@gkd-kit/inspect 0.0.1706116676346 → 0.0.1706369825755
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -32
- package/dist/404.html +4 -4
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-9_eLGhZo.js → ActionCard.vue_vue_type_script_setup_true_lang-UIxiMJWi.js} +3 -3
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-9_eLGhZo.js.map → ActionCard.vue_vue_type_script_setup_true_lang-UIxiMJWi.js.map} +1 -1
- package/dist/assets/{DevicePage-4byZ6B5z.js → DevicePage-r13tj4m4.js} +2 -2
- package/dist/assets/{DevicePage-4byZ6B5z.js.map → DevicePage-r13tj4m4.js.map} +1 -1
- package/dist/assets/{HomePage-KDDcOPLS.js → HomePage-JttdzTBj.js} +2 -2
- package/dist/assets/{HomePage-KDDcOPLS.js.map → HomePage-JttdzTBj.js.map} +1 -1
- package/dist/assets/ImportPage-b3zEQAkz.js +2 -0
- package/dist/assets/{ImportPage-W-1D-WES.js.map → ImportPage-b3zEQAkz.js.map} +1 -1
- package/dist/assets/{SnapshotPage-hxCFbph8.js → SnapshotPage-qvOfZQKW.js} +7 -7
- package/dist/assets/{SnapshotPage-hxCFbph8.js.map → SnapshotPage-qvOfZQKW.js.map} +1 -1
- package/dist/assets/_404Page-vbEw2Mmt.js +2 -0
- package/dist/assets/{_404Page-lFRlMNzr.js.map → _404Page-vbEw2Mmt.js.map} +1 -1
- package/dist/assets/{import-5-DKu0CC.js → import-VNDjsG2f.js} +2 -2
- package/dist/assets/{import-5-DKu0CC.js.map → import-VNDjsG2f.js.map} +1 -1
- package/dist/assets/index-jgJeJAgI.js +17 -0
- package/dist/assets/{index-SCqJE-Ih.js.map → index-jgJeJAgI.js.map} +1 -1
- package/dist/assets/{index-jn0Kv5Ef.js → index-zSKZ1mAi.js} +9 -9
- package/dist/assets/index-zSKZ1mAi.js.map +1 -0
- package/dist/assets/{jszip.min-NsI9wJYU.js → jszip.min-YOVIGqu7.js} +2 -2
- package/dist/assets/{jszip.min-NsI9wJYU.js.map → jszip.min-YOVIGqu7.js.map} +1 -1
- package/dist/assets/{node-5N63euF6.js → node-zQ0XCqY4.js} +4 -4
- package/dist/assets/{node-5N63euF6.js.map → node-zQ0XCqY4.js.map} +1 -1
- package/dist/assets/storage-386vu-oU.js +337 -0
- package/dist/assets/{storage-VxZG8zDv.js.map → storage-386vu-oU.js.map} +1 -1
- package/dist/assets/{table-QIAdp1c_.js → table-dF9-SO3H.js} +2 -2
- package/dist/assets/{table-QIAdp1c_.js.map → table-dF9-SO3H.js.map} +1 -1
- package/dist/index.html +4 -4
- package/package.json +1 -1
- package/dist/assets/ImportPage-W-1D-WES.js +0 -2
- package/dist/assets/_404Page-lFRlMNzr.js +0 -2
- package/dist/assets/index-SCqJE-Ih.js +0 -17
- package/dist/assets/index-jn0Kv5Ef.js.map +0 -1
- package/dist/assets/storage-VxZG8zDv.js +0 -337
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as z5,e as G5,f as $5}from"./ActionCard.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as z5,e as G5,f as $5}from"./ActionCard.vue_vue_type_script_setup_true_lang-UIxiMJWi.js";import{f as Sy,c as Js,m as ca,b as U5,g as ME,e as yA,h as My,i as to,j as ro,k as _e,a as CE,l as j5,n as W5}from"./storage-386vu-oU.js";import{_ as vv,d as Vr,p as Ot,q as ur,v as Ba,x as er,y as dr,z as $r,A as Nc,B as X5,C as d1,D as Y5,E as Pc,G as h1,H as Tn,c as Dr,I as Xl,J as v1,K as p1,L as Gn,M as V5,O as kr,P as mA,Q as bA,S as xA,T as H5,U as ti,V as wu,W as K5,X as AE,Y as wA,Z as q5,$ as yo,a0 as Z5,a1 as Q5,a2 as J5,a3 as eB,a4 as tB,a5 as s0,a6 as rB,a7 as nB,a8 as u0,a9 as iB,aa as aB,ab as oB,ac as EA,ad as sB,w as fs,e as vl,ae as l0,af as TE,ag as gf,ah as IE,ai as Pf,a as _A,s as On,aj as pv,ak as ii,h as Ar,al as SA,am as Cy,an as uB,ao as lB,o as Lr,g as Lt,b as Vt,u as vt,f as bi,ap as $h,F as Hf,m as Hn,n as Ra,l as xn,i as MA,j as fB,k as Yu,aq as OE,ar as cB,N as dB}from"./index-zSKZ1mAi.js";import{e as Rf,h as gv,C as hB,f as vB,g as pB,i as gB,V as yB,j as mB,k as LE,l as bB,m as kE,n as xB,d as pl,o as eu,p as wB,c as DE,q as NE,r as EB,N as _B,a as SB,s as Uh,t as MB,v as PE,w as RE,x as CB}from"./node-zQ0XCqY4.js";import{e as BE,p as AB,a as TB,l as IB,u as OB}from"./index-jgJeJAgI.js";import"./jszip.min-YOVIGqu7.js";function LB(r,t){for(var e=0;e<t.length;e++){const n=t[e];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(r,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const g1=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return wa},get Circle(){return hV},get Ellipse(){return vV},get Image(){return pV},get Line(){return gV},get Marker(){return mV},get Path(){return vb},get Polygon(){return MV},get Polyline(){return CV},get Rect(){return IV},get Text(){return OV}},Symbol.toStringTag,{value:"Module"})),y1=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return na},get Circle(){return NV},get Dom(){return PV},get Ellipse(){return RV},get Image(){return BV},get Line(){return FV},get Marker(){return zV},get Path(){return GV},get Polygon(){return $V},get Polyline(){return UV},get Rect(){return WV},get Text(){return HV}},Symbol.toStringTag,{value:"Module"}));function CA(r){return typeof r=="string"?`s-${r}`:`n-${r}`}function Ay(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function kB(r,t){if(r){if(typeof r=="string")return Ay(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Ay(r,t)}}function ma(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function DB(r,t){if(vv(r)!=="object"||r===null)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var n=e.call(r,t||"default");if(vv(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function AA(r){var t=DB(r,"string");return vv(t)==="symbol"?t:String(t)}function FE(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,AA(n.key),n)}}function ba(r,t,e){return t&&FE(r.prototype,t),e&&FE(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function at(r,t,e){return t=AA(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}const NB=Vr({name:"ChevronLeft",render(){return Ot("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ot("path",{d:"M10.3536 3.14645C10.5488 3.34171 10.5488 3.65829 10.3536 3.85355L6.20711 8L10.3536 12.1464C10.5488 12.3417 10.5488 12.6583 10.3536 12.8536C10.1583 13.0488 9.84171 13.0488 9.64645 12.8536L5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L9.64645 3.14645C9.84171 2.95118 10.1583 2.95118 10.3536 3.14645Z",fill:"currentColor"}))}}),PB=Vr({name:"Switcher",render(){return Ot("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Ot("path",{d:"M12 8l10 8l-10 8z"}))}}),nn="0!important",TA="-1px!important";function Vu(r){return dr(r+"-type",[er("& +",[ur("button",{},[dr(r+"-type",[$r("border",{borderLeftWidth:nn}),$r("state-border",{left:TA})])])])])}function Hu(r){return dr(r+"-type",[er("& +",[ur("button",[dr(r+"-type",[$r("border",{borderTopWidth:nn}),$r("state-border",{top:TA})])])])])}const RB=ur("button-group",`
|
|
2
2
|
flex-wrap: nowrap;
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
position: relative;
|
|
@@ -253,7 +253,7 @@ import{_ as z5,e as G5,f as $5}from"./ActionCard.vue_vue_type_script_setup_true_
|
|
|
253
253
|
max-width: 100%;
|
|
254
254
|
`),$r("suffix",`
|
|
255
255
|
display: inline-flex;
|
|
256
|
-
`)]),$r("empty","margin: auto;")]);var g4=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(f){try{l(n.next(f))}catch(c){o(c)}}function u(f){try{l(n.throw(f))}catch(c){o(c)}}function l(f){f.done?a(f.value):i(f.value).then(s,u)}l((n=n.apply(r,t||[])).next())})};function y4(r,t,e,n){return{getIsGroup(){return!1},getKey(a){return a[r]},getChildren:n||(a=>a[t]),getDisabled(a){return!!(a[e]||a.checkboxDisabled)}}}const m4={allowCheckingNotLoaded:Boolean,filter:Function,defaultExpandAll:Boolean,expandedKeys:Array,keyField:{type:String,default:"key"},labelField:{type:String,default:"label"},childrenField:{type:String,default:"children"},disabledField:{type:String,default:"disabled"},defaultExpandedKeys:{type:Array,default:()=>[]},indeterminateKeys:Array,renderSwitcherIcon:Function,onUpdateIndeterminateKeys:[Function,Array],"onUpdate:indeterminateKeys":[Function,Array],onUpdateExpandedKeys:[Function,Array],"onUpdate:expandedKeys":[Function,Array],overrideDefaultNodeClickBehavior:Function},b4=Object.assign(Object.assign(Object.assign(Object.assign({},Xl.props),{accordion:Boolean,showIrrelevantNodes:{type:Boolean,default:!0},data:{type:Array,default:()=>[]},expandOnDragenter:{type:Boolean,default:!0},expandOnClick:Boolean,checkOnClick:{type:[Boolean,Function],default:!1},cancelable:{type:Boolean,default:!0},checkable:Boolean,draggable:Boolean,blockNode:Boolean,blockLine:Boolean,showLine:Boolean,disabled:Boolean,checkedKeys:Array,defaultCheckedKeys:{type:Array,default:()=>[]},selectedKeys:Array,defaultSelectedKeys:{type:Array,default:()=>[]},multiple:Boolean,pattern:{type:String,default:""},onLoad:Function,cascade:Boolean,selectable:{type:Boolean,default:!0},scrollbarProps:Object,indent:{type:Number,default:24},allowDrop:{type:Function,default:u4},animated:{type:Boolean,default:!0},checkboxPlacement:{type:String,default:"left"},virtualScroll:Boolean,watchProps:Array,renderLabel:Function,renderPrefix:Function,renderSuffix:Function,nodeProps:Function,keyboard:{type:Boolean,default:!0},getChildren:Function,onDragenter:[Function,Array],onDragleave:[Function,Array],onDragend:[Function,Array],onDragstart:[Function,Array],onDragover:[Function,Array],onDrop:[Function,Array],onUpdateCheckedKeys:[Function,Array],"onUpdate:checkedKeys":[Function,Array],onUpdateSelectedKeys:[Function,Array],"onUpdate:selectedKeys":[Function,Array]}),m4),{internalTreeSelect:Boolean,internalScrollable:Boolean,internalScrollablePadding:String,internalRenderEmpty:Function,internalHighlightKeySet:Object,internalUnifySelectCheck:Boolean,internalCheckboxFocusable:{type:Boolean,default:!0},internalFocusable:{type:Boolean,default:!0},checkStrategy:{type:String,default:"all"},leafOnly:Boolean}),x4=Vr({name:"Tree",props:b4,setup(r){const{mergedClsPrefixRef:t,inlineThemeDisabled:e,mergedRtlRef:n}=Nc(r),i=Pc("Tree",n,t),a=Xl("Tree","-tree",p4,t4,r,t),o=Tn(null),s=Tn(null),u=Tn(null);function l(){var ue;return(ue=u.value)===null||ue===void 0?void 0:ue.listElRef}function f(){var ue;return(ue=u.value)===null||ue===void 0?void 0:ue.itemsElRef}const c=Dr(()=>{const{filter:ue}=r;if(ue)return ue;const{labelField:ve}=r;return(Ze,ct)=>{if(!Ze.length)return!0;const St=ct[ve];return typeof St=="string"?St.toLowerCase().includes(Ze.toLowerCase()):!1}}),d=Dr(()=>{const{pattern:ue}=r;return ue?!ue.length||!c.value?{filteredTree:r.data,highlightKeySet:null,expandedKeys:void 0}:c4(r.data,c.value,ue,r.keyField,r.childrenField):{filteredTree:r.data,highlightKeySet:null,expandedKeys:void 0}}),h=Dr(()=>mB(r.showIrrelevantNodes?r.data:d.value.filteredTree,y4(r.keyField,r.childrenField,r.disabledField,r.getChildren))),v=wu(DA,null),p=r.internalTreeSelect?v.dataTreeMate:h,{watchProps:g}=r,y=Tn([]);g!=null&&g.includes("defaultCheckedKeys")?fs(()=>{y.value=r.defaultCheckedKeys}):y.value=r.defaultCheckedKeys;const m=kr(r,"checkedKeys"),b=Rf(m,y),x=Dr(()=>p.value.getCheckedKeys(b.value,{cascade:r.cascade,allowNotLoaded:r.allowCheckingNotLoaded})),w=l4(r),E=Dr(()=>x.value.checkedKeys),_=Dr(()=>{const{indeterminateKeys:ue}=r;return ue!==void 0?ue:x.value.indeterminateKeys}),M=Tn([]);g!=null&&g.includes("defaultSelectedKeys")?fs(()=>{M.value=r.defaultSelectedKeys}):M.value=r.defaultSelectedKeys;const C=kr(r,"selectedKeys"),S=Rf(C,M),A=Tn([]),T=ue=>{A.value=r.defaultExpandAll?p.value.getNonLeafKeys():ue===void 0?r.defaultExpandedKeys:ue};g!=null&&g.includes("defaultExpandedKeys")?fs(()=>{T(void 0)}):fs(()=>{T(r.defaultExpandedKeys)});const I=kr(r,"expandedKeys"),k=Rf(I,A),P=Dr(()=>h.value.getFlattenedNodes(k.value)),{pendingNodeKeyRef:N,handleKeydown:z}=h4({props:r,mergedCheckedKeysRef:b,mergedSelectedKeysRef:S,fNodesRef:P,mergedExpandedKeysRef:k,handleCheck:Er,handleSelect:Br,handleSwitcherClick:ir});let W=null,D=null;const R=Tn(new Set),H=Dr(()=>r.internalHighlightKeySet||d.value.highlightKeySet),ee=Rf(H,R),Y=Tn(new Set),X=Dr(()=>k.value.filter(ue=>!Y.value.has(ue)));let fe=0;const we=Tn(null),Ae=Tn(null),Ke=Tn(null),ot=Tn(null),nt=Tn(0),Ct=Dr(()=>{const{value:ue}=Ae;return ue?ue.parent:null});let Et=!1;vl(kr(r,"data"),()=>{Et=!0,Pf(()=>{Et=!1}),Y.value.clear(),N.value=null,Pt()},{deep:!1});let fr=!1;const Gt=()=>{fr=!0,Pf(()=>{fr=!1})};let jt;vl(kr(r,"pattern"),(ue,ve)=>{if(r.showIrrelevantNodes)if(jt=void 0,ue){const{expandedKeys:Ze,highlightKeySet:ct}=f4(r.data,r.pattern,r.keyField,r.childrenField,c.value);R.value=ct,Gt(),Se(Ze,L(Ze),{node:null,action:"filter"})}else R.value=new Set;else if(!ue.length)jt!==void 0&&(Gt(),Se(jt,L(jt),{node:null,action:"filter"}));else{ve.length||(jt=k.value);const{expandedKeys:Ze}=d.value;Ze!==void 0&&(Gt(),Se(Ze,L(Ze),{node:null,action:"filter"}))}});function Sr(ue){return g4(this,void 0,void 0,function*(){const{onLoad:ve}=r;if(!ve){yield Promise.resolve();return}const{value:Ze}=Y;if(!Ze.has(ue.key)){Ze.add(ue.key);try{(yield ve(ue.rawNode))===!1&&Mr()}catch(ct){console.error(ct),Mr()}Ze.delete(ue.key)}})}fs(()=>{var ue;const{value:ve}=h;if(!ve)return;const{getNode:Ze}=ve;(ue=k.value)===null||ue===void 0||ue.forEach(ct=>{const St=Ze(ct);St&&!St.shallowLoaded&&Sr(St)})});const rr=Tn(!1),Rt=Tn([]);vl(X,(ue,ve)=>{if(!r.animated||fr){Pf(et);return}if(Et)return;const Ze=gf(a.value.self.nodeHeight),ct=new Set(ve);let St=null,Tr=null;for(const Or of ue)if(!ct.has(Or)){if(St!==null)return;St=Or}const zr=new Set(ue);for(const Or of ve)if(!zr.has(Or)){if(Tr!==null)return;Tr=Or}if(St===null&&Tr===null)return;const{virtualScroll:qr}=r,Zn=(qr?u.value.listElRef:o.value).offsetHeight,Qn=Math.ceil(Zn/Ze)+1;let Jn;if(St!==null&&(Jn=ve),Tr!==null&&(Jn===void 0?Jn=ue:Jn=Jn.filter(Or=>Or!==Tr)),rr.value=!0,Rt.value=h.value.getFlattenedNodes(Jn),St!==null){const Or=Rt.value.findIndex(ei=>ei.key===St);if(~Or){const ei=Rt.value[Or].children;if(ei){const fi=LE(ei,ue);Rt.value.splice(Or+1,0,{__motion:!0,mode:"expand",height:qr?fi.length*Ze:void 0,nodes:qr?fi.slice(0,Qn):fi})}}}if(Tr!==null){const Or=Rt.value.findIndex(ei=>ei.key===Tr);if(~Or){const ei=Rt.value[Or].children;if(!ei)return;rr.value=!0;const fi=LE(ei,ue);Rt.value.splice(Or+1,0,{__motion:!0,mode:"collapse",height:qr?fi.length*Ze:void 0,nodes:qr?fi.slice(0,Qn):fi})}}});const sr=Dr(()=>bB(P.value)),Hr=Dr(()=>rr.value?Rt.value:P.value);function et(){const{value:ue}=s;ue&&ue.sync()}function ie(){rr.value=!1,r.virtualScroll&&Pf(et)}function L(ue){const{getNode:ve}=p.value;return ue.map(Ze=>{var ct;return((ct=ve(Ze))===null||ct===void 0?void 0:ct.rawNode)||null})}function Se(ue,ve,Ze){const{"onUpdate:expandedKeys":ct,onUpdateExpandedKeys:St}=r;A.value=ue,ct&&Gn(ct,ue,ve,Ze),St&&Gn(St,ue,ve,Ze)}function Pe(ue,ve,Ze){const{"onUpdate:checkedKeys":ct,onUpdateCheckedKeys:St}=r;y.value=ue,St&&Gn(St,ue,ve,Ze),ct&&Gn(ct,ue,ve,Ze)}function me(ue,ve){const{"onUpdate:indeterminateKeys":Ze,onUpdateIndeterminateKeys:ct}=r;Ze&&Gn(Ze,ue,ve),ct&&Gn(ct,ue,ve)}function je(ue,ve,Ze){const{"onUpdate:selectedKeys":ct,onUpdateSelectedKeys:St}=r;M.value=ue,St&&Gn(St,ue,ve,Ze),ct&&Gn(ct,ue,ve,Ze)}function Xe(ue){const{onDragenter:ve}=r;ve&&Gn(ve,ue)}function qe(ue){const{onDragleave:ve}=r;ve&&Gn(ve,ue)}function tt(ue){const{onDragend:ve}=r;ve&&Gn(ve,ue)}function yt(ue){const{onDragstart:ve}=r;ve&&Gn(ve,ue)}function Ut(ue){const{onDragover:ve}=r;ve&&Gn(ve,ue)}function gr(ue){const{onDrop:ve}=r;ve&&Gn(ve,ue)}function Pt(){wr(),Zt()}function wr(){we.value=null}function Zt(){nt.value=0,Ae.value=null,Ke.value=null,ot.value=null,Mr()}function Mr(){W&&(window.clearTimeout(W),W=null),D=null}function Er(ue,ve){if(r.disabled||rs(ue,r.disabledField))return;if(r.internalUnifySelectCheck&&!r.multiple){Br(ue);return}const Ze=ve?"check":"uncheck",{checkedKeys:ct,indeterminateKeys:St}=p.value[Ze](ue.key,E.value,{cascade:r.cascade,checkStrategy:w.value,allowNotLoaded:r.allowCheckingNotLoaded});Pe(ct,L(ct),{node:ue.rawNode,action:Ze}),me(St,L(St))}function vn(ue){if(r.disabled)return;const{key:ve}=ue,{value:Ze}=k,ct=Ze.findIndex(St=>St===ve);if(~ct){const St=Array.from(Ze);St.splice(ct,1),Se(St,L(St),{node:ue.rawNode,action:"collapse"})}else{const St=h.value.getNode(ve);if(!St||St.isLeaf)return;let Tr;if(r.accordion){const zr=new Set(ue.siblings.map(({key:qr})=>qr));Tr=Ze.filter(qr=>!zr.has(qr)),Tr.push(ve)}else Tr=Ze.concat(ve);Se(Tr,L(Tr),{node:ue.rawNode,action:"expand"})}}function ir(ue){r.disabled||rr.value||vn(ue)}function Br(ue){if(!(r.disabled||!r.selectable)){if(N.value=ue.key,r.internalUnifySelectCheck){const{value:{checkedKeys:ve,indeterminateKeys:Ze}}=x;r.multiple?Er(ue,!(ve.includes(ue.key)||Ze.includes(ue.key))):Pe([ue.key],L([ue.key]),{node:ue.rawNode,action:"check"})}if(r.multiple){const ve=Array.from(S.value),Ze=ve.findIndex(ct=>ct===ue.key);~Ze?r.cancelable&&ve.splice(Ze,1):~Ze||ve.push(ue.key),je(ve,L(ve),{node:ue.rawNode,action:~Ze?"unselect":"select"})}else S.value.includes(ue.key)?r.cancelable&&je([],[],{node:ue.rawNode,action:"unselect"}):je([ue.key],L([ue.key]),{node:ue.rawNode,action:"select"})}}function ui(ue){if(W&&(window.clearTimeout(W),W=null),ue.isLeaf)return;D=ue.key;const ve=()=>{if(D!==ue.key)return;const{value:Ze}=Ke;if(Ze&&Ze.key===ue.key&&!k.value.includes(ue.key)){const ct=k.value.concat(ue.key);Se(ct,L(ct),{node:ue.rawNode,action:"expand"})}W=null,D=null};ue.shallowLoaded?W=window.setTimeout(()=>{ve()},1e3):W=window.setTimeout(()=>{Sr(ue).then(()=>{ve()})},1e3)}function Kr({event:ue,node:ve}){!r.draggable||r.disabled||rs(ve,r.disabledField)||(pi({event:ue,node:ve},!1),Xe({event:ue,node:ve.rawNode}))}function $i({event:ue,node:ve}){!r.draggable||r.disabled||rs(ve,r.disabledField)||qe({event:ue,node:ve.rawNode})}function lo(ue){ue.target===ue.currentTarget&&Zt()}function fo({event:ue,node:ve}){Pt(),!(!r.draggable||r.disabled||rs(ve,r.disabledField))&&tt({event:ue,node:ve.rawNode})}function on({event:ue,node:ve}){!r.draggable||r.disabled||rs(ve,r.disabledField)||(fe=ue.clientX,we.value=ve,yt({event:ue,node:ve.rawNode}))}function pi({event:ue,node:ve},Ze=!0){var ct;if(!r.draggable||r.disabled||rs(ve,r.disabledField))return;const{value:St}=we;if(!St)return;const{allowDrop:Tr,indent:zr}=r;Ze&&Ut({event:ue,node:ve.rawNode});const qr=ue.currentTarget,{height:Zn,top:Qn}=qr.getBoundingClientRect(),Jn=ue.clientY-Qn;let Or;Tr({node:ve.rawNode,dropPosition:"inside",phase:"drag"})?Jn<=8?Or="before":Jn>=Zn-8?Or="after":Or="inside":Jn<=Zn/2?Or="before":Or="after";const{value:fi}=sr;let Ir,pn;const Sa=fi(ve.key);if(Sa===null){Zt();return}let Wo=!1;Or==="inside"?(Ir=ve,pn="inside"):Or==="before"?ve.isFirstChild?(Ir=ve,pn="before"):(Ir=P.value[Sa-1],pn="after"):(Ir=ve,pn="after"),!Ir.isLeaf&&k.value.includes(Ir.key)&&(Wo=!0,pn==="after"&&(Ir=P.value[Sa+1],Ir?pn="before":(Ir=ve,pn="inside")));const Tu=Ir;if(Ke.value=Tu,!Wo&&St.isLastChild&&St.key===Ir.key&&(pn="after"),pn==="after"){let Iu=fe-ue.clientX,Os=0;for(;Iu>=zr/2&&Ir.parent!==null&&Ir.isLastChild&&Os<1;)Iu-=zr,Os+=1,Ir=Ir.parent;nt.value=Os}else nt.value=0;if((St.contains(Ir)||pn==="inside"&&((ct=St.parent)===null||ct===void 0?void 0:ct.key)===Ir.key)&&!(St.key===Tu.key&&St.key===Ir.key)){Zt();return}if(!Tr({node:Ir.rawNode,dropPosition:pn,phase:"drag"})){Zt();return}if(St.key===Ir.key)Mr();else if(D!==Ir.key)if(pn==="inside"){if(r.expandOnDragenter){if(ui(Ir),!Ir.shallowLoaded&&D!==Ir.key){Pt();return}}else if(!Ir.shallowLoaded){Pt();return}}else Mr();else pn!=="inside"&&Mr();ot.value=pn,Ae.value=Ir}function ia({event:ue,node:ve,dropPosition:Ze}){if(!r.draggable||r.disabled||rs(ve,r.disabledField))return;const{value:ct}=we,{value:St}=Ae,{value:Tr}=ot;if(!(!ct||!St||!Tr)&&r.allowDrop({node:St.rawNode,dropPosition:Tr,phase:"drag"})&&ct.key!==St.key){if(Tr==="before"){const zr=ct.getNext({includeDisabled:!0});if(zr&&zr.key===St.key){Zt();return}}if(Tr==="after"){const zr=ct.getPrev({includeDisabled:!0});if(zr&&zr.key===St.key){Zt();return}}gr({event:ue,node:St.rawNode,dragNode:ct.rawNode,dropPosition:Ze}),Pt()}}function co(){et()}function ho(){et()}function vo(ue){var ve;if(r.virtualScroll||r.internalScrollable){const{value:Ze}=s;if(!((ve=Ze==null?void 0:Ze.containerRef)===null||ve===void 0)&&ve.contains(ue.relatedTarget))return;N.value=null}else{const{value:Ze}=o;if(Ze!=null&&Ze.contains(ue.relatedTarget))return;N.value=null}}vl(N,ue=>{var ve,Ze;if(ue!==null){if(r.virtualScroll)(ve=u.value)===null||ve===void 0||ve.scrollTo({key:ue});else if(r.internalScrollable){const{value:ct}=s;if(ct===null)return;const St=(Ze=ct.contentRef)===null||Ze===void 0?void 0:Ze.querySelector(`[data-key="${CA(ue)}"]`);if(!St)return;ct.scrollTo({el:St})}}}),d1(Rc,{loadingKeysRef:Y,highlightKeySetRef:ee,displayedCheckedKeysRef:E,displayedIndeterminateKeysRef:_,mergedSelectedKeysRef:S,mergedExpandedKeysRef:k,mergedThemeRef:a,mergedCheckStrategyRef:w,nodePropsRef:kr(r,"nodeProps"),disabledRef:kr(r,"disabled"),checkableRef:kr(r,"checkable"),selectableRef:kr(r,"selectable"),expandOnClickRef:kr(r,"expandOnClick"),onLoadRef:kr(r,"onLoad"),draggableRef:kr(r,"draggable"),blockLineRef:kr(r,"blockLine"),indentRef:kr(r,"indent"),cascadeRef:kr(r,"cascade"),checkOnClickRef:kr(r,"checkOnClick"),checkboxPlacementRef:r.checkboxPlacement,droppingMouseNodeRef:Ke,droppingNodeParentRef:Ct,draggingNodeRef:we,droppingPositionRef:ot,droppingOffsetLevelRef:nt,fNodesRef:P,pendingNodeKeyRef:N,showLineRef:kr(r,"showLine"),disabledFieldRef:kr(r,"disabledField"),internalScrollableRef:kr(r,"internalScrollable"),internalCheckboxFocusableRef:kr(r,"internalCheckboxFocusable"),internalTreeSelect:r.internalTreeSelect,renderLabelRef:kr(r,"renderLabel"),renderPrefixRef:kr(r,"renderPrefix"),renderSuffixRef:kr(r,"renderSuffix"),renderSwitcherIconRef:kr(r,"renderSwitcherIcon"),labelFieldRef:kr(r,"labelField"),multipleRef:kr(r,"multiple"),overrideDefaultNodeClickBehaviorRef:kr(r,"overrideDefaultNodeClickBehavior"),handleSwitcherClick:ir,handleDragEnd:fo,handleDragEnter:Kr,handleDragLeave:$i,handleDragStart:on,handleDrop:ia,handleDragOver:pi,handleSelect:Br,handleCheck:Er});function li(ue,ve){var Ze,ct;typeof ue=="number"?(Ze=u.value)===null||Ze===void 0||Ze.scrollTo(ue,ve||0):(ct=u.value)===null||ct===void 0||ct.scrollTo(ue)}const jr={handleKeydown:z,scrollTo:li,getCheckedData:()=>{if(!r.checkable)return{keys:[],options:[]};const{checkedKeys:ue}=x.value;return{keys:ue,options:L(ue)}},getIndeterminateData:()=>{if(!r.checkable)return{keys:[],options:[]};const{indeterminateKeys:ue}=x.value;return{keys:ue,options:L(ue)}}},qn=Dr(()=>{const{common:{cubicBezierEaseInOut:ue},self:{fontSize:ve,nodeBorderRadius:Ze,nodeColorHover:ct,nodeColorPressed:St,nodeColorActive:Tr,arrowColor:zr,loadingColor:qr,nodeTextColor:Zn,nodeTextColorDisabled:Qn,dropMarkColor:Jn,nodeWrapperPadding:Or,nodeHeight:ei,lineHeight:fi,lineColor:Ir}}=a.value,pn=l0(Or,"top"),Sa=l0(Or,"bottom"),Wo=EA(gf(ei)-gf(pn)-gf(Sa));return{"--n-arrow-color":zr,"--n-loading-color":qr,"--n-bezier":ue,"--n-font-size":ve,"--n-node-border-radius":Ze,"--n-node-color-active":Tr,"--n-node-color-hover":ct,"--n-node-color-pressed":St,"--n-node-text-color":Zn,"--n-node-text-color-disabled":Qn,"--n-drop-mark-color":Jn,"--n-node-wrapper-padding":Or,"--n-line-offset-top":`-${pn}`,"--n-line-offset-bottom":`-${Sa}`,"--n-node-content-height":Wo,"--n-line-height":fi,"--n-line-color":Ir}}),_t=e?v1("tree",void 0,qn,r):void 0;return Object.assign(Object.assign({},jr),{mergedClsPrefix:t,mergedTheme:a,rtlEnabled:i,fNodes:Hr,aip:rr,selfElRef:o,virtualListInstRef:u,scrollbarInstRef:s,handleFocusout:vo,handleDragLeaveTree:lo,handleScroll:co,getScrollContainer:l,getScrollContent:f,handleAfterEnter:ie,handleResize:ho,cssVars:e?void 0:qn,themeClass:_t==null?void 0:_t.themeClass,onRender:_t==null?void 0:_t.onRender})},render(){var r;const{fNodes:t,internalRenderEmpty:e}=this;if(!t.length&&e)return e();const{mergedClsPrefix:n,blockNode:i,blockLine:a,draggable:o,disabled:s,internalFocusable:u,checkable:l,handleKeydown:f,rtlEnabled:c,handleFocusout:d,scrollbarProps:h}=this,v=u&&!s,p=v?"0":void 0,g=[`${n}-tree`,c&&`${n}-tree--rtl`,l&&`${n}-tree--checkable`,(a||i)&&`${n}-tree--block-node`,a&&`${n}-tree--block-line`],y=b=>"__motion"in b?Ot(v4,{height:b.height,nodes:b.nodes,clsPrefix:n,mode:b.mode,onAfterEnter:this.handleAfterEnter}):Ot(PA,{key:b.key,tmNode:b,clsPrefix:n});if(this.virtualScroll){const{mergedTheme:b,internalScrollablePadding:x}=this,w=l0(x||"0");return Ot(IE,Object.assign({},h,{ref:"scrollbarInstRef",onDragleave:o?this.handleDragLeaveTree:void 0,container:this.getScrollContainer,content:this.getScrollContent,class:g,theme:b.peers.Scrollbar,themeOverrides:b.peerOverrides.Scrollbar,tabindex:p,onKeydown:v?f:void 0,onFocusout:v?d:void 0}),{default:()=>{var E;return(E=this.onRender)===null||E===void 0||E.call(this),t.length?Ot(yB,{ref:"virtualListInstRef",items:this.fNodes,itemSize:gf(b.self.nodeHeight),ignoreItemResize:this.aip,paddingTop:w.top,paddingBottom:w.bottom,class:this.themeClass,style:[this.cssVars,{paddingLeft:w.left,paddingRight:w.right}],onScroll:this.handleScroll,onResize:this.handleResize,showScrollbar:!1,itemResizable:!0},{default:({item:_})=>y(_)}):TE(this.$slots.empty,()=>[Ot(kE,{class:`${n}-tree__empty`,theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})])}})}const{internalScrollable:m}=this;return g.push(this.themeClass),(r=this.onRender)===null||r===void 0||r.call(this),m?Ot(IE,Object.assign({},h,{class:g,tabindex:p,onKeydown:v?f:void 0,onFocusout:v?d:void 0,style:this.cssVars,contentStyle:{padding:this.internalScrollablePadding}}),{default:()=>Ot("div",{onDragleave:o?this.handleDragLeaveTree:void 0,ref:"selfElRef"},this.fNodes.map(y))}):Ot("div",{class:g,tabindex:p,ref:"selfElRef",style:this.cssVars,onKeydown:v?f:void 0,onFocusout:v?d:void 0,onDragleave:o?this.handleDragLeaveTree:void 0},t.length?t.map(y):TE(this.$slots.empty,()=>[Ot(kE,{class:`${n}-tree__empty`,theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})]))}}),RA=Vr({__name:"DraggableCard",props:{initialValue:{default:()=>({})}},setup(r){const t=r,e=t.initialValue.left!==void 0,n=t.initialValue.top!==void 0,i={x:(e?t.initialValue.left:t.initialValue.right)??0,y:(n?t.initialValue.top:t.initialValue.bottom)??0},a=_A({...i}),o=Dr(()=>{const y=e?`left:${a.x}px;`:`right:${a.x}px;`,m=n?`top:${a.y}px;`:`bottom:${a.y}px;`;return y+m});let s;const u=y=>{s=y,i.x=a.x,i.y=a.y},l=y=>{if(!d.value||!s)return;const m=y.clientX-s.clientX,b=y.clientY-s.clientY;a.x=i.x+(e?m:-m),a.y=i.y+(n?b:-b)},f=()=>{s=void 0},c=On(),d=On(),h=y=>{s&&y.preventDefault()},v=["transition-top,bottom,left,right-500"],p=()=>{if(!d.value)return;const{top:y,bottom:m,left:b,right:x}=d.value.getBoundingClientRect();if(x<0||b>window.innerWidth||m<0||y>window.innerHeight){a.x=i.x,a.y=i.y,f();const w=c.value;w&&(w.classList.add(...v),setTimeout(()=>{w.classList.remove(...v)},550))}};window.addEventListener("pointermove",l),window.addEventListener("pointerup",p),document.addEventListener("selectstart",h),pv(()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",p),document.removeEventListener("selectstart",h),f()}),vl(d,(y,m)=>{y&&(y.addEventListener("pointerdown",u),y.addEventListener("pointerup",f)),m&&(m.removeEventListener("pointerdown",u),m.removeEventListener("pointerup",f))}),pv(()=>{d.value&&(d.value.removeEventListener("pointerdown",u),d.value.removeEventListener("pointerup",f))});const g=y=>{y instanceof HTMLElement?d.value=y:d.value=void 0};return(y,m)=>(Lr(),ii(lB,{to:"body"},[Ar("div",{fixed:"",ref_key:"box",ref:c,style:Cy([y.$attrs.style,o.value]),class:uB(y.$attrs.class)},[SA(y.$slots,"default",{onRef:g})],6)]))}}),w4=Ar("th",null,"Name",-1),E4=Ar("th",null,"Value",-1),_4=[w4,E4],S4={key:0,flex:"","justify-between":"","items-center":""},M4={key:0,viewBox:"0 0 28 28"},C4=Ar("g",{fill:"none"},[Ar("path",{d:"M15 8a1 1 0 1 1-2 0a1 1 0 0 1 2 0zm-1.75 3.75v7.5a.75.75 0 0 0 1.5 0v-7.5a.75.75 0 0 0-1.5 0zM2 14C2 7.373 7.373 2 14 2s12 5.373 12 12s-5.373 12-12 12S2 20.627 2 14zM14 3.5C8.201 3.5 3.5 8.201 3.5 14S8.201 24.5 14 24.5S24.5 19.799 24.5 14S19.799 3.5 14 3.5z",fill:"currentColor"})],-1),A4=[C4],T4={key:1,viewBox:"0 0 1024 1024"},I4=Ar("path",{d:"M722.500267 330.888533l-273.408 273.408-147.729067-147.729066a42.018133 42.018133 0 1 0-59.426133 59.426133l177.425066 177.493333a41.984 41.984 0 0 0 59.426134 0L781.9264 390.314667a42.001067 42.001067 0 0 0-59.392-59.426134h-0.034133zM78.506667 783.496533a508.279467 508.279467 0 0 0 319.0784 226.986667C530.773333 1041.066667 667.886933 1017.924267 783.701333 945.390933a508.279467 508.279467 0 0 0 226.986667-319.0784 508.279467 508.279467 0 0 0-65.058133-386.116266C848.554667 85.367467 681.710933 0.341333 511.214933 0.341333a508.6208 508.6208 0 0 0-270.813866 77.960534A36.864 36.864 0 0 0 279.552 140.629333C484.113067 12.288 755.029333 74.581333 883.268267 279.278933a434.9952 434.9952 0 0 1 55.739733 330.5472 435.029333 435.029333 0 0 1-194.3552 273.134934 435.746133 435.746133 0 0 1-330.581333 55.773866A435.165867 435.165867 0 0 1 140.936533 744.379733a436.770133 436.770133 0 0 1-5.666133-456.055466 36.829867 36.829867 0 0 0-63.317333-37.546667A510.1568 510.1568 0 0 0 78.506667 783.530667v-0.034134z"},null,-1),O4=[I4],L4=Vr({__name:"AttrCard",props:{focusNode:{}},setup(r){const t=r,e=["text","desc"],n=Dr(()=>Object.entries(t.focusNode.attr).map(([o,s])=>{const u={name:o,value:JSON.stringify(s)};return e.includes(o)?[u,{name:o+".length",value:JSON.stringify((s==null?void 0:s.length)??null)}]:u}).flat()),i={_id:"虚拟属性(真机不可用):生成快照访问节点顺序",_pid:"虚拟属性(真机不可用):父节点的 _id",depth:"使用此属性在某些应用上可能造成无限节点错误",id:"可快速查找",vid:"可快速查找",text:"可快速查找"},a=["id","vid","text"];return(o,s)=>(Lr(),ii(RA,{initialValue:{top:75,right:10}},{default:Lt(({onRef:u})=>[Vt(vt(LA),{size:"small",striped:"",singleLine:!1,class:"gkd_code",themeOverrides:{thPaddingSmall:"1px 3px",tdPaddingSmall:"1px 3px"}},{default:Lt(()=>[Ar("thead",null,[Ar("tr",{ref:u,"cursor-move":""},_4,512)]),Vt(vt(kA),null,{default:Lt(()=>[(Lr(!0),bi(Hf,null,$h(n.value,l=>(Lr(),ii(vt(Ty),{key:l.name},{default:Lt(()=>[Vt(vt(Mo),{onClick:f=>vt(Js)(`${l.name}=${l.value}`)},{default:Lt(()=>[l.name in i?(Lr(),bi("div",S4,[Ar("div",null,Hn(l.name),1),Vt(vt(xB),null,{trigger:Lt(()=>[Vt(vt(pl),{size:"16"},{default:Lt(()=>[a.includes(l.name)?(o.focusNode.quickFind||l.name=="id"&&o.focusNode.idQf||l.name=="vid"&&o.focusNode.idQf||l.name=="text"&&o.focusNode.textQf)&&JSON.parse(l.value)?(Lr(),bi("svg",T4,O4)):Ra("",!0):(Lr(),bi("svg",M4,A4))]),_:2},1024)]),default:Lt(()=>[xn(" "+Hn(i[l.name]),1)]),_:2},1024)])):(Lr(),bi(Hf,{key:1},[xn(Hn(l.name),1)],64))]),_:2},1032,["onClick"]),Vt(vt(Mo),null,{default:Lt(()=>[l.name=="id"?(Lr(),ii(vt(eu),{key:0,style:{width:"180px","min-width":"max(12vw, 180px)",direction:"rtl","text-align":"left"}},{default:Lt(()=>[xn(Hn(l.value),1)]),_:2},1024)):(Lr(),ii(vt(eu),{key:1,style:{width:"180px","min-width":"max(12vw, 180px)"}},{default:Lt(()=>[xn(Hn(l.value),1)]),_:2},1024))]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:2},1024)]),_:1}))}}),k4={flex:"","flex-col":"",relative:"","h-full":""},D4=["src"],N4=Ar("div",{absolute:"","left-0":"","top-0":"","bottom-0":"","right-0":"","b-solid":"","b-1px":"","b-red":""},null,-1),P4=[N4],R4={class:"left-[calc(100%+4px)]",absolute:"","top-0":"","overflow-hidden":"","z-1":"","bg-white":"","h-200px":"","w-200px":"","border-1px":"","border-indigo-600":"","border-dashed":""},B4=["src"],F4={absolute:"","left-2px":"","top-2px":"",class:"leading-[1]",style:{"background-color":"rgba(256, 256, 256, 0.7)"}},z4=Ar("div",{class:"top-[calc(50%-1px)]",absolute:"","left-0":"","right-0":"","h-1px":"","bg-repeat-x":"","mix-blend-difference":"",style:{background:`linear-gradient(
|
|
256
|
+
`)]),$r("empty","margin: auto;")]);var g4=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(f){try{l(n.next(f))}catch(c){o(c)}}function u(f){try{l(n.throw(f))}catch(c){o(c)}}function l(f){f.done?a(f.value):i(f.value).then(s,u)}l((n=n.apply(r,t||[])).next())})};function y4(r,t,e,n){return{getIsGroup(){return!1},getKey(a){return a[r]},getChildren:n||(a=>a[t]),getDisabled(a){return!!(a[e]||a.checkboxDisabled)}}}const m4={allowCheckingNotLoaded:Boolean,filter:Function,defaultExpandAll:Boolean,expandedKeys:Array,keyField:{type:String,default:"key"},labelField:{type:String,default:"label"},childrenField:{type:String,default:"children"},disabledField:{type:String,default:"disabled"},defaultExpandedKeys:{type:Array,default:()=>[]},indeterminateKeys:Array,renderSwitcherIcon:Function,onUpdateIndeterminateKeys:[Function,Array],"onUpdate:indeterminateKeys":[Function,Array],onUpdateExpandedKeys:[Function,Array],"onUpdate:expandedKeys":[Function,Array],overrideDefaultNodeClickBehavior:Function},b4=Object.assign(Object.assign(Object.assign(Object.assign({},Xl.props),{accordion:Boolean,showIrrelevantNodes:{type:Boolean,default:!0},data:{type:Array,default:()=>[]},expandOnDragenter:{type:Boolean,default:!0},expandOnClick:Boolean,checkOnClick:{type:[Boolean,Function],default:!1},cancelable:{type:Boolean,default:!0},checkable:Boolean,draggable:Boolean,blockNode:Boolean,blockLine:Boolean,showLine:Boolean,disabled:Boolean,checkedKeys:Array,defaultCheckedKeys:{type:Array,default:()=>[]},selectedKeys:Array,defaultSelectedKeys:{type:Array,default:()=>[]},multiple:Boolean,pattern:{type:String,default:""},onLoad:Function,cascade:Boolean,selectable:{type:Boolean,default:!0},scrollbarProps:Object,indent:{type:Number,default:24},allowDrop:{type:Function,default:u4},animated:{type:Boolean,default:!0},checkboxPlacement:{type:String,default:"left"},virtualScroll:Boolean,watchProps:Array,renderLabel:Function,renderPrefix:Function,renderSuffix:Function,nodeProps:Function,keyboard:{type:Boolean,default:!0},getChildren:Function,onDragenter:[Function,Array],onDragleave:[Function,Array],onDragend:[Function,Array],onDragstart:[Function,Array],onDragover:[Function,Array],onDrop:[Function,Array],onUpdateCheckedKeys:[Function,Array],"onUpdate:checkedKeys":[Function,Array],onUpdateSelectedKeys:[Function,Array],"onUpdate:selectedKeys":[Function,Array]}),m4),{internalTreeSelect:Boolean,internalScrollable:Boolean,internalScrollablePadding:String,internalRenderEmpty:Function,internalHighlightKeySet:Object,internalUnifySelectCheck:Boolean,internalCheckboxFocusable:{type:Boolean,default:!0},internalFocusable:{type:Boolean,default:!0},checkStrategy:{type:String,default:"all"},leafOnly:Boolean}),x4=Vr({name:"Tree",props:b4,setup(r){const{mergedClsPrefixRef:t,inlineThemeDisabled:e,mergedRtlRef:n}=Nc(r),i=Pc("Tree",n,t),a=Xl("Tree","-tree",p4,t4,r,t),o=Tn(null),s=Tn(null),u=Tn(null);function l(){var ue;return(ue=u.value)===null||ue===void 0?void 0:ue.listElRef}function f(){var ue;return(ue=u.value)===null||ue===void 0?void 0:ue.itemsElRef}const c=Dr(()=>{const{filter:ue}=r;if(ue)return ue;const{labelField:ve}=r;return(Ze,ct)=>{if(!Ze.length)return!0;const St=ct[ve];return typeof St=="string"?St.toLowerCase().includes(Ze.toLowerCase()):!1}}),d=Dr(()=>{const{pattern:ue}=r;return ue?!ue.length||!c.value?{filteredTree:r.data,highlightKeySet:null,expandedKeys:void 0}:c4(r.data,c.value,ue,r.keyField,r.childrenField):{filteredTree:r.data,highlightKeySet:null,expandedKeys:void 0}}),h=Dr(()=>mB(r.showIrrelevantNodes?r.data:d.value.filteredTree,y4(r.keyField,r.childrenField,r.disabledField,r.getChildren))),v=wu(DA,null),p=r.internalTreeSelect?v.dataTreeMate:h,{watchProps:g}=r,y=Tn([]);g!=null&&g.includes("defaultCheckedKeys")?fs(()=>{y.value=r.defaultCheckedKeys}):y.value=r.defaultCheckedKeys;const m=kr(r,"checkedKeys"),b=Rf(m,y),x=Dr(()=>p.value.getCheckedKeys(b.value,{cascade:r.cascade,allowNotLoaded:r.allowCheckingNotLoaded})),w=l4(r),E=Dr(()=>x.value.checkedKeys),_=Dr(()=>{const{indeterminateKeys:ue}=r;return ue!==void 0?ue:x.value.indeterminateKeys}),M=Tn([]);g!=null&&g.includes("defaultSelectedKeys")?fs(()=>{M.value=r.defaultSelectedKeys}):M.value=r.defaultSelectedKeys;const C=kr(r,"selectedKeys"),S=Rf(C,M),A=Tn([]),T=ue=>{A.value=r.defaultExpandAll?p.value.getNonLeafKeys():ue===void 0?r.defaultExpandedKeys:ue};g!=null&&g.includes("defaultExpandedKeys")?fs(()=>{T(void 0)}):fs(()=>{T(r.defaultExpandedKeys)});const I=kr(r,"expandedKeys"),k=Rf(I,A),P=Dr(()=>h.value.getFlattenedNodes(k.value)),{pendingNodeKeyRef:N,handleKeydown:z}=h4({props:r,mergedCheckedKeysRef:b,mergedSelectedKeysRef:S,fNodesRef:P,mergedExpandedKeysRef:k,handleCheck:Er,handleSelect:Br,handleSwitcherClick:ir});let W=null,D=null;const R=Tn(new Set),H=Dr(()=>r.internalHighlightKeySet||d.value.highlightKeySet),ee=Rf(H,R),Y=Tn(new Set),X=Dr(()=>k.value.filter(ue=>!Y.value.has(ue)));let fe=0;const we=Tn(null),Ae=Tn(null),Ke=Tn(null),ot=Tn(null),nt=Tn(0),Ct=Dr(()=>{const{value:ue}=Ae;return ue?ue.parent:null});let Et=!1;vl(kr(r,"data"),()=>{Et=!0,Pf(()=>{Et=!1}),Y.value.clear(),N.value=null,Pt()},{deep:!1});let fr=!1;const Gt=()=>{fr=!0,Pf(()=>{fr=!1})};let jt;vl(kr(r,"pattern"),(ue,ve)=>{if(r.showIrrelevantNodes)if(jt=void 0,ue){const{expandedKeys:Ze,highlightKeySet:ct}=f4(r.data,r.pattern,r.keyField,r.childrenField,c.value);R.value=ct,Gt(),Se(Ze,L(Ze),{node:null,action:"filter"})}else R.value=new Set;else if(!ue.length)jt!==void 0&&(Gt(),Se(jt,L(jt),{node:null,action:"filter"}));else{ve.length||(jt=k.value);const{expandedKeys:Ze}=d.value;Ze!==void 0&&(Gt(),Se(Ze,L(Ze),{node:null,action:"filter"}))}});function Sr(ue){return g4(this,void 0,void 0,function*(){const{onLoad:ve}=r;if(!ve){yield Promise.resolve();return}const{value:Ze}=Y;if(!Ze.has(ue.key)){Ze.add(ue.key);try{(yield ve(ue.rawNode))===!1&&Mr()}catch(ct){console.error(ct),Mr()}Ze.delete(ue.key)}})}fs(()=>{var ue;const{value:ve}=h;if(!ve)return;const{getNode:Ze}=ve;(ue=k.value)===null||ue===void 0||ue.forEach(ct=>{const St=Ze(ct);St&&!St.shallowLoaded&&Sr(St)})});const rr=Tn(!1),Rt=Tn([]);vl(X,(ue,ve)=>{if(!r.animated||fr){Pf(et);return}if(Et)return;const Ze=gf(a.value.self.nodeHeight),ct=new Set(ve);let St=null,Tr=null;for(const Or of ue)if(!ct.has(Or)){if(St!==null)return;St=Or}const zr=new Set(ue);for(const Or of ve)if(!zr.has(Or)){if(Tr!==null)return;Tr=Or}if(St===null&&Tr===null)return;const{virtualScroll:qr}=r,Zn=(qr?u.value.listElRef:o.value).offsetHeight,Qn=Math.ceil(Zn/Ze)+1;let Jn;if(St!==null&&(Jn=ve),Tr!==null&&(Jn===void 0?Jn=ue:Jn=Jn.filter(Or=>Or!==Tr)),rr.value=!0,Rt.value=h.value.getFlattenedNodes(Jn),St!==null){const Or=Rt.value.findIndex(ei=>ei.key===St);if(~Or){const ei=Rt.value[Or].children;if(ei){const fi=LE(ei,ue);Rt.value.splice(Or+1,0,{__motion:!0,mode:"expand",height:qr?fi.length*Ze:void 0,nodes:qr?fi.slice(0,Qn):fi})}}}if(Tr!==null){const Or=Rt.value.findIndex(ei=>ei.key===Tr);if(~Or){const ei=Rt.value[Or].children;if(!ei)return;rr.value=!0;const fi=LE(ei,ue);Rt.value.splice(Or+1,0,{__motion:!0,mode:"collapse",height:qr?fi.length*Ze:void 0,nodes:qr?fi.slice(0,Qn):fi})}}});const sr=Dr(()=>bB(P.value)),Hr=Dr(()=>rr.value?Rt.value:P.value);function et(){const{value:ue}=s;ue&&ue.sync()}function ie(){rr.value=!1,r.virtualScroll&&Pf(et)}function L(ue){const{getNode:ve}=p.value;return ue.map(Ze=>{var ct;return((ct=ve(Ze))===null||ct===void 0?void 0:ct.rawNode)||null})}function Se(ue,ve,Ze){const{"onUpdate:expandedKeys":ct,onUpdateExpandedKeys:St}=r;A.value=ue,ct&&Gn(ct,ue,ve,Ze),St&&Gn(St,ue,ve,Ze)}function Pe(ue,ve,Ze){const{"onUpdate:checkedKeys":ct,onUpdateCheckedKeys:St}=r;y.value=ue,St&&Gn(St,ue,ve,Ze),ct&&Gn(ct,ue,ve,Ze)}function me(ue,ve){const{"onUpdate:indeterminateKeys":Ze,onUpdateIndeterminateKeys:ct}=r;Ze&&Gn(Ze,ue,ve),ct&&Gn(ct,ue,ve)}function je(ue,ve,Ze){const{"onUpdate:selectedKeys":ct,onUpdateSelectedKeys:St}=r;M.value=ue,St&&Gn(St,ue,ve,Ze),ct&&Gn(ct,ue,ve,Ze)}function Xe(ue){const{onDragenter:ve}=r;ve&&Gn(ve,ue)}function qe(ue){const{onDragleave:ve}=r;ve&&Gn(ve,ue)}function tt(ue){const{onDragend:ve}=r;ve&&Gn(ve,ue)}function yt(ue){const{onDragstart:ve}=r;ve&&Gn(ve,ue)}function Ut(ue){const{onDragover:ve}=r;ve&&Gn(ve,ue)}function gr(ue){const{onDrop:ve}=r;ve&&Gn(ve,ue)}function Pt(){wr(),Zt()}function wr(){we.value=null}function Zt(){nt.value=0,Ae.value=null,Ke.value=null,ot.value=null,Mr()}function Mr(){W&&(window.clearTimeout(W),W=null),D=null}function Er(ue,ve){if(r.disabled||rs(ue,r.disabledField))return;if(r.internalUnifySelectCheck&&!r.multiple){Br(ue);return}const Ze=ve?"check":"uncheck",{checkedKeys:ct,indeterminateKeys:St}=p.value[Ze](ue.key,E.value,{cascade:r.cascade,checkStrategy:w.value,allowNotLoaded:r.allowCheckingNotLoaded});Pe(ct,L(ct),{node:ue.rawNode,action:Ze}),me(St,L(St))}function vn(ue){if(r.disabled)return;const{key:ve}=ue,{value:Ze}=k,ct=Ze.findIndex(St=>St===ve);if(~ct){const St=Array.from(Ze);St.splice(ct,1),Se(St,L(St),{node:ue.rawNode,action:"collapse"})}else{const St=h.value.getNode(ve);if(!St||St.isLeaf)return;let Tr;if(r.accordion){const zr=new Set(ue.siblings.map(({key:qr})=>qr));Tr=Ze.filter(qr=>!zr.has(qr)),Tr.push(ve)}else Tr=Ze.concat(ve);Se(Tr,L(Tr),{node:ue.rawNode,action:"expand"})}}function ir(ue){r.disabled||rr.value||vn(ue)}function Br(ue){if(!(r.disabled||!r.selectable)){if(N.value=ue.key,r.internalUnifySelectCheck){const{value:{checkedKeys:ve,indeterminateKeys:Ze}}=x;r.multiple?Er(ue,!(ve.includes(ue.key)||Ze.includes(ue.key))):Pe([ue.key],L([ue.key]),{node:ue.rawNode,action:"check"})}if(r.multiple){const ve=Array.from(S.value),Ze=ve.findIndex(ct=>ct===ue.key);~Ze?r.cancelable&&ve.splice(Ze,1):~Ze||ve.push(ue.key),je(ve,L(ve),{node:ue.rawNode,action:~Ze?"unselect":"select"})}else S.value.includes(ue.key)?r.cancelable&&je([],[],{node:ue.rawNode,action:"unselect"}):je([ue.key],L([ue.key]),{node:ue.rawNode,action:"select"})}}function ui(ue){if(W&&(window.clearTimeout(W),W=null),ue.isLeaf)return;D=ue.key;const ve=()=>{if(D!==ue.key)return;const{value:Ze}=Ke;if(Ze&&Ze.key===ue.key&&!k.value.includes(ue.key)){const ct=k.value.concat(ue.key);Se(ct,L(ct),{node:ue.rawNode,action:"expand"})}W=null,D=null};ue.shallowLoaded?W=window.setTimeout(()=>{ve()},1e3):W=window.setTimeout(()=>{Sr(ue).then(()=>{ve()})},1e3)}function Kr({event:ue,node:ve}){!r.draggable||r.disabled||rs(ve,r.disabledField)||(pi({event:ue,node:ve},!1),Xe({event:ue,node:ve.rawNode}))}function $i({event:ue,node:ve}){!r.draggable||r.disabled||rs(ve,r.disabledField)||qe({event:ue,node:ve.rawNode})}function lo(ue){ue.target===ue.currentTarget&&Zt()}function fo({event:ue,node:ve}){Pt(),!(!r.draggable||r.disabled||rs(ve,r.disabledField))&&tt({event:ue,node:ve.rawNode})}function on({event:ue,node:ve}){!r.draggable||r.disabled||rs(ve,r.disabledField)||(fe=ue.clientX,we.value=ve,yt({event:ue,node:ve.rawNode}))}function pi({event:ue,node:ve},Ze=!0){var ct;if(!r.draggable||r.disabled||rs(ve,r.disabledField))return;const{value:St}=we;if(!St)return;const{allowDrop:Tr,indent:zr}=r;Ze&&Ut({event:ue,node:ve.rawNode});const qr=ue.currentTarget,{height:Zn,top:Qn}=qr.getBoundingClientRect(),Jn=ue.clientY-Qn;let Or;Tr({node:ve.rawNode,dropPosition:"inside",phase:"drag"})?Jn<=8?Or="before":Jn>=Zn-8?Or="after":Or="inside":Jn<=Zn/2?Or="before":Or="after";const{value:fi}=sr;let Ir,pn;const Sa=fi(ve.key);if(Sa===null){Zt();return}let Wo=!1;Or==="inside"?(Ir=ve,pn="inside"):Or==="before"?ve.isFirstChild?(Ir=ve,pn="before"):(Ir=P.value[Sa-1],pn="after"):(Ir=ve,pn="after"),!Ir.isLeaf&&k.value.includes(Ir.key)&&(Wo=!0,pn==="after"&&(Ir=P.value[Sa+1],Ir?pn="before":(Ir=ve,pn="inside")));const Tu=Ir;if(Ke.value=Tu,!Wo&&St.isLastChild&&St.key===Ir.key&&(pn="after"),pn==="after"){let Iu=fe-ue.clientX,Os=0;for(;Iu>=zr/2&&Ir.parent!==null&&Ir.isLastChild&&Os<1;)Iu-=zr,Os+=1,Ir=Ir.parent;nt.value=Os}else nt.value=0;if((St.contains(Ir)||pn==="inside"&&((ct=St.parent)===null||ct===void 0?void 0:ct.key)===Ir.key)&&!(St.key===Tu.key&&St.key===Ir.key)){Zt();return}if(!Tr({node:Ir.rawNode,dropPosition:pn,phase:"drag"})){Zt();return}if(St.key===Ir.key)Mr();else if(D!==Ir.key)if(pn==="inside"){if(r.expandOnDragenter){if(ui(Ir),!Ir.shallowLoaded&&D!==Ir.key){Pt();return}}else if(!Ir.shallowLoaded){Pt();return}}else Mr();else pn!=="inside"&&Mr();ot.value=pn,Ae.value=Ir}function ia({event:ue,node:ve,dropPosition:Ze}){if(!r.draggable||r.disabled||rs(ve,r.disabledField))return;const{value:ct}=we,{value:St}=Ae,{value:Tr}=ot;if(!(!ct||!St||!Tr)&&r.allowDrop({node:St.rawNode,dropPosition:Tr,phase:"drag"})&&ct.key!==St.key){if(Tr==="before"){const zr=ct.getNext({includeDisabled:!0});if(zr&&zr.key===St.key){Zt();return}}if(Tr==="after"){const zr=ct.getPrev({includeDisabled:!0});if(zr&&zr.key===St.key){Zt();return}}gr({event:ue,node:St.rawNode,dragNode:ct.rawNode,dropPosition:Ze}),Pt()}}function co(){et()}function ho(){et()}function vo(ue){var ve;if(r.virtualScroll||r.internalScrollable){const{value:Ze}=s;if(!((ve=Ze==null?void 0:Ze.containerRef)===null||ve===void 0)&&ve.contains(ue.relatedTarget))return;N.value=null}else{const{value:Ze}=o;if(Ze!=null&&Ze.contains(ue.relatedTarget))return;N.value=null}}vl(N,ue=>{var ve,Ze;if(ue!==null){if(r.virtualScroll)(ve=u.value)===null||ve===void 0||ve.scrollTo({key:ue});else if(r.internalScrollable){const{value:ct}=s;if(ct===null)return;const St=(Ze=ct.contentRef)===null||Ze===void 0?void 0:Ze.querySelector(`[data-key="${CA(ue)}"]`);if(!St)return;ct.scrollTo({el:St})}}}),d1(Rc,{loadingKeysRef:Y,highlightKeySetRef:ee,displayedCheckedKeysRef:E,displayedIndeterminateKeysRef:_,mergedSelectedKeysRef:S,mergedExpandedKeysRef:k,mergedThemeRef:a,mergedCheckStrategyRef:w,nodePropsRef:kr(r,"nodeProps"),disabledRef:kr(r,"disabled"),checkableRef:kr(r,"checkable"),selectableRef:kr(r,"selectable"),expandOnClickRef:kr(r,"expandOnClick"),onLoadRef:kr(r,"onLoad"),draggableRef:kr(r,"draggable"),blockLineRef:kr(r,"blockLine"),indentRef:kr(r,"indent"),cascadeRef:kr(r,"cascade"),checkOnClickRef:kr(r,"checkOnClick"),checkboxPlacementRef:r.checkboxPlacement,droppingMouseNodeRef:Ke,droppingNodeParentRef:Ct,draggingNodeRef:we,droppingPositionRef:ot,droppingOffsetLevelRef:nt,fNodesRef:P,pendingNodeKeyRef:N,showLineRef:kr(r,"showLine"),disabledFieldRef:kr(r,"disabledField"),internalScrollableRef:kr(r,"internalScrollable"),internalCheckboxFocusableRef:kr(r,"internalCheckboxFocusable"),internalTreeSelect:r.internalTreeSelect,renderLabelRef:kr(r,"renderLabel"),renderPrefixRef:kr(r,"renderPrefix"),renderSuffixRef:kr(r,"renderSuffix"),renderSwitcherIconRef:kr(r,"renderSwitcherIcon"),labelFieldRef:kr(r,"labelField"),multipleRef:kr(r,"multiple"),overrideDefaultNodeClickBehaviorRef:kr(r,"overrideDefaultNodeClickBehavior"),handleSwitcherClick:ir,handleDragEnd:fo,handleDragEnter:Kr,handleDragLeave:$i,handleDragStart:on,handleDrop:ia,handleDragOver:pi,handleSelect:Br,handleCheck:Er});function li(ue,ve){var Ze,ct;typeof ue=="number"?(Ze=u.value)===null||Ze===void 0||Ze.scrollTo(ue,ve||0):(ct=u.value)===null||ct===void 0||ct.scrollTo(ue)}const jr={handleKeydown:z,scrollTo:li,getCheckedData:()=>{if(!r.checkable)return{keys:[],options:[]};const{checkedKeys:ue}=x.value;return{keys:ue,options:L(ue)}},getIndeterminateData:()=>{if(!r.checkable)return{keys:[],options:[]};const{indeterminateKeys:ue}=x.value;return{keys:ue,options:L(ue)}}},qn=Dr(()=>{const{common:{cubicBezierEaseInOut:ue},self:{fontSize:ve,nodeBorderRadius:Ze,nodeColorHover:ct,nodeColorPressed:St,nodeColorActive:Tr,arrowColor:zr,loadingColor:qr,nodeTextColor:Zn,nodeTextColorDisabled:Qn,dropMarkColor:Jn,nodeWrapperPadding:Or,nodeHeight:ei,lineHeight:fi,lineColor:Ir}}=a.value,pn=l0(Or,"top"),Sa=l0(Or,"bottom"),Wo=EA(gf(ei)-gf(pn)-gf(Sa));return{"--n-arrow-color":zr,"--n-loading-color":qr,"--n-bezier":ue,"--n-font-size":ve,"--n-node-border-radius":Ze,"--n-node-color-active":Tr,"--n-node-color-hover":ct,"--n-node-color-pressed":St,"--n-node-text-color":Zn,"--n-node-text-color-disabled":Qn,"--n-drop-mark-color":Jn,"--n-node-wrapper-padding":Or,"--n-line-offset-top":`-${pn}`,"--n-line-offset-bottom":`-${Sa}`,"--n-node-content-height":Wo,"--n-line-height":fi,"--n-line-color":Ir}}),_t=e?v1("tree",void 0,qn,r):void 0;return Object.assign(Object.assign({},jr),{mergedClsPrefix:t,mergedTheme:a,rtlEnabled:i,fNodes:Hr,aip:rr,selfElRef:o,virtualListInstRef:u,scrollbarInstRef:s,handleFocusout:vo,handleDragLeaveTree:lo,handleScroll:co,getScrollContainer:l,getScrollContent:f,handleAfterEnter:ie,handleResize:ho,cssVars:e?void 0:qn,themeClass:_t==null?void 0:_t.themeClass,onRender:_t==null?void 0:_t.onRender})},render(){var r;const{fNodes:t,internalRenderEmpty:e}=this;if(!t.length&&e)return e();const{mergedClsPrefix:n,blockNode:i,blockLine:a,draggable:o,disabled:s,internalFocusable:u,checkable:l,handleKeydown:f,rtlEnabled:c,handleFocusout:d,scrollbarProps:h}=this,v=u&&!s,p=v?"0":void 0,g=[`${n}-tree`,c&&`${n}-tree--rtl`,l&&`${n}-tree--checkable`,(a||i)&&`${n}-tree--block-node`,a&&`${n}-tree--block-line`],y=b=>"__motion"in b?Ot(v4,{height:b.height,nodes:b.nodes,clsPrefix:n,mode:b.mode,onAfterEnter:this.handleAfterEnter}):Ot(PA,{key:b.key,tmNode:b,clsPrefix:n});if(this.virtualScroll){const{mergedTheme:b,internalScrollablePadding:x}=this,w=l0(x||"0");return Ot(IE,Object.assign({},h,{ref:"scrollbarInstRef",onDragleave:o?this.handleDragLeaveTree:void 0,container:this.getScrollContainer,content:this.getScrollContent,class:g,theme:b.peers.Scrollbar,themeOverrides:b.peerOverrides.Scrollbar,tabindex:p,onKeydown:v?f:void 0,onFocusout:v?d:void 0}),{default:()=>{var E;return(E=this.onRender)===null||E===void 0||E.call(this),t.length?Ot(yB,{ref:"virtualListInstRef",items:this.fNodes,itemSize:gf(b.self.nodeHeight),ignoreItemResize:this.aip,paddingTop:w.top,paddingBottom:w.bottom,class:this.themeClass,style:[this.cssVars,{paddingLeft:w.left,paddingRight:w.right}],onScroll:this.handleScroll,onResize:this.handleResize,showScrollbar:!1,itemResizable:!0},{default:({item:_})=>y(_)}):TE(this.$slots.empty,()=>[Ot(kE,{class:`${n}-tree__empty`,theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})])}})}const{internalScrollable:m}=this;return g.push(this.themeClass),(r=this.onRender)===null||r===void 0||r.call(this),m?Ot(IE,Object.assign({},h,{class:g,tabindex:p,onKeydown:v?f:void 0,onFocusout:v?d:void 0,style:this.cssVars,contentStyle:{padding:this.internalScrollablePadding}}),{default:()=>Ot("div",{onDragleave:o?this.handleDragLeaveTree:void 0,ref:"selfElRef"},this.fNodes.map(y))}):Ot("div",{class:g,tabindex:p,ref:"selfElRef",style:this.cssVars,onKeydown:v?f:void 0,onFocusout:v?d:void 0,onDragleave:o?this.handleDragLeaveTree:void 0},t.length?t.map(y):TE(this.$slots.empty,()=>[Ot(kE,{class:`${n}-tree__empty`,theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})]))}}),RA=Vr({__name:"DraggableCard",props:{initialValue:{default:()=>({})}},setup(r){var y,m;const t=r,e=t.initialValue.left!==void 0,n=t.initialValue.top!==void 0,i={x:(y=e?t.initialValue.left:t.initialValue.right)!=null?y:0,y:(m=n?t.initialValue.top:t.initialValue.bottom)!=null?m:0},a=_A({...i}),o=Dr(()=>{const b=e?`left:${a.x}px;`:`right:${a.x}px;`,x=n?`top:${a.y}px;`:`bottom:${a.y}px;`;return b+x});let s;const u=b=>{s=b,i.x=a.x,i.y=a.y},l=b=>{if(!d.value||!s)return;const x=b.clientX-s.clientX,w=b.clientY-s.clientY;a.x=i.x+(e?x:-x),a.y=i.y+(n?w:-w)},f=()=>{s=void 0},c=On(),d=On(),h=b=>{s&&b.preventDefault()},v=["transition-top,bottom,left,right-500"],p=()=>{if(!d.value)return;const{top:b,bottom:x,left:w,right:E}=d.value.getBoundingClientRect();if(E<0||w>window.innerWidth||x<0||b>window.innerHeight){a.x=i.x,a.y=i.y,f();const _=c.value;_&&(_.classList.add(...v),setTimeout(()=>{_.classList.remove(...v)},550))}};window.addEventListener("pointermove",l),window.addEventListener("pointerup",p),document.addEventListener("selectstart",h),pv(()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",p),document.removeEventListener("selectstart",h),f()}),vl(d,(b,x)=>{b&&(b.addEventListener("pointerdown",u),b.addEventListener("pointerup",f)),x&&(x.removeEventListener("pointerdown",u),x.removeEventListener("pointerup",f))}),pv(()=>{d.value&&(d.value.removeEventListener("pointerdown",u),d.value.removeEventListener("pointerup",f))});const g=b=>{b instanceof HTMLElement?d.value=b:d.value=void 0};return(b,x)=>(Lr(),ii(lB,{to:"body"},[Ar("div",{fixed:"",ref_key:"box",ref:c,style:Cy([b.$attrs.style,o.value]),class:uB(b.$attrs.class)},[SA(b.$slots,"default",{onRef:g})],6)]))}}),w4=Ar("th",null,"Name",-1),E4=Ar("th",null,"Value",-1),_4=[w4,E4],S4={key:0,flex:"","justify-between":"","items-center":""},M4={key:0,viewBox:"0 0 28 28"},C4=Ar("g",{fill:"none"},[Ar("path",{d:"M15 8a1 1 0 1 1-2 0a1 1 0 0 1 2 0zm-1.75 3.75v7.5a.75.75 0 0 0 1.5 0v-7.5a.75.75 0 0 0-1.5 0zM2 14C2 7.373 7.373 2 14 2s12 5.373 12 12s-5.373 12-12 12S2 20.627 2 14zM14 3.5C8.201 3.5 3.5 8.201 3.5 14S8.201 24.5 14 24.5S24.5 19.799 24.5 14S19.799 3.5 14 3.5z",fill:"currentColor"})],-1),A4=[C4],T4={key:1,viewBox:"0 0 1024 1024"},I4=Ar("path",{d:"M722.500267 330.888533l-273.408 273.408-147.729067-147.729066a42.018133 42.018133 0 1 0-59.426133 59.426133l177.425066 177.493333a41.984 41.984 0 0 0 59.426134 0L781.9264 390.314667a42.001067 42.001067 0 0 0-59.392-59.426134h-0.034133zM78.506667 783.496533a508.279467 508.279467 0 0 0 319.0784 226.986667C530.773333 1041.066667 667.886933 1017.924267 783.701333 945.390933a508.279467 508.279467 0 0 0 226.986667-319.0784 508.279467 508.279467 0 0 0-65.058133-386.116266C848.554667 85.367467 681.710933 0.341333 511.214933 0.341333a508.6208 508.6208 0 0 0-270.813866 77.960534A36.864 36.864 0 0 0 279.552 140.629333C484.113067 12.288 755.029333 74.581333 883.268267 279.278933a434.9952 434.9952 0 0 1 55.739733 330.5472 435.029333 435.029333 0 0 1-194.3552 273.134934 435.746133 435.746133 0 0 1-330.581333 55.773866A435.165867 435.165867 0 0 1 140.936533 744.379733a436.770133 436.770133 0 0 1-5.666133-456.055466 36.829867 36.829867 0 0 0-63.317333-37.546667A510.1568 510.1568 0 0 0 78.506667 783.530667v-0.034134z"},null,-1),O4=[I4],L4=Vr({__name:"AttrCard",props:{focusNode:{}},setup(r){const t=r,e=["text","desc"],n=Dr(()=>Object.entries(t.focusNode.attr).map(([o,s])=>{var l;const u={name:o,value:JSON.stringify(s)};return e.includes(o)?[u,{name:o+".length",value:JSON.stringify((l=s==null?void 0:s.length)!=null?l:null)}]:u}).flat()),i={_id:"虚拟属性(真机不可用):生成快照访问节点顺序",_pid:"虚拟属性(真机不可用):父节点的 _id",depth:"使用此属性在某些应用上可能造成无限节点错误",id:"可快速查找",vid:"可快速查找",text:"可快速查找"},a=["id","vid","text"];return(o,s)=>(Lr(),ii(RA,{initialValue:{top:75,right:10}},{default:Lt(({onRef:u})=>[Vt(vt(LA),{size:"small",striped:"",singleLine:!1,class:"gkd_code",themeOverrides:{thPaddingSmall:"1px 3px",tdPaddingSmall:"1px 3px"}},{default:Lt(()=>[Ar("thead",null,[Ar("tr",{ref:u,"cursor-move":""},_4,512)]),Vt(vt(kA),null,{default:Lt(()=>[(Lr(!0),bi(Hf,null,$h(n.value,l=>(Lr(),ii(vt(Ty),{key:l.name},{default:Lt(()=>[Vt(vt(Mo),{onClick:f=>vt(Js)(`${l.name}=${l.value}`)},{default:Lt(()=>[l.name in i?(Lr(),bi("div",S4,[Ar("div",null,Hn(l.name),1),Vt(vt(xB),null,{trigger:Lt(()=>[Vt(vt(pl),{size:"16"},{default:Lt(()=>[a.includes(l.name)?(o.focusNode.quickFind||l.name=="id"&&o.focusNode.idQf||l.name=="vid"&&o.focusNode.idQf||l.name=="text"&&o.focusNode.textQf)&&JSON.parse(l.value)?(Lr(),bi("svg",T4,O4)):Ra("",!0):(Lr(),bi("svg",M4,A4))]),_:2},1024)]),default:Lt(()=>[xn(" "+Hn(i[l.name]),1)]),_:2},1024)])):(Lr(),bi(Hf,{key:1},[xn(Hn(l.name),1)],64))]),_:2},1032,["onClick"]),Vt(vt(Mo),null,{default:Lt(()=>[l.name=="id"?(Lr(),ii(vt(eu),{key:0,style:{width:"180px","min-width":"max(12vw, 180px)",direction:"rtl","text-align":"left"}},{default:Lt(()=>[xn(Hn(l.value),1)]),_:2},1024)):(Lr(),ii(vt(eu),{key:1,style:{width:"180px","min-width":"max(12vw, 180px)"}},{default:Lt(()=>[xn(Hn(l.value),1)]),_:2},1024))]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:2},1024)]),_:1}))}}),k4={flex:"","flex-col":"",relative:"","h-full":""},D4=["src"],N4=Ar("div",{absolute:"","left-0":"","top-0":"","bottom-0":"","right-0":"","b-solid":"","b-1px":"","b-red":""},null,-1),P4=[N4],R4={class:"left-[calc(100%+4px)]",absolute:"","top-0":"","overflow-hidden":"","z-1":"","bg-white":"","h-200px":"","w-200px":"","border-1px":"","border-indigo-600":"","border-dashed":""},B4=["src"],F4={absolute:"","left-2px":"","top-2px":"",class:"leading-[1]",style:{"background-color":"rgba(256, 256, 256, 0.7)"}},z4=Ar("div",{class:"top-[calc(50%-1px)]",absolute:"","left-0":"","right-0":"","h-1px":"","bg-repeat-x":"","mix-blend-difference":"",style:{background:`linear-gradient(
|
|
257
257
|
to left,
|
|
258
258
|
transparent 0%,
|
|
259
259
|
transparent 50%,
|
|
@@ -265,8 +265,8 @@ import{_ as z5,e as G5,f as $5}from"./ActionCard.vue_vue_type_script_setup_true_
|
|
|
265
265
|
transparent 50%,
|
|
266
266
|
#fff 50%,
|
|
267
267
|
#fff 100%
|
|
268
|
-
)`,"background-size":"1px 10px"}},null,-1),$4=Vr({__name:"ScreenshotCard",props:{url:{},snapshot:{},rootNode:{},focusNode:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}}},setup(r){const t=r,e=On(),n=f=>{if(!t.rootNode)return;const c=e.value;if(!c)return;const d=c.getBoundingClientRect(),h=d.width/c.naturalWidth*c.naturalHeight,v=(d.height-h)/2,p=(f.clientX-d.left)/d.width*c.naturalWidth,g=(f.clientY-d.top-v)/h*c.naturalHeight,y=wB(t.snapshot.nodes,p,g);y&&t.onUpdateFocusNode(y)},i=f=>`${f*100}%`,a=Dr(()=>{var v;const f=e.value,c=(v=t.focusNode)==null?void 0:v.attr;if(!t.focusNode||!f||!c)return"";const d=f.getBoundingClientRect(),h=d.width/f.naturalWidth*f.naturalHeight;return{left:`calc(${i(c.left/f.naturalWidth)} - 2px)`,width:`calc(${i((c.right-c.left)/f.naturalWidth)} + 2px)`,top:`calc(${i((c.top/f.naturalHeight*h+(d.height-h)/2)/d.height)} - 2px)`,height:`calc(${i((c.bottom-c.top)/f.naturalHeight*h/d.height)} + 2px)`}}),o=On(!1),s=On({ox:0,oy:0}),u=f=>{const c=e.value;if(!c)return;const d=c.getBoundingClientRect(),h=d.width/c.naturalWidth*c.naturalHeight,v=(d.height-h)/2,p=(f.clientX-d.left)/d.width*c.naturalWidth,g=(f.clientY-d.top-v)/h*c.naturalHeight;s.value={ox:p,oy:g},l.value={left:-(p-.1*c.naturalWidth)/c.naturalWidth*1e3+"px",top:-(g-.1*c.naturalWidth)/c.naturalWidth*1e3+"px"}},l=On({left:"0",top:"0"});return(f,c)=>(Lr(),bi("div",k4,[Ar("img",{ref_key:"imgRef",ref:e,src:f.url,onClick:n,"cursor-crosshair":"","h-full":"","object-contain":"",style:{"max-width":"max(35vw, 400px)"},onMouseover:c[0]||(c[0]=d=>o.value=!0),onMouseleave:c[1]||(c[1]=d=>o.value=!1),onMousemove:u},null,40,D4),Ar("div",{style:Cy(a.value),absolute:"","pointer-events-none":"","transition-all-300":"","b-1px":"","b-blue":"","b-solid":""},P4,4),mA(Ar("div",R4,[Ar("img",{src:f.url,"object-contain":"",absolute:"","left-0":"","top-0":"",style:Cy(l.value),"w-1000px":""},null,12,B4),Ar("div",F4,Hn(`${s.value.ox.toFixed(0)},${s.value.oy.toFixed(0)}`),1),z4,G4],512),[[bA,o.value]])]))}}),U4={"w-480px":"","bg-white":"","b-1px":"","b-solid":"","b-gray-200":"","rounded-4px":"","p-8px":"",style:{"min-width":"max(25vw, 480px)"}},j4={flex:"","m-b-4px":""},W4=Ar("svg",{viewBox:"0 0 32 32"},[Ar("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"})],-1),X4=Ar("div",{"p-5px":""},null,-1),Y4={key:0,underline:"","decoration-1":"","m-r-4px":"",title:"查询数量"},V4=["title"],H4=Ar("svg",{viewBox:"0 0 24 24"},[Ar("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",fill:"currentColor"})],-1),K4=Ar("div",{"p-l-8px":""},null,-1),q4=Ar("svg",{viewBox:"0 0 24 24"},[Ar("g",{fill:"none"},[Ar("path",{d:"M12 1.75a3.25 3.25 0 0 1 3.245 3.066L15.25 5h5.25a.75.75 0 0 1 .102 1.493L20.5 6.5h-.796l-1.28 13.02a2.75 2.75 0 0 1-2.561 2.474l-.176.006H8.313a2.75 2.75 0 0 1-2.714-2.307l-.023-.174L4.295 6.5H3.5a.75.75 0 0 1-.743-.648L2.75 5.75a.75.75 0 0 1 .648-.743L3.5 5h5.25A3.25 3.25 0 0 1 12 1.75zm6.197 4.75H5.802l1.267 12.872a1.25 1.25 0 0 0 1.117 1.122l.127.006h7.374c.6 0 1.109-.425 1.225-1.002l.02-.126L18.196 6.5zM13.75 9.25a.75.75 0 0 1 .743.648L14.5 10v7a.75.75 0 0 1-1.493.102L13 17v-7a.75.75 0 0 1 .75-.75zm-3.5 0a.75.75 0 0 1 .743.648L11 10v7a.75.75 0 0 1-1.493.102L9.5 17v-7a.75.75 0 0 1 .75-.75zm1.75-6a1.75 1.75 0 0 0-1.744 1.606L10.25 5h3.5A1.75 1.75 0 0 0 12 3.25z",fill:"currentColor"})])],-1),Z4=Ar("svg",{viewBox:"0 0 24 24"},[Ar("path",{fill:"currentColor",d:"M5 21V8.825Q4.125 8.5 3.563 7.738T3 6q0-1.25.875-2.125T6 3q1.25 0 2.125.875T9 6q0 .975-.562 1.738T7 8.825V19h4V3h8v12.175q.875.325 1.438 1.088T21 18q0 1.25-.875 2.125T18 21q-1.25 0-2.125-.875T15 18q0-.975.563-1.75T17 15.175V5h-4v16zM6 7q.425 0 .713-.288T7 6q0-.425-.288-.712T6 5q-.425 0-.712.288T5 6q0 .425.288.713T6 7m12 12q.425 0 .713-.288T19 18q0-.425-.288-.712T18 17q-.425 0-.712.288T17 18q0 .425.288.713T18 19m0-1"})],-1),Q4=Vr({__name:"SearchCard",props:{snapshot:{},rootNode:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}},onUpdateTrack:{type:Function,default:()=>()=>{}}},setup(r){const t=MA(),e=r,n=On(""),i=_A([]),a=On([]),o=BE(()=>{if(!e.rootNode){ca.error("根节点不存在");return}const f=n.value.trim();if(!f)return;if(u.value){const h=TB(()=>AB(f),"选择器非法");if(i.find(p=>typeof p.selector=="object"&&p.selector.toString()==h.toString())){ca.warning("不可重复选择");return}const v=h.querySelectorTrackAll(e.rootNode);if(v.length==0){ca.success("没有选择到节点");return}ca.success(`选择到 ${v.length} 个节点`),i.unshift({selector:h,nodes:v,key:Date.now()})}else{if(i.find(p=>typeof p.selector=="string"&&p.selector.toString()==f)){ca.warning("不可重复选择");return}const h=[],v=[e.rootNode];for(;v.length>0;){const p=v.pop();Uh(p).includes(f)&&h.push(p),v.push(...[...p.children].reverse())}if(h.length==0){ca.success("没有搜索到节点");return}ca.success(`搜索到 ${h.length} 个节点`),i.unshift({selector:f,nodes:h,key:Date.now()})}const c=new Set(i.map(h=>h.key)),d=a.value.filter(h=>c.has(h));d.push(i[0].key),a.value=d}),s=BE(async f=>{let c=U5[e.snapshot.id];c&&(c=ME(t,c));let d=yA[e.snapshot.id];d&&(d=ME(t,d));const h=f.selector,v=f.nodes[0][0],p=[(v.quickFind??v.idQf)&&v.attr.id&&h.qfIdValue,(v.quickFind??v.idQf)&&v.attr.vid&&h.qfVidValue,(v.quickFind??v.textQf)&&v.attr.text&&h.qfTextValue].some(Boolean),g={id:e.snapshot.appId,name:e.snapshot.appName,groups:[{key:1,name:`[ChangeMe]规则名称-${MB().format("YYYY-MM-DD HH:mm:ss")}`,desc:"[ChangeMe]本规则由GKD网页端审查工具生成",rules:[{quickFind:p||void 0,activityIds:e.snapshot.activityId,matches:h.toString(),exampleUrls:c,snapshotUrls:d}]}]};Js(IB.stringify(g,void 0,2))}),u=On(!0),l=window.innerWidth/100;return(f,c)=>(Lr(),ii(RA,{initialValue:{top:75,right:Math.max(315,12*l+135)},class:"z-1"},{default:Lt(({onRef:d})=>[Ar("div",U4,[Ar("div",j4,[Vt(vt(EB),{value:u.value,"onUpdate:value":c[0]||(c[0]=h=>u.value=h)},{default:Lt(()=>[Vt(vt(DE),null,{default:Lt(()=>[Vt(vt(NE),{value:!1},{default:Lt(()=>[xn(" 字符搜索 ")]),_:1}),Vt(vt(NE),{value:!0},{default:Lt(()=>[xn(" 选择器查询 ")]),_:1})]),_:1})]),_:1},8,["value"]),Ar("div",{"flex-1":"","cursor-move":"",ref:d},null,512)]),Vt(vt(SB),null,{default:Lt(()=>[Vt(vt(_B),{value:n.value,"onUpdate:value":c[1]||(c[1]=h=>n.value=h),placeholder:u.value?"请输入选择器":"请输入字符",onKeyup:fB(vt(o),["enter"]),inputProps:{class:"gkd_code"}},null,8,["value","placeholder","onKeyup"]),Vt(vt(Yu),{onClick:vt(o)},{icon:Lt(()=>[Vt(vt(pl),null,{default:Lt(()=>[W4]),_:1})]),_:1},8,["onClick"])]),_:1}),X4,Vt(vt(WB),{expandedNames:a.value,"onUpdate:expandedNames":c[2]||(c[2]=h=>a.value=h)},{default:Lt(()=>[(Lr(!0),bi(Hf,null,$h(vt(i),(h,v)=>(Lr(),ii(vt(VB),{key:h.key,name:h.key},{header:Lt(()=>[h.nodes.length>1?(Lr(),bi("span",Y4,Hn(h.nodes.length),1)):Ra("",!0),Ar("span",{"break-all":"",title:typeof h.selector=="object"?"选择器":"搜索字符"},Hn(h.selector.toString()),9,V4)]),"header-extra":Lt(()=>[typeof h.selector=="object"&&h.selector.canCopy?(Lr(),ii(vt(Yu),{key:0,size:"small",onClick:OE(p=>vt(s)(h),["stop"]),title:"复制规则"},{icon:Lt(()=>[Vt(vt(pl),null,{default:Lt(()=>[H4]),_:1})]),_:2},1032,["onClick"])):Ra("",!0),K4,Vt(vt(Yu),{size:"small",onClick:OE(p=>vt(i).splice(v,1),["stop"]),title:"删除记录"},{icon:Lt(()=>[Vt(vt(pl),null,{default:Lt(()=>[q4]),_:1})]),_:2},1032,["onClick"])]),default:Lt(()=>[Vt(vt(DE),{style:{"max-height":"400px","overflow-y":"scroll","padding-bottom":"10px"}},{default:Lt(()=>[typeof h.selector=="string"||h.selector.tracks.length<=1?(Lr(!0),bi(Hf,{key:0},$h(h.nodes.map(p=>Array.isArray(p)?p[0]:p),p=>(Lr(),ii(vt(Yu),{key:p.id,onClick:g=>f.onUpdateFocusNode(p),size:"small"},{default:Lt(()=>[xn(Hn(vt(Uh)(p)),1)]),_:2},1032,["onClick"]))),128)):(Lr(!0),bi(Hf,{key:1},$h(h.nodes.map(p=>Array.isArray(p)?p:[p]),(p,g)=>(Lr(),ii(vt(FB),{key:g},{default:Lt(()=>[Vt(vt(Yu),{size:"small",onClick:y=>f.onUpdateTrack({nodes:p,selector:h.selector})},{default:Lt(()=>[Vt(vt(pl),null,{default:Lt(()=>[Z4]),_:1})]),_:2},1032,["onClick"]),Vt(vt(Yu),{onClick:y=>f.onUpdateFocusNode(p[h.selector.trackIndex]),size:"small"},{default:Lt(()=>[xn(Hn(vt(Uh)(p[h.selector.trackIndex])),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["expandedNames"])])]),_:1},8,["initialValue"]))}}),J4={flex:"","flex-col":""},eF=Vr({__name:"WindowCard",props:{snapshot:{},rootNode:{},focusNode:{},focusCount:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}}},setup(r){const t=r,e=On([]);vl([()=>t.focusNode,()=>t.focusCount],async()=>{if(!t.focusNode)return;const s=t.focusNode.id;Pf().then(async()=>{var f,c;await My(100),s===((f=t.focusNode)==null?void 0:f.id)&&((c=n.value)==null||c.scrollTo({key:s,behavior:"smooth",debounce:!0}))});let u=t.focusNode.parent;if(!u)return;const l=new Set(e.value);for(;u;)l.add(u.id),u=u.parent;l.size==e.value.length&&e.value.every(f=>l.has(f))||(e.value=[...l])});const n=On(),i=(s,u)=>{var l;return u.id===((l=t.focusNode)==null?void 0:l.id)},a=s=>{var l;const u=s.option.idQf||s.option.textQf||s.option.quickFind;return{onClick:()=>{t.onUpdateFocusNode(s.option)},style:{color:s.option.id==((l=t.focusNode)==null?void 0:l.id)?"#00F":void 0,fontWeight:u?"bold":void 0}}},o=s=>Uh(s.option);return(s,u)=>(Lr(),bi("div",J4,[Vt(vt(LA),{size:"small",striped:"",singleLine:!1,class:"table-fixed",themeOverrides:{thPaddingSmall:"2px 4px",tdPaddingSmall:"2px 4px"}},{default:Lt(()=>[Vt(vt(i4),null,{default:Lt(()=>[Vt(vt(Ty),null,{default:Lt(()=>[Vt(vt(Us),{class:"w-140px"},{default:Lt(()=>[xn(" Device ")]),_:1}),Vt(vt(Us),{class:"w-100px"},{default:Lt(()=>[xn(" Name ")]),_:1}),Vt(vt(Us),{class:"w-100px"},{default:Lt(()=>[xn(" VersionName ")]),_:1}),Vt(vt(Us),{class:"w-100px"},{default:Lt(()=>[xn(" VersionCode ")]),_:1}),Vt(vt(Us),{class:"w-150px"},{default:Lt(()=>[xn(" AppId ")]),_:1}),Vt(vt(Us),null,{default:Lt(()=>[xn(" ActivityId ")]),_:1}),Vt(vt(Us),{class:"w-175px"},{default:Lt(()=>[xn(" 操作 ")]),_:1})]),_:1})]),_:1}),Vt(vt(kA),null,{default:Lt(()=>[Vt(vt(Ty),null,{default:Lt(()=>[Vt(vt(Mo),{class:"whitespace-nowrap"},{default:Lt(()=>[xn(Hn(`${vt(PE)(s.snapshot).manufacturer} Android ${vt(PE)(s.snapshot).release||""}`),1)]),_:1}),Vt(vt(Mo),{class:"whitespace-nowrap",onClick:u[0]||(u[0]=l=>vt(Js)(s.snapshot.appName))},{default:Lt(()=>[Vt(vt(eu),null,{default:Lt(()=>[xn(Hn(s.snapshot.appName),1)]),_:1})]),_:1}),Vt(vt(Mo),{class:"whitespace-nowrap",onClick:u[1]||(u[1]=l=>vt(Js)(s.snapshot.appVersionName))},{default:Lt(()=>[Vt(vt(eu),null,{default:Lt(()=>[xn(Hn(s.snapshot.appVersionName),1)]),_:1})]),_:1}),Vt(vt(Mo),{class:"whitespace-nowrap",onClick:u[2]||(u[2]=l=>vt(Js)(s.snapshot.appVersionCode.toString()))},{default:Lt(()=>[Vt(vt(eu),null,{default:Lt(()=>[xn(Hn(s.snapshot.appVersionCode),1)]),_:1})]),_:1}),Vt(vt(Mo),{class:"whitespace-nowrap",onClick:u[3]||(u[3]=l=>vt(Js)(s.snapshot.appId))},{default:Lt(()=>[Vt(vt(eu),null,{default:Lt(()=>[xn(Hn(s.snapshot.appId),1)]),_:1})]),_:1}),Vt(vt(Mo),{onClick:u[4]||(u[4]=l=>vt(Js)(s.snapshot.activityId)),class:"break-words"},{default:Lt(()=>[Vt(vt(eu),null,{default:Lt(()=>[xn(Hn(s.snapshot.activityId),1)]),_:1})]),_:1}),Vt(vt(Mo),null,{default:Lt(()=>[SA(s.$slots,"default")]),_:3})]),_:3})]),_:3})]),_:3}),Vt(vt(x4),{ref_key:"treeRef",ref:n,virtualScroll:"",showLine:"",keyField:"id",expandedKeys:e.value,"onUpdate:expandedKeys":u[5]||(u[5]=l=>e.value=l),data:[s.rootNode],filter:i,nodeProps:a,renderLabel:o},null,8,["expandedKeys","data","filter","nodeProps","renderLabel"])]))}});var Iy=function(r,t){return Iy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},Iy(r,t)};function zt(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Iy(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var F=function(){return F=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},F.apply(this,arguments)};function Ln(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}function BA(r,t,e,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function FA(r,t){return function(e,n){t(e,n,r)}}function tF(r,t,e,n,i,a){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var s=n.kind,u=s==="getter"?"get":s==="setter"?"set":"value",l=!t&&r?n.static?r:r.prototype:null,f=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),c,d=!1,h=e.length-1;h>=0;h--){var v={};for(var p in n)v[p]=p==="access"?{}:n[p];for(var p in n.access)v.access[p]=n.access[p];v.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(y||null))};var g=(0,e[h])(s==="accessor"?{get:f.get,set:f.set}:f[u],v);if(s==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(c=o(g.get))&&(f.get=c),(c=o(g.set))&&(f.set=c),(c=o(g.init))&&i.unshift(c)}else(c=o(g))&&(s==="field"?i.unshift(c):f[u]=c)}l&&Object.defineProperty(l,n.name,f),d=!0}function rF(r,t,e){for(var n=arguments.length>2,i=0;i<t.length;i++)e=n?t[i].call(r,e):t[i].call(r);return n?e:void 0}function nF(r){return typeof r=="symbol"?r:"".concat(r)}function iF(r,t,e){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:e?"".concat(e," ",t):t})}function zA(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}function Ii(r,t,e,n){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(f){try{l(n.next(f))}catch(c){o(c)}}function u(f){try{l(n.throw(f))}catch(c){o(c)}}function l(f){f.done?a(f.value):i(f.value).then(s,u)}l((n=n.apply(r,t||[])).next())})}function Oi(r,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(f){return u([l,f])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(e=0)),e;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){e.label=l[1];break}if(l[0]===6&&e.label<a[1]){e.label=a[1],a=l;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(l);break}a[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(r,e)}catch(f){l=[6,f],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var fp=Object.create?function(r,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,i)}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]};function GA(r,t){for(var e in r)e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e)&&fp(t,r,e)}function yv(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m1(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a}function $A(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(m1(arguments[t]));return r}function cp(){for(var r=0,t=0,e=arguments.length;t<e;t++)r+=arguments[t].length;for(var n=Array(r),i=0,t=0;t<e;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}function Bi(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return r.concat(a||Array.prototype.slice.call(t))}function Al(r){return this instanceof Al?(this.v=r,this):new Al(r)}function UA(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(d){n[d]&&(i[d]=function(h){return new Promise(function(v,p){a.push([d,h,v,p])>1||s(d,h)})})}function s(d,h){try{u(n[d](h))}catch(v){c(a[0][3],v)}}function u(d){d.value instanceof Al?Promise.resolve(d.value.v).then(l,f):c(a[0][2],d)}function l(d){s("next",d)}function f(d){s("throw",d)}function c(d,h){d(h),a.shift(),a.length&&s(a[0][0],a[0][1])}}function jA(r){var t,e;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,a){t[i]=r[i]?function(o){return(e=!e)?{value:Al(r[i](o)),done:!1}:a?a(o):o}:a}}function WA(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof yv=="function"?yv(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(a){e[a]=r[a]&&function(o){return new Promise(function(s,u){o=r[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(l){a({value:l,done:s})},o)}}function XA(r,t){return Object.defineProperty?Object.defineProperty(r,"raw",{value:t}):r.raw=t,r}var aF=Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t};function YA(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.prototype.hasOwnProperty.call(r,e)&&fp(t,r,e);return aF(t,r),t}function VA(r){return r&&r.__esModule?r:{default:r}}function HA(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)}function KA(r,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e}function qA(r,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?t===r:r.has(t)}function ZA(r,t,e){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n;if(e){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");r.stack.push({value:t,dispose:n,async:e})}else e&&r.stack.push({async:!0});return t}var oF=typeof SuppressedError=="function"?SuppressedError:function(r,t,e){var n=new Error(e);return n.name="SuppressedError",n.error=r,n.suppressed=t,n};function QA(r){function t(n){r.error=r.hasError?new oF(n,r.error,"An error was suppressed during disposal."):n,r.hasError=!0}function e(){for(;r.stack.length;){var n=r.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(e,function(a){return t(a),e()})}catch(a){t(a)}}if(r.hasError)throw r.error}return e()}const sF={__extends:zt,__assign:F,__rest:Ln,__decorate:BA,__param:FA,__metadata:zA,__awaiter:Ii,__generator:Oi,__createBinding:fp,__exportStar:GA,__values:yv,__read:m1,__spread:$A,__spreadArrays:cp,__spreadArray:Bi,__await:Al,__asyncGenerator:UA,__asyncDelegator:jA,__asyncValues:WA,__makeTemplateObject:XA,__importStar:YA,__importDefault:VA,__classPrivateFieldGet:HA,__classPrivateFieldSet:KA,__classPrivateFieldIn:qA,__addDisposableResource:ZA,__disposeResources:QA},uF=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:ZA,get __assign(){return F},__asyncDelegator:jA,__asyncGenerator:UA,__asyncValues:WA,__await:Al,__awaiter:Ii,__classPrivateFieldGet:HA,__classPrivateFieldIn:qA,__classPrivateFieldSet:KA,__createBinding:fp,__decorate:BA,__disposeResources:QA,__esDecorate:tF,__exportStar:GA,__extends:zt,__generator:Oi,__importDefault:VA,__importStar:YA,__makeTemplateObject:XA,__metadata:zA,__param:FA,__propKey:nF,__read:m1,__rest:Ln,__runInitializers:rF,__setFunctionName:iF,__spread:$A,__spreadArray:Bi,__spreadArrays:cp,__values:yv,default:sF},Symbol.toStringTag,{value:"Module"}));var Ei=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},mv=function(r,t){return Ei(r)?r.indexOf(t)>-1:!1},dp=function(r,t){if(!Ei(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];t(i,n)&&e.push(i)}return e},lF=function(r,t){return t===void 0&&(t=[]),dp(r,function(e){return!mv(t,e)})},fF={}.toString,xa=function(r,t){return fF.call(r)==="[object "+t+"]"};const Yr=function(r){return xa(r,"Function")};var gt=function(r){return r==null};const wt=function(r){return Array.isArray?Array.isArray(r):xa(r,"Array")},Wn=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function xe(r,t){if(r){var e;if(wt(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(Wn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var JA=Object.keys?function(r){return Object.keys(r)}:function(r){var t=[];return xe(r,function(e,n){Yr(r)&&n==="prototype"||t.push(n)}),t};function eT(r,t){var e=JA(t),n=e.length;if(gt(r))return!n;for(var i=0;i<n;i+=1){var a=e[i];if(t[a]!==r[a]||!(a in r))return!1}return!0}var bv=function(r){return typeof r=="object"&&r!==null},Un=function(r){if(!bv(r)||!xa(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t};function cF(r,t){if(!wt(r))return null;var e;if(Yr(t)&&(e=t),Un(t)&&(e=function(i){return eT(i,t)}),e){for(var n=0;n<r.length;n+=1)if(e(r[n]))return r[n]}return null}function dF(r,t,e){e===void 0&&(e=0);for(var n=e;n<r.length;n++)if(t(r[n],n))return n;return-1}var hF=function(r,t){for(var e=null,n=0;n<r.length;n++){var i=r[n],a=i[t];if(!gt(a)){wt(a)?e=a[0]:e=a;break}}return e},vF=function(r){if(!wt(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},tT=function(r,t){if(t===void 0&&(t=[]),!wt(r))t.push(r);else for(var e=0;e<r.length;e+=1)tT(r[e],t);return t};const Qa=function(r){if(wt(r))return r.reduce(function(t,e){return Math.max(t,e)},r[0])},Ja=function(r){if(wt(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])};var rT=function(r){var t=r.filter(function(o){return!isNaN(o)});if(!t.length)return{min:0,max:0};if(wt(r[0])){for(var e=[],n=0;n<r.length;n++)e=e.concat(r[n]);t=e}var i=Qa(t),a=Ja(t);return{min:a,max:i}},nT=Array.prototype,pF=nT.splice,gF=nT.indexOf,yF=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n++)for(var i=t[n],a=-1;(a=gF.call(r,i))>-1;)pF.call(r,a,1);return r},mF=Array.prototype.splice,iT=function(t,e){if(!Ei(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var a=void 0,o=e[n];(n===i||o!==a)&&(a=o,mF.call(t,o,1))}return t},aT=function(r,t,e){if(!wt(r)&&!Un(r))return r;var n=e;return xe(r,function(i,a){n=t(n,i,a)}),n},bF=function(r,t){var e=[];if(!Ei(r))return e;for(var n=-1,i=[],a=r.length;++n<a;){var o=r[n];t(o,n,r)&&(e.push(o),i.push(n))}return iT(r,i),e};const Fe=function(r){return xa(r,"String")};function xF(r,t){var e;if(Yr(t))e=function(i,a){return t(i)-t(a)};else{var n=[];Fe(t)?n.push(t):wt(t)&&(n=t),e=function(i,a){for(var o=0;o<n.length;o+=1){var s=n[o];if(i[s]>a[s])return 1;if(i[s]<a[s])return-1}return 0}}return r.sort(e),r}function lc(r,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];t.has(a)||(e.push(a),t.set(a,!0))}return e}var wF=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return lc([].concat.apply([],r))};const EF=function(r,t){for(var e=[],n={},i=0;i<r.length;i++){var a=r[i],o=a[t];if(!gt(o)){wt(o)||(o=[o]);for(var s=0;s<o.length;s++){var u=o[s];n[u]||(e.push(u),n[u]=!0)}}}return e};function Ka(r){if(Ei(r))return r[0]}function Ji(r){if(Ei(r)){var t=r;return t[t.length-1]}}function _F(r,t){return wt(r)||Fe(r)?r[0]===t:!1}function SF(r,t){return wt(r)||Fe(r)?r[r.length-1]===t:!1}var MF=function(r,t){for(var e=0;e<r.length;e++)if(!t(r[e],e))return!1;return!0},CF=function(r,t){for(var e=0;e<r.length;e++)if(t(r[e],e))return!0;return!1},AF=Object.prototype.hasOwnProperty;function xv(r,t){if(!t||!wt(r))return{};for(var e={},n=Yr(t)?t:function(s){return s[t]},i,a=0;a<r.length;a++){var o=r[a];i=n(o),AF.call(e,i)?e[i].push(o):e[i]=[o]}return e}function oT(r,t){if(!t)return{0:r};if(!Yr(t)){var e=wt(t)?t:t.replace(/\s+/g,"").split("*");t=function(n){for(var i="_",a=0,o=e.length;a<o;a++)i+=n[e[a]]&&n[e[a]].toString();return i}}return xv(r,t)}const TF=function(r,t){if(!t)return[r];var e=oT(r,t),n=[];for(var i in e)n.push(e[i]);return n};function IF(r,t){return r["_wrap_"+t]}function tu(r,t){if(r["_wrap_"+t])return r["_wrap_"+t];var e=function(n){r[t](n)};return r["_wrap_"+t]=e,e}var GE={};function OF(r){var t=GE[r];if(!t){for(var e=r.toString(16),n=e.length;n<6;n++)e="0"+e;t="#"+e,GE[r]=t}return t}function LF(r){var t=0,e=0,n=0,i=0;return wt(r)?r.length===1?t=e=n=i=r[0]:r.length===2?(t=n=r[0],e=i=r[1]):r.length===3?(t=r[0],e=i=r[1],n=r[2]):(t=r[0],e=r[1],n=r[2],i=r[3]):t=e=n=i=r,{r1:t,r2:e,r3:n,r4:i}}var kF=function(r,t,e){return r<t?t:r>e?e:r},jh=function(r,t){var e=t.toString(),n=e.indexOf(".");if(n===-1)return Math.round(r);var i=e.substr(n+1).length;return i>20&&(i=20),parseFloat(r.toFixed(i))},mt=function(r){return xa(r,"Number")},DF=function(r){return mt(r)&&r%1!==0},NF=function(r){return mt(r)&&r%2===0},PF=Number.isInteger?Number.isInteger:function(r){return mt(r)&&r%1===0},RF=function(r){return mt(r)&&r<0},BF=1e-5;function sT(r,t,e){return e===void 0&&(e=BF),Math.abs(r-t)<e}var FF=function(r){return mt(r)&&r%2!==0},zF=function(r){return mt(r)&&r>0};const GF=function(r,t){if(wt(r)){for(var e,n=-1/0,i=0;i<r.length;i++){var a=r[i],o=Yr(t)?t(a):a[t];o>n&&(e=a,n=o)}return e}},$F=function(r,t){if(wt(r)){for(var e,n=1/0,i=0;i<r.length;i++){var a=r[i],o=Yr(t)?t(a):a[t];o<n&&(e=a,n=o)}return e}};var hp=function(r,t){return(r%t+t)%t},UF=180/Math.PI,jF=function(r){return UF*r};const WF=parseInt;var XF=Math.PI/180,vp=function(r){return XF*r};const $E=function(r,t){return r.hasOwnProperty(t)};var b1=Object.values?function(r){return Object.values(r)}:function(r){var t=[];return xe(r,function(e,n){Yr(r)&&n==="prototype"||t.push(e)}),t};const YF=function(r,t){return mv(b1(r),t)},Yl=function(r){return gt(r)?"":r.toString()};var VF=function(r){return Yl(r).toLowerCase()},HF=function(r){var t=Yl(r);return t.charAt(0).toLowerCase()+t.substring(1)};function KF(r,t){return!r||!t?r:r.replace(/\\?\{([^{}]+)\}/g,function(e,n){return e.charAt(0)==="\\"?e.slice(1):t[n]===void 0?"":t[n]})}var qF=function(r){return Yl(r).toUpperCase()},Tl=function(r){var t=Yl(r);return t.charAt(0).toUpperCase()+t.substring(1)},ZF={}.toString,uT=function(r){return ZF.call(r).replace(/^\[object /,"").replace(/]$/,"")},QF=function(r){return xa(r,"Arguments")},Bc=function(r){return xa(r,"Boolean")},x1=function(r){return xa(r,"Date")},JF=function(r){return xa(r,"Error")};function e6(r){return mt(r)&&isFinite(r)}var t6=function(r){return r===null},r6=Object.prototype,lT=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||r6;return r===e},n6=function(r){return xa(r,"RegExp")},i6=function(r){return r===void 0},a6=function(r){return r instanceof Element||r instanceof HTMLDocument};function fT(r){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,16)};return t(r)}function cT(r){var t=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;t(r)}function c0(r,t){for(var e in t)t.hasOwnProperty(e)&&e!=="constructor"&&t[e]!==void 0&&(r[e]=t[e])}function Mt(r,t,e,n){return t&&c0(r,t),e&&c0(r,e),n&&c0(r,n),r}var o6=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var e=r[0],n=1;n<r.length;n++){var i=r[n];Yr(i)&&(i=i.prototype),Mt(e.prototype,i)}},ar=function(r){if(typeof r!="object"||r===null)return r;var t;if(wt(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=ar(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=ar(r[i]):t[i]=r[i]}return t};function Fc(r,t,e){var n;return function(){var i=this,a=arguments,o=function(){n=null,e||r.apply(i,a)},s=e&&!n;clearTimeout(n),n=setTimeout(o,t),s&&r.apply(i,a)}}const dT=function(r,t){if(!Yr(r))throw new TypeError("Expected a function");var e=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=t?t.apply(this,n):n[0],o=e.cache;if(o.has(a))return o.get(a);var s=r.apply(this,n);return o.set(a,s),s};return e.cache=new Map,e};var s6=5;function hT(r,t,e,n){e=e||0,n=n||s6;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];a!==null&&Un(a)?(Un(r[i])||(r[i]={}),e<n?hT(r[i],a,e+1,n):r[i]=t[i]):wt(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var Pr=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)hT(r,t[n]);return r},u6=function(r,t,e,n){Yr(t)||(e=t,t=r,r=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function u(){}u.prototype=o;var l=new u;return l.constructor=s,l},a=i(t.prototype,r);return r.prototype=Mt(a,r.prototype),r.superclass=i(t.prototype,t),Mt(a,e),Mt(r,n),r},w1=function(r,t){if(!Ei(r))return-1;var e=Array.prototype.indexOf;if(e)return e.call(r,t);for(var n=-1,i=0;i<r.length;i++)if(r[i]===t){n=i;break}return n},l6=Object.prototype.hasOwnProperty;function vT(r){if(gt(r))return!0;if(Ei(r))return!r.length;var t=uT(r);if(t==="Map"||t==="Set")return!r.size;if(lT(r))return!Object.keys(r).length;for(var e in r)if(l6.call(r,e))return!1;return!0}var ms=function(r,t){if(r===t)return!0;if(!r||!t||Fe(r)||Fe(t))return!1;if(Ei(r)||Ei(t)){if(r.length!==t.length)return!1;for(var e=!0,n=0;n<r.length&&(e=ms(r[n],t[n]),!!e);n++);return e}if(bv(r)||bv(t)){var i=Object.keys(r),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,n=0;n<i.length&&(e=ms(r[i[n]],t[i[n]]),!!e);n++);return e}return!1};const f6=function(r,t,e){return Yr(e)?!!e(r,t):ms(r,t)};var cu=function(r,t){if(!Ei(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];e.push(t(i,n))}return e},c6=function(r){return r};const d6=function(r,t){t===void 0&&(t=c6);var e={};return Wn(r)&&!gt(r)&&Object.keys(r).forEach(function(n){e[n]=t(r[n],n)}),e},Co=function(r,t,e){for(var n=0,i=Fe(t)?t.split("."):t;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?e:r},h6=function(r,t,e){var n=r,i=Fe(t)?t.split("."):t;return i.forEach(function(a,o){o<i.length-1?(Wn(n[a])||(n[a]=mt(i[o+1])?[]:{}),n=n[a]):n[a]=e}),r};var v6=Object.prototype.hasOwnProperty;const p6=function(r,t){if(r===null||!Un(r))return{};var e={};return xe(t,function(n){v6.call(r,n)&&(e[n]=r[n])}),e},g6=function(r,t){return aT(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})},fc=function(r,t,e){var n,i,a,o,s=0;e||(e={});var u=function(){s=e.leading===!1?0:Date.now(),n=null,o=r.apply(i,a),n||(i=a=null)},l=function(){var f=Date.now();!s&&e.leading===!1&&(s=f);var c=t-(f-s);return i=this,a=arguments,c<=0||c>t?(n&&(clearTimeout(n),n=null),s=f,o=r.apply(i,a),n||(i=a=null)):!n&&e.trailing!==!1&&(n=setTimeout(u,c)),o};return l.cancel=function(){clearTimeout(n),s=0,n=i=a=null},l},pT=function(r){return Ei(r)?Array.prototype.slice.call(r):[]};var Wd={};const eo=function(r){return r=r||"g",Wd[r]?Wd[r]+=1:Wd[r]=1,r+Wd[r]},Bf=function(){},y6=function(r){return r};function pp(r){return gt(r)?0:Ei(r)?r.length:Object.keys(r).length}var Xd;const Ff=dT(function(r,t){t===void 0&&(t={});var e=t.fontSize,n=t.fontFamily,i=t.fontWeight,a=t.fontStyle,o=t.fontVariant;return Xd||(Xd=document.createElement("canvas").getContext("2d")),Xd.font=[a,o,i,e+"px",n].join(" "),Xd.measureText(Fe(r)?r:"").width},function(r,t){return t===void 0&&(t={}),cp([r],b1(t)).join("")}),m6=function(r,t,e,n){n===void 0&&(n="...");var i=16,a=Ff(n,e),o=Fe(r)?r:Yl(r),s=t,u=[],l,f;if(Ff(r,e)<=t)return r;for(;l=o.substr(0,i),f=Ff(l,e),!(f+a>s&&f>s);)if(u.push(l),s-=f,o=o.substr(i),!o)return u.join("");for(;l=o.substr(0,1),f=Ff(l,e),!(f+a>s);)if(u.push(l),s-=f,o=o.substr(1),!o)return u.join("");return""+u.join("")+n};var b6=function(){function r(){this.map={}}return r.prototype.has=function(t){return this.map[t]!==void 0},r.prototype.get=function(t,e){var n=this.map[t];return n===void 0?e:n},r.prototype.set=function(t,e){this.map[t]=e},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(t){delete this.map[t]},r.prototype.size=function(){return Object.keys(this.map).length},r}();const x6=Object.freeze(Object.defineProperty({__proto__:null,Cache:b6,assign:Mt,augment:o6,clamp:kF,clearAnimationFrame:cT,clone:ar,contains:mv,debounce:Fc,deepMix:Pr,difference:lF,each:xe,endsWith:SF,every:MF,extend:u6,filter:dp,find:cF,findIndex:dF,firstValue:hF,fixedBase:jh,flatten:vF,flattenDeep:tT,forIn:xe,get:Co,getEllipsisText:m6,getRange:rT,getType:uT,getWrapBehavior:IF,group:TF,groupBy:xv,groupToMap:oT,has:$E,hasKey:$E,hasValue:YF,head:Ka,identity:y6,includes:mv,indexOf:w1,isArguments:QF,isArray:wt,isArrayLike:Ei,isBoolean:Bc,isDate:x1,isDecimal:DF,isElement:a6,isEmpty:vT,isEqual:ms,isEqualWith:f6,isError:JF,isEven:NF,isFinite:e6,isFunction:Yr,isInteger:PF,isMatch:eT,isNegative:RF,isNil:gt,isNull:t6,isNumber:mt,isNumberEqual:sT,isObject:Wn,isObjectLike:bv,isOdd:FF,isPlainObject:Un,isPositive:zF,isPrototype:lT,isRegExp:n6,isString:Fe,isType:xa,isUndefined:i6,keys:JA,last:Ji,lowerCase:VF,lowerFirst:HF,map:cu,mapValues:d6,max:Qa,maxBy:GF,measureTextWidth:Ff,memoize:dT,min:Ja,minBy:$F,mix:Mt,mod:hp,noop:Bf,number2color:OF,omit:g6,parseRadius:LF,pick:p6,pull:yF,pullAt:iT,reduce:aT,remove:bF,requestAnimationFrame:fT,set:h6,size:pp,some:CF,sortBy:xF,startsWith:_F,substitute:KF,throttle:fc,toArray:pT,toDegree:jF,toInteger:WF,toRadian:vp,toString:Yl,union:wF,uniq:lc,uniqueId:eo,upperCase:qF,upperFirst:Tl,values:b1,valuesOfKey:EF,wrapBehavior:tu},Symbol.toStringTag,{value:"Module"})),w6={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(t){return Object.assign(this,t),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(t){var e=this,n=this.events;this.graph=t,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!0),xe(n,function(i,a){t.on(a,i)}),document.addEventListener("visibilitychange",function(){e.keydown=!1})},unbind:function(t){var e=this.events,n=t.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!1),xe(e,function(i,a){t.off(a,i)}),t.get("canvas").set("draggable",n)},get:function(t){return this[t]},set:function(t,e){return this[t]=e,this}};var E1=function(){function r(){}return r.registerBehavior=function(t,e){if(!e)throw new Error("please specify handler for this behavior: ".concat(t));var n=ar(w6);Object.assign(n,e);var i=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var u=this.getEvents();this.events=null;var l={};u&&(xe(u,function(f,c){l[c]=tu(s,f)}),this.events=l)};i.prototype=n,r.types[t]=i},r.hasBehavior=function(t){return!!r.types[t]},r.getBehavior=function(t){return r.types[t]},r.types={},r}(),E6="*",gT=function(){function r(){this._events={}}return r.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},r.prototype.once=function(t,e){return this.on(t,e,!0)},r.prototype.emit=function(t){for(var e=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this._events[t]||[],o=this._events[E6]||[],s=function(u){for(var l=u.length,f=0;f<l;f++)if(u[f]){var c=u[f],d=c.callback,h=c.once;h&&(u.splice(f,1),u.length===0&&delete e._events[t],l--,f--),d.apply(e,n)}};s(a),s(o)},r.prototype.off=function(t,e){if(!t)this._events={};else if(!e)delete this._events[t];else{for(var n=this._events[t]||[],i=n.length,a=0;a<i;a++)n[a].callback===e&&(n.splice(a,1),i--,a--);n.length===0&&delete this._events[t]}return this},r.prototype.getEvents=function(){return this._events},r}(),It=1e-6,vr=typeof Float32Array<"u"?Float32Array:Array,va=Math.random;function _6(r){vr=r}var S6=Math.PI/180;function M6(r){return r*S6}function C6(r,t){return Math.abs(r-t)<=It*Math.max(1,Math.abs(r),Math.abs(t))}Math.hypot||(Math.hypot=function(){for(var r=0,t=arguments.length;t--;)r+=arguments[t]*arguments[t];return Math.sqrt(r)});const A6=Object.freeze(Object.defineProperty({__proto__:null,get ARRAY_TYPE(){return vr},EPSILON:It,RANDOM:va,equals:C6,setMatrixArrayType:_6,toRadian:M6},Symbol.toStringTag,{value:"Module"}));function T6(){var r=new vr(4);return vr!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}function I6(r){var t=new vr(4);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function O6(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function L6(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}function k6(r,t,e,n){var i=new vr(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function D6(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function N6(r,t){if(r===t){var e=t[1];r[1]=t[2],r[2]=e}else r[0]=t[0],r[1]=t[2],r[2]=t[1],r[3]=t[3];return r}function P6(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*a-i*n;return o?(o=1/o,r[0]=a*o,r[1]=-n*o,r[2]=-i*o,r[3]=e*o,r):null}function R6(r,t){var e=t[0];return r[0]=t[3],r[1]=-t[1],r[2]=-t[2],r[3]=e,r}function B6(r){return r[0]*r[3]-r[2]*r[1]}function yT(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],l=e[2],f=e[3];return r[0]=n*s+a*u,r[1]=i*s+o*u,r[2]=n*l+a*f,r[3]=i*l+o*f,r}function F6(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+a*s,r[1]=i*u+o*s,r[2]=n*-s+a*u,r[3]=i*-s+o*u,r}function z6(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1];return r[0]=n*s,r[1]=i*s,r[2]=a*u,r[3]=o*u,r}function G6(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=-e,r[3]=n,r}function $6(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r}function U6(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function j6(r){return Math.hypot(r[0],r[1],r[2],r[3])}function W6(r,t,e,n){return r[2]=n[2]/n[0],e[0]=n[0],e[1]=n[1],e[3]=n[3]-r[2]*e[1],[r,t,e]}function X6(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function mT(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r}function Y6(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function V6(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=t[0],s=t[1],u=t[2],l=t[3];return Math.abs(e-o)<=It*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=It*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=It*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-l)<=It*Math.max(1,Math.abs(a),Math.abs(l))}function H6(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function K6(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r}var q6=yT,Z6=mT;const Q6=Object.freeze(Object.defineProperty({__proto__:null,LDU:W6,add:X6,adjoint:R6,clone:I6,copy:O6,create:T6,determinant:B6,equals:V6,exactEquals:Y6,frob:j6,fromRotation:G6,fromScaling:$6,fromValues:k6,identity:L6,invert:P6,mul:q6,multiply:yT,multiplyScalar:H6,multiplyScalarAndAdd:K6,rotate:F6,scale:z6,set:D6,str:U6,sub:Z6,subtract:mT,transpose:N6},Symbol.toStringTag,{value:"Module"}));function J6(){var r=new vr(6);return vr!=Float32Array&&(r[1]=0,r[2]=0,r[4]=0,r[5]=0),r[0]=1,r[3]=1,r}function ez(r){var t=new vr(6);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t}function tz(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function rz(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function nz(r,t,e,n,i,a){var o=new vr(6);return o[0]=r,o[1]=t,o[2]=e,o[3]=n,o[4]=i,o[5]=a,o}function iz(r,t,e,n,i,a,o){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r}function az(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=e*a-n*i;return u?(u=1/u,r[0]=a*u,r[1]=-n*u,r[2]=-i*u,r[3]=e*u,r[4]=(i*s-a*o)*u,r[5]=(n*o-e*s)*u,r):null}function oz(r){return r[0]*r[3]-r[1]*r[2]}function bT(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=e[0],f=e[1],c=e[2],d=e[3],h=e[4],v=e[5];return r[0]=n*l+a*f,r[1]=i*l+o*f,r[2]=n*c+a*d,r[3]=i*c+o*d,r[4]=n*h+a*v+s,r[5]=i*h+o*v+u,r}function sz(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=Math.sin(e),f=Math.cos(e);return r[0]=n*f+a*l,r[1]=i*f+o*l,r[2]=n*-l+a*f,r[3]=i*-l+o*f,r[4]=s,r[5]=u,r}function uz(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=e[0],f=e[1];return r[0]=n*l,r[1]=i*l,r[2]=a*f,r[3]=o*f,r[4]=s,r[5]=u,r}function lz(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=e[0],f=e[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=n*l+a*f+s,r[5]=i*l+o*f+u,r}function fz(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=-e,r[3]=n,r[4]=0,r[5]=0,r}function cz(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r[4]=0,r[5]=0,r}function dz(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=t[0],r[5]=t[1],r}function hz(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"}function vz(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],1)}function pz(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r}function xT(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r}function gz(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r}function yz(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r}function mz(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]}function bz(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=t[0],l=t[1],f=t[2],c=t[3],d=t[4],h=t[5];return Math.abs(e-u)<=It*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(n-l)<=It*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=It*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-c)<=It*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-d)<=It*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(s-h)<=It*Math.max(1,Math.abs(s),Math.abs(h))}var xz=bT,wz=xT;const Ez=Object.freeze(Object.defineProperty({__proto__:null,add:pz,clone:ez,copy:tz,create:J6,determinant:oz,equals:bz,exactEquals:mz,frob:vz,fromRotation:fz,fromScaling:cz,fromTranslation:dz,fromValues:nz,identity:rz,invert:az,mul:xz,multiply:bT,multiplyScalar:gz,multiplyScalarAndAdd:yz,rotate:sz,scale:uz,set:iz,str:hz,sub:wz,subtract:xT,translate:lz},Symbol.toStringTag,{value:"Module"}));function wT(){var r=new vr(9);return vr!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function _z(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[4],r[4]=t[5],r[5]=t[6],r[6]=t[8],r[7]=t[9],r[8]=t[10],r}function Sz(r){var t=new vr(9);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t}function Mz(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function Cz(r,t,e,n,i,a,o,s,u){var l=new vr(9);return l[0]=r,l[1]=t,l[2]=e,l[3]=n,l[4]=i,l[5]=a,l[6]=o,l[7]=s,l[8]=u,l}function Az(r,t,e,n,i,a,o,s,u,l){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=l,r}function Tz(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function Iz(r,t){if(r===t){var e=t[1],n=t[2],i=t[5];r[1]=t[3],r[2]=t[6],r[3]=e,r[5]=t[7],r[6]=n,r[7]=i}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r}function _1(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8],c=f*o-s*l,d=-f*a+s*u,h=l*a-o*u,v=e*c+n*d+i*h;return v?(v=1/v,r[0]=c*v,r[1]=(-f*n+i*l)*v,r[2]=(s*n-i*o)*v,r[3]=d*v,r[4]=(f*e-i*u)*v,r[5]=(-s*e+i*a)*v,r[6]=h*v,r[7]=(-l*e+n*u)*v,r[8]=(o*e-n*a)*v,r):null}function Oz(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8];return r[0]=o*f-s*l,r[1]=i*l-n*f,r[2]=n*s-i*o,r[3]=s*u-a*f,r[4]=e*f-i*u,r[5]=i*a-e*s,r[6]=a*l-o*u,r[7]=n*u-e*l,r[8]=e*o-n*a,r}function Lz(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],l=r[8];return t*(l*a-o*u)+e*(-l*i+o*s)+n*(u*i-a*s)}function no(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=t[8],d=e[0],h=e[1],v=e[2],p=e[3],g=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return r[0]=d*n+h*o+v*l,r[1]=d*i+h*s+v*f,r[2]=d*a+h*u+v*c,r[3]=p*n+g*o+y*l,r[4]=p*i+g*s+y*f,r[5]=p*a+g*u+y*c,r[6]=m*n+b*o+x*l,r[7]=m*i+b*s+x*f,r[8]=m*a+b*u+x*c,r}function kz(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=t[8],d=e[0],h=e[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=u,r[6]=d*n+h*o+l,r[7]=d*i+h*s+f,r[8]=d*a+h*u+c,r}function Dz(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=t[8],d=Math.sin(e),h=Math.cos(e);return r[0]=h*n+d*o,r[1]=h*i+d*s,r[2]=h*a+d*u,r[3]=h*o-d*n,r[4]=h*s-d*i,r[5]=h*u-d*a,r[6]=l,r[7]=f,r[8]=c,r}function Nz(r,t,e){var n=e[0],i=e[1];return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=i*t[3],r[4]=i*t[4],r[5]=i*t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function S1(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=t[0],r[7]=t[1],r[8]=1,r}function M1(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=-e,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function C1(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=t[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function Pz(r,t){return r[0]=t[0],r[1]=t[1],r[2]=0,r[3]=t[2],r[4]=t[3],r[5]=0,r[6]=t[4],r[7]=t[5],r[8]=1,r}function Rz(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e+e,s=n+n,u=i+i,l=e*o,f=n*o,c=n*s,d=i*o,h=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[3]=f-y,r[6]=d+g,r[1]=f+y,r[4]=1-l-v,r[7]=h-p,r[2]=d-g,r[5]=h+p,r[8]=1-l-c,r}function Bz(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8],c=t[9],d=t[10],h=t[11],v=t[12],p=t[13],g=t[14],y=t[15],m=e*s-n*o,b=e*u-i*o,x=e*l-a*o,w=n*u-i*s,E=n*l-a*s,_=i*l-a*u,M=f*p-c*v,C=f*g-d*v,S=f*y-h*v,A=c*g-d*p,T=c*y-h*p,I=d*y-h*g,k=m*I-b*T+x*A+w*S-E*C+_*M;return k?(k=1/k,r[0]=(s*I-u*T+l*A)*k,r[1]=(u*S-o*I-l*C)*k,r[2]=(o*T-s*S+l*M)*k,r[3]=(i*T-n*I-a*A)*k,r[4]=(e*I-i*S+a*C)*k,r[5]=(n*S-e*T-a*M)*k,r[6]=(p*_-g*E+y*w)*k,r[7]=(g*x-v*_-y*b)*k,r[8]=(v*E-p*x+y*m)*k,r):null}function Fz(r,t,e){return r[0]=2/t,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/e,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}function zz(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function Gz(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function $z(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r}function ET(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r}function Uz(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r}function jz(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r}function Wz(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]}function Xz(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],c=t[0],d=t[1],h=t[2],v=t[3],p=t[4],g=t[5],y=t[6],m=t[7],b=t[8];return Math.abs(e-c)<=It*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(n-d)<=It*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-h)<=It*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-v)<=It*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=It*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=It*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=It*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(l-m)<=It*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(f-b)<=It*Math.max(1,Math.abs(f),Math.abs(b))}var Yz=no,Vz=ET;const _T=Object.freeze(Object.defineProperty({__proto__:null,add:$z,adjoint:Oz,clone:Sz,copy:Mz,create:wT,determinant:Lz,equals:Xz,exactEquals:Wz,frob:Gz,fromMat2d:Pz,fromMat4:_z,fromQuat:Rz,fromRotation:M1,fromScaling:C1,fromTranslation:S1,fromValues:Cz,identity:Tz,invert:_1,mul:Yz,multiply:no,multiplyScalar:Uz,multiplyScalarAndAdd:jz,normalFromMat4:Bz,projection:Fz,rotate:Dz,scale:Nz,set:Az,str:zz,sub:Vz,subtract:ET,translate:kz,transpose:Iz},Symbol.toStringTag,{value:"Module"}));function Hz(){var r=new vr(16);return vr!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function Kz(r){var t=new vr(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}function qz(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function Zz(r,t,e,n,i,a,o,s,u,l,f,c,d,h,v,p){var g=new vr(16);return g[0]=r,g[1]=t,g[2]=e,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=l,g[10]=f,g[11]=c,g[12]=d,g[13]=h,g[14]=v,g[15]=p,g}function Qz(r,t,e,n,i,a,o,s,u,l,f,c,d,h,v,p,g){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=l,r[9]=f,r[10]=c,r[11]=d,r[12]=h,r[13]=v,r[14]=p,r[15]=g,r}function ST(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Jz(r,t){if(r===t){var e=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=e,r[6]=t[9],r[7]=t[13],r[8]=n,r[9]=a,r[11]=t[14],r[12]=i,r[13]=o,r[14]=s}else r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=t[1],r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=t[2],r[9]=t[6],r[10]=t[10],r[11]=t[14],r[12]=t[3],r[13]=t[7],r[14]=t[11],r[15]=t[15];return r}function eG(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8],c=t[9],d=t[10],h=t[11],v=t[12],p=t[13],g=t[14],y=t[15],m=e*s-n*o,b=e*u-i*o,x=e*l-a*o,w=n*u-i*s,E=n*l-a*s,_=i*l-a*u,M=f*p-c*v,C=f*g-d*v,S=f*y-h*v,A=c*g-d*p,T=c*y-h*p,I=d*y-h*g,k=m*I-b*T+x*A+w*S-E*C+_*M;return k?(k=1/k,r[0]=(s*I-u*T+l*A)*k,r[1]=(i*T-n*I-a*A)*k,r[2]=(p*_-g*E+y*w)*k,r[3]=(d*E-c*_-h*w)*k,r[4]=(u*S-o*I-l*C)*k,r[5]=(e*I-i*S+a*C)*k,r[6]=(g*x-v*_-y*b)*k,r[7]=(f*_-d*x+h*b)*k,r[8]=(o*T-s*S+l*M)*k,r[9]=(n*S-e*T-a*M)*k,r[10]=(v*E-p*x+y*m)*k,r[11]=(c*x-f*E-h*m)*k,r[12]=(s*C-o*A-u*M)*k,r[13]=(e*A-n*C+i*M)*k,r[14]=(p*b-v*w-g*m)*k,r[15]=(f*w-c*b+d*m)*k,r):null}function tG(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8],c=t[9],d=t[10],h=t[11],v=t[12],p=t[13],g=t[14],y=t[15];return r[0]=s*(d*y-h*g)-c*(u*y-l*g)+p*(u*h-l*d),r[1]=-(n*(d*y-h*g)-c*(i*y-a*g)+p*(i*h-a*d)),r[2]=n*(u*y-l*g)-s*(i*y-a*g)+p*(i*l-a*u),r[3]=-(n*(u*h-l*d)-s*(i*h-a*d)+c*(i*l-a*u)),r[4]=-(o*(d*y-h*g)-f*(u*y-l*g)+v*(u*h-l*d)),r[5]=e*(d*y-h*g)-f*(i*y-a*g)+v*(i*h-a*d),r[6]=-(e*(u*y-l*g)-o*(i*y-a*g)+v*(i*l-a*u)),r[7]=e*(u*h-l*d)-o*(i*h-a*d)+f*(i*l-a*u),r[8]=o*(c*y-h*p)-f*(s*y-l*p)+v*(s*h-l*c),r[9]=-(e*(c*y-h*p)-f*(n*y-a*p)+v*(n*h-a*c)),r[10]=e*(s*y-l*p)-o*(n*y-a*p)+v*(n*l-a*s),r[11]=-(e*(s*h-l*c)-o*(n*h-a*c)+f*(n*l-a*s)),r[12]=-(o*(c*g-d*p)-f*(s*g-u*p)+v*(s*d-u*c)),r[13]=e*(c*g-d*p)-f*(n*g-i*p)+v*(n*d-i*c),r[14]=-(e*(s*g-u*p)-o*(n*g-i*p)+v*(n*u-i*s)),r[15]=e*(s*d-u*c)-o*(n*d-i*c)+f*(n*u-i*s),r}function rG(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],l=r[8],f=r[9],c=r[10],d=r[11],h=r[12],v=r[13],p=r[14],g=r[15],y=t*o-e*a,m=t*s-n*a,b=t*u-i*a,x=e*s-n*o,w=e*u-i*o,E=n*u-i*s,_=l*v-f*h,M=l*p-c*h,C=l*g-d*h,S=f*p-c*v,A=f*g-d*v,T=c*g-d*p;return y*T-m*A+b*S+x*C-w*M+E*_}function MT(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=t[8],d=t[9],h=t[10],v=t[11],p=t[12],g=t[13],y=t[14],m=t[15],b=e[0],x=e[1],w=e[2],E=e[3];return r[0]=b*n+x*s+w*c+E*p,r[1]=b*i+x*u+w*d+E*g,r[2]=b*a+x*l+w*h+E*y,r[3]=b*o+x*f+w*v+E*m,b=e[4],x=e[5],w=e[6],E=e[7],r[4]=b*n+x*s+w*c+E*p,r[5]=b*i+x*u+w*d+E*g,r[6]=b*a+x*l+w*h+E*y,r[7]=b*o+x*f+w*v+E*m,b=e[8],x=e[9],w=e[10],E=e[11],r[8]=b*n+x*s+w*c+E*p,r[9]=b*i+x*u+w*d+E*g,r[10]=b*a+x*l+w*h+E*y,r[11]=b*o+x*f+w*v+E*m,b=e[12],x=e[13],w=e[14],E=e[15],r[12]=b*n+x*s+w*c+E*p,r[13]=b*i+x*u+w*d+E*g,r[14]=b*a+x*l+w*h+E*y,r[15]=b*o+x*f+w*v+E*m,r}function nG(r,t,e){var n=e[0],i=e[1],a=e[2],o,s,u,l,f,c,d,h,v,p,g,y;return t===r?(r[12]=t[0]*n+t[4]*i+t[8]*a+t[12],r[13]=t[1]*n+t[5]*i+t[9]*a+t[13],r[14]=t[2]*n+t[6]*i+t[10]*a+t[14],r[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],l=t[3],f=t[4],c=t[5],d=t[6],h=t[7],v=t[8],p=t[9],g=t[10],y=t[11],r[0]=o,r[1]=s,r[2]=u,r[3]=l,r[4]=f,r[5]=c,r[6]=d,r[7]=h,r[8]=v,r[9]=p,r[10]=g,r[11]=y,r[12]=o*n+f*i+v*a+t[12],r[13]=s*n+c*i+p*a+t[13],r[14]=u*n+d*i+g*a+t[14],r[15]=l*n+h*i+y*a+t[15]),r}function iG(r,t,e){var n=e[0],i=e[1],a=e[2];return r[0]=t[0]*n,r[1]=t[1]*n,r[2]=t[2]*n,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*i,r[6]=t[6]*i,r[7]=t[7]*i,r[8]=t[8]*a,r[9]=t[9]*a,r[10]=t[10]*a,r[11]=t[11]*a,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function aG(r,t,e,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),u,l,f,c,d,h,v,p,g,y,m,b,x,w,E,_,M,C,S,A,T,I,k,P;return s<It?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(e),l=Math.cos(e),f=1-l,c=t[0],d=t[1],h=t[2],v=t[3],p=t[4],g=t[5],y=t[6],m=t[7],b=t[8],x=t[9],w=t[10],E=t[11],_=i*i*f+l,M=a*i*f+o*u,C=o*i*f-a*u,S=i*a*f-o*u,A=a*a*f+l,T=o*a*f+i*u,I=i*o*f+a*u,k=a*o*f-i*u,P=o*o*f+l,r[0]=c*_+p*M+b*C,r[1]=d*_+g*M+x*C,r[2]=h*_+y*M+w*C,r[3]=v*_+m*M+E*C,r[4]=c*S+p*A+b*T,r[5]=d*S+g*A+x*T,r[6]=h*S+y*A+w*T,r[7]=v*S+m*A+E*T,r[8]=c*I+p*k+b*P,r[9]=d*I+g*k+x*P,r[10]=h*I+y*k+w*P,r[11]=v*I+m*k+E*P,t!==r&&(r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r)}function oG(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],f=t[9],c=t[10],d=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=a*i+l*n,r[5]=o*i+f*n,r[6]=s*i+c*n,r[7]=u*i+d*n,r[8]=l*i-a*n,r[9]=f*i-o*n,r[10]=c*i-s*n,r[11]=d*i-u*n,r}function sG(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],o=t[1],s=t[2],u=t[3],l=t[8],f=t[9],c=t[10],d=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i-l*n,r[1]=o*i-f*n,r[2]=s*i-c*n,r[3]=u*i-d*n,r[8]=a*n+l*i,r[9]=o*n+f*i,r[10]=s*n+c*i,r[11]=u*n+d*i,r}function uG(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],o=t[1],s=t[2],u=t[3],l=t[4],f=t[5],c=t[6],d=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i+l*n,r[1]=o*i+f*n,r[2]=s*i+c*n,r[3]=u*i+d*n,r[4]=l*i-a*n,r[5]=f*i-o*n,r[6]=c*i-s*n,r[7]=d*i-u*n,r}function lG(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function fG(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function cG(r,t,e){var n=e[0],i=e[1],a=e[2],o=Math.hypot(n,i,a),s,u,l;return o<It?null:(o=1/o,n*=o,i*=o,a*=o,s=Math.sin(t),u=Math.cos(t),l=1-u,r[0]=n*n*l+u,r[1]=i*n*l+a*s,r[2]=a*n*l-i*s,r[3]=0,r[4]=n*i*l-a*s,r[5]=i*i*l+u,r[6]=a*i*l+n*s,r[7]=0,r[8]=n*a*l+i*s,r[9]=i*a*l-n*s,r[10]=a*a*l+u,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}function dG(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=e,r[7]=0,r[8]=0,r[9]=-e,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function hG(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=0,r[2]=-e,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=e,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function vG(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=0,r[4]=-e,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function CT(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,l=a+a,f=n*s,c=n*u,d=n*l,h=i*u,v=i*l,p=a*l,g=o*s,y=o*u,m=o*l;return r[0]=1-(h+p),r[1]=c+m,r[2]=d-y,r[3]=0,r[4]=c-m,r[5]=1-(f+p),r[6]=v+g,r[7]=0,r[8]=d+y,r[9]=v-g,r[10]=1-(f+h),r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function pG(r,t){var e=new vr(3),n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=n*n+i*i+a*a+o*o;return c>0?(e[0]=(s*o+f*n+u*a-l*i)*2/c,e[1]=(u*o+f*i+l*n-s*a)*2/c,e[2]=(l*o+f*a+s*i-u*n)*2/c):(e[0]=(s*o+f*n+u*a-l*i)*2,e[1]=(u*o+f*i+l*n-s*a)*2,e[2]=(l*o+f*a+s*i-u*n)*2),CT(r,t,e),r}function AT(r,t){return r[0]=t[12],r[1]=t[13],r[2]=t[14],r}function TT(r,t){var e=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],l=t[9],f=t[10];return r[0]=Math.hypot(e,n,i),r[1]=Math.hypot(a,o,s),r[2]=Math.hypot(u,l,f),r}function IT(r,t){var e=new vr(3);TT(e,t);var n=1/e[0],i=1/e[1],a=1/e[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,l=t[4]*n,f=t[5]*i,c=t[6]*a,d=t[8]*n,h=t[9]*i,v=t[10]*a,p=o+f+v,g=0;return p>0?(g=Math.sqrt(p+1)*2,r[3]=.25*g,r[0]=(c-h)/g,r[1]=(d-u)/g,r[2]=(s-l)/g):o>f&&o>v?(g=Math.sqrt(1+o-f-v)*2,r[3]=(c-h)/g,r[0]=.25*g,r[1]=(s+l)/g,r[2]=(d+u)/g):f>v?(g=Math.sqrt(1+f-o-v)*2,r[3]=(d-u)/g,r[0]=(s+l)/g,r[1]=.25*g,r[2]=(c+h)/g):(g=Math.sqrt(1+v-o-f)*2,r[3]=(s-l)/g,r[0]=(d+u)/g,r[1]=(c+h)/g,r[2]=.25*g),r}function gG(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,l=a+a,f=o+o,c=i*u,d=i*l,h=i*f,v=a*l,p=a*f,g=o*f,y=s*u,m=s*l,b=s*f,x=n[0],w=n[1],E=n[2];return r[0]=(1-(v+g))*x,r[1]=(d+b)*x,r[2]=(h-m)*x,r[3]=0,r[4]=(d-b)*w,r[5]=(1-(c+g))*w,r[6]=(p+y)*w,r[7]=0,r[8]=(h+m)*E,r[9]=(p-y)*E,r[10]=(1-(c+v))*E,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function yG(r,t,e,n,i){var a=t[0],o=t[1],s=t[2],u=t[3],l=a+a,f=o+o,c=s+s,d=a*l,h=a*f,v=a*c,p=o*f,g=o*c,y=s*c,m=u*l,b=u*f,x=u*c,w=n[0],E=n[1],_=n[2],M=i[0],C=i[1],S=i[2],A=(1-(p+y))*w,T=(h+x)*w,I=(v-b)*w,k=(h-x)*E,P=(1-(d+y))*E,N=(g+m)*E,z=(v+b)*_,W=(g-m)*_,D=(1-(d+p))*_;return r[0]=A,r[1]=T,r[2]=I,r[3]=0,r[4]=k,r[5]=P,r[6]=N,r[7]=0,r[8]=z,r[9]=W,r[10]=D,r[11]=0,r[12]=e[0]+M-(A*M+k*C+z*S),r[13]=e[1]+C-(T*M+P*C+W*S),r[14]=e[2]+S-(I*M+N*C+D*S),r[15]=1,r}function mG(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e+e,s=n+n,u=i+i,l=e*o,f=n*o,c=n*s,d=i*o,h=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[1]=f+y,r[2]=d-g,r[3]=0,r[4]=f-y,r[5]=1-l-v,r[6]=h+p,r[7]=0,r[8]=d+g,r[9]=h-p,r[10]=1-l-c,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function bG(r,t,e,n,i,a,o){var s=1/(e-t),u=1/(i-n),l=1/(a-o);return r[0]=a*2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*u,r[6]=0,r[7]=0,r[8]=(e+t)*s,r[9]=(i+n)*u,r[10]=(o+a)*l,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*a*2*l,r[15]=0,r}function OT(r,t,e,n,i){var a=1/Math.tan(t/2),o;return r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=(i+n)*o,r[14]=2*i*n*o):(r[10]=-1,r[14]=-2*n),r}var xG=OT;function wG(r,t,e,n,i){var a=1/Math.tan(t/2),o;return r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=i*o,r[14]=i*n*o):(r[10]=-1,r[14]=-n),r}function EG(r,t,e,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),l=2/(i+a);return r[0]=u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=l,r[6]=0,r[7]=0,r[8]=-((o-s)*u*.5),r[9]=(i-a)*l*.5,r[10]=n/(e-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*e/(e-n),r[15]=0,r}function LT(r,t,e,n,i,a,o){var s=1/(t-e),u=1/(n-i),l=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*l,r[11]=0,r[12]=(t+e)*s,r[13]=(i+n)*u,r[14]=(o+a)*l,r[15]=1,r}var _G=LT;function SG(r,t,e,n,i,a,o){var s=1/(t-e),u=1/(n-i),l=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=l,r[11]=0,r[12]=(t+e)*s,r[13]=(i+n)*u,r[14]=a*l,r[15]=1,r}function MG(r,t,e,n){var i,a,o,s,u,l,f,c,d,h,v=t[0],p=t[1],g=t[2],y=n[0],m=n[1],b=n[2],x=e[0],w=e[1],E=e[2];return Math.abs(v-x)<It&&Math.abs(p-w)<It&&Math.abs(g-E)<It?ST(r):(f=v-x,c=p-w,d=g-E,h=1/Math.hypot(f,c,d),f*=h,c*=h,d*=h,i=m*d-b*c,a=b*f-y*d,o=y*c-m*f,h=Math.hypot(i,a,o),h?(h=1/h,i*=h,a*=h,o*=h):(i=0,a=0,o=0),s=c*o-d*a,u=d*i-f*o,l=f*a-c*i,h=Math.hypot(s,u,l),h?(h=1/h,s*=h,u*=h,l*=h):(s=0,u=0,l=0),r[0]=i,r[1]=s,r[2]=f,r[3]=0,r[4]=a,r[5]=u,r[6]=c,r[7]=0,r[8]=o,r[9]=l,r[10]=d,r[11]=0,r[12]=-(i*v+a*p+o*g),r[13]=-(s*v+u*p+l*g),r[14]=-(f*v+c*p+d*g),r[15]=1,r)}function CG(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],l=n[2],f=i-e[0],c=a-e[1],d=o-e[2],h=f*f+c*c+d*d;h>0&&(h=1/Math.sqrt(h),f*=h,c*=h,d*=h);var v=u*d-l*c,p=l*f-s*d,g=s*c-u*f;return h=v*v+p*p+g*g,h>0&&(h=1/Math.sqrt(h),v*=h,p*=h,g*=h),r[0]=v,r[1]=p,r[2]=g,r[3]=0,r[4]=c*g-d*p,r[5]=d*v-f*g,r[6]=f*p-c*v,r[7]=0,r[8]=f,r[9]=c,r[10]=d,r[11]=0,r[12]=i,r[13]=a,r[14]=o,r[15]=1,r}function AG(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function TG(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}function IG(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r}function kT(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r}function OG(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r}function LG(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r[9]=t[9]+e[9]*n,r[10]=t[10]+e[10]*n,r[11]=t[11]+e[11]*n,r[12]=t[12]+e[12]*n,r[13]=t[13]+e[13]*n,r[14]=t[14]+e[14]*n,r[15]=t[15]+e[15]*n,r}function kG(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]&&r[9]===t[9]&&r[10]===t[10]&&r[11]===t[11]&&r[12]===t[12]&&r[13]===t[13]&&r[14]===t[14]&&r[15]===t[15]}function DG(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],c=r[9],d=r[10],h=r[11],v=r[12],p=r[13],g=r[14],y=r[15],m=t[0],b=t[1],x=t[2],w=t[3],E=t[4],_=t[5],M=t[6],C=t[7],S=t[8],A=t[9],T=t[10],I=t[11],k=t[12],P=t[13],N=t[14],z=t[15];return Math.abs(e-m)<=It*Math.max(1,Math.abs(e),Math.abs(m))&&Math.abs(n-b)<=It*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=It*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=It*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-E)<=It*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-_)<=It*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(u-M)<=It*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(l-C)<=It*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(f-S)<=It*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(c-A)<=It*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(d-T)<=It*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(h-I)<=It*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(v-k)<=It*Math.max(1,Math.abs(v),Math.abs(k))&&Math.abs(p-P)<=It*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-N)<=It*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(y-z)<=It*Math.max(1,Math.abs(y),Math.abs(z))}var NG=MT,PG=kT;const RG=Object.freeze(Object.defineProperty({__proto__:null,add:IG,adjoint:tG,clone:Kz,copy:qz,create:Hz,determinant:rG,equals:DG,exactEquals:kG,frob:TG,fromQuat:mG,fromQuat2:pG,fromRotation:cG,fromRotationTranslation:CT,fromRotationTranslationScale:gG,fromRotationTranslationScaleOrigin:yG,fromScaling:fG,fromTranslation:lG,fromValues:Zz,fromXRotation:dG,fromYRotation:hG,fromZRotation:vG,frustum:bG,getRotation:IT,getScaling:TT,getTranslation:AT,identity:ST,invert:eG,lookAt:MG,mul:NG,multiply:MT,multiplyScalar:OG,multiplyScalarAndAdd:LG,ortho:_G,orthoNO:LT,orthoZO:SG,perspective:xG,perspectiveFromFieldOfView:EG,perspectiveNO:OT,perspectiveZO:wG,rotate:aG,rotateX:oG,rotateY:sG,rotateZ:uG,scale:iG,set:Qz,str:AG,sub:PG,subtract:kT,targetTo:CG,translate:nG,transpose:Jz},Symbol.toStringTag,{value:"Module"}));function A1(){var r=new vr(3);return vr!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function BG(r){var t=new vr(3);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function DT(r){var t=r[0],e=r[1],n=r[2];return Math.hypot(t,e,n)}function Oy(r,t,e){var n=new vr(3);return n[0]=r,n[1]=t,n[2]=e,n}function FG(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function zG(r,t,e,n){return r[0]=t,r[1]=e,r[2]=n,r}function GG(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r}function NT(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r}function PT(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r}function RT(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r}function $G(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r}function UG(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r}function jG(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r}function WG(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r}function XG(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r}function YG(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r}function VG(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r}function BT(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return Math.hypot(e,n,i)}function FT(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return e*e+n*n+i*i}function zT(r){var t=r[0],e=r[1],n=r[2];return t*t+e*e+n*n}function HG(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r}function KG(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r}function GT(r,t){var e=t[0],n=t[1],i=t[2],a=e*e+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r}function T1(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function Wh(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],u=e[2];return r[0]=i*u-a*s,r[1]=a*o-n*u,r[2]=n*s-i*o,r}function qG(r,t,e,n){var i=t[0],a=t[1],o=t[2];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=o+n*(e[2]-o),r}function ZG(r,t,e,n,i,a){var o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,l=o*(a-1),f=o*(3-2*a);return r[0]=t[0]*s+e[0]*u+n[0]*l+i[0]*f,r[1]=t[1]*s+e[1]*u+n[1]*l+i[1]*f,r[2]=t[2]*s+e[2]*u+n[2]*l+i[2]*f,r}function QG(r,t,e,n,i,a){var o=1-a,s=o*o,u=a*a,l=s*o,f=3*a*s,c=3*u*o,d=u*a;return r[0]=t[0]*l+e[0]*f+n[0]*c+i[0]*d,r[1]=t[1]*l+e[1]*f+n[1]*c+i[1]*d,r[2]=t[2]*l+e[2]*f+n[2]*c+i[2]*d,r}function JG(r,t){t=t||1;var e=va()*2*Math.PI,n=va()*2-1,i=Math.sqrt(1-n*n)*t;return r[0]=Math.cos(e)*i,r[1]=Math.sin(e)*i,r[2]=n*t,r}function e8(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[3]*n+e[7]*i+e[11]*a+e[15];return o=o||1,r[0]=(e[0]*n+e[4]*i+e[8]*a+e[12])/o,r[1]=(e[1]*n+e[5]*i+e[9]*a+e[13])/o,r[2]=(e[2]*n+e[6]*i+e[10]*a+e[14])/o,r}function gp(r,t,e){var n=t[0],i=t[1],a=t[2];return r[0]=n*e[0]+i*e[3]+a*e[6],r[1]=n*e[1]+i*e[4]+a*e[7],r[2]=n*e[2]+i*e[5]+a*e[8],r}function t8(r,t,e){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],l=t[2],f=i*l-a*u,c=a*s-n*l,d=n*u-i*s,h=i*d-a*c,v=a*f-n*d,p=n*c-i*f,g=o*2;return f*=g,c*=g,d*=g,h*=2,v*=2,p*=2,r[0]=s+f+h,r[1]=u+c+v,r[2]=l+d+p,r}function r8(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function n8(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function i8(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function a8(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt(e*e+n*n+i*i),l=Math.sqrt(a*a+o*o+s*s),f=u*l,c=f&&T1(r,t)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function o8(r){return r[0]=0,r[1]=0,r[2]=0,r}function s8(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function u8(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}function l8(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],o=t[1],s=t[2];return Math.abs(e-a)<=It*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(n-o)<=It*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=It*Math.max(1,Math.abs(i),Math.abs(s))}var f8=NT,c8=PT,d8=RT,h8=BT,v8=FT,$T=DT,p8=zT,g8=function(){var r=A1();return function(t,e,n,i,a,o){var s,u;for(e||(e=3),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],a(r,r,o),t[s]=r[0],t[s+1]=r[1],t[s+2]=r[2];return t}}();const y8=Object.freeze(Object.defineProperty({__proto__:null,add:GG,angle:a8,bezier:QG,ceil:$G,clone:BG,copy:FG,create:A1,cross:Wh,dist:h8,distance:BT,div:d8,divide:RT,dot:T1,equals:l8,exactEquals:u8,floor:UG,forEach:g8,fromValues:Oy,hermite:ZG,inverse:KG,len:$T,length:DT,lerp:qG,max:WG,min:jG,mul:c8,multiply:PT,negate:HG,normalize:GT,random:JG,rotateX:r8,rotateY:n8,rotateZ:i8,round:XG,scale:YG,scaleAndAdd:VG,set:zG,sqrDist:v8,sqrLen:p8,squaredDistance:FT,squaredLength:zT,str:s8,sub:f8,subtract:NT,transformMat3:gp,transformMat4:e8,transformQuat:t8,zero:o8},Symbol.toStringTag,{value:"Module"}));function UT(){var r=new vr(4);return vr!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function jT(r){var t=new vr(4);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function WT(r,t,e,n){var i=new vr(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function XT(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function YT(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function VT(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function HT(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r}function KT(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r[3]=t[3]*e[3],r}function qT(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r[3]=t[3]/e[3],r}function m8(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r[3]=Math.ceil(t[3]),r}function b8(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r[3]=Math.floor(t[3]),r}function x8(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r[3]=Math.min(t[3],e[3]),r}function w8(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r[3]=Math.max(t[3],e[3]),r}function E8(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r[3]=Math.round(t[3]),r}function ZT(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function _8(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r}function QT(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return Math.hypot(e,n,i,a)}function JT(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return e*e+n*n+i*i+a*a}function I1(r){var t=r[0],e=r[1],n=r[2],i=r[3];return Math.hypot(t,e,n,i)}function O1(r){var t=r[0],e=r[1],n=r[2],i=r[3];return t*t+e*e+n*n+i*i}function S8(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=-t[3],r}function M8(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r[3]=1/t[3],r}function eI(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*e+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),r[0]=e*o,r[1]=n*o,r[2]=i*o,r[3]=a*o,r}function tI(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]}function C8(r,t,e,n){var i=e[0]*n[1]-e[1]*n[0],a=e[0]*n[2]-e[2]*n[0],o=e[0]*n[3]-e[3]*n[0],s=e[1]*n[2]-e[2]*n[1],u=e[1]*n[3]-e[3]*n[1],l=e[2]*n[3]-e[3]*n[2],f=t[0],c=t[1],d=t[2],h=t[3];return r[0]=c*l-d*u+h*s,r[1]=-(f*l)+d*o-h*a,r[2]=f*u-c*o+h*i,r[3]=-(f*s)+c*a-d*i,r}function rI(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=o+n*(e[2]-o),r[3]=s+n*(e[3]-s),r}function A8(r,t){t=t||1;var e,n,i,a,o,s;do e=va()*2-1,n=va()*2-1,o=e*e+n*n;while(o>=1);do i=va()*2-1,a=va()*2-1,s=i*i+a*a;while(s>=1);var u=Math.sqrt((1-o)/s);return r[0]=t*e,r[1]=t*n,r[2]=t*i*u,r[3]=t*a*u,r}function T8(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3];return r[0]=e[0]*n+e[4]*i+e[8]*a+e[12]*o,r[1]=e[1]*n+e[5]*i+e[9]*a+e[13]*o,r[2]=e[2]*n+e[6]*i+e[10]*a+e[14]*o,r[3]=e[3]*n+e[7]*i+e[11]*a+e[15]*o,r}function I8(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],u=e[2],l=e[3],f=l*n+s*a-u*i,c=l*i+u*n-o*a,d=l*a+o*i-s*n,h=-o*n-s*i-u*a;return r[0]=f*l+h*-o+c*-u-d*-s,r[1]=c*l+h*-s+d*-o-f*-u,r[2]=d*l+h*-u+f*-s-c*-o,r[3]=t[3],r}function O8(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function L8(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function nI(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function iI(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=t[0],s=t[1],u=t[2],l=t[3];return Math.abs(e-o)<=It*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=It*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=It*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-l)<=It*Math.max(1,Math.abs(a),Math.abs(l))}var k8=HT,D8=KT,N8=qT,P8=QT,R8=JT,B8=I1,F8=O1,z8=function(){var r=UT();return function(t,e,n,i,a,o){var s,u;for(e||(e=4),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],r[3]=t[s+3],a(r,r,o),t[s]=r[0],t[s+1]=r[1],t[s+2]=r[2],t[s+3]=r[3];return t}}();const G8=Object.freeze(Object.defineProperty({__proto__:null,add:VT,ceil:m8,clone:jT,copy:XT,create:UT,cross:C8,dist:P8,distance:QT,div:N8,divide:qT,dot:tI,equals:iI,exactEquals:nI,floor:b8,forEach:z8,fromValues:WT,inverse:M8,len:B8,length:I1,lerp:rI,max:w8,min:x8,mul:D8,multiply:KT,negate:S8,normalize:eI,random:A8,round:E8,scale:ZT,scaleAndAdd:_8,set:YT,sqrDist:R8,sqrLen:F8,squaredDistance:JT,squaredLength:O1,str:L8,sub:k8,subtract:HT,transformMat4:T8,transformQuat:I8,zero:O8},Symbol.toStringTag,{value:"Module"}));function wv(){var r=new vr(4);return vr!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function $8(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function aI(r,t,e){e=e*.5;var n=Math.sin(e);return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=Math.cos(e),r}function U8(r,t){var e=Math.acos(t[3])*2,n=Math.sin(e/2);return n>It?(r[0]=t[0]/n,r[1]=t[1]/n,r[2]=t[2]/n):(r[0]=1,r[1]=0,r[2]=0),e}function j8(r,t){var e=k1(r,t);return Math.acos(2*e*e-1)}function oI(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],l=e[2],f=e[3];return r[0]=n*f+o*s+i*l-a*u,r[1]=i*f+o*u+a*s-n*l,r[2]=a*f+o*l+n*u-i*s,r[3]=o*f-n*s-i*u-a*l,r}function sI(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+o*s,r[1]=i*u+a*s,r[2]=a*u-i*s,r[3]=o*u-n*s,r}function uI(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u-a*s,r[1]=i*u+o*s,r[2]=a*u+n*s,r[3]=o*u-i*s,r}function lI(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+i*s,r[1]=i*u-n*s,r[2]=a*u+o*s,r[3]=o*u-a*s,r}function W8(r,t){var e=t[0],n=t[1],i=t[2];return r[0]=e,r[1]=n,r[2]=i,r[3]=Math.sqrt(Math.abs(1-e*e-n*n-i*i)),r}function fI(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=Math.sqrt(e*e+n*n+i*i),s=Math.exp(a),u=o>0?s*Math.sin(o)/o:0;return r[0]=e*u,r[1]=n*u,r[2]=i*u,r[3]=s*Math.cos(o),r}function cI(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=Math.sqrt(e*e+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return r[0]=e*s,r[1]=n*s,r[2]=i*s,r[3]=.5*Math.log(e*e+n*n+i*i+a*a),r}function X8(r,t,e){return cI(r,t),hI(r,r,e),fI(r,r),r}function Xh(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3],u=e[0],l=e[1],f=e[2],c=e[3],d,h,v,p,g;return h=i*u+a*l+o*f+s*c,h<0&&(h=-h,u=-u,l=-l,f=-f,c=-c),1-h>It?(d=Math.acos(h),v=Math.sin(d),p=Math.sin((1-n)*d)/v,g=Math.sin(n*d)/v):(p=1-n,g=n),r[0]=p*i+g*u,r[1]=p*a+g*l,r[2]=p*o+g*f,r[3]=p*s+g*c,r}function Y8(r){var t=va(),e=va(),n=va(),i=Math.sqrt(1-t),a=Math.sqrt(t);return r[0]=i*Math.sin(2*Math.PI*e),r[1]=i*Math.cos(2*Math.PI*e),r[2]=a*Math.sin(2*Math.PI*n),r[3]=a*Math.cos(2*Math.PI*n),r}function V8(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*e+n*n+i*i+a*a,s=o?1/o:0;return r[0]=-e*s,r[1]=-n*s,r[2]=-i*s,r[3]=a*s,r}function H8(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r}function dI(r,t){var e=t[0]+t[4]+t[8],n;if(e>0)n=Math.sqrt(e+1),r[3]=.5*n,n=.5/n,r[0]=(t[5]-t[7])*n,r[1]=(t[6]-t[2])*n,r[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),r[i]=.5*n,n=.5/n,r[3]=(t[a*3+o]-t[o*3+a])*n,r[a]=(t[a*3+i]+t[i*3+a])*n,r[o]=(t[o*3+i]+t[i*3+o])*n}return r}function K8(r,t,e,n){var i=.5*Math.PI/180;t*=i,e*=i,n*=i;var a=Math.sin(t),o=Math.cos(t),s=Math.sin(e),u=Math.cos(e),l=Math.sin(n),f=Math.cos(n);return r[0]=a*u*f-o*s*l,r[1]=o*s*f+a*u*l,r[2]=o*u*l-a*s*f,r[3]=o*u*f+a*s*l,r}function q8(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var Z8=jT,Q8=WT,L1=XT,J8=YT,e$=VT,t$=oI,hI=ZT,k1=tI,r$=rI,D1=I1,n$=D1,N1=O1,i$=N1,P1=eI,a$=nI,o$=iI,s$=function(){var r=A1(),t=Oy(1,0,0),e=Oy(0,1,0);return function(n,i,a){var o=T1(i,a);return o<-.999999?(Wh(r,t,i),$T(r)<1e-6&&Wh(r,e,i),GT(r,r),aI(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Wh(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,P1(n,n))}}(),u$=function(){var r=wv(),t=wv();return function(e,n,i,a,o,s){return Xh(r,n,o,s),Xh(t,i,a,s),Xh(e,r,t,2*s*(1-s)),e}}(),l$=function(){var r=wT();return function(t,e,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-e[0],r[5]=-e[1],r[8]=-e[2],P1(t,dI(t,r))}}();const f$=Object.freeze(Object.defineProperty({__proto__:null,add:e$,calculateW:W8,clone:Z8,conjugate:H8,copy:L1,create:wv,dot:k1,equals:o$,exactEquals:a$,exp:fI,fromEuler:K8,fromMat3:dI,fromValues:Q8,getAngle:j8,getAxisAngle:U8,identity:$8,invert:V8,len:n$,length:D1,lerp:r$,ln:cI,mul:t$,multiply:oI,normalize:P1,pow:X8,random:Y8,rotateX:sI,rotateY:uI,rotateZ:lI,rotationTo:s$,scale:hI,set:J8,setAxes:l$,setAxisAngle:aI,slerp:Xh,sqlerp:u$,sqrLen:i$,squaredLength:N1,str:q8},Symbol.toStringTag,{value:"Module"}));function c$(){var r=new vr(8);return vr!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0),r[3]=1,r}function d$(r){var t=new vr(8);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t}function h$(r,t,e,n,i,a,o,s){var u=new vr(8);return u[0]=r,u[1]=t,u[2]=e,u[3]=n,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u}function v$(r,t,e,n,i,a,o){var s=new vr(8);s[0]=r,s[1]=t,s[2]=e,s[3]=n;var u=i*.5,l=a*.5,f=o*.5;return s[4]=u*n+l*e-f*t,s[5]=l*n+f*r-u*e,s[6]=f*n+u*t-l*r,s[7]=-u*r-l*t-f*e,s}function vI(r,t,e){var n=e[0]*.5,i=e[1]*.5,a=e[2]*.5,o=t[0],s=t[1],u=t[2],l=t[3];return r[0]=o,r[1]=s,r[2]=u,r[3]=l,r[4]=n*l+i*u-a*s,r[5]=i*l+a*o-n*u,r[6]=a*l+n*s-i*o,r[7]=-n*o-i*s-a*u,r}function p$(r,t){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=t[0]*.5,r[5]=t[1]*.5,r[6]=t[2]*.5,r[7]=0,r}function g$(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function y$(r,t){var e=wv();IT(e,t);var n=new vr(3);return AT(n,t),vI(r,e,n),r}function pI(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r}function m$(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function b$(r,t,e,n,i,a,o,s,u){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r}var x$=L1;function w$(r,t){return r[0]=t[4],r[1]=t[5],r[2]=t[6],r[3]=t[7],r}var E$=L1;function _$(r,t){return r[4]=t[0],r[5]=t[1],r[6]=t[2],r[7]=t[3],r}function S$(r,t){var e=t[4],n=t[5],i=t[6],a=t[7],o=-t[0],s=-t[1],u=-t[2],l=t[3];return r[0]=(e*l+a*o+n*u-i*s)*2,r[1]=(n*l+a*s+i*o-e*u)*2,r[2]=(i*l+a*u+e*s-n*o)*2,r}function M$(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0]*.5,u=e[1]*.5,l=e[2]*.5,f=t[4],c=t[5],d=t[6],h=t[7];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=o*s+i*l-a*u+f,r[5]=o*u+a*s-n*l+c,r[6]=o*l+n*u-i*s+d,r[7]=-n*s-i*u-a*l+h,r}function C$(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=s*o+f*n+u*a-l*i,d=u*o+f*i+l*n-s*a,h=l*o+f*a+s*i-u*n,v=f*o-s*n-u*i-l*a;return sI(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+d*a-h*i,r[5]=d*o+v*i+h*n-c*a,r[6]=h*o+v*a+c*i-d*n,r[7]=v*o-c*n-d*i-h*a,r}function A$(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=s*o+f*n+u*a-l*i,d=u*o+f*i+l*n-s*a,h=l*o+f*a+s*i-u*n,v=f*o-s*n-u*i-l*a;return uI(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+d*a-h*i,r[5]=d*o+v*i+h*n-c*a,r[6]=h*o+v*a+c*i-d*n,r[7]=v*o-c*n-d*i-h*a,r}function T$(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=s*o+f*n+u*a-l*i,d=u*o+f*i+l*n-s*a,h=l*o+f*a+s*i-u*n,v=f*o-s*n-u*i-l*a;return lI(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+d*a-h*i,r[5]=d*o+v*i+h*n-c*a,r[6]=h*o+v*a+c*i-d*n,r[7]=v*o-c*n-d*i-h*a,r}function I$(r,t,e){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],l=t[2],f=t[3];return r[0]=s*o+f*n+u*a-l*i,r[1]=u*o+f*i+l*n-s*a,r[2]=l*o+f*a+s*i-u*n,r[3]=f*o-s*n-u*i-l*a,s=t[4],u=t[5],l=t[6],f=t[7],r[4]=s*o+f*n+u*a-l*i,r[5]=u*o+f*i+l*n-s*a,r[6]=l*o+f*a+s*i-u*n,r[7]=f*o-s*n-u*i-l*a,r}function O$(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],l=e[2],f=e[3];return r[0]=n*f+o*s+i*l-a*u,r[1]=i*f+o*u+a*s-n*l,r[2]=a*f+o*l+n*u-i*s,r[3]=o*f-n*s-i*u-a*l,s=e[4],u=e[5],l=e[6],f=e[7],r[4]=n*f+o*s+i*l-a*u,r[5]=i*f+o*u+a*s-n*l,r[6]=a*f+o*l+n*u-i*s,r[7]=o*f-n*s-i*u-a*l,r}function L$(r,t,e,n){if(Math.abs(n)<It)return pI(r,t);var i=Math.hypot(e[0],e[1],e[2]);n=n*.5;var a=Math.sin(n),o=a*e[0]/i,s=a*e[1]/i,u=a*e[2]/i,l=Math.cos(n),f=t[0],c=t[1],d=t[2],h=t[3];r[0]=f*l+h*o+c*u-d*s,r[1]=c*l+h*s+d*o-f*u,r[2]=d*l+h*u+f*s-c*o,r[3]=h*l-f*o-c*s-d*u;var v=t[4],p=t[5],g=t[6],y=t[7];return r[4]=v*l+y*o+p*u-g*s,r[5]=p*l+y*s+g*o-v*u,r[6]=g*l+y*u+v*s-p*o,r[7]=y*l-v*o-p*s-g*u,r}function k$(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r}function gI(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[4],u=e[5],l=e[6],f=e[7],c=t[4],d=t[5],h=t[6],v=t[7],p=e[0],g=e[1],y=e[2],m=e[3];return r[0]=n*m+o*p+i*y-a*g,r[1]=i*m+o*g+a*p-n*y,r[2]=a*m+o*y+n*g-i*p,r[3]=o*m-n*p-i*g-a*y,r[4]=n*f+o*s+i*l-a*u+c*m+v*p+d*y-h*g,r[5]=i*f+o*u+a*s-n*l+d*m+v*g+h*p-c*y,r[6]=a*f+o*l+n*u-i*s+h*m+v*y+c*g-d*p,r[7]=o*f-n*s-i*u-a*l+v*m-c*p-d*g-h*y,r}var D$=gI;function N$(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r}var yI=k1;function P$(r,t,e,n){var i=1-n;return yI(t,e)<0&&(n=-n),r[0]=t[0]*i+e[0]*n,r[1]=t[1]*i+e[1]*n,r[2]=t[2]*i+e[2]*n,r[3]=t[3]*i+e[3]*n,r[4]=t[4]*i+e[4]*n,r[5]=t[5]*i+e[5]*n,r[6]=t[6]*i+e[6]*n,r[7]=t[7]*i+e[7]*n,r}function R$(r,t){var e=yp(t);return r[0]=-t[0]/e,r[1]=-t[1]/e,r[2]=-t[2]/e,r[3]=t[3]/e,r[4]=-t[4]/e,r[5]=-t[5]/e,r[6]=-t[6]/e,r[7]=t[7]/e,r}function B$(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r[4]=-t[4],r[5]=-t[5],r[6]=-t[6],r[7]=t[7],r}var mI=D1,F$=mI,yp=N1,z$=yp;function G$(r,t){var e=yp(t);if(e>0){e=Math.sqrt(e);var n=t[0]/e,i=t[1]/e,a=t[2]/e,o=t[3]/e,s=t[4],u=t[5],l=t[6],f=t[7],c=n*s+i*u+a*l+o*f;r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=(s-n*c)/e,r[5]=(u-i*c)/e,r[6]=(l-a*c)/e,r[7]=(f-o*c)/e}return r}function $$(r){return"quat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+")"}function U$(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]}function j$(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=t[0],c=t[1],d=t[2],h=t[3],v=t[4],p=t[5],g=t[6],y=t[7];return Math.abs(e-f)<=It*Math.max(1,Math.abs(e),Math.abs(f))&&Math.abs(n-c)<=It*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-d)<=It*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-h)<=It*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(o-v)<=It*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=It*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(u-g)<=It*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(l-y)<=It*Math.max(1,Math.abs(l),Math.abs(y))}const W$=Object.freeze(Object.defineProperty({__proto__:null,add:k$,clone:d$,conjugate:B$,copy:pI,create:c$,dot:yI,equals:j$,exactEquals:U$,fromMat4:y$,fromRotation:g$,fromRotationTranslation:vI,fromRotationTranslationValues:v$,fromTranslation:p$,fromValues:h$,getDual:w$,getReal:x$,getTranslation:S$,identity:m$,invert:R$,len:F$,length:mI,lerp:P$,mul:D$,multiply:gI,normalize:G$,rotateAroundAxis:L$,rotateByQuatAppend:I$,rotateByQuatPrepend:O$,rotateX:C$,rotateY:A$,rotateZ:T$,scale:N$,set:b$,setDual:_$,setReal:E$,sqrLen:z$,squaredLength:yp,str:$$,translate:M$},Symbol.toStringTag,{value:"Module"}));function bI(){var r=new vr(2);return vr!=Float32Array&&(r[0]=0,r[1]=0),r}function X$(r){var t=new vr(2);return t[0]=r[0],t[1]=r[1],t}function Y$(r,t){var e=new vr(2);return e[0]=r,e[1]=t,e}function V$(r,t){return r[0]=t[0],r[1]=t[1],r}function H$(r,t,e){return r[0]=t,r[1]=e,r}function $n(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r}function xI(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r}function wI(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r}function EI(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r}function K$(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r}function q$(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r}function ns(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r}function is(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r}function Z$(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r}function oi(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r}function Q$(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r}function Ev(r,t){var e=t[0]-r[0],n=t[1]-r[1];return Math.hypot(e,n)}function _I(r,t){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function SI(r){var t=r[0],e=r[1];return Math.hypot(t,e)}function MI(r){var t=r[0],e=r[1];return t*t+e*e}function J$(r,t){return r[0]=-t[0],r[1]=-t[1],r}function eU(r,t){return r[0]=1/t[0],r[1]=1/t[1],r}function gs(r,t){var e=t[0],n=t[1],i=e*e+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=t[0]*i,r[1]=t[1]*i,r}function R1(r,t){return r[0]*t[0]+r[1]*t[1]}function tU(r,t,e){var n=t[0]*e[1]-t[1]*e[0];return r[0]=r[1]=0,r[2]=n,r}function rU(r,t,e,n){var i=t[0],a=t[1];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r}function nU(r,t){t=t||1;var e=va()*2*Math.PI;return r[0]=Math.cos(e)*t,r[1]=Math.sin(e)*t,r}function iU(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i,r[1]=e[1]*n+e[3]*i,r}function aU(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i+e[4],r[1]=e[1]*n+e[3]*i+e[5],r}function oU(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[3]*i+e[6],r[1]=e[1]*n+e[4]*i+e[7],r}function sU(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[4]*i+e[12],r[1]=e[1]*n+e[5]*i+e[13],r}function uU(r,t,e,n){var i=t[0]-e[0],a=t[1]-e[1],o=Math.sin(n),s=Math.cos(n);return r[0]=i*s-a*o+e[0],r[1]=i*o+a*s+e[1],r}function CI(r,t){var e=r[0],n=r[1],i=t[0],a=t[1],o=Math.sqrt(e*e+n*n)*Math.sqrt(i*i+a*a),s=o&&(e*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function lU(r){return r[0]=0,r[1]=0,r}function fU(r){return"vec2("+r[0]+", "+r[1]+")"}function B1(r,t){return r[0]===t[0]&&r[1]===t[1]}function cU(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.abs(e-i)<=It*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(n-a)<=It*Math.max(1,Math.abs(n),Math.abs(a))}var dU=SI,Yh=xI,hU=wI,vU=EI,pU=Ev,gU=_I,yU=MI,mU=function(){var r=bI();return function(t,e,n,i,a,o){var s,u;for(e||(e=2),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],a(r,r,o),t[s]=r[0],t[s+1]=r[1];return t}}();const bU=Object.freeze(Object.defineProperty({__proto__:null,add:$n,angle:CI,ceil:K$,clone:X$,copy:V$,create:bI,cross:tU,dist:pU,distance:Ev,div:vU,divide:EI,dot:R1,equals:cU,exactEquals:B1,floor:q$,forEach:mU,fromValues:Y$,inverse:eU,len:dU,length:SI,lerp:rU,max:is,min:ns,mul:hU,multiply:wI,negate:J$,normalize:gs,random:nU,rotate:uU,round:Z$,scale:oi,scaleAndAdd:Q$,set:H$,sqrDist:gU,sqrLen:yU,squaredDistance:_I,squaredLength:MI,str:fU,sub:Yh,subtract:xI,transformMat2:iU,transformMat2d:aU,transformMat3:oU,transformMat4:sU,zero:lU},Symbol.toStringTag,{value:"Module"})),xU=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:A6,mat2:Q6,mat2d:Ez,mat3:_T,mat4:RG,quat:f$,quat2:W$,vec2:bU,vec3:y8,vec4:G8},Symbol.toStringTag,{value:"Module"}));function wU(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return S1(n,e),no(r,n,t)}function EU(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return M1(n,e),no(r,n,t)}function _U(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return C1(n,e),no(r,n,t)}function SU(r,t,e){return no(r,e,t)}function ra(r,t){for(var e=r?[].concat(r):[1,0,0,0,1,0,0,0,1],n=0,i=t.length;n<i;n++){var a=t[n];switch(a[0]){case"t":wU(e,e,[a[1],a[2]]);break;case"s":_U(e,e,[a[1],a[2]]);break;case"r":EU(e,e,a[1]);break;case"m":SU(e,e,a[1]);break}}return e}var du=function(t,e){var n=t.nodes,i=t.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var l=[];a.push(l)}),i&&i.forEach(function(s){var u=s.source,l=s.target,f=o[u],c=o[l];!f&&f!==0||!c&&c!==0||(a[f][c]=1,e||(a[c][f]=1))}),a},MU=function(t,e){return t===e},UE=function(){function r(t,e){e===void 0&&(e=null),this.value=t,this.next=e}return r.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},r}(),AI=function(){function r(t){t===void 0&&(t=MU),this.head=null,this.tail=null,this.compare=t}return r.prototype.prepend=function(t){var e=new UE(t,this.head);return this.head=e,this.tail||(this.tail=e),this},r.prototype.append=function(t){var e=new UE(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},r.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},r.prototype.find=function(t){var e=t.value,n=e===void 0?void 0:e,i=t.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||n!==void 0&&this.compare(o.value,n))return o;o=o.next}return null},r.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},r.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},r.prototype.fromArray=function(t){var e=this;return t.forEach(function(n){return e.append(n)}),this},r.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},r.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},r.prototype.toString=function(t){return t===void 0&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},r}(),CU=function(){function r(){this.linkedList=new AI}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(t){this.linkedList.append(t)},r.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toString=function(t){return this.linkedList.toString(t)},r}(),Ni=function(t,e,n){e===void 0&&(e=[]);var i=e.filter(function(u){return u.source===t||u.target===t});if(n==="target"){var a=function(l){return l.source===t};return i.filter(a).map(function(u){return u.target})}if(n==="source"){var o=function(l){return l.target===t};return i.filter(o).map(function(u){return u.source})}var s=function(l){return l.source===t?l.target:l.source};return i.map(s)},AU=function(t,e){return e.filter(function(n){return n.source===t})},Vh=function(t,e){return e.filter(function(n){return n.source===t||n.target===t})},TI=function(t){t===void 0&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(n)};function TU(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}var II=function(t,e,n,i){i===void 0&&(i=!0);var a=TU(n),o=new CU,s=t.edges,u=s===void 0?[]:s;o.enqueue(e);for(var l="",f=function(){var d=o.dequeue();a.enter({current:d,previous:l}),Ni(d,u,i?"target":void 0).forEach(function(h){a.allowTraversal({previous:l,current:d,next:h})&&o.enqueue(h)}),a.leave({current:d,previous:l}),l=d};!o.isEmpty();)f()},IU=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,o=[],s={},u=[],l=function h(v){u.push(v),s[v.id]=!0;for(var p=Ni(v.id,a),g=function(b){var x=p[b];if(!s[x]){var w=n.filter(function(E){return E.id===x});w.length>0&&h(w[0])}},y=0;y<p.length;++y)g(y)},f=0;f<n.length;f++){var c=n[f];if(!s[c.id]){l(c);for(var d=[];u.length>0;)d.push(u.pop());o.push(d)}}return o},OI=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,o=[],s={},u={},l={},f=[],c=0,d=function g(y){u[y.id]=c,l[y.id]=c,c+=1,o.push(y),s[y.id]=!0;for(var m=Ni(y.id,a,"target").filter(function(_){return n.map(function(M){return M.id}).indexOf(_)>-1}),b=function(M){var C=m[M];if(!u[C]&&u[C]!==0){var S=n.filter(function(A){return A.id===C});S.length>0&&g(S[0]),l[y.id]=Math.min(l[y.id],l[C])}else s[C]&&(l[y.id]=Math.min(l[y.id],u[C]))},x=0;x<m.length;x++)b(x);if(l[y.id]===u[y.id]){for(var w=[];o.length>0;){var E=o.pop();if(s[E.id]=!1,w.push(E),E===y)break}w.length>0&&f.push(w)}},h=0,v=n;h<v.length;h++){var p=v[h];!u[p.id]&&u[p.id]!==0&&d(p)}return f};function F1(r,t){return t?OI(r):IU(r)}var Po=function(t){var e={},n=t.nodes,i=n===void 0?[]:n,a=t.edges,o=a===void 0?[]:a;return i.forEach(function(s){e[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){e[s.source].degree++,e[s.source].outDegree++,e[s.target].degree++,e[s.target].inDegree++}),e},LI=function(t,e){var n=Po(t);return n[e]?Po(t)[e].inDegree:0},kI=function(t,e){var n=Po(t);return n[e]?Po(t)[e].outDegree:0};function OU(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}function DI(r,t,e,n,i){i===void 0&&(i=!0),n.enter({current:t,previous:e});var a=r.edges,o=a===void 0?[]:a;Ni(t,o,i?"target":void 0).forEach(function(s){n.allowTraversal({previous:e,current:t,next:s})&&DI(r,s,t,n,i)}),n.leave({current:t,previous:e})}function z1(r,t,e,n){n===void 0&&(n=!0),DI(r,t,"",OU(e),n)}var G1=function(t){var e=null,n=t.nodes,i=n===void 0?[]:n,a={},o={},s={},u={};i.forEach(function(c){o[c.id]=c});for(var l={enter:function(d){var h=d.current,v=d.previous;if(s[h]){e={};for(var p=h,g=v;g!==h;)e[p]=g,p=g,g=a[g];e[p]=g}else s[h]=h,delete o[h],a[h]=v},leave:function(d){var h=d.current;u[h]=h,delete s[h]},allowTraversal:function(d){var h=d.next;return e?!1:!u[h]}};Object.keys(o).length;){var f=Object.keys(o)[0];z1(t,f,l)}return e},$1=function(t,e,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=F1(t,!1),u=0,l=s;u<l.length;u++){var f=l[u];if(f.length)for(var c=f[0],d=c.id,h=[c],v=(i={},i[d]=c,i),p=(a={},a[d]=new Set,a);h.length>0;)for(var g=h.pop(),y=g.id,m=Ni(y,t.edges),b=function(E){var _,M=m[E],C=t.nodes.find(function(P){return P.id===M});if(M===y)o.push((_={},_[M]=g,_));else if(!(M in p))v[M]=g,h.push(C),p[M]=new Set([g]);else if(!p[y].has(C)){for(var S=!0,A=[C,g],T=v[y];p[M].size&&!p[M].has(T)&&(A.push(T),T!==v[T.id]);)T=v[T.id];if(A.push(T),e&&n?(S=!1,A.findIndex(function(P){return e.indexOf(P.id)>-1})>-1&&(S=!0)):e&&!n&&A.findIndex(function(P){return e.indexOf(P.id)>-1})>-1&&(S=!1),S){for(var I={},k=1;k<A.length;k+=1)I[A[k-1].id]=A[k];A.length&&(I[A[A.length-1].id]=A[0]),o.push(I)}p[M].add(g)}},x=0;x<m.length;x+=1)b(x)}return o},U1=function(t,e,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],u={},l={},f=function(T){for(var I=[T];I.length>0;){var k=I.pop();a.has(k)&&(a.delete(k),o[k.id].forEach(function(P){I.push(P)}),o[k.id].clear())}},c=function A(T,I,k){var P=!1;if(e&&n===!1&&e.indexOf(T.id)>-1)return P;i.push(T),a.add(T);for(var N=k[T.id],z=0;z<N.length;z+=1){var W=u[N[z]];if(W===I){for(var D={},R=1;R<i.length;R+=1)D[i[R-1].id]=i[R];i.length&&(D[i[i.length-1].id]=i[0]),s.push(D),P=!0}else a.has(W)||A(W,I,k)&&(P=!0)}if(P)f(T);else for(var z=0;z<N.length;z+=1){var W=u[N[z]];o[W.id].has(T)||o[W.id].add(T)}return i.pop(),P},d=t.nodes,h=d===void 0?[]:d,v=0;v<h.length;v+=1){var p=h[v],g=p.id;l[g]=v,u[v]=p}if(e&&n)for(var y=function(T){var I=e[T];l[h[T].id]=l[I],l[I]=0,u[0]=h.find(function(k){return k.id===I}),u[l[h[T].id]]=h[T]},v=0;v<e.length;v++)y(v);for(var m=function(T){for(var I,k,P=1/0,N=0;N<T.length;N+=1)for(var z=T[N],W=0;W<z.length;W++){var D=l[z[W].id];D<P&&(P=D,k=N)}for(var R=T[k],H=[],N=0;N<R.length;N+=1){var ee=R[N];H[ee.id]=[];for(var Y=0,X=Ni(ee.id,t.edges,"target").filter(function(Ae){return R.map(function(Ke){return Ke.id}).indexOf(Ae)>-1});Y<X.length;Y++){var fe=X[Y];fe===ee.id&&!(n===!1&&e.indexOf(ee.id)>-1)?s.push((I={},I[ee.id]=ee,I)):H[ee.id].push(l[fe])}}return{component:R,adjList:H,minIdx:P}},b=0;b<h.length;){var x=h.filter(function(A){return l[A.id]>=b}),w=OI({nodes:x,edges:t.edges}).filter(function(A){return A.length>1});if(w.length===0)break;var E=m(w),_=E.minIdx,M=E.adjList,C=E.component;if(C.length>1){C.forEach(function(A){o[A.id]=new Set});var S=u[_];if(e&&n&&e.indexOf(S.id)===-1)return s;c(S,S,M),b=_+1}else break}return s},NI=function(t,e,n,i){return i===void 0&&(i=!0),e?U1(t,n,i):$1(t,n,i)},LU=function(t,e,n){for(var i=1/0,a,o=0;o<e.length;o++){var s=e[o].id;!n[s]&&t[s]<=i&&(i=t[s],a=e[o])}return a},cc=function(t,e,n,i){var a=t.nodes,o=a===void 0?[]:a,s=t.edges,u=s===void 0?[]:s,l={},f={},c={};o.forEach(function(m,b){var x=m.id;f[x]=1/0,x===e&&(f[x]=0)});for(var d=o.length,h=function(b){var x=LU(f,o,l),w=x.id;if(l[w]=!0,f[w]===1/0)return"continue";var E=[];n?E=AU(w,u):E=Vh(w,u),E.forEach(function(_){var M=_.target,C=_.source,S=M===w?C:M,A=i&&_[i]?_[i]:1;f[S]>f[x.id]+A?(f[S]=f[x.id]+A,c[S]=[x.id]):f[S]===f[x.id]+A&&c[S].push(x.id)})},v=0;v<d;v++)h();c[e]=[e];var p={};for(var g in f)f[g]!==1/0&&PI(e,g,c,p);var y={};for(var g in p)y[g]=p[g][0];return{length:f,path:y,allPath:p}};function PI(r,t,e,n){if(r===t)return[r];if(n[t])return n[t];for(var i=[],a=0,o=e[t];a<o.length;a++){var s=o[a],u=PI(r,s,e,n);if(!u)return;for(var l=0,f=u;l<f.length;l++){var c=f[l];wt(c)?i.push(Bi(Bi([],c,!0),[t],!1)):i.push([c,t])}}return n[t]=i,n[t]}var RI=function(t,e,n,i,a){var o=cc(t,e,i,a),s=o.length,u=o.path,l=o.allPath;return{length:s[n],path:u[n],allPath:l[n]}},BI=function(t,e,n,i){var a;if(e===n)return[[e]];var o=t.edges,s=o===void 0?[]:o,u=[e],l=(a={},a[e]=!0,a),f=[],c=[],d=i?Ni(e,s,"target"):Ni(e,s);for(f.push(d);u.length>0&&f.length>0;){var h=f[f.length-1];if(h.length){var v=h.shift();v&&(u.push(v),l[v]=!0,d=i?Ni(v,s,"target"):Ni(v,s),f.push(d.filter(function(y){return!l[y]})))}else{var p=u.pop();l[p]=!1,f.pop();continue}if(u[u.length-1]===n){var g=u.map(function(m){return m});c.push(g);var p=u.pop();l[p]=!1,f.pop()}}return c},dc=function(t,e){for(var n=du(t,e),i=[],a=n.length,o=0;o<a;o+=1){i[o]=[];for(var s=0;s<a;s+=1)o===s?i[o][s]=0:n[o][s]===0||!n[o][s]?i[o][s]=1/0:i[o][s]=n[o][s]}for(var u=0;u<a;u+=1)for(var o=0;o<a;o+=1)for(var s=0;s<a;s+=1)i[o][s]>i[o][u]+i[u][s]&&(i[o][s]=i[o][u]+i[u][s]);return i},FI=function(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=t.nodes,o=a===void 0?[]:a,s=t.edges,u=s===void 0?[]:s,l={},f={};o.forEach(function(b,x){var w=TI();b.clusterId=w,l[w]={id:w,nodes:[b]},f[b.id]={node:b,idx:x}});var c=du(t,e),d={};c.forEach(function(b,x){var w=o[x].id;d[w]={},b.forEach(function(E,_){if(E){var M=o[_].id;d[w][M]=E}})});for(var h=0,v=function(){var x=!1;if(o.forEach(function(w){var E={};Object.keys(d[w.id]).forEach(function(k){var P=d[w.id][k],N=f[k].node,z=N.clusterId;E[z]||(E[z]=0),E[z]+=P});var _=-1/0,M=[];if(Object.keys(E).forEach(function(k){_<E[k]?(_=E[k],M=[k]):_===E[k]&&M.push(k)}),!(M.length===1&&M[0]===w.clusterId)){var C=M.indexOf(w.clusterId);if(C>=0&&M.splice(C,1),M&&M.length){x=!0;var S=l[w.clusterId],A=S.nodes.indexOf(w);S.nodes.splice(A,1);var T=Math.floor(Math.random()*M.length),I=l[M[T]];I.nodes.push(w),w.clusterId=I.id}}}),!x)return"break";h++};h<i;){var p=v();if(p==="break")break}Object.keys(l).forEach(function(b){var x=l[b];(!x.nodes||!x.nodes.length)&&delete l[b]});var g=[],y={};u.forEach(function(b){var x=b.source,w=b.target,E=b[n]||1,_=f[x].node.clusterId,M=f[w].node.clusterId,C="".concat(_,"---").concat(M);if(y[C])y[C].weight+=E,y[C].count++;else{var S={source:_,target:M,weight:E,count:1};y[C]=S,g.push(S)}});var m=[];return Object.keys(l).forEach(function(b){m.push(l[b])}),{clusters:m,clusterEdges:g}},Qi=function(){function r(t){this.arr=t}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(t){var e=[];if(t!==0)for(var n in this.arr)e[n]=this.arr[n]/t;return new r(e)},r.prototype.negate=function(){var t=[];for(var e in this.arr)t[e]=-this.arr[e];return new r(t)},r.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return i}},r.prototype.euclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var t=[],e=ar(this.arr);e.sort(function(o,s){return o-s});var n=e[e.length-1],i=e[0];for(var a in this.arr)t[a]=(this.arr[a]-i)/(n-i);return new r(t)},r.prototype.norm2=function(){var t;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return 0;var e=0;for(var n in this.arr)e+=Math.pow(this.arr[n],2);return Math.sqrt(e)},r.prototype.dot=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*t.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(t){var e,n=t.arr;if(((e=this.arr)===null||e===void 0?void 0:e.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),j1=function(t,e){e===void 0&&(e=void 0);var n=[];return t.forEach(function(i){e===void 0&&n.push(i),i[e]!==void 0&&n.push(i[e])}),n},ha;(function(r){r.EuclideanDistance="euclideanDistance"})(ha||(ha={}));var kU=function(t,e,n){var i=[];e!=null&&e.length?i=e:(t.forEach(function(o){i=i.concat(Object.keys(o))}),i=lc(i));var a={};return i.forEach(function(o){var s=[];t.forEach(function(u){u[o]!==void 0&&u[o]!==""&&s.push(u[o])}),s.length&&!(n!=null&&n.includes(o))&&(a[o]=lc(s))}),a},W1=function(t,e,n){var i=kU(t,e,n),a=[];if(!Object.keys(i).length)return a;var o=Object.values(i),s=o.every(function(u){return u.every(function(l){return typeof l=="number"})});return t.forEach(function(u,l){var f=[];Object.keys(i).forEach(function(c){var d=u[c],h=i[c],v=h.findIndex(function(y){return d===y}),p=[];if(s)p.push(d);else for(var g=0;g<h.length;g++)g===v?p.push(1):p.push(0);f=f.concat(p)}),a[l]=f}),a},jE=function(t,e,n,i){n===void 0&&(n=ha.EuclideanDistance);var a=0;switch(n){case ha.EuclideanDistance:a=new Qi(t).euclideanDistance(new Qi(e));break}return a},WE=function(t,e,n,i){for(var a=e.length,o=2*i,s=0,u=0;u<a;u++)for(var l=t[u].clusterId,f=0;f<a;f++){var c=t[f].clusterId;if(l===c){var d=e[u][f]||0,h=n[u]||0,v=n[f]||0;s+=d-h*v/o}}return s*=1/o,s},d0=function(t,e){t===void 0&&(t=[]);for(var n=t.length,i=new Qi([]),a=0;a<n;a++)i=i.add(new Qi(e[a]));var o=i.avg(n);o.normalize();for(var s=0,a=0;a<n;a++){var u=new Qi(e[a]),l=u.squareEuclideanDistance(o);s+=l}var f=[];t.forEach(function(){f.push([])});for(var a=0;a<n;a++){var u=new Qi(e[a]);t[a].clusterInertial=0;for(var c=0;c<n;c++){if(a===c){f[a][c]=0;continue}var d=new Qi(e[c]);f[a][c]=u.squareEuclideanDistance(d),t[a].clusterInertial+=f[a][c]}}for(var h=0,v=2*n*s,a=0;a<n;a++)for(var p=t[a].clusterId,c=0;c<n;c++){var g=t[c].clusterId;if(!(a===c||p!==g)){var y=t[a].clusterInertial*t[c].clusterInertial/Math.pow(v,2)-f[a][c]/v;h+=y}}return Number(h.toFixed(4))},X1=function(t,e,n,i,a,o,s,u,l){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),o===void 0&&(o=void 0),s===void 0&&(s=[]),u===void 0&&(u=["id"]),l===void 0&&(l=1);var f=t.nodes,c=f===void 0?[]:f,d=t.edges,h=d===void 0?[]:d,v=[];if(a){c.forEach(function(D,R){D.properties=D.properties||{},D.originIndex=R});var p=[];c.every(function(D){return D.hasOwnProperty("nodeType")})&&(p=Array.from(new Set(c.map(function(D){return D.nodeType}))),c.forEach(function(D){D.properties.nodeType=p.findIndex(function(R){return R===D.nodeType})}));var g=j1(c,o);v=W1(g,s,u)}var y=1,m={},b={};c.forEach(function(D,R){var H=String(y++);D.clusterId=H,m[H]={id:H,nodes:[D]},b[D.id]={node:D,idx:R}});var x=du(t,e),w=[],E={},_=0;x.forEach(function(D,R){var H=0,ee=c[R].id;E[ee]={},D.forEach(function(Y,X){if(Y){H+=Y;var fe=c[X].id;E[ee][fe]=Y,_+=Y}}),w.push(H)}),_/=2;for(var M=1/0,C=1/0,S=0,A=[],T={};;){a&&c.every(function(D){return D.hasOwnProperty("properties")})?M=WE(c,x,w,_)+d0(c,v)*l:M=WE(c,x,w,_),S===0&&(C=M,A=c,T=m);var I=M>0&&M>C&&M-C<i;if(M>C&&(A=c.map(function(D){return{node:D,clusterId:D.clusterId}}),T=ar(m),C=M),I||S>100)break;S++,Object.keys(m).forEach(function(D){var R=0;h.forEach(function(H){var ee=H.source,Y=H.target,X=b[ee].node.clusterId,fe=b[Y].node.clusterId;(X===D&&fe!==D||fe===D&&X!==D)&&(R=R+(H[n]||1))}),m[D].sumTot=R}),c.forEach(function(D,R){var H=m[D.clusterId],ee=0,Y,X=w[R]/(2*_),fe=0,we=H.nodes;we.forEach(function(jt){var Sr=b[jt.id].idx;fe+=x[R][Sr]||0});var Ae=fe-H.sumTot*X,Ke=we.filter(function(jt){return jt.id!==D.id});Ke.forEach(function(jt,Sr){v[jt.originIndex]});var ot=d0(Ke,v)*l,nt=E[D.id];if(Object.keys(nt).forEach(function(jt){var Sr=b[jt].node,rr=Sr.clusterId;if(rr!==D.clusterId){var Rt=m[rr],sr=Rt.nodes;if(!(!sr||!sr.length)){var Hr=0;sr.forEach(function(Pe){var me=b[Pe.id].idx;Hr+=x[R][me]||0});var et=Hr-Rt.sumTot*X,ie=sr.concat([D]);ie.forEach(function(Pe,me){v[Pe.originIndex]});var L=d0(ie,v)*l,Se=et-Ae;a&&(Se=et+L-(Ae+ot)),Se>ee&&(ee=Se,Y=Rt)}}}),ee>0){Y.nodes.push(D);var Ct=D.clusterId;D.clusterId=Y.id;var Et=H.nodes.indexOf(D);H.nodes.splice(Et,1);var fr=0,Gt=0;h.forEach(function(jt){var Sr=jt.source,rr=jt.target,Rt=b[Sr].node.clusterId,sr=b[rr].node.clusterId;(Rt===Y.id&&sr!==Y.id||sr===Y.id&&Rt!==Y.id)&&(fr=fr+(jt[n]||1)),(Rt===Ct&&sr!==Ct||sr===Ct&&Rt!==Ct)&&(Gt=Gt+(jt[n]||1))}),Y.sumTot=fr,H.sumTot=Gt}})}var k={},P=0;Object.keys(T).forEach(function(D){var R=T[D];if(!R.nodes||!R.nodes.length){delete T[D];return}var H=String(P+1);H!==D&&(R.id=H,R.nodes=R.nodes.map(function(ee){return{id:ee.id,clusterId:H}}),T[H]=R,k[D]=H,delete T[D],P++)}),A.forEach(function(D){var R=D.node,H=D.clusterId;R&&(R.clusterId=H,R.clusterId&&k[R.clusterId]&&(R.clusterId=k[R.clusterId]))});var N=[],z={};h.forEach(function(D){var R=D.source,H=D.target,ee=D[n]||1,Y=b[R].node.clusterId,X=b[H].node.clusterId;if(!(!Y||!X)){var fe="".concat(Y,"---").concat(X);if(z[fe])z[fe].weight+=ee,z[fe].count++;else{var we={source:Y,target:X,weight:ee,count:1};z[fe]=we,N.push(we)}}});var W=[];return Object.keys(T).forEach(function(D){W.push(T[D])}),{clusters:W,clusterEdges:N}},zI=function(t,e,n,i,a,o,s,u){return e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),o===void 0&&(o=[]),s===void 0&&(s=["id"]),u===void 0&&(u=1),X1(t,e,n,i,!0,a,o,s,u)},GI=function(t,e){var n;e===void 0&&(e=1);for(var i=ar(t),a=i.nodes,o=a===void 0?[]:a,s=i.edges,u=s===void 0?[]:s,l=function(){var d=Po({nodes:o,edges:u}),h=Object.keys(d);h.sort(function(g,y){var m,b;return((m=d[g])===null||m===void 0?void 0:m.degree)-((b=d[y])===null||b===void 0?void 0:b.degree)});var v=h[0];if(!o.length||((n=d[v])===null||n===void 0?void 0:n.degree)>=e)return"break";var p=o.findIndex(function(g){return g.id===v});o.splice(p,1),u=u.filter(function(g){return!(g.source===v||g.target===v)})};;){var f=l();if(f==="break")break}return{nodes:o,edges:u}},XE=function(t,e,n){var i=[];switch(t){case ha.EuclideanDistance:i=e[n];break;default:i=[];break}return i},$I=function(t,e,n,i,a,o){e===void 0&&(e=3),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),o===void 0&&(o=ha.EuclideanDistance);var s=t.nodes,u=s===void 0?[]:s,l=t.edges,f=l===void 0?[]:l,c={clusters:[{id:"0",nodes:u}],clusterEdges:[]};if(o===ha.EuclideanDistance&&!u.every(function(H){return H.hasOwnProperty(n)}))return c;var d=[],h=[];if(o===ha.EuclideanDistance&&(d=j1(u,n),h=W1(d,i,a)),!h.length)return c;for(var v=lc(h.map(function(H){return H.join("")})),p=Math.min(e,u.length,v.length),g=0;g<u.length;g++)u[g].originIndex=g;for(var y=[],m=[],b=[],g=0;g<p;g++)if(g===0){var x=Math.floor(Math.random()*u.length);switch(o){case ha.EuclideanDistance:y[g]=h[x];break;default:y[g]=[];break}m.push(x),b[g]=[u[x]],u[x].clusterId=String(g)}else{for(var w=-1/0,E=0,_=function(Y){if(!m.includes(Y)){for(var X=0,fe=0;fe<y.length;fe++){var we=0;switch(o){case ha.EuclideanDistance:we=jE(h[u[Y].originIndex],y[fe],o);break}X+=we}var Ae=X/y.length;Ae>w&&!y.find(function(Ke){return ms(Ke,XE(o,h,u[Y].originIndex))})&&(w=Ae,E=Y)}},M=0;M<u.length;M++)_(M);y[g]=XE(o,h,E),m.push(E),b[g]=[u[E]],u[E].clusterId=String(g)}for(var C=0;;){for(var g=0;g<u.length;g++){var S=0,A=1/0;if(!(C===0&&m.includes(g))){for(var T=0;T<y.length;T++){var I=0;switch(o){case ha.EuclideanDistance:I=jE(h[g],y[T],o);break}I<A&&(A=I,S=T)}if(u[g].clusterId!==void 0)for(var k=b[Number(u[g].clusterId)].length-1;k>=0;k--)b[Number(u[g].clusterId)][k].id===u[g].id&&b[Number(u[g].clusterId)].splice(k,1);u[g].clusterId=String(S),b[S].push(u[g])}}for(var P=!1,g=0;g<b.length;g++){for(var N=b[g],z=new Qi([]),T=0;T<N.length;T++)z=z.add(new Qi(h[N[T].originIndex]));var W=z.avg(N.length);W.equal(new Qi(y[g]))||(P=!0,y[g]=W.getArr())}if(C++,u.every(function(H){return H.clusterId!==void 0})&&P||C>=1e3)break}var D=[],R={};return f.forEach(function(H){var ee,Y,X=H.source,fe=H.target,we=(ee=u.find(function(nt){return nt.id===X}))===null||ee===void 0?void 0:ee.clusterId,Ae=(Y=u.find(function(nt){return nt.id===fe}))===null||Y===void 0?void 0:Y.clusterId,Ke="".concat(we,"---").concat(Ae);if(R[Ke])R[Ke].count++;else{var ot={source:we,target:Ae,count:1};R[Ke]=ot,D.push(ot)}}),{clusters:b,clusterEdges:D}},Y1=function(t,e){var n=new Qi(e),i=n.norm2(),a=new Qi(t),o=a.norm2(),s=n.dot(a),u=i*o,l=u?s/u:0;return l},UI=function(t,e,n,i,a){t===void 0&&(t=[]),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var o=ar(t.filter(function(d){return d.id!==e.id})),s=t.findIndex(function(d){return d.id===e.id}),u=j1(t,n),l=W1(u,i,a),f=l[s],c=[];return o.forEach(function(d,h){if(d.id!==e.id){var v=l[h],p=Y1(v,f);c.push(p),d.cosineSimilarity=p}}),o.sort(function(d,h){return h.cosineSimilarity-d.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},DU=function(){function r(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var i=n[e];this.parent[i]=i}}return r.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},r.prototype.union=function(t,e){var n=this.find(t),i=this.find(e);n!==i&&(n<i?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},r.prototype.connected=function(t,e){return this.find(t)===this.find(e)},r}(),NU=function(t,e){return t-e},PU=function(){function r(t){t===void 0&&(t=NU),this.compareFn=t,this.list=[]}return r.prototype.getLeft=function(t){return 2*t+1},r.prototype.getRight=function(t){return 2*t+2},r.prototype.getParent=function(t){return t===0?null:Math.floor((t-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},r.prototype.insert=function(t){if(t!==null){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},r.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},r.prototype.moveDown=function(t){var e,n=t,i=this.getLeft(t),a=this.getRight(t),o=this.list.length;i!==null&&i<o&&this.compareFn(this.list[n],this.list[i])>0?n=i:a!==null&&a<o&&this.compareFn(this.list[n],this.list[a])>0&&(n=a),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},r}(),RU=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,o=t.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=a[0],l=new Set;l.add(u);var f=function(g,y){return e?g.weight-y.weight:0},c=new PU(f);for(Vh(u.id,s).forEach(function(p){c.insert(p)});!c.isEmpty();){var d=c.delMin(),h=d.source,v=d.target;l.has(h)&&l.has(v)||(n.push(d),l.has(h)||(l.add(h),Vh(h,s).forEach(function(p){c.insert(p)})),l.has(v)||(l.add(v),Vh(v,s).forEach(function(p){c.insert(p)})))}return n},YE=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,o=t.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=s.map(function(h){return h});e&&u.sort(function(h,v){return h.weight-v.weight});for(var l=new DU(a.map(function(h){return h.id}));u.length>0;){var f=u.shift(),c=f.source,d=f.target;l.connected(c,d)||(n.push(f),l.union(c,d))}return n},jI=function(t,e,n){var i={prim:RU,kruskal:YE};return n?i[n](t,e):YE(t,e)},WI=function(t,e,n){typeof e!="number"&&(e=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,o=1e3,s=t.nodes,u=s===void 0?[]:s,l=t.edges,f=l===void 0?[]:l,c=u.length,d,h={},v={},p=0;p<c;++p){var g=u[p],y=g.id;h[y]=1/c,v[y]=1/c}for(var m=Po(t);o>0&&i>e;){a=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;if(d=0,m[g.id].inDegree===0)h[y]=0;else{for(var b=Ni(y,f,"source"),x=0;x<b.length;++x){var w=b[x],E=m[w].outDegree;E>0&&(d+=v[w]/E)}h[y]=n*d,a+=h[y]}}a=(1-a)/c,i=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;d=h[y]+a,i+=Math.abs(d-v[y]),v[y]=d}o-=1}return v},BU=-1,_v=-1,XI="-1",Ua="-1",YI=-1,VE=function(){function r(t,e,n,i){t===void 0&&(t=BU),e===void 0&&(e=_v),n===void 0&&(n=_v),i===void 0&&(i=XI),this.id=t,this.from=e,this.to=n,this.label=i}return r}(),FU=function(){function r(t,e){t===void 0&&(t=_v),e===void 0&&(e=Ua),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},r}(),VI=function(){function r(t,e,n){t===void 0&&(t=_v),e===void 0&&(e=!0),n===void 0&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new FU(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},r.prototype.addEdge=function(t,e,n,i){if((this.edgeIdAutoIncrease||t===void 0)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var a=new VE(t,e,n,i);if(this.edges.push(a),this.edgeMap[t]=a,this.nodeMap[e].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new VE(t,n,e,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}(),Hs=function(){function r(t,e,n,i,a){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||Ua,edgeLabel:i||XI,nodeLabel2:a||Ua}}return r.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r}(),HE=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(t){var e=this.dfsEdgeList.length,n=t.length;if(e!==n)return!1;for(var i=0;i<e;i++)if(this.dfsEdgeList[i]!==t[i])return!1;return!0},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r.prototype.pushBack=function(t,e,n,i,a){return this.dfsEdgeList.push(new Hs(t,e,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(t,e){t===void 0&&(t=YI),e===void 0&&(e=!1);var n=new VI(t,!0,e);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,o=i.toNode,s=i.nodeEdgeNodeLabel,u=s.nodeLabel1,l=s.edgeLabel,f=s.nodeLabel2;u!==Ua&&n.addNode(a,u),f!==Ua&&n.addNode(o,f),u!==Ua&&f!==u&&n.addEdge(void 0,a,o,l)}),n},r.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length,n=e-1;n>=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,o=i.toNode;a<o&&(t===void 0||o===t)&&(this.rmpath.push(n),t=a)}return this.rmpath},r.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach(function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)}),Object.keys(t).length},r}(),Yd=function(){function r(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return r.prototype.hasNode=function(t){return this.nodesUsed[t.id]===1},r.prototype.hasEdge=function(t){return this.edgesUsed[t.id]===1},r}(),zU=function(){function r(t){var e=t.graphs,n=t.minSupport,i=n===void 0?2:n,a=t.minNodeNum,o=a===void 0?1:a,s=t.maxNodeNum,u=s===void 0?4:s,l=t.top,f=l===void 0?10:l,c=t.directed,d=c===void 0?!1:c,h=t.verbose,v=h===void 0?!1:h;this.graphs=e,this.dfsCode=new HE,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=f,this.directed=d,this.counter=0,this.maxNodeNum=u,this.minNodeNum=o,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return r.prototype.findForwardRootEdges=function(t,e){var n=this,i=[],a=t.nodeMap;return e.edges.forEach(function(o){(n.directed||e.label<=a[o.to].label)&&i.push(o)}),i},r.prototype.findBackwardEdge=function(t,e,n,i){if(!this.directed&&e===n)return null;for(var a=t.nodeMap,o=a[n.to],s=o.edges,u=s.length,l=0;l<u;l++){var f=s[l];if(!(i.hasEdge(f)||f.to!==e.from)){if(this.directed){if(a[e.from].label<a[n.to].label||a[e.from].label===a[n.to].label&&e.label<=f.label)return f}else if(e.label<f.label||e.label===f.label&&a[e.to].label<=a[n.to].label)return f}}return null},r.prototype.findForwardPureEdges=function(t,e,n,i){for(var a=[],o=e.to,s=t.nodeMap[o].edges,u=s.length,l=0;l<u;l++){var f=s[l],c=t.nodeMap[f.to];n<=c.label&&!i.hasNode(c)&&a.push(f)}return a},r.prototype.findForwardRmpathEdges=function(t,e,n,i){for(var a=[],o=t.nodeMap,s=o[e.to].label,u=o[e.from],l=u.edges,f=l.length,c=0;c<f;c++){var d=l[c],h=o[d.to].label;e.to===d.to||n>h||i.hasNode(o[d.to])||(e.label<d.label||e.label===d.label&&s<=h)&&a.push(d)}return a},r.prototype.getSupport=function(t){var e={};return t.forEach(function(n){e[n.graphId]||(e[n.graphId]=!0)}),Object.keys(e).length},r.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach(function(n){var i=t[n],a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;if(!e){e={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(a<e.nodeLabel1||a===e.nodeLabel1&&o<e.edgeLabel||a===e.nodeLabel1&&o===e.edgeLabel&&s<e.nodeLabel2)&&(e={nodeLabel1:a,edgeLabel:o,nodeLabel2:s})}),e},r.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),e.dfsEdgeList.length===1)return!0;var n=this.directed,i=e.toGraph(YI,n),a=i.nodeMap,o=new HE,s={};i.nodes.forEach(function(c){var d=t.findForwardRootEdges(i,c);d.forEach(function(h){var v=a[h.to],p="".concat(c.label,"-").concat(h.label,"-").concat(v.label);s[p]||(s[p]={projected:[],nodeLabel1:c.label,edgeLabel:h.label,nodeLabel2:v.label});var g={graphId:i.id,edge:h,preNode:null};s[p].projected.push(g)})});var u=this.findMinLabel(s);if(u){o.dfsEdgeList.push(new Hs(0,1,u.nodeLabel1,u.edgeLabel,u.nodeLabel2));var l=function c(d){for(var h=o.buildRmpath(),v=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,p=o.dfsEdgeList[h[0]].toNode,g={},y=!1,m=0,b=n?-1:0,x=function(z){if(y)return"break";d.forEach(function(W){var D=new Yd(W),R=t.findBackwardEdge(i,D.edges[h[z]],D.edges[h[0]],D);R&&(g[R.label]||(g[R.label]={projected:[],edgeLabel:R.label}),g[R.label].projected.push({graphId:i.id,edge:g,preNode:W}),m=o.dfsEdgeList[h[z]].fromNode,y=!0)})},w=h.length-1;w>b;w--){var E=x(w);if(E==="break")break}if(y){var _=t.findMinLabel(g);o.dfsEdgeList.push(new Hs(p,m,Ua,_.edgeLabel,Ua));var M=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[M]!==o.dfsEdgeList[M]?!1:c(g[_.edgeLabel].projected)}var C={};y=!1;var S=0;d.forEach(function(N){var z=new Yd(N),W=t.findForwardPureEdges(i,z.edges[h[0]],v,z);W.length>0&&(y=!0,S=p,W.forEach(function(D){var R="".concat(D.label,"-").concat(a[D.to].label);C[R]||(C[R]={projected:[],edgeLabel:D.label,nodeLabel2:a[D.to].label}),C[R].projected.push({graphId:i.id,edge:D,preNode:N})}))});for(var A=h.length,T=function(z){if(y)return"break";var W=h[z];d.forEach(function(D){var R=new Yd(D),H=t.findForwardRmpathEdges(i,R.edges[W],v,R);H.length>0&&(y=!0,S=o.dfsEdgeList[W].fromNode,H.forEach(function(ee){var Y="".concat(ee.label,"-").concat(a[ee.to].label);C[Y]||(C[Y]={projected:[],edgeLabel:ee.label,nodeLabel2:a[ee.to].label}),C[Y].projected.push({graphId:i.id,edge:ee,preNode:D})}))})},w=0;w<A;w++){var I=T(w);if(I==="break")break}if(!y)return!0;var k=t.findMinLabel(C);o.dfsEdgeList.push(new Hs(S,p+1,Ua,k.edgeLabel,k.nodeLabel2));var P=o.dfsEdgeList.length-1;return e.dfsEdgeList[P]!==o.dfsEdgeList[P]?!1:c(C["".concat(k.edgeLabel,"-").concat(k.nodeLabel2)].projected)},f="".concat(u.nodeLabel1,"-").concat(u.edgeLabel,"-").concat(u.nodeLabel2);return l(s[f].projected)}},r.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(ar(t))}},r.prototype.subGraphMining=function(t){var e=this,n=this.getSupport(t);if(!(n<this.minSupport)&&this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),o=this.dfsCode.dfsEdgeList[a[0]].toNode,s=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,u={},l={};t.forEach(function(f){for(var c=e.graphs[f.graphId],d=c.nodeMap,h=new Yd(f),v=a.length-1;v>=0;v--){var p=e.findBackwardEdge(c,h.edges[a[v]],h.edges[a[0]],h);if(p){var g="".concat(e.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(p.label);l[g]||(l[g]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:p.label}),l[g].projected.push({graphId:f.graphId,edge:p,preNode:f})}}if(!(i>=e.maxNodeNum)){var y=e.findForwardPureEdges(c,h.edges[a[0]],s,h);y.forEach(function(b){var x="".concat(o,"-").concat(b.label,"-").concat(d[b.to].label);u[x]||(u[x]={projected:[],fromNodeId:o,edgeLabel:b.label,nodeLabel2:d[b.to].label}),u[x].projected.push({graphId:f.graphId,edge:b,preNode:f})});for(var m=function(x){var w=e.findForwardRmpathEdges(c,h.edges[a[x]],s,h);w.forEach(function(E){var _="".concat(e.dfsCode.dfsEdgeList[a[x]].fromNode,"-").concat(E.label,"-").concat(d[E.to].label);u[_]||(u[_]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[x]].fromNode,edgeLabel:E.label,nodeLabel2:d[E.to].label}),u[_].projected.push({graphId:f.graphId,edge:E,preNode:f})})},v=0;v<a.length;v++)m(v)}}),Object.keys(l).forEach(function(f){var c=l[f],d=c.toNodeId,h=c.edgeLabel;e.dfsCode.dfsEdgeList.push(new Hs(o,d,"-1",h,"-1")),e.subGraphMining(l[f].projected),e.dfsCode.dfsEdgeList.pop()}),Object.keys(u).forEach(function(f){var c=u[f],d=c.fromNodeId,h=c.edgeLabel,v=c.nodeLabel2;e.dfsCode.dfsEdgeList.push(new Hs(d,o+1,Ua,h,v)),e.subGraphMining(u[f].projected),e.dfsCode.dfsEdgeList.pop()})}},r.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,a={},o={},s={};return Object.keys(t).forEach(function(u){var l=t[u],f=l.nodeMap;l.nodes.forEach(function(c,d){var h=c.label,v="".concat(u,"-").concat(h);if(!s[v]){var p=a[h]||0;p++,a[h]=p}s[v]={graphKey:u,label:h},c.edges.forEach(function(g){var y=h,m=f[g.to].label;if(!e&&y>m){var b=m;m=y,y=b}var x=g.label,w="".concat(y,"-").concat(x,"-").concat(m);if(!o[w]){var E=o[w]||0;E++,o[w]=E}})})}),Object.keys(a).forEach(function(u){var l=a[u];if(!(l<n)){var f={nodes:[],edges:[]};f.nodes.push({id:"0",label:u}),i.push(f)}}),i},r.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs;this.directed;var n={};Object.keys(e).forEach(function(i){var a=e[i],o=a.nodeMap;a.nodes.forEach(function(s){var u=t.findForwardRootEdges(a,s);u.forEach(function(l){var f=o[l.to],c="".concat(s.label,"-").concat(l.label,"-").concat(f.label);n[c]||(n[c]={projected:[],nodeLabel1:s.label,edgeLabel:l.label,nodeLabel2:f.label});var d={graphId:i,edge:l,preNode:null};n[c].projected.push(d)})})}),Object.keys(n).forEach(function(i){var a=n[i],o=a.projected,s=a.nodeLabel1,u=a.edgeLabel,l=a.nodeLabel2;t.dfsCode.dfsEdgeList.push(new Hs(0,1,s,u,l)),t.subGraphMining(o),t.dfsCode.dfsEdgeList.pop()})}},r}(),GU=function(t,e,n,i){var a={};return Object.keys(t).forEach(function(o,s){var u=t[o],l=new VI(s,!0,e),f={};u.nodes.forEach(function(c,d){l.addNode(d,c[n]),f[c.id]=d}),u.edges.forEach(function(c,d){var h=f[c.source],v=f[c.target];l.addEdge(-1,h,v,c[i])}),l&&l.getNodeNum()&&(a[l.id]=l)}),a},$U=function(t,e,n){var i=[];return t.forEach(function(a){var o={nodes:[],edges:[]};a.nodes.forEach(function(s){var u;o.nodes.push((u={id:"".concat(s.id)},u[e]=s.label,u))}),a.edges.forEach(function(s){var u;o.edges.push((u={source:"".concat(s.from),target:"".concat(s.to)},u[n]=s.label,u))}),i.push(o)}),i},KE="cluster",UU=function(t){var e=t.graphs,n=t.directed,i=n===void 0?!1:n,a=t.nodeLabelProp,o=a===void 0?KE:a,s=t.edgeLabelProp,u=s===void 0?KE:s,l=GU(e,i,o,u),f=t.minSupport,c=t.maxNodeNum,d=t.minNodeNum,h=t.verbose,v=t.top,p={graphs:l,minSupport:f,maxNodeNum:c,minNodeNum:d,top:v,verbose:h,directed:i},g=new zU(p);g.run();var y=$U(g.frequentSubgraphs,o,u);return y},qE=function(t,e,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],o=t.nodes;return e.forEach(function(s,u){a.push(HI(o,s,u,n,i))}),a},HI=function(t,e,n,i,a){var o=[n],s=[],u={};return e.forEach(function(l,f){if(l<=a&&n!==f){o.push(f),s.push(t[f]);var c=t[f][i];u[c]?(u[c].count++,u[c].dists.push(l)):u[c]={count:1,dists:[l]}}}),Object.keys(u).forEach(function(l){u[l].dists=u[l].dists.sort(function(f,c){return f-c})}),{nodeIdx:n,nodeId:t[n].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:u}},jU=function(t,e,n,i,a){var o=Math.ceil(n/e),s={},u=0;return i.forEach(function(l,f){for(var c=0,d=0,h=l.nodeIdxs,v=l.neighborNum-1;c<o;){for(var p=h[1+Math.floor(Math.random()*v)],g=0;(s["".concat(f,"-").concat(p)]||s["".concat(p,"-").concat(f)])&&(p=Math.floor(Math.random()*e),g++,!(g>2*e)););if(g<2*e&&(s["".concat(f,"-").concat(p)]={start:f,end:p,distance:a[f][p]},c++,u++,u>=n))return s;if(d++,d>2*e)break}if(c<o){var y=o-c;o=(o+y)/(e-f-1)}}),s},Hh=function(t,e,n,i){var a=n.nodes;return i||(i={}),Object.keys(t).forEach(function(o){var s,u;if(!(i&&i[o])){i[o]={nodes:[],edges:[]};var l=t[o],f=(s=e[l.start])===null||s===void 0?void 0:s.nodeIdxs,c=(u=e[l.end])===null||u===void 0?void 0:u.nodeIdxs;if(!(!f||!c)){var d=new Set(c),h=f.filter(function(m){return d.has(m)});if(!(!h||!h.length)){for(var v={},p=h.length,g=0;g<p;g++){var y=a[h[g]];i[o].nodes.push(y),v[y.id]=!0}n.edges.forEach(function(m){v[m.source]&&v[m.target]&&i[o].edges.push(m)})}}}}),i},Kh=function(t,e,n,i){var a,o,s={};t.nodes.forEach(function(l){s[l.id]=l});var u=0;return!(!((a=e==null?void 0:e.edges)===null||a===void 0)&&a.length)||((o=e==null?void 0:e.nodes)===null||o===void 0?void 0:o.length)<2?0:(t.edges.forEach(function(l){var f=s[l.source][n],c=s[l.target][n],d=e==null?void 0:e.nodes[0][n],h=e==null?void 0:e.nodes[1][n],v=e==null?void 0:e.edges[0][i];l[i]===v&&(f===d&&c===h||f===h&&c===d)&&u++}),u)},WU=function(t,e,n){for(var i=1/0,a=0,o=function(l){var f=t[l],c=Object.keys(f).sort(function(m,b){return f[m]-f[b]}),d=10,h=[];c.forEach(function(m,b){h[b%d]||(h[b%d]={graphs:[],totalCount:0,aveCount:0}),h[b%d].graphs.push(m),h[b%d].totalCount+=f[m]});var v=0,p=[];h.forEach(function(m){var b=m.totalCount/m.graphs.length;m.aveCount=b,p.push(b);var x=0,w=m.length;m.graphs.forEach(function(E,_){var M=f[E];m.graphs.forEach(function(C,S){_!==S&&(x+=Math.abs(M-f[C]))})}),x/=w*(w-1)/2,v+=x}),v/=h.length;var g=0;p.forEach(function(m,b){p.forEach(function(x,w){b!==w&&(g+=Math.abs(m-x))}),g/=p.length*(p.length-1)/2});var y=g-v;i<y&&(i=y,a=l)},s=0;s<e;s++)o(s);return{structure:n[a],structureCountMap:t[a]}},ZE=function(t,e){var n={},i={};return t.forEach(function(a,o){n[a.id]={idx:o,node:a,degree:0,inDegree:0,outDegree:0};var s=a[e];i[s]||(i[s]=[]),i[s].push(a)}),{nodeMap:n,nodeLabelMap:i}},QE=function(t,e,n){var i={},a={};return t.forEach(function(o,s){i["".concat(TI)]={idx:s,edge:o};var u=o[e];a[u]||(a[u]=[]),a[u].push(o);var l=n[o.source];l&&(l.degree++,l.outDegree++);var f=n[o.target];f&&(f.degree++,f.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},JE=function(t,e,n){var i=e.length,a={};return e.forEach(function(o,s){for(var u=n?0:s+1,l=t[s].id,f=u;f<i;f++)if(s!==f){var c=t[f].id,d=o[f];a["".concat(l,"-").concat(c)]=d,n||(a["".concat(c,"-").concat(l)]=d)}}),a},XU=function(t,e,n,i,a,o,s,u,l,f,c){var d,h="".concat(e.id,"-").concat(n.id);if(f&&f[h])return f[h];var v=c?c[h]:void 0;if(!v){var p=(d={},d[h]={start:i[e.id].idx,end:i[n.id].idx,distance:a},d);c=Hh(p,o,t,c),v=c[h]}return Kh(v,s,u,l)},e2=function(t,e,n,i){var a,o,s,u=(a=t[e])===null||a===void 0?void 0:a.degree,l=(o=t[e])===null||o===void 0?void 0:o.inDegree,f=(s=t[e])===null||s===void 0?void 0:s.outDegree;return t[e]===void 0&&(u=1/0,l=1/0,f=1/0,i[e].forEach(function(c){var d=n[c.id].degree;u>d&&(u=d);var h=n[c.id].inDegree;l>h&&(l=h);var v=n[c.id].outDegree;f>v&&(f=v)}),t[e]={degree:u,inDegree:l,outDegree:f}),{minPatternNodeLabelDegree:u,minPatternNodeLabelInDegree:l,minPatternNodeLabelOutDegree:f}},KI=function(t,e,n,i,a,o,s){var u;if(n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!t||!t.nodes)){var l=t.nodes.length;if(l){var f=dc(t,n),c=dc(e,n),d=JE(t.nodes,f,n),h=JE(e.nodes,c,n),v=ZE(t.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,y=ZE(e.nodes,o),m=y.nodeMap,b=y.nodeLabelMap;QE(t.edges,s,p);var x=QE(e.edges,s,m).edgeLabelMap,w=[];c==null||c.forEach(function(et){w=w.concat(et)}),a||(a=Math.max.apply(Math,Bi(Bi([],w,!1),[2],!1))),i||(i=a);var E=qE(t,f,o,i),_=qE(e,c,o,i),M=Math.min(100,l*(l-1)/2),C=jU(i,l,M,E,f),S=Hh(C,E,t),A=10,T=1,I=1,k=4,P={graphs:S,nodeLabelProp:o,edgeLabelProp:s,minSupport:T,minNodeNum:I,maxNodeNum:k,directed:n},N=UU(P).slice(0,A),z=N.length,W=[];N.forEach(function(et,ie){W[ie]={},Object.keys(S).forEach(function(L){var Se=S[L],Pe=Kh(Se,et,o,s);W[ie][L]=Pe})});var D=WU(W,z,N),R=D.structure,H=D.structureCountMap,ee=e.nodes[0],Y=[],X=(u=e.nodes[0])===null||u===void 0?void 0:u[o],fe=-1/0;e.nodes.forEach(function(et){var ie=et[o],L=g[ie];(L==null?void 0:L.length)>fe&&(fe=L.length,Y=L,X=ie,ee=et)});var we={},Ae={},Ke={},ot={},nt={},Ct={};Object.keys(b).forEach(function(et,ie){nt[et]=[],n&&(Ct[et]=[]);var L=b[et],Se={};L.forEach(function(qe){var tt=h["".concat(ee.id,"-").concat(qe.id)];if(tt&&nt[et].push(tt),Se["".concat(ee.id,"-").concat(qe.id)]={start:0,end:m[qe.id].idx,distance:tt},n){var yt=h["".concat(qe.id,"-").concat(ee.id)];yt&&Ct[et].push(yt)}}),nt[et]=nt[et].sort(function(qe,tt){return qe-tt}),n&&(Ct[et]=Ct[et].sort(function(qe,tt){return qe-tt})),Ae=Hh(Se,_,e,Ae);var Pe=[];if(Object.keys(Se).forEach(function(qe){if(Ke[qe]){Pe.push(Ke[qe]);return}var tt=Ae[qe];Ke[qe]=Kh(tt,R,o,s),Pe.push(Ke[qe])}),Pe=Pe.sort(function(qe,tt){return tt-qe}),ot["".concat(ee.id,"-").concat(et)]=Pe,et!==X)for(var me=(Y==null?void 0:Y.length)||0,je=function(tt){var yt=Y[tt],Ut=E[p[yt.id].idx],gr=Ut.nodeLabelCountMap[et],Pt=b[et].length;if(!gr||gr.count<Pt)return Y.splice(tt,1),"continue";for(var wr=!1,Zt=0;Zt<Pt;Zt++)if(gr.dists[Zt]>nt[et][Zt]){wr=!0;break}if(wr)return Y.splice(tt,1),"continue";var Mr={};Ut.neighbors.forEach(function(ir){var Br=d["".concat(yt.id,"-").concat(ir.id)];Mr["".concat(yt.id,"-").concat(ir.id)]={start:p[yt.id].idx,end:p[ir.id].idx,distance:Br}}),S=Hh(Mr,E,t,S);var Er=[];Object.keys(Mr).forEach(function(ir){if(H[ir]){Er.push(H[ir]);return}var Br=S[ir];H[ir]=Kh(Br,R,o,s),Er.push(H[ir])}),Er=Er.sort(function(ir,Br){return Br-ir});for(var vn=!1,Zt=0;Zt<Pt;Zt++)if(Er[Zt]<Pe[Zt]){vn=!0;break}if(vn)return Y.splice(tt,1),"continue"},Xe=me-1;Xe>=0;Xe--)je(Xe)});var Et=[];Y==null||Y.forEach(function(et){for(var ie=p[et.id].idx,L=HI(t.nodes,f[ie],ie,o,a),Se=L.neighbors,Pe=Se.length,me=!1,je=Pe-1;je>=0;je--){if(Se.length+1<e.nodes.length){me=!0;return}var Xe=Se[je],qe=Xe[o];if(!b[qe]||!b[qe].length){Se.splice(je,1);continue}if(!nt[qe]||!nt[qe].length){Se.splice(je,1);continue}var tt="".concat(et.id,"-").concat(Xe.id),yt=d[tt],Ut=nt[qe].length-1,gr=nt[qe][Ut];if(yt>gr){Se.splice(je,1);continue}if(n){var Pt="".concat(Xe.id,"-").concat(et.id),wr=d[Pt];Ut=Ct[qe].length-1;var Zt=Ct[qe][Ut];if(wr>Zt){Se.splice(je,1);continue}}var Mr=H[tt]?H[tt]:XU(t,et,Xe,p,yt,E,R,o,s,H,S),Er="".concat(ee.id,"-").concat(qe),vn=ot[Er][ot[Er].length-1];if(Mr<vn){Se.splice(je,1);continue}var ir=e2(we,qe,m,b),Br=ir.minPatternNodeLabelDegree;if(ir.minPatternNodeLabelInDegree,ir.minPatternNodeLabelOutDegree,p[Xe.id].degree<Br){Se.splice(je,1);continue}}me||Et.push({nodes:[et].concat(Se)})});var fr=cc(e,ee.id,!1).length,Gt={};n?(Object.keys(fr).forEach(function(et){var ie=m[et].node[o];Gt[ie]?Gt[ie].push(fr[et]):Gt[ie]=[fr[et]]}),Object.keys(Gt).forEach(function(et){Gt[et].sort(function(ie,L){return ie-L})})):Gt=nt;for(var jt=Et.length,Sr=function(ie){var L=Et[ie],Se=L.nodes[0],Pe={},me={};L.nodes.forEach(function(_t,ue){me[_t.id]={idx:ue,node:_t,degree:0,inDegree:0,outDegree:0};var ve=_t[o];Pe[ve]?Pe[ve]++:Pe[ve]=1});var je=[],Xe={};t.edges.forEach(function(_t){me[_t.source]&&me[_t.target]&&(je.push(_t),Xe[_t[s]]?Xe[_t[s]]++:Xe[_t[s]]=1,me[_t.source].degree++,me[_t.target].degree++,me[_t.source].outDegree++,me[_t.target].inDegree++)});for(var qe=Object.keys(x).length,tt=!1,yt=0;yt<qe;yt++){var Ut=Object.keys(x)[yt];if(!Xe[Ut]||Xe[Ut]<x[Ut].length){tt=!0;break}}if(tt)return Et.splice(ie,1),"continue";var gr=je.length;if(gr<e.edges.length)return Et.splice(ie,1),"break";for(var Pt=!1,wr=function(ue){var ve=je[ue],Ze=ve[s],ct=x[Ze];if(!ct||!ct.length)return Xe[Ze]--,ct&&Xe[Ze]<ct.length?(Pt=!0,"break"):(je.splice(ue,1),me[ve.source].degree--,me[ve.target].degree--,me[ve.source].outDegree--,me[ve.target].inDegree--,"continue");var St=me[ve.source].node[o],Tr=me[ve.target].node[o],zr=!1;if(ct.forEach(function(qr){var Zn=m[qr.source].node,Qn=m[qr.target].node;Zn[o]===St&&Qn[o]===Tr&&(zr=!0),!n&&Zn[o]===Tr&&Qn[o]===St&&(zr=!0)}),!zr)return Xe[Ze]--,ct&&Xe[Ze]<ct.length?(Pt=!0,"break"):(je.splice(ue,1),me[ve.source].degree--,me[ve.target].degree--,me[ve.source].outDegree--,me[ve.target].inDegree--,"continue")},yt=gr-1;yt>=0;yt--){var Zt=wr(yt);if(Zt==="break")break}if(Pt)return Et.splice(ie,1),"continue";L.edges=je;var Mr=cc(L,L.nodes[0].id,!1).length;if(Object.keys(Mr).reverse().forEach(function(_t){if(!(_t===L.nodes[0].id||Pt)){if(Mr[_t]===1/0){var ue=me[_t].node[o];if(Pe[ue]--,Pe[ue]<b[ue].length){Pt=!0;return}var ve=L.nodes.indexOf(me[_t].node);L.nodes.splice(ve,1),me[_t]=void 0;return}var Ze=p[_t].node[o];if(!Gt[Ze]||!Gt[Ze].length||Mr[_t]>Gt[Ze][Gt[Ze].length-1]){var ue=me[_t].node[o];if(Pe[ue]--,Pe[ue]<b[ue].length){Pt=!0;return}var ve=L.nodes.indexOf(me[_t].node);L.nodes.splice(ve,1),me[_t]=void 0}}}),Pt)return Et.splice(ie,1),"continue";for(var Er=!0,vn=0;Er&&!Pt;){Er=!1;var ir=n?me[Se.id].degree<m[ee.id].degree||me[Se.id].inDegree<m[ee.id].inDegree||me[Se.id].outDegree<m[ee.id].outDegree:me[Se.id].degree<m[ee.id].degree;if(ir){Pt=!0;break}if(Pe[Se[o]]<b[Se[o]].length){Pt=!0;break}for(var Br=L.nodes.length,ui=Br-1;ui>=0;ui--){var Kr=L.nodes[ui],$i=me[Kr.id].degree,lo=me[Kr.id].inDegree,fo=me[Kr.id].outDegree,on=Kr[o],pi=e2(we,on,m,b),ia=pi.minPatternNodeLabelDegree,co=pi.minPatternNodeLabelInDegree,ho=pi.minPatternNodeLabelOutDegree,vo=n?$i<ia||lo<co||fo<ho:$i<ia;if(vo){if(Pe[Kr[o]]--,Pe[Kr[o]]<b[Kr[o]].length){Pt=!0;break}L.nodes.splice(ui,1),me[Kr.id]=void 0,Er=!0}}if(Pt||!Er&&vn!==0)break;gr=je.length;for(var li=gr-1;li>=0;li--){var jr=je[li];if(!me[jr.source]||!me[jr.target]){je.splice(li,1);var qn=jr[s];if(Xe[qn]--,me[jr.source]&&(me[jr.source].degree--,me[jr.source].outDegree--),me[jr.target]&&(me[jr.target].degree--,me[jr.target].inDegree--),x[qn]&&Xe[qn]<x[qn].length){Pt=!0;break}Er=!0}}vn++}if(Pt||Pt||L.nodes.length<e.nodes.length||je.length<e.edges.length)return Et.splice(ie,1),"continue"},rr=jt-1;rr>=0;rr--){var Rt=Sr(rr);if(Rt==="break")break}for(var sr=Et.length,Hr=function(ie){var L=Et[ie],Se={};L.edges.forEach(function(je){var Xe="".concat(je.source,"-").concat(je.target,"-").concat(je.label);Se[Xe]?Se[Xe]++:Se[Xe]=1});for(var Pe=function(Xe){var qe=Et[Xe],tt={};qe.edges.forEach(function(Ut){var gr="".concat(Ut.source,"-").concat(Ut.target,"-").concat(Ut.label);tt[gr]?tt[gr]++:tt[gr]=1});var yt=!0;Object.keys(tt).length!==Object.keys(Se).length?yt=!1:Object.keys(Se).forEach(function(Ut){tt[Ut]!==Se[Ut]&&(yt=!1)}),yt&&Et.splice(Xe,1)},me=sr-1;me>ie;me--)Pe(me);sr=Et.length},rr=0;rr<=sr-1;rr++)Hr(rr);return Et}}},gl=function(){function r(t){t===void 0&&(t=10),this.linkedList=new AI,this.maxStep=t}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r}(),qI=G1;const YU={getAdjMatrix:du,breadthFirstSearch:II,connectedComponent:F1,getDegree:Po,getInDegree:LI,getOutDegree:kI,detectCycle:G1,detectDirectedCycle:qI,detectAllCycles:NI,detectAllDirectedCycle:U1,detectAllUndirectedCycle:$1,depthFirstSearch:z1,dijkstra:cc,findAllPath:BI,findShortestPath:RI,floydWarshall:dc,labelPropagation:FI,louvain:X1,iLouvain:zI,kCore:GI,kMeans:$I,cosineSimilarity:Y1,nodesCosineSimilarity:UI,minimumSpanningTree:jI,pageRank:WI,getNeighbors:Ni,Stack:gl,GADDI:KI},VU=Object.freeze(Object.defineProperty({__proto__:null,GADDI:KI,Stack:gl,breadthFirstSearch:II,connectedComponent:F1,cosineSimilarity:Y1,default:YU,depthFirstSearch:z1,detectAllCycles:NI,detectAllDirectedCycle:U1,detectAllUndirectedCycle:$1,detectCycle:G1,detectDirectedCycle:qI,dijkstra:cc,findAllPath:BI,findShortestPath:RI,floydWarshall:dc,getAdjMatrix:du,getDegree:Po,getInDegree:LI,getNeighbors:Ni,getOutDegree:kI,iLouvain:zI,kCore:GI,kMeans:$I,labelPropagation:FI,louvain:X1,minimumSpanningTree:jI,nodesCosineSimilarity:UI,pageRank:WI},Symbol.toStringTag,{value:"Module"}));var Sv=ra,HU=function(t){return function(e,n){return e[t]-n[t]}},t2=function(t,e,n){return t>=e&&t<=n},mp=function(t,e,n,i){var a=1e-4,o={x:n.x-t.x,y:n.y-t.y},s={x:e.x-t.x,y:e.y-t.y},u={x:i.x-n.x,y:i.y-n.y},l=s.x*u.y-s.y*u.x,f=l*l,c=1/l,d=s.x*s.x+s.y*s.y,h=u.x*u.x+u.y*u.y;if(f>a*d*h){var v=(o.x*u.y-o.y*u.x)*c,p=(o.x*s.y-o.y*s.x)*c;return!t2(v,0,1)||!t2(p,0,1)?null:{x:t.x+v*s.x,y:t.y+v*s.y}}return null},ZI=function(t,e){var n=t.x,i=t.y,a=t.width,o=t.height,s=n+a/2,u=i+o/2,l=[],f={x:s,y:u};l.push({x:n,y:i}),l.push({x:n+a,y:i}),l.push({x:n+a,y:i+o}),l.push({x:n,y:i+o}),l.push({x:n,y:i});for(var c=null,d=1;d<l.length&&(c=mp(l[d-1],l[d],f,e),!c);d++);return c},QI=function(t,e){var n=t.x,i=t.y,a=t.r,o=e.x,s=e.y,u=o-n,l=s-i;if(u*u+l*l<a*a)return null;var f=Math.atan(l/u);return{x:n+Math.abs(a*Math.cos(f))*Math.sign(u),y:i+Math.abs(a*Math.sin(f))*Math.sign(l)}},JI=function(t,e){var n=t.rx,i=t.ry,a=t.x,o=t.y,s=e.x-a,u=e.y-o,l=Math.atan2(u/i,s/n);return l<0&&(l+=2*Math.PI),{x:a+n*Math.cos(l),y:o+i*Math.sin(l)}},xl=function(t,e,n){n===void 0&&(n=1);var i=[t.x,t.y,n];return(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]),gp(i,i,e),{x:i[0],y:i[1]}},eO=function(t,e,n){n===void 0&&(n=1),(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]);var i=_1([1,0,0,0,1,0,0,0,1],e);i||(i=[1,0,0,0,1,0,0,0,1]);var a=[t.x,t.y,n];return gp(a,a,i),{x:a[0],y:a[1]}},Ly=function(t,e,n){var i=t.x-e.x,a=t.y-e.y,o=t.x-n.x,s=t.y-n.y,u=(t.x*t.x-e.x*e.x-e.y*e.y+t.y*t.y)/2,l=(t.x*t.x-n.x*n.x-n.y*n.y+t.y*t.y)/2,f=a*o-i*s;return{x:-(s*u-a*l)/f,y:-(i*l-o*u)/f}},Mv=function(t,e){var n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},KU=function(t,e){var n=[];return t.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*e)}),n.push(a)}),n},qU=function(t){for(var e=[],n=t.length,i=0;i<n;i+=1){e[i]=[];for(var a=0;a<n;a+=1)i===a?e[i][a]=0:t[i][a]===0||!t[i][a]?e[i][a]=1/0:e[i][a]=t[i][a]}for(var o=0;o<n;o+=1)for(var i=0;i<n;i+=1)for(var a=0;a<n;a+=1)e[i][a]>e[i][o]+e[o][a]&&(e[i][a]=e[i][o]+e[o][a]);return e},ZU=function(t,e){var n=t.nodes,i=t.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var l=[];a.push(l)}),i&&i.forEach(function(s){var u=s.source,l=s.target,f=o[u],c=o[l];a[f][c]=1,e||(a[c][f]=1)}),a},tO=function(t,e){t.translate(e.x,e.y)},ky=function(t,e,n,i){i===void 0&&(i={duration:500});var a=t.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=t.getCanvasBBox(),s=e.x-o.minX,u=e.y-o.minY;if(n){var l=s*a[0],f=u*a[4],c=0,d=0,h=0,v=0;t.animate(function(g){return h=l*g,v=f*g,a=Sv(a,[["t",h-c,v-d]]),c=h,d=v,{matrix:a}},i)}else{var p=Sv(a,[["t",s,u]]);t.setMatrix(p)}},QU=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=e;wt(e)||(i=[e,e]),wt(e)&&e.length===1&&(i=[e[0],e[0]]),n=Sv(n,[["s",i[0],i[1]]]),t.setMatrix(n)},JU=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=Sv(n,[["r",e]]),t.setMatrix(n)},ej=function(t,e,n){for(var i=[],a=0;a<t;a++)i[a]=0;return n.forEach(function(o){o.source&&(i[e[o.source]]+=1),o.target&&(i[e[o.target]]+=1)}),i};function tj(r,t,e){return(e[0]-r[0])*(t[1]-r[1])===(t[0]-r[0])*(e[1]-r[1])&&Math.min(r[0],t[0])<=e[0]&&e[0]<=Math.max(r[0],t[0])&&Math.min(r[1],t[1])<=e[1]&&e[1]<=Math.max(r[1],t[1])}var hc=function(t,e,n){var i=!1,a=t.length,o=1e-6;function s(c){return Math.abs(c)<o?0:c<0?-1:1}if(a<=2)return!1;for(var u=0;u<a;u++){var l=t[u],f=t[(u+1)%a];if(tj(l,f,[e,n]))return!0;s(l[1]-n)>0!=s(f[1]-n)>0&&s(e-(n-l[1])*(l[0]-f[0])/(l[1]-f[1])-l[0])<0&&(i=!i)}return i},rO=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},rj=function(t,e){var n=!1;return xe(t,function(i){if(mp(i.from,i.to,e.from,e.to))return n=!0,!1}),n},nO=function(t,e){var n=function(d){var h=d.map(function(p){return p[0]}),v=d.map(function(p){return p[1]});return{minX:Math.min.apply(null,h),maxX:Math.max.apply(null,h),minY:Math.min.apply(null,v),maxY:Math.max.apply(null,v)}},i=function(d){for(var h=[],v=d.length,p=0;p<v-1;p++){var g=d[p],y=d[p+1];h.push({from:{x:g[0],y:g[1]},to:{x:y[0],y:y[1]}})}if(h.length>1){var m=d[0],b=d[v-1];h.push({from:{x:b[0],y:b[1]},to:{x:m[0],y:m[1]}})}return h};if(t.length<2||e.length<2)return!1;var a=n(t),o=n(e);if(!rO(a,o))return!1;var s=!1;if(xe(e,function(c){if(hc(t,c[0],c[1]))return s=!0,!1}),s||(xe(t,function(c){if(hc(e,c[0],c[1]))return s=!0,!1}),s))return!0;var u=i(t),l=i(e),f=!1;return xe(l,function(c){if(rj(u,c))return f=!0,!1}),f},hu=function(){function r(t,e,n,i){this.x1=t,this.y1=e,this.x2=n,this.y2=i}return r.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),i=Math.max(this.y1,this.y2),a={x:t,y:e,minX:t,minY:e,maxX:n,maxY:i,width:n-t,height:i-e};return a},r}(),V1=function(t,e){var n={top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]};return n[e]},nj=function(t,e){var n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),i=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),a=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(a){var o=n/a,s=i/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},iO=function(t,e){for(var n=["top","left","bottom","right"],i=t.getBBox(),a=0,o=[],s=0;s<4;s++){var u=V1(i,n[s]),l=u[0],f=u[1],c=u[2],d=u[3];o[s]=mp({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:l,y:f},{x:c,y:d}),o[s]&&(a+=1)}return[o,a]},H1=function(t,e){for(var n=["top","left","bottom","right"],i=t.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var u=V1(i,n[s]),l=u[0],f=u[1],c=u[2],d=u[3],h=nj(e,new hu(l,f,c,d));h=Math.abs(h-.5),h>=0&&h<=1&&(o+=1,a=h<a?h:a)}return o===0?-1:a},aO=function(t){var e=0,n=0;if(t.length>0){for(var i=0,a=t;i<a.length;i++){var o=a[i];e+=o.x,n+=o.y}e/=t.length,n/=t.length}return{x:e,y:n}},Cv=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},oO=function(t,e){var n=e.x1,i=e.y1,a=e.x2-n,o=e.y2-i,s=t.x-n,u=t.y-i,l=s*a+u*o,f;l<=0?f=0:(s=a-s,u=o-u,l=s*a+u*o,l<=0?f=0:f=l*l/(a*a+o*o));var c=s*s+u*u-f;return c<0&&(c=0),c},Dy=function(t,e,n){return n===void 0&&(n=.001),Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(n,2)},sO=function(t,e){var n=t.x<e.x,i=t.x>e.x+e.width,a=t.y>e.y+e.height,o=t.y<e.y,s=n||i||a||o;if(!s)return 0;if(a&&!n&&!i)return Math.pow(e.y+e.height-t.y,2);if(o&&!n&&!i)return Math.pow(t.y-e.y,2);if(n&&!a&&!o)return Math.pow(e.x-t.x,2);if(i&&!a&&!o)return Math.pow(e.x+e.width-t.x,2);var u=Math.min(Math.abs(e.x-t.x),Math.abs(e.x+e.width-t.x)),l=Math.min(Math.abs(e.y-t.y),Math.abs(e.y+e.height-t.y));return u*u+l*l},ij=function(t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e.x,u=e.y,l=[a-n,o-i];if(B1(l,[0,0]))return NaN;var f=[-l[1],l[0]];gs(f,f);var c=[s-n,u-i];return Math.abs(R1(c,f))},K1=function(t,e,n){return t+(e-t)*n},Ny=function(t,e,n){for(var i=Math.min(t.length,e.length),a=new Array(i),o=0;o<i;o++)a[o]=K1(t[o],e[o],n);return a};const aj=Object.freeze(Object.defineProperty({__proto__:null,Line:hu,applyMatrix:xl,compare:HU,distance:Mv,floydWarshall:qU,fractionToLine:H1,getAdjMatrix:ZU,getBBoxBoundLine:V1,getCircleCenterByPoints:Ly,getCircleIntersectByPoint:QI,getDegree:ej,getEllipseIntersectByPoint:JI,getLineIntersect:mp,getPointsCenter:aO,getRectIntersectByPoint:ZI,intersectBBox:rO,invertMatrix:eO,isPointInPolygon:hc,isPointsOverlap:Dy,isPolygonsIntersect:nO,itemIntersectByLine:iO,lerp:K1,lerpArray:Ny,move:ky,pointLineDistance:ij,pointLineSquareDist:oO,pointRectSquareDist:sO,rotate:JU,scale:QU,scaleMatrix:KU,squareDist:Cv,translate:tO},Symbol.toStringTag,{value:"Module"}));var qo="rgb(95, 149, 255)",oj="rgb(255, 255, 255)",r2="rgb(0, 0, 0)",h0="rgb(247, 250, 255)",uO="rgb(239, 244, 255)",Vd="rgb(253, 253, 253)",n2="rgb(250, 250, 250)",Hd="rgb(224, 224, 224)",i2="rgb(234, 234, 234)",sj="rgb(245, 245, 245)",uj="rgb(191, 213, 255)",a2="#4572d9",lj="rgb(223, 234, 255)",br={mainStroke:qo,mainFill:uO,activeStroke:qo,activeFill:h0,inactiveStroke:uj,inactiveFill:h0,selectedStroke:qo,selectedFill:oj,highlightStroke:a2,highlightFill:lj,disableStroke:Hd,disableFill:n2,edgeMainStroke:Hd,edgeActiveStroke:qo,edgeInactiveStroke:i2,edgeSelectedStroke:qo,edgeHighlightStroke:qo,edgeDisableStroke:sj,comboMainStroke:Hd,comboMainFill:Vd,comboActiveStroke:qo,comboActiveFill:h0,comboInactiveStroke:Hd,comboInactiveFill:Vd,comboSelectedStroke:qo,comboSelectedFill:Vd,comboHighlightStroke:a2,comboHighlightFill:Vd,comboDisableStroke:i2,comboDisableFill:n2};const pt={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:br.mainStroke,fill:uO},size:20,color:br.mainStroke,linkPoints:{size:8,lineWidth:1,fill:br.activeFill,stroke:br.activeStroke}},nodeStateStyles:{active:{fill:br.activeFill,stroke:br.activeStroke,lineWidth:2,shadowColor:br.mainStroke,shadowBlur:10},selected:{fill:br.selectedFill,stroke:br.selectedStroke,lineWidth:4,shadowColor:br.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:br.highlightFill,stroke:br.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:br.inactiveFill,stroke:br.inactiveStroke,lineWidth:1},disable:{fill:br.disableFill,stroke:br.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:r2,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:br.edgeMainStroke,lineAppendWidth:2},color:br.edgeMainStroke},edgeStateStyles:{active:{stroke:br.edgeActiveStroke,lineWidth:1},selected:{stroke:br.edgeSelectedStroke,lineWidth:2,shadowColor:br.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:br.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:br.edgeInactiveStroke,lineWidth:1},disable:{stroke:br.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:r2,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:br.comboMainFill,lineWidth:1,stroke:br.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:br.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:br.comboActiveStroke,lineWidth:1,fill:br.comboActiveFill},selected:{stroke:br.comboSelectedStroke,lineWidth:2,fill:br.comboSelectedFill,shadowColor:br.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:br.comboHighlightStroke,lineWidth:2,fill:br.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:br.comboInactiveStroke,fill:br.comboInactiveFill,lineWidth:1},disable:{stroke:br.comboDisableStroke,fill:br.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window<"u"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},fj={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,0:.6,1:.40099945068359377,2:.6,3:.6,4:.6,5:.6,6:.6,7:.5469985961914062,8:.6,9:.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875};var Na=Math.PI,Py=Math.sin,Ry=Math.cos,Fn=Py(Na/8),zn=Ry(Na/8),Av=function(t,e){var n=t.getBBox(),i={x:n.minX,y:n.minY},a={x:n.maxX,y:n.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),i=xl(i,o),a=xl(a,o)}var s=i.x,u=i.y,l=a.x,f=a.y;return{x:s,y:u,minX:s,minY:u,maxX:l,maxY:f,width:l-s,height:f-u}},lO=function(t){var e=t.sourceNode||t.targetNode,n=e.get("group"),i=n.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var a=e.getKeyShape(),o=a.getBBox(),s=t.loopCfg||{},u=s.dist||Math.max(o.width,o.height)*2,l=s.position||pt.defaultLoopPosition,f=[(o.minX+o.maxX)/2+i[6],(o.minY+o.maxY)/2+i[7]],c=[t.startPoint.x,t.startPoint.y],d=[t.endPoint.x,t.endPoint.y],h=o.height/2,v=o.width/2,p=h,g=h,y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,w=a.get("type"),E=Math.min(h/2,v/2),_=Math.min(h,v),M=s!=null&&s.pointPadding?Math.min(_,s==null?void 0:s.pointPadding):E;if(c[0]===d[0]&&c[1]===d[1]){switch(l){case"top":w==="circle"?(c=[f[0]-y,f[1]-m],d=[f[0]+b,f[1]-x]):(c=[f[0]-M,f[1]-h],d=[f[0]+M,f[1]-h]);break;case"top-right":p=h,g=v,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]+y,f[1]-m],d=[f[0]+x,f[1]-b]):(c=[f[0]+v-M,f[1]-h],d=[f[0]+v,f[1]-h+M]);break;case"right":p=v,g=v,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]+m,f[1]-y],d=[f[0]+x,f[1]+b]):(c=[f[0]+v,f[1]-M],d=[f[0]+v,f[1]+M]);break;case"bottom-right":p=v,g=h,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]+m,f[1]+y],d=[f[0]+b,f[1]+x]):(c=[f[0]+v,f[1]+h-M],d=[f[0]+v-M,f[1]+h]);break;case"bottom":p=h,g=h,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]+y,f[1]+m],d=[f[0]-b,f[1]+x]):(c=[f[0]-M,f[1]+h],d=[f[0]+M,f[1]+h]);break;case"bottom-left":p=h,g=v,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]-y,f[1]+m],d=[f[0]-x,f[1]+b]):(c=[f[0]-v,f[1]+h-M],d=[f[0]-v+M,f[1]+h]);break;case"left":p=v,g=v,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]-m,f[1]+y],d=[f[0]-x,f[1]-b]):(c=[f[0]-v,f[1]-M],d=[f[0]-v,f[1]+M]);break;case"top-left":p=v,g=h,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]-m,f[1]-y],d=[f[0]-b,f[1]-x]):(c=[f[0]-v+M,f[1]-h],d=[f[0]-v,f[1]-h+M]);break;default:p=v,g=v,y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]-y,f[1]-m],d=[f[0]+b,f[1]-x]}if(s.clockwise===!1){var C=[c[0],c[1]];c=[d[0],d[1]],d=[C[0],C[1]]}}var S=[c[0]-f[0],c[1]-f[1]],A=(p+u)/p,T=(g+u)/g;s.clockwise===!1&&(A=(g+u)/g,T=(p+u)/p);var I=oi([0,0],S,A),k=[f[0]+I[0],f[1]+I[1]],P=[d[0]-f[0],d[1]-f[1]],N=oi([0,0],P,T),z=[f[0]+N[0],f[1]+N[1]];return t.startPoint={x:c[0],y:c[1]},t.endPoint={x:d[0],y:d[1]},t.controlPoints=[{x:k[0],y:k[1]},{x:z[0],y:z[1]}],t},fO=function(t,e,n,i,a){var o=1e-4,s=[],u=t==null?void 0:t.getPoint(e);if(!u)return{x:0,y:0,angle:0};if(e<o)s=t.getStartTangent().reverse();else if(e>1-o)s=t.getEndTangent();else{var l=t==null?void 0:t.getPoint(e+o);s.push([u.x,u.y]),s.push([l.x,l.y])}var f=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(f<0&&(f+=Na*2),n&&(u.x+=Ry(f)*n,u.y+=Py(f)*n),i){var c=f-Na/2;f>1/2*Na&&f<3*1/2*Na&&(c-=Na),u.x+=Ry(c)*i,u.y+=Py(c)*i}var d={x:u.x,y:u.y,angle:f};return a?(f>.5*Na&&f<1.5*Na&&(f-=Na),F({rotate:f},d)):d},cj=function r(t,e,n,i){if(i(t,e,n)===!1)return!1;if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!r(t.children[a],t,a,i))return!1}return!0},dj=function r(t,e,n,i){if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!r(t.children[a],t,a,i))return}return i(t,e,n)!==!1},ai=function(t,e){typeof e=="function"&&cj(t,null,-1,e)},Pa=function(t,e){typeof e=="function"&&dj(t,null,-1,e)},cO=function(t,e){return e*(fj[t]||1)},dO=function(t,e){var n=0,i=new RegExp("[一-龥]+");return t.split("").forEach(function(a){i.test(a)?n+=e:n+=cO(a,e)}),[n,e]},hO=function(t,e){return typeof e!="number"||e<=0||e>=t.length?t:t.substring(0,e)+"..."},By=function(t,e){var n=[],i={},a={};t.forEach(function(u){a[u.id]=u}),t.forEach(function(u,l){var f=ar(u);f.itemType="combo",f.children=void 0,f.parentId===f.id?(console.warn("The parentId for combo ".concat(f.id," can not be the same as the combo's id")),delete f.parentId):f.parentId&&!a[f.parentId]&&(console.warn("The parent combo for combo ".concat(f.id," does not exist!")),delete f.parentId);var c=i[f.id];if(c){if(f.children=c.children,i[f.id]=f,c=f,!c.parentId){n.push(c);return}var d=i[c.parentId];if(d)d.children?d.children.push(f):d.children=[f];else{var h={id:c.parentId,children:[c]};i[c.parentId]=h,i[f.id]=f}return}if(Fe(u.parentId)){var v=i[u.parentId];if(v)v.children?v.children.push(f):v.children=[f],i[f.id]=f;else{var p={id:u.parentId,children:[f]};i[p.id]=p,i[f.id]=f}}else n.push(f),i[f.id]=f});var o={};(e||[]).forEach(function(u){o[u.id]=u;var l=i[u.comboId];if(l){var f={id:u.id,comboId:u.comboId};l.children?l.children.push(f):l.children=[f],f.itemType="node",i[u.id]=f}});var s=0;return n.forEach(function(u){u.depth=s+10,ai(u,function(l){var f,c=i[l.id].itemType;c==="node"?f=i[l.comboId]:f=i[l.parentId],f&&c==="node"?l.depth=s+1:l.depth=s+10,s<l.depth&&(s=l.depth);var d=o[l.id];return d&&(d.depth=l.depth),!0})}),n},Fy=function(t,e,n){var i,a=t,o,s={root:{children:t}},u=!1,l="root";(t||[]).forEach(function(v){if(!u){if(v.id===e){o=v,v.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0;return}ai(v,function(p){var g;return s[p.id]={children:(p==null?void 0:p.children)||[]},a=(g=s[p.parentId||p.comboId||"root"])===null||g===void 0?void 0:g.children,p&&(p.removed||e===p.id)&&a?(l=p.parentId||p.comboId||"root",o=p,p.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0,!1):!0})}}),a=(i=s[l])===null||i===void 0?void 0:i.children;var f=a?a.indexOf(o):-1;if(f>-1&&a.splice(f,1),u||(o={id:e,itemType:"node",comboId:n},s[e]={children:void 0}),e){var c=!1;if(n){var d=0;(t||[]).forEach(function(v){c||ai(v,function(p){return n===p.id?(c=!0,p.children?p.children.push(o):p.children=[o],d=p.depth,o.itemType==="node"?o.depth=d+2:o.depth=d+1,!1):!0})})}else(!n||!c)&&o.itemType!=="node"&&t.push(o);var h=o.depth;ai(o,function(v){return v.itemType==="node"?h+=2:h+=1,v.depth=h,!0})}return t},qh=function(t,e,n){var i={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!t||t.length===0){var a=n==null?void 0:n.getModel(),o=a||{},s=o.x,u=o.y,l=o.fixSize,f=o.collapsed,c=o.fixCollapseSize,d=f?c:l,h=wt(d)?d:[d,d],v=h[0],p=h[1],g=[v/2,p/2];return{minX:s-g[0],minY:u-g[1],maxX:s+g[0],maxY:u+g[1],x:s,y:u,width:v,height:p}}return t.forEach(function(y){var m=e.findById(y.id);if(!(!m||!m.isVisible())){m.set("bboxCanvasCache",void 0);var b=m.getCanvasBBox();b.x&&i.minX>b.minX&&(i.minX=b.minX),b.y&&i.minY>b.minY&&(i.minY=b.minY),b.x&&i.maxX<b.maxX&&(i.maxX=b.maxX),b.y&&i.maxY<b.maxY&&(i.maxY=b.maxY)}}),i.x=(i.minX+i.maxX)/2,i.y=(i.minY+i.maxY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2,(n==null?void 0:n.getKeyShape().get("type"))==="circle"&&(i.width=Math.hypot(i.height,i.width),i.height=i.width),Object.keys(i).forEach(function(y){(i[y]===1/0||i[y]===-1/0)&&(i[y]=void 0)}),i},hj=function(t){var e=mt(t.x)||mt(t.y)||t.type||t.anchorPoints||t.size;return t.style&&(e=e||mt(t.style.r)||mt(t.style.width)||mt(t.style.height)||mt(t.style.rx)||mt(t.style.ry)),e},Zh=function(t){var e={};return Object.keys(t).forEach(function(n){var i=t[n];if(!(n==="img"&&!Fe(i)))if(Wn(i)&&!wt(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!Fe(s)||(a[o]=ar(s))}),e[n]=a}else e[n]=ar(i)}),e},vc=function(t){var e=t.animateCfg,n=t.callback,i;if(!e)i={duration:500,callback:n};else if(i=ar(e),e.callback){var a=e.callback;i.callback=function(){n(),a()}}else i.callback=n;return i};const vj=Object.freeze(Object.defineProperty({__proto__:null,cloneBesidesImg:Zh,getAnimateCfgWithCallback:vc,getBBox:Av,getComboBBox:qh,getLabelPosition:fO,getLetterWidth:cO,getLoopCfgs:lO,getTextSize:dO,plainCombosToTrees:By,reconstructTree:Fy,shouldRefreshEdge:hj,traverseTree:ai,traverseTreeUp:Pa,truncateLabelByLength:hO},Symbol.toStringTag,{value:"Module"}));var o2=function(t){if(!t)return console.error("G6 Error Tips: the data must be defined"),!1;var e=t.nodes,n=t.edges,i=t.combos,a=i===void 0?[]:i;if(!e&&!n){var o=!0;return ai(t,function(d){return Fe(d.id)?!0:(o=!1,!1)}),o}var s=(e||[]).find(function(d){return!Fe(d.id)});if(s)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(s.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var u=(e||[]).map(function(d){return d.id}),l=a==null?void 0:a.map(function(d){return d.id}),f=Bi(Bi([],u,!0),l,!0),c=(n||[]).find(function(d){return!f.includes(d.source)||!f.includes(d.target)});return c?(console.warn("G6 Warning Tips: The source %c".concat(c.source,"%c or the target %c").concat(c.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},pj=function(t,e){if(t==="node"||t==="combo"){if(e.id&&!Fe(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(e.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(t==="edge"&&(!e.source||!e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0},gj=function(){function r(t){this.graph=t,this.destroyed=!1,this.modes=t.get("modes")||{default:[]},this.formatModes(),this.mode=t.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return r.prototype.formatModes=function(){var t=this.modes;xe(t,function(e){xe(e,function(n,i){Fe(n)&&(e[i]={type:n})})})},r.prototype.setBehaviors=function(t){var e=this.graph,n=this.modes[t],i=[],a;xe(n||[],function(o){var s=E1.getBehavior(o.type||o);s&&(a=new s(o),a&&(a.bind(e),i.push(a)))}),this.currentBehaves=i},r.mergeBehaviors=function(t,e){return xe(e,function(n){t.indexOf(n)<0&&(Fe(n)&&(n={type:n}),t.push(n))}),t},r.filterBehaviors=function(t,e){var n=[];return t.forEach(function(i){var a="";Fe(i)?a=i:a=i.type,e.indexOf(a)<0&&n.push(i)}),n},r.prototype.setMode=function(t){var e=this,n=e.modes,i=e.graph,a=t,o=n[a];o&&(i.emit("beforemodechange",{mode:t}),xe(this.currentBehaves,function(s){s.delegate&&s.delegate.remove(),s.unbind(i)}),this.setBehaviors(a),i.emit("aftermodechange",{mode:t}),this.mode=t)},r.prototype.getMode=function(){return this.mode},r.prototype.manipulateBehaviors=function(t,e,n){var i=this,a;if(wt(t)?a=t:a=[t],wt(e))return xe(e,function(s){i.modes[s]?n?i.modes[s]=r.mergeBehaviors(i.modes[s]||[],a):i.modes[s]=r.filterBehaviors(i.modes[s]||[],a):n&&(i.modes[s]=a)}),this;var o=e;return e||(o=this.mode),this.modes[o]||n&&(this.modes[o]=a),n?this.modes[o]=r.mergeBehaviors(this.modes[o]||[],a):this.modes[o]=r.filterBehaviors(this.modes[o]||[],a),this.formatModes(),this.setMode(this.mode),this},r.prototype.updateBehavior=function(t,e,n){Fe(t)&&(t={type:t});var i=[];if(!n||n===this.mode||n==="default"){if(i=this.currentBehaves,!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=i.length,o=0;o<a;o++){var s=i[o];if(s.type===t.type)return s.updateCfg(e),this;o===a-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(i=this.modes[n],!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var u=i.length,o=0;o<u;o++){var s=i[o];if(s.type===t.type||s===t.type)return s===t.type&&(s={type:s}),Object.assign(s,e),i[o]=s,this;o===u-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},r.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},r}(),Kf=`
|
|
269
|
-
\v\f\r \u2028\u2029`,yj=new RegExp("([a-z])["+Kf+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Kf+"]*,?["+Kf+"]*)+)","ig"),mj=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Kf+"]*,?["+Kf+"]*","ig"),yl=function(r){if(!r)return null;if(wt(r))return r;var t={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},e=[];return String(r).replace(yj,function(n,i,a){var o=[],s=i.toLowerCase();if(a.replace(mj,function(u,l){l&&o.push(+l)}),s==="m"&&o.length>2&&(e.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&e.push([i,o[0]]),s==="r")e.push([i].concat(o));else for(;o.length>=t[s]&&(e.push([i].concat(o.splice(0,t[s]))),!!t[s]););return r}),e},zy=function(r,t){for(var e=[],n=0,i=r.length;i-2*!t>n;n+=2){var a=[{x:+r[n-2],y:+r[n-1]},{x:+r[n],y:+r[n+1]},{x:+r[n+2],y:+r[n+3]},{x:+r[n+4],y:+r[n+5]}];t?n?i-4===n?a[3]={x:+r[0],y:+r[1]}:i-2===n&&(a[2]={x:+r[0],y:+r[1]},a[3]={x:+r[2],y:+r[3]}):a[0]={x:+r[i-2],y:+r[i-1]}:i-4===n?a[3]=a[2]:n||(a[0]={x:+r[n],y:+r[n+1]}),e.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return e},Kd=function(r,t,e,n,i){var a=[];if(i===null&&n===null&&(n=e),r=+r,t=+t,e=+e,n=+n,i!==null){var o=Math.PI/180,s=r+e*Math.cos(-n*o),u=r+e*Math.cos(-i*o),l=t+e*Math.sin(-n*o),f=t+e*Math.sin(-i*o);a=[["M",s,l],["A",e,e,0,+(i-n>180),0,u,f]]}else a=[["M",r,t],["m",0,-n],["a",e,n,0,1,1,0,2*n],["a",e,n,0,1,1,0,-2*n],["z"]];return a},Gy=function(r){if(r=yl(r),!r||!r.length)return[["M",0,0]];var t=[],e=0,n=0,i=0,a=0,o=0,s,u;r[0][0]==="M"&&(e=+r[0][1],n=+r[0][2],i=e,a=n,o++,t[0]=["M",e,n]);for(var l=r.length===3&&r[0][0]==="M"&&r[1][0].toUpperCase()==="R"&&r[2][0].toUpperCase()==="Z",f=void 0,c=void 0,d=o,h=r.length;d<h;d++){if(t.push(f=[]),c=r[d],s=c[0],s!==s.toUpperCase())switch(f[0]=s.toUpperCase(),f[0]){case"A":f[1]=c[1],f[2]=c[2],f[3]=c[3],f[4]=c[4],f[5]=c[5],f[6]=+c[6]+e,f[7]=+c[7]+n;break;case"V":f[1]=+c[1]+n;break;case"H":f[1]=+c[1]+e;break;case"R":u=[e,n].concat(c.slice(1));for(var v=2,p=u.length;v<p;v++)u[v]=+u[v]+e,u[++v]=+u[v]+n;t.pop(),t=t.concat(zy(u,l));break;case"O":t.pop(),u=Kd(e,n,c[1],c[2]),u.push(u[0]),t=t.concat(u);break;case"U":t.pop(),t=t.concat(Kd(e,n,c[1],c[2],c[3])),f=["U"].concat(t[t.length-1].slice(-2));break;case"M":i=+c[1]+e,a=+c[2]+n;break;default:for(var v=1,p=c.length;v<p;v++)f[v]=+c[v]+(v%2?e:n)}else if(s==="R")u=[e,n].concat(c.slice(1)),t.pop(),t=t.concat(zy(u,l)),f=["R"].concat(c.slice(-2));else if(s==="O")t.pop(),u=Kd(e,n,c[1],c[2]),u.push(u[0]),t=t.concat(u);else if(s==="U")t.pop(),t=t.concat(Kd(e,n,c[1],c[2],c[3])),f=["U"].concat(t[t.length-1].slice(-2));else for(var g=0,y=c.length;g<y;g++)f[g]=c[g];if(s=s.toUpperCase(),s!=="O")switch(f[0]){case"Z":e=+i,n=+a;break;case"H":e=f[1];break;case"V":n=f[1];break;case"M":i=f[f.length-2],a=f[f.length-1];break;default:e=f[f.length-2],n=f[f.length-1]}}return t},qd=function(r,t,e,n){return[r,t,e,n,e,n]},s2=function(r,t,e,n,i,a){var o=.3333333333333333,s=2/3;return[o*r+s*e,o*t+s*n,o*i+s*e,o*a+s*n,i,a]},vO=function(r,t,e,n,i,a,o,s,u,l){e===n&&(e+=1);var f=Math.PI*120/180,c=Math.PI/180*(+i||0),d=[],h,v,p,g,y,m=function(Ae,Ke,ot){var nt=Ae*Math.cos(ot)-Ke*Math.sin(ot),Ct=Ae*Math.sin(ot)+Ke*Math.cos(ot);return{x:nt,y:Ct}};if(l)v=l[0],p=l[1],g=l[2],y=l[3];else{h=m(r,t,-c),r=h.x,t=h.y,h=m(s,u,-c),s=h.x,u=h.y,r===s&&t===u&&(s+=1,u+=1);var b=(r-s)/2,x=(t-u)/2,w=b*b/(e*e)+x*x/(n*n);w>1&&(w=Math.sqrt(w),e=w*e,n=w*n);var E=e*e,_=n*n,M=(a===o?-1:1)*Math.sqrt(Math.abs((E*_-E*x*x-_*b*b)/(E*x*x+_*b*b)));g=M*e*x/n+(r+s)/2,y=M*-n*b/e+(t+u)/2,v=Math.asin(((t-y)/n).toFixed(9)),p=Math.asin(((u-y)/n).toFixed(9)),v=r<g?Math.PI-v:v,p=s<g?Math.PI-p:p,v<0&&(v=Math.PI*2+v),p<0&&(p=Math.PI*2+p),o&&v>p&&(v=v-Math.PI*2),!o&&p>v&&(p=p-Math.PI*2)}var C=p-v;if(Math.abs(C)>f){var S=p,A=s,T=u;p=v+f*(o&&p>v?1:-1),s=g+e*Math.cos(p),u=y+n*Math.sin(p),d=vO(s,u,e,n,i,0,o,A,T,[p,S,g,y])}C=p-v;var I=Math.cos(v),k=Math.sin(v),P=Math.cos(p),N=Math.sin(p),z=Math.tan(C/4),W=4/3*e*z,D=4/3*n*z,R=[r,t],H=[r+W*k,t-D*I],ee=[s+W*N,u-D*P],Y=[s,u];if(H[0]=2*R[0]-H[0],H[1]=2*R[1]-H[1],l)return[H,ee,Y].concat(d);d=[H,ee,Y].concat(d).join().split(",");for(var X=[],fe=0,we=d.length;fe<we;fe++)X[fe]=fe%2?m(d[fe-1],d[fe],c).y:m(d[fe],d[fe+1],c).x;return X},$y=function(r,t){var e=Gy(r),n=t&&Gy(t),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=[],s=[],u="",l="",f,c=function(b,x,w){var E,_;if(!b)return["C",x.x,x.y,x.x,x.y,x.x,x.y];switch(!(b[0]in{T:1,Q:1})&&(x.qx=x.qy=null),b[0]){case"M":x.X=b[1],x.Y=b[2];break;case"A":b=["C"].concat(vO.apply(0,[x.x,x.y].concat(b.slice(1))));break;case"S":w==="C"||w==="S"?(E=x.x*2-x.bx,_=x.y*2-x.by):(E=x.x,_=x.y),b=["C",E,_].concat(b.slice(1));break;case"T":w==="Q"||w==="T"?(x.qx=x.x*2-x.qx,x.qy=x.y*2-x.qy):(x.qx=x.x,x.qy=x.y),b=["C"].concat(s2(x.x,x.y,x.qx,x.qy,b[1],b[2]));break;case"Q":x.qx=b[1],x.qy=b[2],b=["C"].concat(s2(x.x,x.y,b[1],b[2],b[3],b[4]));break;case"L":b=["C"].concat(qd(x.x,x.y,b[1],b[2]));break;case"H":b=["C"].concat(qd(x.x,x.y,b[1],x.y));break;case"V":b=["C"].concat(qd(x.x,x.y,x.x,b[1]));break;case"Z":b=["C"].concat(qd(x.x,x.y,x.X,x.Y));break}return b},d=function(b,x){if(b[x].length>7){b[x].shift();for(var w=b[x];w.length;)o[x]="A",n&&(s[x]="A"),b.splice(x++,0,["C"].concat(w.splice(0,6)));b.splice(x,1),f=Math.max(e.length,n&&n.length||0)}},h=function(b,x,w,E,_){b&&x&&b[_][0]==="M"&&x[_][0]!=="M"&&(x.splice(_,0,["M",E.x,E.y]),w.bx=0,w.by=0,w.x=b[_][1],w.y=b[_][2],f=Math.max(e.length,n&&n.length||0))};f=Math.max(e.length,n&&n.length||0);for(var v=0;v<f;v++){e[v]&&(u=e[v][0]),u!=="C"&&(o[v]=u,v&&(l=o[v-1])),e[v]=c(e[v],i,l),o[v]!=="A"&&u==="C"&&(o[v]="C"),d(e,v),n&&(n[v]&&(u=n[v][0]),u!=="C"&&(s[v]=u,v&&(l=s[v-1])),n[v]=c(n[v],a,l),s[v]!=="A"&&u==="C"&&(s[v]="C"),d(n,v)),h(e,n,i,a,v),h(n,e,a,i,v);var p=e[v],g=n&&n[v],y=p.length,m=n&&g.length;i.x=p[y-2],i.y=p[y-1],i.bx=parseFloat(p[y-4])||i.x,i.by=parseFloat(p[y-3])||i.y,a.bx=n&&(parseFloat(g[m-4])||a.x),a.by=n&&(parseFloat(g[m-3])||a.y),a.x=n&&g[m-2],a.y=n&&g[m-1]}return n?[e,n]:e},bj=/,?([a-z]),?/gi,pO=function(r){return r.join(",").replace(bj,"$1")},u2=function(r,t,e,n,i){var a=-3*t+9*e-9*n+3*i,o=r*a+6*t-12*e+6*n;return r*o-3*t+3*e},l2=function(r,t,e,n,i,a,o,s,u){u===null&&(u=1),u=u>1?1:u<0?0:u;for(var l=u/2,f=12,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,v=0;v<f;v++){var p=l*c[v]+l,g=u2(p,r,e,i,o),y=u2(p,t,n,a,s),m=g*g+y*y;h+=d[v]*Math.sqrt(m)}return l*h},xj=function(r,t,e,n,i,a,o,s){for(var u=[],l=[[],[]],f,c,d,h,v=0;v<2;++v){if(v===0?(c=6*r-12*e+6*i,f=-3*r+9*e-9*i+3*o,d=3*e-3*r):(c=6*t-12*n+6*a,f=-3*t+9*n-9*a+3*s,d=3*n-3*t),Math.abs(f)<1e-12){if(Math.abs(c)<1e-12)continue;h=-d/c,h>0&&h<1&&u.push(h);continue}var p=c*c-4*d*f,g=Math.sqrt(p);if(!(p<0)){var y=(-c+g)/(2*f);y>0&&y<1&&u.push(y);var m=(-c-g)/(2*f);m>0&&m<1&&u.push(m)}}for(var b=u.length,x=b,w;b--;)h=u[b],w=1-h,l[0][b]=w*w*w*r+3*w*w*h*e+3*w*h*h*i+h*h*h*o,l[1][b]=w*w*w*t+3*w*w*h*n+3*w*h*h*a+h*h*h*s;return l[0][x]=r,l[1][x]=t,l[0][x+1]=o,l[1][x+1]=s,l[0].length=l[1].length=x+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}},wj=function(r,t,e,n,i,a,o,s){if(!(Math.max(r,e)<Math.min(i,o)||Math.min(r,e)>Math.max(i,o)||Math.max(t,n)<Math.min(a,s)||Math.min(t,n)>Math.max(a,s))){var u=(r*n-t*e)*(i-o)-(r-e)*(i*s-a*o),l=(r*n-t*e)*(a-s)-(t-n)*(i*s-a*o),f=(r-e)*(a-s)-(t-n)*(i-o);if(f){var c=u/f,d=l/f,h=+c.toFixed(2),v=+d.toFixed(2);if(!(h<+Math.min(r,e).toFixed(2)||h>+Math.max(r,e).toFixed(2)||h<+Math.min(i,o).toFixed(2)||h>+Math.max(i,o).toFixed(2)||v<+Math.min(t,n).toFixed(2)||v>+Math.max(t,n).toFixed(2)||v<+Math.min(a,s).toFixed(2)||v>+Math.max(a,s).toFixed(2)))return{x:c,y:d}}}},Zo=function(r,t,e){return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},gO=function(r,t,e,n,i){if(i)return[["M",+r+ +i,t],["l",e-i*2,0],["a",i,i,0,0,1,i,i],["l",0,n-i*2],["a",i,i,0,0,1,-i,i],["l",i*2-e,0],["a",i,i,0,0,1,-i,-i],["l",0,i*2-n],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",r,t],["l",e,0],["l",0,n],["l",-e,0],["z"]];return a.parsePathArray=pO,a},Uy=function(r,t,e,n){return r===null&&(r=t=e=n=0),t===null&&(t=r.y,e=r.width,n=r.height,r=r.x),{x:r,y:t,width:e,w:e,height:n,h:n,x2:r+e,y2:t+n,cx:r+e/2,cy:t+n/2,r1:Math.min(e,n)/2,r2:Math.max(e,n)/2,r0:Math.sqrt(e*e+n*n)/2,path:gO(r,t,e,n),vb:[r,t,e,n].join(" ")}},Ej=function(r,t){return r=Uy(r),t=Uy(t),Zo(t,r.x,r.y)||Zo(t,r.x2,r.y)||Zo(t,r.x,r.y2)||Zo(t,r.x2,r.y2)||Zo(r,t.x,t.y)||Zo(r,t.x2,t.y)||Zo(r,t.x,t.y2)||Zo(r,t.x2,t.y2)||(r.x<t.x2&&r.x>t.x||t.x<r.x2&&t.x>r.x)&&(r.y<t.y2&&r.y>t.y||t.y<r.y2&&t.y>r.y)},f2=function(r,t,e,n,i,a,o,s){wt(r)||(r=[r,t,e,n,i,a,o,s]);var u=xj.apply(null,r);return Uy(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},c2=function(r,t,e,n,i,a,o,s,u){var l=1-u,f=Math.pow(l,3),c=Math.pow(l,2),d=u*u,h=d*u,v=f*r+c*3*u*e+l*3*u*u*i+h*o,p=f*t+c*3*u*n+l*3*u*u*a+h*s,g=r+2*u*(e-r)+d*(i-2*e+r),y=t+2*u*(n-t)+d*(a-2*n+t),m=e+2*u*(i-e)+d*(o-2*i+e),b=n+2*u*(a-n)+d*(s-2*a+n),x=l*r+u*e,w=l*t+u*n,E=l*i+u*o,_=l*a+u*s,M=90-Math.atan2(g-m,y-b)*180/Math.PI;return{x:v,y:p,m:{x:g,y},n:{x:m,y:b},start:{x,y:w},end:{x:E,y:_},alpha:M}},_j=function(r,t,e){var n=f2(r),i=f2(t);if(!Ej(n,i))return e?0:[];for(var a=l2.apply(0,r),o=l2.apply(0,t),s=~~(a/8),u=~~(o/8),l=[],f=[],c={},d=e?0:[],h=0;h<s+1;h++){var v=c2.apply(0,r.concat(h/s));l.push({x:v.x,y:v.y,t:h/s})}for(var h=0;h<u+1;h++){var v=c2.apply(0,t.concat(h/u));f.push({x:v.x,y:v.y,t:h/u})}for(var h=0;h<s;h++)for(var p=0;p<u;p++){var g=l[h],y=l[h+1],m=f[p],b=f[p+1],x=Math.abs(y.x-g.x)<.001?"y":"x",w=Math.abs(b.x-m.x)<.001?"y":"x",E=wj(g.x,g.y,y.x,y.y,m.x,m.y,b.x,b.y);if(E){if(c[E.x.toFixed(4)]===E.y.toFixed(4))continue;c[E.x.toFixed(4)]=E.y.toFixed(4);var _=g.t+Math.abs((E[x]-g[x])/(y[x]-g[x]))*(y.t-g.t),M=m.t+Math.abs((E[w]-m[w])/(b[w]-m[w]))*(b.t-m.t);_>=0&&_<=1&&M>=0&&M<=1&&(e?d+=1:d.push({x:E.x,y:E.y,t1:_,t2:M}))}}return d},Sj=function(r,t,e){r=$y(r),t=$y(t);for(var n,i,a,o,s,u,l,f,c,d,h=e?0:[],v=0,p=r.length;v<p;v++){var g=r[v];if(g[0]==="M")n=s=g[1],i=u=g[2];else{g[0]==="C"?(c=[n,i].concat(g.slice(1)),n=c[6],i=c[7]):(c=[n,i,n,i,s,u,s,u],n=s,i=u);for(var y=0,m=t.length;y<m;y++){var b=t[y];if(b[0]==="M")a=l=b[1],o=f=b[2];else{b[0]==="C"?(d=[a,o].concat(b.slice(1)),a=d[6],o=d[7]):(d=[a,o,a,o,l,f,l,f],a=l,o=f);var x=_j(c,d,e);if(e)h+=x;else{for(var w=0,E=x.length;w<E;w++)x[w].segment1=v,x[w].segment2=y,x[w].bez1=c,x[w].bez2=d;h=h.concat(x)}}}}}return h},Mj=function(r,t){return Sj(r,t)};function Cj(r,t){var e=[],n=[];function i(a,o){if(a.length===1)e.push(a[0]),n.push(a[0]);else{for(var s=[],u=0;u<a.length-1;u++)u===0&&e.push(a[0]),u===a.length-2&&n.push(a[u+1]),s[u]=[(1-o)*a[u][0]+o*a[u+1][0],(1-o)*a[u][1]+o*a[u+1][1]];i(s,o)}}return r.length&&i(r,t),{left:e,right:n.reverse()}}function Aj(r,t,e){var n=[[r[1],r[2]]];e=e||2;var i=[];t[0]==="A"?(n.push(t[6]),n.push(t[7])):t[0]==="C"?(n.push([t[1],t[2]]),n.push([t[3],t[4]]),n.push([t[5],t[6]])):t[0]==="S"||t[0]==="Q"?(n.push([t[1],t[2]]),n.push([t[3],t[4]])):n.push([t[1],t[2]]);for(var a=n,o=1/e,s=0;s<e-1;s++){var u=o/(1-o*s),l=Cj(a,u);i.push(l.left),a=l.right}i.push(a);var f=i.map(function(c){var d=[];return c.length===4&&(d.push("C"),d=d.concat(c[2])),c.length>=3&&(c.length===3&&d.push("Q"),d=d.concat(c[1])),c.length===2&&d.push("L"),d=d.concat(c[c.length-1]),d});return f}var Tj=function(r,t,e){if(e===1)return[[].concat(r)];var n=[];if(t[0]==="L"||t[0]==="C"||t[0]==="Q")n=n.concat(Aj(r,t,e));else{var i=[].concat(r);i[0]==="M"&&(i[0]="L");for(var a=0;a<=e-1;a++)n.push(i)}return n},Ij=function(r,t){if(r.length===1)return r;var e=r.length-1,n=t.length-1,i=e/n,a=[];if(r.length===1&&r[0][0]==="M"){for(var o=0;o<n-e;o++)r.push(r[0]);return r}for(var o=0;o<n;o++){var s=Math.floor(i*o);a[s]=(a[s]||0)+1}var u=a.reduce(function(l,f,c){return c===e?l.concat(r[e]):l.concat(Tj(r[c],r[c+1],f))},[]);return u.unshift(r[0]),(t[n]==="Z"||t[n]==="z")&&u.push("Z"),u},Oj=function(r,t){if(r.length!==t.length)return!1;var e=!0;return xe(r,function(n,i){if(n!==t[i])return e=!1,!1}),e};function Lj(r,t,e){var n=null,i=e;return t<i&&(i=t,n="add"),r<i&&(i=r,n="del"),{type:n,min:i}}var kj=function(r,t){var e=r.length,n=t.length,i,a,o=0;if(e===0||n===0)return null;for(var s=[],u=0;u<=e;u++)s[u]=[],s[u][0]={min:u};for(var l=0;l<=n;l++)s[0][l]={min:l};for(var u=1;u<=e;u++){i=r[u-1];for(var l=1;l<=n;l++){a=t[l-1],Oj(i,a)?o=0:o=1;var f=s[u-1][l].min+1,c=s[u][l-1].min+1,d=s[u-1][l-1].min+o;s[u][l]=Lj(f,c,d)}}return s},yO=function(r,t){var e=kj(r,t),n=r.length,i=t.length,a=[],o=1,s=1;if(e[n][i].min!==n){for(var u=1;u<=n;u++){var l=e[u][u].min;s=u;for(var f=o;f<=i;f++)e[u][f].min<l&&(l=e[u][f].min,s=f);o=s,e[u][o].type&&a.push({index:u-1,type:e[u][o].type})}for(var u=a.length-1;u>=0;u--)o=a[u].index,a[u].type==="add"?r.splice(o,0,[].concat(r[o])):r.splice(o,1)}n=r.length;var c=i-n;if(n<i)for(var u=0;u<c;u++)r[n-1][0]==="z"||r[n-1][0]==="Z"?r.splice(n-2,0,r[n-2]):r.push(r[n-1]),n+=1;return r};function v0(r,t,e){for(var n=[].concat(r),i,a=1/(e+1),o=mO(t)[0],s=1;s<=e;s++)a*=s,i=Math.floor(r.length*a),i===0?n.unshift([o[0]*a+r[i][0]*(1-a),o[1]*a+r[i][1]*(1-a)]):n.splice(i,0,[o[0]*a+r[i][0]*(1-a),o[1]*a+r[i][1]*(1-a)]);return n}function mO(r){var t=[];switch(r[0]){case"M":t.push([r[1],r[2]]);break;case"L":t.push([r[1],r[2]]);break;case"A":t.push([r[6],r[7]]);break;case"Q":t.push([r[3],r[4]]),t.push([r[1],r[2]]);break;case"T":t.push([r[1],r[2]]);break;case"C":t.push([r[5],r[6]]),t.push([r[1],r[2]]),t.push([r[3],r[4]]);break;case"S":t.push([r[3],r[4]]),t.push([r[1],r[2]]);break;case"H":t.push([r[1],r[1]]);break;case"V":t.push([r[1],r[1]]);break}return t}var jy=function(r,t){if(r.length<=1)return r;for(var e,n=0;n<t.length;n++)if(r[n][0]!==t[n][0])switch(e=mO(r[n]),t[n][0]){case"M":r[n]=["M"].concat(e[0]);break;case"L":r[n]=["L"].concat(e[0]);break;case"A":r[n]=[].concat(t[n]),r[n][6]=e[0][0],r[n][7]=e[0][1];break;case"Q":if(e.length<2)if(n>0)e=v0(e,r[n-1],1);else{r[n]=t[n];break}r[n]=["Q"].concat(e.reduce(function(i,a){return i.concat(a)},[]));break;case"T":r[n]=["T"].concat(e[0]);break;case"C":if(e.length<3)if(n>0)e=v0(e,r[n-1],2);else{r[n]=t[n];break}r[n]=["C"].concat(e.reduce(function(i,a){return i.concat(a)},[]));break;case"S":if(e.length<2)if(n>0)e=v0(e,r[n-1],1);else{r[n]=t[n];break}r[n]=["S"].concat(e.reduce(function(i,a){return i.concat(a)},[]));break;default:r[n]=t[n]}return r};const Dj=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:zy,fillPath:Ij,fillPathByDiff:yO,formatPath:jy,intersection:Mj,parsePathArray:pO,parsePathString:yl,pathToAbsolute:Gy,pathToCurve:$y,rectPath:gO},Symbol.toStringTag,{value:"Module"}));var bO=function(){function r(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return r.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},r.prototype.stopPropagation=function(){this.propagationStopped=!0},r.prototype.toString=function(){var t=this.type;return"[Event (type="+t+")]"},r.prototype.save=function(){},r.prototype.restore=function(){},r}();function xO(r,t){var e=r.indexOf(t);e!==-1&&r.splice(e,1)}var d2=typeof window<"u"&&typeof window.document<"u";function wO(r,t){if(r.isCanvas())return!0;for(var e=t.getParent(),n=!1;e;){if(e===r){n=!0;break}e=e.getParent()}return n}function Wy(r){return r.cfg.visible&&r.cfg.capture}var Nj=function(r){zt(t,r);function t(e){var n=r.call(this)||this;n.destroyed=!1;var i=n.getDefaultCfg();return n.cfg=Mt(i,e),n}return t.prototype.getDefaultCfg=function(){return{}},t.prototype.get=function(e){return this.cfg[e]},t.prototype.set=function(e,n){this.cfg[e]=n},t.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},t}(gT),h2=function(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return r.concat(a||Array.prototype.slice.call(t))},Pj=function(){function r(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"}return r}(),Rj=function(){function r(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return r}(),Bj=function(){function r(t,e,n,i){this.name=t,this.version=e,this.os=n,this.bot=i,this.type="bot-device"}return r}(),Fj=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),zj=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Gj=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,$j=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,v2=3,Uj=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Gj]],p2=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function EO(r){return r?g2(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new zj:typeof navigator<"u"?g2(navigator.userAgent):Xj()}function jj(r){return r!==""&&Uj.reduce(function(t,e){var n=e[0],i=e[1];if(t)return t;var a=i.exec(r);return!!a&&[n,a]},!1)}function g2(r){var t=jj(r);if(!t)return null;var e=t[0],n=t[1];if(e==="searchbot")return new Fj;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<v2&&(i=h2(h2([],i,!0),Yj(v2-i.length),!0)):i=[];var a=i.join("."),o=Wj(r),s=$j.exec(r);return s&&s[1]?new Bj(e,a,o,s[1]):new Pj(e,a,o)}function Wj(r){for(var t=0,e=p2.length;t<e;t++){var n=p2[t],i=n[0],a=n[1],o=a.exec(r);if(o)return i}return null}function Xj(){var r=typeof process<"u"&&process.version;return r?new Rj(process.version.slice(1)):null}function Yj(r){for(var t=[],e=0;e<r;e++)t.push("0");return t}function y2(r,t){var e=[],n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],c=r[8],d=t[0],h=t[1],v=t[2],p=t[3],g=t[4],y=t[5],m=t[6],b=t[7],x=t[8];return e[0]=d*n+h*o+v*l,e[1]=d*i+h*s+v*f,e[2]=d*a+h*u+v*c,e[3]=p*n+g*o+y*l,e[4]=p*i+g*s+y*f,e[5]=p*a+g*u+y*c,e[6]=m*n+b*o+x*l,e[7]=m*i+b*s+x*f,e[8]=m*a+b*u+x*c,e}function ru(r,t){var e=[],n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function _O(r){var t=[],e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],c=f*o-s*l,d=-f*a+s*u,h=l*a-o*u,v=e*c+n*d+i*h;return v?(v=1/v,t[0]=c*v,t[1]=(-f*n+i*l)*v,t[2]=(s*n-i*o)*v,t[3]=d*v,t[4]=(f*e-i*u)*v,t[5]=(-s*e+i*a)*v,t[6]=h*v,t[7]=(-l*e+n*u)*v,t[8]=(o*e-n*a)*v,t):null}var yf=ra,p0="matrix",Vj=["zIndex","capture","visible","type"],Hj=["repeat"],Kj=":",qj="*";function Zj(r){for(var t=[],e=0;e<r.length;e++)wt(r[e])?t.push([].concat(r[e])):t.push(r[e]);return t}function Qj(r,t){var e={},n=t.attrs;for(var i in r)e[i]=n[i];return e}function Jj(r,t){var e={},n=t.attr();return xe(r,function(i,a){Hj.indexOf(a)===-1&&!ms(n[a],i)&&(e[a]=i)}),e}function e7(r,t){if(t.onFrame)return r;var e=t.startTime,n=t.delay,i=t.duration,a=Object.prototype.hasOwnProperty;return xe(r,function(o){e+n<o.startTime+o.delay+o.duration&&i>o.delay&&xe(t.toAttrs,function(s,u){a.call(o.toAttrs,u)&&(delete o.toAttrs[u],delete o.fromAttrs[u])})}),r}var SO=function(r){zt(t,r);function t(e){var n=r.call(this,e)||this;n.attrs={};var i=n.getDefaultAttrs();return Mt(i,e.attrs),n.attrs=i,n.initAttrs(i),n.initAnimate(),n}return t.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},t.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},t.prototype.onCanvasChange=function(e){},t.prototype.initAttrs=function(e){},t.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},t.prototype.isGroup=function(){return!1},t.prototype.getParent=function(){return this.get("parent")},t.prototype.getCanvas=function(){return this.get("canvas")},t.prototype.attr=function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=n[0],o=n[1];if(!a)return this.attrs;if(Wn(a)){for(var s in a)this.setAttr(s,a[s]);return this.afterAttrsChange(a),this}return n.length===2?(this.setAttr(a,o),this.afterAttrsChange((e={},e[a]=o,e)),this):this.attrs[a]},t.prototype.isClipped=function(e,n){var i=this.getClip();return i&&!i.isHit(e,n)},t.prototype.setAttr=function(e,n){var i=this.attrs[e];i!==n&&(this.attrs[e]=n,this.onAttrChange(e,n,i))},t.prototype.onAttrChange=function(e,n,i){e==="matrix"&&this.set("totalMatrix",null)},t.prototype.afterAttrsChange=function(e){if(this.cfg.isClipShape){var n=this.cfg.applyTo;n&&n.onCanvasChange("clip")}else this.onCanvasChange("attr")},t.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},t.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},t.prototype.setZIndex=function(e){this.set("zIndex",e);var n=this.getParent();return n&&n.sort(),this},t.prototype.toFront=function(){var e=this.getParent();if(e){var n=e.getChildren();this.get("el");var i=n.indexOf(this);n.splice(i,1),n.push(this),this.onCanvasChange("zIndex")}},t.prototype.toBack=function(){var e=this.getParent();if(e){var n=e.getChildren();this.get("el");var i=n.indexOf(this);n.splice(i,1),n.unshift(this),this.onCanvasChange("zIndex")}},t.prototype.remove=function(e){e===void 0&&(e=!0);var n=this.getParent();n?(xO(n.getChildren(),this),n.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),e&&this.destroy()},t.prototype.resetMatrix=function(){this.attr(p0,this.getDefaultMatrix()),this.onCanvasChange("matrix")},t.prototype.getMatrix=function(){return this.attr(p0)},t.prototype.setMatrix=function(e){this.attr(p0,e),this.onCanvasChange("matrix")},t.prototype.getTotalMatrix=function(){var e=this.cfg.totalMatrix;if(!e){var n=this.attr("matrix"),i=this.cfg.parentMatrix;i&&n?e=y2(i,n):e=n||i,this.set("totalMatrix",e)}return e},t.prototype.applyMatrix=function(e){var n=this.attr("matrix"),i=null;e&&n?i=y2(e,n):i=n||e,this.set("totalMatrix",i),this.set("parentMatrix",e)},t.prototype.getDefaultMatrix=function(){return null},t.prototype.applyToMatrix=function(e){var n=this.attr("matrix");return n?ru(n,e):e},t.prototype.invertFromMatrix=function(e){var n=this.attr("matrix");if(n){var i=_O(n);if(i)return ru(i,e)}return e},t.prototype.setClip=function(e){var n=this.getCanvas(),i=null;if(e){var a=this.getShapeBase(),o=Tl(e.type),s=a[o];s&&(i=new s({type:e.type,isClipShape:!0,applyTo:this,attrs:e.attrs,canvas:n}))}return this.set("clipShape",i),this.onCanvasChange("clip"),i},t.prototype.getClip=function(){var e=this.cfg.clipShape;return e||null},t.prototype.clone=function(){var e=this,n=this.attrs,i={};xe(n,function(s,u){wt(n[u])?i[u]=Zj(n[u]):i[u]=n[u]});var a=this.constructor,o=new a({attrs:i});return xe(Vj,function(s){o.set(s,e.get(s))}),o},t.prototype.destroy=function(){var e=this.destroyed;e||(this.attrs={},r.prototype.destroy.call(this))},t.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},t.prototype.animate=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!(!this.get("timeline")&&!this.get("canvas"))){this.set("animating",!0);var i=this.get("timeline");i||(i=this.get("canvas").get("timeline"),this.set("timeline",i));var a=this.get("animations")||[];i.timer||i.initTimer();var o=e[0],s=e[1],u=e[2],l=u===void 0?"easeLinear":u,f=e[3],c=f===void 0?Bf:f,d=e[4],h=d===void 0?0:d,v,p,g,y,m;Yr(o)?(v=o,o={}):Wn(o)&&o.onFrame&&(v=o.onFrame,p=o.repeat),Wn(s)?(m=s,s=m.duration,l=m.easing||"easeLinear",h=m.delay||0,p=m.repeat||p||!1,c=m.callback||Bf,g=m.pauseCallback||Bf,y=m.resumeCallback||Bf):(mt(c)&&(h=c,c=null),Yr(l)?(c=l,l="easeLinear"):l=l||"easeLinear");var b=Jj(o,this),x={fromAttrs:Qj(b,this),toAttrs:b,duration:s,easing:l,repeat:p,callback:c,pauseCallback:g,resumeCallback:y,delay:h,startTime:i.getTime(),id:eo(),onFrame:v,pathFormatted:!1};a.length>0?a=e7(a,x):i.addAnimator(this),a.push(x),this.set("animations",a),this.set("_pause",{isPaused:!1})}},t.prototype.stopAnimate=function(e){var n=this;e===void 0&&(e=!0);var i=this.get("animations");xe(i,function(a){e&&(a.onFrame?n.attr(a.onFrame(1)):n.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},t.prototype.pauseAnimate=function(){var e=this.get("timeline"),n=this.get("animations"),i=e.getTime();return xe(n,function(a){a._paused=!0,a._pauseTime=i,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:i}),this},t.prototype.resumeAnimate=function(){var e=this.get("timeline"),n=e.getTime(),i=this.get("animations"),a=this.get("_pause").pauseTime;return xe(i,function(o){o.startTime=o.startTime+(n-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",i),this},t.prototype.emitDelegation=function(e,n){var i=this,a=n.propagationPath;this.getEvents();var o;e==="mouseenter"?o=n.fromShape:e==="mouseleave"&&(o=n.toShape);for(var s=function(c){var d=a[c],h=d.get("name");if(h){if((d.isGroup()||d.isCanvas&&d.isCanvas())&&o&&wO(d,o))return"break";wt(h)?xe(h,function(v){i.emitDelegateEvent(d,v,n)}):u.emitDelegateEvent(d,h,n)}},u=this,l=0;l<a.length;l++){var f=s(l);if(f==="break")break}},t.prototype.emitDelegateEvent=function(e,n,i){var a=this.getEvents(),o=n+Kj+i.type;(a[o]||a[qj])&&(i.name=o,i.currentTarget=e,i.delegateTarget=this,i.delegateObject=e.get("delegateObject"),this.emit(o,i))},t.prototype.translate=function(e,n){e===void 0&&(e=0),n===void 0&&(n=0);var i=this.getMatrix(),a=yf(i,[["t",e,n]]);return this.setMatrix(a),this},t.prototype.move=function(e,n){var i=this.attr("x")||0,a=this.attr("y")||0;return this.translate(e-i,n-a),this},t.prototype.moveTo=function(e,n){return this.move(e,n)},t.prototype.scale=function(e,n){var i=this.getMatrix(),a=yf(i,[["s",e,n||e]]);return this.setMatrix(a),this},t.prototype.rotate=function(e){var n=this.getMatrix(),i=yf(n,[["r",e]]);return this.setMatrix(i),this},t.prototype.rotateAtStart=function(e){var n=this.attr(),i=n.x,a=n.y,o=this.getMatrix(),s=yf(o,[["t",-i,-a],["r",e],["t",i,a]]);return this.setMatrix(s),this},t.prototype.rotateAtPoint=function(e,n,i){var a=this.getMatrix(),o=yf(a,[["t",-e,-n],["r",i],["t",e,n]]);return this.setMatrix(o),this},t}(Nj),m2={},Xy="_INDEX";function MO(r,t){if(r.set("canvas",t),r.isGroup()){var e=r.get("children");e.length&&e.forEach(function(n){MO(n,t)})}}function CO(r,t){if(r.set("timeline",t),r.isGroup()){var e=r.get("children");e.length&&e.forEach(function(n){CO(n,t)})}}function t7(r,t,e){e===void 0&&(e=!0),e?t.destroy():(t.set("parent",null),t.set("canvas",null)),xO(r.getChildren(),t)}function r7(r){return function(t,e){var n=r(t,e);return n===0?t[Xy]-e[Xy]:n}}var AO=function(r){zt(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.isCanvas=function(){return!1},t.prototype.getBBox=function(){var e=1/0,n=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});o.length>0?xe(o,function(u){var l=u.getBBox(),f=l.minX,c=l.maxX,d=l.minY,h=l.maxY;f<e&&(e=f),c>n&&(n=c),d<i&&(i=d),h>a&&(a=h)}):(e=0,n=0,i=0,a=0);var s={x:e,y:i,minX:e,minY:i,maxX:n,maxY:a,width:n-e,height:a-i};return s},t.prototype.getCanvasBBox=function(){var e=1/0,n=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});o.length>0?xe(o,function(u){var l=u.getCanvasBBox(),f=l.minX,c=l.maxX,d=l.minY,h=l.maxY;f<e&&(e=f),c>n&&(n=c),d<i&&(i=d),h>a&&(a=h)}):(e=0,n=0,i=0,a=0);var s={x:e,y:i,minX:e,minY:i,maxX:n,maxY:a,width:n-e,height:a-i};return s},t.prototype.getDefaultCfg=function(){var e=r.prototype.getDefaultCfg.call(this);return e.children=[],e},t.prototype.onAttrChange=function(e,n,i){if(r.prototype.onAttrChange.call(this,e,n,i),e==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},t.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();r.prototype.applyMatrix.call(this,e);var i=this.getTotalMatrix();i!==n&&this._applyChildrenMarix(i)},t.prototype._applyChildrenMarix=function(e){var n=this.getChildren();xe(n,function(i){i.applyMatrix(e)})},t.prototype.addShape=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=e[0],a=e[1];Wn(i)?a=i:a.type=i;var o=m2[a.type];o||(o=Tl(a.type),m2[a.type]=o);var s=this.getShapeBase(),u=new s[o](a);return this.add(u),u},t.prototype.addGroup=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=e[0],a=e[1],o;if(Yr(i))a?o=new i(a):o=new i({parent:this});else{var s=i||{},u=this.getGroupBase();o=new u(s)}return this.add(o),o},t.prototype.getCanvas=function(){var e;return this.isCanvas()?e=this:e=this.get("canvas"),e},t.prototype.getShape=function(e,n,i){if(!Wy(this))return null;var a=this.getChildren(),o;if(this.isCanvas())o=this._findShape(a,e,n,i);else{var s=[e,n,1];s=this.invertFromMatrix(s),this.isClipped(s[0],s[1])||(o=this._findShape(a,s[0],s[1],i))}return o},t.prototype._findShape=function(e,n,i,a){for(var o=null,s=e.length-1;s>=0;s--){var u=e[s];if(Wy(u)&&(u.isGroup()?o=u.getShape(n,i,a):u.isHit(n,i)&&(o=u)),o)break}return o},t.prototype.add=function(e){var n=this.getCanvas(),i=this.getChildren(),a=this.get("timeline"),o=e.getParent();o&&t7(o,e,!1),e.set("parent",this),n&&MO(e,n),a&&CO(e,a),i.push(e),e.onCanvasChange("add"),this._applyElementMatrix(e)},t.prototype._applyElementMatrix=function(e){var n=this.getTotalMatrix();n&&e.applyMatrix(n)},t.prototype.getChildren=function(){return this.get("children")},t.prototype.sort=function(){var e=this.getChildren();xe(e,function(n,i){return n[Xy]=i,n}),e.sort(r7(function(n,i){return n.get("zIndex")-i.get("zIndex")})),this.onCanvasChange("sort")},t.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var e=this.getChildren(),n=e.length-1;n>=0;n--)e[n].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},t.prototype.destroy=function(){this.get("destroyed")||(this.clear(),r.prototype.destroy.call(this))},t.prototype.getFirst=function(){return this.getChildByIndex(0)},t.prototype.getLast=function(){var e=this.getChildren();return this.getChildByIndex(e.length-1)},t.prototype.getChildByIndex=function(e){var n=this.getChildren();return n[e]},t.prototype.getCount=function(){var e=this.getChildren();return e.length},t.prototype.contain=function(e){var n=this.getChildren();return n.indexOf(e)>-1},t.prototype.removeChild=function(e,n){n===void 0&&(n=!0),this.contain(e)&&e.remove(n)},t.prototype.findAll=function(e){var n=[],i=this.getChildren();return xe(i,function(a){e(a)&&n.push(a),a.isGroup()&&(n=n.concat(a.findAll(e)))}),n},t.prototype.find=function(e){var n=null,i=this.getChildren();return xe(i,function(a){if(e(a)?n=a:a.isGroup()&&(n=a.find(e)),n)return!1}),n},t.prototype.findById=function(e){return this.find(function(n){return n.get("id")===e})},t.prototype.findByClassName=function(e){return this.find(function(n){return n.get("className")===e})},t.prototype.findAllByName=function(e){return this.findAll(function(n){return n.get("name")===e})},t}(SO),Il=0,zf=0,mf=0,TO=1e3,Tv,Gf,Iv=0,vu=0,bp=0,pc=typeof performance=="object"&&performance.now?performance:Date,IO=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function OO(){return vu||(IO(n7),vu=pc.now()+bp)}function n7(){vu=0}function Yy(){this._call=this._time=this._next=null}Yy.prototype=LO.prototype={constructor:Yy,restart:function(r,t,e){if(typeof r!="function")throw new TypeError("callback is not a function");e=(e==null?OO():+e)+(t==null?0:+t),!this._next&&Gf!==this&&(Gf?Gf._next=this:Tv=this,Gf=this),this._call=r,this._time=e,Vy()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vy())}};function LO(r,t,e){var n=new Yy;return n.restart(r,t,e),n}function i7(){OO(),++Il;for(var r=Tv,t;r;)(t=vu-r._time)>=0&&r._call.call(null,t),r=r._next;--Il}function b2(){vu=(Iv=pc.now())+bp,Il=zf=0;try{i7()}finally{Il=0,o7(),vu=0}}function a7(){var r=pc.now(),t=r-Iv;t>TO&&(bp-=t,Iv=r)}function o7(){for(var r,t=Tv,e,n=1/0;t;)t._call?(n>t._time&&(n=t._time),r=t,t=t._next):(e=t._next,t._next=null,t=r?r._next=e:Tv=e);Gf=r,Vy(n)}function Vy(r){if(!Il){zf&&(zf=clearTimeout(zf));var t=r-vu;t>24?(r<1/0&&(zf=setTimeout(b2,r-pc.now()-bp)),mf&&(mf=clearInterval(mf))):(mf||(Iv=pc.now(),mf=setInterval(a7,TO)),Il=1,IO(b2))}}function q1(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function kO(r,t){var e=Object.create(r.prototype);for(var n in t)e[n]=t[n];return e}function zc(){}var gc=.7,Ov=1/gc,wl="\\s*([+-]?\\d+)\\s*",yc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",qa="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s7=/^#([0-9a-f]{3,8})$/,u7=new RegExp("^rgb\\("+[wl,wl,wl]+"\\)$"),l7=new RegExp("^rgb\\("+[qa,qa,qa]+"\\)$"),f7=new RegExp("^rgba\\("+[wl,wl,wl,yc]+"\\)$"),c7=new RegExp("^rgba\\("+[qa,qa,qa,yc]+"\\)$"),d7=new RegExp("^hsl\\("+[yc,qa,qa]+"\\)$"),h7=new RegExp("^hsla\\("+[yc,qa,qa,yc]+"\\)$"),x2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};q1(zc,mc,{copy:function(r){return Object.assign(new this.constructor,this,r)},displayable:function(){return this.rgb().displayable()},hex:w2,formatHex:w2,formatHsl:v7,formatRgb:E2,toString:E2});function w2(){return this.rgb().formatHex()}function v7(){return DO(this).formatHsl()}function E2(){return this.rgb().formatRgb()}function mc(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=s7.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?_2(t):e===3?new Pi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?Zd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?Zd(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=u7.exec(r))?new Pi(t[1],t[2],t[3],1):(t=l7.exec(r))?new Pi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=f7.exec(r))?Zd(t[1],t[2],t[3],t[4]):(t=c7.exec(r))?Zd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=d7.exec(r))?C2(t[1],t[2]/100,t[3]/100,1):(t=h7.exec(r))?C2(t[1],t[2]/100,t[3]/100,t[4]):x2.hasOwnProperty(r)?_2(x2[r]):r==="transparent"?new Pi(NaN,NaN,NaN,0):null}function _2(r){return new Pi(r>>16&255,r>>8&255,r&255,1)}function Zd(r,t,e,n){return n<=0&&(r=t=e=NaN),new Pi(r,t,e,n)}function p7(r){return r instanceof zc||(r=mc(r)),r?(r=r.rgb(),new Pi(r.r,r.g,r.b,r.opacity)):new Pi}function Hy(r,t,e,n){return arguments.length===1?p7(r):new Pi(r,t,e,n??1)}function Pi(r,t,e,n){this.r=+r,this.g=+t,this.b=+e,this.opacity=+n}q1(Pi,Hy,kO(zc,{brighter:function(r){return r=r==null?Ov:Math.pow(Ov,r),new Pi(this.r*r,this.g*r,this.b*r,this.opacity)},darker:function(r){return r=r==null?gc:Math.pow(gc,r),new Pi(this.r*r,this.g*r,this.b*r,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:S2,formatHex:S2,formatRgb:M2,toString:M2}));function S2(){return"#"+g0(this.r)+g0(this.g)+g0(this.b)}function M2(){var r=this.opacity;return r=isNaN(r)?1:Math.max(0,Math.min(1,r)),(r===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(r===1?")":", "+r+")")}function g0(r){return r=Math.max(0,Math.min(255,Math.round(r)||0)),(r<16?"0":"")+r.toString(16)}function C2(r,t,e,n){return n<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new za(r,t,e,n)}function DO(r){if(r instanceof za)return new za(r.h,r.s,r.l,r.opacity);if(r instanceof zc||(r=mc(r)),!r)return new za;if(r instanceof za)return r;r=r.rgb();var t=r.r/255,e=r.g/255,n=r.b/255,i=Math.min(t,e,n),a=Math.max(t,e,n),o=NaN,s=a-i,u=(a+i)/2;return s?(t===a?o=(e-n)/s+(e<n)*6:e===a?o=(n-t)/s+2:o=(t-e)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new za(o,s,u,r.opacity)}function g7(r,t,e,n){return arguments.length===1?DO(r):new za(r,t,e,n??1)}function za(r,t,e,n){this.h=+r,this.s=+t,this.l=+e,this.opacity=+n}q1(za,g7,kO(zc,{brighter:function(r){return r=r==null?Ov:Math.pow(Ov,r),new za(this.h,this.s,this.l*r,this.opacity)},darker:function(r){return r=r==null?gc:Math.pow(gc,r),new za(this.h,this.s,this.l*r,this.opacity)},rgb:function(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,n=e+(e<.5?e:1-e)*t,i=2*e-n;return new Pi(y0(r>=240?r-240:r+120,i,n),y0(r,i,n),y0(r<120?r+240:r-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var r=this.opacity;return r=isNaN(r)?1:Math.max(0,Math.min(1,r)),(r===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(r===1?")":", "+r+")")}}));function y0(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}const Z1=r=>()=>r;function y7(r,t){return function(e){return r+e*t}}function m7(r,t,e){return r=Math.pow(r,e),t=Math.pow(t,e)-r,e=1/e,function(n){return Math.pow(r+n*t,e)}}function b7(r){return(r=+r)==1?NO:function(t,e){return e-t?m7(t,e,r):Z1(isNaN(t)?e:t)}}function NO(r,t){var e=t-r;return e?y7(r,e):Z1(isNaN(r)?t:r)}const A2=function r(t){var e=b7(t);function n(i,a){var o=e((i=Hy(i)).r,(a=Hy(a)).r),s=e(i.g,a.g),u=e(i.b,a.b),l=NO(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=u(f),i.opacity=l(f),i+""}}return n.gamma=r,n}(1);function PO(r,t){t||(t=[]);var e=r?Math.min(t.length,r.length):0,n=t.slice(),i;return function(a){for(i=0;i<e;++i)n[i]=r[i]*(1-a)+t[i]*a;return n}}function RO(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function x7(r,t){return(RO(t)?PO:BO)(r,t)}function BO(r,t){var e=t?t.length:0,n=r?Math.min(e,r.length):0,i=new Array(n),a=new Array(e),o;for(o=0;o<n;++o)i[o]=Lv(r[o],t[o]);for(;o<e;++o)a[o]=t[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function w7(r,t){var e=new Date;return r=+r,t=+t,function(n){return e.setTime(r*(1-n)+t*n),e}}function Ky(r,t){return r=+r,t=+t,function(e){return r*(1-e)+t*e}}function E7(r,t){var e={},n={},i;(r===null||typeof r!="object")&&(r={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in r?e[i]=Lv(r[i],t[i]):n[i]=t[i];return function(a){for(i in e)n[i]=e[i](a);return n}}var qy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,m0=new RegExp(qy.source,"g");function _7(r){return function(){return r}}function S7(r){return function(t){return r(t)+""}}function M7(r,t){var e=qy.lastIndex=m0.lastIndex=0,n,i,a,o=-1,s=[],u=[];for(r=r+"",t=t+"";(n=qy.exec(r))&&(i=m0.exec(t));)(a=i.index)>e&&(a=t.slice(e,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,u.push({i:o,x:Ky(n,i)})),e=m0.lastIndex;return e<t.length&&(a=t.slice(e),s[o]?s[o]+=a:s[++o]=a),s.length<2?u[0]?S7(u[0].x):_7(t):(t=u.length,function(l){for(var f=0,c;f<t;++f)s[(c=u[f]).i]=c.x(l);return s.join("")})}function Lv(r,t){var e=typeof t,n;return t==null||e==="boolean"?Z1(t):(e==="number"?Ky:e==="string"?(n=mc(t))?(t=n,A2):M7:t instanceof mc?A2:t instanceof Date?w7:RO(t)?PO:Array.isArray(t)?BO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?E7:Ky)(r,t)}function C7(r){return+r}function A7(r){return r*r}function T7(r){return r*(2-r)}function T2(r){return((r*=2)<=1?r*r:--r*(2-r)+1)/2}function I7(r){return r*r*r}function O7(r){return--r*r*r+1}function I2(r){return((r*=2)<=1?r*r*r:(r-=2)*r*r+2)/2}var Q1=3,L7=function r(t){t=+t;function e(n){return Math.pow(n,t)}return e.exponent=r,e}(Q1),k7=function r(t){t=+t;function e(n){return 1-Math.pow(1-n,t)}return e.exponent=r,e}(Q1),O2=function r(t){t=+t;function e(n){return((n*=2)<=1?Math.pow(n,t):2-Math.pow(2-n,t))/2}return e.exponent=r,e}(Q1),FO=Math.PI,zO=FO/2;function D7(r){return+r==1?1:1-Math.cos(r*zO)}function N7(r){return Math.sin(r*zO)}function L2(r){return(1-Math.cos(FO*r))/2}function bs(r){return(Math.pow(2,-10*r)-.0009765625)*1.0009775171065494}function P7(r){return bs(1-+r)}function R7(r){return 1-bs(r)}function k2(r){return((r*=2)<=1?bs(1-r):2-bs(r-1))/2}function B7(r){return 1-Math.sqrt(1-r*r)}function F7(r){return Math.sqrt(1- --r*r)}function D2(r){return((r*=2)<=1?1-Math.sqrt(1-r*r):Math.sqrt(1-(r-=2)*r)+1)/2}var Zy=4/11,z7=6/11,G7=8/11,$7=3/4,U7=9/11,j7=10/11,W7=15/16,X7=21/22,Y7=63/64,Qd=1/Zy/Zy;function V7(r){return 1-bc(1-r)}function bc(r){return(r=+r)<Zy?Qd*r*r:r<G7?Qd*(r-=z7)*r+$7:r<j7?Qd*(r-=U7)*r+W7:Qd*(r-=X7)*r+Y7}function H7(r){return((r*=2)<=1?1-bc(1-r):bc(r-1)+1)/2}var J1=1.70158,K7=function r(t){t=+t;function e(n){return(n=+n)*n*(t*(n-1)+n)}return e.overshoot=r,e}(J1),q7=function r(t){t=+t;function e(n){return--n*n*((n+1)*t+n)+1}return e.overshoot=r,e}(J1),N2=function r(t){t=+t;function e(n){return((n*=2)<1?n*n*((t+1)*n-t):(n-=2)*n*((t+1)*n+t)+2)/2}return e.overshoot=r,e}(J1),Ol=2*Math.PI,eb=1,tb=.3,Z7=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Ol);function i(a){return t*bs(- --a)*Math.sin((n-a)/e)}return i.amplitude=function(a){return r(a,e*Ol)},i.period=function(a){return r(t,a)},i}(eb,tb),P2=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Ol);function i(a){return 1-t*bs(a=+a)*Math.sin((a+n)/e)}return i.amplitude=function(a){return r(a,e*Ol)},i.period=function(a){return r(t,a)},i}(eb,tb),Q7=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Ol);function i(a){return((a=a*2-1)<0?t*bs(-a)*Math.sin((n-a)/e):2-t*bs(a)*Math.sin((n+a)/e))/2}return i.amplitude=function(a){return r(a,e*Ol)},i.period=function(a){return r(t,a)},i}(eb,tb);const J7=Object.freeze(Object.defineProperty({__proto__:null,easeBack:N2,easeBackIn:K7,easeBackInOut:N2,easeBackOut:q7,easeBounce:bc,easeBounceIn:V7,easeBounceInOut:H7,easeBounceOut:bc,easeCircle:D2,easeCircleIn:B7,easeCircleInOut:D2,easeCircleOut:F7,easeCubic:I2,easeCubicIn:I7,easeCubicInOut:I2,easeCubicOut:O7,easeElastic:P2,easeElasticIn:Z7,easeElasticInOut:Q7,easeElasticOut:P2,easeExp:k2,easeExpIn:P7,easeExpInOut:k2,easeExpOut:R7,easeLinear:C7,easePoly:O2,easePolyIn:L7,easePolyInOut:O2,easePolyOut:k7,easeQuad:T2,easeQuadIn:A7,easeQuadInOut:T2,easeQuadOut:T7,easeSin:L2,easeSinIn:D7,easeSinInOut:L2,easeSinOut:N7},Symbol.toStringTag,{value:"Module"}));var e9={};function t9(r){return e9[r.toLowerCase()]||J7[r]}var r9=function(r){return["fill","stroke","fillStyle","strokeStyle"].includes(r)},n9=function(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)},R2=[1,0,0,0,1,0,0,0,1];function i9(r,t,e){var n={},i=t.fromAttrs,a=t.toAttrs;if(!r.destroyed){var o;for(var s in a)if(!ms(i[s],a[s]))if(s==="path"){var u=a[s],l=i[s];u.length>l.length?(u=yl(a[s]),l=yl(i[s]),l=yO(l,u),l=jy(l,u),t.fromAttrs.path=l,t.toAttrs.path=u):t.pathFormatted||(u=yl(a[s]),l=yl(i[s]),l=jy(l,u),t.fromAttrs.path=l,t.toAttrs.path=u,t.pathFormatted=!0),n[s]=[];for(var f=0;f<u.length;f++){for(var c=u[f],d=l[f],h=[],v=0;v<c.length;v++)mt(c[v])&&d&&mt(d[v])?(o=Lv(d[v],c[v]),h.push(o(e))):h.push(c[v]);n[s].push(h)}}else if(s==="matrix"){var p=x7(i[s]||R2,a[s]||R2),g=p(e);n[s]=g}else r9(s)&&n9(a[s])?n[s]=a[s]:Yr(a[s])||(o=Lv(i[s],a[s]),n[s]=o(e));r.attr(n)}}function a9(r,t,e){var n=t.startTime,i=t.delay;if(e<n+i||t._paused)return!1;var a,o=t.duration,s=t.easing,u=t9(s);if(e=e-n-t.delay,t.repeat)a=e%o/o,a=u(a);else if(a=e/o,a<1)a=u(a);else return t.onFrame?r.attr(t.onFrame(1)):r.attr(t.toAttrs),!0;if(t.onFrame){var l=t.onFrame(a);r.attr(l)}else i9(r,t,a);return!1}var o9=function(){function r(t){this.animators=[],this.current=0,this.timer=null,this.canvas=t}return r.prototype.initTimer=function(){var t=this,e=!1,n,i,a;this.timer=LO(function(o){if(t.current=o,t.animators.length>0){for(var s=t.animators.length-1;s>=0;s--){if(n=t.animators[s],n.destroyed){t.removeAnimator(s);continue}if(!n.isAnimatePaused()){i=n.get("animations");for(var u=i.length-1;u>=0;u--)a=i[u],e=a9(n,a,o),e&&(i.splice(u,1),e=!1,a.callback&&a.callback())}i.length===0&&t.removeAnimator(s)}var l=t.canvas.get("autoDraw");l||t.canvas.draw()}})},r.prototype.addAnimator=function(t){this.animators.push(t)},r.prototype.removeAnimator=function(t){this.animators.splice(t,1)},r.prototype.isAnimating=function(){return!!this.animators.length},r.prototype.stop=function(){this.timer&&this.timer.stop()},r.prototype.stopAllAnimations=function(t){t===void 0&&(t=!0),this.animators.forEach(function(e){e.stopAnimate(t)}),this.animators=[],this.canvas.draw()},r.prototype.getTime=function(){return this.current},r}(),s9=40,B2=0,F2=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function z2(r,t,e){e.name=t,e.target=r,e.currentTarget=r,e.delegateTarget=r,r.emit(t,e)}function u9(r,t,e){if(e.bubbles){var n=void 0,i=!1;if(t==="mouseenter"?(n=e.fromShape,i=!0):t==="mouseleave"&&(i=!0,n=e.toShape),r.isCanvas()&&i)return;if(n&&wO(r,n)){e.bubbles=!1;return}e.name=t,e.currentTarget=r,e.delegateTarget=r,r.emit(t,e)}}var l9=function(){function r(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(n){var i=n.type;e._triggerEvent(i,n)},this._onDocumentMove=function(n){var i=e.canvas,a=i.get("el");if(a!==n.target&&(e.dragging||e.currentShape)){var o=e._getPointInfo(n);e.dragging&&e._emitEvent("drag",n,o,e.draggingShape)}},this._onDocumentMouseUp=function(n){var i=e.canvas,a=i.get("el");if(a!==n.target&&e.dragging){var o=e._getPointInfo(n);e.draggingShape&&e._emitEvent("drop",n,o,null),e._emitEvent("dragend",n,o,e.draggingShape),e._afterDrag(e.draggingShape,o,n)}},this.canvas=t.canvas}return r.prototype.init=function(){this._bindEvents()},r.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");xe(F2,function(n){e.addEventListener(n,t._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");xe(F2,function(n){e.removeEventListener(n,t._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._getEventObj=function(t,e,n,i,a,o){var s=new bO(t,e);return s.fromShape=a,s.toShape=o,s.x=n.x,s.y=n.y,s.clientX=n.clientX,s.clientY=n.clientY,s.propagationPath.push(i),s},r.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},r.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),i=e.getPointByEvent(t);return{x:i.x,y:i.y,clientX:n.x,clientY:n.y}},r.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),i=this._getShape(n,e),a=this["_on"+t],o=!1;if(a)a.call(this,n,i,e);else{var s=this.currentShape;t==="mouseenter"||t==="dragenter"||t==="mouseover"?(this._emitEvent(t,e,n,null,null,i),i&&this._emitEvent(t,e,n,i,null,i),t==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):t==="mouseleave"||t==="dragleave"||t==="mouseout"?(o=!0,s&&this._emitEvent(t,e,n,s,s,null),this._emitEvent(t,e,n,null,s,null),t==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,i,null,null)}if(o||(this.currentShape=i),i&&!i.get("destroyed")){var u=this.canvas,l=u.get("el");l.style.cursor=i.attr("cursor")||u.get("cursor")}},r.prototype._onmousedown=function(t,e,n){n.button===B2&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},r.prototype._emitMouseoverEvents=function(t,e,n,i){var a=this.canvas.get("el");n!==i&&(n&&(this._emitEvent("mouseout",t,e,n,n,i),this._emitEvent("mouseleave",t,e,n,n,i),(!i||i.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),i&&(this._emitEvent("mouseover",t,e,i,n,i),this._emitEvent("mouseenter",t,e,i,n,i)))},r.prototype._emitDragoverEvents=function(t,e,n,i,a){i?(i!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,i),this._emitEvent("dragenter",t,e,i,n,i)),a||this._emitEvent("dragover",t,e,i)):n&&this._emitEvent("dragleave",t,e,n,n,i),a&&this._emitEvent("dragover",t,e,i)},r.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var i=this._getShape(e,n);i!==t&&this._emitMouseoverEvents(n,e,t,i),this.currentShape=i},r.prototype._onmouseup=function(t,e,n){if(n.button===B2){var i=this.draggingShape;this.dragging?(i&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,i),this._afterDrag(i,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},r.prototype._ondragover=function(t,e,n){n.preventDefault();var i=this.currentShape;this._emitDragoverEvents(n,t,i,e,!0)},r.prototype._onmousemove=function(t,e,n){var i=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,a,e,!1),this._emitEvent("drag",n,t,o);else{var s=this.mousedownPoint;if(s){var u=this.mousedownShape,l=n.timeStamp,f=l-this.mousedownTimeStamp,c=s.clientX-t.clientX,d=s.clientY-t.clientY,h=c*c+d*d;f>120||h>s9?u&&u.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!u&&i.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,a,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,a,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,a,e),this._emitEvent("mousemove",n,t,e)}},r.prototype._emitEvent=function(t,e,n,i,a,o){var s=this._getEventObj(t,e,n,i,a,o);if(i){s.shape=i,z2(i,t,s);for(var u=i.getParent();u;)u.emitDelegation(t,s),s.propagationStopped||u9(u,t,s),s.propagationPath.push(u),u=u.getParent()}else{var l=this.canvas;z2(l,t,s)}},r.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},r}(),G2="px",$2=EO(),f9=$2&&$2.name==="firefox",GO=function(r){zt(t,r);function t(e){var n=r.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return t.prototype.getDefaultCfg=function(){var e=r.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},t.prototype.initContainer=function(){var e=this.get("container");Fe(e)&&(e=document.getElementById(e),this.set("container",e))},t.prototype.initDom=function(){var e=this.createDom();this.set("el",e);var n=this.get("container");n.appendChild(e),this.setDOMSize(this.get("width"),this.get("height"))},t.prototype.initEvents=function(){var e=new l9({canvas:this});e.init(),this.set("eventController",e)},t.prototype.initTimeline=function(){var e=new o9(this);this.set("timeline",e)},t.prototype.setDOMSize=function(e,n){var i=this.get("el");d2&&(i.style.width=e+G2,i.style.height=n+G2)},t.prototype.changeSize=function(e,n){this.setDOMSize(e,n),this.set("width",e),this.set("height",n),this.onCanvasChange("changeSize")},t.prototype.getRenderer=function(){return this.get("renderer")},t.prototype.getCursor=function(){return this.get("cursor")},t.prototype.setCursor=function(e){this.set("cursor",e);var n=this.get("el");d2&&n&&(n.style.cursor=e)},t.prototype.getPointByEvent=function(e){var n=this.get("supportCSSTransform");if(n){if(f9&&!gt(e.layerX)&&e.layerX!==e.offsetX)return{x:e.layerX,y:e.layerY};if(!gt(e.offsetX))return{x:e.offsetX,y:e.offsetY}}var i=this.getClientByEvent(e),a=i.x,o=i.y;return this.getPointByClient(a,o)},t.prototype.getClientByEvent=function(e){var n=e;return e.touches&&(e.type==="touchend"?n=e.changedTouches[0]:n=e.touches[0]),{x:n.clientX,y:n.clientY}},t.prototype.getPointByClient=function(e,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:e-a.left,y:n-a.top}},t.prototype.getClientByPoint=function(e,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:e+a.left,y:n+a.top}},t.prototype.draw=function(){},t.prototype.removeDom=function(){var e=this.get("el");e.parentNode.removeChild(e)},t.prototype.clearEvents=function(){var e=this.get("eventController");e.destroy()},t.prototype.isCanvas=function(){return!0},t.prototype.getParent=function(){return null},t.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),r.prototype.destroy.call(this))},t}(AO),$O=function(r){zt(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.isGroup=function(){return!0},t.prototype.isEntityGroup=function(){return!1},t.prototype.clone=function(){for(var e=r.prototype.clone.call(this),n=this.getChildren(),i=0;i<n.length;i++){var a=n[i];e.add(a.clone())}return e},t}(AO),UO=function(r){zt(t,r);function t(e){return r.call(this,e)||this}return t.prototype._isInBBox=function(e,n){var i=this.getBBox();return i.minX<=e&&i.maxX>=e&&i.minY<=n&&i.maxY>=n},t.prototype.afterAttrsChange=function(e){r.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},t.prototype.getBBox=function(){var e=this.cfg.bbox;return e||(e=this.calculateBBox(),this.set("bbox",e)),e},t.prototype.getCanvasBBox=function(){var e=this.cfg.canvasBBox;return e||(e=this.calculateCanvasBBox(),this.set("canvasBBox",e)),e},t.prototype.applyMatrix=function(e){r.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},t.prototype.calculateCanvasBBox=function(){var e=this.getBBox(),n=this.getTotalMatrix(),i=e.minX,a=e.minY,o=e.maxX,s=e.maxY;if(n){var u=ru(n,[e.minX,e.minY]),l=ru(n,[e.maxX,e.minY]),f=ru(n,[e.minX,e.maxY]),c=ru(n,[e.maxX,e.maxY]);i=Math.min(u[0],l[0],f[0],c[0]),o=Math.max(u[0],l[0],f[0],c[0]),a=Math.min(u[1],l[1],f[1],c[1]),s=Math.max(u[1],l[1],f[1],c[1])}var d=this.attrs;if(d.shadowColor){var h=d.shadowBlur,v=h===void 0?0:h,p=d.shadowOffsetX,g=p===void 0?0:p,y=d.shadowOffsetY,m=y===void 0?0:y,b=i-v+g,x=o+v+g,w=a-v+m,E=s+v+m;i=Math.min(i,b),o=Math.max(o,x),a=Math.min(a,w),s=Math.max(s,E)}return{x:i,y:a,minX:i,minY:a,maxX:o,maxY:s,width:o-i,height:s-a}},t.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},t.prototype.isClipShape=function(){return this.get("isClipShape")},t.prototype.isInShape=function(e,n){return!1},t.prototype.isOnlyHitBox=function(){return!1},t.prototype.isHit=function(e,n){var i=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[e,n,1];o=this.invertFromMatrix(o);var s=o[0],u=o[1],l=this._isInBBox(s,u);return this.isOnlyHitBox()?l:!!(l&&!this.isClipped(s,u)&&(this.isInShape(s,u)||i&&i.isHit(s,u)||a&&a.isHit(s,u)))},t}(SO),jO=new Map;function io(r,t){jO.set(r,t)}function WO(r){return jO.get(r)}function XO(r){var t=r.attr(),e=t.x,n=t.y,i=t.width,a=t.height;return{x:e,y:n,width:i,height:a}}function YO(r){var t=r.attr(),e=t.x,n=t.y,i=t.r;return{x:e-i,y:n-i,width:i*2,height:i*2}}function si(r,t,e,n){var i=r-e,a=t-n;return Math.sqrt(i*i+a*a)}function Qh(r,t){return Math.abs(r-t)<.001}function Vl(r,t){var e=Ja(r),n=Ja(t),i=Qa(r),a=Qa(t);return{x:e,y:n,width:i-e,height:a-n}}function xp(r){return(r+Math.PI*2)%(Math.PI*2)}const jn={box:function(r,t,e,n){return Vl([r,e],[t,n])},length:function(r,t,e,n){return si(r,t,e,n)},pointAt:function(r,t,e,n,i){return{x:(1-i)*r+i*e,y:(1-i)*t+i*n}},pointDistance:function(r,t,e,n,i,a){var o=(e-r)*(i-r)+(n-t)*(a-t);if(o<0)return si(r,t,i,a);var s=(e-r)*(e-r)+(n-t)*(n-t);return o>s?si(e,n,i,a):this.pointToLine(r,t,e,n,i,a)},pointToLine:function(r,t,e,n,i,a){var o=[e-r,n-t];if(B1(o,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-t)*(a-t));var s=[-o[1],o[0]];gs(s,s);var u=[i-r,a-t];return Math.abs(R1(u,s))},tangentAngle:function(r,t,e,n){return Math.atan2(n-t,e-r)}};var c9=1e-4;function VO(r,t,e,n,i,a){var o,s=1/0,u=[e,n],l=20;a&&a>200&&(l=a/10);for(var f=1/l,c=f/10,d=0;d<=l;d++){var h=d*f,v=[i.apply(null,r.concat([h])),i.apply(null,t.concat([h]))],p=si(u[0],u[1],v[0],v[1]);p<s&&(o=h,s=p)}if(o===0)return{x:r[0],y:t[0]};if(o===1){var g=r.length;return{x:r[g-1],y:t[g-1]}}s=1/0;for(var d=0;d<32&&!(c<c9);d++){var y=o-c,m=o+c,v=[i.apply(null,r.concat([y])),i.apply(null,t.concat([y]))],p=si(u[0],u[1],v[0],v[1]);if(y>=0&&p<s)o=y,s=p;else{var b=[i.apply(null,r.concat([m])),i.apply(null,t.concat([m]))],x=si(u[0],u[1],b[0],b[1]);m<=1&&x<s?(o=m,s=x):c*=.5}}return{x:i.apply(null,r.concat([o])),y:i.apply(null,t.concat([o]))}}function d9(r,t){for(var e=0,n=r.length,i=0;i<n;i++){var a=r[i],o=t[i],s=r[(i+1)%n],u=t[(i+1)%n];e+=si(a,o,s,u)}return e/2}function os(r,t,e,n){var i=1-n;return i*i*r+2*n*i*t+n*n*e}function U2(r,t,e){var n=r+e-2*t;if(Qh(n,0))return[.5];var i=(r-t)/n;return i<=1&&i>=0?[i]:[]}function j2(r,t,e,n){return 2*(1-n)*(t-r)+2*n*(e-t)}function HO(r,t,e,n,i,a,o){var s=os(r,e,i,o),u=os(t,n,a,o),l=jn.pointAt(r,t,e,n,o),f=jn.pointAt(e,n,i,a,o);return[[r,t,l.x,l.y,s,u],[s,u,f.x,f.y,i,a]]}function Qy(r,t,e,n,i,a,o){if(o===0)return(si(r,t,e,n)+si(e,n,i,a)+si(r,t,i,a))/2;var s=HO(r,t,e,n,i,a,.5),u=s[0],l=s[1];return u.push(o-1),l.push(o-1),Qy.apply(null,u)+Qy.apply(null,l)}const KO={box:function(r,t,e,n,i,a){var o=U2(r,e,i)[0],s=U2(t,n,a)[0],u=[r,i],l=[t,a];return o!==void 0&&u.push(os(r,e,i,o)),s!==void 0&&l.push(os(t,n,a,s)),Vl(u,l)},length:function(r,t,e,n,i,a){return Qy(r,t,e,n,i,a,3)},nearestPoint:function(r,t,e,n,i,a,o,s){return VO([r,e,i],[t,n,a],o,s,os)},pointDistance:function(r,t,e,n,i,a,o,s){var u=this.nearestPoint(r,t,e,n,i,a,o,s);return si(u.x,u.y,o,s)},interpolationAt:os,pointAt:function(r,t,e,n,i,a,o){return{x:os(r,e,i,o),y:os(t,n,a,o)}},divide:function(r,t,e,n,i,a,o){return HO(r,t,e,n,i,a,o)},tangentAngle:function(r,t,e,n,i,a,o){var s=j2(r,e,i,o),u=j2(t,n,a,o),l=Math.atan2(u,s);return xp(l)}};function ss(r,t,e,n,i){var a=1-i;return a*a*a*r+3*t*i*a*a+3*e*i*i*a+n*i*i*i}function W2(r,t,e,n,i){var a=1-i;return 3*(a*a*(t-r)+2*a*i*(e-t)+i*i*(n-e))}function b0(r,t,e,n){var i=-3*r+9*t-9*e+3*n,a=6*r-12*t+6*e,o=3*t-3*r,s=[],u,l,f;if(Qh(i,0))Qh(a,0)||(u=-o/a,u>=0&&u<=1&&s.push(u));else{var c=a*a-4*i*o;Qh(c,0)?s.push(-a/(2*i)):c>0&&(f=Math.sqrt(c),u=(-a+f)/(2*i),l=(-a-f)/(2*i),u>=0&&u<=1&&s.push(u),l>=0&&l<=1&&s.push(l))}return s}function qO(r,t,e,n,i,a,o,s,u){var l=ss(r,e,i,o,u),f=ss(t,n,a,s,u),c=jn.pointAt(r,t,e,n,u),d=jn.pointAt(e,n,i,a,u),h=jn.pointAt(i,a,o,s,u),v=jn.pointAt(c.x,c.y,d.x,d.y,u),p=jn.pointAt(d.x,d.y,h.x,h.y,u);return[[r,t,c.x,c.y,v.x,v.y,l,f],[l,f,p.x,p.y,h.x,h.y,o,s]]}function Jy(r,t,e,n,i,a,o,s,u){if(u===0)return d9([r,e,i,o],[t,n,a,s]);var l=qO(r,t,e,n,i,a,o,s,.5),f=l[0],c=l[1];return f.push(u-1),c.push(u-1),Jy.apply(null,f)+Jy.apply(null,c)}const qf={extrema:b0,box:function(r,t,e,n,i,a,o,s){for(var u=[r,o],l=[t,s],f=b0(r,e,i,o),c=b0(t,n,a,s),d=0;d<f.length;d++)u.push(ss(r,e,i,o,f[d]));for(var d=0;d<c.length;d++)l.push(ss(t,n,a,s,c[d]));return Vl(u,l)},length:function(r,t,e,n,i,a,o,s){return Jy(r,t,e,n,i,a,o,s,3)},nearestPoint:function(r,t,e,n,i,a,o,s,u,l,f){return VO([r,e,i,o],[t,n,a,s],u,l,ss,f)},pointDistance:function(r,t,e,n,i,a,o,s,u,l,f){var c=this.nearestPoint(r,t,e,n,i,a,o,s,u,l,f);return si(c.x,c.y,u,l)},interpolationAt:ss,pointAt:function(r,t,e,n,i,a,o,s,u){return{x:ss(r,e,i,o,u),y:ss(t,n,a,s,u)}},divide:function(r,t,e,n,i,a,o,s,u){return qO(r,t,e,n,i,a,o,s,u)},tangentAngle:function(r,t,e,n,i,a,o,s,u){var l=W2(r,e,i,o,u),f=W2(t,n,a,s,u);return xp(Math.atan2(f,l))}};function X2(r,t){var e=Math.abs(r);return t>0?e:e*-1}const h9={box:function(r,t,e,n){return{x:r-e,y:t-n,width:e*2,height:n*2}},length:function(r,t,e,n){return Math.PI*(3*(e+n)-Math.sqrt((3*e+n)*(e+3*n)))},nearestPoint:function(r,t,e,n,i,a){var o=e,s=n;if(o===0||s===0)return{x:r,y:t};for(var u=i-r,l=a-t,f=Math.abs(u),c=Math.abs(l),d=o*o,h=s*s,v=Math.PI/4,p,g,y=0;y<4;y++){p=o*Math.cos(v),g=s*Math.sin(v);var m=(d-h)*Math.pow(Math.cos(v),3)/o,b=(h-d)*Math.pow(Math.sin(v),3)/s,x=p-m,w=g-b,E=f-m,_=c-b,M=Math.hypot(w,x),C=Math.hypot(_,E),S=M*Math.asin((x*_-w*E)/(M*C)),A=S/Math.sqrt(d+h-p*p-g*g);v+=A,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:r+X2(p,u),y:t+X2(g,l)}},pointDistance:function(r,t,e,n,i,a){var o=this.nearestPoint(r,t,e,n,i,a);return si(o.x,o.y,i,a)},pointAt:function(r,t,e,n,i){var a=2*Math.PI*i;return{x:r+e*Math.cos(a),y:t+n*Math.sin(a)}},tangentAngle:function(r,t,e,n,i){var a=2*Math.PI*i,o=Math.atan2(n*Math.cos(a),-e*Math.sin(a));return xp(o)}};function v9(r,t,e,n,i,a,o,s){return-1*e*Math.cos(i)*Math.sin(s)-n*Math.sin(i)*Math.cos(s)}function p9(r,t,e,n,i,a,o,s){return-1*e*Math.sin(i)*Math.sin(s)+n*Math.cos(i)*Math.cos(s)}function g9(r,t,e){return Math.atan(-t/r*Math.tan(e))}function y9(r,t,e){return Math.atan(t/(r*Math.tan(e)))}function Y2(r,t,e,n,i,a){return e*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function V2(r,t,e,n,i,a){return e*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+t}function m9(r,t,e,n){var i=Math.atan2(n*r,e*t);return(i+Math.PI*2)%(Math.PI*2)}function H2(r,t,e){return{x:r*Math.cos(e),y:t*Math.sin(e)}}function K2(r,t,e){var n=Math.cos(e),i=Math.sin(e);return[r*n-t*i,r*i+t*n]}const b9={box:function(r,t,e,n,i,a,o){for(var s=g9(e,n,i),u=1/0,l=-1/0,f=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var d=s+c;a<o?a<d&&d<o&&f.push(d):o<d&&d<a&&f.push(d)}for(var c=0;c<f.length;c++){var h=Y2(r,t,e,n,i,f[c]);h<u&&(u=h),h>l&&(l=h)}for(var v=y9(e,n,i),p=1/0,g=-1/0,y=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var m=v+c;a<o?a<m&&m<o&&y.push(m):o<m&&m<a&&y.push(m)}for(var c=0;c<y.length;c++){var b=V2(r,t,e,n,i,y[c]);b<p&&(p=b),b>g&&(g=b)}return{x:u,y:p,width:l-u,height:g-p}},length:function(r,t,e,n,i,a,o){},nearestPoint:function(r,t,e,n,i,a,o,s,u){var l=K2(s-r,u-t,-i),f=l[0],c=l[1],d=h9.nearestPoint(0,0,e,n,f,c),h=m9(e,n,d.x,d.y);h<a?d=H2(e,n,a):h>o&&(d=H2(e,n,o));var v=K2(d.x,d.y,i);return{x:v[0]+r,y:v[1]+t}},pointDistance:function(r,t,e,n,i,a,o,s,u){var l=this.nearestPoint(r,t,e,n,s,u);return si(l.x,l.y,s,u)},pointAt:function(r,t,e,n,i,a,o,s){var u=(o-a)*s+a;return{x:Y2(r,t,e,n,i,u),y:V2(r,t,e,n,i,u)}},tangentAngle:function(r,t,e,n,i,a,o,s){var u=(o-a)*s+a,l=v9(r,t,e,n,i,a,o,u),f=p9(r,t,e,n,i,a,o,u);return xp(Math.atan2(f,l))}};function ZO(r){for(var t=0,e=[],n=0;n<r.length-1;n++){var i=r[n],a=r[n+1],o=si(i[0],i[1],a[0],a[1]),s={from:i,to:a,length:o};e.push(s),t+=o}return{segments:e,totalLength:t}}function x9(r){if(r.length<2)return 0;for(var t=0,e=0;e<r.length-1;e++){var n=r[e],i=r[e+1];t+=si(n[0],n[1],i[0],i[1])}return t}function w9(r,t){if(t>1||t<0||r.length<2)return null;var e=ZO(r),n=e.segments,i=e.totalLength;if(i===0)return{x:r[0][0],y:r[0][1]};for(var a=0,o=null,s=0;s<n.length;s++){var u=n[s],l=u.from,f=u.to,c=u.length/i;if(t>=a&&t<=a+c){var d=(t-a)/c;o=jn.pointAt(l[0],l[1],f[0],f[1],d);break}a+=c}return o}function E9(r,t){if(t>1||t<0||r.length<2)return 0;for(var e=ZO(r),n=e.segments,i=e.totalLength,a=0,o=0,s=0;s<n.length;s++){var u=n[s],l=u.from,f=u.to,c=u.length/i;if(t>=a&&t<=a+c){o=Math.atan2(f[1]-l[1],f[0]-l[0]);break}a+=c}return o}function _9(r,t,e){for(var n=1/0,i=0;i<r.length-1;i++){var a=r[i],o=r[i+1],s=jn.pointDistance(a[0],a[1],o[0],o[1],t,e);s<n&&(n=s)}return n}const QO={box:function(r){for(var t=[],e=[],n=0;n<r.length;n++){var i=r[n];t.push(i[0]),e.push(i[1])}return Vl(t,e)},length:function(r){return x9(r)},pointAt:function(r,t){return w9(r,t)},pointDistance:function(r,t,e){return _9(r,t,e)},tangentAngle:function(r,t){return E9(r,t)}};function q2(r,t){return!r||!t?r||t:{minX:Math.min(r.minX,t.minX),minY:Math.min(r.minY,t.minY),maxX:Math.max(r.maxX,t.maxX),maxY:Math.max(r.maxY,t.maxY)}}function rb(r,t){var e=r.get("startArrowShape"),n=r.get("endArrowShape"),i=null,a=null;return e&&(i=e.getCanvasBBox(),t=q2(t,i)),n&&(a=n.getCanvasBBox(),t=q2(t,a)),t}function S9(r){for(var t=r.attr(),e=t.points,n=[],i=[],a=0;a<e.length;a++){var o=e[a];n.push(o[0]),i.push(o[1])}var s=Vl(n,i),u=s.x,l=s.y,f=s.width,c=s.height,d={minX:u,minY:l,maxX:u+f,maxY:l+c};return d=rb(r,d),{x:d.minX,y:d.minY,width:d.maxX-d.minX,height:d.maxY-d.minY}}function M9(r){for(var t=r.attr(),e=t.points,n=[],i=[],a=0;a<e.length;a++){var o=e[a];n.push(o[0]),i.push(o[1])}return Vl(n,i)}var x0=null;function JO(){if(!x0){var r=document.createElement("canvas");r.width=1,r.height=1,x0=r.getContext("2d")}return x0}function eL(r,t,e){var n=1;if(Fe(r)&&(n=r.split(`
|
|
268
|
+
)`,"background-size":"1px 10px"}},null,-1),$4=Vr({__name:"ScreenshotCard",props:{url:{},snapshot:{},rootNode:{},focusNode:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}}},setup(r){const t=r,e=On(),n=f=>{if(!t.rootNode)return;const c=e.value;if(!c)return;const d=c.getBoundingClientRect(),h=d.width/c.naturalWidth*c.naturalHeight,v=(d.height-h)/2,p=(f.clientX-d.left)/d.width*c.naturalWidth,g=(f.clientY-d.top-v)/h*c.naturalHeight,y=wB(t.snapshot.nodes,p,g);y&&t.onUpdateFocusNode(y)},i=f=>`${f*100}%`,a=Dr(()=>{var v;const f=e.value,c=(v=t.focusNode)==null?void 0:v.attr;if(!t.focusNode||!f||!c)return"";const d=f.getBoundingClientRect(),h=d.width/f.naturalWidth*f.naturalHeight;return{left:`calc(${i(c.left/f.naturalWidth)} - 2px)`,width:`calc(${i((c.right-c.left)/f.naturalWidth)} + 2px)`,top:`calc(${i((c.top/f.naturalHeight*h+(d.height-h)/2)/d.height)} - 2px)`,height:`calc(${i((c.bottom-c.top)/f.naturalHeight*h/d.height)} + 2px)`}}),o=On(!1),s=On({ox:0,oy:0}),u=f=>{const c=e.value;if(!c)return;const d=c.getBoundingClientRect(),h=d.width/c.naturalWidth*c.naturalHeight,v=(d.height-h)/2,p=(f.clientX-d.left)/d.width*c.naturalWidth,g=(f.clientY-d.top-v)/h*c.naturalHeight;s.value={ox:p,oy:g},l.value={left:-(p-.1*c.naturalWidth)/c.naturalWidth*1e3+"px",top:-(g-.1*c.naturalWidth)/c.naturalWidth*1e3+"px"}},l=On({left:"0",top:"0"});return(f,c)=>(Lr(),bi("div",k4,[Ar("img",{ref_key:"imgRef",ref:e,src:f.url,onClick:n,"cursor-crosshair":"","h-full":"","object-contain":"",style:{"max-width":"max(35vw, 400px)"},onMouseover:c[0]||(c[0]=d=>o.value=!0),onMouseleave:c[1]||(c[1]=d=>o.value=!1),onMousemove:u},null,40,D4),Ar("div",{style:Cy(a.value),absolute:"","pointer-events-none":"","transition-all-300":"","b-1px":"","b-blue":"","b-solid":""},P4,4),mA(Ar("div",R4,[Ar("img",{src:f.url,"object-contain":"",absolute:"","left-0":"","top-0":"",style:Cy(l.value),"w-1000px":""},null,12,B4),Ar("div",F4,Hn(`${s.value.ox.toFixed(0)},${s.value.oy.toFixed(0)}`),1),z4,G4],512),[[bA,o.value]])]))}}),U4={"w-480px":"","bg-white":"","b-1px":"","b-solid":"","b-gray-200":"","rounded-4px":"","p-8px":"",style:{"min-width":"max(25vw, 480px)"}},j4={flex:"","m-b-4px":""},W4=Ar("svg",{viewBox:"0 0 32 32"},[Ar("path",{d:"M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9a9.01 9.01 0 0 1-9-9z",fill:"currentColor"})],-1),X4=Ar("div",{"p-5px":""},null,-1),Y4={key:0,underline:"","decoration-1":"","m-r-4px":"",title:"查询数量"},V4=["title"],H4=Ar("svg",{viewBox:"0 0 24 24"},[Ar("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z",fill:"currentColor"})],-1),K4=Ar("div",{"p-l-8px":""},null,-1),q4=Ar("svg",{viewBox:"0 0 24 24"},[Ar("g",{fill:"none"},[Ar("path",{d:"M12 1.75a3.25 3.25 0 0 1 3.245 3.066L15.25 5h5.25a.75.75 0 0 1 .102 1.493L20.5 6.5h-.796l-1.28 13.02a2.75 2.75 0 0 1-2.561 2.474l-.176.006H8.313a2.75 2.75 0 0 1-2.714-2.307l-.023-.174L4.295 6.5H3.5a.75.75 0 0 1-.743-.648L2.75 5.75a.75.75 0 0 1 .648-.743L3.5 5h5.25A3.25 3.25 0 0 1 12 1.75zm6.197 4.75H5.802l1.267 12.872a1.25 1.25 0 0 0 1.117 1.122l.127.006h7.374c.6 0 1.109-.425 1.225-1.002l.02-.126L18.196 6.5zM13.75 9.25a.75.75 0 0 1 .743.648L14.5 10v7a.75.75 0 0 1-1.493.102L13 17v-7a.75.75 0 0 1 .75-.75zm-3.5 0a.75.75 0 0 1 .743.648L11 10v7a.75.75 0 0 1-1.493.102L9.5 17v-7a.75.75 0 0 1 .75-.75zm1.75-6a1.75 1.75 0 0 0-1.744 1.606L10.25 5h3.5A1.75 1.75 0 0 0 12 3.25z",fill:"currentColor"})])],-1),Z4=Ar("svg",{viewBox:"0 0 24 24"},[Ar("path",{fill:"currentColor",d:"M5 21V8.825Q4.125 8.5 3.563 7.738T3 6q0-1.25.875-2.125T6 3q1.25 0 2.125.875T9 6q0 .975-.562 1.738T7 8.825V19h4V3h8v12.175q.875.325 1.438 1.088T21 18q0 1.25-.875 2.125T18 21q-1.25 0-2.125-.875T15 18q0-.975.563-1.75T17 15.175V5h-4v16zM6 7q.425 0 .713-.288T7 6q0-.425-.288-.712T6 5q-.425 0-.712.288T5 6q0 .425.288.713T6 7m12 12q.425 0 .713-.288T19 18q0-.425-.288-.712T18 17q-.425 0-.712.288T17 18q0 .425.288.713T18 19m0-1"})],-1),Q4=Vr({__name:"SearchCard",props:{snapshot:{},rootNode:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}},onUpdateTrack:{type:Function,default:()=>()=>{}}},setup(r){const t=MA(),e=r,n=On(""),i=_A([]),a=On([]),o=BE(()=>{if(!e.rootNode){ca.error("根节点不存在");return}const f=n.value.trim();if(!f)return;if(u.value){const h=TB(()=>AB(f),"选择器非法");if(i.find(p=>typeof p.selector=="object"&&p.selector.toString()==h.toString())){ca.warning("不可重复选择");return}const v=h.querySelectorTrackAll(e.rootNode);if(v.length==0){ca.success("没有选择到节点");return}ca.success(`选择到 ${v.length} 个节点`),i.unshift({selector:h,nodes:v,key:Date.now()})}else{if(i.find(p=>typeof p.selector=="string"&&p.selector.toString()==f)){ca.warning("不可重复选择");return}const h=[],v=[e.rootNode];for(;v.length>0;){const p=v.pop();Uh(p).includes(f)&&h.push(p),v.push(...[...p.children].reverse())}if(h.length==0){ca.success("没有搜索到节点");return}ca.success(`搜索到 ${h.length} 个节点`),i.unshift({selector:f,nodes:h,key:Date.now()})}const c=new Set(i.map(h=>h.key)),d=a.value.filter(h=>c.has(h));d.push(i[0].key),a.value=d}),s=BE(async f=>{var y,m,b;let c=U5[e.snapshot.id];c&&(c=ME(t,c));let d=yA[e.snapshot.id];d&&(d=ME(t,d));const h=f.selector,v=f.nodes[0][0],p=[((y=v.quickFind)!=null?y:v.idQf)&&v.attr.id&&h.qfIdValue,((m=v.quickFind)!=null?m:v.idQf)&&v.attr.vid&&h.qfVidValue,((b=v.quickFind)!=null?b:v.textQf)&&v.attr.text&&h.qfTextValue].some(Boolean),g={id:e.snapshot.appId,name:e.snapshot.appName,groups:[{key:1,name:`[ChangeMe]规则名称-${MB().format("YYYY-MM-DD HH:mm:ss")}`,desc:"[ChangeMe]本规则由GKD网页端审查工具生成",rules:[{quickFind:p||void 0,activityIds:e.snapshot.activityId,matches:h.toString(),exampleUrls:c,snapshotUrls:d}]}]};Js(IB.stringify(g,void 0,2))}),u=On(!0),l=window.innerWidth/100;return(f,c)=>(Lr(),ii(RA,{initialValue:{top:75,right:Math.max(315,12*l+135)},class:"z-1"},{default:Lt(({onRef:d})=>[Ar("div",U4,[Ar("div",j4,[Vt(vt(EB),{value:u.value,"onUpdate:value":c[0]||(c[0]=h=>u.value=h)},{default:Lt(()=>[Vt(vt(DE),null,{default:Lt(()=>[Vt(vt(NE),{value:!1},{default:Lt(()=>[xn(" 字符搜索 ")]),_:1}),Vt(vt(NE),{value:!0},{default:Lt(()=>[xn(" 选择器查询 ")]),_:1})]),_:1})]),_:1},8,["value"]),Ar("div",{"flex-1":"","cursor-move":"",ref:d},null,512)]),Vt(vt(SB),null,{default:Lt(()=>[Vt(vt(_B),{value:n.value,"onUpdate:value":c[1]||(c[1]=h=>n.value=h),placeholder:u.value?"请输入选择器":"请输入字符",onKeyup:fB(vt(o),["enter"]),inputProps:{class:"gkd_code"}},null,8,["value","placeholder","onKeyup"]),Vt(vt(Yu),{onClick:vt(o)},{icon:Lt(()=>[Vt(vt(pl),null,{default:Lt(()=>[W4]),_:1})]),_:1},8,["onClick"])]),_:1}),X4,Vt(vt(WB),{expandedNames:a.value,"onUpdate:expandedNames":c[2]||(c[2]=h=>a.value=h)},{default:Lt(()=>[(Lr(!0),bi(Hf,null,$h(vt(i),(h,v)=>(Lr(),ii(vt(VB),{key:h.key,name:h.key},{header:Lt(()=>[h.nodes.length>1?(Lr(),bi("span",Y4,Hn(h.nodes.length),1)):Ra("",!0),Ar("span",{"break-all":"",title:typeof h.selector=="object"?"选择器":"搜索字符"},Hn(h.selector.toString()),9,V4)]),"header-extra":Lt(()=>[typeof h.selector=="object"&&h.selector.canCopy?(Lr(),ii(vt(Yu),{key:0,size:"small",onClick:OE(p=>vt(s)(h),["stop"]),title:"复制规则"},{icon:Lt(()=>[Vt(vt(pl),null,{default:Lt(()=>[H4]),_:1})]),_:2},1032,["onClick"])):Ra("",!0),K4,Vt(vt(Yu),{size:"small",onClick:OE(p=>vt(i).splice(v,1),["stop"]),title:"删除记录"},{icon:Lt(()=>[Vt(vt(pl),null,{default:Lt(()=>[q4]),_:1})]),_:2},1032,["onClick"])]),default:Lt(()=>[Vt(vt(DE),{style:{"max-height":"400px","overflow-y":"scroll","padding-bottom":"10px"}},{default:Lt(()=>[typeof h.selector=="string"||h.selector.tracks.length<=1?(Lr(!0),bi(Hf,{key:0},$h(h.nodes.map(p=>Array.isArray(p)?p[0]:p),p=>(Lr(),ii(vt(Yu),{key:p.id,onClick:g=>f.onUpdateFocusNode(p),size:"small"},{default:Lt(()=>[xn(Hn(vt(Uh)(p)),1)]),_:2},1032,["onClick"]))),128)):(Lr(!0),bi(Hf,{key:1},$h(h.nodes.map(p=>Array.isArray(p)?p:[p]),(p,g)=>(Lr(),ii(vt(FB),{key:g},{default:Lt(()=>[Vt(vt(Yu),{size:"small",onClick:y=>f.onUpdateTrack({nodes:p,selector:h.selector})},{default:Lt(()=>[Vt(vt(pl),null,{default:Lt(()=>[Z4]),_:1})]),_:2},1032,["onClick"]),Vt(vt(Yu),{onClick:y=>f.onUpdateFocusNode(p[h.selector.trackIndex]),size:"small"},{default:Lt(()=>[xn(Hn(vt(Uh)(p[h.selector.trackIndex])),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["expandedNames"])])]),_:1},8,["initialValue"]))}}),J4={flex:"","flex-col":""},eF=Vr({__name:"WindowCard",props:{snapshot:{},rootNode:{},focusNode:{},focusCount:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}}},setup(r){const t=r,e=On([]);vl([()=>t.focusNode,()=>t.focusCount],async()=>{if(!t.focusNode)return;const s=t.focusNode.id;Pf().then(async()=>{var f,c;await My(100),s===((f=t.focusNode)==null?void 0:f.id)&&((c=n.value)==null||c.scrollTo({key:s,behavior:"smooth",debounce:!0}))});let u=t.focusNode.parent;if(!u)return;const l=new Set(e.value);for(;u;)l.add(u.id),u=u.parent;l.size==e.value.length&&e.value.every(f=>l.has(f))||(e.value=[...l])});const n=On(),i=(s,u)=>{var l;return u.id===((l=t.focusNode)==null?void 0:l.id)},a=s=>{var l;const u=s.option.idQf||s.option.textQf||s.option.quickFind;return{onClick:()=>{t.onUpdateFocusNode(s.option)},style:{color:s.option.id==((l=t.focusNode)==null?void 0:l.id)?"#00F":void 0,fontWeight:u?"bold":void 0}}},o=s=>Uh(s.option);return(s,u)=>(Lr(),bi("div",J4,[Vt(vt(LA),{size:"small",striped:"",singleLine:!1,class:"table-fixed",themeOverrides:{thPaddingSmall:"2px 4px",tdPaddingSmall:"2px 4px"}},{default:Lt(()=>[Vt(vt(i4),null,{default:Lt(()=>[Vt(vt(Ty),null,{default:Lt(()=>[Vt(vt(Us),{class:"w-140px"},{default:Lt(()=>[xn(" Device ")]),_:1}),Vt(vt(Us),{class:"w-100px"},{default:Lt(()=>[xn(" Name ")]),_:1}),Vt(vt(Us),{class:"w-100px"},{default:Lt(()=>[xn(" VersionName ")]),_:1}),Vt(vt(Us),{class:"w-100px"},{default:Lt(()=>[xn(" VersionCode ")]),_:1}),Vt(vt(Us),{class:"w-150px"},{default:Lt(()=>[xn(" AppId ")]),_:1}),Vt(vt(Us),null,{default:Lt(()=>[xn(" ActivityId ")]),_:1}),Vt(vt(Us),{class:"w-175px"},{default:Lt(()=>[xn(" 操作 ")]),_:1})]),_:1})]),_:1}),Vt(vt(kA),null,{default:Lt(()=>[Vt(vt(Ty),null,{default:Lt(()=>[Vt(vt(Mo),{class:"whitespace-nowrap"},{default:Lt(()=>[xn(Hn(`${vt(PE)(s.snapshot).manufacturer} Android ${vt(PE)(s.snapshot).release||""}`),1)]),_:1}),Vt(vt(Mo),{class:"whitespace-nowrap",onClick:u[0]||(u[0]=l=>vt(Js)(s.snapshot.appName))},{default:Lt(()=>[Vt(vt(eu),null,{default:Lt(()=>[xn(Hn(s.snapshot.appName),1)]),_:1})]),_:1}),Vt(vt(Mo),{class:"whitespace-nowrap",onClick:u[1]||(u[1]=l=>vt(Js)(s.snapshot.appVersionName))},{default:Lt(()=>[Vt(vt(eu),null,{default:Lt(()=>[xn(Hn(s.snapshot.appVersionName),1)]),_:1})]),_:1}),Vt(vt(Mo),{class:"whitespace-nowrap",onClick:u[2]||(u[2]=l=>vt(Js)(s.snapshot.appVersionCode.toString()))},{default:Lt(()=>[Vt(vt(eu),null,{default:Lt(()=>[xn(Hn(s.snapshot.appVersionCode),1)]),_:1})]),_:1}),Vt(vt(Mo),{class:"whitespace-nowrap",onClick:u[3]||(u[3]=l=>vt(Js)(s.snapshot.appId))},{default:Lt(()=>[Vt(vt(eu),null,{default:Lt(()=>[xn(Hn(s.snapshot.appId),1)]),_:1})]),_:1}),Vt(vt(Mo),{onClick:u[4]||(u[4]=l=>vt(Js)(s.snapshot.activityId)),class:"break-words"},{default:Lt(()=>[Vt(vt(eu),null,{default:Lt(()=>[xn(Hn(s.snapshot.activityId),1)]),_:1})]),_:1}),Vt(vt(Mo),null,{default:Lt(()=>[SA(s.$slots,"default")]),_:3})]),_:3})]),_:3})]),_:3}),Vt(vt(x4),{ref_key:"treeRef",ref:n,virtualScroll:"",showLine:"",keyField:"id",expandedKeys:e.value,"onUpdate:expandedKeys":u[5]||(u[5]=l=>e.value=l),data:[s.rootNode],filter:i,nodeProps:a,renderLabel:o},null,8,["expandedKeys","data","filter","nodeProps","renderLabel"])]))}});var Iy=function(r,t){return Iy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},Iy(r,t)};function zt(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Iy(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var F=function(){return F=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},F.apply(this,arguments)};function Ln(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e}function BA(r,t,e,n){var i=arguments.length,a=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,e):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,t,e,n);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(i<3?o(a):i>3?o(t,e,a):o(t,e))||a);return i>3&&a&&Object.defineProperty(t,e,a),a}function FA(r,t){return function(e,n){t(e,n,r)}}function tF(r,t,e,n,i,a){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var s=n.kind,u=s==="getter"?"get":s==="setter"?"set":"value",l=!t&&r?n.static?r:r.prototype:null,f=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),c,d=!1,h=e.length-1;h>=0;h--){var v={};for(var p in n)v[p]=p==="access"?{}:n[p];for(var p in n.access)v.access[p]=n.access[p];v.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(y||null))};var g=(0,e[h])(s==="accessor"?{get:f.get,set:f.set}:f[u],v);if(s==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(c=o(g.get))&&(f.get=c),(c=o(g.set))&&(f.set=c),(c=o(g.init))&&i.unshift(c)}else(c=o(g))&&(s==="field"?i.unshift(c):f[u]=c)}l&&Object.defineProperty(l,n.name,f),d=!0}function rF(r,t,e){for(var n=arguments.length>2,i=0;i<t.length;i++)e=n?t[i].call(r,e):t[i].call(r);return n?e:void 0}function nF(r){return typeof r=="symbol"?r:"".concat(r)}function iF(r,t,e){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:e?"".concat(e," ",t):t})}function zA(r,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,t)}function Ii(r,t,e,n){function i(a){return a instanceof e?a:new e(function(o){o(a)})}return new(e||(e=Promise))(function(a,o){function s(f){try{l(n.next(f))}catch(c){o(c)}}function u(f){try{l(n.throw(f))}catch(c){o(c)}}function l(f){f.done?a(f.value):i(f.value).then(s,u)}l((n=n.apply(r,t||[])).next())})}function Oi(r,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(f){return u([l,f])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(e=0)),e;)try{if(n=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){e.label=l[1];break}if(l[0]===6&&e.label<a[1]){e.label=a[1],a=l;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(l);break}a[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(r,e)}catch(f){l=[6,f],i=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var fp=Object.create?function(r,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,i)}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]};function GA(r,t){for(var e in r)e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e)&&fp(t,r,e)}function yv(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m1(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a}function $A(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(m1(arguments[t]));return r}function cp(){for(var r=0,t=0,e=arguments.length;t<e;t++)r+=arguments[t].length;for(var n=Array(r),i=0,t=0;t<e;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}function Bi(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return r.concat(a||Array.prototype.slice.call(t))}function Al(r){return this instanceof Al?(this.v=r,this):new Al(r)}function UA(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(r,t||[]),i,a=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(d){n[d]&&(i[d]=function(h){return new Promise(function(v,p){a.push([d,h,v,p])>1||s(d,h)})})}function s(d,h){try{u(n[d](h))}catch(v){c(a[0][3],v)}}function u(d){d.value instanceof Al?Promise.resolve(d.value.v).then(l,f):c(a[0][2],d)}function l(d){s("next",d)}function f(d){s("throw",d)}function c(d,h){d(h),a.shift(),a.length&&s(a[0][0],a[0][1])}}function jA(r){var t,e;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,a){t[i]=r[i]?function(o){return(e=!e)?{value:Al(r[i](o)),done:!1}:a?a(o):o}:a}}function WA(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=r[Symbol.asyncIterator],e;return t?t.call(r):(r=typeof yv=="function"?yv(r):r[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(a){e[a]=r[a]&&function(o){return new Promise(function(s,u){o=r[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(l){a({value:l,done:s})},o)}}function XA(r,t){return Object.defineProperty?Object.defineProperty(r,"raw",{value:t}):r.raw=t,r}var aF=Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t};function YA(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.prototype.hasOwnProperty.call(r,e)&&fp(t,r,e);return aF(t,r),t}function VA(r){return r&&r.__esModule?r:{default:r}}function HA(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)}function KA(r,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e}function qA(r,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?t===r:r.has(t)}function ZA(r,t,e){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n;if(e){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");r.stack.push({value:t,dispose:n,async:e})}else e&&r.stack.push({async:!0});return t}var oF=typeof SuppressedError=="function"?SuppressedError:function(r,t,e){var n=new Error(e);return n.name="SuppressedError",n.error=r,n.suppressed=t,n};function QA(r){function t(n){r.error=r.hasError?new oF(n,r.error,"An error was suppressed during disposal."):n,r.hasError=!0}function e(){for(;r.stack.length;){var n=r.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(e,function(a){return t(a),e()})}catch(a){t(a)}}if(r.hasError)throw r.error}return e()}const sF={__extends:zt,__assign:F,__rest:Ln,__decorate:BA,__param:FA,__metadata:zA,__awaiter:Ii,__generator:Oi,__createBinding:fp,__exportStar:GA,__values:yv,__read:m1,__spread:$A,__spreadArrays:cp,__spreadArray:Bi,__await:Al,__asyncGenerator:UA,__asyncDelegator:jA,__asyncValues:WA,__makeTemplateObject:XA,__importStar:YA,__importDefault:VA,__classPrivateFieldGet:HA,__classPrivateFieldSet:KA,__classPrivateFieldIn:qA,__addDisposableResource:ZA,__disposeResources:QA},uF=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:ZA,get __assign(){return F},__asyncDelegator:jA,__asyncGenerator:UA,__asyncValues:WA,__await:Al,__awaiter:Ii,__classPrivateFieldGet:HA,__classPrivateFieldIn:qA,__classPrivateFieldSet:KA,__createBinding:fp,__decorate:BA,__disposeResources:QA,__esDecorate:tF,__exportStar:GA,__extends:zt,__generator:Oi,__importDefault:VA,__importStar:YA,__makeTemplateObject:XA,__metadata:zA,__param:FA,__propKey:nF,__read:m1,__rest:Ln,__runInitializers:rF,__setFunctionName:iF,__spread:$A,__spreadArray:Bi,__spreadArrays:cp,__values:yv,default:sF},Symbol.toStringTag,{value:"Module"}));var Ei=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},mv=function(r,t){return Ei(r)?r.indexOf(t)>-1:!1},dp=function(r,t){if(!Ei(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];t(i,n)&&e.push(i)}return e},lF=function(r,t){return t===void 0&&(t=[]),dp(r,function(e){return!mv(t,e)})},fF={}.toString,xa=function(r,t){return fF.call(r)==="[object "+t+"]"};const Yr=function(r){return xa(r,"Function")};var gt=function(r){return r==null};const wt=function(r){return Array.isArray?Array.isArray(r):xa(r,"Array")},Wn=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function xe(r,t){if(r){var e;if(wt(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(Wn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var JA=Object.keys?function(r){return Object.keys(r)}:function(r){var t=[];return xe(r,function(e,n){Yr(r)&&n==="prototype"||t.push(n)}),t};function eT(r,t){var e=JA(t),n=e.length;if(gt(r))return!n;for(var i=0;i<n;i+=1){var a=e[i];if(t[a]!==r[a]||!(a in r))return!1}return!0}var bv=function(r){return typeof r=="object"&&r!==null},Un=function(r){if(!bv(r)||!xa(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t};function cF(r,t){if(!wt(r))return null;var e;if(Yr(t)&&(e=t),Un(t)&&(e=function(i){return eT(i,t)}),e){for(var n=0;n<r.length;n+=1)if(e(r[n]))return r[n]}return null}function dF(r,t,e){e===void 0&&(e=0);for(var n=e;n<r.length;n++)if(t(r[n],n))return n;return-1}var hF=function(r,t){for(var e=null,n=0;n<r.length;n++){var i=r[n],a=i[t];if(!gt(a)){wt(a)?e=a[0]:e=a;break}}return e},vF=function(r){if(!wt(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},tT=function(r,t){if(t===void 0&&(t=[]),!wt(r))t.push(r);else for(var e=0;e<r.length;e+=1)tT(r[e],t);return t};const Qa=function(r){if(wt(r))return r.reduce(function(t,e){return Math.max(t,e)},r[0])},Ja=function(r){if(wt(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])};var rT=function(r){var t=r.filter(function(o){return!isNaN(o)});if(!t.length)return{min:0,max:0};if(wt(r[0])){for(var e=[],n=0;n<r.length;n++)e=e.concat(r[n]);t=e}var i=Qa(t),a=Ja(t);return{min:a,max:i}},nT=Array.prototype,pF=nT.splice,gF=nT.indexOf,yF=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n++)for(var i=t[n],a=-1;(a=gF.call(r,i))>-1;)pF.call(r,a,1);return r},mF=Array.prototype.splice,iT=function(t,e){if(!Ei(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var a=void 0,o=e[n];(n===i||o!==a)&&(a=o,mF.call(t,o,1))}return t},aT=function(r,t,e){if(!wt(r)&&!Un(r))return r;var n=e;return xe(r,function(i,a){n=t(n,i,a)}),n},bF=function(r,t){var e=[];if(!Ei(r))return e;for(var n=-1,i=[],a=r.length;++n<a;){var o=r[n];t(o,n,r)&&(e.push(o),i.push(n))}return iT(r,i),e};const Fe=function(r){return xa(r,"String")};function xF(r,t){var e;if(Yr(t))e=function(i,a){return t(i)-t(a)};else{var n=[];Fe(t)?n.push(t):wt(t)&&(n=t),e=function(i,a){for(var o=0;o<n.length;o+=1){var s=n[o];if(i[s]>a[s])return 1;if(i[s]<a[s])return-1}return 0}}return r.sort(e),r}function lc(r,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];t.has(a)||(e.push(a),t.set(a,!0))}return e}var wF=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return lc([].concat.apply([],r))};const EF=function(r,t){for(var e=[],n={},i=0;i<r.length;i++){var a=r[i],o=a[t];if(!gt(o)){wt(o)||(o=[o]);for(var s=0;s<o.length;s++){var u=o[s];n[u]||(e.push(u),n[u]=!0)}}}return e};function Ka(r){if(Ei(r))return r[0]}function Ji(r){if(Ei(r)){var t=r;return t[t.length-1]}}function _F(r,t){return wt(r)||Fe(r)?r[0]===t:!1}function SF(r,t){return wt(r)||Fe(r)?r[r.length-1]===t:!1}var MF=function(r,t){for(var e=0;e<r.length;e++)if(!t(r[e],e))return!1;return!0},CF=function(r,t){for(var e=0;e<r.length;e++)if(t(r[e],e))return!0;return!1},AF=Object.prototype.hasOwnProperty;function xv(r,t){if(!t||!wt(r))return{};for(var e={},n=Yr(t)?t:function(s){return s[t]},i,a=0;a<r.length;a++){var o=r[a];i=n(o),AF.call(e,i)?e[i].push(o):e[i]=[o]}return e}function oT(r,t){if(!t)return{0:r};if(!Yr(t)){var e=wt(t)?t:t.replace(/\s+/g,"").split("*");t=function(n){for(var i="_",a=0,o=e.length;a<o;a++)i+=n[e[a]]&&n[e[a]].toString();return i}}return xv(r,t)}const TF=function(r,t){if(!t)return[r];var e=oT(r,t),n=[];for(var i in e)n.push(e[i]);return n};function IF(r,t){return r["_wrap_"+t]}function tu(r,t){if(r["_wrap_"+t])return r["_wrap_"+t];var e=function(n){r[t](n)};return r["_wrap_"+t]=e,e}var GE={};function OF(r){var t=GE[r];if(!t){for(var e=r.toString(16),n=e.length;n<6;n++)e="0"+e;t="#"+e,GE[r]=t}return t}function LF(r){var t=0,e=0,n=0,i=0;return wt(r)?r.length===1?t=e=n=i=r[0]:r.length===2?(t=n=r[0],e=i=r[1]):r.length===3?(t=r[0],e=i=r[1],n=r[2]):(t=r[0],e=r[1],n=r[2],i=r[3]):t=e=n=i=r,{r1:t,r2:e,r3:n,r4:i}}var kF=function(r,t,e){return r<t?t:r>e?e:r},jh=function(r,t){var e=t.toString(),n=e.indexOf(".");if(n===-1)return Math.round(r);var i=e.substr(n+1).length;return i>20&&(i=20),parseFloat(r.toFixed(i))},mt=function(r){return xa(r,"Number")},DF=function(r){return mt(r)&&r%1!==0},NF=function(r){return mt(r)&&r%2===0},PF=Number.isInteger?Number.isInteger:function(r){return mt(r)&&r%1===0},RF=function(r){return mt(r)&&r<0},BF=1e-5;function sT(r,t,e){return e===void 0&&(e=BF),Math.abs(r-t)<e}var FF=function(r){return mt(r)&&r%2!==0},zF=function(r){return mt(r)&&r>0};const GF=function(r,t){if(wt(r)){for(var e,n=-1/0,i=0;i<r.length;i++){var a=r[i],o=Yr(t)?t(a):a[t];o>n&&(e=a,n=o)}return e}},$F=function(r,t){if(wt(r)){for(var e,n=1/0,i=0;i<r.length;i++){var a=r[i],o=Yr(t)?t(a):a[t];o<n&&(e=a,n=o)}return e}};var hp=function(r,t){return(r%t+t)%t},UF=180/Math.PI,jF=function(r){return UF*r};const WF=parseInt;var XF=Math.PI/180,vp=function(r){return XF*r};const $E=function(r,t){return r.hasOwnProperty(t)};var b1=Object.values?function(r){return Object.values(r)}:function(r){var t=[];return xe(r,function(e,n){Yr(r)&&n==="prototype"||t.push(e)}),t};const YF=function(r,t){return mv(b1(r),t)},Yl=function(r){return gt(r)?"":r.toString()};var VF=function(r){return Yl(r).toLowerCase()},HF=function(r){var t=Yl(r);return t.charAt(0).toLowerCase()+t.substring(1)};function KF(r,t){return!r||!t?r:r.replace(/\\?\{([^{}]+)\}/g,function(e,n){return e.charAt(0)==="\\"?e.slice(1):t[n]===void 0?"":t[n]})}var qF=function(r){return Yl(r).toUpperCase()},Tl=function(r){var t=Yl(r);return t.charAt(0).toUpperCase()+t.substring(1)},ZF={}.toString,uT=function(r){return ZF.call(r).replace(/^\[object /,"").replace(/]$/,"")},QF=function(r){return xa(r,"Arguments")},Bc=function(r){return xa(r,"Boolean")},x1=function(r){return xa(r,"Date")},JF=function(r){return xa(r,"Error")};function e6(r){return mt(r)&&isFinite(r)}var t6=function(r){return r===null},r6=Object.prototype,lT=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||r6;return r===e},n6=function(r){return xa(r,"RegExp")},i6=function(r){return r===void 0},a6=function(r){return r instanceof Element||r instanceof HTMLDocument};function fT(r){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,16)};return t(r)}function cT(r){var t=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;t(r)}function c0(r,t){for(var e in t)t.hasOwnProperty(e)&&e!=="constructor"&&t[e]!==void 0&&(r[e]=t[e])}function Mt(r,t,e,n){return t&&c0(r,t),e&&c0(r,e),n&&c0(r,n),r}var o6=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var e=r[0],n=1;n<r.length;n++){var i=r[n];Yr(i)&&(i=i.prototype),Mt(e.prototype,i)}},ar=function(r){if(typeof r!="object"||r===null)return r;var t;if(wt(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=ar(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=ar(r[i]):t[i]=r[i]}return t};function Fc(r,t,e){var n;return function(){var i=this,a=arguments,o=function(){n=null,e||r.apply(i,a)},s=e&&!n;clearTimeout(n),n=setTimeout(o,t),s&&r.apply(i,a)}}const dT=function(r,t){if(!Yr(r))throw new TypeError("Expected a function");var e=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=t?t.apply(this,n):n[0],o=e.cache;if(o.has(a))return o.get(a);var s=r.apply(this,n);return o.set(a,s),s};return e.cache=new Map,e};var s6=5;function hT(r,t,e,n){e=e||0,n=n||s6;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];a!==null&&Un(a)?(Un(r[i])||(r[i]={}),e<n?hT(r[i],a,e+1,n):r[i]=t[i]):wt(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var Pr=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)hT(r,t[n]);return r},u6=function(r,t,e,n){Yr(t)||(e=t,t=r,r=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function u(){}u.prototype=o;var l=new u;return l.constructor=s,l},a=i(t.prototype,r);return r.prototype=Mt(a,r.prototype),r.superclass=i(t.prototype,t),Mt(a,e),Mt(r,n),r},w1=function(r,t){if(!Ei(r))return-1;var e=Array.prototype.indexOf;if(e)return e.call(r,t);for(var n=-1,i=0;i<r.length;i++)if(r[i]===t){n=i;break}return n},l6=Object.prototype.hasOwnProperty;function vT(r){if(gt(r))return!0;if(Ei(r))return!r.length;var t=uT(r);if(t==="Map"||t==="Set")return!r.size;if(lT(r))return!Object.keys(r).length;for(var e in r)if(l6.call(r,e))return!1;return!0}var ms=function(r,t){if(r===t)return!0;if(!r||!t||Fe(r)||Fe(t))return!1;if(Ei(r)||Ei(t)){if(r.length!==t.length)return!1;for(var e=!0,n=0;n<r.length&&(e=ms(r[n],t[n]),!!e);n++);return e}if(bv(r)||bv(t)){var i=Object.keys(r),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,n=0;n<i.length&&(e=ms(r[i[n]],t[i[n]]),!!e);n++);return e}return!1};const f6=function(r,t,e){return Yr(e)?!!e(r,t):ms(r,t)};var cu=function(r,t){if(!Ei(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];e.push(t(i,n))}return e},c6=function(r){return r};const d6=function(r,t){t===void 0&&(t=c6);var e={};return Wn(r)&&!gt(r)&&Object.keys(r).forEach(function(n){e[n]=t(r[n],n)}),e},Co=function(r,t,e){for(var n=0,i=Fe(t)?t.split("."):t;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?e:r},h6=function(r,t,e){var n=r,i=Fe(t)?t.split("."):t;return i.forEach(function(a,o){o<i.length-1?(Wn(n[a])||(n[a]=mt(i[o+1])?[]:{}),n=n[a]):n[a]=e}),r};var v6=Object.prototype.hasOwnProperty;const p6=function(r,t){if(r===null||!Un(r))return{};var e={};return xe(t,function(n){v6.call(r,n)&&(e[n]=r[n])}),e},g6=function(r,t){return aT(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})},fc=function(r,t,e){var n,i,a,o,s=0;e||(e={});var u=function(){s=e.leading===!1?0:Date.now(),n=null,o=r.apply(i,a),n||(i=a=null)},l=function(){var f=Date.now();!s&&e.leading===!1&&(s=f);var c=t-(f-s);return i=this,a=arguments,c<=0||c>t?(n&&(clearTimeout(n),n=null),s=f,o=r.apply(i,a),n||(i=a=null)):!n&&e.trailing!==!1&&(n=setTimeout(u,c)),o};return l.cancel=function(){clearTimeout(n),s=0,n=i=a=null},l},pT=function(r){return Ei(r)?Array.prototype.slice.call(r):[]};var Wd={};const eo=function(r){return r=r||"g",Wd[r]?Wd[r]+=1:Wd[r]=1,r+Wd[r]},Bf=function(){},y6=function(r){return r};function pp(r){return gt(r)?0:Ei(r)?r.length:Object.keys(r).length}var Xd;const Ff=dT(function(r,t){t===void 0&&(t={});var e=t.fontSize,n=t.fontFamily,i=t.fontWeight,a=t.fontStyle,o=t.fontVariant;return Xd||(Xd=document.createElement("canvas").getContext("2d")),Xd.font=[a,o,i,e+"px",n].join(" "),Xd.measureText(Fe(r)?r:"").width},function(r,t){return t===void 0&&(t={}),cp([r],b1(t)).join("")}),m6=function(r,t,e,n){n===void 0&&(n="...");var i=16,a=Ff(n,e),o=Fe(r)?r:Yl(r),s=t,u=[],l,f;if(Ff(r,e)<=t)return r;for(;l=o.substr(0,i),f=Ff(l,e),!(f+a>s&&f>s);)if(u.push(l),s-=f,o=o.substr(i),!o)return u.join("");for(;l=o.substr(0,1),f=Ff(l,e),!(f+a>s);)if(u.push(l),s-=f,o=o.substr(1),!o)return u.join("");return""+u.join("")+n};var b6=function(){function r(){this.map={}}return r.prototype.has=function(t){return this.map[t]!==void 0},r.prototype.get=function(t,e){var n=this.map[t];return n===void 0?e:n},r.prototype.set=function(t,e){this.map[t]=e},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(t){delete this.map[t]},r.prototype.size=function(){return Object.keys(this.map).length},r}();const x6=Object.freeze(Object.defineProperty({__proto__:null,Cache:b6,assign:Mt,augment:o6,clamp:kF,clearAnimationFrame:cT,clone:ar,contains:mv,debounce:Fc,deepMix:Pr,difference:lF,each:xe,endsWith:SF,every:MF,extend:u6,filter:dp,find:cF,findIndex:dF,firstValue:hF,fixedBase:jh,flatten:vF,flattenDeep:tT,forIn:xe,get:Co,getEllipsisText:m6,getRange:rT,getType:uT,getWrapBehavior:IF,group:TF,groupBy:xv,groupToMap:oT,has:$E,hasKey:$E,hasValue:YF,head:Ka,identity:y6,includes:mv,indexOf:w1,isArguments:QF,isArray:wt,isArrayLike:Ei,isBoolean:Bc,isDate:x1,isDecimal:DF,isElement:a6,isEmpty:vT,isEqual:ms,isEqualWith:f6,isError:JF,isEven:NF,isFinite:e6,isFunction:Yr,isInteger:PF,isMatch:eT,isNegative:RF,isNil:gt,isNull:t6,isNumber:mt,isNumberEqual:sT,isObject:Wn,isObjectLike:bv,isOdd:FF,isPlainObject:Un,isPositive:zF,isPrototype:lT,isRegExp:n6,isString:Fe,isType:xa,isUndefined:i6,keys:JA,last:Ji,lowerCase:VF,lowerFirst:HF,map:cu,mapValues:d6,max:Qa,maxBy:GF,measureTextWidth:Ff,memoize:dT,min:Ja,minBy:$F,mix:Mt,mod:hp,noop:Bf,number2color:OF,omit:g6,parseRadius:LF,pick:p6,pull:yF,pullAt:iT,reduce:aT,remove:bF,requestAnimationFrame:fT,set:h6,size:pp,some:CF,sortBy:xF,startsWith:_F,substitute:KF,throttle:fc,toArray:pT,toDegree:jF,toInteger:WF,toRadian:vp,toString:Yl,union:wF,uniq:lc,uniqueId:eo,upperCase:qF,upperFirst:Tl,values:b1,valuesOfKey:EF,wrapBehavior:tu},Symbol.toStringTag,{value:"Module"})),w6={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(t){return Object.assign(this,t),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(t){var e=this,n=this.events;this.graph=t,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!0),xe(n,function(i,a){t.on(a,i)}),document.addEventListener("visibilitychange",function(){e.keydown=!1})},unbind:function(t){var e=this.events,n=t.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!1),xe(e,function(i,a){t.off(a,i)}),t.get("canvas").set("draggable",n)},get:function(t){return this[t]},set:function(t,e){return this[t]=e,this}};var E1=function(){function r(){}return r.registerBehavior=function(t,e){if(!e)throw new Error("please specify handler for this behavior: ".concat(t));var n=ar(w6);Object.assign(n,e);var i=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var u=this.getEvents();this.events=null;var l={};u&&(xe(u,function(f,c){l[c]=tu(s,f)}),this.events=l)};i.prototype=n,r.types[t]=i},r.hasBehavior=function(t){return!!r.types[t]},r.getBehavior=function(t){return r.types[t]},r.types={},r}(),E6="*",gT=function(){function r(){this._events={}}return r.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},r.prototype.once=function(t,e){return this.on(t,e,!0)},r.prototype.emit=function(t){for(var e=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this._events[t]||[],o=this._events[E6]||[],s=function(u){for(var l=u.length,f=0;f<l;f++)if(u[f]){var c=u[f],d=c.callback,h=c.once;h&&(u.splice(f,1),u.length===0&&delete e._events[t],l--,f--),d.apply(e,n)}};s(a),s(o)},r.prototype.off=function(t,e){if(!t)this._events={};else if(!e)delete this._events[t];else{for(var n=this._events[t]||[],i=n.length,a=0;a<i;a++)n[a].callback===e&&(n.splice(a,1),i--,a--);n.length===0&&delete this._events[t]}return this},r.prototype.getEvents=function(){return this._events},r}(),It=1e-6,vr=typeof Float32Array<"u"?Float32Array:Array,va=Math.random;function _6(r){vr=r}var S6=Math.PI/180;function M6(r){return r*S6}function C6(r,t){return Math.abs(r-t)<=It*Math.max(1,Math.abs(r),Math.abs(t))}Math.hypot||(Math.hypot=function(){for(var r=0,t=arguments.length;t--;)r+=arguments[t]*arguments[t];return Math.sqrt(r)});const A6=Object.freeze(Object.defineProperty({__proto__:null,get ARRAY_TYPE(){return vr},EPSILON:It,RANDOM:va,equals:C6,setMatrixArrayType:_6,toRadian:M6},Symbol.toStringTag,{value:"Module"}));function T6(){var r=new vr(4);return vr!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}function I6(r){var t=new vr(4);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function O6(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function L6(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}function k6(r,t,e,n){var i=new vr(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function D6(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function N6(r,t){if(r===t){var e=t[1];r[1]=t[2],r[2]=e}else r[0]=t[0],r[1]=t[2],r[2]=t[1],r[3]=t[3];return r}function P6(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*a-i*n;return o?(o=1/o,r[0]=a*o,r[1]=-n*o,r[2]=-i*o,r[3]=e*o,r):null}function R6(r,t){var e=t[0];return r[0]=t[3],r[1]=-t[1],r[2]=-t[2],r[3]=e,r}function B6(r){return r[0]*r[3]-r[2]*r[1]}function yT(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],l=e[2],f=e[3];return r[0]=n*s+a*u,r[1]=i*s+o*u,r[2]=n*l+a*f,r[3]=i*l+o*f,r}function F6(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+a*s,r[1]=i*u+o*s,r[2]=n*-s+a*u,r[3]=i*-s+o*u,r}function z6(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1];return r[0]=n*s,r[1]=i*s,r[2]=a*u,r[3]=o*u,r}function G6(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=-e,r[3]=n,r}function $6(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r}function U6(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function j6(r){return Math.hypot(r[0],r[1],r[2],r[3])}function W6(r,t,e,n){return r[2]=n[2]/n[0],e[0]=n[0],e[1]=n[1],e[3]=n[3]-r[2]*e[1],[r,t,e]}function X6(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function mT(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r}function Y6(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function V6(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=t[0],s=t[1],u=t[2],l=t[3];return Math.abs(e-o)<=It*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=It*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=It*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-l)<=It*Math.max(1,Math.abs(a),Math.abs(l))}function H6(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function K6(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r}var q6=yT,Z6=mT;const Q6=Object.freeze(Object.defineProperty({__proto__:null,LDU:W6,add:X6,adjoint:R6,clone:I6,copy:O6,create:T6,determinant:B6,equals:V6,exactEquals:Y6,frob:j6,fromRotation:G6,fromScaling:$6,fromValues:k6,identity:L6,invert:P6,mul:q6,multiply:yT,multiplyScalar:H6,multiplyScalarAndAdd:K6,rotate:F6,scale:z6,set:D6,str:U6,sub:Z6,subtract:mT,transpose:N6},Symbol.toStringTag,{value:"Module"}));function J6(){var r=new vr(6);return vr!=Float32Array&&(r[1]=0,r[2]=0,r[4]=0,r[5]=0),r[0]=1,r[3]=1,r}function ez(r){var t=new vr(6);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t}function tz(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function rz(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function nz(r,t,e,n,i,a){var o=new vr(6);return o[0]=r,o[1]=t,o[2]=e,o[3]=n,o[4]=i,o[5]=a,o}function iz(r,t,e,n,i,a,o){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r}function az(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=e*a-n*i;return u?(u=1/u,r[0]=a*u,r[1]=-n*u,r[2]=-i*u,r[3]=e*u,r[4]=(i*s-a*o)*u,r[5]=(n*o-e*s)*u,r):null}function oz(r){return r[0]*r[3]-r[1]*r[2]}function bT(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=e[0],f=e[1],c=e[2],d=e[3],h=e[4],v=e[5];return r[0]=n*l+a*f,r[1]=i*l+o*f,r[2]=n*c+a*d,r[3]=i*c+o*d,r[4]=n*h+a*v+s,r[5]=i*h+o*v+u,r}function sz(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=Math.sin(e),f=Math.cos(e);return r[0]=n*f+a*l,r[1]=i*f+o*l,r[2]=n*-l+a*f,r[3]=i*-l+o*f,r[4]=s,r[5]=u,r}function uz(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=e[0],f=e[1];return r[0]=n*l,r[1]=i*l,r[2]=a*f,r[3]=o*f,r[4]=s,r[5]=u,r}function lz(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=e[0],f=e[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=n*l+a*f+s,r[5]=i*l+o*f+u,r}function fz(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=-e,r[3]=n,r[4]=0,r[5]=0,r}function cz(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r[4]=0,r[5]=0,r}function dz(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=t[0],r[5]=t[1],r}function hz(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"}function vz(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],1)}function pz(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r}function xT(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r}function gz(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r}function yz(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r}function mz(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]}function bz(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=t[0],l=t[1],f=t[2],c=t[3],d=t[4],h=t[5];return Math.abs(e-u)<=It*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(n-l)<=It*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=It*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-c)<=It*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-d)<=It*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(s-h)<=It*Math.max(1,Math.abs(s),Math.abs(h))}var xz=bT,wz=xT;const Ez=Object.freeze(Object.defineProperty({__proto__:null,add:pz,clone:ez,copy:tz,create:J6,determinant:oz,equals:bz,exactEquals:mz,frob:vz,fromRotation:fz,fromScaling:cz,fromTranslation:dz,fromValues:nz,identity:rz,invert:az,mul:xz,multiply:bT,multiplyScalar:gz,multiplyScalarAndAdd:yz,rotate:sz,scale:uz,set:iz,str:hz,sub:wz,subtract:xT,translate:lz},Symbol.toStringTag,{value:"Module"}));function wT(){var r=new vr(9);return vr!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function _z(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[4],r[4]=t[5],r[5]=t[6],r[6]=t[8],r[7]=t[9],r[8]=t[10],r}function Sz(r){var t=new vr(9);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t}function Mz(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function Cz(r,t,e,n,i,a,o,s,u){var l=new vr(9);return l[0]=r,l[1]=t,l[2]=e,l[3]=n,l[4]=i,l[5]=a,l[6]=o,l[7]=s,l[8]=u,l}function Az(r,t,e,n,i,a,o,s,u,l){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=l,r}function Tz(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function Iz(r,t){if(r===t){var e=t[1],n=t[2],i=t[5];r[1]=t[3],r[2]=t[6],r[3]=e,r[5]=t[7],r[6]=n,r[7]=i}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r}function _1(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8],c=f*o-s*l,d=-f*a+s*u,h=l*a-o*u,v=e*c+n*d+i*h;return v?(v=1/v,r[0]=c*v,r[1]=(-f*n+i*l)*v,r[2]=(s*n-i*o)*v,r[3]=d*v,r[4]=(f*e-i*u)*v,r[5]=(-s*e+i*a)*v,r[6]=h*v,r[7]=(-l*e+n*u)*v,r[8]=(o*e-n*a)*v,r):null}function Oz(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8];return r[0]=o*f-s*l,r[1]=i*l-n*f,r[2]=n*s-i*o,r[3]=s*u-a*f,r[4]=e*f-i*u,r[5]=i*a-e*s,r[6]=a*l-o*u,r[7]=n*u-e*l,r[8]=e*o-n*a,r}function Lz(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],l=r[8];return t*(l*a-o*u)+e*(-l*i+o*s)+n*(u*i-a*s)}function no(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=t[8],d=e[0],h=e[1],v=e[2],p=e[3],g=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return r[0]=d*n+h*o+v*l,r[1]=d*i+h*s+v*f,r[2]=d*a+h*u+v*c,r[3]=p*n+g*o+y*l,r[4]=p*i+g*s+y*f,r[5]=p*a+g*u+y*c,r[6]=m*n+b*o+x*l,r[7]=m*i+b*s+x*f,r[8]=m*a+b*u+x*c,r}function kz(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=t[8],d=e[0],h=e[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=u,r[6]=d*n+h*o+l,r[7]=d*i+h*s+f,r[8]=d*a+h*u+c,r}function Dz(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=t[8],d=Math.sin(e),h=Math.cos(e);return r[0]=h*n+d*o,r[1]=h*i+d*s,r[2]=h*a+d*u,r[3]=h*o-d*n,r[4]=h*s-d*i,r[5]=h*u-d*a,r[6]=l,r[7]=f,r[8]=c,r}function Nz(r,t,e){var n=e[0],i=e[1];return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=i*t[3],r[4]=i*t[4],r[5]=i*t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function S1(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=t[0],r[7]=t[1],r[8]=1,r}function M1(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=-e,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function C1(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=t[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function Pz(r,t){return r[0]=t[0],r[1]=t[1],r[2]=0,r[3]=t[2],r[4]=t[3],r[5]=0,r[6]=t[4],r[7]=t[5],r[8]=1,r}function Rz(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e+e,s=n+n,u=i+i,l=e*o,f=n*o,c=n*s,d=i*o,h=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[3]=f-y,r[6]=d+g,r[1]=f+y,r[4]=1-l-v,r[7]=h-p,r[2]=d-g,r[5]=h+p,r[8]=1-l-c,r}function Bz(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8],c=t[9],d=t[10],h=t[11],v=t[12],p=t[13],g=t[14],y=t[15],m=e*s-n*o,b=e*u-i*o,x=e*l-a*o,w=n*u-i*s,E=n*l-a*s,_=i*l-a*u,M=f*p-c*v,C=f*g-d*v,S=f*y-h*v,A=c*g-d*p,T=c*y-h*p,I=d*y-h*g,k=m*I-b*T+x*A+w*S-E*C+_*M;return k?(k=1/k,r[0]=(s*I-u*T+l*A)*k,r[1]=(u*S-o*I-l*C)*k,r[2]=(o*T-s*S+l*M)*k,r[3]=(i*T-n*I-a*A)*k,r[4]=(e*I-i*S+a*C)*k,r[5]=(n*S-e*T-a*M)*k,r[6]=(p*_-g*E+y*w)*k,r[7]=(g*x-v*_-y*b)*k,r[8]=(v*E-p*x+y*m)*k,r):null}function Fz(r,t,e){return r[0]=2/t,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/e,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}function zz(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function Gz(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function $z(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r}function ET(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r}function Uz(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r}function jz(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r}function Wz(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]}function Xz(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],c=t[0],d=t[1],h=t[2],v=t[3],p=t[4],g=t[5],y=t[6],m=t[7],b=t[8];return Math.abs(e-c)<=It*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(n-d)<=It*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-h)<=It*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-v)<=It*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=It*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=It*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=It*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(l-m)<=It*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(f-b)<=It*Math.max(1,Math.abs(f),Math.abs(b))}var Yz=no,Vz=ET;const _T=Object.freeze(Object.defineProperty({__proto__:null,add:$z,adjoint:Oz,clone:Sz,copy:Mz,create:wT,determinant:Lz,equals:Xz,exactEquals:Wz,frob:Gz,fromMat2d:Pz,fromMat4:_z,fromQuat:Rz,fromRotation:M1,fromScaling:C1,fromTranslation:S1,fromValues:Cz,identity:Tz,invert:_1,mul:Yz,multiply:no,multiplyScalar:Uz,multiplyScalarAndAdd:jz,normalFromMat4:Bz,projection:Fz,rotate:Dz,scale:Nz,set:Az,str:zz,sub:Vz,subtract:ET,translate:kz,transpose:Iz},Symbol.toStringTag,{value:"Module"}));function Hz(){var r=new vr(16);return vr!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function Kz(r){var t=new vr(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}function qz(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function Zz(r,t,e,n,i,a,o,s,u,l,f,c,d,h,v,p){var g=new vr(16);return g[0]=r,g[1]=t,g[2]=e,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=l,g[10]=f,g[11]=c,g[12]=d,g[13]=h,g[14]=v,g[15]=p,g}function Qz(r,t,e,n,i,a,o,s,u,l,f,c,d,h,v,p,g){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r[8]=l,r[9]=f,r[10]=c,r[11]=d,r[12]=h,r[13]=v,r[14]=p,r[15]=g,r}function ST(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Jz(r,t){if(r===t){var e=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=e,r[6]=t[9],r[7]=t[13],r[8]=n,r[9]=a,r[11]=t[14],r[12]=i,r[13]=o,r[14]=s}else r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=t[1],r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=t[2],r[9]=t[6],r[10]=t[10],r[11]=t[14],r[12]=t[3],r[13]=t[7],r[14]=t[11],r[15]=t[15];return r}function eG(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8],c=t[9],d=t[10],h=t[11],v=t[12],p=t[13],g=t[14],y=t[15],m=e*s-n*o,b=e*u-i*o,x=e*l-a*o,w=n*u-i*s,E=n*l-a*s,_=i*l-a*u,M=f*p-c*v,C=f*g-d*v,S=f*y-h*v,A=c*g-d*p,T=c*y-h*p,I=d*y-h*g,k=m*I-b*T+x*A+w*S-E*C+_*M;return k?(k=1/k,r[0]=(s*I-u*T+l*A)*k,r[1]=(i*T-n*I-a*A)*k,r[2]=(p*_-g*E+y*w)*k,r[3]=(d*E-c*_-h*w)*k,r[4]=(u*S-o*I-l*C)*k,r[5]=(e*I-i*S+a*C)*k,r[6]=(g*x-v*_-y*b)*k,r[7]=(f*_-d*x+h*b)*k,r[8]=(o*T-s*S+l*M)*k,r[9]=(n*S-e*T-a*M)*k,r[10]=(v*E-p*x+y*m)*k,r[11]=(c*x-f*E-h*m)*k,r[12]=(s*C-o*A-u*M)*k,r[13]=(e*A-n*C+i*M)*k,r[14]=(p*b-v*w-g*m)*k,r[15]=(f*w-c*b+d*m)*k,r):null}function tG(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8],c=t[9],d=t[10],h=t[11],v=t[12],p=t[13],g=t[14],y=t[15];return r[0]=s*(d*y-h*g)-c*(u*y-l*g)+p*(u*h-l*d),r[1]=-(n*(d*y-h*g)-c*(i*y-a*g)+p*(i*h-a*d)),r[2]=n*(u*y-l*g)-s*(i*y-a*g)+p*(i*l-a*u),r[3]=-(n*(u*h-l*d)-s*(i*h-a*d)+c*(i*l-a*u)),r[4]=-(o*(d*y-h*g)-f*(u*y-l*g)+v*(u*h-l*d)),r[5]=e*(d*y-h*g)-f*(i*y-a*g)+v*(i*h-a*d),r[6]=-(e*(u*y-l*g)-o*(i*y-a*g)+v*(i*l-a*u)),r[7]=e*(u*h-l*d)-o*(i*h-a*d)+f*(i*l-a*u),r[8]=o*(c*y-h*p)-f*(s*y-l*p)+v*(s*h-l*c),r[9]=-(e*(c*y-h*p)-f*(n*y-a*p)+v*(n*h-a*c)),r[10]=e*(s*y-l*p)-o*(n*y-a*p)+v*(n*l-a*s),r[11]=-(e*(s*h-l*c)-o*(n*h-a*c)+f*(n*l-a*s)),r[12]=-(o*(c*g-d*p)-f*(s*g-u*p)+v*(s*d-u*c)),r[13]=e*(c*g-d*p)-f*(n*g-i*p)+v*(n*d-i*c),r[14]=-(e*(s*g-u*p)-o*(n*g-i*p)+v*(n*u-i*s)),r[15]=e*(s*d-u*c)-o*(n*d-i*c)+f*(n*u-i*s),r}function rG(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],o=r[5],s=r[6],u=r[7],l=r[8],f=r[9],c=r[10],d=r[11],h=r[12],v=r[13],p=r[14],g=r[15],y=t*o-e*a,m=t*s-n*a,b=t*u-i*a,x=e*s-n*o,w=e*u-i*o,E=n*u-i*s,_=l*v-f*h,M=l*p-c*h,C=l*g-d*h,S=f*p-c*v,A=f*g-d*v,T=c*g-d*p;return y*T-m*A+b*S+x*C-w*M+E*_}function MT(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=t[8],d=t[9],h=t[10],v=t[11],p=t[12],g=t[13],y=t[14],m=t[15],b=e[0],x=e[1],w=e[2],E=e[3];return r[0]=b*n+x*s+w*c+E*p,r[1]=b*i+x*u+w*d+E*g,r[2]=b*a+x*l+w*h+E*y,r[3]=b*o+x*f+w*v+E*m,b=e[4],x=e[5],w=e[6],E=e[7],r[4]=b*n+x*s+w*c+E*p,r[5]=b*i+x*u+w*d+E*g,r[6]=b*a+x*l+w*h+E*y,r[7]=b*o+x*f+w*v+E*m,b=e[8],x=e[9],w=e[10],E=e[11],r[8]=b*n+x*s+w*c+E*p,r[9]=b*i+x*u+w*d+E*g,r[10]=b*a+x*l+w*h+E*y,r[11]=b*o+x*f+w*v+E*m,b=e[12],x=e[13],w=e[14],E=e[15],r[12]=b*n+x*s+w*c+E*p,r[13]=b*i+x*u+w*d+E*g,r[14]=b*a+x*l+w*h+E*y,r[15]=b*o+x*f+w*v+E*m,r}function nG(r,t,e){var n=e[0],i=e[1],a=e[2],o,s,u,l,f,c,d,h,v,p,g,y;return t===r?(r[12]=t[0]*n+t[4]*i+t[8]*a+t[12],r[13]=t[1]*n+t[5]*i+t[9]*a+t[13],r[14]=t[2]*n+t[6]*i+t[10]*a+t[14],r[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],l=t[3],f=t[4],c=t[5],d=t[6],h=t[7],v=t[8],p=t[9],g=t[10],y=t[11],r[0]=o,r[1]=s,r[2]=u,r[3]=l,r[4]=f,r[5]=c,r[6]=d,r[7]=h,r[8]=v,r[9]=p,r[10]=g,r[11]=y,r[12]=o*n+f*i+v*a+t[12],r[13]=s*n+c*i+p*a+t[13],r[14]=u*n+d*i+g*a+t[14],r[15]=l*n+h*i+y*a+t[15]),r}function iG(r,t,e){var n=e[0],i=e[1],a=e[2];return r[0]=t[0]*n,r[1]=t[1]*n,r[2]=t[2]*n,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*i,r[6]=t[6]*i,r[7]=t[7]*i,r[8]=t[8]*a,r[9]=t[9]*a,r[10]=t[10]*a,r[11]=t[11]*a,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function aG(r,t,e,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),u,l,f,c,d,h,v,p,g,y,m,b,x,w,E,_,M,C,S,A,T,I,k,P;return s<It?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(e),l=Math.cos(e),f=1-l,c=t[0],d=t[1],h=t[2],v=t[3],p=t[4],g=t[5],y=t[6],m=t[7],b=t[8],x=t[9],w=t[10],E=t[11],_=i*i*f+l,M=a*i*f+o*u,C=o*i*f-a*u,S=i*a*f-o*u,A=a*a*f+l,T=o*a*f+i*u,I=i*o*f+a*u,k=a*o*f-i*u,P=o*o*f+l,r[0]=c*_+p*M+b*C,r[1]=d*_+g*M+x*C,r[2]=h*_+y*M+w*C,r[3]=v*_+m*M+E*C,r[4]=c*S+p*A+b*T,r[5]=d*S+g*A+x*T,r[6]=h*S+y*A+w*T,r[7]=v*S+m*A+E*T,r[8]=c*I+p*k+b*P,r[9]=d*I+g*k+x*P,r[10]=h*I+y*k+w*P,r[11]=v*I+m*k+E*P,t!==r&&(r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r)}function oG(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],f=t[9],c=t[10],d=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=a*i+l*n,r[5]=o*i+f*n,r[6]=s*i+c*n,r[7]=u*i+d*n,r[8]=l*i-a*n,r[9]=f*i-o*n,r[10]=c*i-s*n,r[11]=d*i-u*n,r}function sG(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],o=t[1],s=t[2],u=t[3],l=t[8],f=t[9],c=t[10],d=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i-l*n,r[1]=o*i-f*n,r[2]=s*i-c*n,r[3]=u*i-d*n,r[8]=a*n+l*i,r[9]=o*n+f*i,r[10]=s*n+c*i,r[11]=u*n+d*i,r}function uG(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],o=t[1],s=t[2],u=t[3],l=t[4],f=t[5],c=t[6],d=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i+l*n,r[1]=o*i+f*n,r[2]=s*i+c*n,r[3]=u*i+d*n,r[4]=l*i-a*n,r[5]=f*i-o*n,r[6]=c*i-s*n,r[7]=d*i-u*n,r}function lG(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function fG(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function cG(r,t,e){var n=e[0],i=e[1],a=e[2],o=Math.hypot(n,i,a),s,u,l;return o<It?null:(o=1/o,n*=o,i*=o,a*=o,s=Math.sin(t),u=Math.cos(t),l=1-u,r[0]=n*n*l+u,r[1]=i*n*l+a*s,r[2]=a*n*l-i*s,r[3]=0,r[4]=n*i*l-a*s,r[5]=i*i*l+u,r[6]=a*i*l+n*s,r[7]=0,r[8]=n*a*l+i*s,r[9]=i*a*l-n*s,r[10]=a*a*l+u,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}function dG(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=e,r[7]=0,r[8]=0,r[9]=-e,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function hG(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=0,r[2]=-e,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=e,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function vG(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=0,r[4]=-e,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function CT(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,l=a+a,f=n*s,c=n*u,d=n*l,h=i*u,v=i*l,p=a*l,g=o*s,y=o*u,m=o*l;return r[0]=1-(h+p),r[1]=c+m,r[2]=d-y,r[3]=0,r[4]=c-m,r[5]=1-(f+p),r[6]=v+g,r[7]=0,r[8]=d+y,r[9]=v-g,r[10]=1-(f+h),r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function pG(r,t){var e=new vr(3),n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=n*n+i*i+a*a+o*o;return c>0?(e[0]=(s*o+f*n+u*a-l*i)*2/c,e[1]=(u*o+f*i+l*n-s*a)*2/c,e[2]=(l*o+f*a+s*i-u*n)*2/c):(e[0]=(s*o+f*n+u*a-l*i)*2,e[1]=(u*o+f*i+l*n-s*a)*2,e[2]=(l*o+f*a+s*i-u*n)*2),CT(r,t,e),r}function AT(r,t){return r[0]=t[12],r[1]=t[13],r[2]=t[14],r}function TT(r,t){var e=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],l=t[9],f=t[10];return r[0]=Math.hypot(e,n,i),r[1]=Math.hypot(a,o,s),r[2]=Math.hypot(u,l,f),r}function IT(r,t){var e=new vr(3);TT(e,t);var n=1/e[0],i=1/e[1],a=1/e[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,l=t[4]*n,f=t[5]*i,c=t[6]*a,d=t[8]*n,h=t[9]*i,v=t[10]*a,p=o+f+v,g=0;return p>0?(g=Math.sqrt(p+1)*2,r[3]=.25*g,r[0]=(c-h)/g,r[1]=(d-u)/g,r[2]=(s-l)/g):o>f&&o>v?(g=Math.sqrt(1+o-f-v)*2,r[3]=(c-h)/g,r[0]=.25*g,r[1]=(s+l)/g,r[2]=(d+u)/g):f>v?(g=Math.sqrt(1+f-o-v)*2,r[3]=(d-u)/g,r[0]=(s+l)/g,r[1]=.25*g,r[2]=(c+h)/g):(g=Math.sqrt(1+v-o-f)*2,r[3]=(s-l)/g,r[0]=(d+u)/g,r[1]=(c+h)/g,r[2]=.25*g),r}function gG(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,l=a+a,f=o+o,c=i*u,d=i*l,h=i*f,v=a*l,p=a*f,g=o*f,y=s*u,m=s*l,b=s*f,x=n[0],w=n[1],E=n[2];return r[0]=(1-(v+g))*x,r[1]=(d+b)*x,r[2]=(h-m)*x,r[3]=0,r[4]=(d-b)*w,r[5]=(1-(c+g))*w,r[6]=(p+y)*w,r[7]=0,r[8]=(h+m)*E,r[9]=(p-y)*E,r[10]=(1-(c+v))*E,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function yG(r,t,e,n,i){var a=t[0],o=t[1],s=t[2],u=t[3],l=a+a,f=o+o,c=s+s,d=a*l,h=a*f,v=a*c,p=o*f,g=o*c,y=s*c,m=u*l,b=u*f,x=u*c,w=n[0],E=n[1],_=n[2],M=i[0],C=i[1],S=i[2],A=(1-(p+y))*w,T=(h+x)*w,I=(v-b)*w,k=(h-x)*E,P=(1-(d+y))*E,N=(g+m)*E,z=(v+b)*_,W=(g-m)*_,D=(1-(d+p))*_;return r[0]=A,r[1]=T,r[2]=I,r[3]=0,r[4]=k,r[5]=P,r[6]=N,r[7]=0,r[8]=z,r[9]=W,r[10]=D,r[11]=0,r[12]=e[0]+M-(A*M+k*C+z*S),r[13]=e[1]+C-(T*M+P*C+W*S),r[14]=e[2]+S-(I*M+N*C+D*S),r[15]=1,r}function mG(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e+e,s=n+n,u=i+i,l=e*o,f=n*o,c=n*s,d=i*o,h=i*s,v=i*u,p=a*o,g=a*s,y=a*u;return r[0]=1-c-v,r[1]=f+y,r[2]=d-g,r[3]=0,r[4]=f-y,r[5]=1-l-v,r[6]=h+p,r[7]=0,r[8]=d+g,r[9]=h-p,r[10]=1-l-c,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function bG(r,t,e,n,i,a,o){var s=1/(e-t),u=1/(i-n),l=1/(a-o);return r[0]=a*2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*u,r[6]=0,r[7]=0,r[8]=(e+t)*s,r[9]=(i+n)*u,r[10]=(o+a)*l,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*a*2*l,r[15]=0,r}function OT(r,t,e,n,i){var a=1/Math.tan(t/2),o;return r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=(i+n)*o,r[14]=2*i*n*o):(r[10]=-1,r[14]=-2*n),r}var xG=OT;function wG(r,t,e,n,i){var a=1/Math.tan(t/2),o;return r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0?(o=1/(n-i),r[10]=i*o,r[14]=i*n*o):(r[10]=-1,r[14]=-n),r}function EG(r,t,e,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),l=2/(i+a);return r[0]=u,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=l,r[6]=0,r[7]=0,r[8]=-((o-s)*u*.5),r[9]=(i-a)*l*.5,r[10]=n/(e-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*e/(e-n),r[15]=0,r}function LT(r,t,e,n,i,a,o){var s=1/(t-e),u=1/(n-i),l=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*l,r[11]=0,r[12]=(t+e)*s,r[13]=(i+n)*u,r[14]=(o+a)*l,r[15]=1,r}var _G=LT;function SG(r,t,e,n,i,a,o){var s=1/(t-e),u=1/(n-i),l=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*u,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=l,r[11]=0,r[12]=(t+e)*s,r[13]=(i+n)*u,r[14]=a*l,r[15]=1,r}function MG(r,t,e,n){var i,a,o,s,u,l,f,c,d,h,v=t[0],p=t[1],g=t[2],y=n[0],m=n[1],b=n[2],x=e[0],w=e[1],E=e[2];return Math.abs(v-x)<It&&Math.abs(p-w)<It&&Math.abs(g-E)<It?ST(r):(f=v-x,c=p-w,d=g-E,h=1/Math.hypot(f,c,d),f*=h,c*=h,d*=h,i=m*d-b*c,a=b*f-y*d,o=y*c-m*f,h=Math.hypot(i,a,o),h?(h=1/h,i*=h,a*=h,o*=h):(i=0,a=0,o=0),s=c*o-d*a,u=d*i-f*o,l=f*a-c*i,h=Math.hypot(s,u,l),h?(h=1/h,s*=h,u*=h,l*=h):(s=0,u=0,l=0),r[0]=i,r[1]=s,r[2]=f,r[3]=0,r[4]=a,r[5]=u,r[6]=c,r[7]=0,r[8]=o,r[9]=l,r[10]=d,r[11]=0,r[12]=-(i*v+a*p+o*g),r[13]=-(s*v+u*p+l*g),r[14]=-(f*v+c*p+d*g),r[15]=1,r)}function CG(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],l=n[2],f=i-e[0],c=a-e[1],d=o-e[2],h=f*f+c*c+d*d;h>0&&(h=1/Math.sqrt(h),f*=h,c*=h,d*=h);var v=u*d-l*c,p=l*f-s*d,g=s*c-u*f;return h=v*v+p*p+g*g,h>0&&(h=1/Math.sqrt(h),v*=h,p*=h,g*=h),r[0]=v,r[1]=p,r[2]=g,r[3]=0,r[4]=c*g-d*p,r[5]=d*v-f*g,r[6]=f*p-c*v,r[7]=0,r[8]=f,r[9]=c,r[10]=d,r[11]=0,r[12]=i,r[13]=a,r[14]=o,r[15]=1,r}function AG(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function TG(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}function IG(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r}function kT(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r}function OG(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r}function LG(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r[9]=t[9]+e[9]*n,r[10]=t[10]+e[10]*n,r[11]=t[11]+e[11]*n,r[12]=t[12]+e[12]*n,r[13]=t[13]+e[13]*n,r[14]=t[14]+e[14]*n,r[15]=t[15]+e[15]*n,r}function kG(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]&&r[9]===t[9]&&r[10]===t[10]&&r[11]===t[11]&&r[12]===t[12]&&r[13]===t[13]&&r[14]===t[14]&&r[15]===t[15]}function DG(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],c=r[9],d=r[10],h=r[11],v=r[12],p=r[13],g=r[14],y=r[15],m=t[0],b=t[1],x=t[2],w=t[3],E=t[4],_=t[5],M=t[6],C=t[7],S=t[8],A=t[9],T=t[10],I=t[11],k=t[12],P=t[13],N=t[14],z=t[15];return Math.abs(e-m)<=It*Math.max(1,Math.abs(e),Math.abs(m))&&Math.abs(n-b)<=It*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=It*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=It*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-E)<=It*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-_)<=It*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(u-M)<=It*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(l-C)<=It*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(f-S)<=It*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(c-A)<=It*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(d-T)<=It*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(h-I)<=It*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(v-k)<=It*Math.max(1,Math.abs(v),Math.abs(k))&&Math.abs(p-P)<=It*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-N)<=It*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(y-z)<=It*Math.max(1,Math.abs(y),Math.abs(z))}var NG=MT,PG=kT;const RG=Object.freeze(Object.defineProperty({__proto__:null,add:IG,adjoint:tG,clone:Kz,copy:qz,create:Hz,determinant:rG,equals:DG,exactEquals:kG,frob:TG,fromQuat:mG,fromQuat2:pG,fromRotation:cG,fromRotationTranslation:CT,fromRotationTranslationScale:gG,fromRotationTranslationScaleOrigin:yG,fromScaling:fG,fromTranslation:lG,fromValues:Zz,fromXRotation:dG,fromYRotation:hG,fromZRotation:vG,frustum:bG,getRotation:IT,getScaling:TT,getTranslation:AT,identity:ST,invert:eG,lookAt:MG,mul:NG,multiply:MT,multiplyScalar:OG,multiplyScalarAndAdd:LG,ortho:_G,orthoNO:LT,orthoZO:SG,perspective:xG,perspectiveFromFieldOfView:EG,perspectiveNO:OT,perspectiveZO:wG,rotate:aG,rotateX:oG,rotateY:sG,rotateZ:uG,scale:iG,set:Qz,str:AG,sub:PG,subtract:kT,targetTo:CG,translate:nG,transpose:Jz},Symbol.toStringTag,{value:"Module"}));function A1(){var r=new vr(3);return vr!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function BG(r){var t=new vr(3);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function DT(r){var t=r[0],e=r[1],n=r[2];return Math.hypot(t,e,n)}function Oy(r,t,e){var n=new vr(3);return n[0]=r,n[1]=t,n[2]=e,n}function FG(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function zG(r,t,e,n){return r[0]=t,r[1]=e,r[2]=n,r}function GG(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r}function NT(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r}function PT(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r}function RT(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r}function $G(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r}function UG(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r}function jG(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r}function WG(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r}function XG(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r}function YG(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r}function VG(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r}function BT(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return Math.hypot(e,n,i)}function FT(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return e*e+n*n+i*i}function zT(r){var t=r[0],e=r[1],n=r[2];return t*t+e*e+n*n}function HG(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r}function KG(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r}function GT(r,t){var e=t[0],n=t[1],i=t[2],a=e*e+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r}function T1(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function Wh(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],u=e[2];return r[0]=i*u-a*s,r[1]=a*o-n*u,r[2]=n*s-i*o,r}function qG(r,t,e,n){var i=t[0],a=t[1],o=t[2];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=o+n*(e[2]-o),r}function ZG(r,t,e,n,i,a){var o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,l=o*(a-1),f=o*(3-2*a);return r[0]=t[0]*s+e[0]*u+n[0]*l+i[0]*f,r[1]=t[1]*s+e[1]*u+n[1]*l+i[1]*f,r[2]=t[2]*s+e[2]*u+n[2]*l+i[2]*f,r}function QG(r,t,e,n,i,a){var o=1-a,s=o*o,u=a*a,l=s*o,f=3*a*s,c=3*u*o,d=u*a;return r[0]=t[0]*l+e[0]*f+n[0]*c+i[0]*d,r[1]=t[1]*l+e[1]*f+n[1]*c+i[1]*d,r[2]=t[2]*l+e[2]*f+n[2]*c+i[2]*d,r}function JG(r,t){t=t||1;var e=va()*2*Math.PI,n=va()*2-1,i=Math.sqrt(1-n*n)*t;return r[0]=Math.cos(e)*i,r[1]=Math.sin(e)*i,r[2]=n*t,r}function e8(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[3]*n+e[7]*i+e[11]*a+e[15];return o=o||1,r[0]=(e[0]*n+e[4]*i+e[8]*a+e[12])/o,r[1]=(e[1]*n+e[5]*i+e[9]*a+e[13])/o,r[2]=(e[2]*n+e[6]*i+e[10]*a+e[14])/o,r}function gp(r,t,e){var n=t[0],i=t[1],a=t[2];return r[0]=n*e[0]+i*e[3]+a*e[6],r[1]=n*e[1]+i*e[4]+a*e[7],r[2]=n*e[2]+i*e[5]+a*e[8],r}function t8(r,t,e){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],l=t[2],f=i*l-a*u,c=a*s-n*l,d=n*u-i*s,h=i*d-a*c,v=a*f-n*d,p=n*c-i*f,g=o*2;return f*=g,c*=g,d*=g,h*=2,v*=2,p*=2,r[0]=s+f+h,r[1]=u+c+v,r[2]=l+d+p,r}function r8(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function n8(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function i8(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function a8(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt(e*e+n*n+i*i),l=Math.sqrt(a*a+o*o+s*s),f=u*l,c=f&&T1(r,t)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function o8(r){return r[0]=0,r[1]=0,r[2]=0,r}function s8(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function u8(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}function l8(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],o=t[1],s=t[2];return Math.abs(e-a)<=It*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(n-o)<=It*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=It*Math.max(1,Math.abs(i),Math.abs(s))}var f8=NT,c8=PT,d8=RT,h8=BT,v8=FT,$T=DT,p8=zT,g8=function(){var r=A1();return function(t,e,n,i,a,o){var s,u;for(e||(e=3),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],a(r,r,o),t[s]=r[0],t[s+1]=r[1],t[s+2]=r[2];return t}}();const y8=Object.freeze(Object.defineProperty({__proto__:null,add:GG,angle:a8,bezier:QG,ceil:$G,clone:BG,copy:FG,create:A1,cross:Wh,dist:h8,distance:BT,div:d8,divide:RT,dot:T1,equals:l8,exactEquals:u8,floor:UG,forEach:g8,fromValues:Oy,hermite:ZG,inverse:KG,len:$T,length:DT,lerp:qG,max:WG,min:jG,mul:c8,multiply:PT,negate:HG,normalize:GT,random:JG,rotateX:r8,rotateY:n8,rotateZ:i8,round:XG,scale:YG,scaleAndAdd:VG,set:zG,sqrDist:v8,sqrLen:p8,squaredDistance:FT,squaredLength:zT,str:s8,sub:f8,subtract:NT,transformMat3:gp,transformMat4:e8,transformQuat:t8,zero:o8},Symbol.toStringTag,{value:"Module"}));function UT(){var r=new vr(4);return vr!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function jT(r){var t=new vr(4);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function WT(r,t,e,n){var i=new vr(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function XT(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function YT(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function VT(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function HT(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r}function KT(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r[3]=t[3]*e[3],r}function qT(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r[3]=t[3]/e[3],r}function m8(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r[3]=Math.ceil(t[3]),r}function b8(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r[3]=Math.floor(t[3]),r}function x8(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r[3]=Math.min(t[3],e[3]),r}function w8(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r[3]=Math.max(t[3],e[3]),r}function E8(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r[3]=Math.round(t[3]),r}function ZT(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function _8(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r}function QT(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return Math.hypot(e,n,i,a)}function JT(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return e*e+n*n+i*i+a*a}function I1(r){var t=r[0],e=r[1],n=r[2],i=r[3];return Math.hypot(t,e,n,i)}function O1(r){var t=r[0],e=r[1],n=r[2],i=r[3];return t*t+e*e+n*n+i*i}function S8(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=-t[3],r}function M8(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r[3]=1/t[3],r}function eI(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*e+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),r[0]=e*o,r[1]=n*o,r[2]=i*o,r[3]=a*o,r}function tI(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]}function C8(r,t,e,n){var i=e[0]*n[1]-e[1]*n[0],a=e[0]*n[2]-e[2]*n[0],o=e[0]*n[3]-e[3]*n[0],s=e[1]*n[2]-e[2]*n[1],u=e[1]*n[3]-e[3]*n[1],l=e[2]*n[3]-e[3]*n[2],f=t[0],c=t[1],d=t[2],h=t[3];return r[0]=c*l-d*u+h*s,r[1]=-(f*l)+d*o-h*a,r[2]=f*u-c*o+h*i,r[3]=-(f*s)+c*a-d*i,r}function rI(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=o+n*(e[2]-o),r[3]=s+n*(e[3]-s),r}function A8(r,t){t=t||1;var e,n,i,a,o,s;do e=va()*2-1,n=va()*2-1,o=e*e+n*n;while(o>=1);do i=va()*2-1,a=va()*2-1,s=i*i+a*a;while(s>=1);var u=Math.sqrt((1-o)/s);return r[0]=t*e,r[1]=t*n,r[2]=t*i*u,r[3]=t*a*u,r}function T8(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3];return r[0]=e[0]*n+e[4]*i+e[8]*a+e[12]*o,r[1]=e[1]*n+e[5]*i+e[9]*a+e[13]*o,r[2]=e[2]*n+e[6]*i+e[10]*a+e[14]*o,r[3]=e[3]*n+e[7]*i+e[11]*a+e[15]*o,r}function I8(r,t,e){var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],u=e[2],l=e[3],f=l*n+s*a-u*i,c=l*i+u*n-o*a,d=l*a+o*i-s*n,h=-o*n-s*i-u*a;return r[0]=f*l+h*-o+c*-u-d*-s,r[1]=c*l+h*-s+d*-o-f*-u,r[2]=d*l+h*-u+f*-s-c*-o,r[3]=t[3],r}function O8(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function L8(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function nI(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function iI(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=t[0],s=t[1],u=t[2],l=t[3];return Math.abs(e-o)<=It*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=It*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=It*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-l)<=It*Math.max(1,Math.abs(a),Math.abs(l))}var k8=HT,D8=KT,N8=qT,P8=QT,R8=JT,B8=I1,F8=O1,z8=function(){var r=UT();return function(t,e,n,i,a,o){var s,u;for(e||(e=4),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],r[2]=t[s+2],r[3]=t[s+3],a(r,r,o),t[s]=r[0],t[s+1]=r[1],t[s+2]=r[2],t[s+3]=r[3];return t}}();const G8=Object.freeze(Object.defineProperty({__proto__:null,add:VT,ceil:m8,clone:jT,copy:XT,create:UT,cross:C8,dist:P8,distance:QT,div:N8,divide:qT,dot:tI,equals:iI,exactEquals:nI,floor:b8,forEach:z8,fromValues:WT,inverse:M8,len:B8,length:I1,lerp:rI,max:w8,min:x8,mul:D8,multiply:KT,negate:S8,normalize:eI,random:A8,round:E8,scale:ZT,scaleAndAdd:_8,set:YT,sqrDist:R8,sqrLen:F8,squaredDistance:JT,squaredLength:O1,str:L8,sub:k8,subtract:HT,transformMat4:T8,transformQuat:I8,zero:O8},Symbol.toStringTag,{value:"Module"}));function wv(){var r=new vr(4);return vr!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function $8(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function aI(r,t,e){e=e*.5;var n=Math.sin(e);return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=Math.cos(e),r}function U8(r,t){var e=Math.acos(t[3])*2,n=Math.sin(e/2);return n>It?(r[0]=t[0]/n,r[1]=t[1]/n,r[2]=t[2]/n):(r[0]=1,r[1]=0,r[2]=0),e}function j8(r,t){var e=k1(r,t);return Math.acos(2*e*e-1)}function oI(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],l=e[2],f=e[3];return r[0]=n*f+o*s+i*l-a*u,r[1]=i*f+o*u+a*s-n*l,r[2]=a*f+o*l+n*u-i*s,r[3]=o*f-n*s-i*u-a*l,r}function sI(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+o*s,r[1]=i*u+a*s,r[2]=a*u-i*s,r[3]=o*u-n*s,r}function uI(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u-a*s,r[1]=i*u+o*s,r[2]=a*u+n*s,r[3]=o*u-i*s,r}function lI(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(e),u=Math.cos(e);return r[0]=n*u+i*s,r[1]=i*u-n*s,r[2]=a*u+o*s,r[3]=o*u-a*s,r}function W8(r,t){var e=t[0],n=t[1],i=t[2];return r[0]=e,r[1]=n,r[2]=i,r[3]=Math.sqrt(Math.abs(1-e*e-n*n-i*i)),r}function fI(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=Math.sqrt(e*e+n*n+i*i),s=Math.exp(a),u=o>0?s*Math.sin(o)/o:0;return r[0]=e*u,r[1]=n*u,r[2]=i*u,r[3]=s*Math.cos(o),r}function cI(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=Math.sqrt(e*e+n*n+i*i),s=o>0?Math.atan2(o,a)/o:0;return r[0]=e*s,r[1]=n*s,r[2]=i*s,r[3]=.5*Math.log(e*e+n*n+i*i+a*a),r}function X8(r,t,e){return cI(r,t),hI(r,r,e),fI(r,r),r}function Xh(r,t,e,n){var i=t[0],a=t[1],o=t[2],s=t[3],u=e[0],l=e[1],f=e[2],c=e[3],d,h,v,p,g;return h=i*u+a*l+o*f+s*c,h<0&&(h=-h,u=-u,l=-l,f=-f,c=-c),1-h>It?(d=Math.acos(h),v=Math.sin(d),p=Math.sin((1-n)*d)/v,g=Math.sin(n*d)/v):(p=1-n,g=n),r[0]=p*i+g*u,r[1]=p*a+g*l,r[2]=p*o+g*f,r[3]=p*s+g*c,r}function Y8(r){var t=va(),e=va(),n=va(),i=Math.sqrt(1-t),a=Math.sqrt(t);return r[0]=i*Math.sin(2*Math.PI*e),r[1]=i*Math.cos(2*Math.PI*e),r[2]=a*Math.sin(2*Math.PI*n),r[3]=a*Math.cos(2*Math.PI*n),r}function V8(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],o=e*e+n*n+i*i+a*a,s=o?1/o:0;return r[0]=-e*s,r[1]=-n*s,r[2]=-i*s,r[3]=a*s,r}function H8(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r}function dI(r,t){var e=t[0]+t[4]+t[8],n;if(e>0)n=Math.sqrt(e+1),r[3]=.5*n,n=.5/n,r[0]=(t[5]-t[7])*n,r[1]=(t[6]-t[2])*n,r[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),r[i]=.5*n,n=.5/n,r[3]=(t[a*3+o]-t[o*3+a])*n,r[a]=(t[a*3+i]+t[i*3+a])*n,r[o]=(t[o*3+i]+t[i*3+o])*n}return r}function K8(r,t,e,n){var i=.5*Math.PI/180;t*=i,e*=i,n*=i;var a=Math.sin(t),o=Math.cos(t),s=Math.sin(e),u=Math.cos(e),l=Math.sin(n),f=Math.cos(n);return r[0]=a*u*f-o*s*l,r[1]=o*s*f+a*u*l,r[2]=o*u*l-a*s*f,r[3]=o*u*f+a*s*l,r}function q8(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var Z8=jT,Q8=WT,L1=XT,J8=YT,e$=VT,t$=oI,hI=ZT,k1=tI,r$=rI,D1=I1,n$=D1,N1=O1,i$=N1,P1=eI,a$=nI,o$=iI,s$=function(){var r=A1(),t=Oy(1,0,0),e=Oy(0,1,0);return function(n,i,a){var o=T1(i,a);return o<-.999999?(Wh(r,t,i),$T(r)<1e-6&&Wh(r,e,i),GT(r,r),aI(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Wh(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,P1(n,n))}}(),u$=function(){var r=wv(),t=wv();return function(e,n,i,a,o,s){return Xh(r,n,o,s),Xh(t,i,a,s),Xh(e,r,t,2*s*(1-s)),e}}(),l$=function(){var r=wT();return function(t,e,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-e[0],r[5]=-e[1],r[8]=-e[2],P1(t,dI(t,r))}}();const f$=Object.freeze(Object.defineProperty({__proto__:null,add:e$,calculateW:W8,clone:Z8,conjugate:H8,copy:L1,create:wv,dot:k1,equals:o$,exactEquals:a$,exp:fI,fromEuler:K8,fromMat3:dI,fromValues:Q8,getAngle:j8,getAxisAngle:U8,identity:$8,invert:V8,len:n$,length:D1,lerp:r$,ln:cI,mul:t$,multiply:oI,normalize:P1,pow:X8,random:Y8,rotateX:sI,rotateY:uI,rotateZ:lI,rotationTo:s$,scale:hI,set:J8,setAxes:l$,setAxisAngle:aI,slerp:Xh,sqlerp:u$,sqrLen:i$,squaredLength:N1,str:q8},Symbol.toStringTag,{value:"Module"}));function c$(){var r=new vr(8);return vr!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0),r[3]=1,r}function d$(r){var t=new vr(8);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t}function h$(r,t,e,n,i,a,o,s){var u=new vr(8);return u[0]=r,u[1]=t,u[2]=e,u[3]=n,u[4]=i,u[5]=a,u[6]=o,u[7]=s,u}function v$(r,t,e,n,i,a,o){var s=new vr(8);s[0]=r,s[1]=t,s[2]=e,s[3]=n;var u=i*.5,l=a*.5,f=o*.5;return s[4]=u*n+l*e-f*t,s[5]=l*n+f*r-u*e,s[6]=f*n+u*t-l*r,s[7]=-u*r-l*t-f*e,s}function vI(r,t,e){var n=e[0]*.5,i=e[1]*.5,a=e[2]*.5,o=t[0],s=t[1],u=t[2],l=t[3];return r[0]=o,r[1]=s,r[2]=u,r[3]=l,r[4]=n*l+i*u-a*s,r[5]=i*l+a*o-n*u,r[6]=a*l+n*s-i*o,r[7]=-n*o-i*s-a*u,r}function p$(r,t){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=t[0]*.5,r[5]=t[1]*.5,r[6]=t[2]*.5,r[7]=0,r}function g$(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function y$(r,t){var e=wv();IT(e,t);var n=new vr(3);return AT(n,t),vI(r,e,n),r}function pI(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r}function m$(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r}function b$(r,t,e,n,i,a,o,s,u){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=o,r[6]=s,r[7]=u,r}var x$=L1;function w$(r,t){return r[0]=t[4],r[1]=t[5],r[2]=t[6],r[3]=t[7],r}var E$=L1;function _$(r,t){return r[4]=t[0],r[5]=t[1],r[6]=t[2],r[7]=t[3],r}function S$(r,t){var e=t[4],n=t[5],i=t[6],a=t[7],o=-t[0],s=-t[1],u=-t[2],l=t[3];return r[0]=(e*l+a*o+n*u-i*s)*2,r[1]=(n*l+a*s+i*o-e*u)*2,r[2]=(i*l+a*u+e*s-n*o)*2,r}function M$(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0]*.5,u=e[1]*.5,l=e[2]*.5,f=t[4],c=t[5],d=t[6],h=t[7];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=o*s+i*l-a*u+f,r[5]=o*u+a*s-n*l+c,r[6]=o*l+n*u-i*s+d,r[7]=-n*s-i*u-a*l+h,r}function C$(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=s*o+f*n+u*a-l*i,d=u*o+f*i+l*n-s*a,h=l*o+f*a+s*i-u*n,v=f*o-s*n-u*i-l*a;return sI(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+d*a-h*i,r[5]=d*o+v*i+h*n-c*a,r[6]=h*o+v*a+c*i-d*n,r[7]=v*o-c*n-d*i-h*a,r}function A$(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=s*o+f*n+u*a-l*i,d=u*o+f*i+l*n-s*a,h=l*o+f*a+s*i-u*n,v=f*o-s*n-u*i-l*a;return uI(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+d*a-h*i,r[5]=d*o+v*i+h*n-c*a,r[6]=h*o+v*a+c*i-d*n,r[7]=v*o-c*n-d*i-h*a,r}function T$(r,t,e){var n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],l=t[6],f=t[7],c=s*o+f*n+u*a-l*i,d=u*o+f*i+l*n-s*a,h=l*o+f*a+s*i-u*n,v=f*o-s*n-u*i-l*a;return lI(r,t,e),n=r[0],i=r[1],a=r[2],o=r[3],r[4]=c*o+v*n+d*a-h*i,r[5]=d*o+v*i+h*n-c*a,r[6]=h*o+v*a+c*i-d*n,r[7]=v*o-c*n-d*i-h*a,r}function I$(r,t,e){var n=e[0],i=e[1],a=e[2],o=e[3],s=t[0],u=t[1],l=t[2],f=t[3];return r[0]=s*o+f*n+u*a-l*i,r[1]=u*o+f*i+l*n-s*a,r[2]=l*o+f*a+s*i-u*n,r[3]=f*o-s*n-u*i-l*a,s=t[4],u=t[5],l=t[6],f=t[7],r[4]=s*o+f*n+u*a-l*i,r[5]=u*o+f*i+l*n-s*a,r[6]=l*o+f*a+s*i-u*n,r[7]=f*o-s*n-u*i-l*a,r}function O$(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[0],u=e[1],l=e[2],f=e[3];return r[0]=n*f+o*s+i*l-a*u,r[1]=i*f+o*u+a*s-n*l,r[2]=a*f+o*l+n*u-i*s,r[3]=o*f-n*s-i*u-a*l,s=e[4],u=e[5],l=e[6],f=e[7],r[4]=n*f+o*s+i*l-a*u,r[5]=i*f+o*u+a*s-n*l,r[6]=a*f+o*l+n*u-i*s,r[7]=o*f-n*s-i*u-a*l,r}function L$(r,t,e,n){if(Math.abs(n)<It)return pI(r,t);var i=Math.hypot(e[0],e[1],e[2]);n=n*.5;var a=Math.sin(n),o=a*e[0]/i,s=a*e[1]/i,u=a*e[2]/i,l=Math.cos(n),f=t[0],c=t[1],d=t[2],h=t[3];r[0]=f*l+h*o+c*u-d*s,r[1]=c*l+h*s+d*o-f*u,r[2]=d*l+h*u+f*s-c*o,r[3]=h*l-f*o-c*s-d*u;var v=t[4],p=t[5],g=t[6],y=t[7];return r[4]=v*l+y*o+p*u-g*s,r[5]=p*l+y*s+g*o-v*u,r[6]=g*l+y*u+v*s-p*o,r[7]=y*l-v*o-p*s-g*u,r}function k$(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r}function gI(r,t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e[4],u=e[5],l=e[6],f=e[7],c=t[4],d=t[5],h=t[6],v=t[7],p=e[0],g=e[1],y=e[2],m=e[3];return r[0]=n*m+o*p+i*y-a*g,r[1]=i*m+o*g+a*p-n*y,r[2]=a*m+o*y+n*g-i*p,r[3]=o*m-n*p-i*g-a*y,r[4]=n*f+o*s+i*l-a*u+c*m+v*p+d*y-h*g,r[5]=i*f+o*u+a*s-n*l+d*m+v*g+h*p-c*y,r[6]=a*f+o*l+n*u-i*s+h*m+v*y+c*g-d*p,r[7]=o*f-n*s-i*u-a*l+v*m-c*p-d*g-h*y,r}var D$=gI;function N$(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r}var yI=k1;function P$(r,t,e,n){var i=1-n;return yI(t,e)<0&&(n=-n),r[0]=t[0]*i+e[0]*n,r[1]=t[1]*i+e[1]*n,r[2]=t[2]*i+e[2]*n,r[3]=t[3]*i+e[3]*n,r[4]=t[4]*i+e[4]*n,r[5]=t[5]*i+e[5]*n,r[6]=t[6]*i+e[6]*n,r[7]=t[7]*i+e[7]*n,r}function R$(r,t){var e=yp(t);return r[0]=-t[0]/e,r[1]=-t[1]/e,r[2]=-t[2]/e,r[3]=t[3]/e,r[4]=-t[4]/e,r[5]=-t[5]/e,r[6]=-t[6]/e,r[7]=t[7]/e,r}function B$(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r[4]=-t[4],r[5]=-t[5],r[6]=-t[6],r[7]=t[7],r}var mI=D1,F$=mI,yp=N1,z$=yp;function G$(r,t){var e=yp(t);if(e>0){e=Math.sqrt(e);var n=t[0]/e,i=t[1]/e,a=t[2]/e,o=t[3]/e,s=t[4],u=t[5],l=t[6],f=t[7],c=n*s+i*u+a*l+o*f;r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=(s-n*c)/e,r[5]=(u-i*c)/e,r[6]=(l-a*c)/e,r[7]=(f-o*c)/e}return r}function $$(r){return"quat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+")"}function U$(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]}function j$(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=t[0],c=t[1],d=t[2],h=t[3],v=t[4],p=t[5],g=t[6],y=t[7];return Math.abs(e-f)<=It*Math.max(1,Math.abs(e),Math.abs(f))&&Math.abs(n-c)<=It*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-d)<=It*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-h)<=It*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(o-v)<=It*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=It*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(u-g)<=It*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(l-y)<=It*Math.max(1,Math.abs(l),Math.abs(y))}const W$=Object.freeze(Object.defineProperty({__proto__:null,add:k$,clone:d$,conjugate:B$,copy:pI,create:c$,dot:yI,equals:j$,exactEquals:U$,fromMat4:y$,fromRotation:g$,fromRotationTranslation:vI,fromRotationTranslationValues:v$,fromTranslation:p$,fromValues:h$,getDual:w$,getReal:x$,getTranslation:S$,identity:m$,invert:R$,len:F$,length:mI,lerp:P$,mul:D$,multiply:gI,normalize:G$,rotateAroundAxis:L$,rotateByQuatAppend:I$,rotateByQuatPrepend:O$,rotateX:C$,rotateY:A$,rotateZ:T$,scale:N$,set:b$,setDual:_$,setReal:E$,sqrLen:z$,squaredLength:yp,str:$$,translate:M$},Symbol.toStringTag,{value:"Module"}));function bI(){var r=new vr(2);return vr!=Float32Array&&(r[0]=0,r[1]=0),r}function X$(r){var t=new vr(2);return t[0]=r[0],t[1]=r[1],t}function Y$(r,t){var e=new vr(2);return e[0]=r,e[1]=t,e}function V$(r,t){return r[0]=t[0],r[1]=t[1],r}function H$(r,t,e){return r[0]=t,r[1]=e,r}function $n(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r}function xI(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r}function wI(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r}function EI(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r}function K$(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r}function q$(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r}function ns(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r}function is(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r}function Z$(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r}function oi(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r}function Q$(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r}function Ev(r,t){var e=t[0]-r[0],n=t[1]-r[1];return Math.hypot(e,n)}function _I(r,t){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function SI(r){var t=r[0],e=r[1];return Math.hypot(t,e)}function MI(r){var t=r[0],e=r[1];return t*t+e*e}function J$(r,t){return r[0]=-t[0],r[1]=-t[1],r}function eU(r,t){return r[0]=1/t[0],r[1]=1/t[1],r}function gs(r,t){var e=t[0],n=t[1],i=e*e+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=t[0]*i,r[1]=t[1]*i,r}function R1(r,t){return r[0]*t[0]+r[1]*t[1]}function tU(r,t,e){var n=t[0]*e[1]-t[1]*e[0];return r[0]=r[1]=0,r[2]=n,r}function rU(r,t,e,n){var i=t[0],a=t[1];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r}function nU(r,t){t=t||1;var e=va()*2*Math.PI;return r[0]=Math.cos(e)*t,r[1]=Math.sin(e)*t,r}function iU(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i,r[1]=e[1]*n+e[3]*i,r}function aU(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i+e[4],r[1]=e[1]*n+e[3]*i+e[5],r}function oU(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[3]*i+e[6],r[1]=e[1]*n+e[4]*i+e[7],r}function sU(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[4]*i+e[12],r[1]=e[1]*n+e[5]*i+e[13],r}function uU(r,t,e,n){var i=t[0]-e[0],a=t[1]-e[1],o=Math.sin(n),s=Math.cos(n);return r[0]=i*s-a*o+e[0],r[1]=i*o+a*s+e[1],r}function CI(r,t){var e=r[0],n=r[1],i=t[0],a=t[1],o=Math.sqrt(e*e+n*n)*Math.sqrt(i*i+a*a),s=o&&(e*i+n*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function lU(r){return r[0]=0,r[1]=0,r}function fU(r){return"vec2("+r[0]+", "+r[1]+")"}function B1(r,t){return r[0]===t[0]&&r[1]===t[1]}function cU(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.abs(e-i)<=It*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(n-a)<=It*Math.max(1,Math.abs(n),Math.abs(a))}var dU=SI,Yh=xI,hU=wI,vU=EI,pU=Ev,gU=_I,yU=MI,mU=function(){var r=bI();return function(t,e,n,i,a,o){var s,u;for(e||(e=2),n||(n=0),i?u=Math.min(i*e+n,t.length):u=t.length,s=n;s<u;s+=e)r[0]=t[s],r[1]=t[s+1],a(r,r,o),t[s]=r[0],t[s+1]=r[1];return t}}();const bU=Object.freeze(Object.defineProperty({__proto__:null,add:$n,angle:CI,ceil:K$,clone:X$,copy:V$,create:bI,cross:tU,dist:pU,distance:Ev,div:vU,divide:EI,dot:R1,equals:cU,exactEquals:B1,floor:q$,forEach:mU,fromValues:Y$,inverse:eU,len:dU,length:SI,lerp:rU,max:is,min:ns,mul:hU,multiply:wI,negate:J$,normalize:gs,random:nU,rotate:uU,round:Z$,scale:oi,scaleAndAdd:Q$,set:H$,sqrDist:gU,sqrLen:yU,squaredDistance:_I,squaredLength:MI,str:fU,sub:Yh,subtract:xI,transformMat2:iU,transformMat2d:aU,transformMat3:oU,transformMat4:sU,zero:lU},Symbol.toStringTag,{value:"Module"})),xU=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:A6,mat2:Q6,mat2d:Ez,mat3:_T,mat4:RG,quat:f$,quat2:W$,vec2:bU,vec3:y8,vec4:G8},Symbol.toStringTag,{value:"Module"}));function wU(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return S1(n,e),no(r,n,t)}function EU(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return M1(n,e),no(r,n,t)}function _U(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return C1(n,e),no(r,n,t)}function SU(r,t,e){return no(r,e,t)}function ra(r,t){for(var e=r?[].concat(r):[1,0,0,0,1,0,0,0,1],n=0,i=t.length;n<i;n++){var a=t[n];switch(a[0]){case"t":wU(e,e,[a[1],a[2]]);break;case"s":_U(e,e,[a[1],a[2]]);break;case"r":EU(e,e,a[1]);break;case"m":SU(e,e,a[1]);break}}return e}var du=function(t,e){var n=t.nodes,i=t.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var l=[];a.push(l)}),i&&i.forEach(function(s){var u=s.source,l=s.target,f=o[u],c=o[l];!f&&f!==0||!c&&c!==0||(a[f][c]=1,e||(a[c][f]=1))}),a},MU=function(t,e){return t===e},UE=function(){function r(t,e){e===void 0&&(e=null),this.value=t,this.next=e}return r.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},r}(),AI=function(){function r(t){t===void 0&&(t=MU),this.head=null,this.tail=null,this.compare=t}return r.prototype.prepend=function(t){var e=new UE(t,this.head);return this.head=e,this.tail||(this.tail=e),this},r.prototype.append=function(t){var e=new UE(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},r.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(n!==null)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},r.prototype.find=function(t){var e=t.value,n=e===void 0?void 0:e,i=t.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||n!==void 0&&this.compare(o.value,n))return o;o=o.next}return null},r.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},r.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},r.prototype.fromArray=function(t){var e=this;return t.forEach(function(n){return e.append(n)}),this},r.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},r.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},r.prototype.toString=function(t){return t===void 0&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},r}(),CU=function(){function r(){this.linkedList=new AI}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(t){this.linkedList.append(t)},r.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toString=function(t){return this.linkedList.toString(t)},r}(),Ni=function(t,e,n){e===void 0&&(e=[]);var i=e.filter(function(u){return u.source===t||u.target===t});if(n==="target"){var a=function(l){return l.source===t};return i.filter(a).map(function(u){return u.target})}if(n==="source"){var o=function(l){return l.target===t};return i.filter(o).map(function(u){return u.source})}var s=function(l){return l.source===t?l.target:l.source};return i.map(s)},AU=function(t,e){return e.filter(function(n){return n.source===t})},Vh=function(t,e){return e.filter(function(n){return n.source===t||n.target===t})},TI=function(t){t===void 0&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(n)};function TU(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var o=a.next,s=o;return i[s]?!1:(i[s]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}var II=function(t,e,n,i){i===void 0&&(i=!0);var a=TU(n),o=new CU,s=t.edges,u=s===void 0?[]:s;o.enqueue(e);for(var l="",f=function(){var d=o.dequeue();a.enter({current:d,previous:l}),Ni(d,u,i?"target":void 0).forEach(function(h){a.allowTraversal({previous:l,current:d,next:h})&&o.enqueue(h)}),a.leave({current:d,previous:l}),l=d};!o.isEmpty();)f()},IU=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,o=[],s={},u=[],l=function h(v){u.push(v),s[v.id]=!0;for(var p=Ni(v.id,a),g=function(b){var x=p[b];if(!s[x]){var w=n.filter(function(E){return E.id===x});w.length>0&&h(w[0])}},y=0;y<p.length;++y)g(y)},f=0;f<n.length;f++){var c=n[f];if(!s[c.id]){l(c);for(var d=[];u.length>0;)d.push(u.pop());o.push(d)}}return o},OI=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,o=[],s={},u={},l={},f=[],c=0,d=function g(y){u[y.id]=c,l[y.id]=c,c+=1,o.push(y),s[y.id]=!0;for(var m=Ni(y.id,a,"target").filter(function(_){return n.map(function(M){return M.id}).indexOf(_)>-1}),b=function(M){var C=m[M];if(!u[C]&&u[C]!==0){var S=n.filter(function(A){return A.id===C});S.length>0&&g(S[0]),l[y.id]=Math.min(l[y.id],l[C])}else s[C]&&(l[y.id]=Math.min(l[y.id],u[C]))},x=0;x<m.length;x++)b(x);if(l[y.id]===u[y.id]){for(var w=[];o.length>0;){var E=o.pop();if(s[E.id]=!1,w.push(E),E===y)break}w.length>0&&f.push(w)}},h=0,v=n;h<v.length;h++){var p=v[h];!u[p.id]&&u[p.id]!==0&&d(p)}return f};function F1(r,t){return t?OI(r):IU(r)}var Po=function(t){var e={},n=t.nodes,i=n===void 0?[]:n,a=t.edges,o=a===void 0?[]:a;return i.forEach(function(s){e[s.id]={degree:0,inDegree:0,outDegree:0}}),o.forEach(function(s){e[s.source].degree++,e[s.source].outDegree++,e[s.target].degree++,e[s.target].inDegree++}),e},LI=function(t,e){var n=Po(t);return n[e]?Po(t)[e].inDegree:0},kI=function(t,e){var n=Po(t);return n[e]?Po(t)[e].outDegree:0};function OU(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var o=a.next;return i[o]?!1:(i[o]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}function DI(r,t,e,n,i){i===void 0&&(i=!0),n.enter({current:t,previous:e});var a=r.edges,o=a===void 0?[]:a;Ni(t,o,i?"target":void 0).forEach(function(s){n.allowTraversal({previous:e,current:t,next:s})&&DI(r,s,t,n,i)}),n.leave({current:t,previous:e})}function z1(r,t,e,n){n===void 0&&(n=!0),DI(r,t,"",OU(e),n)}var G1=function(t){var e=null,n=t.nodes,i=n===void 0?[]:n,a={},o={},s={},u={};i.forEach(function(c){o[c.id]=c});for(var l={enter:function(d){var h=d.current,v=d.previous;if(s[h]){e={};for(var p=h,g=v;g!==h;)e[p]=g,p=g,g=a[g];e[p]=g}else s[h]=h,delete o[h],a[h]=v},leave:function(d){var h=d.current;u[h]=h,delete s[h]},allowTraversal:function(d){var h=d.next;return e?!1:!u[h]}};Object.keys(o).length;){var f=Object.keys(o)[0];z1(t,f,l)}return e},$1=function(t,e,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=F1(t,!1),u=0,l=s;u<l.length;u++){var f=l[u];if(f.length)for(var c=f[0],d=c.id,h=[c],v=(i={},i[d]=c,i),p=(a={},a[d]=new Set,a);h.length>0;)for(var g=h.pop(),y=g.id,m=Ni(y,t.edges),b=function(E){var _,M=m[E],C=t.nodes.find(function(P){return P.id===M});if(M===y)o.push((_={},_[M]=g,_));else if(!(M in p))v[M]=g,h.push(C),p[M]=new Set([g]);else if(!p[y].has(C)){for(var S=!0,A=[C,g],T=v[y];p[M].size&&!p[M].has(T)&&(A.push(T),T!==v[T.id]);)T=v[T.id];if(A.push(T),e&&n?(S=!1,A.findIndex(function(P){return e.indexOf(P.id)>-1})>-1&&(S=!0)):e&&!n&&A.findIndex(function(P){return e.indexOf(P.id)>-1})>-1&&(S=!1),S){for(var I={},k=1;k<A.length;k+=1)I[A[k-1].id]=A[k];A.length&&(I[A[A.length-1].id]=A[0]),o.push(I)}p[M].add(g)}},x=0;x<m.length;x+=1)b(x)}return o},U1=function(t,e,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],u={},l={},f=function(T){for(var I=[T];I.length>0;){var k=I.pop();a.has(k)&&(a.delete(k),o[k.id].forEach(function(P){I.push(P)}),o[k.id].clear())}},c=function A(T,I,k){var P=!1;if(e&&n===!1&&e.indexOf(T.id)>-1)return P;i.push(T),a.add(T);for(var N=k[T.id],z=0;z<N.length;z+=1){var W=u[N[z]];if(W===I){for(var D={},R=1;R<i.length;R+=1)D[i[R-1].id]=i[R];i.length&&(D[i[i.length-1].id]=i[0]),s.push(D),P=!0}else a.has(W)||A(W,I,k)&&(P=!0)}if(P)f(T);else for(var z=0;z<N.length;z+=1){var W=u[N[z]];o[W.id].has(T)||o[W.id].add(T)}return i.pop(),P},d=t.nodes,h=d===void 0?[]:d,v=0;v<h.length;v+=1){var p=h[v],g=p.id;l[g]=v,u[v]=p}if(e&&n)for(var y=function(T){var I=e[T];l[h[T].id]=l[I],l[I]=0,u[0]=h.find(function(k){return k.id===I}),u[l[h[T].id]]=h[T]},v=0;v<e.length;v++)y(v);for(var m=function(T){for(var I,k,P=1/0,N=0;N<T.length;N+=1)for(var z=T[N],W=0;W<z.length;W++){var D=l[z[W].id];D<P&&(P=D,k=N)}for(var R=T[k],H=[],N=0;N<R.length;N+=1){var ee=R[N];H[ee.id]=[];for(var Y=0,X=Ni(ee.id,t.edges,"target").filter(function(Ae){return R.map(function(Ke){return Ke.id}).indexOf(Ae)>-1});Y<X.length;Y++){var fe=X[Y];fe===ee.id&&!(n===!1&&e.indexOf(ee.id)>-1)?s.push((I={},I[ee.id]=ee,I)):H[ee.id].push(l[fe])}}return{component:R,adjList:H,minIdx:P}},b=0;b<h.length;){var x=h.filter(function(A){return l[A.id]>=b}),w=OI({nodes:x,edges:t.edges}).filter(function(A){return A.length>1});if(w.length===0)break;var E=m(w),_=E.minIdx,M=E.adjList,C=E.component;if(C.length>1){C.forEach(function(A){o[A.id]=new Set});var S=u[_];if(e&&n&&e.indexOf(S.id)===-1)return s;c(S,S,M),b=_+1}else break}return s},NI=function(t,e,n,i){return i===void 0&&(i=!0),e?U1(t,n,i):$1(t,n,i)},LU=function(t,e,n){for(var i=1/0,a,o=0;o<e.length;o++){var s=e[o].id;!n[s]&&t[s]<=i&&(i=t[s],a=e[o])}return a},cc=function(t,e,n,i){var a=t.nodes,o=a===void 0?[]:a,s=t.edges,u=s===void 0?[]:s,l={},f={},c={};o.forEach(function(m,b){var x=m.id;f[x]=1/0,x===e&&(f[x]=0)});for(var d=o.length,h=function(b){var x=LU(f,o,l),w=x.id;if(l[w]=!0,f[w]===1/0)return"continue";var E=[];n?E=AU(w,u):E=Vh(w,u),E.forEach(function(_){var M=_.target,C=_.source,S=M===w?C:M,A=i&&_[i]?_[i]:1;f[S]>f[x.id]+A?(f[S]=f[x.id]+A,c[S]=[x.id]):f[S]===f[x.id]+A&&c[S].push(x.id)})},v=0;v<d;v++)h();c[e]=[e];var p={};for(var g in f)f[g]!==1/0&&PI(e,g,c,p);var y={};for(var g in p)y[g]=p[g][0];return{length:f,path:y,allPath:p}};function PI(r,t,e,n){if(r===t)return[r];if(n[t])return n[t];for(var i=[],a=0,o=e[t];a<o.length;a++){var s=o[a],u=PI(r,s,e,n);if(!u)return;for(var l=0,f=u;l<f.length;l++){var c=f[l];wt(c)?i.push(Bi(Bi([],c,!0),[t],!1)):i.push([c,t])}}return n[t]=i,n[t]}var RI=function(t,e,n,i,a){var o=cc(t,e,i,a),s=o.length,u=o.path,l=o.allPath;return{length:s[n],path:u[n],allPath:l[n]}},BI=function(t,e,n,i){var a;if(e===n)return[[e]];var o=t.edges,s=o===void 0?[]:o,u=[e],l=(a={},a[e]=!0,a),f=[],c=[],d=i?Ni(e,s,"target"):Ni(e,s);for(f.push(d);u.length>0&&f.length>0;){var h=f[f.length-1];if(h.length){var v=h.shift();v&&(u.push(v),l[v]=!0,d=i?Ni(v,s,"target"):Ni(v,s),f.push(d.filter(function(y){return!l[y]})))}else{var p=u.pop();l[p]=!1,f.pop();continue}if(u[u.length-1]===n){var g=u.map(function(m){return m});c.push(g);var p=u.pop();l[p]=!1,f.pop()}}return c},dc=function(t,e){for(var n=du(t,e),i=[],a=n.length,o=0;o<a;o+=1){i[o]=[];for(var s=0;s<a;s+=1)o===s?i[o][s]=0:n[o][s]===0||!n[o][s]?i[o][s]=1/0:i[o][s]=n[o][s]}for(var u=0;u<a;u+=1)for(var o=0;o<a;o+=1)for(var s=0;s<a;s+=1)i[o][s]>i[o][u]+i[u][s]&&(i[o][s]=i[o][u]+i[u][s]);return i},FI=function(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=t.nodes,o=a===void 0?[]:a,s=t.edges,u=s===void 0?[]:s,l={},f={};o.forEach(function(b,x){var w=TI();b.clusterId=w,l[w]={id:w,nodes:[b]},f[b.id]={node:b,idx:x}});var c=du(t,e),d={};c.forEach(function(b,x){var w=o[x].id;d[w]={},b.forEach(function(E,_){if(E){var M=o[_].id;d[w][M]=E}})});for(var h=0,v=function(){var x=!1;if(o.forEach(function(w){var E={};Object.keys(d[w.id]).forEach(function(k){var P=d[w.id][k],N=f[k].node,z=N.clusterId;E[z]||(E[z]=0),E[z]+=P});var _=-1/0,M=[];if(Object.keys(E).forEach(function(k){_<E[k]?(_=E[k],M=[k]):_===E[k]&&M.push(k)}),!(M.length===1&&M[0]===w.clusterId)){var C=M.indexOf(w.clusterId);if(C>=0&&M.splice(C,1),M&&M.length){x=!0;var S=l[w.clusterId],A=S.nodes.indexOf(w);S.nodes.splice(A,1);var T=Math.floor(Math.random()*M.length),I=l[M[T]];I.nodes.push(w),w.clusterId=I.id}}}),!x)return"break";h++};h<i;){var p=v();if(p==="break")break}Object.keys(l).forEach(function(b){var x=l[b];(!x.nodes||!x.nodes.length)&&delete l[b]});var g=[],y={};u.forEach(function(b){var x=b.source,w=b.target,E=b[n]||1,_=f[x].node.clusterId,M=f[w].node.clusterId,C="".concat(_,"---").concat(M);if(y[C])y[C].weight+=E,y[C].count++;else{var S={source:_,target:M,weight:E,count:1};y[C]=S,g.push(S)}});var m=[];return Object.keys(l).forEach(function(b){m.push(l[b])}),{clusters:m,clusterEdges:g}},Qi=function(){function r(t){this.arr=t}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(t){var e=[];if(t!==0)for(var n in this.arr)e[n]=this.arr[n]/t;return new r(e)},r.prototype.negate=function(){var t=[];for(var e in this.arr)t[e]=-this.arr[e];return new r(t)},r.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return i}},r.prototype.euclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var t=[],e=ar(this.arr);e.sort(function(o,s){return o-s});var n=e[e.length-1],i=e[0];for(var a in this.arr)t[a]=(this.arr[a]-i)/(n-i);return new r(t)},r.prototype.norm2=function(){var t;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return 0;var e=0;for(var n in this.arr)e+=Math.pow(this.arr[n],2);return Math.sqrt(e)},r.prototype.dot=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*t.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(t){var e,n=t.arr;if(((e=this.arr)===null||e===void 0?void 0:e.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),j1=function(t,e){e===void 0&&(e=void 0);var n=[];return t.forEach(function(i){e===void 0&&n.push(i),i[e]!==void 0&&n.push(i[e])}),n},ha;(function(r){r.EuclideanDistance="euclideanDistance"})(ha||(ha={}));var kU=function(t,e,n){var i=[];e!=null&&e.length?i=e:(t.forEach(function(o){i=i.concat(Object.keys(o))}),i=lc(i));var a={};return i.forEach(function(o){var s=[];t.forEach(function(u){u[o]!==void 0&&u[o]!==""&&s.push(u[o])}),s.length&&!(n!=null&&n.includes(o))&&(a[o]=lc(s))}),a},W1=function(t,e,n){var i=kU(t,e,n),a=[];if(!Object.keys(i).length)return a;var o=Object.values(i),s=o.every(function(u){return u.every(function(l){return typeof l=="number"})});return t.forEach(function(u,l){var f=[];Object.keys(i).forEach(function(c){var d=u[c],h=i[c],v=h.findIndex(function(y){return d===y}),p=[];if(s)p.push(d);else for(var g=0;g<h.length;g++)g===v?p.push(1):p.push(0);f=f.concat(p)}),a[l]=f}),a},jE=function(t,e,n,i){n===void 0&&(n=ha.EuclideanDistance);var a=0;switch(n){case ha.EuclideanDistance:a=new Qi(t).euclideanDistance(new Qi(e));break}return a},WE=function(t,e,n,i){for(var a=e.length,o=2*i,s=0,u=0;u<a;u++)for(var l=t[u].clusterId,f=0;f<a;f++){var c=t[f].clusterId;if(l===c){var d=e[u][f]||0,h=n[u]||0,v=n[f]||0;s+=d-h*v/o}}return s*=1/o,s},d0=function(t,e){t===void 0&&(t=[]);for(var n=t.length,i=new Qi([]),a=0;a<n;a++)i=i.add(new Qi(e[a]));var o=i.avg(n);o.normalize();for(var s=0,a=0;a<n;a++){var u=new Qi(e[a]),l=u.squareEuclideanDistance(o);s+=l}var f=[];t.forEach(function(){f.push([])});for(var a=0;a<n;a++){var u=new Qi(e[a]);t[a].clusterInertial=0;for(var c=0;c<n;c++){if(a===c){f[a][c]=0;continue}var d=new Qi(e[c]);f[a][c]=u.squareEuclideanDistance(d),t[a].clusterInertial+=f[a][c]}}for(var h=0,v=2*n*s,a=0;a<n;a++)for(var p=t[a].clusterId,c=0;c<n;c++){var g=t[c].clusterId;if(!(a===c||p!==g)){var y=t[a].clusterInertial*t[c].clusterInertial/Math.pow(v,2)-f[a][c]/v;h+=y}}return Number(h.toFixed(4))},X1=function(t,e,n,i,a,o,s,u,l){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),o===void 0&&(o=void 0),s===void 0&&(s=[]),u===void 0&&(u=["id"]),l===void 0&&(l=1);var f=t.nodes,c=f===void 0?[]:f,d=t.edges,h=d===void 0?[]:d,v=[];if(a){c.forEach(function(D,R){D.properties=D.properties||{},D.originIndex=R});var p=[];c.every(function(D){return D.hasOwnProperty("nodeType")})&&(p=Array.from(new Set(c.map(function(D){return D.nodeType}))),c.forEach(function(D){D.properties.nodeType=p.findIndex(function(R){return R===D.nodeType})}));var g=j1(c,o);v=W1(g,s,u)}var y=1,m={},b={};c.forEach(function(D,R){var H=String(y++);D.clusterId=H,m[H]={id:H,nodes:[D]},b[D.id]={node:D,idx:R}});var x=du(t,e),w=[],E={},_=0;x.forEach(function(D,R){var H=0,ee=c[R].id;E[ee]={},D.forEach(function(Y,X){if(Y){H+=Y;var fe=c[X].id;E[ee][fe]=Y,_+=Y}}),w.push(H)}),_/=2;for(var M=1/0,C=1/0,S=0,A=[],T={};;){a&&c.every(function(D){return D.hasOwnProperty("properties")})?M=WE(c,x,w,_)+d0(c,v)*l:M=WE(c,x,w,_),S===0&&(C=M,A=c,T=m);var I=M>0&&M>C&&M-C<i;if(M>C&&(A=c.map(function(D){return{node:D,clusterId:D.clusterId}}),T=ar(m),C=M),I||S>100)break;S++,Object.keys(m).forEach(function(D){var R=0;h.forEach(function(H){var ee=H.source,Y=H.target,X=b[ee].node.clusterId,fe=b[Y].node.clusterId;(X===D&&fe!==D||fe===D&&X!==D)&&(R=R+(H[n]||1))}),m[D].sumTot=R}),c.forEach(function(D,R){var H=m[D.clusterId],ee=0,Y,X=w[R]/(2*_),fe=0,we=H.nodes;we.forEach(function(jt){var Sr=b[jt.id].idx;fe+=x[R][Sr]||0});var Ae=fe-H.sumTot*X,Ke=we.filter(function(jt){return jt.id!==D.id});Ke.forEach(function(jt,Sr){v[jt.originIndex]});var ot=d0(Ke,v)*l,nt=E[D.id];if(Object.keys(nt).forEach(function(jt){var Sr=b[jt].node,rr=Sr.clusterId;if(rr!==D.clusterId){var Rt=m[rr],sr=Rt.nodes;if(!(!sr||!sr.length)){var Hr=0;sr.forEach(function(Pe){var me=b[Pe.id].idx;Hr+=x[R][me]||0});var et=Hr-Rt.sumTot*X,ie=sr.concat([D]);ie.forEach(function(Pe,me){v[Pe.originIndex]});var L=d0(ie,v)*l,Se=et-Ae;a&&(Se=et+L-(Ae+ot)),Se>ee&&(ee=Se,Y=Rt)}}}),ee>0){Y.nodes.push(D);var Ct=D.clusterId;D.clusterId=Y.id;var Et=H.nodes.indexOf(D);H.nodes.splice(Et,1);var fr=0,Gt=0;h.forEach(function(jt){var Sr=jt.source,rr=jt.target,Rt=b[Sr].node.clusterId,sr=b[rr].node.clusterId;(Rt===Y.id&&sr!==Y.id||sr===Y.id&&Rt!==Y.id)&&(fr=fr+(jt[n]||1)),(Rt===Ct&&sr!==Ct||sr===Ct&&Rt!==Ct)&&(Gt=Gt+(jt[n]||1))}),Y.sumTot=fr,H.sumTot=Gt}})}var k={},P=0;Object.keys(T).forEach(function(D){var R=T[D];if(!R.nodes||!R.nodes.length){delete T[D];return}var H=String(P+1);H!==D&&(R.id=H,R.nodes=R.nodes.map(function(ee){return{id:ee.id,clusterId:H}}),T[H]=R,k[D]=H,delete T[D],P++)}),A.forEach(function(D){var R=D.node,H=D.clusterId;R&&(R.clusterId=H,R.clusterId&&k[R.clusterId]&&(R.clusterId=k[R.clusterId]))});var N=[],z={};h.forEach(function(D){var R=D.source,H=D.target,ee=D[n]||1,Y=b[R].node.clusterId,X=b[H].node.clusterId;if(!(!Y||!X)){var fe="".concat(Y,"---").concat(X);if(z[fe])z[fe].weight+=ee,z[fe].count++;else{var we={source:Y,target:X,weight:ee,count:1};z[fe]=we,N.push(we)}}});var W=[];return Object.keys(T).forEach(function(D){W.push(T[D])}),{clusters:W,clusterEdges:N}},zI=function(t,e,n,i,a,o,s,u){return e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),o===void 0&&(o=[]),s===void 0&&(s=["id"]),u===void 0&&(u=1),X1(t,e,n,i,!0,a,o,s,u)},GI=function(t,e){var n;e===void 0&&(e=1);for(var i=ar(t),a=i.nodes,o=a===void 0?[]:a,s=i.edges,u=s===void 0?[]:s,l=function(){var d=Po({nodes:o,edges:u}),h=Object.keys(d);h.sort(function(g,y){var m,b;return((m=d[g])===null||m===void 0?void 0:m.degree)-((b=d[y])===null||b===void 0?void 0:b.degree)});var v=h[0];if(!o.length||((n=d[v])===null||n===void 0?void 0:n.degree)>=e)return"break";var p=o.findIndex(function(g){return g.id===v});o.splice(p,1),u=u.filter(function(g){return!(g.source===v||g.target===v)})};;){var f=l();if(f==="break")break}return{nodes:o,edges:u}},XE=function(t,e,n){var i=[];switch(t){case ha.EuclideanDistance:i=e[n];break;default:i=[];break}return i},$I=function(t,e,n,i,a,o){e===void 0&&(e=3),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),o===void 0&&(o=ha.EuclideanDistance);var s=t.nodes,u=s===void 0?[]:s,l=t.edges,f=l===void 0?[]:l,c={clusters:[{id:"0",nodes:u}],clusterEdges:[]};if(o===ha.EuclideanDistance&&!u.every(function(H){return H.hasOwnProperty(n)}))return c;var d=[],h=[];if(o===ha.EuclideanDistance&&(d=j1(u,n),h=W1(d,i,a)),!h.length)return c;for(var v=lc(h.map(function(H){return H.join("")})),p=Math.min(e,u.length,v.length),g=0;g<u.length;g++)u[g].originIndex=g;for(var y=[],m=[],b=[],g=0;g<p;g++)if(g===0){var x=Math.floor(Math.random()*u.length);switch(o){case ha.EuclideanDistance:y[g]=h[x];break;default:y[g]=[];break}m.push(x),b[g]=[u[x]],u[x].clusterId=String(g)}else{for(var w=-1/0,E=0,_=function(Y){if(!m.includes(Y)){for(var X=0,fe=0;fe<y.length;fe++){var we=0;switch(o){case ha.EuclideanDistance:we=jE(h[u[Y].originIndex],y[fe],o);break}X+=we}var Ae=X/y.length;Ae>w&&!y.find(function(Ke){return ms(Ke,XE(o,h,u[Y].originIndex))})&&(w=Ae,E=Y)}},M=0;M<u.length;M++)_(M);y[g]=XE(o,h,E),m.push(E),b[g]=[u[E]],u[E].clusterId=String(g)}for(var C=0;;){for(var g=0;g<u.length;g++){var S=0,A=1/0;if(!(C===0&&m.includes(g))){for(var T=0;T<y.length;T++){var I=0;switch(o){case ha.EuclideanDistance:I=jE(h[g],y[T],o);break}I<A&&(A=I,S=T)}if(u[g].clusterId!==void 0)for(var k=b[Number(u[g].clusterId)].length-1;k>=0;k--)b[Number(u[g].clusterId)][k].id===u[g].id&&b[Number(u[g].clusterId)].splice(k,1);u[g].clusterId=String(S),b[S].push(u[g])}}for(var P=!1,g=0;g<b.length;g++){for(var N=b[g],z=new Qi([]),T=0;T<N.length;T++)z=z.add(new Qi(h[N[T].originIndex]));var W=z.avg(N.length);W.equal(new Qi(y[g]))||(P=!0,y[g]=W.getArr())}if(C++,u.every(function(H){return H.clusterId!==void 0})&&P||C>=1e3)break}var D=[],R={};return f.forEach(function(H){var ee,Y,X=H.source,fe=H.target,we=(ee=u.find(function(nt){return nt.id===X}))===null||ee===void 0?void 0:ee.clusterId,Ae=(Y=u.find(function(nt){return nt.id===fe}))===null||Y===void 0?void 0:Y.clusterId,Ke="".concat(we,"---").concat(Ae);if(R[Ke])R[Ke].count++;else{var ot={source:we,target:Ae,count:1};R[Ke]=ot,D.push(ot)}}),{clusters:b,clusterEdges:D}},Y1=function(t,e){var n=new Qi(e),i=n.norm2(),a=new Qi(t),o=a.norm2(),s=n.dot(a),u=i*o,l=u?s/u:0;return l},UI=function(t,e,n,i,a){t===void 0&&(t=[]),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var o=ar(t.filter(function(d){return d.id!==e.id})),s=t.findIndex(function(d){return d.id===e.id}),u=j1(t,n),l=W1(u,i,a),f=l[s],c=[];return o.forEach(function(d,h){if(d.id!==e.id){var v=l[h],p=Y1(v,f);c.push(p),d.cosineSimilarity=p}}),o.sort(function(d,h){return h.cosineSimilarity-d.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},DU=function(){function r(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var i=n[e];this.parent[i]=i}}return r.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},r.prototype.union=function(t,e){var n=this.find(t),i=this.find(e);n!==i&&(n<i?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},r.prototype.connected=function(t,e){return this.find(t)===this.find(e)},r}(),NU=function(t,e){return t-e},PU=function(){function r(t){t===void 0&&(t=NU),this.compareFn=t,this.list=[]}return r.prototype.getLeft=function(t){return 2*t+1},r.prototype.getRight=function(t){return 2*t+2},r.prototype.getParent=function(t){return t===0?null:Math.floor((t-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},r.prototype.insert=function(t){if(t!==null){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},r.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},r.prototype.moveDown=function(t){var e,n=t,i=this.getLeft(t),a=this.getRight(t),o=this.list.length;i!==null&&i<o&&this.compareFn(this.list[n],this.list[i])>0?n=i:a!==null&&a<o&&this.compareFn(this.list[n],this.list[a])>0&&(n=a),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},r}(),RU=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,o=t.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=a[0],l=new Set;l.add(u);var f=function(g,y){return e?g.weight-y.weight:0},c=new PU(f);for(Vh(u.id,s).forEach(function(p){c.insert(p)});!c.isEmpty();){var d=c.delMin(),h=d.source,v=d.target;l.has(h)&&l.has(v)||(n.push(d),l.has(h)||(l.add(h),Vh(h,s).forEach(function(p){c.insert(p)})),l.has(v)||(l.add(v),Vh(v,s).forEach(function(p){c.insert(p)})))}return n},YE=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,o=t.edges,s=o===void 0?[]:o;if(a.length===0)return n;var u=s.map(function(h){return h});e&&u.sort(function(h,v){return h.weight-v.weight});for(var l=new DU(a.map(function(h){return h.id}));u.length>0;){var f=u.shift(),c=f.source,d=f.target;l.connected(c,d)||(n.push(f),l.union(c,d))}return n},jI=function(t,e,n){var i={prim:RU,kruskal:YE};return n?i[n](t,e):YE(t,e)},WI=function(t,e,n){typeof e!="number"&&(e=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,o=1e3,s=t.nodes,u=s===void 0?[]:s,l=t.edges,f=l===void 0?[]:l,c=u.length,d,h={},v={},p=0;p<c;++p){var g=u[p],y=g.id;h[y]=1/c,v[y]=1/c}for(var m=Po(t);o>0&&i>e;){a=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;if(d=0,m[g.id].inDegree===0)h[y]=0;else{for(var b=Ni(y,f,"source"),x=0;x<b.length;++x){var w=b[x],E=m[w].outDegree;E>0&&(d+=v[w]/E)}h[y]=n*d,a+=h[y]}}a=(1-a)/c,i=0;for(var p=0;p<c;++p){var g=u[p],y=g.id;d=h[y]+a,i+=Math.abs(d-v[y]),v[y]=d}o-=1}return v},BU=-1,_v=-1,XI="-1",Ua="-1",YI=-1,VE=function(){function r(t,e,n,i){t===void 0&&(t=BU),e===void 0&&(e=_v),n===void 0&&(n=_v),i===void 0&&(i=XI),this.id=t,this.from=e,this.to=n,this.label=i}return r}(),FU=function(){function r(t,e){t===void 0&&(t=_v),e===void 0&&(e=Ua),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},r}(),VI=function(){function r(t,e,n){t===void 0&&(t=_v),e===void 0&&(e=!0),n===void 0&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new FU(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},r.prototype.addEdge=function(t,e,n,i){if((this.edgeIdAutoIncrease||t===void 0)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var a=new VE(t,e,n,i);if(this.edges.push(a),this.edgeMap[t]=a,this.nodeMap[e].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var o=new VE(t,n,e,i);this.nodeMap[n].addEdge(o),this.edgeLabelMap[i].push(o)}}},r}(),Hs=function(){function r(t,e,n,i,a){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||Ua,edgeLabel:i||XI,nodeLabel2:a||Ua}}return r.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r}(),HE=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(t){var e=this.dfsEdgeList.length,n=t.length;if(e!==n)return!1;for(var i=0;i<e;i++)if(this.dfsEdgeList[i]!==t[i])return!1;return!0},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r.prototype.pushBack=function(t,e,n,i,a){return this.dfsEdgeList.push(new Hs(t,e,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(t,e){t===void 0&&(t=YI),e===void 0&&(e=!1);var n=new VI(t,!0,e);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,o=i.toNode,s=i.nodeEdgeNodeLabel,u=s.nodeLabel1,l=s.edgeLabel,f=s.nodeLabel2;u!==Ua&&n.addNode(a,u),f!==Ua&&n.addNode(o,f),u!==Ua&&f!==u&&n.addEdge(void 0,a,o,l)}),n},r.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length,n=e-1;n>=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,o=i.toNode;a<o&&(t===void 0||o===t)&&(this.rmpath.push(n),t=a)}return this.rmpath},r.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach(function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)}),Object.keys(t).length},r}(),Yd=function(){function r(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return r.prototype.hasNode=function(t){return this.nodesUsed[t.id]===1},r.prototype.hasEdge=function(t){return this.edgesUsed[t.id]===1},r}(),zU=function(){function r(t){var e=t.graphs,n=t.minSupport,i=n===void 0?2:n,a=t.minNodeNum,o=a===void 0?1:a,s=t.maxNodeNum,u=s===void 0?4:s,l=t.top,f=l===void 0?10:l,c=t.directed,d=c===void 0?!1:c,h=t.verbose,v=h===void 0?!1:h;this.graphs=e,this.dfsCode=new HE,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=f,this.directed=d,this.counter=0,this.maxNodeNum=u,this.minNodeNum=o,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return r.prototype.findForwardRootEdges=function(t,e){var n=this,i=[],a=t.nodeMap;return e.edges.forEach(function(o){(n.directed||e.label<=a[o.to].label)&&i.push(o)}),i},r.prototype.findBackwardEdge=function(t,e,n,i){if(!this.directed&&e===n)return null;for(var a=t.nodeMap,o=a[n.to],s=o.edges,u=s.length,l=0;l<u;l++){var f=s[l];if(!(i.hasEdge(f)||f.to!==e.from)){if(this.directed){if(a[e.from].label<a[n.to].label||a[e.from].label===a[n.to].label&&e.label<=f.label)return f}else if(e.label<f.label||e.label===f.label&&a[e.to].label<=a[n.to].label)return f}}return null},r.prototype.findForwardPureEdges=function(t,e,n,i){for(var a=[],o=e.to,s=t.nodeMap[o].edges,u=s.length,l=0;l<u;l++){var f=s[l],c=t.nodeMap[f.to];n<=c.label&&!i.hasNode(c)&&a.push(f)}return a},r.prototype.findForwardRmpathEdges=function(t,e,n,i){for(var a=[],o=t.nodeMap,s=o[e.to].label,u=o[e.from],l=u.edges,f=l.length,c=0;c<f;c++){var d=l[c],h=o[d.to].label;e.to===d.to||n>h||i.hasNode(o[d.to])||(e.label<d.label||e.label===d.label&&s<=h)&&a.push(d)}return a},r.prototype.getSupport=function(t){var e={};return t.forEach(function(n){e[n.graphId]||(e[n.graphId]=!0)}),Object.keys(e).length},r.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach(function(n){var i=t[n],a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;if(!e){e={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(a<e.nodeLabel1||a===e.nodeLabel1&&o<e.edgeLabel||a===e.nodeLabel1&&o===e.edgeLabel&&s<e.nodeLabel2)&&(e={nodeLabel1:a,edgeLabel:o,nodeLabel2:s})}),e},r.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),e.dfsEdgeList.length===1)return!0;var n=this.directed,i=e.toGraph(YI,n),a=i.nodeMap,o=new HE,s={};i.nodes.forEach(function(c){var d=t.findForwardRootEdges(i,c);d.forEach(function(h){var v=a[h.to],p="".concat(c.label,"-").concat(h.label,"-").concat(v.label);s[p]||(s[p]={projected:[],nodeLabel1:c.label,edgeLabel:h.label,nodeLabel2:v.label});var g={graphId:i.id,edge:h,preNode:null};s[p].projected.push(g)})});var u=this.findMinLabel(s);if(u){o.dfsEdgeList.push(new Hs(0,1,u.nodeLabel1,u.edgeLabel,u.nodeLabel2));var l=function c(d){for(var h=o.buildRmpath(),v=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,p=o.dfsEdgeList[h[0]].toNode,g={},y=!1,m=0,b=n?-1:0,x=function(z){if(y)return"break";d.forEach(function(W){var D=new Yd(W),R=t.findBackwardEdge(i,D.edges[h[z]],D.edges[h[0]],D);R&&(g[R.label]||(g[R.label]={projected:[],edgeLabel:R.label}),g[R.label].projected.push({graphId:i.id,edge:g,preNode:W}),m=o.dfsEdgeList[h[z]].fromNode,y=!0)})},w=h.length-1;w>b;w--){var E=x(w);if(E==="break")break}if(y){var _=t.findMinLabel(g);o.dfsEdgeList.push(new Hs(p,m,Ua,_.edgeLabel,Ua));var M=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[M]!==o.dfsEdgeList[M]?!1:c(g[_.edgeLabel].projected)}var C={};y=!1;var S=0;d.forEach(function(N){var z=new Yd(N),W=t.findForwardPureEdges(i,z.edges[h[0]],v,z);W.length>0&&(y=!0,S=p,W.forEach(function(D){var R="".concat(D.label,"-").concat(a[D.to].label);C[R]||(C[R]={projected:[],edgeLabel:D.label,nodeLabel2:a[D.to].label}),C[R].projected.push({graphId:i.id,edge:D,preNode:N})}))});for(var A=h.length,T=function(z){if(y)return"break";var W=h[z];d.forEach(function(D){var R=new Yd(D),H=t.findForwardRmpathEdges(i,R.edges[W],v,R);H.length>0&&(y=!0,S=o.dfsEdgeList[W].fromNode,H.forEach(function(ee){var Y="".concat(ee.label,"-").concat(a[ee.to].label);C[Y]||(C[Y]={projected:[],edgeLabel:ee.label,nodeLabel2:a[ee.to].label}),C[Y].projected.push({graphId:i.id,edge:ee,preNode:D})}))})},w=0;w<A;w++){var I=T(w);if(I==="break")break}if(!y)return!0;var k=t.findMinLabel(C);o.dfsEdgeList.push(new Hs(S,p+1,Ua,k.edgeLabel,k.nodeLabel2));var P=o.dfsEdgeList.length-1;return e.dfsEdgeList[P]!==o.dfsEdgeList[P]?!1:c(C["".concat(k.edgeLabel,"-").concat(k.nodeLabel2)].projected)},f="".concat(u.nodeLabel1,"-").concat(u.edgeLabel,"-").concat(u.nodeLabel2);return l(s[f].projected)}},r.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(ar(t))}},r.prototype.subGraphMining=function(t){var e=this,n=this.getSupport(t);if(!(n<this.minSupport)&&this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),o=this.dfsCode.dfsEdgeList[a[0]].toNode,s=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,u={},l={};t.forEach(function(f){for(var c=e.graphs[f.graphId],d=c.nodeMap,h=new Yd(f),v=a.length-1;v>=0;v--){var p=e.findBackwardEdge(c,h.edges[a[v]],h.edges[a[0]],h);if(p){var g="".concat(e.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(p.label);l[g]||(l[g]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:p.label}),l[g].projected.push({graphId:f.graphId,edge:p,preNode:f})}}if(!(i>=e.maxNodeNum)){var y=e.findForwardPureEdges(c,h.edges[a[0]],s,h);y.forEach(function(b){var x="".concat(o,"-").concat(b.label,"-").concat(d[b.to].label);u[x]||(u[x]={projected:[],fromNodeId:o,edgeLabel:b.label,nodeLabel2:d[b.to].label}),u[x].projected.push({graphId:f.graphId,edge:b,preNode:f})});for(var m=function(x){var w=e.findForwardRmpathEdges(c,h.edges[a[x]],s,h);w.forEach(function(E){var _="".concat(e.dfsCode.dfsEdgeList[a[x]].fromNode,"-").concat(E.label,"-").concat(d[E.to].label);u[_]||(u[_]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[x]].fromNode,edgeLabel:E.label,nodeLabel2:d[E.to].label}),u[_].projected.push({graphId:f.graphId,edge:E,preNode:f})})},v=0;v<a.length;v++)m(v)}}),Object.keys(l).forEach(function(f){var c=l[f],d=c.toNodeId,h=c.edgeLabel;e.dfsCode.dfsEdgeList.push(new Hs(o,d,"-1",h,"-1")),e.subGraphMining(l[f].projected),e.dfsCode.dfsEdgeList.pop()}),Object.keys(u).forEach(function(f){var c=u[f],d=c.fromNodeId,h=c.edgeLabel,v=c.nodeLabel2;e.dfsCode.dfsEdgeList.push(new Hs(d,o+1,Ua,h,v)),e.subGraphMining(u[f].projected),e.dfsCode.dfsEdgeList.pop()})}},r.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,a={},o={},s={};return Object.keys(t).forEach(function(u){var l=t[u],f=l.nodeMap;l.nodes.forEach(function(c,d){var h=c.label,v="".concat(u,"-").concat(h);if(!s[v]){var p=a[h]||0;p++,a[h]=p}s[v]={graphKey:u,label:h},c.edges.forEach(function(g){var y=h,m=f[g.to].label;if(!e&&y>m){var b=m;m=y,y=b}var x=g.label,w="".concat(y,"-").concat(x,"-").concat(m);if(!o[w]){var E=o[w]||0;E++,o[w]=E}})})}),Object.keys(a).forEach(function(u){var l=a[u];if(!(l<n)){var f={nodes:[],edges:[]};f.nodes.push({id:"0",label:u}),i.push(f)}}),i},r.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs;this.directed;var n={};Object.keys(e).forEach(function(i){var a=e[i],o=a.nodeMap;a.nodes.forEach(function(s){var u=t.findForwardRootEdges(a,s);u.forEach(function(l){var f=o[l.to],c="".concat(s.label,"-").concat(l.label,"-").concat(f.label);n[c]||(n[c]={projected:[],nodeLabel1:s.label,edgeLabel:l.label,nodeLabel2:f.label});var d={graphId:i,edge:l,preNode:null};n[c].projected.push(d)})})}),Object.keys(n).forEach(function(i){var a=n[i],o=a.projected,s=a.nodeLabel1,u=a.edgeLabel,l=a.nodeLabel2;t.dfsCode.dfsEdgeList.push(new Hs(0,1,s,u,l)),t.subGraphMining(o),t.dfsCode.dfsEdgeList.pop()})}},r}(),GU=function(t,e,n,i){var a={};return Object.keys(t).forEach(function(o,s){var u=t[o],l=new VI(s,!0,e),f={};u.nodes.forEach(function(c,d){l.addNode(d,c[n]),f[c.id]=d}),u.edges.forEach(function(c,d){var h=f[c.source],v=f[c.target];l.addEdge(-1,h,v,c[i])}),l&&l.getNodeNum()&&(a[l.id]=l)}),a},$U=function(t,e,n){var i=[];return t.forEach(function(a){var o={nodes:[],edges:[]};a.nodes.forEach(function(s){var u;o.nodes.push((u={id:"".concat(s.id)},u[e]=s.label,u))}),a.edges.forEach(function(s){var u;o.edges.push((u={source:"".concat(s.from),target:"".concat(s.to)},u[n]=s.label,u))}),i.push(o)}),i},KE="cluster",UU=function(t){var e=t.graphs,n=t.directed,i=n===void 0?!1:n,a=t.nodeLabelProp,o=a===void 0?KE:a,s=t.edgeLabelProp,u=s===void 0?KE:s,l=GU(e,i,o,u),f=t.minSupport,c=t.maxNodeNum,d=t.minNodeNum,h=t.verbose,v=t.top,p={graphs:l,minSupport:f,maxNodeNum:c,minNodeNum:d,top:v,verbose:h,directed:i},g=new zU(p);g.run();var y=$U(g.frequentSubgraphs,o,u);return y},qE=function(t,e,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],o=t.nodes;return e.forEach(function(s,u){a.push(HI(o,s,u,n,i))}),a},HI=function(t,e,n,i,a){var o=[n],s=[],u={};return e.forEach(function(l,f){if(l<=a&&n!==f){o.push(f),s.push(t[f]);var c=t[f][i];u[c]?(u[c].count++,u[c].dists.push(l)):u[c]={count:1,dists:[l]}}}),Object.keys(u).forEach(function(l){u[l].dists=u[l].dists.sort(function(f,c){return f-c})}),{nodeIdx:n,nodeId:t[n].id,nodeIdxs:o,neighbors:s,neighborNum:o.length-1,nodeLabelCountMap:u}},jU=function(t,e,n,i,a){var o=Math.ceil(n/e),s={},u=0;return i.forEach(function(l,f){for(var c=0,d=0,h=l.nodeIdxs,v=l.neighborNum-1;c<o;){for(var p=h[1+Math.floor(Math.random()*v)],g=0;(s["".concat(f,"-").concat(p)]||s["".concat(p,"-").concat(f)])&&(p=Math.floor(Math.random()*e),g++,!(g>2*e)););if(g<2*e&&(s["".concat(f,"-").concat(p)]={start:f,end:p,distance:a[f][p]},c++,u++,u>=n))return s;if(d++,d>2*e)break}if(c<o){var y=o-c;o=(o+y)/(e-f-1)}}),s},Hh=function(t,e,n,i){var a=n.nodes;return i||(i={}),Object.keys(t).forEach(function(o){var s,u;if(!(i&&i[o])){i[o]={nodes:[],edges:[]};var l=t[o],f=(s=e[l.start])===null||s===void 0?void 0:s.nodeIdxs,c=(u=e[l.end])===null||u===void 0?void 0:u.nodeIdxs;if(!(!f||!c)){var d=new Set(c),h=f.filter(function(m){return d.has(m)});if(!(!h||!h.length)){for(var v={},p=h.length,g=0;g<p;g++){var y=a[h[g]];i[o].nodes.push(y),v[y.id]=!0}n.edges.forEach(function(m){v[m.source]&&v[m.target]&&i[o].edges.push(m)})}}}}),i},Kh=function(t,e,n,i){var a,o,s={};t.nodes.forEach(function(l){s[l.id]=l});var u=0;return!(!((a=e==null?void 0:e.edges)===null||a===void 0)&&a.length)||((o=e==null?void 0:e.nodes)===null||o===void 0?void 0:o.length)<2?0:(t.edges.forEach(function(l){var f=s[l.source][n],c=s[l.target][n],d=e==null?void 0:e.nodes[0][n],h=e==null?void 0:e.nodes[1][n],v=e==null?void 0:e.edges[0][i];l[i]===v&&(f===d&&c===h||f===h&&c===d)&&u++}),u)},WU=function(t,e,n){for(var i=1/0,a=0,o=function(l){var f=t[l],c=Object.keys(f).sort(function(m,b){return f[m]-f[b]}),d=10,h=[];c.forEach(function(m,b){h[b%d]||(h[b%d]={graphs:[],totalCount:0,aveCount:0}),h[b%d].graphs.push(m),h[b%d].totalCount+=f[m]});var v=0,p=[];h.forEach(function(m){var b=m.totalCount/m.graphs.length;m.aveCount=b,p.push(b);var x=0,w=m.length;m.graphs.forEach(function(E,_){var M=f[E];m.graphs.forEach(function(C,S){_!==S&&(x+=Math.abs(M-f[C]))})}),x/=w*(w-1)/2,v+=x}),v/=h.length;var g=0;p.forEach(function(m,b){p.forEach(function(x,w){b!==w&&(g+=Math.abs(m-x))}),g/=p.length*(p.length-1)/2});var y=g-v;i<y&&(i=y,a=l)},s=0;s<e;s++)o(s);return{structure:n[a],structureCountMap:t[a]}},ZE=function(t,e){var n={},i={};return t.forEach(function(a,o){n[a.id]={idx:o,node:a,degree:0,inDegree:0,outDegree:0};var s=a[e];i[s]||(i[s]=[]),i[s].push(a)}),{nodeMap:n,nodeLabelMap:i}},QE=function(t,e,n){var i={},a={};return t.forEach(function(o,s){i["".concat(TI)]={idx:s,edge:o};var u=o[e];a[u]||(a[u]=[]),a[u].push(o);var l=n[o.source];l&&(l.degree++,l.outDegree++);var f=n[o.target];f&&(f.degree++,f.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},JE=function(t,e,n){var i=e.length,a={};return e.forEach(function(o,s){for(var u=n?0:s+1,l=t[s].id,f=u;f<i;f++)if(s!==f){var c=t[f].id,d=o[f];a["".concat(l,"-").concat(c)]=d,n||(a["".concat(c,"-").concat(l)]=d)}}),a},XU=function(t,e,n,i,a,o,s,u,l,f,c){var d,h="".concat(e.id,"-").concat(n.id);if(f&&f[h])return f[h];var v=c?c[h]:void 0;if(!v){var p=(d={},d[h]={start:i[e.id].idx,end:i[n.id].idx,distance:a},d);c=Hh(p,o,t,c),v=c[h]}return Kh(v,s,u,l)},e2=function(t,e,n,i){var a,o,s,u=(a=t[e])===null||a===void 0?void 0:a.degree,l=(o=t[e])===null||o===void 0?void 0:o.inDegree,f=(s=t[e])===null||s===void 0?void 0:s.outDegree;return t[e]===void 0&&(u=1/0,l=1/0,f=1/0,i[e].forEach(function(c){var d=n[c.id].degree;u>d&&(u=d);var h=n[c.id].inDegree;l>h&&(l=h);var v=n[c.id].outDegree;f>v&&(f=v)}),t[e]={degree:u,inDegree:l,outDegree:f}),{minPatternNodeLabelDegree:u,minPatternNodeLabelInDegree:l,minPatternNodeLabelOutDegree:f}},KI=function(t,e,n,i,a,o,s){var u;if(n===void 0&&(n=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!t||!t.nodes)){var l=t.nodes.length;if(l){var f=dc(t,n),c=dc(e,n),d=JE(t.nodes,f,n),h=JE(e.nodes,c,n),v=ZE(t.nodes,o),p=v.nodeMap,g=v.nodeLabelMap,y=ZE(e.nodes,o),m=y.nodeMap,b=y.nodeLabelMap;QE(t.edges,s,p);var x=QE(e.edges,s,m).edgeLabelMap,w=[];c==null||c.forEach(function(et){w=w.concat(et)}),a||(a=Math.max.apply(Math,Bi(Bi([],w,!1),[2],!1))),i||(i=a);var E=qE(t,f,o,i),_=qE(e,c,o,i),M=Math.min(100,l*(l-1)/2),C=jU(i,l,M,E,f),S=Hh(C,E,t),A=10,T=1,I=1,k=4,P={graphs:S,nodeLabelProp:o,edgeLabelProp:s,minSupport:T,minNodeNum:I,maxNodeNum:k,directed:n},N=UU(P).slice(0,A),z=N.length,W=[];N.forEach(function(et,ie){W[ie]={},Object.keys(S).forEach(function(L){var Se=S[L],Pe=Kh(Se,et,o,s);W[ie][L]=Pe})});var D=WU(W,z,N),R=D.structure,H=D.structureCountMap,ee=e.nodes[0],Y=[],X=(u=e.nodes[0])===null||u===void 0?void 0:u[o],fe=-1/0;e.nodes.forEach(function(et){var ie=et[o],L=g[ie];(L==null?void 0:L.length)>fe&&(fe=L.length,Y=L,X=ie,ee=et)});var we={},Ae={},Ke={},ot={},nt={},Ct={};Object.keys(b).forEach(function(et,ie){nt[et]=[],n&&(Ct[et]=[]);var L=b[et],Se={};L.forEach(function(qe){var tt=h["".concat(ee.id,"-").concat(qe.id)];if(tt&&nt[et].push(tt),Se["".concat(ee.id,"-").concat(qe.id)]={start:0,end:m[qe.id].idx,distance:tt},n){var yt=h["".concat(qe.id,"-").concat(ee.id)];yt&&Ct[et].push(yt)}}),nt[et]=nt[et].sort(function(qe,tt){return qe-tt}),n&&(Ct[et]=Ct[et].sort(function(qe,tt){return qe-tt})),Ae=Hh(Se,_,e,Ae);var Pe=[];if(Object.keys(Se).forEach(function(qe){if(Ke[qe]){Pe.push(Ke[qe]);return}var tt=Ae[qe];Ke[qe]=Kh(tt,R,o,s),Pe.push(Ke[qe])}),Pe=Pe.sort(function(qe,tt){return tt-qe}),ot["".concat(ee.id,"-").concat(et)]=Pe,et!==X)for(var me=(Y==null?void 0:Y.length)||0,je=function(tt){var yt=Y[tt],Ut=E[p[yt.id].idx],gr=Ut.nodeLabelCountMap[et],Pt=b[et].length;if(!gr||gr.count<Pt)return Y.splice(tt,1),"continue";for(var wr=!1,Zt=0;Zt<Pt;Zt++)if(gr.dists[Zt]>nt[et][Zt]){wr=!0;break}if(wr)return Y.splice(tt,1),"continue";var Mr={};Ut.neighbors.forEach(function(ir){var Br=d["".concat(yt.id,"-").concat(ir.id)];Mr["".concat(yt.id,"-").concat(ir.id)]={start:p[yt.id].idx,end:p[ir.id].idx,distance:Br}}),S=Hh(Mr,E,t,S);var Er=[];Object.keys(Mr).forEach(function(ir){if(H[ir]){Er.push(H[ir]);return}var Br=S[ir];H[ir]=Kh(Br,R,o,s),Er.push(H[ir])}),Er=Er.sort(function(ir,Br){return Br-ir});for(var vn=!1,Zt=0;Zt<Pt;Zt++)if(Er[Zt]<Pe[Zt]){vn=!0;break}if(vn)return Y.splice(tt,1),"continue"},Xe=me-1;Xe>=0;Xe--)je(Xe)});var Et=[];Y==null||Y.forEach(function(et){for(var ie=p[et.id].idx,L=HI(t.nodes,f[ie],ie,o,a),Se=L.neighbors,Pe=Se.length,me=!1,je=Pe-1;je>=0;je--){if(Se.length+1<e.nodes.length){me=!0;return}var Xe=Se[je],qe=Xe[o];if(!b[qe]||!b[qe].length){Se.splice(je,1);continue}if(!nt[qe]||!nt[qe].length){Se.splice(je,1);continue}var tt="".concat(et.id,"-").concat(Xe.id),yt=d[tt],Ut=nt[qe].length-1,gr=nt[qe][Ut];if(yt>gr){Se.splice(je,1);continue}if(n){var Pt="".concat(Xe.id,"-").concat(et.id),wr=d[Pt];Ut=Ct[qe].length-1;var Zt=Ct[qe][Ut];if(wr>Zt){Se.splice(je,1);continue}}var Mr=H[tt]?H[tt]:XU(t,et,Xe,p,yt,E,R,o,s,H,S),Er="".concat(ee.id,"-").concat(qe),vn=ot[Er][ot[Er].length-1];if(Mr<vn){Se.splice(je,1);continue}var ir=e2(we,qe,m,b),Br=ir.minPatternNodeLabelDegree;if(ir.minPatternNodeLabelInDegree,ir.minPatternNodeLabelOutDegree,p[Xe.id].degree<Br){Se.splice(je,1);continue}}me||Et.push({nodes:[et].concat(Se)})});var fr=cc(e,ee.id,!1).length,Gt={};n?(Object.keys(fr).forEach(function(et){var ie=m[et].node[o];Gt[ie]?Gt[ie].push(fr[et]):Gt[ie]=[fr[et]]}),Object.keys(Gt).forEach(function(et){Gt[et].sort(function(ie,L){return ie-L})})):Gt=nt;for(var jt=Et.length,Sr=function(ie){var L=Et[ie],Se=L.nodes[0],Pe={},me={};L.nodes.forEach(function(_t,ue){me[_t.id]={idx:ue,node:_t,degree:0,inDegree:0,outDegree:0};var ve=_t[o];Pe[ve]?Pe[ve]++:Pe[ve]=1});var je=[],Xe={};t.edges.forEach(function(_t){me[_t.source]&&me[_t.target]&&(je.push(_t),Xe[_t[s]]?Xe[_t[s]]++:Xe[_t[s]]=1,me[_t.source].degree++,me[_t.target].degree++,me[_t.source].outDegree++,me[_t.target].inDegree++)});for(var qe=Object.keys(x).length,tt=!1,yt=0;yt<qe;yt++){var Ut=Object.keys(x)[yt];if(!Xe[Ut]||Xe[Ut]<x[Ut].length){tt=!0;break}}if(tt)return Et.splice(ie,1),"continue";var gr=je.length;if(gr<e.edges.length)return Et.splice(ie,1),"break";for(var Pt=!1,wr=function(ue){var ve=je[ue],Ze=ve[s],ct=x[Ze];if(!ct||!ct.length)return Xe[Ze]--,ct&&Xe[Ze]<ct.length?(Pt=!0,"break"):(je.splice(ue,1),me[ve.source].degree--,me[ve.target].degree--,me[ve.source].outDegree--,me[ve.target].inDegree--,"continue");var St=me[ve.source].node[o],Tr=me[ve.target].node[o],zr=!1;if(ct.forEach(function(qr){var Zn=m[qr.source].node,Qn=m[qr.target].node;Zn[o]===St&&Qn[o]===Tr&&(zr=!0),!n&&Zn[o]===Tr&&Qn[o]===St&&(zr=!0)}),!zr)return Xe[Ze]--,ct&&Xe[Ze]<ct.length?(Pt=!0,"break"):(je.splice(ue,1),me[ve.source].degree--,me[ve.target].degree--,me[ve.source].outDegree--,me[ve.target].inDegree--,"continue")},yt=gr-1;yt>=0;yt--){var Zt=wr(yt);if(Zt==="break")break}if(Pt)return Et.splice(ie,1),"continue";L.edges=je;var Mr=cc(L,L.nodes[0].id,!1).length;if(Object.keys(Mr).reverse().forEach(function(_t){if(!(_t===L.nodes[0].id||Pt)){if(Mr[_t]===1/0){var ue=me[_t].node[o];if(Pe[ue]--,Pe[ue]<b[ue].length){Pt=!0;return}var ve=L.nodes.indexOf(me[_t].node);L.nodes.splice(ve,1),me[_t]=void 0;return}var Ze=p[_t].node[o];if(!Gt[Ze]||!Gt[Ze].length||Mr[_t]>Gt[Ze][Gt[Ze].length-1]){var ue=me[_t].node[o];if(Pe[ue]--,Pe[ue]<b[ue].length){Pt=!0;return}var ve=L.nodes.indexOf(me[_t].node);L.nodes.splice(ve,1),me[_t]=void 0}}}),Pt)return Et.splice(ie,1),"continue";for(var Er=!0,vn=0;Er&&!Pt;){Er=!1;var ir=n?me[Se.id].degree<m[ee.id].degree||me[Se.id].inDegree<m[ee.id].inDegree||me[Se.id].outDegree<m[ee.id].outDegree:me[Se.id].degree<m[ee.id].degree;if(ir){Pt=!0;break}if(Pe[Se[o]]<b[Se[o]].length){Pt=!0;break}for(var Br=L.nodes.length,ui=Br-1;ui>=0;ui--){var Kr=L.nodes[ui],$i=me[Kr.id].degree,lo=me[Kr.id].inDegree,fo=me[Kr.id].outDegree,on=Kr[o],pi=e2(we,on,m,b),ia=pi.minPatternNodeLabelDegree,co=pi.minPatternNodeLabelInDegree,ho=pi.minPatternNodeLabelOutDegree,vo=n?$i<ia||lo<co||fo<ho:$i<ia;if(vo){if(Pe[Kr[o]]--,Pe[Kr[o]]<b[Kr[o]].length){Pt=!0;break}L.nodes.splice(ui,1),me[Kr.id]=void 0,Er=!0}}if(Pt||!Er&&vn!==0)break;gr=je.length;for(var li=gr-1;li>=0;li--){var jr=je[li];if(!me[jr.source]||!me[jr.target]){je.splice(li,1);var qn=jr[s];if(Xe[qn]--,me[jr.source]&&(me[jr.source].degree--,me[jr.source].outDegree--),me[jr.target]&&(me[jr.target].degree--,me[jr.target].inDegree--),x[qn]&&Xe[qn]<x[qn].length){Pt=!0;break}Er=!0}}vn++}if(Pt||Pt||L.nodes.length<e.nodes.length||je.length<e.edges.length)return Et.splice(ie,1),"continue"},rr=jt-1;rr>=0;rr--){var Rt=Sr(rr);if(Rt==="break")break}for(var sr=Et.length,Hr=function(ie){var L=Et[ie],Se={};L.edges.forEach(function(je){var Xe="".concat(je.source,"-").concat(je.target,"-").concat(je.label);Se[Xe]?Se[Xe]++:Se[Xe]=1});for(var Pe=function(Xe){var qe=Et[Xe],tt={};qe.edges.forEach(function(Ut){var gr="".concat(Ut.source,"-").concat(Ut.target,"-").concat(Ut.label);tt[gr]?tt[gr]++:tt[gr]=1});var yt=!0;Object.keys(tt).length!==Object.keys(Se).length?yt=!1:Object.keys(Se).forEach(function(Ut){tt[Ut]!==Se[Ut]&&(yt=!1)}),yt&&Et.splice(Xe,1)},me=sr-1;me>ie;me--)Pe(me);sr=Et.length},rr=0;rr<=sr-1;rr++)Hr(rr);return Et}}},gl=function(){function r(t){t===void 0&&(t=10),this.linkedList=new AI,this.maxStep=t}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r}(),qI=G1;const YU={getAdjMatrix:du,breadthFirstSearch:II,connectedComponent:F1,getDegree:Po,getInDegree:LI,getOutDegree:kI,detectCycle:G1,detectDirectedCycle:qI,detectAllCycles:NI,detectAllDirectedCycle:U1,detectAllUndirectedCycle:$1,depthFirstSearch:z1,dijkstra:cc,findAllPath:BI,findShortestPath:RI,floydWarshall:dc,labelPropagation:FI,louvain:X1,iLouvain:zI,kCore:GI,kMeans:$I,cosineSimilarity:Y1,nodesCosineSimilarity:UI,minimumSpanningTree:jI,pageRank:WI,getNeighbors:Ni,Stack:gl,GADDI:KI},VU=Object.freeze(Object.defineProperty({__proto__:null,GADDI:KI,Stack:gl,breadthFirstSearch:II,connectedComponent:F1,cosineSimilarity:Y1,default:YU,depthFirstSearch:z1,detectAllCycles:NI,detectAllDirectedCycle:U1,detectAllUndirectedCycle:$1,detectCycle:G1,detectDirectedCycle:qI,dijkstra:cc,findAllPath:BI,findShortestPath:RI,floydWarshall:dc,getAdjMatrix:du,getDegree:Po,getInDegree:LI,getNeighbors:Ni,getOutDegree:kI,iLouvain:zI,kCore:GI,kMeans:$I,labelPropagation:FI,louvain:X1,minimumSpanningTree:jI,nodesCosineSimilarity:UI,pageRank:WI},Symbol.toStringTag,{value:"Module"}));var Sv=ra,HU=function(t){return function(e,n){return e[t]-n[t]}},t2=function(t,e,n){return t>=e&&t<=n},mp=function(t,e,n,i){var a=1e-4,o={x:n.x-t.x,y:n.y-t.y},s={x:e.x-t.x,y:e.y-t.y},u={x:i.x-n.x,y:i.y-n.y},l=s.x*u.y-s.y*u.x,f=l*l,c=1/l,d=s.x*s.x+s.y*s.y,h=u.x*u.x+u.y*u.y;if(f>a*d*h){var v=(o.x*u.y-o.y*u.x)*c,p=(o.x*s.y-o.y*s.x)*c;return!t2(v,0,1)||!t2(p,0,1)?null:{x:t.x+v*s.x,y:t.y+v*s.y}}return null},ZI=function(t,e){var n=t.x,i=t.y,a=t.width,o=t.height,s=n+a/2,u=i+o/2,l=[],f={x:s,y:u};l.push({x:n,y:i}),l.push({x:n+a,y:i}),l.push({x:n+a,y:i+o}),l.push({x:n,y:i+o}),l.push({x:n,y:i});for(var c=null,d=1;d<l.length&&(c=mp(l[d-1],l[d],f,e),!c);d++);return c},QI=function(t,e){var n=t.x,i=t.y,a=t.r,o=e.x,s=e.y,u=o-n,l=s-i;if(u*u+l*l<a*a)return null;var f=Math.atan(l/u);return{x:n+Math.abs(a*Math.cos(f))*Math.sign(u),y:i+Math.abs(a*Math.sin(f))*Math.sign(l)}},JI=function(t,e){var n=t.rx,i=t.ry,a=t.x,o=t.y,s=e.x-a,u=e.y-o,l=Math.atan2(u/i,s/n);return l<0&&(l+=2*Math.PI),{x:a+n*Math.cos(l),y:o+i*Math.sin(l)}},xl=function(t,e,n){n===void 0&&(n=1);var i=[t.x,t.y,n];return(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]),gp(i,i,e),{x:i[0],y:i[1]}},eO=function(t,e,n){n===void 0&&(n=1),(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]);var i=_1([1,0,0,0,1,0,0,0,1],e);i||(i=[1,0,0,0,1,0,0,0,1]);var a=[t.x,t.y,n];return gp(a,a,i),{x:a[0],y:a[1]}},Ly=function(t,e,n){var i=t.x-e.x,a=t.y-e.y,o=t.x-n.x,s=t.y-n.y,u=(t.x*t.x-e.x*e.x-e.y*e.y+t.y*t.y)/2,l=(t.x*t.x-n.x*n.x-n.y*n.y+t.y*t.y)/2,f=a*o-i*s;return{x:-(s*u-a*l)/f,y:-(i*l-o*u)/f}},Mv=function(t,e){var n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)},KU=function(t,e){var n=[];return t.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*e)}),n.push(a)}),n},qU=function(t){for(var e=[],n=t.length,i=0;i<n;i+=1){e[i]=[];for(var a=0;a<n;a+=1)i===a?e[i][a]=0:t[i][a]===0||!t[i][a]?e[i][a]=1/0:e[i][a]=t[i][a]}for(var o=0;o<n;o+=1)for(var i=0;i<n;i+=1)for(var a=0;a<n;a+=1)e[i][a]>e[i][o]+e[o][a]&&(e[i][a]=e[i][o]+e[o][a]);return e},ZU=function(t,e){var n=t.nodes,i=t.edges,a=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(s,u){o[s.id]=u;var l=[];a.push(l)}),i&&i.forEach(function(s){var u=s.source,l=s.target,f=o[u],c=o[l];a[f][c]=1,e||(a[c][f]=1)}),a},tO=function(t,e){t.translate(e.x,e.y)},ky=function(t,e,n,i){i===void 0&&(i={duration:500});var a=t.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=t.getCanvasBBox(),s=e.x-o.minX,u=e.y-o.minY;if(n){var l=s*a[0],f=u*a[4],c=0,d=0,h=0,v=0;t.animate(function(g){return h=l*g,v=f*g,a=Sv(a,[["t",h-c,v-d]]),c=h,d=v,{matrix:a}},i)}else{var p=Sv(a,[["t",s,u]]);t.setMatrix(p)}},QU=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var i=e;wt(e)||(i=[e,e]),wt(e)&&e.length===1&&(i=[e[0],e[0]]),n=Sv(n,[["s",i[0],i[1]]]),t.setMatrix(n)},JU=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=Sv(n,[["r",e]]),t.setMatrix(n)},ej=function(t,e,n){for(var i=[],a=0;a<t;a++)i[a]=0;return n.forEach(function(o){o.source&&(i[e[o.source]]+=1),o.target&&(i[e[o.target]]+=1)}),i};function tj(r,t,e){return(e[0]-r[0])*(t[1]-r[1])===(t[0]-r[0])*(e[1]-r[1])&&Math.min(r[0],t[0])<=e[0]&&e[0]<=Math.max(r[0],t[0])&&Math.min(r[1],t[1])<=e[1]&&e[1]<=Math.max(r[1],t[1])}var hc=function(t,e,n){var i=!1,a=t.length,o=1e-6;function s(c){return Math.abs(c)<o?0:c<0?-1:1}if(a<=2)return!1;for(var u=0;u<a;u++){var l=t[u],f=t[(u+1)%a];if(tj(l,f,[e,n]))return!0;s(l[1]-n)>0!=s(f[1]-n)>0&&s(e-(n-l[1])*(l[0]-f[0])/(l[1]-f[1])-l[0])<0&&(i=!i)}return i},rO=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},rj=function(t,e){var n=!1;return xe(t,function(i){if(mp(i.from,i.to,e.from,e.to))return n=!0,!1}),n},nO=function(t,e){var n=function(d){var h=d.map(function(p){return p[0]}),v=d.map(function(p){return p[1]});return{minX:Math.min.apply(null,h),maxX:Math.max.apply(null,h),minY:Math.min.apply(null,v),maxY:Math.max.apply(null,v)}},i=function(d){for(var h=[],v=d.length,p=0;p<v-1;p++){var g=d[p],y=d[p+1];h.push({from:{x:g[0],y:g[1]},to:{x:y[0],y:y[1]}})}if(h.length>1){var m=d[0],b=d[v-1];h.push({from:{x:b[0],y:b[1]},to:{x:m[0],y:m[1]}})}return h};if(t.length<2||e.length<2)return!1;var a=n(t),o=n(e);if(!rO(a,o))return!1;var s=!1;if(xe(e,function(c){if(hc(t,c[0],c[1]))return s=!0,!1}),s||(xe(t,function(c){if(hc(e,c[0],c[1]))return s=!0,!1}),s))return!0;var u=i(t),l=i(e),f=!1;return xe(l,function(c){if(rj(u,c))return f=!0,!1}),f},hu=function(){function r(t,e,n,i){this.x1=t,this.y1=e,this.x2=n,this.y2=i}return r.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),i=Math.max(this.y1,this.y2),a={x:t,y:e,minX:t,minY:e,maxX:n,maxY:i,width:n-t,height:i-e};return a},r}(),V1=function(t,e){var n={top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]};return n[e]},nj=function(t,e){var n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),i=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),a=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(a){var o=n/a,s=i/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},iO=function(t,e){for(var n=["top","left","bottom","right"],i=t.getBBox(),a=0,o=[],s=0;s<4;s++){var u=V1(i,n[s]),l=u[0],f=u[1],c=u[2],d=u[3];o[s]=mp({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:l,y:f},{x:c,y:d}),o[s]&&(a+=1)}return[o,a]},H1=function(t,e){for(var n=["top","left","bottom","right"],i=t.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var u=V1(i,n[s]),l=u[0],f=u[1],c=u[2],d=u[3],h=nj(e,new hu(l,f,c,d));h=Math.abs(h-.5),h>=0&&h<=1&&(o+=1,a=h<a?h:a)}return o===0?-1:a},aO=function(t){var e=0,n=0;if(t.length>0){for(var i=0,a=t;i<a.length;i++){var o=a[i];e+=o.x,n+=o.y}e/=t.length,n/=t.length}return{x:e,y:n}},Cv=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},oO=function(t,e){var n=e.x1,i=e.y1,a=e.x2-n,o=e.y2-i,s=t.x-n,u=t.y-i,l=s*a+u*o,f;l<=0?f=0:(s=a-s,u=o-u,l=s*a+u*o,l<=0?f=0:f=l*l/(a*a+o*o));var c=s*s+u*u-f;return c<0&&(c=0),c},Dy=function(t,e,n){return n===void 0&&(n=.001),Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(n,2)},sO=function(t,e){var n=t.x<e.x,i=t.x>e.x+e.width,a=t.y>e.y+e.height,o=t.y<e.y,s=n||i||a||o;if(!s)return 0;if(a&&!n&&!i)return Math.pow(e.y+e.height-t.y,2);if(o&&!n&&!i)return Math.pow(t.y-e.y,2);if(n&&!a&&!o)return Math.pow(e.x-t.x,2);if(i&&!a&&!o)return Math.pow(e.x+e.width-t.x,2);var u=Math.min(Math.abs(e.x-t.x),Math.abs(e.x+e.width-t.x)),l=Math.min(Math.abs(e.y-t.y),Math.abs(e.y+e.height-t.y));return u*u+l*l},ij=function(t,e){var n=t[0],i=t[1],a=t[2],o=t[3],s=e.x,u=e.y,l=[a-n,o-i];if(B1(l,[0,0]))return NaN;var f=[-l[1],l[0]];gs(f,f);var c=[s-n,u-i];return Math.abs(R1(c,f))},K1=function(t,e,n){return t+(e-t)*n},Ny=function(t,e,n){for(var i=Math.min(t.length,e.length),a=new Array(i),o=0;o<i;o++)a[o]=K1(t[o],e[o],n);return a};const aj=Object.freeze(Object.defineProperty({__proto__:null,Line:hu,applyMatrix:xl,compare:HU,distance:Mv,floydWarshall:qU,fractionToLine:H1,getAdjMatrix:ZU,getBBoxBoundLine:V1,getCircleCenterByPoints:Ly,getCircleIntersectByPoint:QI,getDegree:ej,getEllipseIntersectByPoint:JI,getLineIntersect:mp,getPointsCenter:aO,getRectIntersectByPoint:ZI,intersectBBox:rO,invertMatrix:eO,isPointInPolygon:hc,isPointsOverlap:Dy,isPolygonsIntersect:nO,itemIntersectByLine:iO,lerp:K1,lerpArray:Ny,move:ky,pointLineDistance:ij,pointLineSquareDist:oO,pointRectSquareDist:sO,rotate:JU,scale:QU,scaleMatrix:KU,squareDist:Cv,translate:tO},Symbol.toStringTag,{value:"Module"}));var qo="rgb(95, 149, 255)",oj="rgb(255, 255, 255)",r2="rgb(0, 0, 0)",h0="rgb(247, 250, 255)",uO="rgb(239, 244, 255)",Vd="rgb(253, 253, 253)",n2="rgb(250, 250, 250)",Hd="rgb(224, 224, 224)",i2="rgb(234, 234, 234)",sj="rgb(245, 245, 245)",uj="rgb(191, 213, 255)",a2="#4572d9",lj="rgb(223, 234, 255)",br={mainStroke:qo,mainFill:uO,activeStroke:qo,activeFill:h0,inactiveStroke:uj,inactiveFill:h0,selectedStroke:qo,selectedFill:oj,highlightStroke:a2,highlightFill:lj,disableStroke:Hd,disableFill:n2,edgeMainStroke:Hd,edgeActiveStroke:qo,edgeInactiveStroke:i2,edgeSelectedStroke:qo,edgeHighlightStroke:qo,edgeDisableStroke:sj,comboMainStroke:Hd,comboMainFill:Vd,comboActiveStroke:qo,comboActiveFill:h0,comboInactiveStroke:Hd,comboInactiveFill:Vd,comboSelectedStroke:qo,comboSelectedFill:Vd,comboHighlightStroke:a2,comboHighlightFill:Vd,comboDisableStroke:i2,comboDisableFill:n2};const pt={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:br.mainStroke,fill:uO},size:20,color:br.mainStroke,linkPoints:{size:8,lineWidth:1,fill:br.activeFill,stroke:br.activeStroke}},nodeStateStyles:{active:{fill:br.activeFill,stroke:br.activeStroke,lineWidth:2,shadowColor:br.mainStroke,shadowBlur:10},selected:{fill:br.selectedFill,stroke:br.selectedStroke,lineWidth:4,shadowColor:br.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:br.highlightFill,stroke:br.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:br.inactiveFill,stroke:br.inactiveStroke,lineWidth:1},disable:{fill:br.disableFill,stroke:br.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:r2,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:br.edgeMainStroke,lineAppendWidth:2},color:br.edgeMainStroke},edgeStateStyles:{active:{stroke:br.edgeActiveStroke,lineWidth:1},selected:{stroke:br.edgeSelectedStroke,lineWidth:2,shadowColor:br.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:br.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:br.edgeInactiveStroke,lineWidth:1},disable:{stroke:br.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:r2,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:br.comboMainFill,lineWidth:1,stroke:br.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:br.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:br.comboActiveStroke,lineWidth:1,fill:br.comboActiveFill},selected:{stroke:br.comboSelectedStroke,lineWidth:2,fill:br.comboSelectedFill,shadowColor:br.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:br.comboHighlightStroke,lineWidth:2,fill:br.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:br.comboInactiveStroke,fill:br.comboInactiveFill,lineWidth:1},disable:{stroke:br.comboDisableStroke,fill:br.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window<"u"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},fj={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,0:.6,1:.40099945068359377,2:.6,3:.6,4:.6,5:.6,6:.6,7:.5469985961914062,8:.6,9:.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875};var Na=Math.PI,Py=Math.sin,Ry=Math.cos,Fn=Py(Na/8),zn=Ry(Na/8),Av=function(t,e){var n=t.getBBox(),i={x:n.minX,y:n.minY},a={x:n.maxX,y:n.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),i=xl(i,o),a=xl(a,o)}var s=i.x,u=i.y,l=a.x,f=a.y;return{x:s,y:u,minX:s,minY:u,maxX:l,maxY:f,width:l-s,height:f-u}},lO=function(t){var e=t.sourceNode||t.targetNode,n=e.get("group"),i=n.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var a=e.getKeyShape(),o=a.getBBox(),s=t.loopCfg||{},u=s.dist||Math.max(o.width,o.height)*2,l=s.position||pt.defaultLoopPosition,f=[(o.minX+o.maxX)/2+i[6],(o.minY+o.maxY)/2+i[7]],c=[t.startPoint.x,t.startPoint.y],d=[t.endPoint.x,t.endPoint.y],h=o.height/2,v=o.width/2,p=h,g=h,y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,w=a.get("type"),E=Math.min(h/2,v/2),_=Math.min(h,v),M=s!=null&&s.pointPadding?Math.min(_,s==null?void 0:s.pointPadding):E;if(c[0]===d[0]&&c[1]===d[1]){switch(l){case"top":w==="circle"?(c=[f[0]-y,f[1]-m],d=[f[0]+b,f[1]-x]):(c=[f[0]-M,f[1]-h],d=[f[0]+M,f[1]-h]);break;case"top-right":p=h,g=v,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]+y,f[1]-m],d=[f[0]+x,f[1]-b]):(c=[f[0]+v-M,f[1]-h],d=[f[0]+v,f[1]-h+M]);break;case"right":p=v,g=v,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]+m,f[1]-y],d=[f[0]+x,f[1]+b]):(c=[f[0]+v,f[1]-M],d=[f[0]+v,f[1]+M]);break;case"bottom-right":p=v,g=h,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]+m,f[1]+y],d=[f[0]+b,f[1]+x]):(c=[f[0]+v,f[1]+h-M],d=[f[0]+v-M,f[1]+h]);break;case"bottom":p=h,g=h,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]+y,f[1]+m],d=[f[0]-b,f[1]+x]):(c=[f[0]-M,f[1]+h],d=[f[0]+M,f[1]+h]);break;case"bottom-left":p=h,g=v,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]-y,f[1]+m],d=[f[0]-x,f[1]+b]):(c=[f[0]-v,f[1]+h-M],d=[f[0]-v+M,f[1]+h]);break;case"left":p=v,g=v,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]-m,f[1]+y],d=[f[0]-x,f[1]-b]):(c=[f[0]-v,f[1]-M],d=[f[0]-v,f[1]+M]);break;case"top-left":p=v,g=h,w==="circle"?(y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]-m,f[1]-y],d=[f[0]-b,f[1]-x]):(c=[f[0]-v+M,f[1]-h],d=[f[0]-v,f[1]-h+M]);break;default:p=v,g=v,y=p*Fn,m=p*zn,b=g*Fn,x=g*zn,c=[f[0]-y,f[1]-m],d=[f[0]+b,f[1]-x]}if(s.clockwise===!1){var C=[c[0],c[1]];c=[d[0],d[1]],d=[C[0],C[1]]}}var S=[c[0]-f[0],c[1]-f[1]],A=(p+u)/p,T=(g+u)/g;s.clockwise===!1&&(A=(g+u)/g,T=(p+u)/p);var I=oi([0,0],S,A),k=[f[0]+I[0],f[1]+I[1]],P=[d[0]-f[0],d[1]-f[1]],N=oi([0,0],P,T),z=[f[0]+N[0],f[1]+N[1]];return t.startPoint={x:c[0],y:c[1]},t.endPoint={x:d[0],y:d[1]},t.controlPoints=[{x:k[0],y:k[1]},{x:z[0],y:z[1]}],t},fO=function(t,e,n,i,a){var o=1e-4,s=[],u=t==null?void 0:t.getPoint(e);if(!u)return{x:0,y:0,angle:0};if(e<o)s=t.getStartTangent().reverse();else if(e>1-o)s=t.getEndTangent();else{var l=t==null?void 0:t.getPoint(e+o);s.push([u.x,u.y]),s.push([l.x,l.y])}var f=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(f<0&&(f+=Na*2),n&&(u.x+=Ry(f)*n,u.y+=Py(f)*n),i){var c=f-Na/2;f>1/2*Na&&f<3*1/2*Na&&(c-=Na),u.x+=Ry(c)*i,u.y+=Py(c)*i}var d={x:u.x,y:u.y,angle:f};return a?(f>.5*Na&&f<1.5*Na&&(f-=Na),F({rotate:f},d)):d},cj=function r(t,e,n,i){if(i(t,e,n)===!1)return!1;if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!r(t.children[a],t,a,i))return!1}return!0},dj=function r(t,e,n,i){if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!r(t.children[a],t,a,i))return}return i(t,e,n)!==!1},ai=function(t,e){typeof e=="function"&&cj(t,null,-1,e)},Pa=function(t,e){typeof e=="function"&&dj(t,null,-1,e)},cO=function(t,e){return e*(fj[t]||1)},dO=function(t,e){var n=0,i=new RegExp("[一-龥]+");return t.split("").forEach(function(a){i.test(a)?n+=e:n+=cO(a,e)}),[n,e]},hO=function(t,e){return typeof e!="number"||e<=0||e>=t.length?t:t.substring(0,e)+"..."},By=function(t,e){var n=[],i={},a={};t.forEach(function(u){a[u.id]=u}),t.forEach(function(u,l){var f=ar(u);f.itemType="combo",f.children=void 0,f.parentId===f.id?(console.warn("The parentId for combo ".concat(f.id," can not be the same as the combo's id")),delete f.parentId):f.parentId&&!a[f.parentId]&&(console.warn("The parent combo for combo ".concat(f.id," does not exist!")),delete f.parentId);var c=i[f.id];if(c){if(f.children=c.children,i[f.id]=f,c=f,!c.parentId){n.push(c);return}var d=i[c.parentId];if(d)d.children?d.children.push(f):d.children=[f];else{var h={id:c.parentId,children:[c]};i[c.parentId]=h,i[f.id]=f}return}if(Fe(u.parentId)){var v=i[u.parentId];if(v)v.children?v.children.push(f):v.children=[f],i[f.id]=f;else{var p={id:u.parentId,children:[f]};i[p.id]=p,i[f.id]=f}}else n.push(f),i[f.id]=f});var o={};(e||[]).forEach(function(u){o[u.id]=u;var l=i[u.comboId];if(l){var f={id:u.id,comboId:u.comboId};l.children?l.children.push(f):l.children=[f],f.itemType="node",i[u.id]=f}});var s=0;return n.forEach(function(u){u.depth=s+10,ai(u,function(l){var f,c=i[l.id].itemType;c==="node"?f=i[l.comboId]:f=i[l.parentId],f&&c==="node"?l.depth=s+1:l.depth=s+10,s<l.depth&&(s=l.depth);var d=o[l.id];return d&&(d.depth=l.depth),!0})}),n},Fy=function(t,e,n){var i,a=t,o,s={root:{children:t}},u=!1,l="root";(t||[]).forEach(function(v){if(!u){if(v.id===e){o=v,v.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0;return}ai(v,function(p){var g;return s[p.id]={children:(p==null?void 0:p.children)||[]},a=(g=s[p.parentId||p.comboId||"root"])===null||g===void 0?void 0:g.children,p&&(p.removed||e===p.id)&&a?(l=p.parentId||p.comboId||"root",o=p,p.itemType==="combo"?o.parentId=n:o.comboId=n,u=!0,!1):!0})}}),a=(i=s[l])===null||i===void 0?void 0:i.children;var f=a?a.indexOf(o):-1;if(f>-1&&a.splice(f,1),u||(o={id:e,itemType:"node",comboId:n},s[e]={children:void 0}),e){var c=!1;if(n){var d=0;(t||[]).forEach(function(v){c||ai(v,function(p){return n===p.id?(c=!0,p.children?p.children.push(o):p.children=[o],d=p.depth,o.itemType==="node"?o.depth=d+2:o.depth=d+1,!1):!0})})}else(!n||!c)&&o.itemType!=="node"&&t.push(o);var h=o.depth;ai(o,function(v){return v.itemType==="node"?h+=2:h+=1,v.depth=h,!0})}return t},qh=function(t,e,n){var i={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!t||t.length===0){var a=n==null?void 0:n.getModel(),o=a||{},s=o.x,u=o.y,l=o.fixSize,f=o.collapsed,c=o.fixCollapseSize,d=f?c:l,h=wt(d)?d:[d,d],v=h[0],p=h[1],g=[v/2,p/2];return{minX:s-g[0],minY:u-g[1],maxX:s+g[0],maxY:u+g[1],x:s,y:u,width:v,height:p}}return t.forEach(function(y){var m=e.findById(y.id);if(!(!m||!m.isVisible())){m.set("bboxCanvasCache",void 0);var b=m.getCanvasBBox();b.x&&i.minX>b.minX&&(i.minX=b.minX),b.y&&i.minY>b.minY&&(i.minY=b.minY),b.x&&i.maxX<b.maxX&&(i.maxX=b.maxX),b.y&&i.maxY<b.maxY&&(i.maxY=b.maxY)}}),i.x=(i.minX+i.maxX)/2,i.y=(i.minY+i.maxY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY,i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2,(n==null?void 0:n.getKeyShape().get("type"))==="circle"&&(i.width=Math.hypot(i.height,i.width),i.height=i.width),Object.keys(i).forEach(function(y){(i[y]===1/0||i[y]===-1/0)&&(i[y]=void 0)}),i},hj=function(t){var e=mt(t.x)||mt(t.y)||t.type||t.anchorPoints||t.size;return t.style&&(e=e||mt(t.style.r)||mt(t.style.width)||mt(t.style.height)||mt(t.style.rx)||mt(t.style.ry)),e},Zh=function(t){var e={};return Object.keys(t).forEach(function(n){var i=t[n];if(!(n==="img"&&!Fe(i)))if(Wn(i)&&!wt(i)){var a={};Object.keys(i).forEach(function(o){var s=i[o];o==="img"&&!Fe(s)||(a[o]=ar(s))}),e[n]=a}else e[n]=ar(i)}),e},vc=function(t){var e=t.animateCfg,n=t.callback,i;if(!e)i={duration:500,callback:n};else if(i=ar(e),e.callback){var a=e.callback;i.callback=function(){n(),a()}}else i.callback=n;return i};const vj=Object.freeze(Object.defineProperty({__proto__:null,cloneBesidesImg:Zh,getAnimateCfgWithCallback:vc,getBBox:Av,getComboBBox:qh,getLabelPosition:fO,getLetterWidth:cO,getLoopCfgs:lO,getTextSize:dO,plainCombosToTrees:By,reconstructTree:Fy,shouldRefreshEdge:hj,traverseTree:ai,traverseTreeUp:Pa,truncateLabelByLength:hO},Symbol.toStringTag,{value:"Module"}));var o2=function(t){if(!t)return console.error("G6 Error Tips: the data must be defined"),!1;var e=t.nodes,n=t.edges,i=t.combos,a=i===void 0?[]:i;if(!e&&!n){var o=!0;return ai(t,function(d){return Fe(d.id)?!0:(o=!1,!1)}),o}var s=(e||[]).find(function(d){return!Fe(d.id)});if(s)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(s.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var u=(e||[]).map(function(d){return d.id}),l=a==null?void 0:a.map(function(d){return d.id}),f=Bi(Bi([],u,!0),l,!0),c=(n||[]).find(function(d){return!f.includes(d.source)||!f.includes(d.target)});return c?(console.warn("G6 Warning Tips: The source %c".concat(c.source,"%c or the target %c").concat(c.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},pj=function(t,e){if(t==="node"||t==="combo"){if(e.id&&!Fe(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(e.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(t==="edge"&&(!e.source||!e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0},gj=function(){function r(t){this.graph=t,this.destroyed=!1,this.modes=t.get("modes")||{default:[]},this.formatModes(),this.mode=t.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return r.prototype.formatModes=function(){var t=this.modes;xe(t,function(e){xe(e,function(n,i){Fe(n)&&(e[i]={type:n})})})},r.prototype.setBehaviors=function(t){var e=this.graph,n=this.modes[t],i=[],a;xe(n||[],function(o){var s=E1.getBehavior(o.type||o);s&&(a=new s(o),a&&(a.bind(e),i.push(a)))}),this.currentBehaves=i},r.mergeBehaviors=function(t,e){return xe(e,function(n){t.indexOf(n)<0&&(Fe(n)&&(n={type:n}),t.push(n))}),t},r.filterBehaviors=function(t,e){var n=[];return t.forEach(function(i){var a="";Fe(i)?a=i:a=i.type,e.indexOf(a)<0&&n.push(i)}),n},r.prototype.setMode=function(t){var e=this,n=e.modes,i=e.graph,a=t,o=n[a];o&&(i.emit("beforemodechange",{mode:t}),xe(this.currentBehaves,function(s){s.delegate&&s.delegate.remove(),s.unbind(i)}),this.setBehaviors(a),i.emit("aftermodechange",{mode:t}),this.mode=t)},r.prototype.getMode=function(){return this.mode},r.prototype.manipulateBehaviors=function(t,e,n){var i=this,a;if(wt(t)?a=t:a=[t],wt(e))return xe(e,function(s){i.modes[s]?n?i.modes[s]=r.mergeBehaviors(i.modes[s]||[],a):i.modes[s]=r.filterBehaviors(i.modes[s]||[],a):n&&(i.modes[s]=a)}),this;var o=e;return e||(o=this.mode),this.modes[o]||n&&(this.modes[o]=a),n?this.modes[o]=r.mergeBehaviors(this.modes[o]||[],a):this.modes[o]=r.filterBehaviors(this.modes[o]||[],a),this.formatModes(),this.setMode(this.mode),this},r.prototype.updateBehavior=function(t,e,n){Fe(t)&&(t={type:t});var i=[];if(!n||n===this.mode||n==="default"){if(i=this.currentBehaves,!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=i.length,o=0;o<a;o++){var s=i[o];if(s.type===t.type)return s.updateCfg(e),this;o===a-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(i=this.modes[n],!i||!i.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var u=i.length,o=0;o<u;o++){var s=i[o];if(s.type===t.type||s===t.type)return s===t.type&&(s={type:s}),Object.assign(s,e),i[o]=s,this;o===u-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},r.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},r}(),Kf=`
|
|
269
|
+
\v\f\r \u2028\u2029`,yj=new RegExp("([a-z])["+Kf+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Kf+"]*,?["+Kf+"]*)+)","ig"),mj=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Kf+"]*,?["+Kf+"]*","ig"),yl=function(r){if(!r)return null;if(wt(r))return r;var t={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},e=[];return String(r).replace(yj,function(n,i,a){var o=[],s=i.toLowerCase();if(a.replace(mj,function(u,l){l&&o.push(+l)}),s==="m"&&o.length>2&&(e.push([i].concat(o.splice(0,2))),s="l",i=i==="m"?"l":"L"),s==="o"&&o.length===1&&e.push([i,o[0]]),s==="r")e.push([i].concat(o));else for(;o.length>=t[s]&&(e.push([i].concat(o.splice(0,t[s]))),!!t[s]););return r}),e},zy=function(r,t){for(var e=[],n=0,i=r.length;i-2*!t>n;n+=2){var a=[{x:+r[n-2],y:+r[n-1]},{x:+r[n],y:+r[n+1]},{x:+r[n+2],y:+r[n+3]},{x:+r[n+4],y:+r[n+5]}];t?n?i-4===n?a[3]={x:+r[0],y:+r[1]}:i-2===n&&(a[2]={x:+r[0],y:+r[1]},a[3]={x:+r[2],y:+r[3]}):a[0]={x:+r[i-2],y:+r[i-1]}:i-4===n?a[3]=a[2]:n||(a[0]={x:+r[n],y:+r[n+1]}),e.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return e},Kd=function(r,t,e,n,i){var a=[];if(i===null&&n===null&&(n=e),r=+r,t=+t,e=+e,n=+n,i!==null){var o=Math.PI/180,s=r+e*Math.cos(-n*o),u=r+e*Math.cos(-i*o),l=t+e*Math.sin(-n*o),f=t+e*Math.sin(-i*o);a=[["M",s,l],["A",e,e,0,+(i-n>180),0,u,f]]}else a=[["M",r,t],["m",0,-n],["a",e,n,0,1,1,0,2*n],["a",e,n,0,1,1,0,-2*n],["z"]];return a},Gy=function(r){if(r=yl(r),!r||!r.length)return[["M",0,0]];var t=[],e=0,n=0,i=0,a=0,o=0,s,u;r[0][0]==="M"&&(e=+r[0][1],n=+r[0][2],i=e,a=n,o++,t[0]=["M",e,n]);for(var l=r.length===3&&r[0][0]==="M"&&r[1][0].toUpperCase()==="R"&&r[2][0].toUpperCase()==="Z",f=void 0,c=void 0,d=o,h=r.length;d<h;d++){if(t.push(f=[]),c=r[d],s=c[0],s!==s.toUpperCase())switch(f[0]=s.toUpperCase(),f[0]){case"A":f[1]=c[1],f[2]=c[2],f[3]=c[3],f[4]=c[4],f[5]=c[5],f[6]=+c[6]+e,f[7]=+c[7]+n;break;case"V":f[1]=+c[1]+n;break;case"H":f[1]=+c[1]+e;break;case"R":u=[e,n].concat(c.slice(1));for(var v=2,p=u.length;v<p;v++)u[v]=+u[v]+e,u[++v]=+u[v]+n;t.pop(),t=t.concat(zy(u,l));break;case"O":t.pop(),u=Kd(e,n,c[1],c[2]),u.push(u[0]),t=t.concat(u);break;case"U":t.pop(),t=t.concat(Kd(e,n,c[1],c[2],c[3])),f=["U"].concat(t[t.length-1].slice(-2));break;case"M":i=+c[1]+e,a=+c[2]+n;break;default:for(var v=1,p=c.length;v<p;v++)f[v]=+c[v]+(v%2?e:n)}else if(s==="R")u=[e,n].concat(c.slice(1)),t.pop(),t=t.concat(zy(u,l)),f=["R"].concat(c.slice(-2));else if(s==="O")t.pop(),u=Kd(e,n,c[1],c[2]),u.push(u[0]),t=t.concat(u);else if(s==="U")t.pop(),t=t.concat(Kd(e,n,c[1],c[2],c[3])),f=["U"].concat(t[t.length-1].slice(-2));else for(var g=0,y=c.length;g<y;g++)f[g]=c[g];if(s=s.toUpperCase(),s!=="O")switch(f[0]){case"Z":e=+i,n=+a;break;case"H":e=f[1];break;case"V":n=f[1];break;case"M":i=f[f.length-2],a=f[f.length-1];break;default:e=f[f.length-2],n=f[f.length-1]}}return t},qd=function(r,t,e,n){return[r,t,e,n,e,n]},s2=function(r,t,e,n,i,a){var o=.3333333333333333,s=2/3;return[o*r+s*e,o*t+s*n,o*i+s*e,o*a+s*n,i,a]},vO=function(r,t,e,n,i,a,o,s,u,l){e===n&&(e+=1);var f=Math.PI*120/180,c=Math.PI/180*(+i||0),d=[],h,v,p,g,y,m=function(Ae,Ke,ot){var nt=Ae*Math.cos(ot)-Ke*Math.sin(ot),Ct=Ae*Math.sin(ot)+Ke*Math.cos(ot);return{x:nt,y:Ct}};if(l)v=l[0],p=l[1],g=l[2],y=l[3];else{h=m(r,t,-c),r=h.x,t=h.y,h=m(s,u,-c),s=h.x,u=h.y,r===s&&t===u&&(s+=1,u+=1);var b=(r-s)/2,x=(t-u)/2,w=b*b/(e*e)+x*x/(n*n);w>1&&(w=Math.sqrt(w),e=w*e,n=w*n);var E=e*e,_=n*n,M=(a===o?-1:1)*Math.sqrt(Math.abs((E*_-E*x*x-_*b*b)/(E*x*x+_*b*b)));g=M*e*x/n+(r+s)/2,y=M*-n*b/e+(t+u)/2,v=Math.asin(((t-y)/n).toFixed(9)),p=Math.asin(((u-y)/n).toFixed(9)),v=r<g?Math.PI-v:v,p=s<g?Math.PI-p:p,v<0&&(v=Math.PI*2+v),p<0&&(p=Math.PI*2+p),o&&v>p&&(v=v-Math.PI*2),!o&&p>v&&(p=p-Math.PI*2)}var C=p-v;if(Math.abs(C)>f){var S=p,A=s,T=u;p=v+f*(o&&p>v?1:-1),s=g+e*Math.cos(p),u=y+n*Math.sin(p),d=vO(s,u,e,n,i,0,o,A,T,[p,S,g,y])}C=p-v;var I=Math.cos(v),k=Math.sin(v),P=Math.cos(p),N=Math.sin(p),z=Math.tan(C/4),W=4/3*e*z,D=4/3*n*z,R=[r,t],H=[r+W*k,t-D*I],ee=[s+W*N,u-D*P],Y=[s,u];if(H[0]=2*R[0]-H[0],H[1]=2*R[1]-H[1],l)return[H,ee,Y].concat(d);d=[H,ee,Y].concat(d).join().split(",");for(var X=[],fe=0,we=d.length;fe<we;fe++)X[fe]=fe%2?m(d[fe-1],d[fe],c).y:m(d[fe],d[fe+1],c).x;return X},$y=function(r,t){var e=Gy(r),n=t&&Gy(t),i={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=[],s=[],u="",l="",f,c=function(b,x,w){var E,_;if(!b)return["C",x.x,x.y,x.x,x.y,x.x,x.y];switch(!(b[0]in{T:1,Q:1})&&(x.qx=x.qy=null),b[0]){case"M":x.X=b[1],x.Y=b[2];break;case"A":b=["C"].concat(vO.apply(0,[x.x,x.y].concat(b.slice(1))));break;case"S":w==="C"||w==="S"?(E=x.x*2-x.bx,_=x.y*2-x.by):(E=x.x,_=x.y),b=["C",E,_].concat(b.slice(1));break;case"T":w==="Q"||w==="T"?(x.qx=x.x*2-x.qx,x.qy=x.y*2-x.qy):(x.qx=x.x,x.qy=x.y),b=["C"].concat(s2(x.x,x.y,x.qx,x.qy,b[1],b[2]));break;case"Q":x.qx=b[1],x.qy=b[2],b=["C"].concat(s2(x.x,x.y,b[1],b[2],b[3],b[4]));break;case"L":b=["C"].concat(qd(x.x,x.y,b[1],b[2]));break;case"H":b=["C"].concat(qd(x.x,x.y,b[1],x.y));break;case"V":b=["C"].concat(qd(x.x,x.y,x.x,b[1]));break;case"Z":b=["C"].concat(qd(x.x,x.y,x.X,x.Y));break}return b},d=function(b,x){if(b[x].length>7){b[x].shift();for(var w=b[x];w.length;)o[x]="A",n&&(s[x]="A"),b.splice(x++,0,["C"].concat(w.splice(0,6)));b.splice(x,1),f=Math.max(e.length,n&&n.length||0)}},h=function(b,x,w,E,_){b&&x&&b[_][0]==="M"&&x[_][0]!=="M"&&(x.splice(_,0,["M",E.x,E.y]),w.bx=0,w.by=0,w.x=b[_][1],w.y=b[_][2],f=Math.max(e.length,n&&n.length||0))};f=Math.max(e.length,n&&n.length||0);for(var v=0;v<f;v++){e[v]&&(u=e[v][0]),u!=="C"&&(o[v]=u,v&&(l=o[v-1])),e[v]=c(e[v],i,l),o[v]!=="A"&&u==="C"&&(o[v]="C"),d(e,v),n&&(n[v]&&(u=n[v][0]),u!=="C"&&(s[v]=u,v&&(l=s[v-1])),n[v]=c(n[v],a,l),s[v]!=="A"&&u==="C"&&(s[v]="C"),d(n,v)),h(e,n,i,a,v),h(n,e,a,i,v);var p=e[v],g=n&&n[v],y=p.length,m=n&&g.length;i.x=p[y-2],i.y=p[y-1],i.bx=parseFloat(p[y-4])||i.x,i.by=parseFloat(p[y-3])||i.y,a.bx=n&&(parseFloat(g[m-4])||a.x),a.by=n&&(parseFloat(g[m-3])||a.y),a.x=n&&g[m-2],a.y=n&&g[m-1]}return n?[e,n]:e},bj=/,?([a-z]),?/gi,pO=function(r){return r.join(",").replace(bj,"$1")},u2=function(r,t,e,n,i){var a=-3*t+9*e-9*n+3*i,o=r*a+6*t-12*e+6*n;return r*o-3*t+3*e},l2=function(r,t,e,n,i,a,o,s,u){u===null&&(u=1),u=u>1?1:u<0?0:u;for(var l=u/2,f=12,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,v=0;v<f;v++){var p=l*c[v]+l,g=u2(p,r,e,i,o),y=u2(p,t,n,a,s),m=g*g+y*y;h+=d[v]*Math.sqrt(m)}return l*h},xj=function(r,t,e,n,i,a,o,s){for(var u=[],l=[[],[]],f,c,d,h,v=0;v<2;++v){if(v===0?(c=6*r-12*e+6*i,f=-3*r+9*e-9*i+3*o,d=3*e-3*r):(c=6*t-12*n+6*a,f=-3*t+9*n-9*a+3*s,d=3*n-3*t),Math.abs(f)<1e-12){if(Math.abs(c)<1e-12)continue;h=-d/c,h>0&&h<1&&u.push(h);continue}var p=c*c-4*d*f,g=Math.sqrt(p);if(!(p<0)){var y=(-c+g)/(2*f);y>0&&y<1&&u.push(y);var m=(-c-g)/(2*f);m>0&&m<1&&u.push(m)}}for(var b=u.length,x=b,w;b--;)h=u[b],w=1-h,l[0][b]=w*w*w*r+3*w*w*h*e+3*w*h*h*i+h*h*h*o,l[1][b]=w*w*w*t+3*w*w*h*n+3*w*h*h*a+h*h*h*s;return l[0][x]=r,l[1][x]=t,l[0][x+1]=o,l[1][x+1]=s,l[0].length=l[1].length=x+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}},wj=function(r,t,e,n,i,a,o,s){if(!(Math.max(r,e)<Math.min(i,o)||Math.min(r,e)>Math.max(i,o)||Math.max(t,n)<Math.min(a,s)||Math.min(t,n)>Math.max(a,s))){var u=(r*n-t*e)*(i-o)-(r-e)*(i*s-a*o),l=(r*n-t*e)*(a-s)-(t-n)*(i*s-a*o),f=(r-e)*(a-s)-(t-n)*(i-o);if(f){var c=u/f,d=l/f,h=+c.toFixed(2),v=+d.toFixed(2);if(!(h<+Math.min(r,e).toFixed(2)||h>+Math.max(r,e).toFixed(2)||h<+Math.min(i,o).toFixed(2)||h>+Math.max(i,o).toFixed(2)||v<+Math.min(t,n).toFixed(2)||v>+Math.max(t,n).toFixed(2)||v<+Math.min(a,s).toFixed(2)||v>+Math.max(a,s).toFixed(2)))return{x:c,y:d}}}},Zo=function(r,t,e){return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},gO=function(r,t,e,n,i){if(i)return[["M",+r+ +i,t],["l",e-i*2,0],["a",i,i,0,0,1,i,i],["l",0,n-i*2],["a",i,i,0,0,1,-i,i],["l",i*2-e,0],["a",i,i,0,0,1,-i,-i],["l",0,i*2-n],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",r,t],["l",e,0],["l",0,n],["l",-e,0],["z"]];return a.parsePathArray=pO,a},Uy=function(r,t,e,n){return r===null&&(r=t=e=n=0),t===null&&(t=r.y,e=r.width,n=r.height,r=r.x),{x:r,y:t,width:e,w:e,height:n,h:n,x2:r+e,y2:t+n,cx:r+e/2,cy:t+n/2,r1:Math.min(e,n)/2,r2:Math.max(e,n)/2,r0:Math.sqrt(e*e+n*n)/2,path:gO(r,t,e,n),vb:[r,t,e,n].join(" ")}},Ej=function(r,t){return r=Uy(r),t=Uy(t),Zo(t,r.x,r.y)||Zo(t,r.x2,r.y)||Zo(t,r.x,r.y2)||Zo(t,r.x2,r.y2)||Zo(r,t.x,t.y)||Zo(r,t.x2,t.y)||Zo(r,t.x,t.y2)||Zo(r,t.x2,t.y2)||(r.x<t.x2&&r.x>t.x||t.x<r.x2&&t.x>r.x)&&(r.y<t.y2&&r.y>t.y||t.y<r.y2&&t.y>r.y)},f2=function(r,t,e,n,i,a,o,s){wt(r)||(r=[r,t,e,n,i,a,o,s]);var u=xj.apply(null,r);return Uy(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},c2=function(r,t,e,n,i,a,o,s,u){var l=1-u,f=Math.pow(l,3),c=Math.pow(l,2),d=u*u,h=d*u,v=f*r+c*3*u*e+l*3*u*u*i+h*o,p=f*t+c*3*u*n+l*3*u*u*a+h*s,g=r+2*u*(e-r)+d*(i-2*e+r),y=t+2*u*(n-t)+d*(a-2*n+t),m=e+2*u*(i-e)+d*(o-2*i+e),b=n+2*u*(a-n)+d*(s-2*a+n),x=l*r+u*e,w=l*t+u*n,E=l*i+u*o,_=l*a+u*s,M=90-Math.atan2(g-m,y-b)*180/Math.PI;return{x:v,y:p,m:{x:g,y},n:{x:m,y:b},start:{x,y:w},end:{x:E,y:_},alpha:M}},_j=function(r,t,e){var n=f2(r),i=f2(t);if(!Ej(n,i))return e?0:[];for(var a=l2.apply(0,r),o=l2.apply(0,t),s=~~(a/8),u=~~(o/8),l=[],f=[],c={},d=e?0:[],h=0;h<s+1;h++){var v=c2.apply(0,r.concat(h/s));l.push({x:v.x,y:v.y,t:h/s})}for(var h=0;h<u+1;h++){var v=c2.apply(0,t.concat(h/u));f.push({x:v.x,y:v.y,t:h/u})}for(var h=0;h<s;h++)for(var p=0;p<u;p++){var g=l[h],y=l[h+1],m=f[p],b=f[p+1],x=Math.abs(y.x-g.x)<.001?"y":"x",w=Math.abs(b.x-m.x)<.001?"y":"x",E=wj(g.x,g.y,y.x,y.y,m.x,m.y,b.x,b.y);if(E){if(c[E.x.toFixed(4)]===E.y.toFixed(4))continue;c[E.x.toFixed(4)]=E.y.toFixed(4);var _=g.t+Math.abs((E[x]-g[x])/(y[x]-g[x]))*(y.t-g.t),M=m.t+Math.abs((E[w]-m[w])/(b[w]-m[w]))*(b.t-m.t);_>=0&&_<=1&&M>=0&&M<=1&&(e?d+=1:d.push({x:E.x,y:E.y,t1:_,t2:M}))}}return d},Sj=function(r,t,e){r=$y(r),t=$y(t);for(var n,i,a,o,s,u,l,f,c,d,h=e?0:[],v=0,p=r.length;v<p;v++){var g=r[v];if(g[0]==="M")n=s=g[1],i=u=g[2];else{g[0]==="C"?(c=[n,i].concat(g.slice(1)),n=c[6],i=c[7]):(c=[n,i,n,i,s,u,s,u],n=s,i=u);for(var y=0,m=t.length;y<m;y++){var b=t[y];if(b[0]==="M")a=l=b[1],o=f=b[2];else{b[0]==="C"?(d=[a,o].concat(b.slice(1)),a=d[6],o=d[7]):(d=[a,o,a,o,l,f,l,f],a=l,o=f);var x=_j(c,d,e);if(e)h+=x;else{for(var w=0,E=x.length;w<E;w++)x[w].segment1=v,x[w].segment2=y,x[w].bez1=c,x[w].bez2=d;h=h.concat(x)}}}}}return h},Mj=function(r,t){return Sj(r,t)};function Cj(r,t){var e=[],n=[];function i(a,o){if(a.length===1)e.push(a[0]),n.push(a[0]);else{for(var s=[],u=0;u<a.length-1;u++)u===0&&e.push(a[0]),u===a.length-2&&n.push(a[u+1]),s[u]=[(1-o)*a[u][0]+o*a[u+1][0],(1-o)*a[u][1]+o*a[u+1][1]];i(s,o)}}return r.length&&i(r,t),{left:e,right:n.reverse()}}function Aj(r,t,e){var n=[[r[1],r[2]]];e=e||2;var i=[];t[0]==="A"?(n.push(t[6]),n.push(t[7])):t[0]==="C"?(n.push([t[1],t[2]]),n.push([t[3],t[4]]),n.push([t[5],t[6]])):t[0]==="S"||t[0]==="Q"?(n.push([t[1],t[2]]),n.push([t[3],t[4]])):n.push([t[1],t[2]]);for(var a=n,o=1/e,s=0;s<e-1;s++){var u=o/(1-o*s),l=Cj(a,u);i.push(l.left),a=l.right}i.push(a);var f=i.map(function(c){var d=[];return c.length===4&&(d.push("C"),d=d.concat(c[2])),c.length>=3&&(c.length===3&&d.push("Q"),d=d.concat(c[1])),c.length===2&&d.push("L"),d=d.concat(c[c.length-1]),d});return f}var Tj=function(r,t,e){if(e===1)return[[].concat(r)];var n=[];if(t[0]==="L"||t[0]==="C"||t[0]==="Q")n=n.concat(Aj(r,t,e));else{var i=[].concat(r);i[0]==="M"&&(i[0]="L");for(var a=0;a<=e-1;a++)n.push(i)}return n},Ij=function(r,t){if(r.length===1)return r;var e=r.length-1,n=t.length-1,i=e/n,a=[];if(r.length===1&&r[0][0]==="M"){for(var o=0;o<n-e;o++)r.push(r[0]);return r}for(var o=0;o<n;o++){var s=Math.floor(i*o);a[s]=(a[s]||0)+1}var u=a.reduce(function(l,f,c){return c===e?l.concat(r[e]):l.concat(Tj(r[c],r[c+1],f))},[]);return u.unshift(r[0]),(t[n]==="Z"||t[n]==="z")&&u.push("Z"),u},Oj=function(r,t){if(r.length!==t.length)return!1;var e=!0;return xe(r,function(n,i){if(n!==t[i])return e=!1,!1}),e};function Lj(r,t,e){var n=null,i=e;return t<i&&(i=t,n="add"),r<i&&(i=r,n="del"),{type:n,min:i}}var kj=function(r,t){var e=r.length,n=t.length,i,a,o=0;if(e===0||n===0)return null;for(var s=[],u=0;u<=e;u++)s[u]=[],s[u][0]={min:u};for(var l=0;l<=n;l++)s[0][l]={min:l};for(var u=1;u<=e;u++){i=r[u-1];for(var l=1;l<=n;l++){a=t[l-1],Oj(i,a)?o=0:o=1;var f=s[u-1][l].min+1,c=s[u][l-1].min+1,d=s[u-1][l-1].min+o;s[u][l]=Lj(f,c,d)}}return s},yO=function(r,t){var e=kj(r,t),n=r.length,i=t.length,a=[],o=1,s=1;if(e[n][i].min!==n){for(var u=1;u<=n;u++){var l=e[u][u].min;s=u;for(var f=o;f<=i;f++)e[u][f].min<l&&(l=e[u][f].min,s=f);o=s,e[u][o].type&&a.push({index:u-1,type:e[u][o].type})}for(var u=a.length-1;u>=0;u--)o=a[u].index,a[u].type==="add"?r.splice(o,0,[].concat(r[o])):r.splice(o,1)}n=r.length;var c=i-n;if(n<i)for(var u=0;u<c;u++)r[n-1][0]==="z"||r[n-1][0]==="Z"?r.splice(n-2,0,r[n-2]):r.push(r[n-1]),n+=1;return r};function v0(r,t,e){for(var n=[].concat(r),i,a=1/(e+1),o=mO(t)[0],s=1;s<=e;s++)a*=s,i=Math.floor(r.length*a),i===0?n.unshift([o[0]*a+r[i][0]*(1-a),o[1]*a+r[i][1]*(1-a)]):n.splice(i,0,[o[0]*a+r[i][0]*(1-a),o[1]*a+r[i][1]*(1-a)]);return n}function mO(r){var t=[];switch(r[0]){case"M":t.push([r[1],r[2]]);break;case"L":t.push([r[1],r[2]]);break;case"A":t.push([r[6],r[7]]);break;case"Q":t.push([r[3],r[4]]),t.push([r[1],r[2]]);break;case"T":t.push([r[1],r[2]]);break;case"C":t.push([r[5],r[6]]),t.push([r[1],r[2]]),t.push([r[3],r[4]]);break;case"S":t.push([r[3],r[4]]),t.push([r[1],r[2]]);break;case"H":t.push([r[1],r[1]]);break;case"V":t.push([r[1],r[1]]);break}return t}var jy=function(r,t){if(r.length<=1)return r;for(var e,n=0;n<t.length;n++)if(r[n][0]!==t[n][0])switch(e=mO(r[n]),t[n][0]){case"M":r[n]=["M"].concat(e[0]);break;case"L":r[n]=["L"].concat(e[0]);break;case"A":r[n]=[].concat(t[n]),r[n][6]=e[0][0],r[n][7]=e[0][1];break;case"Q":if(e.length<2)if(n>0)e=v0(e,r[n-1],1);else{r[n]=t[n];break}r[n]=["Q"].concat(e.reduce(function(i,a){return i.concat(a)},[]));break;case"T":r[n]=["T"].concat(e[0]);break;case"C":if(e.length<3)if(n>0)e=v0(e,r[n-1],2);else{r[n]=t[n];break}r[n]=["C"].concat(e.reduce(function(i,a){return i.concat(a)},[]));break;case"S":if(e.length<2)if(n>0)e=v0(e,r[n-1],1);else{r[n]=t[n];break}r[n]=["S"].concat(e.reduce(function(i,a){return i.concat(a)},[]));break;default:r[n]=t[n]}return r};const Dj=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:zy,fillPath:Ij,fillPathByDiff:yO,formatPath:jy,intersection:Mj,parsePathArray:pO,parsePathString:yl,pathToAbsolute:Gy,pathToCurve:$y,rectPath:gO},Symbol.toStringTag,{value:"Module"}));var bO=function(){function r(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return r.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},r.prototype.stopPropagation=function(){this.propagationStopped=!0},r.prototype.toString=function(){var t=this.type;return"[Event (type="+t+")]"},r.prototype.save=function(){},r.prototype.restore=function(){},r}();function xO(r,t){var e=r.indexOf(t);e!==-1&&r.splice(e,1)}var d2=typeof window<"u"&&typeof window.document<"u";function wO(r,t){if(r.isCanvas())return!0;for(var e=t.getParent(),n=!1;e;){if(e===r){n=!0;break}e=e.getParent()}return n}function Wy(r){return r.cfg.visible&&r.cfg.capture}var Nj=function(r){zt(t,r);function t(e){var n=r.call(this)||this;n.destroyed=!1;var i=n.getDefaultCfg();return n.cfg=Mt(i,e),n}return t.prototype.getDefaultCfg=function(){return{}},t.prototype.get=function(e){return this.cfg[e]},t.prototype.set=function(e,n){this.cfg[e]=n},t.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},t}(gT),h2=function(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return r.concat(a||Array.prototype.slice.call(t))},Pj=function(){function r(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"}return r}(),Rj=function(){function r(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return r}(),Bj=function(){function r(t,e,n,i){this.name=t,this.version=e,this.os=n,this.bot=i,this.type="bot-device"}return r}(),Fj=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),zj=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Gj=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,$j=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,v2=3,Uj=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Gj]],p2=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function EO(r){return r?g2(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new zj:typeof navigator<"u"?g2(navigator.userAgent):Xj()}function jj(r){return r!==""&&Uj.reduce(function(t,e){var n=e[0],i=e[1];if(t)return t;var a=i.exec(r);return!!a&&[n,a]},!1)}function g2(r){var t=jj(r);if(!t)return null;var e=t[0],n=t[1];if(e==="searchbot")return new Fj;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<v2&&(i=h2(h2([],i,!0),Yj(v2-i.length),!0)):i=[];var a=i.join("."),o=Wj(r),s=$j.exec(r);return s&&s[1]?new Bj(e,a,o,s[1]):new Pj(e,a,o)}function Wj(r){for(var t=0,e=p2.length;t<e;t++){var n=p2[t],i=n[0],a=n[1],o=a.exec(r);if(o)return i}return null}function Xj(){var r=typeof process<"u"&&process.version;return r?new Rj(process.version.slice(1)):null}function Yj(r){for(var t=[],e=0;e<r;e++)t.push("0");return t}function y2(r,t){var e=[],n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],c=r[8],d=t[0],h=t[1],v=t[2],p=t[3],g=t[4],y=t[5],m=t[6],b=t[7],x=t[8];return e[0]=d*n+h*o+v*l,e[1]=d*i+h*s+v*f,e[2]=d*a+h*u+v*c,e[3]=p*n+g*o+y*l,e[4]=p*i+g*s+y*f,e[5]=p*a+g*u+y*c,e[6]=m*n+b*o+x*l,e[7]=m*i+b*s+x*f,e[8]=m*a+b*u+x*c,e}function ru(r,t){var e=[],n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function _O(r){var t=[],e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],c=f*o-s*l,d=-f*a+s*u,h=l*a-o*u,v=e*c+n*d+i*h;return v?(v=1/v,t[0]=c*v,t[1]=(-f*n+i*l)*v,t[2]=(s*n-i*o)*v,t[3]=d*v,t[4]=(f*e-i*u)*v,t[5]=(-s*e+i*a)*v,t[6]=h*v,t[7]=(-l*e+n*u)*v,t[8]=(o*e-n*a)*v,t):null}var yf=ra,p0="matrix",Vj=["zIndex","capture","visible","type"],Hj=["repeat"],Kj=":",qj="*";function Zj(r){for(var t=[],e=0;e<r.length;e++)wt(r[e])?t.push([].concat(r[e])):t.push(r[e]);return t}function Qj(r,t){var e={},n=t.attrs;for(var i in r)e[i]=n[i];return e}function Jj(r,t){var e={},n=t.attr();return xe(r,function(i,a){Hj.indexOf(a)===-1&&!ms(n[a],i)&&(e[a]=i)}),e}function e7(r,t){if(t.onFrame)return r;var e=t.startTime,n=t.delay,i=t.duration,a=Object.prototype.hasOwnProperty;return xe(r,function(o){e+n<o.startTime+o.delay+o.duration&&i>o.delay&&xe(t.toAttrs,function(s,u){a.call(o.toAttrs,u)&&(delete o.toAttrs[u],delete o.fromAttrs[u])})}),r}var SO=function(r){zt(t,r);function t(e){var n=r.call(this,e)||this;n.attrs={};var i=n.getDefaultAttrs();return Mt(i,e.attrs),n.attrs=i,n.initAttrs(i),n.initAnimate(),n}return t.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},t.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},t.prototype.onCanvasChange=function(e){},t.prototype.initAttrs=function(e){},t.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},t.prototype.isGroup=function(){return!1},t.prototype.getParent=function(){return this.get("parent")},t.prototype.getCanvas=function(){return this.get("canvas")},t.prototype.attr=function(){for(var e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=n[0],o=n[1];if(!a)return this.attrs;if(Wn(a)){for(var s in a)this.setAttr(s,a[s]);return this.afterAttrsChange(a),this}return n.length===2?(this.setAttr(a,o),this.afterAttrsChange((e={},e[a]=o,e)),this):this.attrs[a]},t.prototype.isClipped=function(e,n){var i=this.getClip();return i&&!i.isHit(e,n)},t.prototype.setAttr=function(e,n){var i=this.attrs[e];i!==n&&(this.attrs[e]=n,this.onAttrChange(e,n,i))},t.prototype.onAttrChange=function(e,n,i){e==="matrix"&&this.set("totalMatrix",null)},t.prototype.afterAttrsChange=function(e){if(this.cfg.isClipShape){var n=this.cfg.applyTo;n&&n.onCanvasChange("clip")}else this.onCanvasChange("attr")},t.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},t.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},t.prototype.setZIndex=function(e){this.set("zIndex",e);var n=this.getParent();return n&&n.sort(),this},t.prototype.toFront=function(){var e=this.getParent();if(e){var n=e.getChildren();this.get("el");var i=n.indexOf(this);n.splice(i,1),n.push(this),this.onCanvasChange("zIndex")}},t.prototype.toBack=function(){var e=this.getParent();if(e){var n=e.getChildren();this.get("el");var i=n.indexOf(this);n.splice(i,1),n.unshift(this),this.onCanvasChange("zIndex")}},t.prototype.remove=function(e){e===void 0&&(e=!0);var n=this.getParent();n?(xO(n.getChildren(),this),n.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),e&&this.destroy()},t.prototype.resetMatrix=function(){this.attr(p0,this.getDefaultMatrix()),this.onCanvasChange("matrix")},t.prototype.getMatrix=function(){return this.attr(p0)},t.prototype.setMatrix=function(e){this.attr(p0,e),this.onCanvasChange("matrix")},t.prototype.getTotalMatrix=function(){var e=this.cfg.totalMatrix;if(!e){var n=this.attr("matrix"),i=this.cfg.parentMatrix;i&&n?e=y2(i,n):e=n||i,this.set("totalMatrix",e)}return e},t.prototype.applyMatrix=function(e){var n=this.attr("matrix"),i=null;e&&n?i=y2(e,n):i=n||e,this.set("totalMatrix",i),this.set("parentMatrix",e)},t.prototype.getDefaultMatrix=function(){return null},t.prototype.applyToMatrix=function(e){var n=this.attr("matrix");return n?ru(n,e):e},t.prototype.invertFromMatrix=function(e){var n=this.attr("matrix");if(n){var i=_O(n);if(i)return ru(i,e)}return e},t.prototype.setClip=function(e){var n=this.getCanvas(),i=null;if(e){var a=this.getShapeBase(),o=Tl(e.type),s=a[o];s&&(i=new s({type:e.type,isClipShape:!0,applyTo:this,attrs:e.attrs,canvas:n}))}return this.set("clipShape",i),this.onCanvasChange("clip"),i},t.prototype.getClip=function(){var e=this.cfg.clipShape;return e||null},t.prototype.clone=function(){var e=this,n=this.attrs,i={};xe(n,function(s,u){wt(n[u])?i[u]=Zj(n[u]):i[u]=n[u]});var a=this.constructor,o=new a({attrs:i});return xe(Vj,function(s){o.set(s,e.get(s))}),o},t.prototype.destroy=function(){var e=this.destroyed;e||(this.attrs={},r.prototype.destroy.call(this))},t.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},t.prototype.animate=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!(!this.get("timeline")&&!this.get("canvas"))){this.set("animating",!0);var i=this.get("timeline");i||(i=this.get("canvas").get("timeline"),this.set("timeline",i));var a=this.get("animations")||[];i.timer||i.initTimer();var o=e[0],s=e[1],u=e[2],l=u===void 0?"easeLinear":u,f=e[3],c=f===void 0?Bf:f,d=e[4],h=d===void 0?0:d,v,p,g,y,m;Yr(o)?(v=o,o={}):Wn(o)&&o.onFrame&&(v=o.onFrame,p=o.repeat),Wn(s)?(m=s,s=m.duration,l=m.easing||"easeLinear",h=m.delay||0,p=m.repeat||p||!1,c=m.callback||Bf,g=m.pauseCallback||Bf,y=m.resumeCallback||Bf):(mt(c)&&(h=c,c=null),Yr(l)?(c=l,l="easeLinear"):l=l||"easeLinear");var b=Jj(o,this),x={fromAttrs:Qj(b,this),toAttrs:b,duration:s,easing:l,repeat:p,callback:c,pauseCallback:g,resumeCallback:y,delay:h,startTime:i.getTime(),id:eo(),onFrame:v,pathFormatted:!1};a.length>0?a=e7(a,x):i.addAnimator(this),a.push(x),this.set("animations",a),this.set("_pause",{isPaused:!1})}},t.prototype.stopAnimate=function(e){var n=this;e===void 0&&(e=!0);var i=this.get("animations");xe(i,function(a){e&&(a.onFrame?n.attr(a.onFrame(1)):n.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},t.prototype.pauseAnimate=function(){var e=this.get("timeline"),n=this.get("animations"),i=e.getTime();return xe(n,function(a){a._paused=!0,a._pauseTime=i,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:i}),this},t.prototype.resumeAnimate=function(){var e=this.get("timeline"),n=e.getTime(),i=this.get("animations"),a=this.get("_pause").pauseTime;return xe(i,function(o){o.startTime=o.startTime+(n-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",i),this},t.prototype.emitDelegation=function(e,n){var i=this,a=n.propagationPath;this.getEvents();var o;e==="mouseenter"?o=n.fromShape:e==="mouseleave"&&(o=n.toShape);for(var s=function(c){var d=a[c],h=d.get("name");if(h){if((d.isGroup()||d.isCanvas&&d.isCanvas())&&o&&wO(d,o))return"break";wt(h)?xe(h,function(v){i.emitDelegateEvent(d,v,n)}):u.emitDelegateEvent(d,h,n)}},u=this,l=0;l<a.length;l++){var f=s(l);if(f==="break")break}},t.prototype.emitDelegateEvent=function(e,n,i){var a=this.getEvents(),o=n+Kj+i.type;(a[o]||a[qj])&&(i.name=o,i.currentTarget=e,i.delegateTarget=this,i.delegateObject=e.get("delegateObject"),this.emit(o,i))},t.prototype.translate=function(e,n){e===void 0&&(e=0),n===void 0&&(n=0);var i=this.getMatrix(),a=yf(i,[["t",e,n]]);return this.setMatrix(a),this},t.prototype.move=function(e,n){var i=this.attr("x")||0,a=this.attr("y")||0;return this.translate(e-i,n-a),this},t.prototype.moveTo=function(e,n){return this.move(e,n)},t.prototype.scale=function(e,n){var i=this.getMatrix(),a=yf(i,[["s",e,n||e]]);return this.setMatrix(a),this},t.prototype.rotate=function(e){var n=this.getMatrix(),i=yf(n,[["r",e]]);return this.setMatrix(i),this},t.prototype.rotateAtStart=function(e){var n=this.attr(),i=n.x,a=n.y,o=this.getMatrix(),s=yf(o,[["t",-i,-a],["r",e],["t",i,a]]);return this.setMatrix(s),this},t.prototype.rotateAtPoint=function(e,n,i){var a=this.getMatrix(),o=yf(a,[["t",-e,-n],["r",i],["t",e,n]]);return this.setMatrix(o),this},t}(Nj),m2={},Xy="_INDEX";function MO(r,t){if(r.set("canvas",t),r.isGroup()){var e=r.get("children");e.length&&e.forEach(function(n){MO(n,t)})}}function CO(r,t){if(r.set("timeline",t),r.isGroup()){var e=r.get("children");e.length&&e.forEach(function(n){CO(n,t)})}}function t7(r,t,e){e===void 0&&(e=!0),e?t.destroy():(t.set("parent",null),t.set("canvas",null)),xO(r.getChildren(),t)}function r7(r){return function(t,e){var n=r(t,e);return n===0?t[Xy]-e[Xy]:n}}var AO=function(r){zt(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.isCanvas=function(){return!1},t.prototype.getBBox=function(){var e=1/0,n=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});o.length>0?xe(o,function(u){var l=u.getBBox(),f=l.minX,c=l.maxX,d=l.minY,h=l.maxY;f<e&&(e=f),c>n&&(n=c),d<i&&(i=d),h>a&&(a=h)}):(e=0,n=0,i=0,a=0);var s={x:e,y:i,minX:e,minY:i,maxX:n,maxY:a,width:n-e,height:a-i};return s},t.prototype.getCanvasBBox=function(){var e=1/0,n=-1/0,i=1/0,a=-1/0,o=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});o.length>0?xe(o,function(u){var l=u.getCanvasBBox(),f=l.minX,c=l.maxX,d=l.minY,h=l.maxY;f<e&&(e=f),c>n&&(n=c),d<i&&(i=d),h>a&&(a=h)}):(e=0,n=0,i=0,a=0);var s={x:e,y:i,minX:e,minY:i,maxX:n,maxY:a,width:n-e,height:a-i};return s},t.prototype.getDefaultCfg=function(){var e=r.prototype.getDefaultCfg.call(this);return e.children=[],e},t.prototype.onAttrChange=function(e,n,i){if(r.prototype.onAttrChange.call(this,e,n,i),e==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},t.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();r.prototype.applyMatrix.call(this,e);var i=this.getTotalMatrix();i!==n&&this._applyChildrenMarix(i)},t.prototype._applyChildrenMarix=function(e){var n=this.getChildren();xe(n,function(i){i.applyMatrix(e)})},t.prototype.addShape=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=e[0],a=e[1];Wn(i)?a=i:a.type=i;var o=m2[a.type];o||(o=Tl(a.type),m2[a.type]=o);var s=this.getShapeBase(),u=new s[o](a);return this.add(u),u},t.prototype.addGroup=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=e[0],a=e[1],o;if(Yr(i))a?o=new i(a):o=new i({parent:this});else{var s=i||{},u=this.getGroupBase();o=new u(s)}return this.add(o),o},t.prototype.getCanvas=function(){var e;return this.isCanvas()?e=this:e=this.get("canvas"),e},t.prototype.getShape=function(e,n,i){if(!Wy(this))return null;var a=this.getChildren(),o;if(this.isCanvas())o=this._findShape(a,e,n,i);else{var s=[e,n,1];s=this.invertFromMatrix(s),this.isClipped(s[0],s[1])||(o=this._findShape(a,s[0],s[1],i))}return o},t.prototype._findShape=function(e,n,i,a){for(var o=null,s=e.length-1;s>=0;s--){var u=e[s];if(Wy(u)&&(u.isGroup()?o=u.getShape(n,i,a):u.isHit(n,i)&&(o=u)),o)break}return o},t.prototype.add=function(e){var n=this.getCanvas(),i=this.getChildren(),a=this.get("timeline"),o=e.getParent();o&&t7(o,e,!1),e.set("parent",this),n&&MO(e,n),a&&CO(e,a),i.push(e),e.onCanvasChange("add"),this._applyElementMatrix(e)},t.prototype._applyElementMatrix=function(e){var n=this.getTotalMatrix();n&&e.applyMatrix(n)},t.prototype.getChildren=function(){return this.get("children")},t.prototype.sort=function(){var e=this.getChildren();xe(e,function(n,i){return n[Xy]=i,n}),e.sort(r7(function(n,i){return n.get("zIndex")-i.get("zIndex")})),this.onCanvasChange("sort")},t.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var e=this.getChildren(),n=e.length-1;n>=0;n--)e[n].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},t.prototype.destroy=function(){this.get("destroyed")||(this.clear(),r.prototype.destroy.call(this))},t.prototype.getFirst=function(){return this.getChildByIndex(0)},t.prototype.getLast=function(){var e=this.getChildren();return this.getChildByIndex(e.length-1)},t.prototype.getChildByIndex=function(e){var n=this.getChildren();return n[e]},t.prototype.getCount=function(){var e=this.getChildren();return e.length},t.prototype.contain=function(e){var n=this.getChildren();return n.indexOf(e)>-1},t.prototype.removeChild=function(e,n){n===void 0&&(n=!0),this.contain(e)&&e.remove(n)},t.prototype.findAll=function(e){var n=[],i=this.getChildren();return xe(i,function(a){e(a)&&n.push(a),a.isGroup()&&(n=n.concat(a.findAll(e)))}),n},t.prototype.find=function(e){var n=null,i=this.getChildren();return xe(i,function(a){if(e(a)?n=a:a.isGroup()&&(n=a.find(e)),n)return!1}),n},t.prototype.findById=function(e){return this.find(function(n){return n.get("id")===e})},t.prototype.findByClassName=function(e){return this.find(function(n){return n.get("className")===e})},t.prototype.findAllByName=function(e){return this.findAll(function(n){return n.get("name")===e})},t}(SO),Il=0,zf=0,mf=0,TO=1e3,Tv,Gf,Iv=0,vu=0,bp=0,pc=typeof performance=="object"&&performance.now?performance:Date,IO=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function OO(){return vu||(IO(n7),vu=pc.now()+bp)}function n7(){vu=0}function Yy(){this._call=this._time=this._next=null}Yy.prototype=LO.prototype={constructor:Yy,restart:function(r,t,e){if(typeof r!="function")throw new TypeError("callback is not a function");e=(e==null?OO():+e)+(t==null?0:+t),!this._next&&Gf!==this&&(Gf?Gf._next=this:Tv=this,Gf=this),this._call=r,this._time=e,Vy()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vy())}};function LO(r,t,e){var n=new Yy;return n.restart(r,t,e),n}function i7(){OO(),++Il;for(var r=Tv,t;r;)(t=vu-r._time)>=0&&r._call.call(null,t),r=r._next;--Il}function b2(){vu=(Iv=pc.now())+bp,Il=zf=0;try{i7()}finally{Il=0,o7(),vu=0}}function a7(){var r=pc.now(),t=r-Iv;t>TO&&(bp-=t,Iv=r)}function o7(){for(var r,t=Tv,e,n=1/0;t;)t._call?(n>t._time&&(n=t._time),r=t,t=t._next):(e=t._next,t._next=null,t=r?r._next=e:Tv=e);Gf=r,Vy(n)}function Vy(r){if(!Il){zf&&(zf=clearTimeout(zf));var t=r-vu;t>24?(r<1/0&&(zf=setTimeout(b2,r-pc.now()-bp)),mf&&(mf=clearInterval(mf))):(mf||(Iv=pc.now(),mf=setInterval(a7,TO)),Il=1,IO(b2))}}function q1(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function kO(r,t){var e=Object.create(r.prototype);for(var n in t)e[n]=t[n];return e}function zc(){}var gc=.7,Ov=1/gc,wl="\\s*([+-]?\\d+)\\s*",yc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",qa="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s7=/^#([0-9a-f]{3,8})$/,u7=new RegExp("^rgb\\("+[wl,wl,wl]+"\\)$"),l7=new RegExp("^rgb\\("+[qa,qa,qa]+"\\)$"),f7=new RegExp("^rgba\\("+[wl,wl,wl,yc]+"\\)$"),c7=new RegExp("^rgba\\("+[qa,qa,qa,yc]+"\\)$"),d7=new RegExp("^hsl\\("+[yc,qa,qa]+"\\)$"),h7=new RegExp("^hsla\\("+[yc,qa,qa,yc]+"\\)$"),x2={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};q1(zc,mc,{copy:function(r){return Object.assign(new this.constructor,this,r)},displayable:function(){return this.rgb().displayable()},hex:w2,formatHex:w2,formatHsl:v7,formatRgb:E2,toString:E2});function w2(){return this.rgb().formatHex()}function v7(){return DO(this).formatHsl()}function E2(){return this.rgb().formatRgb()}function mc(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=s7.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?_2(t):e===3?new Pi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?Zd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?Zd(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=u7.exec(r))?new Pi(t[1],t[2],t[3],1):(t=l7.exec(r))?new Pi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=f7.exec(r))?Zd(t[1],t[2],t[3],t[4]):(t=c7.exec(r))?Zd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=d7.exec(r))?C2(t[1],t[2]/100,t[3]/100,1):(t=h7.exec(r))?C2(t[1],t[2]/100,t[3]/100,t[4]):x2.hasOwnProperty(r)?_2(x2[r]):r==="transparent"?new Pi(NaN,NaN,NaN,0):null}function _2(r){return new Pi(r>>16&255,r>>8&255,r&255,1)}function Zd(r,t,e,n){return n<=0&&(r=t=e=NaN),new Pi(r,t,e,n)}function p7(r){return r instanceof zc||(r=mc(r)),r?(r=r.rgb(),new Pi(r.r,r.g,r.b,r.opacity)):new Pi}function Hy(r,t,e,n){return arguments.length===1?p7(r):new Pi(r,t,e,n==null?1:n)}function Pi(r,t,e,n){this.r=+r,this.g=+t,this.b=+e,this.opacity=+n}q1(Pi,Hy,kO(zc,{brighter:function(r){return r=r==null?Ov:Math.pow(Ov,r),new Pi(this.r*r,this.g*r,this.b*r,this.opacity)},darker:function(r){return r=r==null?gc:Math.pow(gc,r),new Pi(this.r*r,this.g*r,this.b*r,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:S2,formatHex:S2,formatRgb:M2,toString:M2}));function S2(){return"#"+g0(this.r)+g0(this.g)+g0(this.b)}function M2(){var r=this.opacity;return r=isNaN(r)?1:Math.max(0,Math.min(1,r)),(r===1?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(r===1?")":", "+r+")")}function g0(r){return r=Math.max(0,Math.min(255,Math.round(r)||0)),(r<16?"0":"")+r.toString(16)}function C2(r,t,e,n){return n<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new za(r,t,e,n)}function DO(r){if(r instanceof za)return new za(r.h,r.s,r.l,r.opacity);if(r instanceof zc||(r=mc(r)),!r)return new za;if(r instanceof za)return r;r=r.rgb();var t=r.r/255,e=r.g/255,n=r.b/255,i=Math.min(t,e,n),a=Math.max(t,e,n),o=NaN,s=a-i,u=(a+i)/2;return s?(t===a?o=(e-n)/s+(e<n)*6:e===a?o=(n-t)/s+2:o=(t-e)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new za(o,s,u,r.opacity)}function g7(r,t,e,n){return arguments.length===1?DO(r):new za(r,t,e,n==null?1:n)}function za(r,t,e,n){this.h=+r,this.s=+t,this.l=+e,this.opacity=+n}q1(za,g7,kO(zc,{brighter:function(r){return r=r==null?Ov:Math.pow(Ov,r),new za(this.h,this.s,this.l*r,this.opacity)},darker:function(r){return r=r==null?gc:Math.pow(gc,r),new za(this.h,this.s,this.l*r,this.opacity)},rgb:function(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,n=e+(e<.5?e:1-e)*t,i=2*e-n;return new Pi(y0(r>=240?r-240:r+120,i,n),y0(r,i,n),y0(r<120?r+240:r-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var r=this.opacity;return r=isNaN(r)?1:Math.max(0,Math.min(1,r)),(r===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(r===1?")":", "+r+")")}}));function y0(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}const Z1=r=>()=>r;function y7(r,t){return function(e){return r+e*t}}function m7(r,t,e){return r=Math.pow(r,e),t=Math.pow(t,e)-r,e=1/e,function(n){return Math.pow(r+n*t,e)}}function b7(r){return(r=+r)==1?NO:function(t,e){return e-t?m7(t,e,r):Z1(isNaN(t)?e:t)}}function NO(r,t){var e=t-r;return e?y7(r,e):Z1(isNaN(r)?t:r)}const A2=function r(t){var e=b7(t);function n(i,a){var o=e((i=Hy(i)).r,(a=Hy(a)).r),s=e(i.g,a.g),u=e(i.b,a.b),l=NO(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=u(f),i.opacity=l(f),i+""}}return n.gamma=r,n}(1);function PO(r,t){t||(t=[]);var e=r?Math.min(t.length,r.length):0,n=t.slice(),i;return function(a){for(i=0;i<e;++i)n[i]=r[i]*(1-a)+t[i]*a;return n}}function RO(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function x7(r,t){return(RO(t)?PO:BO)(r,t)}function BO(r,t){var e=t?t.length:0,n=r?Math.min(e,r.length):0,i=new Array(n),a=new Array(e),o;for(o=0;o<n;++o)i[o]=Lv(r[o],t[o]);for(;o<e;++o)a[o]=t[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}function w7(r,t){var e=new Date;return r=+r,t=+t,function(n){return e.setTime(r*(1-n)+t*n),e}}function Ky(r,t){return r=+r,t=+t,function(e){return r*(1-e)+t*e}}function E7(r,t){var e={},n={},i;(r===null||typeof r!="object")&&(r={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in r?e[i]=Lv(r[i],t[i]):n[i]=t[i];return function(a){for(i in e)n[i]=e[i](a);return n}}var qy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,m0=new RegExp(qy.source,"g");function _7(r){return function(){return r}}function S7(r){return function(t){return r(t)+""}}function M7(r,t){var e=qy.lastIndex=m0.lastIndex=0,n,i,a,o=-1,s=[],u=[];for(r=r+"",t=t+"";(n=qy.exec(r))&&(i=m0.exec(t));)(a=i.index)>e&&(a=t.slice(e,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,u.push({i:o,x:Ky(n,i)})),e=m0.lastIndex;return e<t.length&&(a=t.slice(e),s[o]?s[o]+=a:s[++o]=a),s.length<2?u[0]?S7(u[0].x):_7(t):(t=u.length,function(l){for(var f=0,c;f<t;++f)s[(c=u[f]).i]=c.x(l);return s.join("")})}function Lv(r,t){var e=typeof t,n;return t==null||e==="boolean"?Z1(t):(e==="number"?Ky:e==="string"?(n=mc(t))?(t=n,A2):M7:t instanceof mc?A2:t instanceof Date?w7:RO(t)?PO:Array.isArray(t)?BO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?E7:Ky)(r,t)}function C7(r){return+r}function A7(r){return r*r}function T7(r){return r*(2-r)}function T2(r){return((r*=2)<=1?r*r:--r*(2-r)+1)/2}function I7(r){return r*r*r}function O7(r){return--r*r*r+1}function I2(r){return((r*=2)<=1?r*r*r:(r-=2)*r*r+2)/2}var Q1=3,L7=function r(t){t=+t;function e(n){return Math.pow(n,t)}return e.exponent=r,e}(Q1),k7=function r(t){t=+t;function e(n){return 1-Math.pow(1-n,t)}return e.exponent=r,e}(Q1),O2=function r(t){t=+t;function e(n){return((n*=2)<=1?Math.pow(n,t):2-Math.pow(2-n,t))/2}return e.exponent=r,e}(Q1),FO=Math.PI,zO=FO/2;function D7(r){return+r==1?1:1-Math.cos(r*zO)}function N7(r){return Math.sin(r*zO)}function L2(r){return(1-Math.cos(FO*r))/2}function bs(r){return(Math.pow(2,-10*r)-.0009765625)*1.0009775171065494}function P7(r){return bs(1-+r)}function R7(r){return 1-bs(r)}function k2(r){return((r*=2)<=1?bs(1-r):2-bs(r-1))/2}function B7(r){return 1-Math.sqrt(1-r*r)}function F7(r){return Math.sqrt(1- --r*r)}function D2(r){return((r*=2)<=1?1-Math.sqrt(1-r*r):Math.sqrt(1-(r-=2)*r)+1)/2}var Zy=4/11,z7=6/11,G7=8/11,$7=3/4,U7=9/11,j7=10/11,W7=15/16,X7=21/22,Y7=63/64,Qd=1/Zy/Zy;function V7(r){return 1-bc(1-r)}function bc(r){return(r=+r)<Zy?Qd*r*r:r<G7?Qd*(r-=z7)*r+$7:r<j7?Qd*(r-=U7)*r+W7:Qd*(r-=X7)*r+Y7}function H7(r){return((r*=2)<=1?1-bc(1-r):bc(r-1)+1)/2}var J1=1.70158,K7=function r(t){t=+t;function e(n){return(n=+n)*n*(t*(n-1)+n)}return e.overshoot=r,e}(J1),q7=function r(t){t=+t;function e(n){return--n*n*((n+1)*t+n)+1}return e.overshoot=r,e}(J1),N2=function r(t){t=+t;function e(n){return((n*=2)<1?n*n*((t+1)*n-t):(n-=2)*n*((t+1)*n+t)+2)/2}return e.overshoot=r,e}(J1),Ol=2*Math.PI,eb=1,tb=.3,Z7=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Ol);function i(a){return t*bs(- --a)*Math.sin((n-a)/e)}return i.amplitude=function(a){return r(a,e*Ol)},i.period=function(a){return r(t,a)},i}(eb,tb),P2=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Ol);function i(a){return 1-t*bs(a=+a)*Math.sin((a+n)/e)}return i.amplitude=function(a){return r(a,e*Ol)},i.period=function(a){return r(t,a)},i}(eb,tb),Q7=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Ol);function i(a){return((a=a*2-1)<0?t*bs(-a)*Math.sin((n-a)/e):2-t*bs(a)*Math.sin((n+a)/e))/2}return i.amplitude=function(a){return r(a,e*Ol)},i.period=function(a){return r(t,a)},i}(eb,tb);const J7=Object.freeze(Object.defineProperty({__proto__:null,easeBack:N2,easeBackIn:K7,easeBackInOut:N2,easeBackOut:q7,easeBounce:bc,easeBounceIn:V7,easeBounceInOut:H7,easeBounceOut:bc,easeCircle:D2,easeCircleIn:B7,easeCircleInOut:D2,easeCircleOut:F7,easeCubic:I2,easeCubicIn:I7,easeCubicInOut:I2,easeCubicOut:O7,easeElastic:P2,easeElasticIn:Z7,easeElasticInOut:Q7,easeElasticOut:P2,easeExp:k2,easeExpIn:P7,easeExpInOut:k2,easeExpOut:R7,easeLinear:C7,easePoly:O2,easePolyIn:L7,easePolyInOut:O2,easePolyOut:k7,easeQuad:T2,easeQuadIn:A7,easeQuadInOut:T2,easeQuadOut:T7,easeSin:L2,easeSinIn:D7,easeSinInOut:L2,easeSinOut:N7},Symbol.toStringTag,{value:"Module"}));var e9={};function t9(r){return e9[r.toLowerCase()]||J7[r]}var r9=function(r){return["fill","stroke","fillStyle","strokeStyle"].includes(r)},n9=function(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)},R2=[1,0,0,0,1,0,0,0,1];function i9(r,t,e){var n={},i=t.fromAttrs,a=t.toAttrs;if(!r.destroyed){var o;for(var s in a)if(!ms(i[s],a[s]))if(s==="path"){var u=a[s],l=i[s];u.length>l.length?(u=yl(a[s]),l=yl(i[s]),l=yO(l,u),l=jy(l,u),t.fromAttrs.path=l,t.toAttrs.path=u):t.pathFormatted||(u=yl(a[s]),l=yl(i[s]),l=jy(l,u),t.fromAttrs.path=l,t.toAttrs.path=u,t.pathFormatted=!0),n[s]=[];for(var f=0;f<u.length;f++){for(var c=u[f],d=l[f],h=[],v=0;v<c.length;v++)mt(c[v])&&d&&mt(d[v])?(o=Lv(d[v],c[v]),h.push(o(e))):h.push(c[v]);n[s].push(h)}}else if(s==="matrix"){var p=x7(i[s]||R2,a[s]||R2),g=p(e);n[s]=g}else r9(s)&&n9(a[s])?n[s]=a[s]:Yr(a[s])||(o=Lv(i[s],a[s]),n[s]=o(e));r.attr(n)}}function a9(r,t,e){var n=t.startTime,i=t.delay;if(e<n+i||t._paused)return!1;var a,o=t.duration,s=t.easing,u=t9(s);if(e=e-n-t.delay,t.repeat)a=e%o/o,a=u(a);else if(a=e/o,a<1)a=u(a);else return t.onFrame?r.attr(t.onFrame(1)):r.attr(t.toAttrs),!0;if(t.onFrame){var l=t.onFrame(a);r.attr(l)}else i9(r,t,a);return!1}var o9=function(){function r(t){this.animators=[],this.current=0,this.timer=null,this.canvas=t}return r.prototype.initTimer=function(){var t=this,e=!1,n,i,a;this.timer=LO(function(o){if(t.current=o,t.animators.length>0){for(var s=t.animators.length-1;s>=0;s--){if(n=t.animators[s],n.destroyed){t.removeAnimator(s);continue}if(!n.isAnimatePaused()){i=n.get("animations");for(var u=i.length-1;u>=0;u--)a=i[u],e=a9(n,a,o),e&&(i.splice(u,1),e=!1,a.callback&&a.callback())}i.length===0&&t.removeAnimator(s)}var l=t.canvas.get("autoDraw");l||t.canvas.draw()}})},r.prototype.addAnimator=function(t){this.animators.push(t)},r.prototype.removeAnimator=function(t){this.animators.splice(t,1)},r.prototype.isAnimating=function(){return!!this.animators.length},r.prototype.stop=function(){this.timer&&this.timer.stop()},r.prototype.stopAllAnimations=function(t){t===void 0&&(t=!0),this.animators.forEach(function(e){e.stopAnimate(t)}),this.animators=[],this.canvas.draw()},r.prototype.getTime=function(){return this.current},r}(),s9=40,B2=0,F2=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function z2(r,t,e){e.name=t,e.target=r,e.currentTarget=r,e.delegateTarget=r,r.emit(t,e)}function u9(r,t,e){if(e.bubbles){var n=void 0,i=!1;if(t==="mouseenter"?(n=e.fromShape,i=!0):t==="mouseleave"&&(i=!0,n=e.toShape),r.isCanvas()&&i)return;if(n&&wO(r,n)){e.bubbles=!1;return}e.name=t,e.currentTarget=r,e.delegateTarget=r,r.emit(t,e)}}var l9=function(){function r(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(n){var i=n.type;e._triggerEvent(i,n)},this._onDocumentMove=function(n){var i=e.canvas,a=i.get("el");if(a!==n.target&&(e.dragging||e.currentShape)){var o=e._getPointInfo(n);e.dragging&&e._emitEvent("drag",n,o,e.draggingShape)}},this._onDocumentMouseUp=function(n){var i=e.canvas,a=i.get("el");if(a!==n.target&&e.dragging){var o=e._getPointInfo(n);e.draggingShape&&e._emitEvent("drop",n,o,null),e._emitEvent("dragend",n,o,e.draggingShape),e._afterDrag(e.draggingShape,o,n)}},this.canvas=t.canvas}return r.prototype.init=function(){this._bindEvents()},r.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");xe(F2,function(n){e.addEventListener(n,t._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");xe(F2,function(n){e.removeEventListener(n,t._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._getEventObj=function(t,e,n,i,a,o){var s=new bO(t,e);return s.fromShape=a,s.toShape=o,s.x=n.x,s.y=n.y,s.clientX=n.clientX,s.clientY=n.clientY,s.propagationPath.push(i),s},r.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},r.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),i=e.getPointByEvent(t);return{x:i.x,y:i.y,clientX:n.x,clientY:n.y}},r.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),i=this._getShape(n,e),a=this["_on"+t],o=!1;if(a)a.call(this,n,i,e);else{var s=this.currentShape;t==="mouseenter"||t==="dragenter"||t==="mouseover"?(this._emitEvent(t,e,n,null,null,i),i&&this._emitEvent(t,e,n,i,null,i),t==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):t==="mouseleave"||t==="dragleave"||t==="mouseout"?(o=!0,s&&this._emitEvent(t,e,n,s,s,null),this._emitEvent(t,e,n,null,s,null),t==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,i,null,null)}if(o||(this.currentShape=i),i&&!i.get("destroyed")){var u=this.canvas,l=u.get("el");l.style.cursor=i.attr("cursor")||u.get("cursor")}},r.prototype._onmousedown=function(t,e,n){n.button===B2&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},r.prototype._emitMouseoverEvents=function(t,e,n,i){var a=this.canvas.get("el");n!==i&&(n&&(this._emitEvent("mouseout",t,e,n,n,i),this._emitEvent("mouseleave",t,e,n,n,i),(!i||i.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),i&&(this._emitEvent("mouseover",t,e,i,n,i),this._emitEvent("mouseenter",t,e,i,n,i)))},r.prototype._emitDragoverEvents=function(t,e,n,i,a){i?(i!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,i),this._emitEvent("dragenter",t,e,i,n,i)),a||this._emitEvent("dragover",t,e,i)):n&&this._emitEvent("dragleave",t,e,n,n,i),a&&this._emitEvent("dragover",t,e,i)},r.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var i=this._getShape(e,n);i!==t&&this._emitMouseoverEvents(n,e,t,i),this.currentShape=i},r.prototype._onmouseup=function(t,e,n){if(n.button===B2){var i=this.draggingShape;this.dragging?(i&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,i),this._afterDrag(i,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},r.prototype._ondragover=function(t,e,n){n.preventDefault();var i=this.currentShape;this._emitDragoverEvents(n,t,i,e,!0)},r.prototype._onmousemove=function(t,e,n){var i=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,a,e,!1),this._emitEvent("drag",n,t,o);else{var s=this.mousedownPoint;if(s){var u=this.mousedownShape,l=n.timeStamp,f=l-this.mousedownTimeStamp,c=s.clientX-t.clientX,d=s.clientY-t.clientY,h=c*c+d*d;f>120||h>s9?u&&u.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!u&&i.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,a,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,a,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,a,e),this._emitEvent("mousemove",n,t,e)}},r.prototype._emitEvent=function(t,e,n,i,a,o){var s=this._getEventObj(t,e,n,i,a,o);if(i){s.shape=i,z2(i,t,s);for(var u=i.getParent();u;)u.emitDelegation(t,s),s.propagationStopped||u9(u,t,s),s.propagationPath.push(u),u=u.getParent()}else{var l=this.canvas;z2(l,t,s)}},r.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},r}(),G2="px",$2=EO(),f9=$2&&$2.name==="firefox",GO=function(r){zt(t,r);function t(e){var n=r.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return t.prototype.getDefaultCfg=function(){var e=r.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},t.prototype.initContainer=function(){var e=this.get("container");Fe(e)&&(e=document.getElementById(e),this.set("container",e))},t.prototype.initDom=function(){var e=this.createDom();this.set("el",e);var n=this.get("container");n.appendChild(e),this.setDOMSize(this.get("width"),this.get("height"))},t.prototype.initEvents=function(){var e=new l9({canvas:this});e.init(),this.set("eventController",e)},t.prototype.initTimeline=function(){var e=new o9(this);this.set("timeline",e)},t.prototype.setDOMSize=function(e,n){var i=this.get("el");d2&&(i.style.width=e+G2,i.style.height=n+G2)},t.prototype.changeSize=function(e,n){this.setDOMSize(e,n),this.set("width",e),this.set("height",n),this.onCanvasChange("changeSize")},t.prototype.getRenderer=function(){return this.get("renderer")},t.prototype.getCursor=function(){return this.get("cursor")},t.prototype.setCursor=function(e){this.set("cursor",e);var n=this.get("el");d2&&n&&(n.style.cursor=e)},t.prototype.getPointByEvent=function(e){var n=this.get("supportCSSTransform");if(n){if(f9&&!gt(e.layerX)&&e.layerX!==e.offsetX)return{x:e.layerX,y:e.layerY};if(!gt(e.offsetX))return{x:e.offsetX,y:e.offsetY}}var i=this.getClientByEvent(e),a=i.x,o=i.y;return this.getPointByClient(a,o)},t.prototype.getClientByEvent=function(e){var n=e;return e.touches&&(e.type==="touchend"?n=e.changedTouches[0]:n=e.touches[0]),{x:n.clientX,y:n.clientY}},t.prototype.getPointByClient=function(e,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:e-a.left,y:n-a.top}},t.prototype.getClientByPoint=function(e,n){var i=this.get("el"),a=i.getBoundingClientRect();return{x:e+a.left,y:n+a.top}},t.prototype.draw=function(){},t.prototype.removeDom=function(){var e=this.get("el");e.parentNode.removeChild(e)},t.prototype.clearEvents=function(){var e=this.get("eventController");e.destroy()},t.prototype.isCanvas=function(){return!0},t.prototype.getParent=function(){return null},t.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),r.prototype.destroy.call(this))},t}(AO),$O=function(r){zt(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.isGroup=function(){return!0},t.prototype.isEntityGroup=function(){return!1},t.prototype.clone=function(){for(var e=r.prototype.clone.call(this),n=this.getChildren(),i=0;i<n.length;i++){var a=n[i];e.add(a.clone())}return e},t}(AO),UO=function(r){zt(t,r);function t(e){return r.call(this,e)||this}return t.prototype._isInBBox=function(e,n){var i=this.getBBox();return i.minX<=e&&i.maxX>=e&&i.minY<=n&&i.maxY>=n},t.prototype.afterAttrsChange=function(e){r.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},t.prototype.getBBox=function(){var e=this.cfg.bbox;return e||(e=this.calculateBBox(),this.set("bbox",e)),e},t.prototype.getCanvasBBox=function(){var e=this.cfg.canvasBBox;return e||(e=this.calculateCanvasBBox(),this.set("canvasBBox",e)),e},t.prototype.applyMatrix=function(e){r.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},t.prototype.calculateCanvasBBox=function(){var e=this.getBBox(),n=this.getTotalMatrix(),i=e.minX,a=e.minY,o=e.maxX,s=e.maxY;if(n){var u=ru(n,[e.minX,e.minY]),l=ru(n,[e.maxX,e.minY]),f=ru(n,[e.minX,e.maxY]),c=ru(n,[e.maxX,e.maxY]);i=Math.min(u[0],l[0],f[0],c[0]),o=Math.max(u[0],l[0],f[0],c[0]),a=Math.min(u[1],l[1],f[1],c[1]),s=Math.max(u[1],l[1],f[1],c[1])}var d=this.attrs;if(d.shadowColor){var h=d.shadowBlur,v=h===void 0?0:h,p=d.shadowOffsetX,g=p===void 0?0:p,y=d.shadowOffsetY,m=y===void 0?0:y,b=i-v+g,x=o+v+g,w=a-v+m,E=s+v+m;i=Math.min(i,b),o=Math.max(o,x),a=Math.min(a,w),s=Math.max(s,E)}return{x:i,y:a,minX:i,minY:a,maxX:o,maxY:s,width:o-i,height:s-a}},t.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},t.prototype.isClipShape=function(){return this.get("isClipShape")},t.prototype.isInShape=function(e,n){return!1},t.prototype.isOnlyHitBox=function(){return!1},t.prototype.isHit=function(e,n){var i=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[e,n,1];o=this.invertFromMatrix(o);var s=o[0],u=o[1],l=this._isInBBox(s,u);return this.isOnlyHitBox()?l:!!(l&&!this.isClipped(s,u)&&(this.isInShape(s,u)||i&&i.isHit(s,u)||a&&a.isHit(s,u)))},t}(SO),jO=new Map;function io(r,t){jO.set(r,t)}function WO(r){return jO.get(r)}function XO(r){var t=r.attr(),e=t.x,n=t.y,i=t.width,a=t.height;return{x:e,y:n,width:i,height:a}}function YO(r){var t=r.attr(),e=t.x,n=t.y,i=t.r;return{x:e-i,y:n-i,width:i*2,height:i*2}}function si(r,t,e,n){var i=r-e,a=t-n;return Math.sqrt(i*i+a*a)}function Qh(r,t){return Math.abs(r-t)<.001}function Vl(r,t){var e=Ja(r),n=Ja(t),i=Qa(r),a=Qa(t);return{x:e,y:n,width:i-e,height:a-n}}function xp(r){return(r+Math.PI*2)%(Math.PI*2)}const jn={box:function(r,t,e,n){return Vl([r,e],[t,n])},length:function(r,t,e,n){return si(r,t,e,n)},pointAt:function(r,t,e,n,i){return{x:(1-i)*r+i*e,y:(1-i)*t+i*n}},pointDistance:function(r,t,e,n,i,a){var o=(e-r)*(i-r)+(n-t)*(a-t);if(o<0)return si(r,t,i,a);var s=(e-r)*(e-r)+(n-t)*(n-t);return o>s?si(e,n,i,a):this.pointToLine(r,t,e,n,i,a)},pointToLine:function(r,t,e,n,i,a){var o=[e-r,n-t];if(B1(o,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-t)*(a-t));var s=[-o[1],o[0]];gs(s,s);var u=[i-r,a-t];return Math.abs(R1(u,s))},tangentAngle:function(r,t,e,n){return Math.atan2(n-t,e-r)}};var c9=1e-4;function VO(r,t,e,n,i,a){var o,s=1/0,u=[e,n],l=20;a&&a>200&&(l=a/10);for(var f=1/l,c=f/10,d=0;d<=l;d++){var h=d*f,v=[i.apply(null,r.concat([h])),i.apply(null,t.concat([h]))],p=si(u[0],u[1],v[0],v[1]);p<s&&(o=h,s=p)}if(o===0)return{x:r[0],y:t[0]};if(o===1){var g=r.length;return{x:r[g-1],y:t[g-1]}}s=1/0;for(var d=0;d<32&&!(c<c9);d++){var y=o-c,m=o+c,v=[i.apply(null,r.concat([y])),i.apply(null,t.concat([y]))],p=si(u[0],u[1],v[0],v[1]);if(y>=0&&p<s)o=y,s=p;else{var b=[i.apply(null,r.concat([m])),i.apply(null,t.concat([m]))],x=si(u[0],u[1],b[0],b[1]);m<=1&&x<s?(o=m,s=x):c*=.5}}return{x:i.apply(null,r.concat([o])),y:i.apply(null,t.concat([o]))}}function d9(r,t){for(var e=0,n=r.length,i=0;i<n;i++){var a=r[i],o=t[i],s=r[(i+1)%n],u=t[(i+1)%n];e+=si(a,o,s,u)}return e/2}function os(r,t,e,n){var i=1-n;return i*i*r+2*n*i*t+n*n*e}function U2(r,t,e){var n=r+e-2*t;if(Qh(n,0))return[.5];var i=(r-t)/n;return i<=1&&i>=0?[i]:[]}function j2(r,t,e,n){return 2*(1-n)*(t-r)+2*n*(e-t)}function HO(r,t,e,n,i,a,o){var s=os(r,e,i,o),u=os(t,n,a,o),l=jn.pointAt(r,t,e,n,o),f=jn.pointAt(e,n,i,a,o);return[[r,t,l.x,l.y,s,u],[s,u,f.x,f.y,i,a]]}function Qy(r,t,e,n,i,a,o){if(o===0)return(si(r,t,e,n)+si(e,n,i,a)+si(r,t,i,a))/2;var s=HO(r,t,e,n,i,a,.5),u=s[0],l=s[1];return u.push(o-1),l.push(o-1),Qy.apply(null,u)+Qy.apply(null,l)}const KO={box:function(r,t,e,n,i,a){var o=U2(r,e,i)[0],s=U2(t,n,a)[0],u=[r,i],l=[t,a];return o!==void 0&&u.push(os(r,e,i,o)),s!==void 0&&l.push(os(t,n,a,s)),Vl(u,l)},length:function(r,t,e,n,i,a){return Qy(r,t,e,n,i,a,3)},nearestPoint:function(r,t,e,n,i,a,o,s){return VO([r,e,i],[t,n,a],o,s,os)},pointDistance:function(r,t,e,n,i,a,o,s){var u=this.nearestPoint(r,t,e,n,i,a,o,s);return si(u.x,u.y,o,s)},interpolationAt:os,pointAt:function(r,t,e,n,i,a,o){return{x:os(r,e,i,o),y:os(t,n,a,o)}},divide:function(r,t,e,n,i,a,o){return HO(r,t,e,n,i,a,o)},tangentAngle:function(r,t,e,n,i,a,o){var s=j2(r,e,i,o),u=j2(t,n,a,o),l=Math.atan2(u,s);return xp(l)}};function ss(r,t,e,n,i){var a=1-i;return a*a*a*r+3*t*i*a*a+3*e*i*i*a+n*i*i*i}function W2(r,t,e,n,i){var a=1-i;return 3*(a*a*(t-r)+2*a*i*(e-t)+i*i*(n-e))}function b0(r,t,e,n){var i=-3*r+9*t-9*e+3*n,a=6*r-12*t+6*e,o=3*t-3*r,s=[],u,l,f;if(Qh(i,0))Qh(a,0)||(u=-o/a,u>=0&&u<=1&&s.push(u));else{var c=a*a-4*i*o;Qh(c,0)?s.push(-a/(2*i)):c>0&&(f=Math.sqrt(c),u=(-a+f)/(2*i),l=(-a-f)/(2*i),u>=0&&u<=1&&s.push(u),l>=0&&l<=1&&s.push(l))}return s}function qO(r,t,e,n,i,a,o,s,u){var l=ss(r,e,i,o,u),f=ss(t,n,a,s,u),c=jn.pointAt(r,t,e,n,u),d=jn.pointAt(e,n,i,a,u),h=jn.pointAt(i,a,o,s,u),v=jn.pointAt(c.x,c.y,d.x,d.y,u),p=jn.pointAt(d.x,d.y,h.x,h.y,u);return[[r,t,c.x,c.y,v.x,v.y,l,f],[l,f,p.x,p.y,h.x,h.y,o,s]]}function Jy(r,t,e,n,i,a,o,s,u){if(u===0)return d9([r,e,i,o],[t,n,a,s]);var l=qO(r,t,e,n,i,a,o,s,.5),f=l[0],c=l[1];return f.push(u-1),c.push(u-1),Jy.apply(null,f)+Jy.apply(null,c)}const qf={extrema:b0,box:function(r,t,e,n,i,a,o,s){for(var u=[r,o],l=[t,s],f=b0(r,e,i,o),c=b0(t,n,a,s),d=0;d<f.length;d++)u.push(ss(r,e,i,o,f[d]));for(var d=0;d<c.length;d++)l.push(ss(t,n,a,s,c[d]));return Vl(u,l)},length:function(r,t,e,n,i,a,o,s){return Jy(r,t,e,n,i,a,o,s,3)},nearestPoint:function(r,t,e,n,i,a,o,s,u,l,f){return VO([r,e,i,o],[t,n,a,s],u,l,ss,f)},pointDistance:function(r,t,e,n,i,a,o,s,u,l,f){var c=this.nearestPoint(r,t,e,n,i,a,o,s,u,l,f);return si(c.x,c.y,u,l)},interpolationAt:ss,pointAt:function(r,t,e,n,i,a,o,s,u){return{x:ss(r,e,i,o,u),y:ss(t,n,a,s,u)}},divide:function(r,t,e,n,i,a,o,s,u){return qO(r,t,e,n,i,a,o,s,u)},tangentAngle:function(r,t,e,n,i,a,o,s,u){var l=W2(r,e,i,o,u),f=W2(t,n,a,s,u);return xp(Math.atan2(f,l))}};function X2(r,t){var e=Math.abs(r);return t>0?e:e*-1}const h9={box:function(r,t,e,n){return{x:r-e,y:t-n,width:e*2,height:n*2}},length:function(r,t,e,n){return Math.PI*(3*(e+n)-Math.sqrt((3*e+n)*(e+3*n)))},nearestPoint:function(r,t,e,n,i,a){var o=e,s=n;if(o===0||s===0)return{x:r,y:t};for(var u=i-r,l=a-t,f=Math.abs(u),c=Math.abs(l),d=o*o,h=s*s,v=Math.PI/4,p,g,y=0;y<4;y++){p=o*Math.cos(v),g=s*Math.sin(v);var m=(d-h)*Math.pow(Math.cos(v),3)/o,b=(h-d)*Math.pow(Math.sin(v),3)/s,x=p-m,w=g-b,E=f-m,_=c-b,M=Math.hypot(w,x),C=Math.hypot(_,E),S=M*Math.asin((x*_-w*E)/(M*C)),A=S/Math.sqrt(d+h-p*p-g*g);v+=A,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:r+X2(p,u),y:t+X2(g,l)}},pointDistance:function(r,t,e,n,i,a){var o=this.nearestPoint(r,t,e,n,i,a);return si(o.x,o.y,i,a)},pointAt:function(r,t,e,n,i){var a=2*Math.PI*i;return{x:r+e*Math.cos(a),y:t+n*Math.sin(a)}},tangentAngle:function(r,t,e,n,i){var a=2*Math.PI*i,o=Math.atan2(n*Math.cos(a),-e*Math.sin(a));return xp(o)}};function v9(r,t,e,n,i,a,o,s){return-1*e*Math.cos(i)*Math.sin(s)-n*Math.sin(i)*Math.cos(s)}function p9(r,t,e,n,i,a,o,s){return-1*e*Math.sin(i)*Math.sin(s)+n*Math.cos(i)*Math.cos(s)}function g9(r,t,e){return Math.atan(-t/r*Math.tan(e))}function y9(r,t,e){return Math.atan(t/(r*Math.tan(e)))}function Y2(r,t,e,n,i,a){return e*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function V2(r,t,e,n,i,a){return e*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+t}function m9(r,t,e,n){var i=Math.atan2(n*r,e*t);return(i+Math.PI*2)%(Math.PI*2)}function H2(r,t,e){return{x:r*Math.cos(e),y:t*Math.sin(e)}}function K2(r,t,e){var n=Math.cos(e),i=Math.sin(e);return[r*n-t*i,r*i+t*n]}const b9={box:function(r,t,e,n,i,a,o){for(var s=g9(e,n,i),u=1/0,l=-1/0,f=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var d=s+c;a<o?a<d&&d<o&&f.push(d):o<d&&d<a&&f.push(d)}for(var c=0;c<f.length;c++){var h=Y2(r,t,e,n,i,f[c]);h<u&&(u=h),h>l&&(l=h)}for(var v=y9(e,n,i),p=1/0,g=-1/0,y=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var m=v+c;a<o?a<m&&m<o&&y.push(m):o<m&&m<a&&y.push(m)}for(var c=0;c<y.length;c++){var b=V2(r,t,e,n,i,y[c]);b<p&&(p=b),b>g&&(g=b)}return{x:u,y:p,width:l-u,height:g-p}},length:function(r,t,e,n,i,a,o){},nearestPoint:function(r,t,e,n,i,a,o,s,u){var l=K2(s-r,u-t,-i),f=l[0],c=l[1],d=h9.nearestPoint(0,0,e,n,f,c),h=m9(e,n,d.x,d.y);h<a?d=H2(e,n,a):h>o&&(d=H2(e,n,o));var v=K2(d.x,d.y,i);return{x:v[0]+r,y:v[1]+t}},pointDistance:function(r,t,e,n,i,a,o,s,u){var l=this.nearestPoint(r,t,e,n,s,u);return si(l.x,l.y,s,u)},pointAt:function(r,t,e,n,i,a,o,s){var u=(o-a)*s+a;return{x:Y2(r,t,e,n,i,u),y:V2(r,t,e,n,i,u)}},tangentAngle:function(r,t,e,n,i,a,o,s){var u=(o-a)*s+a,l=v9(r,t,e,n,i,a,o,u),f=p9(r,t,e,n,i,a,o,u);return xp(Math.atan2(f,l))}};function ZO(r){for(var t=0,e=[],n=0;n<r.length-1;n++){var i=r[n],a=r[n+1],o=si(i[0],i[1],a[0],a[1]),s={from:i,to:a,length:o};e.push(s),t+=o}return{segments:e,totalLength:t}}function x9(r){if(r.length<2)return 0;for(var t=0,e=0;e<r.length-1;e++){var n=r[e],i=r[e+1];t+=si(n[0],n[1],i[0],i[1])}return t}function w9(r,t){if(t>1||t<0||r.length<2)return null;var e=ZO(r),n=e.segments,i=e.totalLength;if(i===0)return{x:r[0][0],y:r[0][1]};for(var a=0,o=null,s=0;s<n.length;s++){var u=n[s],l=u.from,f=u.to,c=u.length/i;if(t>=a&&t<=a+c){var d=(t-a)/c;o=jn.pointAt(l[0],l[1],f[0],f[1],d);break}a+=c}return o}function E9(r,t){if(t>1||t<0||r.length<2)return 0;for(var e=ZO(r),n=e.segments,i=e.totalLength,a=0,o=0,s=0;s<n.length;s++){var u=n[s],l=u.from,f=u.to,c=u.length/i;if(t>=a&&t<=a+c){o=Math.atan2(f[1]-l[1],f[0]-l[0]);break}a+=c}return o}function _9(r,t,e){for(var n=1/0,i=0;i<r.length-1;i++){var a=r[i],o=r[i+1],s=jn.pointDistance(a[0],a[1],o[0],o[1],t,e);s<n&&(n=s)}return n}const QO={box:function(r){for(var t=[],e=[],n=0;n<r.length;n++){var i=r[n];t.push(i[0]),e.push(i[1])}return Vl(t,e)},length:function(r){return x9(r)},pointAt:function(r,t){return w9(r,t)},pointDistance:function(r,t,e){return _9(r,t,e)},tangentAngle:function(r,t){return E9(r,t)}};function q2(r,t){return!r||!t?r||t:{minX:Math.min(r.minX,t.minX),minY:Math.min(r.minY,t.minY),maxX:Math.max(r.maxX,t.maxX),maxY:Math.max(r.maxY,t.maxY)}}function rb(r,t){var e=r.get("startArrowShape"),n=r.get("endArrowShape"),i=null,a=null;return e&&(i=e.getCanvasBBox(),t=q2(t,i)),n&&(a=n.getCanvasBBox(),t=q2(t,a)),t}function S9(r){for(var t=r.attr(),e=t.points,n=[],i=[],a=0;a<e.length;a++){var o=e[a];n.push(o[0]),i.push(o[1])}var s=Vl(n,i),u=s.x,l=s.y,f=s.width,c=s.height,d={minX:u,minY:l,maxX:u+f,maxY:l+c};return d=rb(r,d),{x:d.minX,y:d.minY,width:d.maxX-d.minX,height:d.maxY-d.minY}}function M9(r){for(var t=r.attr(),e=t.points,n=[],i=[],a=0;a<e.length;a++){var o=e[a];n.push(o[0]),i.push(o[1])}return Vl(n,i)}var x0=null;function JO(){if(!x0){var r=document.createElement("canvas");r.width=1,r.height=1,x0=r.getContext("2d")}return x0}function eL(r,t,e){var n=1;if(Fe(r)&&(n=r.split(`
|
|
270
270
|
`).length),n>1){var i=C9(t,e);return t*n+i*(n-1)}return t}function C9(r,t){return t?t-r:r*.14}function A9(r,t){var e=JO(),n=0;if(gt(r)||r==="")return n;if(e.save(),e.font=t,Fe(r)&&r.includes(`
|
|
271
271
|
`)){var i=r.split(`
|
|
272
272
|
`);xe(i,function(a){var o=e.measureText(a).width;n<o&&(n=o)})}else n=e.measureText(r).width;return e.restore(),n}function tL(r){var t=r.fontSize,e=r.fontFamily,n=r.fontWeight,i=r.fontStyle,a=r.fontVariant;return[i,a,n,t+"px",e].join(" ").trim()}function T9(r){var t=r.attr(),e=t.x,n=t.y,i=t.text,a=t.fontSize,o=t.lineHeight,s=t.font;s||(s=tL(t));var u=A9(i,s),l;if(!u)l={x:e,y:n,width:0,height:0};else{var f=t.textAlign,c=t.textBaseline,d=eL(i,a,o),h={x:e,y:n-d};f&&(f==="end"||f==="right"?h.x-=u:f==="center"&&(h.x-=u/2)),c&&(c==="top"?h.y+=d:c==="middle"&&(h.y+=d/2)),l={x:h.x,y:h.y,width:u,height:d}}return l}var I9=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig,O9=/[^\s\,]+/ig;function L9(r){var t=r||[];if(wt(t))return t;if(Fe(t))return t=t.match(I9),xe(t,function(e,n){if(e=e.match(O9),e[0].length>1){var i=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=i}xe(e,function(a,o){isNaN(a)||(e[o]=+a)}),t[n]=e}),t}function k9(r,t,e,n){var i=[],a=!!n,o,s,u,l,f,c,d;if(a){u=n[0],l=n[1];for(var h=0,v=r.length;h<v;h+=1){var p=r[h];u=ns([0,0],u,p),l=is([0,0],l,p)}}for(var h=0,g=r.length;h<g;h+=1){var p=r[h];if(h===0&&!e)d=p;else if(h===g-1&&!e)c=p,i.push(d),i.push(c);else{var y=[h?h-1:g-1,h-1][e?0:1];o=r[y],s=r[e?(h+1)%g:h+1];var m=[0,0];m=Yh(m,s,o),m=oi(m,m,t);var b=Ev(p,o),x=Ev(p,s),w=b+x;w!==0&&(b/=w,x/=w);var E=oi([0,0],m,-b),_=oi([0,0],m,x);c=$n([0,0],p,E),f=$n([0,0],p,_),f=ns([0,0],f,is([0,0],s,p)),f=is([0,0],f,ns([0,0],s,p)),E=Yh([0,0],f,p),E=oi([0,0],E,-b/x),c=$n([0,0],p,E),c=ns([0,0],c,is([0,0],o,p)),c=is([0,0],c,ns([0,0],o,p)),_=Yh([0,0],p,c),_=oi([0,0],_,x/b),f=$n([0,0],p,_),a&&(c=is([0,0],c,u),c=ns([0,0],c,l),f=is([0,0],f,u),f=ns([0,0],f,l)),i.push(d),i.push(c),d=f}}return e&&i.push(i.shift()),i}function rL(r,t,e){t===void 0&&(t=!1),e===void 0&&(e=[[0,0],[1,1]]);for(var n=!!t,i=[],a=0,o=r.length;a<o;a+=2)i.push([r[a],r[a+1]]);for(var s=k9(i,.4,n,e),u=i.length,l=[],f,c,d,a=0;a<u-1;a+=1)f=s[a*2],c=s[a*2+1],d=i[a+1],l.push(["C",f[0],f[1],c[0],c[1],d[0],d[1]]);return n&&(f=s[u],c=s[u+1],d=i[0],l.push(["C",f[0],f[1],c[0],c[1],d[0],d[1]])),l}var Zf=`
|
|
@@ -294,10 +294,10 @@ import{_ as z5,e as G5,f as $5}from"./ActionCard.vue_vue_type_script_setup_true_
|
|
|
294
294
|
stdDeviation="`+(t.blur?t.blur/10:0)+`"
|
|
295
295
|
flood-color="`+(t.color?t.color:"#000")+`"
|
|
296
296
|
flood-opacity="`+(t.opacity?t.opacity:1)+`"
|
|
297
|
-
/>`;e.innerHTML=n},r}(),X_=function(){function r(t,e){this.cfg={};var n=ea("marker"),i=eo("marker_");n.setAttribute("id",i);var a=ea("path");a.setAttribute("stroke",t.stroke||"none"),a.setAttribute("fill",t.fill||"none"),n.appendChild(a),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=a,this.id=i;var o=t[e==="marker-start"?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",o===!0?this._setDefaultPath(e,a):(this.cfg=o,this._setMarker(t.lineWidth,a)),this}return r.prototype.match=function(){return!1},r.prototype._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),n.setAttribute("refX",""+10*Math.cos(Math.PI/6)),n.setAttribute("refY","5")},r.prototype._setMarker=function(t,e){var n=this.el,i=this.cfg.path,a=this.cfg.d;wt(i)&&(i=i.map(function(o){return o.join(" ")}).join("")),e.setAttribute("d",i),n.appendChild(e),a&&n.setAttribute("refX",""+a/t)},r.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},r}(),iH=function(){function r(t){this.type="clip",this.cfg={};var e=ea("clipPath");this.el=e,this.id=eo("clip_"),e.id=this.id;var n=t.cfg.el;return e.appendChild(n),this.cfg=t,this}return r.prototype.match=function(){return!1},r.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},r}(),aH=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,oH=function(){function r(t){this.cfg={};var e=ea("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=ea("image");e.appendChild(n);var i=eo("pattern_");e.id=i,this.el=e,this.id=i,this.cfg=t;var a=aH.exec(t),o=a[2];n.setAttribute("href",o);var s=new Image;o.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=o;function u(){e.setAttribute("width",""+s.width),e.setAttribute("height",""+s.height)}return s.complete?u():(s.onload=u,s.src=s.src),this}return r.prototype.match=function(t,e){return this.cfg===e},r}(),sH=function(){function r(t){var e=ea("defs"),n=eo("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return r.prototype.find=function(t,e){for(var n=this.children,i=null,a=0;a<n.length;a++)if(n[a].match(t,e)){i=n[a].id;break}return i},r.prototype.findById=function(t){for(var e=this.children,n=null,i=0;i<e.length;i++)if(e[i].id===t){n=e[i];break}return n},r.prototype.add=function(t){this.children.push(t),t.canvas=this.canvas,t.parent=this},r.prototype.getDefaultArrow=function(t,e){var n=t.stroke||t.strokeStyle;if(this.defaultArrow[n])return this.defaultArrow[n].id;var i=new X_(t,e);return this.defaultArrow[n]=i,this.el.appendChild(i.el),this.add(i),i.id},r.prototype.addGradient=function(t){var e=new eH(t);return this.el.appendChild(e.el),this.add(e),e.id},r.prototype.addArrow=function(t,e){var n=new X_(t,e);return this.el.appendChild(n.el),this.add(n),n.id},r.prototype.addShadow=function(t){var e=new nH(t);return this.el.appendChild(e.el),this.add(e),e.id},r.prototype.addPattern=function(t){var e=new oH(t);return this.el.appendChild(e.el),this.add(e),e.id},r.prototype.addClip=function(t){var e=new iH(t);return this.el.appendChild(e.el),this.add(e),e.id},r}(),Qf=function(r){zt(t,r);function t(e){return r.call(this,F(F({},e),{autoDraw:!0,renderer:"svg"}))||this}return t.prototype.getShapeBase=function(){return y1},t.prototype.getGroupBase=function(){return gk},t.prototype.getShape=function(e,n,i){var a=i.target||i.srcElement;if(!mm[a.tagName]){for(var o=a.parentNode;o&&!mm[o.tagName];)o=o.parentNode;a=o}return this.find(function(s){return s.get("el")===a})},t.prototype.createDom=function(){var e=ea("svg"),n=new sH(e);return e.setAttribute("width",""+this.get("width")),e.setAttribute("height",""+this.get("height")),this.set("context",n),e},t.prototype.onCanvasChange=function(e){var n=this.get("context"),i=this.get("el");if(e==="sort"){var a=this.get("children");a&&a.length&&hk(this,function(s,u){return a.indexOf(s)-a.indexOf(u)?1:0})}else if(e==="clear"){if(i){i.innerHTML="";var o=n.el;o.innerHTML="",i.appendChild(o)}}else e==="matrix"?Wc(this):e==="clip"?_c(this,n):e==="changeSize"&&(i.setAttribute("width",""+this.get("width")),i.setAttribute("height",""+this.get("height")))},t.prototype.draw=function(){var e=this.get("context"),n=this.getChildren();_c(this,e),n.length&&vk(e,n)},t}(GO);function ph(r,t,e){if(r){if(typeof r.addEventListener=="function")return r.addEventListener(t,e,!1),{remove:function(){r.removeEventListener(t,e,!1)}};if(typeof r.attachEvent=="function")return r.attachEvent("on"+t,e),{remove:function(){r.detachEvent("on"+t,e)}}}}var Uf,k0,mk,bm;function uH(){Uf=document.createElement("table"),k0=document.createElement("tr"),mk=/^\s*<(\w+|!)[^>]*>/,bm={tr:document.createElement("tbody"),tbody:Uf,thead:Uf,tfoot:Uf,td:k0,th:k0,"*":document.createElement("div")}}function Ur(r){Uf||uH();var t=mk.test(r)&&RegExp.$1;(!t||!(t in bm))&&(t="*");var e=bm[t];r=typeof r=="string"?r.replace(/(^\s*)|(\s*$)/g,""):r,e.innerHTML=""+r;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function tr(r,t){if(r)for(var e in t)t.hasOwnProperty(e)&&(r.style[e]=t[e]);return r}var bk={exports:{}},lH={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},xk={exports:{}},fH=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},cH=fH,dH=Array.prototype.concat,hH=Array.prototype.slice,Y_=xk.exports=function(t){for(var e=[],n=0,i=t.length;n<i;n++){var a=t[n];cH(a)?e=dH.call(e,hH.call(a)):e.push(a)}return e};Y_.wrap=function(r){return function(){return r(Y_(arguments))}};var vH=xk.exports,Jf=lH,Xc=vH,wk=Object.hasOwnProperty,Ek=Object.create(null);for(var D0 in Jf)wk.call(Jf,D0)&&(Ek[Jf[D0]]=D0);var Ri=bk.exports={to:{},get:{}};Ri.get=function(r){var t=r.substring(0,3).toLowerCase(),e,n;switch(t){case"hsl":e=Ri.get.hsl(r),n="hsl";break;case"hwb":e=Ri.get.hwb(r),n="hwb";break;default:e=Ri.get.rgb(r),n="rgb";break}return e?{model:n,value:e}:null};Ri.get.rgb=function(r){if(!r)return null;var t=/^#([a-f0-9]{3,4})$/i,e=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,o=[0,0,0,1],s,u,l;if(s=r.match(e)){for(l=s[2],s=s[1],u=0;u<3;u++){var f=u*2;o[u]=parseInt(s.slice(f,f+2),16)}l&&(o[3]=parseInt(l,16)/255)}else if(s=r.match(t)){for(s=s[1],l=s[3],u=0;u<3;u++)o[u]=parseInt(s[u]+s[u],16);l&&(o[3]=parseInt(l+l,16)/255)}else if(s=r.match(n)){for(u=0;u<3;u++)o[u]=parseInt(s[u+1],0);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else if(s=r.match(i)){for(u=0;u<3;u++)o[u]=Math.round(parseFloat(s[u+1])*2.55);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else return(s=r.match(a))?s[1]==="transparent"?[0,0,0,0]:wk.call(Jf,s[1])?(o=Jf[s[1]],o[3]=1,o):null:null;for(u=0;u<3;u++)o[u]=ys(o[u],0,255);return o[3]=ys(o[3],0,1),o};Ri.get.hsl=function(r){if(!r)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,e=r.match(t);if(e){var n=parseFloat(e[4]),i=(parseFloat(e[1])%360+360)%360,a=ys(parseFloat(e[2]),0,100),o=ys(parseFloat(e[3]),0,100),s=ys(isNaN(n)?1:n,0,1);return[i,a,o,s]}return null};Ri.get.hwb=function(r){if(!r)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,e=r.match(t);if(e){var n=parseFloat(e[4]),i=(parseFloat(e[1])%360+360)%360,a=ys(parseFloat(e[2]),0,100),o=ys(parseFloat(e[3]),0,100),s=ys(isNaN(n)?1:n,0,1);return[i,a,o,s]}return null};Ri.to.hex=function(){var r=Xc(arguments);return"#"+gh(r[0])+gh(r[1])+gh(r[2])+(r[3]<1?gh(Math.round(r[3]*255)):"")};Ri.to.rgb=function(){var r=Xc(arguments);return r.length<4||r[3]===1?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"};Ri.to.rgb.percent=function(){var r=Xc(arguments),t=Math.round(r[0]/255*100),e=Math.round(r[1]/255*100),n=Math.round(r[2]/255*100);return r.length<4||r[3]===1?"rgb("+t+"%, "+e+"%, "+n+"%)":"rgba("+t+"%, "+e+"%, "+n+"%, "+r[3]+")"};Ri.to.hsl=function(){var r=Xc(arguments);return r.length<4||r[3]===1?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"};Ri.to.hwb=function(){var r=Xc(arguments),t="";return r.length>=4&&r[3]!==1&&(t=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+t+")"};Ri.to.keyword=function(r){return Ek[r.slice(0,3)]};function ys(r,t,e){return Math.min(Math.max(t,r),e)}function gh(r){var t=Math.round(r).toString(16).toUpperCase();return t.length<2?"0"+t:t}var pH=bk.exports,_k={exports:{}},gH={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ou=gH,Sk={};for(var N0 in ou)ou.hasOwnProperty(N0)&&(Sk[ou[N0]]=N0);var kt=_k.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var yi in kt)if(kt.hasOwnProperty(yi)){if(!("channels"in kt[yi]))throw new Error("missing channels property: "+yi);if(!("labels"in kt[yi]))throw new Error("missing channel labels property: "+yi);if(kt[yi].labels.length!==kt[yi].channels)throw new Error("channel and label counts mismatch: "+yi);var yH=kt[yi].channels,mH=kt[yi].labels;delete kt[yi].channels,delete kt[yi].labels,Object.defineProperty(kt[yi],"channels",{value:yH}),Object.defineProperty(kt[yi],"labels",{value:mH})}kt.rgb.hsl=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255,i=Math.min(t,e,n),a=Math.max(t,e,n),o=a-i,s,u,l;return a===i?s=0:t===a?s=(e-n)/o:e===a?s=2+(n-t)/o:n===a&&(s=4+(t-e)/o),s=Math.min(s*60,360),s<0&&(s+=360),l=(i+a)/2,a===i?u=0:l<=.5?u=o/(a+i):u=o/(2-a-i),[s,u*100,l*100]};kt.rgb.hsv=function(r){var t,e,n,i,a,o=r[0]/255,s=r[1]/255,u=r[2]/255,l=Math.max(o,s,u),f=l-Math.min(o,s,u),c=function(d){return(l-d)/6/f+1/2};return f===0?i=a=0:(a=f/l,t=c(o),e=c(s),n=c(u),o===l?i=n-e:s===l?i=1/3+t-n:u===l&&(i=2/3+e-t),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,l*100]};kt.rgb.hwb=function(r){var t=r[0],e=r[1],n=r[2],i=kt.rgb.hsl(r)[0],a=1/255*Math.min(t,Math.min(e,n));return n=1-1/255*Math.max(t,Math.max(e,n)),[i,a*100,n*100]};kt.rgb.cmyk=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255,i,a,o,s;return s=Math.min(1-t,1-e,1-n),i=(1-t-s)/(1-s)||0,a=(1-e-s)/(1-s)||0,o=(1-n-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function bH(r,t){return Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2)+Math.pow(r[2]-t[2],2)}kt.rgb.keyword=function(r){var t=Sk[r];if(t)return t;var e=1/0,n;for(var i in ou)if(ou.hasOwnProperty(i)){var a=ou[i],o=bH(r,a);o<e&&(e=o,n=i)}return n};kt.keyword.rgb=function(r){return ou[r]};kt.rgb.xyz=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=t*.4124+e*.3576+n*.1805,a=t*.2126+e*.7152+n*.0722,o=t*.0193+e*.1192+n*.9505;return[i*100,a*100,o*100]};kt.rgb.lab=function(r){var t=kt.rgb.xyz(r),e=t[0],n=t[1],i=t[2],a,o,s;return e/=95.047,n/=100,i/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*n-16,o=500*(e-n),s=200*(n-i),[a,o,s]};kt.hsl.rgb=function(r){var t=r[0]/360,e=r[1]/100,n=r[2]/100,i,a,o,s,u;if(e===0)return u=n*255,[u,u,u];n<.5?a=n*(1+e):a=n+e-n*e,i=2*n-a,s=[0,0,0];for(var l=0;l<3;l++)o=t+1/3*-(l-1),o<0&&o++,o>1&&o--,6*o<1?u=i+(a-i)*6*o:2*o<1?u=a:3*o<2?u=i+(a-i)*(2/3-o)*6:u=i,s[l]=u*255;return s};kt.hsl.hsv=function(r){var t=r[0],e=r[1]/100,n=r[2]/100,i=e,a=Math.max(n,.01),o,s;return n*=2,e*=n<=1?n:2-n,i*=a<=1?a:2-a,s=(n+e)/2,o=n===0?2*i/(a+i):2*e/(n+e),[t,o*100,s*100]};kt.hsv.rgb=function(r){var t=r[0]/60,e=r[1]/100,n=r[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*n*(1-e),s=255*n*(1-e*a),u=255*n*(1-e*(1-a));switch(n*=255,i){case 0:return[n,u,o];case 1:return[s,n,o];case 2:return[o,n,u];case 3:return[o,s,n];case 4:return[u,o,n];case 5:return[n,o,s]}};kt.hsv.hsl=function(r){var t=r[0],e=r[1]/100,n=r[2]/100,i=Math.max(n,.01),a,o,s;return s=(2-e)*n,a=(2-e)*i,o=e*i,o/=a<=1?a:2-a,o=o||0,s/=2,[t,o*100,s*100]};kt.hwb.rgb=function(r){var t=r[0]/360,e=r[1]/100,n=r[2]/100,i=e+n,a,o,s,u;i>1&&(e/=i,n/=i),a=Math.floor(6*t),o=1-n,s=6*t-a,a&1&&(s=1-s),u=e+s*(o-e);var l,f,c;switch(a){default:case 6:case 0:l=o,f=u,c=e;break;case 1:l=u,f=o,c=e;break;case 2:l=e,f=o,c=u;break;case 3:l=e,f=u,c=o;break;case 4:l=u,f=e,c=o;break;case 5:l=o,f=e,c=u;break}return[l*255,f*255,c*255]};kt.cmyk.rgb=function(r){var t=r[0]/100,e=r[1]/100,n=r[2]/100,i=r[3]/100,a,o,s;return a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,n*(1-i)+i),[a*255,o*255,s*255]};kt.xyz.rgb=function(r){var t=r[0]/100,e=r[1]/100,n=r[2]/100,i,a,o;return i=t*3.2406+e*-1.5372+n*-.4986,a=t*-.9689+e*1.8758+n*.0415,o=t*.0557+e*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};kt.xyz.lab=function(r){var t=r[0],e=r[1],n=r[2],i,a,o;return t/=95.047,e/=100,n/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*e-16,a=500*(t-e),o=200*(e-n),[i,a,o]};kt.lab.xyz=function(r){var t=r[0],e=r[1],n=r[2],i,a,o;a=(t+16)/116,i=e/500+a,o=a-n/200;var s=Math.pow(a,3),u=Math.pow(i,3),l=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};kt.lab.lch=function(r){var t=r[0],e=r[1],n=r[2],i,a,o;return i=Math.atan2(n,e),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(e*e+n*n),[t,o,a]};kt.lch.lab=function(r){var t=r[0],e=r[1],n=r[2],i,a,o;return o=n/360*2*Math.PI,i=e*Math.cos(o),a=e*Math.sin(o),[t,i,a]};kt.rgb.ansi16=function(r){var t=r[0],e=r[1],n=r[2],i=1 in arguments?arguments[1]:kt.rgb.hsv(r)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(n/255)<<2|Math.round(e/255)<<1|Math.round(t/255));return i===2&&(a+=60),a};kt.hsv.ansi16=function(r){return kt.rgb.ansi16(kt.hsv.rgb(r),r[2])};kt.rgb.ansi256=function(r){var t=r[0],e=r[1],n=r[2];if(t===e&&e===n)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var i=16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(n/255*5);return i};kt.ansi16.rgb=function(r){var t=r%10;if(t===0||t===7)return r>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var e=(~~(r>50)+1)*.5,n=(t&1)*e*255,i=(t>>1&1)*e*255,a=(t>>2&1)*e*255;return[n,i,a]};kt.ansi256.rgb=function(r){if(r>=232){var t=(r-232)*10+8;return[t,t,t]}r-=16;var e,n=Math.floor(r/36)/5*255,i=Math.floor((e=r%36)/6)/5*255,a=e%6/5*255;return[n,i,a]};kt.rgb.hex=function(r){var t=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),e=t.toString(16).toUpperCase();return"000000".substring(e.length)+e};kt.hex.rgb=function(r){var t=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var e=t[0];t[0].length===3&&(e=e.split("").map(function(s){return s+s}).join(""));var n=parseInt(e,16),i=n>>16&255,a=n>>8&255,o=n&255;return[i,a,o]};kt.rgb.hcg=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255,i=Math.max(Math.max(t,e),n),a=Math.min(Math.min(t,e),n),o=i-a,s,u;return o<1?s=a/(1-o):s=0,o<=0?u=0:i===t?u=(e-n)/o%6:i===e?u=2+(n-t)/o:u=4+(t-e)/o+4,u/=6,u%=1,[u*360,o*100,s*100]};kt.hsl.hcg=function(r){var t=r[1]/100,e=r[2]/100,n=1,i=0;return e<.5?n=2*t*e:n=2*t*(1-e),n<1&&(i=(e-.5*n)/(1-n)),[r[0],n*100,i*100]};kt.hsv.hcg=function(r){var t=r[1]/100,e=r[2]/100,n=t*e,i=0;return n<1&&(i=(e-n)/(1-n)),[r[0],n*100,i*100]};kt.hcg.rgb=function(r){var t=r[0]/360,e=r[1]/100,n=r[2]/100;if(e===0)return[n*255,n*255,n*255];var i=[0,0,0],a=t%1*6,o=a%1,s=1-o,u=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return u=(1-e)*n,[(e*i[0]+u)*255,(e*i[1]+u)*255,(e*i[2]+u)*255]};kt.hcg.hsv=function(r){var t=r[1]/100,e=r[2]/100,n=t+e*(1-t),i=0;return n>0&&(i=t/n),[r[0],i*100,n*100]};kt.hcg.hsl=function(r){var t=r[1]/100,e=r[2]/100,n=e*(1-t)+.5*t,i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[r[0],i*100,n*100]};kt.hcg.hwb=function(r){var t=r[1]/100,e=r[2]/100,n=t+e*(1-t);return[r[0],(n-t)*100,(1-n)*100]};kt.hwb.hcg=function(r){var t=r[1]/100,e=r[2]/100,n=1-e,i=n-t,a=0;return i<1&&(a=(n-i)/(1-i)),[r[0],i*100,a*100]};kt.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};kt.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};kt.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};kt.gray.hsl=kt.gray.hsv=function(r){return[0,0,r[0]]};kt.gray.hwb=function(r){return[0,100,r[0]]};kt.gray.cmyk=function(r){return[0,0,0,r[0]]};kt.gray.lab=function(r){return[r[0],0,0]};kt.gray.hex=function(r){var t=Math.round(r[0]/100*255)&255,e=(t<<16)+(t<<8)+t,n=e.toString(16).toUpperCase();return"000000".substring(n.length)+n};kt.rgb.gray=function(r){var t=(r[0]+r[1]+r[2])/3;return[t/255*100]};var Mk=_k.exports,Pv=Mk;function xH(){for(var r={},t=Object.keys(Pv),e=t.length,n=0;n<e;n++)r[t[n]]={distance:-1,parent:null};return r}function wH(r){var t=xH(),e=[r];for(t[r].distance=0;e.length;)for(var n=e.pop(),i=Object.keys(Pv[n]),a=i.length,o=0;o<a;o++){var s=i[o],u=t[s];u.distance===-1&&(u.distance=t[n].distance+1,u.parent=n,e.unshift(s))}return t}function EH(r,t){return function(e){return t(r(e))}}function _H(r,t){for(var e=[t[r].parent,r],n=Pv[t[r].parent][r],i=t[r].parent;t[i].parent;)e.unshift(t[i].parent),n=EH(Pv[t[i].parent][i],n),i=t[i].parent;return n.conversion=e,n}var SH=function(r){for(var t=wH(r),e={},n=Object.keys(t),i=n.length,a=0;a<i;a++){var o=n[a],s=t[o];s.parent!==null&&(e[o]=_H(o,t))}return e},xm=Mk,MH=SH,sl={},CH=Object.keys(xm);function AH(r){var t=function(e){return e==null?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),r(e))};return"conversion"in r&&(t.conversion=r.conversion),t}function TH(r){var t=function(e){if(e==null)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=r(e);if(typeof n=="object")for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in r&&(t.conversion=r.conversion),t}CH.forEach(function(r){sl[r]={},Object.defineProperty(sl[r],"channels",{value:xm[r].channels}),Object.defineProperty(sl[r],"labels",{value:xm[r].labels});var t=MH(r),e=Object.keys(t);e.forEach(function(n){var i=t[n];sl[r][n]=TH(i),sl[r][n].raw=AH(i)})});var IH=sl,jf=pH,ki=IH,pb=[].slice,Ck=["keyword","gray","hex"],wm={};Object.keys(ki).forEach(function(r){wm[pb.call(ki[r].labels).sort().join("")]=r});var Rv={};function Vn(r,t){if(!(this instanceof Vn))return new Vn(r,t);if(t&&t in Ck&&(t=null),t&&!(t in ki))throw new Error("Unknown model: "+t);var e,n;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof Vn)this.model=r.model,this.color=r.color.slice(),this.valpha=r.valpha;else if(typeof r=="string"){var i=jf.get(r);if(i===null)throw new Error("Unable to parse color from string: "+r);this.model=i.model,n=ki[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(r.length){this.model=t||"rgb",n=ki[this.model].channels;var a=pb.call(r,0,n);this.color=Em(a,n),this.valpha=typeof r[n]=="number"?r[n]:1}else if(typeof r=="number")r&=16777215,this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;var o=Object.keys(r);"alpha"in r&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof r.alpha=="number"?r.alpha:0);var s=o.sort().join("");if(!(s in wm))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=wm[s];var u=ki[this.model].labels,l=[];for(e=0;e<u.length;e++)l.push(r[u[e]]);this.color=Em(l)}if(Rv[this.model])for(n=ki[this.model].channels,e=0;e<n;e++){var f=Rv[this.model][e];f&&(this.color[e]=f(this.color[e]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Vn.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(r){var t=this.model in jf.to?this:this.rgb();t=t.round(typeof r=="number"?r:1);var e=t.valpha===1?t.color:t.color.concat(this.valpha);return jf.to[t.model](e)},percentString:function(r){var t=this.rgb().round(typeof r=="number"?r:1),e=t.valpha===1?t.color:t.color.concat(this.valpha);return jf.to.rgb.percent(e)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var r={},t=ki[this.model].channels,e=ki[this.model].labels,n=0;n<t;n++)r[e[n]]=this.color[n];return this.valpha!==1&&(r.alpha=this.valpha),r},unitArray:function(){var r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,this.valpha!==1&&r.push(this.valpha),r},unitObject:function(){var r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,this.valpha!==1&&(r.alpha=this.valpha),r},round:function(r){return r=Math.max(r||0,0),new Vn(this.color.map(LH(r)).concat(this.valpha),this.model)},alpha:function(r){return arguments.length?new Vn(this.color.concat(Math.max(0,Math.min(1,r))),this.model):this.valpha},red:fn("rgb",0,Cn(255)),green:fn("rgb",1,Cn(255)),blue:fn("rgb",2,Cn(255)),hue:fn(["hsl","hsv","hsl","hwb","hcg"],0,function(r){return(r%360+360)%360}),saturationl:fn("hsl",1,Cn(100)),lightness:fn("hsl",2,Cn(100)),saturationv:fn("hsv",1,Cn(100)),value:fn("hsv",2,Cn(100)),chroma:fn("hcg",1,Cn(100)),gray:fn("hcg",2,Cn(100)),white:fn("hwb",1,Cn(100)),wblack:fn("hwb",2,Cn(100)),cyan:fn("cmyk",0,Cn(100)),magenta:fn("cmyk",1,Cn(100)),yellow:fn("cmyk",2,Cn(100)),black:fn("cmyk",3,Cn(100)),x:fn("xyz",0,Cn(100)),y:fn("xyz",1,Cn(100)),z:fn("xyz",2,Cn(100)),l:fn("lab",0,Cn(100)),a:fn("lab",1),b:fn("lab",2),keyword:function(r){return arguments.length?new Vn(r):ki[this.model].keyword(this.color)},hex:function(r){return arguments.length?new Vn(r):jf.to.hex(this.rgb().round().color)},rgbNumber:function(){var r=this.rgb().color;return(r[0]&255)<<16|(r[1]&255)<<8|r[2]&255},luminosity:function(){for(var r=this.rgb().color,t=[],e=0;e<r.length;e++){var n=r[e]/255;t[e]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(r){var t=this.luminosity(),e=r.luminosity();return t>e?(t+.05)/(e+.05):(e+.05)/(t+.05)},level:function(r){var t=this.contrast(r);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var r=this.rgb().color,t=(r[0]*299+r[1]*587+r[2]*114)/1e3;return t<128},isLight:function(){return!this.isDark()},negate:function(){for(var r=this.rgb(),t=0;t<3;t++)r.color[t]=255-r.color[t];return r},lighten:function(r){var t=this.hsl();return t.color[2]+=t.color[2]*r,t},darken:function(r){var t=this.hsl();return t.color[2]-=t.color[2]*r,t},saturate:function(r){var t=this.hsl();return t.color[1]+=t.color[1]*r,t},desaturate:function(r){var t=this.hsl();return t.color[1]-=t.color[1]*r,t},whiten:function(r){var t=this.hwb();return t.color[1]+=t.color[1]*r,t},blacken:function(r){var t=this.hwb();return t.color[2]+=t.color[2]*r,t},grayscale:function(){var r=this.rgb().color,t=r[0]*.3+r[1]*.59+r[2]*.11;return Vn.rgb(t,t,t)},fade:function(r){return this.alpha(this.valpha-this.valpha*r)},opaquer:function(r){return this.alpha(this.valpha+this.valpha*r)},rotate:function(r){var t=this.hsl(),e=t.color[0];return e=(e+r)%360,e=e<0?360+e:e,t.color[0]=e,t},mix:function(r,t){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);var e=r.rgb(),n=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=e.alpha()-n.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,u=1-s;return Vn.rgb(s*e.red()+u*n.red(),s*e.green()+u*n.green(),s*e.blue()+u*n.blue(),e.alpha()*i+n.alpha()*(1-i))}};Object.keys(ki).forEach(function(r){if(Ck.indexOf(r)===-1){var t=ki[r].channels;Vn.prototype[r]=function(){if(this.model===r)return new Vn(this);if(arguments.length)return new Vn(arguments,r);var e=typeof arguments[t]=="number"?t:this.valpha;return new Vn(kH(ki[this.model][r].raw(this.color)).concat(e),r)},Vn[r]=function(e){return typeof e=="number"&&(e=Em(pb.call(arguments),t)),new Vn(e,r)}}});function OH(r,t){return Number(r.toFixed(t))}function LH(r){return function(t){return OH(t,r)}}function fn(r,t,e){return r=Array.isArray(r)?r:[r],r.forEach(function(n){(Rv[n]||(Rv[n]=[]))[t]=e}),r=r[0],function(n){var i;return arguments.length?(e&&(n=e(n)),i=this[r](),i.color[t]=n,i):(i=this[r]().color[t],e&&(i=e(i)),i)}}function Cn(r){return function(t){return Math.max(0,Math.min(r,t))}}function kH(r){return Array.isArray(r)?r:[r]}function Em(r,t){for(var e=0;e<t;e++)typeof r[e]!="number"&&(r[e]=0);return r}var DH=Vn;const ec=ro(DH);function Bv(r){"@babel/helpers - typeof";return Bv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bv(r)}var NH=/^\s+/,PH=/\s+$/;function Dt(r,t){if(r=r||"",t=t||{},r instanceof Dt)return r;if(!(this instanceof Dt))return new Dt(r,t);var e=RH(r);this._originalInput=r,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||e.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=e.ok}Dt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),e,n,i,a,o,s;return e=t.r/255,n=t.g/255,i=t.b/255,e<=.03928?a=e/12.92:a=Math.pow((e+.055)/1.055,2.4),n<=.03928?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*o+.0722*s},setAlpha:function(t){return this._a=Ak(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=H_(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=H_(this._r,this._g,this._b),e=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+n+"%, "+i+"%)":"hsva("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=V_(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=V_(this._r,this._g,this._b),e=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+n+"%, "+i+"%)":"hsla("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return K_(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return GH(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Jr(this._r,255)*100)+"%",g:Math.round(Jr(this._g,255)*100)+"%",b:Math.round(Jr(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Jr(this._r,255)*100)+"%, "+Math.round(Jr(this._g,255)*100)+"%, "+Math.round(Jr(this._b,255)*100)+"%)":"rgba("+Math.round(Jr(this._r,255)*100)+"%, "+Math.round(Jr(this._g,255)*100)+"%, "+Math.round(Jr(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:QH[K_(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+q_(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=Dt(t);n="#"+q_(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!e&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return Dt(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(WH,arguments)},brighten:function(){return this._applyModification(XH,arguments)},darken:function(){return this._applyModification(YH,arguments)},desaturate:function(){return this._applyModification($H,arguments)},saturate:function(){return this._applyModification(UH,arguments)},greyscale:function(){return this._applyModification(jH,arguments)},spin:function(){return this._applyModification(VH,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(qH,arguments)},complement:function(){return this._applyCombination(HH,arguments)},monochromatic:function(){return this._applyCombination(ZH,arguments)},splitcomplement:function(){return this._applyCombination(KH,arguments)},triad:function(){return this._applyCombination(Z_,[3])},tetrad:function(){return this._applyCombination(Z_,[4])}};Dt.fromRatio=function(r,t){if(Bv(r)=="object"){var e={};for(var n in r)r.hasOwnProperty(n)&&(n==="a"?e[n]=r[n]:e[n]=Wf(r[n]));r=e}return Dt(r,t)};function RH(r){var t={r:0,g:0,b:0},e=1,n=null,i=null,a=null,o=!1,s=!1;return typeof r=="string"&&(r=rK(r)),Bv(r)=="object"&&(bo(r.r)&&bo(r.g)&&bo(r.b)?(t=BH(r.r,r.g,r.b),o=!0,s=String(r.r).substr(-1)==="%"?"prgb":"rgb"):bo(r.h)&&bo(r.s)&&bo(r.v)?(n=Wf(r.s),i=Wf(r.v),t=zH(r.h,n,i),o=!0,s="hsv"):bo(r.h)&&bo(r.s)&&bo(r.l)&&(n=Wf(r.s),a=Wf(r.l),t=FH(r.h,n,a),o=!0,s="hsl"),r.hasOwnProperty("a")&&(e=r.a)),e=Ak(e),{ok:o,format:r.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}function BH(r,t,e){return{r:Jr(r,255)*255,g:Jr(t,255)*255,b:Jr(e,255)*255}}function V_(r,t,e){r=Jr(r,255),t=Jr(t,255),e=Jr(e,255);var n=Math.max(r,t,e),i=Math.min(r,t,e),a,o,s=(n+i)/2;if(n==i)a=o=0;else{var u=n-i;switch(o=s>.5?u/(2-n-i):u/(n+i),n){case r:a=(t-e)/u+(t<e?6:0);break;case t:a=(e-r)/u+2;break;case e:a=(r-t)/u+4;break}a/=6}return{h:a,s:o,l:s}}function FH(r,t,e){var n,i,a;r=Jr(r,360),t=Jr(t,100),e=Jr(e,100);function o(l,f,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?l+(f-l)*6*c:c<1/2?f:c<2/3?l+(f-l)*(2/3-c)*6:l}if(t===0)n=i=a=e;else{var s=e<.5?e*(1+t):e+t-e*t,u=2*e-s;n=o(u,s,r+1/3),i=o(u,s,r),a=o(u,s,r-1/3)}return{r:n*255,g:i*255,b:a*255}}function H_(r,t,e){r=Jr(r,255),t=Jr(t,255),e=Jr(e,255);var n=Math.max(r,t,e),i=Math.min(r,t,e),a,o,s=n,u=n-i;if(o=n===0?0:u/n,n==i)a=0;else{switch(n){case r:a=(t-e)/u+(t<e?6:0);break;case t:a=(e-r)/u+2;break;case e:a=(r-t)/u+4;break}a/=6}return{h:a,s:o,v:s}}function zH(r,t,e){r=Jr(r,360)*6,t=Jr(t,100),e=Jr(e,100);var n=Math.floor(r),i=r-n,a=e*(1-t),o=e*(1-i*t),s=e*(1-(1-i)*t),u=n%6,l=[e,o,a,a,s,e][u],f=[s,e,e,o,a,a][u],c=[a,a,s,e,e,o][u];return{r:l*255,g:f*255,b:c*255}}function K_(r,t,e,n){var i=[pa(Math.round(r).toString(16)),pa(Math.round(t).toString(16)),pa(Math.round(e).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function GH(r,t,e,n,i){var a=[pa(Math.round(r).toString(16)),pa(Math.round(t).toString(16)),pa(Math.round(e).toString(16)),pa(Tk(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function q_(r,t,e,n){var i=[pa(Tk(n)),pa(Math.round(r).toString(16)),pa(Math.round(t).toString(16)),pa(Math.round(e).toString(16))];return i.join("")}Dt.equals=function(r,t){return!r||!t?!1:Dt(r).toRgbString()==Dt(t).toRgbString()};Dt.random=function(){return Dt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function $H(r,t){t=t===0?0:t||10;var e=Dt(r).toHsl();return e.s-=t/100,e.s=Np(e.s),Dt(e)}function UH(r,t){t=t===0?0:t||10;var e=Dt(r).toHsl();return e.s+=t/100,e.s=Np(e.s),Dt(e)}function jH(r){return Dt(r).desaturate(100)}function WH(r,t){t=t===0?0:t||10;var e=Dt(r).toHsl();return e.l+=t/100,e.l=Np(e.l),Dt(e)}function XH(r,t){t=t===0?0:t||10;var e=Dt(r).toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(t/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(t/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(t/100)))),Dt(e)}function YH(r,t){t=t===0?0:t||10;var e=Dt(r).toHsl();return e.l-=t/100,e.l=Np(e.l),Dt(e)}function VH(r,t){var e=Dt(r).toHsl(),n=(e.h+t)%360;return e.h=n<0?360+n:n,Dt(e)}function HH(r){var t=Dt(r).toHsl();return t.h=(t.h+180)%360,Dt(t)}function Z_(r,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var e=Dt(r).toHsl(),n=[Dt(r)],i=360/t,a=1;a<t;a++)n.push(Dt({h:(e.h+a*i)%360,s:e.s,l:e.l}));return n}function KH(r){var t=Dt(r).toHsl(),e=t.h;return[Dt(r),Dt({h:(e+72)%360,s:t.s,l:t.l}),Dt({h:(e+216)%360,s:t.s,l:t.l})]}function qH(r,t,e){t=t||6,e=e||30;var n=Dt(r).toHsl(),i=360/e,a=[Dt(r)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(Dt(n));return a}function ZH(r,t){t=t||6;for(var e=Dt(r).toHsv(),n=e.h,i=e.s,a=e.v,o=[],s=1/t;t--;)o.push(Dt({h:n,s:i,v:a})),a=(a+s)%1;return o}Dt.mix=function(r,t,e){e=e===0?0:e||50;var n=Dt(r).toRgb(),i=Dt(t).toRgb(),a=e/100,o={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return Dt(o)};Dt.readability=function(r,t){var e=Dt(r),n=Dt(t);return(Math.max(e.getLuminance(),n.getLuminance())+.05)/(Math.min(e.getLuminance(),n.getLuminance())+.05)};Dt.isReadable=function(r,t,e){var n=Dt.readability(r,t),i,a;switch(a=!1,i=nK(e),i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a};Dt.mostReadable=function(r,t,e){var n=null,i=0,a,o,s,u;e=e||{},o=e.includeFallbackColors,s=e.level,u=e.size;for(var l=0;l<t.length;l++)a=Dt.readability(r,t[l]),a>i&&(i=a,n=Dt(t[l]));return Dt.isReadable(r,n,{level:s,size:u})||!o?n:(e.includeFallbackColors=!1,Dt.mostReadable(r,["#fff","#000"],e))};var _m=Dt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",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:"f0f",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:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},QH=Dt.hexNames=JH(_m);function JH(r){var t={};for(var e in r)r.hasOwnProperty(e)&&(t[r[e]]=e);return t}function Ak(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}function Jr(r,t){eK(r)&&(r="100%");var e=tK(r);return r=Math.min(t,Math.max(0,parseFloat(r))),e&&(r=parseInt(r*t,10)/100),Math.abs(r-t)<1e-6?1:r%t/parseFloat(t)}function Np(r){return Math.min(1,Math.max(0,r))}function Ti(r){return parseInt(r,16)}function eK(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}function tK(r){return typeof r=="string"&&r.indexOf("%")!=-1}function pa(r){return r.length==1?"0"+r:""+r}function Wf(r){return r<=1&&(r=r*100+"%"),r}function Tk(r){return Math.round(parseFloat(r)*255).toString(16)}function Q_(r){return Ti(r)/255}var ua=function(){var r="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",e="(?:"+t+")|(?:"+r+")",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",i="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function bo(r){return!!ua.CSS_UNIT.exec(r)}function rK(r){r=r.replace(NH,"").replace(PH,"").toLowerCase();var t=!1;if(_m[r])r=_m[r],t=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e;return(e=ua.rgb.exec(r))?{r:e[1],g:e[2],b:e[3]}:(e=ua.rgba.exec(r))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=ua.hsl.exec(r))?{h:e[1],s:e[2],l:e[3]}:(e=ua.hsla.exec(r))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=ua.hsv.exec(r))?{h:e[1],s:e[2],v:e[3]}:(e=ua.hsva.exec(r))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=ua.hex8.exec(r))?{r:Ti(e[1]),g:Ti(e[2]),b:Ti(e[3]),a:Q_(e[4]),format:t?"name":"hex8"}:(e=ua.hex6.exec(r))?{r:Ti(e[1]),g:Ti(e[2]),b:Ti(e[3]),format:t?"name":"hex"}:(e=ua.hex4.exec(r))?{r:Ti(e[1]+""+e[1]),g:Ti(e[2]+""+e[2]),b:Ti(e[3]+""+e[3]),a:Q_(e[4]+""+e[4]),format:t?"name":"hex8"}:(e=ua.hex3.exec(r))?{r:Ti(e[1]+""+e[1]),g:Ti(e[2]+""+e[2]),b:Ti(e[3]+""+e[3]),format:t?"name":"hex"}:!1}function nK(r){var t,e;return r=r||{level:"AA",size:"small"},t=(r.level||"AA").toUpperCase(),e=(r.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),e!=="small"&&e!=="large"&&(e="small"),{level:t,size:e}}var yh=2,J_=.16,iK=.05,aK=.05,oK=.15,Ik=5,Ok=4,sK=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function eS(r,t,e){var n;return Math.round(r.h)>=60&&Math.round(r.h)<=240?n=e?Math.round(r.h)-yh*t:Math.round(r.h)+yh*t:n=e?Math.round(r.h)+yh*t:Math.round(r.h)-yh*t,n<0?n+=360:n>=360&&(n-=360),n}function tS(r,t,e){if(r.h===0&&r.s===0)return r.s;var n;return e?n=r.s-J_*t:t===Ok?n=r.s+J_:n=r.s+iK*t,n>1&&(n=1),e&&t===Ik&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function rS(r,t,e){var n;return e?n=r.v+aK*t:n=r.v-oK*t,n>1&&(n=1),Number(n.toFixed(2))}function Fv(r){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[],n=Dt(r),i=Ik;i>0;i-=1){var a=n.toHsv(),o=Dt({h:eS(a,i,!0),s:tS(a,i,!0),v:rS(a,i,!0)}).toHexString();e.push(o)}e.push(n.toHexString());for(var s=1;s<=Ok;s+=1){var u=n.toHsv(),l=Dt({h:eS(u,s),s:tS(u,s),v:rS(u,s)}).toHexString();e.push(l)}return t.theme==="dark"?sK.map(function(f){var c=f.index,d=f.opacity,h=Dt.mix(t.backgroundColor||"#141414",e[c],d*100).toHexString();return h}):e}var P0={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},R0={},B0={};Object.keys(P0).forEach(function(r){R0[r]=Fv(P0[r]),R0[r].primary=R0[r][5],B0[r]=Fv(P0[r],{theme:"dark",backgroundColor:"#141414"}),B0[r].primary=B0[r][5]});var In=function(t,e,n){var i=ec(t),a=ec(e);return ec([(1-n)*i.red()+n*a.red(),(1-n)*i.green()+n*a.green(),(1-n)*i.blue()+n*a.blue()]).rgb()},uK=function(t,e,n){e===void 0&&(e="#fff"),n===void 0&&(n="rgb(150, 150, 150)");var i=In(e,t,.05).rgb().toString(),a=In(e,t,.1).rgb().toString(),o=In(e,t,.2).rgb().toString(),s=In(e,t,.4).rgb().toString(),u=In(e,n,.02).rgb().toString(),l=In(e,n,.05).rgb().toString(),f=In(e,n,.1).rgb().toString(),c=In(e,n,.2).rgb().toString(),d=In(e,n,.3).rgb().toString(),h=Fv(t,{theme:"default",backgroundColor:e}),v=ec(t).hex().toLowerCase(),p=h.indexOf(v),g=t;return p!==-1&&(g=h[p+1]),{mainStroke:t,mainFill:a,activeStroke:t,activeFill:i,inactiveStroke:s,inactiveFill:i,selectedStroke:t,selectedFill:e,highlightStroke:g,highlightFill:o,disableStroke:d,disableFill:l,edgeMainStroke:d,edgeActiveStroke:t,edgeInactiveStroke:c,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:f,comboMainStroke:d,comboMainFill:u,comboActiveStroke:t,comboActiveFill:i,comboInactiveStroke:d,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:g,comboHighlightFill:u,comboDisableStroke:c,comboDisableFill:l}},lK=function(t,e,n){e===void 0&&(e="#fff"),n===void 0&&(n="#777");var i=In(e,t,.2).rgb().toString(),a=In(e,t,.3).rgb().toString(),o=In(e,t,.6).rgb().toString(),s=In(e,t,.8).rgb().toString(),u=In(e,n,.2).rgb().toString(),l=In(e,n,.25).rgb().toString(),f=In(e,n,.3).rgb().toString(),c=In(e,n,.4).rgb().toString(),d=In(e,n,.5).rgb().toString(),h=Fv(t,{theme:"dark",backgroundColor:e}),v=ec(t).hex().toLowerCase(),p=h.indexOf(v),g=t;return p!==-1&&(g=h[p+1]),{mainStroke:s,mainFill:i,activeStroke:t,activeFill:a,inactiveStroke:s,inactiveFill:i,selectedStroke:t,selectedFill:i,highlightStroke:t,highlightFill:o,disableStroke:d,disableFill:l,edgeMainStroke:n,edgeActiveStroke:t,edgeInactiveStroke:n,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:f,comboMainStroke:c,comboMainFill:l,comboActiveStroke:t,comboActiveFill:u,comboInactiveStroke:c,comboInactiveFill:l,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:g,comboHighlightFill:l,comboDisableStroke:c,comboDisableFill:u}},gb=function(t,e,n,i){return e===void 0&&(e="#fff"),n===void 0&&(n="default"),n==="default"?uK(t,e,"rgb(150, 150, 150)"):lK(t,e,"#777")},fK=function(t,e,n,i){e===void 0&&(e="#fff"),n===void 0&&(n="default");var a=[];return t.forEach(function(o){a.push(gb(o,e,n))}),a};const cK=Object.freeze(Object.defineProperty({__proto__:null,getColorSetsBySubjectColors:fK,getColorsWithSubjectColor:gb,mixColor:In},Symbol.toStringTag,{value:"Module"}));var dK="rgb(95, 149, 255)",hK="rgb(255, 255, 255)",nS="rgb(0, 0, 0)",pr=gb(dK,hK);const su={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:pr.mainStroke,fill:pr.mainFill},size:20,color:pr.mainStroke,linkPoints:{size:8,lineWidth:1,fill:pr.activeFill,stroke:pr.activeStroke}},nodeStateStyles:{active:{fill:pr.activeFill,stroke:pr.activeStroke,lineWidth:2,shadowColor:pr.mainStroke,shadowBlur:10},selected:{fill:pr.selectedFill,stroke:pr.selectedStroke,lineWidth:4,shadowColor:pr.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:pr.highlightFill,stroke:pr.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:pr.inactiveFill,stroke:pr.inactiveStroke,lineWidth:1},disable:{fill:pr.disableFill,stroke:pr.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:nS,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:pr.edgeMainStroke,lineAppendWidth:2},color:pr.edgeMainStroke},edgeStateStyles:{active:{stroke:pr.edgeActiveStroke,lineWidth:1},selected:{stroke:pr.edgeSelectedStroke,lineWidth:2,shadowColor:pr.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:pr.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:pr.edgeInactiveStroke,lineWidth:1},disable:{stroke:pr.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:nS,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:pr.comboMainFill,lineWidth:1,stroke:pr.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:pr.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:pr.comboActiveStroke,lineWidth:1,fill:pr.comboActiveFill},selected:{stroke:pr.comboSelectedStroke,lineWidth:2,fill:pr.comboSelectedFill,shadowColor:pr.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:pr.comboHighlightStroke,lineWidth:2,fill:pr.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:pr.comboInactiveStroke,fill:pr.comboInactiveFill,lineWidth:1},disable:{stroke:pr.comboDisableStroke,fill:pr.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"};var vK=function(t){var e=t.clone();return pK(t,e),e},pK=function r(t,e){var n;t.isGroup()&&e.isGroup()&&((n=t.get("children"))===null||n===void 0||n.forEach(function(s,u){var l=e.get("children")[u];r(s,l)}));var i=t.get("type"),a=e.get("type");if(!(i!=="image"||a!=="image")){var o=t.get("clipShape");o&&e.setClip({type:o.get("type"),attrs:o.attr()})}},gK=Kn.cloneEvent,yK=Kn.isViewportChanged,mK=function(r){zt(t,r);function t(e){var n=r.call(this,e)||this;return n.extendEvents=[],n.dragging=!1,n.mousedown=!1,n.preItem=null,n.destroy(),n.graph=e,n.destroyed=!1,n.initEvents(),n}return t.prototype.initEvents=function(){var e=this,n=e.graph,i=e.extendEvents,a=i===void 0?[]:i,o=n.get("canvas"),s=o.get("el"),u=tu(this,"onCanvasEvents"),l=tu(this,"onExtendEvents"),f=tu(this,"onWheelEvent");o.off("*").on("*",u),this.canvasHandler=u,a.push(ph(s,"wheel",f)),typeof window<"u"&&(a.push(ph(window,"keydown",l)),a.push(ph(window,"keyup",l)),a.push(ph(window,"focus",l))),this.resetHandler&&n.off("afterchangedata",this.resetHandler),this.resetHandler=tu(this,"resetStatus"),n.on("afterchangedata",this.resetHandler)},t.getItemRoot=function(e){for(;e&&!e.get("item");)e=e.get("parent");return e},t.prototype.onCanvasEvents=function(e){var n=this,i=this.graph,a=i.get("canvas"),o=e.target,s=e.type;switch(s){case"drag":this.onCanvasEvents(Object.assign({},e,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},e,{type:"mouseup"}));break;case"mousedown":this.mousedown=!0;break;case"mouseup":setTimeout(function(){return n.mousedown=!1});break;case"click":if(!this.mousedown)return;break}e.canvasX=e.x,e.canvasY=e.y;var u={x:e.canvasX,y:e.canvasY},l=i.get("group"),f=l.getMatrix();if(f||(f=[1,0,0,0,1,0,0,0,1]),yK(f)&&(u=i.getPointByClient(e.clientX,e.clientY)),e.x=u.x,e.y=u.y,e.currentTarget=i,o===a){(s==="mousemove"||s==="mouseleave")&&this.handleMouseMove(e,"canvas"),e.target=a,e.item=null,i.emit(s,e),i.emit("canvas:".concat(s),e);return}var c=t.getItemRoot(o);if(!c){i.emit(s,e);return}var d=c.get("item");if(!d.destroyed){var h=d.getType();if(e.target=o,e.item=d,e.canvasX===e.x&&e.canvasY===e.y){var v=i.getCanvasByPoint(e.x,e.y);e.canvasX=v.x,e.canvasY=v.y}e.name&&!e.name.includes(":")?(i.emit("".concat(h,":").concat(s),e),i.emit(s,e)):e.name&&i.emit(e.name,e),s==="dragstart"&&(this.dragging=!0),s==="dragend"&&(this.dragging=!1),s==="mousemove"&&this.handleMouseMove(e,h)}},t.prototype.onExtendEvents=function(e){this.graph.emit(e.type,e)},t.prototype.onWheelEvent=function(e){gt(e.wheelDelta)&&(e.wheelDelta=-e.detail),this.graph.emit("wheel",e)},t.prototype.handleMouseMove=function(e,n){var i=this,a=i.graph,o=i.preItem,s=a.get("canvas"),u=e.target===s?null:e.item;e=gK(e),o&&o!==u&&!o.destroyed&&(e.item=o,this.emitCustomEvent(o.getType(),"mouseleave",e),this.dragging&&this.emitCustomEvent(o.getType(),"dragleave",e)),u&&o!==u&&(e.item=u,this.emitCustomEvent(n,"mouseenter",e),this.dragging&&this.emitCustomEvent(n,"dragenter",e)),this.preItem=u},t.prototype.emitCustomEvent=function(e,n,i){i.type=n,this.graph.emit("".concat(e,":").concat(n),i)},t.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},t.prototype.destroy=function(){var e=this,n=e.graph,i=e.canvasHandler,a=e.extendEvents,o=n.get("canvas");o.off("*",i),xe(a,function(s){s.remove()}),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},t}(ML),or={},No={},hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.Base=void 0;var bK=function(){function r(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return r.prototype.layout=function(t){return this.init(t),this.execute(!0)},r.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[],this.comboEdges=t.comboEdges||[],this.hiddenNodes=t.hiddenNodes||[],this.hiddenEdges=t.hiddenEdges||[],this.hiddenCombos=t.hiddenCombos||[],this.vedges=t.vedges||[]},r.prototype.execute=function(t){},r.prototype.executeWithWorker=function(){},r.prototype.getDefaultCfg=function(){return{}},r.prototype.updateCfg=function(t){t&&Object.assign(this,t)},r.prototype.getType=function(){return"base"},r.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},r}();hn.Base=bK;var F0={},Pl={};Object.defineProperty(Pl,"__esModule",{value:!0});Pl.camelize=Pl.isString=void 0;var xK=function(r){return typeof r=="string"};Pl.isString=xK;var wK=function(r){var t=Object.create(null);return function(e){var n=t[e];return n||(t[e]=r(e))}},EK=/-(\w)/g;Pl.camelize=wK(function(r){return r.replace(EK,function(t,e){return e?e.toUpperCase():""})});var Yc={};Object.defineProperty(Yc,"__esModule",{value:!0});Yc.isArray=void 0;Yc.isArray=Array.isArray;var Pp={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.toNumber=r.isNaN=r.isNumber=void 0;var t=function(i){return typeof i=="number"};r.isNumber=t;var e=function(i){return Number.isNaN(Number(i))};r.isNaN=e;var n=function(i){var a=parseFloat(i);return(0,r.isNaN)(a)?i:a};r.toNumber=n})(Pp);var Rp={},yb={};(function(r){var t=_e&&_e.__assign||function(){return t=Object.assign||function(i){for(var a,o=1,s=arguments.length;o<s;o++){a=arguments[o];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(i[u]=a[u])}return i},t.apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0}),r.clone=r.isObject=void 0;var e=function(i){return i!==null&&typeof i=="object"};r.isObject=e;var n=function(i){if(i===null)return i;if(i instanceof Date)return new Date(i.getTime());if(i instanceof Array){var a=[];return i.forEach(function(s){a.push(s)}),a.map(function(s){return(0,r.clone)(s)})}if(typeof i=="object"&&Object.keys(i).length){var o=t({},i);return Object.keys(o).forEach(function(s){o[s]=(0,r.clone)(o[s])}),o}return i};r.clone=n})(yb);(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.getCoreNodeAndRelativeLeafNodes=r.getAvgNodePosition=r.getLayoutBBox=r.traverseTreeUp=r.scaleMatrix=r.getAdjMatrix=r.floydWarshall=r.getDegreeMap=r.getDegree=r.getEdgeTerminal=void 0;var t=Yc,e=Pp,n=yb,i=function(m,b){var x=m[b];return(0,n.isObject)(x)?x.cell:x};r.getEdgeTerminal=i;var a=function(m,b,x){for(var w=[],E=0;E<m;E++)w[E]={in:0,out:0,all:0};return x&&x.forEach(function(_){var M=(0,r.getEdgeTerminal)(_,"source"),C=(0,r.getEdgeTerminal)(_,"target");M&&w[b[M]]&&(w[b[M]].out+=1,w[b[M]].all+=1),C&&w[b[C]]&&(w[b[C]].in+=1,w[b[C]].all+=1)}),w};r.getDegree=a;var o=function(m,b){var x={};return m.forEach(function(w){x[w.id]={in:0,out:0,all:0}}),b&&b.forEach(function(w){var E=(0,r.getEdgeTerminal)(w,"source"),_=(0,r.getEdgeTerminal)(w,"target");E&&(x[E].out+=1,x[E].all+=1),_&&(x[_].in+=1,x[_].all+=1)}),x};r.getDegreeMap=o;var s=function(m){for(var b=[],x=m.length,w=0;w<x;w+=1){b[w]=[];for(var E=0;E<x;E+=1)w===E?b[w][E]=0:m[w][E]===0||!m[w][E]?b[w][E]=1/0:b[w][E]=m[w][E]}for(var _=0;_<x;_+=1)for(var w=0;w<x;w+=1)for(var E=0;E<x;E+=1)b[w][E]>b[w][_]+b[_][E]&&(b[w][E]=b[w][_]+b[_][E]);return b};r.floydWarshall=s;var u=function(m,b){var x=m.nodes,w=m.edges,E=[],_={};if(!x)throw new Error("invalid nodes data!");return x&&x.forEach(function(M,C){_[M.id]=C;var S=[];E.push(S)}),w==null||w.forEach(function(M){var C=(0,r.getEdgeTerminal)(M,"source"),S=(0,r.getEdgeTerminal)(M,"target"),A=_[C],T=_[S];A===void 0||T===void 0||(E[A][T]=1,b||(E[T][A]=1))}),E};r.getAdjMatrix=u;var l=function(m,b){var x=[];return m.forEach(function(w){var E=[];w.forEach(function(_){E.push(_*b)}),x.push(E)}),x};r.scaleMatrix=l;var f=function(m,b){if(m&&m.children){for(var x=m.children.length-1;x>=0;x--)if(!f(m.children[x],b))return}return!!b(m)},c=function(m,b){typeof b=="function"&&f(m,b)};r.traverseTreeUp=c;var d=function(m){var b=1/0,x=1/0,w=-1/0,E=-1/0;return m.forEach(function(_){var M=_.size;(0,t.isArray)(M)?M.length===1&&(M=[M[0],M[0]]):(0,e.isNumber)(M)?M=[M,M]:(M===void 0||isNaN(M))&&(M=[30,30]);var C=[M[0]/2,M[1]/2],S=_.x-C[0],A=_.x+C[0],T=_.y-C[1],I=_.y+C[1];b>S&&(b=S),x>T&&(x=T),w<A&&(w=A),E<I&&(E=I)}),{minX:b,minY:x,maxX:w,maxY:E}};r.getLayoutBBox=d;var h=function(m){var b={x:0,y:0};m.forEach(function(w){b.x+=w.x||0,b.y+=w.y||0});var x=m.length||1;return{x:b.x/x,y:b.y/x}};r.getAvgNodePosition=h;var v=function(m,b,x){var w,E;return m==="source"?((w=x==null?void 0:x.find(function(_){return _.target===b.id}))===null||w===void 0?void 0:w.source)||{}:((E=x==null?void 0:x.find(function(_){return _.source===b.id}))===null||E===void 0?void 0:E.target)||{}},p=function(m,b,x){var w=[];switch(m){case"source":w=x==null?void 0:x.filter(function(_){return _.source===b.id}).map(function(_){return _.target});break;case"target":w=x==null?void 0:x.filter(function(_){return _.target===b.id}).map(function(_){return _.source});break;case"both":w=x==null?void 0:x.filter(function(_){return _.source===b.id}).map(function(_){return _.target}).concat(x==null?void 0:x.filter(function(_){return _.target===b.id}).map(function(_){return _.source}));break}var E=new Set(w);return Array.from(E)},g=function(m,b,x,w,E){var _=x[b]||"",M=(w==null?void 0:w.filter(function(C){return C[b]===_}))||[];return m==="leaf"&&(M=M.filter(function(C){var S,A;return((S=E[C.id])===null||S===void 0?void 0:S.in)===0||((A=E[C.id])===null||A===void 0?void 0:A.out)===0})),M},y=function(m,b,x,w,E,_){var M=E[b.id],C=M.in,S=M.out,A=b,T=[];C===0?(A=v("source",b,x),T=p("both",A,x).map(function(k){return _[k]})):S===0&&(A=v("target",b,x),T=p("both",A,x).map(function(k){return _[k]})),T=T.filter(function(k){return E[k.id]&&(E[k.id].in===0||E[k.id].out===0)});var I=g(m,w,b,T,E);return{coreNode:A,relativeLeafNodes:T,sameTypeLeafNodes:I}};r.getCoreNodeAndRelativeLeafNodes=y})(Rp);var z0={},iS;function _K(){return iS||(iS=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.getFuncByUnknownType=r.getFunc=r.isFunction=void 0;var t=an(),e=Pp,n=function(o){return typeof o=="function"};r.isFunction=n;var i=function(o,s,u){var l;return u?l=u:(0,e.isNumber)(o)?l=function(){return o}:l=function(){return s},l};r.getFunc=i;var a=function(o,s,u){return u===void 0&&(u=!0),!s&&s!==0?function(l){return l.size?(0,t.isArray)(l.size)?l.size[0]>l.size[1]?l.size[0]:l.size[1]:(0,t.isObject)(l.size)?l.size.width>l.size.height?l.size.width:l.size.height:l.size:o}:(0,r.isFunction)(s)?s:(0,e.isNumber)(s)?function(){return s}:(0,t.isArray)(s)?function(){if(u){var l=Math.max.apply(Math,s);return isNaN(l)?o:l}return s}:(0,t.isObject)(s)?function(){if(u){var l=Math.max(s.width,s.height);return isNaN(l)?o:l}return[s.width,s.height]}:function(){return o}};r.getFuncByUnknownType=a}(z0)),z0}var aS;function an(){return aS||(aS=1,function(r){var t=_e&&_e.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,o,s)}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),e=_e&&_e.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(r,"__esModule",{value:!0}),e(Pl,r),e(Yc,r),e(Pp,r),e(Rp,r),e(yb,r),e(_K(),r)}(F0)),F0}var SK=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(No,"__esModule",{value:!0});No.getLayoutByName=No.unRegisterLayout=No.registerLayout=void 0;var MK=hn,CK=an(),ds=new Map,AK=function(r,t){if(ds.get(r)&&console.warn("The layout with the name ".concat(r," exists already, it will be overridden")),(0,CK.isObject)(t)){var e=function(n){SK(i,n);function i(a){var o=this,s;o=n.call(this)||this;var u=o,l={},f=Object.assign({},u.getDefaultCfg(),((s=t.getDefaultCfg)===null||s===void 0?void 0:s.call(t))||{});return Object.assign(l,f,t,a),Object.keys(l).forEach(function(c){var d=l[c];u[c]=d}),o}return i}(MK.Base);ds.set(r,e)}else ds.set(r,t);return ds.get(r)};No.registerLayout=AK;var TK=function(r){ds.has(r)&&ds.delete(r)};No.unRegisterLayout=TK;var IK=function(r){return ds.has(r)?ds.get(r):null};No.getLayoutByName=IK;var G0={},Vc={},OK=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(Vc,"__esModule",{value:!0});Vc.GridLayout=void 0;var Zu=an(),LK=hn,kK=function(r){OK(t,r);function t(e){var n=r.call(this)||this;return n.begin=[0,0],n.preventOverlap=!0,n.preventOverlapPadding=10,n.condense=!1,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.row=0,n.col=0,n.cellWidth=0,n.cellHeight=0,n.cellUsed={},n.id2manPos={},n.onLayoutEnd=function(){},n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},t.prototype.execute=function(){var e=this,n=e.nodes,i=e.edges,a=e.begin,o=n.length;if(o===0)return e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:i};if(o===1)return n[0].x=a[0],n[0].y=a[1],e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:i};var s=e.sortBy,u=e.width,l=e.height,f=e.condense,c=e.preventOverlapPadding,d=e.preventOverlap,h=e.nodeSpacing,v=e.nodeSize,p=[];n.forEach(function(T){p.push(T)});var g={};if(p.forEach(function(T,I){g[T.id]=I}),(s==="degree"||!(0,Zu.isString)(s)||p[0][s]===void 0)&&(s="degree",(0,Zu.isNaN)(n[0].degree))){var y=(0,Zu.getDegree)(p.length,g,i);p.forEach(function(T,I){T.degree=y[I].all})}p.sort(function(T,I){return I[s]-T[s]}),!u&&typeof window<"u"&&(u=window.innerWidth),!l&&typeof window<"u"&&(l=window.innerHeight);var m=e.rows,b=e.cols!=null?e.cols:e.columns;if(e.cells=o,m!=null&&b!=null?(e.rows=m,e.cols=b):m!=null&&b==null?(e.rows=m,e.cols=Math.ceil(e.cells/e.rows)):m==null&&b!=null?(e.cols=b,e.rows=Math.ceil(e.cells/e.cols)):(e.splits=Math.sqrt(e.cells*e.height/e.width),e.rows=Math.round(e.splits),e.cols=Math.round(e.width/e.height*e.splits)),e.rows=Math.max(e.rows,1),e.cols=Math.max(e.cols,1),e.cols*e.rows>e.cells){var x=e.small(),w=e.large();(x-1)*w>=e.cells?e.small(x-1):(w-1)*x>=e.cells&&e.large(w-1)}else for(;e.cols*e.rows<e.cells;){var x=e.small(),w=e.large();(w+1)*x>=e.cells?e.large(w+1):e.small(x+1)}if(e.cellWidth=u/e.cols,e.cellHeight=l/e.rows,f&&(e.cellWidth=0,e.cellHeight=0),d||h){var E=(0,Zu.getFuncByUnknownType)(10,h),_=(0,Zu.getFuncByUnknownType)(30,v,!1);p.forEach(function(T){(!T.x||!T.y)&&(T.x=0,T.y=0);var I=_(T)||30,k,P;(0,Zu.isArray)(I)?(k=I[0],P=I[1]):(k=I,P=I);var N=E!==void 0?E(T):c,z=k+N,W=P+N;e.cellWidth=Math.max(e.cellWidth,z),e.cellHeight=Math.max(e.cellHeight,W)})}e.cellUsed={},e.row=0,e.col=0,e.id2manPos={};for(var M=0;M<p.length;M++){var C=p[M],S=void 0;if(e.position&&(S=e.position(C)),S&&(S.row!==void 0||S.col!==void 0)){var A={row:S.row,col:S.col};if(A.col===void 0)for(A.col=0;e.used(A.row,A.col);)A.col++;else if(A.row===void 0)for(A.row=0;e.used(A.row,A.col);)A.row++;e.id2manPos[C.id]=A,e.use(A.row,A.col)}e.getPos(C)}return e.onLayoutEnd&&e.onLayoutEnd(),{edges:i,nodes:p}},t.prototype.small=function(e){var n=this,i,a=n.rows||5,o=n.cols||5;if(e==null)i=Math.min(a,o);else{var s=Math.min(a,o);s===n.rows?n.rows=e:n.cols=e}return i},t.prototype.large=function(e){var n=this,i,a=n.rows||5,o=n.cols||5;if(e==null)i=Math.max(a,o);else{var s=Math.max(a,o);s===n.rows?n.rows=e:n.cols=e}return i},t.prototype.used=function(e,n){var i=this;return i.cellUsed["c-".concat(e,"-").concat(n)]||!1},t.prototype.use=function(e,n){var i=this;i.cellUsed["c-".concat(e,"-").concat(n)]=!0},t.prototype.moveToNextCell=function(){var e=this,n=e.cols||5;e.col++,e.col>=n&&(e.col=0,e.row++)},t.prototype.getPos=function(e){var n=this,i=n.begin,a=n.cellWidth,o=n.cellHeight,s,u,l=n.id2manPos[e.id];if(l)s=l.col*a+a/2+i[0],u=l.row*o+o/2+i[1];else{for(;n.used(n.row,n.col);)n.moveToNextCell();s=n.col*a+a/2+i[0],u=n.row*o+o/2+i[1],n.use(n.row,n.col),n.moveToNextCell()}e.x=s,e.y=u},t.prototype.getType=function(){return"grid"},t}(LK.Base);Vc.GridLayout=kK;var Hc={},DK=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(Hc,"__esModule",{value:!0});Hc.RandomLayout=void 0;var NK=hn,PK=function(r){DK(t,r);function t(e){var n=r.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},t.prototype.execute=function(){var e=this,n=e.nodes,i=.9,a=e.center;return!e.width&&typeof window<"u"&&(e.width=window.innerWidth),!e.height&&typeof window<"u"&&(e.height=window.innerHeight),n&&n.forEach(function(o){o.x=(Math.random()-.5)*i*e.width+a[0],o.y=(Math.random()-.5)*i*e.height+a[1]}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:this.edges}},t.prototype.getType=function(){return"random"},t}(NK.Base);Hc.RandomLayout=PK;var Kc={},RK=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(Kc,"__esModule",{value:!0});Kc.GForceLayout=void 0;var BK=hn,ri=an(),$0=function(r,t){var e;return r?(0,ri.isNumber)(r)?e=function(n){return r}:e=r:e=function(n){return t||1},e},FK=function(r){RK(t,r);function t(e){var n=r.call(this)||this;return n.maxIteration=500,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.collideStrength=1,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.animate=!0,n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},t.prototype.execute=function(){var e,n,i=this,a=i.nodes;if(i.timeInterval!==void 0&&typeof window<"u"&&window.clearInterval(i.timeInterval),!a||a.length===0){(e=i.onLayoutEnd)===null||e===void 0||e.call(i);return}!i.width&&typeof window<"u"&&(i.width=window.innerWidth),!i.height&&typeof window<"u"&&(i.height=window.innerHeight),i.center||(i.center=[i.width/2,i.height/2]);var o=i.center;if(a.length===1){a[0].x=o[0],a[0].y=o[1],(n=i.onLayoutEnd)===null||n===void 0||n.call(i);return}var s={},u={};a.forEach(function(v,p){(0,ri.isNumber)(v.x)||(v.x=Math.random()*i.width),(0,ri.isNumber)(v.y)||(v.y=Math.random()*i.height),s[v.id]=v,u[v.id]=p}),i.nodeMap=s,i.nodeIdxMap=u,i.linkDistance=$0(i.linkDistance,1),i.nodeStrength=$0(i.nodeStrength,1),i.edgeStrength=$0(i.edgeStrength,1);var l=i.nodeSize,f;if(i.preventOverlap){var c=i.nodeSpacing,d;(0,ri.isNumber)(c)?d=function(){return c}:(0,ri.isFunction)(c)?d=c:d=function(){return 0},l?(0,ri.isArray)(l)?f=function(v){return Math.max(l[0],l[1])+d(v)}:f=function(v){return l+d(v)}:f=function(v){return v.size?(0,ri.isArray)(v.size)?Math.max(v.size[0],v.size[1])+d(v):(0,ri.isObject)(v.size)?Math.max(v.size.width,v.size.height)+d(v):v.size+d(v):10+d(v)}}i.nodeSize=f;var h=i.edges;i.degrees=(0,ri.getDegree)(a.length,i.nodeIdxMap,h),i.getMass||(i.getMass=function(v){var p=v.mass||i.degrees[i.nodeIdxMap[v.id]].all||1;return p}),i.run()},t.prototype.run=function(){var e,n=this,i=n.maxIteration,a=n.nodes,o=n.workerEnabled,s=n.minMovement,u=n.animate;if(a)if(o||!u){for(var l=0;l<i;l++){var f=n.runOneStep(l);if(n.reachMoveThreshold(a,f,s))break}(e=n.onLayoutEnd)===null||e===void 0||e.call(n)}else{if(typeof window>"u")return;var c=0;this.timeInterval=window.setInterval(function(){var d,h;if(a){var v=n.runOneStep(c)||[];n.reachMoveThreshold(a,v,s)&&((d=n.onLayoutEnd)===null||d===void 0||d.call(n),window.clearInterval(n.timeInterval)),c++,c>=i&&((h=n.onLayoutEnd)===null||h===void 0||h.call(n),window.clearInterval(n.timeInterval))}},0)}},t.prototype.reachMoveThreshold=function(e,n,i){var a=0;return e.forEach(function(o,s){var u=o.x-n[s].x,l=o.y-n[s].y;a+=Math.sqrt(u*u+l*l)}),a/=e.length,a<i},t.prototype.runOneStep=function(e){var n,i=this,a=i.nodes,o=i.edges,s=[],u=[];if(a){a.forEach(function(c,d){s[2*d]=0,s[2*d+1]=0,u[2*d]=0,u[2*d+1]=0}),i.calRepulsive(s,a),o&&i.calAttractive(s,o),i.calGravity(s,a);var l=Math.max(.02,i.interval-e*.002);i.updateVelocity(s,u,l,a);var f=[];return a.forEach(function(c){f.push({x:c.x,y:c.y})}),i.updatePosition(u,l,a),(n=i.tick)===null||n===void 0||n.call(i),f}},t.prototype.calRepulsive=function(e,n){var i=this,a=i.getMass,o=i.factor,s=i.coulombDisScale,u=i.preventOverlap,l=i.collideStrength,f=l===void 0?1:l,c=i.nodeStrength,d=i.nodeSize;n.forEach(function(h,v){var p=a?a(h):1;n.forEach(function(g,y){if(!(v>=y)){var m=h.x-g.x,b=h.y-g.y;m===0&&b===0&&(m=Math.random()*.01,b=Math.random()*.01);var x=m*m+b*b,w=Math.sqrt(x),E=(w+.1)*s,_=m/w,M=b/w,C=(c(h)+c(g))*.5*o/(E*E),S=a?a(g):1;if(e[2*v]+=_*C,e[2*v+1]+=M*C,e[2*y]-=_*C,e[2*y+1]-=M*C,u&&(d(h)+d(g))/2>w){var A=f*(c(h)+c(g))*.5/x;e[2*v]+=_*A/p,e[2*v+1]+=M*A/p,e[2*y]-=_*A/S,e[2*y+1]-=M*A/S}}})})},t.prototype.calAttractive=function(e,n){var i=this,a=i.nodeMap,o=i.nodeIdxMap,s=i.linkDistance,u=i.edgeStrength,l=i.nodeSize,f=i.getMass;n.forEach(function(c,d){var h=(0,ri.getEdgeTerminal)(c,"source"),v=(0,ri.getEdgeTerminal)(c,"target"),p=a[h],g=a[v],y=g.x-p.x,m=g.y-p.y;y===0&&m===0&&(y=Math.random()*.01,m=Math.random()*.01);var b=Math.sqrt(y*y+m*m),x=y/b,w=m/b,E=s(c,p,g)||1+(l(p)+l(g)||0)/2,_=E-b,M=_*u(c),C=o[h],S=o[v],A=f?f(p):1,T=f?f(g):1;e[2*C]-=x*M/A,e[2*C+1]-=w*M/A,e[2*S]+=x*M/T,e[2*S+1]+=w*M/T})},t.prototype.calGravity=function(e,n){for(var i=this,a=i.center,o=i.gravity,s=i.degrees,u=n.length,l=0;l<u;l++){var f=n[l],c=f.x-a[0],d=f.y-a[1],h=o;if(i.getCenter){var v=i.getCenter(f,s[l].all);v&&(0,ri.isNumber)(v[0])&&(0,ri.isNumber)(v[1])&&(0,ri.isNumber)(v[2])&&(c=f.x-v[0],d=f.y-v[1],h=v[2])}h&&(e[2*l]-=h*c,e[2*l+1]-=h*d)}},t.prototype.updateVelocity=function(e,n,i,a){var o=this,s=i*o.damping;a.forEach(function(u,l){var f=e[2*l]*s||.01,c=e[2*l+1]*s||.01,d=Math.sqrt(f*f+c*c);if(d>o.maxSpeed){var h=o.maxSpeed/d;f=h*f,c=h*c}n[2*l]=f,n[2*l+1]=c})},t.prototype.updatePosition=function(e,n,i){i.forEach(function(a,o){if((0,ri.isNumber)(a.fx)&&(0,ri.isNumber)(a.fy)){a.x=a.fx,a.y=a.fy;return}var s=e[2*o]*n,u=e[2*o+1]*n;a.x+=s,a.y+=u})},t.prototype.stop=function(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval)},t.prototype.destroy=function(){var e=this;e.stop(),e.tick=null,e.nodes=null,e.edges=null,e.destroyed=!0},t.prototype.getType=function(){return"gForce"},t}(BK.Base);Kc.GForceLayout=FK;var qc={},Bp={};function zK(r){const t=+this._x.call(null,r),e=+this._y.call(null,r);return Lk(this.cover(t,e),t,e,r)}function Lk(r,t,e,n){if(isNaN(t)||isNaN(e))return r;var i,a=r._root,o={data:n},s=r._x0,u=r._y0,l=r._x1,f=r._y1,c,d,h,v,p,g,y,m;if(!a)return r._root=o,r;for(;a.length;)if((p=t>=(c=(s+l)/2))?s=c:l=c,(g=e>=(d=(u+f)/2))?u=d:f=d,i=a,!(a=a[y=g<<1|p]))return i[y]=o,r;if(h=+r._x.call(null,a.data),v=+r._y.call(null,a.data),t===h&&e===v)return o.next=a,i?i[y]=o:r._root=o,r;do i=i?i[y]=new Array(4):r._root=new Array(4),(p=t>=(c=(s+l)/2))?s=c:l=c,(g=e>=(d=(u+f)/2))?u=d:f=d;while((y=g<<1|p)===(m=(v>=d)<<1|h>=c));return i[m]=a,i[y]=o,r}function GK(r){var t,e,n=r.length,i,a,o=new Array(n),s=new Array(n),u=1/0,l=1/0,f=-1/0,c=-1/0;for(e=0;e<n;++e)isNaN(i=+this._x.call(null,t=r[e]))||isNaN(a=+this._y.call(null,t))||(o[e]=i,s[e]=a,i<u&&(u=i),i>f&&(f=i),a<l&&(l=a),a>c&&(c=a));if(u>f||l>c)return this;for(this.cover(u,l).cover(f,c),e=0;e<n;++e)Lk(this,o[e],s[e],r[e]);return this}function $K(r,t){if(isNaN(r=+r)||isNaN(t=+t))return this;var e=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(e))i=(e=Math.floor(r))+1,a=(n=Math.floor(t))+1;else{for(var o=i-e||1,s=this._root,u,l;e>r||r>=i||n>t||t>=a;)switch(l=(t<n)<<1|r<e,u=new Array(4),u[l]=s,s=u,o*=2,l){case 0:i=e+o,a=n+o;break;case 1:e=i-o,a=n+o;break;case 2:i=e+o,n=a-o;break;case 3:e=i-o,n=a-o;break}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._y0=n,this._x1=i,this._y1=a,this}function UK(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}function jK(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function hi(r,t,e,n,i){this.node=r,this.x0=t,this.y0=e,this.x1=n,this.y1=i}function WK(r,t,e){var n,i=this._x0,a=this._y0,o,s,u,l,f=this._x1,c=this._y1,d=[],h=this._root,v,p;for(h&&d.push(new hi(h,i,a,f,c)),e==null?e=1/0:(i=r-e,a=t-e,f=r+e,c=t+e,e*=e);v=d.pop();)if(!(!(h=v.node)||(o=v.x0)>f||(s=v.y0)>c||(u=v.x1)<i||(l=v.y1)<a))if(h.length){var g=(o+u)/2,y=(s+l)/2;d.push(new hi(h[3],g,y,u,l),new hi(h[2],o,y,g,l),new hi(h[1],g,s,u,y),new hi(h[0],o,s,g,y)),(p=(t>=y)<<1|r>=g)&&(v=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=v)}else{var m=r-+this._x.call(null,h.data),b=t-+this._y.call(null,h.data),x=m*m+b*b;if(x<e){var w=Math.sqrt(e=x);i=r-w,a=t-w,f=r+w,c=t+w,n=h.data}}return n}function XK(r){if(isNaN(f=+this._x.call(null,r))||isNaN(c=+this._y.call(null,r)))return this;var t,e=this._root,n,i,a,o=this._x0,s=this._y0,u=this._x1,l=this._y1,f,c,d,h,v,p,g,y;if(!e)return this;if(e.length)for(;;){if((v=f>=(d=(o+u)/2))?o=d:u=d,(p=c>=(h=(s+l)/2))?s=h:l=h,t=e,!(e=e[g=p<<1|v]))return this;if(!e.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(n=t,y=g)}for(;e.data!==r;)if(i=e,!(e=e.next))return this;return(a=e.next)&&delete e.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(n?n[y]=e:this._root=e),this):(this._root=a,this)}function YK(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}function VK(){return this._root}function HK(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}function KK(r){var t=[],e,n=this._root,i,a,o,s,u;for(n&&t.push(new hi(n,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!r(n=e.node,a=e.x0,o=e.y0,s=e.x1,u=e.y1)&&n.length){var l=(a+s)/2,f=(o+u)/2;(i=n[3])&&t.push(new hi(i,l,f,s,u)),(i=n[2])&&t.push(new hi(i,a,f,l,u)),(i=n[1])&&t.push(new hi(i,l,o,s,f)),(i=n[0])&&t.push(new hi(i,a,o,l,f))}return this}function qK(r){var t=[],e=[],n;for(this._root&&t.push(new hi(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var i=n.node;if(i.length){var a,o=n.x0,s=n.y0,u=n.x1,l=n.y1,f=(o+u)/2,c=(s+l)/2;(a=i[0])&&t.push(new hi(a,o,s,f,c)),(a=i[1])&&t.push(new hi(a,f,s,u,c)),(a=i[2])&&t.push(new hi(a,o,c,f,l)),(a=i[3])&&t.push(new hi(a,f,c,u,l))}e.push(n)}for(;n=e.pop();)r(n.node,n.x0,n.y0,n.x1,n.y1);return this}function ZK(r){return r[0]}function QK(r){return arguments.length?(this._x=r,this):this._x}function JK(r){return r[1]}function eq(r){return arguments.length?(this._y=r,this):this._y}function Fp(r,t,e){var n=new mb(t??ZK,e??JK,NaN,NaN,NaN,NaN);return r==null?n:n.addAll(r)}function mb(r,t,e,n,i,a){this._x=r,this._y=t,this._x0=e,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function oS(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}var vi=Fp.prototype=mb.prototype;vi.copy=function(){var r=new mb(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,e,n;if(!t)return r;if(!t.length)return r._root=oS(t),r;for(e=[{source:t,target:r._root=new Array(4)}];t=e.pop();)for(var i=0;i<4;++i)(n=t.source[i])&&(n.length?e.push({source:n,target:t.target[i]=new Array(4)}):t.target[i]=oS(n));return r};vi.add=zK;vi.addAll=GK;vi.cover=$K;vi.data=UK;vi.extent=jK;vi.find=WK;vi.remove=XK;vi.removeAll=YK;vi.root=VK;vi.size=HK;vi.visit=KK;vi.visitAfter=qK;vi.x=QK;vi.y=eq;const tq=Object.freeze(Object.defineProperty({__proto__:null,quadtree:Fp},Symbol.toStringTag,{value:"Module"})),rq=to(tq);Object.defineProperty(Bp,"__esModule",{value:!0});Bp.forceNBody=void 0;var nq=rq,iq=.81,sS=.1;function aq(r,t,e,n,i){var a=e/n,o=r.map(function(u,l){var f=t[u.id],c=f.data,d=f.x,h=f.y,v=f.size,p=c.layout.force.nodeStrength;return{x:d,y:h,size:v,index:l,vx:0,vy:0,weight:a*p}}),s=(0,nq.quadtree)(o,function(u){return u.x},function(u){return u.y}).visitAfter(oq);return o.forEach(function(u){uq(u,s)}),o.map(function(u,l){var f=t[r[l].id],c=f.data.layout.force.mass,d=c===void 0?1:c;i[2*l]=u.vx/d,i[2*l+1]=u.vy/d}),i}Bp.forceNBody=aq;function oq(r){var t=0,e=0,n=0;if(r.length){for(var i=0;i<4;i++){var a=r[i];a&&a.weight&&(t+=a.weight,e+=a.x*a.weight,n+=a.y*a.weight)}r.x=e/t,r.y=n/t,r.weight=t}else{var a=r;r.x=a.data.x,r.y=a.data.y,r.weight=a.data.weight}}var sq=function(r,t,e,n,i,a){var o=a.x-r.x||sS,s=a.y-r.y||sS,u=n-t,l=o*o+s*s,f=Math.sqrt(l)*l;if(u*u*iq<l){var c=r.weight/f;return a.vx+=o*c,a.vy+=s*c,!0}if(r.length)return!1;if(r.data!==a){var c=r.data.weight/f;a.vx+=o*c,a.vy+=s*c}};function uq(r,t){t.visit(function(e,n,i,a,o){return sq(e,n,i,a,o,r)})}var lq=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),la=_e&&_e.__assign||function(){return la=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},la.apply(this,arguments)};Object.defineProperty(qc,"__esModule",{value:!0});qc.Force2Layout=void 0;var fq=hn,An=an(),cq=Bp,U0=function(r,t){var e;return r?(0,An.isNumber)(r)?e=function(n){return r}:e=r:e=function(n){return t||1},e},dq=function(r){lq(t,r);function t(e){var n=r.call(this)||this;n.maxIteration=1e3,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=500,n.minMovement=.4,n.interval=.02,n.factor=1,n.linkDistance=200,n.gravity=0,n.clusterNodeStrength=20,n.preventOverlap=!0,n.distanceThresholdMode="mean",n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.judgingDistance=0,n.centripetalOptions={leaf:2,single:2,others:1,center:function(a){return{x:n.width/2,y:n.height/2}}};var i=e.getMass;return n.propsGetMass=i,n.updateCfg(e),n}return t.prototype.getCentripetalOptions=function(){var e=this,n=e.leafCluster,i=e.clustering,a=e.nodeClusterBy,o=e.nodes,s=e.nodeMap,u=e.clusterNodeStrength,l=function(b){return typeof u=="function"?u(b):u},f={},c;if(n){c=this.getSameTypeLeafMap()||{};var d=Array.from(new Set(o==null?void 0:o.map(function(b){return b[a]})))||[];f={single:100,leaf:function(b,x,w){var E=c[b.id]||{},_=E.relativeLeafNodes,M=E.sameTypeLeafNodes;return(M==null?void 0:M.length)===(_==null?void 0:_.length)||(d==null?void 0:d.length)===1?1:l(b)},others:1,center:function(b,x,w){var E,_=(((E=b.data)===null||E===void 0?void 0:E.layout)||{}).degree;if(!_)return{x:100,y:100};var M;if(_===1){var C=(c[b.id]||{}).sameTypeLeafNodes,S=C===void 0?[]:C;S.length===1?M=void 0:S.length>1&&(M=(0,An.getAvgNodePosition)(S))}else M=void 0;return{x:M==null?void 0:M.x,y:M==null?void 0:M.y}}}}if(i){c||(c=this.getSameTypeLeafMap());var h=Array.from(new Set(o.map(function(b,x){return b[a]}))).filter(function(b){return b!==void 0}),v={};h.forEach(function(b){var x=o.filter(function(w){return w[a]===b}).map(function(w){return s[w.id]});v[b]=(0,An.getAvgNodePosition)(x)}),f={single:function(b){return l(b)},leaf:function(b){return l(b)},others:function(b){return l(b)},center:function(b,x,w){var E=v[b[a]];return{x:E==null?void 0:E.x,y:E==null?void 0:E.y}}}}this.centripetalOptions=la(la({},this.centripetalOptions),f);var p=this.centripetalOptions,g=p.leaf,y=p.single,m=p.others;g&&typeof g!="function"&&(this.centripetalOptions.leaf=function(){return g}),y&&typeof y!="function"&&(this.centripetalOptions.single=function(){return y}),m&&typeof m!="function"&&(this.centripetalOptions.others=function(){return m})},t.prototype.updateCfg=function(e){e&&Object.assign(this,e)},t.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},t.prototype.execute=function(){var e=this;e.stop();var n=e.nodes,i=e.edges,a=e.defSpringLen;if(e.judgingDistance=0,!n||n.length===0){e.onLayoutEnd([]);return}!e.width&&typeof window<"u"&&(e.width=window.innerWidth),!e.height&&typeof window<"u"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);var o=e.center;if(n.length===1){n[0].x=o[0],n[0].y=o[1],e.onLayoutEnd([la({},n[0])]);return}e.degreesMap=(0,An.getDegreeMap)(n,i),e.propsGetMass?e.getMass=e.propsGetMass:e.getMass=function(h){var v=1;(0,An.isNumber)(h.mass)&&(v=h.mass);var p=e.degreesMap[h.id].all;return!p||p<5?v:p*5*v};var s=e.nodeSize,u;if(e.preventOverlap){var l=e.nodeSpacing,f;(0,An.isNumber)(l)?f=function(){return l}:(0,An.isFunction)(l)?f=l:f=function(){return 0},s?(0,An.isArray)(s)?u=function(h){return Math.max(s[0],s[1])+f(h)}:u=function(h){return s+f(h)}:u=function(h){return h.size?(0,An.isArray)(h.size)?Math.max(h.size[0],h.size[1])+f(h):(0,An.isObject)(h.size)?Math.max(h.size.width,h.size.height)+f(h):h.size+f(h):10+f(h)}}e.nodeSize=u,e.linkDistance=U0(e.linkDistance,1),e.nodeStrength=U0(e.nodeStrength,1),e.edgeStrength=U0(e.edgeStrength,1);var c={},d={};n.forEach(function(h,v){(0,An.isNumber)(h.x)||(h.x=Math.random()*e.width),(0,An.isNumber)(h.y)||(h.y=Math.random()*e.height);var p=e.degreesMap[h.id];c[h.id]=la(la({},h),{data:la(la({},h.data),{size:e.nodeSize(h)||30,layout:{inDegree:p.in,outDegree:p.out,degree:p.all,tDegree:p.in,sDegree:p.out,force:{mass:e.getMass(h),nodeStrength:e.nodeStrength(h,i)}}})}),d[h.id]=v}),e.nodeMap=c,e.nodeIdxMap=d,e.edgeInfos=[],i==null||i.forEach(function(h){var v=c[h.source],p=c[h.target];!v||!p?elf.edgeInfos.push({}):e.edgeInfos.push({edgeStrength:e.edgeStrength(h),linkDistance:a?a(la(la({},h),{source:v,target:p}),v,p):e.linkDistance(h,v,p)||1+(s(v)+s(v)||0)/2})}),this.getCentripetalOptions(),e.onLayoutEnd=e.onLayoutEnd||function(){},e.run()},t.prototype.run=function(){var e=this,n=e.maxIteration,i=e.nodes,a=e.edges,o=e.workerEnabled,s=e.minMovement,u=e.animate,l=e.nodeMap,f=e.height;if(e.currentMinY=0,e.currentMaxY=f,!!i){var c=[];if(i.forEach(function(y,m){c[2*m]=0,c[2*m+1]=0}),this.defSideCoe&&typeof this.defSideCoe=="function"){var d={};a.forEach(function(y){var m=y.source,b=y.target;d[m]=d[m]||[],d[m].push(y),d[b]=d[b]||[],d[b].push(y)}),this.relatedEdges=d}var h=n,v=!u;if(o||v){for(var p=0;(e.judgingDistance>s||p<1)&&p<h;p++)e.runOneStep(p,c);e.onLayoutEnd(Object.values(l))}else{if(typeof window>"u")return;var g=0;this.timeInterval=window.setInterval(function(){i&&(e.runOneStep(g,c),g++,(g>=h||e.judgingDistance<s)&&(e.onLayoutEnd(Object.values(l)),window.clearInterval(e.timeInterval)))},0)}}},t.prototype.runOneStep=function(e,n){var i,a=this,o=a.nodes,s=a.edges;a.nodeMap;var u=a.monitor,l=[];if(o!=null&&o.length){a.calRepulsive(l),s&&a.calAttractive(l),a.calGravity(l),a.attractToSide(l);var f=a.interval;if(a.updateVelocity(l,n,f),a.updatePosition(n,f),(i=a.tick)===null||i===void 0||i.call(a),u){var c=this.calTotalEnergy(l);u({energy:c,nodes:o,edges:s,iterations:e})}}},t.prototype.calTotalEnergy=function(e){var n=this,i=n.nodes,a=n.nodeMap;if(!(i!=null&&i.length))return 0;var o=0;return i.forEach(function(s,u){var l=e[2*u],f=e[2*u+1],c=l*l+f*f,d=a[s.id].data.layout.force.mass,h=d===void 0?1:d;o+=h*c*.5}),o},t.prototype.calRepulsive=function(e){var n=this,i=n.nodes,a=n.nodeMap,o=n.factor,s=n.coulombDisScale;n.nodeSize,(0,cq.forceNBody)(i,a,o,s*s,e)},t.prototype.calAttractive=function(e){var n=this,i=n.edges,a=n.nodeMap,o=n.nodeIdxMap,s=n.edgeInfos;n.nodeSize,i.forEach(function(u,l){var f=(0,An.getEdgeTerminal)(u,"source"),c=(0,An.getEdgeTerminal)(u,"target"),d=a[f],h=a[c];if(!(!d||!h)){var v=h.x-d.x,p=h.y-d.y;!v&&!p&&(v=Math.random()*.01,p=Math.random()*.01);var g=Math.sqrt(v*v+p*p),y=v/g,m=p/g,b=s[l]||{},x=b.linkDistance,w=x===void 0?200:x,E=b.edgeStrength,_=E===void 0?200:E,M=w-g,C=M*_,S=d.data.layout.force.mass||1,A=h.data.layout.force.mass||1,T=1/S,I=1/A,k=y*C,P=m*C,N=2*o[f],z=2*o[c];e[N]-=k*T,e[N+1]-=P*T,e[z]+=k*I,e[z+1]+=P*I}})},t.prototype.calGravity=function(e){var n,i=this,a=i.nodes,o=i.edges,s=o===void 0?[]:o,u=i.nodeMap,l=i.width,f=i.height,c=i.center,d=i.gravity,h=i.degreesMap,v=i.centripetalOptions;if(a)for(var p=a.length,g=0;g<p;g++){var y=2*g,m=u[a[g].id],b=m.data.layout.force.mass,x=b===void 0?1:b,w=0,E=0,_=d,M=h[m.id],C=M.in,S=M.out,A=M.all,T=(n=i.getCenter)===null||n===void 0?void 0:n.call(i,m,A);if(T){var I=T[0],k=T[1],P=T[2];w=m.x-I,E=m.y-k,_=P}else w=m.x-c[0],E=m.y-c[1];if(_&&(e[y]-=_*w/x,e[y+1]-=_*E/x),v){var N=v.leaf,z=v.single,W=v.others,D=v.center,R=(D==null?void 0:D(m,a,s,l,f))||{x:0,y:0,centerStrength:0},H=R.x,ee=R.y,Y=R.centerStrength;if(!(0,An.isNumber)(H)||!(0,An.isNumber)(ee))continue;var X=(m.x-H)/x,fe=(m.y-ee)/x;if(Y&&(e[y]-=Y*X,e[y+1]-=Y*fe),A===0){var we=z(m);if(!we)continue;e[y]-=we*X,e[y+1]-=we*fe;continue}if(C===0||S===0){var Ae=N(m,a,s);if(!Ae)continue;e[y]-=Ae*X,e[y+1]-=Ae*fe;continue}var Ke=W(m);if(!Ke)continue;e[y]-=Ke*X,e[y+1]-=Ke*fe}}},t.prototype.attractToSide=function(e){var n=this,i=n.defSideCoe;n.height;var a=n.nodes,o=n.relatedEdges,s=n.currentMinY,u=s===void 0?0:s,l=n.currentMaxY,f=l===void 0?this.height:l;!i||typeof i!="function"||!(a!=null&&a.length)||a.forEach(function(c,d){var h=i(c,o[c.id]||[]);if(h!==0){var v=h<0?u:f,p=Math.abs(h);e[2*d+1]-=p*(c.y-v)}})},t.prototype.updateVelocity=function(e,n,i){var a=this,o=a.nodes,s=a.damping,u=a.maxSpeed;o!=null&&o.length&&o.forEach(function(l,f){var c=(n[2*f]+e[2*f]*i)*s||.01,d=(n[2*f+1]+e[2*f+1]*i)*s||.01,h=Math.sqrt(c*c+d*d);if(h>u){var v=u/h;c=v*c,d=v*d}n[2*f]=c,n[2*f+1]=d})},t.prototype.updatePosition=function(e,n){var i=this,a=i.nodes,o=i.distanceThresholdMode,s=i.nodeMap;if(!(a!=null&&a.length)){this.judgingDistance=0;return}var u=0;o==="max"?i.judgingDistance=-1/0:o==="min"&&(i.judgingDistance=1/0);var l=1/0,f=-1/0;a.forEach(function(c,d){var h=s[c.id];if((0,An.isNumber)(c.fx)&&(0,An.isNumber)(c.fy)){c.x=c.fx,c.y=c.fy,h.x=c.x,h.y=c.y;return}var v=e[2*d]*n,p=e[2*d+1]*n;c.x+=v,c.y+=p,h.x=c.x,h.y=c.y,c.y<l&&(l=c.y),c.y>f&&(f=c.y);var g=Math.sqrt(v*v+p*p);switch(o){case"max":i.judgingDistance<g&&(i.judgingDistance=g);break;case"min":i.judgingDistance>g&&(i.judgingDistance=g);break;default:u=u+g;break}}),this.currentMinY=l,this.currentMaxY=f,(!o||o==="mean")&&(i.judgingDistance=u/a.length)},t.prototype.stop=function(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval)},t.prototype.destroy=function(){var e=this;e.stop(),e.tick=null,e.nodes=null,e.edges=null,e.destroyed=!0},t.prototype.getType=function(){return"force2"},t.prototype.getSameTypeLeafMap=function(){var e=this,n=e.nodeClusterBy,i=e.nodes,a=e.edges,o=e.nodeMap,s=e.degreesMap;if(i!=null&&i.length){var u={};return i.forEach(function(l,f){var c=s[l.id].all;c===1&&(u[l.id]=(0,An.getCoreNodeAndRelativeLeafNodes)("leaf",l,a,n,s,o))}),u}},t}(fq.Base);qc.Force2Layout=dq;var bb={},zp={};function hq(r,t){var e,n=1;r==null&&(r=0),t==null&&(t=0);function i(){var a,o=e.length,s,u=0,l=0;for(a=0;a<o;++a)s=e[a],u+=s.x,l+=s.y;for(u=(u/o-r)*n,l=(l/o-t)*n,a=0;a<o;++a)s=e[a],s.x-=u,s.y-=l}return i.initialize=function(a){e=a},i.x=function(a){return arguments.length?(r=+a,i):r},i.y=function(a){return arguments.length?(t=+a,i):t},i.strength=function(a){return arguments.length?(n=+a,i):n},i}function kn(r){return function(){return r}}function hs(r){return(r()-.5)*1e-6}function vq(r){return r.x+r.vx}function pq(r){return r.y+r.vy}function gq(r){var t,e,n,i=1,a=1;typeof r!="function"&&(r=kn(r==null?1:+r));function o(){for(var l,f=t.length,c,d,h,v,p,g,y=0;y<a;++y)for(c=Fp(t,vq,pq).visitAfter(s),l=0;l<f;++l)d=t[l],p=e[d.index],g=p*p,h=d.x+d.vx,v=d.y+d.vy,c.visit(m);function m(b,x,w,E,_){var M=b.data,C=b.r,S=p+C;if(M){if(M.index>d.index){var A=h-M.x-M.vx,T=v-M.y-M.vy,I=A*A+T*T;I<S*S&&(A===0&&(A=hs(n),I+=A*A),T===0&&(T=hs(n),I+=T*T),I=(S-(I=Math.sqrt(I)))/I*i,d.vx+=(A*=I)*(S=(C*=C)/(g+C)),d.vy+=(T*=I)*S,M.vx-=A*(S=1-S),M.vy-=T*S)}return}return x>h+S||E<h-S||w>v+S||_<v-S}}function s(l){if(l.data)return l.r=e[l.data.index];for(var f=l.r=0;f<4;++f)l[f]&&l[f].r>l.r&&(l.r=l[f].r)}function u(){if(t){var l,f=t.length,c;for(e=new Array(f),l=0;l<f;++l)c=t[l],e[c.index]=+r(c,l,t)}}return o.initialize=function(l,f){t=l,n=f,u()},o.iterations=function(l){return arguments.length?(a=+l,o):a},o.strength=function(l){return arguments.length?(i=+l,o):i},o.radius=function(l){return arguments.length?(r=typeof l=="function"?l:kn(+l),u(),o):r},o}function yq(r){return r.index}function uS(r,t){var e=r.get(t);if(!e)throw new Error("node not found: "+t);return e}function mq(r){var t=yq,e=c,n,i=kn(30),a,o,s,u,l,f=1;r==null&&(r=[]);function c(g){return 1/Math.min(s[g.source.index],s[g.target.index])}function d(g){for(var y=0,m=r.length;y<f;++y)for(var b=0,x,w,E,_,M,C,S;b<m;++b)x=r[b],w=x.source,E=x.target,_=E.x+E.vx-w.x-w.vx||hs(l),M=E.y+E.vy-w.y-w.vy||hs(l),C=Math.sqrt(_*_+M*M),C=(C-a[b])/C*g*n[b],_*=C,M*=C,E.vx-=_*(S=u[b]),E.vy-=M*S,w.vx+=_*(S=1-S),w.vy+=M*S}function h(){if(o){var g,y=o.length,m=r.length,b=new Map(o.map((w,E)=>[t(w,E,o),w])),x;for(g=0,s=new Array(y);g<m;++g)x=r[g],x.index=g,typeof x.source!="object"&&(x.source=uS(b,x.source)),typeof x.target!="object"&&(x.target=uS(b,x.target)),s[x.source.index]=(s[x.source.index]||0)+1,s[x.target.index]=(s[x.target.index]||0)+1;for(g=0,u=new Array(m);g<m;++g)x=r[g],u[g]=s[x.source.index]/(s[x.source.index]+s[x.target.index]);n=new Array(m),v(),a=new Array(m),p()}}function v(){if(o)for(var g=0,y=r.length;g<y;++g)n[g]=+e(r[g],g,r)}function p(){if(o)for(var g=0,y=r.length;g<y;++g)a[g]=+i(r[g],g,r)}return d.initialize=function(g,y){o=g,l=y,h()},d.links=function(g){return arguments.length?(r=g,h(),d):r},d.id=function(g){return arguments.length?(t=g,d):t},d.iterations=function(g){return arguments.length?(f=+g,d):f},d.strength=function(g){return arguments.length?(e=typeof g=="function"?g:kn(+g),v(),d):e},d.distance=function(g){return arguments.length?(i=typeof g=="function"?g:kn(+g),p(),d):i},d}var bq={value:()=>{}};function kk(){for(var r=0,t=arguments.length,e={},n;r<t;++r){if(!(n=arguments[r]+"")||n in e||/[\s.]/.test(n))throw new Error("illegal type: "+n);e[n]=[]}return new tv(e)}function tv(r){this._=r}function xq(r,t){return r.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");if(i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}})}tv.prototype=kk.prototype={constructor:tv,on:function(r,t){var e=this._,n=xq(r+"",e),i,a=-1,o=n.length;if(arguments.length<2){for(;++a<o;)if((i=(r=n[a]).type)&&(i=wq(e[i],r.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(r=n[a]).type)e[i]=lS(e[i],r.name,t);else if(t==null)for(i in e)e[i]=lS(e[i],r.name,null);return this},copy:function(){var r={},t=this._;for(var e in t)r[e]=t[e].slice();return new tv(r)},call:function(r,t){if((i=arguments.length-2)>0)for(var e=new Array(i),n=0,i,a;n<i;++n)e[n]=arguments[n+2];if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(a=this._[r],n=0,i=a.length;n<i;++n)a[n].value.apply(t,e)},apply:function(r,t,e){if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(var n=this._[r],i=0,a=n.length;i<a;++i)n[i].value.apply(t,e)}};function wq(r,t){for(var e=0,n=r.length,i;e<n;++e)if((i=r[e]).name===t)return i.value}function lS(r,t,e){for(var n=0,i=r.length;n<i;++n)if(r[n].name===t){r[n]=bq,r=r.slice(0,n).concat(r.slice(n+1));break}return e!=null&&r.push({name:t,value:e}),r}var Rl=0,Xf=0,Ef=0,Dk=1e3,zv,Yf,Gv=0,pu=0,Gp=0,Sc=typeof performance=="object"&&performance.now?performance:Date,Nk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function Pk(){return pu||(Nk(Eq),pu=Sc.now()+Gp)}function Eq(){pu=0}function Sm(){this._call=this._time=this._next=null}Sm.prototype=Rk.prototype={constructor:Sm,restart:function(r,t,e){if(typeof r!="function")throw new TypeError("callback is not a function");e=(e==null?Pk():+e)+(t==null?0:+t),!this._next&&Yf!==this&&(Yf?Yf._next=this:zv=this,Yf=this),this._call=r,this._time=e,Mm()},stop:function(){this._call&&(this._call=null,this._time=1/0,Mm())}};function Rk(r,t,e){var n=new Sm;return n.restart(r,t,e),n}function _q(){Pk(),++Rl;for(var r=zv,t;r;)(t=pu-r._time)>=0&&r._call.call(null,t),r=r._next;--Rl}function fS(){pu=(Gv=Sc.now())+Gp,Rl=Xf=0;try{_q()}finally{Rl=0,Mq(),pu=0}}function Sq(){var r=Sc.now(),t=r-Gv;t>Dk&&(Gp-=t,Gv=r)}function Mq(){for(var r,t=zv,e,n=1/0;t;)t._call?(n>t._time&&(n=t._time),r=t,t=t._next):(e=t._next,t._next=null,t=r?r._next=e:zv=e);Yf=r,Mm(n)}function Mm(r){if(!Rl){Xf&&(Xf=clearTimeout(Xf));var t=r-pu;t>24?(r<1/0&&(Xf=setTimeout(fS,r-Sc.now()-Gp)),Ef&&(Ef=clearInterval(Ef))):(Ef||(Gv=Sc.now(),Ef=setInterval(Sq,Dk)),Rl=1,Nk(fS))}}const Cq=1664525,Aq=1013904223,cS=4294967296;function Tq(){let r=1;return()=>(r=(Cq*r+Aq)%cS)/cS}function Iq(r){return r.x}function Oq(r){return r.y}var Lq=10,kq=Math.PI*(3-Math.sqrt(5));function Dq(r){var t,e=1,n=.001,i=1-Math.pow(n,1/300),a=0,o=.6,s=new Map,u=Rk(c),l=kk("tick","end"),f=Tq();r==null&&(r=[]);function c(){d(),l.call("tick",t),e<n&&(u.stop(),l.call("end",t))}function d(p){var g,y=r.length,m;p===void 0&&(p=1);for(var b=0;b<p;++b)for(e+=(a-e)*i,s.forEach(function(x){x(e)}),g=0;g<y;++g)m=r[g],m.fx==null?m.x+=m.vx*=o:(m.x=m.fx,m.vx=0),m.fy==null?m.y+=m.vy*=o:(m.y=m.fy,m.vy=0);return t}function h(){for(var p=0,g=r.length,y;p<g;++p){if(y=r[p],y.index=p,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var m=Lq*Math.sqrt(.5+p),b=p*kq;y.x=m*Math.cos(b),y.y=m*Math.sin(b)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function v(p){return p.initialize&&p.initialize(r,f),p}return h(),t={tick:d,restart:function(){return u.restart(c),t},stop:function(){return u.stop(),t},nodes:function(p){return arguments.length?(r=p,h(),s.forEach(v),t):r},alpha:function(p){return arguments.length?(e=+p,t):e},alphaMin:function(p){return arguments.length?(n=+p,t):n},alphaDecay:function(p){return arguments.length?(i=+p,t):+i},alphaTarget:function(p){return arguments.length?(a=+p,t):a},velocityDecay:function(p){return arguments.length?(o=1-p,t):1-o},randomSource:function(p){return arguments.length?(f=p,s.forEach(v),t):f},force:function(p,g){return arguments.length>1?(g==null?s.delete(p):s.set(p,v(g)),t):s.get(p)},find:function(p,g,y){var m=0,b=r.length,x,w,E,_,M;for(y==null?y=1/0:y*=y,m=0;m<b;++m)_=r[m],x=p-_.x,w=g-_.y,E=x*x+w*w,E<y&&(M=_,y=E);return M},on:function(p,g){return arguments.length>1?(l.on(p,g),t):l.on(p)}}}function Nq(){var r,t,e,n,i=kn(-30),a,o=1,s=1/0,u=.81;function l(h){var v,p=r.length,g=Fp(r,Iq,Oq).visitAfter(c);for(n=h,v=0;v<p;++v)t=r[v],g.visit(d)}function f(){if(r){var h,v=r.length,p;for(a=new Array(v),h=0;h<v;++h)p=r[h],a[p.index]=+i(p,h,r)}}function c(h){var v=0,p,g,y=0,m,b,x;if(h.length){for(m=b=x=0;x<4;++x)(p=h[x])&&(g=Math.abs(p.value))&&(v+=p.value,y+=g,m+=g*p.x,b+=g*p.y);h.x=m/y,h.y=b/y}else{p=h,p.x=p.data.x,p.y=p.data.y;do v+=a[p.data.index];while(p=p.next)}h.value=v}function d(h,v,p,g){if(!h.value)return!0;var y=h.x-t.x,m=h.y-t.y,b=g-v,x=y*y+m*m;if(b*b/u<x)return x<s&&(y===0&&(y=hs(e),x+=y*y),m===0&&(m=hs(e),x+=m*m),x<o&&(x=Math.sqrt(o*x)),t.vx+=y*h.value*n/x,t.vy+=m*h.value*n/x),!0;if(h.length||x>=s)return;(h.data!==t||h.next)&&(y===0&&(y=hs(e),x+=y*y),m===0&&(m=hs(e),x+=m*m),x<o&&(x=Math.sqrt(o*x)));do h.data!==t&&(b=a[h.data.index]*n/x,t.vx+=y*b,t.vy+=m*b);while(h=h.next)}return l.initialize=function(h,v){r=h,e=v,f()},l.strength=function(h){return arguments.length?(i=typeof h=="function"?h:kn(+h),f(),l):i},l.distanceMin=function(h){return arguments.length?(o=h*h,l):Math.sqrt(o)},l.distanceMax=function(h){return arguments.length?(s=h*h,l):Math.sqrt(s)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function Pq(r,t,e){var n,i=kn(.1),a,o;typeof r!="function"&&(r=kn(+r)),t==null&&(t=0),e==null&&(e=0);function s(l){for(var f=0,c=n.length;f<c;++f){var d=n[f],h=d.x-t||1e-6,v=d.y-e||1e-6,p=Math.sqrt(h*h+v*v),g=(o[f]-p)*a[f]*l/p;d.vx+=h*g,d.vy+=v*g}}function u(){if(n){var l,f=n.length;for(a=new Array(f),o=new Array(f),l=0;l<f;++l)o[l]=+r(n[l],l,n),a[l]=isNaN(o[l])?0:+i(n[l],l,n)}}return s.initialize=function(l){n=l,u()},s.strength=function(l){return arguments.length?(i=typeof l=="function"?l:kn(+l),u(),s):i},s.radius=function(l){return arguments.length?(r=typeof l=="function"?l:kn(+l),u(),s):r},s.x=function(l){return arguments.length?(t=+l,s):t},s.y=function(l){return arguments.length?(e=+l,s):e},s}function Rq(r){var t=kn(.1),e,n,i;typeof r!="function"&&(r=kn(r==null?0:+r));function a(s){for(var u=0,l=e.length,f;u<l;++u)f=e[u],f.vx+=(i[u]-f.x)*n[u]*s}function o(){if(e){var s,u=e.length;for(n=new Array(u),i=new Array(u),s=0;s<u;++s)n[s]=isNaN(i[s]=+r(e[s],s,e))?0:+t(e[s],s,e)}}return a.initialize=function(s){e=s,o()},a.strength=function(s){return arguments.length?(t=typeof s=="function"?s:kn(+s),o(),a):t},a.x=function(s){return arguments.length?(r=typeof s=="function"?s:kn(+s),o(),a):r},a}function Bq(r){var t=kn(.1),e,n,i;typeof r!="function"&&(r=kn(r==null?0:+r));function a(s){for(var u=0,l=e.length,f;u<l;++u)f=e[u],f.vy+=(i[u]-f.y)*n[u]*s}function o(){if(e){var s,u=e.length;for(n=new Array(u),i=new Array(u),s=0;s<u;++s)n[s]=isNaN(i[s]=+r(e[s],s,e))?0:+t(e[s],s,e)}}return a.initialize=function(s){e=s,o()},a.strength=function(s){return arguments.length?(t=typeof s=="function"?s:kn(+s),o(),a):t},a.y=function(s){return arguments.length?(r=typeof s=="function"?s:kn(+s),o(),a):r},a}const Fq=Object.freeze(Object.defineProperty({__proto__:null,forceCenter:hq,forceCollide:gq,forceLink:mq,forceManyBody:Nq,forceRadial:Pq,forceSimulation:Dq,forceX:Rq,forceY:Bq},Symbol.toStringTag,{value:"Module"})),xb=to(Fq);var wb={},zq=_e&&_e.__createBinding||(Object.create?function(r,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,i)}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]}),Gq=_e&&_e.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),$q=_e&&_e.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.prototype.hasOwnProperty.call(r,e)&&zq(t,r,e);return Gq(t,r),t};Object.defineProperty(wb,"__esModule",{value:!0});var Qu=$q(xb),mh=an();function Uq(){function r(X){return function(){return X}}var t=function(X){return X.cluster},e=r(1),n=r(-1),i=r(100),a=r(.1),o=[0,0],s=[],u={},l=[],f=100,c=100,d={none:{x:0,y:0}},h=[],v,p="force",g=!0,y=.1;function m(X){if(!g)return m;v.tick(),M();for(var fe=0,we=s.length,Ae=void 0,Ke=X*y;fe<we;++fe)Ae=s[fe],Ae.vx+=(d[t(Ae)].x-Ae.x)*Ke,Ae.vy+=(d[t(Ae)].y-Ae.y)*Ke}function b(){s&&x()}function x(){if(!(!s||!s.length)){if(t(s[0])===void 0)throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var X=w();v=Qu.forceSimulation(X.nodes).force("x",Qu.forceX(f).strength(.1)).force("y",Qu.forceY(c).strength(.1)).force("collide",Qu.forceCollide(function(fe){return fe.r}).iterations(4)).force("charge",Qu.forceManyBody().strength(n)).force("links",Qu.forceLink(X.nodes.length?X.links:[]).distance(i).strength(a)),h=v.nodes(),M()}}function w(){var X=[],fe=[],we={},Ae=[],Ke={},ot=[];return Ke=E(s),ot=_(l),Ae=Object.keys(Ke),Ae.forEach(function(nt,Ct){var Et=Ke[nt];X.push({id:nt,size:Et.count,r:Math.sqrt(Et.sumforceNodeSize/Math.PI)}),we[nt]=Ct}),ot.forEach(function(nt){var Ct=(0,mh.getEdgeTerminal)(nt,"source"),Et=(0,mh.getEdgeTerminal)(nt,"target"),fr=we[Ct],Gt=we[Et];fr!==void 0&&Gt!==void 0&&fe.push({source:fr,target:Gt,count:nt.count})}),{nodes:X,links:fe}}function E(X){var fe={};return X.forEach(function(we){var Ae=t(we);fe[Ae]||(fe[Ae]={count:0,sumforceNodeSize:0})}),X.forEach(function(we){var Ae=t(we),Ke=e(we),ot=fe[Ae];ot.count=ot.count+1,ot.sumforceNodeSize=ot.sumforceNodeSize+Math.PI*(Ke*Ke)*1.3,fe[Ae]=ot}),fe}function _(X){var fe={},we=[];X.forEach(function(Ke){var ot=C(Ke),nt=0;fe[ot]!==void 0&&(nt=fe[ot]),nt+=1,fe[ot]=nt});var Ae=Object.entries(fe);return Ae.forEach(function(Ke){var ot=Ke[0],nt=Ke[1],Ct=ot.split("~")[0],Et=ot.split("~")[1];Ct!==void 0&&Et!==void 0&&we.push({source:Ct,target:Et,count:nt})}),we}function M(){return d={none:{x:0,y:0}},h.forEach(function(X){d[X.id]={x:X.x-o[0],y:X.y-o[1]}}),d}function C(X){var fe=(0,mh.getEdgeTerminal)(X,"source"),we=(0,mh.getEdgeTerminal)(X,"target"),Ae=t(u[fe]),Ke=t(u[we]);return Ae<=Ke?"".concat(Ae,"~").concat(Ke):"".concat(Ke,"~").concat(Ae)}function S(X){u={},X.forEach(function(fe){u[fe.id]=fe})}function A(X){return arguments.length?(p=X,b(),m):p}function T(X){return arguments.length?typeof X=="string"?(t=function(fe){return fe[X]},m):(t=X,m):t}function I(X){return arguments.length?(g=X,m):g}function k(X){return arguments.length?(y=X,m):y}function P(X){return arguments.length?(f=X,m):f}function N(X){return arguments.length?(c=X,m):c}function z(X){return arguments.length?(S(X||[]),s=X||[],m):s}function W(X){return arguments.length?(l=X||[],b(),m):l}function D(X){return arguments.length?(typeof X=="function"?e=X:e=r(+X),b(),m):e}function R(X){return arguments.length?(typeof X=="function"?n=X:n=r(+X),b(),m):n}function H(X){return arguments.length?(typeof X=="function"?i=X:i=r(+X),b(),m):i}function ee(X){return arguments.length?(typeof X=="function"?a=X:a=r(+X),b(),m):a}function Y(X){return arguments.length?(o=X,m):o}return m.initialize=function(X){s=X,b()},m.template=A,m.groupBy=T,m.enableGrouping=I,m.strength=k,m.centerX=P,m.centerY=N,m.nodes=z,m.links=W,m.forceNodeSize=D,m.nodeSize=m.forceNodeSize,m.forceCharge=R,m.forceLinkDistance=H,m.forceLinkStrength=ee,m.offset=Y,m.getFocis=M,m}wb.default=Uq;var Ro={};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.FORCE_LAYOUT_TYPE_MAP=Ro.LAYOUT_MESSAGE=void 0;Ro.LAYOUT_MESSAGE={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};Ro.FORCE_LAYOUT_TYPE_MAP={gForce:!0,force2:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0};var jq=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Wq=_e&&_e.__createBinding||(Object.create?function(r,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,i)}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]}),Xq=_e&&_e.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),Yq=_e&&_e.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.prototype.hasOwnProperty.call(r,e)&&Wq(t,r,e);return Xq(t,r),t},Vq=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zp,"__esModule",{value:!0});zp.ForceLayout=void 0;var Ju=Yq(xb),Hq=Vq(wb),js=an(),Kq=hn,qq=Ro,Zq=function(r){jq(t,r);function t(e){var n=r.call(this)||this;return n.center=[0,0],n.nodeStrength=null,n.edgeStrength=null,n.preventOverlap=!1,n.clusterNodeStrength=null,n.clusterEdgeStrength=null,n.clusterEdgeDistance=null,n.clusterNodeSize=null,n.clusterFociStrength=null,n.linkDistance=50,n.alphaDecay=.028,n.alphaMin=.001,n.alpha=.3,n.collideStrength=1,n.workerEnabled=!1,n.tick=function(){},n.onLayoutEnd=function(){},n.ticking=void 0,e&&n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},t.prototype.init=function(e){var n=this;n.nodes=e.nodes||[];var i=e.edges||[];n.edges=i.map(function(a){var o={},s=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(a).forEach(function(u){s.indexOf(u)>-1||(o[u]=a[u])}),o}),n.ticking=!1},t.prototype.execute=function(e){var n=this,i=n.nodes,a=n.edges;if(!n.ticking){var o=n.forceSimulation,s=n.alphaMin,u=n.alphaDecay,l=n.alpha;if(o){if(e){if(n.clustering&&n.clusterForce&&(n.clusterForce.nodes(i),n.clusterForce.links(a)),o.nodes(i),a&&n.edgeForce)n.edgeForce.links(a);else if(a&&!n.edgeForce){var d=Ju.forceLink().id(function(g){return g.id}).links(a);n.edgeStrength&&d.strength(n.edgeStrength),n.linkDistance&&d.distance(n.linkDistance),n.edgeForce=d,o.force("link",d)}}n.preventOverlap&&n.overlapProcess(o),o.alpha(l).restart(),this.ticking=!0}else try{var f=Ju.forceManyBody();if(n.nodeStrength&&f.strength(n.nodeStrength),o=Ju.forceSimulation().nodes(i),n.clustering){var c=(0,Hq.default)();c.centerX(n.center[0]).centerY(n.center[1]).template("force").strength(n.clusterFociStrength),a&&c.links(a),i&&c.nodes(i),c.forceLinkDistance(n.clusterEdgeDistance).forceLinkStrength(n.clusterEdgeStrength).forceCharge(n.clusterNodeStrength).forceNodeSize(n.clusterNodeSize),n.clusterForce=c,o.force("group",c)}if(o.force("center",Ju.forceCenter(n.center[0],n.center[1])).force("charge",f).alpha(l).alphaDecay(u).alphaMin(s),n.preventOverlap&&n.overlapProcess(o),a){var d=Ju.forceLink().id(function(p){return p.id}).links(a);n.edgeStrength&&d.strength(n.edgeStrength),n.linkDistance&&d.distance(n.linkDistance),n.edgeForce=d,o.force("link",d)}if(n.workerEnabled&&!Jq()&&(n.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),!n.workerEnabled)o.on("tick",function(){n.tick()}).on("end",function(){n.ticking=!1,n.onLayoutEnd&&n.onLayoutEnd()}),n.ticking=!0;else{o.stop();for(var h=Qq(o),v=1;v<=h;v++)o.tick(),postMessage({nodes:i,currentTick:v,totalTicks:h,type:qq.LAYOUT_MESSAGE.TICK},void 0);n.ticking=!1}n.forceSimulation=o,n.ticking=!0}catch(p){n.ticking=!1,console.warn(p)}}},t.prototype.overlapProcess=function(e){var n=this,i=n.nodeSize,a=n.nodeSpacing,o,s,u=n.collideStrength;if((0,js.isNumber)(a)?s=function(){return a}:(0,js.isFunction)(a)?s=a:s=function(){return 0},!i)o=function(d){if(d.size){if((0,js.isArray)(d.size)){var h=d.size[0]>d.size[1]?d.size[0]:d.size[1];return h/2+s(d)}if((0,js.isObject)(d.size)){var h=d.size.width>d.size.height?d.size.width:d.size.height;return h/2+s(d)}return d.size/2+s(d)}return 10+s(d)};else if((0,js.isFunction)(i))o=function(d){var h=i(d);return h+s(d)};else if((0,js.isArray)(i)){var l=i[0]>i[1]?i[0]:i[1],f=l/2;o=function(d){return f+s(d)}}else if((0,js.isNumber)(i)){var c=i/2;o=function(d){return c+s(d)}}else o=function(){return 10};e.force("collisionForce",Ju.forceCollide(o).strength(u))},t.prototype.updateCfg=function(e){var n=this;n.ticking&&(n.forceSimulation.stop(),n.ticking=!1),n.forceSimulation=null,Object.assign(n,e)},t.prototype.destroy=function(){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.nodes=null,e.edges=null,e.destroyed=!0},t}(Kq.Base);zp.ForceLayout=Zq;function Qq(r){var t=r.alphaMin(),e=r.alphaTarget(),n=r.alpha(),i=Math.log((t-e)/(n-e))/Math.log(1-r.alphaDecay()),a=Math.ceil(i);return a}function Jq(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}(function(r){var t=_e&&_e.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,o,s)}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),e=_e&&_e.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(r,"__esModule",{value:!0}),e(zp,r)})(bb);var Zc={},eZ=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(Zc,"__esModule",{value:!0});Zc.CircularLayout=void 0;var tZ=hn,Ya=an();function rZ(r,t,e,n){r.forEach(function(i,a){r[a].children=[],r[a].parent=[]}),n?t.forEach(function(i){var a=(0,Ya.getEdgeTerminal)(i,"source"),o=(0,Ya.getEdgeTerminal)(i,"target"),s=0;a&&(s=e[a]);var u=0;o&&(u=e[o]);var l=r[s].children,f=r[u].parent;l.push(r[u].id),f.push(r[s].id)}):t.forEach(function(i){var a=(0,Ya.getEdgeTerminal)(i,"source"),o=(0,Ya.getEdgeTerminal)(i,"target"),s=0;a&&(s=e[a]);var u=0;o&&(u=e[o]);var l=r[s].children,f=r[u].children;l.push(r[u].id),f.push(r[s].id)})}function nZ(r,t,e){for(var n=e.length,i=0;i<n;i++){var a=(0,Ya.getEdgeTerminal)(e[i],"source"),o=(0,Ya.getEdgeTerminal)(e[i],"target");if(r.id===a&&t.id===o||t.id===a&&r.id===o)return!0}return!1}function iZ(r,t){var e=r.degree,n=t.degree;return e<n?-1:e>n?1:0}var aZ=function(r){eZ(t,r);function t(e){var n=r.call(this)||this;return n.radius=null,n.nodeSize=void 0,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},t.prototype.execute=function(){var e,n=this,i=n.nodes,a=n.edges,o=i.length;if(o===0){n.onLayoutEnd&&n.onLayoutEnd();return}!n.width&&typeof window<"u"&&(n.width=window.innerWidth),!n.height&&typeof window<"u"&&(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var s=n.center;if(o===1){i[0].x=s[0],i[0].y=s[1],n.onLayoutEnd&&n.onLayoutEnd();return}var u=n.radius,l=n.startRadius,f=n.endRadius,c=n.divisions,d=n.startAngle,h=n.endAngle,v=n.angleRatio,p=n.ordering,g=n.clockwise,y=n.nodeSpacing,m=n.nodeSize,b=(h-d)/o,x={};i.forEach(function(N,z){x[N.id]=z}),n.nodeMap=x;var w=(0,Ya.getDegree)(i.length,x,a);if(n.degrees=w,y){var E=(0,Ya.getFuncByUnknownType)(10,y),_=(0,Ya.getFuncByUnknownType)(10,m),M=-1/0;i.forEach(function(N){var z=_(N);M<z&&(M=z)});var C=0;i.forEach(function(N,z){z===0?C+=M||10:C+=(E(N)||0)+(M||10)}),u=C/(2*Math.PI)}else!u&&!l&&!f?u=n.height>n.width?n.width/2:n.height/2:!l&&f?l=f:l&&!f&&(f=l);var S=b*v,A=[];p==="topology"?A=n.topologyOrdering():p==="topology-directed"?A=n.topologyOrdering(!0):p==="degree"?A=n.degreeOrdering():A=i;for(var T=Math.ceil(o/c),I=0;I<o;++I){var k=u;!k&&l!==null&&f!==null&&(k=l+I*(f-l)/(o-1)),k||(k=10+I*100/(o-1));var P=d+I%T*S+2*Math.PI/c*Math.floor(I/T);g||(P=h-I%T*S-2*Math.PI/c*Math.floor(I/T)),A[I].x=s[0]+Math.cos(P)*k,A[I].y=s[1]+Math.sin(P)*k,A[I].weight=w[I].all}return(e=n.onLayoutEnd)===null||e===void 0||e.call(n),{nodes:A,edges:this.edges}},t.prototype.topologyOrdering=function(e){e===void 0&&(e=!1);var n=this,i=n.degrees,a=n.edges,o=n.nodes,s=(0,Ya.clone)(o),u=n.nodeMap,l=[s[0]],f=[o[0]],c=[],d=o.length;c[0]=!0,rZ(s,a,u,e);var h=0;return s.forEach(function(v,p){if(p!==0)if((p===d-1||i[p].all!==i[p+1].all||nZ(l[h],v,a))&&!c[p])l.push(v),f.push(o[u[v.id]]),c[p]=!0,h++;else{for(var g=l[h].children,y=!1,m=0;m<g.length;m++){var b=u[g[m]];if(i[b].all===i[p].all&&!c[b]){l.push(s[b]),f.push(o[u[s[b].id]]),c[b]=!0,y=!0;break}}for(var x=0;!y&&(c[x]||(l.push(s[x]),f.push(o[u[s[x].id]]),c[x]=!0,y=!0),x++,x!==d););}}),f},t.prototype.degreeOrdering=function(){var e=this,n=e.nodes,i=[],a=e.degrees;return n.forEach(function(o,s){o.degree=a[s].all,i.push(o)}),i.sort(iZ),i},t.prototype.getType=function(){return"circular"},t}(tZ.Base);Zc.CircularLayout=aZ;var Kl={},Eb={},_b={},Sb={},Mb={},Cb={};Object.defineProperty(Cb,"__esModule",{value:!0});var oZ=function(r,t){if(r!=="next"&&r!=="prev")return t},dS=function(r){r.prev.next=r.next,r.next.prev=r.prev,delete r.next,delete r.prev},sZ=function(){function r(){var t={};t.prev=t,t.next=t.prev,this.shortcut=t}return r.prototype.dequeue=function(){var t=this.shortcut,e=t.prev;if(e&&e!==t)return dS(e),e},r.prototype.enqueue=function(t){var e=this.shortcut;t.prev&&t.next&&dS(t),t.next=e.next,e.next.prev=t,e.next=t,t.prev=e},r.prototype.toString=function(){for(var t=[],e=this.shortcut,n=e.prev;n!==e;)t.push(JSON.stringify(n,oZ)),n=n==null?void 0:n.prev;return"[".concat(t.join(", "),"]")},r}();Cb.default=sZ;var El;(function(r){r.DEFAULT_EDGE_NAME="\0",r.GRAPH_NODE="\0",r.EDGE_KEY_DELIM=""})(El||(El={}));function hS(r,t){var e=r.get(t)||0;r.set(t,e+1)}function vS(r,t){var e=r.get(t);e!==void 0&&(e=e-1,e>0?r.set(t,e):r.delete(t))}function Bk(r,t,e,n){var i=String(t),a=String(e);if(!r&&i>a){var o=i;i=a,a=o}return i+El.EDGE_KEY_DELIM+a+El.EDGE_KEY_DELIM+(n===void 0?El.DEFAULT_EDGE_NAME:n)}function pS(r,t,e,n){var i=String(t),a=String(e),o={v:t,w:e};if(!r&&i>a){var s=o.v;o.v=o.w,o.w=s}return n!==void 0&&(o.name=n),o}function j0(r,t){return Bk(r,t.v,t.w,t.name)}function gS(r){return typeof r=="function"}var uZ=function(t){return t.nodes().map(function(e){var n=t.node(e),i=t.parent(e),a={id:e,value:n,parent:i};return a.value===void 0&&delete a.value,a.parent===void 0&&delete a.parent,a})},lZ=function(t){return t.edges().map(function(e){var n=t.edge(e),i={v:e.v,w:e.w,value:n,name:e.name};return i.name===void 0&&delete i.name,i.value===void 0&&delete i.value,i})},fZ=function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:uZ(t),edges:lZ(t),value:t.graph()};return e.value===void 0&&delete e.value,e},cZ=function(t){var e=new _u(t.options);return t.value!==void 0&&e.setGraph(t.value),t.nodes.forEach(function(n){e.setNode(n.id,n.value),n.parent&&e.setParent(n.id,n.parent)}),t.edges.forEach(function(n){e.setEdge(n.v,n.w,n.value,n.name)}),e};function yS(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),e.push.apply(e,n)}return e}function mS(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?yS(Object(e),!0).forEach(function(n){dZ(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):yS(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function dZ(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function hZ(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function bS(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function vZ(r,t,e){return t&&bS(r.prototype,t),e&&bS(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}var pZ={compound:!1,multigraph:!1,directed:!0},_u=function(){function r(){var t=this,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hZ(this,r),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=El.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return t.directed},this.isMultigraph=function(){return t.multigraph},this.isCompound=function(){return t.compound},this.setGraph=function(i){return t.label=i,t},this.graph=function(){return t.label},this.setDefaultNodeLabel=function(i){return gS(i)?t.defaultNodeLabelFn=i:t.defaultNodeLabelFn=function(){return i},t},this.nodeCount=function(){return t.nodeCountNum},this.node=function(i){return t.nodesLabelMap.get(i)},this.nodes=function(){return Array.from(t.nodesLabelMap.keys())},this.sources=function(){return t.nodes().filter(function(i){var a;return!(!((a=t.inEdgesMap.get(i))===null||a===void 0)&&a.size)})},this.sinks=function(){return t.nodes().filter(function(i){var a;return!(!((a=t.outEdgesMap.get(i))===null||a===void 0)&&a.size)})},this.setNodes=function(i,a){return i.map(function(o){return t.setNode(o,a)}),t},this.hasNode=function(i){return t.nodesLabelMap.has(i)},this.checkCompound=function(){if(!t.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(i){if(t.isCompound()){var a,o=(a=t.parentMap)===null||a===void 0?void 0:a.get(i);if(o!==t.GRAPH_NODE)return o}},this.removeFromParentsChildList=function(i){var a=t.parentMap.get(i);t.childrenMap.get(a).delete(i)},this.setParent=function(i,a){var o,s;t.checkCompound();for(var u=a===void 0?t.GRAPH_NODE:a,l=t.parent(u);l;){if(i===l)throw new Error("Setting "+a+" as parent of "+i+" would create a cycle");l=t.parent(l)}a&&t.setNode(a),t.setNode(i),t.removeFromParentsChildList(i),(o=t.parentMap)===null||o===void 0||o.set(i,u);var f=t.childrenMap.get(u);return f.set(i,!0),(s=t.childrenMap)===null||s===void 0||s.set(u,f),t},this.children=function(i){var a=i===void 0?t.GRAPH_NODE:i;if(t.isCompound()){var o,s=(o=t.childrenMap)===null||o===void 0?void 0:o.get(a);return s?Array.from(s.keys()):void 0}if(a===t.GRAPH_NODE)return t.nodes();if(i&&t.hasNode(i))return[]},this.predecessors=function(i){var a=t.predecessorsMap.get(i);return a?Array.from(a.keys()):void 0},this.successors=function(i){var a=t.successorsMap.get(i);return a?Array.from(a.keys()):void 0},this.neighbors=function(i){var a;if(t.hasNode(i))return Array.from(new Set((a=t.predecessors(i))===null||a===void 0?void 0:a.concat(t.successors(i))))},this.isLeaf=function(i){var a;if(t.isDirected()){var o;return!(!((o=t.successors(i))===null||o===void 0)&&o.length)}return!(!((a=t.neighbors(i))===null||a===void 0)&&a.length)},this.filterNodes=function(i){var a=t.directed,o=t.multigraph,s=t.compound,u=new r({directed:a,multigraph:o,compound:s});if(u.setGraph(t.graph()),t.nodes().forEach(function(f){i(f)&&u.setNode(f,t.node(f))}),t.edges().forEach(function(f){u.hasNode(f.v)&&u.hasNode(f.w)&&u.setEdgeObj(f,t.edge(f))}),s){var l=function(c){for(var d=t.parent(c);d!==void 0&&!u.hasNode(d);)d=t.parent(d);return d};u.nodes().forEach(function(f){u.setParent(f,l(f))})}return u},this.setDefaultEdgeLabel=function(i){return gS(i)?t.defaultEdgeLabelFn=i:t.defaultEdgeLabelFn=function(){return i},t},this.edgeCount=function(){return t.edgeCountNum},this.setEdgeObj=function(i,a){return t.setEdge(i.v,i.w,a,i.name)},this.setPath=function(i,a){return i.reduce(function(o,s){return t.setEdge(o,s,a),s}),t},this.edgeFromArgs=function(i,a,o){return t.edge({v:i,w:a,name:o})},this.edge=function(i){return t.edgesLabelsMap.get(j0(t.isDirected(),i))},this.hasEdge=function(i,a,o){return t.edgesLabelsMap.has(j0(t.isDirected(),{v:i,w:a,name:o}))},this.removeEdgeObj=function(i){var a=i.v,o=i.w,s=i.name;return t.removeEdge(a,o,s)},this.edges=function(){return Array.from(t.edgesMap.values())},this.inEdges=function(i,a){var o=t.inEdgesMap.get(i);if(o)return Array.from(o.values()).filter(function(s){return!a||s.v===a})},this.outEdges=function(i,a){var o=t.outEdgesMap.get(i);if(o)return Array.from(o.values()).filter(function(s){return!a||s.w===a})},this.nodeEdges=function(i,a){var o;if(t.hasNode(i))return(o=t.inEdges(i,a))===null||o===void 0?void 0:o.concat(t.outEdges(i,a))},this.toJSON=function(){return fZ(t)},this.nodeInDegree=function(i){var a=t.inEdgesMap.get(i);return a?a.size:0},this.nodeOutDegree=function(i){var a=t.outEdgesMap.get(i);return a?a.size:0},this.nodeDegree=function(i){return t.nodeInDegree(i)+t.nodeOutDegree(i)},this.source=function(i){return i.v},this.target=function(i){return i.w};var n=mS(mS({},pZ),e);this.compound=n.compound,this.directed=n.directed,this.multigraph=n.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return vZ(r,[{key:"setNode",value:function(e,n){var i=this.nodesLabelMap,a=this.defaultNodeLabelFn,o=this.isCompound,s=this.parentMap,u=this.childrenMap,l=this.inEdgesMap,f=this.outEdgesMap,c=this.predecessorsMap,d=this.successorsMap;if(i.has(e))return n!==void 0&&i.set(e,n),this;if(i.set(e,n||a(e)),o()){var h;s==null||s.set(e,this.GRAPH_NODE),u==null||u.set(e,new Map),u!=null&&u.has(this.GRAPH_NODE)||u==null||u.set(this.GRAPH_NODE,new Map),u==null||(h=u.get(this.GRAPH_NODE))===null||h===void 0||h.set(e,!0)}return[l,f,c,d].forEach(function(v){return v.set(e,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(e){var n=this;if(this.hasNode(e)){var i=function(g){n.removeEdge(g.v,g.w,g.name)},a=this.inEdgesMap,o=this.outEdgesMap,s=this.predecessorsMap,u=this.successorsMap,l=this.nodesLabelMap;if(this.isCompound()){var f,c,d;this.removeFromParentsChildList(e),(f=this.parentMap)===null||f===void 0||f.delete(e),(c=this.children(e))===null||c===void 0||c.forEach(function(p){return n.setParent(p)}),(d=this.childrenMap)===null||d===void 0||d.delete(e)}var h=a.get(e),v=o.get(e);Array.from(h.values()).forEach(function(p){return i(p)}),Array.from(v.values()).forEach(function(p){return i(p)}),l.delete(e),a.delete(e),o.delete(e),s.delete(e),u.delete(e),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(e,n,i,a){var o,s,u=pS(this.isDirected(),e,n,a),l=j0(this.isDirected(),u),f=u.v,c=u.w;if(this.edgesLabelsMap.has(l))return this.edgesLabelsMap.set(l,i),this;if(a!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(c),this.edgesLabelsMap.set(l,i||this.defaultEdgeLabelFn(f,c,a)),Object.freeze(u),this.edgesMap.set(l,u);var d=this.predecessorsMap.get(c),h=this.successorsMap.get(f);return hS(d,f),hS(h,c),(o=this.inEdgesMap.get(c))===null||o===void 0||o.set(l,u),(s=this.outEdgesMap.get(f))===null||s===void 0||s.set(l,u),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(e,n,i){var a=Bk(this.isDirected(),e,n,i),o=this.edgesMap.get(a);if(o){var s=pS(this.isDirected(),e,n,i),u=s.v,l=s.w;this.edgesLabelsMap.delete(a),this.edgesMap.delete(a);var f=this.predecessorsMap.get(l),c=this.successorsMap.get(u);vS(f,u),vS(c,l),this.inEdgesMap.get(l).delete(a),this.outEdgesMap.get(u).delete(a),this.edgeCountNum-=1}return this}}]),r}();_u.fromJSON=cZ;function Cm(r){"@babel/helpers - typeof";return Cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cm(r)}function gZ(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function xS(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function yZ(r,t,e){return t&&xS(r.prototype,t),e&&xS(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function iu(){return typeof Reflect<"u"&&Reflect.get?iu=Reflect.get:iu=function(t,e,n){var i=mZ(t,e);if(i){var a=Object.getOwnPropertyDescriptor(i,e);return a.get?a.get.call(arguments.length<3?t:n):a.value}},iu.apply(this,arguments)}function mZ(r,t){for(;!Object.prototype.hasOwnProperty.call(r,t)&&(r=Oo(r),r!==null););return r}function bZ(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),t&&Am(r,t)}function Am(r,t){return Am=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Am(r,t)}function xZ(r){var t=_Z();return function(){var n=Oo(r),i;if(t){var a=Oo(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return wZ(this,i)}}function wZ(r,t){if(t&&(Cm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return EZ(r)}function EZ(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function _Z(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Oo(r){return Oo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Oo(r)}var SZ=function(r){bZ(e,r);var t=xZ(e);function e(){var n;gZ(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=t.call.apply(t,[this].concat(a)),n.eventPool={},n}return yZ(e,[{key:"appendEvent",value:function(i,a){this.eventPool[i]||(this.eventPool[i]=[]),this.eventPool[i].push(a)}},{key:"removeEvent",value:function(i,a){if(this.eventPool[i]){var o=this.eventPool[i].indexOf(a);o>-1&&this.eventPool[i].splice(o,1)}}},{key:"emitEvent",value:function(i){for(var a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];this.eventPool[i]&&this.eventPool[i].forEach(function(u){u.apply(void 0,o)})}},{key:"setNode",value:function(i,a){return iu(Oo(e.prototype),"setNode",this).call(this,i,a),this.emitEvent("nodeAdd",i,a),this}},{key:"removeNode",value:function(i){return iu(Oo(e.prototype),"removeNode",this).call(this,i),this.emitEvent("nodeRemove",i),this}},{key:"setEdge",value:function(i,a,o,s){return iu(Oo(e.prototype),"setEdge",this).call(this,i,a,o,s),this.emitEvent("edgeAdd",i,a,o,s),this}},{key:"removeEdge",value:function(i,a,o){return iu(Oo(e.prototype),"removeEdge",this).call(this,i,a,o),this.emitEvent("edgeRemove",i,a,o),this}}]),e}(_u);function wS(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function MZ(r,t,e){return t&&wS(r.prototype,t),e&&wS(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function CZ(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}var Fk=MZ(function r(){var t=this;CZ(this,r),this.arr=[],this.keyIndice=new Map,this.size=function(){return t.arr.length},this.keys=function(){return t.arr.map(function(e){return e.key})},this.has=function(e){return t.keyIndice.has(e)},this.priority=function(e){var n=t.keyIndice.get(e);if(n!==void 0)return t.arr[n].priority},this.swap=function(e,n){var i=t.arr,a=t.keyIndice,o=[i[e],i[n]],s=o[0],u=o[1];i[e]=u,i[n]=s,a.set(s.key,n),a.set(u.key,e)},this.innerDecrease=function(e){for(var n=t.arr,i=n[e].priority,a,o=e;o!==0;){var s;if(a=o>>1,((s=n[a])===null||s===void 0?void 0:s.priority)<i)break;t.swap(o,a),o=a}},this.heapify=function(e){var n=t.arr,i=e<<1,a=i+1,o=e;i<n.length&&(o=n[i].priority<n[o].priority?i:o,a<n.length&&(o=n[a].priority<n[o].priority?a:o),o!==e&&(t.swap(e,o),t.heapify(o)))},this.min=function(){if(t.size()===0)throw new Error("Queue underflow");return t.arr[0].key},this.add=function(e,n){var i=t.keyIndice,a=t.arr;if(!i.has(e)){var o=a.length;return i.set(e,o),a.push({key:e,priority:n}),t.innerDecrease(o),!0}return!1},this.removeMin=function(){t.swap(0,t.arr.length-1);var e=t.arr.pop();return t.keyIndice.delete(e.key),t.heapify(0),e.key},this.decrease=function(e,n){if(!t.has(e))throw new Error("There's no key named ".concat(e));var i=t.keyIndice.get(e);if(n>t.arr[i].priority)throw new Error("New priority is greater than current priority.Key: ".concat(e," Old: + ").concat(t.arr[i].priority," New: ").concat(n));t.arr[i].priority=n,t.innerDecrease(i)}}),AZ=function(t,e){var n=new _u,i=new Map,a=new Fk,o;function s(f){var c=f.v===o?f.w:f.v,d=a.priority(c);if(d!==void 0){var h=e(f);h<d&&(i.set(c,o),a.decrease(c,h))}}if(t.nodeCount()===0)return n;t.nodes().forEach(function(f){a.add(f,Number.POSITIVE_INFINITY),n.setNode(f)}),a.decrease(t.nodes()[0],0);for(var u=!1;a.size()>0;){var l;if(o=a.removeMin(),i.has(o))n.setEdge(o,i.get(o));else{if(u)throw new Error("Input graph is not connected: "+t.graph());u=!0}(l=t.nodeEdges(o))===null||l===void 0||l.forEach(s)}return n},TZ=function(t){var e=new Set,n=[],i=t.nodes();return i.forEach(function(a){for(var o=[],s=[a];s.length>0;){var u=s.pop();if(!e.has(u)){var l,f;e.add(u),o.push(u),(l=t.successors(u))===null||l===void 0||l.forEach(function(c){return s.push(c)}),(f=t.predecessors(u))===null||f===void 0||f.forEach(function(c){return s.push(c)})}}o.length&&n.push(o)}),n},IZ=function r(t,e,n,i,a,o){i.includes(e)||(i.push(e),n||o.push(e),a(e).forEach(function(s){return r(t,s,n,i,a,o)}),n&&o.push(e))},Ab=function(t,e,n){var i=Array.isArray(e)?e:[e],a=function(l){return t.isDirected()?t.successors(l):t.neighbors(l)},o=[],s=[];return i.forEach(function(u){if(t.hasNode(u))IZ(t,u,n==="post",s,a,o);else throw new Error("Graph does not have node: "+u)}),o};function OZ(r,t){return NZ(r)||DZ(r,t)||kZ(r,t)||LZ()}function LZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
297
|
+
/>`;e.innerHTML=n},r}(),X_=function(){function r(t,e){this.cfg={};var n=ea("marker"),i=eo("marker_");n.setAttribute("id",i);var a=ea("path");a.setAttribute("stroke",t.stroke||"none"),a.setAttribute("fill",t.fill||"none"),n.appendChild(a),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=a,this.id=i;var o=t[e==="marker-start"?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",o===!0?this._setDefaultPath(e,a):(this.cfg=o,this._setMarker(t.lineWidth,a)),this}return r.prototype.match=function(){return!1},r.prototype._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),n.setAttribute("refX",""+10*Math.cos(Math.PI/6)),n.setAttribute("refY","5")},r.prototype._setMarker=function(t,e){var n=this.el,i=this.cfg.path,a=this.cfg.d;wt(i)&&(i=i.map(function(o){return o.join(" ")}).join("")),e.setAttribute("d",i),n.appendChild(e),a&&n.setAttribute("refX",""+a/t)},r.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},r}(),iH=function(){function r(t){this.type="clip",this.cfg={};var e=ea("clipPath");this.el=e,this.id=eo("clip_"),e.id=this.id;var n=t.cfg.el;return e.appendChild(n),this.cfg=t,this}return r.prototype.match=function(){return!1},r.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},r}(),aH=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,oH=function(){function r(t){this.cfg={};var e=ea("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=ea("image");e.appendChild(n);var i=eo("pattern_");e.id=i,this.el=e,this.id=i,this.cfg=t;var a=aH.exec(t),o=a[2];n.setAttribute("href",o);var s=new Image;o.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=o;function u(){e.setAttribute("width",""+s.width),e.setAttribute("height",""+s.height)}return s.complete?u():(s.onload=u,s.src=s.src),this}return r.prototype.match=function(t,e){return this.cfg===e},r}(),sH=function(){function r(t){var e=ea("defs"),n=eo("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return r.prototype.find=function(t,e){for(var n=this.children,i=null,a=0;a<n.length;a++)if(n[a].match(t,e)){i=n[a].id;break}return i},r.prototype.findById=function(t){for(var e=this.children,n=null,i=0;i<e.length;i++)if(e[i].id===t){n=e[i];break}return n},r.prototype.add=function(t){this.children.push(t),t.canvas=this.canvas,t.parent=this},r.prototype.getDefaultArrow=function(t,e){var n=t.stroke||t.strokeStyle;if(this.defaultArrow[n])return this.defaultArrow[n].id;var i=new X_(t,e);return this.defaultArrow[n]=i,this.el.appendChild(i.el),this.add(i),i.id},r.prototype.addGradient=function(t){var e=new eH(t);return this.el.appendChild(e.el),this.add(e),e.id},r.prototype.addArrow=function(t,e){var n=new X_(t,e);return this.el.appendChild(n.el),this.add(n),n.id},r.prototype.addShadow=function(t){var e=new nH(t);return this.el.appendChild(e.el),this.add(e),e.id},r.prototype.addPattern=function(t){var e=new oH(t);return this.el.appendChild(e.el),this.add(e),e.id},r.prototype.addClip=function(t){var e=new iH(t);return this.el.appendChild(e.el),this.add(e),e.id},r}(),Qf=function(r){zt(t,r);function t(e){return r.call(this,F(F({},e),{autoDraw:!0,renderer:"svg"}))||this}return t.prototype.getShapeBase=function(){return y1},t.prototype.getGroupBase=function(){return gk},t.prototype.getShape=function(e,n,i){var a=i.target||i.srcElement;if(!mm[a.tagName]){for(var o=a.parentNode;o&&!mm[o.tagName];)o=o.parentNode;a=o}return this.find(function(s){return s.get("el")===a})},t.prototype.createDom=function(){var e=ea("svg"),n=new sH(e);return e.setAttribute("width",""+this.get("width")),e.setAttribute("height",""+this.get("height")),this.set("context",n),e},t.prototype.onCanvasChange=function(e){var n=this.get("context"),i=this.get("el");if(e==="sort"){var a=this.get("children");a&&a.length&&hk(this,function(s,u){return a.indexOf(s)-a.indexOf(u)?1:0})}else if(e==="clear"){if(i){i.innerHTML="";var o=n.el;o.innerHTML="",i.appendChild(o)}}else e==="matrix"?Wc(this):e==="clip"?_c(this,n):e==="changeSize"&&(i.setAttribute("width",""+this.get("width")),i.setAttribute("height",""+this.get("height")))},t.prototype.draw=function(){var e=this.get("context"),n=this.getChildren();_c(this,e),n.length&&vk(e,n)},t}(GO);function ph(r,t,e){if(r){if(typeof r.addEventListener=="function")return r.addEventListener(t,e,!1),{remove:function(){r.removeEventListener(t,e,!1)}};if(typeof r.attachEvent=="function")return r.attachEvent("on"+t,e),{remove:function(){r.detachEvent("on"+t,e)}}}}var Uf,k0,mk,bm;function uH(){Uf=document.createElement("table"),k0=document.createElement("tr"),mk=/^\s*<(\w+|!)[^>]*>/,bm={tr:document.createElement("tbody"),tbody:Uf,thead:Uf,tfoot:Uf,td:k0,th:k0,"*":document.createElement("div")}}function Ur(r){Uf||uH();var t=mk.test(r)&&RegExp.$1;(!t||!(t in bm))&&(t="*");var e=bm[t];r=typeof r=="string"?r.replace(/(^\s*)|(\s*$)/g,""):r,e.innerHTML=""+r;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function tr(r,t){if(r)for(var e in t)t.hasOwnProperty(e)&&(r.style[e]=t[e]);return r}var bk={exports:{}},lH={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},xk={exports:{}},fH=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},cH=fH,dH=Array.prototype.concat,hH=Array.prototype.slice,Y_=xk.exports=function(t){for(var e=[],n=0,i=t.length;n<i;n++){var a=t[n];cH(a)?e=dH.call(e,hH.call(a)):e.push(a)}return e};Y_.wrap=function(r){return function(){return r(Y_(arguments))}};var vH=xk.exports,Jf=lH,Xc=vH,wk=Object.hasOwnProperty,Ek=Object.create(null);for(var D0 in Jf)wk.call(Jf,D0)&&(Ek[Jf[D0]]=D0);var Ri=bk.exports={to:{},get:{}};Ri.get=function(r){var t=r.substring(0,3).toLowerCase(),e,n;switch(t){case"hsl":e=Ri.get.hsl(r),n="hsl";break;case"hwb":e=Ri.get.hwb(r),n="hwb";break;default:e=Ri.get.rgb(r),n="rgb";break}return e?{model:n,value:e}:null};Ri.get.rgb=function(r){if(!r)return null;var t=/^#([a-f0-9]{3,4})$/i,e=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,o=[0,0,0,1],s,u,l;if(s=r.match(e)){for(l=s[2],s=s[1],u=0;u<3;u++){var f=u*2;o[u]=parseInt(s.slice(f,f+2),16)}l&&(o[3]=parseInt(l,16)/255)}else if(s=r.match(t)){for(s=s[1],l=s[3],u=0;u<3;u++)o[u]=parseInt(s[u]+s[u],16);l&&(o[3]=parseInt(l+l,16)/255)}else if(s=r.match(n)){for(u=0;u<3;u++)o[u]=parseInt(s[u+1],0);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else if(s=r.match(i)){for(u=0;u<3;u++)o[u]=Math.round(parseFloat(s[u+1])*2.55);s[4]&&(s[5]?o[3]=parseFloat(s[4])*.01:o[3]=parseFloat(s[4]))}else return(s=r.match(a))?s[1]==="transparent"?[0,0,0,0]:wk.call(Jf,s[1])?(o=Jf[s[1]],o[3]=1,o):null:null;for(u=0;u<3;u++)o[u]=ys(o[u],0,255);return o[3]=ys(o[3],0,1),o};Ri.get.hsl=function(r){if(!r)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,e=r.match(t);if(e){var n=parseFloat(e[4]),i=(parseFloat(e[1])%360+360)%360,a=ys(parseFloat(e[2]),0,100),o=ys(parseFloat(e[3]),0,100),s=ys(isNaN(n)?1:n,0,1);return[i,a,o,s]}return null};Ri.get.hwb=function(r){if(!r)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,e=r.match(t);if(e){var n=parseFloat(e[4]),i=(parseFloat(e[1])%360+360)%360,a=ys(parseFloat(e[2]),0,100),o=ys(parseFloat(e[3]),0,100),s=ys(isNaN(n)?1:n,0,1);return[i,a,o,s]}return null};Ri.to.hex=function(){var r=Xc(arguments);return"#"+gh(r[0])+gh(r[1])+gh(r[2])+(r[3]<1?gh(Math.round(r[3]*255)):"")};Ri.to.rgb=function(){var r=Xc(arguments);return r.length<4||r[3]===1?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"};Ri.to.rgb.percent=function(){var r=Xc(arguments),t=Math.round(r[0]/255*100),e=Math.round(r[1]/255*100),n=Math.round(r[2]/255*100);return r.length<4||r[3]===1?"rgb("+t+"%, "+e+"%, "+n+"%)":"rgba("+t+"%, "+e+"%, "+n+"%, "+r[3]+")"};Ri.to.hsl=function(){var r=Xc(arguments);return r.length<4||r[3]===1?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"};Ri.to.hwb=function(){var r=Xc(arguments),t="";return r.length>=4&&r[3]!==1&&(t=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+t+")"};Ri.to.keyword=function(r){return Ek[r.slice(0,3)]};function ys(r,t,e){return Math.min(Math.max(t,r),e)}function gh(r){var t=Math.round(r).toString(16).toUpperCase();return t.length<2?"0"+t:t}var pH=bk.exports,_k={exports:{}},gH={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},ou=gH,Sk={};for(var N0 in ou)ou.hasOwnProperty(N0)&&(Sk[ou[N0]]=N0);var kt=_k.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var yi in kt)if(kt.hasOwnProperty(yi)){if(!("channels"in kt[yi]))throw new Error("missing channels property: "+yi);if(!("labels"in kt[yi]))throw new Error("missing channel labels property: "+yi);if(kt[yi].labels.length!==kt[yi].channels)throw new Error("channel and label counts mismatch: "+yi);var yH=kt[yi].channels,mH=kt[yi].labels;delete kt[yi].channels,delete kt[yi].labels,Object.defineProperty(kt[yi],"channels",{value:yH}),Object.defineProperty(kt[yi],"labels",{value:mH})}kt.rgb.hsl=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255,i=Math.min(t,e,n),a=Math.max(t,e,n),o=a-i,s,u,l;return a===i?s=0:t===a?s=(e-n)/o:e===a?s=2+(n-t)/o:n===a&&(s=4+(t-e)/o),s=Math.min(s*60,360),s<0&&(s+=360),l=(i+a)/2,a===i?u=0:l<=.5?u=o/(a+i):u=o/(2-a-i),[s,u*100,l*100]};kt.rgb.hsv=function(r){var t,e,n,i,a,o=r[0]/255,s=r[1]/255,u=r[2]/255,l=Math.max(o,s,u),f=l-Math.min(o,s,u),c=function(d){return(l-d)/6/f+1/2};return f===0?i=a=0:(a=f/l,t=c(o),e=c(s),n=c(u),o===l?i=n-e:s===l?i=1/3+t-n:u===l&&(i=2/3+e-t),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,l*100]};kt.rgb.hwb=function(r){var t=r[0],e=r[1],n=r[2],i=kt.rgb.hsl(r)[0],a=1/255*Math.min(t,Math.min(e,n));return n=1-1/255*Math.max(t,Math.max(e,n)),[i,a*100,n*100]};kt.rgb.cmyk=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255,i,a,o,s;return s=Math.min(1-t,1-e,1-n),i=(1-t-s)/(1-s)||0,a=(1-e-s)/(1-s)||0,o=(1-n-s)/(1-s)||0,[i*100,a*100,o*100,s*100]};function bH(r,t){return Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2)+Math.pow(r[2]-t[2],2)}kt.rgb.keyword=function(r){var t=Sk[r];if(t)return t;var e=1/0,n;for(var i in ou)if(ou.hasOwnProperty(i)){var a=ou[i],o=bH(r,a);o<e&&(e=o,n=i)}return n};kt.keyword.rgb=function(r){return ou[r]};kt.rgb.xyz=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=t*.4124+e*.3576+n*.1805,a=t*.2126+e*.7152+n*.0722,o=t*.0193+e*.1192+n*.9505;return[i*100,a*100,o*100]};kt.rgb.lab=function(r){var t=kt.rgb.xyz(r),e=t[0],n=t[1],i=t[2],a,o,s;return e/=95.047,n/=100,i/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*n-16,o=500*(e-n),s=200*(n-i),[a,o,s]};kt.hsl.rgb=function(r){var t=r[0]/360,e=r[1]/100,n=r[2]/100,i,a,o,s,u;if(e===0)return u=n*255,[u,u,u];n<.5?a=n*(1+e):a=n+e-n*e,i=2*n-a,s=[0,0,0];for(var l=0;l<3;l++)o=t+1/3*-(l-1),o<0&&o++,o>1&&o--,6*o<1?u=i+(a-i)*6*o:2*o<1?u=a:3*o<2?u=i+(a-i)*(2/3-o)*6:u=i,s[l]=u*255;return s};kt.hsl.hsv=function(r){var t=r[0],e=r[1]/100,n=r[2]/100,i=e,a=Math.max(n,.01),o,s;return n*=2,e*=n<=1?n:2-n,i*=a<=1?a:2-a,s=(n+e)/2,o=n===0?2*i/(a+i):2*e/(n+e),[t,o*100,s*100]};kt.hsv.rgb=function(r){var t=r[0]/60,e=r[1]/100,n=r[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*n*(1-e),s=255*n*(1-e*a),u=255*n*(1-e*(1-a));switch(n*=255,i){case 0:return[n,u,o];case 1:return[s,n,o];case 2:return[o,n,u];case 3:return[o,s,n];case 4:return[u,o,n];case 5:return[n,o,s]}};kt.hsv.hsl=function(r){var t=r[0],e=r[1]/100,n=r[2]/100,i=Math.max(n,.01),a,o,s;return s=(2-e)*n,a=(2-e)*i,o=e*i,o/=a<=1?a:2-a,o=o||0,s/=2,[t,o*100,s*100]};kt.hwb.rgb=function(r){var t=r[0]/360,e=r[1]/100,n=r[2]/100,i=e+n,a,o,s,u;i>1&&(e/=i,n/=i),a=Math.floor(6*t),o=1-n,s=6*t-a,a&1&&(s=1-s),u=e+s*(o-e);var l,f,c;switch(a){default:case 6:case 0:l=o,f=u,c=e;break;case 1:l=u,f=o,c=e;break;case 2:l=e,f=o,c=u;break;case 3:l=e,f=u,c=o;break;case 4:l=u,f=e,c=o;break;case 5:l=o,f=e,c=u;break}return[l*255,f*255,c*255]};kt.cmyk.rgb=function(r){var t=r[0]/100,e=r[1]/100,n=r[2]/100,i=r[3]/100,a,o,s;return a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,e*(1-i)+i),s=1-Math.min(1,n*(1-i)+i),[a*255,o*255,s*255]};kt.xyz.rgb=function(r){var t=r[0]/100,e=r[1]/100,n=r[2]/100,i,a,o;return i=t*3.2406+e*-1.5372+n*-.4986,a=t*-.9689+e*1.8758+n*.0415,o=t*.0557+e*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]};kt.xyz.lab=function(r){var t=r[0],e=r[1],n=r[2],i,a,o;return t/=95.047,e/=100,n/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*e-16,a=500*(t-e),o=200*(e-n),[i,a,o]};kt.lab.xyz=function(r){var t=r[0],e=r[1],n=r[2],i,a,o;a=(t+16)/116,i=e/500+a,o=a-n/200;var s=Math.pow(a,3),u=Math.pow(i,3),l=Math.pow(o,3);return a=s>.008856?s:(a-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]};kt.lab.lch=function(r){var t=r[0],e=r[1],n=r[2],i,a,o;return i=Math.atan2(n,e),a=i*360/2/Math.PI,a<0&&(a+=360),o=Math.sqrt(e*e+n*n),[t,o,a]};kt.lch.lab=function(r){var t=r[0],e=r[1],n=r[2],i,a,o;return o=n/360*2*Math.PI,i=e*Math.cos(o),a=e*Math.sin(o),[t,i,a]};kt.rgb.ansi16=function(r){var t=r[0],e=r[1],n=r[2],i=1 in arguments?arguments[1]:kt.rgb.hsv(r)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(n/255)<<2|Math.round(e/255)<<1|Math.round(t/255));return i===2&&(a+=60),a};kt.hsv.ansi16=function(r){return kt.rgb.ansi16(kt.hsv.rgb(r),r[2])};kt.rgb.ansi256=function(r){var t=r[0],e=r[1],n=r[2];if(t===e&&e===n)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;var i=16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(n/255*5);return i};kt.ansi16.rgb=function(r){var t=r%10;if(t===0||t===7)return r>50&&(t+=3.5),t=t/10.5*255,[t,t,t];var e=(~~(r>50)+1)*.5,n=(t&1)*e*255,i=(t>>1&1)*e*255,a=(t>>2&1)*e*255;return[n,i,a]};kt.ansi256.rgb=function(r){if(r>=232){var t=(r-232)*10+8;return[t,t,t]}r-=16;var e,n=Math.floor(r/36)/5*255,i=Math.floor((e=r%36)/6)/5*255,a=e%6/5*255;return[n,i,a]};kt.rgb.hex=function(r){var t=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),e=t.toString(16).toUpperCase();return"000000".substring(e.length)+e};kt.hex.rgb=function(r){var t=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var e=t[0];t[0].length===3&&(e=e.split("").map(function(s){return s+s}).join(""));var n=parseInt(e,16),i=n>>16&255,a=n>>8&255,o=n&255;return[i,a,o]};kt.rgb.hcg=function(r){var t=r[0]/255,e=r[1]/255,n=r[2]/255,i=Math.max(Math.max(t,e),n),a=Math.min(Math.min(t,e),n),o=i-a,s,u;return o<1?s=a/(1-o):s=0,o<=0?u=0:i===t?u=(e-n)/o%6:i===e?u=2+(n-t)/o:u=4+(t-e)/o+4,u/=6,u%=1,[u*360,o*100,s*100]};kt.hsl.hcg=function(r){var t=r[1]/100,e=r[2]/100,n=1,i=0;return e<.5?n=2*t*e:n=2*t*(1-e),n<1&&(i=(e-.5*n)/(1-n)),[r[0],n*100,i*100]};kt.hsv.hcg=function(r){var t=r[1]/100,e=r[2]/100,n=t*e,i=0;return n<1&&(i=(e-n)/(1-n)),[r[0],n*100,i*100]};kt.hcg.rgb=function(r){var t=r[0]/360,e=r[1]/100,n=r[2]/100;if(e===0)return[n*255,n*255,n*255];var i=[0,0,0],a=t%1*6,o=a%1,s=1-o,u=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return u=(1-e)*n,[(e*i[0]+u)*255,(e*i[1]+u)*255,(e*i[2]+u)*255]};kt.hcg.hsv=function(r){var t=r[1]/100,e=r[2]/100,n=t+e*(1-t),i=0;return n>0&&(i=t/n),[r[0],i*100,n*100]};kt.hcg.hsl=function(r){var t=r[1]/100,e=r[2]/100,n=e*(1-t)+.5*t,i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[r[0],i*100,n*100]};kt.hcg.hwb=function(r){var t=r[1]/100,e=r[2]/100,n=t+e*(1-t);return[r[0],(n-t)*100,(1-n)*100]};kt.hwb.hcg=function(r){var t=r[1]/100,e=r[2]/100,n=1-e,i=n-t,a=0;return i<1&&(a=(n-i)/(1-i)),[r[0],i*100,a*100]};kt.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};kt.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};kt.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};kt.gray.hsl=kt.gray.hsv=function(r){return[0,0,r[0]]};kt.gray.hwb=function(r){return[0,100,r[0]]};kt.gray.cmyk=function(r){return[0,0,0,r[0]]};kt.gray.lab=function(r){return[r[0],0,0]};kt.gray.hex=function(r){var t=Math.round(r[0]/100*255)&255,e=(t<<16)+(t<<8)+t,n=e.toString(16).toUpperCase();return"000000".substring(n.length)+n};kt.rgb.gray=function(r){var t=(r[0]+r[1]+r[2])/3;return[t/255*100]};var Mk=_k.exports,Pv=Mk;function xH(){for(var r={},t=Object.keys(Pv),e=t.length,n=0;n<e;n++)r[t[n]]={distance:-1,parent:null};return r}function wH(r){var t=xH(),e=[r];for(t[r].distance=0;e.length;)for(var n=e.pop(),i=Object.keys(Pv[n]),a=i.length,o=0;o<a;o++){var s=i[o],u=t[s];u.distance===-1&&(u.distance=t[n].distance+1,u.parent=n,e.unshift(s))}return t}function EH(r,t){return function(e){return t(r(e))}}function _H(r,t){for(var e=[t[r].parent,r],n=Pv[t[r].parent][r],i=t[r].parent;t[i].parent;)e.unshift(t[i].parent),n=EH(Pv[t[i].parent][i],n),i=t[i].parent;return n.conversion=e,n}var SH=function(r){for(var t=wH(r),e={},n=Object.keys(t),i=n.length,a=0;a<i;a++){var o=n[a],s=t[o];s.parent!==null&&(e[o]=_H(o,t))}return e},xm=Mk,MH=SH,sl={},CH=Object.keys(xm);function AH(r){var t=function(e){return e==null?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),r(e))};return"conversion"in r&&(t.conversion=r.conversion),t}function TH(r){var t=function(e){if(e==null)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=r(e);if(typeof n=="object")for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in r&&(t.conversion=r.conversion),t}CH.forEach(function(r){sl[r]={},Object.defineProperty(sl[r],"channels",{value:xm[r].channels}),Object.defineProperty(sl[r],"labels",{value:xm[r].labels});var t=MH(r),e=Object.keys(t);e.forEach(function(n){var i=t[n];sl[r][n]=TH(i),sl[r][n].raw=AH(i)})});var IH=sl,jf=pH,ki=IH,pb=[].slice,Ck=["keyword","gray","hex"],wm={};Object.keys(ki).forEach(function(r){wm[pb.call(ki[r].labels).sort().join("")]=r});var Rv={};function Vn(r,t){if(!(this instanceof Vn))return new Vn(r,t);if(t&&t in Ck&&(t=null),t&&!(t in ki))throw new Error("Unknown model: "+t);var e,n;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof Vn)this.model=r.model,this.color=r.color.slice(),this.valpha=r.valpha;else if(typeof r=="string"){var i=jf.get(r);if(i===null)throw new Error("Unable to parse color from string: "+r);this.model=i.model,n=ki[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(r.length){this.model=t||"rgb",n=ki[this.model].channels;var a=pb.call(r,0,n);this.color=Em(a,n),this.valpha=typeof r[n]=="number"?r[n]:1}else if(typeof r=="number")r&=16777215,this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;var o=Object.keys(r);"alpha"in r&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof r.alpha=="number"?r.alpha:0);var s=o.sort().join("");if(!(s in wm))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=wm[s];var u=ki[this.model].labels,l=[];for(e=0;e<u.length;e++)l.push(r[u[e]]);this.color=Em(l)}if(Rv[this.model])for(n=ki[this.model].channels,e=0;e<n;e++){var f=Rv[this.model][e];f&&(this.color[e]=f(this.color[e]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Vn.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(r){var t=this.model in jf.to?this:this.rgb();t=t.round(typeof r=="number"?r:1);var e=t.valpha===1?t.color:t.color.concat(this.valpha);return jf.to[t.model](e)},percentString:function(r){var t=this.rgb().round(typeof r=="number"?r:1),e=t.valpha===1?t.color:t.color.concat(this.valpha);return jf.to.rgb.percent(e)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var r={},t=ki[this.model].channels,e=ki[this.model].labels,n=0;n<t;n++)r[e[n]]=this.color[n];return this.valpha!==1&&(r.alpha=this.valpha),r},unitArray:function(){var r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,this.valpha!==1&&r.push(this.valpha),r},unitObject:function(){var r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,this.valpha!==1&&(r.alpha=this.valpha),r},round:function(r){return r=Math.max(r||0,0),new Vn(this.color.map(LH(r)).concat(this.valpha),this.model)},alpha:function(r){return arguments.length?new Vn(this.color.concat(Math.max(0,Math.min(1,r))),this.model):this.valpha},red:fn("rgb",0,Cn(255)),green:fn("rgb",1,Cn(255)),blue:fn("rgb",2,Cn(255)),hue:fn(["hsl","hsv","hsl","hwb","hcg"],0,function(r){return(r%360+360)%360}),saturationl:fn("hsl",1,Cn(100)),lightness:fn("hsl",2,Cn(100)),saturationv:fn("hsv",1,Cn(100)),value:fn("hsv",2,Cn(100)),chroma:fn("hcg",1,Cn(100)),gray:fn("hcg",2,Cn(100)),white:fn("hwb",1,Cn(100)),wblack:fn("hwb",2,Cn(100)),cyan:fn("cmyk",0,Cn(100)),magenta:fn("cmyk",1,Cn(100)),yellow:fn("cmyk",2,Cn(100)),black:fn("cmyk",3,Cn(100)),x:fn("xyz",0,Cn(100)),y:fn("xyz",1,Cn(100)),z:fn("xyz",2,Cn(100)),l:fn("lab",0,Cn(100)),a:fn("lab",1),b:fn("lab",2),keyword:function(r){return arguments.length?new Vn(r):ki[this.model].keyword(this.color)},hex:function(r){return arguments.length?new Vn(r):jf.to.hex(this.rgb().round().color)},rgbNumber:function(){var r=this.rgb().color;return(r[0]&255)<<16|(r[1]&255)<<8|r[2]&255},luminosity:function(){for(var r=this.rgb().color,t=[],e=0;e<r.length;e++){var n=r[e]/255;t[e]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(r){var t=this.luminosity(),e=r.luminosity();return t>e?(t+.05)/(e+.05):(e+.05)/(t+.05)},level:function(r){var t=this.contrast(r);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var r=this.rgb().color,t=(r[0]*299+r[1]*587+r[2]*114)/1e3;return t<128},isLight:function(){return!this.isDark()},negate:function(){for(var r=this.rgb(),t=0;t<3;t++)r.color[t]=255-r.color[t];return r},lighten:function(r){var t=this.hsl();return t.color[2]+=t.color[2]*r,t},darken:function(r){var t=this.hsl();return t.color[2]-=t.color[2]*r,t},saturate:function(r){var t=this.hsl();return t.color[1]+=t.color[1]*r,t},desaturate:function(r){var t=this.hsl();return t.color[1]-=t.color[1]*r,t},whiten:function(r){var t=this.hwb();return t.color[1]+=t.color[1]*r,t},blacken:function(r){var t=this.hwb();return t.color[2]+=t.color[2]*r,t},grayscale:function(){var r=this.rgb().color,t=r[0]*.3+r[1]*.59+r[2]*.11;return Vn.rgb(t,t,t)},fade:function(r){return this.alpha(this.valpha-this.valpha*r)},opaquer:function(r){return this.alpha(this.valpha+this.valpha*r)},rotate:function(r){var t=this.hsl(),e=t.color[0];return e=(e+r)%360,e=e<0?360+e:e,t.color[0]=e,t},mix:function(r,t){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);var e=r.rgb(),n=this.rgb(),i=t===void 0?.5:t,a=2*i-1,o=e.alpha()-n.alpha(),s=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,u=1-s;return Vn.rgb(s*e.red()+u*n.red(),s*e.green()+u*n.green(),s*e.blue()+u*n.blue(),e.alpha()*i+n.alpha()*(1-i))}};Object.keys(ki).forEach(function(r){if(Ck.indexOf(r)===-1){var t=ki[r].channels;Vn.prototype[r]=function(){if(this.model===r)return new Vn(this);if(arguments.length)return new Vn(arguments,r);var e=typeof arguments[t]=="number"?t:this.valpha;return new Vn(kH(ki[this.model][r].raw(this.color)).concat(e),r)},Vn[r]=function(e){return typeof e=="number"&&(e=Em(pb.call(arguments),t)),new Vn(e,r)}}});function OH(r,t){return Number(r.toFixed(t))}function LH(r){return function(t){return OH(t,r)}}function fn(r,t,e){return r=Array.isArray(r)?r:[r],r.forEach(function(n){(Rv[n]||(Rv[n]=[]))[t]=e}),r=r[0],function(n){var i;return arguments.length?(e&&(n=e(n)),i=this[r](),i.color[t]=n,i):(i=this[r]().color[t],e&&(i=e(i)),i)}}function Cn(r){return function(t){return Math.max(0,Math.min(r,t))}}function kH(r){return Array.isArray(r)?r:[r]}function Em(r,t){for(var e=0;e<t;e++)typeof r[e]!="number"&&(r[e]=0);return r}var DH=Vn;const ec=ro(DH);function Bv(r){"@babel/helpers - typeof";return Bv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bv(r)}var NH=/^\s+/,PH=/\s+$/;function Dt(r,t){if(r=r||"",t=t||{},r instanceof Dt)return r;if(!(this instanceof Dt))return new Dt(r,t);var e=RH(r);this._originalInput=r,this._r=e.r,this._g=e.g,this._b=e.b,this._a=e.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||e.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=e.ok}Dt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),e,n,i,a,o,s;return e=t.r/255,n=t.g/255,i=t.b/255,e<=.03928?a=e/12.92:a=Math.pow((e+.055)/1.055,2.4),n<=.03928?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*o+.0722*s},setAlpha:function(t){return this._a=Ak(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=H_(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=H_(this._r,this._g,this._b),e=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this._a==1?"hsv("+e+", "+n+"%, "+i+"%)":"hsva("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var t=V_(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=V_(this._r,this._g,this._b),e=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this._a==1?"hsl("+e+", "+n+"%, "+i+"%)":"hsla("+e+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return K_(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return GH(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Jr(this._r,255)*100)+"%",g:Math.round(Jr(this._g,255)*100)+"%",b:Math.round(Jr(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Jr(this._r,255)*100)+"%, "+Math.round(Jr(this._g,255)*100)+"%, "+Math.round(Jr(this._b,255)*100)+"%)":"rgba("+Math.round(Jr(this._r,255)*100)+"%, "+Math.round(Jr(this._g,255)*100)+"%, "+Math.round(Jr(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:QH[K_(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var e="#"+q_(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=Dt(t);n="#"+q_(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!e&&i&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return a?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return Dt(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(WH,arguments)},brighten:function(){return this._applyModification(XH,arguments)},darken:function(){return this._applyModification(YH,arguments)},desaturate:function(){return this._applyModification($H,arguments)},saturate:function(){return this._applyModification(UH,arguments)},greyscale:function(){return this._applyModification(jH,arguments)},spin:function(){return this._applyModification(VH,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(qH,arguments)},complement:function(){return this._applyCombination(HH,arguments)},monochromatic:function(){return this._applyCombination(ZH,arguments)},splitcomplement:function(){return this._applyCombination(KH,arguments)},triad:function(){return this._applyCombination(Z_,[3])},tetrad:function(){return this._applyCombination(Z_,[4])}};Dt.fromRatio=function(r,t){if(Bv(r)=="object"){var e={};for(var n in r)r.hasOwnProperty(n)&&(n==="a"?e[n]=r[n]:e[n]=Wf(r[n]));r=e}return Dt(r,t)};function RH(r){var t={r:0,g:0,b:0},e=1,n=null,i=null,a=null,o=!1,s=!1;return typeof r=="string"&&(r=rK(r)),Bv(r)=="object"&&(bo(r.r)&&bo(r.g)&&bo(r.b)?(t=BH(r.r,r.g,r.b),o=!0,s=String(r.r).substr(-1)==="%"?"prgb":"rgb"):bo(r.h)&&bo(r.s)&&bo(r.v)?(n=Wf(r.s),i=Wf(r.v),t=zH(r.h,n,i),o=!0,s="hsv"):bo(r.h)&&bo(r.s)&&bo(r.l)&&(n=Wf(r.s),a=Wf(r.l),t=FH(r.h,n,a),o=!0,s="hsl"),r.hasOwnProperty("a")&&(e=r.a)),e=Ak(e),{ok:o,format:r.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:e}}function BH(r,t,e){return{r:Jr(r,255)*255,g:Jr(t,255)*255,b:Jr(e,255)*255}}function V_(r,t,e){r=Jr(r,255),t=Jr(t,255),e=Jr(e,255);var n=Math.max(r,t,e),i=Math.min(r,t,e),a,o,s=(n+i)/2;if(n==i)a=o=0;else{var u=n-i;switch(o=s>.5?u/(2-n-i):u/(n+i),n){case r:a=(t-e)/u+(t<e?6:0);break;case t:a=(e-r)/u+2;break;case e:a=(r-t)/u+4;break}a/=6}return{h:a,s:o,l:s}}function FH(r,t,e){var n,i,a;r=Jr(r,360),t=Jr(t,100),e=Jr(e,100);function o(l,f,c){return c<0&&(c+=1),c>1&&(c-=1),c<1/6?l+(f-l)*6*c:c<1/2?f:c<2/3?l+(f-l)*(2/3-c)*6:l}if(t===0)n=i=a=e;else{var s=e<.5?e*(1+t):e+t-e*t,u=2*e-s;n=o(u,s,r+1/3),i=o(u,s,r),a=o(u,s,r-1/3)}return{r:n*255,g:i*255,b:a*255}}function H_(r,t,e){r=Jr(r,255),t=Jr(t,255),e=Jr(e,255);var n=Math.max(r,t,e),i=Math.min(r,t,e),a,o,s=n,u=n-i;if(o=n===0?0:u/n,n==i)a=0;else{switch(n){case r:a=(t-e)/u+(t<e?6:0);break;case t:a=(e-r)/u+2;break;case e:a=(r-t)/u+4;break}a/=6}return{h:a,s:o,v:s}}function zH(r,t,e){r=Jr(r,360)*6,t=Jr(t,100),e=Jr(e,100);var n=Math.floor(r),i=r-n,a=e*(1-t),o=e*(1-i*t),s=e*(1-(1-i)*t),u=n%6,l=[e,o,a,a,s,e][u],f=[s,e,e,o,a,a][u],c=[a,a,s,e,e,o][u];return{r:l*255,g:f*255,b:c*255}}function K_(r,t,e,n){var i=[pa(Math.round(r).toString(16)),pa(Math.round(t).toString(16)),pa(Math.round(e).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function GH(r,t,e,n,i){var a=[pa(Math.round(r).toString(16)),pa(Math.round(t).toString(16)),pa(Math.round(e).toString(16)),pa(Tk(n))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function q_(r,t,e,n){var i=[pa(Tk(n)),pa(Math.round(r).toString(16)),pa(Math.round(t).toString(16)),pa(Math.round(e).toString(16))];return i.join("")}Dt.equals=function(r,t){return!r||!t?!1:Dt(r).toRgbString()==Dt(t).toRgbString()};Dt.random=function(){return Dt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function $H(r,t){t=t===0?0:t||10;var e=Dt(r).toHsl();return e.s-=t/100,e.s=Np(e.s),Dt(e)}function UH(r,t){t=t===0?0:t||10;var e=Dt(r).toHsl();return e.s+=t/100,e.s=Np(e.s),Dt(e)}function jH(r){return Dt(r).desaturate(100)}function WH(r,t){t=t===0?0:t||10;var e=Dt(r).toHsl();return e.l+=t/100,e.l=Np(e.l),Dt(e)}function XH(r,t){t=t===0?0:t||10;var e=Dt(r).toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(t/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(t/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(t/100)))),Dt(e)}function YH(r,t){t=t===0?0:t||10;var e=Dt(r).toHsl();return e.l-=t/100,e.l=Np(e.l),Dt(e)}function VH(r,t){var e=Dt(r).toHsl(),n=(e.h+t)%360;return e.h=n<0?360+n:n,Dt(e)}function HH(r){var t=Dt(r).toHsl();return t.h=(t.h+180)%360,Dt(t)}function Z_(r,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var e=Dt(r).toHsl(),n=[Dt(r)],i=360/t,a=1;a<t;a++)n.push(Dt({h:(e.h+a*i)%360,s:e.s,l:e.l}));return n}function KH(r){var t=Dt(r).toHsl(),e=t.h;return[Dt(r),Dt({h:(e+72)%360,s:t.s,l:t.l}),Dt({h:(e+216)%360,s:t.s,l:t.l})]}function qH(r,t,e){t=t||6,e=e||30;var n=Dt(r).toHsl(),i=360/e,a=[Dt(r)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(Dt(n));return a}function ZH(r,t){t=t||6;for(var e=Dt(r).toHsv(),n=e.h,i=e.s,a=e.v,o=[],s=1/t;t--;)o.push(Dt({h:n,s:i,v:a})),a=(a+s)%1;return o}Dt.mix=function(r,t,e){e=e===0?0:e||50;var n=Dt(r).toRgb(),i=Dt(t).toRgb(),a=e/100,o={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return Dt(o)};Dt.readability=function(r,t){var e=Dt(r),n=Dt(t);return(Math.max(e.getLuminance(),n.getLuminance())+.05)/(Math.min(e.getLuminance(),n.getLuminance())+.05)};Dt.isReadable=function(r,t,e){var n=Dt.readability(r,t),i,a;switch(a=!1,i=nK(e),i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a};Dt.mostReadable=function(r,t,e){var n=null,i=0,a,o,s,u;e=e||{},o=e.includeFallbackColors,s=e.level,u=e.size;for(var l=0;l<t.length;l++)a=Dt.readability(r,t[l]),a>i&&(i=a,n=Dt(t[l]));return Dt.isReadable(r,n,{level:s,size:u})||!o?n:(e.includeFallbackColors=!1,Dt.mostReadable(r,["#fff","#000"],e))};var _m=Dt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",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:"f0f",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:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",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:"f00",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:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},QH=Dt.hexNames=JH(_m);function JH(r){var t={};for(var e in r)r.hasOwnProperty(e)&&(t[r[e]]=e);return t}function Ak(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}function Jr(r,t){eK(r)&&(r="100%");var e=tK(r);return r=Math.min(t,Math.max(0,parseFloat(r))),e&&(r=parseInt(r*t,10)/100),Math.abs(r-t)<1e-6?1:r%t/parseFloat(t)}function Np(r){return Math.min(1,Math.max(0,r))}function Ti(r){return parseInt(r,16)}function eK(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}function tK(r){return typeof r=="string"&&r.indexOf("%")!=-1}function pa(r){return r.length==1?"0"+r:""+r}function Wf(r){return r<=1&&(r=r*100+"%"),r}function Tk(r){return Math.round(parseFloat(r)*255).toString(16)}function Q_(r){return Ti(r)/255}var ua=function(){var r="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",e="(?:"+t+")|(?:"+r+")",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",i="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function bo(r){return!!ua.CSS_UNIT.exec(r)}function rK(r){r=r.replace(NH,"").replace(PH,"").toLowerCase();var t=!1;if(_m[r])r=_m[r],t=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var e;return(e=ua.rgb.exec(r))?{r:e[1],g:e[2],b:e[3]}:(e=ua.rgba.exec(r))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=ua.hsl.exec(r))?{h:e[1],s:e[2],l:e[3]}:(e=ua.hsla.exec(r))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=ua.hsv.exec(r))?{h:e[1],s:e[2],v:e[3]}:(e=ua.hsva.exec(r))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=ua.hex8.exec(r))?{r:Ti(e[1]),g:Ti(e[2]),b:Ti(e[3]),a:Q_(e[4]),format:t?"name":"hex8"}:(e=ua.hex6.exec(r))?{r:Ti(e[1]),g:Ti(e[2]),b:Ti(e[3]),format:t?"name":"hex"}:(e=ua.hex4.exec(r))?{r:Ti(e[1]+""+e[1]),g:Ti(e[2]+""+e[2]),b:Ti(e[3]+""+e[3]),a:Q_(e[4]+""+e[4]),format:t?"name":"hex8"}:(e=ua.hex3.exec(r))?{r:Ti(e[1]+""+e[1]),g:Ti(e[2]+""+e[2]),b:Ti(e[3]+""+e[3]),format:t?"name":"hex"}:!1}function nK(r){var t,e;return r=r||{level:"AA",size:"small"},t=(r.level||"AA").toUpperCase(),e=(r.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),e!=="small"&&e!=="large"&&(e="small"),{level:t,size:e}}var yh=2,J_=.16,iK=.05,aK=.05,oK=.15,Ik=5,Ok=4,sK=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function eS(r,t,e){var n;return Math.round(r.h)>=60&&Math.round(r.h)<=240?n=e?Math.round(r.h)-yh*t:Math.round(r.h)+yh*t:n=e?Math.round(r.h)+yh*t:Math.round(r.h)-yh*t,n<0?n+=360:n>=360&&(n-=360),n}function tS(r,t,e){if(r.h===0&&r.s===0)return r.s;var n;return e?n=r.s-J_*t:t===Ok?n=r.s+J_:n=r.s+iK*t,n>1&&(n=1),e&&t===Ik&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2))}function rS(r,t,e){var n;return e?n=r.v+aK*t:n=r.v-oK*t,n>1&&(n=1),Number(n.toFixed(2))}function Fv(r){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[],n=Dt(r),i=Ik;i>0;i-=1){var a=n.toHsv(),o=Dt({h:eS(a,i,!0),s:tS(a,i,!0),v:rS(a,i,!0)}).toHexString();e.push(o)}e.push(n.toHexString());for(var s=1;s<=Ok;s+=1){var u=n.toHsv(),l=Dt({h:eS(u,s),s:tS(u,s),v:rS(u,s)}).toHexString();e.push(l)}return t.theme==="dark"?sK.map(function(f){var c=f.index,d=f.opacity,h=Dt.mix(t.backgroundColor||"#141414",e[c],d*100).toHexString();return h}):e}var P0={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},R0={},B0={};Object.keys(P0).forEach(function(r){R0[r]=Fv(P0[r]),R0[r].primary=R0[r][5],B0[r]=Fv(P0[r],{theme:"dark",backgroundColor:"#141414"}),B0[r].primary=B0[r][5]});var In=function(t,e,n){var i=ec(t),a=ec(e);return ec([(1-n)*i.red()+n*a.red(),(1-n)*i.green()+n*a.green(),(1-n)*i.blue()+n*a.blue()]).rgb()},uK=function(t,e,n){e===void 0&&(e="#fff"),n===void 0&&(n="rgb(150, 150, 150)");var i=In(e,t,.05).rgb().toString(),a=In(e,t,.1).rgb().toString(),o=In(e,t,.2).rgb().toString(),s=In(e,t,.4).rgb().toString(),u=In(e,n,.02).rgb().toString(),l=In(e,n,.05).rgb().toString(),f=In(e,n,.1).rgb().toString(),c=In(e,n,.2).rgb().toString(),d=In(e,n,.3).rgb().toString(),h=Fv(t,{theme:"default",backgroundColor:e}),v=ec(t).hex().toLowerCase(),p=h.indexOf(v),g=t;return p!==-1&&(g=h[p+1]),{mainStroke:t,mainFill:a,activeStroke:t,activeFill:i,inactiveStroke:s,inactiveFill:i,selectedStroke:t,selectedFill:e,highlightStroke:g,highlightFill:o,disableStroke:d,disableFill:l,edgeMainStroke:d,edgeActiveStroke:t,edgeInactiveStroke:c,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:f,comboMainStroke:d,comboMainFill:u,comboActiveStroke:t,comboActiveFill:i,comboInactiveStroke:d,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:g,comboHighlightFill:u,comboDisableStroke:c,comboDisableFill:l}},lK=function(t,e,n){e===void 0&&(e="#fff"),n===void 0&&(n="#777");var i=In(e,t,.2).rgb().toString(),a=In(e,t,.3).rgb().toString(),o=In(e,t,.6).rgb().toString(),s=In(e,t,.8).rgb().toString(),u=In(e,n,.2).rgb().toString(),l=In(e,n,.25).rgb().toString(),f=In(e,n,.3).rgb().toString(),c=In(e,n,.4).rgb().toString(),d=In(e,n,.5).rgb().toString(),h=Fv(t,{theme:"dark",backgroundColor:e}),v=ec(t).hex().toLowerCase(),p=h.indexOf(v),g=t;return p!==-1&&(g=h[p+1]),{mainStroke:s,mainFill:i,activeStroke:t,activeFill:a,inactiveStroke:s,inactiveFill:i,selectedStroke:t,selectedFill:i,highlightStroke:t,highlightFill:o,disableStroke:d,disableFill:l,edgeMainStroke:n,edgeActiveStroke:t,edgeInactiveStroke:n,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:f,comboMainStroke:c,comboMainFill:l,comboActiveStroke:t,comboActiveFill:u,comboInactiveStroke:c,comboInactiveFill:l,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:g,comboHighlightFill:l,comboDisableStroke:c,comboDisableFill:u}},gb=function(t,e,n,i){return e===void 0&&(e="#fff"),n===void 0&&(n="default"),n==="default"?uK(t,e,"rgb(150, 150, 150)"):lK(t,e,"#777")},fK=function(t,e,n,i){e===void 0&&(e="#fff"),n===void 0&&(n="default");var a=[];return t.forEach(function(o){a.push(gb(o,e,n))}),a};const cK=Object.freeze(Object.defineProperty({__proto__:null,getColorSetsBySubjectColors:fK,getColorsWithSubjectColor:gb,mixColor:In},Symbol.toStringTag,{value:"Module"}));var dK="rgb(95, 149, 255)",hK="rgb(255, 255, 255)",nS="rgb(0, 0, 0)",pr=gb(dK,hK);const su={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:pr.mainStroke,fill:pr.mainFill},size:20,color:pr.mainStroke,linkPoints:{size:8,lineWidth:1,fill:pr.activeFill,stroke:pr.activeStroke}},nodeStateStyles:{active:{fill:pr.activeFill,stroke:pr.activeStroke,lineWidth:2,shadowColor:pr.mainStroke,shadowBlur:10},selected:{fill:pr.selectedFill,stroke:pr.selectedStroke,lineWidth:4,shadowColor:pr.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:pr.highlightFill,stroke:pr.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:pr.inactiveFill,stroke:pr.inactiveStroke,lineWidth:1},disable:{fill:pr.disableFill,stroke:pr.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:nS,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:pr.edgeMainStroke,lineAppendWidth:2},color:pr.edgeMainStroke},edgeStateStyles:{active:{stroke:pr.edgeActiveStroke,lineWidth:1},selected:{stroke:pr.edgeSelectedStroke,lineWidth:2,shadowColor:pr.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:pr.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:pr.edgeInactiveStroke,lineWidth:1},disable:{stroke:pr.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:nS,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:pr.comboMainFill,lineWidth:1,stroke:pr.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:pr.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:pr.comboActiveStroke,lineWidth:1,fill:pr.comboActiveFill},selected:{stroke:pr.comboSelectedStroke,lineWidth:2,fill:pr.comboSelectedFill,shadowColor:pr.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:pr.comboHighlightStroke,lineWidth:2,fill:pr.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:pr.comboInactiveStroke,fill:pr.comboInactiveFill,lineWidth:1},disable:{stroke:pr.comboDisableStroke,fill:pr.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"};var vK=function(t){var e=t.clone();return pK(t,e),e},pK=function r(t,e){var n;t.isGroup()&&e.isGroup()&&((n=t.get("children"))===null||n===void 0||n.forEach(function(s,u){var l=e.get("children")[u];r(s,l)}));var i=t.get("type"),a=e.get("type");if(!(i!=="image"||a!=="image")){var o=t.get("clipShape");o&&e.setClip({type:o.get("type"),attrs:o.attr()})}},gK=Kn.cloneEvent,yK=Kn.isViewportChanged,mK=function(r){zt(t,r);function t(e){var n=r.call(this,e)||this;return n.extendEvents=[],n.dragging=!1,n.mousedown=!1,n.preItem=null,n.destroy(),n.graph=e,n.destroyed=!1,n.initEvents(),n}return t.prototype.initEvents=function(){var e=this,n=e.graph,i=e.extendEvents,a=i===void 0?[]:i,o=n.get("canvas"),s=o.get("el"),u=tu(this,"onCanvasEvents"),l=tu(this,"onExtendEvents"),f=tu(this,"onWheelEvent");o.off("*").on("*",u),this.canvasHandler=u,a.push(ph(s,"wheel",f)),typeof window<"u"&&(a.push(ph(window,"keydown",l)),a.push(ph(window,"keyup",l)),a.push(ph(window,"focus",l))),this.resetHandler&&n.off("afterchangedata",this.resetHandler),this.resetHandler=tu(this,"resetStatus"),n.on("afterchangedata",this.resetHandler)},t.getItemRoot=function(e){for(;e&&!e.get("item");)e=e.get("parent");return e},t.prototype.onCanvasEvents=function(e){var n=this,i=this.graph,a=i.get("canvas"),o=e.target,s=e.type;switch(s){case"drag":this.onCanvasEvents(Object.assign({},e,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},e,{type:"mouseup"}));break;case"mousedown":this.mousedown=!0;break;case"mouseup":setTimeout(function(){return n.mousedown=!1});break;case"click":if(!this.mousedown)return;break}e.canvasX=e.x,e.canvasY=e.y;var u={x:e.canvasX,y:e.canvasY},l=i.get("group"),f=l.getMatrix();if(f||(f=[1,0,0,0,1,0,0,0,1]),yK(f)&&(u=i.getPointByClient(e.clientX,e.clientY)),e.x=u.x,e.y=u.y,e.currentTarget=i,o===a){(s==="mousemove"||s==="mouseleave")&&this.handleMouseMove(e,"canvas"),e.target=a,e.item=null,i.emit(s,e),i.emit("canvas:".concat(s),e);return}var c=t.getItemRoot(o);if(!c){i.emit(s,e);return}var d=c.get("item");if(!d.destroyed){var h=d.getType();if(e.target=o,e.item=d,e.canvasX===e.x&&e.canvasY===e.y){var v=i.getCanvasByPoint(e.x,e.y);e.canvasX=v.x,e.canvasY=v.y}e.name&&!e.name.includes(":")?(i.emit("".concat(h,":").concat(s),e),i.emit(s,e)):e.name&&i.emit(e.name,e),s==="dragstart"&&(this.dragging=!0),s==="dragend"&&(this.dragging=!1),s==="mousemove"&&this.handleMouseMove(e,h)}},t.prototype.onExtendEvents=function(e){this.graph.emit(e.type,e)},t.prototype.onWheelEvent=function(e){gt(e.wheelDelta)&&(e.wheelDelta=-e.detail),this.graph.emit("wheel",e)},t.prototype.handleMouseMove=function(e,n){var i=this,a=i.graph,o=i.preItem,s=a.get("canvas"),u=e.target===s?null:e.item;e=gK(e),o&&o!==u&&!o.destroyed&&(e.item=o,this.emitCustomEvent(o.getType(),"mouseleave",e),this.dragging&&this.emitCustomEvent(o.getType(),"dragleave",e)),u&&o!==u&&(e.item=u,this.emitCustomEvent(n,"mouseenter",e),this.dragging&&this.emitCustomEvent(n,"dragenter",e)),this.preItem=u},t.prototype.emitCustomEvent=function(e,n,i){i.type=n,this.graph.emit("".concat(e,":").concat(n),i)},t.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},t.prototype.destroy=function(){var e=this,n=e.graph,i=e.canvasHandler,a=e.extendEvents,o=n.get("canvas");o.off("*",i),xe(a,function(s){s.remove()}),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},t}(ML),or={},No={},hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.Base=void 0;var bK=function(){function r(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return r.prototype.layout=function(t){return this.init(t),this.execute(!0)},r.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[],this.comboEdges=t.comboEdges||[],this.hiddenNodes=t.hiddenNodes||[],this.hiddenEdges=t.hiddenEdges||[],this.hiddenCombos=t.hiddenCombos||[],this.vedges=t.vedges||[]},r.prototype.execute=function(t){},r.prototype.executeWithWorker=function(){},r.prototype.getDefaultCfg=function(){return{}},r.prototype.updateCfg=function(t){t&&Object.assign(this,t)},r.prototype.getType=function(){return"base"},r.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},r}();hn.Base=bK;var F0={},Pl={};Object.defineProperty(Pl,"__esModule",{value:!0});Pl.camelize=Pl.isString=void 0;var xK=function(r){return typeof r=="string"};Pl.isString=xK;var wK=function(r){var t=Object.create(null);return function(e){var n=t[e];return n||(t[e]=r(e))}},EK=/-(\w)/g;Pl.camelize=wK(function(r){return r.replace(EK,function(t,e){return e?e.toUpperCase():""})});var Yc={};Object.defineProperty(Yc,"__esModule",{value:!0});Yc.isArray=void 0;Yc.isArray=Array.isArray;var Pp={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.toNumber=r.isNaN=r.isNumber=void 0;var t=function(i){return typeof i=="number"};r.isNumber=t;var e=function(i){return Number.isNaN(Number(i))};r.isNaN=e;var n=function(i){var a=parseFloat(i);return(0,r.isNaN)(a)?i:a};r.toNumber=n})(Pp);var Rp={},yb={};(function(r){var t=_e&&_e.__assign||function(){return t=Object.assign||function(i){for(var a,o=1,s=arguments.length;o<s;o++){a=arguments[o];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(i[u]=a[u])}return i},t.apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0}),r.clone=r.isObject=void 0;var e=function(i){return i!==null&&typeof i=="object"};r.isObject=e;var n=function(i){if(i===null)return i;if(i instanceof Date)return new Date(i.getTime());if(i instanceof Array){var a=[];return i.forEach(function(s){a.push(s)}),a.map(function(s){return(0,r.clone)(s)})}if(typeof i=="object"&&Object.keys(i).length){var o=t({},i);return Object.keys(o).forEach(function(s){o[s]=(0,r.clone)(o[s])}),o}return i};r.clone=n})(yb);(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.getCoreNodeAndRelativeLeafNodes=r.getAvgNodePosition=r.getLayoutBBox=r.traverseTreeUp=r.scaleMatrix=r.getAdjMatrix=r.floydWarshall=r.getDegreeMap=r.getDegree=r.getEdgeTerminal=void 0;var t=Yc,e=Pp,n=yb,i=function(m,b){var x=m[b];return(0,n.isObject)(x)?x.cell:x};r.getEdgeTerminal=i;var a=function(m,b,x){for(var w=[],E=0;E<m;E++)w[E]={in:0,out:0,all:0};return x&&x.forEach(function(_){var M=(0,r.getEdgeTerminal)(_,"source"),C=(0,r.getEdgeTerminal)(_,"target");M&&w[b[M]]&&(w[b[M]].out+=1,w[b[M]].all+=1),C&&w[b[C]]&&(w[b[C]].in+=1,w[b[C]].all+=1)}),w};r.getDegree=a;var o=function(m,b){var x={};return m.forEach(function(w){x[w.id]={in:0,out:0,all:0}}),b&&b.forEach(function(w){var E=(0,r.getEdgeTerminal)(w,"source"),_=(0,r.getEdgeTerminal)(w,"target");E&&(x[E].out+=1,x[E].all+=1),_&&(x[_].in+=1,x[_].all+=1)}),x};r.getDegreeMap=o;var s=function(m){for(var b=[],x=m.length,w=0;w<x;w+=1){b[w]=[];for(var E=0;E<x;E+=1)w===E?b[w][E]=0:m[w][E]===0||!m[w][E]?b[w][E]=1/0:b[w][E]=m[w][E]}for(var _=0;_<x;_+=1)for(var w=0;w<x;w+=1)for(var E=0;E<x;E+=1)b[w][E]>b[w][_]+b[_][E]&&(b[w][E]=b[w][_]+b[_][E]);return b};r.floydWarshall=s;var u=function(m,b){var x=m.nodes,w=m.edges,E=[],_={};if(!x)throw new Error("invalid nodes data!");return x&&x.forEach(function(M,C){_[M.id]=C;var S=[];E.push(S)}),w==null||w.forEach(function(M){var C=(0,r.getEdgeTerminal)(M,"source"),S=(0,r.getEdgeTerminal)(M,"target"),A=_[C],T=_[S];A===void 0||T===void 0||(E[A][T]=1,b||(E[T][A]=1))}),E};r.getAdjMatrix=u;var l=function(m,b){var x=[];return m.forEach(function(w){var E=[];w.forEach(function(_){E.push(_*b)}),x.push(E)}),x};r.scaleMatrix=l;var f=function(m,b){if(m&&m.children){for(var x=m.children.length-1;x>=0;x--)if(!f(m.children[x],b))return}return!!b(m)},c=function(m,b){typeof b=="function"&&f(m,b)};r.traverseTreeUp=c;var d=function(m){var b=1/0,x=1/0,w=-1/0,E=-1/0;return m.forEach(function(_){var M=_.size;(0,t.isArray)(M)?M.length===1&&(M=[M[0],M[0]]):(0,e.isNumber)(M)?M=[M,M]:(M===void 0||isNaN(M))&&(M=[30,30]);var C=[M[0]/2,M[1]/2],S=_.x-C[0],A=_.x+C[0],T=_.y-C[1],I=_.y+C[1];b>S&&(b=S),x>T&&(x=T),w<A&&(w=A),E<I&&(E=I)}),{minX:b,minY:x,maxX:w,maxY:E}};r.getLayoutBBox=d;var h=function(m){var b={x:0,y:0};m.forEach(function(w){b.x+=w.x||0,b.y+=w.y||0});var x=m.length||1;return{x:b.x/x,y:b.y/x}};r.getAvgNodePosition=h;var v=function(m,b,x){var w,E;return m==="source"?((w=x==null?void 0:x.find(function(_){return _.target===b.id}))===null||w===void 0?void 0:w.source)||{}:((E=x==null?void 0:x.find(function(_){return _.source===b.id}))===null||E===void 0?void 0:E.target)||{}},p=function(m,b,x){var w=[];switch(m){case"source":w=x==null?void 0:x.filter(function(_){return _.source===b.id}).map(function(_){return _.target});break;case"target":w=x==null?void 0:x.filter(function(_){return _.target===b.id}).map(function(_){return _.source});break;case"both":w=x==null?void 0:x.filter(function(_){return _.source===b.id}).map(function(_){return _.target}).concat(x==null?void 0:x.filter(function(_){return _.target===b.id}).map(function(_){return _.source}));break}var E=new Set(w);return Array.from(E)},g=function(m,b,x,w,E){var _=x[b]||"",M=(w==null?void 0:w.filter(function(C){return C[b]===_}))||[];return m==="leaf"&&(M=M.filter(function(C){var S,A;return((S=E[C.id])===null||S===void 0?void 0:S.in)===0||((A=E[C.id])===null||A===void 0?void 0:A.out)===0})),M},y=function(m,b,x,w,E,_){var M=E[b.id],C=M.in,S=M.out,A=b,T=[];C===0?(A=v("source",b,x),T=p("both",A,x).map(function(k){return _[k]})):S===0&&(A=v("target",b,x),T=p("both",A,x).map(function(k){return _[k]})),T=T.filter(function(k){return E[k.id]&&(E[k.id].in===0||E[k.id].out===0)});var I=g(m,w,b,T,E);return{coreNode:A,relativeLeafNodes:T,sameTypeLeafNodes:I}};r.getCoreNodeAndRelativeLeafNodes=y})(Rp);var z0={},iS;function _K(){return iS||(iS=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.getFuncByUnknownType=r.getFunc=r.isFunction=void 0;var t=an(),e=Pp,n=function(o){return typeof o=="function"};r.isFunction=n;var i=function(o,s,u){var l;return u?l=u:(0,e.isNumber)(o)?l=function(){return o}:l=function(){return s},l};r.getFunc=i;var a=function(o,s,u){return u===void 0&&(u=!0),!s&&s!==0?function(l){return l.size?(0,t.isArray)(l.size)?l.size[0]>l.size[1]?l.size[0]:l.size[1]:(0,t.isObject)(l.size)?l.size.width>l.size.height?l.size.width:l.size.height:l.size:o}:(0,r.isFunction)(s)?s:(0,e.isNumber)(s)?function(){return s}:(0,t.isArray)(s)?function(){if(u){var l=Math.max.apply(Math,s);return isNaN(l)?o:l}return s}:(0,t.isObject)(s)?function(){if(u){var l=Math.max(s.width,s.height);return isNaN(l)?o:l}return[s.width,s.height]}:function(){return o}};r.getFuncByUnknownType=a}(z0)),z0}var aS;function an(){return aS||(aS=1,function(r){var t=_e&&_e.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,o,s)}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),e=_e&&_e.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(r,"__esModule",{value:!0}),e(Pl,r),e(Yc,r),e(Pp,r),e(Rp,r),e(yb,r),e(_K(),r)}(F0)),F0}var SK=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(No,"__esModule",{value:!0});No.getLayoutByName=No.unRegisterLayout=No.registerLayout=void 0;var MK=hn,CK=an(),ds=new Map,AK=function(r,t){if(ds.get(r)&&console.warn("The layout with the name ".concat(r," exists already, it will be overridden")),(0,CK.isObject)(t)){var e=function(n){SK(i,n);function i(a){var o=this,s;o=n.call(this)||this;var u=o,l={},f=Object.assign({},u.getDefaultCfg(),((s=t.getDefaultCfg)===null||s===void 0?void 0:s.call(t))||{});return Object.assign(l,f,t,a),Object.keys(l).forEach(function(c){var d=l[c];u[c]=d}),o}return i}(MK.Base);ds.set(r,e)}else ds.set(r,t);return ds.get(r)};No.registerLayout=AK;var TK=function(r){ds.has(r)&&ds.delete(r)};No.unRegisterLayout=TK;var IK=function(r){return ds.has(r)?ds.get(r):null};No.getLayoutByName=IK;var G0={},Vc={},OK=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(Vc,"__esModule",{value:!0});Vc.GridLayout=void 0;var Zu=an(),LK=hn,kK=function(r){OK(t,r);function t(e){var n=r.call(this)||this;return n.begin=[0,0],n.preventOverlap=!0,n.preventOverlapPadding=10,n.condense=!1,n.sortBy="degree",n.nodes=[],n.edges=[],n.width=300,n.height=300,n.row=0,n.col=0,n.cellWidth=0,n.cellHeight=0,n.cellUsed={},n.id2manPos={},n.onLayoutEnd=function(){},n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},t.prototype.execute=function(){var e=this,n=e.nodes,i=e.edges,a=e.begin,o=n.length;if(o===0)return e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:i};if(o===1)return n[0].x=a[0],n[0].y=a[1],e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:i};var s=e.sortBy,u=e.width,l=e.height,f=e.condense,c=e.preventOverlapPadding,d=e.preventOverlap,h=e.nodeSpacing,v=e.nodeSize,p=[];n.forEach(function(T){p.push(T)});var g={};if(p.forEach(function(T,I){g[T.id]=I}),(s==="degree"||!(0,Zu.isString)(s)||p[0][s]===void 0)&&(s="degree",(0,Zu.isNaN)(n[0].degree))){var y=(0,Zu.getDegree)(p.length,g,i);p.forEach(function(T,I){T.degree=y[I].all})}p.sort(function(T,I){return I[s]-T[s]}),!u&&typeof window<"u"&&(u=window.innerWidth),!l&&typeof window<"u"&&(l=window.innerHeight);var m=e.rows,b=e.cols!=null?e.cols:e.columns;if(e.cells=o,m!=null&&b!=null?(e.rows=m,e.cols=b):m!=null&&b==null?(e.rows=m,e.cols=Math.ceil(e.cells/e.rows)):m==null&&b!=null?(e.cols=b,e.rows=Math.ceil(e.cells/e.cols)):(e.splits=Math.sqrt(e.cells*e.height/e.width),e.rows=Math.round(e.splits),e.cols=Math.round(e.width/e.height*e.splits)),e.rows=Math.max(e.rows,1),e.cols=Math.max(e.cols,1),e.cols*e.rows>e.cells){var x=e.small(),w=e.large();(x-1)*w>=e.cells?e.small(x-1):(w-1)*x>=e.cells&&e.large(w-1)}else for(;e.cols*e.rows<e.cells;){var x=e.small(),w=e.large();(w+1)*x>=e.cells?e.large(w+1):e.small(x+1)}if(e.cellWidth=u/e.cols,e.cellHeight=l/e.rows,f&&(e.cellWidth=0,e.cellHeight=0),d||h){var E=(0,Zu.getFuncByUnknownType)(10,h),_=(0,Zu.getFuncByUnknownType)(30,v,!1);p.forEach(function(T){(!T.x||!T.y)&&(T.x=0,T.y=0);var I=_(T)||30,k,P;(0,Zu.isArray)(I)?(k=I[0],P=I[1]):(k=I,P=I);var N=E!==void 0?E(T):c,z=k+N,W=P+N;e.cellWidth=Math.max(e.cellWidth,z),e.cellHeight=Math.max(e.cellHeight,W)})}e.cellUsed={},e.row=0,e.col=0,e.id2manPos={};for(var M=0;M<p.length;M++){var C=p[M],S=void 0;if(e.position&&(S=e.position(C)),S&&(S.row!==void 0||S.col!==void 0)){var A={row:S.row,col:S.col};if(A.col===void 0)for(A.col=0;e.used(A.row,A.col);)A.col++;else if(A.row===void 0)for(A.row=0;e.used(A.row,A.col);)A.row++;e.id2manPos[C.id]=A,e.use(A.row,A.col)}e.getPos(C)}return e.onLayoutEnd&&e.onLayoutEnd(),{edges:i,nodes:p}},t.prototype.small=function(e){var n=this,i,a=n.rows||5,o=n.cols||5;if(e==null)i=Math.min(a,o);else{var s=Math.min(a,o);s===n.rows?n.rows=e:n.cols=e}return i},t.prototype.large=function(e){var n=this,i,a=n.rows||5,o=n.cols||5;if(e==null)i=Math.max(a,o);else{var s=Math.max(a,o);s===n.rows?n.rows=e:n.cols=e}return i},t.prototype.used=function(e,n){var i=this;return i.cellUsed["c-".concat(e,"-").concat(n)]||!1},t.prototype.use=function(e,n){var i=this;i.cellUsed["c-".concat(e,"-").concat(n)]=!0},t.prototype.moveToNextCell=function(){var e=this,n=e.cols||5;e.col++,e.col>=n&&(e.col=0,e.row++)},t.prototype.getPos=function(e){var n=this,i=n.begin,a=n.cellWidth,o=n.cellHeight,s,u,l=n.id2manPos[e.id];if(l)s=l.col*a+a/2+i[0],u=l.row*o+o/2+i[1];else{for(;n.used(n.row,n.col);)n.moveToNextCell();s=n.col*a+a/2+i[0],u=n.row*o+o/2+i[1],n.use(n.row,n.col),n.moveToNextCell()}e.x=s,e.y=u},t.prototype.getType=function(){return"grid"},t}(LK.Base);Vc.GridLayout=kK;var Hc={},DK=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(Hc,"__esModule",{value:!0});Hc.RandomLayout=void 0;var NK=hn,PK=function(r){DK(t,r);function t(e){var n=r.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},t.prototype.execute=function(){var e=this,n=e.nodes,i=.9,a=e.center;return!e.width&&typeof window<"u"&&(e.width=window.innerWidth),!e.height&&typeof window<"u"&&(e.height=window.innerHeight),n&&n.forEach(function(o){o.x=(Math.random()-.5)*i*e.width+a[0],o.y=(Math.random()-.5)*i*e.height+a[1]}),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:this.edges}},t.prototype.getType=function(){return"random"},t}(NK.Base);Hc.RandomLayout=PK;var Kc={},RK=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(Kc,"__esModule",{value:!0});Kc.GForceLayout=void 0;var BK=hn,ri=an(),$0=function(r,t){var e;return r?(0,ri.isNumber)(r)?e=function(n){return r}:e=r:e=function(n){return t||1},e},FK=function(r){RK(t,r);function t(e){var n=r.call(this)||this;return n.maxIteration=500,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=1e3,n.minMovement=.5,n.interval=.02,n.factor=1,n.linkDistance=1,n.gravity=10,n.preventOverlap=!0,n.collideStrength=1,n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.animate=!0,n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},t.prototype.execute=function(){var e,n,i=this,a=i.nodes;if(i.timeInterval!==void 0&&typeof window<"u"&&window.clearInterval(i.timeInterval),!a||a.length===0){(e=i.onLayoutEnd)===null||e===void 0||e.call(i);return}!i.width&&typeof window<"u"&&(i.width=window.innerWidth),!i.height&&typeof window<"u"&&(i.height=window.innerHeight),i.center||(i.center=[i.width/2,i.height/2]);var o=i.center;if(a.length===1){a[0].x=o[0],a[0].y=o[1],(n=i.onLayoutEnd)===null||n===void 0||n.call(i);return}var s={},u={};a.forEach(function(v,p){(0,ri.isNumber)(v.x)||(v.x=Math.random()*i.width),(0,ri.isNumber)(v.y)||(v.y=Math.random()*i.height),s[v.id]=v,u[v.id]=p}),i.nodeMap=s,i.nodeIdxMap=u,i.linkDistance=$0(i.linkDistance,1),i.nodeStrength=$0(i.nodeStrength,1),i.edgeStrength=$0(i.edgeStrength,1);var l=i.nodeSize,f;if(i.preventOverlap){var c=i.nodeSpacing,d;(0,ri.isNumber)(c)?d=function(){return c}:(0,ri.isFunction)(c)?d=c:d=function(){return 0},l?(0,ri.isArray)(l)?f=function(v){return Math.max(l[0],l[1])+d(v)}:f=function(v){return l+d(v)}:f=function(v){return v.size?(0,ri.isArray)(v.size)?Math.max(v.size[0],v.size[1])+d(v):(0,ri.isObject)(v.size)?Math.max(v.size.width,v.size.height)+d(v):v.size+d(v):10+d(v)}}i.nodeSize=f;var h=i.edges;i.degrees=(0,ri.getDegree)(a.length,i.nodeIdxMap,h),i.getMass||(i.getMass=function(v){var p=v.mass||i.degrees[i.nodeIdxMap[v.id]].all||1;return p}),i.run()},t.prototype.run=function(){var e,n=this,i=n.maxIteration,a=n.nodes,o=n.workerEnabled,s=n.minMovement,u=n.animate;if(a)if(o||!u){for(var l=0;l<i;l++){var f=n.runOneStep(l);if(n.reachMoveThreshold(a,f,s))break}(e=n.onLayoutEnd)===null||e===void 0||e.call(n)}else{if(typeof window>"u")return;var c=0;this.timeInterval=window.setInterval(function(){var d,h;if(a){var v=n.runOneStep(c)||[];n.reachMoveThreshold(a,v,s)&&((d=n.onLayoutEnd)===null||d===void 0||d.call(n),window.clearInterval(n.timeInterval)),c++,c>=i&&((h=n.onLayoutEnd)===null||h===void 0||h.call(n),window.clearInterval(n.timeInterval))}},0)}},t.prototype.reachMoveThreshold=function(e,n,i){var a=0;return e.forEach(function(o,s){var u=o.x-n[s].x,l=o.y-n[s].y;a+=Math.sqrt(u*u+l*l)}),a/=e.length,a<i},t.prototype.runOneStep=function(e){var n,i=this,a=i.nodes,o=i.edges,s=[],u=[];if(a){a.forEach(function(c,d){s[2*d]=0,s[2*d+1]=0,u[2*d]=0,u[2*d+1]=0}),i.calRepulsive(s,a),o&&i.calAttractive(s,o),i.calGravity(s,a);var l=Math.max(.02,i.interval-e*.002);i.updateVelocity(s,u,l,a);var f=[];return a.forEach(function(c){f.push({x:c.x,y:c.y})}),i.updatePosition(u,l,a),(n=i.tick)===null||n===void 0||n.call(i),f}},t.prototype.calRepulsive=function(e,n){var i=this,a=i.getMass,o=i.factor,s=i.coulombDisScale,u=i.preventOverlap,l=i.collideStrength,f=l===void 0?1:l,c=i.nodeStrength,d=i.nodeSize;n.forEach(function(h,v){var p=a?a(h):1;n.forEach(function(g,y){if(!(v>=y)){var m=h.x-g.x,b=h.y-g.y;m===0&&b===0&&(m=Math.random()*.01,b=Math.random()*.01);var x=m*m+b*b,w=Math.sqrt(x),E=(w+.1)*s,_=m/w,M=b/w,C=(c(h)+c(g))*.5*o/(E*E),S=a?a(g):1;if(e[2*v]+=_*C,e[2*v+1]+=M*C,e[2*y]-=_*C,e[2*y+1]-=M*C,u&&(d(h)+d(g))/2>w){var A=f*(c(h)+c(g))*.5/x;e[2*v]+=_*A/p,e[2*v+1]+=M*A/p,e[2*y]-=_*A/S,e[2*y+1]-=M*A/S}}})})},t.prototype.calAttractive=function(e,n){var i=this,a=i.nodeMap,o=i.nodeIdxMap,s=i.linkDistance,u=i.edgeStrength,l=i.nodeSize,f=i.getMass;n.forEach(function(c,d){var h=(0,ri.getEdgeTerminal)(c,"source"),v=(0,ri.getEdgeTerminal)(c,"target"),p=a[h],g=a[v],y=g.x-p.x,m=g.y-p.y;y===0&&m===0&&(y=Math.random()*.01,m=Math.random()*.01);var b=Math.sqrt(y*y+m*m),x=y/b,w=m/b,E=s(c,p,g)||1+(l(p)+l(g)||0)/2,_=E-b,M=_*u(c),C=o[h],S=o[v],A=f?f(p):1,T=f?f(g):1;e[2*C]-=x*M/A,e[2*C+1]-=w*M/A,e[2*S]+=x*M/T,e[2*S+1]+=w*M/T})},t.prototype.calGravity=function(e,n){for(var i=this,a=i.center,o=i.gravity,s=i.degrees,u=n.length,l=0;l<u;l++){var f=n[l],c=f.x-a[0],d=f.y-a[1],h=o;if(i.getCenter){var v=i.getCenter(f,s[l].all);v&&(0,ri.isNumber)(v[0])&&(0,ri.isNumber)(v[1])&&(0,ri.isNumber)(v[2])&&(c=f.x-v[0],d=f.y-v[1],h=v[2])}h&&(e[2*l]-=h*c,e[2*l+1]-=h*d)}},t.prototype.updateVelocity=function(e,n,i,a){var o=this,s=i*o.damping;a.forEach(function(u,l){var f=e[2*l]*s||.01,c=e[2*l+1]*s||.01,d=Math.sqrt(f*f+c*c);if(d>o.maxSpeed){var h=o.maxSpeed/d;f=h*f,c=h*c}n[2*l]=f,n[2*l+1]=c})},t.prototype.updatePosition=function(e,n,i){i.forEach(function(a,o){if((0,ri.isNumber)(a.fx)&&(0,ri.isNumber)(a.fy)){a.x=a.fx,a.y=a.fy;return}var s=e[2*o]*n,u=e[2*o+1]*n;a.x+=s,a.y+=u})},t.prototype.stop=function(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval)},t.prototype.destroy=function(){var e=this;e.stop(),e.tick=null,e.nodes=null,e.edges=null,e.destroyed=!0},t.prototype.getType=function(){return"gForce"},t}(BK.Base);Kc.GForceLayout=FK;var qc={},Bp={};function zK(r){const t=+this._x.call(null,r),e=+this._y.call(null,r);return Lk(this.cover(t,e),t,e,r)}function Lk(r,t,e,n){if(isNaN(t)||isNaN(e))return r;var i,a=r._root,o={data:n},s=r._x0,u=r._y0,l=r._x1,f=r._y1,c,d,h,v,p,g,y,m;if(!a)return r._root=o,r;for(;a.length;)if((p=t>=(c=(s+l)/2))?s=c:l=c,(g=e>=(d=(u+f)/2))?u=d:f=d,i=a,!(a=a[y=g<<1|p]))return i[y]=o,r;if(h=+r._x.call(null,a.data),v=+r._y.call(null,a.data),t===h&&e===v)return o.next=a,i?i[y]=o:r._root=o,r;do i=i?i[y]=new Array(4):r._root=new Array(4),(p=t>=(c=(s+l)/2))?s=c:l=c,(g=e>=(d=(u+f)/2))?u=d:f=d;while((y=g<<1|p)===(m=(v>=d)<<1|h>=c));return i[m]=a,i[y]=o,r}function GK(r){var t,e,n=r.length,i,a,o=new Array(n),s=new Array(n),u=1/0,l=1/0,f=-1/0,c=-1/0;for(e=0;e<n;++e)isNaN(i=+this._x.call(null,t=r[e]))||isNaN(a=+this._y.call(null,t))||(o[e]=i,s[e]=a,i<u&&(u=i),i>f&&(f=i),a<l&&(l=a),a>c&&(c=a));if(u>f||l>c)return this;for(this.cover(u,l).cover(f,c),e=0;e<n;++e)Lk(this,o[e],s[e],r[e]);return this}function $K(r,t){if(isNaN(r=+r)||isNaN(t=+t))return this;var e=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(e))i=(e=Math.floor(r))+1,a=(n=Math.floor(t))+1;else{for(var o=i-e||1,s=this._root,u,l;e>r||r>=i||n>t||t>=a;)switch(l=(t<n)<<1|r<e,u=new Array(4),u[l]=s,s=u,o*=2,l){case 0:i=e+o,a=n+o;break;case 1:e=i-o,a=n+o;break;case 2:i=e+o,n=a-o;break;case 3:e=i-o,n=a-o;break}this._root&&this._root.length&&(this._root=s)}return this._x0=e,this._y0=n,this._x1=i,this._y1=a,this}function UK(){var r=[];return this.visit(function(t){if(!t.length)do r.push(t.data);while(t=t.next)}),r}function jK(r){return arguments.length?this.cover(+r[0][0],+r[0][1]).cover(+r[1][0],+r[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function hi(r,t,e,n,i){this.node=r,this.x0=t,this.y0=e,this.x1=n,this.y1=i}function WK(r,t,e){var n,i=this._x0,a=this._y0,o,s,u,l,f=this._x1,c=this._y1,d=[],h=this._root,v,p;for(h&&d.push(new hi(h,i,a,f,c)),e==null?e=1/0:(i=r-e,a=t-e,f=r+e,c=t+e,e*=e);v=d.pop();)if(!(!(h=v.node)||(o=v.x0)>f||(s=v.y0)>c||(u=v.x1)<i||(l=v.y1)<a))if(h.length){var g=(o+u)/2,y=(s+l)/2;d.push(new hi(h[3],g,y,u,l),new hi(h[2],o,y,g,l),new hi(h[1],g,s,u,y),new hi(h[0],o,s,g,y)),(p=(t>=y)<<1|r>=g)&&(v=d[d.length-1],d[d.length-1]=d[d.length-1-p],d[d.length-1-p]=v)}else{var m=r-+this._x.call(null,h.data),b=t-+this._y.call(null,h.data),x=m*m+b*b;if(x<e){var w=Math.sqrt(e=x);i=r-w,a=t-w,f=r+w,c=t+w,n=h.data}}return n}function XK(r){if(isNaN(f=+this._x.call(null,r))||isNaN(c=+this._y.call(null,r)))return this;var t,e=this._root,n,i,a,o=this._x0,s=this._y0,u=this._x1,l=this._y1,f,c,d,h,v,p,g,y;if(!e)return this;if(e.length)for(;;){if((v=f>=(d=(o+u)/2))?o=d:u=d,(p=c>=(h=(s+l)/2))?s=h:l=h,t=e,!(e=e[g=p<<1|v]))return this;if(!e.length)break;(t[g+1&3]||t[g+2&3]||t[g+3&3])&&(n=t,y=g)}for(;e.data!==r;)if(i=e,!(e=e.next))return this;return(a=e.next)&&delete e.next,i?(a?i.next=a:delete i.next,this):t?(a?t[g]=a:delete t[g],(e=t[0]||t[1]||t[2]||t[3])&&e===(t[3]||t[2]||t[1]||t[0])&&!e.length&&(n?n[y]=e:this._root=e),this):(this._root=a,this)}function YK(r){for(var t=0,e=r.length;t<e;++t)this.remove(r[t]);return this}function VK(){return this._root}function HK(){var r=0;return this.visit(function(t){if(!t.length)do++r;while(t=t.next)}),r}function KK(r){var t=[],e,n=this._root,i,a,o,s,u;for(n&&t.push(new hi(n,this._x0,this._y0,this._x1,this._y1));e=t.pop();)if(!r(n=e.node,a=e.x0,o=e.y0,s=e.x1,u=e.y1)&&n.length){var l=(a+s)/2,f=(o+u)/2;(i=n[3])&&t.push(new hi(i,l,f,s,u)),(i=n[2])&&t.push(new hi(i,a,f,l,u)),(i=n[1])&&t.push(new hi(i,l,o,s,f)),(i=n[0])&&t.push(new hi(i,a,o,l,f))}return this}function qK(r){var t=[],e=[],n;for(this._root&&t.push(new hi(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var i=n.node;if(i.length){var a,o=n.x0,s=n.y0,u=n.x1,l=n.y1,f=(o+u)/2,c=(s+l)/2;(a=i[0])&&t.push(new hi(a,o,s,f,c)),(a=i[1])&&t.push(new hi(a,f,s,u,c)),(a=i[2])&&t.push(new hi(a,o,c,f,l)),(a=i[3])&&t.push(new hi(a,f,c,u,l))}e.push(n)}for(;n=e.pop();)r(n.node,n.x0,n.y0,n.x1,n.y1);return this}function ZK(r){return r[0]}function QK(r){return arguments.length?(this._x=r,this):this._x}function JK(r){return r[1]}function eq(r){return arguments.length?(this._y=r,this):this._y}function Fp(r,t,e){var n=new mb(t==null?ZK:t,e==null?JK:e,NaN,NaN,NaN,NaN);return r==null?n:n.addAll(r)}function mb(r,t,e,n,i,a){this._x=r,this._y=t,this._x0=e,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function oS(r){for(var t={data:r.data},e=t;r=r.next;)e=e.next={data:r.data};return t}var vi=Fp.prototype=mb.prototype;vi.copy=function(){var r=new mb(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,e,n;if(!t)return r;if(!t.length)return r._root=oS(t),r;for(e=[{source:t,target:r._root=new Array(4)}];t=e.pop();)for(var i=0;i<4;++i)(n=t.source[i])&&(n.length?e.push({source:n,target:t.target[i]=new Array(4)}):t.target[i]=oS(n));return r};vi.add=zK;vi.addAll=GK;vi.cover=$K;vi.data=UK;vi.extent=jK;vi.find=WK;vi.remove=XK;vi.removeAll=YK;vi.root=VK;vi.size=HK;vi.visit=KK;vi.visitAfter=qK;vi.x=QK;vi.y=eq;const tq=Object.freeze(Object.defineProperty({__proto__:null,quadtree:Fp},Symbol.toStringTag,{value:"Module"})),rq=to(tq);Object.defineProperty(Bp,"__esModule",{value:!0});Bp.forceNBody=void 0;var nq=rq,iq=.81,sS=.1;function aq(r,t,e,n,i){var a=e/n,o=r.map(function(u,l){var f=t[u.id],c=f.data,d=f.x,h=f.y,v=f.size,p=c.layout.force.nodeStrength;return{x:d,y:h,size:v,index:l,vx:0,vy:0,weight:a*p}}),s=(0,nq.quadtree)(o,function(u){return u.x},function(u){return u.y}).visitAfter(oq);return o.forEach(function(u){uq(u,s)}),o.map(function(u,l){var f=t[r[l].id],c=f.data.layout.force.mass,d=c===void 0?1:c;i[2*l]=u.vx/d,i[2*l+1]=u.vy/d}),i}Bp.forceNBody=aq;function oq(r){var t=0,e=0,n=0;if(r.length){for(var i=0;i<4;i++){var a=r[i];a&&a.weight&&(t+=a.weight,e+=a.x*a.weight,n+=a.y*a.weight)}r.x=e/t,r.y=n/t,r.weight=t}else{var a=r;r.x=a.data.x,r.y=a.data.y,r.weight=a.data.weight}}var sq=function(r,t,e,n,i,a){var o=a.x-r.x||sS,s=a.y-r.y||sS,u=n-t,l=o*o+s*s,f=Math.sqrt(l)*l;if(u*u*iq<l){var c=r.weight/f;return a.vx+=o*c,a.vy+=s*c,!0}if(r.length)return!1;if(r.data!==a){var c=r.data.weight/f;a.vx+=o*c,a.vy+=s*c}};function uq(r,t){t.visit(function(e,n,i,a,o){return sq(e,n,i,a,o,r)})}var lq=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),la=_e&&_e.__assign||function(){return la=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},la.apply(this,arguments)};Object.defineProperty(qc,"__esModule",{value:!0});qc.Force2Layout=void 0;var fq=hn,An=an(),cq=Bp,U0=function(r,t){var e;return r?(0,An.isNumber)(r)?e=function(n){return r}:e=r:e=function(n){return t||1},e},dq=function(r){lq(t,r);function t(e){var n=r.call(this)||this;n.maxIteration=1e3,n.workerEnabled=!1,n.edgeStrength=200,n.nodeStrength=1e3,n.coulombDisScale=.005,n.damping=.9,n.maxSpeed=500,n.minMovement=.4,n.interval=.02,n.factor=1,n.linkDistance=200,n.gravity=0,n.clusterNodeStrength=20,n.preventOverlap=!0,n.distanceThresholdMode="mean",n.tick=function(){},n.nodes=[],n.edges=[],n.width=300,n.height=300,n.nodeMap={},n.nodeIdxMap={},n.judgingDistance=0,n.centripetalOptions={leaf:2,single:2,others:1,center:function(a){return{x:n.width/2,y:n.height/2}}};var i=e.getMass;return n.propsGetMass=i,n.updateCfg(e),n}return t.prototype.getCentripetalOptions=function(){var e=this,n=e.leafCluster,i=e.clustering,a=e.nodeClusterBy,o=e.nodes,s=e.nodeMap,u=e.clusterNodeStrength,l=function(b){return typeof u=="function"?u(b):u},f={},c;if(n){c=this.getSameTypeLeafMap()||{};var d=Array.from(new Set(o==null?void 0:o.map(function(b){return b[a]})))||[];f={single:100,leaf:function(b,x,w){var E=c[b.id]||{},_=E.relativeLeafNodes,M=E.sameTypeLeafNodes;return(M==null?void 0:M.length)===(_==null?void 0:_.length)||(d==null?void 0:d.length)===1?1:l(b)},others:1,center:function(b,x,w){var E,_=(((E=b.data)===null||E===void 0?void 0:E.layout)||{}).degree;if(!_)return{x:100,y:100};var M;if(_===1){var C=(c[b.id]||{}).sameTypeLeafNodes,S=C===void 0?[]:C;S.length===1?M=void 0:S.length>1&&(M=(0,An.getAvgNodePosition)(S))}else M=void 0;return{x:M==null?void 0:M.x,y:M==null?void 0:M.y}}}}if(i){c||(c=this.getSameTypeLeafMap());var h=Array.from(new Set(o.map(function(b,x){return b[a]}))).filter(function(b){return b!==void 0}),v={};h.forEach(function(b){var x=o.filter(function(w){return w[a]===b}).map(function(w){return s[w.id]});v[b]=(0,An.getAvgNodePosition)(x)}),f={single:function(b){return l(b)},leaf:function(b){return l(b)},others:function(b){return l(b)},center:function(b,x,w){var E=v[b[a]];return{x:E==null?void 0:E.x,y:E==null?void 0:E.y}}}}this.centripetalOptions=la(la({},this.centripetalOptions),f);var p=this.centripetalOptions,g=p.leaf,y=p.single,m=p.others;g&&typeof g!="function"&&(this.centripetalOptions.leaf=function(){return g}),y&&typeof y!="function"&&(this.centripetalOptions.single=function(){return y}),m&&typeof m!="function"&&(this.centripetalOptions.others=function(){return m})},t.prototype.updateCfg=function(e){e&&Object.assign(this,e)},t.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},t.prototype.execute=function(){var e=this;e.stop();var n=e.nodes,i=e.edges,a=e.defSpringLen;if(e.judgingDistance=0,!n||n.length===0){e.onLayoutEnd([]);return}!e.width&&typeof window<"u"&&(e.width=window.innerWidth),!e.height&&typeof window<"u"&&(e.height=window.innerHeight),e.center||(e.center=[e.width/2,e.height/2]);var o=e.center;if(n.length===1){n[0].x=o[0],n[0].y=o[1],e.onLayoutEnd([la({},n[0])]);return}e.degreesMap=(0,An.getDegreeMap)(n,i),e.propsGetMass?e.getMass=e.propsGetMass:e.getMass=function(h){var v=1;(0,An.isNumber)(h.mass)&&(v=h.mass);var p=e.degreesMap[h.id].all;return!p||p<5?v:p*5*v};var s=e.nodeSize,u;if(e.preventOverlap){var l=e.nodeSpacing,f;(0,An.isNumber)(l)?f=function(){return l}:(0,An.isFunction)(l)?f=l:f=function(){return 0},s?(0,An.isArray)(s)?u=function(h){return Math.max(s[0],s[1])+f(h)}:u=function(h){return s+f(h)}:u=function(h){return h.size?(0,An.isArray)(h.size)?Math.max(h.size[0],h.size[1])+f(h):(0,An.isObject)(h.size)?Math.max(h.size.width,h.size.height)+f(h):h.size+f(h):10+f(h)}}e.nodeSize=u,e.linkDistance=U0(e.linkDistance,1),e.nodeStrength=U0(e.nodeStrength,1),e.edgeStrength=U0(e.edgeStrength,1);var c={},d={};n.forEach(function(h,v){(0,An.isNumber)(h.x)||(h.x=Math.random()*e.width),(0,An.isNumber)(h.y)||(h.y=Math.random()*e.height);var p=e.degreesMap[h.id];c[h.id]=la(la({},h),{data:la(la({},h.data),{size:e.nodeSize(h)||30,layout:{inDegree:p.in,outDegree:p.out,degree:p.all,tDegree:p.in,sDegree:p.out,force:{mass:e.getMass(h),nodeStrength:e.nodeStrength(h,i)}}})}),d[h.id]=v}),e.nodeMap=c,e.nodeIdxMap=d,e.edgeInfos=[],i==null||i.forEach(function(h){var v=c[h.source],p=c[h.target];!v||!p?elf.edgeInfos.push({}):e.edgeInfos.push({edgeStrength:e.edgeStrength(h),linkDistance:a?a(la(la({},h),{source:v,target:p}),v,p):e.linkDistance(h,v,p)||1+(s(v)+s(v)||0)/2})}),this.getCentripetalOptions(),e.onLayoutEnd=e.onLayoutEnd||function(){},e.run()},t.prototype.run=function(){var e=this,n=e.maxIteration,i=e.nodes,a=e.edges,o=e.workerEnabled,s=e.minMovement,u=e.animate,l=e.nodeMap,f=e.height;if(e.currentMinY=0,e.currentMaxY=f,!!i){var c=[];if(i.forEach(function(y,m){c[2*m]=0,c[2*m+1]=0}),this.defSideCoe&&typeof this.defSideCoe=="function"){var d={};a.forEach(function(y){var m=y.source,b=y.target;d[m]=d[m]||[],d[m].push(y),d[b]=d[b]||[],d[b].push(y)}),this.relatedEdges=d}var h=n,v=!u;if(o||v){for(var p=0;(e.judgingDistance>s||p<1)&&p<h;p++)e.runOneStep(p,c);e.onLayoutEnd(Object.values(l))}else{if(typeof window>"u")return;var g=0;this.timeInterval=window.setInterval(function(){i&&(e.runOneStep(g,c),g++,(g>=h||e.judgingDistance<s)&&(e.onLayoutEnd(Object.values(l)),window.clearInterval(e.timeInterval)))},0)}}},t.prototype.runOneStep=function(e,n){var i,a=this,o=a.nodes,s=a.edges;a.nodeMap;var u=a.monitor,l=[];if(o!=null&&o.length){a.calRepulsive(l),s&&a.calAttractive(l),a.calGravity(l),a.attractToSide(l);var f=a.interval;if(a.updateVelocity(l,n,f),a.updatePosition(n,f),(i=a.tick)===null||i===void 0||i.call(a),u){var c=this.calTotalEnergy(l);u({energy:c,nodes:o,edges:s,iterations:e})}}},t.prototype.calTotalEnergy=function(e){var n=this,i=n.nodes,a=n.nodeMap;if(!(i!=null&&i.length))return 0;var o=0;return i.forEach(function(s,u){var l=e[2*u],f=e[2*u+1],c=l*l+f*f,d=a[s.id].data.layout.force.mass,h=d===void 0?1:d;o+=h*c*.5}),o},t.prototype.calRepulsive=function(e){var n=this,i=n.nodes,a=n.nodeMap,o=n.factor,s=n.coulombDisScale;n.nodeSize,(0,cq.forceNBody)(i,a,o,s*s,e)},t.prototype.calAttractive=function(e){var n=this,i=n.edges,a=n.nodeMap,o=n.nodeIdxMap,s=n.edgeInfos;n.nodeSize,i.forEach(function(u,l){var f=(0,An.getEdgeTerminal)(u,"source"),c=(0,An.getEdgeTerminal)(u,"target"),d=a[f],h=a[c];if(!(!d||!h)){var v=h.x-d.x,p=h.y-d.y;!v&&!p&&(v=Math.random()*.01,p=Math.random()*.01);var g=Math.sqrt(v*v+p*p),y=v/g,m=p/g,b=s[l]||{},x=b.linkDistance,w=x===void 0?200:x,E=b.edgeStrength,_=E===void 0?200:E,M=w-g,C=M*_,S=d.data.layout.force.mass||1,A=h.data.layout.force.mass||1,T=1/S,I=1/A,k=y*C,P=m*C,N=2*o[f],z=2*o[c];e[N]-=k*T,e[N+1]-=P*T,e[z]+=k*I,e[z+1]+=P*I}})},t.prototype.calGravity=function(e){var n,i=this,a=i.nodes,o=i.edges,s=o===void 0?[]:o,u=i.nodeMap,l=i.width,f=i.height,c=i.center,d=i.gravity,h=i.degreesMap,v=i.centripetalOptions;if(a)for(var p=a.length,g=0;g<p;g++){var y=2*g,m=u[a[g].id],b=m.data.layout.force.mass,x=b===void 0?1:b,w=0,E=0,_=d,M=h[m.id],C=M.in,S=M.out,A=M.all,T=(n=i.getCenter)===null||n===void 0?void 0:n.call(i,m,A);if(T){var I=T[0],k=T[1],P=T[2];w=m.x-I,E=m.y-k,_=P}else w=m.x-c[0],E=m.y-c[1];if(_&&(e[y]-=_*w/x,e[y+1]-=_*E/x),v){var N=v.leaf,z=v.single,W=v.others,D=v.center,R=(D==null?void 0:D(m,a,s,l,f))||{x:0,y:0,centerStrength:0},H=R.x,ee=R.y,Y=R.centerStrength;if(!(0,An.isNumber)(H)||!(0,An.isNumber)(ee))continue;var X=(m.x-H)/x,fe=(m.y-ee)/x;if(Y&&(e[y]-=Y*X,e[y+1]-=Y*fe),A===0){var we=z(m);if(!we)continue;e[y]-=we*X,e[y+1]-=we*fe;continue}if(C===0||S===0){var Ae=N(m,a,s);if(!Ae)continue;e[y]-=Ae*X,e[y+1]-=Ae*fe;continue}var Ke=W(m);if(!Ke)continue;e[y]-=Ke*X,e[y+1]-=Ke*fe}}},t.prototype.attractToSide=function(e){var n=this,i=n.defSideCoe;n.height;var a=n.nodes,o=n.relatedEdges,s=n.currentMinY,u=s===void 0?0:s,l=n.currentMaxY,f=l===void 0?this.height:l;!i||typeof i!="function"||!(a!=null&&a.length)||a.forEach(function(c,d){var h=i(c,o[c.id]||[]);if(h!==0){var v=h<0?u:f,p=Math.abs(h);e[2*d+1]-=p*(c.y-v)}})},t.prototype.updateVelocity=function(e,n,i){var a=this,o=a.nodes,s=a.damping,u=a.maxSpeed;o!=null&&o.length&&o.forEach(function(l,f){var c=(n[2*f]+e[2*f]*i)*s||.01,d=(n[2*f+1]+e[2*f+1]*i)*s||.01,h=Math.sqrt(c*c+d*d);if(h>u){var v=u/h;c=v*c,d=v*d}n[2*f]=c,n[2*f+1]=d})},t.prototype.updatePosition=function(e,n){var i=this,a=i.nodes,o=i.distanceThresholdMode,s=i.nodeMap;if(!(a!=null&&a.length)){this.judgingDistance=0;return}var u=0;o==="max"?i.judgingDistance=-1/0:o==="min"&&(i.judgingDistance=1/0);var l=1/0,f=-1/0;a.forEach(function(c,d){var h=s[c.id];if((0,An.isNumber)(c.fx)&&(0,An.isNumber)(c.fy)){c.x=c.fx,c.y=c.fy,h.x=c.x,h.y=c.y;return}var v=e[2*d]*n,p=e[2*d+1]*n;c.x+=v,c.y+=p,h.x=c.x,h.y=c.y,c.y<l&&(l=c.y),c.y>f&&(f=c.y);var g=Math.sqrt(v*v+p*p);switch(o){case"max":i.judgingDistance<g&&(i.judgingDistance=g);break;case"min":i.judgingDistance>g&&(i.judgingDistance=g);break;default:u=u+g;break}}),this.currentMinY=l,this.currentMaxY=f,(!o||o==="mean")&&(i.judgingDistance=u/a.length)},t.prototype.stop=function(){this.timeInterval&&typeof window<"u"&&window.clearInterval(this.timeInterval)},t.prototype.destroy=function(){var e=this;e.stop(),e.tick=null,e.nodes=null,e.edges=null,e.destroyed=!0},t.prototype.getType=function(){return"force2"},t.prototype.getSameTypeLeafMap=function(){var e=this,n=e.nodeClusterBy,i=e.nodes,a=e.edges,o=e.nodeMap,s=e.degreesMap;if(i!=null&&i.length){var u={};return i.forEach(function(l,f){var c=s[l.id].all;c===1&&(u[l.id]=(0,An.getCoreNodeAndRelativeLeafNodes)("leaf",l,a,n,s,o))}),u}},t}(fq.Base);qc.Force2Layout=dq;var bb={},zp={};function hq(r,t){var e,n=1;r==null&&(r=0),t==null&&(t=0);function i(){var a,o=e.length,s,u=0,l=0;for(a=0;a<o;++a)s=e[a],u+=s.x,l+=s.y;for(u=(u/o-r)*n,l=(l/o-t)*n,a=0;a<o;++a)s=e[a],s.x-=u,s.y-=l}return i.initialize=function(a){e=a},i.x=function(a){return arguments.length?(r=+a,i):r},i.y=function(a){return arguments.length?(t=+a,i):t},i.strength=function(a){return arguments.length?(n=+a,i):n},i}function kn(r){return function(){return r}}function hs(r){return(r()-.5)*1e-6}function vq(r){return r.x+r.vx}function pq(r){return r.y+r.vy}function gq(r){var t,e,n,i=1,a=1;typeof r!="function"&&(r=kn(r==null?1:+r));function o(){for(var l,f=t.length,c,d,h,v,p,g,y=0;y<a;++y)for(c=Fp(t,vq,pq).visitAfter(s),l=0;l<f;++l)d=t[l],p=e[d.index],g=p*p,h=d.x+d.vx,v=d.y+d.vy,c.visit(m);function m(b,x,w,E,_){var M=b.data,C=b.r,S=p+C;if(M){if(M.index>d.index){var A=h-M.x-M.vx,T=v-M.y-M.vy,I=A*A+T*T;I<S*S&&(A===0&&(A=hs(n),I+=A*A),T===0&&(T=hs(n),I+=T*T),I=(S-(I=Math.sqrt(I)))/I*i,d.vx+=(A*=I)*(S=(C*=C)/(g+C)),d.vy+=(T*=I)*S,M.vx-=A*(S=1-S),M.vy-=T*S)}return}return x>h+S||E<h-S||w>v+S||_<v-S}}function s(l){if(l.data)return l.r=e[l.data.index];for(var f=l.r=0;f<4;++f)l[f]&&l[f].r>l.r&&(l.r=l[f].r)}function u(){if(t){var l,f=t.length,c;for(e=new Array(f),l=0;l<f;++l)c=t[l],e[c.index]=+r(c,l,t)}}return o.initialize=function(l,f){t=l,n=f,u()},o.iterations=function(l){return arguments.length?(a=+l,o):a},o.strength=function(l){return arguments.length?(i=+l,o):i},o.radius=function(l){return arguments.length?(r=typeof l=="function"?l:kn(+l),u(),o):r},o}function yq(r){return r.index}function uS(r,t){var e=r.get(t);if(!e)throw new Error("node not found: "+t);return e}function mq(r){var t=yq,e=c,n,i=kn(30),a,o,s,u,l,f=1;r==null&&(r=[]);function c(g){return 1/Math.min(s[g.source.index],s[g.target.index])}function d(g){for(var y=0,m=r.length;y<f;++y)for(var b=0,x,w,E,_,M,C,S;b<m;++b)x=r[b],w=x.source,E=x.target,_=E.x+E.vx-w.x-w.vx||hs(l),M=E.y+E.vy-w.y-w.vy||hs(l),C=Math.sqrt(_*_+M*M),C=(C-a[b])/C*g*n[b],_*=C,M*=C,E.vx-=_*(S=u[b]),E.vy-=M*S,w.vx+=_*(S=1-S),w.vy+=M*S}function h(){if(o){var g,y=o.length,m=r.length,b=new Map(o.map((w,E)=>[t(w,E,o),w])),x;for(g=0,s=new Array(y);g<m;++g)x=r[g],x.index=g,typeof x.source!="object"&&(x.source=uS(b,x.source)),typeof x.target!="object"&&(x.target=uS(b,x.target)),s[x.source.index]=(s[x.source.index]||0)+1,s[x.target.index]=(s[x.target.index]||0)+1;for(g=0,u=new Array(m);g<m;++g)x=r[g],u[g]=s[x.source.index]/(s[x.source.index]+s[x.target.index]);n=new Array(m),v(),a=new Array(m),p()}}function v(){if(o)for(var g=0,y=r.length;g<y;++g)n[g]=+e(r[g],g,r)}function p(){if(o)for(var g=0,y=r.length;g<y;++g)a[g]=+i(r[g],g,r)}return d.initialize=function(g,y){o=g,l=y,h()},d.links=function(g){return arguments.length?(r=g,h(),d):r},d.id=function(g){return arguments.length?(t=g,d):t},d.iterations=function(g){return arguments.length?(f=+g,d):f},d.strength=function(g){return arguments.length?(e=typeof g=="function"?g:kn(+g),v(),d):e},d.distance=function(g){return arguments.length?(i=typeof g=="function"?g:kn(+g),p(),d):i},d}var bq={value:()=>{}};function kk(){for(var r=0,t=arguments.length,e={},n;r<t;++r){if(!(n=arguments[r]+"")||n in e||/[\s.]/.test(n))throw new Error("illegal type: "+n);e[n]=[]}return new tv(e)}function tv(r){this._=r}function xq(r,t){return r.trim().split(/^|\s+/).map(function(e){var n="",i=e.indexOf(".");if(i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}})}tv.prototype=kk.prototype={constructor:tv,on:function(r,t){var e=this._,n=xq(r+"",e),i,a=-1,o=n.length;if(arguments.length<2){for(;++a<o;)if((i=(r=n[a]).type)&&(i=wq(e[i],r.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(r=n[a]).type)e[i]=lS(e[i],r.name,t);else if(t==null)for(i in e)e[i]=lS(e[i],r.name,null);return this},copy:function(){var r={},t=this._;for(var e in t)r[e]=t[e].slice();return new tv(r)},call:function(r,t){if((i=arguments.length-2)>0)for(var e=new Array(i),n=0,i,a;n<i;++n)e[n]=arguments[n+2];if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(a=this._[r],n=0,i=a.length;n<i;++n)a[n].value.apply(t,e)},apply:function(r,t,e){if(!this._.hasOwnProperty(r))throw new Error("unknown type: "+r);for(var n=this._[r],i=0,a=n.length;i<a;++i)n[i].value.apply(t,e)}};function wq(r,t){for(var e=0,n=r.length,i;e<n;++e)if((i=r[e]).name===t)return i.value}function lS(r,t,e){for(var n=0,i=r.length;n<i;++n)if(r[n].name===t){r[n]=bq,r=r.slice(0,n).concat(r.slice(n+1));break}return e!=null&&r.push({name:t,value:e}),r}var Rl=0,Xf=0,Ef=0,Dk=1e3,zv,Yf,Gv=0,pu=0,Gp=0,Sc=typeof performance=="object"&&performance.now?performance:Date,Nk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function Pk(){return pu||(Nk(Eq),pu=Sc.now()+Gp)}function Eq(){pu=0}function Sm(){this._call=this._time=this._next=null}Sm.prototype=Rk.prototype={constructor:Sm,restart:function(r,t,e){if(typeof r!="function")throw new TypeError("callback is not a function");e=(e==null?Pk():+e)+(t==null?0:+t),!this._next&&Yf!==this&&(Yf?Yf._next=this:zv=this,Yf=this),this._call=r,this._time=e,Mm()},stop:function(){this._call&&(this._call=null,this._time=1/0,Mm())}};function Rk(r,t,e){var n=new Sm;return n.restart(r,t,e),n}function _q(){Pk(),++Rl;for(var r=zv,t;r;)(t=pu-r._time)>=0&&r._call.call(null,t),r=r._next;--Rl}function fS(){pu=(Gv=Sc.now())+Gp,Rl=Xf=0;try{_q()}finally{Rl=0,Mq(),pu=0}}function Sq(){var r=Sc.now(),t=r-Gv;t>Dk&&(Gp-=t,Gv=r)}function Mq(){for(var r,t=zv,e,n=1/0;t;)t._call?(n>t._time&&(n=t._time),r=t,t=t._next):(e=t._next,t._next=null,t=r?r._next=e:zv=e);Yf=r,Mm(n)}function Mm(r){if(!Rl){Xf&&(Xf=clearTimeout(Xf));var t=r-pu;t>24?(r<1/0&&(Xf=setTimeout(fS,r-Sc.now()-Gp)),Ef&&(Ef=clearInterval(Ef))):(Ef||(Gv=Sc.now(),Ef=setInterval(Sq,Dk)),Rl=1,Nk(fS))}}const Cq=1664525,Aq=1013904223,cS=4294967296;function Tq(){let r=1;return()=>(r=(Cq*r+Aq)%cS)/cS}function Iq(r){return r.x}function Oq(r){return r.y}var Lq=10,kq=Math.PI*(3-Math.sqrt(5));function Dq(r){var t,e=1,n=.001,i=1-Math.pow(n,1/300),a=0,o=.6,s=new Map,u=Rk(c),l=kk("tick","end"),f=Tq();r==null&&(r=[]);function c(){d(),l.call("tick",t),e<n&&(u.stop(),l.call("end",t))}function d(p){var g,y=r.length,m;p===void 0&&(p=1);for(var b=0;b<p;++b)for(e+=(a-e)*i,s.forEach(function(x){x(e)}),g=0;g<y;++g)m=r[g],m.fx==null?m.x+=m.vx*=o:(m.x=m.fx,m.vx=0),m.fy==null?m.y+=m.vy*=o:(m.y=m.fy,m.vy=0);return t}function h(){for(var p=0,g=r.length,y;p<g;++p){if(y=r[p],y.index=p,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var m=Lq*Math.sqrt(.5+p),b=p*kq;y.x=m*Math.cos(b),y.y=m*Math.sin(b)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function v(p){return p.initialize&&p.initialize(r,f),p}return h(),t={tick:d,restart:function(){return u.restart(c),t},stop:function(){return u.stop(),t},nodes:function(p){return arguments.length?(r=p,h(),s.forEach(v),t):r},alpha:function(p){return arguments.length?(e=+p,t):e},alphaMin:function(p){return arguments.length?(n=+p,t):n},alphaDecay:function(p){return arguments.length?(i=+p,t):+i},alphaTarget:function(p){return arguments.length?(a=+p,t):a},velocityDecay:function(p){return arguments.length?(o=1-p,t):1-o},randomSource:function(p){return arguments.length?(f=p,s.forEach(v),t):f},force:function(p,g){return arguments.length>1?(g==null?s.delete(p):s.set(p,v(g)),t):s.get(p)},find:function(p,g,y){var m=0,b=r.length,x,w,E,_,M;for(y==null?y=1/0:y*=y,m=0;m<b;++m)_=r[m],x=p-_.x,w=g-_.y,E=x*x+w*w,E<y&&(M=_,y=E);return M},on:function(p,g){return arguments.length>1?(l.on(p,g),t):l.on(p)}}}function Nq(){var r,t,e,n,i=kn(-30),a,o=1,s=1/0,u=.81;function l(h){var v,p=r.length,g=Fp(r,Iq,Oq).visitAfter(c);for(n=h,v=0;v<p;++v)t=r[v],g.visit(d)}function f(){if(r){var h,v=r.length,p;for(a=new Array(v),h=0;h<v;++h)p=r[h],a[p.index]=+i(p,h,r)}}function c(h){var v=0,p,g,y=0,m,b,x;if(h.length){for(m=b=x=0;x<4;++x)(p=h[x])&&(g=Math.abs(p.value))&&(v+=p.value,y+=g,m+=g*p.x,b+=g*p.y);h.x=m/y,h.y=b/y}else{p=h,p.x=p.data.x,p.y=p.data.y;do v+=a[p.data.index];while(p=p.next)}h.value=v}function d(h,v,p,g){if(!h.value)return!0;var y=h.x-t.x,m=h.y-t.y,b=g-v,x=y*y+m*m;if(b*b/u<x)return x<s&&(y===0&&(y=hs(e),x+=y*y),m===0&&(m=hs(e),x+=m*m),x<o&&(x=Math.sqrt(o*x)),t.vx+=y*h.value*n/x,t.vy+=m*h.value*n/x),!0;if(h.length||x>=s)return;(h.data!==t||h.next)&&(y===0&&(y=hs(e),x+=y*y),m===0&&(m=hs(e),x+=m*m),x<o&&(x=Math.sqrt(o*x)));do h.data!==t&&(b=a[h.data.index]*n/x,t.vx+=y*b,t.vy+=m*b);while(h=h.next)}return l.initialize=function(h,v){r=h,e=v,f()},l.strength=function(h){return arguments.length?(i=typeof h=="function"?h:kn(+h),f(),l):i},l.distanceMin=function(h){return arguments.length?(o=h*h,l):Math.sqrt(o)},l.distanceMax=function(h){return arguments.length?(s=h*h,l):Math.sqrt(s)},l.theta=function(h){return arguments.length?(u=h*h,l):Math.sqrt(u)},l}function Pq(r,t,e){var n,i=kn(.1),a,o;typeof r!="function"&&(r=kn(+r)),t==null&&(t=0),e==null&&(e=0);function s(l){for(var f=0,c=n.length;f<c;++f){var d=n[f],h=d.x-t||1e-6,v=d.y-e||1e-6,p=Math.sqrt(h*h+v*v),g=(o[f]-p)*a[f]*l/p;d.vx+=h*g,d.vy+=v*g}}function u(){if(n){var l,f=n.length;for(a=new Array(f),o=new Array(f),l=0;l<f;++l)o[l]=+r(n[l],l,n),a[l]=isNaN(o[l])?0:+i(n[l],l,n)}}return s.initialize=function(l){n=l,u()},s.strength=function(l){return arguments.length?(i=typeof l=="function"?l:kn(+l),u(),s):i},s.radius=function(l){return arguments.length?(r=typeof l=="function"?l:kn(+l),u(),s):r},s.x=function(l){return arguments.length?(t=+l,s):t},s.y=function(l){return arguments.length?(e=+l,s):e},s}function Rq(r){var t=kn(.1),e,n,i;typeof r!="function"&&(r=kn(r==null?0:+r));function a(s){for(var u=0,l=e.length,f;u<l;++u)f=e[u],f.vx+=(i[u]-f.x)*n[u]*s}function o(){if(e){var s,u=e.length;for(n=new Array(u),i=new Array(u),s=0;s<u;++s)n[s]=isNaN(i[s]=+r(e[s],s,e))?0:+t(e[s],s,e)}}return a.initialize=function(s){e=s,o()},a.strength=function(s){return arguments.length?(t=typeof s=="function"?s:kn(+s),o(),a):t},a.x=function(s){return arguments.length?(r=typeof s=="function"?s:kn(+s),o(),a):r},a}function Bq(r){var t=kn(.1),e,n,i;typeof r!="function"&&(r=kn(r==null?0:+r));function a(s){for(var u=0,l=e.length,f;u<l;++u)f=e[u],f.vy+=(i[u]-f.y)*n[u]*s}function o(){if(e){var s,u=e.length;for(n=new Array(u),i=new Array(u),s=0;s<u;++s)n[s]=isNaN(i[s]=+r(e[s],s,e))?0:+t(e[s],s,e)}}return a.initialize=function(s){e=s,o()},a.strength=function(s){return arguments.length?(t=typeof s=="function"?s:kn(+s),o(),a):t},a.y=function(s){return arguments.length?(r=typeof s=="function"?s:kn(+s),o(),a):r},a}const Fq=Object.freeze(Object.defineProperty({__proto__:null,forceCenter:hq,forceCollide:gq,forceLink:mq,forceManyBody:Nq,forceRadial:Pq,forceSimulation:Dq,forceX:Rq,forceY:Bq},Symbol.toStringTag,{value:"Module"})),xb=to(Fq);var wb={},zq=_e&&_e.__createBinding||(Object.create?function(r,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,i)}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]}),Gq=_e&&_e.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),$q=_e&&_e.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.prototype.hasOwnProperty.call(r,e)&&zq(t,r,e);return Gq(t,r),t};Object.defineProperty(wb,"__esModule",{value:!0});var Qu=$q(xb),mh=an();function Uq(){function r(X){return function(){return X}}var t=function(X){return X.cluster},e=r(1),n=r(-1),i=r(100),a=r(.1),o=[0,0],s=[],u={},l=[],f=100,c=100,d={none:{x:0,y:0}},h=[],v,p="force",g=!0,y=.1;function m(X){if(!g)return m;v.tick(),M();for(var fe=0,we=s.length,Ae=void 0,Ke=X*y;fe<we;++fe)Ae=s[fe],Ae.vx+=(d[t(Ae)].x-Ae.x)*Ke,Ae.vy+=(d[t(Ae)].y-Ae.y)*Ke}function b(){s&&x()}function x(){if(!(!s||!s.length)){if(t(s[0])===void 0)throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var X=w();v=Qu.forceSimulation(X.nodes).force("x",Qu.forceX(f).strength(.1)).force("y",Qu.forceY(c).strength(.1)).force("collide",Qu.forceCollide(function(fe){return fe.r}).iterations(4)).force("charge",Qu.forceManyBody().strength(n)).force("links",Qu.forceLink(X.nodes.length?X.links:[]).distance(i).strength(a)),h=v.nodes(),M()}}function w(){var X=[],fe=[],we={},Ae=[],Ke={},ot=[];return Ke=E(s),ot=_(l),Ae=Object.keys(Ke),Ae.forEach(function(nt,Ct){var Et=Ke[nt];X.push({id:nt,size:Et.count,r:Math.sqrt(Et.sumforceNodeSize/Math.PI)}),we[nt]=Ct}),ot.forEach(function(nt){var Ct=(0,mh.getEdgeTerminal)(nt,"source"),Et=(0,mh.getEdgeTerminal)(nt,"target"),fr=we[Ct],Gt=we[Et];fr!==void 0&&Gt!==void 0&&fe.push({source:fr,target:Gt,count:nt.count})}),{nodes:X,links:fe}}function E(X){var fe={};return X.forEach(function(we){var Ae=t(we);fe[Ae]||(fe[Ae]={count:0,sumforceNodeSize:0})}),X.forEach(function(we){var Ae=t(we),Ke=e(we),ot=fe[Ae];ot.count=ot.count+1,ot.sumforceNodeSize=ot.sumforceNodeSize+Math.PI*(Ke*Ke)*1.3,fe[Ae]=ot}),fe}function _(X){var fe={},we=[];X.forEach(function(Ke){var ot=C(Ke),nt=0;fe[ot]!==void 0&&(nt=fe[ot]),nt+=1,fe[ot]=nt});var Ae=Object.entries(fe);return Ae.forEach(function(Ke){var ot=Ke[0],nt=Ke[1],Ct=ot.split("~")[0],Et=ot.split("~")[1];Ct!==void 0&&Et!==void 0&&we.push({source:Ct,target:Et,count:nt})}),we}function M(){return d={none:{x:0,y:0}},h.forEach(function(X){d[X.id]={x:X.x-o[0],y:X.y-o[1]}}),d}function C(X){var fe=(0,mh.getEdgeTerminal)(X,"source"),we=(0,mh.getEdgeTerminal)(X,"target"),Ae=t(u[fe]),Ke=t(u[we]);return Ae<=Ke?"".concat(Ae,"~").concat(Ke):"".concat(Ke,"~").concat(Ae)}function S(X){u={},X.forEach(function(fe){u[fe.id]=fe})}function A(X){return arguments.length?(p=X,b(),m):p}function T(X){return arguments.length?typeof X=="string"?(t=function(fe){return fe[X]},m):(t=X,m):t}function I(X){return arguments.length?(g=X,m):g}function k(X){return arguments.length?(y=X,m):y}function P(X){return arguments.length?(f=X,m):f}function N(X){return arguments.length?(c=X,m):c}function z(X){return arguments.length?(S(X||[]),s=X||[],m):s}function W(X){return arguments.length?(l=X||[],b(),m):l}function D(X){return arguments.length?(typeof X=="function"?e=X:e=r(+X),b(),m):e}function R(X){return arguments.length?(typeof X=="function"?n=X:n=r(+X),b(),m):n}function H(X){return arguments.length?(typeof X=="function"?i=X:i=r(+X),b(),m):i}function ee(X){return arguments.length?(typeof X=="function"?a=X:a=r(+X),b(),m):a}function Y(X){return arguments.length?(o=X,m):o}return m.initialize=function(X){s=X,b()},m.template=A,m.groupBy=T,m.enableGrouping=I,m.strength=k,m.centerX=P,m.centerY=N,m.nodes=z,m.links=W,m.forceNodeSize=D,m.nodeSize=m.forceNodeSize,m.forceCharge=R,m.forceLinkDistance=H,m.forceLinkStrength=ee,m.offset=Y,m.getFocis=M,m}wb.default=Uq;var Ro={};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.FORCE_LAYOUT_TYPE_MAP=Ro.LAYOUT_MESSAGE=void 0;Ro.LAYOUT_MESSAGE={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};Ro.FORCE_LAYOUT_TYPE_MAP={gForce:!0,force2:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0};var jq=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Wq=_e&&_e.__createBinding||(Object.create?function(r,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(r,n,i)}:function(r,t,e,n){n===void 0&&(n=e),r[n]=t[e]}),Xq=_e&&_e.__setModuleDefault||(Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t}),Yq=_e&&_e.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var e in r)e!=="default"&&Object.prototype.hasOwnProperty.call(r,e)&&Wq(t,r,e);return Xq(t,r),t},Vq=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zp,"__esModule",{value:!0});zp.ForceLayout=void 0;var Ju=Yq(xb),Hq=Vq(wb),js=an(),Kq=hn,qq=Ro,Zq=function(r){jq(t,r);function t(e){var n=r.call(this)||this;return n.center=[0,0],n.nodeStrength=null,n.edgeStrength=null,n.preventOverlap=!1,n.clusterNodeStrength=null,n.clusterEdgeStrength=null,n.clusterEdgeDistance=null,n.clusterNodeSize=null,n.clusterFociStrength=null,n.linkDistance=50,n.alphaDecay=.028,n.alphaMin=.001,n.alpha=.3,n.collideStrength=1,n.workerEnabled=!1,n.tick=function(){},n.onLayoutEnd=function(){},n.ticking=void 0,e&&n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},t.prototype.init=function(e){var n=this;n.nodes=e.nodes||[];var i=e.edges||[];n.edges=i.map(function(a){var o={},s=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys(a).forEach(function(u){s.indexOf(u)>-1||(o[u]=a[u])}),o}),n.ticking=!1},t.prototype.execute=function(e){var n=this,i=n.nodes,a=n.edges;if(!n.ticking){var o=n.forceSimulation,s=n.alphaMin,u=n.alphaDecay,l=n.alpha;if(o){if(e){if(n.clustering&&n.clusterForce&&(n.clusterForce.nodes(i),n.clusterForce.links(a)),o.nodes(i),a&&n.edgeForce)n.edgeForce.links(a);else if(a&&!n.edgeForce){var d=Ju.forceLink().id(function(g){return g.id}).links(a);n.edgeStrength&&d.strength(n.edgeStrength),n.linkDistance&&d.distance(n.linkDistance),n.edgeForce=d,o.force("link",d)}}n.preventOverlap&&n.overlapProcess(o),o.alpha(l).restart(),this.ticking=!0}else try{var f=Ju.forceManyBody();if(n.nodeStrength&&f.strength(n.nodeStrength),o=Ju.forceSimulation().nodes(i),n.clustering){var c=(0,Hq.default)();c.centerX(n.center[0]).centerY(n.center[1]).template("force").strength(n.clusterFociStrength),a&&c.links(a),i&&c.nodes(i),c.forceLinkDistance(n.clusterEdgeDistance).forceLinkStrength(n.clusterEdgeStrength).forceCharge(n.clusterNodeStrength).forceNodeSize(n.clusterNodeSize),n.clusterForce=c,o.force("group",c)}if(o.force("center",Ju.forceCenter(n.center[0],n.center[1])).force("charge",f).alpha(l).alphaDecay(u).alphaMin(s),n.preventOverlap&&n.overlapProcess(o),a){var d=Ju.forceLink().id(function(p){return p.id}).links(a);n.edgeStrength&&d.strength(n.edgeStrength),n.linkDistance&&d.distance(n.linkDistance),n.edgeForce=d,o.force("link",d)}if(n.workerEnabled&&!Jq()&&(n.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),!n.workerEnabled)o.on("tick",function(){n.tick()}).on("end",function(){n.ticking=!1,n.onLayoutEnd&&n.onLayoutEnd()}),n.ticking=!0;else{o.stop();for(var h=Qq(o),v=1;v<=h;v++)o.tick(),postMessage({nodes:i,currentTick:v,totalTicks:h,type:qq.LAYOUT_MESSAGE.TICK},void 0);n.ticking=!1}n.forceSimulation=o,n.ticking=!0}catch(p){n.ticking=!1,console.warn(p)}}},t.prototype.overlapProcess=function(e){var n=this,i=n.nodeSize,a=n.nodeSpacing,o,s,u=n.collideStrength;if((0,js.isNumber)(a)?s=function(){return a}:(0,js.isFunction)(a)?s=a:s=function(){return 0},!i)o=function(d){if(d.size){if((0,js.isArray)(d.size)){var h=d.size[0]>d.size[1]?d.size[0]:d.size[1];return h/2+s(d)}if((0,js.isObject)(d.size)){var h=d.size.width>d.size.height?d.size.width:d.size.height;return h/2+s(d)}return d.size/2+s(d)}return 10+s(d)};else if((0,js.isFunction)(i))o=function(d){var h=i(d);return h+s(d)};else if((0,js.isArray)(i)){var l=i[0]>i[1]?i[0]:i[1],f=l/2;o=function(d){return f+s(d)}}else if((0,js.isNumber)(i)){var c=i/2;o=function(d){return c+s(d)}}else o=function(){return 10};e.force("collisionForce",Ju.forceCollide(o).strength(u))},t.prototype.updateCfg=function(e){var n=this;n.ticking&&(n.forceSimulation.stop(),n.ticking=!1),n.forceSimulation=null,Object.assign(n,e)},t.prototype.destroy=function(){var e=this;e.ticking&&(e.forceSimulation.stop(),e.ticking=!1),e.nodes=null,e.edges=null,e.destroyed=!0},t}(Kq.Base);zp.ForceLayout=Zq;function Qq(r){var t=r.alphaMin(),e=r.alphaTarget(),n=r.alpha(),i=Math.log((t-e)/(n-e))/Math.log(1-r.alphaDecay()),a=Math.ceil(i);return a}function Jq(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}(function(r){var t=_e&&_e.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a);var s=Object.getOwnPropertyDescriptor(i,a);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[a]}}),Object.defineProperty(n,o,s)}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),e=_e&&_e.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&t(i,n,a)};Object.defineProperty(r,"__esModule",{value:!0}),e(zp,r)})(bb);var Zc={},eZ=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(Zc,"__esModule",{value:!0});Zc.CircularLayout=void 0;var tZ=hn,Ya=an();function rZ(r,t,e,n){r.forEach(function(i,a){r[a].children=[],r[a].parent=[]}),n?t.forEach(function(i){var a=(0,Ya.getEdgeTerminal)(i,"source"),o=(0,Ya.getEdgeTerminal)(i,"target"),s=0;a&&(s=e[a]);var u=0;o&&(u=e[o]);var l=r[s].children,f=r[u].parent;l.push(r[u].id),f.push(r[s].id)}):t.forEach(function(i){var a=(0,Ya.getEdgeTerminal)(i,"source"),o=(0,Ya.getEdgeTerminal)(i,"target"),s=0;a&&(s=e[a]);var u=0;o&&(u=e[o]);var l=r[s].children,f=r[u].children;l.push(r[u].id),f.push(r[s].id)})}function nZ(r,t,e){for(var n=e.length,i=0;i<n;i++){var a=(0,Ya.getEdgeTerminal)(e[i],"source"),o=(0,Ya.getEdgeTerminal)(e[i],"target");if(r.id===a&&t.id===o||t.id===a&&r.id===o)return!0}return!1}function iZ(r,t){var e=r.degree,n=t.degree;return e<n?-1:e>n?1:0}var aZ=function(r){eZ(t,r);function t(e){var n=r.call(this)||this;return n.radius=null,n.nodeSize=void 0,n.startRadius=null,n.endRadius=null,n.startAngle=0,n.endAngle=2*Math.PI,n.clockwise=!0,n.divisions=1,n.ordering=null,n.angleRatio=1,n.nodes=[],n.edges=[],n.nodeMap={},n.degrees=[],n.width=300,n.height=300,n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},t.prototype.execute=function(){var e,n=this,i=n.nodes,a=n.edges,o=i.length;if(o===0){n.onLayoutEnd&&n.onLayoutEnd();return}!n.width&&typeof window<"u"&&(n.width=window.innerWidth),!n.height&&typeof window<"u"&&(n.height=window.innerHeight),n.center||(n.center=[n.width/2,n.height/2]);var s=n.center;if(o===1){i[0].x=s[0],i[0].y=s[1],n.onLayoutEnd&&n.onLayoutEnd();return}var u=n.radius,l=n.startRadius,f=n.endRadius,c=n.divisions,d=n.startAngle,h=n.endAngle,v=n.angleRatio,p=n.ordering,g=n.clockwise,y=n.nodeSpacing,m=n.nodeSize,b=(h-d)/o,x={};i.forEach(function(N,z){x[N.id]=z}),n.nodeMap=x;var w=(0,Ya.getDegree)(i.length,x,a);if(n.degrees=w,y){var E=(0,Ya.getFuncByUnknownType)(10,y),_=(0,Ya.getFuncByUnknownType)(10,m),M=-1/0;i.forEach(function(N){var z=_(N);M<z&&(M=z)});var C=0;i.forEach(function(N,z){z===0?C+=M||10:C+=(E(N)||0)+(M||10)}),u=C/(2*Math.PI)}else!u&&!l&&!f?u=n.height>n.width?n.width/2:n.height/2:!l&&f?l=f:l&&!f&&(f=l);var S=b*v,A=[];p==="topology"?A=n.topologyOrdering():p==="topology-directed"?A=n.topologyOrdering(!0):p==="degree"?A=n.degreeOrdering():A=i;for(var T=Math.ceil(o/c),I=0;I<o;++I){var k=u;!k&&l!==null&&f!==null&&(k=l+I*(f-l)/(o-1)),k||(k=10+I*100/(o-1));var P=d+I%T*S+2*Math.PI/c*Math.floor(I/T);g||(P=h-I%T*S-2*Math.PI/c*Math.floor(I/T)),A[I].x=s[0]+Math.cos(P)*k,A[I].y=s[1]+Math.sin(P)*k,A[I].weight=w[I].all}return(e=n.onLayoutEnd)===null||e===void 0||e.call(n),{nodes:A,edges:this.edges}},t.prototype.topologyOrdering=function(e){e===void 0&&(e=!1);var n=this,i=n.degrees,a=n.edges,o=n.nodes,s=(0,Ya.clone)(o),u=n.nodeMap,l=[s[0]],f=[o[0]],c=[],d=o.length;c[0]=!0,rZ(s,a,u,e);var h=0;return s.forEach(function(v,p){if(p!==0)if((p===d-1||i[p].all!==i[p+1].all||nZ(l[h],v,a))&&!c[p])l.push(v),f.push(o[u[v.id]]),c[p]=!0,h++;else{for(var g=l[h].children,y=!1,m=0;m<g.length;m++){var b=u[g[m]];if(i[b].all===i[p].all&&!c[b]){l.push(s[b]),f.push(o[u[s[b].id]]),c[b]=!0,y=!0;break}}for(var x=0;!y&&(c[x]||(l.push(s[x]),f.push(o[u[s[x].id]]),c[x]=!0,y=!0),x++,x!==d););}}),f},t.prototype.degreeOrdering=function(){var e=this,n=e.nodes,i=[],a=e.degrees;return n.forEach(function(o,s){o.degree=a[s].all,i.push(o)}),i.sort(iZ),i},t.prototype.getType=function(){return"circular"},t}(tZ.Base);Zc.CircularLayout=aZ;var Kl={},Eb={},_b={},Sb={},Mb={},Cb={};Object.defineProperty(Cb,"__esModule",{value:!0});var oZ=function(r,t){if(r!=="next"&&r!=="prev")return t},dS=function(r){r.prev.next=r.next,r.next.prev=r.prev,delete r.next,delete r.prev},sZ=function(){function r(){var t={};t.prev=t,t.next=t.prev,this.shortcut=t}return r.prototype.dequeue=function(){var t=this.shortcut,e=t.prev;if(e&&e!==t)return dS(e),e},r.prototype.enqueue=function(t){var e=this.shortcut;t.prev&&t.next&&dS(t),t.next=e.next,e.next.prev=t,e.next=t,t.prev=e},r.prototype.toString=function(){for(var t=[],e=this.shortcut,n=e.prev;n!==e;)t.push(JSON.stringify(n,oZ)),n=n==null?void 0:n.prev;return"[".concat(t.join(", "),"]")},r}();Cb.default=sZ;var El;(function(r){r.DEFAULT_EDGE_NAME="\0",r.GRAPH_NODE="\0",r.EDGE_KEY_DELIM=""})(El||(El={}));function hS(r,t){var e=r.get(t)||0;r.set(t,e+1)}function vS(r,t){var e=r.get(t);e!==void 0&&(e=e-1,e>0?r.set(t,e):r.delete(t))}function Bk(r,t,e,n){var i=String(t),a=String(e);if(!r&&i>a){var o=i;i=a,a=o}return i+El.EDGE_KEY_DELIM+a+El.EDGE_KEY_DELIM+(n===void 0?El.DEFAULT_EDGE_NAME:n)}function pS(r,t,e,n){var i=String(t),a=String(e),o={v:t,w:e};if(!r&&i>a){var s=o.v;o.v=o.w,o.w=s}return n!==void 0&&(o.name=n),o}function j0(r,t){return Bk(r,t.v,t.w,t.name)}function gS(r){return typeof r=="function"}var uZ=function(t){return t.nodes().map(function(e){var n=t.node(e),i=t.parent(e),a={id:e,value:n,parent:i};return a.value===void 0&&delete a.value,a.parent===void 0&&delete a.parent,a})},lZ=function(t){return t.edges().map(function(e){var n=t.edge(e),i={v:e.v,w:e.w,value:n,name:e.name};return i.name===void 0&&delete i.name,i.value===void 0&&delete i.value,i})},fZ=function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:uZ(t),edges:lZ(t),value:t.graph()};return e.value===void 0&&delete e.value,e},cZ=function(t){var e=new _u(t.options);return t.value!==void 0&&e.setGraph(t.value),t.nodes.forEach(function(n){e.setNode(n.id,n.value),n.parent&&e.setParent(n.id,n.parent)}),t.edges.forEach(function(n){e.setEdge(n.v,n.w,n.value,n.name)}),e};function yS(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),e.push.apply(e,n)}return e}function mS(r){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?yS(Object(e),!0).forEach(function(n){dZ(r,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):yS(Object(e)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(e,n))})}return r}function dZ(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function hZ(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function bS(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function vZ(r,t,e){return t&&bS(r.prototype,t),e&&bS(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}var pZ={compound:!1,multigraph:!1,directed:!0},_u=function(){function r(){var t=this,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hZ(this,r),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=El.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return t.directed},this.isMultigraph=function(){return t.multigraph},this.isCompound=function(){return t.compound},this.setGraph=function(i){return t.label=i,t},this.graph=function(){return t.label},this.setDefaultNodeLabel=function(i){return gS(i)?t.defaultNodeLabelFn=i:t.defaultNodeLabelFn=function(){return i},t},this.nodeCount=function(){return t.nodeCountNum},this.node=function(i){return t.nodesLabelMap.get(i)},this.nodes=function(){return Array.from(t.nodesLabelMap.keys())},this.sources=function(){return t.nodes().filter(function(i){var a;return!(!((a=t.inEdgesMap.get(i))===null||a===void 0)&&a.size)})},this.sinks=function(){return t.nodes().filter(function(i){var a;return!(!((a=t.outEdgesMap.get(i))===null||a===void 0)&&a.size)})},this.setNodes=function(i,a){return i.map(function(o){return t.setNode(o,a)}),t},this.hasNode=function(i){return t.nodesLabelMap.has(i)},this.checkCompound=function(){if(!t.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(i){if(t.isCompound()){var a,o=(a=t.parentMap)===null||a===void 0?void 0:a.get(i);if(o!==t.GRAPH_NODE)return o}},this.removeFromParentsChildList=function(i){var a=t.parentMap.get(i);t.childrenMap.get(a).delete(i)},this.setParent=function(i,a){var o,s;t.checkCompound();for(var u=a===void 0?t.GRAPH_NODE:a,l=t.parent(u);l;){if(i===l)throw new Error("Setting "+a+" as parent of "+i+" would create a cycle");l=t.parent(l)}a&&t.setNode(a),t.setNode(i),t.removeFromParentsChildList(i),(o=t.parentMap)===null||o===void 0||o.set(i,u);var f=t.childrenMap.get(u);return f.set(i,!0),(s=t.childrenMap)===null||s===void 0||s.set(u,f),t},this.children=function(i){var a=i===void 0?t.GRAPH_NODE:i;if(t.isCompound()){var o,s=(o=t.childrenMap)===null||o===void 0?void 0:o.get(a);return s?Array.from(s.keys()):void 0}if(a===t.GRAPH_NODE)return t.nodes();if(i&&t.hasNode(i))return[]},this.predecessors=function(i){var a=t.predecessorsMap.get(i);return a?Array.from(a.keys()):void 0},this.successors=function(i){var a=t.successorsMap.get(i);return a?Array.from(a.keys()):void 0},this.neighbors=function(i){var a;if(t.hasNode(i))return Array.from(new Set((a=t.predecessors(i))===null||a===void 0?void 0:a.concat(t.successors(i))))},this.isLeaf=function(i){var a;if(t.isDirected()){var o;return!(!((o=t.successors(i))===null||o===void 0)&&o.length)}return!(!((a=t.neighbors(i))===null||a===void 0)&&a.length)},this.filterNodes=function(i){var a=t.directed,o=t.multigraph,s=t.compound,u=new r({directed:a,multigraph:o,compound:s});if(u.setGraph(t.graph()),t.nodes().forEach(function(f){i(f)&&u.setNode(f,t.node(f))}),t.edges().forEach(function(f){u.hasNode(f.v)&&u.hasNode(f.w)&&u.setEdgeObj(f,t.edge(f))}),s){var l=function(c){for(var d=t.parent(c);d!==void 0&&!u.hasNode(d);)d=t.parent(d);return d};u.nodes().forEach(function(f){u.setParent(f,l(f))})}return u},this.setDefaultEdgeLabel=function(i){return gS(i)?t.defaultEdgeLabelFn=i:t.defaultEdgeLabelFn=function(){return i},t},this.edgeCount=function(){return t.edgeCountNum},this.setEdgeObj=function(i,a){return t.setEdge(i.v,i.w,a,i.name)},this.setPath=function(i,a){return i.reduce(function(o,s){return t.setEdge(o,s,a),s}),t},this.edgeFromArgs=function(i,a,o){return t.edge({v:i,w:a,name:o})},this.edge=function(i){return t.edgesLabelsMap.get(j0(t.isDirected(),i))},this.hasEdge=function(i,a,o){return t.edgesLabelsMap.has(j0(t.isDirected(),{v:i,w:a,name:o}))},this.removeEdgeObj=function(i){var a=i.v,o=i.w,s=i.name;return t.removeEdge(a,o,s)},this.edges=function(){return Array.from(t.edgesMap.values())},this.inEdges=function(i,a){var o=t.inEdgesMap.get(i);if(o)return Array.from(o.values()).filter(function(s){return!a||s.v===a})},this.outEdges=function(i,a){var o=t.outEdgesMap.get(i);if(o)return Array.from(o.values()).filter(function(s){return!a||s.w===a})},this.nodeEdges=function(i,a){var o;if(t.hasNode(i))return(o=t.inEdges(i,a))===null||o===void 0?void 0:o.concat(t.outEdges(i,a))},this.toJSON=function(){return fZ(t)},this.nodeInDegree=function(i){var a=t.inEdgesMap.get(i);return a?a.size:0},this.nodeOutDegree=function(i){var a=t.outEdgesMap.get(i);return a?a.size:0},this.nodeDegree=function(i){return t.nodeInDegree(i)+t.nodeOutDegree(i)},this.source=function(i){return i.v},this.target=function(i){return i.w};var n=mS(mS({},pZ),e);this.compound=n.compound,this.directed=n.directed,this.multigraph=n.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return vZ(r,[{key:"setNode",value:function(e,n){var i=this.nodesLabelMap,a=this.defaultNodeLabelFn,o=this.isCompound,s=this.parentMap,u=this.childrenMap,l=this.inEdgesMap,f=this.outEdgesMap,c=this.predecessorsMap,d=this.successorsMap;if(i.has(e))return n!==void 0&&i.set(e,n),this;if(i.set(e,n||a(e)),o()){var h;s==null||s.set(e,this.GRAPH_NODE),u==null||u.set(e,new Map),u!=null&&u.has(this.GRAPH_NODE)||u==null||u.set(this.GRAPH_NODE,new Map),u==null||(h=u.get(this.GRAPH_NODE))===null||h===void 0||h.set(e,!0)}return[l,f,c,d].forEach(function(v){return v.set(e,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(e){var n=this;if(this.hasNode(e)){var i=function(g){n.removeEdge(g.v,g.w,g.name)},a=this.inEdgesMap,o=this.outEdgesMap,s=this.predecessorsMap,u=this.successorsMap,l=this.nodesLabelMap;if(this.isCompound()){var f,c,d;this.removeFromParentsChildList(e),(f=this.parentMap)===null||f===void 0||f.delete(e),(c=this.children(e))===null||c===void 0||c.forEach(function(p){return n.setParent(p)}),(d=this.childrenMap)===null||d===void 0||d.delete(e)}var h=a.get(e),v=o.get(e);Array.from(h.values()).forEach(function(p){return i(p)}),Array.from(v.values()).forEach(function(p){return i(p)}),l.delete(e),a.delete(e),o.delete(e),s.delete(e),u.delete(e),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(e,n,i,a){var o,s,u=pS(this.isDirected(),e,n,a),l=j0(this.isDirected(),u),f=u.v,c=u.w;if(this.edgesLabelsMap.has(l))return this.edgesLabelsMap.set(l,i),this;if(a!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(c),this.edgesLabelsMap.set(l,i||this.defaultEdgeLabelFn(f,c,a)),Object.freeze(u),this.edgesMap.set(l,u);var d=this.predecessorsMap.get(c),h=this.successorsMap.get(f);return hS(d,f),hS(h,c),(o=this.inEdgesMap.get(c))===null||o===void 0||o.set(l,u),(s=this.outEdgesMap.get(f))===null||s===void 0||s.set(l,u),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(e,n,i){var a=Bk(this.isDirected(),e,n,i),o=this.edgesMap.get(a);if(o){var s=pS(this.isDirected(),e,n,i),u=s.v,l=s.w;this.edgesLabelsMap.delete(a),this.edgesMap.delete(a);var f=this.predecessorsMap.get(l),c=this.successorsMap.get(u);vS(f,u),vS(c,l),this.inEdgesMap.get(l).delete(a),this.outEdgesMap.get(u).delete(a),this.edgeCountNum-=1}return this}}]),r}();_u.fromJSON=cZ;function Cm(r){"@babel/helpers - typeof";return Cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cm(r)}function gZ(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function xS(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function yZ(r,t,e){return t&&xS(r.prototype,t),e&&xS(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function iu(){return typeof Reflect<"u"&&Reflect.get?iu=Reflect.get:iu=function(t,e,n){var i=mZ(t,e);if(i){var a=Object.getOwnPropertyDescriptor(i,e);return a.get?a.get.call(arguments.length<3?t:n):a.value}},iu.apply(this,arguments)}function mZ(r,t){for(;!Object.prototype.hasOwnProperty.call(r,t)&&(r=Oo(r),r!==null););return r}function bZ(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),t&&Am(r,t)}function Am(r,t){return Am=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Am(r,t)}function xZ(r){var t=_Z();return function(){var n=Oo(r),i;if(t){var a=Oo(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return wZ(this,i)}}function wZ(r,t){if(t&&(Cm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return EZ(r)}function EZ(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function _Z(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Oo(r){return Oo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Oo(r)}var SZ=function(r){bZ(e,r);var t=xZ(e);function e(){var n;gZ(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=t.call.apply(t,[this].concat(a)),n.eventPool={},n}return yZ(e,[{key:"appendEvent",value:function(i,a){this.eventPool[i]||(this.eventPool[i]=[]),this.eventPool[i].push(a)}},{key:"removeEvent",value:function(i,a){if(this.eventPool[i]){var o=this.eventPool[i].indexOf(a);o>-1&&this.eventPool[i].splice(o,1)}}},{key:"emitEvent",value:function(i){for(var a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];this.eventPool[i]&&this.eventPool[i].forEach(function(u){u.apply(void 0,o)})}},{key:"setNode",value:function(i,a){return iu(Oo(e.prototype),"setNode",this).call(this,i,a),this.emitEvent("nodeAdd",i,a),this}},{key:"removeNode",value:function(i){return iu(Oo(e.prototype),"removeNode",this).call(this,i),this.emitEvent("nodeRemove",i),this}},{key:"setEdge",value:function(i,a,o,s){return iu(Oo(e.prototype),"setEdge",this).call(this,i,a,o,s),this.emitEvent("edgeAdd",i,a,o,s),this}},{key:"removeEdge",value:function(i,a,o){return iu(Oo(e.prototype),"removeEdge",this).call(this,i,a,o),this.emitEvent("edgeRemove",i,a,o),this}}]),e}(_u);function wS(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function MZ(r,t,e){return t&&wS(r.prototype,t),e&&wS(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function CZ(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}var Fk=MZ(function r(){var t=this;CZ(this,r),this.arr=[],this.keyIndice=new Map,this.size=function(){return t.arr.length},this.keys=function(){return t.arr.map(function(e){return e.key})},this.has=function(e){return t.keyIndice.has(e)},this.priority=function(e){var n=t.keyIndice.get(e);if(n!==void 0)return t.arr[n].priority},this.swap=function(e,n){var i=t.arr,a=t.keyIndice,o=[i[e],i[n]],s=o[0],u=o[1];i[e]=u,i[n]=s,a.set(s.key,n),a.set(u.key,e)},this.innerDecrease=function(e){for(var n=t.arr,i=n[e].priority,a,o=e;o!==0;){var s;if(a=o>>1,((s=n[a])===null||s===void 0?void 0:s.priority)<i)break;t.swap(o,a),o=a}},this.heapify=function(e){var n=t.arr,i=e<<1,a=i+1,o=e;i<n.length&&(o=n[i].priority<n[o].priority?i:o,a<n.length&&(o=n[a].priority<n[o].priority?a:o),o!==e&&(t.swap(e,o),t.heapify(o)))},this.min=function(){if(t.size()===0)throw new Error("Queue underflow");return t.arr[0].key},this.add=function(e,n){var i=t.keyIndice,a=t.arr;if(!i.has(e)){var o=a.length;return i.set(e,o),a.push({key:e,priority:n}),t.innerDecrease(o),!0}return!1},this.removeMin=function(){t.swap(0,t.arr.length-1);var e=t.arr.pop();return t.keyIndice.delete(e.key),t.heapify(0),e.key},this.decrease=function(e,n){if(!t.has(e))throw new Error("There's no key named ".concat(e));var i=t.keyIndice.get(e);if(n>t.arr[i].priority)throw new Error("New priority is greater than current priority.Key: ".concat(e," Old: + ").concat(t.arr[i].priority," New: ").concat(n));t.arr[i].priority=n,t.innerDecrease(i)}}),AZ=function(t,e){var n=new _u,i=new Map,a=new Fk,o;function s(f){var c=f.v===o?f.w:f.v,d=a.priority(c);if(d!==void 0){var h=e(f);h<d&&(i.set(c,o),a.decrease(c,h))}}if(t.nodeCount()===0)return n;t.nodes().forEach(function(f){a.add(f,Number.POSITIVE_INFINITY),n.setNode(f)}),a.decrease(t.nodes()[0],0);for(var u=!1;a.size()>0;){var l;if(o=a.removeMin(),i.has(o))n.setEdge(o,i.get(o));else{if(u)throw new Error("Input graph is not connected: "+t.graph());u=!0}(l=t.nodeEdges(o))===null||l===void 0||l.forEach(s)}return n},TZ=function(t){var e=new Set,n=[],i=t.nodes();return i.forEach(function(a){for(var o=[],s=[a];s.length>0;){var u=s.pop();if(!e.has(u)){var l,f;e.add(u),o.push(u),(l=t.successors(u))===null||l===void 0||l.forEach(function(c){return s.push(c)}),(f=t.predecessors(u))===null||f===void 0||f.forEach(function(c){return s.push(c)})}}o.length&&n.push(o)}),n},IZ=function r(t,e,n,i,a,o){i.includes(e)||(i.push(e),n||o.push(e),a(e).forEach(function(s){return r(t,s,n,i,a,o)}),n&&o.push(e))},Ab=function(t,e,n){var i=Array.isArray(e)?e:[e],a=function(l){return t.isDirected()?t.successors(l):t.neighbors(l)},o=[],s=[];return i.forEach(function(u){if(t.hasNode(u))IZ(t,u,n==="post",s,a,o);else throw new Error("Graph does not have node: "+u)}),o};function OZ(r,t){return NZ(r)||DZ(r,t)||kZ(r,t)||LZ()}function LZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
298
298
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kZ(r,t){if(r){if(typeof r=="string")return ES(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ES(r,t)}}function ES(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function DZ(r,t){var e=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(e!=null){var n=[],i=!0,a=!1,o,s;try{for(e=e.call(r);!(i=(o=e.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&e.return!=null&&e.return()}finally{if(a)throw s}}return n}}function NZ(r){if(Array.isArray(r))return r}var PZ=function(){return 1},zk=function(t,e,n,i){return RZ(t,e,n||PZ,i||function(a){return t.outEdges(a)})},RZ=function(t,e,n,i){var a=new Map,o=new Fk,s,u,l=function(d){var h=d.v!==s?d.v:d.w,v=a.get(h),p=n(d),g=u.distance+p;if(p<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+d+" Weight: "+p);g<v.distance&&(v.distance=g,v.predecessor=s,o.decrease(h,g))};for(t.nodes().forEach(function(c){var d=c===e?0:Number.POSITIVE_INFINITY;a.set(c,{distance:d}),o.add(c,d)});o.size()>0&&(s=o.removeMin(),u=a.get(s),!(u&&u.distance===Number.POSITIVE_INFINITY));)i(s).forEach(l);var f={};return Array.from(a.entries()).forEach(function(c){var d=OZ(c,2),h=d[0],v=d[1];return f[String(h)]=v,f}),f},BZ=function(t,e,n){var i={};return t.nodes().forEach(function(a){return i[String(a)]=zk(t,a,e,n),i}),i},Gk=function(t){var e=0,n=[],i=new Map,a=[];function o(s){var u,l={onStack:!0,lowlink:e,index:e};if(i.set(s,l),e+=1,n.push(s),(u=t.successors(s))===null||u===void 0||u.forEach(function(h){var v;if(i.has(h)){if(!((v=i.get(h))===null||v===void 0)&&v.onStack){var g=i.get(h);l.lowlink=Math.min(l.lowlink,g.index)}}else{o(h);var p=i.get(h);l.lowlink=Math.min(l.lowlink,p.lowlink)}}),l.lowlink===l.index){var f=[],c;do{c=n.pop();var d=i.get(c);d.onStack=!1,f.push(c)}while(s!==c);a.push(f)}}return t.nodes().forEach(function(s){i.has(s)||o(s)}),a},FZ=function(t){return Gk(t).filter(function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})};function Tm(r){"@babel/helpers - typeof";return Tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tm(r)}function _S(r,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function zZ(r,t,e){return t&&_S(r.prototype,t),e&&_S(r,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function GZ(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function $Z(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),t&&Mc(r,t)}function UZ(r){var t=$k();return function(){var n=Cc(r),i;if(t){var a=Cc(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return jZ(this,i)}}function jZ(r,t){if(t&&(Tm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WZ(r)}function WZ(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Im(r){var t=typeof Map=="function"?new Map:void 0;return Im=function(n){if(n===null||!XZ(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return rv(n,arguments,Cc(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Mc(i,n)},Im(r)}function rv(r,t,e){return $k()?rv=Reflect.construct:rv=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),l=new u;return o&&Mc(l,o.prototype),l},rv.apply(null,arguments)}function $k(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function XZ(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function Mc(r,t){return Mc=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Mc(r,t)}function Cc(r){return Cc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Cc(r)}var Om=function(r){$Z(e,r);var t=UZ(e);function e(){return GZ(this,e),t.apply(this,arguments)}return zZ(e)}(Im(Error));function Uk(r){var t=new Set,e=new Set,n=[];function i(a){if(e.has(a))throw new Om;if(!t.has(a)){var o;e.add(a),t.add(a),(o=r.predecessors(a))===null||o===void 0||o.forEach(i),e.delete(a),n.push(a)}}if(r.sinks().forEach(i),t.size!==r.nodeCount())throw new Om;return n}var YZ=function(t){try{Uk(t)}catch(e){if(e instanceof Om)return!1;throw e}return!0},VZ=function(t,e){return Ab(t,e,"post")},HZ=function(t,e){return Ab(t,e,"pre")},KZ=function(){return 1};function qZ(r,t,e){return ZZ(r,t||KZ,e||function(n){return r.outEdges(n)})}function ZZ(r,t,e){var n={},i=r.nodes();return i.forEach(function(a){var o=String(a);n[o]={},n[o][o]={distance:0},i.forEach(function(s){a!==s&&(n[o][String(s)]={distance:Number.POSITIVE_INFINITY})}),e(a).forEach(function(s){var u=s.v===a?s.w:s.v,l=t(s);n[o][String(u)]={distance:l,predecessor:a}})}),i.forEach(function(a){var o=String(a),s=n[o];i.forEach(function(u){var l=String(u),f=n[l];i.forEach(function(c){var d=String(c),h=f[o],v=s[d],p=f[d],g=h.distance+v.distance;g<p.distance&&(p.distance=g,p.predecessor=v.predecessor)})})}),n}const QZ=Object.freeze(Object.defineProperty({__proto__:null,components:TZ,dfs:Ab,dijkstra:zk,dijkstraAll:BZ,findCycles:FZ,floydWarshall:qZ,isAcyclic:YZ,postorder:VZ,preorder:HZ,prim:AZ,tarjan:Gk,topsort:Uk},Symbol.toStringTag,{value:"Module"}));var JZ=function(t,e){for(var n=t.nodes(),i=0;i<n.length;i++){var a=n[i];if(e.hasNode(a))return!0}return!1},jk=function(t,e){for(var n=t.edges(),i=0;i<n.length;i++){var a=n[i];if(e.hasEdge(a.v,a.w,a.name))return!0}return!1},Wk=function(t,e){var n=t.nodes(),i=n.filter(function(a){return e.hasNode(a)});return i},Xk=function(t,e){var n=t.edges(),i=n.filter(function(a){return e.hasEdge(a.v,a.w,a.name)});return i},Yk=function(t,e){return t.isCompound()===e.isCompound()&&t.isDirected()===e.isDirected()&&t.isMultigraph()===e.isMultigraph()},$p=function(t,e){var n=Wk(t,e);return n.length===t.nodes().length},Tb=function(t,e){var n=Xk(t,e);return n.length===t.edges().length},eQ=function(t,e){return Yk(t,e)&&t.nodeCount()===e.nodeCount()&&$p(t,e)&&t.edgeCount()===e.edgeCount()&&Tb(t,e)},tQ=function(t,e){return $p(t,e)&&Tb(t,e)};function rQ(r,t){return oQ(r)||aQ(r,t)||iQ(r,t)||nQ()}function nQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
299
299
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iQ(r,t){if(r){if(typeof r=="string")return SS(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor&&(e=r.constructor.name),e==="Map"||e==="Set")return Array.from(r);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return SS(r,t)}}function SS(r,t){(t==null||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e<t;e++)n[e]=r[e];return n}function aQ(r,t){var e=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(e!=null){var n=[],i=!0,a=!1,o,s;try{for(e=e.call(r);!(i=(o=e.next()).done)&&(n.push(o.value),!(t&&n.length===t));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&e.return!=null&&e.return()}finally{if(a)throw s}}return n}}function oQ(r){if(Array.isArray(r))return r}function sQ(r){return r instanceof _u}function $v(r){if(r.isMultigraph())return!1;for(var t=r.edges(),e=new Map,n=0;n<t.length;n++){var i=t[n];if(i.v===i.w)return!1;var a=[i.v,i.w].sort(),o=rQ(a,2),s=o[0],u=o[1],l="".concat(s,"-").concat(u);if(e.has(l))return!1;e.set(l,!0)}return!0}function uQ(r){return r.nodes().length===0}function lQ(r){for(var t=r.edges(),e=0;e<t.length;e++){var n=t[e];if(n.v===n.w)return!0}return!1}const fQ=Object.freeze(Object.defineProperty({__proto__:null,hasSelfLoop:lQ,isGraph:sQ,isNullGraph:uQ,isSimpleGraph:$v},Symbol.toStringTag,{value:"Module"}));var cQ=function(t,e){if(!$v(t)||!$v(e)||!$p(t,e)||jk(t,e))return!1;var n=t.nodeCount();return t.edgeCount()+e.edgeCount()===n*(n-1)/2};const dQ=Object.freeze(Object.defineProperty({__proto__:null,containAllSameEdges:Tb,containAllSameNodes:$p,containSameEdges:jk,containSameNodes:JZ,getSameEdges:Xk,getSameNodes:Wk,isGraphComplement:cQ,isGraphContainsAnother:tQ,isGraphOptionSame:Yk,isGraphSame:eQ},Symbol.toStringTag,{value:"Module"}));var hQ=function(t){if(!$v(t))return null;for(var e=t.nodeCount(),n=new _u({compound:t.isCompound(),directed:t.isDirected(),multigraph:t.isMultigraph()}),i=t.nodes(),a=0;a<e;a++){var o=i[a];n.setNode(o,t.node(o));for(var s=a+1;s<e;s++){var u=i[s];t.hasEdge(o,u)||n.setEdge(o,u)}}return n};const vQ=Object.freeze(Object.defineProperty({__proto__:null,getGraphComplement:hQ},Symbol.toStringTag,{value:"Module"})),pQ=Object.freeze(Object.defineProperty({__proto__:null,Graph:_u,GraphWithEvent:SZ,algorithm:QZ,comparision:dQ,essence:fQ,generate:vQ},Symbol.toStringTag,{value:"Module"})),Up=to(pQ);var Vk=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),gQ=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Mb,"__esModule",{value:!0});var yQ=gQ(Cb),mQ=Up,bQ=function(r){Vk(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(yQ.default),xQ=function(r){Vk(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(mQ.Graph),wQ=function(){return 1},EQ=function(r,t){var e;if(r.nodeCount()<=1)return[];var n=SQ(r,t||wQ),i=_Q(n.graph,n.buckets,n.zeroIdx);return(e=i.map(function(a){return r.outEdges(a.v,a.w)}))===null||e===void 0?void 0:e.flat()},_Q=function(r,t,e){for(var n=[],i=t[t.length-1],a=t[0],o;r.nodeCount();){for(;o=a.dequeue();)W0(r,t,e,o);for(;o=i.dequeue();)W0(r,t,e,o);if(r.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){n=n.concat(W0(r,t,e,o,!0));break}}}return n},W0=function(r,t,e,n,i){var a,o,s=[];return(a=r.inEdges(n.v))===null||a===void 0||a.forEach(function(u){var l=r.edge(u),f=r.node(u.v);i&&s.push({v:u.v,w:u.w,in:0,out:0}),f.out===void 0&&(f.out=0),f.out-=l,Lm(t,e,f)}),(o=r.outEdges(n.v))===null||o===void 0||o.forEach(function(u){var l=r.edge(u),f=u.w,c=r.node(f);c.in===void 0&&(c.in=0),c.in-=l,Lm(t,e,c)}),r.removeNode(n.v),i?s:void 0},SQ=function(r,t){var e=new xQ,n=0,i=0;r.nodes().forEach(function(l){e.setNode(l,{v:l,in:0,out:0})}),r.edges().forEach(function(l){var f=e.edge(l)||0,c=(t==null?void 0:t(l))||1,d=f+c;e.setEdge(l.v,l.w,d),i=Math.max(i,e.node(l.v).out+=c),n=Math.max(n,e.node(l.w).in+=c)});for(var a=[],o=i+n+3,s=0;s<o;s++)a.push(new bQ);var u=n+1;return e.nodes().forEach(function(l){Lm(a,u,e.node(l))}),{buckets:a,zeroIdx:u,graph:e}},Lm=function(r,t,e){e.out?e.in?r[e.out-e.in+t].enqueue(e):r[r.length-1].enqueue(e):r[0].enqueue(e)};Mb.default=EQ;var MQ=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sb,"__esModule",{value:!0});var CQ=MQ(Mb),AQ=function(r){var t=function(n){return function(i){var a;return((a=n.edge(i))===null||a===void 0?void 0:a.weight)||1}},e=r.graph().acyclicer==="greedy"?(0,CQ.default)(r,t(r)):TQ(r);e==null||e.forEach(function(n){var i=r.edge(n);r.removeEdgeObj(n),i.forwardName=n.name,i.reversed=!0,r.setEdge(n.w,n.v,i,"rev-".concat(Math.random()))})},TQ=function(r){var t=[],e={},n={},i=function(a){var o;n[a]||(n[a]=!0,e[a]=!0,(o=r.outEdges(a))===null||o===void 0||o.forEach(function(s){e[s.w]?t.push(s):i(s.w)}),delete e[a])};return r.nodes().forEach(i),t},IQ=function(r){r.edges().forEach(function(t){var e=r.edge(t);if(e.reversed){r.removeEdgeObj(t);var n=e.forwardName;delete e.reversed,delete e.forwardName,r.setEdge(t.w,t.v,e,n)}})};Sb.default={run:AQ,undo:IQ};var Ib={},zi={},Fo={},OQ=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}();Object.defineProperty(Fo,"__esModule",{value:!0});Fo.Graph=void 0;var LQ=Up,kQ=function(r){OQ(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t}(LQ.Graph);Fo.Graph=kQ;(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.minBy=r.notime=r.time=r.partition=r.maxRank=r.addBorderNode=r.removeEmptyRanks=r.normalizeRanks=r.buildLayerMatrix=r.intersectRect=r.predecessorWeights=r.successorWeights=r.zipObject=r.asNonCompoundGraph=r.simplify=r.addDummyNode=void 0;var t=an(),e=Fo,n=function(x,w){return Number(x)-Number(w)},i=function(x,w,E,_){var M;do M="".concat(_).concat(Math.random());while(x.hasNode(M));return E.dummy=w,x.setNode(M,E),M};r.addDummyNode=i;var a=function(x){var w=new e.Graph().setGraph(x.graph());return x.nodes().forEach(function(E){w.setNode(E,x.node(E))}),x.edges().forEach(function(E){var _=w.edgeFromArgs(E.v,E.w)||{weight:0,minlen:1},M=x.edge(E);w.setEdge(E.v,E.w,{weight:_.weight+M.weight,minlen:Math.max(_.minlen,M.minlen)})}),w};r.simplify=a;var o=function(x){var w=new e.Graph({multigraph:x.isMultigraph()}).setGraph(x.graph());return x.nodes().forEach(function(E){var _;!((_=x.children(E))===null||_===void 0)&&_.length||w.setNode(E,x.node(E))}),x.edges().forEach(function(E){w.setEdgeObj(E,x.edge(E))}),w};r.asNonCompoundGraph=o;var s=function(x,w){return x==null?void 0:x.reduce(function(E,_,M){return E[_]=w[M],E},{})};r.zipObject=s;var u=function(x){var w={};return x.nodes().forEach(function(E){var _,M={};(_=x.outEdges(E))===null||_===void 0||_.forEach(function(C){var S;M[C.w]=(M[C.w]||0)+(((S=x.edge(C))===null||S===void 0?void 0:S.weight)||0)}),w[E]=M}),w};r.successorWeights=u;var l=function(x){var w=x.nodes(),E=w.map(function(_){var M,C={};return(M=x.inEdges(_))===null||M===void 0||M.forEach(function(S){C[S.v]=(C[S.v]||0)+x.edge(S).weight}),C});return(0,r.zipObject)(w,E)};r.predecessorWeights=l;var f=function(x,w){var E=Number(x.x),_=Number(x.y),M=Number(w.x)-E,C=Number(w.y)-_,S=Number(x.width)/2,A=Number(x.height)/2;if(!M&&!C)return{x:0,y:0};var T,I;return Math.abs(C)*S>Math.abs(M)*A?(C<0&&(A=-A),T=A*M/C,I=A):(M<0&&(S=-S),T=S,I=S*C/M),{x:E+T,y:_+I}};r.intersectRect=f;var c=function(x){for(var w=[],E=(0,r.maxRank)(x)+1,_=0;_<E;_++)w.push([]);x.nodes().forEach(function(M){var C=x.node(M);if(C){var S=C.rank;S!==void 0&&w[S]&&w[S].push(M)}});for(var _=0;_<E;_++)w[_]=w[_].sort(function(C,S){var A,T;return n((A=x.node(C))===null||A===void 0?void 0:A.order,(T=x.node(S))===null||T===void 0?void 0:T.order)});return w};r.buildLayerMatrix=c;var d=function(x){var w=x.nodes().filter(function(_){var M;return((M=x.node(_))===null||M===void 0?void 0:M.rank)!==void 0}).map(function(_){return x.node(_).rank}),E=Math.min.apply(Math,w);x.nodes().forEach(function(_){var M=x.node(_);M.hasOwnProperty("rank")&&E!==1/0&&(M.rank-=E)})};r.normalizeRanks=d;var h=function(x){var w=x.nodes(),E=w.filter(function(I){var k;return((k=x.node(I))===null||k===void 0?void 0:k.rank)!==void 0}).map(function(I){return x.node(I).rank}),_=Math.min.apply(Math,E),M=[];w.forEach(function(I){var k,P=(((k=x.node(I))===null||k===void 0?void 0:k.rank)||0)-_;M[P]||(M[P]=[]),M[P].push(I)});for(var C=0,S=x.graph().nodeRankFactor||0,A=0;A<M.length;A++){var T=M[A];T===void 0?A%S!==0&&(C-=1):C&&(T==null||T.forEach(function(I){var k=x.node(I);k&&(k.rank=k.rank||0,k.rank+=C)}))}};r.removeEmptyRanks=h;var v=function(x,w,E,_){var M={width:0,height:0};return(0,t.isNumber)(E)&&(0,t.isNumber)(_)&&(M.rank=E,M.order=_),(0,r.addDummyNode)(x,"border",M,w)};r.addBorderNode=v;var p=function(x){var w;return x.nodes().forEach(function(E){var _,M=(_=x.node(E))===null||_===void 0?void 0:_.rank;M!==void 0&&(w===void 0||M>w)&&(w=M)}),w||(w=0),w};r.maxRank=p;var g=function(x,w){var E={lhs:[],rhs:[]};return x==null||x.forEach(function(_){w(_)?E.lhs.push(_):E.rhs.push(_)}),E};r.partition=g;var y=function(x,w){var E=Date.now();try{return w()}finally{console.log("".concat(x," time: ").concat(Date.now()-E,"ms"))}};r.time=y;var m=function(x,w){return w()};r.notime=m;var b=function(x,w){return x.reduce(function(E,_){var M=w(E),C=w(_);return M>C?_:E})};r.minBy=b})(zi);Object.defineProperty(Ib,"__esModule",{value:!0});var DQ=zi,NQ=function(r){r.graph().dummyChains=[],r.edges().forEach(function(t){return PQ(r,t)})},PQ=function(r,t){var e=t.v,n=r.node(e).rank,i=t.w,a=r.node(i).rank,o=t.name,s=r.edge(t),u=s.labelRank;if(a!==n+1){r.removeEdgeObj(t);var l=r.graph(),f,c,d;for(d=0,++n;n<a;++d,++n)s.points=[],c={edgeLabel:s,width:0,height:0,edgeObj:t,rank:n},f=(0,DQ.addDummyNode)(r,"edge",c,"_d"),n===u&&(c.width=s.width,c.height=s.height,c.dummy="edge-label",c.labelpos=s.labelpos),r.setEdge(e,f,{weight:s.weight},o),d===0&&(l.dummyChains||(l.dummyChains=[]),l.dummyChains.push(f)),e=f;r.setEdge(e,i,{weight:s.weight},o)}},RQ=function(r){var t;(t=r.graph().dummyChains)===null||t===void 0||t.forEach(function(e){var n=r.node(e),i=n.edgeLabel,a;n.edgeObj&&r.setEdgeObj(n.edgeObj,i);for(var o=e;n.dummy;)a=r.successors(o)[0],r.removeNode(o),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),o=a,n=r.node(o)})};Ib.default={run:NQ,undo:RQ};var Ob={},ga={};Object.defineProperty(ga,"__esModule",{value:!0});ga.slack=ga.longestPathWithLayer=ga.longestPath=void 0;var Hk=function(r){var t,e={},n=function(i){var a,o=r.node(i);if(!o)return 0;if(e[i])return o.rank;e[i]=!0;var s;return(a=r.outEdges(i))===null||a===void 0||a.forEach(function(u){var l=n(u.w),f=r.edge(u).minlen,c=l-f;c&&(s===void 0||c<s)&&(s=c)}),s||(s=0),o.rank=s,s};(t=r.sources())===null||t===void 0||t.forEach(function(i){return n(i)})};ga.longestPath=Hk;var Kk=function(r){var t,e={},n,i=function(s){var u,l=r.node(s);if(!l)return 0;if(e[s])return l.rank;e[s]=!0;var f;return(u=r.outEdges(s))===null||u===void 0||u.forEach(function(c){var d=i(c.w),h=r.edge(c).minlen,v=d-h;v&&(f===void 0||v<f)&&(f=v)}),f||(f=0),(n===void 0||f<n)&&(n=f),l.rank=f,f};(t=r.sources())===null||t===void 0||t.forEach(function(s){r.node(s)&&i(s)}),n===void 0&&(n=0);var a={},o=function(s,u){var l,f=r.node(s),c=isNaN(f.layer)?u:f.layer;(f.rank===void 0||f.rank<c)&&(f.rank=c),!a[s]&&(a[s]=!0,(l=r.outEdges(s))===null||l===void 0||l.map(function(d){o(d.w,c+r.edge(d).minlen)}))};r.nodes().forEach(function(s){var u=r.node(s);u&&(isNaN(u.layer)?u.rank-=n:o(s,u.layer))})};ga.longestPathWithLayer=Kk;var qk=function(r,t){return r.node(t.w).rank-r.node(t.v).rank-r.edge(t).minlen};ga.slack=qk;ga.default={longestPath:Hk,longestPathWithLayer:Kk,slack:qk};var _s={};Object.defineProperty(_s,"__esModule",{value:!0});_s.feasibleTreeWithLayer=_s.feasibleTree=void 0;var gu=ga,BQ=zi,Zk=Fo,Qk=function(r){var t=new Zk.Graph({directed:!1}),e=r.nodes()[0],n=r.nodeCount();t.setNode(e,{});for(var i,a;FQ(t,r)<n;)i=eD(t,r),a=t.hasNode(i.v)?(0,gu.slack)(r,i):-(0,gu.slack)(r,i),tD(t,r,a);return t};_s.feasibleTree=Qk;var FQ=function(r,t){var e=function(n){t.nodeEdges(n).forEach(function(i){var a=i.v,o=n===a?i.w:a;!r.hasNode(o)&&!(0,gu.slack)(t,i)&&(r.setNode(o,{}),r.setEdge(n,o,{}),e(o))})};return r.nodes().forEach(e),r.nodeCount()},Jk=function(r){var t=new Zk.Graph({directed:!1}),e=r.nodes()[0],n=r.nodes().filter(function(o){return!!r.node(o)}).length;t.setNode(e,{});for(var i,a;zQ(t,r)<n;)i=eD(t,r),a=t.hasNode(i.v)?(0,gu.slack)(r,i):-(0,gu.slack)(r,i),tD(t,r,a);return t};_s.feasibleTreeWithLayer=Jk;var zQ=function(r,t){var e=function(n){var i;(i=t.nodeEdges(n))===null||i===void 0||i.forEach(function(a){var o=a.v,s=n===o?a.w:o;!r.hasNode(s)&&(t.node(s).layer!==void 0||!(0,gu.slack)(t,a))&&(r.setNode(s,{}),r.setEdge(n,s,{}),e(s))})};return r.nodes().forEach(e),r.nodeCount()},eD=function(r,t){return(0,BQ.minBy)(t.edges(),function(e){return r.hasNode(e.v)!==r.hasNode(e.w)?(0,gu.slack)(t,e):1/0})},tD=function(r,t,e){r.nodes().forEach(function(n){t.node(n).rank||(t.node(n).rank=0),t.node(n).rank+=e})};_s.default={feasibleTree:Qk,feasibleTreeWithLayer:Jk};var rD={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.exchangeEdges=r.enterEdge=r.leaveEdge=r.initLowLimValues=r.calcCutValue=r.initCutValues=void 0;var t=_s,e=ga,n=zi,i=Up,a=i.algorithm.preorder,o=i.algorithm.postorder,s=function(b){var x=(0,n.simplify)(b);(0,e.longestPath)(x);var w=(0,t.feasibleTree)(x);(0,r.initLowLimValues)(w),(0,r.initCutValues)(w,x);for(var E,_;E=(0,r.leaveEdge)(w);)_=(0,r.enterEdge)(w,x,E),(0,r.exchangeEdges)(w,x,E,_)},u=function(b,x){var w=o(b,b.nodes());w=w==null?void 0:w.slice(0,(w==null?void 0:w.length)-1),w==null||w.forEach(function(E){l(b,x,E)})};r.initCutValues=u;var l=function(b,x,w){var E=b.node(w),_=E.parent;b.edgeFromArgs(w,_).cutvalue=(0,r.calcCutValue)(b,x,w)},f=function(b,x,w){var E,_=b.node(w),M=_.parent,C=!0,S=x.edgeFromArgs(w,M),A=0;return S||(C=!1,S=x.edgeFromArgs(M,w)),A=S.weight,(E=x.nodeEdges(w))===null||E===void 0||E.forEach(function(T){var I=T.v===w,k=I?T.w:T.v;if(k!==M){var P=I===C,N=x.edge(T).weight;if(A+=P?N:-N,y(b,w,k)){var z=b.edgeFromArgs(w,k).cutvalue;A+=P?-z:z}}}),A};r.calcCutValue=f;var c=function(b,x){x===void 0&&(x=b.nodes()[0]),d(b,{},1,x)};r.initLowLimValues=c;var d=function(b,x,w,E,_){var M,C=w,S=w,A=b.node(E);return x[E]=!0,(M=b.neighbors(E))===null||M===void 0||M.forEach(function(T){x[T]||(S=d(b,x,S,T,E))}),A.low=C,A.lim=S++,_?A.parent=_:delete A.parent,S},h=function(b){return b.edges().find(function(x){return b.edge(x).cutvalue<0})};r.leaveEdge=h;var v=function(b,x,w){var E=w.v,_=w.w;x.hasEdge(E,_)||(E=w.w,_=w.v);var M=b.node(E),C=b.node(_),S=M,A=!1;M.lim>C.lim&&(S=C,A=!0);var T=x.edges().filter(function(I){return A===m(b,b.node(I.v),S)&&A!==m(b,b.node(I.w),S)});return(0,n.minBy)(T,function(I){return(0,e.slack)(x,I)})};r.enterEdge=v;var p=function(b,x,w,E){var _=w.v,M=w.w;b.removeEdge(_,M),b.setEdge(E.v,E.w,{}),(0,r.initLowLimValues)(b),(0,r.initCutValues)(b,x),g(b,x)};r.exchangeEdges=p;var g=function(b,x){var w=b.nodes().find(function(_){var M;return!(!((M=x.node(_))===null||M===void 0)&&M.parent)}),E=a(b,w);E=E==null?void 0:E.slice(1),E==null||E.forEach(function(_){var M=b.node(_).parent,C=x.edgeFromArgs(_,M),S=!1;C||(C=x.edgeFromArgs(M,_),S=!0),x.node(_).rank=x.node(M).rank+(S?C.minlen:-C.minlen)})},y=function(b,x,w){return b.hasEdge(x,w)},m=function(b,x,w){return w.low<=x.lim&&x.lim<=w.lim};r.default=s})(rD);var GQ=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ob,"__esModule",{value:!0});var nD=ga,$Q=_s,UQ=GQ(rD),jQ=function(r){switch(r.graph().ranker){case"network-simplex":XQ(r);break;case"tight-tree":MS(r);break;case"longest-path":WQ(r);break;default:MS(r)}},WQ=nD.longestPath,MS=function(r){(0,nD.longestPathWithLayer)(r),(0,$Q.feasibleTreeWithLayer)(r)},XQ=function(r){(0,UQ.default)(r)};Ob.default=jQ;var Lb={};Object.defineProperty(Lb,"__esModule",{value:!0});var YQ=function(r){var t,e={},n=0,i=function(a){var o,s=n;(o=r.children(a))===null||o===void 0||o.forEach(i),e[a]={low:s,lim:n++}};return(t=r.children())===null||t===void 0||t.forEach(i),e},VQ=function(r,t,e,n){var i=[],a=[],o=Math.min(t[e].low,t[n].low),s=Math.max(t[e].lim,t[n].lim),u,l;u=e;do u=r.parent(u),i.push(u);while(u&&(t[u].low>o||s>t[u].lim));for(l=u,u=n;u&&u!==l;)a.push(u),u=r.parent(u);return{lca:l,path:i.concat(a.reverse())}},HQ=function(r){var t,e=YQ(r);(t=r.graph().dummyChains)===null||t===void 0||t.forEach(function(n){var i,a,o=n,s=r.node(o),u=s.edgeObj;if(u)for(var l=VQ(r,e,u.v,u.w),f=l.path,c=l.lca,d=0,h=f[d],v=!0;o!==u.w;){if(s=r.node(o),v){for(;h!==c&&((i=r.node(h))===null||i===void 0?void 0:i.maxRank)<s.rank;)d++,h=f[d];h===c&&(v=!1)}if(!v){for(;d<f.length-1&&((a=r.node(f[d+1]))===null||a===void 0?void 0:a.minRank)<=s.rank;)d++;h=f[d]}r.setParent(o,h),o=r.successors(o)[0]}})};Lb.default=HQ;var kb={};Object.defineProperty(kb,"__esModule",{value:!0});var km=zi,KQ=function(r){var t,e=(0,km.addDummyNode)(r,"root",{},"_root"),n=qQ(r),i=Math.max.apply(Math,Object.values(n));Math.abs(i)===1/0&&(i=1);var a=i-1,o=2*a+1;r.graph().nestingRoot=e,r.edges().forEach(function(u){r.edge(u).minlen*=o});var s=ZQ(r)+1;(t=r.children())===null||t===void 0||t.forEach(function(u){iD(r,e,o,s,a,n,u)}),r.graph().nodeRankFactor=o},iD=function(r,t,e,n,i,a,o){var s=r.children(o);if(!(s!=null&&s.length)){o!==t&&r.setEdge(t,o,{weight:0,minlen:e});return}var u=(0,km.addBorderNode)(r,"_bt"),l=(0,km.addBorderNode)(r,"_bb"),f=r.node(o);r.setParent(u,o),f.borderTop=u,r.setParent(l,o),f.borderBottom=l,s==null||s.forEach(function(c){iD(r,t,e,n,i,a,c);var d=r.node(c),h=d.borderTop?d.borderTop:c,v=d.borderBottom?d.borderBottom:c,p=d.borderTop?n:2*n,g=h!==v?1:i-a[o]+1;r.setEdge(u,h,{minlen:g,weight:p,nestingEdge:!0}),r.setEdge(v,l,{minlen:g,weight:p,nestingEdge:!0})}),r.parent(o)||r.setEdge(t,u,{weight:0,minlen:i+a[o]})},qQ=function(r){var t,e={},n=function(i,a){var o=r.children(i);o==null||o.forEach(function(s){return n(s,a+1)}),e[i]=a};return(t=r.children())===null||t===void 0||t.forEach(function(i){return n(i,1)}),e},ZQ=function(r){var t=0;return r.edges().forEach(function(e){t+=r.edge(e).weight}),t},QQ=function(r){var t=r.graph();t.nestingRoot&&r.removeNode(t.nestingRoot),delete t.nestingRoot,r.edges().forEach(function(e){var n=r.edge(e);n.nestingEdge&&r.removeEdgeObj(e)})};kb.default={run:KQ,cleanup:QQ};var Db={};Object.defineProperty(Db,"__esModule",{value:!0});var JQ=zi,eJ=function(r){var t,e=function(n){var i=r.children(n),a=r.node(n);if(i!=null&&i.length&&i.forEach(function(u){return e(u)}),a.hasOwnProperty("minRank")){a.borderLeft=[],a.borderRight=[];for(var o=a.minRank,s=a.maxRank+1;o<s;o+=1)CS(r,"borderLeft","_bl",n,a,o),CS(r,"borderRight","_br",n,a,o)}};(t=r.children())===null||t===void 0||t.forEach(function(n){return e(n)})},CS=function(r,t,e,n,i,a){var o={rank:a,borderType:t,width:0,height:0},s=i[t][a-1],u=(0,JQ.addDummyNode)(r,"border",o,e);i[t][a]=u,r.setParent(u,n),s&&r.setEdge(s,u,{weight:1})};Db.default=eJ;var Nb={};Object.defineProperty(Nb,"__esModule",{value:!0});var tJ=function(r){var t,e=(t=r.graph().rankdir)===null||t===void 0?void 0:t.toLowerCase();(e==="lr"||e==="rl")&&aD(r)},rJ=function(r){var t,e=(t=r.graph().rankdir)===null||t===void 0?void 0:t.toLowerCase();(e==="bt"||e==="rl")&&nJ(r),(e==="lr"||e==="rl")&&(iJ(r),aD(r))},aD=function(r){r.nodes().forEach(function(t){AS(r.node(t))}),r.edges().forEach(function(t){AS(r.edge(t))})},AS=function(r){var t=r.width;r.width=r.height,r.height=t},nJ=function(r){r.nodes().forEach(function(t){X0(r.node(t))}),r.edges().forEach(function(t){var e,n=r.edge(t);(e=n.points)===null||e===void 0||e.forEach(function(i){return X0(i)}),n.hasOwnProperty("y")&&X0(n)})},X0=function(r){r!=null&&r.y&&(r.y=-r.y)},iJ=function(r){r.nodes().forEach(function(t){Y0(r.node(t))}),r.edges().forEach(function(t){var e,n=r.edge(t);(e=n.points)===null||e===void 0||e.forEach(function(i){return Y0(i)}),n.hasOwnProperty("x")&&Y0(n)})},Y0=function(r){var t=r.x;r.x=r.y,r.y=t};Nb.default={adjust:tJ,undo:rJ};var Pb={},Rb={};function oD(r){return[parseInt(r.substr(1,2),16),parseInt(r.substr(3,2),16),parseInt(r.substr(5,2),16)]}function V0(r){var t=Math.round(r).toString(16);return t.length===1?"0"+t:t}function sD(r){return"#"+V0(r[0])+V0(r[1])+V0(r[2])}var _i=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},aJ=function(r,t){return _i(r)?r.indexOf(t)>-1:!1};const Uv=aJ;var uD=function(r,t){if(!_i(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];t(i,n)&&e.push(i)}return e},oJ=function(r,t){return t===void 0&&(t=[]),uD(r,function(e){return!Uv(t,e)})};const sJ=oJ,Gi=function(r){return typeof r=="function"};var As=function(r){return r==null},uJ={}.toString,ao=function(r,t){return uJ.call(r)==="[object "+t+"]"};const wn=function(r){return Array.isArray?Array.isArray(r):ao(r,"Array")},jp=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function Bl(r,t){if(r){var e;if(wn(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(jp(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var lJ=Object.keys?function(r){return Object.keys(r)}:function(r){var t=[];return Bl(r,function(e,n){Gi(r)&&n==="prototype"||t.push(n)}),t};const lD=lJ;function fD(r,t){var e=lD(t),n=e.length;if(As(r))return!n;for(var i=0;i<n;i+=1){var a=e[i];if(t[a]!==r[a]||!(a in r))return!1}return!0}var fJ=function(r){return typeof r=="object"&&r!==null};const jv=fJ;var cJ=function(r){if(!jv(r)||!ao(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t};const Fl=cJ;function dJ(r,t){if(!wn(r))return null;var e;if(Gi(t)&&(e=t),Fl(t)&&(e=function(i){return fD(i,t)}),e){for(var n=0;n<r.length;n+=1)if(e(r[n]))return r[n]}return null}function hJ(r,t,e){e===void 0&&(e=0);for(var n=e;n<r.length;n++)if(t(r[n],n))return n;return-1}var vJ=function(r,t){for(var e=null,n=0;n<r.length;n++){var i=r[n],a=i[t];if(!As(a)){wn(a)?e=a[0]:e=a;break}}return e};const pJ=vJ;var gJ=function(r){if(!wn(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t};const yJ=gJ;var cD=function(r,t){if(t===void 0&&(t=[]),!wn(r))t.push(r);else for(var e=0;e<r.length;e+=1)cD(r[e],t);return t};const mJ=cD,dD=function(r){if(wn(r))return r.reduce(function(t,e){return Math.max(t,e)},r[0])},hD=function(r){if(wn(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])};var bJ=function(r){var t=r.filter(function(o){return!isNaN(o)});if(!t.length)return{min:0,max:0};if(wn(r[0])){for(var e=[],n=0;n<r.length;n++)e=e.concat(r[n]);t=e}var i=dD(t),a=hD(t);return{min:a,max:i}};const xJ=bJ;var vD=Array.prototype,wJ=vD.splice,EJ=vD.indexOf,_J=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n++)for(var i=t[n],a=-1;(a=EJ.call(r,i))>-1;)wJ.call(r,a,1);return r};const SJ=_J;var MJ=Array.prototype.splice,CJ=function(t,e){if(!_i(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var a=void 0,o=e[n];(n===i||o!==a)&&(a=o,MJ.call(t,o,1))}return t};const pD=CJ;var AJ=function(r,t,e){if(!wn(r)&&!Fl(r))return r;var n=e;return Bl(r,function(i,a){n=t(n,i,a)}),n};const gD=AJ;var TJ=function(r,t){var e=[];if(!_i(r))return e;for(var n=-1,i=[],a=r.length;++n<a;){var o=r[n];t(o,n,r)&&(e.push(o),i.push(n))}return pD(r,i),e};const IJ=TJ,Ss=function(r){return ao(r,"String")};function OJ(r,t){var e;if(Gi(t))e=function(i,a){return t(i)-t(a)};else{var n=[];Ss(t)?n.push(t):wn(t)&&(n=t),e=function(i,a){for(var o=0;o<n.length;o+=1){var s=n[o];if(i[s]>a[s])return 1;if(i[s]<a[s])return-1}return 0}}return r.sort(e),r}function yD(r,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];t.has(a)||(e.push(a),t.set(a,!0))}return e}var LJ=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return yD([].concat.apply([],r))};const kJ=LJ,DJ=function(r,t){for(var e=[],n={},i=0;i<r.length;i++){var a=r[i],o=a[t];if(!As(o)){wn(o)||(o=[o]);for(var s=0;s<o.length;s++){var u=o[s];n[u]||(e.push(u),n[u]=!0)}}}return e};function NJ(r){if(_i(r))return r[0]}function PJ(r){if(_i(r)){var t=r;return t[t.length-1]}}function RJ(r,t){return wn(r)||Ss(r)?r[0]===t:!1}function BJ(r,t){return wn(r)||Ss(r)?r[r.length-1]===t:!1}var FJ=function(r,t){for(var e=0;e<r.length;e++)if(!t(r[e],e))return!1;return!0};const zJ=FJ;var GJ=function(r,t){for(var e=0;e<r.length;e++)if(t(r[e],e))return!0;return!1};const $J=GJ;var UJ=Object.prototype.hasOwnProperty;function mD(r,t){if(!t||!wn(r))return{};for(var e={},n=Gi(t)?t:function(s){return s[t]},i,a=0;a<r.length;a++){var o=r[a];i=n(o),UJ.call(e,i)?e[i].push(o):e[i]=[o]}return e}function bD(r,t){if(!t)return{0:r};if(!Gi(t)){var e=wn(t)?t:t.replace(/\s+/g,"").split("*");t=function(n){for(var i="_",a=0,o=e.length;a<o;a++)i+=n[e[a]]&&n[e[a]].toString();return i}}return mD(r,t)}const jJ=function(r,t){if(!t)return[r];var e=bD(r,t),n=[];for(var i in e)n.push(e[i]);return n};function WJ(r,t){return r["_wrap_"+t]}function XJ(r,t){if(r["_wrap_"+t])return r["_wrap_"+t];var e=function(n){r[t](n)};return r["_wrap_"+t]=e,e}var TS={};function YJ(r){var t=TS[r];if(!t){for(var e=r.toString(16),n=e.length;n<6;n++)e="0"+e;t="#"+e,TS[r]=t}return t}function VJ(r){var t=0,e=0,n=0,i=0;return wn(r)?r.length===1?t=e=n=i=r[0]:r.length===2?(t=n=r[0],e=i=r[1]):r.length===3?(t=r[0],e=i=r[1],n=r[2]):(t=r[0],e=r[1],n=r[2],i=r[3]):t=e=n=i=r,{r1:t,r2:e,r3:n,r4:i}}var HJ=function(r,t,e){return r<t?t:r>e?e:r};const KJ=HJ;var qJ=function(r,t){var e=t.toString(),n=e.indexOf(".");if(n===-1)return Math.round(r);var i=e.substr(n+1).length;return i>20&&(i=20),parseFloat(r.toFixed(i))};const ZJ=qJ;var zo=function(r){return ao(r,"Number")},QJ=function(r){return zo(r)&&r%1!==0};const JJ=QJ;var eee=function(r){return zo(r)&&r%2===0};const tee=eee;var ree=Number.isInteger?Number.isInteger:function(r){return zo(r)&&r%1===0};const nee=ree;var iee=function(r){return zo(r)&&r<0};const aee=iee;var oee=1e-5;function see(r,t,e){return e===void 0&&(e=oee),Math.abs(r-t)<e}var uee=function(r){return zo(r)&&r%2!==0};const lee=uee;var fee=function(r){return zo(r)&&r>0};const cee=fee,dee=function(r,t){if(wn(r)){for(var e,n=-1/0,i=0;i<r.length;i++){var a=r[i],o=Gi(t)?t(a):a[t];o>n&&(e=a,n=o)}return e}},hee=function(r,t){if(wn(r)){for(var e,n=1/0,i=0;i<r.length;i++){var a=r[i],o=Gi(t)?t(a):a[t];o<n&&(e=a,n=o)}return e}};var vee=function(r,t){return(r%t+t)%t};const pee=vee;var gee=180/Math.PI,yee=function(r){return gee*r};const mee=yee,bee=parseInt;var xee=Math.PI/180,wee=function(r){return xee*r};const Eee=wee,IS=function(r,t){return r.hasOwnProperty(t)};var xD=Object.values?function(r){return Object.values(r)}:function(r){var t=[];return Bl(r,function(e,n){Gi(r)&&n==="prototype"||t.push(e)}),t};const _ee=function(r,t){return Uv(xD(r),t)},Qc=function(r){return As(r)?"":r.toString()};var See=function(r){return Qc(r).toLowerCase()};const Mee=See;var Cee=function(r){var t=Qc(r);return t.charAt(0).toLowerCase()+t.substring(1)};const Aee=Cee;function Tee(r,t){return!r||!t?r:r.replace(/\\?\{([^{}]+)\}/g,function(e,n){return e.charAt(0)==="\\"?e.slice(1):t[n]===void 0?"":t[n]})}var Iee=function(r){return Qc(r).toUpperCase()};const Oee=Iee;var Lee=function(r){var t=Qc(r);return t.charAt(0).toUpperCase()+t.substring(1)};const kee=Lee;var Dee={}.toString,Nee=function(r){return Dee.call(r).replace(/^\[object /,"").replace(/]$/,"")};const wD=Nee;var Pee=function(r){return ao(r,"Arguments")};const Ree=Pee;var Bee=function(r){return ao(r,"Boolean")};const Fee=Bee;var zee=function(r){return ao(r,"Date")};const Gee=zee;var $ee=function(r){return ao(r,"Error")};const Uee=$ee;function jee(r){return zo(r)&&isFinite(r)}var Wee=function(r){return r===null};const Xee=Wee;var Yee=Object.prototype,Vee=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||Yee;return r===e};const ED=Vee;var Hee=function(r){return ao(r,"RegExp")};const Kee=Hee;var qee=function(r){return r===void 0};const Zee=qee;var Qee=function(r){return r instanceof Element||r instanceof Document};const Jee=Qee;function ete(r){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,16)};return t(r)}function tte(r){var t=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;t(r)}function H0(r,t){for(var e in t)t.hasOwnProperty(e)&&e!=="constructor"&&t[e]!==void 0&&(r[e]=t[e])}function _l(r,t,e,n){return t&&H0(r,t),e&&H0(r,e),n&&H0(r,n),r}var rte=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var e=r[0],n=1;n<r.length;n++){var i=r[n];Gi(i)&&(i=i.prototype),_l(e.prototype,i)}};const nte=rte;var Dm=function(r){if(typeof r!="object"||r===null)return r;var t;if(wn(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=Dm(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=Dm(r[i]):t[i]=r[i]}return t};const ite=Dm;function ate(r,t,e){var n;return function(){var i=this,a=arguments,o=function(){n=null,e||r.apply(i,a)},s=e&&!n;clearTimeout(n),n=setTimeout(o,t),s&&r.apply(i,a)}}function ote(r){var t,e,n,i=r||1;function a(s,u){++t>i&&(n=e,o(1),++t),e[s]=u}function o(s){t=0,e=Object.create(null),s||(n=Object.create(null))}return o(),{clear:o,has:function(s){return e[s]!==void 0||n[s]!==void 0},get:function(s){var u=e[s];if(u!==void 0)return u;if((u=n[s])!==void 0)return a(s,u),u},set:function(s,u){e[s]!==void 0?e[s]=u:a(s,u)}}}const _D=function(r,t,e){if(e===void 0&&(e=128),!Gi(r))throw new TypeError("Expected a function");var n=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var o=t?t.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var u=r.apply(this,i);return s.set(o,u),u};return n.cache=ote(e),n};var ste=5;function ute(r,t){if(Object.hasOwn)return Object.hasOwn(r,t);if(r==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(r),t)}function SD(r,t,e,n){e=e||0,n=n||ste;for(var i in t)if(ute(t,i)){var a=t[i];a!==null&&Fl(a)?(Fl(r[i])||(r[i]={}),e<n?SD(r[i],a,e+1,n):r[i]=t[i]):wn(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var lte=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)SD(r,t[n]);return r};const fte=lte;var cte=function(r,t,e,n){Gi(t)||(e=t,t=r,r=function(){});var i=Object.create?function(o,s){return Object.create(o,{constructor:{value:s}})}:function(o,s){function u(){}u.prototype=o;var l=new u;return l.constructor=s,l},a=i(t.prototype,r);return r.prototype=_l(a,r.prototype),r.superclass=i(t.prototype,t),_l(a,e),_l(r,n),r};const dte=cte;var hte=function(r,t){if(!_i(r))return-1;var e=Array.prototype.indexOf;if(e)return e.call(r,t);for(var n=-1,i=0;i<r.length;i++)if(r[i]===t){n=i;break}return n};const vte=hte;var pte=Object.prototype.hasOwnProperty;function gte(r){if(As(r))return!0;if(_i(r))return!r.length;var t=wD(r);if(t==="Map"||t==="Set")return!r.size;if(ED(r))return!Object.keys(r).length;for(var e in r)if(pte.call(r,e))return!1;return!0}var Nm=function(r,t){if(r===t)return!0;if(!r||!t||Ss(r)||Ss(t))return!1;if(_i(r)||_i(t)){if(r.length!==t.length)return!1;for(var e=!0,n=0;n<r.length&&(e=Nm(r[n],t[n]),!!e);n++);return e}if(jv(r)||jv(t)){var i=Object.keys(r),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,n=0;n<i.length&&(e=Nm(r[i[n]],t[i[n]]),!!e);n++);return e}return!1};const MD=Nm,yte=function(r,t,e){return Gi(e)?!!e(r,t):MD(r,t)};var mte=function(r,t){if(!_i(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];e.push(t(i,n))}return e};const bte=mte;var xte=function(r){return r};const wte=function(r,t){t===void 0&&(t=xte);var e={};return jp(r)&&!As(r)&&Object.keys(r).forEach(function(n){e[n]=t(r[n],n)}),e},Ete=function(r,t,e){for(var n=0,i=Ss(t)?t.split("."):t;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?e:r},_te=function(r,t,e){var n=r,i=Ss(t)?t.split("."):t;return i.forEach(function(a,o){o<i.length-1?(jp(n[a])||(n[a]=zo(i[o+1])?[]:{}),n=n[a]):n[a]=e}),r};var Ste=Object.prototype.hasOwnProperty;const Mte=function(r,t){if(r===null||!Fl(r))return{};var e={};return Bl(t,function(n){Ste.call(r,n)&&(e[n]=r[n])}),e},Cte=function(r,t){return gD(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})},Ate=function(r,t,e){var n,i,a,o,s=0;e||(e={});var u=function(){s=e.leading===!1?0:Date.now(),n=null,o=r.apply(i,a),n||(i=a=null)},l=function(){var f=Date.now();!s&&e.leading===!1&&(s=f);var c=t-(f-s);return i=this,a=arguments,c<=0||c>t?(n&&(clearTimeout(n),n=null),s=f,o=r.apply(i,a),n||(i=a=null)):!n&&e.trailing!==!1&&(n=setTimeout(u,c)),o};return l.cancel=function(){clearTimeout(n),s=0,n=i=a=null},l},Tte=function(r){return _i(r)?Array.prototype.slice.call(r):[]};var bh={};const Ite=function(r){return r=r||"g",bh[r]?bh[r]+=1:bh[r]=1,r+bh[r]},Ote=function(){},Lte=function(r){return r};function kte(r){return As(r)?0:_i(r)?r.length:Object.keys(r).length}var Dte=function(){function r(){this.map={}}return r.prototype.has=function(t){return this.map[t]!==void 0},r.prototype.get=function(t,e){var n=this.map[t];return n===void 0?e:n},r.prototype.set=function(t,e){this.map[t]=e},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(t){delete this.map[t]},r.prototype.size=function(){return Object.keys(this.map).length},r}();const Nte=Dte;var Pte=/rgba?\(([\s.,0-9]+)\)/;function Rte(){var r=document.createElement("i");return r.title="Web Colour Picker",r.style.display="none",document.body.appendChild(r),r}var xh;function Bte(r){if(r[0]==="#"&&r.length===7)return r;xh||(xh=Rte()),xh.style.color=r;var t=document.defaultView.getComputedStyle(xh,"").getPropertyValue("color"),e=Pte.exec(t),n=e[1].split(/\s*,\s*/).map(function(i){return Number(i)});return t=sD(n),t}var CD=_D(Bte,function(r){return r},256);function K0(r,t,e,n){return r[n]+(t[n]-r[n])*e}function Fte(r,t){var e=isNaN(Number(t))||t<0?0:t>1?1:Number(t),n=r.length-1,i=Math.floor(n*e),a=n*e-i,o=r[i],s=i===n?o:r[i+1];return sD([K0(o,s,a,0),K0(o,s,a,1),K0(o,s,a,2)])}function zte(r){var t=typeof r=="string"?r.split("-"):r,e=t.map(function(n){return oD(n.indexOf("#")===-1?CD(n):n)});return function(n){return Fte(e,n)}}var Gte=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,$te=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Ute=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function jte(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)}function Wte(r){if(jte(r)){var t,e=void 0;if(r[0]==="l"){var n=Gte.exec(r),i=+n[1]+90;e=n[2],t="linear-gradient("+i+"deg, "}else if(r[0]==="r"){t="radial-gradient(";var n=$te.exec(r);e=n[4]}var a=e.match(Ute);return a.forEach(function(o,s){var u=o.split(":");t+=u[1]+" "+Number(u[0])*100+"%",s!==a.length-1&&(t+=", ")}),t+=")",t}return r}function Xte(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return S1(n,e),no(r,n,t)}function Yte(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return M1(n,e),no(r,n,t)}function Vte(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return C1(n,e),no(r,n,t)}function Hte(r,t,e){return no(r,e,t)}function Kte(r,t){for(var e=r?[].concat(r):[1,0,0,0,1,0,0,0,1],n=0,i=t.length;n<i;n++){var a=t[n];switch(a[0]){case"t":Xte(e,e,[a[1],a[2]]);break;case"s":Vte(e,e,[a[1],a[2]]);break;case"r":Yte(e,e,a[1]);break;case"m":Hte(e,e,a[1]);break}}return e}function AD(r,t){return r[0]*t[1]-t[0]*r[1]}function qte(r,t,e){var n=CI(r,t),i=AD(r,t)>=0;return e?i?Math.PI*2-n:n:i?n:Math.PI*2-n}function Zte(r,t,e){return e?(r[0]=t[1],r[1]=-1*t[0]):(r[0]=-1*t[1],r[1]=t[0]),r}function Qte(r,t){if(t==="off")return[].concat(r);var e=typeof t=="number"&&t>=1?Math.pow(10,t):1;return r.map(function(n){var i=n.slice(1).map(Number).map(function(a){return t?Math.round(a*e)/e:Math.round(a)});return[n[0]].concat(i)})}function Jte(r,t){return t===void 0&&(t="off"),Qte(r,t).map(function(e){return e[0]+e.slice(1).join(" ")}).join("")}var TD={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function ere(r,t,e){if(r[e].length>7){r[e].shift();for(var n=r[e],i=e;n.length;)t[e]="A",r.splice(i+=1,0,["C"].concat(n.splice(0,6)));r.splice(e,1)}}var tc={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ID(r){return Array.isArray(r)&&r.every(function(t){var e=t[0].toLowerCase();return tc[e]===t.length-1&&"achlmqstvz".includes(e)})}function OD(r){return ID(r)&&r.every(function(t){var e=t[0];return e===e.toUpperCase()})}function LD(r){return OD(r)&&r.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}function OS(r){for(var t=r.pathValue[r.segmentStart],e=t.toLowerCase(),n=r.data;n.length>=tc[e]&&(e==="m"&&n.length>2?(r.segments.push([t].concat(n.splice(0,2))),e="l",t=t==="m"?"l":"L"):r.segments.push([t].concat(n.splice(0,tc[e]))),!!tc[e]););}function tre(r){var t=r.index,e=r.pathValue,n=e.charCodeAt(t);if(n===48){r.param=0,r.index+=1;return}if(n===49){r.param=1,r.index+=1;return}r.err='[path-util]: invalid Arc flag "'+e[t]+'", expecting 0 or 1 at index '+t}function rre(r){return r>=48&&r<=57||r===43||r===45||r===46}function el(r){return r>=48&&r<=57}function nre(r){var t=r.max,e=r.pathValue,n=r.index,i=n,a=!1,o=!1,s=!1,u=!1,l;if(i>=t){r.err="[path-util]: Invalid path value at index "+i+', "pathValue" is missing param';return}if(l=e.charCodeAt(i),(l===43||l===45)&&(i+=1,l=e.charCodeAt(i)),!el(l)&&l!==46){r.err="[path-util]: Invalid path value at index "+i+', "'+e[i]+'" is not a number';return}if(l!==46){if(a=l===48,i+=1,l=e.charCodeAt(i),a&&i<t&&l&&el(l)){r.err="[path-util]: Invalid path value at index "+n+', "'+e[n]+'" illegal number';return}for(;i<t&&el(e.charCodeAt(i));)i+=1,o=!0;l=e.charCodeAt(i)}if(l===46){for(u=!0,i+=1;el(e.charCodeAt(i));)i+=1,s=!0;l=e.charCodeAt(i)}if(l===101||l===69){if(u&&!o&&!s){r.err="[path-util]: Invalid path value at index "+i+', "'+e[i]+'" invalid float exponent';return}if(i+=1,l=e.charCodeAt(i),(l===43||l===45)&&(i+=1),i<t&&el(e.charCodeAt(i)))for(;i<t&&el(e.charCodeAt(i));)i+=1;else{r.err="[path-util]: Invalid path value at index "+i+', "'+e[i]+'" invalid integer exponent';return}}r.index=i,r.param=+r.pathValue.slice(n,i)}function ire(r){var t=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return r===10||r===13||r===8232||r===8233||r===32||r===9||r===11||r===12||r===160||r>=5760&&t.includes(r)}function nv(r){for(var t=r.pathValue,e=r.max;r.index<e&&ire(t.charCodeAt(r.index));)r.index+=1}function are(r){switch(r|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function ore(r){return(r|32)===97}function sre(r){var t=r.max,e=r.pathValue,n=r.index,i=e.charCodeAt(n),a=tc[e[n].toLowerCase()];if(r.segmentStart=n,!are(i)){r.err='[path-util]: Invalid path value "'+e[n]+'" is not a path command';return}if(r.index+=1,nv(r),r.data=[],!a){OS(r);return}for(;;){for(var o=a;o>0;o-=1){if(ore(i)&&(o===3||o===4)?tre(r):nre(r),r.err.length)return;r.data.push(r.param),nv(r),r.index<t&&e.charCodeAt(r.index)===44&&(r.index+=1,nv(r))}if(r.index>=r.max||!rre(e.charCodeAt(r.index)))break}OS(r)}var ure=function(){function r(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return r}();function Bb(r){if(ID(r))return[].concat(r);var t=new ure(r);for(nv(t);t.index<t.max&&!t.err.length;)sre(t);return t.err?t.err:t.segments}function kD(r){if(OD(r))return[].concat(r);var t=Bb(r),e=0,n=0,i=0,a=0;return t.map(function(o){var s=o.slice(1).map(Number),u=o[0],l=u.toUpperCase();if(u==="M")return e=s[0],n=s[1],i=e,a=n,["M",e,n];var f;if(u!==l)switch(l){case"A":f=[l,s[0],s[1],s[2],s[3],s[4],s[5]+e,s[6]+n];break;case"V":f=[l,s[0]+n];break;case"H":f=[l,s[0]+e];break;default:{var c=s.map(function(h,v){return h+(v%2?n:e)});f=[l].concat(c)}}else f=[l].concat(s);var d=f.length;switch(l){case"Z":e=i,n=a;break;case"H":e=f[1];break;case"V":n=f[1];break;default:e=f[d-2],n=f[d-1],l==="M"&&(i=e,a=n)}return f})}function lre(r,t){var e=r[0],n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=r.slice(1).map(Number),u=r;if("TQ".includes(e)||(t.qx=null,t.qy=null),e==="H")u=["L",r[1],i];else if(e==="V")u=["L",n,r[1]];else if(e==="S"){var l=n*2-a,f=i*2-o;t.x1=l,t.y1=f,u=["C",l,f].concat(s)}else if(e==="T"){var c=n*2-t.qx,d=i*2-t.qy;t.qx=c,t.qy=d,u=["Q",c,d].concat(s)}else if(e==="Q"){var h=s[0],v=s[1];t.qx=h,t.qy=v}return u}function Wp(r){if(LD(r))return[].concat(r);for(var t=kD(r),e=F({},TD),n=0;n<t.length;n+=1){t[n]=lre(t[n],e);var i=t[n],a=i.length;e.x1=+i[a-2],e.y1=+i[a-1],e.x2=+i[a-4]||e.x1,e.y2=+i[a-3]||e.y1}return t}function fre(r){return LD(r)&&r.every(function(t){var e=t[0];return"MC".includes(e)})}function wh(r,t,e){var n=r*Math.cos(e)-t*Math.sin(e),i=r*Math.sin(e)+t*Math.cos(e);return{x:n,y:i}}function Fb(r,t,e,n,i,a,o,s,u,l){var f=r,c=t,d=e,h=n,v=s,p=u,g=Math.PI*120/180,y=Math.PI/180*(+i||0),m=[],b,x,w,E,_;if(l)x=l[0],w=l[1],E=l[2],_=l[3];else{b=wh(f,c,-y),f=b.x,c=b.y,b=wh(v,p,-y),v=b.x,p=b.y;var M=(f-v)/2,C=(c-p)/2,S=M*M/(d*d)+C*C/(h*h);S>1&&(S=Math.sqrt(S),d*=S,h*=S);var A=d*d,T=h*h,I=(a===o?-1:1)*Math.sqrt(Math.abs((A*T-A*C*C-T*M*M)/(A*C*C+T*M*M)));E=I*d*C/h+(f+v)/2,_=I*-h*M/d+(c+p)/2,x=Math.asin(((c-_)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((p-_)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),x=f<E?Math.PI-x:x,w=v<E?Math.PI-w:w,x<0&&(x=Math.PI*2+x),w<0&&(w=Math.PI*2+w),o&&x>w&&(x-=Math.PI*2),!o&&w>x&&(w-=Math.PI*2)}var k=w-x;if(Math.abs(k)>g){var P=w,N=v,z=p;w=x+g*(o&&w>x?1:-1),v=E+d*Math.cos(w),p=_+h*Math.sin(w),m=Fb(v,p,d,h,i,0,o,N,z,[w,P,E,_])}k=w-x;var W=Math.cos(x),D=Math.sin(x),R=Math.cos(w),H=Math.sin(w),ee=Math.tan(k/4),Y=4/3*d*ee,X=4/3*h*ee,fe=[f,c],we=[f+Y*D,c-X*W],Ae=[v+Y*H,p-X*R],Ke=[v,p];if(we[0]=2*fe[0]-we[0],we[1]=2*fe[1]-we[1],l)return we.concat(Ae,Ke,m);m=we.concat(Ae,Ke,m);for(var ot=[],nt=0,Ct=m.length;nt<Ct;nt+=1)ot[nt]=nt%2?wh(m[nt-1],m[nt],y).y:wh(m[nt],m[nt+1],y).x;return ot}function cre(r,t,e,n,i,a){var o=.3333333333333333,s=2/3;return[o*r+s*e,o*t+s*n,o*i+s*e,o*a+s*n,i,a]}function us(r,t,e){var n=r[0],i=r[1],a=t[0],o=t[1];return[n+(a-n)*e,i+(o-i)*e]}var LS=function(r,t,e,n){var i=.5,a=us([r,t],[e,n],i);return Bi(Bi([],a,!0),[e,n,e,n],!1)};function dre(r,t){var e=r[0],n=r.slice(1).map(Number),i=n[0],a=n[1],o,s=t.x1,u=t.y1,l=t.x,f=t.y;switch("TQ".includes(e)||(t.qx=null,t.qy=null),e){case"M":return t.x=i,t.y=a,r;case"A":return o=[s,u].concat(n),["C"].concat(Fb(o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],o[8],o[9]));case"Q":return t.qx=i,t.qy=a,o=[s,u].concat(n),["C"].concat(cre(o[0],o[1],o[2],o[3],o[4],o[5]));case"L":return["C"].concat(LS(s,u,i,a));case"Z":return s===l&&u===f?["C",s,u,l,f,l,f]:["C"].concat(LS(s,u,l,f))}return r}function DD(r,t){if(t===void 0&&(t=!1),fre(r)){var e=[].concat(r);return t?[e,[]]:e}for(var n=Wp(r),i=F({},TD),a=[],o="",s=n.length,u,l,f=[],c=0;c<s;c+=1){n[c]&&(o=n[c][0]),a[c]=o;var d=dre(n[c],i);n[c]=d,ere(n,a,c),s=n.length,o==="Z"&&f.push(c),u=n[c],l=u.length,i.x1=+u[l-2],i.y1=+u[l-1],i.x2=+u[l-4]||i.x1,i.y2=+u[l-3]||i.y1}return t?[n,f]:n}function hre(r){return r.map(function(t){return Array.isArray(t)?[].concat(t):t})}function vre(r){var t=r.slice(1).map(function(e,n,i){return n?i[n-1].slice(-2).concat(e.slice(1)):r[0].slice(1).concat(e.slice(1))}).map(function(e){return e.map(function(n,i){return e[e.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(t[0].slice(0,2))].concat(t.map(function(e){return["C"].concat(e.slice(2))}))}function ql(r,t){return Math.sqrt((r[0]-t[0])*(r[0]-t[0])+(r[1]-t[1])*(r[1]-t[1]))}function Pm(r,t,e,n,i){var a=ql([r,t],[e,n]),o={x:0,y:0};if(typeof i=="number")if(i<=0)o={x:r,y:t};else if(i>=a)o={x:e,y:n};else{var s=us([r,t],[e,n],i/a),u=s[0],l=s[1];o={x:u,y:l}}return{length:a,point:o,min:{x:Math.min(r,e),y:Math.min(t,n)},max:{x:Math.max(r,e),y:Math.max(t,n)}}}function kS(r,t){var e=r.x,n=r.y,i=t.x,a=t.y,o=e*i+n*a,s=Math.sqrt((Math.pow(e,2)+Math.pow(n,2))*(Math.pow(i,2)+Math.pow(a,2))),u=e*a-n*i<0?-1:1,l=u*Math.acos(o/s);return l}function pre(r,t,e,n,i,a,o,s,u,l){var f=Math.abs,c=Math.sin,d=Math.cos,h=Math.sqrt,v=Math.PI,p=f(e),g=f(n),y=(i%360+360)%360,m=y*(v/180);if(r===s&&t===u)return{x:r,y:t};if(p===0||g===0)return Pm(r,t,s,u,l).point;var b=(r-s)/2,x=(t-u)/2,w={x:d(m)*b+c(m)*x,y:-c(m)*b+d(m)*x},E=Math.pow(w.x,2)/Math.pow(p,2)+Math.pow(w.y,2)/Math.pow(g,2);E>1&&(p*=h(E),g*=h(E));var _=Math.pow(p,2)*Math.pow(g,2)-Math.pow(p,2)*Math.pow(w.y,2)-Math.pow(g,2)*Math.pow(w.x,2),M=Math.pow(p,2)*Math.pow(w.y,2)+Math.pow(g,2)*Math.pow(w.x,2),C=_/M;C=C<0?0:C;var S=(a!==o?1:-1)*h(C),A={x:S*(p*w.y/g),y:S*(-(g*w.x)/p)},T={x:d(m)*A.x-c(m)*A.y+(r+s)/2,y:c(m)*A.x+d(m)*A.y+(t+u)/2},I={x:(w.x-A.x)/p,y:(w.y-A.y)/g},k=kS({x:1,y:0},I),P={x:(-w.x-A.x)/p,y:(-w.y-A.y)/g},N=kS(I,P);!o&&N>0?N-=2*v:o&&N<0&&(N+=2*v),N%=2*v;var z=k+N*l,W=p*d(z),D=g*c(z),R={x:d(m)*W-c(m)*D+T.x,y:c(m)*W+d(m)*D+T.y};return R}function gre(r,t,e,n,i,a,o,s,u,l,f){var c,d=f.bbox,h=d===void 0?!0:d,v=f.length,p=v===void 0?!0:v,g=f.sampleSize,y=g===void 0?30:g,m=typeof l=="number",b=r,x=t,w=0,E=[b,x,w],_=[b,x],M=0,C={x:0,y:0},S=[{x:b,y:x}];m&&l<=0&&(C={x:b,y:x});for(var A=0;A<=y;A+=1){if(M=A/y,c=pre(r,t,e,n,i,a,o,s,u,M),b=c.x,x=c.y,h&&S.push({x:b,y:x}),p&&(w+=ql(_,[b,x])),_=[b,x],m&&w>=l&&l>E[2]){var T=(w-l)/(w-E[2]);C={x:_[0]*(1-T)+E[0]*T,y:_[1]*(1-T)+E[1]*T}}E=[b,x,w]}return m&&l>=w&&(C={x:s,y:u}),{length:w,point:C,min:{x:Math.min.apply(null,S.map(function(I){return I.x})),y:Math.min.apply(null,S.map(function(I){return I.y}))},max:{x:Math.max.apply(null,S.map(function(I){return I.x})),y:Math.max.apply(null,S.map(function(I){return I.y}))}}}function yre(r,t,e,n,i,a,o,s,u){var l=1-u;return{x:Math.pow(l,3)*r+3*Math.pow(l,2)*u*e+3*l*Math.pow(u,2)*i+Math.pow(u,3)*o,y:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*a+Math.pow(u,3)*s}}function ND(r,t,e,n,i,a,o,s,u,l){var f,c=l.bbox,d=c===void 0?!0:c,h=l.length,v=h===void 0?!0:h,p=l.sampleSize,g=p===void 0?10:p,y=typeof u=="number",m=r,b=t,x=0,w=[m,b,x],E=[m,b],_=0,M={x:0,y:0},C=[{x:m,y:b}];y&&u<=0&&(M={x:m,y:b});for(var S=0;S<=g;S+=1){if(_=S/g,f=yre(r,t,e,n,i,a,o,s,_),m=f.x,b=f.y,d&&C.push({x:m,y:b}),v&&(x+=ql(E,[m,b])),E=[m,b],y&&x>=u&&u>w[2]){var A=(x-u)/(x-w[2]);M={x:E[0]*(1-A)+w[0]*A,y:E[1]*(1-A)+w[1]*A}}w=[m,b,x]}return y&&u>=x&&(M={x:o,y:s}),{length:x,point:M,min:{x:Math.min.apply(null,C.map(function(T){return T.x})),y:Math.min.apply(null,C.map(function(T){return T.y}))},max:{x:Math.max.apply(null,C.map(function(T){return T.x})),y:Math.max.apply(null,C.map(function(T){return T.y}))}}}function mre(r,t,e,n,i,a,o){var s=1-o;return{x:Math.pow(s,2)*r+2*s*o*e+Math.pow(o,2)*i,y:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*a}}function bre(r,t,e,n,i,a,o,s){var u,l=s.bbox,f=l===void 0?!0:l,c=s.length,d=c===void 0?!0:c,h=s.sampleSize,v=h===void 0?10:h,p=typeof o=="number",g=r,y=t,m=0,b=[g,y,m],x=[g,y],w=0,E={x:0,y:0},_=[{x:g,y}];p&&o<=0&&(E={x:g,y});for(var M=0;M<=v;M+=1){if(w=M/v,u=mre(r,t,e,n,i,a,w),g=u.x,y=u.y,f&&_.push({x:g,y}),d&&(m+=ql(x,[g,y])),x=[g,y],p&&m>=o&&o>b[2]){var C=(m-o)/(m-b[2]);E={x:x[0]*(1-C)+b[0]*C,y:x[1]*(1-C)+b[1]*C}}b=[g,y,m]}return p&&o>=m&&(E={x:i,y:a}),{length:m,point:E,min:{x:Math.min.apply(null,_.map(function(S){return S.x})),y:Math.min.apply(null,_.map(function(S){return S.y}))},max:{x:Math.max.apply(null,_.map(function(S){return S.x})),y:Math.max.apply(null,_.map(function(S){return S.y}))}}}function Xp(r,t,e){for(var n,i,a,o,s,u,l=Wp(r),f=typeof t=="number",c,d=[],h,v=0,p=0,g=0,y=0,m,b=[],x=[],w=0,E={x:0,y:0},_=E,M=E,C=E,S=0,A=0,T=l.length;A<T;A+=1)m=l[A],h=m[0],c=h==="M",d=c?d:[v,p].concat(m.slice(1)),c?(g=m[1],y=m[2],E={x:g,y},_=E,w=0,f&&t<.001&&(C=E)):h==="L"?(n=Pm(d[0],d[1],d[2],d[3],(t||0)-S),w=n.length,E=n.min,_=n.max,M=n.point):h==="A"?(i=gre(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(t||0)-S,e||{}),w=i.length,E=i.min,_=i.max,M=i.point):h==="C"?(a=ND(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(t||0)-S,e||{}),w=a.length,E=a.min,_=a.max,M=a.point):h==="Q"?(o=bre(d[0],d[1],d[2],d[3],d[4],d[5],(t||0)-S,e||{}),w=o.length,E=o.min,_=o.max,M=o.point):h==="Z"&&(d=[v,p,g,y],s=Pm(d[0],d[1],d[2],d[3],(t||0)-S),w=s.length,E=s.min,_=s.max,M=s.point),f&&S<t&&S+w>=t&&(C=M),x.push(_),b.push(E),S+=w,u=h!=="Z"?m.slice(-2):[g,y],v=u[0],p=u[1];return f&&t>=S&&(C={x:v,y:p}),{length:S,point:C,min:{x:Math.min.apply(null,b.map(function(I){return I.x})),y:Math.min.apply(null,b.map(function(I){return I.y}))},max:{x:Math.max.apply(null,x.map(function(I){return I.x})),y:Math.max.apply(null,x.map(function(I){return I.y}))}}}function xre(r,t){if(!r)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var e=Xp(r,void 0,F(F({},t),{length:!1})),n=e.min,i=n.x,a=n.y,o=e.max,s=o.x,u=o.y,l=s-i,f=u-a;return{width:l,height:f,x:i,y:a,x2:s,y2:u,cx:i+l/2,cy:a+f/2,cz:Math.max(l,f)+Math.min(l,f)/2}}function rc(r,t){return Xp(r,void 0,F(F({},t),{bbox:!1,length:!0})).length}function wre(r,t){if(!r)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var e=Xp(r,void 0,F(F({},t),{bbox:!0,length:!0})),n=e.length,i=e.min,a=i.x,o=i.y,s=e.max,u=s.x,l=s.y,f=u-a,c=l-o;return{length:n,width:f,height:c,x:a,y:o,x2:u,y2:l,cx:a+f/2,cy:o+c/2,cz:Math.max(f,c)+Math.min(f,c)/2}}function Ere(r){var t=r.length,e=t-1;return r.map(function(n,i){return r.map(function(a,o){var s=i+o,u;return o===0||r[s]&&r[s][0]==="M"?(u=r[s],["M"].concat(u.slice(-2))):(s>=t&&(s-=e),r[s])})})}function _re(r,t){var e=r.length-1,n=[],i=0,a=0,o=Ere(r);return o.forEach(function(s,u){r.slice(1).forEach(function(l,f){a+=ql(r[(u+f)%e].slice(-2),t[f%e].slice(-2))}),n[u]=a,a=0}),i=n.indexOf(Math.min.apply(null,n)),o[i]}function Sre(r,t,e,n,i,a,o,s){return 3*((s-t)*(e+i)-(o-r)*(n+a)+n*(r-i)-e*(t-a)+s*(i+r/3)-o*(a+t/3))/20}function PD(r){var t=0,e=0,n=0;return DD(r).map(function(i){var a;switch(i[0]){case"M":return t=i[1],e=i[2],0;default:var o=i.slice(1),s=o[0],u=o[1],l=o[2],f=o[3],c=o[4],d=o[5];return n=Sre(t,e,s,u,l,f,c,d),a=i.slice(-2),t=a[0],e=a[1],n}}).reduce(function(i,a){return i+a},0)}function Mre(r){return PD(r)>=0}function iv(r,t,e){return Xp(r,t,F(F({},e),{bbox:!1,length:!0})).point}function Cre(r,t){var e=Bb(r);if(typeof e=="string")throw TypeError(e);var n=e.slice(),i=rc(n),a=n.length-1,o=0,s=0,u=e[0],l=u.slice(-2),f=l[0],c=l[1],d={x:f,y:c};if(a<=0||!t||!Number.isFinite(t))return{segment:u,index:0,length:s,point:d,lengthAtSegment:o};if(t>=i)return n=e.slice(0,-1),o=rc(n),s=i-o,{segment:e[a],index:a,length:s,lengthAtSegment:o};for(var h=[];a>0;)u=n[a],n=n.slice(0,-1),o=rc(n),s=i-o,i=o,h.push({segment:u,index:a,length:s,lengthAtSegment:o}),a-=1;return h.find(function(v){var p=v.lengthAtSegment;return p<=t})}function Are(r,t){for(var e=Bb(r),n=Wp(e),i=rc(e),a=function(w){var E=w.x-t.x,_=w.y-t.y;return E*E+_*_},o=8,s,u=0,l,f=0,c=1/0,d=0;d<=i;d+=o)s=iv(n,d),u=a(s),u<c&&(l=s,f=d,c=u);o/=2;for(var h,v,p=0,g=0,y=0,m=0;o>.5;)p=f-o,h=iv(n,p),y=a(h),g=f+o,v=iv(n,g),m=a(v),p>=0&&y<c?(l=h,f=p,c=y):g<=i&&m<c?(l=v,f=g,c=m):o/=2;var b=Cre(e,f),x=Math.sqrt(c);return{closest:l,distance:x,segment:b}}function Tre(r,t){var e=Are(r,t).distance;return Math.abs(e)<.001}function Ire(r,t){t===void 0&&(t=.5);var e=r.slice(0,2),n=r.slice(2,4),i=r.slice(4,6),a=r.slice(6,8),o=us(e,n,t),s=us(n,i,t),u=us(i,a,t),l=us(o,s,t),f=us(s,u,t),c=us(l,f,t);return[["C"].concat(o,l,c),["C"].concat(f,u,a)]}function DS(r){return r.map(function(t,e,n){var i=e&&n[e-1].slice(-2).concat(t.slice(1)),a=e?ND(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,o;return e?o=a?Ire(i):[t,t]:o=[t],{s:t,ss:o,l:a}})}function RD(r,t,e){var n=DS(r),i=DS(t),a=n.length,o=i.length,s=n.filter(function(g){return g.l}).length,u=i.filter(function(g){return g.l}).length,l=n.filter(function(g){return g.l}).reduce(function(g,y){var m=y.l;return g+m},0)/s||0,f=i.filter(function(g){return g.l}).reduce(function(g,y){var m=y.l;return g+m},0)/u||0,c=e||Math.max(a,o),d=[l,f],h=[c-a,c-o],v=0,p=[n,i].map(function(g,y){return g.l===c?g.map(function(m){return m.s}):g.map(function(m,b){return v=b&&h[y]&&m.l>=d[y],h[y]-=v?1:0,v?m.ss:[m.s]}).flat()});return p[0].length===p[1].length?p:RD(p[0],p[1],c)}var Ore=1e-6;function q0(r){return Math.abs(r)<Ore?0:r<0?-1:1}function Lre(r,t,e){return(e[0]-r[0])*(t[1]-r[1])===(t[0]-r[0])*(e[1]-r[1])&&Math.min(r[0],t[0])<=e[0]&&e[0]<=Math.max(r[0],t[0])&&Math.min(r[1],t[1])<=e[1]&&e[1]<=Math.max(r[1],t[1])}function Rm(r,t,e){var n=!1,i=r.length;if(i<=2)return!1;for(var a=0;a<i;a++){var o=r[a],s=r[(a+1)%i];if(Lre(o,s,[t,e]))return!0;q0(o[1]-e)>0!=q0(s[1]-e)>0&&q0(t-(e-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(n=!n)}return n}var NS=function(r,t,e){return r>=t&&r<=e};function kre(r,t,e,n){var i=.001,a={x:e.x-r.x,y:e.y-r.y},o={x:t.x-r.x,y:t.y-r.y},s={x:n.x-e.x,y:n.y-e.y},u=o.x*s.y-o.y*s.x,l=u*u,f=o.x*o.x+o.y*o.y,c=s.x*s.x+s.y*s.y,d=null;if(l>i*f*c){var h=(a.x*s.y-a.y*s.x)/u,v=(a.x*o.y-a.y*o.x)/u;NS(h,0,1)&&NS(v,0,1)&&(d={x:r.x+h*o.x,y:r.y+h*o.y})}return d}function PS(r){for(var t=[],e=r.length,n=0;n<e-1;n++){var i=r[n],a=r[n+1];t.push({from:{x:i[0],y:i[1]},to:{x:a[0],y:a[1]}})}if(t.length>1){var o=r[0],s=r[e-1];t.push({from:{x:s[0],y:s[1]},to:{x:o[0],y:o[1]}})}return t}function Dre(r,t){var e=!1;return r.forEach(function(n){if(kre(n.from,n.to,t.from,t.to))return e=!0,!1}),e}function RS(r){var t=r.map(function(n){return n[0]}),e=r.map(function(n){return n[1]});return{minX:Math.min.apply(null,t),maxX:Math.max.apply(null,t),minY:Math.min.apply(null,e),maxY:Math.max.apply(null,e)}}function Nre(r,t){return!(t.minX>r.maxX||t.maxX<r.minX||t.minY>r.maxY||t.maxY<r.minY)}function Pre(r,t){if(r.length<2||t.length<2)return!1;var e=RS(r),n=RS(t);if(!Nre(e,n))return!1;var i=!1;if(t.forEach(function(u){if(Rm(r,u[0],u[1]))return i=!0,!1}),i||(r.forEach(function(u){if(Rm(t,u[0],u[1]))return i=!0,!1}),i))return!0;var a=PS(r),o=PS(t),s=!1;return o.forEach(function(u){if(Dre(a,u))return s=!0,!1}),s}function Rre(r){var t=document.createElement("div");t.innerHTML=r;var e=t.childNodes[0];return e&&t.contains(e)&&t.removeChild(e),e}function Bre(r,t){if(r)return Object.keys(t).forEach(function(e){r.style[e]=t[e]}),r}const Fre=Object.freeze(Object.defineProperty({__proto__:null,Cache:Nte,angleTo:qte,arcToCubic:Fb,assign:_l,augment:nte,clamp:KJ,clearAnimationFrame:tte,clone:ite,clonePath:hre,contains:Uv,createDOM:Rre,debounce:ate,deepMix:fte,difference:sJ,direction:AD,distanceSquareRoot:ql,each:Bl,endsWith:BJ,equalizeSegments:RD,every:zJ,extend:dte,filter:uD,find:dJ,findIndex:hJ,firstValue:pJ,fixedBase:ZJ,flatten:yJ,flattenDeep:mJ,forIn:Bl,get:Ete,getDrawDirection:Mre,getPathArea:PD,getPathBBox:xre,getPathBBoxTotalLength:wre,getPointAtLength:iv,getRange:xJ,getRotatedCurve:_re,getTotalLength:rc,getType:wD,getWrapBehavior:WJ,gradient:zte,group:jJ,groupBy:mD,groupToMap:bD,has:IS,hasKey:IS,hasValue:_ee,head:NJ,identity:Lte,includes:Uv,indexOf:vte,isArguments:Ree,isArray:wn,isArrayLike:_i,isBoolean:Fee,isDate:Gee,isDecimal:JJ,isElement:Jee,isEmpty:gte,isEqual:MD,isEqualWith:yte,isError:Uee,isEven:tee,isFinite:jee,isFunction:Gi,isInteger:nee,isMatch:fD,isNegative:aee,isNil:As,isNull:Xee,isNumber:zo,isNumberEqual:see,isObject:jp,isObjectLike:jv,isOdd:lee,isPlainObject:Fl,isPointInPolygon:Rm,isPointInStroke:Tre,isPolygonsIntersect:Pre,isPositive:cee,isPrototype:ED,isRegExp:Kee,isString:Ss,isType:ao,isUndefined:Zee,keys:lD,last:PJ,lowerCase:Mee,lowerFirst:Aee,map:bte,mapValues:wte,max:dD,maxBy:dee,memoize:_D,min:hD,minBy:hee,mix:_l,mod:pee,modifyCSS:Bre,noop:Ote,normalizePath:Wp,number2color:YJ,omit:Cte,parseRadius:VJ,path2Absolute:kD,path2Curve:DD,path2String:Jte,pick:Mte,pull:SJ,pullAt:pD,reduce:gD,remove:IJ,requestAnimationFrame:ete,reverseCurve:vre,rgb2arr:oD,set:_te,size:kte,some:$J,sortBy:OJ,startsWith:RJ,substitute:Tee,throttle:Ate,toArray:Tte,toCSSGradient:Wte,toDegree:mee,toInteger:bee,toRGB:CD,toRadian:Eee,toString:Qc,transform:Kte,union:kJ,uniq:yD,uniqueId:Ite,upperCase:Oee,upperFirst:kee,values:xD,valuesOfKey:DJ,vertical:Zte,wrapBehavior:XJ},Symbol.toStringTag,{value:"Module"})),BD=to(Fre);Object.defineProperty(Rb,"__esModule",{value:!0});var zre=BD,Gre=function(r){for(var t={},e=r.nodes().filter(function(c){var d;return!(!((d=r.children(c))===null||d===void 0)&&d.length)}),n=e.map(function(c){return r.node(c).rank}),i=(0,zre.max)(n),a=[],o=0;o<i+1;o++)a.push([]);var s=function(c){var d;if(!t.hasOwnProperty(c)){t[c]=!0;var h=r.node(c);isNaN(h.rank)||a[h.rank].push(c),(d=r.successors(c))===null||d===void 0||d.forEach(function(v){return s(v)})}},u=e.sort(function(c,d){return r.node(c).rank-r.node(d).rank}),l=u.filter(function(c){return r.node(c).fixorder!==void 0}),f=l.sort(function(c,d){return r.node(c).fixorder-r.node(d).fixorder});return f==null||f.forEach(function(c){isNaN(r.node(c).rank)||a[r.node(c).rank].push(c),t[c]=!0}),u==null||u.forEach(s),a};Rb.default=Gre;var zb={};Object.defineProperty(zb,"__esModule",{value:!0});var $re=zi,Ure=function(r,t,e){for(var n=(0,$re.zipObject)(e,e.map(function(f,c){return c})),i=t.map(function(f){var c,d=(c=r.outEdges(f))===null||c===void 0?void 0:c.map(function(h){return{pos:n[h.w]||0,weight:r.edge(h).weight}});return d==null?void 0:d.sort(function(h,v){return h.pos-v.pos})}),a=i.flat().filter(function(f){return f!==void 0}),o=1;o<e.length;)o<<=1;var s=2*o-1;o-=1;var u=Array(s).fill(0,0,s),l=0;return a==null||a.forEach(function(f){if(f){var c=f.pos+o;u[c]+=f.weight;for(var d=0;c>0;)c%2&&(d+=u[c+1]),c=c-1>>1,u[c]+=f.weight;l+=f.weight*d}}),l},jre=function(r,t){for(var e=0,n=1;n<(t==null?void 0:t.length);n+=1)e+=Ure(r,t[n-1],t[n]);return e};zb.default=jre;var Gb={};Object.defineProperty(Gb,"__esModule",{value:!0});var Wre=Fo,Xre=function(r,t,e){var n=Yre(r),i=new Wre.Graph({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return r.node(a)});return r.nodes().forEach(function(a){var o,s=r.node(a),u=r.parent(a);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(i.setNode(a),i.setParent(a,u||n),(o=r[e](a))===null||o===void 0||o.forEach(function(l){var f=l.v===a?l.w:l.v,c=i.edgeFromArgs(f,a),d=c!==void 0?c.weight:0;i.setEdge(f,a,{weight:r.edge(l).weight+d})}),s.hasOwnProperty("minRank")&&i.setNode(a,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),i},Yre=function(r){for(var t;r.hasNode(t="_root".concat(Math.random())););return t};Gb.default=Xre;var $b={};Object.defineProperty($b,"__esModule",{value:!0});var Vre=function(r,t,e){var n={},i;e==null||e.forEach(function(a){for(var o=r.parent(a),s,u;o;){if(s=r.parent(o),s?(u=n[s],n[s]=o):(u=i,i=o),u&&u!==o){t.setEdge(u,o);return}o=s}})};$b.default=Vre;var Ub={},jb={};Object.defineProperty(jb,"__esModule",{value:!0});var Hre=function(r,t){return t.map(function(e){var n=r.inEdges(e);if(!(n!=null&&n.length))return{v:e};{var i={sum:0,weight:0};return n==null||n.forEach(function(a){var o=r.edge(a),s=r.node(a.v);i.sum+=o.weight*s.order,i.weight+=o.weight}),{v:e,barycenter:i.sum/i.weight,weight:i.weight}}})};jb.default=Hre;var Wb={};Object.defineProperty(Wb,"__esModule",{value:!0});var Kre=function(r,t){var e,n,i,a={};r==null||r.forEach(function(s,u){a[s.v]={i:u,indegree:0,in:[],out:[],vs:[s.v]};var l=a[s.v];s.barycenter!==void 0&&(l.barycenter=s.barycenter,l.weight=s.weight)}),(e=t.edges())===null||e===void 0||e.forEach(function(s){var u=a[s.v],l=a[s.w];u!==void 0&&l!==void 0&&(l.indegree++,u.out.push(a[s.w]))});var o=(i=(n=Object.values(a)).filter)===null||i===void 0?void 0:i.call(n,function(s){return!s.indegree});return qre(o)},qre=function(r){for(var t,e,n=[],i=function(l){return function(f){f.merged||(f.barycenter===void 0||l.barycenter===void 0||f.barycenter>=l.barycenter)&&Zre(l,f)}},a=function(l){return function(f){f.in.push(l),--f.indegree===0&&r.push(f)}},o=function(){var l=r.pop();n.push(l),(t=l.in.reverse())===null||t===void 0||t.forEach(function(f){return i(l)(f)}),(e=l.out)===null||e===void 0||e.forEach(function(f){return a(l)(f)})};r!=null&&r.length;)o();var s=n.filter(function(l){return!l.merged}),u=["vs","i","barycenter","weight"];return s.map(function(l){var f={};return u==null||u.forEach(function(c){l[c]!==void 0&&(f[c]=l[c])}),f})},Zre=function(r,t){var e,n=0,i=0;r.weight&&(n+=r.barycenter*r.weight,i+=r.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),r.vs=(e=t.vs)===null||e===void 0?void 0:e.concat(r.vs),r.barycenter=n/i,r.weight=i,r.i=Math.min(t.i,r.i),t.merged=!0};Wb.default=Kre;var Xb={};Object.defineProperty(Xb,"__esModule",{value:!0});var Qre=zi,Jre=function(r,t,e,n){var i=(0,Qre.partition)(r,function(d){var h=d.hasOwnProperty("fixorder")&&!isNaN(d.fixorder);return n?!h&&d.hasOwnProperty("barycenter"):h||d.hasOwnProperty("barycenter")}),a=i.lhs,o=i.rhs.sort(function(d,h){return-d.i- -h.i}),s=[],u=0,l=0,f=0;a==null||a.sort(ene(!!t,!!e)),f=BS(s,o,f),a==null||a.forEach(function(d){var h;f+=(h=d.vs)===null||h===void 0?void 0:h.length,s.push(d.vs),u+=d.barycenter*d.weight,l+=d.weight,f=BS(s,o,f)});var c={vs:s.flat()};return l&&(c.barycenter=u/l,c.weight=l),c},BS=function(r,t,e){for(var n=e,i;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),r==null||r.push(i.vs),n++;return n},ene=function(r,t){return function(e,n){if(e.fixorder!==void 0&&n.fixorder!==void 0)return e.fixorder-n.fixorder;if(e.barycenter<n.barycenter)return-1;if(e.barycenter>n.barycenter)return 1;if(t&&e.order!==void 0&&n.order!==void 0){if(e.order<n.order)return-1;if(e.order>n.order)return 1}return r?n.i-e.i:e.i-n.i}};Xb.default=Jre;var Yb=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ub,"__esModule",{value:!0});var tne=Yb(jb),rne=Yb(Wb),nne=Yb(Xb),FD=function(r,t,e,n,i,a){var o,s,u,l,f=r.children(t),c=r.node(t),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,v={};d&&(f=f==null?void 0:f.filter(function(x){return x!==d&&x!==h}));var p=(0,tne.default)(r,f||[]);p==null||p.forEach(function(x){var w;if(!((w=r.children(x.v))===null||w===void 0)&&w.length){var E=FD(r,x.v,e,n,a);v[x.v]=E,E.hasOwnProperty("barycenter")&&ane(x,E)}});var g=(0,rne.default)(p,e);ine(g,v),(o=g.filter(function(x){return x.vs.length>0}))===null||o===void 0||o.forEach(function(x){var w=r.node(x.vs[0]);w&&(x.fixorder=w.fixorder,x.order=w.order)});var y=(0,nne.default)(g,n,i,a);if(d&&(y.vs=[d,y.vs,h].flat(),!((s=r.predecessors(d))===null||s===void 0)&&s.length)){var m=r.node(((u=r.predecessors(d))===null||u===void 0?void 0:u[0])||""),b=r.node(((l=r.predecessors(h))===null||l===void 0?void 0:l[0])||"");y.hasOwnProperty("barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+m.order+b.order)/(y.weight+2),y.weight+=2}return y},ine=function(r,t){r==null||r.forEach(function(e){var n,i=(n=e.vs)===null||n===void 0?void 0:n.map(function(a){return t[a]?t[a].vs:a});e.vs=i.flat()})},ane=function(r,t){r.barycenter!==void 0?(r.barycenter=(r.barycenter*r.weight+t.barycenter*t.weight)/(r.weight+t.weight),r.weight+=t.weight):(r.barycenter=t.barycenter,r.weight=t.weight)};Ub.default=FD;var Jc=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pb,"__esModule",{value:!0});var FS=Jc(Rb),zS=Jc(zb),one=Jc(Gb),sne=Jc($b),une=Jc(Ub),GS=an(),lne=Fo,Z0=zi,fne=function(r,t){for(var e=(0,Z0.maxRank)(r),n=[],i=[],a=1;a<e+1;a++)n.push(a);for(var a=e-1;a>-1;a--)i.push(a);var o=$S(r,n,"inEdges"),s=$S(r,i,"outEdges"),u=(0,FS.default)(r);Q0(r,u);for(var l=Number.POSITIVE_INFINITY,f,a=0,c=0;c<4;++a,++c){US(a%2?o:s,a%4>=2,!1,t),u=(0,Z0.buildLayerMatrix)(r);var d=(0,zS.default)(r,u);d<l&&(c=0,f=(0,GS.clone)(u),l=d)}u=(0,FS.default)(r),Q0(r,u);for(var a=0,c=0;c<4;++a,++c){US(a%2?o:s,a%4>=2,!0,t),u=(0,Z0.buildLayerMatrix)(r);var d=(0,zS.default)(r,u);d<l&&(c=0,f=(0,GS.clone)(u),l=d)}Q0(r,f)},$S=function(r,t,e){return t.map(function(n){return(0,one.default)(r,n,e)})},US=function(r,t,e,n){var i=new lne.Graph;r==null||r.forEach(function(a){for(var o,s=a.graph().root,u=(0,une.default)(a,s,i,t,e,n),l=0;l<((o=u.vs)===null||o===void 0?void 0:o.length);l++){var f=a.node(u.vs[l]);f&&(f.order=l)}(0,sne.default)(a,i,u.vs)})},Q0=function(r,t){t==null||t.forEach(function(e){e==null||e.forEach(function(n,i){r.node(n).order=i})})};Pb.default=fne;var Vb={},zD={};(function(r){var t=_e&&_e.__extends||function(){var x=function(w,E){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,M){_.__proto__=M}||function(_,M){for(var C in M)Object.prototype.hasOwnProperty.call(M,C)&&(_[C]=M[C])},x(w,E)};return function(w,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");x(w,E);function _(){this.constructor=w}w.prototype=E===null?Object.create(E):(_.prototype=E.prototype,new _)}}();Object.defineProperty(r,"__esModule",{value:!0}),r.width=r.sep=r.positionX=r.balance=r.alignCoordinates=r.findSmallestWidthAlignment=r.buildBlockGraph=r.horizontalCompaction=r.verticalAlignment=r.hasConflict=r.addConflict=r.findOtherInnerSegmentNode=r.findType2Conflicts=r.findType1Conflicts=void 0;var e=Up,n=BD,i=zi,a=function(x){t(w,x);function w(){return x!==null&&x.apply(this,arguments)||this}return w}(e.Graph),o=function(x,w){var E={},_=function(M,C){var S=0,A=0,T=M.length,I=C==null?void 0:C[(C==null?void 0:C.length)-1];return C==null||C.forEach(function(k,P){var N,z=(0,r.findOtherInnerSegmentNode)(x,k),W=z?x.node(z).order:T;(z||k===I)&&((N=C.slice(A,P+1))===null||N===void 0||N.forEach(function(D){var R;(R=x.predecessors(D))===null||R===void 0||R.forEach(function(H){var ee,Y=x.node(H),X=Y.order;(X<S||W<X)&&!(Y.dummy&&(!((ee=x.node(D))===null||ee===void 0)&&ee.dummy))&&(0,r.addConflict)(E,H,D)})}),A=P+1,S=W)}),C};return w!=null&&w.length&&w.reduce(_),E};r.findType1Conflicts=o;var s=function(x,w){var E={};function _(A,T,I,k,P){for(var N,z,W,D=T;D<I;D++)W=A[D],!((N=x.node(W))===null||N===void 0)&&N.dummy&&((z=x.predecessors(W))===null||z===void 0||z.forEach(function(R){var H=x.node(R);H.dummy&&(H.order<k||H.order>P)&&(0,r.addConflict)(E,R,W)}))}function M(A){return JSON.stringify(A.slice(1))}function C(A,T){var I=M(A);T.get(I)||(_.apply(void 0,A),T.set(I,!0))}var S=function(A,T){var I=-1,k,P=0,N=new Map;return T==null||T.forEach(function(z,W){var D;if(((D=x.node(z))===null||D===void 0?void 0:D.dummy)==="border"){var R=x.predecessors(z)||[];R.length&&(k=x.node(R[0]).order,C([T,P,W,I,k],N),P=W,I=k)}C([T,P,T.length,k,A.length],N)}),T};return w!=null&&w.length&&w.reduce(S),E};r.findType2Conflicts=s;var u=function(x,w){var E,_;if(!((E=x.node(w))===null||E===void 0)&&E.dummy)return(_=x.predecessors(w))===null||_===void 0?void 0:_.find(function(M){return x.node(M).dummy})};r.findOtherInnerSegmentNode=u;var l=function(x,w,E){var _=w,M=E;if(_>M){var C=_;_=M,M=C}var S=x[_];S||(x[_]=S={}),S[M]=!0};r.addConflict=l;var f=function(x,w,E){var _=w,M=E;if(_>M){var C=w;_=M,M=C}return!!x[_]};r.hasConflict=f;var c=function(x,w,E,_){var M={},C={},S={};return w==null||w.forEach(function(A){A==null||A.forEach(function(T,I){M[T]=T,C[T]=T,S[T]=I})}),w==null||w.forEach(function(A){var T=-1;A==null||A.forEach(function(I){var k=_(I);if(k.length){k=k.sort(function(D,R){return S[D]-S[R]});for(var P=(k.length-1)/2,N=Math.floor(P),z=Math.ceil(P);N<=z;++N){var W=k[N];C[I]===I&&T<S[W]&&!(0,r.hasConflict)(E,I,W)&&(C[W]=I,C[I]=M[I]=M[W],T=S[W])}}})}),{root:M,align:C}};r.verticalAlignment=c;var d=function(x,w,E,_,M){var C,S={},A=(0,r.buildBlockGraph)(x,w,E,M),T=M?"borderLeft":"borderRight",I=function(N,z){for(var W=A.nodes(),D=W.pop(),R={};D;)R[D]?N(D):(R[D]=!0,W.push(D),W=W.concat(z(D))),D=W.pop()},k=function(N){S[N]=(A.inEdges(N)||[]).reduce(function(z,W){return Math.max(z,(S[W.v]||0)+A.edge(W))},0)},P=function(N){var z=(A.outEdges(N)||[]).reduce(function(D,R){return Math.min(D,(S[R.w]||0)-A.edge(R))},Number.POSITIVE_INFINITY),W=x.node(N);z!==Number.POSITIVE_INFINITY&&W.borderType!==T&&(S[N]=Math.max(S[N],z))};return I(k,A.predecessors.bind(A)),I(P,A.successors.bind(A)),(C=Object.values(_))===null||C===void 0||C.forEach(function(N){S[N]=S[E[N]]}),S};r.horizontalCompaction=d;var h=function(x,w,E,_){var M=new a,C=x.graph(),S=(0,r.sep)(C.nodesep,C.edgesep,_);return w==null||w.forEach(function(A){var T;A==null||A.forEach(function(I){var k=E[I];if(M.setNode(k),T){var P=E[T],N=M.edgeFromArgs(P,k);M.setEdge(P,k,Math.max(S(x,I,T),N||0))}T=I})}),M};r.buildBlockGraph=h;var v=function(x,w){return(0,i.minBy)(Object.values(w),function(E){var _,M=Number.NEGATIVE_INFINITY,C=Number.POSITIVE_INFINITY;return(_=Object.keys(E))===null||_===void 0||_.forEach(function(S){var A=E[S],T=(0,r.width)(x,S)/2;M=Math.max(A+T,M),C=Math.min(A-T,C)}),M-C})};r.findSmallestWidthAlignment=v;function p(x,w){var E=Object.values(w),_=(0,n.min)(E),M=(0,n.max)(E);["u","d"].forEach(function(C){["l","r"].forEach(function(S){var A=C+S,T=x[A],I;if(T!==w){var k=Object.values(T);I=S==="l"?_-(0,n.min)(k):M-(0,n.max)(k),I&&(x[A]={},Object.keys(T).forEach(function(P){x[A][P]=T[P]+I}))}})})}r.alignCoordinates=p;var g=function(x,w){var E={};return Object.keys(x.ul).forEach(function(_){if(w)E[_]=x[w.toLowerCase()][_];else{var M=Object.values(x).map(function(C){return C[_]});E[_]=(M[0]+M[1])/2}}),E};r.balance=g;var y=function(x){var w=(0,i.buildLayerMatrix)(x),E=Object.assign((0,r.findType1Conflicts)(x,w),(0,r.findType2Conflicts)(x,w)),_={},M;["u","d"].forEach(function(S){M=S==="u"?w:Object.values(w).reverse(),["l","r"].forEach(function(A){A==="r"&&(M=M.map(function(P){return Object.values(P).reverse()}));var T=(S==="u"?x.predecessors:x.successors).bind(x),I=(0,r.verticalAlignment)(x,M,E,T),k=(0,r.horizontalCompaction)(x,M,I.root,I.align,A==="r");A==="r"&&Object.keys(k).forEach(function(P){k[P]=-k[P]}),_[S+A]=k})});var C=(0,r.findSmallestWidthAlignment)(x,_);return p(_,C),(0,r.balance)(_,x.graph().align)};r.positionX=y;var m=function(x,w,E){return function(_,M,C){var S=_.node(M),A=_.node(C),T=0,I;if(T+=S.width/2,S.hasOwnProperty("labelpos"))switch((S.labelpos||"").toLowerCase()){case"l":I=-S.width/2;break;case"r":I=S.width/2;break}if(I&&(T+=E?I:-I),I=0,T+=(S.dummy?w:x)/2,T+=(A.dummy?w:x)/2,T+=A.width/2,A.labelpos)switch((A.labelpos||"").toLowerCase()){case"l":I=A.width/2;break;case"r":I=-A.width/2;break}return I&&(T+=E?I:-I),I=0,T}};r.sep=m;var b=function(x,w){return x.node(w).width||0};r.width=b})(zD);var jS=_e&&_e.__spreadArray||function(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return r.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(Vb,"__esModule",{value:!0});var Hb=zi,Ws=zD,cne=function(r){var t=(0,Hb.buildLayerMatrix)(r),e=r.graph().ranksep,n=0;t==null||t.forEach(function(i){var a=i.map(function(s){return r.node(s).height}),o=Math.max.apply(Math,jS(jS([],a,!1),[0],!1));i==null||i.forEach(function(s){r.node(s).y=n+o/2}),n+=o+e})},dne=function(r){var t=(0,Hb.buildLayerMatrix)(r),e=Object.assign((0,Ws.findType1Conflicts)(r,t),(0,Ws.findType2Conflicts)(r,t)),n={},i=[];["u","d"].forEach(function(o){i=o==="u"?t:Object.values(t).reverse(),["l","r"].forEach(function(s){s==="r"&&(i=i.map(function(c){return Object.values(c).reverse()}));var u=(o==="u"?r.predecessors:r.successors).bind(r),l=(0,Ws.verticalAlignment)(r,i,e,u),f=(0,Ws.horizontalCompaction)(r,i,l.root,l.align,s==="r");s==="r"&&Object.keys(f).forEach(function(c){return f[c]=-f[c]}),n[o+s]=f})});var a=(0,Ws.findSmallestWidthAlignment)(r,n);return a&&(0,Ws.alignCoordinates)(n,a),(0,Ws.balance)(n,r.graph().align)},hne=function(r){var t,e=(0,Hb.asNonCompoundGraph)(r);cne(e);var n=dne(e);(t=Object.keys(n))===null||t===void 0||t.forEach(function(i){e.node(i).x=n[i]})};Vb.default=hne;var Kb={};Object.defineProperty(Kb,"__esModule",{value:!0});var vne=function(r,t){for(var e=r.nodes().filter(function(s){var u;return!(!((u=r.children(s))===null||u===void 0)&&u.length)}),n=e.map(function(s){return r.node(s).rank}),i=Math.max.apply(Math,n),a=[],o=0;o<i+1;o++)a[o]=[];t==null||t.forEach(function(s){var u=r.node(s);!u||u!=null&&u.dummy||isNaN(u.rank)||(u.fixorder=a[u.rank].length,a[u.rank].push(s))})};Kb.default=vne;var Wv=_e&&_e.__assign||function(){return Wv=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Wv.apply(this,arguments)},oo=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_b,"__esModule",{value:!0});var WS=oo(Sb),XS=oo(Ib),pne=oo(Ob),Za=zi,gne=oo(Lb),YS=oo(kb),yne=oo(Db),VS=oo(Nb),mne=oo(Pb),bne=oo(Vb),xne=oo(Kb),wne=Fo,Ene=function(r,t){var e=t&&t.debugTiming?Za.time:Za.notime;e("layout",function(){t&&!t.keepNodeOrder&&t.prevGraph&&e(" inheritOrder",function(){Sne(r,t.prevGraph)});var n=e(" buildLayoutGraph",function(){return kne(r)});t&&t.edgeLabelSpace===!1||e(" makeSpaceForEdgeLabels",function(){Dne(n)});try{e(" runLayout",function(){_ne(n,e,t)})}catch(i){if(i.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
|
|
300
|
-
`,i);return}throw i}e(" updateInputGraph",function(){Mne(r,n)})})},_ne=function(r,t,e){t(" removeSelfEdges",function(){Une(r)}),t(" acyclic",function(){WS.default.run(r)}),t(" nestingGraph.run",function(){YS.default.run(r)}),t(" rank",function(){(0,pne.default)((0,Za.asNonCompoundGraph)(r))}),t(" injectEdgeLabelProxies",function(){Nne(r)}),t(" removeEmptyRanks",function(){(0,Za.removeEmptyRanks)(r)}),t(" nestingGraph.cleanup",function(){YS.default.cleanup(r)}),t(" normalizeRanks",function(){(0,Za.normalizeRanks)(r)}),t(" assignRankMinMax",function(){Pne(r)}),t(" removeEdgeLabelProxies",function(){Rne(r)}),t(" normalize.run",function(){XS.default.run(r)}),t(" parentDummyChains",function(){(0,gne.default)(r)}),t(" addBorderSegments",function(){(0,yne.default)(r)}),e&&e.keepNodeOrder&&t(" initDataOrder",function(){(0,xne.default)(r,e.nodeOrder)}),t(" order",function(){(0,mne.default)(r,e==null?void 0:e.keepNodeOrder)}),t(" insertSelfEdges",function(){jne(r)}),t(" adjustCoordinateSystem",function(){VS.default.adjust(r)}),t(" position",function(){(0,bne.default)(r)}),t(" positionSelfEdges",function(){Wne(r)}),t(" removeBorderNodes",function(){$ne(r)}),t(" normalize.undo",function(){XS.default.undo(r)}),t(" fixupEdgeLabelCoords",function(){zne(r)}),t(" undoCoordinateSystem",function(){VS.default.undo(r)}),t(" translateGraph",function(){Bne(r)}),t(" assignNodeIntersects",function(){Fne(r)}),t(" reversePoints",function(){Gne(r)}),t(" acyclic.undo",function(){WS.default.undo(r)})},Sne=function(r,t){r.nodes().forEach(function(e){var n=r.node(e),i=t.node(e);i!==void 0?(n.fixorder=i._order,delete i._order):delete n.fixorder})},Mne=function(r,t){r.nodes().forEach(function(e){var n,i=r.node(e);if(i){var a=t.node(e);i.x=a.x,i.y=a.y,i._order=a.order,i._rank=a.rank,!((n=t.children(e))===null||n===void 0)&&n.length&&(i.width=a.width,i.height=a.height)}}),r.edges().forEach(function(e){var n=r.edge(e),i=t.edge(e);n.points=i?i.points:[],i&&i.hasOwnProperty("x")&&(n.x=i.x,n.y=i.y)}),r.graph().width=t.graph().width,r.graph().height=t.graph().height},Cne=["nodesep","edgesep","ranksep","marginx","marginy"],Ane={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},J0=["acyclicer","ranker","rankdir","align"],Tne=["width","height","layer","fixorder"],Ine={width:0,height:0},One=["minlen","weight","width","height","labeloffset"],Lne={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ey=["labelpos"],kne=function(r){var t=new wne.Graph({multigraph:!0,compound:!0}),e=ry(r.graph()),n={};return J0==null||J0.forEach(function(i){e[i]!==void 0&&(n[i]=e[i])}),t.setGraph(Object.assign({},Ane,ty(e,Cne),n)),r.nodes().forEach(function(i){var a=ry(r.node(i)),o=Wv(Wv({},Ine),a),s=ty(o,Tne);t.setNode(i,s),t.setParent(i,r.parent(i))}),r.edges().forEach(function(i){var a=ry(r.edge(i)),o={};ey==null||ey.forEach(function(s){a[s]!==void 0&&(o[s]=a[s])}),t.setEdgeObj(i,Object.assign({},Lne,ty(a,One),o))}),t},Dne=function(r){var t=r.graph();t.ranksep||(t.ranksep=0),t.ranksep/=2,r.nodes().forEach(function(e){var n=r.node(e);isNaN(n.layer)||n.layer||(n.layer=0)}),r.edges().forEach(function(e){var n,i=r.edge(e);i.minlen*=2,((n=i.labelpos)===null||n===void 0?void 0:n.toLowerCase())!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})},Nne=function(r){r.edges().forEach(function(t){var e=r.edge(t);if(e.width&&e.height){var n=r.node(t.v),i=r.node(t.w),a={e:t,rank:(i.rank-n.rank)/2+n.rank};(0,Za.addDummyNode)(r,"edge-proxy",a,"_ep")}})},Pne=function(r){var t=0;r.nodes().forEach(function(e){var n,i,a=r.node(e);a.borderTop&&(a.minRank=(n=r.node(a.borderTop))===null||n===void 0?void 0:n.rank,a.maxRank=(i=r.node(a.borderBottom))===null||i===void 0?void 0:i.rank,t=Math.max(t,a.maxRank||-1/0))}),r.graph().maxRank=t},Rne=function(r){r.nodes().forEach(function(t){var e=r.node(t);e.dummy==="edge-proxy"&&(r.edge(e.e).labelRank=e.rank,r.removeNode(t))})},Bne=function(r){var t,e=0,n,i=0,a=r.graph(),o=a.marginx||0,s=a.marginy||0,u=function(l){if(l){var f=l.x,c=l.y,d=l.width,h=l.height;!isNaN(f)&&!isNaN(d)&&(t===void 0&&(t=f-d/2),t=Math.min(t,f-d/2),e=Math.max(e,f+d/2)),!isNaN(c)&&!isNaN(h)&&(n===void 0&&(n=c-h/2),n=Math.min(n,c-h/2),i=Math.max(i,c+h/2))}};r.nodes().forEach(function(l){u(r.node(l))}),r.edges().forEach(function(l){var f=r.edge(l);f!=null&&f.hasOwnProperty("x")&&u(f)}),t-=o,n-=s,r.nodes().forEach(function(l){var f=r.node(l);f&&(f.x-=t,f.y-=n)}),r.edges().forEach(function(l){var f,c=r.edge(l);(f=c.points)===null||f===void 0||f.forEach(function(d){d.x-=t,d.y-=n}),c.hasOwnProperty("x")&&(c.x-=t),c.hasOwnProperty("y")&&(c.y-=n)}),a.width=e-t+o,a.height=i-n+s},Fne=function(r){r.edges().forEach(function(t){var e=r.edge(t),n=r.node(t.v),i=r.node(t.w),a,o;e.points?(a=e.points[0],o=e.points[e.points.length-1]):(e.points=[],a=i,o=n),e.points.unshift((0,Za.intersectRect)(n,a)),e.points.push((0,Za.intersectRect)(i,o))})},zne=function(r){r.edges().forEach(function(t){var e=r.edge(t);if(e!=null&&e.hasOwnProperty("x"))switch((e.labelpos==="l"||e.labelpos==="r")&&(e.width-=e.labeloffset),e.labelpos){case"l":e.x-=e.width/2+e.labeloffset;break;case"r":e.x+=e.width/2+e.labeloffset;break}})},Gne=function(r){r.edges().forEach(function(t){var e,n=r.edge(t);n.reversed&&((e=n.points)===null||e===void 0||e.reverse())})},$ne=function(r){r.nodes().forEach(function(t){var e,n,i;if(!((e=r.children(t))===null||e===void 0)&&e.length){var a=r.node(t),o=r.node(a.borderTop),s=r.node(a.borderBottom),u=r.node(a.borderLeft[((n=a.borderLeft)===null||n===void 0?void 0:n.length)-1]),l=r.node(a.borderRight[((i=a.borderRight)===null||i===void 0?void 0:i.length)-1]);a.width=Math.abs((l==null?void 0:l.x)-(u==null?void 0:u.x))||10,a.height=Math.abs((s==null?void 0:s.y)-(o==null?void 0:o.y))||10,a.x=((u==null?void 0:u.x)||0)+a.width/2,a.y=((o==null?void 0:o.y)||0)+a.height/2}}),r.nodes().forEach(function(t){var e;((e=r.node(t))===null||e===void 0?void 0:e.dummy)==="border"&&r.removeNode(t)})},Une=function(r){r.edges().forEach(function(t){if(t.v===t.w){var e=r.node(t.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:t,label:r.edge(t)}),r.removeEdgeObj(t)}})},jne=function(r){var t=(0,Za.buildLayerMatrix)(r);t==null||t.forEach(function(e){var n=0;e==null||e.forEach(function(i,a){var o,s=r.node(i);s.order=a+n,(o=s.selfEdges)===null||o===void 0||o.forEach(function(u){(0,Za.addDummyNode)(r,"selfedge",{width:u.label.width,height:u.label.height,rank:s.rank,order:a+ ++n,e:u.e,label:u.label},"_se")}),delete s.selfEdges})})},Wne=function(r){r.nodes().forEach(function(t){var e=r.node(t);if(e.dummy==="selfedge"){var n=r.node(e.e.v),i=n.x+n.width/2,a=n.y,o=e.x-i,s=n.height/2;r.setEdgeObj(e.e,e.label),r.removeNode(t),e.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{y:a,x:i+o},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],e.label.x=e.x,e.label.y=e.y}})},ty=function(r,t){var e={};return t==null||t.forEach(function(n){r[n]!==void 0&&(e[n]=+r[n])}),e},ry=function(r){r===void 0&&(r={});var t={};return Object.keys(r).forEach(function(e){t[e.toLowerCase()]=r[e]}),t};_b.default=Ene;var Xne=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Eb,"__esModule",{value:!0});var Yne=Xne(_b),HS=zi;Eb.default={layout:Yne.default,util:{time:HS.time,notime:HS.notime}};var Vne=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Hne=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Kl,"__esModule",{value:!0});Kl.DagreLayout=void 0;var Kne=Hne(Eb),Ai=an(),qne=hn,KS=Fo,Zne=function(r){Vne(t,r);function t(e){var n=r.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.ranksep=50,n.controlPoints=!1,n.sortByCombo=!1,n.edgeLabelSpace=!0,n.radial=!1,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.layoutNode=function(i){var a=n,o=a.nodes,s=o.find(function(l){return l.id===i});if(s){var u=s.layout!==!1;return u}return!0},n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},t.prototype.execute=function(){var e=this,n,i,a,o,s=this,u=s.nodes,l=s.nodeSize,f=s.rankdir,c=s.combos,d=s.begin,h=s.radial,v=s.comboEdges,p=v===void 0?[]:v,g=s.vedges,y=g===void 0?[]:g;if(u){var m=s.edges||[],b=new KS.Graph({multigraph:!0,compound:!0});s.nodeMap={};var x={};u.forEach(function(ie){s.nodeMap[ie.id]=ie,ie.comboId&&(x[ie.comboId]=x[ie.comboId]||[],x[ie.comboId].push(ie.id))});var w=[],E={};!((n=s.nodeOrder)===null||n===void 0)&&n.length?(s.nodeOrder.forEach(function(ie){E[ie]=!0,w.push(s.nodeMap[ie])}),u.forEach(function(ie){E[ie.id]||w.push(ie)})):w=u;var _;l?(0,Ai.isArray)(l)?_=function(){return l}:_=function(){return[l,l]}:_=function(ie){return ie.size?(0,Ai.isArray)(ie.size)?ie.size:(0,Ai.isObject)(ie.size)?[ie.size.width||40,ie.size.height||40]:[ie.size,ie.size]:[40,40]};var M=(0,Ai.getFunc)(s.ranksep,50,s.ranksepFunc),C=(0,Ai.getFunc)(s.nodesep,50,s.nodesepFunc),S=C,A=M;(f==="LR"||f==="RL")&&(S=M,A=C),b.setDefaultEdgeLabel(function(){return{}}),b.setGraph(s);var T={};this.sortByCombo&&c&&c.forEach(function(ie){if(T[ie.id]=ie,ie.collapsed){var L=_(ie),Se=A(ie),Pe=S(ie),me=L[0]+2*Pe,je=L[1]+2*Se;b.setNode(ie.id,{width:me,height:je})}ie.parentId&&(T[ie.parentId]||b.setNode(ie.parentId,{}),b.setParent(ie.id,ie.parentId))}),w.filter(function(ie){return ie.layout!==!1}).forEach(function(ie){var L=_(ie),Se=A(ie),Pe=S(ie),me=L[0]+2*Pe,je=L[1]+2*Se,Xe=ie.layer;(0,Ai.isNumber)(Xe)?b.setNode(ie.id,{width:me,height:je,layer:Xe}):b.setNode(ie.id,{width:me,height:je}),e.sortByCombo&&ie.comboId&&(T[ie.comboId]||(T[ie.comboId]={id:ie.comboId},b.setNode(ie.comboId,{})),b.setParent(ie.id,ie.comboId))}),m.forEach(function(ie){var L=(0,Ai.getEdgeTerminal)(ie,"source"),Se=(0,Ai.getEdgeTerminal)(ie,"target");e.layoutNode(L)&&e.layoutNode(Se)&&b.setEdge(L,Se,{weight:ie.weight||1})}),(i=p==null?void 0:p.concat(y||[]))===null||i===void 0||i.forEach(function(ie){var L,Se,Pe=ie.source,me=ie.target,je=!((L=T[Pe])===null||L===void 0)&&L.collapsed?[Pe]:x[Pe]||[Pe],Xe=!((Se=T[me])===null||Se===void 0)&&Se.collapsed?[me]:x[me]||[me];je.forEach(function(qe){Xe.forEach(function(tt){b.setEdge(qe,tt,{weight:ie.weight||1})})})});var I=void 0;!((a=s.preset)===null||a===void 0)&&a.nodes&&(I=new KS.Graph({multigraph:!0,compound:!0}),s.preset.nodes.forEach(function(ie){I==null||I.setNode(ie.id,ie)})),Kne.default.layout(b,{prevGraph:I,edgeLabelSpace:s.edgeLabelSpace,keepNodeOrder:!!s.nodeOrder,nodeOrder:s.nodeOrder});var k=[0,0];if(d){var P=1/0,N=1/0;b.nodes().forEach(function(ie){var L=b.node(ie);P>L.x&&(P=L.x),N>L.y&&(N=L.y)}),b.edges().forEach(function(ie){var L,Se=b.edge(ie);(L=Se.points)===null||L===void 0||L.forEach(function(Pe){P>Pe.x&&(P=Pe.x),N>Pe.y&&(N=Pe.y)})}),k[0]=d[0]-P,k[1]=d[1]-N}var z=f==="LR"||f==="RL";if(h){var W=this,D=W.focusNode,R=W.ranksep,H=W.getRadialPos,ee=(0,Ai.isString)(D)?D:D==null?void 0:D.id,Y=ee?(o=b.node(ee))===null||o===void 0?void 0:o._rank:0,X=[],fe=z?"y":"x",we=z?"height":"width",Ae=1/0,Ke=-1/0;b.nodes().forEach(function(ie){var L=b.node(ie);if(s.nodeMap[ie]){var Se=C(s.nodeMap[ie]);if(Y===0)X[L._rank]||(X[L._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),X[L._rank].nodes.push(ie),X[L._rank].totalWidth+=Se*2+L[we],X[L._rank].maxSize<Math.max(L.width,L.height)&&(X[L._rank].maxSize=Math.max(L.width,L.height));else{var Pe=L._rank-Y;if(Pe===0)X[Pe]||(X[Pe]={nodes:[],totalWidth:0,maxSize:-1/0}),X[Pe].nodes.push(ie),X[Pe].totalWidth+=Se*2+L[we],X[Pe].maxSize<Math.max(L.width,L.height)&&(X[Pe].maxSize=Math.max(L.width,L.height));else{var me=Math.abs(Pe);X[me]||(X[me]={left:[],right:[],totalWidth:0,maxSize:-1/0}),X[me].totalWidth+=Se*2+L[we],X[me].maxSize<Math.max(L.width,L.height)&&(X[me].maxSize=Math.max(L.width,L.height)),Pe<0?X[me].left.push(ie):X[me].right.push(ie)}}var je=L[fe]-L[we]/2-Se,Xe=L[fe]+L[we]/2+Se;je<Ae&&(Ae=je),Xe>Ke&&(Ke=Xe)}});var ot=R||50,nt={},Ct=(Ke-Ae)/.9,Et=[(Ae+Ke-Ct)*.5,(Ae+Ke+Ct)*.5],fr=function(ie,L,Se,Pe){Se===void 0&&(Se=-1/0),Pe===void 0&&(Pe=[0,1]);var me=Se;return ie.forEach(function(je){var Xe=b.node(je);nt[je]=L;var qe=H(Xe[fe],Et,Ct,L,Pe),tt=qe.x,yt=qe.y;if(s.nodeMap[je]){s.nodeMap[je].x=tt+k[0],s.nodeMap[je].y=yt+k[1],s.nodeMap[je]._order=Xe._order;var Ut=M(s.nodeMap[je]);me<Ut&&(me=Ut)}}),me},Gt=!0,jt=0;X.forEach(function(ie){var L,Se,Pe,me,je,Xe,qe;if(!(!(!((L=ie==null?void 0:ie.nodes)===null||L===void 0)&&L.length)&&!(!((Se=ie==null?void 0:ie.left)===null||Se===void 0)&&Se.length)&&!(!((Pe=ie==null?void 0:ie.right)===null||Pe===void 0)&&Pe.length))){if(Gt&&ie.nodes.length===1){var tt=ie.nodes[0];if(!s.nodeMap[tt])return;s.nodeMap[tt].x=k[0],s.nodeMap[tt].y=k[1],nt[ie.nodes[0]]=0,ot=M(s.nodeMap[tt]),Gt=!1;return}ot=Math.max(ot,ie.totalWidth/(2*Math.PI));var yt=-1/0;if(Y===0||!((me=ie.nodes)===null||me===void 0)&&me.length)yt=fr(ie.nodes,ot,yt,[0,1]);else{var Ut=((je=ie.left)===null||je===void 0?void 0:je.length)/(((Xe=ie.left)===null||Xe===void 0?void 0:Xe.length)+((qe=ie.right)===null||qe===void 0?void 0:qe.length));yt=fr(ie.left,ot,yt,[0,Ut]),yt=fr(ie.right,ot,yt,[Ut+.05,1])}ot+=yt,Gt=!1,jt-ie.maxSize}}),b.edges().forEach(function(ie){var L,Se,Pe,me=b.edge(ie),je=m.findIndex(function(wr){var Zt=(0,Ai.getEdgeTerminal)(wr,"source"),Mr=(0,Ai.getEdgeTerminal)(wr,"target");return Zt===ie.v&&Mr===ie.w});if(!(je<=-1)&&s.edgeLabelSpace&&s.controlPoints&&m[je].type!=="loop"){var Xe=fe==="x"?"y":"x",qe=(L=me==null?void 0:me.points)===null||L===void 0?void 0:L.slice(1,me.points.length-1),tt=[],yt=(Se=b.node(ie.v))===null||Se===void 0?void 0:Se[Xe],Ut=yt-((Pe=b.node(ie.w))===null||Pe===void 0?void 0:Pe[Xe]),gr=nt[ie.v],Pt=gr-nt[ie.w];qe==null||qe.forEach(function(wr){var Zt=(wr[Xe]-yt)/Ut*Pt+gr,Mr=H(wr[fe],Et,Ct,Zt);tt.push({x:Mr.x+k[0],y:Mr.y+k[1]})}),m[je].controlPoints=tt}})}else{var Sr=new Set,rr=f==="BT"||f==="RL",Rt=rr?function(ie,L){return L-ie}:function(ie,L){return ie-L};b.nodes().forEach(function(ie){var L=b.node(ie);if(L){var Se=e.nodeMap[ie];Se||(Se=c==null?void 0:c.find(function(Pe){return Pe.id===ie})),Se&&(Se.x=L.x+k[0],Se.y=L.y+k[1],Se._order=L._order,Sr.add(z?Se.x:Se.y))}});var sr=Array.from(Sr).sort(Rt),Hr=z?function(ie,L){return ie.x!==L.x}:function(ie,L){return ie.y!==L.y},et=z?function(ie,L,Se){var Pe=Math.max(L.y,Se.y),me=Math.min(L.y,Se.y);return ie.filter(function(je){return je.y<=Pe&&je.y>=me})}:function(ie,L,Se){var Pe=Math.max(L.x,Se.x),me=Math.min(L.x,Se.x);return ie.filter(function(je){return je.x<=Pe&&je.x>=me})};b.edges().forEach(function(ie){var L,Se=b.edge(ie),Pe=m.findIndex(function(Xe){var qe=(0,Ai.getEdgeTerminal)(Xe,"source"),tt=(0,Ai.getEdgeTerminal)(Xe,"target");return qe===ie.v&&tt===ie.w});if(!(Pe<=-1)&&s.edgeLabelSpace&&s.controlPoints&&m[Pe].type!=="loop"){(L=Se==null?void 0:Se.points)===null||L===void 0||L.forEach(function(Xe){Xe.x+=k[0],Xe.y+=k[1]});var me=s.nodeMap[ie.v],je=s.nodeMap[ie.w];m[Pe].controlPoints=Qne(Se==null?void 0:Se.points,me,je,sr,z,Hr,et)}})}return s.onLayoutEnd&&s.onLayoutEnd(),{nodes:u,edges:m}}},t.prototype.getRadialPos=function(e,n,i,a,o){o===void 0&&(o=[0,1]);var s=(e-n[0])/i;s=s*(o[1]-o[0])+o[0];var u=s*2*Math.PI;return{x:Math.cos(u)*a,y:Math.sin(u)*a}},t.prototype.getType=function(){return"dagre"},t}(qne.Base);Kl.DagreLayout=Zne;var Qne=function(r,t,e,n,i,a,o){var s=(r==null?void 0:r.slice(1,r.length-1))||[];if(t&&e){var u=t.x,l=t.y,f=e.x,c=e.y;if(i&&(u=t.y,l=t.x,f=e.y,c=e.x),c!==l&&u!==f){var d=n.indexOf(l),h=n[d+1];if(h){var v=s[0],p=i?{x:(l+h)/2,y:(v==null?void 0:v.y)||f}:{x:(v==null?void 0:v.x)||f,y:(l+h)/2};(!v||a(v,p))&&s.unshift(p)}var g=n.indexOf(c),y=Math.abs(g-d);if(y===1)s=o(s,t,e),s.length||s.push(i?{x:(l+c)/2,y:u}:{x:u,y:(l+c)/2});else if(y>1){var m=n[g-1];if(m){var b=s[s.length-1],x=i?{x:(c+m)/2,y:(b==null?void 0:b.y)||f}:{x:(b==null?void 0:b.x)||u,y:(c+m)/2};(!b||a(b,x))&&s.push(x)}}}}return s},ed={};const Xv={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function Bm(r={},t=Xv){var e,n,i,a;const o=JSON.parse(JSON.stringify(t)),s=((e=r==null?void 0:r.graph)===null||e===void 0?void 0:e.meta)||{},u=((n=r==null?void 0:r.subScene)===null||n===void 0?void 0:n.meta)||{},l=((i=r==null?void 0:r.nodeSize)===null||i===void 0?void 0:i.meta)||{},f=((a=r==null?void 0:r.nodeSize)===null||a===void 0?void 0:a.node)||{},c=o.nodeSize.bridge;return{graph:{meta:Object.assign(o.graph.meta,s)},subScene:{meta:Object.assign(o.subScene.meta,u)},nodeSize:{meta:Object.assign(o.nodeSize.meta,l),node:Object.assign(o.nodeSize.node,f),bridge:c}}}function GD(r){return`◬${r}◬`}const zl=GD("ROOT"),$D=GD("BRIDGE_GRAPH");var wi,yu,Gl,Fm;(function(r){r[r.META=0]="META",r[r.NODE=1]="NODE",r[r.BRIDGE=2]="BRIDGE"})(wi||(wi={})),function(r){r[r.INCLUDE=0]="INCLUDE",r[r.EXCLUDE=1]="EXCLUDE",r[r.UNSPECIFIED=2]="UNSPECIFIED"}(yu||(yu={})),function(r){r[r.META=0]="META",r[r.CORE=1]="CORE",r[r.BRIDGE=2]="BRIDGE"}(Gl||(Gl={})),function(r){r[r.META=0]="META",r[r.OP=1]="OP",r[r.SERIES=2]="SERIES"}(Fm||(Fm={}));var Eh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qb(r,t){return r(t={exports:{}},t.exports),t.exports}var Jne=function(){this.__data__=[],this.size=0},Zl=function(r,t){return r===t||r!=r&&t!=t},Yp=function(r,t){for(var e=r.length;e--;)if(Zl(r[e][0],t))return e;return-1},eie=Array.prototype.splice,tie=function(r){var t=this.__data__,e=Yp(t,r);return!(e<0)&&(e==t.length-1?t.pop():eie.call(t,e,1),--this.size,!0)},rie=function(r){var t=this.__data__,e=Yp(t,r);return e<0?void 0:t[e][1]},nie=function(r){return Yp(this.__data__,r)>-1},iie=function(r,t){var e=this.__data__,n=Yp(e,r);return n<0?(++this.size,e.push([r,t])):e[n][1]=t,this};function ul(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}ul.prototype.clear=Jne,ul.prototype.delete=tie,ul.prototype.get=rie,ul.prototype.has=nie,ul.prototype.set=iie;var Vp=ul,aie=function(){this.__data__=new Vp,this.size=0},oie=function(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e},sie=function(r){return this.__data__.get(r)},uie=function(r){return this.__data__.has(r)},UD=typeof Eh=="object"&&Eh&&Eh.Object===Object&&Eh,lie=typeof self=="object"&&self&&self.Object===Object&&self,Ea=UD||lie||Function("return this")(),ta=Ea.Symbol,jD=Object.prototype,fie=jD.hasOwnProperty,cie=jD.toString,_f=ta?ta.toStringTag:void 0,die=function(r){var t=fie.call(r,_f),e=r[_f];try{r[_f]=void 0;var n=!0}catch{}var i=cie.call(r);return n&&(t?r[_f]=e:delete r[_f]),i},hie=Object.prototype.toString,vie=function(r){return hie.call(r)},qS=ta?ta.toStringTag:void 0,Ts=function(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":qS&&qS in Object(r)?die(r):vie(r)},Si=function(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")},ZS,td=function(r){if(!Si(r))return!1;var t=Ts(r);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"},ny=Ea["__core-js_shared__"],QS=(ZS=/[^.]+$/.exec(ny&&ny.keys&&ny.keys.IE_PROTO||""))?"Symbol(src)_1."+ZS:"",pie=function(r){return!!QS&&QS in r},gie=Function.prototype.toString,Su=function(r){if(r!=null){try{return gie.call(r)}catch{}try{return r+""}catch{}}return""},yie=/^\[object .+?Constructor\]$/,mie=Function.prototype,bie=Object.prototype,xie=mie.toString,wie=bie.hasOwnProperty,Eie=RegExp("^"+xie.call(wie).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_ie=function(r){return!(!Si(r)||pie(r))&&(td(r)?Eie:yie).test(Su(r))},Sie=function(r,t){return r==null?void 0:r[t]},Mu=function(r,t){var e=Sie(r,t);return _ie(e)?e:void 0},Ac=Mu(Ea,"Map"),Tc=Mu(Object,"create"),Mie=function(){this.__data__=Tc?Tc(null):{},this.size=0},Cie=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t},Aie=Object.prototype.hasOwnProperty,Tie=function(r){var t=this.__data__;if(Tc){var e=t[r];return e==="__lodash_hash_undefined__"?void 0:e}return Aie.call(t,r)?t[r]:void 0},Iie=Object.prototype.hasOwnProperty,Oie=function(r){var t=this.__data__;return Tc?t[r]!==void 0:Iie.call(t,r)},Lie=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=Tc&&t===void 0?"__lodash_hash_undefined__":t,this};function ll(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}ll.prototype.clear=Mie,ll.prototype.delete=Cie,ll.prototype.get=Tie,ll.prototype.has=Oie,ll.prototype.set=Lie;var JS=ll,kie=function(){this.size=0,this.__data__={hash:new JS,map:new(Ac||Vp),string:new JS}},Die=function(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null},Hp=function(r,t){var e=r.__data__;return Die(t)?e[typeof t=="string"?"string":"hash"]:e.map},Nie=function(r){var t=Hp(this,r).delete(r);return this.size-=t?1:0,t},Pie=function(r){return Hp(this,r).get(r)},Rie=function(r){return Hp(this,r).has(r)},Bie=function(r,t){var e=Hp(this,r),n=e.size;return e.set(r,t),this.size+=e.size==n?0:1,this};function fl(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}fl.prototype.clear=kie,fl.prototype.delete=Nie,fl.prototype.get=Pie,fl.prototype.has=Rie,fl.prototype.set=Bie;var Kp=fl,Fie=function(r,t){var e=this.__data__;if(e instanceof Vp){var n=e.__data__;if(!Ac||n.length<199)return n.push([r,t]),this.size=++e.size,this;e=this.__data__=new Kp(n)}return e.set(r,t),this.size=e.size,this};function cl(r){var t=this.__data__=new Vp(r);this.size=t.size}cl.prototype.clear=aie,cl.prototype.delete=oie,cl.prototype.get=sie,cl.prototype.has=uie,cl.prototype.set=Fie;var Sl=cl,Zb=function(r,t){for(var e=-1,n=r==null?0:r.length;++e<n&&t(r[e],e,r)!==!1;);return r},Yv=function(){try{var r=Mu(Object,"defineProperty");return r({},"",{}),r}catch{}}(),qp=function(r,t,e){t=="__proto__"&&Yv?Yv(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e},zie=Object.prototype.hasOwnProperty,Zp=function(r,t,e){var n=r[t];zie.call(r,t)&&Zl(n,e)&&(e!==void 0||t in r)||qp(r,t,e)},rd=function(r,t,e,n){var i=!e;e||(e={});for(var a=-1,o=t.length;++a<o;){var s=t[a],u=n?n(e[s],r[s],s,e,r):void 0;u===void 0&&(u=r[s]),i?qp(e,s,u):Zp(e,s,u)}return e},Gie=function(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n},ya=function(r){return r!=null&&typeof r=="object"},eM=function(r){return ya(r)&&Ts(r)=="[object Arguments]"},WD=Object.prototype,$ie=WD.hasOwnProperty,Uie=WD.propertyIsEnumerable,$l=eM(function(){return arguments}())?eM:function(r){return ya(r)&&$ie.call(r,"callee")&&!Uie.call(r,"callee")},dn=Array.isArray,jie=function(){return!1},mu=qb(function(r,t){var e=t&&!t.nodeType&&t,n=e&&r&&!r.nodeType&&r,i=n&&n.exports===e?Ea.Buffer:void 0,a=(i?i.isBuffer:void 0)||jie;r.exports=a}),Wie=/^(?:0|[1-9]\d*)$/,Qp=function(r,t){var e=typeof r;return!!(t=t??9007199254740991)&&(e=="number"||e!="symbol"&&Wie.test(r))&&r>-1&&r%1==0&&r<t},Qb=function(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=9007199254740991},Wr={};Wr["[object Float32Array]"]=Wr["[object Float64Array]"]=Wr["[object Int8Array]"]=Wr["[object Int16Array]"]=Wr["[object Int32Array]"]=Wr["[object Uint8Array]"]=Wr["[object Uint8ClampedArray]"]=Wr["[object Uint16Array]"]=Wr["[object Uint32Array]"]=!0,Wr["[object Arguments]"]=Wr["[object Array]"]=Wr["[object ArrayBuffer]"]=Wr["[object Boolean]"]=Wr["[object DataView]"]=Wr["[object Date]"]=Wr["[object Error]"]=Wr["[object Function]"]=Wr["[object Map]"]=Wr["[object Number]"]=Wr["[object Object]"]=Wr["[object RegExp]"]=Wr["[object Set]"]=Wr["[object String]"]=Wr["[object WeakMap]"]=!1;var Xie=function(r){return ya(r)&&Qb(r.length)&&!!Wr[Ts(r)]},Jp=function(r){return function(t){return r(t)}},Ul=qb(function(r,t){var e=t&&!t.nodeType&&t,n=e&&r&&!r.nodeType&&r,i=n&&n.exports===e&&UD.process,a=function(){try{var o=n&&n.require&&n.require("util").types;return o||i&&i.binding&&i.binding("util")}catch{}}();r.exports=a}),tM=Ul&&Ul.isTypedArray,nd=tM?Jp(tM):Xie,Yie=Object.prototype.hasOwnProperty,XD=function(r,t){var e=dn(r),n=!e&&$l(r),i=!e&&!n&&mu(r),a=!e&&!n&&!i&&nd(r),o=e||n||i||a,s=o?Gie(r.length,String):[],u=s.length;for(var l in r)!t&&!Yie.call(r,l)||o&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Qp(l,u))||s.push(l);return s},Vie=Object.prototype,eg=function(r){var t=r&&r.constructor;return r===(typeof t=="function"&&t.prototype||Vie)},YD=function(r,t){return function(e){return r(t(e))}},Hie=YD(Object.keys,Object),Kie=Object.prototype.hasOwnProperty,Jb=function(r){if(!eg(r))return Hie(r);var t=[];for(var e in Object(r))Kie.call(r,e)&&e!="constructor"&&t.push(e);return t},Go=function(r){return r!=null&&Qb(r.length)&&!td(r)},Is=function(r){return Go(r)?XD(r):Jb(r)},qie=function(r,t){return r&&rd(t,Is(t),r)},Zie=function(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t},Qie=Object.prototype.hasOwnProperty,Jie=function(r){if(!Si(r))return Zie(r);var t=eg(r),e=[];for(var n in r)(n!="constructor"||!t&&Qie.call(r,n))&&e.push(n);return e},Cu=function(r){return Go(r)?XD(r,!0):Jie(r)},eae=function(r,t){return r&&rd(t,Cu(t),r)},VD=qb(function(r,t){var e=t&&!t.nodeType&&t,n=e&&r&&!r.nodeType&&r,i=n&&n.exports===e?Ea.Buffer:void 0,a=i?i.allocUnsafe:void 0;r.exports=function(o,s){if(s)return o.slice();var u=o.length,l=a?a(u):new o.constructor(u);return o.copy(l),l}}),HD=function(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t},KD=function(r,t){for(var e=-1,n=r==null?0:r.length,i=0,a=[];++e<n;){var o=r[e];t(o,e,r)&&(a[i++]=o)}return a},qD=function(){return[]},tae=Object.prototype.propertyIsEnumerable,rM=Object.getOwnPropertySymbols,ex=rM?function(r){return r==null?[]:(r=Object(r),KD(rM(r),function(t){return tae.call(r,t)}))}:qD,rae=function(r,t){return rd(r,ex(r),t)},tx=function(r,t){for(var e=-1,n=t.length,i=r.length;++e<n;)r[i+e]=t[e];return r},tg=YD(Object.getPrototypeOf,Object),ZD=Object.getOwnPropertySymbols?function(r){for(var t=[];r;)tx(t,ex(r)),r=tg(r);return t}:qD,nae=function(r,t){return rd(r,ZD(r),t)},QD=function(r,t,e){var n=t(r);return dn(r)?n:tx(n,e(r))},zm=function(r){return QD(r,Is,ex)},iae=function(r){return QD(r,Cu,ZD)},Gm=Mu(Ea,"DataView"),$m=Mu(Ea,"Promise"),Ml=Mu(Ea,"Set"),Um=Mu(Ea,"WeakMap"),aae=Su(Gm),oae=Su(Ac),sae=Su($m),uae=Su(Ml),lae=Su(Um),qs=Ts;(Gm&&qs(new Gm(new ArrayBuffer(1)))!="[object DataView]"||Ac&&qs(new Ac)!="[object Map]"||$m&&qs($m.resolve())!="[object Promise]"||Ml&&qs(new Ml)!="[object Set]"||Um&&qs(new Um)!="[object WeakMap]")&&(qs=function(r){var t=Ts(r),e=t=="[object Object]"?r.constructor:void 0,n=e?Su(e):"";if(n)switch(n){case aae:return"[object DataView]";case oae:return"[object Map]";case sae:return"[object Promise]";case uae:return"[object Set]";case lae:return"[object WeakMap]"}return t});var bu=qs,fae=Object.prototype.hasOwnProperty,cae=function(r){var t=r.length,e=new r.constructor(t);return t&&typeof r[0]=="string"&&fae.call(r,"index")&&(e.index=r.index,e.input=r.input),e},Vv=Ea.Uint8Array,rx=function(r){var t=new r.constructor(r.byteLength);return new Vv(t).set(new Vv(r)),t},dae=function(r,t){var e=t?rx(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.byteLength)},hae=/\w*$/,vae=function(r){var t=new r.constructor(r.source,hae.exec(r));return t.lastIndex=r.lastIndex,t},nM=ta?ta.prototype:void 0,iM=nM?nM.valueOf:void 0,pae=function(r){return iM?Object(iM.call(r)):{}},JD=function(r,t){var e=t?rx(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)},gae=function(r,t,e){var n=r.constructor;switch(t){case"[object ArrayBuffer]":return rx(r);case"[object Boolean]":case"[object Date]":return new n(+r);case"[object DataView]":return dae(r,e);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return JD(r,e);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(r);case"[object RegExp]":return vae(r);case"[object Set]":return new n;case"[object Symbol]":return pae(r)}},aM=Object.create,eN=function(){function r(){}return function(t){if(!Si(t))return{};if(aM)return aM(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}(),tN=function(r){return typeof r.constructor!="function"||eg(r)?{}:eN(tg(r))},yae=function(r){return ya(r)&&bu(r)=="[object Map]"},oM=Ul&&Ul.isMap,mae=oM?Jp(oM):yae,bae=function(r){return ya(r)&&bu(r)=="[object Set]"},sM=Ul&&Ul.isSet,xae=sM?Jp(sM):bae,Gr={};Gr["[object Arguments]"]=Gr["[object Array]"]=Gr["[object ArrayBuffer]"]=Gr["[object DataView]"]=Gr["[object Boolean]"]=Gr["[object Date]"]=Gr["[object Float32Array]"]=Gr["[object Float64Array]"]=Gr["[object Int8Array]"]=Gr["[object Int16Array]"]=Gr["[object Int32Array]"]=Gr["[object Map]"]=Gr["[object Number]"]=Gr["[object Object]"]=Gr["[object RegExp]"]=Gr["[object Set]"]=Gr["[object String]"]=Gr["[object Symbol]"]=Gr["[object Uint8Array]"]=Gr["[object Uint8ClampedArray]"]=Gr["[object Uint16Array]"]=Gr["[object Uint32Array]"]=!0,Gr["[object Error]"]=Gr["[object Function]"]=Gr["[object WeakMap]"]=!1;var rN=function r(t,e,n,i,a,o){var s,u=1&e,l=2&e,f=4&e;if(n&&(s=a?n(t,i,a,o):n(t)),s!==void 0)return s;if(!Si(t))return t;var c=dn(t);if(c){if(s=cae(t),!u)return HD(t,s)}else{var d=bu(t),h=d=="[object Function]"||d=="[object GeneratorFunction]";if(mu(t))return VD(t,u);if(d=="[object Object]"||d=="[object Arguments]"||h&&!a){if(s=l||h?{}:tN(t),!u)return l?nae(t,eae(s,t)):rae(t,qie(s,t))}else{if(!Gr[d])return a?t:{};s=gae(t,d,u)}}o||(o=new Sl);var v=o.get(t);if(v)return v;o.set(t,s),xae(t)?t.forEach(function(g){s.add(r(g,e,n,g,t,o))}):mae(t)&&t.forEach(function(g,y){s.set(y,r(g,e,n,y,t,o))});var p=c?void 0:(f?l?iae:zm:l?Cu:Is)(t);return Zb(p||t,function(g,y){p&&(g=t[y=g]),Zp(s,y,r(g,e,n,y,t,o))}),s},wae=function(r){return rN(r,4)},nx=function(r){return function(){return r}},ix=function(r){return function(t,e,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var u=o[r?s:++i];if(e(a[u],u,a)===!1)break}return t}}(),ax=function(r,t){return r&&ix(r,t,Is)},rg=function(r,t){return function(e,n){if(e==null)return e;if(!Go(e))return r(e,n);for(var i=e.length,a=t?i:-1,o=Object(e);(t?a--:++a<i)&&n(o[a],a,o)!==!1;);return e}}(ax),Au=function(r){return r},nN=function(r){return typeof r=="function"?r:Au},iN=function(r,t){return(dn(r)?Zb:rg)(r,nN(t))},aN=iN,Eae=function(r,t){var e=[];return rg(r,function(n,i,a){t(n,i,a)&&e.push(n)}),e},_ae=function(r){return this.__data__.set(r,"__lodash_hash_undefined__"),this},Sae=function(r){return this.__data__.has(r)};function av(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new Kp;++t<e;)this.add(r[t])}av.prototype.add=av.prototype.push=_ae,av.prototype.has=Sae;var oN=av,Mae=function(r,t){for(var e=-1,n=r==null?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1},sN=function(r,t){return r.has(t)},uN=function(r,t,e,n,i,a){var o=1&e,s=r.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var l=a.get(r),f=a.get(t);if(l&&f)return l==t&&f==r;var c=-1,d=!0,h=2&e?new oN:void 0;for(a.set(r,t),a.set(t,r);++c<s;){var v=r[c],p=t[c];if(n)var g=o?n(p,v,c,t,r,a):n(v,p,c,r,t,a);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!Mae(t,function(y,m){if(!sN(h,m)&&(v===y||i(v,y,e,n,a)))return h.push(m)})){d=!1;break}}else if(v!==p&&!i(v,p,e,n,a)){d=!1;break}}return a.delete(r),a.delete(t),d},Cae=function(r){var t=-1,e=Array(r.size);return r.forEach(function(n,i){e[++t]=[i,n]}),e},ox=function(r){var t=-1,e=Array(r.size);return r.forEach(function(n){e[++t]=n}),e},uM=ta?ta.prototype:void 0,iy=uM?uM.valueOf:void 0,Aae=function(r,t,e,n,i,a,o){switch(e){case"[object DataView]":if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(r.byteLength!=t.byteLength||!a(new Vv(r),new Vv(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Zl(+r,+t);case"[object Error]":return r.name==t.name&&r.message==t.message;case"[object RegExp]":case"[object String]":return r==t+"";case"[object Map]":var s=Cae;case"[object Set]":var u=1&n;if(s||(s=ox),r.size!=t.size&&!u)return!1;var l=o.get(r);if(l)return l==t;n|=2,o.set(r,t);var f=uN(s(r),s(t),n,i,a,o);return o.delete(r),f;case"[object Symbol]":if(iy)return iy.call(r)==iy.call(t)}return!1},Tae=Object.prototype.hasOwnProperty,Iae=function(r,t,e,n,i,a){var o=1&e,s=zm(r),u=s.length;if(u!=zm(t).length&&!o)return!1;for(var l=u;l--;){var f=s[l];if(!(o?f in t:Tae.call(t,f)))return!1}var c=a.get(r),d=a.get(t);if(c&&d)return c==t&&d==r;var h=!0;a.set(r,t),a.set(t,r);for(var v=o;++l<u;){var p=r[f=s[l]],g=t[f];if(n)var y=o?n(g,p,f,t,r,a):n(p,g,f,r,t,a);if(!(y===void 0?p===g||i(p,g,e,n,a):y)){h=!1;break}v||(v=f=="constructor")}if(h&&!v){var m=r.constructor,b=t.constructor;m==b||!("constructor"in r)||!("constructor"in t)||typeof m=="function"&&m instanceof m&&typeof b=="function"&&b instanceof b||(h=!1)}return a.delete(r),a.delete(t),h},lM=Object.prototype.hasOwnProperty,Oae=function(r,t,e,n,i,a){var o=dn(r),s=dn(t),u=o?"[object Array]":bu(r),l=s?"[object Array]":bu(t),f=(u=u=="[object Arguments]"?"[object Object]":u)=="[object Object]",c=(l=l=="[object Arguments]"?"[object Object]":l)=="[object Object]",d=u==l;if(d&&mu(r)){if(!mu(t))return!1;o=!0,f=!1}if(d&&!f)return a||(a=new Sl),o||nd(r)?uN(r,t,e,n,i,a):Aae(r,t,u,e,n,i,a);if(!(1&e)){var h=f&&lM.call(r,"__wrapped__"),v=c&&lM.call(t,"__wrapped__");if(h||v){var p=h?r.value():r,g=v?t.value():t;return a||(a=new Sl),i(p,g,e,n,a)}}return!!d&&(a||(a=new Sl),Iae(r,t,e,n,i,a))},lN=function r(t,e,n,i,a){return t===e||(t==null||e==null||!ya(t)&&!ya(e)?t!=t&&e!=e:Oae(t,e,n,i,r,a))},Lae=function(r,t,e,n){var i=e.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=e[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){var u=(s=e[i])[0],l=r[u],f=s[1];if(o&&s[2]){if(l===void 0&&!(u in r))return!1}else{var c=new Sl;if(n)var d=n(l,f,u,r,t,c);if(!(d===void 0?lN(f,l,3,n,c):d))return!1}}return!0},fN=function(r){return r==r&&!Si(r)},kae=function(r){for(var t=Is(r),e=t.length;e--;){var n=t[e],i=r[n];t[e]=[n,i,fN(i)]}return t},cN=function(r,t){return function(e){return e!=null&&e[r]===t&&(t!==void 0||r in Object(e))}},Dae=function(r){var t=kae(r);return t.length==1&&t[0][2]?cN(t[0][0],t[0][1]):function(e){return e===r||Lae(e,r,t)}},xu=function(r){return typeof r=="symbol"||ya(r)&&Ts(r)=="[object Symbol]"},Nae=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pae=/^\w*$/,sx=function(r,t){if(dn(r))return!1;var e=typeof r;return!(e!="number"&&e!="symbol"&&e!="boolean"&&r!=null&&!xu(r))||Pae.test(r)||!Nae.test(r)||t!=null&&r in Object(t)};function ux(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var e=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=e.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return e.cache=a.set(i,o)||a,o};return e.cache=new(ux.Cache||Kp),e}ux.Cache=Kp;var Rae=ux,Bae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fae=/\\(\\)?/g,zae=function(r){var t=Rae(r,function(n){return e.size===500&&e.clear(),n}),e=t.cache;return t}(function(r){var t=[];return r.charCodeAt(0)===46&&t.push(""),r.replace(Bae,function(e,n,i,a){t.push(i?a.replace(Fae,"$1"):n||e)}),t}),Cl=function(r,t){for(var e=-1,n=r==null?0:r.length,i=Array(n);++e<n;)i[e]=t(r[e],e,r);return i},fM=ta?ta.prototype:void 0,cM=fM?fM.toString:void 0,Gae=function r(t){if(typeof t=="string")return t;if(dn(t))return Cl(t,r)+"";if(xu(t))return cM?cM.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e},dN=function(r){return r==null?"":Gae(r)},ng=function(r,t){return dn(r)?r:sx(r,t)?[r]:zae(dN(r))},id=function(r){if(typeof r=="string"||xu(r))return r;var t=r+"";return t=="0"&&1/r==-1/0?"-0":t},ig=function(r,t){for(var e=0,n=(t=ng(t,r)).length;r!=null&&e<n;)r=r[id(t[e++])];return e&&e==n?r:void 0},$ae=function(r,t,e){var n=r==null?void 0:ig(r,t);return n===void 0?e:n},Uae=function(r,t){return r!=null&&t in Object(r)},hN=function(r,t,e){for(var n=-1,i=(t=ng(t,r)).length,a=!1;++n<i;){var o=id(t[n]);if(!(a=r!=null&&e(r,o)))break;r=r[o]}return a||++n!=i?a:!!(i=r==null?0:r.length)&&Qb(i)&&Qp(o,i)&&(dn(r)||$l(r))},vN=function(r,t){return r!=null&&hN(r,t,Uae)},jae=function(r,t){return sx(r)&&fN(t)?cN(id(r),t):function(e){var n=$ae(e,r);return n===void 0&&n===t?vN(e,r):lN(t,n,3)}},pN=function(r){return function(t){return t==null?void 0:t[r]}},Wae=function(r){return function(t){return ig(t,r)}},Xae=function(r){return sx(r)?pN(id(r)):Wae(r)},$o=function(r){return typeof r=="function"?r:r==null?Au:typeof r=="object"?dn(r)?jae(r[0],r[1]):Dae(r):Xae(r)},gN=function(r,t){return(dn(r)?KD:Eae)(r,$o(t))},Yae=Object.prototype.hasOwnProperty,Vae=function(r,t){return r!=null&&Yae.call(r,t)},yN=function(r,t){return r!=null&&hN(r,t,Vae)},Hae=Object.prototype.hasOwnProperty,Kae=function(r){if(r==null)return!0;if(Go(r)&&(dn(r)||typeof r=="string"||typeof r.splice=="function"||mu(r)||nd(r)||$l(r)))return!r.length;var t=bu(r);if(t=="[object Map]"||t=="[object Set]")return!r.size;if(eg(r))return!Jb(r).length;for(var e in r)if(Hae.call(r,e))return!1;return!0},mN=function(r){return r===void 0},bN=function(r,t){var e=-1,n=Go(r)?Array(r.length):[];return rg(r,function(i,a,o){n[++e]=t(i,a,o)}),n},xN=function(r,t){return(dn(r)?Cl:bN)(r,$o(t))},qae=function(r,t,e,n){var i=-1,a=r==null?0:r.length;for(n&&a&&(e=r[++i]);++i<a;)e=t(e,r[i],i,r);return e},Zae=function(r,t,e,n,i){return i(r,function(a,o,s){e=n?(n=!1,a):t(e,a,o,s)}),e},wN=function(r,t,e){var n=dn(r)?qae:Zae,i=arguments.length<3;return n(r,$o(t),e,i,rg)},Qae=function(r){return typeof r=="string"||!dn(r)&&ya(r)&&Ts(r)=="[object String]"},Jae=pN("length"),eoe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),toe=function(r){return eoe.test(r)},roe="[\\ud800-\\udfff]",jm="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Wm="\\ud83c[\\udffb-\\udfff]",EN="[^\\ud800-\\udfff]",_N="(?:\\ud83c[\\udde6-\\uddff]){2}",SN="[\\ud800-\\udbff][\\udc00-\\udfff]",dM="(?:"+jm+"|"+Wm+")?",noe="[\\ufe0e\\ufe0f]?"+dM+("(?:\\u200d(?:"+[EN,_N,SN].join("|")+")[\\ufe0e\\ufe0f]?"+dM+")*"),ioe="(?:"+[EN+jm+"?",jm,_N,SN,roe].join("|")+")",hM=RegExp(Wm+"(?="+Wm+")|"+ioe+noe,"g"),aoe=function(r){for(var t=hM.lastIndex=0;hM.test(r);)++t;return t},ooe=function(r){return toe(r)?aoe(r):Jae(r)},soe=function(r){if(r==null)return 0;if(Go(r))return Qae(r)?ooe(r):r.length;var t=bu(r);return t=="[object Map]"||t=="[object Set]"?r.size:Jb(r).length},uoe=function(r,t,e){var n=dn(r),i=n||mu(r)||nd(r);if(t=$o(t),e==null){var a=r&&r.constructor;e=i?n?new a:[]:Si(r)&&td(a)?eN(tg(r)):{}}return(i?Zb:ax)(r,function(o,s,u){return t(e,o,s,u)}),e},vM=ta?ta.isConcatSpreadable:void 0,loe=function(r){return dn(r)||$l(r)||!!(vM&&r&&r[vM])},lx=function r(t,e,n,i,a){var o=-1,s=t.length;for(n||(n=loe),a||(a=[]);++o<s;){var u=t[o];e>0&&n(u)?e>1?r(u,e-1,n,i,a):tx(a,u):i||(a[a.length]=u)}return a},foe=function(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)},pM=Math.max,MN=function(r,t,e){return t=pM(t===void 0?r.length-1:t,0),function(){for(var n=arguments,i=-1,a=pM(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=e(o),foe(r,this,s)}},coe=Yv?function(r,t){return Yv(r,"toString",{configurable:!0,enumerable:!1,value:nx(t),writable:!0})}:Au,doe=Date.now,CN=function(r){var t=0,e=0;return function(){var n=doe(),i=16-(n-e);if(e=n,i>0){if(++t>=800)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}(coe),ag=function(r,t){return CN(MN(r,t,Au),r+"")},AN=function(r,t,e,n){for(var i=r.length,a=e+(n?1:-1);n?a--:++a<i;)if(t(r[a],a,r))return a;return-1},hoe=function(r){return r!=r},voe=function(r,t,e){for(var n=e-1,i=r.length;++n<i;)if(r[n]===t)return n;return-1},poe=function(r,t,e){return t==t?voe(r,t,e):AN(r,hoe,e)},goe=function(r,t){return!!(r!=null&&r.length)&&poe(r,t,0)>-1},yoe=function(r,t,e){for(var n=-1,i=r==null?0:r.length;++n<i;)if(e(t,r[n]))return!0;return!1},moe=function(){},boe=Ml&&1/ox(new Ml([,-0]))[1]==1/0?function(r){return new Ml(r)}:moe,xoe=function(r,t,e){var n=-1,i=goe,a=r.length,o=!0,s=[],u=s;if(e)o=!1,i=yoe;else if(a>=200){var l=t?null:boe(r);if(l)return ox(l);o=!1,i=sN,u=new oN}else u=t?[]:s;e:for(;++n<a;){var f=r[n],c=t?t(f):f;if(f=e||f!==0?f:0,o&&c==c){for(var d=u.length;d--;)if(u[d]===c)continue e;t&&u.push(c),s.push(f)}else i(u,c,e)||(u!==s&&u.push(c),s.push(f))}return s},TN=function(r){return ya(r)&&Go(r)},woe=ag(function(r){return xoe(lx(r,1,TN,!0))}),Eoe=function(r,t){return Cl(t,function(e){return r[e]})},Hv,IN=function(r){return r==null?[]:Eoe(r,Is(r))};try{Hv={clone:wae,constant:nx,each:aN,filter:gN,has:yN,isArray:dn,isEmpty:Kae,isFunction:td,isUndefined:mN,keys:Is,map:xN,reduce:wN,size:soe,transform:uoe,union:woe,values:IN}}catch{}Hv||(Hv=window._);var dt=Hv,fx=xr;function xr(r){this._isDirected=!dt.has(r,"directed")||r.directed,this._isMultigraph=!!dt.has(r,"multigraph")&&r.multigraph,this._isCompound=!!dt.has(r,"compound")&&r.compound,this._label=void 0,this._defaultNodeLabelFn=dt.constant(void 0),this._defaultEdgeLabelFn=dt.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function gM(r,t){r[t]?r[t]++:r[t]=1}function yM(r,t){--r[t]||delete r[t]}function Vf(r,t,e,n){var i=""+t,a=""+e;if(!r&&i>a){var o=i;i=a,a=o}return i+""+a+""+(dt.isUndefined(n)?"\0":n)}function _oe(r,t,e,n){var i=""+t,a=""+e;if(!r&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function ay(r,t){return Vf(r,t.v,t.w,t.name)}xr.prototype._nodeCount=0,xr.prototype._edgeCount=0,xr.prototype.isDirected=function(){return this._isDirected},xr.prototype.isMultigraph=function(){return this._isMultigraph},xr.prototype.isCompound=function(){return this._isCompound},xr.prototype.setGraph=function(r){return this._label=r,this},xr.prototype.graph=function(){return this._label},xr.prototype.setDefaultNodeLabel=function(r){return dt.isFunction(r)||(r=dt.constant(r)),this._defaultNodeLabelFn=r,this},xr.prototype.nodeCount=function(){return this._nodeCount},xr.prototype.nodes=function(){return dt.keys(this._nodes)},xr.prototype.sources=function(){var r=this;return dt.filter(this.nodes(),function(t){return dt.isEmpty(r._in[t])})},xr.prototype.sinks=function(){var r=this;return dt.filter(this.nodes(),function(t){return dt.isEmpty(r._out[t])})},xr.prototype.setNodes=function(r,t){var e=arguments,n=this;return dt.each(r,function(i){e.length>1?n.setNode(i,t):n.setNode(i)}),this},xr.prototype.setNode=function(r,t){return dt.has(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=t),this):(this._nodes[r]=arguments.length>1?t:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]="\0",this._children[r]={},this._children["\0"][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)},xr.prototype.node=function(r){return this._nodes[r]},xr.prototype.hasNode=function(r){return dt.has(this._nodes,r)},xr.prototype.removeNode=function(r){var t=this;if(dt.has(this._nodes,r)){var e=function(n){t.removeEdge(t._edgeObjs[n])};delete this._nodes[r],this._isCompound&&(this._removeFromParentsChildList(r),delete this._parent[r],dt.each(this.children(r),function(n){t.setParent(n)}),delete this._children[r]),dt.each(dt.keys(this._in[r]),e),delete this._in[r],delete this._preds[r],dt.each(dt.keys(this._out[r]),e),delete this._out[r],delete this._sucs[r],--this._nodeCount}return this},xr.prototype.setParent=function(r,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(dt.isUndefined(t))t="\0";else{for(var e=t+="";!dt.isUndefined(e);e=this.parent(e))if(e===r)throw new Error("Setting "+t+" as parent of "+r+" would create a cycle");this.setNode(t)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=t,this._children[t][r]=!0,this},xr.prototype._removeFromParentsChildList=function(r){delete this._children[this._parent[r]][r]},xr.prototype.parent=function(r){if(this._isCompound){var t=this._parent[r];if(t!=="\0")return t}},xr.prototype.children=function(r){if(dt.isUndefined(r)&&(r="\0"),this._isCompound){var t=this._children[r];if(t)return dt.keys(t)}else{if(r==="\0")return this.nodes();if(this.hasNode(r))return[]}},xr.prototype.predecessors=function(r){var t=this._preds[r];if(t)return dt.keys(t)},xr.prototype.successors=function(r){var t=this._sucs[r];if(t)return dt.keys(t)},xr.prototype.neighbors=function(r){var t=this.predecessors(r);if(t)return dt.union(t,this.successors(r))},xr.prototype.isLeaf=function(r){return(this.isDirected()?this.successors(r):this.neighbors(r)).length===0},xr.prototype.filterNodes=function(r){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var e=this;dt.each(this._nodes,function(a,o){r(o)&&t.setNode(o,a)}),dt.each(this._edgeObjs,function(a){t.hasNode(a.v)&&t.hasNode(a.w)&&t.setEdge(a,e.edge(a))});var n={};function i(a){var o=e.parent(a);return o===void 0||t.hasNode(o)?(n[a]=o,o):o in n?n[o]:i(o)}return this._isCompound&&dt.each(t.nodes(),function(a){t.setParent(a,i(a))}),t},xr.prototype.setDefaultEdgeLabel=function(r){return dt.isFunction(r)||(r=dt.constant(r)),this._defaultEdgeLabelFn=r,this},xr.prototype.edgeCount=function(){return this._edgeCount},xr.prototype.edges=function(){return dt.values(this._edgeObjs)},xr.prototype.setPath=function(r,t){var e=this,n=arguments;return dt.reduce(r,function(i,a){return n.length>1?e.setEdge(i,a,t):e.setEdge(i,a),a}),this},xr.prototype.setEdge=function(){var r,t,e,n,i=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(r=a.v,t=a.w,e=a.name,arguments.length===2&&(n=arguments[1],i=!0)):(r=a,t=arguments[1],e=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),r=""+r,t=""+t,dt.isUndefined(e)||(e=""+e);var o=Vf(this._isDirected,r,t,e);if(dt.has(this._edgeLabels,o))return i&&(this._edgeLabels[o]=n),this;if(!dt.isUndefined(e)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(t),this._edgeLabels[o]=i?n:this._defaultEdgeLabelFn(r,t,e);var s=_oe(this._isDirected,r,t,e);return r=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,gM(this._preds[t],r),gM(this._sucs[r],t),this._in[t][o]=s,this._out[r][o]=s,this._edgeCount++,this},xr.prototype.edge=function(r,t,e){var n=arguments.length===1?ay(this._isDirected,arguments[0]):Vf(this._isDirected,r,t,e);return this._edgeLabels[n]},xr.prototype.hasEdge=function(r,t,e){var n=arguments.length===1?ay(this._isDirected,arguments[0]):Vf(this._isDirected,r,t,e);return dt.has(this._edgeLabels,n)},xr.prototype.removeEdge=function(r,t,e){var n=arguments.length===1?ay(this._isDirected,arguments[0]):Vf(this._isDirected,r,t,e),i=this._edgeObjs[n];return i&&(r=i.v,t=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],yM(this._preds[t],r),yM(this._sucs[r],t),delete this._in[t][n],delete this._out[r][n],this._edgeCount--),this},xr.prototype.inEdges=function(r,t){var e=this._in[r];if(e){var n=dt.values(e);return t?dt.filter(n,function(i){return i.v===t}):n}},xr.prototype.outEdges=function(r,t){var e=this._out[r];if(e){var n=dt.values(e);return t?dt.filter(n,function(i){return i.w===t}):n}},xr.prototype.nodeEdges=function(r,t){var e=this.inEdges(r,t);if(e)return e.concat(this.outEdges(r,t))};var mM={Graph:fx,version:"2.1.8"},Soe={write:function(r){var t={options:{directed:r.isDirected(),multigraph:r.isMultigraph(),compound:r.isCompound()},nodes:Moe(r),edges:Coe(r)};return dt.isUndefined(r.graph())||(t.value=dt.clone(r.graph())),t},read:function(r){var t=new fx(r.options).setGraph(r.value);return dt.each(r.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),dt.each(r.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}};function Moe(r){return dt.map(r.nodes(),function(t){var e=r.node(t),n=r.parent(t),i={v:t};return dt.isUndefined(e)||(i.value=e),dt.isUndefined(n)||(i.parent=n),i})}function Coe(r){return dt.map(r.edges(),function(t){var e=r.edge(t),n={v:t.v,w:t.w};return dt.isUndefined(t.name)||(n.name=t.name),dt.isUndefined(e)||(n.value=e),n})}var Aoe=function(r){var t,e={},n=[];function i(a){dt.has(e,a)||(e[a]=!0,t.push(a),dt.each(r.successors(a),i),dt.each(r.predecessors(a),i))}return dt.each(r.nodes(),function(a){t=[],i(a),t.length&&n.push(t)}),n},ON=Vi;function Vi(){this._arr=[],this._keyIndices={}}Vi.prototype.size=function(){return this._arr.length},Vi.prototype.keys=function(){return this._arr.map(function(r){return r.key})},Vi.prototype.has=function(r){return dt.has(this._keyIndices,r)},Vi.prototype.priority=function(r){var t=this._keyIndices[r];if(t!==void 0)return this._arr[t].priority},Vi.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},Vi.prototype.add=function(r,t){var e=this._keyIndices;if(r=String(r),!dt.has(e,r)){var n=this._arr,i=n.length;return e[r]=i,n.push({key:r,priority:t}),this._decrease(i),!0}return!1},Vi.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},Vi.prototype.decrease=function(r,t){var e=this._keyIndices[r];if(t>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[e].priority+" New: "+t);this._arr[e].priority=t,this._decrease(e)},Vi.prototype._heapify=function(r){var t=this._arr,e=2*r,n=e+1,i=r;e<t.length&&(i=t[e].priority<t[i].priority?e:i,n<t.length&&(i=t[n].priority<t[i].priority?n:i),i!==r&&(this._swap(r,i),this._heapify(i)))},Vi.prototype._decrease=function(r){for(var t,e=this._arr,n=e[r].priority;r!==0&&!(e[t=r>>1].priority<n);)this._swap(r,t),r=t},Vi.prototype._swap=function(r,t){var e=this._arr,n=this._keyIndices,i=e[r],a=e[t];e[r]=a,e[t]=i,n[a.key]=r,n[i.key]=t};var LN=function(r,t,e,n){return function(i,a,o,s){var u,l,f={},c=new ON,d=function(h){var v=h.v!==u?h.v:h.w,p=f[v],g=o(h),y=l.distance+g;if(g<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+h+" Weight: "+g);y<p.distance&&(p.distance=y,p.predecessor=u,c.decrease(v,y))};for(i.nodes().forEach(function(h){var v=h===a?0:Number.POSITIVE_INFINITY;f[h]={distance:v},c.add(h,v)});c.size()>0&&(u=c.removeMin(),(l=f[u]).distance!==Number.POSITIVE_INFINITY);)s(u).forEach(d);return f}(r,String(t),e||Toe,n||function(i){return r.outEdges(i)})},Toe=dt.constant(1),Ioe=function(r,t,e){return dt.transform(r.nodes(),function(n,i){n[i]=LN(r,i,t,e)},{})},kN=function(r){var t=0,e=[],n={},i=[];function a(o){var s=n[o]={onStack:!0,lowlink:t,index:t++};if(e.push(o),r.successors(o).forEach(function(f){dt.has(n,f)?n[f].onStack&&(s.lowlink=Math.min(s.lowlink,n[f].index)):(a(f),s.lowlink=Math.min(s.lowlink,n[f].lowlink))}),s.lowlink===s.index){var u,l=[];do u=e.pop(),n[u].onStack=!1,l.push(u);while(o!==u);i.push(l)}}return r.nodes().forEach(function(o){dt.has(n,o)||a(o)}),i},Ooe=function(r){return dt.filter(kN(r),function(t){return t.length>1||t.length===1&&r.hasEdge(t[0],t[0])})},Loe=function(r,t,e){return function(n,i,a){var o={},s=n.nodes();return s.forEach(function(u){o[u]={},o[u][u]={distance:0},s.forEach(function(l){u!==l&&(o[u][l]={distance:Number.POSITIVE_INFINITY})}),a(u).forEach(function(l){var f=l.v===u?l.w:l.v,c=i(l);o[u][f]={distance:c,predecessor:u}})}),s.forEach(function(u){var l=o[u];s.forEach(function(f){var c=o[f];s.forEach(function(d){var h=c[u],v=l[d],p=c[d],g=h.distance+v.distance;g<p.distance&&(p.distance=g,p.predecessor=v.predecessor)})})}),o}(r,t||koe,e||function(n){return r.outEdges(n)})},koe=dt.constant(1),oy=DN;function DN(r){var t={},e={},n=[];if(dt.each(r.sinks(),function i(a){if(dt.has(e,a))throw new Kv;dt.has(t,a)||(e[a]=!0,t[a]=!0,dt.each(r.predecessors(a),i),delete e[a],n.push(a))}),dt.size(t)!==r.nodeCount())throw new Kv;return n}function Kv(){}DN.CycleException=Kv,Kv.prototype=new Error;var bM=function(r,t,e){dt.isArray(t)||(t=[t]);var n=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],a={};return dt.each(t,function(o){if(!r.hasNode(o))throw new Error("Graph does not have node: "+o);NN(r,o,e==="post",a,n,i)}),i};function NN(r,t,e,n,i,a){dt.has(n,t)||(n[t]=!0,e||a.push(t),dt.each(i(t),function(o){NN(r,o,e,n,i,a)}),e&&a.push(t))}var qv,Doe={Graph:mM.Graph,json:Soe,alg:{components:Aoe,dijkstra:LN,dijkstraAll:Ioe,findCycles:Ooe,floydWarshall:Loe,isAcyclic:function(r){try{oy(r)}catch(t){if(t instanceof oy.CycleException)return!1;throw t}return!0},postorder:function(r,t){return bM(r,t,"post")},preorder:function(r,t){return bM(r,t,"pre")},prim:function(r,t){var e,n=new fx,i={},a=new ON;function o(u){var l=u.v===e?u.w:u.v,f=a.priority(l);if(f!==void 0){var c=t(u);c<f&&(i[l]=e,a.decrease(l,c))}}if(r.nodeCount()===0)return n;dt.each(r.nodes(),function(u){a.add(u,Number.POSITIVE_INFINITY),n.setNode(u)}),a.decrease(r.nodes()[0],0);for(var s=!1;a.size()>0;){if(e=a.removeMin(),dt.has(i,e))n.setEdge(e,i[e]);else{if(s)throw new Error("Input graph is not connected: "+r);s=!0}r.nodeEdges(e).forEach(o)}return n},tarjan:kN,topsort:oy},version:mM.version};try{qv=Doe}catch{}qv||(qv=window.graphlib);var _a=qv,Noe=function(r){return rN(r,5)},Ic=function(r,t,e){if(!Si(e))return!1;var n=typeof t;return!!(n=="number"?Go(e)&&Qp(t,e.length):n=="string"&&t in e)&&Zl(e[t],r)},PN=Object.prototype,Poe=PN.hasOwnProperty,Roe=ag(function(r,t){r=Object(r);var e=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&Ic(t[0],t[1],i)&&(n=1);++e<n;)for(var a=t[e],o=Cu(a),s=-1,u=o.length;++s<u;){var l=o[s],f=r[l];(f===void 0||Zl(f,PN[l])&&!Poe.call(r,l))&&(r[l]=a[l])}return r}),Boe=function(r){return function(t,e,n){var i=Object(t);if(!Go(t)){var a=$o(e);t=Is(t),e=function(s){return a(i[s],s,i)}}var o=r(t,e,n);return o>-1?i[a?t[o]:o]:void 0}},Foe=/^\s+|\s+$/g,zoe=/^[-+]0x[0-9a-f]+$/i,Goe=/^0b[01]+$/i,$oe=/^0o[0-7]+$/i,Uoe=parseInt,joe=function(r){if(typeof r=="number")return r;if(xu(r))return NaN;if(Si(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=Si(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=r.replace(Foe,"");var e=Goe.test(r);return e||$oe.test(r)?Uoe(r.slice(2),e?2:8):zoe.test(r)?NaN:+r},ov=function(r){return r?(r=joe(r))===1/0||r===-1/0?17976931348623157e292*(r<0?-1:1):r==r?r:0:r===0?r:0},Woe=function(r){var t=ov(r),e=t%1;return t==t?e?t-e:t:0},Xoe=Math.max,Yoe=Boe(function(r,t,e){var n=r==null?0:r.length;if(!n)return-1;var i=e==null?0:Woe(e);return i<0&&(i=Xoe(n+i,0)),AN(r,$o(t),i)}),RN=function(r){return r!=null&&r.length?lx(r,1):[]},Voe=function(r,t){return r==null?r:ix(r,nN(t),Cu)},Hoe=function(r){var t=r==null?0:r.length;return t?r[t-1]:void 0},Koe=function(r,t){var e={};return t=$o(t),ax(r,function(n,i,a){qp(e,i,t(n,i,a))}),e},cx=function(r,t,e){for(var n=-1,i=r.length;++n<i;){var a=r[n],o=t(a);if(o!=null&&(s===void 0?o==o&&!xu(o):e(o,s)))var s=o,u=a}return u},qoe=function(r,t){return r>t},Zoe=function(r){return r&&r.length?cx(r,Au,qoe):void 0},Xm=function(r,t,e){(e!==void 0&&!Zl(r[t],e)||e===void 0&&!(t in r))&&qp(r,t,e)},Qoe=Function.prototype,Joe=Object.prototype,BN=Qoe.toString,ese=Joe.hasOwnProperty,tse=BN.call(Object),rse=function(r){if(!ya(r)||Ts(r)!="[object Object]")return!1;var t=tg(r);if(t===null)return!0;var e=ese.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&BN.call(e)==tse},Ym=function(r,t){if((t!=="constructor"||typeof r[t]!="function")&&t!="__proto__")return r[t]},nse=function(r){return rd(r,Cu(r))},ise=function(r,t,e,n,i,a,o){var s=Ym(r,e),u=Ym(t,e),l=o.get(u);if(l)Xm(r,e,l);else{var f=a?a(s,u,e+"",r,t,o):void 0,c=f===void 0;if(c){var d=dn(u),h=!d&&mu(u),v=!d&&!h&&nd(u);f=u,d||h||v?dn(s)?f=s:TN(s)?f=HD(s):h?(c=!1,f=VD(u,!0)):v?(c=!1,f=JD(u,!0)):f=[]:rse(u)||$l(u)?(f=s,$l(s)?f=nse(s):Si(s)&&!td(s)||(f=tN(u))):c=!1}c&&(o.set(u,f),i(f,u,n,a,o),o.delete(u)),Xm(r,e,f)}},ase=function r(t,e,n,i,a){t!==e&&ix(e,function(o,s){if(a||(a=new Sl),Si(o))ise(t,e,s,n,r,i,a);else{var u=i?i(Ym(t,s),o,s+"",t,e,a):void 0;u===void 0&&(u=o),Xm(t,s,u)}},Cu)},ose=function(r){return ag(function(t,e){var n=-1,i=e.length,a=i>1?e[i-1]:void 0,o=i>2?e[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,o&&Ic(e[0],e[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=e[n];s&&r(t,s,n,a)}return t})}(function(r,t,e){ase(r,t,e)}),FN=function(r,t){return r<t},sse=function(r){return r&&r.length?cx(r,Au,FN):void 0},use=function(r,t){return r&&r.length?cx(r,$o(t),FN):void 0},lse=function(){return Ea.Date.now()},fse=function(r,t,e,n){if(!Si(r))return r;for(var i=-1,a=(t=ng(t,r)).length,o=a-1,s=r;s!=null&&++i<a;){var u=id(t[i]),l=e;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(i!=o){var f=s[u];(l=n?n(f,u,s):void 0)===void 0&&(l=Si(f)?f:Qp(t[i+1])?[]:{})}Zp(s,u,l),s=s[u]}return r},cse=function(r,t,e){for(var n=-1,i=t.length,a={};++n<i;){var o=t[n],s=ig(r,o);e(s,o)&&fse(a,ng(o,r),s)}return a},dse=function(r,t){return cse(r,t,function(e,n){return vN(r,n)})},hse=function(r){return CN(MN(r,void 0,RN),r+"")}(function(r,t){return r==null?{}:dse(r,t)}),vse=Math.ceil,pse=Math.max,gse=function(r,t,e,n){for(var i=-1,a=pse(vse((t-r)/(e||1)),0),o=Array(a);a--;)o[n?a:++i]=r,r+=e;return o},yse=function(r){return function(t,e,n){return n&&typeof n!="number"&&Ic(t,e,n)&&(e=n=void 0),t=ov(t),e===void 0?(e=t,t=0):e=ov(e),n=n===void 0?t<e?1:-1:ov(n),gse(t,e,n,r)}}(),mse=function(r,t){var e=r.length;for(r.sort(t);e--;)r[e]=r[e].value;return r},bse=function(r,t){if(r!==t){var e=r!==void 0,n=r===null,i=r==r,a=xu(r),o=t!==void 0,s=t===null,u=t==t,l=xu(t);if(!s&&!l&&!a&&r>t||a&&o&&u&&!s&&!l||n&&o&&u||!e&&u||!i)return 1;if(!n&&!a&&!l&&r<t||l&&e&&i&&!n&&!a||s&&e&&i||!o&&i||!u)return-1}return 0},xse=function(r,t,e){for(var n=-1,i=r.criteria,a=t.criteria,o=i.length,s=e.length;++n<o;){var u=bse(i[n],a[n]);if(u)return n>=s?u:u*(e[n]=="desc"?-1:1)}return r.index-t.index},wse=function(r,t,e){t=t.length?Cl(t,function(a){return dn(a)?function(o){return ig(o,a.length===1?a[0]:a)}:a}):[Au];var n=-1;t=Cl(t,Jp($o));var i=bN(r,function(a,o,s){return{criteria:Cl(t,function(u){return u(a)}),index:++n,value:a}});return mse(i,function(a,o){return xse(a,o,e)})},Ese=ag(function(r,t){if(r==null)return[];var e=t.length;return e>1&&Ic(r,t[0],t[1])?t=[]:e>2&&Ic(t[0],t[1],t[2])&&(t=[t[0]]),wse(r,lx(t,1),[])}),_se=0,Sse=function(r){var t=++_se;return dN(r)+t},Mse=function(r,t,e){for(var n=-1,i=r.length,a=t.length,o={};++n<i;){var s=n<a?t[n]:void 0;e(o,r[n],s)}return o},Zv,Cse=function(r,t){return Mse(r||[],t||[],Zp)};try{Zv={cloneDeep:Noe,constant:nx,defaults:Roe,each:aN,filter:gN,find:Yoe,flatten:RN,forEach:iN,forIn:Voe,has:yN,isUndefined:mN,last:Hoe,map:xN,mapValues:Koe,max:Zoe,merge:ose,min:sse,minBy:use,now:lse,pick:hse,range:yse,reduce:wN,sortBy:Ese,uniqueId:Sse,values:IN,zipObject:Cse}}catch{}Zv||(Zv=window._);var Q=Zv,Ase=sv;function sv(){var r={};r._next=r._prev=r,this._sentinel=r}function xM(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function Tse(r,t){if(r!=="_next"&&r!=="_prev")return t}sv.prototype.dequeue=function(){var r=this._sentinel,t=r._prev;if(t!==r)return xM(t),t},sv.prototype.enqueue=function(r){var t=this._sentinel;r._prev&&r._next&&xM(r),r._next=t._next,t._next._prev=r,t._next=r,r._prev=t},sv.prototype.toString=function(){for(var r=[],t=this._sentinel,e=t._prev;e!==t;)r.push(JSON.stringify(e,Tse)),e=e._prev;return"["+r.join(", ")+"]"};var Ise=_a.Graph,Ose=function(r,t){if(r.nodeCount()<=1)return[];var e=function(i,a){var o=new Ise,s=0,u=0;Q.forEach(i.nodes(),function(c){o.setNode(c,{v:c,in:0,out:0})}),Q.forEach(i.edges(),function(c){var d=o.edge(c.v,c.w)||0,h=a(c),v=d+h;o.setEdge(c.v,c.w,v),u=Math.max(u,o.node(c.v).out+=h),s=Math.max(s,o.node(c.w).in+=h)});var l=Q.range(u+s+3).map(function(){return new Ase}),f=s+1;return Q.forEach(o.nodes(),function(c){Vm(l,f,o.node(c))}),{graph:o,buckets:l,zeroIdx:f}}(r,t||Lse),n=function(i,a,o){for(var s,u=[],l=a[a.length-1],f=a[0];i.nodeCount();){for(;s=f.dequeue();)sy(i,a,o,s);for(;s=l.dequeue();)sy(i,a,o,s);if(i.nodeCount()){for(var c=a.length-2;c>0;--c)if(s=a[c].dequeue()){u=u.concat(sy(i,a,o,s,!0));break}}}return u}(e.graph,e.buckets,e.zeroIdx);return Q.flatten(Q.map(n,function(i){return r.outEdges(i.v,i.w)}),!0)},Lse=Q.constant(1);function sy(r,t,e,n,i){var a=i?[]:void 0;return Q.forEach(r.inEdges(n.v),function(o){var s=r.edge(o),u=r.node(o.v);i&&a.push({v:o.v,w:o.w}),u.out-=s,Vm(t,e,u)}),Q.forEach(r.outEdges(n.v),function(o){var s=r.edge(o),u=o.w,l=r.node(u);l.in-=s,Vm(t,e,l)}),r.removeNode(n.v),a}function Vm(r,t,e){e.out?e.in?r[e.out-e.in+t].enqueue(e):r[r.length-1].enqueue(e):r[0].enqueue(e)}var wM={run:function(r){var t=r.graph().acyclicer==="greedy"?Ose(r,function(e){return function(n){return e.edge(n).weight}}(r)):function(e){var n=[],i={},a={};function o(s){Q.has(a,s)||(a[s]=!0,i[s]=!0,Q.forEach(e.outEdges(s),function(u){Q.has(i,u.w)?n.push(u):o(u.w)}),delete i[s])}return Q.forEach(e.nodes(),o),n}(r);Q.forEach(t,function(e){var n=r.edge(e);r.removeEdge(e),n.forwardName=e.name,n.reversed=!0,r.setEdge(e.w,e.v,n,Q.uniqueId("rev"))})},undo:function(r){Q.forEach(r.edges(),function(t){var e=r.edge(t);if(e.reversed){r.removeEdge(t);var n=e.forwardName;delete e.reversed,delete e.forwardName,r.setEdge(t.w,t.v,e,n)}})}},EM=_a.Graph,Xn={addDummyNode:_M,simplify:function(r){var t=new EM().setGraph(r.graph());return Q.forEach(r.nodes(),function(e){t.setNode(e,r.node(e))}),Q.forEach(r.edges(),function(e){var n=t.edge(e.v,e.w)||{weight:0,minlen:1},i=r.edge(e);t.setEdge(e.v,e.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t},asNonCompoundGraph:function(r){var t=new EM({multigraph:r.isMultigraph()}).setGraph(r.graph());return Q.forEach(r.nodes(),function(e){r.children(e).length||t.setNode(e,r.node(e))}),Q.forEach(r.edges(),function(e){t.setEdge(e,r.edge(e))}),t},successorWeights:function(r){var t=Q.map(r.nodes(),function(e){var n={};return Q.forEach(r.outEdges(e),function(i){n[i.w]=(n[i.w]||0)+r.edge(i).weight}),n});return Q.zipObject(r.nodes(),t)},predecessorWeights:function(r){var t=Q.map(r.nodes(),function(e){var n={};return Q.forEach(r.inEdges(e),function(i){n[i.v]=(n[i.v]||0)+r.edge(i).weight}),n});return Q.zipObject(r.nodes(),t)},intersectRect:function(r,t){var e,n,i=r.x,a=r.y,o=t.x-i,s=t.y-a,u=r.width/2,l=r.height/2;if(!o&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(o)*l?(s<0&&(l=-l),e=l*o/s,n=l):(o<0&&(u=-u),e=u,n=u*s/o),{x:i+e,y:a+n}},buildLayerMatrix:function(r){var t=Q.map(Q.range(SM(r)+1),function(){return[]});return Q.forEach(r.nodes(),function(e){var n=r.node(e),i=n.rank;Q.isUndefined(i)||(t[i][n.order]=e)}),t},normalizeRanks:function(r){var t=Q.min(Q.map(r.nodes(),function(e){return r.node(e).rank}));Q.forEach(r.nodes(),function(e){var n=r.node(e);Q.has(n,"rank")&&(n.rank-=t)})},removeEmptyRanks:function(r){var t=Q.min(Q.map(r.nodes(),function(a){return r.node(a).rank})),e=[];Q.forEach(r.nodes(),function(a){var o=r.node(a).rank-t;e[o]||(e[o]=[]),e[o].push(a)});var n=0,i=r.graph().nodeRankFactor;Q.forEach(e,function(a,o){Q.isUndefined(a)&&o%i!=0?--n:n&&Q.forEach(a,function(s){r.node(s).rank+=n})})},addBorderNode:function(r,t,e,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=e,i.order=n),_M(r,"border",i,t)},maxRank:SM,partition:function(r,t){var e={lhs:[],rhs:[]};return Q.forEach(r,function(n){t(n)?e.lhs.push(n):e.rhs.push(n)}),e},time:function(r,t){var e=Q.now();try{return t()}finally{console.log(r+" time: "+(Q.now()-e)+"ms")}},notime:function(r,t){return t()}};function _M(r,t,e,n){var i;do i=Q.uniqueId(n);while(r.hasNode(i));return e.dummy=t,r.setNode(i,e),i}function SM(r){return Q.max(Q.map(r.nodes(),function(t){var e=r.node(t).rank;if(!Q.isUndefined(e))return e}))}var MM={run:function(r){r.graph().dummyChains=[],Q.forEach(r.edges(),function(t){(function(e,n){var i,a,o,s=n.v,u=e.node(s).rank,l=n.w,f=e.node(l).rank,c=n.name,d=e.edge(n),h=d.labelRank;if(f!==u+1){for(e.removeEdge(n),o=0,++u;u<f;++o,++u)d.points=[],a={width:0,height:0,edgeLabel:d,edgeObj:n,rank:u},i=Xn.addDummyNode(e,"edge",a,"_d"),u===h&&(a.width=d.width,a.height=d.height,a.dummy="edge-label",a.labelpos=d.labelpos),e.setEdge(s,i,{weight:d.weight},c),o===0&&e.graph().dummyChains.push(i),s=i;e.setEdge(s,l,{weight:d.weight},c)}})(r,t)})},undo:function(r){Q.forEach(r.graph().dummyChains,function(t){var e,n=r.node(t),i=n.edgeLabel;for(r.setEdge(n.edgeObj,i);n.dummy;)e=r.successors(t)[0],r.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=e,n=r.node(t)})}},zN=function(r){var t={};Q.forEach(r.sources(),function e(n){var i=r.node(n);if(Q.has(t,n))return i.rank;t[n]=!0;var a=Q.min(Q.map(r.outEdges(n),function(o){return e(o.w)-r.edge(o).minlen}));return a!==Number.POSITIVE_INFINITY&&a!=null||(a=0),i.rank=a})},GN=function(r,t){return r.node(t.w).rank-r.node(t.v).rank-r.edge(t).minlen},kse=_a.Graph,Qv=GN,$N=function(r){var t,e,n=new kse({directed:!1}),i=r.nodes()[0],a=r.nodeCount();for(n.setNode(i,{});Dse(n,r)<a;)t=Nse(n,r),e=n.hasNode(t.v)?Qv(r,t):-Qv(r,t),Pse(n,r,e);return n};function Dse(r,t){return Q.forEach(r.nodes(),function e(n){Q.forEach(t.nodeEdges(n),function(i){var a=i.v,o=n===a?i.w:a;r.hasNode(o)||Qv(t,i)||(r.setNode(o,{}),r.setEdge(n,o,{}),e(o))})}),r.nodeCount()}function Nse(r,t){return Q.minBy(t.edges(),function(e){if(r.hasNode(e.v)!==r.hasNode(e.w))return Qv(t,e)})}function Pse(r,t,e){Q.forEach(r.nodes(),function(n){t.node(n).rank+=e})}var Rse=GN,Bse=zN,Fse=_a.alg.preorder,zse=_a.alg.postorder,Gse=Xn.simplify,$se=Zs;function Zs(r){r=Gse(r),Bse(r);var t,e=$N(r);for(hx(e),dx(e,r);t=WN(e);)YN(e,r,t,XN(e,r,t))}function dx(r,t){var e=zse(r,r.nodes());e=e.slice(0,e.length-1),Q.forEach(e,function(n){(function(i,a,o){var s=i.node(o).parent;i.edge(o,s).cutvalue=UN(i,a,o)})(r,t,n)})}function UN(r,t,e){var n=r.node(e).parent,i=!0,a=t.edge(e,n),o=0;return a||(i=!1,a=t.edge(n,e)),o=a.weight,Q.forEach(t.nodeEdges(e),function(s){var u,l,f=s.v===e,c=f?s.w:s.v;if(c!==n){var d=f===i,h=t.edge(s).weight;if(o+=d?h:-h,u=e,l=c,r.hasEdge(u,l)){var v=r.edge(e,c).cutvalue;o+=d?-v:v}}}),o}function hx(r,t){arguments.length<2&&(t=r.nodes()[0]),jN(r,{},1,t)}function jN(r,t,e,n,i){var a=e,o=r.node(n);return t[n]=!0,Q.forEach(r.neighbors(n),function(s){Q.has(t,s)||(e=jN(r,t,e,s,n))}),o.low=a,o.lim=e++,i?o.parent=i:delete o.parent,e}function WN(r){return Q.find(r.edges(),function(t){return r.edge(t).cutvalue<0})}function XN(r,t,e){var n=e.v,i=e.w;t.hasEdge(n,i)||(n=e.w,i=e.v);var a=r.node(n),o=r.node(i),s=a,u=!1;a.lim>o.lim&&(s=o,u=!0);var l=Q.filter(t.edges(),function(f){return u===CM(r,r.node(f.v),s)&&u!==CM(r,r.node(f.w),s)});return Q.minBy(l,function(f){return Rse(t,f)})}function YN(r,t,e,n){var i=e.v,a=e.w;r.removeEdge(i,a),r.setEdge(n.v,n.w,{}),hx(r),dx(r,t),function(o,s){var u=Q.find(o.nodes(),function(f){return!s.node(f).parent}),l=Fse(o,u);l=l.slice(1),Q.forEach(l,function(f){var c=o.node(f).parent,d=s.edge(f,c),h=!1;d||(d=s.edge(c,f),h=!0),s.node(f).rank=s.node(c).rank+(h?d.minlen:-d.minlen)})}(r,t)}function CM(r,t,e){return e.low<=t.lim&&t.lim<=e.lim}Zs.initLowLimValues=hx,Zs.initCutValues=dx,Zs.calcCutValue=UN,Zs.leaveEdge=WN,Zs.enterEdge=XN,Zs.exchangeEdges=YN;var VN=zN,Use=function(r){switch(r.graph().ranker){case"network-simplex":AM(r);break;case"tight-tree":(function(t){VN(t),$N(t)})(r);break;case"longest-path":jse(r);break;default:AM(r)}},jse=VN;function AM(r){$se(r)}var Wse=function(r){var t=function(e){var n={},i=0;function a(o){var s=i;Q.forEach(e.children(o),a),n[o]={low:s,lim:i++}}return Q.forEach(e.children(),a),n}(r);Q.forEach(r.graph().dummyChains,function(e){for(var n=r.node(e),i=n.edgeObj,a=function(c,d,h,v){var p,g,y=[],m=[],b=Math.min(d[h].low,d[v].low),x=Math.max(d[h].lim,d[v].lim);p=h;do p=c.parent(p),y.push(p);while(p&&(d[p].low>b||x>d[p].lim));for(g=p,p=v;(p=c.parent(p))!==g;)m.push(p);return{path:y.concat(m.reverse()),lca:g}}(r,t,i.v,i.w),o=a.path,s=a.lca,u=0,l=o[u],f=!0;e!==i.w;){if(n=r.node(e),f){for(;(l=o[u])!==s&&r.node(l).maxRank<n.rank;)u++;l===s&&(f=!1)}if(!f){for(;u<o.length-1&&r.node(l=o[u+1]).minRank<=n.rank;)u++;l=o[u]}r.setParent(e,l),e=r.successors(e)[0]}})},TM={run:function(r){var t=Xn.addDummyNode(r,"root",{},"_root"),e=function(o){var s={};function u(l,f){var c=o.children(l);c&&c.length&&Q.forEach(c,function(d){u(d,f+1)}),s[l]=f}return Q.forEach(o.children(),function(l){u(l,1)}),s}(r),n=Q.max(Q.values(e))-1,i=2*n+1;r.graph().nestingRoot=t,Q.forEach(r.edges(),function(o){r.edge(o).minlen*=i});var a=function(o){return Q.reduce(o.edges(),function(s,u){return s+o.edge(u).weight},0)}(r)+1;Q.forEach(r.children(),function(o){HN(r,t,i,a,n,e,o)}),r.graph().nodeRankFactor=i},cleanup:function(r){var t=r.graph();r.removeNode(t.nestingRoot),delete t.nestingRoot,Q.forEach(r.edges(),function(e){r.edge(e).nestingEdge&&r.removeEdge(e)})}};function HN(r,t,e,n,i,a,o){var s=r.children(o);if(s.length){var u=Xn.addBorderNode(r,"_bt"),l=Xn.addBorderNode(r,"_bb"),f=r.node(o);r.setParent(u,o),f.borderTop=u,r.setParent(l,o),f.borderBottom=l,Q.forEach(s,function(c){HN(r,t,e,n,i,a,c);var d=r.node(c),h=d.borderTop?d.borderTop:c,v=d.borderBottom?d.borderBottom:c,p=d.borderTop?n:2*n,g=h!==v?1:i-a[o]+1;r.setEdge(u,h,{weight:p,minlen:g,nestingEdge:!0}),r.setEdge(v,l,{weight:p,minlen:g,nestingEdge:!0})}),r.parent(o)||r.setEdge(t,u,{weight:0,minlen:i+a[o]})}else o!==t&&r.setEdge(t,o,{weight:0,minlen:e})}var Xse=function(r){Q.forEach(r.children(),function t(e){var n=r.children(e),i=r.node(e);if(n.length&&Q.forEach(n,t),Q.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)IM(r,"borderLeft","_bl",e,i,a),IM(r,"borderRight","_br",e,i,a)}})};function IM(r,t,e,n,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],u=Xn.addDummyNode(r,"border",o,e);i[t][a]=u,r.setParent(u,n),s&&r.setEdge(s,u,{weight:1})}var OM={adjust:function(r){var t=r.graph().rankdir.toLowerCase();t!=="lr"&&t!=="rl"||LM(r)},undo:function(r){var t=r.graph().rankdir.toLowerCase();t!=="bt"&&t!=="rl"||function(e){Q.forEach(e.nodes(),function(n){uy(e.node(n))}),Q.forEach(e.edges(),function(n){var i=e.edge(n);Q.forEach(i.points,uy),Q.has(i,"y")&&uy(i)})}(r),t!=="lr"&&t!=="rl"||(function(e){Q.forEach(e.nodes(),function(n){ly(e.node(n))}),Q.forEach(e.edges(),function(n){var i=e.edge(n);Q.forEach(i.points,ly),Q.has(i,"x")&&ly(i)})}(r),LM(r))}};function LM(r){Q.forEach(r.nodes(),function(t){kM(r.node(t))}),Q.forEach(r.edges(),function(t){kM(r.edge(t))})}function kM(r){var t=r.width;r.width=r.height,r.height=t}function uy(r){r.y=-r.y}function ly(r){var t=r.x;r.x=r.y,r.y=t}var Yse=function(r){var t={},e=Q.filter(r.nodes(),function(s){return!r.children(s).length}),n=Q.max(Q.map(e,function(s){return r.node(s).rank})),i=Q.map(Q.range(n+1),function(){return[]});function a(s){if(!Q.has(t,s)){t[s]=!0;var u=r.node(s);i[u.rank].push(s),Q.forEach(r.successors(s),a)}}var o=Q.sortBy(e,function(s){return r.node(s).rank});return Q.forEach(o,a),i},Vse=function(r,t){for(var e=0,n=1;n<t.length;++n)e+=Hse(r,t[n-1],t[n]);return e};function Hse(r,t,e){for(var n=Q.zipObject(e,Q.map(e,function(l,f){return f})),i=Q.flatten(Q.map(t,function(l){return Q.sortBy(Q.map(r.outEdges(l),function(f){return{pos:n[f.w],weight:r.edge(f).weight}}),"pos")}),!0),a=1;a<e.length;)a<<=1;var o=2*a-1;a-=1;var s=Q.map(new Array(o),function(){return 0}),u=0;return Q.forEach(i.forEach(function(l){var f=l.pos+a;s[f]+=l.weight;for(var c=0;f>0;)f%2&&(c+=s[f+1]),s[f=f-1>>1]+=l.weight;u+=l.weight*c})),u}var Kse=function(r,t){return Q.map(t,function(e){var n=r.inEdges(e);if(n.length){var i=Q.reduce(n,function(a,o){var s=r.edge(o),u=r.node(o.v);return{sum:a.sum+s.weight*u.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})},qse=function(r,t){var e={};return Q.forEach(r,function(n,i){var a=e[n.v]={indegree:0,in:[],out:[],vs:[n.v],i};Q.isUndefined(n.barycenter)||(a.barycenter=n.barycenter,a.weight=n.weight)}),Q.forEach(t.edges(),function(n){var i=e[n.v],a=e[n.w];Q.isUndefined(i)||Q.isUndefined(a)||(a.indegree++,i.out.push(e[n.w]))}),function(n){var i=[];function a(u){return function(l){l.merged||(Q.isUndefined(l.barycenter)||Q.isUndefined(u.barycenter)||l.barycenter>=u.barycenter)&&function(f,c){var d=0,h=0;f.weight&&(d+=f.barycenter*f.weight,h+=f.weight),c.weight&&(d+=c.barycenter*c.weight,h+=c.weight),f.vs=c.vs.concat(f.vs),f.barycenter=d/h,f.weight=h,f.i=Math.min(c.i,f.i),c.merged=!0}(u,l)}}function o(u){return function(l){l.in.push(u),--l.indegree==0&&n.push(l)}}for(;n.length;){var s=n.pop();i.push(s),Q.forEach(s.in.reverse(),a(s)),Q.forEach(s.out,o(s))}return Q.map(Q.filter(i,function(u){return!u.merged}),function(u){return Q.pick(u,["vs","i","barycenter","weight"])})}(Q.filter(e,function(n){return!n.indegree}))},Zse=function(r,t){var e=Xn.partition(r,function(c){return Q.has(c,"barycenter")}),n=e.lhs,i=Q.sortBy(e.rhs,function(c){return-c.i}),a=[],o=0,s=0,u=0;n.sort((l=!!t,function(c,d){return c.barycenter<d.barycenter?-1:c.barycenter>d.barycenter?1:l?d.i-c.i:c.i-d.i})),u=DM(a,i,u),Q.forEach(n,function(c){u+=c.vs.length,a.push(c.vs),o+=c.barycenter*c.weight,s+=c.weight,u=DM(a,i,u)});var l,f={vs:Q.flatten(a,!0)};return s&&(f.barycenter=o/s,f.weight=s),f};function DM(r,t,e){for(var n;t.length&&(n=Q.last(t)).i<=e;)t.pop(),r.push(n.vs),e++;return e}var Qse=function r(t,e,n,i){var a=t.children(e),o=t.node(e),s=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,l={};s&&(a=Q.filter(a,function(p){return p!==s&&p!==u}));var f=Kse(t,a);Q.forEach(f,function(p){if(t.children(p.v).length){var g=r(t,p.v,n,i);l[p.v]=g,Q.has(g,"barycenter")&&(y=p,m=g,Q.isUndefined(y.barycenter)?(y.barycenter=m.barycenter,y.weight=m.weight):(y.barycenter=(y.barycenter*y.weight+m.barycenter*m.weight)/(y.weight+m.weight),y.weight+=m.weight))}var y,m});var c=qse(f,n);(function(p,g){Q.forEach(p,function(y){y.vs=Q.flatten(y.vs.map(function(m){return g[m]?g[m].vs:m}),!0)})})(c,l);var d=Zse(c,i);if(s&&(d.vs=Q.flatten([s,d.vs,u],!0),t.predecessors(s).length)){var h=t.node(t.predecessors(s)[0]),v=t.node(t.predecessors(u)[0]);Q.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+v.order)/(d.weight+2),d.weight+=2}return d},Jse=_a.Graph,eue=function(r,t,e){var n=function(a){for(var o;a.hasNode(o=Q.uniqueId("_root")););return o}(r),i=new Jse({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return r.node(a)});return Q.forEach(r.nodes(),function(a){var o=r.node(a),s=r.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||n),Q.forEach(r[e](a),function(u){var l=u.v===a?u.w:u.v,f=i.edge(l,a),c=Q.isUndefined(f)?0:f.weight;i.setEdge(l,a,{weight:r.edge(u).weight+c})}),Q.has(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i},tue=function(r,t,e){var n,i={};Q.forEach(e,function(a){for(var o,s,u=r.parent(a);u;){if((o=r.parent(u))?(s=i[o],i[o]=u):(s=n,n=u),s&&s!==u)return void t.setEdge(s,u);u=o}})},rue=_a.Graph,nue=function(r){var t=Xn.maxRank(r),e=NM(r,Q.range(1,t+1),"inEdges"),n=NM(r,Q.range(t-1,-1,-1),"outEdges"),i=Yse(r);PM(r,i);for(var a,o=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){iue(s%2?e:n,s%4>=2),i=Xn.buildLayerMatrix(r);var l=Vse(r,i);l<o&&(u=0,a=Q.cloneDeep(i),o=l)}PM(r,a)};function NM(r,t,e){return Q.map(t,function(n){return eue(r,n,e)})}function iue(r,t){var e=new rue;Q.forEach(r,function(n){var i=n.graph().root,a=Qse(n,i,e,t);Q.forEach(a.vs,function(o,s){n.node(o).order=s}),tue(n,e,a.vs)})}function PM(r,t){Q.forEach(t,function(e){Q.forEach(e,function(n,i){r.node(n).order=i})})}var aue=_a.Graph,oue=function(r){var t,e=Xn.buildLayerMatrix(r),n=Q.merge(sue(r,e),uue(r,e)),i={};Q.forEach(["u","d"],function(o){t=o==="u"?e:Q.values(e).reverse(),Q.forEach(["l","r"],function(s){s==="r"&&(t=Q.map(t,function(c){return Q.values(c).reverse()}));var u=(o==="u"?r.predecessors:r.successors).bind(r),l=fue(r,t,n,u),f=cue(r,t,l.root,l.align,s==="r");s==="r"&&(f=Q.mapValues(f,function(c){return-c})),i[o+s]=f})});var a=due(r,i);return hue(i,a),vue(i,r.graph().align)};function sue(r,t){var e={};return Q.reduce(t,function(n,i){var a=0,o=0,s=n.length,u=Q.last(i);return Q.forEach(i,function(l,f){var c=function(h,v){if(h.node(v).dummy)return Q.find(h.predecessors(v),function(p){return h.node(p).dummy})}(r,l),d=c?r.node(c).order:s;(c||l===u)&&(Q.forEach(i.slice(o,f+1),function(h){Q.forEach(r.predecessors(h),function(v){var p=r.node(v),g=p.order;!(g<a||d<g)||p.dummy&&r.node(h).dummy||KN(e,v,h)})}),o=f+1,a=d)}),i}),e}function uue(r,t){var e={};function n(i,a,o,s,u){var l;Q.forEach(Q.range(a,o),function(f){l=i[f],r.node(l).dummy&&Q.forEach(r.predecessors(l),function(c){var d=r.node(c);d.dummy&&(d.order<s||d.order>u)&&KN(e,c,l)})})}return Q.reduce(t,function(i,a){var o,s=-1,u=0;return Q.forEach(a,function(l,f){if(r.node(l).dummy==="border"){var c=r.predecessors(l);c.length&&(o=r.node(c[0]).order,n(a,u,f,s,o),u=f,s=o)}n(a,u,a.length,o,i.length)}),a}),e}function KN(r,t,e){if(t>e){var n=t;t=e,e=n}var i=r[t];i||(r[t]=i={}),i[e]=!0}function lue(r,t,e){if(t>e){var n=t;t=e,e=n}return Q.has(r[t],e)}function fue(r,t,e,n){var i={},a={},o={};return Q.forEach(t,function(s){Q.forEach(s,function(u,l){i[u]=u,a[u]=u,o[u]=l})}),Q.forEach(t,function(s){var u=-1;Q.forEach(s,function(l){var f=n(l);if(f.length)for(var c=((f=Q.sortBy(f,function(p){return o[p]})).length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var v=f[d];a[l]===l&&u<o[v]&&!lue(e,l,v)&&(a[v]=l,a[l]=i[l]=i[v],u=o[v])}})}),{root:i,align:a}}function cue(r,t,e,n,i){var a={},o=function(l,f,c,d){var h=new aue,v=l.graph(),p=function(g,y,m){return function(b,x,w){var E,_=b.node(x),M=b.node(w),C=0;if(C+=_.width/2,Q.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":E=-_.width/2;break;case"r":E=_.width/2}if(E&&(C+=m?E:-E),E=0,C+=(_.dummy?y:g)/2,C+=(M.dummy?y:g)/2,C+=M.width/2,Q.has(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":E=M.width/2;break;case"r":E=-M.width/2}return E&&(C+=m?E:-E),E=0,C}}(v.nodesep,v.edgesep,d);return Q.forEach(f,function(g){var y;Q.forEach(g,function(m){var b=c[m];if(h.setNode(b),y){var x=c[y],w=h.edge(x,b);h.setEdge(x,b,Math.max(p(l,m,y),w||0))}y=m})}),h}(r,t,e,i),s=i?"borderLeft":"borderRight";function u(l,f){for(var c=o.nodes(),d=c.pop(),h={};d;)h[d]?l(d):(h[d]=!0,c.push(d),c=c.concat(f(d))),d=c.pop()}return u(function(l){a[l]=o.inEdges(l).reduce(function(f,c){return Math.max(f,a[c.v]+o.edge(c))},0)},o.predecessors.bind(o)),u(function(l){var f=o.outEdges(l).reduce(function(d,h){return Math.min(d,a[h.w]-o.edge(h))},Number.POSITIVE_INFINITY),c=r.node(l);f!==Number.POSITIVE_INFINITY&&c.borderType!==s&&(a[l]=Math.max(a[l],f))},o.successors.bind(o)),Q.forEach(n,function(l){a[l]=a[e[l]]}),a}function due(r,t){return Q.minBy(Q.values(t),function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return Q.forIn(e,function(a,o){var s=function(u,l){return u.node(l).width}(r,o)/2;n=Math.max(a+s,n),i=Math.min(a-s,i)}),n-i})}function hue(r,t){var e=Q.values(t),n=Q.min(e),i=Q.max(e);Q.forEach(["u","d"],function(a){Q.forEach(["l","r"],function(o){var s,u=a+o,l=r[u];if(l!==t){var f=Q.values(l);(s=o==="l"?n-Q.min(f):i-Q.max(f))&&(r[u]=Q.mapValues(l,function(c){return c+s}))}})})}function vue(r,t){return Q.mapValues(r.ul,function(e,n){if(t)return r[t.toLowerCase()][n];var i=Q.sortBy(Q.map(r,n));return(i[1]+i[2])/2})}var pue=oue,gue=function(r){(function(t){var e=Xn.buildLayerMatrix(t),n=t.graph().ranksep,i=0;Q.forEach(e,function(a){var o=Q.max(Q.map(a,function(s){return t.node(s).height}));Q.forEach(a,function(s){t.node(s).y=i+o/2}),i+=o+n})})(r=Xn.asNonCompoundGraph(r)),Q.forEach(pue(r),function(t,e){r.node(e).x=t})},yue=Xn.normalizeRanks,mue=Xn.removeEmptyRanks,Qo=Xn,bue=_a.Graph,xue=function(r,t){var e=t&&t.debugTiming?Qo.time:Qo.notime;e("layout",function(){var n=e(" buildLayoutGraph",function(){return function(i){var a=new bue({multigraph:!0,compound:!0}),o=cy(i.graph());return a.setGraph(Q.merge({},Eue,fy(o,wue),Q.pick(o,_ue))),Q.forEach(i.nodes(),function(s){var u=cy(i.node(s));a.setNode(s,Q.defaults(fy(u,Sue),Mue)),a.setParent(s,i.parent(s))}),Q.forEach(i.edges(),function(s){var u=cy(i.edge(s));a.setEdge(s,Q.merge({},Aue,fy(u,Cue),Q.pick(u,Tue)))}),a}(r)});e(" runLayout",function(){(function(i,a){a(" makeSpaceForEdgeLabels",function(){(function(o){var s=o.graph();s.ranksep/=2,Q.forEach(o.edges(),function(u){var l=o.edge(u);l.minlen*=2,l.labelpos.toLowerCase()!=="c"&&(s.rankdir==="TB"||s.rankdir==="BT"?l.width+=l.labeloffset:l.height+=l.labeloffset)})})(i)}),a(" removeSelfEdges",function(){(function(o){Q.forEach(o.edges(),function(s){if(s.v===s.w){var u=o.node(s.v);u.selfEdges||(u.selfEdges=[]),u.selfEdges.push({e:s,label:o.edge(s)}),o.removeEdge(s)}})})(i)}),a(" acyclic",function(){wM.run(i)}),a(" nestingGraph.run",function(){TM.run(i)}),a(" rank",function(){Use(Qo.asNonCompoundGraph(i))}),a(" injectEdgeLabelProxies",function(){(function(o){Q.forEach(o.edges(),function(s){var u=o.edge(s);if(u.width&&u.height){var l=o.node(s.v),f={rank:(o.node(s.w).rank-l.rank)/2+l.rank,e:s};Qo.addDummyNode(o,"edge-proxy",f,"_ep")}})})(i)}),a(" removeEmptyRanks",function(){mue(i)}),a(" nestingGraph.cleanup",function(){TM.cleanup(i)}),a(" normalizeRanks",function(){yue(i)}),a(" assignRankMinMax",function(){(function(o){var s=0;Q.forEach(o.nodes(),function(u){var l=o.node(u);l.borderTop&&(l.minRank=o.node(l.borderTop).rank,l.maxRank=o.node(l.borderBottom).rank,s=Q.max(s,l.maxRank))}),o.graph().maxRank=s})(i)}),a(" removeEdgeLabelProxies",function(){(function(o){Q.forEach(o.nodes(),function(s){var u=o.node(s);u.dummy==="edge-proxy"&&(o.edge(u.e).labelRank=u.rank,o.removeNode(s))})})(i)}),a(" normalize.run",function(){MM.run(i)}),a(" parentDummyChains",function(){Wse(i)}),a(" addBorderSegments",function(){Xse(i)}),a(" order",function(){nue(i)}),a(" insertSelfEdges",function(){(function(o){var s=Qo.buildLayerMatrix(o);Q.forEach(s,function(u){var l=0;Q.forEach(u,function(f,c){var d=o.node(f);d.order=c+l,Q.forEach(d.selfEdges,function(h){Qo.addDummyNode(o,"selfedge",{width:h.label.width,height:h.label.height,rank:d.rank,order:c+ ++l,e:h.e,label:h.label},"_se")}),delete d.selfEdges})})})(i)}),a(" adjustCoordinateSystem",function(){OM.adjust(i)}),a(" position",function(){gue(i)}),a(" positionSelfEdges",function(){(function(o){Q.forEach(o.nodes(),function(s){var u=o.node(s);if(u.dummy==="selfedge"){var l=o.node(u.e.v),f=l.x+l.width/2,c=l.y,d=u.x-f,h=l.height/2;o.setEdge(u.e,u.label),o.removeNode(s),u.label.points=[{x:f+2*d/3,y:c-h},{x:f+5*d/6,y:c-h},{x:f+d,y:c},{x:f+5*d/6,y:c+h},{x:f+2*d/3,y:c+h}],u.label.x=u.x,u.label.y=u.y}})})(i)}),a(" removeBorderNodes",function(){(function(o){Q.forEach(o.nodes(),function(s){if(o.children(s).length){var u=o.node(s),l=o.node(u.borderTop),f=o.node(u.borderBottom),c=o.node(Q.last(u.borderLeft)),d=o.node(Q.last(u.borderRight));u.width=Math.abs(d.x-c.x),u.height=Math.abs(f.y-l.y),u.x=c.x+u.width/2,u.y=l.y+u.height/2}}),Q.forEach(o.nodes(),function(s){o.node(s).dummy==="border"&&o.removeNode(s)})})(i)}),a(" normalize.undo",function(){MM.undo(i)}),a(" fixupEdgeLabelCoords",function(){(function(o){Q.forEach(o.edges(),function(s){var u=o.edge(s);if(Q.has(u,"x"))switch(u.labelpos!=="l"&&u.labelpos!=="r"||(u.width-=u.labeloffset),u.labelpos){case"l":u.x-=u.width/2+u.labeloffset;break;case"r":u.x+=u.width/2+u.labeloffset}})})(i)}),a(" undoCoordinateSystem",function(){OM.undo(i)}),a(" translateGraph",function(){(function(o){var s=Number.POSITIVE_INFINITY,u=0,l=Number.POSITIVE_INFINITY,f=0,c=o.graph(),d=c.marginx||0,h=c.marginy||0;function v(p){var g=p.x,y=p.y,m=p.width,b=p.height;s=Math.min(s,g-m/2),u=Math.max(u,g+m/2),l=Math.min(l,y-b/2),f=Math.max(f,y+b/2)}Q.forEach(o.nodes(),function(p){v(o.node(p))}),Q.forEach(o.edges(),function(p){var g=o.edge(p);Q.has(g,"x")&&v(g)}),s-=d,l-=h,Q.forEach(o.nodes(),function(p){var g=o.node(p);g.x-=s,g.y-=l}),Q.forEach(o.edges(),function(p){var g=o.edge(p);Q.forEach(g.points,function(y){y.x-=s,y.y-=l}),Q.has(g,"x")&&(g.x-=s),Q.has(g,"y")&&(g.y-=l)}),c.width=u-s+d,c.height=f-l+h})(i)}),a(" assignNodeIntersects",function(){(function(o){Q.forEach(o.edges(),function(s){var u,l,f=o.edge(s),c=o.node(s.v),d=o.node(s.w);f.points?(u=f.points[0],l=f.points[f.points.length-1]):(f.points=[],u=d,l=c),f.points.unshift(Qo.intersectRect(c,u)),f.points.push(Qo.intersectRect(d,l))})})(i)}),a(" reversePoints",function(){(function(o){Q.forEach(o.edges(),function(s){var u=o.edge(s);u.reversed&&u.points.reverse()})})(i)}),a(" acyclic.undo",function(){wM.undo(i)})})(n,e)}),e(" updateInputGraph",function(){(function(i,a){Q.forEach(i.nodes(),function(o){var s=i.node(o),u=a.node(o);s&&(s.x=u.x,s.y=u.y,a.children(o).length&&(s.width=u.width,s.height=u.height))}),Q.forEach(i.edges(),function(o){var s=i.edge(o),u=a.edge(o);s.points=u.points,Q.has(u,"x")&&(s.x=u.x,s.y=u.y)}),i.graph().width=a.graph().width,i.graph().height=a.graph().height})(r,n)})})},wue=["nodesep","edgesep","ranksep","marginx","marginy"],Eue={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_ue=["acyclicer","ranker","rankdir","align"],Sue=["width","height"],Mue={width:0,height:0},Cue=["minlen","weight","width","height","labeloffset"],Aue={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Tue=["labelpos"];function fy(r,t){return Q.mapValues(Q.pick(r,t),Number)}function cy(r){var t={};return Q.forEach(r,function(e,n){t[n.toLowerCase()]=e}),t}var Iue=_a.Graph,qN={graphlib:_a,layout:xue,debug:{debugOrdering:function(r){var t=Xn.buildLayerMatrix(r),e=new Iue({compound:!0,multigraph:!0}).setGraph({});return Q.forEach(r.nodes(),function(n){e.setNode(n,{label:n}),e.setParent(n,"layer"+r.node(n).rank)}),Q.forEach(r.edges(),function(n){e.setEdge(n.v,n.w,{},n.name)}),Q.forEach(t,function(n,i){var a="layer"+i;e.setNode(a,{rank:"same"}),Q.reduce(n,function(o,s){return e.setEdge(o,s,{style:"invis"}),s})}),e}},util:{time:Xn.time,notime:Xn.notime},version:"0.8.5"},Oue=qN.graphlib,Lue=qN.layout;class kue{constructor(t){this.cardinality=1,this.include=yu.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=wi.NODE,this.name=t.name,this.attr=t.attr||{},this.inputs=t.inputs,this.path=t.path||[],this.width=t.width,this.height=t.height}}class Due{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}function Nue(r){const t=new Due;return r.nodes.map(e=>new kue(e)).forEach(e=>{t.nodes[e.name]=e,e.inputs.forEach(n=>{(function(i,a,o){o.name!==a.name&&i.edges.push(Object.assign(Object.assign({},o.attr),{v:o.name,w:a.name}))})(t,e,n)})}),t}class Pue{constructor(t,e={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=yu.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=wi.META,this.path=[],this.name=t,this.metaGraph=vx(t,Gl.META,e)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map(t=>this.metaGraph.node(t))}leaves(){let t,e=[],n=[this];for(;n.length;){let i=n.shift();i.isGroupNode?(t=i.metaGraph,t.nodes().forEach(a=>n.push(t.node(a)))):e.push(i.name)}return e}}class Rue{constructor(t,e){this.v=t,this.w=e,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(t,e){this.baseEdgeList.push(t)}}function ZN(r,t={}){return new Pue(r,t)}function QN(r,t){return new Rue(r,t)}function vx(r,t,e){const n=e||{},i=new Oue.Graph(n);return i.setGraph({name:r,rankdir:n.rankdir,type:t,align:n.align}),i}class Bue{constructor(t={}){this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=ZN(zl,this.graphOptions),this.index[zl]=this.root}getNodeMap(){return this.index}node(t){return this.index[t]}setNode(t,e){this.index[t]=e}getBridgeGraph(t){const e=this.index[t];if(!e)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in e))return null;const n=e;if(n.bridgeGraph)return n.bridgeGraph;const i=vx($D,Gl.BRIDGE,this.graphOptions);if(n.bridgeGraph=i,!e.parentNode||!("metaGraph"in e.parentNode))return i;const a=e.parentNode;return[a.metaGraph,this.getBridgeGraph(a.name)].forEach(o=>{o.edges().filter(s=>s.v===t||s.w===t).forEach(s=>{const u=s.w===t;o.edge(s).baseEdgeList.forEach(l=>{const[f,c]=u?[l.w,s.v]:[l.v,s.w],d=this.getChildName(t,f),h={v:u?c:d,w:u?d:c};let v=i.edge(h);v||(v=QN(h.v,h.w),v.inbound=u,i.setEdge(h.v,h.w,v)),v.addBaseEdge(l,this)})})}),i}getChildName(t,e){let n=this.index[e];for(;n;){if(n.parentNode&&n.parentNode.name===t)return n.name;n=n.parentNode}throw Error("Could not find immediate child for descendant: "+e)}getPredecessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}getSuccessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}getOneWayEdges(t,e){const n=[];if(!t.parentNode||!t.parentNode.isGroupNode)return n;const i=t.parentNode,a=i.metaGraph,o=this.getBridgeGraph(i.name);return RM(a,t,e,n),RM(o,t,e,n),n}}function Fue(r,t){const{rankDirection:e,align:n}=t,i=new Bue({rankdir:e,align:n});return function(a,o){Object.keys(o.nodes).forEach(s=>{const u=o.nodes[s],l=u.path;let f=a.root;f.depth=Math.max(l.length,f.depth);for(let c=0;c<l.length&&(f.depth=Math.max(f.depth,l.length-c),f.cardinality+=u.cardinality,c!==l.length-1);c++){const d=l[c];let h=a.node(d);h||(h=ZN(d,a.graphOptions),h.path=u.path.slice(0,c+1),h.parentNode=f,a.setNode(d,h),f.metaGraph.setNode(d,h)),f=h}a.setNode(u.name,u),u.parentNode=f,f.metaGraph.setNode(u.name,u)})}(i,r),function(a,o){const s=a.getNodeMap();let u=[],l=[];const f=(c,d)=>{let h=0;for(;c;)d[h++]=c.name,c=c.parentNode;return h-1};o.edges.forEach(c=>{u=[],l=[];let d=f(o.nodes[c.v],u),h=f(o.nodes[c.w],l);for(;u[d]===l[h];)if(d--,h--,d<0||h<0)throw Error("No difference found between ancestor paths.");const v=s[u[d+1]],p=u[d],g=l[h];let y=v.metaGraph.edge(p,g);y||(y=QN(p,g),v.metaGraph.setEdge(p,g,y)),y.addBaseEdge(c,a)})}(i,r),i}function RM(r,t,e,n){(e?r.inEdges(t.name):r.outEdges(t.name)).forEach(i=>{const a=r.edge(i);n.push(a)})}class zue{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new FM(this.hierarchy.root,this.hierarchy.graphOptions),this.index[t.root.name]=this.root,this.buildSubHierarchy(t.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(t){if(t in this.hasSubHierarchy)return;this.hasSubHierarchy[t]=!0;const e=this.index[t];if(e.node.type!==wi.META)return;const n=e,i=n.node.metaGraph,a=n.coreGraph;i.nodes().forEach(f=>{const c=this.getOrCreateRenderNodeByName(f);a.setNode(f,c)}),i.edges().forEach(f=>{const c=i.edge(f),d=new BM(c);a.setEdge(f.v,f.w,d)});const o=n.node.parentNode;if(!o)return;const s=this.getRenderNodeByName(o.name),u=(f,...c)=>c.concat([f?"IN":"OUT"]).join("~~"),l=this.hierarchy.getBridgeGraph(t);l.edges().forEach(f=>{const c=l.edge(f),d=!!i.node(f.w),[h,v]=d?[f.w,f.v]:[f.v,f.w],p=w=>{const E=d?{v:w,w:t}:{v:t,w};return s.coreGraph.edge(E)};let g=p(v);g||(g=p(u(d,v,o.name)));const y=u(d,t),m=u(d,v,t);let b=a.node(m);if(!b){let w=a.node(y);if(!w){const _={name:y,type:wi.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:yu.UNSPECIFIED,inbound:d,attr:{}};w=new uv(_),this.index[y]=w,a.setNode(y,w)}const E={name:m,type:wi.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:yu.UNSPECIFIED,inbound:d,attr:{}};b=new uv(E),this.index[m]=b,a.setNode(m,b),a.setParent(m,y),w.node.cardinality++}const x=new BM(c);x.adjoiningMetaEdge=g,d?a.setEdge(m,h,x):a.setEdge(h,m,x)})}getOrCreateRenderNodeByName(t){if(!t)return null;if(t in this.index)return this.index[t];const e=this.getNodeByName(t);return e?(this.index[t]=e.isGroupNode?new FM(e,this.hierarchy.graphOptions):new uv(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class uv{constructor(t){this.node=t,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=t.width||0,this.height=t.height||0,this.displayName=t.name,this.attr=t.attr}}class BM{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class FM extends uv{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=vx(n.name,Gl.CORE,e)}}function JN(r,t){r.node.isGroupNode&&function(e,n){const i=Bm(n);e.coreGraph.nodes().map(a=>e.coreGraph.node(a)).forEach(a=>{var o,s,u,l,f,c;const{height:d,width:h}=a;switch(a.node.type){case wi.NODE:Object.assign(a,i.nodeSize.node),a.height=d||i.nodeSize.node.height,a.width=h||i.nodeSize.node.width;break;case wi.BRIDGE:Object.assign(a,i.nodeSize.bridge);break;case wi.META:a.expanded?JN(a,n):(Object.assign(a,i.nodeSize.meta),a.height=i.nodeSize.meta.height,a.width=i.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+a.node.type)}if(!a.expanded){const v=a.attr;(function(p,g=!1){if(p.coreBox.width=p.width,p.coreBox.height=p.height,!g){const y=`${p.displayName}`.length,m=3;p.width=Math.max(p.coreBox.width,y*m)}})(a,n&&(a.node.type===0&&!!(!((s=(o=n==null?void 0:n.nodeSize)===null||o===void 0?void 0:o.meta)===null||s===void 0)&&s.width)||a.node.type===1&&(!!(!((l=(u=n==null?void 0:n.nodeSize)===null||u===void 0?void 0:u.node)===null||l===void 0)&&l.width)||!!v.width)||a.node.type===2&&!!(!((c=(f=n==null?void 0:n.nodeSize)===null||f===void 0?void 0:f.bridge)===null||c===void 0)&&c.width)))}})}(r,t),r.node.type===wi.META&&function(e,n){const i=Bm(n),a=i.subScene.meta;Object.assign(e,a);const{nodeSep:o,rankSep:s,edgeSep:u,align:l}=i.graph.meta,f={nodesep:o,ranksep:s,edgesep:u,align:l};Object.assign(e.coreBox,function(h,v){const{ranksep:p,nodesep:g,edgesep:y,align:m}=v;Object.assign(h.graph(),{ranksep:p,nodesep:g,edgesep:y,align:m});const b=[];if(h.nodes().forEach(M=>{h.node(M).node.type!==wi.BRIDGE&&b.push(M)}),!b.length)return{width:0,height:0};Lue(h);let x=1/0,w=1/0,E=-1/0,_=-1/0;return b.forEach(M=>{const C=h.node(M),S=.5*C.width,A=C.x-S,T=C.x+S;x=A<x?A:x,E=T>E?T:E;const I=.5*C.height,k=C.y-I,P=C.y+I;w=k<w?k:w,_=P>_?P:_}),h.edges().forEach(M=>{const C=h.edge(M),S=h.node(C.metaEdge.v),A=h.node(C.metaEdge.w);if(C.points.length===3&&function(k){let P=zM(k[0],k[1]);for(let N=1;N<k.length-1;N++){const z=zM(k[N],k[N+1]);if(Math.abs(z-P)>1)return!1;P=z}return!0}(C.points)){if(S!=null){const k=S.expanded?S.x:Hm(S);C.points[0].x=k}if(A!=null){const k=A.expanded?A.x:Hm(A);C.points[2].x=k}C.points=[C.points[0],C.points[1]]}const T=C.points[C.points.length-2];A!=null&&(C.points[C.points.length-1]=GM(T,A));const I=C.points[1];S!=null&&(C.points[0]=GM(I,S)),C.points.forEach(k=>{x=k.x<x?k.x:x,E=k.x>E?k.x:E,w=k.y<w?k.y:w,_=k.y>_?k.y:_})}),h.nodes().forEach(M=>{const C=h.node(M);C.x-=x,C.y-=w}),h.edges().forEach(M=>{h.edge(M).points.forEach(C=>{C.x-=x,C.y-=w})}),{width:E-x,height:_-w}}(e.coreGraph,f));let c=0;e.coreGraph.nodeCount()>0&&c++;const d=c<=1?0:c;e.coreBox.width+=d+d,e.coreBox.height=a.labelHeight+e.coreBox.height,e.width=e.coreBox.width+a.paddingLeft+a.paddingRight,e.height=e.paddingTop+e.coreBox.height+e.paddingBottom}(r,t)}function zM(r,t){const e=t.x-r.x,n=t.y-r.y;return 180*Math.atan(n/e)/Math.PI}function Hm(r){return r.expanded?r.x:r.x-r.width/2+0+r.coreBox.width/2}function GM(r,t){const e=t.expanded?t.x:Hm(t),n=t.y,i=r.x-e,a=r.y-n;let o,s,u=t.expanded?t.width:t.coreBox.width,l=t.expanded?t.height:t.coreBox.height;return Math.abs(a)*u/2>Math.abs(i)*l/2?(a<0&&(l=-l),o=a===0?0:l/2*i/a,s=l/2):(i<0&&(u=-u),o=u/2,s=i===0?0:u/2*a/i),{x:e+o,y:n+s}}function Gue(r,t,e){var n,i,a,o;const s=r.nodes.filter((c,d,h)=>h.findIndex(v=>v.id===c.id)!==d).map(c=>c.id);if(s.length)throw new Error(`Duplicated ids found: ${s.join(", ")}`);const u=function(c){const d={nodes:[]},h=c.compound,v=Object.keys(h||{}),p=new Map,g=(m,b=[])=>{if(p.has(m))return p.get(m);for(let x=0;x<v.length;x++){let w=v[x];if(h&&h[w].indexOf(m)!==-1)return b.unshift(w),g(w,b)}return b.length===0&&p.set(m,b),b},y=m=>c.edges.filter(b=>b.w===m).map(b=>({name:b.v}));return c.nodes.forEach(m=>{const b=m.id,x=[...g(b),b];let w=y(b);d.nodes.push({name:b,path:x,inputs:w,width:m.width,height:m.height,attr:Object.assign({},m)})}),d}(r),l=function(c,d){const h=(p,g)=>{for(let y of g.values())if(y.includes(p))return!0;return!1},v=(p,g=[])=>{if(Object.keys(p).length===0)return[...new Set(g)];const y=new Map(Object.keys(p).map(b=>[b,p[b]])),m={};for(let[b,x]of y)h(b,y)?m[b]=x:g=g.concat(b,x);return v(m,g)};return v(c).filter(p=>d.includes(p))}(r.compound||{},(t==null?void 0:t.expanded)||[]),f=function(c,d){return function(h){return new zue(h)}(Fue(Nue(c),d))}(u,{rankDirection:((i=(n=e==null?void 0:e.graph)===null||n===void 0?void 0:n.meta)===null||i===void 0?void 0:i.rankDir)||(t==null?void 0:t.rankDirection)||Xv.graph.meta.rankDir,align:((o=(a=e==null?void 0:e.graph)===null||a===void 0?void 0:a.meta)===null||o===void 0?void 0:o.align)||Xv.graph.meta.align});return function(c,d){d.forEach(h=>{const v=c.getRenderInfoNodes().find(y=>y.displayName===h);let p=v&&v.node&&v.node.name||"";const g=c.getRenderNodeByName(p);if(!g)throw new Error(`No nodes found: ${p}`);g.expanded=!0,c.buildSubHierarchy(p)})}(f,l),JN(f.root,e),eP(f.root)}function $ue(r,t=!1){const e=JSON.parse(JSON.stringify(r)),n={nodes:[e],edges:[...e.edges]};return e.nodes.forEach(function i(a){(a.type===0||a.type===1)&&n.nodes.push(a),a.type===0&&(n.edges=n.edges.concat(a.edges)),Array.isArray(a.nodes)&&a.nodes.forEach(i)}),t&&n.nodes.forEach(i=>{const a=n.nodes.find(o=>o.id===i.parentNodeName);if(a){const o=a.x-a.width/2+a.paddingLeft,s=a.y-a.height/2+a.labelHeight+a.paddingTop;a.id!==zl&&(i.x+=o,i.y+=s),i.type===0&&i.edges.forEach(u=>{u.points.forEach(l=>{l.x+=i.x-i.width/2+i.paddingLeft,l.y+=i.y-i.height/2+i.labelHeight+i.paddingTop})})}}),n}function Uue(r,t,e,n){var i,a;let o=[];const s=((i=e.find(c=>c.id===r))===null||i===void 0?void 0:i.path)||[],u=((a=e.find(c=>c.id===t))===null||a===void 0?void 0:a.path)||[],l=[zl,...s].slice(0,s.length).reverse(),f=[zl,...u].slice(0,u.length);return l.forEach(c=>{const d=e.find(h=>h.id===c);o=o.concat(d.edges.filter(h=>h.baseEdgeList.some(v=>v.v===((n==null?void 0:n.v)||r)&&v.w===((n==null?void 0:n.w)||t))))}),f.filter(c=>!l.includes(c)).forEach(c=>{const d=e.find(h=>h.id===c);o=o.concat(d.edges.filter(h=>h.baseEdgeList.some(v=>v.v===((n==null?void 0:n.v)||r)&&v.w===((n==null?void 0:n.w)||t))))}),o}function eP(r){const t=r.coreGraph.nodes().map(n=>r.coreGraph.node(n));return Object.assign(Object.assign({},$M(r)),{expanded:r.expanded,nodes:r.expanded?(e=t,e.map(n=>n.node.type===wi.META?eP(n):$M(n))):[],edges:r.expanded?jue(r):[]});var e}function $M(r){return{id:r.node.name,name:r.node.name,type:r.node.type,cardinality:r.node.cardinality,attr:r.attr,parentNodeName:r.node.parentNode?r.node.parentNode.name:null,coreBox:Object.assign({},r.coreBox),x:r.x,y:r.y,width:r.width,height:r.height,radius:r.radius,labelHeight:r.labelHeight,labelOffset:r.labelOffset,outboxWidth:r.outboxWidth,paddingLeft:r.paddingLeft,paddingTop:r.paddingTop,paddingRight:r.paddingRight,paddingBottom:r.paddingBottom,path:r.node.path}}function jue(r){return r.coreGraph.edges().map(t=>({renderInfoEdge:r.coreGraph.edge(t),edge:t})).filter(({renderInfoEdge:t})=>t.metaEdge).map(({edge:t,renderInfoEdge:e})=>{const n=function(i,a){const o=a.points.map(s=>Object.assign({},s));if(a.adjoiningMetaEdge){const s=a.adjoiningMetaEdge.points,u=a.metaEdge.inbound,l=u?s[s.length-1]:s[0],f=o[u?0:o.length-1],c=i.x-i.width/2,d=i.y-i.height/2,h=l.x-c,v=l.y-d,p=-i.paddingLeft,g=-(i.paddingTop+i.labelHeight);f.x=h+p,f.y=v+g}return o}(r,e);return{adjoiningEdge:e.adjoiningMetaEdge?{w:e.adjoiningMetaEdge.metaEdge.w,v:e.adjoiningMetaEdge.metaEdge.v}:null,inbound:e.metaEdge.inbound,w:t.w,v:t.v,points:n,weight:e.weight,baseEdgeList:e.metaEdge.baseEdgeList,parentNodeName:r.node.name}})}const Wue=Object.freeze(Object.defineProperty({__proto__:null,BRIDGE_GRAPH_NAME:$D,get GraphType(){return Gl},get HierarchyNodeType(){return Fm},get InclusionType(){return yu},LAYOUT_CONFIG:Xv,get NodeType(){return wi},ROOT_NAME:zl,buildGraph:Gue,flatGraph:$ue,getEdges:Uue,mergeConfig:Bm},Symbol.toStringTag,{value:"Module"})),Xue=to(Wue);var Yue=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),fa=_e&&_e.__assign||function(){return fa=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},fa.apply(this,arguments)},tl=_e&&_e.__spreadArray||function(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return r.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(ed,"__esModule",{value:!0});ed.DagreCompoundLayout=void 0;var Vue=hn,Wi=Xue,_h=an(),Hue=function(r){Yue(t,r);function t(e){var n=r.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.edgesep=5,n.ranksep=50,n.controlPoints=!0,n.anchorPoint=!0,n.nodes=[],n.edges=[],n.combos=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,begin:void 0,nodeSize:void 0,nodesep:50,ranksep:50,controlPoints:!0,anchorPoint:!0}},t.prototype.init=function(e){var n=e.hiddenNodes||[],i=e.hiddenEdges||[],a=e.hiddenCombos||[];this.nodes=this.getDataByOrder((e.nodes||[]).concat(n)),this.edges=this.getDataByOrder((e.edges||[]).concat(i)),this.combos=(e.combos||[]).concat(a.map(function(o){return fa(fa({},o),{collapsed:!0})}))},t.prototype.execute=function(){var e=this,n=e.nodes,i=e.edges;if(n){var a=e.getLayoutConfig(),o=a.graphDef,s=a.graphOption,u=a.graphSettings,l=(0,Wi.buildGraph)(o,s,u),f=(0,Wi.flatGraph)(l,!0);return this.updatePosition(f),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:i}}},t.prototype.getNodePath=function(e){var n=this,i=n.nodes,a=n.combos,o=i.find(function(u){return u.id===e}),s=function(u,l){l===void 0&&(l=[]);var f=a.find(function(c){return c.id===u});return f?(l.unshift(u),f.parentId?s(f.parentId,l):l):l};return o&&o.comboId?s(o.comboId,[e]):[e]},t.prototype.getLayoutConfig=function(){var e,n,i,a=this,o=a.nodes,s=a.edges,u=a.combos,l=a.nodeSize,f=a.rankdir,c=a.align,d=a.edgesep,h=a.nodesep,v=a.ranksep,p=a.settings,g=(u||[]).reduce(function(N,z){var W=o.filter(function(R){return R.comboId===z.id}).map(function(R){return R.id}),D=(u||[]).filter(function(R){return R.parentId===z.id}).map(function(R){return R.id});return(W.length||D.length)&&(N[z.id]=tl(tl([],W,!0),D,!0)),N},{}),y;l?(0,_h.isArray)(l)?y=function(){return l}:y=function(){return[l,l]}:y=function(N){return N&&N.size?(0,_h.isArray)(N.size)?N.size:(0,_h.isObject)(N.size)?[N.size.width||40,N.size.height||40]:[N.size,N.size]:[40,40]};var m=function(N){return N&&N.size?(0,_h.isArray)(N.size)?N.size:[N.size,N.size]:[80,40]},b=m(u==null?void 0:u[0]),x=b[0],w=b[1],E=(n=(e=a.graphSettings)===null||e===void 0?void 0:e.subScene)===null||n===void 0?void 0:n.meta,_=((i=u.find(function(N){return!N.collapsed}))===null||i===void 0?void 0:i.padding)||[20,20,20,20],M=_[0],C=_[1],S=_[2],A=_[3],T={compound:g,nodes:tl([],(o||[]).map(function(N){var z=y(N),W=z[0],D=z[1];return fa(fa({},N),{width:W,height:D})}),!0),edges:tl([],(s||[]).map(function(N){return fa(fa({},N),{v:N.source,w:N.target})}),!0)},I={expanded:(u||[]).filter(function(N){return!N.collapsed}).map(function(N){return N.id})},k={graph:{meta:{align:c,rankDir:f,nodeSep:h,edgeSep:d,rankSep:v}},subScene:{meta:{paddingTop:M||(E==null?void 0:E.paddingTop)||20,paddingRight:C||(E==null?void 0:E.paddingRight)||20,paddingBottom:S||(E==null?void 0:E.paddingBottom)||20,paddingLeft:A||(E==null?void 0:E.paddingLeft)||20,labelHeight:0}},nodeSize:{meta:{width:x,height:w}}},P=(0,Wi.mergeConfig)(p,fa({},(0,Wi.mergeConfig)(k,Wi.LAYOUT_CONFIG)));return a.graphSettings=P,{graphDef:T,graphOption:I,graphSettings:P}},t.prototype.updatePosition=function(e){var n=e.nodes,i=e.edges;this.updateNodePosition(n,i),this.updateEdgePosition(n,i)},t.prototype.getBegin=function(e,n){var i=this,a=i.begin,o=[0,0];if(a){var s=1/0,u=1/0;e.forEach(function(l){s>l.x&&(s=l.x),u>l.y&&(u=l.y)}),n.forEach(function(l){l.points.forEach(function(f){s>f.x&&(s=f.x),u>f.y&&(u=f.y)})}),o[0]=a[0]-s,o[1]=a[1]-u}return o},t.prototype.updateNodePosition=function(e,n){var i=this,a=i.combos,o=i.nodes,s=i.edges,u=i.anchorPoint,l=i.graphSettings,f=this.getBegin(e,n);e.forEach(function(c){var d,h=c.x,v=c.y,p=c.id,g=c.type,y=c.coreBox;if(g===Wi.HierarchyNodeType.META&&p!==Wi.ROOT_NAME){var m=a.findIndex(function(_){return _.id===p}),b=(d=l==null?void 0:l.subScene)===null||d===void 0?void 0:d.meta;a[m].offsetX=h+f[0],a[m].offsetY=v+f[1],a[m].fixSize=[y.width,y.height],a[m].fixCollapseSize=[y.width,y.height],c.expanded?a[m].padding=[b==null?void 0:b.paddingTop,b==null?void 0:b.paddingRight,b==null?void 0:b.paddingBottom,b==null?void 0:b.paddingLeft]:a[m].padding=[0,0,0,0]}else if(g===Wi.HierarchyNodeType.OP){var m=o.findIndex(function(M){return M.id===p});if(o[m].x=h+f[0],o[m].y=v+f[1],u){var x=[],w=n.filter(function(M){return M.v===p}),E=n.filter(function(M){return M.w===p});w.length>0&&w.forEach(function(M){var C=M.points[0],S=(C.x-h)/c.width+.5,A=(C.y-v)/c.height+.5;x.push([S,A]),M.baseEdgeList.forEach(function(T){var I=s.find(function(k){return k.source===T.v&&k.target===T.w});I&&(I.sourceAnchor=x.length-1)})}),E.length>0&&E.forEach(function(M){var C=M.points[M.points.length-1],S=(C.x-h)/c.width+.5,A=(C.y-v)/c.height+.5;x.push([S,A]),M.baseEdgeList.forEach(function(T){var I=s.find(function(k){return k.source===T.v&&k.target===T.w});I&&(I.targetAnchor=x.length-1)})}),o[m].anchorPoints=x.length>0?x:o[m].anchorPoints||[]}}})},t.prototype.updateEdgePosition=function(e,n){var i=this,a=i.combos,o=i.edges,s=i.controlPoints,u=this.getBegin(e,n);s&&(a.forEach(function(l){l.inEdges=[],l.outEdges=[]}),o.forEach(function(l){var f,c,d,h,v=e.find(function(_){return _.id===l.source}),p=e.find(function(_){return _.id===l.target}),g=[],y=[];if(v&&p)y=(0,Wi.getEdges)(v==null?void 0:v.id,p==null?void 0:p.id,e);else if(!v||!p){var m=i.getNodePath(l.source),b=i.getNodePath(l.target),x=m.reverse().slice(v?0:1).find(function(_){return e.find(function(M){return M.id===_})}),w=b.reverse().slice(p?0:1).find(function(_){return e.find(function(M){return M.id===_})});v=e.find(function(_){return _.id===x}),p=e.find(function(_){return _.id===w}),y=(0,Wi.getEdges)(v==null?void 0:v.id,p==null?void 0:p.id,e,{v:l.source,w:l.target})}if(g=y.reduce(function(_,M){return tl(tl([],_,!0),M.points.map(function(C){return fa(fa({},C),{x:C.x+u[0],y:C.y+u[1]})}),!0)},[]),g=g.slice(1,-1),l.controlPoints=g,(p==null?void 0:p.type)===Wi.NodeType.META){var E=a.findIndex(function(_){return _.id===(p==null?void 0:p.id)});if(!a[E]||!((f=a[E].inEdges)===null||f===void 0)&&f.some(function(_){return _.source===v.id&&_.target===p.id}))return;(c=a[E].inEdges)===null||c===void 0||c.push({source:v.id,target:p.id,controlPoints:g})}if((v==null?void 0:v.type)===Wi.NodeType.META){var E=a.findIndex(function(M){return M.id===(v==null?void 0:v.id)});if(!a[E]||!((d=a[E].outEdges)===null||d===void 0)&&d.some(function(M){return M.source===v.id&&M.target===p.id}))return;(h=a[E].outEdges)===null||h===void 0||h.push({source:v.id,target:p.id,controlPoints:g})}}))},t.prototype.getType=function(){return"dagreCompound"},t.prototype.getDataByOrder=function(e){return e.every(function(n){return n.layoutOrder!==void 0})||e.forEach(function(n,i){n.layoutOrder=i}),e.sort(function(n,i){return n.layoutOrder-i.layoutOrder})},t}(Vue.Base);ed.DagreCompoundLayout=Hue;var px={},og={},gx={};const Kue=Object.prototype.toString;function Jv(r){const t=Kue.call(r);return t.endsWith("Array]")&&!t.includes("Big")}function que(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Jv(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var e=t.fromIndex,n=e===void 0?0:e,i=t.toIndex,a=i===void 0?r.length:i;if(n<0||n>=r.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>r.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=r[n],s=n+1;s<a;s++)r[s]>o&&(o=r[s]);return o}function Zue(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Jv(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var e=t.fromIndex,n=e===void 0?0:e,i=t.toIndex,a=i===void 0?r.length:i;if(n<0||n>=r.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>r.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=r[n],s=n+1;s<a;s++)r[s]<o&&(o=r[s]);return o}function UM(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Jv(r)){if(r.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var e;if(t.output!==void 0){if(!Jv(t.output))throw new TypeError("output option must be an array if specified");e=t.output}else e=new Array(r.length);var n=Zue(r),i=que(r);if(n===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=t.min,o=a===void 0?t.autoMinMax?n:0:a,s=t.max,u=s===void 0?t.autoMinMax?i:1:s;if(o>=u)throw new RangeError("min option must be smaller than max option");for(var l=(u-o)/(i-n),f=0;f<r.length;f++)e[f]=(r[f]-n)*l+o;return e}const Sh=" ".repeat(2),tP=" ".repeat(4);function Que(){return rP(this)}function rP(r,t={}){const{maxRows:e=15,maxColumns:n=10,maxNumSize:i=8}=t;return`${r.constructor.name} {
|
|
300
|
+
`,i);return}throw i}e(" updateInputGraph",function(){Mne(r,n)})})},_ne=function(r,t,e){t(" removeSelfEdges",function(){Une(r)}),t(" acyclic",function(){WS.default.run(r)}),t(" nestingGraph.run",function(){YS.default.run(r)}),t(" rank",function(){(0,pne.default)((0,Za.asNonCompoundGraph)(r))}),t(" injectEdgeLabelProxies",function(){Nne(r)}),t(" removeEmptyRanks",function(){(0,Za.removeEmptyRanks)(r)}),t(" nestingGraph.cleanup",function(){YS.default.cleanup(r)}),t(" normalizeRanks",function(){(0,Za.normalizeRanks)(r)}),t(" assignRankMinMax",function(){Pne(r)}),t(" removeEdgeLabelProxies",function(){Rne(r)}),t(" normalize.run",function(){XS.default.run(r)}),t(" parentDummyChains",function(){(0,gne.default)(r)}),t(" addBorderSegments",function(){(0,yne.default)(r)}),e&&e.keepNodeOrder&&t(" initDataOrder",function(){(0,xne.default)(r,e.nodeOrder)}),t(" order",function(){(0,mne.default)(r,e==null?void 0:e.keepNodeOrder)}),t(" insertSelfEdges",function(){jne(r)}),t(" adjustCoordinateSystem",function(){VS.default.adjust(r)}),t(" position",function(){(0,bne.default)(r)}),t(" positionSelfEdges",function(){Wne(r)}),t(" removeBorderNodes",function(){$ne(r)}),t(" normalize.undo",function(){XS.default.undo(r)}),t(" fixupEdgeLabelCoords",function(){zne(r)}),t(" undoCoordinateSystem",function(){VS.default.undo(r)}),t(" translateGraph",function(){Bne(r)}),t(" assignNodeIntersects",function(){Fne(r)}),t(" reversePoints",function(){Gne(r)}),t(" acyclic.undo",function(){WS.default.undo(r)})},Sne=function(r,t){r.nodes().forEach(function(e){var n=r.node(e),i=t.node(e);i!==void 0?(n.fixorder=i._order,delete i._order):delete n.fixorder})},Mne=function(r,t){r.nodes().forEach(function(e){var n,i=r.node(e);if(i){var a=t.node(e);i.x=a.x,i.y=a.y,i._order=a.order,i._rank=a.rank,!((n=t.children(e))===null||n===void 0)&&n.length&&(i.width=a.width,i.height=a.height)}}),r.edges().forEach(function(e){var n=r.edge(e),i=t.edge(e);n.points=i?i.points:[],i&&i.hasOwnProperty("x")&&(n.x=i.x,n.y=i.y)}),r.graph().width=t.graph().width,r.graph().height=t.graph().height},Cne=["nodesep","edgesep","ranksep","marginx","marginy"],Ane={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},J0=["acyclicer","ranker","rankdir","align"],Tne=["width","height","layer","fixorder"],Ine={width:0,height:0},One=["minlen","weight","width","height","labeloffset"],Lne={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ey=["labelpos"],kne=function(r){var t=new wne.Graph({multigraph:!0,compound:!0}),e=ry(r.graph()),n={};return J0==null||J0.forEach(function(i){e[i]!==void 0&&(n[i]=e[i])}),t.setGraph(Object.assign({},Ane,ty(e,Cne),n)),r.nodes().forEach(function(i){var a=ry(r.node(i)),o=Wv(Wv({},Ine),a),s=ty(o,Tne);t.setNode(i,s),t.setParent(i,r.parent(i))}),r.edges().forEach(function(i){var a=ry(r.edge(i)),o={};ey==null||ey.forEach(function(s){a[s]!==void 0&&(o[s]=a[s])}),t.setEdgeObj(i,Object.assign({},Lne,ty(a,One),o))}),t},Dne=function(r){var t=r.graph();t.ranksep||(t.ranksep=0),t.ranksep/=2,r.nodes().forEach(function(e){var n=r.node(e);isNaN(n.layer)||n.layer||(n.layer=0)}),r.edges().forEach(function(e){var n,i=r.edge(e);i.minlen*=2,((n=i.labelpos)===null||n===void 0?void 0:n.toLowerCase())!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?i.width+=i.labeloffset:i.height+=i.labeloffset)})},Nne=function(r){r.edges().forEach(function(t){var e=r.edge(t);if(e.width&&e.height){var n=r.node(t.v),i=r.node(t.w),a={e:t,rank:(i.rank-n.rank)/2+n.rank};(0,Za.addDummyNode)(r,"edge-proxy",a,"_ep")}})},Pne=function(r){var t=0;r.nodes().forEach(function(e){var n,i,a=r.node(e);a.borderTop&&(a.minRank=(n=r.node(a.borderTop))===null||n===void 0?void 0:n.rank,a.maxRank=(i=r.node(a.borderBottom))===null||i===void 0?void 0:i.rank,t=Math.max(t,a.maxRank||-1/0))}),r.graph().maxRank=t},Rne=function(r){r.nodes().forEach(function(t){var e=r.node(t);e.dummy==="edge-proxy"&&(r.edge(e.e).labelRank=e.rank,r.removeNode(t))})},Bne=function(r){var t,e=0,n,i=0,a=r.graph(),o=a.marginx||0,s=a.marginy||0,u=function(l){if(l){var f=l.x,c=l.y,d=l.width,h=l.height;!isNaN(f)&&!isNaN(d)&&(t===void 0&&(t=f-d/2),t=Math.min(t,f-d/2),e=Math.max(e,f+d/2)),!isNaN(c)&&!isNaN(h)&&(n===void 0&&(n=c-h/2),n=Math.min(n,c-h/2),i=Math.max(i,c+h/2))}};r.nodes().forEach(function(l){u(r.node(l))}),r.edges().forEach(function(l){var f=r.edge(l);f!=null&&f.hasOwnProperty("x")&&u(f)}),t-=o,n-=s,r.nodes().forEach(function(l){var f=r.node(l);f&&(f.x-=t,f.y-=n)}),r.edges().forEach(function(l){var f,c=r.edge(l);(f=c.points)===null||f===void 0||f.forEach(function(d){d.x-=t,d.y-=n}),c.hasOwnProperty("x")&&(c.x-=t),c.hasOwnProperty("y")&&(c.y-=n)}),a.width=e-t+o,a.height=i-n+s},Fne=function(r){r.edges().forEach(function(t){var e=r.edge(t),n=r.node(t.v),i=r.node(t.w),a,o;e.points?(a=e.points[0],o=e.points[e.points.length-1]):(e.points=[],a=i,o=n),e.points.unshift((0,Za.intersectRect)(n,a)),e.points.push((0,Za.intersectRect)(i,o))})},zne=function(r){r.edges().forEach(function(t){var e=r.edge(t);if(e!=null&&e.hasOwnProperty("x"))switch((e.labelpos==="l"||e.labelpos==="r")&&(e.width-=e.labeloffset),e.labelpos){case"l":e.x-=e.width/2+e.labeloffset;break;case"r":e.x+=e.width/2+e.labeloffset;break}})},Gne=function(r){r.edges().forEach(function(t){var e,n=r.edge(t);n.reversed&&((e=n.points)===null||e===void 0||e.reverse())})},$ne=function(r){r.nodes().forEach(function(t){var e,n,i;if(!((e=r.children(t))===null||e===void 0)&&e.length){var a=r.node(t),o=r.node(a.borderTop),s=r.node(a.borderBottom),u=r.node(a.borderLeft[((n=a.borderLeft)===null||n===void 0?void 0:n.length)-1]),l=r.node(a.borderRight[((i=a.borderRight)===null||i===void 0?void 0:i.length)-1]);a.width=Math.abs((l==null?void 0:l.x)-(u==null?void 0:u.x))||10,a.height=Math.abs((s==null?void 0:s.y)-(o==null?void 0:o.y))||10,a.x=((u==null?void 0:u.x)||0)+a.width/2,a.y=((o==null?void 0:o.y)||0)+a.height/2}}),r.nodes().forEach(function(t){var e;((e=r.node(t))===null||e===void 0?void 0:e.dummy)==="border"&&r.removeNode(t)})},Une=function(r){r.edges().forEach(function(t){if(t.v===t.w){var e=r.node(t.v);e.selfEdges||(e.selfEdges=[]),e.selfEdges.push({e:t,label:r.edge(t)}),r.removeEdgeObj(t)}})},jne=function(r){var t=(0,Za.buildLayerMatrix)(r);t==null||t.forEach(function(e){var n=0;e==null||e.forEach(function(i,a){var o,s=r.node(i);s.order=a+n,(o=s.selfEdges)===null||o===void 0||o.forEach(function(u){(0,Za.addDummyNode)(r,"selfedge",{width:u.label.width,height:u.label.height,rank:s.rank,order:a+ ++n,e:u.e,label:u.label},"_se")}),delete s.selfEdges})})},Wne=function(r){r.nodes().forEach(function(t){var e=r.node(t);if(e.dummy==="selfedge"){var n=r.node(e.e.v),i=n.x+n.width/2,a=n.y,o=e.x-i,s=n.height/2;r.setEdgeObj(e.e,e.label),r.removeNode(t),e.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{y:a,x:i+o},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],e.label.x=e.x,e.label.y=e.y}})},ty=function(r,t){var e={};return t==null||t.forEach(function(n){r[n]!==void 0&&(e[n]=+r[n])}),e},ry=function(r){r===void 0&&(r={});var t={};return Object.keys(r).forEach(function(e){t[e.toLowerCase()]=r[e]}),t};_b.default=Ene;var Xne=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Eb,"__esModule",{value:!0});var Yne=Xne(_b),HS=zi;Eb.default={layout:Yne.default,util:{time:HS.time,notime:HS.notime}};var Vne=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Hne=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Kl,"__esModule",{value:!0});Kl.DagreLayout=void 0;var Kne=Hne(Eb),Ai=an(),qne=hn,KS=Fo,Zne=function(r){Vne(t,r);function t(e){var n=r.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.ranksep=50,n.controlPoints=!1,n.sortByCombo=!1,n.edgeLabelSpace=!0,n.radial=!1,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.layoutNode=function(i){var a=n,o=a.nodes,s=o.find(function(l){return l.id===i});if(s){var u=s.layout!==!1;return u}return!0},n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},t.prototype.execute=function(){var e=this,n,i,a,o,s=this,u=s.nodes,l=s.nodeSize,f=s.rankdir,c=s.combos,d=s.begin,h=s.radial,v=s.comboEdges,p=v===void 0?[]:v,g=s.vedges,y=g===void 0?[]:g;if(u){var m=s.edges||[],b=new KS.Graph({multigraph:!0,compound:!0});s.nodeMap={};var x={};u.forEach(function(ie){s.nodeMap[ie.id]=ie,ie.comboId&&(x[ie.comboId]=x[ie.comboId]||[],x[ie.comboId].push(ie.id))});var w=[],E={};!((n=s.nodeOrder)===null||n===void 0)&&n.length?(s.nodeOrder.forEach(function(ie){E[ie]=!0,w.push(s.nodeMap[ie])}),u.forEach(function(ie){E[ie.id]||w.push(ie)})):w=u;var _;l?(0,Ai.isArray)(l)?_=function(){return l}:_=function(){return[l,l]}:_=function(ie){return ie.size?(0,Ai.isArray)(ie.size)?ie.size:(0,Ai.isObject)(ie.size)?[ie.size.width||40,ie.size.height||40]:[ie.size,ie.size]:[40,40]};var M=(0,Ai.getFunc)(s.ranksep,50,s.ranksepFunc),C=(0,Ai.getFunc)(s.nodesep,50,s.nodesepFunc),S=C,A=M;(f==="LR"||f==="RL")&&(S=M,A=C),b.setDefaultEdgeLabel(function(){return{}}),b.setGraph(s);var T={};this.sortByCombo&&c&&c.forEach(function(ie){if(T[ie.id]=ie,ie.collapsed){var L=_(ie),Se=A(ie),Pe=S(ie),me=L[0]+2*Pe,je=L[1]+2*Se;b.setNode(ie.id,{width:me,height:je})}ie.parentId&&(T[ie.parentId]||b.setNode(ie.parentId,{}),b.setParent(ie.id,ie.parentId))}),w.filter(function(ie){return ie.layout!==!1}).forEach(function(ie){var L=_(ie),Se=A(ie),Pe=S(ie),me=L[0]+2*Pe,je=L[1]+2*Se,Xe=ie.layer;(0,Ai.isNumber)(Xe)?b.setNode(ie.id,{width:me,height:je,layer:Xe}):b.setNode(ie.id,{width:me,height:je}),e.sortByCombo&&ie.comboId&&(T[ie.comboId]||(T[ie.comboId]={id:ie.comboId},b.setNode(ie.comboId,{})),b.setParent(ie.id,ie.comboId))}),m.forEach(function(ie){var L=(0,Ai.getEdgeTerminal)(ie,"source"),Se=(0,Ai.getEdgeTerminal)(ie,"target");e.layoutNode(L)&&e.layoutNode(Se)&&b.setEdge(L,Se,{weight:ie.weight||1})}),(i=p==null?void 0:p.concat(y||[]))===null||i===void 0||i.forEach(function(ie){var L,Se,Pe=ie.source,me=ie.target,je=!((L=T[Pe])===null||L===void 0)&&L.collapsed?[Pe]:x[Pe]||[Pe],Xe=!((Se=T[me])===null||Se===void 0)&&Se.collapsed?[me]:x[me]||[me];je.forEach(function(qe){Xe.forEach(function(tt){b.setEdge(qe,tt,{weight:ie.weight||1})})})});var I=void 0;!((a=s.preset)===null||a===void 0)&&a.nodes&&(I=new KS.Graph({multigraph:!0,compound:!0}),s.preset.nodes.forEach(function(ie){I==null||I.setNode(ie.id,ie)})),Kne.default.layout(b,{prevGraph:I,edgeLabelSpace:s.edgeLabelSpace,keepNodeOrder:!!s.nodeOrder,nodeOrder:s.nodeOrder});var k=[0,0];if(d){var P=1/0,N=1/0;b.nodes().forEach(function(ie){var L=b.node(ie);P>L.x&&(P=L.x),N>L.y&&(N=L.y)}),b.edges().forEach(function(ie){var L,Se=b.edge(ie);(L=Se.points)===null||L===void 0||L.forEach(function(Pe){P>Pe.x&&(P=Pe.x),N>Pe.y&&(N=Pe.y)})}),k[0]=d[0]-P,k[1]=d[1]-N}var z=f==="LR"||f==="RL";if(h){var W=this,D=W.focusNode,R=W.ranksep,H=W.getRadialPos,ee=(0,Ai.isString)(D)?D:D==null?void 0:D.id,Y=ee?(o=b.node(ee))===null||o===void 0?void 0:o._rank:0,X=[],fe=z?"y":"x",we=z?"height":"width",Ae=1/0,Ke=-1/0;b.nodes().forEach(function(ie){var L=b.node(ie);if(s.nodeMap[ie]){var Se=C(s.nodeMap[ie]);if(Y===0)X[L._rank]||(X[L._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),X[L._rank].nodes.push(ie),X[L._rank].totalWidth+=Se*2+L[we],X[L._rank].maxSize<Math.max(L.width,L.height)&&(X[L._rank].maxSize=Math.max(L.width,L.height));else{var Pe=L._rank-Y;if(Pe===0)X[Pe]||(X[Pe]={nodes:[],totalWidth:0,maxSize:-1/0}),X[Pe].nodes.push(ie),X[Pe].totalWidth+=Se*2+L[we],X[Pe].maxSize<Math.max(L.width,L.height)&&(X[Pe].maxSize=Math.max(L.width,L.height));else{var me=Math.abs(Pe);X[me]||(X[me]={left:[],right:[],totalWidth:0,maxSize:-1/0}),X[me].totalWidth+=Se*2+L[we],X[me].maxSize<Math.max(L.width,L.height)&&(X[me].maxSize=Math.max(L.width,L.height)),Pe<0?X[me].left.push(ie):X[me].right.push(ie)}}var je=L[fe]-L[we]/2-Se,Xe=L[fe]+L[we]/2+Se;je<Ae&&(Ae=je),Xe>Ke&&(Ke=Xe)}});var ot=R||50,nt={},Ct=(Ke-Ae)/.9,Et=[(Ae+Ke-Ct)*.5,(Ae+Ke+Ct)*.5],fr=function(ie,L,Se,Pe){Se===void 0&&(Se=-1/0),Pe===void 0&&(Pe=[0,1]);var me=Se;return ie.forEach(function(je){var Xe=b.node(je);nt[je]=L;var qe=H(Xe[fe],Et,Ct,L,Pe),tt=qe.x,yt=qe.y;if(s.nodeMap[je]){s.nodeMap[je].x=tt+k[0],s.nodeMap[je].y=yt+k[1],s.nodeMap[je]._order=Xe._order;var Ut=M(s.nodeMap[je]);me<Ut&&(me=Ut)}}),me},Gt=!0,jt=0;X.forEach(function(ie){var L,Se,Pe,me,je,Xe,qe;if(!(!(!((L=ie==null?void 0:ie.nodes)===null||L===void 0)&&L.length)&&!(!((Se=ie==null?void 0:ie.left)===null||Se===void 0)&&Se.length)&&!(!((Pe=ie==null?void 0:ie.right)===null||Pe===void 0)&&Pe.length))){if(Gt&&ie.nodes.length===1){var tt=ie.nodes[0];if(!s.nodeMap[tt])return;s.nodeMap[tt].x=k[0],s.nodeMap[tt].y=k[1],nt[ie.nodes[0]]=0,ot=M(s.nodeMap[tt]),Gt=!1;return}ot=Math.max(ot,ie.totalWidth/(2*Math.PI));var yt=-1/0;if(Y===0||!((me=ie.nodes)===null||me===void 0)&&me.length)yt=fr(ie.nodes,ot,yt,[0,1]);else{var Ut=((je=ie.left)===null||je===void 0?void 0:je.length)/(((Xe=ie.left)===null||Xe===void 0?void 0:Xe.length)+((qe=ie.right)===null||qe===void 0?void 0:qe.length));yt=fr(ie.left,ot,yt,[0,Ut]),yt=fr(ie.right,ot,yt,[Ut+.05,1])}ot+=yt,Gt=!1,jt-ie.maxSize}}),b.edges().forEach(function(ie){var L,Se,Pe,me=b.edge(ie),je=m.findIndex(function(wr){var Zt=(0,Ai.getEdgeTerminal)(wr,"source"),Mr=(0,Ai.getEdgeTerminal)(wr,"target");return Zt===ie.v&&Mr===ie.w});if(!(je<=-1)&&s.edgeLabelSpace&&s.controlPoints&&m[je].type!=="loop"){var Xe=fe==="x"?"y":"x",qe=(L=me==null?void 0:me.points)===null||L===void 0?void 0:L.slice(1,me.points.length-1),tt=[],yt=(Se=b.node(ie.v))===null||Se===void 0?void 0:Se[Xe],Ut=yt-((Pe=b.node(ie.w))===null||Pe===void 0?void 0:Pe[Xe]),gr=nt[ie.v],Pt=gr-nt[ie.w];qe==null||qe.forEach(function(wr){var Zt=(wr[Xe]-yt)/Ut*Pt+gr,Mr=H(wr[fe],Et,Ct,Zt);tt.push({x:Mr.x+k[0],y:Mr.y+k[1]})}),m[je].controlPoints=tt}})}else{var Sr=new Set,rr=f==="BT"||f==="RL",Rt=rr?function(ie,L){return L-ie}:function(ie,L){return ie-L};b.nodes().forEach(function(ie){var L=b.node(ie);if(L){var Se=e.nodeMap[ie];Se||(Se=c==null?void 0:c.find(function(Pe){return Pe.id===ie})),Se&&(Se.x=L.x+k[0],Se.y=L.y+k[1],Se._order=L._order,Sr.add(z?Se.x:Se.y))}});var sr=Array.from(Sr).sort(Rt),Hr=z?function(ie,L){return ie.x!==L.x}:function(ie,L){return ie.y!==L.y},et=z?function(ie,L,Se){var Pe=Math.max(L.y,Se.y),me=Math.min(L.y,Se.y);return ie.filter(function(je){return je.y<=Pe&&je.y>=me})}:function(ie,L,Se){var Pe=Math.max(L.x,Se.x),me=Math.min(L.x,Se.x);return ie.filter(function(je){return je.x<=Pe&&je.x>=me})};b.edges().forEach(function(ie){var L,Se=b.edge(ie),Pe=m.findIndex(function(Xe){var qe=(0,Ai.getEdgeTerminal)(Xe,"source"),tt=(0,Ai.getEdgeTerminal)(Xe,"target");return qe===ie.v&&tt===ie.w});if(!(Pe<=-1)&&s.edgeLabelSpace&&s.controlPoints&&m[Pe].type!=="loop"){(L=Se==null?void 0:Se.points)===null||L===void 0||L.forEach(function(Xe){Xe.x+=k[0],Xe.y+=k[1]});var me=s.nodeMap[ie.v],je=s.nodeMap[ie.w];m[Pe].controlPoints=Qne(Se==null?void 0:Se.points,me,je,sr,z,Hr,et)}})}return s.onLayoutEnd&&s.onLayoutEnd(),{nodes:u,edges:m}}},t.prototype.getRadialPos=function(e,n,i,a,o){o===void 0&&(o=[0,1]);var s=(e-n[0])/i;s=s*(o[1]-o[0])+o[0];var u=s*2*Math.PI;return{x:Math.cos(u)*a,y:Math.sin(u)*a}},t.prototype.getType=function(){return"dagre"},t}(qne.Base);Kl.DagreLayout=Zne;var Qne=function(r,t,e,n,i,a,o){var s=(r==null?void 0:r.slice(1,r.length-1))||[];if(t&&e){var u=t.x,l=t.y,f=e.x,c=e.y;if(i&&(u=t.y,l=t.x,f=e.y,c=e.x),c!==l&&u!==f){var d=n.indexOf(l),h=n[d+1];if(h){var v=s[0],p=i?{x:(l+h)/2,y:(v==null?void 0:v.y)||f}:{x:(v==null?void 0:v.x)||f,y:(l+h)/2};(!v||a(v,p))&&s.unshift(p)}var g=n.indexOf(c),y=Math.abs(g-d);if(y===1)s=o(s,t,e),s.length||s.push(i?{x:(l+c)/2,y:u}:{x:u,y:(l+c)/2});else if(y>1){var m=n[g-1];if(m){var b=s[s.length-1],x=i?{x:(c+m)/2,y:(b==null?void 0:b.y)||f}:{x:(b==null?void 0:b.x)||u,y:(c+m)/2};(!b||a(b,x))&&s.push(x)}}}}return s},ed={};const Xv={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function Bm(r={},t=Xv){var e,n,i,a;const o=JSON.parse(JSON.stringify(t)),s=((e=r==null?void 0:r.graph)===null||e===void 0?void 0:e.meta)||{},u=((n=r==null?void 0:r.subScene)===null||n===void 0?void 0:n.meta)||{},l=((i=r==null?void 0:r.nodeSize)===null||i===void 0?void 0:i.meta)||{},f=((a=r==null?void 0:r.nodeSize)===null||a===void 0?void 0:a.node)||{},c=o.nodeSize.bridge;return{graph:{meta:Object.assign(o.graph.meta,s)},subScene:{meta:Object.assign(o.subScene.meta,u)},nodeSize:{meta:Object.assign(o.nodeSize.meta,l),node:Object.assign(o.nodeSize.node,f),bridge:c}}}function GD(r){return`◬${r}◬`}const zl=GD("ROOT"),$D=GD("BRIDGE_GRAPH");var wi,yu,Gl,Fm;(function(r){r[r.META=0]="META",r[r.NODE=1]="NODE",r[r.BRIDGE=2]="BRIDGE"})(wi||(wi={})),function(r){r[r.INCLUDE=0]="INCLUDE",r[r.EXCLUDE=1]="EXCLUDE",r[r.UNSPECIFIED=2]="UNSPECIFIED"}(yu||(yu={})),function(r){r[r.META=0]="META",r[r.CORE=1]="CORE",r[r.BRIDGE=2]="BRIDGE"}(Gl||(Gl={})),function(r){r[r.META=0]="META",r[r.OP=1]="OP",r[r.SERIES=2]="SERIES"}(Fm||(Fm={}));var Eh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qb(r,t){return r(t={exports:{}},t.exports),t.exports}var Jne=function(){this.__data__=[],this.size=0},Zl=function(r,t){return r===t||r!=r&&t!=t},Yp=function(r,t){for(var e=r.length;e--;)if(Zl(r[e][0],t))return e;return-1},eie=Array.prototype.splice,tie=function(r){var t=this.__data__,e=Yp(t,r);return!(e<0)&&(e==t.length-1?t.pop():eie.call(t,e,1),--this.size,!0)},rie=function(r){var t=this.__data__,e=Yp(t,r);return e<0?void 0:t[e][1]},nie=function(r){return Yp(this.__data__,r)>-1},iie=function(r,t){var e=this.__data__,n=Yp(e,r);return n<0?(++this.size,e.push([r,t])):e[n][1]=t,this};function ul(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}ul.prototype.clear=Jne,ul.prototype.delete=tie,ul.prototype.get=rie,ul.prototype.has=nie,ul.prototype.set=iie;var Vp=ul,aie=function(){this.__data__=new Vp,this.size=0},oie=function(r){var t=this.__data__,e=t.delete(r);return this.size=t.size,e},sie=function(r){return this.__data__.get(r)},uie=function(r){return this.__data__.has(r)},UD=typeof Eh=="object"&&Eh&&Eh.Object===Object&&Eh,lie=typeof self=="object"&&self&&self.Object===Object&&self,Ea=UD||lie||Function("return this")(),ta=Ea.Symbol,jD=Object.prototype,fie=jD.hasOwnProperty,cie=jD.toString,_f=ta?ta.toStringTag:void 0,die=function(r){var t=fie.call(r,_f),e=r[_f];try{r[_f]=void 0;var n=!0}catch{}var i=cie.call(r);return n&&(t?r[_f]=e:delete r[_f]),i},hie=Object.prototype.toString,vie=function(r){return hie.call(r)},qS=ta?ta.toStringTag:void 0,Ts=function(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":qS&&qS in Object(r)?die(r):vie(r)},Si=function(r){var t=typeof r;return r!=null&&(t=="object"||t=="function")},ZS,td=function(r){if(!Si(r))return!1;var t=Ts(r);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"},ny=Ea["__core-js_shared__"],QS=(ZS=/[^.]+$/.exec(ny&&ny.keys&&ny.keys.IE_PROTO||""))?"Symbol(src)_1."+ZS:"",pie=function(r){return!!QS&&QS in r},gie=Function.prototype.toString,Su=function(r){if(r!=null){try{return gie.call(r)}catch{}try{return r+""}catch{}}return""},yie=/^\[object .+?Constructor\]$/,mie=Function.prototype,bie=Object.prototype,xie=mie.toString,wie=bie.hasOwnProperty,Eie=RegExp("^"+xie.call(wie).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_ie=function(r){return!(!Si(r)||pie(r))&&(td(r)?Eie:yie).test(Su(r))},Sie=function(r,t){return r==null?void 0:r[t]},Mu=function(r,t){var e=Sie(r,t);return _ie(e)?e:void 0},Ac=Mu(Ea,"Map"),Tc=Mu(Object,"create"),Mie=function(){this.__data__=Tc?Tc(null):{},this.size=0},Cie=function(r){var t=this.has(r)&&delete this.__data__[r];return this.size-=t?1:0,t},Aie=Object.prototype.hasOwnProperty,Tie=function(r){var t=this.__data__;if(Tc){var e=t[r];return e==="__lodash_hash_undefined__"?void 0:e}return Aie.call(t,r)?t[r]:void 0},Iie=Object.prototype.hasOwnProperty,Oie=function(r){var t=this.__data__;return Tc?t[r]!==void 0:Iie.call(t,r)},Lie=function(r,t){var e=this.__data__;return this.size+=this.has(r)?0:1,e[r]=Tc&&t===void 0?"__lodash_hash_undefined__":t,this};function ll(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}ll.prototype.clear=Mie,ll.prototype.delete=Cie,ll.prototype.get=Tie,ll.prototype.has=Oie,ll.prototype.set=Lie;var JS=ll,kie=function(){this.size=0,this.__data__={hash:new JS,map:new(Ac||Vp),string:new JS}},Die=function(r){var t=typeof r;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?r!=="__proto__":r===null},Hp=function(r,t){var e=r.__data__;return Die(t)?e[typeof t=="string"?"string":"hash"]:e.map},Nie=function(r){var t=Hp(this,r).delete(r);return this.size-=t?1:0,t},Pie=function(r){return Hp(this,r).get(r)},Rie=function(r){return Hp(this,r).has(r)},Bie=function(r,t){var e=Hp(this,r),n=e.size;return e.set(r,t),this.size+=e.size==n?0:1,this};function fl(r){var t=-1,e=r==null?0:r.length;for(this.clear();++t<e;){var n=r[t];this.set(n[0],n[1])}}fl.prototype.clear=kie,fl.prototype.delete=Nie,fl.prototype.get=Pie,fl.prototype.has=Rie,fl.prototype.set=Bie;var Kp=fl,Fie=function(r,t){var e=this.__data__;if(e instanceof Vp){var n=e.__data__;if(!Ac||n.length<199)return n.push([r,t]),this.size=++e.size,this;e=this.__data__=new Kp(n)}return e.set(r,t),this.size=e.size,this};function cl(r){var t=this.__data__=new Vp(r);this.size=t.size}cl.prototype.clear=aie,cl.prototype.delete=oie,cl.prototype.get=sie,cl.prototype.has=uie,cl.prototype.set=Fie;var Sl=cl,Zb=function(r,t){for(var e=-1,n=r==null?0:r.length;++e<n&&t(r[e],e,r)!==!1;);return r},Yv=function(){try{var r=Mu(Object,"defineProperty");return r({},"",{}),r}catch{}}(),qp=function(r,t,e){t=="__proto__"&&Yv?Yv(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0}):r[t]=e},zie=Object.prototype.hasOwnProperty,Zp=function(r,t,e){var n=r[t];zie.call(r,t)&&Zl(n,e)&&(e!==void 0||t in r)||qp(r,t,e)},rd=function(r,t,e,n){var i=!e;e||(e={});for(var a=-1,o=t.length;++a<o;){var s=t[a],u=n?n(e[s],r[s],s,e,r):void 0;u===void 0&&(u=r[s]),i?qp(e,s,u):Zp(e,s,u)}return e},Gie=function(r,t){for(var e=-1,n=Array(r);++e<r;)n[e]=t(e);return n},ya=function(r){return r!=null&&typeof r=="object"},eM=function(r){return ya(r)&&Ts(r)=="[object Arguments]"},WD=Object.prototype,$ie=WD.hasOwnProperty,Uie=WD.propertyIsEnumerable,$l=eM(function(){return arguments}())?eM:function(r){return ya(r)&&$ie.call(r,"callee")&&!Uie.call(r,"callee")},dn=Array.isArray,jie=function(){return!1},mu=qb(function(r,t){var e=t&&!t.nodeType&&t,n=e&&r&&!r.nodeType&&r,i=n&&n.exports===e?Ea.Buffer:void 0,a=(i?i.isBuffer:void 0)||jie;r.exports=a}),Wie=/^(?:0|[1-9]\d*)$/,Qp=function(r,t){var e=typeof r;return!!(t=t==null?9007199254740991:t)&&(e=="number"||e!="symbol"&&Wie.test(r))&&r>-1&&r%1==0&&r<t},Qb=function(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=9007199254740991},Wr={};Wr["[object Float32Array]"]=Wr["[object Float64Array]"]=Wr["[object Int8Array]"]=Wr["[object Int16Array]"]=Wr["[object Int32Array]"]=Wr["[object Uint8Array]"]=Wr["[object Uint8ClampedArray]"]=Wr["[object Uint16Array]"]=Wr["[object Uint32Array]"]=!0,Wr["[object Arguments]"]=Wr["[object Array]"]=Wr["[object ArrayBuffer]"]=Wr["[object Boolean]"]=Wr["[object DataView]"]=Wr["[object Date]"]=Wr["[object Error]"]=Wr["[object Function]"]=Wr["[object Map]"]=Wr["[object Number]"]=Wr["[object Object]"]=Wr["[object RegExp]"]=Wr["[object Set]"]=Wr["[object String]"]=Wr["[object WeakMap]"]=!1;var Xie=function(r){return ya(r)&&Qb(r.length)&&!!Wr[Ts(r)]},Jp=function(r){return function(t){return r(t)}},Ul=qb(function(r,t){var e=t&&!t.nodeType&&t,n=e&&r&&!r.nodeType&&r,i=n&&n.exports===e&&UD.process,a=function(){try{var o=n&&n.require&&n.require("util").types;return o||i&&i.binding&&i.binding("util")}catch{}}();r.exports=a}),tM=Ul&&Ul.isTypedArray,nd=tM?Jp(tM):Xie,Yie=Object.prototype.hasOwnProperty,XD=function(r,t){var e=dn(r),n=!e&&$l(r),i=!e&&!n&&mu(r),a=!e&&!n&&!i&&nd(r),o=e||n||i||a,s=o?Gie(r.length,String):[],u=s.length;for(var l in r)!t&&!Yie.call(r,l)||o&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Qp(l,u))||s.push(l);return s},Vie=Object.prototype,eg=function(r){var t=r&&r.constructor;return r===(typeof t=="function"&&t.prototype||Vie)},YD=function(r,t){return function(e){return r(t(e))}},Hie=YD(Object.keys,Object),Kie=Object.prototype.hasOwnProperty,Jb=function(r){if(!eg(r))return Hie(r);var t=[];for(var e in Object(r))Kie.call(r,e)&&e!="constructor"&&t.push(e);return t},Go=function(r){return r!=null&&Qb(r.length)&&!td(r)},Is=function(r){return Go(r)?XD(r):Jb(r)},qie=function(r,t){return r&&rd(t,Is(t),r)},Zie=function(r){var t=[];if(r!=null)for(var e in Object(r))t.push(e);return t},Qie=Object.prototype.hasOwnProperty,Jie=function(r){if(!Si(r))return Zie(r);var t=eg(r),e=[];for(var n in r)(n!="constructor"||!t&&Qie.call(r,n))&&e.push(n);return e},Cu=function(r){return Go(r)?XD(r,!0):Jie(r)},eae=function(r,t){return r&&rd(t,Cu(t),r)},VD=qb(function(r,t){var e=t&&!t.nodeType&&t,n=e&&r&&!r.nodeType&&r,i=n&&n.exports===e?Ea.Buffer:void 0,a=i?i.allocUnsafe:void 0;r.exports=function(o,s){if(s)return o.slice();var u=o.length,l=a?a(u):new o.constructor(u);return o.copy(l),l}}),HD=function(r,t){var e=-1,n=r.length;for(t||(t=Array(n));++e<n;)t[e]=r[e];return t},KD=function(r,t){for(var e=-1,n=r==null?0:r.length,i=0,a=[];++e<n;){var o=r[e];t(o,e,r)&&(a[i++]=o)}return a},qD=function(){return[]},tae=Object.prototype.propertyIsEnumerable,rM=Object.getOwnPropertySymbols,ex=rM?function(r){return r==null?[]:(r=Object(r),KD(rM(r),function(t){return tae.call(r,t)}))}:qD,rae=function(r,t){return rd(r,ex(r),t)},tx=function(r,t){for(var e=-1,n=t.length,i=r.length;++e<n;)r[i+e]=t[e];return r},tg=YD(Object.getPrototypeOf,Object),ZD=Object.getOwnPropertySymbols?function(r){for(var t=[];r;)tx(t,ex(r)),r=tg(r);return t}:qD,nae=function(r,t){return rd(r,ZD(r),t)},QD=function(r,t,e){var n=t(r);return dn(r)?n:tx(n,e(r))},zm=function(r){return QD(r,Is,ex)},iae=function(r){return QD(r,Cu,ZD)},Gm=Mu(Ea,"DataView"),$m=Mu(Ea,"Promise"),Ml=Mu(Ea,"Set"),Um=Mu(Ea,"WeakMap"),aae=Su(Gm),oae=Su(Ac),sae=Su($m),uae=Su(Ml),lae=Su(Um),qs=Ts;(Gm&&qs(new Gm(new ArrayBuffer(1)))!="[object DataView]"||Ac&&qs(new Ac)!="[object Map]"||$m&&qs($m.resolve())!="[object Promise]"||Ml&&qs(new Ml)!="[object Set]"||Um&&qs(new Um)!="[object WeakMap]")&&(qs=function(r){var t=Ts(r),e=t=="[object Object]"?r.constructor:void 0,n=e?Su(e):"";if(n)switch(n){case aae:return"[object DataView]";case oae:return"[object Map]";case sae:return"[object Promise]";case uae:return"[object Set]";case lae:return"[object WeakMap]"}return t});var bu=qs,fae=Object.prototype.hasOwnProperty,cae=function(r){var t=r.length,e=new r.constructor(t);return t&&typeof r[0]=="string"&&fae.call(r,"index")&&(e.index=r.index,e.input=r.input),e},Vv=Ea.Uint8Array,rx=function(r){var t=new r.constructor(r.byteLength);return new Vv(t).set(new Vv(r)),t},dae=function(r,t){var e=t?rx(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.byteLength)},hae=/\w*$/,vae=function(r){var t=new r.constructor(r.source,hae.exec(r));return t.lastIndex=r.lastIndex,t},nM=ta?ta.prototype:void 0,iM=nM?nM.valueOf:void 0,pae=function(r){return iM?Object(iM.call(r)):{}},JD=function(r,t){var e=t?rx(r.buffer):r.buffer;return new r.constructor(e,r.byteOffset,r.length)},gae=function(r,t,e){var n=r.constructor;switch(t){case"[object ArrayBuffer]":return rx(r);case"[object Boolean]":case"[object Date]":return new n(+r);case"[object DataView]":return dae(r,e);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return JD(r,e);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(r);case"[object RegExp]":return vae(r);case"[object Set]":return new n;case"[object Symbol]":return pae(r)}},aM=Object.create,eN=function(){function r(){}return function(t){if(!Si(t))return{};if(aM)return aM(t);r.prototype=t;var e=new r;return r.prototype=void 0,e}}(),tN=function(r){return typeof r.constructor!="function"||eg(r)?{}:eN(tg(r))},yae=function(r){return ya(r)&&bu(r)=="[object Map]"},oM=Ul&&Ul.isMap,mae=oM?Jp(oM):yae,bae=function(r){return ya(r)&&bu(r)=="[object Set]"},sM=Ul&&Ul.isSet,xae=sM?Jp(sM):bae,Gr={};Gr["[object Arguments]"]=Gr["[object Array]"]=Gr["[object ArrayBuffer]"]=Gr["[object DataView]"]=Gr["[object Boolean]"]=Gr["[object Date]"]=Gr["[object Float32Array]"]=Gr["[object Float64Array]"]=Gr["[object Int8Array]"]=Gr["[object Int16Array]"]=Gr["[object Int32Array]"]=Gr["[object Map]"]=Gr["[object Number]"]=Gr["[object Object]"]=Gr["[object RegExp]"]=Gr["[object Set]"]=Gr["[object String]"]=Gr["[object Symbol]"]=Gr["[object Uint8Array]"]=Gr["[object Uint8ClampedArray]"]=Gr["[object Uint16Array]"]=Gr["[object Uint32Array]"]=!0,Gr["[object Error]"]=Gr["[object Function]"]=Gr["[object WeakMap]"]=!1;var rN=function r(t,e,n,i,a,o){var s,u=1&e,l=2&e,f=4&e;if(n&&(s=a?n(t,i,a,o):n(t)),s!==void 0)return s;if(!Si(t))return t;var c=dn(t);if(c){if(s=cae(t),!u)return HD(t,s)}else{var d=bu(t),h=d=="[object Function]"||d=="[object GeneratorFunction]";if(mu(t))return VD(t,u);if(d=="[object Object]"||d=="[object Arguments]"||h&&!a){if(s=l||h?{}:tN(t),!u)return l?nae(t,eae(s,t)):rae(t,qie(s,t))}else{if(!Gr[d])return a?t:{};s=gae(t,d,u)}}o||(o=new Sl);var v=o.get(t);if(v)return v;o.set(t,s),xae(t)?t.forEach(function(g){s.add(r(g,e,n,g,t,o))}):mae(t)&&t.forEach(function(g,y){s.set(y,r(g,e,n,y,t,o))});var p=c?void 0:(f?l?iae:zm:l?Cu:Is)(t);return Zb(p||t,function(g,y){p&&(g=t[y=g]),Zp(s,y,r(g,e,n,y,t,o))}),s},wae=function(r){return rN(r,4)},nx=function(r){return function(){return r}},ix=function(r){return function(t,e,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var u=o[r?s:++i];if(e(a[u],u,a)===!1)break}return t}}(),ax=function(r,t){return r&&ix(r,t,Is)},rg=function(r,t){return function(e,n){if(e==null)return e;if(!Go(e))return r(e,n);for(var i=e.length,a=t?i:-1,o=Object(e);(t?a--:++a<i)&&n(o[a],a,o)!==!1;);return e}}(ax),Au=function(r){return r},nN=function(r){return typeof r=="function"?r:Au},iN=function(r,t){return(dn(r)?Zb:rg)(r,nN(t))},aN=iN,Eae=function(r,t){var e=[];return rg(r,function(n,i,a){t(n,i,a)&&e.push(n)}),e},_ae=function(r){return this.__data__.set(r,"__lodash_hash_undefined__"),this},Sae=function(r){return this.__data__.has(r)};function av(r){var t=-1,e=r==null?0:r.length;for(this.__data__=new Kp;++t<e;)this.add(r[t])}av.prototype.add=av.prototype.push=_ae,av.prototype.has=Sae;var oN=av,Mae=function(r,t){for(var e=-1,n=r==null?0:r.length;++e<n;)if(t(r[e],e,r))return!0;return!1},sN=function(r,t){return r.has(t)},uN=function(r,t,e,n,i,a){var o=1&e,s=r.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var l=a.get(r),f=a.get(t);if(l&&f)return l==t&&f==r;var c=-1,d=!0,h=2&e?new oN:void 0;for(a.set(r,t),a.set(t,r);++c<s;){var v=r[c],p=t[c];if(n)var g=o?n(p,v,c,t,r,a):n(v,p,c,r,t,a);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!Mae(t,function(y,m){if(!sN(h,m)&&(v===y||i(v,y,e,n,a)))return h.push(m)})){d=!1;break}}else if(v!==p&&!i(v,p,e,n,a)){d=!1;break}}return a.delete(r),a.delete(t),d},Cae=function(r){var t=-1,e=Array(r.size);return r.forEach(function(n,i){e[++t]=[i,n]}),e},ox=function(r){var t=-1,e=Array(r.size);return r.forEach(function(n){e[++t]=n}),e},uM=ta?ta.prototype:void 0,iy=uM?uM.valueOf:void 0,Aae=function(r,t,e,n,i,a,o){switch(e){case"[object DataView]":if(r.byteLength!=t.byteLength||r.byteOffset!=t.byteOffset)return!1;r=r.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(r.byteLength!=t.byteLength||!a(new Vv(r),new Vv(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Zl(+r,+t);case"[object Error]":return r.name==t.name&&r.message==t.message;case"[object RegExp]":case"[object String]":return r==t+"";case"[object Map]":var s=Cae;case"[object Set]":var u=1&n;if(s||(s=ox),r.size!=t.size&&!u)return!1;var l=o.get(r);if(l)return l==t;n|=2,o.set(r,t);var f=uN(s(r),s(t),n,i,a,o);return o.delete(r),f;case"[object Symbol]":if(iy)return iy.call(r)==iy.call(t)}return!1},Tae=Object.prototype.hasOwnProperty,Iae=function(r,t,e,n,i,a){var o=1&e,s=zm(r),u=s.length;if(u!=zm(t).length&&!o)return!1;for(var l=u;l--;){var f=s[l];if(!(o?f in t:Tae.call(t,f)))return!1}var c=a.get(r),d=a.get(t);if(c&&d)return c==t&&d==r;var h=!0;a.set(r,t),a.set(t,r);for(var v=o;++l<u;){var p=r[f=s[l]],g=t[f];if(n)var y=o?n(g,p,f,t,r,a):n(p,g,f,r,t,a);if(!(y===void 0?p===g||i(p,g,e,n,a):y)){h=!1;break}v||(v=f=="constructor")}if(h&&!v){var m=r.constructor,b=t.constructor;m==b||!("constructor"in r)||!("constructor"in t)||typeof m=="function"&&m instanceof m&&typeof b=="function"&&b instanceof b||(h=!1)}return a.delete(r),a.delete(t),h},lM=Object.prototype.hasOwnProperty,Oae=function(r,t,e,n,i,a){var o=dn(r),s=dn(t),u=o?"[object Array]":bu(r),l=s?"[object Array]":bu(t),f=(u=u=="[object Arguments]"?"[object Object]":u)=="[object Object]",c=(l=l=="[object Arguments]"?"[object Object]":l)=="[object Object]",d=u==l;if(d&&mu(r)){if(!mu(t))return!1;o=!0,f=!1}if(d&&!f)return a||(a=new Sl),o||nd(r)?uN(r,t,e,n,i,a):Aae(r,t,u,e,n,i,a);if(!(1&e)){var h=f&&lM.call(r,"__wrapped__"),v=c&&lM.call(t,"__wrapped__");if(h||v){var p=h?r.value():r,g=v?t.value():t;return a||(a=new Sl),i(p,g,e,n,a)}}return!!d&&(a||(a=new Sl),Iae(r,t,e,n,i,a))},lN=function r(t,e,n,i,a){return t===e||(t==null||e==null||!ya(t)&&!ya(e)?t!=t&&e!=e:Oae(t,e,n,i,r,a))},Lae=function(r,t,e,n){var i=e.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=e[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){var u=(s=e[i])[0],l=r[u],f=s[1];if(o&&s[2]){if(l===void 0&&!(u in r))return!1}else{var c=new Sl;if(n)var d=n(l,f,u,r,t,c);if(!(d===void 0?lN(f,l,3,n,c):d))return!1}}return!0},fN=function(r){return r==r&&!Si(r)},kae=function(r){for(var t=Is(r),e=t.length;e--;){var n=t[e],i=r[n];t[e]=[n,i,fN(i)]}return t},cN=function(r,t){return function(e){return e!=null&&e[r]===t&&(t!==void 0||r in Object(e))}},Dae=function(r){var t=kae(r);return t.length==1&&t[0][2]?cN(t[0][0],t[0][1]):function(e){return e===r||Lae(e,r,t)}},xu=function(r){return typeof r=="symbol"||ya(r)&&Ts(r)=="[object Symbol]"},Nae=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pae=/^\w*$/,sx=function(r,t){if(dn(r))return!1;var e=typeof r;return!(e!="number"&&e!="symbol"&&e!="boolean"&&r!=null&&!xu(r))||Pae.test(r)||!Nae.test(r)||t!=null&&r in Object(t)};function ux(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var e=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=e.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return e.cache=a.set(i,o)||a,o};return e.cache=new(ux.Cache||Kp),e}ux.Cache=Kp;var Rae=ux,Bae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fae=/\\(\\)?/g,zae=function(r){var t=Rae(r,function(n){return e.size===500&&e.clear(),n}),e=t.cache;return t}(function(r){var t=[];return r.charCodeAt(0)===46&&t.push(""),r.replace(Bae,function(e,n,i,a){t.push(i?a.replace(Fae,"$1"):n||e)}),t}),Cl=function(r,t){for(var e=-1,n=r==null?0:r.length,i=Array(n);++e<n;)i[e]=t(r[e],e,r);return i},fM=ta?ta.prototype:void 0,cM=fM?fM.toString:void 0,Gae=function r(t){if(typeof t=="string")return t;if(dn(t))return Cl(t,r)+"";if(xu(t))return cM?cM.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e},dN=function(r){return r==null?"":Gae(r)},ng=function(r,t){return dn(r)?r:sx(r,t)?[r]:zae(dN(r))},id=function(r){if(typeof r=="string"||xu(r))return r;var t=r+"";return t=="0"&&1/r==-1/0?"-0":t},ig=function(r,t){for(var e=0,n=(t=ng(t,r)).length;r!=null&&e<n;)r=r[id(t[e++])];return e&&e==n?r:void 0},$ae=function(r,t,e){var n=r==null?void 0:ig(r,t);return n===void 0?e:n},Uae=function(r,t){return r!=null&&t in Object(r)},hN=function(r,t,e){for(var n=-1,i=(t=ng(t,r)).length,a=!1;++n<i;){var o=id(t[n]);if(!(a=r!=null&&e(r,o)))break;r=r[o]}return a||++n!=i?a:!!(i=r==null?0:r.length)&&Qb(i)&&Qp(o,i)&&(dn(r)||$l(r))},vN=function(r,t){return r!=null&&hN(r,t,Uae)},jae=function(r,t){return sx(r)&&fN(t)?cN(id(r),t):function(e){var n=$ae(e,r);return n===void 0&&n===t?vN(e,r):lN(t,n,3)}},pN=function(r){return function(t){return t==null?void 0:t[r]}},Wae=function(r){return function(t){return ig(t,r)}},Xae=function(r){return sx(r)?pN(id(r)):Wae(r)},$o=function(r){return typeof r=="function"?r:r==null?Au:typeof r=="object"?dn(r)?jae(r[0],r[1]):Dae(r):Xae(r)},gN=function(r,t){return(dn(r)?KD:Eae)(r,$o(t))},Yae=Object.prototype.hasOwnProperty,Vae=function(r,t){return r!=null&&Yae.call(r,t)},yN=function(r,t){return r!=null&&hN(r,t,Vae)},Hae=Object.prototype.hasOwnProperty,Kae=function(r){if(r==null)return!0;if(Go(r)&&(dn(r)||typeof r=="string"||typeof r.splice=="function"||mu(r)||nd(r)||$l(r)))return!r.length;var t=bu(r);if(t=="[object Map]"||t=="[object Set]")return!r.size;if(eg(r))return!Jb(r).length;for(var e in r)if(Hae.call(r,e))return!1;return!0},mN=function(r){return r===void 0},bN=function(r,t){var e=-1,n=Go(r)?Array(r.length):[];return rg(r,function(i,a,o){n[++e]=t(i,a,o)}),n},xN=function(r,t){return(dn(r)?Cl:bN)(r,$o(t))},qae=function(r,t,e,n){var i=-1,a=r==null?0:r.length;for(n&&a&&(e=r[++i]);++i<a;)e=t(e,r[i],i,r);return e},Zae=function(r,t,e,n,i){return i(r,function(a,o,s){e=n?(n=!1,a):t(e,a,o,s)}),e},wN=function(r,t,e){var n=dn(r)?qae:Zae,i=arguments.length<3;return n(r,$o(t),e,i,rg)},Qae=function(r){return typeof r=="string"||!dn(r)&&ya(r)&&Ts(r)=="[object String]"},Jae=pN("length"),eoe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),toe=function(r){return eoe.test(r)},roe="[\\ud800-\\udfff]",jm="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Wm="\\ud83c[\\udffb-\\udfff]",EN="[^\\ud800-\\udfff]",_N="(?:\\ud83c[\\udde6-\\uddff]){2}",SN="[\\ud800-\\udbff][\\udc00-\\udfff]",dM="(?:"+jm+"|"+Wm+")?",noe="[\\ufe0e\\ufe0f]?"+dM+("(?:\\u200d(?:"+[EN,_N,SN].join("|")+")[\\ufe0e\\ufe0f]?"+dM+")*"),ioe="(?:"+[EN+jm+"?",jm,_N,SN,roe].join("|")+")",hM=RegExp(Wm+"(?="+Wm+")|"+ioe+noe,"g"),aoe=function(r){for(var t=hM.lastIndex=0;hM.test(r);)++t;return t},ooe=function(r){return toe(r)?aoe(r):Jae(r)},soe=function(r){if(r==null)return 0;if(Go(r))return Qae(r)?ooe(r):r.length;var t=bu(r);return t=="[object Map]"||t=="[object Set]"?r.size:Jb(r).length},uoe=function(r,t,e){var n=dn(r),i=n||mu(r)||nd(r);if(t=$o(t),e==null){var a=r&&r.constructor;e=i?n?new a:[]:Si(r)&&td(a)?eN(tg(r)):{}}return(i?Zb:ax)(r,function(o,s,u){return t(e,o,s,u)}),e},vM=ta?ta.isConcatSpreadable:void 0,loe=function(r){return dn(r)||$l(r)||!!(vM&&r&&r[vM])},lx=function r(t,e,n,i,a){var o=-1,s=t.length;for(n||(n=loe),a||(a=[]);++o<s;){var u=t[o];e>0&&n(u)?e>1?r(u,e-1,n,i,a):tx(a,u):i||(a[a.length]=u)}return a},foe=function(r,t,e){switch(e.length){case 0:return r.call(t);case 1:return r.call(t,e[0]);case 2:return r.call(t,e[0],e[1]);case 3:return r.call(t,e[0],e[1],e[2])}return r.apply(t,e)},pM=Math.max,MN=function(r,t,e){return t=pM(t===void 0?r.length-1:t,0),function(){for(var n=arguments,i=-1,a=pM(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=e(o),foe(r,this,s)}},coe=Yv?function(r,t){return Yv(r,"toString",{configurable:!0,enumerable:!1,value:nx(t),writable:!0})}:Au,doe=Date.now,CN=function(r){var t=0,e=0;return function(){var n=doe(),i=16-(n-e);if(e=n,i>0){if(++t>=800)return arguments[0]}else t=0;return r.apply(void 0,arguments)}}(coe),ag=function(r,t){return CN(MN(r,t,Au),r+"")},AN=function(r,t,e,n){for(var i=r.length,a=e+(n?1:-1);n?a--:++a<i;)if(t(r[a],a,r))return a;return-1},hoe=function(r){return r!=r},voe=function(r,t,e){for(var n=e-1,i=r.length;++n<i;)if(r[n]===t)return n;return-1},poe=function(r,t,e){return t==t?voe(r,t,e):AN(r,hoe,e)},goe=function(r,t){return!!(r!=null&&r.length)&&poe(r,t,0)>-1},yoe=function(r,t,e){for(var n=-1,i=r==null?0:r.length;++n<i;)if(e(t,r[n]))return!0;return!1},moe=function(){},boe=Ml&&1/ox(new Ml([,-0]))[1]==1/0?function(r){return new Ml(r)}:moe,xoe=function(r,t,e){var n=-1,i=goe,a=r.length,o=!0,s=[],u=s;if(e)o=!1,i=yoe;else if(a>=200){var l=t?null:boe(r);if(l)return ox(l);o=!1,i=sN,u=new oN}else u=t?[]:s;e:for(;++n<a;){var f=r[n],c=t?t(f):f;if(f=e||f!==0?f:0,o&&c==c){for(var d=u.length;d--;)if(u[d]===c)continue e;t&&u.push(c),s.push(f)}else i(u,c,e)||(u!==s&&u.push(c),s.push(f))}return s},TN=function(r){return ya(r)&&Go(r)},woe=ag(function(r){return xoe(lx(r,1,TN,!0))}),Eoe=function(r,t){return Cl(t,function(e){return r[e]})},Hv,IN=function(r){return r==null?[]:Eoe(r,Is(r))};try{Hv={clone:wae,constant:nx,each:aN,filter:gN,has:yN,isArray:dn,isEmpty:Kae,isFunction:td,isUndefined:mN,keys:Is,map:xN,reduce:wN,size:soe,transform:uoe,union:woe,values:IN}}catch{}Hv||(Hv=window._);var dt=Hv,fx=xr;function xr(r){this._isDirected=!dt.has(r,"directed")||r.directed,this._isMultigraph=!!dt.has(r,"multigraph")&&r.multigraph,this._isCompound=!!dt.has(r,"compound")&&r.compound,this._label=void 0,this._defaultNodeLabelFn=dt.constant(void 0),this._defaultEdgeLabelFn=dt.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function gM(r,t){r[t]?r[t]++:r[t]=1}function yM(r,t){--r[t]||delete r[t]}function Vf(r,t,e,n){var i=""+t,a=""+e;if(!r&&i>a){var o=i;i=a,a=o}return i+""+a+""+(dt.isUndefined(n)?"\0":n)}function _oe(r,t,e,n){var i=""+t,a=""+e;if(!r&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function ay(r,t){return Vf(r,t.v,t.w,t.name)}xr.prototype._nodeCount=0,xr.prototype._edgeCount=0,xr.prototype.isDirected=function(){return this._isDirected},xr.prototype.isMultigraph=function(){return this._isMultigraph},xr.prototype.isCompound=function(){return this._isCompound},xr.prototype.setGraph=function(r){return this._label=r,this},xr.prototype.graph=function(){return this._label},xr.prototype.setDefaultNodeLabel=function(r){return dt.isFunction(r)||(r=dt.constant(r)),this._defaultNodeLabelFn=r,this},xr.prototype.nodeCount=function(){return this._nodeCount},xr.prototype.nodes=function(){return dt.keys(this._nodes)},xr.prototype.sources=function(){var r=this;return dt.filter(this.nodes(),function(t){return dt.isEmpty(r._in[t])})},xr.prototype.sinks=function(){var r=this;return dt.filter(this.nodes(),function(t){return dt.isEmpty(r._out[t])})},xr.prototype.setNodes=function(r,t){var e=arguments,n=this;return dt.each(r,function(i){e.length>1?n.setNode(i,t):n.setNode(i)}),this},xr.prototype.setNode=function(r,t){return dt.has(this._nodes,r)?(arguments.length>1&&(this._nodes[r]=t),this):(this._nodes[r]=arguments.length>1?t:this._defaultNodeLabelFn(r),this._isCompound&&(this._parent[r]="\0",this._children[r]={},this._children["\0"][r]=!0),this._in[r]={},this._preds[r]={},this._out[r]={},this._sucs[r]={},++this._nodeCount,this)},xr.prototype.node=function(r){return this._nodes[r]},xr.prototype.hasNode=function(r){return dt.has(this._nodes,r)},xr.prototype.removeNode=function(r){var t=this;if(dt.has(this._nodes,r)){var e=function(n){t.removeEdge(t._edgeObjs[n])};delete this._nodes[r],this._isCompound&&(this._removeFromParentsChildList(r),delete this._parent[r],dt.each(this.children(r),function(n){t.setParent(n)}),delete this._children[r]),dt.each(dt.keys(this._in[r]),e),delete this._in[r],delete this._preds[r],dt.each(dt.keys(this._out[r]),e),delete this._out[r],delete this._sucs[r],--this._nodeCount}return this},xr.prototype.setParent=function(r,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(dt.isUndefined(t))t="\0";else{for(var e=t+="";!dt.isUndefined(e);e=this.parent(e))if(e===r)throw new Error("Setting "+t+" as parent of "+r+" would create a cycle");this.setNode(t)}return this.setNode(r),this._removeFromParentsChildList(r),this._parent[r]=t,this._children[t][r]=!0,this},xr.prototype._removeFromParentsChildList=function(r){delete this._children[this._parent[r]][r]},xr.prototype.parent=function(r){if(this._isCompound){var t=this._parent[r];if(t!=="\0")return t}},xr.prototype.children=function(r){if(dt.isUndefined(r)&&(r="\0"),this._isCompound){var t=this._children[r];if(t)return dt.keys(t)}else{if(r==="\0")return this.nodes();if(this.hasNode(r))return[]}},xr.prototype.predecessors=function(r){var t=this._preds[r];if(t)return dt.keys(t)},xr.prototype.successors=function(r){var t=this._sucs[r];if(t)return dt.keys(t)},xr.prototype.neighbors=function(r){var t=this.predecessors(r);if(t)return dt.union(t,this.successors(r))},xr.prototype.isLeaf=function(r){return(this.isDirected()?this.successors(r):this.neighbors(r)).length===0},xr.prototype.filterNodes=function(r){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var e=this;dt.each(this._nodes,function(a,o){r(o)&&t.setNode(o,a)}),dt.each(this._edgeObjs,function(a){t.hasNode(a.v)&&t.hasNode(a.w)&&t.setEdge(a,e.edge(a))});var n={};function i(a){var o=e.parent(a);return o===void 0||t.hasNode(o)?(n[a]=o,o):o in n?n[o]:i(o)}return this._isCompound&&dt.each(t.nodes(),function(a){t.setParent(a,i(a))}),t},xr.prototype.setDefaultEdgeLabel=function(r){return dt.isFunction(r)||(r=dt.constant(r)),this._defaultEdgeLabelFn=r,this},xr.prototype.edgeCount=function(){return this._edgeCount},xr.prototype.edges=function(){return dt.values(this._edgeObjs)},xr.prototype.setPath=function(r,t){var e=this,n=arguments;return dt.reduce(r,function(i,a){return n.length>1?e.setEdge(i,a,t):e.setEdge(i,a),a}),this},xr.prototype.setEdge=function(){var r,t,e,n,i=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(r=a.v,t=a.w,e=a.name,arguments.length===2&&(n=arguments[1],i=!0)):(r=a,t=arguments[1],e=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),r=""+r,t=""+t,dt.isUndefined(e)||(e=""+e);var o=Vf(this._isDirected,r,t,e);if(dt.has(this._edgeLabels,o))return i&&(this._edgeLabels[o]=n),this;if(!dt.isUndefined(e)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(t),this._edgeLabels[o]=i?n:this._defaultEdgeLabelFn(r,t,e);var s=_oe(this._isDirected,r,t,e);return r=s.v,t=s.w,Object.freeze(s),this._edgeObjs[o]=s,gM(this._preds[t],r),gM(this._sucs[r],t),this._in[t][o]=s,this._out[r][o]=s,this._edgeCount++,this},xr.prototype.edge=function(r,t,e){var n=arguments.length===1?ay(this._isDirected,arguments[0]):Vf(this._isDirected,r,t,e);return this._edgeLabels[n]},xr.prototype.hasEdge=function(r,t,e){var n=arguments.length===1?ay(this._isDirected,arguments[0]):Vf(this._isDirected,r,t,e);return dt.has(this._edgeLabels,n)},xr.prototype.removeEdge=function(r,t,e){var n=arguments.length===1?ay(this._isDirected,arguments[0]):Vf(this._isDirected,r,t,e),i=this._edgeObjs[n];return i&&(r=i.v,t=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],yM(this._preds[t],r),yM(this._sucs[r],t),delete this._in[t][n],delete this._out[r][n],this._edgeCount--),this},xr.prototype.inEdges=function(r,t){var e=this._in[r];if(e){var n=dt.values(e);return t?dt.filter(n,function(i){return i.v===t}):n}},xr.prototype.outEdges=function(r,t){var e=this._out[r];if(e){var n=dt.values(e);return t?dt.filter(n,function(i){return i.w===t}):n}},xr.prototype.nodeEdges=function(r,t){var e=this.inEdges(r,t);if(e)return e.concat(this.outEdges(r,t))};var mM={Graph:fx,version:"2.1.8"},Soe={write:function(r){var t={options:{directed:r.isDirected(),multigraph:r.isMultigraph(),compound:r.isCompound()},nodes:Moe(r),edges:Coe(r)};return dt.isUndefined(r.graph())||(t.value=dt.clone(r.graph())),t},read:function(r){var t=new fx(r.options).setGraph(r.value);return dt.each(r.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),dt.each(r.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}};function Moe(r){return dt.map(r.nodes(),function(t){var e=r.node(t),n=r.parent(t),i={v:t};return dt.isUndefined(e)||(i.value=e),dt.isUndefined(n)||(i.parent=n),i})}function Coe(r){return dt.map(r.edges(),function(t){var e=r.edge(t),n={v:t.v,w:t.w};return dt.isUndefined(t.name)||(n.name=t.name),dt.isUndefined(e)||(n.value=e),n})}var Aoe=function(r){var t,e={},n=[];function i(a){dt.has(e,a)||(e[a]=!0,t.push(a),dt.each(r.successors(a),i),dt.each(r.predecessors(a),i))}return dt.each(r.nodes(),function(a){t=[],i(a),t.length&&n.push(t)}),n},ON=Vi;function Vi(){this._arr=[],this._keyIndices={}}Vi.prototype.size=function(){return this._arr.length},Vi.prototype.keys=function(){return this._arr.map(function(r){return r.key})},Vi.prototype.has=function(r){return dt.has(this._keyIndices,r)},Vi.prototype.priority=function(r){var t=this._keyIndices[r];if(t!==void 0)return this._arr[t].priority},Vi.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},Vi.prototype.add=function(r,t){var e=this._keyIndices;if(r=String(r),!dt.has(e,r)){var n=this._arr,i=n.length;return e[r]=i,n.push({key:r,priority:t}),this._decrease(i),!0}return!1},Vi.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},Vi.prototype.decrease=function(r,t){var e=this._keyIndices[r];if(t>this._arr[e].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[e].priority+" New: "+t);this._arr[e].priority=t,this._decrease(e)},Vi.prototype._heapify=function(r){var t=this._arr,e=2*r,n=e+1,i=r;e<t.length&&(i=t[e].priority<t[i].priority?e:i,n<t.length&&(i=t[n].priority<t[i].priority?n:i),i!==r&&(this._swap(r,i),this._heapify(i)))},Vi.prototype._decrease=function(r){for(var t,e=this._arr,n=e[r].priority;r!==0&&!(e[t=r>>1].priority<n);)this._swap(r,t),r=t},Vi.prototype._swap=function(r,t){var e=this._arr,n=this._keyIndices,i=e[r],a=e[t];e[r]=a,e[t]=i,n[a.key]=r,n[i.key]=t};var LN=function(r,t,e,n){return function(i,a,o,s){var u,l,f={},c=new ON,d=function(h){var v=h.v!==u?h.v:h.w,p=f[v],g=o(h),y=l.distance+g;if(g<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+h+" Weight: "+g);y<p.distance&&(p.distance=y,p.predecessor=u,c.decrease(v,y))};for(i.nodes().forEach(function(h){var v=h===a?0:Number.POSITIVE_INFINITY;f[h]={distance:v},c.add(h,v)});c.size()>0&&(u=c.removeMin(),(l=f[u]).distance!==Number.POSITIVE_INFINITY);)s(u).forEach(d);return f}(r,String(t),e||Toe,n||function(i){return r.outEdges(i)})},Toe=dt.constant(1),Ioe=function(r,t,e){return dt.transform(r.nodes(),function(n,i){n[i]=LN(r,i,t,e)},{})},kN=function(r){var t=0,e=[],n={},i=[];function a(o){var s=n[o]={onStack:!0,lowlink:t,index:t++};if(e.push(o),r.successors(o).forEach(function(f){dt.has(n,f)?n[f].onStack&&(s.lowlink=Math.min(s.lowlink,n[f].index)):(a(f),s.lowlink=Math.min(s.lowlink,n[f].lowlink))}),s.lowlink===s.index){var u,l=[];do u=e.pop(),n[u].onStack=!1,l.push(u);while(o!==u);i.push(l)}}return r.nodes().forEach(function(o){dt.has(n,o)||a(o)}),i},Ooe=function(r){return dt.filter(kN(r),function(t){return t.length>1||t.length===1&&r.hasEdge(t[0],t[0])})},Loe=function(r,t,e){return function(n,i,a){var o={},s=n.nodes();return s.forEach(function(u){o[u]={},o[u][u]={distance:0},s.forEach(function(l){u!==l&&(o[u][l]={distance:Number.POSITIVE_INFINITY})}),a(u).forEach(function(l){var f=l.v===u?l.w:l.v,c=i(l);o[u][f]={distance:c,predecessor:u}})}),s.forEach(function(u){var l=o[u];s.forEach(function(f){var c=o[f];s.forEach(function(d){var h=c[u],v=l[d],p=c[d],g=h.distance+v.distance;g<p.distance&&(p.distance=g,p.predecessor=v.predecessor)})})}),o}(r,t||koe,e||function(n){return r.outEdges(n)})},koe=dt.constant(1),oy=DN;function DN(r){var t={},e={},n=[];if(dt.each(r.sinks(),function i(a){if(dt.has(e,a))throw new Kv;dt.has(t,a)||(e[a]=!0,t[a]=!0,dt.each(r.predecessors(a),i),delete e[a],n.push(a))}),dt.size(t)!==r.nodeCount())throw new Kv;return n}function Kv(){}DN.CycleException=Kv,Kv.prototype=new Error;var bM=function(r,t,e){dt.isArray(t)||(t=[t]);var n=(r.isDirected()?r.successors:r.neighbors).bind(r),i=[],a={};return dt.each(t,function(o){if(!r.hasNode(o))throw new Error("Graph does not have node: "+o);NN(r,o,e==="post",a,n,i)}),i};function NN(r,t,e,n,i,a){dt.has(n,t)||(n[t]=!0,e||a.push(t),dt.each(i(t),function(o){NN(r,o,e,n,i,a)}),e&&a.push(t))}var qv,Doe={Graph:mM.Graph,json:Soe,alg:{components:Aoe,dijkstra:LN,dijkstraAll:Ioe,findCycles:Ooe,floydWarshall:Loe,isAcyclic:function(r){try{oy(r)}catch(t){if(t instanceof oy.CycleException)return!1;throw t}return!0},postorder:function(r,t){return bM(r,t,"post")},preorder:function(r,t){return bM(r,t,"pre")},prim:function(r,t){var e,n=new fx,i={},a=new ON;function o(u){var l=u.v===e?u.w:u.v,f=a.priority(l);if(f!==void 0){var c=t(u);c<f&&(i[l]=e,a.decrease(l,c))}}if(r.nodeCount()===0)return n;dt.each(r.nodes(),function(u){a.add(u,Number.POSITIVE_INFINITY),n.setNode(u)}),a.decrease(r.nodes()[0],0);for(var s=!1;a.size()>0;){if(e=a.removeMin(),dt.has(i,e))n.setEdge(e,i[e]);else{if(s)throw new Error("Input graph is not connected: "+r);s=!0}r.nodeEdges(e).forEach(o)}return n},tarjan:kN,topsort:oy},version:mM.version};try{qv=Doe}catch{}qv||(qv=window.graphlib);var _a=qv,Noe=function(r){return rN(r,5)},Ic=function(r,t,e){if(!Si(e))return!1;var n=typeof t;return!!(n=="number"?Go(e)&&Qp(t,e.length):n=="string"&&t in e)&&Zl(e[t],r)},PN=Object.prototype,Poe=PN.hasOwnProperty,Roe=ag(function(r,t){r=Object(r);var e=-1,n=t.length,i=n>2?t[2]:void 0;for(i&&Ic(t[0],t[1],i)&&(n=1);++e<n;)for(var a=t[e],o=Cu(a),s=-1,u=o.length;++s<u;){var l=o[s],f=r[l];(f===void 0||Zl(f,PN[l])&&!Poe.call(r,l))&&(r[l]=a[l])}return r}),Boe=function(r){return function(t,e,n){var i=Object(t);if(!Go(t)){var a=$o(e);t=Is(t),e=function(s){return a(i[s],s,i)}}var o=r(t,e,n);return o>-1?i[a?t[o]:o]:void 0}},Foe=/^\s+|\s+$/g,zoe=/^[-+]0x[0-9a-f]+$/i,Goe=/^0b[01]+$/i,$oe=/^0o[0-7]+$/i,Uoe=parseInt,joe=function(r){if(typeof r=="number")return r;if(xu(r))return NaN;if(Si(r)){var t=typeof r.valueOf=="function"?r.valueOf():r;r=Si(t)?t+"":t}if(typeof r!="string")return r===0?r:+r;r=r.replace(Foe,"");var e=Goe.test(r);return e||$oe.test(r)?Uoe(r.slice(2),e?2:8):zoe.test(r)?NaN:+r},ov=function(r){return r?(r=joe(r))===1/0||r===-1/0?17976931348623157e292*(r<0?-1:1):r==r?r:0:r===0?r:0},Woe=function(r){var t=ov(r),e=t%1;return t==t?e?t-e:t:0},Xoe=Math.max,Yoe=Boe(function(r,t,e){var n=r==null?0:r.length;if(!n)return-1;var i=e==null?0:Woe(e);return i<0&&(i=Xoe(n+i,0)),AN(r,$o(t),i)}),RN=function(r){return r!=null&&r.length?lx(r,1):[]},Voe=function(r,t){return r==null?r:ix(r,nN(t),Cu)},Hoe=function(r){var t=r==null?0:r.length;return t?r[t-1]:void 0},Koe=function(r,t){var e={};return t=$o(t),ax(r,function(n,i,a){qp(e,i,t(n,i,a))}),e},cx=function(r,t,e){for(var n=-1,i=r.length;++n<i;){var a=r[n],o=t(a);if(o!=null&&(s===void 0?o==o&&!xu(o):e(o,s)))var s=o,u=a}return u},qoe=function(r,t){return r>t},Zoe=function(r){return r&&r.length?cx(r,Au,qoe):void 0},Xm=function(r,t,e){(e!==void 0&&!Zl(r[t],e)||e===void 0&&!(t in r))&&qp(r,t,e)},Qoe=Function.prototype,Joe=Object.prototype,BN=Qoe.toString,ese=Joe.hasOwnProperty,tse=BN.call(Object),rse=function(r){if(!ya(r)||Ts(r)!="[object Object]")return!1;var t=tg(r);if(t===null)return!0;var e=ese.call(t,"constructor")&&t.constructor;return typeof e=="function"&&e instanceof e&&BN.call(e)==tse},Ym=function(r,t){if((t!=="constructor"||typeof r[t]!="function")&&t!="__proto__")return r[t]},nse=function(r){return rd(r,Cu(r))},ise=function(r,t,e,n,i,a,o){var s=Ym(r,e),u=Ym(t,e),l=o.get(u);if(l)Xm(r,e,l);else{var f=a?a(s,u,e+"",r,t,o):void 0,c=f===void 0;if(c){var d=dn(u),h=!d&&mu(u),v=!d&&!h&&nd(u);f=u,d||h||v?dn(s)?f=s:TN(s)?f=HD(s):h?(c=!1,f=VD(u,!0)):v?(c=!1,f=JD(u,!0)):f=[]:rse(u)||$l(u)?(f=s,$l(s)?f=nse(s):Si(s)&&!td(s)||(f=tN(u))):c=!1}c&&(o.set(u,f),i(f,u,n,a,o),o.delete(u)),Xm(r,e,f)}},ase=function r(t,e,n,i,a){t!==e&&ix(e,function(o,s){if(a||(a=new Sl),Si(o))ise(t,e,s,n,r,i,a);else{var u=i?i(Ym(t,s),o,s+"",t,e,a):void 0;u===void 0&&(u=o),Xm(t,s,u)}},Cu)},ose=function(r){return ag(function(t,e){var n=-1,i=e.length,a=i>1?e[i-1]:void 0,o=i>2?e[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,o&&Ic(e[0],e[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=e[n];s&&r(t,s,n,a)}return t})}(function(r,t,e){ase(r,t,e)}),FN=function(r,t){return r<t},sse=function(r){return r&&r.length?cx(r,Au,FN):void 0},use=function(r,t){return r&&r.length?cx(r,$o(t),FN):void 0},lse=function(){return Ea.Date.now()},fse=function(r,t,e,n){if(!Si(r))return r;for(var i=-1,a=(t=ng(t,r)).length,o=a-1,s=r;s!=null&&++i<a;){var u=id(t[i]),l=e;if(u==="__proto__"||u==="constructor"||u==="prototype")return r;if(i!=o){var f=s[u];(l=n?n(f,u,s):void 0)===void 0&&(l=Si(f)?f:Qp(t[i+1])?[]:{})}Zp(s,u,l),s=s[u]}return r},cse=function(r,t,e){for(var n=-1,i=t.length,a={};++n<i;){var o=t[n],s=ig(r,o);e(s,o)&&fse(a,ng(o,r),s)}return a},dse=function(r,t){return cse(r,t,function(e,n){return vN(r,n)})},hse=function(r){return CN(MN(r,void 0,RN),r+"")}(function(r,t){return r==null?{}:dse(r,t)}),vse=Math.ceil,pse=Math.max,gse=function(r,t,e,n){for(var i=-1,a=pse(vse((t-r)/(e||1)),0),o=Array(a);a--;)o[n?a:++i]=r,r+=e;return o},yse=function(r){return function(t,e,n){return n&&typeof n!="number"&&Ic(t,e,n)&&(e=n=void 0),t=ov(t),e===void 0?(e=t,t=0):e=ov(e),n=n===void 0?t<e?1:-1:ov(n),gse(t,e,n,r)}}(),mse=function(r,t){var e=r.length;for(r.sort(t);e--;)r[e]=r[e].value;return r},bse=function(r,t){if(r!==t){var e=r!==void 0,n=r===null,i=r==r,a=xu(r),o=t!==void 0,s=t===null,u=t==t,l=xu(t);if(!s&&!l&&!a&&r>t||a&&o&&u&&!s&&!l||n&&o&&u||!e&&u||!i)return 1;if(!n&&!a&&!l&&r<t||l&&e&&i&&!n&&!a||s&&e&&i||!o&&i||!u)return-1}return 0},xse=function(r,t,e){for(var n=-1,i=r.criteria,a=t.criteria,o=i.length,s=e.length;++n<o;){var u=bse(i[n],a[n]);if(u)return n>=s?u:u*(e[n]=="desc"?-1:1)}return r.index-t.index},wse=function(r,t,e){t=t.length?Cl(t,function(a){return dn(a)?function(o){return ig(o,a.length===1?a[0]:a)}:a}):[Au];var n=-1;t=Cl(t,Jp($o));var i=bN(r,function(a,o,s){return{criteria:Cl(t,function(u){return u(a)}),index:++n,value:a}});return mse(i,function(a,o){return xse(a,o,e)})},Ese=ag(function(r,t){if(r==null)return[];var e=t.length;return e>1&&Ic(r,t[0],t[1])?t=[]:e>2&&Ic(t[0],t[1],t[2])&&(t=[t[0]]),wse(r,lx(t,1),[])}),_se=0,Sse=function(r){var t=++_se;return dN(r)+t},Mse=function(r,t,e){for(var n=-1,i=r.length,a=t.length,o={};++n<i;){var s=n<a?t[n]:void 0;e(o,r[n],s)}return o},Zv,Cse=function(r,t){return Mse(r||[],t||[],Zp)};try{Zv={cloneDeep:Noe,constant:nx,defaults:Roe,each:aN,filter:gN,find:Yoe,flatten:RN,forEach:iN,forIn:Voe,has:yN,isUndefined:mN,last:Hoe,map:xN,mapValues:Koe,max:Zoe,merge:ose,min:sse,minBy:use,now:lse,pick:hse,range:yse,reduce:wN,sortBy:Ese,uniqueId:Sse,values:IN,zipObject:Cse}}catch{}Zv||(Zv=window._);var Q=Zv,Ase=sv;function sv(){var r={};r._next=r._prev=r,this._sentinel=r}function xM(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function Tse(r,t){if(r!=="_next"&&r!=="_prev")return t}sv.prototype.dequeue=function(){var r=this._sentinel,t=r._prev;if(t!==r)return xM(t),t},sv.prototype.enqueue=function(r){var t=this._sentinel;r._prev&&r._next&&xM(r),r._next=t._next,t._next._prev=r,t._next=r,r._prev=t},sv.prototype.toString=function(){for(var r=[],t=this._sentinel,e=t._prev;e!==t;)r.push(JSON.stringify(e,Tse)),e=e._prev;return"["+r.join(", ")+"]"};var Ise=_a.Graph,Ose=function(r,t){if(r.nodeCount()<=1)return[];var e=function(i,a){var o=new Ise,s=0,u=0;Q.forEach(i.nodes(),function(c){o.setNode(c,{v:c,in:0,out:0})}),Q.forEach(i.edges(),function(c){var d=o.edge(c.v,c.w)||0,h=a(c),v=d+h;o.setEdge(c.v,c.w,v),u=Math.max(u,o.node(c.v).out+=h),s=Math.max(s,o.node(c.w).in+=h)});var l=Q.range(u+s+3).map(function(){return new Ase}),f=s+1;return Q.forEach(o.nodes(),function(c){Vm(l,f,o.node(c))}),{graph:o,buckets:l,zeroIdx:f}}(r,t||Lse),n=function(i,a,o){for(var s,u=[],l=a[a.length-1],f=a[0];i.nodeCount();){for(;s=f.dequeue();)sy(i,a,o,s);for(;s=l.dequeue();)sy(i,a,o,s);if(i.nodeCount()){for(var c=a.length-2;c>0;--c)if(s=a[c].dequeue()){u=u.concat(sy(i,a,o,s,!0));break}}}return u}(e.graph,e.buckets,e.zeroIdx);return Q.flatten(Q.map(n,function(i){return r.outEdges(i.v,i.w)}),!0)},Lse=Q.constant(1);function sy(r,t,e,n,i){var a=i?[]:void 0;return Q.forEach(r.inEdges(n.v),function(o){var s=r.edge(o),u=r.node(o.v);i&&a.push({v:o.v,w:o.w}),u.out-=s,Vm(t,e,u)}),Q.forEach(r.outEdges(n.v),function(o){var s=r.edge(o),u=o.w,l=r.node(u);l.in-=s,Vm(t,e,l)}),r.removeNode(n.v),a}function Vm(r,t,e){e.out?e.in?r[e.out-e.in+t].enqueue(e):r[r.length-1].enqueue(e):r[0].enqueue(e)}var wM={run:function(r){var t=r.graph().acyclicer==="greedy"?Ose(r,function(e){return function(n){return e.edge(n).weight}}(r)):function(e){var n=[],i={},a={};function o(s){Q.has(a,s)||(a[s]=!0,i[s]=!0,Q.forEach(e.outEdges(s),function(u){Q.has(i,u.w)?n.push(u):o(u.w)}),delete i[s])}return Q.forEach(e.nodes(),o),n}(r);Q.forEach(t,function(e){var n=r.edge(e);r.removeEdge(e),n.forwardName=e.name,n.reversed=!0,r.setEdge(e.w,e.v,n,Q.uniqueId("rev"))})},undo:function(r){Q.forEach(r.edges(),function(t){var e=r.edge(t);if(e.reversed){r.removeEdge(t);var n=e.forwardName;delete e.reversed,delete e.forwardName,r.setEdge(t.w,t.v,e,n)}})}},EM=_a.Graph,Xn={addDummyNode:_M,simplify:function(r){var t=new EM().setGraph(r.graph());return Q.forEach(r.nodes(),function(e){t.setNode(e,r.node(e))}),Q.forEach(r.edges(),function(e){var n=t.edge(e.v,e.w)||{weight:0,minlen:1},i=r.edge(e);t.setEdge(e.v,e.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),t},asNonCompoundGraph:function(r){var t=new EM({multigraph:r.isMultigraph()}).setGraph(r.graph());return Q.forEach(r.nodes(),function(e){r.children(e).length||t.setNode(e,r.node(e))}),Q.forEach(r.edges(),function(e){t.setEdge(e,r.edge(e))}),t},successorWeights:function(r){var t=Q.map(r.nodes(),function(e){var n={};return Q.forEach(r.outEdges(e),function(i){n[i.w]=(n[i.w]||0)+r.edge(i).weight}),n});return Q.zipObject(r.nodes(),t)},predecessorWeights:function(r){var t=Q.map(r.nodes(),function(e){var n={};return Q.forEach(r.inEdges(e),function(i){n[i.v]=(n[i.v]||0)+r.edge(i).weight}),n});return Q.zipObject(r.nodes(),t)},intersectRect:function(r,t){var e,n,i=r.x,a=r.y,o=t.x-i,s=t.y-a,u=r.width/2,l=r.height/2;if(!o&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(o)*l?(s<0&&(l=-l),e=l*o/s,n=l):(o<0&&(u=-u),e=u,n=u*s/o),{x:i+e,y:a+n}},buildLayerMatrix:function(r){var t=Q.map(Q.range(SM(r)+1),function(){return[]});return Q.forEach(r.nodes(),function(e){var n=r.node(e),i=n.rank;Q.isUndefined(i)||(t[i][n.order]=e)}),t},normalizeRanks:function(r){var t=Q.min(Q.map(r.nodes(),function(e){return r.node(e).rank}));Q.forEach(r.nodes(),function(e){var n=r.node(e);Q.has(n,"rank")&&(n.rank-=t)})},removeEmptyRanks:function(r){var t=Q.min(Q.map(r.nodes(),function(a){return r.node(a).rank})),e=[];Q.forEach(r.nodes(),function(a){var o=r.node(a).rank-t;e[o]||(e[o]=[]),e[o].push(a)});var n=0,i=r.graph().nodeRankFactor;Q.forEach(e,function(a,o){Q.isUndefined(a)&&o%i!=0?--n:n&&Q.forEach(a,function(s){r.node(s).rank+=n})})},addBorderNode:function(r,t,e,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=e,i.order=n),_M(r,"border",i,t)},maxRank:SM,partition:function(r,t){var e={lhs:[],rhs:[]};return Q.forEach(r,function(n){t(n)?e.lhs.push(n):e.rhs.push(n)}),e},time:function(r,t){var e=Q.now();try{return t()}finally{console.log(r+" time: "+(Q.now()-e)+"ms")}},notime:function(r,t){return t()}};function _M(r,t,e,n){var i;do i=Q.uniqueId(n);while(r.hasNode(i));return e.dummy=t,r.setNode(i,e),i}function SM(r){return Q.max(Q.map(r.nodes(),function(t){var e=r.node(t).rank;if(!Q.isUndefined(e))return e}))}var MM={run:function(r){r.graph().dummyChains=[],Q.forEach(r.edges(),function(t){(function(e,n){var i,a,o,s=n.v,u=e.node(s).rank,l=n.w,f=e.node(l).rank,c=n.name,d=e.edge(n),h=d.labelRank;if(f!==u+1){for(e.removeEdge(n),o=0,++u;u<f;++o,++u)d.points=[],a={width:0,height:0,edgeLabel:d,edgeObj:n,rank:u},i=Xn.addDummyNode(e,"edge",a,"_d"),u===h&&(a.width=d.width,a.height=d.height,a.dummy="edge-label",a.labelpos=d.labelpos),e.setEdge(s,i,{weight:d.weight},c),o===0&&e.graph().dummyChains.push(i),s=i;e.setEdge(s,l,{weight:d.weight},c)}})(r,t)})},undo:function(r){Q.forEach(r.graph().dummyChains,function(t){var e,n=r.node(t),i=n.edgeLabel;for(r.setEdge(n.edgeObj,i);n.dummy;)e=r.successors(t)[0],r.removeNode(t),i.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height),t=e,n=r.node(t)})}},zN=function(r){var t={};Q.forEach(r.sources(),function e(n){var i=r.node(n);if(Q.has(t,n))return i.rank;t[n]=!0;var a=Q.min(Q.map(r.outEdges(n),function(o){return e(o.w)-r.edge(o).minlen}));return a!==Number.POSITIVE_INFINITY&&a!=null||(a=0),i.rank=a})},GN=function(r,t){return r.node(t.w).rank-r.node(t.v).rank-r.edge(t).minlen},kse=_a.Graph,Qv=GN,$N=function(r){var t,e,n=new kse({directed:!1}),i=r.nodes()[0],a=r.nodeCount();for(n.setNode(i,{});Dse(n,r)<a;)t=Nse(n,r),e=n.hasNode(t.v)?Qv(r,t):-Qv(r,t),Pse(n,r,e);return n};function Dse(r,t){return Q.forEach(r.nodes(),function e(n){Q.forEach(t.nodeEdges(n),function(i){var a=i.v,o=n===a?i.w:a;r.hasNode(o)||Qv(t,i)||(r.setNode(o,{}),r.setEdge(n,o,{}),e(o))})}),r.nodeCount()}function Nse(r,t){return Q.minBy(t.edges(),function(e){if(r.hasNode(e.v)!==r.hasNode(e.w))return Qv(t,e)})}function Pse(r,t,e){Q.forEach(r.nodes(),function(n){t.node(n).rank+=e})}var Rse=GN,Bse=zN,Fse=_a.alg.preorder,zse=_a.alg.postorder,Gse=Xn.simplify,$se=Zs;function Zs(r){r=Gse(r),Bse(r);var t,e=$N(r);for(hx(e),dx(e,r);t=WN(e);)YN(e,r,t,XN(e,r,t))}function dx(r,t){var e=zse(r,r.nodes());e=e.slice(0,e.length-1),Q.forEach(e,function(n){(function(i,a,o){var s=i.node(o).parent;i.edge(o,s).cutvalue=UN(i,a,o)})(r,t,n)})}function UN(r,t,e){var n=r.node(e).parent,i=!0,a=t.edge(e,n),o=0;return a||(i=!1,a=t.edge(n,e)),o=a.weight,Q.forEach(t.nodeEdges(e),function(s){var u,l,f=s.v===e,c=f?s.w:s.v;if(c!==n){var d=f===i,h=t.edge(s).weight;if(o+=d?h:-h,u=e,l=c,r.hasEdge(u,l)){var v=r.edge(e,c).cutvalue;o+=d?-v:v}}}),o}function hx(r,t){arguments.length<2&&(t=r.nodes()[0]),jN(r,{},1,t)}function jN(r,t,e,n,i){var a=e,o=r.node(n);return t[n]=!0,Q.forEach(r.neighbors(n),function(s){Q.has(t,s)||(e=jN(r,t,e,s,n))}),o.low=a,o.lim=e++,i?o.parent=i:delete o.parent,e}function WN(r){return Q.find(r.edges(),function(t){return r.edge(t).cutvalue<0})}function XN(r,t,e){var n=e.v,i=e.w;t.hasEdge(n,i)||(n=e.w,i=e.v);var a=r.node(n),o=r.node(i),s=a,u=!1;a.lim>o.lim&&(s=o,u=!0);var l=Q.filter(t.edges(),function(f){return u===CM(r,r.node(f.v),s)&&u!==CM(r,r.node(f.w),s)});return Q.minBy(l,function(f){return Rse(t,f)})}function YN(r,t,e,n){var i=e.v,a=e.w;r.removeEdge(i,a),r.setEdge(n.v,n.w,{}),hx(r),dx(r,t),function(o,s){var u=Q.find(o.nodes(),function(f){return!s.node(f).parent}),l=Fse(o,u);l=l.slice(1),Q.forEach(l,function(f){var c=o.node(f).parent,d=s.edge(f,c),h=!1;d||(d=s.edge(c,f),h=!0),s.node(f).rank=s.node(c).rank+(h?d.minlen:-d.minlen)})}(r,t)}function CM(r,t,e){return e.low<=t.lim&&t.lim<=e.lim}Zs.initLowLimValues=hx,Zs.initCutValues=dx,Zs.calcCutValue=UN,Zs.leaveEdge=WN,Zs.enterEdge=XN,Zs.exchangeEdges=YN;var VN=zN,Use=function(r){switch(r.graph().ranker){case"network-simplex":AM(r);break;case"tight-tree":(function(t){VN(t),$N(t)})(r);break;case"longest-path":jse(r);break;default:AM(r)}},jse=VN;function AM(r){$se(r)}var Wse=function(r){var t=function(e){var n={},i=0;function a(o){var s=i;Q.forEach(e.children(o),a),n[o]={low:s,lim:i++}}return Q.forEach(e.children(),a),n}(r);Q.forEach(r.graph().dummyChains,function(e){for(var n=r.node(e),i=n.edgeObj,a=function(c,d,h,v){var p,g,y=[],m=[],b=Math.min(d[h].low,d[v].low),x=Math.max(d[h].lim,d[v].lim);p=h;do p=c.parent(p),y.push(p);while(p&&(d[p].low>b||x>d[p].lim));for(g=p,p=v;(p=c.parent(p))!==g;)m.push(p);return{path:y.concat(m.reverse()),lca:g}}(r,t,i.v,i.w),o=a.path,s=a.lca,u=0,l=o[u],f=!0;e!==i.w;){if(n=r.node(e),f){for(;(l=o[u])!==s&&r.node(l).maxRank<n.rank;)u++;l===s&&(f=!1)}if(!f){for(;u<o.length-1&&r.node(l=o[u+1]).minRank<=n.rank;)u++;l=o[u]}r.setParent(e,l),e=r.successors(e)[0]}})},TM={run:function(r){var t=Xn.addDummyNode(r,"root",{},"_root"),e=function(o){var s={};function u(l,f){var c=o.children(l);c&&c.length&&Q.forEach(c,function(d){u(d,f+1)}),s[l]=f}return Q.forEach(o.children(),function(l){u(l,1)}),s}(r),n=Q.max(Q.values(e))-1,i=2*n+1;r.graph().nestingRoot=t,Q.forEach(r.edges(),function(o){r.edge(o).minlen*=i});var a=function(o){return Q.reduce(o.edges(),function(s,u){return s+o.edge(u).weight},0)}(r)+1;Q.forEach(r.children(),function(o){HN(r,t,i,a,n,e,o)}),r.graph().nodeRankFactor=i},cleanup:function(r){var t=r.graph();r.removeNode(t.nestingRoot),delete t.nestingRoot,Q.forEach(r.edges(),function(e){r.edge(e).nestingEdge&&r.removeEdge(e)})}};function HN(r,t,e,n,i,a,o){var s=r.children(o);if(s.length){var u=Xn.addBorderNode(r,"_bt"),l=Xn.addBorderNode(r,"_bb"),f=r.node(o);r.setParent(u,o),f.borderTop=u,r.setParent(l,o),f.borderBottom=l,Q.forEach(s,function(c){HN(r,t,e,n,i,a,c);var d=r.node(c),h=d.borderTop?d.borderTop:c,v=d.borderBottom?d.borderBottom:c,p=d.borderTop?n:2*n,g=h!==v?1:i-a[o]+1;r.setEdge(u,h,{weight:p,minlen:g,nestingEdge:!0}),r.setEdge(v,l,{weight:p,minlen:g,nestingEdge:!0})}),r.parent(o)||r.setEdge(t,u,{weight:0,minlen:i+a[o]})}else o!==t&&r.setEdge(t,o,{weight:0,minlen:e})}var Xse=function(r){Q.forEach(r.children(),function t(e){var n=r.children(e),i=r.node(e);if(n.length&&Q.forEach(n,t),Q.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)IM(r,"borderLeft","_bl",e,i,a),IM(r,"borderRight","_br",e,i,a)}})};function IM(r,t,e,n,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],u=Xn.addDummyNode(r,"border",o,e);i[t][a]=u,r.setParent(u,n),s&&r.setEdge(s,u,{weight:1})}var OM={adjust:function(r){var t=r.graph().rankdir.toLowerCase();t!=="lr"&&t!=="rl"||LM(r)},undo:function(r){var t=r.graph().rankdir.toLowerCase();t!=="bt"&&t!=="rl"||function(e){Q.forEach(e.nodes(),function(n){uy(e.node(n))}),Q.forEach(e.edges(),function(n){var i=e.edge(n);Q.forEach(i.points,uy),Q.has(i,"y")&&uy(i)})}(r),t!=="lr"&&t!=="rl"||(function(e){Q.forEach(e.nodes(),function(n){ly(e.node(n))}),Q.forEach(e.edges(),function(n){var i=e.edge(n);Q.forEach(i.points,ly),Q.has(i,"x")&&ly(i)})}(r),LM(r))}};function LM(r){Q.forEach(r.nodes(),function(t){kM(r.node(t))}),Q.forEach(r.edges(),function(t){kM(r.edge(t))})}function kM(r){var t=r.width;r.width=r.height,r.height=t}function uy(r){r.y=-r.y}function ly(r){var t=r.x;r.x=r.y,r.y=t}var Yse=function(r){var t={},e=Q.filter(r.nodes(),function(s){return!r.children(s).length}),n=Q.max(Q.map(e,function(s){return r.node(s).rank})),i=Q.map(Q.range(n+1),function(){return[]});function a(s){if(!Q.has(t,s)){t[s]=!0;var u=r.node(s);i[u.rank].push(s),Q.forEach(r.successors(s),a)}}var o=Q.sortBy(e,function(s){return r.node(s).rank});return Q.forEach(o,a),i},Vse=function(r,t){for(var e=0,n=1;n<t.length;++n)e+=Hse(r,t[n-1],t[n]);return e};function Hse(r,t,e){for(var n=Q.zipObject(e,Q.map(e,function(l,f){return f})),i=Q.flatten(Q.map(t,function(l){return Q.sortBy(Q.map(r.outEdges(l),function(f){return{pos:n[f.w],weight:r.edge(f).weight}}),"pos")}),!0),a=1;a<e.length;)a<<=1;var o=2*a-1;a-=1;var s=Q.map(new Array(o),function(){return 0}),u=0;return Q.forEach(i.forEach(function(l){var f=l.pos+a;s[f]+=l.weight;for(var c=0;f>0;)f%2&&(c+=s[f+1]),s[f=f-1>>1]+=l.weight;u+=l.weight*c})),u}var Kse=function(r,t){return Q.map(t,function(e){var n=r.inEdges(e);if(n.length){var i=Q.reduce(n,function(a,o){var s=r.edge(o),u=r.node(o.v);return{sum:a.sum+s.weight*u.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}})},qse=function(r,t){var e={};return Q.forEach(r,function(n,i){var a=e[n.v]={indegree:0,in:[],out:[],vs:[n.v],i};Q.isUndefined(n.barycenter)||(a.barycenter=n.barycenter,a.weight=n.weight)}),Q.forEach(t.edges(),function(n){var i=e[n.v],a=e[n.w];Q.isUndefined(i)||Q.isUndefined(a)||(a.indegree++,i.out.push(e[n.w]))}),function(n){var i=[];function a(u){return function(l){l.merged||(Q.isUndefined(l.barycenter)||Q.isUndefined(u.barycenter)||l.barycenter>=u.barycenter)&&function(f,c){var d=0,h=0;f.weight&&(d+=f.barycenter*f.weight,h+=f.weight),c.weight&&(d+=c.barycenter*c.weight,h+=c.weight),f.vs=c.vs.concat(f.vs),f.barycenter=d/h,f.weight=h,f.i=Math.min(c.i,f.i),c.merged=!0}(u,l)}}function o(u){return function(l){l.in.push(u),--l.indegree==0&&n.push(l)}}for(;n.length;){var s=n.pop();i.push(s),Q.forEach(s.in.reverse(),a(s)),Q.forEach(s.out,o(s))}return Q.map(Q.filter(i,function(u){return!u.merged}),function(u){return Q.pick(u,["vs","i","barycenter","weight"])})}(Q.filter(e,function(n){return!n.indegree}))},Zse=function(r,t){var e=Xn.partition(r,function(c){return Q.has(c,"barycenter")}),n=e.lhs,i=Q.sortBy(e.rhs,function(c){return-c.i}),a=[],o=0,s=0,u=0;n.sort((l=!!t,function(c,d){return c.barycenter<d.barycenter?-1:c.barycenter>d.barycenter?1:l?d.i-c.i:c.i-d.i})),u=DM(a,i,u),Q.forEach(n,function(c){u+=c.vs.length,a.push(c.vs),o+=c.barycenter*c.weight,s+=c.weight,u=DM(a,i,u)});var l,f={vs:Q.flatten(a,!0)};return s&&(f.barycenter=o/s,f.weight=s),f};function DM(r,t,e){for(var n;t.length&&(n=Q.last(t)).i<=e;)t.pop(),r.push(n.vs),e++;return e}var Qse=function r(t,e,n,i){var a=t.children(e),o=t.node(e),s=o?o.borderLeft:void 0,u=o?o.borderRight:void 0,l={};s&&(a=Q.filter(a,function(p){return p!==s&&p!==u}));var f=Kse(t,a);Q.forEach(f,function(p){if(t.children(p.v).length){var g=r(t,p.v,n,i);l[p.v]=g,Q.has(g,"barycenter")&&(y=p,m=g,Q.isUndefined(y.barycenter)?(y.barycenter=m.barycenter,y.weight=m.weight):(y.barycenter=(y.barycenter*y.weight+m.barycenter*m.weight)/(y.weight+m.weight),y.weight+=m.weight))}var y,m});var c=qse(f,n);(function(p,g){Q.forEach(p,function(y){y.vs=Q.flatten(y.vs.map(function(m){return g[m]?g[m].vs:m}),!0)})})(c,l);var d=Zse(c,i);if(s&&(d.vs=Q.flatten([s,d.vs,u],!0),t.predecessors(s).length)){var h=t.node(t.predecessors(s)[0]),v=t.node(t.predecessors(u)[0]);Q.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+v.order)/(d.weight+2),d.weight+=2}return d},Jse=_a.Graph,eue=function(r,t,e){var n=function(a){for(var o;a.hasNode(o=Q.uniqueId("_root")););return o}(r),i=new Jse({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return r.node(a)});return Q.forEach(r.nodes(),function(a){var o=r.node(a),s=r.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||n),Q.forEach(r[e](a),function(u){var l=u.v===a?u.w:u.v,f=i.edge(l,a),c=Q.isUndefined(f)?0:f.weight;i.setEdge(l,a,{weight:r.edge(u).weight+c})}),Q.has(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i},tue=function(r,t,e){var n,i={};Q.forEach(e,function(a){for(var o,s,u=r.parent(a);u;){if((o=r.parent(u))?(s=i[o],i[o]=u):(s=n,n=u),s&&s!==u)return void t.setEdge(s,u);u=o}})},rue=_a.Graph,nue=function(r){var t=Xn.maxRank(r),e=NM(r,Q.range(1,t+1),"inEdges"),n=NM(r,Q.range(t-1,-1,-1),"outEdges"),i=Yse(r);PM(r,i);for(var a,o=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){iue(s%2?e:n,s%4>=2),i=Xn.buildLayerMatrix(r);var l=Vse(r,i);l<o&&(u=0,a=Q.cloneDeep(i),o=l)}PM(r,a)};function NM(r,t,e){return Q.map(t,function(n){return eue(r,n,e)})}function iue(r,t){var e=new rue;Q.forEach(r,function(n){var i=n.graph().root,a=Qse(n,i,e,t);Q.forEach(a.vs,function(o,s){n.node(o).order=s}),tue(n,e,a.vs)})}function PM(r,t){Q.forEach(t,function(e){Q.forEach(e,function(n,i){r.node(n).order=i})})}var aue=_a.Graph,oue=function(r){var t,e=Xn.buildLayerMatrix(r),n=Q.merge(sue(r,e),uue(r,e)),i={};Q.forEach(["u","d"],function(o){t=o==="u"?e:Q.values(e).reverse(),Q.forEach(["l","r"],function(s){s==="r"&&(t=Q.map(t,function(c){return Q.values(c).reverse()}));var u=(o==="u"?r.predecessors:r.successors).bind(r),l=fue(r,t,n,u),f=cue(r,t,l.root,l.align,s==="r");s==="r"&&(f=Q.mapValues(f,function(c){return-c})),i[o+s]=f})});var a=due(r,i);return hue(i,a),vue(i,r.graph().align)};function sue(r,t){var e={};return Q.reduce(t,function(n,i){var a=0,o=0,s=n.length,u=Q.last(i);return Q.forEach(i,function(l,f){var c=function(h,v){if(h.node(v).dummy)return Q.find(h.predecessors(v),function(p){return h.node(p).dummy})}(r,l),d=c?r.node(c).order:s;(c||l===u)&&(Q.forEach(i.slice(o,f+1),function(h){Q.forEach(r.predecessors(h),function(v){var p=r.node(v),g=p.order;!(g<a||d<g)||p.dummy&&r.node(h).dummy||KN(e,v,h)})}),o=f+1,a=d)}),i}),e}function uue(r,t){var e={};function n(i,a,o,s,u){var l;Q.forEach(Q.range(a,o),function(f){l=i[f],r.node(l).dummy&&Q.forEach(r.predecessors(l),function(c){var d=r.node(c);d.dummy&&(d.order<s||d.order>u)&&KN(e,c,l)})})}return Q.reduce(t,function(i,a){var o,s=-1,u=0;return Q.forEach(a,function(l,f){if(r.node(l).dummy==="border"){var c=r.predecessors(l);c.length&&(o=r.node(c[0]).order,n(a,u,f,s,o),u=f,s=o)}n(a,u,a.length,o,i.length)}),a}),e}function KN(r,t,e){if(t>e){var n=t;t=e,e=n}var i=r[t];i||(r[t]=i={}),i[e]=!0}function lue(r,t,e){if(t>e){var n=t;t=e,e=n}return Q.has(r[t],e)}function fue(r,t,e,n){var i={},a={},o={};return Q.forEach(t,function(s){Q.forEach(s,function(u,l){i[u]=u,a[u]=u,o[u]=l})}),Q.forEach(t,function(s){var u=-1;Q.forEach(s,function(l){var f=n(l);if(f.length)for(var c=((f=Q.sortBy(f,function(p){return o[p]})).length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var v=f[d];a[l]===l&&u<o[v]&&!lue(e,l,v)&&(a[v]=l,a[l]=i[l]=i[v],u=o[v])}})}),{root:i,align:a}}function cue(r,t,e,n,i){var a={},o=function(l,f,c,d){var h=new aue,v=l.graph(),p=function(g,y,m){return function(b,x,w){var E,_=b.node(x),M=b.node(w),C=0;if(C+=_.width/2,Q.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":E=-_.width/2;break;case"r":E=_.width/2}if(E&&(C+=m?E:-E),E=0,C+=(_.dummy?y:g)/2,C+=(M.dummy?y:g)/2,C+=M.width/2,Q.has(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":E=M.width/2;break;case"r":E=-M.width/2}return E&&(C+=m?E:-E),E=0,C}}(v.nodesep,v.edgesep,d);return Q.forEach(f,function(g){var y;Q.forEach(g,function(m){var b=c[m];if(h.setNode(b),y){var x=c[y],w=h.edge(x,b);h.setEdge(x,b,Math.max(p(l,m,y),w||0))}y=m})}),h}(r,t,e,i),s=i?"borderLeft":"borderRight";function u(l,f){for(var c=o.nodes(),d=c.pop(),h={};d;)h[d]?l(d):(h[d]=!0,c.push(d),c=c.concat(f(d))),d=c.pop()}return u(function(l){a[l]=o.inEdges(l).reduce(function(f,c){return Math.max(f,a[c.v]+o.edge(c))},0)},o.predecessors.bind(o)),u(function(l){var f=o.outEdges(l).reduce(function(d,h){return Math.min(d,a[h.w]-o.edge(h))},Number.POSITIVE_INFINITY),c=r.node(l);f!==Number.POSITIVE_INFINITY&&c.borderType!==s&&(a[l]=Math.max(a[l],f))},o.successors.bind(o)),Q.forEach(n,function(l){a[l]=a[e[l]]}),a}function due(r,t){return Q.minBy(Q.values(t),function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return Q.forIn(e,function(a,o){var s=function(u,l){return u.node(l).width}(r,o)/2;n=Math.max(a+s,n),i=Math.min(a-s,i)}),n-i})}function hue(r,t){var e=Q.values(t),n=Q.min(e),i=Q.max(e);Q.forEach(["u","d"],function(a){Q.forEach(["l","r"],function(o){var s,u=a+o,l=r[u];if(l!==t){var f=Q.values(l);(s=o==="l"?n-Q.min(f):i-Q.max(f))&&(r[u]=Q.mapValues(l,function(c){return c+s}))}})})}function vue(r,t){return Q.mapValues(r.ul,function(e,n){if(t)return r[t.toLowerCase()][n];var i=Q.sortBy(Q.map(r,n));return(i[1]+i[2])/2})}var pue=oue,gue=function(r){(function(t){var e=Xn.buildLayerMatrix(t),n=t.graph().ranksep,i=0;Q.forEach(e,function(a){var o=Q.max(Q.map(a,function(s){return t.node(s).height}));Q.forEach(a,function(s){t.node(s).y=i+o/2}),i+=o+n})})(r=Xn.asNonCompoundGraph(r)),Q.forEach(pue(r),function(t,e){r.node(e).x=t})},yue=Xn.normalizeRanks,mue=Xn.removeEmptyRanks,Qo=Xn,bue=_a.Graph,xue=function(r,t){var e=t&&t.debugTiming?Qo.time:Qo.notime;e("layout",function(){var n=e(" buildLayoutGraph",function(){return function(i){var a=new bue({multigraph:!0,compound:!0}),o=cy(i.graph());return a.setGraph(Q.merge({},Eue,fy(o,wue),Q.pick(o,_ue))),Q.forEach(i.nodes(),function(s){var u=cy(i.node(s));a.setNode(s,Q.defaults(fy(u,Sue),Mue)),a.setParent(s,i.parent(s))}),Q.forEach(i.edges(),function(s){var u=cy(i.edge(s));a.setEdge(s,Q.merge({},Aue,fy(u,Cue),Q.pick(u,Tue)))}),a}(r)});e(" runLayout",function(){(function(i,a){a(" makeSpaceForEdgeLabels",function(){(function(o){var s=o.graph();s.ranksep/=2,Q.forEach(o.edges(),function(u){var l=o.edge(u);l.minlen*=2,l.labelpos.toLowerCase()!=="c"&&(s.rankdir==="TB"||s.rankdir==="BT"?l.width+=l.labeloffset:l.height+=l.labeloffset)})})(i)}),a(" removeSelfEdges",function(){(function(o){Q.forEach(o.edges(),function(s){if(s.v===s.w){var u=o.node(s.v);u.selfEdges||(u.selfEdges=[]),u.selfEdges.push({e:s,label:o.edge(s)}),o.removeEdge(s)}})})(i)}),a(" acyclic",function(){wM.run(i)}),a(" nestingGraph.run",function(){TM.run(i)}),a(" rank",function(){Use(Qo.asNonCompoundGraph(i))}),a(" injectEdgeLabelProxies",function(){(function(o){Q.forEach(o.edges(),function(s){var u=o.edge(s);if(u.width&&u.height){var l=o.node(s.v),f={rank:(o.node(s.w).rank-l.rank)/2+l.rank,e:s};Qo.addDummyNode(o,"edge-proxy",f,"_ep")}})})(i)}),a(" removeEmptyRanks",function(){mue(i)}),a(" nestingGraph.cleanup",function(){TM.cleanup(i)}),a(" normalizeRanks",function(){yue(i)}),a(" assignRankMinMax",function(){(function(o){var s=0;Q.forEach(o.nodes(),function(u){var l=o.node(u);l.borderTop&&(l.minRank=o.node(l.borderTop).rank,l.maxRank=o.node(l.borderBottom).rank,s=Q.max(s,l.maxRank))}),o.graph().maxRank=s})(i)}),a(" removeEdgeLabelProxies",function(){(function(o){Q.forEach(o.nodes(),function(s){var u=o.node(s);u.dummy==="edge-proxy"&&(o.edge(u.e).labelRank=u.rank,o.removeNode(s))})})(i)}),a(" normalize.run",function(){MM.run(i)}),a(" parentDummyChains",function(){Wse(i)}),a(" addBorderSegments",function(){Xse(i)}),a(" order",function(){nue(i)}),a(" insertSelfEdges",function(){(function(o){var s=Qo.buildLayerMatrix(o);Q.forEach(s,function(u){var l=0;Q.forEach(u,function(f,c){var d=o.node(f);d.order=c+l,Q.forEach(d.selfEdges,function(h){Qo.addDummyNode(o,"selfedge",{width:h.label.width,height:h.label.height,rank:d.rank,order:c+ ++l,e:h.e,label:h.label},"_se")}),delete d.selfEdges})})})(i)}),a(" adjustCoordinateSystem",function(){OM.adjust(i)}),a(" position",function(){gue(i)}),a(" positionSelfEdges",function(){(function(o){Q.forEach(o.nodes(),function(s){var u=o.node(s);if(u.dummy==="selfedge"){var l=o.node(u.e.v),f=l.x+l.width/2,c=l.y,d=u.x-f,h=l.height/2;o.setEdge(u.e,u.label),o.removeNode(s),u.label.points=[{x:f+2*d/3,y:c-h},{x:f+5*d/6,y:c-h},{x:f+d,y:c},{x:f+5*d/6,y:c+h},{x:f+2*d/3,y:c+h}],u.label.x=u.x,u.label.y=u.y}})})(i)}),a(" removeBorderNodes",function(){(function(o){Q.forEach(o.nodes(),function(s){if(o.children(s).length){var u=o.node(s),l=o.node(u.borderTop),f=o.node(u.borderBottom),c=o.node(Q.last(u.borderLeft)),d=o.node(Q.last(u.borderRight));u.width=Math.abs(d.x-c.x),u.height=Math.abs(f.y-l.y),u.x=c.x+u.width/2,u.y=l.y+u.height/2}}),Q.forEach(o.nodes(),function(s){o.node(s).dummy==="border"&&o.removeNode(s)})})(i)}),a(" normalize.undo",function(){MM.undo(i)}),a(" fixupEdgeLabelCoords",function(){(function(o){Q.forEach(o.edges(),function(s){var u=o.edge(s);if(Q.has(u,"x"))switch(u.labelpos!=="l"&&u.labelpos!=="r"||(u.width-=u.labeloffset),u.labelpos){case"l":u.x-=u.width/2+u.labeloffset;break;case"r":u.x+=u.width/2+u.labeloffset}})})(i)}),a(" undoCoordinateSystem",function(){OM.undo(i)}),a(" translateGraph",function(){(function(o){var s=Number.POSITIVE_INFINITY,u=0,l=Number.POSITIVE_INFINITY,f=0,c=o.graph(),d=c.marginx||0,h=c.marginy||0;function v(p){var g=p.x,y=p.y,m=p.width,b=p.height;s=Math.min(s,g-m/2),u=Math.max(u,g+m/2),l=Math.min(l,y-b/2),f=Math.max(f,y+b/2)}Q.forEach(o.nodes(),function(p){v(o.node(p))}),Q.forEach(o.edges(),function(p){var g=o.edge(p);Q.has(g,"x")&&v(g)}),s-=d,l-=h,Q.forEach(o.nodes(),function(p){var g=o.node(p);g.x-=s,g.y-=l}),Q.forEach(o.edges(),function(p){var g=o.edge(p);Q.forEach(g.points,function(y){y.x-=s,y.y-=l}),Q.has(g,"x")&&(g.x-=s),Q.has(g,"y")&&(g.y-=l)}),c.width=u-s+d,c.height=f-l+h})(i)}),a(" assignNodeIntersects",function(){(function(o){Q.forEach(o.edges(),function(s){var u,l,f=o.edge(s),c=o.node(s.v),d=o.node(s.w);f.points?(u=f.points[0],l=f.points[f.points.length-1]):(f.points=[],u=d,l=c),f.points.unshift(Qo.intersectRect(c,u)),f.points.push(Qo.intersectRect(d,l))})})(i)}),a(" reversePoints",function(){(function(o){Q.forEach(o.edges(),function(s){var u=o.edge(s);u.reversed&&u.points.reverse()})})(i)}),a(" acyclic.undo",function(){wM.undo(i)})})(n,e)}),e(" updateInputGraph",function(){(function(i,a){Q.forEach(i.nodes(),function(o){var s=i.node(o),u=a.node(o);s&&(s.x=u.x,s.y=u.y,a.children(o).length&&(s.width=u.width,s.height=u.height))}),Q.forEach(i.edges(),function(o){var s=i.edge(o),u=a.edge(o);s.points=u.points,Q.has(u,"x")&&(s.x=u.x,s.y=u.y)}),i.graph().width=a.graph().width,i.graph().height=a.graph().height})(r,n)})})},wue=["nodesep","edgesep","ranksep","marginx","marginy"],Eue={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_ue=["acyclicer","ranker","rankdir","align"],Sue=["width","height"],Mue={width:0,height:0},Cue=["minlen","weight","width","height","labeloffset"],Aue={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Tue=["labelpos"];function fy(r,t){return Q.mapValues(Q.pick(r,t),Number)}function cy(r){var t={};return Q.forEach(r,function(e,n){t[n.toLowerCase()]=e}),t}var Iue=_a.Graph,qN={graphlib:_a,layout:xue,debug:{debugOrdering:function(r){var t=Xn.buildLayerMatrix(r),e=new Iue({compound:!0,multigraph:!0}).setGraph({});return Q.forEach(r.nodes(),function(n){e.setNode(n,{label:n}),e.setParent(n,"layer"+r.node(n).rank)}),Q.forEach(r.edges(),function(n){e.setEdge(n.v,n.w,{},n.name)}),Q.forEach(t,function(n,i){var a="layer"+i;e.setNode(a,{rank:"same"}),Q.reduce(n,function(o,s){return e.setEdge(o,s,{style:"invis"}),s})}),e}},util:{time:Xn.time,notime:Xn.notime},version:"0.8.5"},Oue=qN.graphlib,Lue=qN.layout;class kue{constructor(t){this.cardinality=1,this.include=yu.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=wi.NODE,this.name=t.name,this.attr=t.attr||{},this.inputs=t.inputs,this.path=t.path||[],this.width=t.width,this.height=t.height}}class Due{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}function Nue(r){const t=new Due;return r.nodes.map(e=>new kue(e)).forEach(e=>{t.nodes[e.name]=e,e.inputs.forEach(n=>{(function(i,a,o){o.name!==a.name&&i.edges.push(Object.assign(Object.assign({},o.attr),{v:o.name,w:a.name}))})(t,e,n)})}),t}class Pue{constructor(t,e={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=yu.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=wi.META,this.path=[],this.name=t,this.metaGraph=vx(t,Gl.META,e)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map(t=>this.metaGraph.node(t))}leaves(){let t,e=[],n=[this];for(;n.length;){let i=n.shift();i.isGroupNode?(t=i.metaGraph,t.nodes().forEach(a=>n.push(t.node(a)))):e.push(i.name)}return e}}class Rue{constructor(t,e){this.v=t,this.w=e,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(t,e){this.baseEdgeList.push(t)}}function ZN(r,t={}){return new Pue(r,t)}function QN(r,t){return new Rue(r,t)}function vx(r,t,e){const n=e||{},i=new Oue.Graph(n);return i.setGraph({name:r,rankdir:n.rankdir,type:t,align:n.align}),i}class Bue{constructor(t={}){this.graphOptions=t,this.index={},this.graphOptions.compound=!0,this.root=ZN(zl,this.graphOptions),this.index[zl]=this.root}getNodeMap(){return this.index}node(t){return this.index[t]}setNode(t,e){this.index[t]=e}getBridgeGraph(t){const e=this.index[t];if(!e)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in e))return null;const n=e;if(n.bridgeGraph)return n.bridgeGraph;const i=vx($D,Gl.BRIDGE,this.graphOptions);if(n.bridgeGraph=i,!e.parentNode||!("metaGraph"in e.parentNode))return i;const a=e.parentNode;return[a.metaGraph,this.getBridgeGraph(a.name)].forEach(o=>{o.edges().filter(s=>s.v===t||s.w===t).forEach(s=>{const u=s.w===t;o.edge(s).baseEdgeList.forEach(l=>{const[f,c]=u?[l.w,s.v]:[l.v,s.w],d=this.getChildName(t,f),h={v:u?c:d,w:u?d:c};let v=i.edge(h);v||(v=QN(h.v,h.w),v.inbound=u,i.setEdge(h.v,h.w,v)),v.addBaseEdge(l,this)})})}),i}getChildName(t,e){let n=this.index[e];for(;n;){if(n.parentNode&&n.parentNode.name===t)return n.name;n=n.parentNode}throw Error("Could not find immediate child for descendant: "+e)}getPredecessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}getSuccessors(t){const e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}getOneWayEdges(t,e){const n=[];if(!t.parentNode||!t.parentNode.isGroupNode)return n;const i=t.parentNode,a=i.metaGraph,o=this.getBridgeGraph(i.name);return RM(a,t,e,n),RM(o,t,e,n),n}}function Fue(r,t){const{rankDirection:e,align:n}=t,i=new Bue({rankdir:e,align:n});return function(a,o){Object.keys(o.nodes).forEach(s=>{const u=o.nodes[s],l=u.path;let f=a.root;f.depth=Math.max(l.length,f.depth);for(let c=0;c<l.length&&(f.depth=Math.max(f.depth,l.length-c),f.cardinality+=u.cardinality,c!==l.length-1);c++){const d=l[c];let h=a.node(d);h||(h=ZN(d,a.graphOptions),h.path=u.path.slice(0,c+1),h.parentNode=f,a.setNode(d,h),f.metaGraph.setNode(d,h)),f=h}a.setNode(u.name,u),u.parentNode=f,f.metaGraph.setNode(u.name,u)})}(i,r),function(a,o){const s=a.getNodeMap();let u=[],l=[];const f=(c,d)=>{let h=0;for(;c;)d[h++]=c.name,c=c.parentNode;return h-1};o.edges.forEach(c=>{u=[],l=[];let d=f(o.nodes[c.v],u),h=f(o.nodes[c.w],l);for(;u[d]===l[h];)if(d--,h--,d<0||h<0)throw Error("No difference found between ancestor paths.");const v=s[u[d+1]],p=u[d],g=l[h];let y=v.metaGraph.edge(p,g);y||(y=QN(p,g),v.metaGraph.setEdge(p,g,y)),y.addBaseEdge(c,a)})}(i,r),i}function RM(r,t,e,n){(e?r.inEdges(t.name):r.outEdges(t.name)).forEach(i=>{const a=r.edge(i);n.push(a)})}class zue{constructor(t){this.hierarchy=t,this.index={},this.hasSubHierarchy={},this.root=new FM(this.hierarchy.root,this.hierarchy.graphOptions),this.index[t.root.name]=this.root,this.buildSubHierarchy(t.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(t){if(t in this.hasSubHierarchy)return;this.hasSubHierarchy[t]=!0;const e=this.index[t];if(e.node.type!==wi.META)return;const n=e,i=n.node.metaGraph,a=n.coreGraph;i.nodes().forEach(f=>{const c=this.getOrCreateRenderNodeByName(f);a.setNode(f,c)}),i.edges().forEach(f=>{const c=i.edge(f),d=new BM(c);a.setEdge(f.v,f.w,d)});const o=n.node.parentNode;if(!o)return;const s=this.getRenderNodeByName(o.name),u=(f,...c)=>c.concat([f?"IN":"OUT"]).join("~~"),l=this.hierarchy.getBridgeGraph(t);l.edges().forEach(f=>{const c=l.edge(f),d=!!i.node(f.w),[h,v]=d?[f.w,f.v]:[f.v,f.w],p=w=>{const E=d?{v:w,w:t}:{v:t,w};return s.coreGraph.edge(E)};let g=p(v);g||(g=p(u(d,v,o.name)));const y=u(d,t),m=u(d,v,t);let b=a.node(m);if(!b){let w=a.node(y);if(!w){const _={name:y,type:wi.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:yu.UNSPECIFIED,inbound:d,attr:{}};w=new uv(_),this.index[y]=w,a.setNode(y,w)}const E={name:m,type:wi.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:yu.UNSPECIFIED,inbound:d,attr:{}};b=new uv(E),this.index[m]=b,a.setNode(m,b),a.setParent(m,y),w.node.cardinality++}const x=new BM(c);x.adjoiningMetaEdge=g,d?a.setEdge(m,h,x):a.setEdge(h,m,x)})}getOrCreateRenderNodeByName(t){if(!t)return null;if(t in this.index)return this.index[t];const e=this.getNodeByName(t);return e?(this.index[t]=e.isGroupNode?new FM(e,this.hierarchy.graphOptions):new uv(e),this.index[t]):null}getRenderNodeByName(t){return this.index[t]}getNodeByName(t){return this.hierarchy.node(t)}}class uv{constructor(t){this.node=t,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=t.width||0,this.height=t.height||0,this.displayName=t.name,this.attr=t.attr}}class BM{constructor(t){this.metaEdge=t,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class FM extends uv{constructor(t,e){super(t);const n=t.metaGraph.graph();e.compound=!0,this.coreGraph=vx(n.name,Gl.CORE,e)}}function JN(r,t){r.node.isGroupNode&&function(e,n){const i=Bm(n);e.coreGraph.nodes().map(a=>e.coreGraph.node(a)).forEach(a=>{var o,s,u,l,f,c;const{height:d,width:h}=a;switch(a.node.type){case wi.NODE:Object.assign(a,i.nodeSize.node),a.height=d||i.nodeSize.node.height,a.width=h||i.nodeSize.node.width;break;case wi.BRIDGE:Object.assign(a,i.nodeSize.bridge);break;case wi.META:a.expanded?JN(a,n):(Object.assign(a,i.nodeSize.meta),a.height=i.nodeSize.meta.height,a.width=i.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+a.node.type)}if(!a.expanded){const v=a.attr;(function(p,g=!1){if(p.coreBox.width=p.width,p.coreBox.height=p.height,!g){const y=`${p.displayName}`.length,m=3;p.width=Math.max(p.coreBox.width,y*m)}})(a,n&&(a.node.type===0&&!!(!((s=(o=n==null?void 0:n.nodeSize)===null||o===void 0?void 0:o.meta)===null||s===void 0)&&s.width)||a.node.type===1&&(!!(!((l=(u=n==null?void 0:n.nodeSize)===null||u===void 0?void 0:u.node)===null||l===void 0)&&l.width)||!!v.width)||a.node.type===2&&!!(!((c=(f=n==null?void 0:n.nodeSize)===null||f===void 0?void 0:f.bridge)===null||c===void 0)&&c.width)))}})}(r,t),r.node.type===wi.META&&function(e,n){const i=Bm(n),a=i.subScene.meta;Object.assign(e,a);const{nodeSep:o,rankSep:s,edgeSep:u,align:l}=i.graph.meta,f={nodesep:o,ranksep:s,edgesep:u,align:l};Object.assign(e.coreBox,function(h,v){const{ranksep:p,nodesep:g,edgesep:y,align:m}=v;Object.assign(h.graph(),{ranksep:p,nodesep:g,edgesep:y,align:m});const b=[];if(h.nodes().forEach(M=>{h.node(M).node.type!==wi.BRIDGE&&b.push(M)}),!b.length)return{width:0,height:0};Lue(h);let x=1/0,w=1/0,E=-1/0,_=-1/0;return b.forEach(M=>{const C=h.node(M),S=.5*C.width,A=C.x-S,T=C.x+S;x=A<x?A:x,E=T>E?T:E;const I=.5*C.height,k=C.y-I,P=C.y+I;w=k<w?k:w,_=P>_?P:_}),h.edges().forEach(M=>{const C=h.edge(M),S=h.node(C.metaEdge.v),A=h.node(C.metaEdge.w);if(C.points.length===3&&function(k){let P=zM(k[0],k[1]);for(let N=1;N<k.length-1;N++){const z=zM(k[N],k[N+1]);if(Math.abs(z-P)>1)return!1;P=z}return!0}(C.points)){if(S!=null){const k=S.expanded?S.x:Hm(S);C.points[0].x=k}if(A!=null){const k=A.expanded?A.x:Hm(A);C.points[2].x=k}C.points=[C.points[0],C.points[1]]}const T=C.points[C.points.length-2];A!=null&&(C.points[C.points.length-1]=GM(T,A));const I=C.points[1];S!=null&&(C.points[0]=GM(I,S)),C.points.forEach(k=>{x=k.x<x?k.x:x,E=k.x>E?k.x:E,w=k.y<w?k.y:w,_=k.y>_?k.y:_})}),h.nodes().forEach(M=>{const C=h.node(M);C.x-=x,C.y-=w}),h.edges().forEach(M=>{h.edge(M).points.forEach(C=>{C.x-=x,C.y-=w})}),{width:E-x,height:_-w}}(e.coreGraph,f));let c=0;e.coreGraph.nodeCount()>0&&c++;const d=c<=1?0:c;e.coreBox.width+=d+d,e.coreBox.height=a.labelHeight+e.coreBox.height,e.width=e.coreBox.width+a.paddingLeft+a.paddingRight,e.height=e.paddingTop+e.coreBox.height+e.paddingBottom}(r,t)}function zM(r,t){const e=t.x-r.x,n=t.y-r.y;return 180*Math.atan(n/e)/Math.PI}function Hm(r){return r.expanded?r.x:r.x-r.width/2+0+r.coreBox.width/2}function GM(r,t){const e=t.expanded?t.x:Hm(t),n=t.y,i=r.x-e,a=r.y-n;let o,s,u=t.expanded?t.width:t.coreBox.width,l=t.expanded?t.height:t.coreBox.height;return Math.abs(a)*u/2>Math.abs(i)*l/2?(a<0&&(l=-l),o=a===0?0:l/2*i/a,s=l/2):(i<0&&(u=-u),o=u/2,s=i===0?0:u/2*a/i),{x:e+o,y:n+s}}function Gue(r,t,e){var n,i,a,o;const s=r.nodes.filter((c,d,h)=>h.findIndex(v=>v.id===c.id)!==d).map(c=>c.id);if(s.length)throw new Error(`Duplicated ids found: ${s.join(", ")}`);const u=function(c){const d={nodes:[]},h=c.compound,v=Object.keys(h||{}),p=new Map,g=(m,b=[])=>{if(p.has(m))return p.get(m);for(let x=0;x<v.length;x++){let w=v[x];if(h&&h[w].indexOf(m)!==-1)return b.unshift(w),g(w,b)}return b.length===0&&p.set(m,b),b},y=m=>c.edges.filter(b=>b.w===m).map(b=>({name:b.v}));return c.nodes.forEach(m=>{const b=m.id,x=[...g(b),b];let w=y(b);d.nodes.push({name:b,path:x,inputs:w,width:m.width,height:m.height,attr:Object.assign({},m)})}),d}(r),l=function(c,d){const h=(p,g)=>{for(let y of g.values())if(y.includes(p))return!0;return!1},v=(p,g=[])=>{if(Object.keys(p).length===0)return[...new Set(g)];const y=new Map(Object.keys(p).map(b=>[b,p[b]])),m={};for(let[b,x]of y)h(b,y)?m[b]=x:g=g.concat(b,x);return v(m,g)};return v(c).filter(p=>d.includes(p))}(r.compound||{},(t==null?void 0:t.expanded)||[]),f=function(c,d){return function(h){return new zue(h)}(Fue(Nue(c),d))}(u,{rankDirection:((i=(n=e==null?void 0:e.graph)===null||n===void 0?void 0:n.meta)===null||i===void 0?void 0:i.rankDir)||(t==null?void 0:t.rankDirection)||Xv.graph.meta.rankDir,align:((o=(a=e==null?void 0:e.graph)===null||a===void 0?void 0:a.meta)===null||o===void 0?void 0:o.align)||Xv.graph.meta.align});return function(c,d){d.forEach(h=>{const v=c.getRenderInfoNodes().find(y=>y.displayName===h);let p=v&&v.node&&v.node.name||"";const g=c.getRenderNodeByName(p);if(!g)throw new Error(`No nodes found: ${p}`);g.expanded=!0,c.buildSubHierarchy(p)})}(f,l),JN(f.root,e),eP(f.root)}function $ue(r,t=!1){const e=JSON.parse(JSON.stringify(r)),n={nodes:[e],edges:[...e.edges]};return e.nodes.forEach(function i(a){(a.type===0||a.type===1)&&n.nodes.push(a),a.type===0&&(n.edges=n.edges.concat(a.edges)),Array.isArray(a.nodes)&&a.nodes.forEach(i)}),t&&n.nodes.forEach(i=>{const a=n.nodes.find(o=>o.id===i.parentNodeName);if(a){const o=a.x-a.width/2+a.paddingLeft,s=a.y-a.height/2+a.labelHeight+a.paddingTop;a.id!==zl&&(i.x+=o,i.y+=s),i.type===0&&i.edges.forEach(u=>{u.points.forEach(l=>{l.x+=i.x-i.width/2+i.paddingLeft,l.y+=i.y-i.height/2+i.labelHeight+i.paddingTop})})}}),n}function Uue(r,t,e,n){var i,a;let o=[];const s=((i=e.find(c=>c.id===r))===null||i===void 0?void 0:i.path)||[],u=((a=e.find(c=>c.id===t))===null||a===void 0?void 0:a.path)||[],l=[zl,...s].slice(0,s.length).reverse(),f=[zl,...u].slice(0,u.length);return l.forEach(c=>{const d=e.find(h=>h.id===c);o=o.concat(d.edges.filter(h=>h.baseEdgeList.some(v=>v.v===((n==null?void 0:n.v)||r)&&v.w===((n==null?void 0:n.w)||t))))}),f.filter(c=>!l.includes(c)).forEach(c=>{const d=e.find(h=>h.id===c);o=o.concat(d.edges.filter(h=>h.baseEdgeList.some(v=>v.v===((n==null?void 0:n.v)||r)&&v.w===((n==null?void 0:n.w)||t))))}),o}function eP(r){const t=r.coreGraph.nodes().map(n=>r.coreGraph.node(n));return Object.assign(Object.assign({},$M(r)),{expanded:r.expanded,nodes:r.expanded?(e=t,e.map(n=>n.node.type===wi.META?eP(n):$M(n))):[],edges:r.expanded?jue(r):[]});var e}function $M(r){return{id:r.node.name,name:r.node.name,type:r.node.type,cardinality:r.node.cardinality,attr:r.attr,parentNodeName:r.node.parentNode?r.node.parentNode.name:null,coreBox:Object.assign({},r.coreBox),x:r.x,y:r.y,width:r.width,height:r.height,radius:r.radius,labelHeight:r.labelHeight,labelOffset:r.labelOffset,outboxWidth:r.outboxWidth,paddingLeft:r.paddingLeft,paddingTop:r.paddingTop,paddingRight:r.paddingRight,paddingBottom:r.paddingBottom,path:r.node.path}}function jue(r){return r.coreGraph.edges().map(t=>({renderInfoEdge:r.coreGraph.edge(t),edge:t})).filter(({renderInfoEdge:t})=>t.metaEdge).map(({edge:t,renderInfoEdge:e})=>{const n=function(i,a){const o=a.points.map(s=>Object.assign({},s));if(a.adjoiningMetaEdge){const s=a.adjoiningMetaEdge.points,u=a.metaEdge.inbound,l=u?s[s.length-1]:s[0],f=o[u?0:o.length-1],c=i.x-i.width/2,d=i.y-i.height/2,h=l.x-c,v=l.y-d,p=-i.paddingLeft,g=-(i.paddingTop+i.labelHeight);f.x=h+p,f.y=v+g}return o}(r,e);return{adjoiningEdge:e.adjoiningMetaEdge?{w:e.adjoiningMetaEdge.metaEdge.w,v:e.adjoiningMetaEdge.metaEdge.v}:null,inbound:e.metaEdge.inbound,w:t.w,v:t.v,points:n,weight:e.weight,baseEdgeList:e.metaEdge.baseEdgeList,parentNodeName:r.node.name}})}const Wue=Object.freeze(Object.defineProperty({__proto__:null,BRIDGE_GRAPH_NAME:$D,get GraphType(){return Gl},get HierarchyNodeType(){return Fm},get InclusionType(){return yu},LAYOUT_CONFIG:Xv,get NodeType(){return wi},ROOT_NAME:zl,buildGraph:Gue,flatGraph:$ue,getEdges:Uue,mergeConfig:Bm},Symbol.toStringTag,{value:"Module"})),Xue=to(Wue);var Yue=_e&&_e.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),fa=_e&&_e.__assign||function(){return fa=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},fa.apply(this,arguments)},tl=_e&&_e.__spreadArray||function(r,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,a;n<i;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return r.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(ed,"__esModule",{value:!0});ed.DagreCompoundLayout=void 0;var Vue=hn,Wi=Xue,_h=an(),Hue=function(r){Yue(t,r);function t(e){var n=r.call(this)||this;return n.rankdir="TB",n.nodesep=50,n.edgesep=5,n.ranksep=50,n.controlPoints=!0,n.anchorPoint=!0,n.nodes=[],n.edges=[],n.combos=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return t.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,begin:void 0,nodeSize:void 0,nodesep:50,ranksep:50,controlPoints:!0,anchorPoint:!0}},t.prototype.init=function(e){var n=e.hiddenNodes||[],i=e.hiddenEdges||[],a=e.hiddenCombos||[];this.nodes=this.getDataByOrder((e.nodes||[]).concat(n)),this.edges=this.getDataByOrder((e.edges||[]).concat(i)),this.combos=(e.combos||[]).concat(a.map(function(o){return fa(fa({},o),{collapsed:!0})}))},t.prototype.execute=function(){var e=this,n=e.nodes,i=e.edges;if(n){var a=e.getLayoutConfig(),o=a.graphDef,s=a.graphOption,u=a.graphSettings,l=(0,Wi.buildGraph)(o,s,u),f=(0,Wi.flatGraph)(l,!0);return this.updatePosition(f),e.onLayoutEnd&&e.onLayoutEnd(),{nodes:n,edges:i}}},t.prototype.getNodePath=function(e){var n=this,i=n.nodes,a=n.combos,o=i.find(function(u){return u.id===e}),s=function(u,l){l===void 0&&(l=[]);var f=a.find(function(c){return c.id===u});return f?(l.unshift(u),f.parentId?s(f.parentId,l):l):l};return o&&o.comboId?s(o.comboId,[e]):[e]},t.prototype.getLayoutConfig=function(){var e,n,i,a=this,o=a.nodes,s=a.edges,u=a.combos,l=a.nodeSize,f=a.rankdir,c=a.align,d=a.edgesep,h=a.nodesep,v=a.ranksep,p=a.settings,g=(u||[]).reduce(function(N,z){var W=o.filter(function(R){return R.comboId===z.id}).map(function(R){return R.id}),D=(u||[]).filter(function(R){return R.parentId===z.id}).map(function(R){return R.id});return(W.length||D.length)&&(N[z.id]=tl(tl([],W,!0),D,!0)),N},{}),y;l?(0,_h.isArray)(l)?y=function(){return l}:y=function(){return[l,l]}:y=function(N){return N&&N.size?(0,_h.isArray)(N.size)?N.size:(0,_h.isObject)(N.size)?[N.size.width||40,N.size.height||40]:[N.size,N.size]:[40,40]};var m=function(N){return N&&N.size?(0,_h.isArray)(N.size)?N.size:[N.size,N.size]:[80,40]},b=m(u==null?void 0:u[0]),x=b[0],w=b[1],E=(n=(e=a.graphSettings)===null||e===void 0?void 0:e.subScene)===null||n===void 0?void 0:n.meta,_=((i=u.find(function(N){return!N.collapsed}))===null||i===void 0?void 0:i.padding)||[20,20,20,20],M=_[0],C=_[1],S=_[2],A=_[3],T={compound:g,nodes:tl([],(o||[]).map(function(N){var z=y(N),W=z[0],D=z[1];return fa(fa({},N),{width:W,height:D})}),!0),edges:tl([],(s||[]).map(function(N){return fa(fa({},N),{v:N.source,w:N.target})}),!0)},I={expanded:(u||[]).filter(function(N){return!N.collapsed}).map(function(N){return N.id})},k={graph:{meta:{align:c,rankDir:f,nodeSep:h,edgeSep:d,rankSep:v}},subScene:{meta:{paddingTop:M||(E==null?void 0:E.paddingTop)||20,paddingRight:C||(E==null?void 0:E.paddingRight)||20,paddingBottom:S||(E==null?void 0:E.paddingBottom)||20,paddingLeft:A||(E==null?void 0:E.paddingLeft)||20,labelHeight:0}},nodeSize:{meta:{width:x,height:w}}},P=(0,Wi.mergeConfig)(p,fa({},(0,Wi.mergeConfig)(k,Wi.LAYOUT_CONFIG)));return a.graphSettings=P,{graphDef:T,graphOption:I,graphSettings:P}},t.prototype.updatePosition=function(e){var n=e.nodes,i=e.edges;this.updateNodePosition(n,i),this.updateEdgePosition(n,i)},t.prototype.getBegin=function(e,n){var i=this,a=i.begin,o=[0,0];if(a){var s=1/0,u=1/0;e.forEach(function(l){s>l.x&&(s=l.x),u>l.y&&(u=l.y)}),n.forEach(function(l){l.points.forEach(function(f){s>f.x&&(s=f.x),u>f.y&&(u=f.y)})}),o[0]=a[0]-s,o[1]=a[1]-u}return o},t.prototype.updateNodePosition=function(e,n){var i=this,a=i.combos,o=i.nodes,s=i.edges,u=i.anchorPoint,l=i.graphSettings,f=this.getBegin(e,n);e.forEach(function(c){var d,h=c.x,v=c.y,p=c.id,g=c.type,y=c.coreBox;if(g===Wi.HierarchyNodeType.META&&p!==Wi.ROOT_NAME){var m=a.findIndex(function(_){return _.id===p}),b=(d=l==null?void 0:l.subScene)===null||d===void 0?void 0:d.meta;a[m].offsetX=h+f[0],a[m].offsetY=v+f[1],a[m].fixSize=[y.width,y.height],a[m].fixCollapseSize=[y.width,y.height],c.expanded?a[m].padding=[b==null?void 0:b.paddingTop,b==null?void 0:b.paddingRight,b==null?void 0:b.paddingBottom,b==null?void 0:b.paddingLeft]:a[m].padding=[0,0,0,0]}else if(g===Wi.HierarchyNodeType.OP){var m=o.findIndex(function(M){return M.id===p});if(o[m].x=h+f[0],o[m].y=v+f[1],u){var x=[],w=n.filter(function(M){return M.v===p}),E=n.filter(function(M){return M.w===p});w.length>0&&w.forEach(function(M){var C=M.points[0],S=(C.x-h)/c.width+.5,A=(C.y-v)/c.height+.5;x.push([S,A]),M.baseEdgeList.forEach(function(T){var I=s.find(function(k){return k.source===T.v&&k.target===T.w});I&&(I.sourceAnchor=x.length-1)})}),E.length>0&&E.forEach(function(M){var C=M.points[M.points.length-1],S=(C.x-h)/c.width+.5,A=(C.y-v)/c.height+.5;x.push([S,A]),M.baseEdgeList.forEach(function(T){var I=s.find(function(k){return k.source===T.v&&k.target===T.w});I&&(I.targetAnchor=x.length-1)})}),o[m].anchorPoints=x.length>0?x:o[m].anchorPoints||[]}}})},t.prototype.updateEdgePosition=function(e,n){var i=this,a=i.combos,o=i.edges,s=i.controlPoints,u=this.getBegin(e,n);s&&(a.forEach(function(l){l.inEdges=[],l.outEdges=[]}),o.forEach(function(l){var f,c,d,h,v=e.find(function(_){return _.id===l.source}),p=e.find(function(_){return _.id===l.target}),g=[],y=[];if(v&&p)y=(0,Wi.getEdges)(v==null?void 0:v.id,p==null?void 0:p.id,e);else if(!v||!p){var m=i.getNodePath(l.source),b=i.getNodePath(l.target),x=m.reverse().slice(v?0:1).find(function(_){return e.find(function(M){return M.id===_})}),w=b.reverse().slice(p?0:1).find(function(_){return e.find(function(M){return M.id===_})});v=e.find(function(_){return _.id===x}),p=e.find(function(_){return _.id===w}),y=(0,Wi.getEdges)(v==null?void 0:v.id,p==null?void 0:p.id,e,{v:l.source,w:l.target})}if(g=y.reduce(function(_,M){return tl(tl([],_,!0),M.points.map(function(C){return fa(fa({},C),{x:C.x+u[0],y:C.y+u[1]})}),!0)},[]),g=g.slice(1,-1),l.controlPoints=g,(p==null?void 0:p.type)===Wi.NodeType.META){var E=a.findIndex(function(_){return _.id===(p==null?void 0:p.id)});if(!a[E]||!((f=a[E].inEdges)===null||f===void 0)&&f.some(function(_){return _.source===v.id&&_.target===p.id}))return;(c=a[E].inEdges)===null||c===void 0||c.push({source:v.id,target:p.id,controlPoints:g})}if((v==null?void 0:v.type)===Wi.NodeType.META){var E=a.findIndex(function(M){return M.id===(v==null?void 0:v.id)});if(!a[E]||!((d=a[E].outEdges)===null||d===void 0)&&d.some(function(M){return M.source===v.id&&M.target===p.id}))return;(h=a[E].outEdges)===null||h===void 0||h.push({source:v.id,target:p.id,controlPoints:g})}}))},t.prototype.getType=function(){return"dagreCompound"},t.prototype.getDataByOrder=function(e){return e.every(function(n){return n.layoutOrder!==void 0})||e.forEach(function(n,i){n.layoutOrder=i}),e.sort(function(n,i){return n.layoutOrder-i.layoutOrder})},t}(Vue.Base);ed.DagreCompoundLayout=Hue;var px={},og={},gx={};const Kue=Object.prototype.toString;function Jv(r){const t=Kue.call(r);return t.endsWith("Array]")&&!t.includes("Big")}function que(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Jv(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var e=t.fromIndex,n=e===void 0?0:e,i=t.toIndex,a=i===void 0?r.length:i;if(n<0||n>=r.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>r.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=r[n],s=n+1;s<a;s++)r[s]>o&&(o=r[s]);return o}function Zue(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Jv(r))throw new TypeError("input must be an array");if(r.length===0)throw new TypeError("input must not be empty");var e=t.fromIndex,n=e===void 0?0:e,i=t.toIndex,a=i===void 0?r.length:i;if(n<0||n>=r.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>r.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=r[n],s=n+1;s<a;s++)r[s]<o&&(o=r[s]);return o}function UM(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Jv(r)){if(r.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var e;if(t.output!==void 0){if(!Jv(t.output))throw new TypeError("output option must be an array if specified");e=t.output}else e=new Array(r.length);var n=Zue(r),i=que(r);if(n===i)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=t.min,o=a===void 0?t.autoMinMax?n:0:a,s=t.max,u=s===void 0?t.autoMinMax?i:1:s;if(o>=u)throw new RangeError("min option must be smaller than max option");for(var l=(u-o)/(i-n),f=0;f<r.length;f++)e[f]=(r[f]-n)*l+o;return e}const Sh=" ".repeat(2),tP=" ".repeat(4);function Que(){return rP(this)}function rP(r,t={}){const{maxRows:e=15,maxColumns:n=10,maxNumSize:i=8}=t;return`${r.constructor.name} {
|
|
301
301
|
${Sh}[
|
|
302
302
|
${tP}${Jue(r,e,n,i)}
|
|
303
303
|
${Sh}]
|
|
@@ -936,4 +936,4 @@ class CalcAveMovement {
|
|
|
936
936
|
</div>`)}},t.prototype.init=function(){var e=this;if(!e.destroyed){var n=e.get("graph"),i=n.getContainer(),a=e.get("container"),o=this.get("containerCfg");o?(a=this.createContainer(),i.appendChild(a)):a=i,this.set("container",a);var s=i.getBoundingClientRect(),u=new Io({container:i,width:s.right-s.left,height:s.bottom-s.top});tr(u.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",Fc(function(){return e.resizeCanvas(e)},100));var l=u.addGroup({id:"annotation-link-group"});e.set("linkGroup",l),e.set("canvas",u),e.get("getTitle")||e.set("getTitle",function(c){var d,h=((d=c==null?void 0:c.getModel)===null||d===void 0?void 0:d.call(c))||{},v=h.label,p=h.id;return v||p||"-"}),e.get("getContent")||e.set("getContent",function(c){var d,h;if(!c)return"-";var v=((d=c.getModel)===null||d===void 0?void 0:d.call(c))||{},p=v.label,g=v.id,y=(h=c.getType)===null||h===void 0?void 0:h.call(c),m=y?"".concat(y,": "):"";return"".concat(m).concat(p||g||"")});var f=e.get("defaultData");f&&this.readData(f)}},t.prototype.createContainer=function(){var e=this;if(!this.destroyed){var n=this.get("containerCfg"),i=this.get("graph"),a=i.getContainer(),o=a.getBoundingClientRect(),s=o.left,u=o.right,l=o.top,f=o.bottom,c=f-l,d=u-s,h=n.position,v=h===void 0?"top":h,p=n.offsetX,g=p===void 0?0:p,y=n.offsetY,m=y===void 0?0:y,b=KC(n,["position","offsetX","offsetY"]),x=n.height,w=x===void 0?"fit-content":x,E=n.width,_=E===void 0?i.getWidth():E;w==="100%"&&(w=c),_==="100%"&&(_=d);var M="unset",C="unset",S={};switch(v){case"right":M="".concat(c,"px"),S={top:0,right:0},S.right+=s+g,S.top+=l+m;break;case"bottom":C="".concat(d,"px"),S={bottom:0,left:0},S.left+=s+g,S.bottom+=l+m;break;case"top":C="".concat(d,"px");case"left":M="".concat(c,"px");default:S={top:0,left:0},S.left+=s+g,S.top+=l+m;break}Object.keys(S).forEach(function(T){S[T]="".concat(S[T],"px")});var A=Ur("<div class='".concat(n.className," g6-annotation-container'></div>"));return tr(A,Hi(Hi({position:"absolute",display:v==="top"||v==="bottom"?"inline-flex":"unset",width:mt(_)?"".concat(_,"px"):_,height:mt(w)?"".concat(w,"px"):w,maxHeight:M,maxWidth:C,overflow:"scroll"},S),b)),a.appendChild(A),A.addEventListener("scroll",function(T){e.updateLinks()}),A}},t.prototype.resizeCanvas=function(e){clearTimeout(e.resizeTimer),e.resizeTimer=setTimeout(function(){if(!(!e||e.destroyed)){var n=e.get("container").getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top;e.get("canvas").changeSize(i,a),e.updateOutsideCards(e)}},250)},t.prototype.updateOutsideCards=function(e){var n=e||this,i=n.get("cardInfoMap")||{},a=n.get("graph"),o=a.getPointByCanvas(0,0),s=a.getPointByCanvas(a.getWidth(),a.getHeight()),u=a.getClientByPoint(o.x,o.y),l=u.x,f=u.y,c=a.getClientByPoint(s.x,s.y),d=c.x,h=c.y;Object.values(i).forEach(function(v){var p=v.card;if(p){var g=p.style,y=Vs(g.left),m=Vs(g.top),b=p.getBoundingClientRect(),x=b.width,w=b.height,E=y,_=m;y+x>d-l&&(E=d-l-x),y<0&&(E=0),m+w>h-f&&(_=h-f-w),m<0&&(_=0),tr(p,{left:"".concat(E,"px"),top:"".concat(_,"px")})}}),n.updateLinks()},t.prototype.showAnnotation=function(e){if(!this.destroyed){var n=e.item;this.toggleAnnotation(n)}},t.prototype.hideCards=function(){var e=this;if(!e.destroyed){var n=e.get("cardInfoMap")||{};Object.keys(n).forEach(function(i){e.hideCard(i)})}},t.prototype.toggleAnnotation=function(e,n){var i,a;n===void 0&&(n={});var o=this;if(!o.destroyed){var s=o.get("cardInfoMap")||{},u=o.get("graph"),l=o.get("container"),f=o.get("containerCfg"),c=Object.assign({},o.get("cardCfg")||{},n),d=c.minHeight,h=c.minWidth,v=c.width,p=c.height,g=c.collapsed,y=g===void 0?!1:g,m=c.x,b=c.y,x=c.title,w=c.content,E=c.maxTitleLength,_=c.defaultBegin,M=KC(c,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),C=o.get("linkGroup"),S=this.get("rows")||[[]],A=(i=e.isCanvas)===null||i===void 0?void 0:i.call(e),T=A?qC:e.getID(),I=s[T]||{},k=I.card,P=I.link,N=I.x,z=I.y,W=I.title,D=I.content,R=this.get("getTitle"),H=this.get("getContent"),ee=this.get("getContentPlaceholder")||function(){return""},Y=this.get("getTitlePlaceHolder")||function(){return""},X=ee(e),fe=Y(e),we=Ur(this.getDOMContent(Hi({itemId:T,collapsed:y,title:((a=W||x||(R==null?void 0:R(e)))===null||a===void 0?void 0:a.substr(0,E))||fe,content:D||w||(H==null?void 0:H(e))||X},M))),Ae=mt(d)?"".concat(d,"px"):d;tr(we,{minHeight:y?"unset":Ae,minWidth:mt(h)?"".concat(h,"px"):h,height:p,width:v});var Ke=!!k;Ke?(P==null||P.remove(!0),l.replaceChild(we,k)):l.appendChild(we);var ot;if(!f){if(ot=l.getBoundingClientRect()||{},m!==void 0&&b!==void 0)N=m,z=b;else if(!Ke&&!A){var nt=ot.top,Ct=_||{},Et=Ct.left,fr=Ct.right,Gt=fr===void 0?16:fr,jt=Ct.top,Sr=jt===void 0?8:jt,rr=Ct.bottom,Rt=Gt,sr=Sr;isNaN(Et)||(Rt=l.scrollWidth-Et),isNaN(rr)||(sr=l.scrollHeight-rr);var Hr=mt(h)?h:100;N=l.scrollWidth-we.scrollWidth-(S.length-1)*Hr-Rt;var et=S[S.length-1],ie=(et[et.length-1]||{}).bbox;z=(ie==null?void 0:ie.bottom)-nt||sr}tr(we,{position:"absolute",left:"".concat(N,"px"),top:"".concat(z,"px"),cusor:f?"unset":"move"})}this.bindListener(we,T);var L=we.getBoundingClientRect();if(!A){var Se=Ey(e,L,u,this.get("canvas")),Pe=this.get("linkStyle");P=C.addShape("path",{attrs:Hi({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:Se},Pe)})}if(s[T]=Hi(Hi({},s[T]||{}),{id:T,collapsed:y,card:we,link:P,x:N,y:z,cardBBox:L,content:D||w,title:W||x,contentPlaceholder:X,titlePlaceholder:fe,isCanvas:A}),o.set("cardInfoMap",s),f)this.updateCardPositionsInConatainer(),this.updateLinks();else{var me=!isNaN(m)&&!isNaN(b);if(!Ke&&!A&&!me){var je=ot.bottom,Xe=je===void 0?0:je,nt=ot.top;S[S.length-1].push({id:T,bbox:L}),L.top>Xe-nt-L.height-16&&S.push([]),this.set("rows",S)}}this.updateCardSize(T);var qe=this.get("onAnnotationChange");qe==null||qe(s[T],Ke?"update":"create")}},t.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var n=this.get("container"),i=this.get("containerCfg").position,a=n.getBoundingClientRect().width,o=getComputedStyle(n),s=Vs(o.paddingLeft)+Vs(o.paddingRight);a-=s,Object.values(e).forEach(function(u){var l=u.card,f=l.getBoundingClientRect().width;switch(i){case"right":tr(l,{marginLeft:a?"".concat(a-f,"px"):"0px"});break;case"top":case"bottom":tr(l,{marginLeft:"8px"})}})}}},t.prototype.handleExpandCollapseCard=function(e){if(!this.destroyed){var n=this.get("graph"),i=this.get("cardInfoMap");if(i){var a=i[e].collapsed,o=n.findById(e);if(o){var s=this.get("cardCfg").collapseType;s==="hide"&&!a?this.hideCard(e):this.toggleAnnotation(o,{collapsed:!a}),i[e]=Hi(Hi({},i[e]),{collapsed:!a})}}}},t.prototype.hideCard=function(e){if(!this.destroyed){var n=this.get("cardInfoMap");if(!(!n||!n[e])){var i=n[e],a=i.card,o=i.link;tr(a,{display:"none"}),o==null||o.hide();var s=this.get("onAnnotationChange");s(n[e],"hide")}}},t.prototype.removeCard=function(e){if(!this.destroyed){var n=this.get("cardInfoMap");if(n){var i=n[e],a=i.card,o=i.link,s=this.get("container");s.removeChild(a),o==null||o.remove(!0),delete n[e];var u=this.get("onAnnotationChange");u(i,"remove")}}},t.prototype.bindListener=function(e,n){var i=this;if(!this.destroyed){e.addEventListener("mousemove",function(u){var l;if(u.target.className==="g6-annotation-collapse"?l="collapse":u.target.className==="g6-annotation-expand"?l="expand":u.target.className==="g6-annotation-close"&&(l="close"),l){var f=i.get("cardCfg").onMouseEnterIcon,c=f===void 0?function(){}:f;c(u,n,l)}}),e.addEventListener("mouseout",function(u){var l;if(u.target.className==="g6-annotation-collapse"?l="collapse":u.target.className==="g6-annotation-expand"?l="expand":u.target.className==="g6-annotation-close"&&(l="close"),l){var f=i.get("cardCfg").onMouseLeaveIcon,c=f===void 0?function(){}:f;c(u,n,l)}}),e.addEventListener("mouseenter",function(u){var l=i.get("cardInfoMap");if(l){var f=i.get("graph"),c=f.findById(n);if(c){var d=i.get("itemHighlightState");f.setItemState(c,d,!0)}var h=l[n].link;if(h){var v=i.get("linkHighlightStyle")||{};h.attr(v)}}}),e.addEventListener("mouseleave",function(u){var l=i.get("cardInfoMap");if(l){var f=i.get("graph"),c=f.findById(n);if(c){var d=i.get("itemHighlightState");f.setItemState(c,d,!1)}var h=l[n].link;if(h){var v=i.get("linkHighlightStyle")||{};Object.keys(v).forEach(function(g){h.attr(g,void 0),h.attr(g,void 0)});var p=i.get("linkStyle");h.attr(p)}}}),e.addEventListener("click",function(u){var l=(i.get("cardCfg")||{}).onClickIcon;if(u.target.className==="g6-annotation-collapse"||u.target.className==="g6-annotation-expand"){var f=i.get("cardCfg").collapseType;f==="hide"?i.hideCard(n):i.handleExpandCollapseCard(n),l==null||l(u,n,u.target.className==="g6-annotation-collapse"?"collapse":"expand")}else if(u.target.className==="g6-annotation-close"){var c=i.get("cardCfg").closeType;c==="remove"?i.removeCard(n):i.hideCard(n),l==null||l(u,n,"close")}});var a=this.get("editable");a&&e.addEventListener("dblclick",function(u){var l=i.get("cardInfoMap"),f=(i.get("cardCfg")||{}).maxTitleLength,c=f===void 0?20:f;if(l){var d=u.target,h=d.className;if(!(h!=="g6-annotation-title"&&h!=="g6-annotation-content")){var v=h==="g6-annotation-title"?d.getBoundingClientRect():d.parentNode.getBoundingClientRect(),p=v.width,g=v.height,y=getComputedStyle(d),m=h==="g6-annotation-title"?"input":"textarea",b=Ur("<".concat(m,' class="').concat(h,'-input" type="textarea" style="width:').concat(p,"px; height: ").concat(g,'px; min-width: 16px;"/>')),x=Ur('<div class="'.concat(h,'-input-wrapper" style="width: ').concat(p,"px; height: ").concat(g,"px; min-width: 16px; margin-right: ").concat(y.marginRight,'" />'));x.appendChild(b),d.parentNode.replaceChild(x,d);var w=l[n],E=w.contentPlaceholder,_=w.titlePlaceholder,M=w.content,C=w.title,S=M;h==="g6-annotation-title"?(b.name="title",b.maxLength=c,S=C):b.name="content",S?(b.innerHTML=d.innerHTML,b.value=d.innerHTML):b.placeholder=h==="g6-annotation-title"?_:E,b.focus(),b.addEventListener("blur",function(A){b.value&&(d.innerHTML=b.value,w[b.name||"title"]=b.value),x.parentNode.replaceChild(d,x),i.updateCardSize(n);var T=i.get("onAnnotationChange");T==null||T(w,"update")})}}});var o=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];e.draggable=!0,e.addEventListener("dragstart",function(u){var l=u.target.className;if(!o.includes(l)){var f=e.style;i.set("dragging",{card:e,x:u.clientX,y:u.clientY,left:Vs(f.left),top:Vs(f.top)})}}),e.addEventListener("drag",function(u){u.preventDefault();var l=i.get("cardInfoMap");if(l){var f=u.clientX,c=u.clientY,d=i.get("dragging");if(!(isNaN(f)||isNaN(c)||!d)){var h=d.x,v=d.y,p=d.left,g=d.top,y=d.card,m=f-h,b=c-v;p+=m,g+=b;var x=i.get("graph"),w=x.getPointByCanvas(0,0),E=x.getPointByCanvas(x.getWidth(),x.getHeight()),_=x.getClientByPoint(w.x,w.y),M=_.x,C=_.y,S=x.getClientByPoint(E.x,E.y),A=S.x,T=S.y,I=y.getBoundingClientRect(),k=I.right-I.left,P=I.bottom-I.top;(p>A-M-k&&m>0||p<0&&m<0)&&(p-=m),(g>T-C-P&&b>0||g<0&&b<0)&&(g-=b),tr(y,{left:"".concat(p,"px"),top:"".concat(g,"px"),visibility:"hidden"}),h=f,v=c;var N=(l[n]||{}).link;if(N){var z=x.findById(n);N.attr("path",Ey(z,I,x,i.get("canvas")))}i.set("dragging",{x:h,y:v,left:p,top:g,card:y})}}});var s=function(l){var f=i.get("cardInfoMap");if(f){var c=i.get("dragging");if(c){var d=c.left,h=c.top,v=c.card;f[n].x=d,f[n].y=h,tr(v,{visibility:"visible"}),i.set("dragging",!1);var p=i.get("rows");p==null||p.forEach(function(y){for(var m=y.length-1;m>=0;m--)y[m].id===n&&y.splice(m,1)});var g=i.get("onAnnotationChange");g==null||g(f[n],"update")}}};e.addEventListener("dragend",s)}},t.prototype.updateCardSize=function(e){var n=this.get("cardInfoMap");if(n){var i=n[e].card,a=i.getBoundingClientRect().width,o=i.getElementsByClassName("g6-annotation-title")[0];if(o){var s=getComputedStyle(o),u=Vs(s.marginLeft),l=o.getBoundingClientRect().width;tr(o,{marginRight:"".concat(a-u-24-16-l,"px")})}}},t.prototype.updateLink=function(e){var n=e.item;if(n){var i=this.get("cardInfoMap");if(i){var a=this.get("canvas"),o=this.get("graph"),s=n.getID(),u=i[s]||{},l=u.link,f=u.card;if(l){var c=Ey(n,f.getBoundingClientRect(),o,a);l.attr("path",c)}}}},t.prototype.updateLinks=function(){var e=this;if(!this.destroyed){var n=this.get("cardInfoMap");if(n){var i=this.get("graph");Object.values(n).forEach(function(a){var o=a.id,s=i.findById(o);e.updateLink({item:s})})}}},t.prototype.onGraphDataChange=function(){var e=this,n=this.get("cardInfoMap");if(n){var i=this.get("graph");Object.values(n).forEach(function(a){var o=a.id,s=a.card,u=a.isCanvas;if(!(!s||u||s.style.display==="none")){var l=i.findById(o);l&&l.isVisible()?e.toggleAnnotation(l):e.hideCard(o)}})}},t.prototype.onGraphItemVisibilityChange=function(e){var n=e.item,i=e.visible;if(!(!n||n.destroyed)){var a=this.get("cardInfoMap");if(a){var o=n.getID();a[o]&&(i||this.hideCard(o))}}},t.prototype.saveData=function(e){e===void 0&&(e=!1);var n=this.get("cardInfoMap");if(n){var i=this.get("graph"),a=this.get("getTitle"),o=this.get("getContent"),s=[];return Object.values(n).forEach(function(u){var l=u.title,f=u.content,c=u.x,d=u.y,h=u.id,v=u.collapsed,p=u.card;if(!(p&&p.style.display==="none"&&!e)){var g=i.findById(h)||i.get("canvas");s.push({id:h,x:c,y:d,collapsed:v,title:l||(a==null?void 0:a(g)),content:f||(o==null?void 0:o(g)),visible:p&&p.style.display!=="none"})}}),s}},t.prototype.readData=function(e){var n=this,i=this.get("graph");e.forEach(function(a){var o=a.id,s=a.x,u=a.y,l=a.title,f=a.content,c=a.collapsed,d=a.visible,h=i.findById(o);if(!h&&o===qC&&(h=i.get("canvas")),!h){var v=n.get("cardInfoMap")||{};v[o]=a,n.set("cardInfoMap",v);return}n.toggleAnnotation(h,{x:s,y:u,title:l,content:f,collapsed:c}),d||n.hideCard(o)})},t.prototype.clear=function(){var e=this.get("cardInfoMap");if(e){var n=this.get("container");Object.values(e).forEach(function(i){var a=i.card,o=i.link;n.removeChild(a),o==null||o.remove(!0)}),this.set("cardInfoMap",{})}},t.prototype.destroy=function(){var e;this.clear(),(e=this.get("canvas"))===null||e===void 0||e.destroy();var n=this.get("graph");!n||n.destroyed||(this.get("containerCfg")&&n.getContainer().removeChild(this.get("container")),this.destroyed=!0)},t}(Mi);const _ge=Ege;var Sge=function(t,e){var n,i,a=1/0;Object.keys(t).forEach(function(u){var l=t[u];Object.keys(e).forEach(function(f){var c=e[f],d=l.x-c.x,h=l.y-c.y,v=d*d+h*h;a>v&&(a=v,n=l,i=c)})});var o=20,s=Kn.getControlPoint(n,i,.5,o);return[["M",n.x,n.y],["Q",s.x,s.y,i.x,i.y]]},Ey=function(t,e,n,i){var a,o,s=t.getType();if(s==="edge")o=[t.getKeyShape().getPoint(.5)];else{var u=(a=t.getKeyShape)===null||a===void 0?void 0:a.call(t).getBBox(),l=u.minX,f=u.minY,c=u.maxX,d=u.maxY,h=t.getModel(),v=h.x,p=h.y;l+=v,f+=p,c+=v,d+=p,o={left:{x:l,y:(f+d)/2},right:{x:c,y:(f+d)/2},top:{x:(l+c)/2,y:f},bottom:{x:(l+c)/2,y:d}}}Object.keys(o).forEach(function(C){var S=o[C],A=S.x,T=S.y,I=n.getClientByPoint(A,T);o[C]=i.getPointByClient(I.x,I.y)});var g=e.top,y=g===void 0?0:g,m=e.left,b=m===void 0?0:m,x=e.right,w=x===void 0?0:x,E=e.bottom,_=E===void 0?0:E,M={left:i.getPointByClient(b,(y+_)/2),right:i.getPointByClient(w,(y+_)/2),top:i.getPointByClient((b+w)/2,y),bottom:i.getPointByClient((b+w)/2,_)};return Sge(o,M)},Vs=function(t){return Number(t.replace(/\s+|px/gi,""))||0},Li={PluginBase:Mi,Menu:Hhe,Grid:Uhe,Minimap:tve,Bundling:ave,ToolBar:dve,Tooltip:pve,Fisheye:uve,TimeBar:rge,ImageMinimap:sge,EdgeFilterLens:cge,SnapLine:gge,Legend:xge,Annotation:_ge};Bo("circle",{options:{size:it.defaultNode.size,style:{x:0,y:0,stroke:it.defaultNode.style.stroke,fill:it.defaultNode.style.fill,lineWidth:it.defaultNode.style.lineWidth},labelCfg:{style:{fill:it.nodeLabel.style.fill,fontSize:it.nodeLabel.style.fontSize,fontFamily:it.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:it.defaultNode.linkPoints.size,lineWidth:it.defaultNode.linkPoints.lineWidth,fill:it.defaultNode.linkPoints.fill,stroke:it.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:F({},it.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=Pr({},i,t.icon),s="".concat(this.type,"-keyShape"),u=e.addShape("circle",{attrs:a,className:s,name:s,draggable:!0});e.shapeMap[s]=u;var l=o.width,f=o.height,c=o.show,d=o.text;if(c){var h="".concat(this.type,"-icon");d?e.shapeMap[h]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:h,name:h,draggable:!0}):e.shapeMap[h]=e.addShape("image",{attrs:F({x:-l/2,y:-f/2},o),className:h,name:h,draggable:!0})}return this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints;if(n){var i=n||{},a=i.top,o=i.left,s=i.right,u=i.bottom,l=i.size,f=i.r,c=Ln(i,["top","left","right","bottom","size","r"]),d=this.getSize(t),h=d[0]/2;if(o){var v="link-point-left";e.shapeMap[v]=e.addShape("circle",{attrs:F(F({},c),{x:-h,y:0,r:l/2||f||5}),className:v,name:v,isAnchorPoint:!0})}if(s){var p="link-point-right";e.shapeMap[p]=e.addShape("circle",{attrs:F(F({},c),{x:h,y:0,r:l/2||f||5}),className:p,name:p,isAnchorPoint:!0})}if(a){var g="link-point-top";e.shapeMap[g]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:-h,r:l/2||f||5}),className:g,name:g,isAnchorPoint:!0})}if(u){var y="link-point-bottom";e.shapeMap[y]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:h,r:l/2||f||5}),className:y,name:y,isAnchorPoint:!0})}}},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=Pr({},e,n),a=this.getSize(t),o=a[0]/2,s=F({x:0,y:0,r:o},i);return s},update:function(t,e,n){var i=e.getContainer(),a=this.getSize(t),o=F({},t.style);t.style.stroke===void 0&&t.color&&(o.stroke=t.color),t.style.r===void 0&&!isNaN(a[0])&&(o.r=a[0]/2),this.updateShape(t,e,o,!0,n),this.updateLinkPoints(t,i)}},"single-node");Bo("rect",{options:{size:[100,30],style:{radius:0,stroke:it.defaultNode.style.stroke,fill:it.defaultNode.style.fill,lineWidth:it.defaultNode.style.lineWidth},labelCfg:{style:{fill:it.nodeLabel.style.fill,fontSize:it.nodeLabel.style.fontSize,fontFamily:it.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:it.defaultNode.linkPoints.size,lineWidth:it.defaultNode.linkPoints.lineWidth,fill:it.defaultNode.linkPoints.fill,stroke:it.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:F({},it.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t),i=e.addShape("rect",{attrs:n,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return e.shapeMap["".concat(this.type,"-keyShape")]=i,this.drawLinkPoints(t,e),i},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,l=i.size,f=i.r,c=Ln(i,["top","left","right","bottom","size","r"]),d=this.getSize(t),h=d[0],v=d[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},c),{x:-h/2,y:0,r:l/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},c),{x:h/2,y:0,r:l/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:-v/2,r:l/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:v/2,r:l/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=Mt({},e,n),a=this.getSize(t),o=i.width||a[0],s=i.height||a[1],u=F({x:-o/2,y:-s/2,width:o,height:s},i);return u},update:function(t,e,n){var i=e.getContainer(),a=this.getOptions({}).style,o=this.getSize(t),s=e.get("keyShape");t.size||(o[0]=s.attr("width")||a.width,o[1]=s.attr("height")||a.height);var u={stroke:t.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},l=Mt({},a,s.attr(),u);l=Mt(l,t.style),this.updateShape(t,e,l,!1,n),this.updateLinkPoints(t,i)}},"single-node");Bo("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:it.defaultNode.style.stroke,fill:it.defaultNode.style.fill,lineWidth:it.defaultNode.style.lineWidth},labelCfg:{style:{fill:it.nodeLabel.style.fill,fontSize:it.nodeLabel.style.fontSize,fontFamily:it.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:it.defaultNode.linkPoints.size,lineWidth:it.defaultNode.linkPoints.lineWidth,fill:it.defaultNode.linkPoints.fill,stroke:it.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:F({},it.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=e.addShape("ellipse",{attrs:a,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});e.shapeMap["ellipse-keyShape"]=o;var s=i.width,u=i.height,l=i.show,f=i.text;return l&&(f?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:F({x:-s/2,y:-u/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,l=i.size,f=i.r,c=Ln(i,["top","left","right","bottom","size","r"]),d=this.getSize(t),h=d[0]/2,v=d[1]/2;o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},c),{x:-h,y:0,r:l/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},c),{x:h,y:0,r:l/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:-v,r:l/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:v,r:l/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=Mt({},e,n),a=this.getSize(t),o=a[0]/2,s=a[1]/2,u=F({x:0,y:0,rx:o,ry:s},i);return u},update:function(t,e,n){var i=e.getContainer(),a=this.getOptions({}).style,o=this.getSize(t),s={stroke:t.color,rx:o[0]/2,ry:o[1]/2},u=e.get("keyShape"),l=Mt({},a,u.attr(),s);l=Mt(l,t.style),this.updateShape(t,e,l,!0,n),this.updateLinkPoints(t,i)}},"single-node");Bo("diamond",{options:{size:[80,80],style:{stroke:it.defaultNode.style.stroke,fill:it.defaultNode.style.fill,lineWidth:it.defaultNode.style.lineWidth},labelCfg:{style:{fill:it.nodeLabel.style.fill,fontSize:it.nodeLabel.style.fontSize,fontFamily:it.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:it.defaultNode.linkPoints.size,lineWidth:it.defaultNode.linkPoints.lineWidth,fill:it.defaultNode.linkPoints.fill,stroke:it.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:F({},it.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,u=i.height,l=i.show,f=i.text;return l&&(f?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:F({x:-s/2,y:-u/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,l=i.size,f=i.r,c=Ln(i,["top","left","right","bottom","size","r"]),d=this.getSize(t),h=d[0],v=d[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},c),{x:-h/2,y:0,r:l/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},c),{x:h/2,y:0,r:l/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:-v/2,r:l/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:v/2,r:l/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(t){var e=this.getSize(t),n=e[0],i=e[1],a=[["M",0,-i/2],["L",n/2,0],["L",0,i/2],["L",-n/2,0],["Z"]];return a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=Mt({},e,n),a=this.getPath(t),o=F({path:a},i);return o},update:function(t,e,n){var i=e.getContainer(),a=this.getOptions({}).style,o=this.getPath(t),s={stroke:t.color,path:o},u=e.get("keyShape"),l=Mt({},a,u.attr(),s);l=Mt(l,t.style),this.updateShape(t,e,l,!0,n),this.updateLinkPoints(t,i)}},"single-node");Bo("triangle",{options:{size:40,direction:"up",style:{stroke:it.defaultNode.style.stroke,fill:it.defaultNode.style.fill,lineWidth:it.defaultNode.style.lineWidth},labelCfg:{style:{fill:it.nodeLabel.style.fill,fontSize:it.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:it.defaultNode.linkPoints.size,lineWidth:it.defaultNode.linkPoints.lineWidth,fill:it.defaultNode.linkPoints.fill,stroke:it.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:F({},it.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var n=this.mergeStyle||this.getOptions(t),i=n.icon,a=i===void 0?{}:i,o=n.direction,s=this.getShapeStyle(t),u=t.direction||o,l=e.addShape("path",{attrs:s,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=l;var f=a.width,c=a.height,d=a.show,h=a.offset,v=a.text;if(d)if(v)e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var p=-f/2,g=-c/2;(u==="up"||u==="down")&&(g+=h),(u==="left"||u==="right")&&(p+=h),e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:F({x:p,y:g},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(t,e),l},drawLinkPoints:function(t,e){var n=this.mergeStyle||this.getOptions(t),i=n.linkPoints,a=i===void 0?{}:i,o=n.direction,s=t.direction||o,u=a.top,l=a.left,f=a.right,c=a.bottom,d=a.size,h=a.r,v=Ln(a,["top","left","right","bottom","size","r"]),p=this.getSize(t),g=p[0];if(l){var y=null,m=g*Math.sin(1/3*Math.PI),b=g*Math.sin(1/3*Math.PI);s==="up"?y=[-b,m]:s==="down"?y=[-b,-m]:s==="left"&&(y=[-b,b-m]),y&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},v),{x:y[0],y:y[1],r:d/2||h||5}),className:"link-point-left",name:"link-point-left"}))}if(f){var x=null,m=g*Math.sin(1/3*Math.PI),b=g*Math.sin(1/3*Math.PI);s==="up"?x=[b,m]:s==="down"?x=[b,-m]:s==="right"&&(x=[b,b-m]),x&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},v),{x:x[0],y:x[1],r:d/2||h||5}),className:"link-point-right",name:"link-point-right"}))}if(u){var w=null,m=g*Math.sin(1/3*Math.PI),b=g*Math.sin(1/3*Math.PI);s==="up"?w=[b-m,-m]:s==="left"?w=[b,-m]:s==="right"&&(w=[-b,-m]),w&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},v),{x:w[0],y:w[1],r:d/2||h||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var E=null,m=g*Math.sin(1/3*Math.PI),b=g*Math.sin(1/3*Math.PI);s==="down"?E=[-b+m,m]:s==="left"?E=[b,m]:s==="right"&&(E=[-b,m]),E&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},v),{x:E[0],y:E[1],r:d/2||h||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(t){var e=(this.mergeStyle||this.getOptions(t)).direction,n=t.direction||e,i=this.getSize(t),a=i[0],o=a*Math.sin(1/3*Math.PI),s=a*Math.sin(1/3*Math.PI),u=[["M",-s,o],["L",0,-o],["L",s,o],["Z"]];return n==="down"?u=[["M",-s,-o],["L",s,-o],["L",0,o],["Z"]]:n==="left"?u=[["M",-s,s-o],["L",s,-s],["L",s,s],["Z"]]:n==="right"&&(u=[["M",s,s-o],["L",-s,s],["L",-s,-s],["Z"]]),u},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=Mt({},e,n),a=this.getPath(t),o=F({path:a},i);return o},update:function(t,e,n){var i=e.getContainer(),a=this.getOptions({}).style,o=this.getPath(t),s={stroke:t.color,path:o},u=e.get("keyShape"),l=Mt({},a,u.attr(),s);l=Mt(l,t.style),this.updateShape(t,e,l,!0,n),this.updateLinkPoints(t,i)},updateLinkPoints:function(t,e){var n=this.getOptions({}),i=n.linkPoints,a=n.direction,o=t.direction||a,s=e.shapeMap["link-point-left"]||e.find(function(N){return N.get("className")==="link-point-left"}),u=e.shapeMap["link-point-right"]||e.find(function(N){return N.get("className")==="link-point-right"}),l=e.shapeMap["link-point-top"]||e.find(function(N){return N.get("className")==="link-point-top"}),f=e.shapeMap["link-point-bottom"]||e.find(function(N){return N.get("className")==="link-point-bottom"}),c=i,d=s||u||l||f;d&&(c=d.attr());var h=Mt({},c,t.linkPoints),v=h.fill,p=h.stroke,g=h.lineWidth,y=h.size/2;y||(y=h.r);var m=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},b=m.left,x=m.right,w=m.top,E=m.bottom,_=this.getSize(t),M=_[0],C={r:y,fill:v,stroke:p,lineWidth:g},S=null,A=M*Math.sin(1/3*Math.PI),T=M*Math.sin(1/3*Math.PI);o==="up"?S=[-T,A]:o==="down"?S=[-T,-A]:o==="left"&&(S=[-T,T-A]),S&&(s?!b&&b!==void 0?(s.remove(),delete e.shapeMap["link-point-left"]):s.attr(F(F({},C),{x:S[0],y:S[1]})):b&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},C),{x:S[0],y:S[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var I=null;o==="up"?I=[T,A]:o==="down"?I=[T,-A]:o==="right"&&(I=[T,T-A]),I&&(u?!x&&x!==void 0?(u.remove(),delete e.shapeMap["link-point-right"]):u.attr(F(F({},C),{x:I[0],y:I[1]})):x&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},C),{x:I[0],y:I[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var k=null;o==="up"?k=[T-A,-A]:o==="left"?k=[T,-A]:o==="right"&&(k=[-T,-A]),k&&(l?!w&&w!==void 0?(l.remove(),delete e.shapeMap["link-point-top"]):l.attr(F(F({},C),{x:k[0],y:k[1]})):w&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},C),{x:k[0],y:k[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var P=null;o==="down"?P=[-T+A,A]:o==="left"?P=[T,A]:o==="right"&&(P=[-T,A]),P&&(f?!E&&E!==void 0?(f.remove(),delete e.shapeMap["link-point-bottom"]):f.attr(F(F({},C),{x:P[0],y:P[1]})):E&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},C),{x:P[0],y:P[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node");Bo("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:it.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:it.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:it.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).preRect,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=this.getSize(t),s=o[0],u=o[1],l=e.addShape("rect",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=l;var f=i.show,c=Ln(i,["show"]);return f&&(e.shapeMap["pre-rect"]=e.addShape("rect",{attrs:F({x:-s/2,y:-u/2,height:u},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),l},drawLogoIcon:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).logoIcon,i=n===void 0?{}:n,a=this.getSize(t),o=a[0];if(i.show){var s=i.width,u=i.height,l=i.x,f=i.y,c=i.offset,d=i.text,h=Ln(i,["width","height","x","y","offset","text"]);d?e.shapeMap["rect-logo-icon"]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},h),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):e.shapeMap["rect-logo-icon"]=e.addShape("image",{attrs:F(F({},h),{x:l||-o/2+s+c,y:f||-u/2,width:s,height:u}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).stateIcon,i=n===void 0?{}:n,a=this.getSize(t),o=a[0];if(i.show){var s=i.width,u=i.height,l=i.x,f=i.y,c=i.offset,d=i.text,h=Ln(i,["width","height","x","y","offset","text"]);d?e.shapeMap["rect-state-icon"]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},h),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):e.shapeMap["rect-state-icon"]=e.addShape("image",{attrs:F(F({},h),{x:l||o/2-s+c,y:f||-u/2,width:s,height:u}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.bottom,l=i.size,f=i.r,c=Ln(i,["top","left","right","bottom","size","r"]),d=this.getSize(t),h=d[0],v=d[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},c),{x:-h/2,y:0,r:l/2||f||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},c),{x:h/2,y:0,r:l/2||f||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:-v/2,r:l/2||f||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},c),{x:0,y:v/2,r:l/2||f||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(t,e){var n=this.getOptions(t),i=n.labelCfg,a=i===void 0?{}:i,o=n.logoIcon,s=o===void 0?{}:o,u=n.descriptionCfg,l=u===void 0?{}:u,f=this.getSize(t),c=f[0],d=null,h=s.show,v=s.width,p=-c/2+a.offset;h&&(p=-c/2+v+a.offset);var g=a.style,y=l.style,m=l.paddingTop;return Fe(t.description)?(d=e.addShape("text",{attrs:F(F({},g),{x:p,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=d,e.shapeMap["rect-description"]=e.addShape("text",{attrs:F(F({},y),{x:p,y:17+(m||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(d=e.addShape("text",{attrs:F(F({},g),{x:p,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=d),d},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=Mt({},e,n),a=this.getSize(t),o=i.width||a[0],s=i.height||a[1],u=F({x:-o/2,y:-s/2,width:o,height:s},i);return u},update:function(t,e){var n=this.mergeStyle||this.getOptions(t),i=n.style,a=i===void 0?{}:i,o=n.labelCfg,s=o===void 0?{}:o,u=n.descriptionCfg,l=u===void 0?{}:u,f=this.getSize(t),c=f[0],d=f[1],h=e.get("keyShape");h.attr(F(F({},a),{x:-c/2,y:-d/2,width:c,height:d}));var v=e.getContainer(),p=v.shapeMap["rect-logo-icon"]||v.find(function(we){return we.get("className")==="rect-logo-icon"}),g=p?p.attr():{},y=Mt({},g,t.logoIcon),m=y.width;m===void 0&&(m=this.options.logoIcon.width);var b=t.logoIcon?t.logoIcon.show:void 0,x=s.offset,w=-c/2+m+x;!b&&b!==void 0&&(w=-c/2+x);var E=v.shapeMap["node-label"]||v.find(function(we){return we.get("className")==="node-label"}),_=v.shapeMap["rect-description"]||v.find(function(we){return we.get("className")==="rect-description"});if(t.label)if(!E)v.shapeMap["node-label"]=v.addShape("text",{attrs:F(F({},s.style),{x:w,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var M=t.labelCfg?t.labelCfg.style:{},C=Mt({},E.attr(),M);t.label&&(C.text=t.label),C.x=w,Fe(t.description)&&(C.y=-5),_&&(_.resetMatrix(),_.attr({x:w})),E.resetMatrix(),E.attr(C)}if(Fe(t.description)){var S=l.paddingTop;if(!_)v.shapeMap["rect-description"]=v.addShape("text",{attrs:F(F({},l.style),{x:w,y:17+(S||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var M=t.descriptionCfg?t.descriptionCfg.style:{},A=Mt({},_.attr(),M);Fe(t.description)&&(A.text=t.description),A.x=w,_.resetMatrix(),_.attr(F(F({},A),{y:17+(S||0)}))}}var T=v.shapeMap["pre-rect"]||v.find(function(we){return we.get("className")==="pre-rect"});if(T&&!T.destroyed){var I=Mt({},T.attr(),t.preRect);T.attr(F(F({},I),{x:-c/2,y:-d/2,height:d}))}if(p&&!p.destroyed)if(!b&&b!==void 0)p.remove(),delete v.shapeMap["pre-rect"];else{var k=y.width,P=y.height,N=y.x,z=y.y,W=y.offset,D=Ln(y,["width","height","x","y","offset"]);p.attr(F(F({},D),{x:N||-c/2+k+W,y:z||-P/2,width:k,height:P}))}else b&&this.drawLogoIcon(t,v);var R=v.shapeMap["rect-state-icon"]||v.find(function(we){return we.get("className")==="rect-state-icon"}),H=R?R.attr():{},ee=Mt({},H,t.stateIcon);if(R){!ee.show&&ee.show!==void 0&&(R.remove(),delete v.shapeMap["rect-state-icon"]);var Y=ee.width,P=ee.height,N=ee.x,z=ee.y,X=ee.offset,fe=Ln(ee,["width","height","x","y","offset"]);R.attr(F(F({},fe),{x:N||c/2-Y+X,y:z||-P/2,width:Y,height:P}))}else ee.show&&this.drawStateIcon(t,v);this.updateLinkPoints(t,v)},getOptions:function(t,e){return e==="move"?t:Pr({},this.options,this.getCustomConfig(t)||{},t)}},"single-node");Bo("star",{options:{size:60,style:{stroke:it.defaultNode.style.stroke,fill:it.defaultNode.style.fill,lineWidth:it.defaultNode.style.lineWidth},labelCfg:{style:{fill:it.nodeLabel.style.fill,fontSize:it.nodeLabel.style.fontSize,fontFamily:it.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:it.defaultNode.linkPoints.size,lineWidth:it.defaultNode.linkPoints.lineWidth,fill:it.defaultNode.linkPoints.fill,stroke:it.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:F({},it.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,u=i.height,l=i.show,f=i.text;return l&&(f?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:F({x:-s/2,y:-u/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=n===void 0?{}:n,a=i.top,o=i.left,s=i.right,u=i.leftBottom,l=i.rightBottom,f=i.size,c=i.r,d=Ln(i,["top","left","right","leftBottom","rightBottom","size","r"]),h=this.getSize(t),v=h[0];if(s){var p=Math.cos(.1*Math.PI)*v,g=Math.sin((18+72*0)/180*Math.PI)*v;e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},d),{x:p,y:-g,r:f/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(a){var p=Math.cos(.5*Math.PI)*v,g=Math.sin((18+72*1)/180*Math.PI)*v;e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},d),{x:p,y:-g,r:f/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){var p=Math.cos(.9*Math.PI)*v,g=Math.sin((18+72*2)/180*Math.PI)*v;e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},d),{x:p,y:-g,r:f/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(u){var p=Math.cos(1.3*Math.PI)*v,g=Math.sin((18+72*3)/180*Math.PI)*v;e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:F(F({},d),{x:p,y:-g,r:f/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(l){var p=Math.cos(1.7*Math.PI)*v,g=Math.sin((18+72*4)/180*Math.PI)*v;e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:F(F({},d),{x:p,y:-g,r:f/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){var e=this.getSize(t),n=e[0],i=n*3/8,a=t.innerR||i;return Kn.getStarPath(n,a)},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,n={stroke:t.color},i=Mt({},e,n),a=this.getPath(t),o=F({path:a},i);return o},update:function(t,e,n){var i=e.getContainer(),a=this.getOptions({}).style,o=this.getPath(t),s={stroke:t.color,path:o},u=e.get("keyShape"),l=Mt({},a,u.attr(),s);l=Mt(l,t.style),this.updateShape(t,e,l,!0,n),this.updateLinkPoints(t,i)},updateLinkPoints:function(t,e){var n=this.getOptions({}).linkPoints,i=e.shapeMap["link-point-left"]||e.find(function(A){return A.get("className")==="link-point-left"}),a=e.shapeMap["link-point-right"]||e.find(function(A){return A.get("className")==="link-point-right"}),o=e.shapeMap["link-point-top"]||e.find(function(A){return A.get("className")==="link-point-top"}),s=e.shapeMap["link-point-left-bottom"]||e.find(function(A){return A.get("className")==="link-point-left-bottom"}),u=e.shapeMap["link-point-left-bottom"]||e.find(function(A){return A.get("className")==="link-point-right-bottom"}),l=n,f=i||a||o||s||u;f&&(l=f.attr());var c=Mt({},l,t.linkPoints),d=c.fill,h=c.stroke,v=c.lineWidth,p=c.size/2;p||(p=c.r);var g=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},y=g.left,m=g.right,b=g.top,x=g.leftBottom,w=g.rightBottom,E=this.getSize(t),_=E[0],M={r:p,fill:d,stroke:h,lineWidth:v},C=Math.cos((18+72*0)/180*Math.PI)*_,S=Math.sin((18+72*0)/180*Math.PI)*_;a?!m&&m!==void 0?(a.remove(),delete e.shapeMap["link-point-right"]):a.attr(F(F({},M),{x:C,y:-S})):m&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:F(F({},M),{x:C,y:-S}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),C=Math.cos((18+72*1)/180*Math.PI)*_,S=Math.sin((18+72*1)/180*Math.PI)*_,o?!b&&b!==void 0?(o.remove(),delete e.shapeMap["link-point-top"]):o.attr(F(F({},M),{x:C,y:-S})):b&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:F(F({},M),{x:C,y:-S}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),C=Math.cos((18+72*2)/180*Math.PI)*_,S=Math.sin((18+72*2)/180*Math.PI)*_,i?!y&&y!==void 0?(i.remove(),delete e.shapeMap["link-point-left"]):i.attr(F(F({},M),{x:C,y:-S})):y&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:F(F({},M),{x:C,y:-S}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),C=Math.cos((18+72*3)/180*Math.PI)*_,S=Math.sin((18+72*3)/180*Math.PI)*_,s?!x&&x!==void 0?(s.remove(),delete e.shapeMap["link-point-left-bottom"]):s.attr(F(F({},M),{x:C,y:-S})):x&&(e.shapeMap["link-point-left-bottom"]=e.addShape("circle",{attrs:F(F({},M),{x:C,y:-S}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),C=Math.cos((18+72*4)/180*Math.PI)*_,S=Math.sin((18+72*4)/180*Math.PI)*_,u?!w&&w!==void 0?(u.remove(),delete e.shapeMap["link-point-right-bottom"]):u.attr(F(F({},M),{x:C,y:-S})):w&&(e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:F(F({},M),{x:C,y:-S}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var ZC=Kn.defaultSubjectColors,uc="fan-shape-";Bo("donut",{options:{size:it.defaultNode.size,style:{x:0,y:0,stroke:it.defaultNode.style.stroke,fill:it.defaultNode.style.fill,lineWidth:it.defaultNode.style.lineWidth},labelCfg:{style:{fill:it.nodeLabel.style.fill,fontSize:it.nodeLabel.style.fontSize,fontFamily:it.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:it.defaultNode.linkPoints.size,lineWidth:it.defaultNode.linkPoints.lineWidth,fill:it.defaultNode.linkPoints.fill,stroke:it.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:F({},it.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=(this.mergeStyle||this.getOptions(t)).icon,i=n===void 0?{}:n,a=this.getShapeStyle(t),o=Pr({},i,t.icon),s=e.addShape("circle",{attrs:a,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});e.shapeMap["".concat(this.type,"-keyShape")]=s;var u=o.width,l=o.height,f=o.show,c=o.text;return f&&(c?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:F({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:F({x:-u/2,y:-l/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),Mge(t,e,s),this.drawLinkPoints(t,e),s},updateShape:function(t,e,n,i,a){var o=e.get("keyShape");o.attr(F({},n)),Cge(t,e,o),this.updateLabel(t,e,a),i&&this.updateIcon(t,e)}},"circle");var Mge=function(t,e,n){var i=t.donutAttrs,a=i===void 0?{}:i,o=t.donutColorMap,s=o===void 0?{}:o,u=Object.keys(a).length;if(a&&u>1){var l=a3(a,s),f=l.configs,c=l.totalValue;if(c){var d=o3(n),h=d.lineWidth,v=d.arcR,p=[v,0],g=0;if(u===1){s1(e,{arcR:v,arcBegin:p,beginAngle:g,config:f[0],fanIndex:0,lineWidth:h,totalValue:c,drawWhole:!0});return}for(var y=0;y<f.length;y++){var m=s1(e,{arcR:v,arcBegin:p,beginAngle:g,config:f[y],fanIndex:y,lineWidth:h,totalValue:c});if(m.shouldEnd)return;p=m.arcBegin,g=m.beginAngle}}}},s1=function(t,e){var n=e.arcR,i=e.arcBegin,a=e.beginAngle,o=e.config,s=e.fanIndex,u=e.lineWidth,l=e.totalValue,f=e.drawWhole,c=f===void 0?!1:f,d=e.updateShape,h=d===void 0?void 0:d,v=o.value/l;if(v<.001)return{beginAngle:a,arcBegin:i,shape:void 0,shouldEnd:!1};var p,g,y;if(c||v>.999)p=[n,1e-4],y=1;else{var m=v*Math.PI*2;g=a+m,p=[n*Math.cos(g),-n*Math.sin(g)],y=m>Math.PI?1:0}var b={path:[["M",i[0],i[1]],["A",n,n,0,y,0,p[0],p[1]]],stroke:o.color||(h==null?void 0:h.attr("stroke"))||ZC[s%ZC.length],lineWidth:u};return h?h.attr(b):t.shapeMap["".concat(uc).concat(s)]=t.addShape("path",{attrs:b,name:"".concat(uc).concat(s),draggable:!0}),{beginAngle:g,arcBegin:p,shape:t.shapeMap["".concat(uc).concat(s)],shouldEnd:c||v>.999}},Cge=function(t,e,n){var i=t.donutAttrs,a=t.donutColorMap,o=a===void 0?{}:a,s={},u=e.getContainer();if(i){var l=a3(i,o),f=l.configs,c=l.totalValue;if(c)for(var d=o3(n),h=d.lineWidth,v=d.arcR,p=[v,0],g=0,y=0;y<f.length;y++){var m="".concat(uc).concat(y),b=s1(u,{arcR:v,arcBegin:p,beginAngle:g,config:f[y],fanIndex:y,lineWidth:h,totalValue:c,drawWhole:f.length===1,updateShape:u.shapeMap[m]});if(b.shape&&(s[m]=!0),b.shouldEnd)break;p=b.arcBegin,g=b.beginAngle}}var x=Object.keys(u.shapeMap).filter(function(w){return w.includes(uc)});x.forEach(function(w){s[w]||(u.shapeMap[w].remove(!0),delete u.shapeMap[w])})},a3=function(t,e){var n=0,i=[];return Object.keys(t).forEach(function(a){var o=+t[a];isNaN(o)||(i.push({key:a,value:o,color:e[a]}),n+=o)}),{totalValue:n,configs:i}},o3=function(t){var e=t.attr("r"),n=.6*e,i=(e+n)/2,a=e-n;return{lineWidth:a,arcR:i}},Ph=function(t){var e=t.x,n=t.y;return{x:e,y:n,centerX:e,centerY:n,minX:e,minY:n,maxX:e,maxY:n,height:0,width:0}},Age=function(t){t===void 0&&(t=[]);var e=[],n=[];t.forEach(function(u){e.push(u.x),n.push(u.y)});var i=Math.min.apply(Math,e),a=Math.max.apply(Math,e),o=Math.min.apply(Math,n),s=Math.max.apply(Math,n);return{centerX:(i+a)/2,centerY:(o+s)/2,maxX:a,maxY:s,minX:i,minY:o,height:s-o,width:a-i}},Nx=function(t){for(var e=[],n={},i=t.length,a=i-1;a>=0;a--){var o=t[a];o.id="".concat(o.x,"|||").concat(o.y),n[o.id]||(n[o.id]=o,e.push(o))}return e},s3=function(t){return Nx(t)},lp=function(t,e){return t.width||t.height?{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}:t},Tge=function(t,e){var n=Math.abs(t.x-e.centerX),i=Math.abs(t.y-e.centerY);return n===0&&i===0?0:n/e.width>i/e.height},u1=function(t,e,n){var i=Tge(e,t);if(i===0){var a=t.centerX,o=t.centerY;return n.y<e.y?o=t.minY:n.x>e.x?a=t.maxX:n.x<e.x?a=t.minX:n.x===e.x&&(o=t.maxY),{x:a,y:o}}return i?{x:e.x>t.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},QC=function(t,e){var n=Math.min(t.minX,e.minX),i=Math.min(t.minY,e.minY),a=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(n+a)/2,centerY:(i+o)/2,minX:n,minY:i,maxX:a,maxY:o,height:o-i,width:a-n}},l1=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},Rh=function(t,e){var n=t.x,i=t.y;return n<e.minX||n>e.maxX||i<e.minY||i>e.maxY},Ige=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},Oge=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},Lge=function(t,e){return Ige(t,e.x).concat(Oge(t,e.y))},Dc=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},kge=function(t,e){var n=-2,i=0;return e.forEach(function(a){a&&(t.x===a.x&&(i+=n),t.y===a.y&&(i+=n))}),i},JC=function(t,e,n,i,a){return Dc(t,e)+Dc(t,n)+kge(t,[e,n,i,a])},Dge=function r(t,e,n,i,a){a===void 0&&(a=0),t.unshift(e[i]),n[i]&&n[i]!==i&&a<=100&&r(t,e,n,n[i],a+1)},Bh=function(t,e,n,i){var a=n.x-t.x,o=n.y-t.y,s=i.x-t.x,u=i.y-t.y,l=n.x-e.x,f=n.y-e.y,c=i.x-e.x,d=i.y-e.y,h=a*u-o*s,v=l*d-f*c,p=a*f-o*l,g=s*d-u*c;return h*v<=0&&p*g<=0},f1=function(t,e,n){if(n.width||n.height){var i=l1(n),a=i[0],o=i[1],s=i[2],u=i[3];return Bh(t,e,a,o)||Bh(t,e,a,u)||Bh(t,e,o,s)||Bh(t,e,s,u)}return!1},Nge=function(t,e,n,i){var a=[];return t.forEach(function(o){if(o!==e&&(o.x===e.x||o.y===e.y)){if(f1(o,e,n)||f1(o,e,i))return;a.push(o)}}),Nx(a)},Pge=function(t,e,n,i,a,o,s){var u,l=[],f=(u={},u[e.id]=e,u),c={},d={},h={};d[e.id]=0,h[e.id]=JC(e,n,e);var v=new l3;v.add({id:e.id,value:h[e.id]});var p={};t.forEach(function(w){p[w.id]=w});for(var g;Object.keys(f).length;){var y=v.minId(!1);if(y)g=f[y];else break;if(g===n){var m=[];return Dge(m,p,c,n.id),m}delete f[g.id],v.remove(g.id),l.push(g);var b=Nge(t,g,i,a),x=function(E){E.forEach(function(_){if(l.indexOf(_)===-1){var M=_.id;f[M]||(f[M]=_);var C=h[g.id]+Dc(g,_);if(d[M]&&C>=d[M]){v.add({id:M,value:h[M]});return}c[M]=g.id,d[M]=C,h[M]=d[M]+JC(_,n,e,o,s),v.add({id:M,value:h[M]})}})};x(b)}return[e,n]},Rge=function(t,e,n){return!(t.x===e.x&&e.x===n.x||t.y===e.y&&e.y===n.y)},Bge=function(t,e,n,i){var a=Dc(t,e),o=Dc(n,e);a<i&&(i=a),o<i&&(i=o);var s={x:e.x-i/a*(e.x-t.x),y:e.y-i/a*(e.y-t.y)},u={x:e.x-i/o*(e.x-n.x),y:e.y-i/o*(e.y-n.y)};return[s,u]},eA=function(t,e){var n=[],i=t[0];return n.push("M".concat(i.x," ").concat(i.y)),t.forEach(function(a,o){var s=t[o+1],u=t[o+2];if(s&&u)if(Rge(a,s,u)){var l=Bge(a,s,u,e),f=l[0],c=l[1];n.push("L".concat(f.x," ").concat(f.y)),n.push("Q".concat(s.x," ").concat(s.y," ").concat(c.x," ").concat(c.y)),n.push("L".concat(c.x," ").concat(c.y))}else n.push("L".concat(s.x," ").concat(s.y));else s&&n.push("L".concat(s.x," ").concat(s.y))}),n.join("")},u3=function(t,e,n,i,a){var o,s;if(!n||!n.getType())o=Ph(t);else if(n.getType()==="combo"){var u=n.getKeyShape().getBBox();if(u){var l=n.getModel(),f=l.x,c=l.y;o={x:f,y:c,width:u.width,height:u.height,minX:u.minX+f,maxX:u.maxX+f,minY:u.minY+c,maxY:u.maxY+c},o.centerX=(o.minX+o.maxX)/2,o.centerY=(o.minY+o.maxY)/2}else o=Ph(t)}else o=n&&n.getBBox();if(!i||!i.getType())s=Ph(e);else if(i.getType()==="combo"){var d=i.getKeyShape().getBBox();if(d){var h=i.getModel(),v=h.x,p=h.y;s={x:v,y:p,width:d.width,height:d.height,minX:d.minX+v,maxX:d.maxX+v,minY:d.minY+p,maxY:d.maxY+p},s.centerX=(s.minX+s.maxX)/2,s.centerY=(s.minY+s.maxY)/2}else s=Ph(e)}else s=i&&i.getBBox();var g=lp(o,a),y=lp(s,a),m=u1(g,t,e),b=u1(y,e,t),x=Age([m,b]),w=QC(g,x),E=QC(y,x),_=[];_=_.concat(l1(w)).concat(l1(E));var M={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[x,w,E].forEach(function(S){_=_.concat(Lge(S,M).filter(function(A){return Rh(A,g)&&Rh(A,y)}))}),[{x:m.x,y:b.y},{x:b.x,y:m.y}].forEach(function(S){Rh(S,g)&&Rh(S,y)&&_.push(S)}),_.unshift(m),_.push(b),_=Nx(_);var C=Pge(_,m,b,o,s,t,e);return C.unshift(t),C.push(e),s3(C)},Fge=function(t){if(!(t!=null&&t.length))return t;for(var e=t[t.length-1],n={x:e.x,y:e.y},i=[e],a=[e],o=t.length-2;o>=0;o--){var s=t[o];if(s.x===n.x?i.push(s):(i=[s],n.x=s.x),s.y===n.y?a.push(s):(a=[s],n.y=s.y),i.length>2){var u=t.indexOf(i[1]);u>-1&&t.splice(u,1);continue}if(a.length>2){var u=t.indexOf(a[1]);u>-1&&t.splice(u,1)}}return t},l3=function(){function r(){this.arr=[],this.map={},this.arr=[],this.map={}}return r.prototype._innerAdd=function(t,e){for(var n=[0,e-1];n[1]-n[0]>1;){var i=Math.floor((n[0]+n[1])/2);if(this.arr[i].value>t.value)n[1]=i;else if(this.arr[i].value<t.value)n[0]=i;else{this.arr.splice(i,0,t),this.map[t.id]=!0;return}}this.arr.splice(n[1],0,t),this.map[t.id]=!0},r.prototype.add=function(t){delete this.map[t.id];var e=this.arr.length;if(!e){this.arr.push(t),this.map[t.id]=!0;return}if(this.arr[e-1].value<t.value){this.arr.push(t),this.map[t.id]=!0;return}this._innerAdd(t,e)},r.prototype.remove=function(t){this.map[t]&&delete this.map[t]},r.prototype._clearAndGetMinId=function(){for(var t,e=this.arr.length-1;e>=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t},r.prototype._findFirstId=function(){for(;this.arr.length;){var t=this.arr.shift();if(this.map[t.id])return t.id}},r.prototype.minId=function(t){return t?this._clearAndGetMinId():this._findFirstId()},r}(),zge=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Gge=function(t,e,n,i,a){return s3(u3(t,e,n,i,a.offset))},$ge={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:zge,fallbackRoute:Gge},ko=function(t,e){var n=Math.round(Math.abs(t/e)),i=t<0?-1:1;return n<0?0:i*n},Uge=function(t,e,n){var i={};return t.forEach(function(a){if(a)for(var o=lp(a.getBBox(),n),s=ko(o.minX,e);s<=ko(o.maxX,e);s+=1)for(var u=ko(o.minY,e);u<=ko(o.maxY,e);u+=1)i["".concat(s,"|||").concat(u)]=!0}),i},_y=function(t,e){var n=e.x-t.x,i=e.y-t.y;return n||i?Math.atan2(i,n):0},tA=function(t,e){var n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n},rA=function(t,e,n){for(var i=1/0,a=0,o=e.length;a<o;a++){var s=n(t,e[a]);s<i&&(i=s)}return i},nA=function(t,e,n,i,a){var o=[];if(!n)return[t];var s=a.directions,u=a.offset,l=n.getBBox(),f=e.x>l.minX&&e.x<l.maxX&&e.y>l.minY&&e.y<l.maxY,c=lp(l,u);for(var d in c)c[d]=ko(c[d],a.gridSize);if(f){for(var h=0,v=s;h<v.length;h++)for(var p=v[h],g=[[{x:c.minX,y:c.minY},{x:c.maxX,y:c.minY}],[{x:c.minX,y:c.minY},{x:c.minX,y:c.maxY}],[{x:c.maxX,y:c.minY},{x:c.maxX,y:c.maxY}],[{x:c.minX,y:c.maxY},{x:c.maxX,y:c.maxY}]],d=0;d<4;d++){var y=g[d],m=Kn.getLineIntersect(t,{x:t.x+p.stepX*c.width,y:t.y+p.stepY*c.height},y[0],y[1]);m&&!f1(t,m,l)&&(m.id="".concat(m.x,"|||").concat(m.y),o.push(m))}return o}var b=u1(c,t,i);return b.id="".concat(b.x,"|||").concat(b.y),[b]},c1=function(t,e,n,i){var a=_y(t,e),o=n[t.id];if(!o){var s=_y(i,t);return tA(s,a)}var u=_y({x:o.x,y:o.y},t);return tA(u,a)},jge=function(t,e,n,i,a,o,s){var u=[i],l=i,f=t.id,c=t.x,d=t.y,h={x:c,y:d,id:f};c1(h,o,e,n)&&(l={x:o.x===i.x?i.x:h.x*s,y:o.y===i.y?i.y:h.y*s},u.unshift(l));for(var v=e[f];v&&v.id!==f;){var p={x:c,y:d,id:f},g={x:v.x,y:v.y,id:v.id},y=c1(g,p,e,n);y&&(l={x:g.x===p.x?l.x:g.x*s,y:g.y===p.y?l.y:g.y*s},u.unshift(l)),f=g.id,c=g.x,d=g.y,v=e[f]}return u[0].x=c===n.x?a.x:l.x,u[0].y=d===n.y?a.y:l.y,u.unshift(a),u},Wge=function(t,e,n,i,a){if(isNaN(t.x)||isNaN(e.x))return[];var o=Pr($ge,a);o.obstacles=o.obstacles||[];var s=o.penalties,u=o.gridSize,l=Uge(o.obstacles.concat([n,i]),u,o.offset),f={x:ko(t.x,u),y:ko(t.y,u)},c={x:ko(e.x,u),y:ko(e.y,u)};t.id="".concat(f.x,"|||").concat(f.y),e.id="".concat(c.x,"|||").concat(c.y);var d=nA(f,t,n,c,o),h=nA(c,e,i,f,o);d.forEach(function(D){delete l[D.id]}),h.forEach(function(D){delete l[D.id]});for(var v={},p={},g={},y={},m={},b=new l3,x=0;x<d.length;x++){var w=d[x];v[w.id]=w,y[w.id]=0,m[w.id]=rA(w,h,o.distFunc),b.add({id:w.id,value:m[w.id]})}var E=o.maximumLoops,_,M,C,S,A,T,I=1/0,k={};for(h.forEach(function(D){k["".concat(D.x,"|||").concat(D.y)]=!0}),Object.keys(v).forEach(function(D){var R=v[D].id;m[R]<=I&&(I=m[R],_=v[R])});Object.keys(v).length>0&&E>0;){var P=b.minId((E+1)%30===0);if(P)_=v[P];else break;if(k["".concat(_.x,"|||").concat(_.y)])return jge(_,g,f,e,t,c,u);delete v[_.id],b.remove(_.id),p[_.id]=!0;for(var x=0;x<o.directions.length;x++){M=o.directions[x];var N="".concat(Math.round(_.x)+M.stepX,"|||").concat(Math.round(_.y)+M.stepY);if(C={x:_.x+M.stepX,y:_.y+M.stepY,id:N},!p[N]&&(T=c1(_,C,g,f),!(T>o.maxAllowedDirectionChange)&&!l[N])){v[N]||(v[N]=C);var z=s[T];S=o.distFunc(_,C)+(isNaN(z)?u:z),A=y[_.id]+S;var W=y[N];W&&A>=W||(g[N]=_,y[N]=A,m[N]=A+rA(C,h,o.distFunc),b.add({id:N,value:m[N]}))}}E-=1}return o.fallbackRoute(t,e,n,i,o)};CL("polyline",{options:{color:it.defaultEdge.color,size:it.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:it.defaultEdge.style.stroke,lineAppendWidth:it.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:it.edgeLabel.style.fill,fontSize:it.edgeLabel.style.fontSize,fontFamily:it.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:F({},it.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);n.radius===0&&delete n.radius;var i=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n});return e.shapeMap["edge-shape"]=i,i},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},i=Mt({},e,n,t.style);t=this.getPathPoints(t),this.radius=i.radius,this.offset=i.offset;var a=t.startPoint,o=t.endPoint,s=this.getControlPoints(t),u=[a];s&&(u=u.concat(s)),u.push(o);var l=t.sourceNode,f=t.targetNode,c=i.radius,d=this.options.routeCfg,h=Mt({},d,t.routeCfg);h.offset=i.offset;var v=this.getPath(u,l,f,c,h,!s);(wt(v)&&v.length<=1||Fe(v)&&v.indexOf("L")===-1)&&(v="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(o.x)||isNaN(o.y))&&(v="M0 0, L0 0");var p=Mt({},it.defaultEdge.style,i,{lineWidth:t.size,path:v});return p},updateShapeStyle:function(t,e){var n=e.getContainer();if(e.isVisible()){var i={stroke:t.color},a=n.shapeMap["edge-shape"]||n.find(function(x){return x.get("className")==="edge-shape"})||e.getKeyShape(),o=t.size;t=this.getPathPoints(t);var s=t.startPoint,u=t.endPoint,l=this.getControlPoints(t),f=[s];l&&(f=f.concat(l)),f.push(u);var c=a.attr(),d=Mt({},i,c,t.style),h=t.sourceNode,v=t.targetNode,p=d.radius,g=this.options.routeCfg,y=Mt({},g,t.routeCfg);y.offset=d.offset;var m=this.getPath(f,h,v,p,y,!l);(wt(m)&&m.length<=1||Fe(m)&&m.indexOf("L")===-1)&&(m="M0 0, L0 0"),(isNaN(s.x)||isNaN(s.y)||isNaN(u.x)||isNaN(u.y))&&(m="M0 0, L0 0"),c.endArrow&&d.endArrow===!1&&(t.style.endArrow={path:""}),c.startArrow&&d.startArrow===!1&&(t.style.startArrow={path:""});var b=Mt(i,a.attr(),{lineWidth:o,path:m},t.style);a&&a.attr(b)}},getPath:function(t,e,n,i,a,o){var s=a.offset,u=a.obstacles,l=a.simple;if(!s||t.length>2||o===!1){if(i)return eA(t,i);var f=[];return xe(t,function(v,p){p===0?f.push(["M",v.x,v.y]):f.push(["L",v.x,v.y])}),f}l!==!1&&!(u!=null&&u.length)&&(l=!0);var c=l?u3(t[t.length-1],t[0],n,e,s):Wge(t[0],t[t.length-1],e,n,a);if(!c||!c.length)return"M0 0, L0 0";if(i){var d=eA(c,i);return d}c=Fge(c);var h=Kn.pointsToPolygon(c);return h}},"single-edge");var iA=jo.cloneEvent,aA=jo.isNaN,oA=Math.abs,Xge=10,Yge=["shift","ctrl","alt","control"];const Vge={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,n=+t.clientX,i=+t.clientY;if(!(aA(n)||aA(i))){var a=n-e.x,o=i-e.y;this.get("direction")==="x"?o=0:this.get("direction")==="y"&&(a=0),this.origin={x:n,y:i};var s=this.graph.get("width"),u=this.graph.get("height"),l=this.graph.get("canvas").getCanvasBBox(),f=this.scalableRange,c=this.scalableRange;f<1&&f>-1&&(f=s*f,c=u*c),(l.minX<=s+f&&l.minX+a>s+f||l.maxX+f>=0&&l.maxX+f+a<0)&&(a=0),(l.minY<=u+c&&l.minY+o>u+c||l.maxY+c>=0&&l.maxY+c+o<0)&&(o=0),this.graph.translate(a,o)}},onTouchStart:function(t){var e=this,n=t.originalEvent.touches,i=n[0],a=n[1];i&&a||(t.preventDefault(),this.mousedown=!0,e.onDragStart(t))},onMouseDown:function(t){this.mousedown=!0},onDragMove:function(t){this.mousedown&&(this.dragstart?this.onDrag(t):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=this,n=t.originalEvent;if(!(n&&t.name!=="touchstart"&&n.button!==0)&&!(t.name!=="touchstart"&&typeof window<"u"&&window.event&&!window.event.buttons&&!window.event.button)&&this.shouldBegin(t,this)&&!e.keydown&&this.allowDrag(t)){if(e.origin={x:t.clientX,y:t.clientY},e.dragging=!1,this.enableOptimize){for(var i=this.graph,a=i.getEdges(),o=0,s=a.length;o<s;o++){var u=a[o].get("group").get("children");u&&u.forEach(function(b){b.set("ori-visibility",b.get("ori-visibility")||b.get("visible")),b.hide()})}for(var l=i.getNodes(),f=0,c=l.length;f<c;f++)for(var d=l[f].getContainer(),h=d.get("children"),v=0,p=h;v<p.length;v++){var g=p[v],y=g.get("isKeyShape");y||(g.set("ori-visibility",g.get("ori-visibility")||g.get("visible")),g.hide())}}if(typeof window<"u"){var m=this;this.handleDOMContextMenu=function(b){return m.onMouseUp(b)},document.body.addEventListener("contextmenu",this.handleDOMContextMenu)}}},onTouchMove:function(t){var e=this,n=t.originalEvent.touches,i=n[0],a=n[1];if(i&&a){this.onMouseUp(t);return}t.preventDefault(),e.onDrag(t)},onDrag:function(t){if(this.mousedown){var e=this.graph;if(!this.keydown&&this.allowDrag(t)&&(t=iA(t),!!this.origin)){if(this.dragging)t.type="drag",e.emit("canvas:drag",t);else{if(oA(this.origin.x-t.clientX)+oA(this.origin.y-t.clientY)<Xge)return;this.shouldBegin(t,this)&&(t.type="dragstart",e.emit("canvas:dragstart",t),this.originPosition={x:t.clientX,y:t.clientY},this.dragging=!0)}this.shouldUpdate(t,this)&&this.updateViewport(t)}}},onMouseUp:function(t){var e,n;this.mousedown=!1,this.dragstart=!1;var i=this.graph;if(!this.keydown){var a=i.getZoom(),o=i.get("modeController"),s=(n=(e=o==null?void 0:o.modes[o.mode])===null||e===void 0?void 0:e.filter(function(_){return _.type==="zoom-canvas"}))===null||n===void 0?void 0:n[0],u=s?s.optimizeZoom||.1:0;if(this.enableOptimize){for(var l=i.getEdges(),f=0,c=l.length;f<c;f++){var d=l[f].get("group").get("children");d&&d.forEach(function(_){var M=_.get("ori-visibility");_.set("ori-visibility",void 0),M&&_.show()})}if(a>u)for(var h=i.getNodes(),v=0,p=h.length;v<p;v++)for(var g=h[v].getContainer(),y=g.get("children"),m=0,b=y;m<b.length;m++){var x=b[m],w=x.get("isKeyShape");if(!w){var E=x.get("ori-visibility");x.set("ori-visibility",void 0),E&&x.show()}}}if(!this.dragging){this.origin=null;return}t=iA(t),this.shouldEnd(t,this)&&this.updateViewport(t),t.type="dragend",t.dx=t.clientX-this.originPosition.x,t.dy=t.clientY-this.originPosition.y,i.emit("canvas:dragend",t),this.endDrag(),typeof window<"u"&&document.body.removeEventListener("contextmenu",this.handleDOMContextMenu)}},endDrag:function(){this.origin=null,this.dragging=!1,this.dragbegin=!1,this.mousedown=!1,this.dragstart=!1},onKeyDown:function(t){var e=this,n=t.key;n&&(Yge.indexOf(n.toLowerCase())>-1?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(t){var e,n,i=t.target,a=i&&i.isCanvas&&i.isCanvas();if(Bc(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(Wn(this.allowDragOnItem)){var o=this.allowDragOnItem,s=o.node,u=o.edge,l=o.combo,f=(n=(e=t.item)===null||e===void 0?void 0:e.getType)===null||n===void 0?void 0:n.call(e);if(!s&&f==="node"||!u&&f==="edge"||!l&&f==="combo")return!1}return!0}},Hge={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(t){if(!this.origin||!t||t.destroyed)return!1;var e=t.getType();return e==="combo"},onTouchStart:function(t){if(t.item){var e=this;try{var n=t.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;t.preventDefault()}catch{console.warn("Touch original event not exist!")}this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},this.dragstart=!0,e.onDragStart(t)}},onTouchMove:function(t){var e=this;try{var n=t.originalEvent.touches,i=n[0],a=n[1];if(i&&a){e.onDragEnd(t);return}t.preventDefault()}catch{console.warn("Touch original event not exist!")}e.onDrag(t)},onMouseDown:function(t){this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},typeof window<"u"&&!this.windowEventBinded&&(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(t){var e,n;if(((n=(e=t.item)===null||e===void 0?void 0:e.getType)===null||n===void 0?void 0:n.call(e))!=="node"){this.onDragEnd();return}this.mousedown&&(this.dragstart?this.onDrag(F(F({},t),this.mousedown)):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=this;if(this.currentShouldEnd=!0,!!this.shouldBegin(F(F({},t),this.mousedown),this)){var n=this.mousedown,i=n.item,a=n.target;if(!(!i||i.destroyed||i.hasLocked())){var o=i.getContainer();if(o.set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(i),a){var s=a.get("isAnchorPoint");if(s)return}var u=this.graph;this.targets=[],this.targetCombo=null;var l=u.findAllByState("node",this.selectedState),f=i.get("id"),c=l.filter(function(h){var v=h.get("id");return f===v});if(c.length===0?this.targets.push(i):l.length>1?l.forEach(function(h){var v=h.hasLocked();v||e.targets.push(h)}):this.targets.push(i),this.graph.get("enabledStack")&&this.enableStack){var d=[];this.targets.forEach(function(h){var v=h.getModel(),p=v.x,g=v.y,y=v.id;d.push({x:p,y:g,id:y})}),this.set("beforeDragNodes",d)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(h){var v=h.getEdges();v.forEach(function(p){p.isVisible()&&(e.hidenEdge[p.getID()]=!0,p.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;if(!(!this.mousedown||!this.origin)&&this.shouldUpdate(t,this))if(this.get("enableDelegate"))this.updateDelegate(t);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var n={};this.targets.map(function(i){e.update(i,t);var a=i.getModel().comboId;a&&(n[a]=e.graph.findById(a))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(t){var e=this,n;if(this.mousedown=!1,this.dragstart=!1,typeof window<"u"&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),!!this.origin){(n=this.cachedCaptureItems)===null||n===void 0||n.forEach(function(o){var s=o.getContainer();s.set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(o){var s=o.getEdges();s.forEach(function(u){e.hidenEdge[u.getID()]&&u.show(),u.refresh()})}),this.hidenEdge={};var i=this.graph;if(i.get("enabledStack")&&this.enableStack){var a={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(o){a.before.nodes.push(o)}),this.targets.forEach(function(o){var s=o.getModel(),u=s.x,l=s.y,f=s.id;a.after.nodes.push({x:u,y:l,id:f})}),i.pushStack("update",ar(a))}i.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.currentShouldEnd=this.shouldEnd(t,e,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.currentShouldEnd||!this.validationCombo(e))){var n=this.graph;if(this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)n.updateCombos();else{var i=e.getModel();this.targets.map(function(a){var o=a.getModel();o.comboId!==i.id&&n.updateComboTree(a,i.id)}),n.updateCombo(e)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.currentShouldEnd=this.shouldEnd(t,void 0,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.targets||this.targets.length===0||!this.currentShouldEnd)&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map(function(n){var i=n.getModel();i.comboId&&e.updateComboTree(n)}))},onDropNode:function(t){if(!(!this.targets||this.targets.length===0)){var e=this,n=t.item,i=e.graph,a=n.getModel().comboId,o=a?i.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(t,o,this),this.updatePositions(t,!this.currentShouldEnd),!!this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(a){var s=i.findById(a);e.comboActiveState&&i.setItemState(s,e.comboActiveState,!1),this.targets.map(function(u){var l=u.getModel();a!==l.comboId&&i.updateComboTree(u,a)}),i.updateCombo(s)}else this.targets.map(function(u){var l=u.getModel();l.comboId&&i.updateComboTree(u)});i.emit("dragnodeend",{items:this.targets,targetItem:n})}}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t,e){var n=this;!this.targets||this.targets.length===0||(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):e||this.targets.map(function(i){return n.update(i,t)}):this.targets.map(function(i){return n.update(i,t,e)}))},update:function(t,e,n){var i=this.origin,a=t.get("model"),o=t.get("id");this.point[o]||(this.point[o]={x:a.x||0,y:a.y||0});var s=e.x-i.x+this.point[o].x,u=e.y-i.y+this.point[o].y;n&&(s+=i.x-e.x,u+=i.y-e.y);var l={x:s,y:u};this.get("updateEdge")?this.graph.updateItem(t,l,!1):t.updatePosition(l)},debounceUpdate:Fc(function(r){var t=r.targets,e=r.graph,n=r.point,i=r.origin,a=r.evt,o=r.updateEdge,s=r.onlyChangeComboSize,u=r.updateParentCombos;t.map(function(l){var f=l.get("model"),c=l.get("id");n[c]||(n[c]={x:f.x||0,y:f.y||0});var d=a.x-i.x+n[c].x,h=a.y-i.y+n[c].y,v={x:d,y:h};o?e.updateItem(l,v,!1):l.updatePosition(v)}),s&&u(e,t)},50,!0),updateDelegate:function(t){var e=this.graph;if(this.delegateRect){var d=t.x-this.origin.x+this.originPoint.minX,h=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:d,y:h})}else{var n=e.get("group"),i=Pr({},su.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),o=a.x,s=a.y,u=a.width,l=a.height,f=a.minX,c=a.minY;this.originPoint={x:o,y:s,width:u,height:l,minX:f,minY:c},this.delegateRect=n.addShape("rect",{attrs:F({width:u,height:l,x:o,y:s},i),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.targets;e.length===0&&e.push(t.item);for(var n=1/0,i=-1/0,a=1/0,o=-1/0,s=0;s<e.length;s++){var u=e[s],l=u.getBBox(),f=l.minX,c=l.minY,d=l.maxX,h=l.maxY;f<n&&(n=f),c<a&&(a=c),d>i&&(i=d),h>o&&(o=h)}var v=Math.floor(n),p=Math.floor(a),g=Math.ceil(i)-Math.floor(n),y=Math.ceil(o)-Math.floor(a);return{x:v,y:p,width:g,height:y,minX:n,minY:a}},updateParentCombos:function(t,e){var n=t||this.graph,i=e||this.targets,a={};i==null||i.forEach(function(o){var s=o.getModel().comboId;s&&(a[s]=n.findById(s))}),Object.values(a).forEach(function(o){o&&n.updateCombo(o)})}};var Fh=null;const Kge={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return this.get("trigger")==="mouseenter"?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(t){var e=this;try{var n=t.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;t.preventDefault()}catch{console.warn("Touch original event not exist!")}e.setAllItemStates(t)},clearOnTouchStart:function(t){var e=this;try{var n=t.originalEvent.touches,i=n[0],a=n[1];if(i&&a)return;t.preventDefault()}catch{console.warn("Touch original event not exist!")}e.clearActiveState(t)},setAllItemStates:function(t){clearTimeout(this.timer),this.throttleSetAllItemStates(t,this)},clearActiveState:function(t){var e=this,n=this.shouldClearStatusOnSecond;n&&(Fh=null),this.timer=setTimeout(function(){e.throttleClearActiveState(t,e)},50)},throttleSetAllItemStates:fc(function(r,t){var e=r.item,n=t.graph;if(!(!n||n.destroyed)&&(t.item=e,!!t.shouldUpdate(r.item,{event:r,action:"activate"},t))){var i=t.shouldClearStatusOnSecond,a=e.getModel().id;if(Fh===a&&i){t.throttleClearActiveState(r,t),Fh=null;return}for(var o=t.activeState,s=t.inactiveState,u=n.getNodes(),l=n.getCombos(),f=n.getEdges(),c=n.get("vedges"),d=u.length,h=l.length,v=f.length,p=c.length,g=t.inactiveItems||{},y=t.activeItems||{},m=0;m<d;m++){var b=u[m],x=b.getID(),w=b.hasState("selected");t.resetSelected&&w&&n.setItemState(b,"selected",!1),y[x]&&(n.setItemState(b,o,!1),delete y[x]),s&&!g[x]&&(n.setItemState(b,s,!0),g[x]=b)}for(var m=0;m<h;m++){var E=l[m],_=E.getID(),w=E.hasState("selected");t.resetSelected&&w&&n.setItemState(E,"selected",!1),y[_]&&(n.setItemState(E,o,!1),delete y[_]),s&&!g[_]&&(n.setItemState(E,s,!0),g[_]=E)}for(var m=0;m<v;m++){var M=f[m],C=M.getID();y[C]&&(n.setItemState(M,o,!1),delete y[C]),s&&!g[C]&&(n.setItemState(M,s,!0),g[C]=M)}for(var m=0;m<p;m++){var S=c[m],A=S.getID();y[A]&&(n.setItemState(S,o,!1),delete y[A]),s&&!g[A]&&(n.setItemState(S,s,!0),g[A]=S)}if(e&&!e.destroyed){s&&(n.setItemState(e,s,!1),delete g[e.getID()]),y[e.getID()]||(n.setItemState(e,o,!0),y[e.getID()]=e);for(var T=e.getEdges(),I=T.length,m=0;m<I;m++){var M=T[m],C=M.getID(),k=void 0;M.getSource()===e?k=M.getTarget():k=M.getSource();var P=k.getID();s&&g[P]&&(n.setItemState(k,s,!1),delete g[P]),y[P]||(n.setItemState(k,o,!0),y[P]=k),g[C]&&(n.setItemState(M,s,!1),delete g[C]),y[C]||(n.setItemState(M,o,!0),y[C]=M),M.toFront()}}t.activeItems=y,t.inactiveItems=g,i&&(Fh=e.getModel().id),n.emit("afteractivaterelations",{item:r.item,action:"activate"})}},50,{trailing:!0,leading:!0}),throttleClearActiveState:fc(function(r,t){var e=t.get("graph");if(!(!e||e.destroyed)&&t.shouldUpdate(r.item,{event:r,action:"deactivate"},t)){var n=t.activeState,i=t.inactiveState,a=t.activeItems||{},o=t.inactiveItems||{};Object.values(a).filter(function(s){return!s.destroyed}).forEach(function(s){e.clearItemStates(s,n)}),Object.values(o).filter(function(s){return!s.destroyed}).forEach(function(s){e.clearItemStates(s,i)}),t.activeItems={},t.inactiveItems={},e.emit("afteractivaterelations",{item:r.item||t.get("item"),action:"deactivate"})}},50,{trailing:!0,leading:!0})};var zh=Math.min,sA=Math.max,uA=Math.abs,lA="shift",qge=["drag","shift","ctrl","alt","control"];const Zge={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:lA,includeEdges:!0,includeCombos:!1,selectOnCombo:!1,selectedEdges:[],selectedNodes:[],selectedCombos:[]}},getEvents:function(){return qge.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=lA,console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.trigger==="drag"?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(t){var e=t.item,n=this.brush,i=this.selectOnCombo,a=(e==null?void 0:e.getType())==="combo";a&&!i||!a&&e||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),n||(n=this.createBrush()),this.originPoint={x:t.canvasX,y:t.canvasY},n.attr({width:0,height:0}),n.show(),this.dragging=!0)},onMouseMove:function(t){this.dragging&&(this.trigger!=="drag"&&!this.keydown||this.updateBrush(t))},onMouseUp:function(t){this.graph,!(!this.brush&&!this.dragging)&&(this.trigger!=="drag"&&!this.keydown||(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1))},clearStates:function(){var t=this,e=t.graph,n=t.selectedState,i=e.findAllByState("node",n),a=e.findAllByState("edge",n),o=e.findAllByState("combo",n);i.forEach(function(s){return e.setItemState(s,n,!1)}),a.forEach(function(s){return e.setItemState(s,n,!1)}),o.forEach(function(s){return e.setItemState(s,n,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(t,e,n,i,a){var o=t.getBBox();return o.centerX>=e&&o.centerX<=n&&o.centerY>=i&&o.centerY<=a},getSelectedNodes:function(t){var e=this,n=this,i=n.graph,a=n.originPoint,o=n.shouldUpdate,s=n.isBBoxCenterInRect,u=this.selectedState,l={x:t.x,y:t.y},f=i.getPointByCanvas(a.x,a.y),c=zh(l.x,f.x),d=sA(l.x,f.x),h=zh(l.y,f.y),v=sA(l.y,f.y),p=[],g=[];i.getNodes().forEach(function(b){if(b.isVisible()&&s(b,c,d,h,v)&&o(b,"select",e)){p.push(b);var x=b.getModel();g.push(x.id),i.setItemState(b,u,!0)}});var y=[];this.includeEdges&&p.forEach(function(b){var x=b.getOutEdges();x.forEach(function(w){if(w.isVisible()){var E=w.getModel(),_=E.source,M=E.target;g.includes(_)&&g.includes(M)&&o(w,"select",e)&&(y.push(w),i.setItemState(w,e.selectedState,!0))}})});var m=[];this.includeCombos&&i.getCombos().forEach(function(b){if(b.isVisible()&&s(b,c,d,h,v)&&o(b,"select",e)){m.push(b);var x=b.getModel();g.push(x.id),i.setItemState(b,u,!0)}}),this.selectedEdges=y,this.selectedNodes=p,this.selectedCombos=m,this.onSelect&&this.onSelect(p,y,m),i.emit("nodeselectchange",{selectedItems:{nodes:p,edges:y,combos:m},select:!0})},createBrush:function(){var t=this,e=t.graph.get("canvas").addShape("rect",{attrs:t.brushStyle,capture:!1,name:"brush-shape"});return this.brush=e,this.delegate=e,e},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:uA(t.canvasX-e.x),height:uA(t.canvasY-e.y),x:zh(t.canvasX,e.x),y:zh(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),i=e.toLowerCase();i===n||i==="control"&&n==="ctrl"||i==="ctrl"&&n==="control"?this.keydown=!0:this.keydown=!1}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}};var fA="shift",Qge=["shift","ctrl","alt","control"];const Jge={getDefaultCfg:function(){return{multiple:!0,trigger:fA,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var t=this;return Qge.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=fA,console.warn("Behavior click-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),t.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,n=t.item;if(!(!n||n.destroyed)){var i=n.getType(),a=e.graph,o=e.keydown,s=e.multiple,u=e.shouldUpdate,l=e.shouldBegin;if(l(t,e)){if(!o||!s){var f=a.findAllByState("node",e.selectedState).concat(a.findAllByState("edge",e.selectedState)).concat(a.findAllByState("combo",e.selectedState));xe(f,function(p){p!==n&&a.setItemState(p,e.selectedState,!1)})}var c=function(){switch(i){case"node":return e.selectNode;case"edge":return e.selectEdge;case"combo":return e.selectCombo;default:return!1}}();if(!c){var d=a.findAllByState("node",e.selectedState),h=a.findAllByState("edge",e.selectedState),v=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{selectedItems:{nodes:d,edges:h,combos:v},select:!1});return}if(n.hasState(e.selectedState)){u(t,e)&&a.setItemState(n,e.selectedState,!1);var d=a.findAllByState("node",e.selectedState),h=a.findAllByState("edge",e.selectedState),v=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{target:n,selectedItems:{nodes:d,edges:h,combos:v},select:!1})}else{u(t,e)&&a.setItemState(n,e.selectedState,!0);var d=a.findAllByState("node",e.selectedState),h=a.findAllByState("edge",e.selectedState),v=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{target:n,selectedItems:{nodes:d,edges:h,combos:v},select:!0})}}}},onCanvasClick:function(t){var e=this,n=this,i=n.graph,a=n.shouldBegin;if(a(t,this)){var o=i.findAllByState("node",this.selectedState);xe(o,function(l){i.setItemState(l,e.selectedState,!1)});var s=i.findAllByState("edge",this.selectedState);xe(s,function(l){i.setItemState(l,e.selectedState,!1)});var u=i.findAllByState("combo",this.selectedState);xe(u,function(l){i.setItemState(l,e.selectedState,!1)}),i.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(t){var e=this,n=t.key;n&&(n.toLowerCase()===this.trigger.toLowerCase()||n.toLowerCase()==="control"?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){var t=this;t.keydown=!1}};var e0e=ra,Gh=.05;const t0e={getDefaultCfg:function(){return this.isFireFox=LP()==="firefox",{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(t){var e=t.originalEvent.touches,n=e[0],i=e[1];t.preventDefault(),i&&(this.shouldBegin&&!this.shouldBegin(t,this)||(this.startPoint={pageX:n.pageX,pageY:n.pageY},this.moveable=!0,i&&(this.endPoint={pageX:i.pageX,pageY:i.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(t){if(this.moveable){t.preventDefault();var e=t.originalEvent.touches,n=e[0],i=e[1];if(i){this.endPoint||(this.endPoint={pageX:i.pageX,pageY:i.pageY});var a=function(p,g){return Math.hypot(g.x-p.x,g.y-p.y)},o=a({x:n.pageX,y:n.pageY},{x:i.pageX,y:i.pageY})/a({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),s=this.originScale*o;this.currentScale=s;var u=this.get("minZoom")||this.graph.get("minZoom"),l=this.get("maxZoom")||this.graph.get("maxZoom");if(!(s>l||s<u)){var f=this.get("animate"),c=this.get("animateCfg"),d=this.graph.get("canvas"),h=d.getPointByClient(t.clientX,t.clientY);this.graph.zoomTo(s,{x:h.x,y:h.y},f,c),this.graph.emit("wheelzoom",t)}}}},onTouchEnd:function(){this.moveable=!1,this.endPoint=null},onWheel:function(t){var e=this,n=this,i=n.graph,a=n.fixSelectedItems;if(!(this.shouldBegin&&!this.shouldBegin(t,this))&&this.shouldUpdate(t,this)){t.preventDefault();var o=i.get("canvas"),s=o.getPointByClient(t.clientX,t.clientY),u=this.get("sensitivity"),l=i.getZoom(),f=l,c=l;this.isFireFox?t.deltaY>0||t.wheelDelta<0?f=1-Gh*u:f=1/(1-Gh*u):t.wheelDelta<0?f=1-Gh*u:f=1/(1-Gh*u),c=l*f;var d=this.get("minZoom")||i.get("minZoom"),h=this.get("maxZoom")||i.get("maxZoom");c>h?c=h:c<d&&(c=d);var v=this.get("enableOptimize");if(v){var p=this.get("optimizeZoom"),g=this.get("optimized"),y=i.getNodes(),m=i.getEdges(),b=y.length,x=m.length;if(!g){for(var w=0;w<b;w++){var E=y[w];if(!E.destroyed)for(var _=E.get("group").get("children"),M=_.length,C=0;C<M;C++){var S=_[C];!S.destoryed&&!S.get("isKeyShape")&&(S.set("ori-visibility",S.get("ori-visibility")||S.get("visible")),S.hide())}}for(var A=0;A<x;A++)for(var T=m[A],_=T.get("group").get("children"),M=_.length,C=0;C<M;C++){var S=_[C];S.set("ori-visibility",S.get("ori-visibility")||S.get("visible")),S.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var I=setTimeout(function(){var et=i.getZoom(),ie=e.get("optimized");if(ie){e.set("optimized",!1);for(var L=0;L<b;L++){var Se=y[L],Pe=Se.get("group").get("children"),me=Pe.length;if(et<p){var je=Se.getKeyShape(),Xe=je.get("ori-visibility");je.set("ori-visibility",void 0),Xe&&je.show()}else for(var qe=0;qe<me;qe++){var tt=Pe[qe],Xe=tt.get("ori-visibility");tt.set("ori-visibility",void 0),!tt.get("visible")&&Xe&&Xe&&tt.show()}}for(var yt=0;yt<x;yt++){var Ut=m[yt],Pe=Ut.get("group").get("children"),me=Pe.length;if(et<p){var je=Ut.getKeyShape(),Xe=je.get("ori-visibility");je.set("ori-visibility",void 0),Xe&&je.show()}else for(var qe=0;qe<me;qe++){var tt=Pe[qe];if(!tt.get("visible")){var Xe=tt.get("ori-visibility");tt.set("ori-visibility",void 0),Xe&&tt.show()}}}}},100);this.set("timeout",I)}if(l<=1){var k=void 0,P=void 0;if(a.fixAll||a.fixLineWidth||a.fixLabel){k=i.findAllByState("node",a.fixState),P=i.findAllByState("edge",a.fixState);for(var N=l/c,z=k.length,W=0;W<z;W++){var E=k[W],D=E.getContainer(),R=E.getModel(),H=E.getOriginStyle(),ee=E.getStateStyle(a.fixState),Y=E.get("shapeFactory").getShape(R.type).getStateStyle(a.fixState,E)[a.fixState];if(a.fixAll){if(c<=1){var X=ar(D.getMatrix());X||(X=[1,0,0,0,1,0,0,0,1]);var fe=E.getModel(),we=fe.x,Ae=fe.y;X=e0e(X,[["t",-we,-Ae],["s",N,N],["t",we,Ae]]),D.setMatrix(X)}}else for(var _=D.get("children"),M=_.length,C=0;C<M;C++){var S=_[C],Ke=void 0,ot=void 0;if(a.fixLabel){var nt=S.get("type");if(nt==="text"){Ke=S.attr("fontSize")||12;var Ct=ee[S.get("name")],Et=Y[S.get("name")],fr=Ct?Ct.fontSize:12,Gt=Et?Et.fontSize:12,jt=fr||Gt||12;if(c<=1&&S.attr("fontSize",jt/c),ot)break}}if(a.fixLineWidth&&S.get("isKeyShape")){ot=S.attr("lineWidth")||0;var Sr=ee.lineWidth||Y.lineWidth||H.lineWidth||0;if(c<=1&&S.attr("lineWidth",Sr/c),Ke)break}}}for(var rr=P.length,Rt=0;Rt<rr;Rt++)for(var T=P[Rt],D=T.getContainer(),_=D.get("children"),R=T.getModel(),ee=T.getStateStyle(a.fixState),Y=T.get("shapeFactory").getShape(R.type).getStateStyle(a.fixState,T)[a.fixState],M=_.length,C=0;C<M;C++){var S=_[C],Ke=void 0,ot=void 0;if(a.fixLabel||a.fixAll){var nt=S.get("type");if(nt==="text"){Ke=S.attr("fontSize")||12;var Ct=ee[S.get("name")],Et=Y[S.get("name")],fr=Ct?Ct.fontSize:12,Gt=Et?Et.fontSize:12,jt=fr||Gt||12;if(c<=1&&S.attr("fontSize",jt/c),ot)break}}if((a.fixLineWidth||a.fixAll)&&S.get("isKeyShape")){ot=S.attr("lineWidth")||0;var Sr=ee.lineWidth||Y.lineWidth||1;if(c<=1&&S.attr("lineWidth",Sr/c),Ke)break}}}}var sr=this.get("animate"),Hr=this.get("animateCfg");i.zoomTo(c,{x:s.x,y:s.y},sr,Hr),i.emit("wheelzoom",t)}}},f3={onMouseEnter:function(t){var e=t.item;this.currentTarget=e,this.showTooltip(t),this.graph.emit("tooltipchange",{item:t.item,action:"show"})},onMouseMove:function(t){if(!this.shouldUpdate(t,this)){this.hideTooltip();return}!this.currentTarget||t.item!==this.currentTarget||this.updatePosition(t)},onMouseLeave:function(t){this.shouldEnd(t,this)&&(this.hideTooltip(),this.graph.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null)},showTooltip:function(t){var e=this.container;if(!(!t.item||t.item.destroyed)){e||(e=this.createTooltip(this.graph.get("canvas")),this.container=e);var n=this.formatText(t.item.get("model"),t);e.innerHTML=n,tr(this.container,{visibility:"visible"}),this.updatePosition(t)}},hideTooltip:function(){tr(this.container,{visibility:"hidden"})},updatePosition:function(t){var e=this.get("shouldBegin"),n=this,i=n.width,a=n.height,o=n.container,s=n.graph;if(!e(t,this)){tr(o,{visibility:"hidden"});return}var u=s.getPointByClient(t.clientX,t.clientY),l=s.getCanvasByPoint(u.x,u.y),f=l.x,c=l.y,d=o.getBoundingClientRect();f>i/2?f-=d.width:f+=this.offset,c>a/2?c-=d.height:c+=this.offset;var h="".concat(f,"px"),v="".concat(c,"px");tr(this.container,{left:h,top:v,visibility:"visible"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var n=Ur('<div class="g6-tooltip g6-'.concat(this.item,'-tooltip"></div>'));return e.parentNode.appendChild(n),tr(n,{position:"absolute",visibility:"visible"}),this.width=t.get("width"),this.height=t.get("height"),this.container=n,this.graph.get("tooltips").push(n),n}},r0e=F({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(e){return e.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},f3),n0e=F({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(e){return"source: ".concat(e.source," target: ").concat(e.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},f3);var cA="click",i0e=["click","dblclick"];const a0e={getDefaultCfg:function(){return{trigger:cA,onChange:function(){}}},getEvents:function(){var t,e;return i0e.includes(this.trigger)?e=this.trigger:(e=cA,console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),t={},t["node:".concat(e)]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=this;if(this.trigger==="click"){if(this.timer){clearTimeout(this.timer),this.timer=0;return}this.timer=setTimeout(function(){e.toggle(t),clearTimeout(e.timer),e.timer=0},200)}else this.toggle(t)},toggle:function(t){var e=t.item;if(e){var n=this.graph.findDataById(e.get("id"));if(n){var i=n.children;if(!(!i||i.length===0)){var a=!n.collapsed;this.shouldBegin(t,a,this)&&(n.collapsed=a,e.getModel().collapsed=a,this.graph.emit("itemcollapsed",{item:t.item,collapsed:a}),this.shouldUpdate(t,a,this)&&(this.onChange(e,a,this),this.graph.layout()))}}}}};var o0e=jo.calculationItemsBBox,s0e=function r(t,e){if(e(t)!==!1&&t){var n=t.get("combos");if(n.length===0)return!1;xe(n,function(i){r(i,e)})}};const u0e={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;if(!e||e.destroyed||!this.shouldUpdate(t,this))return!1;var n=e.getType();return n==="combo"},onMouseDown:function(t){this.origin={x:t.x,y:t.y}},onDragStart:function(t){var e=this,n=this.graph,i=t.item;if(this.currentShouldEnd=!0,!!this.validationCombo(t)){this.targets=[];var a=n.findAllByState("combo",this.selectedState),o=i.get("id"),s=a.filter(function(l){var f=l.get("id");return o===f});s.length===0?this.targets.push(i):this.targets=a;var u=[];this.targets.forEach(function(l){var f=l.getModel(),c=f.x,d=f.y,h=f.id;u.push({x:c,y:d,id:h})}),this.set("beforeDragItems",u),this.activeState&&this.targets.map(function(l){var f=l.getModel();if(f.parentId){var c=n.findById(f.parentId);c&&n.setItemState(c,e.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],s0e(i,function(l){if(l.destroyed)return!1;var f=l.getModel();return e.currentItemChildCombos.push(f.id),!0})}},onDrag:function(t){var e=this;if(this.origin&&this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var n=this.graph,i=t.item,a=i.getModel(),o=n.getCombos(),s=i.getBBox(),u=s.centerX,l=s.centerY,f=s.width,c=o.filter(function(d){var h=d.getModel();return a.parentId,h.id!==a.id&&!e.currentItemChildCombos.includes(h.id)});c.map(function(d){var h=d.getBBox(),v=h.centerX,p=h.centerY,g=h.width,y=u-v,m=l-p,b=2*Math.sqrt(y*y+m*m);f+g-b>.8*f?n.setItemState(d,e.activeState,!0):n.setItemState(d,e.activeState,!1)})}xe(this.targets,function(d){e.updateCombo(d,t)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(t,e){var n=this;(this.enableDelegate||e)&&xe(this.targets,function(i){n.updateCombo(i,t,e)})},onDrop:function(t){var e=this,n=t.item;if(this.currentShouldEnd=this.shouldEnd(t,n,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.currentShouldEnd||!n||!this.targets||n.destroyed)){var i=this.graph,a=n.getModel();this.targets.map(function(o){var s=o.getModel();s.parentId!==a.id?(e.activeState&&i.setItemState(n,e.activeState,!1),e.onlyChangeComboSize?i.updateCombo(o):i.updateComboTree(o,a.id,!1)):i.updateCombo(n)}),this.end(n,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(!(!this.targets||this.targets.length===0)){var n=this.graph,i=t.item,a=i.getModel().comboId,o=a?n.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(t,o,this),this.updatePositions(t,!this.currentShouldEnd),!!this.currentShouldEnd){var s;if(a){if(this.activeState){var u=n.findById(a);n.setItemState(u,this.activeState,!1)}this.targets.map(function(l){e.onlyChangeComboSize?n.updateCombo(l):a!==l.getID()&&(s=n.findById(a),a!==l.getModel().parentId&&n.updateComboTree(l,a,!1))})}else this.targets.map(function(l){if(e.onlyChangeComboSize)n.updateCombo(l);else{var f=l.getModel();f.comboId&&n.updateComboTree(l,void 0,!1)}});this.endComparison=!0,this.end(s,t)}}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(!(!this.targets||this.targets.length===0)){var e=t.item;this.currentShouldEnd&&this.updatePositions(t);var n=this.getParentCombo(e.getModel().parentId),i=this.graph;n&&this.activeState&&i.setItemState(n,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var n=this;if(this.origin){var i=this.graph;if(this.delegateShape){var a=i.get("delegateGroup");a.clear(),this.delegateShape=null}if(t&&this.activeState&&i.setItemState(t,this.activeState,!1),!t){var o=i.get("enabledStack")&&this.enableStack,s={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(u){if(!n.onlyChangeComboSize)i.updateComboTree(u,void 0,o);else{i.updateCombo(u);var l=u.getModel(),f=l.x,c=l.y,d=l.id;s.after.combos.push({x:f,y:c,id:d}),i.pushStack("update",s)}})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e,n){var i=this;if(n===void 0&&(n={}),e(t,n)!==!1&&t){var a=t.get("combos");xe(a,function(s){i.traverse(s,e,n)});var o=t.get("nodes");xe(o,function(s){i.traverse(s,e,n)})}},updateCombo:function(t,e,n){this.updateSingleItem(t,e,n);var i={};this.traverse(t,function(a,o){return a.destroyed?!1:(a.getEdges().forEach(function(s){return o[s.getID()]=s}),!0)},i),Object.values(i).forEach(function(a){return a.refresh()})},updateSingleItem:function(t,e,n){var i=this.origin,a=this.graph,o=t.getModel(),s=t.get("id");this.point[s]||(this.point[s]={x:o.x,y:o.y});var u=e.x-i.x+this.point[s].x,l=e.y-i.y+this.point[s].y;n&&(u+=i.x-e.x,l+=i.y-e.y),a.updateItem(t,{x:u,y:l},!1)},getParentCombo:function(t){var e=this.graph;if(t){var n=e.findById(t);if(n)return n}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var d=t.x-this.origin.x+this.originPoint.minX,h=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:d,y:h})}else{var n=e.get("delegateGroup"),i=null;this.targets.length>1?i=o0e(this.targets):i=this.targets[0].getBBox();var a=i.x,o=i.y,s=i.width,u=i.height,l=i.minX,f=i.minY;this.originPoint={x:a,y:o,width:s,height:u,minX:l,minY:f};var c=F(F({},su.delegateStyle),this.delegateStyle);this.delegateShape=n.addShape("rect",{attrs:F({width:i.width,height:i.height,x:i.x,y:i.y},c),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var t=this,e=t.graph,n=t.targets,i={};n==null||n.forEach(function(a){var o=a.getModel().parentId;o&&(i[o]=e.findById(o))}),Object.values(i).forEach(function(a){a&&e.updateCombo(a)})}};var dA="dblclick",l0e=["click","dblclick"];const f0e={getDefaultCfg:function(){return{trigger:dA,relayout:!0}},getEvents:function(){var t,e;return l0e.includes(this.trigger)?e=this.trigger:(e=dA,console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),t={},t["combo:".concat(e)]="onComboClick",t},onComboClick:function(t){var e=t.item,n=this,i=n.graph,a=n.relayout;if(!(!e||e.destroyed||e.getType()!=="combo")){var o=e.getModel(),s=o.id;s&&(i.collapseExpandCombo(s),a&&i.get("layout")?i.layout():i.refreshPositions())}}};var c0e=jo.isPolygonsIntersect,d0e=jo.pathToPoints,hA="shift",h0e=["drag","shift","ctrl","alt","control"],v0e=function(t,e){var n,i=t.getKeyShape();if(t.get("type")==="path")n=d0e(i.attr("path"));else{var a=i.getCanvasBBox();n=[[a.minX,a.minY],[a.maxX,a.minY],[a.maxX,a.maxY],[a.minX,a.maxY]]}return c0e(e,n)};const p0e={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:hA,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return h0e.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=hA,console.warn("Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.trigger==="drag"?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(t){var e=this.lasso,n=t.item;n||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates("dragstart"),e||(e=this.createLasso()),this.dragging=!0,this.originPoint={x:t.x,y:t.y},this.points.push(this.originPoint),e.show())},onDragMove:function(t){this.dragging&&(this.trigger!=="drag"&&!this.keydown||(this.points.push({x:t.x,y:t.y}),this.updateLasso(t)))},onDragEnd:function(t){!this.lasso&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var t=this.points,e=[];return t.length&&(t.forEach(function(n,i){i===0?e.push(["M",n.x,n.y]):e.push(["L",n.x,n.y])}),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(t){t===void 0&&(t="canvas:click");var e=this,n=e.graph,i=e.selectedState,a=e.shouldDeselect,o=n.findAllByState("node",i),s=n.findAllByState("edge",i);(!a||a({action:t,nodes:o,edges:s}))&&(o.forEach(function(u){return n.setItemState(u,i,!1)}),s.forEach(function(u){return n.setItemState(u,i,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],n.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this,n=e.graph,i=e.shouldUpdate,a=this.points.map(function(f){return[n.getCanvasByPoint(f.x,f.y).x,n.getCanvasByPoint(f.x,f.y).y]}),o=this.selectedState,s=[],u=[];n.getNodes().forEach(function(f){if(f.isVisible()&&v0e(f,a)&&i(f,"select",t)){s.push(f);var c=f.getModel();u.push(c.id),n.setItemState(f,o,!0)}});var l=[];this.includeEdges&&s.forEach(function(f){var c=f.getOutEdges();c.forEach(function(d){if(d.isVisible()){var h=d.getModel(),v=h.source,p=h.target;u.includes(v)&&u.includes(p)&&i(d,"select",t)&&(l.push(d),n.setItemState(d,t.selectedState,!0))}})}),this.selectedEdges=l,this.selectedNodes=s,this.onSelect&&this.onSelect(s,l),n.emit("nodeselectchange",{selectedItems:{nodes:s,edges:l},select:!0})},createLasso:function(){var t=this,e=t.graph.get("delegateGroup").addShape("path",{attrs:F({path:[]},t.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=e,this.delegate=e,this.points=[],e},updateLasso:function(t){var e=this;this.lasso.attr({path:e.getLassoPath()})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}};var vA="click",g0e=["click","drag"],pA=void 0,y0e=["shift","ctrl","control","alt","meta",void 0];const m0e={getDefaultCfg:function(){return{trigger:vA,key:pA,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t=this;g0e.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=vA,console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),t.key&&y0e.indexOf(t.key.toLowerCase())===-1&&(t.trigger=pA,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined"));var e;return t.trigger==="drag"?e={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:t.trigger==="click"&&(e={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),t.key&&(e.keydown="onKeyDown",e.keyup="onKeyUp"),e},onDragEnd:function(t){var e=this;if(!(e.key&&!e.keydown)){var n=t.item;(!n||n.getID()===e.source||n.getType()!=="node")&&e.cancelCreating({item:e.edge,x:t.x,y:t.y})}},onClick:function(t){var e=this;if(!(e.key&&!e.keydown)){var n=t.item,i=e.graph,a=n.getModel(),o=e.getEdgeConfig;if(e.addingEdge&&e.edge){if(!e.shouldEnd(t,e))return;var s=void 0;o&&Yr(o)?s=o({source:e.source,target:a.id},e):s=e.edgeConfig;var u=F({target:a.id},s);if(e.source===a.id&&(u.type="loop"),i.emit("beforecreateedge",{}),i.updateItem(e.edge,u,!1),i.get("enabledStack")){var l=F(F({},e.edge.getModel()),{itemType:"edge"}),f={};f.edges=[l],i.pushStack("add",{before:{},after:f})}i.emit("aftercreateedge",{edge:e.edge}),e.edge.getKeyShape().set("capture",!0),e.edge=null,e.addingEdge=!1}else{if(!e.shouldBegin(t,e))return;var s=void 0;o&&Yr(o)?s=o({source:a.id,target:a.id},e):s=e.edgeConfig,e.edge=i.addItem("edge",F({source:a.id,target:a.id},s),!1),e.source=a.id,e.addingEdge=!0,e.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){var e=this;if(!(e.key&&!e.keydown)){e.edge&&e.edge.destroyed&&e.cancelCreating({item:e.edge});var n={x:t.x,y:t.y};if(!e.graph.findById(e.source)){e.addingEdge=!1;return}e.addingEdge&&e.edge&&e.graph.updateItem(e.edge,{target:n},!1)}},cancelCreating:function(t){var e,n,i=this;if(!(i.key&&!i.keydown)){var a=i.graph,o=t.item;if(i.addingEdge&&(i.edge===o||!((n=(e=t.target)===null||e===void 0?void 0:e.isCanvas)===null||n===void 0)&&n.call(e))){i.edge&&!i.edge.destroyed&&a.removeItem(i.edge,!1),i.edge=null,i.addingEdge=!1;return}}},onKeyDown:function(t){var e=this,n=t.key;n&&(n.toLowerCase()===e.key.toLowerCase()?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){var t=this;t.addingEdge&&t.edge&&(t.graph.removeItem(t.edge,!1),t.addingEdge=!1,t.edge=null),this.keydown=!1}};var gA="ctrl",b0e=["shift","ctrl","alt","control"],x0e="1";const w0e={getDefaultCfg:function(){return{trigger:gA,combinedKey:x0e,functionName:"fitView",functionParams:[]}},getEvents:function(){return b0e.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=gA,console.warn("Behavior shortcuts-fit-view 的 trigger 参数 '".concat(this.trigger,"' 不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(t){var e=t.key;if(e){var n=this.trigger.toLowerCase(),i=e.toLowerCase();this.triggerKeydown||(i===n||i==="control"&&n==="ctrl"||i==="ctrl"&&n==="control"?this.triggerKeydown=!0:this.triggerKeydown=!1);var a=this.graph;if(!a[this.functionName])return console.warn("Behavior shortcuts-fit-view 的 functionName 参数 '".concat(this.functionName,"' 不合法,它不是 Graph 的一个函数名")),{};if(this.triggerKeydown&&!this.combinedKey){this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]();return}var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(i===o||i==="control"&&o==="ctrl"||i==="ctrl"&&o==="control")&&(this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]())}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}};var E0e=["shift","ctrl","alt","control","meta"];const _0e={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||E0e.indexOf(this.zoomKey)===-1)&&(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(t){var e=this;if(this.allowDrag(t)){var n=this.graph,i=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];i.includes("control")&&i.push("ctrl");var a=i.some(function(R){return t["".concat(R,"Key")]});if(a){var o=n.get("canvas"),s=o.getPointByClient(t.clientX,t.clientY),u=n.getZoom();t.wheelDelta>0?u=u+u*.05:u=u-u*.05,n.zoomTo(u,{x:s.x,y:s.y})}else{var l=t.deltaX||t.movementX,f=t.deltaY||t.movementY;!f&&navigator.userAgent.indexOf("Firefox")>-1&&(f=-t.wheelDelta*125/3);var c=this.graph.get("width"),d=this.graph.get("height"),h=this.graph.get("canvas").getCanvasBBox(),v=this.scalableRange,p=this.scalableRange;v<1&&v>-1&&(v=c*v,p=d*p);var g=h.minX,y=h.maxX,m=h.minY,b=h.maxY;l>0?y<-v?l=0:y-l<-v&&(l=y+v):l<0&&(g>c+v?l=0:g-l>c+v&&(l=g-(c+v))),f>0?b<-p?f=0:b-f<-p&&(f=b+p):f<0&&(m>d+p?f=0:m-f>d+p&&(f=m-(d+p))),this.get("direction")==="x"?f=0:this.get("direction")==="y"&&(l=0),n.translate(-l,-f)}t.preventDefault();var x=this.get("enableOptimize");if(x){var w=this.get("optimizeZoom"),E=this.get("optimized"),_=n.getNodes(),M=n.getEdges(),C=_.length,S=M.length;if(!E){for(var A=0;A<C;A++){var T=_[A];if(!T.destroyed)for(var I=T.get("group").get("children"),k=I.length,P=0;P<k;P++){var N=I[P];!N.destoryed&&!N.get("isKeyShape")&&(N.set("ori-visibility",N.get("ori-visibility")||N.get("visible")),N.hide())}}for(var z=0;z<S;z++)for(var W=M[z],I=W.get("group").get("children"),k=I.length,P=0;P<k;P++){var N=I[P];N.set("ori-visibility",N.get("ori-visibility")||N.get("visible")),N.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var D=setTimeout(function(){var R=n.getZoom(),H=e.get("optimized");if(H){e.set("optimized",!1);for(var ee=0;ee<C;ee++){var Y=_[ee],X=Y.get("group").get("children"),fe=X.length;if(R<w){var we=Y.getKeyShape(),Ae=we.get("ori-visibility");Ae&&we.show()}else for(var Ke=0;Ke<fe;Ke++){var ot=X[Ke],Ae=ot.get("ori-visibility");!ot.get("visible")&&Ae&&Ae&&ot.show()}}for(var nt=0;nt<S;nt++){var Ct=M[nt],X=Ct.get("group").get("children"),fe=X.length;if(R<w){var we=Ct.getKeyShape(),Ae=we.get("ori-visibility");Ae&&we.show()}else for(var Ke=0;Ke<fe;Ke++){var ot=X[Ke];if(!ot.get("visible")){var Ae=ot.get("ori-visibility");Ae&&ot.show()}}}}},100);this.set("timeout",D)}}},allowDrag:function(t){var e,n,i=t.target,a=i&&i.isCanvas&&i.isCanvas();if(Bc(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if(Wn(this.allowDragOnItem)){var o=this.allowDragOnItem,s=o.node,u=o.edge,l=o.combo,f=(n=(e=t.item)===null||e===void 0?void 0:e.getType)===null||n===void 0?void 0:n.call(e);if(!s&&f==="node"||!u&&f==="edge"||!l&&f==="combo")return!1}return!0}};var S0e={"drag-canvas":Vge,"zoom-canvas":t0e,"drag-node":Hge,"activate-relations":Kge,"brush-select":Zge,"click-select":Jge,"lasso-select":p0e,tooltip:r0e,"edge-tooltip":n0e,"collapse-expand":a0e,"drag-combo":u0e,"collapse-expand-combo":f0e,"create-edge":m0e,"shortcuts-call":w0e,"scroll-canvas":_0e};xe(S0e,function(r,t){AL(t,r)});var M0e=F(F({},VU),ZY),C0e=Li.Fisheye,A0e=Li.TimeBar,T0e=Li.ImageMinimap,I0e=Li.EdgeFilterLens,O0e=Li.SnapLine,L0e=Li.Annotation;const fg={version:su.version,Graph:DP,TreeGraph:Fhe,Util:jo,Layout:or.Layouts,TreeLayout:Mhe,registerLayout:Che,Global:su,registerBehavior:AL,registerCombo:DW,registerEdge:CL,registerNode:Bo,Minimap:Li.Minimap,Grid:Li.Grid,Bundling:Li.Bundling,Menu:Li.Menu,ToolBar:Li.ToolBar,Tooltip:Li.Tooltip,Legend:Li.Legend,TimeBar:A0e,SnapLine:O0e,Fisheye:C0e,ImageMinimap:T0e,EdgeFilterLens:I0e,Annotation:L0e,Algorithm:M0e,Arrow:wL,Marker:EL,Shape:Rr};fg.version="4.8.23";fg.registerNode("file-node",{draw(r,t){const e=t.addShape("rect",{name:"rect-shape",attrs:{x:0,y:0,fill:"#fff",stroke:null}});return r.children.length==0||t.addShape("marker",{name:"marker-shape",attrs:{symbol:"triangle-down",x:0,y:0,r:4,fill:"#767c82"}}),t.addShape("text",{name:"text-shape",attrs:{x:6,y:8,fontSize:16,text:r.label,fill:r.tracked?"#00f":"#333639",textAlign:"left",fontFamily:window.getComputedStyle(document.body,null).getPropertyValue("font-family")}}),e}});fg.registerEdge("step-line",{getControlPoints(r){const t=r.startPoint,e=r.endPoint;return[t,{x:t==null?void 0:t.x,y:e==null?void 0:e.y},e]}},"polyline");const k0e=Vr({__name:"TrackGraph",props:{track:{}},setup(r){const t=r,e=Dr(()=>{var c;const o=t.track.nodes,s=(c=t.track.nodes[t.track.selector.trackIndex])==null?void 0:c.id,u=(()=>{const d=o.reduce((h,v)=>v.id<h.id?v:h,o[0]);return d.parent&&o.some(h=>h!==d&&h.pid==d.pid)?d.parent:d})(),l=new Set;l.add(u),o.forEach(d=>{l.add(d);let h=d;for(;h&&h!==u;)l.add(h),h=h.parent});const f=Array.from(l).map(d=>({_node:d,children:[],id:d.id.toString(),label:RE(d),tracked:s===d.id}));return f.sort((d,h)=>d._node.id-h._node.id),f.forEach(d=>{const h=f.find(v=>v.id===d._node.pid.toString());h&&h.children.push(d)}),f.forEach(d=>{if(d.children.length<d._node.children.length){const h=[],v=()=>{for(;h.length>0;)h.pop()},p=()=>{if(h.length==0)return;const g=h[0].parent.children,y=h[0];if(g.length>1&&g.indexOf(y)==1&&g.indexOf(h.at(-1))==g.length-1){v();return}d.children.push({_node:y,children:[],id:y.id.toString(),label:h.length==1?RE(y):`[${g.indexOf(y)} ... ${g.indexOf(h.at(-1))}]`,tracked:s===y.id}),v()};d._node.children.forEach(g=>{d.children.find(y=>y.id===g.id.toString())?p():h.push(g)}),h.length>0&&p(),d.children.sort((g,y)=>d._node.children.indexOf(g._node)-d._node.children.indexOf(y._node))}}),f}),n=On();let i;fs(()=>{if(!n.value)return;i==null||i.destroy();const o=n.value.scrollWidth,s=n.value.scrollHeight||o;i=new fg.TreeGraph({container:n.value,width:o,height:s,modes:{default:["drag-canvas","zoom-canvas"]},layout:{type:"indented",indent:25,getHeight(){return 10}}}),i.node(c=>({type:"file-node"})),i.edge(c=>{if(c.id&&c.id.startsWith("-")){const d=Number.parseInt(c.source)>Number.parseInt(c.target)?-1:1,h=String(c.connect),v=Number(c.count);let p=40;if(h.startsWith("<<")){let y=t.track.nodes.find(b=>b.id.toString()==c.source).parent,m=1;for(;y&&y.id.toString()!=c.target;)y=y.parent,m++;m>1&&(p+=m*20)}return v>1&&(p+=(v-1)*20),p*=d,{type:"quadratic",color:"#ff00ff80",curveOffset:p,style:{startArrow:!0},label:h,labelCfg:{style:{fill:"#f00",fontSize:12,background:{fill:"#ffffff",stroke:"#f0f",lineWidth:1,padding:[2,1,0,1],radius:2}}}}}return{type:"step-line"}}),i.data({...e.value[0]}),i.render();const u=Array.from(t.track.nodes).reverse(),l=t.track.selector.connectKeys,f={};u.forEach((c,d)=>{const h=u[d+1];if(h&&i){const v=h.id>c.id?`-${c.id}:${h.id}`:`-${h.id}:${c.id}`;f[v]=(f[v]||0)+1;const p=`${v}/${f[v]}`,g=l[l.length-d-1],y={"+":()=>h.parent.children.slice(0,h.parent.children.indexOf(h)).reverse().indexOf(c),"-":()=>h.parent.children.slice(h.parent.children.indexOf(h)+1).indexOf(c),">":()=>{let m=0,b=h.parent;for(;b;){if(b===c)return m;b=b.parent,m++}return m},"<":()=>h.children.indexOf(c),"<<":()=>{let m=0;const b=Array.from(h.children).reverse();for(;b.length>0;){const x=b.pop();if(x===c)return m;b.push(...Array.from(x.children).reverse()),m++}return m}}[g]()+1;i.addItem("edge",{source:c.id.toString(),target:h.id.toString(),id:p,connect:y>1?g+y:g,count:f[v]},!1)}}),i.fitView(30)}),pv(()=>{i==null||i.destroy()});const a=()=>{!i||i.get("destroyed")||!n.value||!n.value||!n.value.scrollWidth||!n.value.scrollHeight||i.changeSize(n.value.scrollWidth,n.value.scrollHeight)};return window.addEventListener("resize",a),pv(()=>{window.removeEventListener("resize",a)}),(o,s)=>(Lr(),bi("div",{ref_key:"container",ref:n},null,512))}}),D0e={"h-full":"",flex:"","gap-5px":"","p-5px":"","box-border":""},N0e=Ar("svg",{viewBox:"0 0 24 24"},[Ar("path",{fill:"currentColor",d:"M5 21V8.825Q4.125 8.5 3.563 7.738T3 6q0-1.25.875-2.125T6 3q1.25 0 2.125.875T9 6q0 .975-.562 1.738T7 8.825V19h4V3h8v12.175q.875.325 1.438 1.088T21 18q0 1.25-.875 2.125T18 21q-1.25 0-2.125-.875T15 18q0-.975.563-1.75T17 15.175V5h-4v16zM6 7q.425 0 .713-.288T7 6q0-.425-.288-.712T6 5q-.425 0-.712.288T5 6q0 .425.288.713T6 7m12 12q.425 0 .713-.288T19 18q0-.425-.288-.712T18 17q-.425 0-.712.288T17 18q0 .425.288.713T18 19m0-1"})],-1),P0e={key:0,class:"gkd_code"},R0e=Ar("div",null,"*为简化视图已隐藏部分节点",-1),j0e=Vr({__name:"SnapshotPage",setup(r){const t=cB(),e=MA(),n=OB(),i=Dr(()=>String(t.params.snapshotId||"")),a=Dr(()=>{const v=Number(t.query.showSize||"");return!Number.isSafeInteger(v)||v<=0?2e3:v}),o=On(""),s=On();fs(async()=>{const v=await CE.getItem(i.value);if(!v){ca.error("快照数据缺失");return}j5()&&setTimeout(async()=>{G5(v),yA[v.id]||$5(await CE.getItem(i.value))},1e3),v.nodes.length>a.value&&(ca.warning(`当前展示节点数量为${a.value}
|
|
937
937
|
之后的${v.nodes.length-a.value}个节点将被丢弃
|
|
938
938
|
使用showSize查询参数可以修改展示数量`),v.nodes=v.nodes.slice(0,a.value));const p=await W5.getItem(i.value);if(!p){ca.create("截屏数据缺失");return}o.value=URL.createObjectURL(new Blob([p],{type:"image/png"})),s.value=v,u.value=CB(v.nodes),n.value="快照-"+v.appName||v.appId,await My(500),l.value||(l.value=u.value)});const u=On(),l=On(),f=On(0),c=async()=>{ca.success("删除成功,即将回到首页"),await My(2e3),e.replace({path:"/"})},d=On(),h=On(!1);return fs(()=>{d.value&&(h.value=!0)}),(v,p)=>(Lr(),bi("div",D0e,[o.value&&s.value?(Lr(),ii($4,{key:0,url:o.value,snapshot:s.value,rootNode:u.value,focusNode:l.value,onUpdateFocusNode:p[0]||(p[0]=g=>{l.value=g,f.value++})},null,8,["url","snapshot","rootNode","focusNode"])):Ra("",!0),s.value&&u.value?(Lr(),ii(eF,{key:1,rootNode:u.value,snapshot:s.value,focusNode:l.value,onUpdateFocusNode:p[1]||(p[1]=g=>l.value=g),focusCount:f.value,class:"flex-1"},{default:Lt(()=>[s.value?(Lr(),ii(z5,{key:0,snapshot:s.value,onDelete:c,showPreview:!1},null,8,["snapshot"])):Ra("",!0)]),_:1},8,["rootNode","snapshot","focusNode","focusCount"])):Ra("",!0),l.value?(Lr(),ii(L4,{key:2,focusNode:l.value},null,8,["focusNode"])):Ra("",!0),u.value&&s.value?(Lr(),ii(Q4,{key:3,snapshot:s.value,rootNode:u.value,onUpdateFocusNode:p[2]||(p[2]=g=>{l.value=g,f.value++}),onUpdateTrack:p[3]||(p[3]=g=>d.value=g)},null,8,["snapshot","rootNode"])):Ra("",!0),Vt(vt(dB),{show:h.value,"onUpdate:show":p[4]||(p[4]=g=>h.value=g),preset:"dialog",title:"选择器路径视图",style:{width:"max(600px, 80vh)"},onAfterLeave:p[5]||(p[5]=g=>d.value=void 0)},{icon:Lt(()=>[Vt(vt(pl),null,{default:Lt(()=>[N0e]),_:1})]),default:Lt(()=>[d.value?(Lr(),bi("div",P0e,Hn(d.value.selector.toString()),1)):Ra("",!0),d.value?(Lr(),ii(k0e,{key:1,track:d.value},null,8,["track"])):Ra("",!0),R0e]),_:1},8,["show"])]))}});export{j0e as default};
|
|
939
|
-
//# sourceMappingURL=SnapshotPage-
|
|
939
|
+
//# sourceMappingURL=SnapshotPage-qvOfZQKW.js.map
|