@gkd-kit/inspect 0.0.1708869631756 → 0.0.1708870839260
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/dist/404.html +4 -4
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-b7dk0NEr.js → ActionCard.vue_vue_type_script_setup_true_lang-mPuNAM_k.js} +2 -2
- package/dist/assets/{ActionCard.vue_vue_type_script_setup_true_lang-b7dk0NEr.js.map → ActionCard.vue_vue_type_script_setup_true_lang-mPuNAM_k.js.map} +1 -1
- package/dist/assets/DevicePage-kso-ZNBW.js +49 -0
- package/dist/assets/{DevicePage-fbp_spdh.js.map → DevicePage-kso-ZNBW.js.map} +1 -1
- package/dist/assets/HomePage-tlPI1bPF.js +17 -0
- package/dist/assets/HomePage-tlPI1bPF.js.map +1 -0
- package/dist/assets/{ImportPage-PgsRoGvG.js → ImportPage-NLSIhMQ-.js} +2 -2
- package/dist/assets/{ImportPage-PgsRoGvG.js.map → ImportPage-NLSIhMQ-.js.map} +1 -1
- package/dist/assets/PreviewSharePage-iKnyKivu.js +2 -0
- package/dist/assets/PreviewSharePage-iKnyKivu.js.map +1 -0
- package/dist/assets/{SnapshotPage-goerP043.js → SnapshotPage-YWbGBZcb.js} +5 -5
- package/dist/assets/{SnapshotPage-goerP043.js.map → SnapshotPage-YWbGBZcb.js.map} +1 -1
- package/dist/assets/_404Page-5UZxjsl8.js +2 -0
- package/dist/assets/{_404Page-CEASAEr1.js.map → _404Page-5UZxjsl8.js.map} +1 -1
- package/dist/assets/{fetch-XNgKiI1r.js → fetch-wgH4g-5n.js} +2 -2
- package/dist/assets/{fetch-XNgKiI1r.js.map → fetch-wgH4g-5n.js.map} +1 -1
- package/dist/assets/{import-BgDMc_As.js → import-H9FdD8WV.js} +2 -2
- package/dist/assets/{import-BgDMc_As.js.map → import-H9FdD8WV.js.map} +1 -1
- package/dist/assets/index-539cTDQX.js +281 -0
- package/dist/assets/index-539cTDQX.js.map +1 -0
- package/dist/assets/index-B6RiVsPv.js +2 -0
- package/dist/assets/index-B6RiVsPv.js.map +1 -0
- package/dist/assets/index-ZWTJTFvn.css +1 -0
- package/dist/assets/{index-Q19h9qCj.js → index-o21slAq-.js} +5 -5
- package/dist/assets/{index-Q19h9qCj.js.map → index-o21slAq-.js.map} +1 -1
- package/dist/assets/{jszip.min-j7i8b4PH.js → jszip.min-o2QHBz8W.js} +2 -2
- package/dist/assets/{jszip.min-j7i8b4PH.js.map → jszip.min-o2QHBz8W.js.map} +1 -1
- package/dist/assets/node-fnADUNed.js +466 -0
- package/dist/assets/node-fnADUNed.js.map +1 -0
- package/dist/assets/polyfills-DS8jGJZm.js +1 -0
- package/dist/assets/selector-PNAmoqPq.js +4 -0
- package/dist/assets/selector-PNAmoqPq.js.map +1 -0
- package/dist/assets/{storage-RAG9OMXc.js → storage-kKDFXaEC.js} +2 -2
- package/dist/assets/{storage-RAG9OMXc.js.map → storage-kKDFXaEC.js.map} +1 -1
- package/dist/assets/{table-4C57XHVh.js → table-DfFvsV2I.js} +11 -11
- package/dist/assets/{table-4C57XHVh.js.map → table-DfFvsV2I.js.map} +1 -1
- package/dist/index.html +4 -4
- package/package.json +3 -1
- package/dist/assets/DevicePage-fbp_spdh.js +0 -49
- package/dist/assets/HomePage-RhRadU9j.js +0 -10
- package/dist/assets/HomePage-RhRadU9j.js.map +0 -1
- package/dist/assets/PreviewSharePage-hFqq8AeD.js +0 -2
- package/dist/assets/PreviewSharePage-hFqq8AeD.js.map +0 -1
- package/dist/assets/_404Page-CEASAEr1.js +0 -2
- package/dist/assets/index-QDZ70lRk.css +0 -1
- package/dist/assets/index-V8B8onWG.js +0 -281
- package/dist/assets/index-V8B8onWG.js.map +0 -1
- package/dist/assets/node-O0AgFTjD.js +0 -466
- package/dist/assets/node-O0AgFTjD.js.map +0 -1
- package/dist/assets/polyfills-4ameGDja.js +0 -1
- package/dist/assets/selector-g1HP6R4N.js +0 -4
- package/dist/assets/selector-g1HP6R4N.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as G5,e as $5,f as U5}from"./ActionCard.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as G5,e as $5,f as U5}from"./ActionCard.vue_vue_type_script_setup_true_lang-mPuNAM_k.js";import{f as My,c as Js,m as ca,g as CE,a as Cy,b as j5}from"./fetch-wgH4g-5n.js";import{_ as vv,d as Vr,q as Lt,v as ur,x as Fa,y as er,z as dr,A as $r,B as Nc,C as W5,D as h1,E as X5,G as Pc,H as v1,I as In,l as Lr,J as Xl,K as p1,L as g1,M as $n,O as Y5,P as kr,Q as yT,S as mT,T as bT,U as V5,V as ti,W as xu,X as H5,Y as TE,Z as xT,$ as K5,a0 as mo,a1 as q5,a2 as Z5,a3 as Q5,a4 as J5,a5 as eB,a6 as s0,a7 as tB,a8 as rB,a9 as u0,aa as nB,ab as iB,ac as aB,ad as wT,ae as oB,w as cs,m as vl,af as l0,ag as AE,ah as gf,ai as IE,aj as Pf,k as ET,s as Ln,ak as pv,al as bi,g as _r,am as _T,an as Ty,ao as ST,ap as sB,o as Dr,b as It,a as jt,e as ht,c as di,aq as $h,F as Hf,t as Sn,j as da,i as dn,f as MT,p as uB,h as Xu,ar as OE,as as lB,N as fB}from"./index-o21slAq-.js";import{h as gv,C as cB,c as dB,e as hB,d as vB,V as pB,f as gB,g as LE,i as yB,j as kE,k as mB,l as ol,m as bB,b as DE,n as NE,o as xB,N as wB,p as Uh,q as EB,r as f0,s as PE,t as _B}from"./node-fnADUNed.js";import{b as Rf,a as pl,r as SB,N as MB,l as CB}from"./index-539cTDQX.js";import{u as TB,a as AB}from"./index-B6RiVsPv.js";import{e as RE,p as IB,a as OB}from"./selector-PNAmoqPq.js";import{g as LB,b as CT,c as ro,d as no,e as _e,a as BE,f as kB}from"./storage-kKDFXaEC.js";import"./jszip.min-o2QHBz8W.js";function DB(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 y1=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Ea},get Circle(){return gV},get Ellipse(){return yV},get Image(){return mV},get Line(){return bV},get Marker(){return wV},get Path(){return pb},get Polygon(){return AV},get Polyline(){return IV},get Rect(){return kV},get Text(){return DV}},Symbol.toStringTag,{value:"Module"})),m1=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return na},get Circle(){return BV},get Dom(){return FV},get Ellipse(){return zV},get Image(){return GV},get Line(){return $V},get Marker(){return UV},get Path(){return jV},get Polygon(){return WV},get Polyline(){return XV},get Rect(){return VV},get Text(){return ZV}},Symbol.toStringTag,{value:"Module"}));function TT(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 NB(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 ba(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function PB(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 AT(r){var t=PB(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,AT(n.key),n)}}function xa(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=AT(t),t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}const RB=Vr({name:"ChevronLeft",render(){return Lt("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Lt("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"}))}}),BB=Vr({name:"Switcher",render(){return Lt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Lt("path",{d:"M12 8l10 8l-10 8z"}))}}),nn="0!important",IT="-1px!important";function Yu(r){return dr(r+"-type",[er("& +",[ur("button",{},[dr(r+"-type",[$r("border",{borderLeftWidth:nn}),$r("state-border",{left:IT})])])])])}function Vu(r){return dr(r+"-type",[er("& +",[ur("button",[dr(r+"-type",[$r("border",{borderTopWidth:nn}),$r("state-border",{top:IT})])])])])}const FB=ur("button-group",`
|
|
2
2
|
flex-wrap: nowrap;
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
position: relative;
|
|
@@ -265,7 +265,7 @@ import{_ as G5,e as $5,f as U5}from"./ActionCard.vue_vue_type_script_setup_true_
|
|
|
265
265
|
transparent 50%,
|
|
266
266
|
#fff 50%,
|
|
267
267
|
#fff 100%
|
|
268
|
-
)`,"background-position-y":"1.5px"}},null,-1),W4=Vr({__name:"ScreenshotCard",props:{url:{},snapshot:{},rootNode:{},focusNode:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}}},setup(r){const t=r,e=TB(),n=bB(Lr(()=>(e.width.value,e.height.value,Math.random())),300),i=Ln(),a=h=>{if(!t.rootNode)return;const v=i.value;if(!v)return;const p=v.getBoundingClientRect(),g=p.width/v.naturalWidth*v.naturalHeight,y=(p.height-g)/2,m=(h.clientX-p.left)/p.width*v.naturalWidth,b=(h.clientY-p.top-y)/g*v.naturalHeight,x=xB(t.snapshot.nodes,m,b);x&&t.onUpdateFocusNode(x)},o=h=>`${h*100}%`,s=Lr(()=>{var y;n.value;const h=i.value,v=(y=t.focusNode)==null?void 0:y.attr;if(!t.focusNode||!h||!v)return"";const p=h.getBoundingClientRect(),g=p.width/h.naturalWidth*h.naturalHeight;return{left:`calc(${o(v.left/h.naturalWidth)} - 2px)`,width:`calc(${o((v.right-v.left)/h.naturalWidth)} + 2px)`,top:`calc(${o((v.top/h.naturalHeight*g+(p.height-g)/2)/p.height)} - 2px)`,height:`calc(${o((v.bottom-v.top)/h.naturalHeight*g/p.height)} + 2px)`}}),u=Ln(!1),l=Ln({ox:0,oy:0}),f=Lr(()=>{var g;const h=(g=t.focusNode)==null?void 0:g.attr;if(!h)return;const{ox:v,oy:p}=l.value;return{left:v-h.left,right:h.right-v,top:p-h.top,bottom:h.bottom-p}}),c=h=>{const v=i.value;if(!v)return;const p=v.getBoundingClientRect(),g=p.width/v.naturalWidth*v.naturalHeight,y=(p.height-g)/2,m=(h.clientX-p.left)/p.width*v.naturalWidth,b=(h.clientY-p.top-y)/g*v.naturalHeight;l.value={ox:m,oy:b},d.value={left:-(m-.1*v.naturalWidth)/v.naturalWidth*1e3+"px",top:-(b-.1*v.naturalWidth)/v.naturalWidth*1e3+"px"}},d=Ln({left:"0",top:"0"});return(h,v)=>(Dr(),di("div",N4,[_r("img",{ref_key:"imgRef",ref:i,src:h.url,onClick:a,"cursor-crosshair":"","h-full":"","object-contain":"",class:"max-w-[calc(var(--gkd-width)*0.35)]",onMouseover:v[0]||(v[0]=p=>u.value=!0),onMouseleave:v[1]||(v[1]=p=>u.value=!1),onMousemove:c},null,40,P4),_r("div",{style:Ty(s.value),absolute:"","pointer-events-none":"","transition-all-300":"","b-1px":"","b-blue":"","b-solid":""},B4,4),yT(_r("div",F4,[_r("img",{src:h.url,"object-contain":"",absolute:"","left-0":"","top-0":"",style:Ty(d.value),"w-1000px":""},null,12,z4),_r("div",G4,Sn(`${l.value.ox.toFixed(0)},${l.value.oy.toFixed(0)}`),1),f.value?(Dr(),di("div",$4,[_r("div",null,Sn(f.value.top.toFixed(0)),1),_r("div",null,Sn(f.value.left.toFixed(0)+","+f.value.right.toFixed(0)),1),_r("div",null,Sn(f.value.bottom.toFixed(0)),1)])):da("",!0),U4,j4],512),[[mT,u.value]])]))}}),X4={"w-480px":"","bg-white":"","b-1px":"","b-solid":"","b-gray-200":"","rounded-4px":"","p-8px":"",class:"min-w-[calc(var(--gkd-width)*0.3)]"},Y4={flex:"","m-b-4px":""},V4=_r("svg",{viewBox:"0 0 32 32"},[_r("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),H4=_r("div",{"p-5px":""},null,-1),K4={key:0,underline:"","decoration-1":"","m-r-4px":"",title:"查询数量"},q4=["title"],Z4=_r("svg",{viewBox:"0 0 24 24"},[_r("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),Q4=_r("div",{"p-l-8px":""},null,-1),J4=_r("svg",{viewBox:"0 0 24 24"},[_r("g",{fill:"none"},[_r("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),eF=_r("svg",{viewBox:"0 0 24 24"},[_r("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),tF=Vr({__name:"SearchCard",props:{snapshot:{},rootNode:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}},onUpdateTrack:{type:Function,default:()=>()=>{}}},setup(r){const t=MT(),e=r,n=Ln(""),i=ET([]),a=Ln([]),o=RE(()=>{if(!e.rootNode){ca.error("根节点不存在");return}const f=n.value.trim();if(!f)return;if(u.value){const h=IB(()=>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=RE(async f=>{var y,m,b;let c=LB[e.snapshot.id];c&&(c=CE(t,c));let d=CT[e.snapshot.id];d&&(d=CE(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]规则名称-${_B().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(CB.stringify(g,void 0,2))}),u=Ln(!0),l=window.innerWidth/100;return(f,c)=>(Dr(),bi(BT,{initialValue:{top:75,right:Math.max(315,12*l+135)},class:"z-1"},{default:It(({onRef:d})=>[_r("div",X4,[_r("div",Y4,[jt(ht(wB),{value:u.value,"onUpdate:value":c[0]||(c[0]=h=>u.value=h)},{default:It(()=>[jt(ht(DE),null,{default:It(()=>[jt(ht(NE),{value:!1},{default:It(()=>[dn(" 字符搜索 ")]),_:1}),jt(ht(NE),{value:!0},{default:It(()=>[dn(" 选择器查询 ")]),_:1})]),_:1})]),_:1},8,["value"]),_r("div",{"flex-1":"","cursor-move":"",ref:d},null,512)]),jt(ht(EB),null,{default:It(()=>[jt(ht(MB),{value:n.value,"onUpdate:value":c[1]||(c[1]=h=>n.value=h),placeholder:u.value?"请输入选择器":"请输入字符",onKeyup:uB(ht(o),["enter"]),inputProps:{class:"gkd_code"}},null,8,["value","placeholder","onKeyup"]),jt(ht(Xu),{onClick:ht(o)},{icon:It(()=>[jt(ht(pl),null,{default:It(()=>[V4]),_:1})]),_:1},8,["onClick"])]),_:1}),H4,jt(ht(YB),{expandedNames:a.value,"onUpdate:expandedNames":c[2]||(c[2]=h=>a.value=h)},{default:It(()=>[(Dr(!0),di(Hf,null,$h(ht(i),(h,v)=>(Dr(),bi(ht(KB),{key:h.key,name:h.key},{header:It(()=>[h.nodes.length>1?(Dr(),di("span",K4,Sn(h.nodes.length),1)):da("",!0),_r("span",{"break-all":"",title:typeof h.selector=="object"?"选择器":"搜索字符"},Sn(h.selector.toString()),9,q4)]),"header-extra":It(()=>[typeof h.selector=="object"&&h.selector.canCopy?(Dr(),bi(ht(Xu),{key:0,size:"small",onClick:OE(p=>ht(s)(h),["stop"]),title:"复制规则"},{icon:It(()=>[jt(ht(pl),null,{default:It(()=>[Z4]),_:1})]),_:2},1032,["onClick"])):da("",!0),Q4,jt(ht(Xu),{size:"small",onClick:OE(p=>ht(i).splice(v,1),["stop"]),title:"删除记录"},{icon:It(()=>[jt(ht(pl),null,{default:It(()=>[J4]),_:1})]),_:2},1032,["onClick"])]),default:It(()=>[jt(ht(DE),{style:{"max-height":"400px","overflow-y":"scroll","padding-bottom":"10px"}},{default:It(()=>[typeof h.selector=="string"||h.selector.tracks.length<=1?(Dr(!0),di(Hf,{key:0},$h(h.nodes.map(p=>Array.isArray(p)?p[0]:p),p=>(Dr(),bi(ht(Xu),{key:p.id,onClick:g=>f.onUpdateFocusNode(p),size:"small"},{default:It(()=>[dn(Sn(ht(Uh)(p)),1)]),_:2},1032,["onClick"]))),128)):(Dr(!0),di(Hf,{key:1},$h(h.nodes.map(p=>Array.isArray(p)?p:[p]),(p,g)=>(Dr(),bi(ht(GB),{key:g},{default:It(()=>[jt(ht(Xu),{size:"small",onClick:y=>f.onUpdateTrack({nodes:p,selector:h.selector})},{default:It(()=>[jt(ht(pl),null,{default:It(()=>[eF]),_:1})]),_:2},1032,["onClick"]),jt(ht(Xu),{onClick:y=>f.onUpdateFocusNode(p[h.selector.trackIndex]),size:"small"},{default:It(()=>[dn(Sn(ht(Uh)(p[h.selector.trackIndex])),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["expandedNames"])])]),_:1},8,["initialValue"]))}}),rF={flex:"","flex-col":""},nF=Vr({__name:"WindowCard",props:{snapshot:{},rootNode:{},focusNode:{},focusCount:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}}},setup(r){const t=r,e=Ln([]);vl([()=>t.focusNode,()=>t.focusCount],async()=>{if(!t.focusNode)return;const s=t.focusNode.id;Pf().then(async()=>{var f,c;await Cy(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=Ln(),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)=>(Dr(),di("div",rF,[jt(ht(kT),{size:"small",striped:"",singleLine:!1,themeOverrides:{thPaddingSmall:"2px 4px",tdPaddingSmall:"2px 4px"}},{default:It(()=>[jt(ht(o4),null,{default:It(()=>[jt(ht(Iy),null,{default:It(()=>[jt(ht(qo),null,{default:It(()=>[dn(" 设备 ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" GKD ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 应用名称 ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 版本名称 ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 版本代码 ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 应用ID ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 界面ID ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 操作 ")]),_:1})]),_:1})]),_:1}),jt(ht(DT),null,{default:It(()=>[jt(ht(Iy),null,{default:It(()=>[jt(ht(Pa),{class:"whitespace-nowrap w-0"},{default:It(()=>[dn(Sn(`${ht(f0)(s.snapshot).manufacturer} Android ${ht(f0)(s.snapshot).release||""}`),1)]),_:1}),jt(ht(Pa),{class:"whitespace-nowrap"},{default:It(()=>[dn(Sn(ht(f0)(s.snapshot).gkdVersionName||"1.6.4"),1)]),_:1}),jt(ht(Pa),{class:"whitespace-nowrap",onClick:u[0]||(u[0]=l=>ht(Js)(s.snapshot.appName))},{default:It(()=>[jt(ht(ol),null,{default:It(()=>[dn(Sn(s.snapshot.appName),1)]),_:1})]),_:1}),jt(ht(Pa),{class:"whitespace-nowrap",onClick:u[1]||(u[1]=l=>ht(Js)(s.snapshot.appVersionName))},{default:It(()=>[jt(ht(ol),null,{default:It(()=>[dn(Sn(s.snapshot.appVersionName),1)]),_:1})]),_:1}),jt(ht(Pa),{class:"whitespace-nowrap",onClick:u[2]||(u[2]=l=>ht(Js)(s.snapshot.appVersionCode.toString()))},{default:It(()=>[jt(ht(ol),null,{default:It(()=>[dn(Sn(s.snapshot.appVersionCode),1)]),_:1})]),_:1}),jt(ht(Pa),{class:"whitespace-nowrap max-w-[max(12vw,180px)]",onClick:u[3]||(u[3]=l=>ht(Js)(s.snapshot.appId))},{default:It(()=>[jt(ht(ol),null,{default:It(()=>[dn(Sn(s.snapshot.appId),1)]),_:1})]),_:1}),jt(ht(Pa),{onClick:u[4]||(u[4]=l=>ht(Js)(s.snapshot.activityId)),class:"break-words max-w-[max(15vw,200px)]"},{default:It(()=>[jt(ht(ol),null,{default:It(()=>[dn(Sn(s.snapshot.activityId),1)]),_:1})]),_:1}),jt(ht(Pa),null,{default:It(()=>[_T(s.$slots,"default")]),_:3})]),_:3})]),_:3})]),_:3}),jt(ht(E4),{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 Oy=function(r,t){return Oy=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])},Oy(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");Oy(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 kn(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 FT(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 zT(r,t){return function(e,n){t(e,n,r)}}function iF(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 aF(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 oF(r){return typeof r=="symbol"?r:"".concat(r)}function sF(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 GT(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 $T(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 b1(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 UT(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(b1(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 Tl(r){return this instanceof Tl?(this.v=r,this):new Tl(r)}function jT(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 Tl?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 WT(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:Tl(r[i](o)),done:!1}:a?a(o):o}:a}}function XT(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 YT(r,t){return Object.defineProperty?Object.defineProperty(r,"raw",{value:t}):r.raw=t,r}var uF=Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t};function VT(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 uF(t,r),t}function HT(r){return r&&r.__esModule?r:{default:r}}function KT(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 qT(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 ZT(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 QT(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 lF=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 JT(r){function t(n){r.error=r.hasError?new lF(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 fF={__extends:zt,__assign:F,__rest:kn,__decorate:FT,__param:zT,__metadata:GT,__awaiter:Ii,__generator:Oi,__createBinding:fp,__exportStar:$T,__values:yv,__read:b1,__spread:UT,__spreadArrays:cp,__spreadArray:Bi,__await:Tl,__asyncGenerator:jT,__asyncDelegator:WT,__asyncValues:XT,__makeTemplateObject:YT,__importStar:VT,__importDefault:HT,__classPrivateFieldGet:KT,__classPrivateFieldSet:qT,__classPrivateFieldIn:ZT,__addDisposableResource:QT,__disposeResources:JT},cF=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:QT,get __assign(){return F},__asyncDelegator:WT,__asyncGenerator:jT,__asyncValues:XT,__await:Tl,__awaiter:Ii,__classPrivateFieldGet:KT,__classPrivateFieldIn:ZT,__classPrivateFieldSet:qT,__createBinding:fp,__decorate:FT,__disposeResources:JT,__esDecorate:iF,__exportStar:$T,__extends:zt,__generator:Oi,__importDefault:HT,__importStar:VT,__makeTemplateObject:YT,__metadata:GT,__param:zT,__propKey:oF,__read:b1,__rest:kn,__runInitializers:aF,__setFunctionName:sF,__spread:UT,__spreadArray:Bi,__spreadArrays:cp,__values:yv,default:fF},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},dF=function(r,t){return t===void 0&&(t=[]),dp(r,function(e){return!mv(t,e)})},hF={}.toString,wa=function(r,t){return hF.call(r)==="[object "+t+"]"};const Yr=function(r){return wa(r,"Function")};var gt=function(r){return r==null};const wt=function(r){return Array.isArray?Array.isArray(r):wa(r,"Array")},Xn=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(Xn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var eA=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 tA(r,t){var e=eA(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},jn=function(r){if(!bv(r)||!wa(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 vF(r,t){if(!wt(r))return null;var e;if(Yr(t)&&(e=t),jn(t)&&(e=function(i){return tA(i,t)}),e){for(var n=0;n<r.length;n+=1)if(e(r[n]))return r[n]}return null}function pF(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 gF=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},yF=function(r){if(!wt(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},rA=function(r,t){if(t===void 0&&(t=[]),!wt(r))t.push(r);else for(var e=0;e<r.length;e+=1)rA(r[e],t);return t};const Ja=function(r){if(wt(r))return r.reduce(function(t,e){return Math.max(t,e)},r[0])},eo=function(r){if(wt(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])};var nA=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=Ja(t),a=eo(t);return{min:a,max:i}},iA=Array.prototype,mF=iA.splice,bF=iA.indexOf,xF=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=bF.call(r,i))>-1;)mF.call(r,a,1);return r},wF=Array.prototype.splice,aA=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,wF.call(t,o,1))}return t},oA=function(r,t,e){if(!wt(r)&&!jn(r))return r;var n=e;return xe(r,function(i,a){n=t(n,i,a)}),n},EF=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 aA(r,i),e};const Fe=function(r){return wa(r,"String")};function _F(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 SF=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return lc([].concat.apply([],r))};const MF=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 qa(r){if(Ei(r))return r[0]}function Ji(r){if(Ei(r)){var t=r;return t[t.length-1]}}function CF(r,t){return wt(r)||Fe(r)?r[0]===t:!1}function TF(r,t){return wt(r)||Fe(r)?r[r.length-1]===t:!1}var AF=function(r,t){for(var e=0;e<r.length;e++)if(!t(r[e],e))return!1;return!0},IF=function(r,t){for(var e=0;e<r.length;e++)if(t(r[e],e))return!0;return!1},OF=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),OF.call(e,i)?e[i].push(o):e[i]=[o]}return e}function sA(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 LF=function(r,t){if(!t)return[r];var e=sA(r,t),n=[];for(var i in e)n.push(e[i]);return n};function kF(r,t){return r["_wrap_"+t]}function eu(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 DF(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 NF(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 PF=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 wa(r,"Number")},RF=function(r){return mt(r)&&r%1!==0},BF=function(r){return mt(r)&&r%2===0},FF=Number.isInteger?Number.isInteger:function(r){return mt(r)&&r%1===0},zF=function(r){return mt(r)&&r<0},GF=1e-5;function uA(r,t,e){return e===void 0&&(e=GF),Math.abs(r-t)<e}var $F=function(r){return mt(r)&&r%2!==0},UF=function(r){return mt(r)&&r>0};const jF=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}},WF=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},XF=180/Math.PI,YF=function(r){return XF*r};const VF=parseInt;var HF=Math.PI/180,vp=function(r){return HF*r};const $E=function(r,t){return r.hasOwnProperty(t)};var x1=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 KF=function(r,t){return mv(x1(r),t)},Yl=function(r){return gt(r)?"":r.toString()};var qF=function(r){return Yl(r).toLowerCase()},ZF=function(r){var t=Yl(r);return t.charAt(0).toLowerCase()+t.substring(1)};function QF(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 JF=function(r){return Yl(r).toUpperCase()},Al=function(r){var t=Yl(r);return t.charAt(0).toUpperCase()+t.substring(1)},e6={}.toString,lA=function(r){return e6.call(r).replace(/^\[object /,"").replace(/]$/,"")},t6=function(r){return wa(r,"Arguments")},Bc=function(r){return wa(r,"Boolean")},w1=function(r){return wa(r,"Date")},r6=function(r){return wa(r,"Error")};function n6(r){return mt(r)&&isFinite(r)}var i6=function(r){return r===null},a6=Object.prototype,fA=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||a6;return r===e},o6=function(r){return wa(r,"RegExp")},s6=function(r){return r===void 0},u6=function(r){return r instanceof Element||r instanceof HTMLDocument};function cA(r){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,16)};return t(r)}function dA(r){var t=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;t(r)}function d0(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&&d0(r,t),e&&d0(r,e),n&&d0(r,n),r}var l6=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 hA=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 f6=5;function vA(r,t,e,n){e=e||0,n=n||f6;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];a!==null&&jn(a)?(jn(r[i])||(r[i]={}),e<n?vA(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)vA(r,t[n]);return r},c6=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},E1=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},d6=Object.prototype.hasOwnProperty;function pA(r){if(gt(r))return!0;if(Ei(r))return!r.length;var t=lA(r);if(t==="Map"||t==="Set")return!r.size;if(fA(r))return!Object.keys(r).length;for(var e in r)if(d6.call(r,e))return!1;return!0}var bs=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=bs(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=bs(r[i[n]],t[i[n]]),!!e);n++);return e}return!1};const h6=function(r,t,e){return Yr(e)?!!e(r,t):bs(r,t)};var fu=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},v6=function(r){return r};const p6=function(r,t){t===void 0&&(t=v6);var e={};return Xn(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},g6=function(r,t,e){var n=r,i=Fe(t)?t.split("."):t;return i.forEach(function(a,o){o<i.length-1?(Xn(n[a])||(n[a]=mt(i[o+1])?[]:{}),n=n[a]):n[a]=e}),r};var y6=Object.prototype.hasOwnProperty;const m6=function(r,t){if(r===null||!jn(r))return{};var e={};return xe(t,function(n){y6.call(r,n)&&(e[n]=r[n])}),e},b6=function(r,t){return oA(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},gA=function(r){return Ei(r)?Array.prototype.slice.call(r):[]};var Wd={};const to=function(r){return r=r||"g",Wd[r]?Wd[r]+=1:Wd[r]=1,r+Wd[r]},Bf=function(){},x6=function(r){return r};function pp(r){return gt(r)?0:Ei(r)?r.length:Object.keys(r).length}var Xd;const Ff=hA(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],x1(t)).join("")}),w6=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 E6=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 _6=Object.freeze(Object.defineProperty({__proto__:null,Cache:E6,assign:Mt,augment:l6,clamp:PF,clearAnimationFrame:dA,clone:ar,contains:mv,debounce:Fc,deepMix:Pr,difference:dF,each:xe,endsWith:TF,every:AF,extend:c6,filter:dp,find:vF,findIndex:pF,firstValue:gF,fixedBase:jh,flatten:yF,flattenDeep:rA,forIn:xe,get:Co,getEllipsisText:w6,getRange:nA,getType:lA,getWrapBehavior:kF,group:LF,groupBy:xv,groupToMap:sA,has:$E,hasKey:$E,hasValue:KF,head:qa,identity:x6,includes:mv,indexOf:E1,isArguments:t6,isArray:wt,isArrayLike:Ei,isBoolean:Bc,isDate:w1,isDecimal:RF,isElement:u6,isEmpty:pA,isEqual:bs,isEqualWith:h6,isError:r6,isEven:BF,isFinite:n6,isFunction:Yr,isInteger:FF,isMatch:tA,isNegative:zF,isNil:gt,isNull:i6,isNumber:mt,isNumberEqual:uA,isObject:Xn,isObjectLike:bv,isOdd:$F,isPlainObject:jn,isPositive:UF,isPrototype:fA,isRegExp:o6,isString:Fe,isType:wa,isUndefined:s6,keys:eA,last:Ji,lowerCase:qF,lowerFirst:ZF,map:fu,mapValues:p6,max:Ja,maxBy:jF,measureTextWidth:Ff,memoize:hA,min:eo,minBy:WF,mix:Mt,mod:hp,noop:Bf,number2color:DF,omit:b6,parseRadius:NF,pick:m6,pull:xF,pullAt:aA,reduce:oA,remove:EF,requestAnimationFrame:cA,set:g6,size:pp,some:IF,sortBy:_F,startsWith:CF,substitute:QF,throttle:fc,toArray:gA,toDegree:YF,toInteger:VF,toRadian:vp,toString:Yl,union:SF,uniq:lc,uniqueId:to,upperCase:JF,upperFirst:Al,values:x1,valuesOfKey:MF,wrapBehavior:eu},Symbol.toStringTag,{value:"Module"})),S6={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 _1=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(S6);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]=eu(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}(),M6="*",yA=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[M6]||[],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}(),Ot=1e-6,vr=typeof Float32Array<"u"?Float32Array:Array,pa=Math.random;function C6(r){vr=r}var T6=Math.PI/180;function A6(r){return r*T6}function I6(r,t){return Math.abs(r-t)<=Ot*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 O6=Object.freeze(Object.defineProperty({__proto__:null,get ARRAY_TYPE(){return vr},EPSILON:Ot,RANDOM:pa,equals:I6,setMatrixArrayType:C6,toRadian:A6},Symbol.toStringTag,{value:"Module"}));function L6(){var r=new vr(4);return vr!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}function k6(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 D6(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function N6(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}function P6(r,t,e,n){var i=new vr(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function R6(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function B6(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 F6(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 z6(r,t){var e=t[0];return r[0]=t[3],r[1]=-t[1],r[2]=-t[2],r[3]=e,r}function G6(r){return r[0]*r[3]-r[2]*r[1]}function mA(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 $6(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 U6(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 j6(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 W6(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r}function X6(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function Y6(r){return Math.hypot(r[0],r[1],r[2],r[3])}function V6(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 H6(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 bA(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 K6(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function q6(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=Ot*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=Ot*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-l)<=Ot*Math.max(1,Math.abs(a),Math.abs(l))}function Z6(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 Q6(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 J6=mA,ez=bA;const tz=Object.freeze(Object.defineProperty({__proto__:null,LDU:V6,add:H6,adjoint:z6,clone:k6,copy:D6,create:L6,determinant:G6,equals:q6,exactEquals:K6,frob:Y6,fromRotation:j6,fromScaling:W6,fromValues:P6,identity:N6,invert:F6,mul:J6,multiply:mA,multiplyScalar:Z6,multiplyScalarAndAdd:Q6,rotate:$6,scale:U6,set:R6,str:X6,sub:ez,subtract:bA,transpose:B6},Symbol.toStringTag,{value:"Module"}));function rz(){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 nz(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 iz(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 az(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function oz(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 sz(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 uz(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 lz(r){return r[0]*r[3]-r[1]*r[2]}function xA(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 fz(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 cz(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 dz(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 hz(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 vz(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 pz(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 gz(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"}function yz(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],1)}function mz(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 wA(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 bz(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 xz(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 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]}function Ez(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(n-l)<=Ot*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=Ot*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-c)<=Ot*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-d)<=Ot*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(s-h)<=Ot*Math.max(1,Math.abs(s),Math.abs(h))}var _z=xA,Sz=wA;const Mz=Object.freeze(Object.defineProperty({__proto__:null,add:mz,clone:nz,copy:iz,create:rz,determinant:lz,equals:Ez,exactEquals:wz,frob:yz,fromRotation:hz,fromScaling:vz,fromTranslation:pz,fromValues:oz,identity:az,invert:uz,mul:_z,multiply:xA,multiplyScalar:bz,multiplyScalarAndAdd:xz,rotate:fz,scale:cz,set:sz,str:gz,sub:Sz,subtract:wA,translate:dz},Symbol.toStringTag,{value:"Module"}));function EA(){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 Cz(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 Tz(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 Az(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 Iz(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 Oz(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 Lz(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 kz(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 S1(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 Dz(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 Nz(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 io(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 Pz(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 Rz(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 Bz(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 M1(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 C1(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 T1(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 Fz(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 zz(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 Gz(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,T=c*g-d*p,A=c*y-h*p,I=d*y-h*g,k=m*I-b*A+x*T+w*S-E*C+_*M;return k?(k=1/k,r[0]=(s*I-u*A+l*T)*k,r[1]=(u*S-o*I-l*C)*k,r[2]=(o*A-s*S+l*M)*k,r[3]=(i*A-n*I-a*T)*k,r[4]=(e*I-i*S+a*C)*k,r[5]=(n*S-e*A-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 $z(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 Uz(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function jz(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function Wz(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 _A(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 Xz(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 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[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r}function Vz(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 Hz(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(n-d)<=Ot*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-h)<=Ot*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-v)<=Ot*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=Ot*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=Ot*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=Ot*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(l-m)<=Ot*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(f-b)<=Ot*Math.max(1,Math.abs(f),Math.abs(b))}var Kz=io,qz=_A;const SA=Object.freeze(Object.defineProperty({__proto__:null,add:Wz,adjoint:Dz,clone:Tz,copy:Az,create:EA,determinant:Nz,equals:Hz,exactEquals:Vz,frob:jz,fromMat2d:Fz,fromMat4:Cz,fromQuat:zz,fromRotation:C1,fromScaling:T1,fromTranslation:M1,fromValues:Iz,identity:Lz,invert:S1,mul:Kz,multiply:io,multiplyScalar:Xz,multiplyScalarAndAdd:Yz,normalFromMat4:Gz,projection:$z,rotate:Rz,scale:Bz,set:Oz,str:Uz,sub:qz,subtract:_A,translate:Pz,transpose:kz},Symbol.toStringTag,{value:"Module"}));function Zz(){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 Qz(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 Jz(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 eG(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 tG(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 MA(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 rG(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 nG(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,T=c*g-d*p,A=c*y-h*p,I=d*y-h*g,k=m*I-b*A+x*T+w*S-E*C+_*M;return k?(k=1/k,r[0]=(s*I-u*A+l*T)*k,r[1]=(i*A-n*I-a*T)*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*A-s*S+l*M)*k,r[9]=(n*S-e*A-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*T-u*M)*k,r[13]=(e*T-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 iG(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 aG(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,T=f*g-d*v,A=c*g-d*p;return y*A-m*T+b*S+x*C-w*M+E*_}function CA(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 oG(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 sG(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 uG(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,T,A,I,k,P;return s<Ot?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,T=a*a*f+l,A=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*T+b*A,r[5]=d*S+g*T+x*A,r[6]=h*S+y*T+w*A,r[7]=v*S+m*T+E*A,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 lG(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 fG(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 cG(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 dG(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 hG(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 vG(r,t,e){var n=e[0],i=e[1],a=e[2],o=Math.hypot(n,i,a),s,u,l;return o<Ot?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 pG(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 gG(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 yG(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 TA(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 mG(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),TA(r,t,e),r}function AA(r,t){return r[0]=t[12],r[1]=t[13],r[2]=t[14],r}function IA(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 OA(r,t){var e=new vr(3);IA(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 bG(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 xG(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],T=(1-(p+y))*w,A=(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]=T,r[1]=A,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-(T*M+k*C+z*S),r[13]=e[1]+C-(A*M+P*C+W*S),r[14]=e[2]+S-(I*M+N*C+D*S),r[15]=1,r}function wG(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 EG(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 LA(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 _G=LA;function SG(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 MG(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 kA(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 CG=kA;function TG(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 AG(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)<Ot&&Math.abs(p-w)<Ot&&Math.abs(g-E)<Ot?MA(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 IG(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 OG(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 LG(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 kG(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 DA(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 DG(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 NG(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 PG(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 RG(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],T=t[9],A=t[10],I=t[11],k=t[12],P=t[13],N=t[14],z=t[15];return Math.abs(e-m)<=Ot*Math.max(1,Math.abs(e),Math.abs(m))&&Math.abs(n-b)<=Ot*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=Ot*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=Ot*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-E)<=Ot*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-_)<=Ot*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(u-M)<=Ot*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(l-C)<=Ot*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(f-S)<=Ot*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(c-T)<=Ot*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(d-A)<=Ot*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(h-I)<=Ot*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(v-k)<=Ot*Math.max(1,Math.abs(v),Math.abs(k))&&Math.abs(p-P)<=Ot*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-N)<=Ot*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(y-z)<=Ot*Math.max(1,Math.abs(y),Math.abs(z))}var BG=CA,FG=DA;const zG=Object.freeze(Object.defineProperty({__proto__:null,add:kG,adjoint:iG,clone:Qz,copy:Jz,create:Zz,determinant:aG,equals:RG,exactEquals:PG,frob:LG,fromQuat:wG,fromQuat2:mG,fromRotation:vG,fromRotationTranslation:TA,fromRotationTranslationScale:bG,fromRotationTranslationScaleOrigin:xG,fromScaling:hG,fromTranslation:dG,fromValues:eG,fromXRotation:pG,fromYRotation:gG,fromZRotation:yG,frustum:EG,getRotation:OA,getScaling:IA,getTranslation:AA,identity:MA,invert:nG,lookAt:AG,mul:BG,multiply:CA,multiplyScalar:DG,multiplyScalarAndAdd:NG,ortho:CG,orthoNO:kA,orthoZO:TG,perspective:_G,perspectiveFromFieldOfView:MG,perspectiveNO:LA,perspectiveZO:SG,rotate:uG,rotateX:lG,rotateY:fG,rotateZ:cG,scale:sG,set:tG,str:OG,sub:FG,subtract:DA,targetTo:IG,translate:oG,transpose:rG},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 GG(r){var t=new vr(3);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function NA(r){var t=r[0],e=r[1],n=r[2];return Math.hypot(t,e,n)}function Ly(r,t,e){var n=new vr(3);return n[0]=r,n[1]=t,n[2]=e,n}function $G(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function UG(r,t,e,n){return r[0]=t,r[1]=e,r[2]=n,r}function jG(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r}function PA(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r}function RA(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r}function BA(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r}function WG(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r}function XG(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r}function YG(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 VG(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 HG(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r}function KG(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r}function qG(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 FA(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 zA(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 GA(r){var t=r[0],e=r[1],n=r[2];return t*t+e*e+n*n}function ZG(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r}function QG(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r}function $A(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 I1(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 JG(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 e8(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 t8(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 r8(r,t){t=t||1;var e=pa()*2*Math.PI,n=pa()*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 n8(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 i8(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 a8(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 o8(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 s8(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 u8(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&&I1(r,t)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function l8(r){return r[0]=0,r[1]=0,r[2]=0,r}function f8(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function c8(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}function d8(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(n-o)<=Ot*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=Ot*Math.max(1,Math.abs(i),Math.abs(s))}var h8=PA,v8=RA,p8=BA,g8=FA,y8=zA,UA=NA,m8=GA,b8=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 x8=Object.freeze(Object.defineProperty({__proto__:null,add:jG,angle:u8,bezier:t8,ceil:WG,clone:GG,copy:$G,create:A1,cross:Wh,dist:g8,distance:FA,div:p8,divide:BA,dot:I1,equals:d8,exactEquals:c8,floor:XG,forEach:b8,fromValues:Ly,hermite:e8,inverse:QG,len:UA,length:NA,lerp:JG,max:VG,min:YG,mul:v8,multiply:RA,negate:ZG,normalize:$A,random:r8,rotateX:a8,rotateY:o8,rotateZ:s8,round:HG,scale:KG,scaleAndAdd:qG,set:UG,sqrDist:y8,sqrLen:m8,squaredDistance:zA,squaredLength:GA,str:f8,sub:h8,subtract:PA,transformMat3:gp,transformMat4:n8,transformQuat:i8,zero:l8},Symbol.toStringTag,{value:"Module"}));function jA(){var r=new vr(4);return vr!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function WA(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 XA(r,t,e,n){var i=new vr(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function YA(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function VA(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function HA(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 KA(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 qA(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 ZA(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 w8(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 E8(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 _8(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 S8(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 M8(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 QA(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 C8(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 JA(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 eI(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 O1(r){var t=r[0],e=r[1],n=r[2],i=r[3];return Math.hypot(t,e,n,i)}function L1(r){var t=r[0],e=r[1],n=r[2],i=r[3];return t*t+e*e+n*n+i*i}function T8(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=-t[3],r}function A8(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 tI(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 rI(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]}function I8(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 nI(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 O8(r,t){t=t||1;var e,n,i,a,o,s;do e=pa()*2-1,n=pa()*2-1,o=e*e+n*n;while(o>=1);do i=pa()*2-1,a=pa()*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 L8(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 k8(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 D8(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function N8(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function iI(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function aI(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=Ot*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=Ot*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-l)<=Ot*Math.max(1,Math.abs(a),Math.abs(l))}var P8=KA,R8=qA,B8=ZA,F8=JA,z8=eI,G8=O1,$8=L1,U8=function(){var r=jA();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 j8=Object.freeze(Object.defineProperty({__proto__:null,add:HA,ceil:w8,clone:WA,copy:YA,create:jA,cross:I8,dist:F8,distance:JA,div:B8,divide:ZA,dot:rI,equals:aI,exactEquals:iI,floor:E8,forEach:U8,fromValues:XA,inverse:A8,len:G8,length:O1,lerp:nI,max:S8,min:_8,mul:R8,multiply:qA,negate:T8,normalize:tI,random:O8,round:M8,scale:QA,scaleAndAdd:C8,set:VA,sqrDist:z8,sqrLen:$8,squaredDistance:eI,squaredLength:L1,str:N8,sub:P8,subtract:KA,transformMat4:L8,transformQuat:k8,zero:D8},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 W8(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function oI(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 X8(r,t){var e=Math.acos(t[3])*2,n=Math.sin(e/2);return n>Ot?(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 Y8(r,t){var e=D1(r,t);return Math.acos(2*e*e-1)}function sI(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 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+o*s,r[1]=i*u+a*s,r[2]=a*u-i*s,r[3]=o*u-n*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-a*s,r[1]=i*u+o*s,r[2]=a*u+n*s,r[3]=o*u-i*s,r}function fI(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 V8(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 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=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 dI(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 H8(r,t,e){return dI(r,t),vI(r,r,e),cI(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>Ot?(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 K8(r){var t=pa(),e=pa(),n=pa(),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 q8(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 Z8(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r}function hI(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 Q8(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 J8(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var e$=WA,t$=XA,k1=YA,r$=VA,n$=HA,i$=sI,vI=QA,D1=rI,a$=nI,N1=O1,o$=N1,P1=L1,s$=P1,R1=tI,u$=iI,l$=aI,f$=function(){var r=A1(),t=Ly(1,0,0),e=Ly(0,1,0);return function(n,i,a){var o=I1(i,a);return o<-.999999?(Wh(r,t,i),UA(r)<1e-6&&Wh(r,e,i),$A(r,r),oI(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,R1(n,n))}}(),c$=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}}(),d$=function(){var r=EA();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],R1(t,hI(t,r))}}();const h$=Object.freeze(Object.defineProperty({__proto__:null,add:n$,calculateW:V8,clone:e$,conjugate:Z8,copy:k1,create:wv,dot:D1,equals:l$,exactEquals:u$,exp:cI,fromEuler:Q8,fromMat3:hI,fromValues:t$,getAngle:Y8,getAxisAngle:X8,identity:W8,invert:q8,len:o$,length:N1,lerp:a$,ln:dI,mul:i$,multiply:sI,normalize:R1,pow:H8,random:K8,rotateX:uI,rotateY:lI,rotateZ:fI,rotationTo:f$,scale:vI,set:r$,setAxes:d$,setAxisAngle:oI,slerp:Xh,sqlerp:c$,sqrLen:s$,squaredLength:P1,str:J8},Symbol.toStringTag,{value:"Module"}));function v$(){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 p$(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 g$(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 y$(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 pI(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 m$(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 b$(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 x$(r,t){var e=wv();OA(e,t);var n=new vr(3);return AA(n,t),pI(r,e,n),r}function gI(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 w$(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 E$(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 _$=k1;function S$(r,t){return r[0]=t[4],r[1]=t[5],r[2]=t[6],r[3]=t[7],r}var M$=k1;function C$(r,t){return r[4]=t[0],r[5]=t[1],r[6]=t[2],r[7]=t[3],r}function T$(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 A$(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 I$(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 O$(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 L$(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 fI(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 k$(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 D$(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 N$(r,t,e,n){if(Math.abs(n)<Ot)return gI(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 P$(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 yI(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 R$=yI;function B$(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 mI=D1;function F$(r,t,e,n){var i=1-n;return mI(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 z$(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 G$(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 bI=N1,$$=bI,yp=P1,U$=yp;function j$(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 W$(r){return"quat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+")"}function X$(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 Y$(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(f))&&Math.abs(n-c)<=Ot*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-d)<=Ot*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-h)<=Ot*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(o-v)<=Ot*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=Ot*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(u-g)<=Ot*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(l-y)<=Ot*Math.max(1,Math.abs(l),Math.abs(y))}const V$=Object.freeze(Object.defineProperty({__proto__:null,add:P$,clone:p$,conjugate:G$,copy:gI,create:v$,dot:mI,equals:Y$,exactEquals:X$,fromMat4:x$,fromRotation:b$,fromRotationTranslation:pI,fromRotationTranslationValues:y$,fromTranslation:m$,fromValues:g$,getDual:S$,getReal:_$,getTranslation:T$,identity:w$,invert:z$,len:$$,length:bI,lerp:F$,mul:R$,multiply:yI,normalize:j$,rotateAroundAxis:N$,rotateByQuatAppend:k$,rotateByQuatPrepend:D$,rotateX:I$,rotateY:O$,rotateZ:L$,scale:B$,set:E$,setDual:C$,setReal:M$,sqrLen:U$,squaredLength:yp,str:W$,translate:A$},Symbol.toStringTag,{value:"Module"}));function xI(){var r=new vr(2);return vr!=Float32Array&&(r[0]=0,r[1]=0),r}function H$(r){var t=new vr(2);return t[0]=r[0],t[1]=r[1],t}function K$(r,t){var e=new vr(2);return e[0]=r,e[1]=t,e}function q$(r,t){return r[0]=t[0],r[1]=t[1],r}function Z$(r,t,e){return r[0]=t,r[1]=e,r}function Un(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 _I(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r}function Q$(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r}function J$(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r}function is(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r}function as(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r}function eU(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r}function ai(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r}function tU(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 SI(r,t){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function MI(r){var t=r[0],e=r[1];return Math.hypot(t,e)}function CI(r){var t=r[0],e=r[1];return t*t+e*e}function rU(r,t){return r[0]=-t[0],r[1]=-t[1],r}function nU(r,t){return r[0]=1/t[0],r[1]=1/t[1],r}function ys(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 B1(r,t){return r[0]*t[0]+r[1]*t[1]}function iU(r,t,e){var n=t[0]*e[1]-t[1]*e[0];return r[0]=r[1]=0,r[2]=n,r}function aU(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 oU(r,t){t=t||1;var e=pa()*2*Math.PI;return r[0]=Math.cos(e)*t,r[1]=Math.sin(e)*t,r}function sU(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 uU(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 lU(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 fU(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 cU(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 TI(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 dU(r){return r[0]=0,r[1]=0,r}function hU(r){return"vec2("+r[0]+", "+r[1]+")"}function F1(r,t){return r[0]===t[0]&&r[1]===t[1]}function vU(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.abs(e-i)<=Ot*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(n-a)<=Ot*Math.max(1,Math.abs(n),Math.abs(a))}var pU=MI,Yh=wI,gU=EI,yU=_I,mU=Ev,bU=SI,xU=CI,wU=function(){var r=xI();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 EU=Object.freeze(Object.defineProperty({__proto__:null,add:Un,angle:TI,ceil:Q$,clone:H$,copy:q$,create:xI,cross:iU,dist:mU,distance:Ev,div:yU,divide:_I,dot:B1,equals:vU,exactEquals:F1,floor:J$,forEach:wU,fromValues:K$,inverse:nU,len:pU,length:MI,lerp:aU,max:as,min:is,mul:gU,multiply:EI,negate:rU,normalize:ys,random:oU,rotate:cU,round:eU,scale:ai,scaleAndAdd:tU,set:Z$,sqrDist:bU,sqrLen:xU,squaredDistance:SI,squaredLength:CI,str:hU,sub:Yh,subtract:wI,transformMat2:sU,transformMat2d:uU,transformMat3:lU,transformMat4:fU,zero:dU},Symbol.toStringTag,{value:"Module"})),_U=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:O6,mat2:tz,mat2d:Mz,mat3:SA,mat4:zG,quat:h$,quat2:V$,vec2:EU,vec3:x8,vec4:j8},Symbol.toStringTag,{value:"Module"}));function SU(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return M1(n,e),io(r,n,t)}function MU(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return C1(n,e),io(r,n,t)}function CU(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return T1(n,e),io(r,n,t)}function TU(r,t,e){return io(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":SU(e,e,[a[1],a[2]]);break;case"s":CU(e,e,[a[1],a[2]]);break;case"r":MU(e,e,a[1]);break;case"m":TU(e,e,a[1]);break}}return e}var cu=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},AU=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=AU),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}(),IU=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)},OU=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})},II=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 LU(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 OI=function(t,e,n,i){i===void 0&&(i=!0);var a=LU(n),o=new IU,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()},kU=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},LI=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(T){return T.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 z1(r,t){return t?LI(r):kU(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},kI=function(t,e){var n=Po(t);return n[e]?Po(t)[e].inDegree:0},DI=function(t,e){var n=Po(t);return n[e]?Po(t)[e].outDegree:0};function DU(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 NI(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})&&NI(r,s,t,n,i)}),n.leave({current:t,previous:e})}function G1(r,t,e,n){n===void 0&&(n=!0),NI(r,t,"",DU(e),n)}var $1=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];G1(t,f,l)}return e},U1=function(t,e,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=z1(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,T=[C,g],A=v[y];p[M].size&&!p[M].has(A)&&(T.push(A),A!==v[A.id]);)A=v[A.id];if(T.push(A),e&&n?(S=!1,T.findIndex(function(P){return e.indexOf(P.id)>-1})>-1&&(S=!0)):e&&!n&&T.findIndex(function(P){return e.indexOf(P.id)>-1})>-1&&(S=!1),S){for(var I={},k=1;k<T.length;k+=1)I[T[k-1].id]=T[k];T.length&&(I[T[T.length-1].id]=T[0]),o.push(I)}p[M].add(g)}},x=0;x<m.length;x+=1)b(x)}return o},j1=function(t,e,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],u={},l={},f=function(A){for(var I=[A];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 T(A,I,k){var P=!1;if(e&&n===!1&&e.indexOf(A.id)>-1)return P;i.push(A),a.add(A);for(var N=k[A.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)||T(W,I,k)&&(P=!0)}if(P)f(A);else for(var z=0;z<N.length;z+=1){var W=u[N[z]];o[W.id].has(A)||o[W.id].add(A)}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(A){var I=e[A];l[h[A].id]=l[I],l[I]=0,u[0]=h.find(function(k){return k.id===I}),u[l[h[A].id]]=h[A]},v=0;v<e.length;v++)y(v);for(var m=function(A){for(var I,k,P=1/0,N=0;N<A.length;N+=1)for(var z=A[N],W=0;W<z.length;W++){var D=l[z[W].id];D<P&&(P=D,k=N)}for(var R=A[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(Te){return R.map(function(Ke){return Ke.id}).indexOf(Te)>-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(T){return l[T.id]>=b}),w=LI({nodes:x,edges:t.edges}).filter(function(T){return T.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(T){o[T.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},PI=function(t,e,n,i){return i===void 0&&(i=!0),e?j1(t,n,i):U1(t,n,i)},NU=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=NU(f,o,l),w=x.id;if(l[w]=!0,f[w]===1/0)return"continue";var E=[];n?E=OU(w,u):E=Vh(w,u),E.forEach(function(_){var M=_.target,C=_.source,S=M===w?C:M,T=i&&_[i]?_[i]:1;f[S]>f[x.id]+T?(f[S]=f[x.id]+T,c[S]=[x.id]):f[S]===f[x.id]+T&&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&&RI(e,g,c,p);var y={};for(var g in p)y[g]=p[g][0];return{length:f,path:y,allPath:p}};function RI(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=RI(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 BI=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]}},FI=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=cu(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},zI=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=II();b.clusterId=w,l[w]={id:w,nodes:[b]},f[b.id]={node:b,idx:x}});var c=cu(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],T=S.nodes.indexOf(w);S.nodes.splice(T,1);var A=Math.floor(Math.random()*M.length),I=l[M[A]];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}(),W1=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},va;(function(r){r.EuclideanDistance="euclideanDistance"})(va||(va={}));var PU=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},X1=function(t,e,n){var i=PU(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=va.EuclideanDistance);var a=0;switch(n){case va.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},h0=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))},Y1=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=W1(c,o);v=X1(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=cu(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,T=[],A={};;){a&&c.every(function(D){return D.hasOwnProperty("properties")})?M=WE(c,x,w,_)+h0(c,v)*l:M=WE(c,x,w,_),S===0&&(C=M,T=c,A=m);var I=M>0&&M>C&&M-C<i;if(M>C&&(T=c.map(function(D){return{node:D,clusterId:D.clusterId}}),A=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(Wt){var Mr=b[Wt.id].idx;fe+=x[R][Mr]||0});var Te=fe-H.sumTot*X,Ke=we.filter(function(Wt){return Wt.id!==D.id});Ke.forEach(function(Wt,Mr){v[Wt.originIndex]});var ot=h0(Ke,v)*l,nt=E[D.id];if(Object.keys(nt).forEach(function(Wt){var Mr=b[Wt].node,rr=Mr.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=h0(ie,v)*l,Se=et-Te;a&&(Se=et+L-(Te+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(Wt){var Mr=Wt.source,rr=Wt.target,Rt=b[Mr].node.clusterId,sr=b[rr].node.clusterId;(Rt===Y.id&&sr!==Y.id||sr===Y.id&&Rt!==Y.id)&&(fr=fr+(Wt[n]||1)),(Rt===Ct&&sr!==Ct||sr===Ct&&Rt!==Ct)&&(Gt=Gt+(Wt[n]||1))}),Y.sumTot=fr,H.sumTot=Gt}})}var k={},P=0;Object.keys(A).forEach(function(D){var R=A[D];if(!R.nodes||!R.nodes.length){delete A[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}}),A[H]=R,k[D]=H,delete A[D],P++)}),T.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(A).forEach(function(D){W.push(A[D])}),{clusters:W,clusterEdges:N}},GI=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),Y1(t,e,n,i,!0,a,o,s,u)},$I=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 va.EuclideanDistance:i=e[n];break;default:i=[];break}return i},UI=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=va.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===va.EuclideanDistance&&!u.every(function(H){return H.hasOwnProperty(n)}))return c;var d=[],h=[];if(o===va.EuclideanDistance&&(d=W1(u,n),h=X1(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 va.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 va.EuclideanDistance:we=jE(h[u[Y].originIndex],y[fe],o);break}X+=we}var Te=X/y.length;Te>w&&!y.find(function(Ke){return bs(Ke,XE(o,h,u[Y].originIndex))})&&(w=Te,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,T=1/0;if(!(C===0&&m.includes(g))){for(var A=0;A<y.length;A++){var I=0;switch(o){case va.EuclideanDistance:I=jE(h[g],y[A],o);break}I<T&&(T=I,S=A)}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([]),A=0;A<N.length;A++)z=z.add(new Qi(h[N[A].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,Te=(Y=u.find(function(nt){return nt.id===fe}))===null||Y===void 0?void 0:Y.clusterId,Ke="".concat(we,"---").concat(Te);if(R[Ke])R[Ke].count++;else{var ot={source:we,target:Te,count:1};R[Ke]=ot,D.push(ot)}}),{clusters:b,clusterEdges:D}},V1=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},jI=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=W1(t,n),l=X1(u,i,a),f=l[s],c=[];return o.forEach(function(d,h){if(d.id!==e.id){var v=l[h],p=V1(v,f);c.push(p),d.cosineSimilarity=p}}),o.sort(function(d,h){return h.cosineSimilarity-d.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},RU=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}(),BU=function(t,e){return t-e},FU=function(){function r(t){t===void 0&&(t=BU),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}(),zU=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 FU(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 RU(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},WI=function(t,e,n){var i={prim:zU,kruskal:YE};return n?i[n](t,e):YE(t,e)},XI=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},GU=-1,_v=-1,YI="-1",ja="-1",VI=-1,VE=function(){function r(t,e,n,i){t===void 0&&(t=GU),e===void 0&&(e=_v),n===void 0&&(n=_v),i===void 0&&(i=YI),this.id=t,this.from=e,this.to=n,this.label=i}return r}(),$U=function(){function r(t,e){t===void 0&&(t=_v),e===void 0&&(e=ja),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}(),HI=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 $U(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||ja,edgeLabel:i||YI,nodeLabel2:a||ja}}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=VI),e===void 0&&(e=!1);var n=new HI(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!==ja&&n.addNode(a,u),f!==ja&&n.addNode(o,f),u!==ja&&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}(),UU=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(VI,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,ja,_.edgeLabel,ja));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 T=h.length,A=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<T;w++){var I=A(w);if(I==="break")break}if(!y)return!0;var k=t.findMinLabel(C);o.dfsEdgeList.push(new Hs(S,p+1,ja,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,ja,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}(),jU=function(t,e,n,i){var a={};return Object.keys(t).forEach(function(o,s){var u=t[o],l=new HI(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},WU=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",XU=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=jU(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 UU(p);g.run();var y=WU(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(KI(o,s,u,n,i))}),a},KI=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}},YU=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)},VU=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(II)]={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},HU=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}},qI=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=YU(i,l,M,E,f),S=Hh(C,E,t),T=10,A=1,I=1,k=4,P={graphs:S,nodeLabelProp:o,edgeLabelProp:s,minSupport:A,minNodeNum:I,maxNodeNum:k,directed:n},N=XU(P).slice(0,T),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=VU(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={},Te={},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})),Te=Hh(Se,_,e,Te);var Pe=[];if(Object.keys(Se).forEach(function(qe){if(Ke[qe]){Pe.push(Ke[qe]);return}var tt=Te[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 Cr={};Ut.neighbors.forEach(function(ir){var Br=d["".concat(yt.id,"-").concat(ir.id)];Cr["".concat(yt.id,"-").concat(ir.id)]={start:p[yt.id].idx,end:p[ir.id].idx,distance:Br}}),S=Hh(Cr,E,t,S);var Er=[];Object.keys(Cr).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 pn=!1,Zt=0;Zt<Pt;Zt++)if(Er[Zt]<Pe[Zt]){pn=!0;break}if(pn)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=KI(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 Cr=H[tt]?H[tt]:HU(t,et,Xe,p,yt,E,R,o,s,H,S),Er="".concat(ee.id,"-").concat(qe),pn=ot[Er][ot[Er].length-1];if(Cr<pn){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 Wt=Et.length,Mr=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],Ar=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]===Ar&&(zr=!0),!n&&Zn[o]===Ar&&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 Cr=cc(L,L.nodes[0].id,!1).length;if(Object.keys(Cr).reverse().forEach(function(_t){if(!(_t===L.nodes[0].id||Pt)){if(Cr[_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||Cr[_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,pn=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,si=Br-1;si>=0;si--){var Kr=L.nodes[si],$i=me[Kr.id].degree,fo=me[Kr.id].inDegree,co=me[Kr.id].outDegree,on=Kr[o],pi=e2(we,on,m,b),ia=pi.minPatternNodeLabelDegree,ho=pi.minPatternNodeLabelInDegree,vo=pi.minPatternNodeLabelOutDegree,po=n?$i<ia||fo<ho||co<vo:$i<ia;if(po){if(Pe[Kr[o]]--,Pe[Kr[o]]<b[Kr[o]].length){Pt=!0;break}L.nodes.splice(si,1),me[Kr.id]=void 0,Er=!0}}if(Pt||!Er&&pn!==0)break;gr=je.length;for(var ui=gr-1;ui>=0;ui--){var jr=je[ui];if(!me[jr.source]||!me[jr.target]){je.splice(ui,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}}pn++}if(Pt||Pt||L.nodes.length<e.nodes.length||je.length<e.edges.length)return Et.splice(ie,1),"continue"},rr=Wt-1;rr>=0;rr--){var Rt=Mr(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}(),ZI=$1;const KU={getAdjMatrix:cu,breadthFirstSearch:OI,connectedComponent:z1,getDegree:Po,getInDegree:kI,getOutDegree:DI,detectCycle:$1,detectDirectedCycle:ZI,detectAllCycles:PI,detectAllDirectedCycle:j1,detectAllUndirectedCycle:U1,depthFirstSearch:G1,dijkstra:cc,findAllPath:FI,findShortestPath:BI,floydWarshall:dc,labelPropagation:zI,louvain:Y1,iLouvain:GI,kCore:$I,kMeans:UI,cosineSimilarity:V1,nodesCosineSimilarity:jI,minimumSpanningTree:WI,pageRank:XI,getNeighbors:Ni,Stack:gl,GADDI:qI},qU=Object.freeze(Object.defineProperty({__proto__:null,GADDI:qI,Stack:gl,breadthFirstSearch:OI,connectedComponent:z1,cosineSimilarity:V1,default:KU,depthFirstSearch:G1,detectAllCycles:PI,detectAllDirectedCycle:j1,detectAllUndirectedCycle:U1,detectCycle:$1,detectDirectedCycle:ZI,dijkstra:cc,findAllPath:FI,findShortestPath:BI,floydWarshall:dc,getAdjMatrix:cu,getDegree:Po,getInDegree:kI,getNeighbors:Ni,getOutDegree:DI,iLouvain:GI,kCore:$I,kMeans:UI,labelPropagation:zI,louvain:Y1,minimumSpanningTree:WI,nodesCosineSimilarity:jI,pageRank:XI},Symbol.toStringTag,{value:"Module"}));var Sv=ra,ZU=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},QI=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},JI=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)}},eO=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]}},tO=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=S1([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]}},ky=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)},QU=function(t,e){var n=[];return t.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*e)}),n.push(a)}),n},JU=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},ej=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},rO=function(t,e){t.translate(e.x,e.y)},Dy=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)}},tj=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)},rj=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)},nj=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 ij(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(ij(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},nO=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},aj=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},iO=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(!nO(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(aj(u,c))return f=!0,!1}),f},du=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}(),H1=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]},oj=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},aO=function(t,e){for(var n=["top","left","bottom","right"],i=t.getBBox(),a=0,o=[],s=0;s<4;s++){var u=H1(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]},K1=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=H1(i,n[s]),l=u[0],f=u[1],c=u[2],d=u[3],h=oj(e,new du(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},oO=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)},sO=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},Ny=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)},uO=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},sj=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(F1(l,[0,0]))return NaN;var f=[-l[1],l[0]];ys(f,f);var c=[s-n,u-i];return Math.abs(B1(c,f))},q1=function(t,e,n){return t+(e-t)*n},Py=function(t,e,n){for(var i=Math.min(t.length,e.length),a=new Array(i),o=0;o<i;o++)a[o]=q1(t[o],e[o],n);return a};const uj=Object.freeze(Object.defineProperty({__proto__:null,Line:du,applyMatrix:xl,compare:ZU,distance:Mv,floydWarshall:JU,fractionToLine:K1,getAdjMatrix:ej,getBBoxBoundLine:H1,getCircleCenterByPoints:ky,getCircleIntersectByPoint:JI,getDegree:nj,getEllipseIntersectByPoint:eO,getLineIntersect:mp,getPointsCenter:oO,getRectIntersectByPoint:QI,intersectBBox:nO,invertMatrix:tO,isPointInPolygon:hc,isPointsOverlap:Ny,isPolygonsIntersect:iO,itemIntersectByLine:aO,lerp:q1,lerpArray:Py,move:Dy,pointLineDistance:sj,pointLineSquareDist:sO,pointRectSquareDist:uO,rotate:rj,scale:tj,scaleMatrix:QU,squareDist:Cv,translate:rO},Symbol.toStringTag,{value:"Module"}));var Zo="rgb(95, 149, 255)",lj="rgb(255, 255, 255)",r2="rgb(0, 0, 0)",v0="rgb(247, 250, 255)",lO="rgb(239, 244, 255)",Vd="rgb(253, 253, 253)",n2="rgb(250, 250, 250)",Hd="rgb(224, 224, 224)",i2="rgb(234, 234, 234)",fj="rgb(245, 245, 245)",cj="rgb(191, 213, 255)",a2="#4572d9",dj="rgb(223, 234, 255)",br={mainStroke:Zo,mainFill:lO,activeStroke:Zo,activeFill:v0,inactiveStroke:cj,inactiveFill:v0,selectedStroke:Zo,selectedFill:lj,highlightStroke:a2,highlightFill:dj,disableStroke:Hd,disableFill:n2,edgeMainStroke:Hd,edgeActiveStroke:Zo,edgeInactiveStroke:i2,edgeSelectedStroke:Zo,edgeHighlightStroke:Zo,edgeDisableStroke:fj,comboMainStroke:Hd,comboMainFill:Vd,comboActiveStroke:Zo,comboActiveFill:v0,comboInactiveStroke:Hd,comboInactiveFill:Vd,comboSelectedStroke:Zo,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:lO},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"},hj={" ":.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 Ra=Math.PI,Ry=Math.sin,By=Math.cos,zn=Ry(Ra/8),Gn=By(Ra/8),Tv=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}},fO=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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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]],T=(p+u)/p,A=(g+u)/g;s.clockwise===!1&&(T=(g+u)/g,A=(p+u)/p);var I=ai([0,0],S,T),k=[f[0]+I[0],f[1]+I[1]],P=[d[0]-f[0],d[1]-f[1]],N=ai([0,0],P,A),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},cO=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+=Ra*2),n&&(u.x+=By(f)*n,u.y+=Ry(f)*n),i){var c=f-Ra/2;f>1/2*Ra&&f<3*1/2*Ra&&(c-=Ra),u.x+=By(c)*i,u.y+=Ry(c)*i}var d={x:u.x,y:u.y,angle:f};return a?(f>.5*Ra&&f<1.5*Ra&&(f-=Ra),F({rotate:f},d)):d},vj=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},pj=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},ii=function(t,e){typeof e=="function"&&vj(t,null,-1,e)},Ba=function(t,e){typeof e=="function"&&pj(t,null,-1,e)},dO=function(t,e){return e*(hj[t]||1)},hO=function(t,e){var n=0,i=new RegExp("[一-龥]+");return t.split("").forEach(function(a){i.test(a)?n+=e:n+=dO(a,e)}),[n,e]},vO=function(t,e){return typeof e!="number"||e<=0||e>=t.length?t:t.substring(0,e)+"..."},Fy=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,ii(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},zy=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}ii(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||ii(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;ii(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},gj=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(Xn(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 yj=Object.freeze(Object.defineProperty({__proto__:null,cloneBesidesImg:Zh,getAnimateCfgWithCallback:vc,getBBox:Tv,getComboBBox:qh,getLabelPosition:cO,getLetterWidth:dO,getLoopCfgs:fO,getTextSize:hO,plainCombosToTrees:Fy,reconstructTree:zy,shouldRefreshEdge:gj,traverseTree:ii,traverseTreeUp:Ba,truncateLabelByLength:vO},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 ii(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},mj=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},bj=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=_1.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=`
|
|
268
|
+
)`,"background-position-y":"1.5px"}},null,-1),W4=Vr({__name:"ScreenshotCard",props:{url:{},snapshot:{},rootNode:{},focusNode:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}}},setup(r){const t=r,e=TB(),n=SB(Lr(()=>(e.width.value,e.height.value,Math.random())),300),i=Ln(),a=h=>{if(!t.rootNode)return;const v=i.value;if(!v)return;const p=v.getBoundingClientRect(),g=p.width/v.naturalWidth*v.naturalHeight,y=(p.height-g)/2,m=(h.clientX-p.left)/p.width*v.naturalWidth,b=(h.clientY-p.top-y)/g*v.naturalHeight,x=bB(t.snapshot.nodes,m,b);x&&t.onUpdateFocusNode(x)},o=h=>`${h*100}%`,s=Lr(()=>{var y;n.value;const h=i.value,v=(y=t.focusNode)==null?void 0:y.attr;if(!t.focusNode||!h||!v)return"";const p=h.getBoundingClientRect(),g=p.width/h.naturalWidth*h.naturalHeight;return{left:`calc(${o(v.left/h.naturalWidth)} - 2px)`,width:`calc(${o((v.right-v.left)/h.naturalWidth)} + 2px)`,top:`calc(${o((v.top/h.naturalHeight*g+(p.height-g)/2)/p.height)} - 2px)`,height:`calc(${o((v.bottom-v.top)/h.naturalHeight*g/p.height)} + 2px)`}}),u=Ln(!1),l=Ln({ox:0,oy:0}),f=Lr(()=>{var g;const h=(g=t.focusNode)==null?void 0:g.attr;if(!h)return;const{ox:v,oy:p}=l.value;return{left:v-h.left,right:h.right-v,top:p-h.top,bottom:h.bottom-p}}),c=h=>{const v=i.value;if(!v)return;const p=v.getBoundingClientRect(),g=p.width/v.naturalWidth*v.naturalHeight,y=(p.height-g)/2,m=(h.clientX-p.left)/p.width*v.naturalWidth,b=(h.clientY-p.top-y)/g*v.naturalHeight;l.value={ox:m,oy:b},d.value={left:-(m-.1*v.naturalWidth)/v.naturalWidth*1e3+"px",top:-(b-.1*v.naturalWidth)/v.naturalWidth*1e3+"px"}},d=Ln({left:"0",top:"0"});return(h,v)=>(Dr(),di("div",N4,[_r("img",{ref_key:"imgRef",ref:i,src:h.url,onClick:a,"cursor-crosshair":"","h-full":"","object-contain":"",class:"max-w-[calc(var(--gkd-width)*0.35)]",onMouseover:v[0]||(v[0]=p=>u.value=!0),onMouseleave:v[1]||(v[1]=p=>u.value=!1),onMousemove:c},null,40,P4),_r("div",{style:Ty(s.value),absolute:"","pointer-events-none":"","transition-all-300":"","b-1px":"","b-blue":"","b-solid":""},B4,4),yT(_r("div",F4,[_r("img",{src:h.url,"object-contain":"",absolute:"","left-0":"","top-0":"",style:Ty(d.value),"w-1000px":""},null,12,z4),_r("div",G4,Sn(`${l.value.ox.toFixed(0)},${l.value.oy.toFixed(0)}`),1),f.value?(Dr(),di("div",$4,[_r("div",null,Sn(f.value.top.toFixed(0)),1),_r("div",null,Sn(f.value.left.toFixed(0)+","+f.value.right.toFixed(0)),1),_r("div",null,Sn(f.value.bottom.toFixed(0)),1)])):da("",!0),U4,j4],512),[[mT,u.value]])]))}}),X4={"w-480px":"","bg-white":"","b-1px":"","b-solid":"","b-gray-200":"","rounded-4px":"","p-8px":"",class:"min-w-[calc(var(--gkd-width)*0.3)]"},Y4={flex:"","m-b-4px":""},V4=_r("svg",{viewBox:"0 0 32 32"},[_r("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),H4=_r("div",{"p-5px":""},null,-1),K4={key:0,underline:"","decoration-1":"","m-r-4px":"",title:"查询数量"},q4=["title"],Z4=_r("svg",{viewBox:"0 0 24 24"},[_r("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),Q4=_r("div",{"p-l-8px":""},null,-1),J4=_r("svg",{viewBox:"0 0 24 24"},[_r("g",{fill:"none"},[_r("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),eF=_r("svg",{viewBox:"0 0 24 24"},[_r("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),tF=Vr({__name:"SearchCard",props:{snapshot:{},rootNode:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}},onUpdateTrack:{type:Function,default:()=>()=>{}}},setup(r){const t=MT(),e=r,n=Ln(""),i=ET([]),a=Ln([]),o=RE(()=>{if(!e.rootNode){ca.error("根节点不存在");return}const f=n.value.trim();if(!f)return;if(u.value){const h=OB(()=>IB(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=RE(async f=>{var y,m,b;let c=LB[e.snapshot.id];c&&(c=CE(t,c));let d=CT[e.snapshot.id];d&&(d=CE(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]规则名称-${EB().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(CB.stringify(g,void 0,2))}),u=Ln(!0),l=window.innerWidth/100;return(f,c)=>(Dr(),bi(BT,{initialValue:{top:75,right:Math.max(315,12*l+135)},class:"z-1"},{default:It(({onRef:d})=>[_r("div",X4,[_r("div",Y4,[jt(ht(xB),{value:u.value,"onUpdate:value":c[0]||(c[0]=h=>u.value=h)},{default:It(()=>[jt(ht(DE),null,{default:It(()=>[jt(ht(NE),{value:!1},{default:It(()=>[dn(" 字符搜索 ")]),_:1}),jt(ht(NE),{value:!0},{default:It(()=>[dn(" 选择器查询 ")]),_:1})]),_:1})]),_:1},8,["value"]),_r("div",{"flex-1":"","cursor-move":"",ref:d},null,512)]),jt(ht(wB),null,{default:It(()=>[jt(ht(MB),{value:n.value,"onUpdate:value":c[1]||(c[1]=h=>n.value=h),placeholder:u.value?"请输入选择器":"请输入字符",onKeyup:uB(ht(o),["enter"]),inputProps:{class:"gkd_code"}},null,8,["value","placeholder","onKeyup"]),jt(ht(Xu),{onClick:ht(o)},{icon:It(()=>[jt(ht(pl),null,{default:It(()=>[V4]),_:1})]),_:1},8,["onClick"])]),_:1}),H4,jt(ht(YB),{expandedNames:a.value,"onUpdate:expandedNames":c[2]||(c[2]=h=>a.value=h)},{default:It(()=>[(Dr(!0),di(Hf,null,$h(ht(i),(h,v)=>(Dr(),bi(ht(KB),{key:h.key,name:h.key},{header:It(()=>[h.nodes.length>1?(Dr(),di("span",K4,Sn(h.nodes.length),1)):da("",!0),_r("span",{"break-all":"",title:typeof h.selector=="object"?"选择器":"搜索字符"},Sn(h.selector.toString()),9,q4)]),"header-extra":It(()=>[typeof h.selector=="object"&&h.selector.canCopy?(Dr(),bi(ht(Xu),{key:0,size:"small",onClick:OE(p=>ht(s)(h),["stop"]),title:"复制规则"},{icon:It(()=>[jt(ht(pl),null,{default:It(()=>[Z4]),_:1})]),_:2},1032,["onClick"])):da("",!0),Q4,jt(ht(Xu),{size:"small",onClick:OE(p=>ht(i).splice(v,1),["stop"]),title:"删除记录"},{icon:It(()=>[jt(ht(pl),null,{default:It(()=>[J4]),_:1})]),_:2},1032,["onClick"])]),default:It(()=>[jt(ht(DE),{style:{"max-height":"400px","overflow-y":"scroll","padding-bottom":"10px"}},{default:It(()=>[typeof h.selector=="string"||h.selector.tracks.length<=1?(Dr(!0),di(Hf,{key:0},$h(h.nodes.map(p=>Array.isArray(p)?p[0]:p),p=>(Dr(),bi(ht(Xu),{key:p.id,onClick:g=>f.onUpdateFocusNode(p),size:"small"},{default:It(()=>[dn(Sn(ht(Uh)(p)),1)]),_:2},1032,["onClick"]))),128)):(Dr(!0),di(Hf,{key:1},$h(h.nodes.map(p=>Array.isArray(p)?p:[p]),(p,g)=>(Dr(),bi(ht(GB),{key:g},{default:It(()=>[jt(ht(Xu),{size:"small",onClick:y=>f.onUpdateTrack({nodes:p,selector:h.selector})},{default:It(()=>[jt(ht(pl),null,{default:It(()=>[eF]),_:1})]),_:2},1032,["onClick"]),jt(ht(Xu),{onClick:y=>f.onUpdateFocusNode(p[h.selector.trackIndex]),size:"small"},{default:It(()=>[dn(Sn(ht(Uh)(p[h.selector.trackIndex])),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["expandedNames"])])]),_:1},8,["initialValue"]))}}),rF={flex:"","flex-col":""},nF=Vr({__name:"WindowCard",props:{snapshot:{},rootNode:{},focusNode:{},focusCount:{},onUpdateFocusNode:{type:Function,default:()=>()=>{}}},setup(r){const t=r,e=Ln([]);vl([()=>t.focusNode,()=>t.focusCount],async()=>{if(!t.focusNode)return;const s=t.focusNode.id;Pf().then(async()=>{var f,c;await Cy(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=Ln(),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)=>(Dr(),di("div",rF,[jt(ht(kT),{size:"small",striped:"",singleLine:!1,themeOverrides:{thPaddingSmall:"2px 4px",tdPaddingSmall:"2px 4px"}},{default:It(()=>[jt(ht(o4),null,{default:It(()=>[jt(ht(Iy),null,{default:It(()=>[jt(ht(qo),null,{default:It(()=>[dn(" 设备 ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" GKD ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 应用名称 ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 版本名称 ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 版本代码 ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 应用ID ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 界面ID ")]),_:1}),jt(ht(qo),null,{default:It(()=>[dn(" 操作 ")]),_:1})]),_:1})]),_:1}),jt(ht(DT),null,{default:It(()=>[jt(ht(Iy),null,{default:It(()=>[jt(ht(Pa),{class:"whitespace-nowrap w-0"},{default:It(()=>[dn(Sn(`${ht(f0)(s.snapshot).manufacturer} Android ${ht(f0)(s.snapshot).release||""}`),1)]),_:1}),jt(ht(Pa),{class:"whitespace-nowrap"},{default:It(()=>[dn(Sn(ht(f0)(s.snapshot).gkdVersionName||"1.6.4"),1)]),_:1}),jt(ht(Pa),{class:"whitespace-nowrap",onClick:u[0]||(u[0]=l=>ht(Js)(s.snapshot.appName))},{default:It(()=>[jt(ht(ol),null,{default:It(()=>[dn(Sn(s.snapshot.appName),1)]),_:1})]),_:1}),jt(ht(Pa),{class:"whitespace-nowrap",onClick:u[1]||(u[1]=l=>ht(Js)(s.snapshot.appVersionName))},{default:It(()=>[jt(ht(ol),null,{default:It(()=>[dn(Sn(s.snapshot.appVersionName),1)]),_:1})]),_:1}),jt(ht(Pa),{class:"whitespace-nowrap",onClick:u[2]||(u[2]=l=>ht(Js)(s.snapshot.appVersionCode.toString()))},{default:It(()=>[jt(ht(ol),null,{default:It(()=>[dn(Sn(s.snapshot.appVersionCode),1)]),_:1})]),_:1}),jt(ht(Pa),{class:"whitespace-nowrap max-w-[max(12vw,180px)]",onClick:u[3]||(u[3]=l=>ht(Js)(s.snapshot.appId))},{default:It(()=>[jt(ht(ol),null,{default:It(()=>[dn(Sn(s.snapshot.appId),1)]),_:1})]),_:1}),jt(ht(Pa),{onClick:u[4]||(u[4]=l=>ht(Js)(s.snapshot.activityId)),class:"break-words max-w-[max(15vw,200px)]"},{default:It(()=>[jt(ht(ol),null,{default:It(()=>[dn(Sn(s.snapshot.activityId),1)]),_:1})]),_:1}),jt(ht(Pa),null,{default:It(()=>[_T(s.$slots,"default")]),_:3})]),_:3})]),_:3})]),_:3}),jt(ht(E4),{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 Oy=function(r,t){return Oy=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])},Oy(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");Oy(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 kn(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 FT(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 zT(r,t){return function(e,n){t(e,n,r)}}function iF(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 aF(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 oF(r){return typeof r=="symbol"?r:"".concat(r)}function sF(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 GT(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 $T(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 b1(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 UT(){for(var r=[],t=0;t<arguments.length;t++)r=r.concat(b1(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 Tl(r){return this instanceof Tl?(this.v=r,this):new Tl(r)}function jT(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 Tl?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 WT(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:Tl(r[i](o)),done:!1}:a?a(o):o}:a}}function XT(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 YT(r,t){return Object.defineProperty?Object.defineProperty(r,"raw",{value:t}):r.raw=t,r}var uF=Object.create?function(r,t){Object.defineProperty(r,"default",{enumerable:!0,value:t})}:function(r,t){r.default=t};function VT(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 uF(t,r),t}function HT(r){return r&&r.__esModule?r:{default:r}}function KT(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 qT(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 ZT(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 QT(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 lF=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 JT(r){function t(n){r.error=r.hasError?new lF(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 fF={__extends:zt,__assign:F,__rest:kn,__decorate:FT,__param:zT,__metadata:GT,__awaiter:Ii,__generator:Oi,__createBinding:fp,__exportStar:$T,__values:yv,__read:b1,__spread:UT,__spreadArrays:cp,__spreadArray:Bi,__await:Tl,__asyncGenerator:jT,__asyncDelegator:WT,__asyncValues:XT,__makeTemplateObject:YT,__importStar:VT,__importDefault:HT,__classPrivateFieldGet:KT,__classPrivateFieldSet:qT,__classPrivateFieldIn:ZT,__addDisposableResource:QT,__disposeResources:JT},cF=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:QT,get __assign(){return F},__asyncDelegator:WT,__asyncGenerator:jT,__asyncValues:XT,__await:Tl,__awaiter:Ii,__classPrivateFieldGet:KT,__classPrivateFieldIn:ZT,__classPrivateFieldSet:qT,__createBinding:fp,__decorate:FT,__disposeResources:JT,__esDecorate:iF,__exportStar:$T,__extends:zt,__generator:Oi,__importDefault:HT,__importStar:VT,__makeTemplateObject:YT,__metadata:GT,__param:zT,__propKey:oF,__read:b1,__rest:kn,__runInitializers:aF,__setFunctionName:sF,__spread:UT,__spreadArray:Bi,__spreadArrays:cp,__values:yv,default:fF},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},dF=function(r,t){return t===void 0&&(t=[]),dp(r,function(e){return!mv(t,e)})},hF={}.toString,wa=function(r,t){return hF.call(r)==="[object "+t+"]"};const Yr=function(r){return wa(r,"Function")};var gt=function(r){return r==null};const wt=function(r){return Array.isArray?Array.isArray(r):wa(r,"Array")},Xn=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(Xn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var eA=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 tA(r,t){var e=eA(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},jn=function(r){if(!bv(r)||!wa(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 vF(r,t){if(!wt(r))return null;var e;if(Yr(t)&&(e=t),jn(t)&&(e=function(i){return tA(i,t)}),e){for(var n=0;n<r.length;n+=1)if(e(r[n]))return r[n]}return null}function pF(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 gF=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},yF=function(r){if(!wt(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},rA=function(r,t){if(t===void 0&&(t=[]),!wt(r))t.push(r);else for(var e=0;e<r.length;e+=1)rA(r[e],t);return t};const Ja=function(r){if(wt(r))return r.reduce(function(t,e){return Math.max(t,e)},r[0])},eo=function(r){if(wt(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])};var nA=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=Ja(t),a=eo(t);return{min:a,max:i}},iA=Array.prototype,mF=iA.splice,bF=iA.indexOf,xF=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=bF.call(r,i))>-1;)mF.call(r,a,1);return r},wF=Array.prototype.splice,aA=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,wF.call(t,o,1))}return t},oA=function(r,t,e){if(!wt(r)&&!jn(r))return r;var n=e;return xe(r,function(i,a){n=t(n,i,a)}),n},EF=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 aA(r,i),e};const Fe=function(r){return wa(r,"String")};function _F(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 SF=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return lc([].concat.apply([],r))};const MF=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 qa(r){if(Ei(r))return r[0]}function Ji(r){if(Ei(r)){var t=r;return t[t.length-1]}}function CF(r,t){return wt(r)||Fe(r)?r[0]===t:!1}function TF(r,t){return wt(r)||Fe(r)?r[r.length-1]===t:!1}var AF=function(r,t){for(var e=0;e<r.length;e++)if(!t(r[e],e))return!1;return!0},IF=function(r,t){for(var e=0;e<r.length;e++)if(t(r[e],e))return!0;return!1},OF=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),OF.call(e,i)?e[i].push(o):e[i]=[o]}return e}function sA(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 LF=function(r,t){if(!t)return[r];var e=sA(r,t),n=[];for(var i in e)n.push(e[i]);return n};function kF(r,t){return r["_wrap_"+t]}function eu(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 DF(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 NF(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 PF=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 wa(r,"Number")},RF=function(r){return mt(r)&&r%1!==0},BF=function(r){return mt(r)&&r%2===0},FF=Number.isInteger?Number.isInteger:function(r){return mt(r)&&r%1===0},zF=function(r){return mt(r)&&r<0},GF=1e-5;function uA(r,t,e){return e===void 0&&(e=GF),Math.abs(r-t)<e}var $F=function(r){return mt(r)&&r%2!==0},UF=function(r){return mt(r)&&r>0};const jF=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}},WF=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},XF=180/Math.PI,YF=function(r){return XF*r};const VF=parseInt;var HF=Math.PI/180,vp=function(r){return HF*r};const $E=function(r,t){return r.hasOwnProperty(t)};var x1=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 KF=function(r,t){return mv(x1(r),t)},Yl=function(r){return gt(r)?"":r.toString()};var qF=function(r){return Yl(r).toLowerCase()},ZF=function(r){var t=Yl(r);return t.charAt(0).toLowerCase()+t.substring(1)};function QF(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 JF=function(r){return Yl(r).toUpperCase()},Al=function(r){var t=Yl(r);return t.charAt(0).toUpperCase()+t.substring(1)},e6={}.toString,lA=function(r){return e6.call(r).replace(/^\[object /,"").replace(/]$/,"")},t6=function(r){return wa(r,"Arguments")},Bc=function(r){return wa(r,"Boolean")},w1=function(r){return wa(r,"Date")},r6=function(r){return wa(r,"Error")};function n6(r){return mt(r)&&isFinite(r)}var i6=function(r){return r===null},a6=Object.prototype,fA=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||a6;return r===e},o6=function(r){return wa(r,"RegExp")},s6=function(r){return r===void 0},u6=function(r){return r instanceof Element||r instanceof HTMLDocument};function cA(r){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return setTimeout(e,16)};return t(r)}function dA(r){var t=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;t(r)}function d0(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&&d0(r,t),e&&d0(r,e),n&&d0(r,n),r}var l6=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 hA=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 f6=5;function vA(r,t,e,n){e=e||0,n=n||f6;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];a!==null&&jn(a)?(jn(r[i])||(r[i]={}),e<n?vA(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)vA(r,t[n]);return r},c6=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},E1=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},d6=Object.prototype.hasOwnProperty;function pA(r){if(gt(r))return!0;if(Ei(r))return!r.length;var t=lA(r);if(t==="Map"||t==="Set")return!r.size;if(fA(r))return!Object.keys(r).length;for(var e in r)if(d6.call(r,e))return!1;return!0}var bs=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=bs(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=bs(r[i[n]],t[i[n]]),!!e);n++);return e}return!1};const h6=function(r,t,e){return Yr(e)?!!e(r,t):bs(r,t)};var fu=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},v6=function(r){return r};const p6=function(r,t){t===void 0&&(t=v6);var e={};return Xn(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},g6=function(r,t,e){var n=r,i=Fe(t)?t.split("."):t;return i.forEach(function(a,o){o<i.length-1?(Xn(n[a])||(n[a]=mt(i[o+1])?[]:{}),n=n[a]):n[a]=e}),r};var y6=Object.prototype.hasOwnProperty;const m6=function(r,t){if(r===null||!jn(r))return{};var e={};return xe(t,function(n){y6.call(r,n)&&(e[n]=r[n])}),e},b6=function(r,t){return oA(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},gA=function(r){return Ei(r)?Array.prototype.slice.call(r):[]};var Wd={};const to=function(r){return r=r||"g",Wd[r]?Wd[r]+=1:Wd[r]=1,r+Wd[r]},Bf=function(){},x6=function(r){return r};function pp(r){return gt(r)?0:Ei(r)?r.length:Object.keys(r).length}var Xd;const Ff=hA(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],x1(t)).join("")}),w6=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 E6=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 _6=Object.freeze(Object.defineProperty({__proto__:null,Cache:E6,assign:Mt,augment:l6,clamp:PF,clearAnimationFrame:dA,clone:ar,contains:mv,debounce:Fc,deepMix:Pr,difference:dF,each:xe,endsWith:TF,every:AF,extend:c6,filter:dp,find:vF,findIndex:pF,firstValue:gF,fixedBase:jh,flatten:yF,flattenDeep:rA,forIn:xe,get:Co,getEllipsisText:w6,getRange:nA,getType:lA,getWrapBehavior:kF,group:LF,groupBy:xv,groupToMap:sA,has:$E,hasKey:$E,hasValue:KF,head:qa,identity:x6,includes:mv,indexOf:E1,isArguments:t6,isArray:wt,isArrayLike:Ei,isBoolean:Bc,isDate:w1,isDecimal:RF,isElement:u6,isEmpty:pA,isEqual:bs,isEqualWith:h6,isError:r6,isEven:BF,isFinite:n6,isFunction:Yr,isInteger:FF,isMatch:tA,isNegative:zF,isNil:gt,isNull:i6,isNumber:mt,isNumberEqual:uA,isObject:Xn,isObjectLike:bv,isOdd:$F,isPlainObject:jn,isPositive:UF,isPrototype:fA,isRegExp:o6,isString:Fe,isType:wa,isUndefined:s6,keys:eA,last:Ji,lowerCase:qF,lowerFirst:ZF,map:fu,mapValues:p6,max:Ja,maxBy:jF,measureTextWidth:Ff,memoize:hA,min:eo,minBy:WF,mix:Mt,mod:hp,noop:Bf,number2color:DF,omit:b6,parseRadius:NF,pick:m6,pull:xF,pullAt:aA,reduce:oA,remove:EF,requestAnimationFrame:cA,set:g6,size:pp,some:IF,sortBy:_F,startsWith:CF,substitute:QF,throttle:fc,toArray:gA,toDegree:YF,toInteger:VF,toRadian:vp,toString:Yl,union:SF,uniq:lc,uniqueId:to,upperCase:JF,upperFirst:Al,values:x1,valuesOfKey:MF,wrapBehavior:eu},Symbol.toStringTag,{value:"Module"})),S6={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 _1=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(S6);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]=eu(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}(),M6="*",yA=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[M6]||[],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}(),Ot=1e-6,vr=typeof Float32Array<"u"?Float32Array:Array,pa=Math.random;function C6(r){vr=r}var T6=Math.PI/180;function A6(r){return r*T6}function I6(r,t){return Math.abs(r-t)<=Ot*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 O6=Object.freeze(Object.defineProperty({__proto__:null,get ARRAY_TYPE(){return vr},EPSILON:Ot,RANDOM:pa,equals:I6,setMatrixArrayType:C6,toRadian:A6},Symbol.toStringTag,{value:"Module"}));function L6(){var r=new vr(4);return vr!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}function k6(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 D6(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function N6(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}function P6(r,t,e,n){var i=new vr(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function R6(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function B6(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 F6(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 z6(r,t){var e=t[0];return r[0]=t[3],r[1]=-t[1],r[2]=-t[2],r[3]=e,r}function G6(r){return r[0]*r[3]-r[2]*r[1]}function mA(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 $6(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 U6(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 j6(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 W6(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=t[1],r}function X6(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function Y6(r){return Math.hypot(r[0],r[1],r[2],r[3])}function V6(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 H6(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 bA(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 K6(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function q6(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=Ot*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=Ot*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-l)<=Ot*Math.max(1,Math.abs(a),Math.abs(l))}function Z6(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 Q6(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 J6=mA,ez=bA;const tz=Object.freeze(Object.defineProperty({__proto__:null,LDU:V6,add:H6,adjoint:z6,clone:k6,copy:D6,create:L6,determinant:G6,equals:q6,exactEquals:K6,frob:Y6,fromRotation:j6,fromScaling:W6,fromValues:P6,identity:N6,invert:F6,mul:J6,multiply:mA,multiplyScalar:Z6,multiplyScalarAndAdd:Q6,rotate:$6,scale:U6,set:R6,str:X6,sub:ez,subtract:bA,transpose:B6},Symbol.toStringTag,{value:"Module"}));function rz(){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 nz(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 iz(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 az(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function oz(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 sz(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 uz(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 lz(r){return r[0]*r[3]-r[1]*r[2]}function xA(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 fz(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 cz(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 dz(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 hz(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 vz(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 pz(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 gz(r){return"mat2d("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+")"}function yz(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],1)}function mz(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 wA(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 bz(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 xz(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 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]}function Ez(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(u))&&Math.abs(n-l)<=Ot*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(i-f)<=Ot*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-c)<=Ot*Math.max(1,Math.abs(a),Math.abs(c))&&Math.abs(o-d)<=Ot*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(s-h)<=Ot*Math.max(1,Math.abs(s),Math.abs(h))}var _z=xA,Sz=wA;const Mz=Object.freeze(Object.defineProperty({__proto__:null,add:mz,clone:nz,copy:iz,create:rz,determinant:lz,equals:Ez,exactEquals:wz,frob:yz,fromRotation:hz,fromScaling:vz,fromTranslation:pz,fromValues:oz,identity:az,invert:uz,mul:_z,multiply:xA,multiplyScalar:bz,multiplyScalarAndAdd:xz,rotate:fz,scale:cz,set:sz,str:gz,sub:Sz,subtract:wA,translate:dz},Symbol.toStringTag,{value:"Module"}));function EA(){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 Cz(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 Tz(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 Az(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 Iz(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 Oz(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 Lz(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 kz(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 S1(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 Dz(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 Nz(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 io(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 Pz(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 Rz(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 Bz(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 M1(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 C1(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 T1(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 Fz(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 zz(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 Gz(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,T=c*g-d*p,A=c*y-h*p,I=d*y-h*g,k=m*I-b*A+x*T+w*S-E*C+_*M;return k?(k=1/k,r[0]=(s*I-u*A+l*T)*k,r[1]=(u*S-o*I-l*C)*k,r[2]=(o*A-s*S+l*M)*k,r[3]=(i*A-n*I-a*T)*k,r[4]=(e*I-i*S+a*C)*k,r[5]=(n*S-e*A-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 $z(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 Uz(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function jz(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}function Wz(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 _A(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 Xz(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 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[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r}function Vz(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 Hz(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(n-d)<=Ot*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-h)<=Ot*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(a-v)<=Ot*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(o-p)<=Ot*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-g)<=Ot*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(u-y)<=Ot*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(l-m)<=Ot*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(f-b)<=Ot*Math.max(1,Math.abs(f),Math.abs(b))}var Kz=io,qz=_A;const SA=Object.freeze(Object.defineProperty({__proto__:null,add:Wz,adjoint:Dz,clone:Tz,copy:Az,create:EA,determinant:Nz,equals:Hz,exactEquals:Vz,frob:jz,fromMat2d:Fz,fromMat4:Cz,fromQuat:zz,fromRotation:C1,fromScaling:T1,fromTranslation:M1,fromValues:Iz,identity:Lz,invert:S1,mul:Kz,multiply:io,multiplyScalar:Xz,multiplyScalarAndAdd:Yz,normalFromMat4:Gz,projection:$z,rotate:Rz,scale:Bz,set:Oz,str:Uz,sub:qz,subtract:_A,translate:Pz,transpose:kz},Symbol.toStringTag,{value:"Module"}));function Zz(){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 Qz(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 Jz(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 eG(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 tG(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 MA(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 rG(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 nG(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,T=c*g-d*p,A=c*y-h*p,I=d*y-h*g,k=m*I-b*A+x*T+w*S-E*C+_*M;return k?(k=1/k,r[0]=(s*I-u*A+l*T)*k,r[1]=(i*A-n*I-a*T)*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*A-s*S+l*M)*k,r[9]=(n*S-e*A-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*T-u*M)*k,r[13]=(e*T-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 iG(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 aG(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,T=f*g-d*v,A=c*g-d*p;return y*A-m*T+b*S+x*C-w*M+E*_}function CA(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 oG(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 sG(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 uG(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,T,A,I,k,P;return s<Ot?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,T=a*a*f+l,A=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*T+b*A,r[5]=d*S+g*T+x*A,r[6]=h*S+y*T+w*A,r[7]=v*S+m*T+E*A,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 lG(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 fG(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 cG(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 dG(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 hG(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 vG(r,t,e){var n=e[0],i=e[1],a=e[2],o=Math.hypot(n,i,a),s,u,l;return o<Ot?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 pG(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 gG(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 yG(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 TA(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 mG(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),TA(r,t,e),r}function AA(r,t){return r[0]=t[12],r[1]=t[13],r[2]=t[14],r}function IA(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 OA(r,t){var e=new vr(3);IA(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 bG(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 xG(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],T=(1-(p+y))*w,A=(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]=T,r[1]=A,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-(T*M+k*C+z*S),r[13]=e[1]+C-(A*M+P*C+W*S),r[14]=e[2]+S-(I*M+N*C+D*S),r[15]=1,r}function wG(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 EG(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 LA(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 _G=LA;function SG(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 MG(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 kA(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 CG=kA;function TG(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 AG(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)<Ot&&Math.abs(p-w)<Ot&&Math.abs(g-E)<Ot?MA(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 IG(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 OG(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 LG(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 kG(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 DA(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 DG(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 NG(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 PG(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 RG(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],T=t[9],A=t[10],I=t[11],k=t[12],P=t[13],N=t[14],z=t[15];return Math.abs(e-m)<=Ot*Math.max(1,Math.abs(e),Math.abs(m))&&Math.abs(n-b)<=Ot*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=Ot*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=Ot*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-E)<=Ot*Math.max(1,Math.abs(o),Math.abs(E))&&Math.abs(s-_)<=Ot*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(u-M)<=Ot*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(l-C)<=Ot*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(f-S)<=Ot*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(c-T)<=Ot*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(d-A)<=Ot*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(h-I)<=Ot*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(v-k)<=Ot*Math.max(1,Math.abs(v),Math.abs(k))&&Math.abs(p-P)<=Ot*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-N)<=Ot*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(y-z)<=Ot*Math.max(1,Math.abs(y),Math.abs(z))}var BG=CA,FG=DA;const zG=Object.freeze(Object.defineProperty({__proto__:null,add:kG,adjoint:iG,clone:Qz,copy:Jz,create:Zz,determinant:aG,equals:RG,exactEquals:PG,frob:LG,fromQuat:wG,fromQuat2:mG,fromRotation:vG,fromRotationTranslation:TA,fromRotationTranslationScale:bG,fromRotationTranslationScaleOrigin:xG,fromScaling:hG,fromTranslation:dG,fromValues:eG,fromXRotation:pG,fromYRotation:gG,fromZRotation:yG,frustum:EG,getRotation:OA,getScaling:IA,getTranslation:AA,identity:MA,invert:nG,lookAt:AG,mul:BG,multiply:CA,multiplyScalar:DG,multiplyScalarAndAdd:NG,ortho:CG,orthoNO:kA,orthoZO:TG,perspective:_G,perspectiveFromFieldOfView:MG,perspectiveNO:LA,perspectiveZO:SG,rotate:uG,rotateX:lG,rotateY:fG,rotateZ:cG,scale:sG,set:tG,str:OG,sub:FG,subtract:DA,targetTo:IG,translate:oG,transpose:rG},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 GG(r){var t=new vr(3);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function NA(r){var t=r[0],e=r[1],n=r[2];return Math.hypot(t,e,n)}function Ly(r,t,e){var n=new vr(3);return n[0]=r,n[1]=t,n[2]=e,n}function $G(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function UG(r,t,e,n){return r[0]=t,r[1]=e,r[2]=n,r}function jG(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r}function PA(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r}function RA(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r}function BA(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r}function WG(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r}function XG(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r}function YG(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 VG(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 HG(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r[2]=Math.round(t[2]),r}function KG(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r}function qG(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 FA(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 zA(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 GA(r){var t=r[0],e=r[1],n=r[2];return t*t+e*e+n*n}function ZG(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r}function QG(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r}function $A(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 I1(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 JG(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 e8(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 t8(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 r8(r,t){t=t||1;var e=pa()*2*Math.PI,n=pa()*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 n8(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 i8(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 a8(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 o8(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 s8(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 u8(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&&I1(r,t)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function l8(r){return r[0]=0,r[1]=0,r[2]=0,r}function f8(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function c8(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}function d8(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(n-o)<=Ot*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=Ot*Math.max(1,Math.abs(i),Math.abs(s))}var h8=PA,v8=RA,p8=BA,g8=FA,y8=zA,UA=NA,m8=GA,b8=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 x8=Object.freeze(Object.defineProperty({__proto__:null,add:jG,angle:u8,bezier:t8,ceil:WG,clone:GG,copy:$G,create:A1,cross:Wh,dist:g8,distance:FA,div:p8,divide:BA,dot:I1,equals:d8,exactEquals:c8,floor:XG,forEach:b8,fromValues:Ly,hermite:e8,inverse:QG,len:UA,length:NA,lerp:JG,max:VG,min:YG,mul:v8,multiply:RA,negate:ZG,normalize:$A,random:r8,rotateX:a8,rotateY:o8,rotateZ:s8,round:HG,scale:KG,scaleAndAdd:qG,set:UG,sqrDist:y8,sqrLen:m8,squaredDistance:zA,squaredLength:GA,str:f8,sub:h8,subtract:PA,transformMat3:gp,transformMat4:n8,transformQuat:i8,zero:l8},Symbol.toStringTag,{value:"Module"}));function jA(){var r=new vr(4);return vr!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function WA(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 XA(r,t,e,n){var i=new vr(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function YA(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function VA(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function HA(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 KA(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 qA(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 ZA(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 w8(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 E8(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 _8(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 S8(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 M8(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 QA(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 C8(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 JA(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 eI(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 O1(r){var t=r[0],e=r[1],n=r[2],i=r[3];return Math.hypot(t,e,n,i)}function L1(r){var t=r[0],e=r[1],n=r[2],i=r[3];return t*t+e*e+n*n+i*i}function T8(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=-t[3],r}function A8(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 tI(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 rI(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]}function I8(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 nI(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 O8(r,t){t=t||1;var e,n,i,a,o,s;do e=pa()*2-1,n=pa()*2-1,o=e*e+n*n;while(o>=1);do i=pa()*2-1,a=pa()*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 L8(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 k8(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 D8(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function N8(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function iI(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function aI(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(o))&&Math.abs(n-s)<=Ot*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=Ot*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(a-l)<=Ot*Math.max(1,Math.abs(a),Math.abs(l))}var P8=KA,R8=qA,B8=ZA,F8=JA,z8=eI,G8=O1,$8=L1,U8=function(){var r=jA();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 j8=Object.freeze(Object.defineProperty({__proto__:null,add:HA,ceil:w8,clone:WA,copy:YA,create:jA,cross:I8,dist:F8,distance:JA,div:B8,divide:ZA,dot:rI,equals:aI,exactEquals:iI,floor:E8,forEach:U8,fromValues:XA,inverse:A8,len:G8,length:O1,lerp:nI,max:S8,min:_8,mul:R8,multiply:qA,negate:T8,normalize:tI,random:O8,round:M8,scale:QA,scaleAndAdd:C8,set:VA,sqrDist:z8,sqrLen:$8,squaredDistance:eI,squaredLength:L1,str:N8,sub:P8,subtract:KA,transformMat4:L8,transformQuat:k8,zero:D8},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 W8(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function oI(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 X8(r,t){var e=Math.acos(t[3])*2,n=Math.sin(e/2);return n>Ot?(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 Y8(r,t){var e=D1(r,t);return Math.acos(2*e*e-1)}function sI(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 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+o*s,r[1]=i*u+a*s,r[2]=a*u-i*s,r[3]=o*u-n*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-a*s,r[1]=i*u+o*s,r[2]=a*u+n*s,r[3]=o*u-i*s,r}function fI(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 V8(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 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=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 dI(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 H8(r,t,e){return dI(r,t),vI(r,r,e),cI(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>Ot?(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 K8(r){var t=pa(),e=pa(),n=pa(),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 q8(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 Z8(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r}function hI(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 Q8(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 J8(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var e$=WA,t$=XA,k1=YA,r$=VA,n$=HA,i$=sI,vI=QA,D1=rI,a$=nI,N1=O1,o$=N1,P1=L1,s$=P1,R1=tI,u$=iI,l$=aI,f$=function(){var r=A1(),t=Ly(1,0,0),e=Ly(0,1,0);return function(n,i,a){var o=I1(i,a);return o<-.999999?(Wh(r,t,i),UA(r)<1e-6&&Wh(r,e,i),$A(r,r),oI(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,R1(n,n))}}(),c$=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}}(),d$=function(){var r=EA();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],R1(t,hI(t,r))}}();const h$=Object.freeze(Object.defineProperty({__proto__:null,add:n$,calculateW:V8,clone:e$,conjugate:Z8,copy:k1,create:wv,dot:D1,equals:l$,exactEquals:u$,exp:cI,fromEuler:Q8,fromMat3:hI,fromValues:t$,getAngle:Y8,getAxisAngle:X8,identity:W8,invert:q8,len:o$,length:N1,lerp:a$,ln:dI,mul:i$,multiply:sI,normalize:R1,pow:H8,random:K8,rotateX:uI,rotateY:lI,rotateZ:fI,rotationTo:f$,scale:vI,set:r$,setAxes:d$,setAxisAngle:oI,slerp:Xh,sqlerp:c$,sqrLen:s$,squaredLength:P1,str:J8},Symbol.toStringTag,{value:"Module"}));function v$(){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 p$(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 g$(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 y$(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 pI(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 m$(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 b$(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 x$(r,t){var e=wv();OA(e,t);var n=new vr(3);return AA(n,t),pI(r,e,n),r}function gI(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 w$(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 E$(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 _$=k1;function S$(r,t){return r[0]=t[4],r[1]=t[5],r[2]=t[6],r[3]=t[7],r}var M$=k1;function C$(r,t){return r[4]=t[0],r[5]=t[1],r[6]=t[2],r[7]=t[3],r}function T$(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 A$(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 I$(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 O$(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 L$(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 fI(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 k$(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 D$(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 N$(r,t,e,n){if(Math.abs(n)<Ot)return gI(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 P$(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 yI(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 R$=yI;function B$(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 mI=D1;function F$(r,t,e,n){var i=1-n;return mI(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 z$(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 G$(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 bI=N1,$$=bI,yp=P1,U$=yp;function j$(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 W$(r){return"quat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+")"}function X$(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 Y$(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)<=Ot*Math.max(1,Math.abs(e),Math.abs(f))&&Math.abs(n-c)<=Ot*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-d)<=Ot*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(a-h)<=Ot*Math.max(1,Math.abs(a),Math.abs(h))&&Math.abs(o-v)<=Ot*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(s-p)<=Ot*Math.max(1,Math.abs(s),Math.abs(p))&&Math.abs(u-g)<=Ot*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(l-y)<=Ot*Math.max(1,Math.abs(l),Math.abs(y))}const V$=Object.freeze(Object.defineProperty({__proto__:null,add:P$,clone:p$,conjugate:G$,copy:gI,create:v$,dot:mI,equals:Y$,exactEquals:X$,fromMat4:x$,fromRotation:b$,fromRotationTranslation:pI,fromRotationTranslationValues:y$,fromTranslation:m$,fromValues:g$,getDual:S$,getReal:_$,getTranslation:T$,identity:w$,invert:z$,len:$$,length:bI,lerp:F$,mul:R$,multiply:yI,normalize:j$,rotateAroundAxis:N$,rotateByQuatAppend:k$,rotateByQuatPrepend:D$,rotateX:I$,rotateY:O$,rotateZ:L$,scale:B$,set:E$,setDual:C$,setReal:M$,sqrLen:U$,squaredLength:yp,str:W$,translate:A$},Symbol.toStringTag,{value:"Module"}));function xI(){var r=new vr(2);return vr!=Float32Array&&(r[0]=0,r[1]=0),r}function H$(r){var t=new vr(2);return t[0]=r[0],t[1]=r[1],t}function K$(r,t){var e=new vr(2);return e[0]=r,e[1]=t,e}function q$(r,t){return r[0]=t[0],r[1]=t[1],r}function Z$(r,t,e){return r[0]=t,r[1]=e,r}function Un(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 _I(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r}function Q$(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r}function J$(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r}function is(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r}function as(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r}function eU(r,t){return r[0]=Math.round(t[0]),r[1]=Math.round(t[1]),r}function ai(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r}function tU(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 SI(r,t){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function MI(r){var t=r[0],e=r[1];return Math.hypot(t,e)}function CI(r){var t=r[0],e=r[1];return t*t+e*e}function rU(r,t){return r[0]=-t[0],r[1]=-t[1],r}function nU(r,t){return r[0]=1/t[0],r[1]=1/t[1],r}function ys(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 B1(r,t){return r[0]*t[0]+r[1]*t[1]}function iU(r,t,e){var n=t[0]*e[1]-t[1]*e[0];return r[0]=r[1]=0,r[2]=n,r}function aU(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 oU(r,t){t=t||1;var e=pa()*2*Math.PI;return r[0]=Math.cos(e)*t,r[1]=Math.sin(e)*t,r}function sU(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 uU(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 lU(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 fU(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 cU(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 TI(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 dU(r){return r[0]=0,r[1]=0,r}function hU(r){return"vec2("+r[0]+", "+r[1]+")"}function F1(r,t){return r[0]===t[0]&&r[1]===t[1]}function vU(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.abs(e-i)<=Ot*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(n-a)<=Ot*Math.max(1,Math.abs(n),Math.abs(a))}var pU=MI,Yh=wI,gU=EI,yU=_I,mU=Ev,bU=SI,xU=CI,wU=function(){var r=xI();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 EU=Object.freeze(Object.defineProperty({__proto__:null,add:Un,angle:TI,ceil:Q$,clone:H$,copy:q$,create:xI,cross:iU,dist:mU,distance:Ev,div:yU,divide:_I,dot:B1,equals:vU,exactEquals:F1,floor:J$,forEach:wU,fromValues:K$,inverse:nU,len:pU,length:MI,lerp:aU,max:as,min:is,mul:gU,multiply:EI,negate:rU,normalize:ys,random:oU,rotate:cU,round:eU,scale:ai,scaleAndAdd:tU,set:Z$,sqrDist:bU,sqrLen:xU,squaredDistance:SI,squaredLength:CI,str:hU,sub:Yh,subtract:wI,transformMat2:sU,transformMat2d:uU,transformMat3:lU,transformMat4:fU,zero:dU},Symbol.toStringTag,{value:"Module"})),_U=Object.freeze(Object.defineProperty({__proto__:null,glMatrix:O6,mat2:tz,mat2d:Mz,mat3:SA,mat4:zG,quat:h$,quat2:V$,vec2:EU,vec3:x8,vec4:j8},Symbol.toStringTag,{value:"Module"}));function SU(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return M1(n,e),io(r,n,t)}function MU(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return C1(n,e),io(r,n,t)}function CU(r,t,e){var n=[0,0,0,0,0,0,0,0,0];return T1(n,e),io(r,n,t)}function TU(r,t,e){return io(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":SU(e,e,[a[1],a[2]]);break;case"s":CU(e,e,[a[1],a[2]]);break;case"r":MU(e,e,a[1]);break;case"m":TU(e,e,a[1]);break}}return e}var cu=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},AU=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=AU),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}(),IU=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)},OU=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})},II=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 LU(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 OI=function(t,e,n,i){i===void 0&&(i=!0);var a=LU(n),o=new IU,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()},kU=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},LI=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(T){return T.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 z1(r,t){return t?LI(r):kU(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},kI=function(t,e){var n=Po(t);return n[e]?Po(t)[e].inDegree:0},DI=function(t,e){var n=Po(t);return n[e]?Po(t)[e].outDegree:0};function DU(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 NI(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})&&NI(r,s,t,n,i)}),n.leave({current:t,previous:e})}function G1(r,t,e,n){n===void 0&&(n=!0),NI(r,t,"",DU(e),n)}var $1=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];G1(t,f,l)}return e},U1=function(t,e,n){var i,a;n===void 0&&(n=!0);for(var o=[],s=z1(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,T=[C,g],A=v[y];p[M].size&&!p[M].has(A)&&(T.push(A),A!==v[A.id]);)A=v[A.id];if(T.push(A),e&&n?(S=!1,T.findIndex(function(P){return e.indexOf(P.id)>-1})>-1&&(S=!0)):e&&!n&&T.findIndex(function(P){return e.indexOf(P.id)>-1})>-1&&(S=!1),S){for(var I={},k=1;k<T.length;k+=1)I[T[k-1].id]=T[k];T.length&&(I[T[T.length-1].id]=T[0]),o.push(I)}p[M].add(g)}},x=0;x<m.length;x+=1)b(x)}return o},j1=function(t,e,n){n===void 0&&(n=!0);for(var i=[],a=new Set,o=[],s=[],u={},l={},f=function(A){for(var I=[A];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 T(A,I,k){var P=!1;if(e&&n===!1&&e.indexOf(A.id)>-1)return P;i.push(A),a.add(A);for(var N=k[A.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)||T(W,I,k)&&(P=!0)}if(P)f(A);else for(var z=0;z<N.length;z+=1){var W=u[N[z]];o[W.id].has(A)||o[W.id].add(A)}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(A){var I=e[A];l[h[A].id]=l[I],l[I]=0,u[0]=h.find(function(k){return k.id===I}),u[l[h[A].id]]=h[A]},v=0;v<e.length;v++)y(v);for(var m=function(A){for(var I,k,P=1/0,N=0;N<A.length;N+=1)for(var z=A[N],W=0;W<z.length;W++){var D=l[z[W].id];D<P&&(P=D,k=N)}for(var R=A[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(Te){return R.map(function(Ke){return Ke.id}).indexOf(Te)>-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(T){return l[T.id]>=b}),w=LI({nodes:x,edges:t.edges}).filter(function(T){return T.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(T){o[T.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},PI=function(t,e,n,i){return i===void 0&&(i=!0),e?j1(t,n,i):U1(t,n,i)},NU=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=NU(f,o,l),w=x.id;if(l[w]=!0,f[w]===1/0)return"continue";var E=[];n?E=OU(w,u):E=Vh(w,u),E.forEach(function(_){var M=_.target,C=_.source,S=M===w?C:M,T=i&&_[i]?_[i]:1;f[S]>f[x.id]+T?(f[S]=f[x.id]+T,c[S]=[x.id]):f[S]===f[x.id]+T&&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&&RI(e,g,c,p);var y={};for(var g in p)y[g]=p[g][0];return{length:f,path:y,allPath:p}};function RI(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=RI(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 BI=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]}},FI=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=cu(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},zI=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=II();b.clusterId=w,l[w]={id:w,nodes:[b]},f[b.id]={node:b,idx:x}});var c=cu(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],T=S.nodes.indexOf(w);S.nodes.splice(T,1);var A=Math.floor(Math.random()*M.length),I=l[M[A]];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}(),W1=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},va;(function(r){r.EuclideanDistance="euclideanDistance"})(va||(va={}));var PU=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},X1=function(t,e,n){var i=PU(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=va.EuclideanDistance);var a=0;switch(n){case va.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},h0=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))},Y1=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=W1(c,o);v=X1(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=cu(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,T=[],A={};;){a&&c.every(function(D){return D.hasOwnProperty("properties")})?M=WE(c,x,w,_)+h0(c,v)*l:M=WE(c,x,w,_),S===0&&(C=M,T=c,A=m);var I=M>0&&M>C&&M-C<i;if(M>C&&(T=c.map(function(D){return{node:D,clusterId:D.clusterId}}),A=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(Wt){var Mr=b[Wt.id].idx;fe+=x[R][Mr]||0});var Te=fe-H.sumTot*X,Ke=we.filter(function(Wt){return Wt.id!==D.id});Ke.forEach(function(Wt,Mr){v[Wt.originIndex]});var ot=h0(Ke,v)*l,nt=E[D.id];if(Object.keys(nt).forEach(function(Wt){var Mr=b[Wt].node,rr=Mr.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=h0(ie,v)*l,Se=et-Te;a&&(Se=et+L-(Te+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(Wt){var Mr=Wt.source,rr=Wt.target,Rt=b[Mr].node.clusterId,sr=b[rr].node.clusterId;(Rt===Y.id&&sr!==Y.id||sr===Y.id&&Rt!==Y.id)&&(fr=fr+(Wt[n]||1)),(Rt===Ct&&sr!==Ct||sr===Ct&&Rt!==Ct)&&(Gt=Gt+(Wt[n]||1))}),Y.sumTot=fr,H.sumTot=Gt}})}var k={},P=0;Object.keys(A).forEach(function(D){var R=A[D];if(!R.nodes||!R.nodes.length){delete A[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}}),A[H]=R,k[D]=H,delete A[D],P++)}),T.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(A).forEach(function(D){W.push(A[D])}),{clusters:W,clusterEdges:N}},GI=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),Y1(t,e,n,i,!0,a,o,s,u)},$I=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 va.EuclideanDistance:i=e[n];break;default:i=[];break}return i},UI=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=va.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===va.EuclideanDistance&&!u.every(function(H){return H.hasOwnProperty(n)}))return c;var d=[],h=[];if(o===va.EuclideanDistance&&(d=W1(u,n),h=X1(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 va.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 va.EuclideanDistance:we=jE(h[u[Y].originIndex],y[fe],o);break}X+=we}var Te=X/y.length;Te>w&&!y.find(function(Ke){return bs(Ke,XE(o,h,u[Y].originIndex))})&&(w=Te,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,T=1/0;if(!(C===0&&m.includes(g))){for(var A=0;A<y.length;A++){var I=0;switch(o){case va.EuclideanDistance:I=jE(h[g],y[A],o);break}I<T&&(T=I,S=A)}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([]),A=0;A<N.length;A++)z=z.add(new Qi(h[N[A].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,Te=(Y=u.find(function(nt){return nt.id===fe}))===null||Y===void 0?void 0:Y.clusterId,Ke="".concat(we,"---").concat(Te);if(R[Ke])R[Ke].count++;else{var ot={source:we,target:Te,count:1};R[Ke]=ot,D.push(ot)}}),{clusters:b,clusterEdges:D}},V1=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},jI=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=W1(t,n),l=X1(u,i,a),f=l[s],c=[];return o.forEach(function(d,h){if(d.id!==e.id){var v=l[h],p=V1(v,f);c.push(p),d.cosineSimilarity=p}}),o.sort(function(d,h){return h.cosineSimilarity-d.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},RU=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}(),BU=function(t,e){return t-e},FU=function(){function r(t){t===void 0&&(t=BU),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}(),zU=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 FU(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 RU(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},WI=function(t,e,n){var i={prim:zU,kruskal:YE};return n?i[n](t,e):YE(t,e)},XI=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},GU=-1,_v=-1,YI="-1",ja="-1",VI=-1,VE=function(){function r(t,e,n,i){t===void 0&&(t=GU),e===void 0&&(e=_v),n===void 0&&(n=_v),i===void 0&&(i=YI),this.id=t,this.from=e,this.to=n,this.label=i}return r}(),$U=function(){function r(t,e){t===void 0&&(t=_v),e===void 0&&(e=ja),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}(),HI=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 $U(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||ja,edgeLabel:i||YI,nodeLabel2:a||ja}}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=VI),e===void 0&&(e=!1);var n=new HI(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!==ja&&n.addNode(a,u),f!==ja&&n.addNode(o,f),u!==ja&&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}(),UU=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(VI,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,ja,_.edgeLabel,ja));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 T=h.length,A=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<T;w++){var I=A(w);if(I==="break")break}if(!y)return!0;var k=t.findMinLabel(C);o.dfsEdgeList.push(new Hs(S,p+1,ja,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,ja,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}(),jU=function(t,e,n,i){var a={};return Object.keys(t).forEach(function(o,s){var u=t[o],l=new HI(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},WU=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",XU=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=jU(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 UU(p);g.run();var y=WU(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(KI(o,s,u,n,i))}),a},KI=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}},YU=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)},VU=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(II)]={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},HU=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}},qI=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=YU(i,l,M,E,f),S=Hh(C,E,t),T=10,A=1,I=1,k=4,P={graphs:S,nodeLabelProp:o,edgeLabelProp:s,minSupport:A,minNodeNum:I,maxNodeNum:k,directed:n},N=XU(P).slice(0,T),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=VU(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={},Te={},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})),Te=Hh(Se,_,e,Te);var Pe=[];if(Object.keys(Se).forEach(function(qe){if(Ke[qe]){Pe.push(Ke[qe]);return}var tt=Te[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 Cr={};Ut.neighbors.forEach(function(ir){var Br=d["".concat(yt.id,"-").concat(ir.id)];Cr["".concat(yt.id,"-").concat(ir.id)]={start:p[yt.id].idx,end:p[ir.id].idx,distance:Br}}),S=Hh(Cr,E,t,S);var Er=[];Object.keys(Cr).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 pn=!1,Zt=0;Zt<Pt;Zt++)if(Er[Zt]<Pe[Zt]){pn=!0;break}if(pn)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=KI(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 Cr=H[tt]?H[tt]:HU(t,et,Xe,p,yt,E,R,o,s,H,S),Er="".concat(ee.id,"-").concat(qe),pn=ot[Er][ot[Er].length-1];if(Cr<pn){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 Wt=Et.length,Mr=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],Ar=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]===Ar&&(zr=!0),!n&&Zn[o]===Ar&&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 Cr=cc(L,L.nodes[0].id,!1).length;if(Object.keys(Cr).reverse().forEach(function(_t){if(!(_t===L.nodes[0].id||Pt)){if(Cr[_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||Cr[_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,pn=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,si=Br-1;si>=0;si--){var Kr=L.nodes[si],$i=me[Kr.id].degree,fo=me[Kr.id].inDegree,co=me[Kr.id].outDegree,on=Kr[o],pi=e2(we,on,m,b),ia=pi.minPatternNodeLabelDegree,ho=pi.minPatternNodeLabelInDegree,vo=pi.minPatternNodeLabelOutDegree,po=n?$i<ia||fo<ho||co<vo:$i<ia;if(po){if(Pe[Kr[o]]--,Pe[Kr[o]]<b[Kr[o]].length){Pt=!0;break}L.nodes.splice(si,1),me[Kr.id]=void 0,Er=!0}}if(Pt||!Er&&pn!==0)break;gr=je.length;for(var ui=gr-1;ui>=0;ui--){var jr=je[ui];if(!me[jr.source]||!me[jr.target]){je.splice(ui,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}}pn++}if(Pt||Pt||L.nodes.length<e.nodes.length||je.length<e.edges.length)return Et.splice(ie,1),"continue"},rr=Wt-1;rr>=0;rr--){var Rt=Mr(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}(),ZI=$1;const KU={getAdjMatrix:cu,breadthFirstSearch:OI,connectedComponent:z1,getDegree:Po,getInDegree:kI,getOutDegree:DI,detectCycle:$1,detectDirectedCycle:ZI,detectAllCycles:PI,detectAllDirectedCycle:j1,detectAllUndirectedCycle:U1,depthFirstSearch:G1,dijkstra:cc,findAllPath:FI,findShortestPath:BI,floydWarshall:dc,labelPropagation:zI,louvain:Y1,iLouvain:GI,kCore:$I,kMeans:UI,cosineSimilarity:V1,nodesCosineSimilarity:jI,minimumSpanningTree:WI,pageRank:XI,getNeighbors:Ni,Stack:gl,GADDI:qI},qU=Object.freeze(Object.defineProperty({__proto__:null,GADDI:qI,Stack:gl,breadthFirstSearch:OI,connectedComponent:z1,cosineSimilarity:V1,default:KU,depthFirstSearch:G1,detectAllCycles:PI,detectAllDirectedCycle:j1,detectAllUndirectedCycle:U1,detectCycle:$1,detectDirectedCycle:ZI,dijkstra:cc,findAllPath:FI,findShortestPath:BI,floydWarshall:dc,getAdjMatrix:cu,getDegree:Po,getInDegree:kI,getNeighbors:Ni,getOutDegree:DI,iLouvain:GI,kCore:$I,kMeans:UI,labelPropagation:zI,louvain:Y1,minimumSpanningTree:WI,nodesCosineSimilarity:jI,pageRank:XI},Symbol.toStringTag,{value:"Module"}));var Sv=ra,ZU=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},QI=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},JI=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)}},eO=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]}},tO=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=S1([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]}},ky=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)},QU=function(t,e){var n=[];return t.forEach(function(i){var a=[];i.forEach(function(o){a.push(o*e)}),n.push(a)}),n},JU=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},ej=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},rO=function(t,e){t.translate(e.x,e.y)},Dy=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)}},tj=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)},rj=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)},nj=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 ij(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(ij(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},nO=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},aj=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},iO=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(!nO(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(aj(u,c))return f=!0,!1}),f},du=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}(),H1=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]},oj=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},aO=function(t,e){for(var n=["top","left","bottom","right"],i=t.getBBox(),a=0,o=[],s=0;s<4;s++){var u=H1(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]},K1=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=H1(i,n[s]),l=u[0],f=u[1],c=u[2],d=u[3],h=oj(e,new du(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},oO=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)},sO=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},Ny=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)},uO=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},sj=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(F1(l,[0,0]))return NaN;var f=[-l[1],l[0]];ys(f,f);var c=[s-n,u-i];return Math.abs(B1(c,f))},q1=function(t,e,n){return t+(e-t)*n},Py=function(t,e,n){for(var i=Math.min(t.length,e.length),a=new Array(i),o=0;o<i;o++)a[o]=q1(t[o],e[o],n);return a};const uj=Object.freeze(Object.defineProperty({__proto__:null,Line:du,applyMatrix:xl,compare:ZU,distance:Mv,floydWarshall:JU,fractionToLine:K1,getAdjMatrix:ej,getBBoxBoundLine:H1,getCircleCenterByPoints:ky,getCircleIntersectByPoint:JI,getDegree:nj,getEllipseIntersectByPoint:eO,getLineIntersect:mp,getPointsCenter:oO,getRectIntersectByPoint:QI,intersectBBox:nO,invertMatrix:tO,isPointInPolygon:hc,isPointsOverlap:Ny,isPolygonsIntersect:iO,itemIntersectByLine:aO,lerp:q1,lerpArray:Py,move:Dy,pointLineDistance:sj,pointLineSquareDist:sO,pointRectSquareDist:uO,rotate:rj,scale:tj,scaleMatrix:QU,squareDist:Cv,translate:rO},Symbol.toStringTag,{value:"Module"}));var Zo="rgb(95, 149, 255)",lj="rgb(255, 255, 255)",r2="rgb(0, 0, 0)",v0="rgb(247, 250, 255)",lO="rgb(239, 244, 255)",Vd="rgb(253, 253, 253)",n2="rgb(250, 250, 250)",Hd="rgb(224, 224, 224)",i2="rgb(234, 234, 234)",fj="rgb(245, 245, 245)",cj="rgb(191, 213, 255)",a2="#4572d9",dj="rgb(223, 234, 255)",br={mainStroke:Zo,mainFill:lO,activeStroke:Zo,activeFill:v0,inactiveStroke:cj,inactiveFill:v0,selectedStroke:Zo,selectedFill:lj,highlightStroke:a2,highlightFill:dj,disableStroke:Hd,disableFill:n2,edgeMainStroke:Hd,edgeActiveStroke:Zo,edgeInactiveStroke:i2,edgeSelectedStroke:Zo,edgeHighlightStroke:Zo,edgeDisableStroke:fj,comboMainStroke:Hd,comboMainFill:Vd,comboActiveStroke:Zo,comboActiveFill:v0,comboInactiveStroke:Hd,comboInactiveFill:Vd,comboSelectedStroke:Zo,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:lO},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"},hj={" ":.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 Ra=Math.PI,Ry=Math.sin,By=Math.cos,zn=Ry(Ra/8),Gn=By(Ra/8),Tv=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}},fO=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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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*zn,m=p*Gn,b=g*zn,x=g*Gn,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]],T=(p+u)/p,A=(g+u)/g;s.clockwise===!1&&(T=(g+u)/g,A=(p+u)/p);var I=ai([0,0],S,T),k=[f[0]+I[0],f[1]+I[1]],P=[d[0]-f[0],d[1]-f[1]],N=ai([0,0],P,A),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},cO=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+=Ra*2),n&&(u.x+=By(f)*n,u.y+=Ry(f)*n),i){var c=f-Ra/2;f>1/2*Ra&&f<3*1/2*Ra&&(c-=Ra),u.x+=By(c)*i,u.y+=Ry(c)*i}var d={x:u.x,y:u.y,angle:f};return a?(f>.5*Ra&&f<1.5*Ra&&(f-=Ra),F({rotate:f},d)):d},vj=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},pj=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},ii=function(t,e){typeof e=="function"&&vj(t,null,-1,e)},Ba=function(t,e){typeof e=="function"&&pj(t,null,-1,e)},dO=function(t,e){return e*(hj[t]||1)},hO=function(t,e){var n=0,i=new RegExp("[一-龥]+");return t.split("").forEach(function(a){i.test(a)?n+=e:n+=dO(a,e)}),[n,e]},vO=function(t,e){return typeof e!="number"||e<=0||e>=t.length?t:t.substring(0,e)+"..."},Fy=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,ii(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},zy=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}ii(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||ii(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;ii(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},gj=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(Xn(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 yj=Object.freeze(Object.defineProperty({__proto__:null,cloneBesidesImg:Zh,getAnimateCfgWithCallback:vc,getBBox:Tv,getComboBBox:qh,getLabelPosition:cO,getLetterWidth:dO,getLoopCfgs:fO,getTextSize:hO,plainCombosToTrees:Fy,reconstructTree:zy,shouldRefreshEdge:gj,traverseTree:ii,traverseTreeUp:Ba,truncateLabelByLength:vO},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 ii(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},mj=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},bj=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=_1.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
269
|
\v\f\r \u2028\u2029`,xj=new RegExp("([a-z])["+Kf+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Kf+"]*,?["+Kf+"]*)+)","ig"),wj=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(xj,function(n,i,a){var o=[],s=i.toLowerCase();if(a.replace(wj,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},Gy=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},$y=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(Gy(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(Gy(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]},pO=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(Te,Ke,ot){var nt=Te*Math.cos(ot)-Ke*Math.sin(ot),Ct=Te*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,T=s,A=u;p=v+f*(o&&p>v?1:-1),s=g+e*Math.cos(p),u=y+n*Math.sin(p),d=pO(s,u,e,n,i,0,o,T,A,[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},Uy=function(r,t){var e=$y(r),n=t&&$y(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(pO.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},Ej=/,?([a-z]),?/gi,gO=function(r){return r.join(",").replace(Ej,"$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},_j=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])}}},Sj=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}}}},Qo=function(r,t,e){return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},yO=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=gO,a},jy=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:yO(r,t,e,n),vb:[r,t,e,n].join(" ")}},Mj=function(r,t){return r=jy(r),t=jy(t),Qo(t,r.x,r.y)||Qo(t,r.x2,r.y)||Qo(t,r.x,r.y2)||Qo(t,r.x2,r.y2)||Qo(r,t.x,t.y)||Qo(r,t.x2,t.y)||Qo(r,t.x,t.y2)||Qo(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=_j.apply(null,r);return jy(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}},Cj=function(r,t,e){var n=f2(r),i=f2(t);if(!Mj(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=Sj(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},Tj=function(r,t,e){r=Uy(r),t=Uy(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=Cj(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},Aj=function(r,t){return Tj(r,t)};function Ij(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 Oj(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=Ij(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 Lj=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(Oj(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},kj=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(Lj(r[c],r[c+1],f))},[]);return u.unshift(r[0]),(t[n]==="Z"||t[n]==="z")&&u.push("Z"),u},Dj=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 Nj(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 Pj=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],Dj(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]=Nj(f,c,d)}}return s},mO=function(r,t){var e=Pj(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 p0(r,t,e){for(var n=[].concat(r),i,a=1/(e+1),o=bO(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 bO(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 Wy=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=bO(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=p0(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=p0(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=p0(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 Rj=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:Gy,fillPath:kj,fillPathByDiff:mO,formatPath:Wy,intersection:Aj,parsePathArray:gO,parsePathString:yl,pathToAbsolute:$y,pathToCurve:Uy,rectPath:yO},Symbol.toStringTag,{value:"Module"}));var xO=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 wO(r,t){var e=r.indexOf(t);e!==-1&&r.splice(e,1)}var d2=typeof window<"u"&&typeof window.document<"u";function EO(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 Xy(r){return r.cfg.visible&&r.cfg.capture}var Bj=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}(yA),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))},Fj=function(){function r(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"}return r}(),zj=function(){function r(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return r}(),Gj=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}(),$j=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Uj=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),jj=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Wj=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,v2=3,Xj=[["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",jj]],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 _O(r){return r?g2(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Uj:typeof navigator<"u"?g2(navigator.userAgent):Hj()}function Yj(r){return r!==""&&Xj.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=Yj(r);if(!t)return null;var e=t[0],n=t[1];if(e==="searchbot")return new $j;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<v2&&(i=h2(h2([],i,!0),Kj(v2-i.length),!0)):i=[];var a=i.join("."),o=Vj(r),s=Wj.exec(r);return s&&s[1]?new Gj(e,a,o,s[1]):new Fj(e,a,o)}function Vj(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 Hj(){var r=typeof process<"u"&&process.version;return r?new zj(process.version.slice(1)):null}function Kj(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 tu(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 SO(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,g0="matrix",qj=["zIndex","capture","visible","type"],Zj=["repeat"],Qj=":",Jj="*";function e7(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 t7(r,t){var e={},n=t.attrs;for(var i in r)e[i]=n[i];return e}function r7(r,t){var e={},n=t.attr();return xe(r,function(i,a){Zj.indexOf(a)===-1&&!bs(n[a],i)&&(e[a]=i)}),e}function n7(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 MO=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(Xn(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?(wO(n.getChildren(),this),n.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),e&&this.destroy()},t.prototype.resetMatrix=function(){this.attr(g0,this.getDefaultMatrix()),this.onCanvasChange("matrix")},t.prototype.getMatrix=function(){return this.attr(g0)},t.prototype.setMatrix=function(e){this.attr(g0,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?tu(n,e):e},t.prototype.invertFromMatrix=function(e){var n=this.attr("matrix");if(n){var i=SO(n);if(i)return tu(i,e)}return e},t.prototype.setClip=function(e){var n=this.getCanvas(),i=null;if(e){var a=this.getShapeBase(),o=Al(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]=e7(n[u]):i[u]=n[u]});var a=this.constructor,o=new a({attrs:i});return xe(qj,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={}):Xn(o)&&o.onFrame&&(v=o.onFrame,p=o.repeat),Xn(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=r7(o,this),x={fromAttrs:t7(b,this),toAttrs:b,duration:s,easing:l,repeat:p,callback:c,pauseCallback:g,resumeCallback:y,delay:h,startTime:i.getTime(),id:to(),onFrame:v,pathFormatted:!1};a.length>0?a=n7(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&&EO(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+Qj+i.type;(a[o]||a[Jj])&&(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}(Bj),m2={},Yy="_INDEX";function CO(r,t){if(r.set("canvas",t),r.isGroup()){var e=r.get("children");e.length&&e.forEach(function(n){CO(n,t)})}}function TO(r,t){if(r.set("timeline",t),r.isGroup()){var e=r.get("children");e.length&&e.forEach(function(n){TO(n,t)})}}function i7(r,t,e){e===void 0&&(e=!0),e?t.destroy():(t.set("parent",null),t.set("canvas",null)),wO(r.getChildren(),t)}function a7(r){return function(t,e){var n=r(t,e);return n===0?t[Yy]-e[Yy]: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];Xn(i)?a=i:a.type=i;var o=m2[a.type];o||(o=Al(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(!Xy(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(Xy(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&&i7(o,e,!1),e.set("parent",this),n&&CO(e,n),a&&TO(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[Yy]=i,n}),e.sort(a7(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}(MO),Il=0,zf=0,mf=0,IO=1e3,Av,Gf,Iv=0,hu=0,bp=0,pc=typeof performance=="object"&&performance.now?performance:Date,OO=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function LO(){return hu||(OO(o7),hu=pc.now()+bp)}function o7(){hu=0}function Vy(){this._call=this._time=this._next=null}Vy.prototype=kO.prototype={constructor:Vy,restart:function(r,t,e){if(typeof r!="function")throw new TypeError("callback is not a function");e=(e==null?LO():+e)+(t==null?0:+t),!this._next&&Gf!==this&&(Gf?Gf._next=this:Av=this,Gf=this),this._call=r,this._time=e,Hy()},stop:function(){this._call&&(this._call=null,this._time=1/0,Hy())}};function kO(r,t,e){var n=new Vy;return n.restart(r,t,e),n}function s7(){LO(),++Il;for(var r=Av,t;r;)(t=hu-r._time)>=0&&r._call.call(null,t),r=r._next;--Il}function b2(){hu=(Iv=pc.now())+bp,Il=zf=0;try{s7()}finally{Il=0,l7(),hu=0}}function u7(){var r=pc.now(),t=r-Iv;t>IO&&(bp-=t,Iv=r)}function l7(){for(var r,t=Av,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:Av=e);Gf=r,Hy(n)}function Hy(r){if(!Il){zf&&(zf=clearTimeout(zf));var t=r-hu;t>24?(r<1/0&&(zf=setTimeout(b2,r-pc.now()-bp)),mf&&(mf=clearInterval(mf))):(mf||(Iv=pc.now(),mf=setInterval(u7,IO)),Il=1,OO(b2))}}function Z1(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function DO(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*",Za="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",f7=/^#([0-9a-f]{3,8})$/,c7=new RegExp("^rgb\\("+[wl,wl,wl]+"\\)$"),d7=new RegExp("^rgb\\("+[Za,Za,Za]+"\\)$"),h7=new RegExp("^rgba\\("+[wl,wl,wl,yc]+"\\)$"),v7=new RegExp("^rgba\\("+[Za,Za,Za,yc]+"\\)$"),p7=new RegExp("^hsl\\("+[yc,Za,Za]+"\\)$"),g7=new RegExp("^hsla\\("+[yc,Za,Za,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};Z1(zc,mc,{copy:function(r){return Object.assign(new this.constructor,this,r)},displayable:function(){return this.rgb().displayable()},hex:w2,formatHex:w2,formatHsl:y7,formatRgb:E2,toString:E2});function w2(){return this.rgb().formatHex()}function y7(){return NO(this).formatHsl()}function E2(){return this.rgb().formatRgb()}function mc(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=f7.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=c7.exec(r))?new Pi(t[1],t[2],t[3],1):(t=d7.exec(r))?new Pi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=h7.exec(r))?Zd(t[1],t[2],t[3],t[4]):(t=v7.exec(r))?Zd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=p7.exec(r))?C2(t[1],t[2]/100,t[3]/100,1):(t=g7.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 m7(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 Ky(r,t,e,n){return arguments.length===1?m7(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}Z1(Pi,Ky,DO(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"#"+y0(this.r)+y0(this.g)+y0(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 y0(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 Ga(r,t,e,n)}function NO(r){if(r instanceof Ga)return new Ga(r.h,r.s,r.l,r.opacity);if(r instanceof zc||(r=mc(r)),!r)return new Ga;if(r instanceof Ga)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 Ga(o,s,u,r.opacity)}function b7(r,t,e,n){return arguments.length===1?NO(r):new Ga(r,t,e,n==null?1:n)}function Ga(r,t,e,n){this.h=+r,this.s=+t,this.l=+e,this.opacity=+n}Z1(Ga,b7,DO(zc,{brighter:function(r){return r=r==null?Ov:Math.pow(Ov,r),new Ga(this.h,this.s,this.l*r,this.opacity)},darker:function(r){return r=r==null?gc:Math.pow(gc,r),new Ga(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(m0(r>=240?r-240:r+120,i,n),m0(r,i,n),m0(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 m0(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 Q1=r=>()=>r;function x7(r,t){return function(e){return r+e*t}}function w7(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 E7(r){return(r=+r)==1?PO:function(t,e){return e-t?w7(t,e,r):Q1(isNaN(t)?e:t)}}function PO(r,t){var e=t-r;return e?x7(r,e):Q1(isNaN(r)?t:r)}const T2=function r(t){var e=E7(t);function n(i,a){var o=e((i=Ky(i)).r,(a=Ky(a)).r),s=e(i.g,a.g),u=e(i.b,a.b),l=PO(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 RO(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 BO(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function _7(r,t){return(BO(t)?RO:FO)(r,t)}function FO(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 S7(r,t){var e=new Date;return r=+r,t=+t,function(n){return e.setTime(r*(1-n)+t*n),e}}function qy(r,t){return r=+r,t=+t,function(e){return r*(1-e)+t*e}}function M7(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 Zy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,b0=new RegExp(Zy.source,"g");function C7(r){return function(){return r}}function T7(r){return function(t){return r(t)+""}}function A7(r,t){var e=Zy.lastIndex=b0.lastIndex=0,n,i,a,o=-1,s=[],u=[];for(r=r+"",t=t+"";(n=Zy.exec(r))&&(i=b0.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:qy(n,i)})),e=b0.lastIndex;return e<t.length&&(a=t.slice(e),s[o]?s[o]+=a:s[++o]=a),s.length<2?u[0]?T7(u[0].x):C7(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"?Q1(t):(e==="number"?qy:e==="string"?(n=mc(t))?(t=n,T2):A7:t instanceof mc?T2:t instanceof Date?S7:BO(t)?RO:Array.isArray(t)?FO:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?M7:qy)(r,t)}function I7(r){return+r}function O7(r){return r*r}function L7(r){return r*(2-r)}function A2(r){return((r*=2)<=1?r*r:--r*(2-r)+1)/2}function k7(r){return r*r*r}function D7(r){return--r*r*r+1}function I2(r){return((r*=2)<=1?r*r*r:(r-=2)*r*r+2)/2}var J1=3,N7=function r(t){t=+t;function e(n){return Math.pow(n,t)}return e.exponent=r,e}(J1),P7=function r(t){t=+t;function e(n){return 1-Math.pow(1-n,t)}return e.exponent=r,e}(J1),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}(J1),zO=Math.PI,GO=zO/2;function R7(r){return+r==1?1:1-Math.cos(r*GO)}function B7(r){return Math.sin(r*GO)}function L2(r){return(1-Math.cos(zO*r))/2}function xs(r){return(Math.pow(2,-10*r)-.0009765625)*1.0009775171065494}function F7(r){return xs(1-+r)}function z7(r){return 1-xs(r)}function k2(r){return((r*=2)<=1?xs(1-r):2-xs(r-1))/2}function G7(r){return 1-Math.sqrt(1-r*r)}function $7(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 Qy=4/11,U7=6/11,j7=8/11,W7=3/4,X7=9/11,Y7=10/11,V7=15/16,H7=21/22,K7=63/64,Qd=1/Qy/Qy;function q7(r){return 1-bc(1-r)}function bc(r){return(r=+r)<Qy?Qd*r*r:r<j7?Qd*(r-=U7)*r+W7:r<Y7?Qd*(r-=X7)*r+V7:Qd*(r-=H7)*r+K7}function Z7(r){return((r*=2)<=1?1-bc(1-r):bc(r-1)+1)/2}var eb=1.70158,Q7=function r(t){t=+t;function e(n){return(n=+n)*n*(t*(n-1)+n)}return e.overshoot=r,e}(eb),J7=function r(t){t=+t;function e(n){return--n*n*((n+1)*t+n)+1}return e.overshoot=r,e}(eb),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}(eb),Ol=2*Math.PI,tb=1,rb=.3,e9=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Ol);function i(a){return t*xs(- --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}(tb,rb),P2=function r(t,e){var n=Math.asin(1/(t=Math.max(1,t)))*(e/=Ol);function i(a){return 1-t*xs(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}(tb,rb),t9=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*xs(-a)*Math.sin((n-a)/e):2-t*xs(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}(tb,rb);const r9=Object.freeze(Object.defineProperty({__proto__:null,easeBack:N2,easeBackIn:Q7,easeBackInOut:N2,easeBackOut:J7,easeBounce:bc,easeBounceIn:q7,easeBounceInOut:Z7,easeBounceOut:bc,easeCircle:D2,easeCircleIn:G7,easeCircleInOut:D2,easeCircleOut:$7,easeCubic:I2,easeCubicIn:k7,easeCubicInOut:I2,easeCubicOut:D7,easeElastic:P2,easeElasticIn:e9,easeElasticInOut:t9,easeElasticOut:P2,easeExp:k2,easeExpIn:F7,easeExpInOut:k2,easeExpOut:z7,easeLinear:I7,easePoly:O2,easePolyIn:N7,easePolyInOut:O2,easePolyOut:P7,easeQuad:A2,easeQuadIn:O7,easeQuadInOut:A2,easeQuadOut:L7,easeSin:L2,easeSinIn:R7,easeSinInOut:L2,easeSinOut:B7},Symbol.toStringTag,{value:"Module"}));var n9={};function i9(r){return n9[r.toLowerCase()]||r9[r]}var a9=function(r){return["fill","stroke","fillStyle","strokeStyle"].includes(r)},o9=function(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)},R2=[1,0,0,0,1,0,0,0,1];function s9(r,t,e){var n={},i=t.fromAttrs,a=t.toAttrs;if(!r.destroyed){var o;for(var s in a)if(!bs(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=mO(l,u),l=Wy(l,u),t.fromAttrs.path=l,t.toAttrs.path=u):t.pathFormatted||(u=yl(a[s]),l=yl(i[s]),l=Wy(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=_7(i[s]||R2,a[s]||R2),g=p(e);n[s]=g}else a9(s)&&o9(a[s])?n[s]=a[s]:Yr(a[s])||(o=Lv(i[s],a[s]),n[s]=o(e));r.attr(n)}}function u9(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=i9(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 s9(r,t,a);return!1}var l9=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=kO(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=u9(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}(),f9=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 c9(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&&EO(r,n)){e.bubbles=!1;return}e.name=t,e.currentTarget=r,e.delegateTarget=r,r.emit(t,e)}}var d9=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 xO(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>f9?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||c9(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=_O(),h9=$2&&$2.name==="firefox",$O=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 d9({canvas:this});e.init(),this.set("eventController",e)},t.prototype.initTimeline=function(){var e=new l9(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(h9&&!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),UO=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),jO=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=tu(n,[e.minX,e.minY]),l=tu(n,[e.maxX,e.minY]),f=tu(n,[e.minX,e.maxY]),c=tu(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}(MO),WO=new Map;function ao(r,t){WO.set(r,t)}function XO(r){return WO.get(r)}function YO(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 VO(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 oi(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=eo(r),n=eo(t),i=Ja(r),a=Ja(t);return{x:e,y:n,width:i-e,height:a-n}}function xp(r){return(r+Math.PI*2)%(Math.PI*2)}const Wn={box:function(r,t,e,n){return Vl([r,e],[t,n])},length:function(r,t,e,n){return oi(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 oi(r,t,i,a);var s=(e-r)*(e-r)+(n-t)*(n-t);return o>s?oi(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(F1(o,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-t)*(a-t));var s=[-o[1],o[0]];ys(s,s);var u=[i-r,a-t];return Math.abs(B1(u,s))},tangentAngle:function(r,t,e,n){return Math.atan2(n-t,e-r)}};var v9=1e-4;function HO(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=oi(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<v9);d++){var y=o-c,m=o+c,v=[i.apply(null,r.concat([y])),i.apply(null,t.concat([y]))],p=oi(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=oi(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 p9(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+=oi(a,o,s,u)}return e/2}function ss(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 KO(r,t,e,n,i,a,o){var s=ss(r,e,i,o),u=ss(t,n,a,o),l=Wn.pointAt(r,t,e,n,o),f=Wn.pointAt(e,n,i,a,o);return[[r,t,l.x,l.y,s,u],[s,u,f.x,f.y,i,a]]}function Jy(r,t,e,n,i,a,o){if(o===0)return(oi(r,t,e,n)+oi(e,n,i,a)+oi(r,t,i,a))/2;var s=KO(r,t,e,n,i,a,.5),u=s[0],l=s[1];return u.push(o-1),l.push(o-1),Jy.apply(null,u)+Jy.apply(null,l)}const qO={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(ss(r,e,i,o)),s!==void 0&&l.push(ss(t,n,a,s)),Vl(u,l)},length:function(r,t,e,n,i,a){return Jy(r,t,e,n,i,a,3)},nearestPoint:function(r,t,e,n,i,a,o,s){return HO([r,e,i],[t,n,a],o,s,ss)},pointDistance:function(r,t,e,n,i,a,o,s){var u=this.nearestPoint(r,t,e,n,i,a,o,s);return oi(u.x,u.y,o,s)},interpolationAt:ss,pointAt:function(r,t,e,n,i,a,o){return{x:ss(r,e,i,o),y:ss(t,n,a,o)}},divide:function(r,t,e,n,i,a,o){return KO(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 us(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 x0(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 ZO(r,t,e,n,i,a,o,s,u){var l=us(r,e,i,o,u),f=us(t,n,a,s,u),c=Wn.pointAt(r,t,e,n,u),d=Wn.pointAt(e,n,i,a,u),h=Wn.pointAt(i,a,o,s,u),v=Wn.pointAt(c.x,c.y,d.x,d.y,u),p=Wn.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 em(r,t,e,n,i,a,o,s,u){if(u===0)return p9([r,e,i,o],[t,n,a,s]);var l=ZO(r,t,e,n,i,a,o,s,.5),f=l[0],c=l[1];return f.push(u-1),c.push(u-1),em.apply(null,f)+em.apply(null,c)}const qf={extrema:x0,box:function(r,t,e,n,i,a,o,s){for(var u=[r,o],l=[t,s],f=x0(r,e,i,o),c=x0(t,n,a,s),d=0;d<f.length;d++)u.push(us(r,e,i,o,f[d]));for(var d=0;d<c.length;d++)l.push(us(t,n,a,s,c[d]));return Vl(u,l)},length:function(r,t,e,n,i,a,o,s){return em(r,t,e,n,i,a,o,s,3)},nearestPoint:function(r,t,e,n,i,a,o,s,u,l,f){return HO([r,e,i,o],[t,n,a,s],u,l,us,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 oi(c.x,c.y,u,l)},interpolationAt:us,pointAt:function(r,t,e,n,i,a,o,s,u){return{x:us(r,e,i,o,u),y:us(t,n,a,s,u)}},divide:function(r,t,e,n,i,a,o,s,u){return ZO(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 g9={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)),T=S/Math.sqrt(d+h-p*p-g*g);v+=T,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 oi(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 y9(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 m9(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 b9(r,t,e){return Math.atan(-t/r*Math.tan(e))}function x9(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 w9(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 E9={box:function(r,t,e,n,i,a,o){for(var s=b9(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=x9(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=g9.nearestPoint(0,0,e,n,f,c),h=w9(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 oi(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=y9(r,t,e,n,i,a,o,u),f=m9(r,t,e,n,i,a,o,u);return xp(Math.atan2(f,l))}};function QO(r){for(var t=0,e=[],n=0;n<r.length-1;n++){var i=r[n],a=r[n+1],o=oi(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 _9(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+=oi(n[0],n[1],i[0],i[1])}return t}function S9(r,t){if(t>1||t<0||r.length<2)return null;var e=QO(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=Wn.pointAt(l[0],l[1],f[0],f[1],d);break}a+=c}return o}function M9(r,t){if(t>1||t<0||r.length<2)return 0;for(var e=QO(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 C9(r,t,e){for(var n=1/0,i=0;i<r.length-1;i++){var a=r[i],o=r[i+1],s=Wn.pointDistance(a[0],a[1],o[0],o[1],t,e);s<n&&(n=s)}return n}const JO={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 _9(r)},pointAt:function(r,t){return S9(r,t)},pointDistance:function(r,t,e){return C9(r,t,e)},tangentAngle:function(r,t){return M9(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 nb(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 T9(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=nb(r,d),{x:d.minX,y:d.minY,width:d.maxX-d.minX,height:d.maxY-d.minY}}function A9(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 w0=null;function eL(){if(!w0){var r=document.createElement("canvas");r.width=1,r.height=1,w0=r.getContext("2d")}return w0}function tL(r,t,e){var n=1;if(Fe(r)&&(n=r.split(`
|
|
270
270
|
`).length),n>1){var i=I9(t,e);return t*n+i*(n-1)}return t}function I9(r,t){return t?t-r:r*.14}function O9(r,t){var e=eL(),n=0;if(gt(r)||r==="")return n;if(e.save(),e.font=t,Fe(r)&&r.includes(`
|
|
271
271
|
`)){var i=r.split(`
|
|
@@ -933,7 +933,7 @@ class CalcAveMovement {
|
|
|
933
933
|
`).concat(h,`
|
|
934
934
|
</div>
|
|
935
935
|
`).concat(d,`
|
|
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(A){S[A]="".concat(S[A],"px")});var T=Ur("<div class='".concat(n.className," g6-annotation-container'></div>"));return tr(T,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(T),T.addEventListener("scroll",function(A){e.updateLinks()}),T}},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")||[[]],T=(i=e.isCanvas)===null||i===void 0?void 0:i.call(e),A=T?qC:e.getID(),I=s[A]||{},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:A,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))),Te=mt(d)?"".concat(d,"px"):d;tr(we,{minHeight:y?"unset":Te,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&&!T){var nt=ot.top,Ct=_||{},Et=Ct.left,fr=Ct.right,Gt=fr===void 0?16:fr,Wt=Ct.top,Mr=Wt===void 0?8:Wt,rr=Ct.bottom,Rt=Gt,sr=Mr;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,A);var L=we.getBoundingClientRect();if(!T){var Se=_y(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[A]=Hi(Hi({},s[A]||{}),{id:A,collapsed:y,card:we,link:P,x:N,y:z,cardBBox:L,content:D||w,title:W||x,contentPlaceholder:X,titlePlaceholder:fe,isCanvas:T}),o.set("cardInfoMap",s),f)this.updateCardPositionsInConatainer(),this.updateLinks();else{var me=!isNaN(m)&&!isNaN(b);if(!Ke&&!T&&!me){var je=ot.bottom,Xe=je===void 0?0:je,nt=ot.top;S[S.length-1].push({id:A,bbox:L}),L.top>Xe-nt-L.height-16&&S.push([]),this.set("rows",S)}}this.updateCardSize(A);var qe=this.get("onAnnotationChange");qe==null||qe(s[A],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(T){b.value&&(d.innerHTML=b.value,w[b.name||"title"]=b.value),x.parentNode.replaceChild(d,x),i.updateCardSize(n);var A=i.get("onAnnotationChange");A==null||A(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),T=S.x,A=S.y,I=y.getBoundingClientRect(),k=I.right-I.left,P=I.bottom-I.top;(p>T-M-k&&m>0||p<0&&m<0)&&(p-=m),(g>A-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",_y(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=_y(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 Cge=Mge;var Tge=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]]},_y=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],T=S.x,A=S.y,I=n.getClientByPoint(T,A);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 Tge(o,M)},Vs=function(t){return Number(t.replace(/\s+|px/gi,""))||0},Li={PluginBase:Mi,Menu:Zhe,Grid:Xhe,Minimap:ive,Bundling:uve,ToolBar:pve,Tooltip:mve,Fisheye:cve,TimeBar:age,ImageMinimap:fge,EdgeFilterLens:vge,SnapLine:bge,Legend:_ge,Annotation:Cge};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=kn(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=kn(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=kn(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=kn(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=kn(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,T=M*Math.sin(1/3*Math.PI),A=M*Math.sin(1/3*Math.PI);o==="up"?S=[-A,T]:o==="down"?S=[-A,-T]:o==="left"&&(S=[-A,A-T]),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=[A,T]:o==="down"?I=[A,-T]:o==="right"&&(I=[A,A-T]),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=[A-T,-T]:o==="left"?k=[A,-T]:o==="right"&&(k=[-A,-T]),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=[-A+T,T]:o==="left"?P=[A,T]:o==="right"&&(P=[-A,T]),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=kn(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=kn(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=kn(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=kn(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:{},T=Mt({},_.attr(),M);Fe(t.description)&&(T.text=t.description),T.x=w,_.resetMatrix(),_.attr(F(F({},T),{y:17+(S||0)}))}}var A=v.shapeMap["pre-rect"]||v.find(function(we){return we.get("className")==="pre-rect"});if(A&&!A.destroyed){var I=Mt({},A.attr(),t.preRect);A.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=kn(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=kn(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=kn(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(T){return T.get("className")==="link-point-left"}),a=e.shapeMap["link-point-right"]||e.find(function(T){return T.get("className")==="link-point-right"}),o=e.shapeMap["link-point-top"]||e.find(function(T){return T.get("className")==="link-point-top"}),s=e.shapeMap["link-point-left-bottom"]||e.find(function(T){return T.get("className")==="link-point-left-bottom"}),u=e.shapeMap["link-point-left-bottom"]||e.find(function(T){return T.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})),Age(t,e,s),this.drawLinkPoints(t,e),s},updateShape:function(t,e,n,i,a){var o=e.get("keyShape");o.attr(F({},n)),Ige(t,e,o),this.updateLabel(t,e,a),i&&this.updateIcon(t,e)}},"circle");var Age=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=o3(a,s),f=l.configs,c=l.totalValue;if(c){var d=s3(n),h=d.lineWidth,v=d.arcR,p=[v,0],g=0;if(u===1){u1(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=u1(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}}}},u1=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}},Ige=function(t,e,n){var i=t.donutAttrs,a=t.donutColorMap,o=a===void 0?{}:a,s={},u=e.getContainer();if(i){var l=o3(i,o),f=l.configs,c=l.totalValue;if(c)for(var d=s3(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=u1(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])})},o3=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}},s3=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}},Oge=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}},Px=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},u3=function(t){return Px(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},Lge=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},l1=function(t,e,n){var i=Lge(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}},f1=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},kge=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},Dge=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},Nge=function(t,e){return kge(t,e.x).concat(Dge(t,e.y))},Dc=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Pge=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)+Pge(t,[e,n,i,a])},Rge=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},c1=function(t,e,n){if(n.width||n.height){var i=f1(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},Bge=function(t,e,n,i){var a=[];return t.forEach(function(o){if(o!==e&&(o.x===e.x||o.y===e.y)){if(c1(o,e,n)||c1(o,e,i))return;a.push(o)}}),Px(a)},Fge=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 f3;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 Rge(m,p,c,n.id),m}delete f[g.id],v.remove(g.id),l.push(g);var b=Bge(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]},zge=function(t,e,n){return!(t.x===e.x&&e.x===n.x||t.y===e.y&&e.y===n.y)},Gge=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]},eT=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(zge(a,s,u)){var l=Gge(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("")},l3=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=l1(g,t,e),b=l1(y,e,t),x=Oge([m,b]),w=QC(g,x),E=QC(y,x),_=[];_=_.concat(f1(w)).concat(f1(E));var M={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[x,w,E].forEach(function(S){_=_.concat(Nge(S,M).filter(function(T){return Rh(T,g)&&Rh(T,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),_=Px(_);var C=Fge(_,m,b,o,s,t,e);return C.unshift(t),C.push(e),u3(C)},$ge=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},f3=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}(),Uge=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},jge=function(t,e,n,i,a){return u3(l3(t,e,n,i,a.offset))},Wge={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:Uge,fallbackRoute:jge},ko=function(t,e){var n=Math.round(Math.abs(t/e)),i=t<0?-1:1;return n<0?0:i*n},Xge=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},Sy=function(t,e){var n=e.x-t.x,i=e.y-t.y;return n||i?Math.atan2(i,n):0},tT=function(t,e){var n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n},rT=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},nT=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&&!c1(t,m,l)&&(m.id="".concat(m.x,"|||").concat(m.y),o.push(m))}return o}var b=l1(c,t,i);return b.id="".concat(b.x,"|||").concat(b.y),[b]},d1=function(t,e,n,i){var a=Sy(t,e),o=n[t.id];if(!o){var s=Sy(i,t);return tT(s,a)}var u=Sy({x:o.x,y:o.y},t);return tT(u,a)},Yge=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};d1(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=d1(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},Vge=function(t,e,n,i,a){if(isNaN(t.x)||isNaN(e.x))return[];var o=Pr(Wge,a);o.obstacles=o.obstacles||[];var s=o.penalties,u=o.gridSize,l=Xge(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=nT(f,t,n,c,o),h=nT(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 f3,x=0;x<d.length;x++){var w=d[x];v[w.id]=w,y[w.id]=0,m[w.id]=rT(w,h,o.distFunc),b.add({id:w.id,value:m[w.id]})}var E=o.maximumLoops,_,M,C,S,T,A,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 Yge(_,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]&&(A=d1(_,C,g,f),!(A>o.maxAllowedDirectionChange)&&!l[N])){v[N]||(v[N]=C);var z=s[A];S=o.distFunc(_,C)+(isNaN(z)?u:z),T=y[_.id]+S;var W=y[N];W&&T>=W||(g[N]=_,y[N]=T,m[N]=T+rT(C,h,o.distFunc),b.add({id:N,value:m[N]}))}}E-=1}return o.fallbackRoute(t,e,n,i,o)};TL("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 eT(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?l3(t[t.length-1],t[0],n,e,s):Vge(t[0],t[t.length-1],e,n,a);if(!c||!c.length)return"M0 0, L0 0";if(i){var d=eT(c,i);return d}c=$ge(c);var h=Kn.pointsToPolygon(c);return h}},"single-edge");var iT=jo.cloneEvent,aT=jo.isNaN,oT=Math.abs,Hge=10,Kge=["shift","ctrl","alt","control"];const qge={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(!(aT(n)||aT(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=iT(t),!!this.origin)){if(this.dragging)t.type="drag",e.emit("canvas:drag",t);else{if(oT(this.origin.x-t.clientX)+oT(this.origin.y-t.clientY)<Hge)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=iT(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&&(Kge.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(Xn(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}},Zge={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({},ou.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 Qge={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],T=S.getID();y[T]&&(n.setItemState(S,o,!1),delete y[T]),s&&!g[T]&&(n.setItemState(S,s,!0),g[T]=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 A=e.getEdges(),I=A.length,m=0;m<I;m++){var M=A[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,sT=Math.max,uT=Math.abs,lT="shift",Jge=["drag","shift","ctrl","alt","control"];const e0e={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:lT,includeEdges:!0,includeCombos:!1,selectOnCombo:!1,selectedEdges:[],selectedNodes:[],selectedCombos:[]}},getEvents:function(){return Jge.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=lT,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=sT(l.x,f.x),h=zh(l.y,f.y),v=sT(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:uT(t.canvasX-e.x),height:uT(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 fT="shift",t0e=["shift","ctrl","alt","control"];const r0e={getDefaultCfg:function(){return{multiple:!0,trigger:fT,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var t=this;return t0e.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=fT,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 n0e=ra,Gh=.05;const i0e={getDefaultCfg:function(){return this.isFireFox=kP()==="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 T=0;T<x;T++)for(var A=m[T],_=A.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,Te=fe.y;X=n0e(X,[["t",-we,-Te],["s",N,N],["t",we,Te]]),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,Wt=fr||Gt||12;if(c<=1&&S.attr("fontSize",Wt/c),ot)break}}if(a.fixLineWidth&&S.get("isKeyShape")){ot=S.attr("lineWidth")||0;var Mr=ee.lineWidth||Y.lineWidth||H.lineWidth||0;if(c<=1&&S.attr("lineWidth",Mr/c),Ke)break}}}for(var rr=P.length,Rt=0;Rt<rr;Rt++)for(var A=P[Rt],D=A.getContainer(),_=D.get("children"),R=A.getModel(),ee=A.getStateStyle(a.fixState),Y=A.get("shapeFactory").getShape(R.type).getStateStyle(a.fixState,A)[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,Wt=fr||Gt||12;if(c<=1&&S.attr("fontSize",Wt/c),ot)break}}if((a.fixLineWidth||a.fixAll)&&S.get("isKeyShape")){ot=S.attr("lineWidth")||0;var Mr=ee.lineWidth||Y.lineWidth||1;if(c<=1&&S.attr("lineWidth",Mr/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)}}},c3={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}},a0e=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"}}},c3),o0e=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"}}},c3);var cT="click",s0e=["click","dblclick"];const u0e={getDefaultCfg:function(){return{trigger:cT,onChange:function(){}}},getEvents:function(){var t,e;return s0e.includes(this.trigger)?e=this.trigger:(e=cT,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 l0e=jo.calculationItemsBBox,f0e=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 c0e={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=[],f0e(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=l0e(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({},ou.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 dT="dblclick",d0e=["click","dblclick"];const h0e={getDefaultCfg:function(){return{trigger:dT,relayout:!0}},getEvents:function(){var t,e;return d0e.includes(this.trigger)?e=this.trigger:(e=dT,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 v0e=jo.isPolygonsIntersect,p0e=jo.pathToPoints,hT="shift",g0e=["drag","shift","ctrl","alt","control"],y0e=function(t,e){var n,i=t.getKeyShape();if(t.get("type")==="path")n=p0e(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 v0e(e,n)};const m0e={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:hT,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return g0e.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=hT,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()&&y0e(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 vT="click",b0e=["click","drag"],pT=void 0,x0e=["shift","ctrl","control","alt","meta",void 0];const w0e={getDefaultCfg:function(){return{trigger:vT,key:pT,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t=this;b0e.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=vT,console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),t.key&&x0e.indexOf(t.key.toLowerCase())===-1&&(t.trigger=pT,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 gT="ctrl",E0e=["shift","ctrl","alt","control"],_0e="1";const S0e={getDefaultCfg:function(){return{trigger:gT,combinedKey:_0e,functionName:"fitView",functionParams:[]}},getEvents:function(){return E0e.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=gT,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 M0e=["shift","ctrl","alt","control","meta"];const C0e={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||M0e.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 T=0;T<C;T++){var A=_[T];if(!A.destroyed)for(var I=A.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(),Te=we.get("ori-visibility");Te&&we.show()}else for(var Ke=0;Ke<fe;Ke++){var ot=X[Ke],Te=ot.get("ori-visibility");!ot.get("visible")&&Te&&Te&&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(),Te=we.get("ori-visibility");Te&&we.show()}else for(var Ke=0;Ke<fe;Ke++){var ot=X[Ke];if(!ot.get("visible")){var Te=ot.get("ori-visibility");Te&&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(Xn(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 T0e={"drag-canvas":qge,"zoom-canvas":i0e,"drag-node":Zge,"activate-relations":Qge,"brush-select":e0e,"click-select":r0e,"lasso-select":m0e,tooltip:a0e,"edge-tooltip":o0e,"collapse-expand":u0e,"drag-combo":c0e,"collapse-expand-combo":h0e,"create-edge":w0e,"shortcuts-call":S0e,"scroll-canvas":C0e};xe(T0e,function(r,t){AL(t,r)});var A0e=F(F({},qU),eV),I0e=Li.Fisheye,O0e=Li.TimeBar,L0e=Li.ImageMinimap,k0e=Li.EdgeFilterLens,D0e=Li.SnapLine,N0e=Li.Annotation;const fg={version:ou.version,Graph:NP,TreeGraph:$he,Util:jo,Layout:or.Layouts,TreeLayout:Ahe,registerLayout:Ihe,Global:ou,registerBehavior:AL,registerCombo:RW,registerEdge:TL,registerNode:Bo,Minimap:Li.Minimap,Grid:Li.Grid,Bundling:Li.Bundling,Menu:Li.Menu,ToolBar:Li.ToolBar,Tooltip:Li.Tooltip,Legend:Li.Legend,TimeBar:O0e,SnapLine:D0e,Fisheye:I0e,ImageMinimap:L0e,EdgeFilterLens:k0e,Annotation:N0e,Algorithm:A0e,Arrow:EL,Marker:_L,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 P0e=Vr({__name:"TrackGraph",props:{track:{}},setup(r){const t=r,e=Lr(()=>{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:PE(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?PE(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=Ln();let i;cs(()=>{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)=>(Dr(),di("div",{ref_key:"container",ref:n},null,512))}}),R0e={"h-full":"",flex:"","gap-5px":"","p-5px":"","box-border":""},B0e=_r("svg",{viewBox:"0 0 24 24"},[_r("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),F0e={key:0,class:"gkd_code"},z0e=_r("div",null,"*为简化视图已隐藏部分节点",-1),H0e=Vr({__name:"SnapshotPage",setup(r){const t=lB(),e=MT(),n=OB(),i=Lr(()=>String(t.params.snapshotId||"")),a=Lr(()=>{const v=Number(t.query.showSize||"");return!Number.isSafeInteger(v)||v<=0?2e3:v}),o=Ln(""),s=Ln();cs(async()=>{const v=await BE.getItem(i.value);if(!v){ca.error("快照数据缺失");return}j5()&&setTimeout(async()=>{$5(v),CT[v.id]||U5(await BE.getItem(i.value))},1e3),v.nodes.length>a.value&&(ca.warning(`当前展示节点数量为${a.value}
|
|
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(A){S[A]="".concat(S[A],"px")});var T=Ur("<div class='".concat(n.className," g6-annotation-container'></div>"));return tr(T,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(T),T.addEventListener("scroll",function(A){e.updateLinks()}),T}},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")||[[]],T=(i=e.isCanvas)===null||i===void 0?void 0:i.call(e),A=T?qC:e.getID(),I=s[A]||{},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:A,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))),Te=mt(d)?"".concat(d,"px"):d;tr(we,{minHeight:y?"unset":Te,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&&!T){var nt=ot.top,Ct=_||{},Et=Ct.left,fr=Ct.right,Gt=fr===void 0?16:fr,Wt=Ct.top,Mr=Wt===void 0?8:Wt,rr=Ct.bottom,Rt=Gt,sr=Mr;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,A);var L=we.getBoundingClientRect();if(!T){var Se=_y(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[A]=Hi(Hi({},s[A]||{}),{id:A,collapsed:y,card:we,link:P,x:N,y:z,cardBBox:L,content:D||w,title:W||x,contentPlaceholder:X,titlePlaceholder:fe,isCanvas:T}),o.set("cardInfoMap",s),f)this.updateCardPositionsInConatainer(),this.updateLinks();else{var me=!isNaN(m)&&!isNaN(b);if(!Ke&&!T&&!me){var je=ot.bottom,Xe=je===void 0?0:je,nt=ot.top;S[S.length-1].push({id:A,bbox:L}),L.top>Xe-nt-L.height-16&&S.push([]),this.set("rows",S)}}this.updateCardSize(A);var qe=this.get("onAnnotationChange");qe==null||qe(s[A],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(T){b.value&&(d.innerHTML=b.value,w[b.name||"title"]=b.value),x.parentNode.replaceChild(d,x),i.updateCardSize(n);var A=i.get("onAnnotationChange");A==null||A(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),T=S.x,A=S.y,I=y.getBoundingClientRect(),k=I.right-I.left,P=I.bottom-I.top;(p>T-M-k&&m>0||p<0&&m<0)&&(p-=m),(g>A-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",_y(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=_y(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 Cge=Mge;var Tge=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]]},_y=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],T=S.x,A=S.y,I=n.getClientByPoint(T,A);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 Tge(o,M)},Vs=function(t){return Number(t.replace(/\s+|px/gi,""))||0},Li={PluginBase:Mi,Menu:Zhe,Grid:Xhe,Minimap:ive,Bundling:uve,ToolBar:pve,Tooltip:mve,Fisheye:cve,TimeBar:age,ImageMinimap:fge,EdgeFilterLens:vge,SnapLine:bge,Legend:_ge,Annotation:Cge};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=kn(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=kn(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=kn(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=kn(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=kn(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,T=M*Math.sin(1/3*Math.PI),A=M*Math.sin(1/3*Math.PI);o==="up"?S=[-A,T]:o==="down"?S=[-A,-T]:o==="left"&&(S=[-A,A-T]),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=[A,T]:o==="down"?I=[A,-T]:o==="right"&&(I=[A,A-T]),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=[A-T,-T]:o==="left"?k=[A,-T]:o==="right"&&(k=[-A,-T]),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=[-A+T,T]:o==="left"?P=[A,T]:o==="right"&&(P=[-A,T]),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=kn(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=kn(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=kn(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=kn(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:{},T=Mt({},_.attr(),M);Fe(t.description)&&(T.text=t.description),T.x=w,_.resetMatrix(),_.attr(F(F({},T),{y:17+(S||0)}))}}var A=v.shapeMap["pre-rect"]||v.find(function(we){return we.get("className")==="pre-rect"});if(A&&!A.destroyed){var I=Mt({},A.attr(),t.preRect);A.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=kn(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=kn(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=kn(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(T){return T.get("className")==="link-point-left"}),a=e.shapeMap["link-point-right"]||e.find(function(T){return T.get("className")==="link-point-right"}),o=e.shapeMap["link-point-top"]||e.find(function(T){return T.get("className")==="link-point-top"}),s=e.shapeMap["link-point-left-bottom"]||e.find(function(T){return T.get("className")==="link-point-left-bottom"}),u=e.shapeMap["link-point-left-bottom"]||e.find(function(T){return T.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})),Age(t,e,s),this.drawLinkPoints(t,e),s},updateShape:function(t,e,n,i,a){var o=e.get("keyShape");o.attr(F({},n)),Ige(t,e,o),this.updateLabel(t,e,a),i&&this.updateIcon(t,e)}},"circle");var Age=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=o3(a,s),f=l.configs,c=l.totalValue;if(c){var d=s3(n),h=d.lineWidth,v=d.arcR,p=[v,0],g=0;if(u===1){u1(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=u1(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}}}},u1=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}},Ige=function(t,e,n){var i=t.donutAttrs,a=t.donutColorMap,o=a===void 0?{}:a,s={},u=e.getContainer();if(i){var l=o3(i,o),f=l.configs,c=l.totalValue;if(c)for(var d=s3(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=u1(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])})},o3=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}},s3=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}},Oge=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}},Px=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},u3=function(t){return Px(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},Lge=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},l1=function(t,e,n){var i=Lge(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}},f1=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},kge=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},Dge=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},Nge=function(t,e){return kge(t,e.x).concat(Dge(t,e.y))},Dc=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Pge=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)+Pge(t,[e,n,i,a])},Rge=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},c1=function(t,e,n){if(n.width||n.height){var i=f1(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},Bge=function(t,e,n,i){var a=[];return t.forEach(function(o){if(o!==e&&(o.x===e.x||o.y===e.y)){if(c1(o,e,n)||c1(o,e,i))return;a.push(o)}}),Px(a)},Fge=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 f3;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 Rge(m,p,c,n.id),m}delete f[g.id],v.remove(g.id),l.push(g);var b=Bge(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]},zge=function(t,e,n){return!(t.x===e.x&&e.x===n.x||t.y===e.y&&e.y===n.y)},Gge=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]},eT=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(zge(a,s,u)){var l=Gge(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("")},l3=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=l1(g,t,e),b=l1(y,e,t),x=Oge([m,b]),w=QC(g,x),E=QC(y,x),_=[];_=_.concat(f1(w)).concat(f1(E));var M={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[x,w,E].forEach(function(S){_=_.concat(Nge(S,M).filter(function(T){return Rh(T,g)&&Rh(T,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),_=Px(_);var C=Fge(_,m,b,o,s,t,e);return C.unshift(t),C.push(e),u3(C)},$ge=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},f3=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}(),Uge=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},jge=function(t,e,n,i,a){return u3(l3(t,e,n,i,a.offset))},Wge={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:Uge,fallbackRoute:jge},ko=function(t,e){var n=Math.round(Math.abs(t/e)),i=t<0?-1:1;return n<0?0:i*n},Xge=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},Sy=function(t,e){var n=e.x-t.x,i=e.y-t.y;return n||i?Math.atan2(i,n):0},tT=function(t,e){var n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n},rT=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},nT=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&&!c1(t,m,l)&&(m.id="".concat(m.x,"|||").concat(m.y),o.push(m))}return o}var b=l1(c,t,i);return b.id="".concat(b.x,"|||").concat(b.y),[b]},d1=function(t,e,n,i){var a=Sy(t,e),o=n[t.id];if(!o){var s=Sy(i,t);return tT(s,a)}var u=Sy({x:o.x,y:o.y},t);return tT(u,a)},Yge=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};d1(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=d1(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},Vge=function(t,e,n,i,a){if(isNaN(t.x)||isNaN(e.x))return[];var o=Pr(Wge,a);o.obstacles=o.obstacles||[];var s=o.penalties,u=o.gridSize,l=Xge(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=nT(f,t,n,c,o),h=nT(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 f3,x=0;x<d.length;x++){var w=d[x];v[w.id]=w,y[w.id]=0,m[w.id]=rT(w,h,o.distFunc),b.add({id:w.id,value:m[w.id]})}var E=o.maximumLoops,_,M,C,S,T,A,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 Yge(_,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]&&(A=d1(_,C,g,f),!(A>o.maxAllowedDirectionChange)&&!l[N])){v[N]||(v[N]=C);var z=s[A];S=o.distFunc(_,C)+(isNaN(z)?u:z),T=y[_.id]+S;var W=y[N];W&&T>=W||(g[N]=_,y[N]=T,m[N]=T+rT(C,h,o.distFunc),b.add({id:N,value:m[N]}))}}E-=1}return o.fallbackRoute(t,e,n,i,o)};TL("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 eT(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?l3(t[t.length-1],t[0],n,e,s):Vge(t[0],t[t.length-1],e,n,a);if(!c||!c.length)return"M0 0, L0 0";if(i){var d=eT(c,i);return d}c=$ge(c);var h=Kn.pointsToPolygon(c);return h}},"single-edge");var iT=jo.cloneEvent,aT=jo.isNaN,oT=Math.abs,Hge=10,Kge=["shift","ctrl","alt","control"];const qge={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(!(aT(n)||aT(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=iT(t),!!this.origin)){if(this.dragging)t.type="drag",e.emit("canvas:drag",t);else{if(oT(this.origin.x-t.clientX)+oT(this.origin.y-t.clientY)<Hge)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=iT(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&&(Kge.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(Xn(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}},Zge={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({},ou.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 Qge={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],T=S.getID();y[T]&&(n.setItemState(S,o,!1),delete y[T]),s&&!g[T]&&(n.setItemState(S,s,!0),g[T]=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 A=e.getEdges(),I=A.length,m=0;m<I;m++){var M=A[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,sT=Math.max,uT=Math.abs,lT="shift",Jge=["drag","shift","ctrl","alt","control"];const e0e={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:lT,includeEdges:!0,includeCombos:!1,selectOnCombo:!1,selectedEdges:[],selectedNodes:[],selectedCombos:[]}},getEvents:function(){return Jge.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=lT,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=sT(l.x,f.x),h=zh(l.y,f.y),v=sT(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:uT(t.canvasX-e.x),height:uT(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 fT="shift",t0e=["shift","ctrl","alt","control"];const r0e={getDefaultCfg:function(){return{multiple:!0,trigger:fT,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var t=this;return t0e.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=fT,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 n0e=ra,Gh=.05;const i0e={getDefaultCfg:function(){return this.isFireFox=kP()==="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 T=0;T<x;T++)for(var A=m[T],_=A.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,Te=fe.y;X=n0e(X,[["t",-we,-Te],["s",N,N],["t",we,Te]]),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,Wt=fr||Gt||12;if(c<=1&&S.attr("fontSize",Wt/c),ot)break}}if(a.fixLineWidth&&S.get("isKeyShape")){ot=S.attr("lineWidth")||0;var Mr=ee.lineWidth||Y.lineWidth||H.lineWidth||0;if(c<=1&&S.attr("lineWidth",Mr/c),Ke)break}}}for(var rr=P.length,Rt=0;Rt<rr;Rt++)for(var A=P[Rt],D=A.getContainer(),_=D.get("children"),R=A.getModel(),ee=A.getStateStyle(a.fixState),Y=A.get("shapeFactory").getShape(R.type).getStateStyle(a.fixState,A)[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,Wt=fr||Gt||12;if(c<=1&&S.attr("fontSize",Wt/c),ot)break}}if((a.fixLineWidth||a.fixAll)&&S.get("isKeyShape")){ot=S.attr("lineWidth")||0;var Mr=ee.lineWidth||Y.lineWidth||1;if(c<=1&&S.attr("lineWidth",Mr/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)}}},c3={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}},a0e=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"}}},c3),o0e=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"}}},c3);var cT="click",s0e=["click","dblclick"];const u0e={getDefaultCfg:function(){return{trigger:cT,onChange:function(){}}},getEvents:function(){var t,e;return s0e.includes(this.trigger)?e=this.trigger:(e=cT,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 l0e=jo.calculationItemsBBox,f0e=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 c0e={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=[],f0e(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=l0e(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({},ou.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 dT="dblclick",d0e=["click","dblclick"];const h0e={getDefaultCfg:function(){return{trigger:dT,relayout:!0}},getEvents:function(){var t,e;return d0e.includes(this.trigger)?e=this.trigger:(e=dT,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 v0e=jo.isPolygonsIntersect,p0e=jo.pathToPoints,hT="shift",g0e=["drag","shift","ctrl","alt","control"],y0e=function(t,e){var n,i=t.getKeyShape();if(t.get("type")==="path")n=p0e(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 v0e(e,n)};const m0e={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:hT,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return g0e.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=hT,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()&&y0e(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 vT="click",b0e=["click","drag"],pT=void 0,x0e=["shift","ctrl","control","alt","meta",void 0];const w0e={getDefaultCfg:function(){return{trigger:vT,key:pT,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t=this;b0e.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=vT,console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),t.key&&x0e.indexOf(t.key.toLowerCase())===-1&&(t.trigger=pT,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 gT="ctrl",E0e=["shift","ctrl","alt","control"],_0e="1";const S0e={getDefaultCfg:function(){return{trigger:gT,combinedKey:_0e,functionName:"fitView",functionParams:[]}},getEvents:function(){return E0e.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=gT,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 M0e=["shift","ctrl","alt","control","meta"];const C0e={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||M0e.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 T=0;T<C;T++){var A=_[T];if(!A.destroyed)for(var I=A.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(),Te=we.get("ori-visibility");Te&&we.show()}else for(var Ke=0;Ke<fe;Ke++){var ot=X[Ke],Te=ot.get("ori-visibility");!ot.get("visible")&&Te&&Te&&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(),Te=we.get("ori-visibility");Te&&we.show()}else for(var Ke=0;Ke<fe;Ke++){var ot=X[Ke];if(!ot.get("visible")){var Te=ot.get("ori-visibility");Te&&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(Xn(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 T0e={"drag-canvas":qge,"zoom-canvas":i0e,"drag-node":Zge,"activate-relations":Qge,"brush-select":e0e,"click-select":r0e,"lasso-select":m0e,tooltip:a0e,"edge-tooltip":o0e,"collapse-expand":u0e,"drag-combo":c0e,"collapse-expand-combo":h0e,"create-edge":w0e,"shortcuts-call":S0e,"scroll-canvas":C0e};xe(T0e,function(r,t){AL(t,r)});var A0e=F(F({},qU),eV),I0e=Li.Fisheye,O0e=Li.TimeBar,L0e=Li.ImageMinimap,k0e=Li.EdgeFilterLens,D0e=Li.SnapLine,N0e=Li.Annotation;const fg={version:ou.version,Graph:NP,TreeGraph:$he,Util:jo,Layout:or.Layouts,TreeLayout:Ahe,registerLayout:Ihe,Global:ou,registerBehavior:AL,registerCombo:RW,registerEdge:TL,registerNode:Bo,Minimap:Li.Minimap,Grid:Li.Grid,Bundling:Li.Bundling,Menu:Li.Menu,ToolBar:Li.ToolBar,Tooltip:Li.Tooltip,Legend:Li.Legend,TimeBar:O0e,SnapLine:D0e,Fisheye:I0e,ImageMinimap:L0e,EdgeFilterLens:k0e,Annotation:N0e,Algorithm:A0e,Arrow:EL,Marker:_L,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 P0e=Vr({__name:"TrackGraph",props:{track:{}},setup(r){const t=r,e=Lr(()=>{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:PE(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?PE(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=Ln();let i;cs(()=>{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)=>(Dr(),di("div",{ref_key:"container",ref:n},null,512))}}),R0e={"h-full":"",flex:"","gap-5px":"","p-5px":"","box-border":""},B0e=_r("svg",{viewBox:"0 0 24 24"},[_r("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),F0e={key:0,class:"gkd_code"},z0e=_r("div",null,"*为简化视图已隐藏部分节点",-1),K0e=Vr({__name:"SnapshotPage",setup(r){const t=lB(),e=MT(),n=AB(),i=Lr(()=>String(t.params.snapshotId||"")),a=Lr(()=>{const v=Number(t.query.showSize||"");return!Number.isSafeInteger(v)||v<=0?2e3:v}),o=Ln(""),s=Ln();cs(async()=>{const v=await BE.getItem(i.value);if(!v){ca.error("快照数据缺失");return}j5()&&setTimeout(async()=>{$5(v),CT[v.id]||U5(await BE.getItem(i.value))},1e3),v.nodes.length>a.value&&(ca.warning(`当前展示节点数量为${a.value}
|
|
937
937
|
之后的${v.nodes.length-a.value}个节点将被丢弃
|
|
938
|
-
使用showSize查询参数可以修改展示数量`),v.nodes=v.nodes.slice(0,a.value));const p=await kB.getItem(i.value);if(!p){ca.create("截屏数据缺失");return}o.value=URL.createObjectURL(new Blob([p],{type:"image/png"})),s.value=v,u.value=
|
|
939
|
-
//# sourceMappingURL=SnapshotPage-
|
|
938
|
+
使用showSize查询参数可以修改展示数量`),v.nodes=v.nodes.slice(0,a.value));const p=await kB.getItem(i.value);if(!p){ca.create("截屏数据缺失");return}o.value=URL.createObjectURL(new Blob([p],{type:"image/png"})),s.value=v,u.value=_B(v.nodes),n.value="快照-"+v.appName||v.appId,await Cy(500),l.value||(l.value=u.value)});const u=Ln(),l=Ln(),f=Ln(0),c=async()=>{ca.success("删除成功,即将回到首页"),await Cy(2e3),e.replace({path:"/"})},d=Ln(),h=Ln(!1);return cs(()=>{d.value&&(h.value=!0)}),(v,p)=>(Dr(),di("div",R0e,[o.value&&s.value?(Dr(),bi(W4,{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"])):da("",!0),s.value&&u.value?(Dr(),bi(nF,{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:It(()=>[s.value?(Dr(),bi(G5,{key:0,snapshot:s.value,onDelete:c,showPreview:!1},null,8,["snapshot"])):da("",!0)]),_:1},8,["rootNode","snapshot","focusNode","focusCount"])):da("",!0),l.value?(Dr(),bi(D4,{key:2,focusNode:l.value},null,8,["focusNode"])):da("",!0),u.value&&s.value?(Dr(),bi(tF,{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"])):da("",!0),jt(ht(fB),{show:h.value,"onUpdate:show":p[4]||(p[4]=g=>h.value=g),preset:"dialog",title:"选择器路径视图",class:"w-[max(600px,80vh)]",onAfterLeave:p[5]||(p[5]=g=>d.value=void 0)},{icon:It(()=>[jt(ht(pl),null,{default:It(()=>[B0e]),_:1})]),default:It(()=>[d.value?(Dr(),di("div",F0e,Sn(d.value.selector.toString()),1)):da("",!0),d.value?(Dr(),bi(P0e,{key:1,track:d.value},null,8,["track"])):da("",!0),z0e]),_:1},8,["show"])]))}});export{K0e as default};
|
|
939
|
+
//# sourceMappingURL=SnapshotPage-YWbGBZcb.js.map
|