You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/9794.1a2cc54a.async.js

133 lines
1.2 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

!(function(){var IB=Object.defineProperty,BB=Object.defineProperties;var FB=Object.getOwnPropertyDescriptors;var aw=Object.getOwnPropertySymbols;var zB=Object.prototype.hasOwnProperty,jB=Object.prototype.propertyIsEnumerable;var is=Math.pow,U0=(U,Q,S)=>Q in U?IB(U,Q,{enumerable:!0,configurable:!0,writable:!0,value:S}):U[Q]=S,Bo=(U,Q)=>{for(var S in Q||(Q={}))zB.call(Q,S)&&U0(U,S,Q[S]);if(aw)for(var S of aw(Q))jB.call(Q,S)&&U0(U,S,Q[S]);return U},Y0=(U,Q)=>BB(U,FB(Q));var Cn=(U,Q,S)=>U0(U,typeof Q!="symbol"?Q+"":Q,S);(self.webpackChunk=self.webpackChunk||[]).push([[9794],{39627:function(U,Q,S){"use strict";S.d(Q,{kJ:function(){return ad},RN:function(){return bB}});var A={};S.r(A),S.d(A,{add:function(){return hw},adjoint:function(){return Mt},clone:function(){return ue},copy:function(){return we},create:function(){return Wt},decompose:function(){return yd},determinant:function(){return Yt},equals:function(){return vw},exactEquals:function(){return wd},frob:function(){return uw},fromQuat:function(){return Wo},fromQuat2:function(){return _r},fromRotation:function(){return ti},fromRotationTranslation:function(){return Mr},fromRotationTranslationScale:function(){return bd},fromRotationTranslationScaleOrigin:function(){return hs},fromScaling:function(){return gn},fromTranslation:function(){return Hn},fromValues:function(){return Ae},fromXRotation:function(){return fi},fromYRotation:function(){return ze},fromZRotation:function(){return Bn},frustum:function(){return xd},getRotation:function(){return Js},getScaling:function(){return Ca},getTranslation:function(){return Tn},identity:function(){return ge},invert:function(){return Ze},lookAt:function(){return sg},mul:function(){return lg},multiply:function(){return Jt},multiplyScalar:function(){return dw},multiplyScalarAndAdd:function(){return fw},ortho:function(){return ig},orthoNO:function(){return rg},orthoZO:function(){return ag},perspective:function(){return Ed},perspectiveFromFieldOfView:function(){return ow},perspectiveNO:function(){return Kl},perspectiveZO:function(){return sw},rotate:function(){return $e},rotateX:function(){return hn},rotateY:function(){return vn},rotateZ:function(){return nr},scale:function(){return fn},set:function(){return un},str:function(){return cw},sub:function(){return gw},subtract:function(){return og},targetTo:function(){return lw},translate:function(){return Ht},transpose:function(){return be}});var Z={};S.r(Z),S.d(Z,{circle:function(){return E3},diamond:function(){return w3},rect:function(){return M3},simple:function(){return T3},triangle:function(){return p1},triangleRect:function(){return A3},vee:function(){return S3}});var B=S(33885),N=S(67732),T=S(83652),k=S(94480),_=S(22214),C=S(42403),R=S(42978),z=S(37271),D=z,W=1e-6,X=typeof Float32Array!="undefined"?Float32Array:Array,K=Math.random,rt="zyx";function nt(n){return n>=0?Math.round(n):n%.5===0?Math.floor(n):Math.round(n)}function q(n){X=n}var it=Math.PI/180,at=180/Math.PI;function ut(n){return n*it}function ht(n){return n*at}function xt(n,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:W;return Math.abs(n-t)<=e*Math.max(1,Math.abs(n),Math.abs(t))}function pt(){var n=new X(3);return X!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n}function wt(n){var t=new X(3);return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function gt(n){var t=n[0],e=n[1],r=n[2];return Math.sqrt(t*t+e*e+r*r)}function Et(n,t,e){var r=new X(3);return r[0]=n,r[1]=t,r[2]=e,r}function kt(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n}function zt(n,t,e,r){return n[0]=t,n[1]=e,n[2]=r,n}function Ut(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n}function Qt(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n}function Ee(n,t,e){return n[0]=t[0]*e[0],n[1]=t[1]*e[1],n[2]=t[2]*e[2],n}function Le(n,t,e){return n[0]=t[0]/e[0],n[1]=t[1]/e[1],n[2]=t[2]/e[2],n}function tn(n,t){return n[0]=Math.ceil(t[0]),n[1]=Math.ceil(t[1]),n[2]=Math.ceil(t[2]),n}function er(n,t){return n[0]=Math.floor(t[0]),n[1]=Math.floor(t[1]),n[2]=Math.floor(t[2]),n}function $r(n,t,e){return n[0]=Math.min(t[0],e[0]),n[1]=Math.min(t[1],e[1]),n[2]=Math.min(t[2],e[2]),n}function la(n,t,e){return n[0]=Math.max(t[0],e[0]),n[1]=Math.max(t[1],e[1]),n[2]=Math.max(t[2],e[2]),n}function as(n,t){return n[0]=glMatrix.round(t[0]),n[1]=glMatrix.round(t[1]),n[2]=glMatrix.round(t[2]),n}function Pt(n,t,e){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n}function _t(n,t,e,r){return n[0]=t[0]+e[0]*r,n[1]=t[1]+e[1]*r,n[2]=t[2]+e[2]*r,n}function It(n,t){var e=t[0]-n[0],r=t[1]-n[1],i=t[2]-n[2];return Math.sqrt(e*e+r*r+i*i)}function dt(n,t){var e=t[0]-n[0],r=t[1]-n[1],i=t[2]-n[2];return e*e+r*r+i*i}function St(n){var t=n[0],e=n[1],r=n[2];return t*t+e*e+r*r}function Ct(n,t){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n}function Gt(n,t){return n[0]=1/t[0],n[1]=1/t[1],n[2]=1/t[2],n}function oe(n,t){var e=t[0],r=t[1],i=t[2],a=e*e+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),n[0]=t[0]*a,n[1]=t[1]*a,n[2]=t[2]*a,n}function ye(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function de(n,t,e){var r=t[0],i=t[1],a=t[2],s=e[0],o=e[1],l=e[2];return n[0]=i*l-a*o,n[1]=a*s-r*l,n[2]=r*o-i*s,n}function _e(n,t,e,r){var i=t[0],a=t[1],s=t[2];return n[0]=i+r*(e[0]-i),n[1]=a+r*(e[1]-a),n[2]=s+r*(e[2]-s),n}function Mn(n,t,e,r){var i=Math.acos(Math.min(Math.max(ye(t,e),-1),1)),a=Math.sin(i),s=Math.sin((1-r)*i)/a,o=Math.sin(r*i)/a;return n[0]=s*t[0]+o*e[0],n[1]=s*t[1]+o*e[1],n[2]=s*t[2]+o*e[2],n}function Nn(n,t,e,r,i,a){var s=a*a,o=s*(2*a-3)+1,l=s*(a-2)+a,c=s*(a-1),u=s*(3-2*a);return n[0]=t[0]*o+e[0]*l+r[0]*c+i[0]*u,n[1]=t[1]*o+e[1]*l+r[1]*c+i[1]*u,n[2]=t[2]*o+e[2]*l+r[2]*c+i[2]*u,n}function Pe(n,t,e,r,i,a){var s=1-a,o=s*s,l=a*a,c=o*s,u=3*a*o,h=3*l*s,d=l*a;return n[0]=t[0]*c+e[0]*u+r[0]*h+i[0]*d,n[1]=t[1]*c+e[1]*u+r[1]*h+i[1]*d,n[2]=t[2]*c+e[2]*u+r[2]*h+i[2]*d,n}function Se(n,t){t=t===void 0?1:t;var e=glMatrix.RANDOM()*2*Math.PI,r=glMatrix.RANDOM()*2-1,i=Math.sqrt(1-r*r)*t;return n[0]=Math.cos(e)*i,n[1]=Math.sin(e)*i,n[2]=r*t,n}function re(n,t,e){var r=t[0],i=t[1],a=t[2],s=e[3]*r+e[7]*i+e[11]*a+e[15];return s=s||1,n[0]=(e[0]*r+e[4]*i+e[8]*a+e[12])/s,n[1]=(e[1]*r+e[5]*i+e[9]*a+e[13])/s,n[2]=(e[2]*r+e[6]*i+e[10]*a+e[14])/s,n}function Oe(n,t,e){var r=t[0],i=t[1],a=t[2];return n[0]=r*e[0]+i*e[3]+a*e[6],n[1]=r*e[1]+i*e[4]+a*e[7],n[2]=r*e[2]+i*e[5]+a*e[8],n}function cr(n,t,e){var r=e[0],i=e[1],a=e[2],s=e[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,d=r*l-i*o;return u=u+u,h=h+h,d=d+d,n[0]=o+s*u+i*d-a*h,n[1]=l+s*h+a*u-r*d,n[2]=c+s*d+r*h-i*u,n}function ca(n,t,e,r){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(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),n[0]=a[0]+e[0],n[1]=a[1]+e[1],n[2]=a[2]+e[2],n}function ne(n,t,e,r){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(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),n[0]=a[0]+e[0],n[1]=a[1]+e[1],n[2]=a[2]+e[2],n}function ss(n,t,e,r){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(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],n[0]=a[0]+e[0],n[1]=a[1]+e[1],n[2]=a[2]+e[2],n}function Rr(n,t){var e=n[0],r=n[1],i=n[2],a=t[0],s=t[1],o=t[2],l=Math.sqrt((e*e+r*r+i*i)*(a*a+s*s+o*o)),c=l&&ye(n,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function Yn(n){return n[0]=0,n[1]=0,n[2]=0,n}function Lr(n){return"vec3("+n[0]+", "+n[1]+", "+n[2]+")"}function os(n,t){return n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]}function ua(n,t){var e=n[0],r=n[1],i=n[2],a=t[0],s=t[1],o=t[2];return Math.abs(e-a)<=W*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(r-s)<=W*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=W*Math.max(1,Math.abs(i),Math.abs(o))}var qs=Qt,ha=null,Fo=null,ls=It,cs=null,us=gt,Ai=null,Ti=function(){var n=pt();return function(t,e,r,i,a,s){var o,l;for(e||(e=3),r||(r=0),i?l=Math.min(i*e+r,t.length):l=t.length,o=r;o<l;o+=e)n[0]=t[o],n[1]=t[o+1],n[2]=t[o+2],a(n,n,s),t[o]=n[0],t[o+1]=n[1],t[o+2]=n[2];return t}}();function An(){var n=new X(4);return X!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0,n[3]=0),n}function hd(n){var t=new X(4);return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function Ui(n,t,e,r){var i=new X(4);return i[0]=n,i[1]=t,i[2]=e,i[3]=r,i}function Oi(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n}function zo(n,t,e,r,i){return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n}function Oa(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n}function K0(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n}function dd(n,t,e){return n[0]=t[0]*e[0],n[1]=t[1]*e[1],n[2]=t[2]*e[2],n[3]=t[3]*e[3],n}function jo(n,t,e){return n[0]=t[0]/e[0],n[1]=t[1]/e[1],n[2]=t[2]/e[2],n[3]=t[3]/e[3],n}function Q0(n,t){return n[0]=Math.ceil(t[0]),n[1]=Math.ceil(t[1]),n[2]=Math.ceil(t[2]),n[3]=Math.ceil(t[3]),n}function q0(n,t){return n[0]=Math.floor(t[0]),n[1]=Math.floor(t[1]),n[2]=Math.floor(t[2]),n[3]=Math.floor(t[3]),n}function J0(n,t,e){return n[0]=Math.min(t[0],e[0]),n[1]=Math.min(t[1],e[1]),n[2]=Math.min(t[2],e[2]),n[3]=Math.min(t[3],e[3]),n}function $0(n,t,e){return n[0]=Math.max(t[0],e[0]),n[1]=Math.max(t[1],e[1]),n[2]=Math.max(t[2],e[2]),n[3]=Math.max(t[3],e[3]),n}function tg(n,t){return n[0]=glMatrix.round(t[0]),n[1]=glMatrix.round(t[1]),n[2]=glMatrix.round(t[2]),n[3]=glMatrix.round(t[3]),n}function fd(n,t,e){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n}function vd(n,t,e,r){return n[0]=t[0]+e[0]*r,n[1]=t[1]+e[1]*r,n[2]=t[2]+e[2]*r,n[3]=t[3]+e[3]*r,n}function eg(n,t){var e=t[0]-n[0],r=t[1]-n[1],i=t[2]-n[2],a=t[3]-n[3];return Math.sqrt(e*e+r*r+i*i+a*a)}function ng(n,t){var e=t[0]-n[0],r=t[1]-n[1],i=t[2]-n[2],a=t[3]-n[3];return e*e+r*r+i*i+a*a}function gd(n){var t=n[0],e=n[1],r=n[2],i=n[3];return Math.sqrt(t*t+e*e+r*r+i*i)}function pd(n){var t=n[0],e=n[1],r=n[2],i=n[3];return t*t+e*e+r*r+i*i}function Zo(n,t){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}function md(n,t){return n[0]=1/t[0],n[1]=1/t[1],n[2]=1/t[2],n[3]=1/t[3],n}function Xl(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=e*e+r*r+i*i+a*a;return s>0&&(s=1/Math.sqrt(s)),n[0]=e*s,n[1]=r*s,n[2]=i*s,n[3]=a*s,n}function H(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function x(n,t,e,r){var i=e[0]*r[1]-e[1]*r[0],a=e[0]*r[2]-e[2]*r[0],s=e[0]*r[3]-e[3]*r[0],o=e[1]*r[2]-e[2]*r[1],l=e[1]*r[3]-e[3]*r[1],c=e[2]*r[3]-e[3]*r[2],u=t[0],h=t[1],d=t[2],f=t[3];return n[0]=h*c-d*l+f*o,n[1]=-(u*c)+d*s-f*a,n[2]=u*l-h*s+f*i,n[3]=-(u*o)+h*a-d*i,n}function w(n,t,e,r){var i=t[0],a=t[1],s=t[2],o=t[3];return n[0]=i+r*(e[0]-i),n[1]=a+r*(e[1]-a),n[2]=s+r*(e[2]-s),n[3]=o+r*(e[3]-o),n}function m(n,t){t=t===void 0?1:t;var e,r,i,a,s,o,l;l=glMatrix.RANDOM(),e=l*2-1,r=(4*glMatrix.RANDOM()-2)*Math.sqrt(l*-l+l),s=e*e+r*r,l=glMatrix.RANDOM(),i=l*2-1,a=(4*glMatrix.RANDOM()-2)*Math.sqrt(l*-l+l),o=i*i+a*a;var c=Math.sqrt((1-s)/o);return n[0]=t*e,n[1]=t*r,n[2]=t*i*c,n[3]=t*a*c,n}function M(n,t,e){var r=t[0],i=t[1],a=t[2],s=t[3];return n[0]=e[0]*r+e[4]*i+e[8]*a+e[12]*s,n[1]=e[1]*r+e[5]*i+e[9]*a+e[13]*s,n[2]=e[2]*r+e[6]*i+e[10]*a+e[14]*s,n[3]=e[3]*r+e[7]*i+e[11]*a+e[15]*s,n}function j(n,t,e){var r=e[0],i=e[1],a=e[2],s=e[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-r*c,d=r*l-i*o;return u=u+u,h=h+h,d=d+d,n[0]=o+s*u+i*d-a*h,n[1]=l+s*h+a*u-r*d,n[2]=c+s*d+r*h-i*u,n[3]=t[3],n}function tt(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n}function et(n){return"vec4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+")"}function st(n,t){return n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]&&n[3]===t[3]}function lt(n,t){var e=n[0],r=n[1],i=n[2],a=n[3],s=t[0],o=t[1],l=t[2],c=t[3];return Math.abs(e-s)<=glMatrix.EPSILON*Math.max(1,Math.abs(e),Math.abs(s))&&Math.abs(r-o)<=glMatrix.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-l)<=glMatrix.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=glMatrix.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))}var Tt=null,vt=null,Ft=null,qt=null,Lt=null,Zt=null,le=null,bt=function(){var n=An();return function(t,e,r,i,a,s){var o,l;for(e||(e=4),r||(r=0),i?l=Math.min(i*e+r,t.length):l=t.length,o=r;o<l;o+=e)n[0]=t[o],n[1]=t[o+1],n[2]=t[o+2],n[3]=t[o+3],a(n,n,s),t[o]=n[0],t[o+1]=n[1],t[o+2]=n[2],t[o+3]=n[3];return t}}();function Wt(){var n=new X(16);return X!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,n}function ue(n){var t=new X(16);return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function we(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function Ae(n,t,e,r,i,a,s,o,l,c,u,h,d,f,v,g){var p=new X(16);return p[0]=n,p[1]=t,p[2]=e,p[3]=r,p[4]=i,p[5]=a,p[6]=s,p[7]=o,p[8]=l,p[9]=c,p[10]=u,p[11]=h,p[12]=d,p[13]=f,p[14]=v,p[15]=g,p}function un(n,t,e,r,i,a,s,o,l,c,u,h,d,f,v,g,p){return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n[4]=a,n[5]=s,n[6]=o,n[7]=l,n[8]=c,n[9]=u,n[10]=h,n[11]=d,n[12]=f,n[13]=v,n[14]=g,n[15]=p,n}function ge(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function be(n,t){if(n===t){var e=t[1],r=t[2],i=t[3],a=t[6],s=t[7],o=t[11];n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=e,n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=a,n[11]=t[14],n[12]=i,n[13]=s,n[14]=o}else n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15];return n}function Ze(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],v=t[12],g=t[13],p=t[14],y=t[15],b=e*o-r*s,E=e*l-i*s,O=e*c-a*s,P=r*l-i*o,L=r*c-a*o,F=i*c-a*l,I=u*g-h*v,V=u*p-d*v,Y=u*y-f*v,J=h*p-d*g,$=h*y-f*g,ot=d*y-f*p,ct=b*ot-E*$+O*J+P*Y-L*V+F*I;return ct?(ct=1/ct,n[0]=(o*ot-l*$+c*J)*ct,n[1]=(i*$-r*ot-a*J)*ct,n[2]=(g*F-p*L+y*P)*ct,n[3]=(d*L-h*F-f*P)*ct,n[4]=(l*Y-s*ot-c*V)*ct,n[5]=(e*ot-i*Y+a*V)*ct,n[6]=(p*O-v*F-y*E)*ct,n[7]=(u*F-d*O+f*E)*ct,n[8]=(s*$-o*Y+c*I)*ct,n[9]=(r*Y-e*$-a*I)*ct,n[10]=(v*L-g*O+y*b)*ct,n[11]=(h*O-u*L-f*b)*ct,n[12]=(o*V-s*J-l*I)*ct,n[13]=(e*J-r*V+i*I)*ct,n[14]=(g*E-v*P-p*b)*ct,n[15]=(u*P-h*E+d*b)*ct,n):null}function Mt(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],v=t[12],g=t[13],p=t[14],y=t[15],b=e*o-r*s,E=e*l-i*s,O=e*c-a*s,P=r*l-i*o,L=r*c-a*o,F=i*c-a*l,I=u*g-h*v,V=u*p-d*v,Y=u*y-f*v,J=h*p-d*g,$=h*y-f*g,ot=d*y-f*p;return n[0]=o*ot-l*$+c*J,n[1]=i*$-r*ot-a*J,n[2]=g*F-p*L+y*P,n[3]=d*L-h*F-f*P,n[4]=l*Y-s*ot-c*V,n[5]=e*ot-i*Y+a*V,n[6]=p*O-v*F-y*E,n[7]=u*F-d*O+f*E,n[8]=s*$-o*Y+c*I,n[9]=r*Y-e*$-a*I,n[10]=v*L-g*O+y*b,n[11]=h*O-u*L-f*b,n[12]=o*V-s*J-l*I,n[13]=e*J-r*V+i*I,n[14]=g*E-v*P-p*b,n[15]=u*P-h*E+d*b,n}function Yt(n){var t=n[0],e=n[1],r=n[2],i=n[3],a=n[4],s=n[5],o=n[6],l=n[7],c=n[8],u=n[9],h=n[10],d=n[11],f=n[12],v=n[13],g=n[14],p=n[15],y=t*s-e*a,b=t*o-r*a,E=e*o-r*s,O=c*v-u*f,P=c*g-h*f,L=u*g-h*v,F=t*L-e*P+r*O,I=a*L-s*P+o*O,V=c*E-u*b+h*y,Y=f*E-v*b+g*y;return l*F-i*I+p*V-d*Y}function Jt(n,t,e){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],v=t[11],g=t[12],p=t[13],y=t[14],b=t[15],E=e[0],O=e[1],P=e[2],L=e[3];return n[0]=E*r+O*o+P*h+L*g,n[1]=E*i+O*l+P*d+L*p,n[2]=E*a+O*c+P*f+L*y,n[3]=E*s+O*u+P*v+L*b,E=e[4],O=e[5],P=e[6],L=e[7],n[4]=E*r+O*o+P*h+L*g,n[5]=E*i+O*l+P*d+L*p,n[6]=E*a+O*c+P*f+L*y,n[7]=E*s+O*u+P*v+L*b,E=e[8],O=e[9],P=e[10],L=e[11],n[8]=E*r+O*o+P*h+L*g,n[9]=E*i+O*l+P*d+L*p,n[10]=E*a+O*c+P*f+L*y,n[11]=E*s+O*u+P*v+L*b,E=e[12],O=e[13],P=e[14],L=e[15],n[12]=E*r+O*o+P*h+L*g,n[13]=E*i+O*l+P*d+L*p,n[14]=E*a+O*c+P*f+L*y,n[15]=E*s+O*u+P*v+L*b,n}function Ht(n,t,e){var r=e[0],i=e[1],a=e[2],s,o,l,c,u,h,d,f,v,g,p,y;return t===n?(n[12]=t[0]*r+t[4]*i+t[8]*a+t[12],n[13]=t[1]*r+t[5]*i+t[9]*a+t[13],n[14]=t[2]*r+t[6]*i+t[10]*a+t[14],n[15]=t[3]*r+t[7]*i+t[11]*a+t[15]):(s=t[0],o=t[1],l=t[2],c=t[3],u=t[4],h=t[5],d=t[6],f=t[7],v=t[8],g=t[9],p=t[10],y=t[11],n[0]=s,n[1]=o,n[2]=l,n[3]=c,n[4]=u,n[5]=h,n[6]=d,n[7]=f,n[8]=v,n[9]=g,n[10]=p,n[11]=y,n[12]=s*r+u*i+v*a+t[12],n[13]=o*r+h*i+g*a+t[13],n[14]=l*r+d*i+p*a+t[14],n[15]=c*r+f*i+y*a+t[15]),n}function fn(n,t,e){var r=e[0],i=e[1],a=e[2];return n[0]=t[0]*r,n[1]=t[1]*r,n[2]=t[2]*r,n[3]=t[3]*r,n[4]=t[4]*i,n[5]=t[5]*i,n[6]=t[6]*i,n[7]=t[7]*i,n[8]=t[8]*a,n[9]=t[9]*a,n[10]=t[10]*a,n[11]=t[11]*a,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n}function $e(n,t,e,r){var i=r[0],a=r[1],s=r[2],o=Math.sqrt(i*i+a*a+s*s),l,c,u,h,d,f,v,g,p,y,b,E,O,P,L,F,I,V,Y,J,$,ot,ct,ft;return o<W?null:(o=1/o,i*=o,a*=o,s*=o,l=Math.sin(e),c=Math.cos(e),u=1-c,h=t[0],d=t[1],f=t[2],v=t[3],g=t[4],p=t[5],y=t[6],b=t[7],E=t[8],O=t[9],P=t[10],L=t[11],F=i*i*u+c,I=a*i*u+s*l,V=s*i*u-a*l,Y=i*a*u-s*l,J=a*a*u+c,$=s*a*u+i*l,ot=i*s*u+a*l,ct=a*s*u-i*l,ft=s*s*u+c,n[0]=h*F+g*I+E*V,n[1]=d*F+p*I+O*V,n[2]=f*F+y*I+P*V,n[3]=v*F+b*I+L*V,n[4]=h*Y+g*J+E*$,n[5]=d*Y+p*J+O*$,n[6]=f*Y+y*J+P*$,n[7]=v*Y+b*J+L*$,n[8]=h*ot+g*ct+E*ft,n[9]=d*ot+p*ct+O*ft,n[10]=f*ot+y*ct+P*ft,n[11]=v*ot+b*ct+L*ft,t!==n&&(n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n)}function hn(n,t,e){var r=Math.sin(e),i=Math.cos(e),a=t[4],s=t[5],o=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[4]=a*i+c*r,n[5]=s*i+u*r,n[6]=o*i+h*r,n[7]=l*i+d*r,n[8]=c*i-a*r,n[9]=u*i-s*r,n[10]=h*i-o*r,n[11]=d*i-l*r,n}function vn(n,t,e){var r=Math.sin(e),i=Math.cos(e),a=t[0],s=t[1],o=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==n&&(n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=a*i-c*r,n[1]=s*i-u*r,n[2]=o*i-h*r,n[3]=l*i-d*r,n[8]=a*r+c*i,n[9]=s*r+u*i,n[10]=o*r+h*i,n[11]=l*r+d*i,n}function nr(n,t,e){var r=Math.sin(e),i=Math.cos(e),a=t[0],s=t[1],o=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==n&&(n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15]),n[0]=a*i+c*r,n[1]=s*i+u*r,n[2]=o*i+h*r,n[3]=l*i+d*r,n[4]=c*i-a*r,n[5]=u*i-s*r,n[6]=h*i-o*r,n[7]=d*i-l*r,n}function Hn(n,t){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=t[0],n[13]=t[1],n[14]=t[2],n[15]=1,n}function gn(n,t){return n[0]=t[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function ti(n,t,e){var r=e[0],i=e[1],a=e[2],s=Math.sqrt(r*r+i*i+a*a),o,l,c;return s<W?null:(s=1/s,r*=s,i*=s,a*=s,o=Math.sin(t),l=Math.cos(t),c=1-l,n[0]=r*r*c+l,n[1]=i*r*c+a*o,n[2]=a*r*c-i*o,n[3]=0,n[4]=r*i*c-a*o,n[5]=i*i*c+l,n[6]=a*i*c+r*o,n[7]=0,n[8]=r*a*c+i*o,n[9]=i*a*c-r*o,n[10]=a*a*c+l,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n)}function fi(n,t){var e=Math.sin(t),r=Math.cos(t);return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=r,n[6]=e,n[7]=0,n[8]=0,n[9]=-e,n[10]=r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function ze(n,t){var e=Math.sin(t),r=Math.cos(t);return n[0]=r,n[1]=0,n[2]=-e,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=e,n[9]=0,n[10]=r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Bn(n,t){var e=Math.sin(t),r=Math.cos(t);return n[0]=r,n[1]=e,n[2]=0,n[3]=0,n[4]=-e,n[5]=r,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Mr(n,t,e){var r=t[0],i=t[1],a=t[2],s=t[3],o=r+r,l=i+i,c=a+a,u=r*o,h=r*l,d=r*c,f=i*l,v=i*c,g=a*c,p=s*o,y=s*l,b=s*c;return n[0]=1-(f+g),n[1]=h+b,n[2]=d-y,n[3]=0,n[4]=h-b,n[5]=1-(u+g),n[6]=v+p,n[7]=0,n[8]=d+y,n[9]=v-p,n[10]=1-(u+f),n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function _r(n,t){var e=new X(3),r=-t[0],i=-t[1],a=-t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=r*r+i*i+a*a+s*s;return h>0?(e[0]=(o*s+u*r+l*a-c*i)*2/h,e[1]=(l*s+u*i+c*r-o*a)*2/h,e[2]=(c*s+u*a+o*i-l*r)*2/h):(e[0]=(o*s+u*r+l*a-c*i)*2,e[1]=(l*s+u*i+c*r-o*a)*2,e[2]=(c*s+u*a+o*i-l*r)*2),Mr(n,t,e),n}function Tn(n,t){return n[0]=t[12],n[1]=t[13],n[2]=t[14],n}function Ca(n,t){var e=t[0],r=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return n[0]=Math.sqrt(e*e+r*r+i*i),n[1]=Math.sqrt(a*a+s*s+o*o),n[2]=Math.sqrt(l*l+c*c+u*u),n}function Js(n,t){var e=new X(3);Ca(e,t);var r=1/e[0],i=1/e[1],a=1/e[2],s=t[0]*r,o=t[1]*i,l=t[2]*a,c=t[4]*r,u=t[5]*i,h=t[6]*a,d=t[8]*r,f=t[9]*i,v=t[10]*a,g=s+u+v,p=0;return g>0?(p=Math.sqrt(g+1)*2,n[3]=.25*p,n[0]=(h-f)/p,n[1]=(d-l)/p,n[2]=(o-c)/p):s>u&&s>v?(p=Math.sqrt(1+s-u-v)*2,n[3]=(h-f)/p,n[0]=.25*p,n[1]=(o+c)/p,n[2]=(d+l)/p):u>v?(p=Math.sqrt(1+u-s-v)*2,n[3]=(d-l)/p,n[0]=(o+c)/p,n[1]=.25*p,n[2]=(h+f)/p):(p=Math.sqrt(1+v-s-u)*2,n[3]=(o-c)/p,n[0]=(d+l)/p,n[1]=(h+f)/p,n[2]=.25*p),n}function yd(n,t,e,r){t[0]=r[12],t[1]=r[13],t[2]=r[14];var i=r[0],a=r[1],s=r[2],o=r[4],l=r[5],c=r[6],u=r[8],h=r[9],d=r[10];e[0]=Math.sqrt(i*i+a*a+s*s),e[1]=Math.sqrt(o*o+l*l+c*c),e[2]=Math.sqrt(u*u+h*h+d*d);var f=1/e[0],v=1/e[1],g=1/e[2],p=i*f,y=a*v,b=s*g,E=o*f,O=l*v,P=c*g,L=u*f,F=h*v,I=d*g,V=p+O+I,Y=0;return V>0?(Y=Math.sqrt(V+1)*2,n[3]=.25*Y,n[0]=(P-F)/Y,n[1]=(L-b)/Y,n[2]=(y-E)/Y):p>O&&p>I?(Y=Math.sqrt(1+p-O-I)*2,n[3]=(P-F)/Y,n[0]=.25*Y,n[1]=(y+E)/Y,n[2]=(L+b)/Y):O>I?(Y=Math.sqrt(1+O-p-I)*2,n[3]=(L-b)/Y,n[0]=(y+E)/Y,n[1]=.25*Y,n[2]=(P+F)/Y):(Y=Math.sqrt(1+I-p-O)*2,n[3]=(y-E)/Y,n[0]=(L+b)/Y,n[1]=(P+F)/Y,n[2]=.25*Y),n}function bd(n,t,e,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,d=i*c,f=i*u,v=a*c,g=a*u,p=s*u,y=o*l,b=o*c,E=o*u,O=r[0],P=r[1],L=r[2];return n[0]=(1-(v+p))*O,n[1]=(d+E)*O,n[2]=(f-b)*O,n[3]=0,n[4]=(d-E)*P,n[5]=(1-(h+p))*P,n[6]=(g+y)*P,n[7]=0,n[8]=(f+b)*L,n[9]=(g-y)*L,n[10]=(1-(h+v))*L,n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function hs(n,t,e,r,i){var a=t[0],s=t[1],o=t[2],l=t[3],c=a+a,u=s+s,h=o+o,d=a*c,f=a*u,v=a*h,g=s*u,p=s*h,y=o*h,b=l*c,E=l*u,O=l*h,P=r[0],L=r[1],F=r[2],I=i[0],V=i[1],Y=i[2],J=(1-(g+y))*P,$=(f+O)*P,ot=(v-E)*P,ct=(f-O)*L,ft=(1-(d+y))*L,Nt=(p+b)*L,Ot=(v+E)*F,mt=(p-b)*F,yt=(1-(d+g))*F;return n[0]=J,n[1]=$,n[2]=ot,n[3]=0,n[4]=ct,n[5]=ft,n[6]=Nt,n[7]=0,n[8]=Ot,n[9]=mt,n[10]=yt,n[11]=0,n[12]=e[0]+I-(J*I+ct*V+Ot*Y),n[13]=e[1]+V-($*I+ft*V+mt*Y),n[14]=e[2]+Y-(ot*I+Nt*V+yt*Y),n[15]=1,n}function Wo(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=e+e,o=r+r,l=i+i,c=e*s,u=r*s,h=r*o,d=i*s,f=i*o,v=i*l,g=a*s,p=a*o,y=a*l;return n[0]=1-h-v,n[1]=u+y,n[2]=d-p,n[3]=0,n[4]=u-y,n[5]=1-c-v,n[6]=f+g,n[7]=0,n[8]=d+p,n[9]=f-g,n[10]=1-c-h,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function xd(n,t,e,r,i,a,s){var o=1/(e-t),l=1/(i-r),c=1/(a-s);return n[0]=a*2*o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a*2*l,n[6]=0,n[7]=0,n[8]=(e+t)*o,n[9]=(i+r)*l,n[10]=(s+a)*c,n[11]=-1,n[12]=0,n[13]=0,n[14]=s*a*2*c,n[15]=0,n}function Kl(n,t,e,r,i){var a=1/Math.tan(t/2);if(n[0]=a/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,i!=null&&i!==1/0){var s=1/(r-i);n[10]=(i+r)*s,n[14]=2*i*r*s}else n[10]=-1,n[14]=-2*r;return n}var Ed=Kl;function sw(n,t,e,r,i){var a=1/Math.tan(t/2);if(n[0]=a/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,i!=null&&i!==1/0){var s=1/(r-i);n[10]=i*s,n[14]=i*r*s}else n[10]=-1,n[14]=-r;return n}function ow(n,t,e,r){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),o=Math.tan(t.rightDegrees*Math.PI/180),l=2/(s+o),c=2/(i+a);return n[0]=l,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=c,n[6]=0,n[7]=0,n[8]=-((s-o)*l*.5),n[9]=(i-a)*c*.5,n[10]=r/(e-r),n[11]=-1,n[12]=0,n[13]=0,n[14]=r*e/(e-r),n[15]=0,n}function rg(n,t,e,r,i,a,s){var o=1/(t-e),l=1/(r-i),c=1/(a-s);return n[0]=-2*o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*l,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*c,n[11]=0,n[12]=(t+e)*o,n[13]=(i+r)*l,n[14]=(s+a)*c,n[15]=1,n}var ig=rg;function ag(n,t,e,r,i,a,s){var o=1/(t-e),l=1/(r-i),c=1/(a-s);return n[0]=-2*o,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*l,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=c,n[11]=0,n[12]=(t+e)*o,n[13]=(i+r)*l,n[14]=a*c,n[15]=1,n}function sg(n,t,e,r){var i,a,s,o,l,c,u,h,d,f,v=t[0],g=t[1],p=t[2],y=r[0],b=r[1],E=r[2],O=e[0],P=e[1],L=e[2];return Math.abs(v-O)<W&&Math.abs(g-P)<W&&Math.abs(p-L)<W?ge(n):(u=v-O,h=g-P,d=p-L,f=1/Math.sqrt(u*u+h*h+d*d),u*=f,h*=f,d*=f,i=b*d-E*h,a=E*u-y*d,s=y*h-b*u,f=Math.sqrt(i*i+a*a+s*s),f?(f=1/f,i*=f,a*=f,s*=f):(i=0,a=0,s=0),o=h*s-d*a,l=d*i-u*s,c=u*a-h*i,f=Math.sqrt(o*o+l*l+c*c),f?(f=1/f,o*=f,l*=f,c*=f):(o=0,l=0,c=0),n[0]=i,n[1]=o,n[2]=u,n[3]=0,n[4]=a,n[5]=l,n[6]=h,n[7]=0,n[8]=s,n[9]=c,n[10]=d,n[11]=0,n[12]=-(i*v+a*g+s*p),n[13]=-(o*v+l*g+c*p),n[14]=-(u*v+h*g+d*p),n[15]=1,n)}function lw(n,t,e,r){var i=t[0],a=t[1],s=t[2],o=r[0],l=r[1],c=r[2],u=i-e[0],h=a-e[1],d=s-e[2],f=u*u+h*h+d*d;f>0&&(f=1/Math.sqrt(f),u*=f,h*=f,d*=f);var v=l*d-c*h,g=c*u-o*d,p=o*h-l*u;return f=v*v+g*g+p*p,f>0&&(f=1/Math.sqrt(f),v*=f,g*=f,p*=f),n[0]=v,n[1]=g,n[2]=p,n[3]=0,n[4]=h*p-d*g,n[5]=d*v-u*p,n[6]=u*g-h*v,n[7]=0,n[8]=u,n[9]=h,n[10]=d,n[11]=0,n[12]=i,n[13]=a,n[14]=s,n[15]=1,n}function cw(n){return"mat4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9]+", "+n[10]+", "+n[11]+", "+n[12]+", "+n[13]+", "+n[14]+", "+n[15]+")"}function uw(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]+n[3]*n[3]+n[4]*n[4]+n[5]*n[5]+n[6]*n[6]+n[7]*n[7]+n[8]*n[8]+n[9]*n[9]+n[10]*n[10]+n[11]*n[11]+n[12]*n[12]+n[13]*n[13]+n[14]*n[14]+n[15]*n[15])}function hw(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n}function og(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n}function dw(n,t,e){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n}function fw(n,t,e,r){return n[0]=t[0]+e[0]*r,n[1]=t[1]+e[1]*r,n[2]=t[2]+e[2]*r,n[3]=t[3]+e[3]*r,n[4]=t[4]+e[4]*r,n[5]=t[5]+e[5]*r,n[6]=t[6]+e[6]*r,n[7]=t[7]+e[7]*r,n[8]=t[8]+e[8]*r,n[9]=t[9]+e[9]*r,n[10]=t[10]+e[10]*r,n[11]=t[11]+e[11]*r,n[12]=t[12]+e[12]*r,n[13]=t[13]+e[13]*r,n[14]=t[14]+e[14]*r,n[15]=t[15]+e[15]*r,n}function wd(n,t){return n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]&&n[3]===t[3]&&n[4]===t[4]&&n[5]===t[5]&&n[6]===t[6]&&n[7]===t[7]&&n[8]===t[8]&&n[9]===t[9]&&n[10]===t[10]&&n[11]===t[11]&&n[12]===t[12]&&n[13]===t[13]&&n[14]===t[14]&&n[15]===t[15]}function vw(n,t){var e=n[0],r=n[1],i=n[2],a=n[3],s=n[4],o=n[5],l=n[6],c=n[7],u=n[8],h=n[9],d=n[10],f=n[11],v=n[12],g=n[13],p=n[14],y=n[15],b=t[0],E=t[1],O=t[2],P=t[3],L=t[4],F=t[5],I=t[6],V=t[7],Y=t[8],J=t[9],$=t[10],ot=t[11],ct=t[12],ft=t[13],Nt=t[14],Ot=t[15];return Math.abs(e-b)<=W*Math.max(1,Math.abs(e),Math.abs(b))&&Math.abs(r-E)<=W*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(i-O)<=W*Math.max(1,Math.abs(i),Math.abs(O))&&Math.abs(a-P)<=W*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(s-L)<=W*Math.max(1,Math.abs(s),Math.abs(L))&&Math.abs(o-F)<=W*Math.max(1,Math.abs(o),Math.abs(F))&&Math.abs(l-I)<=W*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(c-V)<=W*Math.max(1,Math.abs(c),Math.abs(V))&&Math.abs(u-Y)<=W*Math.max(1,Math.abs(u),Math.abs(Y))&&Math.abs(h-J)<=W*Math.max(1,Math.abs(h),Math.abs(J))&&Math.abs(d-$)<=W*Math.max(1,Math.abs(d),Math.abs($))&&Math.abs(f-ot)<=W*Math.max(1,Math.abs(f),Math.abs(ot))&&Math.abs(v-ct)<=W*Math.max(1,Math.abs(v),Math.abs(ct))&&Math.abs(g-ft)<=W*Math.max(1,Math.abs(g),Math.abs(ft))&&Math.abs(p-Nt)<=W*Math.max(1,Math.abs(p),Math.abs(Nt))&&Math.abs(y-Ot)<=W*Math.max(1,Math.abs(y),Math.abs(Ot))}var lg=Jt,gw=og;function cg(){var n=new X(9);return X!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[5]=0,n[6]=0,n[7]=0),n[0]=1,n[4]=1,n[8]=1,n}function pw(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n}function ZB(n){var t=new glMatrix.ARRAY_TYPE(9);return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t}function WB(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n}function mw(n,t,e,r,i,a,s,o,l){var c=new X(9);return c[0]=n,c[1]=t,c[2]=e,c[3]=r,c[4]=i,c[5]=a,c[6]=s,c[7]=o,c[8]=l,c}function GB(n,t,e,r,i,a,s,o,l,c){return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n[4]=a,n[5]=s,n[6]=o,n[7]=l,n[8]=c,n}function VB(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=1,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n}function UB(n,t){if(n===t){var e=t[1],r=t[2],i=t[5];n[1]=t[3],n[2]=t[6],n[3]=e,n[5]=t[7],n[6]=r,n[7]=i}else n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8];return n}function YB(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=u*s-o*c,d=-u*a+o*l,f=c*a-s*l,v=e*h+r*d+i*f;return v?(v=1/v,n[0]=h*v,n[1]=(-u*r+i*c)*v,n[2]=(o*r-i*s)*v,n[3]=d*v,n[4]=(u*e-i*l)*v,n[5]=(-o*e+i*a)*v,n[6]=f*v,n[7]=(-c*e+r*l)*v,n[8]=(s*e-r*a)*v,n):null}function HB(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8];return n[0]=s*u-o*c,n[1]=i*c-r*u,n[2]=r*o-i*s,n[3]=o*l-a*u,n[4]=e*u-i*l,n[5]=i*a-e*o,n[6]=a*c-s*l,n[7]=r*l-e*c,n[8]=e*s-r*a,n}function XB(n){var t=n[0],e=n[1],r=n[2],i=n[3],a=n[4],s=n[5],o=n[6],l=n[7],c=n[8];return t*(c*a-s*l)+e*(-c*i+s*o)+r*(l*i-a*o)}function KB(n,t,e){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=e[0],f=e[1],v=e[2],g=e[3],p=e[4],y=e[5],b=e[6],E=e[7],O=e[8];return n[0]=d*r+f*s+v*c,n[1]=d*i+f*o+v*u,n[2]=d*a+f*l+v*h,n[3]=g*r+p*s+y*c,n[4]=g*i+p*o+y*u,n[5]=g*a+p*l+y*h,n[6]=b*r+E*s+O*c,n[7]=b*i+E*o+O*u,n[8]=b*a+E*l+O*h,n}function QB(n,t,e){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=e[0],f=e[1];return n[0]=r,n[1]=i,n[2]=a,n[3]=s,n[4]=o,n[5]=l,n[6]=d*r+f*s+c,n[7]=d*i+f*o+u,n[8]=d*a+f*l+h,n}function qB(n,t,e){var r=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=Math.sin(e),f=Math.cos(e);return n[0]=f*r+d*s,n[1]=f*i+d*o,n[2]=f*a+d*l,n[3]=f*s-d*r,n[4]=f*o-d*i,n[5]=f*l-d*a,n[6]=c,n[7]=u,n[8]=h,n}function JB(n,t,e){var r=e[0],i=e[1];return n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=i*t[3],n[4]=i*t[4],n[5]=i*t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n}function $B(n,t){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=1,n[5]=0,n[6]=t[0],n[7]=t[1],n[8]=1,n}function tF(n,t){var e=Math.sin(t),r=Math.cos(t);return n[0]=r,n[1]=e,n[2]=0,n[3]=-e,n[4]=r,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n}function eF(n,t){return n[0]=t[0],n[1]=0,n[2]=0,n[3]=0,n[4]=t[1],n[5]=0,n[6]=0,n[7]=0,n[8]=1,n}function nF(n,t){return n[0]=t[0],n[1]=t[1],n[2]=0,n[3]=t[2],n[4]=t[3],n[5]=0,n[6]=t[4],n[7]=t[5],n[8]=1,n}function rF(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=e+e,o=r+r,l=i+i,c=e*s,u=r*s,h=r*o,d=i*s,f=i*o,v=i*l,g=a*s,p=a*o,y=a*l;return n[0]=1-h-v,n[3]=u-y,n[6]=d+p,n[1]=u+y,n[4]=1-c-v,n[7]=f-g,n[2]=d-p,n[5]=f+g,n[8]=1-c-h,n}function iF(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],v=t[12],g=t[13],p=t[14],y=t[15],b=e*o-r*s,E=e*l-i*s,O=e*c-a*s,P=r*l-i*o,L=r*c-a*o,F=i*c-a*l,I=u*g-h*v,V=u*p-d*v,Y=u*y-f*v,J=h*p-d*g,$=h*y-f*g,ot=d*y-f*p,ct=b*ot-E*$+O*J+P*Y-L*V+F*I;return ct?(ct=1/ct,n[0]=(o*ot-l*$+c*J)*ct,n[1]=(l*Y-s*ot-c*V)*ct,n[2]=(s*$-o*Y+c*I)*ct,n[3]=(i*$-r*ot-a*J)*ct,n[4]=(e*ot-i*Y+a*V)*ct,n[5]=(r*Y-e*$-a*I)*ct,n[6]=(g*F-p*L+y*P)*ct,n[7]=(p*O-v*F-y*E)*ct,n[8]=(v*L-g*O+y*b)*ct,n):null}function aF(n,t,e){return n[0]=2/t,n[1]=0,n[2]=0,n[3]=0,n[4]=-2/e,n[5]=0,n[6]=-1,n[7]=1,n[8]=1,n}function sF(n){return"mat3("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+", "+n[8]+")"}function oF(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]+n[3]*n[3]+n[4]*n[4]+n[5]*n[5]+n[6]*n[6]+n[7]*n[7]+n[8]*n[8])}function lF(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n}function cF(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n}function uF(n,t,e){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n}function hF(n,t,e,r){return n[0]=t[0]+e[0]*r,n[1]=t[1]+e[1]*r,n[2]=t[2]+e[2]*r,n[3]=t[3]+e[3]*r,n[4]=t[4]+e[4]*r,n[5]=t[5]+e[5]*r,n[6]=t[6]+e[6]*r,n[7]=t[7]+e[7]*r,n[8]=t[8]+e[8]*r,n}function dF(n,t){return n[0]===t[0]&&n[1]===t[1]&&n[2]===t[2]&&n[3]===t[3]&&n[4]===t[4]&&n[5]===t[5]&&n[6]===t[6]&&n[7]===t[7]&&n[8]===t[8]}function fF(n,t){var e=n[0],r=n[1],i=n[2],a=n[3],s=n[4],o=n[5],l=n[6],c=n[7],u=n[8],h=t[0],d=t[1],f=t[2],v=t[3],g=t[4],p=t[5],y=t[6],b=t[7],E=t[8];return Math.abs(e-h)<=glMatrix.EPSILON*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(r-d)<=glMatrix.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(i-f)<=glMatrix.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-v)<=glMatrix.EPSILON*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(s-g)<=glMatrix.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(o-p)<=glMatrix.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(l-y)<=glMatrix.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(c-b)<=glMatrix.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(u-E)<=glMatrix.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))}var vF=null,gF=null;function Xn(){var n=new X(4);return X!=Float32Array&&(n[0]=0,n[1]=0,n[2]=0),n[3]=1,n}function pF(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function Na(n,t,e){e=e*.5;var r=Math.sin(e);return n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=Math.cos(e),n}function mF(n,t){var e=Math.acos(t[3])*2,r=Math.sin(e/2);return r>glMatrix.EPSILON?(n[0]=t[0]/r,n[1]=t[1]/r,n[2]=t[2]/r):(n[0]=1,n[1]=0,n[2]=0),e}function yF(n,t){var e=Sw(n,t);return Math.acos(2*e*e-1)}function ka(n,t,e){var r=t[0],i=t[1],a=t[2],s=t[3],o=e[0],l=e[1],c=e[2],u=e[3];return n[0]=r*u+s*o+i*c-a*l,n[1]=i*u+s*l+a*o-r*c,n[2]=a*u+s*c+r*l-i*o,n[3]=s*u-r*o-i*l-a*c,n}function bF(n,t,e){e*=.5;var r=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(e),l=Math.cos(e);return n[0]=r*l+s*o,n[1]=i*l+a*o,n[2]=a*l-i*o,n[3]=s*l-r*o,n}function xF(n,t,e){e*=.5;var r=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(e),l=Math.cos(e);return n[0]=r*l-a*o,n[1]=i*l+s*o,n[2]=a*l+r*o,n[3]=s*l-i*o,n}function EF(n,t,e){e*=.5;var r=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(e),l=Math.cos(e);return n[0]=r*l+i*o,n[1]=i*l-r*o,n[2]=a*l+s*o,n[3]=s*l-a*o,n}function wF(n,t){var e=t[0],r=t[1],i=t[2];return n[0]=e,n[1]=r,n[2]=i,n[3]=Math.sqrt(Math.abs(1-e*e-r*r-i*i)),n}function yw(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=Math.sqrt(e*e+r*r+i*i),o=Math.exp(a),l=s>0?o*Math.sin(s)/s:0;return n[0]=e*l,n[1]=r*l,n[2]=i*l,n[3]=o*Math.cos(s),n}function bw(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=Math.sqrt(e*e+r*r+i*i),o=s>0?Math.atan2(s,a)/s:0;return n[0]=e*o,n[1]=r*o,n[2]=i*o,n[3]=.5*Math.log(e*e+r*r+i*i+a*a),n}function SF(n,t,e){return bw(n,t),ww(n,n,e),yw(n,n),n}function Sd(n,t,e,r){var i=t[0],a=t[1],s=t[2],o=t[3],l=e[0],c=e[1],u=e[2],h=e[3],d,f,v,g,p;return f=i*l+a*c+s*u+o*h,f<0&&(f=-f,l=-l,c=-c,u=-u,h=-h),1-f>W?(d=Math.acos(f),v=Math.sin(d),g=Math.sin((1-r)*d)/v,p=Math.sin(r*d)/v):(g=1-r,p=r),n[0]=g*i+p*l,n[1]=g*a+p*c,n[2]=g*s+p*u,n[3]=g*o+p*h,n}function MF(n){var t=glMatrix.RANDOM(),e=glMatrix.RANDOM(),r=glMatrix.RANDOM(),i=Math.sqrt(1-t),a=Math.sqrt(t);return n[0]=i*Math.sin(2*Math.PI*e),n[1]=i*Math.cos(2*Math.PI*e),n[2]=a*Math.sin(2*Math.PI*r),n[3]=a*Math.cos(2*Math.PI*r),n}function Md(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=e*e+r*r+i*i+a*a,o=s?1/s:0;return n[0]=-e*o,n[1]=-r*o,n[2]=-i*o,n[3]=a*o,n}function AF(n,t){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=t[3],n}function xw(n,t){var e=t[0]+t[4]+t[8],r;if(e>0)r=Math.sqrt(e+1),n[3]=.5*r,r=.5/r,n[0]=(t[5]-t[7])*r,n[1]=(t[6]-t[2])*r,n[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),n[i]=.5*r,r=.5/r,n[3]=(t[a*3+s]-t[s*3+a])*r,n[a]=(t[a*3+i]+t[i*3+a])*r,n[s]=(t[s*3+i]+t[i*3+s])*r}return n}function Ql(n,t,e,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:rt,a=Math.PI/360;t*=a,r*=a,e*=a;var s=Math.sin(t),o=Math.cos(t),l=Math.sin(e),c=Math.cos(e),u=Math.sin(r),h=Math.cos(r);switch(i){case"xyz":n[0]=s*c*h+o*l*u,n[1]=o*l*h-s*c*u,n[2]=o*c*u+s*l*h,n[3]=o*c*h-s*l*u;break;case"xzy":n[0]=s*c*h-o*l*u,n[1]=o*l*h-s*c*u,n[2]=o*c*u+s*l*h,n[3]=o*c*h+s*l*u;break;case"yxz":n[0]=s*c*h+o*l*u,n[1]=o*l*h-s*c*u,n[2]=o*c*u-s*l*h,n[3]=o*c*h+s*l*u;break;case"yzx":n[0]=s*c*h+o*l*u,n[1]=o*l*h+s*c*u,n[2]=o*c*u-s*l*h,n[3]=o*c*h-s*l*u;break;case"zxy":n[0]=s*c*h-o*l*u,n[1]=o*l*h+s*c*u,n[2]=o*c*u+s*l*h,n[3]=o*c*h-s*l*u;break;case"zyx":n[0]=s*c*h-o*l*u,n[1]=o*l*h+s*c*u,n[2]=o*c*u-s*l*h,n[3]=o*c*h+s*l*u;break;default:throw new Error("Unknown angle order "+i)}return n}function TF(n){return"quat("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+")"}var OF=hd,Ew=Ui,ql=Oi,ug=zo,CF=Oa,hg=ka,ww=fd,Sw=H,NF=w,kF=gd,PF=null,RF=pd,LF=null,Jl=Xl,_F=st;function DF(n,t){return Math.abs(vec4.dot(n,t))>=1-glMatrix.EPSILON}var IF=function(){var n=pt(),t=Et(1,0,0),e=Et(0,1,0);return function(r,i,a){var s=ye(i,a);return s<-.999999?(de(n,t,i),us(n)<1e-6&&de(n,e,i),oe(n,n),Na(r,n,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(de(n,i,a),r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=1+s,Jl(r,r))}}(),BF=function(){var n=Xn(),t=Xn();return function(e,r,i,a,s,o){return Sd(n,r,s,o),Sd(t,i,a,o),Sd(e,n,t,2*o*(1-o)),e}}(),FF=function(){var n=cg();return function(t,e,r,i){return n[0]=r[0],n[3]=r[1],n[6]=r[2],n[1]=i[0],n[4]=i[1],n[7]=i[2],n[2]=-e[0],n[5]=-e[1],n[8]=-e[2],Jl(t,xw(t,n))}}();function Ad(){var n=new X(2);return X!=Float32Array&&(n[0]=0,n[1]=0),n}function zF(n){var t=new glMatrix.ARRAY_TYPE(2);return t[0]=n[0],t[1]=n[1],t}function jF(n,t){var e=new glMatrix.ARRAY_TYPE(2);return e[0]=n,e[1]=t,e}function Mw(n,t){return n[0]=t[0],n[1]=t[1],n}function Aw(n,t,e){return n[0]=t,n[1]=e,n}function ZF(n,t,e){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n}function WF(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n}function GF(n,t,e){return n[0]=t[0]*e[0],n[1]=t[1]*e[1],n}function VF(n,t,e){return n[0]=t[0]/e[0],n[1]=t[1]/e[1],n}function UF(n,t){return n[0]=Math.ceil(t[0]),n[1]=Math.ceil(t[1]),n}function YF(n,t){return n[0]=Math.floor(t[0]),n[1]=Math.floor(t[1]),n}function HF(n,t,e){return n[0]=Math.min(t[0],e[0]),n[1]=Math.min(t[1],e[1]),n}function XF(n,t,e){return n[0]=Math.max(t[0],e[0]),n[1]=Math.max(t[1],e[1]),n}function KF(n,t){return n[0]=glMatrix.round(t[0]),n[1]=glMatrix.round(t[1]),n}function QF(n,t,e){return n[0]=t[0]*e,n[1]=t[1]*e,n}function qF(n,t,e,r){return n[0]=t[0]+e[0]*r,n[1]=t[1]+e[1]*r,n}function JF(n,t){var e=t[0]-n[0],r=t[1]-n[1];return Math.sqrt(e*e+r*r)}function $F(n,t){var e=t[0]-n[0],r=t[1]-n[1];return e*e+r*r}function t8(n){var t=n[0],e=n[1];return Math.sqrt(t*t+e*e)}function e8(n){var t=n[0],e=n[1];return t*t+e*e}function n8(n,t){return n[0]=-t[0],n[1]=-t[1],n}function r8(n,t){return n[0]=1/t[0],n[1]=1/t[1],n}function Tw(n,t){var e=t[0],r=t[1],i=e*e+r*r;return i>0&&(i=1/Math.sqrt(i)),n[0]=t[0]*i,n[1]=t[1]*i,n}function Ow(n,t){return n[0]*t[0]+n[1]*t[1]}function i8(n,t,e){var r=t[0]*e[1]-t[1]*e[0];return n[0]=n[1]=0,n[2]=r,n}function a8(n,t,e,r){var i=t[0],a=t[1];return n[0]=i+r*(e[0]-i),n[1]=a+r*(e[1]-a),n}function s8(n,t){t=t===void 0?1:t;var e=glMatrix.RANDOM()*2*Math.PI;return n[0]=Math.cos(e)*t,n[1]=Math.sin(e)*t,n}function o8(n,t,e){var r=t[0],i=t[1];return n[0]=e[0]*r+e[2]*i,n[1]=e[1]*r+e[3]*i,n}function l8(n,t,e){var r=t[0],i=t[1];return n[0]=e[0]*r+e[2]*i+e[4],n[1]=e[1]*r+e[3]*i+e[5],n}function c8(n,t,e){var r=t[0],i=t[1];return n[0]=e[0]*r+e[3]*i+e[6],n[1]=e[1]*r+e[4]*i+e[7],n}function u8(n,t,e){var r=t[0],i=t[1];return n[0]=e[0]*r+e[4]*i+e[12],n[1]=e[1]*r+e[5]*i+e[13],n}function h8(n,t,e,r){var i=t[0]-e[0],a=t[1]-e[1],s=Math.sin(r),o=Math.cos(r);return n[0]=i*o-a*s+e[0],n[1]=i*s+a*o+e[1],n}function d8(n,t){var e=n[0],r=n[1],i=t[0],a=t[1];return Math.abs(Math.atan2(r*i-e*a,e*i+r*a))}function f8(n,t){var e=n[0],r=n[1],i=t[0],a=t[1];return Math.atan2(e*a-r*i,e*i+r*a)}function v8(n){return n[0]=0,n[1]=0,n}function g8(n){return"vec2("+n[0]+", "+n[1]+")"}function Cw(n,t){return n[0]===t[0]&&n[1]===t[1]}function p8(n,t){var e=n[0],r=n[1],i=t[0],a=t[1];return Math.abs(e-i)<=glMatrix.EPSILON*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(r-a)<=glMatrix.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))}var m8=null,y8=null,b8=null,x8=null,E8=null,w8=null,S8=null,M8=function(){var n=Ad();return function(t,e,r,i,a,s){var o,l;for(e||(e=2),r||(r=0),i?l=Math.min(i*e+r,t.length):l=t.length,o=r;o<l;o+=e)n[0]=t[o],n[1]=t[o+1],a(n,n,s),t[o]=n[0],t[o+1]=n[1];return t}}();function ie(n){return typeof n=="number"}function Zr(n,t){return Math.sqrt((n[0]-t[0])*(n[0]-t[0])+(n[1]-t[1])*(n[1]-t[1]))}function me(n){return n==null}function Ge(n){return typeof n=="string"}var Nw=function(n,t,e){return n<t?t:n>e?e:n},kn=Nw,G=S(80813),Go={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function dg(n){return Array.isArray(n)&&n.every(function(t){var e=t[0].toLowerCase();return Go[e]===t.length-1&&"achlmqstvz".includes(e)})}function fg(n){return dg(n)&&n.every(function(t){var e=t[0];return e===e.toUpperCase()})}function vg(n){return fg(n)&&n.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}var gg={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function pg(n){for(var t=n.pathValue[n.segmentStart],e=t.toLowerCase(),r=n.data;r.length>=Go[e]&&(e==="m"&&r.length>2?(n.segments.push([t].concat(r.splice(0,2))),e="l",t=t==="m"?"l":"L"):n.segments.push([t].concat(r.splice(0,Go[e]))),!!Go[e]););}function kw(n){var t=n.index,e=n.pathValue,r=e.charCodeAt(t);if(r===48){n.param=0,n.index+=1;return}if(r===49){n.param=1,n.index+=1;return}n.err='[path-util]: invalid Arc flag "'.concat(e[t],'", expecting 0 or 1 at index ').concat(t)}function Pw(n){return n>=48&&n<=57||n===43||n===45||n===46}function $s(n){return n>=48&&n<=57}function Rw(n){var t=n.max,e=n.pathValue,r=n.index,i=r,a=!1,s=!1,o=!1,l=!1,c;if(i>=t){n.err="[path-util]: Invalid path value at index ".concat(i,', "pathValue" is missing param');return}if(c=e.charCodeAt(i),(c===43||c===45)&&(i+=1,c=e.charCodeAt(i)),!$s(c)&&c!==46){n.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" is not a number');return}if(c!==46){if(a=c===48,i+=1,c=e.charCodeAt(i),a&&i<t&&c&&$s(c)){n.err="[path-util]: Invalid path value at index ".concat(r,', "').concat(e[r],'" illegal number');return}for(;i<t&&$s(e.charCodeAt(i));)i+=1,s=!0;c=e.charCodeAt(i)}if(c===46){for(l=!0,i+=1;$s(e.charCodeAt(i));)i+=1,o=!0;c=e.charCodeAt(i)}if(c===101||c===69){if(l&&!s&&!o){n.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" invalid float exponent');return}if(i+=1,c=e.charCodeAt(i),(c===43||c===45)&&(i+=1),i<t&&$s(e.charCodeAt(i)))for(;i<t&&$s(e.charCodeAt(i));)i+=1;else{n.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" invalid integer exponent');return}}n.index=i,n.param=+n.pathValue.slice(r,i)}function Lw(n){var t=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return n===10||n===13||n===8232||n===8233||n===32||n===9||n===11||n===12||n===160||n>=5760&&t.includes(n)}function $l(n){for(var t=n.pathValue,e=n.max;n.index<e&&Lw(t.charCodeAt(n.index));)n.index+=1}function _w(n){switch(n|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function Dw(n){return(n|32)===97}function Iw(n){var t=n.max,e=n.pathValue,r=n.index,i=e.charCodeAt(r),a=Go[e[r].toLowerCase()];if(n.segmentStart=r,!_w(i)){n.err='[path-util]: Invalid path value "'.concat(e[r],'" is not a path command');return}if(n.index+=1,$l(n),n.data=[],!a){pg(n);return}for(;;){for(var s=a;s>0;s-=1){if(Dw(i)&&(s===3||s===4)?kw(n):Rw(n),n.err.length)return;n.data.push(n.param),$l(n),n.index<t&&e.charCodeAt(n.index)===44&&(n.index+=1,$l(n))}if(n.index>=n.max||!Pw(e.charCodeAt(n.index)))break}pg(n)}var Bw=function(){function n(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return n}();function Fw(n){if(dg(n))return[].concat(n);var t=new Bw(n);for($l(t);t.index<t.max&&!t.err.length;)Iw(t);return t.err?t.err:t.segments}function zw(n){if(fg(n))return[].concat(n);var t=Fw(n),e=0,r=0,i=0,a=0;return t.map(function(s){var o=s.slice(1).map(Number),l=s[0],c=l.toUpperCase();if(l==="M")return e=o[0],r=o[1],i=e,a=r,["M",e,r];var u;if(l!==c)switch(c){case"A":u=[c,o[0],o[1],o[2],o[3],o[4],o[5]+e,o[6]+r];break;case"V":u=[c,o[0]+r];break;case"H":u=[c,o[0]+e];break;default:{var h=o.map(function(f,v){return f+(v%2?r:e)});u=[c].concat(h)}}else u=[c].concat(o);var d=u.length;switch(c){case"Z":e=i,r=a;break;case"H":e=u[1];break;case"V":r=u[1];break;default:e=u[d-2],r=u[d-1],c==="M"&&(i=e,a=r)}return u})}function jw(n,t){var e=n[0],r=t.x1,i=t.y1,a=t.x2,s=t.y2,o=n.slice(1).map(Number),l=n;if("TQ".includes(e)||(t.qx=null,t.qy=null),e==="H")l=["L",n[1],i];else if(e==="V")l=["L",r,n[1]];else if(e==="S"){var c=r*2-a,u=i*2-s;t.x1=c,t.y1=u,l=["C",c,u].concat(o)}else if(e==="T"){var h=r*2-t.qx,d=i*2-t.qy;t.qx=h,t.qy=d,l=["Q",h,d].concat(o)}else if(e==="Q"){var f=o[0],v=o[1];t.qx=f,t.qy=v}return l}function tc(n){if(vg(n))return[].concat(n);for(var t=zw(n),e=(0,G.pi)({},gg),r=0;r<t.length;r+=1){t[r]=jw(t[r],e);var i=t[r],a=i.length;e.x1=+i[a-2],e.y1=+i[a-1],e.x2=+i[a-4]||e.x1,e.y2=+i[a-3]||e.y1}return t}function Pa(n,t,e){var r=n[0],i=n[1],a=t[0],s=t[1];return[r+(a-r)*e,i+(s-i)*e]}function Td(n,t,e,r,i){var a=Zr([n,t],[e,r]),s={x:0,y:0};if(typeof i=="number")if(i<=0)s={x:n,y:t};else if(i>=a)s={x:e,y:r};else{var o=Pa([n,t],[e,r],i/a),l=o[0],c=o[1];s={x:l,y:c}}return{length:a,point:s,min:{x:Math.min(n,e),y:Math.min(t,r)},max:{x:Math.max(n,e),y:Math.max(t,r)}}}function mg(n,t){var e=n.x,r=n.y,i=t.x,a=t.y,s=e*i+r*a,o=Math.sqrt((Math.pow(e,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))),l=e*a-r*i<0?-1:1,c=l*Math.acos(s/o);return c}function Zw(n,t,e,r,i,a,s,o,l,c){var u=Math.abs,h=Math.sin,d=Math.cos,f=Math.sqrt,v=Math.PI,g=u(e),p=u(r),y=(i%360+360)%360,b=y*(v/180);if(n===o&&t===l)return{x:n,y:t};if(g===0||p===0)return Td(n,t,o,l,c).point;var E=(n-o)/2,O=(t-l)/2,P={x:d(b)*E+h(b)*O,y:-h(b)*E+d(b)*O},L=Math.pow(P.x,2)/Math.pow(g,2)+Math.pow(P.y,2)/Math.pow(p,2);L>1&&(g*=f(L),p*=f(L));var F=Math.pow(g,2)*Math.pow(p,2)-Math.pow(g,2)*Math.pow(P.y,2)-Math.pow(p,2)*Math.pow(P.x,2),I=Math.pow(g,2)*Math.pow(P.y,2)+Math.pow(p,2)*Math.pow(P.x,2),V=F/I;V=V<0?0:V;var Y=(a!==s?1:-1)*f(V),J={x:Y*(g*P.y/p),y:Y*(-(p*P.x)/g)},$={x:d(b)*J.x-h(b)*J.y+(n+o)/2,y:h(b)*J.x+d(b)*J.y+(t+l)/2},ot={x:(P.x-J.x)/g,y:(P.y-J.y)/p},ct=mg({x:1,y:0},ot),ft={x:(-P.x-J.x)/g,y:(-P.y-J.y)/p},Nt=mg(ot,ft);!s&&Nt>0?Nt-=2*v:s&&Nt<0&&(Nt+=2*v),Nt%=2*v;var Ot=ct+Nt*c,mt=g*d(Ot),yt=p*h(Ot),Rt={x:d(b)*mt-h(b)*yt+$.x,y:h(b)*mt+d(b)*yt+$.y};return Rt}function Ww(n,t,e,r,i,a,s,o,l,c,u){var h,d=u.bbox,f=d===void 0?!0:d,v=u.length,g=v===void 0?!0:v,p=u.sampleSize,y=p===void 0?30:p,b=typeof c=="number",E=n,O=t,P=0,L=[E,O,P],F=[E,O],I=0,V={x:0,y:0},Y=[{x:E,y:O}];b&&c<=0&&(V={x:E,y:O});for(var J=0;J<=y;J+=1){if(I=J/y,h=Zw(n,t,e,r,i,a,s,o,l,I),E=h.x,O=h.y,f&&Y.push({x:E,y:O}),g&&(P+=Zr(F,[E,O])),F=[E,O],b&&P>=c&&c>L[2]){var $=(P-c)/(P-L[2]);V={x:F[0]*(1-$)+L[0]*$,y:F[1]*(1-$)+L[1]*$}}L=[E,O,P]}return b&&c>=P&&(V={x:o,y:l}),{length:P,point:V,min:{x:Math.min.apply(null,Y.map(function(ot){return ot.x})),y:Math.min.apply(null,Y.map(function(ot){return ot.y}))},max:{x:Math.max.apply(null,Y.map(function(ot){return ot.x})),y:Math.max.apply(null,Y.map(function(ot){return ot.y}))}}}function Gw(n,t,e,r,i,a,s,o,l){var c=1-l;return{x:Math.pow(c,3)*n+3*Math.pow(c,2)*l*e+3*c*Math.pow(l,2)*i+Math.pow(l,3)*s,y:Math.pow(c,3)*t+3*Math.pow(c,2)*l*r+3*c*Math.pow(l,2)*a+Math.pow(l,3)*o}}function yg(n,t,e,r,i,a,s,o,l,c){var u,h=c.bbox,d=h===void 0?!0:h,f=c.length,v=f===void 0?!0:f,g=c.sampleSize,p=g===void 0?10:g,y=typeof l=="number",b=n,E=t,O=0,P=[b,E,O],L=[b,E],F=0,I={x:0,y:0},V=[{x:b,y:E}];y&&l<=0&&(I={x:b,y:E});for(var Y=0;Y<=p;Y+=1){if(F=Y/p,u=Gw(n,t,e,r,i,a,s,o,F),b=u.x,E=u.y,d&&V.push({x:b,y:E}),v&&(O+=Zr(L,[b,E])),L=[b,E],y&&O>=l&&l>P[2]){var J=(O-l)/(O-P[2]);I={x:L[0]*(1-J)+P[0]*J,y:L[1]*(1-J)+P[1]*J}}P=[b,E,O]}return y&&l>=O&&(I={x:s,y:o}),{length:O,point:I,min:{x:Math.min.apply(null,V.map(function($){return $.x})),y:Math.min.apply(null,V.map(function($){return $.y}))},max:{x:Math.max.apply(null,V.map(function($){return $.x})),y:Math.max.apply(null,V.map(function($){return $.y}))}}}function Vw(n,t,e,r,i,a,s){var o=1-s;return{x:Math.pow(o,2)*n+2*o*s*e+Math.pow(s,2)*i,y:Math.pow(o,2)*t+2*o*s*r+Math.pow(s,2)*a}}function Uw(n,t,e,r,i,a,s,o){var l,c=o.bbox,u=c===void 0?!0:c,h=o.length,d=h===void 0?!0:h,f=o.sampleSize,v=f===void 0?10:f,g=typeof s=="number",p=n,y=t,b=0,E=[p,y,b],O=[p,y],P=0,L={x:0,y:0},F=[{x:p,y}];g&&s<=0&&(L={x:p,y});for(var I=0;I<=v;I+=1){if(P=I/v,l=Vw(n,t,e,r,i,a,P),p=l.x,y=l.y,u&&F.push({x:p,y}),d&&(b+=Zr(O,[p,y])),O=[p,y],g&&b>=s&&s>E[2]){var V=(b-s)/(b-E[2]);L={x:O[0]*(1-V)+E[0]*V,y:O[1]*(1-V)+E[1]*V}}E=[p,y,b]}return g&&s>=b&&(L={x:i,y:a}),{length:b,point:L,min:{x:Math.min.apply(null,F.map(function(Y){return Y.x})),y:Math.min.apply(null,F.map(function(Y){return Y.y}))},max:{x:Math.max.apply(null,F.map(function(Y){return Y.x})),y:Math.max.apply(null,F.map(function(Y){return Y.y}))}}}function bg(n,t,e){for(var r,i,a,s,o,l,c=tc(n),u=typeof t=="number",h,d=[],f,v=0,g=0,p=0,y=0,b,E=[],O=[],P=0,L={x:0,y:0},F=L,I=L,V=L,Y=0,J=0,$=c.length;J<$;J+=1)b=c[J],f=b[0],h=f==="M",d=h?d:[v,g].concat(b.slice(1)),h?(p=b[1],y=b[2],L={x:p,y},F=L,P=0,u&&t<.001&&(V=L)):f==="L"?(r=Td(d[0],d[1],d[2],d[3],(t||0)-Y),P=r.length,L=r.min,F=r.max,I=r.point):f==="A"?(i=Ww(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(t||0)-Y,e||{}),P=i.length,L=i.min,F=i.max,I=i.point):f==="C"?(a=yg(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(t||0)-Y,e||{}),P=a.length,L=a.min,F=a.max,I=a.point):f==="Q"?(s=Uw(d[0],d[1],d[2],d[3],d[4],d[5],(t||0)-Y,e||{}),P=s.length,L=s.min,F=s.max,I=s.point):f==="Z"&&(d=[v,g,p,y],o=Td(d[0],d[1],d[2],d[3],(t||0)-Y),P=o.length,L=o.min,F=o.max,I=o.point),u&&Y<t&&Y+P>=t&&(V=I),O.push(F),E.push(L),Y+=P,l=f!=="Z"?b.slice(-2):[p,y],v=l[0],g=l[1];return u&&t>=Y&&(V={x:v,y:g}),{length:Y,point:V,min:{x:Math.min.apply(null,E.map(function(ot){return ot.x})),y:Math.min.apply(null,E.map(function(ot){return ot.y}))},max:{x:Math.max.apply(null,O.map(function(ot){return ot.x})),y:Math.max.apply(null,O.map(function(ot){return ot.y}))}}}function Yw(n,t){return bg(n,void 0,(0,G.pi)((0,G.pi)({},t),{bbox:!1,length:!0})).length}function Wr(n){return Array.isArray(n)}var ec=function(n){if(Wr(n))return n.reduce(function(t,e){return Math.min(t,e)},n[0])};function nc(n){if(!Array.isArray(n))return-1/0;var t=n.length;if(!t)return-1/0;for(var e=n[0],r=1;r<t;r++)e=Math.max(e,n[r]);return e}var Hw=1e-5;function Vo(n,t,e){return e===void 0&&(e=Hw),n===t||Math.abs(n-t)<e}var Xw=function(n,t){return(n%t+t)%t},xg=Xw;function Kw(n,t,e){if(n[e].length>7){n[e].shift();for(var r=n[e],i=e;r.length;)t[e]="A",n.splice(i+=1,0,["C"].concat(r.splice(0,6)));n.splice(e,1)}}function Qw(n){return vg(n)&&n.every(function(t){var e=t[0];return"MC".includes(e)})}function rc(n,t,e){var r=n*Math.cos(e)-t*Math.sin(e),i=n*Math.sin(e)+t*Math.cos(e);return{x:r,y:i}}function Od(n,t,e,r,i,a,s,o,l,c){var u=n,h=t,d=e,f=r,v=o,g=l,p=Math.PI*120/180,y=Math.PI/180*(+i||0),b=[],E,O,P,L,F;if(c)O=c[0],P=c[1],L=c[2],F=c[3];else{E=rc(u,h,-y),u=E.x,h=E.y,E=rc(v,g,-y),v=E.x,g=E.y;var I=(u-v)/2,V=(h-g)/2,Y=I*I/(d*d)+V*V/(f*f);Y>1&&(Y=Math.sqrt(Y),d*=Y,f*=Y);var J=d*d,$=f*f,ot=(a===s?-1:1)*Math.sqrt(Math.abs((J*$-J*V*V-$*I*I)/(J*V*V+$*I*I)));L=ot*d*V/f+(u+v)/2,F=ot*-f*I/d+(h+g)/2,O=Math.asin(((h-F)/f*Math.pow(10,9)>>0)/Math.pow(10,9)),P=Math.asin(((g-F)/f*Math.pow(10,9)>>0)/Math.pow(10,9)),O=u<L?Math.PI-O:O,P=v<L?Math.PI-P:P,O<0&&(O=Math.PI*2+O),P<0&&(P=Math.PI*2+P),s&&O>P&&(O-=Math.PI*2),!s&&P>O&&(P-=Math.PI*2)}var ct=P-O;if(Math.abs(ct)>p){var ft=P,Nt=v,Ot=g;P=O+p*(s&&P>O?1:-1),v=L+d*Math.cos(P),g=F+f*Math.sin(P),b=Od(v,g,d,f,i,0,s,Nt,Ot,[P,ft,L,F])}ct=P-O;var mt=Math.cos(O),yt=Math.sin(O),Rt=Math.cos(P),jt=Math.sin(P),Xt=Math.tan(ct/4),ee=4/3*d*Xt,ae=4/3*f*Xt,he=[u,h],ce=[u+ee*yt,h-ae*mt],xe=[v+ee*jt,g-ae*Rt],Ce=[v,g];if(ce[0]=2*he[0]-ce[0],ce[1]=2*he[1]-ce[1],c)return ce.concat(xe,Ce,b);b=ce.concat(xe,Ce,b);for(var je=[],Ue=0,or=b.length;Ue<or;Ue+=1)je[Ue]=Ue%2?rc(b[Ue-1],b[Ue],y).y:rc(b[Ue],b[Ue+1],y).x;return je}function qw(n,t,e,r,i,a){var s=.3333333333333333,o=2/3;return[s*n+o*e,s*t+o*r,s*i+o*e,s*a+o*r,i,a]}var Eg=function(n,t,e,r){var i=.5,a=Pa([n,t],[e,r],i);return(0,G.ev)((0,G.ev)([],a,!0),[e,r,e,r],!1)};function Jw(n,t){var e=n[0],r=n.slice(1).map(Number),i=r[0],a=r[1],s,o=t.x1,l=t.y1,c=t.x,u=t.y;switch("TQ".includes(e)||(t.qx=null,t.qy=null),e){case"M":return t.x=i,t.y=a,n;case"A":return s=[o,l].concat(r),["C"].concat(Od(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return t.qx=i,t.qy=a,s=[o,l].concat(r),["C"].concat(qw(s[0],s[1],s[2],s[3],s[4],s[5]));case"L":return["C"].concat(Eg(o,l,i,a));case"Z":return o===c&&l===u?["C",o,l,c,u,c,u]:["C"].concat(Eg(o,l,c,u));default:}return n}function Cd(n,t){if(t===void 0&&(t=!1),Qw(n)){var e=[].concat(n);return t?[e,[]]:e}for(var r=tc(n),i=(0,G.pi)({},gg),a=[],s="",o=r.length,l,c,u=[],h=0;h<o;h+=1){r[h]&&(s=r[h][0]),a[h]=s;var d=Jw(r[h],i);r[h]=d,Kw(r,a,h),o=r.length,s==="Z"&&u.push(h),l=r[h],c=l.length,i.x1=+l[c-2],i.y1=+l[c-1],i.x2=+l[c-4]||i.x1,i.y2=+l[c-3]||i.y1}return t?[r,u]:r}var $w=50;function t2(n,t){t===void 0&&(t=.5);var e=n.slice(0,2),r=n.slice(2,4),i=n.slice(4,6),a=n.slice(6,8),s=Pa(e,r,t),o=Pa(r,i,t),l=Pa(i,a,t),c=Pa(s,o,t),u=Pa(o,l,t),h=Pa(c,u,t);return[["C"].concat(s,c,h),["C"].concat(u,l,a)]}function wg(n){return n.map(function(t,e,r){var i=e&&r[e-1].slice(-2).concat(t.slice(1)),a=e?yg(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,s;return e?s=a?t2(i):[t,t]:s=[t],{s:t,ss:s,l:a}})}function Sg(n,t,e,r){if(r===void 0&&(r=0),r>$w)return console.warn("Maximum recursion depth reached in equalizeSegments"),[n,t];var i=wg(n),a=wg(t),s=i.length,o=a.length,l=i.filter(function(y){return y.l}).length,c=a.filter(function(y){return y.l}).length,u=i.filter(function(y){return y.l}).reduce(function(y,b){var E=b.l;return y+E},0)/l||0,h=a.filter(function(y){return y.l}).reduce(function(y,b){var E=b.l;return y+E},0)/c||0,d=e||Math.max(s,o),f=[u,h],v=[d-s,d-o],g=0,p=[i,a].map(function(y,b){return y.l===d?y.map(function(E){return E.s}):y.map(function(E,O){return g=O&&v[b]&&E.l>=f[b],v[b]-=g?1:0,g?E.ss:[E.s]}).flat()});return p[0].length===p[1].length?p:Sg(p[0],p[1],d,r+1)}function e2(n,t,e,r,i,a,s,o){return 3*((o-t)*(e+i)-(s-n)*(r+a)+r*(n-i)-e*(t-a)+o*(i+n/3)-s*(a+t/3))/20}function n2(n){var t=0,e=0,r=0;return Cd(n).map(function(i){var a;switch(i[0]){case"M":return t=i[1],e=i[2],0;default:var s=i.slice(1),o=s[0],l=s[1],c=s[2],u=s[3],h=s[4],d=s[5];return r=e2(t,e,o,l,c,u,h,d),a=i.slice(-2),t=a[0],e=a[1],r}}).reduce(function(i,a){return i+a},0)}function Mg(n){return n2(n)>=0}function r2(n){var t=n.slice(1).map(function(e,r,i){return r?i[r-1].slice(-2).concat(e.slice(1)):n[0].slice(1).concat(e.slice(1))}).map(function(e){return e.map(function(r,i){return e[e.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(t[0].slice(0,2))].concat(t.map(function(e){return["C"].concat(e.slice(2))}))}function i2(n){return n.map(function(t){return Array.isArray(t)?[].concat(t):t})}function a2(n){var t=n.length,e=t-1;return n.map(function(r,i){return n.map(function(a,s){var o=i+s,l;return s===0||n[o]&&n[o][0]==="M"?(l=n[o],["M"].concat(l.slice(-2))):(o>=t&&(o-=e),n[o])})})}function s2(n,t){var e=n.length-1,r=[],i=0,a=0,s=a2(n);return s.forEach(function(o,l){n.slice(1).forEach(function(c,u){a+=Zr(n[(l+u)%e].slice(-2),t[u%e].slice(-2))}),r[l]=a,a=0}),i=r.indexOf(Math.min.apply(null,r)),s[i]}var o2=function(n){return n===void 0},Te=o2,l2={}.toString,c2=function(n,t){return l2.call(n)==="[object "+t+"]"},Ag=c2,u2=function(n){return Ag(n,"Boolean")},Uo=u2;function fe(n){return typeof n=="function"}var Fn=function(n){var t=typeof n;return n!==null&&t==="object"||t==="function"};function h2(n,t,e){return bg(n,t,(0,G.pi)((0,G.pi)({},e),{bbox:!1,length:!0})).point}var se=S(20068),Tg=S(58289);function d2(n,t){for(;!{}.hasOwnProperty.call(n,t)&&(n=(0,Tg.Z)(n))!==null;);return n}function Nd(){return Nd=typeof Reflect!="undefined"&&Reflect.get?Reflect.get.bind():function(n,t,e){var r=d2(n,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?n:e):i.value}},Nd.apply(null,arguments)}function Og(n,t,e,r){var i=Nd((0,Tg.Z)(1&r?n.prototype:n),t,e);return 2&r&&typeof i=="function"?function(a){return i.apply(e,a)}:i}function Ar(n,t,e,r){var i=n-e,a=t-r;return Math.sqrt(i*i+a*a)}function ic(n,t){var e=Math.min.apply(Math,(0,k.Z)(n)),r=Math.min.apply(Math,(0,k.Z)(t)),i=Math.max.apply(Math,(0,k.Z)(n)),a=Math.max.apply(Math,(0,k.Z)(t));return{x:e,y:r,width:i-e,height:a-r}}function Cg(n){return(n+Math.PI*2)%(Math.PI*2)}function Ng(n,t){var e=Math.abs(n);return t>0?e:e*-1}function f2(n,t,e,r,i,a){var s=e,o=r;if(s===0||o===0)return{x:n,y:t};for(var l=i-n,c=a-t,u=Math.abs(l),h=Math.abs(c),d=s*s,f=o*o,v=Math.PI/4,g=0,p=0,y=0;y<4;y++){g=s*Math.cos(v),p=o*Math.sin(v);var b=(d-f)*Math.pow(Math.cos(v),3)/s,E=(f-d)*Math.pow(Math.sin(v),3)/o,O=g-b,P=p-E,L=u-b,F=h-E,I=Math.hypot(P,O),V=Math.hypot(F,L),Y=I*Math.asin((O*F-P*L)/(I*V)),J=Y/Math.sqrt(d+f-g*g-p*p);v+=J,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:n+Ng(g,l),y:t+Ng(p,c)}}function v2(n,t,e,r,i,a,s,o){return-1*e*Math.cos(i)*Math.sin(o)-r*Math.sin(i)*Math.cos(o)}function g2(n,t,e,r,i,a,s,o){return-1*e*Math.sin(i)*Math.sin(o)+r*Math.cos(i)*Math.cos(o)}function p2(n,t,e){return Math.atan(-t/n*Math.tan(e))}function m2(n,t,e){return Math.atan(t/(n*Math.tan(e)))}function y2(n,t,e,r,i,a){return e*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+n}function b2(n,t,e,r,i,a){return e*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+t}function x2(n,t,e,r){var i=Math.atan2(r*n,e*t);return(i+Math.PI*2)%(Math.PI*2)}function kg(n,t,e){return{x:n*Math.cos(e),y:t*Math.sin(e)}}function Pg(n,t,e){var r=Math.cos(e),i=Math.sin(e);return[n*r-t*i,n*i+t*r]}function E2(n,t,e,r,i,a,s){for(var o=p2(e,r,i),l=1/0,c=-1/0,u=[a,s],h=-Math.PI*2;h<=Math.PI*2;h+=Math.PI){var d=o+h;a<s?a<d&&d<s&&u.push(d):s<d&&d<a&&u.push(d)}for(var f=0;f<u.length;f++){var v=y2(n,t,e,r,i,u[f]);v<l&&(l=v),v>c&&(c=v)}for(var g=m2(e,r,i),p=1/0,y=-1/0,b=[a,s],E=-Math.PI*2;E<=Math.PI*2;E+=Math.PI){var O=g+E;a<s?a<O&&O<s&&b.push(O):s<O&&O<a&&b.push(O)}for(var P=0;P<b.length;P++){var L=b2(n,t,e,r,i,b[P]);L<p&&(p=L),L>y&&(y=L)}return{x:l,y:p,width:c-l,height:y-p}}function A8(n,t,e,r,i,a,s,o,l){var c=Pg(o-n,l-t,-i),u=_slicedToArray(c,2),h=u[0],d=u[1],f=f2(0,0,e,r,h,d),v=x2(e,r,f.x,f.y);v<a?f=kg(e,r,a):v>s&&(f=kg(e,r,s));var g=Pg(f.x,f.y,i);return{x:g[0]+n,y:g[1]+t}}function T8(n,t,e,r,i,a,s,o){var l=(s-a)*o+a,c=v2(n,t,e,r,i,a,s,l),u=g2(n,t,e,r,i,a,s,l);return Cg(Math.atan2(u,c))}var w2=1e-4;function Rg(n,t,e,r,i,a){var s=-1,o=1/0,l=[e,r],c=20;a&&a>200&&(c=a/10);for(var u=1/c,h=u/10,d=0;d<=c;d++){var f=d*u,v=[i.apply(void 0,(0,k.Z)(n.concat([f]))),i.apply(void 0,(0,k.Z)(t.concat([f])))],g=Ar(l[0],l[1],v[0],v[1]);g<o&&(s=f,o=g)}if(s===0)return{x:n[0],y:t[0]};if(s===1){var p=n.length;return{x:n[p-1],y:t[p-1]}}o=1/0;for(var y=0;y<32&&!(h<w2);y++){var b=s-h,E=s+h,O=[i.apply(void 0,(0,k.Z)(n.concat([b]))),i.apply(void 0,(0,k.Z)(t.concat([b])))],P=Ar(l[0],l[1],O[0],O[1]);if(b>=0&&P<o)s=b,o=P;else{var L=[i.apply(void 0,(0,k.Z)(n.concat([E]))),i.apply(void 0,(0,k.Z)(t.concat([E])))],F=Ar(l[0],l[1],L[0],L[1]);E<=1&&F<o?(s=E,o=F):h*=.5}}return{x:i.apply(void 0,(0,k.Z)(n.concat([s]))),y:i.apply(void 0,(0,k.Z)(t.concat([s])))}}function S2(n,t){for(var e=0,r=n.length,i=0;i<r;i++){var a=n[i],s=t[i],o=n[(i+1)%r],l=t[(i+1)%r];e+=Ar(a,s,o,l)}return e/2}function O8(n,t,e,r){return ic([n,e],[t,r])}function Lg(n,t,e,r){return Ar(n,t,e,r)}function Yi(n,t,e,r,i){return{x:(1-i)*n+i*e,y:(1-i)*t+i*r}}function M2(n,t,e,r,i,a){var s=(e-n)*(i-n)+(r-t)*(a-t);if(s<0)return Ar(n,t,i,a);var o=(e-n)*(e-n)+(r-t)*(r-t);return s>o?Ar(e,r,i,a):_g(n,t,e,r,i,a)}function _g(n,t,e,r,i,a){var s=[e-n,r-t];if(Cw(s,[0,0]))return Math.sqrt((i-n)*(i-n)+(a-t)*(a-t));var o=[-s[1],s[0]];Tw(o,o);var l=[i-n,a-t];return Math.abs(Ow(l,o))}function C8(n,t,e,r){return Math.atan2(r-t,e-n)}function ds(n,t,e,r,i){var a=1-i;return a*a*a*n+3*t*i*a*a+3*e*i*i*a+r*i*i*i}function Dg(n,t,e,r,i){var a=1-i;return 3*(a*a*(t-n)+2*a*i*(e-t)+i*i*(r-e))}function Ig(n,t,e,r){var i=-3*n+9*t-9*e+3*r,a=6*n-12*t+6*e,s=3*t-3*n,o=[],l,c,u;if(Vo(i,0))Vo(a,0)||(l=-s/a,l>=0&&l<=1&&o.push(l));else{var h=a*a-4*i*s;Vo(h,0)?o.push(-a/(2*i)):h>0&&(u=Math.sqrt(h),l=(-a+u)/(2*i),c=(-a-u)/(2*i),l>=0&&l<=1&&o.push(l),c>=0&&c<=1&&o.push(c))}return o}function A2(n,t,e,r,i,a,s,o,l){var c=ds(n,e,i,s,l),u=ds(t,r,a,o,l),h=Yi(n,t,e,r,l),d=Yi(e,r,i,a,l),f=Yi(i,a,s,o,l),v=Yi(h.x,h.y,d.x,d.y,l),g=Yi(d.x,d.y,f.x,f.y,l);return[[n,t,h.x,h.y,v.x,v.y,c,u],[c,u,g.x,g.y,f.x,f.y,s,o]]}function kd(n,t,e,r,i,a,s,o,l){if(l===0)return S2([n,e,i,s],[t,r,a,o]);var c=A2(n,t,e,r,i,a,s,o,.5),u=[].concat(_toConsumableArray(c[0]),[l-1]),h=[].concat(_toConsumableArray(c[1]),[l-1]);return kd.apply(void 0,_toConsumableArray(u))+kd.apply(void 0,_toConsumableArray(h))}function T2(n,t,e,r,i,a,s,o){for(var l=[n,s],c=[t,o],u=Ig(n,e,i,s),h=Ig(t,r,a,o),d=0;d<u.length;d++)l.push(ds(n,e,i,s,u[d]));for(var f=0;f<h.length;f++)c.push(ds(t,r,a,o,h[f]));return ic(l,c)}function N8(n,t,e,r,i,a,s,o){return kd(n,t,e,r,i,a,s,o,3)}function O2(n,t,e,r,i,a,s,o,l,c,u){return Rg([n,e,i,s],[t,r,a,o],l,c,ds,u)}function Bg(n,t,e,r,i,a,s,o,l,c,u){var h=O2(n,t,e,r,i,a,s,o,l,c,u);return Ar(h.x,h.y,l,c)}function k8(n,t,e,r,i,a,s,o,l){return{x:ds(n,e,i,s,l),y:ds(t,r,a,o,l)}}function P8(n,t,e,r,i,a,s,o,l){var c=Dg(n,e,i,s,l),u=Dg(t,r,a,o,l);return Cg(Math.atan2(u,c))}function Fg(n){for(var t=0,e=[],r=0;r<n.length-1;r++){var i=n[r],a=n[r+1],s=Ar(i[0],i[1],a[0],a[1]),o={from:i,to:a,length:s};e.push(o),t+=s}return{segments:e,totalLength:t}}function zg(n){if(n.length<2)return 0;for(var t=0,e=0;e<n.length-1;e++){var r=n[e],i=n[e+1];t+=Ar(r[0],r[1],i[0],i[1])}return t}function jg(n,t){if(t>1||t<0||n.length<2)return null;var e=Fg(n),r=e.segments,i=e.totalLength;if(i===0)return{x:n[0][0],y:n[0][1]};for(var a=0,s=null,o=0;o<r.length;o++){var l=r[o],c=l.from,u=l.to,h=l.length/i;if(t>=a&&t<=a+h){var d=(t-a)/h;s=Yi(c[0],c[1],u[0],u[1],d);break}a+=h}return s}function Zg(n,t){if(t>1||t<0||n.length<2)return 0;for(var e=Fg(n),r=e.segments,i=e.totalLength,a=0,s=0,o=0;o<r.length;o++){var l=r[o],c=l.from,u=l.to,h=l.length/i;if(t>=a&&t<=a+h){s=Math.atan2(u[1]-c[1],u[0]-c[0]);break}a+=h}return s}function Wg(n,t,e){for(var r=1/0,i=0;i<n.length-1;i++){var a=n[i],s=n[i+1],o=M2(a[0],a[1],s[0],s[1],t,e);o<r&&(r=o)}return r}function C2(n){for(var t=[],e=[],r=0;r<n.length;r++){var i=n[r];t.push(i[0]),e.push(i[1])}return ic(t,e)}function N2(n){return zg(n)}function R8(n,t){return jg(n,t)}function L8(n,t,e){return Wg(n,t,e)}function _8(n,t){return Zg(n,t)}function ac(n){var t=n.slice(0);return n.length&&t.push(n[0]),t}function D8(n){return C2(n)}function I8(n){return zg(ac(n))}function B8(n,t){return jg(ac(n),t)}function F8(n,t,e){return Wg(ac(n),t,e)}function z8(n,t){return Zg(ac(n),t)}function Yo(n,t,e,r){var i=1-r;return i*i*n+2*r*i*t+r*r*e}function Gg(n,t,e){var r=n+e-2*t;if(Vo(r,0))return[.5];var i=(n-t)/r;return i<=1&&i>=0?[i]:[]}function k2(n,t,e,r,i,a,s){var o=Yo(n,e,i,s),l=Yo(t,r,a,s),c=Yi(n,t,e,r,s),u=Yi(e,r,i,a,s);return[[n,t,c.x,c.y,o,l],[o,l,u.x,u.y,i,a]]}function Pd(n,t,e,r,i,a,s){if(s===0)return(Ar(n,t,e,r)+Ar(e,r,i,a)+Ar(n,t,i,a))/2;var o=k2(n,t,e,r,i,a,.5),l=o[0],c=o[1];return l.push(s-1),c.push(s-1),Pd.apply(void 0,_toConsumableArray(l))+Pd.apply(void 0,_toConsumableArray(c))}function P2(n,t,e,r,i,a){var s=Gg(n,e,i)[0],o=Gg(t,r,a)[0],l=[n,i],c=[t,a];return s!==void 0&&l.push(Yo(n,e,i,s)),o!==void 0&&c.push(Yo(t,r,a,o)),ic(l,c)}function j8(n,t,e,r,i,a){return Pd(n,t,e,r,i,a,3)}function R2(n,t,e,r,i,a,s,o){return Rg([n,e,i],[t,r,a],s,o,Yo)}function L2(n,t,e,r,i,a,s,o){var l=R2(n,t,e,r,i,a,s,o);return Ar(l.x,l.y,s,o)}var Tr=S(75044),Ra=S(3202),fs=S(19251),vs=S(75931);var _2=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof S.g!="undefined"?S.g:typeof self!="undefined"?self:{},Vg={exports:{}};(function(n,t){(function(e,r){n.exports=r()})(_2,function(){function e(P,L,F,I,V){r(P,L,F||0,I||P.length-1,V||a)}function r(P,L,F,I,V){for(;I>F;){if(I-F>600){var Y=I-F+1,J=L-F+1,$=Math.log(Y),ot=.5*Math.exp(2*$/3),ct=.5*Math.sqrt($*ot*(Y-ot)/Y)*(J-Y/2<0?-1:1),ft=Math.max(F,Math.floor(L-J*ot/Y+ct)),Nt=Math.min(I,Math.floor(L+(Y-J)*ot/Y+ct));r(P,L,ft,Nt,V)}var Ot=P[L],mt=F,yt=I;for(i(P,F,L),V(P[I],Ot)>0&&i(P,F,I);mt<yt;){for(i(P,mt,yt),mt++,yt--;V(P[mt],Ot)<0;)mt++;for(;V(P[yt],Ot)>0;)yt--}V(P[F],Ot)===0?i(P,F,yt):(yt++,i(P,yt,I)),yt<=L&&(F=yt+1),L<=yt&&(I=yt-1)}}function i(P,L,F){var I=P[L];P[L]=P[F],P[F]=I}function a(P,L){return P<L?-1:P>L?1:0}var s=function(L){L===void 0&&(L=9),this._maxEntries=Math.max(4,L),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(L){var F=this.data,I=[];if(!b(L,F))return I;for(var V=this.toBBox,Y=[];F;){for(var J=0;J<F.children.length;J++){var $=F.children[J],ot=F.leaf?V($):$;b(L,ot)&&(F.leaf?I.push($):y(L,ot)?this._all($,I):Y.push($))}F=Y.pop()}return I},s.prototype.collides=function(L){var F=this.data;if(!b(L,F))return!1;for(var I=[];F;){for(var V=0;V<F.children.length;V++){var Y=F.children[V],J=F.leaf?this.toBBox(Y):Y;if(b(L,J)){if(F.leaf||y(L,J))return!0;I.push(Y)}}F=I.pop()}return!1},s.prototype.load=function(L){if(!(L&&L.length))return this;if(L.length<this._minEntries){for(var F=0;F<L.length;F++)this.insert(L[F]);return this}var I=this._build(L.slice(),0,L.length-1,0);if(!this.data.children.length)this.data=I;else if(this.data.height===I.height)this._splitRoot(this.data,I);else{if(this.data.height<I.height){var V=this.data;this.data=I,I=V}this._insert(I,this.data.height-I.height-1,!0)}return this},s.prototype.insert=function(L){return L&&this._insert(L,this.data.height-1),this},s.prototype.clear=function(){return this.data=E([]),this},s.prototype.remove=function(L,F){if(!L)return this;for(var I=this.data,V=this.toBBox(L),Y=[],J=[],$,ot,ct;I||Y.length;){if(I||(I=Y.pop(),ot=Y[Y.length-1],$=J.pop(),ct=!0),I.leaf){var ft=o(L,I.children,F);if(ft!==-1)return I.children.splice(ft,1),Y.push(I),this._condense(Y),this}!ct&&!I.leaf&&y(I,V)?(Y.push(I),J.push($),$=0,ot=I,I=I.children[0]):ot?($++,I=ot.children[$],ct=!1):I=null}return this},s.prototype.toBBox=function(L){return L},s.prototype.compareMinX=function(L,F){return L.minX-F.minX},s.prototype.compareMinY=function(L,F){return L.minY-F.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(L){return this.data=L,this},s.prototype._all=function(L,F){for(var I=[];L;)L.leaf?F.push.apply(F,L.children):I.push.apply(I,L.children),L=I.pop();return F},s.prototype._build=function(L,F,I,V){var Y=I-F+1,J=this._maxEntries,$;if(Y<=J)return $=E(L.slice(F,I+1)),l($,this.toBBox),$;V||(V=Math.ceil(Math.log(Y)/Math.log(J)),J=Math.ceil(Y/Math.pow(J,V-1))),$=E([]),$.leaf=!1,$.height=V;var ot=Math.ceil(Y/J),ct=ot*Math.ceil(Math.sqrt(J));O(L,F,I,ct,this.compareMinX);for(var ft=F;ft<=I;ft+=ct){var Nt=Math.min(ft+ct-1,I);O(L,ft,Nt,ot,this.compareMinY);for(var Ot=ft;Ot<=Nt;Ot+=ot){var mt=Math.min(Ot+ot-1,Nt);$.children.push(this._build(L,Ot,mt,V-1))}}return l($,this.toBBox),$},s.prototype._chooseSubtree=function(L,F,I,V){for(;V.push(F),!(F.leaf||V.length-1===I);){for(var Y=1/0,J=1/0,$=void 0,ot=0;ot<F.children.length;ot++){var ct=F.children[ot],ft=f(ct),Nt=g(L,ct)-ft;Nt<J?(J=Nt,Y=ft<Y?ft:Y,$=ct):Nt===J&&ft<Y&&(Y=ft,$=ct)}F=$||F.children[0]}return F},s.prototype._insert=function(L,F,I){var V=I?L:this.toBBox(L),Y=[],J=this._chooseSubtree(V,this.data,F,Y);for(J.children.push(L),u(J,V);F>=0&&Y[F].children.length>this._maxEntries;)this._split(Y,F),F--;this._adjustParentBBoxes(V,Y,F)},s.prototype._split=function(L,F){var I=L[F],V=I.children.length,Y=this._minEntries;this._chooseSplitAxis(I,Y,V);var J=this._chooseSplitIndex(I,Y,V),$=E(I.children.splice(J,I.children.length-J));$.height=I.height,$.leaf=I.leaf,l(I,this.toBBox),l($,this.toBBox),F?L[F-1].children.push($):this._splitRoot(I,$)},s.prototype._splitRoot=function(L,F){this.data=E([L,F]),this.data.height=L.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(L,F,I){for(var V,Y=1/0,J=1/0,$=F;$<=I-F;$++){var ot=c(L,0,$,this.toBBox),ct=c(L,$,I,this.toBBox),ft=p(ot,ct),Nt=f(ot)+f(ct);ft<Y?(Y=ft,V=$,J=Nt<J?Nt:J):ft===Y&&Nt<J&&(J=Nt,V=$)}return V||I-F},s.prototype._chooseSplitAxis=function(L,F,I){var V=L.leaf?this.compareMinX:h,Y=L.leaf?this.compareMinY:d,J=this._allDistMargin(L,F,I,V),$=this._allDistMargin(L,F,I,Y);J<$&&L.children.sort(V)},s.prototype._allDistMargin=function(L,F,I,V){L.children.sort(V);for(var Y=this.toBBox,J=c(L,0,F,Y),$=c(L,I-F,I,Y),ot=v(J)+v($),ct=F;ct<I-F;ct++){var ft=L.children[ct];u(J,L.leaf?Y(ft):ft),ot+=v(J)}for(var Nt=I-F-1;Nt>=F;Nt--){var Ot=L.children[Nt];u($,L.leaf?Y(Ot):Ot),ot+=v($)}return ot},s.prototype._adjustParentBBoxes=function(L,F,I){for(var V=I;V>=0;V--)u(F[V],L)},s.prototype._condense=function(L){for(var F=L.length-1,I=void 0;F>=0;F--)L[F].children.length===0?F>0?(I=L[F-1].children,I.splice(I.indexOf(L[F]),1)):this.clear():l(L[F],this.toBBox)};function o(P,L,F){if(!F)return L.indexOf(P);for(var I=0;I<L.length;I++)if(F(P,L[I]))return I;return-1}function l(P,L){c(P,0,P.children.length,L,P)}function c(P,L,F,I,V){V||(V=E(null)),V.minX=1/0,V.minY=1/0,V.maxX=-1/0,V.maxY=-1/0;for(var Y=L;Y<F;Y++){var J=P.children[Y];u(V,P.leaf?I(J):J)}return V}function u(P,L){return P.minX=Math.min(P.minX,L.minX),P.minY=Math.min(P.minY,L.minY),P.maxX=Math.max(P.maxX,L.maxX),P.maxY=Math.max(P.maxY,L.maxY),P}function h(P,L){return P.minX-L.minX}function d(P,L){return P.minY-L.minY}function f(P){return(P.maxX-P.minX)*(P.maxY-P.minY)}function v(P){return P.maxX-P.minX+(P.maxY-P.minY)}function g(P,L){return(Math.max(L.maxX,P.maxX)-Math.min(L.minX,P.minX))*(Math.max(L.maxY,P.maxY)-Math.min(L.minY,P.minY))}function p(P,L){var F=Math.max(P.minX,L.minX),I=Math.max(P.minY,L.minY),V=Math.min(P.maxX,L.maxX),Y=Math.min(P.maxY,L.maxY);return Math.max(0,V-F)*Math.max(0,Y-I)}function y(P,L){return P.minX<=L.minX&&P.minY<=L.minY&&L.maxX<=P.maxX&&L.maxY<=P.maxY}function b(P,L){return L.minX<=P.maxX&&L.minY<=P.maxY&&L.maxX>=P.minX&&L.maxY>=P.minY}function E(P){return{children:P,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function O(P,L,F,I,V){for(var Y=[L,F];Y.length;)if(F=Y.pop(),L=Y.pop(),!(F-L<=I)){var J=L+Math.ceil((F-L)/I/2)*I;e(P,J,L,F,V),Y.push(L,J,J,F)}}return s})})(Vg);var D2=Vg.exports,Dt=function(n){return n.GROUP="g",n.FRAGMENT="fragment",n.CIRCLE="circle",n.ELLIPSE="ellipse",n.IMAGE="image",n.RECT="rect",n.LINE="line",n.POLYLINE="polyline",n.POLYGON="polygon",n.TEXT="text",n.PATH="path",n.HTML="html",n.MESH="mesh",n}({}),sc=function(n){return n[n.ZERO=0]="ZERO",n[n.NEGATIVE_ONE=1]="NEGATIVE_ONE",n}({}),La=function(){function n(){(0,N.Z)(this,n),this.plugins=[]}return(0,T.Z)(n,[{key:"addRenderingPlugin",value:function(e){this.plugins.push(e),this.context.renderingPlugins.push(e)}},{key:"removeAllRenderingPlugins",value:function(){var e=this;this.plugins.forEach(function(r){var i=e.context.renderingPlugins.indexOf(r);i>=0&&e.context.renderingPlugins.splice(i,1)})}}])}(),I2=function(){function n(t){(0,N.Z)(this,n),this.clipSpaceNearZ=sc.NEGATIVE_ONE,this.plugins=[],this.config=(0,B.Z)({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},t)}return(0,T.Z)(n,[{key:"registerPlugin",value:function(e){var r=this.plugins.findIndex(function(i){return i===e});r===-1&&this.plugins.push(e)}},{key:"unregisterPlugin",value:function(e){var r=this.plugins.findIndex(function(i){return i===e});r>-1&&this.plugins.splice(r,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(e){return this.plugins.find(function(r){return r.name===e})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(e){Object.assign(this.config,e)}}])}(),Rd=Ut,to=kt,B2=la,F2=$r,Ug=Pt,Ld=qs,pn=function(){function n(){(0,N.Z)(this,n),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return(0,T.Z)(n,[{key:"update",value:function(e,r){to(this.center,e),to(this.halfExtents,r),Ld(this.min,this.center,this.halfExtents),Rd(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(e,r){Rd(this.center,r,e),Ug(this.center,this.center,.5),Ld(this.halfExtents,r,e),Ug(this.halfExtents,this.halfExtents,.5),to(this.min,e),to(this.max,r)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!n.isEmpty(e)){if(n.isEmpty(this)){this.setMinMax(e.getMin(),e.getMax());return}var r=this.center,i=r[0],a=r[1],s=r[2],o=this.halfExtents,l=o[0],c=o[1],u=o[2],h=i-l,d=i+l,f=a-c,v=a+c,g=s-u,p=s+u,y=e.center,b=y[0],E=y[1],O=y[2],P=e.halfExtents,L=P[0],F=P[1],I=P[2],V=b-L,Y=b+L,J=E-F,$=E+F,ot=O-I,ct=O+I;V<h&&(h=V),Y>d&&(d=Y),J<f&&(f=J),$>v&&(v=$),ot<g&&(g=ot),ct>p&&(p=ct),r[0]=(h+d)*.5,r[1]=(f+v)*.5,r[2]=(g+p)*.5,o[0]=(d-h)*.5,o[1]=(v-f)*.5,o[2]=(p-g)*.5,this.min[0]=h,this.min[1]=f,this.min[2]=g,this.max[0]=d,this.max[1]=v,this.max[2]=p}}},{key:"setFromTransformedAABB",value:function(e,r){var i=this.center,a=this.halfExtents,s=e.center,o=e.halfExtents,l=r[0],c=r[4],u=r[8],h=r[1],d=r[5],f=r[9],v=r[2],g=r[6],p=r[10],y=Math.abs(l),b=Math.abs(c),E=Math.abs(u),O=Math.abs(h),P=Math.abs(d),L=Math.abs(f),F=Math.abs(v),I=Math.abs(g),V=Math.abs(p);i[0]=r[12]+l*s[0]+c*s[1]+u*s[2],i[1]=r[13]+h*s[0]+d*s[1]+f*s[2],i[2]=r[14]+v*s[0]+g*s[1]+p*s[2],a[0]=y*o[0]+b*o[1]+E*o[2],a[1]=O*o[0]+P*o[1]+L*o[2],a[2]=F*o[0]+I*o[1]+V*o[2],Ld(this.min,i,a),Rd(this.max,i,a)}},{key:"intersects",value:function(e){var r=this.getMax(),i=this.getMin(),a=e.getMax(),s=e.getMin();return i[0]<=a[0]&&r[0]>=s[0]&&i[1]<=a[1]&&r[1]>=s[1]&&i[2]<=a[2]&&r[2]>=s[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var r=new n,i=B2([0,0,0],this.getMin(),e.getMin()),a=F2([0,0,0],this.getMax(),e.getMax());return r.setMinMax(i,a),r}},{key:"getNegativeFarPoint",value:function(e){return e.pnVertexFlag===273?to([0,0,0],this.min):e.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:e.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(e){return e.pnVertexFlag===273?to([0,0,0],this.max):e.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:e.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(e){return!e||e.halfExtents[0]===0&&e.halfExtents[1]===0&&e.halfExtents[2]===0}}])}(),z2=function(){function n(t,e){(0,N.Z)(this,n),this.distance=t||0,this.normal=e||Et(0,1,0),this.updatePNVertexFlag()}return(0,T.Z)(n,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(e){return ye(e,this.normal)-this.distance}},{key:"normalize",value:function(){var e=1/us(this.normal);Pt(this.normal,this.normal,e),this.distance*=e}},{key:"intersectsLine",value:function(e,r,i){var a=this.distanceToPoint(e),s=this.distanceToPoint(r),o=a/(a-s),l=o>=0&&o<=1;return l&&i&&_e(i,e,r,o),l}}])}(),eo=function(n){return n[n.OUTSIDE=4294967295]="OUTSIDE",n[n.INSIDE=0]="INSIDE",n[n.INDETERMINATE=2147483647]="INDETERMINATE",n}({}),j2=function(){function n(t){if((0,N.Z)(this,n),this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new z2)}return(0,T.Z)(n,[{key:"extractFromVPMatrix",value:function(e){var r=(0,R.Z)(e,16),i=r[0],a=r[1],s=r[2],o=r[3],l=r[4],c=r[5],u=r[6],h=r[7],d=r[8],f=r[9],v=r[10],g=r[11],p=r[12],y=r[13],b=r[14],E=r[15];zt(this.planes[0].normal,o-i,h-l,g-d),this.planes[0].distance=E-p,zt(this.planes[1].normal,o+i,h+l,g+d),this.planes[1].distance=E+p,zt(this.planes[2].normal,o+a,h+c,g+f),this.planes[2].distance=E+y,zt(this.planes[3].normal,o-a,h-c,g-f),this.planes[3].distance=E-y,zt(this.planes[4].normal,o-s,h-u,g-v),this.planes[4].distance=E-b,zt(this.planes[5].normal,o+s,h+u,g+v),this.planes[5].distance=E+b,this.planes.forEach(function(O){O.normalize(),O.updatePNVertexFlag()})}}])}(),vr=function(){function n(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;(0,N.Z)(this,n),this.x=0,this.y=0,this.x=t,this.y=e}return(0,T.Z)(n,[{key:"clone",value:function(){return new n(this.x,this.y)}},{key:"copyFrom",value:function(e){this.x=e.x,this.y=e.y}}])}(),no=function(){function n(t,e,r,i){(0,N.Z)(this,n),this.x=t,this.y=e,this.width=r,this.height=i,this.left=t,this.right=t+r,this.top=e,this.bottom=e+i}return(0,T.Z)(n,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new n(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,r){var i=Ui(e.x,e.y,0,1),a=Ui(e.x+e.width,e.y,0,1),s=Ui(e.x,e.y+e.height,0,1),o=Ui(e.x+e.width,e.y+e.height,0,1),l=An(),c=An(),u=An(),h=An();M(l,i,r),M(c,a,r),M(u,s,r),M(h,o,r);var d=Math.min(l[0],c[0],u[0],h[0]),f=Math.min(l[1],c[1],u[1],h[1]),v=Math.max(l[0],c[0],u[0],h[0]),g=Math.max(l[1],c[1],u[1],h[1]);return n.fromRect({x:d,y:f,width:v-d,height:g-f})}}])}(),rn="Method not implemented.",ro="Use document.documentElement instead.",Z2="Cannot append a destroyed element.";function io(n){return n===void 0?0:n>360||n<-360?n%360:n}var _d=pt();function Dr(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;return Array.isArray(n)&&n.length===3?r?wt(n):kt(_d,n):ie(n)?r?Et(n,t,e):zt(_d,n,t,e):r?Et(n[0],n[1]||t,n[2]||e):zt(_d,n[0],n[1]||t,n[2]||e)}var W2=Math.PI/180;function an(n){return n*W2}var G2=180/Math.PI;function Gr(n){return n*G2}var V2=.9;function Z8(n){return n%=400,n<0&&(n+=400),n*V2}function W8(n){return n/360}function U2(n){return 360*n}var oc=Math.PI/2;function Y2(n,t){var e=t[0],r=t[1],i=t[2],a=t[3],s=e*e,o=r*r,l=i*i,c=a*a,u=s+o+l+c,h=e*a-r*i;return h>.499995*u?(n[0]=oc,n[1]=2*Math.atan2(r,e),n[2]=0):h<-.499995*u?(n[0]=-oc,n[1]=2*Math.atan2(r,e),n[2]=0):(n[0]=Math.asin(2*(e*i-a*r)),n[1]=Math.atan2(2*(e*a+r*i),1-2*(l+c)),n[2]=Math.atan2(2*(e*r+i*a),1-2*(o+l))),n}function H2(n,t){var e,r,i=Ca(pt(),t),a=(0,R.Z)(i,3),s=a[0],o=a[1],l=a[2],c=Math.asin(-t[2]/s);return c<oc?c>-oc?(e=Math.atan2(t[6]/o,t[10]/l),r=Math.atan2(t[1]/s,t[0]/s)):(r=0,e=-Math.atan2(t[4]/o,t[5]/o)):(r=0,e=Math.atan2(t[4]/o,t[5]/o)),n[0]=e,n[1]=c,n[2]=r,n}function Dd(n,t){return t.length===16?H2(n,t):Y2(n,t)}function X2(n,t,e,r,i){var a=Math.cos(n),s=Math.sin(n);return mw(r*a,i*s,0,-r*s,i*a,0,t,e,1)}function K2(n,t,e,r,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,l=2*a,c=e-t,u=r-i,h=l/c,d=l/u,f=(e+t)/c,v=(r+i)/u,g,p,y=s-a,b=s*a;return o?(g=-s/y,p=-b/y):(g=-(s+a)/y,p=-2*b/y),n[0]=h,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=d,n[6]=0,n[7]=0,n[8]=f,n[9]=v,n[10]=g,n[11]=-1,n[12]=0,n[13]=0,n[14]=p,n[15]=0,n}function Yg(n){var t=n[0],e=n[1],r=n[3],i=n[4],a=Math.sqrt(t*t+e*e),s=Math.sqrt(r*r+i*i),o=t*i-e*r;if(o<0&&(t<i?a=-a:s=-s),a){var l=1/a;t*=l,e*=l}if(s){var c=1/s;r*=c,i*=c}var u=Math.atan2(e,t),h=Gr(u);return[n[6],n[7],a,s,h]}var Hi=Wt(),Ci=Wt(),Ho=An(),Me=[pt(),pt(),pt()],Hg=pt();function Q2(n,t,e,r,i,a){if(!q2(Hi,n)||(we(Ci,Hi),Ci[3]=0,Ci[7]=0,Ci[11]=0,Ci[15]=1,Math.abs(Yt(Ci))<1e-8))return!1;var s=Hi[3],o=Hi[7],l=Hi[11],c=Hi[12],u=Hi[13],h=Hi[14],d=Hi[15];if(s!==0||o!==0||l!==0){Ho[0]=s,Ho[1]=o,Ho[2]=l,Ho[3]=d;var f=Ze(Ci,Ci);if(!f)return!1;be(Ci,Ci),M(i,Ho,Ci)}else i[0]=i[1]=i[2]=0,i[3]=1;if(t[0]=c,t[1]=u,t[2]=h,J2(Me,Hi),e[0]=gt(Me[0]),oe(Me[0],Me[0]),r[0]=ye(Me[0],Me[1]),Id(Me[1],Me[1],Me[0],1,-r[0]),e[1]=gt(Me[1]),oe(Me[1],Me[1]),r[0]/=e[1],r[1]=ye(Me[0],Me[2]),Id(Me[2],Me[2],Me[0],1,-r[1]),r[2]=ye(Me[1],Me[2]),Id(Me[2],Me[2],Me[1],1,-r[2]),e[2]=gt(Me[2]),oe(Me[2],Me[2]),r[1]/=e[2],r[2]/=e[2],de(Hg,Me[1],Me[2]),ye(Me[0],Hg)<0)for(var v=0;v<3;v++)e[v]*=-1,Me[v][0]*=-1,Me[v][1]*=-1,Me[v][2]*=-1;return a[0]=.5*Math.sqrt(Math.max(1+Me[0][0]-Me[1][1]-Me[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Me[0][0]+Me[1][1]-Me[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Me[0][0]-Me[1][1]+Me[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Me[0][0]+Me[1][1]+Me[2][2],0)),Me[2][1]>Me[1][2]&&(a[0]=-a[0]),Me[0][2]>Me[2][0]&&(a[1]=-a[1]),Me[1][0]>Me[0][1]&&(a[2]=-a[2]),!0}function q2(n,t){var e=t[15];if(e===0)return!1;for(var r=1/e,i=0;i<16;i++)n[i]=t[i]*r;return!0}function J2(n,t){n[0][0]=t[0],n[0][1]=t[1],n[0][2]=t[2],n[1][0]=t[4],n[1][1]=t[5],n[1][2]=t[6],n[2][0]=t[8],n[2][1]=t[9],n[2][2]=t[10]}function Id(n,t,e,r,i){n[0]=t[0]*r+e[0]*i,n[1]=t[1]*r+e[1]*i,n[2]=t[2]*r+e[2]*i}var sn=function(n){return n[n.ORBITING=0]="ORBITING",n[n.EXPLORING=1]="EXPLORING",n[n.TRACKING=2]="TRACKING",n}({}),Bd=function(n){return n[n.DEFAULT=0]="DEFAULT",n[n.ROTATIONAL=1]="ROTATIONAL",n[n.TRANSLATIONAL=2]="TRANSLATIONAL",n[n.CINEMATIC=3]="CINEMATIC",n}({}),vi=function(n){return n[n.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",n[n.PERSPECTIVE=1]="PERSPECTIVE",n}({}),Xg={UPDATED:"updated"},Kg=2e-4,Qg=function(){function n(){(0,N.Z)(this,n),this.clipSpaceNearZ=sc.NEGATIVE_ONE,this.eventEmitter=new D,this.matrix=Wt(),this.right=Et(1,0,0),this.up=Et(0,1,0),this.forward=Et(0,0,1),this.position=Et(0,0,1),this.focalPoint=Et(0,0,0),this.distanceVector=Et(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=Wt(),this.projectionMatrixInverse=Wt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=sn.EXPLORING,this.trackingMode=Bd.DEFAULT,this.projectionMode=vi.PERSPECTIVE,this.frustum=new j2,this.orthoMatrix=Wt()}return(0,T.Z)(n,[{key:"isOrtho",value:function(){return this.projectionMode===vi.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(e){this.enableUpdate=e}},{key:"setType",value:function(e,r){return this.type=e,this.type===sn.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===sn.TRACKING&&r!==void 0&&this.setTrackingMode(r),this}},{key:"setProjectionMode",value:function(e){return this.projectionMode=e,this}},{key:"setTrackingMode",value:function(e){if(this.type!==sn.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this}},{key:"setWorldRotation",value:function(e){return this.rotateWorld=e,this._getAngles(),this}},{key:"getViewTransform",value:function(){return Ze(Wt(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(e,r){var i=Hn(Wt(),[e,r,0]);this.jitteredProjectionMatrix=Jt(Wt(),i,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(e){return this.matrix=e,this._update(),this}},{key:"setProjectionMatrix",value:function(e){this.projectionMatrix=e}},{key:"setFov",value:function(e){return this.setPerspective(this.near,this.far,e,this.aspect),this}},{key:"setAspect",value:function(e){return this.setPerspective(this.near,this.far,this.fov,e),this}},{key:"setNear",value:function(e){return this.projectionMode===vi.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this}},{key:"setFar",value:function(e){return this.projectionMode===vi.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this}},{key:"setViewOffset",value:function(e,r,i,a,s,o){return this.aspect=e/r,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=r,this.view.offsetX=i,this.view.offsetY=a,this.view.width=s,this.view.height=o,this.projectionMode===vi.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===vi.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(e){return this.zoom=e,this.projectionMode===vi.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===vi.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(e,r){var i=this.canvas.viewport2Canvas({x:r[0],y:r[1]}),a=i.x,s=i.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(a,s),this.setFocalPoint(a,s),this.setZoom(e),this.rotate(0,0,o);var l=this.canvas.viewport2Canvas({x:r[0],y:r[1]}),c=l.x,u=l.y,h=Et(c-a,u-s,0),d=ye(h,this.right)/gt(this.right),f=ye(h,this.up)/gt(this.up),v=this.getPosition(),g=(0,R.Z)(v,2),p=g[0],y=g[1],b=this.getFocalPoint(),E=(0,R.Z)(b,2),O=E[0],P=E[1];return this.setPosition(p-d,y-f),this.setFocalPoint(O-d,P-f),this}},{key:"setPerspective",value:function(e,r,i,a){var s;this.projectionMode=vi.PERSPECTIVE,this.fov=i,this.near=e,this.far=r,this.aspect=a;var o=this.near*Math.tan(an(.5*this.fov))/this.zoom,l=2*o,c=this.aspect*l,u=-.5*c;if((s=this.view)!==null&&s!==void 0&&s.enabled){var h=this.view.fullWidth,d=this.view.fullHeight;u+=this.view.offsetX*c/h,o-=this.view.offsetY*l/d,c*=this.view.width/h,l*=this.view.height/d}return K2(this.projectionMatrix,u,u+c,o-l,o,e,this.far,this.clipSpaceNearZ===sc.ZERO),Ze(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(e,r,i,a,s,o){var l;this.projectionMode=vi.ORTHOGRAPHIC,this.rright=r,this.left=e,this.top=i,this.bottom=a,this.near=s,this.far=o;var c=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),h=(this.rright+this.left)/2,d=(this.top+this.bottom)/2,f=h-c,v=h+c,g=d+u,p=d-u;if((l=this.view)!==null&&l!==void 0&&l.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,b=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f+=y*this.view.offsetX,v=f+y*this.view.width,g-=b*this.view.offsetY,p=g-b*this.view.height}return this.clipSpaceNearZ===sc.NEGATIVE_ONE?ig(this.projectionMatrix,f,v,g,p,s,o):ag(this.projectionMatrix,f,v,g,p,s,o),Ze(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.position[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.position[2],a=Dr(e,r,i);return this._setPosition(a),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.focalPoint[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.focalPoint[2],a=Et(0,1,0);if(this.focalPoint=Dr(e,r,i),this.trackingMode===Bd.CINEMATIC){var s=Qt(pt(),this.focalPoint,this.position);e=s[0],r=s[1],i=s[2];var o=gt(s),l=Gr(Math.asin(r/o)),c=90+Gr(Math.atan2(i,e)),u=Wt();vn(u,u,an(c)),hn(u,u,an(l)),a=re(pt(),[0,1,0],u)}return Ze(this.matrix,sg(Wt(),this.position,this.focalPoint,a)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(e){if(this.distance===e||e<0)return this;this.distance=e,this.distance<Kg&&(this.distance=Kg),this.dollyingStep=this.distance/100;var r=pt();e=this.distance;var i=this.forward,a=this.focalPoint;return r[0]=e*i[0]+a[0],r[1]=e*i[1]+a[1],r[2]=e*i[2]+a[2],this._setPosition(r),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(e){return this.maxDistance=e,this}},{key:"setMinDistance",value:function(e){return this.minDistance=e,this}},{key:"setAzimuth",value:function(e){return this.azimuth=io(e),this.computeMatrix(),this._getAxes(),this.type===sn.ORBITING||this.type===sn.EXPLORING?this._getPosition():this.type===sn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(e){return this.elevation=io(e),this.computeMatrix(),this._getAxes(),this.type===sn.ORBITING||this.type===sn.EXPLORING?this._getPosition():this.type===sn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(e){return this.roll=io(e),this.computeMatrix(),this._getAxes(),this.type===sn.ORBITING||this.type===sn.EXPLORING?this._getPosition():this.type===sn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var e=Na(Xn(),[0,0,1],an(this.roll));ge(this.matrix);var r=Na(Xn(),[1,0,0],an((this.rotateWorld&&this.type!==sn.TRACKING||this.type===sn.TRACKING?1:-1)*this.elevation)),i=Na(Xn(),[0,1,0],an((this.rotateWorld&&this.type!==sn.TRACKING||this.type===sn.TRACKING?1:-1)*this.azimuth)),a=ka(Xn(),i,r);a=ka(Xn(),a,e);var s=Wo(Wt(),a);this.type===sn.ORBITING||this.type===sn.EXPLORING?(Ht(this.matrix,this.matrix,this.focalPoint),Jt(this.matrix,this.matrix,s),Ht(this.matrix,this.matrix,[0,0,this.distance])):this.type===sn.TRACKING&&(Ht(this.matrix,this.matrix,this.position),Jt(this.matrix,this.matrix,s))}},{key:"_setPosition",value:function(e,r,i){this.position=Dr(e,r,i);var a=this.matrix;a[12]=this.position[0],a[13]=this.position[1],a[14]=this.position[2],a[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){kt(this.right,Dr(M(An(),[1,0,0,0],this.matrix))),kt(this.up,Dr(M(An(),[0,1,0,0],this.matrix))),kt(this.forward,Dr(M(An(),[0,0,1,0],this.matrix))),oe(this.right,this.right),oe(this.up,this.up),oe(this.forward,this.forward)}},{key:"_getAngles",value:function(){var e=this.distanceVector[0],r=this.distanceVector[1],i=this.distanceVector[2],a=gt(this.distanceVector);if(a===0){this.elevation=0,this.azimuth=0;return}this.type===sn.TRACKING?(this.elevation=Gr(Math.asin(r/a)),this.azimuth=Gr(Math.atan2(-e,-i))):this.rotateWorld?(this.elevation=Gr(Math.asin(r/a)),this.azimuth=Gr(Math.atan2(-e,-i))):(this.elevation=-Gr(Math.asin(r/a)),this.azimuth=-Gr(Math.atan2(-e,-i)))}},{key:"_getPosition",value:function(){kt(this.position,Dr(M(An(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){Oe(this.distanceVector,[0,0,-this.distance],pw(cg(),this.matrix)),Ut(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=Qt(pt(),this.focalPoint,this.position),this.distance=gt(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===vi.ORTHOGRAPHIC){var e=this.position,r=Na(Xn(),[0,0,1],-this.roll*Math.PI/180);hs(this.orthoMatrix,r,Et((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),Et(this.zoom,this.zoom,1),e)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var e=this.getViewTransform(),r=Jt(Wt(),this.getPerspective(),e);this.getFrustum().extractFromVPMatrix(r),this.eventEmitter.emit(Xg.UPDATED)}}},{key:"rotate",value:function(e,r,i){throw new Error(rn)}},{key:"pan",value:function(e,r){throw new Error(rn)}},{key:"dolly",value:function(e){throw new Error(rn)}},{key:"createLandmark",value:function(e,r){throw new Error(rn)}},{key:"gotoLandmark",value:function(e,r){throw new Error(rn)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(rn)}}])}(),$2=function(n){return n[n.Standard=0]="Standard",n}({}),lc=function(n){return n[n.ADDED=0]="ADDED",n[n.REMOVED=1]="REMOVED",n[n.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",n}({}),tS=pt(),Xo=Wt(),eS=Xn();function qg(n){if(n.localDirtyFlag){var t=n.localSkew[0]!==0||n.localSkew[1]!==0;if(t){hs(n.localTransform,n.localRotation,n.localPosition,Et(1,1,1),n.origin),(n.localSkew[0]!==0||n.localSkew[1]!==0)&&(ge(Xo),Xo[4]=Math.tan(n.localSkew[0]),Xo[1]=Math.tan(n.localSkew[1]),Jt(n.localTransform,n.localTransform,Xo));var e=hs(Xo,ug(eS,0,0,0,1),zt(tS,1,1,1),n.localScale,n.origin);Jt(n.localTransform,n.localTransform,e)}else{var r=n.localTransform,i=n.localPosition,a=n.localRotation,s=n.localScale,o=n.origin,l=i[0]!==0||i[1]!==0||i[2]!==0,c=a[3]!==1||a[0]!==0||a[1]!==0||a[2]!==0,u=s[0]!==1||s[1]!==1||s[2]!==1,h=o[0]!==0||o[1]!==0||o[2]!==0;!c&&!u&&!h?l?Hn(r,i):ge(r):hs(r,a,i,s,o)}n.localDirtyFlag=!1}}function nS(n,t){n.dirtyFlag&&(t?Jt(n.worldTransform,t.worldTransform,n.localTransform):we(n.worldTransform,n.localTransform),n.dirtyFlag=!1)}var Jg={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new no(0,0,0,0)},$t=function(n){return n.COORDINATE="<coordinate>",n.COLOR="<color>",n.PAINT="<paint>",n.NUMBER="<number>",n.ANGLE="<angle>",n.OPACITY_VALUE="<opacity-value>",n.SHADOW_BLUR="<shadow-blur>",n.LENGTH="<length>",n.PERCENTAGE="<percentage>",n.LENGTH_PERCENTAGE="<length> | <percentage>",n.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",n.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",n.LIST_OF_POINTS="<list-of-points>",n.PATH="<path>",n.FILTER="<filter>",n.Z_INDEX="<z-index>",n.OFFSET_DISTANCE="<offset-distance>",n.DEFINED_PATH="<defined-path>",n.MARKER="<marker>",n.TRANSFORM="<transform>",n.TRANSFORM_ORIGIN="<transform-origin>",n.TEXT="<text>",n.TEXT_TRANSFORM="<text-transform>",n}({});function Fd(n,t,e){n.prototype=t.prototype=e,e.constructor=n}function $g(n,t){var e=Object.create(n.prototype);for(var r in t)e[r]=t[r];return e}function Ko(){}var Qo=.7,cc=1/Qo,ao="\\s*([+-]?\\d+)\\s*",qo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rS=/^#([0-9a-f]{3,8})$/,iS=new RegExp(`^rgb\\(${ao},${ao},${ao}\\)$`),aS=new RegExp(`^rgb\\(${Xi},${Xi},${Xi}\\)$`),sS=new RegExp(`^rgba\\(${ao},${ao},${ao},${qo}\\)$`),oS=new RegExp(`^rgba\\(${Xi},${Xi},${Xi},${qo}\\)$`),lS=new RegExp(`^hsl\\(${qo},${Xi},${Xi}\\)$`),cS=new RegExp(`^hsla\\(${qo},${Xi},${Xi},${qo}\\)$`),tp={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};Fd(Ko,uc,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:ep,formatHex:ep,formatHex8:uS,formatHsl:hS,formatRgb:np,toString:np});function ep(){return this.rgb().formatHex()}function uS(){return this.rgb().formatHex8()}function hS(){return op(this).formatHsl()}function np(){return this.rgb().formatRgb()}function uc(n){var t,e;return n=(n+"").trim().toLowerCase(),(t=rS.exec(n))?(e=t[1].length,t=parseInt(t[1],16),e===6?rp(t):e===3?new Vr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?hc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?hc(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=iS.exec(n))?new Vr(t[1],t[2],t[3],1):(t=aS.exec(n))?new Vr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=sS.exec(n))?hc(t[1],t[2],t[3],t[4]):(t=oS.exec(n))?hc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=lS.exec(n))?sp(t[1],t[2]/100,t[3]/100,1):(t=cS.exec(n))?sp(t[1],t[2]/100,t[3]/100,t[4]):tp.hasOwnProperty(n)?rp(tp[n]):n==="transparent"?new Vr(NaN,NaN,NaN,0):null}function rp(n){return new Vr(n>>16&255,n>>8&255,n&255,1)}function hc(n,t,e,r){return r<=0&&(n=t=e=NaN),new Vr(n,t,e,r)}function dS(n){return n instanceof Ko||(n=uc(n)),n?(n=n.rgb(),new Vr(n.r,n.g,n.b,n.opacity)):new Vr}function fS(n,t,e,r){return arguments.length===1?dS(n):new Vr(n,t,e,r==null?1:r)}function Vr(n,t,e,r){this.r=+n,this.g=+t,this.b=+e,this.opacity=+r}Fd(Vr,fS,$g(Ko,{brighter(n){return n=n==null?cc:Math.pow(cc,n),new Vr(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Qo:Math.pow(Qo,n),new Vr(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Vr(gs(this.r),gs(this.g),gs(this.b),dc(this.opacity))},displayable(){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:ip,formatHex:ip,formatHex8:vS,formatRgb:ap,toString:ap}));function ip(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}`}function vS(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}${ps((isNaN(this.opacity)?1:this.opacity)*255)}`}function ap(){const n=dc(this.opacity);return`${n===1?"rgb(":"rgba("}${gs(this.r)}, ${gs(this.g)}, ${gs(this.b)}${n===1?")":`, ${n})`}`}function dc(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function gs(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function ps(n){return n=gs(n),(n<16?"0":"")+n.toString(16)}function sp(n,t,e,r){return r<=0?n=t=e=NaN:e<=0||e>=1?n=t=NaN:t<=0&&(n=NaN),new Ni(n,t,e,r)}function op(n){if(n instanceof Ni)return new Ni(n.h,n.s,n.l,n.opacity);if(n instanceof Ko||(n=uc(n)),!n)return new Ni;if(n instanceof Ni)return n;n=n.rgb();var t=n.r/255,e=n.g/255,r=n.b/255,i=Math.min(t,e,r),a=Math.max(t,e,r),s=NaN,o=a-i,l=(a+i)/2;return o?(t===a?s=(e-r)/o+(e<r)*6:e===a?s=(r-t)/o+2:s=(t-e)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new Ni(s,o,l,n.opacity)}function gS(n,t,e,r){return arguments.length===1?op(n):new Ni(n,t,e,r==null?1:r)}function Ni(n,t,e,r){this.h=+n,this.s=+t,this.l=+e,this.opacity=+r}Fd(Ni,gS,$g(Ko,{brighter(n){return n=n==null?cc:Math.pow(cc,n),new Ni(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Qo:Math.pow(Qo,n),new Ni(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,t=isNaN(n)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*t,i=2*e-r;return new Vr(zd(n>=240?n-240:n+120,i,r),zd(n,i,r),zd(n<120?n+240:n-120,i,r),this.opacity)},clamp(){return new Ni(lp(this.h),fc(this.s),fc(this.l),dc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=dc(this.opacity);return`${n===1?"hsl(":"hsla("}${lp(this.h)}, ${fc(this.s)*100}%, ${fc(this.l)*100}%${n===1?")":`, ${n})`}`}}));function lp(n){return n=(n||0)%360,n<0?n+360:n}function fc(n){return Math.max(0,Math.min(1,n||0))}function zd(n,t,e){return(n<60?t+(e-t)*n/60:n<180?e:n<240?t+(e-t)*(240-n)/60:t)*255}function zn(n,t){if(typeof n!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var e=function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=t?t.apply(this,a):a[0],l=e.cache;if(l.has(o))return l.get(o);var c=n.apply(this,a);return e.cache=l.set(o,c)||l,c};return e.cache=new(zn.Cache||Map),zn.cacheList.push(e.cache),e}zn.Cache=Map,zn.cacheList=[],zn.clearCache=function(){zn.cacheList.forEach(function(n){return n.clear()})};var te=function(n){return n[n.kUnknown=0]="kUnknown",n[n.kNumber=1]="kNumber",n[n.kPercentage=2]="kPercentage",n[n.kEms=3]="kEms",n[n.kPixels=4]="kPixels",n[n.kRems=5]="kRems",n[n.kDegrees=6]="kDegrees",n[n.kRadians=7]="kRadians",n[n.kGradians=8]="kGradians",n[n.kTurns=9]="kTurns",n[n.kMilliseconds=10]="kMilliseconds",n[n.kSeconds=11]="kSeconds",n[n.kInteger=12]="kInteger",n}({}),ki=function(n){return n[n.kUNumber=0]="kUNumber",n[n.kUPercent=1]="kUPercent",n[n.kULength=2]="kULength",n[n.kUAngle=3]="kUAngle",n[n.kUTime=4]="kUTime",n[n.kUOther=5]="kUOther",n}({}),pS=function(n){return n[n.kYes=0]="kYes",n[n.kNo=1]="kNo",n}({}),mS=function(n){return n[n.kYes=0]="kYes",n[n.kNo=1]="kNo",n}({}),yS=[{name:"em",unit_type:te.kEms},{name:"px",unit_type:te.kPixels},{name:"deg",unit_type:te.kDegrees},{name:"rad",unit_type:te.kRadians},{name:"grad",unit_type:te.kGradians},{name:"ms",unit_type:te.kMilliseconds},{name:"s",unit_type:te.kSeconds},{name:"rem",unit_type:te.kRems},{name:"turn",unit_type:te.kTurns}],so=function(n){return n[n.kUnknownType=0]="kUnknownType",n[n.kUnparsedType=1]="kUnparsedType",n[n.kKeywordType=2]="kKeywordType",n[n.kUnitType=3]="kUnitType",n[n.kSumType=4]="kSumType",n[n.kProductType=5]="kProductType",n[n.kNegateType=6]="kNegateType",n[n.kInvertType=7]="kInvertType",n[n.kMinType=8]="kMinType",n[n.kMaxType=9]="kMaxType",n[n.kClampType=10]="kClampType",n[n.kTransformType=11]="kTransformType",n[n.kPositionType=12]="kPositionType",n[n.kURLImageType=13]="kURLImageType",n[n.kColorType=14]="kColorType",n[n.kUnsupportedColorType=15]="kUnsupportedColorType",n}({}),bS=function(t){return yS.find(function(e){return e.name===t}).unit_type},xS=function(t){return t?t==="number"?te.kNumber:t==="percent"||t==="%"?te.kPercentage:bS(t):te.kUnknown},ES=function(t){switch(t){case te.kNumber:case te.kInteger:return ki.kUNumber;case te.kPercentage:return ki.kUPercent;case te.kPixels:return ki.kULength;case te.kMilliseconds:case te.kSeconds:return ki.kUTime;case te.kDegrees:case te.kRadians:case te.kGradians:case te.kTurns:return ki.kUAngle;default:return ki.kUOther}},wS=function(t){switch(t){case ki.kUNumber:return te.kNumber;case ki.kULength:return te.kPixels;case ki.kUPercent:return te.kPercentage;case ki.kUTime:return te.kSeconds;case ki.kUAngle:return te.kDegrees;default:return te.kUnknown}},cp=function(t){var e=1;switch(t){case te.kPixels:case te.kDegrees:case te.kSeconds:break;case te.kMilliseconds:e=.001;break;case te.kRadians:e=180/Math.PI;break;case te.kGradians:e=.9;break;case te.kTurns:e=360;break}return e},jd=function(t){switch(t){case te.kNumber:case te.kInteger:return"";case te.kPercentage:return"%";case te.kEms:return"em";case te.kRems:return"rem";case te.kPixels:return"px";case te.kDegrees:return"deg";case te.kRadians:return"rad";case te.kGradians:return"grad";case te.kMilliseconds:return"ms";case te.kSeconds:return"s";case te.kTurns:return"turn"}return""},vc=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"toString",value:function(){return this.buildCSSText(pS.kNo,mS.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=so.kUnitType&&this.getType()<=so.kClampType}}],[{key:"isAngle",value:function(e){return e===te.kDegrees||e===te.kRadians||e===te.kGradians||e===te.kTurns}},{key:"isLength",value:function(e){return e>=te.kEms&&e<te.kDegrees}},{key:"isRelativeUnit",value:function(e){return e===te.kPercentage||e===te.kEms||e===te.kRems}},{key:"isTime",value:function(e){return e===te.kSeconds||e===te.kMilliseconds}}])}(),SS=function(n){function t(e){var r;return(0,N.Z)(this,t),r=(0,_.Z)(this,t),r.colorSpace=e,r}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"getType",value:function(){return so.kColorType}},{key:"to",value:function(r){return this}}])}(vc),_a=function(n){return n[n.Constant=0]="Constant",n[n.LinearGradient=1]="LinearGradient",n[n.RadialGradient=2]="RadialGradient",n}({}),gc=function(n){function t(e,r){var i;return(0,N.Z)(this,t),i=(0,_.Z)(this,t),i.type=e,i.value=r,i}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.type,this.value)}},{key:"buildCSSText",value:function(r,i,a){return a}},{key:"getType",value:function(){return so.kColorType}}])}(vc),gi=function(n){function t(e){var r;return(0,N.Z)(this,t),r=(0,_.Z)(this,t),r.value=e,r}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.value)}},{key:"getType",value:function(){return so.kKeywordType}},{key:"buildCSSText",value:function(r,i,a){return a+this.value}}])}(vc),MS=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r="";return Number.isFinite(t)?r="NaN":t>0?r="infinity":r="-infinity",r+=e},Zd=function(t){return wS(ES(t))},on=function(n){function t(e){var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.kNumber;(0,N.Z)(this,t),r=(0,_.Z)(this,t);var a;return typeof i=="string"?a=xS(i):a=i,r.unit=a,r.value=e,r}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.value,this.unit)}},{key:"equals",value:function(r){var i=r;return this.value===i.value&&this.unit===i.unit}},{key:"getType",value:function(){return so.kUnitType}},{key:"convertTo",value:function(r){if(this.unit===r)return new t(this.value,this.unit);var i=Zd(this.unit);if(i!==Zd(r)||i===te.kUnknown)return null;var a=cp(this.unit)/cp(r);return new t(this.value*a,r)}},{key:"buildCSSText",value:function(r,i,a){var s;switch(this.unit){case te.kUnknown:break;case te.kInteger:s=Number(this.value).toFixed(0);break;case te.kNumber:case te.kPercentage:case te.kEms:case te.kRems:case te.kPixels:case te.kDegrees:case te.kRadians:case te.kGradians:case te.kMilliseconds:case te.kSeconds:case te.kTurns:{var o=-999999,l=999999,c=this.value,u=jd(this.unit);if(c<o||c>l){var h=jd(this.unit);!Number.isFinite(c)||Number.isNaN(c)?s=MS(c,h):s=c+(h||"")}else s="".concat(c).concat(u)}}return a+=s,a}}])}(vc),Pi=new on(0,"px");new on(1,"px");var ms=new on(0,"deg"),Wd=function(n){function t(e,r,i){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;return(0,N.Z)(this,t),a=(0,_.Z)(this,t,["rgb"]),a.r=e,a.g=r,a.b=i,a.alpha=s,a.isNone=o,a}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(r,i,a){return"".concat(a,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(SS),up=new gi("unset"),AS=new gi("initial"),TS=new gi("inherit"),Gd={"":up,unset:up,initial:AS,inherit:TS},OS=function(t){return Gd[t]||(Gd[t]=new gi(t)),Gd[t]},hp=new Wd(0,0,0,0,!0),dp=new Wd(0,0,0,0),CS=zn(function(n,t,e,r){return new Wd(n,t,e,r)},function(n,t,e,r){return"rgba(".concat(n,",").concat(t,",").concat(e,",").concat(r,")")}),En=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.kNumber;return new on(t,e)};new on(50,"%");function NS(n){var t=n.type,e=n.value;return t==="hex"?"#".concat(e):t==="literal"?e:t==="rgb"?"rgb(".concat(e.join(","),")"):"rgba(".concat(e.join(","),")")}var kS=function(){var n={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function e(Ot){throw new Error("".concat(t,": ").concat(Ot))}function r(){var Ot=i();return t.length>0&&e("Invalid input not EOF"),Ot}function i(){return E(a)}function a(){return s("linear-gradient",n.linearGradient,l)||s("repeating-linear-gradient",n.repeatingLinearGradient,l)||s("radial-gradient",n.radialGradient,h)||s("repeating-radial-gradient",n.repeatingRadialGradient,h)||s("conic-gradient",n.conicGradient,h)}function s(Ot,mt,yt){return o(mt,function(Rt){var jt=yt();return jt&&(ft(n.comma)||e("Missing comma before color stops")),{type:Ot,orientation:jt,colorStops:E(O)}})}function o(Ot,mt){var yt=ft(Ot);if(yt){ft(n.startCall)||e("Missing (");var Rt=mt(yt);return ft(n.endCall)||e("Missing )"),Rt}}function l(){return c()||u()}function c(){return ct("directional",n.sideOrCorner,1)}function u(){return ct("angular",n.angleValue,1)}function h(){var Ot,mt=d(),yt;return mt&&(Ot=[],Ot.push(mt),yt=t,ft(n.comma)&&(mt=d(),mt?Ot.push(mt):t=yt)),Ot}function d(){var Ot=f()||v();if(Ot)Ot.at=p();else{var mt=g();if(mt){Ot=mt;var yt=p();yt&&(Ot.at=yt)}else{var Rt=y();Rt&&(Ot={type:"default-radial",at:Rt})}}return Ot}function f(){var Ot=ct("shape",/^(circle)/i,0);return Ot&&(Ot.style=ot()||g()),Ot}function v(){var Ot=ct("shape",/^(ellipse)/i,0);return Ot&&(Ot.style=J()||g()),Ot}function g(){return ct("extent-keyword",n.extentKeywords,1)}function p(){if(ct("position",/^at/,0)){var Ot=y();return Ot||e("Missing positioning value"),Ot}}function y(){var Ot=b();if(Ot.x||Ot.y)return{type:"position",value:Ot}}function b(){return{x:J(),y:J()}}function E(Ot){var mt=Ot(),yt=[];if(mt)for(yt.push(mt);ft(n.comma);)mt=Ot(),mt?yt.push(mt):e("One extra comma");return yt}function O(){var Ot=P();return Ot||e("Expected color definition"),Ot.length=J(),Ot}function P(){return F()||V()||I()||L()}function L(){return ct("literal",n.literalColor,0)}function F(){return ct("hex",n.hexColor,1)}function I(){return o(n.rgbColor,function(){return{type:"rgb",value:E(Y)}})}function V(){return o(n.rgbaColor,function(){return{type:"rgba",value:E(Y)}})}function Y(){return ft(n.number)[1]}function J(){return ct("%",n.percentageValue,1)||$()||ot()}function $(){return ct("position-keyword",n.positionKeywords,1)}function ot(){return ct("px",n.pixelValue,1)||ct("em",n.emValue,1)}function ct(Ot,mt,yt){var Rt=ft(mt);if(Rt)return{type:Ot,value:Rt[yt]}}function ft(Ot){var mt=/^[\n\r\t\s]+/.exec(t);mt&&Nt(mt[0].length);var yt=Ot.exec(t);return yt&&Nt(yt[0].length),yt}function Nt(Ot){t=t.substring(Ot)}return function(Ot){return t=Ot,r()}}();function PS(n,t,e,r){var i=an(r.value),a=0,s=0,o=a+t/2,l=s+e/2,c=Math.abs(t*Math.cos(i))+Math.abs(e*Math.sin(i)),u=n[0]+o-Math.cos(i)*c/2,h=n[1]+l-Math.sin(i)*c/2,d=n[0]+o+Math.cos(i)*c/2,f=n[1]+l+Math.sin(i)*c/2;return{x1:u,y1:h,x2:d,y2:f}}function RS(n,t,e,r,i,a){var s=r.value,o=i.value;r.unit===te.kPercentage&&(s=r.value/100*t),i.unit===te.kPercentage&&(o=i.value/100*e);var l=Math.max(Zr([0,0],[s,o]),Zr([0,e],[s,o]),Zr([t,e],[s,o]),Zr([t,0],[s,o]));return a&&(a instanceof on?l=a.value:a instanceof gi&&(a.value==="closest-side"?l=Math.min(s,t-s,o,e-o):a.value==="farthest-side"?l=Math.max(s,t-s,o,e-o):a.value==="closest-corner"&&(l=Math.min(Zr([0,0],[s,o]),Zr([0,e],[s,o]),Zr([t,e],[s,o]),Zr([t,0],[s,o]))))),{x:s+n[0],y:o+n[1],r:l}}var LS=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,_S=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,DS=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,fp=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function IS(n){var t,e=n.length;if(n[e-1].length=(t=n[e-1].length)!==null&&t!==void 0?t:{type:"%",value:"100"},e>1){var r;n[0].length=(r=n[0].length)!==null&&r!==void 0?r:{type:"%",value:"0"}}for(var i=0,a=Number(n[0].length.value),s=1;s<e;s++){var o,l=(o=n[s].length)===null||o===void 0?void 0:o.value;if(!me(l)&&!me(a)){for(var c=1;c<s-i;c++)n[i+c].length={type:"%",value:"".concat(a+(Number(l)-a)*c/(s-i))};i=s,a=Number(l)}}}var BS={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},FS=zn(function(n){var t;return n.type==="angular"?t=Number(n.value):t=BS[n.value]||0,En(t,"deg")}),zS=zn(function(n){var t=50,e=50,r="%",i="%";if((n==null?void 0:n.type)==="position"){var a=n.value,s=a.x,o=a.y;(s==null?void 0:s.type)==="position-keyword"&&(s.value==="left"?t=0:s.value==="center"?t=50:s.value==="right"?t=100:s.value==="top"?e=0:s.value==="bottom"&&(e=100)),(o==null?void 0:o.type)==="position-keyword"&&(o.value==="left"?t=0:o.value==="center"?e=50:o.value==="right"?t=100:o.value==="top"?e=0:o.value==="bottom"&&(e=100)),((s==null?void 0:s.type)==="px"||(s==null?void 0:s.type)==="%"||(s==null?void 0:s.type)==="em")&&(r=s==null?void 0:s.type,t=Number(s.value)),((o==null?void 0:o.type)==="px"||(o==null?void 0:o.type)==="%"||(o==null?void 0:o.type)==="em")&&(i=o==null?void 0:o.type,e=Number(o.value))}return{cx:En(t,r),cy:En(e,i)}}),jS=zn(function(n){if(n.indexOf("linear")>-1||n.indexOf("radial")>-1){var t=kS(n);return t.map(function(o){var l=o.type,c=o.orientation,u=o.colorStops;IS(u);var h=u.map(function(E){return{offset:En(Number(E.length.value),"%"),color:NS(E)}});if(l==="linear-gradient")return new gc(_a.LinearGradient,{angle:c?FS(c):ms,steps:h});if(l==="radial-gradient"&&(c||(c=[{type:"shape",value:"circle"}]),c[0].type==="shape"&&c[0].value==="circle")){var d=zS(c[0].at),f=d.cx,v=d.cy,g;if(c[0].style){var p=c[0].style,y=p.type,b=p.value;y==="extent-keyword"?g=OS(b):g=En(b,y)}return new gc(_a.RadialGradient,{cx:f,cy:v,size:g,steps:h})}})}var e=n[0];if(n[1]==="("||n[2]==="("){if(e==="l"){var r=LS.exec(n);if(r){var i,a=((i=r[2].match(fp))===null||i===void 0?void 0:i.map(function(o){return o.split(":")}))||[];return[new gc(_a.LinearGradient,{angle:En(parseFloat(r[1]),"deg"),steps:a.map(function(o){var l=(0,R.Z)(o,2),c=l[0],u=l[1];return{offset:En(Number(c)*100,"%"),color:u}})})]}}else if(e==="r"){var s=ZS(n);if(s)if(Ge(s))n=s;else return[new gc(_a.RadialGradient,s)]}else if(e==="p")return WS(n)}});function ZS(n){var t=_S.exec(n);if(t){var e,r=((e=t[4].match(fp))===null||e===void 0?void 0:e.map(function(i){return i.split(":")}))||[];return{cx:En(50,"%"),cy:En(50,"%"),steps:r.map(function(i){var a=(0,R.Z)(i,2),s=a[0],o=a[1];return{offset:En(Number(s)*100,"%"),color:o}})}}return null}function WS(n){var t=DS.exec(n);if(t){var e=t[1],r=t[2];switch(e){case"a":e="repeat";break;case"x":e="repeat-x";break;case"y":e="repeat-y";break;case"n":e="no-repeat";break;default:e="no-repeat"}return{image:r,repetition:e}}return null}function G8(n){return!!n.type&&!!n.value}function ys(n){return n&&!!n.image}function pc(n){return n&&!me(n.r)&&!me(n.g)&&!me(n.b)}var Jo=zn(function(n){if(ys(n))return(0,B.Z)({repetition:"repeat"},n);if(me(n)&&(n=""),n==="transparent")return dp;if(n==="currentColor")n="black";else if(n==="none")return hp;var t=jS(n);if(t)return t;var e=uc(n),r=[0,0,0,0];return e!==null&&(r[0]=e.r||0,r[1]=e.g||0,r[2]=e.b||0,r[3]=e.opacity),CS.apply(void 0,r)});function GS(n,t){if(!(!pc(n)||!pc(t)))return[[Number(n.r),Number(n.g),Number(n.b),Number(n.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(e){var r=e.slice();if(r[3])for(var i=0;i<3;i++)r[i]=Math.round(kn(r[i],0,255));return r[3]=kn(r[3],0,1),"rgba(".concat(r.join(","),")")}]}function $o(n,t){if(me(t))return En(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(n)>=0)return En(Number(t),"px");if("deg".search(n)>=0)return En(Number(t),"deg")}var e=[];t=t.replace(n,function(i){return e.push(i),"U".concat(i)});var r="U(".concat(n.source,")");return e.map(function(i){return En(Number(t.replace(new RegExp("U".concat(i),"g"),"").replace(new RegExp(r,"g"),"*0")),i)})[0]}var vp=function(t){return $o(new RegExp("px","g"),t)},VS=zn(vp),US=function(t){return $o(new RegExp("%","g"),t)};zn(US);var gp=function(t){return ie(t)||isFinite(Number(t))?En(Number(t)||0,"px"):$o(new RegExp("px|%|em|rem","g"),t)},Vd=zn(gp),pp=function(t){return $o(new RegExp("deg|rad|grad|turn","g"),t)},YS=zn(pp);function HS(n,t,e,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a="",s=n.value||0,o=t.value||0,l=Zd(n.unit),c=n.convertTo(l),u=t.convertTo(l);return c&&u?(s=c.value,o=u.value,a=jd(n.unit)):(on.isLength(n.unit)||on.isLength(t.unit))&&(s=ei(n,i,e),o=ei(t,i,e),a="px"),[s,o,function(h){return r&&(h=Math.max(h,0)),h+a}]}function Ur(n){var t=0;return n.unit===te.kDegrees?t=n.value:n.unit===te.kRadians?t=Gr(Number(n.value)):n.unit===te.kTurns?t=U2(Number(n.value)):n.value&&(t=n.value),t}function mp(n,t){var e;return Array.isArray(n)?e=n.map(function(r){return Number(r)}):Ge(n)?e=n.split(" ").map(function(r){return Number(r)}):ie(n)&&(e=[n]),t===2?e.length===1?[e[0],e[0]]:[e[0],e[1]]:t===4?e.length===1?[e[0],e[0],e[0],e[0]]:e.length===2?[e[0],e[1],e[0],e[1]]:e.length===3?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]:t==="even"&&e.length%2===1?[].concat((0,k.Z)(e),(0,k.Z)(e)):e}function ei(n,t,e){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(n.unit===te.kPixels)return Number(n.value);if(n.unit===te.kPercentage&&e){var i=e.nodeName===Dt.GROUP?e.getLocalBounds():e.getGeometryBounds();return(r?i.min[t]:0)+n.value/100*i.halfExtents[t]*2}return 0}var XS=function(t){return $o(/deg|rad|grad|turn|px|%/g,t)},KS=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function QS(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(n=n.toLowerCase().trim(),n==="none")return[];for(var t=/\s*([\w-]+)\(([^)]*)\)/g,e=[],r,i=0;r=t.exec(n);){if(r.index!==i)return[];if(i=r.index+r[0].length,KS.indexOf(r[1])>-1&&e.push({name:r[1],params:r[2].split(" ").map(function(a){return XS(a)||Jo(a)})}),t.lastIndex===n.length)return e}return[]}function yp(n){return n.toString()}var bp=function(t){return typeof t=="number"?En(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?En(Number(t)):En(0)},Ud=zn(bp);zn(function(n){return Ge(n)?n.split(" ").map(Ud):n.map(Ud)});function Yd(n,t){return[n,t,yp]}function Hd(n,t){return function(e,r){return[e,r,function(i){return yp(kn(i,n,t))}]}}function xp(n,t){if(n.length===t.length)return[n,t,function(e){return e}]}function Xd(n){return n.parsedStyle.d.totalLength===0&&(n.parsedStyle.d.totalLength=Yw(n.parsedStyle.d.absolutePath)),n.parsedStyle.d.totalLength}function qS(n){return n.parsedStyle.points.totalLength===0&&(n.parsedStyle.points.totalLength=N2(n.parsedStyle.points.points)),n.parsedStyle.points.totalLength}function JS(n){for(var t=0;t<n.length;t++){var e=n[t-1],r=n[t],i=r[0];if(i==="M"&&e){var a=e[0],s=[r[1],r[2]],o=void 0;a==="L"||a==="M"?o=[e[1],e[2]]:(a==="C"||a==="A"||a==="Q")&&(o=[e[e.length-2],e[e.length-1]]),o&&mc(s,o)&&(n.splice(t,1),t--)}}}function $S(n){for(var t=!1,e=n.length,r=0;r<e;r++){var i=n[r],a=i[0];if(a==="C"||a==="A"||a==="Q"){t=!0;break}}return t}function tM(n){for(var t=[],e=[],r=[],i=0;i<n.length;i++){var a=n[i],s=a[0];s==="M"?(r.length&&(e.push(r),r=[]),r.push([a[1],a[2]])):s==="Z"?r.length&&(t.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&e.push(r),{polygons:t,polylines:e}}function mc(n,t){return n[0]===t[0]&&n[1]===t[1]}function eM(n,t){for(var e=[],r=[],i=[],a=0;a<n.length;a++){var s=n[a],o=s.currentPoint,l=s.params,c=s.prePoint,u=void 0;switch(s.command){case"Q":u=P2(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=T2(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=s.arcParams;u=E2(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:e.push(o[0]),r.push(o[1]);break}u&&(s.box=u,e.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),t&&(s.command==="L"||s.command==="M")&&s.prePoint&&s.nextPoint&&i.push(s)}e=e.filter(function(O){return!Number.isNaN(O)&&O!==1/0&&O!==-1/0}),r=r.filter(function(O){return!Number.isNaN(O)&&O!==1/0&&O!==-1/0});var d=ec(e),f=ec(r),v=nc(e),g=nc(r);if(i.length===0)return{x:d,y:f,width:v-d,height:g-f};for(var p=0;p<i.length;p++){var y=i[p],b=y.currentPoint,E=void 0;b[0]===d?(E=yc(y,t),d-=E.xExtra):b[0]===v&&(E=yc(y,t),v+=E.xExtra),b[1]===f?(E=yc(y,t),f-=E.yExtra):b[1]===g&&(E=yc(y,t),g+=E.yExtra)}return{x:d,y:f,width:v-d,height:g-f}}function yc(n,t){var e=n.prePoint,r=n.currentPoint,i=n.nextPoint,a=Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2),s=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),o=Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2),l=Math.acos((a+s-o)/(2*Math.sqrt(a)*Math.sqrt(s)));if(!l||Math.sin(l)===0||Vo(l,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));c=c>Math.PI/2?Math.PI-c:c,u=u>Math.PI/2?Math.PI-u:u;var h={xExtra:Math.cos(l/2-c)*(t/2*(1/Math.sin(l/2)))-t/2||0,yExtra:Math.cos(u-l/2)*(t/2*(1/Math.sin(l/2)))-t/2||0};return h}function Ep(n,t){return[t[0]+(t[0]-n[0]),t[1]+(t[1]-n[1])]}var wp=function(t,e){var r=t.x*e.x+t.y*e.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))),a=t.x*e.y-t.y*e.x<0?-1:1,s=a*Math.acos(r/i);return s},Sp=function(t,e,r,i,a,s,o,l){e=Math.abs(e),r=Math.abs(r),i=xg(i,360);var c=an(i);if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(e===0||r===0)return{x:0,y:0,ellipticalArcAngle:0};var u=(t.x-o.x)/2,h=(t.y-o.y)/2,d={x:Math.cos(c)*u+Math.sin(c)*h,y:-Math.sin(c)*u+Math.cos(c)*h},f=Math.pow(d.x,2)/Math.pow(e,2)+Math.pow(d.y,2)/Math.pow(r,2);f>1&&(e*=Math.sqrt(f),r*=Math.sqrt(f));var v=Math.pow(e,2)*Math.pow(r,2)-Math.pow(e,2)*Math.pow(d.y,2)-Math.pow(r,2)*Math.pow(d.x,2),g=Math.pow(e,2)*Math.pow(d.y,2)+Math.pow(r,2)*Math.pow(d.x,2),p=v/g;p=p<0?0:p;var y=(a!==s?1:-1)*Math.sqrt(p),b={x:y*(e*d.y/r),y:y*(-(r*d.x)/e)},E={x:Math.cos(c)*b.x-Math.sin(c)*b.y+(t.x+o.x)/2,y:Math.sin(c)*b.x+Math.cos(c)*b.y+(t.y+o.y)/2},O={x:(d.x-b.x)/e,y:(d.y-b.y)/r},P=wp({x:1,y:0},O),L={x:(-d.x-b.x)/e,y:(-d.y-b.y)/r},F=wp(O,L);!s&&F>0?F-=2*Math.PI:s&&F<0&&(F+=2*Math.PI),F%=2*Math.PI;var I=P+F*l,V=e*Math.cos(I),Y=r*Math.sin(I),J={x:Math.cos(c)*V-Math.sin(c)*Y+E.x,y:Math.sin(c)*V+Math.cos(c)*Y+E.y,ellipticalArcStartAngle:P,ellipticalArcEndAngle:P+F,ellipticalArcAngle:I,ellipticalArcCenter:E,resultantRx:e,resultantRy:r};return J};function nM(n){for(var t=[],e=null,r=null,i=null,a=0,s=n.length,o=0;o<s;o++){var l=n[o];r=n[o+1];var c=l[0],u={command:c,prePoint:e,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],a=o;break;case"A":var h=rM(e,l);u.arcParams=h;break}if(c==="Z")e=i,r=n[a+1];else{var d=l.length;e=[l[d-2],l[d-1]]}r&&r[0]==="Z"&&(r=n[a],t[a]&&(t[a].prePoint=e)),u.currentPoint=e,t[a]&&mc(e,t[a].currentPoint)&&(t[a].prePoint=u.prePoint);var f=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=f;var v=u.prePoint;if(["L","H","V"].includes(c))u.startTangent=[v[0]-e[0],v[1]-e[1]],u.endTangent=[e[0]-v[0],e[1]-v[1]];else if(c==="Q"){var g=[l[1],l[2]];u.startTangent=[v[0]-g[0],v[1]-g[1]],u.endTangent=[e[0]-g[0],e[1]-g[1]]}else if(c==="T"){var p=t[o-1],y=Ep(p.currentPoint,v);p.command==="Q"?(u.command="Q",u.startTangent=[v[0]-y[0],v[1]-y[1]],u.endTangent=[e[0]-y[0],e[1]-y[1]]):(u.command="TL",u.startTangent=[v[0]-e[0],v[1]-e[1]],u.endTangent=[e[0]-v[0],e[1]-v[1]])}else if(c==="C"){var b=[l[1],l[2]],E=[l[3],l[4]];u.startTangent=[v[0]-b[0],v[1]-b[1]],u.endTangent=[e[0]-E[0],e[1]-E[1]],u.startTangent[0]===0&&u.startTangent[1]===0&&(u.startTangent=[b[0]-E[0],b[1]-E[1]]),u.endTangent[0]===0&&u.endTangent[1]===0&&(u.endTangent=[E[0]-b[0],E[1]-b[1]])}else if(c==="S"){var O=t[o-1],P=Ep(O.currentPoint,v),L=[l[1],l[2]];O.command==="C"?(u.command="C",u.startTangent=[v[0]-P[0],v[1]-P[1]],u.endTangent=[e[0]-L[0],e[1]-L[1]]):(u.command="SQ",u.startTangent=[v[0]-L[0],v[1]-L[1]],u.endTangent=[e[0]-L[0],e[1]-L[1]])}else if(c==="A"){var F=Mp(u,0),I=F.x,V=F.y,Y=Mp(u,1,!1),J=Y.x,$=Y.y;u.startTangent=[I,V],u.endTangent=[J,$]}t.push(u)}return t}function Mp(n,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=n.arcParams,i=r.rx,a=i===void 0?0:i,s=r.ry,o=s===void 0?0:s,l=r.xRotation,c=r.arcFlag,u=r.sweepFlag,h=Sp({x:n.prePoint[0],y:n.prePoint[1]},a,o,l,!!c,!!u,{x:n.currentPoint[0],y:n.currentPoint[1]},t),d=Sp({x:n.prePoint[0],y:n.prePoint[1]},a,o,l,!!c,!!u,{x:n.currentPoint[0],y:n.currentPoint[1]},e?t+.005:t-.005),f=d.x-h.x,v=d.y-h.y,g=Math.sqrt(f*f+v*v);return{x:-f/g,y:-v/g}}function bc(n){return Math.sqrt(n[0]*n[0]+n[1]*n[1])}function Kd(n,t){return bc(n)*bc(t)?(n[0]*t[0]+n[1]*t[1])/(bc(n)*bc(t)):1}function Ap(n,t){return(n[0]*t[1]<n[1]*t[0]?-1:1)*Math.acos(Kd(n,t))}function rM(n,t){var e=t[1],r=t[2],i=xg(an(t[3]),Math.PI*2),a=t[4],s=t[5],o=n[0],l=n[1],c=t[6],u=t[7],h=Math.cos(i)*(o-c)/2+Math.sin(i)*(l-u)/2,d=-1*Math.sin(i)*(o-c)/2+Math.cos(i)*(l-u)/2,f=h*h/(e*e)+d*d/(r*r);f>1&&(e*=Math.sqrt(f),r*=Math.sqrt(f));var v=e*e*(d*d)+r*r*(h*h),g=v?Math.sqrt((e*e*(r*r)-v)/v):1;a===s&&(g*=-1),isNaN(g)&&(g=0);var p=r?g*e*d/r:0,y=e?g*-r*h/e:0,b=(o+c)/2+Math.cos(i)*p-Math.sin(i)*y,E=(l+u)/2+Math.sin(i)*p+Math.cos(i)*y,O=[(h-p)/e,(d-y)/r],P=[(-1*h-p)/e,(-1*d-y)/r],L=Ap([1,0],O),F=Ap(O,P);return Kd(O,P)<=-1&&(F=Math.PI),Kd(O,P)>=1&&(F=0),s===0&&F>0&&(F-=2*Math.PI),s===1&&F<0&&(F+=2*Math.PI),{cx:b,cy:E,rx:mc(n,[c,u])?0:e,ry:mc(n,[c,u])?0:r,startAngle:L,endAngle:L+F,xRotation:i,arcFlag:a,sweepFlag:s}}function iM(n,t,e){return n.reduce(function(r,i){var a="";if(i[0]==="M"||i[0]==="L"){var s=vec3.fromValues(i[1],i[2],0);e&&vec3.transformMat4(s,s,e),a="".concat(i[0]).concat(s[0],",").concat(s[1])}else if(i[0]==="Z")a=i[0];else if(i[0]==="C"){var o=vec3.fromValues(i[1],i[2],0),l=vec3.fromValues(i[3],i[4],0),c=vec3.fromValues(i[5],i[6],0);e&&(vec3.transformMat4(o,o,e),vec3.transformMat4(l,l,e),vec3.transformMat4(c,c,e)),a="".concat(i[0]).concat(o[0],",").concat(o[1],",").concat(l[0],",").concat(l[1],",").concat(c[0],",").concat(c[1])}else if(i[0]==="A"){var u=vec3.fromValues(i[6],i[7],0);e&&vec3.transformMat4(u,u,e),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],",").concat(i[5],",").concat(u[0],",").concat(u[1])}else if(i[0]==="Q"){var h=vec3.fromValues(i[1],i[2],0),d=vec3.fromValues(i[3],i[4],0);e&&(vec3.transformMat4(h,h,e),vec3.transformMat4(d,d,e)),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],"}")}return r+=a},"")}function aM(n,t,e,r){return[["M",n,t],["L",e,r]]}function Tp(n,t,e,r){var i=(-1+Math.sqrt(2))/3*4,a=n*i,s=t*i,o=e-n,l=e+n,c=r-t,u=r+t;return[["M",o,r],["C",o,r-s,e-a,c,e,c],["C",e+a,c,l,r-s,l,r],["C",l,r+s,e+a,u,e,u],["C",e-a,u,o,r+s,o,r],["Z"]]}function sM(n,t){var e=n.map(function(r,i){return[i===0?"M":"L",r[0],r[1]]});return t&&e.push(["Z"]),e}function oM(n,t,e,r,i){if(i){var a=_slicedToArray(i,4),s=a[0],o=a[1],l=a[2],c=a[3],u=n>0?1:-1,h=t>0?1:-1,d=u+h!==0?1:0;return[["M",u*s+e,r],["L",n-u*o+e,r],o?["A",o,o,0,0,d,n+e,h*o+r]:null,["L",n+e,t-h*l+r],l?["A",l,l,0,0,d,n+e-u*l,t+r]:null,["L",e+u*c,t+r],c?["A",c,c,0,0,d,e,t+r-h*c]:null,["L",e,h*s+r],s?["A",s,s,0,0,d,u*s+e,r]:null,["Z"]].filter(function(f){return f})}return[["M",e,r],["L",e+n,r],["L",e+n,r+t],["L",e,r+t],["Z"]]}function V8(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n.getLocalTransform(),e=[];switch(n.nodeName){case Dt.LINE:var r=n.parsedStyle,i=r.x1,a=i===void 0?0:i,s=r.y1,o=s===void 0?0:s,l=r.x2,c=l===void 0?0:l,u=r.y2,h=u===void 0?0:u;e=aM(a,o,c,h);break;case Dt.CIRCLE:{var d=n.parsedStyle,f=d.r,v=f===void 0?0:f,g=d.cx,p=g===void 0?0:g,y=d.cy,b=y===void 0?0:y;e=Tp(v,v,p,b);break}case Dt.ELLIPSE:{var E=n.parsedStyle,O=E.rx,P=O===void 0?0:O,L=E.ry,F=L===void 0?0:L,I=E.cx,V=I===void 0?0:I,Y=E.cy,J=Y===void 0?0:Y;e=Tp(P,F,V,J);break}case Dt.POLYLINE:case Dt.POLYGON:var $=n.parsedStyle.points;e=sM($.points,n.nodeName===Dt.POLYGON);break;case Dt.RECT:var ot=n.parsedStyle,ct=ot.width,ft=ct===void 0?0:ct,Nt=ot.height,Ot=Nt===void 0?0:Nt,mt=ot.x,yt=mt===void 0?0:mt,Rt=ot.y,jt=Rt===void 0?0:Rt,Xt=ot.radius,ee=Xt&&Xt.some(function(he){return he!==0});e=oM(ft,Ot,yt,jt,ee&&Xt.map(function(he){return clamp(he,0,Math.min(Math.abs(ft)/2,Math.abs(Ot)/2))}));break;case Dt.PATH:var ae=n.parsedStyle.d.absolutePath;e=_toConsumableArray(ae);break}if(e.length)return iM(e,n,t)}function U8(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=n.map(function(s,o){var l=s[0],c=n[o+1],u=o===0&&(t!==0||e!==0),h=(o===n.length-1||c&&(c[0]==="M"||c[0]==="Z"))&&r!==0&&i!==0,d=u?[t,e]:[0,0],f=_slicedToArray(d,2),v=f[0],g=f[1],p=h?[r,i]:[0,0],y=_slicedToArray(p,2),b=y[0],E=y[1];switch(l){case"M":return"M ".concat(s[1]+v,",").concat(s[2]+g);case"L":return"L ".concat(s[1]+b,",").concat(s[2]+E);case"Q":return"Q ".concat(s[1]," ").concat(s[2],",").concat(s[3]+b," ").concat(s[4]+E);case"C":return"C ".concat(s[1]," ").concat(s[2],",").concat(s[3]," ").concat(s[4],",").concat(s[5]+b," ").concat(s[6]+E);case"A":return"A ".concat(s[1]," ").concat(s[2]," ").concat(s[3]," ").concat(s[4]," ").concat(s[5]," ").concat(s[6]," ").concat(s[7]).concat(h?" L ".concat(s[6]+r,",").concat(s[7]+i):"");case"Z":return"Z";default:return null}}).filter(function(s){return s!==null}).join(" ");return~a.indexOf("NaN")?"":a}var Op=function(t){if(t===""||Array.isArray(t)&&t.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=tc(t)}catch(f){e=tc(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}JS(e);var r=$S(e),i=tM(e),a=i.polygons,s=i.polylines,o=nM(e),l=eM(o,0),c=l.x,u=l.y,h=l.width,d=l.height;return{absolutePath:e,hasArc:r,segments:o,polygons:a,polylines:s,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(u)?u:0,width:Number.isFinite(h)?h:0,height:Number.isFinite(d)?d:0}}},lM=zn(Op);function Cp(n){return Ge(n)?lM(n):Op(n)}function cM(n,t,e){var r=n.curve,i=t.curve;(!r||r.length===0)&&(r=Cd(n.absolutePath,!1),n.curve=r),(!i||i.length===0)&&(i=Cd(t.absolutePath,!1),t.curve=i);var a=[r,i];r.length!==i.length&&(a=Sg(r,i));var s=Mg(a[0])!==Mg(a[1])?r2(a[0]):i2(a[0]);return[s,s2(a[1],s),function(o){return o}]}function uM(n,t){var e;return Ge(n)?e=n.split(" ").map(function(r){var i=r.split(","),a=(0,R.Z)(i,2),s=a[0],o=a[1];return[Number(s),Number(o)]}):e=n,{points:e,totalLength:0,segments:[]}}function hM(n,t){return[n.points,t.points,function(e){return e}]}var Pn=null,oo=/\s*(\w+)\(([^)]*)\)/g;function Yr(n){return function(t){var e=0;return n.map(function(r){return r===Pn?t[e++]:r})}}function bs(n){return n}var tl={matrix:["NNNNNN",[Pn,Pn,0,0,Pn,Pn,0,0,0,0,1,0,Pn,Pn,0,1],bs],matrix3d:["NNNNNNNNNNNNNNNN",bs],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Yr([Pn,Pn,new on(1)]),bs],scaleX:["N",Yr([Pn,new on(1),new on(1)]),Yr([Pn,new on(1)])],scaleY:["N",Yr([new on(1),Pn,new on(1)]),Yr([new on(1),Pn])],scaleZ:["N",Yr([new on(1),new on(1),Pn])],scale3d:["NNN",bs],skew:["Aa",null,bs],skewX:["A",null,Yr([Pn,ms])],skewY:["A",null,Yr([ms,Pn])],translate:["Tt",Yr([Pn,Pn,Pi]),bs],translateX:["T",Yr([Pn,Pi,Pi]),Yr([Pn,Pi])],translateY:["T",Yr([Pi,Pn,Pi]),Yr([Pi,Pn])],translateZ:["L",Yr([Pi,Pi,Pn])],translate3d:["TTL",bs]};function Np(n){for(var t=[],e=n.length,r=0;r<e;r++){var i=n[r],a=i[0],s=i.slice(1);a==="translate"||a==="skew"?s.length===1&&s.push(0):a==="scale"&&s.length===1&&s.push(s[0]);var o=tl[a];if(!o)return[];var l=s.map(function(c){return En(c)});t.push({t:a,d:l})}return t}function kp(n){if(Array.isArray(n))return Np(n);if(n=(n||"none").trim(),n==="none")return[];var t=[],e,r=0;for(oo.lastIndex=0;e=oo.exec(n);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=tl[i];if(!a)return[];var s=e[2].split(","),o=a[0];if(o.length<s.length)return[];for(var l=[],c=0;c<o.length;c++){var u=s[c],h=o[c],d=void 0;if(u?d={A:function(v){return v.trim()==="0"?ms:YS(v)},N:Ud,T:Vd,L:VS}[h.toUpperCase()](u):d={a:ms,n:l[0],t:Pi}[h],d===void 0)return[];l.push(d)}if(t.push({t:i,d:l}),oo.lastIndex===n.length)return t}return[]}function dM(n){if(Array.isArray(n))return Np(n);if(n=(n||"none").trim(),n==="none")return[];var t=[],e,r=0;for(oo.lastIndex=0;e=oo.exec(n);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=tl[i];if(!a)return[];var s=e[2].split(","),o=a[0];if(o.length<s.length)return[];for(var l=[],c=0;c<o.length;c++){var u=s[c],h=o[c],d=void 0;if(u?d={A:function(v){return v.trim()==="0"?ms:pp(v)},N:bp,T:gp,L:vp}[h.toUpperCase()](u):d={a:ms,n:l[0],t:Pi}[h],d===void 0)return[];l.push(d)}if(t.push({t:i,d:l}),oo.lastIndex===n.length)return t}return[]}function fM(n){var t,e,r,i;switch(n.t){case"rotateX":return i=an(Ur(n.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=an(Ur(n.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=an(Ur(n.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":t=n.d[0].value,e=n.d[1].value,r=n.d[2].value,i=an(Ur(n.d[3]));var a=t*t+e*e+r*r;if(a===0)t=1,e=0,r=0;else if(a!==1){var s=Math.sqrt(a);t/=s,e/=s,r/=s}var o=Math.sin(i/2),l=o*Math.cos(i/2),c=o*o;return[1-2*(e*e+r*r)*c,2*(t*e*c+r*l),2*(t*r*c-e*l),0,2*(t*e*c-r*l),1-2*(t*t+r*r)*c,2*(e*r*c+t*l),0,2*(t*r*c+e*l),2*(e*r*c-t*l),1-2*(t*t+e*e)*c,0,0,0,0,1];case"scale":return[n.d[0].value,0,0,0,0,n.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[n.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,n.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,n.d[0].value,0,0,0,0,1];case"scale3d":return[n.d[0].value,0,0,0,0,n.d[1].value,0,0,0,0,n.d[2].value,0,0,0,0,1];case"skew":var u=an(Ur(n.d[0])),h=an(Ur(n.d[1]));return[1,Math.tan(h),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=an(Ur(n.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=an(Ur(n.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return t=ei(n.d[0],0,null)||0,e=ei(n.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1];case"translateX":return t=ei(n.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,0,0,1];case"translateY":return e=ei(n.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,e,0,1];case"translateZ":return r=ei(n.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r,1];case"translate3d":return t=ei(n.d[0],0,null)||0,e=ei(n.d[1],0,null)||0,r=ei(n.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,e,r,1];case"perspective":var d=ei(n.d[0],0,null)||0,f=d?-1/d:0;return[1,0,0,0,0,1,0,0,0,0,1,f,0,0,0,1];case"matrix":return[n.d[0].value,n.d[1].value,0,0,n.d[2].value,n.d[3].value,0,0,0,0,1,0,n.d[4].value,n.d[5].value,0,1];case"matrix3d":return n.d.map(function(v){return v.value})}}function vM(n,t){return[n[0]*t[0]+n[4]*t[1]+n[8]*t[2]+n[12]*t[3],n[1]*t[0]+n[5]*t[1]+n[9]*t[2]+n[13]*t[3],n[2]*t[0]+n[6]*t[1]+n[10]*t[2]+n[14]*t[3],n[3]*t[0]+n[7]*t[1]+n[11]*t[2]+n[15]*t[3],n[0]*t[4]+n[4]*t[5]+n[8]*t[6]+n[12]*t[7],n[1]*t[4]+n[5]*t[5]+n[9]*t[6]+n[13]*t[7],n[2]*t[4]+n[6]*t[5]+n[10]*t[6]+n[14]*t[7],n[3]*t[4]+n[7]*t[5]+n[11]*t[6]+n[15]*t[7],n[0]*t[8]+n[4]*t[9]+n[8]*t[10]+n[12]*t[11],n[1]*t[8]+n[5]*t[9]+n[9]*t[10]+n[13]*t[11],n[2]*t[8]+n[6]*t[9]+n[10]*t[10]+n[14]*t[11],n[3]*t[8]+n[7]*t[9]+n[11]*t[10]+n[15]*t[11],n[0]*t[12]+n[4]*t[13]+n[8]*t[14]+n[12]*t[15],n[1]*t[12]+n[5]*t[13]+n[9]*t[14]+n[13]*t[15],n[2]*t[12]+n[6]*t[13]+n[10]*t[14]+n[14]*t[15],n[3]*t[12]+n[7]*t[13]+n[11]*t[14]+n[15]*t[15]]}function gM(n){return n.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:n.map(fM).reduce(vM)}function Pp(n){var t=[0,0,0],e=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return Q2(gM(n),t,e,r,i,a),[[t,e,r,a,i]]}var pM=function(){function n(r,i){for(var a=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],s=0;s<4;s++)for(var o=0;o<4;o++)for(var l=0;l<4;l++)a[s][o]+=i[s][l]*r[l][o];return a}function t(r){return r[0][2]===0&&r[0][3]===0&&r[1][2]===0&&r[1][3]===0&&r[2][0]===0&&r[2][1]===0&&r[2][2]===1&&r[2][3]===0&&r[3][2]===0&&r[3][3]===1}function e(r,i,a,s,o){for(var l=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],c=0;c<4;c++)l[c][3]=o[c];for(var u=0;u<3;u++)for(var h=0;h<3;h++)l[3][u]+=r[h]*l[h][u];var d=s[0],f=s[1],v=s[2],g=s[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(f*f+v*v),p[0][1]=2*(d*f-v*g),p[0][2]=2*(d*v+f*g),p[1][0]=2*(d*f+v*g),p[1][1]=1-2*(d*d+v*v),p[1][2]=2*(f*v-d*g),p[2][0]=2*(d*v-f*g),p[2][1]=2*(f*v+d*g),p[2][2]=1-2*(d*d+f*f),l=n(l,p);var y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];a[2]&&(y[2][1]=a[2],l=n(l,y)),a[1]&&(y[2][1]=0,y[2][0]=a[0],l=n(l,y)),a[0]&&(y[2][0]=0,y[1][0]=a[0],l=n(l,y));for(var b=0;b<3;b++)for(var E=0;E<3;E++)l[b][E]*=i[b];return t(l)?[l[0][0],l[0][1],l[1][0],l[1][1],l[3][0],l[3][1]]:l[0].concat(l[1],l[2],l[3])}return e}();function mM(n){return n.toFixed(6).replace(".000000","")}function Qd(n,t){var e,r;return n.decompositionPair!==t&&(n.decompositionPair=t,e=Pp(n)),t.decompositionPair!==n&&(t.decompositionPair=n,r=Pp(t)),e[0]===null||r[0]===null?[[!1],[!0],function(i){return i?t[0].d:n[0].d}]:(e[0].push(0),r[0].push(1),[e,r,function(i){var a=bM(e[0][3],r[0][3],i[5]),s=pM(i[0],i[1],i[2],a,i[4]),o=s.map(mM).join(",");return o}])}function yM(n,t){for(var e=0,r=0;r<n.length;r++)e+=n[r]*t[r];return e}function bM(n,t,e){var r=yM(n,t);r=kn(r,-1,1);var i=[];if(r===1)i=n;else for(var a=Math.acos(r),s=Math.sin(e*a)*1/Math.sqrt(1-r*r),o=0;o<4;o++)i.push(n[o]*(Math.cos(e*a)-r*s)+t[o]*s);return i}function qd(n){return n.replace(/[XY]/,"")}function Jd(n){return n.replace(/(X|Y|Z|3d)?$/,"3d")}var xM=function(t,e){return t==="perspective"&&e==="perspective"||(t==="matrix"||t==="matrix3d")&&(e==="matrix"||e==="matrix3d")};function EM(n,t,e){var r=!1;if(!n.length||!t.length){n.length||(r=!0,n=t,t=[]);for(var i=function(){var J=n[a],$=J.t,ot=J.d,ct=$.substring(0,5)==="scale"?1:0;t.push({t:$,d:ot.map(function(ft){return typeof ft=="number"?En(ct):En(ct,ft.unit)})})},a=0;a<n.length;a++)i()}var s=[],o=[],l=[];if(n.length!==t.length){var c=Qd(n,t);s=[c[0]],o=[c[1]],l=[["matrix",[c[2]]]]}else for(var u=0;u<n.length;u++){var h=n[u].t,d=t[u].t,f=n[u].d,v=t[u].d,g=tl[h],p=tl[d],y=void 0;if(xM(h,d)){var b=Qd([n[u]],[t[u]]);s.push(b[0]),o.push(b[1]),l.push(["matrix",[b[2]]]);continue}else if(h===d)y=h;else if(g[2]&&p[2]&&qd(h)===qd(d))y=qd(h),f=g[2](f),v=p[2](v);else if(g[1]&&p[1]&&Jd(h)===Jd(d))y=Jd(h),f=g[1](f),v=p[1](v);else{var E=Qd(n,t);s=[E[0]],o=[E[1]],l=[["matrix",[E[2]]]];break}for(var O=[],P=[],L=[],F=0;F<f.length;F++){var I=HS(f[F],v[F],e,!1,F);O[F]=I[0],P[F]=I[1],L.push(I[2])}s.push(O),o.push(P),l.push([y,L])}if(r){var V=s;s=o,o=V}return[s,o,function(Y){return Y.map(function(J,$){var ot=J.map(function(ct,ft){return l[$][1][ft](ct)}).join(",");return l[$][0]==="matrix"&&ot.split(",").length===16&&(l[$][0]="matrix3d"),l[$][0]==="matrix3d"&&ot.split(",").length===6&&(l[$][0]="matrix"),"".concat(l[$][0],"(").concat(ot,")")}).join(" ")}]}var wM=zn(function(n){if(Ge(n)){if(n==="text-anchor")return[En(0,"px"),En(0,"px")];var t=n.split(" ");return t.length===1&&(t[0]==="top"||t[0]==="bottom"?(t[1]=t[0],t[0]="center"):t[1]="center"),t.length!==2?null:[Vd(Rp(t[0])),Vd(Rp(t[1]))]}return[En(n[0]||0,"px"),En(n[1]||0,"px")]});function Rp(n){return n==="center"?"50%":n==="left"||n==="top"?"0%":n==="right"||n==="bottom"?"100%":n}var $d=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:$t.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:$t.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:$t.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:$t.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:$t.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:$t.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:$t.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:$t.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:$t.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:$t.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:$t.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:$t.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:$t.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:$t.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:$t.FILTER},{n:"clipPath",syntax:$t.DEFINED_PATH},{n:"textPath",syntax:$t.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:$t.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:$t.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:$t.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:$t.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:$t.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:$t.COORDINATE},{n:"y1",int:!0,l:!0,syntax:$t.COORDINATE},{n:"z1",int:!0,l:!0,syntax:$t.COORDINATE},{n:"x2",int:!0,l:!0,syntax:$t.COORDINATE},{n:"y2",int:!0,l:!0,syntax:$t.COORDINATE},{n:"z2",int:!0,l:!0,syntax:$t.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:$t.PATH,p:50},{n:"points",int:!0,l:!0,syntax:$t.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:$t.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:$t.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:$t.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:$t.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:$t.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:$t.NUMBER,d:function(t){return t===Dt.PATH||t===Dt.POLYGON||t===Dt.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:$t.MARKER},{n:"markerEnd",syntax:$t.MARKER},{n:"markerMid",syntax:$t.MARKER},{n:"markerStartOffset",syntax:$t.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:$t.LENGTH,l:!0,int:!0,d:"0"}],SM=new Set($d.filter(function(n){return!!n.l}).map(function(n){return n.n})),Lp={},MM=function(){function n(t){var e=this;(0,N.Z)(this,n),this.runtime=t,$d.forEach(function(r){e.registerMetadata(r)})}return(0,T.Z)(n,[{key:"registerMetadata",value:function(e){[e.n].concat((0,k.Z)(e.a||[])).forEach(function(r){Lp[r]=e})}},{key:"getPropertySyntax",value:function(e){return this.runtime.CSSPropertySyntaxFactory[e]}},{key:"processProperties",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(e.attributes,r);var a=e.parsedStyle.clipPath,s=e.parsedStyle.offsetPath;AM(e,r);var o=!!i.forceUpdateGeometry;if(!o){for(var l in r)if(SM.has(l)){o=!0;break}}var c=_p(e);c.has("fill")&&r.fill&&(e.parsedStyle.fill=Jo(r.fill)),c.has("stroke")&&r.stroke&&(e.parsedStyle.stroke=Jo(r.stroke)),c.has("shadowColor")&&r.shadowColor&&(e.parsedStyle.shadowColor=Jo(r.shadowColor)),c.has("filter")&&r.filter&&(e.parsedStyle.filter=QS(r.filter)),c.has("radius")&&!me(r.radius)&&(e.parsedStyle.radius=mp(r.radius,4)),c.has("lineDash")&&!me(r.lineDash)&&(e.parsedStyle.lineDash=mp(r.lineDash,"even")),c.has("points")&&r.points&&(e.parsedStyle.points=uM(r.points)),c.has("d")&&r.d===""&&(e.parsedStyle.d=(0,B.Z)({},Jg)),c.has("d")&&r.d&&(e.parsedStyle.d=Cp(r.d)),c.has("textTransform")&&r.textTransform&&this.runtime.CSSPropertySyntaxFactory[$t.TEXT_TRANSFORM].calculator(null,null,{value:r.textTransform},e,null),c.has("clipPath")&&!Te(r.clipPath)&&this.runtime.CSSPropertySyntaxFactory[$t.DEFINED_PATH].calculator("clipPath",a,r.clipPath,e,this.runtime),c.has("offsetPath")&&r.offsetPath&&this.runtime.CSSPropertySyntaxFactory[$t.DEFINED_PATH].calculator("offsetPath",s,r.offsetPath,e,this.runtime),c.has("transform")&&r.transform&&(e.parsedStyle.transform=kp(r.transform)),c.has("transformOrigin")&&r.transformOrigin&&(e.parsedStyle.transformOrigin=wM(r.transformOrigin)),c.has("markerStart")&&r.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[$t.MARKER].calculator(null,r.markerStart,r.markerStart,null,null)),c.has("markerEnd")&&r.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[$t.MARKER].calculator(null,r.markerEnd,r.markerEnd,null,null)),c.has("markerMid")&&r.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[$t.MARKER].calculator("",r.markerMid,r.markerMid,null,null)),c.has("zIndex")&&!me(r.zIndex)&&this.runtime.CSSPropertySyntaxFactory[$t.Z_INDEX].postProcessor(e),c.has("offsetDistance")&&!me(r.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[$t.OFFSET_DISTANCE].postProcessor(e),c.has("transform")&&r.transform&&this.runtime.CSSPropertySyntaxFactory[$t.TRANSFORM].postProcessor(e),c.has("transformOrigin")&&r.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[$t.TRANSFORM_ORIGIN].postProcessor(e),o&&(e.geometry.dirty=!0,e.dirty(!0,!0),i.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(e))}},{key:"updateGeometry",value:function(e){var r=e.nodeName,i=this.runtime.geometryUpdaterFactory[r];if(i){var a=e.geometry;a.contentBounds||(a.contentBounds=new pn),a.renderBounds||(a.renderBounds=new pn);var s=e.parsedStyle,o=i.update(s,e),l=o.cx,c=l===void 0?0:l,u=o.cy,h=u===void 0?0:u,d=o.cz,f=d===void 0?0:d,v=o.hwidth,g=v===void 0?0:v,p=o.hheight,y=p===void 0?0:p,b=o.hdepth,E=b===void 0?0:b,O=[Math.abs(g),Math.abs(y),E],P=s.stroke,L=s.lineWidth,F=L===void 0?1:L,I=s.increasedLineWidthForHitTesting,V=I===void 0?0:I,Y=s.shadowType,J=Y===void 0?"outer":Y,$=s.shadowColor,ot=s.filter,ct=ot===void 0?[]:ot,ft=s.transformOrigin,Nt=[c,h,f];a.contentBounds.update(Nt,O);var Ot=r===Dt.POLYLINE||r===Dt.POLYGON||r===Dt.PATH?Math.SQRT2:.5,mt=P&&!P.isNone;if(mt){var yt=((F||0)+(V||0))*Ot;O[0]+=yt,O[1]+=yt}if(a.renderBounds.update(Nt,O),$&&J&&J!=="inner"){var Rt=a.renderBounds,jt=Rt.min,Xt=Rt.max,ee=s.shadowBlur,ae=s.shadowOffsetX,he=s.shadowOffsetY,ce=ee||0,xe=ae||0,Ce=he||0,je=jt[0]-ce+xe,Ue=Xt[0]+ce+xe,or=jt[1]-ce+Ce,Ke=Xt[1]+ce+Ce;jt[0]=Math.min(jt[0],je),Xt[0]=Math.max(Xt[0],Ue),jt[1]=Math.min(jt[1],or),Xt[1]=Math.max(Xt[1],Ke),a.renderBounds.setMinMax(jt,Xt)}ct.forEach(function(fr){var Ma=fr.name,Sr=fr.params;if(Ma==="blur"){var Jr=Sr[0].value;a.renderBounds.update(a.renderBounds.center,Ut(a.renderBounds.halfExtents,a.renderBounds.halfExtents,[Jr,Jr,0]))}else if(Ma==="drop-shadow"){var Be=Sr[0].value,Qe=Sr[1].value,Fe=Sr[2].value,Ye=a.renderBounds,nn=Ye.min,pe=Ye.max,He=nn[0]-Fe+Be,qe=pe[0]+Fe+Be,tr=nn[1]-Fe+Qe,Je=pe[1]+Fe+Qe;nn[0]=Math.min(nn[0],He),pe[0]=Math.max(pe[0],qe),nn[1]=Math.min(nn[1],tr),pe[1]=Math.max(pe[1],Je),a.renderBounds.setMinMax(nn,pe)}}),e.geometry.dirty=!1;var ui=g<0,Pr=y<0,ns=(ui?-1:1)*(ft?ei(ft[0],0,e,!0):0),wr=(Pr?-1:1)*(ft?ei(ft[1],1,e,!0):0);(ns||wr)&&e.setOrigin(ns,wr)}}},{key:"updateSizeAttenuation",value:function(e,r){e.style.isSizeAttenuation?(e.style.rawLineWidth||(e.style.rawLineWidth=e.style.lineWidth),e.style.lineWidth=(e.style.rawLineWidth||1)/r,e.nodeName===Dt.CIRCLE&&(e.style.rawR||(e.style.rawR=e.style.r),e.style.r=(e.style.rawR||1)/r)):(e.style.rawLineWidth&&(e.style.lineWidth=e.style.rawLineWidth,delete e.style.rawLineWidth),e.nodeName===Dt.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))}}])}();function AM(n,t){var e=_p(n);for(var r in t)e.has(r)&&(n.parsedStyle[r]=t[r])}function _p(n){return n.constructor.PARSED_STYLE_LIST}var TM=function(){function n(){(0,N.Z)(this,n),this.mixer=Yd}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i,a){return Ur(i)}}])}(),OM=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i,a,s){return i instanceof gi&&(i=null),s.sceneGraphService.updateDisplayObjectDependency(e,r,i,a),e==="clipPath"&&a.forEach(function(o){o.childNodes.length===0&&s.sceneGraphService.dirtyToRoot(o)}),i}}])}(),CM=function(){function n(){(0,N.Z)(this,n),this.parser=Jo,this.mixer=GS}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i,a){return i instanceof gi?i.value==="none"?hp:dp:i}}])}(),NM=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i){return i instanceof gi?[]:i}}])}();function Dp(n){var t=n.parsedStyle,e=t.fontSize;return me(e)?null:e}var tf=function(){function n(){(0,N.Z)(this,n),this.mixer=Yd}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i,a,s){if(ie(i))return i;if(on.isRelativeUnit(i.unit)){if(i.unit===te.kPercentage)return 0;if(i.unit===te.kEms){if(a.parentNode){var o=Dp(a.parentNode);if(o)return o*=i.value,o}return 0}if(i.unit===te.kRems){var l;if(a!=null&&(l=a.ownerDocument)!==null&&l!==void 0&&l.documentElement){var c=Dp(a.ownerDocument.documentElement);if(c)return c*=i.value,c}return 0}}else return i.value}}])}(),kM=function(){function n(){(0,N.Z)(this,n),this.mixer=xp}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i){return i.map(function(a){return a.value})}}])}(),PM=function(){function n(){(0,N.Z)(this,n),this.mixer=xp}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i){return i.map(function(a){return a.value})}}])}(),RM=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i,a){var s;i instanceof gi&&(i=null);var o=(s=i)===null||s===void 0?void 0:s.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])}(),LM=function(){function n(){(0,N.Z)(this,n),this.mixer=Yd}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i){return i.value}}])}(),_M=function(){function n(){(0,N.Z)(this,n),this.mixer=Hd(0,1)}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i){return i.value}},{key:"postProcessor",value:function(e){var r=e.parsedStyle,i=r.offsetPath,a=r.offsetDistance;if(i){var s=i.nodeName;if(s===Dt.LINE||s===Dt.PATH||s===Dt.POLYLINE){var o=i.getPoint(a);o&&e.setLocalPosition(o.x,o.y)}}}}])}(),DM=function(){function n(){(0,N.Z)(this,n),this.mixer=Hd(0,1)}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i){return i.value}}])}(),IM=function(){function n(){(0,N.Z)(this,n),this.parser=Cp,this.mixer=cM}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i){return i instanceof gi&&i.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new no(0,0,0,0)}:i}}])}(),BM=(0,T.Z)(function n(){(0,N.Z)(this,n),this.mixer=hM}),FM=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.mixer=Hd(0,1/0),e}return(0,C.Z)(t,n),(0,T.Z)(t)}(tf),zM=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i,a){return i instanceof gi?i.value==="unset"?"":i.value:"".concat(i)}},{key:"postProcessor",value:function(e){e.nodeValue="".concat(e.parsedStyle.text)||""}}])}(),jM=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i,a){var s=a.getAttribute("text");if(s){var o=s;i.value==="capitalize"?o=s.charAt(0).toUpperCase()+s.slice(1):i.value==="lowercase"?o=s.toLowerCase():i.value==="uppercase"&&(o=s.toUpperCase()),a.parsedStyle.text=o}return i.value}}])}(),Y8=function(t){return Object.fromEntries(Object.entries(t).filter(function(e){var r=_slicedToArray(e,2),i=r[1];return i!==void 0}))},ef=new WeakMap;function ZM(n,t,e){if(n){var r=typeof n=="string"?document.getElementById(n):n;ef.has(r)&&ef.get(r).destroy(e),ef.set(r,t)}}var nf=typeof window!="undefined"&&typeof window.document!="undefined";function WM(n){return!!n.getAttribute}function GM(n,t){for(var e=0,r=n.length;e<r;){var i=e+r>>>1;Ip(n[i],t)<0?e=i+1:r=i}return e}function Ip(n,t){var e=Number(n.parsedStyle.zIndex||0),r=Number(t.parsedStyle.zIndex||0);if(e===r){var i=n.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(n)-a.indexOf(t)}}return e-r}function Bp(n){var t=n;do{var e,r=(e=t.parsedStyle)===null||e===void 0?void 0:e.clipPath;if(r)return t;t=t.parentElement}while(t!==null);return null}var Fp="px";function VM(n,t,e){nf&&n.style&&(n.style.width=t+Fp,n.style.height=e+Fp)}function zp(n,t){if(nf)return document.defaultView.getComputedStyle(n,null).getPropertyValue(t)}function UM(n){var t=zp(n,"width");return t==="auto"?n.offsetWidth:parseFloat(t)}function YM(n){var t=zp(n,"height");return t==="auto"?n.offsetHeight:parseFloat(t)}var HM=1,XM={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},rf=typeof performance=="object"&&performance.now?performance:Date;function xc(n){return n.nodeName===Dt.FRAGMENT?!0:n.getRootNode().nodeName===Dt.FRAGMENT}function xs(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auto",t=arguments.length>1?arguments[1]:void 0,e=arguments.length>2?arguments[2]:void 0,r=!1,i=!1,a=!!t&&!t.isNone,s=!!e&&!e.isNone;return n==="visiblepainted"||n==="painted"||n==="auto"?(r=a,i=s):n==="visiblefill"||n==="fill"?r=!0:n==="visiblestroke"||n==="stroke"?i=!0:(n==="visible"||n==="all")&&(r=!0,i=!0),[r,i]}var KM=1,QM=function(){return KM++},Ki=typeof self=="object"&&self.self===self?self:typeof S.g=="object"&&S.g.global===S.g?S.g:{},qM=Date.now(),JM=function(){return Ki.performance&&typeof Ki.performance.now=="function"?Ki.performance.now():Date.now()-qM},el={},jp=Date.now(),$M=function(t){if(typeof t!="function")throw new TypeError("".concat(t," is not a function"));var e=Date.now(),r=e-jp,i=r>16?0:16-r,a=QM();return el[a]=t,Object.keys(el).length>1||setTimeout(function(){jp=e;var s=el;el={},Object.keys(s).forEach(function(o){return s[o](JM())})},i),a},tA=function(t){delete el[t]},eA=["","webkit","moz","ms","o"],Zp=function(t){return typeof t!="string"?$M:t===""?Ki.requestAnimationFrame:Ki["".concat(t,"RequestAnimationFrame")]},nA=function(t){return typeof t!="string"?tA:t===""?Ki.cancelAnimationFrame:Ki["".concat(t,"CancelAnimationFrame")]||Ki["".concat(t,"CancelRequestAnimationFrame")]},rA=function(t,e){for(var r=0;t[r]!==void 0;){if(e(t[r]))return t[r];r+=1}},Wp=rA(eA,function(n){return!!Zp(n)}),af=Zp(Wp),Gp=nA(Wp);Ki.requestAnimationFrame=af,Ki.cancelAnimationFrame=Gp;var iA=function(){function n(){(0,N.Z)(this,n),this.callbacks=[]}return(0,T.Z)(n,[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(e,r){this.callbacks.push(r)}},{key:"promise",value:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return Promise.all(this.callbacks.map(function(a){return a.apply(void 0,r)}))}}])}(),aA=function(){function n(){(0,N.Z)(this,n),this.callbacks=[]}return(0,T.Z)(n,[{key:"tapPromise",value:function(e,r){this.callbacks.push(r)}},{key:"promise",value:function(){var t=(0,Ra.Z)((0,Tr.Z)().mark(function r(){var i,a,s,o,l=arguments;return(0,Tr.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!this.callbacks.length){c.next=6;break}return c.next=1,(i=this.callbacks)[0].apply(i,l);case 1:a=c.sent,s=0;case 2:if(!(s<this.callbacks.length-1)){c.next=5;break}return o=this.callbacks[s],c.next=3,o(a);case 3:a=c.sent;case 4:s++,c.next=2;break;case 5:return c.abrupt("return",a);case 6:return c.abrupt("return",null);case 7:case"end":return c.stop()}},r,this)}));function e(){return t.apply(this,arguments)}return e}()}])}(),Ir=function(){function n(){(0,N.Z)(this,n),this.callbacks=[]}return(0,T.Z)(n,[{key:"tap",value:function(e,r){this.callbacks.push(r)}},{key:"call",value:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var a=arguments;this.callbacks.forEach(function(s){s.apply(void 0,a)})}}])}(),sf=function(){function n(){(0,N.Z)(this,n),this.callbacks=[]}return(0,T.Z)(n,[{key:"tap",value:function(e,r){this.callbacks.push(r)}},{key:"call",value:function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];if(this.callbacks.length){for(var a=arguments,s=this.callbacks[0].apply(void 0,a),o=0;o<this.callbacks.length-1;o++){var l=this.callbacks[o];s=l(s)}return s}return null}}])}(),sA=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],oA=/([\"\'])[^\'\"]+\1/;function Vp(n){var t=n.fontSize,e=t===void 0?16:t,r=n.fontFamily,i=r===void 0?"sans-serif":r,a=n.fontStyle,s=a===void 0?"normal":a,o=n.fontVariant,l=o===void 0?"normal":o,c=n.fontWeight,u=c===void 0?"normal":c;return{fontSize:e,fontFamily:i,fontStyle:s,fontVariant:l,fontWeight:u}}var Up=zn(function(t){for(var e=Vp(t),r=e.fontSize,i=e.fontFamily,a=e.fontStyle,s=e.fontVariant,o=e.fontWeight,l=ie(r)&&"".concat(r,"px")||"16px",c=i.split(","),u=c.length-1;u>=0;u--){var h=c[u].trim();!oA.test(h)&&sA.indexOf(h)<0&&(h='"'.concat(h,'"')),c[u]=h}return"".concat(a," ").concat(s," ").concat(o," ").concat(l," ").concat(c.join(","))},function(n){var t=Vp(n),e=t.fontSize,r=t.fontFamily,i=t.fontStyle,a=t.fontVariant,s=t.fontWeight;return"".concat(i,"_").concat(a,"_").concat(s,"_").concat(e,"_").concat(r)}),lA=1e-6,nl=function(t){return Math.max(t,lA)};function of(n,t,e){return ge(n),n[4]=Math.tan(t),n[1]=Math.tan(e),n}var jn=Wt(),cA=Wt(),uA={scale:function(t){gn(jn,[t[0].value,t[1].value,1].map(function(e){return nl(e)}))},scaleX:function(t){gn(jn,[t[0].value,1,1].map(function(e){return nl(e)}))},scaleY:function(t){gn(jn,[1,t[0].value,1].map(function(e){return nl(e)}))},scaleZ:function(t){gn(jn,[1,1,t[0].value].map(function(e){return nl(e)}))},scale3d:function(t){gn(jn,[t[0].value,t[1].value,t[2].value].map(function(e){return nl(e)}))},translate:function(t){Hn(jn,[t[0].value,t[1].value,0])},translateX:function(t){Hn(jn,[t[0].value,0,0])},translateY:function(t){Hn(jn,[0,t[0].value,0])},translateZ:function(t){Hn(jn,[0,0,t[0].value])},translate3d:function(t){Hn(jn,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Bn(jn,an(Ur(t[0])))},rotateX:function(t){fi(jn,an(Ur(t[0])))},rotateY:function(t){ze(jn,an(Ur(t[0])))},rotateZ:function(t){Bn(jn,an(Ur(t[0])))},rotate3d:function(t){ti(jn,an(Ur(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){of(jn,an(t[0].value),an(t[1].value))},skewX:function(t){of(jn,an(t[0].value),0)},skewY:function(t){of(jn,0,an(t[0].value))},matrix:function(t){un(jn,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){un.apply(A,[jn].concat((0,k.Z)(t.map(function(e){return e.value}))))}},hA=Et(1,1,1),dA=pt(),Yp={translate:function(t,e){Vt.sceneGraphService.setLocalScale(t,hA,!1),Vt.sceneGraphService.setLocalEulerAngles(t,dA,void 0,void 0,!1),Vt.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Vt.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};function Hp(n,t){if(n.length){if(n.length===1&&Yp[n[0].t]){Yp[n[0].t](t,n[0].d);return}for(var e=ge(cA),r=0;r<n.length;r++){var i=n[r],a=i.t,s=i.d,o=uA[a];o&&(o(s),lg(e,e,jn))}t.setLocalTransform(e)}else t.resetLocalTransform();return t.getLocalTransform()}var fA=function(){function n(){(0,N.Z)(this,n),this.parser=dM,this.mixer=EM}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i,a){return i instanceof gi?[]:i}},{key:"postProcessor",value:function(e){Hp(e.parsedStyle.transform,e)}}])}(),vA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"postProcessor",value:function(e){var r=e.parsedStyle.transformOrigin;r[0].unit===te.kPixels&&r[1].unit===te.kPixels?e.setOrigin(r[0].value,r[1].value):e.getGeometryBounds()}}])}(),gA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"calculator",value:function(e,r,i,a){return i.value}},{key:"postProcessor",value:function(e){if(e.parentNode){var r=e.parentNode,i=r.renderable,a=r.sortable;i&&r.dirty(),a&&(a.dirty=!0,a.dirtyReason=lc.Z_INDEX_CHANGED)}}}])}(),pA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"update",value:function(e,r){var i=e.cx,a=i===void 0?0:i,s=e.cy,o=s===void 0?0:s,l=e.r,c=l===void 0?0:l;return{cx:a,cy:o,hwidth:c,hheight:c}}}])}(),mA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"update",value:function(e,r){var i=e.cx,a=i===void 0?0:i,s=e.cy,o=s===void 0?0:s,l=e.rx,c=l===void 0?0:l,u=e.ry,h=u===void 0?0:u;return{cx:a,cy:o,hwidth:c,hheight:h}}}])}(),yA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"update",value:function(e){var r=e.x1,i=e.y1,a=e.x2,s=e.y2,o=Math.min(r,a),l=Math.max(r,a),c=Math.min(i,s),u=Math.max(i,s),h=l-o,d=u-c,f=h/2,v=d/2;return{cx:o+f,cy:c+v,hwidth:f,hheight:v}}}])}(),bA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"update",value:function(e){var r=e.d,i=r.rect,a=i.x,s=i.y,o=i.width,l=i.height,c=o/2,u=l/2;return{cx:a+c,cy:s+u,hwidth:c,hheight:u}}}])}(),xA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"update",value:function(e){if(e.points&&Wr(e.points.points)){var r=e.points.points,i=Math.min.apply(Math,(0,k.Z)(r.map(function(d){return d[0]}))),a=Math.max.apply(Math,(0,k.Z)(r.map(function(d){return d[0]}))),s=Math.min.apply(Math,(0,k.Z)(r.map(function(d){return d[1]}))),o=Math.max.apply(Math,(0,k.Z)(r.map(function(d){return d[1]}))),l=a-i,c=o-s,u=l/2,h=c/2;return{cx:i+u,cy:s+h,hwidth:u,hheight:h}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),EA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"update",value:function(e,r){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s,l=e.src,c=e.width,u=c===void 0?0:c,h=e.height,d=h===void 0?0:h,f=u,v=d;return l&&!Ge(l)&&(f||(f=l.width,e.width=f),v||(v=l.height,e.height=v)),{cx:a+f/2,cy:o+v/2,hwidth:f/2,hheight:v/2}}}])}(),wA=function(){function n(t){(0,N.Z)(this,n),this.globalRuntime=t}return(0,T.Z)(n,[{key:"isReadyToMeasure",value:function(e,r){var i=e.text;return i}},{key:"update",value:function(e,r){var i,a=e.text,s=e.textAlign,o=s===void 0?"start":s,l=e.lineWidth,c=l===void 0?1:l,u=e.textBaseline,h=u===void 0?"alphabetic":u,d=e.dx,f=d===void 0?0:d,v=e.dy,g=v===void 0?0:v,p=e.x,y=p===void 0?0:p,b=e.y,E=b===void 0?0:b;if(!this.isReadyToMeasure(e,r))return e.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var O=(r==null||(i=r.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0?void 0:i.getConfig())||{},P=O.offscreenCanvas,L=this.globalRuntime.textService.measureText(a,e,P);e.metrics=L;var F=L.width,I=L.height,V=F/2,Y=I/2,J=y+V;o==="center"||o==="middle"?J+=c/2-V:(o==="right"||o==="end")&&(J+=c-V*2);var $=E-Y;return h==="middle"?$+=Y:h==="top"||h==="hanging"?$+=Y*2:h==="alphabetic"||(h==="bottom"||h==="ideographic")&&($+=0),f&&(J+=f),g&&($+=g),{cx:J,cy:$,hwidth:V,hheight:Y}}}])}(),SA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"update",value:function(e,r){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),MA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"update",value:function(e,r){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s,l=e.width,c=l===void 0?0:l,u=e.height,h=u===void 0?0:u;return{cx:a+c/2,cy:o+h/2,hwidth:c/2,hheight:h/2}}}])}();function H8(n){return!!n.type}var Ec=function(){function n(t){(0,N.Z)(this,n),this.eventPhase=n.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new vr,this.page=new vr,this.canvas=new vr,this.viewport=new vr,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}return(0,T.Z)(n,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(rn)}}])}(),Xp=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.client=new vr,e.movement=new vr,e.offset=new vr,e.global=new vr,e.screen=new vr,e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(r){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(r)}},{key:"initMouseEvent",value:function(){throw new Error(rn)}}])}(Ec),wc=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.width=0,e.height=0,e.isPrimary=!1,e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"getCoalescedEvents",value:function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Xp),lf=function(n){function t(){return(0,N.Z)(this,t),(0,_.Z)(this,t,arguments)}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Xp),Kn=function(n){function t(e,r){var i;return(0,N.Z)(this,t),i=(0,_.Z)(this,t,[null]),i.type=e,i.detail=r,Object.assign(i,r),i}return(0,C.Z)(t,n),(0,T.Z)(t)}(Ec),Kp=function(){function n(){(0,N.Z)(this,n),this.emitter=new D}return(0,T.Z)(n,[{key:"on",value:function(e,r,i){return this.addEventListener(e,r,i),this}},{key:"addEventListener",value:function(e,r,i){var a=!1,s=!1;if(Uo(i))a=i;else if(i){var o=i.capture;a=o===void 0?!1:o;var l=i.once;s=l===void 0?!1:l}a&&(e+="capture"),r=fe(r)?r:r.handleEvent;var c=fe(r)?void 0:r;return s?this.emitter.once(e,r,c):this.emitter.on(e,r,c),this}},{key:"off",value:function(e,r,i){return e?this.removeEventListener(e,r,i):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var e;(e=this.emitter)===null||e===void 0||e.removeAllListeners()}},{key:"removeEventListener",value:function(e,r,i){var a;if(!this.emitter)return this;var s=Uo(i)?i:i==null?void 0:i.capture;s&&(e+="capture"),r=fe(r)?r:(a=r)===null||a===void 0?void 0:a.handleEvent;var o=fe(r)?void 0:r;return this.emitter.off(e,r,o),this}},{key:"emit",value:function(e,r){this.dispatchEvent(new Kn(e,r))}},{key:"dispatchEventToSelf",value:function(e){e.target||(e.target=this),e.currentTarget=this,this.emitter.emit(e.type,e)}},{key:"dispatchEvent",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2?arguments[2]:void 0;if(i)return this.dispatchEventToSelf(e),!0;var a;if(this.document)a=this;else if(this.defaultView)a=this.defaultView;else{var s;a=(s=this.ownerDocument)===null||s===void 0?void 0:s.defaultView}if(a){if(e.manager=a.getEventService(),!e.manager)return!1;e.defaultPrevented=!1,e.path?e.path.length=0:e.page=[],r||(e.target=this),e.manager.dispatchEvent(e,e.type,r)}else this.dispatchEventToSelf(e);return!e.defaultPrevented}}])}(),On=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e.destroyed=!1,e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"textContent",get:function(){var r="";this.nodeName===Dt.TEXT&&(r+=this.style.text);var i=(0,fs.Z)(this.childNodes),a;try{for(i.s();!(a=i.n()).done;){var s=a.value;s.nodeName===Dt.TEXT?r+=s.nodeValue:r+=s.textContent}}catch(o){i.e(o)}finally{i.f()}return r},set:function(r){var i=this;this.childNodes.slice().forEach(function(a){i.removeChild(a)}),this.nodeName===Dt.TEXT&&(this.style.text="".concat(r))}},{key:"getRootNode",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(r):r.composed&&this.host?this.host.getRootNode(r):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(r){throw new Error(rn)}},{key:"lookupNamespaceURI",value:function(r){throw new Error(rn)}},{key:"lookupPrefix",value:function(r){throw new Error(rn)}},{key:"normalize",value:function(){throw new Error(rn)}},{key:"isEqualNode",value:function(r){return this===r}},{key:"isSameNode",value:function(r){return this.isEqualNode(r)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(r){if(r===this)return 0;for(var i=r,a=this,s=[i],o=[a];(l=i.parentNode)!==null&&l!==void 0?l:a.parentNode;){var l;i=i.parentNode?(s.push(i.parentNode),i.parentNode):i,a=a.parentNode?(o.push(a.parentNode),a.parentNode):a}if(i!==a)return t.DOCUMENT_POSITION_DISCONNECTED|t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|t.DOCUMENT_POSITION_PRECEDING;var c=s.length>o.length?s:o,u=c===s?o:s;if(c[c.length-u.length]===u[0])return c===s?t.DOCUMENT_POSITION_CONTAINED_BY|t.DOCUMENT_POSITION_FOLLOWING:t.DOCUMENT_POSITION_CONTAINS|t.DOCUMENT_POSITION_PRECEDING;for(var h=c.length-u.length,d=u.length-1;d>=0;d--){var f=u[d],v=c[h+d];if(v!==f){var g=f.parentNode.childNodes;return g.indexOf(f)<g.indexOf(v)?u===s?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING:c===s?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING}}return t.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(r){return this.contains(r)}},{key:"contains",value:function(r){for(var i=r;i&&this!==i;)i=i.parentNode;return!!i}},{key:"getAncestor",value:function(r){for(var i=this;r>0&&i;)i=i.parentNode,r--;return i}},{key:"forEach",value:function(r){for(var i=[this];i.length>0;){var a=i.pop(),s=r(a);if(s===!1)break;for(var o=a.childNodes.length-1;o>=0;o--)i.push(a.childNodes[o])}}}],[{key:"isNode",value:function(r){return!!r.childNodes}}])}(Kp);On.DOCUMENT_POSITION_DISCONNECTED=1,On.DOCUMENT_POSITION_PRECEDING=2,On.DOCUMENT_POSITION_FOLLOWING=4,On.DOCUMENT_POSITION_CONTAINS=8,On.DOCUMENT_POSITION_CONTAINED_BY=16,On.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var AA=2048,TA=function(){function n(t,e){var r=this;(0,N.Z)(this,n),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Wt(),this.tmpVec3=pt(),this.onPointerDown=function(i){var a=r.createPointerEvent(i);if(r.dispatchEvent(a,"pointerdown"),a.pointerType==="touch")r.dispatchEvent(a,"touchstart");else if(a.pointerType==="mouse"||a.pointerType==="pen"){var s=a.button===2;r.dispatchEvent(a,s?"rightdown":"mousedown")}var o=r.trackingData(i.pointerId);o.pressTargetsByButton[i.button]=a.composedPath(),r.freeEvent(a)},this.onPointerUp=function(i){var a=rf.now(),s=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(s,"pointerup"),s.pointerType==="touch")r.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var o=s.button===2;r.dispatchEvent(s,o?"rightup":"mouseup")}var l=r.trackingData(i.pointerId),c=r.findMountedTarget(l.pressTargetsByButton[i.button]),u=c;if(c&&!s.composedPath().includes(c)){for(var h=c;h&&!s.composedPath().includes(h);){if(s.currentTarget=h,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")r.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var d=s.button===2;r.notifyTarget(s,d?"rightupoutside":"mouseupoutside")}On.isNode(h)&&(h=h.parentNode)}delete l.pressTargetsByButton[i.button],u=h}if(u){var f,v=r.clonePointerEvent(s,"click");v.target=u,v.path=[],l.clicksByButton[i.button]||(l.clicksByButton[i.button]={clickCount:0,target:v.target,timeStamp:a});var g=r.context.renderingContext.root.ownerDocument.defaultView,p=l.clicksByButton[i.button];p.target===v.target&&a-p.timeStamp<g.getConfig().dblClickSpeed?++p.clickCount:p.clickCount=1,p.target=v.target,p.timeStamp=a,v.detail=p.clickCount,(f=s.detail)!==null&&f!==void 0&&f.preventClick||(!r.context.config.useNativeClickEvent&&(v.pointerType==="mouse"||v.pointerType==="touch")&&r.dispatchEvent(v,"click"),r.dispatchEvent(v,"pointertap")),r.freeEvent(v)}r.freeEvent(s)},this.onPointerMove=function(i){var a=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),s=a.pointerType==="mouse"||a.pointerType==="pen",o=r.trackingData(i.pointerId),l=r.findMountedTarget(o.overTargets);if(o.overTargets&&l!==a.target){var c=i.type==="mousemove"?"mouseout":"pointerout",u=r.createPointerEvent(i,c,l||void 0);if(r.dispatchEvent(u,"pointerout"),s&&r.dispatchEvent(u,"mouseout"),!a.composedPath().includes(l)){var h=r.createPointerEvent(i,"pointerleave",l||void 0);for(h.eventPhase=h.AT_TARGET;h.target&&!a.composedPath().includes(h.target);)h.currentTarget=h.target,r.notifyTarget(h),s&&r.notifyTarget(h,"mouseleave"),On.isNode(h.target)&&(h.target=h.target.parentNode);r.freeEvent(h)}r.freeEvent(u)}if(l!==a.target){var d=i.type==="mousemove"?"mouseover":"pointerover",f=r.clonePointerEvent(a,d);r.dispatchEvent(f,"pointerover"),s&&r.dispatchEvent(f,"mouseover");for(var v=l&&On.isNode(l)&&l.parentNode;v&&v!==(On.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&v!==a.target;)v=v.parentNode;var g=!v||v===(On.isNode(r.rootTarget)&&r.rootTarget.parentNode);if(g){var p=r.clonePointerEvent(a,"pointerenter");for(p.eventPhase=p.AT_TARGET;p.target&&p.target!==l&&p.target!==(On.isNode(r.rootTarget)&&r.rootTarget.parentNode);)p.currentTarget=p.target,r.notifyTarget(p),s&&r.notifyTarget(p,"mouseenter"),On.isNode(p.target)&&(p.target=p.target.parentNode);r.freeEvent(p)}r.freeEvent(f)}r.dispatchEvent(a,"pointermove"),a.pointerType==="touch"&&r.dispatchEvent(a,"touchmove"),s&&(r.dispatchEvent(a,"mousemove"),r.cursor=r.getCursor(a.target)),o.overTargets=a.composedPath(),r.freeEvent(a)},this.onPointerOut=function(i){var a=r.trackingData(i.pointerId);if(a.overTargets){var s=i.pointerType==="mouse"||i.pointerType==="pen",o=r.findMountedTarget(a.overTargets),l=r.createPointerEvent(i,"pointerout",o||void 0);r.dispatchEvent(l),s&&r.dispatchEvent(l,"mouseout");var c=r.createPointerEvent(i,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==(On.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),s&&r.notifyTarget(c,"mouseleave"),On.isNode(c.target)&&(c.target=c.target.parentNode);a.overTargets=null,r.freeEvent(l),r.freeEvent(c)}r.cursor=null},this.onPointerOver=function(i){var a=r.trackingData(i.pointerId),s=r.createPointerEvent(i),o=s.pointerType==="mouse"||s.pointerType==="pen";r.dispatchEvent(s,"pointerover"),o&&r.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(r.cursor=r.getCursor(s.target));var l=r.clonePointerEvent(s,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(On.isNode(r.rootTarget)&&r.rootTarget.parentNode);)l.currentTarget=l.target,r.notifyTarget(l),o&&r.notifyTarget(l,"mouseenter"),On.isNode(l.target)&&(l.target=l.target.parentNode);a.overTargets=s.composedPath(),r.freeEvent(s),r.freeEvent(l)},this.onPointerUpOutside=function(i){var a=r.trackingData(i.pointerId),s=r.findMountedTarget(a.pressTargetsByButton[i.button]),o=r.createPointerEvent(i);if(s){for(var l=s;l;)o.currentTarget=l,r.notifyTarget(o,"pointerupoutside"),o.pointerType==="touch"||(o.pointerType==="mouse"||o.pointerType==="pen")&&r.notifyTarget(o,o.button===2?"rightupoutside":"mouseupoutside"),On.isNode(l)&&(l=l.parentNode);delete a.pressTargetsByButton[i.button]}r.freeEvent(o)},this.onWheel=function(i){var a=r.createWheelEvent(i);r.dispatchEvent(a),r.freeEvent(a)},this.onClick=function(i){if(r.context.config.useNativeClickEvent){var a=r.createPointerEvent(i);r.dispatchEvent(a),r.freeEvent(a)}},this.onPointerCancel=function(i){var a=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(a),r.freeEvent(a)},this.globalRuntime=t,this.context=e}return(0,T.Z)(n,[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var e=this.context.contextService.getBoundingClientRect(),r=1,i=1,a=this.context.contextService.getDomElement();if(a&&e){var s=a.offsetWidth,o=a.offsetHeight;s&&o&&(r=e.width/s,i=e.height/o)}return{scaleX:r,scaleY:i,bbox:e}}},{key:"client2Viewport",value:function(e){var r=this.getScale(),i=r.scaleX,a=r.scaleY,s=r.bbox;return new vr((e.x-((s==null?void 0:s.left)||0))/i,(e.y-((s==null?void 0:s.top)||0))/a)}},{key:"viewport2Client",value:function(e){var r=this.getScale(),i=r.scaleX,a=r.scaleY,s=r.bbox;return new vr((e.x+((s==null?void 0:s.left)||0))*i,(e.y+((s==null?void 0:s.top)||0))*a)}},{key:"viewport2Canvas",value:function(e){var r=e.x,i=e.y,a=this.rootTarget.defaultView,s=a.getCamera(),o=this.context.config,l=o.width,c=o.height,u=s.getPerspectiveInverse(),h=s.getWorldTransform(),d=Jt(this.tmpMatrix,h,u),f=zt(this.tmpVec3,r/l*2-1,(1-i/c)*2-1,0);return re(f,f,d),new vr(f[0],f[1])}},{key:"canvas2Viewport",value:function(e){var r=this.rootTarget.defaultView,i=r.getCamera(),a=i.getPerspective(),s=i.getViewTransform(),o=Jt(this.tmpMatrix,a,s),l=zt(this.tmpVec3,e.x,e.y,0);re(this.tmpVec3,this.tmpVec3,o);var c=this.context.config,u=c.width,h=c.height;return new vr((l[0]+1)/2*u,(1-(l[1]+1)/2)*h)}},{key:"setPickHandler",value:function(e){this.pickHandler=e}},{key:"addEventMapping",value:function(e,r){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:r,priority:0}),this.mappingTable[e].sort(function(i,a){return i.priority-a.priority})}},{key:"mapEvent",value:function(e){if(this.rootTarget){var r=this.mappingTable[e.type];if(r)for(var i=0,a=r.length;i<a;i++)r[i].fn(e);else console.warn("[EventService]: Event mapping not defined for ".concat(e.type))}}},{key:"dispatchEvent",value:function(e,r,i){if(!i)e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,r);else{e.eventPhase=e.AT_TARGET;var a=this.rootTarget.defaultView||null;e.currentTarget=a,this.notifyListeners(e,r)}}},{key:"propagate",value:function(e,r){if(e.target){var i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(var a=i.length-1;a>=1;a--)if(e.currentTarget=i[a],this.notifyTarget(e,r),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,r),!(e.propagationStopped||e.propagationImmediatelyStopped)){var s=i.indexOf(e.currentTarget);e.eventPhase=e.BUBBLING_PHASE;for(var o=s+1;o<i.length;o++)if(e.currentTarget=i[o],this.notifyTarget(e,r),e.propagationStopped||e.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(e){var r=[e],i=this.rootTarget.defaultView||null;if(i&&i===e)return r.unshift(i.document),r;for(var a=0;a<AA&&e!==this.rootTarget;a++)On.isNode(e)&&e.parentNode&&(r.push(e.parentNode),e=e.parentNode);return i&&r.push(i),r}},{key:"hitTest",value:function(e){var r=e.viewportX,i=e.viewportY,a=this.context.config,s=a.width,o=a.height,l=a.disableHitTesting;return r<0||i<0||r>s||i>o?null:!l&&this.pickHandler(e)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(e,r){var i,a=r==null?void 0:r.target;if((i=a)!==null&&i!==void 0&&i.shadowRoot&&(a=r.composedPath()[0]),a){if(a===e)return!0;if(e&&e.contains)return e.contains(a)}return r!=null&&r.composedPath?r.composedPath().indexOf(e)>-1:!1}},{key:"getExistedHTML",value:function(e){if(e.nativeEvent.composedPath)for(var r=0,i=e.nativeEvent.composedPath();r<i.length;r++){var a=i[r],s=this.nativeHTMLMap.get(a);if(s)return s}return null}},{key:"pickTarget",value:function(e){return this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY})}},{key:"createPointerEvent",value:function(e,r,i,a){var s=this.allocateEvent(wc);this.copyPointerData(e,s),this.copyMouseData(e,s),this.copyData(e,s),s.nativeEvent=e.nativeEvent,s.originalEvent=e;var o=this.getExistedHTML(s),l=this.context.contextService.getDomElement();return s.target=i!=null?i:o||this.isNativeEventFromCanvas(l,s.nativeEvent)&&this.pickTarget(s)||a,typeof r=="string"&&(s.type=r),s}},{key:"createWheelEvent",value:function(e){var r=this.allocateEvent(lf);this.copyWheelData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e;var i=this.getExistedHTML(r),a=this.context.contextService.getDomElement();return r.target=i||this.isNativeEventFromCanvas(a,r.nativeEvent)&&this.pickTarget(r),r}},{key:"trackingData",value:function(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}},{key:"cloneWheelEvent",value:function(e){var r=this.allocateEvent(lf);return r.nativeEvent=e.nativeEvent,r.originalEvent=e.originalEvent,this.copyWheelData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.target=e.target,r.path=e.composedPath().slice(),r.type=e.type,r}},{key:"clonePointerEvent",value:function(e,r){var i=this.allocateEvent(wc);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=r!=null?r:i.type,i}},{key:"copyPointerData",value:function(e,r){r.pointerId=e.pointerId,r.width=e.width,r.height=e.height,r.isPrimary=e.isPrimary,r.pointerType=e.pointerType,r.pressure=e.pressure,r.tangentialPressure=e.tangentialPressure,r.tiltX=e.tiltX,r.tiltY=e.tiltY,r.twist=e.twist}},{key:"copyMouseData",value:function(e,r){r.altKey=e.altKey,r.button=e.button,r.buttons=e.buttons,r.ctrlKey=e.ctrlKey,r.metaKey=e.metaKey,r.shiftKey=e.shiftKey,r.client.copyFrom(e.client),r.movement.copyFrom(e.movement),r.canvas.copyFrom(e.canvas),r.screen.copyFrom(e.screen),r.global.copyFrom(e.global),r.offset.copyFrom(e.offset)}},{key:"copyWheelData",value:function(e,r){r.deltaMode=e.deltaMode,r.deltaX=e.deltaX,r.deltaY=e.deltaY,r.deltaZ=e.deltaZ}},{key:"copyData",value:function(e,r){r.isTrusted=e.isTrusted,r.timeStamp=rf.now(),r.type=e.type,r.detail=e.detail,r.view=e.view,r.page.copyFrom(e.page),r.viewport.copyFrom(e.viewport)}},{key:"allocateEvent",value:function(e){this.eventPool.has(e)||this.eventPool.set(e,[]);var r=this.eventPool.get(e).pop()||new e(this);return r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.target=null,r}},{key:"freeEvent",value:function(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var r=e.constructor;this.eventPool.has(r)||this.eventPool.set(r,[]),this.eventPool.get(r).push(e)}},{key:"notifyTarget",value:function(e,r){r=r!=null?r:e.type;var i=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?"".concat(r,"capture"):r;this.notifyListeners(e,i),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,r)}},{key:"notifyListeners",value:function(e,r){var i=e.currentTarget.emitter,a=i._events[r];if(a)if("fn"in a)a.once&&i.removeListener(r,a.fn,void 0,!0),a.fn.call(e.currentTarget||a.context,e);else for(var s=0;s<a.length&&!e.propagationImmediatelyStopped;s++)a[s].once&&i.removeListener(r,a[s].fn,void 0,!0),a[s].fn.call(e.currentTarget||a[s].context,e)}},{key:"findMountedTarget",value:function(e){if(!e)return null;for(var r=e[e.length-1],i=e.length-2;i>=0;i--){var a=e[i];if(a===this.rootTarget||On.isNode(a)&&a.parentNode===r)r=e[i];else break}return r}},{key:"getCursor",value:function(e){for(var r=e;r;){var i=WM(r)&&r.getAttribute("cursor");if(i)return i;r=On.isNode(r)&&r.parentNode}}}])}(),cf=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"getOrCreateCanvas",value:function(e,r){if(this.canvas)return this.canvas;if(e||Vt.offscreenCanvas)this.canvas=e||Vt.offscreenCanvas,this.context=this.canvas.getContext("2d",(0,B.Z)({willReadFrequently:!0},r));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",(0,B.Z)({willReadFrequently:!0},r)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",(0,B.Z)({willReadFrequently:!0},r))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(e,r){return this.context?this.context:(this.getOrCreateCanvas(e,r),this.context)}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(e){}try{return document.createElement("canvas")}catch(e){}return null}}])}(),lo=function(n){return n[n.CAMERA_CHANGED=0]="CAMERA_CHANGED",n[n.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",n[n.NONE=2]="NONE",n}({}),OA=function(){function n(t,e){(0,N.Z)(this,n),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ir,initAsync:new iA,dirtycheck:new sf,cull:new sf,beginFrame:new Ir,beforeRender:new Ir,render:new Ir,afterRender:new Ir,endFrame:new Ir,destroy:new Ir,pick:new aA,pickSync:new sf,pointerDown:new Ir,pointerUp:new Ir,pointerMove:new Ir,pointerOut:new Ir,pointerOver:new Ir,pointerWheel:new Ir,pointerCancel:new Ir,click:new Ir},this.globalRuntime=t,this.context=e}return(0,T.Z)(n,[{key:"init",value:function(e){var r=this,i=(0,B.Z)((0,B.Z)({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(a){a.apply(i,r.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,e()):this.hooks.initAsync.promise().then(function(){r.inited=!0,e()}).catch(function(a){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){var e=this.context.config.renderer,r=e.getConfig(),i=r.enableDirtyRectangleRendering;return!i||this.context.renderingContext.renderReasons.has(lo.CAMERA_CHANGED)}},{key:"render",value:function(e,r,i){var a=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var s=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(s.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),s.renderReasons.size&&this.inited){s.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=s.renderReasons.size===1&&s.renderReasons.has(lo.CAMERA_CHANGED),l=!e.disableRenderHooks||!o;l&&this.renderDisplayObject(s.root,e,s),this.hooks.beginFrame.call(r),l&&s.renderListCurrentFrame.forEach(function(c){a.hooks.beforeRender.call(c),a.hooks.render.call(c),a.hooks.afterRender.call(c)}),this.hooks.endFrame.call(r),s.renderListCurrentFrame=[],s.renderReasons.clear(),i()}}},{key:"renderDisplayObject",value:function(e,r,i){var a=this,s=r.renderer.getConfig(),o=s.enableDirtyCheck,l=s.enableCulling;function c(g){var p=g.renderable,y=g.sortable,b=o?p.dirty||i.dirtyRectangleRenderingDisabled?g:null:g,E=null;b&&(E=l?a.hooks.cull.call(b,a.context.camera):b,E&&(a.stats.rendered+=1,i.renderListCurrentFrame.push(E))),g.dirty(!1),y.renderOrder=a.zIndexCounter,a.zIndexCounter+=1,a.stats.total+=1,y.dirty&&(a.sort(g,y),y.dirty=!1,y.dirtyChildren=[],y.dirtyReason=void 0)}for(var u=[e];u.length>0;){var h,d=u.pop();c(d);for(var f=((h=d.sortable)===null||h===void 0||(h=h.sorted)===null||h===void 0?void 0:h.length)>0?d.sortable.sorted:d.childNodes,v=f.length-1;v>=0;v--)u.push(f[v])}}},{key:"sort",value:function(e,r){var i,a;(r==null||(i=r.sorted)===null||i===void 0?void 0:i.length)>0&&r.dirtyReason!==lc.Z_INDEX_CHANGED?r.dirtyChildren.forEach(function(s){var o=r.sorted.indexOf(s);o>-1&&r.sorted.splice(o,1);var l=e.childNodes.indexOf(s);if(l>-1)if(r.sorted.length===0)r.sorted.push(s);else{var c=GM(r.sorted,s);r.sorted.splice(c,0,s)}}):r.sorted=e.childNodes.slice().sort(Ip),((a=r.sorted)===null||a===void 0?void 0:a.length)>0&&e.childNodes.filter(function(s){return s.parsedStyle.zIndex}).length===0&&(r.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(lo.DISPLAY_OBJECT_CHANGED)}}])}(),CA=/\[\s*(.*)=(.*)\s*\]/,NA=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"selectOne",value:function(e,r){var i=this;if(e.startsWith("."))return r.find(function(l){return((l==null?void 0:l.classList)||[]).indexOf(i.getIdOrClassname(e))>-1});if(e.startsWith("#"))return r.find(function(l){return l.id===i.getIdOrClassname(e)});if(e.startsWith("[")){var a=this.getAttribute(e),s=a.name,o=a.value;return s?r.find(function(l){return r!==l&&(s==="name"?l.name===o:i.attributeToString(l,s)===o)}):null}return r.find(function(l){return r!==l&&l.nodeName===e})}},{key:"selectAll",value:function(e,r){var i=this;if(e.startsWith("."))return r.findAll(function(l){return r!==l&&((l==null?void 0:l.classList)||[]).indexOf(i.getIdOrClassname(e))>-1});if(e.startsWith("#"))return r.findAll(function(l){return r!==l&&l.id===i.getIdOrClassname(e)});if(e.startsWith("[")){var a=this.getAttribute(e),s=a.name,o=a.value;return s?r.findAll(function(l){return r!==l&&(s==="name"?l.name===o:i.attributeToString(l,s)===o)}):[]}return r.findAll(function(l){return r!==l&&l.nodeName===e})}},{key:"is",value:function(e,r){if(e.startsWith("."))return r.className===this.getIdOrClassname(e);if(e.startsWith("#"))return r.id===this.getIdOrClassname(e);if(e.startsWith("[")){var i=this.getAttribute(e),a=i.name,s=i.value;return a==="name"?r.name===s:this.attributeToString(r,a)===s}return r.nodeName===e}},{key:"getIdOrClassname",value:function(e){return e.substring(1)}},{key:"getAttribute",value:function(e){var r=e.match(CA),i="",a="";return r&&r.length>2&&(i=r[1].replace(/"/g,""),a=r[2].replace(/"/g,"")),{name:i,value:a}}},{key:"attributeToString",value:function(e,r){if(!e.getAttribute)return"";var i=e.getAttribute(r);return me(i)?"":i.toString?i.toString():""}}])}(),De=function(n){return n.ATTR_MODIFIED="DOMAttrModified",n.INSERTED="DOMNodeInserted",n.MOUNTED="DOMNodeInsertedIntoDocument",n.REMOVED="removed",n.UNMOUNTED="DOMNodeRemovedFromDocument",n.REPARENT="reparent",n.DESTROY="destroy",n.BOUNDS_CHANGED="bounds-changed",n.CULLED="culled",n}({}),Qi=function(n){function t(e,r,i,a,s,o,l,c){var u;return(0,N.Z)(this,t),u=(0,_.Z)(this,t,[null]),u.relatedNode=r,u.prevValue=i,u.newValue=a,u.attrName=s,u.attrChange=o,u.prevParsedValue=l,u.newParsedValue=c,u.type=e,u}return(0,C.Z)(t,n),(0,T.Z)(t)}(Ec);Qi.ADDITION=2,Qi.MODIFICATION=1,Qi.REMOVAL=3;var kA=new Qi(De.REPARENT,null,"","","",0,"",""),PA=Ad(),Sc=pt(),RA=Et(1,1,1),LA=Wt(),_A=Ad(),Es=pt(),DA=Wt(),ws=Xn(),IA=pt(),BA=Xn(),FA=pt(),rl=pt(),Ss=pt(),Mc=Wt(),Qp=Xn(),qp=Xn(),Ac=Xn(),Tc={affectChildren:!0},zA=function(){function n(t){(0,N.Z)(this,n),this.pendingEvents=new Map,this.boundsChangedEvent=new Kn(De.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=t}return(0,T.Z)(n,[{key:"matches",value:function(e,r){return this.runtime.sceneGraphSelector.is(e,r)}},{key:"querySelector",value:function(e,r){return this.runtime.sceneGraphSelector.selectOne(e,r)}},{key:"querySelectorAll",value:function(e,r){return this.runtime.sceneGraphSelector.selectAll(e,r)}},{key:"attach",value:function(e,r,i){var a,s=!1;e.parentNode&&(s=e.parentNode!==r,this.detach(e));var o=e.nodeName===Dt.FRAGMENT,l=xc(r);e.parentNode=r;var c=o?e.childNodes:[e];ie(i)?c.forEach(function(g){r.childNodes.splice(i,0,g),g.parentNode=r}):c.forEach(function(g){r.childNodes.push(g),g.parentNode=r});var u=r,h=u.sortable;if((h!=null&&(a=h.sorted)!==null&&a!==void 0&&a.length||h.dirty||e.parsedStyle.zIndex)&&(h.dirtyChildren.indexOf(e)===-1&&h.dirtyChildren.push(e),h.dirty=!0,h.dirtyReason=lc.ADDED),!l){if(o)this.dirtifyFragment(e);else{var d=e.transformable;d&&this.dirtyWorldTransform(e,d)}if(s){var f,v=((f=r.ownerDocument)===null||f===void 0||(f=f.defaultView)===null||f===void 0||(f=f.getConfig())===null||f===void 0||(f=f.future)===null||f===void 0?void 0:f.experimentalCancelEventPropagation)===!0;e.dispatchEvent(kA,v,v)}}}},{key:"detach",value:function(e){var r,i;if(e.parentNode){var a=e.transformable,s=e.parentNode,o=s.sortable;(o!=null&&(r=o.sorted)!==null&&r!==void 0&&r.length||(i=e.style)!==null&&i!==void 0&&i.zIndex)&&(o.dirtyChildren.indexOf(e)===-1&&o.dirtyChildren.push(e),o.dirty=!0,o.dirtyReason=lc.REMOVED);var l=e.parentNode.childNodes.indexOf(e);l>-1&&e.parentNode.childNodes.splice(l,1),a&&this.dirtyWorldTransform(e,a),e.parentNode=null}}},{key:"getLocalPosition",value:function(e){return e.transformable.localPosition}},{key:"getLocalRotation",value:function(e){return e.transformable.localRotation}},{key:"getLocalScale",value:function(e){return e.transformable.localScale}},{key:"getLocalSkew",value:function(e){return e.transformable.localSkew}},{key:"getLocalTransform",value:function(e){var r=e.transformable;return qg(r),r.localTransform}},{key:"setLocalPosition",value:function(e,r){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=e.transformable;rl[0]=r[0],rl[1]=r[1],rl[2]=(i=r[2])!==null&&i!==void 0?i:0,!ua(s.localPosition,rl)&&(kt(s.localPosition,rl),a&&this.dirtyLocalTransform(e,s))}},{key:"translateLocal",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof r=="number"&&(r=Et(r,i,a));var s=e.transformable;ua(r,Sc)||(cr(r,r,s.localRotation),Ut(s.localPosition,s.localPosition,r),this.dirtyLocalTransform(e,s))}},{key:"setLocalRotation",value:function(e,r,i,a,s){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;typeof r=="number"&&(r=ug(ws,r,i,a,s));var l=e.transformable;ql(l.localRotation,r),o&&this.dirtyLocalTransform(e,l)}},{key:"rotateLocal",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof r=="number"&&(r=Et(r,i,a));var s=e.transformable;Ql(qp,r[0],r[1],r[2]),hg(s.localRotation,s.localRotation,qp),this.dirtyLocalTransform(e,s)}},{key:"setLocalScale",value:function(e,r){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=e.transformable;zt(Es,r[0],r[1],(i=r[2])!==null&&i!==void 0?i:s.localScale[2]),!ua(Es,s.localScale)&&(kt(s.localScale,Es),a&&this.dirtyLocalTransform(e,s))}},{key:"scaleLocal",value:function(e,r){var i,a=e.transformable;Ee(a.localScale,a.localScale,zt(Es,r[0],r[1],(i=r[2])!==null&&i!==void 0?i:1)),this.dirtyLocalTransform(e,a)}},{key:"setLocalSkew",value:function(e,r,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;typeof r=="number"&&(r=Aw(_A,r,i));var s=e.transformable;Mw(s.localSkew,r),a&&this.dirtyLocalTransform(e,s)}},{key:"setLocalEulerAngles",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;typeof r=="number"&&(r=Et(r,i,a));var o=e.transformable;Ql(o.localRotation,r[0],r[1],r[2]),s&&this.dirtyLocalTransform(e,o)}},{key:"setLocalTransform",value:function(e,r){var i=Tn(IA,r),a=Js(BA,r),s=Ca(FA,r);this.setLocalScale(e,s,!1),this.setLocalPosition(e,i,!1),this.setLocalRotation(e,a,void 0,void 0,void 0,!1),this.dirtyLocalTransform(e,e.transformable)}},{key:"resetLocalTransform",value:function(e){this.setLocalScale(e,RA,!1),this.setLocalPosition(e,Sc,!1),this.setLocalEulerAngles(e,Sc,void 0,void 0,!1),this.setLocalSkew(e,PA,void 0,!1),this.dirtyLocalTransform(e,e.transformable)}},{key:"getPosition",value:function(e){var r=e.transformable;return Tn(r.position,this.getWorldTransform(e,r))}},{key:"getRotation",value:function(e){var r=e.transformable;return Js(r.rotation,this.getWorldTransform(e,r))}},{key:"getScale",value:function(e){var r=e.transformable;return Ca(r.scaling,this.getWorldTransform(e,r))}},{key:"getOrigin",value:function(e){return e.getGeometryBounds(),e.transformable.origin}},{key:"getWorldTransform",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.transformable;return!r.localDirtyFlag&&!r.dirtyFlag||(e.parentNode&&e.parentNode.transformable&&this.getWorldTransform(e.parentNode),this.internalUpdateTransform(e)),r.worldTransform}},{key:"setPosition",value:function(e,r){var i,a=e.transformable;if(Ss[0]=r[0],Ss[1]=r[1],Ss[2]=(i=r[2])!==null&&i!==void 0?i:0,!ua(this.getPosition(e),Ss)){if(kt(a.position,Ss),e.parentNode===null||!e.parentNode.transformable)kt(a.localPosition,Ss);else{var s=e.parentNode.transformable;we(Mc,s.worldTransform),Ze(Mc,Mc),re(a.localPosition,Ss,Mc)}this.dirtyLocalTransform(e,a)}}},{key:"translate",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof r=="number"&&(r=zt(Es,r,i,a)),!ua(r,Sc)&&(Ut(Es,this.getPosition(e),r),this.setPosition(e,Es))}},{key:"setRotation",value:function(e,r,i,a,s){var o=e.transformable;if(typeof r=="number"&&(r=Ew(r,i,a,s)),e.parentNode===null||!e.parentNode.transformable)this.setLocalRotation(e,r);else{var l=this.getRotation(e.parentNode);ql(ws,l),Md(ws,ws),ka(o.localRotation,ws,r),Jl(o.localRotation,o.localRotation),this.dirtyLocalTransform(e,o)}}},{key:"rotate",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof r=="number"&&(r=Et(r,i,a));var s=e.transformable;if(e.parentNode===null||!e.parentNode.transformable)this.rotateLocal(e,r);else{var o=ws;Ql(o,r[0],r[1],r[2]);var l=this.getRotation(e),c=this.getRotation(e.parentNode);ql(Ac,c),Md(Ac,Ac),ka(o,Ac,o),ka(s.localRotation,o,l),Jl(s.localRotation,s.localRotation),this.dirtyLocalTransform(e,s)}}},{key:"setOrigin",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof r=="number"&&(r=[r,i,a]);var s=e.transformable;if(!(r[0]===s.origin[0]&&r[1]===s.origin[1]&&r[2]===s.origin[2])){var o=s.origin;o[0]=r[0],o[1]=r[1],o[2]=r[2]||0,this.dirtyLocalTransform(e,s)}}},{key:"setEulerAngles",value:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof r=="number"&&(r=Et(r,i,a));var s=e.transformable;if(e.parentNode===null||!e.parentNode.transformable)this.setLocalEulerAngles(e,r);else{Ql(s.localRotation,r[0],r[1],r[2]);var o=this.getRotation(e.parentNode);ql(Qp,Md(ws,o)),hg(s.localRotation,s.localRotation,Qp),this.dirtyLocalTransform(e,s)}}},{key:"getTransformedGeometryBounds",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2?arguments[2]:void 0,a=this.getGeometryBounds(e,r);if(!pn.isEmpty(a)){var s=i||new pn;return s.setFromTransformedAABB(a,this.getWorldTransform(e)),s}return null}},{key:"getGeometryBounds",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=e,a=i.geometry;a.dirty&&Vt.styleValueRegistry.updateGeometry(e);var s=r?a.renderBounds:a.contentBounds||null;return s||new pn}},{key:"getBounds",value:function(e){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=e,s=a.renderable;if(!s.boundsDirty&&!i&&s.bounds)return s.bounds;if(!s.renderBoundsDirty&&i&&s.renderBounds)return s.renderBounds;var o=i?s.renderBounds:s.bounds,l=this.getTransformedGeometryBounds(e,i,o),c=e.childNodes;if(c.forEach(function(d){var f=r.getBounds(d,i);f&&(l?l.add(f):(l=o||new pn,l.update(f.center,f.halfExtents)))}),l||(l=new pn),i){var u=Bp(e);if(u){var h=u.parsedStyle.clipPath.getBounds(i);l?h&&(l=h.intersection(l)):l.update(h.center,h.halfExtents)}}return i?(s.renderBounds=l,s.renderBoundsDirty=!1):(s.bounds=l,s.boundsDirty=!1),l}},{key:"getLocalBounds",value:function(e){if(e.parentNode){var r=LA;e.parentNode.transformable&&(r=Ze(DA,this.getWorldTransform(e.parentNode)));var i=this.getBounds(e);if(!pn.isEmpty(i)){var a=new pn;return a.setFromTransformedAABB(i,r),a}}return this.getBounds(e)}},{key:"getBoundingClientRect",value:function(e){var r,i,a=this.getGeometryBounds(e);pn.isEmpty(a)||(i=new pn,i.setFromTransformedAABB(a,this.getWorldTransform(e)));var s=(r=e.ownerDocument)===null||r===void 0||(r=r.defaultView)===null||r===void 0?void 0:r.getContextService().getBoundingClientRect();if(i){var o=i.getMin(),l=(0,R.Z)(o,2),c=l[0],u=l[1],h=i.getMax(),d=(0,R.Z)(h,2),f=d[0],v=d[1];return new no(c+((s==null?void 0:s.left)||0),u+((s==null?void 0:s.top)||0),f-c,v-u)}return new no((s==null?void 0:s.left)||0,(s==null?void 0:s.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(e){var r,i=(r=e.parentNode)===null||r===void 0?void 0:r.transformable;qg(e.transformable),nS(e.transformable,i)}},{key:"internalUpdateElement",value:function(e,r){var i,a,s,o,l=((i=e.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig())===null||i===void 0||(i=i.future)===null||i===void 0?void 0:i.experimentalAttributeUpdateOptimization)===!0,c=r[r.length-1],u=(c==null?void 0:c.transformDirty)||((a=e.transformable)===null||a===void 0?void 0:a.localDirtyFlag);if(e.transformable){var h;(h=e.transformable).dirtyFlag||(h.dirtyFlag=u)}if(this.internalUpdateTransform(e),u){var d;(d=e.dirty)===null||d===void 0||d.call(e,!0,!0)}var f=((s=e.renderable)===null||s===void 0?void 0:s.boundsDirty)||((o=e.renderable)===null||o===void 0?void 0:o.renderBoundsDirty);if((u||f)&&(c==null?void 0:c.shapeUpdated)===!1&&l)for(var v=r.length-1;v>=0;){var g,p,y=r[v];if(y.shapeUpdated)break;(g=(p=y.node).dirty)===null||g===void 0||g.call(p,!0,!0),y.shapeUpdated=!0,v-=1}return u}},{key:"syncHierarchy",value:function(e){for(var r,i,a=[e],s=e.parentNode?[{node:e.parentNode,transformDirty:((r=e.parentNode.transformable)===null||r===void 0?void 0:r.localDirtyFlag)||((i=e.parentNode.transformable)===null||i===void 0?void 0:i.dirtyFlag),shapeUpdated:!1}]:[];a.length>0;){for(var o=a.pop(),l=s[s.length-1];s.length>0&&o.parentNode!==l.node;)l=s.pop();var c=this.internalUpdateElement(o,s);if(o.childNodes.length>0){for(var u=o.childNodes.length-1;u>=0;u--)a.push(o.childNodes[u]);s.push({node:o,transformDirty:c,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(e,r){xc(e)||r.localDirtyFlag||(r.localDirtyFlag=!0,r.dirtyFlag||this.dirtyWorldTransform(e,r))}},{key:"dirtyWorldTransform",value:function(e,r){this.dirtifyWorldInternal(e,r),this.dirtyToRoot(e,!0)}},{key:"dirtifyWorldInternal",value:function(e,r){var i,a=this,s=((i=e.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig())===null||i===void 0||(i=i.future)===null||i===void 0?void 0:i.experimentalAttributeUpdateOptimization)===!0;r.dirtyFlag||(r.dirtyFlag=!0,e.dirty(!0,!0),s||e.childNodes.forEach(function(o){var l=o.transformable;a.dirtifyWorldInternal(o,l)}))}},{key:"dirtyToRoot",value:function(e){for(var r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=e,s=((r=e.ownerDocument)===null||r===void 0||(r=r.defaultView)===null||r===void 0||(r=r.getConfig())===null||r===void 0||(r=r.future)===null||r===void 0?void 0:r.experimentalAttributeUpdateOptimization)===!0;a;){var o,l;if((o=(l=a).dirty)===null||o===void 0||o.call(l,!0,!0),s)break;a=a.parentNode}i&&e.forEach(function(c){var u;(u=c.dirty)===null||u===void 0||u.call(c,!0,!0)}),this.informDependentDisplayObjects(e),this.pendingEvents.set(e,i)}},{key:"dirtifyFragment",value:function(e){var r,i,a=e.transformable;a&&(a.dirtyFlag=!0,a.localDirtyFlag=!0),(r=(i=e).dirty)===null||r===void 0||r.call(i,!0,!0);for(var s=e.childNodes.length,o=0;o<s;o++)this.dirtifyFragment(e.childNodes[o]);e.nodeName===Dt.FRAGMENT&&this.pendingEvents.set(e,!1)}},{key:"triggerPendingEvents",value:function(){var e=this,r=new Set,i,a,s=function(l,c){if(!(!l.isConnected||r.has(l)||l.nodeName===Dt.FRAGMENT)){if(e.boundsChangedEvent.detail=c,e.boundsChangedEvent.target=l,l.isMutationObserved)l.dispatchEvent(e.boundsChangedEvent);else{if(i===void 0){var u;i=((u=l.ownerDocument.defaultView)===null||u===void 0||(u=u.getConfig())===null||u===void 0||(u=u.future)===null||u===void 0?void 0:u.experimentalCancelEventPropagation)===!0}l.ownerDocument.defaultView.dispatchEvent(e.boundsChangedEvent,!0,i)}r.add(l)}};this.pendingEvents.forEach(function(o,l){if(l.nodeName!==Dt.FRAGMENT){if(a===void 0){var c;a=((c=l.ownerDocument)===null||c===void 0||(c=c.defaultView)===null||c===void 0||(c=c.getConfig())===null||c===void 0||(c=c.future)===null||c===void 0?void 0:c.experimentalAttributeUpdateOptimization)===!0}Tc.affectChildren=o,a?s(l,Tc):o?l.forEach(function(u){s(u,Tc)}):s(l,Tc)}}),r.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"updateDisplayObjectDependency",value:function(e,r,i,a){if(r&&r!==i){var s=this.displayObjectDependencyMap.get(r);if(s&&s[e]){var o=s[e].indexOf(a);s[e].splice(o,1)}}if(i){var l=this.displayObjectDependencyMap.get(i);l||(this.displayObjectDependencyMap.set(i,{}),l=this.displayObjectDependencyMap.get(i)),l[e]||(l[e]=[]),l[e].push(a)}}},{key:"informDependentDisplayObjects",value:function(e){var r,i=this,a=this.displayObjectDependencyMap.get(e);if(a){var s=(r=e.ownerDocument)===null||r===void 0||(r=r.defaultView)===null||r===void 0||(r=r.getConfig())===null||r===void 0||(r=r.future)===null||r===void 0?void 0:r.experimentalCancelEventPropagation;Object.keys(a).forEach(function(o){a[o].forEach(function(l){i.dirtyToRoot(l,!0),l.dispatchEvent(new Qi(De.ATTR_MODIFIED,l,i,i,o,Qi.MODIFICATION,i,i),s,s),l.isCustomElement&&l.isConnected&&l.attributeChangedCallback&&l.attributeChangedCallback(o,i,i)})})}}}])}(),Jp=function(){function n(t){if((0,N.Z)(this,n),t<=0)throw new Error("LRU capacity must be a positive number.");this.capacity=t,this.cache=new Map}return(0,T.Z)(n,[{key:"get",value:function(e){if(this.cache.has(e)){var r=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,r),r}}},{key:"put",value:function(e,r){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,r),this.cache.size>this.capacity){var i=this.cache.keys().next().value;this.cache.delete(i)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),Ms={MetricsString:"|\xC9q\xC5",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},$p=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,jA=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,ZA=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,WA=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,GA=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,VA=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,UA=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,YA=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,HA=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,XA=new RegExp("".concat(jA.source,"|").concat(WA.source,"|").concat(VA.source,"|").concat(YA.source)),KA=new RegExp("".concat(ZA.source,"|").concat(GA.source,"|").concat(UA.source,"|").concat(HA.source)),QA=function(){function n(t){var e=this;(0,N.Z)(this,n),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(r,i){return e.isBreakingSpace(i)?!1:!!(r&&(KA.exec(i)||XA.exec(r)))},this.trimByKinsokuShorui=function(r){var i=(0,k.Z)(r),a=i[i.length-2];if(!a)return r;var s=a[a.length-1];return i[i.length-2]=a.slice(0,-1),i[i.length-1]=s+i[i.length-1],i},this.runtime=t,this.charWidthCache=new Jp(100)}return(0,T.Z)(n,[{key:"measureFont",value:function(e,r){if(this.fontMetricsCache[e])return this.fontMetricsCache[e];var i={ascent:0,descent:0,fontSize:0},a=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(r),s=this.runtime.offscreenCanvasCreator.getOrCreateContext(r,{willReadFrequently:!0});s.font=e;var o=Ms.MetricsString+Ms.BaselineSymbol,l=Math.ceil(s.measureText(o).width),c=Math.ceil(s.measureText(Ms.BaselineSymbol).width),u=Ms.HeightMultiplier*c;c=c*Ms.BaselineMultiplier|0,a.width=l,a.height=u,s.fillStyle="#f00",s.fillRect(0,0,l,u),s.font=e,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(o,0,c);var h=s.getImageData(0,0,l||1,u||1).data,d=h.length,f=l*4,v=0,g=0,p=!1;for(v=0;v<c;++v){for(var y=0;y<f;y+=4)if(h[g+y]!==255){p=!0;break}if(!p)g+=f;else break}for(i.ascent=c-v,g=d-f,p=!1,v=u;v>c;--v){for(var b=0;b<f;b+=4)if(h[g+b]!==255){p=!0;break}if(!p)g-=f;else break}return i.descent=v-c,i.fontSize=i.ascent+i.descent,this.fontMetricsCache[e]=i,i}},{key:"measureText",value:function(e,r,i){var a=r.fontSize,s=a===void 0?16:a,o=r.wordWrap,l=o===void 0?!1:o,c=r.lineHeight,u=r.lineWidth,h=u===void 0?1:u,d=r.textBaseline,f=d===void 0?"alphabetic":d,v=r.textAlign,g=v===void 0?"start":v,p=r.letterSpacing,y=p===void 0?0:p,b=r.textPath;r.textPathSide,r.textPathStartOffset;var E=r.leading,O=E===void 0?0:E,P=Up(r),L=this.measureFont(P,i);L.fontSize===0&&(L.fontSize=s,L.ascent=s);var F=this.runtime.offscreenCanvasCreator.getOrCreateContext(i);F.font=P,r.isOverflowing=!1;var I=l?this.wordWrap(e,r,i):e,V=I.split(/(?:\r\n|\r|\n)/),Y=new Array(V.length),J=0;if(b){b.getTotalLength();for(var $=0;$<V.length;$++)F.measureText(V[$]).width+(V[$].length-1)*y}else{for(var ot=0;ot<V.length;ot++){var ct=F.measureText(V[ot]).width+(V[ot].length-1)*y;Y[ot]=ct,J=Math.max(J,ct)}var ft=J+h,Nt=c||L.fontSize+h,Ot=Math.max(Nt,L.fontSize+h)+(V.length-1)*(Nt+O);Nt+=O;var mt=0;return f==="middle"?mt=-Ot/2:f==="bottom"||f==="alphabetic"||f==="ideographic"?mt=-Ot:(f==="top"||f==="hanging")&&(mt=0),{font:P,width:ft,height:Ot,lines:V,lineWidths:Y,lineHeight:Nt,maxLineWidth:J,fontProperties:L,lineMetrics:Y.map(function(yt,Rt){var jt=0;return g==="center"||g==="middle"?jt-=yt/2:(g==="right"||g==="end")&&(jt-=yt),new no(jt-h/2,mt+Rt*Nt,yt+h,Nt)})}}}},{key:"wordWrap",value:function(e,r,i){var a=this,s=Array.from(e);if(s.length===0)return"";var o=this,l=r.wordWrapWidth,c=l===void 0?0:l,u=r.letterSpacing,h=u===void 0?0:u,d=r.maxLines,f=d===void 0?1/0:d,v=r.textOverflow,g=this.runtime.offscreenCanvasCreator.getOrCreateContext(i),p=c+h,y="";v==="ellipsis"?y="...":v&&v!=="clip"&&(y=v);var b=[""],E=0,O=0,P=-1,L=Up(r),F=this.charWidthCache.get(L);F||(F=new Jp(500),this.charWidthCache.put(L,F));var I=function(yt){return a.getFromCache(yt,h,F,g)},V=I(y);function Y(mt,yt,Rt,jt){for(;I(mt)<jt&&yt<s.length-1&&!o.isNewline(s[yt+1]);)yt+=1,mt+=s[yt];for(;I(mt)>jt&&yt>=Rt;)yt-=1,mt=mt.slice(0,-1);return{lineTxt:mt,txtLastCharIndex:yt}}function J(mt,yt){if(!(V<=0||V>p)){if(!b[mt]){b[mt]=y;return}var Rt=Y(b[mt],yt,P+1,p-V);b[mt]=Rt.lineTxt+y}}for(var $=0;$<s.length;$++){var ot=s[$],ct=s[$-1],ft=s[$+1],Nt=I(ot);if(this.isNewline(ot)){if(E+1>=f){$<s.length-1&&J(E,$-1),r.isOverflowing=!0;break}P=$-1,E+=1,O=0,b[E]="";continue}if(Nt>p){J(E,$-1),r.isOverflowing=!0;break}if(O>0&&O+Nt>p){var Ot=Y(b[E],$-1,P+1,p);if(Ot.txtLastCharIndex!==$-1){if(b[E]=Ot.lineTxt,Ot.txtLastCharIndex===s.length-1)break;$=Ot.txtLastCharIndex+1,ot=s[$],ct=s[$-1],ft=s[$+1],Nt=I(ot)}if(E+1>=f){J(E,$-1),r.isOverflowing=!0;break}if(P=$-1,E+=1,O=0,b[E]="",this.isBreakingSpace(ot))continue;this.canBreakInLastChar(ot)||(b=this.trimToBreakable(b),O=this.sumTextWidthByCache(b[E]||"",I)),this.shouldBreakByKinsokuShorui(ot,ft)&&(b=this.trimByKinsokuShorui(b),O+=I(ct||""))}O+=Nt,b[E]+=ot}return b.join(`
`)}},{key:"isBreakingSpace",value:function(e){return typeof e!="string"?!1:Ms.BreakingSpaces.indexOf(e.charCodeAt(0))>=0}},{key:"isNewline",value:function(e){return typeof e!="string"?!1:Ms.Newlines.indexOf(e.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(e){var r=(0,k.Z)(e),i=r[r.length-2],a=this.findBreakableIndex(i);if(a===-1||!i)return r;var s=i.slice(a,a+1),o=this.isBreakingSpace(s),l=a+1,c=a+(o?0:1);return r[r.length-1]+=i.slice(l,i.length),r[r.length-2]=i.slice(0,c),r}},{key:"canBreakInLastChar",value:function(e){return!(e&&$p.test(e))}},{key:"sumTextWidthByCache",value:function(e,r){return e.split("").reduce(function(i,a){return i+r(a)},0)}},{key:"findBreakableIndex",value:function(e){for(var r=e.length-1;r>=0;r--)if(!$p.test(e[r]))return r;return-1}},{key:"getFromCache",value:function(e,r,i,a){var s=i.get(e);if(typeof s!="number"){var o=e.length*r,l=a.measureText(e);s=l.width+o,i.put(e,s)}return s}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),Vt={},qA=function(n){var t=new EA,e=new xA;return n={},(0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(n,Dt.FRAGMENT,null),Dt.CIRCLE,new pA),Dt.ELLIPSE,new mA),Dt.RECT,t),Dt.IMAGE,t),Dt.GROUP,new SA),Dt.LINE,new yA),Dt.TEXT,new wA(Vt)),Dt.POLYLINE,e),Dt.POLYGON,e),(0,se.Z)((0,se.Z)((0,se.Z)(n,Dt.PATH,new bA),Dt.HTML,new MA),Dt.MESH,null)}(),JA=function(n){var t=new CM,e=new tf;return n={},(0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(n,$t.PERCENTAGE,null),$t.NUMBER,new LM),$t.ANGLE,new TM),$t.DEFINED_PATH,new OM),$t.PAINT,t),$t.COLOR,t),$t.FILTER,new NM),$t.LENGTH,e),$t.LENGTH_PERCENTAGE,e),$t.LENGTH_PERCENTAGE_12,new kM),(0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(n,$t.LENGTH_PERCENTAGE_14,new PM),$t.COORDINATE,new tf),$t.OFFSET_DISTANCE,new _M),$t.OPACITY_VALUE,new DM),$t.PATH,new IM),$t.LIST_OF_POINTS,new BM),$t.SHADOW_BLUR,new FM),$t.TEXT,new zM),$t.TEXT_TRANSFORM,new jM),$t.TRANSFORM,new fA),(0,se.Z)((0,se.Z)((0,se.Z)(n,$t.TRANSFORM_ORIGIN,new vA),$t.Z_INDEX,new gA),$t.MARKER,new RM)}(),$A=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof S.g!="undefined"?S.g:{}};Vt.CameraContribution=Qg,Vt.AnimationTimeline=null,Vt.EasingFunction=null,Vt.offscreenCanvasCreator=new cf,Vt.sceneGraphSelector=new NA,Vt.sceneGraphService=new zA(Vt),Vt.textService=new QA(Vt),Vt.geometryUpdaterFactory=qA,Vt.CSSPropertySyntaxFactory=JA,Vt.styleValueRegistry=new MM(Vt),Vt.layoutRegistry=null,Vt.globalThis=$A(),Vt.enableStyleSyntax=!0,Vt.enableSizeAttenuation=!1;var tm=0;function X8(){tm=0}var uf=new Qi(De.INSERTED,null,"","","",0,"",""),hf=new Qi(De.REMOVED,null,"","","",0,"",""),em=new Kn(De.DESTROY),tT=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.entity=tm++,e.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},e.cullable={strategy:$2.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.style={},e.computedStyle={},e.parsedStyle={},e.attributes={},e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"dirty",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.renderable.dirty=r,i&&(this.renderable.boundsDirty=r,this.renderable.renderBoundsDirty=r)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(r){this.setAttribute("class",r)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(r){return r!==""})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[r+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[r-1]||null}return null}},{key:"cloneNode",value:function(r){throw new Error(rn)}},{key:"appendChild",value:function(r,i){var a;if(r.destroyed)throw new Error(Z2);return Vt.sceneGraphService.attach(r,this,i),(a=this.ownerDocument)!==null&&a!==void 0&&a.defaultView&&(!xc(this)&&r.nodeName===Dt.FRAGMENT?this.ownerDocument.defaultView.mountFragment(r):this.ownerDocument.defaultView.mountChildren(r)),this.isMutationObserved&&(uf.relatedNode=this,r.dispatchEvent(uf)),r}},{key:"insertBefore",value:function(r,i){if(!i)this.appendChild(r);else{r.parentElement&&r.parentElement.removeChild(r);var a=this.childNodes.indexOf(i);a===-1?this.appendChild(r):this.appendChild(r,a)}return r}},{key:"replaceChild",value:function(r,i){var a=this.childNodes.indexOf(i);return this.removeChild(i),this.appendChild(r,a),i}},{key:"removeChild",value:function(r){var i,a,s=((i=this.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig().future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;return hf.relatedNode=this,r.dispatchEvent(hf,s,s),(a=r.ownerDocument)!==null&&a!==void 0&&a.defaultView&&r.ownerDocument.defaultView.unmountChildren(r),Vt.sceneGraphService.detach(r),r}},{key:"removeChildren",value:function(){for(var r=this.childNodes.length-1;r>=0;r--){var i=this.childNodes[r];this.removeChild(i)}}},{key:"destroyChildren",value:function(){for(var r=this.childNodes.length-1;r>=0;r--){var i=this.childNodes[r];i.childNodes.length>0&&i.destroyChildren(),i.destroy()}}},{key:"matches",value:function(r){return Vt.sceneGraphService.matches(r,this)}},{key:"getElementById",value:function(r){return Vt.sceneGraphService.querySelector("#".concat(r),this)}},{key:"getElementsByName",value:function(r){return Vt.sceneGraphService.querySelectorAll('[name="'.concat(r,'"]'),this)}},{key:"getElementsByClassName",value:function(r){return Vt.sceneGraphService.querySelectorAll(".".concat(r),this)}},{key:"getElementsByTagName",value:function(r){return Vt.sceneGraphService.querySelectorAll(r,this)}},{key:"querySelector",value:function(r){return Vt.sceneGraphService.querySelector(r,this)}},{key:"querySelectorAll",value:function(r){return Vt.sceneGraphService.querySelectorAll(r,this)}},{key:"closest",value:function(r){var i=this;do{if(Vt.sceneGraphService.matches(r,i))return i;i=i.parentElement}while(i!==null);return null}},{key:"find",value:function(r){var i=this,a=null;return this.forEach(function(s){return s!==i&&r(s)?(a=s,!1):!0}),a}},{key:"findAll",value:function(r){var i=this,a=[];return this.forEach(function(s){s!==i&&r(s)&&a.push(s)}),a}},{key:"after",value:function(){var r=this;if(this.parentNode){for(var i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];s.forEach(function(l,c){var u;return(u=r.parentNode)===null||u===void 0?void 0:u.appendChild(l,i+c+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var r,i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];var l=s[0],c=s.slice(1);this.parentNode.appendChild(l,i),(r=l).after.apply(r,(0,k.Z)(c))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var r=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o){return r.appendChild(o)})}},{key:"prepend",value:function(){for(var r=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o,l){return r.appendChild(o,l)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var r,i=((r=this.ownerDocument)===null||r===void 0||(r=r.defaultView)===null||r===void 0||(r=r.getConfig().future)===null||r===void 0?void 0:r.experimentalCancelEventPropagation)===!0;this.destroyChildren(),this.dispatchEvent(em,i,i),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Vt.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return Vt.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return Vt.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return Vt.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Vt.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(r){if(typeof r!="symbol"){var i=this.attributes[r];return i}}},{key:"hasAttribute",value:function(r){return this.getAttributeNames().includes(r)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(r){this.setAttribute(r,null),delete this.attributes[r]}},{key:"setAttribute",value:function(r,i,a,s){this.attributes[r]=i}},{key:"getAttributeNS",value:function(r,i){throw new Error(rn)}},{key:"getAttributeNode",value:function(r){throw new Error(rn)}},{key:"getAttributeNodeNS",value:function(r,i){throw new Error(rn)}},{key:"hasAttributeNS",value:function(r,i){throw new Error(rn)}},{key:"removeAttributeNS",value:function(r,i){throw new Error(rn)}},{key:"removeAttributeNode",value:function(r){throw new Error(rn)}},{key:"setAttributeNS",value:function(r,i,a){throw new Error(rn)}},{key:"setAttributeNode",value:function(r){throw new Error(rn)}},{key:"setAttributeNodeNS",value:function(r){throw new Error(rn)}},{key:"toggleAttribute",value:function(r,i){throw new Error(rn)}}])}(On);function Ve(n){return!!(n!=null&&n.nodeName)}var eT=Vt.globalThis.Proxy?Vt.globalThis.Proxy:function(){},qi=new Qi(De.ATTR_MODIFIED,null,null,null,null,Qi.MODIFICATION,null,null),il=pt(),nT=Xn(),yn=function(n){function t(e){var r;return(0,N.Z)(this,t),r=(0,_.Z)(this,t),r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.config=e,r.id=e.id||"",r.name=e.name||"",(e.className||e.class)&&(r.className=e.className||e.class),r.nodeName=e.type||Dt.GROUP,e.initialParsedStyle&&Object.assign(r.parsedStyle,e.initialParsedStyle),r.initAttributes(e.style),Vt.enableStyleSyntax&&(r.style=new eT({setProperty:function(a,s){r.setAttribute(a,s)},getPropertyValue:function(a){return r.getAttribute(a)},removeProperty:function(a){r.removeAttribute(a)},item:function(){return""}},{get:function(a,s){return a[s]!==void 0?a[s]:r.getAttribute(s)},set:function(a,s,o){return r.setAttribute(s,o),!0}})),r}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"destroy",value:function(){Og(t,"destroy",this,3)([]),this.getAnimations().forEach(function(r){r.cancel()})}},{key:"cloneNode",value:function(r,i){var a=(0,B.Z)({},this.attributes);for(var s in a){var o=a[s];Ve(o)&&s!=="clipPath"&&s!=="offsetPath"&&s!=="textPath"&&(a[s]=o.cloneNode(r)),i&&(a[s]=i(s,o))}var l=new this.constructor((0,B.Z)((0,B.Z)({},this.config),{},{style:a}));return l.setLocalTransform(this.getLocalTransform()),r&&this.children.forEach(function(c){if(!c.style.isMarker){var u=c.cloneNode(r);l.appendChild(u)}}),l}},{key:"initAttributes",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={forceUpdateGeometry:!0};Vt.styleValueRegistry.processProperties(this,r,i),this.dirty()}},{key:"setAttribute",value:function(r,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;Te(i)||(a||i!==this.attributes[r])&&(this.internalSetAttribute(r,i,{memoize:s}),Og(t,"setAttribute",this,3)([r,i]))}},{key:"internalSetAttribute",value:function(r,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.attributes[r],o=this.parsedStyle[r];Vt.styleValueRegistry.processProperties(this,(0,se.Z)({},r,i),a),this.dirty();var l=this.parsedStyle[r];if(this.isConnected)if(qi.relatedNode=this,qi.prevValue=s,qi.newValue=i,qi.attrName=r,qi.prevParsedValue=o,qi.newParsedValue=l,this.isMutationObserved)this.dispatchEvent(qi);else{var c,u=((c=this.ownerDocument.defaultView.getConfig().future)===null||c===void 0?void 0:c.experimentalCancelEventPropagation)===!0;qi.target=this,this.ownerDocument.defaultView.dispatchEvent(qi,!0,u)}if(this.isCustomElement&&this.isConnected||!this.isCustomElement){var h,d;(h=(d=this).attributeChangedCallback)===null||h===void 0||h.call(d,r,s,i,o,l)}}},{key:"getBBox",value:function(){var r=this.getBounds(),i=r.getMin(),a=(0,R.Z)(i,2),s=a[0],o=a[1],l=r.getMax(),c=(0,R.Z)(l,2),u=c[0],h=c[1];return new no(s,o,u-s,h-o)}},{key:"setOrigin",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Vt.sceneGraphService.setOrigin(this,Dr(r,i,a,!1)),this}},{key:"getOrigin",value:function(){return Vt.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Vt.sceneGraphService.setPosition(this,Dr(r,i,a,!1)),this}},{key:"setLocalPosition",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Vt.sceneGraphService.setLocalPosition(this,Dr(r,i,a,!1)),this}},{key:"translate",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Vt.sceneGraphService.translate(this,Dr(r,i,a,!1)),this}},{key:"translateLocal",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Vt.sceneGraphService.translateLocal(this,Dr(r,i,a,!1)),this}},{key:"getPosition",value:function(){return Vt.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Vt.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(r,i,a){return this.scaleLocal(r,i,a)}},{key:"scaleLocal",value:function(r,i,a){return typeof r=="number"&&(i=i||r,a=a||r,r=Dr(r,i,a,!1)),Vt.sceneGraphService.scaleLocal(this,r),this}},{key:"setLocalScale",value:function(r,i,a){return typeof r=="number"&&(i=i||r,a=a||r,r=Dr(r,i,a,!1)),Vt.sceneGraphService.setLocalScale(this,r),this}},{key:"getLocalScale",value:function(){return Vt.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Vt.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var r=Dd(il,Vt.sceneGraphService.getWorldTransform(this)),i=(0,R.Z)(r,3),a=i[2];return Gr(a)}},{key:"getLocalEulerAngles",value:function(){var r=Dd(il,Vt.sceneGraphService.getLocalRotation(this)),i=(0,R.Z)(r,3),a=i[2];return Gr(a)}},{key:"setEulerAngles",value:function(r){return Vt.sceneGraphService.setEulerAngles(this,0,0,r),this}},{key:"setLocalEulerAngles",value:function(r){return Vt.sceneGraphService.setLocalEulerAngles(this,0,0,r),this}},{key:"rotateLocal",value:function(r,i,a){return me(i)&&me(a)?Vt.sceneGraphService.rotateLocal(this,0,0,r):Vt.sceneGraphService.rotateLocal(this,r,i,a),this}},{key:"rotate",value:function(r,i,a){return me(i)&&me(a)?Vt.sceneGraphService.rotate(this,0,0,r):Vt.sceneGraphService.rotate(this,r,i,a),this}},{key:"setRotation",value:function(r,i,a,s){return Vt.sceneGraphService.setRotation(this,r,i,a,s),this}},{key:"setLocalRotation",value:function(r,i,a,s){return Vt.sceneGraphService.setLocalRotation(this,r,i,a,s),this}},{key:"setLocalSkew",value:function(r,i){return Vt.sceneGraphService.setLocalSkew(this,r,i),this}},{key:"getRotation",value:function(){return Vt.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Vt.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Vt.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Vt.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Vt.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(r){return Vt.sceneGraphService.setLocalTransform(this,r),this}},{key:"resetLocalTransform",value:function(){Vt.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(r,i){var a,s=(a=this.ownerDocument)===null||a===void 0?void 0:a.timeline;return s?s.play(this,r,i):null}},{key:"isVisible",value:function(){var r;return((r=this.parsedStyle)===null||r===void 0?void 0:r.visibility)!=="hidden"}},{key:"interactive",get:function(){return this.isInteractive()},set:function(r){this.style.pointerEvents=r?"auto":"none"}},{key:"isInteractive",value:function(){var r;return((r=this.parsedStyle)===null||r===void 0?void 0:r.pointerEvents)!=="none"}},{key:"isCulled",value:function(){return!!(this.cullable&&this.cullable.enable&&!this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,(0,k.Z)(this.parentNode.children.map(function(r){return Number(r.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,(0,k.Z)(this.parentNode.children.map(function(r){return Number(r.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var r=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=a[0],l=a[1];return o?Fn(o)?(Object.keys(o).forEach(function(c){r.setAttribute(c,o[c])}),this):a.length===2?(this.setAttribute(o,l),this):this.attributes[o]:this.attributes}},{key:"getMatrix",value:function(r){var i=r||this.getWorldTransform(),a=Tn(il,i),s=(0,R.Z)(a,2),o=s[0],l=s[1],c=Ca(il,i),u=(0,R.Z)(c,2),h=u[0],d=u[1],f=Js(nT,i),v=Dd(il,f),g=(0,R.Z)(v,3),p=g[0],y=g[2];return X2(p||y,o,l,h,d)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(r){var i=Yg(r),a=(0,R.Z)(i,5),s=a[0],o=a[1],l=a[2],c=a[3],u=a[4];this.setEulerAngles(u).setPosition(s,o).setLocalScale(l,c)}},{key:"setLocalMatrix",value:function(r){var i=Yg(r),a=(0,R.Z)(i,5),s=a[0],o=a[1],l=a[2],c=a[3],u=a[4];this.setLocalEulerAngles(u).setLocalPosition(s,o).setLocalScale(l,c)}},{key:"show",value:function(){this.forEach(function(r){r.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(r){r.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(r){return this.children[r]||null}},{key:"add",value:function(r,i){return this.appendChild(r,i)}},{key:"set",value:function(r,i){this.config[r]=i}},{key:"get",value:function(r){return this.config[r]}},{key:"moveTo",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(r,i,a),this}},{key:"move",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(r,i,a),this}},{key:"setZIndex",value:function(r){return this.style.zIndex=r,this}}])}(tT);yn.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Ji=function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,_.Z)(this,t,[(0,B.Z)({type:Dt.CIRCLE},e)])}return(0,C.Z)(t,n),(0,T.Z)(t)}(yn);Ji.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var rT=["style"],df=function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.style,a=(0,vs.Z)(r,rT);return(0,N.Z)(this,t),e=(0,_.Z)(this,t,[(0,B.Z)({style:i},a)]),e.isCustomElement=!0,e}return(0,C.Z)(t,n),(0,T.Z)(t)}(yn);df.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var al=function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,_.Z)(this,t,[(0,B.Z)({type:Dt.ELLIPSE},e)])}return(0,C.Z)(t,n),(0,T.Z)(t)}(yn);al.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var iT=function(n){function t(){return(0,N.Z)(this,t),(0,_.Z)(this,t,[{type:Dt.FRAGMENT}])}return(0,C.Z)(t,n),(0,T.Z)(t)}(yn);iT.PARSED_STYLE_LIST=new Set(["class","className"]);var rr=function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,_.Z)(this,t,[(0,B.Z)({type:Dt.GROUP},e)])}return(0,C.Z)(t,n),(0,T.Z)(t)}(yn);rr.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var aT=["style"],co=function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.style,a=(0,vs.Z)(r,aT);return(0,N.Z)(this,t),e=(0,_.Z)(this,t,[(0,B.Z)({type:Dt.HTML,style:i},a)]),e.cullable.enable=!1,e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var r=Ze(Wt(),this.parentNode.getWorldTransform()),i=this.getBounds();if(!pn.isEmpty(i)){var a=new pn;return a.setFromTransformedAABB(i,r),a}}return this.getBounds()}}])}(yn);co.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var sl=function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,_.Z)(this,t,[(0,B.Z)({type:Dt.IMAGE},e)])}return(0,C.Z)(t,n),(0,T.Z)(t)}(yn);sl.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var sT=["style"],As=function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.style,a=(0,vs.Z)(r,sT);(0,N.Z)(this,t),e=(0,_.Z)(this,t,[(0,B.Z)({type:Dt.LINE,style:(0,B.Z)({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},a)]),e.markerStartAngle=0,e.markerEndAngle=0;var s=e.parsedStyle,o=s.markerStart,l=s.markerEnd;return o&&Ve(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),l&&Ve(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"attributeChangedCallback",value:function(r,i,a,s,o){r==="x1"||r==="y1"||r==="x2"||r==="y2"||r==="markerStartOffset"||r==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):r==="markerStart"?(s&&Ve(s)&&(this.markerStartAngle=0,s.remove()),o&&Ve(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):r==="markerEnd"&&(s&&Ve(s)&&(this.markerEndAngle=0,s.remove()),o&&Ve(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1)))}},{key:"transformMarker",value:function(r){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,c=i.x1,u=i.x2,h=i.y1,d=i.y2,f=r?a:s;if(!(!f||!Ve(f))){var v=0,g,p,y,b,E,O;r?(y=c,b=h,g=u-c,p=d-h,E=o||0,O=this.markerStartAngle):(y=u,b=d,g=c-u,p=h-d,E=l||0,O=this.markerEndAngle),v=Math.atan2(p,g),f.setLocalEulerAngles(v*180/Math.PI+O),f.setLocalPosition(y+Math.cos(v)*E,b+Math.sin(v)*E)}}},{key:"getPoint",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle,s=a.x1,o=a.y1,l=a.x2,c=a.y2,u=Yi(s,o,l,c,r),h=u.x,d=u.y,f=re(pt(),Et(h,d,0),i?this.getWorldTransform():this.getLocalTransform());return new vr(f[0],f[1])}},{key:"getPointAtLength",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(r/this.getTotalLength(),i)}},{key:"getTotalLength",value:function(){var r=this.parsedStyle,i=r.x1,a=r.y1,s=r.x2,o=r.y2;return Lg(i,a,s,o)}}])}(yn);As.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var oT=["style"],ni=function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.style,a=(0,vs.Z)(r,oT);(0,N.Z)(this,t),e=(0,_.Z)(this,t,[(0,B.Z)({type:Dt.PATH,style:i,initialParsedStyle:{miterLimit:4,d:(0,B.Z)({},Jg)}},a)]),e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var s=e.parsedStyle,o=s.markerStart,l=s.markerEnd,c=s.markerMid;return o&&Ve(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),c&&Ve(c)&&e.placeMarkerMid(c),l&&Ve(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"attributeChangedCallback",value:function(r,i,a,s,o){r==="d"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):r==="markerStartOffset"||r==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):r==="markerStart"?(s&&Ve(s)&&(this.markerStartAngle=0,s.remove()),o&&Ve(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):r==="markerEnd"?(s&&Ve(s)&&(this.markerEndAngle=0,s.remove()),o&&Ve(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):r==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(r){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,c=r?a:s;if(!(!c||!Ve(c))){var u=0,h,d,f,v,g,p;if(r){var y=this.getStartTangent(),b=(0,R.Z)(y,2),E=b[0],O=b[1];f=O[0],v=O[1],h=E[0]-O[0],d=E[1]-O[1],g=o||0,p=this.markerStartAngle}else{var P=this.getEndTangent(),L=(0,R.Z)(P,2),F=L[0],I=L[1];f=I[0],v=I[1],h=F[0]-I[0],d=F[1]-I[1],g=l||0,p=this.markerEndAngle}u=Math.atan2(d,h),c.setLocalEulerAngles(u*180/Math.PI+p),c.setLocalPosition(f+Math.cos(u)*g,v+Math.sin(u)*g)}}},{key:"placeMarkerMid",value:function(r){var i=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(u){u.remove()}),r&&Ve(r))for(var a=1;a<i.length-1;a++){var s=(0,R.Z)(i[a].currentPoint,2),o=s[0],l=s[1],c=a===1?r:r.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(o,l)}}},{key:"getTotalLength",value:function(){return Xd(this)}},{key:"getPointAtLength",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.d.absolutePath,s=h2(a,r),o=s.x,l=s.y,c=re(pt(),Et(o,l,0),i?this.getWorldTransform():this.getLocalTransform());return new vr(c[0],c[1])}},{key:"getPoint",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPointAtLength(r*Xd(this),i)}},{key:"getStartTangent",value:function(){var r=this.parsedStyle.d.segments,i=[];if(r.length>1){var a=r[0].currentPoint,s=r[1].currentPoint,o=r[1].startTangent;i=[],o?(i.push([a[0]-o[0],a[1]-o[1]]),i.push([a[0],a[1]])):(i.push([s[0],s[1]]),i.push([a[0],a[1]]))}return i}},{key:"getEndTangent",value:function(){var r=this.parsedStyle.d.segments,i=r.length,a=[];if(i>1){var s=r[i-2].currentPoint,o=r[i-1].currentPoint,l=r[i-1].endTangent;a=[],l?(a.push([o[0]-l[0],o[1]-l[1]]),a.push([o[0],o[1]])):(a.push([s[0],s[1]]),a.push([o[0],o[1]]))}return a}}])}(yn);ni.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var lT=["style"],Ts=function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=r.style,a=(0,vs.Z)(r,lT);(0,N.Z)(this,t),e=(0,_.Z)(this,t,[(0,B.Z)({type:Dt.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a)]),e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var s=e.parsedStyle,o=s.markerStart,l=s.markerEnd,c=s.markerMid;return o&&Ve(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),c&&Ve(c)&&e.placeMarkerMid(c),l&&Ve(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"attributeChangedCallback",value:function(r,i,a,s,o){r==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):r==="markerStartOffset"||r==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):r==="markerStart"?(s&&Ve(s)&&(this.markerStartAngle=0,s.remove()),o&&Ve(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):r==="markerEnd"?(s&&Ve(s)&&(this.markerEndAngle=0,s.remove()),o&&Ve(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):r==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(r){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,c=i.points,u=c||{},h=u.points,d=r?a:s;if(!(!d||!Ve(d)||!h)){var f=0,v,g,p,y,b,E;if(p=h[0][0],y=h[0][1],r)v=h[1][0]-h[0][0],g=h[1][1]-h[0][1],b=o||0,E=this.markerStartAngle;else{var O=h.length;this.parsedStyle.isClosed?(v=h[O-1][0]-h[0][0],g=h[O-1][1]-h[0][1]):(p=h[O-1][0],y=h[O-1][1],v=h[O-2][0]-h[O-1][0],g=h[O-2][1]-h[O-1][1]),b=l||0,E=this.markerEndAngle}f=Math.atan2(g,v),d.setLocalEulerAngles(f*180/Math.PI+E),d.setLocalPosition(p+Math.cos(f)*b,y+Math.sin(f)*b)}}},{key:"placeMarkerMid",value:function(r){var i=this.parsedStyle.points,a=i||{},s=a.points;if(this.markerMidList.forEach(function(h){h.remove()}),this.markerMidList=[],r&&Ve(r)&&s)for(var o=1;o<(this.parsedStyle.isClosed?s.length:s.length-1);o++){var l=s[o][0],c=s[o][1],u=o===1?r:r.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(l,c)}}}])}(yn);Ts.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var cT=["style"],Oc=function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.style,i=(0,vs.Z)(e,cT);return(0,N.Z)(this,t),(0,_.Z)(this,t,[(0,B.Z)({type:Dt.POLYLINE,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i)])}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"getTotalLength",value:function(){return qS(this)}},{key:"getPointAtLength",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(r/this.getTotalLength(),i)}},{key:"getPoint",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.points.points;if(this.parsedStyle.points.segments.length===0){var s=[],o=0,l,c,u=this.getTotalLength();a.forEach(function(y,b){a[b+1]&&(l=[0,0],l[0]=o/u,c=Lg(y[0],y[1],a[b+1][0],a[b+1][1]),o+=c,l[1]=o/u,s.push(l))}),this.parsedStyle.points.segments=s}var h=0,d=0;this.parsedStyle.points.segments.forEach(function(y,b){r>=y[0]&&r<=y[1]&&(h=(r-y[0])/(y[1]-y[0]),d=b)});var f=Yi(a[d][0],a[d][1],a[d+1][0],a[d+1][1],h),v=f.x,g=f.y,p=re(pt(),Et(v,g,0),i?this.getWorldTransform():this.getLocalTransform());return new vr(p[0],p[1])}},{key:"getStartTangent",value:function(){var r=this.parsedStyle.points.points,i=[];return i.push([r[1][0],r[1][1]]),i.push([r[0][0],r[0][1]]),i}},{key:"getEndTangent",value:function(){var r=this.parsedStyle.points.points,i=r.length-1,a=[];return a.push([r[i-1][0],r[i-1][1]]),a.push([r[i][0],r[i][1]]),a}}])}(Ts);Oc.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(Ts.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var gr=function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),(0,_.Z)(this,t,[(0,B.Z)({type:Dt.RECT},e)])}return(0,C.Z)(t,n),(0,T.Z)(t)}(yn);gr.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var uT=["style"],Os=function(n){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.style,i=(0,vs.Z)(e,uT);return(0,N.Z)(this,t),(0,_.Z)(this,t,[(0,B.Z)({type:Dt.TEXT,style:(0,B.Z)({fill:"black"},r)},i)])}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"getComputedTextLength",value:function(){var r;return this.getGeometryBounds(),((r=this.parsedStyle.metrics)===null||r===void 0?void 0:r.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var r;return this.getGeometryBounds(),((r=this.parsedStyle.metrics)===null||r===void 0?void 0:r.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(yn);Os.PARSED_STYLE_LIST=new Set([].concat((0,k.Z)(yn.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var hT=function(){function n(){(0,N.Z)(this,n),this.registry={},this.define(Dt.CIRCLE,Ji),this.define(Dt.ELLIPSE,al),this.define(Dt.RECT,gr),this.define(Dt.IMAGE,sl),this.define(Dt.LINE,As),this.define(Dt.GROUP,rr),this.define(Dt.PATH,ni),this.define(Dt.POLYGON,Ts),this.define(Dt.POLYLINE,Oc),this.define(Dt.TEXT,Os),this.define(Dt.HTML,co)}return(0,T.Z)(n,[{key:"define",value:function(e,r){this.registry[e]=r}},{key:"get",value:function(e){return this.registry[e]}}])}(),K8={number:function(t){return new on(t)},percent:function(t){return new on(t,"%")},px:function(t){return new on(t,"px")},em:function(t){return new on(t,"em")},rem:function(t){return new on(t,"rem")},deg:function(t){return new on(t,"deg")},grad:function(t){return new on(t,"grad")},rad:function(t){return new on(t,"rad")},turn:function(t){return new on(t,"turn")},s:function(t){return new on(t,"s")},ms:function(t){return new on(t,"ms")},registerProperty:function(t){var e=t.name,r=t.inherits,i=t.interpolable,a=t.initialValue,s=t.syntax;Vt.styleValueRegistry.registerMetadata({n:e,inh:r,int:i,d:a,syntax:s})},registerLayout:function(t,e){Vt.layoutRegistry.registerLayout(t,e)}},nm=function(n){function t(){var e;(0,N.Z)(this,t),e=(0,_.Z)(this,t),e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new Vt.AnimationTimeline(e)}catch(i){}var r={};return $d.forEach(function(i){var a=i.n,s=i.inh,o=i.d;s&&o&&(r[a]=fe(o)?o(Dt.GROUP):o)}),e.documentElement=new rr({id:"g-root",style:r}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(r,i){if(r==="svg")return this.documentElement;var a=this.defaultView.customElements.get(r);a||(console.warn("Unsupported tagName: ",r),a=r==="tspan"?Os:rr);var s=new a(i);return s.ownerDocument=this,s}},{key:"createElementNS",value:function(r,i,a){return this.createElement(i,a)}},{key:"cloneNode",value:function(r){throw new Error(rn)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(r){}}},{key:"elementsFromBBox",value:function(r,i,a,s){var o=this.defaultView.context.rBushRoot,l=o.search({minX:r,minY:i,maxX:a,maxY:s}),c=[];return l.forEach(function(u){var h=u.displayObject,d=h.parsedStyle.pointerEvents,f=d===void 0?"auto":d,v=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(f);(!v||v&&h.isVisible())&&!h.isCulled()&&h.isInteractive()&&c.push(h)}),c.sort(function(u,h){return h.sortable.renderOrder-u.sortable.renderOrder}),c}},{key:"elementFromPointSync",value:function(r,i){var a=this.defaultView.canvas2Viewport({x:r,y:i}),s=a.x,o=a.y,l=this.defaultView.getConfig(),c=l.width,u=l.height;if(s<0||o<0||s>c||o>u)return null;var h=this.defaultView.viewport2Client({x:s,y:o}),d=h.x,f=h.y,v=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:r,y:i,viewportX:s,viewportY:o,clientX:d,clientY:f},picked:[]}),g=v.picked;return g&&g[0]||this.documentElement}},{key:"elementFromPoint",value:function(){var e=(0,Ra.Z)((0,Tr.Z)().mark(function i(a,s){var o,l,c,u,h,d,f,v,g,p,y;return(0,Tr.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(o=this.defaultView.canvas2Viewport({x:a,y:s}),l=o.x,c=o.y,u=this.defaultView.getConfig(),h=u.width,d=u.height,!(l<0||c<0||l>h||c>d)){b.next=1;break}return b.abrupt("return",null);case 1:return f=this.defaultView.viewport2Client({x:l,y:c}),v=f.x,g=f.y,b.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:s,viewportX:l,viewportY:c,clientX:v,clientY:g},picked:[]});case 2:return p=b.sent,y=p.picked,b.abrupt("return",y&&y[0]||this.documentElement);case 3:case"end":return b.stop()}},i,this)}));function r(i,a){return e.apply(this,arguments)}return r}()},{key:"elementsFromPointSync",value:function(r,i){var a=this.defaultView.canvas2Viewport({x:r,y:i}),s=a.x,o=a.y,l=this.defaultView.getConfig(),c=l.width,u=l.height;if(s<0||o<0||s>c||o>u)return[];var h=this.defaultView.viewport2Client({x:s,y:o}),d=h.x,f=h.y,v=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:r,y:i,viewportX:s,viewportY:o,clientX:d,clientY:f},picked:[]}),g=v.picked;return g[g.length-1]!==this.documentElement&&g.push(this.documentElement),g}},{key:"elementsFromPoint",value:function(){var e=(0,Ra.Z)((0,Tr.Z)().mark(function i(a,s){var o,l,c,u,h,d,f,v,g,p,y;return(0,Tr.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(o=this.defaultView.canvas2Viewport({x:a,y:s}),l=o.x,c=o.y,u=this.defaultView.getConfig(),h=u.width,d=u.height,!(l<0||c<0||l>h||c>d)){b.next=1;break}return b.abrupt("return",[]);case 1:return f=this.defaultView.viewport2Client({x:l,y:c}),v=f.x,g=f.y,b.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:s,viewportX:l,viewportY:c,clientX:v,clientY:g},picked:[]});case 2:return p=b.sent,y=p.picked,y[y.length-1]!==this.documentElement&&y.push(this.documentElement),b.abrupt("return",y);case 3:case"end":return b.stop()}},i,this)}));function r(i,a){return e.apply(this,arguments)}return r}()},{key:"appendChild",value:function(r,i){throw new Error(ro)}},{key:"insertBefore",value:function(r,i){throw new Error(ro)}},{key:"removeChild",value:function(r,i){throw new Error(ro)}},{key:"replaceChild",value:function(r,i,a){throw new Error(ro)}},{key:"append",value:function(){throw new Error(ro)}},{key:"prepend",value:function(){throw new Error(ro)}},{key:"getElementById",value:function(r){return this.documentElement.getElementById(r)}},{key:"getElementsByName",value:function(r){return this.documentElement.getElementsByName(r)}},{key:"getElementsByTagName",value:function(r){return this.documentElement.getElementsByTagName(r)}},{key:"getElementsByClassName",value:function(r){return this.documentElement.getElementsByClassName(r)}},{key:"querySelector",value:function(r){return this.documentElement.querySelector(r)}},{key:"querySelectorAll",value:function(r){return this.documentElement.querySelectorAll(r)}},{key:"find",value:function(r){return this.documentElement.find(r)}},{key:"findAll",value:function(r){return this.documentElement.findAll(r)}}])}(On),rm=function(){function n(t){(0,N.Z)(this,n),this.strategies=t}return(0,T.Z)(n,[{key:"apply",value:function(e){var r=e.config,i=e.camera,a=e.renderingService,s=e.renderingContext,o=this.strategies;a.hooks.cull.tap(n.tag,function(l){if(l){var c,u=l.cullable;if(o.length===0?u.visible=s.unculledEntities.indexOf(l.entity)>-1:u.visible=o.every(function(d){return d.isVisible(i,l)}),!l.isCulled()&&l.isVisible())return l;var h=((c=r.future)===null||c===void 0?void 0:c.experimentalCancelEventPropagation)===!0;return l.dispatchEvent(new Kn(De.CULLED),h,h),null}return l}),a.hooks.afterRender.tap(n.tag,function(l){l.cullable.visibilityPlaneMask=-1})}}])}();rm.tag="Culling";var im=function(){function n(){var t=this;(0,N.Z)(this,n),this.autoPreventDefault=!1,this.rootPointerEvent=new wc(null),this.rootWheelEvent=new lf(null),this.onPointerMove=function(e){var r,i=(r=t.context.renderingContext.root)===null||r===void 0||(r=r.ownerDocument)===null||r===void 0?void 0:r.defaultView;if(!(i.supportsTouchEvents&&e.pointerType==="touch")){var a=t.normalizeToPointerEvent(e,i),s=(0,fs.Z)(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,c=t.bootstrapEvent(t.rootPointerEvent,l,i,e);t.context.eventService.mapEvent(c)}}catch(u){s.e(u)}finally{s.f()}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var r,i=(r=t.context.renderingContext.root)===null||r===void 0||(r=r.ownerDocument)===null||r===void 0?void 0:r.defaultView,a=t.normalizeToPointerEvent(e,i),s=(0,fs.Z)(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,c=t.bootstrapEvent(t.rootPointerEvent,l,i,e);t.context.eventService.mapEvent(c)}}catch(u){s.e(u)}finally{s.f()}t.setCursor(t.context.eventService.cursor)}}return(0,T.Z)(n,[{key:"apply",value:function(e){var r=this;this.context=e;var i=e.renderingService,a=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(s){var o=r.context.renderingService.hooks.pickSync.call({position:s,picked:[],topmost:!0}),l=o.picked;return l[0]||null}),i.hooks.pointerWheel.tap(n.tag,function(s){var o=r.normalizeWheelEvent(s);r.context.eventService.mapEvent(o)}),i.hooks.pointerDown.tap(n.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=r.normalizeToPointerEvent(s,a);if(r.autoPreventDefault&&o[0].isNormalized){var l=s.cancelable||!("cancelable"in s);l&&s.preventDefault()}var c=(0,fs.Z)(o),u;try{for(c.s();!(u=c.n()).done;){var h=u.value,d=r.bootstrapEvent(r.rootPointerEvent,h,a,s);r.context.eventService.mapEvent(d)}}catch(f){c.e(f)}finally{c.f()}r.setCursor(r.context.eventService.cursor)}}),i.hooks.pointerUp.tap(n.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=r.context.contextService.getDomElement(),l=r.context.eventService.isNativeEventFromCanvas(o,s),c=l?"":"outside",u=r.normalizeToPointerEvent(s,a),h=(0,fs.Z)(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,v=r.bootstrapEvent(r.rootPointerEvent,f,a,s);v.type+=c,r.context.eventService.mapEvent(v)}}catch(g){h.e(g)}finally{h.f()}r.setCursor(r.context.eventService.cursor)}}),i.hooks.pointerMove.tap(n.tag,this.onPointerMove),i.hooks.pointerOver.tap(n.tag,this.onPointerMove),i.hooks.pointerOut.tap(n.tag,this.onPointerMove),i.hooks.click.tap(n.tag,this.onClick),i.hooks.pointerCancel.tap(n.tag,function(s){var o=r.normalizeToPointerEvent(s,a),l=(0,fs.Z)(o),c;try{for(l.s();!(c=l.n()).done;){var u=c.value,h=r.bootstrapEvent(r.rootPointerEvent,u,a,s);r.context.eventService.mapEvent(h)}}catch(d){l.e(d)}finally{l.f()}r.setCursor(r.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(e,r,i,a){e.view=i,e.originalEvent=null,e.nativeEvent=a,e.pointerId=r.pointerId,e.width=r.width,e.height=r.height,e.isPrimary=r.isPrimary,e.pointerType=r.pointerType,e.pressure=r.pressure,e.tangentialPressure=r.tangentialPressure,e.tiltX=r.tiltX,e.tiltY=r.tiltY,e.twist=r.twist,this.transferMouseData(e,r);var s=this.context.eventService.client2Viewport({x:r.clientX,y:r.clientY}),o=s.x,l=s.y;e.viewport.x=o,e.viewport.y=l;var c=this.context.eventService.viewport2Canvas(e.viewport),u=c.x,h=c.y;return e.canvas.x=u,e.canvas.y=h,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.isTrusted=a.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=XM[e.type]||e.type),e}},{key:"normalizeWheelEvent",value:function(e){var r=this.rootWheelEvent;this.transferMouseData(r,e),r.deltaMode=e.deltaMode,r.deltaX=e.deltaX,r.deltaY=e.deltaY,r.deltaZ=e.deltaZ;var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.x,s=i.y;r.viewport.x=a,r.viewport.y=s;var o=this.context.eventService.viewport2Canvas(r.viewport),l=o.x,c=o.y;return r.canvas.x=l,r.canvas.y=c,r.global.copyFrom(r.canvas),r.offset.copyFrom(r.canvas),r.nativeEvent=e,r.type=e.type,r}},{key:"transferMouseData",value:function(e,r){e.isTrusted=r.isTrusted,e.srcElement=r.srcElement,e.timeStamp=rf.now(),e.type=r.type,e.altKey=r.altKey,e.metaKey=r.metaKey,e.shiftKey=r.shiftKey,e.ctrlKey=r.ctrlKey,e.button=r.button,e.buttons=r.buttons,e.client.x=r.clientX,e.client.y=r.clientY,e.movement.x=r.movementX,e.movement.y=r.movementY,e.page.x=r.pageX,e.page.y=r.pageY,e.screen.x=r.screenX,e.screen.y=r.screenY,e.relatedTarget=null}},{key:"setCursor",value:function(e){this.context.contextService.applyCursorStyle(e||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(e,r){var i=[];if(r.isTouchEvent(e))for(var a=0;a<e.changedTouches.length;a++){var s=e.changedTouches[a];Te(s.button)&&(s.button=0),Te(s.buttons)&&(s.buttons=1),Te(s.isPrimary)&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),Te(s.width)&&(s.width=s.radiusX||1),Te(s.height)&&(s.height=s.radiusY||1),Te(s.tiltX)&&(s.tiltX=0),Te(s.tiltY)&&(s.tiltY=0),Te(s.pointerType)&&(s.pointerType="touch"),Te(s.pointerId)&&(s.pointerId=s.identifier||0),Te(s.pressure)&&(s.pressure=s.force||.5),Te(s.twist)&&(s.twist=0),Te(s.tangentialPressure)&&(s.tangentialPressure=0),s.isNormalized=!0,s.type=e.type,i.push(s)}else if(r.isMouseEvent(e)){var o=e;Te(o.isPrimary)&&(o.isPrimary=!0),Te(o.width)&&(o.width=1),Te(o.height)&&(o.height=1),Te(o.tiltX)&&(o.tiltX=0),Te(o.tiltY)&&(o.tiltY=0),Te(o.pointerType)&&(o.pointerType="mouse"),Te(o.pointerId)&&(o.pointerId=HM),Te(o.pressure)&&(o.pressure=.5),Te(o.twist)&&(o.twist=0),Te(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,i.push(o)}else i.push(e);return i}}])}();im.tag="Event";var dT=[Dt.CIRCLE,Dt.ELLIPSE,Dt.IMAGE,Dt.RECT,Dt.LINE,Dt.POLYLINE,Dt.POLYGON,Dt.TEXT,Dt.PATH,Dt.HTML],fT=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"isVisible",value:function(e,r){var i,a=r.cullable;if(!a.enable)return!0;var s=r.getRenderBounds();if(pn.isEmpty(s))return!1;var o=e.getFrustum(),l=(i=r.parentNode)===null||i===void 0||(i=i.cullable)===null||i===void 0?void 0:i.visibilityPlaneMask;return a.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(r,s,l||eo.INDETERMINATE,o.planes),a.visible=a.visibilityPlaneMask!==eo.OUTSIDE,a.visible}},{key:"computeVisibilityWithPlaneMask",value:function(e,r,i,a){if(i===eo.OUTSIDE||i===eo.INSIDE)return i;for(var s=eo.INSIDE,o=dT.indexOf(e.nodeName)>-1,l=0,c=a.length;l<c;++l){var u=1<<l;if(i&u&&!(o&&(l===4||l===5))){var h=a[l],d=h.normal,f=h.distance;if(ye(d,r.getPositiveFarPoint(a[l]))+f<0)return eo.OUTSIDE;ye(d,r.getNegativeFarPoint(a[l]))+f<0&&(s|=u)}}return s}}])}(),am=function(){function n(){(0,N.Z)(this,n),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return(0,T.Z)(n,[{key:"apply",value:function(e){var r=this,i,a,s=e.config,o=e.renderingService,l=e.renderingContext,c=e.rBushRoot,u=l.root.ownerDocument.defaultView;this.rBush=c;var h=function(b){o.dirtify()},d=function(b){r.syncTasks.set(b.target,b.detail.affectChildren),o.dirtify()},f=function(b){var E=b.target;Vt.enableSizeAttenuation&&Vt.styleValueRegistry.updateSizeAttenuation(E,u.getCamera().getZoom())},v=function(b){var E=b.target,O=E.rBushNode;O!=null&&O.aabb&&r.rBush.remove(O.aabb),r.syncTasks.delete(E),Vt.sceneGraphService.dirtyToRoot(E),o.dirtify()};o.hooks.init.tap(n.tag,function(){u.addEventListener(De.MOUNTED,f),u.addEventListener(De.UNMOUNTED,v),u.addEventListener(De.ATTR_MODIFIED,h),u.addEventListener(De.BOUNDS_CHANGED,d)}),o.hooks.destroy.tap(n.tag,function(){u.removeEventListener(De.MOUNTED,f),u.removeEventListener(De.UNMOUNTED,v),u.removeEventListener(De.ATTR_MODIFIED,h),u.removeEventListener(De.BOUNDS_CHANGED,d),r.syncTasks.clear()});var g=(i=Vt.globalThis.requestIdleCallback)!==null&&i!==void 0?i:af.bind(Vt.globalThis),p=((a=s.future)===null||a===void 0?void 0:a.experimentalRICSyncRTree)===!0;o.hooks.endFrame.tap(n.tag,function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,g(function(){r.syncRTree(!0),r.isFirstTimeRenderingFinished=!0})):p&&Vt.globalThis.requestIdleCallback&&Vt.globalThis.cancelIdleCallback?(Vt.globalThis.cancelIdleCallback(r.ricSyncRTreeId),r.ricSyncRTreeId=Vt.globalThis.requestIdleCallback(function(){return r.syncRTree()})):r.syncRTree()})}},{key:"syncNode",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.isConnected){var i=e.rBushNode;i.aabb&&this.rBush.remove(i.aabb);var a=e.getRenderBounds();if(a){var s=e.renderable;r&&(s.dirtyRenderBounds||(s.dirtyRenderBounds=new pn),s.dirtyRenderBounds.update(a.center,a.halfExtents));var o=a.getMin(),l=(0,R.Z)(o,2),c=l[0],u=l[1],h=a.getMax(),d=(0,R.Z)(h,2),f=d[0],v=d[1];i.aabb||(i.aabb={}),i.aabb.displayObject=e,i.aabb.minX=c,i.aabb.minY=u,i.aabb.maxX=f,i.aabb.maxY=v}if(i.aabb&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.minX)&&!isNaN(i.aabb.minY))return i.aabb}}},{key:"syncRTree",value:function(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!(!r&&(this.syncing||this.syncTasks.size===0))){this.syncing=!0;var i=[],a=new Set,s=function(l){if(!a.has(l)&&l.renderable){var c=e.syncNode(l,r);c&&(i.push(c),a.add(l))}};this.syncTasks.forEach(function(o,l){o&&l.forEach(s);for(var c=l;c;)s(c),c=c.parentElement}),this.rBush.load(i),i.length=0,this.syncing=!1}}}])}();am.tag="Prepare";function Q8(n){return!!n.document}var ri=function(n){return n.READY="ready",n.BEFORE_RENDER="beforerender",n.RERENDER="rerender",n.AFTER_RENDER="afterrender",n.BEFORE_DESTROY="beforedestroy",n.AFTER_DESTROY="afterdestroy",n.RESIZE="resize",n.DIRTY_RECTANGLE="dirtyrectangle",n.RENDERER_CHANGED="rendererchanged",n}({}),sm=500,vT=.1,gT=1e3,Cc=new Kn(De.MOUNTED),Nc=new Kn(De.UNMOUNTED),ff=new Kn(ri.BEFORE_RENDER),om=new Kn(ri.RERENDER),vf=new Kn(ri.AFTER_RENDER),gf=function(n){function t(e){var r;(0,N.Z)(this,t),r=(0,_.Z)(this,t),r.Element=yn,r.inited=!1,r.context={};var i=e.container,a=e.canvas,s=e.renderer,o=e.width,l=e.height,c=e.background,u=e.cursor,h=e.supportsMutipleCanvasesInOneContainer,d=e.cleanUpOnDestroy,f=d===void 0?!0:d,v=e.offscreenCanvas,g=e.devicePixelRatio,p=e.requestAnimationFrame,y=e.cancelAnimationFrame,b=e.createImage,E=e.supportsTouchEvents,O=e.supportsPointerEvents,P=e.isTouchEvent,L=e.isMouseEvent,F=e.dblClickSpeed,I=o,V=l,Y=g||nf&&window.devicePixelRatio||1;return Y=Y>=1?Math.ceil(Y):1,a&&(I=o||UM(a)||a.width/Y,V=l||YM(a)||a.height/Y),r.customElements=new hT,r.devicePixelRatio=Y,r.requestAnimationFrame=p!=null?p:af.bind(Vt.globalThis),r.cancelAnimationFrame=y!=null?y:Gp.bind(Vt.globalThis),r.createImage=b!=null?b:function(){return new window.Image},r.supportsTouchEvents=E!=null?E:"ontouchstart"in Vt.globalThis,r.supportsPointerEvents=O!=null?O:!!Vt.globalThis.PointerEvent,r.isTouchEvent=P!=null?P:function(J){return r.supportsTouchEvents&&J instanceof Vt.globalThis.TouchEvent},r.isMouseEvent=L!=null?L:function(J){return!Vt.globalThis.MouseEvent||J instanceof Vt.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(J instanceof Vt.globalThis.PointerEvent))},v&&(Vt.offscreenCanvas=v),r.document=new nm,r.document.defaultView=r,h||ZM(i,r,f),r.initRenderingContext((0,B.Z)((0,B.Z)({},e),{},{width:I,height:V,background:c!=null?c:"transparent",cursor:u!=null?u:"default",cleanUpOnDestroy:f,devicePixelRatio:Y,requestAnimationFrame:r.requestAnimationFrame,cancelAnimationFrame:r.cancelAnimationFrame,createImage:r.createImage,supportsTouchEvents:r.supportsTouchEvents,supportsPointerEvents:r.supportsPointerEvents,isTouchEvent:r.isTouchEvent,isMouseEvent:r.isMouseEvent,dblClickSpeed:F!=null?F:200})),r.initDefaultCamera(I,V,s.clipSpaceNearZ),r.initRenderer(s,!0),r}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"initRenderingContext",value:function(r){this.context.config=r,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(r,i,a){var s=this,o=new Vt.CameraContribution;o.clipSpaceNearZ=a,o.setType(sn.EXPLORING,Bd.DEFAULT).setPosition(r/2,i/2,sm).setFocalPoint(r/2,i/2,0).setOrthographic(r/-2,r/2,i/2,i/-2,vT,gT),o.canvas=this,o.eventEmitter.on(Xg.UPDATED,function(){s.context.renderingContext.renderReasons.add(lo.CAMERA_CHANGED),Vt.enableSizeAttenuation&&s.getConfig().renderer.getConfig().enableSizeAttenuation&&s.updateSizeAttenuation()}),this.context.camera=o}},{key:"updateSizeAttenuation",value:function(){var r=this.getCamera().getZoom();this.document.documentElement.forEach(function(i){Vt.styleValueRegistry.updateSizeAttenuation(i,r)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var r=this;return this.readyPromise||(this.readyPromise=new Promise(function(i){r.resolveReadyPromise=function(){i(r)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,a=arguments.length>1?arguments[1]:void 0;zn.clearCache();var s=((r=this.getConfig().future)===null||r===void 0?void 0:r.experimentalCancelEventPropagation)===!0;a||this.dispatchEvent(new Kn(ri.BEFORE_DESTROY),s,s),this.frameId&&this.cancelAnimationFrame(this.frameId);var o=this.getRoot();i&&(this.unmountChildren(o),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),a||this.dispatchEvent(new Kn(ri.AFTER_DESTROY),s,s);var l=function(u){u.currentTarget=null,u.manager=null,u.target=null,u.relatedNode=null};l(Cc),l(Nc),l(ff),l(om),l(vf),l(qi),l(uf),l(hf),l(em),Vt.textService.clearCache()}},{key:"changeSize",value:function(r,i){this.resize(r,i)}},{key:"resize",value:function(r,i){var a,s=this.context.config;s.width=r,s.height=i,this.getContextService().resize(r,i);var o=this.context.camera,l=o.getProjectionMode();o.setPosition(r/2,i/2,sm).setFocalPoint(r/2,i/2,0),l===vi.ORTHOGRAPHIC?o.setOrthographic(r/-2,r/2,i/2,i/-2,o.getNear(),o.getFar()):o.setAspect(r/i);var c=((a=s.future)===null||a===void 0?void 0:a.experimentalCancelEventPropagation)===!0;this.dispatchEvent(new Kn(ri.RESIZE,{width:r,height:i}),c,c)}},{key:"appendChild",value:function(r,i){return this.document.documentElement.appendChild(r,i)}},{key:"insertBefore",value:function(r,i){return this.document.documentElement.insertBefore(r,i)}},{key:"removeChild",value:function(r){return this.document.documentElement.removeChild(r)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(r){var i,a=this;r&&(ff.detail=r,vf.detail=r);var s=((i=this.getConfig().future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;this.dispatchEvent(ff,s,s);var o=this.getRenderingService();o.render(this.getConfig(),r,function(){a.dispatchEvent(om,s,s)}),this.dispatchEvent(vf,s,s)}},{key:"run",value:function(){var r=this,i=function(s,o){r.render(o),r.frameId=r.requestAnimationFrame(i)};i()}},{key:"initRenderer",value:function(r){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!r)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new D2,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new im,new am,new rm([new fT])),this.loadRendererContainerModule(r),this.context.contextService=new this.context.ContextService((0,B.Z)((0,B.Z)({},Vt),this.context)),this.context.renderingService=new OA(Vt,this.context),this.context.eventService=new TA(Vt,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(r,a,!0)):this.context.contextService.initAsync().then(function(){i.initRenderingService(r,a)}).catch(function(s){console.error(s)})}},{key:"initRenderingService",value:function(r){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.context.renderingService.init(function(){var o;i.inited=!0;var l=((o=i.getConfig().future)===null||o===void 0?void 0:o.experimentalCancelEventPropagation)===!0;a?s?i.requestAnimationFrame(function(){i.dispatchEvent(new Kn(ri.READY),l,l)}):i.dispatchEvent(new Kn(ri.READY),l,l):i.dispatchEvent(new Kn(ri.RENDERER_CHANGED),l,l),i.readyPromise&&i.resolveReadyPromise(),a||i.getRoot().forEach(function(c){var u,h;(u=(h=c).dirty)===null||u===void 0||u.call(h,!0,!0)}),i.mountChildren(i.getRoot()),r.getConfig().enableAutoRendering&&i.run()})}},{key:"loadRendererContainerModule",value:function(r){var i=this,a=r.getPlugins();a.forEach(function(s){s.context=i.context,s.init(Vt)})}},{key:"setRenderer",value:function(r){var i=this.getConfig();if(i.renderer!==r){var a=i.renderer;i.renderer=r,this.destroy(!1,!0),(0,k.Z)((a==null?void 0:a.getPlugins())||[]).reverse().forEach(function(s){s.destroy(Vt)}),this.initRenderer(r)}}},{key:"setCursor",value:function(r){var i=this.getConfig();i.cursor=r,this.getContextService().applyCursorStyle(r)}},{key:"unmountChildren",value:function(r){var i=this;if(r.childNodes.forEach(function(o){i.unmountChildren(o)}),this.inited){if(r.isMutationObserved)r.dispatchEvent(Nc);else{var a,s=((a=this.getConfig().future)===null||a===void 0?void 0:a.experimentalCancelEventPropagation)===!0;Nc.target=r,this.dispatchEvent(Nc,!0,s)}r!==this.document.documentElement&&(r.ownerDocument=null),r.isConnected=!1}r.isCustomElement&&r.disconnectedCallback&&r.disconnectedCallback()}},{key:"mountChildren",value:function(r){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xc(r);if(this.inited){if(!r.isConnected&&(r.ownerDocument=this.document,r.isConnected=!0,!a))if(r.isMutationObserved)r.dispatchEvent(Cc);else{var s,o=((s=this.getConfig().future)===null||s===void 0?void 0:s.experimentalCancelEventPropagation)===!0;Cc.target=r,this.dispatchEvent(Cc,!0,o)}}else console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",r.nodeName);r.childNodes.forEach(function(l){i.mountChildren(l,a)}),r.isCustomElement&&r.connectedCallback&&r.connectedCallback()}},{key:"mountFragment",value:function(r){this.mountChildren(r,!1)}},{key:"client2Viewport",value:function(r){return this.getEventService().client2Viewport(r)}},{key:"viewport2Client",value:function(r){return this.getEventService().viewport2Client(r)}},{key:"viewport2Canvas",value:function(r){return this.getEventService().viewport2Canvas(r)}},{key:"canvas2Viewport",value:function(r){return this.getEventService().canvas2Viewport(r)}},{key:"getPointByClient",value:function(r,i){return this.client2Viewport({x:r,y:i})}},{key:"getClientByPoint",value:function(r,i){return this.viewport2Client({x:r,y:i})}}])}(Kp);var pT=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.landmarks=[],e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"rotate",value:function(r,i,a){if(this.relElevation=io(i),this.relAzimuth=io(r),this.relRoll=io(a),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===sn.EXPLORING){var s=Na(Xn(),[1,0,0],an((this.rotateWorld?1:-1)*this.relElevation)),o=Na(Xn(),[0,1,0],an((this.rotateWorld?1:-1)*this.relAzimuth)),l=Na(Xn(),[0,0,1],an(this.relRoll)),c=ka(Xn(),o,s);c=ka(Xn(),c,l);var u=Wo(Wt(),c);Ht(this.matrix,this.matrix,[0,0,-this.distance]),Jt(this.matrix,this.matrix,u),Ht(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===sn.ORBITING||this.type===sn.EXPLORING?this._getPosition():this.type===sn.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(r,i){var a=Dr(r,i,0),s=wt(this.position);return Ut(s,s,Pt(pt(),this.right,a[0])),Ut(s,s,Pt(pt(),this.up,a[1])),this._setPosition(s),this.triggerUpdate(),this}},{key:"dolly",value:function(r){var i=this.forward,a=wt(this.position),s=r*this.dollyingStep,o=this.distance+r*this.dollyingStep;return s=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,a[0]+=s*i[0],a[1]+=s*i[1],a[2]+=s*i[2],this._setPosition(a),this.type===sn.ORBITING||this.type===sn.EXPLORING?this._getDistance():this.type===sn.TRACKING&&Ut(this.focalPoint,a,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(r){var i,a,s,o,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=l.position,u=c===void 0?this.position:c,h=l.focalPoint,d=h===void 0?this.focalPoint:h,f=l.roll,v=l.zoom,g=new Vt.CameraContribution;g.setType(this.type,void 0),g.setPosition(u[0],(i=u[1])!==null&&i!==void 0?i:this.position[1],(a=u[2])!==null&&a!==void 0?a:this.position[2]),g.setFocalPoint(d[0],(s=d[1])!==null&&s!==void 0?s:this.focalPoint[1],(o=d[2])!==null&&o!==void 0?o:this.focalPoint[2]),g.setRoll(f!=null?f:this.roll),g.setZoom(v!=null?v:this.zoom);var p={name:r,matrix:ue(g.getWorldTransform()),right:wt(g.right),up:wt(g.up),forward:wt(g.forward),position:wt(g.getPosition()),focalPoint:wt(g.getFocalPoint()),distanceVector:wt(g.getDistanceVector()),distance:g.getDistance(),dollyingStep:g.getDollyingStep(),azimuth:g.getAzimuth(),elevation:g.getElevation(),roll:g.getRoll(),relAzimuth:g.relAzimuth,relElevation:g.relElevation,relRoll:g.relRoll,zoom:g.getZoom()};return this.landmarks.push(p),p}},{key:"gotoLandmark",value:function(r){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=Ge(r)?this.landmarks.find(function(J){return J.name===r}):r;if(s){var o=ie(a)?{duration:a}:a,l=o.easing,c=l===void 0?"linear":l,u=o.duration,h=u===void 0?100:u,d=o.easingFunction,f=d===void 0?void 0:d,v=o.onfinish,g=v===void 0?void 0:v,p=o.onframe,y=p===void 0?void 0:p,b=.01;this.cancelLandmarkAnimation();var E=s.position,O=s.focalPoint,P=s.zoom,L=s.roll,F=f||Vt.EasingFunction(c),I,V=function(){i.setFocalPoint(O),i.setPosition(E),i.setRoll(L),i.setZoom(P),i.computeMatrix(),i.triggerUpdate(),g==null||g()};if(h===0)return V();var Y=function($){I===void 0&&(I=$);var ot=$-I;if(ot>=h){V();return}var ct=F(ot/h),ft=pt(),Nt=pt(),Ot=1,mt=0;_e(ft,i.focalPoint,O,ct),_e(Nt,i.position,E,ct),mt=i.roll*(1-ct)+L*ct,Ot=i.zoom*(1-ct)+P*ct,i.setFocalPoint(ft),i.setPosition(Nt),i.setRoll(mt),i.setZoom(Ot);var yt=ls(ft,O)+ls(Nt,E);if(yt<=b&&P===void 0&&L===void 0)return V();i.computeMatrix(),i.triggerUpdate(),ot<h&&(y==null||y(ct),i.landmarkAnimationID=i.canvas.requestAnimationFrame(Y))};this.canvas.requestAnimationFrame(Y)}}}])}(Qg);Vt.CameraContribution=pT;var lm=null,q8=0,cm=new WeakMap,J8=null,$8=null,kc,da;function t9(n,t){return kc=new lm(n,t)}function e9(n){return da||(da=lm.copy(kc),da.oldValue=n,da)}function n9(){kc=da=void 0}function mT(n){return n===da||n===kc}function r9(n,t){return n===t?n:da&&mT(n)?da:null}function yT(n){n.nodes.forEach(function(t){var e=cm.get(t);e&&e.forEach(function(r){r.observer===n&&r.removeTransientObservers()})})}function i9(n,t){for(var e=n;e;e=e.parentNode){var r=cm.get(e);if(r)for(var i=0;i<r.length;i++){var a=r[i],s=a.options;if(!(e!==n&&!s.subtree)){var o=t(s);o&&a.enqueue(o)}}}}var pf=!1,mf=null;function a9(n){mf.push(n),pf||(pf=!0,typeof runtime.globalThis!="undefined"?runtime.globalThis.setTimeout(yf):yf())}function yf(){pf=!1;var n=mf;mf=[],n.sort(function(e,r){return e.uid-r.uid});var t=!1;n.forEach(function(e){var r=e.takeRecords();yT(e),r.length&&(e.callback(r,e),t=!0)}),t&&yf()}var bf=function(n){function t(e,r,i,a){var s;return(0,N.Z)(this,t),s=(0,_.Z)(this,t,[e]),s.currentTime=i,s.timelineTime=a,s.target=r,s.type="finish",s.bubbles=!1,s.currentTarget=r,s.defaultPrevented=!1,s.eventPhase=s.AT_TARGET,s.timeStamp=Date.now(),s.currentTime=i,s.timelineTime=a,s}return(0,C.Z)(t,n),(0,T.Z)(t)}(Ec),bT=0,xT=function(){function n(t,e){var r;(0,N.Z)(this,n),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(bT++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number((r=this.effect)===null||r===void 0?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return(0,T.Z)(n,[{key:"pending",get:function(){return this._startTime===null&&!this._paused&&this.playbackRate!==0||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var e=this;return this.readyPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(r,i){e.resolveReadyPromise=function(){r(e)},e.rejectReadyPromise=function(){i(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var e=this;return this.finishedPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(r,i){e.resolveFinishedPromise=function(){r(e)},e.rejectFinishedPromise=function(){i(new Error)}}),this.playState==="finished"&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(e){if(e=Number(e),!isNaN(e)){if(this.timeline.restart(),!this._paused&&this._startTime!==null){var r;this._startTime=Number((r=this.timeline)===null||r===void 0?void 0:r.currentTime)-e/this.playbackRate}this.currentTimePending=!1,this._currentTime!==e&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(e,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(e){if(e!==null){if(this.updatePromises(),e=Number(e),isNaN(e)||this._paused||this._idle)return;this._startTime=e,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(e){if(e!==this._playbackRate){this.updatePromises();var r=this.currentTime;this._playbackRate=e,this.startTime=null,this.playState!=="paused"&&this.playState!=="idle"&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),r!==null&&(this.currentTime=r),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||this.playState==="running"||!this._finishedFlag}},{key:"updatePromises",value:function(){var e;if((e=this.effect.target)!==null&&e!==void 0&&e.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var r=this.oldPlayState,i=this.pending?"pending":this.playState;return this.readyPromise&&i!==r&&(i==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):r==="pending"?this.resolveReadyPromise():i==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&i!==r&&(i==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):i==="finished"?this.resolveFinishedPromise():r==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=i,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),this.timeline.animations.indexOf(this)===-1&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),!this._isFinished&&!this._paused&&!this._idle?this.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),!this._idle&&(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var e=this;if(this.updatePromises(),!!this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var r=new bf(null,this,this.currentTime,null);setTimeout(function(){e.oncancel(r)})}}},{key:"reverse",value:function(){this.updatePromises();var e=this.currentTime;this.playbackRate*=-1,this.play(),e!==null&&(this.currentTime=e),this.updatePromises()}},{key:"updatePlaybackRate",value:function(e){this.playbackRate=e}},{key:"targetAnimations",value:function(){var e,r=(e=this.effect)===null||e===void 0?void 0:e.target;return r.getAnimations()}},{key:"markTarget",value:function(){var e=this.targetAnimations();e.indexOf(this)===-1&&e.push(this)}},{key:"unmarkTarget",value:function(){var e=this.targetAnimations(),r=e.indexOf(this);r!==-1&&e.splice(r,1)}},{key:"tick",value:function(e,r){!this._idle&&!this._paused&&(this._startTime===null?r&&(this.startTime=e-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((e-this._startTime)*this.playbackRate)),r&&(this.currentTimePending=!1,this.fireEvents(e))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")}},{key:"persist",value:function(){throw new Error(rn)}},{key:"addEventListener",value:function(e,r,i){throw new Error(rn)}},{key:"removeEventListener",value:function(e,r,i){throw new Error(rn)}},{key:"dispatchEvent",value:function(e){throw new Error(rn)}},{key:"commitStyles",value:function(){throw new Error(rn)}},{key:"ensureAlive",value:function(){if(this.playbackRate<0&&this.currentTime===0){var e;this._inEffect=!!((e=this.effect)!==null&&e!==void 0&&e.update(-1))}else{var r;this._inEffect=!!((r=this.effect)!==null&&r!==void 0&&r.update(this.currentTime))}!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(e,r){e!==this._currentTime&&(this._currentTime=e,this._isFinished&&!r&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(e){var r=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var i=new bf(null,this,this.currentTime,e);setTimeout(function(){r.onfinish&&r.onfinish(i)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var a=new bf(null,this,this.currentTime,e);this.onframe(a)}this._finishedFlag=!1}}}])}(),ET=4,wT=.001,ST=1e-7,MT=10,ol=11,Pc=1/(ol-1),AT=typeof Float32Array=="function",um=function(t,e){return 1-3*e+3*t},hm=function(t,e){return 3*e-6*t},dm=function(t){return 3*t},Rc=function(t,e,r){return((um(e,r)*t+hm(e,r))*t+dm(e))*t},fm=function(t,e,r){return 3*um(e,r)*t*t+2*hm(e,r)*t+dm(e)},TT=function(t,e,r,i,a){var s,o,l=0;do o=e+(r-e)/2,s=Rc(o,i,a)-t,s>0?r=o:e=o;while(Math.abs(s)>ST&&++l<MT);return o},OT=function(t,e,r,i){for(var a=0;a<ET;++a){var s=fm(e,r,i);if(s===0)return e;var o=Rc(e,r,i)-t;e-=o/s}return e},xf=function(t,e,r,i){if(!(t>=0&&t<=1&&r>=0&&r<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&r===i)return function(l){return l};for(var a=AT?new Float32Array(ol):new Array(ol),s=0;s<ol;++s)a[s]=Rc(s*Pc,t,r);var o=function(c){for(var u=0,h=1,d=ol-1;h!==d&&a[h]<=c;++h)u+=Pc;--h;var f=(c-a[h])/(a[h+1]-a[h]),v=u+f*Pc,g=fm(v,t,r);return g>=wT?OT(c,v,t,r):g===0?v:TT(c,u,u+Pc,t,r)};return function(l){return l===0||l===1?l:Rc(o(l),e,i)}},CT=function(t){return t=t.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())}),t.charAt(0)==="-"?t.substring(1):t},Lc=function(t){return Math.pow(t,2)},_c=function(t){return Math.pow(t,3)},Dc=function(t){return Math.pow(t,4)},Ic=function(t){return Math.pow(t,5)},Bc=function(t){return Math.pow(t,6)},Fc=function(t){return 1-Math.cos(t*Math.PI/2)},zc=function(t){return 1-Math.sqrt(1-t*t)},jc=function(t){return t*t*(3*t-2)},Zc=function(t){for(var e,r=4;t<((e=Math.pow(2,--r))-1)/11;);return 1/Math.pow(4,3-r)-7.5625*Math.pow((e*3-2)/22-t,2)},Wc=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=(0,R.Z)(e,2),i=r[0],a=i===void 0?1:i,s=r[1],o=s===void 0?.5:s,l=kn(Number(a),1,10),c=kn(Number(o),.1,2);return t===0||t===1?t:-l*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(Math.PI*2)*Math.asin(1/l))*(Math.PI*2)/c)},ll=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=(0,R.Z)(e,4),a=i[0],s=a===void 0?1:a,o=i[1],l=o===void 0?100:o,c=i[2],u=c===void 0?10:c,h=i[3],d=h===void 0?0:h;s=kn(s,.1,1e3),l=kn(l,.1,1e3),u=kn(u,.1,1e3),d=kn(d,.1,1e3);var f=Math.sqrt(l/s),v=u/(2*Math.sqrt(l*s)),g=v<1?f*Math.sqrt(1-v*v):0,p=1,y=v<1?(v*f+-d)/g:-d+f,b=r?r*t/1e3:t;return v<1?b=Math.exp(-b*v*f)*(p*Math.cos(g*b)+y*Math.sin(g*b)):b=(p+y*b)*Math.exp(-b*f),t===0||t===1?t:1-b},Ef=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=e,i=(0,R.Z)(r,2),a=i[0],s=a===void 0?10:a,o=i[1],l=o==="start"?Math.ceil:Math.floor;return l(kn(t,0,1)*s)/s},vm=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=(0,R.Z)(e,4),i=r[0],a=r[1],s=r[2],o=r[3];return xf(i,a,s,o)(t)},Gc=xf(.42,0,1,1),pi=function(t){return function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return 1-t(1-e,r,i)}},mi=function(t){return function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return e<.5?t(e*2,r,i)/2:1-t(e*-2+2,r,i)/2}},yi=function(t){return function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-e*2,r,i))/2:(t(e*2-1,r,i)+1)/2}},gm={steps:Ef,"step-start":function(t){return Ef(t,[1,"start"])},"step-end":function(t){return Ef(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":vm,ease:function(t){return vm(t,[.25,.1,.25,1])},in:Gc,out:pi(Gc),"in-out":mi(Gc),"out-in":yi(Gc),"in-quad":Lc,"out-quad":pi(Lc),"in-out-quad":mi(Lc),"out-in-quad":yi(Lc),"in-cubic":_c,"out-cubic":pi(_c),"in-out-cubic":mi(_c),"out-in-cubic":yi(_c),"in-quart":Dc,"out-quart":pi(Dc),"in-out-quart":mi(Dc),"out-in-quart":yi(Dc),"in-quint":Ic,"out-quint":pi(Ic),"in-out-quint":mi(Ic),"out-in-quint":yi(Ic),"in-expo":Bc,"out-expo":pi(Bc),"in-out-expo":mi(Bc),"out-in-expo":yi(Bc),"in-sine":Fc,"out-sine":pi(Fc),"in-out-sine":mi(Fc),"out-in-sine":yi(Fc),"in-circ":zc,"out-circ":pi(zc),"in-out-circ":mi(zc),"out-in-circ":yi(zc),"in-back":jc,"out-back":pi(jc),"in-out-back":mi(jc),"out-in-back":yi(jc),"in-bounce":Zc,"out-bounce":pi(Zc),"in-out-bounce":mi(Zc),"out-in-bounce":yi(Zc),"in-elastic":Wc,"out-elastic":pi(Wc),"in-out-elastic":mi(Wc),"out-in-elastic":yi(Wc),spring:ll,"spring-in":ll,"spring-out":pi(ll),"spring-in-out":mi(ll),"spring-out-in":yi(ll)},NT=function(t){return CT(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},kT=function(t){return gm[NT(t)]||gm.linear},PT=function(t){return t},RT=1,LT=.5,pm=0;function mm(n,t){return function(e){if(e>=1)return 1;var r=1/n;return e+=t*r,e-e%r}}var Vc="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",_T=new RegExp("cubic-bezier\\(".concat(Vc,",").concat(Vc,",").concat(Vc,",").concat(Vc,"\\)")),DT=/steps\(\s*(\d+)\s*\)/,IT=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function wf(n){var t=_T.exec(n);if(t)return xf.apply(void 0,(0,k.Z)(t.slice(1).map(Number)));var e=DT.exec(n);if(e)return mm(Number(e[1]),pm);var r=IT.exec(n);return r?mm(Number(r[1]),{start:RT,middle:LT,end:pm}[r[2]]):kT(n)}function BT(n){return Math.abs(FT(n)/(n.playbackRate||1))}function FT(n){var t;return n.duration===0||n.iterations===0?0:(n.duration==="auto"?0:Number(n.duration))*((t=n.iterations)!==null&&t!==void 0?t:1)}var ym=0,Sf=1,Uc=2,bm=3;function zT(n,t,e){if(t===null)return ym;var r=e.endTime;return t<Math.min(e.delay,r)?Sf:t>=Math.min(e.delay+n+e.endDelay,r)?Uc:bm}function jT(n,t,e,r,i){switch(r){case Sf:return t==="backwards"||t==="both"?0:null;case bm:return e-i;case Uc:return t==="forwards"||t==="both"?n:null;case ym:return null}}function ZT(n,t,e,r,i){var a=i;return n===0?t!==Sf&&(a+=e):a+=r/n,a}function WT(n,t,e,r,i,a){var s=n===1/0?t%1:n%1;return s===0&&e===Uc&&r!==0&&(i!==0||a===0)&&(s=1),s}function GT(n,t,e,r){return n===Uc&&t===1/0?1/0:e===1?Math.floor(r)-1:Math.floor(r)}function VT(n,t,e){var r=n;if(n!=="normal"&&n!=="reverse"){var i=t;n==="alternate-reverse"&&(i+=1),r="normal",i!==1/0&&i%2!==0&&(r="reverse")}return r==="normal"?e:1-e}function UT(n,t,e){var r=zT(n,t,e),i=jT(n,e.fill,t,r,e.delay);if(i===null)return null;var a=e.duration==="auto"?0:e.duration,s=ZT(a,r,e.iterations,i,e.iterationStart),o=WT(s,e.iterationStart,r,e.iterations,i,a),l=GT(r,e.iterations,o,s),c=VT(e.direction,l,o);return e.currentIteration=l,e.progress=c,e.easingFunction(c)}function YT(n,t,e){var r=HT(n,t),i=XT(r,e);return function(a,s){if(s!==null)i.filter(function(l){return s>=l.applyFrom&&s<l.applyTo}).forEach(function(l){var c=s-l.startOffset,u=l.endOffset-l.startOffset,h=u===0?0:c/u;a.setAttribute(l.property,l.interpolation(h),!1,!1)});else for(var o in r)xm(o)&&a.setAttribute(o,null)}}function xm(n){return n!=="offset"&&n!=="easing"&&n!=="composite"&&n!=="computedOffset"}function HT(n,t){for(var e={},r=0;r<n.length;r++)for(var i in n[r])if(xm(i)){var a={offset:n[r].offset,computedOffset:n[r].computedOffset,easing:n[r].easing,easingFunction:wf(n[r].easing)||t.easingFunction,value:n[r][i]};e[i]=e[i]||[],e[i].push(a)}return e}function XT(n,t){var e=[];for(var r in n)for(var i=n[r],a=0;a<i.length-1;a++){var s=a,o=a+1,l=i[s].computedOffset,c=i[o].computedOffset,u=l,h=c;a===0&&(u=-1/0,c===0&&(o=s)),a===i.length-2&&(h=1/0,l===1&&(s=o)),e.push({applyFrom:u,applyTo:h,startOffset:i[s].computedOffset,endOffset:i[o].computedOffset,easingFunction:i[s].easingFunction,property:r,interpolation:KT(r,i[s].value,i[o].value,t)})}return e.sort(function(d,f){return d.startOffset-f.startOffset}),e}var Em=function(t,e,r){return function(i){var a=wm(t,e,i);return ie(a)?a:r(a)}};function KT(n,t,e,r){var i=Lp[n];if(i&&i.syntax&&i.int){var a=Vt.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var s=a.parser,o=s?s(t,r):t,l=s?s(e,r):e,c=a.mixer(o,l,r);if(c){var u=Em.apply(void 0,(0,k.Z)(c));return function(h){return h===0?t:h===1?e:u(h)}}}}return Em(!1,!0,function(h){return h?e:t})}function wm(n,t,e){if(typeof n=="number"&&typeof t=="number")return n*(1-e)+t*e;if(typeof n=="boolean"&&typeof t=="boolean"||typeof n=="string"&&typeof t=="string")return e<.5?n:t;if(Array.isArray(n)&&Array.isArray(t)){for(var r=n.length,i=t.length,a=Math.max(r,i),s=[],o=0;o<a;o++)s.push(wm(n[o<r?o:r-1],t[o<i?o:i-1],e));return s}throw new Error("Mismatched interpolation arguments ".concat(n,":").concat(t))}var QT=function(){function n(){(0,N.Z)(this,n),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=PT,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return(0,T.Z)(n,[{key:"easing",get:function(){return this._easing},set:function(e){this.easingFunction=wf(e),this._easing=e}}])}();function qT(n){var t=[];for(var e in n)if(!(e in["easing","offset","composite"])){var r=n[e];Array.isArray(r)||(r=[r]);for(var i=r.length,a=0;a<i;a++){if(!t[a]){var s={};"offset"in n&&(s.offset=Number(n.offset)),"easing"in n&&(s.easing=n.easing),"composite"in n&&(s.composite=n.composite),t[a]=s}r[a]!==void 0&&r[a]!==null&&(t[a][e]=r[a])}}return t.sort(function(o,l){return(o.computedOffset||0)-(l.computedOffset||0)}),t}function Sm(n,t){if(n===null)return[];Array.isArray(n)||(n=qT(n));for(var e=n.map(function(l){var c={};t!=null&&t.composite&&(c.composite="auto");for(var u in l){var h=l[u];if(u==="offset"){if(h!==null){if(h=Number(h),!isFinite(h))throw new Error("Keyframe offsets must be numbers.");if(h<0||h>1)throw new Error("Keyframe offsets must be between 0 and 1.");c.computedOffset=h}}else if(u==="composite"&&["replace","add","accumulate","auto"].indexOf(h)===-1)throw new Error("".concat(h," compositing is not supported"));c[u]=h}return c.offset===void 0&&(c.offset=null),c.easing===void 0&&(c.easing=(t==null?void 0:t.easing)||"linear"),c.composite===void 0&&(c.composite="auto"),c}),r=!0,i=-1/0,a=0;a<e.length;a++){var s=e[a].offset;if(me(s))r=!1;else{if(s<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=s}}e=e.filter(function(l){return Number(l.offset)>=0&&Number(l.offset)<=1});function o(){var l,c=e,u=c.length;if(e[u-1].computedOffset=Number((l=e[u-1].offset)!==null&&l!==void 0?l:1),u>1){var h;e[0].computedOffset=Number((h=e[0].offset)!==null&&h!==void 0?h:0)}for(var d=0,f=Number(e[0].computedOffset),v=1;v<u;v++){var g=e[v].computedOffset;if(!me(g)&&!me(f)){for(var p=1;p<v-d;p++)e[d+p].computedOffset=f+(Number(g)-f)*p/(v-d);d=v,f=Number(g)}}}return r||o(),e}var JT="backwards|forwards|both|none".split("|"),$T="reverse|alternate|alternate-reverse".split("|");function tO(n,t){var e=new QT;return t&&(e.fill="both",e.duration="auto"),typeof n=="number"&&!isNaN(n)?e.duration=n:n!==void 0&&Object.keys(n).forEach(function(r){if(n[r]!==void 0&&n[r]!==null&&n[r]!=="auto"){if((typeof e[r]=="number"||r==="duration")&&(typeof n[r]!="number"||isNaN(n[r]))||r==="fill"&&JT.indexOf(n[r])===-1||r==="direction"&&$T.indexOf(n[r])===-1)return;e[r]=n[r]}}),e}function eO(n,t){return n=nO(n!=null?n:{duration:"auto"}),tO(n,t)}function nO(n){return typeof n=="number"&&(isNaN(n)?n={duration:"auto"}:n={duration:n}),n}var rO=function(){function n(t,e,r){var i=this;(0,N.Z)(this,n),this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=eO(r,!1),this.timing.effect=this,this.timing.activeDuration=BT(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Sm(e,this.timing),this.interpolations=YT(this.normalizedKeyframes,this.timing,this.target);var a=Vt.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(o,l){return l==="duration"?o.duration==="auto"?0:o.duration:l==="fill"?o.fill==="auto"?"none":o.fill:l==="localTime"?i.animation&&i.animation.currentTime||null:l==="currentIteration"?!i.animation||i.animation.playState!=="running"?null:o.currentIteration||0:l==="progress"?!i.animation||i.animation.playState!=="running"?null:o.progress||0:o[l]},set:function(){return!0}}):this.timing}return(0,T.Z)(n,[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(e){return e===null?!1:(this.timeFraction=UT(this.timing.activeDuration,e,this.timing),this.timeFraction!==null)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(e){this.normalizedKeyframes=Sm(e)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(e){var r=this;Object.keys(e||{}).forEach(function(i){r.timing[i]=e[i]})}}])}();function Mm(n,t){return Number(n.id)-Number(t.id)}var iO=function(){function n(t){var e=this;(0,N.Z)(this,n),this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(r){e.currentTime=r,e.discardAnimations(),e.animations.length===0?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(r){var i=e.rafCallbacks;e.rafCallbacks=[],r<Number(e.currentTime)&&(r=Number(e.currentTime)),e.animations.sort(Mm),e.animations=e.tick(r,!0,e.animations)[0],i.forEach(function(a){a[1](r)}),e.applyPendingEffects()},this.document=t}return(0,T.Z)(n,[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(e,r,i){var a=new rO(e,r,i),s=new xT(a,this);return this.animations.push(s),this.restartWebAnimationsNextTick(),s.updatePromises(),s.play(),s.updatePromises(),s}},{key:"applyDirtiedAnimation",value:function(e){var r=this;if(!this.inTick){e.markTarget();var i=e.targetAnimations();i.sort(Mm);var a=this.tick(Number(this.currentTime),!1,i.slice())[1];a.forEach(function(s){var o=r.animations.indexOf(s);o!==-1&&r.animations.splice(o,1)}),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach(function(e){e==null||e.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(e){return e.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(e){return e.playState!=="finished"&&e.playState!=="idle"})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(e){var r=this.rafId++;return this.rafCallbacks.length===0&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([r,e]),r}},{key:"requestAnimationFrame",value:function(e){var r=this;return this.rAF(function(i){r.updateAnimationsPromises(),e(i),r.updateAnimationsPromises()})}},{key:"tick",value:function(e,r,i){var a=this,s,o;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=e,this.ticking=!1;var l=[],c=[],u=[],h=[];return i.forEach(function(d){d.tick(e,r),d._inEffect?(c.push(d.effect),d.markTarget()):(l.push(d.effect),d.unmarkTarget()),d._needsTick&&(a.ticking=!0);var f=d._inEffect||d._needsTick;d._inTimeline=f,f?u.push(d):h.push(d)}),(s=this.pendingEffects).push.apply(s,l),(o=this.pendingEffects).push.apply(o,c),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[u,h]}}])}();Vt.EasingFunction=wf,Vt.AnimationTimeline=iO;var Am=function(n){return me(n)?"":n.toString()},aO=function(n){var t=Am(n);return t.charAt(0).toUpperCase()+t.substring(1)},Yc=aO,sO=function(n){return typeof n=="object"&&n!==null},Mf=sO,oO=function(n){return n!==null&&typeof n!="function"&&isFinite(n.length)},cl=oO,Af=function(n,t){if(n===t)return!0;if(!n||!t||Ge(n)||Ge(t))return!1;if(cl(n)||cl(t)){if(n.length!==t.length)return!1;for(var e=!0,r=0;r<n.length&&(e=Af(n[r],t[r]),!!e);r++);return e}if(Mf(n)||Mf(t)){var i=Object.keys(n),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,r=0;r<i.length&&(e=Af(n[i[r]],t[i[r]]),!!e);r++);return e}return!1},Zn=Af;const lO={duration:500},cO={duration:1e3,easing:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",iterations:1,fill:"both"},s9={CHANGE:"change"};var wn;(function(n){n.NodeAdded="NodeAdded",n.NodeUpdated="NodeUpdated",n.NodeRemoved="NodeRemoved",n.EdgeAdded="EdgeAdded",n.EdgeUpdated="EdgeUpdated",n.EdgeRemoved="EdgeRemoved",n.ComboAdded="ComboAdded",n.ComboUpdated="ComboUpdated",n.ComboRemoved="ComboRemoved"})(wn||(wn={}));var Hr;(function(n){n.DRAW="draw",n.COLLAPSE="collapse",n.EXPAND="expand",n.TRANSFORM="transform"})(Hr||(Hr={}));var fa;(function(n){n.CLICK="canvas:click",n.DBLCLICK="canvas:dblclick",n.POINTER_OVER="canvas:pointerover",n.POINTER_LEAVE="canvas:pointerleave",n.POINTER_ENTER="canvas:pointerenter",n.POINTER_MOVE="canvas:pointermove",n.POINTER_OUT="canvas:pointerout",n.POINTER_DOWN="canvas:pointerdown",n.POINTER_UP="canvas:pointerup",n.CONTEXT_MENU="canvas:contextmenu",n.DRAG_START="canvas:dragstart",n.DRAG="canvas:drag",n.DRAG_END="canvas:dragend",n.DRAG_ENTER="canvas:dragenter",n.DRAG_OVER="canvas:dragover",n.DRAG_LEAVE="canvas:dragleave",n.DROP="canvas:drop",n.WHEEL="canvas:wheel"})(fa||(fa={}));var Cs;(function(n){n.CLICK="combo:click",n.DBLCLICK="combo:dblclick",n.POINTER_OVER="combo:pointerover",n.POINTER_LEAVE="combo:pointerleave",n.POINTER_ENTER="combo:pointerenter",n.POINTER_MOVE="combo:pointermove",n.POINTER_OUT="combo:pointerout",n.POINTER_DOWN="combo:pointerdown",n.POINTER_UP="combo:pointerup",n.CONTEXT_MENU="combo:contextmenu",n.DRAG_START="combo:dragstart",n.DRAG="combo:drag",n.DRAG_END="combo:dragend",n.DRAG_ENTER="combo:dragenter",n.DRAG_OVER="combo:dragover",n.DRAG_LEAVE="combo:dragleave",n.DROP="combo:drop"})(Cs||(Cs={}));var Bt;(function(n){n.CLICK="click",n.DBLCLICK="dblclick",n.POINTER_OVER="pointerover",n.POINTER_LEAVE="pointerleave",n.POINTER_ENTER="pointerenter",n.POINTER_MOVE="pointermove",n.POINTER_OUT="pointerout",n.POINTER_DOWN="pointerdown",n.POINTER_UP="pointerup",n.CONTEXT_MENU="contextmenu",n.DRAG_START="dragstart",n.DRAG="drag",n.DRAG_END="dragend",n.DRAG_ENTER="dragenter",n.DRAG_OVER="dragover",n.DRAG_LEAVE="dragleave",n.DROP="drop",n.KEY_DOWN="keydown",n.KEY_UP="keyup",n.WHEEL="wheel",n.PINCH="pinch"})(Bt||(Bt={}));var uo;(function(n){n.KEY_DOWN="keydown",n.KEY_UP="keyup"})(uo||(uo={}));var Hc;(function(n){n.CLICK="edge:click",n.DBLCLICK="edge:dblclick",n.POINTER_OVER="edge:pointerover",n.POINTER_LEAVE="edge:pointerleave",n.POINTER_ENTER="edge:pointerenter",n.POINTER_MOVE="edge:pointermove",n.POINTER_OUT="edge:pointerout",n.POINTER_DOWN="edge:pointerdown",n.POINTER_UP="edge:pointerup",n.CONTEXT_MENU="edge:contextmenu",n.DRAG_ENTER="edge:dragenter",n.DRAG_OVER="edge:dragover",n.DRAG_LEAVE="edge:dragleave",n.DROP="edge:drop"})(Hc||(Hc={}));var Kt;(function(n){n.BEFORE_CANVAS_INIT="beforecanvasinit",n.AFTER_CANVAS_INIT="aftercanvasinit",n.BEFORE_SIZE_CHANGE="beforesizechange",n.AFTER_SIZE_CHANGE="aftersizechange",n.BEFORE_ELEMENT_CREATE="beforeelementcreate",n.AFTER_ELEMENT_CREATE="afterelementcreate",n.BEFORE_ELEMENT_UPDATE="beforeelementupdate",n.AFTER_ELEMENT_UPDATE="afterelementupdate",n.BEFORE_ELEMENT_DESTROY="beforeelementdestroy",n.AFTER_ELEMENT_DESTROY="afterelementdestroy",n.BEFORE_ELEMENT_TRANSLATE="beforeelementtranslate",n.AFTER_ELEMENT_TRANSLATE="afterelementtranslate",n.BEFORE_DRAW="beforedraw",n.AFTER_DRAW="afterdraw",n.BEFORE_RENDER="beforerender",n.AFTER_RENDER="afterrender",n.BEFORE_ANIMATE="beforeanimate",n.AFTER_ANIMATE="afteranimate",n.BEFORE_LAYOUT="beforelayout",n.AFTER_LAYOUT="afterlayout",n.BEFORE_STAGE_LAYOUT="beforestagelayout",n.AFTER_STAGE_LAYOUT="afterstagelayout",n.BEFORE_TRANSFORM="beforetransform",n.AFTER_TRANSFORM="aftertransform",n.BATCH_START="batchstart",n.BATCH_END="batchend",n.BEFORE_DESTROY="beforedestroy",n.AFTER_DESTROY="afterdestroy",n.BEFORE_RENDERER_CHANGE="beforerendererchange",n.AFTER_RENDERER_CHANGE="afterrendererchange"})(Kt||(Kt={}));var Da;(function(n){n.UNDO="undo",n.REDO="redo",n.CANCEL="cancel",n.ADD="add",n.CLEAR="clear",n.CHANGE="change"})(Da||(Da={}));var bi;(function(n){n.CLICK="node:click",n.DBLCLICK="node:dblclick",n.POINTER_OVER="node:pointerover",n.POINTER_LEAVE="node:pointerleave",n.POINTER_ENTER="node:pointerenter",n.POINTER_MOVE="node:pointermove",n.POINTER_OUT="node:pointerout",n.POINTER_DOWN="node:pointerdown",n.POINTER_UP="node:pointerup",n.CONTEXT_MENU="node:contextmenu",n.DRAG_START="node:dragstart",n.DRAG="node:drag",n.DRAG_END="node:dragend",n.DRAG_ENTER="node:dragenter",n.DRAG_OVER="node:dragover",n.DRAG_LEAVE="node:dragleave",n.DROP="node:drop"})(bi||(bi={}));const dn="combo",ii="tree";var ul;(function(n){n.NODE="node",n.EDGE="edge",n.COMBO="combo",n.THEME="theme",n.PALETTE="palette",n.LAYOUT="layout",n.BEHAVIOR="behavior",n.PLUGIN="plugin",n.ANIMATION="animation",n.TRANSFORM="transform",n.SHAPE="shape"})(ul||(ul={}));const Tf={animation:{},behavior:{},combo:{},edge:{},layout:{},node:{},palette:{},theme:{},plugin:{},transform:{},shape:{}};function va(n,t){var e;const r=(e=Tf[n])===null||e===void 0?void 0:e[t];if(r)return r}function o9(n){return EXTENSION_REGISTRY[n]}const uO="5.0.49",hO="G6";function ga(n){return`[${hO} v${uO}] ${n}`}const Xr={mute:!1,debug:n=>{!Xr.mute&&console.debug(ga(n))},info:n=>{!Xr.mute&&console.info(ga(n))},warn:n=>{!Xr.mute&&console.warn(ga(n))},error:n=>{!Xr.mute&&console.error(ga(n))}};function Tm(n){const{theme:t}=n;if(!t)return{};const e=va(ul.THEME,t);return e||(Xr.warn(`The theme of ${t} is not registered.`),{})}function Of(n,t){if(Array.isArray(n)&&n.length===0)return null;const e=Array.isArray(n)?n[0]:n,r=Array.isArray(n)?n.slice(1):t||[];return new Proxy(e,{get(i,a){return typeof i[a]=="function"&&!["onframe","onfinish"].includes(a)?(...s)=>{i[a](...s),r.forEach(o=>{var l;return(l=o[a])===null||l===void 0?void 0:l.call(o,...s)})}:a==="finished"?Promise.all([e.finished,...r.map(s=>s.finished)]):Reflect.get(i,a)},set(i,a,s){return["onframe","onfinish"].includes(a)||r.forEach(o=>{o[a]=s}),Reflect.set(i,a,s)}})}function Cf(n){const t=n.reduce((r,i)=>(Object.entries(i).forEach(([a,s])=>{r[a]===void 0?r[a]=[s]:r[a].push(s)}),r),{});Object.entries(t).forEach(([r,i])=>{(i.length!==n.length||i.some(a=>me(a))||i.every(a=>!["sourceNode","targetNode","childrenNode"].includes(r)&&Zn(a,i[0])))&&delete t[r]});const e=Object.entries(t).reduce((r,[i,a])=>(a.forEach((s,o)=>{r[o]?r[o][i]=s:r[o]={[i]:s}}),r),[]);return n.length!==0&&e.length===0&&e.push({_:0},{_:0}),e}function hl(n){switch(n){case"opacity":return 1;case"x":case"y":case"z":case"zIndex":return 0;case"visibility":return"visible";case"collapsed":return!1;case"states":return[];default:return}}function Om(n,t){const{animation:e}=n;if(e===!1||t===!1)return!1;const r=Object.assign({},lO);return Fn(e)&&Object.assign(r,e),Fn(t)&&Object.assign(r,t),r}function dO(n){if(typeof n=="string"){const t=va(ul.ANIMATION,n);return t||(Xr.warn(`The animation of ${n} is not registered.`),[])}return n}function fO(n,t,e,r){var i,a;const{animation:s}=n;if(s===!1||r===!1)return[];const o=(i=n==null?void 0:n[t])===null||i===void 0?void 0:i.animation;if(o===!1)return[];const l=o==null?void 0:o[e];if(l===!1)return[];const c=(a=Tm(n)[t])===null||a===void 0?void 0:a.animation,u=(d=[])=>dO(d).map(f=>Object.assign(Object.assign(Object.assign(Object.assign({},cO),Fn(s)&&s),f),Fn(r)&&r));if(l)return u(l);if(!c)return[];const h=c[e];return h===!1?[]:u(h)}function Cm(n,t,e,r=[]){if(!r&&n===0&&t===0&&e===0)return null;if(Array.isArray(r)){let a=-1;const s=[];for(let o=0;o<r.length;o++){const l=r[o];if(l[0]==="translate"){if(l[1]===n&&l[2]===t)return null;a=o,s.push(["translate",n,t])}else if(l[0]==="translate3d"){if(l[1]===n&&l[2]===t&&l[3]===e)return null;a=o,s.push(["translate3d",n,t,e!=null?e:0])}else s.push(l)}return a===-1&&s.splice(0,0,ie(e)?["translate3d",n,t,e!=null?e:0]:["translate",n,t]),s.length===0?null:s}const i=r?r.replace(/translate(3d)?\([^)]*\)/g,""):"";return e===0?`translate(${n}, ${t})${i}`:`translate3d(${n}, ${t}, ${e})${i}`}var vO=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};const gO=(n,t,e)=>{if(!e.length)return null;const[r,i]=t,a=c=>{var u;if(c){const h=n.getShape(c);if(!h)return null;const d=`get${Yc(c)}Style`,f=((u=n==null?void 0:n[d])===null||u===void 0?void 0:u.bind(n))||(p=>p),v=(f==null?void 0:f(r))||{},g=(f==null?void 0:f(i))||{};return{shape:h,fromStyle:v,toStyle:g}}else return{shape:n,fromStyle:r,toStyle:i}};let s;const o=e.map(c=>{var{fields:u,shape:h,states:d}=c,f=vO(c,["fields","shape","states"]);const v=a(h);if(!v)return null;const{shape:g,fromStyle:p,toStyle:y}=v,b=[{},{}];if(u.forEach(O=>{var P,L;Object.assign(b[0],{[O]:(P=p[O])!==null&&P!==void 0?P:hl(O)}),Object.assign(b[1],{[O]:(L=y[O])!==null&&L!==void 0?L:hl(O)})}),b.some(O=>Object.keys(O).some(P=>["x","y","z"].includes(P)))){const{x:O=0,y:P=0,z:L,transform:F=""}=g.attributes||{};b.forEach(I=>{var V,Y,J;I.transform=Cm((V=I.x)!==null&&V!==void 0?V:O,(Y=I.y)!==null&&Y!==void 0?Y:P,(J=I.z)!==null&&J!==void 0?J:L,F)})}const E=g.animate(Cf(b),f);return h===void 0&&(s=E),E}).filter(Boolean),l=s||(o==null?void 0:o[0]);return l?Of(l,o.filter(c=>c!==c)):null},pO=[{fields:["opacity"]}],mO=[{fields:["x","y"]}],Nm=[{fields:["x","y"]}],yO=Nm,km=[{fields:["sourceNode","targetNode"]}],bO=km,Pm=[{fields:["childrenNode","x","y"]}],xO=Pm,l9=[{fields:["childrenNode","x","y"]}];var EO=Object.prototype.hasOwnProperty;function wO(n,t){if(!t||!Wr(n))return{};for(var e={},r=fe(t)?t:function(o){return o[t]},i,a=0;a<n.length;a++){var s=n[a];i=r(s),EO.call(e,i)?e[i].push(s):e[i]=[s]}return e}var Xc=wO,Rm=function(n,t,e){var r,i,a,s,o=0;e||(e={});var l=function(){o=e.leading===!1?0:Date.now(),r=null,s=n.apply(i,a),r||(i=a=null)},c=function(){var u=Date.now();!o&&e.leading===!1&&(o=u);var h=t-(u-o);return i=this,a=arguments,h<=0||h>t?(r&&(clearTimeout(r),r=null),o=u,s=n.apply(i,a),r||(i=a=null)):!r&&e.trailing!==!1&&(r=setTimeout(l,h)),s};return c.cancel=function(){clearTimeout(r),o=0,r=i=a=null},c},Nf=function(n){if(typeof n!="object"||n===null)return n;var t;if(Wr(n)){t=[];for(var e=0,r=n.length;e<r;e++)typeof n[e]=="object"&&n[e]!=null?t[e]=Nf(n[e]):t[e]=n[e]}else{t={};for(var i in n)typeof n[i]=="object"&&n[i]!=null?t[i]=Nf(n[i]):t[i]=n[i]}return t},ho=Nf;function SO(n){return"source"in n&&"target"in n}function MO(n){return n.length===2}function c9(n){return n.length===3}function fo(n){return n instanceof Float32Array?!0:Array.isArray(n)&&(n.length===2||n.length===3)?n.every(t=>typeof t=="number"):!1}function $i(n,t,e){return n>=t&&n<=e}function Ri(n=0){if(Array.isArray(n)){const[t=0,e=t,r=t,i=e]=n;return[t,e,r,i]}return[n,n,n,n]}function AO(n=0){const t=Ri(n);return t[0]+t[2]}function u9(n=0){const t=Ri(n);return t[1]+t[3]}function ta(n){return n.max[0]-n.min[0]}function ea(n){return n.max[1]-n.min[1]}function Ia(n){return[ta(n),ea(n)]}function Ba(n,t){const e=fo(n)?kf(n):n.getShape("key").getBounds();return t?Fa(e,t):e}function kf(n){const[t,e,r=0]=n,i=new pn;return i.setMinMax([t,e,r],[t,e,r]),i}function Fa(n,t){const[e,r,i,a]=Ri(t),[s,o,l]=n.min,[c,u,h]=n.max,d=new pn;return d.setMinMax([s-a,o-e,l],[c+r,u+i,h]),d}function dl(n){if(n.length===0)return new pn;if(n.length===1)return n[0];const t=new pn;t.setMinMax(n[0].min,n[0].max);for(let e=1;e<n.length;e++){const r=n[e];t.setMinMax([Math.min(t.min[0],r.min[0]),Math.min(t.min[1],r.min[1]),Math.min(t.min[2],r.min[2])],[Math.max(t.max[0],r.max[0]),Math.max(t.max[1],r.max[1]),Math.max(t.max[2],r.max[2])])}return t}function TO(n,t){const[e,r]=n.min,[i,a]=n.max,[s,o]=t.min,[l,c]=t.max;return e>=s&&i<=l&&r>=o&&a<=c}function Li(n,t){return $i(n[0],t.min[0],t.max[0])&&$i(n[1],t.min[1],t.max[1])}function Lm(n,t,e=!1){const{min:[r,i],max:[a,s]}=t,o=(n[1]===i||n[1]===s)&&(e||$i(n[0],r,a)),l=(n[0]===r||n[0]===a)&&(e||$i(n[1],i,s));return o||l}function OO(n,t){return!Li(n,t)}function Kc(n,t){const{center:e}=t;return n[0]===e[0]&&n[1]===e[1]}function fl(n,t){const[e,r]=n,[i,a]=t.min,[s,o]=t.max,l=e-i,c=s-e,u=r-a,h=o-r,d=Math.min(l,c,u,h);return d===l?"left":d===c?"right":d===u?"top":d===h?"bottom":"left"}function Ns(n,t){const e=ho(n);if(Li(n,t))switch(fl(n,t)){case"left":e[0]=t.min[0];break;case"right":e[0]=t.max[0];break;case"top":e[1]=t.min[1];break;case"bottom":e[1]=t.max[1];break}else{const[r,i]=n,[a,s]=t.min,[o,l]=t.max;e[0]=$i(r,a,o)?r:r<a?a:o,e[1]=$i(i,s,l)?i:i<s?s:l}return e}function CO(n,t){const{center:e}=n,[r,i]=Ia(n),a=t==="up"||t==="down"?e[0]:t==="right"?e[0]-r/6:e[0]+r/6,s=t==="left"||t==="right"?e[1]:t==="down"?e[1]-i/6:e[1]+i/6;return[a,s]}function NO(n,t){let[e,r]=Ia(n);return[e,r]=t==="up"||t==="down"?[e,r]:[r,e],(Math.pow(r,2)-Math.pow(Math.sqrt(Math.pow(e/2,2)+Math.pow(r,2))-e/2,2))/(2*r)}function kO(n){const{min:[t,e],max:[r,i]}=n,a=[t,i],s=[r,i],o=[r,e],l=[t,e];return[[a,s],[s,o],[o,l],[l,a]]}var PO=function(t,e){var r=t.nodes,i=t.edges,a=[],s={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(o,l){s[o.id]=l;var c=[];a.push(c)}),i&&i.forEach(function(o){var l=o.source,c=o.target,u=s[l],h=s[c];!u&&u!==0||!h&&h!==0||(a[u][h]=1,e||(a[h][u]=1))}),a},Qc=PO,RO=function(t,e){return t===e},_m=function(){function n(t,e){e===void 0&&(e=null),this.value=t,this.next=e}return n.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},n}(),LO=function(){function n(t){t===void 0&&(t=RO),this.head=null,this.tail=null,this.compare=t}return n.prototype.prepend=function(t){var e=new _m(t,this.head);return this.head=e,this.tail||(this.tail=e),this},n.prototype.append=function(t){var e=new _m(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},n.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 r=this.head;if(r!==null)for(;r.next;)this.compare(r.next.value,t)?(e=r.next,r.next=r.next.next):r=r.next;return this.compare(this.tail.value,t)&&(this.tail=r),e},n.prototype.find=function(t){var e=t.value,r=e===void 0?void 0:e,i=t.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var s=this.head;s;){if(a&&a(s.value)||r!==void 0&&this.compare(s.value,r))return s;s=s.next}return null},n.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},n.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},n.prototype.fromArray=function(t){var e=this;return t.forEach(function(r){return e.append(r)}),this},n.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},n.prototype.reverse=function(){for(var t=this.head,e=null,r=null;t;)r=t.next,t.next=e,e=t,t=r;this.tail=this.head,this.head=e},n.prototype.toString=function(t){return t===void 0&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},n}(),Dm=LO,_O=function(){function n(){this.linkedList=new Dm}return n.prototype.isEmpty=function(){return!this.linkedList.head},n.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},n.prototype.enqueue=function(t){this.linkedList.append(t)},n.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},n.prototype.toString=function(t){return this.linkedList.toString(t)},n}(),DO=_O,xi=function(t,e,r){e===void 0&&(e=[]);var i=e.filter(function(l){return l.source===t||l.target===t});if(r==="target"){var a=function(c){return c.source===t};return i.filter(a).map(function(l){return l.target})}if(r==="source"){var s=function(c){return c.target===t};return i.filter(s).map(function(l){return l.source})}var o=function(c){return c.source===t?c.target:c.source};return i.map(o)},IO=function(t,e){return e.filter(function(r){return r.source===t})},qc=function(t,e){return e.filter(function(r){return r.source===t||r.target===t})},Im=function(t){t===void 0&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),r="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(r)};function BO(n){n===void 0&&(n={});var t=n,e=function(){},r=function(){var i={};return function(a){var s=a.next,o=s;return i[o]?!1:(i[o]=!0,!0)}}();return t.allowTraversal=n.allowTraversal||r,t.enter=n.enter||e,t.leave=n.leave||e,t}var FO=function(t,e,r,i){i===void 0&&(i=!0);var a=BO(r),s=new DO,o=t.edges,l=o===void 0?[]:o;s.enqueue(e);for(var c="",u=function(){var d=s.dequeue();a.enter({current:d,previous:c}),xi(d,l,i?"target":void 0).forEach(function(f){a.allowTraversal({previous:c,current:d,next:f})&&s.enqueue(f)}),a.leave({current:d,previous:c}),c=d};!s.isEmpty();)u()},zO=FO,jO=function(t){for(var e=t.nodes,r=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,s=[],o={},l=[],c=function f(v){l.push(v),o[v.id]=!0;for(var g=xi(v.id,a),p=function(E){var O=g[E];if(!o[O]){var P=r.filter(function(L){return L.id===O});P.length>0&&f(P[0])}},y=0;y<g.length;++y)p(y)},u=0;u<r.length;u++){var h=r[u];if(!o[h.id]){c(h);for(var d=[];l.length>0;)d.push(l.pop());s.push(d)}}return s},Bm=function(t){for(var e=t.nodes,r=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,s=[],o={},l={},c={},u=[],h=0,d=function p(y){l[y.id]=h,c[y.id]=h,h+=1,s.push(y),o[y.id]=!0;for(var b=xi(y.id,a,"target").filter(function(F){return r.map(function(I){return I.id}).indexOf(F)>-1}),E=function(I){var V=b[I];if(!l[V]&&l[V]!==0){var Y=r.filter(function(J){return J.id===V});Y.length>0&&p(Y[0]),c[y.id]=Math.min(c[y.id],c[V])}else o[V]&&(c[y.id]=Math.min(c[y.id],l[V]))},O=0;O<b.length;O++)E(O);if(c[y.id]===l[y.id]){for(var P=[];s.length>0;){var L=s.pop();if(o[L.id]=!1,P.push(L),L===y)break}P.length>0&&u.push(P)}},f=0,v=r;f<v.length;f++){var g=v[f];!l[g.id]&&l[g.id]!==0&&d(g)}return u};function Fm(n,t){return t?Bm(n):jO(n)}var vl=function(t){var e={},r=t.nodes,i=r===void 0?[]:r,a=t.edges,s=a===void 0?[]:a;return i.forEach(function(o){e[o.id]={degree:0,inDegree:0,outDegree:0}}),s.forEach(function(o){e[o.source].degree++,e[o.source].outDegree++,e[o.target].degree++,e[o.target].inDegree++}),e},Pf=vl,ZO=function(t,e){var r=vl(t);return r[e]?vl(t)[e].inDegree:0},WO=function(t,e){var r=vl(t);return r[e]?vl(t)[e].outDegree:0};function GO(n){n===void 0&&(n={});var t=n,e=function(){},r=function(){var i={};return function(a){var s=a.next;return i[s]?!1:(i[s]=!0,!0)}}();return t.allowTraversal=n.allowTraversal||r,t.enter=n.enter||e,t.leave=n.leave||e,t}function zm(n,t,e,r,i){i===void 0&&(i=!0),r.enter({current:t,previous:e});var a=n.edges,s=a===void 0?[]:a;xi(t,s,i?"target":void 0).forEach(function(o){r.allowTraversal({previous:e,current:t,next:o})&&zm(n,o,t,r,i)}),r.leave({current:t,previous:e})}function jm(n,t,e,r){r===void 0&&(r=!0),zm(n,t,"",GO(e),r)}var VO=function(t){var e=null,r=t.nodes,i=r===void 0?[]:r,a={},s={},o={},l={};i.forEach(function(h){s[h.id]=h});for(var c={enter:function(d){var f=d.current,v=d.previous;if(o[f]){e={};for(var g=f,p=v;p!==f;)e[g]=p,g=p,p=a[p];e[g]=p}else o[f]=f,delete s[f],a[f]=v},leave:function(d){var f=d.current;l[f]=f,delete o[f]},allowTraversal:function(d){var f=d.next;return e?!1:!l[f]}};Object.keys(s).length;){var u=Object.keys(s)[0];jm(t,u,c)}return e},Zm=function(t,e,r){var i,a;r===void 0&&(r=!0);for(var s=[],o=Fm(t,!1),l=0,c=o;l<c.length;l++){var u=c[l];if(u.length)for(var h=u[0],d=h.id,f=[h],v=(i={},i[d]=h,i),g=(a={},a[d]=new Set,a);f.length>0;)for(var p=f.pop(),y=p.id,b=xi(y,t.edges),E=function(L){var F,I=b[L],V=t.nodes.find(function(ft){return ft.id===I});if(I===y)s.push((F={},F[I]=p,F));else if(!(I in g))v[I]=p,f.push(V),g[I]=new Set([p]);else if(!g[y].has(V)){for(var Y=!0,J=[V,p],$=v[y];g[I].size&&!g[I].has($)&&(J.push($),$!==v[$.id]);)$=v[$.id];if(J.push($),e&&r?(Y=!1,J.findIndex(function(ft){return e.indexOf(ft.id)>-1})>-1&&(Y=!0)):e&&!r&&J.findIndex(function(ft){return e.indexOf(ft.id)>-1})>-1&&(Y=!1),Y){for(var ot={},ct=1;ct<J.length;ct+=1)ot[J[ct-1].id]=J[ct];J.length&&(ot[J[J.length-1].id]=J[0]),s.push(ot)}g[I].add(p)}},O=0;O<b.length;O+=1)E(O)}return s},Wm=function(t,e,r){r===void 0&&(r=!0);for(var i=[],a=new Set,s=[],o=[],l={},c={},u=function($){for(var ot=[$];ot.length>0;){var ct=ot.pop();a.has(ct)&&(a.delete(ct),s[ct.id].forEach(function(ft){ot.push(ft)}),s[ct.id].clear())}},h=function J($,ot,ct){var ft=!1;if(e&&r===!1&&e.indexOf($.id)>-1)return ft;i.push($),a.add($);for(var Nt=ct[$.id],Ot=0;Ot<Nt.length;Ot+=1){var mt=l[Nt[Ot]];if(mt===ot){for(var yt={},Rt=1;Rt<i.length;Rt+=1)yt[i[Rt-1].id]=i[Rt];i.length&&(yt[i[i.length-1].id]=i[0]),o.push(yt),ft=!0}else a.has(mt)||J(mt,ot,ct)&&(ft=!0)}if(ft)u($);else for(var Ot=0;Ot<Nt.length;Ot+=1){var mt=l[Nt[Ot]];s[mt.id].has($)||s[mt.id].add($)}return i.pop(),ft},d=t.nodes,f=d===void 0?[]:d,v=0;v<f.length;v+=1){var g=f[v],p=g.id;c[p]=v,l[v]=g}if(e&&r)for(var y=function($){var ot=e[$];c[f[$].id]=c[ot],c[ot]=0,l[0]=f.find(function(ct){return ct.id===ot}),l[c[f[$].id]]=f[$]},v=0;v<e.length;v++)y(v);for(var b=function($){for(var ot,ct,ft=1/0,Nt=0;Nt<$.length;Nt+=1)for(var Ot=$[Nt],mt=0;mt<Ot.length;mt++){var yt=c[Ot[mt].id];yt<ft&&(ft=yt,ct=Nt)}for(var Rt=$[ct],jt=[],Nt=0;Nt<Rt.length;Nt+=1){var Xt=Rt[Nt];jt[Xt.id]=[];for(var ee=0,ae=xi(Xt.id,t.edges,"target").filter(function(xe){return Rt.map(function(Ce){return Ce.id}).indexOf(xe)>-1});ee<ae.length;ee++){var he=ae[ee];he===Xt.id&&!(r===!1&&e.indexOf(Xt.id)>-1)?o.push((ot={},ot[Xt.id]=Xt,ot)):jt[Xt.id].push(c[he])}}return{component:Rt,adjList:jt,minIdx:ft}},E=0;E<f.length;){var O=f.filter(function(J){return c[J.id]>=E}),P=Bm({nodes:O,edges:t.edges}).filter(function(J){return J.length>1});if(P.length===0)break;var L=b(P),F=L.minIdx,I=L.adjList,V=L.component;if(V.length>1){V.forEach(function(J){s[J.id]=new Set});var Y=l[F];if(e&&r&&e.indexOf(Y.id)===-1)return o;h(Y,Y,I),E=F+1}else break}return o},UO=function(t,e,r,i){return i===void 0&&(i=!0),e?Wm(t,r,i):Zm(t,r,i)},Gm=VO,YO={}.toString,HO=function(n,t){return YO.call(n)==="[object "+t+"]"},Jc=HO,Rf=function(n){return Jc(n,"Function")},Lf=function(n){return Array.isArray?Array.isArray(n):Jc(n,"Array")},XO=function(n){var t=typeof n;return n!==null&&t==="object"||t==="function"};function KO(n,t){if(n){var e;if(Lf(n))for(var r=0,i=n.length;r<i&&(e=t(n[r],r),e!==!1);r++);else if(XO(n)){for(var a in n)if(n.hasOwnProperty(a)&&(e=t(n[a],a),e===!1))break}}}var Vm=KO,h9=Object.keys?function(n){return Object.keys(n)}:function(n){var t=[];return Vm(n,function(e,r){Rf(n)&&r==="prototype"||t.push(r)}),t},d9=null;function f9(n,t){var e=keys(t),r=e.length;if(isNil(n))return!r;for(var i=0;i<r;i+=1){var a=e[i];if(t[a]!==n[a]||!(a in n))return!1}return!0}var v9=null,g9=function(n){if(!isObjectLike(n)||!isType(n,"Object"))return!1;if(Object.getPrototypeOf(n)===null)return!0;for(var t=n;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(n)===t},p9=null;function m9(n,t){if(!isArray(n))return null;var e;if(isFunction(t)&&(e=t),isPlainObject(t)&&(e=function(i){return isMatch(i,t)}),e){for(var r=0;r<n.length;r+=1)if(e(n[r]))return n[r]}return null}var y9=null,b9=function(n,t){for(var e=null,r=0;r<n.length;r++){var i=n[r],a=i[t];if(!isNil(a)){isArray(a)?e=a[0]:e=a;break}}return e},x9=null,E9=function(n){if(!isArray(n))return[];for(var t=[],e=0;e<n.length;e++)t=t.concat(n[e]);return t},w9=null,QO=function(n,t){if(t===void 0&&(t=[]),!isArray(n))t.push(n);else for(var e=0;e<n.length;e+=1)QO(n[e],t);return t},S9=null,M9=function(n){if(isArray(n))return n.reduce(function(t,e){return Math.max(t,e)},n[0])},A9=function(n){if(isArray(n))return n.reduce(function(t,e){return Math.min(t,e)},n[0])},T9=function(n){var t=n.filter(function(s){return!isNaN(s)});if(!t.length)return{min:0,max:0};if(isArray(n[0])){for(var e=[],r=0;r<n.length;r++)e=e.concat(n[r]);t=e}var i=getMax(t),a=getMin(t);return{min:a,max:i}},O9=null,Um=Array.prototype,qO=Um.splice,JO=Um.indexOf,C9=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var r=0;r<t.length;r++)for(var i=t[r],a=-1;(a=JO.call(n,i))>-1;)qO.call(n,a,1);return n},N9=null,$O=Array.prototype.splice,k9=function(t,e){if(!isArrayLike(t))return[];for(var r=t?e.length:0,i=r-1;r--;){var a=void 0,s=e[r];(r===i||s!==a)&&(a=s,$O.call(t,s,1))}return t},P9=null,R9=function(n,t,e){if(!isArray(n)&&!isPlainObject(n))return n;var r=e;return each(n,function(i,a){r=t(r,i,a)}),r},L9=null,_9=function(n,t){var e=[];if(!isArrayLike(n))return e;for(var r=-1,i=[],a=n.length;++r<a;){var s=n[r];t(s,r,n)&&(e.push(s),i.push(r))}return pullAt(n,i),e},D9=null,_f=function(n){return Jc(n,"String")};function I9(n,t){var e;if(isFunction(t))e=function(i,a){return t(i)-t(a)};else{var r=[];isString(t)?r.push(t):isArray(t)&&(r=t),e=function(i,a){for(var s=0;s<r.length;s+=1){var o=r[s];if(i[o]>a[o])return 1;if(i[o]<a[o])return-1}return 0}}return n.sort(e),n}var B9=null;function Df(n,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++){var a=n[r];t.has(a)||(e.push(a),t.set(a,!0))}return e}var F9=function(n,t){for(var e=[],r={},i=0;i<n.length;i++){var a=n[i],s=a[t];if(!isNil(s)){isArray(s)||(s=[s]);for(var o=0;o<s.length;o++){var l=s[o];r[l]||(e.push(l),r[l]=!0)}}}return e};function z9(n,t){return isArray(n)||isString(n)?n[0]===t:!1}var j9=null;function Z9(n,t){return isArray(n)||isString(n)?n[n.length-1]===t:!1}var W9=null,tC=Object.prototype.hasOwnProperty;function G9(n,t){if(!t||!isArray(n))return{};for(var e={},r=isFunction(t)?t:function(o){return o[t]},i,a=0;a<n.length;a++){var s=n[a];i=r(s),tC.call(e,i)?e[i].push(s):e[i]=[s]}return e}var V9=null;function U9(n,t){if(!t)return{0:n};if(!isFunction(t)){var e=isArray(t)?t:t.replace(/\s+/g,"").split("*");t=function(r){for(var i="_",a=0,s=e.length;a<s;a++)i+=r[e[a]]&&r[e[a]].toString();return i}}return groupBy(n,t)}var Y9=function(n,t){if(!t)return[n];var e=groupToMap(n,t),r=[];for(var i in e)r.push(e[i]);return r},Ym={};function H9(n){var t=Ym[n];if(!t){for(var e=n.toString(16),r=e.length;r<6;r++)e="0"+e;t="#"+e,Ym[n]=t}return t}var X9=null;function K9(n){var t=0,e=0,r=0,i=0;return isArray(n)?n.length===1?t=e=r=i=n[0]:n.length===2?(t=r=n[0],e=i=n[1]):n.length===3?(t=n[0],e=i=n[1],r=n[2]):(t=n[0],e=n[1],r=n[2],i=n[3]):t=e=r=i=n,{r1:t,r2:e,r3:r,r4:i}}var Q9=null,eC=function(n){return Jc(n,"Number")},nC=eC,q9=function(n){return isNumber(n)&&n%1!==0},J9=null,$9=function(n){return isNumber(n)&&n%2===0},tz=null,ez=Number.isInteger?Number.isInteger:function(n){return nC(n)&&n%1===0},nz=null,rz=function(n){return isNumber(n)&&n<0},iz=null,az=function(n){return isNumber(n)&&n%2!==0},sz=null,oz=function(n){return isNumber(n)&&n>0},lz=null,cz=function(n,t){if(isArray(n)){for(var e,r=-1/0,i=0;i<n.length;i++){var a=n[i],s=isFunction(t)?t(a):a[t];s>r&&(e=a,r=s)}return e}},uz=function(n,t){if(isArray(n)){for(var e,r=1/0,i=0;i<n.length;i++){var a=n[i],s=isFunction(t)?t(a):a[t];s<r&&(e=a,r=s)}return e}},rC=180/Math.PI,hz=function(n){return rC*n},dz=null,iC=Math.PI/180,fz=function(n){return iC*n},vz=null,gz=null,aC=Object.values?function(n){return Object.values(n)}:function(n){var t=[];return Vm(n,function(e,r){Rf(n)&&r==="prototype"||t.push(e)}),t},sC=aC,pz=function(n,t){return contains(values(n),t)},oC={}.toString,mz=function(n){return oC.call(n).replace(/^\[object /,"").replace(/]$/,"")},yz=null,bz=function(n){return isType(n,"Arguments")},xz=null,Ez=function(n){return isType(n,"Boolean")},wz=null,Sz=function(n){return isType(n,"Date")},Mz=null,Az=function(n){return isType(n,"Error")},Tz=null;function Oz(n){return isNumber(n)&&isFinite(n)}var lC=Object.prototype,Cz=function(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||lC;return n===e},Nz=null,kz=function(n){return isType(n,"RegExp")},Pz=null,Rz=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];for(var e=n[0],r=1;r<n.length;r++){var i=n[r];isFunction(i)&&(i=i.prototype),mix(e.prototype,i)}},Lz=null,If=function(n){if(typeof n!="object"||n===null)return n;var t;if(Lf(n)){t=[];for(var e=0,r=n.length;e<r;e++)typeof n[e]=="object"&&n[e]!=null?t[e]=If(n[e]):t[e]=n[e]}else{t={};for(var i in n)typeof n[i]=="object"&&n[i]!=null?t[i]=If(n[i]):t[i]=n[i]}return t},gl=If,cC=function(n,t){if(!Rf(n))throw new TypeError("Expected a function");var e=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=t?t.apply(this,r):r[0],s=e.cache;if(s.has(a))return s.get(a);var o=n.apply(this,r);return s.set(a,o),o};return e.cache=new Map,e},uC=5;function Hm(n,t,e,r){e=e||0,r=r||uC;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];a!==null&&isPlainObject(a)?(isPlainObject(n[i])||(n[i]={}),e<r?Hm(n[i],a,e+1,r):n[i]=t[i]):isArray(a)?(n[i]=[],n[i]=n[i].concat(a)):a!==void 0&&(n[i]=a)}}var _z=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var r=0;r<t.length;r+=1)Hm(n,t[r]);return n},Dz=null,Iz=function(n,t,e,r){isFunction(t)||(e=t,t=n,n=function(){});var i=Object.create?function(s,o){return Object.create(s,{constructor:{value:o}})}:function(s,o){function l(){}l.prototype=s;var c=new l;return c.constructor=o,c},a=i(t.prototype,n);return n.prototype=mix(a,n.prototype),n.superclass=i(t.prototype,t),mix(a,e),mix(n,r),n},Bz=null,hC=Object.prototype.hasOwnProperty;function Fz(n){if(isNil(n))return!0;if(isArrayLike(n))return!n.length;var t=getType(n);if(t==="Map"||t==="Set")return!n.size;if(isPrototype(n))return!Object.keys(n).length;for(var e in n)if(hC.call(n,e))return!1;return!0}var zz=null,dC=function(n){return typeof n=="object"&&n!==null},Xm=dC,fC=function(n){return n!==null&&typeof n!="function"&&isFinite(n.length)},Km=fC,Bf=function(n,t){if(n===t)return!0;if(!n||!t||_f(n)||_f(t))return!1;if(Km(n)||Km(t)){if(n.length!==t.length)return!1;for(var e=!0,r=0;r<n.length&&(e=Bf(n[r],t[r]),!!e);r++);return e}if(Xm(n)||Xm(t)){var i=Object.keys(n),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,r=0;r<i.length&&(e=Bf(n[i[r]],t[i[r]]),!!e);r++);return e}return!1},vC=Bf,jz=function(n,t,e){return isFunction(e)?!!e(n,t):isEqual(n,t)},Zz=function(n,t,e){for(var r=0,i=isString(t)?t.split("."):t;n&&r<i.length;)n=n[i[r++]];return n===void 0||r<i.length?e:n},Wz=function(n,t,e){var r=n,i=isString(t)?t.split("."):t;return i.forEach(function(a,s){s<i.length-1?(isObject(r[a])||(r[a]=isNumber(i[s+1])?[]:{}),r=r[a]):r[a]=e}),n},gC=Object.prototype.hasOwnProperty,Gz=function(n,t){if(n===null||!isPlainObject(n))return{};var e={};return each(t,function(r){gC.call(n,r)&&(e[r]=n[r])}),e},Vz=function(n,t){return reduce(n,function(e,r,i){return t.includes(i)||(e[i]=r),e},{})},$c={},Uz=function(n){return n=n||"g",$c[n]?$c[n]+=1:$c[n]=1,n+$c[n]},tu,Yz=cC(function(n,t){t===void 0&&(t={});var e=t.fontSize,r=t.fontFamily,i=t.fontWeight,a=t.fontStyle,s=t.fontVariant;return tu||(tu=document.createElement("canvas").getContext("2d")),tu.font=[a,s,i,e+"px",r].join(" "),tu.measureText(_f(n)?n:"").width},function(n,t){return t===void 0&&(t={}),(0,G.pr)([n],sC(t)).join("")}),Hz=function(n,t,e,r){r===void 0&&(r="...");var i=16,a=measureTextWidth(r,e),s=isString(n)?n:toString(n),o=t,l=[],c,u;if(measureTextWidth(n,e)<=t)return n;for(;c=s.substr(0,i),u=measureTextWidth(c,e),!(u+a>o&&u>o);)if(l.push(c),o-=u,s=s.substr(i),!s)return l.join("");for(;c=s.substr(0,1),u=measureTextWidth(c,e),!(u+a>o);)if(l.push(c),o-=u,s=s.substr(1),!s)return l.join("");return""+l.join("")+r},Xz=function(){function n(){this.map={}}return n.prototype.has=function(t){return this.map[t]!==void 0},n.prototype.get=function(t,e){var r=this.map[t];return r===void 0?e:r},n.prototype.set=function(t,e){this.map[t]=e},n.prototype.clear=function(){this.map={}},n.prototype.delete=function(t){delete this.map[t]},n.prototype.size=function(){return Object.keys(this.map).length},n}(),Kz=null,pC=function(t,e,r){for(var i=1/0,a,s=0;s<e.length;s++){var o=e[s].id;!r[o]&&t[o]<=i&&(i=t[o],a=e[s])}return a},mC=function(t,e,r,i){var a=t.nodes,s=a===void 0?[]:a,o=t.edges,l=o===void 0?[]:o,c=[],u={},h={},d={};s.forEach(function(E,O){var P=E.id;c.push(P),h[P]=1/0,P===e&&(h[P]=0)});for(var f=s.length,v=function(O){var P=pC(h,s,u),L=P.id;if(u[L]=!0,h[L]===1/0)return"continue";var F=[];r?F=IO(L,l):F=qc(L,l),F.forEach(function(I){var V=I.target,Y=I.source,J=V===L?Y:V,$=i&&I[i]?I[i]:1;h[J]>h[P.id]+$?(h[J]=h[P.id]+$,d[J]=[P.id]):h[J]===h[P.id]+$&&d[J].push(P.id)})},g=0;g<f;g++)v(g);d[e]=[e];var p={};for(var y in h)h[y]!==1/0&&Qm(e,y,d,p);var b={};for(var y in p)b[y]=p[y][0];return{length:h,path:b,allPath:p}},eu=mC;function Qm(n,t,e,r){if(n===t)return[n];if(r[t])return r[t];for(var i=[],a=0,s=e[t];a<s.length;a++){var o=s[a],l=Qm(n,o,e,r);if(!l)return;for(var c=0,u=l;c<u.length;c++){var h=u[c];Lf(h)?i.push((0,G.ev)((0,G.ev)([],h,!0),[t],!1)):i.push([h,t])}}return r[t]=i,r[t]}var Ff=function(t,e,r,i,a){var s=eu(t,e,i,a),o=s.length,l=s.path,c=s.allPath;return{length:o[r],path:l[r],allPath:c[r]}},yC=function(t,e,r,i){var a;if(e===r)return[[e]];var s=t.edges,o=s===void 0?[]:s,l=[e],c=(a={},a[e]=!0,a),u=[],h=[],d=i?xi(e,o,"target"):xi(e,o);for(u.push(d);l.length>0&&u.length>0;){var f=u[u.length-1];if(f.length){var v=f.shift();v&&(l.push(v),c[v]=!0,d=i?xi(v,o,"target"):xi(v,o),u.push(d.filter(function(y){return!c[y]})))}else{var g=l.pop();c[g]=!1,u.pop();continue}if(l[l.length-1]===r){var p=l.map(function(b){return b});h.push(p);var g=l.pop();c[g]=!1,u.pop()}}return h},bC=function(t,e){for(var r=Qc(t,e),i=[],a=r.length,s=0;s<a;s+=1){i[s]=[];for(var o=0;o<a;o+=1)s===o?i[s][o]=0:r[s][o]===0||!r[s][o]?i[s][o]=1/0:i[s][o]=r[s][o]}for(var l=0;l<a;l+=1)for(var s=0;s<a;s+=1)for(var o=0;o<a;o+=1)i[s][o]>i[s][l]+i[l][o]&&(i[s][o]=i[s][l]+i[l][o]);return i},zf=bC,xC=function(t,e,r,i){e===void 0&&(e=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e3);var a=t.nodes,s=a===void 0?[]:a,o=t.edges,l=o===void 0?[]:o,c={},u={};s.forEach(function(O,P){var L=Im();O.clusterId=L,c[L]={id:L,nodes:[O]},u[O.id]={node:O,idx:P}});var h=Qc(t,e),d=[],f={};h.forEach(function(O,P){var L=0,F=s[P].id;f[F]={},O.forEach(function(I,V){if(I){L+=I;var Y=s[V].id;f[F][Y]=I}}),d.push(L)});for(var v=0,g=function(){var P=!1;if(s.forEach(function(L){var F={};Object.keys(f[L.id]).forEach(function(ft){var Nt=f[L.id][ft],Ot=u[ft].node,mt=Ot.clusterId;F[mt]||(F[mt]=0),F[mt]+=Nt});var I=-1/0,V=[];if(Object.keys(F).forEach(function(ft){I<F[ft]?(I=F[ft],V=[ft]):I===F[ft]&&V.push(ft)}),!(V.length===1&&V[0]===L.clusterId)){var Y=V.indexOf(L.clusterId);if(Y>=0&&V.splice(Y,1),V&&V.length){P=!0;var J=c[L.clusterId],$=J.nodes.indexOf(L);J.nodes.splice($,1);var ot=Math.floor(Math.random()*V.length),ct=c[V[ot]];ct.nodes.push(L),L.clusterId=ct.id}}}),!P)return"break";v++};v<i;){var p=g();if(p==="break")break}Object.keys(c).forEach(function(O){var P=c[O];(!P.nodes||!P.nodes.length)&&delete c[O]});var y=[],b={};l.forEach(function(O){var P=O.source,L=O.target,F=O[r]||1,I=u[P].node.clusterId,V=u[L].node.clusterId,Y="".concat(I,"---").concat(V);if(b[Y])b[Y].weight+=F,b[Y].count++;else{var J={source:I,target:V,weight:F,count:1};b[Y]=J,y.push(J)}});var E=[];return Object.keys(c).forEach(function(O){E.push(c[O])}),{clusters:E,clusterEdges:y}},EC=xC,wC=function(){function n(t){this.arr=t}return n.prototype.getArr=function(){return this.arr||[]},n.prototype.add=function(t){var e,r=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new n(r);if(!(r!=null&&r.length))return new n(this.arr);if(this.arr.length===r.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+r[a];return new n(i)}},n.prototype.subtract=function(t){var e,r=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new n(r);if(!(r!=null&&r.length))return new n(this.arr);if(this.arr.length===r.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-r[a];return new n(i)}},n.prototype.avg=function(t){var e=[];if(t!==0)for(var r in this.arr)e[r]=this.arr[r]/t;return new n(e)},n.prototype.negate=function(){var t=[];for(var e in this.arr)t[e]=-this.arr[e];return new n(t)},n.prototype.squareEuclideanDistance=function(t){var e,r=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return i}},n.prototype.euclideanDistance=function(t){var e,r=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.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.")},n.prototype.normalize=function(){var t=[],e=gl(this.arr);e.sort(function(s,o){return s-o});var r=e[e.length-1],i=e[0];for(var a in this.arr)t[a]=(this.arr[a]-i)/(r-i);return new n(t)},n.prototype.norm2=function(){var t;if(!(!((t=this.arr)===null||t===void 0)&&t.length))return 0;var e=0;for(var r in this.arr)e+=Math.pow(this.arr[r],2);return Math.sqrt(e)},n.prototype.dot=function(t){var e,r=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(r!=null&&r.length))return 0;if(this.arr.length===r.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.")},n.prototype.equal=function(t){var e,r=t.arr;if(((e=this.arr)===null||e===void 0?void 0:e.length)!==(r==null?void 0:r.length))return!1;for(var i in this.arr)if(this.arr[i]!==r[i])return!1;return!0},n}(),Ei=wC,SC=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/,MC=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/,qm=function(t,e){t===void 0&&(t=[]),e===void 0&&(e=100);var r={};t.forEach(function(a){a.properties&&Object.keys(a.properties).forEach(function(s){if(s==="id"||!"".concat(a.properties[s]).match(SC)&&!"".concat(a.properties[s]).match(MC)&&isNaN(Number(a.properties[s]))){r.hasOwnProperty(s)&&delete r[s];return}r.hasOwnProperty(s)?r[s]+=1:r[s]=1})});var i=Object.keys(r).sort(function(a,s){return r[s]-r[a]});return i.length<e?i:i.slice(0,e)},AC=function(t,e){return e.map(function(r){return t.hasOwnProperty(r)?t[r]:0})},TC=function(t){for(var e=qm(t),r=[],i=0;i<t.length;i++)r[i]=AC(t[i].properties,e);return r},nu=function(t,e){e===void 0&&(e=void 0);var r=[];return t.forEach(function(i){e===void 0&&r.push(i),i[e]!==void 0&&r.push(i[e])}),r},Qz={getAllSortProperties:qm,getPropertyWeight:TC,getAllProperties:nu},_i;(function(n){n.EuclideanDistance="euclideanDistance"})(_i||(_i={}));var Jm=function(t,e,r){var i=[];e!=null&&e.length?i=e:(t.forEach(function(s){i=i.concat(Object.keys(s))}),i=Df(i));var a={};return i.forEach(function(s){var o=[];t.forEach(function(l){l[s]!==void 0&&l[s]!==""&&o.push(l[s])}),o.length&&!(r!=null&&r.includes(s))&&(a[s]=Df(o))}),a},ru=function(t,e,r){var i=Jm(t,e,r),a=[];if(!Object.keys(i).length)return a;var s=Object.values(i),o=s.every(function(l){return l.every(function(c){return typeof c=="number"})});return t.forEach(function(l,c){var u=[];Object.keys(i).forEach(function(h){var d=l[h],f=i[h],v=f.findIndex(function(y){return d===y}),g=[];if(o)g.push(d);else for(var p=0;p<f.length;p++)p===v?g.push(1):g.push(0);u=u.concat(g)}),a[c]=u}),a},jf=function(t,e,r,i){r===void 0&&(r=_i.EuclideanDistance);var a=0;switch(r){case _i.EuclideanDistance:a=new Ei(t).euclideanDistance(new Ei(e));break;default:break}return a},qz={getAllKeyValueMap:Jm,oneHot:ru,getDistance:jf},$m=function(t,e,r,i){for(var a=e.length,s=2*i,o=0,l=0;l<a;l++)for(var c=t[l].clusterId,u=0;u<a;u++){var h=t[u].clusterId;if(c===h){var d=e[l][u]||0,f=r[l]||0,v=r[u]||0;o+=d-f*v/s}}return o*=1/s,o},Zf=function(t,e){t===void 0&&(t=[]);for(var r=t.length,i=new Ei([]),a=0;a<r;a++)i=i.add(new Ei(e[a]));var s=i.avg(r);s.normalize();for(var o=0,a=0;a<r;a++){var l=new Ei(e[a]),c=l.squareEuclideanDistance(s);o+=c}var u=[];t.forEach(function(){u.push([])});for(var a=0;a<r;a++){var l=new Ei(e[a]);t[a].clusterInertial=0;for(var h=0;h<r;h++){if(a===h){u[a][h]=0;continue}var d=new Ei(e[h]);u[a][h]=l.squareEuclideanDistance(d),t[a].clusterInertial+=u[a][h]}}for(var f=0,v=2*r*o,a=0;a<r;a++)for(var g=t[a].clusterId,h=0;h<r;h++){var p=t[h].clusterId;if(!(a===h||g!==p)){var y=t[a].clusterInertial*t[h].clusterInertial/Math.pow(v,2)-u[a][h]/v;f+=y}}return Number(f.toFixed(4))},OC=function(t,e,r,i,a,s,o,l,c){e===void 0&&(e=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),s===void 0&&(s=void 0),o===void 0&&(o=[]),l===void 0&&(l=["id"]),c===void 0&&(c=1);var u=t.nodes,h=u===void 0?[]:u,d=t.edges,f=d===void 0?[]:d,v=[];if(a){h.forEach(function(yt,Rt){yt.properties=yt.properties||{},yt.originIndex=Rt});var g=[];h.every(function(yt){return yt.hasOwnProperty("nodeType")})&&(g=Array.from(new Set(h.map(function(yt){return yt.nodeType}))),h.forEach(function(yt){yt.properties.nodeType=g.findIndex(function(Rt){return Rt===yt.nodeType})}));var p=nu(h,s);v=ru(p,o,l)}var y=1,b={},E={};h.forEach(function(yt,Rt){var jt=String(y++);yt.clusterId=jt,b[jt]={id:jt,nodes:[yt]},E[yt.id]={node:yt,idx:Rt}});var O=Qc(t,e),P=[],L={},F=0;O.forEach(function(yt,Rt){var jt=0,Xt=h[Rt].id;L[Xt]={},yt.forEach(function(ee,ae){if(ee){jt+=ee;var he=h[ae].id;L[Xt][he]=ee,F+=ee}}),P.push(jt)}),F/=2;for(var I=1/0,V=1/0,Y=0,J=[],$={};;){a&&h.every(function(yt){return yt.hasOwnProperty("properties")})?I=$m(h,O,P,F)+Zf(h,v)*c:I=$m(h,O,P,F),Y===0&&(V=I,J=h,$=b);var ot=I>0&&I>V&&I-V<i;if(I>V&&(J=h.map(function(yt){return{node:yt,clusterId:yt.clusterId}}),$=gl(b),V=I),ot||Y>100)break;Y++,Object.keys(b).forEach(function(yt){var Rt=0;f.forEach(function(jt){var Xt=jt.source,ee=jt.target,ae=E[Xt].node.clusterId,he=E[ee].node.clusterId;(ae===yt&&he!==yt||he===yt&&ae!==yt)&&(Rt=Rt+(jt[r]||1))}),b[yt].sumTot=Rt}),h.forEach(function(yt,Rt){var jt=b[yt.clusterId],Xt=0,ee,ae=P[Rt]/(2*F),he=0,ce=jt.nodes;ce.forEach(function(wr){var fr=E[wr.id].idx;he+=O[Rt][fr]||0});var xe=he-jt.sumTot*ae,Ce=ce.filter(function(wr){return wr.id!==yt.id}),je=[];Ce.forEach(function(wr,fr){je[fr]=v[wr.originIndex]});var Ue=Zf(Ce,v)*c,or=L[yt.id];if(Object.keys(or).forEach(function(wr){var fr=E[wr].node,Ma=fr.clusterId;if(Ma!==yt.clusterId){var Sr=b[Ma],Jr=Sr.nodes;if(!(!Jr||!Jr.length)){var Be=0;Jr.forEach(function(He){var qe=E[He.id].idx;Be+=O[Rt][qe]||0});var Qe=Be-Sr.sumTot*ae,Fe=Jr.concat([yt]),Ye=[];Fe.forEach(function(He,qe){Ye[qe]=v[He.originIndex]});var nn=Zf(Fe,v)*c,pe=Qe-xe;a&&(pe=Qe+nn-(xe+Ue)),pe>Xt&&(Xt=pe,ee=Sr)}}}),Xt>0){ee.nodes.push(yt);var Ke=yt.clusterId;yt.clusterId=ee.id;var ui=jt.nodes.indexOf(yt);jt.nodes.splice(ui,1);var Pr=0,ns=0;f.forEach(function(wr){var fr=wr.source,Ma=wr.target,Sr=E[fr].node.clusterId,Jr=E[Ma].node.clusterId;(Sr===ee.id&&Jr!==ee.id||Jr===ee.id&&Sr!==ee.id)&&(Pr=Pr+(wr[r]||1)),(Sr===Ke&&Jr!==Ke||Jr===Ke&&Sr!==Ke)&&(ns=ns+(wr[r]||1))}),ee.sumTot=Pr,jt.sumTot=ns}})}var ct={},ft=0;Object.keys($).forEach(function(yt){var Rt=$[yt];if(!Rt.nodes||!Rt.nodes.length){delete $[yt];return}var jt=String(ft+1);jt!==yt&&(Rt.id=jt,Rt.nodes=Rt.nodes.map(function(Xt){return{id:Xt.id,clusterId:jt}}),$[jt]=Rt,ct[yt]=jt,delete $[yt],ft++)}),J.forEach(function(yt){var Rt=yt.node,jt=yt.clusterId;Rt&&(Rt.clusterId=jt,Rt.clusterId&&ct[Rt.clusterId]&&(Rt.clusterId=ct[Rt.clusterId]))});var Nt=[],Ot={};f.forEach(function(yt){var Rt=yt.source,jt=yt.target,Xt=yt[r]||1,ee=E[Rt].node.clusterId,ae=E[jt].node.clusterId;if(!(!ee||!ae)){var he="".concat(ee,"---").concat(ae);if(Ot[he])Ot[he].weight+=Xt,Ot[he].count++;else{var ce={source:ee,target:ae,weight:Xt,count:1};Ot[he]=ce,Nt.push(ce)}}});var mt=[];return Object.keys($).forEach(function(yt){mt.push($[yt])}),{clusters:mt,clusterEdges:Nt}},ty=OC,CC=function(t,e,r,i,a,s,o,l){return e===void 0&&(e=!1),r===void 0&&(r="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),s===void 0&&(s=[]),o===void 0&&(o=["id"]),l===void 0&&(l=1),ty(t,e,r,i,!0,a,s,o,l)},NC=CC,kC=function(t,e){var r;e===void 0&&(e=1);for(var i=gl(t),a=i.nodes,s=a===void 0?[]:a,o=i.edges,l=o===void 0?[]:o,c=function(){var d=Pf({nodes:s,edges:l}),f=Object.keys(d);f.sort(function(p,y){var b,E;return((b=d[p])===null||b===void 0?void 0:b.degree)-((E=d[y])===null||E===void 0?void 0:E.degree)});var v=f[0];if(!s.length||((r=d[v])===null||r===void 0?void 0:r.degree)>=e)return"break";var g=s.findIndex(function(p){return p.id===v});s.splice(g,1),l=l.filter(function(p){return!(p.source===v||p.target===v)})};;){var u=c();if(u==="break")break}return{nodes:s,edges:l}},PC=kC,ey=function(t,e,r){var i=[];switch(t){case _i.EuclideanDistance:i=e[r];break;default:i=[];break}return i},RC=function(t,e,r,i,a,s){e===void 0&&(e=3),r===void 0&&(r=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),s===void 0&&(s=_i.EuclideanDistance);var o=t.nodes,l=o===void 0?[]:o,c=t.edges,u=c===void 0?[]:c,h={clusters:[{id:"0",nodes:l}],clusterEdges:[]};if(s===_i.EuclideanDistance&&!l.every(function(jt){return jt.hasOwnProperty(r)}))return h;var d=[],f=[];if(s===_i.EuclideanDistance&&(d=nu(l,r),f=ru(d,i,a)),!f.length)return h;for(var v=Df(f.map(function(jt){return jt.join("")})),g=Math.min(e,l.length,v.length),p=0;p<l.length;p++)l[p].originIndex=p;for(var y=[],b=[],E=[],p=0;p<g;p++)if(p===0){var O=Math.floor(Math.random()*l.length);switch(s){case _i.EuclideanDistance:y[p]=f[O];break;default:y[p]=[];break}b.push(O),E[p]=[l[O]],l[O].clusterId=String(p)}else{for(var P=-1/0,L=0,F=function(ee){if(!b.includes(ee)){for(var ae=0,he=0;he<y.length;he++){var ce=0;switch(s){case _i.EuclideanDistance:ce=jf(f[l[ee].originIndex],y[he],s);break;default:break}ae+=ce}var xe=ae/y.length;xe>P&&!y.find(function(Ce){return vC(Ce,ey(s,f,l[ee].originIndex))})&&(P=xe,L=ee)}},I=0;I<l.length;I++)F(I);y[p]=ey(s,f,L),b.push(L),E[p]=[l[L]],l[L].clusterId=String(p)}for(var V=0;;){for(var p=0;p<l.length;p++){var Y=0,J=1/0;if(!(V===0&&b.includes(p))){for(var $=0;$<y.length;$++){var ot=0;switch(s){case _i.EuclideanDistance:ot=jf(f[p],y[$],s);break;default:break}ot<J&&(J=ot,Y=$)}if(l[p].clusterId!==void 0)for(var ct=E[Number(l[p].clusterId)].length-1;ct>=0;ct--)E[Number(l[p].clusterId)][ct].id===l[p].id&&E[Number(l[p].clusterId)].splice(ct,1);l[p].clusterId=String(Y),E[Y].push(l[p])}}for(var ft=!1,p=0;p<E.length;p++){for(var Nt=E[p],Ot=new Ei([]),$=0;$<Nt.length;$++)Ot=Ot.add(new Ei(f[Nt[$].originIndex]));var mt=Ot.avg(Nt.length);mt.equal(new Ei(y[p]))||(ft=!0,y[p]=mt.getArr())}if(V++,l.every(function(jt){return jt.clusterId!==void 0})&&ft||V>=1e3)break}var yt=[],Rt={};return u.forEach(function(jt){var Xt,ee,ae=jt.source,he=jt.target,ce=(Xt=l.find(function(Ue){return Ue.id===ae}))===null||Xt===void 0?void 0:Xt.clusterId,xe=(ee=l.find(function(Ue){return Ue.id===he}))===null||ee===void 0?void 0:ee.clusterId,Ce="".concat(ce,"---").concat(xe);if(Rt[Ce])Rt[Ce].count++;else{var je={source:ce,target:xe,count:1};Rt[Ce]=je,yt.push(je)}}),{clusters:E,clusterEdges:yt}},LC=RC,_C=function(t,e){var r=new Ei(e),i=r.norm2(),a=new Ei(t),s=a.norm2(),o=r.dot(a),l=i*s,c=l?o/l:0;return c},ny=_C,DC=function(t,e,r,i,a){t===void 0&&(t=[]),r===void 0&&(r=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var s=gl(t.filter(function(d){return d.id!==e.id})),o=t.findIndex(function(d){return d.id===e.id}),l=nu(t,r),c=ru(l,i,a),u=c[o],h=[];return s.forEach(function(d,f){if(d.id!==e.id){var v=c[f],g=ny(v,u);h.push(g),d.cosineSimilarity=g}}),s.sort(function(d,f){return f.cosineSimilarity-d.cosineSimilarity}),{allCosineSimilarity:h,similarNodes:s}},IC=DC,BC=function(){function n(t){this.count=t.length,this.parent={};for(var e=0,r=t;e<r.length;e++){var i=r[e];this.parent[i]=i}}return n.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},n.prototype.union=function(t,e){var r=this.find(t),i=this.find(e);r!==i&&(r<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]))},n.prototype.connected=function(t,e){return this.find(t)===this.find(e)},n}(),FC=BC,zC=function(t,e){return t-e},jC=function(){function n(t){t===void 0&&(t=zC),this.compareFn=t,this.list=[]}return n.prototype.getLeft=function(t){return 2*t+1},n.prototype.getRight=function(t){return 2*t+2},n.prototype.getParent=function(t){return t===0?null:Math.floor((t-1)/2)},n.prototype.isEmpty=function(){return this.list.length<=0},n.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},n.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},n.prototype.insert=function(t){if(t!==null){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},n.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var r=this.list[e];this.list[e]=this.list[t],this.list[t]=r,t=e,e=this.getParent(t)}},n.prototype.moveDown=function(t){var e,r=t,i=this.getLeft(t),a=this.getRight(t),s=this.list.length;i!==null&&i<s&&this.compareFn(this.list[r],this.list[i])>0?r=i:a!==null&&a<s&&this.compareFn(this.list[r],this.list[a])>0&&(r=a),t!==r&&(e=[this.list[r],this.list[t]],this.list[t]=e[0],this.list[r]=e[1],this.moveDown(r))},n}(),ZC=jC,WC=function(t,e){var r=[],i=t.nodes,a=i===void 0?[]:i,s=t.edges,o=s===void 0?[]:s;if(a.length===0)return r;var l=a[0],c=new Set;c.add(l);var u=function(p,y){return e?p.weight-y.weight:0},h=new ZC(u);for(qc(l.id,o).forEach(function(g){h.insert(g)});!h.isEmpty();){var d=h.delMin(),f=d.source,v=d.target;c.has(f)&&c.has(v)||(r.push(d),c.has(f)||(c.add(f),qc(f,o).forEach(function(g){h.insert(g)})),c.has(v)||(c.add(v),qc(v,o).forEach(function(g){h.insert(g)})))}return r},ry=function(t,e){var r=[],i=t.nodes,a=i===void 0?[]:i,s=t.edges,o=s===void 0?[]:s;if(a.length===0)return r;var l=o.map(function(f){return f});e&&l.sort(function(f,v){return f.weight-v.weight});for(var c=new FC(a.map(function(f){return f.id}));l.length>0;){var u=l.shift(),h=u.source,d=u.target;c.connected(h,d)||(r.push(u),c.union(h,d))}return r},GC=function(t,e,r){var i={prim:WC,kruskal:ry};return r?i[r](t,e):ry(t,e)},VC=GC,UC=function(t,e,r){typeof e!="number"&&(e=1e-6),typeof r!="number"&&(r=.85);for(var i=1,a=0,s=1e3,o=t.nodes,l=o===void 0?[]:o,c=t.edges,u=c===void 0?[]:c,h=l.length,d,f={},v={},g=0;g<h;++g){var p=l[g],y=p.id;f[y]=1/h,v[y]=1/h}for(var b=Pf(t);s>0&&i>e;){a=0;for(var g=0;g<h;++g){var p=l[g],y=p.id;if(d=0,b[p.id].inDegree===0)f[y]=0;else{for(var E=xi(y,u,"source"),O=0;O<E.length;++O){var P=E[O],L=b[P].outDegree;L>0&&(d+=v[P]/L)}f[y]=r*d,a+=f[y]}}a=(1-a)/h,i=0;for(var g=0;g<h;++g){var p=l[g],y=p.id;d=f[y]+a,i+=Math.abs(d-v[y]),v[y]=d}s-=1}return v},iy=UC,YC=-1,iu=-1,ay="-1",na="-1",sy=-1,Jz="-1",oy=function(){function n(t,e,r,i){t===void 0&&(t=YC),e===void 0&&(e=iu),r===void 0&&(r=iu),i===void 0&&(i=ay),this.id=t,this.from=e,this.to=r,this.label=i}return n}(),HC=function(){function n(t,e){t===void 0&&(t=iu),e===void 0&&(e=na),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return n.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},n}(),ly=function(){function n(t,e,r){t===void 0&&(t=iu),e===void 0&&(e=!0),r===void 0&&(r=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=r}return n.prototype.getNodeNum=function(){return this.nodes.length},n.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var r=new HC(t,e);this.nodes.push(r),this.nodeMap[t]=r,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},n.prototype.addEdge=function(t,e,r,i){if((this.edgeIdAutoIncrease||t===void 0)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[r]&&this.nodeMap[r].edgeMap[t])){var a=new oy(t,e,r,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 s=new oy(t,r,e,i);this.nodeMap[r].addEdge(s),this.edgeLabelMap[i].push(s)}}},n}(),ks=function(){function n(t,e,r,i,a){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:r||na,edgeLabel:i||ay,nodeLabel2:a||na}}return n.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},n.prototype.notEqualTo=function(t){return!this.equalTo(t)},n}(),cy=function(){function n(){this.rmpath=[],this.dfsEdgeList=[]}return n.prototype.equalTo=function(t){var e=this.dfsEdgeList.length,r=t.length;if(e!==r)return!1;for(var i=0;i<e;i++)if(this.dfsEdgeList[i]!==t[i])return!1;return!0},n.prototype.notEqualTo=function(t){return!this.equalTo(t)},n.prototype.pushBack=function(t,e,r,i,a){return this.dfsEdgeList.push(new ks(t,e,r,i,a)),this.dfsEdgeList},n.prototype.toGraph=function(t,e){t===void 0&&(t=sy),e===void 0&&(e=!1);var r=new ly(t,!0,e);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,s=i.toNode,o=i.nodeEdgeNodeLabel,l=o.nodeLabel1,c=o.edgeLabel,u=o.nodeLabel2;l!==na&&r.addNode(a,l),u!==na&&r.addNode(s,u),l!==na&&u!==l&&r.addEdge(void 0,a,s,c)}),r},n.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length,r=e-1;r>=0;r--){var i=this.dfsEdgeList[r],a=i.fromNode,s=i.toNode;a<s&&(t===void 0||s===t)&&(this.rmpath.push(r),t=a)}return this.rmpath},n.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},n}(),au=function(){function n(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 n.prototype.hasNode=function(t){return this.nodesUsed[t.id]===1},n.prototype.hasEdge=function(t){return this.edgesUsed[t.id]===1},n}(),XC=function(){function n(t){var e=t.graphs,r=t.minSupport,i=r===void 0?2:r,a=t.minNodeNum,s=a===void 0?1:a,o=t.maxNodeNum,l=o===void 0?4:o,c=t.top,u=c===void 0?10:c,h=t.directed,d=h===void 0?!1:h,f=t.verbose,v=f===void 0?!1:f;this.graphs=e,this.dfsCode=new cy,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=u,this.directed=d,this.counter=0,this.maxNodeNum=l,this.minNodeNum=s,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return n.prototype.findForwardRootEdges=function(t,e){var r=this,i=[],a=t.nodeMap;return e.edges.forEach(function(s){(r.directed||e.label<=a[s.to].label)&&i.push(s)}),i},n.prototype.findBackwardEdge=function(t,e,r,i){if(!this.directed&&e===r)return null;for(var a=t.nodeMap,s=a[r.to],o=s.edges,l=o.length,c=0;c<l;c++){var u=o[c];if(!(i.hasEdge(u)||u.to!==e.from)){if(this.directed){if(a[e.from].label<a[r.to].label||a[e.from].label===a[r.to].label&&e.label<=u.label)return u}else if(e.label<u.label||e.label===u.label&&a[e.to].label<=a[r.to].label)return u}}return null},n.prototype.findForwardPureEdges=function(t,e,r,i){for(var a=[],s=e.to,o=t.nodeMap[s].edges,l=o.length,c=0;c<l;c++){var u=o[c],h=t.nodeMap[u.to];r<=h.label&&!i.hasNode(h)&&a.push(u)}return a},n.prototype.findForwardRmpathEdges=function(t,e,r,i){for(var a=[],s=t.nodeMap,o=s[e.to].label,l=s[e.from],c=l.edges,u=c.length,h=0;h<u;h++){var d=c[h],f=s[d.to].label;e.to===d.to||r>f||i.hasNode(s[d.to])||(e.label<d.label||e.label===d.label&&o<=f)&&a.push(d)}return a},n.prototype.getSupport=function(t){var e={};return t.forEach(function(r){e[r.graphId]||(e[r.graphId]=!0)}),Object.keys(e).length},n.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach(function(r){var i=t[r],a=i.nodeLabel1,s=i.edgeLabel,o=i.nodeLabel2;if(!e){e={nodeLabel1:a,edgeLabel:s,nodeLabel2:o};return}(a<e.nodeLabel1||a===e.nodeLabel1&&s<e.edgeLabel||a===e.nodeLabel1&&s===e.edgeLabel&&o<e.nodeLabel2)&&(e={nodeLabel1:a,edgeLabel:s,nodeLabel2:o})}),e},n.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),e.dfsEdgeList.length===1)return!0;var r=this.directed,i=e.toGraph(sy,r),a=i.nodeMap,s=new cy,o={};i.nodes.forEach(function(h){var d=t.findForwardRootEdges(i,h);d.forEach(function(f){var v=a[f.to],g="".concat(h.label,"-").concat(f.label,"-").concat(v.label);o[g]||(o[g]={projected:[],nodeLabel1:h.label,edgeLabel:f.label,nodeLabel2:v.label});var p={graphId:i.id,edge:f,preNode:null};o[g].projected.push(p)})});var l=this.findMinLabel(o);if(l){s.dfsEdgeList.push(new ks(0,1,l.nodeLabel1,l.edgeLabel,l.nodeLabel2));var c=function h(d){for(var f=s.buildRmpath(),v=s.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,g=s.dfsEdgeList[f[0]].toNode,p={},y=!1,b=0,E=r?-1:0,O=function(Ot){if(y)return"break";d.forEach(function(mt){var yt=new au(mt),Rt=t.findBackwardEdge(i,yt.edges[f[Ot]],yt.edges[f[0]],yt);Rt&&(p[Rt.label]||(p[Rt.label]={projected:[],edgeLabel:Rt.label}),p[Rt.label].projected.push({graphId:i.id,edge:p,preNode:mt}),b=s.dfsEdgeList[f[Ot]].fromNode,y=!0)})},P=f.length-1;P>E;P--){var L=O(P);if(L==="break")break}if(y){var F=t.findMinLabel(p);s.dfsEdgeList.push(new ks(g,b,na,F.edgeLabel,na));var I=s.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[I]!==s.dfsEdgeList[I]?!1:h(p[F.edgeLabel].projected)}var V={};y=!1;var Y=0;d.forEach(function(Nt){var Ot=new au(Nt),mt=t.findForwardPureEdges(i,Ot.edges[f[0]],v,Ot);mt.length>0&&(y=!0,Y=g,mt.forEach(function(yt){var Rt="".concat(yt.label,"-").concat(a[yt.to].label);V[Rt]||(V[Rt]={projected:[],edgeLabel:yt.label,nodeLabel2:a[yt.to].label}),V[Rt].projected.push({graphId:i.id,edge:yt,preNode:Nt})}))});for(var J=f.length,$=function(Ot){if(y)return"break";var mt=f[Ot];d.forEach(function(yt){var Rt=new au(yt),jt=t.findForwardRmpathEdges(i,Rt.edges[mt],v,Rt);jt.length>0&&(y=!0,Y=s.dfsEdgeList[mt].fromNode,jt.forEach(function(Xt){var ee="".concat(Xt.label,"-").concat(a[Xt.to].label);V[ee]||(V[ee]={projected:[],edgeLabel:Xt.label,nodeLabel2:a[Xt.to].label}),V[ee].projected.push({graphId:i.id,edge:Xt,preNode:yt})}))})},P=0;P<J;P++){var ot=$(P);if(ot==="break")break}if(!y)return!0;var ct=t.findMinLabel(V);s.dfsEdgeList.push(new ks(Y,g+1,na,ct.edgeLabel,ct.nodeLabel2));var ft=s.dfsEdgeList.length-1;return e.dfsEdgeList[ft]!==s.dfsEdgeList[ft]?!1:h(V["".concat(ct.edgeLabel,"-").concat(ct.nodeLabel2)].projected)},u="".concat(l.nodeLabel1,"-").concat(l.edgeLabel,"-").concat(l.nodeLabel2);return c(o[u].projected)}},n.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(gl(t))}},n.prototype.subGraphMining=function(t){var e=this,r=this.getSupport(t);if(!(r<this.minSupport)&&this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),s=this.dfsCode.dfsEdgeList[a[0]].toNode,o=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,l={},c={};t.forEach(function(u){for(var h=e.graphs[u.graphId],d=h.nodeMap,f=new au(u),v=a.length-1;v>=0;v--){var g=e.findBackwardEdge(h,f.edges[a[v]],f.edges[a[0]],f);if(g){var p="".concat(e.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(g.label);c[p]||(c[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:g.label}),c[p].projected.push({graphId:u.graphId,edge:g,preNode:u})}}if(!(i>=e.maxNodeNum)){var y=e.findForwardPureEdges(h,f.edges[a[0]],o,f);y.forEach(function(E){var O="".concat(s,"-").concat(E.label,"-").concat(d[E.to].label);l[O]||(l[O]={projected:[],fromNodeId:s,edgeLabel:E.label,nodeLabel2:d[E.to].label}),l[O].projected.push({graphId:u.graphId,edge:E,preNode:u})});for(var b=function(O){var P=e.findForwardRmpathEdges(h,f.edges[a[O]],o,f);P.forEach(function(L){var F="".concat(e.dfsCode.dfsEdgeList[a[O]].fromNode,"-").concat(L.label,"-").concat(d[L.to].label);l[F]||(l[F]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[O]].fromNode,edgeLabel:L.label,nodeLabel2:d[L.to].label}),l[F].projected.push({graphId:u.graphId,edge:L,preNode:u})})},v=0;v<a.length;v++)b(v)}}),Object.keys(c).forEach(function(u){var h=c[u],d=h.toNodeId,f=h.edgeLabel;e.dfsCode.dfsEdgeList.push(new ks(s,d,"-1",f,"-1")),e.subGraphMining(c[u].projected),e.dfsCode.dfsEdgeList.pop()}),Object.keys(l).forEach(function(u){var h=l[u],d=h.fromNodeId,f=h.edgeLabel,v=h.nodeLabel2;e.dfsCode.dfsEdgeList.push(new ks(d,s+1,na,f,v)),e.subGraphMining(l[u].projected),e.dfsCode.dfsEdgeList.pop()})}},n.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,r=this.minSupport,i=this.frequentSize1Subgraphs,a={},s={},o={},l={};return Object.keys(t).forEach(function(c){var u=t[c],h=u.nodeMap;u.nodes.forEach(function(d,f){var v=d.label,g="".concat(c,"-").concat(v);if(!o[g]){var p=a[v]||0;p++,a[v]=p}o[g]={graphKey:c,label:v},d.edges.forEach(function(y){var b=v,E=h[y.to].label;if(!e&&b>E){var O=E;E=b,b=O}var P=y.label,L="".concat(c,"-").concat(b,"-").concat(P,"-").concat(E),F="".concat(b,"-").concat(P,"-").concat(E);if(!s[F]){var I=s[F]||0;I++,s[F]=I}l[L]={graphId:c,nodeLabel1:b,edgeLabel:P,nodeLabel2:E}})})}),Object.keys(a).forEach(function(c){var u=a[c];if(!(u<r)){var h={nodes:[],edges:[]};h.nodes.push({id:"0",label:c}),i.push(h)}}),i},n.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,r=this.directed,i={};Object.keys(e).forEach(function(a){var s=e[a],o=s.nodeMap;s.nodes.forEach(function(l){var c=t.findForwardRootEdges(s,l);c.forEach(function(u){var h=o[u.to],d="".concat(l.label,"-").concat(u.label,"-").concat(h.label);i[d]||(i[d]={projected:[],nodeLabel1:l.label,edgeLabel:u.label,nodeLabel2:h.label});var f={graphId:a,edge:u,preNode:null};i[d].projected.push(f)})})}),Object.keys(i).forEach(function(a){var s=i[a],o=s.projected,l=s.nodeLabel1,c=s.edgeLabel,u=s.nodeLabel2;t.dfsCode.dfsEdgeList.push(new ks(0,1,l,c,u)),t.subGraphMining(o),t.dfsCode.dfsEdgeList.pop()})}},n}(),KC=function(t,e,r,i){var a={};return Object.keys(t).forEach(function(s,o){var l=t[s],c=new ly(o,!0,e),u={};l.nodes.forEach(function(h,d){c.addNode(d,h[r]),u[h.id]=d}),l.edges.forEach(function(h,d){var f=u[h.source],v=u[h.target];c.addEdge(-1,f,v,h[i])}),c&&c.getNodeNum()&&(a[c.id]=c)}),a},QC=function(t,e,r){var i=[];return t.forEach(function(a){var s={nodes:[],edges:[]};a.nodes.forEach(function(o){var l;s.nodes.push((l={id:"".concat(o.id)},l[e]=o.label,l))}),a.edges.forEach(function(o){var l;s.edges.push((l={source:"".concat(o.from),target:"".concat(o.to)},l[r]=o.label,l))}),i.push(s)}),i},uy="cluster",qC=function(t){var e=t.graphs,r=t.directed,i=r===void 0?!1:r,a=t.nodeLabelProp,s=a===void 0?uy:a,o=t.edgeLabelProp,l=o===void 0?uy:o,c=KC(e,i,s,l),u=t.minSupport,h=t.maxNodeNum,d=t.minNodeNum,f=t.verbose,v=t.top,g={graphs:c,minSupport:u,maxNodeNum:h,minNodeNum:d,top:v,verbose:f,directed:i},p=new XC(g);p.run();var y=QC(p.frequentSubgraphs,s,l);return y},JC=qC,hy=function(t,e,r,i){r===void 0&&(r="cluster"),i===void 0&&(i=2);var a=[],s=t.nodes;return e.forEach(function(o,l){a.push(dy(s,o,l,r,i))}),a},dy=function(t,e,r,i,a){var s=[r],o=[],l={};return e.forEach(function(c,u){if(c<=a&&r!==u){s.push(u),o.push(t[u]);var h=t[u][i];l[h]?(l[h].count++,l[h].dists.push(c)):l[h]={count:1,dists:[c]}}}),Object.keys(l).forEach(function(c){l[c].dists=l[c].dists.sort(function(u,h){return u-h})}),{nodeIdx:r,nodeId:t[r].id,nodeIdxs:s,neighbors:o,neighborNum:s.length-1,nodeLabelCountMap:l}},$C=function(t,e,r,i,a){var s=Math.ceil(r/e),o={},l=0;return i.forEach(function(c,u){for(var h=0,d=0,f=c.nodeIdxs,v=c.neighborNum-1;h<s;){for(var g=f[1+Math.floor(Math.random()*v)],p=0;(o["".concat(u,"-").concat(g)]||o["".concat(g,"-").concat(u)])&&(g=Math.floor(Math.random()*e),p++,!(p>2*e)););if(p<2*e&&(o["".concat(u,"-").concat(g)]={start:u,end:g,distance:a[u][g]},h++,l++,l>=r))return o;if(d++,d>2*e)break}if(h<s){var y=s-h;s=(s+y)/(e-u-1)}}),o},su=function(t,e,r,i){var a=r.nodes;return i||(i={}),Object.keys(t).forEach(function(s){var o,l;if(!(i&&i[s])){i[s]={nodes:[],edges:[]};var c=t[s],u=(o=e[c.start])===null||o===void 0?void 0:o.nodeIdxs,h=(l=e[c.end])===null||l===void 0?void 0:l.nodeIdxs;if(!(!u||!h)){var d=new Set(h),f=u.filter(function(b){return d.has(b)});if(!(!f||!f.length)){for(var v={},g=f.length,p=0;p<g;p++){var y=a[f[p]];i[s].nodes.push(y),v[y.id]=!0}r.edges.forEach(function(b){v[b.source]&&v[b.target]&&i[s].edges.push(b)})}}}}),i},ou=function(t,e,r,i){var a,s,o={};t.nodes.forEach(function(c){o[c.id]=c});var l=0;return!(!((a=e==null?void 0:e.edges)===null||a===void 0)&&a.length)||((s=e==null?void 0:e.nodes)===null||s===void 0?void 0:s.length)<2?0:(t.edges.forEach(function(c){var u=o[c.source][r],h=o[c.target][r],d=e==null?void 0:e.nodes[0][r],f=e==null?void 0:e.nodes[1][r],v=e==null?void 0:e.edges[0][i];c[i]===v&&(u===d&&h===f||u===f&&h===d)&&l++}),l)},tN=function(t,e,r){for(var i=1/0,a=0,s=function(c){var u=t[c],h=Object.keys(u).sort(function(b,E){return u[b]-u[E]}),d=10,f=[];h.forEach(function(b,E){f[E%d]||(f[E%d]={graphs:[],totalCount:0,aveCount:0}),f[E%d].graphs.push(b),f[E%d].totalCount+=u[b]});var v=0,g=[];f.forEach(function(b){var E=b.totalCount/b.graphs.length;b.aveCount=E,g.push(E);var O=0,P=b.length;b.graphs.forEach(function(L,F){var I=u[L];b.graphs.forEach(function(V,Y){F!==Y&&(O+=Math.abs(I-u[V]))})}),O/=P*(P-1)/2,v+=O}),v/=f.length;var p=0;g.forEach(function(b,E){g.forEach(function(O,P){E!==P&&(p+=Math.abs(b-O))}),p/=g.length*(g.length-1)/2});var y=p-v;i<y&&(i=y,a=c)},o=0;o<e;o++)s(o);return{structure:r[a],structureCountMap:t[a]}},fy=function(t,e){var r={},i={};return t.forEach(function(a,s){r[a.id]={idx:s,node:a,degree:0,inDegree:0,outDegree:0};var o=a[e];i[o]||(i[o]=[]),i[o].push(a)}),{nodeMap:r,nodeLabelMap:i}},vy=function(t,e,r){var i={},a={};return t.forEach(function(s,o){i["".concat(Im)]={idx:o,edge:s};var l=s[e];a[l]||(a[l]=[]),a[l].push(s);var c=r[s.source];c&&(c.degree++,c.outDegree++);var u=r[s.target];u&&(u.degree++,u.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},gy=function(t,e,r){var i=e.length,a={};return e.forEach(function(s,o){for(var l=r?0:o+1,c=t[o].id,u=l;u<i;u++)if(o!==u){var h=t[u].id,d=s[u];a["".concat(c,"-").concat(h)]=d,r||(a["".concat(h,"-").concat(c)]=d)}}),a},eN=function(t,e,r,i,a,s,o,l,c,u,h){var d,f="".concat(e.id,"-").concat(r.id);if(u&&u[f])return u[f];var v=h?h[f]:void 0;if(!v){var g=(d={},d[f]={start:i[e.id].idx,end:i[r.id].idx,distance:a},d);h=su(g,s,t,h),v=h[f]}return ou(v,o,l,c)},py=function(t,e,r,i){var a,s,o,l=(a=t[e])===null||a===void 0?void 0:a.degree,c=(s=t[e])===null||s===void 0?void 0:s.inDegree,u=(o=t[e])===null||o===void 0?void 0:o.outDegree;return t[e]===void 0&&(l=1/0,c=1/0,u=1/0,i[e].forEach(function(h){var d=r[h.id].degree;l>d&&(l=d);var f=r[h.id].inDegree;c>f&&(c=f);var v=r[h.id].outDegree;u>v&&(u=v)}),t[e]={degree:l,inDegree:c,outDegree:u}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:c,minPatternNodeLabelOutDegree:u}},nN=function(t,e,r,i,a,s,o){var l;if(r===void 0&&(r=!1),s===void 0&&(s="cluster"),o===void 0&&(o="cluster"),!(!t||!t.nodes)){var c=t.nodes.length;if(c){var u=zf(t,r),h=zf(e,r),d=gy(t.nodes,u,r),f=gy(e.nodes,h,r),v=fy(t.nodes,s),g=v.nodeMap,p=v.nodeLabelMap,y=fy(e.nodes,s),b=y.nodeMap,E=y.nodeLabelMap;vy(t.edges,o,g);var O=vy(e.edges,o,b).edgeLabelMap,P=[];h==null||h.forEach(function(Be){P=P.concat(Be)}),a||(a=Math.max.apply(Math,(0,G.ev)((0,G.ev)([],P,!1),[2],!1))),i||(i=a);var L=hy(t,u,s,i),F=hy(e,h,s,i),I=Math.min(100,c*(c-1)/2),V=$C(i,c,I,L,u),Y=su(V,L,t),J=10,$=1,ot=1,ct=4,ft={graphs:Y,nodeLabelProp:s,edgeLabelProp:o,minSupport:$,minNodeNum:ot,maxNodeNum:ct,directed:r},Nt=JC(ft).slice(0,J),Ot=Nt.length,mt=[];Nt.forEach(function(Be,Qe){mt[Qe]={},Object.keys(Y).forEach(function(Fe){var Ye=Y[Fe],nn=ou(Ye,Be,s,o);mt[Qe][Fe]=nn})});var yt=tN(mt,Ot,Nt),Rt=yt.structure,jt=yt.structureCountMap,Xt=e.nodes[0],ee=[],ae=(l=e.nodes[0])===null||l===void 0?void 0:l[s],he=-1/0;e.nodes.forEach(function(Be){var Qe=Be[s],Fe=p[Qe];(Fe==null?void 0:Fe.length)>he&&(he=Fe.length,ee=Fe,ae=Qe,Xt=Be)});var ce={},xe={},Ce={},je={},Ue={},or={};Object.keys(E).forEach(function(Be,Qe){Ue[Be]=[],r&&(or[Be]=[]);var Fe=-1/0,Ye=E[Be],nn={};Ye.forEach(function(Je){var Xe=f["".concat(Xt.id,"-").concat(Je.id)];if(Xe&&Ue[Be].push(Xe),Fe<Xe&&(Fe=Xe),nn["".concat(Xt.id,"-").concat(Je.id)]={start:0,end:b[Je.id].idx,distance:Xe},r){var In=f["".concat(Je.id,"-").concat(Xt.id)];In&&or[Be].push(In)}}),Ue[Be]=Ue[Be].sort(function(Je,Xe){return Je-Xe}),r&&(or[Be]=or[Be].sort(function(Je,Xe){return Je-Xe})),xe=su(nn,F,e,xe);var pe=[];if(Object.keys(nn).forEach(function(Je){if(Ce[Je]){pe.push(Ce[Je]);return}var Xe=xe[Je];Ce[Je]=ou(Xe,Rt,s,o),pe.push(Ce[Je])}),pe=pe.sort(function(Je,Xe){return Xe-Je}),je["".concat(Xt.id,"-").concat(Be)]=pe,Be!==ae)for(var He=(ee==null?void 0:ee.length)||0,qe=function(Xe){var In=ee[Xe],hi=L[g[In.id].idx],Un=hi.nodeLabelCountMap[Be],Ks=E[Be].length;if(!Un||Un.count<Ks)return ee.splice(Xe,1),"continue";for(var Io=!1,zr=0;zr<Ks;zr++)if(Un.dists[zr]>Ue[Be][zr]){Io=!0;break}if(Io)return ee.splice(Xe,1),"continue";var Mi={};hi.neighbors.forEach(function(jr){var Vi=d["".concat(In.id,"-").concat(jr.id)];Mi["".concat(In.id,"-").concat(jr.id)]={start:g[In.id].idx,end:g[jr.id].idx,distance:Vi}}),Y=su(Mi,L,t,Y);var sa=[];Object.keys(Mi).forEach(function(jr){if(jt[jr]){sa.push(jt[jr]);return}var Vi=Y[jr];jt[jr]=ou(Vi,Rt,s,o),sa.push(jt[jr])}),sa=sa.sort(function(jr,Vi){return Vi-jr});for(var rs=!1,zr=0;zr<Ks;zr++)if(sa[zr]<pe[zr]){rs=!0;break}if(rs)return ee.splice(Xe,1),"continue"},tr=He-1;tr>=0;tr--)qe(tr)});var Ke=[];ee==null||ee.forEach(function(Be){for(var Qe=g[Be.id].idx,Fe=dy(t.nodes,u[Qe],Qe,s,a),Ye=Fe.neighbors,nn=Ye.length,pe=!1,He=nn-1;He>=0;He--){if(Ye.length+1<e.nodes.length){pe=!0;return}var qe=Ye[He],tr=qe[s];if(!E[tr]||!E[tr].length){Ye.splice(He,1);continue}if(!Ue[tr]||!Ue[tr].length){Ye.splice(He,1);continue}var Je="".concat(Be.id,"-").concat(qe.id),Xe=d[Je],In=Ue[tr].length-1,hi=Ue[tr][In];if(Xe>hi){Ye.splice(He,1);continue}if(r){var Un="".concat(qe.id,"-").concat(Be.id),Ks=d[Un];In=or[tr].length-1;var Io=or[tr][In];if(Ks>Io){Ye.splice(He,1);continue}}var zr=jt[Je]?jt[Je]:eN(t,Be,qe,g,Xe,L,Rt,s,o,jt,Y),Mi="".concat(Xt.id,"-").concat(tr),sa=je[Mi][je[Mi].length-1];if(zr<sa){Ye.splice(He,1);continue}var rs=py(ce,tr,b,E),jr=rs.minPatternNodeLabelDegree,Vi=rs.minPatternNodeLabelInDegree,Aa=rs.minPatternNodeLabelOutDegree;if(g[qe.id].degree<jr){Ye.splice(He,1);continue}}pe||Ke.push({nodes:[Be].concat(Ye)})});var ui=eu(e,Xt.id,!1).length,Pr={};r?(Object.keys(ui).forEach(function(Be){var Qe=b[Be].node[s];Pr[Qe]?Pr[Qe].push(ui[Be]):Pr[Qe]=[ui[Be]]}),Object.keys(Pr).forEach(function(Be){Pr[Be].sort(function(Qe,Fe){return Qe-Fe})})):Pr=Ue;for(var ns=Ke.length,wr=function(Qe){var Fe=Ke[Qe],Ye=Fe.nodes[0],nn={},pe={};Fe.nodes.forEach(function(xn,di){pe[xn.id]={idx:di,node:xn,degree:0,inDegree:0,outDegree:0};var lr=xn[s];nn[lr]?nn[lr]++:nn[lr]=1});var He=[],qe={};t.edges.forEach(function(xn){pe[xn.source]&&pe[xn.target]&&(He.push(xn),qe[xn[o]]?qe[xn[o]]++:qe[xn[o]]=1,pe[xn.source].degree++,pe[xn.target].degree++,pe[xn.source].outDegree++,pe[xn.target].inDegree++)});for(var tr=Object.keys(O).length,Je=!1,Xe=0;Xe<tr;Xe++){var In=Object.keys(O)[Xe];if(!qe[In]||qe[In]<O[In].length){Je=!0;break}}if(Je)return Ke.splice(Qe,1),"continue";var hi=He.length;if(hi<e.edges.length)return Ke.splice(Qe,1),"break";for(var Un=!1,Ks=function(di){var lr=He[di],oa=lr[o],Qs=O[oa];if(!Qs||!Qs.length)return qe[oa]--,Qs&&qe[oa]<Qs.length?(Un=!0,"break"):(He.splice(di,1),pe[lr.source].degree--,pe[lr.target].degree--,pe[lr.source].outDegree--,pe[lr.target].inDegree--,"continue");var tw=pe[lr.source].node[s],ew=pe[lr.target].node[s],V0=!1;if(Qs.forEach(function(nw){var rw=b[nw.source].node,iw=b[nw.target].node;rw[s]===tw&&iw[s]===ew&&(V0=!0),!r&&rw[s]===ew&&iw[s]===tw&&(V0=!0)}),!V0)return qe[oa]--,Qs&&qe[oa]<Qs.length?(Un=!0,"break"):(He.splice(di,1),pe[lr.source].degree--,pe[lr.target].degree--,pe[lr.source].outDegree--,pe[lr.target].inDegree--,"continue")},Xe=hi-1;Xe>=0;Xe--){var Io=Ks(Xe);if(Io==="break")break}if(Un)return Ke.splice(Qe,1),"continue";Fe.edges=He;var zr=eu(Fe,Fe.nodes[0].id,!1).length;if(Object.keys(zr).reverse().forEach(function(xn){if(!(xn===Fe.nodes[0].id||Un)){if(zr[xn]===1/0){var di=pe[xn].node[s];if(nn[di]--,nn[di]<E[di].length){Un=!0;return}var lr=Fe.nodes.indexOf(pe[xn].node);Fe.nodes.splice(lr,1),pe[xn]=void 0;return}var oa=g[xn].node[s];if(!Pr[oa]||!Pr[oa].length||zr[xn]>Pr[oa][Pr[oa].length-1]){var di=pe[xn].node[s];if(nn[di]--,nn[di]<E[di].length){Un=!0;return}var lr=Fe.nodes.indexOf(pe[xn].node);Fe.nodes.splice(lr,1),pe[xn]=void 0}}}),Un)return Ke.splice(Qe,1),"continue";for(var Mi=!0,sa=0;Mi&&!Un;){Mi=!1;var rs=r?pe[Ye.id].degree<b[Xt.id].degree||pe[Ye.id].inDegree<b[Xt.id].inDegree||pe[Ye.id].outDegree<b[Xt.id].outDegree:pe[Ye.id].degree<b[Xt.id].degree;if(rs){Un=!0;break}if(nn[Ye[s]]<E[Ye[s]].length){Un=!0;break}for(var jr=Fe.nodes.length,Vi=jr-1;Vi>=0;Vi--){var Aa=Fe.nodes[Vi],JE=pe[Aa.id].degree,kB=pe[Aa.id].inDegree,PB=pe[Aa.id].outDegree,RB=Aa[s],G0=py(ce,RB,b,E),$E=G0.minPatternNodeLabelDegree,LB=G0.minPatternNodeLabelInDegree,_B=G0.minPatternNodeLabelOutDegree,DB=r?JE<$E||kB<LB||PB<_B:JE<$E;if(DB){if(nn[Aa[s]]--,nn[Aa[s]]<E[Aa[s]].length){Un=!0;break}Fe.nodes.splice(Vi,1),pe[Aa.id]=void 0,Mi=!0}}if(Un||!Mi&&sa!==0)break;hi=He.length;for(var cd=hi-1;cd>=0;cd--){var Ta=He[cd];if(!pe[Ta.source]||!pe[Ta.target]){He.splice(cd,1);var ud=Ta[o];if(qe[ud]--,pe[Ta.source]&&(pe[Ta.source].degree--,pe[Ta.source].outDegree--),pe[Ta.target]&&(pe[Ta.target].degree--,pe[Ta.target].inDegree--),O[ud]&&qe[ud]<O[ud].length){Un=!0;break}Mi=!0}}sa++}if(Un||Un||Fe.nodes.length<e.nodes.length||He.length<e.edges.length)return Ke.splice(Qe,1),"continue"},fr=ns-1;fr>=0;fr--){var Ma=wr(fr);if(Ma==="break")break}for(var Sr=Ke.length,Jr=function(Qe){var Fe=Ke[Qe],Ye={};Fe.edges.forEach(function(He){var qe="".concat(He.source,"-").concat(He.target,"-").concat(He.label);Ye[qe]?Ye[qe]++:Ye[qe]=1});for(var nn=function(qe){var tr=Ke[qe],Je={};tr.edges.forEach(function(In){var hi="".concat(In.source,"-").concat(In.target,"-").concat(In.label);Je[hi]?Je[hi]++:Je[hi]=1});var Xe=!0;Object.keys(Je).length!==Object.keys(Ye).length?Xe=!1:Object.keys(Ye).forEach(function(In){Je[In]!==Ye[In]&&(Xe=!1)}),Xe&&Ke.splice(qe,1)},pe=Sr-1;pe>Qe;pe--)nn(pe);Sr=Ke.length},fr=0;fr<=Sr-1;fr++)Jr(fr);return Ke}}},rN=nN,iN=function(){function n(t){t===void 0&&(t=10),this.linkedList=new Dm,this.maxStep=t}return Object.defineProperty(n.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),n.prototype.isEmpty=function(){return!this.linkedList.head},n.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},n.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},n.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},n.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},n.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},n.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},n}(),aN=iN,sN=Gm,$z={getAdjMatrix:Qc,breadthFirstSearch:zO,connectedComponent:Fm,getDegree:Pf,getInDegree:ZO,getOutDegree:WO,detectCycle:Gm,detectDirectedCycle:sN,detectAllCycles:UO,detectAllDirectedCycle:Wm,detectAllUndirectedCycle:Zm,depthFirstSearch:jm,dijkstra:eu,findAllPath:yC,findShortestPath:Ff,floydWarshall:zf,labelPropagation:EC,louvain:ty,iLouvain:NC,kCore:PC,kMeans:LC,cosineSimilarity:ny,nodesCosineSimilarity:IC,minimumSpanningTree:VC,pageRank:iy,getNeighbors:xi,Stack:aN,GADDI:rN};function At(n){if(n.id!==void 0)return n.id;if(n.source!==void 0&&n.target!==void 0)return`${n.source}-${n.target}`;throw new Error(ga("The datum does not have available id."))}function lu(n){return n.combo}function my(n,t){const e={nodes:(n.nodes||[]).map(At),edges:(n.edges||[]).map(At),combos:(n.combos||[]).map(At)};return t?Object.values(e).flat():e}const yy=(n,t,e)=>{var r;switch(e.type){case"degree":{const i=new Map;return(r=n.nodes)===null||r===void 0||r.forEach(a=>{const s=t(At(a),e.direction).length;i.set(At(a),s)}),i}case"betweenness":return oN(n,e.directed,e.weightPropertyName);case"closeness":return lN(n,e.directed,e.weightPropertyName);case"eigenvector":return uN(n,e.directed);case"pagerank":return cN(n,e.epsilon,e.linkProb);default:return by(n)}},by=n=>{var t;const e=new Map;return(t=n.nodes)===null||t===void 0||t.forEach(r=>{e.set(At(r),0)}),e},oN=(n,t,e)=>{const r=by(n),{nodes:i=[]}=n;return i.forEach(a=>{i.forEach(s=>{if(a!==s){const{allPath:o}=Ff(n,At(a),At(s),t,e),l=o.length;o.flat().forEach(c=>{c!==At(a)&&c!==At(s)&&r.set(c,r.get(c)+1/l)})}})}),r},lN=(n,t,e)=>{const r=new Map,{nodes:i=[]}=n;return i.forEach(a=>{const s=i.reduce((o,l)=>{if(a!==l){const{length:c}=Ff(n,At(a),At(l),t,e);o+=c}return o},0);r.set(At(a),1/s)}),r},cN=(n,t,e)=>{var r;const i=new Map,a=iy(n,t,e);return(r=n.nodes)===null||r===void 0||r.forEach(s=>{i.set(At(s),a[At(s)])}),i},uN=(n,t)=>{const{nodes:e=[]}=n,r=hN(n,t),i=dN(r,e.length),a=new Map;return e.forEach((s,o)=>{a.set(At(s),i[o])}),a},hN=(n,t)=>{const{nodes:e=[],edges:r=[]}=n,i=Array(e.length).fill(null).map(()=>Array(e.length).fill(0));return r.forEach(({source:a,target:s})=>{const o=e.findIndex(c=>At(c)===a),l=e.findIndex(c=>At(c)===s);t?i[o][l]=1:(i[o][l]=1,i[l][o]=1)}),i},dN=(n,t,e=100,r=1e-6)=>{let i=Array(t).fill(1),a=1/0;for(let s=0;s<e&&a>r;s++){const o=Array(t).fill(0);for(let c=0;c<t;c++)for(let u=0;u<t;u++)o[c]+=n[c][u]*i[u];const l=Math.sqrt(o.reduce((c,u)=>c+u*u,0));for(let c=0;c<t;c++)o[c]/=l;a=Math.sqrt(o.reduce((c,u,h)=>c+(u-i[h])*u,0)),i=o}return i};function za(n,t,e,r=Zn){const i=new Map(n.map(d=>[e(d),d])),a=new Map(t.map(d=>[e(d),d])),s=new Set(i.keys()),o=new Set(a.keys()),l=[],c=[],u=[],h=[];return o.forEach(d=>{s.has(d)?r(i.get(d),a.get(d))?h.push(a.get(d)):c.push(a.get(d)):l.push(a.get(d))}),s.forEach(d=>{o.has(d)||u.push(i.get(d))}),{enter:l,exit:u,keep:h,update:c}}function Ps(n,t,e){const r=i=>{e&&!e(i)||(i.style.visibility=t)};n.forEach(i=>{r(i)})}function fN(n,t,e){const r={},i=a=>(a in r||(r[a]=0),`${t}-${a}-${r[a]++}`);return e.map(a=>typeof a=="string"?{type:a,key:i(a)}:typeof a=="function"?a.call(n):a.key?a:Object.assign(Object.assign({},a),{key:i(a.type)}))}class Wf{constructor(t){this.extensions=[],this.extensionMap={},this.context=t}setExtensions(t){const e=fN(this.context.graph,this.category,t),{enter:r,update:i,exit:a,keep:s}=za(this.extensions,e,o=>o.key);this.createExtensions(r),this.updateExtensions([...i,...s]),this.destroyExtensions(a),this.extensions=e}createExtension(t){const{category:e}=this,{key:r,type:i}=t,a=va(e,i);if(!a)return Xr.warn(`The extension ${i} of ${e} is not registered.`);const s=new a(this.context,t);s.initialized=!0,this.extensionMap[r]=s}createExtensions(t){t.forEach(e=>this.createExtension(e))}updateExtension(t){const{key:e}=t,r=this.extensionMap[e];r&&r.update(t)}updateExtensions(t){t.forEach(e=>this.updateExtension(e))}destroyExtension(t){const e=this.extensionMap[t];e&&(e.initialized&&!e.destroyed&&e.destroy(),delete this.extensionMap[t])}destroyExtensions(t){t.forEach(({key:e})=>this.destroyExtension(e))}destroy(){this.destroyExtensions(this.extensions),this.context={},this.extensions=[],this.extensionMap={}}}class Gf{constructor(t,e){this.events=[],this.initialized=!1,this.destroyed=!1,this.context=t,this.options=e}update(t){this.options=Object.assign(this.options,t)}destroy(){this.context={},this.options={},this.destroyed=!0}}class ai extends Gf{}class cu extends ai{constructor(t,e){super(t,Object.assign({},cu.defaultOptions,e)),this.isOverlapping=(r,i)=>i.some(a=>r.intersects(a)),this.occupiedBounds=[],this.detectLabelCollision=r=>{const i=this.context.viewport,a={show:[],hide:[]};return this.occupiedBounds=[],r.forEach(s=>{const o=s.getShape("label").getRenderBounds();i.isInViewport(o,!0)&&!this.isOverlapping(o,this.occupiedBounds)?(a.show.push(s),this.occupiedBounds.push(Fa(o,this.options.padding))):a.hide.push(s)}),a},this.hideLabelIfExceedViewport=(r,i)=>{const{exit:a}=za(r,i,s=>s.id);a==null||a.forEach(this.hideLabel)},this.nodeCentralities=new Map,this.sortNodesByCentrality=(r,i)=>{const{model:a}=this.context,s=a.getData(),o=a.getRelatedEdgesData.bind(a);return r.map(c=>(this.nodeCentralities.has(c.id)||(this.nodeCentralities=yy(s,o,i)),{node:c,centrality:this.nodeCentralities.get(c.id)})).sort((c,u)=>u.centrality-c.centrality).map(c=>c.node)},this.sortLabelElementsInView=r=>{const{sort:i,sortNode:a,sortCombo:s,sortEdge:o}=this.options,{model:l}=this.context;if(fe(i))return r.sort((g,p)=>i(l.getElementDataById(g.id),l.getElementDataById(p.id)));const{node:c=[],edge:u=[],combo:h=[]}=Xc(r,g=>g.type),d=fe(s)?h.sort((g,p)=>s(...l.getComboData([g.id,p.id]))):h,f=fe(a)?c.sort((g,p)=>a(...l.getNodeData([g.id,p.id]))):this.sortNodesByCentrality(c,a),v=fe(o)?u.sort((g,p)=>o(...l.getEdgeData([g.id,p.id]))):u;return[...d,...f,...v]},this.labelElementsInView=[],this.isFirstRender=!0,this.onToggleVisibility=r=>{var i;if(((i=r.data)===null||i===void 0?void 0:i.stage)==="zIndex")return;if(!this.validate(r)){this.hiddenElements.size>0&&(this.hiddenElements.forEach(this.showLabel),this.hiddenElements.clear());return}const a=this.isFirstRender?this.getLabelElements():this.getLabelElementsInView();this.hideLabelIfExceedViewport(this.labelElementsInView,a),this.labelElementsInView=a;const s=this.sortLabelElementsInView(this.labelElementsInView),{show:o,hide:l}=this.detectLabelCollision(s);for(let c=o.length-1;c>=0;c--)this.showLabel(o[c]);l.forEach(this.hideLabel)},this.hiddenElements=new Map,this.hideLabel=r=>{const i=r.getShape("label");i&&Ps(i,"hidden"),this.hiddenElements.set(r.id,r)},this.showLabel=r=>{const i=r.getShape("label");i&&Ps(i,"visible"),r.toFront(),this.hiddenElements.delete(r.id)},this.onTransform=Rm(this.onToggleVisibility,this.options.throttle,{leading:!0}),this.enableToggle=!0,this.toggle=r=>{this.enableToggle&&this.onToggleVisibility(r)},this.onBeforeRender=()=>{this.enableToggle=!1},this.onAfterRender=r=>{this.onToggleVisibility(r),this.enableToggle=!0},this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents(),this.onToggleVisibility({})}getLabelElements(){const{elementMap:t}=this.context.element,e=[];for(const r in t){const i=t[r];i.isVisible()&&i.getShape("label")&&e.push(i)}return e}getLabelElementsInView(){const t=this.context.viewport;return this.getLabelElements().filter(e=>t.isInViewport(e.getShape("key").getRenderBounds()))}bindEvents(){const{graph:t}=this.context;t.on(Kt.BEFORE_RENDER,this.onBeforeRender),t.on(Kt.AFTER_RENDER,this.onAfterRender),t.on(Kt.AFTER_DRAW,this.toggle),t.on(Kt.AFTER_LAYOUT,this.toggle),t.on(Kt.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.BEFORE_RENDER,this.onBeforeRender),t.off(Kt.AFTER_RENDER,this.onAfterRender),t.off(Kt.AFTER_DRAW,this.toggle),t.off(Kt.AFTER_LAYOUT,this.toggle),t.off(Kt.AFTER_TRANSFORM,this.onTransform)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}cu.defaultOptions={enable:!0,throttle:100,padding:0,sortNode:{type:"degree"}};var vN=function(n){if(!Mf(n)||!Ag(n,"Object"))return!1;if(Object.getPrototypeOf(n)===null)return!0;for(var t=n;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(n)===t},vo=vN,gN=5;function pN(n,t){if(Object.hasOwn)return Object.hasOwn(n,t);if(n==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(n),t)}function xy(n,t,e,r){e=e||0,r=r||gN;for(var i in t)if(pN(t,i)){var a=t[i];a!==null&&vo(a)?(vo(n[i])||(n[i]={}),e<r?xy(n[i],a,e+1,r):n[i]=t[i]):Wr(a)?(n[i]=[],n[i]=n[i].concat(a)):a!==void 0&&(n[i]=a)}}var mN=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var r=0;r<t.length;r+=1)xy(n,t[r]);return n},pr=mN;const Ey=[0,0,0];function Ne(n,t){return n.map((e,r)=>e+t[r])}function ln(n,t){return n.map((e,r)=>e-t[r])}function Di(n,t){return typeof t=="number"?n.map(e=>e*t):n.map((e,r)=>e*t[r])}function Ii(n,t){return typeof t=="number"?n.map(e=>e/t):n.map((e,r)=>e/t[r])}function yN(n,t){return n.reduce((e,r,i)=>e+r*t[i],0)}function bN(n,t){const e=pl(n),r=pl(t);return[e[1]*r[2]-e[2]*r[1],e[2]*r[0]-e[0]*r[2],e[0]*r[1]-e[1]*r[0]]}function ja(n,t){return n.map(e=>e*t)}function bn(n,t){return Math.sqrt(n.reduce((e,r,i)=>e+Math.pow(r-t[i]||0,2),0))}function uu(n,t){return n.reduce((e,r,i)=>e+Math.abs(r-t[i]),0)}function pa(n){const t=n.reduce((e,r)=>e+Math.pow(r,2),0);return n.map(e=>e/Math.sqrt(t))}function Vf(n,t,e=!1){const r=n[0]*t[1]-n[1]*t[0];let i=Math.acos(Di(n,t).reduce((a,s)=>a+s,0)/(bn(n,Ey)*bn(t,Ey)));return e&&r<0&&(i=2*Math.PI-i),i}function t7(n,t){return n.every((e,r)=>e===t[r])}function hu(n,t=!0){return t?[-n[1],n[0]]:[n[1],-n[0]]}function Uf(n,t){return n.map(e=>e%t)}function Rs(n){return[n[0],n[1]]}function pl(n){return MO(n)?[n[0],n[1],0]:n}function wy(n){const[t,e]=n;return!t&&!e?0:Math.atan2(e,t)}function Sy(n,t){const[e,r]=n,[i,a]=t,s=ln(e,r),o=ln(i,a);return bN(s,o).every(l=>l===0)}function Yf(n,t,e=!1){if(Sy(n,t))return;const[r,i]=n,[a,s]=t,o=((r[0]-a[0])*(a[1]-s[1])-(r[1]-a[1])*(a[0]-s[0]))/((r[0]-i[0])*(a[1]-s[1])-(r[1]-i[1])*(a[0]-s[0])),l=s[0]-a[0]?(r[0]-a[0]+o*(i[0]-r[0]))/(s[0]-a[0]):(r[1]-a[1]+o*(i[1]-r[1]))/(s[1]-a[1]);if(!(!e&&(!$i(o,0,1)||!$i(l,0,1))))return[r[0]+o*(i[0]-r[0]),r[1]+o*(i[1]-r[1])]}function My(n){if(Array.isArray(n))return $i(n[0],0,1)&&$i(n[1],0,1)?n:[.5,.5];const t=n.split("-"),e=t.includes("left")?0:t.includes("right")?1:.5,r=t.includes("top")?0:t.includes("bottom")?1:.5;return[e,r]}function ir(n){const{x:t=0,y:e=0,z:r=0}=n.style||{};return[+t,+e,+r]}function xN(n){const{x:t,y:e,z:r}=n.style||{};return t!==void 0||e!==void 0||r!==void 0}function Ay(n,t){const[e,r]=t,{min:i,max:a}=n;return[i[0]+e*(a[0]-i[0]),i[1]+r*(a[1]-i[1])]}function ma(n,t="center"){const e=My(t);return Ay(n,e)}function e7(n,t){const e=parseAnchor(t);return Ay(n,e)}const n7=n=>{const[t,e]=n;return{left:Math.min(t[0],e[0]),right:Math.max(t[0],e[0]),top:Math.min(t[1],e[1]),bottom:Math.max(t[1],e[1])}};function mr(n){var t;return[n.x,n.y,(t=n.z)!==null&&t!==void 0?t:0]}function Bi(n){var t;return{x:n[0],y:n[1],z:(t=n[2])!==null&&t!==void 0?t:0}}function r7(n){return n.sort((t,e)=>t[0]-e[0]||t[1]-e[1])}function i7(n){const t=new Set;return n.filter(e=>{const r=e.join(",");return t.has(r)?!1:(t.add(r),!0)})}function ml(n,t=0){return n.map(e=>parseFloat(e.toFixed(t)))}function Za(n,t,e,r=!1){if(Zn(n,t))return n;const i=r?ln(n,t):ln(t,n),a=pa(i),s=[a[0]*e,a[1]*e];return Ne(Rs(n),s)}function Ty(n,t){return n[1]===t[1]}function EN(n,t){return n[0]===t[0]}function wN(n,t){return Ty(n,t)||EN(n,t)}function Oy(n,t,e){return Sy([n,t],[t,e])}function Cy(n,t){return[2*t[0]-n[0],2*t[1]-n[1]]}function Ny(n,t,e,r=!0,i=!1){for(let a=0;a<e.length;a++){let s=e[a],o=e[(a+1)%e.length];r&&(s=Ne(t,s),o=Ne(t,o));const l=i?Cy(n,t):n,c=Yf([t,l],[s,o]);if(c)return{point:c,line:[s,o]}}return{point:t,line:void 0}}function SN(n,t,e,r){const i=n[0],a=n[1];let s=!1;e===void 0&&(e=0),r===void 0&&(r=t.length);const o=r-e;for(let l=0,c=o-1;l<o;c=l++){const u=t[l+e][0],h=t[l+e][1],d=t[c+e][0],f=t[c+e][1];h>a!=f>a&&i<(d-u)*(a-h)/(f-h)+u&&(s=!s)}return s}function MN(n,t,e=!1){const r=ma(t,"center"),i=[ma(t,"left-top"),ma(t,"right-top"),ma(t,"right-bottom"),ma(t,"left-bottom")];return Ny(n,r,i,!1,e).point}function du(n,t,e=!1){const r=t.center,i=e?Cy(n,r):n,a=ln(i,t.center),s=Math.atan2(a[1],a[0]);if(isNaN(s))return r;const o=ta(t)/2,l=ea(t)/2,c=r[0]+o*Math.cos(s),u=r[1]+l*Math.sin(s);return[c,u]}function AN(n,t){let e=1/0,r=[n[0],t[0]];return n.forEach(i=>{t.forEach(a=>{const s=bn(i,a);s<e&&(e=s,r=[i,a])})}),r}function TN(n,t){let e=1/0,r=[[0,0],[0,0]];return t.forEach(i=>{const a=ON(n,i);a<e&&(e=a,r=i)}),r}function ON(n,t){const e=ky(n,t);return bn(n,e)}function ky(n,t){const[e,r]=t[0],[i,a]=t[1],[s,o]=n,l=i-e,c=a-r;if(l===0&&c===0)return[e,r];let u=((s-e)*l+(o-r)*c)/(l*l+c*c);u>1?u=1:u<0&&(u=0);const h=e+u*l,d=r+u*c;return[h,d]}function CN(n){const t=n.reduce((e,r)=>Ne(e,r),[0,0]);return Ii(t,n.length)}function Hf(n,t=!0){const e=CN(n);return n.sort(([r,i],[a,s])=>{const o=Math.atan2(i-e[1],r-e[0]),l=Math.atan2(s-e[1],a-e[0]);return t?l-o:o-l})}function Py(n,t){return[n,[n[0],t[1]],t,[t[0],n[1]]]}class Wn{constructor(t,e,r){if(this.phase=e,this.pointerByTouch=[],this.initialDistance=null,this.emitter=t,Wn.instance)return Wn.callbacks[this.phase].push(r),Wn.instance;this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.bindEvents(),Wn.instance=this,Wn.callbacks[this.phase].push(r)}bindEvents(){const{emitter:t}=this;t.on(Bt.POINTER_DOWN,this.onPointerDown),t.on(Bt.POINTER_MOVE,this.onPointerMove),t.on(Bt.POINTER_UP,this.onPointerUp)}updatePointerPosition(t,e,r){const i=this.pointerByTouch.findIndex(a=>a.pointerId===t);i>=0&&(this.pointerByTouch[i]={x:e,y:r,pointerId:t})}onPointerDown(t){const{x:e,y:r}=t.client||{};if(!(e===void 0||r===void 0)&&(this.pointerByTouch.push({x:e,y:r,pointerId:t.pointerId}),t.pointerType==="touch"&&this.pointerByTouch.length===2)){Wn.isPinching=!0;const i=this.pointerByTouch[0].x-this.pointerByTouch[1].x,a=this.pointerByTouch[0].y-this.pointerByTouch[1].y;this.initialDistance=Math.sqrt(i*i+a*a),Wn.callbacks.pinchstart.forEach(s=>s(t,{scale:0}))}}onPointerMove(t){if(this.pointerByTouch.length!==2||this.initialDistance===null)return;const{x:e,y:r}=t.client||{};if(e===void 0||r===void 0)return;this.updatePointerPosition(t.pointerId,e,r);const i=this.pointerByTouch[0].x-this.pointerByTouch[1].x,a=this.pointerByTouch[0].y-this.pointerByTouch[1].y,o=Math.sqrt(i*i+a*a)/this.initialDistance;Wn.callbacks.pinchmove.forEach(l=>l(t,{scale:(o-1)*5}))}onPointerUp(t){var e;Wn.callbacks.pinchend.forEach(r=>r(t,{scale:0})),Wn.isPinching=!1,this.initialDistance=null,this.pointerByTouch=[],(e=Wn.instance)===null||e===void 0||e.tryDestroy()}destroy(){this.emitter.off(Bt.POINTER_DOWN,this.onPointerDown),this.emitter.off(Bt.POINTER_MOVE,this.onPointerMove),this.emitter.off(Bt.POINTER_UP,this.onPointerUp),Wn.instance=null}off(t,e){const r=Wn.callbacks[t].indexOf(e);r>-1&&Wn.callbacks[t].splice(r,1),this.tryDestroy()}tryDestroy(){Object.values(Wn.callbacks).every(t=>t.length===0)&&this.destroy()}}Wn.isPinching=!1,Wn.instance=null,Wn.callbacks={pinchstart:[],pinchmove:[],pinchend:[]};const Ry=n=>n.map(t=>Ge(t)?t.toLocaleLowerCase():t);class go{constructor(t){this.map=new Map,this.boundHandlePinch=()=>{},this.recordKey=new Set,this.onKeyDown=e=>{e!=null&&e.key&&(this.recordKey.add(e.key),this.trigger(e))},this.onKeyUp=e=>{e!=null&&e.key&&this.recordKey.delete(e.key)},this.onWheel=e=>{this.triggerExtendKey(Bt.WHEEL,e)},this.onDrag=e=>{this.triggerExtendKey(Bt.DRAG,e)},this.handlePinch=(e,r)=>{this.triggerExtendKey(Bt.PINCH,Object.assign(Object.assign({},e),r))},this.onFocus=()=>{this.recordKey.clear()},this.emitter=t,this.bindEvents()}bind(t,e){t.length!==0&&(t.includes(Bt.PINCH)&&!this.pinchHandler&&(this.boundHandlePinch=this.handlePinch.bind(this),this.pinchHandler=new Wn(this.emitter,"pinchmove",this.boundHandlePinch)),this.map.set(t,e))}unbind(t,e){this.map.forEach((r,i)=>{Zn(i,t)&&(!e||e===r)&&this.map.delete(i)})}unbindAll(){this.map.clear()}match(t){const e=Ry(Array.from(this.recordKey)).sort(),r=Ry(t).sort();return Zn(e,r)}bindEvents(){var t;const{emitter:e}=this;e.on(Bt.KEY_DOWN,this.onKeyDown),e.on(Bt.KEY_UP,this.onKeyUp),e.on(Bt.WHEEL,this.onWheel),e.on(Bt.DRAG,this.onDrag),(t=globalThis.addEventListener)===null||t===void 0||t.call(globalThis,"focus",this.onFocus)}trigger(t){this.map.forEach((e,r)=>{this.match(r)&&e(t)})}triggerExtendKey(t,e){this.map.forEach((r,i)=>{i.includes(t)&&Zn(Array.from(this.recordKey),i.filter(a=>a!==t))&&r(e)})}destroy(){var t,e;this.unbindAll(),this.emitter.off(Bt.KEY_DOWN,this.onKeyDown),this.emitter.off(Bt.KEY_UP,this.onKeyUp),this.emitter.off(Bt.WHEEL,this.onWheel),this.emitter.off(Bt.DRAG,this.onDrag),(t=this.pinchHandler)===null||t===void 0||t.off("pinchmove",this.boundHandlePinch),(e=globalThis.removeEventListener)===null||e===void 0||e.call(globalThis,"blur",this.onFocus)}}class yl extends ai{constructor(t,e){super(t,pr({},yl.defaultOptions,e)),this.shortcut=new go(t.graph),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.clearStates=this.clearStates.bind(this),this.bindEvents()}onPointerDown(t){if(!this.validate(t)||!this.isKeydown()||this.startPoint)return;const{canvas:e,graph:r}=this.context,i=Object.assign({},this.options.style);this.options.style.lineWidth&&(i.lineWidth=+this.options.style.lineWidth/r.getZoom()),this.rectShape=new gr({id:"g6-brush-select",style:i}),e.appendChild(this.rectShape),this.startPoint=[t.canvas.x,t.canvas.y]}onPointerMove(t){var e;if(!this.startPoint)return;const{immediately:r,mode:i}=this.options;this.endPoint=fu(t),(e=this.rectShape)===null||e===void 0||e.attr({x:Math.min(this.endPoint[0],this.startPoint[0]),y:Math.min(this.endPoint[1],this.startPoint[1]),width:Math.abs(this.endPoint[0]-this.startPoint[0]),height:Math.abs(this.endPoint[1]-this.startPoint[1])}),r&&i==="default"&&this.updateElementsStates(Py(this.startPoint,this.endPoint))}onPointerUp(t){if(this.startPoint){if(!this.endPoint){this.clearBrush();return}this.endPoint=fu(t),this.updateElementsStates(Py(this.startPoint,this.endPoint)),this.clearBrush()}}clearStates(){this.endPoint||this.clearElementsStates()}clearElementsStates(){const{graph:t}=this.context,e=Object.values(t.getData()).reduce((r,i)=>Object.assign({},r,i.reduce((a,s)=>{var o;const l=(o=s.states||[])===null||o===void 0?void 0:o.filter(c=>c!==this.options.state);return a[At(s)]=l,a},{})),{});t.setElementState(e,this.options.animation)}updateElementsStates(t){const{graph:e}=this.context,{enableElements:r,state:i,mode:a,onSelect:s}=this.options,o=this.selector(e,t,r);let l={};switch(a){case"union":o.forEach(c=>{l[c]=[...e.getElementState(c),i]});break;case"diff":o.forEach(c=>{const u=e.getElementState(c);l[c]=u.includes(i)?u.filter(h=>h!==i):[...u,i]});break;case"intersect":o.forEach(c=>{const u=e.getElementState(c);l[c]=u.includes(i)?[i]:[]});break;case"default":default:o.forEach(c=>{l[c]=[i]});break}fe(s)&&(l=s(l)),e.setElementState(l,this.options.animation)}selector(t,e,r){if(!r||r.length===0)return[];const i=[],a=t.getData();if(r.forEach(s=>{a[`${s}s`].forEach(o=>{const l=At(o);t.getElementVisibility(l)!=="hidden"&&SN(t.getElementPosition(l),e)&&i.push(l)})}),r.includes("edge")){const s=a.edges;s==null||s.forEach(o=>{const{source:l,target:c}=o;i.includes(l)&&i.includes(c)&&i.push(At(o))})}return i}clearBrush(){var t;(t=this.rectShape)===null||t===void 0||t.remove(),this.rectShape=void 0,this.startPoint=void 0,this.endPoint=void 0}isKeydown(){const{trigger:t}=this.options,e=Array.isArray(t)?t:[t];return this.shortcut.match(e.filter(r=>r!=="drag"))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}bindEvents(){const{graph:t}=this.context;t.on(Bt.POINTER_DOWN,this.onPointerDown),t.on(Bt.POINTER_MOVE,this.onPointerMove),t.on(Bt.POINTER_UP,this.onPointerUp),t.on(fa.CLICK,this.clearStates)}unbindEvents(){const{graph:t}=this.context;t.off(Bt.POINTER_DOWN,this.onPointerDown),t.off(Bt.POINTER_MOVE,this.onPointerMove),t.off(Bt.POINTER_UP,this.onPointerUp),t.off(fa.CLICK,this.clearStates)}update(t){this.unbindEvents(),this.options=pr(this.options,t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}yl.defaultOptions={animation:!1,enable:!0,enableElements:["node","combo","edge"],immediately:!1,mode:"default",state:"selected",trigger:["shift"],style:{width:0,height:0,lineWidth:1,fill:"#1677FF",stroke:"#1677FF",fillOpacity:.1,zIndex:2,pointerEvents:"none"}};const fu=n=>[n.canvas.x,n.canvas.y],ya=.8,Ls=["node","edge","combo"];function _s(n,t,e,r,i=0){r==="TB"&&t(n,i);const a=e(n);if(a)for(const s of a)_s(s,t,e,r,i+1);r==="BT"&&t(n,i)}function NN(n,t,e){const r=[[n,0]];for(;r.length;){const[i,a]=r.shift();t(i,a);const s=e(i);if(s)for(const o of s)r.push([o,a+1])}}function Ly(n,t,e,r,i="both"){if(t==="combo"||t==="node")return Xf(n,e,r,i);const a=n.getEdgeData(e);if(!a)return[];const s=Xf(n,a.source,r-1,i),o=Xf(n,a.target,r-1,i);return Array.from(new Set([...s,...o,e]))}function Xf(n,t,e,r="both"){const i=new Set,a=new Set,s=new Set;return NN(t,(o,l)=>{l>e||(s.add(o),n.getRelatedEdgesData(o,r).forEach(c=>{const u=At(c);!a.has(u)&&l<e&&(s.add(u),a.add(u))}))},o=>n.getRelatedEdgesData(o,r).map(l=>l.source===o?l.target:l.source).filter(l=>i.has(l)?!1:(i.add(l),!0))),Array.from(s)}function Kf(n){return n.states||[]}var vu=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class gu extends ai{constructor(t,e){super(t,Object.assign({},gu.defaultOptions,e)),this.onClickSelect=r=>vu(this,void 0,void 0,function*(){var i,a;this.validate(r)&&(yield this.updateState(r),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,r))}),this.onClickCanvas=r=>vu(this,void 0,void 0,function*(){var i,a;this.validate(r)&&(yield this.clearState(),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,r))}),this.shortcut=new go(t.graph),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Ls.forEach(e=>{t.on(`${e}:${Bt.CLICK}`,this.onClickSelect)}),t.on(fa.CLICK,this.onClickCanvas)}get isMultipleSelect(){const{multiple:t,trigger:e}=this.options;return t&&this.shortcut.match(e)}getNeighborIds(t){const{target:e,targetType:r}=t,{graph:i}=this.context,{degree:a}=this.options;return Ly(i,r,e.id,typeof a=="function"?a(t):a).filter(s=>s!==e.id)}updateState(t){return vu(this,void 0,void 0,function*(){const{state:e,unselectedState:r,neighborState:i,animation:a}=this.options;if(!e&&!i&&!r)return;const{target:s}=t,{graph:o}=this.context,l=o.getElementData(s.id),c=Kf(l).includes(e)?"unselect":"select",u={},h=this.isMultipleSelect,d=[s.id],f=this.getNeighborIds(t);if(h)if(Object.assign(u,this.getDataStates()),c==="select"){const v=(g,p)=>{g.forEach(y=>{const b=new Set(o.getElementState(y));b.add(p),b.delete(r),u[y]=Array.from(b)})};v(d,e),v(f,i),r&&Object.keys(u).forEach(g=>{const p=u[g];!p.includes(e)&&!p.includes(i)&&!p.includes(r)&&u[g].push(r)})}else{const v=u[s.id];u[s.id]=v.filter(g=>g!==e&&g!==i),v.includes(r)||u[s.id].push(r),f.forEach(g=>{u[g]=u[g].filter(p=>p!==i),u[g].includes(e)||u[g].push(r)})}else if(c==="select"){Object.assign(u,this.getClearStates(!!r));const v=(g,p)=>{g.forEach(y=>{u[y]||(u[y]=o.getElementState(y)),u[y].push(p)})};v(d,e),v(f,i),r&&Object.keys(u).forEach(g=>{!d.includes(g)&&!f.includes(g)&&u[g].push(r)})}else Object.assign(u,this.getClearStates());yield o.setElementState(u,a)})}getDataStates(){const{graph:t}=this.context,{nodes:e,edges:r,combos:i}=t.getData(),a={};return[...e,...r,...i].forEach(s=>{a[At(s)]=Kf(s)}),a}getClearStates(t=!1){const{graph:e}=this.context,{state:r,unselectedState:i,neighborState:a}=this.options,s=new Set([r,i,a]),{nodes:o,edges:l,combos:c}=e.getData(),u={};return[...o,...l,...c].forEach(h=>{const d=Kf(h),f=d.filter(v=>!s.has(v));(t||f.length!==d.length)&&(u[At(h)]=f)}),u}clearState(){return vu(this,void 0,void 0,function*(){const{graph:t}=this.context;yield t.setElementState(this.getClearStates(),this.options.animation)})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Ls.forEach(e=>{t.off(`${e}:${Bt.CLICK}`,this.onClickSelect)}),t.off(fa.CLICK,this.onClickCanvas)}destroy(){this.unbindEvents(),super.destroy()}}gu.defaultOptions={animation:!0,enable:!0,multiple:!1,trigger:["shift"],state:"selected",neighborState:"selected",unselectedState:void 0,degree:0};function Kr(n){var t;return!!(!((t=n.style)===null||t===void 0)&&t.collapsed)}var yr=function(n,t,e){for(var r=0,i=Ge(t)?t.split("."):t;n&&r<i.length;)n=n[i[r++]];return n===void 0||r<i.length?e:n},bl=function(n,t,e){var r=n,i=Ge(t)?t.split("."):t;return i.forEach(function(a,s){s<i.length-1?(Fn(r[a])||(r[a]=ie(i[s+1])?[]:{}),r=r[a]):r[a]=e}),n},kN=function(n){var t=Am(n);return t.charAt(0).toLowerCase()+t.substring(1)},PN=kN;function xl(n,t){if(!n.startsWith(t))return!1;const e=n[t.length];return e>="A"&&e<="Z"}function _y(n,t){return`${t}${Yc(n)}`}function Dy(n,t,e=!0){if(!t||!xl(n,t))return n;const r=n.slice(t.length);return e?PN(r):r}function Qn(n,t){const e=Object.entries(n).reduce((r,[i,a])=>(i==="className"||i==="class"||xl(i,t)&&Object.assign(r,{[Dy(i,t)]:a}),r),{});if("opacity"in n){const r=_y("opacity",t),i=n.opacity;if(r in n){const a=n[r];Object.assign(e,{opacity:i*a})}else Object.assign(e,{opacity:i})}return e}function Qf(n,t){const e=t.length;return Object.keys(n).reduce((r,i)=>{if(i.startsWith(t)){const a=i.slice(e);r[a]=n[i]}return r},{})}function Iy(n,t){const e=typeof t=="string"?[t]:t,r={};return Object.keys(n).forEach(i=>{e.find(a=>i.startsWith(a))||(r[i]=n[i])}),r}function a7(n,t,e){return Object.entries(n).reduce((r,[i,a])=>(xl(i,t)?r[_y(Dy(i,t,!1),e)]=a:r[i]=a,r),{})}function si(n=0){if(typeof n=="number")return[n,n,n];const[t,e=t,r=t]=n;return[t,e,r]}var RN=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function By(n,t){const{datum:e,graph:r}=t;return typeof n=="function"?n.call(r,e):Object.fromEntries(Object.entries(n).map(([i,a])=>typeof a=="function"?[i,a.call(r,e)]:[i,a]))}function ur(n,t){const e=(n==null?void 0:n.style)||{},r=(t==null?void 0:t.style)||{};for(const i in e)i in r||(r[i]=e[i]);return Object.assign({},n,t,{style:r})}function LN(n){const{x:t,y:e,z:r,class:i,className:a,transform:s,transformOrigin:o,zIndex:l,visibility:c}=n;return RN(n,["x","y","z","class","className","transform","transformOrigin","zIndex","visibility"])}function _N(n,t){const e=si(n);let r={};return t.text&&!t.fontSize&&(r={fontSize:Math.min(...e)*.5}),t.src&&(!t.width||!t.height)&&(r={width:e[0]*.5,height:e[1]*.5}),r}function Fy(n){if(n)return typeof n=="string"||typeof n=="function"||Array.isArray(n)?{type:"group",field:t=>t.id,color:n,invert:!1}:n}function DN(n,t){if(!t)return{};const{type:e,color:r,field:i,invert:a}=t,s=l=>{const c=typeof r=="string"?va("palette",r):r;if(typeof c=="function"){const u={};return l.forEach(([h,d])=>{u[h]=c(a?1-d:d)}),u}else if(Array.isArray(c)){const u=a?[...c].reverse():c,h={};return l.forEach(([d,f])=>{h[d]=u[f%c.length]}),h}return{}},o=(l,c)=>{var u;return typeof l=="string"?(u=c.data)===null||u===void 0?void 0:u[l]:l==null?void 0:l(c)};if(e==="group"){const l=Xc(n,d=>{if(!i)return"default";const f=o(i,d);return f?String(f):"default"}),c=Object.keys(l),u=s(c.map((d,f)=>[d,f])),h={};return Object.entries(l).forEach(([d,f])=>{f.forEach(v=>{h[At(v)]=u[d]})}),h}else if(e==="value"){const[l,c]=n.reduce(([h,d],f)=>{const v=o(i,f);if(typeof v!="number")throw new Error(ga(`Palette field ${i} is not a number`));return[Math.min(h,v),Math.max(d,v)]},[1/0,-1/0]),u=c-l;return s(n.map(h=>[h.id,(o(i,h)-l)/u]))}}function zy(n){const t=typeof n=="string"?va("palette",n):n;if(typeof t!="function")return t}function jy(n,t){let e=2*n;return typeof t=="string"?e=n*Number(t.replace("%",""))/100:typeof t=="number"&&(e=t),isNaN(e)&&(e=2*n),e}function Zy(n,t,e=1,r=!1){const i=r?e:1,a=(n.max[0]-n.min[0])*i;return jy(a,t)}function IN(n,t,e=1){const r=bn(n[0],n[1])*e;return jy(r,t)}var BN={}.toString,FN=function(n){return BN.call(n).replace(/^\[object /,"").replace(/]$/,"")},zN=FN,jN=Object.prototype,ZN=function(n){var t=n&&n.constructor,e=typeof t=="function"&&t.prototype||jN;return n===e},WN=ZN,GN=Object.prototype.hasOwnProperty;function VN(n){if(me(n))return!0;if(cl(n))return!n.length;var t=zN(n);if(t==="Map"||t==="Set")return!n.size;if(WN(n))return!Object.keys(n).length;for(var e in n)if(GN.call(n,e))return!1;return!0}var ra=VN;class El extends df{constructor(t){Wy(t.style),super(t),this.shapeMap={},this.animateMap={},this.render(this.attributes,this),this.setVisibility(),this.bindEvents()}get parsedAttributes(){return this.attributes}upsert(t,e,r,i,a){var s,o,l,c,u,h,d,f;const v=this.shapeMap[t];if(r===!1){v&&((s=a==null?void 0:a.beforeDestroy)===null||s===void 0||s.call(a,v),i.removeChild(v),delete this.shapeMap[t],(o=a==null?void 0:a.afterDestroy)===null||o===void 0||o.call(a,v));return}const g=typeof e=="string"?va(ul.SHAPE,e):e;if(!g)throw new Error(ga(`Shape ${e} not found`));if(!v||v.destroyed||!(v instanceof g)){v&&((l=a==null?void 0:a.beforeDestroy)===null||l===void 0||l.call(a,v),v==null||v.destroy(),(c=a==null?void 0:a.afterDestroy)===null||c===void 0||c.call(a,v)),(u=a==null?void 0:a.beforeCreate)===null||u===void 0||u.call(a);const p=new g({className:t,style:r});return i.appendChild(p),this.shapeMap[t]=p,(h=a==null?void 0:a.afterCreate)===null||h===void 0||h.call(a,p),p}return(d=a==null?void 0:a.beforeUpdate)===null||d===void 0||d.call(a,v),yv(v,r),(f=a==null?void 0:a.afterUpdate)===null||f===void 0||f.call(a,v),v}update(t={}){const e=Object.assign({},this.attributes,t);Wy(e),U3(this,e),this.render(e,this),this.setVisibility()}bindEvents(){}getGraphicStyle(t){return LN(t)}get compositeShapes(){return[["badges","badge-"],["ports","port-"]]}animate(t,e){if(t.length===0)return null;const r=[];if(t[0].x!==void 0||t[0].y!==void 0||t[0].z!==void 0){const{x:a=0,y:s=0,z:o=0}=this.attributes;t.forEach(l=>{const{x:c=a,y:u=s,z:h=o}=l;Object.assign(l,{transform:h?[["translate3d",c,u,h]]:[["translate",c,u]]})})}const i=super.animate(t,e);if(i&&(qf(this,i),r.push(i)),Array.isArray(t)&&t.length>0){const a=["transform","transformOrigin","x","y","z","zIndex"];if(Object.keys(t[0]).some(s=>!a.includes(s))){Object.entries(this.shapeMap).forEach(([o,l])=>{const c=`get${Yc(o)}Style`,u=this[c];if(fe(u)){const h=t.map(f=>u.call(this,Object.assign(Object.assign({},this.attributes),f))),d=l.animate(Cf(h),e);d&&(qf(l,d),r.push(d))}});const s=(o,l)=>{if(!ra(o)){const c=`get${Yc(l)}Style`,u=this[c];if(fe(u)){const h=t.map(d=>u.call(this,Object.assign(Object.assign({},this.attributes),d)));Object.entries(h[0]).map(([d])=>{const f=h.map(g=>g[d]),v=o[d];if(v){const g=v.animate(Cf(f),e);g&&(qf(v,g),r.push(g))}})}}};this.compositeShapes.forEach(([o,l])=>{const c=Qf(this.shapeMap,l);s(c,o)})}}return Of(r)}getShape(t){return this.shapeMap[t]}setVisibility(){const{visibility:t}=this.attributes;Ps(this,t)}destroy(){this.shapeMap={},this.animateMap={},super.destroy()}}function qf(n,t){t==null||t.finished.then(()=>{const e=n.activeAnimations.findIndex(r=>r===t);e>-1&&n.activeAnimations.splice(e,1)})}function Wy(n){if(!n)return{};if("x"in n||"y"in n||"z"in n){const{x:t=0,y:e=0,z:r,transform:i}=n,a=Cm(t,e,r,i);a&&(n.transform=a)}return n}var UN=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Wa extends El{constructor(t){super(ur({style:Wa.defaultStyleProps},t))}isTextStyle(t){return xl(t,"label")}isBackgroundStyle(t){return xl(t,"background")}getTextStyle(t){const e=this.getGraphicStyle(t),{padding:r}=e,i=UN(e,["padding"]);return Iy(i,"background")}getBackgroundStyle(t){if(t.background===!1)return!1;const e=this.getGraphicStyle(t),{wordWrap:r,wordWrapWidth:i,padding:a}=e,s=Qn(e,"background"),{min:[o,l],center:[c,u],halfExtents:[h,d]}=this.shapeMap.text.getGeometryBounds(),[f,v,g,p]=Ri(a),y=h*2+p+v,{width:b,height:E}=s;b&&E?Object.assign(s,{x:c-Number(b)/2,y:u-Number(E)/2}):Object.assign(s,{x:o-p,y:l-f,width:r?Math.min(y,i+p+v):y,height:d*2+f+g});const{radius:O}=s;if(typeof O=="string"&&O.endsWith("%")){const P=Number(O.replace("%",""))/100;s.radius=Math.min(+s.width,+s.height)*P}return s}render(t=this.parsedAttributes,e=this){this.upsert("text",Os,this.getTextStyle(t),e),this.upsert("background",gr,this.getBackgroundStyle(t),e)}getGeometryBounds(){return(this.getShape("background")||this.getShape("text")).getGeometryBounds()}}Wa.defaultStyleProps={padding:0,fontSize:12,fontFamily:"system-ui, sans-serif",wordWrap:!0,maxLines:1,wordWrapWidth:128,textOverflow:"...",textBaseline:"middle",backgroundOpacity:.75,backgroundZIndex:-1,backgroundLineWidth:0};class po extends El{constructor(t){super(ur({style:po.defaultStyleProps},t))}getBadgeStyle(t){return this.getGraphicStyle(t)}render(t=this.parsedAttributes,e=this){this.upsert("label",Wa,this.getBadgeStyle(t),e)}getGeometryBounds(){const t=this.getShape("label");return(t.getShape("background")||t.getShape("text")).getGeometryBounds()}}po.defaultStyleProps={padding:[2,4,2,4],fontSize:10,wordWrap:!1,backgroundRadius:"50%",backgroundOpacity:1};function YN(n,t=!0){const e=[];return n.forEach((r,i)=>{e.push([i===0?"M":"L",...r])}),t&&e.push(["Z"]),e}const Gy={M:["x","y"],m:["dx","dy"],H:["x"],h:["dx"],V:["y"],v:["dy"],L:["x","y"],l:["dx","dy"],Z:[],z:[],C:["x1","y1","x2","y2","x","y"],c:["dx1","dy1","dx2","dy2","dx","dy"],S:["x2","y2","x","y"],s:["dx2","dy2","dx","dy"],Q:["x1","y1","x","y"],q:["dx1","dy1","dx","dy"],T:["x","y"],t:["dx","dy"],A:["rx","ry","rotation","large-arc","sweep","x","y"],a:["rx","ry","rotation","large-arc","sweep","dx","dy"]};function HN(n){const t=n.replace(/[\n\r]/g,"").replace(/-/g," -").replace(/(\d*\.)(\d+)(?=\.)/g,"$1$2 ").trim().split(/\s*,|\s+/),e=[];let r="",i={};for(;t.length>0;){let a=t.shift();a in Gy?r=a:t.unshift(a),i={type:r},Gy[r].forEach(l=>{a=t.shift(),i[l]=a}),r==="M"?r="L":r==="m"&&(r="l");const[s,...o]=Object.values(i);e.push([s,...o.map(Number)])}return e}function XN(n){const t=[];return(typeof n=="string"?HN(n):n).forEach(r=>{const i=r[0];if(i==="Z"){t.push(t[0]);return}if(i!=="A")for(let a=1;a<r.length;a=a+2)t.push([r[a],r[a+1],0]);else{const a=r.length;t.push([r[a-2],r[a-1],0])}}),t}const Vy=n=>{if(n.length<2)return[["M",0,0],["L",0,0]];const t=n[0],e=n[1],r=n[n.length-1],i=n[n.length-2];n.unshift(i,r),n.push(t,e);const a=[["M",r[0],r[1]]];for(let s=1;s<n.length-2;s+=1){const[o,l]=n[s-1],[c,u]=n[s],[h,d]=n[s+1],[f,v]=s!==n.length-2?n[s+2]:[h,d],g=c+(h-o)/6,p=u+(d-l)/6,y=h-(f-c)/6,b=d-(v-u)/6;a.push(["C",g,p,y,b,h,d])}return a};function KN(n,t,e,r,i,a,s){const[o,l]=ma(n,t),c={textAlign:t==="left"?"right":t==="right"?"left":"center",textBaseline:t==="top"?"bottom":t==="bottom"?"top":"middle",transform:[["translate",o+e,l+r]]};if(t==="center"||!i)return c;const u=XN(a);if(!u||u.length<=3)return c;const h=u.map((v,g)=>{const p=v,y=u[(g+1)%u.length];return Zn(p,y)?null:[p,y]}).filter(Boolean),d=TN([o,l],h),f=ky([o,l],d);if(f&&d&&(c.transform=[["translate",f[0]+e,f[1]+r]],s)){const v=Math.atan((d[0][1]-d[1][1])/(d[0][0]-d[1][0]));c.transform.push(["rotate",v/Math.PI*180]),c.textAlign="center",(t==="right"||t==="left")&&(v>0?c.textBaseline=t==="right"?"bottom":"top":c.textBaseline=t==="right"?"top":"bottom")}return c}var QN=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class wl extends El{constructor(t){super(ur({style:wl.defaultStyleProps},t))}getLabelStyle(t){if(!t.label||!t.d||t.d.length===0)return!1;const e=Qn(this.getGraphicStyle(t),"label"),{maxWidth:r,offsetX:i,offsetY:a,autoRotate:s,placement:o,closeToPath:l}=e,c=QN(e,["maxWidth","offsetX","offsetY","autoRotate","placement","closeToPath"]),u=this.shapeMap.key,h=u==null?void 0:u.getRenderBounds();return Object.assign(KN(h,o,i,a,l,t.d,s),{wordWrapWidth:Zy(h,r)},c)}getKeyStyle(t){return this.getGraphicStyle(t)}render(t,e){this.upsert("key",ni,this.getKeyStyle(t),e),this.upsert("label",Wa,this.getLabelStyle(t),e)}}wl.defaultStyleProps={label:!0,labelPlacement:"bottom",labelCloseToPath:!0,labelAutoRotate:!0,labelOffsetX:0,labelOffsetY:0};function qN(n){const t=[],e=r=>{r!=null&&r.children.length&&r.children.forEach(i=>{t.push(i),e(i)})};return e(n),t}function JN(n){const t=[];let e=n.parentNode;for(;e;)t.push(e),e=e.parentNode;return t}class Jf extends sl{constructor(t){super(t),this.onMounted=()=>{this.handleRadius()},this.onAttrModified=()=>{this.handleRadius()},mo=this,this.isMutationObserved=!0,this.addEventListener(De.MOUNTED,this.onMounted),this.addEventListener(De.ATTR_MODIFIED,this.onAttrModified)}handleRadius(){const{radius:t,clipPath:e,width:r=0,height:i=0}=this.attributes;if(t&&r&&i){const[a,s]=this.getBounds().min,o={x:a,y:s,radius:t,width:r,height:i};if(e)Object.assign(this.parsedStyle.clipPath.style,o);else{const l=new gr({style:o});this.style.clipPath=l}}else e&&(this.style.clipPath=null)}}const $f=new WeakMap;let mo=null;const tv=n=>{if(mo&&JN(mo).includes(n)){const t=$f.get(n);t?t.includes(mo)||t.push(mo):$f.set(n,[mo])}},ev=n=>{const t=$f.get(n);t&&t.forEach(e=>e.handleRadius())};class Uy extends El{constructor(t){super(t)}isImage(){const{src:t}=this.attributes;return!!t}getIconStyle(t=this.attributes){const{width:e=0,height:r=0}=t,i=this.getGraphicStyle(t);return this.isImage()?Object.assign({x:-e/2,y:-r/2},i):Object.assign({textBaseline:"middle",textAlign:"center"},i)}render(t=this.attributes,e=this){this.upsert("icon",this.isImage()?Jf:Os,this.getIconStyle(t),e)}}class Yy extends El{get context(){return this.config.context}get parsedAttributes(){return this.attributes}onframe(){}animate(t,e){const r=super.animate(t,e);return r&&(r.onframe=()=>this.onframe(),r.finished.then(()=>this.onframe())),r}}var pu=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Fi extends Yy{constructor(t){super(ur({style:Fi.defaultStyleProps},t)),this.type="node"}getSize(t=this.attributes){const{size:e}=t;return si(e)}getKeyStyle(t){const e=this.getGraphicStyle(t);return Object.assign(Iy(e,["label","halo","icon","badge","port"]))}getLabelStyle(t){if(t.label===!1||!t.labelText)return!1;const e=Qn(this.getGraphicStyle(t),"label"),{placement:r,maxWidth:i,offsetX:a,offsetY:s}=e,o=pu(e,["placement","maxWidth","offsetX","offsetY"]),l=this.getShape("key").getLocalBounds();return Object.assign(A1(l,r,a,s),{wordWrapWidth:Zy(l,i)},o)}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getKeyStyle(t),{fill:r}=e,i=pu(e,["fill"]),a=Qn(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign(Object.assign({},i),{stroke:r}),a)}getIconStyle(t){if(t.icon===!1||!t.iconText&&!t.iconSrc)return!1;const e=Qn(this.getGraphicStyle(t),"icon");return Object.assign(_N(t.size,e),e)}getBadgesStyle(t){var e;const r=Qf(this.shapeMap,"badge-"),i={};if(Object.keys(r).forEach(h=>{i[h]=!1}),t.badge===!1||!(!((e=t.badges)===null||e===void 0)&&e.length))return i;const{badges:a=[],badgePalette:s,opacity:o=1}=t,l=pu(t,["badges","badgePalette","opacity"]),c=zy(s),u=Qn(this.getGraphicStyle(l),"badge");return a.forEach((h,d)=>{i[d]=Object.assign(Object.assign({backgroundFill:c?c[d%(c==null?void 0:c.length)]:void 0,opacity:o},u),this.getBadgeStyle(h))}),i}getBadgeStyle(t){const e=this.getShape("key"),{placement:r="top",offsetX:i,offsetY:a}=t,s=pu(t,["placement","offsetX","offsetY"]),o=A1(e.getLocalBounds(),r,i,a,!0);return Object.assign(Object.assign({},o),s)}getPortsStyle(t){var e;const r=this.getPorts(),i={};if(Object.keys(r).forEach(o=>{i[o]=!1}),t.port===!1||!(!((e=t.ports)===null||e===void 0)&&e.length))return i;const a=Qn(this.getGraphicStyle(t),"port"),{ports:s=[]}=t;return s.forEach((o,l)=>{const c=o.key||l,u=Object.assign(Object.assign({},a),o);if(w1(u))i[c]=!1;else{const[h,d]=this.getPortXY(t,o);i[c]=Object.assign({transform:[["translate",h,d]]},u)}}),i}getPortXY(t,e){const{placement:r="left"}=e,i=this.getShape("key");return gv($N(this.context,i),r)}getPorts(){return Qf(this.shapeMap,"port-")}getCenter(){return this.getShape("key").getBounds().center}getIntersectPoint(t,e=!1){const r=this.getShape("key").getBounds();return MN(t,r,e)}drawHaloShape(t,e){const r=this.getHaloStyle(t),i=this.getShape("key");this.upsert("halo",i.constructor,r,e)}drawIconShape(t,e){const r=this.getIconStyle(t);this.upsert("icon",Uy,r,e),tv(this)}drawBadgeShapes(t,e){const r=this.getBadgesStyle(t);Object.keys(r).forEach(i=>{const a=r[i];this.upsert(`badge-${i}`,po,a,e)})}drawPortShapes(t,e){const r=this.getPortsStyle(t);Object.keys(r).forEach(i=>{const a=r[i],s=`port-${i}`;this.upsert(s,Ji,a,e)})}drawLabelShape(t,e){const r=this.getLabelStyle(t);this.upsert("label",Wa,r,e)}_drawKeyShape(t,e){return this.drawKeyShape(t,e)}render(t=this.parsedAttributes,e=this){this._drawKeyShape(t,e),this.getShape("key")&&(this.drawHaloShape(t,e),this.drawIconShape(t,e),this.drawBadgeShapes(t,e),this.drawLabelShape(t,e),this.drawPortShapes(t,e))}update(t){super.update(t),t&&("x"in t||"y"in t||"z"in t)&&ev(this)}onframe(){this.drawBadgeShapes(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this)}}Fi.defaultStyleProps={x:0,y:0,size:32,droppable:!0,draggable:!0,port:!0,ports:[],portZIndex:2,portLinkToCenter:!1,badge:!0,badges:[],badgeZIndex:3,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloStrokeOpacity:.25,haloPointerEvents:"none",haloZIndex:-1,icon:!0,iconZIndex:1,label:!0,labelIsBillboard:!0,labelMaxWidth:"200%",labelPlacement:"bottom",labelWordWrap:!1,labelZIndex:0};function $N(n,t){if(!n)return t.getLocalBounds();const e=n.canvas.getLayer(),r=t.cloneNode();Ps(r,"hidden"),e.appendChild(r);const i=r.getLocalBounds();return r.destroy(),i}class Ds extends Fi{constructor(t){super(ur({style:Ds.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",Ji,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t);return Object.assign(Object.assign({},e),{r:Math.min(...this.getSize(t))/2})}getIconStyle(t){const e=super.getIconStyle(t),{r}=this.getShape("key").attributes,i=r*2*ya;return e?Object.assign({width:i,height:i},e):!1}getIntersectPoint(t,e=!1){const r=this.getShape("key").getBounds();return du(t,r,e)}}Ds.defaultStyleProps={size:32};class mu extends Fi{constructor(t){super(t)}get parsedAttributes(){return this.attributes}drawKeyShape(t,e){return this.upsert("key",Ts,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t);return Object.assign(Object.assign({},e),{points:this.getPoints(t)})}getIntersectPoint(t,e=!1){var r,i;const{points:a}=this.getShape("key").attributes,s=[+(((r=this.attributes)===null||r===void 0?void 0:r.x)||0),+(((i=this.attributes)===null||i===void 0?void 0:i.y)||0)];return Ny(t,s,a,!0,e).point}}class tk extends mu{constructor(t){super(t)}getPoints(t){const[e,r]=this.getSize(t);return V3(e,r)}}var ek=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class yu extends Ds{constructor(t){super(ur({style:yu.defaultStyleProps},t))}parseOuterR(){const{size:t}=this.parsedAttributes;return Math.min(...si(t))/2}parseInnerR(){const{innerR:t}=this.parsedAttributes;return Ge(t)?parseInt(t)/100*this.parseOuterR():t}drawDonutShape(t,e){const{donuts:r}=t;if(!(r!=null&&r.length))return;const i=r.map(h=>ie(h)?{value:h}:h),a=Qn(this.getGraphicStyle(t),"donut"),s=zy(t.donutPalette);if(!s)return;const o=i.reduce((h,d)=>{var f;return h+((f=d.value)!==null&&f!==void 0?f:0)},0),l=this.parseOuterR(),c=this.parseInnerR();let u=0;i.forEach((h,d)=>{const{value:f=0,color:v=s[d%s.length]}=h,g=ek(h,["value","color"]),p=(o===0?1/i.length:f/o)*360;this.upsert(`round${d}`,ni,Object.assign(Object.assign(Object.assign({},a),{d:ik(l,c,u,u+p),fill:v}),g),e),u+=p})}render(t,e=this){super.render(t,e),this.drawDonutShape(t,e)}}yu.defaultStyleProps={innerR:"50%",donuts:[],donutPalette:"tableau"};const bu=(n,t,e,r)=>[n+Math.sin(r)*e,t-Math.cos(r)*e],nk=(n,t,e,r)=>r<=0||e<=r?[["M",n-e,t],["A",e,e,0,1,1,n+e,t],["A",e,e,0,1,1,n-e,t],["Z"]]:[["M",n-e,t],["A",e,e,0,1,1,n+e,t],["A",e,e,0,1,1,n-e,t],["Z"],["M",n+r,t],["A",r,r,0,1,0,n-r,t],["A",r,r,0,1,0,n+r,t],["Z"]],rk=(n,t,e,r,i,a)=>{const[s,o]=[i/360*2*Math.PI,a/360*2*Math.PI],l=[bu(n,t,r,s),bu(n,t,e,s),bu(n,t,e,o),bu(n,t,r,o)],c=o-s>Math.PI?1:0;return[["M",l[0][0],l[0][1]],["L",l[1][0],l[1][1]],["A",e,e,0,c,1,l[2][0],l[2][1]],["L",l[3][0],l[3][1]],["A",r,r,0,c,0,l[0][0],l[0][1]],["Z"]]},ik=(n=0,t=0,e,r)=>{const[i,a]=[0,0];return Math.abs(e-r)%360<1e-6?nk(i,a,n,t):rk(i,a,n,t,e,r)};class xu extends Fi{constructor(t){super(ur({style:xu.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",al,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t),[r,i]=this.getSize(t);return Object.assign(Object.assign({},e),{rx:r/2,ry:i/2})}getIconStyle(t){const e=super.getIconStyle(t),{rx:r,ry:i}=this.getShape("key").attributes,a=Math.min(+r,+i)*2*ya;return e?Object.assign({width:a,height:a},e):!1}getIntersectPoint(t,e=!1){const r=this.getShape("key").getBounds();return du(t,r,e)}}xu.defaultStyleProps={size:[45,35]};class ak extends mu{constructor(t){super(t)}getOuterR(t){return t.outerR||Math.min(...this.getSize(t))/2}getPoints(t){return Y3(this.getOuterR(t))}getIconStyle(t){const e=super.getIconStyle(t),r=this.getOuterR(t)*ya;return e?Object.assign({width:r,height:r},e):!1}}function sk(n,t){var e=t.cx,r=e===void 0?0:e,i=t.cy,a=i===void 0?0:i,s=t.r;n.arc(r,a,s,0,Math.PI*2,!1)}function ok(n,t){var e=t.cx,r=e===void 0?0:e,i=t.cy,a=i===void 0?0:i,s=t.rx,o=t.ry;if(n.ellipse)n.ellipse(r,a,s,o,0,0,Math.PI*2,!1);else{var l=s>o?s:o,c=s>o?1:s/o,u=s>o?o/s:1;n.save(),n.scale(c,u),n.arc(r,a,l,0,Math.PI*2)}}function lk(n,t){var e=t.x1,r=t.y1,i=t.x2,a=t.y2,s=t.markerStart,o=t.markerEnd,l=t.markerStartOffset,c=t.markerEndOffset,u=0,h=0,d=0,f=0,v=0,g,p;s&&Ve(s)&&l&&(g=i-e,p=a-r,v=Math.atan2(p,g),u=Math.cos(v)*(l||0),h=Math.sin(v)*(l||0)),o&&Ve(o)&&c&&(g=e-i,p=r-a,v=Math.atan2(p,g),d=Math.cos(v)*(c||0),f=Math.sin(v)*(c||0)),n.moveTo(e+u,r+h),n.lineTo(i+d,a+f)}function ck(n,t){var e=t.markerStart,r=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,s=t.d,o=s.absolutePath,l=s.segments,c=0,u=0,h=0,d=0,f=0,v,g;if(e&&Ve(e)&&i){var p=e.parentNode.getStartTangent(),y=(0,R.Z)(p,2),b=y[0],E=y[1];v=b[0]-E[0],g=b[1]-E[1],f=Math.atan2(g,v),c=Math.cos(f)*(i||0),u=Math.sin(f)*(i||0)}if(r&&Ve(r)&&a){var O=r.parentNode.getEndTangent(),P=(0,R.Z)(O,2),L=P[0],F=P[1];v=L[0]-F[0],g=L[1]-F[1],f=Math.atan2(g,v),h=Math.cos(f)*(a||0),d=Math.sin(f)*(a||0)}for(var I=0;I<o.length;I++){var V=o[I],Y=V[0],J=o[I+1],$=I===0&&(c!==0||u!==0),ot=(I===o.length-1||J&&(J[0]==="M"||J[0]==="Z"))&&h!==0&&d!==0,ct=$?[c,u]:[0,0],ft=(0,R.Z)(ct,2),Nt=ft[0],Ot=ft[1],mt=ot?[h,d]:[0,0],yt=(0,R.Z)(mt,2),Rt=yt[0],jt=yt[1];switch(Y){case"M":n.moveTo(V[1]+Nt,V[2]+Ot);break;case"L":n.lineTo(V[1]+Rt,V[2]+jt);break;case"Q":n.quadraticCurveTo(V[1],V[2],V[3]+Rt,V[4]+jt);break;case"C":n.bezierCurveTo(V[1],V[2],V[3],V[4],V[5]+Rt,V[6]+jt);break;case"A":{var Xt=l[I].arcParams,ee=Xt.cx,ae=Xt.cy,he=Xt.rx,ce=Xt.ry,xe=Xt.startAngle,Ce=Xt.endAngle,je=Xt.xRotation,Ue=Xt.sweepFlag;if(n.ellipse)n.ellipse(ee,ae,he,ce,je,xe,Ce,!!(1-Ue));else{var or=he>ce?he:ce,Ke=he>ce?1:he/ce,ui=he>ce?ce/he:1;n.translate(ee,ae),n.rotate(je),n.scale(Ke,ui),n.arc(0,0,or,xe,Ce,!!(1-Ue)),n.scale(1/Ke,1/ui),n.rotate(-je),n.translate(-ee,-ae)}ot&&n.lineTo(V[6]+h,V[7]+d);break}case"Z":n.closePath();break}}}function uk(n,t){var e=t.markerStart,r=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,s=t.points.points,o=s.length,l=s[0][0],c=s[0][1],u=s[o-1][0],h=s[o-1][1],d=0,f=0,v=0,g=0,p=0,y,b;e&&Ve(e)&&i&&(y=s[1][0]-s[0][0],b=s[1][1]-s[0][1],p=Math.atan2(b,y),d=Math.cos(p)*(i||0),f=Math.sin(p)*(i||0)),r&&Ve(r)&&a&&(y=s[o-1][0]-s[0][0],b=s[o-1][1]-s[0][1],p=Math.atan2(b,y),v=Math.cos(p)*(a||0),g=Math.sin(p)*(a||0)),n.moveTo(l+(d||v),c+(f||g));for(var E=1;E<o-1;E++){var O=s[E];n.lineTo(O[0],O[1])}n.lineTo(u,h)}function hk(n,t){var e=t.markerStart,r=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,s=t.points.points,o=s.length,l=s[0][0],c=s[0][1],u=s[o-1][0],h=s[o-1][1],d=0,f=0,v=0,g=0,p=0,y,b;e&&Ve(e)&&i&&(y=s[1][0]-s[0][0],b=s[1][1]-s[0][1],p=Math.atan2(b,y),d=Math.cos(p)*(i||0),f=Math.sin(p)*(i||0)),r&&Ve(r)&&a&&(y=s[o-2][0]-s[o-1][0],b=s[o-2][1]-s[o-1][1],p=Math.atan2(b,y),v=Math.cos(p)*(a||0),g=Math.sin(p)*(a||0)),n.moveTo(l+d,c+f);for(var E=1;E<o-1;E++){var O=s[E];n.lineTo(O[0],O[1])}n.lineTo(u+v,h+g)}function dk(n,t){var e=t.x,r=e===void 0?0:e,i=t.y,a=i===void 0?0:i,s=t.radius,o=t.width,l=t.height,c=o,u=l,h=s&&s.some(function(P){return P!==0});if(!h)n.rect(r,a,c,u);else{var d=o>0?1:-1,f=l>0?1:-1,v=d+f===0,g=s.map(function(P){return kn(P,0,Math.min(Math.abs(c)/2,Math.abs(u)/2))}),p=(0,R.Z)(g,4),y=p[0],b=p[1],E=p[2],O=p[3];n.moveTo(d*y+r,a),n.lineTo(c-d*b+r,a),b!==0&&n.arc(c-d*b+r,f*b+a,b,-f*Math.PI/2,d>0?0:Math.PI,v),n.lineTo(c+r,u-f*E+a),E!==0&&n.arc(c-d*E+r,u-f*E+a,E,d>0?0:Math.PI,f>0?Math.PI/2:1.5*Math.PI,v),n.lineTo(d*O+r,u+a),O!==0&&n.arc(d*O+r,u-f*O+a,O,f>0?Math.PI/2:-Math.PI/2,d>0?Math.PI:0,v),n.lineTo(r,f*y+a),y!==0&&n.arc(d*y+r,f*y+a,y,d>0?Math.PI:0,f>0?Math.PI*1.5:Math.PI/2,v)}}var fk=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.name="canvas-path-generator",e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"init",value:function(){var r,i=(r={},(0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(r,Dt.CIRCLE,sk),Dt.ELLIPSE,ok),Dt.RECT,dk),Dt.LINE,lk),Dt.POLYLINE,hk),Dt.POLYGON,uk),Dt.PATH,ck),Dt.TEXT,void 0),Dt.GROUP,void 0),Dt.IMAGE,void 0),(0,se.Z)((0,se.Z)((0,se.Z)(r,Dt.HTML,void 0),Dt.MESH,void 0),Dt.FRAGMENT,void 0));this.context.pathGeneratorFactory=i}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(La);var vk=pt(),gk=pt(),pk=pt(),mk=Wt(),Hy=function(){function n(){var t=this;(0,N.Z)(this,n),this.isHit=function(e,r,i,a){var s=t.context.pointInPathPickerFactory[e.nodeName];if(s){var o=Ze(mk,i),l=re(gk,zt(pk,r[0],r[1],0),o);if(s(e,new vr(l[0],l[1]),a,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,r){var i=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),a=t.context.pathGeneratorFactory[e.nodeName];return a&&(i.beginPath(),a(i,e.parsedStyle),i.closePath()),i.isPointInPath(r.x,r.y)}}return(0,T.Z)(n,[{key:"apply",value:function(e,r){var i,a=this,s=e.renderingService,o=e.renderingContext;this.context=e,this.runtime=r;var l=(i=o.root)===null||i===void 0?void 0:i.ownerDocument;s.hooks.pick.tapPromise(n.tag,function(){var c=(0,Ra.Z)((0,Tr.Z)().mark(function u(h){return(0,Tr.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",a.pick(l,h));case 1:case"end":return d.stop()}},u)}));return function(u){return c.apply(this,arguments)}}()),s.hooks.pickSync.tap(n.tag,function(c){return a.pick(l,c)})}},{key:"pick",value:function(e,r){var i=r.topmost,a=r.position,s=a.x,o=a.y,l=zt(vk,s,o,0),c=e.elementsFromBBox(l[0],l[1],l[0],l[1]),u=[],h=(0,fs.Z)(c),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,v=f.getWorldTransform(),g=this.isHit(f,l,v,!1);if(g){var p=Bp(f);if(p){var y=p.parsedStyle.clipPath,b=this.isHit(y,l,y.getWorldTransform(),!0);if(b){if(i)return r.picked=[f],r;u.push(f)}}else{if(i)return r.picked=[f],r;u.push(f)}}}}catch(E){h.e(E)}finally{h.f()}return r.picked=u,r}}])}();Hy.tag="CanvasPicker";function yk(n,t,e){var r=n.parsedStyle,i=r.cx,a=i===void 0?0:i,s=r.cy,o=s===void 0?0:s,l=r.r,c=r.fill,u=r.stroke,h=r.lineWidth,d=h===void 0?1:h,f=r.increasedLineWidthForHitTesting,v=f===void 0?0:f,g=r.pointerEvents,p=g===void 0?"auto":g,y=(d+v)/2,b=Ar(a,o,t.x,t.y),E=xs(p,c,u),O=(0,R.Z)(E,2),P=O[0],L=O[1];return P&&L||e?b<=l+y:P?b<=l:L?b>=l-y&&b<=l+y:!1}function Eu(n,t,e,r){return n/(e*e)+t/(r*r)}function bk(n,t,e){var r=n.parsedStyle,i=r.cx,a=i===void 0?0:i,s=r.cy,o=s===void 0?0:s,l=r.rx,c=r.ry,u=r.fill,h=r.stroke,d=r.lineWidth,f=d===void 0?1:d,v=r.increasedLineWidthForHitTesting,g=v===void 0?0:v,p=r.pointerEvents,y=p===void 0?"auto":p,b=t.x,E=t.y,O=xs(y,u,h),P=(0,R.Z)(O,2),L=P[0],F=P[1],I=(f+g)/2,V=(b-a)*(b-a),Y=(E-o)*(E-o);return L&&F||e?Eu(V,Y,l+I,c+I)<=1:L?Eu(V,Y,l,c)<=1:F?Eu(V,Y,l-I,c-I)>=1&&Eu(V,Y,l+I,c+I)<=1:!1}function Is(n,t,e,r,i,a){return i>=n&&i<=n+e&&a>=t&&a<=t+r}function xk(n,t,e,r,i,a,s){var o=i/2;return Is(n-o,t-o,e,i,a,s)||Is(n+e-o,t-o,i,r,a,s)||Is(n+o,t+r-o,e,i,a,s)||Is(n-o,t+o,i,r,a,s)}function wu(n,t,e,r,i,a,s,o){var l=(Math.atan2(o-t,s-n)+Math.PI*2)%(Math.PI*2),c={x:n+e*Math.cos(l),y:t+e*Math.sin(l)};return Ar(c.x,c.y,s,o)<=a/2}function Ga(n,t,e,r,i,a,s){var o=Math.min(n,e),l=Math.max(n,e),c=Math.min(t,r),u=Math.max(t,r),h=i/2;return a>=o-h&&a<=l+h&&s>=c-h&&s<=u+h?_g(n,t,e,r,a,s)<=i/2:!1}function Xy(n,t,e,r,i){var a=n.length;if(a<2)return!1;for(var s=0;s<a-1;s++){var o=n[s][0],l=n[s][1],c=n[s+1][0],u=n[s+1][1];if(Ga(o,l,c,u,t,e,r))return!0}if(i){var h=n[0],d=n[a-1];if(Ga(h[0],h[1],d[0],d[1],t,e,r))return!0}return!1}var Ek=1e-6;function nv(n){return Math.abs(n)<Ek?0:n<0?-1:1}function wk(n,t,e){return(e[0]-n[0])*(t[1]-n[1])===(t[0]-n[0])*(e[1]-n[1])&&Math.min(n[0],t[0])<=e[0]&&e[0]<=Math.max(n[0],t[0])&&Math.min(n[1],t[1])<=e[1]&&e[1]<=Math.max(n[1],t[1])}function Ky(n,t,e){var r=!1,i=n.length;if(i<=2)return!1;for(var a=0;a<i;a++){var s=n[a],o=n[(a+1)%i];if(wk(s,o,[t,e]))return!0;nv(s[1]-e)>0!=nv(o[1]-e)>0&&nv(t-(e-s[1])*(s[0]-o[0])/(s[1]-o[1])-s[0])<0&&(r=!r)}return r}function Qy(n,t,e){for(var r=!1,i=0;i<n.length;i++){var a=n[i];if(r=Ky(a,t,e),r)break}return r}function Sk(n,t,e){var r=n.parsedStyle,i=r.x1,a=r.y1,s=r.x2,o=r.y2,l=r.lineWidth,c=l===void 0?1:l,u=r.increasedLineWidthForHitTesting,h=u===void 0?0:u,d=r.pointerEvents,f=d===void 0?"auto":d,v=r.fill,g=r.stroke,p=xs(f,v,g),y=(0,R.Z)(p,2),b=y[1];return!b&&!e||!c?!1:Ga(i,a,s,o,c+h,t.x,t.y)}function Mk(n,t,e,r,i){for(var a=!1,s=t/2,o=0;o<n.length;o++){var l=n[o],c=l.currentPoint,u=l.params,h=l.prePoint,d=l.box;if(!(d&&!Is(d.x-s,d.y-s,d.width+t,d.height+t,e,r)))switch(l.command){case"L":case"Z":if(a=Ga(h[0],h[1],c[0],c[1],t,e,r),a)return!0;break;case"Q":var f=L2(h[0],h[1],u[1],u[2],u[3],u[4],e,r);if(a=f<=t/2,a)return!0;break;case"C":var v=Bg(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],e,r,i);if(a=v<=t/2,a)return!0;break;case"A":l.cubicParams||(l.cubicParams=Od(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var g=l.cubicParams,p=h,y=0;y<g.length;y+=6){var b=Bg(p[0],p[1],g[y],g[y+1],g[y+2],g[y+3],g[y+4],g[y+5],e,r,i);if(p=[g[y+4],g[y+5]],a=b<=t/2,a)return!0}break}}return a}function Ak(n,t,e,r,i,a){var s=n.parsedStyle,o=s.lineWidth,l=o===void 0?1:o,c=s.increasedLineWidthForHitTesting,u=c===void 0?0:c,h=s.stroke,d=s.fill,f=s.d,v=s.pointerEvents,g=v===void 0?"auto":v,p=f.segments,y=f.hasArc,b=f.polylines,E=f.polygons,O=xs(g,(E==null?void 0:E.length)&&d,h),P=(0,R.Z)(O,2),L=P[0],F=P[1],I=Xd(n),V=!1;return L||e?(y?V=r(n,t):V=Qy(E,t.x,t.y)||Qy(b,t.x,t.y),V):((F||e)&&(V=Mk(p,l+u,t.x,t.y,I)),V)}function Tk(n,t,e){var r=n.parsedStyle,i=r.stroke,a=r.fill,s=r.lineWidth,o=s===void 0?1:s,l=r.increasedLineWidthForHitTesting,c=l===void 0?0:l,u=r.points,h=r.pointerEvents,d=h===void 0?"auto":h,f=xs(d,a,i),v=(0,R.Z)(f,2),g=v[0],p=v[1],y=!1;return(p||e)&&(y=Xy(u.points,o+c,t.x,t.y,!0)),!y&&(g||e)&&(y=Ky(u.points,t.x,t.y)),y}function Ok(n,t,e){var r=n.parsedStyle,i=r.lineWidth,a=i===void 0?1:i,s=r.increasedLineWidthForHitTesting,o=s===void 0?0:s,l=r.points,c=r.pointerEvents,u=c===void 0?"auto":c,h=r.fill,d=r.stroke,f=xs(u,h,d),v=(0,R.Z)(f,2),g=v[1];return!g&&!e||!a?!1:Xy(l.points,a+o,t.x,t.y,!1)}function Ck(n,t,e,r,i){var a=n.parsedStyle,s=a.radius,o=a.fill,l=a.stroke,c=a.lineWidth,u=c===void 0?1:c,h=a.increasedLineWidthForHitTesting,d=h===void 0?0:h,f=a.x,v=f===void 0?0:f,g=a.y,p=g===void 0?0:g,y=a.width,b=a.height,E=a.pointerEvents,O=E===void 0?"auto":E,P=xs(O,o,l),L=(0,R.Z)(P,2),F=L[0],I=L[1],V=s&&s.some(function(ot){return ot!==0}),Y=u+d;if(V){var $=!1;return(I||e)&&($=Nk(v,p,y,b,s.map(function(ot){return kn(ot,0,Math.min(Math.abs(y)/2,Math.abs(b)/2))}),Y,t.x,t.y)),!$&&(F||e)&&($=r(n,t)),$}else{var J=Y/2;if(F&&I||e)return Is(v-J,p-J,y+J,b+J,t.x,t.y);if(F)return Is(v,p,y,b,t.x,t.y);if(I)return xk(v,p,y,b,Y,t.x,t.y)}return!1}function Nk(n,t,e,r,i,a,s,o){var l=(0,R.Z)(i,4),c=l[0],u=l[1],h=l[2],d=l[3];return Ga(n+c,t,n+e-u,t,a,s,o)||Ga(n+e,t+u,n+e,t+r-h,a,s,o)||Ga(n+e-h,t+r,n+d,t+r,a,s,o)||Ga(n,t+r-d,n,t+c,a,s,o)||wu(n+e-u,t+u,u,1.5*Math.PI,2*Math.PI,a,s,o)||wu(n+e-h,t+r-h,h,0,.5*Math.PI,a,s,o)||wu(n+d,t+r-d,d,.5*Math.PI,Math.PI,a,s,o)||wu(n+c,t+c,c,Math.PI,1.5*Math.PI,a,s,o)}function kk(n,t,e,r,i,a){var s=n.parsedStyle,o=s.pointerEvents,l=o===void 0?"auto":o,c=s.x,u=c===void 0?0:c,h=s.y,d=h===void 0?0:h,f=s.width,v=s.height;if(l==="non-transparent-pixel"){var g=i.config.offscreenCanvas,p=a.offscreenCanvasCreator.getOrCreateCanvas(g),y=a.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});p.width=f,p.height=v,i.defaultStyleRendererFactory[Dt.IMAGE].render(y,(0,B.Z)((0,B.Z)({},n.parsedStyle),{},{x:0,y:0}),n,void 0,void 0,void 0);var b=y.getImageData(t.x-u,t.y-d,1,1).data;return b.every(function(E){return E!==0})}return!0}function Pk(n,t,e,r){var i=n.getGeometryBounds();return t.x>=i.min[0]&&t.y>=i.min[1]&&t.x<=i.max[0]&&t.y<=i.max[1]}var Rk=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.name="canvas-picker",e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"init",value:function(){var r,i=(r={},(0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(r,Dt.CIRCLE,yk),Dt.ELLIPSE,bk),Dt.RECT,Ck),Dt.LINE,Sk),Dt.POLYLINE,Ok),Dt.POLYGON,Tk),Dt.PATH,Ak),Dt.TEXT,Pk),Dt.GROUP,null),Dt.IMAGE,kk),(0,se.Z)((0,se.Z)(r,Dt.HTML,null),Dt.MESH,null));this.context.pointInPathPickerFactory=i,this.addRenderingPlugin(new Hy)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(La);function ia(n,t){if(!{}.hasOwnProperty.call(n,t))throw new TypeError("attempted to use private field on non-instance");return n}var Lk=0;function _k(n){return"__private_"+Lk+++"_"+n}var Dk=function(){function n(){(0,N.Z)(this,n),this.cacheStore=new Map}return(0,T.Z)(n,[{key:"onRefAdded",value:function(e){}},{key:"has",value:function(e){return this.cacheStore.has(e)}},{key:"put",value:function(e,r,i){return this.cacheStore.has(e)?!1:(this.cacheStore.set(e,{value:r,counter:new Set([i.entity])}),this.onRefAdded(i),!0)}},{key:"get",value:function(e,r){var i=this.cacheStore.get(e);return i?(i.counter.has(r.entity)||(i.counter.add(r.entity),this.onRefAdded(r)),i.value):null}},{key:"update",value:function(e,r,i){var a=this.cacheStore.get(e);return a?(a.value=(0,B.Z)((0,B.Z)({},a.value),r),a.counter.has(i.entity)||(a.counter.add(i.entity),this.onRefAdded(i)),!0):!1}},{key:"release",value:function(e,r){var i=this.cacheStore.get(e);return i?(i.counter.delete(r.entity),i.counter.size<=0&&this.cacheStore.delete(e),!0):!1}},{key:"releaseRef",value:function(e){var r=this;Array.from(this.cacheStore.keys()).forEach(function(i){r.release(i,e)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),rv=[],iv=[],av=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,null,[{key:"stop",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n.api;n.rafId&&(e.cancelAnimationFrame(n.rafId),n.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n.api;rv.length<=0&&iv.length<=0||(iv.forEach(function(r){return r()}),iv=rv.splice(0,n.TASK_NUM_PER_FRAME),n.rafId=e.requestAnimationFrame(function(){n.executeTask(e)}))}},{key:"sliceImage",value:function(e,r,i,a){for(var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:n.api,l=e.naturalWidth||e.width,c=e.naturalHeight||e.height,u=r-s,h=i-s,d=Math.ceil(l/u),f=Math.ceil(c/h),v={tileSize:[r,i],gridSize:[f,d],tiles:Array(f).fill(null).map(function(){return Array(d).fill(null)})},g=function(b){for(var E=function(L){rv.push(function(){var F=L*u,I=b*h,V=[Math.min(r,l-F),Math.min(i,c-I)],Y=V[0],J=V[1],$=o.createCanvas();$.width=r,$.height=i;var ot=$.getContext("2d");ot.drawImage(e,F,I,Y,J,0,0,Y,J),v.tiles[b][L]={x:F,y:I,tileX:L,tileY:b,data:$},a()})},O=0;O<d;O++)E(O)},p=0;p<f;p++)g(p);return n.stop(),n.executeTask(),v}}])}();av.TASK_NUM_PER_FRAME=10;var oi=new Dk;oi.onRefAdded=function(t){var e=this;t.addEventListener(De.DESTROY,function(){e.releaseRef(t)},{once:!0})};var sv=function(){function n(t,e){(0,N.Z)(this,n),this.gradientCache={},this.patternCache={},this.context=t,this.runtime=e}return(0,T.Z)(n,[{key:"getImageSync",value:function(e,r,i){var a=Ge(e)?e:e.src;if(oi.has(a)){var s=oi.get(a,r);if(s.img.complete)return i==null||i(s),s}return this.getOrCreateImage(e,r).then(function(o){i==null||i(o)}).catch(function(o){console.error(o)}),null}},{key:"getOrCreateImage",value:function(e,r){var i=this,a=Ge(e)?e:e.src;if(!Ge(e)&&!oi.has(a)){var s={img:e,size:[e.naturalWidth||e.width,e.naturalHeight||e.height],tileSize:Su(e)};oi.put(a,s,r)}if(oi.has(a)){var o=oi.get(a,r);return o.img.complete?Promise.resolve(o):new Promise(function(l,c){o.img.addEventListener("load",function(){o.size=[o.img.naturalWidth||o.img.width,o.img.naturalHeight||o.img.height],o.tileSize=Su(o.img),l(o)}),o.img.addEventListener("error",function(u){c(u)})})}return new Promise(function(l,c){var u=i.context.config.createImage();if(u){var h={img:u,size:[0,0],tileSize:Su(u)};oi.put(a,h,r),u.onload=function(){h.size=[u.naturalWidth||u.width,u.naturalHeight||u.height],h.tileSize=Su(h.img),l(h)},u.onerror=function(d){c(d)},u.crossOrigin="Anonymous",u.src=a}})}},{key:"createDownSampledImage",value:function(){var t=(0,Ra.Z)((0,Tr.Z)().mark(function r(i,a){var s,o,l,c,u,h,d,f,v,g,p,y,b,E;return(0,Tr.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=1,this.getOrCreateImage(i,a);case 1:if(s=O.sent,typeof s.downSamplingRate=="undefined"){O.next=2;break}return O.abrupt("return",s);case 2:if(o=this.context.config.enableLargeImageOptimization,l=typeof o=="boolean"?{}:o,c=l.maxDownSampledImageSize,u=c===void 0?2048:c,h=l.downSamplingRateThreshold,d=h===void 0?.5:h,f=this.runtime.globalThis.createImageBitmap,v=(0,R.Z)(s.size,2),g=v[0],p=v[1],y=s.img,b=Math.min((u+u)/(g+p),Math.max(.01,Math.min(d,.5))),E=(0,B.Z)((0,B.Z)({},s),{},{downSamplingRate:b}),oi.update(s.img.src,E,a),!f){O.next=7;break}return O.prev=3,O.next=4,f(s.img,{resizeWidth:g*b,resizeHeight:p*b});case 4:y=O.sent,O.next=6;break;case 5:O.prev=5,O.catch(3),b=1;case 6:O.next=8;break;case 7:b=1;case 8:return E=(0,B.Z)((0,B.Z)({},this.getImageSync(i,a)),{},{downSampled:y,downSamplingRate:b}),oi.update(s.img.src,E,a),O.abrupt("return",E);case 9:case"end":return O.stop()}},r,this,[[3,5]])}));function e(r,i){return t.apply(this,arguments)}return e}()},{key:"createImageTiles",value:function(){var t=(0,Ra.Z)((0,Tr.Z)().mark(function r(i,a,s,o){var l,c,u,h,d;return(0,Tr.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=1,this.getOrCreateImage(i,o);case 1:return l=f.sent,c=o.ownerDocument.defaultView,u=c.requestAnimationFrame,h=c.cancelAnimationFrame,av.api={requestAnimationFrame:u,cancelAnimationFrame:h,createCanvas:function(){return cf.createCanvas()}},d=(0,B.Z)((0,B.Z)({},l),av.sliceImage(l.img,l.tileSize[0],l.tileSize[0],s)),oi.update(l.img.src,d,o),f.abrupt("return",d);case 2:case"end":return f.stop()}},r,this)}));function e(r,i,a,s){return t.apply(this,arguments)}return e}()},{key:"releaseImage",value:function(e,r){oi.release(Ge(e)?e:e.src,r)}},{key:"releaseImageRef",value:function(e){oi.releaseRef(e)}},{key:"getOrCreatePatternSync",value:function(e,r,i,a,s,o,l){var c=this.generatePatternKey(r);if(c&&this.patternCache[c])return this.patternCache[c];var u=r.image,h=r.repetition,d=r.transform,f,v=!1;if(Ge(u)){var g=this.getImageSync(u,e,l);f=g==null?void 0:g.img}else a?(f=a,v=!0):f=u;var p=f&&i.createPattern(f,h);if(p){var y;d?y=Hp(kp(d),new yn({})):y=ge(Wt()),v&&fn(y,y,[1/s,1/s,1]),p.setTransform({a:y[0],b:y[1],c:y[4],d:y[5],e:y[12]+o[0],f:y[13]+o[1]})}return c&&p&&(this.patternCache[c]=p),p}},{key:"getOrCreateGradient",value:function(e,r){var i=this.generateGradientKey(e),a=e.type,s=e.steps,o=e.min,l=e.width,c=e.height,u=e.angle,h=e.cx,d=e.cy,f=e.size;if(this.gradientCache[i])return this.gradientCache[i];var v=null;if(a===_a.LinearGradient){var g=PS(o,l,c,u),p=g.x1,y=g.y1,b=g.x2,E=g.y2;v=r.createLinearGradient(p,y,b,E)}else if(a===_a.RadialGradient){var O=RS(o,l,c,h,d,f),P=O.x,L=O.y,F=O.r;v=r.createRadialGradient(P,L,0,P,L,F)}return v&&(s.forEach(function(I){var V=I.offset,Y=I.color;if(V.unit===te.kPercentage){var J;(J=v)===null||J===void 0||J.addColorStop(V.value/100,Y.toString())}}),this.gradientCache[i]=v),this.gradientCache[i]}},{key:"generateGradientKey",value:function(e){var r=e.type,i=e.min,a=e.width,s=e.height,o=e.steps,l=e.angle,c=e.cx,u=e.cy,h=e.size;return"gradient-".concat(r,"-").concat((l==null?void 0:l.toString())||0,"-").concat((c==null?void 0:c.toString())||0,"-").concat((u==null?void 0:u.toString())||0,"-").concat((h==null?void 0:h.toString())||0,"-").concat(i[0],"-").concat(i[1],"-").concat(a,"-").concat(s,"-").concat(o.map(function(d){var f=d.offset,v=d.color;return"".concat(f).concat(v)}).join("-"))}},{key:"generatePatternKey",value:function(e){var r=e.image,i=e.repetition;if(Ge(r))return"pattern-".concat(r,"-").concat(i);if(r.nodeName==="rect")return"pattern-".concat(r.entity,"-").concat(i)}}])}();sv.isSupportTile=!!cf.createCanvas();function Su(n){if(!n.complete)return[0,0];var t=n.naturalWidth||n.width,e=n.naturalHeight||n.height,r=256;return[256,512].forEach(function(i){var a=Math.ceil(e/i),s=Math.ceil(t/i);a*s<1e3&&(r=i)}),[r,r]}var qy=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"apply",value:function(e){var r=e.renderingService,i=e.renderingContext,a=e.imagePool,s=i.root.ownerDocument.defaultView,o=function(h,d,f){var v=h.parsedStyle,g=v.width,p=v.height;g&&!p?h.setAttribute("height",f/d*g):!g&&p&&h.setAttribute("width",d/f*p)},l=function(h){var d=h.target,f=d.nodeName,v=d.attributes;if(f===Dt.IMAGE){var g=v.src,p=v.keepAspectRatio;a.getImageSync(g,d,function(y){var b=y.img,E=b.width,O=b.height;p&&o(d,E,O),d.renderable.dirty=!0,r.dirtify()})}},c=function(h){var d=h.target,f=h.attrName,v=h.prevValue,g=h.newValue;d.nodeName!==Dt.IMAGE||f!=="src"||(v!==g&&a.releaseImage(v,d),Ge(g)&&a.getOrCreateImage(g,d).then(function(p){var y=p.img,b=y.width,E=y.height;d.attributes.keepAspectRatio&&o(d,b,E),d.renderable.dirty=!0,r.dirtify()}).catch(function(){}))};r.hooks.init.tap(n.tag,function(){s.addEventListener(De.MOUNTED,l),s.addEventListener(De.ATTR_MODIFIED,c)}),r.hooks.destroy.tap(n.tag,function(){s.removeEventListener(De.MOUNTED,l),s.removeEventListener(De.ATTR_MODIFIED,c)})}}])}();qy.tag="LoadImage";var Ik=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.name="image-loader",e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"init",value:function(r){this.context.imagePool=new sv(this.context,r),this.addRenderingPlugin(new qy)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(La);var Gn=_k("renderState"),Jy=function(){function n(t){(0,N.Z)(this,n),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,Gn,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=Wt(),this.dprMatrix=Wt(),this.tmpMat4=Wt(),this.vec3a=pt(),this.vec3b=pt(),this.vec3c=pt(),this.vec3d=pt(),this.canvasRendererPluginOptions=t}return(0,T.Z)(n,[{key:"apply",value:function(e,r){var i=this;this.context=e;var a=this.context,s=a.config,o=a.camera,l=a.renderingService,c=a.renderingContext,u=a.rBushRoot,h=a.pathGeneratorFactory,d=s.renderer.getConfig().enableRenderingOptimization;s.renderer.getConfig().enableDirtyCheck=!1,s.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=u,this.pathGeneratorFactory=h;var f=e.contextService,v=c.root.ownerDocument.defaultView,g=function(O){var P=O.target,L=P.rBushNode;L!=null&&L.aabb&&i.removedRBushNodeAABBs.push(L.aabb)},p=function(O){var P=O.target,L=P.rBushNode;L.aabb&&i.removedRBushNodeAABBs.push(L.aabb)};l.hooks.init.tap(n.tag,function(){v.addEventListener(De.UNMOUNTED,g),v.addEventListener(De.CULLED,p);var E=f.getDPR(),O=s.width,P=s.height,L=f.getContext();i.clearRect(L,0,0,O*E,P*E,s.background)}),l.hooks.destroy.tap(n.tag,function(){v.removeEventListener(De.UNMOUNTED,g),v.removeEventListener(De.CULLED,p),i.renderQueue=[],i.removedRBushNodeAABBs=[],ia(i,Gn)[Gn]={restoreStack:[],prevObject:null,currentContext:null}});var y=function(){var O,P=f.getContext(),L=f.getDPR(),F=s.width,I=s.height,V=i.canvasRendererPluginOptions,Y=V.dirtyObjectNumThreshold,J=V.dirtyObjectRatioThreshold,$=l.getStats(),ot=$.total,ct=$.rendered,ft=ct/ot;i.clearFullScreen=i.clearFullScreenLastFrame||!((O=v.context.renderingPlugins[1])!==null&&O!==void 0&&O.isFirstTimeRenderingFinished)||l.disableDirtyRectangleRendering()||ct>Y&&ft>J,P&&(typeof P.resetTransform=="function"?P.resetTransform():P.setTransform(1,0,0,1,0,0),i.clearFullScreen&&i.clearRect(P,0,0,F*L,I*L,s.background))},b=function(O,P){for(var L=[O];L.length>0;){var F,I=L.pop();I.isVisible()&&!I.isCulled()&&(d?i.renderDisplayObjectOptimized(I,P,i.context,ia(i,Gn)[Gn],r):i.renderDisplayObject(I,P,i.context,ia(i,Gn)[Gn],r));for(var V=((F=I.sortable)===null||F===void 0||(F=F.sorted)===null||F===void 0?void 0:F.length)>0?I.sortable.sorted:I.childNodes,Y=V.length-1;Y>=0;Y--)L.push(V[Y])}};l.hooks.endFrame.tap(n.tag,function(){if(y(),c.root.childNodes.length===0){i.clearFullScreenLastFrame=!0;return}d=s.renderer.getConfig().enableRenderingOptimization,ia(i,Gn)[Gn]={restoreStack:[],prevObject:null,currentContext:ia(i,Gn)[Gn].currentContext},ia(i,Gn)[Gn].currentContext.clear(),i.clearFullScreenLastFrame=!1;var E=f.getContext(),O=f.getDPR();if(gn(i.dprMatrix,[O,O,1]),Jt(i.vpMatrix,i.dprMatrix,o.getOrthoMatrix()),i.clearFullScreen)d?(E.save(),b(c.root,E),E.restore()):b(c.root,E),i.removedRBushNodeAABBs=[];else{var P=i.safeMergeAABB.apply(i,[i.mergeDirtyAABBs(i.renderQueue)].concat((0,k.Z)(i.removedRBushNodeAABBs.map(function(ce){var xe=ce.minX,Ce=ce.minY,je=ce.maxX,Ue=ce.maxY,or=new pn;return or.setMinMax([xe,Ce,0],[je,Ue,0]),or}))));if(i.removedRBushNodeAABBs=[],pn.isEmpty(P)){i.renderQueue=[];return}var L=i.convertAABB2Rect(P),F=L.x,I=L.y,V=L.width,Y=L.height,J=re(i.vec3a,[F,I,0],i.vpMatrix),$=re(i.vec3b,[F+V,I,0],i.vpMatrix),ot=re(i.vec3c,[F,I+Y,0],i.vpMatrix),ct=re(i.vec3d,[F+V,I+Y,0],i.vpMatrix),ft=Math.min(J[0],$[0],ct[0],ot[0]),Nt=Math.min(J[1],$[1],ct[1],ot[1]),Ot=Math.max(J[0],$[0],ct[0],ot[0]),mt=Math.max(J[1],$[1],ct[1],ot[1]),yt=Math.floor(ft),Rt=Math.floor(Nt),jt=Math.ceil(Ot-ft),Xt=Math.ceil(mt-Nt);E.save(),i.clearRect(E,yt,Rt,jt,Xt,s.background),E.beginPath(),E.rect(yt,Rt,jt,Xt),E.clip(),E.setTransform(i.vpMatrix[0],i.vpMatrix[1],i.vpMatrix[4],i.vpMatrix[5],i.vpMatrix[12],i.vpMatrix[13]);var ee=s.renderer.getConfig(),ae=ee.enableDirtyRectangleRenderingDebug;ae&&v.dispatchEvent(new Kn(ri.DIRTY_RECTANGLE,{dirtyRect:{x:yt,y:Rt,width:jt,height:Xt}}));var he=i.searchDirtyObjects(P);he.sort(function(ce,xe){return ce.sortable.renderOrder-xe.sortable.renderOrder}).forEach(function(ce){ce&&ce.isVisible()&&!ce.isCulled()&&i.renderDisplayObject(ce,E,i.context,ia(i,Gn)[Gn],r)}),E.restore(),i.renderQueue.forEach(function(ce){i.saveDirtyAABB(ce)}),i.renderQueue=[]}ia(i,Gn)[Gn].restoreStack.forEach(function(){E.restore()}),ia(i,Gn)[Gn].restoreStack=[]}),l.hooks.render.tap(n.tag,function(E){i.clearFullScreen||i.renderQueue.push(E)})}},{key:"clearRect",value:function(e,r,i,a,s,o){e.clearRect(r,i,a,s),o&&(e.fillStyle=o,e.fillRect(r,i,a,s))}},{key:"renderDisplayObjectOptimized",value:function(e,r,i,a,s){var o=e.nodeName,l=!1,c=!1,u=this.context.styleRendererFactory[o],h=this.pathGeneratorFactory[o],d=e.parsedStyle.clipPath;if(d){l=!a.prevObject||!wd(d.getWorldTransform(),a.prevObject.getWorldTransform()),l&&(this.applyWorldTransform(r,d),a.prevObject=null);var f=this.pathGeneratorFactory[d.nodeName];f&&(r.save(),c=!0,r.beginPath(),f(r,d.parsedStyle),r.closePath(),r.clip())}if(u){l=!a.prevObject||!wd(e.getWorldTransform(),a.prevObject.getWorldTransform()),l&&this.applyWorldTransform(r,e);var v=!a.prevObject;if(!v){var g=a.prevObject.nodeName;o===Dt.TEXT?v=g!==Dt.TEXT:o===Dt.IMAGE?v=g!==Dt.IMAGE:v=g===Dt.TEXT||g===Dt.IMAGE}u.applyStyleToContext(r,e,v,a),a.prevObject=e}h&&(r.beginPath(),h(r,e.parsedStyle),o!==Dt.LINE&&o!==Dt.PATH&&o!==Dt.POLYLINE&&r.closePath()),u&&u.drawToContext(r,e,ia(this,Gn)[Gn],this,s),c&&r.restore(),e.dirty(!1)}},{key:"renderDisplayObject",value:function(e,r,i,a,s){var o=e.nodeName,l=a.restoreStack[a.restoreStack.length-1];l&&!(e.compareDocumentPosition(l)&On.DOCUMENT_POSITION_CONTAINS)&&(r.restore(),a.restoreStack.pop());var c=this.context.styleRendererFactory[o],u=this.pathGeneratorFactory[o],h=e.parsedStyle.clipPath;if(h){this.applyWorldTransform(r,h);var d=this.pathGeneratorFactory[h.nodeName];d&&(r.save(),a.restoreStack.push(e),r.beginPath(),d(r,h.parsedStyle),r.closePath(),r.clip())}c&&(this.applyWorldTransform(r,e),r.save(),this.applyAttributesToContext(r,e)),u&&(r.beginPath(),u(r,e.parsedStyle),o!==Dt.LINE&&o!==Dt.PATH&&o!==Dt.POLYLINE&&r.closePath()),c&&(c.render(r,e.parsedStyle,e,i,this,s),r.restore()),e.dirty(!1)}},{key:"applyAttributesToContext",value:function(e,r){var i=r.parsedStyle,a=i.stroke,s=i.fill,o=i.opacity,l=i.lineDash,c=i.lineDashOffset;l&&e.setLineDash(l),me(c)||(e.lineDashOffset=c),me(o)||(e.globalAlpha*=o),!me(a)&&!Array.isArray(a)&&!a.isNone&&(e.strokeStyle=r.attributes.stroke),!me(s)&&!Array.isArray(s)&&!s.isNone&&(e.fillStyle=r.attributes.fill)}},{key:"convertAABB2Rect",value:function(e){var r=e.getMin(),i=e.getMax(),a=Math.floor(r[0]),s=Math.floor(r[1]),o=Math.ceil(i[0]),l=Math.ceil(i[1]),c=o-a,u=l-s;return{x:a,y:s,width:c,height:u}}},{key:"mergeDirtyAABBs",value:function(e){var r=new pn;return e.forEach(function(i){var a=i.getRenderBounds();r.add(a);var s=i.renderable.dirtyRenderBounds;s&&r.add(s)}),r}},{key:"searchDirtyObjects",value:function(e){var r=e.getMin(),i=(0,R.Z)(r,2),a=i[0],s=i[1],o=e.getMax(),l=(0,R.Z)(o,2),c=l[0],u=l[1],h=this.rBush.search({minX:a,minY:s,maxX:c,maxY:u});return h.map(function(d){var f=d.displayObject;return f})}},{key:"saveDirtyAABB",value:function(e){var r=e.renderable;r.dirtyRenderBounds||(r.dirtyRenderBounds=new pn);var i=e.getRenderBounds();i&&r.dirtyRenderBounds.update(i.center,i.halfExtents)}},{key:"applyWorldTransform",value:function(e,r,i){i?(we(this.tmpMat4,r.getLocalTransform()),Jt(this.tmpMat4,i,this.tmpMat4),Jt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(we(this.tmpMat4,r.getWorldTransform()),Jt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),e.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var e=new pn,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return i.forEach(function(s){e.add(s)}),e}}])}();Jy.tag="CanvasRenderer";function Mu(n,t,e,r,i,a,s){var o,l;if(n.image.nodeName==="rect"){var c=n.image.parsedStyle,u=c.width,h=c.height;l=r.contextService.getDPR();var d=r.config.offscreenCanvas;o=a.offscreenCanvasCreator.getOrCreateCanvas(d),o.width=u*l,o.height=h*l;var f=a.offscreenCanvasCreator.getOrCreateContext(d),v={restoreStack:[],prevObject:null,currentContext:new Map};n.image.forEach(function(p){i.renderDisplayObject(p,f,r,v,a)}),v.restoreStack.forEach(function(){f.restore()})}var g=s.getOrCreatePatternSync(t,n,e,o,l,t.getGeometryBounds().min,function(){t.dirty(),r.renderingService.dirtify()});return g}function Au(n,t,e,r){var i;if(n.type===_a.LinearGradient||n.type===_a.RadialGradient){var a=t.getGeometryBounds(),s=a&&a.halfExtents[0]*2||1,o=a&&a.halfExtents[1]*2||1,l=a&&a.min||[0,0];i=r.getOrCreateGradient((0,B.Z)((0,B.Z)({type:n.type},n.value),{},{min:l,width:s,height:o}),e)}return i}var Tu=["shadowBlur","shadowOffsetX","shadowOffsetY"],$y=["lineCap","lineJoin","miterLimit"],qn={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},t1={};function Rn(n,t,e,r){var i=r.has(t)?r.get(t):qn[t];return i!==e&&(t==="lineDash"?n.setLineDash(e):n[t]=e,r.set(t,e)),i}var Bk=function(){function n(t){(0,N.Z)(this,n),this.imagePool=t}return(0,T.Z)(n,[{key:"applyAttributesToContext",value:function(e,r){}},{key:"render",value:function(e,r,i,a,s,o){}},{key:"applyCommonStyleToContext",value:function(e,r,i,a){var s=i?t1:a.prevObject.parsedStyle,o=r.parsedStyle;(i||o.opacity!==s.opacity)&&Rn(e,"globalAlpha",me(o.opacity)?qn.globalAlpha:o.opacity,a.currentContext),(i||o.blend!==s.blend)&&Rn(e,"globalCompositeOperation",me(o.blend)?qn.globalCompositeOperation:o.blend,a.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(e,r,i,a){var s=i?t1:a.prevObject.parsedStyle,o=r.parsedStyle,l=o.lineWidth,c=l===void 0?qn.lineWidth:l,u=o.fill&&!o.fill.isNone,h=o.stroke&&!o.stroke.isNone&&c>0;if(h){if(i||r.attributes.stroke!==a.prevObject.attributes.stroke){var d=!me(o.stroke)&&!Array.isArray(o.stroke)&&!o.stroke.isNone?r.attributes.stroke:qn.strokeStyle;Rn(e,"strokeStyle",d,a.currentContext)}(i||o.lineWidth!==s.lineWidth)&&Rn(e,"lineWidth",me(o.lineWidth)?qn.lineWidth:o.lineWidth,a.currentContext),(i||o.lineDash!==s.lineDash)&&Rn(e,"lineDash",o.lineDash||qn.lineDash,a.currentContext),(i||o.lineDashOffset!==s.lineDashOffset)&&Rn(e,"lineDashOffset",me(o.lineDashOffset)?qn.lineDashOffset:o.lineDashOffset,a.currentContext);for(var f=0;f<$y.length;f++){var v=$y[f];(i||o[v]!==s[v])&&Rn(e,v,me(o[v])?qn[v]:o[v],a.currentContext)}}if(u&&(i||r.attributes.fill!==a.prevObject.attributes.fill)){var g=!me(o.fill)&&!Array.isArray(o.fill)&&!o.fill.isNone?r.attributes.fill:qn.fillStyle;Rn(e,"fillStyle",g,a.currentContext)}}},{key:"applyStyleToContext",value:function(e,r,i,a){var s=r.nodeName;this.applyCommonStyleToContext(e,r,i,a),s===Dt.IMAGE||this.applyStrokeFillStyleToContext(e,r,i,a)}},{key:"applyShadowAndFilterStyleToContext",value:function(e,r,i,a){var s=r.parsedStyle;if(i){Rn(e,"shadowColor",s.shadowColor.toString(),a.currentContext);for(var o=0;o<Tu.length;o++){var l=Tu[o];Rn(e,l,s[l]||qn[l],a.currentContext)}}s.filter&&s.filter.length&&Rn(e,"filter",r.attributes.filter,a.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(e,r,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(r){Rn(e,"shadowColor",qn.shadowColor,a.currentContext);for(var o=0;o<Tu.length;o++){var l=Tu[o];Rn(e,l,qn[l],a.currentContext)}}if(i)if(r&&s){var c=e.filter;!me(c)&&c.indexOf("drop-shadow")>-1&&Rn(e,"filter",c.replace(/drop-shadow\([^)]*\)/,"").trim()||qn.filter,a.currentContext)}else Rn(e,"filter",qn.filter,a.currentContext)}},{key:"fillToContext",value:function(e,r,i,a,s){var o=this,l=r.parsedStyle,c=l.fill,u=l.fillRule,h=null;if(Array.isArray(c)&&c.length>0)c.forEach(function(f){var v=Rn(e,"fillStyle",Au(f,r,e,o.imagePool),i.currentContext);h=h!=null?h:v,u?e.fill(u):e.fill()});else{if(ys(c)){var d=Mu(c,r,e,r.ownerDocument.defaultView.context,a,s,this.imagePool);d&&(e.fillStyle=d,h=!0)}u?e.fill(u):e.fill()}h!==null&&Rn(e,"fillStyle",h,i.currentContext)}},{key:"strokeToContext",value:function(e,r,i,a,s){var o=this,l=r.parsedStyle.stroke,c=null;if(Array.isArray(l)&&l.length>0)l.forEach(function(d){var f=Rn(e,"strokeStyle",Au(d,r,e,o.imagePool),i.currentContext);c=c!=null?c:f,e.stroke()});else{if(ys(l)){var u=Mu(l,r,e,r.ownerDocument.defaultView.context,a,s,this.imagePool);if(u){var h=Rn(e,"strokeStyle",u,i.currentContext);c=c!=null?c:h}}e.stroke()}c!==null&&Rn(e,"strokeStyle",c,i.currentContext)}},{key:"drawToContext",value:function(e,r,i,a,s){var o,l=r.nodeName,c=r.parsedStyle,u=c.opacity,h=u===void 0?qn.globalAlpha:u,d=c.fillOpacity,f=d===void 0?qn.fillOpacity:d,v=c.strokeOpacity,g=v===void 0?qn.strokeOpacity:v,p=c.lineWidth,y=p===void 0?qn.lineWidth:p,b=c.fill&&!c.fill.isNone,E=c.stroke&&!c.stroke.isNone&&y>0;if(!(!b&&!E)){var O=!me(c.shadowColor)&&c.shadowBlur>0,P=c.shadowType==="inner",L=((o=c.fill)===null||o===void 0?void 0:o.alpha)===0,F=!!(c.filter&&c.filter.length),I=O&&E&&(l===Dt.PATH||l===Dt.LINE||l===Dt.POLYLINE||L||P),V=null;if(b){I||this.applyShadowAndFilterStyleToContext(e,r,O,i);var Y=h*f;V=Rn(e,"globalAlpha",Y,i.currentContext),this.fillToContext(e,r,i,a,s),I||this.clearShadowAndFilterStyleForContext(e,O,F,i)}if(E){var J=!1,$=h*g,ot=Rn(e,"globalAlpha",$,i.currentContext);if(V=b?V:ot,I&&(this.applyShadowAndFilterStyleToContext(e,r,O,i),J=!0,P)){var ct=e.globalCompositeOperation;e.globalCompositeOperation="source-atop",this.strokeToContext(e,r,i,a,s),e.globalCompositeOperation=ct,this.clearShadowAndFilterStyleForContext(e,O,F,i,!0)}this.strokeToContext(e,r,i,a,s),J&&this.clearShadowAndFilterStyleForContext(e,O,F,i)}V!==null&&Rn(e,"globalAlpha",V,i.currentContext)}}}])}(),ov=function(n){function t(){return(0,N.Z)(this,t),(0,_.Z)(this,t,arguments)}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"render",value:function(r,i,a,s,o,l){var c=i.fill,u=i.fillRule,h=i.opacity,d=h===void 0?1:h,f=i.fillOpacity,v=f===void 0?1:f,g=i.stroke,p=i.strokeOpacity,y=p===void 0?1:p,b=i.lineWidth,E=b===void 0?1:b,O=i.lineCap,P=i.lineJoin,L=i.shadowType,F=i.shadowColor,I=i.shadowBlur,V=i.filter,Y=i.miterLimit,J=c&&!c.isNone,$=g&&!g.isNone&&E>0,ot=(c==null?void 0:c.alpha)===0,ct=!!(V&&V.length),ft=!me(F)&&I>0,Nt=a.nodeName,Ot=L==="inner",mt=$&&ft&&(Nt===Dt.PATH||Nt===Dt.LINE||Nt===Dt.POLYLINE||ot||Ot);J&&(r.globalAlpha=d*v,mt||Ou(a,r,ft),e1(r,a,c,u,s,o,l,this.imagePool),mt||this.clearShadowAndFilter(r,ct,ft)),$&&(r.globalAlpha=d*y,r.lineWidth=E,me(Y)||(r.miterLimit=Y),me(O)||(r.lineCap=O),me(P)||(r.lineJoin=P),mt&&(Ot&&(r.globalCompositeOperation="source-atop"),Ou(a,r,!0),Ot&&(lv(r,a,g,s,o,l,this.imagePool),r.globalCompositeOperation=qn.globalCompositeOperation,this.clearShadowAndFilter(r,ct,!0))),lv(r,a,g,s,o,l,this.imagePool))}},{key:"clearShadowAndFilter",value:function(r,i,a){if(a&&(r.shadowColor="transparent",r.shadowBlur=0),i){var s=r.filter;!me(s)&&s.indexOf("drop-shadow")>-1&&(r.filter=s.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(Bk);function Ou(n,t,e){var r=n.parsedStyle,i=r.filter,a=r.shadowColor,s=r.shadowBlur,o=r.shadowOffsetX,l=r.shadowOffsetY;i&&i.length&&(t.filter=n.style.filter),e&&(t.shadowColor=a.toString(),t.shadowBlur=s||0,t.shadowOffsetX=o||0,t.shadowOffsetY=l||0)}function e1(n,t,e,r,i,a,s,o){var l=arguments.length>8&&arguments[8]!==void 0?arguments[8]:!1;Array.isArray(e)?e.forEach(function(c){n.fillStyle=Au(c,t,n,o),l||(r?n.fill(r):n.fill())}):(ys(e)&&(n.fillStyle=Mu(e,t,n,i,a,s,o)),l||(r?n.fill(r):n.fill()))}function lv(n,t,e,r,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1;Array.isArray(e)?e.forEach(function(l){n.strokeStyle=Au(l,t,n,s),o||n.stroke()}):(ys(e)&&(n.strokeStyle=Mu(e,t,n,r,i,a,s)),o||n.stroke())}function Fk(n,t){var e=(0,R.Z)(n,4),r=e[0],i=e[1],a=e[2],s=e[3],o=(0,R.Z)(t,4),l=o[0],c=o[1],u=o[2],h=o[3],d=Math.max(r,l),f=Math.max(i,c),v=Math.min(r+a,l+u),g=Math.min(i+s,c+h);return v<=d||g<=f?null:[d,f,v-d,g-f]}function zk(n,t){var e=re(pt(),[n[0],n[1],0],t),r=re(pt(),[n[0]+n[2],n[1],0],t),i=re(pt(),[n[0],n[1]+n[3],0],t),a=re(pt(),[n[0]+n[2],n[1]+n[3],0],t);return[Math.min(e[0],r[0],i[0],a[0]),Math.min(e[1],r[1],i[1],a[1]),Math.max(e[0],r[0],i[0],a[0])-Math.min(e[0],r[0],i[0],a[0]),Math.max(e[1],r[1],i[1],a[1])-Math.min(e[1],r[1],i[1],a[1])]}var jk=function(n){function t(){return(0,N.Z)(this,t),(0,_.Z)(this,t,arguments)}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"renderDownSampled",value:function(r,i,a,s){var o=s.src,l=s.imageCache;if(!l.downSampled){this.imagePool.createDownSampledImage(o,a).then(function(){a.ownerDocument&&(a.dirty(),a.ownerDocument.defaultView.context.renderingService.dirtify())}).catch(function(c){console.error(c)});return}r.drawImage(l.downSampled,Math.floor(s.drawRect[0]),Math.floor(s.drawRect[1]),Math.ceil(s.drawRect[2]),Math.ceil(s.drawRect[3]))}},{key:"renderTile",value:function(r,i,a,s){var o=s.src,l=s.imageCache,c=s.imageRect,u=s.drawRect,h=l.size,d=r.getTransform(),f=d.a,v=d.b,g=d.c,p=d.d,y=d.e,b=d.f;if(r.resetTransform(),!(l!=null&&l.gridSize)){this.imagePool.createImageTiles(o,[],function(){a.ownerDocument&&(a.dirty(),a.ownerDocument.defaultView.context.renderingService.dirtify())},a).catch(function(ft){console.error(ft)});return}for(var E=[h[0]/c[2],h[1]/c[3]],O=[l.tileSize[0]/E[0],l.tileSize[1]/E[1]],P=[Math.floor((u[0]-c[0])/O[0]),Math.ceil((u[0]+u[2]-c[0])/O[0])],L=P[0],F=P[1],I=[Math.floor((u[1]-c[1])/O[1]),Math.ceil((u[1]+u[3]-c[1])/O[1])],V=I[0],Y=I[1],J=V;J<=Y;J++)for(var $=L;$<=F;$++){var ot=l.tiles[J][$];if(ot){var ct=[Math.floor(c[0]+ot.tileX*O[0]),Math.floor(c[1]+ot.tileY*O[1]),Math.ceil(O[0]),Math.ceil(O[1])];r.drawImage(ot.data,ct[0],ct[1],ct[2],ct[3])}}r.setTransform(f,v,g,p,y,b)}},{key:"render",value:function(r,i,a){var s=i.x,o=s===void 0?0:s,l=i.y,c=l===void 0?0:l,u=i.width,h=i.height,d=i.src,f=i.shadowColor,v=i.shadowBlur,g=this.imagePool.getImageSync(d,a),p=g==null?void 0:g.img,y=u,b=h;if(p){y||(y=p.width),b||(b=p.height);var E=!me(f)&&v>0;Ou(a,r,E);try{var O=a.ownerDocument.defaultView.getContextService().getDomElement(),P=O.width,L=O.height,F=r.getTransform(),I=F.a,V=F.b,Y=F.c,J=F.d,$=F.e,ot=F.f,ct=Ae(I,Y,0,0,V,J,0,0,0,0,1,0,$,ot,0,1),ft=zk([o,c,y,b],ct),Nt=Fk([0,0,P,L],ft);if(!Nt)return;if(!a.ownerDocument.defaultView.getConfig().enableLargeImageOptimization){t.renderFull(r,i,a,{image:p,drawRect:[o,c,y,b]});return}var Ot=ft[2]/g.size[0];if(Ot<(g.downSamplingRate||.5)){this.renderDownSampled(r,i,a,{src:d,imageCache:g,drawRect:[o,c,y,b]});return}if(!sv.isSupportTile){t.renderFull(r,i,a,{image:p,drawRect:[o,c,y,b]});return}this.renderTile(r,i,a,{src:d,imageCache:g,imageRect:ft,drawRect:Nt})}catch(mt){}}}},{key:"drawToContext",value:function(r,i,a,s,o){this.render(r,i.parsedStyle,i)}}],[{key:"renderFull",value:function(r,i,a,s){r.drawImage(s.image,Math.floor(s.drawRect[0]),Math.floor(s.drawRect[1]),Math.ceil(s.drawRect[2]),Math.ceil(s.drawRect[3]))}}])}(ov),Zk=function(n){function t(){return(0,N.Z)(this,t),(0,_.Z)(this,t,arguments)}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"render",value:function(r,i,a,s,o,l){a.getBounds();var c=i.lineWidth,u=c===void 0?1:c,h=i.textAlign,d=h===void 0?"start":h,f=i.textBaseline,v=f===void 0?"alphabetic":f,g=i.lineJoin,p=g===void 0?"miter":g,y=i.miterLimit,b=y===void 0?10:y,E=i.letterSpacing,O=E===void 0?0:E,P=i.stroke,L=i.fill,F=i.fillRule,I=i.fillOpacity,V=I===void 0?1:I,Y=i.strokeOpacity,J=Y===void 0?1:Y,$=i.opacity,ot=$===void 0?1:$,ct=i.metrics,ft=i.x,Nt=ft===void 0?0:ft,Ot=i.y,mt=Ot===void 0?0:Ot,yt=i.dx,Rt=i.dy,jt=i.shadowColor,Xt=i.shadowBlur,ee=ct.font,ae=ct.lines,he=ct.height,ce=ct.lineHeight,xe=ct.lineMetrics;r.font=ee,r.lineWidth=u,r.textAlign=d==="middle"?"center":d;var Ce=v;Ce==="alphabetic"&&(Ce="bottom"),r.lineJoin=p,me(b)||(r.miterLimit=b);var je=mt;v==="middle"?je+=-he/2-ce/2:v==="bottom"||v==="alphabetic"||v==="ideographic"?je+=-he:(v==="top"||v==="hanging")&&(je+=-ce);var Ue=Nt+(yt||0);je+=Rt||0,ae.length===1&&(Ce==="bottom"?(Ce="middle",je-=.5*he):Ce==="top"&&(Ce="middle",je+=.5*he)),r.textBaseline=Ce;var or=!me(jt)&&Xt>0;Ou(a,r,or);for(var Ke=0;Ke<ae.length;Ke++){var ui=u/2+Ue;je+=ce,!me(P)&&!P.isNone&&u&&this.drawLetterSpacing(r,a,ae[Ke],xe[Ke],d,ui,je,O,L,F,V,P,J,ot,!0,s,o,l),me(L)||this.drawLetterSpacing(r,a,ae[Ke],xe[Ke],d,ui,je,O,L,F,V,P,J,ot,!1,s,o,l)}}},{key:"drawLetterSpacing",value:function(r,i,a,s,o,l,c,u,h,d,f,v,g,p,y,b,E,O){if(u===0){y?this.strokeText(r,i,a,l,c,v,g,b,E,O):this.fillText(r,i,a,l,c,h,d,f,p,b,E,O);return}var P=r.textAlign;r.textAlign="left";var L=l;o==="center"||o==="middle"?L=l-s.width/2:(o==="right"||o==="end")&&(L=l-s.width);for(var F=Array.from(a),I=r.measureText(a).width,V=0,Y=0;Y<F.length;++Y){var J=F[Y];y?this.strokeText(r,i,J,L,c,v,g,b,E,O):this.fillText(r,i,J,L,c,h,d,f,p,b,E,O),V=r.measureText(a.substring(Y+1)).width,L+=I-V+u,I=V}r.textAlign=P}},{key:"fillText",value:function(r,i,a,s,o,l,c,u,h,d,f,v){e1(r,i,l,c,d,f,v,this.imagePool,!0);var g,p=!me(u)&&u!==1;p&&(g=r.globalAlpha,r.globalAlpha=u*h),r.fillText(a,s,o),p&&(r.globalAlpha=g)}},{key:"strokeText",value:function(r,i,a,s,o,l,c,u,h,d){lv(r,i,l,u,h,d,this.imagePool,!0);var f,v=!me(c)&&c!==1;v&&(f=r.globalAlpha,r.globalAlpha=c),r.strokeText(a,s,o),v&&(r.globalAlpha=f)}},{key:"drawToContext",value:function(r,i,a,s,o){this.render(r,i.parsedStyle,i,i.ownerDocument.defaultView.context,s,o)}}])}(ov),Wk=function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),e=(0,_.Z)(this,t),e.name="canvas-renderer",e.options=r,e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"init",value:function(){var r,i=(0,B.Z)({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),a=this.context.imagePool,s=new ov(a),o=(r={},(0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)((0,se.Z)(r,Dt.CIRCLE,s),Dt.ELLIPSE,s),Dt.RECT,s),Dt.IMAGE,new jk(a)),Dt.TEXT,new Zk(a)),Dt.LINE,s),Dt.POLYLINE,s),Dt.POLYGON,s),Dt.PATH,s),Dt.GROUP,void 0),(0,se.Z)((0,se.Z)((0,se.Z)(r,Dt.HTML,void 0),Dt.MESH,void 0),Dt.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new Jy(i))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(La);var n1=function(){function n(){(0,N.Z)(this,n)}return(0,T.Z)(n,[{key:"apply",value:function(e,r){var i=this,a=e.renderingService,s=e.renderingContext,o=e.config;this.context=e;var l=s.root.ownerDocument.defaultView,c=function(I){a.hooks.pointerMove.call(I)},u=function(I){a.hooks.pointerUp.call(I)},h=function(I){a.hooks.pointerDown.call(I)},d=function(I){a.hooks.pointerOver.call(I)},f=function(I){a.hooks.pointerOut.call(I)},v=function(I){a.hooks.pointerCancel.call(I)},g=function(I){a.hooks.pointerWheel.call(I)},p=function(I){a.hooks.click.call(I)},y=function(I){r.globalThis.document.addEventListener("pointermove",c,!0),I.addEventListener("pointerdown",h,!0),I.addEventListener("pointerleave",f,!0),I.addEventListener("pointerover",d,!0),r.globalThis.addEventListener("pointerup",u,!0),r.globalThis.addEventListener("pointercancel",v,!0)},b=function(I){I.addEventListener("touchstart",h,!0),I.addEventListener("touchend",u,!0),I.addEventListener("touchmove",c,!0),I.addEventListener("touchcancel",v,!0)},E=function(I){r.globalThis.document.addEventListener("mousemove",c,!0),I.addEventListener("mousedown",h,!0),I.addEventListener("mouseout",f,!0),I.addEventListener("mouseover",d,!0),r.globalThis.addEventListener("mouseup",u,!0)},O=function(I){r.globalThis.document.removeEventListener("pointermove",c,!0),I.removeEventListener("pointerdown",h,!0),I.removeEventListener("pointerleave",f,!0),I.removeEventListener("pointerover",d,!0),r.globalThis.removeEventListener("pointerup",u,!0),r.globalThis.removeEventListener("pointercancel",v,!0)},P=function(I){I.removeEventListener("touchstart",h,!0),I.removeEventListener("touchend",u,!0),I.removeEventListener("touchmove",c,!0),I.removeEventListener("touchcancel",v,!0)},L=function(I){r.globalThis.document.removeEventListener("mousemove",c,!0),I.removeEventListener("mousedown",h,!0),I.removeEventListener("mouseout",f,!0),I.removeEventListener("mouseover",d,!0),r.globalThis.removeEventListener("mouseup",u,!0)};a.hooks.init.tap(n.tag,function(){var F=i.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(F.style.msContentZooming="none",F.style.msTouchAction="none"):l.supportsPointerEvents&&(F.style.touchAction="none"),l.supportsPointerEvents?y(F):E(F),l.supportsTouchEvents&&b(F),o.useNativeClickEvent&&F.addEventListener("click",p,!0),F.addEventListener("wheel",g,{passive:!0,capture:!0})}),a.hooks.destroy.tap(n.tag,function(){var F=i.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(F.style.msContentZooming="",F.style.msTouchAction=""):l.supportsPointerEvents&&(F.style.touchAction=""),l.supportsPointerEvents?O(F):L(F),l.supportsTouchEvents&&P(F),o.useNativeClickEvent&&F.removeEventListener("click",p,!0),F.removeEventListener("wheel",g,!0)})}}])}();n1.tag="DOMInteraction";var Gk=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.name="dom-interaction",e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"init",value:function(){this.addRenderingPlugin(new n1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(La);var Vk="g-canvas-camera",r1=function(){function n(){(0,N.Z)(this,n),this.displayObjectHTMLElementMap=new WeakMap}return(0,T.Z)(n,[{key:"joinTransformMatrix",value:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return"matrix(".concat([e[0],e[1],e[4],e[5],e[12]+r[0],e[13]+r[1]].join(","),")")}},{key:"apply",value:function(e,r){var i=this,a=e.camera,s=e.renderingContext,o=e.renderingService;this.context=e;var l=s.root.ownerDocument.defaultView,c=l.context.eventService.nativeHTMLMap,u=function(y,b){b.style.transform=i.joinTransformMatrix(y.getWorldTransform(),y.getOrigin())},h=function(y){var b=y.target;if(b.nodeName===Dt.HTML){i.$camera||(i.$camera=i.createCamera(a));var E=i.getOrCreateEl(b);i.$camera.appendChild(E),Object.keys(b.attributes).forEach(function(O){i.updateAttribute(O,b)}),u(b,E),c.set(E,b)}},d=function(y){var b=y.target;if(b.nodeName===Dt.HTML&&i.$camera){var E=i.getOrCreateEl(b);E&&(E.remove(),c.delete(E))}},f=function(y){var b=y.target;if(b.nodeName===Dt.HTML){var E=y.attrName;i.updateAttribute(E,b)}},v=function(y){var b=y.target,E=b.nodeName===Dt.FRAGMENT?b.childNodes:[b];E.forEach(function(O){if(O.nodeName===Dt.HTML){var P=i.getOrCreateEl(O);u(O,P)}})},g=function(){if(i.$camera){var y=i.context.config,b=y.width,E=y.height;i.$camera.parentElement.style.width="".concat(b||0,"px"),i.$camera.parentElement.style.height="".concat(E||0,"px")}};o.hooks.init.tap(n.tag,function(){l.addEventListener(ri.RESIZE,g),l.addEventListener(De.MOUNTED,h),l.addEventListener(De.UNMOUNTED,d),l.addEventListener(De.ATTR_MODIFIED,f),l.addEventListener(De.BOUNDS_CHANGED,v)}),o.hooks.endFrame.tap(n.tag,function(){i.$camera&&s.renderReasons.has(lo.CAMERA_CHANGED)&&(i.$camera.style.transform=i.joinTransformMatrix(a.getOrthoMatrix()))}),o.hooks.destroy.tap(n.tag,function(){i.$camera&&i.$camera.remove(),l.removeEventListener(ri.RESIZE,g),l.removeEventListener(De.MOUNTED,h),l.removeEventListener(De.UNMOUNTED,d),l.removeEventListener(De.ATTR_MODIFIED,f),l.removeEventListener(De.BOUNDS_CHANGED,v)})}},{key:"createCamera",value:function(e){var r=this.context.config,i=r.document,a=r.width,s=r.height,o=this.context.contextService.getDomElement(),l=o.parentNode;if(l){var c=Vk,u=l.querySelector("#".concat(c));if(!u){var h=(i||document).createElement("div");h.style.overflow="hidden",h.style.pointerEvents="none",h.style.position="absolute",h.style.left="0px",h.style.top="0px",h.style.width="".concat(a||0,"px"),h.style.height="".concat(s||0,"px");var d=(i||document).createElement("div");u=d,d.id=c,d.style.position="absolute",d.style.left="".concat(o.offsetLeft||0,"px"),d.style.top="".concat(o.offsetTop||0,"px"),d.style.transformOrigin="left top",d.style.transform=this.joinTransformMatrix(e.getOrthoMatrix()),d.style.pointerEvents="none",d.style.width="100%",d.style.height="100%",h.appendChild(d),l.appendChild(h)}return u}return null}},{key:"getOrCreateEl",value:function(e){var r=this.context.config.document,i=this.displayObjectHTMLElementMap.get(e);return i||(i=(r||document).createElement("div"),e.parsedStyle.$el=i,this.displayObjectHTMLElementMap.set(e,i),e.id&&(i.id=e.id),e.name&&i.setAttribute("name",e.name),e.className&&(i.className=e.className),i.style.position="absolute",i.style["will-change"]="transform",i.style.transform=this.joinTransformMatrix(e.getWorldTransform(),e.getOrigin())),i}},{key:"updateAttribute",value:function(e,r){var i=this.getOrCreateEl(r);switch(e){case"innerHTML":var a=r.parsedStyle.innerHTML;Ge(a)?i.innerHTML=a:(i.innerHTML="",i.appendChild(a));break;case"x":i.style.left="".concat(r.parsedStyle.x,"px");break;case"y":i.style.top="".concat(r.parsedStyle.y,"px");break;case"transformOrigin":var s=r.parsedStyle.transformOrigin;i.style["transform-origin"]="".concat(s[0].buildCSSText(null,null,"")," ").concat(s[1].buildCSSText(null,null,""));break;case"width":var o=r.parsedStyle.width;i.style.width=ie(o)?"".concat(o,"px"):o.toString();break;case"height":var l=r.parsedStyle.height;i.style.height=ie(l)?"".concat(l,"px"):l.toString();break;case"zIndex":var c=r.parsedStyle.zIndex;i.style["z-index"]="".concat(c);break;case"visibility":var u=r.parsedStyle.visibility;i.style.visibility=u;break;case"pointerEvents":var h=r.parsedStyle.pointerEvents,d=h===void 0?"auto":h;i.style.pointerEvents=d;break;case"opacity":var f=r.parsedStyle.opacity;i.style.opacity="".concat(f);break;case"fill":var v=r.parsedStyle.fill,g="";pc(v)?v.isNone?g="transparent":g=r.getAttribute("fill"):Array.isArray(v)?g=r.getAttribute("fill"):ys(v),i.style.background=g;break;case"stroke":var p=r.parsedStyle.stroke,y="";pc(p)?p.isNone?y="transparent":y=r.getAttribute("stroke"):Array.isArray(p)?y=r.getAttribute("stroke"):ys(p),i.style["border-color"]=y,i.style["border-style"]="solid";break;case"lineWidth":var b=r.parsedStyle.lineWidth;i.style["border-width"]="".concat(b||0,"px");break;case"lineDash":i.style["border-style"]="dashed";break;case"filter":var E=r.style.filter;i.style.filter=E;break;default:!me(r.style[e])&&r.style[e]!==""&&(i.style[e]=r.style[e])}}}])}();r1.tag="HTMLRendering";var Uk=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.name="html-renderer",e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"init",value:function(){this.addRenderingPlugin(new r1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(La);var Yk=function(){function n(t){(0,N.Z)(this,n),this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return(0,T.Z)(n,[{key:"init",value:function(){var e=this.canvasConfig,r=e.container,i=e.canvas;if(i)this.$canvas=i,r&&i.parentElement!==r&&r.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container;else if(r&&(this.$container=Ge(r)?document.getElementById(r):r,this.$container)){var a=document.createElement("canvas");this.$container.appendChild(a),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=a}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(e,r){var i=this.canvasConfig.devicePixelRatio;this.dpr=i,this.$canvas&&(this.$canvas.width=this.dpr*e,this.$canvas.height=this.dpr*r,VM(this.$canvas,e,r)),this.renderingContext.renderReasons.add(lo.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(e){this.$container&&this.$container.style&&(this.$container.style.cursor=e)}},{key:"toDataURL",value:function(){var t=(0,Ra.Z)((0,Tr.Z)().mark(function r(){var i,a,s,o=arguments;return(0,Tr.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return i=o.length>0&&o[0]!==void 0?o[0]:{},a=i.type,s=i.encoderOptions,l.abrupt("return",this.context.canvas.toDataURL(a,s));case 1:case"end":return l.stop()}},r,this)}));function e(){return t.apply(this,arguments)}return e}()}])}(),Hk=function(n){function t(){var e;(0,N.Z)(this,t);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return e=(0,_.Z)(this,t,[].concat(i)),e.name="canvas-context-register",e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"init",value:function(){this.context.ContextService=Yk}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(La),Sl=function(n){function t(e){var r;return(0,N.Z)(this,t),r=(0,_.Z)(this,t,[e]),r.registerPlugin(new Hk),r.registerPlugin(new Ik),r.registerPlugin(new fk),r.registerPlugin(new Wk),r.registerPlugin(new Gk),r.registerPlugin(new Rk),r.registerPlugin(new Uk),r}return(0,C.Z)(t,n),(0,T.Z)(t)}(I2);function Xk(n,t){if(n){var e;if(Wr(n))for(var r=0,i=n.length;r<i&&(e=t(n[r],r),e!==!1);r++);else if(Fn(n)){for(var a in n)if(n.hasOwnProperty(a)&&(e=t(n[a],a),e===!1))break}}}var i1=Xk,Kk=Object.prototype.hasOwnProperty,Bs=function(n,t){if(n===null||!vo(n))return{};var e={};return i1(t,function(r){Kk.call(n,r)&&(e[r]=n[r])}),e},Qk=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Cu extends Fi{constructor(t){super(Object.assign(Object.assign({},t),{style:Object.assign({},Cu.defaultStyleProps,t.style)})),this.rootPointerEvent=new wc(null),this.forwardEvents=e=>{const r=this.context.canvas,i=r.context.renderingContext.root.ownerDocument.defaultView;this.normalizeToPointerEvent(e,i).forEach(s=>{const o=this.bootstrapEvent(this.rootPointerEvent,s,i,e);bl(r.context.eventService,"mappingTable.pointerupoutside",[]),r.context.eventService.mapEvent(o)})}}get eventService(){return this.context.canvas.context.eventService}get events(){return[Bt.CLICK,Bt.POINTER_DOWN,Bt.POINTER_MOVE,Bt.POINTER_UP,Bt.POINTER_OVER,Bt.POINTER_LEAVE]}getDomElement(){return this.getShape("key").getDomElement()}render(t=this.parsedAttributes,e=this){this.drawKeyShape(t,e),this.drawPortShapes(t,e)}getKeyStyle(t){const e=Bs(t,["dx","dy","innerHTML","pointerEvents","cursor"]),{dx:r=0,dy:i=0}=e,a=Qk(e,["dx","dy"]),[s,o]=this.getSize(t);return Object.assign(Object.assign({x:r,y:i},a),{width:s,height:o})}drawKeyShape(t,e){const r=this.getKeyStyle(t),{x:i,y:a,width:s=0,height:o=0}=r,l=this.upsert("key-container",gr,{x:i,y:a,width:s,height:o,opacity:0},e);return this.upsert("key",co,r,l)}connectedCallback(){if(!(this.context.canvas.getRenderer("main")instanceof Sl))return;const r=this.getDomElement();this.events.forEach(i=>{r.addEventListener(i,this.forwardEvents)})}attributeChangedCallback(t,e,r){t==="zIndex"&&e!==r&&(this.getDomElement().style.zIndex=r)}destroy(){const t=this.getDomElement();this.events.forEach(e=>{t.removeEventListener(e,this.forwardEvents)}),super.destroy()}normalizeToPointerEvent(t,e){const r=[];if(e.isTouchEvent(t))for(let i=0;i<t.changedTouches.length;i++){const a=t.changedTouches[i];Te(a.button)&&(a.button=0),Te(a.buttons)&&(a.buttons=1),Te(a.isPrimary)&&(a.isPrimary=t.touches.length===1&&t.type==="touchstart"),Te(a.width)&&(a.width=a.radiusX||1),Te(a.height)&&(a.height=a.radiusY||1),Te(a.tiltX)&&(a.tiltX=0),Te(a.tiltY)&&(a.tiltY=0),Te(a.pointerType)&&(a.pointerType="touch"),Te(a.pointerId)&&(a.pointerId=a.identifier||0),Te(a.pressure)&&(a.pressure=a.force||.5),Te(a.twist)&&(a.twist=0),Te(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,a.type=t.type,r.push(a)}else if(e.isMouseEvent(t)){const i=t;Te(i.isPrimary)&&(i.isPrimary=!0),Te(i.width)&&(i.width=1),Te(i.height)&&(i.height=1),Te(i.tiltX)&&(i.tiltX=0),Te(i.tiltY)&&(i.tiltY=0),Te(i.pointerType)&&(i.pointerType="mouse"),Te(i.pointerId)&&(i.pointerId=1),Te(i.pressure)&&(i.pressure=.5),Te(i.twist)&&(i.twist=0),Te(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,r.push(i)}else r.push(t);return r}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}bootstrapEvent(t,e,r,i){t.view=r,t.originalEvent=null,t.nativeEvent=i,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:a,y:s}=this.getViewportXY(e);t.viewport.x=a,t.viewport.y=s;const[o,l]=this.context.canvas.getCanvasByViewport([a,s]);return t.canvas.x=o,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t}getViewportXY(t){let e,r;const{offsetX:i,offsetY:a,clientX:s,clientY:o}=t;if(!me(i)&&!me(a))e=i,r=a;else{const l=this.eventService.client2Viewport({x:s,y:o});e=l.x,r=l.y}return{x:e,y:r}}onframe(){super.onframe();const{opacity:t}=this.attributes;this.getDomElement().style.opacity=`${t}`}}Cu.defaultStyleProps={size:[160,80],halo:!1,icon:!1,label:!1,pointerEvents:"auto"};var a1=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Nu extends Fi{constructor(t){super(ur({style:Nu.defaultStyleProps},t))}getKeyStyle(t){const[e,r]=this.getSize(t),i=super.getKeyStyle(t),{fillOpacity:a,opacity:s=a}=i,o=a1(i,["fillOpacity","opacity"]);return Object.assign(Object.assign({opacity:s},o),{width:e,height:r,x:-e/2,y:-r/2})}getBounds(){return this.getShape("key").getBounds()}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getShape("key").attributes,{fill:r,stroke:i}=e,a=a1(e,["fill","stroke"]),s=Qn(this.getGraphicStyle(t),"halo"),o=Number(s.lineWidth),[l,c]=Ne(this.getSize(t),[o,o]),{lineWidth:u}=s,h={fill:"transparent",lineWidth:u/2,width:l-u/2,height:c-u/2,x:-(l-u/2)/2,y:-(c-u/2)/2};return Object.assign(Object.assign({},s),h)}getIconStyle(t){const e=super.getIconStyle(t),[r,i]=this.getSize(t);return e?Object.assign({width:r*ya,height:i*ya},e):!1}drawKeyShape(t,e){const r=this.upsert("key",Jf,this.getKeyStyle(t),e);return tv(this),r}drawHaloShape(t,e){this.upsert("halo",gr,this.getHaloStyle(t),e)}update(t){super.update(t),t&&("x"in t||"y"in t||"z"in t)&&ev(this)}}Nu.defaultStyleProps={size:32};class qk extends Fi{constructor(t){super(t)}getKeyStyle(t){const[e,r]=this.getSize(t);return Object.assign(Object.assign({},super.getKeyStyle(t)),{width:e,height:r,x:-e/2,y:-r/2})}getIconStyle(t){const e=super.getIconStyle(t),{width:r,height:i}=this.getShape("key").attributes;return e?Object.assign({width:r*ya,height:i*ya},e):!1}drawKeyShape(t,e){return this.upsert("key",gr,this.getKeyStyle(t),e)}}class Jk extends mu{constructor(t){super(t)}getInnerR(t){return t.innerR||this.getOuterR(t)*3/8}getOuterR(t){return Math.min(...this.getSize(t))/2}getPoints(t){return j3(this.getOuterR(t),this.getInnerR(t))}getIconStyle(t){const e=super.getIconStyle(t),r=this.getInnerR(t)*2*ya;return e?Object.assign({width:r,height:r},e):!1}getPortXY(t,e){const{placement:r="top"}=e,i=this.getShape("key").getLocalBounds(),a=Z3(this.getOuterR(t),this.getInnerR(t));return gv(i,r,a,!1)}}class ku extends mu{constructor(t){super(ur({style:ku.defaultStyleProps},t))}getPoints(t){const{direction:e}=t,[r,i]=this.getSize(t);return W3(r,i,e)}getPortXY(t,e){const{direction:r}=t,{placement:i="top"}=e,a=this.getShape("key").getLocalBounds(),[s,o]=this.getSize(t),l=G3(s,o,r);return gv(a,i,l,!1)}getIconStyle(t){const{icon:e,iconText:r,iconSrc:i,direction:a}=t;if(e===!1||ra(r||i))return!1;const s=Qn(this.getGraphicStyle(t),"icon"),o=this.getShape("key").getLocalBounds(),[l,c]=CO(o,a),u=NO(o,a)*2*ya;return Object.assign({x:l,y:c,width:u,height:u},s)}}ku.defaultStyleProps={size:40,direction:"up"};var s1=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class yo extends Fi{constructor(t){super(ur({style:yo.defaultStyleProps},t)),this.type="combo",this.updateComboPosition(this.parsedAttributes)}getKeySize(t){const{collapsed:e,childrenNode:r=[]}=t;return r.length===0?this.getEmptyKeySize(t):e?this.getCollapsedKeySize(t):this.getExpandedKeySize(t)}getEmptyKeySize(t){const{padding:e,collapsedSize:r}=t,[i,a,s,o]=Ri(e);return Ne(si(r),[o+a,i+s,0])}getCollapsedKeySize(t){return si(t.collapsedSize)}getExpandedKeySize(t){const e=this.getContentBBox(t);return[ta(e),ea(e),0]}getContentBBox(t){const{childrenNode:e=[],padding:r}=t,i=e.map(s=>this.context.element.getElement(s)).filter(Boolean);if(i.length===0){const s=new pn,{x:o=0,y:l=0,size:c}=t,[u,h]=si(c);return s.setMinMax([o-u/2,l-h/2,0],[o+u/2,l+h/2,0]),s}const a=dl(i.map(s=>s.getBounds()));return r?Fa(a,r):a}drawCollapsedMarkerShape(t,e){const r=this.getCollapsedMarkerStyle(t);this.upsert("collapsed-marker",Uy,r,e),tv(this)}getCollapsedMarkerStyle(t){if(!t.collapsed||!t.collapsedMarker)return!1;const e=Qn(this.getGraphicStyle(t),"collapsedMarker"),{type:r}=e,i=s1(e,["type"]),a=this.getShape("key"),[s,o]=ma(a.getLocalBounds(),"center"),l=Object.assign(Object.assign({},i),{x:s,y:o});if(r){const c=this.getCollapsedMarkerText(r,t);Object.assign(l,{text:c})}return l}getCollapsedMarkerText(t,e){const{childrenData:r=[]}=e,{model:i}=this.context;return t==="descendant-count"?i.getDescendantsData(this.id).length.toString():t==="child-count"?r.length.toString():t==="node-count"?i.getDescendantsData(this.id).filter(a=>i.getElementType(At(a))==="node").length.toString():fe(t)?t(r):""}getComboPosition(t){const{x:e=0,y:r=0,collapsed:i,childrenData:a=[]}=t;if(a.length===0)return[+e,+r,0];if(i){const{model:s}=this.context,o=s.getDescendantsData(this.id).filter(l=>!s.isCombo(At(l)));if(o.length>0&&o.some(xN)){const l=o.reduce((c,u)=>Ne(c,ir(u)),[0,0,0]);return Ii(l,o.length)}return[+e,+r,0]}return this.getContentBBox(t).center}getComboStyle(t){const[e,r]=this.getComboPosition(t);return{x:e,y:r,transform:[["translate",e,r]]}}updateComboPosition(t){const e=this.getComboStyle(t);Object.assign(this.style,e);const{x:r,y:i}=e;this.context.model.syncNodeLikeDatum({id:this.id,style:{x:r,y:i}}),ev(this)}render(t,e=this){super.render(t,e),this.drawCollapsedMarkerShape(t,e)}update(t={}){super.update(t),this.updateComboPosition(this.parsedAttributes)}onframe(){super.onframe(),this.attributes.collapsed||this.updateComboPosition(this.parsedAttributes),this.drawKeyShape(this.parsedAttributes,this)}animate(t,e){const r=super.animate(this.attributes.collapsed?t:t.map(i=>{var{x:a,y:s,z:o,transform:l}=i,c=s1(i,["x","y","z","transform"]);return c}),e);return r&&new Proxy(r,{set:(i,a,s)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,s))})}}yo.defaultStyleProps={childrenNode:[],droppable:!0,draggable:!0,collapsed:!1,collapsedSize:32,collapsedMarker:!0,collapsedMarkerZIndex:1,collapsedMarkerFontSize:12,collapsedMarkerTextAlign:"center",collapsedMarkerTextBaseline:"middle",collapsedMarkerType:"child-count"};class $k extends yo{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",Ji,this.getKeyStyle(t),e)}getKeyStyle(t){const{collapsed:e}=t,r=super.getKeyStyle(t),[i]=this.getKeySize(t);return Object.assign(Object.assign(Object.assign({},r),e&&Qn(r,"collapsed")),{r:i/2})}getCollapsedKeySize(t){const[e,r]=si(t.collapsedSize),i=Math.max(e,r)/2;return[i*2,i*2,0]}getExpandedKeySize(t){const e=this.getContentBBox(t),[r,i]=Ia(e),a=Math.sqrt(Math.pow(r,2)+Math.pow(i,2))/2;return[a*2,a*2,0]}getIntersectPoint(t,e=!1){const r=this.getShape("key").getBounds();return du(t,r,e)}}class t3 extends yo{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",gr,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t),[r,i]=this.getKeySize(t);return Object.assign(Object.assign(Object.assign({},e),t.collapsed&&Qn(e,"collapsed")),{width:r,height:i,x:-r/2,y:-i/2})}}var e3=function(n,t){if(!cl(n))return n;for(var e=[],r=0;r<n.length;r++){var i=n[r];t(i,r)&&e.push(i)}return e},n3=e3,r3=function(n,t){return cl(n)?n.indexOf(t)>-1:!1},i3=r3,a3=function(n,t){return t===void 0&&(t=[]),n3(n,function(e){return!i3(t,e)})},s3=a3;const o3={padding:10};function o1(n,t,e,r,i,a){const{padding:s}=Object.assign(o3,a),o=Ba(e,s),l=Ba(r,s),c=[n,...i,t];let u=null;const h=[];for(let d=0,f=c.length;d<f-1;d++){const v=d+1,g=c[d],p=c[v],y=wN(g,p);let b=null;if(d===0)if(v===f-1)if(o.intersects(l))b=uv(g,p,o,l);else if(!Kc(g,o)&&!Kc(p,l)){const E=Ns(g,o),O=Ns(p,l);b=c1(E,O,Br(E,O)),b.points.unshift(E),b.points.push(O)}else y||(b=c3(g,p,o,l));else Li(p,o)?b=uv(g,p,o,Ba(p,s),u):y||(b=Pu(g,p,o));else v===f-1?Li(g,l)?b=uv(g,p,Ba(g,s),l,u):y||(b=u1(g,p,l,u)):y||(b=c1(g,p,u));b?(h.push(...b.points),u=b.direction):u=Br(g,p),v<f-1&&h.push(p)}return h.map(Rs)}const l3={N:"S",S:"N",W:"E",E:"W"},l1={N:-Math.PI/2,S:Math.PI/2,E:0,W:Math.PI};function Br(n,t){const[e,r]=n,[i,a]=t;return e===i?r>a?"N":"S":r===a?e>i?"W":"E":null}function cv(n,t){return t==="N"||t==="S"?ea(n):ta(n)}function c1(n,t,e){const r=[n[0],t[1]],i=[t[0],n[1]],a=Br(n,r),s=Br(n,i),o=e?l3[e]:null,l=a===e||a!==o&&s!==e?r:i;return{points:[l],direction:Br(l,t)}}function Pu(n,t,e){if(Kc(n,e)){const r=Ml(n,t,e);return{points:[r],direction:Br(r,t)}}else{const r=Ns(n,e),a=["left","right"].includes(fl(n,e))?[t[0],r[1]]:[r[0],t[1]];return{points:[a],direction:Br(a,t)}}}function u1(n,t,e,r){const i=Kc(t,e)?t:Ns(t,e),a=[[i[0],n[1]],[n[0],i[1]]],s=a.filter(l=>OO(l,e)&&!Lm(l,e,!0)),o=s.filter(l=>Br(l,n)!==r);if(o.length>0){const l=o.find(c=>Br(n,c)===r)||o[0];return{points:[l],direction:Br(l,t)}}else{const l=s3(a,s)[0],c=Za(t,l,cv(e,r)/2);return{points:[Ml(c,n,e),c],direction:Br(c,t)}}}function c3(n,t,e,r){let i=Pu(n,t,e);const a=pl(i.points[0]);if(Li(a,r)){i=Pu(t,n,r);const s=pl(i.points[0]);if(Li(s,e)){const o=Za(n,a,cv(e,Br(n,a))/2),l=Za(t,s,cv(r,Br(t,s))/2),c=[(o[0]+l[0])/2,(o[1]+l[1])/2],u=Pu(n,c,e),h=u1(c,t,r,u.direction);i.points=[u.points[0],h.points[0]],i.direction=h.direction}}return i}function uv(n,t,e,r,i){const s=dl([e,r]),o=bn(t,s.center)>bn(n,s.center),[l,c]=o?[t,n]:[n,t],u=ea(s)+ta(s);let h;if(i){const v=[l[0]+u*Math.cos(l1[i]),l[1]+u*Math.sin(l1[i])];h=Za(Ns(v,s),v,.01)}else h=Za(Ns(l,s),l,-.01);let d=Ml(h,c,s),f=[ml(h,2),ml(d,2)];if(Zn(ml(h),ml(d))){const v=Vf(ln(h,l),[1,0,0])+Math.PI/2;d=[c[0]+u*Math.cos(v),c[1]+u*Math.sin(v),0],d=ml(Za(Ns(d,s),c,-.01),2);const g=Ml(h,d,s);f=[h,g,d]}return{points:o?f.reverse():f,direction:Br(o?h:d,t)}}function Ml(n,t,e){let r=[n[0],t[1]];return Li(r,e)&&(r=[t[0],n[1]]),r}function h1(n,t,e,r,i){let l=typeof t=="number"?t:.5;t==="start"&&(l=0),t==="end"&&(l=.99);const c=mr(n.getPoint(l)),u=mr(n.getPoint(l+.01));let h=t==="start"?"left":t==="end"?"right":"center";if(Ty(c,u)||!e){const[y,b]=d1(n,l,r,i);return{transform:[["translate",y,b]],textAlign:h}}let d=Math.atan2(u[1]-c[1],u[0]-c[0]);u[0]<c[0]&&(h=h==="center"?h:h==="left"?"right":"left",r*=-1,d+=Math.PI);const[v,g]=d1(n,l,r,i,d),p=[["translate",v,g],["rotate",d/Math.PI*180]];return{textAlign:h,transform:p}}function u3(n,t,e,r,i){var a,s;const o=((a=n.badge)===null||a===void 0?void 0:a.getGeometryBounds().halfExtents[0])*2||0,l=((s=n.label)===null||s===void 0?void 0:s.getGeometryBounds().halfExtents[0])*2||0;return h1(n.key,e,!0,(l?(l/2+o/2)*(t==="suffix"?1:-1):0)+r,i)}function d1(n,t,e,r,i){const[a,s]=mr(n.getPoint(t));let o=e,l=r;return i&&(o=e*Math.cos(i)-r*Math.sin(i),l=e*Math.sin(i)+r*Math.cos(i)),[a+o,s+l]}function hv(n,t,e,r){if(Zn(n,t))return n;const i=ln(t,n),a=[n[0]+e*i[0],n[1]+e*i[1]],s=pa(hu(i,!1));return a[0]+=r*s[0],a[1]+=r*s[1],a}function h3(n){return ie(n)?[n,-n]:n}function d3(n){return ie(n)?[n,1-n]:n}function f3(n,t,e){return[["M",n[0],n[1]],["Q",e[0],e[1],t[0],t[1]]]}function f1(n,t,e){return[["M",n[0],n[1]],["C",e[0][0],e[0][1],e[1][0],e[1][1],t[0],t[1]]]}function dv(n,t=0,e=!1){const r=n.length-1,i=n[0],a=n[r],s=n.slice(1,r),o=[["M",i[0],i[1]]];return s.forEach((l,c)=>{const u=s[c-1]||i,h=s[c+1]||a;if(!Oy(u,l,h)&&t){const[d,f]=v3(u,l,h,t);o.push(["L",d[0],d[1]],["Q",l[0],l[1],f[0],f[1]],["L",f[0],f[1]])}else o.push(["L",l[0],l[1]])}),o.push(["L",a[0],a[1]]),e&&o.push(["Z"]),o}function v3(n,t,e,r){const i=uu(n,t),a=uu(e,t),s=Math.min(r,Math.min(i,a)/2),o=[t[0]-s/i*(t[0]-n[0]),t[1]-s/i*(t[1]-n[1])],l=[t[0]-s/a*(t[0]-e[0]),t[1]-s/a*(t[1]-e[1])];return[o,l]}const g3=n=>{const t=Math.PI/2,e=ea(n)/2,r=ta(n)/2,i=Math.atan2(e,r)/2,a=Math.atan2(r,e)/2;return{top:[-t-a,-t+a],"top-right":[-t+a,-i],"right-top":[-t+a,-i],right:[-i,i],"bottom-right":[i,t-a],"right-bottom":[i,t-a],bottom:[t-a,t+a],"bottom-left":[t+a,Math.PI-i],"left-bottom":[t+a,Math.PI-i],left:[Math.PI-i,Math.PI+i],"top-left":[Math.PI+i,-t-a],"left-top":[Math.PI+i,-t-a]}};function v1(n,t,e,r,i){const a=Ba(n),s=n.getCenter();let o=r&&Ua(r),l=i&&Ua(i);if(!o||!l){const c=g3(a),u=c[t][0],h=c[t][1],[d,f]=Ia(a),v=Math.max(d,f),g=Ne(s,[v*Math.cos(u),v*Math.sin(u),0]),p=Ne(s,[v*Math.cos(h),v*Math.sin(h),0]);o=mv(n,g),l=mv(n,p),e||([o,l]=[l,o])}return[o,l]}function p3(n,t,e,r,i,a){const s=n.getPorts()[i||a],o=n.getPorts()[a||i];let[l,c]=v1(n,t,e,s,o);const u=m3(n,l,c,r);return s&&(l=Tl(s,u[0])),o&&(c=Tl(o,u.at(-1))),f1(l,c,u)}function m3(n,t,e,r){const i=n.getCenter();if(Zn(t,e)){const a=ln(t,i),s=[r*Math.sign(a[0])||r/2,r*Math.sign(a[1])||-r/2,0];return[Ne(t,s),Ne(e,Di(s,[1,-1,1]))]}return[Za(i,t,bn(i,t)+r),Za(i,e,bn(i,e)+r)]}function y3(n,t,e,r,i,a,s){const o=pv(n),l=o[a||s],c=o[s||a];let[u,h]=v1(n,e,r,l,c);const d=b3(n,u,h,i);return l&&(u=Tl(l,d[0])),c&&(h=Tl(c,d.at(-1))),dv([u,...d,h],t)}function b3(n,t,e,r){const i=[],a=Ba(n);if(Zn(t,e))switch(fl(t,a)){case"left":i.push([t[0]-r,t[1]]),i.push([t[0]-r,t[1]+r]),i.push([t[0],t[1]+r]);break;case"right":i.push([t[0]+r,t[1]]),i.push([t[0]+r,t[1]+r]),i.push([t[0],t[1]+r]);break;case"top":i.push([t[0],t[1]-r]),i.push([t[0]+r,t[1]-r]),i.push([t[0]+r,t[1]]);break;case"bottom":i.push([t[0],t[1]+r]),i.push([t[0]+r,t[1]+r]),i.push([t[0]+r,t[1]]);break}else{const s=fl(t,a),o=fl(e,a);if(s===o){const l=s;let c,u;switch(l){case"left":c=Math.min(t[0],e[0])-r,i.push([c,t[1]]),i.push([c,e[1]]);break;case"right":c=Math.max(t[0],e[0])+r,i.push([c,t[1]]),i.push([c,e[1]]);break;case"top":u=Math.min(t[1],e[1])-r,i.push([t[0],u]),i.push([e[0],u]);break;case"bottom":u=Math.max(t[1],e[1])+r,i.push([t[0],u]),i.push([e[0],u]);break}}else{const l=(d,f)=>({left:[f[0]-r,f[1]],right:[f[0]+r,f[1]],top:[f[0],f[1]-r],bottom:[f[0],f[1]+r]})[d],c=l(s,t),u=l(o,e),h=Ml(c,u,a);i.push(c,h,u)}}return i}function fv(n,t){const e=new Set,r=new Set,i=new Set;return n.forEach(a=>{t(a).forEach(o=>{e.add(o),n.includes(o.source)&&n.includes(o.target)?r.add(o):i.add(o)})}),{edges:Array.from(e),internal:Array.from(r),external:Array.from(i)}}function g1(n,t){const e=[];let r=n;for(;r;){e.push(r);const i=t(At(r));if(i)r=i;else break}if(e.some(i=>{var a;return(a=i.style)===null||a===void 0?void 0:a.collapsed})){const i=e.reverse().findIndex(Kr);return e[i]||e.at(-1)}return n}function x3(n,t){return t||(n<4?10:n===4?12:n*2.5)}const E3=(n,t)=>{const e=Math.max(n,t)/2;return[["M",-n/2,0],["A",e,e,0,1,0,2*e-n/2,0],["A",e,e,0,1,0,-n/2,0],["Z"]]},p1=(n,t)=>[["M",-n/2,0],["L",n/2,-t/2],["L",n/2,t/2],["Z"]],w3=(n,t)=>[["M",-n/2,0],["L",0,-t/2],["L",n/2,0],["L",0,t/2],["Z"]],S3=(n,t)=>[["M",-n/2,0],["L",n/2,-t/2],["L",4*n/5-n/2,0],["L",n/2,t/2],["Z"]],M3=(n,t)=>[["M",-n/2,-t/2],["L",n/2,-t/2],["L",n/2,t/2],["L",-n/2,t/2],["Z"]],A3=(n,t)=>{const e=n/2,r=n/7,i=n-r;return[["M",-e,0],["L",0,-t/2],["L",0,t/2],["Z"],["M",i-e,-t/2],["L",i+r-e,-t/2],["L",i+r-e,t/2],["L",i-e,t/2],["Z"]]},T3=(n,t)=>[["M",n/2,-t/2],["L",-n/2,0],["L",n/2,0],["L",-n/2,0],["L",n/2,t/2]];var Ru=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Va extends Yy{constructor(t){super(ur({style:Va.defaultStyleProps},t)),this.type="edge"}get sourceNode(){const{sourceNode:t}=this.parsedAttributes;return this.context.element.getElement(t)}get targetNode(){const{targetNode:t}=this.parsedAttributes;return this.context.element.getElement(t)}getKeyStyle(t){const e=this.getGraphicStyle(t),{loop:r}=e,i=Ru(e,["loop"]),{sourceNode:a,targetNode:s}=this,l={d:r&&I3(a,s)?this.getLoopPath(t):this.getKeyPath(t)};return ni.PARSED_STYLE_LIST.forEach(c=>{c in i&&(l[c]=i[c])}),l}getLoopPath(t){const{sourcePort:e,targetPort:r}=t,i=this.sourceNode,a=Ba(i),s=Math.max(ta(a),ea(a)),{placement:o,clockwise:l,dist:c=s}=Qn(this.getGraphicStyle(t),"loop");return p3(i,o,l,c,e,r)}getEndpoints(t,e=!0,r=[]){const{sourcePort:i,targetPort:a}=t,{sourceNode:s,targetNode:o}=this,[l,c]=F3(s,o,i,a);if(!e){const f=l?Ua(l):s.getCenter(),v=c?Ua(c):o.getCenter();return[f,v]}const u=typeof r=="function"?r():r,h=M1(l||s,u[0]||c||o),d=M1(c||o,u[u.length-1]||l||s);return[h,d]}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getKeyStyle(t),r=Qn(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign({},e),r)}getLabelStyle(t){if(t.label===!1||!t.labelText)return!1;const e=Qn(this.getGraphicStyle(t),"label"),{placement:r,offsetX:i,offsetY:a,autoRotate:s,maxWidth:o}=e,l=Ru(e,["placement","offsetX","offsetY","autoRotate","maxWidth"]),c=h1(this.shapeMap.key,r,s,i,a),u=this.shapeMap.key.getLocalBounds(),h=IN([u.min,u.max],o);return Object.assign({wordWrapWidth:h},c,l)}getBadgeStyle(t){if(t.badge===!1||!t.badgeText)return!1;const e=Qn(t,"badge"),{offsetX:r,offsetY:i,placement:a}=e,s=Ru(e,["offsetX","offsetY","placement"]);return Object.assign(s,u3(this.shapeMap,a,t.labelPlacement,r,i))}drawArrow(t,e){var r;const i=e==="start",s=t[e==="start"?"startArrow":"endArrow"],o=this.shapeMap.key;if(s){const l=this.getArrowStyle(t,i),[c,u,h]=i?["markerStart","markerStartOffset","startArrowOffset"]:["markerEnd","markerEndOffset","endArrowOffset"],d=o.parsedStyle[c];if(d)d.attr(l);else{const f=l.src?sl:ni,v=new f({style:l});o.style[c]=v}o.style[u]=t[h]||l.width/2+ +l.lineWidth}else{const l=i?"markerStart":"markerEnd";(r=o.style[l])===null||r===void 0||r.destroy(),o.style[l]=null}}getArrowStyle(t,e){const r=this.getShape("key").attributes,i=e?"startArrow":"endArrow",a=Qn(this.getGraphicStyle(t),i),{size:s,type:o}=a,l=Ru(a,["size","type"]),[c,u]=si(x3(r.lineWidth,s)),d=(fe(o)?o:Z[o]||p1)(c,u);return Object.assign(Bs(r,["stroke","strokeOpacity","fillOpacity"]),{width:c,height:u},Object.assign({},d&&{d,fill:o==="simple"?"":r.stroke}),l)}drawLabelShape(t,e){const r=this.getLabelStyle(t);this.upsert("label",Wa,r,e)}drawHaloShape(t,e){const r=this.getHaloStyle(t);this.upsert("halo",ni,r,e)}drawBadgeShape(t,e){const r=this.getBadgeStyle(t);this.upsert("badge",po,r,e)}drawSourceArrow(t){this.drawArrow(t,"start")}drawTargetArrow(t){this.drawArrow(t,"end")}drawKeyShape(t,e){const r=this.getKeyStyle(t);return this.upsert("key",ni,r,e)}render(t=this.parsedAttributes,e=this){this.drawKeyShape(t,e),this.getShape("key")&&(this.drawSourceArrow(t),this.drawTargetArrow(t),this.drawLabelShape(t,e),this.drawHaloShape(t,e),this.drawBadgeShape(t,e))}onframe(){this.drawKeyShape(this.parsedAttributes,this),this.drawSourceArrow(this.parsedAttributes),this.drawTargetArrow(this.parsedAttributes),this.drawHaloShape(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this),this.drawBadgeShape(this.parsedAttributes,this)}animate(t,e){const r=super.animate(t,e);return r&&new Proxy(r,{set:(i,a,s)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,s))})}}Va.defaultStyleProps={badge:!0,badgeOffsetX:0,badgeOffsetY:0,badgePlacement:"suffix",isBillboard:!0,label:!0,labelAutoRotate:!0,labelIsBillboard:!0,labelMaxWidth:"80%",labelOffsetX:4,labelOffsetY:0,labelPlacement:"center",labelTextBaseline:"middle",labelWordWrap:!1,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloPointerEvents:"none",haloStrokeOpacity:.25,haloZIndex:-1,loop:!0,startArrow:!1,startArrowLineDash:0,startArrowLineJoin:"round",startArrowLineWidth:1,startArrowTransformOrigin:"center",startArrowType:"vee",endArrow:!1,endArrowLineDash:0,endArrowLineJoin:"round",endArrowLineWidth:1,endArrowTransformOrigin:"center",endArrowType:"vee",loopPlacement:"top",loopClockwise:!0};class Fs extends Va{constructor(t){super(ur({style:Fs.defaultStyleProps},t))}getKeyPath(t){const[e,r]=this.getEndpoints(t),{controlPoints:i,curvePosition:a,curveOffset:s}=t,o=this.getControlPoints(e,r,d3(a),h3(s),i);return f1(e,r,o)}getControlPoints(t,e,r,i,a){return(a==null?void 0:a.length)===2?a:[hv(t,e,r[0],i[0]),hv(t,e,r[1],i[1])]}}Fs.defaultStyleProps={curvePosition:.5,curveOffset:20};class Lu extends Fs{constructor(t){super(ur({style:Lu.defaultStyleProps},t))}getControlPoints(t,e,r,i){const a=e[0]-t[0];return[[t[0]+a*r[0]+i[0],t[1]],[e[0]-a*r[1]+i[1],e[1]]]}}Lu.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class _u extends Fs{constructor(t){super(ur({style:_u.defaultStyleProps},t))}get ref(){return this.context.model.getRootsData()[0]}getEndpoints(t){if(this.sourceNode.id===this.ref.id)return super.getEndpoints(t);const e=ir(this.ref),r=this.sourceNode.getIntersectPoint(e,!0),i=this.targetNode.getIntersectPoint(e);return[r,i]}toRadialCoordinate(t){const e=ir(this.ref),r=bn(t,e),i=wy(ln(t,e));return[r,i]}getControlPoints(t,e,r,i){const[a,s]=this.toRadialCoordinate(t),[o]=this.toRadialCoordinate(e),l=o-a;return[[t[0]+(l*r[0]+i[0])*Math.cos(s),t[1]+(l*r[0]+i[0])*Math.sin(s)],[e[0]-(l*r[1]-i[0])*Math.cos(s),e[1]-(l*r[1]-i[0])*Math.sin(s)]]}}_u.defaultStyleProps={curvePosition:.5,curveOffset:20};class Du extends Fs{constructor(t){super(ur({style:Du.defaultStyleProps},t))}getControlPoints(t,e,r,i){const a=e[1]-t[1];return[[t[0],t[1]+a*r[0]+i[0]],[e[0],e[1]-a*r[1]+i[1]]]}}Du.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class Iu extends Va{constructor(t){super(ur({style:Iu.defaultStyleProps},t))}getKeyPath(t){const[e,r]=this.getEndpoints(t);return[["M",e[0],e[1]],["L",r[0],r[1]]]}}Iu.defaultStyleProps={};const O3={enableObstacleAvoidance:!1,offset:10,maxAllowedDirectionChange:Math.PI/2,maximumLoops:3e3,gridSize:5,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{right:{stepX:1,stepY:0},left:{stepX:-1,stepY:0},bottom:{stepX:0,stepY:1},top:{stepX:0,stepY:-1}},penalties:{0:0,90:0},distFunc:uu},ba=n=>`${Math.round(n[0])}|||${Math.round(n[1])}`;function zs(n,t){const e=r=>Math.round(r/t);return ie(n)?e(n):n.map(e)}function C3(n,t){const e=Math.abs(n-t);return e>Math.PI?2*Math.PI-e:e}function m1(n,t){const e=t[0]-n[0],r=t[1]-n[1];return!e&&!r?0:Math.atan2(r,e)}function y1(n,t,e,r){const i=m1(n,t),a=e[ba(n)],o=m1(a||r,n);return C3(o,i)}const N3=(n,t)=>{const{offset:e,gridSize:r}=t,i={};return n.forEach(a=>{if(!a||a.destroyed||!a.isVisible())return;const s=Fa(a.getRenderBounds(),e);for(let o=zs(s.min[0],r);o<=zs(s.max[0],r);o+=1)for(let l=zs(s.min[1],r);l<=zs(s.max[1],r);l+=1)i[`${o}|||${l}`]=!0}),i};function b1(n,t,e){return Math.min(...t.map(r=>e(n,r)))}function k3(n,t,e){let r=n[0],i=e(n[0],t);for(let a=0;a<n.length;a++){const s=n[a],o=e(s,t);o<i&&(r=s,i=o)}return r}const x1=(n,t,e,r)=>{if(!t)return[n];const{directionMap:i,offset:a}=r,s=Fa(t.getRenderBounds(),a),o=Object.keys(i).reduce((l,c)=>{if(e.includes(c)){const u=i[c],[h,d]=Ia(s),f=[n[0]+u.stepX*h,n[1]+u.stepY*d],v=kO(s);for(let g=0;g<v.length;g++){const p=Yf([n,f],v[g]);p&&Lm(p,s)&&l.push(p)}}return l},[]);return Li(n,s)||o.push(n),o.map(l=>zs(l,r.gridSize))},P3=(n,t,e,r,i,a,s)=>{const o=[];let l=[a[0]===r[0]?r[0]:n[0]*s,a[1]===r[1]?r[1]:n[1]*s];o.unshift(l);let c=n,u=t[ba(c)];for(;u;){const f=u,v=c;y1(f,v,t,e)&&(l=[f[0]===v[0]?l[0]:f[0]*s,f[1]===v[1]?l[1]:f[1]*s],o.unshift(l)),u=t[ba(f)],c=f}const h=i.map(f=>[f[0]*s,f[1]*s]),d=k3(h,l,uu);return o.unshift(d),o};function R3(n,t,e,r){const i=Rs(n.getCenter()),a=Rs(t.getCenter()),s=Object.assign(O3,r),{gridSize:o}=s,l=s.enableObstacleAvoidance?e:[n,t],c=N3(l,s),u=zs(i,o),h=zs(a,o),d=x1(i,n,s.startDirections,s),f=x1(a,t,s.endDirections,s);d.forEach(I=>delete c[ba(I)]),f.forEach(I=>delete c[ba(I)]);const v={},g={},p={},y={},b={},E=new L3;for(let I=0;I<d.length;I++){const V=d[I],Y=ba(V);v[Y]=V,y[Y]=0,b[Y]=b1(V,f,s.distFunc),E.add({id:Y,value:b[Y]})}const O=f.map(I=>ba(I));let P=s.maximumLoops,L,F=1/0;for(const[I,V]of Object.entries(v))b[I]<=F&&(F=b[I],L=V);for(;Object.keys(v).length>0&&P>0;){const I=E.minId(!1);if(I)L=v[I];else break;const V=ba(L);if(O.includes(V))return P3(L,p,u,a,d,h,o);delete v[V],E.remove(V),g[V]=!0;for(const Y of Object.values(s.directionMap)){const J=Ne(L,[Y.stepX,Y.stepY]),$=ba(J);if(g[$])continue;const ot=y1(L,J,p,u);if(ot>s.maxAllowedDirectionChange||c[$])continue;v[$]||(v[$]=J);const ct=s.penalties[ot],ft=s.distFunc(L,J)+(isNaN(ct)?o:ct),Nt=y[V]+ft,Ot=y[$];Ot&&Nt>=Ot||(p[$]=L,y[$]=Nt,b[$]=Nt+b1(J,f,s.distFunc),E.add({id:$,value:b[$]}))}P-=1}return[]}class L3{constructor(){this.arr=[],this.map={},this.arr=[],this.map={}}_innerAdd(t,e){let r=0,i=e-1;for(;i-r>1;){const a=Math.floor((r+i)/2);if(this.arr[a].value>t.value)i=a;else if(this.arr[a].value<t.value)r=a;else{this.arr.splice(a,0,t),this.map[t.id]=!0;return}}this.arr.splice(i,0,t),this.map[t.id]=!0}add(t){delete this.map[t.id];const e=this.arr.length;if(!e||this.arr[e-1].value<t.value){this.arr.push(t),this.map[t.id]=!0;return}this._innerAdd(t,e)}remove(t){this.map[t]&&delete this.map[t]}_clearAndGetMinId(){let t;for(let 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}_findFirstId(){for(;this.arr.length;){const t=this.arr.shift();if(this.map[t.id])return t.id}}minId(t){return t?this._clearAndGetMinId():this._findFirstId()}}class Bu extends Va{constructor(t){super(ur({style:Bu.defaultStyleProps},t))}getControlPoints(t){const{router:e}=t,{sourceNode:r,targetNode:i}=this,[a,s]=this.getEndpoints(t,!1);let o=[];if(!e)o=t.controlPoints;else if(e.type==="shortest-path"){const l=this.context.element.getNodes();o=R3(r,i,l,e),o.length||(o=o1(a,s,r,i,t.controlPoints,{padding:e.offset}))}else e.type==="orth"&&(o=o1(a,s,r,i,t.controlPoints,e));return o}getPoints(t){const e=this.getControlPoints(t),[r,i]=this.getEndpoints(t,!0,e);return[r,...e,i]}getKeyPath(t){const e=this.getPoints(t);return dv(e,t.radius)}getLoopPath(t){const{sourcePort:e,targetPort:r,radius:i}=t,a=this.sourceNode,s=Ba(a),o=Math.max(ta(s),ea(s))/4,{placement:l,clockwise:c,dist:u=o}=Qn(this.getGraphicStyle(t),"loop");return y3(a,i,l,c,u,e,r)}}Bu.defaultStyleProps={radius:0,controlPoints:[],router:!1};class Fu extends Va{constructor(t){super(ur({style:Fu.defaultStyleProps},t))}getKeyPath(t){const{curvePosition:e,curveOffset:r}=t,[i,a]=this.getEndpoints(t),s=t.controlPoint||hv(i,a,e,r);return f3(i,a,s)}}Fu.defaultStyleProps={curvePosition:.5,curveOffset:30};var _3=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function Al(n){return n instanceof Fi&&n.type==="node"}function E1(n){return n instanceof Va}function vv(n){return n instanceof yo}function D3(n){return Al(n)||E1(n)||vv(n)}function I3(n,t){return!n||!t?!1:n===t}const B3={top:[.5,0],right:[1,.5],bottom:[.5,1],left:[0,.5],"left-top":[0,0],"top-left":[0,0],"left-bottom":[0,1],"bottom-left":[0,1],"right-top":[1,0],"top-right":[1,0],"right-bottom":[1,1],"bottom-right":[1,1],default:[.5,.5]};function gv(n,t,e=B3,r=!0){const i=[.5,.5],a=Ge(t)?yr(e,t.toLocaleLowerCase(),i):t;if(!r&&Ge(t))return a;const[s,o]=a||i;return[n.min[0]+ta(n)*s,n.min[1]+ea(n)*o]}function pv(n){if(!n)return{};const t=n.getPorts();return(n.attributes.ports||[]).forEach((r,i)=>{var a;const{key:s,placement:o}=r;w1(r)&&(t[a=s||i]||(t[a]=ma(n.getShape("key").getBounds(),o)))}),t}function w1(n){const{r:t}=n;return!t||Number(t)===0}function Ua(n){return fo(n)?n:n.getPosition()}function F3(n,t,e,r){const i=S1(n,t,e,r),a=S1(t,n,r,e);return[i,a]}function S1(n,t,e,r){const i=pv(n);if(e)return i[e];const a=Object.values(i);if(a.length===0)return;const s=a.map(c=>Ua(c)),o=z3(t,r),[l]=AN(s,o);return a.find(c=>Ua(c)===l)}function z3(n,t){const e=pv(n);if(t)return[Ua(e[t])];const r=Object.values(e);return r.length>0?r.map(i=>Ua(i)):[n.getCenter()]}function M1(n,t){return vv(n)||Al(n)?mv(n,t):Tl(n,t)}function Tl(n,t){if(!n||!t)return[0,0,0];if(fo(n))return n;if(n.attributes.linkToCenter)return n.getPosition();const e=fo(t)?t:Al(t)?t.getCenter():t.getPosition();return du(e,n.getBounds())}function mv(n,t){if(!n||!t)return[0,0,0];const e=fo(t)?t:Al(t)?t.getCenter():t.getPosition();return n.getIntersectPoint(e)||n.getCenter()}function A1(n,t="bottom",e=0,r=0,i=!1){const a=t.split("-"),[s,o]=ma(n,t),[l,c]=i?["bottom","top"]:["top","bottom"],u=a.includes("top")?c:a.includes("bottom")?l:"middle",h=a.includes("left")?"right":a.includes("right")?"left":"center";return{transform:[["translate",s+e,o+r]],textBaseline:u,textAlign:h}}function j3(n,t){return[[0,-n],[t*Math.cos(3*Math.PI/10),-t*Math.sin(3*Math.PI/10)],[n*Math.cos(Math.PI/10),-n*Math.sin(Math.PI/10)],[t*Math.cos(Math.PI/10),t*Math.sin(Math.PI/10)],[n*Math.cos(3*Math.PI/10),n*Math.sin(3*Math.PI/10)],[0,t],[-n*Math.cos(3*Math.PI/10),n*Math.sin(3*Math.PI/10)],[-t*Math.cos(Math.PI/10),t*Math.sin(Math.PI/10)],[-n*Math.cos(Math.PI/10),-n*Math.sin(Math.PI/10)],[-t*Math.cos(3*Math.PI/10),-t*Math.sin(3*Math.PI/10)]]}function Z3(n,t){const e={};return e.top=[0,-n],e.left=[-n*Math.cos(Math.PI/10),-n*Math.sin(Math.PI/10)],e["left-bottom"]=[-n*Math.cos(3*Math.PI/10),n*Math.sin(3*Math.PI/10)],e.bottom=[0,t],e["right-bottom"]=[n*Math.cos(3*Math.PI/10),n*Math.sin(3*Math.PI/10)],e.right=e.default=[n*Math.cos(Math.PI/10),-n*Math.sin(Math.PI/10)],e}function W3(n,t,e){const r=t/2,i=n/2,a={up:[[-i,r],[i,r],[0,-r]],left:[[-i,0],[i,r],[i,-r]],right:[[-i,r],[-i,-r],[i,0]],down:[[-i,-r],[i,-r],[0,r]]};return a[e]||a.up}function G3(n,t,e){const r=t/2,i=n/2,a={};return e==="down"?(a.bottom=a.default=[0,r],a.right=[i,-r],a.left=[-i,-r]):e==="left"?(a.top=[i,-r],a.bottom=[i,r],a.left=a.default=[-i,0]):e==="right"?(a.top=[-i,-r],a.bottom=[-i,r],a.right=a.default=[i,0]):(a.left=[-i,r],a.top=a.default=[0,-r],a.right=[i,r]),a}function s7(n,t){return[[n/2,-t/2],[n/2,t/2],[-n/2,t/2],[-n/2,-t/2]]}function V3(n,t){return[[0,-t/2],[n/2,0],[0,t/2],[-n/2,0]]}function T1(n){return yr(n,["style","visibility"])!=="hidden"}function U3(n,t){const{zIndex:e,transform:r,transformOrigin:i,visibility:a,cursor:s,clipPath:o,component:l}=t,c=_3(t,["zIndex","transform","transformOrigin","visibility","cursor","clipPath","component"]);Object.assign(n.attributes,c),r&&n.setAttribute("transform",r),ie(e)&&n.setAttribute("zIndex",e),i&&n.setAttribute("transformOrigin",i),a&&n.setAttribute("visibility",a),s&&n.setAttribute("cursor",s),o&&n.setAttribute("clipPath",o),l&&n.setAttribute("component",l)}function yv(n,t){"update"in n?n.update(t):n.attr(t)}function Y3(n){return[[0,n],[n*Math.sqrt(3)/2,n/2],[n*Math.sqrt(3)/2,-n/2],[0,-n],[-n*Math.sqrt(3)/2,-n/2],[-n*Math.sqrt(3)/2,n/2]]}function H3(n){bl(n,"__to_be_destroyed__",!0)}function Ol(n){return yr(n,"__to_be_destroyed__",!1)}var X3=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class zu extends ai{constructor(t,e){super(t,Object.assign({},zu.defaultOptions,e)),this.onCollapseExpand=r=>X3(this,void 0,void 0,function*(){if(!this.validate(r))return;const{target:i}=r;if(!D3(i))return;const a=i.id,{model:s,graph:o}=this.context,l=s.getElementDataById(a);if(!l)return!1;const{onCollapse:c,onExpand:u,animation:h,align:d}=this.options;Kr(l)?(yield o.expandElement(a,{animation:h,align:d}),u==null||u(a)):(yield o.collapseElement(a,{animation:h,align:d}),c==null||c(a))}),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.on(`node:${e}`,this.onCollapseExpand),t.on(`combo:${e}`,this.onCollapseExpand)}unbindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.off(`node:${e}`,this.onCollapseExpand),t.off(`combo:${e}`,this.onCollapseExpand)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}zu.defaultOptions={enable:!0,animation:!0,trigger:Bt.DBLCLICK,align:!0};var ju={},K3=function(n){return n=n||"g",ju[n]?ju[n]+=1:ju[n]=1,n+ju[n]},Zu=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};const Q3="g6-create-edge-assist-edge-id",Wu="g6-create-edge-assist-node-id";class Gu extends ai{constructor(t,e){super(t,Object.assign({},Gu.defaultOptions,e)),this.drop=r=>Zu(this,void 0,void 0,function*(){const{targetType:i}=r;["combo","node"].includes(i)&&this.source?yield this.handleCreateEdge(r):yield this.cancelEdge()}),this.handleCreateEdge=r=>Zu(this,void 0,void 0,function*(){var i,a,s;if(!this.validate(r))return;const{graph:o,canvas:l,batch:c,element:u}=this.context,{style:h}=this.options;if(this.source){this.createEdge(r),yield this.cancelEdge();return}c.startBatch(),l.setCursor("crosshair"),this.source=this.getSelectedNodeIDs([r.target.id])[0];const d=o.getElementData(this.source);o.addNodeData([{id:Wu,style:{visibility:"hidden",ports:[{key:"port-1",placement:[.5,.5]}],x:(i=d.style)===null||i===void 0?void 0:i.x,y:(a=d.style)===null||a===void 0?void 0:a.y}}]),o.addEdgeData([{id:Q3,source:this.source,target:Wu,style:Object.assign({pointerEvents:"none"},h)}]),yield(s=u.draw({animation:!1}))===null||s===void 0?void 0:s.finished}),this.updateAssistEdge=r=>Zu(this,void 0,void 0,function*(){var i;if(!this.source)return;const{model:a,element:s}=this.context;a.translateNodeTo(Wu,[r.canvas.x,r.canvas.y]),yield(i=s.draw({animation:!1,silence:!0}))===null||i===void 0?void 0:i.finished}),this.createEdge=r=>{var i,a;const{graph:s}=this.context,{style:o,onFinish:l,onCreate:c}=this.options;if(((i=r.target)===null||i===void 0?void 0:i.id)===void 0||this.source===void 0)return;const h=(a=this.getSelectedNodeIDs([r.target.id]))===null||a===void 0?void 0:a[0],d=`${this.source}-${h}-${K3()}`,f=c({id:d,source:this.source,target:h,style:o});f&&(s.addEdgeData([f]),l(f))},this.cancelEdge=()=>Zu(this,void 0,void 0,function*(){var r;if(!this.source)return;const{graph:i,element:a,batch:s}=this.context;i.removeNodeData([Wu]),this.source=void 0,yield(r=a.draw({animation:!1}))===null||r===void 0?void 0:r.finished,s.endBatch()}),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;this.unbindEvents(),e==="click"?(t.on(bi.CLICK,this.handleCreateEdge),t.on(Cs.CLICK,this.handleCreateEdge),t.on(fa.CLICK,this.cancelEdge),t.on(Hc.CLICK,this.cancelEdge)):(t.on(bi.DRAG_START,this.handleCreateEdge),t.on(Cs.DRAG_START,this.handleCreateEdge),t.on(Bt.POINTER_UP,this.drop)),t.on(Bt.POINTER_MOVE,this.updateAssistEdge)}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(e=>e.id).concat(t)))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;t.off(bi.CLICK,this.handleCreateEdge),t.off(Cs.CLICK,this.handleCreateEdge),t.off(fa.CLICK,this.cancelEdge),t.off(Hc.CLICK,this.cancelEdge),t.off(bi.DRAG_START,this.handleCreateEdge),t.off(Cs.DRAG_START,this.handleCreateEdge),t.off(Bt.POINTER_UP,this.drop),t.off(Bt.POINTER_MOVE,this.updateAssistEdge)}destroy(){this.unbindEvents(),super.destroy()}}Gu.defaultOptions={animation:!0,enable:!0,style:{},trigger:"drag",onCreate:n=>n,onFinish:()=>{}};function q3(n,t,e){var r;return function(){var i=this,a=arguments,s=function(){r=null,e||n.apply(i,a)},o=e&&!r;clearTimeout(r),r=setTimeout(s,t),o&&n.apply(i,a)}}var Cl=q3,O1=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class Vu extends ai{constructor(t,e){super(t,Object.assign({},Vu.defaultOptions,e)),this.isDragging=!1,this.onDragStart=r=>{this.validate(r)&&(this.isDragging=!0,this.context.canvas.setCursor("grabbing"))},this.onDrag=r=>{var i,a,s,o;if(!this.isDragging||Wn.isPinching)return;const l=(a=(i=r.movement)===null||i===void 0?void 0:i.x)!==null&&a!==void 0?a:r.dx,c=(o=(s=r.movement)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:r.dy;l|c&&this.translate([l,c],!1)},this.onDragEnd=()=>{var r,i;this.isDragging=!1,this.context.canvas.setCursor(this.defaultCursor),(i=(r=this.options).onFinish)===null||i===void 0||i.call(r)},this.invokeOnFinish=Cl(()=>{var r,i;(i=(r=this.options).onFinish)===null||i===void 0||i.call(r)},300),this.shortcut=new go(t.graph),this.bindEvents(),this.defaultCursor=this.context.canvas.getConfig().cursor||"default"}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{trigger:t}=this.options;if(Fn(t)){const{up:e=[],down:r=[],left:i=[],right:a=[]}=t;this.shortcut.bind(e,s=>this.onTranslate([0,1],s)),this.shortcut.bind(r,s=>this.onTranslate([0,-1],s)),this.shortcut.bind(i,s=>this.onTranslate([1,0],s)),this.shortcut.bind(a,s=>this.onTranslate([-1,0],s))}else{const{graph:e}=this.context;e.on(Bt.DRAG_START,this.onDragStart),e.on(Bt.DRAG,this.onDrag),e.on(Bt.DRAG_END,this.onDragEnd)}}onTranslate(t,e){return O1(this,void 0,void 0,function*(){if(!this.validate(e))return;const{sensitivity:r}=this.options,i=r*-1;yield this.translate(Di(t,i),this.options.animation),this.invokeOnFinish()})}translate(t,e){return O1(this,void 0,void 0,function*(){t=this.clampByDirection(t),t=this.clampByRange(t),t=this.clampByRotation(t),yield this.context.graph.translateBy(t,e)})}clampByRotation([t,e]){const r=this.context.graph.getRotation();if(r%360===0)return[t,e];const i=r*Math.PI/180,a=Math.cos(i),s=Math.sin(i);return[t*a-e*s,t*s+e*a]}clampByDirection([t,e]){const{direction:r}=this.options;return r==="x"?e=0:r==="y"&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:r,canvas:i}=this.context,[a,s]=i.getSize(),[o,l,c,u]=Ri(this.options.range),h=[s*o,a*l,s*c,a*u],d=Fa(kf(r.getCanvasCenter()),h),f=ln(r.getViewportCenter(),[t,e,0]);if(!Li(f,d)){const{min:[v,g],max:[p,y]}=d;(f[0]<v&&t>0||f[0]>p&&t<0)&&(t=0),(f[1]<g&&e>0||f[1]>y&&e<0)&&(e=0)}return[t,e]}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return typeof e=="function"?e(t):!!e}unbindEvents(){this.shortcut.unbindAll();const{graph:t}=this.context;t.off(Bt.DRAG_START,this.onDragStart),t.off(Bt.DRAG,this.onDrag),t.off(Bt.DRAG_END,this.onDragEnd)}destroy(){this.shortcut.destroy(),this.unbindEvents(),this.context.canvas.setCursor(this.defaultCursor),super.destroy()}}Vu.defaultOptions={enable:n=>"targetType"in n?n.targetType==="canvas":!0,sensitivity:10,direction:"both",range:1/0};var C1=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class Nl extends ai{constructor(t,e){super(t,Object.assign({},Nl.defaultOptions,e)),this.enable=!1,this.enableElements=["node","combo"],this.target=[],this.shadowOrigin=[0,0],this.hiddenEdges=[],this.isDragging=!1,this.onDrop=r=>C1(this,void 0,void 0,function*(){var i;if(this.options.dropEffect!=="link")return;const{model:a,element:s}=this.context,o=r.target.id;this.target.forEach(l=>{const c=a.getParentData(l,dn);c&&At(c)===o&&a.refreshComboData(o),a.setParent(l,o,dn)}),yield(i=s==null?void 0:s.draw({animation:!0}))===null||i===void 0?void 0:i.finished}),this.setCursor=r=>{if(this.isDragging)return;const{type:i}=r,{canvas:a}=this.context,{cursor:s}=this.options;i===Bt.POINTER_ENTER?a.setCursor((s==null?void 0:s.grab)||"grab"):a.setCursor((s==null?void 0:s.default)||"default")},this.onDragStart=this.onDragStart.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragEnd=this.onDragEnd.bind(this),this.onDrop=this.onDrop.bind(this),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{graph:t,canvas:e}=this.context,r=e.getLayer().getContextService().$canvas;r&&(r.addEventListener("blur",this.onDragEnd),r.addEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach(i=>{t.on(`${i}:${Bt.DRAG_START}`,this.onDragStart),t.on(`${i}:${Bt.DRAG}`,this.onDrag),t.on(`${i}:${Bt.DRAG_END}`,this.onDragEnd),t.on(`${i}:${Bt.POINTER_ENTER}`,this.setCursor),t.on(`${i}:${Bt.POINTER_LEAVE}`,this.setCursor)}),["link"].includes(this.options.dropEffect)&&(t.on(Cs.DROP,this.onDrop),t.on(fa.DROP,this.onDrop))}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(e=>e.id).concat(t)))}getDelta(t){const e=this.context.graph.getZoom();return Ii([t.dx,t.dy],e)}onDragStart(t){var e;if(this.enable=this.validate(t),!this.enable)return;const{batch:r,canvas:i,graph:a}=this.context;i.setCursor(((e=this.options.cursor)===null||e===void 0?void 0:e.grabbing)||"grabbing"),this.isDragging=!0,r.startBatch();const s=t.target.id;a.getElementState(s).includes(this.options.state)?this.target=this.getSelectedNodeIDs([s]):this.target=[s],this.hideEdge(),this.context.graph.frontElement(this.target),this.options.shadow&&this.createShadow(this.target)}onDrag(t){if(!this.enable)return;const e=this.getDelta(t);this.options.shadow?this.moveShadow(e):this.moveElement(this.target,e)}onDragEnd(){var t,e,r;if(!this.enable)return;if(this.enable=!1,this.options.shadow){if(!this.shadow)return;this.shadow.style.visibility="hidden";const{x:s=0,y:o=0}=this.shadow.attributes,[l,c]=ln([+s,+o],this.shadowOrigin);this.moveElement(this.target,[l,c])}this.showEdges(),(e=(t=this.options).onFinish)===null||e===void 0||e.call(t,this.target);const{batch:i,canvas:a}=this.context;i.endBatch(),a.setCursor(((r=this.options.cursor)===null||r===void 0?void 0:r.grab)||"grab"),this.isDragging=!1,this.target=[]}validate(t){if(this.destroyed||Ol(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}moveElement(t,e){return C1(this,void 0,void 0,function*(){const{graph:r,model:i}=this.context,{dropEffect:a}=this.options;a==="move"&&t.forEach(s=>i.refreshComboData(s)),r.translateElementBy(Object.fromEntries(t.map(s=>[s,e])),!1)})}moveShadow(t){if(!this.shadow)return;const{x:e=0,y:r=0}=this.shadow.attributes,[i,a]=t;this.shadow.attr({x:+e+i,y:+r+a})}createShadow(t){const e=Qn(this.options,"shadow"),r=dl(t.map(c=>this.context.element.getElement(c).getBounds())),[i,a]=r.min;this.shadowOrigin=[i,a];const[s,o]=Ia(r),l={width:s,height:o,x:i,y:a};this.shadow?this.shadow.attr(Object.assign(Object.assign(Object.assign({},e),l),{visibility:"visible"})):(this.shadow=new gr({style:Object.assign(Object.assign(Object.assign({$layer:"transient"},e),l),{pointerEvents:"none"})}),this.context.canvas.appendChild(this.shadow))}showEdges(){this.options.shadow||this.hiddenEdges.length===0||(this.context.graph.showElement(this.hiddenEdges),this.hiddenEdges=[])}hideEdge(){const{hideEdge:t,shadow:e}=this.options;if(t==="none"||e)return;const{graph:r}=this.context;t==="all"?this.hiddenEdges=r.getEdgeData().map(At):this.hiddenEdges=Array.from(new Set(this.target.map(i=>r.getRelatedEdgesData(i,t).map(At)).flat())),r.hideElement(this.hiddenEdges)}unbindEvents(){const{graph:t,canvas:e}=this.context,r=e.getLayer().getContextService().$canvas;r&&(r.removeEventListener("blur",this.onDragEnd),r.removeEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach(i=>{t.off(`${i}:${Bt.DRAG_START}`,this.onDragStart),t.off(`${i}:${Bt.DRAG}`,this.onDrag),t.off(`${i}:${Bt.DRAG_END}`,this.onDragEnd),t.off(`${i}:${Bt.POINTER_ENTER}`,this.setCursor),t.off(`${i}:${Bt.POINTER_LEAVE}`,this.setCursor)}),t.off(`combo:${Bt.DROP}`,this.onDrop),t.off(`canvas:${Bt.DROP}`,this.onDrop)}destroy(){var t;this.unbindEvents(),(t=this.shadow)===null||t===void 0||t.destroy(),super.destroy()}}Nl.defaultOptions={animation:!0,enable:n=>["node","combo"].includes(n.targetType),dropEffect:"move",state:"selected",hideEdge:"none",shadow:!1,shadowZIndex:100,shadowFill:"#F3F9FF",shadowFillOpacity:.5,shadowStroke:"#1890FF",shadowStrokeOpacity:.9,shadowLineDash:[5,5],cursor:{default:"default",grab:"grab",grabbing:"grabbing"}};var J3="*",$3=function(){function n(){this._events={}}return n.prototype.on=function(t,e,r){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!r}),this},n.prototype.once=function(t,e){return this.on(t,e,!0)},n.prototype.emit=function(t){for(var e=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var a=this._events[t]||[],s=this._events[J3]||[],o=function(l){for(var c=l.length,u=0;u<c;u++)if(l[u]){var h=l[u],d=h.callback,f=h.once;f&&(l.splice(u,1),l.length===0&&delete e._events[t],c--,u--),d.apply(e,r)}};o(a),o(s)},n.prototype.off=function(t,e){if(!t)this._events={};else if(!e)delete this._events[t];else{for(var r=this._events[t]||[],i=r.length,a=0;a<i;a++)r[a].callback===e&&(r.splice(a,1),i--,a--);r.length===0&&delete this._events[t]}return this},n.prototype.getEvents=function(){return this._events},n}(),Uu=$3;function bv(n,t,e,r){for(;n.length;){const i=n.shift();if(e(i))return!0;t.add(i.id),r(i.id).forEach(s=>{t.has(s.id)||(t.add(s.id),n.push(s))})}return!1}function Yu(n,t,e,r){if(e(n))return!0;t.add(n.id);for(const a of r(n.id))if(!t.has(a.id)&&Yu(a,t,e,r))return!0;return!1}const N1=()=>!0;class tP{constructor(t){Cn(this,"graph");Cn(this,"nodeFilter");Cn(this,"edgeFilter");Cn(this,"cacheEnabled");Cn(this,"inEdgesMap",new Map);Cn(this,"outEdgesMap",new Map);Cn(this,"bothEdgesMap",new Map);Cn(this,"allNodesMap",new Map);Cn(this,"allEdgesMap",new Map);Cn(this,"clearCache",()=>{this.inEdgesMap.clear(),this.outEdgesMap.clear(),this.bothEdgesMap.clear(),this.allNodesMap.clear(),this.allEdgesMap.clear()});Cn(this,"refreshCache",()=>{this.clearCache(),this.updateCache(this.graph.getAllNodes().map(t=>t.id))});Cn(this,"updateCache",t=>{const e=new Set;t.forEach(r=>{const i=this.bothEdgesMap.get(r);if(i&&i.forEach(a=>e.add(a.id)),!this.hasNode(r))this.inEdgesMap.delete(r),this.outEdgesMap.delete(r),this.bothEdgesMap.delete(r),this.allNodesMap.delete(r);else{const a=this.graph.getRelatedEdges(r,"in").filter(this.edgeFilter),s=this.graph.getRelatedEdges(r,"out").filter(this.edgeFilter),o=Array.from(new Set([...a,...s]));o.forEach(l=>e.add(l.id)),this.inEdgesMap.set(r,a),this.outEdgesMap.set(r,s),this.bothEdgesMap.set(r,o),this.allNodesMap.set(r,this.graph.getNode(r))}}),e.forEach(r=>{this.hasEdge(r)?this.allEdgesMap.set(r,this.graph.getEdge(r)):this.allEdgesMap.delete(r)})});Cn(this,"handleGraphChanged",t=>{const e=new Set;t.changes.forEach(r=>{switch(r.type){case"NodeAdded":e.add(r.value.id);break;case"NodeDataUpdated":e.add(r.id);break;case"EdgeAdded":e.add(r.value.source),e.add(r.value.target);break;case"EdgeUpdated":(r.propertyName==="source"||r.propertyName==="target")&&(e.add(r.oldValue),e.add(r.newValue));break;case"EdgeDataUpdated":if(t.graph.hasEdge(r.id)){const i=t.graph.getEdge(r.id);e.add(i.source),e.add(i.target)}break;case"EdgeRemoved":e.add(r.value.source),e.add(r.value.target);break;case"NodeRemoved":e.add(r.value.id);break;default:break}}),this.updateCache(e)});this.graph=t.graph;const e=t.nodeFilter||N1,r=t.edgeFilter||N1;this.nodeFilter=e,this.edgeFilter=i=>{const{source:a,target:s}=this.graph.getEdgeDetail(i.id);return!e(a)||!e(s)?!1:r(i,a,s)},t.cache==="auto"?(this.cacheEnabled=!0,this.startAutoCache()):t.cache==="manual"?this.cacheEnabled=!0:this.cacheEnabled=!1}startAutoCache(){this.refreshCache(),this.graph.on("changed",this.handleGraphChanged)}stopAutoCache(){this.graph.off("changed",this.handleGraphChanged)}checkNodeExistence(t){this.getNode(t)}hasNode(t){if(!this.graph.hasNode(t))return!1;const e=this.graph.getNode(t);return this.nodeFilter(e)}areNeighbors(t,e){return this.checkNodeExistence(t),this.getNeighbors(e).some(r=>r.id===t)}getNode(t){const e=this.graph.getNode(t);if(!this.nodeFilter(e))throw new Error("Node not found for id: "+t);return e}getRelatedEdges(t,e){return this.checkNodeExistence(t),this.cacheEnabled?e==="in"?this.inEdgesMap.get(t):e==="out"?this.outEdgesMap.get(t):this.bothEdgesMap.get(t):this.graph.getRelatedEdges(t,e).filter(this.edgeFilter)}getDegree(t,e){return this.getRelatedEdges(t,e).length}getSuccessors(t){const r=this.getRelatedEdges(t,"out").map(i=>this.getNode(i.target));return Array.from(new Set(r))}getPredecessors(t){const r=this.getRelatedEdges(t,"in").map(i=>this.getNode(i.source));return Array.from(new Set(r))}getNeighbors(t){const e=this.getPredecessors(t),r=this.getSuccessors(t);return Array.from(new Set([...e,...r]))}hasEdge(t){if(!this.graph.hasEdge(t))return!1;const e=this.graph.getEdge(t);return this.edgeFilter(e)}getEdge(t){const e=this.graph.getEdge(t);if(!this.edgeFilter(e))throw new Error("Edge not found for id: "+t);return e}getEdgeDetail(t){const e=this.getEdge(t);return{edge:e,source:this.getNode(e.source),target:this.getNode(e.target)}}hasTreeStructure(t){return this.graph.hasTreeStructure(t)}getRoots(t){return this.graph.getRoots(t).filter(this.nodeFilter)}getChildren(t,e){return this.checkNodeExistence(t),this.graph.getChildren(t,e).filter(this.nodeFilter)}getParent(t,e){this.checkNodeExistence(t);const r=this.graph.getParent(t,e);return!r||!this.nodeFilter(r)?null:r}getAllNodes(){return this.cacheEnabled?Array.from(this.allNodesMap.values()):this.graph.getAllNodes().filter(this.nodeFilter)}getAllEdges(){return this.cacheEnabled?Array.from(this.allEdgesMap.values()):this.graph.getAllEdges().filter(this.edgeFilter)}bfs(t,e,r="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[r];bv([this.getNode(t)],new Set,e,i)}dfs(t,e,r="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[r];Yu(this.getNode(t),new Set,e,i)}}class Vn extends Uu{constructor(e){super();Cn(this,"nodeMap",new Map);Cn(this,"edgeMap",new Map);Cn(this,"inEdgesMap",new Map);Cn(this,"outEdgesMap",new Map);Cn(this,"bothEdgesMap",new Map);Cn(this,"treeIndices",new Map);Cn(this,"changes",[]);Cn(this,"batchCount",0);Cn(this,"onChanged",()=>{});Cn(this,"batch",e=>{this.batchCount+=1,e(),this.batchCount-=1,this.batchCount||this.commit()});e&&(e.nodes&&this.addNodes(e.nodes),e.edges&&this.addEdges(e.edges),e.tree&&this.addTree(e.tree),e.onChanged&&(this.onChanged=e.onChanged))}commit(){const e=this.changes;this.changes=[];const r={graph:this,changes:e};this.emit("changed",r),this.onChanged(r)}reduceChanges(e){let r=[];return e.forEach(i=>{switch(i.type){case"NodeRemoved":{let a=!1;r=r.filter(s=>{if(s.type==="NodeAdded"){const o=s.value.id===i.value.id;return o&&(a=!0),!o}else{if(s.type==="NodeDataUpdated")return s.id!==i.value.id;if(s.type==="TreeStructureChanged")return s.nodeId!==i.value.id}return!0}),a||r.push(i);break}case"EdgeRemoved":{let a=!1;r=r.filter(s=>{if(s.type==="EdgeAdded"){const o=s.value.id===i.value.id;return o&&(a=!0),!o}else if(s.type==="EdgeDataUpdated"||s.type==="EdgeUpdated")return s.id!==i.value.id;return!0}),a||r.push(i);break}case"NodeDataUpdated":case"EdgeDataUpdated":case"EdgeUpdated":{const a=r.findIndex(o=>o.type===i.type&&o.id===i.id&&(i.propertyName===void 0||o.propertyName===i.propertyName)),s=r[a];s?i.propertyName!==void 0?s.newValue=i.newValue:(r.splice(a,1),r.push(i)):r.push(i);break}case"TreeStructureDetached":{r=r.filter(a=>a.type==="TreeStructureAttached"||a.type==="TreeStructureChanged"?a.treeKey!==i.treeKey:!0),r.push(i);break}case"TreeStructureChanged":{const a=r.find(s=>s.type==="TreeStructureChanged"&&s.treeKey===i.treeKey&&s.nodeId===i.nodeId);a?a.newParentId=i.newParentId:r.push(i);break}default:r.push(i);break}}),r}checkNodeExistence(e){this.getNode(e)}hasNode(e){return this.nodeMap.has(e)}areNeighbors(e,r){return this.getNeighbors(r).some(i=>i.id===e)}getNode(e){const r=this.nodeMap.get(e);if(!r)throw new Error("Node not found for id: "+e);return r}getRelatedEdges(e,r){if(this.checkNodeExistence(e),r==="in"){const i=this.inEdgesMap.get(e);return Array.from(i)}else if(r==="out"){const i=this.outEdgesMap.get(e);return Array.from(i)}else{const i=this.bothEdgesMap.get(e);return Array.from(i)}}getDegree(e,r){return this.getRelatedEdges(e,r).length}getSuccessors(e){const i=this.getRelatedEdges(e,"out").map(a=>this.getNode(a.target));return Array.from(new Set(i))}getPredecessors(e){const i=this.getRelatedEdges(e,"in").map(a=>this.getNode(a.source));return Array.from(new Set(i))}getNeighbors(e){const r=this.getPredecessors(e),i=this.getSuccessors(e);return Array.from(new Set([...r,...i]))}doAddNode(e){if(this.hasNode(e.id))throw new Error("Node already exists: "+e.id);this.nodeMap.set(e.id,e),this.inEdgesMap.set(e.id,new Set),this.outEdgesMap.set(e.id,new Set),this.bothEdgesMap.set(e.id,new Set),this.treeIndices.forEach(r=>{r.childrenMap.set(e.id,new Set)}),this.changes.push({type:"NodeAdded",value:e})}addNodes(e){this.batch(()=>{for(const r of e)this.doAddNode(r)})}addNode(e){this.addNodes([e])}doRemoveNode(e){const r=this.getNode(e),i=this.bothEdgesMap.get(e);i==null||i.forEach(a=>this.doRemoveEdge(a.id)),this.nodeMap.delete(e),this.treeIndices.forEach(a=>{var o,l;(o=a.childrenMap.get(e))==null||o.forEach(c=>{a.parentMap.delete(c.id)});const s=a.parentMap.get(e);s&&((l=a.childrenMap.get(s.id))==null||l.delete(r)),a.parentMap.delete(e),a.childrenMap.delete(e)}),this.bothEdgesMap.delete(e),this.inEdgesMap.delete(e),this.outEdgesMap.delete(e),this.changes.push({type:"NodeRemoved",value:r})}removeNodes(e){this.batch(()=>{e.forEach(r=>this.doRemoveNode(r))})}removeNode(e){this.removeNodes([e])}updateNodeDataProperty(e,r,i){const a=this.getNode(e);this.batch(()=>{const s=a.data[r],o=i;a.data[r]=o,this.changes.push({type:"NodeDataUpdated",id:e,propertyName:r,oldValue:s,newValue:o})})}mergeNodeData(e,r){this.batch(()=>{Object.entries(r).forEach(([i,a])=>{this.updateNodeDataProperty(e,i,a)})})}updateNodeData(...e){const r=e[0],i=this.getNode(r);if(typeof e[1]=="string"){this.updateNodeDataProperty(r,e[1],e[2]);return}let a;if(typeof e[1]=="function"){const s=e[1];a=s(i.data)}else typeof e[1]=="object"&&(a=e[1]);this.batch(()=>{const s=i.data,o=a;i.data=a,this.changes.push({type:"NodeDataUpdated",id:r,oldValue:s,newValue:o})})}checkEdgeExistence(e){if(!this.hasEdge(e))throw new Error("Edge not found for id: "+e)}hasEdge(e){return this.edgeMap.has(e)}getEdge(e){return this.checkEdgeExistence(e),this.edgeMap.get(e)}getEdgeDetail(e){const r=this.getEdge(e);return{edge:r,source:this.getNode(r.source),target:this.getNode(r.target)}}doAddEdge(e){if(this.hasEdge(e.id))throw new Error("Edge already exists: "+e.id);this.checkNodeExistence(e.source),this.checkNodeExistence(e.target),this.edgeMap.set(e.id,e);const r=this.inEdgesMap.get(e.target),i=this.outEdgesMap.get(e.source),a=this.bothEdgesMap.get(e.source),s=this.bothEdgesMap.get(e.target);r.add(e),i.add(e),a.add(e),s.add(e),this.changes.push({type:"EdgeAdded",value:e})}addEdges(e){this.batch(()=>{for(const r of e)this.doAddEdge(r)})}addEdge(e){this.addEdges([e])}doRemoveEdge(e){const r=this.getEdge(e),i=this.outEdgesMap.get(r.source),a=this.inEdgesMap.get(r.target),s=this.bothEdgesMap.get(r.source),o=this.bothEdgesMap.get(r.target);i.delete(r),a.delete(r),s.delete(r),o.delete(r),this.edgeMap.delete(e),this.changes.push({type:"EdgeRemoved",value:r})}removeEdges(e){this.batch(()=>{e.forEach(r=>this.doRemoveEdge(r))})}removeEdge(e){this.removeEdges([e])}updateEdgeSource(e,r){const i=this.getEdge(e);this.checkNodeExistence(r);const a=i.source,s=r;this.outEdgesMap.get(a).delete(i),this.bothEdgesMap.get(a).delete(i),this.outEdgesMap.get(s).add(i),this.bothEdgesMap.get(s).add(i),i.source=r,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:e,propertyName:"source",oldValue:a,newValue:s})})}updateEdgeTarget(e,r){const i=this.getEdge(e);this.checkNodeExistence(r);const a=i.target,s=r;this.inEdgesMap.get(a).delete(i),this.bothEdgesMap.get(a).delete(i),this.inEdgesMap.get(s).add(i),this.bothEdgesMap.get(s).add(i),i.target=r,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:e,propertyName:"target",oldValue:a,newValue:s})})}updateEdgeDataProperty(e,r,i){const a=this.getEdge(e);this.batch(()=>{const s=a.data[r],o=i;a.data[r]=o,this.changes.push({type:"EdgeDataUpdated",id:e,propertyName:r,oldValue:s,newValue:o})})}updateEdgeData(...e){const r=e[0],i=this.getEdge(r);if(typeof e[1]=="string"){this.updateEdgeDataProperty(r,e[1],e[2]);return}let a;if(typeof e[1]=="function"){const s=e[1];a=s(i.data)}else typeof e[1]=="object"&&(a=e[1]);this.batch(()=>{const s=i.data,o=a;i.data=a,this.changes.push({type:"EdgeDataUpdated",id:r,oldValue:s,newValue:o})})}mergeEdgeData(e,r){this.batch(()=>{Object.entries(r).forEach(([i,a])=>{this.updateEdgeDataProperty(e,i,a)})})}checkTreeExistence(e){if(!this.hasTreeStructure(e))throw new Error("Tree structure not found for treeKey: "+e)}hasTreeStructure(e){return this.treeIndices.has(e)}attachTreeStructure(e){this.treeIndices.has(e)||(this.treeIndices.set(e,{parentMap:new Map,childrenMap:new Map}),this.batch(()=>{this.changes.push({type:"TreeStructureAttached",treeKey:e})}))}detachTreeStructure(e){this.checkTreeExistence(e),this.treeIndices.delete(e),this.batch(()=>{this.changes.push({type:"TreeStructureDetached",treeKey:e})})}addTree(e,r){this.batch(()=>{this.attachTreeStructure(r);const i=[],a=Array.isArray(e)?e:[e];for(;a.length;){const s=a.shift();i.push(s),s.children&&a.push(...s.children)}this.addNodes(i),i.forEach(s=>{var o;(o=s.children)==null||o.forEach(l=>{this.setParent(l.id,s.id,r)})})})}getRoots(e){return this.checkTreeExistence(e),this.getAllNodes().filter(r=>!this.getParent(r.id,e))}getChildren(e,r){this.checkNodeExistence(e),this.checkTreeExistence(r);const a=this.treeIndices.get(r).childrenMap.get(e);return Array.from(a||[])}getParent(e,r){return this.checkNodeExistence(e),this.checkTreeExistence(r),this.treeIndices.get(r).parentMap.get(e)||null}getAncestors(e,r){const i=[];let a=this.getNode(e),s;for(;s=this.getParent(a.id,r);)i.push(s),a=s;return i}setParent(e,r,i){var u,h;this.checkTreeExistence(i);const a=this.treeIndices.get(i);if(!a)return;const s=this.getNode(e),o=a.parentMap.get(e);if((o==null?void 0:o.id)===r)return;if(r==null){o&&((u=a.childrenMap.get(o.id))==null||u.delete(s)),a.parentMap.delete(e);return}const l=this.getNode(r);a.parentMap.set(e,l),o&&((h=a.childrenMap.get(o.id))==null||h.delete(s));let c=a.childrenMap.get(l.id);c||(c=new Set,a.childrenMap.set(l.id,c)),c.add(s),this.batch(()=>{this.changes.push({type:"TreeStructureChanged",treeKey:i,nodeId:e,oldParentId:o==null?void 0:o.id,newParentId:l.id})})}dfsTree(e,r,i){const a=s=>this.getChildren(s,i);return Yu(this.getNode(e),new Set,r,a)}bfsTree(e,r,i){const a=s=>this.getChildren(s,i);return bv([this.getNode(e)],new Set,r,a)}getAllNodes(){return Array.from(this.nodeMap.values())}getAllEdges(){return Array.from(this.edgeMap.values())}bfs(e,r,i="out"){const a={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[i];return bv([this.getNode(e)],new Set,r,a)}dfs(e,r,i="out"){const a={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[i];return Yu(this.getNode(e),new Set,r,a)}clone(){const e=this.getAllNodes().map(a=>Y0(Bo({},a),{data:Bo({},a.data)})),r=this.getAllEdges().map(a=>Y0(Bo({},a),{data:Bo({},a.data)})),i=new Vn({nodes:e,edges:r});return this.treeIndices.forEach(({parentMap:a,childrenMap:s},o)=>{const l=new Map;a.forEach((u,h)=>{l.set(h,i.getNode(u.id))});const c=new Map;s.forEach((u,h)=>{c.set(h,new Set(Array.from(u).map(d=>i.getNode(d.id))))}),i.treeIndices.set(o,{parentMap:l,childrenMap:c})}),i}toJSON(){return JSON.stringify({nodes:this.getAllNodes(),edges:this.getAllEdges()})}createView(e){return new tP(Bo({graph:this},e))}}class Hu{constructor(t,e){this.context=t,this.options=e||{}}}var eP=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})},nP=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function o7(n){const{type:t}=n;return!!(["comboCombined","comboForce"].includes(t)||t==="antv-dagre"&&n.sortByCombo)}function rP(n){const{type:t}=n;return["compact-box","mindmap","dendrogram","indented"].includes(t)}function l7(n){return isNumber(n.x)&&isNumber(n.y)}function iP(n){return!Array.isArray(n)&&(n==null?void 0:n.preLayout)}function Xu(n){const{nodes:t,edges:e}=n,r={nodes:[],edges:[],combos:[]};return t.forEach(i=>{const a=i.data._isCombo?r.combos:r.nodes,{x:s,y:o,z:l=0}=i.data;a==null||a.push({id:i.id,style:{x:s,y:o,z:l}})}),e.forEach(i=>{const{id:a,source:s,target:o,data:{points:l=[],controlPoints:c=l.slice(1,l.length-1)}}=i;r.edges.push({id:a,source:s,target:o,style:Object.assign({},c!=null&&c.length?{controlPoints:c.map(mr)}:{})})}),r}function aP(n,t){class e extends Hu{constructor(i,a){if(super(i,a),this.instance=new n({}),this.id=this.instance.id,"stop"in this.instance&&"tick"in this.instance){const s=this.instance;this.stop=s.stop.bind(s),this.tick=o=>{const l=s.tick(o);return Xu(l)}}}execute(i,a){return eP(this,void 0,void 0,function*(){return Xu(yield this.instance.execute(this.graphData2LayoutModel(i),this.transformOptions(pr({},this.options,a))))})}transformOptions(i){if(!("onTick"in i))return i;const a=i.onTick;return i.onTick=s=>a(Xu(s)),i}graphData2LayoutModel(i){const{nodes:a=[],edges:s=[],combos:o=[]}=i,l=a.map(f=>{const v=At(f),{data:g,style:p,combo:y}=f,b=nP(f,["data","style","combo"]),E={id:v,data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g),{data:g}),y?{parentId:y}:{}),{style:p}),b)};return p!=null&&p.x&&Object.assign(E.data,{x:p.x}),p!=null&&p.y&&Object.assign(E.data,{y:p.y}),p!=null&&p.z&&Object.assign(E.data,{z:p.z}),E}),c=new Map(l.map(f=>[f.id,f])),u=s.filter(f=>{const{source:v,target:g}=f;return c.has(v)&&c.has(g)}).map(f=>{const{source:v,target:g,data:p,style:y}=f;return{id:At(f),source:v,target:g,data:Object.assign({},p),style:Object.assign({},y)}}),h=o.map(f=>({id:At(f),data:Object.assign({_isCombo:!0},f.data),style:Object.assign({},f.style)})),d=new Vn({nodes:[...l,...h],edges:u});return t.model.model.hasTreeStructure(dn)&&(d.attachTreeStructure(dn),l.forEach(f=>{const v=t.model.model.getParent(f.id,dn);v&&d.hasNode(v.id)&&d.setParent(f.id,v.id,dn)})),d}}return e}function xv(n,t,...e){if(t in n)return n[t](...e);if("instance"in n){const r=n.instance;if(t in r)return r[t](...e)}return null}function k1(n,t){if(t in n)return n[t];if("instance"in n){const e=n.instance;if(t in e)return e[t]}return null}var sP=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class oP extends Nl{get forceLayoutInstance(){return this.context.layout.getLayoutInstance().find(t=>["d3-force","d3-force-3d"].includes(t==null?void 0:t.id))}validate(t){return this.context.layout?this.forceLayoutInstance?super.validate(t):(Xr.warn("DragElementForce only works with d3-force or d3-force-3d layout"),!1):!1}moveElement(t,e){return sP(this,void 0,void 0,function*(){const r=this.forceLayoutInstance;this.context.graph.getNodeData(t).forEach((i,a)=>{const{x:s=0,y:o=0}=i.style||{};r&&xv(r,"setFixedPosition",t[a],[...Ne([+s,+o],e)])})})}onDragStart(t){if(this.enable=this.validate(t),!this.enable)return;this.target=this.getSelectedNodeIDs([t.target.id]),this.hideEdge(),this.context.graph.frontElement(this.target);const e=this.forceLayoutInstance;e&&k1(e,"simulation").alphaTarget(.3).restart(),this.context.graph.getNodeData(this.target).forEach(r=>{const{x:i=0,y:a=0}=r.style||{};e&&xv(e,"setFixedPosition",At(r),[+i,+a])})}onDrag(t){if(!this.enable)return;const e=this.getDelta(t);this.moveElement(this.target,e)}onDragEnd(){const t=this.forceLayoutInstance;t&&k1(t,"simulation").alphaTarget(0),!this.options.fixed&&this.context.graph.getNodeData(this.target).forEach(e=>{t&&xv(t,"setFixedPosition",At(e),[null,null,null])})}}var P1=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class Ku extends ai{constructor(t,e){super(t,Object.assign({},Ku.defaultOptions,e)),this.isZoomEvent=r=>!!(r.data&&"scale"in r.data),this.relatedEdgeToUpdate=new Set,this.zoom=this.context.graph.getZoom(),this.fixElementSize=r=>P1(this,void 0,void 0,function*(){if(!this.validate(r))return;const{graph:i}=this.context,{state:a,nodeFilter:s,edgeFilter:o,comboFilter:l}=this.options,c=(a?i.getElementDataByState("node",a):i.getNodeData()).filter(s),u=(a?i.getElementDataByState("edge",a):i.getEdgeData()).filter(o),h=(a?i.getElementDataByState("combo",a):i.getComboData()).filter(l),d=this.isZoomEvent(r)?this.zoom=Math.max(.01,Math.min(r.data.scale,10)):this.zoom,f=[...c,...h];f.length>0&&f.forEach(v=>this.fixNodeLike(v,d)),this.updateRelatedEdges(),u.length>0&&u.forEach(v=>this.fixEdge(v,d))}),this.cachedStyles=new Map,this.getOriginalFieldValue=(r,i,a)=>{var s;const o=this.cachedStyles.get(r)||[],l=((s=o.find(c=>c.shape===i))===null||s===void 0?void 0:s.style)||{};return a in l||(l[a]=i.attributes[a],this.cachedStyles.set(r,[...o.filter(c=>c.shape!==i),{shape:i,style:l}])),l[a]},this.scaleEntireElement=(r,i,a)=>{i.setLocalScale(1/a);const s=this.cachedStyles.get(r)||[];s.push({shape:i}),this.cachedStyles.set(r,s)},this.scaleSpecificShapes=(r,i,a)=>{const s=qN(r);(Array.isArray(a)?a:[a]).forEach(l=>{const{shape:c,fields:u}=l,h=typeof c=="function"?c(s):r.getShape(c);if(h){if(!u){this.scaleEntireElement(r.id,h,i);return}u.forEach(d=>{const f=this.getOriginalFieldValue(r.id,h,d);ie(f)&&(h.style[d]=f/i)})}})},this.skipIfExceedViewport=r=>{const{viewport:i}=this.context;return!(i!=null&&i.isInViewport(r.getRenderBounds(),!1,30))},this.fixNodeLike=(r,i)=>{const a=At(r),{element:s,model:o}=this.context,l=s.getElement(a);if(!l||this.skipIfExceedViewport(l))return;o.getRelatedEdgesData(a).forEach(h=>this.relatedEdgeToUpdate.add(At(h)));const u=this.options[l.type];if(!u){this.scaleEntireElement(a,l,i);return}this.scaleSpecificShapes(l,i,u)},this.fixEdge=(r,i)=>{const a=At(r),s=this.context.element.getElement(a);if(!s||this.skipIfExceedViewport(s))return;const o=this.options.edge;if(!o){s.style.transformOrigin="center",this.scaleEntireElement(a,s,i);return}this.scaleSpecificShapes(s,i,o)},this.updateRelatedEdges=()=>{const{element:r}=this.context;this.relatedEdgeToUpdate.size>0&&this.relatedEdgeToUpdate.forEach(i=>{const a=r.getElement(i);a==null||a.update({})}),this.relatedEdgeToUpdate.clear()},this.resetTransform=r=>P1(this,void 0,void 0,function*(){var i;!((i=r.data)===null||i===void 0)&&i.firstRender||(this.options.reset?this.restoreCachedStyles():this.fixElementSize({data:{scale:this.zoom}}))}),this.bindEvents()}restoreCachedStyles(){if(this.cachedStyles.size>0){this.cachedStyles.forEach(i=>{i.forEach(({shape:a,style:s})=>{if(ra(s))a.setLocalScale(1);else{if(this.options.state)return;Object.entries(s).forEach(([o,l])=>a.style[o]=l)}})});const{graph:t,element:e}=this.context,r=Object.keys(Object.fromEntries(this.cachedStyles)).filter(i=>i&&t.getElementType(i)==="node");if(r.length>0){const i=new Set;r.forEach(a=>{t.getRelatedEdgesData(a).forEach(s=>i.add(At(s)))}),i.forEach(a=>{const s=e==null?void 0:e.getElement(a);s==null||s.update({})})}}}bindEvents(){const{graph:t}=this.context;t.on(Kt.AFTER_DRAW,this.resetTransform),t.on(Kt.AFTER_TRANSFORM,this.fixElementSize)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.AFTER_DRAW,this.resetTransform),t.off(Kt.AFTER_TRANSFORM,this.fixElementSize)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Ku.defaultOptions={enable:n=>n.data.scale<1,nodeFilter:()=>!0,edgeFilter:()=>!0,comboFilter:()=>!0,edge:[{shape:"key",fields:["lineWidth"]},{shape:"halo",fields:["lineWidth"]},{shape:"label"}],reset:!1};var lP=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class Qu extends ai{constructor(t,e){super(t,Object.assign({},Qu.defaultOptions,e)),this.focus=r=>lP(this,void 0,void 0,function*(){if(!this.validate(r))return;const{graph:i}=this.context;yield i.focusElement(r.target.id,this.options.animation)}),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Ls.forEach(e=>{t.on(`${e}:${Bt.CLICK}`,this.focus)})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Ls.forEach(e=>{t.off(`${e}:${Bt.CLICK}`,this.focus)})}destroy(){this.unbindEvents(),super.destroy()}}Qu.defaultOptions={animation:{easing:"ease-in",duration:500},enable:!0};class qu extends ai{constructor(t,e){super(t,Object.assign({},qu.defaultOptions,e)),this.isFrozen=!1,this.toggleFrozen=r=>{this.isFrozen=r.type==="dragstart"},this.hoverElement=r=>{if(!this.validate(r))return;const i=r.type===Bt.POINTER_ENTER;this.updateElementsState(r,i);const{onHover:a,onHoverEnd:s}=this.options;i?a==null||a(r):s==null||s(r)},this.updateElementsState=(r,i)=>{if(!this.options.state&&!this.options.inactiveState)return;const{graph:a}=this.context,{state:s,animation:o,inactiveState:l}=this.options,c=this.getActiveIds(r),u={};if(s&&Object.assign(u,this.getElementsState(c,s,i)),l){const h=my(a.getData(),!0).filter(d=>!c.includes(d));Object.assign(u,this.getElementsState(h,l,i))}a.setElementState(u,o)},this.getElementsState=(r,i,a)=>{const{graph:s}=this.context,o={};return r.forEach(l=>{const c=s.getElementState(l);a?o[l]=c.includes(i)?c:[...c,i]:o[l]=c.filter(u=>u!==i)}),o},this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Ls.forEach(r=>{t.on(`${r}:${Bt.POINTER_ENTER}`,this.hoverElement),t.on(`${r}:${Bt.POINTER_LEAVE}`,this.hoverElement)});const e=this.context.canvas.document;e.addEventListener(`${Bt.DRAG_START}`,this.toggleFrozen),e.addEventListener(`${Bt.DRAG_END}`,this.toggleFrozen)}getActiveIds(t){const{graph:e}=this.context,{degree:r,direction:i}=this.options,a=t.target.id;return r?Ly(e,t.targetType,a,typeof r=="function"?r(t):r,i):[a]}validate(t){if(this.destroyed||this.isFrozen||Ol(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Ls.forEach(r=>{t.off(`${r}:${Bt.POINTER_ENTER}`,this.hoverElement),t.off(`${r}:${Bt.POINTER_LEAVE}`,this.hoverElement)});const e=this.context.canvas.document;e.removeEventListener(`${Bt.DRAG_START}`,this.toggleFrozen),e.removeEventListener(`${Bt.DRAG_END}`,this.toggleFrozen)}destroy(){this.unbindEvents(),super.destroy()}}qu.defaultOptions={animation:!1,enable:!0,degree:0,direction:"both",state:"active",inactiveState:void 0};class cP extends yl{onPointerDown(t){if(!super.validate(t)||!super.isKeydown()||this.points)return;const{canvas:e}=this.context;this.pathShape=new ni({id:"g6-lasso-select",style:this.options.style}),e.appendChild(this.pathShape),this.points=[fu(t)]}onPointerMove(t){var e;if(!this.points)return;const{immediately:r,mode:i}=this.options;this.points.push(fu(t)),(e=this.pathShape)===null||e===void 0||e.setAttribute("d",YN(this.points)),r&&i==="default"&&this.points.length>2&&super.updateElementsStates(this.points)}onPointerUp(){if(this.points){if(this.points.length<2){this.clearLasso();return}super.updateElementsStates(this.points),this.clearLasso()}}clearLasso(){var t;(t=this.pathShape)===null||t===void 0||t.remove(),this.pathShape=void 0,this.points=void 0}}class Ju extends ai{constructor(t,e){super(t,Object.assign({},Ju.defaultOptions,e)),this.hiddenShapes=[],this.isVisible=!0,this.setElementsVisibility=(r,i,a)=>{r.filter(Boolean).forEach(s=>{i==="hidden"&&!s.isVisible()?this.hiddenShapes.push(s):i==="visible"&&this.hiddenShapes.includes(s)?this.hiddenShapes.splice(this.hiddenShapes.indexOf(s),1):Ps(s,i,a)})},this.filterShapes=(r,i)=>{if(fe(i))return s=>!i(r,s);const a=i==null?void 0:i[r];return s=>s.className?!(a!=null&&a.includes(s.className)):!0},this.hideShapes=r=>{if(!this.validate(r)||!this.isVisible)return;const{element:i}=this.context,{shapes:a={}}=this.options;this.setElementsVisibility(i.getNodes(),"hidden",this.filterShapes("node",a)),this.setElementsVisibility(i.getEdges(),"hidden",this.filterShapes("edge",a)),this.setElementsVisibility(i.getCombos(),"hidden",this.filterShapes("combo",a)),this.isVisible=!1},this.showShapes=Cl(r=>{if(!this.validate(r)||this.isVisible)return;const{element:i}=this.context;this.setElementsVisibility(i.getNodes(),"visible"),this.setElementsVisibility(i.getEdges(),"visible"),this.setElementsVisibility(i.getCombos(),"visible"),this.isVisible=!0},this.options.debounce),this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(Kt.BEFORE_TRANSFORM,this.hideShapes),t.on(Kt.AFTER_TRANSFORM,this.showShapes)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.BEFORE_TRANSFORM,this.hideShapes),t.off(Kt.AFTER_TRANSFORM,this.showShapes)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}Ju.defaultOptions={enable:!0,debounce:200,shapes:n=>n==="node"};var R1=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class $u extends ai{constructor(t,e){super(t,Object.assign({},$u.defaultOptions,e)),this.onWheel=r=>R1(this,void 0,void 0,function*(){this.options.preventDefault&&r.preventDefault();const i=r.deltaX,a=r.deltaY;yield this.scroll([-i,-a],r)}),this.shortcut=new go(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){var t,e;const{trigger:r}=this.options;if(this.shortcut.unbindAll(),Fn(r)){(t=this.graphDom)===null||t===void 0||t.removeEventListener(Bt.WHEEL,this.onWheel);const{up:i=[],down:a=[],left:s=[],right:o=[]}=r;this.shortcut.bind(i,l=>this.scroll([0,-10],l)),this.shortcut.bind(a,l=>this.scroll([0,10],l)),this.shortcut.bind(s,l=>this.scroll([-10,0],l)),this.shortcut.bind(o,l=>this.scroll([10,0],l))}else(e=this.graphDom)===null||e===void 0||e.addEventListener(Bt.WHEEL,this.onWheel,{passive:!1})}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}formatDisplacement(t){const{sensitivity:e}=this.options;return t=Di(t,e),t=this.clampByDirection(t),t=this.clampByRange(t),t}clampByDirection([t,e]){const{direction:r}=this.options;return r==="x"?e=0:r==="y"&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:r,canvas:i}=this.context,[a,s]=i.getSize(),[o,l,c,u]=Ri(this.options.range),h=[s*o,a*l,s*c,a*u],d=Fa(kf(r.getCanvasCenter()),h),f=ln(r.getViewportCenter(),[t,e,0]);if(!Li(f,d)){const{min:[v,g],max:[p,y]}=d;(f[0]<v&&t>0||f[0]>p&&t<0)&&(t=0),(f[1]<g&&e>0||f[1]>y&&e<0)&&(e=0)}return[t,e]}scroll(t,e){return R1(this,void 0,void 0,function*(){if(!this.validate(e))return;const{onFinish:r}=this.options,i=this.context.graph,a=this.formatDisplacement(t);yield i.translateBy(a,!1),r==null||r()})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),(t=this.graphDom)===null||t===void 0||t.removeEventListener(Bt.WHEEL,this.onWheel),super.destroy()}}$u.defaultOptions={enable:!0,sensitivity:1,preventDefault:!0,range:1/0};var L1=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class th extends ai{constructor(t,e){super(t,Object.assign({},th.defaultOptions,e)),this.zoom=(r,i,a)=>L1(this,void 0,void 0,function*(){if(!this.validate(i))return;const{graph:s}=this.context;let o=this.options.origin;!o&&"viewport"in i&&(o=mr(i.viewport));const{sensitivity:l,onFinish:c}=this.options,u=1+kn(r,-50,50)*l/100,h=s.getZoom();yield s.zoomTo(h*u,a,o),c==null||c()}),this.onReset=()=>L1(this,void 0,void 0,function*(){yield this.context.graph.zoomTo(1,this.options.animation)}),this.preventDefault=r=>{this.options.preventDefault&&r.preventDefault()},this.shortcut=new go(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){const{trigger:t}=this.options;if(this.shortcut.unbindAll(),Array.isArray(t))if(t.includes(Bt.PINCH))this.shortcut.bind([Bt.PINCH],e=>{this.zoom(e.scale,e,!1)});else{const e=this.context.canvas.getContainer();e==null||e.addEventListener(Bt.WHEEL,this.preventDefault),this.shortcut.bind([...t,Bt.WHEEL],r=>{const{deltaX:i,deltaY:a}=r;this.zoom(-(a!=null?a:i),r,!1)})}if(typeof t=="object"){const{zoomIn:e=[],zoomOut:r=[],reset:i=[]}=t;this.shortcut.bind(e,a=>this.zoom(10,a,this.options.animation)),this.shortcut.bind(r,a=>this.zoom(-10,a,this.options.animation)),this.shortcut.bind(i,this.onReset)}}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return fe(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),(t=this.context.canvas.getContainer())===null||t===void 0||t.removeEventListener(Bt.WHEEL,this.preventDefault),super.destroy()}}th.defaultOptions={animation:{duration:200},enable:!0,sensitivity:1,trigger:[],preventDefault:!0};var eh=S(13722);const uP=(n,t)=>{if(n!=="next"&&n!=="prev")return t},_1=n=>{n.prev.next=n.next,n.next.prev=n.prev,delete n.next,delete n.prev};class hP{constructor(){const t={};t.prev=t,t.next=t.prev,this.shortcut=t}dequeue(){const t=this.shortcut,e=t.prev;if(e&&e!==t)return _1(e),e}enqueue(t){const e=this.shortcut;t.prev&&t.next&&_1(t),t.next=e.next,e.next.prev=t,e.next=t,t.prev=e}toString(){const t=[],e=this.shortcut;let r=e.prev;for(;r!==e;)t.push(JSON.stringify(r,uP)),r=r==null?void 0:r.prev;return`[${t.join(", ")}]`}}class dP extends hP{}const fP=()=>1,vP=(n,t)=>{var e;if(n.getAllNodes().length<=1)return[];const r=pP(n,t||fP);return(e=gP(r.graph,r.buckets,r.zeroIdx).map(a=>n.getRelatedEdges(a.v,"out").filter(({target:s})=>s===a.w)))===null||e===void 0?void 0:e.flat()},gP=(n,t,e)=>{let r=[];const i=t[t.length-1],a=t[0];let s;for(;n.getAllNodes().length;){for(;s=a.dequeue();)Ev(n,t,e,s);for(;s=i.dequeue();)Ev(n,t,e,s);if(n.getAllNodes().length){for(let o=t.length-2;o>0;--o)if(s=t[o].dequeue(),s){r=r.concat(Ev(n,t,e,s,!0));break}}}return r},Ev=(n,t,e,r,i)=>{var a,s;const o=[];return n.hasNode(r.v)&&((a=n.getRelatedEdges(r.v,"in"))===null||a===void 0||a.forEach(l=>{const c=l.data.weight,u=n.getNode(l.source);i&&o.push({v:l.source,w:l.target,in:0,out:0}),u.data.out===void 0&&(u.data.out=0),u.data.out-=c,wv(t,e,Object.assign({v:u.id},u.data))}),(s=n.getRelatedEdges(r.v,"out"))===null||s===void 0||s.forEach(l=>{const c=l.data.weight,u=l.target,h=n.getNode(u);h.data.in===void 0&&(h.data.in=0),h.data.in-=c,wv(t,e,Object.assign({v:h.id},h.data))}),n.removeNode(r.v)),i?o:void 0},pP=(n,t)=>{const e=new Vn;let r=0,i=0;n.getAllNodes().forEach(l=>{e.addNode({id:l.id,data:{v:l.id,in:0,out:0}})}),n.getAllEdges().forEach(l=>{const c=e.getRelatedEdges(l.source,"out").find(h=>h.target===l.target),u=(t==null?void 0:t(l))||1;c?e.updateEdgeData(c==null?void 0:c.id,Object.assign(Object.assign({},c.data),{weight:c.data.weight+u})):e.addEdge({id:l.id,source:l.source,target:l.target,data:{weight:u}}),i=Math.max(i,e.getNode(l.source).data.out+=u),r=Math.max(r,e.getNode(l.target).data.in+=u)});const a=[],s=i+r+3;for(let l=0;l<s;l++)a.push(new dP);const o=r+1;return e.getAllNodes().forEach(l=>{wv(a,o,Object.assign({v:l.id},e.getNode(l.id).data))}),{buckets:a,zeroIdx:o,graph:e}},wv=(n,t,e)=>{e.out?e.in?n[e.out-e.in+t].enqueue(e):n[n.length-1].enqueue(e):n[0].enqueue(e)},mP=(n,t)=>{const r=t==="greedy"?vP(n,(i=>a=>a.data.weight||1)(n)):yP(n);r==null||r.forEach(i=>{const a=i.data;n.removeEdge(i.id),a.forwardName=i.data.name,a.reversed=!0,n.addEdge({id:i.id,source:i.target,target:i.source,data:Object.assign({},a)})})},yP=n=>{const t=[],e={},r={},i=a=>{r[a]||(r[a]=!0,e[a]=!0,n.getRelatedEdges(a,"out").forEach(s=>{e[s.target]?t.push(s):i(s.target)}),delete e[a])};return n.getAllNodes().forEach(a=>i(a.id)),t},bP=n=>{n.getAllEdges().forEach(t=>{const e=t.data;if(e.reversed){n.removeEdge(t.id);const r=e.forwardName;delete e.reversed,delete e.forwardName,n.addEdge({id:t.id,source:t.target,target:t.source,data:Object.assign(Object.assign({},e),{forwardName:r})})}})},xP=(n,t)=>Number(n)-Number(t),bo=(n,t,e,r)=>{let i;do i=`${r}${Math.random()}`;while(n.hasNode(i));return e.dummy=t,n.addNode({id:i,data:e}),i},EP=n=>{const t=new Vn;return n.getAllNodes().forEach(e=>{t.addNode(Object.assign({},e))}),n.getAllEdges().forEach(e=>{const r=t.getRelatedEdges(e.source,"out").find(i=>i.target===e.target);r?t.updateEdgeData(r==null?void 0:r.id,Object.assign(Object.assign({},r.data),{weight:r.data.weight+e.data.weight||0,minlen:Math.max(r.data.minlen,e.data.minlen||1)})):t.addEdge({id:e.id,source:e.source,target:e.target,data:{weight:e.data.weight||0,minlen:e.data.minlen||1}})}),t},D1=n=>{const t=new Vn;return n.getAllNodes().forEach(e=>{n.getChildren(e.id).length||t.addNode(Object.assign({},e))}),n.getAllEdges().forEach(e=>{t.addEdge(e)}),t},I1=(n,t)=>n==null?void 0:n.reduce((e,r,i)=>(e[r]=t[i],e),{}),c7=n=>{const t={};return n.getAllNodes().forEach(e=>{const r={};n.getRelatedEdges(e.id,"out").forEach(i=>{r[i.target]=(r[i.target]||0)+(i.data.weight||0)}),t[e.id]=r}),t},u7=n=>{const t=n.getAllNodes(),e=t.map(r=>{const i={};return n.getRelatedEdges(r.id,"in").forEach(a=>{i[a.source]=(i[a.source]||0)+a.data.weight}),i});return I1(t.map(r=>r.id),e)},B1=(n,t)=>{const e=Number(n.x),r=Number(n.y),i=Number(t.x)-e,a=Number(t.y)-r;let s=Number(n.width)/2,o=Number(n.height)/2;if(!i&&!a)return{x:0,y:0};let l,c;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,c=o):(i<0&&(s=-s),l=s,c=s*a/i),{x:e+l,y:r+c}},kl=n=>{const t=[],e=z1(n)+1;for(let r=0;r<e;r++)t.push([]);n.getAllNodes().forEach(r=>{const i=r.data.rank;i!==void 0&&t[i]&&t[i].push(r.id)});for(let r=0;r<e;r++)t[r]=t[r].sort((i,a)=>xP(n.getNode(i).data.order,n.getNode(a).data.order));return t},wP=n=>{const t=n.getAllNodes().filter(r=>r.data.rank!==void 0).map(r=>r.data.rank),e=Math.min(...t);n.getAllNodes().forEach(r=>{r.data.hasOwnProperty("rank")&&e!==1/0&&(r.data.rank-=e)})},SP=(n,t=0)=>{const e=n.getAllNodes(),r=e.filter(o=>o.data.rank!==void 0).map(o=>o.data.rank),i=Math.min(...r),a=[];e.forEach(o=>{const l=(o.data.rank||0)-i;a[l]||(a[l]=[]),a[l].push(o.id)});let s=0;for(let o=0;o<a.length;o++){const l=a[o];l===void 0?o%t!==0&&(s-=1):s&&(l==null||l.forEach(c=>{const u=n.getNode(c);u&&(u.data.rank=u.data.rank||0,u.data.rank+=s)}))}},F1=(n,t,e,r)=>{const i={width:0,height:0};return ie(e)&&ie(r)&&(i.rank=e,i.order=r),bo(n,"border",i,t)},z1=n=>{let t;return n.getAllNodes().forEach(e=>{const r=e.data.rank;r!==void 0&&(t===void 0||r>t)&&(t=r)}),t||(t=0),t},MP=(n,t)=>{const e={lhs:[],rhs:[]};return n==null||n.forEach(r=>{t(r)?e.lhs.push(r):e.rhs.push(r)}),e},Sv=(n,t)=>n.reduce((e,r)=>{const i=t(e),a=t(r);return i>a?r:e}),j1=(n,t,e,r,i,a)=>{r.includes(t.id)||(r.push(t.id),e||a.push(t.id),i(t.id).forEach(s=>j1(n,s,e,r,i,a)),e&&a.push(t.id))},Z1=(n,t,e,r)=>{const i=Array.isArray(t)?t:[t],a=l=>r?n.getSuccessors(l):n.getNeighbors(l),s=[],o=[];return i.forEach(l=>{if(n.hasNode(l.id))j1(n,l,e==="post",o,a,s);else throw new Error(`Graph does not have node: ${l}`)}),s},AP=n=>{const t=e=>{const r=n.getChildren(e),i=n.getNode(e);if(r!=null&&r.length&&r.forEach(a=>t(a.id)),i.data.hasOwnProperty("minRank")){i.data.borderLeft=[],i.data.borderRight=[];for(let a=i.data.minRank,s=i.data.maxRank+1;a<s;a+=1)W1(n,"borderLeft","_bl",e,i,a),W1(n,"borderRight","_br",e,i,a)}};n.getRoots().forEach(e=>t(e.id))},W1=(n,t,e,r,i,a)=>{const s={rank:a,borderType:t,width:0,height:0},o=i.data[t][a-1],l=bo(n,"border",s,e);i.data[t][a]=l,n.setParent(l,r),o&&n.addEdge({id:`e${Math.random()}`,source:o,target:l,data:{weight:1}})},TP=(n,t)=>{const e=t.toLowerCase();(e==="lr"||e==="rl")&&G1(n)},OP=(n,t)=>{const e=t.toLowerCase();(e==="bt"||e==="rl")&&CP(n),(e==="lr"||e==="rl")&&(NP(n),G1(n))},G1=n=>{n.getAllNodes().forEach(t=>{V1(t)}),n.getAllEdges().forEach(t=>{V1(t)})},V1=n=>{const t=n.data.width;n.data.width=n.data.height,n.data.height=t},CP=n=>{n.getAllNodes().forEach(t=>{Mv(t.data)}),n.getAllEdges().forEach(t=>{var e;(e=t.data.points)===null||e===void 0||e.forEach(r=>Mv(r)),t.data.hasOwnProperty("y")&&Mv(t.data)})},Mv=n=>{n!=null&&n.y&&(n.y=-n.y)},NP=n=>{n.getAllNodes().forEach(t=>{Av(t.data)}),n.getAllEdges().forEach(t=>{var e;(e=t.data.points)===null||e===void 0||e.forEach(r=>Av(r)),t.data.hasOwnProperty("x")&&Av(t.data)})},Av=n=>{const t=n.x;n.x=n.y,n.y=t},kP=n=>{const t=bo(n,"root",{},"_root"),e=PP(n);let r=Math.max(...Object.values(e));Math.abs(r)===1/0&&(r=1);const i=r-1,a=2*i+1;n.getAllEdges().forEach(o=>{o.data.minlen*=a});const s=RP(n)+1;return n.getRoots().forEach(o=>{U1(n,t,a,s,i,e,o.id)}),{nestingRoot:t,nodeRankFactor:a}},U1=(n,t,e,r,i,a,s)=>{const o=n.getChildren(s);if(!(o!=null&&o.length)){s!==t&&n.addEdge({id:`e${Math.random()}`,source:t,target:s,data:{weight:0,minlen:e}});return}const l=F1(n,"_bt"),c=F1(n,"_bb"),u=n.getNode(s);n.setParent(l,s),u.data.borderTop=l,n.setParent(c,s),u.data.borderBottom=c,o==null||o.forEach(h=>{U1(n,t,e,r,i,a,h.id);const d=h.data.borderTop?h.data.borderTop:h.id,f=h.data.borderBottom?h.data.borderBottom:h.id,v=h.data.borderTop?r:2*r,g=d!==f?1:i-a[s]+1;n.addEdge({id:`e${Math.random()}`,source:l,target:d,data:{minlen:g,weight:v,nestingEdge:!0}}),n.addEdge({id:`e${Math.random()}`,source:f,target:c,data:{minlen:g,weight:v,nestingEdge:!0}})}),n.getParent(s)||n.addEdge({id:`e${Math.random()}`,source:t,target:l,data:{weight:0,minlen:i+a[s]}})},PP=n=>{const t={},e=(r,i)=>{const a=n.getChildren(r);a==null||a.forEach(s=>e(s.id,i+1)),t[r]=i};return n.getRoots().forEach(r=>e(r.id,1)),t},RP=n=>{let t=0;return n.getAllEdges().forEach(e=>{t+=e.data.weight}),t},LP=(n,t)=>{t&&n.removeNode(t),n.getAllEdges().forEach(e=>{e.data.nestingEdge&&n.removeEdge(e.id)})},_P="edge",Y1="edge-label",DP=(n,t)=>{n.getAllEdges().forEach(e=>IP(n,e,t))},IP=(n,t,e)=>{let r=t.source,i=n.getNode(r).data.rank;const a=t.target,s=n.getNode(a).data.rank,o=t.data.labelRank;if(s===i+1)return;n.removeEdge(t.id);let l,c,u;for(u=0,++i;i<s;++u,++i)t.data.points=[],c={originalEdge:t,width:0,height:0,rank:i},l=bo(n,_P,c,"_d"),i===o&&(c.width=t.data.width,c.height=t.data.height,c.dummy=Y1,c.labelpos=t.data.labelpos),n.addEdge({id:`e${Math.random()}`,source:r,target:l,data:{weight:t.data.weight}}),u===0&&e.push(l),r=l;n.addEdge({id:`e${Math.random()}`,source:r,target:a,data:{weight:t.data.weight}})},BP=(n,t)=>{t.forEach(e=>{let r=n.getNode(e);const{data:i}=r,a=i.originalEdge;let s;a&&n.addEdge(a);let o=e;for(;r.data.dummy;)s=n.getSuccessors(o)[0],n.removeNode(o),a.data.points.push({x:r.data.x,y:r.data.y}),r.data.dummy===Y1&&(a.data.x=r.data.x,a.data.y=r.data.y,a.data.width=r.data.width,a.data.height=r.data.height),o=s.id,r=n.getNode(o)})},FP=(n,t,e)=>{const r={};let i;e==null||e.forEach(a=>{let s=n.getParent(a),o,l;for(;s;){if(o=n.getParent(s.id),o?(l=r[o.id],r[o.id]=s.id):(l=i,i=s.id),l&&l!==s.id){t.hasNode(l)||t.addNode({id:l,data:{}}),t.hasNode(s.id)||t.addNode({id:s.id,data:{}}),t.hasEdge(`e${l}-${s.id}`)||t.addEdge({id:`e${l}-${s.id}`,source:l,target:s.id,data:{}});return}s=o}})},zP=(n,t,e)=>{const r=jP(n),i=new Vn({tree:[{id:r,children:[],data:{}}]});return n.getAllNodes().forEach(a=>{const s=n.getParent(a.id);(a.data.rank===t||a.data.minRank<=t&&t<=a.data.maxRank)&&(i.hasNode(a.id)||i.addNode(Object.assign({},a)),s!=null&&s.id&&!i.hasNode(s==null?void 0:s.id)&&i.addNode(Object.assign({},s)),i.setParent(a.id,(s==null?void 0:s.id)||r),n.getRelatedEdges(a.id,e).forEach(o=>{const l=o.source===a.id?o.target:o.source;i.hasNode(l)||i.addNode(Object.assign({},n.getNode(l)));const c=i.getRelatedEdges(l,"out").find(({target:h})=>h===a.id),u=c!==void 0?c.data.weight:0;c?i.updateEdgeData(c.id,Object.assign(Object.assign({},c.data),{weight:o.data.weight+u})):i.addEdge({id:o.id,source:l,target:a.id,data:{weight:o.data.weight+u}})}),a.data.hasOwnProperty("minRank")&&i.updateNodeData(a.id,Object.assign(Object.assign({},a.data),{borderLeft:a.data.borderLeft[t],borderRight:a.data.borderRight[t]})))}),i},jP=n=>{let t;for(;n.hasNode(t=`_root${Math.random()}`););return t},ZP=(n,t,e)=>{const r=I1(e,e.map((u,h)=>h)),a=t.map(u=>{const h=n.getRelatedEdges(u,"out").map(d=>({pos:r[d.target]||0,weight:d.data.weight}));return h==null?void 0:h.sort((d,f)=>d.pos-f.pos)}).flat().filter(u=>u!==void 0);let s=1;for(;s<e.length;)s<<=1;const o=2*s-1;s-=1;const l=Array(o).fill(0,0,o);let c=0;return a==null||a.forEach(u=>{if(u){let h=u.pos+s;l[h]+=u.weight;let d=0;for(;h>0;)h%2&&(d+=l[h+1]),h=h-1>>1,l[h]+=u.weight;c+=u.weight*d}}),c},H1=(n,t)=>{let e=0;for(let r=1;r<(t==null?void 0:t.length);r+=1)e+=ZP(n,t[r-1],t[r]);return e},X1=n=>{const t={},e=n.getAllNodes(),r=e.map(c=>{var u;return(u=c.data.rank)!==null&&u!==void 0?u:-1/0}),i=Math.max(...r),a=[];for(let c=0;c<i+1;c++)a.push([]);const s=e.sort((c,u)=>n.getNode(c.id).data.rank-n.getNode(u.id).data.rank),l=s.filter(c=>n.getNode(c.id).data.fixorder!==void 0).sort((c,u)=>n.getNode(c.id).data.fixorder-n.getNode(u.id).data.fixorder);return l==null||l.forEach(c=>{isNaN(n.getNode(c.id).data.rank)||a[n.getNode(c.id).data.rank].push(c.id),t[c.id]=!0}),s==null||s.forEach(c=>n.dfsTree(c.id,u=>{if(t.hasOwnProperty(u.id))return!0;t[u.id]=!0,isNaN(u.data.rank)||a[u.data.rank].push(u.id)})),a},WP=(n,t)=>t.map(e=>{const r=n.getRelatedEdges(e,"in");if(!(r!=null&&r.length))return{v:e};const i={sum:0,weight:0};return r==null||r.forEach(a=>{const s=n.getNode(a.source);i.sum+=a.data.weight*s.data.order,i.weight+=a.data.weight}),{v:e,barycenter:i.sum/i.weight,weight:i.weight}}),GP=(n,t)=>{var e,r,i;const a={};n==null||n.forEach((o,l)=>{a[o.v]={i:l,indegree:0,in:[],out:[],vs:[o.v]};const c=a[o.v];o.barycenter!==void 0&&(c.barycenter=o.barycenter,c.weight=o.weight)}),(e=t.getAllEdges())===null||e===void 0||e.forEach(o=>{const l=a[o.source],c=a[o.target];l!==void 0&&c!==void 0&&(c.indegree++,l.out.push(a[o.target]))});const s=(i=(r=Object.values(a)).filter)===null||i===void 0?void 0:i.call(r,o=>!o.indegree);return VP(s)},VP=n=>{var t,e;const r=[],i=l=>c=>{c.merged||(c.barycenter===void 0||l.barycenter===void 0||c.barycenter>=l.barycenter)&&UP(l,c)},a=l=>c=>{c.in.push(l),--c.indegree===0&&n.push(c)};for(;n!=null&&n.length;){const l=n.pop();r.push(l),(t=l.in.reverse())===null||t===void 0||t.forEach(c=>i(l)(c)),(e=l.out)===null||e===void 0||e.forEach(c=>a(l)(c))}const s=r.filter(l=>!l.merged),o=["vs","i","barycenter","weight"];return s.map(l=>{const c={};return o==null||o.forEach(u=>{l[u]!==void 0&&(c[u]=l[u])}),c})},UP=(n,t)=>{var e;let r=0,i=0;n.weight&&(r+=n.barycenter*n.weight,i+=n.weight),t.weight&&(r+=t.barycenter*t.weight,i+=t.weight),n.vs=(e=t.vs)===null||e===void 0?void 0:e.concat(n.vs),n.barycenter=r/i,n.weight=i,n.i=Math.min(t.i,n.i),t.merged=!0};var YP=GP;const HP=(n,t,e,r)=>{const i=MP(n,d=>{const f=d.hasOwnProperty("fixorder")&&!isNaN(d.fixorder);return r?!f&&d.hasOwnProperty("barycenter"):f||d.hasOwnProperty("barycenter")}),a=i.lhs,s=i.rhs.sort((d,f)=>-d.i- -f.i),o=[];let l=0,c=0,u=0;a==null||a.sort(XP(!!t,!!e)),u=K1(o,s,u),a==null||a.forEach(d=>{var f;u+=(f=d.vs)===null||f===void 0?void 0:f.length,o.push(d.vs),l+=d.barycenter*d.weight,c+=d.weight,u=K1(o,s,u)});const h={vs:o.flat()};return c&&(h.barycenter=l/c,h.weight=c),h},K1=(n,t,e)=>{let r=e,i;for(;t.length&&(i=t[t.length-1]).i<=r;)t.pop(),n==null||n.push(i.vs),r++;return r},XP=(n,t)=>(e,r)=>{if(e.fixorder!==void 0&&r.fixorder!==void 0)return e.fixorder-r.fixorder;if(e.barycenter<r.barycenter)return-1;if(e.barycenter>r.barycenter)return 1;if(t&&e.order!==void 0&&r.order!==void 0){if(e.order<r.order)return-1;if(e.order>r.order)return 1}return n?r.i-e.i:e.i-r.i},Q1=(n,t,e,r,i,a)=>{var s,o,l,c;let u=n.getChildren(t).map(b=>b.id);const h=n.getNode(t),d=h?h.data.borderLeft:void 0,f=h?h.data.borderRight:void 0,v={};d&&(u=u==null?void 0:u.filter(b=>b!==d&&b!==f));const g=WP(n,u||[]);g==null||g.forEach(b=>{var E;if(!((E=n.getChildren(b.v))===null||E===void 0)&&E.length){const O=Q1(n,b.v,e,r,a);v[b.v]=O,O.hasOwnProperty("barycenter")&&QP(b,O)}});const p=YP(g,e);KP(p,v),(s=p.filter(b=>b.vs.length>0))===null||s===void 0||s.forEach(b=>{const E=n.getNode(b.vs[0]);E&&(b.fixorder=E.data.fixorder,b.order=E.data.order)});const y=HP(p,r,i,a);if(d&&(y.vs=[d,y.vs,f].flat(),!((o=n.getPredecessors(d))===null||o===void 0)&&o.length)){const b=n.getNode(((l=n.getPredecessors(d))===null||l===void 0?void 0:l[0].id)||""),E=n.getNode(((c=n.getPredecessors(f))===null||c===void 0?void 0:c[0].id)||"");y.hasOwnProperty("barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+b.data.order+E.data.order)/(y.weight+2),y.weight+=2}return y},KP=(n,t)=>{n==null||n.forEach(e=>{var r;const i=(r=e.vs)===null||r===void 0?void 0:r.map(a=>t[a]?t[a].vs:a);e.vs=i.flat()})},QP=(n,t)=>{n.barycenter!==void 0?(n.barycenter=(n.barycenter*n.weight+t.barycenter*t.weight)/(n.weight+t.weight),n.weight+=t.weight):(n.barycenter=t.barycenter,n.weight=t.weight)},qP=(n,t)=>{const e=z1(n),r=[],i=[];for(let u=1;u<e+1;u++)r.push(u);for(let u=e-1;u>-1;u--)i.push(u);const a=q1(n,r,"in"),s=q1(n,i,"out");let o=X1(n);Tv(n,o);let l=Number.POSITIVE_INFINITY,c;for(let u=0,h=0;h<4;++u,++h){J1(u%2?a:s,u%4>=2,!1,t),o=kl(n);const d=H1(n,o);d<l&&(h=0,c=ho(o),l=d)}o=X1(n),Tv(n,o);for(let u=0,h=0;h<4;++u,++h){J1(u%2?a:s,u%4>=2,!0,t),o=kl(n);const d=H1(n,o);d<l&&(h=0,c=ho(o),l=d)}Tv(n,c)},q1=(n,t,e)=>t.map(r=>zP(n,r,e)),J1=(n,t,e,r)=>{const i=new Vn;n==null||n.forEach(a=>{var s;const o=a.getRoots()[0].id,l=Q1(a,o,i,t,e,r);for(let c=0;c<((s=l.vs)===null||s===void 0?void 0:s.length);c++){const u=a.getNode(l.vs[c]);u&&(u.data.order=c)}FP(a,i,l.vs)})},Tv=(n,t)=>{t==null||t.forEach(e=>{e==null||e.forEach((r,i)=>{n.getNode(r).data.order=i})})},JP=(n,t)=>{const r=n.getAllNodes().filter(s=>{var o;return!(!((o=n.getChildren(s.id))===null||o===void 0)&&o.length)}).map(s=>s.data.rank),i=Math.max(...r),a=[];for(let s=0;s<i+1;s++)a[s]=[];t==null||t.forEach(s=>{const o=n.getNode(s);!o||o.data.dummy||isNaN(o.data.rank)||(o.data.fixorder=a[o.data.rank].length,a[o.data.rank].push(s))})},$P=n=>{const t={};let e=0;const r=i=>{const a=e;n.getChildren(i).forEach(s=>r(s.id)),t[i]={low:a,lim:e++}};return n.getRoots().forEach(i=>r(i.id)),t},tR=(n,t,e,r)=>{var i,a;const s=[],o=[],l=Math.min(t[e].low,t[r].low),c=Math.max(t[e].lim,t[r].lim);let u,h;u=e;do u=(i=n.getParent(u))===null||i===void 0?void 0:i.id,s.push(u);while(u&&(t[u].low>l||c>t[u].lim));for(h=u,u=r;u&&u!==h;)o.push(u),u=(a=n.getParent(u))===null||a===void 0?void 0:a.id;return{lca:h,path:s.concat(o.reverse())}},eR=(n,t)=>{const e=$P(n);t.forEach(r=>{var i,a;let s=r,o=n.getNode(s);const l=o.data.originalEdge;if(!l)return;const c=tR(n,e,l.source,l.target),u=c.path,h=c.lca;let d=0,f=u[d],v=!0;for(;s!==l.target;){if(o=n.getNode(s),v){for(;f!==h&&((i=n.getNode(f))===null||i===void 0?void 0:i.data.maxRank)<o.data.rank;)d++,f=u[d];f===h&&(v=!1)}if(!v){for(;d<u.length-1&&((a=n.getNode(u[d+1]))===null||a===void 0?void 0:a.data.minRank)<=o.data.rank;)d++;f=u[d]}n.hasNode(f)&&n.setParent(s,f),s=n.getSuccessors(s)[0].id}})},$1=(n,t)=>{const e={},r=(i,a)=>{let s=0,o=0;const l=i.length,c=a==null?void 0:a[(a==null?void 0:a.length)-1];return a==null||a.forEach((u,h)=>{var d;const f=nR(n,u),v=f?n.getNode(f.id).data.order:l;(f||u===c)&&((d=a.slice(o,h+1))===null||d===void 0||d.forEach(g=>{var p;(p=n.getPredecessors(g))===null||p===void 0||p.forEach(y=>{var b;const E=n.getNode(y.id),O=E.data.order;(O<s||v<O)&&!(E.data.dummy&&(!((b=n.getNode(g))===null||b===void 0)&&b.data.dummy))&&eb(e,y.id,g)})}),o=h+1,s=v)}),a};return t!=null&&t.length&&t.reduce(r),e},tb=(n,t)=>{const e={};function r(o,l,c,u,h){var d,f;let v;for(let g=l;g<c;g++)v=o[g],!((d=n.getNode(v))===null||d===void 0)&&d.data.dummy&&((f=n.getPredecessors(v))===null||f===void 0||f.forEach(p=>{const y=n.getNode(p.id);y.data.dummy&&(y.data.order<u||y.data.order>h)&&eb(e,p.id,v)}))}function i(o){return JSON.stringify(o.slice(1))}function a(o,l){const c=i(o);l.get(c)||(r(...o),l.set(c,!0))}const s=(o,l)=>{let c=-1,u,h=0;const d=new Map;return l==null||l.forEach((f,v)=>{var g;if(((g=n.getNode(f))===null||g===void 0?void 0:g.data.dummy)==="border"){const p=n.getPredecessors(f)||[];p.length&&(u=n.getNode(p[0].id).data.order,a([l,h,v,c,u],d),h=v,c=u)}a([l,h,l.length,u,o.length],d)}),l};return t!=null&&t.length&&t.reduce(s),e},nR=(n,t)=>{var e,r;if(!((e=n.getNode(t))===null||e===void 0)&&e.data.dummy)return(r=n.getPredecessors(t))===null||r===void 0?void 0:r.find(i=>n.getNode(i.id).data.dummy)},eb=(n,t,e)=>{let r=t,i=e;if(r>i){const s=r;r=i,i=s}let a=n[r];a||(n[r]=a={}),a[i]=!0},rR=(n,t,e)=>{let r=t,i=e;if(r>i){const a=t;r=i,i=a}return!!n[r]},nb=(n,t,e,r)=>{const i={},a={},s={};return t==null||t.forEach(o=>{o==null||o.forEach((l,c)=>{i[l]=l,a[l]=l,s[l]=c})}),t==null||t.forEach(o=>{let l=-1;o==null||o.forEach(c=>{let u=r(c).map(h=>h.id);if(u.length){u=u.sort((d,f)=>s[d]-s[f]);const h=(u.length-1)/2;for(let d=Math.floor(h),f=Math.ceil(h);d<=f;++d){const v=u[d];a[c]===c&&l<s[v]&&!rR(e,c,v)&&(a[v]=c,a[c]=i[c]=i[v],l=s[v])}}})}),{root:i,align:a}},rb=(n,t,e,r,i,a,s)=>{var o;const l={},c=iR(n,t,e,i,a,s),u=s?"borderLeft":"borderRight",h=(v,g)=>{let p=c.getAllNodes(),y=p.pop();const b={};for(;y;)b[y.id]?v(y.id):(b[y.id]=!0,p.push(y),p=p.concat(g(y.id))),y=p.pop()},d=v=>{l[v]=(c.getRelatedEdges(v,"in")||[]).reduce((g,p)=>Math.max(g,(l[p.source]||0)+p.data.weight),0)},f=v=>{const g=(c.getRelatedEdges(v,"out")||[]).reduce((y,b)=>Math.min(y,(l[b.target]||0)-b.data.weight),Number.POSITIVE_INFINITY),p=n.getNode(v);g!==Number.POSITIVE_INFINITY&&p.data.borderType!==u&&(l[v]=Math.max(l[v],g))};return h(d,c.getPredecessors.bind(c)),h(f,c.getSuccessors.bind(c)),(o=Object.values(r))===null||o===void 0||o.forEach(v=>{l[v]=l[e[v]]}),l},iR=(n,t,e,r,i,a)=>{const s=new Vn,o=aR(r,i,a);return t==null||t.forEach(l=>{let c;l==null||l.forEach(u=>{const h=e[u];if(s.hasNode(h)||s.addNode({id:h,data:{}}),c){const d=e[c],f=s.getRelatedEdges(d,"out").find(v=>v.target===h);f?s.updateEdgeData(f.id,Object.assign(Object.assign({},f.data),{weight:Math.max(o(n,u,c),f.data.weight||0)})):s.addEdge({id:`e${Math.random()}`,source:d,target:h,data:{weight:Math.max(o(n,u,c),0)}})}c=u})}),s},ib=(n,t)=>Sv(Object.values(t),e=>{var r;let i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return(r=Object.keys(e))===null||r===void 0||r.forEach(s=>{const o=e[s],l=sR(n,s)/2;i=Math.max(o+l,i),a=Math.min(o-l,a)}),i-a});function ab(n,t){const e=Object.values(t),r=Math.min(...e),i=Math.max(...e);["u","d"].forEach(a=>{["l","r"].forEach(s=>{const o=a+s,l=n[o];let c;if(l===t)return;const u=Object.values(l);c=s==="l"?r-Math.min(...u):i-Math.max(...u),c&&(n[o]={},Object.keys(l).forEach(h=>{n[o][h]=l[h]+c}))})})}const sb=(n,t)=>{const e={};return Object.keys(n.ul).forEach(r=>{if(t)e[r]=n[t.toLowerCase()][r];else{const i=Object.values(n).map(a=>a[r]);e[r]=(i[0]+i[1])/2}}),e},h7=(n,t)=>{const{align:e,nodesep:r=0,edgesep:i=0}=t||{},a=buildLayerMatrix(n),s=Object.assign($1(n,a),tb(n,a)),o={};let l;["u","d"].forEach(u=>{l=u==="u"?a:Object.values(a).reverse(),["l","r"].forEach(h=>{h==="r"&&(l=l.map(g=>Object.values(g).reverse()));const d=(u==="u"?n.getPredecessors:n.getSuccessors).bind(n),f=nb(n,l,s,d),v=rb(n,l,f.root,f.align,r,i,h==="r");h==="r"&&Object.keys(v).forEach(g=>{v[g]=-v[g]}),o[u+h]=v})});const c=ib(n,o);return ab(o,c),sb(o,e)},aR=(n,t,e)=>(r,i,a)=>{const s=r.getNode(i),o=r.getNode(a);let l=0,c=0;if(l+=s.data.width/2,s.data.hasOwnProperty("labelpos"))switch((s.data.labelpos||"").toLowerCase()){case"l":c=-s.data.width/2;break;case"r":c=s.data.width/2;break}if(c&&(l+=e?c:-c),c=0,l+=(s.data.dummy?t:n)/2,l+=(o.data.dummy?t:n)/2,l+=o.data.width/2,o.data.labelpos)switch((o.data.labelpos||"").toLowerCase()){case"l":c=o.data.width/2;break;case"r":c=-o.data.width/2;break}return c&&(l+=e?c:-c),c=0,l},sR=(n,t)=>n.getNode(t).data.width||0,oR=(n,t)=>{const{ranksep:e=0}=t||{},r=kl(n);let i=0;r==null||r.forEach(a=>{const s=a.map(l=>n.getNode(l).data.height),o=Math.max(...s,0);a==null||a.forEach(l=>{n.getNode(l).data.y=i+o/2}),i+=o+e})},lR=(n,t)=>{const{align:e,nodesep:r=0,edgesep:i=0}=t||{},a=kl(n),s=Object.assign($1(n,a),tb(n,a)),o={};let l=[];["u","d"].forEach(u=>{l=u==="u"?a:Object.values(a).reverse(),["l","r"].forEach(h=>{h==="r"&&(l=l.map(g=>Object.values(g).reverse()));const d=(u==="u"?n.getPredecessors:n.getSuccessors).bind(n),f=nb(n,l,s,d),v=rb(n,l,f.root,f.align,r,i,h==="r");h==="r"&&Object.keys(v).forEach(g=>v[g]=-v[g]),o[u+h]=v})});const c=ib(n,o);return c&&ab(o,c),sb(o,e)},cR=(n,t)=>{var e;const r=D1(n);oR(r,t);const i=lR(r,t);(e=Object.keys(i))===null||e===void 0||e.forEach(a=>{r.getNode(a).data.x=i[a]})},ob=n=>{const t={},e=r=>{var i;const a=n.getNode(r);if(!a)return 0;if(t[r])return a.data.rank;t[r]=!0;let s;return(i=n.getRelatedEdges(r,"out"))===null||i===void 0||i.forEach(o=>{const l=e(o.target),c=o.data.minlen,u=l-c;u&&(s===void 0||u<s)&&(s=u)}),s||(s=0),a.data.rank=s,s};n.getAllNodes().filter(r=>n.getRelatedEdges(r.id,"in").length===0).forEach(r=>e(r.id))},uR=n=>{const t={};let e;const r=s=>{var o;const l=n.getNode(s);if(!l)return 0;if(t[s])return l.data.rank;t[s]=!0;let c;return(o=n.getRelatedEdges(s,"out"))===null||o===void 0||o.forEach(u=>{const h=r(u.target),d=u.data.minlen,f=h-d;f&&(c===void 0||f<c)&&(c=f)}),c||(c=0),(e===void 0||c<e)&&(e=c),l.data.rank=c,c};n.getAllNodes().filter(s=>n.getRelatedEdges(s.id,"in").length===0).forEach(s=>{s&&r(s.id)}),e===void 0&&(e=0);const i={},a=(s,o)=>{var l;const c=n.getNode(s),u=isNaN(c.data.layer)?o:c.data.layer;(c.data.rank===void 0||c.data.rank<u)&&(c.data.rank=u),!i[s]&&(i[s]=!0,(l=n.getRelatedEdges(s,"out"))===null||l===void 0||l.forEach(h=>{a(h.target,u+h.data.minlen)}))};n.getAllNodes().forEach(s=>{const o=s.data;o&&(isNaN(o.layer)?o.rank-=e:a(s.id,o.layer))})},Ya=(n,t)=>n.getNode(t.target).data.rank-n.getNode(t.source).data.rank-t.data.minlen,hR=n=>{const t=new Vn({tree:[]}),e=n.getAllNodes()[0],r=n.getAllNodes().length;t.addNode(e);let i,a;for(;dR(t,n)<r;)i=lb(t,n),a=t.hasNode(i.source)?Ya(n,i):-Ya(n,i),cb(t,n,a);return t},dR=(n,t)=>{const e=r=>{t.getRelatedEdges(r,"both").forEach(i=>{const a=i.source,s=r===a?i.target:a;!n.hasNode(s)&&!Ya(t,i)&&(n.addNode({id:s,data:{}}),n.addEdge({id:i.id,source:r,target:s,data:{}}),e(s))})};return n.getAllNodes().forEach(r=>e(r.id)),n.getAllNodes().length},fR=n=>{const t=new Vn({tree:[]}),e=n.getAllNodes()[0],r=n.getAllNodes().length;t.addNode(e);let i,a;for(;vR(t,n)<r;)i=lb(t,n),a=t.hasNode(i.source)?Ya(n,i):-Ya(n,i),cb(t,n,a);return t},vR=(n,t)=>{const e=r=>{var i;(i=t.getRelatedEdges(r,"both"))===null||i===void 0||i.forEach(a=>{const s=a.source,o=r===s?a.target:s;!n.hasNode(o)&&(t.getNode(o).data.layer!==void 0||!Ya(t,a))&&(n.addNode({id:o,data:{}}),n.addEdge({id:a.id,source:r,target:o,data:{}}),e(o))})};return n.getAllNodes().forEach(r=>e(r.id)),n.getAllNodes().length},lb=(n,t)=>Sv(t.getAllEdges(),e=>n.hasNode(e.source)!==n.hasNode(e.target)?Ya(t,e):1/0),cb=(n,t,e)=>{n.getAllNodes().forEach(r=>{const i=t.getNode(r.id);i.data.rank||(i.data.rank=0),i.data.rank+=e})},gR=n=>{const t=EP(n);ob(t);const e=hR(t);hb(e),ub(e,t);let r,i;for(;r=yR(e);)i=bR(e,t,r),xR(e,t,r,i)},ub=(n,t)=>{let e=Z1(n,n.getAllNodes(),"post",!1);e=e.slice(0,(e==null?void 0:e.length)-1),e.forEach(r=>{pR(n,t,r)})},pR=(n,t,e)=>{const i=n.getNode(e).data.parent,a=n.getRelatedEdges(e,"both").find(s=>s.target===i||s.source===i);a.data.cutvalue=mR(n,t,e)},mR=(n,t,e)=>{const i=n.getNode(e).data.parent;let a=!0,s=t.getRelatedEdges(e,"out").find(l=>l.target===i),o=0;return s||(a=!1,s=t.getRelatedEdges(i,"out").find(l=>l.target===e)),o=s.data.weight,t.getRelatedEdges(e,"both").forEach(l=>{const c=l.source===e,u=c?l.target:l.source;if(u!==i){const h=c===a,d=l.data.weight;if(o+=h?d:-d,wR(n,e,u)){const f=n.getRelatedEdges(e,"both").find(v=>v.source===u||v.target===u).data.cutvalue;o+=h?-f:f}}}),o},hb=(n,t=n.getAllNodes()[0].id)=>{db(n,{},1,t)},db=(n,t,e,r,i)=>{var a;const s=e;let o=e;const l=n.getNode(r);return t[r]=!0,(a=n.getNeighbors(r))===null||a===void 0||a.forEach(c=>{t[c.id]||(o=db(n,t,o,c.id,r))}),l.data.low=s,l.data.lim=o++,i?l.data.parent=i:delete l.data.parent,o},yR=n=>n.getAllEdges().find(t=>t.data.cutvalue<0),bR=(n,t,e)=>{let r=e.source,i=e.target;t.getRelatedEdges(r,"out").find(u=>u.target===i)||(r=e.target,i=e.source);const a=n.getNode(r),s=n.getNode(i);let o=a,l=!1;a.data.lim>s.data.lim&&(o=s,l=!0);const c=t.getAllEdges().filter(u=>l===fb(n.getNode(u.source),o)&&l!==fb(n.getNode(u.target),o));return Sv(c,u=>Ya(t,u))},xR=(n,t,e,r)=>{const i=n.getRelatedEdges(e.source,"both").find(a=>a.source===e.target||a.target===e.target);i&&n.removeEdge(i.id),n.addEdge({id:`e${Math.random()}`,source:r.source,target:r.target,data:{}}),hb(n),ub(n,t),ER(n,t)},ER=(n,t)=>{const e=n.getAllNodes().find(i=>!i.data.parent);let r=Z1(n,e,"pre",!1);r=r.slice(1),r.forEach(i=>{const a=n.getNode(i).data.parent;let s=t.getRelatedEdges(i,"out").find(l=>l.target===a),o=!1;!s&&t.hasNode(a)&&(s=t.getRelatedEdges(a,"out").find(l=>l.target===i),o=!0),t.getNode(i).data.rank=(t.hasNode(a)&&t.getNode(a).data.rank||0)+(o?s==null?void 0:s.data.minlen:-(s==null?void 0:s.data.minlen))})},wR=(n,t,e)=>n.getRelatedEdges(t,"both").find(r=>r.source===e||r.target===e),fb=(n,t)=>t.data.low<=n.data.lim&&n.data.lim<=t.data.lim,SR=(n,t)=>{switch(t){case"network-simplex":AR(n);break;case"tight-tree":vb(n);break;case"longest-path":MR(n);break;default:vb(n)}},MR=ob,vb=n=>{uR(n),fR(n)},AR=n=>{gR(n)},TR=(n,t)=>{const{edgeLabelSpace:e,keepNodeOrder:r,prevGraph:i,rankdir:a,ranksep:s}=t;!r&&i&&CR(n,i);const o=_R(n);e&&(t.ranksep=DR(o,{rankdir:a,ranksep:s}));let l;try{l=OR(o,t)}catch(c){if(c.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
`,c);return}throw c}return NR(n,o),l},OR=(n,t)=>{const{acyclicer:e,ranker:r,rankdir:i="tb",nodeOrder:a,keepNodeOrder:s,align:o,nodesep:l=50,edgesep:c=20,ranksep:u=50}=t;VR(n),mP(n,e);const{nestingRoot:h,nodeRankFactor:d}=kP(n);SR(D1(n),r),IR(n),SP(n,d),LP(n,h),wP(n),BR(n),FR(n);const f=[];DP(n,f),eR(n,f),AP(n),s&&JP(n,a),qP(n,s),UR(n),TP(n,i),cR(n,{align:o,nodesep:l,edgesep:c,ranksep:u}),YR(n),GR(n),BP(n,f),ZR(n),OP(n,i);const{width:v,height:g}=zR(n);return jR(n),WR(n),bP(n),{width:v,height:g}},CR=(n,t)=>{n.getAllNodes().forEach(e=>{const r=n.getNode(e.id);if(t.hasNode(e.id)){const i=t.getNode(e.id);r.data.fixorder=i.data._order,delete i.data._order}else delete r.data.fixorder})},NR=(n,t)=>{n.getAllNodes().forEach(e=>{var r;const i=n.getNode(e.id);if(i){const a=t.getNode(e.id);i.data.x=a.data.x,i.data.y=a.data.y,i.data._order=a.data.order,i.data._rank=a.data.rank,!((r=t.getChildren(e.id))===null||r===void 0)&&r.length&&(i.data.width=a.data.width,i.data.height=a.data.height)}}),n.getAllEdges().forEach(e=>{const r=n.getEdge(e.id),i=t.getEdge(e.id);r.data.points=i?i.data.points:[],i&&i.data.hasOwnProperty("x")&&(r.data.x=i.data.x,r.data.y=i.data.y)})},kR=["width","height","layer","fixorder"],PR={width:0,height:0},RR=["minlen","weight","width","height","labeloffset"],LR={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Ov=["labelpos"],_R=n=>{const t=new Vn({tree:[]});return n.getAllNodes().forEach(e=>{const r=pb(n.getNode(e.id).data),i=Object.assign(Object.assign({},PR),r),a=gb(i,kR);t.hasNode(e.id)||t.addNode({id:e.id,data:Object.assign({},a)});const s=n.hasTreeStructure("combo")?n.getParent(e.id,"combo"):n.getParent(e.id);me(s)||(t.hasNode(s.id)||t.addNode(Object.assign({},s)),t.setParent(e.id,s.id))}),n.getAllEdges().forEach(e=>{const r=pb(n.getEdge(e.id).data),i={};Ov==null||Ov.forEach(a=>{r[a]!==void 0&&(i[a]=r[a])}),t.addEdge({id:e.id,source:e.source,target:e.target,data:Object.assign({},LR,gb(r,RR),i)})}),t},DR=(n,t)=>{const{ranksep:e=0,rankdir:r}=t;return n.getAllNodes().forEach(i=>{isNaN(i.data.layer)||i.data.layer||(i.data.layer=0)}),n.getAllEdges().forEach(i=>{var a;i.data.minlen*=2,((a=i.data.labelpos)===null||a===void 0?void 0:a.toLowerCase())!=="c"&&(r==="TB"||r==="BT"?i.data.width+=i.data.labeloffset:i.data.height+=i.data.labeloffset)}),e/2},IR=n=>{n.getAllEdges().forEach(t=>{if(t.data.width&&t.data.height){const e=n.getNode(t.source),r=n.getNode(t.target),i={e:t,rank:(r.data.rank-e.data.rank)/2+e.data.rank};bo(n,"edge-proxy",i,"_ep")}})},BR=n=>{let t=0;return n.getAllNodes().forEach(e=>{var r,i;e.data.borderTop&&(e.data.minRank=(r=n.getNode(e.data.borderTop))===null||r===void 0?void 0:r.data.rank,e.data.maxRank=(i=n.getNode(e.data.borderBottom))===null||i===void 0?void 0:i.data.rank,t=Math.max(t,e.data.maxRank||-1/0))}),t},FR=n=>{n.getAllNodes().forEach(t=>{t.data.dummy==="edge-proxy"&&(n.getEdge(t.data.e.id).data.labelRank=t.data.rank,n.removeNode(t.id))})},zR=(n,t)=>{let e,r=0,i,a=0;const{marginx:s=0,marginy:o=0}=t||{},l=c=>{if(!c.data)return;const u=c.data.x,h=c.data.y,d=c.data.width,f=c.data.height;!isNaN(u)&&!isNaN(d)&&(e===void 0&&(e=u-d/2),e=Math.min(e,u-d/2),r=Math.max(r,u+d/2)),!isNaN(h)&&!isNaN(f)&&(i===void 0&&(i=h-f/2),i=Math.min(i,h-f/2),a=Math.max(a,h+f/2))};return n.getAllNodes().forEach(c=>{l(c)}),n.getAllEdges().forEach(c=>{c!=null&&c.data.hasOwnProperty("x")&&l(c)}),e-=s,i-=o,n.getAllNodes().forEach(c=>{c.data.x-=e,c.data.y-=i}),n.getAllEdges().forEach(c=>{var u;(u=c.data.points)===null||u===void 0||u.forEach(h=>{h.x-=e,h.y-=i}),c.data.hasOwnProperty("x")&&(c.data.x-=e),c.data.hasOwnProperty("y")&&(c.data.y-=i)}),{width:r-e+s,height:a-i+o}},jR=n=>{n.getAllEdges().forEach(t=>{const e=n.getNode(t.source),r=n.getNode(t.target);let i,a;t.data.points?(i=t.data.points[0],a=t.data.points[t.data.points.length-1]):(t.data.points=[],i={x:r.data.x,y:r.data.y},a={x:e.data.x,y:e.data.y}),t.data.points.unshift(B1(e.data,i)),t.data.points.push(B1(r.data,a))})},ZR=n=>{n.getAllEdges().forEach(t=>{if(t.data.hasOwnProperty("x"))switch((t.data.labelpos==="l"||t.data.labelpos==="r")&&(t.data.width-=t.data.labeloffset),t.data.labelpos){case"l":t.data.x-=t.data.width/2+t.data.labeloffset;break;case"r":t.data.x+=t.data.width/2+t.data.labeloffset;break}})},WR=n=>{n.getAllEdges().forEach(t=>{var e;t.data.reversed&&((e=t.data.points)===null||e===void 0||e.reverse())})},GR=n=>{n.getAllNodes().forEach(t=>{var e,r,i;if(!((e=n.getChildren(t.id))===null||e===void 0)&&e.length){const a=n.getNode(t.id),s=n.getNode(a.data.borderTop),o=n.getNode(a.data.borderBottom),l=n.getNode(a.data.borderLeft[((r=a.data.borderLeft)===null||r===void 0?void 0:r.length)-1]),c=n.getNode(a.data.borderRight[((i=a.data.borderRight)===null||i===void 0?void 0:i.length)-1]);a.data.width=Math.abs((c==null?void 0:c.data.x)-(l==null?void 0:l.data.x))||10,a.data.height=Math.abs((o==null?void 0:o.data.y)-(s==null?void 0:s.data.y))||10,a.data.x=((l==null?void 0:l.data.x)||0)+a.data.width/2,a.data.y=((s==null?void 0:s.data.y)||0)+a.data.height/2}}),n.getAllNodes().forEach(t=>{t.data.dummy==="border"&&n.removeNode(t.id)})},VR=n=>{n.getAllEdges().forEach(t=>{if(t.source===t.target){const e=n.getNode(t.source);e.data.selfEdges||(e.data.selfEdges=[]),e.data.selfEdges.push(t),n.removeEdge(t.id)}})},UR=n=>{const t=kl(n);t==null||t.forEach(e=>{let r=0;e==null||e.forEach((i,a)=>{var s;const o=n.getNode(i);o.data.order=a+r,(s=o.data.selfEdges)===null||s===void 0||s.forEach(l=>{bo(n,"selfedge",{width:l.data.width,height:l.data.height,rank:o.data.rank,order:a+ ++r,e:l},"_se")}),delete o.data.selfEdges})})},YR=n=>{n.getAllNodes().forEach(t=>{const e=n.getNode(t.id);if(e.data.dummy==="selfedge"){const r=n.getNode(e.data.e.source),i=r.data.x+r.data.width/2,a=r.data.y,s=e.data.x-i,o=r.data.height/2;n.hasEdge(e.data.e.id)?n.updateEdgeData(e.data.e.id,e.data.e.data):n.addEdge({id:e.data.e.id,source:e.data.e.source,target:e.data.e.target,data:e.data.e.data}),n.removeNode(t.id),e.data.e.data.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{y:a,x:i+s},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],e.data.e.data.x=e.data.x,e.data.e.data.y=e.data.y}})},gb=(n,t)=>{const e={};return t==null||t.forEach(r=>{n[r]!==void 0&&(e[r]=+n[r])}),e},pb=(n={})=>{const t={};return Object.keys(n).forEach(e=>{t[e.toLowerCase()]=n[e]}),t};function Pl(n){if(!n)return[0,0,0];if(ie(n))return[n,n,n];if(n.length===0)return[0,0,0];const[t,e=t,r=t]=n;return[t,e,r]}function js(n,t){let e;return fe(t)?e=t:ie(t)?e=()=>t:e=()=>n,e}function Cv(n,t,e=!0){return!t&&t!==0?r=>{const{size:i}=r.data||{};return i?Array.isArray(i)?e?Math.max(...i)||n:i:Fn(i)&&i.width&&i.height?e?Math.max(i.width,i.height)||n:[i.width,i.height]:i:n}:fe(t)?t:ie(t)?()=>t:Array.isArray(t)?()=>e?Math.max(...t)||n:t:Fn(t)&&t.width&&t.height?()=>e?Math.max(t.width,t.height)||n:[t.width,t.height]:()=>n}const Nv=(n,t,e=10)=>{let r;const i=typeof t=="function"?t:()=>t||0;return n?Array.isArray(n)?r=s=>n:fe(n)?r=n:r=s=>n:r=s=>{var o,l,c;if(!((o=s.data)===null||o===void 0)&&o.bboxSize)return(l=s.data)===null||l===void 0?void 0:l.bboxSize;if(!((c=s.data)===null||c===void 0)&&c.size){const u=s.data.size;return Array.isArray(u)?u:Fn(u)?[u.width,u.height]:u}return e},s=>{const o=r(s),l=i(s);return Math.max(...Pl(o))+l}},kv=n=>{if(n===null)return n;if(n instanceof Date)return new Date(n.getTime());if(n instanceof Array){const t=[];return n.forEach(e=>{t.push(e)}),t.map(e=>kv(e))}if(typeof n=="object"){const t={};return Object.keys(n).forEach(e=>{t[e]=kv(n[e])}),t}return n},li=(n,t)=>{const e=kv(n);return e.data=e.data||{},t&&(ie(e.data.x)||(e.data.x=Math.random()*t[0]),ie(e.data.y)||(e.data.y=Math.random()*t[1])),e},HR={rankdir:"TB",nodesep:50,ranksep:50,edgeLabelSpace:!0,ranker:"tight-tree",controlPoints:!1,radial:!1,focusNode:null};class XR{constructor(t={}){this.options=t,this.id="antv-dagre",this.options=Object.assign(Object.assign({},HR),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,t,e)})}genericDagreLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),r),{nodeSize:a,align:s,rankdir:o="TB",ranksep:l,nodesep:c,ranksepFunc:u,nodesepFunc:h,edgeLabelSpace:d,ranker:f,nodeOrder:v,begin:g,controlPoints:p,radial:y,sortByCombo:b,preset:E}=i,O=new Vn({tree:[]}),P=js(l||50,u),L=js(c||50,h);let F=L,I=P;(o==="LR"||o==="RL")&&(F=P,I=L);const V=Cv(10,a,!1),Y=e.getAllNodes(),J=e.getAllEdges();Y.forEach(mt=>{const yt=Pl(V(mt)),Rt=I(mt),jt=F(mt),Xt=yt[0]+2*jt,ee=yt[1]+2*Rt,ae=mt.data.layer;ie(ae)?O.addNode({id:mt.id,data:{width:Xt,height:ee,layer:ae}}):O.addNode({id:mt.id,data:{width:Xt,height:ee}})}),b&&(O.attachTreeStructure("combo"),Y.forEach(mt=>{const{parentId:yt}=mt.data;yt!==void 0&&O.hasNode(yt)&&O.setParent(mt.id,yt,"combo")})),J.forEach(mt=>{O.addEdge({id:mt.id,source:mt.source,target:mt.target,data:{weight:mt.data.weight||1}})});let $;E!=null&&E.length&&($=new Vn({nodes:E})),TR(O,{prevGraph:$,edgeLabelSpace:d,keepNodeOrder:!!v,nodeOrder:v||[],acyclicer:"greedy",ranker:f,rankdir:o,nodesep:c,align:s});const ot=[0,0];if(g){let mt=1/0,yt=1/0;O.getAllNodes().forEach(Rt=>{mt>Rt.data.x&&(mt=Rt.data.x),yt>Rt.data.y&&(yt=Rt.data.y)}),O.getAllEdges().forEach(Rt=>{var jt;(jt=Rt.data.points)===null||jt===void 0||jt.forEach(Xt=>{mt>Xt.x&&(mt=Xt.x),yt>Xt.y&&(yt=Xt.y)})}),ot[0]=g[0]-mt,ot[1]=g[1]-yt}const ct=o==="LR"||o==="RL";if(!y){const mt=new Set,Rt=o==="BT"||o==="RL"?(ae,he)=>he-ae:(ae,he)=>ae-he;O.getAllNodes().forEach(ae=>{ae.data.x=ae.data.x+ot[0],ae.data.y=ae.data.y+ot[1],mt.add(ct?ae.data.x:ae.data.y)});const jt=Array.from(mt).sort(Rt),Xt=ct?(ae,he)=>ae.x!==he.x:(ae,he)=>ae.y!==he.y,ee=ct?(ae,he,ce)=>{const xe=Math.max(he.y,ce.y),Ce=Math.min(he.y,ce.y);return ae.filter(je=>je.y<=xe&&je.y>=Ce)}:(ae,he,ce)=>{const xe=Math.max(he.x,ce.x),Ce=Math.min(he.x,ce.x);return ae.filter(je=>je.x<=xe&&je.x>=Ce)};O.getAllEdges().forEach((ae,he)=>{var ce;d&&p&&ae.data.type!=="loop"&&(ae.data.controlPoints=KR((ce=ae.data.points)===null||ce===void 0?void 0:ce.map(({x:xe,y:Ce})=>({x:xe+ot[0],y:Ce+ot[1]})),O.getNode(ae.source),O.getNode(ae.target),jt,ct,Xt,ee))})}let ft=[];ft=O.getAllNodes().map(mt=>li(mt));const Nt=O.getAllEdges();return t&&(ft.forEach(mt=>{e.mergeNodeData(mt.id,{x:mt.data.x,y:mt.data.y})}),Nt.forEach(mt=>{e.mergeEdgeData(mt.id,{controlPoints:mt.data.controlPoints})})),{nodes:ft,edges:Nt}})}}const KR=(n,t,e,r,i,a,s)=>{let o=(n==null?void 0:n.slice(1,n.length-1))||[];if(t&&e){let{x:l,y:c}=t.data,{x:u,y:h}=e.data;if(i&&(l=t.data.y,c=t.data.x,u=e.data.y,h=e.data.x),h!==c&&l!==u){const d=r.indexOf(c),f=r[d+1];if(f){const p=o[0],y=i?{x:(c+f)/2,y:(p==null?void 0:p.y)||u}:{x:(p==null?void 0:p.x)||u,y:(c+f)/2};(!p||a(p,y))&&o.unshift(y)}const v=r.indexOf(h),g=Math.abs(v-d);if(g===1)o=s(o,t.data,e.data),o.length||o.push(i?{x:(c+h)/2,y:l}:{x:l,y:(c+h)/2});else if(g>1){const p=r[v-1];if(p){const y=o[o.length-1],b=i?{x:(h+p)/2,y:(y==null?void 0:y.y)||u}:{x:(y==null?void 0:y.x)||l,y:(h+p)/2};(!y||a(y,b))&&o.push(b)}}}}return o},Zs=(n,t,e)=>{const r=n.getAllNodes(),i=n.getAllEdges();if(!(r!=null&&r.length))return{nodes:[],edges:i};if(r.length===1)return t&&n.mergeNodeData(r[0].id,{x:e[0],y:e[1]}),{nodes:[Object.assign(Object.assign({},r[0]),{data:Object.assign(Object.assign({},r[0].data),{x:e[0],y:e[1]})})],edges:i}},QR={radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1};class qR{constructor(t={}){this.options=t,this.id="circular",this.options=Object.assign(Object.assign({},QR),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericCircularLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericCircularLayout(!0,t,e)})}genericCircularLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),r),{width:a,height:s,center:o,divisions:l,startAngle:c=0,endAngle:u=2*Math.PI,angleRatio:h,ordering:d,clockwise:f,nodeSpacing:v,nodeSize:g}=i,p=e.getAllNodes(),y=e.getAllEdges(),[b,E,O]=$R(a,s,o),P=p==null?void 0:p.length;if(!P||P===1)return Zs(e,t,O);const L=(u-c)/P;let{radius:F,startRadius:I,endRadius:V}=i;if(v){const ct=js(10,v),ft=Cv(10,g);let Nt=-1/0;p.forEach(mt=>{const yt=ft(mt);Nt<yt&&(Nt=yt)});let Ot=0;p.forEach((mt,yt)=>{yt===0?Ot+=Nt||10:Ot+=(ct(mt)||0)+(Nt||10)}),F=Ot/(2*Math.PI)}else!F&&!I&&!V?F=Math.min(E,b)/2:!I&&V?I=V:I&&!V&&(V=I);const Y=L*h;let J=[];d==="topology"?J=mb(e,p):d==="topology-directed"?J=mb(e,p,!0):d==="degree"?J=JR(e,p):J=p.map(ct=>li(ct));const $=Math.ceil(P/l);for(let ct=0;ct<P;++ct){let ft=F;!ft&&I!==null&&V!==null&&(ft=I+ct*(V-I)/(P-1)),ft||(ft=10+ct*100/(P-1));let Nt=c+ct%$*Y+2*Math.PI/l*Math.floor(ct/$);f||(Nt=u-ct%$*Y-2*Math.PI/l*Math.floor(ct/$)),J[ct].data.x=O[0]+Math.cos(Nt)*ft,J[ct].data.y=O[1]+Math.sin(Nt)*ft}return t&&J.forEach(ct=>{e.mergeNodeData(ct.id,{x:ct.data.x,y:ct.data.y})}),{nodes:J,edges:y}})}}const mb=(n,t,e=!1)=>{const r=[li(t[0])],i={},a=t.length;i[t[0].id]=!0;let s=0;return t.forEach((o,l)=>{if(l!==0)if((l===a-1||n.getDegree(o.id,"both")!==n.getDegree(t[l+1].id,"both")||n.areNeighbors(r[s].id,o.id))&&!i[o.id])r.push(li(o)),i[o.id]=!0,s++;else{const c=e?n.getSuccessors(r[s].id):n.getNeighbors(r[s].id);let u=!1;for(let d=0;d<c.length;d++){const f=c[d];if(n.getDegree(f.id)===n.getDegree(o.id)&&!i[f.id]){r.push(li(f)),i[f.id]=!0,u=!0;break}}let h=0;for(;!u&&(i[t[h].id]||(r.push(li(t[h])),i[t[h].id]=!0,u=!0),h++,h!==a););}}),r};function JR(n,t){const e=[];return t.forEach((r,i)=>{e.push(li(r))}),e.sort((r,i)=>n.getDegree(r.id,"both")-n.getDegree(i.id,"both")),e}const $R=(n,t,e)=>{let r=n,i=t,a=e;return!r&&typeof window!="undefined"&&(r=window.innerWidth),!i&&typeof window!="undefined"&&(i=window.innerHeight),a||(a=[r/2,i/2]),[r,i,a]},xa=Array.isArray,tL={nodeSize:30,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"};class Pv{constructor(t={}){this.options=t,this.id="concentric",this.options=Object.assign(Object.assign({},tL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericConcentricLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericConcentricLayout(!0,t,e)})}genericConcentricLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),r),{center:a,width:s,height:o,sortBy:l,maxLevelDiff:c,sweep:u,clockwise:h,equidistant:d,preventOverlap:f,startAngle:v=3/2*Math.PI,nodeSize:g,nodeSpacing:p}=i,y=e.getAllNodes(),b=e.getAllEdges(),E=!s&&typeof window!="undefined"?window.innerWidth:s,O=!o&&typeof window!="undefined"?window.innerHeight:o,P=a||[E/2,O/2];if(!(y!=null&&y.length)||y.length===1)return Zs(e,t,P);const L=[];let F,I=0;xa(g)?F=Math.max(g[0],g[1]):fe(g)?(F=-1/0,y.forEach(mt=>{const yt=Math.max(...Pl(g(mt)));yt>F&&(F=yt)})):F=g,xa(p)?I=Math.max(p[0],p[1]):ie(p)&&(I=p),y.forEach(mt=>{const yt=li(mt);L.push(yt);let Rt=F;const{data:jt}=yt;xa(jt.size)?Rt=Math.max(jt.size[0],jt.size[1]):ie(jt.size)?Rt=jt.size:Fn(jt.size)&&(Rt=Math.max(jt.size.width,jt.size.height)),F=Math.max(F,Rt),fe(p)&&(I=Math.max(p(mt),I))});const V={};L.forEach((mt,yt)=>{V[mt.id]=yt});let Y=l;(!Ge(Y)||L[0].data[Y]===void 0)&&(Y="degree"),Y==="degree"?L.sort((mt,yt)=>e.getDegree(yt.id,"both")-e.getDegree(mt.id,"both")):L.sort((mt,yt)=>yt.data[Y]-mt.data[Y]);const J=L[0],$=(c||(Y==="degree"?e.getDegree(J.id,"both"):J.data[Y]))/4,ot=[{nodes:[]}];let ct=ot[0];L.forEach(mt=>{if(ct.nodes.length>0){const yt=Math.abs(Y==="degree"?e.getDegree(ct.nodes[0].id,"both")-e.getDegree(mt.id,"both"):ct.nodes[0].data[Y]-mt.data[Y]);$&&yt>=$&&(ct={nodes:[]},ot.push(ct))}ct.nodes.push(mt)});let ft=F+I;if(!f){const mt=ot.length>0&&ot[0].nodes.length>1,Rt=(Math.min(E,O)/2-ft)/(ot.length+(mt?1:0));ft=Math.min(ft,Rt)}let Nt=0;if(ot.forEach(mt=>{const yt=u===void 0?2*Math.PI-2*Math.PI/mt.nodes.length:u;if(mt.dTheta=yt/Math.max(1,mt.nodes.length-1),mt.nodes.length>1&&f){const Rt=Math.cos(mt.dTheta)-Math.cos(0),jt=Math.sin(mt.dTheta)-Math.sin(0),Xt=Math.sqrt(ft*ft/(Rt*Rt+jt*jt));Nt=Math.max(Xt,Nt)}mt.r=Nt,Nt+=ft}),d){let mt=0,yt=0;for(let Rt=0;Rt<ot.length;Rt++){const Xt=(ot[Rt].r||0)-yt;mt=Math.max(mt,Xt)}yt=0,ot.forEach((Rt,jt)=>{jt===0&&(yt=Rt.r||0),Rt.r=yt,yt+=mt})}return ot.forEach(mt=>{const yt=mt.dTheta||0,Rt=mt.r||0;mt.nodes.forEach((jt,Xt)=>{const ee=v+(h?1:-1)*yt*Xt;jt.data.x=P[0]+Rt*Math.cos(ee),jt.data.y=P[1]+Rt*Math.sin(ee)})}),t&&L.forEach(mt=>e.mergeNodeData(mt.id,{x:mt.data.x,y:mt.data.y})),{nodes:L,edges:b}})}}var Rv=S(14301),eL=S(7695);const nL=.81,Lv=.1;function rL(n,t,e,r,i=2){const a=t/e,s=n.getAllNodes(),o=s.map((u,h)=>{const{nodeStrength:d,x:f,y:v,z:g,size:p}=u.data;return{x:f,y:v,z:g,size:p,index:h,id:u.id,vx:0,vy:0,vz:0,weight:a*d}}),l=(i===2?(0,Rv.Z)(o,u=>u.x,u=>u.y):(0,eL.Z)(o,u=>u.x,u=>u.y,u=>u.z)).visitAfter(iL),c=new Map;return o.forEach(u=>{c.set(u.id,u),sL(u,l,i)}),o.map((u,h)=>{const{id:d,data:f}=s[h],{mass:v=1}=f;r[d]={x:u.vx/v,y:u.vy/v,z:u.vz/v}}),r}function iL(n){let t=0,e=0,r=0,i=0,a=0;const s=n.length;if(s){for(let o=0;o<s;o++){const l=n[o];l&&l.weight&&(t+=l.weight,e+=l.x*l.weight,r+=l.y*l.weight,i+=l.z*l.weight,a+=l.size*l.weight)}n.x=e/t,n.y=r/t,n.z=i/t,n.size=a/t,n.weight=t}else{const o=n;n.x=o.data.x,n.y=o.data.y,n.z=o.data.z,n.size=o.data.size,n.weight=o.data.weight}}const aL=(n,t,e,r,i,a,s)=>{var o;if(((o=n.data)===null||o===void 0?void 0:o.id)===a.id)return;const l=[e,r,i][s-1],c=a.x-n.x||Lv,u=a.y-n.y||Lv,h=a.z-n.z||Lv,d=[c,u,h],f=l-t;let v=0;for(let y=0;y<s;y++)v+=d[y]*d[y];const p=Math.sqrt(v)*v;if(f*f*nL<v){const y=n.weight/p;return a.vx+=c*y,a.vy+=u*y,a.vz+=h*y,!0}if(n.length)return!1;if(n.data!==a){const y=n.data.weight/p;a.vx+=c*y,a.vy+=u*y,a.vz+=h*y}};function sL(n,t,e){t.visit((r,i,a,s,o)=>aL(r,i,a,s,o,n,e))}const oL={dimensions:2,maxIteration:500,gravity:10,factor:1,edgeStrength:50,nodeStrength:1e3,coulombDisScale:.005,damping:.9,maxSpeed:200,minMovement:.4,interval:.02,linkDistance:200,clusterNodeStrength:20,preventOverlap:!0,distanceThresholdMode:"mean"};class yb{constructor(t={}){this.options=t,this.id="force",this.timeInterval=0,this.judgingDistance=0,this.running=!1,this.options=Object.assign(Object.assign({},oL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericForceLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericForceLayout(!0,t,e)})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval),this.running=!1}tick(t=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let r=0;(this.judgingDistance>this.lastOptions.minMovement||r<1)&&r<t;r++)this.runOneStep(this.lastCalcGraph,this.lastGraph,r,this.lastVelMap,this.lastOptions),this.updatePosition(this.lastGraph,this.lastCalcGraph,this.lastVelMap,this.lastOptions);const e={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&e.nodes.forEach(r=>this.lastGraph.mergeNodeData(r.id,{x:r.data.x,y:r.data.y,z:this.options.dimensions===3?r.data.z:void 0})),e}genericForceLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),r),a=e.getAllNodes(),s=e.getAllEdges(),o=this.formatOptions(i,e),{dimensions:l,width:c,height:u,nodeSize:h,getMass:d,nodeStrength:f,edgeStrength:v,linkDistance:g}=o,p=a.map((I,V)=>Object.assign(Object.assign({},I),{data:Object.assign(Object.assign({},I.data),{x:ie(I.data.x)?I.data.x:Math.random()*c,y:ie(I.data.y)?I.data.y:Math.random()*u,z:ie(I.data.z)?I.data.z:Math.random()*Math.sqrt(c*u),size:h(I)||30,mass:d(I),nodeStrength:f(I)})})),y=s.map(I=>Object.assign(Object.assign({},I),{data:Object.assign(Object.assign({},I.data),{edgeStrength:v(I),linkDistance:g(I,e.getNode(I.source),e.getNode(I.target))})}));if(!(a!=null&&a.length))return this.lastResult={nodes:[],edges:s},{nodes:[],edges:s};const b={};a.forEach((I,V)=>{b[I.id]={x:0,y:0,z:0}});const E=new Vn({nodes:p,edges:y});this.formatCentripetal(o,E);const{maxIteration:O,minMovement:P,onTick:L}=o;if(this.lastLayoutNodes=p,this.lastLayoutEdges=y,this.lastAssign=t,this.lastGraph=e,this.lastCalcGraph=E,this.lastOptions=o,this.lastVelMap=b,typeof window=="undefined")return;let F=0;return new Promise(I=>{this.timeInterval=window.setInterval(()=>{(!a||!this.running)&&I({nodes:_v(e,p),edges:s}),this.runOneStep(E,e,F,b,o),this.updatePosition(e,E,b,o),t&&p.forEach(V=>e.mergeNodeData(V.id,{x:V.data.x,y:V.data.y,z:l===3?V.data.z:void 0})),L==null||L({nodes:_v(e,p),edges:s}),F++,(F>=O||this.judgingDistance<P)&&(window.clearInterval(this.timeInterval),I({nodes:_v(e,p),edges:s}))},0),this.running=!0})})}formatOptions(t,e){const r=Object.assign({},t),{width:i,height:a,getMass:s}=t;r.width=!i&&typeof window!="undefined"?window.innerWidth:i,r.height=!a&&typeof window!="undefined"?window.innerHeight:a,t.center||(r.center=[r.width/2,r.height/2]),s||(r.getMass=l=>{let c=1;ie(l==null?void 0:l.data.mass)&&(c=l==null?void 0:l.data.mass);const u=e.getDegree(l.id,"both");return!u||u<5?c:u*5*c}),r.nodeSize=Nv(t.nodeSize,t.nodeSpacing);const o=t.linkDistance?js(1,t.linkDistance):l=>1+r.nodeSize(e.getNode(l.source))+r.nodeSize(e.getNode(l.target));return r.linkDistance=o,r.nodeStrength=js(1,t.nodeStrength),r.edgeStrength=js(1,t.edgeStrength),r}formatCentripetal(t,e){const{dimensions:r,centripetalOptions:i,center:a,clusterNodeStrength:s,leafCluster:o,clustering:l,nodeClusterBy:c}=t,u=e.getAllNodes(),h=i||{leaf:2,single:2,others:1,center:y=>({x:a[0],y:a[1],z:r===3?a[2]:void 0})};typeof s!="function"&&(t.clusterNodeStrength=y=>s);let d,f;if(o&&c&&(d=bb(e,c),f=Array.from(new Set(u==null?void 0:u.map(y=>y.data[c])))||[],t.centripetalOptions=Object.assign(h,{single:100,leaf:y=>{const{siblingLeaves:b,sameTypeLeaves:E}=d[y.id]||{};return(E==null?void 0:E.length)===(b==null?void 0:b.length)||(f==null?void 0:f.length)===1?1:t.clusterNodeStrength(y)},others:1,center:y=>{const b=e.getDegree(y.id,"both");if(!b)return{x:100,y:100,z:0};let E;if(b===1){const{sameTypeLeaves:O=[]}=d[y.id]||{};O.length===1?E=void 0:O.length>1&&(E=xb(O))}else E=void 0;return{x:E==null?void 0:E.x,y:E==null?void 0:E.y,z:E==null?void 0:E.z}}})),l&&c){d||(d=bb(e,c)),f||(f=Array.from(new Set(u.map(b=>b.data[c])))),f=f.filter(b=>b!==void 0);const y={};f.forEach(b=>{const E=u.filter(O=>O.data[c]===b).map(O=>e.getNode(O.id));y[b]=xb(E)}),t.centripetalOptions=Object.assign(h,{single:b=>t.clusterNodeStrength(b),leaf:b=>t.clusterNodeStrength(b),others:b=>t.clusterNodeStrength(b),center:b=>{const E=y[b.data[c]];return{x:E==null?void 0:E.x,y:E==null?void 0:E.y,z:E==null?void 0:E.z}}})}const{leaf:v,single:g,others:p}=t.centripetalOptions||{};v&&typeof v!="function"&&(t.centripetalOptions.leaf=()=>v),g&&typeof g!="function"&&(t.centripetalOptions.single=()=>g),p&&typeof p!="function"&&(t.centripetalOptions.others=()=>p)}runOneStep(t,e,r,i,a){const s={},o=t.getAllNodes(),l=t.getAllEdges();if(!(o!=null&&o.length))return;const{monitor:c}=a;if(this.calRepulsive(t,s,a),l&&this.calAttractive(t,s,a),this.calGravity(t,e,s,a),this.updateVelocity(t,s,i,a),c){const u=this.calTotalEnergy(s,o);c({energy:u,nodes:e.getAllNodes(),edges:e.getAllEdges(),iterations:r})}}calTotalEnergy(t,e){if(!(e!=null&&e.length))return 0;let r=0;return e.forEach((i,a)=>{const s=t[i.id].x,o=t[i.id].y,l=this.options.dimensions===3?t[i.id].z:0,c=s*s+o*o+l*l,{mass:u=1}=i.data;r+=u*c*.5}),r}calRepulsive(t,e,r){const{dimensions:i,factor:a,coulombDisScale:s}=r;rL(t,a,s*s,e,i)}calAttractive(t,e,r){const{dimensions:i,nodeSize:a}=r;t.getAllEdges().forEach((s,o)=>{const{source:l,target:c}=s,u=t.getNode(l),h=t.getNode(c);if(!u||!h)return;let d=h.data.x-u.data.x,f=h.data.y-u.data.y,v=i===3?h.data.z-u.data.z:0;!d&&!f&&(d=Math.random()*.01,f=Math.random()*.01,i===3&&!v&&(v=Math.random()*.01));const g=Math.sqrt(d*d+f*f+v*v);if(g<a(u)+a(h))return;const p=d/g,y=f/g,b=v/g,{linkDistance:E=200,edgeStrength:O=200}=s.data||{},L=(E-g)*O,F=u.data.mass||1,I=h.data.mass||1,V=1/F,Y=1/I,J=p*L,$=y*L,ot=b*L;e[l].x-=J*V,e[l].y-=$*V,e[l].z-=ot*V,e[c].x+=J*Y,e[c].y+=$*Y,e[c].z+=ot*Y})}calGravity(t,e,r,i){const{getCenter:a}=i,s=t.getAllNodes(),o=e.getAllNodes(),l=e.getAllEdges(),{width:c,height:u,center:h,gravity:d,centripetalOptions:f}=i;s&&s.forEach(v=>{const{id:g,data:p}=v,{mass:y,x:b,y:E,z:O}=p,P=e.getNode(g);let L=0,F=0,I=0,V=d;const Y=t.getDegree(g,"in"),J=t.getDegree(g,"out"),$=t.getDegree(g,"both"),ot=a==null?void 0:a(P,$);if(ot){const[ct,ft,Nt]=ot;L=b-ct,F=E-ft,V=Nt}else L=b-h[0],F=E-h[1],I=O-h[2];if(V&&(r[g].x-=V*L/y,r[g].y-=V*F/y,r[g].z-=V*I/y),f){const{leaf:ct,single:ft,others:Nt,center:Ot}=f,{x:mt,y:yt,z:Rt,centerStrength:jt}=(Ot==null?void 0:Ot(P,o,l,c,u))||{x:0,y:0,z:0,centerStrength:0};if(!ie(mt)||!ie(yt))return;const Xt=(b-mt)/y,ee=(E-yt)/y,ae=(O-Rt)/y;if(jt&&(r[g].x-=jt*Xt,r[g].y-=jt*ee,r[g].z-=jt*ae),$===0){const ce=ft(P);if(!ce)return;r[g].x-=ce*Xt,r[g].y-=ce*ee,r[g].z-=ce*ae;return}if(Y===0||J===0){const ce=ct(P,o,l);if(!ce)return;r[g].x-=ce*Xt,r[g].y-=ce*ee,r[g].z-=ce*ae;return}const he=Nt(P);if(!he)return;r[g].x-=he*Xt,r[g].y-=he*ee,r[g].z-=he*ae}})}updateVelocity(t,e,r,i){const{damping:a,maxSpeed:s,interval:o,dimensions:l}=i,c=t.getAllNodes();c!=null&&c.length&&c.forEach(u=>{const{id:h}=u;let d=(r[h].x+e[h].x*o)*a||.01,f=(r[h].y+e[h].y*o)*a||.01,v=l===3?(r[h].z+e[h].z*o)*a||.01:0;const g=Math.sqrt(d*d+f*f+v*v);if(g>s){const p=s/g;d=p*d,f=p*f,v=p*v}r[h]={x:d,y:f,z:v}})}updatePosition(t,e,r,i){const{distanceThresholdMode:a,interval:s,dimensions:o}=i,l=e.getAllNodes();if(!(l!=null&&l.length)){this.judgingDistance=0;return}let c=0;a==="max"?this.judgingDistance=-1/0:a==="min"&&(this.judgingDistance=1/0),l.forEach(u=>{const{id:h}=u,d=t.getNode(h);if(ie(d.data.fx)&&ie(d.data.fy)){e.mergeNodeData(h,{x:d.data.fx,y:d.data.fy,z:o===3?d.data.fz:void 0});return}const f=r[h].x*s,v=r[h].y*s,g=o===3?r[h].z*s:0;e.mergeNodeData(h,{x:u.data.x+f,y:u.data.y+v,z:u.data.z+g});const p=Math.sqrt(f*f+v*v+g*g);switch(a){case"max":this.judgingDistance<p&&(this.judgingDistance=p);break;case"min":this.judgingDistance>p&&(this.judgingDistance=p);break;default:c=c+p;break}}),(!a||a==="mean")&&(this.judgingDistance=c/l.length)}}const bb=(n,t)=>{const e=n.getAllNodes();if(!(e!=null&&e.length))return{};const r={};return e.forEach((i,a)=>{n.getDegree(i.id,"both")===1&&(r[i.id]=lL(n,"leaf",i,t))}),r},lL=(n,t,e,r)=>{const i=n.getDegree(e.id,"in"),a=n.getDegree(e.id,"out");let s=e,o=[];i===0?(s=n.getSuccessors(e.id)[0],o=n.getNeighbors(s.id)):a===0&&(s=n.getPredecessors(e.id)[0],o=n.getNeighbors(s.id)),o=o.filter(c=>n.getDegree(c.id,"in")===0||n.getDegree(c.id,"out")===0);const l=cL(n,t,r,e,o);return{coreNode:s,siblingLeaves:o,sameTypeLeaves:l}},cL=(n,t,e,r,i)=>{const a=r.data[e]||"";let s=(i==null?void 0:i.filter(o=>o.data[e]===a))||[];return t==="leaf"&&(s=s.filter(o=>n.getDegree(o.id,"in")===0||n.getDegree(o.id,"out")===0)),s},xb=n=>{const t={x:0,y:0};n.forEach(r=>{const{x:i,y:a}=r.data;t.x+=i||0,t.y+=a||0});const e=n.length||1;return{x:t.x/e,y:t.y/e}},_v=(n,t)=>t.map(e=>{const{id:r,data:i}=e,a=n.getNode(r);return Object.assign(Object.assign({},a),{data:Object.assign(Object.assign({},a.data),{x:i.x,y:i.y,z:i.z})})});var We=S(13377);const d7=We.XA,f7=We.a_,v7=We.yQ,g7=We.Hs,p7=We.Ec,m7=We.dx,y7=We.LU,b7=We.Rm,Ha=We.y3,x7=We.qK,E7=We.pb,w7=We.j,S7=We.sO,M7=We.BZ,A7=We.EK,T7=We.Db,O7=We.Fx,C7=We.tU,N7=We.Ym,k7=We.rs,P7=We.QR,R7=We.TB,L7=We.oH,Eb=We.Sc,_7=We.BN,D7=We.it,I7=We.$r,B7=We.QM,F7=We.AV;var z7=(We.y3,We.y3);const j7=We.GH,Z7=We.SO,W7=We.uZ,G7=We.yU,V7=We.F1,U7=We.re,wb=n=>{const t=[],e=n.length;for(let r=0;r<e;r+=1){t[r]=[];for(let i=0;i<e;i+=1)r===i?t[r][i]=0:n[r][i]===0||!n[r][i]?t[r][i]=1/0:t[r][i]=n[r][i]}for(let r=0;r<e;r+=1)for(let i=0;i<e;i+=1)for(let a=0;a<e;a+=1)t[i][a]>t[i][r]+t[r][a]&&(t[i][a]=t[i][r]+t[r][a]);return t},Sb=(n,t)=>{const{nodes:e,edges:r}=n,i=[],a={};if(!e)throw new Error("invalid nodes data!");return e&&e.forEach((s,o)=>{a[s.id]=o;const l=[];i.push(l)}),r==null||r.forEach(s=>{const{source:o,target:l}=s,c=a[o],u=a[l];c===void 0||u===void 0||(i[c][u]=1,t||(i[u][c]=1))}),i},uL=(n,t)=>{const e=[];return n.forEach(r=>{const i=[];r.forEach(a=>{i.push(a*t)}),e.push(i)}),e},hL=n=>{let t=1/0,e=1/0,r=-1/0,i=-1/0;return n.forEach(a=>{let s=a.data.size;xa(s)?s.length===1&&(s=[s[0],s[0]]):ie(s)?s=[s,s]:(s===void 0||isNaN(s))&&(s=[30,30]);const o=[s[0]/2,s[1]/2],l=a.data.x-o[0],c=a.data.x+o[0],u=a.data.y-o[1],h=a.data.y+o[1];t>l&&(t=l),e>u&&(e=u),r<c&&(r=c),i<h&&(i=h)}),{minX:t,minY:e,maxX:r,maxY:i}},Mb=(n,t)=>Math.sqrt((n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y)),Dv=(n,t,e,r="TB",i,a={})=>{if(!(t!=null&&t.length))return;const{stopBranchFn:s,stopAllFn:o}=a;for(let l=0;l<t.length;l++){const c=t[l];if(n.hasNode(c.id)&&!(s!=null&&s(c))){if(o!=null&&o(c))return;r==="TB"&&e(c),Dv(n,n.getChildren(c.id,i),e,r,i,a),r!=="TB"&&e(c)}}},dL={center:[0,0],linkDistance:50};class Ab{constructor(t={}){this.options=t,this.id="mds",this.options=Object.assign(Object.assign({},dL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericMDSLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericMDSLayout(!0,t,e)})}genericMDSLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),r),{center:a=[0,0],linkDistance:s=50}=i,o=e.getAllNodes(),l=e.getAllEdges();if(!(o!=null&&o.length)||o.length===1)return Zs(e,t,a);const c=Sb({nodes:o,edges:l},!1),u=wb(c);fL(u);const h=uL(u,s),d=vL(h),f=[];return d.forEach((g,p)=>{const y=li(o[p]);y.data.x=g[0]+a[0],y.data.y=g[1]+a[1],f.push(y)}),t&&f.forEach(g=>e.mergeNodeData(g.id,{x:g.data.x,y:g.data.y})),{nodes:f,edges:l}})}}const fL=n=>{let t=-999999;n.forEach(e=>{e.forEach(r=>{r!==1/0&&t<r&&(t=r)})}),n.forEach((e,r)=>{e.forEach((i,a)=>{i===1/0&&(n[r][a]=t)})})},vL=n=>{const e=Ha.mul(Ha.pow(n,2),-.5),r=e.mean("row"),i=e.mean("column"),a=e.mean();e.add(a).subRowVector(r).subColumnVector(i);const s=new Eb(e),o=Ha.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map(l=>Ha.mul([l],[o]).toJSON()[0].splice(0,2))};function Iv(n){return!!n.tick&&!!n.stop}const gL={gForce:!0,force2:!0,d3force:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},pL={center:[0,0],comboPadding:10,treeKey:"combo"};class mL{constructor(t={}){this.options=t,this.id="comboCombined",this.options=Object.assign(Object.assign({},pL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericComboCombinedLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericComboCombinedLayout(!0,t,e)})}genericComboCombinedLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const i=this.initVals(Object.assign(Object.assign({},this.options),r)),{center:a,treeKey:s,outerLayout:o}=i,l=e.getAllNodes().filter(I=>!I.data._isCombo),c=e.getAllNodes().filter(I=>I.data._isCombo),u=e.getAllEdges(),h=l==null?void 0:l.length;if(!h||h===1)return Zs(e,t,a);const d=[],f=new Map;l.forEach(I=>{f.set(I.id,I)});const v=new Map;c.forEach(I=>{v.set(I.id,I)});const g=new Map,p=this.getInnerGraphs(e,s,f,v,u,i,g);yield Promise.all(p);const y=new Map,b=[],E=new Map;let O=!0;e.getRoots(s).forEach(I=>{const V=g.get(I.id),Y=v.get(I.id)||f.get(I.id),J={id:I.id,data:Object.assign(Object.assign({},I.data),{x:V.data.x||Y.data.x,y:V.data.y||Y.data.y,fx:V.data.fx||Y.data.fx,fy:V.data.fy||Y.data.fy,mass:V.data.mass||Y.data.mass,size:V.data.size})};b.push(J),y.set(I.id,!0),!isNaN(J.data.x)&&J.data.x!==0&&!isNaN(J.data.y)&&J.data.y!==0?O=!1:(J.data.x=Math.random()*100,J.data.y=Math.random()*100),Dv(e,[I],$=>{$.id!==I.id&&E.set($.id,I.id)},"TB",s)});const P=[];u.forEach(I=>{const V=E.get(I.source)||I.source,Y=E.get(I.target)||I.target;V!==Y&&y.has(V)&&y.has(Y)&&P.push({id:I.id,source:V,target:Y,data:{}})});let L;if(b!=null&&b.length){if(b.length===1)b[0].data.x=a[0],b[0].data.y=a[1];else{const I=new Vn({nodes:b,edges:P}),V=o||new yb;O&&gL[V.id]&&(yield(b.length<100?new Ab:new Pv).assign(I));const Y=Object.assign({center:a,kg:5,preventOverlap:!0,animate:!1},V.id==="force"?{gravity:1,factor:4,linkDistance:(J,$,ot)=>{const ct=Math.max(...$.data.size)||32,ft=Math.max(...ot.data.size)||32;return ct/2+ft/2+200}}:{});L=yield Tb(V,I,Y)}g.forEach(I=>{var V;const Y=L.nodes.find(ot=>ot.id===I.id);if(Y){const{x:ot,y:ct}=Y.data;I.data.visited=!0,I.data.x=ot,I.data.y=ct,d.push({id:I.id,data:{x:ot,y:ct}})}const{x:J,y:$}=I.data;(V=I.data.nodes)===null||V===void 0||V.forEach(ot=>{d.push({id:ot.id,data:{x:ot.data.x+J,y:ot.data.y+$}})})}),g.forEach(({data:I})=>{const{x:V,y:Y,visited:J,nodes:$}=I;$==null||$.forEach(ot=>{if(!J){const ct=d.find(ft=>ft.id===ot.id);ct.data.x+=V||0,ct.data.y+=Y||0}})})}return t&&d.forEach(I=>{e.mergeNodeData(I.id,{x:I.data.x,y:I.data.y})}),{nodes:d,edges:u}})}initVals(t){const e=Object.assign({},t),{nodeSize:r,spacing:i,comboPadding:a}=t;let s,o;if(ie(i)?o=()=>i:fe(i)?o=i:o=()=>0,e.spacing=o,!r)s=c=>{const u=o(c);return c.size?xa(c.size)?((c.size[0]>c.size[1]?c.size[0]:c.size[1])+u)/2:Fn(c.size)?((c.size.width>c.size.height?c.size.width:c.size.height)+u)/2:(c.size+u)/2:32+u/2};else if(fe(r))s=c=>{const u=r(c),h=o(c);return xa(c.size)?((c.size[0]>c.size[1]?c.size[0]:c.size[1])+h)/2:((u||32)+h)/2};else if(xa(r)){const u=(r[0]>r[1]?r[0]:r[1])/2;s=h=>u+o(h)/2}else{const c=r/2;s=u=>c+o(u)/2}e.nodeSize=s;let l;return ie(a)?l=()=>a:xa(a)?l=()=>Math.max.apply(null,a):fe(a)?l=a:l=()=>0,e.comboPadding=l,e}getInnerGraphs(t,e,r,i,a,s,o){const{nodeSize:l,comboPadding:c,spacing:u,innerLayout:h}=s,d=h||new Pv({}),f={center:[0,0],preventOverlap:!0,nodeSpacing:u},v=[],g=p=>{let y=(c==null?void 0:c(p))||10;return xa(y)&&(y=Math.max(...y)),{size:y?[y*2,y*2]:[30,30],padding:y}};return t.getRoots(e).forEach(p=>{o.set(p.id,{id:p.id,data:{nodes:[],size:g(p).size}});let y=Promise.resolve();Dv(t,[p],b=>{var E;if(!b.data._isCombo)return;const{size:O,padding:P}=g(b);if(!(!((E=t.getChildren(b.id,e))===null||E===void 0)&&E.length))o.set(b.id,{id:b.id,data:Object.assign(Object.assign({},b.data),{size:O})});else{const L=o.get(b.id);o.set(b.id,{id:b.id,data:Object.assign({nodes:[]},L==null?void 0:L.data)});const F=new Map,I=t.getChildren(b.id,e).map(J=>{if(J.data._isCombo)return o.has(J.id)||o.set(J.id,{id:J.id,data:Object.assign({},J.data)}),F.set(J.id,!0),o.get(J.id);const $=r.get(J.id)||i.get(J.id);return F.set(J.id,!0),{id:J.id,data:Object.assign(Object.assign({},$.data),J.data)}}),V={nodes:I,edges:a.filter(J=>F.has(J.source)&&F.has(J.target))};let Y=1/0;I.forEach(J=>{var $;let{size:ot}=J.data;ot||(ot=(($=o.get(J.id))===null||$===void 0?void 0:$.data.size)||(l==null?void 0:l(J))||[30,30]),ie(ot)&&(ot=[ot,ot]);const[ct,ft]=ot;Y>ct&&(Y=ct),Y>ft&&(Y=ft),J.data.size=ot}),y=y.then(()=>(0,G.mG)(this,void 0,void 0,function*(){const J=new Vn(V);yield Tb(d,J,f,!0);const{minX:$,minY:ot,maxX:ct,maxY:ft}=hL(I),Nt={x:(ct+$)/2,y:(ft+ot)/2};V.nodes.forEach(mt=>{mt.data.x-=Nt.x,mt.data.y-=Nt.y});const Ot=[Math.max(ct-$,Y)+P*2,Math.max(ft-ot,Y)+P*2];o.get(b.id).data.size=Ot,o.get(b.id).data.nodes=I}))}return!0},"BT",e),v.push(y)}),v}}function Tb(n,t,e,r){var i;return(0,G.mG)(this,void 0,void 0,function*(){return Iv(n)?(n.execute(t,e),n.stop(),n.tick((i=e.iterations)!==null&&i!==void 0?i:300)):r?yield n.assign(t,e):yield n.execute(t,e)})}function ar(n){return function(){return n}}function Xa(n){return(n()-.5)*1e-6}function yL(n){return n.index}function Ob(n,t){var e=n.get(t);if(!e)throw new Error("node not found: "+t);return e}function bL(n){var t=yL,e=h,r,i=ar(30),a,s,o,l,c,u=1;n==null&&(n=[]);function h(p){return 1/Math.min(o[p.source.index],o[p.target.index])}function d(p){for(var y=0,b=n.length;y<u;++y)for(var E=0,O,P,L,F,I,V,Y;E<b;++E)O=n[E],P=O.source,L=O.target,F=L.x+L.vx-P.x-P.vx||Xa(c),I=L.y+L.vy-P.y-P.vy||Xa(c),V=Math.sqrt(F*F+I*I),V=(V-a[E])/V*p*r[E],F*=V,I*=V,L.vx-=F*(Y=l[E]),L.vy-=I*Y,P.vx+=F*(Y=1-Y),P.vy+=I*Y}function f(){if(s){var p,y=s.length,b=n.length,E=new Map(s.map((P,L)=>[t(P,L,s),P])),O;for(p=0,o=new Array(y);p<b;++p)O=n[p],O.index=p,typeof O.source!="object"&&(O.source=Ob(E,O.source)),typeof O.target!="object"&&(O.target=Ob(E,O.target)),o[O.source.index]=(o[O.source.index]||0)+1,o[O.target.index]=(o[O.target.index]||0)+1;for(p=0,l=new Array(b);p<b;++p)O=n[p],l[p]=o[O.source.index]/(o[O.source.index]+o[O.target.index]);r=new Array(b),v(),a=new Array(b),g()}}function v(){if(s)for(var p=0,y=n.length;p<y;++p)r[p]=+e(n[p],p,n)}function g(){if(s)for(var p=0,y=n.length;p<y;++p)a[p]=+i(n[p],p,n)}return d.initialize=function(p,y){s=p,c=y,f()},d.links=function(p){return arguments.length?(n=p,f(),d):n},d.id=function(p){return arguments.length?(t=p,d):t},d.iterations=function(p){return arguments.length?(u=+p,d):u},d.strength=function(p){return arguments.length?(e=typeof p=="function"?p:ar(+p),v(),d):e},d.distance=function(p){return arguments.length?(i=typeof p=="function"?p:ar(+p),g(),d):i},d}var xL=S(30168),EL=S(83833);const wL=1664525,SL=1013904223,Cb=4294967296;function ML(){let n=1;return()=>(n=(wL*n+SL)%Cb)/Cb}function AL(n){return n.x}function TL(n){return n.y}var OL=10,CL=Math.PI*(3-Math.sqrt(5));function NL(n){var t,e=1,r=.001,i=1-Math.pow(r,1/300),a=0,s=.6,o=new Map,l=(0,EL.HT)(h),c=(0,xL.Z)("tick","end"),u=ML();n==null&&(n=[]);function h(){d(),c.call("tick",t),e<r&&(l.stop(),c.call("end",t))}function d(g){var p,y=n.length,b;g===void 0&&(g=1);for(var E=0;E<g;++E)for(e+=(a-e)*i,o.forEach(function(O){O(e)}),p=0;p<y;++p)b=n[p],b.fx==null?b.x+=b.vx*=s:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=s:(b.y=b.fy,b.vy=0);return t}function f(){for(var g=0,p=n.length,y;g<p;++g){if(y=n[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=OL*Math.sqrt(.5+g),E=g*CL;y.x=b*Math.cos(E),y.y=b*Math.sin(E)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function v(g){return g.initialize&&g.initialize(n,u),g}return f(),t={tick:d,restart:function(){return l.restart(h),t},stop:function(){return l.stop(),t},nodes:function(g){return arguments.length?(n=g,f(),o.forEach(v),t):n},alpha:function(g){return arguments.length?(e=+g,t):e},alphaMin:function(g){return arguments.length?(r=+g,t):r},alphaDecay:function(g){return arguments.length?(i=+g,t):+i},alphaTarget:function(g){return arguments.length?(a=+g,t):a},velocityDecay:function(g){return arguments.length?(s=1-g,t):1-s},randomSource:function(g){return arguments.length?(u=g,o.forEach(v),t):u},force:function(g,p){return arguments.length>1?(p==null?o.delete(g):o.set(g,v(p)),t):o.get(g)},find:function(g,p,y){var b=0,E=n.length,O,P,L,F,I;for(y==null?y=1/0:y*=y,b=0;b<E;++b)F=n[b],O=g-F.x,P=p-F.y,L=O*O+P*P,L<y&&(I=F,y=L);return I},on:function(g,p){return arguments.length>1?(c.on(g,p),t):c.on(g)}}}function kL(){var n,t,e,r,i=ar(-30),a,s=1,o=1/0,l=.81;function c(f){var v,g=n.length,p=(0,Rv.Z)(n,AL,TL).visitAfter(h);for(r=f,v=0;v<g;++v)t=n[v],p.visit(d)}function u(){if(n){var f,v=n.length,g;for(a=new Array(v),f=0;f<v;++f)g=n[f],a[g.index]=+i(g,f,n)}}function h(f){var v=0,g,p,y=0,b,E,O;if(f.length){for(b=E=O=0;O<4;++O)(g=f[O])&&(p=Math.abs(g.value))&&(v+=g.value,y+=p,b+=p*g.x,E+=p*g.y);f.x=b/y,f.y=E/y}else{g=f,g.x=g.data.x,g.y=g.data.y;do v+=a[g.data.index];while(g=g.next)}f.value=v}function d(f,v,g,p){if(!f.value)return!0;var y=f.x-t.x,b=f.y-t.y,E=p-v,O=y*y+b*b;if(E*E/l<O)return O<o&&(y===0&&(y=Xa(e),O+=y*y),b===0&&(b=Xa(e),O+=b*b),O<s&&(O=Math.sqrt(s*O)),t.vx+=y*f.value*r/O,t.vy+=b*f.value*r/O),!0;if(f.length||O>=o)return;(f.data!==t||f.next)&&(y===0&&(y=Xa(e),O+=y*y),b===0&&(b=Xa(e),O+=b*b),O<s&&(O=Math.sqrt(s*O)));do f.data!==t&&(E=a[f.data.index]*r/O,t.vx+=y*E,t.vy+=b*E);while(f=f.next)}return c.initialize=function(f,v){n=f,e=v,u()},c.strength=function(f){return arguments.length?(i=typeof f=="function"?f:ar(+f),u(),c):i},c.distanceMin=function(f){return arguments.length?(s=f*f,c):Math.sqrt(s)},c.distanceMax=function(f){return arguments.length?(o=f*f,c):Math.sqrt(o)},c.theta=function(f){return arguments.length?(l=f*f,c):Math.sqrt(l)},c}function PL(n,t){var e,r=1;n==null&&(n=0),t==null&&(t=0);function i(){var a,s=e.length,o,l=0,c=0;for(a=0;a<s;++a)o=e[a],l+=o.x,c+=o.y;for(l=(l/s-n)*r,c=(c/s-t)*r,a=0;a<s;++a)o=e[a],o.x-=l,o.y-=c}return i.initialize=function(a){e=a},i.x=function(a){return arguments.length?(n=+a,i):n},i.y=function(a){return arguments.length?(t=+a,i):t},i.strength=function(a){return arguments.length?(r=+a,i):r},i}function RL(n){return n.x+n.vx}function LL(n){return n.y+n.vy}function _L(n){var t,e,r,i=1,a=1;typeof n!="function"&&(n=ar(n==null?1:+n));function s(){for(var c,u=t.length,h,d,f,v,g,p,y=0;y<a;++y)for(h=(0,Rv.Z)(t,RL,LL).visitAfter(o),c=0;c<u;++c)d=t[c],g=e[d.index],p=g*g,f=d.x+d.vx,v=d.y+d.vy,h.visit(b);function b(E,O,P,L,F){var I=E.data,V=E.r,Y=g+V;if(I){if(I.index>d.index){var J=f-I.x-I.vx,$=v-I.y-I.vy,ot=J*J+$*$;ot<Y*Y&&(J===0&&(J=Xa(r),ot+=J*J),$===0&&($=Xa(r),ot+=$*$),ot=(Y-(ot=Math.sqrt(ot)))/ot*i,d.vx+=(J*=ot)*(Y=(V*=V)/(p+V)),d.vy+=($*=ot)*Y,I.vx-=J*(Y=1-Y),I.vy-=$*Y)}return}return O>f+Y||L<f-Y||P>v+Y||F<v-Y}}function o(c){if(c.data)return c.r=e[c.data.index];for(var u=c.r=0;u<4;++u)c[u]&&c[u].r>c.r&&(c.r=c[u].r)}function l(){if(t){var c,u=t.length,h;for(e=new Array(u),c=0;c<u;++c)h=t[c],e[h.index]=+n(h,c,t)}}return s.initialize=function(c,u){t=c,r=u,l()},s.iterations=function(c){return arguments.length?(a=+c,s):a},s.strength=function(c){return arguments.length?(i=+c,s):i},s.radius=function(c){return arguments.length?(n=typeof c=="function"?c:ar(+c),l(),s):n},s}function DL(n,t,e){var r,i=ar(.1),a,s;typeof n!="function"&&(n=ar(+n)),t==null&&(t=0),e==null&&(e=0);function o(c){for(var u=0,h=r.length;u<h;++u){var d=r[u],f=d.x-t||1e-6,v=d.y-e||1e-6,g=Math.sqrt(f*f+v*v),p=(s[u]-g)*a[u]*c/g;d.vx+=f*p,d.vy+=v*p}}function l(){if(r){var c,u=r.length;for(a=new Array(u),s=new Array(u),c=0;c<u;++c)s[c]=+n(r[c],c,r),a[c]=isNaN(s[c])?0:+i(r[c],c,r)}}return o.initialize=function(c){r=c,l()},o.strength=function(c){return arguments.length?(i=typeof c=="function"?c:ar(+c),l(),o):i},o.radius=function(c){return arguments.length?(n=typeof c=="function"?c:ar(+c),l(),o):n},o.x=function(c){return arguments.length?(t=+c,o):t},o.y=function(c){return arguments.length?(e=+c,o):e},o}function IL(n){var t=ar(.1),e,r,i;typeof n!="function"&&(n=ar(n==null?0:+n));function a(o){for(var l=0,c=e.length,u;l<c;++l)u=e[l],u.vx+=(i[l]-u.x)*r[l]*o}function s(){if(e){var o,l=e.length;for(r=new Array(l),i=new Array(l),o=0;o<l;++o)r[o]=isNaN(i[o]=+n(e[o],o,e))?0:+t(e[o],o,e)}}return a.initialize=function(o){e=o,s()},a.strength=function(o){return arguments.length?(t=typeof o=="function"?o:ar(+o),s(),a):t},a.x=function(o){return arguments.length?(n=typeof o=="function"?o:ar(+o),s(),a):n},a}function BL(n){var t=ar(.1),e,r,i;typeof n!="function"&&(n=ar(n==null?0:+n));function a(o){for(var l=0,c=e.length,u;l<c;++l)u=e[l],u.vy+=(i[l]-u.y)*r[l]*o}function s(){if(e){var o,l=e.length;for(r=new Array(l),i=new Array(l),o=0;o<l;++o)r[o]=isNaN(i[o]=+n(e[o],o,e))?0:+t(e[o],o,e)}}return a.initialize=function(o){e=o,s()},a.strength=function(o){return arguments.length?(t=typeof o=="function"?o:ar(+o),s(),a):t},a.y=function(o){return arguments.length?(n=typeof o=="function"?o:ar(+o),s(),a):n},a}class FL{constructor(t){this.id="d3-force",this.config={inputNodeAttrs:["x","y","vx","vy","fx","fy"],outputNodeAttrs:["x","y","vx","vy"],simulationAttrs:["alpha","alphaMin","alphaDecay","alphaTarget","velocityDecay","randomSource"]},this.forceMap={link:bL,manyBody:kL,center:PL,collide:_L,radial:DL,x:IL,y:BL},this.options={link:{id:e=>e.id},manyBody:{},center:{x:0,y:0}},this.context={options:{},assign:!1,nodes:[],edges:[]},pr(this.options,t),this.options.forceSimulation&&(this.simulation=this.options.forceSimulation)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericLayout(!0,t,e)})}stop(){this.simulation.stop()}tick(t){return this.simulation.tick(t),this.getResult()}restart(){this.simulation.restart()}setFixedPosition(t,e){const r=this.context.nodes.find(i=>i.id===t);r&&e.forEach((i,a)=>{if(typeof i=="number"||i===null){const s=["fx","fy","fz"][a];r[s]=i}})}getOptions(t){var e,r;const i=pr({},this.options,t);return i.collide&&((e=i.collide)===null||e===void 0?void 0:e.radius)===void 0&&(i.collide=i.collide||{},i.collide.radius=(r=i.nodeSize)!==null&&r!==void 0?r:10),i.iterations===void 0&&(i.link&&i.link.iterations===void 0&&(i.iterations=i.link.iterations),i.collide&&i.collide.iterations===void 0&&(i.iterations=i.collide.iterations)),this.context.options=i,i}genericLayout(t,e,r){var i;return(0,G.mG)(this,void 0,void 0,function*(){const a=this.getOptions(r),s=e.getAllNodes().map(({id:u,data:h})=>Object.assign(Object.assign({id:u},h),Bs(h.data,this.config.inputNodeAttrs))),o=e.getAllEdges().map(u=>Object.assign({},u));Object.assign(this.context,{assign:t,nodes:s,edges:o,graph:e});const l=new Promise(u=>{this.resolver=u}),c=this.setSimulation(a);return c.nodes(s),(i=c.force("link"))===null||i===void 0||i.links(o),l})}getResult(){const{assign:t,nodes:e,edges:r,graph:i}=this.context,a=e.map(o=>({id:o.id,data:Object.assign(Object.assign({},o.data),Bs(o,this.config.outputNodeAttrs))})),s=r.map(({id:o,source:l,target:c,data:u})=>({id:o,source:typeof l=="object"?l.id:l,target:typeof c=="object"?c.id:c,data:u}));return t&&a.forEach(o=>i.mergeNodeData(o.id,o.data)),{nodes:a,edges:s}}initSimulation(){return NL()}setSimulation(t){const e=this.simulation||this.options.forceSimulation||this.initSimulation();return this.simulation||(this.simulation=e.on("tick",()=>{var r;return(r=t.onTick)===null||r===void 0?void 0:r.call(t,this.getResult())}).on("end",()=>{var r;return(r=this.resolver)===null||r===void 0?void 0:r.call(this,this.getResult())})),Nb(e,this.config.simulationAttrs.map(r=>[r,t[r]])),Object.entries(this.forceMap).forEach(([r,i])=>{const a=r;if(t[r]){let s=e.force(a);s||(s=i(),e.force(a,s)),Nb(s,Object.entries(t[a]))}else e.force(a,null)}),e}}const Nb=(n,t)=>t.reduce((e,[r,i])=>!e[r]||i===void 0?e:e[r].call(n,i),n);var kb=S(92546),zL=S.n(kb);class nh{constructor(t){this.id="dagre",this.options={},Object.assign(this.options,nh.defaultOptions,t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,t,Object.assign(Object.assign({},this.options),e))})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,t,Object.assign(Object.assign({},this.options),e))})}genericDagreLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const{nodeSize:i}=r,a=new kb.graphlib.Graph;a.setGraph(r),a.setDefaultEdgeLabel(()=>({}));const s=e.getAllNodes(),o=e.getAllEdges();[...s,...o].some(({id:c})=>ie(c))&&console.error("Dagre layout only support string id, it will convert number to string."),e.getAllNodes().forEach(c=>{const{id:u}=c,h=Object.assign({},c.data);if(i!==void 0){const[d,f]=Pl(fe(i)?i(c):i);Object.assign(h,{width:d,height:f})}a.setNode(u.toString(),h)}),e.getAllEdges().forEach(({id:c,source:u,target:h})=>{a.setEdge(u.toString(),h.toString(),{id:c})}),zL().layout(a);const l={nodes:[],edges:[]};return a.nodes().forEach(c=>{const u=a.node(c);l.nodes.push({id:c,data:u}),t&&e.mergeNodeData(c,u)}),a.edges().forEach(c=>{const u=a.edge(c),{id:h}=u,d=(0,G._T)(u,["id"]),{v:f,w:v}=c;l.edges.push({id:h,source:f,target:v,data:d}),t&&e.mergeEdgeData(h,d)}),l})}}nh.defaultOptions={};class Bv{constructor(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}distanceTo(t){const e=this.rx-t.rx,r=this.ry-t.ry;return Math.hypot(e,r)}setPos(t,e){this.rx=t,this.ry=e}resetForce(){this.fx=0,this.fy=0}addForce(t){const e=t.rx-this.rx,r=t.ry-this.ry;let i=Math.hypot(e,r);i=i<1e-4?1e-4:i;const a=this.g*(this.degree+1)*(t.degree+1)/i;this.fx+=a*e/i,this.fy+=a*r/i}in(t){return t.contains(this.rx,this.ry)}add(t){const e=this.mass+t.mass,r=(this.rx*this.mass+t.rx*t.mass)/e,i=(this.ry*this.mass+t.ry*t.mass)/e,a=this.degree+t.degree,s={rx:r,ry:i,mass:e,degree:a};return new Bv(s)}}class xo{constructor(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}getLength(){return this.length}contains(t,e){const r=this.length/2;return t<=this.xmid+r&&t>=this.xmid-r&&e<=this.ymid+r&&e>=this.ymid-r}NW(){const t=this.xmid-this.length/4,e=this.ymid+this.length/4,r=this.length/2,i={xmid:t,ymid:e,length:r};return new xo(i)}NE(){const t=this.xmid+this.length/4,e=this.ymid+this.length/4,r=this.length/2,i={xmid:t,ymid:e,length:r};return new xo(i)}SW(){const t=this.xmid-this.length/4,e=this.ymid-this.length/4,r=this.length/2,i={xmid:t,ymid:e,length:r};return new xo(i)}SE(){const t=this.xmid+this.length/4,e=this.ymid-this.length/4,r=this.length/2,i={xmid:t,ymid:e,length:r};return new xo(i)}}class Eo{constructor(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,t!=null&&(this.quad=t)}insert(t){if(this.body==null){this.body=t;return}this._isExternal()?(this.quad&&(this.NW=new Eo(this.quad.NW()),this.NE=new Eo(this.quad.NE()),this.SW=new Eo(this.quad.SW()),this.SE=new Eo(this.quad.SE())),this._putBody(this.body),this._putBody(t),this.body=this.body.add(t)):(this.body=this.body.add(t),this._putBody(t))}_putBody(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))}_isExternal(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null}updateForce(t){if(!(this.body==null||t===this.body))if(this._isExternal())t.addForce(this.body);else{const e=this.quad?this.quad.getLength():0,r=this.body.distanceTo(t);e/r<this.theta?t.addForce(this.body):(this.NW&&this.NW.updateForce(t),this.NE&&this.NE.updateForce(t),this.SW&&this.SW.updateForce(t),this.SE&&this.SE.updateForce(t))}}}const jL={center:[0,0],width:300,height:300,kr:5,kg:1,mode:"normal",preventOverlap:!1,dissuadeHubs:!1,maxIteration:0,ks:.1,ksmax:10,tao:.1};class ZL{constructor(t={}){this.options=t,this.id="forceAtlas2",this.options=Object.assign(Object.assign({},jL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericForceAtlas2Layout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericForceAtlas2Layout(!0,t,e)})}genericForceAtlas2Layout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const i=e.getAllEdges(),a=e.getAllNodes(),s=this.formatOptions(r,a.length),{width:o,height:l,prune:c,maxIteration:u,nodeSize:h,center:d}=s;if(!(a!=null&&a.length)||a.length===1)return Zs(e,t,d);const f=a.map(y=>li(y,[o,l])),v=i.filter(y=>{const{source:b,target:E}=y;return b!==E}),g=new Vn({nodes:f,edges:v}),p=this.getSizes(g,h);if(this.run(g,e,u,p,t,s),c){for(let b=0;b<v.length;b+=1){const{source:E,target:O}=v[b],P=g.getDegree(E),L=g.getDegree(E);if(P<=1){const F=g.getNode(O);g.mergeNodeData(E,{x:F.data.x,y:F.data.y})}else if(L<=1){const F=g.getNode(E);g.mergeNodeData(O,{x:F.data.x,y:F.data.y})}}const y=Object.assign(Object.assign({},s),{prune:!1,barnesHut:!1});this.run(g,e,100,p,t,y)}return{nodes:f,edges:i}})}getSizes(t,e){const r=t.getAllNodes(),i={};for(let a=0;a<r.length;a+=1){const s=r[a];i[s.id]=Nv(e,void 0)(s)}return i}formatOptions(t={},e){const r=Object.assign(Object.assign({},this.options),t),{center:i,width:a,height:s,barnesHut:o,prune:l,maxIteration:c,kr:u,kg:h}=r;return r.width=!a&&typeof window!="undefined"?window.innerWidth:a,r.height=!s&&typeof window!="undefined"?window.innerHeight:s,r.center=i||[r.width/2,r.height/2],o===void 0&&e>250&&(r.barnesHut=!0),l===void 0&&e>100&&(r.prune=!0),c===0&&!l?(r.maxIteration=250,e<=200&&e>100?r.maxIteration=1e3:e>200&&(r.maxIteration=1200)):c===0&&l&&(r.maxIteration=100,e<=200&&e>100?r.maxIteration=500:e>200&&(r.maxIteration=950)),u||(r.kr=50,e>100&&e<=500?r.kr=20:e>500&&(r.kr=1)),h||(r.kg=20,e>100&&e<=500?r.kg=10:e>500&&(r.kg=1)),r}run(t,e,r,i,a,s){const{kr:o,barnesHut:l,onTick:c}=s,u=t.getAllNodes();let h=0,d=r;const f={},v={},g={};for(let p=0;p<u.length;p+=1){const{data:y,id:b}=u[p];if(f[b]=[0,0],l){const E={id:p,rx:y.x,ry:y.y,mass:1,g:o,degree:t.getDegree(b)};g[b]=new Bv(E)}}for(;d>0;)h=this.oneStep(t,{iter:d,preventOverlapIters:50,krPrime:100,sg:h,forces:f,preForces:v,bodies:g,sizes:i},s),d--,c==null||c({nodes:u,edges:e.getAllEdges()});return t}oneStep(t,e,r){const{iter:i,preventOverlapIters:a,krPrime:s,sg:o,preForces:l,bodies:c,sizes:u}=e;let{forces:h}=e;const{preventOverlap:d,barnesHut:f}=r,v=t.getAllNodes();for(let g=0;g<v.length;g+=1){const{id:p}=v[g];l[p]=[...h[p]],h[p]=[0,0]}return h=this.getAttrForces(t,i,a,u,h,r),f&&(d&&i>a||!d)?h=this.getOptRepGraForces(t,h,c,r):h=this.getRepGraForces(t,i,a,h,s,u,r),this.updatePos(t,h,l,o,r)}getAttrForces(t,e,r,i,a,s){const{preventOverlap:o,dissuadeHubs:l,mode:c,prune:u}=s,h=t.getAllEdges();for(let d=0;d<h.length;d+=1){const{source:f,target:v}=h[d],g=t.getNode(f),p=t.getNode(v),y=t.getDegree(f),b=t.getDegree(v);if(u&&(y<=1||b<=1))continue;const E=[p.data.x-g.data.x,p.data.y-g.data.y];let O=Math.hypot(E[0],E[1]);O=O<1e-4?1e-4:O,E[0]=E[0]/O,E[1]=E[1]/O,o&&e<r&&(O=O-i[f]-i[v]);let P=O,L=P;c==="linlog"&&(P=Math.log(1+O),L=P),l&&(P=O/y,L=O/b),o&&e<r&&O<=0?(P=0,L=0):o&&e<r&&O>0&&(P=O,L=O),a[f][0]+=P*E[0],a[v][0]-=L*E[0],a[f][1]+=P*E[1],a[v][1]-=L*E[1]}return a}getOptRepGraForces(t,e,r,i){const{kg:a,center:s,prune:o}=i,l=t.getAllNodes(),c=l.length;let u=9e10,h=-9e10,d=9e10,f=-9e10;for(let b=0;b<c;b+=1){const{id:E,data:O}=l[b];o&&t.getDegree(E)<=1||(r[E].setPos(O.x,O.y),O.x>=h&&(h=O.x),O.x<=u&&(u=O.x),O.y>=f&&(f=O.y),O.y<=d&&(d=O.y))}const v=Math.max(h-u,f-d),g={xmid:(h+u)/2,ymid:(f+d)/2,length:v,massCenter:s,mass:c},p=new xo(g),y=new Eo(p);for(let b=0;b<c;b+=1){const{id:E}=l[b];o&&t.getDegree(E)<=1||r[E].in(p)&&y.insert(r[E])}for(let b=0;b<c;b+=1){const{id:E,data:O}=l[b],P=t.getDegree(E);if(o&&P<=1)continue;r[E].resetForce(),y.updateForce(r[E]),e[E][0]-=r[E].fx,e[E][1]-=r[E].fy;const L=[O.x-s[0],O.y-s[1]];let F=Math.hypot(L[0],L[1]);F=F<1e-4?1e-4:F,L[0]=L[0]/F,L[1]=L[1]/F;const I=a*(P+1);e[E][0]-=I*L[0],e[E][1]-=I*L[1]}return e}getRepGraForces(t,e,r,i,a,s,o){const{preventOverlap:l,kr:c,kg:u,center:h,prune:d}=o,f=t.getAllNodes(),v=f.length;for(let g=0;g<v;g+=1){const p=f[g],y=t.getDegree(p.id);for(let P=g+1;P<v;P+=1){const L=f[P],F=t.getDegree(L.id);if(d&&(y<=1||F<=1))continue;const I=[L.data.x-p.data.x,L.data.y-p.data.y];let V=Math.hypot(I[0],I[1]);V=V<1e-4?1e-4:V,I[0]=I[0]/V,I[1]=I[1]/V,l&&e<r&&(V=V-s[p.id]-s[L.id]);let Y=c*(y+1)*(F+1)/V;l&&e<r&&V<0?Y=a*(y+1)*(F+1):l&&e<r&&V===0?Y=0:l&&e<r&&V>0&&(Y=c*(y+1)*(F+1)/V),i[p.id][0]-=Y*I[0],i[L.id][0]+=Y*I[0],i[p.id][1]-=Y*I[1],i[L.id][1]+=Y*I[1]}const b=[p.data.x-h[0],p.data.y-h[1]],E=Math.hypot(b[0],b[1]);b[0]=b[0]/E,b[1]=b[1]/E;const O=u*(y+1);i[p.id][0]-=O*b[0],i[p.id][1]-=O*b[1]}return i}updatePos(t,e,r,i,a){const{ks:s,tao:o,prune:l,ksmax:c}=a,u=t.getAllNodes(),h=u.length,d=[],f=[];let v=0,g=0,p=i;for(let b=0;b<h;b+=1){const{id:E}=u[b],O=t.getDegree(E);if(l&&O<=1)continue;const P=[e[E][0]-r[E][0],e[E][1]-r[E][1]],L=Math.hypot(P[0],P[1]),F=[e[E][0]+r[E][0],e[E][1]+r[E][1]],I=Math.hypot(F[0],F[1]);d[b]=L,f[b]=I/2,v+=(O+1)*d[b],g+=(O+1)*f[b]}const y=p;p=o*g/v,y!==0&&(p=p>1.5*y?1.5*y:p);for(let b=0;b<h;b+=1){const{id:E,data:O}=u[b],P=t.getDegree(E);if(l&&P<=1||ie(O.fx)&&ie(O.fy))continue;let L=s*p/(1+p*Math.sqrt(d[b])),F=Math.hypot(e[E][0],e[E][1]);F=F<1e-4?1e-4:F;const I=c/F;L=L>I?I:L;const V=L*e[E][0],Y=L*e[E][1];t.mergeNodeData(E,{x:O.x+V,y:O.y+Y})}return p}}const WL={maxIteration:1e3,gravity:10,speed:5,clustering:!1,clusterGravity:10,width:300,height:300,nodeClusterBy:"cluster"},GL=800;class VL{constructor(t={}){this.options=t,this.id="fruchterman",this.timeInterval=0,this.running=!1,this.options=Object.assign(Object.assign({},WL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericFruchtermanLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericFruchtermanLayout(!0,t,e)})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval),this.running=!1}tick(t=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let r=0;r<t;r++)this.runOneStep(this.lastGraph,this.lastClusterMap,this.lastOptions);const e={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&e.nodes.forEach(r=>this.lastGraph.mergeNodeData(r.id,{x:r.data.x,y:r.data.y,z:this.options.dimensions===3?r.data.z:void 0})),e}genericFruchtermanLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){if(this.running)return;const i=this.formatOptions(r),{dimensions:a,width:s,height:o,center:l,clustering:c,nodeClusterBy:u,maxIteration:h,onTick:d}=i,f=e.getAllNodes(),v=e.getAllEdges();if(!(f!=null&&f.length)){const E={nodes:[],edges:v};return this.lastResult=E,E}if(f.length===1){t&&e.mergeNodeData(f[0].id,{x:l[0],y:l[1],z:a===3?l[2]:void 0});const E={nodes:[Object.assign(Object.assign({},f[0]),{data:Object.assign(Object.assign({},f[0].data),{x:l[0],y:l[1],z:a===3?l[2]:void 0})})],edges:v};return this.lastResult=E,E}const g=f.map(E=>li(E,[s,o])),p=new Vn({nodes:g,edges:v}),y={};if(c&&g.forEach(E=>{const O=E.data[u];y[O]||(y[O]={name:O,cx:0,cy:0,count:0})}),this.lastLayoutNodes=g,this.lastLayoutEdges=v,this.lastAssign=t,this.lastGraph=p,this.lastOptions=i,this.lastClusterMap=y,typeof window=="undefined")return;let b=0;return new Promise(E=>{this.timeInterval=window.setInterval(()=>{if(!this.running){E({nodes:g,edges:v});return}this.runOneStep(p,y,i),t&&g.forEach(({id:O,data:P})=>e.mergeNodeData(O,{x:P.x,y:P.y,z:a===3?P.z:void 0})),d==null||d({nodes:g,edges:v}),b++,b>=h&&(window.clearInterval(this.timeInterval),E({nodes:g,edges:v}))},0),this.running=!0})})}formatOptions(t={}){const e=Object.assign(Object.assign({},this.options),t),{clustering:r,nodeClusterBy:i}=e,{center:a,width:s,height:o}=e;return e.width=!s&&typeof window!="undefined"?window.innerWidth:s,e.height=!o&&typeof window!="undefined"?window.innerHeight:o,e.center=a||[e.width/2,e.height/2],e.clustering=r&&!!i,e}runOneStep(t,e,r){const{dimensions:i,height:a,width:s,gravity:o,center:l,speed:c,clustering:u,nodeClusterBy:h,clusterGravity:d}=r,f=a*s,v=Math.sqrt(f)/10,g=t.getAllNodes(),p=f/(g.length+1),y=Math.sqrt(p),b={};if(this.applyCalculate(t,b,y,p),u){for(const O in e)e[O].cx=0,e[O].cy=0,e[O].count=0;g.forEach(O=>{const{data:P}=O,L=e[P[h]];ie(P.x)&&(L.cx+=P.x),ie(P.y)&&(L.cy+=P.y),L.count++});for(const O in e)e[O].cx/=e[O].count,e[O].cy/=e[O].count;const E=d||o;g.forEach((O,P)=>{const{id:L,data:F}=O;if(!ie(F.x)||!ie(F.y))return;const I=e[F[h]],V=Math.sqrt((F.x-I.cx)*(F.x-I.cx)+(F.y-I.cy)*(F.y-I.cy)),Y=y*E;b[L].x-=Y*(F.x-I.cx)/V,b[L].y-=Y*(F.y-I.cy)/V})}g.forEach((E,O)=>{const{id:P,data:L}=E;if(!ie(L.x)||!ie(L.y))return;const F=.01*y*o;b[P].x-=F*(L.x-l[0]),b[P].y-=F*(L.y-l[1]),i===3&&(b[P].z-=F*(L.z-l[2]))}),g.forEach((E,O)=>{const{id:P,data:L}=E;if(ie(L.fx)&&ie(L.fy)){L.x=L.fx,L.y=L.fy,i===3&&(L.z=L.fz);return}if(!ie(L.x)||!ie(L.y))return;const F=Math.sqrt(b[P].x*b[P].x+b[P].y*b[P].y+(i===3?b[P].z*b[P].z:0));if(F>0){const I=Math.min(v*(c/GL),F);t.mergeNodeData(P,{x:L.x+b[P].x/F*I,y:L.y+b[P].y/F*I,z:i===3?L.z+b[P].z/F*I:void 0})}})}applyCalculate(t,e,r,i){this.calRepulsive(t,e,i),this.calAttractive(t,e,r)}calRepulsive(t,e,r){const i=t.getAllNodes();i.forEach(({data:a,id:s},o)=>{e[s]={x:0,y:0,z:0},i.forEach(({data:l,id:c},u)=>{if(o<=u||!ie(a.x)||!ie(l.x)||!ie(a.y)||!ie(l.y))return;let h=a.x-l.x,d=a.y-l.y,f=this.options.dimensions===3?a.z-l.z:0,v=h*h+d*d+f*f;v===0&&(v=1,h=.01,d=.01,f=.01);const g=r/v,p=h*g,y=d*g,b=f*g;e[s].x+=p,e[s].y+=y,e[c].x-=p,e[c].y-=y,this.options.dimensions===3&&(e[s].z+=b,e[c].z-=b)})})}calAttractive(t,e,r){t.getAllEdges().forEach(a=>{const{source:s,target:o}=a;if(!s||!o||s===o)return;const{data:l}=t.getNode(s),{data:c}=t.getNode(o);if(!ie(c.x)||!ie(l.x)||!ie(c.y)||!ie(l.y))return;const u=c.x-l.x,h=c.y-l.y,d=this.options.dimensions===3?c.z-l.z:0,f=Math.sqrt(u*u+h*h+d*d)/r,v=u*f,g=h*f,p=d*f;e[s].x+=v,e[s].y+=g,e[o].x-=v,e[o].y-=g,this.options.dimensions===3&&(e[s].z+=p,e[o].z-=p)})}}const UL={begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30,width:300,height:300};class YL{constructor(t={}){this.options=t,this.id="grid",this.options=Object.assign(Object.assign({},UL),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericGridLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericGridLayout(!0,t,e)})}genericGridLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),r),{begin:a=[0,0],condense:s,preventOverlapPadding:o,preventOverlap:l,rows:c,cols:u,nodeSpacing:h,nodeSize:d,width:f,height:v,position:g}=i;let{sortBy:p}=i;const y=e.getAllNodes(),b=e.getAllEdges(),E=y==null?void 0:y.length;if(!E||E===1)return Zs(e,t,a);const O=y.map(ft=>li(ft));p!=="id"&&(!Ge(p)||O[0].data[p]===void 0)&&(p="degree"),p==="degree"?O.sort((ft,Nt)=>e.getDegree(Nt.id,"both")-e.getDegree(ft.id,"both")):p==="id"?O.sort((ft,Nt)=>ie(Nt.id)&&ie(ft.id)?Nt.id-ft.id:`${ft.id}`.localeCompare(`${Nt.id}`)):O.sort((ft,Nt)=>Nt.data[p]-ft.data[p]);const P=!f&&typeof window!="undefined"?window.innerWidth:f,L=!v&&typeof window!="undefined"?window.innerHeight:v,F=E,I={rows:c,cols:u};if(c!=null&&u!=null)I.rows=c,I.cols=u;else if(c!=null&&u==null)I.rows=c,I.cols=Math.ceil(F/I.rows);else if(c==null&&u!=null)I.cols=u,I.rows=Math.ceil(F/I.cols);else{const ft=Math.sqrt(F*L/P);I.rows=Math.round(ft),I.cols=Math.round(P/L*ft)}if(I.rows=Math.max(I.rows,1),I.cols=Math.max(I.cols,1),I.cols*I.rows>F){const ft=rh(I),Nt=ih(I);(ft-1)*Nt>=F?rh(I,ft-1):(Nt-1)*ft>=F&&ih(I,Nt-1)}else for(;I.cols*I.rows<F;){const ft=rh(I),Nt=ih(I);(Nt+1)*ft>=F?ih(I,Nt+1):rh(I,ft+1)}let V=s?0:P/I.cols,Y=s?0:L/I.rows;if(l||h){const ft=js(10,h),Nt=Cv(30,d,!1);O.forEach(Ot=>{(!Ot.data.x||!Ot.data.y)&&(Ot.data.x=0,Ot.data.y=0);const mt=e.getNode(Ot.id),[yt,Rt]=Pl(Nt(mt)||30),jt=ft!==void 0?ft(Ot):o,Xt=yt+jt,ee=Rt+jt;V=Math.max(V,Xt),Y=Math.max(Y,ee)})}const J={},$={row:0,col:0},ot={};for(let ft=0;ft<O.length;ft++){const Nt=O[ft];let Ot;if(g&&(Ot=g(e.getNode(Nt.id))),Ot&&(Ot.row!==void 0||Ot.col!==void 0)){const mt={row:Ot.row,col:Ot.col};if(mt.col===void 0)for(mt.col=0;Fv(J,mt);)mt.col++;else if(mt.row===void 0)for(mt.row=0;Fv(J,mt);)mt.row++;ot[Nt.id]=mt,Pb(J,mt)}HL(Nt,a,V,Y,ot,I,$,J)}const ct={nodes:O,edges:b};return t&&O.forEach(ft=>{e.mergeNodeData(ft.id,{x:ft.data.x,y:ft.data.y})}),ct})}}const rh=(n,t)=>{let e;const r=n.rows||5,i=n.cols||5;return t==null?e=Math.min(r,i):Math.min(r,i)===n.rows?n.rows=t:n.cols=t,e},ih=(n,t)=>{let e;const r=n.rows||5,i=n.cols||5;return t==null?e=Math.max(r,i):Math.max(r,i)===n.rows?n.rows=t:n.cols=t,e},Fv=(n,t)=>n[`c-${t.row}-${t.col}`]||!1,Pb=(n,t)=>n[`c-${t.row}-${t.col}`]=!0,Rb=(n,t)=>{const e=n.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)},HL=(n,t,e,r,i,a,s,o)=>{let l,c;const u=i[n.id];if(u)l=u.col*e+e/2+t[0],c=u.row*r+r/2+t[1];else{for(;Fv(o,s);)Rb(a,s);l=s.col*e+e/2+t[0],c=s.row*r+r/2+t[1],Pb(o,s),Rb(a,s)}n.data.x=l,n.data.y=c},XL=(n,t,e)=>{try{const r=Ha.mul(Ha.pow(t,2),-.5),i=r.mean("row"),a=r.mean("column"),s=r.mean();r.add(s).subRowVector(i).subColumnVector(a);const o=new Eb(r),l=Ha.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map(c=>Ha.mul([c],[l]).toJSON()[0].splice(0,n))}catch(r){const i=[];for(let a=0;a<t.length;a++){const s=Math.random()*e,o=Math.random()*e;i.push([s,o])}return i}},KL=800,QL={iterations:10,height:10,width:10,speed:100,gravity:10,k:5},qL=(n,t)=>{const e=Object.assign(Object.assign({},QL),t),{positions:r,iterations:i,width:a,k:s,speed:o=100,strictRadial:l,focusIdx:c,radii:u=[],nodeSizeFunc:h}=e,d=n.getAllNodes(),f=[],v=a/10;for(let g=0;g<i;g++)r.forEach((p,y)=>{f[y]={x:0,y:0}}),JL(d,r,f,s,u,h),$L(r,f,o,l,c,v,a,u);return r},JL=(n,t,e,r,i,a)=>{t.forEach((s,o)=>{e[o]={x:0,y:0},t.forEach((l,c)=>{if(o===c||i[o]!==i[c])return;let u=s.x-l.x,h=s.y-l.y,d=Math.sqrt(u*u+h*h);if(d===0){d=1;const f=o>c?1:-1;u=.01*f,h=.01*f}if(d<a(n[o])/2+a(n[c])/2){const f=r*r/d;e[o].x+=u/d*f,e[o].y+=h/d*f}})})},$L=(n,t,e,r,i,a,s,o)=>{const l=a||s/10;return r&&t.forEach((c,u)=>{const h=n[u].x-n[i].x,d=n[u].y-n[i].y,f=Math.sqrt(h*h+d*d);let v=d/f,g=-h/f;const p=Math.sqrt(c.x*c.x+c.y*c.y);let y=Math.acos((v*c.x+g*c.y)/p);y>Math.PI/2&&(y-=Math.PI/2,v*=-1,g*=-1);const b=Math.cos(y)*p;c.x=v*b,c.y=g*b}),n.forEach((c,u)=>{if(u===i)return;const h=Math.sqrt(t[u].x*t[u].x+t[u].y*t[u].y);if(h>0&&u!==i){const d=Math.min(l*(e/KL),h);if(c.x+=t[u].x/h*d,c.y+=t[u].y/h*d,r){let f=c.x-n[i].x,v=c.y-n[i].y;const g=Math.sqrt(f*f+v*v);f=f/g*o[u],v=v/g*o[u],c.x=n[i].x+f,c.y=n[i].y+v}}}),n},t_={maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,strictRadial:!0,maxPreventOverlapIteration:200,sortStrength:10};class e_{constructor(t={}){this.options=t,this.id="radial",this.options=Object.assign(Object.assign({},t_),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericRadialLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericRadialLayout(!0,t,e)})}genericRadialLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),r),{width:a,height:s,center:o,focusNode:l,unitRadius:c,nodeSize:u,nodeSpacing:h,strictRadial:d,preventOverlap:f,maxPreventOverlapIteration:v,sortBy:g,linkDistance:p=50,sortStrength:y=10,maxIteration:b=1e3}=i,E=e.getAllNodes(),O=e.getAllEdges(),P=!a&&typeof window!="undefined"?window.innerWidth:a,L=!s&&typeof window!="undefined"?window.innerHeight:s,F=o||[P/2,L/2];if(!(E!=null&&E.length)||E.length===1)return Zs(e,t,F);let I=E[0];if(Ge(l)){for(let xe=0;xe<E.length;xe++)if(E[xe].id===l){I=E[xe];break}}else I=l||E[0];const V=i_(E,I.id),Y=Sb({nodes:E,edges:O},!1),J=wb(Y),$=s_(J,V);a_(J,V,$+1);const ot=J[V];let ct=P-F[0]>F[0]?F[0]:P-F[0],ft=L-F[1]>F[1]?F[1]:L-F[1];ct===0&&(ct=P/2),ft===0&&(ft=L/2);const Nt=Math.min(ct,ft),Ot=Math.max(...ot),mt=[],yt=c||Nt/Ot;ot.forEach((xe,Ce)=>{mt[Ce]=xe*yt});const Rt=n_(E,J,p,mt,yt,g,y),jt=r_(Rt),Xt=XL(p,Rt,p);let ee=Xt.map(([xe,Ce])=>({x:(isNaN(xe)?Math.random()*p:xe)-Xt[V][0],y:(isNaN(Ce)?Math.random()*p:Ce)-Xt[V][1]}));this.run(b,ee,jt,Rt,mt,V);let ae;if(f){ae=Nv(u,h);const xe={nodes:E,nodeSizeFunc:ae,positions:ee,radii:mt,height:L,width:P,strictRadial:!!d,focusIdx:V,iterations:v||200,k:ee.length/4.5};ee=qL(e,xe)}const he=[];return ee.forEach((xe,Ce)=>{const je=li(E[Ce]);je.data.x=xe.x+F[0],je.data.y=xe.y+F[1],he.push(je)}),t&&he.forEach(xe=>e.mergeNodeData(xe.id,{x:xe.data.x,y:xe.data.y})),{nodes:he,edges:O}})}run(t,e,r,i,a,s){for(let o=0;o<=t;o++){const l=o/t;this.oneIteration(l,e,a,i,r,s)}}oneIteration(t,e,r,i,a,s){const o=1-t;e.forEach((l,c)=>{const u=Mb(l,{x:0,y:0}),h=u===0?0:1/u;if(c===s)return;let d=0,f=0,v=0;e.forEach((p,y)=>{if(c===y)return;const b=Mb(l,p),E=b===0?0:1/b,O=i[y][c];v+=a[c][y],d+=a[c][y]*(p.x+O*(l.x-p.x)*E),f+=a[c][y]*(p.y+O*(l.y-p.y)*E)});const g=r[c]===0?0:1/r[c];v*=o,v+=t*g*g,d*=o,d+=t*g*l.x*h,l.x=d/v,f*=o,f+=t*g*l.y*h,l.y=f/v})}}const n_=(n,t,e,r,i,a,s)=>{if(!n)return[];const o=[];if(t){const l={};t.forEach((c,u)=>{const h=[];c.forEach((d,f)=>{var v,g;if(u===f)h.push(0);else if(r[u]===r[f])if(a==="data")h.push(d*(Math.abs(u-f)*s)/(r[u]/i));else if(a){let p,y;if(l[n[u].id])p=l[n[u].id];else{const b=(a==="id"?n[u].id:(v=n[u].data)===null||v===void 0?void 0:v[a])||0;Ge(b)?p=b.charCodeAt(0):p=b,l[n[u].id]=p}if(l[n[f].id])y=l[n[f].id];else{const b=(a==="id"?n[f].id:(g=n[f].data)===null||g===void 0?void 0:g[a])||0;Ge(b)?y=b.charCodeAt(0):y=b,l[n[f].id]=y}h.push(d*(Math.abs(p-y)*s)/(r[u]/i))}else h.push(d*e/(r[u]/i));else{const p=(e+i)/2;h.push(d*p)}}),o.push(h)})}return o},r_=n=>{const t=n.length,e=n[0].length,r=[];for(let i=0;i<t;i++){const a=[];for(let s=0;s<e;s++)n[i][s]!==0?a.push(1/(n[i][s]*n[i][s])):a.push(0);r.push(a)}return r},i_=(n,t)=>{let e=-1;return n.forEach((r,i)=>{r.id===t&&(e=i)}),Math.max(e,0)},a_=(n,t,e)=>{const r=n.length;for(let i=0;i<r;i++)if(n[t][i]===1/0){n[t][i]=e,n[i][t]=e;for(let a=0;a<r;a++)n[i][a]!==1/0&&n[t][a]===1/0&&(n[t][a]=e+n[i][a],n[a][t]=e+n[i][a])}for(let i=0;i<r;i++)if(i!==t){for(let a=0;a<r;a++)if(n[i][a]===1/0){let s=Math.abs(n[t][i]-n[t][a]);s=s===0?1:s,n[i][a]=s}}},s_=(n,t)=>{let e=0;for(let r=0;r<n[t].length;r++)n[t][r]!==1/0&&(e=n[t][r]>e?n[t][r]:e);return e},o_={center:[0,0],width:300,height:300};class l_{constructor(t={}){this.options=t,this.id="random",this.options=Object.assign(Object.assign({},o_),t)}execute(t,e){return(0,G.mG)(this,void 0,void 0,function*(){return this.genericRandomLayout(!1,t,e)})}assign(t,e){return(0,G.mG)(this,void 0,void 0,function*(){yield this.genericRandomLayout(!0,t,e)})}genericRandomLayout(t,e,r){return(0,G.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),r),{center:a,width:s,height:o}=i,l=e.getAllNodes(),c=.9,u=!s&&typeof window!="undefined"?window.innerWidth:s,h=!o&&typeof window!="undefined"?window.innerHeight:o,d=a||[u/2,h/2],f=[];return l&&l.forEach(g=>{f.push({id:g.id,data:{x:(Math.random()-.5)*c*u+d[0],y:(Math.random()-.5)*c*h+d[1]}})}),t&&f.forEach(g=>e.mergeNodeData(g.id,{x:g.data.x,y:g.data.y})),{nodes:f,edges:e.getAllEdges()}})}}function c_(n){var t,e,r,i=n||1;function a(o,l){++t>i&&(r=e,s(1),++t),e[o]=l}function s(o){t=0,e=Object.create(null),o||(r=Object.create(null))}return s(),{clear:s,has:function(o){return e[o]!==void 0||r[o]!==void 0},get:function(o){var l=e[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return a(o,l),l},set:function(o,l){e[o]!==void 0?e[o]=l:a(o,l)}}}var zv=new Map;function jv(n,t,e){e===void 0&&(e=128);var r=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var s=t?t.apply(this,i):i[0];zv.has(n)||zv.set(n,c_(e));var o=zv.get(n);if(o.has(s))return o.get(s);var l=n.apply(this,i);return o.set(s,l),l};return r}var u_=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class ah extends Hu{constructor(){super(...arguments),this.id="fishbone"}getRoot(){const t=this.context.model.getRootsData();if(!(ra(t)||t.length>2))return t[0]}formatSize(t){const e=typeof t=="function"?t:()=>t;return r=>si(e(r))}doLayout(t,e){const{hGap:r,getRibSep:i,vGap:a,nodeSize:s,height:o}=e,{model:l}=this.context,c=this.formatSize(s);let u=c(t)[0]+i(t);const h=(E,O=0)=>{var P;return O+=r*((E.children||[]).length+1),(P=E.children)===null||P===void 0||P.forEach(L=>{var F;(F=l.getNodeLikeDatum(L).children)===null||F===void 0||F.forEach(V=>{const Y=l.getNodeLikeDatum(V);O=h(Y,O)})}),O},d=E=>{if(E.depth===1)return u;const O=l.getParentData(E.id,"tree");if(wo(E)){const P=l.getParentData(O.id,"tree"),L=g(E)-g(P);return d(O)+L*r/a}else{const P=(O.children||[]).indexOf(E.id),L=l.getNodeData((O.children||[]).slice(P));return f(O)-L.reduce((F,I)=>F+h(I),0)-c(O)[0]/2}},f=jv(E=>{if(Zv(E))return c(E)[0]/2;const O=l.getParentData(E.id,"tree");if(wo(E))return d(E)+h(E)+c(E)[0]/2;{const P=g(E)-g(O),L=r/a;return d(E)+P*L}},E=>E.id),v=E=>g(l.getParentData(E,"tree")),g=jv(E=>{if(Zv(E))return o/2;if(wo(E)){const O=l.getParentData(E.id,"tree"),P=O.children.indexOf(E.id);if(P===0)return v(O.id)+a;const L=l.getNodeLikeDatum(O.children[P-1]);if(ra(L.children))return g(L)+a;const F=l.getDescendantsData(L.id);return Math.max(...F.map(I=>wo(I)?v(I.id):g(I)))+a}else{if(ra(E.children))return v(E.id)+a;const O=l.getNodeLikeDatum(E.children.slice(-1)[0]);if(ra(O.children))return g(O)+a;const P=l.getDescendantsData(E.id).slice(-1)[0];return(wo(P)?v(P.id):g(P))+a}},E=>E.id);let p=0;const y={nodes:[],edges:[]},b=E=>{var O;(O=E.children)===null||O===void 0||O.forEach(V=>b(l.getNodeLikeDatum(V)));const P=g(E),L=f(E);if(y.nodes.push({id:E.id,x:L,y:P}),Zv(E))return;const F=l.getRelatedEdgesData(E.id,"in")[0],I=[d(E),wo(E)?P:v(E.id)];y.edges.push({id:At(F),controlPoints:[I],relatedNodeId:E.id}),p=Math.max(p,L+i(E)),E.depth===1&&(u=p)};return b(t),y}placeAlterative(t,e){const r=(e.children||[]).filter((o,l)=>l%2!==0);if(r.length===0)return t;const{model:i}=this.context,a=t.nodes.find(o=>o.id===e.id).y,s=o=>{const l=i.getAncestorsData(o,"tree");if(ra(l))return!1;const c=l.length===1?o:l[l.length-2].id;return r.includes(c)};t.nodes.forEach(o=>{s(o.id)&&(o.y=2*a-o.y)}),t.edges.forEach(o=>{s(o.relatedNodeId)&&(o.controlPoints=o.controlPoints.map(l=>[l[0],2*a-l[1]]))})}rightToLeft(t,e){return t.nodes.forEach(r=>r.x=e.width-r.x),t.edges.forEach(r=>{r.controlPoints=r.controlPoints.map(i=>[e.width-i[0],i[1]])}),t}execute(t,e){return u_(this,void 0,void 0,function*(){const r=Object.assign(Object.assign(Object.assign({},ah.defaultOptions),this.options),e),{direction:i,nodeSize:a}=r,s=this.getRoot();if(!s)return t;const o=this.formatSize(a);r.vGap||(r.vGap=Math.max(...(t.nodes||[]).map(d=>o(d)[1]))),r.hGap||(r.hGap=Math.max(...(t.nodes||[]).map(d=>o(d)[0])));let l=this.doLayout(s,r);this.placeAlterative(l,s),i==="RL"&&(l=this.rightToLeft(l,r));const{model:c}=this.context,u=[],h=[];return l.nodes.forEach(d=>{const{id:f,x:v,y:g}=d,p=c.getNodeLikeDatum(f);u.push(Lb(p,{x:v,y:g}))}),l.edges.forEach(d=>{const{id:f,controlPoints:v}=d,g=c.getEdgeDatum(f);h.push(Lb(g,{controlPoints:v}))}),{nodes:u,edges:h}})}}ah.defaultOptions={direction:"RL",getRibSep:()=>60};const Lb=(n,t)=>Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),t)}),Zv=n=>n.depth===0,wo=n=>(n.depth||(n.depth=0))%2===0;var h_=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class sh extends Hu{constructor(){super(...arguments),this.id="snake"}formatSize(t,e){const r=typeof e=="function"?e:()=>e;return t.reduce((i,a)=>{const[s,o]=si(r(a))||[0,0];return[Math.max(i[0],s),Math.max(i[1],o)]},[0,0])}validate(t){const{nodes:e=[],edges:r=[]}=t,i={},a={},s={};e.forEach(d=>{i[d.id]=0,a[d.id]=0,s[d.id]=[]}),r.forEach(d=>{i[d.target]++,a[d.source]++,s[d.source].push(d.target)});const o=new Set,l=d=>{o.has(d)||(o.add(d),s[d].forEach(l))};if(l(e[0].id),o.size!==e.length)return!1;const c=e.filter(d=>i[d.id]===0),u=e.filter(d=>a[d.id]===0);return!(c.length!==1||u.length!==1||e.filter(d=>i[d.id]===1&&a[d.id]===1).length!==e.length-2)}execute(t,e){return h_(this,void 0,void 0,function*(){var r;if(!this.validate(t))return t;const{nodeSize:i,padding:a,sortBy:s,cols:o,colGap:l,rowGap:c,clockwise:u,width:h,height:d}=Object.assign({},sh.defaultOptions,this.options,e),[f,v,g,p]=Ri(a),y=this.formatSize(t.nodes||[],i),b=Math.ceil((t.nodes||[]).length/o);let E=l||(h-p-v-o*y[0])/(o-1),O=c||(d-f-g-b*y[1])/(b-1);return(O===1/0||O<0)&&(O=0),(E===1/0||E<0)&&(E=0),{nodes:((s?(r=t.nodes)===null||r===void 0?void 0:r.sort(s):d_(t))||[]).map((F,I)=>{const V=Math.floor(I/o),Y=I%o,J=u?V%2===0?Y:o-1-Y:V%2===0?o-1-Y:Y,$=p+J*(y[0]+E)+y[0]/2,ot=f+V*(y[1]+O)+y[1]/2;return{id:F.id,style:{x:$,y:ot}}})}})}}sh.defaultOptions={padding:0,cols:5,clockwise:!0};function d_(n){const{nodes:t=[],edges:e=[]}=n,r={},i={};t.forEach(o=>{r[o.id]=0,i[o.id]=[]}),e.forEach(o=>{r[o.target]++,i[o.source].push(o.target)});const a=[],s=[];for(t.forEach(o=>{r[o.id]===0&&a.push(o.id)});a.length>0;){const o=a.shift(),l=t.find(c=>c.id===o);s.push(l),i[o].forEach(c=>{r[c]--,r[c]===0&&a.push(c)})}return s}const f_=["rgb(158, 1, 66)","rgb(213, 62, 79)","rgb(244, 109, 67)","rgb(253, 174, 97)","rgb(254, 224, 139)","rgb(255, 255, 191)","rgb(230, 245, 152)","rgb(171, 221, 164)","rgb(102, 194, 165)","rgb(50, 136, 189)","rgb(94, 79, 162)"],v_=["rgb(78, 121, 167)","rgb(242, 142, 44)","rgb(225, 87, 89)","rgb(118, 183, 178)","rgb(89, 161, 79)","rgb(237, 201, 73)","rgb(175, 122, 161)","rgb(255, 157, 167)","rgb(156, 117, 95)","rgb(186, 176, 171)"],g_=["rgb(255, 245, 235)","rgb(254, 230, 206)","rgb(253, 208, 162)","rgb(253, 174, 107)","rgb(253, 141, 60)","rgb(241, 105, 19)","rgb(217, 72, 1)","rgb(166, 54, 3)","rgb(127, 39, 4)"],p_=["rgb(247, 252, 245)","rgb(229, 245, 224)","rgb(199, 233, 192)","rgb(161, 217, 155)","rgb(116, 196, 118)","rgb(65, 171, 93)","rgb(35, 139, 69)","rgb(0, 109, 44)","rgb(0, 68, 27)"],m_=["rgb(247, 251, 255)","rgb(222, 235, 247)","rgb(198, 219, 239)","rgb(158, 202, 225)","rgb(107, 174, 214)","rgb(66, 146, 198)","rgb(33, 113, 181)","rgb(8, 81, 156)","rgb(8, 48, 107)"];var y_=function(n,t,e){if(!Wr(n)&&!vo(n))return n;var r=e;return i1(n,function(i,a){r=t(r,i,a)}),r},b_=y_,Wv=function(n,t){return b_(n,function(e,r,i){return t.includes(i)||(e[i]=r),e},{})};class br extends Gf{}function So(n,t=!0,e){const r=document.createElement("div");return r.setAttribute("class",`g6-${n}`),Object.assign(r.style,{position:"absolute",display:"block"}),t&&Object.assign(r.style,{position:"unset",gridArea:"1 / 1 / 2 / 2",inset:"0px",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none"}),e&&Object.assign(r.style,e),r}function Gv(n,t="div",e={},r="",i=document.body){const a=document.getElementById(n);a&&a.remove();const s=document.createElement(t);return s.innerHTML=r,s.id=n,Object.assign(s.style,e),i.appendChild(s),s}var x_=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class oh extends br{constructor(t,e){super(t,Object.assign({},oh.defaultOptions,e)),this.$element=So("background"),this.context.canvas.getContainer().prepend(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return x_(this,void 0,void 0,function*(){e.update.call(this,t),Object.assign(this.$element.style,Wv(this.options,["key","type"]))})}destroy(){super.destroy(),this.$element.remove()}}oh.defaultOptions={transition:"background 0.5s",backgroundSize:"cover",zIndex:"-1"};function Vv(n,t,e,r,i,a){const s=n,o=t,l=e-s,c=r-o;let u=i-s,h=a-o,d=u*l+h*c,f=0;d<=0?f=0:(u=l-u,h=c-h,d=u*l+h*c,d<=0?f=0:f=d*d/(l*l+c*c));const v=u*u+h*h-f;return v<0?0:v}function Ka(n,t,e,r){return(n-e)*(n-e)+(t-r)*(t-r)}function _b(n,t,e,r,i){return Ka(n,t,e,r)<i*i}function E_(n){if(!Number.isFinite(n))return e=>e;if(n===0)return Math.round;const t=Math.pow(10,n);return e=>Math.round(e*t)/t}function Db(n){const t=Math.min(n.x1,n.x2),e=Math.max(n.x1,n.x2),r=Math.min(n.y1,n.y2),i=Math.max(n.y1,n.y2);return{x:t,y:r,x2:e,y2:i,width:e-t,height:i-r}}class hr{constructor(t,e,r,i){this.x1=t,this.y1=e,this.x2=r,this.y2=i}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}draw(t){t.moveTo(this.x1,this.y1),t.lineTo(this.x2,this.y2)}toString(){return`Line(from=(${this.x1},${this.y1}),to=(${this.x2},${this.y2}))`}static from(t){return new hr(t.x1,t.y1,t.x2,t.y2)}cuts(t,e){if(this.y1===this.y2||e<this.y1&&e<=this.y2||e>this.y1&&e>=this.y2||t>this.x1&&t>=this.x2)return!1;if(t<this.x1&&t<=this.x2)return!0;const r=this.x1+(e-this.y1)*(this.x2-this.x1)/(this.y2-this.y1);return t<=r}distSquare(t,e){return Vv(this.x1,this.y1,this.x2,this.y2,t,e)}ptClose(t,e,r){if(this.x1<this.x2){if(t<this.x1-r||t>this.x2+r)return!1}else if(t<this.x2-r||t>this.x1+r)return!1;if(this.y1<this.y2){if(e<this.y1-r||e>this.y2+r)return!1}else if(e<this.y2-r||e>this.y1+r)return!1;return!0}}var _n;(function(n){n[n.POINT=1]="POINT",n[n.PARALLEL=2]="PARALLEL",n[n.COINCIDENT=3]="COINCIDENT",n[n.NONE=4]="NONE"})(_n||(_n={}));class Uv{constructor(t,e=0,r=0){this.state=t,this.x=e,this.y=r}}function lh(n,t){const e=(t.x2-t.x1)*(n.y1-t.y1)-(t.y2-t.y1)*(n.x1-t.x1),r=(n.x2-n.x1)*(n.y1-t.y1)-(n.y2-n.y1)*(n.x1-t.x1),i=(t.y2-t.y1)*(n.x2-n.x1)-(t.x2-t.x1)*(n.y2-n.y1);if(i){const a=e/i,s=r/i;return 0<=a&&a<=1&&0<=s&&s<=1?new Uv(_n.POINT,n.x1+a*(n.x2-n.x1),n.y1+a*(n.y2-n.y1)):new Uv(_n.NONE)}return new Uv(e===0||r===0?_n.COINCIDENT:_n.PARALLEL)}function Ib(n,t){const e=(t.x2-t.x1)*(n.y1-t.y1)-(t.y2-t.y1)*(n.x1-t.x1),r=(n.x2-n.x1)*(n.y1-t.y1)-(n.y2-n.y1)*(n.x1-t.x1),i=(t.y2-t.y1)*(n.x2-n.x1)-(t.x2-t.x1)*(n.y2-n.y1);if(i){const a=e/i,s=r/i;if(0<=a&&a<=1&&0<=s&&s<=1)return a}return Number.POSITIVE_INFINITY}function w_(n,t){function e(i,a,s,o){let l=Ib(t,new hr(i,a,s,o));return l=Math.abs(l-.5),l>=0&&l<=1?1:0}let r=e(n.x,n.y,n.x2,n.y);return r+=e(n.x,n.y,n.x,n.y2),r>1||(r+=e(n.x,n.y2,n.x2,n.y2),r>1)?!0:(r+=e(n.x2,n.y,n.x2,n.y2),r>0)}var Dn;(function(n){n[n.LEFT=0]="LEFT",n[n.TOP=1]="TOP",n[n.RIGHT=2]="RIGHT",n[n.BOTTOM=3]="BOTTOM"})(Dn||(Dn={}));function ch(n,t,e){const r=new Set;return n.width<=0?(r.add(Dn.LEFT),r.add(Dn.RIGHT)):t<n.x?r.add(Dn.LEFT):t>n.x+n.width&&r.add(Dn.RIGHT),n.height<=0?(r.add(Dn.TOP),r.add(Dn.BOTTOM)):e<n.y?r.add(Dn.TOP):e>n.y+n.height&&r.add(Dn.BOTTOM),r}function Bb(n,t){let e=t.x1,r=t.y1;const i=t.x2,a=t.y2,s=Array.from(ch(n,i,a));if(s.length===0)return!0;let o=ch(n,e,r);for(;o.size!==0;){for(const l of s)if(o.has(l))return!1;if(o.has(Dn.RIGHT)||o.has(Dn.LEFT)){let l=n.x;o.has(Dn.RIGHT)&&(l+=n.width),r=r+(l-e)*(a-r)/(i-e),e=l}else{let l=n.y;o.has(Dn.BOTTOM)&&(l+=n.height),e=e+(l-r)*(i-e)/(a-r),r=l}o=ch(n,e,r)}return!0}function S_(n,t){let e=Number.POSITIVE_INFINITY,r=0;function i(a,s,o,l){let c=Ib(t,new hr(a,s,o,l));c=Math.abs(c-.5),c>=0&&c<=1&&(r++,c<e&&(e=c))}return i(n.x,n.y,n.x2,n.y),i(n.x,n.y,n.x,n.y2),r>1||(i(n.x,n.y2,n.x2,n.y2),r>1)?e:(i(n.x2,n.y,n.x2,n.y2),r===0?-1:e)}function M_(n,t){let e=0;const r=lh(n,new hr(t.x,t.y,t.x2,t.y));e+=r.state===_n.POINT?1:0;const i=lh(n,new hr(t.x,t.y,t.x,t.y2));e+=i.state===_n.POINT?1:0;const a=lh(n,new hr(t.x,t.y2,t.x2,t.y2));e+=a.state===_n.POINT?1:0;const s=lh(n,new hr(t.x2,t.y,t.x2,t.y2));return e+=s.state===_n.POINT?1:0,{top:r,left:i,bottom:a,right:s,count:e}}class Or{constructor(t,e,r,i){this.x=t,this.y=e,this.width=r,this.height=i}get x2(){return this.x+this.width}get y2(){return this.y+this.height}get cx(){return this.x+this.width/2}get cy(){return this.y+this.height/2}get radius(){return Math.max(this.width,this.height)/2}static from(t){return new Or(t.x,t.y,t.width,t.height)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}clone(){return new Or(this.x,this.y,this.width,this.height)}add(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),i=Math.max(this.x2,t.x+t.width),a=Math.max(this.y2,t.y+t.height);this.x=e,this.y=r,this.width=i-e,this.height=a-r}addPoint(t){const e=Math.min(this.x,t.x),r=Math.min(this.y,t.y),i=Math.max(this.x2,t.x),a=Math.max(this.y2,t.y);this.x=e,this.y=r,this.width=i-e,this.height=a-r}toString(){return`Rectangle[x=${this.x}, y=${this.y}, w=${this.width}, h=${this.height}]`}draw(t){t.rect(this.x,this.y,this.width,this.height)}containsPt(t,e){return t>=this.x&&t<=this.x2&&e>=this.y&&e<=this.y2}get area(){return this.width*this.height}intersects(t){return this.area<=0||t.width<=0||t.height<=0?!1:t.x+t.width>this.x&&t.y+t.height>this.y&&t.x<this.x2&&t.y<this.y2}distSquare(t,e){if(this.containsPt(t,e))return 0;const r=ch(this,t,e);return r.has(Dn.TOP)?r.has(Dn.LEFT)?Ka(t,e,this.x,this.y):r.has(Dn.RIGHT)?Ka(t,e,this.x2,this.y):(this.y-e)*(this.y-e):r.has(Dn.BOTTOM)?r.has(Dn.LEFT)?Ka(t,e,this.x,this.y2):r.has(Dn.RIGHT)?Ka(t,e,this.x2,this.y2):(e-this.y2)*(e-this.y2):r.has(Dn.LEFT)?(this.x-t)*(this.x-t):r.has(Dn.RIGHT)?(t-this.x2)*(t-this.x2):0}}function A_(n){if(n.length===0)return null;const t=n[0],e=new Or(t.x,t.y,0,0);for(const r of n)e.addPoint(r);return e}class uh{constructor(t,e,r){this.cx=t,this.cy=e,this.radius=r}get x(){return this.cx-this.radius}get x2(){return this.cx+this.radius}get width(){return this.radius*2}get y(){return this.cy-this.radius}get y2(){return this.cy+this.radius}get height(){return this.radius*2}static from(t){return new uh(t.cx,t.cy,t.radius)}containsPt(t,e){return Ka(this.cx,this.cy,t,e)<this.radius*this.radius}distSquare(t,e){const r=Ka(this.cx,this.cy,t,e);if(r<this.radius*this.radius)return 0;const i=Math.sqrt(r)-this.radius;return i*i}draw(t){t.ellipse(this.cx,this.cy,this.radius,this.radius,0,0,Math.PI*2)}}class Ws{constructor(t,e=0,r=0,i=0,a=0,s=10,o=10,l=new Float32Array(Math.max(0,s*o)).fill(0)){this.pixelGroup=t,this.i=e,this.j=r,this.pixelX=i,this.pixelY=a,this.width=s,this.height=o,this.area=l}createSub(t,e){return new Ws(this.pixelGroup,t.x,t.y,e.x,e.y,t.width,t.height)}static fromPixelRegion(t,e){return new Ws(e,0,0,t.x,t.y,Math.ceil(t.width/e),Math.ceil(t.height/e))}copy(t,e){return new Ws(this.pixelGroup,this.scaleX(e.x),this.scaleY(e.y),e.x,e.y,t.width,t.height,t.area)}boundX(t){return t<this.i?this.i:t>=this.width?this.width-1:t}boundY(t){return t<this.j?this.j:t>=this.height?this.height-1:t}scaleX(t){return this.boundX(Math.floor((t-this.pixelX)/this.pixelGroup))}scaleY(t){return this.boundY(Math.floor((t-this.pixelY)/this.pixelGroup))}scale(t){const e=this.scaleX(t.x),r=this.scaleY(t.y),i=this.boundX(Math.ceil((t.x+t.width-this.pixelX)/this.pixelGroup)),a=this.boundY(Math.ceil((t.y+t.height-this.pixelY)/this.pixelGroup)),s=i-e,o=a-r;return new Or(e,r,s,o)}invertScaleX(t){return Math.round(t*this.pixelGroup+this.pixelX)}invertScaleY(t){return Math.round(t*this.pixelGroup+this.pixelY)}addPadding(t,e){const r=Math.ceil(e/this.pixelGroup),i=this.boundX(t.x-r),a=this.boundY(t.y-r),s=this.boundX(t.x2+r),o=this.boundY(t.y2+r),l=s-i,c=o-a;return new Or(i,a,l,c)}get(t,e){return t<0||e<0||t>=this.width||e>=this.height?Number.NaN:this.area[t+e*this.width]}inc(t,e,r){t<0||e<0||t>=this.width||e>=this.height||(this.area[t+e*this.width]+=r)}set(t,e,r){t<0||e<0||t>=this.width||e>=this.height||(this.area[t+e*this.width]=r)}incArea(t,e){if(t.width<=0||t.height<=0||e===0)return;const r=this.width,i=t.width,a=Math.max(0,t.i),s=Math.max(0,t.j),o=Math.min(t.i+t.width,r),l=Math.min(t.j+t.height,this.height);if(!(l<=0||o<=0||a>=r||l>=this.height))for(let c=s;c<l;c++){const u=(c-t.j)*i,h=c*r;for(let d=a;d<o;d++){const f=t.area[d-t.i+u];f!==0&&(this.area[d+h]+=e*f)}}}fill(t){this.area.fill(t)}fillArea(t,e){const r=t.x+t.y*this.width;for(let i=0;i<t.height;i++){const a=r+i*this.width;this.area.fill(e,a,a+t.width)}}fillHorizontalLine(t,e,r,i){const a=t+e*this.width;this.area.fill(i,a,a+r)}fillVerticalLine(t,e,r,i){const a=t+e*this.width;for(let s=0;s<r;s++)this.area[a+s*this.width]=i}clear(){this.area.fill(0)}toString(){let t="";for(let e=0;e<this.height;e++){const r=e*this.width;for(let i=0;i<this.width;i++){const a=this.area[r+i];t+=a.toFixed(1).padStart(6),t+=" "}t+=`
`}return t}draw(t,e=!0){if(this.width<=0||this.height<=0)return;t.save(),e&&t.translate(this.pixelX,this.pixelY);const r=this.area.reduce((s,o)=>Math.min(s,o),Number.POSITIVE_INFINITY),i=this.area.reduce((s,o)=>Math.max(s,o),Number.NEGATIVE_INFINITY),a=s=>(s-r)/(i-r);t.scale(this.pixelGroup,this.pixelGroup);for(let s=0;s<this.width;s++)for(let o=0;o<this.height;o++){const l=this.area[s+o*this.width];t.fillStyle=`rgba(0, 0, 0, ${a(l)})`,t.fillRect(s,o,1,1)}t.restore()}drawThreshold(t,e,r=!0){if(!(this.width<=0||this.height<=0)){t.save(),r&&t.translate(this.pixelX,this.pixelY),t.scale(this.pixelGroup,this.pixelGroup);for(let i=0;i<this.width;i++)for(let a=0;a<this.height;a++){const s=this.area[i+a*this.width];t.fillStyle=s>e?"black":"white",t.fillRect(i,a,1,1)}t.restore()}}}function Fb(n,t){const e=r=>({x:r.x-t,y:r.y-t,width:r.width+2*t,height:r.height+2*t});return Array.isArray(n)?n.map(e):e(n)}function zb(n,t,e){return jb(Object.assign(Db(n),{distSquare:(r,i)=>Vv(n.x1,n.y1,n.x2,n.y2,r,i)}),t,e)}function jb(n,t,e){const r=Fb(n,e),i=t.scale(r),a=t.createSub(i,r);return T_(a,t,e,(s,o)=>n.distSquare(s,o)),a}function T_(n,t,e,r){const i=e*e;for(let a=0;a<n.height;a++)for(let s=0;s<n.width;s++){const o=t.invertScaleX(n.i+s),l=t.invertScaleY(n.j+a),c=r(o,l);if(c===0){n.set(s,a,i);continue}if(c<i){const u=e-Math.sqrt(c);n.set(s,a,u*u)}}return n}function O_(n,t,e){const r=t.scale(n),i=t.addPadding(r,e),a=t.createSub(i,{x:n.x-e,y:n.y-e}),s=r.x-i.x,o=r.y-i.y,l=i.x2-r.x2,c=i.y2-r.y2,u=i.width-s-l,h=i.height-o-c,d=e*e;a.fillArea({x:s,y:o,width:u+1,height:h+1},d);const f=[0],v=Math.max(o,s,l,c);{const b=t.invertScaleX(r.x+r.width/2);for(let E=1;E<v;E++){const O=t.invertScaleY(r.y-E),P=n.distSquare(b,O);if(P<d){const L=e-Math.sqrt(P);f.push(L*L)}else break}}const g=[],p=Math.max(s,l),y=Math.max(o,l);for(let b=1;b<p;b++){const E=t.invertScaleX(r.x-b),O=[];for(let P=1;P<y;P++){const L=t.invertScaleY(r.y-P),F=n.distSquare(E,L);if(F<d){const I=e-Math.sqrt(F);O.push(I*I)}else O.push(0)}g.push(O)}for(let b=1;b<Math.min(o,f.length);b++){const E=f[b];a.fillHorizontalLine(s,o-b,u+1,E)}for(let b=1;b<Math.min(c,f.length);b++){const E=f[b];a.fillHorizontalLine(s,o+h+b,u+1,E)}for(let b=1;b<Math.min(s,f.length);b++){const E=f[b];a.fillVerticalLine(s-b,o,h+1,E)}for(let b=1;b<Math.min(c,f.length);b++){const E=f[b];a.fillVerticalLine(s+u+b,o,h+1,E)}for(let b=1;b<s;b++){const E=g[b-1],O=s-b;for(let P=1;P<o;P++)a.set(O,o-P,E[P-1]);for(let P=1;P<c;P++)a.set(O,o+h+P,E[P-1])}for(let b=1;b<l;b++){const E=g[b-1],O=s+u+b;for(let P=1;P<o;P++)a.set(O,o-P,E[P-1]);for(let P=1;P<c;P++)a.set(O,o+h+P,E[P-1])}return a}function Y7(n,t,e,r){return{x:n,y:t,width:e,height:r}}function H7(n,t,e){return{cx:n,cy:t,radius:e}}function X7(n,t,e,r){return{x1:n,y1:t,x2:e,y2:r}}function Sn(n,t){return{x:n,y:t}}function C_(n,t,e,r){if(n.length===0)return[];const i=L_(n);return i.map((a,s)=>{const o=i.slice(0,s);return N_(t,a,o,e,r)}).flat()}function N_(n,t,e,r,i){const a=Sn(t.cx,t.cy),s=R_(a,e,n);if(s==null)return[];const o=new hr(a.x,a.y,s.cx,s.cy),l=k_(o,n,r,i);return P_(l,n)}function k_(n,t,e,r){const i=[],a=[];a.push(n);let s=!0;for(let o=0;o<e&&s;o++)for(s=!1;!s&&a.length>0;){const l=a.pop(),c=Zb(t,l),u=c?M_(l,c):null;if(!c||!u||u.count!==2){s||i.push(l);continue}let h=r,d=dh(c,h,u,!0),f=Qa(d,a)||Qa(d,i),v=hh(d,t);for(;!f&&v&&h>=1;)h/=1.5,d=dh(c,h,u,!0),f=Qa(d,a)||Qa(d,i),v=hh(d,t);if(d&&!f&&!v&&(a.push(new hr(l.x1,l.y1,d.x,d.y)),a.push(new hr(d.x,d.y,l.x2,l.y2)),s=!0),s)continue;h=r,d=dh(c,h,u,!1);let g=Qa(d,a)||Qa(d,i);for(v=hh(d,t);!g&&v&&h>=1;)h/=1.5,d=dh(c,h,u,!1),g=Qa(d,a)||Qa(d,i),v=hh(d,t);d&&!g&&(a.push(new hr(l.x1,l.y1,d.x,d.y)),a.push(new hr(d.x,d.y,l.x2,l.y2)),s=!0),s||i.push(l)}for(;a.length>0;)i.push(a.pop());return i}function P_(n,t){const e=[];for(;n.length>0;){const r=n.pop();if(n.length===0){e.push(r);break}const i=n.pop(),a=new hr(r.x1,r.y1,i.x2,i.y2);Zb(t,a)?(e.push(r),n.push(i)):n.push(a)}return e}function R_(n,t,e){let r=Number.POSITIVE_INFINITY;return t.reduce((i,a)=>{const s=Ka(n.x,n.y,a.cx,a.cy);if(s>r)return i;const o=new hr(n.x,n.y,a.cx,a.cy),l=__(e,o);return s*(l+1)*(l+1)<r&&(i=a,r=s*(l+1)*(l+1)),i},null)}function L_(n){if(n.length<2)return n;let t=0,e=0;return n.forEach(r=>{t+=r.cx,e+=r.cy}),t/=n.length,e/=n.length,n.map(r=>{const i=t-r.cx,a=e-r.cy,s=i*i+a*a;return[r,s]}).sort((r,i)=>r[1]-i[1]).map(r=>r[0])}function hh(n,t){return t.some(e=>e.containsPt(n.x,n.y))}function Qa(n,t){return t.some(e=>!!(_b(e.x1,e.y1,n.x,n.y,.001)||_b(e.x2,e.y2,n.x,n.y,.001)))}function Zb(n,t){let e=Number.POSITIVE_INFINITY,r=null;for(const i of n){if(!Bb(i,t))continue;const a=S_(i,t);a>=0&&a<e&&(r=i,e=a)}return r}function __(n,t){return n.reduce((e,r)=>Bb(r,t)&&w_(r,t)?e+1:e,0)}function dh(n,t,e,r){const i=e.top,a=e.left,s=e.bottom,o=e.right;if(r){if(a.state===_n.POINT){if(i.state===_n.POINT)return Sn(n.x-t,n.y-t);if(s.state===_n.POINT)return Sn(n.x-t,n.y2+t);const d=n.width*n.height;return n.width*((a.y-n.y+(o.y-n.y))*.5)<d*.5?a.y>o.y?Sn(n.x-t,n.y-t):Sn(n.x2+t,n.y-t):a.y<o.y?Sn(n.x-t,n.y2+t):Sn(n.x2+t,n.y2+t)}if(o.state===_n.POINT){if(i.state===_n.POINT)return Sn(n.x2+t,n.y-t);if(s.state===_n.POINT)return Sn(n.x2+t,n.y2+t)}const u=n.height*n.width;return n.height*((i.x-n.x+(o.x-n.x))*.5)<u*.5?i.x>s.x?Sn(n.x-t,n.y-t):Sn(n.x-t,n.y2+t):i.x<s.x?Sn(n.x2+t,n.y-t):Sn(n.x2+t,n.y2+t)}if(a.state===_n.POINT){if(i.state===_n.POINT)return Sn(n.x2+t,n.y2+t);if(s.state===_n.POINT)return Sn(n.x2+t,n.y-t);const u=n.height*n.width;return n.width*((a.y-n.y+(o.y-n.y))*.5)<u*.5?a.y>o.y?Sn(n.x2+t,n.y2+t):Sn(n.x-t,n.y2+t):a.y<o.y?Sn(n.x2+t,n.y-t):Sn(n.x-t,n.y-t)}if(o.state===_n.POINT){if(i.state===_n.POINT)return Sn(n.x-t,n.y2+t);if(s.state===_n.POINT)return Sn(n.x-t,n.y-t)}const l=n.height*n.width;return n.height*((i.x-n.x+(o.x-n.x))*.5)<l*.5?i.x>s.x?Sn(n.x2+t,n.y2+t):Sn(n.x2+t,n.y-t):i.x<s.x?Sn(n.x-t,n.y2+t):Sn(n.x-t,n.y-t)}function D_(n,t,e,r){if(!(n.closed?e<n.length:e<n.length-1))return!1;const a=n.get(t),s=n.get(e+1);for(let o=t+1;o<=e;o++){const l=n.get(o);if(Vv(a.x,a.y,s.x,s.y,l.x,l.y)>r)return!1}return!0}function I_(n=0){return t=>{if(n<0||t.length<3)return t;const e=[];let r=0;const i=n*n;for(;r<t.length;){let a=r+1;for(;D_(t,r,a,i);)a++;e.push(t.get(r)),r=a}return new Gs(e)}}function B_(n,t){switch(n){case-2:return(((-t+3)*t-3)*t+1)/6;case-1:return((3*t-6)*t*t+4)/6;case 0:return(((-3*t+3)*t+3)*t+1)/6;case 1:return t*t*t/6;default:throw new Error("unknown error")}}function F_(n=6){function a(s,o,l){let c=0,u=0;for(let h=-2;h<=1;h++){const d=s.get(o+h),f=B_(h,l);c+=f*d.x,u+=f*d.y}return{x:c,y:u}}return s=>{if(s.length<3)return s;const o=[],l=s.closed,c=s.length+3-1+(l?0:2);o.push(a(s,2-(l?0:2),0));for(let u=2-(l?0:2);u<c;u++)for(let h=1;h<=n;h++)o.push(a(s,u,h/n));return new Gs(o)}}function z_(n=8){return t=>{let e=n,r=t.length;if(e>1)for(r=Math.floor(t.length/e);r<3&&e>1;)e-=1,r=Math.floor(t.length/e);const i=[];for(let a=0,s=0;s<r;s++,a+=e)i.push(t.get(a));return new Gs(i)}}class Gs{constructor(t=[],e=!0){this.points=t,this.closed=e}get(t){const e=t,r=this.points.length;return t<0?this.closed?this.get(t+r):this.points[0]:t>=r?this.closed?this.get(t-r):this.points[r-1]:this.points[e]}get length(){return this.points.length}toString(t=1/0){const e=this.points;if(e.length===0)return"";const r=typeof t=="function"?t:E_(t);let i="M";for(const a of e)i+=`${r(a.x)},${r(a.y)} L`;return i=i.slice(0,-1),this.closed&&(i+=" Z"),i}draw(t){const e=this.points;if(e.length!==0){t.beginPath(),t.moveTo(e[0].x,e[0].y);for(const r of e)t.lineTo(r.x,r.y);this.closed&&t.closePath()}}sample(t){return z_(t)(this)}simplify(t){return I_(t)(this)}bSplines(t){return F_(t)(this)}apply(t){return t(this)}containsElements(t){const e=A_(this.points);return e?t.every(r=>e.containsPt(r.cx,r.cy)&&this.withinArea(r.cx,r.cy)):!1}withinArea(t,e){if(this.length===0)return!1;let r=0;const i=this.points[0],a=new hr(i.x,i.y,i.x,i.y);for(let s=1;s<this.points.length;s++){const o=this.points[s];a.x1=a.x2,a.y1=a.y2,a.x2=o.x,a.y2=o.y,a.cuts(t,e)&&r++}return a.x1=a.x2,a.y1=a.y2,a.x2=i.x,a.y2=i.y,a.cuts(t,e)&&r++,r%2===1}}class j_{constructor(t=0){this.count=0,this.arr=[],this.set=new Set,this.arr.length=t}add(t){this.set.add(`${t.x}x${t.y}`),this.arr[this.count++]=t}contains(t){return this.set.has(`${t.x}x${t.y}`)}isFirst(t){if(this.count===0)return!1;const e=this.arr[0];return e!=null&&e.x===t.x&&e.y===t.y}path(){return new Gs(this.arr.slice(0,this.count))}clear(){this.set.clear(),this.count=0}get(t){return this.arr[t]}get length(){return this.count}}const Rl=0,fh=1,vh=2,Yv=3;function Z_(n,t){const e=(Math.floor(n.width)+Math.floor(n.height))*2,r=new j_(e);function i(l,c,u,h){const d=n.get(l,c);return Number.isNaN(d)?Number.NaN:d>t?u+h:u}function a(l,c){let u=Rl;return u=i(l,c,u,1),u=i(l+1,c,u,2),u=i(l,c+1,u,4),u=i(l+1,c+1,u,8),Number.isNaN(u)?-1:u}let s=fh;function o(l,c){let u=l,h=c,d=n.invertScaleX(u),f=n.invertScaleY(h);for(let v=0;v<n.width*n.height;v++){const g={x:d,y:f};if(r.contains(g)){if(r.isFirst(g))return!0}else r.add(g);const p=a(u,h);switch(p){case-1:return!0;case 0:case 3:case 2:case 7:s=vh;break;case 12:case 14:case 4:s=Yv;break;case 6:s=s===Rl?Yv:vh;break;case 1:case 13:case 5:s=Rl;break;case 9:s=s===vh?Rl:fh;break;case 10:case 8:case 11:s=fh;break;default:return console.warn("Marching squares invalid state: "+p),!0}switch(s){case Rl:h--,f-=n.pixelGroup;break;case fh:h++,f+=n.pixelGroup;break;case Yv:u--,d-=n.pixelGroup;break;case vh:u++,d+=n.pixelGroup;break;default:return console.warn("Marching squares invalid state: "+p),!0}}return!0}for(let l=0;l<n.width;l++)for(let c=0;c<n.height;c++){if(n.get(l,c)<=t)continue;const u=a(l,c);if(!(u<0||u===15)&&o(l,c))return r.path()}return null}const gh={maxRoutingIterations:100,maxMarchingIterations:20,pixelGroup:4,edgeR0:10,edgeR1:20,nodeR0:15,nodeR1:50,morphBuffer:10,threshold:1,memberInfluenceFactor:1,edgeInfluenceFactor:1,nonMemberInfluenceFactor:-.8,virtualEdges:!0};function Ll(n){return n!=null&&typeof n.radius=="number"}function Wb(n,t){if(Ll(n)!==Ll(t))return!1;if(Ll(n)){const r=t;return n.cx===r.cx&&n.cy===r.cy&&n.radius===r.radius}const e=t;return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}var zi;(function(n){n[n.MEMBERS=0]="MEMBERS",n[n.NON_MEMBERS=1]="NON_MEMBERS",n[n.EDGES=2]="EDGES"})(zi||(zi={}));class Hv{constructor(t={}){this.dirty=new Set,this.members=[],this.nonMembers=[],this.virtualEdges=[],this.edges=[],this.activeRegion=new Or(0,0,0,0),this.potentialArea=new Ws(1,0,0,0,0,0,0),this.o=Object.assign({},gh,t)}pushMember(...t){if(t.length!==0){this.dirty.add(zi.MEMBERS);for(const e of t)this.members.push({raw:e,obj:Ll(e)?uh.from(e):Or.from(e),area:null})}}removeMember(t){const e=this.members.findIndex(r=>Wb(r.raw,t));return e<0?!1:(this.members.splice(e,1),this.dirty.add(zi.MEMBERS),!0)}removeNonMember(t){const e=this.nonMembers.findIndex(r=>Wb(r.raw,t));return e<0?!1:(this.nonMembers.splice(e,1),this.dirty.add(zi.NON_MEMBERS),!0)}removeEdge(t){const e=this.edges.findIndex(r=>r.obj.equals(t));return e<0?!1:(this.edges.splice(e,1),this.dirty.add(zi.NON_MEMBERS),!0)}pushNonMember(...t){if(t.length!==0){this.dirty.add(zi.NON_MEMBERS);for(const e of t)this.nonMembers.push({raw:e,obj:Ll(e)?uh.from(e):Or.from(e),area:null})}}pushEdge(...t){if(t.length!==0){this.dirty.add(zi.EDGES);for(const e of t)this.edges.push({raw:e,obj:hr.from(e),area:null})}}update(){const t=this.dirty.has(zi.MEMBERS),e=this.dirty.has(zi.NON_MEMBERS);let r=this.dirty.has(zi.EDGES);this.dirty.clear();const i=this.members.map(c=>c.obj);if(this.o.virtualEdges&&(t||e)){const c=this.nonMembers.map(d=>d.obj),u=C_(i,c,this.o.maxRoutingIterations,this.o.morphBuffer),h=new Map(this.virtualEdges.map(d=>[d.obj.toString(),d.area]));this.virtualEdges=u.map(d=>{var f;return{raw:d,obj:d,area:(f=h.get(d.toString()))!==null&&f!==void 0?f:null}}),r=!0}let a=!1;if(t||r){const c=this.virtualEdges.concat(this.edges).map(f=>f.obj),u=G_(i,c),h=Math.max(this.o.edgeR1,this.o.nodeR1)+this.o.morphBuffer,d=Or.from(Fb(u,h));d.equals(this.activeRegion)||(a=!0,this.activeRegion=d)}if(a){const c=Math.ceil(this.activeRegion.width/this.o.pixelGroup),u=Math.ceil(this.activeRegion.height/this.o.pixelGroup);this.activeRegion.x!==this.potentialArea.pixelX||this.activeRegion.y!==this.potentialArea.pixelY?(this.potentialArea=Ws.fromPixelRegion(this.activeRegion,this.o.pixelGroup),this.members.forEach(h=>h.area=null),this.nonMembers.forEach(h=>h.area=null),this.edges.forEach(h=>h.area=null),this.virtualEdges.forEach(h=>h.area=null)):(c!==this.potentialArea.width||u!==this.potentialArea.height)&&(this.potentialArea=Ws.fromPixelRegion(this.activeRegion,this.o.pixelGroup))}const s=new Map,o=c=>{if(c.area){const u=`${c.obj.width}x${c.obj.height}x${c.obj instanceof Or?"R":"C"}`;s.set(u,c.area)}},l=c=>{if(c.area)return;const u=`${c.obj.width}x${c.obj.height}x${c.obj instanceof Or?"R":"C"}`;if(s.has(u)){const d=s.get(u);c.area=this.potentialArea.copy(d,{x:c.obj.x-this.o.nodeR1,y:c.obj.y-this.o.nodeR1});return}const h=c.obj instanceof Or?O_(c.obj,this.potentialArea,this.o.nodeR1):jb(c.obj,this.potentialArea,this.o.nodeR1);c.area=h,s.set(u,h)};this.members.forEach(o),this.nonMembers.forEach(o),this.members.forEach(l),this.nonMembers.forEach(c=>{this.activeRegion.intersects(c.obj)?l(c):c.area=null}),this.edges.forEach(c=>{c.area||(c.area=zb(c.obj,this.potentialArea,this.o.edgeR1))}),this.virtualEdges.forEach(c=>{c.area||(c.area=zb(c.obj,this.potentialArea,this.o.edgeR1))})}drawMembers(t){for(const e of this.members)e.obj.draw(t)}drawNonMembers(t){for(const e of this.nonMembers)e.obj.draw(t)}drawEdges(t){for(const e of this.edges)e.obj.draw(t)}drawPotentialArea(t,e=!0){this.potentialArea.draw(t,e)}compute(){if(this.members.length===0)return new Gs([]);this.dirty.size>0&&this.update();const{o:t,potentialArea:e}=this,r=this.members.map(o=>o.area),i=this.virtualEdges.concat(this.edges).map(o=>o.area),a=this.nonMembers.filter(o=>o.area!=null).map(o=>o.area),s=this.members.map(o=>o.obj);return W_(e,r,i,a,o=>o.containsElements(s),t)}}function W_(n,t,e,r,i,a={}){const s=Object.assign({},gh,a);let o=s.threshold,l=s.memberInfluenceFactor,c=s.edgeInfluenceFactor,u=s.nonMemberInfluenceFactor;const h=(s.nodeR0-s.nodeR1)*(s.nodeR0-s.nodeR1),d=(s.edgeR0-s.edgeR1)*(s.edgeR0-s.edgeR1);for(let f=0;f<s.maxMarchingIterations;f++){if(n.clear(),l!==0){const g=l/h;for(const p of t)n.incArea(p,g)}if(c!==0){const g=c/d;for(const p of e)n.incArea(p,g)}if(u!==0){const g=u/h;for(const p of r)n.incArea(p,g)}const v=Z_(n,o);if(v&&i(v))return v;if(o*=.95,f<=s.maxMarchingIterations*.5)l*=1.2,c*=1.2;else if(u!==0&&r.length>0)u*=.8;else break}return new Gs([])}function G_(n,t){if(n.length===0)return new Or(0,0,0,0);const e=Or.from(n[0]);for(const r of n)e.add(r);for(const r of t)e.add(Db(r));return e}function K7(n,t=[],e=[],r={}){if(n.length===0)return new Gs([]);const i=new Hv(r);return i.pushMember(...n),i.pushNonMember(...t),i.pushEdge(...e),i.compute()}var V_=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class ph extends br{constructor(t,e){super(t,pr({},ph.defaultOptions,e)),this.members=new Map,this.avoidMembers=new Map,this.bubbleSetOptions={},this.drawBubbleSets=()=>{const{style:r,bubbleSetOptions:i}=this.parseOptions();Zn(this.bubbleSetOptions,i)||this.init(),this.bubbleSetOptions=Object.assign({},i);const a=Object.assign(Object.assign({},r),{d:this.getPath()});this.shape?this.shape.update(a):(this.shape=new wl({style:a}),this.context.canvas.appendChild(this.shape))},this.updateBubbleSetsPath=r=>{if(!this.shape)return;const i=At(r.data);[...this.options.members,...this.options.avoidMembers].includes(i)&&this.shape.update(Object.assign(Object.assign({},this.parseOptions().style),{d:this.getPath(i)}))},this.getPath=r=>{const{graph:i}=this.context,a=this.options.members,s=[...this.members.keys()],o=this.options.avoidMembers,l=[...this.avoidMembers.keys()];if(!r&&Zn(a,s)&&Zn(o,l))return this.path;const{enter:c=[],exit:u=[]}=za(s,a,p=>p),{enter:h=[],exit:d=[]}=za(l,o,p=>p);r&&(u.push(r),c.push(r));const f=(p,y,b)=>{p.forEach(E=>{const O=b?this.members:this.avoidMembers,P=b?"pushMember":"pushNonMember",L=b?"removeMember":"removeNonMember";if(y){let F;i.getElementType(E)==="edge"?([F]=Y_(i,E),this.bubbleSets.pushEdge(F)):([F]=U_(i,E),this.bubbleSets[P](F)),O.set(E,F)}else{const F=O.get(E);F&&(i.getElementType(E)==="edge"?this.bubbleSets.removeEdge(F):this.bubbleSets[L](F),O.delete(E))}})};f(u,!1,!0),f(c,!0,!0),f(d,!1,!1),f(h,!0,!1);const g=this.bubbleSets.compute().sample(8).simplify(0).bSplines().simplify(0);return this.path=Vy(g.points.map(mr)),this.path},this.bindEvents(),this.bubbleSets=new Hv(this.options)}bindEvents(){this.context.graph.on(Kt.AFTER_RENDER,this.drawBubbleSets),this.context.graph.on(Kt.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath)}init(){this.bubbleSets=new Hv(this.options),this.members=new Map,this.avoidMembers=new Map}parseOptions(){const t=this.options,{type:e,key:r,members:i,avoidMembers:a}=t,s=V_(t,["type","key","members","avoidMembers"]),o=Object.keys(s).reduce((l,c)=>(c in gh?l.bubbleSetOptions[c]=s[c]:l.style[c]=s[c],l),{style:{},bubbleSetOptions:{}});return Object.assign({type:e,key:r,members:i,avoidMembers:a},o)}addMember(t){const e=Array.isArray(t)?t:[t];e.some(r=>this.options.avoidMembers.includes(r))&&(this.options.avoidMembers=this.options.avoidMembers.filter(r=>!e.includes(r))),this.options.members=[...new Set([...this.options.members,...e])],this.drawBubbleSets()}removeMember(t){const e=Array.isArray(t)?t:[t];this.options.members=this.options.members.filter(r=>!e.includes(r)),this.drawBubbleSets()}updateMember(t){this.options.members=fe(t)?t(this.options.members):t,this.drawBubbleSets()}getMember(){return this.options.members}addAvoidMember(t){const e=Array.isArray(t)?t:[t];e.some(r=>this.options.members.includes(r))&&(this.options.members=this.options.members.filter(r=>!e.includes(r))),this.options.avoidMembers=[...new Set([...this.options.avoidMembers,...e])],this.drawBubbleSets()}removeAvoidMember(t){const e=Array.isArray(t)?t:[t];this.options.avoidMembers.some(r=>e.includes(r))&&(this.options.avoidMembers=this.options.avoidMembers.filter(r=>!e.includes(r)),this.drawBubbleSets())}updateAvoidMember(t){this.options.avoidMembers=Array.isArray(t)?t:[t],this.drawBubbleSets()}getAvoidMember(){return this.options.avoidMembers}destroy(){this.context.graph.off(Kt.AFTER_RENDER,this.drawBubbleSets),this.context.graph.off(Kt.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath),this.shape.destroy(),super.destroy()}}ph.defaultOptions=Object.assign({members:[],avoidMembers:[],fill:"lightblue",fillOpacity:.2,stroke:"blue",strokeOpacity:.2},gh);const U_=(n,t)=>(Array.isArray(t)?t:[t]).map(r=>{const i=n.getElementRenderBounds(r);return new Or(i.min[0],i.min[1],ta(i),ea(i))}),Y_=(n,t)=>(Array.isArray(t)?t:[t]).map(r=>{const i=n.getEdgeData(r),a=n.getElementPosition(i.source),s=n.getElementPosition(i.target);return hr.from({x1:a[0],y1:a[1],x2:s[0],y2:s[1]})});class Q7 extends null{constructor(t,e){super(t,e),this.setOptions=r=>{const i={cameraType:"setType",near:"setNear",far:"setFar",fov:"setFov",aspect:"setAspect",projectionMode:"setProjectionMode",distance:"setDistance",minDistance:"setMinDistance",maxDistance:"setMaxDistance",roll:"setRoll",elevation:"setElevation",azimuth:"setAzimuth"},a=(s,o)=>{switch(s){case"projectionMode":return o==="perspective"?1:0;case"cameraType":return{orbiting:0,exploring:1,tracking:2}[o];case"aspect":return typeof o=="number"?o:this.getCanvasAspect();default:return o}};Object.entries(i).forEach(([s,o])=>{const l=r[s];if(l!==void 0){const c=a(s,l);this.context.canvas.getCamera()[o](c)}})},this.bindEvents()}update(t){this.setOptions(t),super.update(t)}bindEvents(){this.context.graph.once(GraphEvent.BEFORE_DRAW,()=>this.setOptions(this.options))}getCanvasAspect(){const[t,e]=this.context.viewport.getCanvasSize();return t/e}}function H_(n){return`
<ul class="g6-contextmenu-ul">
${n.map(t=>`<li class="g6-contextmenu-li" value="${t.value}">${t.name}</li>`).join("")}
</ul>
`}const X_=`
.g6-contextmenu {
font-size: 12px;
background-color: rgba(255, 255, 255, 0.96);
border-radius: 4px;
overflow: hidden;
box-shadow: rgba(0, 0, 0, 0.12) 0px 6px 12px 0px;
transition: visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1) 0s, left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s;
}
.g6-contextmenu-ul {
max-width: 256px;
min-width: 96px;
list-style: none;
padding: 0;
margin: 0;
}
.g6-contextmenu-li {
padding: 8px 12px;
cursor: pointer;
user-select: none;
}
.g6-contextmenu-li:hover {
background-color: #f5f5f5;
cursor: pointer;
}
`;var Gb=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class mh extends br{constructor(t,e){super(t,Object.assign({},mh.defaultOptions,e)),this.targetElement=null,this.onTriggerEvent=r=>{var i;(i=r.preventDefault)===null||i===void 0||i.call(r),this.show(r)},this.onMenuItemClick=r=>{const{onClick:i,trigger:a}=this.options;if(r.target instanceof HTMLElement&&r.target.className.includes("g6-contextmenu-li")){const s=r.target.getAttribute("value");i==null||i(s,r.target,this.targetElement),this.hide()}a!=="click"&&this.hide()},this.initElement(),this.update(e)}initElement(){this.$element=So("contextmenu",!1,{zIndex:"99"});const{className:t}=this.options;t&&this.$element.classList.add(t),this.context.canvas.getContainer().appendChild(this.$element),Gv("g6-contextmenu-css","style",{},X_,document.head)}show(t){return Gb(this,void 0,void 0,function*(){const{enable:e,offset:r}=this.options;if(typeof e=="function"&&!e(t)||!e){this.hide();return}const i=yield this.getDOMContent(t);i instanceof HTMLElement?(this.$element.innerHTML="",this.$element.appendChild(i)):this.$element.innerHTML=i;const a=this.context.graph.getCanvas().getContainer().getBoundingClientRect();this.$element.style.left=`${t.client.x-a.left+r[0]}px`,this.$element.style.top=`${t.client.y-a.top+r[1]}px`,this.$element.style.display="block",this.targetElement=t.target})}hide(){this.$element.style.display="none",this.targetElement=null}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.$element.remove()}getDOMContent(t){return Gb(this,void 0,void 0,function*(){const{getContent:e,getItems:r}=this.options;return r?H_(yield r(t)):yield e(t)})}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.on(`canvas:${e}`,this.onTriggerEvent),t.on(`node:${e}`,this.onTriggerEvent),t.on(`edge:${e}`,this.onTriggerEvent),t.on(`combo:${e}`,this.onTriggerEvent),document.addEventListener("click",this.onMenuItemClick)}unbindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.off(`canvas:${e}`,this.onTriggerEvent),t.off(`node:${e}`,this.onTriggerEvent),t.off(`edge:${e}`,this.onTriggerEvent),t.off(`combo:${e}`,this.onTriggerEvent),document.removeEventListener("click",this.onMenuItemClick)}}mh.defaultOptions={trigger:"contextmenu",offset:[4,4],loadingContent:'<div class="g6-contextmenu-loading">Loading...</div>',getContent:()=>"It is a empty context menu.",enable:()=>!0};class yh extends br{constructor(t,e){super(t,Object.assign({},yh.defaultOptions,e)),this.edgeBundles={},this.edgePoints={},this.onBundle=()=>{const{model:r,element:i}=this.context,a=r.getEdgeData();this.divideEdges(this.options.divisions);const{cycles:s,iterRate:o,divRate:l}=this.options;let{lambda:c,divisions:u,iterations:h}=this.options;for(let d=0;d<s;d++){for(let f=0;f<h;f++){const v={};a.forEach(g=>{var p;if(g.source===g.target)return;const y=At(g);v[y]=this.getEdgeForces(g,u,c);for(let b=0;b<u+1;b++)(p=this.edgePoints)[y]||(p[y]=[]),this.edgePoints[y][b]=Ne(this.edgePoints[y][b],v[y][b])})}c/=2,u*=l,h*=o,this.divideEdges(u)}a.forEach(d=>{const f=At(d),v=i.getElement(f);v==null||v.update({d:dv(this.edgePoints[f])})})},this.bindEvents()}get nodeMap(){const t=this.context.model.getNodeData();return Object.fromEntries(t.map(e=>[At(e),Rs(ir(e))]))}divideEdges(t){this.context.model.getEdgeData().forEach(r=>{var i;const a=At(r);(i=this.edgePoints)[a]||(i[a]=[]);const s=this.nodeMap[r.source],o=this.nodeMap[r.target];if(t===1)this.edgePoints[a].push(s),this.edgePoints[a].push(Ii(Ne(s,o),2)),this.edgePoints[a].push(o);else{const c=(this.edgePoints[a].length===0?bn(s,o):$_(this.edgePoints[a]))/(t+1);let u=c;const h=[s];for(let d=1;d<this.edgePoints[a].length;d++){const f=this.edgePoints[a][d-1],v=this.edgePoints[a][d];let g=bn(v,f);for(;g>u;){const p=u/g,y=Ne(f,Di(ln(v,f),p));h.push(y),g-=u,u=c}u-=g}h.push(o),this.edgePoints[a]=h}})}getVectorPosition(t){const e=this.nodeMap[t.source],r=this.nodeMap[t.target],[i,a]=ln(r,e),s=bn(e,r);return{source:e,target:r,vx:i,vy:a,length:s}}measureEdgeCompatibility(t,e){const r=this.getVectorPosition(t),i=this.getVectorPosition(e),a=K_(r,i),s=Q_(r,i),o=q_(r,i),l=J_(r,i);return a*s*o*l}getEdgeBundles(){const t={},e=this.options.bundleThreshold,r=this.context.model.getEdgeData();return r.forEach((i,a)=>{r.forEach((s,o)=>{var l,c;if(o<=a)return;this.measureEdgeCompatibility(i,s)>=e&&(t[l=At(i)]||(t[l]=[]),t[At(i)].push(s),t[c=At(s)]||(t[c]=[]),t[At(s)].push(i))})}),t}getSpringForce(t,e){const{pre:r,cur:i,next:a}=t;return Di(ln(Ne(r,a),Di(i,2)),e)}getElectrostaticForce(t,e){ra(this.edgeBundles)&&(this.edgeBundles=this.getEdgeBundles());const r=this.edgeBundles[At(e)];let i=[0,0];return r==null||r.forEach(a=>{const s=this.edgePoints[At(a)][t],o=this.edgePoints[At(e)][t],l=ln(s,o),c=bn(s,o);i=Ne(i,Di(l,1/c))}),i}getEdgeForces(t,e,r){const i=this.nodeMap[t.source],a=this.nodeMap[t.target],s=this.options.K/(bn(i,a)*(e+1)),o=[[0,0]],l=At(t);for(let c=1;c<e;c++){const u=this.getSpringForce({pre:this.edgePoints[l][c-1],cur:this.edgePoints[l][c],next:this.edgePoints[l][c+1]||[0,0]},s),h=this.getElectrostaticForce(c,t);o.push(Di(Ne(u,h),r))}return o.push([0,0]),o}bindEvents(){const{graph:t}=this.context;t.on(Kt.AFTER_RENDER,this.onBundle)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.AFTER_RENDER,this.onBundle)}destroy(){this.unbindEvents(),super.destroy()}}yh.defaultOptions={K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:2/3,bundleThreshold:.6};const K_=(n,t)=>Math.abs(yN([n.vx,n.vy],[t.vx,t.vy])/(n.length*t.length)),Q_=(n,t)=>{const e=(n.length+t.length)/2;return 2/(e/Math.min(n.length,t.length)+Math.max(n.length,t.length)/e)},q_=(n,t)=>{const e=(n.length+t.length)/2,r=Ii(Ne(n.source,n.target),2),i=Ii(Ne(t.source,t.target),2);return e/(e+bn(r,i))},Vb=(n,t)=>{if(t.source[0]===t.target[0])return[t.source[0],n[1]];if(t.source[1]===t.target[1])return[n[0],t.source[1]];const e=(t.source[1]-t.target[1])/(t.source[0]-t.target[0]),r=(e*e*t.source[0]+e*(n[1]-t.source[1])+n[0])/(e*e+1),i=e*(r-t.source[0])+t.source[1];return[r,i]},Ub=(n,t)=>{const e=Vb(t.source,n),r=Vb(t.target,n),i=Ii(Ne(e,r),2),a=Ii(Ne(n.source,n.target),2);return bn(e,r)===0?0:Math.max(0,1-2*bn(a,i)/bn(e,r))},J_=(n,t)=>Math.min(Ub(n,t),Ub(t,n)),$_=n=>{let t=0;for(let e=1;e<n.length;e++)t+=bn(n[e],n[e-1]);return t},tD={fill:"#fff",fillOpacity:1,lineWidth:1,stroke:"#000",strokeOpacity:.8,zIndex:-1/0},Yb=.05;class bh extends br{constructor(t,e){super(t,Object.assign({},bh.defaultOptions,e)),this.shapes=new Map,this.r=this.options.r,this.onEdgeFilter=r=>{if(this.options.trigger==="drag"&&this.isLensOn)return;const i=mr(r.canvas);this.renderLens(i),this.renderFocusElements()},this.renderLens=r=>{const i=Object.assign({},tD,this.options.style);this.isLensOn||(this.lens=new Ds({style:i}),this.canvas.appendChild(this.lens)),Object.assign(i,Bi(r),{size:this.r*2}),this.lens.update(i)},this.getFilterData=()=>{const{filter:r}=this.options,{model:i}=this.context,a=i.getData();if(!r)return a;const{nodes:s,edges:o,combos:l}=a;return{nodes:s.filter(c=>r(At(c),"node")),edges:o.filter(c=>r(At(c),"edge")),combos:l.filter(c=>r(At(c),"combo"))}},this.getFocusElements=r=>{const{nodes:i,edges:a}=this.getFilterData(),s=i.filter(c=>bn(ir(c),r)<this.r),o=s.map(c=>At(c)),l=a.filter(c=>{const{source:u,target:h}=c,d=o.includes(u),f=o.includes(h);switch(this.options.nodeType){case"both":return d&&f;case"either":return d!==f;case"source":return d&&!f;case"target":return!d&&f;default:return!1}});return{nodes:s,edges:l}},this.renderFocusElements=()=>{const{element:r,graph:i}=this.context;if(!this.isLensOn)return;const a=this.lens.getCenter(),{nodes:s,edges:o}=this.getFocusElements(a),l=new Set,c=u=>{const h=At(u);l.add(h);const d=r.getElement(h);if(!d)return;const f=this.shapes.get(h)||d.cloneNode();f.setPosition(d.getPosition()),f.id=d.id,this.shapes.has(h)?Object.entries(d.attributes).forEach(([p,y])=>{f.style[p]!==y&&(f.style[p]=y)}):(this.canvas.appendChild(f),this.shapes.set(h,f));const v=i.getElementType(h),g=this.getElementStyle(v,u);f.update(g)};s.forEach(c),o.forEach(c),this.shapes.forEach((u,h)=>{l.has(h)||(u.destroy(),this.shapes.delete(h))})},this.scaleRByWheel=r=>{var i;this.options.preventDefault&&r.preventDefault();const{clientX:a,clientY:s,deltaX:o,deltaY:l}=r,{graph:c,canvas:u}=this.context,h=c.getCanvasByClient([a,s]),d=(i=this.lens)===null||i===void 0?void 0:i.getCenter();if(!this.isLensOn||bn(h,d)>this.r)return;const{maxR:f,minR:v}=this.options,g=o+l>0?1/(1-Yb):1-Yb,p=Math.min(...u.getSize())/2;this.r=Math.max(v||0,Math.min(f||p,this.r*g)),this.renderLens(d),this.renderFocusElements()},this.isLensDragging=!1,this.onDragStart=r=>{var i;const a=mr(r.canvas),s=(i=this.lens)===null||i===void 0?void 0:i.getCenter();!this.isLensOn||bn(a,s)>this.r||(this.isLensDragging=!0)},this.onDrag=r=>{if(!this.isLensDragging)return;const i=mr(r.canvas);this.renderLens(i),this.renderFocusElements()},this.onDragEnd=()=>{this.isLensDragging=!1},this.bindEvents()}get canvas(){return this.context.canvas.getLayer("transient")}get isLensOn(){return this.lens&&!this.lens.destroyed}getElementStyle(t,e){const r=t==="node"?this.options.nodeStyle:this.options.edgeStyle;return typeof r=="function"?r(e):r}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var t;const{graph:e}=this.context,{trigger:r,scaleRBy:i}=this.options,a=e.getCanvas().getLayer();["click","drag"].includes(r)&&a.addEventListener(Bt.CLICK,this.onEdgeFilter),r==="pointermove"?a.addEventListener(Bt.POINTER_MOVE,this.onEdgeFilter):r==="drag"&&(a.addEventListener(Bt.DRAG_START,this.onDragStart),a.addEventListener(Bt.DRAG,this.onDrag),a.addEventListener(Bt.DRAG_END,this.onDragEnd)),i==="wheel"&&((t=this.graphDom)===null||t===void 0||t.addEventListener(Bt.WHEEL,this.scaleRByWheel,{passive:!1}))}unbindEvents(){var t;const{graph:e}=this.context,{trigger:r,scaleRBy:i}=this.options,a=e.getCanvas().getLayer();["click","drag"].includes(r)&&a.removeEventListener(Bt.CLICK,this.onEdgeFilter),r==="pointermove"?a.removeEventListener(Bt.POINTER_MOVE,this.onEdgeFilter):r==="drag"&&(a.removeEventListener(Bt.DRAG_START,this.onDragStart),a.removeEventListener(Bt.DRAG,this.onDrag),a.removeEventListener(Bt.DRAG_END,this.onDragEnd)),i==="wheel"&&((t=this.graphDom)===null||t===void 0||t.removeEventListener(Bt.WHEEL,this.scaleRByWheel))}update(t){var e;this.unbindEvents(),super.update(t),this.r=(e=t.r)!==null&&e!==void 0?e:this.r,this.bindEvents()}destroy(){this.unbindEvents(),this.isLensOn&&this.lens.destroy(),this.shapes.forEach((t,e)=>{t.destroy(),this.shapes.delete(e)}),super.destroy()}}bh.defaultOptions={trigger:"pointermove",r:60,nodeType:"both",filter:()=>!0,style:{lineWidth:2},nodeStyle:{label:!1},edgeStyle:{label:!0},scaleRBy:"wheel",preventDefault:!0};const eD={fill:"#ccc",fillOpacity:.1,lineWidth:2,stroke:"#000",strokeOpacity:.8,labelFontSize:12},Hb=.05,Xb=.1;class xh extends br{constructor(t,e){super(t,Object.assign({},xh.defaultOptions,e)),this.r=this.options.r,this.d=this.options.d,this.onCreateFisheye=r=>{if(this.options.trigger==="drag"&&this.isLensOn)return;const i=mr(r.canvas);this.onMagnify(i)},this.onMagnify=r=>{r.some(isNaN)||(this.renderLens(r),this.renderFocusElements())},this.renderLens=r=>{const i=Object.assign({},eD,this.options.style);this.isLensOn||(this.lens=new Ds({style:i}),this.canvas.appendChild(this.lens)),Object.assign(i,Bi(r),{size:this.r*2,label:this.options.showDPercent,labelText:this.getDPercent()}),this.lens.update(i)},this.getDPercent=()=>{const{minD:r,maxD:i}=this.options;return`${Math.round((this.d-r)/(i-r)*100)}%`},this.prevMagnifiedStyleMap=new Map,this.prevOriginStyleMap=new Map,this.renderFocusElements=()=>{if(!this.isLensOn)return;const{graph:r}=this.context,i=this.lens.getCenter(),a=(this.d+1)*this.r,s=new Map,o=new Map;r.getNodeData().forEach(c=>{const u=ir(c),h=bn(u,i);if(h>this.r)return;const d=a*h/(this.d*h+this.r),[f,v]=u,[g,p]=i,y=(f-g)/h,b=(v-p)/h,E=[g+d*y,p+d*b],O=At(c),P=this.getNodeStyle(c),L=Bs(r.getElementRenderStyle(O),Object.keys(P));s.set(O,Object.assign(Object.assign({},Bi(E)),P)),o.set(O,Object.assign(Object.assign({},Bi(u)),L))}),this.updateStyle(s,o)},this.getNodeStyle=r=>{const{nodeStyle:i}=this.options;return typeof i=="function"?i(r):i},this.updateStyle=(r,i)=>{const{graph:a,element:s}=this.context,{enter:o,exit:l,keep:c}=za(Array.from(this.prevMagnifiedStyleMap.keys()),Array.from(r.keys()),d=>d),u=new Set,h=(d,f)=>{const v=s.getElement(d);v==null||v.update(f),a.getRelatedEdgesData(d).forEach(g=>{u.add(At(g))})};[...o,...c].forEach(d=>{h(d,r.get(d))}),l.forEach(d=>{h(d,this.prevOriginStyleMap.get(d)),this.prevOriginStyleMap.delete(d)}),u.forEach(d=>{const f=s.getElement(d);f==null||f.update({})}),this.prevMagnifiedStyleMap=r,i.forEach((d,f)=>{this.prevOriginStyleMap.has(f)||this.prevOriginStyleMap.set(f,d)})},this.isWheelValid=r=>{if(this.options.preventDefault&&r.preventDefault(),!this.isLensOn)return!1;const{clientX:i,clientY:a}=r,s=this.context.graph.getCanvasByClient([i,a]),o=this.lens.getCenter();return!(bn(s,o)>this.r)},this.scaleR=r=>{const{maxR:i,minR:a}=this.options,s=r?1/(1-Hb):1-Hb,o=Math.min(...this.context.canvas.getSize())/2;this.r=Math.max(a||0,Math.min(i||o,this.r*s))},this.scaleD=r=>{const{maxD:i,minD:a}=this.options,s=r?this.d+Xb:this.d-Xb;this.d=Math.max(a,Math.min(i,s))},this.scaleRByWheel=r=>{if(!this.isWheelValid(r))return;const{deltaX:i,deltaY:a}=r;this.scaleR(i+a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.scaleDByWheel=r=>{if(!this.isWheelValid(r))return;const{deltaX:i,deltaY:a}=r;this.scaleD(i+a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.isDragValid=r=>{if(this.options.preventDefault&&r.preventDefault(),!this.isLensOn)return!1;const i=mr(r.canvas),a=this.lens.getCenter();return!(bn(i,a)>this.r)},this.isLensDragging=!1,this.onDragStart=r=>{this.isDragValid(r)&&(this.isLensDragging=!0)},this.onDrag=r=>{if(!this.isLensDragging)return;const i=mr(r.canvas);this.onMagnify(i)},this.onDragEnd=()=>{this.isLensDragging=!1},this.scaleRByDrag=r=>{if(!this.isLensDragging)return;const{dx:i,dy:a}=r;this.scaleR(i-a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.scaleDByDrag=r=>{if(!this.isLensDragging)return;const{dx:i,dy:a}=r;this.scaleD(i-a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.bindEvents()}get canvas(){return this.context.canvas.getLayer("transient")}get isLensOn(){return this.lens&&!this.lens.destroyed}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var t;const{graph:e}=this.context,{trigger:r,scaleRBy:i,scaleDBy:a}=this.options,s=e.getCanvas().getLayer();if(["click","drag"].includes(r)&&s.addEventListener(Bt.CLICK,this.onCreateFisheye),r==="pointermove"&&s.addEventListener(Bt.POINTER_MOVE,this.onCreateFisheye),r==="drag"||i==="drag"||a==="drag"){s.addEventListener(Bt.DRAG_START,this.onDragStart),s.addEventListener(Bt.DRAG_END,this.onDragEnd);const o=r==="drag"?this.onDrag:i==="drag"?this.scaleRByDrag:this.scaleDByDrag;s.addEventListener(Bt.DRAG,o)}if(i==="wheel"||a==="wheel"){const o=i==="wheel"?this.scaleRByWheel:this.scaleDByWheel;(t=this.graphDom)===null||t===void 0||t.addEventListener(Bt.WHEEL,o,{passive:!1})}}unbindEvents(){var t;const{graph:e}=this.context,{trigger:r,scaleRBy:i,scaleDBy:a}=this.options,s=e.getCanvas().getLayer();if(["click","drag"].includes(r)&&s.removeEventListener(Bt.CLICK,this.onCreateFisheye),r==="pointermove"&&s.removeEventListener(Bt.POINTER_MOVE,this.onCreateFisheye),r==="drag"||i==="drag"||a==="drag"){s.removeEventListener(Bt.DRAG_START,this.onDragStart),s.removeEventListener(Bt.DRAG_END,this.onDragEnd);const o=r==="drag"?this.onDrag:i==="drag"?this.scaleRByDrag:this.scaleDByDrag;s.removeEventListener(Bt.DRAG,o)}if(i==="wheel"||a==="wheel"){const o=i==="wheel"?this.scaleRByWheel:this.scaleDByWheel;(t=this.graphDom)===null||t===void 0||t.removeEventListener(Bt.WHEEL,o)}}update(t){var e,r;this.unbindEvents(),super.update(t),this.r=(e=t.r)!==null&&e!==void 0?e:this.r,this.d=(r=t.d)!==null&&r!==void 0?r:this.d,this.bindEvents()}destroy(){var t;this.unbindEvents(),this.isLensOn&&((t=this.lens)===null||t===void 0||t.destroy()),this.prevMagnifiedStyleMap.clear(),this.prevOriginStyleMap.clear(),super.destroy()}}xh.defaultOptions={trigger:"pointermove",r:120,d:1.5,maxD:5,minD:0,showDPercent:!0,style:{},nodeStyle:{label:!0},preventDefault:!0};class Eh extends br{constructor(t,e){super(t,Object.assign({},Eh.defaultOptions,e)),this.$el=this.context.canvas.getContainer(),this.graphSize=[0,0],this.onFullscreenChange=()=>{var r,i,a,s;const o=!!document.fullscreenElement;this.options.autoFit&&this.setGraphSize(o),o?(i=(r=this.options).onEnter)===null||i===void 0||i.call(r):(s=(a=this.options).onExit)===null||s===void 0||s.call(a)},this.shortcut=new go(t.graph),this.bindEvents(),this.style=document.createElement("style"),document.head.appendChild(this.style),this.style.innerHTML=`
:not(:root):fullscreen::backdrop {
background: transparent;
}
`}bindEvents(){this.unbindEvents(),this.shortcut.unbindAll();const{request:t=[],exit:e=[]}=this.options.trigger;this.shortcut.bind(t,this.request),this.shortcut.bind(e,this.exit),["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach(i=>{document.addEventListener(i,this.onFullscreenChange,!1)})}unbindEvents(){this.shortcut.unbindAll(),["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach(e=>{document.removeEventListener(e,this.onFullscreenChange,!1)})}setGraphSize(t=!0){var e,r;let i,a;t?(i=((e=globalThis.screen)===null||e===void 0?void 0:e.width)||0,a=((r=globalThis.screen)===null||r===void 0?void 0:r.height)||0,this.graphSize=this.context.graph.getSize()):[i,a]=this.graphSize,this.context.graph.setSize(i,a),this.context.graph.render()}request(){document.fullscreenElement||!nD()||this.$el.requestFullscreen().catch(t=>{Xr.warn(`Error attempting to enable full-screen: ${t.message} (${t.name})`)})}exit(){document.fullscreenElement&&document.exitFullscreen()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.exit(),this.style.remove(),super.destroy()}}Eh.defaultOptions={trigger:{},autoFit:!0};function nD(){return document.fullscreenEnabled||Reflect.get(document,"webkitFullscreenEnabled")||Reflect.get(document,"mozFullscreenEnabled")||Reflect.get(document,"msFullscreenEnabled")}class wh extends br{constructor(t,e){super(t,Object.assign({},wh.defaultOptions,e)),this.$element=So("grid-line",!0),this.offset=[0,0],this.currentScale=1,this.followZoom=i=>{const{data:{scale:a,origin:s}}=i;if(!a)return;const o=this.currentScale;this.currentScale=a;const l=a/o,c=Di(s||this.context.graph.getCanvasCenter(),1-l),u=this.baseSize*a,h=Di(this.offset,l),d=Uf(h,u),f=Ne(d,c);this.$element.style.backgroundSize=`${u}px ${u}px`,this.$element.style.backgroundPosition=`${f[0]}px ${f[1]}px`,this.offset=Uf(f,u)},this.followTranslate=i=>{if(!this.options.follow)return;const{data:{translate:a}}=i;a&&this.updateOffset(a)},this.onTransform=i=>{const a=this.parseFollow(this.options.follow);a.zoom&&this.followZoom(i),a.translate&&this.followTranslate(i)},this.context.canvas.getContainer().prepend(this.$element),this.baseSize=this.options.size,this.updateStyle(),this.bindEvents()}update(t){super.update(t),t.size!==void 0&&(this.baseSize=t.size),this.updateStyle()}bindEvents(){const{graph:t}=this.context;t.on(Kt.AFTER_TRANSFORM,this.onTransform)}updateStyle(){const{stroke:t,lineWidth:e,border:r,borderLineWidth:i,borderStroke:a,borderStyle:s}=this.options,o=this.baseSize*this.currentScale;Object.assign(this.$element.style,{border:r?`${i}px ${s} ${a}`:"none",backgroundImage:`linear-gradient(${t} ${e}px, transparent ${e}px), linear-gradient(90deg, ${t} ${e}px, transparent ${e}px)`,backgroundSize:`${o}px ${o}px`,backgroundRepeat:"repeat"})}updateOffset(t){const e=this.baseSize*this.currentScale;this.offset=Uf(Ne(this.offset,t),e),this.$element.style.backgroundPosition=`${this.offset[0]}px ${this.offset[1]}px`}parseFollow(t){var e,r;return Uo(t)?{translate:t,zoom:t}:{translate:(e=t==null?void 0:t.translate)!==null&&e!==void 0?e:!1,zoom:(r=t==null?void 0:t.zoom)!==null&&r!==void 0?r:!1}}destroy(){this.context.graph.off(Kt.AFTER_TRANSFORM,this.onTransform),this.$element.remove(),super.destroy()}}wh.defaultOptions={border:!0,borderLineWidth:1,borderStroke:"#eee",borderStyle:"solid",lineWidth:1,size:20,stroke:"#eee"};function Xv(n){const t={Added:new Map,Updated:new Map,Removed:new Map};return n.forEach(e=>{const{type:r,value:i}=e,a=At(i);if(r==="NodeAdded"||r==="EdgeAdded"||r==="ComboAdded")t.Added.set(a,e);else if(r==="NodeUpdated"||r==="EdgeUpdated"||r==="ComboUpdated")if(t.Added.has(a))t.Added.set(a,{type:r.replace("Updated","Added"),value:i});else if(t.Updated.has(a)){const{original:s}=t.Updated.get(a);t.Updated.set(a,{type:r,value:i,original:s})}else t.Removed.has(a)||t.Updated.set(a,e);else(r==="NodeRemoved"||r==="EdgeRemoved"||r==="ComboRemoved")&&(t.Added.has(a)?t.Added.delete(a):(t.Updated.has(a)&&t.Updated.delete(a),t.Removed.set(a,e)))}),[...Array.from(t.Added.values()),...Array.from(t.Updated.values()),...Array.from(t.Removed.values())]}function Kb(n){const{NodeAdded:t=[],NodeUpdated:e=[],NodeRemoved:r=[],EdgeAdded:i=[],EdgeUpdated:a=[],EdgeRemoved:s=[],ComboAdded:o=[],ComboUpdated:l=[],ComboRemoved:c=[]}=Xc(n,u=>u.type);return{add:{nodes:t,edges:i,combos:o},update:{nodes:e,edges:a,combos:l},remove:{nodes:r,edges:s,combos:c}}}function Qb(n,t){for(const e in n)Fn(n[e])&&!Array.isArray(n[e])&&n[e]!==null?(t[e]||(t[e]={}),Qb(n[e],t[e])):t[e]===void 0&&(t[e]=hl(e))}function rD(n,t=!1,e){const r={animation:t,current:{add:{},update:{},remove:{}},original:{add:{},update:{},remove:{}}},{add:i,update:a,remove:s}=Kb(Xv(n));return["nodes","edges","combos"].forEach(o=>{a[o]&&a[o].forEach(l=>{var c,u;const h=Object.assign({},l.value);let d=Object.assign({},l.original);if(e){const f=e.graph.getElementType(At(l.original)),v=f==="edge"?"stroke":"fill",g=e.element.getElementComputedStyle(f,l.original);d=Object.assign(Object.assign({},l.original),{style:Object.assign({[v]:g[v]},l.original.style)})}Qb(h,d),(c=r.current.update)[o]||(c[o]=[]),r.current.update[o].push(h),(u=r.original.update)[o]||(u[o]=[]),r.original.update[o].push(d)}),i[o]&&i[o].forEach(l=>{var c,u;const h=Object.assign({},l.value);(c=r.current.add)[o]||(c[o]=[]),r.current.add[o].push(h),(u=r.original.remove)[o]||(u[o]=[]),r.original.remove[o].push(h)}),s[o]&&s[o].forEach(l=>{var c,u;const h=Object.assign({},l.value);(c=r.current.remove)[o]||(c[o]=[]),r.current.remove[o].push(h),(u=r.original.add)[o]||(u[o]=[]),r.original.add[o].push(h)})}),r}class Sh extends br{constructor(t,e){super(t,Object.assign({},Sh.defaultOptions,e)),this.batchChanges=null,this.batchAnimation=!1,this.undoStack=[],this.redoStack=[],this.freezed=!1,this.executeCommand=(i,a=!0)=>{var s,o,l;this.freezed=!0,(o=(s=this.options).executeCommand)===null||o===void 0||o.call(s,i);const c=a?i.original:i.current;this.context.graph.addData(c.add),this.context.graph.updateData(c.update),this.context.graph.removeData(my(c.remove,!1)),(l=this.context.element)===null||l===void 0||l.draw({silence:!0,animation:i.animation}),this.freezed=!1},this.addCommand=i=>{var a;if(!this.freezed){if(i.type===Kt.AFTER_DRAW){const{dataChanges:s=[],animation:o=!0}=i.data;if(!((a=this.context.batch)===null||a===void 0)&&a.isBatching){if(!this.batchChanges)return;this.batchChanges.push(s),this.batchAnimation&&(this.batchAnimation=o);return}this.batchChanges=[s],this.batchAnimation=o}this.undoStackPush(rD(this.batchChanges.flat(),this.batchAnimation,this.context)),this.notify(Da.ADD,this.undoStack[this.undoStack.length-1])}},this.initBatchCommand=i=>{const{initiate:a}=i.data;this.batchAnimation=!1,a?this.batchChanges=[]:this.undoStack.pop()||(this.batchChanges=null)},this.emitter=new Uu;const{graph:r}=this.context;r.on(Kt.AFTER_DRAW,this.addCommand),r.on(Kt.BATCH_START,this.initBatchCommand),r.on(Kt.BATCH_END,this.addCommand)}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){var t,e,r,i;const a=this.undoStack.pop();if(a){if(this.executeCommand(a),((e=(t=this.options).beforeAddCommand)===null||e===void 0?void 0:e.call(t,a,!1))===!1)return;this.redoStack.push(a),(i=(r=this.options).afterAddCommand)===null||i===void 0||i.call(r,a,!1),this.notify(Da.UNDO,a)}return this}redo(){const t=this.redoStack.pop();return t&&(this.executeCommand(t,!1),this.undoStackPush(t),this.notify(Da.REDO,t)),this}undoAndCancel(){const t=this.undoStack.pop();return t&&(this.executeCommand(t,!1),this.redoStack=[],this.notify(Da.CANCEL,t)),this}undoStackPush(t){var e,r,i,a;const{stackSize:s}=this.options;s!==0&&this.undoStack.length>=s&&this.undoStack.shift(),((r=(e=this.options).beforeAddCommand)===null||r===void 0?void 0:r.call(e,t,!0))!==!1&&(this.undoStack.push(t),(a=(i=this.options).afterAddCommand)===null||a===void 0||a.call(i,t,!0))}clear(){this.undoStack=[],this.redoStack=[],this.batchChanges=null,this.batchAnimation=!1,this.notify(Da.CLEAR,null)}notify(t,e){this.emitter.emit(t,{cmd:e}),this.emitter.emit(Da.CHANGE,{cmd:e})}on(t,e){this.emitter.on(t,e)}destroy(){const{graph:t}=this.context;t.off(Kt.AFTER_DRAW,this.addCommand),t.off(Kt.BATCH_START,this.initBatchCommand),t.off(Kt.BATCH_END,this.addCommand),this.emitter.off(),super.destroy(),this.undoStack=[],this.redoStack=[]}}Sh.defaultOptions={stackSize:0};const Kv={toXy(n,t){if(!t)return[...n];const e=t[0].slice(1),r=t[1].slice(1);return n.map(i=>[i[e],i[r]])},fromXy(n,t){if(!t)return[...n];const e=t[0].slice(1),r=t[1].slice(1);return n.map(([i,a])=>({[e]:i,[r]:a}))}};class iD{constructor(t,e){this._cells=[],this._cellSize=e,this._reverseCellSize=1/e;for(const r of t){const i=this.coordToCellNum(r[0]),a=this.coordToCellNum(r[1]);this._cells[i]||(this._cells[i]=[]),this._cells[i][a]||(this._cells[i][a]=[]),this._cells[i][a].push(r)}}cellPoints(t,e){var r;return((r=this._cells[t])===null||r===void 0?void 0:r[e])||[]}rangePoints(t){const e=this.coordToCellNum(t[0]),r=this.coordToCellNum(t[1]),i=this.coordToCellNum(t[2]),a=this.coordToCellNum(t[3]),s=[];for(let o=e;o<=i;o++)for(let l=r;l<=a;l++){const c=this.cellPoints(o,l);for(const u of c)s.push(u)}return s}removePoint(t){const e=this.coordToCellNum(t[0]),r=this.coordToCellNum(t[1]),i=this._cells[e][r],a=i.findIndex(([s,o])=>s===t[0]&&o===t[1]);return a>-1&&i.splice(a,1),i}trunc(t){return Math.trunc(t)}coordToCellNum(t){return this.trunc(t*this._reverseCellSize)}extendBbox(t,e){return[t[0]-e*this._cellSize,t[1]-e*this._cellSize,t[2]+e*this._cellSize,t[3]+e*this._cellSize]}}function aD(n,t){return new iD(n,t)}const qb=+(Math.pow(2,27)+1);function Mh(n,t,e){const r=n*t,i=qb*n,a=i-n,s=i-a,o=n-s,l=qb*t,c=l-t,u=l-c,h=t-u,v=r-s*u-o*u-s*h,g=o*h-v;return e?(e[0]=g,e[1]=r,e):[g,r]}function sD(n,t,e){const r=n+t,i=r-n,a=r-i,s=t-i,o=n-a;return e?(e[0]=o+s,e[1]=r,e):[o+s,r]}function oD(n,t){const e=n.length;if(e===1){const o=Mh(n[0],t);return o[0]?o:[o[1]]}const r=new Array(2*e),i=[.1,.1],a=[.1,.1];let s=0;Mh(n[0],t,i),i[0]&&(r[s++]=i[0]);for(let o=1;o<e;++o){Mh(n[o],t,a);const l=i[1];sD(l,a[0],i),i[0]&&(r[s++]=i[0]);const c=a[1],u=i[1],h=c+u,d=h-c,f=u-d;i[1]=h,f&&(r[s++]=f)}return i[1]&&(r[s++]=i[1]),s===0&&(r[s++]=0),r.length=s,r}function lD(n,t){const e=n+t,r=e-n,i=e-r,a=t-r,o=n-i+a;return o?[o,e]:[e]}function cD(n,t){const e=n.length|0,r=t.length|0;if(e===1&&r===1)return lD(n[0],-t[0]);const i=e+r,a=new Array(i);let s=0,o=0,l=0;const c=Math.abs;let u=n[o],h=c(u),d=-t[l],f=c(d),v,g;h<f?(g=u,o+=1,o<e&&(u=n[o],h=c(u))):(g=d,l+=1,l<r&&(d=-t[l],f=c(d))),o<e&&h<f||l>=r?(v=u,o+=1,o<e&&(u=n[o],h=c(u))):(v=d,l+=1,l<r&&(d=-t[l],f=c(d)));let p=v+g,y=p-v,b=g-y,E=b,O=p,P,L,F,I,V;for(;o<e&&l<r;)h<f?(v=u,o+=1,o<e&&(u=n[o],h=c(u))):(v=d,l+=1,l<r&&(d=-t[l],f=c(d))),g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,L=P-O,F=P-L,I=p-L,V=O-F,E=V+I,O=P;for(;o<e;)v=u,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,L=P-O,F=P-L,I=p-L,V=O-F,E=V+I,O=P,o+=1,o<e&&(u=n[o]);for(;l<r;)v=d,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,L=P-O,F=P-L,I=p-L,V=O-F,E=V+I,O=P,l+=1,l<r&&(d=-t[l]);return E&&(a[s++]=E),O&&(a[s++]=O),s||(a[s++]=0),a.length=s,a}function uD(n,t){const e=n+t,r=e-n,i=e-r,a=t-r,o=n-i+a;return o?[o,e]:[e]}function hD(n,t){const e=n.length|0,r=t.length|0;if(e===1&&r===1)return uD(n[0],t[0]);const i=e+r,a=new Array(i);let s=0,o=0,l=0;const c=Math.abs;let u=n[o],h=c(u),d=t[l],f=c(d),v,g;h<f?(g=u,o+=1,o<e&&(u=n[o],h=c(u))):(g=d,l+=1,l<r&&(d=t[l],f=c(d))),o<e&&h<f||l>=r?(v=u,o+=1,o<e&&(u=n[o],h=c(u))):(v=d,l+=1,l<r&&(d=t[l],f=c(d)));let p=v+g,y=p-v,b=g-y,E=b,O=p,P,L,F,I,V;for(;o<e&&l<r;)h<f?(v=u,o+=1,o<e&&(u=n[o],h=c(u))):(v=d,l+=1,l<r&&(d=t[l],f=c(d))),g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,L=P-O,F=P-L,I=p-L,V=O-F,E=V+I,O=P;for(;o<e;)v=u,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,L=P-O,F=P-L,I=p-L,V=O-F,E=V+I,O=P,o+=1,o<e&&(u=n[o]);for(;l<r;)v=d,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),P=O+p,L=P-O,F=P-L,I=p-L,V=O-F,E=V+I,O=P,l+=1,l<r&&(d=t[l]);return E&&(a[s++]=E),O&&(a[s++]=O),s||(a[s++]=0),a.length=s,a}const Jb=5,Ah=11102230246251565e-32,dD=(3+16*Ah)*Ah,fD=(7+56*Ah)*Ah;function vD(n,t,e,r){return function(a,s,o){const l=n(n(t(s[1],o[0]),t(-o[1],s[0])),n(t(a[1],s[0]),t(-s[1],a[0]))),c=n(t(a[1],o[0]),t(-o[1],a[0])),u=r(l,c);return u[u.length-1]}}function gD(n,t,e,r){return function(a,s,o,l){const c=n(n(e(n(t(o[1],l[0]),t(-l[1],o[0])),s[2]),n(e(n(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),e(n(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),n(e(n(t(s[1],l[0]),t(-l[1],s[0])),a[2]),n(e(n(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),e(n(t(a[1],s[0]),t(-s[1],a[0])),l[2])))),u=n(n(e(n(t(o[1],l[0]),t(-l[1],o[0])),a[2]),n(e(n(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),e(n(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),n(e(n(t(s[1],o[0]),t(-o[1],s[0])),a[2]),n(e(n(t(a[1],o[0]),t(-o[1],a[0])),-s[2]),e(n(t(a[1],s[0]),t(-s[1],a[0])),o[2])))),h=r(c,u);return h[h.length-1]}}function pD(n,t,e,r){return function(a,s,o,l,c){const u=n(n(n(e(n(e(n(t(l[1],c[0]),t(-c[1],l[0])),o[2]),n(e(n(t(o[1],c[0]),t(-c[1],o[0])),-l[2]),e(n(t(o[1],l[0]),t(-l[1],o[0])),c[2]))),s[3]),n(e(n(e(n(t(l[1],c[0]),t(-c[1],l[0])),s[2]),n(e(n(t(s[1],c[0]),t(-c[1],s[0])),-l[2]),e(n(t(s[1],l[0]),t(-l[1],s[0])),c[2]))),-o[3]),e(n(e(n(t(o[1],c[0]),t(-c[1],o[0])),s[2]),n(e(n(t(s[1],c[0]),t(-c[1],s[0])),-o[2]),e(n(t(s[1],o[0]),t(-o[1],s[0])),c[2]))),l[3]))),n(e(n(e(n(t(o[1],l[0]),t(-l[1],o[0])),s[2]),n(e(n(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),e(n(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),-c[3]),n(e(n(e(n(t(l[1],c[0]),t(-c[1],l[0])),s[2]),n(e(n(t(s[1],c[0]),t(-c[1],s[0])),-l[2]),e(n(t(s[1],l[0]),t(-l[1],s[0])),c[2]))),a[3]),e(n(e(n(t(l[1],c[0]),t(-c[1],l[0])),a[2]),n(e(n(t(a[1],c[0]),t(-c[1],a[0])),-l[2]),e(n(t(a[1],l[0]),t(-l[1],a[0])),c[2]))),-s[3])))),n(n(e(n(e(n(t(s[1],c[0]),t(-c[1],s[0])),a[2]),n(e(n(t(a[1],c[0]),t(-c[1],a[0])),-s[2]),e(n(t(a[1],s[0]),t(-s[1],a[0])),c[2]))),l[3]),n(e(n(e(n(t(s[1],l[0]),t(-l[1],s[0])),a[2]),n(e(n(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),e(n(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),-c[3]),e(n(e(n(t(o[1],l[0]),t(-l[1],o[0])),s[2]),n(e(n(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),e(n(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),a[3]))),n(e(n(e(n(t(o[1],l[0]),t(-l[1],o[0])),a[2]),n(e(n(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),e(n(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),-s[3]),n(e(n(e(n(t(s[1],l[0]),t(-l[1],s[0])),a[2]),n(e(n(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),e(n(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),o[3]),e(n(e(n(t(s[1],o[0]),t(-o[1],s[0])),a[2]),n(e(n(t(a[1],o[0]),t(-o[1],a[0])),-s[2]),e(n(t(a[1],s[0]),t(-s[1],a[0])),o[2]))),-l[3]))))),h=n(n(n(e(n(e(n(t(l[1],c[0]),t(-c[1],l[0])),o[2]),n(e(n(t(o[1],c[0]),t(-c[1],o[0])),-l[2]),e(n(t(o[1],l[0]),t(-l[1],o[0])),c[2]))),a[3]),e(n(e(n(t(l[1],c[0]),t(-c[1],l[0])),a[2]),n(e(n(t(a[1],c[0]),t(-c[1],a[0])),-l[2]),e(n(t(a[1],l[0]),t(-l[1],a[0])),c[2]))),-o[3])),n(e(n(e(n(t(o[1],c[0]),t(-c[1],o[0])),a[2]),n(e(n(t(a[1],c[0]),t(-c[1],a[0])),-o[2]),e(n(t(a[1],o[0]),t(-o[1],a[0])),c[2]))),l[3]),e(n(e(n(t(o[1],l[0]),t(-l[1],o[0])),a[2]),n(e(n(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),e(n(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),-c[3]))),n(n(e(n(e(n(t(o[1],c[0]),t(-c[1],o[0])),s[2]),n(e(n(t(s[1],c[0]),t(-c[1],s[0])),-o[2]),e(n(t(s[1],o[0]),t(-o[1],s[0])),c[2]))),a[3]),e(n(e(n(t(o[1],c[0]),t(-c[1],o[0])),a[2]),n(e(n(t(a[1],c[0]),t(-c[1],a[0])),-o[2]),e(n(t(a[1],o[0]),t(-o[1],a[0])),c[2]))),-s[3])),n(e(n(e(n(t(s[1],c[0]),t(-c[1],s[0])),a[2]),n(e(n(t(a[1],c[0]),t(-c[1],a[0])),-s[2]),e(n(t(a[1],s[0]),t(-s[1],a[0])),c[2]))),o[3]),e(n(e(n(t(s[1],o[0]),t(-o[1],s[0])),a[2]),n(e(n(t(a[1],o[0]),t(-o[1],a[0])),-s[2]),e(n(t(a[1],s[0]),t(-s[1],a[0])),o[2]))),-c[3])))),d=r(u,h);return d[d.length-1]}}function Th(n){return(n===3?vD:n===4?gD:pD)(hD,Mh,oD,cD)}const mD=Th(3),yD=Th(4),Vs=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){const i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),s=i-a;let o;if(i>0){if(a<=0)return s;o=i+a}else if(i<0){if(a>=0)return s;o=-(i+a)}else return s;const l=dD*o;return s>=l||s<=-l?s:mD(t,e,r)},function(t,e,r,i){const a=t[0]-i[0],s=e[0]-i[0],o=r[0]-i[0],l=t[1]-i[1],c=e[1]-i[1],u=r[1]-i[1],h=t[2]-i[2],d=e[2]-i[2],f=r[2]-i[2],v=s*u,g=o*c,p=o*l,y=a*u,b=a*c,E=s*l,O=h*(v-g)+d*(p-y)+f*(b-E),P=(Math.abs(v)+Math.abs(g))*Math.abs(h)+(Math.abs(p)+Math.abs(y))*Math.abs(d)+(Math.abs(b)+Math.abs(E))*Math.abs(f),L=fD*P;return O>L||-O>L?O:yD(t,e,r,i)}];function bD(n){let t=Vs[n.length];return t||(t=Vs[n.length]=Th(n.length)),t.apply(void 0,...n)}function xD(n,t,e,r,i,a,s){return function(...l){switch(l.length){case 0:case 1:return 0;case 2:return r(l[0],l[1]);case 3:return i(l[0],l[1],l[2]);case 4:return a(l[0],l[1],l[2],l[3]);case 5:return s(l[0],l[1],l[2],l[3],l[4])}return n(l)}}function ED(){for(;Vs.length<=Jb;)Vs.push(Th(Vs.length));const n=xD(void 0,bD,...Vs);for(let t=0;t<=Jb;++t)n[t]=Vs[t];return n}var _l=ED();const $b=_l[3];function wD(n){const t=n.length;if(t<3){const o=new Array(t);for(let l=0;l<t;++l)o[l]=l;return t===2&&n[0][0]===n[1][0]&&n[0][1]===n[1][1]?[0]:o}const e=new Array(t);for(let o=0;o<t;++o)e[o]=o;e.sort((o,l)=>{const c=n[o][0]-n[l][0];return c||n[o][1]-n[l][1]});const r=[e[0],e[1]],i=[e[0],e[1]];for(let o=2;o<t;++o){const l=e[o],c=n[l];let u=r.length;for(;u>1&&$b(n[r[u-2]],n[r[u-1]],c)<=0;)u-=1,r.pop();for(r.push(l),u=i.length;u>1&&$b(n[i[u-2]],n[i[u-1]],c)>=0;)u-=1,i.pop();i.push(l)}const a=new Array(i.length+r.length-2);let s=0;for(let o=0,l=r.length;o<l;++o)a[s++]=r[o];for(let o=i.length-2;o>0;--o)a[s++]=i[o];return a}function SD(n,t,e,r){for(let i=0;i<2;++i){const a=n[i],s=t[i],[o,l]=[Math.min(a,s),Math.max(a,s)],c=e[i],u=r[i],[h,d]=[Math.min(c,u),Math.max(c,u)];if(d<o||l<h)return!1}return!0}function MD(n,t,e,r){const i=_l(n,e,r),a=_l(t,e,r);if(i>0&&a>0||i<0&&a<0)return!1;const s=_l(e,n,t),o=_l(r,n,t);return s>0&&o>0||s<0&&o<0?!1:i===0&&a===0&&s===0&&o===0?SD(n,t,e,r):!0}function AD(n){const t=[n[0]];let e=n[0];for(let r=1;r<n.length;r++){const i=n[r];(e[0]!==i[0]||e[1]!==i[1])&&t.push(i),e=i}return t}function TD(n){return n.sort(function(t,e){return t[0]-e[0]||t[1]-e[1]})}function Qv(n,t){return Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2)}function tx(n,t,e){const r=[t[0]-n[0],t[1]-n[1]],i=[e[0]-n[0],e[1]-n[1]],a=Qv(n,t),s=Qv(n,e);return(r[0]*i[0]+r[1]*i[1])/Math.sqrt(a*s)}function ex(n,t){for(let e=0;e<t.length-1;e++){const r=[t[e],t[e+1]];if(!(n[0][0]===r[0][0]&&n[0][1]===r[0][1]||n[0][0]===r[1][0]&&n[0][1]===r[1][1])&&MD(n[0],n[1],r[0],r[1]))return!0}return!1}function OD(n){let t=1/0,e=1/0,r=-1/0,i=-1/0;for(let a=n.length-1;a>=0;a--)n[a][0]<t&&(t=n[a][0]),n[a][1]<e&&(e=n[a][1]),n[a][0]>r&&(r=n[a][0]),n[a][1]>i&&(i=n[a][1]);return[r-t,i-e]}function CD(n){return[Math.min(n[0][0],n[1][0]),Math.min(n[0][1],n[1][1]),Math.max(n[0][0],n[1][0]),Math.max(n[0][1],n[1][1])]}function ND(n,t,e){let r=null,i=rx,a=rx,s,o;for(let l=0;l<t.length;l++)s=tx(n[0],n[1],t[l]),o=tx(n[1],n[0],t[l]),s>i&&o>a&&!ex([n[0],t[l]],e)&&!ex([n[1],t[l]],e)&&(i=s,a=o,r=t[l]);return r}function nx(n,t,e,r,i){let a=!1;for(let s=0;s<n.length-1;s++){const o=[n[s],n[s+1]],l=o[0][0]+","+o[0][1]+","+o[1][0]+","+o[1][1];if(Qv(o[0],o[1])<t||i.has(l))continue;let c=0,u=CD(o),h,d,f;do u=r.extendBbox(u,c),h=u[2]-u[0],d=u[3]-u[1],f=ND(o,r.rangePoints(u),n),c++;while(f===null&&(e[0]>h||e[1]>d));h>=e[0]&&d>=e[1]&&i.add(l),f!==null&&(n.splice(s+1,0,f),r.removePoint(f),a=!0)}return a?nx(n,t,e,r,i):n}function kD(n,t,e){const r=t||20,i=AD(TD(Kv.toXy(n,e)));if(i.length<4){const h=i.concat([i[0]]);return e?Kv.fromXy(h,e):h}const a=OD(i),s=[a[0]*ix,a[1]*ix],o=wD(i).reverse().map(h=>i[h]);o.push(o[0]);const l=i.filter(function(h){return o.indexOf(h)<0}),c=Math.ceil(1/(i.length/(a[0]*a[1]))),u=nx(o,Math.pow(r,2),s,aD(l,c),new Set);return e?Kv.fromXy(u,e):u}const rx=Math.cos(90/(180/Math.PI)),ix=.6;function PD(n,t,e){if(n.length===1)return RD(n[0],t,e);if(n.length===2)return ax(n,t,e);if(n.length===3){const[r,i,a]=Hf(n);if(Oy(r,i,a))return ax([r,a],t,e)}switch(e){case"smooth":return _D(n,t);case"sharp":return DD(n,t);case"rounded":default:return LD(n,t)}}const RD=(n,t,e)=>{if(e==="sharp")return[["M",n[0]-t,n[1]-t],["L",n[0]+t,n[1]-t],["L",n[0]+t,n[1]+t],["L",n[0]-t,n[1]+t],["Z"]];const r=[t,t,0,0,0];return[["M",n[0],n[1]-t],["A",...r,n[0],n[1]+t],["A",...r,n[0],n[1]-t]]},ax=(n,t,e)=>{const r=[t,t,0,0,0],i=e==="sharp"?Ne(n[0],ja(pa(ln(n[0],n[1])),t)):n[0],a=e==="sharp"?Ne(n[1],ja(pa(ln(n[1],n[0])),t)):n[1],s=ja(pa(hu(ln(i,a),!1)),t),o=ja(s,-1),l=Ne(i,s),c=Ne(a,s),u=Ne(a,o),h=Ne(i,o);return e==="sharp"?[["M",l[0],l[1]],["L",c[0],c[1]],["L",u[0],u[1]],["L",h[0],h[1]],["Z"]]:[["M",l[0],l[1]],["L",c[0],c[1]],["A",...r,u[0],u[1]],["L",h[0],h[1]],["A",...r,l[0],l[1]]]},LD=(n,t)=>{const e=Hf(n).map((o,l)=>{const c=(l-2+n.length)%n.length,u=(l-1+n.length)%n.length,h=(l+1)%n.length,d=n[c],f=n[u],v=n[h],g=ln(d,f),p=ln(f,o),y=ln(o,v),b=(F,I)=>Vf(F,I,!0)<Math.PI,E=b(g,p),O=b(p,y),P=F=>ja(pa(hu(F,!1)),t),L=P(p);return[{p:Rs(E?Ne(f,P(g)):Ne(f,L)),concave:E&&f},{p:Rs(O?Ne(o,P(y)):Ne(o,L)),concave:O&&o}]}),r=[t,t,0,0,0],i=e.findIndex((o,l)=>!e[(l-1+e.length)%e.length][0].concave&&!e[(l-1+e.length)%e.length][1].concave&&!o[0].concave&&!o[0].concave&&!o[1].concave),a=e.slice(i).concat(e.slice(0,i));let s=[];return a.flatMap((o,l)=>{const c=[],u=a[e.length-1];return l===0&&c.push(["M",...u[1].p]),o[0].concave?s.push(o[0].p,o[1].p):c.push(["A",...r,...o[0].p]),o[1].concave?s.unshift(o[1].p):c.push(["L",...o[1].p]),s.length===3&&(c.pop(),c.push(["C",...s.flat()]),s=[]),c})},_D=(n,t)=>{const e=Hf(n).map((r,i)=>{const a=n[(i+1)%n.length];return{p:r,v:pa(ln(a,r))}});return e.forEach((r,i)=>{const a=i>0?i-1:n.length-1,s=e[a].v,o=pa(Ne(s,ja(r.v,Vf(s,r.v,!0)<Math.PI?1:-1)));r.p=Ne(r.p,ja(o,t))}),Vy(e.map(r=>r.p))},DD=(n,t)=>{const r=n.map((a,s)=>{const o=n[s===0?n.length-1:s-1],l=pl(ja(pa(hu(ln(o,a),!1)),t));return[Ne(o,l),Ne(a,l)]}).flat();return r.map((a,s)=>{if(s%2===0)return null;const o=[r[(s-1)%r.length],r[s%r.length]],l=[r[(s+1)%r.length],r[(s+2)%r.length]];return Yf(o,l,!0)}).filter(Boolean).map((a,s)=>[s===0?"M":"L",a[0],a[1]]).concat([["Z"]])};var ID=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Oh extends br{constructor(t,e){super(t,Object.assign({},Oh.defaultOptions,e)),this.hullMemberIds=[],this.drawHull=()=>{if(!this.shape)this.shape=new wl({style:this.getHullStyle()}),this.context.canvas.appendChild(this.shape);else{const r=!Zn(this.optionsCache,this.options);this.shape.update(this.getHullStyle(r))}this.optionsCache=Object.assign({},this.options)},this.updateHullPath=r=>{this.shape&&this.options.members.includes(At(r.data))&&this.shape.update({d:this.getHullPath(!0)})},this.getHullPath=(r=!1)=>{const{graph:i}=this.context,a=this.getMember();if(a.length===0)return"";const s=a.map(c=>i.getNodeData(c)),o=kD(s.map(ir),this.options.concavity).slice(1).reverse(),l=o.flatMap(c=>s.filter(u=>Zn(ir(u),c)).map(At));return Zn(l,this.hullMemberIds)&&!r?this.path:(this.hullMemberIds=l,this.path=PD(o,this.getPadding(),this.options.corner),this.path)},this.bindEvents()}bindEvents(){this.context.graph.on(Kt.AFTER_RENDER,this.drawHull),this.context.graph.on(Kt.AFTER_ELEMENT_UPDATE,this.updateHullPath)}unbindEvents(){this.context.graph.off(Kt.AFTER_RENDER,this.drawHull),this.context.graph.off(Kt.AFTER_ELEMENT_UPDATE,this.updateHullPath)}getHullStyle(t){const e=this.options,{members:r,padding:i,corner:a}=e,s=ID(e,["members","padding","corner"]);return Object.assign(Object.assign({},s),{d:this.getHullPath(t)})}getPadding(){const{graph:t}=this.context;return this.hullMemberIds.reduce((r,i)=>{const{halfExtents:a}=t.getElementRenderBounds(i),s=Math.max(a[0],a[1]);return Math.max(r,s)},0)+this.options.padding}addMember(t){const e=Array.isArray(t)?t:[t];this.options.members=[...new Set([...this.options.members,...e])],this.shape.update({d:this.getHullPath()})}removeMember(t){const e=Array.isArray(t)?t:[t];this.options.members=this.options.members.filter(r=>!e.includes(r)),e.some(r=>this.hullMemberIds.includes(r))&&this.shape.update({d:this.getHullPath()})}updateMember(t){this.options.members=fe(t)?t(this.options.members):t,this.shape.update(this.getHullStyle(!0))}getMember(){return this.options.members}destroy(){this.unbindEvents(),this.shape.destroy(),this.hullMemberIds=[],super.destroy()}}Oh.defaultOptions={members:[],padding:10,corner:"rounded",concavity:1/0,fill:"lightblue",fillOpacity:.2,labelOpacity:1,stroke:"blue",strokeOpacity:.2};function sx(n,t){t(n),n.children&&n.children.forEach(function(e){e&&sx(e,t)})}function Dl(n){Ch(n,!0)}function ji(n){Ch(n,!1)}function Ch(n,t){var e=t?"visible":"hidden";sx(n,function(r){r.attr("visibility",e)})}var BD=5,ox=function(n,t,e,r){e===void 0&&(e=0),r===void 0&&(r=BD),Object.entries(t).forEach(function(i){var a=(0,G.CR)(i,2),s=a[0],o=a[1],l=n;Object.prototype.hasOwnProperty.call(t,s)&&(o?vo(o)?(vo(n[s])||(l[s]={}),e<r?ox(n[s],o,e+1,r):l[s]=t[s]):Wr(o)?(l[s]=[],l[s]=l[s].concat(o)):l[s]=o:l[s]=o)})},Jn=function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var r=0;r<t.length;r+=1)ox(n,t[r]);return n},FD=function(n){(0,G.ZT)(t,n);function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=n.apply(this,(0,G.ev)([],(0,G.CR)(e),!1))||this;return i.isMutationObserved=!0,i.addEventListener(De.INSERTED,function(){ji(i)}),i}return t}(rr);function lx(n){var t=n.appendChild(new FD({class:"offscreen"}));return ji(t),t}function zD(n){for(var t=n;t;){if(t.className==="offscreen")return!0;t=t.parent}return!1}function jD(){Ch(this,this.attributes.visibility!=="hidden")}var Ln=function(n){(0,G.ZT)(t,n);function t(e,r){r===void 0&&(r={});var i=n.call(this,Jn({},{style:r},e))||this;return i.initialized=!1,i._defaultOptions=r,i}return Object.defineProperty(t.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=lx(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),t.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},t.prototype.disconnectedCallback=function(){var e;(e=this._offscreen)===null||e===void 0||e.destroy()},t.prototype.attributeChangedCallback=function(e){e==="visibility"&&jD.call(this)},t.prototype.update=function(e,r){var i;return this.attr(Jn({},this.attributes,e||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,r)},t.prototype.clear=function(){this.removeChildren()},t.prototype.bindEvents=function(e,r){},t.prototype.getSubShapeStyle=function(e){var r=e.x,i=e.y,a=e.transform,s=e.transformOrigin,o=e.class,l=e.className,c=e.zIndex,u=(0,G._T)(e,["x","y","transform","transformOrigin","class","className","zIndex"]);return u},t}(df);function qv(n){return n.toString().charAt(0).toUpperCase()+n.toString().slice(1)}function ZD(n){return n.toString().charAt(0).toLowerCase()+n.toString().slice(1)}function WD(n,t){return"".concat(t).concat(qv(n))}function cx(n,t,e){var r;e===void 0&&(e=!0);var i=t||((r=n.match(/^([a-z][a-z0-9]+)/))===null||r===void 0?void 0:r[0])||"",a=n.replace(new RegExp("^(".concat(i,")")),"");return e?ZD(a):a}function GD(n,t){Object.entries(t).forEach(function(e){var r=(0,G.CR)(e,2),i=r[0],a=r[1];(0,G.ev)([n],(0,G.CR)(n.querySelectorAll(i)),!1).filter(function(s){return s.matches(i)}).forEach(function(s){if(s){var o=s;o.style.cssText+=Object.entries(a).reduce(function(l,c){return"".concat(l).concat(c.join(":"),";")},"")}})})}var Nh=function(n,t){if(!(n!=null&&n.startsWith(t)))return!1;var e=n[t.length];return e>="A"&&e<="Z"};function ke(n,t,e){e===void 0&&(e=!1);var r={};return Object.entries(n).forEach(function(i){var a=(0,G.CR)(i,2),s=a[0],o=a[1];if(!(s==="className"||s==="class")){if(Nh(s,"show")&&Nh(cx(s,"show"),t)!==e)s===WD(t,"show")?r[s]=o:r[s.replace(new RegExp(qv(t)),"")]=o;else if(!Nh(s,"show")&&Nh(s,t)!==e){var l=cx(s,t);l==="filter"&&typeof o=="function"||(r[l]=o)}}}),r}function Mo(n,t){return Object.entries(n).reduce(function(e,r){var i=(0,G.CR)(r,2),a=i[0],s=i[1];return a.startsWith("show")?e["show".concat(t).concat(a.slice(4))]=s:e["".concat(t).concat(qv(a))]=s,e},{})}function Ea(n,t){t===void 0&&(t=["x","y","class","className"]);var e=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(n).forEach(function(a){var s=(0,G.CR)(a,2),o=s[0],l=s[1];t.includes(o)||(e.indexOf(o)!==-1?i[o]=l:r[o]=l)}),[r,i]}var VD=function(n){if(!Wr(n))return[];for(var t=[],e=0;e<n.length;e++)t=t.concat(n[e]);return t},UD=VD,Jv=function(n){(0,G.ZT)(t,n);function t(e){e===void 0&&(e={});var r=e.style,i=(0,G._T)(e,["style"]);return n.call(this,(0,G.pi)({style:(0,G.pi)({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},r)},i))||this}return Object.defineProperty(t.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=lx(this)),this._offscreen},enumerable:!1,configurable:!0}),t.prototype.disconnectedCallback=function(){var e;(e=this._offscreen)===null||e===void 0||e.destroy()},t}(Os);function YD(n,t){var e=new Map;return n.forEach(function(r){var i=t(r);e.has(i)||e.set(i,[]),e.get(i).push(r)}),e}function HD(n){throw new Error(n)}var XD=function(){function n(i,a,s,o,l,c,u){i===void 0&&(i=null),a===void 0&&(a=null),s===void 0&&(s=null),o===void 0&&(o=null),l===void 0&&(l=[null,null,null,null,null]),c===void 0&&(c=[]),u===void 0&&(u=[]),t.add(this),this._elements=Array.from(i),this._data=a,this._parent=s,this._document=o,this._enter=l[0],this._update=l[1],this._exit=l[2],this._merge=l[3],this._split=l[4],this._transitions=c,this._facetElements=u}n.prototype.selectAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new e(a,null,this._elements[0],this._document)},n.prototype.selectFacetAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new e(this._elements,null,this._parent,this._document,void 0,void 0,a)},n.prototype.select=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i)[0]||null:i;return new e([a],null,a,this._document)},n.prototype.append=function(i){var a=this,s=typeof i=="function"?i:function(){return a.createElement(i)},o=[];if(this._data!==null){for(var l=0;l<this._data.length;l++){var c=this._data[l],u=(0,G.CR)(Array.isArray(c)?c:[c,null],2),h=u[0],d=u[1],f=s(h,l);f.__data__=h,d!==null&&(f.__fromElements__=d),this._parent.appendChild(f),o.push(f)}return new e(o,null,this._parent,this._document)}for(var l=0;l<this._elements.length;l++){var v=this._elements[l],h=v.__data__,f=s(h,l);v.appendChild(f),o.push(f)}return new e(o,null,o[0],this._document)},n.prototype.maybeAppend=function(i,a){var s=(0,G.Q_)(this,t,"m",r).call(this,i[0]==="#"?i:"#".concat(i),a);return s.attr("id",i),s},n.prototype.maybeAppendByClassName=function(i,a){var s=i.toString(),o=(0,G.Q_)(this,t,"m",r).call(this,s[0]==="."?s:".".concat(s),a);return o.attr("className",s),o},n.prototype.maybeAppendByName=function(i,a){var s=(0,G.Q_)(this,t,"m",r).call(this,'[name="'.concat(i,'"]'),a);return s.attr("name",i),s},n.prototype.data=function(i,a,s){var o,l;a===void 0&&(a=function(Y){return Y}),s===void 0&&(s=function(){return null});for(var c=[],u=[],h=new Set(this._elements),d=[],f=new Set,v=new Map(this._elements.map(function(Y,J){return[a(Y.__data__,J),Y]})),g=new Map(this._facetElements.map(function(Y,J){return[a(Y.__data__,J),Y]})),p=YD(this._elements,function(Y){return s(Y.__data__)}),y=0;y<i.length;y++){var b=i[y],E=a(b,y),O=s(b,y);if(v.has(E)){var P=v.get(E);P.__data__=b,P.__facet__=!1,u.push(P),h.delete(P),v.delete(E)}else if(g.has(E)){var P=g.get(E);P.__data__=b,P.__facet__=!0,u.push(P),g.delete(E)}else if(p.has(E)){var L=p.get(E);d.push([b,L]);try{for(var F=(o=void 0,(0,G.XA)(L)),I=F.next();!I.done;I=F.next()){var P=I.value;h.delete(P)}}catch(Y){o={error:Y}}finally{try{I&&!I.done&&(l=F.return)&&l.call(F)}finally{if(o)throw o.error}}p.delete(E)}else if(v.has(O)){var P=v.get(O);P.__toData__?P.__toData__.push(b):P.__toData__=[b],f.add(P),h.delete(P)}else c.push(b)}var V=[new e([],c,this._parent,this._document),new e(u,null,this._parent,this._document),new e(h,null,this._parent,this._document),new e([],d,this._parent,this._document),new e(f,null,this._parent,this._document)];return new e(this._elements,null,this._parent,this._document,V)},n.prototype.merge=function(i){var a=(0,G.ev)((0,G.ev)([],(0,G.CR)(this._elements),!1),(0,G.CR)(i._elements),!1),s=(0,G.ev)((0,G.ev)([],(0,G.CR)(this._transitions),!1),(0,G.CR)(i._transitions),!1);return new e(a,null,this._parent,this._document,void 0,s)},n.prototype.createElement=function(i){if(this._document)return this._document.createElement(i,{});var a=e.registry[i];return a?new a:HD("Unknown node type: ".concat(i))},n.prototype.join=function(i,a,s,o,l){i===void 0&&(i=function(v){return v}),a===void 0&&(a=function(v){return v}),s===void 0&&(s=function(v){return v.remove()}),o===void 0&&(o=function(v){return v}),l===void 0&&(l=function(v){return v.remove()});var c=i(this._enter),u=a(this._update),h=s(this._exit),d=o(this._merge),f=l(this._split);return u.merge(c).merge(h).merge(d).merge(f)},n.prototype.remove=function(){for(var i=function(o){var l=a._elements[o],c=a._transitions[o];c?c.then(function(){return l.remove()}):l.remove()},a=this,s=0;s<this._elements.length;s++)i(s);return new e([],null,this._parent,this._document,void 0,this._transitions)},n.prototype.each=function(i){for(var a=0;a<this._elements.length;a++){var s=this._elements[a],o=s.__data__;i.call(s,o,a)}return this},n.prototype.attr=function(i,a){var s=typeof a!="function"?function(){return a}:a;return this.each(function(o,l){a!==void 0&&(this[i]=s.call(this,o,l))})},n.prototype.style=function(i,a,s){s===void 0&&(s=!0);var o=typeof a!="function"||!s?function(){return a}:a;return this.each(function(l,c){a!==void 0&&(this.style[i]=o.call(this,l,c))})},n.prototype.styles=function(i,a){return i===void 0&&(i={}),a===void 0&&(a=!0),this.each(function(s,o){var l=this;Object.entries(i).forEach(function(c){var u=(0,G.CR)(c,2),h=u[0],d=u[1],f=typeof d!="function"||!a?function(){return d}:d;d!==void 0&&l.attr(h,f.call(l,s,o))})})},n.prototype.update=function(i,a){a===void 0&&(a=!0);var s=typeof i!="function"||!a?function(){return i}:i;return this.each(function(o,l){i&&this.update&&this.update(s.call(this,o,l))})},n.prototype.maybeUpdate=function(i,a){a===void 0&&(a=!0);var s=typeof i!="function"||!a?function(){return i}:i;return this.each(function(o,l){i&&this.update&&this.update(s.call(this,o,l))})},n.prototype.transition=function(i){var a=this._transitions,s=new Array(this._elements.length);return this.each(function(o,l){s[l]=i.call(this,o,l)}),this._transitions=UD(s),this},n.prototype.on=function(i,a){return this.each(function(){this.addEventListener(i,a)}),this},n.prototype.call=function(i){for(var a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];return i.call.apply(i,(0,G.ev)([this._parent,this],(0,G.CR)(a),!1)),this},n.prototype.node=function(){return this._elements[0]},n.prototype.nodes=function(){return this._elements},n.prototype.transitions=function(){return this._transitions.filter(function(i){return!!i})},n.prototype.parent=function(){return this._parent};var t,e,r;return e=n,t=new WeakSet,r=function(a,s){var o=this._elements[0],l=o.querySelector(a);if(l)return new e([l],null,this._parent,this._document);var c=typeof s=="string"?this.createElement(s):s();return o.appendChild(c),new e([c],null,this._parent,this._document)},n.registry={g:rr,rect:gr,circle:Ji,path:ni,text:Jv,ellipse:al,image:sl,line:As,polygon:Ts,polyline:Oc,html:co},n}();function ve(n){return new XD([n],null,n,n.ownerDocument)}function KD(n,t,e){return n.querySelector(t)?ve(n).select(t):ve(n).append(e)}var Cr=function(){function n(t,e,r,i){t===void 0&&(t=0),e===void 0&&(e=0),r===void 0&&(r=0),i===void 0&&(i=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=r,this.height=i}return Object.defineProperty(n.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),n.fromRect=function(t){return new n(t.x,t.y,t.width,t.height)},n.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},n.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},n}();function q7(n){var t=n.getRenderBounds(),e=__read(t.min,2),r=e[0],i=e[1],a=__read(t.max,2),s=a[0],o=a[1],l=s-r,c=o-i;return new Cr(r,i,l,c)}var Zi=function(n,t){var e=function(i){return"".concat(t,"-").concat(i)},r=Object.fromEntries(Object.entries(n).map(function(i){var a=(0,G.CR)(i,2),s=a[0],o=a[1],l=e(o);return[s,{name:l,class:".".concat(l),id:"#".concat(l),toString:function(){return l}}]}));return Object.assign(r,{prefix:e}),r};function kh(n){return/\S+-\S+/g.test(n)?n.split("-").map(function(t){return t[0]}):n.length>2?[n[0]]:n.split("")}function xr(n){if(ie(n))return[n,n,n,n];if(Wr(n)){var t=n.length;if(t===1)return[n[0],n[0],n[0],n[0]];if(t===2)return[n[0],n[1],n[0],n[1]];if(t===3)return[n[0],n[1],n[2],n[1]];if(t===4)return n}return[0,0,0,0]}function Qr(n,t,e,r,i){return r===void 0&&(r=!0),i===void 0&&(i=function(a){a.node().removeChildren()}),n?e(t):(r&&i(t),null)}var ux=Zi({text:"text"},"title");function QD(n,t){var e=n.attributes,r=e.position,i=e.spacing,a=e.inset,s=e.text,o=n.getBBox(),l=t.getBBox(),c=kh(r),u=(0,G.CR)(xr(s?i:0),4),h=u[0],d=u[1],f=u[2],v=u[3],g=(0,G.CR)(xr(a),4),p=g[0],y=g[1],b=g[2],E=g[3],O=(0,G.CR)([v+d,h+f],2),P=O[0],L=O[1],F=(0,G.CR)([E+y,p+b],2),I=F[0],V=F[1];if(c[0]==="l")return new Cr(o.x,o.y,l.width+o.width+P+I,Math.max(l.height+V,o.height));if(c[0]==="t")return new Cr(o.x,o.y,Math.max(l.width+I,o.width),l.height+o.height+L+V);var Y=(0,G.CR)([t.attributes.width||l.width,t.attributes.height||l.height],2),J=Y[0],$=Y[1];return new Cr(l.x,l.y,J+o.width+P+I,$+o.height+L+V)}function qD(n,t){var e=Object.entries(t).reduce(function(r,i){var a=(0,G.CR)(i,2),s=a[0],o=a[1],l=n.node().attr(s);return l||(r[s]=o),r},{});n.styles(e)}function JD(n){var t,e,r,i,a=n,s=a.width,o=a.height,l=a.position,c=(0,G.CR)([+s/2,+o/2],2),u=c[0],h=c[1],d=(0,G.CR)([+u,+h,"center","middle"],4),f=d[0],v=d[1],g=d[2],p=d[3],y=kh(l);return y.includes("l")&&(t=(0,G.CR)([0,"start"],2),f=t[0],g=t[1]),y.includes("r")&&(e=(0,G.CR)([+s,"end"],2),f=e[0],g=e[1]),y.includes("t")&&(r=(0,G.CR)([0,"top"],2),v=r[0],p=r[1]),y.includes("b")&&(i=(0,G.CR)([+o,"bottom"],2),v=i[0],p=i[1]),{x:f,y:v,textAlign:g,textBaseline:p}}var $D=function(n){(0,G.ZT)(t,n);function t(e){return n.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return t.prototype.getAvailableSpace=function(){var e=this,r=this.attributes,i=r.width,a=r.height,s=r.position,o=r.spacing,l=r.inset,c=e.querySelector(ux.text.class);if(!c)return new Cr(0,0,+i,+a);var u=c.getBBox(),h=u.width,d=u.height,f=(0,G.CR)(xr(o),4),v=f[0],g=f[1],p=f[2],y=f[3],b=(0,G.CR)([0,0,+i,+a],4),E=b[0],O=b[1],P=b[2],L=b[3],F=kh(s);if(F.includes("i"))return new Cr(E,O,P,L);F.forEach(function(Nt,Ot){var mt,yt,Rt,jt;Nt==="t"&&(mt=(0,G.CR)(Ot===0?[d+p,+a-d-p]:[0,+a],2),O=mt[0],L=mt[1]),Nt==="r"&&(yt=(0,G.CR)([+i-h-y],1),P=yt[0]),Nt==="b"&&(Rt=(0,G.CR)([+a-d-v],1),L=Rt[0]),Nt==="l"&&(jt=(0,G.CR)(Ot===0?[h+g,+i-h-g]:[0,+i],2),E=jt[0],P=jt[1])});var I=(0,G.CR)(xr(l),4),V=I[0],Y=I[1],J=I[2],$=I[3],ot=(0,G.CR)([$+Y,V+J],2),ct=ot[0],ft=ot[1];return new Cr(E+$,O+V,P-ct,L-ft)},t.prototype.getBBox=function(){return this.title?this.title.getBBox():new Cr(0,0,0,0)},t.prototype.render=function(e,r){var i=this,a=e.width,s=e.height,o=e.position,l=e.spacing,c=(0,G._T)(e,["width","height","position","spacing"]),u=(0,G.CR)(Ea(c),1),h=u[0],d=JD(e),f=d.x,v=d.y,g=d.textAlign,p=d.textBaseline;Qr(!!c.text,ve(r),function(y){i.title=y.maybeAppendByClassName(ux.text,"text").styles(h).call(qD,{x:f,y:v,textAlign:g,textBaseline:p}).node()})},t}(Ln),$v=function(){};function qr(n,t){return fe(n)?n.apply(void 0,(0,G.ev)([],(0,G.CR)(t),!1)):n}function tI(n,t){return n.reduce(function(e,r){return(e[r[t]]=e[r[t]]||[]).push(r),e},{})}function eI(n){return typeof n=="boolean"?!1:"enter"in n&&"update"in n&&"exit"in n}function hx(n){if(!n)return{enter:!1,update:!1,exit:!1};var t=["enter","update","exit"],e=Object.fromEntries(Object.entries(n).filter(function(r){var i=(0,G.CR)(r,1),a=i[0];return!t.includes(a)}));return Object.fromEntries(t.map(function(r){return eI(n)?n[r]===!1?[r,!1]:[r,(0,G.pi)((0,G.pi)({},n[r]),e)]:[r,e]}))}function Ao(n,t){n?n.finished.then(t):t()}function nI(n,t){n.length===0?t():Promise.all(n.map(function(e){return e==null?void 0:e.finished})).then(t)}function dx(n,t){"update"in n?n.update(t):n.attr(t)}function fx(n,t,e){if(t.length===0)return null;if(!e){var r=t.slice(-1)[0];return dx(n,{style:r}),null}return n.animate(t,e)}function rI(n,t){return!(n.nodeName!=="text"||t.nodeName!=="text"||n.attributes.text!==t.attributes.text)}function iI(n,t,e,r){if(r===void 0&&(r="destroy"),rI(n,t))return n.remove(),[null];var i=function(){r==="destroy"?n.destroy():r==="hide"&&ji(n),t.isVisible()&&Dl(t)};if(!e)return i(),[null];var a=e.duration,s=a===void 0?0:a,o=e.delay,l=o===void 0?0:o,c=Math.ceil(+s/2),u=+s/4,h=(0,G.CR)(n.getGeometryBounds().center,2),d=h[0],f=h[1],v=(0,G.CR)(t.getGeometryBounds().center,2),g=v[0],p=v[1],y=(0,G.CR)([(d+g)/2-d,(f+p)/2-f],2),b=y[0],E=y[1],O=n.style.opacity,P=O===void 0?1:O,L=t.style.opacity,F=L===void 0?1:L,I=n.style.transform||"",V=t.style.transform||"",Y=n.animate([{opacity:P,transform:"translate(0, 0) ".concat(I)},{opacity:0,transform:"translate(".concat(b,", ").concat(E,") ").concat(I)}],(0,G.pi)((0,G.pi)({fill:"both"},e),{duration:l+c+u})),J=t.animate([{opacity:0,transform:"translate(".concat(-b,", ").concat(-E,") ").concat(V),offset:.01},{opacity:F,transform:"translate(0, 0) ".concat(V)}],(0,G.pi)((0,G.pi)({fill:"both"},e),{duration:c+u,delay:l+c-u}));return Ao(J,i),[Y,J]}function Wi(n,t,e){var r={},i={};return Object.entries(t).forEach(function(a){var s=(0,G.CR)(a,2),o=s[0],l=s[1];if(!me(l)){var c=n.style[o]||n.parsedStyle[o]||0;c!==l&&(r[o]=c,i[o]=l)}}),e?fx(n,[r,i],(0,G.pi)({fill:"both"},e)):(dx(n,i),null)}function aI(n){var t;return((t=n[0])===null||t===void 0?void 0:t.map(function(e,r){return n.map(function(i){return i[r]})}))||[]}function t0(n,t,e){e===void 0&&(e=!1);var r=n.getBBox(),i=r.width,a=r.height,s=t/Math.max(i,a);return e&&(n.style.transform="scale(".concat(s,")")),s}var vx=function(n,t,e){return[["M",n-e,t],["A",e,e,0,1,0,n+e,t],["A",e,e,0,1,0,n-e,t],["Z"]]},sI=vx,oI=function(n,t,e){return[["M",n-e,t-e],["L",n+e,t-e],["L",n+e,t+e],["L",n-e,t+e],["Z"]]},lI=function(n,t,e){return[["M",n-e,t],["L",n,t-e],["L",n+e,t],["L",n,t+e],["Z"]]},cI=function(n,t,e){var r=e*Math.sin(.3333333333333333*Math.PI);return[["M",n-e,t+r],["L",n,t-r],["L",n+e,t+r],["Z"]]},uI=function(n,t,e){var r=e*Math.sin(.3333333333333333*Math.PI);return[["M",n-e,t-r],["L",n+e,t-r],["L",n,t+r],["Z"]]},hI=function(n,t,e){var r=e/2*Math.sqrt(3);return[["M",n,t-e],["L",n+r,t-e/2],["L",n+r,t+e/2],["L",n,t+e],["L",n-r,t+e/2],["L",n-r,t-e/2],["Z"]]},dI=function(n,t,e){var r=e-1.5;return[["M",n-e,t-r],["L",n+e,t+r],["L",n+e,t-r],["L",n-e,t+r],["Z"]]},gx=function(n,t,e){return[["M",n,t+e],["L",n,t-e]]},fI=function(n,t,e){return[["M",n-e,t-e],["L",n+e,t+e],["M",n+e,t-e],["L",n-e,t+e]]},vI=function(n,t,e){return[["M",n-e/2,t-e],["L",n+e/2,t-e],["M",n,t-e],["L",n,t+e],["M",n-e/2,t+e],["L",n+e/2,t+e]]},gI=function(n,t,e){return[["M",n-e,t],["L",n+e,t],["M",n,t-e],["L",n,t+e]]},pI=function(n,t,e){return[["M",n-e,t],["L",n+e,t]]},px=function(n,t,e){return[["M",n-e,t],["L",n+e,t]]},mI=px,yI=function(n,t,e){return[["M",n-e,t],["A",e/2,e/2,0,1,1,n,t],["A",e/2,e/2,0,1,0,n+e,t]]},bI=function(n,t,e){return[["M",n-e-1,t-2.5],["L",n,t-2.5],["L",n,t+2.5],["L",n+e+1,t+2.5]]},xI=function(n,t,e){return[["M",n-e-1,t+2.5],["L",n,t+2.5],["L",n,t-2.5],["L",n+e+1,t-2.5]]},EI=function(n,t,e){return[["M",n-(e+1),t+2.5],["L",n-e/2,t+2.5],["L",n-e/2,t-2.5],["L",n+e/2,t-2.5],["L",n+e/2,t+2.5],["L",n+e+1,t+2.5]]};function wI(n,t){return[["M",n-5,t+2.5],["L",n-5,t],["L",n,t],["L",n,t-3],["L",n,t+3],["L",n+6.5,t+3]]}var SI=function(n,t,e){return[["M",n-e,t-e],["L",n+e,t],["L",n-e,t+e],["Z"]]},MI=function(n,t,e){var r=e,i=e*.2,a=e*.7;return[["M",n-r,t],["A",r,r,0,1,0,n+r,t],["A",r,r,0,1,0,n-r,t],["Z"],["M",n-a,t],["L",n-i,t],["M",n+i,t],["L",n+a,t],["M",n,t-a],["L",n,t-i],["M",n,t+i],["L",n,t+a]]},wi=Zi({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),AI=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:SI(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(i,a){return"".concat(i,"/").concat(a)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return r.playState="idle",r.contentGroup=r.appendChild(new rr({class:wi.contentGroup.name})),r.playWindow=r.contentGroup.appendChild(new rr({class:wi.playWindow.name})),r.innerCurrPage=r.defaultPage,r}return Object.defineProperty(t.prototype,"defaultPage",{get:function(){var e=this.attributes.defaultPage;return kn(e,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageShape",{get:function(){var e=this.pageViews,r=(0,G.CR)(aI(e.map(function(h){var d=h.getBBox(),f=d.width,v=d.height;return[f,v]})).map(function(h){return Math.max.apply(Math,(0,G.ev)([],(0,G.CR)(h),!1))}),2),i=r[0],a=r[1],s=this.attributes,o=s.pageWidth,l=o===void 0?i:o,c=s.pageHeight,u=c===void 0?a:c;return{pageWidth:l,pageHeight:u}},enumerable:!1,configurable:!0}),t.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(t.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var e=n.prototype.getBBox.call(this),r=e.x,i=e.y,a=this.controllerShape,s=this.pageShape,o=s.pageWidth,l=s.pageHeight;return new Cr(r,i,o+a.width,l)},t.prototype.goTo=function(e){var r=this,i=this.attributes.animate,a=this,s=a.currPage,o=a.playState,l=a.playWindow,c=a.pageViews;if(o!=="idle"||e<0||c.length<=0||e>=c.length)return null;c[s].setLocalPosition(0,0),this.prepareFollowingPage(e);var u=(0,G.CR)(this.getFollowingPageDiff(e),2),h=u[0],d=u[1];this.playState="running";var f=fx(l,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-h,", ").concat(-d,")")}],i);return Ao(f,function(){r.innerCurrPage=e,r.playState="idle",r.setVisiblePages([e]),r.updatePageInfo()}),f},t.prototype.prev=function(){var e=this.attributes.loop,r=this.pageViews.length,i=this.currPage;if(!e&&i<=0)return null;var a=e?(i-1+r)%r:kn(i-1,0,r);return this.goTo(a)},t.prototype.next=function(){var e=this.attributes.loop,r=this.pageViews.length,i=this.currPage;if(!e&&i>=r-1)return null;var a=e?(i+1)%r:kn(i+1,0,r);return this.goTo(a)},t.prototype.renderClipPath=function(e){var r=this.pageShape,i=r.pageWidth,a=r.pageHeight;if(!i||!a){this.contentGroup.style.clipPath=void 0;return}this.clipPath=e.maybeAppendByClassName(wi.clipPath,"rect").styles({width:i,height:a}),this.contentGroup.attr("clipPath",this.clipPath.node())},t.prototype.setVisiblePages=function(e){this.playWindow.children.forEach(function(r,i){e.includes(i)?Dl(r):ji(r)})},t.prototype.adjustControllerLayout=function(){var e=this,r=e.prevBtnGroup,i=e.nextBtnGroup,a=e.pageInfoGroup,s=this.attributes,o=s.orientation,l=s.controllerPadding,c=a.getBBox(),u=c.width,h=c.height,d=(0,G.CR)(o==="horizontal"?[-180,0]:[-90,90],2),f=d[0],v=d[1];r.setLocalEulerAngles(f),i.setLocalEulerAngles(v);var g=r.getBBox(),p=g.width,y=g.height,b=i.getBBox(),E=b.width,O=b.height,P=Math.max(p,u,E),L=o==="horizontal"?{offset:[[0,0],[p/2+l,0],[p+u+l*2,0]],textAlign:"start"}:{offset:[[P/2,-y-l],[P/2,0],[P/2,O+l]],textAlign:"center"},F=(0,G.CR)(L.offset,3),I=(0,G.CR)(F[0],2),V=I[0],Y=I[1],J=(0,G.CR)(F[1],2),$=J[0],ot=J[1],ct=(0,G.CR)(F[2],2),ft=ct[0],Nt=ct[1],Ot=L.textAlign,mt=a.querySelector("text");mt&&(mt.style.textAlign=Ot),r.setLocalPosition(V,Y),a.setLocalPosition($,ot),i.setLocalPosition(ft,Nt)},t.prototype.updatePageInfo=function(){var e,r=this,i=r.currPage,a=r.pageViews,s=r.attributes.formatter;a.length<2||((e=this.pageInfoGroup.querySelector(wi.pageInfo.class))===null||e===void 0||e.attr("text",s(i+1,a.length)),this.adjustControllerLayout())},t.prototype.getFollowingPageDiff=function(e){var r=this.currPage;if(r===e)return[0,0];var i=this.attributes.orientation,a=this.pageShape,s=a.pageWidth,o=a.pageHeight,l=e<r?-1:1;return i==="horizontal"?[l*s,0]:[0,l*o]},t.prototype.prepareFollowingPage=function(e){var r=this,i=r.currPage,a=r.pageViews;if(this.setVisiblePages([e,i]),e!==i){var s=(0,G.CR)(this.getFollowingPageDiff(e),2),o=s[0],l=s[1];a[e].setLocalPosition(o,l)}},t.prototype.renderController=function(e){var r=this,i=this.attributes.controllerSpacing,a=this.pageShape,s=a.pageWidth,o=a.pageHeight,l=this.pageViews.length>=2,c=e.maybeAppendByClassName(wi.controller,"g");if(Ch(c.node(),l),!!l){var u=ke(this.attributes,"button"),h=ke(this.attributes,"pageNum"),d=(0,G.CR)(Ea(u),2),f=d[0],v=d[1],g=f.size,p=(0,G._T)(f,["size"]),y=!c.select(wi.prevBtnGroup.class).node(),b=c.maybeAppendByClassName(wi.prevBtnGroup,"g").styles(v);this.prevBtnGroup=b.node();var E=b.maybeAppendByClassName(wi.prevBtn,"path"),O=c.maybeAppendByClassName(wi.nextBtnGroup,"g").styles(v);this.nextBtnGroup=O.node();var P=O.maybeAppendByClassName(wi.nextBtn,"path");[E,P].forEach(function(F){F.styles((0,G.pi)((0,G.pi)({},p),{transformOrigin:"center"})),t0(F.node(),g,!0)});var L=c.maybeAppendByClassName(wi.pageInfoGroup,"g");this.pageInfoGroup=L.node(),L.maybeAppendByClassName(wi.pageInfo,"text").styles(h),this.updatePageInfo(),c.node().setLocalPosition(s+i,o/2),y&&(this.prevBtnGroup.addEventListener("click",function(){r.prev()}),this.nextBtnGroup.addEventListener("click",function(){r.next()}))}},t.prototype.render=function(e,r){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s;this.attr("transform","translate(".concat(a,", ").concat(o,")"));var l=ve(r);this.renderClipPath(l),this.renderController(l),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},t.prototype.bindEvents=function(){var e=this,r=Cl(function(){return e.render(e.attributes,e)},50);this.playWindow.addEventListener(De.INSERTED,r),this.playWindow.addEventListener(De.REMOVED,r)},t}(Ln);function TI(n){var t="default";if(Fn(n)&&n instanceof Image)t="image";else if(fe(n))t="symbol";else if(Ge(n)){var e=new RegExp("data:(image|text)");n.match(e)?t="base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(n)?t="url":t="symbol"}return t}function OI(n){var t=TI(n);return["base64","url","image"].includes(t)?"image":n&&t==="symbol"?"path":null}var en=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(e,r){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s,l=this.getSubShapeStyle(e),c=l.symbol,u=l.size,h=u===void 0?16:u,d=(0,G._T)(l,["symbol","size"]),f=OI(c);Qr(!!f,ve(r),function(v){v.maybeAppendByClassName("marker",f).attr("className","marker ".concat(f,"-marker")).call(function(g){if(f==="image"){var p=h*2;g.styles({img:c,width:p,height:p,x:a-h,y:o-h})}else{var p=h/2,y=fe(c)?c:t.getSymbol(c);g.styles((0,G.pi)({d:y==null?void 0:y(a,o,p)},d))}})})},t.MARKER_SYMBOL_MAP=new Map,t.registerSymbol=function(e,r){t.MARKER_SYMBOL_MAP.set(e,r)},t.getSymbol=function(e){return t.MARKER_SYMBOL_MAP.get(e)},t.getSymbols=function(){return Array.from(t.MARKER_SYMBOL_MAP.keys())},t}(Ln);en.registerSymbol("cross",fI),en.registerSymbol("hyphen",pI),en.registerSymbol("line",gx),en.registerSymbol("plus",gI),en.registerSymbol("tick",vI),en.registerSymbol("circle",vx),en.registerSymbol("point",sI),en.registerSymbol("bowtie",dI),en.registerSymbol("hexagon",hI),en.registerSymbol("square",oI),en.registerSymbol("diamond",lI),en.registerSymbol("triangle",cI),en.registerSymbol("triangle-down",uI),en.registerSymbol("line",gx),en.registerSymbol("dot",px),en.registerSymbol("dash",mI),en.registerSymbol("smooth",yI),en.registerSymbol("hv",bI),en.registerSymbol("vh",xI),en.registerSymbol("hvh",EI),en.registerSymbol("vhv",wI),en.registerSymbol("focus",MI);function J7(n,t,e){var r=Math.round((n-e)/t);return e+r*t}function CI(n,t,e){var r=1.4,i=r*e;return[["M",n-e,t-i],["L",n+e,t-i],["L",n+e,t+i],["L",n-e,t+i],["Z"]]}var mx=1.4,yx=.4;function NI(n,t,e){var r=e,i=r*mx,a=r/2,s=r/6,o=n+i*yx;return[["M",n,t],["L",o,t+a],["L",n+i,t+a],["L",n+i,t-a],["L",o,t-a],["Z"],["M",o,t+s],["L",n+i-2,t+s],["M",o,t-s],["L",n+i-2,t-s]]}function kI(n,t,e){var r=e,i=r*mx,a=r/2,s=r/6,o=t+i*yx;return[["M",n,t],["L",n-a,o],["L",n-a,t+i],["L",n+a,t+i],["L",n+a,o],["Z"],["M",n-s,o],["L",n-s,t+i-2],["M",n+s,o],["L",n+s,t+i-2]]}en.registerSymbol("hiddenHandle",CI),en.registerSymbol("verticalHandle",NI),en.registerSymbol("horizontalHandle",kI);var $7=function(n,t,e){return n===void 0&&(n="horizontal"),n==="horizontal"?t:e};function tj(n,t,e,r){var i;r===void 0&&(r=4);var a=__read(n,2),s=a[0],o=a[1],l=__read(t,2),c=l[0],u=l[1],h=__read(e,2),d=h[0],f=h[1],v=__read([c,u],2),g=v[0],p=v[1],y=p-g;return g>p&&(i=__read([p,g],2),g=i[0],p=i[1]),y>o-s?[s,o]:g<s?d===s&&f===p?[s,p]:[s,y+s]:p>o?f===o&&d===g?[g,o]:[o-y,o]:[g,p]}function e0(n,t,e){return n===void 0&&(n="horizontal"),n==="horizontal"?t:e}function ej(n){var t=n&&n.getRenderBounds();if(!t)return{width:0,height:0};var e=t.getMax(),r=t.getMin();return{width:e[0]-r[0],height:e[1]-r[1]}}function bx(n){var t=n.getLocalBounds(),e=t.min,r=t.max,i=(0,G.CR)([e,r],2),a=(0,G.CR)(i[0],2),s=a[0],o=a[1],l=(0,G.CR)(i[1],2),c=l[0],u=l[1];return{x:s,y:o,width:c-s,height:u-o,left:s,bottom:u,top:o,right:c}}function nj(n,t){var e=select(n).append("text").node();return e.attr(__assign(__assign({},t),{visibility:"hidden"})),e}function PI(n,t){var e=(0,G.CR)(n,2),r=e[0],i=e[1],a=(0,G.CR)(t,2),s=a[0],o=a[1];return r!==s&&i===o}function rj(n,t){var e=__read(n,2),r=e[0],i=e[1],a=__read(t,2),s=a[0],o=a[1];return r===s&&i!==o}function RI(n,t){var e,r,i=t.attributes;try{for(var a=(0,G.XA)(Object.entries(i)),s=a.next();!s.done;s=a.next()){var o=(0,G.CR)(s.value,2),l=o[0],c=o[1];l!=="id"&&l!=="className"&&n.attr(l,c)}}catch(u){e={error:u}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}}function wa(n){return typeof n=="function"?n():Ge(n)||ie(n)?new Jv({style:{text:String(n)}}):n}function LI(n,t){return typeof n=="function"?n():Ge(n)||ie(n)?new co({style:(0,G.pi)((0,G.pi)({},t),{innerHTML:String(n)})}):n}var Ph,n0;function ij(n){n0=n}var _I=jv(function(n,t){var e=t.fontSize,r=t.fontFamily,i=t.fontWeight,a=t.fontStyle,s=t.fontVariant;return n0?n0(n,e):(Ph||(Ph=Vt.offscreenCanvasCreator.getOrCreateContext(void 0)),Ph.font=[a,s,i,"".concat(e,"px"),r].join(" "),Ph.measureText(n).width)},function(n,t){return[n,Object.values(t||xx(n)).join()].join("")},4096),xx=function(n){var t=n.style.fontFamily||"sans-serif",e=n.style.fontWeight||"normal",r=n.style.fontStyle||"normal",i=n.style.fontVariant,a=n.style.fontSize;return a=typeof a=="object"?a.value:a,{fontSize:a,fontFamily:t,fontWeight:e,fontStyle:r,fontVariant:i}};function Ex(n){return n.nodeName==="text"?n:n.nodeName==="g"&&n.children.length===1&&n.children[0].nodeName==="text"?n.children[0]:null}function wx(n,t){var e=Ex(n);e&&e.attr(t)}function r0(n,t,e){e===void 0&&(e="..."),wx(n,{wordWrap:!0,wordWrapWidth:t,maxLines:1,textOverflow:e})}function i0(n,t){for(var e in t)t.hasOwnProperty(e)&&e!=="constructor"&&t[e]!==void 0&&(n[e]=t[e])}function DI(n,t,e,r){return t&&i0(n,t),e&&i0(n,e),r&&i0(n,r),n}function II(n){return n instanceof Element||n instanceof Document}var Ie,BI="component-poptip",Re={CONTAINER:"component-poptip",ARROW:"component-poptip-arrow",TEXT:"component-poptip-text"},Sx=(Ie={},Ie[".".concat(Re.CONTAINER)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},Ie[".".concat(Re.TEXT)]={"text-align":"center"},Ie[".".concat(Re.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, -100%)"},Ie[".".concat(Re.CONTAINER,"[data-position='left']")]={transform:"translate(-100%, -50%)"},Ie[".".concat(Re.CONTAINER,"[data-position='right']")]={transform:"translate(0, -50%)"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},Ie[".".concat(Re.CONTAINER,"[data-position='top-left']")]={transform:"translate(0,-100%)"},Ie[".".concat(Re.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},Ie[".".concat(Re.CONTAINER,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},Ie[".".concat(Re.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},Ie[".".concat(Re.CONTAINER,"[data-position='right-top']")]={transform:"translate(0, 0)"},Ie[".".concat(Re.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},Ie[".".concat(Re.ARROW)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},Ie[".".concat(Re.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},Ie["[data-position='top'] .".concat(Re.ARROW)]={bottom:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},Ie["[data-position='left'] .".concat(Re.ARROW)]={right:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='right']")]={transform:"translate(5px, -50%)"},Ie["[data-position='right'] .".concat(Re.ARROW)]={left:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},Ie["[data-position='bottom'] .".concat(Re.ARROW)]={top:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},Ie["[data-position='top-left'] .".concat(Re.ARROW)]={left:"10px",bottom:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},Ie["[data-position='top-right'] .".concat(Re.ARROW)]={right:"10px",bottom:"-2px"},Ie[".".concat(Re.CONTAINER,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},Ie["[data-position='left-top'] .".concat(Re.ARROW)]={right:"-2px",top:"8px"},Ie[".".concat(Re.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},Ie["[data-position='left-bottom'] .".concat(Re.ARROW)]={right:"-2px",bottom:"8px"},Ie[".".concat(Re.CONTAINER,"[data-position='right-top']")]={transform:"translate(5px, 0)"},Ie["[data-position='right-top'] .".concat(Re.ARROW)]={left:"-2px",top:"8px"},Ie[".".concat(Re.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},Ie["[data-position='right-bottom'] .".concat(Re.ARROW)]={left:"-2px",bottom:"8px"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},Ie["[data-position='bottom-left'] .".concat(Re.ARROW)]={top:"-2px",left:"8px"},Ie[".".concat(Re.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},Ie["[data-position='bottom-right'] .".concat(Re.ARROW)]={top:"-2px",right:"8px"},Ie),FI=void 0;function zI(n,t,e,r,i,a){if(i===void 0&&(i=!1),a===void 0&&(a=!1),a)return[n,t];var s=e.getBoundingClientRect(),o=s.x,l=s.y,c=s.width,u=s.height;switch(r){case"top":return i?[o+c/2,l]:[n,l];case"left":return i?[o,l+u/2]:[o,t];case"bottom":return i?[o+c/2,l+u]:[n,l+u];case"right":return i?[o+c,l+u/2]:[o+c,t];case"top-right":case"right-top":return[o+c,l];case"left-bottom":case"bottom-left":return[o,l+u];case"right-bottom":case"bottom-right":return[o+c,l+u];case"top-left":case"left-top":default:return[o,l]}}var jI=function(n){var t;return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t||(t=n.apply(FI,e)),t}};function ZI(n){var t=n&&document.getElementById(n);return t||(t=document.createElement("div"),t.setAttribute("id",n),document.body.appendChild(t)),t}function WI(n){var t=jI(ZI)(n);return t}var GI=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,pr({style:{id:BI}},t.defaultOptions,e))||this;return r.visibility="visible",r.map=new Map,r.domStyles="",r.initShape(),r.render(r.attributes,r),r}return Object.defineProperty(t.prototype,"visible",{get:function(){return this.visibility==="visible"},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){this.visibility=this.style.visibility,this.updatePoptipElement()},t.prototype.update=function(e){this.attr(pr({},this.style,e)),this.render(this.attributes,this)},t.prototype.bind=function(e,r){var i=this;if(e){var a=this.style.text,s=function(l){var c=e,u=i.style,h=a;if(r){var d=typeof r=="function"?r.call(null,l):r,f=d.html,v=d.target,g=(0,G._T)(d,["html","target"]);u=DI({},i.style,g),(v||v===!1)&&(c=v),typeof f=="string"&&(h=f)}var p=u.position,y=u.arrowPointAtCenter,b=u.follow,E=u.offset;if(c){var O=l,P=O.clientX,L=O.clientY,F=(0,G.CR)(zI(P,L,c,p,y,b),2),I=F[0],V=F[1];i.showTip(I,V,{text:h,position:p,offset:E})}else i.hideTip()},o=function(){i.hideTip()};e.addEventListener("mousemove",s),e.addEventListener("mouseleave",o),this.map.set(e,[s,o])}},t.prototype.unbind=function(e){if(this.map.has(e)){var r=(0,G.CR)(this.map.get(e)||[],2),i=r[0],a=r[1];i&&e.removeEventListener("mousemove",i),a&&e.removeEventListener("mouseleave",a),this.map.delete(e)}},t.prototype.clear=function(){this.container.innerHTML=""},t.prototype.destroy=function(){var e=this,r;(0,G.ev)([],(0,G.CR)(this.map.keys()),!1).forEach(function(i){return e.unbind(i)}),(r=this.container)===null||r===void 0||r.remove(),n.prototype.destroy.call(this)},t.prototype.showTip=function(e,r,i){var a=yr(i,"text");if(!(a&&typeof a!="string")&&(this.applyStyles(),e&&r&&i)){var s=i.offset,o=i.position;if(o&&this.container.setAttribute("data-position",o),this.setOffsetPosition(e,r,s),typeof a=="string"){var l=this.container.querySelector(".".concat(Re.TEXT));l&&(l.innerHTML=a)}this.visibility="visible",this.container.style.visibility="visible"}},t.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},t.prototype.getContainer=function(){return this.container},t.prototype.getClassName=function(){var e=this.style.containerClassName;return"".concat(Re.CONTAINER).concat(e?" ".concat(e):"")},t.prototype.initShape=function(){var e=this,r=this.style.id;this.container=WI(r),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",function(){return e.showTip()}),this.container.addEventListener("mouseleave",function(){return e.hideTip()})},t.prototype.updatePoptipElement=function(){var e=this.container;this.clear();var r=this.style,i=r.id,a=r.template,s=r.text;this.container.setAttribute("id",i),this.container.className=this.getClassName();var o='<span class="'.concat(Re.ARROW,'"></span>');e.innerHTML=o,Ge(a)?e.innerHTML+=a:a&&II(a)&&e.appendChild(a),s&&(e.getElementsByClassName(Re.TEXT)[0].textContent=s),this.applyStyles(),this.container.style.visibility=this.visibility},t.prototype.applyStyles=function(){var e=Jn({},Sx,this.style.domStyles),r=Object.entries(e).reduce(function(a,s){var o=(0,G.CR)(s,2),l=o[0],c=o[1],u=Object.entries(c).reduce(function(h,d){var f=(0,G.CR)(d,2),v=f[0],g=f[1];return"".concat(h).concat(v,": ").concat(g,";")},"");return"".concat(a).concat(l,"{").concat(u,"}")},"");if(this.domStyles!==r){this.domStyles=r;var i=this.container.querySelector("style");i&&this.container.removeChild(i),i=document.createElement("style"),i.innerHTML=r,this.container.appendChild(i)}},t.prototype.setOffsetPosition=function(e,r,i){i===void 0&&(i=this.style.offset);var a=(0,G.CR)(i,2),s=a[0],o=s===void 0?0:s,l=a[1],c=l===void 0?0:l;this.container.style.left="".concat(e+o,"px"),this.container.style.top="".concat(r+c,"px")},t.tag="poptip",t.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:Sx,template:'<div class="'.concat(Re.TEXT,'"></div>')}},t}(Ln),Nr=Zi({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",focusGroup:"focus-group",focus:"focus",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),VI={offset:[0,20],domStyles:{".component-poptip":{opacity:"1",padding:"8px 12px",background:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},".component-poptip-arrow":{display:"none"},".component-poptip-text":{color:"#000",lineHeight:"20px"}}};function UI(n){var t=n.querySelector(Nr.marker.class);return t?t.style:{}}var YI=function(n){(0,G.ZT)(t,n);function t(e){return n.call(this,e,{span:[1,1],marker:function(){return new Ji({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Object.defineProperty(t.prototype,"showValue",{get:function(){var e=this.attributes.valueText;return e?typeof e=="string"||typeof e=="number"?e!=="":typeof e=="function"?!0:e.attr("text")!=="":!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"actualSpace",{get:function(){var e=this.labelGroup,r=this.valueGroup,i=this.attributes,a=i.markerSize,s=i.focus,o=i.focusMarkerSize,l=e.node().getBBox(),c=l.width,u=l.height,h=r.node().getBBox(),d=h.width,f=h.height,v=s?o!=null?o:12:0;return{markerWidth:a,labelWidth:c,valueWidth:d,focusWidth:v,height:Math.max(a,u,f)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"span",{get:function(){var e=this.attributes.span;if(!e)return[1,1];var r=(0,G.CR)(xr(e),2),i=r[0],a=r[1],s=this.showValue?a:0,o=i+s;return[i/o,s/o]},enumerable:!1,configurable:!0}),t.prototype.setAttribute=function(e,r){n.prototype.setAttribute.call(this,e,r)},Object.defineProperty(t.prototype,"shape",{get:function(){var e,r=this.attributes,i=r.markerSize,a=r.width,s=this.actualSpace,o=s.markerWidth,l=s.focusWidth,c=s.height,u=this.actualSpace,h=u.labelWidth,d=u.valueWidth,f=(0,G.CR)(this.spacing,3),v=f[0],g=f[1],p=f[2];if(a){var y=a-i-v-g-l-p,b=(0,G.CR)(this.span,2),E=b[0],O=b[1];e=(0,G.CR)([E*y,O*y],2),h=e[0],d=e[1]}var P=o+h+d+v+g+l+p;return{width:P,height:c,markerWidth:o,labelWidth:h,valueWidth:d,focusWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){var e=this.attributes,r=e.spacing,i=e.focus;if(!r)return[0,0,0];var a=(0,G.CR)(xr(r),3),s=a[0],o=a[1],l=a[2];return[s,this.showValue?o:0,i?l:0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){var e=this.shape,r=e.markerWidth,i=e.labelWidth,a=e.valueWidth,s=e.focusWidth,o=e.width,l=e.height,c=(0,G.CR)(this.spacing,3),u=c[0],h=c[1],d=c[2];return{height:l,width:o,markerWidth:r,labelWidth:i,valueWidth:a,focusWidth:s,position:[r/2,r+u,r+i+u+h,r+i+a+u+h+d+s/2]}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleSize",{get:function(){var e=UI(this.markerGroup.node()),r=this.attributes,i=r.markerSize,a=r.markerStrokeWidth,s=a===void 0?e.strokeWidth:a,o=r.markerLineWidth,l=o===void 0?e.lineWidth:o,c=r.markerStroke,u=c===void 0?e.stroke:c,h=+(s||l||(u?1:0))*Math.sqrt(2),d=this.markerGroup.node().getBBox(),f=d.width,v=d.height;return(1-h/Math.max(f,v))*i},enumerable:!1,configurable:!0}),t.prototype.renderMarker=function(e){var r=this,i=this.attributes.marker,a=ke(this.attributes,"marker");this.markerGroup=e.maybeAppendByClassName(Nr.markerGroup,"g").style("zIndex",0),Qr(!!i,this.markerGroup,function(){var s,o=r.markerGroup.node(),l=(s=o.childNodes)===null||s===void 0?void 0:s[0],c=typeof i=="string"?new en({style:{symbol:i},className:Nr.marker.name}):i();l?c.nodeName===l.nodeName?l instanceof en?l.update((0,G.pi)((0,G.pi)({},a),{symbol:i})):(RI(l,c),ve(l).styles(a)):(l.remove(),ve(c).attr("className",Nr.marker.name).styles(a),o.appendChild(c)):(c instanceof en||ve(c).attr("className",Nr.marker.name).styles(a),o.appendChild(c)),r.markerGroup.node().scale(1/r.markerGroup.node().getScale()[0]);var u=t0(r.markerGroup.node(),r.scaleSize,!0);r.markerGroup.node().style._transform="scale(".concat(u,")")})},t.prototype.renderLabel=function(e){var r=ke(this.attributes,"label"),i=r.text,a=(0,G._T)(r,["text"]);this.labelGroup=e.maybeAppendByClassName(Nr.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Nr.label,function(){return wa(i)}).styles(a)},t.prototype.renderValue=function(e){var r=this,i=ke(this.attributes,"value"),a=i.text,s=(0,G._T)(i,["text"]);this.valueGroup=e.maybeAppendByClassName(Nr.valueGroup,"g").style("zIndex",0),Qr(this.showValue,this.valueGroup,function(){r.valueGroup.maybeAppendByClassName(Nr.value,function(){return wa(a)}).styles(s)})},t.prototype.createPoptip=function(){var e=this.attributes.poptip,r=e||{},i=r.render,a=(0,G._T)(r,["render"]),s=new GI({style:Jn(VI,a)});return this.poptipGroup=s,s},t.prototype.bindPoptip=function(e){var r=this,i=this.attributes.poptip;if(i){var a=this.poptipGroup||this.createPoptip();a.bind(e,function(){var s=r.attributes,o=s.labelText,l=s.valueText,c=s.markerFill,u=typeof o=="string"?o:o==null?void 0:o.attr("text"),h=typeof l=="string"?l:l==null?void 0:l.attr("text");if(typeof i.render=="function")return{html:i.render({label:u,value:h,color:c})};var d="";return(typeof u=="string"||typeof u=="number")&&(d+='<div class="component-poptip-label">'.concat(u,"</div>")),(typeof h=="string"||typeof h=="number")&&(d+='<div class="component-poptip-value">'.concat(h,"</div>")),{html:d}})}},t.prototype.renderFocus=function(e){var r=this,i=this.attributes,a=i.focus,s=i.focusMarkerSize,o={x:0,y:0,size:s,opacity:.6,symbol:"focus",stroke:"#aaaaaa",lineWidth:1};Te(a)||(this.focusGroup=e.maybeAppendByClassName(Nr.focusGroup,"g").style("zIndex",0),Qr(a,this.focusGroup,function(){var l=new en({style:(0,G.pi)((0,G.pi)({},o),{symbol:"focus"})}),c=new Ji({style:{r:o.size/2,fill:"transparent"}}),u=r.focusGroup.node();u.appendChild(c),u.appendChild(l),l.update({opacity:0}),e.node().addEventListener("pointerenter",function(){l.update({opacity:1})}),e.node().addEventListener("pointerleave",function(){l.update({opacity:0})})}))},t.prototype.renderPoptip=function(e){var r=this,i=this.attributes.poptip;if(i){var a=e.maybeAppendByClassName(Nr.value,"g").node(),s=e.maybeAppendByClassName(Nr.label,"g").node();[a,s].forEach(function(o){o&&r.bindPoptip(o)})}},t.prototype.renderBackground=function(e){var r=this.shape,i=r.width,a=r.height,s=ke(this.attributes,"background");this.background=e.maybeAppendByClassName(Nr.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Nr.background,"rect").styles((0,G.pi)({width:i,height:a},s))},t.prototype.adjustLayout=function(){var e=this.layout,r=e.labelWidth,i=e.valueWidth,a=e.height,s=(0,G.CR)(e.position,4),o=s[0],l=s[1],c=s[2],u=s[3],h=a/2;this.markerGroup.styles({transform:"translate(".concat(o,", ").concat(h,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(l,", ").concat(h,")")}),this.focusGroup&&this.focusGroup.styles({transform:"translate(".concat(u,", ").concat(h,")")}),r0(this.labelGroup.select(Nr.label.class).node(),Math.ceil(r)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(c,", ").concat(h,")")}),r0(this.valueGroup.select(Nr.value.class).node(),Math.ceil(i)))},t.prototype.render=function(e,r){var i=ve(r),a=e.x,s=a===void 0?0:a,o=e.y,l=o===void 0?0:o;i.styles({transform:"translate(".concat(s,", ").concat(l,")")}),this.renderMarker(i),this.renderLabel(i),this.renderValue(i),this.renderBackground(i),this.renderPoptip(i),this.renderFocus(i),this.adjustLayout()},t}(Ln),Us=Zi({page:"item-page",navigator:"navigator",item:"item"},"items"),Mx=function(n,t,e){return e===void 0&&(e=!0),n?t(n):e},HI=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:$v,mouseenter:$v,mouseleave:$v})||this;return r.navigatorShape=[0,0],r}return Object.defineProperty(t.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grid",{get:function(){var e=this.attributes,r=e.gridRow,i=e.gridCol,a=e.data;if(!r&&!i)throw new Error("gridRow and gridCol can not be set null at the same time");return r&&i?[r,i]:r?[r,a.length]:[a.length,i]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderData",{get:function(){var e=this.attributes,r=e.data,i=e.layout,a=e.poptip,s=e.focus,o=e.focusMarkerSize,l=ke(this.attributes,"item"),c=r.map(function(u,h){var d=u.id,f=d===void 0?h:d,v=u.label,g=u.value;return{id:"".concat(f),index:h,style:(0,G.pi)({layout:i,labelText:v,valueText:g,poptip:a,focus:s,focusMarkerSize:o},Object.fromEntries(Object.entries(l).map(function(p){var y=(0,G.CR)(p,2),b=y[0],E=y[1];return[b,qr(E,[u,h,r])]})))}});return c},enumerable:!1,configurable:!0}),t.prototype.getGridLayout=function(){var e=this,r=this.attributes,i=r.orientation,a=r.width,s=r.rowPadding,o=r.colPadding,l=(0,G.CR)(this.navigatorShape,1),c=l[0],u=(0,G.CR)(this.grid,2),h=u[0],d=u[1],f=d*h,v=0;return this.pageViews.children.map(function(g,p){var y,b,E=Math.floor(p/f),O=p%f,P=e.ifHorizontal(d,h),L=[Math.floor(O/P),O%P];i==="vertical"&&L.reverse();var F=(0,G.CR)(L,2),I=F[0],V=F[1],Y=(a-c-(d-1)*o)/d,J=g.getBBox().height,$=(0,G.CR)([0,0],2),ot=$[0],ct=$[1];return i==="horizontal"?(y=(0,G.CR)([v,I*(J+s)],2),ot=y[0],ct=y[1],v=V===d-1?0:v+Y+o):(b=(0,G.CR)([V*(Y+o),v],2),ot=b[0],ct=b[1],v=I===h-1?0:v+J+s),{page:E,index:p,row:I,col:V,pageIndex:O,width:Y,height:J,x:ot,y:ct}})},t.prototype.getFlexLayout=function(){var e=this.attributes,r=e.width,i=e.height,a=e.rowPadding,s=e.colPadding,o=(0,G.CR)(this.navigatorShape,1),l=o[0],c=(0,G.CR)(this.grid,2),u=c[0],h=c[1],d=(0,G.CR)([r-l,i],2),f=d[0],v=d[1],g=(0,G.CR)([0,0,0,0,0,0,0,0],8),p=g[0],y=g[1],b=g[2],E=g[3],O=g[4],P=g[5],L=g[6],F=g[7];return this.pageViews.children.map(function(I,V){var Y,J,$,ot,ct=I.getBBox(),ft=ct.width,Nt=ct.height,Ot=L===0?0:s,mt=L+Ot+ft;if(mt<=f&&Mx(O,function(Rt){return Rt<h}))return Y=(0,G.CR)([L+Ot,F,mt],3),p=Y[0],y=Y[1],L=Y[2],{width:ft,height:Nt,x:p,y,page:b,index:V,pageIndex:E++,row:P,col:O++};J=(0,G.CR)([P+1,0,0,F+Nt+a],4),P=J[0],O=J[1],L=J[2],F=J[3];var yt=F+Nt;return yt<=v&&Mx(P,function(Rt){return Rt<u})?($=(0,G.CR)([L,F,ft],3),p=$[0],y=$[1],L=$[2],{width:ft,height:Nt,x:p,y,page:b,index:V,pageIndex:E++,row:P,col:O++}):(ot=(0,G.CR)([0,0,ft,0,b+1,0,0,0],8),p=ot[0],y=ot[1],L=ot[2],F=ot[3],b=ot[4],E=ot[5],P=ot[6],O=ot[7],{width:ft,height:Nt,x:p,y,page:b,index:V,pageIndex:E++,row:P,col:O++})})},Object.defineProperty(t.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var e=this.attributes.layout==="grid"?this.getGridLayout:this.getFlexLayout,r=e.call(this);return r.slice(-1)[0].page>0?(this.navigatorShape=[55,0],e.call(this)):r},enumerable:!1,configurable:!0}),t.prototype.ifHorizontal=function(e,r){var i=this.attributes.orientation;return e0(i,e,r)},t.prototype.flattenPage=function(e){e.querySelectorAll(Us.item.class).forEach(function(r){e.appendChild(r)}),e.querySelectorAll(Us.page.class).forEach(function(r){var i=e.removeChild(r);i.destroy()})},t.prototype.renderItems=function(e){var r=this.attributes,i=r.click,a=r.mouseenter,s=r.mouseleave;this.flattenPage(e);var o=this.dispatchCustomEvent.bind(this);ve(e).selectAll(Us.item.class).data(this.renderData,function(l){return l.id}).join(function(l){return l.append(function(c){var u=c.style;return new YI({style:u})}).attr("className",Us.item.name).on("click",function(){i==null||i(this),o("itemClick",{item:this})}).on("pointerenter",function(){a==null||a(this),o("itemMouseenter",{item:this})}).on("pointerleave",function(){s==null||s(this),o("itemMouseleave",{item:this})})},function(l){return l.each(function(c){var u=c.style;this.update(u)})},function(l){return l.remove()})},t.prototype.relayoutNavigator=function(){var e,r=this.attributes,i=r.layout,a=r.width,s=((e=this.pageViews.children[0])===null||e===void 0?void 0:e.getBBox().height)||0,o=(0,G.CR)(this.navigatorShape,2),l=o[0],c=o[1];this.navigator.update(i==="grid"?{pageWidth:a-l,pageHeight:s-c}:{})},t.prototype.adjustLayout=function(){var e=this,r=Object.entries(tI(this.itemsLayout,"page")).map(function(a){var s=(0,G.CR)(a,2),o=s[0],l=s[1];return{page:o,layouts:l}}),i=(0,G.ev)([],(0,G.CR)(this.navigator.getContainer().children),!1);r.forEach(function(a){var s=a.layouts,o=e.pageViews.appendChild(new rr({className:Us.page.name}));s.forEach(function(l){var c=l.x,u=l.y,h=l.index,d=l.width,f=l.height,v=i[h];o.appendChild(v),bl(v,"__layout__",l),v.update({x:c,y:u,width:d,height:f})})}),this.relayoutNavigator()},t.prototype.renderNavigator=function(e){var r=this.attributes.orientation,i=ke(this.attributes,"nav"),a=Jn({orientation:r},i),s=this;return e.selectAll(Us.navigator.class).data(["nav"]).join(function(o){return o.append(function(){return new AI({style:a})}).attr("className",Us.navigator.name).each(function(){s.navigator=this})},function(o){return o.each(function(){this.update(a)})},function(o){return o.remove()}),this.navigator},t.prototype.getBBox=function(){return this.navigator.getBBox()},t.prototype.render=function(e,r){var i=this.attributes.data;if(!(!i||i.length===0)){var a=this.renderNavigator(ve(r));this.renderItems(a.getContainer()),this.adjustLayout()}},t.prototype.dispatchCustomEvent=function(e,r){var i=new Kn(e,{detail:r});this.dispatchEvent(i)},t}(Ln),Il=Zi({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Ax={showLabel:!0,formatter:function(n){return n.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},aj=function(n){(0,G.ZT)(t,n);function t(e){return n.call(this,e,Ax)||this}return t.prototype.render=function(e,r){var i=ve(r).maybeAppendByClassName(Il.markerGroup,"g");this.renderMarker(i);var a=ve(r).maybeAppendByClassName(Il.labelGroup,"g");this.renderLabel(a)},t.prototype.renderMarker=function(e){var r=this,i=this.attributes,a=i.orientation,s=i.markerSymbol,o=s===void 0?e0(a,"horizontalHandle","verticalHandle"):s;Qr(!!o,e,function(l){var c=ke(r.attributes,"marker"),u=(0,G.pi)({symbol:o},c);r.marker=l.maybeAppendByClassName(Il.marker,function(){return new en({style:u})}).update(u)})},t.prototype.renderLabel=function(e){var r=this,i=this.attributes,a=i.showLabel,s=i.orientation,o=i.spacing,l=o===void 0?0:o,c=i.formatter;Qr(a,e,function(u){var h,d=ke(r.attributes,"label"),f=d.text,v=(0,G._T)(d,["text"]),g=((h=u.select(Il.marker.class))===null||h===void 0?void 0:h.node().getBBox())||{},p=g.width,y=p===void 0?0:p,b=g.height,E=b===void 0?0:b,O=(0,G.CR)(e0(s,[0,E+l,"center","top"],[y+l,0,"start","middle"]),4),P=O[0],L=O[1],F=O[2],I=O[3];u.maybeAppendByClassName(Il.label,"text").styles((0,G.pi)((0,G.pi)({},v),{x:P,y:L,text:c(f).toString(),textAlign:F,textBaseline:I}))})},t}(Ln),Tx={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},XI=Jn({},Tx,{}),sj=Jn({},Tx,Mo(Ax,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),oj=.01,lj=.5,Bl=Zi({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),KI=function(n){(0,G.ZT)(t,n);function t(e){return n.call(this,e,XI)||this}return t.prototype.renderTitle=function(e,r,i){var a=this.attributes,s=a.showTitle,o=a.titleText,l=ke(this.attributes,"title"),c=(0,G.CR)(Ea(l),2),u=c[0],h=c[1];this.titleGroup=e.maybeAppendByClassName(Bl.titleGroup,"g").styles(h);var d=(0,G.pi)((0,G.pi)({width:r,height:i},u),{text:s?o:""});this.title=this.titleGroup.maybeAppendByClassName(Bl.title,function(){return new $D({style:d})}).update(d)},t.prototype.renderItems=function(e,r){var i=r.x,a=r.y,s=r.width,o=r.height,l=ke(this.attributes,"title",!0),c=(0,G.CR)(Ea(l),2),u=c[0],h=c[1],d=(0,G.pi)((0,G.pi)({},u),{width:s,height:o,x:0,y:0});this.itemsGroup=e.maybeAppendByClassName(Bl.itemsGroup,"g").styles((0,G.pi)((0,G.pi)({},h),{transform:"translate(".concat(i,", ").concat(a,")")}));var f=this;this.itemsGroup.selectAll(Bl.items.class).data(["items"]).join(function(v){return v.append(function(){return new HI({style:d})}).attr("className",Bl.items.name).each(function(){f.items=ve(this)})},function(v){return v.update(d)},function(v){return v.remove()})},t.prototype.adjustLayout=function(){var e=this.attributes.showTitle;if(e){var r=this.title.node().getAvailableSpace(),i=r.x,a=r.y;this.itemsGroup.node().style.transform="translate(".concat(i,", ").concat(a,")")}},Object.defineProperty(t.prototype,"availableSpace",{get:function(){var e=this.attributes,r=e.showTitle,i=e.width,a=e.height;return r?this.title.node().getAvailableSpace():new Cr(0,0,i,a)},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var e,r,i=(e=this.title)===null||e===void 0?void 0:e.node(),a=(r=this.items)===null||r===void 0?void 0:r.node();return!i||!a?n.prototype.getBBox.call(this):QD(i,a)},t.prototype.render=function(e,r){var i=this.attributes,a=i.width,s=i.height,o=i.x,l=o===void 0?0:o,c=i.y,u=c===void 0?0:c,h=ve(r);r.style.transform="translate(".concat(l,", ").concat(u,")"),this.renderTitle(h,a,s),this.renderItems(h,this.availableSpace),this.adjustLayout()},t}(Ln);function a0(n){const{width:t,height:e,renderer:r}=n,i=QI(n),a=new gf({width:t,height:e,container:i,renderer:r||new Sl});return[i,a]}function QI(n){var t;const{container:e,className:r,graphCanvas:i}=n;if(e)return typeof e=="string"?document.getElementById(e):e;const a=So(r,!1),{width:s,height:o,containerStyle:l}=n,[c,u]=qI(n);return Object.assign(a.style,Object.assign({position:"absolute",left:c+"px",top:u+"px",width:s+"px",height:o+"px"},l)),(t=i.getContainer())===null||t===void 0||t.appendChild(a),a}function qI(n){const{width:t,height:e,placement:r,graphCanvas:i}=n,[a,s]=i.getSize(),[o,l]=My(r);return[o*(a-t),l*(s-e)]}var JI=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Rh extends br{constructor(t,e){super(t,Object.assign({},Rh.defaultOptions,e)),this.typePrefix="__data__",this.draw=!1,this.fieldMap={node:new Map,edge:new Map,combo:new Map},this.selectedItems=[],this.bindEvents=()=>{const{graph:r}=this.context;r.on(Kt.AFTER_DRAW,this.createElement)},this.changeState=(r,i)=>{const{graph:a}=this.context,{typePrefix:s}=this,o=yr(r,[s,"id"]),l=yr(r,[s,"style","labelText"]),[c]=o.split("__"),u=this.fieldMap[c].get(l)||[];a.setElementState(Object.fromEntries(u==null?void 0:u.map(h=>[h,i])))},this.click=r=>{if(this.options.trigger==="hover")return;const i=yr(r,[this.typePrefix,"id"]);this.selectedItems.includes(i)?(this.selectedItems=this.selectedItems.filter(a=>a!==i),this.changeState(r,[])):(this.selectedItems.push(i),this.changeState(r,"selected"))},this.mouseleave=r=>{this.options.trigger!=="click"&&(this.selectedItems=[],this.changeState(r,[]))},this.mouseenter=r=>{if(this.options.trigger==="click")return;const i=yr(r,[this.typePrefix,"id"]);this.selectedItems.includes(i)?this.selectedItems=this.selectedItems.filter(a=>a!==i):(this.selectedItems.push(i),this.changeState(r,"active"))},this.setFieldMap=(r,i,a)=>{if(!r)return;const s=this.fieldMap[a];if(s)if(!s.has(r))s.set(r,[i]);else{const o=s.get(r);o&&(o.push(i),s.set(r,o))}},this.getEvents=()=>({mouseenter:this.mouseenter,mouseleave:this.mouseleave,click:this.click}),this.getMarkerData=(r,i)=>{if(!r)return[];const{model:a,element:s}=this.context,{nodes:o,edges:l,combos:c}=a.getData(),u={},h=p=>fe(r)?r(p):r,d={node:"circle",edge:"line",combo:"rect"},f={circle:"circle",ellipse:"circle",image:"bowtie",rect:"square",star:"cross",triangle:"triangle",diamond:"diamond",cubic:"dot",line:"hyphen",polyline:"hyphen",quadratic:"hv","cubic-horizontal":"hyphen","cubic-vertical":"line"},v=(p,y)=>s==null?void 0:s.getElementComputedStyle(p,y),g=(p,y)=>{p.forEach(b=>{const{id:E}=b,O=yr(b,["data",h(b)]),P=(s==null?void 0:s.getElementType(y,b))||"circle",L=v(y,b),F=(y==="edge"?L==null?void 0:L.stroke:L==null?void 0:L.fill)||"#1783ff";E&&O&&O.replace(/\s+/g,"")&&(this.setFieldMap(O,E,y),u[O]||(u[O]={id:`${y}__${E}`,label:O,marker:f[P]||d[y],elementType:y,lineWidth:1,stroke:F,fill:F}))})};switch(i){case"node":g(o,"node");break;case"edge":g(l,"edge");break;case"combo":g(c,"combo");break;default:return[]}return Object.values(u)},this.createElement=()=>{if(this.draw){this.updateElement();return}const r=this.options,{width:i,height:a,nodeField:s,edgeField:o,comboField:l,trigger:c,position:u,container:h,containerStyle:d,className:f}=r,v=JI(r,["width","height","nodeField","edgeField","comboField","trigger","position","container","containerStyle","className"]),g=this.getMarkerData(s,"node"),p=this.getMarkerData(o,"edge"),y=this.getMarkerData(l,"combo"),b=[...g,...y,...p],E=Object.assign({width:i,height:a,data:b,itemMarkerLineWidth:({lineWidth:L})=>L,itemMarker:({marker:L})=>L,itemMarkerStroke:({stroke:L})=>L,itemMarkerFill:({fill:L})=>L,gridCol:g.length},v,this.getEvents()),O=new KI({className:"legend",style:E});this.category=O,this.upsertCanvas().appendChild(O),this.draw=!0},this.bindEvents()}update(t){super.update(t),this.clear(),this.createElement()}clear(){var t,e;(t=this.canvas)===null||t===void 0||t.destroy(),(e=this.container)===null||e===void 0||e.remove(),this.canvas=void 0,this.container=void 0,this.draw=!1}updateElement(){this.category&&this.category.update({itemMarkerOpacity:({id:t})=>!this.selectedItems.length||this.selectedItems.includes(t)?1:.5,itemLabelOpacity:({id:t})=>!this.selectedItems.length||this.selectedItems.includes(t)?1:.5})}upsertCanvas(){if(this.canvas)return this.canvas;const t=this.context.canvas,[e,r]=t.getSize(),{width:i=e,height:a=r,position:s,container:o,containerStyle:l,className:c}=this.options,[u,h]=a0({width:i,height:a,graphCanvas:t,container:o,containerStyle:l,placement:s,className:"legend"});return this.container=u,c&&u.classList.add(c),this.canvas=h,this.canvas}destroy(){this.clear(),this.context.graph.off(Kt.AFTER_DRAW,this.createElement),super.destroy()}}Rh.defaultOptions={position:"bottom",trigger:"hover",orientation:"horizontal",layout:"flex",itemSpacing:4,rowPadding:10,colPadding:10,itemMarkerSize:16,itemLabelFontSize:16,width:240,height:160};class Lh extends br{constructor(t,e){super(t,Object.assign({},Lh.defaultOptions,e)),this.onDraw=r=>{var i;!((i=r==null?void 0:r.data)===null||i===void 0)&&i.render||this.onRender()},this.shapes=new Map,this.landmarkMap=new Map,this.mask=null,this.isMaskDragging=!1,this.onMaskDragStart=r=>{this.mask&&(this.isMaskDragging=!0,this.mask.setPointerCapture(r.pointerId),this.mask.addEventListener("pointermove",this.onMaskDrag),this.mask.addEventListener("pointerup",this.onMaskDragEnd),this.mask.addEventListener("pointercancel",this.onMaskDragEnd))},this.onMaskDrag=r=>{if(!this.mask||!this.isMaskDragging)return;const{size:[i,a]}=this.options,{movementX:s,movementY:o}=r,{left:l,top:c,width:u,height:h}=this.mask.style,[,,d,f]=this.maskBBox;let v=parseInt(l)+s,g=parseInt(c)+o,p=parseInt(u),y=parseInt(h);v<0&&(v=0),g<0&&(g=0),v+p>i&&(v=Ja(i-p,0)),g+y>a&&(g=Ja(a-y,0)),p<d&&(s>0?(v=Ja(v-s,0),p=qa(p+s,i)):s<0&&(p=qa(p-s,i))),y<f&&(o>0?(g=Ja(g-o,0),y=qa(y+o,a)):o<0&&(y=qa(y-o,a))),Object.assign(this.mask.style,{left:v+"px",top:g+"px",width:p+"px",height:y+"px"});const b=parseInt(l)-v,E=parseInt(c)-g;if(b===0&&E===0)return;const O=this.context.canvas.getCamera().getZoom(),P=this.canvas.getCamera().getZoom(),L=O/P;this.context.graph.translateBy([b*L,E*L],!1)},this.onMaskDragEnd=r=>{this.mask&&(this.isMaskDragging=!1,this.mask.releasePointerCapture(r.pointerId),this.mask.removeEventListener("pointermove",this.onMaskDrag),this.mask.removeEventListener("pointerup",this.onMaskDragEnd),this.mask.removeEventListener("pointercancel",this.onMaskDragEnd))},this.onTransform=Rm(()=>{this.isMaskDragging||(this.updateMask(),this.setCamera())},32,{leading:!0}),this.setOnRender(),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),"delay"in t&&this.setOnRender(),this.bindEvents()}setOnRender(){this.onRender=Cl(()=>{this.renderMinimap(),this.renderMask()},this.options.delay)}bindEvents(){const{graph:t}=this.context;t.on(Kt.AFTER_DRAW,this.onDraw),t.on(Kt.AFTER_RENDER,this.onRender),t.on(Kt.AFTER_ANIMATE,this.onRender),t.on(Kt.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(Kt.AFTER_DRAW,this.onDraw),t.off(Kt.AFTER_RENDER,this.onRender),t.off(Kt.AFTER_ANIMATE,this.onRender),t.off(Kt.AFTER_TRANSFORM,this.onTransform)}renderMinimap(){const t=this.getElements(),e=this.initCanvas();this.setShapes(e,t)}getElements(){const{filter:t}=this.options,{model:e,element:r}=this.context,i=e.getData(),a={nodes:i.nodes.filter(c=>r==null?void 0:r.getElement(At(c))),edges:i.edges.filter(c=>{const u=r==null?void 0:r.getElement(At(c));return u&&T1(u)}),combos:i.combos.filter(c=>r==null?void 0:r.getElement(At(c)))};if(!t)return a;const{nodes:s,edges:o,combos:l}=a;return{nodes:s.filter(c=>t(At(c),"node")),edges:o.filter(c=>t(At(c),"edge")),combos:l.filter(c=>t(At(c),"combo"))}}setShapes(t,e){const{nodes:r,edges:i,combos:a}=e,{shape:s}=this.options,{element:o}=this.context;if(s==="key"){const c=new Set,u=h=>{const d=At(h);c.add(d);const f=o.getElement(d);if(!f)return;const v=f.getShape("key"),g=this.shapes.get(d)||v.cloneNode();g.setPosition(v.getPosition()),f.style.zIndex&&(g.style.zIndex=f.style.zIndex),g.id=f.id,this.shapes.has(d)?Object.entries(v.attributes).forEach(([p,y])=>{g.style[p]!==y&&(g.style[p]=y)}):(t.appendChild(g),this.shapes.set(d,g))};i.forEach(u),a.forEach(u),r.forEach(u),this.shapes.forEach((h,d)=>{c.has(d)||(t.removeChild(h),this.shapes.delete(d))});return}const l=(c,u)=>{const d=o.getElement(c).getPosition();return u.setPosition(d),u};t.removeChildren(),i.forEach(c=>t.appendChild(s(At(c),"edge"))),a.forEach(c=>{t.appendChild(l(At(c),s(At(c),"combo")))}),r.forEach(c=>{t.appendChild(l(At(c),s(At(c),"node")))})}initCanvas(){const{renderer:t,size:[e,r]}=this.options;if(this.canvas){const{width:i,height:a}=this.canvas.getConfig();(e!==i||r!==a)&&this.canvas.resize(e,r),t&&this.canvas.setRenderer(t)}else{const{className:i,position:a,container:s,containerStyle:o}=this.options,[l,c]=a0({renderer:t,width:e,height:r,placement:a,className:"minimap",container:s,containerStyle:o,graphCanvas:this.context.canvas});i&&l.classList.add(i),this.container=l,this.canvas=c}return this.setCamera(),this.canvas}createLandmark(t,e,r){const i=`${t.join(",")}-${e.join(",")}-${r}`;if(this.landmarkMap.has(i))return this.landmarkMap.get(i);const s=this.canvas.getCamera().createLandmark(i,{position:t,focalPoint:e,zoom:r});return this.landmarkMap.set(i,s),s}setCamera(){var t;const{canvas:e}=this.context,r=(t=this.canvas)===null||t===void 0?void 0:t.getCamera();if(!r)return;const{size:[i,a],padding:s}=this.options,[o,l,c,u]=Ri(s),{min:h,max:d,center:f}=e.getBounds("elements"),v=d[0]-h[0],g=d[1]-h[1],p=i-u-l,y=a-o-c,b=p/v,E=y/g,O=Math.min(b,E),P=this.createLandmark(f,f,O);r.gotoLandmark(P,0)}get maskBBox(){const{canvas:t}=this.context,e=t.getSize(),r=t.getCanvasByViewport([0,0]),i=t.getCanvasByViewport(e),a=this.canvas.canvas2Viewport(Bi(r)),s=this.canvas.canvas2Viewport(Bi(i)),o=s.x-a.x,l=s.y-a.y;return[a.x,a.y,o,l]}calculateMaskBBox(){const{size:[t,e]}=this.options;let[r,i,a,s]=this.maskBBox;return r<0&&(a=qa(a+r,t),r=0),i<0&&(s=qa(s+i,e),i=0),r+a>t&&(a=Ja(t-r,0)),i+s>e&&(s=Ja(e-i,0)),[qa(r,t),qa(i,e),Ja(a,0),Ja(s,0)]}renderMask(){const{maskStyle:t}=this.options;this.mask||(this.mask=document.createElement("div"),this.mask.addEventListener("pointerdown",this.onMaskDragStart),this.mask.draggable=!0,this.mask.addEventListener("dragstart",e=>e.preventDefault&&e.preventDefault())),this.container.appendChild(this.mask),Object.assign(this.mask.style,Object.assign(Object.assign({},t),{cursor:"move",position:"absolute",pointerEvents:"auto"})),this.updateMask()}updateMask(){if(!this.mask)return;const[t,e,r,i]=this.calculateMaskBBox();Object.assign(this.mask.style,{top:e+"px",left:t+"px",width:r+"px",height:i+"px"})}destroy(){var t,e,r;this.unbindEvents(),(t=this.canvas)===null||t===void 0||t.destroy(),(e=this.mask)===null||e===void 0||e.remove(),(r=this.container)===null||r===void 0||r.remove(),super.destroy()}}Lh.defaultOptions={size:[240,160],shape:"key",padding:10,position:"right-bottom",maskStyle:{border:"1px solid #ddd",background:"rgba(0, 0, 0, 0.1)"},containerStyle:{border:"1px solid #ddd",background:"#fff"},delay:128};const qa=(n,t)=>Math.min(n,t),Ja=(n,t)=>Math.max(n,t);var s0=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};const o0={x1:0,y1:0,x2:0,y2:0,visibility:"hidden"};class _h extends br{constructor(t,e){super(t,Object.assign({},_h.defaultOptions,e)),this.initSnapline=()=>{const r=this.context.canvas.getLayer("transient");this.horizontalLine||(this.horizontalLine=r.appendChild(new As({style:Object.assign(Object.assign({},o0),this.options.horizontalLineStyle)}))),this.verticalLine||(this.verticalLine=r.appendChild(new As({style:Object.assign(Object.assign({},o0),this.options.verticalLineStyle)})))},this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!0,this.autoSnapToLine=(r,i,a)=>s0(this,void 0,void 0,function*(){const{verticalX:s,horizontalY:o}=a,{tolerance:l}=this.options,{min:[c,u],max:[h,d],center:[f,v]}=i;let g=0,p=0;s!==null&&(kr(h,s)<l&&(g=s-h),kr(c,s)<l&&(g=s-c),kr(f,s)<l&&(g=s-f),g!==0&&(this.isVerticalSticking=!0)),o!==null&&(kr(d,o)<l&&(p=o-d),kr(u,o)<l&&(p=o-u),kr(v,o)<l&&(p=o-v),p!==0&&(this.isHorizontalSticking=!0)),(g!==0||p!==0)&&(yield this.context.graph.translateElementBy({[r]:[g,p]},!1))}),this.enableSnap=r=>{const{target:i}=r,a=.5;if(this.isHorizontalSticking||this.isVerticalSticking){const[s,o]=this.getDelta(r);if(this.isHorizontalSticking&&this.isVerticalSticking&&Math.abs(s)<=a&&Math.abs(o)<=a)return this.context.graph.translateElementBy({[i.id]:[-s,-o]},!1),!1;if(this.isHorizontalSticking&&Math.abs(o)<=a)return this.context.graph.translateElementBy({[i.id]:[0,-o]},!1),!1;if(this.isVerticalSticking&&Math.abs(s)<=a)return this.context.graph.translateElementBy({[i.id]:[-s,0]},!1),!1;this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!1,setTimeout(()=>{this.enableStick=!0},200)}return this.enableStick},this.calcSnaplineMetadata=(r,i)=>{const{tolerance:a,shape:s}=this.options,{min:[o,l],max:[c,u],center:[h,d]}=i;let f=null,v=null,g=null,p=null,y=null,b=null;return this.getNodes().some(E=>{if(Zn(r.id,E.id))return!1;const O=Ox(E,s).getRenderBounds(),{min:[P,L],max:[F,I],center:[V,Y]}=O;return f===null&&(kr(V,h)<a?f=V:kr(P,o)<a||kr(P,c)<a?f=P:(kr(F,c)<a||kr(F,o)<a)&&(f=F),f!==null&&(v=Math.min(L,l),g=Math.max(I,u))),p===null&&(kr(Y,d)<a?p=Y:kr(L,l)<a||kr(L,u)<a?p=L:(kr(I,u)<a||kr(I,l)<a)&&(p=I),p!==null&&(y=Math.min(P,o),b=Math.max(F,c))),f!==null&&p!==null}),{verticalX:f,verticalMinY:v,verticalMaxY:g,horizontalY:p,horizontalMinX:y,horizontalMaxX:b}},this.onDragStart=()=>{this.initSnapline()},this.onDrag=r=>s0(this,void 0,void 0,function*(){const{target:i}=r;if(this.options.autoSnap&&!this.enableSnap(r))return;const a=Ox(i,this.options.shape).getRenderBounds(),s=this.calcSnaplineMetadata(i,a);this.hideSnapline(),(s.verticalX!==null||s.horizontalY!==null)&&this.updateSnapline(s),this.options.autoSnap&&(yield this.autoSnapToLine(i.id,a,s))}),this.onDragEnd=()=>{this.hideSnapline()},this.bindEvents()}getNodes(){var t;const{filter:e}=this.options,i=(((t=this.context.element)===null||t===void 0?void 0:t.getNodes())||[]).filter(a=>{var s;return T1(a)&&((s=this.context.viewport)===null||s===void 0?void 0:s.isInViewport(a.getRenderBounds()))});return e?i.filter(a=>e(a)):i}hideSnapline(){this.horizontalLine.style.visibility="hidden",this.verticalLine.style.visibility="hidden"}getLineWidth(t){const{lineWidth:e}=this.options[`${t}LineStyle`];return+(e||o0.lineWidth||1)/this.context.graph.getZoom()}updateSnapline(t){const{verticalX:e,verticalMinY:r,verticalMaxY:i,horizontalY:a,horizontalMinX:s,horizontalMaxX:o}=t,[l,c]=this.context.canvas.getSize(),{offset:u}=this.options;a!==null?Object.assign(this.horizontalLine.style,{x1:u===1/0?0:s-u,y1:a,x2:u===1/0?l:o+u,y2:a,visibility:"visible",lineWidth:this.getLineWidth("horizontal")}):this.horizontalLine.style.visibility="hidden",e!==null?Object.assign(this.verticalLine.style,{x1:e,y1:u===1/0?0:r-u,x2:e,y2:u===1/0?c:i+u,visibility:"visible",lineWidth:this.getLineWidth("vertical")}):this.verticalLine.style.visibility="hidden"}getDelta(t){const e=this.context.graph.getZoom();return Ii([t.dx,t.dy],e)}bindEvents(){return s0(this,void 0,void 0,function*(){const{graph:t}=this.context;t.on(bi.DRAG_START,this.onDragStart),t.on(bi.DRAG,this.onDrag),t.on(bi.DRAG_END,this.onDragEnd)})}unbindEvents(){const{graph:t}=this.context;t.off(bi.DRAG_START,this.onDragStart),t.off(bi.DRAG,this.onDrag),t.off(bi.DRAG_END,this.onDragEnd)}destroyElements(){var t,e;(t=this.horizontalLine)===null||t===void 0||t.destroy(),(e=this.verticalLine)===null||e===void 0||e.destroy()}destroy(){this.destroyElements(),this.unbindEvents(),super.destroy()}}_h.defaultOptions={tolerance:5,offset:20,autoSnap:!0,shape:"key",verticalLineStyle:{stroke:"#1783FF"},horizontalLineStyle:{stroke:"#1783FF"},filter:()=>!0};const kr=(n,t)=>Math.abs(n-t),Ox=(n,t)=>typeof t=="function"?t(n):n.getShape(t);var Cx=null,$I=null;function Dh(n){return n instanceof Date?n:new Date(n)}function t6(n){for(var t=__read(n,2),e=t[0],r=t[1],i=Cx.indexOf(e),a=Cx.indexOf(r),s="",o=i;o<=a;o+=1)if(s+=$I[o],o<a){var l="-";o===2?l=" ":o>2&&(l=":"),s+=l}return s}function Fr(n,t){var e={YYYY:n.getFullYear(),MM:n.getMonth()+1,DD:n.getDate(),HH:n.getHours(),mm:n.getMinutes(),ss:n.getSeconds()},r=t;return Object.keys(e).forEach(function(i){var a=e[i];r=r.replace(i,i==="YYYY"?"".concat(a):"".concat(a).padStart(2,"0"))}),r}function cj(n,t){return Dh(n).getTime()-Dh(t).getTime()}function uj(n,t){var e=__read([Dh(n),Dh(t)],2),r=e[0],i=e[1];return r.getFullYear()!==i.getFullYear()?"year":r.getMonth()!==i.getMonth()?"month":r.getDay()!==i.getDay()?"day":r.getHours()!==i.getHours()?"hour":r.getMinutes()!==i.getMinutes()?"minute":"second"}function hj(n,t){var e=new Date(n),r={year:function(i){i.setMonth(0),i.setHours(0,0,0,0)},month:function(i){i.setDate(1),i.setHours(0,0,0,0)},day:function(i){return i.setHours(0,0,0,0)},hour:function(i){return i.setMinutes(0,0,0)},minute:function(i){return i.setSeconds(0,0)},second:function(i){return i.setMilliseconds(0)}};return r[t](e),Fr(e,t6(["year",t]))}function e6(n,t){if(n.length<=t)return n;for(var e=Math.floor(n.length/t),r=[],i=0;i<n.length;i+=e)r.push(n[i]);return r}var l0={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new ni({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]},dj=pr({},l0,{style:{type:"arc"}}),fj=pr({},l0,{style:{}}),cn=Zi({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis");function Sa(n,t){return[n[0]*t,n[1]*t]}function Fl(n,t){return[n[0]+t[0],n[1]+t[1]]}function c0(n,t){return[n[0]-t[0],n[1]-t[1]]}function Ys(n,t){return[Math.min(n[0],t[0]),Math.min(n[1],t[1])]}function Hs(n,t){return[Math.max(n[0],t[0]),Math.max(n[1],t[1])]}function zl(n,t){return Math.sqrt(Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2))}function Nx(n){if(n[0]===0&&n[1]===0)return[0,0];var t=Math.sqrt(Math.pow(n[0],2)+Math.pow(n[1],2));return[n[0]/t,n[1]/t]}function vj(n,t,e){var r=__read(n,2),i=r[0],a=r[1],s=__read(t,2),o=s[0],l=s[1],c=i-o,u=a-l,h=Math.sin(e),d=Math.cos(e);return[c*d-u*h+o,c*h+u*d+l]}function n6(n,t){return t?[n[1],-n[0]]:[-n[1],n[0]]}function To(n){return n*Math.PI/180}function kx(n){return Number((n*180/Math.PI).toPrecision(5))}function Ih(n,t){return n.style.opacity||(n.style.opacity=1),Wi(n,{opacity:0},t)}var r6=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function i6(n){return r6.includes(n)}function Px(n){var t={};for(var e in n)i6(e)&&(t[e]=n[e]);return t}var Oo=Zi({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Rx(n){return n.reduce(function(t,e,r){return t.push((0,G.ev)([r===0?"M":"L"],(0,G.CR)(e),!1)),t},[])}function a6(n,t,e){var r=t.connect,i=r===void 0?"line":r,a=t.center;if(i==="line")return Rx(n);if(!a)return[];var s=zl(n[0],a),o=e?0:1;return n.reduce(function(l,c,u){return u===0?l.push((0,G.ev)(["M"],(0,G.CR)(c),!1)):l.push((0,G.ev)(["A",s,s,0,0,o],(0,G.CR)(c),!1)),l},[])}function u0(n,t,e){return t.type==="surround"?a6(n,t,e):Rx(n)}function s6(n,t,e){var r=e.type,i=e.connect,a=e.center,s=e.closed,o=s?[["Z"]]:[],l=(0,G.CR)([u0(n,e),u0(t.slice().reverse(),e,!0)],2),c=l[0],u=l[1],h=(0,G.CR)([n[0],t.slice(-1)[0]],2),d=h[0],f=h[1],v=function(b,E){return[c,b,u,E,o].flat()};if(i==="line"||r==="surround")return v([(0,G.ev)(["L"],(0,G.CR)(f),!1)],[(0,G.ev)(["L"],(0,G.CR)(d),!1)]);if(!a)throw new Error("Arc grid need to specified center");var g=(0,G.CR)([zl(f,a),zl(d,a)],2),p=g[0],y=g[1];return v([(0,G.ev)(["A",p,p,0,0,1],(0,G.CR)(f),!1),(0,G.ev)(["L"],(0,G.CR)(f),!1)],[(0,G.ev)(["A",y,y,0,0,0],(0,G.CR)(d),!1),(0,G.ev)(["L"],(0,G.CR)(d),!1)])}function o6(n,t,e,r){var i=e.animate,a=e.isBillboard,s=t.map(function(o,l){return{id:o.id||"grid-line-".concat(l),d:u0(o.points,e)}});return n.selectAll(Oo.line.class).data(s,function(o){return o.id}).join(function(o){return o.append("path").each(function(l,c){var u=qr(Px((0,G.pi)({d:l.d},r)),[l,c,s]);this.attr((0,G.pi)({class:Oo.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},u))})},function(o){return o.transition(function(l,c){var u=qr(Px((0,G.pi)({d:l.d},r)),[l,c,s]);return Wi(this,u,i.update)})},function(o){return o.transition(function(){var l=this,c=Ih(this,i.exit);return Ao(c,function(){return l.remove()}),c})}).transitions()}function l6(n,t,e){var r=e.animate,i=e.connect,a=e.areaFill;if(t.length<2||!a||!i)return[];for(var s=Array.isArray(a)?a:[a,"transparent"],o=function(v){return s[v%s.length]},l=[],c=0;c<t.length-1;c++){var u=(0,G.CR)([t[c].points,t[c+1].points],2),h=u[0],d=u[1],f=s6(h,d,e);l.push({d:f,fill:o(c)})}return n.selectAll(Oo.region.class).data(l,function(v,g){return g}).join(function(v){return v.append("path").each(function(g,p){var y=qr(g,[g,p,l]);this.attr(y)}).attr("className",Oo.region.name)},function(v){return v.transition(function(g,p){var y=qr(g,[g,p,l]);return Wi(this,y,r.update)})},function(v){return v.transition(function(){var g=this,p=Ih(this,r.exit);return Ao(p,function(){return g.remove()}),p})}).transitions()}function c6(n){var t=n.data,e=t===void 0?[]:t,r=n.closed;return r?e.map(function(i){var a=i.points,s=(0,G.CR)(a,1),o=s[0];return(0,G.pi)((0,G.pi)({},i),{points:(0,G.ev)((0,G.ev)([],(0,G.CR)(a),!1),[o],!1)})}):e}var u6=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(e,r){var i=e.type,a=e.center,s=e.areaFill,o=e.closed,l=(0,G._T)(e,["type","center","areaFill","closed"]),c=c6(e),u=ve(r).maybeAppendByClassName(Oo.lineGroup,"g"),h=ve(r).maybeAppendByClassName(Oo.regionGroup,"g"),d=o6(u,c,e,l),f=l6(h,c,e);return(0,G.ev)((0,G.ev)([],(0,G.CR)(d),!1),(0,G.CR)(f),!1)},t}(Ln),h6=function(n,t){return function(e){return n*(1-e)+t*e}};function d6(n,t){var e=t?t.length:0,r=n?Math.min(e,n.length):0;return function(i){var a=new Array(r),s=new Array(e),o=0;for(o=0;o<r;++o)a[o]=h0(n[o],t[o]);for(;o<e;++o)s[o]=t[o];for(o=0;o<r;++o)s[o]=a[o](i);return s}}function f6(n,t){n===void 0&&(n={}),t===void 0&&(t={});var e={},r={};return Object.entries(t).forEach(function(i){var a=(0,G.CR)(i,2),s=a[0],o=a[1];s in n?e[s]=h0(n[s],o):r[s]=o}),function(i){return Object.entries(e).forEach(function(a){var s=(0,G.CR)(a,2),o=s[0],l=s[1];return r[o]=l(i)}),r}}function h0(n,t){return typeof n=="number"&&typeof t=="number"?h6(n,t):Array.isArray(n)&&Array.isArray(t)?d6(n,t):typeof n=="object"&&typeof t=="object"?f6(n,t):function(e){return n}}function v6(n,t,e,r){if(!r)return n.attr("__keyframe_data__",e),null;var i=r.duration,a=i===void 0?0:i,s=h0(t,e),o=Math.ceil(+a/16),l=new Array(o).fill(0).map(function(c,u,h){return{__keyframe_data__:s(u/(h.length-1))}});return n.animate(l,(0,G.pi)({fill:"both"},r))}function Lx(n,t){var e={},r=Array.isArray(t)?t:[t];for(var i in n)r.includes(i)||(e[i]=n[i]);return e}function _x(n,t){return Object.fromEntries(Object.entries(n).map(function(e){var r=(0,G.CR)(e,2),i=r[0],a=r[1];return[i,qr(a,t)]}))}function gj(n){if(n.type==="linear"){var t=n.startPos,e=n.endPos;return __spreadArray(__spreadArray([],__read(t),!1),__read(e),!1)}var r=n.startAngle,i=n.endAngle,a=n.center,s=n.radius;return __spreadArray(__spreadArray([r,i],__read(a),!1),[s],!1)}function d0(n,t){return t&&fe(t)?n.filter(t):n}function Dx(n,t){var e=t.startAngle,r=t.endAngle;return(r-e)*n+e}function Bh(n,t){if(t.type==="linear"){var e=(0,G.CR)(t.startPos,2),r=e[0],i=e[1],a=(0,G.CR)(t.endPos,2),s=a[0],o=a[1],l=(0,G.CR)([s-r,o-i],2),c=l[0],u=l[1];return Nx([c,u])}var h=To(Dx(n,t));return[-Math.sin(h),Math.cos(h)]}function f0(n,t,e){var r=Bh(n,e);return n6(r,t!=="positive")}function Co(n,t){return f0(n,t.labelDirection,t)}function g6(n,t){var e=(0,G.CR)(t.startPos,2),r=e[0],i=e[1],a=(0,G.CR)(t.endPos,2),s=a[0],o=a[1],l=(0,G.CR)([s-r,o-i],2),c=l[0],u=l[1];return[r+c*n,i+u*n]}function p6(n,t){var e=t.radius,r=(0,G.CR)(t.center,2),i=r[0],a=r[1],s=To(Dx(n,t));return[i+e*Math.cos(s),a+e*Math.sin(s)]}function Fh(n,t){return t.type==="linear"?g6(n,t):p6(n,t)}function v0(n){return Bh(0,n)[1]===0}function Ix(n){return Bh(0,n)[0]===0}function Bx(n,t){return t-n===360}function Fx(n,t,e,r,i){var a=t-n,s=(0,G.CR)([i,i],2),o=s[0],l=s[1],c=(0,G.CR)([To(n),To(t)],2),u=c[0],h=c[1],d=function(Y){return[e+i*Math.cos(Y),r+i*Math.sin(Y)]},f=(0,G.CR)(d(u),2),v=f[0],g=f[1],p=(0,G.CR)(d(h),2),y=p[0],b=p[1];if(Bx(n,t)){var E=(h+u)/2,O=(0,G.CR)(d(E),2),P=O[0],L=O[1];return[["M",v,g],["A",o,l,0,1,0,P,L],["A",o,l,0,1,0,y,b]]}var F=a>180?1:0,I=n>t?0:1,V=!1;return V?"M".concat(e,",").concat(r,",L").concat(v,",").concat(g,",A").concat(o,",").concat(l,",0,").concat(F,",").concat(I,",").concat(y,",").concat(b,",L").concat(e,",").concat(r):"M".concat(v,",").concat(g,",A").concat(o,",").concat(l,",0,").concat(F,",").concat(I,",").concat(y,",").concat(b)}function m6(n){var t=n.attributes,e=t.startAngle,r=t.endAngle,i=t.center,a=t.radius;return(0,G.ev)((0,G.ev)([e,r],(0,G.CR)(i),!1),[a],!1)}function y6(n,t,e,r){var i=t.startAngle,a=t.endAngle,s=t.center,o=t.radius;return n.selectAll(cn.line.class).data([{d:Fx.apply(void 0,(0,G.ev)((0,G.ev)([i,a],(0,G.CR)(s),!1),[o],!1))}],function(l,c){return c}).join(function(l){return l.append("path").attr("className",cn.line.name).styles(t).styles({d:function(c){return c.d}})},function(l){return l.transition(function(){var c=this,u=v6(this,m6(this),(0,G.ev)((0,G.ev)([i,a],(0,G.CR)(s),!1),[o],!1),r.update);if(u){var h=function(){var d=yr(c.attributes,"__keyframe_data__");c.style.d=Fx.apply(void 0,(0,G.ev)([],(0,G.CR)(d),!1))};u.onframe=h,u.onfinish=h}return u}).styles(t)},function(l){return l.remove()}).styles(e).transitions()}function b6(n,t){var e=t.truncRange,r=t.truncShape,i=t.lineExtension}function x6(n,t,e){e===void 0&&(e=[0,0]);var r=(0,G.CR)([n,t,e],3),i=(0,G.CR)(r[0],2),a=i[0],s=i[1],o=(0,G.CR)(r[1],2),l=o[0],c=o[1],u=(0,G.CR)(r[2],2),h=u[0],d=u[1],f=(0,G.CR)([l-a,c-s],2),v=f[0],g=f[1],p=Math.sqrt(Math.pow(v,2)+Math.pow(g,2)),y=(0,G.CR)([-h/p,d/p],2),b=y[0],E=y[1];return[b*v,b*g,E*v,E*g]}function zx(n){var t=(0,G.CR)(n,2),e=(0,G.CR)(t[0],2),r=e[0],i=e[1],a=(0,G.CR)(t[1],2),s=a[0],o=a[1];return{x1:r,y1:i,x2:s,y2:o}}function E6(n,t,e,r){var i=t.showTrunc,a=t.startPos,s=t.endPos,o=t.truncRange,l=t.lineExtension,c=(0,G.CR)([a,s],2),u=(0,G.CR)(c[0],2),h=u[0],d=u[1],f=(0,G.CR)(c[1],2),v=f[0],g=f[1],p=(0,G.CR)(l?x6(a,s,l):new Array(4).fill(0),4),y=p[0],b=p[1],E=p[2],O=p[3],P=function(mt){return n.selectAll(cn.line.class).data(mt,function(yt,Rt){return Rt}).join(function(yt){return yt.append("line").attr("className",function(Rt){return"".concat(cn.line.name," ").concat(Rt.className)}).styles(e).transition(function(Rt){return Wi(this,zx(Rt.line),!1)})},function(yt){return yt.styles(e).transition(function(Rt){var jt=Rt.line;return Wi(this,zx(jt),r.update)})},function(yt){return yt.remove()}).transitions()};if(!i||!o)return P([{line:[[h+y,d+b],[v+E,g+O]],className:cn.line.name}]);var L=(0,G.CR)(o,2),F=L[0],I=L[1],V=v-h,Y=g-d,J=(0,G.CR)([h+V*F,d+Y*F],2),$=J[0],ot=J[1],ct=(0,G.CR)([h+V*I,d+Y*I],2),ft=ct[0],Nt=ct[1],Ot=P([{line:[[h+y,d+b],[$,ot]],className:cn.lineFirst.name},{line:[[ft,Nt],[v+E,g+O]],className:cn.lineSecond.name}]);return b6(n,t),Ot}function w6(n,t,e,r){var i=e.showArrow,a=e.showTrunc,s=e.lineArrow,o=e.lineArrowOffset,l=e.lineArrowSize,c;if(t==="arc"?c=n.select(cn.line.class):a?c=n.select(cn.lineSecond.class):c=n.select(cn.line.class),!i||!s||e.type==="arc"&&Bx(e.startAngle,e.endAngle)){var u=c.node();u&&(u.style.markerEnd=void 0);return}var h=wa(s);h.attr(r),t0(h,l,!0),c.style("markerEnd",h).style("markerEndOffset",-o)}function S6(n,t,e){var r=t.type,i,a=ke(t,"line");return r==="linear"?i=E6(n,t,Lx(a,"arrow"),e):i=y6(n,t,Lx(a,"arrow"),e),w6(n,r,t,a),i}function M6(n,t){return f0(n,t.gridDirection,t)}function jx(n){var t=n.type,e=n.gridCenter;return t==="linear"?e:e||n.center}function A6(n,t){var e=t.gridLength;return n.map(function(r,i){var a=r.value,s=(0,G.CR)(Fh(a,t),2),o=s[0],l=s[1],c=(0,G.CR)(Sa(M6(a,t),e),2),u=c[0],h=c[1];return{id:i,points:[[o,l],[o+u,l+h]]}})}function T6(n,t){var e=t.gridControlAngles,r=jx(t);if(!r)throw new Error("grid center is not provide");if(n.length<2)throw new Error("Invalid grid data");if(!e||e.length===0)throw new Error("Invalid gridControlAngles");var i=(0,G.CR)(r,2),a=i[0],s=i[1];return n.map(function(o,l){var c=o.value,u=(0,G.CR)(Fh(c,t),2),h=u[0],d=u[1],f=(0,G.CR)([h-a,d-s],2),v=f[0],g=f[1],p=[];return e.forEach(function(y){var b=To(y),E=(0,G.CR)([Math.cos(b),Math.sin(b)],2),O=E[0],P=E[1],L=v*O-g*P+a,F=v*P+g*O+s;p.push([L,F])}),{points:p,id:l}})}function O6(n,t,e,r){var i=ke(e,"grid"),a=i.type,s=i.areaFill,o=jx(e),l=d0(t,e.gridFilter),c=a==="segment"?A6(l,e):T6(l,e),u=(0,G.pi)((0,G.pi)({},i),{center:o,areaFill:fe(s)?l.map(function(h,d){return qr(s,[h,d,l])}):s,animate:r,data:c});return n.selectAll(cn.grid.class).data([1]).join(function(h){return h.append(function(){return new u6({style:u})}).attr("className",cn.grid.name)},function(h){return h.transition(function(){return this.update(u)})},function(h){return h.remove()}).transitions()}function Er(n,t,e,r,i){return r===void 0&&(r=!0),i===void 0&&(i=!1),r&&n===t||i&&n===e?!0:n>t&&n<e}var C6=function(n){var t=new DOMParser,e=t.parseFromString(n,"text/html"),r=e.body.firstElementChild;if(console.log(r==null?void 0:r.getClientRects(),11),!r)return 0;var i=r.getAttribute("style")||"",a=Object.fromEntries(i.split(";").map(function(p){return p.trim()}).filter(function(p){return p.includes(":")}).map(function(p){var y=(0,G.CR)(p.split(":").map(function(O){return O.trim()}),2),b=y[0],E=y[1];return[b.toLowerCase(),E]})),s=function(p){if(!p)return 0;var y=p.match(/([\d.]+)px/);return y?parseFloat(y[1]):0};if(a.height)return s(a.height);var o=s(a["font-size"])||16,l=a["line-height"],c;!l||l==="normal"?c=1.2*o:l.endsWith("px")?c=s(l):/^[\d.]+$/.test(l)?c=parseFloat(l)*o:c=o;var u=s(a["padding-top"]),h=s(a["padding-bottom"]);if(a.padding){var d=a.padding.split(/\s+/).map(s);d.length===1||d.length===2?(u=d[0],h=d[0]):(d.length===3||d.length===4)&&(u=d[0],h=d[2])}var f=s(a["border-top-width"]),v=s(a["border-bottom-width"]);if(a.border){var g=a.border.match(/([\d.]+)px/);g&&(f=parseFloat(g[1]),v=parseFloat(g[1]))}if(a["border-width"]){var d=a["border-width"].split(/\s+/).map(s);d.length===1||d.length===2?(f=d[0],v=d[0]):(d.length===3||d.length===4)&&(f=d[0],v=d[2])}return c+u+h+f+v};function N6(n,t,e,r){e===void 0&&(e=2),r===void 0&&(r="top"),wx(n,{wordWrap:!0,wordWrapWidth:t,maxLines:e,textBaseline:r})}function k6(n,t,e){var r=n.getBBox(),i=r.width,a=r.height,s=(0,G.CR)([t,e].map(function(c,u){var h;return c.includes("%")?parseFloat(((h=c.match(/[+-]?([0-9]*[.])?[0-9]+/))===null||h===void 0?void 0:h[0])||"0")/100*(u===0?i:a):c}),2),o=s[0],l=s[1];return[o,l]}function Zx(n,t){if(t)try{var e=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,r=t.replace(e,function(i,a,s){return"translate(".concat(k6(n,a,s),")")});n.attr("transform",r)}catch(i){}}var g0=function(){function n(t,e,r,i){this.set(t,e,r,i)}return Object.defineProperty(n.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),n.prototype.rotatedPoints=function(t,e,r){var i=this,a=i.x1,s=i.y1,o=i.x2,l=i.y2,c=Math.cos(t),u=Math.sin(t),h=e-e*c+r*u,d=r-e*u-r*c,f=[[c*a-u*l+h,u*a+c*l+d],[c*o-u*l+h,u*o+c*l+d],[c*a-u*s+h,u*a+c*s+d],[c*o-u*s+h,u*o+c*s+d]];return f},n.prototype.set=function(t,e,r,i){return r<t?(this.x2=t,this.x1=r):(this.x1=t,this.x2=r),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},n.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},n}();function zh(n,t){var e=n.getEulerAngles()||0;n.setEulerAngles(0);var r=n.getBounds(),i=(0,G.CR)(r.min,2),a=i[0],s=i[1],o=(0,G.CR)(r.max,2),l=o[0],c=o[1],u=n.getBBox(),h=u.width,d=u.height,f=d,v=0,g=0,p=a,y=s,b=Ex(n);if(b){f-=1.5;var E=b.style.textAlign,O=b.style.textBaseline;E==="center"?p=(a+l)/2:(E==="right"||E==="end")&&(p=l),O==="middle"?y=(s+c)/2:O==="bottom"&&(y=c)}var P=(0,G.CR)(xr(t),4),L=P[0],F=L===void 0?0:L,I=P[1],V=I===void 0?0:I,Y=P[2],J=Y===void 0?F:Y,$=P[3],ot=$===void 0?V:$,ct=new g0((v+=a)-ot,(g+=s)-F,v+h+V,g+f+J);return n.setEulerAngles(e),ct.rotatedPoints(To(e),p,y)}function jl(n,t){return t[0]<=Math.max(n[0][0],n[1][0])&&t[0]<=Math.min(n[0][0],n[1][0])&&t[1]<=Math.max(n[0][1],n[1][1])&&t[1]<=Math.min(n[0][1],n[1][1])}function Zl(n,t,e){var r=(t[1]-n[1])*(e[0]-t[0])-(t[0]-n[0])*(e[1]-t[1]);return r===0?0:r<0?2:1}function P6(n,t){var e=Zl(n[0],n[1],t[0]),r=Zl(n[0],n[1],t[1]),i=Zl(t[0],t[1],n[0]),a=Zl(t[0],t[1],n[1]);return!!(e!==r&&i!==a||e===0&&jl(n,t[0])||r===0&&jl(n,t[1])||i===0&&jl(t,n[0])||a===0&&jl(t,n[1]))}function R6(n,t){var e=n.length;if(e<3)return!1;var r=[t,[9999,t[1]]],i=0,a=0;do{var s=[n[a],n[(a+1)%e]];if(P6(s,r)){if(Zl(s[0],t,s[1])===0)return jl(s,t);i++}a=(a+1)%e}while(a!==0);return!!(i&1)}function L6(n,t){return t.every(function(e){return R6(n,e)})}function _6(n,t,e){var r=n.x1,i=n.x2,a=n.y1,s=n.y2,o=[[r,a],[i,a],[i,s],[r,s]],l=zh(t,e);return L6(o,l)}function Wx(n,t){var e=(0,G.CR)(n,4),r=e[0],i=e[1],a=e[2],s=e[3],o=(0,G.CR)(t,4),l=o[0],c=o[1],u=o[2],h=o[3],d=a-r,f=s-i,v=u-l,g=h-c,p=d*g-v*f;if(p===0)return!1;var y=p>0,b=r-l,E=i-c,O=d*E-f*b;if(O<0===y)return!1;var P=v*E-g*b;return!(P<0===y||O>p===y||P>p===y)}function Gx(n,t){var e=[[n[0],n[1],n[2],n[3]],[n[2],n[3],n[4],n[5]],[n[4],n[5],n[6],n[7]],[n[6],n[7],n[0],n[1]]];return e.some(function(r){return Wx(t,r)})}var pj={lineToLine:Wx,intersectBoxLine:Gx,getBounds:zh};function D6(n,t,e){var r,i,a=zh(n,e).flat(1),s=zh(t,e).flat(1),o=[[a[0],a[1],a[2],a[3]],[a[0],a[1],a[4],a[5]],[a[4],a[5],a[6],a[7]],[a[2],a[3],a[6],a[7]]];try{for(var l=(0,G.XA)(o),c=l.next();!c.done;c=l.next()){var u=c.value;if(Gx(s,u))return!0}}catch(h){r={error:h}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return!1}function I6(n,t){var e=n.type,r=n.labelDirection,i=n.crossSize;if(!i)return!1;if(e==="arc"){var a=n.center,s=n.radius,o=(0,G.CR)(a,2),l=o[0],c=o[1],u=r==="negative"?0:i,h=-s-u,d=s+u,f=(0,G.CR)(xr(t),4),v=f[0],g=f[1],p=f[2],y=f[3];return new g0(l+h-y,c+h-v,l+d+g,c+d+p)}var b=(0,G.CR)(n.startPos,2),E=b[0],O=b[1],P=(0,G.CR)(n.endPos,2),L=P[0],F=P[1],I=(0,G.CR)(Ix(n)?[-t,0,t,0]:[0,t,0,-t],4),V=I[0],Y=I[1],J=I[2],$=I[3],ot=Co(0,n),ct=Sa(ot,i),ft=new g0(E,O,L,F);return ft.x1+=$,ft.y1+=V,ft.x2+=Y+ct[0],ft.y2+=J+ct[1],ft}function jh(n,t,e){var r,i,a=t.crossPadding,s=new Set,o=null,l=I6(t,a),c=function(v){return l?_6(l,v):!0},u=function(v,g){return!v||!v.firstChild?!0:!D6(v.firstChild,g.firstChild,xr(e))};try{for(var h=(0,G.XA)(n),d=h.next();!d.done;d=h.next()){var f=d.value;c(f)?!o||u(o,f)?o=f:(s.add(o),s.add(f)):s.add(f)}}catch(v){r={error:v}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return Array.from(s)}function p0(n,t){return t===void 0&&(t={}),me(n)?0:typeof n=="number"?n:Math.floor(_I(n,t))}function B6(n,t,e,r){if(!(n.length<=0)){var i=t.suffix,a=i===void 0?"...":i,s=t.minLength,o=t.maxLength,l=o===void 0?1/0:o,c=t.step,u=c===void 0?" ":c,h=t.margin,d=h===void 0?[0,0,0,0]:h,f=xx(r.getTextShape(n[0])),v=p0(u,f),g=s?p0(s,f):v,p=p0(l,f);(me(p)||p===1/0)&&(p=Math.max.apply(null,n.map(function(ct){return ct.getBBox().width})));for(var y=n.slice(),b=(0,G.CR)(d,4),E=b[0],O=E===void 0?0:E,P=b[1],L=P===void 0?0:P,F=b[2],I=F===void 0?O:F,V=b[3],Y=V===void 0?L:V,J=function(ct){if(y.forEach(function(ft){r.ellipsis(r.getTextShape(ft),ct,a)}),y=jh(n,e,d),y.length<1)return{value:void 0}},$=p;$>g+v;$-=v){var ot=J($);if(typeof ot=="object")return ot.value}}}var F6=function(n){return n!==void 0&&n!=null&&!Number.isNaN(n)},z6={parity:function(n,t){var e=t.seq,r=e===void 0?2:e;return n.filter(function(i,a){return a%r?(ji(i),!1):!0})}},j6=function(n){return n.filter(F6)};function Z6(n,t,e,r){var i=n.length,a=t.keepHeader,s=t.keepTail;if(!(i<=1||i===2&&a&&s)){var o=z6.parity,l=function(E){return E.forEach(r.show),E},c=2,u=n.slice(),h=n.slice(),d=Math.min.apply(Math,(0,G.ev)([1],(0,G.CR)(n.map(function(E){return E.getBBox().width})),!1));if(e.type==="linear"&&(v0(e)||Ix(e))){var f=bx(n[0]).left,v=bx(n[i-1]).right,g=Math.abs(v-f)||1;c=Math.max(Math.floor(i*d/g),c)}var p,y;for(a&&(p=u.splice(0,1)[0]),s&&(y=u.splice(-1,1)[0],u.reverse()),l(u);c<n.length&&jh(j6(y?(0,G.ev)((0,G.ev)([y],(0,G.CR)(h),!1),[p],!1):(0,G.ev)([p],(0,G.CR)(h),!1)),e,t==null?void 0:t.margin).length;){if(y&&!p&&c%2===0){var b=u.splice(0,1);b.forEach(r.hide)}else if(y&&p){var b=u.splice(0,1);b.forEach(r.hide)}h=o(l(u),{seq:c}),c++}}}function W6(n,t,e,r){var i,a,s=t.optionalAngles,o=s===void 0?[0,45,90]:s,l=t.margin,c=t.recoverWhenFailed,u=c===void 0?!0:c,h=n.map(function(y){return y.getLocalEulerAngles()}),d=function(){return jh(n,e,l).length<1},f=function(y){return n.forEach(function(b,E){var O=Array.isArray(y)?y[E]:y;r.rotate(b,+O)})};try{for(var v=(0,G.XA)(o),g=v.next();!g.done;g=v.next()){var p=g.value;if(f(p),d())return}}catch(y){i={error:y}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}u&&f(h)}function G6(n){var t=n.type,e=n.labelDirection;return t==="linear"&&v0(n)?e==="negative"?"bottom":"top":"middle"}function V6(n,t,e,r,i){var a,s=t.maxLines,o=s===void 0?3:s,l=t.recoverWhenFailed,c=l===void 0?!0:l,u=t.margin,h=u===void 0?[0,0,0,0]:u,d=qr((a=t.wordWrapWidth)!==null&&a!==void 0?a:50,[i]),f=n.map(function(E){return E.attr("maxLines")||1}),v=Math.min.apply(Math,(0,G.ev)([],(0,G.CR)(f),!1)),g=function(){return jh(n,e,h).length<1},p=G6(e),y=function(E){return n.forEach(function(O,P){var L=Array.isArray(E)?E[P]:E;r.wrap(O,d,L,p)})};if(!(v>o)){if(e.type==="linear"&&v0(e)){if(y(o),g())return}else for(var b=v;b<=o;b++)if(y(b),g())return;c&&y(f)}}var U6=new Map([["hide",Z6],["rotate",W6],["ellipsis",B6],["wrap",V6]]);function Y6(n,t,e){return t.labelOverlap.length<1?!1:e==="hide"?!zD(n[0]):e==="rotate"?!n.some(function(r){var i;return!!(!((i=r.attr("transform"))===null||i===void 0)&&i.includes("rotate"))}):e==="ellipsis"||e==="wrap"?n.filter(function(r){return r.querySelector("text")}).length>=1:!0}function H6(n,t,e,r){var i=t.labelOverlap,a=i===void 0?[]:i;a.length&&a.forEach(function(s){var o=s.type,l=U6.get(o);Y6(n,t,o)&&(l==null||l(n,s,t,r,e))})}function X6(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=function(r){return r==="positive"?-1:1};return n.reduce(function(r,i){return r*e(i)},1)}function Vx(n){for(var t=n;t<0;)t+=360;return Math.round(t%360)}function m0(n,t){var e=(0,G.CR)(n,2),r=e[0],i=e[1],a=(0,G.CR)(t,2),s=a[0],o=a[1],l=(0,G.CR)([r*s+i*o,r*o-i*s],2),c=l[0],u=l[1];return Math.atan2(u,c)}function K6(n){var t=(n+360)%180;return Er(t,-90,90)||(t+=180),t}function Q6(n,t,e){var r,i=e.labelAlign,a=(r=t.style.transform)===null||r===void 0?void 0:r.includes("rotate");if(a)return t.getLocalEulerAngles();var s=0,o=Co(n.value,e),l=Bh(n.value,e);return i==="horizontal"?0:(i==="perpendicular"?s=m0([1,0],o):s=m0([l[0]<0?-1:1,0],l),K6(kx(s)))}function Ux(n,t,e){var r=e.type,i=e.labelAlign,a=Co(n,e),s=Vx(t),o=Vx(kx(m0([1,0],a))),l="center",c="middle";return r==="linear"?[90,270].includes(o)&&s===0?(l="center",c=a[1]===1?"top":"bottom"):!(o%180)&&[90,270].includes(s)?l="center":o===0?(Er(s,0,90,!1,!0)||Er(s,0,90)||Er(s,270,360))&&(l="start"):o===90?Er(s,0,90,!1,!0)?l="start":(Er(s,90,180)||Er(s,270,360))&&(l="end"):o===270?Er(s,0,90,!1,!0)?l="end":(Er(s,90,180)||Er(s,270,360))&&(l="start"):o===180&&(s===90?l="start":(Er(s,0,90)||Er(s,270,360))&&(l="end")):i==="parallel"?Er(o,0,180,!0)?c="top":c="bottom":i==="horizontal"?Er(o,90,270,!1)?l="end":(Er(o,270,360,!1)||Er(o,0,90))&&(l="start"):i==="perpendicular"&&(Er(o,90,270)?l="end":l="start"),{textAlign:l,textBaseline:c}}function q6(n,t,e){t.setLocalEulerAngles(n);var r=t.__data__.value,i=Ux(r,n,e),a=t.querySelector(cn.labelItem.class);a&&Hx(a,i)}function Yx(n,t,e){var r=e.showTick,i=e.tickLength,a=e.tickDirection,s=e.labelDirection,o=e.labelSpacing,l=t.indexOf(n),c=qr(o,[n,l,t]),u=(0,G.CR)([Co(n.value,e),X6(s,a)],2),h=u[0],d=u[1],f=d===1?qr(r?i:0,[n,l,t]):0,v=(0,G.CR)(Fl(Sa(h,c+f),Fh(n.value,e)),2),g=v[0],p=v[1];return{x:g,y:p}}function J6(n,t,e,r){var i=r.labelFormatter,a=fe(i)?function(){return wa(qr(i,[n,t,e,Co(n.value,r)]))}:function(){return wa(n.label||"")};return a}function $6(n,t,e,r){var i=r.labelRender,a=(yr(r,"endPos.0",400)-yr(r,"startPos.0",0))/e.length,s=fe(i)?qr(i,[n,t,e,Co(n.value,r)]):n.label||"",o=C6(s)||30;return function(){return LI(s,{width:a,height:o})}}function Hx(n,t){["text","html"].includes(n.nodeName)&&n.attr(t)}function t5(n,t){H6(this.node().childNodes,n,t,{hide:ji,show:Dl,rotate:function(e,r){q6(+r,e,n)},ellipsis:function(e,r,i){e&&r0(e,r||1/0,i)},wrap:function(e,r,i){e&&N6(e,r,i)},getTextShape:function(e){return e.querySelector("text")}})}function Xx(n,t,e,r,i){var a=e.indexOf(t),s=i.labelRender,o=ve(n).append(s?$6(t,a,e,i):J6(t,a,e,i)).attr("className",cn.labelItem.name).node(),l=(0,G.CR)(Ea(_x(r,[t,a,e])),2),c=l[0],u=l[1],h=u.transform,d=(0,G._T)(u,["transform"]);Zx(o,h);var f=Q6(t,o,i);return o.getLocalEulerAngles()||o.setLocalEulerAngles(f),Hx(o,(0,G.pi)((0,G.pi)({},Ux(t.value,f,i)),c)),n.attr(d),o}function e5(n,t,e,r,i){var a=d0(t,e.labelFilter),s=ke(e,"label"),o,l=n.selectAll(cn.label.class).data(a,function(c,u){return u}).join(function(c){return c.append("g").attr("className",cn.label.name).transition(function(u){Xx(this,u,t,s,e);var h=Yx(u,t,e),d=h.x,f=h.y;return this.style.transform="translate(".concat(d,", ").concat(f,")"),null})},function(c){return c.transition(function(u){var h=this.querySelector(cn.labelItem.class),d=Xx(this,u,t,s,e),f=iI(h,d,r.update),v=Yx(u,t,e),g=v.x,p=v.y,y=Wi(this,{transform:"translate(".concat(g,", ").concat(p,")")},r.update);return(0,G.ev)((0,G.ev)([],(0,G.CR)(f),!1),[y],!1)})},function(c){return o=c,c.transition(function(){var u=this,h=Ih(this.childNodes[0],r.exit);return Ao(h,function(){return ve(u).remove()}),h}),o}).transitions();return nI(l,function(){t5.call(n,e,i)}),l}function Kx(n,t){return f0(n,t.tickDirection,t)}function n5(n,t){var e=(0,G.CR)(n,2),r=e[0],i=e[1];return[[0,0],[r*t,i*t]]}function r5(n,t,e,r,i){var a=i.tickLength,s=(0,G.CR)(n5(r,qr(a,[n,t,e])),2),o=(0,G.CR)(s[0],2),l=o[0],c=o[1],u=(0,G.CR)(s[1],2),h=u[0],d=u[1];return{x1:l,x2:h,y1:c,y2:d}}function i5(n,t,e,r,i){var a=i.tickFormatter,s=Kx(t.value,i),o="line";return fe(a)&&(o=function(){return qr(a,[t,e,r,s])}),n.append(o).attr("className",cn.tickItem.name)}function a5(n,t,e,r,i,a,s){var o=Kx(n.value,a),l=r5(n,t,e,o,a),c=l.x1,u=l.x2,h=l.y1,d=l.y2,f=(0,G.CR)(Ea(_x(s,[n,t,e,o])),2),v=f[0],g=f[1];r.node().nodeName==="line"&&r.styles((0,G.pi)({x1:c,x2:u,y1:h,y2:d},v)),i.attr(g),r.styles(v)}function Qx(n,t,e,r,i,a){var s=i5(ve(this),n,t,e,r);a5(n,t,e,s,this,r,i);var o=(0,G.CR)(Fh(n.value,r),2),l=o[0],c=o[1];return Wi(this,{transform:"translate(".concat(l,", ").concat(c,")")},a)}function s5(n,t,e,r){var i=d0(t,e.tickFilter),a=ke(e,"tick");return n.selectAll(cn.tick.class).data(i,function(s){return s.id||s.label}).join(function(s){return s.append("g").attr("className",cn.tick.name).transition(function(o,l){return Qx.call(this,o,l,i,e,a,!1)})},function(s){return s.transition(function(o,l){return this.removeChildren(),Qx.call(this,o,l,i,e,a,r.update)})},function(s){return s.transition(function(){var o=this,l=Ih(this.childNodes[0],r.exit);return Ao(l,function(){return o.remove()}),l})}).transitions()}function o5(n,t,e){var r=e.titlePosition,i=r===void 0?"lb":r,a=e.titleSpacing,s=kh(i),o=n.node().getLocalBounds(),l=(0,G.CR)(o.min,2),c=l[0],u=l[1],h=(0,G.CR)(o.halfExtents,2),d=h[0],f=h[1],v=(0,G.CR)(t.node().getLocalBounds().halfExtents,2),g=v[0],p=v[1],y=(0,G.CR)([c+d,u+f],2),b=y[0],E=y[1],O=(0,G.CR)(xr(a),4),P=O[0],L=O[1],F=O[2],I=O[3];if(["start","end"].includes(i)&&e.type==="linear"){var V=e.startPos,Y=e.endPos,J=(0,G.CR)(i==="start"?[V,Y]:[Y,V],2),$=J[0],ot=J[1],ct=Nx([-ot[0]+$[0],-ot[1]+$[1]]),ft=(0,G.CR)(Sa(ct,P),2),Nt=ft[0],Ot=ft[1];return{x:$[0]+Nt,y:$[1]+Ot}}return s.includes("t")&&(E-=f+p+P),s.includes("r")&&(b+=d+g+L),s.includes("l")&&(b-=d+g+I),s.includes("b")&&(E+=f+p+F),{x:b,y:E}}function l5(n,t,e){var r=n.getGeometryBounds().halfExtents,i=r[1]*2;if(t==="vertical"){if(e==="left")return"rotate(-90) translate(0, ".concat(i/2,")");if(e==="right")return"rotate(-90) translate(0, -".concat(i/2,")")}return""}function qx(n,t,e,r,i){var a=ke(r,"title"),s=(0,G.CR)(Ea(a),2),o=s[0],l=s[1],c=l.transform,u=l.transformOrigin,h=(0,G._T)(l,["transform","transformOrigin"]);t.styles(h);var d=c||l5(n.node(),o.direction,o.position);n.styles((0,G.pi)((0,G.pi)({},o),{transformOrigin:u})),Zx(n.node(),d);var f=o5(ve(e._offscreen||e.querySelector(cn.mainGroup.class)),t,r),v=f.x,g=f.y,p=Wi(t.node(),{transform:"translate(".concat(v,", ").concat(g,")")},i);return p}function c5(n,t,e,r){var i=e.titleText;return n.selectAll(cn.title.class).data([{title:i}].filter(function(a){return!!a.title}),function(a,s){return a.title}).join(function(a){return a.append(function(){return wa(i)}).attr("className",cn.title.name).transition(function(){return qx(ve(this),n,t,e,r.enter)})},function(a){return a.transition(function(){return qx(ve(this),n,t,e,r.update)})},function(a){return a.remove()}).transitions()}function Jx(n,t,e,r){var i=n.showLine,a=n.showTick,s=n.showLabel,o=t.maybeAppendByClassName(cn.lineGroup,"g"),l=Qr(i,o,function(f){return S6(f,n,r)})||[],c=t.maybeAppendByClassName(cn.tickGroup,"g"),u=Qr(a,c,function(f){return s5(f,e,n,r)})||[],h=t.maybeAppendByClassName(cn.labelGroup,"g"),d=Qr(s,h,function(f){return e5(f,e,n,r,t.node())})||[];return(0,G.ev)((0,G.ev)((0,G.ev)([],(0,G.CR)(l),!1),(0,G.CR)(u),!1),(0,G.CR)(d),!1).filter(function(f){return!!f})}var u5=function(n){(0,G.ZT)(t,n);function t(e){return n.call(this,e,l0)||this}return t.prototype.render=function(e,r,i){var a=this,s=e.titleText,o=e.data,l=e.animate,c=e.showTitle,u=e.showGrid,h=e.dataThreshold,d=e.truncRange,f=e6(o,h).filter(function(P){var L=P.value;return!(d&&L>d[0]&&L<d[1])}),v=hx(i===void 0?l:i),g=ve(r).maybeAppendByClassName(cn.gridGroup,"g"),p=Qr(u,g,function(P){return O6(P,f,e,v)})||[],y=ve(r).maybeAppendByClassName(cn.mainGroup,"g");s&&(!this.initialized&&v.enter||this.initialized&&v.update)&&Jx(e,ve(this.offscreenGroup),f,hx(!1));var b=Jx(e,ve(y.node()),f,v),E=ve(r).maybeAppendByClassName(cn.titleGroup,"g"),O=Qr(c,E,function(P){return c5(P,a,e,v)})||[];return(0,G.ev)((0,G.ev)((0,G.ev)([],(0,G.CR)(p),!1),(0,G.CR)(b),!1),(0,G.CR)(O),!1).flat().filter(function(P){return!!P})},t}(Ln);function $x(n){var t=n.canvas,e=n.touches,r=n.offsetX,i=n.offsetY;if(t){var a=t.x,s=t.y;return[a,s]}if(e){var o=e[0],l=o.clientX,c=o.clientY;return[l,c]}return r&&i?[r,i]:[0,0]}function y0(n,t){return+n.toPrecision(t)}function mj(n){return n.toLocaleString()}function yj(n){return n.toExponential()}function bj(n,t){return t===void 0&&(t=0),Math.abs(n)<1e3?String(n):"".concat(y0(n/1e3,t).toLocaleString(),"K")}var xj=function(n,t,e){return n<0&&Number.isFinite(n)?t:e},Ej=function(n,t,e){return n>0&&Number.isFinite(n)?t:e},wj=function(n,t){return n*t},Sj=function(n,t){return n/2+(t||0)/2},b0=function(n){return n};class tE{constructor(t){this.options=pr({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=pr({},this.options,t),this.rescale(t)}rescale(t){}}function x0(n,t){return t-n?e=>(e-n)/(t-n):e=>.5}function Zh(n,...t){return t.reduce((e,r)=>i=>e(r(i)),n)}function h5(n,t,e,r,i){let a=e||0,s=r||n.length;const o=i||(l=>l);for(;a<s;){const l=Math.floor((a+s)/2);o(n[l])>t?s=l:a=l+1}return a}var d5=S(75196),f5=S.n(d5);function E0(n,t,e){let r=e;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?n+(t-n)*6*r:r<1/2?t:r<2/3?n+(t-n)*(2/3-r)*6:n}function v5(n){const t=n[0]/360,e=n[1]/100,r=n[2]/100,i=n[3];if(e===0)return[r*255,r*255,r*255,i];const a=r<.5?r*(1+e):r+e-r*e,s=2*r-a,o=E0(s,a,t+1/3),l=E0(s,a,t),c=E0(s,a,t-1/3);return[o*255,l*255,c*255,i]}function eE(n){const t=f5().get(n);if(!t)return null;const{model:e,value:r}=t;return e==="rgb"?r:e==="hsl"?v5(r):null}const Wh=(n,t)=>e=>n*(1-e)+t*e,g5=(n,t)=>{const e=eE(n),r=eE(t);return e===null||r===null?e?()=>n:()=>t:i=>{const a=new Array(4);for(let u=0;u<4;u+=1){const h=e[u],d=r[u];a[u]=h*(1-i)+d*i}const[s,o,l,c]=a;return`rgba(${Math.round(s)}, ${Math.round(o)}, ${Math.round(l)}, ${c})`}},p5=(n,t)=>typeof n=="number"&&typeof t=="number"?Wh(n,t):typeof n=="string"&&typeof t=="string"?g5(n,t):()=>n,m5=(n,t)=>{const e=Wh(n,t);return r=>Math.round(e(r))};function y5(n){return n===null}function nE(n){return!Te(n)&&!y5(n)&&!Number.isNaN(n)}const w0=Math.sqrt(50),S0=Math.sqrt(10),M0=Math.sqrt(2);function Gh(n,t,e){const r=(t-n)/Math.max(0,e),i=Math.floor(Math.log(r)/Math.LN10),a=r/is(10,i);return i>=0?(a>=w0?10:a>=S0?5:a>=M0?2:1)*is(10,i):-is(10,-i)/(a>=w0?10:a>=S0?5:a>=M0?2:1)}function Mj(n,t,e){const r=Math.abs(t-n)/Math.max(0,e);let i=is(10,Math.floor(Math.log(r)/Math.LN10));const a=r/i;return a>=w0?i*=10:a>=S0?i*=5:a>=M0&&(i*=2),t<n?-i:i}const b5=(n,t,e=5)=>{const r=[n,t];let i=0,a=r.length-1,s=r[i],o=r[a],l;return o<s&&([s,o]=[o,s],[i,a]=[a,i]),l=Gh(s,o,e),l>0?(s=Math.floor(s/l)*l,o=Math.ceil(o/l)*l,l=Gh(s,o,e)):l<0&&(s=Math.ceil(s*l)/l,o=Math.floor(o*l)/l,l=Gh(s,o,e)),l>0?(r[i]=Math.floor(s/l)*l,r[a]=Math.ceil(o/l)*l):l<0&&(r[i]=Math.ceil(s*l)/l,r[a]=Math.floor(o*l)/l),r};function x5(n,t){const e=t<n?t:n,r=n>t?n:t;return i=>Math.min(Math.max(e,i),r)}const E5=(n,t,e)=>{const[r,i]=n,[a,s]=t;let o,l;return r<i?(o=x0(r,i),l=e(a,s)):(o=x0(i,r),l=e(s,a)),Zh(l,o)},w5=(n,t,e)=>{const r=Math.min(n.length,t.length)-1,i=new Array(r),a=new Array(r),s=n[0]>n[r],o=s?[...n].reverse():n,l=s?[...t].reverse():t;for(let c=0;c<r;c+=1)i[c]=x0(o[c],o[c+1]),a[c]=e(l[c],l[c+1]);return c=>{const u=h5(n,c,1,r)-1,h=i[u],d=a[u];return Zh(d,h)(c)}},rE=(n,t,e,r)=>(Math.min(n.length,t.length)>2?w5:E5)(n,t,r?m5:e);class S5 extends tE{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Wh,tickCount:5}}map(t){return nE(t)?this.output(t):this.options.unknown}invert(t){return nE(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,r,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,r,...i)}getTicks(){const{tickMethod:t}=this.options,[e,r,i,...a]=this.getTickMethodOptions();return t(e,r,i,...a)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options,r=t[0],i=t[t.length-1];return[r,i,e]}chooseNice(){return b5}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:r}=this.options,i=this.options.domain.map(t),a=Math.min(i.length,r.length);return e?x5(i[0],i[a-1]):b0}composeOutput(t,e){const{domain:r,range:i,round:a,interpolate:s}=this.options,o=rE(r.map(t),i,s,a);this.output=Zh(o,e,t)}composeInput(t,e,r){const{domain:i,range:a}=this.options,s=rE(a,i.map(t),Wh);this.input=Zh(e,r,s)}}const M5=(n,t,e)=>{let r,i,a=n,s=t;if(a===s&&e>0)return[a];let o=Gh(a,s,e);if(o===0||!Number.isFinite(o))return[];if(o>0){a=Math.ceil(a/o),s=Math.floor(s/o),i=new Array(r=Math.ceil(s-a+1));for(let l=0;l<r;l+=1)i[l]=(a+l)*o}else{o=-o,a=Math.ceil(a*o),s=Math.floor(s*o),i=new Array(r=Math.ceil(s-a+1));for(let l=0;l<r;l+=1)i[l]=(a+l)/o}return i};class Wl extends S5{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:p5,tickMethod:M5,tickCount:5}}chooseTransforms(){return[b0,b0]}clone(){return new Wl(this.options)}}function iE({map:n,initKey:t},e){const r=t(e);return n.has(r)?n.get(r):e}function A5({map:n,initKey:t},e){const r=t(e);return n.has(r)?n.get(r):(n.set(r,e),e)}function T5({map:n,initKey:t},e){const r=t(e);return n.has(r)&&(e=n.get(r),n.delete(r)),e}function O5(n){return typeof n=="object"?n.valueOf():n}class aE extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=O5,t!==null)for(const[e,r]of t)this.set(e,r)}get(t){return super.get(iE({map:this.map,initKey:this.initKey},t))}has(t){return super.has(iE({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(A5({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(T5({map:this.map,initKey:this.initKey},t))}}const A0=Symbol("defaultUnknown");function sE(n,t,e){for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(e(t[r]),r)}function oE(n){const{value:t,from:e,to:r,mapper:i,notFoundReturn:a}=n;let s=i.get(t);if(s===void 0){if(a!==A0)return a;s=e.push(t)-1,i.set(t,s)}return r[s%r.length]}function lE(n){return n instanceof Date?t=>`${t}`:typeof n=="object"?t=>JSON.stringify(t):t=>t}class T0 extends tE{getDefaultOptions(){return{domain:[],range:[],unknown:A0}}constructor(t){super(t)}map(t){return this.domainIndexMap.size===0&&sE(this.domainIndexMap,this.getDomain(),this.domainKey),oE({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return this.rangeIndexMap.size===0&&sE(this.rangeIndexMap,this.getRange(),this.rangeKey),oE({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[r]=this.options.range;if(this.domainKey=lE(e),this.rangeKey=lE(r),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!t||t.range)&&this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new T0(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function C5(n){const t=Math.min(...n);return n.map(e=>e/t)}function N5(n,t){const e=n.length,r=t-e;return r>0?[...n,...new Array(r).fill(1)]:r<0?n.slice(0,t):n}function k5(n){return Math.round(n*1e12)/1e12}function P5(n){const{domain:t,range:e,paddingOuter:r,paddingInner:i,flex:a,round:s,align:o}=n,l=t.length,c=N5(a,l),[u,h]=e,d=h-u,f=2/l*r+1-1/l*i,v=d/f,g=v*i/l,p=v-l*g,y=C5(c),b=y.reduce(($,ot)=>$+ot),E=p/b,O=new aE(t.map(($,ot)=>{const ct=y[ot]*E;return[$,s?Math.floor(ct):ct]})),P=new aE(t.map(($,ot)=>{const ft=y[ot]*E+g;return[$,s?Math.floor(ft):ft]})),L=Array.from(P.values()).reduce(($,ot)=>$+ot),I=(d-(L-L/l*i))*o,V=u+I;let Y=s?Math.round(V):V;const J=new Array(l);for(let $=0;$<l;$+=1){J[$]=k5(Y);const ot=t[$];Y+=P.get(ot)}return{valueBandWidth:O,valueStep:P,adjustedRange:J}}function R5(n){var t;const{domain:e}=n,r=e.length;if(r===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((t=n.flex)===null||t===void 0)&&t.length))return P5(n);const{range:a,paddingOuter:s,paddingInner:o,round:l,align:c}=n;let u,h,d=a[0];const v=a[1]-d,g=s*2,p=r-o;u=v/Math.max(1,g+p),l&&(u=Math.floor(u)),d+=(v-u*(r-o))*c,h=u*(1-o),l&&(d=Math.round(d),h=Math.round(h));const y=new Array(r).fill(0).map((b,E)=>d+E*u);return{valueStep:u,valueBandWidth:h,adjustedRange:y}}class O0 extends T0{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:A0,flex:[]}}constructor(t){super(t)}clone(){return new O0(this.options)}getStep(t){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:t===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:t===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:r,round:i,flex:a}=this.options,{adjustedRange:s,valueBandWidth:o,valueStep:l}=R5({align:t,range:r,round:i,flex:a,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=l,this.valueBandWidth=o,this.adjustedRange=s}}var L5=function(n){(0,G.ZT)(t,n);function t(e){var r=this,i=e.style,a=(0,G._T)(e,["style"]);return r=n.call(this,pr({},{type:"column"},(0,G.pi)({style:i},a)))||this,r.columnsGroup=new rr({name:"columns"}),r.appendChild(r.columnsGroup),r.render(),r}return t.prototype.render=function(){var e=this.attributes,r=e.columns,i=e.x,a=e.y;this.columnsGroup.style.transform="translate(".concat(i,", ").concat(a,")"),ve(this.columnsGroup).selectAll(".column").data(r.flat()).join(function(s){return s.append("rect").attr("className","column").each(function(o){this.attr(o)})},function(s){return s.each(function(o){this.attr(o)})},function(s){return s.remove()})},t.prototype.update=function(e){this.attr(Jn({},this.attributes,e)),this.render()},t.prototype.clear=function(){this.removeChildren()},t}(yn),_5=function(n){(0,G.ZT)(t,n);function t(e){var r=this,i=e.style,a=(0,G._T)(e,["style"]);return r=n.call(this,pr({},{type:"lines"},(0,G.pi)({style:i},a)))||this,r.linesGroup=r.appendChild(new rr),r.areasGroup=r.appendChild(new rr),r.render(),r}return t.prototype.render=function(){var e=this.attributes,r=e.lines,i=e.areas,a=e.x,s=e.y;this.style.transform="translate(".concat(a,", ").concat(s,")"),r&&this.renderLines(r),i&&this.renderAreas(i)},t.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},t.prototype.update=function(e){this.attr(Jn({},this.attributes,e)),this.render()},t.prototype.renderLines=function(e){ve(this.linesGroup).selectAll(".line").data(e).join(function(r){return r.append("path").attr("className","line").each(function(i){this.attr(i)})},function(r){return r.each(function(i){this.attr(i)})},function(r){return r.remove()})},t.prototype.renderAreas=function(e){ve(this.linesGroup).selectAll(".area").data(e).join(function(r){return r.append("path").attr("className","area").each(function(i){this.attr(i)})},function(r){return r.each(function(i){this.style(i)})},function(r){return r.remove()})},t}(yn);function D5(n,t,e,r){var i,a=[],s=!!r,o,l,c=[1/0,1/0],u=[-1/0,-1/0],h,d,f;if(s){i=(0,G.CR)(r,2),c=i[0],u=i[1];for(var v=0,g=n.length;v<g;v+=1){var p=n[v];c=Ys(c,p),u=Hs(u,p)}}for(var v=0,y=n.length;v<y;v+=1){var p=n[v];if(v===0&&!e)f=p;else if(v===y-1&&!e)d=p,a.push(f),a.push(d);else{var b=[v?v-1:y-1,v-1][e?0:1];o=n[b],l=n[e?(v+1)%y:v+1];var E=[0,0];E=c0(l,o),E=Sa(E,t);var O=zl(p,o),P=zl(p,l),L=O+P;L!==0&&(O/=L,P/=L);var F=Sa(E,-O),I=Sa(E,P);d=Fl(p,F),h=Fl(p,I),h=Ys(h,Hs(l,p)),h=Hs(h,Ys(l,p)),F=c0(h,p),F=Sa(F,-O/P),d=Fl(p,F),d=Ys(d,Hs(o,p)),d=Hs(d,Ys(o,p)),I=c0(p,d),I=Sa(I,P/O),h=Fl(p,I),s&&(d=Hs(d,c),d=Ys(d,u),h=Hs(h,c),h=Ys(h,u)),a.push(f),a.push(d),f=h}}return e&&a.push(a.shift()),a}function I5(n,t,e){var r;t===void 0&&(t=!1),e===void 0&&(e=[[0,0],[1,1]]);for(var i=!!t,a=[],s=0,o=n.length;s<o;s+=2)a.push([n[s],n[s+1]]);for(var l=D5(a,.4,i,e),c=a.length,u=[],h,d,f,s=0;s<c-1;s+=1)h=l[s*2],d=l[s*2+1],f=a[s+1],u.push(["C",h[0],h[1],d[0],d[1],f[0],f[1]]);return i&&(h=l[c],d=l[c+1],r=(0,G.CR)(a,1),f=r[0],u.push(["C",h[0],h[1],d[0],d[1],f[0],f[1]])),u}function B5(n,t){var e,r=t.x,i=t.y,a=(0,G.CR)(i.getOptions().range||[0,0],2),s=a[0],o=a[1];return o>s&&(e=(0,G.CR)([s,o],2),o=e[0],s=e[1]),n.map(function(l){var c=l.map(function(u,h){return[r.map(h),kn(i.map(u),o,s)]});return c})}function Gl(n,t){t===void 0&&(t=!1);var e=t?n.length-1:0,r=n.map(function(i,a){return(0,G.ev)([a===e?"M":"L"],(0,G.CR)(i),!1)});return t?r.reverse():r}function Vh(n,t){if(t===void 0&&(t=!1),n.length<=2)return Gl(n);for(var e=[],r=n.length,i=0;i<r;i+=1){var a=t?n[r-i-1]:n[i];Zn(a,e.slice(-2))||e.push.apply(e,(0,G.ev)([],(0,G.CR)(a),!1))}var s=I5(e,!1);return t?s.unshift((0,G.ev)(["M"],(0,G.CR)(n[r-1]),!1)):s.unshift((0,G.ev)(["M"],(0,G.CR)(n[0]),!1)),s}function C0(n,t,e){var r=ho(n);return r.push(["L",t,e],["L",0,e],["Z"]),r}function F5(n,t,e,r){return n.map(function(i){return C0(t?Vh(i):Gl(i),e,r)})}function z5(n,t,e){for(var r=[],i=n.length-1;i>=0;i-=1){var a=n[i],s=Gl(a),o=void 0;if(i===0)o=C0(s,t,e);else{var l=n[i-1],c=Gl(l,!0);c[0][0]="L",o=(0,G.ev)((0,G.ev)((0,G.ev)([],(0,G.CR)(s),!1),(0,G.CR)(c),!1),[["Z"]],!1)}r.push(o)}return r}function j5(n,t,e){for(var r=[],i=n.length-1;i>=0;i-=1){var a=n[i],s=Vh(a),o=void 0;if(i===0)o=C0(s,t,e);else{var l=n[i-1],c=Vh(l,!0),u=a[0];c[0][0]="L",o=(0,G.ev)((0,G.ev)((0,G.ev)([],(0,G.CR)(s),!1),(0,G.CR)(c),!1),[(0,G.ev)(["M"],(0,G.CR)(u),!1),["Z"]],!1)}r.push(o)}return r}var Z5=function(n,t){if(Wr(n)){for(var e,r=1/0,i=0;i<n.length;i++){var a=n[i],s=fe(t)?t(a):a[t];s<r&&(e=a,r=s)}return e}},W5=function(n,t){if(Wr(n)){for(var e,r=-1/0,i=0;i<n.length;i++){var a=n[i],s=fe(t)?t(a):a[t];s>r&&(e=a,r=s)}return e}};function cE(n){return n.length===0?[0,0]:[ec(Z5(n,function(t){return ec(t)||0})),nc(W5(n,function(t){return nc(t)||0}))]}function uE(n){for(var t=ho(n),e=t[0].length,r=(0,G.CR)([Array(e).fill(0),Array(e).fill(0)],2),i=r[0],a=r[1],s=0;s<t.length;s+=1)for(var o=t[s],l=0;l<e;l+=1)o[l]>=0?(o[l]+=i[l],i[l]=o[l]):(o[l]+=a[l],a[l]=o[l]);return t}var G5=function(n){(0,G.ZT)(t,n);function t(e){return n.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Object.defineProperty(t.prototype,"rawData",{get:function(){var e=this.attributes.data;if(!e||(e==null?void 0:e.length)===0)return[[]];var r=ho(e);return ie(r[0])?[r]:r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.attributes.isStack?uE(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseline",{get:function(){var e=this.scales.y,r=(0,G.CR)(e.getOptions().domain||[0,0],2),i=r[0],a=r[1];return a<0?e.map(a):e.map(i<0?0:i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"containerShape",{get:function(){var e=this.attributes,r=e.width,i=e.height;return{width:r,height:i}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linesStyle",{get:function(){var e=this,r=this.attributes,i=r.type,a=r.isStack,s=r.smooth;if(i!=="line")throw new Error("linesStyle can only be used in line type");var o=ke(this.attributes,"area"),l=ke(this.attributes,"line"),c=this.containerShape.width,u=this.data;if(u[0].length===0)return{lines:[],areas:[]};var h=this.scales,d=h.x,f=h.y,v=B5(u,{type:"line",x:d,y:f}),g=[];if(o){var p=this.baseline;a?g=s?j5(v,c,p):z5(v,c,p):g=F5(v,s,c,p)}return{lines:v.map(function(y,b){return(0,G.pi)({stroke:e.getColor(b),d:s?Vh(y):Gl(y)},l)}),areas:g.map(function(y,b){return(0,G.pi)({d:y,fill:e.getColor(b)},o)})}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columnsStyle",{get:function(){var e=this,r=ke(this.attributes,"column"),i=this.attributes,a=i.isStack,s=i.type,o=i.scale;if(s!=="column")throw new Error("columnsStyle can only be used in column type");var l=this.containerShape.height,c=this.rawData;if(!c)return{columns:[]};a&&(c=uE(c));var u=this.createScales(c),h=u.x,d=u.y,f=(0,G.CR)(cE(c),2),v=f[0],g=f[1],p=new Wl({domain:[0,g-(v>0?0:v)],range:[0,l*o]}),y=h.getBandWidth(),b=this.rawData;return{columns:c.map(function(E,O){return E.map(function(P,L){var F=y/c.length,I=function(){return{x:h.map(L)+F*O,y:P>=0?d.map(P):d.map(0),width:F,height:p.map(Math.abs(P))}},V=function(){return{x:h.map(L),y:d.map(P),width:y,height:p.map(b[O][L])}};return(0,G.pi)((0,G.pi)({fill:e.getColor(O)},r),a?V():I())})})}},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){KD(r,".container","rect").attr("className","container").node();var i=e.type,a=e.x,s=e.y,o="spark".concat(i),l=(0,G.pi)({x:a,y:s},i==="line"?this.linesStyle:this.columnsStyle);ve(r).selectAll(".spark").data([i]).join(function(c){return c.append(function(u){return u==="line"?new _5({className:o,style:l}):new L5({className:o,style:l})}).attr("className","spark ".concat(o))},function(c){return c.update(l)},function(c){return c.remove()})},t.prototype.getColor=function(e){var r=this.attributes.color;return Wr(r)?r[e%r.length]:fe(r)?r.call(null,e):r},t.prototype.createScales=function(e){var r,i,a=this.attributes,s=a.type,o=a.scale,l=a.range,c=l===void 0?[]:l,u=a.spacing,h=this.containerShape,d=h.width,f=h.height,v=(0,G.CR)(cE(e),2),g=v[0],p=v[1],y=new Wl({domain:[(r=c[0])!==null&&r!==void 0?r:g,(i=c[1])!==null&&i!==void 0?i:p],range:[f,f*(1-o)]});return s==="line"?{type:s,x:new Wl({domain:[0,e[0].length-1],range:[0,d]}),y}:{type:s,x:new O0({domain:e[0].map(function(b,E){return E}),range:[0,d],paddingInner:u,paddingOuter:u/2,align:.5}),y}},t.tag="sparkline",t}(Ln),hE={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},dE={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},fE={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},aa=Zi({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),$a=Zi({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),V5=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(e,r){var i=e.x,a=e.y,s=e.size,o=s===void 0?10:s,l=e.radius,c=l===void 0?o/4:l,u=e.orientation,h=(0,G._T)(e,["x","y","size","radius","orientation"]),d=o,f=d*2.4,v=ve(r).maybeAppendByClassName($a.iconRect,"rect").styles((0,G.pi)((0,G.pi)({},h),{width:d,height:f,radius:c,x:i-d/2,y:a-f/2,transformOrigin:"center"})),g=i+1/3*d-d/2,p=i+2/3*d-d/2,y=a+1/4*f-f/2,b=a+3/4*f-f/2;v.maybeAppendByClassName("".concat($a.iconLine,"-1"),"line").styles((0,G.pi)({x1:g,x2:g,y1:y,y2:b},h)),v.maybeAppendByClassName("".concat($a.iconLine,"-2"),"line").styles((0,G.pi)({x1:p,x2:p,y1:y,y2:b},h)),u==="vertical"&&(v.node().style.transform="rotate(90)")},t}(Ln),U5=function(n){(0,G.ZT)(t,n);function t(e){return n.call(this,e,fE)||this}return t.prototype.renderLabel=function(e){var r=this,i=this.attributes,a=i.x,s=i.y,o=i.showLabel,l=ke(this.attributes,"label"),c=l.x,u=c===void 0?0:c,h=l.y,d=h===void 0?0:h,f=l.transform,v=l.transformOrigin,g=(0,G._T)(l,["x","y","transform","transformOrigin"]),p=(0,G.CR)(Ea(g,[]),2),y=p[0],b=p[1],E=ve(e).maybeAppendByClassName($a.labelGroup,"g").styles(b),O=(0,G.pi)((0,G.pi)({},dE),y),P=O.text,L=(0,G._T)(O,["text"]);Qr(!!o,E,function(F){r.label=F.maybeAppendByClassName($a.label,"text").styles((0,G.pi)((0,G.pi)({},L),{x:a+u,y:s+d,transform:f,transformOrigin:v,text:"".concat(P)})),r.label.on("mousedown",function(I){I.stopPropagation()}),r.label.on("touchstart",function(I){I.stopPropagation()})})},t.prototype.renderIcon=function(e){var r=this.attributes,i=r.x,a=r.y,s=r.orientation,o=r.type,l=(0,G.pi)((0,G.pi)({x:i,y:a,orientation:s},hE),ke(this.attributes,"icon")),c=this.attributes.iconShape,u=c===void 0?function(){return new V5({style:l})}:c,h=ve(e).maybeAppendByClassName($a.iconGroup,"g");h.selectAll($a.icon.class).data([u]).join(function(d){return d.append(typeof u=="string"?u:function(){return u(o)}).attr("className",$a.icon.name)},function(d){return d.update(l)},function(d){return d.remove()})},t.prototype.render=function(e,r){this.renderIcon(r),this.renderLabel(r)},t}(Ln),Y5=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,e,(0,G.pi)((0,G.pi)((0,G.pi)({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(i){return i.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},Mo(fE,"handle")),Mo(hE,"handleIcon")),Mo(dE,"handleLabel")))||this;return r.range=[0,1],r.onDragStart=function(i){return function(a){a.stopPropagation(),r.target=i,r.prevPos=r.getOrientVal($x(a));var s=r.availableSpace,o=s.x,l=s.y,c=r.getBBox(),u=c.x,h=c.y;r.selectionStartPos=r.getRatio(r.prevPos-r.getOrientVal([o,l])-r.getOrientVal([+u,+h])),r.selectionWidth=0,document.addEventListener("pointermove",r.onDragging),document.addEventListener("pointerup",r.onDragEnd)}},r.onDragging=function(i){var a=r.attributes,s=a.slidable,o=a.brushable,l=a.type;i.stopPropagation();var c=r.getOrientVal($x(i)),u=c-r.prevPos;if(u){var h=r.getRatio(u);switch(r.target){case"start":s&&r.setValuesOffset(h);break;case"end":s&&r.setValuesOffset(0,h);break;case"selection":s&&r.setValuesOffset(h,h);break;case"track":if(!o)return;r.selectionWidth+=h,l==="range"?r.innerSetValues([r.selectionStartPos,r.selectionStartPos+r.selectionWidth].sort(),!0):r.innerSetValues([0,r.selectionStartPos+r.selectionWidth],!0);break;default:break}r.prevPos=c}},r.onDragEnd=function(){document.removeEventListener("pointermove",r.onDragging),document.removeEventListener("pointermove",r.onDragging),document.removeEventListener("pointerup",r.onDragEnd),r.target="",r.updateHandlesPosition(!1)},r.onValueChange=function(i){var a=r.attributes,s=a.onChange,o=a.type,l=o==="range"?i:i[1],c=o==="range"?r.getValues():r.getValues()[1],u=new Kn("valuechange",{detail:{oldValue:l,value:c}});r.dispatchEvent(u),s==null||s(c)},r.selectionStartPos=0,r.selectionWidth=0,r.prevPos=0,r.target="",r}return Object.defineProperty(t.prototype,"values",{get:function(){return this.attributes.values},set:function(e){this.attributes.values=this.clampValues(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sparklineStyle",{get:function(){var e=this.attributes.orientation;if(e!=="horizontal")return null;var r=ke(this.attributes,"sparkline");return(0,G.pi)((0,G.pi)({zIndex:0},this.availableSpace),r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shape",{get:function(){var e=this.attributes,r=e.trackLength,i=e.trackSize,a=(0,G.CR)(this.getOrientVal([[r,i],[i,r]]),2),s=a[0],o=a[1];return{width:s,height:o}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableSpace",{get:function(){var e=this.attributes,r=e.x,i=e.y,a=e.padding,s=(0,G.CR)(xr(a),4),o=s[0],l=s[1],c=s[2],u=s[3],h=this.shape,d=h.width,f=h.height;return{x:u,y:o,width:d-(u+l),height:f-(o+c)}},enumerable:!1,configurable:!0}),t.prototype.getValues=function(){return this.values},t.prototype.setValues=function(e,r){e===void 0&&(e=[0,0]),r===void 0&&(r=!1),this.attributes.values=e;var i=r===!1?!1:this.attributes.animate;this.updateSelectionArea(i),this.updateHandlesPosition(i)},t.prototype.updateSelectionArea=function(e){var r=this.calcSelectionArea();this.foregroundGroup.selectAll(aa.selection.class).each(function(i,a){Wi(this,r[a],e)})},t.prototype.updateHandlesPosition=function(e){this.attributes.showHandle&&(this.startHandle&&Wi(this.startHandle,this.getHandleStyle("start"),e),this.endHandle&&Wi(this.endHandle,this.getHandleStyle("end"),e))},t.prototype.innerSetValues=function(e,r){e===void 0&&(e=[0,0]),r===void 0&&(r=!1);var i=this.values,a=this.clampValues(e);this.attributes.values=a,this.setValues(a),r&&this.onValueChange(i)},t.prototype.renderTrack=function(e){var r=this.attributes,i=r.x,a=r.y,s=ke(this.attributes,"track");this.trackShape=ve(e).maybeAppendByClassName(aa.track,"rect").styles((0,G.pi)((0,G.pi)({x:i,y:a},this.shape),s))},t.prototype.renderBrushArea=function(e){var r=this.attributes,i=r.x,a=r.y,s=r.brushable;this.brushArea=ve(e).maybeAppendByClassName(aa.brushArea,"rect").styles((0,G.pi)({x:i,y:a,fill:"transparent",cursor:s?"crosshair":"default"},this.shape))},t.prototype.renderSparkline=function(e){var r=this,i=this.attributes,a=i.x,s=i.y,o=i.orientation,l=ve(e).maybeAppendByClassName(aa.sparklineGroup,"g");Qr(o==="horizontal",l,function(c){var u=(0,G.pi)((0,G.pi)({},r.sparklineStyle),{x:a,y:s});c.maybeAppendByClassName(aa.sparkline,function(){return new G5({style:u})}).update(u)})},t.prototype.renderHandles=function(){var e=this,r,i=this.attributes,a=i.showHandle,s=i.type,o=s==="range"?["start","end"]:["end"],l=a?o:[],c=this;(r=this.foregroundGroup)===null||r===void 0||r.selectAll(aa.handle.class).data(l.map(function(u){return{type:u}}),function(u){return u.type}).join(function(u){return u.append(function(h){var d=h.type;return new U5({style:e.getHandleStyle(d)})}).each(function(h){var d=h.type;this.attr("class","".concat(aa.handle.name," ").concat(d,"-handle"));var f="".concat(d,"Handle");c[f]=this,this.addEventListener("pointerdown",c.onDragStart(d))})},function(u){return u.each(function(h){var d=h.type;this.update(c.getHandleStyle(d))})},function(u){return u.each(function(h){var d=h.type,f="".concat(d,"Handle");c[f]=void 0}).remove()})},t.prototype.renderSelection=function(e){var r=this.attributes,i=r.x,a=r.y,s=r.type,o=r.selectionType;this.foregroundGroup=ve(e).maybeAppendByClassName(aa.foreground,"g");var l=ke(this.attributes,"selection"),c=function(h){return h.style("visibility",function(d){return d.show?"visible":"hidden"}).style("cursor",function(d){return o==="select"?"grab":o==="invert"?"crosshair":"default"}).styles((0,G.pi)((0,G.pi)({},l),{transform:"translate(".concat(i,", ").concat(a,")")}))},u=this;this.foregroundGroup.selectAll(aa.selection.class).data(s==="value"?[]:this.calcSelectionArea().map(function(h,d){return{style:(0,G.pi)({},h),index:d,show:o==="select"?d===1:d!==1}}),function(h){return h.index}).join(function(h){return h.append("rect").attr("className",aa.selection.name).call(c).each(function(d,f){var v=this;f===1?(u.selectionShape=ve(this),this.on("pointerdown",function(g){v.attr("cursor","grabbing"),u.onDragStart("selection")(g)}),u.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),u.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),u.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){v.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){v.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){v.attr("cursor","pointer")})):this.on("pointerdown",u.onDragStart("track"))})},function(h){return h.call(c)},function(h){return h.remove()}),this.updateSelectionArea(!1),this.renderHandles()},t.prototype.render=function(e,r){this.renderTrack(r),this.renderSparkline(r),this.renderBrushArea(r),this.renderSelection(r)},t.prototype.clampValues=function(e,r){var i;r===void 0&&(r=4);var a=(0,G.CR)(this.range,2),s=a[0],o=a[1],l=(0,G.CR)(this.getValues().map(function(p){return y0(p,r)}),2),c=l[0],u=l[1],h=Array.isArray(e)?e:[c,e!=null?e:u],d=(0,G.CR)((h||[c,u]).map(function(p){return y0(p,r)}),2),f=d[0],v=d[1];if(this.attributes.type==="value")return[0,kn(v,s,o)];f>v&&(i=(0,G.CR)([v,f],2),f=i[0],v=i[1]);var g=v-f;return g>o-s?[s,o]:f<s?c===s&&u===v?[s,v]:[s,g+s]:v>o?u===o&&c===f?[f,o]:[o-g,o]:[f,v]},t.prototype.calcSelectionArea=function(e){var r=(0,G.CR)(this.clampValues(e),2),i=r[0],a=r[1],s=this.availableSpace,o=s.x,l=s.y,c=s.width,u=s.height;return this.getOrientVal([[{y:l,height:u,x:o,width:i*c},{y:l,height:u,x:i*c+o,width:(a-i)*c},{y:l,height:u,x:a*c,width:(1-a)*c}],[{x:o,width:c,y:l,height:i*u},{x:o,width:c,y:i*u+l,height:(a-i)*u},{x:o,width:c,y:a*u,height:(1-a)*u}]])},t.prototype.calcHandlePosition=function(e){var r=this.attributes.handleIconOffset,i=this.availableSpace,a=i.x,s=i.y,o=i.width,l=i.height,c=(0,G.CR)(this.clampValues(),2),u=c[0],h=c[1],d=e==="start"?-r:r,f=(e==="start"?u:h)*this.getOrientVal([o,l])+d;return{x:a+this.getOrientVal([f,o/2]),y:s+this.getOrientVal([l/2,f])}},t.prototype.inferTextStyle=function(e){var r=this.attributes.orientation;return r==="horizontal"?{}:e==="start"?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:e==="end"?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},t.prototype.calcHandleText=function(e){var r,i=this.attributes,a=i.type,s=i.orientation,o=i.formatter,l=i.autoFitLabel,c=ke(this.attributes,"handle"),u=ke(c,"label"),h=c.spacing,d=this.getHandleSize(),f=this.clampValues(),v=e==="start"?f[0]:f[1],g=o(v),p=new Jv({style:(0,G.pi)((0,G.pi)((0,G.pi)({},u),this.inferTextStyle(e)),{text:g})}),y=p.getBBox(),b=y.width,E=y.height;if(p.destroy(),!l){if(a==="value")return{text:g,x:0,y:-E-h};var O=h+d+(s==="horizontal"?b/2:0);return r={text:g},r[s==="horizontal"?"x":"y"]=e==="start"?-O:O,r}var P=0,L=0,F=this.availableSpace,I=F.width,V=F.height,Y=this.calcSelectionArea()[1],J=Y.x,$=Y.y,ot=Y.width,ct=Y.height,ft=h+d;if(s==="horizontal"){var Nt=ft+b/2;if(e==="start"){var Ot=J-ft-b;P=Ot>0?-Nt:Nt}else{var mt=I-J-ot-ft>b;P=mt?Nt:-Nt}}else{var yt=ft,Rt=E+ft;e==="start"?L=$-d>E?-Rt:yt:L=V-($+ct)-d>E?Rt:-yt}return{x:P,y:L,text:g}},t.prototype.getHandleLabelStyle=function(e){var r=ke(this.attributes,"handleLabel");return(0,G.pi)((0,G.pi)((0,G.pi)({},r),this.calcHandleText(e)),this.inferTextStyle(e))},t.prototype.getHandleIconStyle=function(){var e=this.attributes.handleIconShape,r=ke(this.attributes,"handleIcon"),i=this.getOrientVal(["ew-resize","ns-resize"]),a=this.getHandleSize();return(0,G.pi)({cursor:i,shape:e,size:a},r)},t.prototype.getHandleStyle=function(e){var r=this.attributes,i=r.x,a=r.y,s=r.showLabel,o=r.showLabelOnInteraction,l=r.orientation,c=this.calcHandlePosition(e),u=c.x,h=c.y,d=this.calcHandleText(e),f=s;return!s&&o&&(this.target?f=!0:f=!1),(0,G.pi)((0,G.pi)((0,G.pi)({},Mo(this.getHandleIconStyle(),"icon")),Mo((0,G.pi)((0,G.pi)({},this.getHandleLabelStyle(e)),d),"label")),{transform:"translate(".concat(u+i,", ").concat(h+a,")"),orientation:l,showLabel:f,type:e,zIndex:3})},t.prototype.getHandleSize=function(){var e=this.attributes,r=e.handleIconSize,i=e.width,a=e.height;return r||Math.floor((this.getOrientVal([+a,+i])+4)/2.4)},t.prototype.getOrientVal=function(e){var r=(0,G.CR)(e,2),i=r[0],a=r[1],s=this.attributes.orientation;return s==="horizontal"?i:a},t.prototype.setValuesOffset=function(e,r){r===void 0&&(r=0);var i=this.attributes.type,a=(0,G.CR)(this.getValues(),2),s=a[0],o=a[1],l=i==="range"?e:0,c=[s+l,o+r].sort();this.innerSetValues(c,!0)},t.prototype.getRatio=function(e){var r=this.availableSpace,i=r.width,a=r.height;return e/this.getOrientVal([i,a])},t.prototype.dispatchCustomEvent=function(e,r,i){var a=this;e.on(r,function(s){s.stopPropagation(),a.dispatchEvent(new Kn(i,{detail:s}))})},t.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var e=this.brushArea;this.dispatchCustomEvent(e,"click","trackClick"),this.dispatchCustomEvent(e,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(e,"pointerleave","trackMouseleave"),e.on("pointerdown",this.onDragStart("track"))},t.prototype.onScroll=function(e){var r=this.attributes.scrollable;if(r){var i=e.deltaX,a=e.deltaY,s=a||i,o=this.getRatio(s);this.setValuesOffset(o,o)}},t.tag="slider",t}(Ln),H5={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(n){return n.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},N0=Zi({background:"background",labelGroup:"label-group",label:"label"},"indicator"),X5=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,e,H5)||this;return r.point=[0,0],r.group=r.appendChild(new rr({})),r.isMutationObserved=!0,r}return t.prototype.renderBackground=function(){if(this.label){var e=this.attributes,r=e.position,i=e.padding,a=(0,G.CR)(xr(i),4),s=a[0],o=a[1],l=a[2],c=a[3],u=this.label.node().getLocalBounds(),h=u.min,d=u.max,f=new Cr(h[0]-c,h[1]-s,d[0]+o-h[0]+c,d[1]+l-h[1]+s),v=this.getPath(r,f),g=ke(this.attributes,"background");this.background=ve(this.group).maybeAppendByClassName(N0.background,"path").styles((0,G.pi)((0,G.pi)({},g),{d:v})),this.group.appendChild(this.label.node())}},t.prototype.renderLabel=function(){var e=this.attributes,r=e.formatter,i=e.labelText,a=ke(this.attributes,"label"),s=(0,G.CR)(Ea(a),2),o=s[0],l=s[1],c=o.text,u=(0,G._T)(o,["text"]);if(this.label=ve(this.group).maybeAppendByClassName(N0.labelGroup,"g").styles(l),!!i){var h=this.label.maybeAppendByClassName(N0.label,function(){return wa(r(i))}).style("text",r(i).toString());h.selectAll("text").styles(u)}},t.prototype.adjustLayout=function(){var e=(0,G.CR)(this.point,2),r=e[0],i=e[1],a=this.attributes,s=a.x,o=a.y;this.group.attr("transform","translate(".concat(s-r,", ").concat(o-i,")"))},t.prototype.getPath=function(e,r){var i=this.attributes.radius,a=r.x,s=r.y,o=r.width,l=r.height,c=[["M",a+i,s],["L",a+o-i,s],["A",i,i,0,0,1,a+o,s+i],["L",a+o,s+l-i],["A",i,i,0,0,1,a+o-i,s+l],["L",a+i,s+l],["A",i,i,0,0,1,a,s+l-i],["L",a,s+i],["A",i,i,0,0,1,a+i,s],["Z"]],u={top:4,right:6,bottom:0,left:2},h=u[e],d=this.createCorner([c[h].slice(-2),c[h+1].slice(-2)]);return c.splice.apply(c,(0,G.ev)([h+1,1],(0,G.CR)(d),!1)),c[0][0]="M",c},t.prototype.createCorner=function(e,r){r===void 0&&(r=10);var i=.8,a=PI.apply(void 0,(0,G.ev)([],(0,G.CR)(e),!1)),s=(0,G.CR)(e,2),o=(0,G.CR)(s[0],2),l=o[0],c=o[1],u=(0,G.CR)(s[1],2),h=u[0],d=u[1],f=(0,G.CR)(a?[h-l,[l,h]]:[d-c,[c,d]],2),v=f[0],g=(0,G.CR)(f[1],2),p=g[0],y=g[1],b=v/2,E=v/Math.abs(v),O=r*E,P=O/2,L=O*Math.sqrt(3)/2*i,F=(0,G.CR)([p,p+b-P,p+b,p+b+P,y],5),I=F[0],V=F[1],Y=F[2],J=F[3],$=F[4];return a?(this.point=[Y,c-L],[["L",I,c],["L",V,c],["L",Y,c-L],["L",J,c],["L",$,c]]):(this.point=[l+L,Y],[["L",l,I],["L",l,V],["L",l+L,Y],["L",l,J],["L",l,$]])},t.prototype.applyVisibility=function(){var e=this.attributes.visibility;e==="hidden"?ji(this):Dl(this)},t.prototype.bindEvents=function(){this.label.on(De.BOUNDS_CHANGED,this.renderBackground)},t.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},t}(Ln),K5=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,Jn({},t.defaultOptions,e))||this;return r.hoverColor="#f5f5f5",r.selectedColor="#e6f7ff",r.background=r.appendChild(new gr({})),r.label=r.background.appendChild(new rr({})),r}return Object.defineProperty(t.prototype,"padding",{get:function(){return xr(this.style.padding)},enumerable:!1,configurable:!0}),t.prototype.renderLabel=function(){var e=this.style,r=e.label,i=e.value,a=ke(this.attributes,"label");ve(this.label).maybeAppend(".label",function(){return wa(r)}).attr("className","label").styles(a),this.label.attr("__data__",i)},t.prototype.renderBackground=function(){var e=this.label.getBBox(),r=(0,G.CR)(this.padding,4),i=r[0],a=r[1],s=r[2],o=r[3],l=e.width,c=e.height,u=l+o+a,h=c+i+s,d=ke(this.attributes,"background"),f=this.style,v=f.width,g=v===void 0?0:v,p=f.height,y=p===void 0?0:p,b=f.selected;this.background.attr((0,G.pi)((0,G.pi)({},d),{width:Math.max(u,g),height:Math.max(h,y),fill:b?this.selectedColor:"#fff"})),this.label.attr({transform:"translate(".concat(o,", ").concat((h-c)/2,")")})},t.prototype.render=function(){this.renderLabel(),this.renderBackground()},t.prototype.bindEvents=function(){var e=this;this.addEventListener("pointerenter",function(){e.style.selected||e.background.attr("fill",e.hoverColor)}),this.addEventListener("pointerleave",function(){e.style.selected||e.background.attr("fill",e.style.backgroundFill)});var r=this;this.addEventListener("click",function(){var i=e.style,a=i.label,s=i.value,o=i.onClick;o==null||o(s,{label:a,value:s},r)})},t.defaultOptions={style:{value:"",label:"",cursor:"pointer"}},t}(Ln),Q5=function(n){(0,G.ZT)(t,n);function t(e){var r,i,a=n.call(this,Jn({},t.defaultOptions,e))||this;a.currentValue=(r=t.defaultOptions.style)===null||r===void 0?void 0:r.defaultValue,a.isPointerInSelect=!1,a.select=a.appendChild(new gr({className:"select",style:{cursor:"pointer",width:0,height:0}})),a.dropdown=a.appendChild(new gr({className:"dropdown"}));var s=a.style.defaultValue;return s&&(!((i=a.style.options)===null||i===void 0)&&i.some(function(o){return o.value===s}))&&(a.currentValue=s),a}return t.prototype.setValue=function(e){this.currentValue=e,this.render()},t.prototype.getValue=function(){return this.currentValue},Object.defineProperty(t.prototype,"dropdownPadding",{get:function(){return xr(this.style.dropdownPadding)},enumerable:!1,configurable:!0}),t.prototype.renderSelect=function(){var e=this,r,i=this.style,a=i.x,s=i.y,o=i.width,l=i.height,c=i.bordered,u=i.showDropdownIcon,h=ke(this.attributes,"select"),d=ke(this.attributes,"placeholder");this.select.attr((0,G.pi)((0,G.pi)({x:a,y:s,width:o,height:l},h),{fill:"#fff",strokeWidth:c?1:0}));var f=this.dropdownPadding,v=10;u&&ve(this.select).maybeAppend(".dropdown-icon","path").style("d","M-5,-3.5 L0,3.5 L5,-3.5").style("transform","translate(".concat(a+o-v-f[1]-f[3],", ").concat(s+l/2,")")).style("lineWidth",1).style("stroke",this.select.style.stroke);var g=(r=this.style.options)===null||r===void 0?void 0:r.find(function(E){return E.value===e.currentValue}),p=(0,G.pi)({x:a+f[3]},d);ve(this.select).selectAll(".placeholder").data(g?[]:[1]).join(function(E){return E.append("text").attr("className","placeholder").styles(p).style("y",function(){var O=this.getBBox();return s+(l-O.height)/2})},function(E){return E.styles(p)},function(E){return E.remove()});var y=ke(this.attributes,"optionLabel"),b=(0,G.pi)({x:a+f[3]},y);ve(this.select).selectAll(".value").data(g?[g]:[]).join(function(E){return E.append(function(O){return wa(O.label)}).attr("className","value").styles(b).style("y",function(){var O=this.getBBox();return s+(l-O.height)/2})},function(E){return E.styles(b)},function(E){return E.remove()})},t.prototype.renderDropdown=function(){var e=this,r,i,a=this.style,s=a.x,o=a.y,l=a.width,c=a.height,u=a.options,h=a.onSelect,d=a.open,f=ke(this.attributes,"dropdown"),v=ke(this.attributes,"option"),g=this.dropdownPadding;ve(this.dropdown).maybeAppend(".dropdown-container","g").attr("className","dropdown-container").selectAll(".dropdown-item").data(u,function(b){return b.value}).join(function(b){return b.append(function(E){return new K5({className:"dropdown-item",style:(0,G.pi)((0,G.pi)((0,G.pi)({},E),v),{width:l-g[1]-g[3],selected:E.value===e.currentValue,onClick:function(O,P,L){e.setValue(O),h==null||h(O,P,L),e.dispatchEvent(new Kn("change",{detail:{value:O,option:P,item:L}})),ji(e.dropdown)}})})}).each(function(E,O){var P,L=(P=this.parentNode)===null||P===void 0?void 0:P.children,F=L.reduce(function(I,V,Y){return Y<O&&(I+=V.getBBox().height),I},0);this.attr("transform","translate(".concat(g[3],", ").concat(g[0]+F,")"))})},function(b){return b.update(function(E){return{selected:E.value===e.currentValue}})},function(b){return b.remove()});var p=(i=(r=this.dropdown.getElementsByClassName("dropdown-container"))===null||r===void 0?void 0:r[0])===null||i===void 0?void 0:i.getBBox(),y=f.spacing;this.dropdown.attr((0,G.pi)({transform:"translate(".concat(s,", ").concat(o+c+y,")"),width:p.width+g[1]+g[3],height:p.height+g[0]+g[2]},f)),!d&&ji(this.dropdown)},t.prototype.render=function(){this.renderSelect(),this.renderDropdown()},t.prototype.bindEvents=function(){var e=this;this.addEventListener("click",function(r){r.stopPropagation()}),this.select.addEventListener("click",function(){e.dropdown.style.visibility==="visible"?ji(e.dropdown):Dl(e.dropdown)}),this.addEventListener("pointerenter",function(){e.isPointerInSelect=!0}),this.addEventListener("pointerleave",function(){e.isPointerInSelect=!1}),document==null||document.addEventListener("click",function(){e.isPointerInSelect||ji(e.dropdown)})},t.defaultOptions={style:{x:0,y:0,width:140,height:32,options:[],bordered:!0,defaultValue:"",selectRadius:8,selectStroke:"#d9d9d9",showDropdownIcon:!0,placeholderText:"\u8BF7\u9009\u62E9",placeholderFontSize:12,placeholderTextBaseline:"top",placeholderFill:"#c2c2c2",dropdownFill:"#fff",dropdownStroke:"#d9d9d9",dropdownRadius:8,dropdownShadowBlur:4,dropdownShadowColor:"rgba(0, 0, 0, 0.08)",dropdownPadding:8,dropdownSpacing:10,optionPadding:[8,12],optionFontSize:12,optionTextBaseline:"top",optionBackgroundFill:"#fff",optionBackgroundRadius:4,optionLabelFontSize:12,optionLabelTextBaseline:"top"}},t}(Ln),Gi=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,Jn({},{style:{backgroundOpacity:t.backgroundOpacities.default}},t.defaultOptions,e))||this;return r.showBackground=!0,r.background=r.appendChild(new gr({})),r.icon=r.appendChild(new rr({})),r}return Object.defineProperty(t.prototype,"label",{get:function(){return"BaseIcon"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineWidth",{get:function(){return Math.log10(this.attributes.size)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return xr(this.attributes.size/5)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iconSize",{get:function(){var e=this.attributes.size,r=(0,G.CR)(this.padding,4),i=r[0],a=r[1],s=r[2],o=r[3];return Math.max(e-Math.max(o+a,i+s),this.lineWidth*2+1)},enumerable:!1,configurable:!0}),t.prototype.renderBackground=function(){var e=this.attributes,r=e.x,i=e.y,a=e.size,s=a/2,o=ke(this.attributes,"background");this.background.attr((0,G.pi)({x:r-s,y:i-s,width:a,height:a},o))},t.prototype.showIndicator=function(){if(this.label){var e=this.attributes.size,r=this.background.getBBox(),i=r.x,a=r.y;this.indicator.update({x:i+e/2,y:a-5,labelText:this.label,visibility:"visible"})}},t.prototype.hideIndicator=function(){this.indicator.update({visibility:"hidden"})},t.prototype.connectedCallback=function(){var e;n.prototype.connectedCallback.call(this);var r=this.attributes.size,i=this.background.getBBox(),a=i.x,s=i.y,o=(e=this.ownerDocument)===null||e===void 0?void 0:e.defaultView;o&&(this.indicator=o.appendChild(new X5({style:{x:a+r/2,y:s-r/2,visibility:"hidden",position:"top",radius:3,zIndex:100}})))},t.prototype.disconnectedCallback=function(){this.indicator.destroy()},t.prototype.render=function(){this.renderIcon(),this.showBackground&&this.renderBackground()},t.prototype.bindEvents=function(){var e=this,r=this.attributes.onClick;if(this.addEventListener("click",function(){r==null||r(e)}),this.showBackground){var i=function(){return e.background.attr({opacity:t.backgroundOpacities.default})},a=function(){return e.background.attr({opacity:t.backgroundOpacities.hover})},s=function(){return e.background.attr({opacity:t.backgroundOpacities.active})};this.addEventListener("pointerenter",function(){a(),e.showIndicator()}),this.addEventListener("pointerleave",function(){i(),e.hideIndicator()}),this.addEventListener("pointerdown",function(){s()}),this.addEventListener("pointerup",function(){i()})}},t.tag="IconBase",t.defaultOptions={style:{x:0,y:0,size:10,color:"#565758",backgroundRadius:4,backgroundFill:"#e2e2e2"}},t.backgroundOpacities={default:0,hover:.8,active:1},t}(Ln),Vl=function(n,t){return t===void 0&&(t="#565758"),new ni({style:{fill:t,d:"M ".concat(n,",").concat(n," L -").concat(n,",0 L ").concat(n,",-").concat(n," Z"),transformOrigin:"center"}})},q5=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.arcPath=function(e,r,i){var a=(0,G.CR)([i,i],2),s=a[0],o=a[1],l=function(g){return[e+i*Math.cos(g),r+i*Math.sin(g)]},c=(0,G.CR)(l(-5/4*Math.PI),2),u=c[0],h=c[1],d=(0,G.CR)(l(1/4*Math.PI),2),f=d[0],v=d[1];return"M".concat(u,",").concat(h,",A").concat(s,",").concat(o,",0,1,1,").concat(f,",").concat(v)},Object.defineProperty(t.prototype,"label",{get:function(){return"\u91CD\u7F6E"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,r=e.x,i=e.y,a=e.color,s=this.iconSize,o=this.lineWidth,l=o+.5;ve(this.icon).maybeAppend(".reset","path").styles({stroke:a,lineWidth:o,d:this.arcPath(r,i,s/2-o),markerStart:Vl(l,a)})},t}(Gi),J5=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u5FEB\u9000"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,r=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/2,l=s/2/Math.pow(3,.5),c=[[r,i],[r,i-l],[r-o,i],[r,i+l],[r,i],[r+o,i-l],[r+o,i+l],[r,i]];ve(this.icon).maybeAppend(".backward","polygon").styles({points:c,fill:a})},t}(Gi),$5=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u5FEB\u8FDB"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,r=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/2,l=s/2/Math.pow(3,.5),c=[[r,i],[r,i-l],[r+o,i],[r,i+l],[r,i],[r-o,i-l],[r-o,i+l],[r,i]];ve(this.icon).maybeAppend(".forward","polygon").styles({points:c,fill:a})},t}(Gi),t4=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u64AD\u653E"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,r=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/3*Math.pow(3,.5)*.8,l=[[r+o,i],[r-o/2,i-s/2*.8],[r-o/2,i+s/2*.8],[r+o,i]];ve(this.icon).maybeAppend(".play","polygon").styles({points:l,fill:a})},t}(Gi),e4=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u6682\u505C"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,r=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/3,l=[[r-o,i-s/2],[r-o,i+s/2],[r-o/2,i+s/2],[r-o/2,i-s/2],[r-o,i-s/2],[r+o/2,i-s/2],[r+o/2,i+s/2],[r+o,i+s/2],[r+o,i-s/2]];ve(this.icon).maybeAppend(".pause","polygon").styles({points:l,fill:a})},t}(Gi),n4=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u8303\u56F4\u65F6\u95F4"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,r=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth,c=l;ve(this.icon).maybeAppend(".left-line","line").styles({x1:r-o/2,y1:i-o/2,x2:r-o/2,y2:i+o/2,stroke:a,lineWidth:l}),ve(this.icon).maybeAppend(".right-line","line").styles({x1:r+o/2,y1:i-o/2,x2:r+o/2,y2:i+o/2,stroke:a,lineWidth:l}),ve(this.icon).maybeAppend(".left-arrow","line").styles({x1:r,y1:i,x2:r-o/2+c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Vl(l*2,a)}),ve(this.icon).maybeAppend(".right-arrow","line").styles({x1:r,y1:i,x2:r+o/2-c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Vl(l*2,a)})},t}(Gi),r4=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u5355\u4E00\u65F6\u95F4"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,r=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth;ve(this.icon).maybeAppend(".line","line").styles({x1:r,y1:i-o/2,x2:r,y2:i+o/2,stroke:a,lineWidth:l});var c=l;ve(this.icon).maybeAppend(".left-arrow","line").styles({x1:r-o/2-c*2,y1:i,x2:r-c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Vl(l*2,a)}),ve(this.icon).maybeAppend(".right-arrow","line").styles({x1:r+o/2+c*2,y1:i,x2:r+c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Vl(l*2,a)})},t}(Gi),vE=function(n){return[[-n/2,-n/2],[-n/2,n/2],[n/2,n/2]]},i4=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u6298\u7EBF\u56FE"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,r=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth,c=l,u=(o-c*2-l)/4,h=(o-c*2-l)/2,d=(0,G.CR)([r-o/2+c,i+o/2-c*2],2),f=d[0],v=d[1];ve(this.icon).maybeAppend(".coordinate","polyline").styles({points:vE(o).map(function(g){var p=(0,G.CR)(g,2),y=p[0],b=p[1];return[y+r,b+i]}),stroke:a,lineWidth:l}),ve(this.icon).maybeAppend(".line","polyline").styles({points:[[f,v],[f+u,v-h],[f+u*2,v],[f+u*4,v-h*2]],stroke:a,lineWidth:l})},t}(Gi),a4=function(n){(0,G.ZT)(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u6761\u5F62\u56FE"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return[1,4,2,4,3]},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.data,r=this.attributes,i=r.x,a=r.y,s=r.color,o=this,l=o.iconSize,c=o.lineWidth,u=c,h=(l-u)/e.length,d=(l-u*2)/4,f=(0,G.CR)([i-l/2+u*2,a+l/2-u],2),v=f[0],g=f[1];ve(this.icon).maybeAppend(".coordinate","polyline").styles({points:vE(l).map(function(p){var y=(0,G.CR)(p,2),b=y[0],E=y[1];return[b+i,E+a]}),stroke:s,lineWidth:c}),ve(this.icon).maybeAppend(".bars","g").selectAll(".column").data(this.data.map(function(p,y){return{value:p,index:y}})).join(function(p){return p.append("line").attr("className","column").style("x1",function(y){var b=y.index;return v+h*b}).style("y1",g).style("x2",function(y){var b=y.index;return v+h*b}).style("y2",function(y){var b=y.value;return g-d*b}).styles({y1:g,stroke:s,lineWidth:c})})},t}(Gi),s4=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,Jn({},{style:{color:"#d8d9d9"}},e))||this;return r.showBackground=!1,r}return t.prototype.renderIcon=function(){var e=this.attributes,r=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth;ve(this.icon).maybeAppend(".split","line").styles({x1:r,y1:i-o/2,x2:r,y2:i+o/2,stroke:a,lineWidth:l})},t}(Gi),k0=function(n){(0,G.ZT)(t,n);function t(){var e=n.apply(this,(0,G.ev)([],(0,G.CR)(arguments),!1))||this;return e.showBackground=!1,e}return Object.defineProperty(t.prototype,"padding",{get:function(){return xr(0)},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.iconSize,r=this.attributes,i=r.x,a=r.y,s=r.speed,o=s===void 0?1:s,l=Wv(this.attributes,["x","y","transform","transformOrigin","width","height","size","color","speed"]),c=kn(e,20,1/0),u=20,h=(0,G.pi)((0,G.pi)({},l),{x:i-c/2,y:a-u/2,width:c,height:u,defaultValue:o,bordered:!1,showDropdownIcon:!1,selectRadius:2,dropdownPadding:this.padding,dropdownRadius:2,dropdownSpacing:e/5,placeholderFontSize:e/2,optionPadding:0,optionLabelFontSize:e/2,optionBackgroundRadius:1,options:[{label:"1x",value:1},{label:"1.5x",value:1.5},{label:"2x",value:2}]});ve(this.icon).maybeAppend(".speed",function(){return new Q5({style:h})}).attr("className","speed").each(function(){this.update(h)})},t.tag="SpeedSelect",t}(Gi),P0=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,e)||this;return r.icon=r.appendChild(new rr({})),r.currentType=r.attributes.type,r}return t.prototype.getType=function(){return this.currentType},t.prototype.render=function(){var e=this,r=this.attributes,i=r.onChange,a=(0,G._T)(r,["onChange"]);ve(this.icon).selectAll(".icon").data([this.currentType]).join(function(s){return s.append(function(o){var l,c=(l=e.toggles.find(function(u){var h=(0,G.CR)(u,1),d=h[0];return d===o}))===null||l===void 0?void 0:l[1];if(!c)throw new Error("Invalid type: ".concat(o));return new c({})}).attr("className","icon").styles(a,!1).update({})},function(s){return s.styles({restStyles:a}).update({})},function(s){return s.remove()})},t.prototype.bindEvents=function(){var e=this,r=this.attributes.onChange;this.addEventListener("click",function(i){i.preventDefault(),i.stopPropagation();var a=(e.toggles.findIndex(function(o){var l=(0,G.CR)(o,1),c=l[0];return c===e.currentType})+1)%e.toggles.length,s=e.toggles[a][0];r==null||r(e.currentType),e.currentType=s,e.render()})},t.tag="ToggleIcon",t}(Ln),R0=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,Jn({},{style:{type:"play"}},e))||this;return r.toggles=[["play",t4],["pause",e4]],r}return t}(P0),L0=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,Jn({},{style:{type:"range"}},e))||this;return r.toggles=[["range",n4],["value",r4]],r}return t}(P0),_0=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,Jn({},{style:{type:"column"}},e))||this;return r.toggles=[["line",i4],["column",a4]],r}return t}(P0),o4={reset:q5,speed:k0,backward:J5,playPause:R0,forward:$5,selectionType:L0,chartType:_0,split:s4},l4=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,Jn({},t.defaultOptions,e))||this;return r.background=r.appendChild(new gr({})),r.functions=r.appendChild(new rr({})),r}return Object.defineProperty(t.prototype,"padding",{get:function(){return xr(this.attributes.padding)},enumerable:!1,configurable:!0}),t.prototype.renderBackground=function(){var e=this.style,r=e.x,i=e.y,a=e.width,s=e.height,o=ke(this.attributes,"background");this.background.attr((0,G.pi)({x:r,y:i,width:a,height:s},o))},t.prototype.renderFunctions=function(){var e=this,r,i=this.attributes,a=i.functions,s=i.iconSize,o=i.iconSpacing,l=i.x,c=i.y,u=i.width,h=i.height,d=i.align,f=(0,G.CR)(this.padding,4),v=f[1],g=f[3],p=a.reduce(function(E,O){return E.length&&O.length?E.concat.apply(E,(0,G.ev)(["split"],(0,G.CR)(O),!1)):E.concat.apply(E,(0,G.ev)([],(0,G.CR)(O),!1))},[]),y=p.length*(s+o)-o,b={left:g+s/2,center:(u-y)/2+s/2,right:u-y-g-v+s/2}[d]||0;(r=this.speedSelect)===null||r===void 0||r.destroy(),this.functions.removeChildren(),p.forEach(function(E,O){var P,L=o4[E],F={x:l+O*(s+o)+b,y:c+h/2,size:s};if(L===k0?(F.speed=e.attributes.speed,F.onSelect=function(V){return e.handleFunctionChange(E,{value:V})}):[R0,L0,_0].includes(L)?(F.onChange=function(V){return e.handleFunctionChange(E,{value:V})},L===R0&&(F.type=e.attributes.state==="play"?"pause":"play"),L===L0&&(F.type=e.attributes.selectionType==="range"?"value":"range"),L===_0&&(F.type=e.attributes.chartType==="line"?"column":"line")):F.onClick=function(){return e.handleFunctionChange(E,{value:E})},L===k0){var I=(P=e.ownerDocument)===null||P===void 0?void 0:P.defaultView;I&&(e.speedSelect=new L({style:(0,G.pi)((0,G.pi)({},F),{zIndex:100})}),I.appendChild(e.speedSelect))}else e.functions.appendChild(new L({style:F}))})},t.prototype.disconnectedCallback=function(){var e;n.prototype.disconnectedCallback.call(this),(e=this.speedSelect)===null||e===void 0||e.destroy()},t.prototype.render=function(){this.renderBackground(),this.renderFunctions()},t.prototype.handleFunctionChange=function(e,r){var i=this.attributes.onChange;i==null||i(e,r)},t.defaultOptions={style:{x:0,y:0,width:300,height:40,padding:0,align:"center",iconSize:25,iconSpacing:0,speed:1,state:"pause",chartType:"line",selectionType:"range",backgroundFill:"#fbfdff",backgroundStroke:"#ebedf0",functions:[["reset","speed"],["backward","playPause","forward"],["selectionType","chartType"]]}},t}(Ln),c4=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,Jn({},t.defaultOptions,e))||this;return r.bindEvents(),r}return t.prototype.bindEvents=function(){var e=this;this.addEventListener("mouseenter",function(){e.attr("lineWidth",Math.ceil(+(e.style.r||0)/2))}),this.addEventListener("mouseleave",function(){e.attr("lineWidth",0)})},t.defaultOptions={style:{r:5,fill:"#3f7cf7",lineWidth:0,stroke:"#3f7cf7",strokeOpacity:.5,cursor:"pointer"}},t}(Ji),u4=function(n){(0,G.ZT)(t,n);function t(e){return n.call(this,Jn({},t.defaultOptions,e))||this}return t.prototype.renderBackground=function(){var e=this.attributes,r=e.x,i=e.y,a=e.width,s=e.height,o=ke(this.attributes,"background");ve(this).maybeAppend("background","rect").attr("className","background").styles((0,G.pi)({x:r-a/2,y:i-s/2,width:a,height:s},o))},t.prototype.renderIcon=function(){var e=this.attributes,r=e.x,i=e.y,a=e.iconSize,s=ke(this.attributes,"icon"),o=1,l=a/2;ve(this).maybeAppend("icon-left-line","line").attr("className","icon-left-line").styles((0,G.pi)({x1:r-o,y1:i-l,x2:r-o,y2:i+l},s)),ve(this).maybeAppend("icon-right-line","line").attr("className","icon-right-line").styles((0,G.pi)({x1:r+o,y1:i-l,x2:r+o,y2:i+l},s))},t.prototype.renderBorder=function(){var e=this.attributes,r=e.x,i=e.y,a=e.width,s=e.height,o=e.type,l=ke(this.attributes,"border"),c=o==="start"?+a/2:-a/2;ve(this).maybeAppend("border","line").attr("className","border").styles((0,G.pi)({x1:c+r,y1:i-s/2,x2:c+r,y2:i+s/2},l))},t.prototype.render=function(){this.renderBackground(),this.renderIcon(),this.renderBorder()},t.defaultOptions={style:{x:0,y:0,width:10,height:50,iconSize:10,type:"start",backgroundFill:"#fff",backgroundFillOpacity:.5,iconStroke:"#9a9a9a",iconLineWidth:1,borderStroke:"#e8e8e8",borderLineWidth:1}},t}(Ln);function h4(n,t){return typeof n=="number"?gE(n):d4(n,t)}function d4(n,t){var e=new Date(n);switch(t){case"half-hour":case"hour":case"four-hour":return[0,6,12,18].includes(e.getHours())&&e.getMinutes()===0?Fr(e,`HH:mm
YYYY-MM-DD`):Fr(e,"HH:mm");case"half-day":return e.getHours()<12?`AM
`.concat(Fr(e,"YYYY-MM-DD")):"PM";case"day":return[1,10,20].includes(e.getDate())?Fr(e,`DD
YYYY-MM`):Fr(e,"DD");case"week":return e.getDate()<=7?Fr(e,`DD
YYYY-MM`):Fr(e,"DD");case"month":return[0,6].includes(e.getMonth())?Fr(e,`MM\u6708
YYYY`):Fr(e,"MM\u6708");case"season":return[0].includes(e.getMonth())?Fr(e,`MM\u6708
YYYY`):Fr(e,"MM\u6708");case"year":return Fr(e,"YYYY");default:return Fr(e,"YYYY-MM-DD HH:mm")}}function gE(n){var t=String(Math.floor(n/3600)).padStart(2,"0"),e=String(Math.floor(n%3600/60)).padStart(2,"0"),r=String(Math.floor(n%60)).padStart(2,"0");return n<3600?"".concat(e,":").concat(r):"".concat(t,":").concat(e,":").concat(r)}var f4=function(n){(0,G.ZT)(t,n);function t(e){var r=n.call(this,Jn({},t.defaultOptions,e))||this;r.axis=r.appendChild(new u5({style:{type:"linear",startPos:[0,0],endPos:[0,0],data:[],showArrow:!1,animate:!1}})),r.timeline=r.appendChild(new Y5({style:{onChange:function(h){r.handleSliderChange(h)}}})),r.controller=r.appendChild(new l4({})),r.states={},r.handleSliderChange=function(h){var d=function(){var f=r.states.values;return Array.isArray(f)?(0,G.ev)([],(0,G.CR)(f),!1):f}();r.setBySliderValues(h),r.dispatchOnChange(d)};var i=r.attributes,a=i.selectionType,s=i.chartType,o=i.speed,l=i.state,c=i.playMode,u=i.values;return r.states={chartType:s,playMode:c,selectionType:a,speed:o,state:l},r.setByTimebarValues(u),r}return Object.defineProperty(t.prototype,"data",{get:function(){var e=this.attributes.data,r=function(i,a){return i.time<a.time?-1:i.time>a.time?1:0};return e.sort(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"space",{get:function(){var e=this.attributes,r=e.x,i=e.y,a=e.width,s=e.height,o=e.type,l=e.controllerHeight,c=kn(+s-l,0,+s),u=new Cr(r,i+ +s-l,+a,l),h,d=0;o==="chart"?(d=35,h=new Cr(r,i+c-d,+a,d)):h=new Cr;var f=o==="time"?10:c,v=new Cr(r,i+(o==="time"?c:c-f),+a,f-d);return{axisBBox:h,controllerBBox:u,timelineBBox:v}},enumerable:!1,configurable:!0}),t.prototype.setBySliderValues=function(e){var r,i,a=this.data,s=(0,G.CR)(Array.isArray(e)?e:[0,e],2),o=s[0],l=s[1],c=a.length,u=a[Math.floor(o*c)],h=a[Math.ceil(l*c)-(Array.isArray(e)?0:1)];this.states.values=[(r=u==null?void 0:u.time)!==null&&r!==void 0?r:a[0].time,(i=h==null?void 0:h.time)!==null&&i!==void 0?i:1/0]},t.prototype.setByTimebarValues=function(e){var r,i,a,s=this.data,o=(0,G.CR)(Array.isArray(e)?e:[void 0,e],2),l=o[0],c=o[1],u=s.find(function(d){var f=d.time;return f===l}),h=s.find(function(d){var f=d.time;return f===c});this.states.values=[(r=u==null?void 0:u.time)!==null&&r!==void 0?r:(i=s[0])===null||i===void 0?void 0:i.time,(a=h==null?void 0:h.time)!==null&&a!==void 0?a:1/0]},t.prototype.setByIndex=function(e){var r,i,a,s,o=this.data,l=(0,G.CR)(e,2),c=l[0],u=l[1];this.states.values=[(i=(r=o[c])===null||r===void 0?void 0:r.time)!==null&&i!==void 0?i:o[0].time,(s=(a=this.data[u])===null||a===void 0?void 0:a.time)!==null&&s!==void 0?s:1/0]},Object.defineProperty(t.prototype,"sliderValues",{get:function(){var e=this.states,r=e.values,i=e.selectionType,a=(0,G.CR)(Array.isArray(r)?r:[void 0,r],2),s=a[0],o=a[1],l=this.data,c=l.length,u=i==="value",h=function(){var f=l.findIndex(function(v){var g=v.time;return g===s});return u?0:f>-1?f/c:0},d=function(){if(o===1/0)return 1;var f=l.findIndex(function(v){var g=v.time;return g===o});return f>-1?f/c:u?.5:1};return[h(),d()]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var e=this.states,r=e.values,i=e.selectionType,a=(0,G.CR)(Array.isArray(r)?r:[this.data[0].time,r],2),s=a[0],o=a[1];return i==="value"?o:[s,o]},enumerable:!1,configurable:!0}),t.prototype.getDatumByRatio=function(e){var r=this.data,i=r.length,a=Math.floor(e*(i-1));return r[a]},Object.defineProperty(t.prototype,"chartHandleIconShape",{get:function(){var e=this.states.selectionType,r=this.space.timelineBBox.height;return e==="range"?function(i){return new u4({style:{type:i,height:r,iconSize:r/6}})}:function(){return new As({style:{x1:0,y1:-r/2,x2:0,y2:r/2,lineWidth:2,stroke:"#c8c8c8"}})}},enumerable:!1,configurable:!0}),t.prototype.getChartStyle=function(e){var r=this,i=e.x,a=e.y,s=e.width,o=e.height,l=this.states,c=l.selectionType,u=l.chartType,h=this.data,d=this.attributes,f=d.type,v=d.labelFormatter,g=ke(this.attributes,"chart"),p=g.type,y=(0,G._T)(g,["type"]),b=c==="range";if(f==="time")return(0,G.pi)({handleIconShape:function(){return new c4({})},selectionFill:"#2e7ff8",selectionFillOpacity:1,showLabelOnInteraction:!0,handleLabelDy:b?-15:0,autoFitLabel:b,handleSpacing:b?-15:0,trackFill:"#edeeef",trackLength:s,trackOpacity:.5,trackRadius:o/2,trackSize:o/2,type:c,values:this.sliderValues,formatter:function(P){if(v)return v(P);var L=r.getDatumByRatio(P).time;return typeof L=="number"?gE(L):Fr(L,"YYYY-MM-DD HH:mm:ss")},transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},y);var E=c==="range"?5:0,O=h.map(function(P){var L=P.value;return L});return(0,G.pi)({handleIconOffset:E,handleIconShape:this.chartHandleIconShape,selectionFill:"#fff",selectionFillOpacity:.5,selectionType:"invert",sparklineSpacing:.1,sparklineColumnLineWidth:0,sparklineColor:"#d4e5fd",sparklineAreaOpacity:1,sparklineAreaLineWidth:0,sparklineData:O,sparklineType:u,sparklineScale:.8,trackLength:s,trackSize:o,type:c,values:this.sliderValues,transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},y)},t.prototype.renderChart=function(e){e===void 0&&(e=this.space.timelineBBox),this.timeline.update(this.getChartStyle(e))},t.prototype.updateSelection=function(){this.timeline.setValues(this.sliderValues,!0),this.handleSliderChange(this.sliderValues)},t.prototype.getAxisStyle=function(e){var r=this.data,i=this.attributes,a=i.interval,s=i.labelFormatter,o=ke(this.attributes,"axis"),l=e.x,c=e.y,u=e.width,h=(0,G.ev)((0,G.ev)([],(0,G.CR)(r),!1),[{time:0}],!1).map(function(f,v,g){var p=f.time;return{label:"".concat(p),value:v/(g.length-1),time:p}}),d=(0,G.pi)({startPos:[l,c],endPos:[l+u,c],data:h,labelFilter:function(f,v){return v<h.length-1},labelFormatter:function(f){var v=f.time;return s?s(v):h4(v,a)}},o);return d},t.prototype.renderAxis=function(e){e===void 0&&(e=this.space.axisBBox);var r=this.attributes.type;r==="chart"&&this.axis.update(this.getAxisStyle(e))},t.prototype.renderController=function(e){e===void 0&&(e=this.space.controllerBBox);var r=this.attributes.type,i=this.states,a=i.state,s=i.speed,o=i.selectionType,l=i.chartType,c=ke(this.attributes,"controller"),u=this,h=(0,G.pi)((0,G.pi)((0,G.pi)({},e),{iconSize:20,speed:s,state:a,selectionType:o,chartType:l,onChange:function(d,f){var v=f.value;switch(d){case"reset":u.internalReset();break;case"speed":u.handleSpeedChange(v);break;case"backward":u.internalBackward();break;case"playPause":v==="play"?u.internalPlay():u.internalPause();break;case"forward":u.internalForward();break;case"selectionType":u.handleSelectionTypeChange(v);break;case"chartType":u.handleChartTypeChange(v);break;default:break}}}),c);r==="time"&&(h.functions=[["reset","speed"],["backward","playPause","forward"],["selectionType"]]),this.controller.update(h)},t.prototype.dispatchOnChange=function(e){var r=this.data,i=this.attributes.onChange,a=this.states,s=a.values,o=a.selectionType,l=(0,G.CR)(s,2),c=l[0],u=l[1],h=u===1/0?r.at(-1).time:u,d=o==="range"?[c,h]:h,f=function(v,g){return Array.isArray(v)?Array.isArray(g)?v[0]===g[0]&&(v[1]===g[1]||v[1]===1/0||g[1]===1/0):!1:Array.isArray(g)?!1:v===g};(!e||!f(e,d))&&(i==null||i(o==="range"?[c,h]:h))},t.prototype.internalReset=function(e){var r,i,a=this.states.selectionType;this.internalPause(),this.setBySliderValues(a==="range"?[0,1]:[0,0]),this.renderController(),this.updateSelection(),e||((i=(r=this.attributes)===null||r===void 0?void 0:r.onReset)===null||i===void 0||i.call(r),this.dispatchOnChange())},t.prototype.reset=function(){this.internalReset()},t.prototype.moveSelection=function(e,r){var i=this.data,a=i.length,s=this.states,o=s.values,l=s.selectionType,c=s.playMode,u=(0,G.CR)(o,2),h=u[0],d=u[1],f=i.findIndex(function(E){var O=E.time;return O===h}),v=i.findIndex(function(E){var O=E.time;return O===d});v===-1&&(v=a);var g=e==="backward"?-1:1,p;l==="range"?c==="acc"?(p=[f,v+g],g===-1&&f===v&&(p=[f,a])):p=[f+g,v+g]:p=[f,v+g];var y=function(E){var O=(0,G.CR)(E.sort(function(I,V){return I-V}),2),P=O[0],L=O[1],F=function(I){return kn(I,0,a)};return L>a?l==="value"?[0,0]:c==="acc"?[F(P),F(P)]:[0,F(L-P)]:P<0?c==="acc"?[0,F(L)]:[F(P+a-L),a]:[F(P),F(L)]},b=y(p);return this.setByIndex(b),this.updateSelection(),b},t.prototype.internalBackward=function(e){var r,i,a=this.moveSelection("backward",e);return e||((i=(r=this.attributes)===null||r===void 0?void 0:r.onBackward)===null||i===void 0||i.call(r),this.dispatchOnChange()),a},t.prototype.backward=function(){this.internalBackward()},t.prototype.internalPlay=function(e){var r=this,i,a,s=this.data,o=this.attributes.loop,l=this.states.speed,c=l===void 0?1:l;this.playInterval=window.setInterval(function(){var u=r.internalForward();u[1]===s.length&&!o&&(r.internalPause(),r.renderController())},1e3/c),this.states.state="play",!e&&((a=(i=this.attributes)===null||i===void 0?void 0:i.onPlay)===null||a===void 0||a.call(i))},t.prototype.play=function(){this.internalPlay()},t.prototype.internalPause=function(e){var r,i;clearInterval(this.playInterval),this.states.state="pause",!e&&((i=(r=this.attributes)===null||r===void 0?void 0:r.onPause)===null||i===void 0||i.call(r))},t.prototype.pause=function(){this.internalPause()},t.prototype.internalForward=function(e){var r,i,a=this.moveSelection("forward",e);return e||((i=(r=this.attributes)===null||r===void 0?void 0:r.onForward)===null||i===void 0||i.call(r),this.dispatchOnChange()),a},t.prototype.forward=function(){this.internalForward()},t.prototype.handleSpeedChange=function(e){var r,i;this.states.speed=e;var a=this.states.state;a==="play"&&(this.internalPause(!0),this.internalPlay(!0)),(i=(r=this.attributes)===null||r===void 0?void 0:r.onSpeedChange)===null||i===void 0||i.call(r,e)},t.prototype.handleSelectionTypeChange=function(e){var r,i;this.states.selectionType=e,this.renderChart(),(i=(r=this.attributes)===null||r===void 0?void 0:r.onSelectionTypeChange)===null||i===void 0||i.call(r,e)},t.prototype.handleChartTypeChange=function(e){var r,i;this.states.chartType=e,this.renderChart(),(i=(r=this.attributes)===null||r===void 0?void 0:r.onChartTypeChange)===null||i===void 0||i.call(r,e)},t.prototype.render=function(){var e=this.space,r=e.axisBBox,i=e.controllerBBox,a=e.timelineBBox;this.renderController(i),this.renderAxis(r),this.renderChart(a),this.states.state==="play"&&this.internalPlay()},t.prototype.destroy=function(){n.prototype.destroy.call(this),this.internalPause(!0)},t.defaultOptions={style:{x:0,y:0,axisLabelFill:"#6e6e6e",axisLabelTextAlign:"left",axisLabelTextBaseline:"top",axisLabelTransform:"translate(5, -12)",axisLineLineWidth:1,axisLineStroke:"#cacdd1",axisTickLength:15,axisTickLineWidth:1,axisTickStroke:"#cacdd1",chartShowLabel:!1,chartType:"line",controllerAlign:"center",controllerHeight:40,data:[],interval:"day",loop:!1,playMode:"acc",selectionType:"range",type:"time"}},t}(Ln);function v4(n){return n instanceof Date}var g4=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})},p4=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};const m4=["timestamp","time","date","datetime"];class Uh extends br{get padding(){return Ri(this.options.padding)}constructor(t,e){super(t,Object.assign({},Uh.defaultOptions,e)),this.backup(),this.upsertTimebar()}play(){var t;(t=this.timebar)===null||t===void 0||t.play()}pause(){var t;(t=this.timebar)===null||t===void 0||t.pause()}forward(){var t;(t=this.timebar)===null||t===void 0||t.forward()}backward(){var t;(t=this.timebar)===null||t===void 0||t.backward()}reset(){var t;(t=this.timebar)===null||t===void 0||t.reset()}update(t){super.update(t),this.backup(),this.upsertTimebar()}backup(){this.originalData=pE(this.context.graph.getData())}upsertTimebar(){const{canvas:t}=this.context,e=this.options,{onChange:r,timebarType:i,data:a,x:s,y:o,width:l,height:c,mode:u}=e,h=p4(e,["onChange","timebarType","data","x","y","width","height","mode"]),d=t.getSize(),[f]=this.padding;this.upsertCanvas().ready.then(()=>{var v;const g=Object.assign(Object.assign({x:d[0]/2-l/2,y:f,onChange:p=>{const y=(Wr(p)?p:[p,p]).map(b=>v4(b)?b.getTime():b);this.options.mode==="modify"?this.filterElements(y):this.hiddenElements(y),r==null||r(y)}},h),{data:a.map(p=>ie(p)?{time:p,value:0}:p),width:l,height:c,type:i});this.timebar?this.timebar.update(g):(this.timebar=new f4({style:g}),(v=this.canvas)===null||v===void 0||v.appendChild(this.timebar))})}upsertCanvas(){if(this.canvas)return this.canvas;const{className:t,height:e,position:r}=this.options,i=this.context.canvas,[a]=i.getSize(),[s,,o]=this.padding,[l,c]=a0({width:a,height:e+s+o,graphCanvas:i,className:"timebar",placement:r});return this.container=l,t&&l.classList.add(t),this.canvas=c,this.canvas}filterElements(t){return g4(this,void 0,void 0,function*(){var e;if(!this.originalData)return;const{elementTypes:r,getTime:i}=this.options,{graph:a,element:s}=this.context,o=pE(this.originalData);r.forEach(c=>{const u=`${c}s`;o[u]=(this.originalData[u]||[]).filter(h=>{const d=i(h);return!!mE(d,t)})});const l=[...o.nodes,...o.combos].map(c=>At(c));o.edges=o.edges.filter(c=>{const u=c.source,h=c.target;return l.includes(u)&&l.includes(h)}),a.setData(o),yield(e=s.draw({animation:!1,silence:!0}))===null||e===void 0?void 0:e.finished})}hiddenElements(t){const{graph:e}=this.context,{elementTypes:r,getTime:i}=this.options,a=[],s=[];r.forEach(o=>{var l;const c=`${o}s`;(((l=this.originalData)===null||l===void 0?void 0:l[c])||[]).forEach(h=>{const d=At(h),f=i(h);mE(f,t)?s.push(d):a.push(d)})}),e.hideElement(a,!1),e.showElement(s,!1)}destroy(){var t,e,r;const{graph:i}=this.context;this.originalData&&i.setData(Object.assign({},this.originalData)),(t=this.timebar)===null||t===void 0||t.destroy(),(e=this.canvas)===null||e===void 0||e.destroy(),(r=this.container)===null||r===void 0||r.remove(),this.originalData=void 0,this.container=void 0,this.timebar=void 0,this.canvas=void 0,super.destroy()}}Uh.defaultOptions={position:"bottom",enable:!0,timebarType:"time",className:"g6-timebar",width:450,height:60,zIndex:3,elementTypes:["node"],padding:10,mode:"modify",getTime:n=>y4(n,m4,void 0),loop:!1};const pE=n=>{const{nodes:t=[],edges:e=[],combos:r=[]}=n;return{nodes:[...t],edges:[...e],combos:[...r]}},mE=(n,t)=>{if(ie(t))return n===t;const[e,r]=t;return n>=e&&n<=r},y4=(n,t,e)=>{var r;for(let i=0;i<t.length;i++){const a=t[i],s=(r=n.data)===null||r===void 0?void 0:r[a];if(s)return s}return e};function b4(n){const t={top:"unset",right:"unset",bottom:"unset",left:"unset"};return n.split("-").forEach(r=>{t[r]="8px"}),t.flexDirection=n.startsWith("top")||n.startsWith("bottom")?"row":"column",t}const x4=`
.g6-toolbar {
position: absolute;
z-index: 100;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
border-radius: 4px;
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
opacity: 0.65;
}
.g6-toolbar .g6-toolbar-item {
display: inline-block;
width: 16px;
height: 16px;
padding: 4px;
cursor: pointer;
box-sizing: content-box;
}
.g6-toolbar .g6-toolbar-item:hover {
background-color: #f0f0f0;
}
.g6-toolbar .g6-toolbar-item svg {
display: inline-block;
width: 100%;
height: 100%;
pointer-events: none;
}
`,E4=`
<svg>
<symbol id="zoom-in" viewBox="64 64 896 896">
<path d="M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>
</symbol>
<symbol id="zoom-out" viewBox="64 64 896 896">
<path d="M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>
</symbol>
<symbol id="edit" viewBox="64 64 896 896">
<path d="M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"></path>
</symbol>
<symbol id="delete" viewBox="64 64 896 896">
<path d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"></path>
</symbol>
<symbol id="redo" viewBox="64 64 896 896">
<path d="M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"></path>
</symbol>
<symbol id="undo" viewBox="64 64 896 896">
<path d="M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z"></path>
</symbol>
<symbol id="export" viewBox="64 64 896 896">
<path d="M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"></path>
</symbol>
<symbol id="auto-fit" viewBox="64 64 896 896">
<path d="M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"></path>
<path d="M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"></path>
</symbol>
<symbol id="reset" viewBox="64 64 896 896">
<path d="M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"></path>
</symbol>
<symbol id="exit-fullscreen" viewBox="0 0 1024 1024">
<path d="M418.13333333 361.43786666c0 0.2048-0.13653333 0.4096-0.13653334 0.68266667C417.99679999 362.32533333 418.13333333 362.53013333 418.13333333 362.73493333 418.13333333 371.54133333 414.44693333 379.392 408.78079999 385.39946666 408.43946666 385.7408 408.30293333 386.21866666 408.02986666 386.49173333c-1.09226667 1.09226667-2.59413333 1.77493333-3.82293333 2.73066667C398.40426666 393.65973333 391.64586666 396.8 383.93173333 396.8 383.72693333 396.8 383.59039999 396.73173333 383.38559999 396.73173333S382.97599999 396.8 382.77119999 396.8L112.29866666 396.8C92.50133333 396.8 76.79999999 381.50826666 76.79999999 362.66666666 76.66346666 343.89333333 92.63786666 328.53333333 112.16213333 328.53333333l189.44 0L87.44959999 114.51733333C73.59146666 100.59093333 73.25013333 78.5408 86.63039999 65.29706666c13.17546667-13.44853333 35.36213333-12.97066667 49.152 0.88746667l214.08426667 214.08426667L349.86666666 90.89706666C349.79839999 71.23626666 365.22666666 55.46666666 383.99999999 55.46666666 402.77333333 55.33013333 418.13333333 71.30453333 418.13333333 90.8288L418.13333333 361.43786666zM928.90453333 328.53333333l-189.44 0 214.15253333-214.08426667c13.85813333-13.9264 14.19946667-35.90826667 0.88746667-49.22026666-13.17546667-13.44853333-35.36213333-12.97066667-49.152 0.88746666l-214.08426667 214.08426667L691.26826666 90.89706666C691.26826666 71.23626666 675.83999999 55.46666666 657.06666666 55.46666666 638.29333333 55.33013333 622.93333333 71.30453333 622.93333333 90.8288l0 270.60906666c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 362.32533333 622.93333333 362.53013333 622.93333333 362.73493333 622.93333333 371.54133333 626.61973333 379.392 632.28586666 385.39946666c0.34133333 0.34133333 0.47786667 0.8192 0.8192 1.09226667 1.09226667 1.09226667 2.59413333 1.77493333 3.8912 2.73066667C642.66239999 393.65973333 649.42079999 396.8 657.13493333 396.8c0.2048 0 0.34133333-0.06826667 0.54613333-0.06826667S658.09066666 396.8 658.29546666 396.8l270.5408 0C948.56533333 396.8 964.26666666 381.50826666 964.26666666 362.66666666 964.40319999 343.89333333 948.42879999 328.53333333 928.90453333 328.53333333zM418.13333333 635.73333333c0-8.8064-3.6864-16.5888-9.35253334-22.66453333C408.43946666 612.72746666 408.30293333 612.2496 408.02986666 611.90826666 406.86933333 610.88426666 405.43573333 610.2016 404.20693333 609.24586666 398.47253333 604.80853333 391.64586666 601.6 383.93173333 601.6 383.72693333 601.6 383.59039999 601.73653333 383.38559999 601.73653333S382.97599999 601.6 382.77119999 601.6L112.29866666 601.6C92.50133333 601.6 76.79999999 616.96 76.79999999 635.73333333 76.66346666 654.50666666 92.63786666 669.86666666 112.16213333 669.86666666l189.44 0-214.15253334 214.15253334c-13.85813333 13.85813333-14.19946667 35.84-0.88746666 49.22026666 13.17546667 13.44853333 35.36213333 12.9024 49.152-0.95573333l214.08426666-214.08426667 0 189.37173334c0 19.59253333 15.42826667 35.49866667 34.2016 35.36213333C402.77333333 943.2064 418.13333333 927.232 418.13333333 907.5712L418.13333333 637.09866666c0-0.27306667-0.13653333-0.47786667-0.13653334-0.68266666C417.99679999 636.14293333 418.13333333 635.93813333 418.13333333 635.73333333zM739.46453333 669.86666666l189.44 0c19.456 0 35.49866667-15.36 35.36213333-34.13333333C964.26666666 616.96 948.56533333 601.6 928.76799999 601.6L658.29546666 601.6C658.09066666 601.6 657.88586666 601.73653333 657.68106666 601.73653333S657.33973333 601.6 657.13493333 601.6C649.42079999 601.6 642.59413333 604.80853333 636.85973333 609.24586666 635.63093333 610.2016 634.19733333 610.88426666 633.03679999 611.90826666 632.76373333 612.2496 632.62719999 612.72746666 632.28586666 613.0688 626.61973333 619.14453333 622.93333333 626.92693333 622.93333333 635.73333333c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 636.6208 622.93333333 636.8256 622.93333333 637.09866666l0 270.5408C622.93333333 927.232 638.29333333 943.2064 657.06666666 942.93333333c18.77333333 0.13653333 34.2016-15.70133333 34.2016-35.36213333l0-189.37173334 214.08426667 214.08426667c13.78986667 13.85813333 35.90826667 14.40426667 49.152 0.95573333 13.312-13.312 12.97066667-35.36213333-0.88746667-49.22026666L739.46453333 669.86666666z" ></path></symbol>
<symbol id="request-fullscreen" viewBox="0 0 1024 1024">
<path d="M69.818182 87.598545v273.128728a34.909091 34.909091 0 0 0 69.818182 0V163.653818l221.928727 222.021818a33.512727 33.512727 0 0 0 47.383273-47.383272L186.926545 116.363636h197.073455a34.909091 34.909091 0 0 0 0-69.818181H110.871273C85.364364 46.545455 69.818182 59.671273 69.818182 87.598545zM938.542545 46.545455H665.413818a34.909091 34.909091 0 0 0 0 69.818181h197.073455L640.465455 338.292364a33.512727 33.512727 0 0 0 47.383272 47.383272l221.928728-222.021818v197.073455a34.909091 34.909091 0 0 0 69.818181 0V87.598545c0-27.927273-15.453091-41.053091-40.96-41.05309z m-827.671272 907.636363h273.128727a34.909091 34.909091 0 0 0 0-69.818182H186.926545l222.021819-221.928727a33.512727 33.512727 0 0 0-47.383273-47.383273L139.636364 837.073455V640a34.909091 34.909091 0 0 0-69.818182 0v273.128727c0 27.927273 15.546182 41.053091 41.053091 41.053091z m868.724363-41.053091V640a34.909091 34.909091 0 0 0-69.818181 0v197.073455L687.941818 615.051636a33.512727 33.512727 0 0 0-47.383273 47.383273L862.487273 884.363636H665.413818a34.909091 34.909091 0 0 0 0 69.818182h273.128727c25.6 0 41.053091-13.125818 41.053091-41.053091z" ></path></symbol>
</svg>
`;var yE=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class Yh extends br{constructor(t,e){super(t,Object.assign({},Yh.defaultOptions,e)),this.$element=So("toolbar",!1),this.onToolbarItemClick=i=>{const{onClick:a}=this.options;if(i.target instanceof Element&&i.target.className.includes("g6-toolbar-item")){const s=i.target.getAttribute("value");a==null||a(s,i.target)}};const r=this.context.canvas.getContainer();this.$element.style.display="flex",r.appendChild(this.$element),Gv("g6-toolbar-css","style",{},x4,document.head),Gv("g6-toolbar-svgicon","div",{display:"none"},E4),this.$element.addEventListener("click",this.onToolbarItemClick),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return yE(this,void 0,void 0,function*(){e.update.call(this,t);const{className:r,position:i,style:a}=this.options;this.$element.className=`g6-toolbar ${r||""}`,Object.assign(this.$element.style,a,b4(i)),this.$element.innerHTML=yield this.getDOMContent()})}destroy(){this.$element.removeEventListener("click",this.onToolbarItemClick),this.$element.remove(),super.destroy()}getDOMContent(){return yE(this,void 0,void 0,function*(){return(yield this.options.getItems()).map(e=>{var r;return`
<div class="g6-toolbar-item" value="${e.value}" title="${(r=e.title)!==null&&r!==void 0?r:""}">
<svg aria-hidden="true" focusable="false">
<use xlink:href="#${e.id}"></use>
</svg>
</div>`}).join("")})}}Yh.defaultOptions={position:"top-left"};function D0(n){var t=document.createElement("div");t.innerHTML=n;var e=t.childNodes[0];return e&&t.contains(e)&&t.removeChild(e),e}function w4(n,t){return!n||!t?n:n.replace(/\\?\{([^{}]+)\}/g,function(e,r){return e.charAt(0)==="\\"?e.slice(1):t[r]===void 0?"":t[r]})}var S4=w4,bE=function(n,t){if(t==null){n.innerHTML="";return}n.replaceChildren?Array.isArray(t)?n.replaceChildren.apply(n,(0,G.ev)([],(0,G.CR)(t),!1)):n.replaceChildren(t):(n.innerHTML="",Array.isArray(t)?t.forEach(function(e){return n.appendChild(e)}):n.appendChild(t))};function I0(n){return n===void 0&&(n=""),{CONTAINER:"".concat(n,"tooltip"),TITLE:"".concat(n,"tooltip-title"),LIST:"".concat(n,"tooltip-list"),LIST_ITEM:"".concat(n,"tooltip-list-item"),NAME:"".concat(n,"tooltip-list-item-name"),MARKER:"".concat(n,"tooltip-list-item-marker"),NAME_LABEL:"".concat(n,"tooltip-list-item-name-label"),VALUE:"".concat(n,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(n,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(n,"tooltip-crosshair-y")}}var xE={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function M4(n){var t;n===void 0&&(n="");var e=I0(n);return t={},t[".".concat(e.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},t[".".concat(e.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},t[".".concat(e.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},t[".".concat(e.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},t[".".concat(e.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},t[".".concat(e.NAME)]={display:"flex","align-items":"center","max-width":"216px"},t[".".concat(e.NAME_LABEL)]=(0,G.pi)({flex:1},xE),t[".".concat(e.VALUE)]=(0,G.pi)({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},xE),t[".".concat(e.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},t[".".concat(e.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},t}var A4=function(n){(0,G.ZT)(t,n);function t(e){var r=this,i,a,s=(a=(i=e.style)===null||i===void 0?void 0:i.template)===null||a===void 0?void 0:a.prefixCls,o=I0(s);return r=n.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(o.CONTAINER,'"></div>'),title:'<div class="'.concat(o.TITLE,'"></div>'),item:'<li class="'.concat(o.LIST_ITEM,`" data-index={index}>
<span class="`).concat(o.NAME,`">
<span class="`).concat(o.MARKER,`" style="background:{color}"></span>
<span class="`).concat(o.NAME_LABEL,`" title="{name}">{name}</span>
</span>
<span class="`).concat(o.VALUE,`" title="{value}">{value}</span>
</li>`)},style:M4(s)})||this,r.timestamp=-1,r.prevCustomContentKey=r.attributes.contentKey,r.initShape(),r.render(r.attributes,r),r}return Object.defineProperty(t.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),t.prototype.getContainer=function(){return this.element},Object.defineProperty(t.prototype,"elementSize",{get:function(){var e=this.element.offsetWidth,r=this.element.offsetHeight;return{width:e,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HTMLTooltipItemsElements",{get:function(){var e=this.attributes,r=e.data,i=e.template;return r.map(function(a,s){var o=a.name,l=o===void 0?"":o,c=a.color,u=c===void 0?"black":c,h=a.index,d=(0,G._T)(a,["name","color","index"]),f=(0,G.pi)({name:l,color:u,index:h!=null?h:s},d);return D0(S4(i.item,f))})},enumerable:!1,configurable:!0}),t.prototype.render=function(e,r){this.renderHTMLTooltipElement(),this.updatePosition()},t.prototype.destroy=function(){var e;(e=this.element)===null||e===void 0||e.remove(),n.prototype.destroy.call(this)},t.prototype.show=function(e,r){var i=this;if(e!==void 0&&r!==void 0){var a=this.element.style.visibility==="hidden",s=function(){i.attributes.x=e!=null?e:i.attributes.x,i.attributes.y=r!=null?r:i.attributes.y,i.updatePosition()};a?this.closeTransition(s):s()}this.element.style.visibility="visible"},t.prototype.hide=function(e,r){e===void 0&&(e=0),r===void 0&&(r=0);var i=this.attributes.enterable;i&&this.isCursorEntered(e,r)||(this.element.style.visibility="hidden")},t.prototype.initShape=function(){var e=this.attributes.template;this.element=D0(e.container),this.id&&this.element.setAttribute("id",this.id)},t.prototype.renderCustomContent=function(){if(!(this.prevCustomContentKey!==void 0&&this.prevCustomContentKey===this.attributes.contentKey)){this.prevCustomContentKey=this.attributes.contentKey;var e=this.attributes.content;e&&(typeof e=="string"?this.element.innerHTML=e:bE(this.element,e))}},t.prototype.renderHTMLTooltipElement=function(){var e,r,i=this.attributes,a=i.template,s=i.title,o=i.enterable,l=i.style,c=i.content,u=I0(a.prefixCls),h=this.element;if(this.element.style.pointerEvents=o?"auto":"none",c)this.renderCustomContent();else{s?(h.innerHTML=a.title,h.getElementsByClassName(u.TITLE)[0].innerHTML=s):(r=(e=h.getElementsByClassName(u.TITLE))===null||e===void 0?void 0:e[0])===null||r===void 0||r.remove();var d=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=u.LIST,bE(f,d);var v=this.element.querySelector(".".concat(u.LIST));v?v.replaceWith(f):h.appendChild(f)}GD(h,l)},t.prototype.getRelativeOffsetFromCursor=function(e){var r=this.attributes,i=r.position,a=r.offset,s=e||i,o=s.split("-"),l={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},c=this.elementSize,u=c.width,h=c.height,d=[-u/2,-h/2];return o.forEach(function(f){var v=(0,G.CR)(d,2),g=v[0],p=v[1],y=(0,G.CR)(l[f],2),b=y[0],E=y[1];d=[g+(u/2+a[0])*b,p+(h/2+a[1])*E]}),d},t.prototype.setOffsetPosition=function(e){var r=(0,G.CR)(e,2),i=r[0],a=r[1],s=this.attributes,o=s.x,l=o===void 0?0:o,c=s.y,u=c===void 0?0:c,h=s.container,d=h.x,f=h.y;this.element.style.left="".concat(+l+d+i,"px"),this.element.style.top="".concat(+u+f+a,"px")},t.prototype.updatePosition=function(){var e=this.attributes.showDelay,r=e===void 0?60:e,i=Date.now();this.timestamp>0&&i-this.timestamp<r||(this.timestamp=i,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},t.prototype.autoPosition=function(e){var r=(0,G.CR)(e,2),i=r[0],a=r[1],s=this.attributes,o=s.x,l=s.y,c=s.bounding,u=s.position;if(!c)return[i,a];var h=this.element,d=h.offsetWidth,f=h.offsetHeight,v=(0,G.CR)([+o+i,+l+a],2),g=v[0],p=v[1],y={left:"right",right:"left",top:"bottom",bottom:"top"},b=c.x,E=c.y,O=c.width,P=c.height,L={left:g<b,right:g+d>b+O,top:p<E,bottom:p+f>E+P},F=[];u.split("-").forEach(function(V){L[V]?F.push(y[V]):F.push(V)});var I=F.join("-");return this.getRelativeOffsetFromCursor(I)},t.prototype.isCursorEntered=function(e,r){if(this.element){var i=this.element.getBoundingClientRect(),a=i.x,s=i.y,o=i.width,l=i.height;return new Cr(a,s,o,l).isPointIn(e,r)}return!1},t.prototype.closeTransition=function(e){var r=this,i=this.element.style.transition;this.element.style.transition="none",e(),setTimeout(function(){r.element.style.transition=i},10)},t.tag="tooltip",t}(Ln),EE=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class Hh extends br{constructor(t,e){super(t,Object.assign({},Hh.defaultOptions,e)),this.currentTarget=null,this.tooltipElement=null,this.container=null,this.isEnable=(r,i)=>{const{enable:a}=this.options;return typeof a=="function"?a(r,i):a},this.onClick=r=>{const{target:{id:i}}=r;this.currentTarget===i?this.hide(r):this.show(r)},this.onPointerMove=r=>{const{target:i}=r;!this.currentTarget||i.id===this.currentTarget||this.show(r)},this.onPointerLeave=r=>{this.hide(r)},this.onCanvasMove=r=>{this.hide(r)},this.onPointerOver=r=>{this.show(r)},this.showById=r=>EE(this,void 0,void 0,function*(){const i={target:{id:r}};yield this.show(i)}),this.getElementData=(r,i)=>{const{model:a}=this.context;switch(i){case"node":return a.getNodeData([r]);case"edge":return a.getEdgeData([r]);case"combo":return a.getComboData([r]);default:return[]}},this.show=r=>EE(this,void 0,void 0,function*(){var i,a;const{client:s,target:{id:o}}=r;if(Ol(r.target))return;const l=this.context.graph.getElementType(o),{getContent:c,title:u}=this.options,h=this.getElementData(o,l);if(!this.tooltipElement||!this.isEnable(r,h))return;let d={};if(c){if(d.content=yield c(r,h),!d.content)return}else{const g=this.context.graph.getElementRenderStyle(o),p=l==="node"?g.fill:g.stroke;d={title:u||l,data:h.map(y=>({name:"ID",value:y.id||`${y.source} -> ${y.target}`,color:p}))}}this.currentTarget=o;let f,v;if(s)f=s.x,v=s.y;else{const g=yr(h,"0.style",{x:0,y:0});f=g.x,v=g.y}(a=(i=this.options).onOpenChange)===null||a===void 0||a.call(i,!0),this.tooltipElement.update(Object.assign(Object.assign(Object.assign({},this.tooltipStyleProps),{x:f,y:v,style:{".tooltip":{visibility:"visible"}}}),d))}),this.hide=r=>{var i,a,s,o,l;if(!r){(a=(i=this.options).onOpenChange)===null||a===void 0||a.call(i,!1),(s=this.tooltipElement)===null||s===void 0||s.hide(),this.currentTarget=null;return}if(!this.tooltipElement||!this.currentTarget)return;const{client:{x:c,y:u}}=r;(l=(o=this.options).onOpenChange)===null||l===void 0||l.call(o,!1),this.tooltipElement.hide(c,u),this.currentTarget=null},this.initTooltip=()=>{var r;const i=new A4({className:"tooltip",style:this.tooltipStyleProps});return(r=this.container)===null||r===void 0||r.appendChild(i.HTMLTooltipElement),i},this.render(),this.bindEvents()}getEvents(){return this.options.trigger==="click"?{"node:click":this.onClick,"edge:click":this.onClick,"combo:click":this.onClick,"canvas:click":this.onPointerLeave,contextmenu:this.onPointerLeave,drag:this.onPointerLeave}:{"node:pointerover":this.onPointerOver,"node:pointermove":this.onPointerMove,"canvas:pointermove":this.onCanvasMove,"edge:pointerover":this.onPointerOver,"edge:pointermove":this.onPointerMove,"combo:pointerover":this.onPointerOver,"combo:pointermove":this.onPointerMove,contextmenu:this.onPointerLeave,"node:drag":this.onPointerLeave}}update(t){var e;this.unbindEvents(),super.update(t),this.tooltipElement&&((e=this.container)===null||e===void 0||e.removeChild(this.tooltipElement.HTMLTooltipElement)),this.tooltipElement=this.initTooltip(),this.bindEvents()}render(){const{canvas:t}=this.context,e=t.getContainer();e&&(this.container=e,this.tooltipElement=this.initTooltip())}unbindEvents(){const{graph:t}=this.context,e=this.getEvents();Object.keys(e).forEach(r=>{t.off(r,e[r])})}bindEvents(){const{graph:t}=this.context,e=this.getEvents();Object.keys(e).forEach(r=>{t.on(r,e[r])})}get tooltipStyleProps(){const{canvas:t}=this.context,{center:e}=t.getBounds(),r=t.getContainer(),{top:i,left:a}=r.getBoundingClientRect(),{style:s,position:o,enterable:l,container:c={x:-a,y:-i},title:u,offset:h}=this.options,[d,f]=e,[v,g]=t.getSize();return{x:d,y:f,container:c,title:u,bounding:{x:0,y:0,width:v,height:g},position:o,enterable:l,offset:h,style:s}}destroy(){var t;this.unbindEvents(),this.tooltipElement&&((t=this.container)===null||t===void 0||t.removeChild(this.tooltipElement.HTMLTooltipElement)),super.destroy()}}Hh.defaultOptions={trigger:"hover",position:"top-right",enterable:!1,enable:!0,offset:[10,10],style:{".tooltip":{visibility:"hidden"}}};var wE=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};let No;function SE(n,t){return No||(No=document.createElement("canvas")),No.width=n,No.height=t,No.getContext("2d").clearRect(0,0,n,t),No}function T4(n,t,e,r){return wE(this,void 0,void 0,function*(){const i=SE(n,t),a=i.getContext("2d"),{rotate:s,opacity:o,textFill:l,textFontSize:c,textFontFamily:u,textFontVariant:h,textFontWeight:d,textAlign:f,textBaseline:v}=r;return a.textAlign=f,a.textBaseline=v,a.translate(n/2,t/2),a.font=`${c}px ${u} ${h} ${d}`,s&&a.rotate(s),o&&(a.globalAlpha=o),l&&(a.fillStyle=l,a.fillText(`${e}`,0,0)),i.toDataURL()})}function O4(n,t,e,r){return wE(this,void 0,void 0,function*(){const i=SE(n,t),a=i.getContext("2d"),{rotate:s,opacity:o}=r;s&&a.rotate(s),o&&(a.globalAlpha=o);const l=new Image;return l.crossOrigin="anonymous",l.src=e,new Promise(c=>{l.onload=function(){const u=n>l.width?(n-l.width)/2:0,h=t>l.height?(t-l.height)/2:0;a.drawImage(l,0,0,l.width,l.height,u,h,n-u*2,t-h*2),c(i.toDataURL())}})})}var C4=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})},N4=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class Xh extends br{constructor(t,e){super(t,Object.assign({},Xh.defaultOptions,e)),this.$element=So("watermark"),this.context.canvas.getContainer().appendChild(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return C4(this,void 0,void 0,function*(){e.update.call(this,t);const r=this.options,{width:i,height:a,text:s,imageURL:o}=r,l=N4(r,["width","height","text","imageURL"]);Object.keys(l).forEach(u=>{u.startsWith("background")&&(this.$element.style[u]=t[u])});const c=o?yield O4(i,a,o,l):yield T4(i,a,s,l);this.$element.style.backgroundImage=`url(${c})`})}destroy(){super.destroy(),this.$element.remove()}}Xh.defaultOptions={width:200,height:100,opacity:.2,rotate:Math.PI/12,text:"",textFill:"#000",textFontSize:16,textAlign:"center",textBaseline:"middle",backgroundRepeat:"repeat"};const k4=["#7E92B5","#F4664A","#FFBE3A"],P4={type:"group",color:["#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]},R4={type:"group",color:["#99ADD1","#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]};function ME(n){const{bgColor:t,textColor:e,nodeColor:r,nodeColorDisabled:i,nodeStroke:a,nodeHaloStrokeOpacityActive:s=.15,nodeHaloStrokeOpacitySelected:o=.25,nodeOpacityDisabled:l=.06,nodeIconOpacityInactive:c=.85,nodeOpacityInactive:u=.25,nodeBadgePalette:h=k4,nodePaletteOptions:d=P4,edgeColor:f,edgeColorDisabled:v,edgePaletteOptions:g=R4,comboColor:p,comboColorDisabled:y,comboStroke:b,comboStrokeDisabled:E,edgeColorInactive:O}=n;return{background:t,node:{palette:d,style:{donutOpacity:1,badgeBackgroundOpacity:1,badgeFill:"#fff",badgeFontSize:8,badgePadding:[0,4],badgePalette:h,fill:r,fillOpacity:1,halo:!1,iconFill:"#fff",iconOpacity:1,labelBackground:!1,labelBackgroundFill:t,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelFill:e,labelFillOpacity:.85,labelLineHeight:16,labelPadding:[0,2],labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelOffsetY:2,lineWidth:0,portFill:r,portLineWidth:1,portStroke:a,portStrokeOpacity:.65,size:32,stroke:a,strokeOpacity:1,zIndex:2},state:{selected:{halo:!0,haloLineWidth:24,haloStrokeOpacity:o,labelFontSize:12,labelFontWeight:"bold",lineWidth:4,stroke:a},active:{halo:!0,haloLineWidth:12,haloStrokeOpacity:s},highlight:{labelFontWeight:"bold",lineWidth:4,stroke:a,strokeOpacity:.85},inactive:{badgeBackgroundOpacity:u,donutOpacity:u,fillOpacity:u,iconOpacity:c,labelFill:e,labelFillOpacity:u,strokeOpacity:u},disabled:{badgeBackgroundOpacity:.25,donutOpacity:l,fill:i,fillOpacity:l,iconFill:i,iconOpacity:.25,labelFill:e,labelFillOpacity:.25,strokeOpacity:l}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"node-expand",collapse:"node-collapse",update:[{fields:["x","y","fill","stroke"]}],translate:[{fields:["x","y"]}]}},edge:{palette:g,style:{badgeBackgroundFill:f,badgeFill:"#fff",badgeFontSize:8,badgeOffsetX:10,fillOpacity:1,halo:!1,haloLineWidth:12,haloStrokeOpacity:1,increasedLineWidthForHitTesting:2,labelBackground:!1,labelBackgroundFill:t,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[4,4,4,4],labelFill:e,labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelPlacement:"center",labelTextBaseline:"middle",lineWidth:1,stroke:f,strokeOpacity:1,zIndex:1},state:{selected:{halo:!0,haloStrokeOpacity:.25,labelFontSize:14,labelFontWeight:"bold",lineWidth:3},active:{halo:!0,haloStrokeOpacity:.15},highlight:{labelFontWeight:"bold",lineWidth:3},inactive:{stroke:O,fillOpacity:.08,labelOpacity:.25,strokeOpacity:.08,badgeBackgroundOpacity:.25},disabled:{stroke:v,fillOpacity:.45,strokeOpacity:.45,labelOpacity:.25,badgeBackgroundOpacity:.45}},animation:{enter:"fade",exit:"fade",expand:"path-in",collapse:"path-out",show:"fade",hide:"fade",update:[{fields:["sourceNode","targetNode"]},{fields:["stroke"],shape:"key"}],translate:[{fields:["sourceNode","targetNode"]}]}},combo:{style:{collapsedMarkerFill:t,collapsedMarkerFontSize:12,collapsedMarkerFillOpacity:1,collapsedSize:32,collapsedFillOpacity:1,fill:p,halo:!1,haloLineWidth:12,haloStroke:b,haloStrokeOpacity:.25,labelBackground:!1,labelBackgroundFill:t,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[2,4,2,4],labelFill:e,labelFontSize:12,labelFontWeight:400,labelOpacity:1,lineDash:0,lineWidth:1,fillOpacity:.04,strokeOpacity:1,padding:10,stroke:b},state:{selected:{halo:!0,labelFontSize:14,labelFontWeight:700,lineWidth:4},active:{halo:!0},highlight:{labelFontWeight:700,lineWidth:4},inactive:{fillOpacity:.65,labelOpacity:.25,strokeOpacity:.65},disabled:{fill:y,fillOpacity:.25,labelOpacity:.25,stroke:E,strokeOpacity:.25}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"combo-expand",collapse:"combo-collapse",update:[{fields:["x","y"]},{fields:["fill","stroke","lineWidth"],shape:"key"}],translate:[{fields:["x","y"]}]}}}}const L4=ME({bgColor:"#000000",comboColor:"#fdfdfd",comboColorDisabled:"#d0e4ff",comboStroke:"#99add1",comboStrokeDisabled:"#969696",edgeColor:"#637088",edgeColorDisabled:"#637088",edgeColorInactive:"#D0E4FF",edgePaletteOptions:{type:"group",color:["#637088","#0F55A6","#008383","#9C5D38","#8B53A6","#4E40A6","#8F6608","#3E801D","#A65383","#175E75","#0F8248"]},nodeColor:"#1783ff",nodeColorDisabled:"#D0E4FF",nodeHaloStrokeOpacityActive:.25,nodeHaloStrokeOpacitySelected:.45,nodeIconOpacityInactive:.45,nodeOpacityDisabled:.25,nodeOpacityInactive:.45,nodeStroke:"#d0e4ff",textColor:"#ffffff"}),_4=ME({bgColor:"#ffffff",comboColor:"#99ADD1",comboColorDisabled:"#f0f0f0",comboStroke:"#99add1",comboStrokeDisabled:"#d9d9d9",edgeColor:"#99add1",edgeColorDisabled:"#d9d9d9",edgeColorInactive:"#1B324F",nodeColor:"#1783ff",nodeColorDisabled:"#1B324F",nodeHaloStrokeOpacityActive:.15,nodeHaloStrokeOpacitySelected:.25,nodeIconOpacityInactive:.85,nodeOpacityDisabled:.06,nodeOpacityInactive:.25,nodeStroke:"#000000",textColor:"#000000"});class ts extends Gf{beforeDraw(t,e){return t}afterLayout(t,e){}}class D4 extends ts{beforeDraw(t){const{model:e}=this.context,r=t.add.combos,i=a=>{const s=[];return a.forEach((o,l)=>{const u=e.getAncestorsData(l,"combo").map(h=>At(h)).reverse();s.push([l,o,u.length])}),new Map(s.sort(([,,o],[,,l])=>l-o).map(([o,l])=>[o,l]))};return t.add.combos=i(r),t.update.combos=i(t.update.combos),t}}function ci(n,t,e,r,i){const a=At(r),s=`${e}s`,o=i?r:n.add[s].get(a)||n.update[s].get(a)||n.remove[s].get(a)||r;Object.entries(n).forEach(([l,c])=>{t===l?c[s].set(a,o):c[s].delete(a)})}function Kh(n,t){return Object.keys(n).every(e=>n[e]===t[e])}class I4 extends ts{beforeDraw(t,e){if(e.stage==="visibility"||!this.context.model.model.hasTreeStructure(dn))return t;const{model:r}=this.context,{add:i,update:a}=t,s=[...t.update.combos.entries(),...t.add.combos.entries()];for(;s.length;){const[o,l]=s.pop();if(Kr(l)){const c=r.getDescendantsData(o),u=c.map(At),{internal:h,external:d}=fv(u,f=>r.getRelatedEdgesData(f));c.forEach(f=>{const v=At(f),g=s.findIndex(([y])=>y===v);g!==-1&&s.splice(g,1);const p=r.getElementType(v);ci(t,"remove",p,f)}),h.forEach(f=>ci(t,"remove","edge",f)),d.forEach(f=>{var v;const g=At(f);((v=this.context.element)===null||v===void 0?void 0:v.getElement(g))?a.edges.set(g,f):i.edges.set(g,f)})}else{const c=r.getChildrenData(o),u=c.map(At),{edges:h}=fv(u,d=>r.getRelatedEdgesData(d));[...c,...h].forEach(d=>{var f;const v=At(d),g=r.getElementType(v);((f=this.context.element)===null||f===void 0?void 0:f.getElement(v))?ci(t,"update",g,d):ci(t,"add",g,d),g==="combo"&&s.push([v,d])})}}return t}}const AE=(n,t,e,r)=>{const i=`${e}s`,a=At(r);!n.add[i].has(a)&&!n.update[i].has(a)&&n[t][i].set(At(r),r)};class B4 extends ts{getElement(t){return this.context.element.getElement(t)}handleExpand(t,e){if(AE(e,"add","node",t),Kr(t))return;const r=At(t);AE(e,"add","node",t),this.context.model.getRelatedEdgesData(r).forEach(s=>{ci(e,"add","edge",s)}),this.context.model.getChildrenData(r).forEach(s=>{this.handleExpand(s,e)})}beforeDraw(t){const{graph:e,model:r}=this.context;if(!r.model.hasTreeStructure(ii))return t;const{add:{nodes:i,edges:a},update:{nodes:s}}=t,o=new Map,l=new Map;i.forEach((u,h)=>{Kr(u)&&o.set(h,u)}),a.forEach(u=>{if(e.getElementType(u.source)!=="node")return;const h=e.getNodeData(u.source);Kr(h)&&o.set(u.source,h)}),s.forEach((u,h)=>{const d=this.getElement(h);if(!d)return;const f=d.attributes.collapsed;Kr(u)?f||o.set(h,u):f&&l.set(h,u)});const c=new Set;return o.forEach((u,h)=>{r.getDescendantsData(h).forEach(f=>{const v=At(f);if(c.has(v))return;ci(t,"remove","node",f),r.getRelatedEdgesData(v).forEach(p=>{ci(t,"remove","edge",p)}),c.add(v)})}),l.forEach((u,h)=>{if(r.getAncestorsData(h,ii).some(Kr)){ci(t,"remove","node",u);return}this.handleExpand(u,t)}),t}}const B0=new WeakMap;function Cj(n,t,e){B0.has(n)||B0.set(n,{});const r=B0.get(n);if(!r[t])return r[t]=e,!0;const i=r[t];return TE(i,e)?!1:(r[t]=e,!0)}const TE=(n,t,e=2)=>{if(typeof n!="object"||typeof t!="object")return n===t;const r=Object.keys(n),i=Object.keys(t);if(r.length!==i.length)return!1;for(const a of r){const s=n[a],o=t[a];if(e>1&&typeof s=="object"&&typeof o=="object"){if(!TE(s,o,e-1))return!1}else if(s!==o)return!1}return!0};function F4(n,t,e){Tf[n][t]&&Xr.warn(`The extension ${t} of ${n} has been registered before, and will be overridden.`),Object.assign(Tf[n],{[t]:e})}var OE=function(){function n(t){(0,N.Z)(this,n),this.dragndropPluginOptions=t}return(0,T.Z)(n,[{key:"apply",value:function(e){var r=this,i=e.renderingService,a=e.renderingContext,s=a.root.ownerDocument,o=s.defaultView,l=function(u){var h=u.target,d=h===s,f=d&&r.dragndropPluginOptions.isDocumentDraggable?s:h.closest&&h.closest("[draggable=true]");if(f){var v=!1,g=u.timeStamp,p=[u.clientX,u.clientY],y=null,b=[u.clientX,u.clientY],E=function(){var P=(0,Ra.Z)((0,Tr.Z)().mark(function L(F){var I,V,Y,J,$,ot;return(0,Tr.Z)().wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:if(v){ct.next=2;break}if(I=F.timeStamp-g,V=Zr([F.clientX,F.clientY],p),!(I<=r.dragndropPluginOptions.dragstartTimeThreshold||V<=r.dragndropPluginOptions.dragstartDistanceThreshold)){ct.next=1;break}return ct.abrupt("return");case 1:F.type="dragstart",f.dispatchEvent(F),v=!0;case 2:if(F.type="drag",F.dx=F.clientX-b[0],F.dy=F.clientY-b[1],f.dispatchEvent(F),b=[F.clientX,F.clientY],d){ct.next=4;break}return Y=r.dragndropPluginOptions.overlap==="pointer"?[F.canvasX,F.canvasY]:h.getBounds().center,ct.next=3,s.elementsFromPoint(Y[0],Y[1]);case 3:J=ct.sent,$=J[J.indexOf(h)+1],ot=($==null?void 0:$.closest("[droppable=true]"))||(r.dragndropPluginOptions.isDocumentDroppable?s:null),y!==ot&&(y&&(F.type="dragleave",F.target=y,y.dispatchEvent(F)),ot&&(F.type="dragenter",F.target=ot,ot.dispatchEvent(F)),y=ot,y&&(F.type="dragover",F.target=y,y.dispatchEvent(F)));case 4:case"end":return ct.stop()}},L)}));return function(F){return P.apply(this,arguments)}}();o.addEventListener("pointermove",E);var O=function(L){if(v){L.detail={preventClick:!0};var F=L.clone();y&&(F.type="drop",F.target=y,y.dispatchEvent(F)),F.type="dragend",f.dispatchEvent(F),v=!1}o.removeEventListener("pointermove",E)};h.addEventListener("pointerup",O,{once:!0}),h.addEventListener("pointerupoutside",O,{once:!0})}};i.hooks.init.tap(n.tag,function(){o.addEventListener("pointerdown",l)}),i.hooks.destroy.tap(n.tag,function(){o.removeEventListener("pointerdown",l)})}}])}();OE.tag="Dragndrop";var z4=function(n){function t(){var e,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,N.Z)(this,t),e=(0,_.Z)(this,t),e.name="dragndrop",e.options=r,e}return(0,C.Z)(t,n),(0,T.Z)(t,[{key:"init",value:function(){this.addRenderingPlugin(new OE((0,B.Z)({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(r){Object.assign(this.plugins[0].dragndropPluginOptions,r)}}])}(La),CE=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})},NE=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};const kE=["main"],PE=["background","main","label","transient"];function j4(n){return n.main}class RE{getConfig(){return this.config}getLayer(t="main"){return this.extends.layers[t]||j4(this.getLayers())}getLayers(){return this.extends.layers}getRenderer(t){return this.extends.renderers[t]}getCamera(t="main"){return this.getLayer(t).getCamera()}getRoot(t="main"){return this.getLayer(t).getRoot()}getContextService(t="main"){return this.getLayer(t).getContextService()}setCursor(t){this.config.cursor=t,this.getLayer().setCursor(t)}get document(){return this.getLayer().document}get context(){return this.getLayer().context}constructor(t){this.config={enableMultiLayer:!0},Object.assign(this.config,t);const e=this.config,{renderer:r,background:i,cursor:a,enableMultiLayer:s}=e,o=NE(e,["renderer","background","cursor","enableMultiLayer"]),l=s?PE:kE,c=LE(r,l),u=Object.fromEntries(l.map(h=>{const d=new gf(Object.assign(Object.assign({},o),{supportsMutipleCanvasesInOneContainer:s,renderer:c[h],background:s?h==="background"?i:void 0:i}));return[h,d]}));_E(u),this.extends={config:this.config,renderer:r,renderers:c,layers:u}}get ready(){return Promise.all(Object.entries(this.getLayers()).map(([,t])=>t.ready))}resize(t,e){Object.assign(this.extends.config,{width:t,height:e}),Object.values(this.getLayers()).forEach(r=>{const i=r.getCamera(),a=i.getPosition(),s=i.getFocalPoint();r.resize(t,e),i.setPosition(a),i.setFocalPoint(s)})}getBounds(t){return dl(Object.values(this.getLayers()).map(e=>t?e.getRoot().childNodes.find(i=>i.classList.includes(t)):e.getRoot()).filter(e=>(e==null?void 0:e.childNodes.length)>0).map(e=>e.getBounds()))}getContainer(){const t=this.extends.config.container;return typeof t=="string"?document.getElementById(t):t}getSize(){return[this.extends.config.width||0,this.extends.config.height||0]}appendChild(t,e){var r;const i=((r=t.style)===null||r===void 0?void 0:r.$layer)||"main";return this.getLayer(i).appendChild(t,e)}setRenderer(t){if(t===this.extends.renderer)return;const e=LE(t,this.config.enableMultiLayer?PE:kE);this.extends.renderers=e,Object.entries(e).forEach(([r,i])=>this.getLayer(r).setRenderer(i)),_E(this.getLayers())}getCanvasByViewport(t){return mr(this.getLayer().viewport2Canvas(Bi(t)))}getViewportByCanvas(t){return mr(this.getLayer().canvas2Viewport(Bi(t)))}getViewportByClient(t){return mr(this.getLayer().client2Viewport(Bi(t)))}getClientByViewport(t){return mr(this.getLayer().viewport2Client(Bi(t)))}getClientByCanvas(t){return this.getClientByViewport(this.getViewportByCanvas(t))}getCanvasByClient(t){const e=this.getLayer(),r=e.client2Viewport(Bi(t));return mr(e.viewport2Canvas(r))}toDataURL(){return CE(this,arguments,void 0,function*(t={}){const e=globalThis.devicePixelRatio||1,{mode:r="viewport"}=t,i=NE(t,["mode"]);let[a,s,o,l]=[0,0,0,0];if(r==="viewport")[o,l]=this.getSize();else if(r==="overall"){const y=this.getBounds(),b=Ia(y);[a,s]=y.min,[o,l]=b}const c=D0('<div id="virtual-image"></div>'),u=new gf({width:o,height:l,renderer:new Sl,devicePixelRatio:e,container:c,background:this.extends.config.background});yield u.ready,u.appendChild(this.getLayer("background").getRoot().cloneNode(!0)),u.appendChild(this.getRoot().cloneNode(!0));const h=this.getLayer("label").getRoot().cloneNode(!0),d=u.viewport2Canvas({x:0,y:0}),f=this.getCanvasByViewport([0,0]);h.translate([f[0]-d.x,f[1]-d.y]),h.scale(1/this.getCamera().getZoom()),u.appendChild(h),u.appendChild(this.getLayer("transient").getRoot().cloneNode(!0));const v=this.getCamera(),g=u.getCamera();if(r==="viewport")g.setZoom(v.getZoom()),g.setPosition(v.getPosition()),g.setFocalPoint(v.getFocalPoint());else if(r==="overall"){const[y,b,E]=g.getPosition(),[O,P,L]=g.getFocalPoint();g.setPosition([y+a,b+s,E]),g.setFocalPoint([O+a,P+s,L])}const p=u.getContextService();return new Promise(y=>{u.addEventListener(ri.RERENDER,()=>CE(this,void 0,void 0,function*(){yield new Promise(E=>setTimeout(E,300));const b=yield p.toDataURL(i);y(b)}))})})}destroy(){Object.values(this.getLayers()).forEach(t=>{t.getCamera().cancelLandmarkAnimation(),t.destroy()})}}function LE(n,t){return Object.fromEntries(t.map(e=>{const r=(n==null?void 0:n(e))||new Sl;return r instanceof Sl&&r.setConfig({enableDirtyRectangleRendering:!1}),e==="main"?r.registerPlugin(new z4({isDocumentDraggable:!0,isDocumentDroppable:!0,dragstartDistanceThreshold:10,dragstartTimeThreshold:100})):r.unregisterPlugin(r.getPlugin("dom-interaction")),[e,r]}))}function _E(n){Object.entries(n).forEach(([t,e])=>{const r=e.getContextService().getDomElement();r!=null&&r.style&&(r.style.gridArea="1 / 1 / 2 / 2",r.style.outline="none",r.tabIndex=1,t!=="main"&&(r.style.pointerEvents="none")),r!=null&&r.parentElement&&(r.parentElement.style.display="grid",r.parentElement.style.isolation="isolate")})}const ko=n=>n?parseInt(n):0;function Z4(n){const t=getComputedStyle(n),e=n.clientWidth||ko(t.width),r=n.clientHeight||ko(t.height),i=ko(t.paddingLeft)+ko(t.paddingRight),a=ko(t.paddingTop)+ko(t.paddingBottom);return[e-i,r-a]}function DE(n){if(!n)return[0,0];let t=640,e=480;const[r,i]=Z4(n);t=r||t,e=i||e;const a=1,s=1;return[Math.max(ie(t)?t:a,a),Math.max(ie(e)?e:s,s)]}class Qh{constructor(t){this.type=t}}class $n extends Qh{constructor(t,e){super(t),this.data=e}}class Si extends Qh{constructor(t,e,r,i){super(t),this.animationType=e,this.animation=r,this.data=i}}class Po extends Qh{constructor(t,e,r){super(t),this.elementType=e,this.data=r}}class qh extends Qh{constructor(t,e){super(t),this.data=e}}function sr(n,t){n.emit(t.type,t)}function W4(n){if(!n)return null;if(n instanceof nm)return{type:"canvas",element:n};let t=n;for(;t;){if(Al(t))return{type:"node",element:t};if(E1(t))return{type:"edge",element:t};if(vv(t))return{type:"combo",element:t};t=t.parentElement}return null}function IE(n){var t;return((t=n==null?void 0:n.style)===null||t===void 0?void 0:t.zIndex)||0}const Ro="cachedStyle",Jh=n=>`__${n}__`;function G4(n,t){const e=Array.isArray(t)?t:[t];yr(n,Ro)||bl(n,Ro,{}),e.forEach(r=>{bl(yr(n,Ro),Jh(r),n.attributes[r])})}function BE(n,t){return yr(n,[Ro,Jh(t)])}function V4(n,t){return Jh(t)in(yr(n,Ro)||{})}function Nj(n,t,e){set(n,[Ro,Jh(t)],e)}class U4{constructor(t){this.tasks=[],this.animations=new Set,this.context=t}getTasks(){const t=[...this.tasks];return this.tasks=[],t}add(t,e){this.tasks.push([t,e])}animate(t,e,r){var i,a,s;(i=e==null?void 0:e.before)===null||i===void 0||i.call(e);const o=this.getTasks().map(([c,u])=>{var h,d,f;const{element:v,elementType:g,stage:p}=c,y=fO(this.context.options,g,p,t);(h=u==null?void 0:u.before)===null||h===void 0||h.call(u);const b=y.length?gO(v,this.inferStyle(c,r),y):null;return b?((d=u==null?void 0:u.beforeAnimate)===null||d===void 0||d.call(u,b),b.finished.then(()=>{var E,O;(E=u==null?void 0:u.afterAnimate)===null||E===void 0||E.call(u,b),(O=u==null?void 0:u.after)===null||O===void 0||O.call(u),this.animations.delete(b)})):(f=u==null?void 0:u.after)===null||f===void 0||f.call(u),b}).filter(Boolean);o.forEach(c=>this.animations.add(c));const l=Of(o);return l?((a=e==null?void 0:e.beforeAnimate)===null||a===void 0||a.call(e,l),l.finished.then(()=>{var c,u;(c=e==null?void 0:e.afterAnimate)===null||c===void 0||c.call(e,l),(u=e==null?void 0:e.after)===null||u===void 0||u.call(e),this.release()})):(s=e==null?void 0:e.after)===null||s===void 0||s.call(e),l}inferStyle(t,e){var r,i;const{element:a,elementType:s,stage:o,originalStyle:l,updatedStyle:c={}}=t;t.modifiedStyle||(t.modifiedStyle=Object.assign(Object.assign({},l),c));const{modifiedStyle:u}=t,h={},d={};if(o==="enter")Object.assign(h,{opacity:0});else if(o==="exit")Object.assign(d,{opacity:0});else if(o==="show")Object.assign(h,{opacity:0}),Object.assign(d,{opacity:(r=BE(a,"opacity"))!==null&&r!==void 0?r:hl("opacity")});else if(o==="hide")Object.assign(h,{opacity:(i=BE(a,"opacity"))!==null&&i!==void 0?i:hl("opacity")}),Object.assign(d,{opacity:0});else if(o==="collapse"){const{collapse:f}=e||{},{target:v,descendants:g,position:p}=f;if(s==="node"){if(g.includes(a.id)){const[y,b,E]=p;Object.assign(d,{x:y,y:b,z:E})}}else if(s==="combo"){if(a.id===v||g.includes(a.id)){const[y,b]=p;Object.assign(d,{x:y,y:b,childrenNode:l.childrenNode})}}else s==="edge"&&Object.assign(d,{sourceNode:u.sourceNode,targetNode:u.targetNode})}else if(o==="expand"){const{expand:f}=e||{},{target:v,descendants:g,position:p}=f;if(s==="node"){if(a.id===v||g.includes(a.id)){const[y,b,E]=p;Object.assign(h,{x:y,y:b,z:E})}}else if(s==="combo"){if(a.id===v||g.includes(a.id)){const[y,b,E]=p;Object.assign(h,{x:y,y:b,z:E,childrenNode:u.childrenNode})}}else s==="edge"&&Object.assign(h,{sourceNode:u.sourceNode,targetNode:u.targetNode})}return[Object.keys(h).length>0?Object.assign({},l,h):l,Object.keys(d).length>0?Object.assign({},u,d):u]}stop(){this.animations.forEach(t=>t.cancel())}clear(){this.tasks=[]}release(){var t,e;const{canvas:r}=this.context,i=(e=(t=r.document)===null||t===void 0?void 0:t.timeline)===null||e===void 0?void 0:e.animationsWithPromises;i&&(r.document.timeline.animationsWithPromises=i.filter(a=>a.playState!=="finished"))}destroy(){this.stop(),this.animations.clear(),this.tasks=[]}}class Y4{constructor(t){this.batchCount=0,this.context=t}emit(t){const{graph:e}=this.context;e.emit(t.type,t)}startBatch(t=!0){this.batchCount++,this.batchCount===1&&this.emit(new $n(Kt.BATCH_START,{initiate:t}))}endBatch(){this.batchCount--,this.batchCount===0&&this.emit(new $n(Kt.BATCH_END))}get isBatching(){return this.batchCount>0}destroy(){this.context=null}}class H4 extends Wf{constructor(t){super(t),this.currentTarget=null,this.currentTargetType=null,this.category="behavior",this.forwardCanvasEvents=e=>{const{target:r}=e,i=W4(r);if(!i)return;const{graph:a,canvas:s}=this.context,{type:o,element:l}=i;if("destroyed"in l&&(Ol(l)||l.destroyed))return;const{type:c,detail:u,button:h}=e,d=Object.assign(Object.assign({},e),{target:l,targetType:o,originalTarget:r});c===Bt.POINTER_MOVE&&(this.currentTarget!==l&&(this.currentTarget&&a.emit(`${this.currentTargetType}:${Bt.POINTER_LEAVE}`,Object.assign(Object.assign({},d),{type:Bt.POINTER_LEAVE,target:this.currentTarget,targetType:this.currentTargetType})),l&&(Object.assign(d,{type:Bt.POINTER_ENTER}),a.emit(`${o}:${Bt.POINTER_ENTER}`,d))),this.currentTarget=l,this.currentTargetType=o),c===Bt.CLICK&&h===2||(a.emit(`${o}:${c}`,d),a.emit(c,d)),c===Bt.CLICK&&u===2&&(Object.assign(d,{type:Bt.DBLCLICK}),a.emit(`${o}:${Bt.DBLCLICK}`,d),a.emit(Bt.DBLCLICK,d)),c===Bt.POINTER_DOWN&&h===2&&(Object.assign(d,{type:Bt.CONTEXT_MENU,preventDefault:()=>{var f;(f=s.getContainer())===null||f===void 0||f.addEventListener(Bt.CONTEXT_MENU,v=>v.preventDefault(),{once:!0})}}),a.emit(`${o}:${Bt.CONTEXT_MENU}`,d),a.emit(Bt.CONTEXT_MENU,d))},this.forwardContainerEvents=e=>{this.context.graph.emit(e.type,e)},this.forwardEvents(),this.setBehaviors(this.context.options.behaviors||[])}setBehaviors(t){this.setExtensions(t)}forwardEvents(){const t=this.context.canvas.getContainer();t&&[uo.KEY_DOWN,uo.KEY_UP].forEach(r=>{t.addEventListener(r,this.forwardContainerEvents)});const e=this.context.canvas.document;e&&[Bt.CLICK,Bt.DBLCLICK,Bt.POINTER_OVER,Bt.POINTER_LEAVE,Bt.POINTER_ENTER,Bt.POINTER_MOVE,Bt.POINTER_OUT,Bt.POINTER_DOWN,Bt.POINTER_UP,Bt.CONTEXT_MENU,Bt.DRAG_START,Bt.DRAG,Bt.DRAG_END,Bt.DRAG_ENTER,Bt.DRAG_OVER,Bt.DRAG_LEAVE,Bt.DROP,Bt.WHEEL].forEach(r=>{e.addEventListener(r,this.forwardCanvasEvents)})}destroy(){const t=this.context.canvas.getContainer();t&&[uo.KEY_DOWN,uo.KEY_UP].forEach(e=>{t.removeEventListener(e,this.forwardContainerEvents)}),this.context.canvas.document.removeAllEventListeners(),super.destroy()}}function X4(n,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++){var a=n[r];t.has(a)||(e.push(a),t.set(a,!0))}return e}var Ul=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function es(n,t){const{data:e,style:r}=n,i=Ul(n,["data","style"]),{data:a,style:s}=t,o=Ul(t,["data","style"]),l=Object.assign(Object.assign({},i),o);return(e||a)&&Object.assign(l,{data:Object.assign(Object.assign({},e),a)}),(r||s)&&Object.assign(l,{style:Object.assign(Object.assign({},r),s)}),l}function F0(n){const{data:t,style:e}=n,i=Ul(n,["data","style"]);return t&&(i.data=Object.assign({},t)),e&&(i.style=Object.assign({},e)),i}function kj(n){return!get(n,["nodes","length"])&&!get(n,["edges","length"])&&!get(n,["combos","length"])}function Lo(n={},t={}){const{states:e=[],data:r={},style:i={},children:a=[]}=n,s=Ul(n,["states","data","style","children"]),{states:o=[],data:l={},style:c={},children:u=[]}=t,h=Ul(t,["states","data","style","children"]),d=(v,g)=>v.length!==g.length?!1:v.every((p,y)=>p===g[y]),f=(v,g)=>{const p=Object.keys(v),y=Object.keys(g);return p.length!==y.length?!1:p.every(b=>v[b]===g[b])};return!(!f(s,h)||!d(a,u)||!d(e,o)||!f(r,l)||!f(i,c))}var K4=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function z0(n){const{id:t=At(n),style:e,data:r}=n,i=K4(n,["id","style","data"]),a=Object.assign(Object.assign({},n),{style:Object.assign({},e),data:Object.assign({},r)});return SO(n)?Object.assign({id:t,data:a},i):{id:t,data:a}}function dr(n){return n.data}function Q4(n){if(n.hasTreeStructure(ii))return;n.attachTreeStructure(ii);const t=n.getAllEdges();for(const e of t){const{source:r,target:i}=e;n.setParent(i,r,ii)}}class q4{constructor(){this.latestRemovedComboIds=new Set,this.comboIds=new Set,this.changes=[],this.batchCount=0,this.isTraceless=!1,this.enableUpdateNodeLikeHierarchy=!0,this.model=new Vn}pushChange(t){if(this.isTraceless)return;const{type:e}=t;if(e===wn.NodeUpdated||e===wn.EdgeUpdated||e===wn.ComboUpdated){const{value:r,original:i}=t;this.changes.push({value:F0(r),original:F0(i),type:e})}else this.changes.push({value:F0(t.value),type:e})}getChanges(){return this.changes}clearChanges(){this.changes=[]}batch(t){this.batchCount++,this.model.batch(t),this.batchCount--}isBatching(){return this.batchCount>0}silence(t){this.isTraceless=!0,t(),this.isTraceless=!1}isCombo(t){return this.comboIds.has(t)||this.latestRemovedComboIds.has(t)}getData(){return{nodes:this.getNodeData(),edges:this.getEdgeData(),combos:this.getComboData()}}getNodeData(t){return this.model.getAllNodes().reduce((e,r)=>{const i=dr(r);return this.isCombo(At(i))||(t===void 0||t.includes(At(i)))&&e.push(i),e},[])}getEdgeDatum(t){return dr(this.model.getEdge(t))}getEdgeData(t){return this.model.getAllEdges().reduce((e,r)=>{const i=dr(r);return(t===void 0||t.includes(At(i)))&&e.push(i),e},[])}getComboData(t){return this.model.getAllNodes().reduce((e,r)=>{const i=dr(r);return this.isCombo(At(i))&&(t===void 0||t.includes(At(i)))&&e.push(i),e},[])}getRootsData(t=ii){return this.model.getRoots(t).map(dr)}getAncestorsData(t,e){const{model:r}=this;return!r.hasNode(t)||!r.hasTreeStructure(e)?[]:r.getAncestors(t,e).map(dr)}getDescendantsData(t){const e=this.getElementDataById(t),r=[];return _s(e,i=>{i!==e&&r.push(i)},i=>this.getChildrenData(At(i)),"TB"),r}getParentData(t,e){const{model:r}=this;if(!e){Xr.warn("The hierarchy structure key is not specified");return}if(!r.hasNode(t)||!r.hasTreeStructure(e))return;const i=r.getParent(t,e);return i?dr(i):void 0}getChildrenData(t){const e=this.getElementType(t)==="node"?ii:dn,{model:r}=this;return!r.hasNode(t)||!r.hasTreeStructure(e)?[]:r.getChildren(t,e).map(dr)}getElementsDataByType(t){return t==="node"?this.getNodeData():t==="edge"?this.getEdgeData():t==="combo"?this.getComboData():[]}getElementDataById(t){return this.getElementType(t)==="edge"?this.getEdgeDatum(t):this.getNodeLikeDatum(t)}getNodeLikeDatum(t){const e=this.model.getNode(t);return dr(e)}getNodeLikeData(t){return this.model.getAllNodes().reduce((e,r)=>{const i=dr(r);return t?t.includes(At(i))&&e.push(i):e.push(i),e},[])}getElementDataByState(t,e){return this.getElementsDataByType(t).filter(i=>{var a;return(a=i.states)===null||a===void 0?void 0:a.includes(e)})}getElementState(t){var e;return((e=this.getElementDataById(t))===null||e===void 0?void 0:e.states)||[]}hasNode(t){return this.model.hasNode(t)&&!this.isCombo(t)}hasEdge(t){return this.model.hasEdge(t)}hasCombo(t){return this.model.hasNode(t)&&this.isCombo(t)}getRelatedEdgesData(t,e="both"){return this.model.getRelatedEdges(t,e).map(dr)}getNeighborNodesData(t){return this.model.getNeighbors(t).map(dr)}setData(t){const{nodes:e=[],edges:r=[],combos:i=[]}=t,{nodes:a,edges:s,combos:o}=this.getData(),l=za(a,e,h=>At(h),Lo),c=za(s,r,h=>At(h),Lo),u=za(o,i,h=>At(h),Lo);this.batch(()=>{const h={nodes:l.enter,edges:c.enter,combos:u.enter};this.addData(h),this.computeZIndex(h,"add",!0);const d={nodes:l.update,edges:c.update,combos:u.update};this.updateData(d),this.computeZIndex(d,"update",!0);const f={nodes:l.exit.map(At),edges:c.exit.map(At),combos:u.exit.map(At)};this.removeData(f)})}addData(t){const{nodes:e,edges:r,combos:i}=t;this.batch(()=>{this.addComboData(i),this.addNodeData(e),this.addEdgeData(r)}),this.computeZIndex(t,"add")}addNodeData(t=[]){t.length&&(this.model.addNodes(t.map(e=>(this.pushChange({value:e,type:wn.NodeAdded}),z0(e)))),this.updateNodeLikeHierarchy(t),this.computeZIndex({nodes:t},"add"))}addEdgeData(t=[]){t.length&&(this.model.addEdges(t.map(e=>(this.pushChange({value:e,type:wn.EdgeAdded}),z0(e)))),this.computeZIndex({edges:t},"add"))}addComboData(t=[]){if(!t.length)return;const{model:e}=this;e.hasTreeStructure(dn)||e.attachTreeStructure(dn),e.addNodes(t.map(r=>(this.comboIds.add(At(r)),this.pushChange({value:r,type:wn.ComboAdded}),z0(r)))),this.updateNodeLikeHierarchy(t),this.computeZIndex({combos:t},"add")}addChildrenData(t,e){const r=this.getNodeLikeDatum(t),i=e.map(At);this.addNodeData(e),this.updateNodeData([{id:t,children:[...r.children||[],...i]}]),this.addEdgeData(i.map(a=>({source:t,target:a})))}computeZIndex(t,e,r=!1){!r&&this.isBatching()||this.batch(()=>{const{nodes:i=[],edges:a=[],combos:s=[]}=t;s.forEach(o=>{var l,c,u;const h=At(o);if(e==="add"&&ie((l=o.style)===null||l===void 0?void 0:l.zIndex)||e==="update"&&!("combo"in o))return;const d=this.getParentData(h,dn),f=d?((u=(c=d.style)===null||c===void 0?void 0:c.zIndex)!==null&&u!==void 0?u:0)+1:0;this.preventUpdateNodeLikeHierarchy(()=>{this.updateComboData([{id:h,style:{zIndex:f}}])})}),i.forEach(o=>{var l,c,u;const h=At(o);if(e==="add"&&ie((l=o.style)===null||l===void 0?void 0:l.zIndex)||e==="update"&&!("combo"in o)&&!("children"in o))return;let d=0;const f=this.getParentData(h,dn);if(f)d=(((c=f.style)===null||c===void 0?void 0:c.zIndex)||0)+1;else{const v=this.getParentData(h,ii);v&&(d=((u=v==null?void 0:v.style)===null||u===void 0?void 0:u.zIndex)||0)}this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:h,style:{zIndex:d}}])})}),a.forEach(o=>{var l,c,u,h,d;if(ie((l=o.style)===null||l===void 0?void 0:l.zIndex))return;let{id:f,source:v,target:g}=o;if(!f)f=At(o);else{const b=this.getEdgeDatum(f);v=b.source,g=b.target}if(!v||!g)return;const p=((u=(c=this.getNodeLikeDatum(v))===null||c===void 0?void 0:c.style)===null||u===void 0?void 0:u.zIndex)||0,y=((d=(h=this.getNodeLikeDatum(g))===null||h===void 0?void 0:h.style)===null||d===void 0?void 0:d.zIndex)||0;this.updateEdgeData([{id:At(o),style:{zIndex:Math.max(p,y)-1}}])})})}getFrontZIndex(t){var e;const r=this.getElementType(t),i=this.getElementDataById(t),a=this.getData();if(Object.assign(a,{[`${r}s`]:a[`${r}s`].filter(s=>At(s)!==t)}),r==="combo"&&!Kr(i)){const s=new Set(this.getAncestorsData(t,dn).map(At));a.nodes=a.nodes.filter(o=>!s.has(At(o))),a.combos=a.combos.filter(o=>!s.has(At(o))),a.edges=a.edges.filter(({source:o,target:l})=>!s.has(o)&&!s.has(l))}return Math.max(((e=i.style)===null||e===void 0?void 0:e.zIndex)||0,0,...Object.values(a).flat().map(s=>{var o;return(((o=s==null?void 0:s.style)===null||o===void 0?void 0:o.zIndex)||0)+1}))}updateNodeLikeHierarchy(t){if(!this.enableUpdateNodeLikeHierarchy)return;const{model:e}=this;t.forEach(r=>{const i=At(r),a=lu(r);a!==void 0&&(e.hasTreeStructure(dn)||e.attachTreeStructure(dn),a===null&&this.refreshComboData(i),this.setParent(i,lu(r),dn));const s=r.children||[];if(s.length){e.hasTreeStructure(ii)||e.attachTreeStructure(ii);const o=s.filter(l=>e.hasNode(l));o.forEach(l=>this.setParent(l,i,ii)),o.length!==s.length&&this.updateNodeData([{id:i,children:o}])}})}preventUpdateNodeLikeHierarchy(t){this.enableUpdateNodeLikeHierarchy=!1,t(),this.enableUpdateNodeLikeHierarchy=!0}updateData(t){const{nodes:e,edges:r,combos:i}=t;this.batch(()=>{this.updateNodeData(e),this.updateComboData(i),this.updateEdgeData(r)}),this.computeZIndex(t,"update")}updateNodeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch(()=>{const r=[];t.forEach(i=>{const a=At(i),s=dr(e.getNode(a));if(Lo(s,i))return;const o=es(s,i);this.pushChange({value:o,original:s,type:wn.NodeUpdated}),e.mergeNodeData(a,o),r.push(o)}),this.updateNodeLikeHierarchy(r)}),this.computeZIndex({nodes:t},"update")}refreshData(){const{nodes:t,edges:e,combos:r}=this.getData();t.forEach(i=>{this.pushChange({value:i,original:i,type:wn.NodeUpdated})}),e.forEach(i=>{this.pushChange({value:i,original:i,type:wn.EdgeUpdated})}),r.forEach(i=>{this.pushChange({value:i,original:i,type:wn.ComboUpdated})})}syncNodeLikeDatum(t){const{model:e}=this,r=At(t);if(!e.hasNode(r))return;const i=dr(e.getNode(r)),a=es(i,t);e.mergeNodeData(r,a)}syncEdgeDatum(t){const{model:e}=this,r=At(t);if(!e.hasEdge(r))return;const i=dr(e.getEdge(r)),a=es(i,t);e.mergeEdgeData(r,a)}updateEdgeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch(()=>{t.forEach(r=>{const i=At(r),a=dr(e.getEdge(i));if(Lo(a,r))return;r.source&&a.source!==r.source&&e.updateEdgeSource(i,r.source),r.target&&a.target!==r.target&&e.updateEdgeTarget(i,r.target);const s=es(a,r);this.pushChange({value:s,original:a,type:wn.EdgeUpdated}),e.mergeEdgeData(i,s)})}),this.computeZIndex({edges:t},"update")}updateComboData(t=[]){if(!t.length)return;const{model:e}=this;e.batch(()=>{const r=[];t.forEach(i=>{const a=At(i),s=dr(e.getNode(a));if(Lo(s,i))return;const o=es(s,i);this.pushChange({value:o,original:s,type:wn.ComboUpdated}),e.mergeNodeData(a,o),r.push(o)}),this.updateNodeLikeHierarchy(r)}),this.computeZIndex({combos:t},"update")}setParent(t,e,r,i=!0){if(t===e)return;const a=this.getNodeLikeDatum(t),s=lu(a);if(s!==e&&r===dn){const o={id:t,combo:e};this.isCombo(t)?this.syncNodeLikeDatum(o):this.syncNodeLikeDatum(o)}this.model.setParent(t,e,r),i&&r===dn&&X4([s,e]).forEach(o=>{o!==void 0&&this.refreshComboData(o)})}refreshComboData(t){const e=this.getComboData([t])[0],r=this.getAncestorsData(t,dn);e&&this.pushChange({value:e,original:e,type:wn.ComboUpdated}),r.forEach(i=>{this.pushChange({value:i,original:i,type:wn.ComboUpdated})})}getElementPosition(t){const e=this.getElementDataById(t);return ir(e)}translateNodeLikeBy(t,e){this.isCombo(t)?this.translateComboBy(t,e):this.translateNodeBy(t,e)}translateNodeLikeTo(t,e){this.isCombo(t)?this.translateComboTo(t,e):this.translateNodeTo(t,e)}translateNodeBy(t,e){const r=this.getElementPosition(t),i=Ne(r,[...e,0].slice(0,3));this.translateNodeTo(t,i)}translateNodeTo(t,e){const[r=0,i=0,a=0]=e;this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:t,style:{x:r,y:i,z:a}}])})}translateComboBy(t,e){const[r=0,i=0,a=0]=e;if([r,i,a].some(isNaN)||[r,i,a].every(l=>l===0))return;const s=this.getComboData([t])[0];if(!s)return;const o=new Set;_s(s,l=>{const c=At(l);if(o.has(c))return;o.add(c);const[u,h,d]=ir(l),f=es(l,{style:{x:u+r,y:h+i,z:d+a}});this.pushChange({value:f,original:l,type:this.isCombo(c)?wn.ComboUpdated:wn.NodeUpdated}),this.model.mergeNodeData(c,f)},l=>this.getChildrenData(At(l)),"BT")}translateComboTo(t,e){var r;if(e.some(isNaN))return;const[i=0,a=0,s=0]=e,o=(r=this.getComboData([t]))===null||r===void 0?void 0:r[0];if(!o)return;const[l,c,u]=ir(o),h=i-l,d=a-c,f=s-u;_s(o,v=>{const g=At(v),[p,y,b]=ir(v),E=es(v,{style:{x:p+h,y:y+d,z:b+f}});this.pushChange({value:E,original:v,type:this.isCombo(g)?wn.ComboUpdated:wn.NodeUpdated}),this.model.mergeNodeData(g,E)},v=>this.getChildrenData(At(v)),"BT")}removeData(t){const{nodes:e,edges:r,combos:i}=t;this.batch(()=>{this.removeEdgeData(r),this.removeNodeData(e),this.removeComboData(i),this.latestRemovedComboIds=new Set(i)})}removeNodeData(t=[]){t.length&&this.batch(()=>{t.forEach(e=>{this.removeEdgeData(this.getRelatedEdgesData(e).map(At)),this.pushChange({value:this.getNodeData([e])[0],type:wn.NodeRemoved}),this.removeNodeLikeHierarchy(e)}),this.model.removeNodes(t)})}removeEdgeData(t=[]){t.length&&(t.forEach(e=>this.pushChange({value:this.getEdgeData([e])[0],type:wn.EdgeRemoved})),this.model.removeEdges(t))}removeComboData(t=[]){t.length&&this.batch(()=>{t.forEach(e=>{this.pushChange({value:this.getComboData([e])[0],type:wn.ComboRemoved}),this.removeNodeLikeHierarchy(e),this.comboIds.delete(e)}),this.model.removeNodes(t)})}removeNodeLikeHierarchy(t){if(this.model.hasTreeStructure(dn)){const e=lu(this.getNodeLikeDatum(t));this.setParent(t,void 0,dn,!1),this.model.getChildren(t,dn).forEach(r=>{const i=dr(r),a=At(i);this.setParent(At(i),e,dn,!1);const s=es(i,{id:At(i),combo:e});this.pushChange({value:s,original:i,type:this.isCombo(a)?wn.ComboUpdated:wn.NodeUpdated}),this.model.mergeNodeData(At(i),s)}),me(e)||this.refreshComboData(e)}}getElementType(t){if(this.model.hasNode(t))return this.isCombo(t)?"combo":"node";if(this.model.hasEdge(t))return"edge";throw new Error(ga(`Unknown element type of id: ${t}`))}destroy(){const{model:t}=this,e=t.getAllNodes(),r=t.getAllEdges();t.removeEdges(r.map(i=>i.id)),t.removeNodes(e.map(i=>i.id)),this.context={}}}var Yl=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class J4{constructor(t){this.elementMap={},this.shapeTypeMap={},this.paletteStyle={},this.defaultStyle={},this.stateStyle={},this.visibilityCache=new WeakMap,this.context=t}init(){this.initContainer()}initContainer(){if(!this.container||this.container.destroyed){const{canvas:t}=this.context;this.container=t.appendChild(new rr({className:"elements"}))}}emit(t,e){e.silence||sr(this.context.graph,t)}forEachElementData(t){Ls.forEach(e=>{const r=this.context.model.getElementsDataByType(e);t(e,r)})}getElementType(t,e){var r;const{options:i,graph:a}=this.context,s=((r=i[t])===null||r===void 0?void 0:r.type)||e.type;return s?typeof s=="string"?s:s.call(a,e):t==="edge"?"line":"circle"}getTheme(t){return Tm(this.context.options)[t]||{}}getThemeStyle(t){return this.getTheme(t).style||{}}getThemeStateStyle(t,e){const{state:r={}}=this.getTheme(t);return Object.assign({},...e.map(i=>r[i]||{}))}computePaletteStyle(){const{options:t}=this.context;this.paletteStyle={},this.forEachElementData((e,r)=>{var i,a;const s=Object.assign({},Fy((i=this.getTheme(e))===null||i===void 0?void 0:i.palette),Fy((a=t[e])===null||a===void 0?void 0:a.palette));s!=null&&s.field&&Object.assign(this.paletteStyle,DN(r,s))})}getPaletteStyle(t,e){const r=this.paletteStyle[e];return r?t==="edge"?{stroke:r}:{fill:r}:{}}computeElementDefaultStyle(t,e){var r;const{options:i}=this.context,a=((r=i[t])===null||r===void 0?void 0:r.style)||{};"transform"in a&&Array.isArray(a.transform)&&(a.transform=[...a.transform]),this.defaultStyle[At(e.datum)]=By(a,e)}computeElementsDefaultStyle(t){const{graph:e}=this.context;this.forEachElementData((r,i)=>{const a=i.length;for(let s=0;s<a;s++){const o=i[s];(t===void 0||t.includes(At(o)))&&this.computeElementDefaultStyle(r,{datum:o,graph:e})}})}getDefaultStyle(t){return this.defaultStyle[t]||{}}getElementState(t){try{const{model:e}=this.context;return e.getElementState(t)}catch(e){return[]}}getElementStateStyle(t,e,r){var i,a;const{options:s}=this.context,o=((a=(i=s[t])===null||i===void 0?void 0:i.state)===null||a===void 0?void 0:a[e])||{};return By(o,r)}computeElementStatesStyle(t,e,r){this.stateStyle[At(r.datum)]=Object.assign({},...e.map(i=>this.getElementStateStyle(t,i,r)))}computeElementsStatesStyle(t){const{graph:e}=this.context;this.forEachElementData((r,i)=>{const a=i.length;for(let s=0;s<a;s++){const o=i[s];if(t===void 0||t.includes(At(o))){const l=this.getElementState(At(o));this.computeElementStatesStyle(r,l,{datum:o,graph:e})}}})}getStateStyle(t){return this.stateStyle[t]||{}}computeStyle(t,e){t&&["translate","zIndex"].includes(t)||(this.computePaletteStyle(),this.computeElementsDefaultStyle(e),this.computeElementsStatesStyle(e))}getElement(t){return this.elementMap[t]}getNodes(){return this.context.model.getNodeData().map(({id:t})=>this.elementMap[t])}getEdges(){return this.context.model.getEdgeData().map(t=>this.elementMap[At(t)])}getCombos(){return this.context.model.getComboData().map(({id:t})=>this.elementMap[t])}getElementComputedStyle(t,e){const r=At(e),i=this.getThemeStyle(t),a=this.getPaletteStyle(t,r),s=e.style||{},o=this.getDefaultStyle(r),l=this.getThemeStateStyle(t,this.getElementState(r)),c=this.getStateStyle(r),u=Object.assign({},i,a,s,o,l,c);if(t==="combo"){const h=this.context.model.getChildrenData(r),f=!!u.collapsed?[]:h.map(At).filter(v=>this.getElement(v));Object.assign(u,{childrenNode:f,childrenData:h})}return u}getDrawData(t){this.init();const e=this.computeChangesAndDrawData(t);if(!e)return null;const{type:r="draw",stage:i=r}=t;return this.markDestroyElement(e.drawData),this.computeStyle(i),{type:r,stage:i,data:e}}draw(t={animation:!0}){const e=this.getDrawData(t);if(!e)return;const{data:{drawData:{add:r,update:i,remove:a}}}=e;return this.destroyElements(a,t),this.createElements(r,t),this.updateElements(i,t),this.setAnimationTask(t,e)}preLayoutDraw(){return Yl(this,arguments,void 0,function*(t={animation:!0}){var e,r;const i=this.getDrawData(t);if(!i)return;const{data:{drawData:a}}=i;yield(r=(e=this.context.layout)===null||e===void 0?void 0:e.preLayout)===null||r===void 0?void 0:r.call(e,a);const{add:s,update:o,remove:l}=a;return this.destroyElements(l,t),this.createElements(s,t),this.updateElements(o,t),this.setAnimationTask(t,i)})}setAnimationTask(t,e){const{animation:r,silence:i}=t,{data:{dataChanges:a,drawData:s},stage:o,type:l}=e;return this.context.animation.animate(r,i?{}:{before:()=>this.emit(new $n(Kt.BEFORE_DRAW,{dataChanges:a,animation:r,stage:o,render:l==="render"}),t),beforeAnimate:c=>this.emit(new Si(Kt.BEFORE_ANIMATE,Hr.DRAW,c,s),t),afterAnimate:c=>this.emit(new Si(Kt.AFTER_ANIMATE,Hr.DRAW,c,s),t),after:()=>this.emit(new $n(Kt.AFTER_DRAW,{dataChanges:a,animation:r,stage:o,render:l==="render",firstRender:this.context.graph.rendered===!1}),t)})}computeChangesAndDrawData(t){const{model:e}=this.context,r=e.getChanges(),i=Xv(r);if(i.length===0)return null;const{NodeAdded:a=[],NodeUpdated:s=[],NodeRemoved:o=[],EdgeAdded:l=[],EdgeUpdated:c=[],EdgeRemoved:u=[],ComboAdded:h=[],ComboUpdated:d=[],ComboRemoved:f=[]}=Xc(i,y=>y.type),v=y=>new Map(y.map(b=>{const E=b.value;return[At(E),E]})),g={add:{nodes:v(a),edges:v(l),combos:v(h)},update:{nodes:v(s),edges:v(c),combos:v(d)},remove:{nodes:v(o),edges:v(u),combos:v(f)}},p=this.transformData(g,t);return e.clearChanges(),{dataChanges:r,drawData:p}}transformData(t,e){const r=this.context.transform.getTransformInstance();return Object.values(r).reduce((i,a)=>a.beforeDraw(i,e),t)}createElement(t,e,r){var i;const a=At(e);if(this.getElement(a))return;const o=this.getElementType(t,e),l=this.getElementComputedStyle(t,e),c=va(t,o);if(!c)return Xr.warn(`The element ${o} of ${t} is not registered.`);this.emit(new Po(Kt.BEFORE_ELEMENT_CREATE,t,e),r);const u=this.container.appendChild(new c({id:a,context:this.context,style:l}));this.shapeTypeMap[a]=o,this.elementMap[a]=u;const{stage:h="enter"}=r;(i=this.context.animation)===null||i===void 0||i.add({element:u,elementType:t,stage:h,originalStyle:Object.assign({},u.attributes),updatedStyle:l},{after:()=>{var d;this.emit(new Po(Kt.AFTER_ELEMENT_CREATE,t,e),r),(d=u.onCreate)===null||d===void 0||d.call(u)}})}createElements(t,e){const{nodes:r,edges:i,combos:a}=t;[["node",r],["combo",a],["edge",i]].forEach(([o,l])=>{l.forEach(c=>this.createElement(o,c,e))})}getUpdateStageStyle(t,e,r){const{stage:i="update"}=r;if(i==="translate")if(t==="node"||t==="combo"){const{style:{x:a=0,y:s=0,z:o=0}={}}=e;return{x:a,y:s,z:o}}else return{};return this.getElementComputedStyle(t,e)}updateElement(t,e,r){var i;const a=At(e),{stage:s="update"}=r,o=this.getElement(a);if(!o)return()=>null;this.emit(new Po(Kt.BEFORE_ELEMENT_UPDATE,t,e),r);const l=this.getElementType(t,e),c=this.getUpdateStageStyle(t,e,r);this.shapeTypeMap[a]!==l&&(o.destroy(),delete this.shapeTypeMap[a],delete this.elementMap[a],this.createElement(t,e,{animation:!1,silence:!0}));const u=s!=="visibility"?s:c.visibility==="hidden"?"hide":"show";u==="hide"&&delete c.visibility,(i=this.context.animation)===null||i===void 0||i.add({element:o,elementType:t,stage:u,originalStyle:Object.assign({},o.attributes),updatedStyle:c},{before:()=>{const h=this.elementMap[a];s!=="collapse"&&yv(h,c),s==="visibility"&&(V4(h,"opacity")||G4(h,"opacity"),this.visibilityCache.set(h,u==="show"?"visible":"hidden"),u==="show"&&Ps(h,"visible"))},after:()=>{var h;const d=this.elementMap[a];s==="collapse"&&yv(d,c),u==="hide"&&Ps(d,this.visibilityCache.get(d)),this.emit(new Po(Kt.AFTER_ELEMENT_UPDATE,t,e),r),(h=d.onUpdate)===null||h===void 0||h.call(d)}})}updateElements(t,e){const{nodes:r,edges:i,combos:a}=t;[["node",r],["combo",a],["edge",i]].forEach(([o,l])=>{l.forEach(c=>this.updateElement(o,c,e))})}markDestroyElement(t){Object.values(t.remove).forEach(e=>{e.forEach(r=>{const i=At(r),a=this.getElement(i);a&&H3(a)})})}destroyElement(t,e,r){var i;const{stage:a="exit"}=r,s=At(e),o=this.elementMap[s];if(!o)return()=>null;this.emit(new Po(Kt.BEFORE_ELEMENT_DESTROY,t,e),r),(i=this.context.animation)===null||i===void 0||i.add({element:o,elementType:t,stage:a,originalStyle:Object.assign({},o.attributes),updatedStyle:{}},{after:()=>{var l;this.clearElement(s),o.destroy(),(l=o.onDestroy)===null||l===void 0||l.call(o),this.emit(new Po(Kt.AFTER_ELEMENT_DESTROY,t,e),r)}})}destroyElements(t,e){const{nodes:r,edges:i,combos:a}=t;[["combo",a],["edge",i],["node",r]].forEach(([o,l])=>{l.forEach(c=>this.destroyElement(o,c,e))})}clearElement(t){delete this.paletteStyle[t],delete this.defaultStyle[t],delete this.stateStyle[t],delete this.elementMap[t],delete this.shapeTypeMap[t]}alignLayoutResultToElement(t,e){var r,i;const a=(r=t.nodes)===null||r===void 0?void 0:r.find(s=>At(s)===e);if(a){const s=ir(this.context.model.getNodeLikeDatum(e)),o=ir(a),l=ln(s,o);(i=t.nodes)===null||i===void 0||i.forEach(c=>{var u,h,d;!((u=c.style)===null||u===void 0)&&u.x&&(c.style.x+=l[0]),!((h=c.style)===null||h===void 0)&&h.y&&(c.style.y+=l[1]),!((d=c.style)===null||d===void 0)&&d.z&&(c.style.z+=l[2]||0)})}}collapseNode(t,e){return Yl(this,void 0,void 0,function*(){var r;const{animation:i}=e,{model:a}=this.context,s=this.computeChangesAndDrawData({stage:"collapse",animation:i});if(!s)return;const{drawData:o}=s,{add:l,remove:c,update:u}=o;this.markDestroyElement(o);const h={animation:i,stage:"collapse",data:o};this.destroyElements(c,h),this.createElements(l,h),this.updateElements(u,h),yield(r=this.context.animation.animate(i,{beforeAnimate:d=>this.emit(new Si(Kt.BEFORE_ANIMATE,Hr.COLLAPSE,d,o),h),afterAnimate:d=>this.emit(new Si(Kt.AFTER_ANIMATE,Hr.COLLAPSE,d,o),h)},{collapse:{target:t,descendants:Array.from(c.nodes).map(([,d])=>At(d)),position:ir(u.nodes.get(t))}}))===null||r===void 0?void 0:r.finished})}expandNode(t,e){return Yl(this,void 0,void 0,function*(){var r;const{model:i,layout:a}=this.context,{animation:s,align:o}=e,l=ir(i.getNodeData([t])[0]),c=this.computeChangesAndDrawData({stage:"expand",animation:s});if(this.createElements(c.drawData.add,{animation:!1,stage:"expand",target:t}),this.context.animation.clear(),this.computeStyle("expand"),!c)return;const{drawData:u}=c,{update:h,add:d}=u,f={animation:s,stage:"expand",data:u};d.edges.forEach(v=>h.edges.set(At(v),v)),d.nodes.forEach(v=>h.nodes.set(At(v),v)),this.updateElements(h,f),yield(r=this.context.animation.animate(s,{beforeAnimate:v=>this.emit(new Si(Kt.BEFORE_ANIMATE,Hr.EXPAND,v,u),f),afterAnimate:v=>this.emit(new Si(Kt.AFTER_ANIMATE,Hr.EXPAND,v,u),f)},{expand:{target:t,descendants:Array.from(d.nodes).map(([,v])=>At(v)),position:l}}))===null||r===void 0?void 0:r.finished})}collapseCombo(t,e){return Yl(this,void 0,void 0,function*(){var r;const{model:i,element:a}=this.context;if(i.getAncestorsData(t,dn).some(g=>Kr(g)))return;const s=a.getElement(t),o=s.getComboPosition(Object.assign(Object.assign({},s.attributes),{collapsed:!0})),l=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!l)return;const{dataChanges:c,drawData:u}=l;this.markDestroyElement(u);const{update:h,remove:d}=u,f={animation:e,stage:"collapse",data:u};this.destroyElements(d,f),this.updateElements(h,f);const v=g=>Array.from(g).map(([,p])=>At(p));yield(r=this.context.animation.animate(e,{before:()=>this.emit(new $n(Kt.BEFORE_DRAW,{dataChanges:c,animation:e}),f),beforeAnimate:g=>this.emit(new Si(Kt.BEFORE_ANIMATE,Hr.COLLAPSE,g,u),f),afterAnimate:g=>this.emit(new Si(Kt.AFTER_ANIMATE,Hr.COLLAPSE,g,u),f),after:()=>this.emit(new $n(Kt.AFTER_DRAW,{dataChanges:c,animation:e}),f)},{collapse:{target:t,descendants:[...v(d.nodes),...v(d.combos)],position:o}}))===null||r===void 0?void 0:r.finished})}expandCombo(t,e){return Yl(this,void 0,void 0,function*(){var r;const{model:i}=this.context,a=ir(i.getComboData([t])[0]);this.computeStyle("expand");const s=this.computeChangesAndDrawData({stage:"expand",animation:e});if(!s)return;const{dataChanges:o,drawData:l}=s,{add:c,update:u}=l,h={animation:e,stage:"expand",data:l,target:t};this.createElements(c,h),this.updateElements(u,h);const d=f=>Array.from(f).map(([,v])=>At(v));yield(r=this.context.animation.animate(e,{before:()=>this.emit(new $n(Kt.BEFORE_DRAW,{dataChanges:o,animation:e}),h),beforeAnimate:f=>this.emit(new Si(Kt.BEFORE_ANIMATE,Hr.EXPAND,f,l),h),afterAnimate:f=>this.emit(new Si(Kt.AFTER_ANIMATE,Hr.EXPAND,f,l),h),after:()=>this.emit(new $n(Kt.AFTER_DRAW,{dataChanges:o,animation:e}),h)},{expand:{target:t,descendants:[...d(c.nodes),...d(c.combos)],position:a}}))===null||r===void 0?void 0:r.finished})}clear(){this.container.destroy(),this.initContainer(),this.elementMap={},this.shapeTypeMap={},this.defaultStyle={},this.stateStyle={},this.paletteStyle={}}destroy(){this.clear(),this.container.destroy(),this.context={}}}const FE=Symbol("Comlink.proxy"),$4=Symbol("Comlink.endpoint"),zE=Symbol("Comlink.releaseProxy"),j0=Symbol("Comlink.finalizer"),$h=Symbol("Comlink.thrown"),jE=n=>typeof n=="object"&&n!==null||typeof n=="function",tB={canHandle:n=>jE(n)&&n[FE],serialize(n){const{port1:t,port2:e}=new MessageChannel;return WE(n,t),[e,[e]]},deserialize(n){return n.start(),VE(n)}},eB={canHandle:n=>jE(n)&&$h in n,serialize({value:n}){let t;return n instanceof Error?t={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:t={isError:!1,value:n},[t,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},ZE=new Map([["proxy",tB],["throw",eB]]);function nB(n,t){for(const e of n)if(t===e||e==="*"||e instanceof RegExp&&e.test(t))return!0;return!1}function WE(n,t=globalThis,e=["*"]){t.addEventListener("message",function r(i){if(!i||!i.data)return;if(!nB(e,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:s,path:o}=Object.assign({path:[]},i.data),l=(i.data.argumentList||[]).map(Xs);let c;try{const u=o.slice(0,-1).reduce((d,f)=>d[f],n),h=o.reduce((d,f)=>d[f],n);switch(s){case"GET":c=h;break;case"SET":u[o.slice(-1)[0]]=Xs(i.data.value),c=!0;break;case"APPLY":c=h.apply(u,l);break;case"CONSTRUCT":{const d=new h(...l);c=lB(d)}break;case"ENDPOINT":{const{port1:d,port2:f}=new MessageChannel;WE(n,f),c=oB(d,[d])}break;case"RELEASE":c=void 0;break;default:return}}catch(u){c={value:u,[$h]:0}}Promise.resolve(c).catch(u=>({value:u,[$h]:0})).then(u=>{const[h,d]=rd(u);t.postMessage(Object.assign(Object.assign({},h),{id:a}),d),s==="RELEASE"&&(t.removeEventListener("message",r),GE(t),j0 in n&&typeof n[j0]=="function"&&n[j0]())}).catch(u=>{const[h,d]=rd({value:new TypeError("Unserializable return value"),[$h]:0});t.postMessage(Object.assign(Object.assign({},h),{id:a}),d)})}),t.start&&t.start()}function rB(n){return n.constructor.name==="MessagePort"}function GE(n){rB(n)&&n.close()}function VE(n,t){const e=new Map;return n.addEventListener("message",function(i){const{data:a}=i;if(!a||!a.id)return;const s=e.get(a.id);if(s)try{s(a)}finally{e.delete(a.id)}}),Z0(n,e,[],t)}function td(n){if(n)throw new Error("Proxy has been released and is not useable")}function UE(n){return _o(n,new Map,{type:"RELEASE"}).then(()=>{GE(n)})}const ed=new WeakMap,nd="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const t=(ed.get(n)||0)-1;ed.set(n,t),t===0&&UE(n)});function iB(n,t){const e=(ed.get(t)||0)+1;ed.set(t,e),nd&&nd.register(n,t,n)}function aB(n){nd&&nd.unregister(n)}function Z0(n,t,e=[],r=function(){}){let i=!1;const a=new Proxy(r,{get(s,o){if(td(i),o===zE)return()=>{aB(a),UE(n),t.clear(),i=!0};if(o==="then"){if(e.length===0)return{then:()=>a};const l=_o(n,t,{type:"GET",path:e.map(c=>c.toString())}).then(Xs);return l.then.bind(l)}return Z0(n,t,[...e,o])},set(s,o,l){td(i);const[c,u]=rd(l);return _o(n,t,{type:"SET",path:[...e,o].map(h=>h.toString()),value:c},u).then(Xs)},apply(s,o,l){td(i);const c=e[e.length-1];if(c===$4)return _o(n,t,{type:"ENDPOINT"}).then(Xs);if(c==="bind")return Z0(n,t,e.slice(0,-1));const[u,h]=YE(l);return _o(n,t,{type:"APPLY",path:e.map(d=>d.toString()),argumentList:u},h).then(Xs)},construct(s,o){td(i);const[l,c]=YE(o);return _o(n,t,{type:"CONSTRUCT",path:e.map(u=>u.toString()),argumentList:l},c).then(Xs)}});return iB(a,n),a}function sB(n){return Array.prototype.concat.apply([],n)}function YE(n){const t=n.map(rd);return[t.map(e=>e[0]),sB(t.map(e=>e[1]))]}const HE=new WeakMap;function oB(n,t){return HE.set(n,t),n}function lB(n){return Object.assign(n,{[FE]:!0})}function Pj(n,t=globalThis,e="*"){return{postMessage:(r,i)=>n.postMessage(r,e,i),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function rd(n){for(const[t,e]of ZE)if(e.canHandle(n)){const[r,i]=e.serialize(n);return[{type:"HANDLER",name:t,value:r},i]}return[{type:"RAW",value:n},HE.get(n)||[]]}function Xs(n){switch(n.type){case"HANDLER":return ZE.get(n.name).deserialize(n.value);case"RAW":return n.value}}function _o(n,t,e,r){return new Promise(i=>{const a=cB();t.set(a,i),n.start&&n.start(),n.postMessage(Object.assign({id:a},e),r)})}function cB(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class uB extends Uu{constructor(t,e,r){super(),this.graph=t,this.layout=e,this.options=r,this.spawnWorker()}spawnWorker(){this.proxy=VE(new Worker(new URL(S.p+S.u(5030),S.b),{type:void 0})),this.running&&(this.running=!1,this.execute())}execute(){var t;return(0,G.mG)(this,void 0,void 0,function*(){if(this.running)return this;this.running=!0;const e=this.layout.options,{onTick:r}=e,i=(0,G._T)(e,["onTick"]),a={};Object.keys(i).forEach(c=>{fe(i[c])||(a[c]=i[c])});const s={layout:{id:this.layout.id,options:a,iterations:(t=this.options)===null||t===void 0?void 0:t.iterations},nodes:this.graph.getAllNodes(),edges:this.graph.getAllEdges()},o=new Float32Array([0]),[l]=yield this.proxy.calculateLayout(s,[o]);return l})}stop(){return this.running=!1,this.proxy.stopLayout(),this}kill(){this.proxy[zE]()}isRunning(){return this.running}}var Do=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})},hB=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};class dB{get presetOptions(){return{animation:!!Om(this.context.options,!0)}}get options(){const{options:t}=this.context;return t.layout}constructor(t){this.instances=[],this.context=t}getLayoutInstance(){return this.instances}preLayout(t){return Do(this,void 0,void 0,function*(){var e,r,i,a;const{graph:s,model:o}=this.context,{add:l}=t;sr(s,new $n(Kt.BEFORE_LAYOUT,{type:"pre"}));const c=yield(e=this.context.layout)===null||e===void 0?void 0:e.simulate();(r=c==null?void 0:c.nodes)===null||r===void 0||r.forEach(u=>{const h=At(u),d=l.nodes.get(h);o.syncNodeLikeDatum(u),d&&Object.assign(d.style,u.style)}),(i=c==null?void 0:c.edges)===null||i===void 0||i.forEach(u=>{const h=At(u),d=l.edges.get(h);o.syncEdgeDatum(u),d&&Object.assign(d.style,u.style)}),(a=c==null?void 0:c.combos)===null||a===void 0||a.forEach(u=>{const h=At(u),d=l.combos.get(h);o.syncNodeLikeDatum(u),d&&Object.assign(d.style,u.style)}),sr(s,new $n(Kt.AFTER_LAYOUT,{type:"pre"})),this.transformDataAfterLayout("pre",t)})}postLayout(){return Do(this,arguments,void 0,function*(t=this.options){if(!t)return;const e=Array.isArray(t)?t:[t],{graph:r}=this.context;sr(r,new $n(Kt.BEFORE_LAYOUT,{type:"post"}));for(let i=0;i<e.length;i++){const a=e[i],s=this.getLayoutData(a),o=Object.assign(Object.assign({},this.presetOptions),a);sr(r,new $n(Kt.BEFORE_STAGE_LAYOUT,{options:o,index:i}));const l=yield this.stepLayout(s,o,i);sr(r,new $n(Kt.AFTER_STAGE_LAYOUT,{options:o,index:i})),a.animation||this.updateElementPosition(l,!1)}sr(r,new $n(Kt.AFTER_LAYOUT,{type:"post"})),this.transformDataAfterLayout("post")})}transformDataAfterLayout(t,e){const r=this.context.transform.getTransformInstance();Object.values(r).forEach(i=>i.afterLayout(t,e))}simulate(){return Do(this,void 0,void 0,function*(){if(!this.options)return{};const t=Array.isArray(this.options)?this.options:[this.options];let e={};for(let r=0;r<t.length;r++){const i=t[r],a=this.getLayoutData(i);e=yield this.stepLayout(a,Object.assign(Object.assign(Object.assign({},this.presetOptions),i),{animation:!1}),r)}return e})}stepLayout(t,e,r){return Do(this,void 0,void 0,function*(){return rP(e)?yield this.treeLayout(t,e,r):yield this.graphLayout(t,e,r)})}graphLayout(t,e,r){return Do(this,void 0,void 0,function*(){const{animation:i,enableWorker:a,iterations:s=300}=e,o=this.initGraphLayout(e);if(!o)return{};if(this.instances[r]=o,this.instance=o,a){const c=o;return this.supervisor=new uB(c.graphData2LayoutModel(t),c.instance,{iterations:s}),Xu(yield this.supervisor.execute())}if(Iv(o))return i?yield o.execute(t,{onTick:c=>{this.updateElementPosition(c,!1)}}):(o.execute(t),o.stop(),o.tick(s));const l=yield o.execute(t);if(i){const c=this.updateElementPosition(l,i);yield c==null?void 0:c.finished}return l})}treeLayout(t,e,r){return Do(this,void 0,void 0,function*(){const{type:i,animation:a}=e,s=va("layout",i);if(!s)return{};const{nodes:o=[],edges:l=[]}=t,c=new Vn({nodes:o.map(v=>({id:At(v),data:v.data||{}})),edges:l.map(v=>({id:At(v),source:v.source,target:v.target,data:v.data||{}}))});Q4(c);const u={nodes:[],edges:[]},h={nodes:[],edges:[]};c.getRoots(ii).forEach(v=>{_s(v,E=>{E.children=c.getSuccessors(E.id)},E=>c.getSuccessors(E.id),"TB");const g=s(v,e),{x:p,y,z:b=0}=g;_s(g,E=>{const{id:O,x:P,y:L,z:F=0}=E;u.nodes.push({id:O,style:{x:p,y,z:b}}),h.nodes.push({id:O,style:{x:P,y:L,z:F}})},E=>E.children,"TB")});const f=this.inferTreeLayoutOffset(h);if(XE(h,f),a){XE(u,f),this.updateElementPosition(u,!1);const v=this.updateElementPosition(h,a);yield v==null?void 0:v.finished}return h})}inferTreeLayoutOffset(t){var e;let[r,i]=[1/0,-1/0],[a,s]=[1/0,-1/0];(e=t.nodes)===null||e===void 0||e.forEach(g=>{const{x:p=0,y=0}=g.style||{};r=Math.min(r,p),i=Math.max(i,p),a=Math.min(a,y),s=Math.max(s,y)});const{canvas:o}=this.context,l=o.getSize(),[c,u]=o.getCanvasByViewport([0,0]),[h,d]=o.getCanvasByViewport(l);if(r>=c&&i<=h&&a>=u&&s<=d)return[0,0];const f=(c+h)/2,v=(u+d)/2;return[f-(r+i)/2,v-(a+s)/2]}stopLayout(){this.instance&&Iv(this.instance)&&(this.instance.stop(),this.instance=void 0),this.supervisor&&(this.supervisor.stop(),this.supervisor=void 0),this.animationResult&&(this.animationResult.finish(),this.animationResult=void 0)}getLayoutData(t){const{nodeFilter:e=()=>!0,preLayout:r=!1,isLayoutInvisibleNodes:i=!1}=t,{nodes:a,edges:s,combos:o}=this.context.model.getData(),{element:l,model:c}=this.context,u=g=>l.getElement(g),h=r?g=>{var p;return!i&&(((p=g.style)===null||p===void 0?void 0:p.visibility)==="hidden"||c.getAncestorsData(g.id,ii).some(Kr)||c.getAncestorsData(g.id,dn).some(Kr))?!1:e(g)}:g=>{const p=At(g),y=u(p);return!y||Ol(y)?!1:e(g)},d=a.filter(h),f=new Map(d.map(g=>[At(g),g]));o.forEach(g=>f.set(At(g),g));const v=s.filter(({source:g,target:p})=>f.has(g)&&f.has(p));return{nodes:d,edges:v,combos:o}}initGraphLayout(t){var e;const{element:r,viewport:i}=this.context,{type:a,enableWorker:s,animation:o,iterations:l}=t,c=hB(t,["type","enableWorker","animation","iterations"]),[u,h]=i.getCanvasSize(),d=[u/2,h/2],f=(e=t==null?void 0:t.nodeSize)!==null&&e!==void 0?e:b=>{const E=r==null?void 0:r.getElement(b.id);return E?E.attributes.size:r==null?void 0:r.getElementComputedStyle("node",b).size},v=va("layout",a);if(!v)return Xr.warn(`The layout of ${a} is not registered.`);const g=Object.getPrototypeOf(v.prototype)===Hu.prototype?v:aP(v,this.context),p=new g(this.context),y={nodeSize:f,width:u,height:h,center:d};switch(p.id){case"d3-force":case"d3-force-3d":Object.assign(y,{center:{x:u/2,y:h/2,z:0}});break;default:break}return pr(p.options,y,c),p}updateElementPosition(t,e){const{model:r,element:i}=this.context;return i?(r.updateData(t),i.draw({animation:e,silence:!0})):null}destroy(){var t;this.stopLayout(),this.context={},(t=this.supervisor)===null||t===void 0||t.kill(),this.supervisor=void 0,this.instance=void 0,this.instances=[],this.animationResult=void 0}}const XE=(n,t)=>{var e;const[r,i]=t;(e=n.nodes)===null||e===void 0||e.forEach(a=>{if(a.style){const{x:s=0,y:o=0}=a.style;a.style.x=s+r,a.style.y=o+i}else a.style={x:r,y:i}})};function fB(n){return[vB].reduce((e,r)=>r(e),n)}function vB(n){return!n.layout||Array.isArray(n.layout)||"preLayout"in n.layout||["antv-dagre","combo-combined","compact-box","circular","concentric","dagre","fishbone","grid","indented","mds","radial","random","snake","dendrogram","mindmap"].includes(n.layout.type)&&(n.layout.preLayout=!0),n}class gB extends Wf{constructor(t){super(t),this.category="plugin",this.setPlugins(this.context.options.plugins||[])}setPlugins(t){this.setExtensions(t)}getPluginInstance(t){const e=this.extensionMap[t];if(e)return e;Xr.warn(`Cannot find the plugin ${t}, will try to find it by type.`);const r=this.extensions.find(i=>i.type===t);if(r)return this.extensionMap[r.key]}}const id=["update-related-edges","collapse-expand-node","collapse-expand-combo","get-edge-actual-ends","arrange-draw-order"];class pB extends Wf{constructor(t){super(t),this.category="transform",this.setTransforms(this.context.options.transforms||[])}getTransforms(){}setTransforms(t){this.setExtensions([...id.slice(0,id.length-1),...t,id[id.length-1]])}getTransformInstance(t){return t?this.extensionMap[t]:this.extensionMap}}var Hl=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class mB{get padding(){return Ri(this.context.options.padding)}get paddingOffset(){const[t,e,r,i]=this.padding,[a,s,o]=[(i-e)/2,(t-r)/2,0];return[a,s,o]}constructor(t){this.landmarkCounter=0,this.context=t;const[e,r]=this.paddingOffset,{zoom:i,rotation:a,x:s=e,y:o=r}=t.options;this.transform({mode:"absolute",scale:i,translate:[s,o],rotate:a},!1)}get camera(){const{canvas:t}=this.context;return new Proxy(t.getCamera(),{get:(e,r)=>{const a=Object.entries(t.getLayers()).filter(([o])=>!["main"].includes(o)).map(([,o])=>o.getCamera()),s=e[r];if(typeof s=="function")return(...o)=>{const l=s.apply(e,o);return a.forEach(c=>{c[r].apply(c,o)}),l}}})}createLandmark(t){return this.camera.createLandmark(`landmark-${this.landmarkCounter++}`,t)}getAnimation(t){const e=Om(this.context.options,t);return e?Bs(Object.assign({},e),["easing","duration"]):!1}getCanvasSize(){const{canvas:t}=this.context,{width:e=0,height:r=0}=t.getConfig();return[e,r]}getCanvasCenter(){const{canvas:t}=this.context,{width:e=0,height:r=0}=t.getConfig();return[e/2,r/2,0]}getViewportCenter(){const[t,e]=this.camera.getPosition();return[t,e,0]}getGraphCenter(){return this.context.graph.getViewportByCanvas(this.getCanvasCenter())}getZoom(){return this.camera.getZoom()}getRotation(){return this.camera.getRoll()}getTranslateOptions(t){const{camera:e}=this,{mode:r,translate:i=[]}=t,a=this.getZoom(),s=e.getPosition(),o=e.getFocalPoint(),[l,c]=this.getCanvasCenter(),[u=0,h=0,d=0]=i,f=Ii([-u,-h,-d],a);return r==="relative"?{position:Ne(s,f),focalPoint:Ne(o,f)}:{position:Ne([l,c,s[2]],f),focalPoint:Ne([l,c,o[2]],f)}}getRotateOptions(t){const{mode:e,rotate:r=0}=t;return{roll:e==="relative"?this.camera.getRoll()+r:r}}getZoomOptions(t){const{zoomRange:e}=this.context.options,r=this.camera.getZoom(),{mode:i,scale:a=1}=t;return kn(i==="relative"?r*a:a,...e)}transform(t,e){return Hl(this,void 0,void 0,function*(){const{graph:r}=this.context,{translate:i,rotate:a,scale:s,origin:o}=t;this.cancelAnimation();const l=this.getAnimation(e);if(sr(r,new qh(Kt.BEFORE_TRANSFORM,t)),!a&&s&&!i&&o&&!l){this.camera.setZoomByViewportPoint(this.getZoomOptions(t),o),sr(r,new qh(Kt.AFTER_TRANSFORM,t));return}const c={};if(i&&Object.assign(c,this.getTranslateOptions(t)),ie(a)&&Object.assign(c,this.getRotateOptions(t)),ie(s)&&Object.assign(c,{zoom:this.getZoomOptions(t)}),l)return sr(r,new Si(Kt.BEFORE_ANIMATE,Hr.TRANSFORM,null,t)),new Promise(u=>{this.transformResolver=u,this.camera.gotoLandmark(this.createLandmark(c),Object.assign(Object.assign({},l),{onfinish:()=>{sr(r,new Si(Kt.AFTER_ANIMATE,Hr.TRANSFORM,null,t)),sr(r,new qh(Kt.AFTER_TRANSFORM,t)),this.transformResolver=void 0,u()}}))});this.camera.gotoLandmark(this.createLandmark(c),{duration:0}),sr(r,new qh(Kt.AFTER_TRANSFORM,t))})}fitView(t,e){return Hl(this,void 0,void 0,function*(){const[r,i,a,s]=this.padding,{when:o="always",direction:l="both"}=t||{},[c,u]=this.context.canvas.getSize(),h=c-s-i,d=u-r-a,f=this.context.canvas.getBounds(),v=this.getBBoxInViewport(f),[g,p]=Ia(v),y=l==="x"&&g>=h||l==="y"&&p>=d||l==="both"&&g>=h&&p>=d;if(o==="overflow"&&!y)return yield this.fitCenter({animation:e});const b=h/g,E=d/p,O=l==="x"?b:l==="y"?E:Math.min(b,E),P=this.getAnimation(e);yield this.transform({mode:"relative",scale:O,translate:Ne(ln(this.getCanvasCenter(),this.getBBoxInViewport(f).center),Ii(this.paddingOffset,O))},P)})}fitCenter(t){return Hl(this,void 0,void 0,function*(){const e=this.context.canvas.getBounds();yield this.focus(e,t)})}focusElements(t){return Hl(this,arguments,void 0,function*(e,r={}){const{element:i}=this.context;if(!i)return;const a=o=>r.shapes?o.getShape(r.shapes).getRenderBounds():o.getRenderBounds(),s=dl(e.map(o=>a(i.getElement(o))));yield this.focus(s,r)})}focus(t,e){return Hl(this,void 0,void 0,function*(){const r=this.context.graph.getViewportByCanvas(t.center),i=e.position||this.getCanvasCenter(),a=ln(i,r);yield this.transform({mode:"relative",translate:Ne(a,this.paddingOffset)},e.animation)})}getBBoxInViewport(t){const{min:e,max:r}=t,{graph:i}=this.context,[a,s]=i.getViewportByCanvas(e),[o,l]=i.getViewportByCanvas(r),c=new pn;return c.setMinMax([a,s,0],[o,l,0]),c}isInViewport(t,e=!1,r=0){const{graph:i}=this.context,a=this.getCanvasSize(),[s,o]=i.getCanvasByViewport([0,0]),[l,c]=i.getCanvasByViewport(a);let u=new pn;return u.setMinMax([s,o,0],[l,c,0]),r&&(u=Fa(u,r)),fo(t)?Li(t,u):e?TO(t,u):u.intersects(t)}cancelAnimation(){var t,e;!((t=this.camera.landmarks)===null||t===void 0)&&t.length&&this.camera.cancelLandmarkAnimation(),(e=this.transformResolver)===null||e===void 0||e.call(this)}}var mn=function(n,t,e,r){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(n,t||[])).next())})};class ad extends Uu{constructor(t){var e;super(),this.options={},this.rendered=!1,this.destroyed=!1,this.context={model:new q4},this.isCollapsingExpanding=!1,this.onResize=Cl(()=>{this.resize()},300),this._setOptions(Object.assign({},ad.defaultOptions,t),!0),this.context.graph=this,this.options.autoResize&&((e=globalThis.addEventListener)===null||e===void 0||e.call(globalThis,"resize",this.onResize))}getOptions(){return this.options}setOptions(t){this._setOptions(t,!1)}_setOptions(t,e){if(this.updateCanvas(t),Object.assign(this.options,fB(t)),e){const{data:d}=t;d&&this.addData(d);return}const{behaviors:r,combo:i,data:a,edge:s,layout:o,node:l,plugins:c,theme:u,transforms:h}=t;r&&this.setBehaviors(r),a&&this.setData(a),l&&this.setNode(l),s&&this.setEdge(s),i&&this.setCombo(i),o&&this.setLayout(o),u&&this.setTheme(u),c&&this.setPlugins(c),h&&this.setTransforms(h)}getSize(){return this.context.canvas?this.context.canvas.getSize():[this.options.width||0,this.options.height||0]}setSize(t,e){t&&(this.options.width=t),e&&(this.options.height=e),this.resize(t,e)}setZoomRange(t){this.options.zoomRange=t}getZoomRange(){return this.options.zoomRange}setNode(t){this.options.node=t,this.context.model.refreshData()}setEdge(t){this.options.edge=t,this.context.model.refreshData()}setCombo(t){this.options.combo=t,this.context.model.refreshData()}getTheme(){return this.options.theme}setTheme(t){this.options.theme=fe(t)?t(this.getTheme()):t}setLayout(t){this.options.layout=fe(t)?t(this.getLayout()):t}getLayout(){return this.options.layout}setBehaviors(t){var e;this.options.behaviors=fe(t)?t(this.getBehaviors()):t,(e=this.context.behavior)===null||e===void 0||e.setBehaviors(this.options.behaviors)}updateBehavior(t){this.setBehaviors(e=>e.map(r=>typeof r=="object"&&r.key===t.key?Object.assign(Object.assign({},r),t):r))}getBehaviors(){return this.options.behaviors||[]}setPlugins(t){var e;this.options.plugins=fe(t)?t(this.getPlugins()):t,(e=this.context.plugin)===null||e===void 0||e.setPlugins(this.options.plugins)}updatePlugin(t){this.setPlugins(e=>e.map(r=>typeof r=="object"&&r.key===t.key?Object.assign(Object.assign({},r),t):r))}getPlugins(){return this.options.plugins||[]}getPluginInstance(t){return this.context.plugin.getPluginInstance(t)}setTransforms(t){var e;this.options.transforms=fe(t)?t(this.getTransforms()):t,(e=this.context.transform)===null||e===void 0||e.setTransforms(this.options.transforms)}updateTransform(t){this.setTransforms(e=>e.map(r=>typeof r=="object"&&r.key===t.key?Object.assign(Object.assign({},r),t):r)),this.context.model.refreshData()}getTransforms(){return this.options.transforms||[]}getData(){return this.context.model.getData()}getElementData(t){return Array.isArray(t)?t.map(e=>this.context.model.getElementDataById(e)):this.context.model.getElementDataById(t)}getNodeData(t){return t===void 0?this.context.model.getNodeData():Array.isArray(t)?this.context.model.getNodeData(t):this.context.model.getNodeLikeDatum(t)}getEdgeData(t){return t===void 0?this.context.model.getEdgeData():Array.isArray(t)?this.context.model.getEdgeData(t):this.context.model.getEdgeDatum(t)}getComboData(t){return t===void 0?this.context.model.getComboData():Array.isArray(t)?this.context.model.getComboData(t):this.context.model.getNodeLikeDatum(t)}setData(t){this.context.model.setData(fe(t)?t(this.getData()):t)}addData(t){this.context.model.addData(fe(t)?t(this.getData()):t)}addNodeData(t){this.context.model.addNodeData(fe(t)?t(this.getNodeData()):t)}addEdgeData(t){this.context.model.addEdgeData(fe(t)?t(this.getEdgeData()):t)}addComboData(t){this.context.model.addComboData(fe(t)?t(this.getComboData()):t)}addChildrenData(t,e){this.context.model.addChildrenData(t,e)}updateData(t){this.context.model.updateData(fe(t)?t(this.getData()):t)}updateNodeData(t){this.context.model.updateNodeData(fe(t)?t(this.getNodeData()):t)}updateEdgeData(t){this.context.model.updateEdgeData(fe(t)?t(this.getEdgeData()):t)}updateComboData(t){this.context.model.updateComboData(fe(t)?t(this.getComboData()):t)}removeData(t){this.context.model.removeData(fe(t)?t(this.getData()):t)}removeNodeData(t){this.context.model.removeNodeData(fe(t)?t(this.getNodeData()):t)}removeEdgeData(t){this.context.model.removeEdgeData(fe(t)?t(this.getEdgeData()):t)}removeComboData(t){this.context.model.removeComboData(fe(t)?t(this.getComboData()):t)}getElementType(t){return this.context.model.getElementType(t)}getRelatedEdgesData(t,e="both"){return this.context.model.getRelatedEdgesData(t,e)}getNeighborNodesData(t){return this.context.model.getNeighborNodesData(t)}getAncestorsData(t,e){return this.context.model.getAncestorsData(t,e)}getParentData(t,e){return this.context.model.getParentData(t,e)}getChildrenData(t){return this.context.model.getChildrenData(t)}getDescendantsData(t){return this.context.model.getDescendantsData(t)}getElementDataByState(t,e){return this.context.model.getElementDataByState(t,e)}initCanvas(){return mn(this,void 0,void 0,function*(){var t;if(this.context.canvas)return yield this.context.canvas.ready;const{container:e="container",width:r,height:i,renderer:a,cursor:s,background:o,canvas:l,devicePixelRatio:c=(t=globalThis.devicePixelRatio)!==null&&t!==void 0?t:1}=this.options;if(e instanceof RE)this.context.canvas=e,s&&e.setCursor(s),a&&e.setRenderer(a),yield e.ready;else{const u=Ge(e)?document.getElementById(e):e,h=DE(u);this.emit(Kt.BEFORE_CANVAS_INIT,{container:u,width:r,height:i});const d=Object.assign(Object.assign({},l),{container:u,width:r||h[0],height:i||h[1],background:o,renderer:a,cursor:s,devicePixelRatio:c}),f=new RE(d);this.context.canvas=f,yield f.ready,this.emit(Kt.AFTER_CANVAS_INIT,{canvas:f})}})}updateCanvas(t){var e,r;const{renderer:i,cursor:a,height:s,width:o}=t,l=this.context.canvas;l&&(i&&(this.emit(Kt.BEFORE_RENDERER_CHANGE,{renderer:this.options.renderer}),l.setRenderer(i),this.emit(Kt.AFTER_RENDERER_CHANGE,{renderer:i})),a&&l.setCursor(a),(ie(o)||ie(s))&&this.setSize((e=o!=null?o:this.options.width)!==null&&e!==void 0?e:0,(r=s!=null?s:this.options.height)!==null&&r!==void 0?r:0))}initRuntime(){this.context.options=this.options,this.context.batch||(this.context.batch=new Y4(this.context)),this.context.plugin||(this.context.plugin=new gB(this.context)),this.context.viewport||(this.context.viewport=new mB(this.context)),this.context.transform||(this.context.transform=new pB(this.context)),this.context.element||(this.context.element=new J4(this.context)),this.context.animation||(this.context.animation=new U4(this.context)),this.context.layout||(this.context.layout=new dB(this.context)),this.context.behavior||(this.context.behavior=new H4(this.context))}prepare(){return mn(this,void 0,void 0,function*(){if(yield Promise.resolve(),this.destroyed){console.error(ga("The graph instance has been destroyed"));return}yield this.initCanvas(),this.initRuntime()})}render(){return mn(this,void 0,void 0,function*(){if(yield this.prepare(),sr(this,new $n(Kt.BEFORE_RENDER)),this.options.layout)if(!this.rendered&&iP(this.options.layout)){const t=yield this.context.element.preLayoutDraw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.autoFit()])}else{const t=this.context.element.draw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.context.layout.postLayout()]),yield this.autoFit()}else{const t=this.context.element.draw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.autoFit()])}this.rendered=!0,sr(this,new $n(Kt.AFTER_RENDER))})}draw(){return mn(this,void 0,void 0,function*(){var t;yield this.prepare(),yield(t=this.context.element.draw())===null||t===void 0?void 0:t.finished})}layout(t){return mn(this,void 0,void 0,function*(){yield this.context.layout.postLayout(t)})}stopLayout(){this.context.layout.stopLayout()}clear(){return mn(this,void 0,void 0,function*(){const{model:t,element:e}=this.context;t.setData({}),t.clearChanges(),e==null||e.clear()})}destroy(){var t;sr(this,new $n(Kt.BEFORE_DESTROY));const{layout:e,animation:r,element:i,model:a,canvas:s,behavior:o,plugin:l}=this.context;l==null||l.destroy(),o==null||o.destroy(),e==null||e.destroy(),r==null||r.destroy(),i==null||i.destroy(),a.destroy(),s==null||s.destroy(),this.options={},this.context={},this.off(),(t=globalThis.removeEventListener)===null||t===void 0||t.call(globalThis,"resize",this.onResize),this.destroyed=!0,sr(this,new $n(Kt.AFTER_DESTROY))}getCanvas(){return this.context.canvas}resize(t,e){var r;const i=DE((r=this.context.canvas)===null||r===void 0?void 0:r.getContainer()),a=[t||i[0],e||i[1]];if(!this.context.canvas)return;const s=this.context.canvas.getSize();Zn(a,s)||(sr(this,new $n(Kt.BEFORE_SIZE_CHANGE,{size:a})),this.context.canvas.resize(...a),sr(this,new $n(Kt.AFTER_SIZE_CHANGE,{size:a})))}fitView(t,e){return mn(this,void 0,void 0,function*(){var r;yield(r=this.context.viewport)===null||r===void 0?void 0:r.fitView(t,e)})}fitCenter(t){return mn(this,void 0,void 0,function*(){var e;yield(e=this.context.viewport)===null||e===void 0?void 0:e.fitCenter({animation:t})})}autoFit(){return mn(this,void 0,void 0,function*(){const{autoFit:t}=this.context.options;if(t)if(Ge(t))t==="view"?yield this.fitView():t==="center"&&(yield this.fitCenter());else{const{type:e,animation:r}=t;e==="view"?yield this.fitView(t.options,r):e==="center"&&(yield this.fitCenter(r))}})}focusElement(t,e){return mn(this,void 0,void 0,function*(){var r;yield(r=this.context.viewport)===null||r===void 0?void 0:r.focusElements(Array.isArray(t)?t:[t],{animation:e})})}zoomBy(t,e,r){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",scale:t,origin:r},e)})}zoomTo(t,e,r){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",scale:t,origin:r},e)})}getZoom(){return this.context.viewport.getZoom()}rotateBy(t,e,r){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",rotate:t,origin:r},e)})}rotateTo(t,e,r){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",rotate:t,origin:r},e)})}getRotation(){return this.context.viewport.getRotation()}translateBy(t,e){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",translate:t},e)})}translateTo(t,e){return mn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",translate:t},e)})}getPosition(){return ln([0,0],this.getCanvasByViewport([0,0]))}translateElementBy(t,e){return mn(this,arguments,void 0,function*(r,i,a=!0){var s,o;const[l,c]=Fn(r)?[r,(s=i)!==null&&s!==void 0?s:!0]:[{[r]:i},a];Object.entries(l).forEach(([u,h])=>this.context.model.translateNodeLikeBy(u,h)),yield(o=this.context.element.draw({animation:c,stage:"translate"}))===null||o===void 0?void 0:o.finished})}translateElementTo(t,e){return mn(this,arguments,void 0,function*(r,i,a=!0){var s,o;const[l,c]=Fn(r)?[r,(s=i)!==null&&s!==void 0?s:!0]:[{[r]:i},a];Object.entries(l).forEach(([u,h])=>this.context.model.translateNodeLikeTo(u,h)),yield(o=this.context.element.draw({animation:c,stage:"translate"}))===null||o===void 0?void 0:o.finished})}getElementPosition(t){return this.context.model.getElementPosition(t)}getElementRenderStyle(t){return Wv(this.context.element.getElement(t).attributes,["context"])}setElementVisibility(t,e){return mn(this,arguments,void 0,function*(r,i,a=!0){var s,o;const[l,c]=Fn(r)?[r,(s=i)!==null&&s!==void 0?s:!0]:[{[r]:i},a],u={nodes:[],edges:[],combos:[]};Object.entries(l).forEach(([f,v])=>{const g=this.getElementType(f);u[`${g}s`].push({id:f,style:{visibility:v}})});const{model:h,element:d}=this.context;h.preventUpdateNodeLikeHierarchy(()=>{h.updateData(u)}),yield(o=d.draw({animation:c,stage:"visibility"}))===null||o===void 0?void 0:o.finished})}showElement(t,e){return mn(this,void 0,void 0,function*(){const r=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(r.map(i=>[i,"visible"])),e)})}hideElement(t,e){return mn(this,void 0,void 0,function*(){const r=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(r.map(i=>[i,"hidden"])),e)})}getElementVisibility(t){var e,r;const i=this.context.element.getElement(t);return(r=(e=i==null?void 0:i.style)===null||e===void 0?void 0:e.visibility)!==null&&r!==void 0?r:"visible"}setElementZIndex(t,e){return mn(this,void 0,void 0,function*(){var r;const i={nodes:[],edges:[],combos:[]},a=Fn(t)?t:{[t]:e};Object.entries(a).forEach(([l,c])=>{const u=this.getElementType(l);i[`${u}s`].push({id:l,style:{zIndex:c}})});const{model:s,element:o}=this.context;s.preventUpdateNodeLikeHierarchy(()=>s.updateData(i)),yield(r=o.draw({animation:!1,stage:"zIndex"}))===null||r===void 0?void 0:r.finished})}frontElement(t){return mn(this,void 0,void 0,function*(){const e=Array.isArray(t)?t:[t],{model:r}=this.context,i={};e.map(a=>{const s=r.getFrontZIndex(a);if(r.getElementType(a)==="combo"){const l=r.getAncestorsData(a,dn).at(-1)||this.getComboData(a),c=[l,...r.getDescendantsData(At(l))],u=s-IE(l);c.forEach(d=>{i[At(d)]=this.getElementZIndex(At(d))+u});const{internal:h}=fv(c.map(At),d=>r.getRelatedEdgesData(d));h.forEach(d=>{const f=At(d);i[f]=this.getElementZIndex(f)+u})}else i[a]=s}),yield this.setElementZIndex(i)})}getElementZIndex(t){return IE(this.context.model.getElementDataById(t))}setElementState(t,e){return mn(this,arguments,void 0,function*(r,i,a=!0){var s,o;const[l,c]=Fn(r)?[r,(s=i)!==null&&s!==void 0?s:!0]:[{[r]:i},a],u=d=>d?Array.isArray(d)?d:[d]:[],h={nodes:[],edges:[],combos:[]};Object.entries(l).forEach(([d,f])=>{const v=this.getElementType(d);h[`${v}s`].push({id:d,states:u(f)})}),this.updateData(h),yield(o=this.context.element.draw({animation:c,stage:"state"}))===null||o===void 0?void 0:o.finished})}getElementState(t){return this.context.model.getElementState(t)}getElementRenderBounds(t){return this.context.element.getElement(t).getRenderBounds()}collapseElement(t){return mn(this,arguments,void 0,function*(e,r=!0){const{model:i,element:a}=this.context;if(Kr(i.getNodeLikeData([e])[0])||this.isCollapsingExpanding)return;typeof r=="boolean"&&(r={animation:r,align:!0});const s=i.getElementType(e);yield this.frontElement(e),this.isCollapsingExpanding=!0,i.updateData(s==="node"?{nodes:[{id:e,style:{collapsed:!0}}]}:{combos:[{id:e,style:{collapsed:!0}}]}),s==="node"?yield a.collapseNode(e,r):s==="combo"&&(yield a.collapseCombo(e,!!r.animation)),this.isCollapsingExpanding=!1})}expandElement(t){return mn(this,arguments,void 0,function*(e,r=!0){const{model:i,element:a}=this.context;if(!Kr(i.getNodeLikeData([e])[0])||this.isCollapsingExpanding)return;typeof r=="boolean"&&(r={animation:r,align:!0});const s=i.getElementType(e);this.isCollapsingExpanding=!0,i.updateData(s==="node"?{nodes:[{id:e,style:{collapsed:!1}}]}:{combos:[{id:e,style:{collapsed:!1}}]}),s==="node"?yield a.expandNode(e,r):s==="combo"&&(yield a.expandCombo(e,!!r.animation)),this.isCollapsingExpanding=!1})}setElementCollapsibility(t,e){const r=this.getElementType(t);r==="node"?this.updateNodeData([{id:t,style:{collapsed:e}}]):r==="combo"&&this.updateComboData([{id:t,style:{collapsed:e}}])}toDataURL(){return mn(this,arguments,void 0,function*(t={}){return this.context.canvas.toDataURL(t)})}getCanvasByViewport(t){return this.context.canvas.getCanvasByViewport(t)}getViewportByCanvas(t){return this.context.canvas.getViewportByCanvas(t)}getClientByCanvas(t){return this.context.canvas.getClientByCanvas(t)}getCanvasByClient(t){return this.context.canvas.getCanvasByClient(t)}getViewportCenter(){return this.context.viewport.getViewportCenter()}getCanvasCenter(){return this.context.viewport.getCanvasCenter()}on(t,e,r){return super.on(t,e,r)}once(t,e){return super.once(t,e)}off(t,e){return super.off(t,e)}}ad.defaultOptions={autoResize:!1,theme:"light",rotation:0,zoom:1,zoomRange:[.01,10]};var yB=function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(e[r[i]]=n[r[i]]);return e};function bB(n,t){const{getNodeData:e=(o,l)=>{if(o.depth=l,!o.children)return o;const{children:c}=o,u=yB(o,["children"]);return Object.assign(Object.assign({},u),{children:c.map(h=>h.id)})},getEdgeData:r=(o,l)=>({source:o.id,target:l.id}),getChildren:i=o=>o.children||[]}=t||{},a=[],s=[];return _s(n,(o,l)=>{a.push(e(o,l));const c=i(o);for(const u of c)s.push(r(o,u))},o=>i(o),"TB"),{nodes:a,edges:s}}class xB extends ts{beforeDraw(t){const{add:e,update:r}=t,{model:i}=this.context;return[...e.edges.entries(),...r.edges.entries()].forEach(([,a])=>{KE(i,a)}),t}}const KE=(n,t)=>{const{source:e,target:r}=t,i=n.getElementDataById(e),a=n.getElementDataById(r),s=g1(i,h=>n.getParentData(h,dn)),o=g1(a,h=>n.getParentData(h,dn)),l=At(s),c=At(o),u={sourceNode:l,targetNode:c};return t.style?Object.assign(t.style,u):t.style=u,t},EB=(n,t,e)=>{const[r,i]=t,[a,s]=e;if(i===r)return a;const o=(n-r)/(i-r);return a+o*(s-a)},wB=(n,t,e)=>{const[r,i]=t,[a,s]=e,o=Math.log(n-r+1)/Math.log(i-r+1);return a+o*(s-a)},SB=(n,t,e,r=2)=>{const[i,a]=t,[s,o]=e,l=Math.pow((n-i)/(a-i),r);return s+l*(o-s)},MB=(n,t,e)=>{const[r,i]=t,[a,s]=e,o=Math.sqrt((n-r)/(i-r));return a+o*(s-a)};class sd extends ts{constructor(t,e){super(t,pr({},sd.defaultOptions,e)),this.assignSizeByCentrality=(r,i,a,s,o,l)=>{const c=[i,a],u=[s[0],o[0]],h=[s[1],o[1]],d=[s[2],o[2]],f=(v,g)=>{if(typeof l=="function")return l(v,c,g);switch(l){case"linear":return EB(v,c,g);case"log":return wB(v,c,g);case"pow":return SB(v,c,g,2);case"sqrt":return MB(v,c,g);default:return g[0]}};return[f(r,u),f(r,h),f(r,d)]}}beforeDraw(t){const{model:e}=this.context,r=e.getNodeData(),i=si(this.options.maxSize),a=si(this.options.minSize),s=this.getCentralities(this.options.centrality),o=s.size>0?Math.max(...s.values()):0,l=s.size>0?Math.min(...s.values()):0;return r.forEach(c=>{var u;const h=this.assignSizeByCentrality(s.get(At(c))||0,l,o,a,i,this.options.scale),d=(u=this.context.element)===null||u===void 0?void 0:u.getElement(At(c)),f={size:h};this.assignLabelStyle(f,h,c,d),(!d||!Kh(f,d.attributes))&&ci(t,d?"update":"add","node",pr(c,{style:f}),!0)}),t}assignLabelStyle(t,e,r,i){var a;const s=i?i.config.style:(a=this.context.element)===null||a===void 0?void 0:a.getElementComputedStyle("node",r);if(Object.assign(t,Bs(s,["labelFontSize","labelLineHeight"])),this.options.mapLabelSize){const o=this.getLabelSizeByNodeSize(e,1/0,Number(t.labelFontSize));Object.assign(t,{labelFontSize:o,labelLineHeight:o+AO(t.labelPadding)})}return t}getLabelSizeByNodeSize(t,e,r){const i=Math.min(...t)/2,[a,s]=Array.isArray(this.options.mapLabelSize)?this.options.mapLabelSize:[r,e];return Math.min(s,Math.max(i,a))}getCentralities(t){const{model:e}=this.context,r=e.getData();if(typeof t=="function")return t(r);const i=e.getRelatedEdgesData.bind(e);return yy(r,i,t)}}sd.defaultOptions={centrality:{type:"degree"},maxSize:80,minSize:20,scale:"linear",mapLabelSize:!1};class od extends ts{constructor(t,e){super(t,Object.assign({},od.defaultOptions,e))}get ref(){return this.context.model.getRootsData()[0]}afterLayout(){var t;const e=ir(this.ref),{graph:r,model:i}=this.context;(t=i.getData().nodes)===null||t===void 0||t.forEach(s=>{var o;if(At(s)===At(this.ref))return;const l=wy(ln(ir(s),e)),c=Math.abs(l)>Math.PI/2,u=!s.children||s.children.length===0,h=At(s),d=(o=this.context.element)===null||o===void 0?void 0:o.getElement(h);if(!d||!d.isVisible())return;const f=si(r.getElementRenderStyle(h).size)[0]/2,v=(u?1:-1)*(f+this.options.offset),g=[["translate",v*Math.cos(l),v*Math.sin(l)],["rotate",c?Gr(l)+180:Gr(l)]];i.updateNodeData([{id:At(s),style:{labelTextAlign:c===u?"right":"left",labelTextBaseline:"middle",labelTransform:g}}])}),r.draw()}}od.defaultOptions={offset:5};const AB="quadratic",QE=["top","top-right","right","right-bottom","bottom","bottom-left","left","left-top"];class ld extends ts{constructor(t,e){super(t,Object.assign({},ld.defaultOptions,e)),this.cacheMergeStyle=new Map,this.getAffectedParallelEdges=r=>{const{add:{edges:i},update:{nodes:a,edges:s,combos:o},remove:{edges:l}}=r,{model:c}=this.context,u=new Map,h=(v,g)=>{c.getRelatedEdgesData(g).forEach(y=>!u.has(At(y))&&u.set(At(y),y))};a.forEach(h),o.forEach(h);const d=v=>{const g=c.getEdgeData().map(y=>KE(c,y));TB(v,g,!0).forEach(y=>!u.has(At(y))&&u.set(At(y),y))};if(l.size&&l.forEach(d),i.size&&i.forEach(d),s.size){const v=Kb(Xv(c.getChanges())).update.edges;s.forEach(g=>{var p;d(g);const y=(p=v.find(b=>At(b.value)===At(g)))===null||p===void 0?void 0:p.original;y&&!W0(g,y)&&d(y)})}ra(this.options.edges)||u.forEach((v,g)=>!this.options.edges.includes(g)&&u.delete(g));const f=c.getEdgeData().map(At);return new Map([...u].sort((v,g)=>f.indexOf(v[0])-f.indexOf(g[0])))},this.applyBundlingStyle=(r,i,a)=>{const{edgeMap:s,reverses:o}=qE(i);s.forEach(l=>{l.forEach((c,u,h)=>{var d;const f=h.length,v=c.style||{};if(c.source===c.target){const y=QE.length;v.loopPlacement=QE[u%y],v.loopDist=Math.floor(u/y)*a+50}else if(f===1)v.curveOffset=0;else{const y=(u%2===0?1:-1)*(o[`${c.source}|${c.target}|${u}`]?-1:1);v.curveOffset=f%2===1?y*Math.ceil(u/2)*a*2:y*(Math.floor(u/2)*a*2+a)}const g=Object.assign(c,{type:AB,style:v}),p=(d=this.context.element)===null||d===void 0?void 0:d.getElement(At(c));(!p||!Kh(g.style,p.attributes))&&ci(r,p?"update":"add","edge",g,!0)})})},this.resetEdgeStyle=r=>{const i=r.style||{},a=this.cacheMergeStyle.get(At(r))||{};return Object.keys(a).forEach(s=>{Zn(i[s],a[s])&&(r[s]?i[s]=r[s]:delete i[s])}),Object.assign(r,{style:i})},this.applyMergingStyle=(r,i)=>{const{edgeMap:a,reverses:s}=qE(i);a.forEach(o=>{var l;if(o.length===1){const u=o[0],h=(l=this.context.element)===null||l===void 0?void 0:l.getElement(At(u)),d=this.resetEdgeStyle(u);(!h||!Kh(d,h.attributes))&&ci(r,h?"update":"add","edge",d);return}const c=o.map(({source:u,target:h,style:d={}},f)=>{const{startArrow:v,endArrow:g}=d,p={},[y,b]=s[`${u}|${h}|${f}`]?["endArrow","startArrow"]:["startArrow","endArrow"];return Uo(v)&&(p[y]=v),Uo(g)&&(p[b]=g),p}).reduce((u,h)=>Object.assign(Object.assign({},u),h),{});o.forEach((u,h,d)=>{var f;if(h!==0){ci(r,"remove","edge",u);return}const v=Object.assign({},fe(this.options.style)?this.options.style(d):this.options.style,{childrenData:d});this.cacheMergeStyle.set(At(u),v);const g=Object.assign(Object.assign({},u),{type:"line",style:Object.assign(Object.assign(Object.assign({},u.style),c),v)}),p=(f=this.context.element)===null||f===void 0?void 0:f.getElement(At(u));(!p||!Kh(g.style,p.attributes))&&ci(r,p?"update":"add","edge",g,!0)})})}}beforeDraw(t){const e=this.getAffectedParallelEdges(t);return e.size===0||(this.options.mode==="bundle"?this.applyBundlingStyle(t,e,this.options.distance):this.applyMergingStyle(t,e)),t}}ld.defaultOptions={mode:"bundle",distance:15};const qE=n=>{const t=new Map,e=new Set,r={},i=new Map;for(const[a,s]of n){if(e.has(a))continue;const{source:o,target:l}=s,c=`${o}-${l}`;t.has(c)||(t.set(c,[]),i.set(c,new Set));const u=t.get(c),h=i.get(c);u&&h&&!h.has(a)&&(u.push(s),h.add(a),e.add(a));for(const[d,f]of n)if(!(e.has(d)||d===a)&&W0(s,f)){const v=t.get(c),g=i.get(c);v&&g&&!g.has(d)&&(v.push(f),g.add(d),o===f.target&&l===f.source&&(r[`${f.source}|${f.target}|${v.length-1}`]=!0),e.add(d))}}return{edgeMap:t,reverses:r}},TB=(n,t,e)=>t.filter(r=>(e||At(r)!==At(n))&&W0(r,n)),W0=(n,t)=>{const{sourceNode:e,targetNode:r}=n.style||{},{sourceNode:i,targetNode:a}=t.style||{};return e===i&&r===a||e===a&&r===i};class OB extends ts{beforeDraw(t,e){const{stage:r}=e;if(r==="visibility")return t;const{model:i}=this.context,{update:{nodes:a,edges:s,combos:o}}=t,l=(c,u)=>{i.getRelatedEdgesData(u).forEach(d=>!s.has(At(d))&&s.set(At(d),d))};return a.forEach(l),o.forEach(l),t}}const CB={animation:{"combo-collapse":Pm,"combo-expand":xO,"node-collapse":Nm,"node-expand":yO,"path-in":km,"path-out":bO,fade:pO,translate:mO},behavior:{"brush-select":yl,"click-select":gu,"collapse-expand":zu,"create-edge":Gu,"drag-canvas":Vu,"drag-element-force":oP,"drag-element":Nl,"fix-element-size":Ku,"focus-element":Qu,"hover-activate":qu,"lasso-select":cP,"auto-adapt-label":cu,"optimize-viewport-transform":Ju,"scroll-canvas":$u,"zoom-canvas":th},combo:{circle:$k,rect:t3},edge:{cubic:Fs,line:Iu,polyline:Bu,quadratic:Fu,"cubic-horizontal":Lu,"cubic-radial":_u,"cubic-vertical":Du},layout:{"antv-dagre":XR,"combo-combined":mL,"compact-box":eh.compactBox,"d3-force":FL,"force-atlas2":ZL,circular:qR,concentric:Pv,dagre:nh,dendrogram:eh.dendrogram,fishbone:ah,force:yb,fruchterman:VL,grid:YL,indented:eh.indented,mds:Ab,mindmap:eh.mindmap,radial:e_,random:l_,snake:sh},node:{circle:Ds,diamond:tk,ellipse:xu,hexagon:ak,html:Cu,image:Nu,rect:qk,star:Jk,donut:yu,triangle:ku},palette:{spectral:f_,tableau:v_,oranges:g_,greens:p_,blues:m_},theme:{dark:L4,light:_4},plugin:{"bubble-sets":ph,"edge-bundling":yh,"edge-filter-lens":bh,"grid-line":wh,background:oh,contextmenu:mh,fisheye:xh,fullscreen:Eh,history:Sh,hull:Oh,legend:Rh,minimap:Lh,snapline:_h,timebar:Uh,toolbar:Yh,tooltip:Hh,watermark:Xh},transform:{"arrange-draw-order":D4,"collapse-expand-combo":I4,"collapse-expand-node":B4,"get-edge-actual-ends":xB,"map-node-size":sd,"place-radial-labels":od,"process-parallel-edges":ld,"update-related-edges":OB},shape:{circle:Ji,ellipse:al,group:rr,html:co,image:Jf,line:As,path:ni,polygon:Ts,polyline:Oc,rect:gr,text:Os,label:Wa,badge:po}};function NB(){Object.entries(CB).forEach(([n,t])=>{Object.entries(t).forEach(([e,r])=>{F4(n,e,r)})})}NB();const Rj={css:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.css",js:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.js"}},13722:function(U){(function(S,A){U.exports=A()})(typeof self!="undefined"?self:this,function(){return function(Q){var S={};function A(Z){if(S[Z])return S[Z].exports;var B=S[Z]={i:Z,l:!1,exports:{}};return Q[Z].call(B.exports,B,B.exports,A),B.l=!0,B.exports}return A.m=Q,A.c=S,A.d=function(Z,B,N){A.o(Z,B)||Object.defineProperty(Z,B,{configurable:!1,enumerable:!0,get:N})},A.n=function(Z){var B=Z&&Z.__esModule?function(){return Z.default}:function(){return Z};return A.d(B,"a",B),B},A.o=function(Z,B){return Object.prototype.hasOwnProperty.call(Z,B)},A.p="",A(A.s=5)}([function(Q,S){function A(Z,B,N,T){return T===void 0&&(T="height"),N==="center"?(Z[T]+B[T])/2:Z.height}Q.exports={assign:Object.assign,getHeight:A}},function(Q,S,A){var Z=A(3),B=function(){function N(k,_){_===void 0&&(_={});var C=this;C.options=_,C.rootNode=Z(k,_)}var T=N.prototype;return T.execute=function(){throw new Error("please override this method")},N}();Q.exports=B},function(Q,S,A){var Z=A(4),B=["LR","RL","TB","BT","H","V"],N=["LR","RL","H"],T=function(R){return N.indexOf(R)>-1},k=B[0];Q.exports=function(C,R,z){var D=R.direction||k;if(R.isHorizontal=T(D),D&&B.indexOf(D)===-1)throw new TypeError("Invalid direction: "+D);if(D===B[0])z(C,R);else if(D===B[1])z(C,R),C.right2left();else if(D===B[2])z(C,R);else if(D===B[3])z(C,R),C.bottom2top();else if(D===B[4]||D===B[5]){var W=Z(C,R),X=W.left,K=W.right;z(X,R),z(K,R),R.isHorizontal?X.right2left():X.bottom2top(),K.translate(X.x-K.x,X.y-K.y),C.x=X.x,C.y=K.y;var rt=C.getBoundingBox();R.isHorizontal?rt.top<0&&C.translate(0,-rt.top):rt.left<0&&C.translate(-rt.left,0)}var nt=R.fixedRoot;return nt===void 0&&(nt=!0),nt&&C.translate(-(C.x+C.width/2+C.hgap),-(C.y+C.height/2+C.vgap)),_(C,R),C};function _(C,R){if(R.radial){var z=R.isHorizontal?["x","y"]:["y","x"],D=z[0],W=z[1],X={x:1/0,y:1/0},K={x:-1/0,y:-1/0},rt=0;C.DFTraverse(function(it){rt++;var at=it.x,ut=it.y;X.x=Math.min(X.x,at),X.y=Math.min(X.y,ut),K.x=Math.max(K.x,at),K.y=Math.max(K.y,ut)});var nt=K[W]-X[W];if(nt===0)return;var q=Math.PI*2/rt;C.DFTraverse(function(it){var at=(it[W]-X[W])/nt*(Math.PI*2-q)+q,ut=it[D]-C[D];it.x=Math.cos(at)*ut,it.y=Math.sin(at)*ut})}}},function(Q,S,A){var Z=A(0),B=18,N=B*2,T=B,k={getId:function(z){return z.id||z.name},getPreH:function(z){return z.preH||0},getPreV:function(z){return z.preV||0},getHGap:function(z){return z.hgap||T},getVGap:function(z){return z.vgap||T},getChildren:function(z){return z.children},getHeight:function(z){return z.height||N},getWidth:function(z){var D=z.label||" ";return z.width||D.split("").length*B}};function _(R,z){var D=this;if(D.vgap=D.hgap=0,R instanceof _)return R;D.data=R;var W=z.getHGap(R),X=z.getVGap(R);return D.preH=z.getPreH(R),D.preV=z.getPreV(R),D.width=z.getWidth(R),D.height=z.getHeight(R),D.width+=D.preH,D.height+=D.preV,D.id=z.getId(R),D.x=D.y=0,D.depth=0,D.children||(D.children=[]),D.addGap(W,X),D}Z.assign(_.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(z,D){var W=this;W.hgap+=z,W.vgap+=D,W.width+=2*z,W.height+=2*D},eachNode:function(z){for(var D=this,W=[D],X;X=W.shift();)z(X),W=X.children.concat(W)},DFTraverse:function(z){this.eachNode(z)},BFTraverse:function(z){for(var D=this,W=[D],X;X=W.shift();)z(X),W=W.concat(X.children)},getBoundingBox:function(){var z={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(D){z.left=Math.min(z.left,D.x),z.top=Math.min(z.top,D.y),z.width=Math.max(z.width,D.x+D.width),z.height=Math.max(z.height,D.y+D.height)}),z},translate:function(z,D){z===void 0&&(z=0),D===void 0&&(D=0),this.eachNode(function(W){W.x+=z,W.y+=D,W.x+=W.preH,W.y+=W.preV})},right2left:function(){var z=this,D=z.getBoundingBox();z.eachNode(function(W){W.x=W.x-(W.x-D.left)*2-W.width}),z.translate(D.width,0)},bottom2top:function(){var z=this,D=z.getBoundingBox();z.eachNode(function(W){W.y=W.y-(W.y-D.top)*2-W.height}),z.translate(0,D.height)}});function C(R,z,D){z===void 0&&(z={}),z=Z.assign({},k,z);var W=new _(R,z),X=[W],K;if(!D&&!R.collapsed){for(;K=X.shift();)if(!K.data.collapsed){var rt=z.getChildren(K.data),nt=rt?rt.length:0;if(K.children=new Array(nt),rt&&nt)for(var q=0;q<nt;q++){var it=new _(rt[q],z);K.children[q]=it,X.push(it),it.parent=K,it.depth=K.depth+1}}}return W}Q.exports=C},function(Q,S,A){var Z=A(3);Q.exports=function(B,N){for(var T=Z(B.data,N,!0),k=Z(B.data,N,!0),_=B.children.length,C=Math.round(_/2),R=N.getSide||function(X,K){return K<C?"right":"left"},z=0;z<_;z++){var D=B.children[z],W=R(D,z);W==="right"?k.children.push(D):T.children.push(D)}return T.eachNode(function(X){X.isRoot()||(X.side="left")}),k.eachNode(function(X){X.isRoot()||(X.side="right")}),{left:T,right:k}}},function(Q,S,A){var Z={compactBox:A(6),dendrogram:A(8),indented:A(10),mindmap:A(12)};Q.exports=Z},function(Q,S,A){function Z(D,W){D.prototype=Object.create(W.prototype),D.prototype.constructor=D,B(D,W)}function B(D,W){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,K){return X.__proto__=K,X},B(D,W)}var N=A(1),T=A(7),k=A(2),_=A(0),C=function(D){function W(){return D.apply(this,arguments)||this}Z(W,D);var X=W.prototype;return X.execute=function(){var rt=this;return k(rt.rootNode,rt.options,T)},W}(N),R={};function z(D,W){return W=_.assign({},R,W),new C(D,W).execute()}Q.exports=z},function(Q,S){function A(_,C,R,z){z===void 0&&(z=[]);var D=this;D.w=_||0,D.h=C||0,D.y=R||0,D.x=0,D.c=z||[],D.cs=z.length,D.prelim=0,D.mod=0,D.shift=0,D.change=0,D.tl=null,D.tr=null,D.el=null,D.er=null,D.msel=0,D.mser=0}A.fromNode=function(_,C){if(!_)return null;var R=[];return _.children.forEach(function(z){R.push(A.fromNode(z,C))}),C?new A(_.height,_.width,_.x,R):new A(_.width,_.height,_.y,R)};function Z(_,C,R){R?_.y+=C:_.x+=C,_.children.forEach(function(z){Z(z,C,R)})}function B(_,C){var R=C?_.y:_.x;return _.children.forEach(function(z){R=Math.min(B(z,C),R)}),R}function N(_,C){var R=B(_,C);Z(_,-R,C)}function T(_,C,R){R?C.y=_.x:C.x=_.x,_.c.forEach(function(z,D){T(z,C.children[D],R)})}function k(_,C,R){R===void 0&&(R=0),C?(_.x=R,R+=_.width):(_.y=R,R+=_.height),_.children.forEach(function(z){k(z,C,R)})}Q.exports=function(_,C){C===void 0&&(C={});var R=C.isHorizontal;function z(gt){if(gt.cs===0){D(gt);return}z(gt.c[0]);for(var Et=pt(nt(gt.c[0].el),0,null),kt=1;kt<gt.cs;++kt){z(gt.c[kt]);var zt=nt(gt.c[kt].er);W(gt,kt,Et),Et=pt(zt,kt,Et)}at(gt),D(gt)}function D(gt){gt.cs===0?(gt.el=gt,gt.er=gt,gt.msel=gt.mser=0):(gt.el=gt.c[0].el,gt.msel=gt.c[0].msel,gt.er=gt.c[gt.cs-1].er,gt.mser=gt.c[gt.cs-1].mser)}function W(gt,Et,kt){for(var zt=gt.c[Et-1],Ut=zt.mod,Qt=gt.c[Et],Ee=Qt.mod;zt!==null&&Qt!==null;){nt(zt)>kt.low&&(kt=kt.nxt);var Le=Ut+zt.prelim+zt.w-(Ee+Qt.prelim);Le>0&&(Ee+=Le,X(gt,Et,kt.index,Le));var tn=nt(zt),er=nt(Qt);tn<=er&&(zt=rt(zt),zt!==null&&(Ut+=zt.mod)),tn>=er&&(Qt=K(Qt),Qt!==null&&(Ee+=Qt.mod))}!zt&&Qt?q(gt,Et,Qt,Ee):zt&&!Qt&&it(gt,Et,zt,Ut)}function X(gt,Et,kt,zt){gt.c[Et].mod+=zt,gt.c[Et].msel+=zt,gt.c[Et].mser+=zt,ht(gt,Et,kt,zt)}function K(gt){return gt.cs===0?gt.tl:gt.c[0]}function rt(gt){return gt.cs===0?gt.tr:gt.c[gt.cs-1]}function nt(gt){return gt.y+gt.h}function q(gt,Et,kt,zt){var Ut=gt.c[0].el;Ut.tl=kt;var Qt=zt-kt.mod-gt.c[0].msel;Ut.mod+=Qt,Ut.prelim-=Qt,gt.c[0].el=gt.c[Et].el,gt.c[0].msel=gt.c[Et].msel}function it(gt,Et,kt,zt){var Ut=gt.c[Et].er;Ut.tr=kt;var Qt=zt-kt.mod-gt.c[Et].mser;Ut.mod+=Qt,Ut.prelim-=Qt,gt.c[Et].er=gt.c[Et-1].er,gt.c[Et].mser=gt.c[Et-1].mser}function at(gt){gt.prelim=(gt.c[0].prelim+gt.c[0].mod+gt.c[gt.cs-1].mod+gt.c[gt.cs-1].prelim+gt.c[gt.cs-1].w)/2-gt.w/2}function ut(gt,Et){Et+=gt.mod,gt.x=gt.prelim+Et,xt(gt);for(var kt=0;kt<gt.cs;kt++)ut(gt.c[kt],Et)}function ht(gt,Et,kt,zt){if(kt!==Et-1){var Ut=Et-kt;gt.c[kt+1].shift+=zt/Ut,gt.c[Et].shift-=zt/Ut,gt.c[Et].change-=zt-zt/Ut}}function xt(gt){for(var Et=0,kt=0,zt=0;zt<gt.cs;zt++)Et+=gt.c[zt].shift,kt+=Et+gt.c[zt].change,gt.c[zt].mod+=kt}function pt(gt,Et,kt){for(;kt!==null&&gt>=kt.low;)kt=kt.nxt;return{low:gt,index:Et,nxt:kt}}k(_,R);var wt=A.fromNode(_,R);return z(wt),ut(wt,0),T(wt,_,R),N(_,R),_}},function(Q,S,A){function Z(D,W){D.prototype=Object.create(W.prototype),D.prototype.constructor=D,B(D,W)}function B(D,W){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,K){return X.__proto__=K,X},B(D,W)}var N=A(1),T=A(9),k=A(2),_=A(0),C=function(D){function W(){return D.apply(this,arguments)||this}Z(W,D);var X=W.prototype;return X.execute=function(){var rt=this;return rt.rootNode.width=0,k(rt.rootNode,rt.options,T)},W}(N),R={};function z(D,W){return W=_.assign({},R,W),new C(D,W).execute()}Q.exports=z},function(Q,S,A){var Z=A(0);function B(k,_){k===void 0&&(k=0),_===void 0&&(_=[]);var C=this;C.x=C.y=0,C.leftChild=C.rightChild=null,C.height=0,C.children=_}var N={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function T(k,_,C){C?(_.x=k.x,_.y=k.y):(_.x=k.y,_.y=k.x),k.children.forEach(function(R,z){T(R,_.children[z],C)})}Q.exports=function(k,_){_===void 0&&(_={}),_=Z.assign({},N,_);var C=0;function R(K){if(!K)return null;K.width=0,K.depth&&K.depth>C&&(C=K.depth);var rt=K.children,nt=rt.length,q=new B(K.height,[]);return rt.forEach(function(it,at){var ut=R(it);q.children.push(ut),at===0&&(q.leftChild=ut),at===nt-1&&(q.rightChild=ut)}),q.originNode=K,q.isLeaf=K.isLeaf(),q}function z(K){if(K.isLeaf||K.children.length===0)K.drawingDepth=C;else{var rt=K.children.map(function(q){return z(q)}),nt=Math.min.apply(null,rt);K.drawingDepth=nt-1}return K.drawingDepth}var D;function W(K){K.x=K.drawingDepth*_.rankSep,K.isLeaf?(K.y=0,D&&(K.y=D.y+D.height+_.nodeSep,K.originNode.parent!==D.originNode.parent&&(K.y+=_.subTreeSep)),D=K):(K.children.forEach(function(rt){W(rt)}),K.y=(K.leftChild.y+K.rightChild.y)/2)}var X=R(k);return z(X),W(X),T(X,k,_.isHorizontal),k}},function(Q,S,A){function Z(X,K){X.prototype=Object.create(K.prototype),X.prototype.constructor=X,B(X,K)}function B(X,K){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(rt,nt){return rt.__proto__=nt,rt},B(X,K)}var N=A(1),T=A(11),k=A(4),_=A(0),C=["LR","RL","H"],R=C[0],z=function(X){function K(){return X.apply(this,arguments)||this}Z(K,X);var rt=K.prototype;return rt.execute=function(){var q=this,it=q.options,at=q.rootNode;it.isHorizontal=!0;var ut=it.indent,ht=ut===void 0?20:ut,xt=it.dropCap,pt=xt===void 0?!0:xt,wt=it.direction,gt=wt===void 0?R:wt,Et=it.align;if(gt&&C.indexOf(gt)===-1)throw new TypeError("Invalid direction: "+gt);if(gt===C[0])T(at,ht,pt,Et);else if(gt===C[1])T(at,ht,pt,Et),at.right2left();else if(gt===C[2]){var kt=k(at,it),zt=kt.left,Ut=kt.right;T(zt,ht,pt,Et),zt.right2left(),T(Ut,ht,pt,Et);var Qt=zt.getBoundingBox();Ut.translate(Qt.width,0),at.x=Ut.x-at.width/2}return at},K}(N),D={};function W(X,K){return K=_.assign({},D,K),new z(X,K).execute()}Q.exports=W},function(Q,S,A){var Z=A(0);function B(N,T,k,_,C){var R=(typeof k=="function"?k(N):k)*N.depth;if(!_)try{if(N.id===N.parent.children[0].id){N.x+=R,N.y=T?T.y:0;return}}catch(W){}if(N.x+=R,T){if(N.y=T.y+Z.getHeight(T,N,C),T.parent&&N.parent.id!==T.parent.id){var z=T.parent,D=z.y+Z.getHeight(z,N,C);N.y=D>N.y?D:N.y}}else N.y=0}Q.exports=function(N,T,k,_){var C=null;N.eachNode(function(R){B(R,C,T,k,_),C=R})}},function(Q,S,A){function Z(D,W){D.prototype=Object.create(W.prototype),D.prototype.constructor=D,B(D,W)}function B(D,W){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,K){return X.__proto__=K,X},B(D,W)}var N=A(1),T=A(13),k=A(2),_=A(0),C=function(D){function W(){return D.apply(this,arguments)||this}Z(W,D);var X=W.prototype;return X.execute=function(){var rt=this;return k(rt.rootNode,rt.options,T)},W}(N),R={};function z(D,W){return W=_.assign({},R,W),new C(D,W).execute()}Q.exports=z},function(Q,S,A){var Z=A(0);function B(k,_){var C=0;return k.children.length?k.children.forEach(function(R){C+=B(R,_)}):C=k.height,k._subTreeSep=_.getSubTreeSep(k.data),k.totalHeight=Math.max(k.height,C)+2*k._subTreeSep,k.totalHeight}function N(k){var _=k.children,C=_.length;if(C){_.forEach(function(K){N(K)});var R=_[0],z=_[C-1],D=z.y-R.y+z.height,W=0;if(_.forEach(function(K){W+=K.totalHeight}),D>k.height)k.y=R.y+D/2-k.height/2;else if(_.length!==1||k.height>W){var X=k.y+(k.height-D)/2-R.y;_.forEach(function(K){K.translate(0,X)})}else k.y=(R.y+R.height/2+z.y+z.height/2)/2-k.height/2}}var T={getSubTreeSep:function(){return 0}};Q.exports=function(k,_){_===void 0&&(_={}),_=Z.assign({},T,_),k.parent={x:0,width:0,height:0,y:0},k.BFTraverse(function(C){C.x=C.parent.x+C.parent.width}),k.parent=null,B(k,_),k.startY=0,k.y=k.totalHeight/2-k.height/2,k.eachNode(function(C){var R=C.children,z=R.length;if(z){var D=R[0];if(D.startY=C.startY+C._subTreeSep,z===1)D.y=C.y+C.height/2-D.height/2;else{D.y=D.startY+D.totalHeight/2-D.height/2;for(var W=1;W<z;W++){var X=R[W];X.startY=R[W-1].startY+R[W-1].totalHeight,X.y=X.startY+X.totalHeight/2-X.height/2}}}}),N(k)}}])})},32168:function(U,Q,S){"use strict";var A=S(59301),Z=S(42441),B=S(48961),N=S.n(B),T=Object.defineProperty,k=Object.defineProperties,_=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,D=(q,it,at)=>it in q?T(q,it,{enumerable:!0,configurable:!0,writable:!0,value:at}):q[it]=at,W=(q,it)=>{for(var at in it||(it={}))R.call(it,at)&&D(q,at,it[at]);if(C)for(var at of C(it))z.call(it,at)&&D(q,at,it[at]);return q},X=(q,it)=>k(q,_(it));function K(q,it,at=1/3,ut){let ht=q*Math.PI*2,xt=it*Math.PI*2;return{u:{min:-Math.PI,max:Math.PI*3,step:Math.PI/32},v:{min:0,max:Math.PI*2,step:Math.PI/20},x:function(pt,wt){return pt<ht?Math.cos(ht)*(1+Math.cos(wt)*at):pt>xt?Math.cos(xt)*(1+Math.cos(wt)*at):Math.cos(pt)*(1+Math.cos(wt)*at)},y:function(pt,wt){return pt<ht?Math.sin(ht)*(1+Math.cos(wt)*at):pt>xt?Math.sin(xt)*(1+Math.cos(wt)*at):Math.sin(pt)*(1+Math.cos(wt)*at)},z:function(pt,wt){return pt<-Math.PI*.5?Math.sin(pt):pt>Math.PI*2.5?Math.sin(pt)*ut*.1:Math.sin(wt)>0?1*ut*.1:-1}}}function rt({pieData:q=[],internalDiameterRatio:it=1/3}){var at,ut,ht,xt;const pt=[],wt=q==null?void 0:q.reduce((Ut,Qt)=>(Ut||0)+((Qt==null?void 0:Qt.value)||0),0);let gt=0,Et=0;const kt=[];for(let Ut=0;Ut<(q==null?void 0:q.length);Ut++){Et=gt+(wt==0?1:((at=q==null?void 0:q[Ut])==null?void 0:at.value)||0);const Qt={itemStyle:((ut=q==null?void 0:q[Ut])==null?void 0:ut.itemStyle)||{},name:((ht=q==null?void 0:q[Ut])==null?void 0:ht.name)||`name${Ut}`,type:"surface",parametric:!0,parametricEquation:K(gt/(wt||(q==null?void 0:q.length)),Et/(wt||(q==null?void 0:q.length)),it,((xt=q==null?void 0:q[Ut])==null?void 0:xt.value)||(wt==0?25:0)),wireframe:{show:!1},pieData:q==null?void 0:q[Ut]};kt.push(Qt.name),pt.push(Qt),gt=Et}return pt.push({name:"pie2d",type:"pie",showEmptyCircle:!0,label:{show:!0,formatter:Ut=>`${Ut.value}
${Ut.name}`},startAngle:-35,radius:["49%","50%"],center:["50%","40%"],data:[...q||[]].reverse(),itemStyle:{opacity:0}}),{legend:{left:"50%",top:"center",textStyle:{fontSize:12},data:kt},xAxis3D:{},yAxis3D:{},zAxis3D:{},grid3D:{viewControl:{alpha:45,rotateSensitivity:0,zoomSensitivity:0,panSensitivity:0,autoRotate:!1},left:"center",top:"-10%",show:!1,boxHeight:25},series:pt}}const nt=({dataSource:q=[{name:"\u638C\u63E1\u738780%~100%",value:0,itemStyle:{color:"rgb(223,209,38)"}},{name:"\u638C\u63D0\u738760%~79%",value:0,itemStyle:{color:"rgb(6,234,230)"}},{name:"\u638C\u63A8\u738759%\u4EE5\u4E0B",value:0,itemStyle:{color:"rgb(6,110,247)"}}],className:it="",style:at={},legend:ut={},internalDiameterRatio:ht=1/3})=>{const[xt,pt]=(0,A.useState)([]),wt=(0,A.useCallback)(kt=>{const zt=kt.selected||{},Ut=q.map(Qt=>Qt.name).filter(Qt=>zt[Qt]===!1);pt(Ut)},[q]),gt=(0,A.useMemo)(()=>q.filter(kt=>!xt.includes(kt.name)),[q,xt]),Et=(0,A.useMemo)(()=>{const kt=rt({pieData:gt,internalDiameterRatio:ht}),zt=q.map(Qt=>Qt.name),Ut=q.reduce((Qt,Ee)=>(Qt[Ee.name]=!xt.includes(Ee.name),Qt),{});return kt.legend=X(W(W({},kt.legend),ut),{data:zt,selected:Ut}),kt},[gt,ut,ht,q,xt]);return A.createElement(Z.Z,{onEvents:{legendselectchanged:wt},className:`w-full h-full ${it}`,option:Et,style:W({height:"100%"},at)})};Q.Z=nt},13377:function(U,Q,S){"use strict";var A,Z=Object.defineProperty,B=H=>{throw TypeError(H)},N=Math.pow,T=(H,x,w)=>x in H?Z(H,x,{enumerable:!0,configurable:!0,writable:!0,value:w}):H[x]=w,k=(H,x,w)=>T(H,typeof x!="symbol"?x+"":x,w),_=(H,x,w)=>x.has(H)||B("Cannot "+w),C=(H,x,w)=>(_(H,x,"read from private field"),w?w.call(H):x.get(H)),R=(H,x,w)=>x.has(H)?B("Cannot add the same private member more than once"):x instanceof WeakSet?x.add(H):x.set(H,w),z=(H,x,w,m)=>(_(H,x,"write to private field"),m?m.call(H,w):x.set(H,w),w),D=(H,x,w)=>(_(H,x,"access private method"),w),W,X,K;A={value:!0};var rt=S(34634),nt=S(34402);const q=" ".repeat(2),it=" ".repeat(4);function at(){return ut(this)}function ut(H,x={}){const{maxRows:w=15,maxColumns:m=10,maxNumSize:M=8,padMinus:j="auto"}=x;return`${H.constructor.name} {
${q}[
${it}${ht(H,w,m,M,j)}
${q}]
${q}rows: ${H.rows}
${q}columns: ${H.columns}
}`}function ht(H,x,w,m,M){const{rows:j,columns:tt}=H,et=Math.min(j,x),st=Math.min(tt,w),lt=[];if(M==="auto"){M=!1;t:for(let Tt=0;Tt<et;Tt++)for(let vt=0;vt<st;vt++)if(H.get(Tt,vt)<0){M=!0;break t}}for(let Tt=0;Tt<et;Tt++){let vt=[];for(let Ft=0;Ft<st;Ft++)vt.push(xt(H.get(Tt,Ft),m,M));lt.push(`${vt.join(" ")}`)}return st!==tt&&(lt[lt.length-1]+=` ... ${tt-w} more columns`),et!==j&&lt.push(`... ${j-x} more rows`),lt.join(`
${it}`)}function xt(H,x,w){return(H>=0&&w?` ${pt(H,x-1)}`:pt(H,x)).padEnd(x)}function pt(H,x){let w=H.toString();if(w.length<=x)return w;let m=H.toFixed(x);if(m.length>x&&(m=H.toFixed(Math.max(0,x-(m.length-x)))),m.length<=x&&!m.startsWith("0.000")&&!m.startsWith("-0.000"))return m;let M=H.toExponential(x);return M.length>x&&(M=H.toExponential(Math.max(0,x-(M.length-x)))),M.slice(0)}function wt(H,x){H.prototype.add=function(m){return typeof m=="number"?this.addS(m):this.addM(m)},H.prototype.addS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)+m);return this},H.prototype.addM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)+m.get(M,j));return this},H.add=function(m,M){return new x(m).add(M)},H.prototype.sub=function(m){return typeof m=="number"?this.subS(m):this.subM(m)},H.prototype.subS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)-m);return this},H.prototype.subM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)-m.get(M,j));return this},H.sub=function(m,M){return new x(m).sub(M)},H.prototype.subtract=H.prototype.sub,H.prototype.subtractS=H.prototype.subS,H.prototype.subtractM=H.prototype.subM,H.subtract=H.sub,H.prototype.mul=function(m){return typeof m=="number"?this.mulS(m):this.mulM(m)},H.prototype.mulS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)*m);return this},H.prototype.mulM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)*m.get(M,j));return this},H.mul=function(m,M){return new x(m).mul(M)},H.prototype.multiply=H.prototype.mul,H.prototype.multiplyS=H.prototype.mulS,H.prototype.multiplyM=H.prototype.mulM,H.multiply=H.mul,H.prototype.div=function(m){return typeof m=="number"?this.divS(m):this.divM(m)},H.prototype.divS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)/m);return this},H.prototype.divM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)/m.get(M,j));return this},H.div=function(m,M){return new x(m).div(M)},H.prototype.divide=H.prototype.div,H.prototype.divideS=H.prototype.divS,H.prototype.divideM=H.prototype.divM,H.divide=H.div,H.prototype.mod=function(m){return typeof m=="number"?this.modS(m):this.modM(m)},H.prototype.modS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)%m);return this},H.prototype.modM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)%m.get(M,j));return this},H.mod=function(m,M){return new x(m).mod(M)},H.prototype.modulus=H.prototype.mod,H.prototype.modulusS=H.prototype.modS,H.prototype.modulusM=H.prototype.modM,H.modulus=H.mod,H.prototype.and=function(m){return typeof m=="number"?this.andS(m):this.andM(m)},H.prototype.andS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)&m);return this},H.prototype.andM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)&m.get(M,j));return this},H.and=function(m,M){return new x(m).and(M)},H.prototype.or=function(m){return typeof m=="number"?this.orS(m):this.orM(m)},H.prototype.orS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)|m);return this},H.prototype.orM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)|m.get(M,j));return this},H.or=function(m,M){return new x(m).or(M)},H.prototype.xor=function(m){return typeof m=="number"?this.xorS(m):this.xorM(m)},H.prototype.xorS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)^m);return this},H.prototype.xorM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)^m.get(M,j));return this},H.xor=function(m,M){return new x(m).xor(M)},H.prototype.leftShift=function(m){return typeof m=="number"?this.leftShiftS(m):this.leftShiftM(m)},H.prototype.leftShiftS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)<<m);return this},H.prototype.leftShiftM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)<<m.get(M,j));return this},H.leftShift=function(m,M){return new x(m).leftShift(M)},H.prototype.signPropagatingRightShift=function(m){return typeof m=="number"?this.signPropagatingRightShiftS(m):this.signPropagatingRightShiftM(m)},H.prototype.signPropagatingRightShiftS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>m);return this},H.prototype.signPropagatingRightShiftM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>m.get(M,j));return this},H.signPropagatingRightShift=function(m,M){return new x(m).signPropagatingRightShift(M)},H.prototype.rightShift=function(m){return typeof m=="number"?this.rightShiftS(m):this.rightShiftM(m)},H.prototype.rightShiftS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>>m);return this},H.prototype.rightShiftM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>>m.get(M,j));return this},H.rightShift=function(m,M){return new x(m).rightShift(M)},H.prototype.zeroFillRightShift=H.prototype.rightShift,H.prototype.zeroFillRightShiftS=H.prototype.rightShiftS,H.prototype.zeroFillRightShiftM=H.prototype.rightShiftM,H.zeroFillRightShift=H.rightShift,H.prototype.not=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,~this.get(m,M));return this},H.not=function(m){return new x(m).not()},H.prototype.abs=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.abs(this.get(m,M)));return this},H.abs=function(m){return new x(m).abs()},H.prototype.acos=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.acos(this.get(m,M)));return this},H.acos=function(m){return new x(m).acos()},H.prototype.acosh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.acosh(this.get(m,M)));return this},H.acosh=function(m){return new x(m).acosh()},H.prototype.asin=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.asin(this.get(m,M)));return this},H.asin=function(m){return new x(m).asin()},H.prototype.asinh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.asinh(this.get(m,M)));return this},H.asinh=function(m){return new x(m).asinh()},H.prototype.atan=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.atan(this.get(m,M)));return this},H.atan=function(m){return new x(m).atan()},H.prototype.atanh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.atanh(this.get(m,M)));return this},H.atanh=function(m){return new x(m).atanh()},H.prototype.cbrt=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.cbrt(this.get(m,M)));return this},H.cbrt=function(m){return new x(m).cbrt()},H.prototype.ceil=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.ceil(this.get(m,M)));return this},H.ceil=function(m){return new x(m).ceil()},H.prototype.clz32=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.clz32(this.get(m,M)));return this},H.clz32=function(m){return new x(m).clz32()},H.prototype.cos=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.cos(this.get(m,M)));return this},H.cos=function(m){return new x(m).cos()},H.prototype.cosh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.cosh(this.get(m,M)));return this},H.cosh=function(m){return new x(m).cosh()},H.prototype.exp=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.exp(this.get(m,M)));return this},H.exp=function(m){return new x(m).exp()},H.prototype.expm1=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.expm1(this.get(m,M)));return this},H.expm1=function(m){return new x(m).expm1()},H.prototype.floor=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.floor(this.get(m,M)));return this},H.floor=function(m){return new x(m).floor()},H.prototype.fround=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.fround(this.get(m,M)));return this},H.fround=function(m){return new x(m).fround()},H.prototype.log=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log(this.get(m,M)));return this},H.log=function(m){return new x(m).log()},H.prototype.log1p=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log1p(this.get(m,M)));return this},H.log1p=function(m){return new x(m).log1p()},H.prototype.log10=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log10(this.get(m,M)));return this},H.log10=function(m){return new x(m).log10()},H.prototype.log2=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log2(this.get(m,M)));return this},H.log2=function(m){return new x(m).log2()},H.prototype.round=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.round(this.get(m,M)));return this},H.round=function(m){return new x(m).round()},H.prototype.sign=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sign(this.get(m,M)));return this},H.sign=function(m){return new x(m).sign()},H.prototype.sin=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sin(this.get(m,M)));return this},H.sin=function(m){return new x(m).sin()},H.prototype.sinh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sinh(this.get(m,M)));return this},H.sinh=function(m){return new x(m).sinh()},H.prototype.sqrt=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sqrt(this.get(m,M)));return this},H.sqrt=function(m){return new x(m).sqrt()},H.prototype.tan=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.tan(this.get(m,M)));return this},H.tan=function(m){return new x(m).tan()},H.prototype.tanh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.tanh(this.get(m,M)));return this},H.tanh=function(m){return new x(m).tanh()},H.prototype.trunc=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.trunc(this.get(m,M)));return this},H.trunc=function(m){return new x(m).trunc()},H.pow=function(m,M){return new x(m).pow(M)},H.prototype.pow=function(m){return typeof m=="number"?this.powS(m):this.powM(m)},H.prototype.powS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,N(this.get(M,j),m));return this},H.prototype.powM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,N(this.get(M,j),m.get(M,j)));return this}}function gt(H,x,w){let m=w?H.rows:H.rows-1;if(x<0||x>m)throw new RangeError("Row index out of range")}function Et(H,x,w){let m=w?H.columns:H.columns-1;if(x<0||x>m)throw new RangeError("Column index out of range")}function kt(H,x){if(x.to1DArray&&(x=x.to1DArray()),x.length!==H.columns)throw new RangeError("vector size must be the same as the number of columns");return x}function zt(H,x){if(x.to1DArray&&(x=x.to1DArray()),x.length!==H.rows)throw new RangeError("vector size must be the same as the number of rows");return x}function Ut(H,x){if(!rt.isAnyArray(x))throw new TypeError("row indices must be an array");for(let w=0;w<x.length;w++)if(x[w]<0||x[w]>=H.rows)throw new RangeError("row indices are out of range")}function Qt(H,x){if(!rt.isAnyArray(x))throw new TypeError("column indices must be an array");for(let w=0;w<x.length;w++)if(x[w]<0||x[w]>=H.columns)throw new RangeError("column indices are out of range")}function Ee(H,x,w,m,M){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(tn("startRow",x),tn("endRow",w),tn("startColumn",m),tn("endColumn",M),x>w||m>M||x<0||x>=H.rows||w<0||w>=H.rows||m<0||m>=H.columns||M<0||M>=H.columns)throw new RangeError("Submatrix indices are out of range")}function Le(H,x=0){let w=[];for(let m=0;m<H;m++)w.push(x);return w}function tn(H,x){if(typeof x!="number")throw new TypeError(`${H} must be a number`)}function er(H){if(H.isEmpty())throw new Error("Empty matrix has no elements to index")}function $r(H){let x=Le(H.rows);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[w]+=H.get(w,m);return x}function la(H){let x=Le(H.columns);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[m]+=H.get(w,m);return x}function as(H){let x=0;for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)x+=H.get(w,m);return x}function Pt(H){let x=Le(H.rows,1);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[w]*=H.get(w,m);return x}function _t(H){let x=Le(H.columns,1);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[m]*=H.get(w,m);return x}function It(H){let x=1;for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)x*=H.get(w,m);return x}function dt(H,x,w){const m=H.rows,M=H.columns,j=[];for(let tt=0;tt<m;tt++){let et=0,st=0,lt=0;for(let Tt=0;Tt<M;Tt++)lt=H.get(tt,Tt)-w[tt],et+=lt,st+=lt*lt;x?j.push((st-et*et/M)/(M-1)):j.push((st-et*et/M)/M)}return j}function St(H,x,w){const m=H.rows,M=H.columns,j=[];for(let tt=0;tt<M;tt++){let et=0,st=0,lt=0;for(let Tt=0;Tt<m;Tt++)lt=H.get(Tt,tt)-w[tt],et+=lt,st+=lt*lt;x?j.push((st-et*et/m)/(m-1)):j.push((st-et*et/m)/m)}return j}function Ct(H,x,w){const m=H.rows,M=H.columns,j=m*M;let tt=0,et=0,st=0;for(let lt=0;lt<m;lt++)for(let Tt=0;Tt<M;Tt++)st=H.get(lt,Tt)-w,tt+=st,et+=st*st;return x?(et-tt*tt/j)/(j-1):(et-tt*tt/j)/j}function Gt(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)-x[w])}function oe(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)-x[m])}function ye(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)-x)}function de(H){const x=[];for(let w=0;w<H.rows;w++){let m=0;for(let M=0;M<H.columns;M++)m+=N(H.get(w,M),2)/(H.columns-1);x.push(Math.sqrt(m))}return x}function _e(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)/x[w])}function Mn(H){const x=[];for(let w=0;w<H.columns;w++){let m=0;for(let M=0;M<H.rows;M++)m+=N(H.get(M,w),2)/(H.rows-1);x.push(Math.sqrt(m))}return x}function Nn(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)/x[m])}function Pe(H){const x=H.size-1;let w=0;for(let m=0;m<H.columns;m++)for(let M=0;M<H.rows;M++)w+=N(H.get(M,m),2)/x;return Math.sqrt(w)}function Se(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)/x)}class re{static from1DArray(x,w,m){if(x*w!==m.length)throw new RangeError("data length does not match given dimensions");let j=new ne(x,w);for(let tt=0;tt<x;tt++)for(let et=0;et<w;et++)j.set(tt,et,m[tt*w+et]);return j}static rowVector(x){let w=new ne(1,x.length);for(let m=0;m<x.length;m++)w.set(0,m,x[m]);return w}static columnVector(x){let w=new ne(x.length,1);for(let m=0;m<x.length;m++)w.set(m,0,x[m]);return w}static zeros(x,w){return new ne(x,w)}static ones(x,w){return new ne(x,w).fill(1)}static rand(x,w,m={}){if(typeof m!="object")throw new TypeError("options must be an object");const{random:M=Math.random}=m;let j=new ne(x,w);for(let tt=0;tt<x;tt++)for(let et=0;et<w;et++)j.set(tt,et,M());return j}static randInt(x,w,m={}){if(typeof m!="object")throw new TypeError("options must be an object");const{min:M=0,max:j=1e3,random:tt=Math.random}=m;if(!Number.isInteger(M))throw new TypeError("min must be an integer");if(!Number.isInteger(j))throw new TypeError("max must be an integer");if(M>=j)throw new RangeError("min must be smaller than max");let et=j-M,st=new ne(x,w);for(let lt=0;lt<x;lt++)for(let Tt=0;Tt<w;Tt++){let vt=M+Math.round(tt()*et);st.set(lt,Tt,vt)}return st}static eye(x,w,m){w===void 0&&(w=x),m===void 0&&(m=1);let M=Math.min(x,w),j=this.zeros(x,w);for(let tt=0;tt<M;tt++)j.set(tt,tt,m);return j}static diag(x,w,m){let M=x.length;w===void 0&&(w=M),m===void 0&&(m=w);let j=Math.min(M,w,m),tt=this.zeros(w,m);for(let et=0;et<j;et++)tt.set(et,et,x[et]);return tt}static min(x,w){x=this.checkMatrix(x),w=this.checkMatrix(w);let m=x.rows,M=x.columns,j=new ne(m,M);for(let tt=0;tt<m;tt++)for(let et=0;et<M;et++)j.set(tt,et,Math.min(x.get(tt,et),w.get(tt,et)));return j}static max(x,w){x=this.checkMatrix(x),w=this.checkMatrix(w);let m=x.rows,M=x.columns,j=new this(m,M);for(let tt=0;tt<m;tt++)for(let et=0;et<M;et++)j.set(tt,et,Math.max(x.get(tt,et),w.get(tt,et)));return j}static checkMatrix(x){return re.isMatrix(x)?x:new ne(x)}static isMatrix(x){return x!=null&&x.klass==="Matrix"}get size(){return this.rows*this.columns}apply(x){if(typeof x!="function")throw new TypeError("callback must be a function");for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x.call(this,w,m);return this}to1DArray(){let x=[];for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x.push(this.get(w,m));return x}to2DArray(){let x=[];for(let w=0;w<this.rows;w++){x.push([]);for(let m=0;m<this.columns;m++)x[w].push(this.get(w,m))}return x}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isEmpty(){return this.rows===0||this.columns===0}isSymmetric(){if(this.isSquare()){for(let x=0;x<this.rows;x++)for(let w=0;w<=x;w++)if(this.get(x,w)!==this.get(w,x))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let x=0;x<this.rows;x++)if(this.get(x,x)!==0)return!1;return!0}isEchelonForm(){let x=0,w=0,m=-1,M=!0,j=!1;for(;x<this.rows&&M;){for(w=0,j=!1;w<this.columns&&j===!1;)this.get(x,w)===0?w++:this.get(x,w)===1&&w>m?(j=!0,m=w):(M=!1,j=!0);x++}return M}isReducedEchelonForm(){let x=0,w=0,m=-1,M=!0,j=!1;for(;x<this.rows&&M;){for(w=0,j=!1;w<this.columns&&j===!1;)this.get(x,w)===0?w++:this.get(x,w)===1&&w>m?(j=!0,m=w):(M=!1,j=!0);for(let tt=w+1;tt<this.rows;tt++)this.get(x,tt)!==0&&(M=!1);x++}return M}echelonForm(){let x=this.clone(),w=0,m=0;for(;w<x.rows&&m<x.columns;){let M=w;for(let j=w;j<x.rows;j++)x.get(j,m)>x.get(M,m)&&(M=j);if(x.get(M,m)===0)m++;else{x.swapRows(w,M);let j=x.get(w,m);for(let tt=m;tt<x.columns;tt++)x.set(w,tt,x.get(w,tt)/j);for(let tt=w+1;tt<x.rows;tt++){let et=x.get(tt,m)/x.get(w,m);x.set(tt,m,0);for(let st=m+1;st<x.columns;st++)x.set(tt,st,x.get(tt,st)-x.get(w,st)*et)}w++,m++}}return x}reducedEchelonForm(){let x=this.echelonForm(),w=x.columns,m=x.rows,M=m-1;for(;M>=0;)if(x.maxRow(M)===0)M--;else{let j=0,tt=!1;for(;j<m&&tt===!1;)x.get(M,j)===1?tt=!0:j++;for(let et=0;et<M;et++){let st=x.get(et,j);for(let lt=j;lt<w;lt++){let Tt=x.get(et,lt)-st*x.get(M,lt);x.set(et,lt,Tt)}}M--}return x}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{rows:w=1,columns:m=1}=x;if(!Number.isInteger(w)||w<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(m)||m<=0)throw new TypeError("columns must be a positive integer");let M=new ne(this.rows*w,this.columns*m);for(let j=0;j<w;j++)for(let tt=0;tt<m;tt++)M.setSubMatrix(this,this.rows*j,this.columns*tt);return M}fill(x){for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,x);return this}neg(){return this.mulS(-1)}getRow(x){gt(this,x);let w=[];for(let m=0;m<this.columns;m++)w.push(this.get(x,m));return w}getRowVector(x){return ne.rowVector(this.getRow(x))}setRow(x,w){gt(this,x),w=kt(this,w);for(let m=0;m<this.columns;m++)this.set(x,m,w[m]);return this}swapRows(x,w){gt(this,x),gt(this,w);for(let m=0;m<this.columns;m++){let M=this.get(x,m);this.set(x,m,this.get(w,m)),this.set(w,m,M)}return this}getColumn(x){Et(this,x);let w=[];for(let m=0;m<this.rows;m++)w.push(this.get(m,x));return w}getColumnVector(x){return ne.columnVector(this.getColumn(x))}setColumn(x,w){Et(this,x),w=zt(this,w);for(let m=0;m<this.rows;m++)this.set(m,x,w[m]);return this}swapColumns(x,w){Et(this,x),Et(this,w);for(let m=0;m<this.rows;m++){let M=this.get(m,x);this.set(m,x,this.get(m,w)),this.set(m,w,M)}return this}addRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)+x[m]);return this}subRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)-x[m]);return this}mulRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)*x[m]);return this}divRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)/x[m]);return this}addColumnVector(x){x=zt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)+x[w]);return this}subColumnVector(x){x=zt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)-x[w]);return this}mulColumnVector(x){x=zt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)*x[w]);return this}divColumnVector(x){x=zt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)/x[w]);return this}mulRow(x,w){gt(this,x);for(let m=0;m<this.columns;m++)this.set(x,m,this.get(x,m)*w);return this}mulColumn(x,w){Et(this,x);for(let m=0;m<this.rows;m++)this.set(m,x,this.get(m,x)*w);return this}max(x){if(this.isEmpty())return NaN;switch(x){case"row":{const w=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>w[m]&&(w[m]=this.get(m,M));return w}case"column":{const w=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>w[M]&&(w[M]=this.get(m,M));return w}case void 0:{let w=this.get(0,0);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>w&&(w=this.get(m,M));return w}default:throw new Error(`invalid option: ${x}`)}}maxIndex(){er(this);let x=this.get(0,0),w=[0,0];for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>x&&(x=this.get(m,M),w[0]=m,w[1]=M);return w}min(x){if(this.isEmpty())return NaN;switch(x){case"row":{const w=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<w[m]&&(w[m]=this.get(m,M));return w}case"column":{const w=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<w[M]&&(w[M]=this.get(m,M));return w}case void 0:{let w=this.get(0,0);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<w&&(w=this.get(m,M));return w}default:throw new Error(`invalid option: ${x}`)}}minIndex(){er(this);let x=this.get(0,0),w=[0,0];for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<x&&(x=this.get(m,M),w[0]=m,w[1]=M);return w}maxRow(x){if(gt(this,x),this.isEmpty())return NaN;let w=this.get(x,0);for(let m=1;m<this.columns;m++)this.get(x,m)>w&&(w=this.get(x,m));return w}maxRowIndex(x){gt(this,x),er(this);let w=this.get(x,0),m=[x,0];for(let M=1;M<this.columns;M++)this.get(x,M)>w&&(w=this.get(x,M),m[1]=M);return m}minRow(x){if(gt(this,x),this.isEmpty())return NaN;let w=this.get(x,0);for(let m=1;m<this.columns;m++)this.get(x,m)<w&&(w=this.get(x,m));return w}minRowIndex(x){gt(this,x),er(this);let w=this.get(x,0),m=[x,0];for(let M=1;M<this.columns;M++)this.get(x,M)<w&&(w=this.get(x,M),m[1]=M);return m}maxColumn(x){if(Et(this,x),this.isEmpty())return NaN;let w=this.get(0,x);for(let m=1;m<this.rows;m++)this.get(m,x)>w&&(w=this.get(m,x));return w}maxColumnIndex(x){Et(this,x),er(this);let w=this.get(0,x),m=[0,x];for(let M=1;M<this.rows;M++)this.get(M,x)>w&&(w=this.get(M,x),m[0]=M);return m}minColumn(x){if(Et(this,x),this.isEmpty())return NaN;let w=this.get(0,x);for(let m=1;m<this.rows;m++)this.get(m,x)<w&&(w=this.get(m,x));return w}minColumnIndex(x){Et(this,x),er(this);let w=this.get(0,x),m=[0,x];for(let M=1;M<this.rows;M++)this.get(M,x)<w&&(w=this.get(M,x),m[0]=M);return m}diag(){let x=Math.min(this.rows,this.columns),w=[];for(let m=0;m<x;m++)w.push(this.get(m,m));return w}norm(x="frobenius"){switch(x){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${x}`)}}cumulativeSum(){let x=0;for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x+=this.get(w,m),this.set(w,m,x);return this}dot(x){re.isMatrix(x)&&(x=x.to1DArray());let w=this.to1DArray();if(w.length!==x.length)throw new RangeError("vectors do not have the same size");let m=0;for(let M=0;M<w.length;M++)m+=w[M]*x[M];return m}mmul(x){x=ne.checkMatrix(x);let w=this.rows,m=this.columns,M=x.columns,j=new ne(w,M),tt=new Float64Array(m);for(let et=0;et<M;et++){for(let st=0;st<m;st++)tt[st]=x.get(st,et);for(let st=0;st<w;st++){let lt=0;for(let Tt=0;Tt<m;Tt++)lt+=this.get(st,Tt)*tt[Tt];j.set(st,et,lt)}}return j}mpow(x){if(!this.isSquare())throw new RangeError("Matrix must be square");if(!Number.isInteger(x)||x<0)throw new RangeError("Exponent must be a non-negative integer");let w=ne.eye(this.rows),m=this;for(let M=x;M>=1;M/=2)M&1&&(w=w.mmul(m)),m=m.mmul(m);return w}strassen2x2(x){x=ne.checkMatrix(x);let w=new ne(2,2);const m=this.get(0,0),M=x.get(0,0),j=this.get(0,1),tt=x.get(0,1),et=this.get(1,0),st=x.get(1,0),lt=this.get(1,1),Tt=x.get(1,1),vt=(m+lt)*(M+Tt),Ft=(et+lt)*M,qt=m*(tt-Tt),Lt=lt*(st-M),Zt=(m+j)*Tt,le=(et-m)*(M+tt),bt=(j-lt)*(st+Tt),Wt=vt+Lt-Zt+bt,ue=qt+Zt,we=Ft+Lt,Ae=vt-Ft+qt+le;return w.set(0,0,Wt),w.set(0,1,ue),w.set(1,0,we),w.set(1,1,Ae),w}strassen3x3(x){x=ne.checkMatrix(x);let w=new ne(3,3);const m=this.get(0,0),M=this.get(0,1),j=this.get(0,2),tt=this.get(1,0),et=this.get(1,1),st=this.get(1,2),lt=this.get(2,0),Tt=this.get(2,1),vt=this.get(2,2),Ft=x.get(0,0),qt=x.get(0,1),Lt=x.get(0,2),Zt=x.get(1,0),le=x.get(1,1),bt=x.get(1,2),Wt=x.get(2,0),ue=x.get(2,1),we=x.get(2,2),Ae=(m+M+j-tt-et-Tt-vt)*le,un=(m-tt)*(-qt+le),ge=et*(-Ft+qt+Zt-le-bt-Wt+we),be=(-m+tt+et)*(Ft-qt+le),Ze=(tt+et)*(-Ft+qt),Mt=m*Ft,Yt=(-m+lt+Tt)*(Ft-Lt+bt),Jt=(-m+lt)*(Lt-bt),Ht=(lt+Tt)*(-Ft+Lt),fn=(m+M+j-et-st-lt-Tt)*bt,$e=Tt*(-Ft+Lt+Zt-le-bt-Wt+ue),hn=(-j+Tt+vt)*(le+Wt-ue),vn=(j-vt)*(le-ue),nr=j*Wt,Hn=(Tt+vt)*(-Wt+ue),gn=(-j+et+st)*(bt+Wt-we),ti=(j-st)*(bt-we),fi=(et+st)*(-Wt+we),ze=M*Zt,Bn=st*ue,Mr=tt*Lt,_r=lt*qt,Tn=vt*we,Ca=Mt+nr+ze,Js=Ae+be+Ze+Mt+hn+nr+Hn,yd=Mt+Yt+Ht+fn+nr+gn+fi,bd=un+ge+be+Mt+nr+gn+ti,hs=un+be+Ze+Mt+Bn,Wo=nr+gn+ti+fi+Mr,xd=Mt+Yt+Jt+$e+hn+vn+nr,Kl=hn+vn+nr+Hn+_r,Ed=Mt+Yt+Jt+Ht+Tn;return w.set(0,0,Ca),w.set(0,1,Js),w.set(0,2,yd),w.set(1,0,bd),w.set(1,1,hs),w.set(1,2,Wo),w.set(2,0,xd),w.set(2,1,Kl),w.set(2,2,Ed),w}mmulStrassen(x){x=ne.checkMatrix(x);let w=this.clone(),m=w.rows,M=w.columns,j=x.rows,tt=x.columns;M!==j&&console.warn(`Multiplying ${m} x ${M} and ${j} x ${tt} matrix: dimensions do not match.`);function et(vt,Ft,qt){let Lt=vt.rows,Zt=vt.columns;if(Lt===Ft&&Zt===qt)return vt;{let le=re.zeros(Ft,qt);return le=le.setSubMatrix(vt,0,0),le}}let st=Math.max(m,j),lt=Math.max(M,tt);w=et(w,st,lt),x=et(x,st,lt);function Tt(vt,Ft,qt,Lt){if(qt<=512||Lt<=512)return vt.mmul(Ft);qt%2===1&&Lt%2===1?(vt=et(vt,qt+1,Lt+1),Ft=et(Ft,qt+1,Lt+1)):qt%2===1?(vt=et(vt,qt+1,Lt),Ft=et(Ft,qt+1,Lt)):Lt%2===1&&(vt=et(vt,qt,Lt+1),Ft=et(Ft,qt,Lt+1));let Zt=parseInt(vt.rows/2,10),le=parseInt(vt.columns/2,10),bt=vt.subMatrix(0,Zt-1,0,le-1),Wt=Ft.subMatrix(0,Zt-1,0,le-1),ue=vt.subMatrix(0,Zt-1,le,vt.columns-1),we=Ft.subMatrix(0,Zt-1,le,Ft.columns-1),Ae=vt.subMatrix(Zt,vt.rows-1,0,le-1),un=Ft.subMatrix(Zt,Ft.rows-1,0,le-1),ge=vt.subMatrix(Zt,vt.rows-1,le,vt.columns-1),be=Ft.subMatrix(Zt,Ft.rows-1,le,Ft.columns-1),Ze=Tt(re.add(bt,ge),re.add(Wt,be),Zt,le),Mt=Tt(re.add(Ae,ge),Wt,Zt,le),Yt=Tt(bt,re.sub(we,be),Zt,le),Jt=Tt(ge,re.sub(un,Wt),Zt,le),Ht=Tt(re.add(bt,ue),be,Zt,le),fn=Tt(re.sub(Ae,bt),re.add(Wt,we),Zt,le),$e=Tt(re.sub(ue,ge),re.add(un,be),Zt,le),hn=re.add(Ze,Jt);hn.sub(Ht),hn.add($e);let vn=re.add(Yt,Ht),nr=re.add(Mt,Jt),Hn=re.sub(Ze,Mt);Hn.add(Yt),Hn.add(fn);let gn=re.zeros(2*hn.rows,2*hn.columns);return gn=gn.setSubMatrix(hn,0,0),gn=gn.setSubMatrix(vn,hn.rows,0),gn=gn.setSubMatrix(nr,0,hn.columns),gn=gn.setSubMatrix(Hn,hn.rows,hn.columns),gn.subMatrix(0,qt-1,0,Lt-1)}return Tt(w,x,st,lt)}scaleRows(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{min:w=0,max:m=1}=x;if(!Number.isFinite(w))throw new TypeError("min must be a number");if(!Number.isFinite(m))throw new TypeError("max must be a number");if(w>=m)throw new RangeError("min must be smaller than max");let M=new ne(this.rows,this.columns);for(let j=0;j<this.rows;j++){const tt=this.getRow(j);tt.length>0&&nt(tt,{min:w,max:m,output:tt}),M.setRow(j,tt)}return M}scaleColumns(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{min:w=0,max:m=1}=x;if(!Number.isFinite(w))throw new TypeError("min must be a number");if(!Number.isFinite(m))throw new TypeError("max must be a number");if(w>=m)throw new RangeError("min must be smaller than max");let M=new ne(this.rows,this.columns);for(let j=0;j<this.columns;j++){const tt=this.getColumn(j);tt.length&&nt(tt,{min:w,max:m,output:tt}),M.setColumn(j,tt)}return M}flipRows(){const x=Math.ceil(this.columns/2);for(let w=0;w<this.rows;w++)for(let m=0;m<x;m++){let M=this.get(w,m),j=this.get(w,this.columns-1-m);this.set(w,m,j),this.set(w,this.columns-1-m,M)}return this}flipColumns(){const x=Math.ceil(this.rows/2);for(let w=0;w<this.columns;w++)for(let m=0;m<x;m++){let M=this.get(m,w),j=this.get(this.rows-1-m,w);this.set(m,w,j),this.set(this.rows-1-m,w,M)}return this}kroneckerProduct(x){x=ne.checkMatrix(x);let w=this.rows,m=this.columns,M=x.rows,j=x.columns,tt=new ne(w*M,m*j);for(let et=0;et<w;et++)for(let st=0;st<m;st++)for(let lt=0;lt<M;lt++)for(let Tt=0;Tt<j;Tt++)tt.set(M*et+lt,j*st+Tt,this.get(et,st)*x.get(lt,Tt));return tt}kroneckerSum(x){if(x=ne.checkMatrix(x),!this.isSquare()||!x.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let w=this.rows,m=x.rows,M=this.kroneckerProduct(ne.eye(m,m)),j=ne.eye(w,w).kroneckerProduct(x);return M.add(j)}transpose(){let x=new ne(this.columns,this.rows);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x.set(m,w,this.get(w,m));return x}sortRows(x=Oe){for(let w=0;w<this.rows;w++)this.setRow(w,this.getRow(w).sort(x));return this}sortColumns(x=Oe){for(let w=0;w<this.columns;w++)this.setColumn(w,this.getColumn(w).sort(x));return this}subMatrix(x,w,m,M){Ee(this,x,w,m,M);let j=new ne(w-x+1,M-m+1);for(let tt=x;tt<=w;tt++)for(let et=m;et<=M;et++)j.set(tt-x,et-m,this.get(tt,et));return j}subMatrixRow(x,w,m){if(w===void 0&&(w=0),m===void 0&&(m=this.columns-1),w>m||w<0||w>=this.columns||m<0||m>=this.columns)throw new RangeError("Argument out of range");let M=new ne(x.length,m-w+1);for(let j=0;j<x.length;j++)for(let tt=w;tt<=m;tt++){if(x[j]<0||x[j]>=this.rows)throw new RangeError(`Row index out of range: ${x[j]}`);M.set(j,tt-w,this.get(x[j],tt))}return M}subMatrixColumn(x,w,m){if(w===void 0&&(w=0),m===void 0&&(m=this.rows-1),w>m||w<0||w>=this.rows||m<0||m>=this.rows)throw new RangeError("Argument out of range");let M=new ne(m-w+1,x.length);for(let j=0;j<x.length;j++)for(let tt=w;tt<=m;tt++){if(x[j]<0||x[j]>=this.columns)throw new RangeError(`Column index out of range: ${x[j]}`);M.set(tt-w,j,this.get(tt,x[j]))}return M}setSubMatrix(x,w,m){if(x=ne.checkMatrix(x),x.isEmpty())return this;let M=w+x.rows-1,j=m+x.columns-1;Ee(this,w,M,m,j);for(let tt=0;tt<x.rows;tt++)for(let et=0;et<x.columns;et++)this.set(w+tt,m+et,x.get(tt,et));return this}selection(x,w){Ut(this,x),Qt(this,w);let m=new ne(x.length,w.length);for(let M=0;M<x.length;M++){let j=x[M];for(let tt=0;tt<w.length;tt++){let et=w[tt];m.set(M,tt,this.get(j,et))}}return m}trace(){let x=Math.min(this.rows,this.columns),w=0;for(let m=0;m<x;m++)w+=this.get(m,m);return w}clone(){return this.constructor.copy(this,new ne(this.rows,this.columns))}static copy(x,w){for(const[m,M,j]of x.entries())w.set(m,M,j);return w}sum(x){switch(x){case"row":return $r(this);case"column":return la(this);case void 0:return as(this);default:throw new Error(`invalid option: ${x}`)}}product(x){switch(x){case"row":return Pt(this);case"column":return _t(this);case void 0:return It(this);default:throw new Error(`invalid option: ${x}`)}}mean(x){const w=this.sum(x);switch(x){case"row":{for(let m=0;m<this.rows;m++)w[m]/=this.columns;return w}case"column":{for(let m=0;m<this.columns;m++)w[m]/=this.rows;return w}case void 0:return w/this.size;default:throw new Error(`invalid option: ${x}`)}}variance(x,w={}){if(typeof x=="object"&&(w=x,x=void 0),typeof w!="object")throw new TypeError("options must be an object");const{unbiased:m=!0,mean:M=this.mean(x)}=w;if(typeof m!="boolean")throw new TypeError("unbiased must be a boolean");switch(x){case"row":{if(!rt.isAnyArray(M))throw new TypeError("mean must be an array");return dt(this,m,M)}case"column":{if(!rt.isAnyArray(M))throw new TypeError("mean must be an array");return St(this,m,M)}case void 0:{if(typeof M!="number")throw new TypeError("mean must be a number");return Ct(this,m,M)}default:throw new Error(`invalid option: ${x}`)}}standardDeviation(x,w){typeof x=="object"&&(w=x,x=void 0);const m=this.variance(x,w);if(x===void 0)return Math.sqrt(m);for(let M=0;M<m.length;M++)m[M]=Math.sqrt(m[M]);return m}center(x,w={}){if(typeof x=="object"&&(w=x,x=void 0),typeof w!="object")throw new TypeError("options must be an object");const{center:m=this.mean(x)}=w;switch(x){case"row":{if(!rt.isAnyArray(m))throw new TypeError("center must be an array");return Gt(this,m),this}case"column":{if(!rt.isAnyArray(m))throw new TypeError("center must be an array");return oe(this,m),this}case void 0:{if(typeof m!="number")throw new TypeError("center must be a number");return ye(this,m),this}default:throw new Error(`invalid option: ${x}`)}}scale(x,w={}){if(typeof x=="object"&&(w=x,x=void 0),typeof w!="object")throw new TypeError("options must be an object");let m=w.scale;switch(x){case"row":{if(m===void 0)m=de(this);else if(!rt.isAnyArray(m))throw new TypeError("scale must be an array");return _e(this,m),this}case"column":{if(m===void 0)m=Mn(this);else if(!rt.isAnyArray(m))throw new TypeError("scale must be an array");return Nn(this,m),this}case void 0:{if(m===void 0)m=Pe(this);else if(typeof m!="number")throw new TypeError("scale must be a number");return Se(this,m),this}default:throw new Error(`invalid option: ${x}`)}}toString(x){return ut(this,x)}[Symbol.iterator](){return this.entries()}*entries(){for(let x=0;x<this.rows;x++)for(let w=0;w<this.columns;w++)yield[x,w,this.get(x,w)]}*values(){for(let x=0;x<this.rows;x++)for(let w=0;w<this.columns;w++)yield this.get(x,w)}}re.prototype.klass="Matrix",typeof Symbol!="undefined"&&(re.prototype[Symbol.for("nodejs.util.inspect.custom")]=at);function Oe(H,x){return H-x}function cr(H){return H.every(x=>typeof x=="number")}re.random=re.rand,re.randomInt=re.randInt,re.diagonal=re.diag,re.prototype.diagonal=re.prototype.diag,re.identity=re.eye,re.prototype.negate=re.prototype.neg,re.prototype.tensorProduct=re.prototype.kroneckerProduct;const ca=class H0 extends re{constructor(x,w){if(super(),R(this,W),k(this,"data"),H0.isMatrix(x))D(this,W,X).call(this,x.rows,x.columns),H0.copy(x,this);else if(Number.isInteger(x)&&x>=0)D(this,W,X).call(this,x,w);else if(rt.isAnyArray(x)){const m=x;if(x=m.length,w=x?m[0].length:0,typeof w!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let M=0;M<x;M++){if(m[M].length!==w)throw new RangeError("Inconsistent array dimensions");if(!cr(m[M]))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(m[M]))}this.rows=x,this.columns=w}else throw new TypeError("First argument must be a positive number or an array")}set(x,w,m){return this.data[x][w]=m,this}get(x,w){return this.data[x][w]}removeRow(x){return gt(this,x),this.data.splice(x,1),this.rows-=1,this}addRow(x,w){return w===void 0&&(w=x,x=this.rows),gt(this,x,!0),w=Float64Array.from(kt(this,w)),this.data.splice(x,0,w),this.rows+=1,this}removeColumn(x){Et(this,x);for(let w=0;w<this.rows;w++){const m=new Float64Array(this.columns-1);for(let M=0;M<x;M++)m[M]=this.data[w][M];for(let M=x+1;M<this.columns;M++)m[M-1]=this.data[w][M];this.data[w]=m}return this.columns-=1,this}addColumn(x,w){typeof w=="undefined"&&(w=x,x=this.columns),Et(this,x,!0),w=zt(this,w);for(let m=0;m<this.rows;m++){const M=new Float64Array(this.columns+1);let j=0;for(;j<x;j++)M[j]=this.data[m][j];for(M[j++]=w[m];j<this.columns+1;j++)M[j]=this.data[m][j-1];this.data[m]=M}return this.columns+=1,this}};W=new WeakSet,X=function(H,x){if(this.data=[],Number.isInteger(x)&&x>=0)for(let w=0;w<H;w++)this.data.push(new Float64Array(x));else throw new TypeError("nColumns must be a positive integer");this.rows=H,this.columns=x};let ne=ca;wt(re,ne);const ss=class X0 extends re{constructor(x){if(super(),R(this,K),ne.isMatrix(x)){if(!x.isSymmetric())throw new TypeError("not symmetric data");z(this,K,ne.copy(x,new ne(x.rows,x.rows)))}else if(Number.isInteger(x)&&x>=0)z(this,K,new ne(x,x));else if(z(this,K,new ne(x)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return C(this,K).size}get rows(){return C(this,K).rows}get columns(){return C(this,K).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(x){return ne.isMatrix(x)&&x.klassType==="SymmetricMatrix"}static zeros(x){return new this(x)}static ones(x){return new this(x).fill(1)}clone(){const x=new X0(this.diagonalSize);for(const[w,m,M]of this.upperRightEntries())x.set(w,m,M);return x}toMatrix(){return new ne(this)}get(x,w){return C(this,K).get(x,w)}set(x,w,m){return C(this,K).set(x,w,m),C(this,K).set(w,x,m),this}removeCross(x){return C(this,K).removeRow(x),C(this,K).removeColumn(x),this}addCross(x,w){w===void 0&&(w=x,x=this.diagonalSize);const m=w.slice();return m.splice(x,1),C(this,K).addRow(x,m),C(this,K).addColumn(x,w),this}applyMask(x){if(x.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const w=[];for(const[m,M]of x.entries())M||w.push(m);w.reverse();for(const m of w)this.removeCross(m);return this}toCompact(){const{diagonalSize:x}=this,w=new Array(x*(x+1)/2);for(let m=0,M=0,j=0;j<w.length;j++)w[j]=this.get(M,m),++m>=x&&(m=++M);return w}static fromCompact(x){const w=x.length,m=(Math.sqrt(8*w+1)-1)/2;if(!Number.isInteger(m))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(x)}`);const M=new X0(m);for(let j=0,tt=0,et=0;et<w;et++)M.set(j,tt,x[et]),++j>=m&&(j=++tt);return M}*upperRightEntries(){for(let x=0,w=0;x<this.diagonalSize;void 0){const m=this.get(x,w);yield[x,w,m],++w>=this.diagonalSize&&(w=++x)}}*upperRightValues(){for(let x=0,w=0;x<this.diagonalSize;void 0)yield this.get(x,w),++w>=this.diagonalSize&&(w=++x)}};K=new WeakMap;let Rr=ss;Rr.prototype.klassType="SymmetricMatrix";class Yn extends Rr{static isDistanceMatrix(x){return Rr.isSymmetricMatrix(x)&&x.klassSubType==="DistanceMatrix"}constructor(x){if(super(x),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(x,w,m){return x===w&&(m=0),super.set(x,w,m)}addCross(x,w){return w===void 0&&(w=x,x=this.diagonalSize),w=w.slice(),w[x]=0,super.addCross(x,w)}toSymmetricMatrix(){return new Rr(this)}clone(){const x=new Yn(this.diagonalSize);for(const[w,m,M]of this.upperRightEntries())w!==m&&x.set(w,m,M);return x}toCompact(){const{diagonalSize:x}=this,w=(x-1)*x/2,m=new Array(w);for(let M=1,j=0,tt=0;tt<m.length;tt++)m[tt]=this.get(j,M),++M>=x&&(M=++j+1);return m}static fromCompact(x){const w=x.length;if(w===0)return new this(0);const m=(Math.sqrt(8*w+1)+1)/2;if(!Number.isInteger(m))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(x)}`);const M=new this(m);for(let j=1,tt=0,et=0;et<w;et++)M.set(j,tt,x[et]),++j>=m&&(j=++tt+1);return M}}Yn.prototype.klassSubType="DistanceMatrix";class Lr extends re{constructor(x,w,m){super(),this.matrix=x,this.rows=w,this.columns=m}}class os extends Lr{constructor(x,w){Et(x,w),super(x,x.rows,1),this.column=w}set(x,w,m){return this.matrix.set(x,this.column,m),this}get(x){return this.matrix.get(x,this.column)}}class ua extends Lr{constructor(x,w){Qt(x,w),super(x,x.rows,w.length),this.columnIndices=w}set(x,w,m){return this.matrix.set(x,this.columnIndices[w],m),this}get(x,w){return this.matrix.get(x,this.columnIndices[w])}}class qs extends Lr{constructor(x){super(x,x.rows,x.columns)}set(x,w,m){return this.matrix.set(x,this.columns-w-1,m),this}get(x,w){return this.matrix.get(x,this.columns-w-1)}}class ha extends Lr{constructor(x){super(x,x.rows,x.columns)}set(x,w,m){return this.matrix.set(this.rows-x-1,w,m),this}get(x,w){return this.matrix.get(this.rows-x-1,w)}}class Fo extends Lr{constructor(x,w){gt(x,w),super(x,1,x.columns),this.row=w}set(x,w,m){return this.matrix.set(this.row,w,m),this}get(x,w){return this.matrix.get(this.row,w)}}class ls extends Lr{constructor(x,w){Ut(x,w),super(x,w.length,x.columns),this.rowIndices=w}set(x,w,m){return this.matrix.set(this.rowIndices[x],w,m),this}get(x,w){return this.matrix.get(this.rowIndices[x],w)}}class cs extends Lr{constructor(x,w,m){Ut(x,w),Qt(x,m),super(x,w.length,m.length),this.rowIndices=w,this.columnIndices=m}set(x,w,m){return this.matrix.set(this.rowIndices[x],this.columnIndices[w],m),this}get(x,w){return this.matrix.get(this.rowIndices[x],this.columnIndices[w])}}class us extends Lr{constructor(x,w,m,M,j){Ee(x,w,m,M,j),super(x,m-w+1,j-M+1),this.startRow=w,this.startColumn=M}set(x,w,m){return this.matrix.set(this.startRow+x,this.startColumn+w,m),this}get(x,w){return this.matrix.get(this.startRow+x,this.startColumn+w)}}class Ai extends Lr{constructor(x){super(x,x.columns,x.rows)}set(x,w,m){return this.matrix.set(w,x,m),this}get(x,w){return this.matrix.get(w,x)}}class Ti extends re{constructor(x,w={}){const{rows:m=1}=w;if(x.length%m!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=m,this.columns=x.length/m,this.data=x}set(x,w,m){let M=this._calculateIndex(x,w);return this.data[M]=m,this}get(x,w){let m=this._calculateIndex(x,w);return this.data[m]}_calculateIndex(x,w){return x*this.columns+w}}class An extends re{constructor(x){super(),this.data=x,this.rows=x.length,this.columns=x[0].length}set(x,w,m){return this.data[x][w]=m,this}get(x,w){return this.data[x][w]}}function hd(H,x){if(rt.isAnyArray(H))return H[0]&&rt.isAnyArray(H[0])?new An(H):new Ti(H,x);throw new Error("the argument is not an array")}class Ui{constructor(x){x=An.checkMatrix(x);let w=x.clone(),m=w.rows,M=w.columns,j=new Float64Array(m),tt=1,et,st,lt,Tt,vt,Ft,qt,Lt,Zt;for(et=0;et<m;et++)j[et]=et;for(Lt=new Float64Array(m),st=0;st<M;st++){for(et=0;et<m;et++)Lt[et]=w.get(et,st);for(et=0;et<m;et++){for(Zt=Math.min(et,st),vt=0,lt=0;lt<Zt;lt++)vt+=w.get(et,lt)*Lt[lt];Lt[et]-=vt,w.set(et,st,Lt[et])}for(Tt=st,et=st+1;et<m;et++)Math.abs(Lt[et])>Math.abs(Lt[Tt])&&(Tt=et);if(Tt!==st){for(lt=0;lt<M;lt++)Ft=w.get(Tt,lt),w.set(Tt,lt,w.get(st,lt)),w.set(st,lt,Ft);qt=j[Tt],j[Tt]=j[st],j[st]=qt,tt=-tt}if(st<m&&w.get(st,st)!==0)for(et=st+1;et<m;et++)w.set(et,st,w.get(et,st)/w.get(st,st))}this.LU=w,this.pivotVector=j,this.pivotSign=tt}isSingular(){let x=this.LU,w=x.columns;for(let m=0;m<w;m++)if(x.get(m,m)===0)return!0;return!1}solve(x){x=ne.checkMatrix(x);let w=this.LU;if(w.rows!==x.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let M=x.columns,j=x.subMatrixRow(this.pivotVector,0,M-1),tt=w.columns,et,st,lt;for(lt=0;lt<tt;lt++)for(et=lt+1;et<tt;et++)for(st=0;st<M;st++)j.set(et,st,j.get(et,st)-j.get(lt,st)*w.get(et,lt));for(lt=tt-1;lt>=0;lt--){for(st=0;st<M;st++)j.set(lt,st,j.get(lt,st)/w.get(lt,lt));for(et=0;et<lt;et++)for(st=0;st<M;st++)j.set(et,st,j.get(et,st)-j.get(lt,st)*w.get(et,lt))}return j}get determinant(){let x=this.LU;if(!x.isSquare())throw new Error("Matrix must be square");let w=this.pivotSign,m=x.columns;for(let M=0;M<m;M++)w*=x.get(M,M);return w}get lowerTriangularMatrix(){let x=this.LU,w=x.rows,m=x.columns,M=new ne(w,m);for(let j=0;j<w;j++)for(let tt=0;tt<m;tt++)j>tt?M.set(j,tt,x.get(j,tt)):j===tt?M.set(j,tt,1):M.set(j,tt,0);return M}get upperTriangularMatrix(){let x=this.LU,w=x.rows,m=x.columns,M=new ne(w,m);for(let j=0;j<w;j++)for(let tt=0;tt<m;tt++)j<=tt?M.set(j,tt,x.get(j,tt)):M.set(j,tt,0);return M}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function Oi(H,x){let w=0;return Math.abs(H)>Math.abs(x)?(w=x/H,Math.abs(H)*Math.sqrt(1+w*w)):x!==0?(w=H/x,Math.abs(x)*Math.sqrt(1+w*w)):0}class zo{constructor(x){x=An.checkMatrix(x);let w=x.clone(),m=x.rows,M=x.columns,j=new Float64Array(M),tt,et,st,lt;for(st=0;st<M;st++){let Tt=0;for(tt=st;tt<m;tt++)Tt=Oi(Tt,w.get(tt,st));if(Tt!==0){for(w.get(st,st)<0&&(Tt=-Tt),tt=st;tt<m;tt++)w.set(tt,st,w.get(tt,st)/Tt);for(w.set(st,st,w.get(st,st)+1),et=st+1;et<M;et++){for(lt=0,tt=st;tt<m;tt++)lt+=w.get(tt,st)*w.get(tt,et);for(lt=-lt/w.get(st,st),tt=st;tt<m;tt++)w.set(tt,et,w.get(tt,et)+lt*w.get(tt,st))}}j[st]=-Tt}this.QR=w,this.Rdiag=j}solve(x){x=ne.checkMatrix(x);let w=this.QR,m=w.rows;if(x.rows!==m)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let M=x.columns,j=x.clone(),tt=w.columns,et,st,lt,Tt;for(lt=0;lt<tt;lt++)for(st=0;st<M;st++){for(Tt=0,et=lt;et<m;et++)Tt+=w.get(et,lt)*j.get(et,st);for(Tt=-Tt/w.get(lt,lt),et=lt;et<m;et++)j.set(et,st,j.get(et,st)+Tt*w.get(et,lt))}for(lt=tt-1;lt>=0;lt--){for(st=0;st<M;st++)j.set(lt,st,j.get(lt,st)/this.Rdiag[lt]);for(et=0;et<lt;et++)for(st=0;st<M;st++)j.set(et,st,j.get(et,st)-j.get(lt,st)*w.get(et,lt))}return j.subMatrix(0,tt-1,0,M-1)}isFullRank(){let x=this.QR.columns;for(let w=0;w<x;w++)if(this.Rdiag[w]===0)return!1;return!0}get upperTriangularMatrix(){let x=this.QR,w=x.columns,m=new ne(w,w),M,j;for(M=0;M<w;M++)for(j=0;j<w;j++)M<j?m.set(M,j,x.get(M,j)):M===j?m.set(M,j,this.Rdiag[M]):m.set(M,j,0);return m}get orthogonalMatrix(){let x=this.QR,w=x.rows,m=x.columns,M=new ne(w,m),j,tt,et,st;for(et=m-1;et>=0;et--){for(j=0;j<w;j++)M.set(j,et,0);for(M.set(et,et,1),tt=et;tt<m;tt++)if(x.get(et,et)!==0){for(st=0,j=et;j<w;j++)st+=x.get(j,et)*M.get(j,tt);for(st=-st/x.get(et,et),j=et;j<w;j++)M.set(j,tt,M.get(j,tt)+st*x.get(j,et))}}return M}}class Oa{constructor(x,w={}){if(x=An.checkMatrix(x),x.isEmpty())throw new Error("Matrix must be non-empty");let m=x.rows,M=x.columns;const{computeLeftSingularVectors:j=!0,computeRightSingularVectors:tt=!0,autoTranspose:et=!1}=w;let st=!!j,lt=!!tt,Tt=!1,vt;if(m<M)if(!et)vt=x.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{vt=x.transpose(),m=vt.rows,M=vt.columns,Tt=!0;let Mt=st;st=lt,lt=Mt}else vt=x.clone();let Ft=Math.min(m,M),qt=Math.min(m+1,M),Lt=new Float64Array(qt),Zt=new ne(m,Ft),le=new ne(M,M),bt=new Float64Array(M),Wt=new Float64Array(m),ue=new Float64Array(qt);for(let Mt=0;Mt<qt;Mt++)ue[Mt]=Mt;let we=Math.min(m-1,M),Ae=Math.max(0,Math.min(M-2,m)),un=Math.max(we,Ae);for(let Mt=0;Mt<un;Mt++){if(Mt<we){Lt[Mt]=0;for(let Yt=Mt;Yt<m;Yt++)Lt[Mt]=Oi(Lt[Mt],vt.get(Yt,Mt));if(Lt[Mt]!==0){vt.get(Mt,Mt)<0&&(Lt[Mt]=-Lt[Mt]);for(let Yt=Mt;Yt<m;Yt++)vt.set(Yt,Mt,vt.get(Yt,Mt)/Lt[Mt]);vt.set(Mt,Mt,vt.get(Mt,Mt)+1)}Lt[Mt]=-Lt[Mt]}for(let Yt=Mt+1;Yt<M;Yt++){if(Mt<we&&Lt[Mt]!==0){let Jt=0;for(let Ht=Mt;Ht<m;Ht++)Jt+=vt.get(Ht,Mt)*vt.get(Ht,Yt);Jt=-Jt/vt.get(Mt,Mt);for(let Ht=Mt;Ht<m;Ht++)vt.set(Ht,Yt,vt.get(Ht,Yt)+Jt*vt.get(Ht,Mt))}bt[Yt]=vt.get(Mt,Yt)}if(st&&Mt<we)for(let Yt=Mt;Yt<m;Yt++)Zt.set(Yt,Mt,vt.get(Yt,Mt));if(Mt<Ae){bt[Mt]=0;for(let Yt=Mt+1;Yt<M;Yt++)bt[Mt]=Oi(bt[Mt],bt[Yt]);if(bt[Mt]!==0){bt[Mt+1]<0&&(bt[Mt]=0-bt[Mt]);for(let Yt=Mt+1;Yt<M;Yt++)bt[Yt]/=bt[Mt];bt[Mt+1]+=1}if(bt[Mt]=-bt[Mt],Mt+1<m&&bt[Mt]!==0){for(let Yt=Mt+1;Yt<m;Yt++)Wt[Yt]=0;for(let Yt=Mt+1;Yt<m;Yt++)for(let Jt=Mt+1;Jt<M;Jt++)Wt[Yt]+=bt[Jt]*vt.get(Yt,Jt);for(let Yt=Mt+1;Yt<M;Yt++){let Jt=-bt[Yt]/bt[Mt+1];for(let Ht=Mt+1;Ht<m;Ht++)vt.set(Ht,Yt,vt.get(Ht,Yt)+Jt*Wt[Ht])}}if(lt)for(let Yt=Mt+1;Yt<M;Yt++)le.set(Yt,Mt,bt[Yt])}}let ge=Math.min(M,m+1);if(we<M&&(Lt[we]=vt.get(we,we)),m<ge&&(Lt[ge-1]=0),Ae+1<ge&&(bt[Ae]=vt.get(Ae,ge-1)),bt[ge-1]=0,st){for(let Mt=we;Mt<Ft;Mt++){for(let Yt=0;Yt<m;Yt++)Zt.set(Yt,Mt,0);Zt.set(Mt,Mt,1)}for(let Mt=we-1;Mt>=0;Mt--)if(Lt[Mt]!==0){for(let Yt=Mt+1;Yt<Ft;Yt++){let Jt=0;for(let Ht=Mt;Ht<m;Ht++)Jt+=Zt.get(Ht,Mt)*Zt.get(Ht,Yt);Jt=-Jt/Zt.get(Mt,Mt);for(let Ht=Mt;Ht<m;Ht++)Zt.set(Ht,Yt,Zt.get(Ht,Yt)+Jt*Zt.get(Ht,Mt))}for(let Yt=Mt;Yt<m;Yt++)Zt.set(Yt,Mt,-Zt.get(Yt,Mt));Zt.set(Mt,Mt,1+Zt.get(Mt,Mt));for(let Yt=0;Yt<Mt-1;Yt++)Zt.set(Yt,Mt,0)}else{for(let Yt=0;Yt<m;Yt++)Zt.set(Yt,Mt,0);Zt.set(Mt,Mt,1)}}if(lt)for(let Mt=M-1;Mt>=0;Mt--){if(Mt<Ae&&bt[Mt]!==0)for(let Yt=Mt+1;Yt<M;Yt++){let Jt=0;for(let Ht=Mt+1;Ht<M;Ht++)Jt+=le.get(Ht,Mt)*le.get(Ht,Yt);Jt=-Jt/le.get(Mt+1,Mt);for(let Ht=Mt+1;Ht<M;Ht++)le.set(Ht,Yt,le.get(Ht,Yt)+Jt*le.get(Ht,Mt))}for(let Yt=0;Yt<M;Yt++)le.set(Yt,Mt,0);le.set(Mt,Mt,1)}let be=ge-1,Ze=Number.EPSILON;for(;ge>0;){let Mt,Yt;for(Mt=ge-2;Mt>=-1&&Mt!==-1;Mt--){const Jt=Number.MIN_VALUE+Ze*Math.abs(Lt[Mt]+Math.abs(Lt[Mt+1]));if(Math.abs(bt[Mt])<=Jt||Number.isNaN(bt[Mt])){bt[Mt]=0;break}}if(Mt===ge-2)Yt=4;else{let Jt;for(Jt=ge-1;Jt>=Mt&&Jt!==Mt;Jt--){let Ht=(Jt!==ge?Math.abs(bt[Jt]):0)+(Jt!==Mt+1?Math.abs(bt[Jt-1]):0);if(Math.abs(Lt[Jt])<=Ze*Ht){Lt[Jt]=0;break}}Jt===Mt?Yt=3:Jt===ge-1?Yt=1:(Yt=2,Mt=Jt)}switch(Mt++,Yt){case 1:{let Jt=bt[ge-2];bt[ge-2]=0;for(let Ht=ge-2;Ht>=Mt;Ht--){let fn=Oi(Lt[Ht],Jt),$e=Lt[Ht]/fn,hn=Jt/fn;if(Lt[Ht]=fn,Ht!==Mt&&(Jt=-hn*bt[Ht-1],bt[Ht-1]=$e*bt[Ht-1]),lt)for(let vn=0;vn<M;vn++)fn=$e*le.get(vn,Ht)+hn*le.get(vn,ge-1),le.set(vn,ge-1,-hn*le.get(vn,Ht)+$e*le.get(vn,ge-1)),le.set(vn,Ht,fn)}break}case 2:{let Jt=bt[Mt-1];bt[Mt-1]=0;for(let Ht=Mt;Ht<ge;Ht++){let fn=Oi(Lt[Ht],Jt),$e=Lt[Ht]/fn,hn=Jt/fn;if(Lt[Ht]=fn,Jt=-hn*bt[Ht],bt[Ht]=$e*bt[Ht],st)for(let vn=0;vn<m;vn++)fn=$e*Zt.get(vn,Ht)+hn*Zt.get(vn,Mt-1),Zt.set(vn,Mt-1,-hn*Zt.get(vn,Ht)+$e*Zt.get(vn,Mt-1)),Zt.set(vn,Ht,fn)}break}case 3:{const Jt=Math.max(Math.abs(Lt[ge-1]),Math.abs(Lt[ge-2]),Math.abs(bt[ge-2]),Math.abs(Lt[Mt]),Math.abs(bt[Mt])),Ht=Lt[ge-1]/Jt,fn=Lt[ge-2]/Jt,$e=bt[ge-2]/Jt,hn=Lt[Mt]/Jt,vn=bt[Mt]/Jt,nr=((fn+Ht)*(fn-Ht)+$e*$e)/2,Hn=Ht*$e*(Ht*$e);let gn=0;(nr!==0||Hn!==0)&&(nr<0?gn=0-Math.sqrt(nr*nr+Hn):gn=Math.sqrt(nr*nr+Hn),gn=Hn/(nr+gn));let ti=(hn+Ht)*(hn-Ht)+gn,fi=hn*vn;for(let ze=Mt;ze<ge-1;ze++){let Bn=Oi(ti,fi);Bn===0&&(Bn=Number.MIN_VALUE);let Mr=ti/Bn,_r=fi/Bn;if(ze!==Mt&&(bt[ze-1]=Bn),ti=Mr*Lt[ze]+_r*bt[ze],bt[ze]=Mr*bt[ze]-_r*Lt[ze],fi=_r*Lt[ze+1],Lt[ze+1]=Mr*Lt[ze+1],lt)for(let Tn=0;Tn<M;Tn++)Bn=Mr*le.get(Tn,ze)+_r*le.get(Tn,ze+1),le.set(Tn,ze+1,-_r*le.get(Tn,ze)+Mr*le.get(Tn,ze+1)),le.set(Tn,ze,Bn);if(Bn=Oi(ti,fi),Bn===0&&(Bn=Number.MIN_VALUE),Mr=ti/Bn,_r=fi/Bn,Lt[ze]=Bn,ti=Mr*bt[ze]+_r*Lt[ze+1],Lt[ze+1]=-_r*bt[ze]+Mr*Lt[ze+1],fi=_r*bt[ze+1],bt[ze+1]=Mr*bt[ze+1],st&&ze<m-1)for(let Tn=0;Tn<m;Tn++)Bn=Mr*Zt.get(Tn,ze)+_r*Zt.get(Tn,ze+1),Zt.set(Tn,ze+1,-_r*Zt.get(Tn,ze)+Mr*Zt.get(Tn,ze+1)),Zt.set(Tn,ze,Bn)}bt[ge-2]=ti;break}case 4:{if(Lt[Mt]<=0&&(Lt[Mt]=Lt[Mt]<0?-Lt[Mt]:0,lt))for(let Jt=0;Jt<=be;Jt++)le.set(Jt,Mt,-le.get(Jt,Mt));for(;Mt<be&&!(Lt[Mt]>=Lt[Mt+1]);){let Jt=Lt[Mt];if(Lt[Mt]=Lt[Mt+1],Lt[Mt+1]=Jt,lt&&Mt<M-1)for(let Ht=0;Ht<M;Ht++)Jt=le.get(Ht,Mt+1),le.set(Ht,Mt+1,le.get(Ht,Mt)),le.set(Ht,Mt,Jt);if(st&&Mt<m-1)for(let Ht=0;Ht<m;Ht++)Jt=Zt.get(Ht,Mt+1),Zt.set(Ht,Mt+1,Zt.get(Ht,Mt)),Zt.set(Ht,Mt,Jt);Mt++}ge--;break}}}if(Tt){let Mt=le;le=Zt,Zt=Mt}this.m=m,this.n=M,this.s=Lt,this.U=Zt,this.V=le}solve(x){let w=x,m=this.threshold,M=this.s.length,j=ne.zeros(M,M);for(let Ft=0;Ft<M;Ft++)Math.abs(this.s[Ft])<=m?j.set(Ft,Ft,0):j.set(Ft,Ft,1/this.s[Ft]);let tt=this.U,et=this.rightSingularVectors,st=et.mmul(j),lt=et.rows,Tt=tt.rows,vt=ne.zeros(lt,Tt);for(let Ft=0;Ft<lt;Ft++)for(let qt=0;qt<Tt;qt++){let Lt=0;for(let Zt=0;Zt<M;Zt++)Lt+=st.get(Ft,Zt)*tt.get(qt,Zt);vt.set(Ft,qt,Lt)}return vt.mmul(w)}solveForDiagonal(x){return this.solve(ne.diag(x))}inverse(){let x=this.V,w=this.threshold,m=x.rows,M=x.columns,j=new ne(m,this.s.length);for(let Tt=0;Tt<m;Tt++)for(let vt=0;vt<M;vt++)Math.abs(this.s[vt])>w&&j.set(Tt,vt,x.get(Tt,vt)/this.s[vt]);let tt=this.U,et=tt.rows,st=tt.columns,lt=new ne(m,et);for(let Tt=0;Tt<m;Tt++)for(let vt=0;vt<et;vt++){let Ft=0;for(let qt=0;qt<st;qt++)Ft+=j.get(Tt,qt)*tt.get(vt,qt);lt.set(Tt,vt,Ft)}return lt}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let x=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,w=0,m=this.s;for(let M=0,j=m.length;M<j;M++)m[M]>x&&w++;return w}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return ne.diag(this.s)}}function K0(H,x=!1){return H=An.checkMatrix(H),x?new Oa(H).inverse():dd(H,ne.eye(H.rows))}function dd(H,x,w=!1){return H=An.checkMatrix(H),x=An.checkMatrix(x),w?new Oa(H).solve(x):H.isSquare()?new Ui(H).solve(x):new zo(H).solve(x)}function jo(H){if(H=ne.checkMatrix(H),H.isSquare()){if(H.columns===0)return 1;let x,w,m,M;if(H.columns===2)return x=H.get(0,0),w=H.get(0,1),m=H.get(1,0),M=H.get(1,1),x*M-w*m;if(H.columns===3){let j,tt,et;return j=new cs(H,[1,2],[1,2]),tt=new cs(H,[1,2],[0,2]),et=new cs(H,[1,2],[0,1]),x=H.get(0,0),w=H.get(0,1),m=H.get(0,2),x*jo(j)-w*jo(tt)+m*jo(et)}else return new Ui(H).determinant}else throw Error("determinant can only be calculated for a square matrix")}function Q0(H,x){let w=[];for(let m=0;m<H;m++)m!==x&&w.push(m);return w}function q0(H,x,w,m=1e-9,M=1e-9){if(H>M)return new Array(x.rows+1).fill(0);{let j=x.addRow(w,[0]);for(let tt=0;tt<j.rows;tt++)Math.abs(j.get(tt,0))<m&&j.set(tt,0,0);return j.to1DArray()}}function J0(H,x={}){const{thresholdValue:w=1e-9,thresholdError:m=1e-9}=x;H=ne.checkMatrix(H);let M=H.rows,j=new ne(M,M);for(let tt=0;tt<M;tt++){let et=ne.columnVector(H.getRow(tt)),st=H.subMatrixRow(Q0(M,tt)).transpose(),Tt=new Oa(st).solve(et),vt=ne.sub(et,st.mmul(Tt)).abs().max();j.setRow(tt,q0(vt,Tt,tt,w,m))}return j}function $0(H,x=Number.EPSILON){if(H=ne.checkMatrix(H),H.isEmpty())return H.transpose();let w=new Oa(H,{autoTranspose:!0}),m=w.leftSingularVectors,M=w.rightSingularVectors,j=w.diagonal;for(let tt=0;tt<j.length;tt++)Math.abs(j[tt])>x?j[tt]=1/j[tt]:j[tt]=0;return M.mmul(ne.diag(j).mmul(m.transpose()))}function tg(H,x=H,w={}){H=new ne(H);let m=!1;if(typeof x=="object"&&!ne.isMatrix(x)&&!rt.isAnyArray(x)?(w=x,x=H,m=!0):x=new ne(x),H.rows!==x.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:M=!0}=w;M&&(H=H.center("column"),m||(x=x.center("column")));const j=H.transpose().mmul(x);for(let tt=0;tt<j.rows;tt++)for(let et=0;et<j.columns;et++)j.set(tt,et,j.get(tt,et)*(1/(H.rows-1)));return j}function fd(H,x=H,w={}){H=new ne(H);let m=!1;if(typeof x=="object"&&!ne.isMatrix(x)&&!rt.isAnyArray(x)?(w=x,x=H,m=!0):x=new ne(x),H.rows!==x.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:M=!0,scale:j=!0}=w;M&&(H.center("column"),m||x.center("column")),j&&(H.scale("column"),m||x.scale("column"));const tt=H.standardDeviation("column",{unbiased:!0}),et=m?tt:x.standardDeviation("column",{unbiased:!0}),st=H.transpose().mmul(x);for(let lt=0;lt<st.rows;lt++)for(let Tt=0;Tt<st.columns;Tt++)st.set(lt,Tt,st.get(lt,Tt)*(1/(tt[lt]*et[Tt]))*(1/(H.rows-1)));return st}class vd{constructor(x,w={}){const{assumeSymmetric:m=!1}=w;if(x=An.checkMatrix(x),!x.isSquare())throw new Error("Matrix is not a square matrix");if(x.isEmpty())throw new Error("Matrix must be non-empty");let M=x.columns,j=new ne(M,M),tt=new Float64Array(M),et=new Float64Array(M),st=x,lt,Tt,vt=!1;if(m?vt=!0:vt=x.isSymmetric(),vt){for(lt=0;lt<M;lt++)for(Tt=0;Tt<M;Tt++)j.set(lt,Tt,st.get(lt,Tt));eg(M,et,tt,j),ng(M,et,tt,j)}else{let Ft=new ne(M,M),qt=new Float64Array(M);for(Tt=0;Tt<M;Tt++)for(lt=0;lt<M;lt++)Ft.set(lt,Tt,st.get(lt,Tt));gd(M,Ft,qt,j),pd(M,et,tt,j,Ft)}this.n=M,this.e=et,this.d=tt,this.V=j}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let x=this.n,w=this.e,m=this.d,M=new ne(x,x),j,tt;for(j=0;j<x;j++){for(tt=0;tt<x;tt++)M.set(j,tt,0);M.set(j,j,m[j]),w[j]>0?M.set(j,j+1,w[j]):w[j]<0&&M.set(j,j-1,w[j])}return M}}function eg(H,x,w,m){let M,j,tt,et,st,lt,Tt,vt;for(st=0;st<H;st++)w[st]=m.get(H-1,st);for(et=H-1;et>0;et--){for(vt=0,tt=0,lt=0;lt<et;lt++)vt=vt+Math.abs(w[lt]);if(vt===0)for(x[et]=w[et-1],st=0;st<et;st++)w[st]=m.get(et-1,st),m.set(et,st,0),m.set(st,et,0);else{for(lt=0;lt<et;lt++)w[lt]/=vt,tt+=w[lt]*w[lt];for(M=w[et-1],j=Math.sqrt(tt),M>0&&(j=-j),x[et]=vt*j,tt=tt-M*j,w[et-1]=M-j,st=0;st<et;st++)x[st]=0;for(st=0;st<et;st++){for(M=w[st],m.set(st,et,M),j=x[st]+m.get(st,st)*M,lt=st+1;lt<=et-1;lt++)j+=m.get(lt,st)*w[lt],x[lt]+=m.get(lt,st)*M;x[st]=j}for(M=0,st=0;st<et;st++)x[st]/=tt,M+=x[st]*w[st];for(Tt=M/(tt+tt),st=0;st<et;st++)x[st]-=Tt*w[st];for(st=0;st<et;st++){for(M=w[st],j=x[st],lt=st;lt<=et-1;lt++)m.set(lt,st,m.get(lt,st)-(M*x[lt]+j*w[lt]));w[st]=m.get(et-1,st),m.set(et,st,0)}}w[et]=tt}for(et=0;et<H-1;et++){if(m.set(H-1,et,m.get(et,et)),m.set(et,et,1),tt=w[et+1],tt!==0){for(lt=0;lt<=et;lt++)w[lt]=m.get(lt,et+1)/tt;for(st=0;st<=et;st++){for(j=0,lt=0;lt<=et;lt++)j+=m.get(lt,et+1)*m.get(lt,st);for(lt=0;lt<=et;lt++)m.set(lt,st,m.get(lt,st)-j*w[lt])}}for(lt=0;lt<=et;lt++)m.set(lt,et+1,0)}for(st=0;st<H;st++)w[st]=m.get(H-1,st),m.set(H-1,st,0);m.set(H-1,H-1,1),x[0]=0}function ng(H,x,w,m){let M,j,tt,et,st,lt,Tt,vt,Ft,qt,Lt,Zt,le,bt,Wt,ue;for(tt=1;tt<H;tt++)x[tt-1]=x[tt];x[H-1]=0;let we=0,Ae=0,un=Number.EPSILON;for(lt=0;lt<H;lt++){for(Ae=Math.max(Ae,Math.abs(w[lt])+Math.abs(x[lt])),Tt=lt;Tt<H&&!(Math.abs(x[Tt])<=un*Ae);)Tt++;if(Tt>lt)do{for(M=w[lt],vt=(w[lt+1]-M)/(2*x[lt]),Ft=Oi(vt,1),vt<0&&(Ft=-Ft),w[lt]=x[lt]/(vt+Ft),w[lt+1]=x[lt]*(vt+Ft),qt=w[lt+1],j=M-w[lt],tt=lt+2;tt<H;tt++)w[tt]-=j;for(we=we+j,vt=w[Tt],Lt=1,Zt=Lt,le=Lt,bt=x[lt+1],Wt=0,ue=0,tt=Tt-1;tt>=lt;tt--)for(le=Zt,Zt=Lt,ue=Wt,M=Lt*x[tt],j=Lt*vt,Ft=Oi(vt,x[tt]),x[tt+1]=Wt*Ft,Wt=x[tt]/Ft,Lt=vt/Ft,vt=Lt*w[tt]-Wt*M,w[tt+1]=j+Wt*(Lt*M+Wt*w[tt]),st=0;st<H;st++)j=m.get(st,tt+1),m.set(st,tt+1,Wt*m.get(st,tt)+Lt*j),m.set(st,tt,Lt*m.get(st,tt)-Wt*j);vt=-Wt*ue*le*bt*x[lt]/qt,x[lt]=Wt*vt,w[lt]=Lt*vt}while(Math.abs(x[lt])>un*Ae);w[lt]=w[lt]+we,x[lt]=0}for(tt=0;tt<H-1;tt++){for(st=tt,vt=w[tt],et=tt+1;et<H;et++)w[et]<vt&&(st=et,vt=w[et]);if(st!==tt)for(w[st]=w[tt],w[tt]=vt,et=0;et<H;et++)vt=m.get(et,tt),m.set(et,tt,m.get(et,st)),m.set(et,st,vt)}}function gd(H,x,w,m){let M=0,j=H-1,tt,et,st,lt,Tt,vt,Ft;for(vt=M+1;vt<=j-1;vt++){for(Ft=0,lt=vt;lt<=j;lt++)Ft=Ft+Math.abs(x.get(lt,vt-1));if(Ft!==0){for(st=0,lt=j;lt>=vt;lt--)w[lt]=x.get(lt,vt-1)/Ft,st+=w[lt]*w[lt];for(et=Math.sqrt(st),w[vt]>0&&(et=-et),st=st-w[vt]*et,w[vt]=w[vt]-et,Tt=vt;Tt<H;Tt++){for(tt=0,lt=j;lt>=vt;lt--)tt+=w[lt]*x.get(lt,Tt);for(tt=tt/st,lt=vt;lt<=j;lt++)x.set(lt,Tt,x.get(lt,Tt)-tt*w[lt])}for(lt=0;lt<=j;lt++){for(tt=0,Tt=j;Tt>=vt;Tt--)tt+=w[Tt]*x.get(lt,Tt);for(tt=tt/st,Tt=vt;Tt<=j;Tt++)x.set(lt,Tt,x.get(lt,Tt)-tt*w[Tt])}w[vt]=Ft*w[vt],x.set(vt,vt-1,Ft*et)}}for(lt=0;lt<H;lt++)for(Tt=0;Tt<H;Tt++)m.set(lt,Tt,lt===Tt?1:0);for(vt=j-1;vt>=M+1;vt--)if(x.get(vt,vt-1)!==0){for(lt=vt+1;lt<=j;lt++)w[lt]=x.get(lt,vt-1);for(Tt=vt;Tt<=j;Tt++){for(et=0,lt=vt;lt<=j;lt++)et+=w[lt]*m.get(lt,Tt);for(et=et/w[vt]/x.get(vt,vt-1),lt=vt;lt<=j;lt++)m.set(lt,Tt,m.get(lt,Tt)+et*w[lt])}}}function pd(H,x,w,m,M){let j=H-1,tt=0,et=H-1,st=Number.EPSILON,lt=0,Tt=0,vt=0,Ft=0,qt=0,Lt=0,Zt=0,le=0,bt,Wt,ue,we,Ae,un,ge,be,Ze,Mt,Yt,Jt,Ht,fn,$e;for(bt=0;bt<H;bt++)for((bt<tt||bt>et)&&(w[bt]=M.get(bt,bt),x[bt]=0),Wt=Math.max(bt-1,0);Wt<H;Wt++)Tt=Tt+Math.abs(M.get(bt,Wt));for(;j>=tt;){for(we=j;we>tt&&(Lt=Math.abs(M.get(we-1,we-1))+Math.abs(M.get(we,we)),Lt===0&&(Lt=Tt),!(Math.abs(M.get(we,we-1))<st*Lt));)we--;if(we===j)M.set(j,j,M.get(j,j)+lt),w[j]=M.get(j,j),x[j]=0,j--,le=0;else if(we===j-1){if(ge=M.get(j,j-1)*M.get(j-1,j),vt=(M.get(j-1,j-1)-M.get(j,j))/2,Ft=vt*vt+ge,Zt=Math.sqrt(Math.abs(Ft)),M.set(j,j,M.get(j,j)+lt),M.set(j-1,j-1,M.get(j-1,j-1)+lt),be=M.get(j,j),Ft>=0){for(Zt=vt>=0?vt+Zt:vt-Zt,w[j-1]=be+Zt,w[j]=w[j-1],Zt!==0&&(w[j]=be-ge/Zt),x[j-1]=0,x[j]=0,be=M.get(j,j-1),Lt=Math.abs(be)+Math.abs(Zt),vt=be/Lt,Ft=Zt/Lt,qt=Math.sqrt(vt*vt+Ft*Ft),vt=vt/qt,Ft=Ft/qt,Wt=j-1;Wt<H;Wt++)Zt=M.get(j-1,Wt),M.set(j-1,Wt,Ft*Zt+vt*M.get(j,Wt)),M.set(j,Wt,Ft*M.get(j,Wt)-vt*Zt);for(bt=0;bt<=j;bt++)Zt=M.get(bt,j-1),M.set(bt,j-1,Ft*Zt+vt*M.get(bt,j)),M.set(bt,j,Ft*M.get(bt,j)-vt*Zt);for(bt=tt;bt<=et;bt++)Zt=m.get(bt,j-1),m.set(bt,j-1,Ft*Zt+vt*m.get(bt,j)),m.set(bt,j,Ft*m.get(bt,j)-vt*Zt)}else w[j-1]=be+vt,w[j]=be+vt,x[j-1]=Zt,x[j]=-Zt;j=j-2,le=0}else{if(be=M.get(j,j),Ze=0,ge=0,we<j&&(Ze=M.get(j-1,j-1),ge=M.get(j,j-1)*M.get(j-1,j)),le===10){for(lt+=be,bt=tt;bt<=j;bt++)M.set(bt,bt,M.get(bt,bt)-be);Lt=Math.abs(M.get(j,j-1))+Math.abs(M.get(j-1,j-2)),be=Ze=.75*Lt,ge=-.4375*Lt*Lt}if(le===30&&(Lt=(Ze-be)/2,Lt=Lt*Lt+ge,Lt>0)){for(Lt=Math.sqrt(Lt),Ze<be&&(Lt=-Lt),Lt=be-ge/((Ze-be)/2+Lt),bt=tt;bt<=j;bt++)M.set(bt,bt,M.get(bt,bt)-Lt);lt+=Lt,be=Ze=ge=.964}for(le=le+1,Ae=j-2;Ae>=we&&(Zt=M.get(Ae,Ae),qt=be-Zt,Lt=Ze-Zt,vt=(qt*Lt-ge)/M.get(Ae+1,Ae)+M.get(Ae,Ae+1),Ft=M.get(Ae+1,Ae+1)-Zt-qt-Lt,qt=M.get(Ae+2,Ae+1),Lt=Math.abs(vt)+Math.abs(Ft)+Math.abs(qt),vt=vt/Lt,Ft=Ft/Lt,qt=qt/Lt,!(Ae===we||Math.abs(M.get(Ae,Ae-1))*(Math.abs(Ft)+Math.abs(qt))<st*(Math.abs(vt)*(Math.abs(M.get(Ae-1,Ae-1))+Math.abs(Zt)+Math.abs(M.get(Ae+1,Ae+1))))));)Ae--;for(bt=Ae+2;bt<=j;bt++)M.set(bt,bt-2,0),bt>Ae+2&&M.set(bt,bt-3,0);for(ue=Ae;ue<=j-1&&(fn=ue!==j-1,ue!==Ae&&(vt=M.get(ue,ue-1),Ft=M.get(ue+1,ue-1),qt=fn?M.get(ue+2,ue-1):0,be=Math.abs(vt)+Math.abs(Ft)+Math.abs(qt),be!==0&&(vt=vt/be,Ft=Ft/be,qt=qt/be)),be!==0);ue++)if(Lt=Math.sqrt(vt*vt+Ft*Ft+qt*qt),vt<0&&(Lt=-Lt),Lt!==0){for(ue!==Ae?M.set(ue,ue-1,-Lt*be):we!==Ae&&M.set(ue,ue-1,-M.get(ue,ue-1)),vt=vt+Lt,be=vt/Lt,Ze=Ft/Lt,Zt=qt/Lt,Ft=Ft/vt,qt=qt/vt,Wt=ue;Wt<H;Wt++)vt=M.get(ue,Wt)+Ft*M.get(ue+1,Wt),fn&&(vt=vt+qt*M.get(ue+2,Wt),M.set(ue+2,Wt,M.get(ue+2,Wt)-vt*Zt)),M.set(ue,Wt,M.get(ue,Wt)-vt*be),M.set(ue+1,Wt,M.get(ue+1,Wt)-vt*Ze);for(bt=0;bt<=Math.min(j,ue+3);bt++)vt=be*M.get(bt,ue)+Ze*M.get(bt,ue+1),fn&&(vt=vt+Zt*M.get(bt,ue+2),M.set(bt,ue+2,M.get(bt,ue+2)-vt*qt)),M.set(bt,ue,M.get(bt,ue)-vt),M.set(bt,ue+1,M.get(bt,ue+1)-vt*Ft);for(bt=tt;bt<=et;bt++)vt=be*m.get(bt,ue)+Ze*m.get(bt,ue+1),fn&&(vt=vt+Zt*m.get(bt,ue+2),m.set(bt,ue+2,m.get(bt,ue+2)-vt*qt)),m.set(bt,ue,m.get(bt,ue)-vt),m.set(bt,ue+1,m.get(bt,ue+1)-vt*Ft)}}}if(Tt!==0){for(j=H-1;j>=0;j--)if(vt=w[j],Ft=x[j],Ft===0)for(we=j,M.set(j,j,1),bt=j-1;bt>=0;bt--){for(ge=M.get(bt,bt)-vt,qt=0,Wt=we;Wt<=j;Wt++)qt=qt+M.get(bt,Wt)*M.get(Wt,j);if(x[bt]<0)Zt=ge,Lt=qt;else if(we=bt,x[bt]===0?M.set(bt,j,ge!==0?-qt/ge:-qt/(st*Tt)):(be=M.get(bt,bt+1),Ze=M.get(bt+1,bt),Ft=(w[bt]-vt)*(w[bt]-vt)+x[bt]*x[bt],un=(be*Lt-Zt*qt)/Ft,M.set(bt,j,un),M.set(bt+1,j,Math.abs(be)>Math.abs(Zt)?(-qt-ge*un)/be:(-Lt-Ze*un)/Zt)),un=Math.abs(M.get(bt,j)),st*un*un>1)for(Wt=bt;Wt<=j;Wt++)M.set(Wt,j,M.get(Wt,j)/un)}else if(Ft<0)for(we=j-1,Math.abs(M.get(j,j-1))>Math.abs(M.get(j-1,j))?(M.set(j-1,j-1,Ft/M.get(j,j-1)),M.set(j-1,j,-(M.get(j,j)-vt)/M.get(j,j-1))):($e=Zo(0,-M.get(j-1,j),M.get(j-1,j-1)-vt,Ft),M.set(j-1,j-1,$e[0]),M.set(j-1,j,$e[1])),M.set(j,j-1,0),M.set(j,j,1),bt=j-2;bt>=0;bt--){for(Mt=0,Yt=0,Wt=we;Wt<=j;Wt++)Mt=Mt+M.get(bt,Wt)*M.get(Wt,j-1),Yt=Yt+M.get(bt,Wt)*M.get(Wt,j);if(ge=M.get(bt,bt)-vt,x[bt]<0)Zt=ge,qt=Mt,Lt=Yt;else if(we=bt,x[bt]===0?($e=Zo(-Mt,-Yt,ge,Ft),M.set(bt,j-1,$e[0]),M.set(bt,j,$e[1])):(be=M.get(bt,bt+1),Ze=M.get(bt+1,bt),Jt=(w[bt]-vt)*(w[bt]-vt)+x[bt]*x[bt]-Ft*Ft,Ht=(w[bt]-vt)*2*Ft,Jt===0&&Ht===0&&(Jt=st*Tt*(Math.abs(ge)+Math.abs(Ft)+Math.abs(be)+Math.abs(Ze)+Math.abs(Zt))),$e=Zo(be*qt-Zt*Mt+Ft*Yt,be*Lt-Zt*Yt-Ft*Mt,Jt,Ht),M.set(bt,j-1,$e[0]),M.set(bt,j,$e[1]),Math.abs(be)>Math.abs(Zt)+Math.abs(Ft)?(M.set(bt+1,j-1,(-Mt-ge*M.get(bt,j-1)+Ft*M.get(bt,j))/be),M.set(bt+1,j,(-Yt-ge*M.get(bt,j)-Ft*M.get(bt,j-1))/be)):($e=Zo(-qt-Ze*M.get(bt,j-1),-Lt-Ze*M.get(bt,j),Zt,Ft),M.set(bt+1,j-1,$e[0]),M.set(bt+1,j,$e[1]))),un=Math.max(Math.abs(M.get(bt,j-1)),Math.abs(M.get(bt,j))),st*un*un>1)for(Wt=bt;Wt<=j;Wt++)M.set(Wt,j-1,M.get(Wt,j-1)/un),M.set(Wt,j,M.get(Wt,j)/un)}for(bt=0;bt<H;bt++)if(bt<tt||bt>et)for(Wt=bt;Wt<H;Wt++)m.set(bt,Wt,M.get(bt,Wt));for(Wt=H-1;Wt>=tt;Wt--)for(bt=tt;bt<=et;bt++){for(Zt=0,ue=tt;ue<=Math.min(Wt,et);ue++)Zt=Zt+m.get(bt,ue)*M.get(ue,Wt);m.set(bt,Wt,Zt)}}}function Zo(H,x,w,m){let M,j;return Math.abs(w)>Math.abs(m)?(M=m/w,j=w+M*m,[(H+M*x)/j,(x-M*H)/j]):(M=w/m,j=m+M*w,[(M*H+x)/j,(M*x-H)/j])}class md{constructor(x){if(x=An.checkMatrix(x),!x.isSymmetric())throw new Error("Matrix is not symmetric");let w=x,m=w.rows,M=new ne(m,m),j=!0,tt,et,st;for(et=0;et<m;et++){let lt=0;for(st=0;st<et;st++){let Tt=0;for(tt=0;tt<st;tt++)Tt+=M.get(st,tt)*M.get(et,tt);Tt=(w.get(et,st)-Tt)/M.get(st,st),M.set(et,st,Tt),lt=lt+Tt*Tt}for(lt=w.get(et,et)-lt,j&&(j=lt>0),M.set(et,et,Math.sqrt(Math.max(lt,0))),st=et+1;st<m;st++)M.set(et,st,0)}this.L=M,this.positiveDefinite=j}isPositiveDefinite(){return this.positiveDefinite}solve(x){x=An.checkMatrix(x);let w=this.L,m=w.rows;if(x.rows!==m)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");let M=x.columns,j=x.clone(),tt,et,st;for(st=0;st<m;st++)for(et=0;et<M;et++){for(tt=0;tt<st;tt++)j.set(st,et,j.get(st,et)-j.get(tt,et)*w.get(st,tt));j.set(st,et,j.get(st,et)/w.get(st,st))}for(st=m-1;st>=0;st--)for(et=0;et<M;et++){for(tt=st+1;tt<m;tt++)j.set(st,et,j.get(st,et)-j.get(tt,et)*w.get(tt,st));j.set(st,et,j.get(st,et)/w.get(st,st))}return j}get lowerTriangularMatrix(){return this.L}}class Xl{constructor(x,w={}){x=An.checkMatrix(x);let{Y:m}=w;const{scaleScores:M=!1,maxIterations:j=1e3,terminationCriteria:tt=1e-10}=w;let et;if(m){if(rt.isAnyArray(m)&&typeof m[0]=="number"?m=ne.columnVector(m):m=An.checkMatrix(m),m.rows!==x.rows)throw new Error("Y should have the same number of rows as X");et=m.getColumnVector(0)}else et=x.getColumnVector(0);let st=1,lt,Tt,vt,Ft;for(let qt=0;qt<j&&st>tt;qt++)vt=x.transpose().mmul(et).div(et.transpose().mmul(et).get(0,0)),vt=vt.div(vt.norm()),lt=x.mmul(vt).div(vt.transpose().mmul(vt).get(0,0)),qt>0&&(st=lt.clone().sub(Ft).pow(2).sum()),Ft=lt.clone(),m?(Tt=m.transpose().mmul(lt).div(lt.transpose().mmul(lt).get(0,0)),Tt=Tt.div(Tt.norm()),et=m.mmul(Tt).div(Tt.transpose().mmul(Tt).get(0,0))):et=lt;if(m){let qt=x.transpose().mmul(lt).div(lt.transpose().mmul(lt).get(0,0));qt=qt.div(qt.norm());let Lt=x.clone().sub(lt.clone().mmul(qt.transpose())),Zt=et.transpose().mmul(lt).div(lt.transpose().mmul(lt).get(0,0)),le=m.clone().sub(lt.clone().mulS(Zt.get(0,0)).mmul(Tt.transpose()));this.t=lt,this.p=qt.transpose(),this.w=vt.transpose(),this.q=Tt,this.u=et,this.s=lt.transpose().mmul(lt),this.xResidual=Lt,this.yResidual=le,this.betas=Zt}else this.w=vt.transpose(),this.s=lt.transpose().mmul(lt).sqrt(),M?this.t=lt.clone().div(this.s.get(0,0)):this.t=lt,this.xResidual=x.sub(lt.mmul(vt.transpose()))}}Q.XA=re,Q.a_=md,Q.yQ=md,Q.Hs=Yn,Q.Ec=vd,Q.dx=vd,Q.LU=Ui,Q.Rm=Ui,Q.y3=ne,Q.qK=ua,Q.pb=os,Q.j=qs,Q.sO=ha,Q.BZ=ls,Q.EK=Fo,Q.Db=cs,Q.Fx=us,Q.tU=Ai,Q.Ym=Xl,Q.rs=Xl,Q.QR=zo,Q.TB=zo,Q.oH=Oa,Q.Sc=Oa,Q.BN=Rr,Q.it=Ti,Q.$r=An,Q.QM=fd,Q.AV=tg,A=ne,Q.GH=jo,Q.SO=K0,Q.uZ=J0,Q.yU=$0,Q.F1=dd,Q.re=hd},45411:function(U){"use strict";U.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},75196:function(U,Q,S){var A=S(45411),Z=S(81683),B=Object.hasOwnProperty,N=Object.create(null);for(var T in A)B.call(A,T)&&(N[A[T]]=T);var k=U.exports={to:{},get:{}};k.get=function(R){var z=R.substring(0,3).toLowerCase(),D,W;switch(z){case"hsl":D=k.get.hsl(R),W="hsl";break;case"hwb":D=k.get.hwb(R),W="hwb";break;default:D=k.get.rgb(R),W="rgb";break}return D?{model:W,value:D}:null},k.get.rgb=function(R){if(!R)return null;var z=/^#([a-f0-9]{3,4})$/i,D=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,W=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,X=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,K=/^(\w+)$/,rt=[0,0,0,1],nt,q,it;if(nt=R.match(D)){for(it=nt[2],nt=nt[1],q=0;q<3;q++){var at=q*2;rt[q]=parseInt(nt.slice(at,at+2),16)}it&&(rt[3]=parseInt(it,16)/255)}else if(nt=R.match(z)){for(nt=nt[1],it=nt[3],q=0;q<3;q++)rt[q]=parseInt(nt[q]+nt[q],16);it&&(rt[3]=parseInt(it+it,16)/255)}else if(nt=R.match(W)){for(q=0;q<3;q++)rt[q]=parseInt(nt[q+1],0);nt[4]&&(nt[5]?rt[3]=parseFloat(nt[4])*.01:rt[3]=parseFloat(nt[4]))}else if(nt=R.match(X)){for(q=0;q<3;q++)rt[q]=Math.round(parseFloat(nt[q+1])*2.55);nt[4]&&(nt[5]?rt[3]=parseFloat(nt[4])*.01:rt[3]=parseFloat(nt[4]))}else return(nt=R.match(K))?nt[1]==="transparent"?[0,0,0,0]:B.call(A,nt[1])?(rt=A[nt[1]],rt[3]=1,rt):null:null;for(q=0;q<3;q++)rt[q]=_(rt[q],0,255);return rt[3]=_(rt[3],0,1),rt},k.get.hsl=function(R){if(!R)return null;var z=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,D=R.match(z);if(D){var W=parseFloat(D[4]),X=(parseFloat(D[1])%360+360)%360,K=_(parseFloat(D[2]),0,100),rt=_(parseFloat(D[3]),0,100),nt=_(isNaN(W)?1:W,0,1);return[X,K,rt,nt]}return null},k.get.hwb=function(R){if(!R)return null;var z=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,D=R.match(z);if(D){var W=parseFloat(D[4]),X=(parseFloat(D[1])%360+360)%360,K=_(parseFloat(D[2]),0,100),rt=_(parseFloat(D[3]),0,100),nt=_(isNaN(W)?1:W,0,1);return[X,K,rt,nt]}return null},k.to.hex=function(){var R=Z(arguments);return"#"+C(R[0])+C(R[1])+C(R[2])+(R[3]<1?C(Math.round(R[3]*255)):"")},k.to.rgb=function(){var R=Z(arguments);return R.length<4||R[3]===1?"rgb("+Math.round(R[0])+", "+Math.round(R[1])+", "+Math.round(R[2])+")":"rgba("+Math.round(R[0])+", "+Math.round(R[1])+", "+Math.round(R[2])+", "+R[3]+")"},k.to.rgb.percent=function(){var R=Z(arguments),z=Math.round(R[0]/255*100),D=Math.round(R[1]/255*100),W=Math.round(R[2]/255*100);return R.length<4||R[3]===1?"rgb("+z+"%, "+D+"%, "+W+"%)":"rgba("+z+"%, "+D+"%, "+W+"%, "+R[3]+")"},k.to.hsl=function(){var R=Z(arguments);return R.length<4||R[3]===1?"hsl("+R[0]+", "+R[1]+"%, "+R[2]+"%)":"hsla("+R[0]+", "+R[1]+"%, "+R[2]+"%, "+R[3]+")"},k.to.hwb=function(){var R=Z(arguments),z="";return R.length>=4&&R[3]!==1&&(z=", "+R[3]),"hwb("+R[0]+", "+R[1]+"%, "+R[2]+"%"+z+")"},k.to.keyword=function(R){return N[R.slice(0,3)]};function _(R,z,D){return Math.min(Math.max(z,R),D)}function C(R){var z=Math.round(R).toString(16).toUpperCase();return z.length<2?"0"+z:z}},92546:function(U,Q,S){U.exports={graphlib:S(76626),layout:S(47194),debug:S(11303),util:{time:S(53063).time,notime:S(53063).notime},version:S(11897)}},81255:function(U,Q,S){"use strict";var A=S(72361),Z=S(39240);U.exports={run:B,undo:T};function B(k){var _=k.graph().acyclicer==="greedy"?Z(k,C(k)):N(k);A.forEach(_,function(R){var z=k.edge(R);k.removeEdge(R),z.forwardName=R.name,z.reversed=!0,k.setEdge(R.w,R.v,z,A.uniqueId("rev"))});function C(R){return function(z){return R.edge(z).weight}}}function N(k){var _=[],C={},R={};function z(D){A.has(R,D)||(R[D]=!0,C[D]=!0,A.forEach(k.outEdges(D),function(W){A.has(C,W.w)?_.push(W):z(W.w)}),delete C[D])}return A.forEach(k.nodes(),z),_}function T(k){A.forEach(k.edges(),function(_){var C=k.edge(_);if(C.reversed){k.removeEdge(_);var R=C.forwardName;delete C.reversed,delete C.forwardName,k.setEdge(_.w,_.v,C,R)}})}},60765:function(U,Q,S){var A=S(72361),Z=S(53063);U.exports=B;function B(T){function k(_){var C=T.children(_),R=T.node(_);if(C.length&&A.forEach(C,k),A.has(R,"minRank")){R.borderLeft=[],R.borderRight=[];for(var z=R.minRank,D=R.maxRank+1;z<D;++z)N(T,"borderLeft","_bl",_,R,z),N(T,"borderRight","_br",_,R,z)}}A.forEach(T.children(),k)}function N(T,k,_,C,R,z){var D={width:0,height:0,rank:z,borderType:k},W=R[k][z-1],X=Z.addDummyNode(T,"border",D,_);R[k][z]=X,T.setParent(X,C),W&&T.setEdge(W,X,{weight:1})}},13257:function(U,Q,S){"use strict";var A=S(72361);U.exports={adjust:Z,undo:B};function Z(z){var D=z.graph().rankdir.toLowerCase();(D==="lr"||D==="rl")&&N(z)}function B(z){var D=z.graph().rankdir.toLowerCase();(D==="bt"||D==="rl")&&k(z),(D==="lr"||D==="rl")&&(C(z),N(z))}function N(z){A.forEach(z.nodes(),function(D){T(z.node(D))}),A.forEach(z.edges(),function(D){T(z.edge(D))})}function T(z){var D=z.width;z.width=z.height,z.height=D}function k(z){A.forEach(z.nodes(),function(D){_(z.node(D))}),A.forEach(z.edges(),function(D){var W=z.edge(D);A.forEach(W.points,_),A.has(W,"y")&&_(W)})}function _(z){z.y=-z.y}function C(z){A.forEach(z.nodes(),function(D){R(z.node(D))}),A.forEach(z.edges(),function(D){var W=z.edge(D);A.forEach(W.points,R),A.has(W,"x")&&R(W)})}function R(z){var D=z.x;z.x=z.y,z.y=D}},21135:function(U){U.exports=Q;function Q(){var Z={};Z._next=Z._prev=Z,this._sentinel=Z}Q.prototype.dequeue=function(){var Z=this._sentinel,B=Z._prev;if(B!==Z)return S(B),B},Q.prototype.enqueue=function(Z){var B=this._sentinel;Z._prev&&Z._next&&S(Z),Z._next=B._next,B._next._prev=Z,B._next=Z,Z._prev=B},Q.prototype.toString=function(){for(var Z=[],B=this._sentinel,N=B._prev;N!==B;)Z.push(JSON.stringify(N,A)),N=N._prev;return"["+Z.join(", ")+"]"};function S(Z){Z._prev._next=Z._next,Z._next._prev=Z._prev,delete Z._next,delete Z._prev}function A(Z,B){if(Z!=="_next"&&Z!=="_prev")return B}},11303:function(U,Q,S){var A=S(72361),Z=S(53063),B=S(76626).Graph;U.exports={debugOrdering:N};function N(T){var k=Z.buildLayerMatrix(T),_=new B({compound:!0,multigraph:!0}).setGraph({});return A.forEach(T.nodes(),function(C){_.setNode(C,{label:C}),_.setParent(C,"layer"+T.node(C).rank)}),A.forEach(T.edges(),function(C){_.setEdge(C.v,C.w,{},C.name)}),A.forEach(k,function(C,R){var z="layer"+R;_.setNode(z,{rank:"same"}),A.reduce(C,function(D,W){return _.setEdge(D,W,{style:"invis"}),W})}),_}},76626:function(U,Q,S){var A;try{A=S(75172)}catch(Z){}A||(A=window.graphlib),U.exports=A},39240:function(U,Q,S){var A=S(72361),Z=S(76626).Graph,B=S(21135);U.exports=T;var N=A.constant(1);function T(z,D){if(z.nodeCount()<=1)return[];var W=C(z,D||N),X=k(W.graph,W.buckets,W.zeroIdx);return A.flatten(A.map(X,function(K){return z.outEdges(K.v,K.w)}),!0)}function k(z,D,W){for(var X=[],K=D[D.length-1],rt=D[0],nt;z.nodeCount();){for(;nt=rt.dequeue();)_(z,D,W,nt);for(;nt=K.dequeue();)_(z,D,W,nt);if(z.nodeCount()){for(var q=D.length-2;q>0;--q)if(nt=D[q].dequeue(),nt){X=X.concat(_(z,D,W,nt,!0));break}}}return X}function _(z,D,W,X,K){var rt=K?[]:void 0;return A.forEach(z.inEdges(X.v),function(nt){var q=z.edge(nt),it=z.node(nt.v);K&&rt.push({v:nt.v,w:nt.w}),it.out-=q,R(D,W,it)}),A.forEach(z.outEdges(X.v),function(nt){var q=z.edge(nt),it=nt.w,at=z.node(it);at.in-=q,R(D,W,at)}),z.removeNode(X.v),rt}function C(z,D){var W=new Z,X=0,K=0;A.forEach(z.nodes(),function(q){W.setNode(q,{v:q,in:0,out:0})}),A.forEach(z.edges(),function(q){var it=W.edge(q.v,q.w)||0,at=D(q),ut=it+at;W.setEdge(q.v,q.w,ut),K=Math.max(K,W.node(q.v).out+=at),X=Math.max(X,W.node(q.w).in+=at)});var rt=A.range(K+X+3).map(function(){return new B}),nt=X+1;return A.forEach(W.nodes(),function(q){R(rt,nt,W.node(q))}),{graph:W,buckets:rt,zeroIdx:nt}}function R(z,D,W){W.out?W.in?z[W.out-W.in+D].enqueue(W):z[z.length-1].enqueue(W):z[0].enqueue(W)}},47194:function(U,Q,S){"use strict";var A=S(72361),Z=S(81255),B=S(27163),N=S(64505),T=S(53063).normalizeRanks,k=S(71970),_=S(53063).removeEmptyRanks,C=S(31733),R=S(60765),z=S(13257),D=S(62852),W=S(93021),X=S(53063),K=S(76626).Graph;U.exports=rt;function rt(dt,St){var Ct=St&&St.debugTiming?X.time:X.notime;Ct("layout",function(){var Gt=Ct(" buildLayoutGraph",function(){return Et(dt)});Ct(" runLayout",function(){nt(Gt,Ct)}),Ct(" updateInputGraph",function(){q(dt,Gt)})})}function nt(dt,St){St(" makeSpaceForEdgeLabels",function(){kt(dt)}),St(" removeSelfEdges",function(){la(dt)}),St(" acyclic",function(){Z.run(dt)}),St(" nestingGraph.run",function(){C.run(dt)}),St(" rank",function(){N(X.asNonCompoundGraph(dt))}),St(" injectEdgeLabelProxies",function(){zt(dt)}),St(" removeEmptyRanks",function(){_(dt)}),St(" nestingGraph.cleanup",function(){C.cleanup(dt)}),St(" normalizeRanks",function(){T(dt)}),St(" assignRankMinMax",function(){Ut(dt)}),St(" removeEdgeLabelProxies",function(){Qt(dt)}),St(" normalize.run",function(){B.run(dt)}),St(" parentDummyChains",function(){k(dt)}),St(" addBorderSegments",function(){R(dt)}),St(" order",function(){D(dt)}),St(" insertSelfEdges",function(){as(dt)}),St(" adjustCoordinateSystem",function(){z.adjust(dt)}),St(" position",function(){W(dt)}),St(" positionSelfEdges",function(){Pt(dt)}),St(" removeBorderNodes",function(){$r(dt)}),St(" normalize.undo",function(){B.undo(dt)}),St(" fixupEdgeLabelCoords",function(){tn(dt)}),St(" undoCoordinateSystem",function(){z.undo(dt)}),St(" translateGraph",function(){Ee(dt)}),St(" assignNodeIntersects",function(){Le(dt)}),St(" reversePoints",function(){er(dt)}),St(" acyclic.undo",function(){Z.undo(dt)})}function q(dt,St){A.forEach(dt.nodes(),function(Ct){var Gt=dt.node(Ct),oe=St.node(Ct);Gt&&(Gt.x=oe.x,Gt.y=oe.y,St.children(Ct).length&&(Gt.width=oe.width,Gt.height=oe.height))}),A.forEach(dt.edges(),function(Ct){var Gt=dt.edge(Ct),oe=St.edge(Ct);Gt.points=oe.points,A.has(oe,"x")&&(Gt.x=oe.x,Gt.y=oe.y)}),dt.graph().width=St.graph().width,dt.graph().height=St.graph().height}var it=["nodesep","edgesep","ranksep","marginx","marginy"],at={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ut=["acyclicer","ranker","rankdir","align"],ht=["width","height"],xt={width:0,height:0},pt=["minlen","weight","width","height","labeloffset"],wt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},gt=["labelpos"];function Et(dt){var St=new K({multigraph:!0,compound:!0}),Ct=It(dt.graph());return St.setGraph(A.merge({},at,_t(Ct,it),A.pick(Ct,ut))),A.forEach(dt.nodes(),function(Gt){var oe=It(dt.node(Gt));St.setNode(Gt,A.defaults(_t(oe,ht),xt)),St.setParent(Gt,dt.parent(Gt))}),A.forEach(dt.edges(),function(Gt){var oe=It(dt.edge(Gt));St.setEdge(Gt,A.merge({},wt,_t(oe,pt),A.pick(oe,gt)))}),St}function kt(dt){var St=dt.graph();St.ranksep/=2,A.forEach(dt.edges(),function(Ct){var Gt=dt.edge(Ct);Gt.minlen*=2,Gt.labelpos.toLowerCase()!=="c"&&(St.rankdir==="TB"||St.rankdir==="BT"?Gt.width+=Gt.labeloffset:Gt.height+=Gt.labeloffset)})}function zt(dt){A.forEach(dt.edges(),function(St){var Ct=dt.edge(St);if(Ct.width&&Ct.height){var Gt=dt.node(St.v),oe=dt.node(St.w),ye={rank:(oe.rank-Gt.rank)/2+Gt.rank,e:St};X.addDummyNode(dt,"edge-proxy",ye,"_ep")}})}function Ut(dt){var St=0;A.forEach(dt.nodes(),function(Ct){var Gt=dt.node(Ct);Gt.borderTop&&(Gt.minRank=dt.node(Gt.borderTop).rank,Gt.maxRank=dt.node(Gt.borderBottom).rank,St=A.max(St,Gt.maxRank))}),dt.graph().maxRank=St}function Qt(dt){A.forEach(dt.nodes(),function(St){var Ct=dt.node(St);Ct.dummy==="edge-proxy"&&(dt.edge(Ct.e).labelRank=Ct.rank,dt.removeNode(St))})}function Ee(dt){var St=Number.POSITIVE_INFINITY,Ct=0,Gt=Number.POSITIVE_INFINITY,oe=0,ye=dt.graph(),de=ye.marginx||0,_e=ye.marginy||0;function Mn(Nn){var Pe=Nn.x,Se=Nn.y,re=Nn.width,Oe=Nn.height;St=Math.min(St,Pe-re/2),Ct=Math.max(Ct,Pe+re/2),Gt=Math.min(Gt,Se-Oe/2),oe=Math.max(oe,Se+Oe/2)}A.forEach(dt.nodes(),function(Nn){Mn(dt.node(Nn))}),A.forEach(dt.edges(),function(Nn){var Pe=dt.edge(Nn);A.has(Pe,"x")&&Mn(Pe)}),St-=de,Gt-=_e,A.forEach(dt.nodes(),function(Nn){var Pe=dt.node(Nn);Pe.x-=St,Pe.y-=Gt}),A.forEach(dt.edges(),function(Nn){var Pe=dt.edge(Nn);A.forEach(Pe.points,function(Se){Se.x-=St,Se.y-=Gt}),A.has(Pe,"x")&&(Pe.x-=St),A.has(Pe,"y")&&(Pe.y-=Gt)}),ye.width=Ct-St+de,ye.height=oe-Gt+_e}function Le(dt){A.forEach(dt.edges(),function(St){var Ct=dt.edge(St),Gt=dt.node(St.v),oe=dt.node(St.w),ye,de;Ct.points?(ye=Ct.points[0],de=Ct.points[Ct.points.length-1]):(Ct.points=[],ye=oe,de=Gt),Ct.points.unshift(X.intersectRect(Gt,ye)),Ct.points.push(X.intersectRect(oe,de))})}function tn(dt){A.forEach(dt.edges(),function(St){var Ct=dt.edge(St);if(A.has(Ct,"x"))switch((Ct.labelpos==="l"||Ct.labelpos==="r")&&(Ct.width-=Ct.labeloffset),Ct.labelpos){case"l":Ct.x-=Ct.width/2+Ct.labeloffset;break;case"r":Ct.x+=Ct.width/2+Ct.labeloffset;break}})}function er(dt){A.forEach(dt.edges(),function(St){var Ct=dt.edge(St);Ct.reversed&&Ct.points.reverse()})}function $r(dt){A.forEach(dt.nodes(),function(St){if(dt.children(St).length){var Ct=dt.node(St),Gt=dt.node(Ct.borderTop),oe=dt.node(Ct.borderBottom),ye=dt.node(A.last(Ct.borderLeft)),de=dt.node(A.last(Ct.borderRight));Ct.width=Math.abs(de.x-ye.x),Ct.height=Math.abs(oe.y-Gt.y),Ct.x=ye.x+Ct.width/2,Ct.y=Gt.y+Ct.height/2}}),A.forEach(dt.nodes(),function(St){dt.node(St).dummy==="border"&&dt.removeNode(St)})}function la(dt){A.forEach(dt.edges(),function(St){if(St.v===St.w){var Ct=dt.node(St.v);Ct.selfEdges||(Ct.selfEdges=[]),Ct.selfEdges.push({e:St,label:dt.edge(St)}),dt.removeEdge(St)}})}function as(dt){var St=X.buildLayerMatrix(dt);A.forEach(St,function(Ct){var Gt=0;A.forEach(Ct,function(oe,ye){var de=dt.node(oe);de.order=ye+Gt,A.forEach(de.selfEdges,function(_e){X.addDummyNode(dt,"selfedge",{width:_e.label.width,height:_e.label.height,rank:de.rank,order:ye+ ++Gt,e:_e.e,label:_e.label},"_se")}),delete de.selfEdges})})}function Pt(dt){A.forEach(dt.nodes(),function(St){var Ct=dt.node(St);if(Ct.dummy==="selfedge"){var Gt=dt.node(Ct.e.v),oe=Gt.x+Gt.width/2,ye=Gt.y,de=Ct.x-oe,_e=Gt.height/2;dt.setEdge(Ct.e,Ct.label),dt.removeNode(St),Ct.label.points=[{x:oe+2*de/3,y:ye-_e},{x:oe+5*de/6,y:ye-_e},{x:oe+de,y:ye},{x:oe+5*de/6,y:ye+_e},{x:oe+2*de/3,y:ye+_e}],Ct.label.x=Ct.x,Ct.label.y=Ct.y}})}function _t(dt,St){return A.mapValues(A.pick(dt,St),Number)}function It(dt){var St={};return A.forEach(dt,function(Ct,Gt){St[Gt.toLowerCase()]=Ct}),St}},72361:function(U,Q,S){var A;try{A={cloneDeep:S(20250),constant:S(13503),defaults:S(28548),each:S(76934),filter:S(64725),find:S(79785),flatten:S(39807),forEach:S(99204),forIn:S(23190),has:S(99946),isUndefined:S(16513),last:S(10611),map:S(9924),mapValues:S(70642),max:S(95987),merge:S(28440),min:S(80991),minBy:S(83296),now:S(5795),pick:S(89409),range:S(60859),reduce:S(16473),sortBy:S(351),uniqueId:S(95708),values:S(81229),zipObject:S(65441)}}catch(Z){}A||(A=window._),U.exports=A},31733:function(U,Q,S){var A=S(72361),Z=S(53063);U.exports={run:B,cleanup:_};function B(C){var R=Z.addDummyNode(C,"root",{},"_root"),z=T(C),D=A.max(A.values(z))-1,W=2*D+1;C.graph().nestingRoot=R,A.forEach(C.edges(),function(K){C.edge(K).minlen*=W});var X=k(C)+1;A.forEach(C.children(),function(K){N(C,R,W,X,D,z,K)}),C.graph().nodeRankFactor=W}function N(C,R,z,D,W,X,K){var rt=C.children(K);if(!rt.length){K!==R&&C.setEdge(R,K,{weight:0,minlen:z});return}var nt=Z.addBorderNode(C,"_bt"),q=Z.addBorderNode(C,"_bb"),it=C.node(K);C.setParent(nt,K),it.borderTop=nt,C.setParent(q,K),it.borderBottom=q,A.forEach(rt,function(at){N(C,R,z,D,W,X,at);var ut=C.node(at),ht=ut.borderTop?ut.borderTop:at,xt=ut.borderBottom?ut.borderBottom:at,pt=ut.borderTop?D:2*D,wt=ht!==xt?1:W-X[K]+1;C.setEdge(nt,ht,{weight:pt,minlen:wt,nestingEdge:!0}),C.setEdge(xt,q,{weight:pt,minlen:wt,nestingEdge:!0})}),C.parent(K)||C.setEdge(R,nt,{weight:0,minlen:W+X[K]})}function T(C){var R={};function z(D,W){var X=C.children(D);X&&X.length&&A.forEach(X,function(K){z(K,W+1)}),R[D]=W}return A.forEach(C.children(),function(D){z(D,1)}),R}function k(C){return A.reduce(C.edges(),function(R,z){return R+C.edge(z).weight},0)}function _(C){var R=C.graph();C.removeNode(R.nestingRoot),delete R.nestingRoot,A.forEach(C.edges(),function(z){var D=C.edge(z);D.nestingEdge&&C.removeEdge(z)})}},27163:function(U,Q,S){"use strict";var A=S(72361),Z=S(53063);U.exports={run:B,undo:T};function B(k){k.graph().dummyChains=[],A.forEach(k.edges(),function(_){N(k,_)})}function N(k,_){var C=_.v,R=k.node(C).rank,z=_.w,D=k.node(z).rank,W=_.name,X=k.edge(_),K=X.labelRank;if(D!==R+1){k.removeEdge(_);var rt,nt,q;for(q=0,++R;R<D;++q,++R)X.points=[],nt={width:0,height:0,edgeLabel:X,edgeObj:_,rank:R},rt=Z.addDummyNode(k,"edge",nt,"_d"),R===K&&(nt.width=X.width,nt.height=X.height,nt.dummy="edge-label",nt.labelpos=X.labelpos),k.setEdge(C,rt,{weight:X.weight},W),q===0&&k.graph().dummyChains.push(rt),C=rt;k.setEdge(C,z,{weight:X.weight},W)}}function T(k){A.forEach(k.graph().dummyChains,function(_){var C=k.node(_),R=C.edgeLabel,z;for(k.setEdge(C.edgeObj,R);C.dummy;)z=k.successors(_)[0],k.removeNode(_),R.points.push({x:C.x,y:C.y}),C.dummy==="edge-label"&&(R.x=C.x,R.y=C.y,R.width=C.width,R.height=C.height),_=z,C=k.node(_)})}},52205:function(U,Q,S){var A=S(72361);U.exports=Z;function Z(B,N,T){var k={},_;A.forEach(T,function(C){for(var R=B.parent(C),z,D;R;){if(z=B.parent(R),z?(D=k[z],k[z]=R):(D=_,_=R),D&&D!==R){N.setEdge(D,R);return}R=z}})}},99506:function(U,Q,S){var A=S(72361);U.exports=Z;function Z(B,N){return A.map(N,function(T){var k=B.inEdges(T);if(k.length){var _=A.reduce(k,function(C,R){var z=B.edge(R),D=B.node(R.v);return{sum:C.sum+z.weight*D.order,weight:C.weight+z.weight}},{sum:0,weight:0});return{v:T,barycenter:_.sum/_.weight,weight:_.weight}}else return{v:T}})}},59105:function(U,Q,S){var A=S(72361),Z=S(76626).Graph;U.exports=B;function B(T,k,_){var C=N(T),R=new Z({compound:!0}).setGraph({root:C}).setDefaultNodeLabel(function(z){return T.node(z)});return A.forEach(T.nodes(),function(z){var D=T.node(z),W=T.parent(z);(D.rank===k||D.minRank<=k&&k<=D.maxRank)&&(R.setNode(z),R.setParent(z,W||C),A.forEach(T[_](z),function(X){var K=X.v===z?X.w:X.v,rt=R.edge(K,z),nt=A.isUndefined(rt)?0:rt.weight;R.setEdge(K,z,{weight:T.edge(X).weight+nt})}),A.has(D,"minRank")&&R.setNode(z,{borderLeft:D.borderLeft[k],borderRight:D.borderRight[k]}))}),R}function N(T){for(var k;T.hasNode(k=A.uniqueId("_root")););return k}},45456:function(U,Q,S){"use strict";var A=S(72361);U.exports=Z;function Z(N,T){for(var k=0,_=1;_<T.length;++_)k+=B(N,T[_-1],T[_]);return k}function B(N,T,k){for(var _=A.zipObject(k,A.map(k,function(X,K){return K})),C=A.flatten(A.map(T,function(X){return A.sortBy(A.map(N.outEdges(X),function(K){return{pos:_[K.w],weight:N.edge(K).weight}}),"pos")}),!0),R=1;R<k.length;)R<<=1;var z=2*R-1;R-=1;var D=A.map(new Array(z),function(){return 0}),W=0;return A.forEach(C.forEach(function(X){var K=X.pos+R;D[K]+=X.weight;for(var rt=0;K>0;)K%2&&(rt+=D[K+1]),K=K-1>>1,D[K]+=X.weight;W+=X.weight*rt})),W}},62852:function(U,Q,S){"use strict";var A=S(72361),Z=S(18043),B=S(45456),N=S(86490),T=S(59105),k=S(52205),_=S(76626).Graph,C=S(53063);U.exports=R;function R(X){var K=C.maxRank(X),rt=z(X,A.range(1,K+1),"inEdges"),nt=z(X,A.range(K-1,-1,-1),"outEdges"),q=Z(X);W(X,q);for(var it=Number.POSITIVE_INFINITY,at,ut=0,ht=0;ht<4;++ut,++ht){D(ut%2?rt:nt,ut%4>=2),q=C.buildLayerMatrix(X);var xt=B(X,q);xt<it&&(ht=0,at=A.cloneDeep(q),it=xt)}W(X,at)}function z(X,K,rt){return A.map(K,function(nt){return T(X,nt,rt)})}function D(X,K){var rt=new _;A.forEach(X,function(nt){var q=nt.graph().root,it=N(nt,q,rt,K);A.forEach(it.vs,function(at,ut){nt.node(at).order=ut}),k(nt,rt,it.vs)})}function W(X,K){A.forEach(K,function(rt){A.forEach(rt,function(nt,q){X.node(nt).order=q})})}},18043:function(U,Q,S){"use strict";var A=S(72361);U.exports=Z;function Z(B){var N={},T=A.filter(B.nodes(),function(z){return!B.children(z).length}),k=A.max(A.map(T,function(z){return B.node(z).rank})),_=A.map(A.range(k+1),function(){return[]});function C(z){if(!A.has(N,z)){N[z]=!0;var D=B.node(z);_[D.rank].push(z),A.forEach(B.successors(z),C)}}var R=A.sortBy(T,function(z){return B.node(z).rank});return A.forEach(R,C),_}},45926:function(U,Q,S){"use strict";var A=S(72361);U.exports=Z;function Z(T,k){var _={};A.forEach(T,function(R,z){var D=_[R.v]={indegree:0,in:[],out:[],vs:[R.v],i:z};A.isUndefined(R.barycenter)||(D.barycenter=R.barycenter,D.weight=R.weight)}),A.forEach(k.edges(),function(R){var z=_[R.v],D=_[R.w];!A.isUndefined(z)&&!A.isUndefined(D)&&(D.indegree++,z.out.push(_[R.w]))});var C=A.filter(_,function(R){return!R.indegree});return B(C)}function B(T){var k=[];function _(z){return function(D){D.merged||(A.isUndefined(D.barycenter)||A.isUndefined(z.barycenter)||D.barycenter>=z.barycenter)&&N(z,D)}}function C(z){return function(D){D.in.push(z),--D.indegree===0&&T.push(D)}}for(;T.length;){var R=T.pop();k.push(R),A.forEach(R.in.reverse(),_(R)),A.forEach(R.out,C(R))}return A.map(A.filter(k,function(z){return!z.merged}),function(z){return A.pick(z,["vs","i","barycenter","weight"])})}function N(T,k){var _=0,C=0;T.weight&&(_+=T.barycenter*T.weight,C+=T.weight),k.weight&&(_+=k.barycenter*k.weight,C+=k.weight),T.vs=k.vs.concat(T.vs),T.barycenter=_/C,T.weight=C,T.i=Math.min(k.i,T.i),k.merged=!0}},86490:function(U,Q,S){var A=S(72361),Z=S(99506),B=S(45926),N=S(1349);U.exports=T;function T(C,R,z,D){var W=C.children(R),X=C.node(R),K=X?X.borderLeft:void 0,rt=X?X.borderRight:void 0,nt={};K&&(W=A.filter(W,function(xt){return xt!==K&&xt!==rt}));var q=Z(C,W);A.forEach(q,function(xt){if(C.children(xt.v).length){var pt=T(C,xt.v,z,D);nt[xt.v]=pt,A.has(pt,"barycenter")&&_(xt,pt)}});var it=B(q,z);k(it,nt);var at=N(it,D);if(K&&(at.vs=A.flatten([K,at.vs,rt],!0),C.predecessors(K).length)){var ut=C.node(C.predecessors(K)[0]),ht=C.node(C.predecessors(rt)[0]);A.has(at,"barycenter")||(at.barycenter=0,at.weight=0),at.barycenter=(at.barycenter*at.weight+ut.order+ht.order)/(at.weight+2),at.weight+=2}return at}function k(C,R){A.forEach(C,function(z){z.vs=A.flatten(z.vs.map(function(D){return R[D]?R[D].vs:D}),!0)})}function _(C,R){A.isUndefined(C.barycenter)?(C.barycenter=R.barycenter,C.weight=R.weight):(C.barycenter=(C.barycenter*C.weight+R.barycenter*R.weight)/(C.weight+R.weight),C.weight+=R.weight)}},1349:function(U,Q,S){var A=S(72361),Z=S(53063);U.exports=B;function B(k,_){var C=Z.partition(k,function(nt){return A.has(nt,"barycenter")}),R=C.lhs,z=A.sortBy(C.rhs,function(nt){return-nt.i}),D=[],W=0,X=0,K=0;R.sort(T(!!_)),K=N(D,z,K),A.forEach(R,function(nt){K+=nt.vs.length,D.push(nt.vs),W+=nt.barycenter*nt.weight,X+=nt.weight,K=N(D,z,K)});var rt={vs:A.flatten(D,!0)};return X&&(rt.barycenter=W/X,rt.weight=X),rt}function N(k,_,C){for(var R;_.length&&(R=A.last(_)).i<=C;)_.pop(),k.push(R.vs),C++;return C}function T(k){return function(_,C){return _.barycenter<C.barycenter?-1:_.barycenter>C.barycenter?1:k?C.i-_.i:_.i-C.i}}},71970:function(U,Q,S){var A=S(72361);U.exports=Z;function Z(T){var k=N(T);A.forEach(T.graph().dummyChains,function(_){for(var C=T.node(_),R=C.edgeObj,z=B(T,k,R.v,R.w),D=z.path,W=z.lca,X=0,K=D[X],rt=!0;_!==R.w;){if(C=T.node(_),rt){for(;(K=D[X])!==W&&T.node(K).maxRank<C.rank;)X++;K===W&&(rt=!1)}if(!rt){for(;X<D.length-1&&T.node(K=D[X+1]).minRank<=C.rank;)X++;K=D[X]}T.setParent(_,K),_=T.successors(_)[0]}})}function B(T,k,_,C){var R=[],z=[],D=Math.min(k[_].low,k[C].low),W=Math.max(k[_].lim,k[C].lim),X,K;X=_;do X=T.parent(X),R.push(X);while(X&&(k[X].low>D||W>k[X].lim));for(K=X,X=C;(X=T.parent(X))!==K;)z.push(X);return{path:R.concat(z.reverse()),lca:K}}function N(T){var k={},_=0;function C(R){var z=_;A.forEach(T.children(R),C),k[R]={low:z,lim:_++}}return A.forEach(T.children(),C),k}},92080:function(U,Q,S){"use strict";var A=S(72361),Z=S(76626).Graph,B=S(53063);U.exports={positionX:rt,findType1Conflicts:N,findType2Conflicts:T,addConflict:_,hasConflict:C,verticalAlignment:R,horizontalCompaction:z,alignCoordinates:X,findSmallestWidthAlignment:W,balance:K};function N(it,at){var ut={};function ht(xt,pt){var wt=0,gt=0,Et=xt.length,kt=A.last(pt);return A.forEach(pt,function(zt,Ut){var Qt=k(it,zt),Ee=Qt?it.node(Qt).order:Et;(Qt||zt===kt)&&(A.forEach(pt.slice(gt,Ut+1),function(Le){A.forEach(it.predecessors(Le),function(tn){var er=it.node(tn),$r=er.order;($r<wt||Ee<$r)&&!(er.dummy&&it.node(Le).dummy)&&_(ut,tn,Le)})}),gt=Ut+1,wt=Ee)}),pt}return A.reduce(at,ht),ut}function T(it,at){var ut={};function ht(pt,wt,gt,Et,kt){var zt;A.forEach(A.range(wt,gt),function(Ut){zt=pt[Ut],it.node(zt).dummy&&A.forEach(it.predecessors(zt),function(Qt){var Ee=it.node(Qt);Ee.dummy&&(Ee.order<Et||Ee.order>kt)&&_(ut,Qt,zt)})})}function xt(pt,wt){var gt=-1,Et,kt=0;return A.forEach(wt,function(zt,Ut){if(it.node(zt).dummy==="border"){var Qt=it.predecessors(zt);Qt.length&&(Et=it.node(Qt[0]).order,ht(wt,kt,Ut,gt,Et),kt=Ut,gt=Et)}ht(wt,kt,wt.length,Et,pt.length)}),wt}return A.reduce(at,xt),ut}function k(it,at){if(it.node(at).dummy)return A.find(it.predecessors(at),function(ut){return it.node(ut).dummy})}function _(it,at,ut){if(at>ut){var ht=at;at=ut,ut=ht}var xt=it[at];xt||(it[at]=xt={}),xt[ut]=!0}function C(it,at,ut){if(at>ut){var ht=at;at=ut,ut=ht}return A.has(it[at],ut)}function R(it,at,ut,ht){var xt={},pt={},wt={};return A.forEach(at,function(gt){A.forEach(gt,function(Et,kt){xt[Et]=Et,pt[Et]=Et,wt[Et]=kt})}),A.forEach(at,function(gt){var Et=-1;A.forEach(gt,function(kt){var zt=ht(kt);if(zt.length){zt=A.sortBy(zt,function(tn){return wt[tn]});for(var Ut=(zt.length-1)/2,Qt=Math.floor(Ut),Ee=Math.ceil(Ut);Qt<=Ee;++Qt){var Le=zt[Qt];pt[kt]===kt&&Et<wt[Le]&&!C(ut,kt,Le)&&(pt[Le]=kt,pt[kt]=xt[kt]=xt[Le],Et=wt[Le])}}})}),{root:xt,align:pt}}function z(it,at,ut,ht,xt){var pt={},wt=D(it,at,ut,xt),gt=xt?"borderLeft":"borderRight";function Et(Ut,Qt){for(var Ee=wt.nodes(),Le=Ee.pop(),tn={};Le;)tn[Le]?Ut(Le):(tn[Le]=!0,Ee.push(Le),Ee=Ee.concat(Qt(Le))),Le=Ee.pop()}function kt(Ut){pt[Ut]=wt.inEdges(Ut).reduce(function(Qt,Ee){return Math.max(Qt,pt[Ee.v]+wt.edge(Ee))},0)}function zt(Ut){var Qt=wt.outEdges(Ut).reduce(function(Le,tn){return Math.min(Le,pt[tn.w]-wt.edge(tn))},Number.POSITIVE_INFINITY),Ee=it.node(Ut);Qt!==Number.POSITIVE_INFINITY&&Ee.borderType!==gt&&(pt[Ut]=Math.max(pt[Ut],Qt))}return Et(kt,wt.predecessors.bind(wt)),Et(zt,wt.successors.bind(wt)),A.forEach(ht,function(Ut){pt[Ut]=pt[ut[Ut]]}),pt}function D(it,at,ut,ht){var xt=new Z,pt=it.graph(),wt=nt(pt.nodesep,pt.edgesep,ht);return A.forEach(at,function(gt){var Et;A.forEach(gt,function(kt){var zt=ut[kt];if(xt.setNode(zt),Et){var Ut=ut[Et],Qt=xt.edge(Ut,zt);xt.setEdge(Ut,zt,Math.max(wt(it,kt,Et),Qt||0))}Et=kt})}),xt}function W(it,at){return A.minBy(A.values(at),function(ut){var ht=Number.NEGATIVE_INFINITY,xt=Number.POSITIVE_INFINITY;return A.forIn(ut,function(pt,wt){var gt=q(it,wt)/2;ht=Math.max(pt+gt,ht),xt=Math.min(pt-gt,xt)}),ht-xt})}function X(it,at){var ut=A.values(at),ht=A.min(ut),xt=A.max(ut);A.forEach(["u","d"],function(pt){A.forEach(["l","r"],function(wt){var gt=pt+wt,Et=it[gt],kt;if(Et!==at){var zt=A.values(Et);kt=wt==="l"?ht-A.min(zt):xt-A.max(zt),kt&&(it[gt]=A.mapValues(Et,function(Ut){return Ut+kt}))}})})}function K(it,at){return A.mapValues(it.ul,function(ut,ht){if(at)return it[at.toLowerCase()][ht];var xt=A.sortBy(A.map(it,ht));return(xt[1]+xt[2])/2})}function rt(it){var at=B.buildLayerMatrix(it),ut=A.merge(N(it,at),T(it,at)),ht={},xt;A.forEach(["u","d"],function(wt){xt=wt==="u"?at:A.values(at).reverse(),A.forEach(["l","r"],function(gt){gt==="r"&&(xt=A.map(xt,function(Ut){return A.values(Ut).reverse()}));var Et=(wt==="u"?it.predecessors:it.successors).bind(it),kt=R(it,xt,ut,Et),zt=z(it,xt,kt.root,kt.align,gt==="r");gt==="r"&&(zt=A.mapValues(zt,function(Ut){return-Ut})),ht[wt+gt]=zt})});var pt=W(it,ht);return X(ht,pt),K(ht,it.graph().align)}function nt(it,at,ut){return function(ht,xt,pt){var wt=ht.node(xt),gt=ht.node(pt),Et=0,kt;if(Et+=wt.width/2,A.has(wt,"labelpos"))switch(wt.labelpos.toLowerCase()){case"l":kt=-wt.width/2;break;case"r":kt=wt.width/2;break}if(kt&&(Et+=ut?kt:-kt),kt=0,Et+=(wt.dummy?at:it)/2,Et+=(gt.dummy?at:it)/2,Et+=gt.width/2,A.has(gt,"labelpos"))switch(gt.labelpos.toLowerCase()){case"l":kt=gt.width/2;break;case"r":kt=-gt.width/2;break}return kt&&(Et+=ut?kt:-kt),kt=0,Et}}function q(it,at){return it.node(at).width}},93021:function(U,Q,S){"use strict";var A=S(72361),Z=S(53063),B=S(92080).positionX;U.exports=N;function N(k){k=Z.asNonCompoundGraph(k),T(k),A.forEach(B(k),function(_,C){k.node(C).x=_})}function T(k){var _=Z.buildLayerMatrix(k),C=k.graph().ranksep,R=0;A.forEach(_,function(z){var D=A.max(A.map(z,function(W){return k.node(W).height}));A.forEach(z,function(W){k.node(W).y=R+D/2}),R+=D+C})}},61031:function(U,Q,S){"use strict";var A=S(72361),Z=S(76626).Graph,B=S(2416).slack;U.exports=N;function N(C){var R=new Z({directed:!1}),z=C.nodes()[0],D=C.nodeCount();R.setNode(z,{});for(var W,X;T(R,C)<D;)W=k(R,C),X=R.hasNode(W.v)?B(C,W):-B(C,W),_(R,C,X);return R}function T(C,R){function z(D){A.forEach(R.nodeEdges(D),function(W){var X=W.v,K=D===X?W.w:X;!C.hasNode(K)&&!B(R,W)&&(C.setNode(K,{}),C.setEdge(D,K,{}),z(K))})}return A.forEach(C.nodes(),z),C.nodeCount()}function k(C,R){return A.minBy(R.edges(),function(z){if(C.hasNode(z.v)!==C.hasNode(z.w))return B(R,z)})}function _(C,R,z){A.forEach(C.nodes(),function(D){R.node(D).rank+=z})}},64505:function(U,Q,S){"use strict";var A=S(2416),Z=A.longestPath,B=S(61031),N=S(77076);U.exports=T;function T(R){switch(R.graph().ranker){case"network-simplex":C(R);break;case"tight-tree":_(R);break;case"longest-path":k(R);break;default:C(R)}}var k=Z;function _(R){Z(R),B(R)}function C(R){N(R)}},77076:function(U,Q,S){"use strict";var A=S(72361),Z=S(61031),B=S(2416).slack,N=S(2416).longestPath,T=S(76626).alg.preorder,k=S(76626).alg.postorder,_=S(53063).simplify;U.exports=C,C.initLowLimValues=W,C.initCutValues=R,C.calcCutValue=D,C.leaveEdge=K,C.enterEdge=rt,C.exchangeEdges=nt;function C(ut){ut=_(ut),N(ut);var ht=Z(ut);W(ht),R(ht,ut);for(var xt,pt;xt=K(ht);)pt=rt(ht,ut,xt),nt(ht,ut,xt,pt)}function R(ut,ht){var xt=k(ut,ut.nodes());xt=xt.slice(0,xt.length-1),A.forEach(xt,function(pt){z(ut,ht,pt)})}function z(ut,ht,xt){var pt=ut.node(xt),wt=pt.parent;ut.edge(xt,wt).cutvalue=D(ut,ht,xt)}function D(ut,ht,xt){var pt=ut.node(xt),wt=pt.parent,gt=!0,Et=ht.edge(xt,wt),kt=0;return Et||(gt=!1,Et=ht.edge(wt,xt)),kt=Et.weight,A.forEach(ht.nodeEdges(xt),function(zt){var Ut=zt.v===xt,Qt=Ut?zt.w:zt.v;if(Qt!==wt){var Ee=Ut===gt,Le=ht.edge(zt).weight;if(kt+=Ee?Le:-Le,it(ut,xt,Qt)){var tn=ut.edge(xt,Qt).cutvalue;kt+=Ee?-tn:tn}}}),kt}function W(ut,ht){arguments.length<2&&(ht=ut.nodes()[0]),X(ut,{},1,ht)}function X(ut,ht,xt,pt,wt){var gt=xt,Et=ut.node(pt);return ht[pt]=!0,A.forEach(ut.neighbors(pt),function(kt){A.has(ht,kt)||(xt=X(ut,ht,xt,kt,pt))}),Et.low=gt,Et.lim=xt++,wt?Et.parent=wt:delete Et.parent,xt}function K(ut){return A.find(ut.edges(),function(ht){return ut.edge(ht).cutvalue<0})}function rt(ut,ht,xt){var pt=xt.v,wt=xt.w;ht.hasEdge(pt,wt)||(pt=xt.w,wt=xt.v);var gt=ut.node(pt),Et=ut.node(wt),kt=gt,zt=!1;gt.lim>Et.lim&&(kt=Et,zt=!0);var Ut=A.filter(ht.edges(),function(Qt){return zt===at(ut,ut.node(Qt.v),kt)&&zt!==at(ut,ut.node(Qt.w),kt)});return A.minBy(Ut,function(Qt){return B(ht,Qt)})}function nt(ut,ht,xt,pt){var wt=xt.v,gt=xt.w;ut.removeEdge(wt,gt),ut.setEdge(pt.v,pt.w,{}),W(ut),R(ut,ht),q(ut,ht)}function q(ut,ht){var xt=A.find(ut.nodes(),function(wt){return!ht.node(wt).parent}),pt=T(ut,xt);pt=pt.slice(1),A.forEach(pt,function(wt){var gt=ut.node(wt).parent,Et=ht.edge(wt,gt),kt=!1;Et||(Et=ht.edge(gt,wt),kt=!0),ht.node(wt).rank=ht.node(gt).rank+(kt?Et.minlen:-Et.minlen)})}function it(ut,ht,xt){return ut.hasEdge(ht,xt)}function at(ut,ht,xt){return xt.low<=ht.lim&&ht.lim<=xt.lim}},2416:function(U,Q,S){"use strict";var A=S(72361);U.exports={longestPath:Z,slack:B};function Z(N){var T={};function k(_){var C=N.node(_);if(A.has(T,_))return C.rank;T[_]=!0;var R=A.min(A.map(N.outEdges(_),function(z){return k(z.w)-N.edge(z).minlen}));return(R===Number.POSITIVE_INFINITY||R===void 0||R===null)&&(R=0),C.rank=R}A.forEach(N.sources(),k)}function B(N,T){return N.node(T.w).rank-N.node(T.v).rank-N.edge(T).minlen}},53063:function(U,Q,S){"use strict";var A=S(72361),Z=S(76626).Graph;U.exports={addDummyNode:B,simplify:N,asNonCompoundGraph:T,successorWeights:k,predecessorWeights:_,intersectRect:C,buildLayerMatrix:R,normalizeRanks:z,removeEmptyRanks:D,addBorderNode:W,maxRank:X,partition:K,time:rt,notime:nt};function B(q,it,at,ut){var ht;do ht=A.uniqueId(ut);while(q.hasNode(ht));return at.dummy=it,q.setNode(ht,at),ht}function N(q){var it=new Z().setGraph(q.graph());return A.forEach(q.nodes(),function(at){it.setNode(at,q.node(at))}),A.forEach(q.edges(),function(at){var ut=it.edge(at.v,at.w)||{weight:0,minlen:1},ht=q.edge(at);it.setEdge(at.v,at.w,{weight:ut.weight+ht.weight,minlen:Math.max(ut.minlen,ht.minlen)})}),it}function T(q){var it=new Z({multigraph:q.isMultigraph()}).setGraph(q.graph());return A.forEach(q.nodes(),function(at){q.children(at).length||it.setNode(at,q.node(at))}),A.forEach(q.edges(),function(at){it.setEdge(at,q.edge(at))}),it}function k(q){var it=A.map(q.nodes(),function(at){var ut={};return A.forEach(q.outEdges(at),function(ht){ut[ht.w]=(ut[ht.w]||0)+q.edge(ht).weight}),ut});return A.zipObject(q.nodes(),it)}function _(q){var it=A.map(q.nodes(),function(at){var ut={};return A.forEach(q.inEdges(at),function(ht){ut[ht.v]=(ut[ht.v]||0)+q.edge(ht).weight}),ut});return A.zipObject(q.nodes(),it)}function C(q,it){var at=q.x,ut=q.y,ht=it.x-at,xt=it.y-ut,pt=q.width/2,wt=q.height/2;if(!ht&&!xt)throw new Error("Not possible to find intersection inside of the rectangle");var gt,Et;return Math.abs(xt)*pt>Math.abs(ht)*wt?(xt<0&&(wt=-wt),gt=wt*ht/xt,Et=wt):(ht<0&&(pt=-pt),gt=pt,Et=pt*xt/ht),{x:at+gt,y:ut+Et}}function R(q){var it=A.map(A.range(X(q)+1),function(){return[]});return A.forEach(q.nodes(),function(at){var ut=q.node(at),ht=ut.rank;A.isUndefined(ht)||(it[ht][ut.order]=at)}),it}function z(q){var it=A.min(A.map(q.nodes(),function(at){return q.node(at).rank}));A.forEach(q.nodes(),function(at){var ut=q.node(at);A.has(ut,"rank")&&(ut.rank-=it)})}function D(q){var it=A.min(A.map(q.nodes(),function(xt){return q.node(xt).rank})),at=[];A.forEach(q.nodes(),function(xt){var pt=q.node(xt).rank-it;at[pt]||(at[pt]=[]),at[pt].push(xt)});var ut=0,ht=q.graph().nodeRankFactor;A.forEach(at,function(xt,pt){A.isUndefined(xt)&&pt%ht!==0?--ut:ut&&A.forEach(xt,function(wt){q.node(wt).rank+=ut})})}function W(q,it,at,ut){var ht={width:0,height:0};return arguments.length>=4&&(ht.rank=at,ht.order=ut),B(q,"border",ht,it)}function X(q){return A.max(A.map(q.nodes(),function(it){var at=q.node(it).rank;if(!A.isUndefined(at))return at}))}function K(q,it){var at={lhs:[],rhs:[]};return A.forEach(q,function(ut){it(ut)?at.lhs.push(ut):at.rhs.push(ut)}),at}function rt(q,it){var at=A.now();try{return it()}finally{console.log(q+" time: "+(A.now()-at)+"ms")}}function nt(q,it){return it()}},11897:function(U){U.exports="0.8.5"},37271:function(U){"use strict";var Q=Object.prototype.hasOwnProperty,S="~";function A(){}Object.create&&(A.prototype=Object.create(null),new A().__proto__||(S=!1));function Z(k,_,C){this.fn=k,this.context=_,this.once=C||!1}function B(k,_,C,R,z){if(typeof C!="function")throw new TypeError("The listener must be a function");var D=new Z(C,R||k,z),W=S?S+_:_;return k._events[W]?k._events[W].fn?k._events[W]=[k._events[W],D]:k._events[W].push(D):(k._events[W]=D,k._eventsCount++),k}function N(k,_){--k._eventsCount===0?k._events=new A:delete k._events[_]}function T(){this._events=new A,this._eventsCount=0}T.prototype.eventNames=function(){var _=[],C,R;if(this._eventsCount===0)return _;for(R in C=this._events)Q.call(C,R)&&_.push(S?R.slice(1):R);return Object.getOwnPropertySymbols?_.concat(Object.getOwnPropertySymbols(C)):_},T.prototype.listeners=function(_){var C=S?S+_:_,R=this._events[C];if(!R)return[];if(R.fn)return[R.fn];for(var z=0,D=R.length,W=new Array(D);z<D;z++)W[z]=R[z].fn;return W},T.prototype.listenerCount=function(_){var C=S?S+_:_,R=this._events[C];return R?R.fn?1:R.length:0},T.prototype.emit=function(_,C,R,z,D,W){var X=S?S+_:_;if(!this._events[X])return!1;var K=this._events[X],rt=arguments.length,nt,q;if(K.fn){switch(K.once&&this.removeListener(_,K.fn,void 0,!0),rt){case 1:return K.fn.call(K.context),!0;case 2:return K.fn.call(K.context,C),!0;case 3:return K.fn.call(K.context,C,R),!0;case 4:return K.fn.call(K.context,C,R,z),!0;case 5:return K.fn.call(K.context,C,R,z,D),!0;case 6:return K.fn.call(K.context,C,R,z,D,W),!0}for(q=1,nt=new Array(rt-1);q<rt;q++)nt[q-1]=arguments[q];K.fn.apply(K.context,nt)}else{var it=K.length,at;for(q=0;q<it;q++)switch(K[q].once&&this.removeListener(_,K[q].fn,void 0,!0),rt){case 1:K[q].fn.call(K[q].context);break;case 2:K[q].fn.call(K[q].context,C);break;case 3:K[q].fn.call(K[q].context,C,R);break;case 4:K[q].fn.call(K[q].context,C,R,z);break;default:if(!nt)for(at=1,nt=new Array(rt-1);at<rt;at++)nt[at-1]=arguments[at];K[q].fn.apply(K[q].context,nt)}}return!0},T.prototype.on=function(_,C,R){return B(this,_,C,R,!1)},T.prototype.once=function(_,C,R){return B(this,_,C,R,!0)},T.prototype.removeListener=function(_,C,R,z){var D=S?S+_:_;if(!this._events[D])return this;if(!C)return N(this,D),this;var W=this._events[D];if(W.fn)W.fn===C&&(!z||W.once)&&(!R||W.context===R)&&N(this,D);else{for(var X=0,K=[],rt=W.length;X<rt;X++)(W[X].fn!==C||z&&!W[X].once||R&&W[X].context!==R)&&K.push(W[X]);K.length?this._events[D]=K.length===1?K[0]:K:N(this,D)}return this},T.prototype.removeAllListeners=function(_){var C;return _?(C=S?S+_:_,this._events[C]&&N(this,C)):(this._events=new A,this._eventsCount=0),this},T.prototype.off=T.prototype.removeListener,T.prototype.addListener=T.prototype.on,T.prefixed=S,T.EventEmitter=T,U.exports=T},75172:function(U,Q,S){var A=S(89224);U.exports={Graph:A.Graph,json:S(17401),alg:S(54613),version:A.version}},91606:function(U,Q,S){var A=S(95329);U.exports=Z;function Z(B){var N={},T=[],k;function _(C){A.has(N,C)||(N[C]=!0,k.push(C),A.each(B.successors(C),_),A.each(B.predecessors(C),_))}return A.each(B.nodes(),function(C){k=[],_(C),k.length&&T.push(k)}),T}},21482:function(U,Q,S){var A=S(95329);U.exports=Z;function Z(N,T,k){A.isArray(T)||(T=[T]);var _=(N.isDirected()?N.successors:N.neighbors).bind(N),C=[],R={};return A.each(T,function(z){if(!N.hasNode(z))throw new Error("Graph does not have node: "+z);B(N,z,k==="post",R,_,C)}),C}function B(N,T,k,_,C,R){A.has(_,T)||(_[T]=!0,k||R.push(T),A.each(C(T),function(z){B(N,z,k,_,C,R)}),k&&R.push(T))}},40845:function(U,Q,S){var A=S(13746),Z=S(95329);U.exports=B;function B(N,T,k){return Z.transform(N.nodes(),function(_,C){_[C]=A(N,C,T,k)},{})}},13746:function(U,Q,S){var A=S(95329),Z=S(36614);U.exports=N;var B=A.constant(1);function N(k,_,C,R){return T(k,String(_),C||B,R||function(z){return k.outEdges(z)})}function T(k,_,C,R){var z={},D=new Z,W,X,K=function(rt){var nt=rt.v!==W?rt.v:rt.w,q=z[nt],it=C(rt),at=X.distance+it;if(it<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+rt+" Weight: "+it);at<q.distance&&(q.distance=at,q.predecessor=W,D.decrease(nt,at))};for(k.nodes().forEach(function(rt){var nt=rt===_?0:Number.POSITIVE_INFINITY;z[rt]={distance:nt},D.add(rt,nt)});D.size()>0&&(W=D.removeMin(),X=z[W],X.distance!==Number.POSITIVE_INFINITY);)R(W).forEach(K);return z}},59324:function(U,Q,S){var A=S(95329),Z=S(94558);U.exports=B;function B(N){return A.filter(Z(N),function(T){return T.length>1||T.length===1&&N.hasEdge(T[0],T[0])})}},22893:function(U,Q,S){var A=S(95329);U.exports=B;var Z=A.constant(1);function B(T,k,_){return N(T,k||Z,_||function(C){return T.outEdges(C)})}function N(T,k,_){var C={},R=T.nodes();return R.forEach(function(z){C[z]={},C[z][z]={distance:0},R.forEach(function(D){z!==D&&(C[z][D]={distance:Number.POSITIVE_INFINITY})}),_(z).forEach(function(D){var W=D.v===z?D.w:D.v,X=k(D);C[z][W]={distance:X,predecessor:z}})}),R.forEach(function(z){var D=C[z];R.forEach(function(W){var X=C[W];R.forEach(function(K){var rt=X[z],nt=D[K],q=X[K],it=rt.distance+nt.distance;it<q.distance&&(q.distance=it,q.predecessor=nt.predecessor)})})}),C}},54613:function(U,Q,S){U.exports={components:S(91606),dijkstra:S(13746),dijkstraAll:S(40845),findCycles:S(59324),floydWarshall:S(22893),isAcyclic:S(588),postorder:S(98049),preorder:S(67158),prim:S(66058),tarjan:S(94558),topsort:S(7793)}},588:function(U,Q,S){var A=S(7793);U.exports=Z;function Z(B){try{A(B)}catch(N){if(N instanceof A.CycleException)return!1;throw N}return!0}},98049:function(U,Q,S){var A=S(21482);U.exports=Z;function Z(B,N){return A(B,N,"post")}},67158:function(U,Q,S){var A=S(21482);U.exports=Z;function Z(B,N){return A(B,N,"pre")}},66058:function(U,Q,S){var A=S(95329),Z=S(55954),B=S(36614);U.exports=N;function N(T,k){var _=new Z,C={},R=new B,z;function D(X){var K=X.v===z?X.w:X.v,rt=R.priority(K);if(rt!==void 0){var nt=k(X);nt<rt&&(C[K]=z,R.decrease(K,nt))}}if(T.nodeCount()===0)return _;A.each(T.nodes(),function(X){R.add(X,Number.POSITIVE_INFINITY),_.setNode(X)}),R.decrease(T.nodes()[0],0);for(var W=!1;R.size()>0;){if(z=R.removeMin(),A.has(C,z))_.setEdge(z,C[z]);else{if(W)throw new Error("Input graph is not connected: "+T);W=!0}T.nodeEdges(z).forEach(D)}return _}},94558:function(U,Q,S){var A=S(95329);U.exports=Z;function Z(B){var N=0,T=[],k={},_=[];function C(R){var z=k[R]={onStack:!0,lowlink:N,index:N++};if(T.push(R),B.successors(R).forEach(function(X){A.has(k,X)?k[X].onStack&&(z.lowlink=Math.min(z.lowlink,k[X].index)):(C(X),z.lowlink=Math.min(z.lowlink,k[X].lowlink))}),z.lowlink===z.index){var D=[],W;do W=T.pop(),k[W].onStack=!1,D.push(W);while(R!==W);_.push(D)}}return B.nodes().forEach(function(R){A.has(k,R)||C(R)}),_}},7793:function(U,Q,S){var A=S(95329);U.exports=Z,Z.CycleException=B;function Z(N){var T={},k={},_=[];function C(R){if(A.has(k,R))throw new B;A.has(T,R)||(k[R]=!0,T[R]=!0,A.each(N.predecessors(R),C),delete k[R],_.push(R))}if(A.each(N.sinks(),C),A.size(T)!==N.nodeCount())throw new B;return _}function B(){}B.prototype=new Error},36614:function(U,Q,S){var A=S(95329);U.exports=Z;function Z(){this._arr=[],this._keyIndices={}}Z.prototype.size=function(){return this._arr.length},Z.prototype.keys=function(){return this._arr.map(function(B){return B.key})},Z.prototype.has=function(B){return A.has(this._keyIndices,B)},Z.prototype.priority=function(B){var N=this._keyIndices[B];if(N!==void 0)return this._arr[N].priority},Z.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},Z.prototype.add=function(B,N){var T=this._keyIndices;if(B=String(B),!A.has(T,B)){var k=this._arr,_=k.length;return T[B]=_,k.push({key:B,priority:N}),this._decrease(_),!0}return!1},Z.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var B=this._arr.pop();return delete this._keyIndices[B.key],this._heapify(0),B.key},Z.prototype.decrease=function(B,N){var T=this._keyIndices[B];if(N>this._arr[T].priority)throw new Error("New priority is greater than current priority. Key: "+B+" Old: "+this._arr[T].priority+" New: "+N);this._arr[T].priority=N,this._decrease(T)},Z.prototype._heapify=function(B){var N=this._arr,T=2*B,k=T+1,_=B;T<N.length&&(_=N[T].priority<N[_].priority?T:_,k<N.length&&(_=N[k].priority<N[_].priority?k:_),_!==B&&(this._swap(B,_),this._heapify(_)))},Z.prototype._decrease=function(B){for(var N=this._arr,T=N[B].priority,k;B!==0&&(k=B>>1,!(N[k].priority<T));)this._swap(B,k),B=k},Z.prototype._swap=function(B,N){var T=this._arr,k=this._keyIndices,_=T[B],C=T[N];T[B]=C,T[N]=_,k[C.key]=B,k[_.key]=N}},55954:function(U,Q,S){"use strict";var A=S(95329);U.exports=T;var Z="\0",B="\0",N="";function T(D){this._isDirected=A.has(D,"directed")?D.directed:!0,this._isMultigraph=A.has(D,"multigraph")?D.multigraph:!1,this._isCompound=A.has(D,"compound")?D.compound:!1,this._label=void 0,this._defaultNodeLabelFn=A.constant(void 0),this._defaultEdgeLabelFn=A.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[B]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}T.prototype._nodeCount=0,T.prototype._edgeCount=0,T.prototype.isDirected=function(){return this._isDirected},T.prototype.isMultigraph=function(){return this._isMultigraph},T.prototype.isCompound=function(){return this._isCompound},T.prototype.setGraph=function(D){return this._label=D,this},T.prototype.graph=function(){return this._label},T.prototype.setDefaultNodeLabel=function(D){return A.isFunction(D)||(D=A.constant(D)),this._defaultNodeLabelFn=D,this},T.prototype.nodeCount=function(){return this._nodeCount},T.prototype.nodes=function(){return A.keys(this._nodes)},T.prototype.sources=function(){var D=this;return A.filter(this.nodes(),function(W){return A.isEmpty(D._in[W])})},T.prototype.sinks=function(){var D=this;return A.filter(this.nodes(),function(W){return A.isEmpty(D._out[W])})},T.prototype.setNodes=function(D,W){var X=arguments,K=this;return A.each(D,function(rt){X.length>1?K.setNode(rt,W):K.setNode(rt)}),this},T.prototype.setNode=function(D,W){return A.has(this._nodes,D)?(arguments.length>1&&(this._nodes[D]=W),this):(this._nodes[D]=arguments.length>1?W:this._defaultNodeLabelFn(D),this._isCompound&&(this._parent[D]=B,this._children[D]={},this._children[B][D]=!0),this._in[D]={},this._preds[D]={},this._out[D]={},this._sucs[D]={},++this._nodeCount,this)},T.prototype.node=function(D){return this._nodes[D]},T.prototype.hasNode=function(D){return A.has(this._nodes,D)},T.prototype.removeNode=function(D){var W=this;if(A.has(this._nodes,D)){var X=function(K){W.removeEdge(W._edgeObjs[K])};delete this._nodes[D],this._isCompound&&(this._removeFromParentsChildList(D),delete this._parent[D],A.each(this.children(D),function(K){W.setParent(K)}),delete this._children[D]),A.each(A.keys(this._in[D]),X),delete this._in[D],delete this._preds[D],A.each(A.keys(this._out[D]),X),delete this._out[D],delete this._sucs[D],--this._nodeCount}return this},T.prototype.setParent=function(D,W){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(A.isUndefined(W))W=B;else{W+="";for(var X=W;!A.isUndefined(X);X=this.parent(X))if(X===D)throw new Error("Setting "+W+" as parent of "+D+" would create a cycle");this.setNode(W)}return this.setNode(D),this._removeFromParentsChildList(D),this._parent[D]=W,this._children[W][D]=!0,this},T.prototype._removeFromParentsChildList=function(D){delete this._children[this._parent[D]][D]},T.prototype.parent=function(D){if(this._isCompound){var W=this._parent[D];if(W!==B)return W}},T.prototype.children=function(D){if(A.isUndefined(D)&&(D=B),this._isCompound){var W=this._children[D];if(W)return A.keys(W)}else{if(D===B)return this.nodes();if(this.hasNode(D))return[]}},T.prototype.predecessors=function(D){var W=this._preds[D];if(W)return A.keys(W)},T.prototype.successors=function(D){var W=this._sucs[D];if(W)return A.keys(W)},T.prototype.neighbors=function(D){var W=this.predecessors(D);if(W)return A.union(W,this.successors(D))},T.prototype.isLeaf=function(D){var W;return this.isDirected()?W=this.successors(D):W=this.neighbors(D),W.length===0},T.prototype.filterNodes=function(D){var W=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});W.setGraph(this.graph());var X=this;A.each(this._nodes,function(nt,q){D(q)&&W.setNode(q,nt)}),A.each(this._edgeObjs,function(nt){W.hasNode(nt.v)&&W.hasNode(nt.w)&&W.setEdge(nt,X.edge(nt))});var K={};function rt(nt){var q=X.parent(nt);return q===void 0||W.hasNode(q)?(K[nt]=q,q):q in K?K[q]:rt(q)}return this._isCompound&&A.each(W.nodes(),function(nt){W.setParent(nt,rt(nt))}),W},T.prototype.setDefaultEdgeLabel=function(D){return A.isFunction(D)||(D=A.constant(D)),this._defaultEdgeLabelFn=D,this},T.prototype.edgeCount=function(){return this._edgeCount},T.prototype.edges=function(){return A.values(this._edgeObjs)},T.prototype.setPath=function(D,W){var X=this,K=arguments;return A.reduce(D,function(rt,nt){return K.length>1?X.setEdge(rt,nt,W):X.setEdge(rt,nt),nt}),this},T.prototype.setEdge=function(){var D,W,X,K,rt=!1,nt=arguments[0];typeof nt=="object"&&nt!==null&&"v"in nt?(D=nt.v,W=nt.w,X=nt.name,arguments.length===2&&(K=arguments[1],rt=!0)):(D=nt,W=arguments[1],X=arguments[3],arguments.length>2&&(K=arguments[2],rt=!0)),D=""+D,W=""+W,A.isUndefined(X)||(X=""+X);var q=C(this._isDirected,D,W,X);if(A.has(this._edgeLabels,q))return rt&&(this._edgeLabels[q]=K),this;if(!A.isUndefined(X)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(D),this.setNode(W),this._edgeLabels[q]=rt?K:this._defaultEdgeLabelFn(D,W,X);var it=R(this._isDirected,D,W,X);return D=it.v,W=it.w,Object.freeze(it),this._edgeObjs[q]=it,k(this._preds[W],D),k(this._sucs[D],W),this._in[W][q]=it,this._out[D][q]=it,this._edgeCount++,this},T.prototype.edge=function(D,W,X){var K=arguments.length===1?z(this._isDirected,arguments[0]):C(this._isDirected,D,W,X);return this._edgeLabels[K]},T.prototype.hasEdge=function(D,W,X){var K=arguments.length===1?z(this._isDirected,arguments[0]):C(this._isDirected,D,W,X);return A.has(this._edgeLabels,K)},T.prototype.removeEdge=function(D,W,X){var K=arguments.length===1?z(this._isDirected,arguments[0]):C(this._isDirected,D,W,X),rt=this._edgeObjs[K];return rt&&(D=rt.v,W=rt.w,delete this._edgeLabels[K],delete this._edgeObjs[K],_(this._preds[W],D),_(this._sucs[D],W),delete this._in[W][K],delete this._out[D][K],this._edgeCount--),this},T.prototype.inEdges=function(D,W){var X=this._in[D];if(X){var K=A.values(X);return W?A.filter(K,function(rt){return rt.v===W}):K}},T.prototype.outEdges=function(D,W){var X=this._out[D];if(X){var K=A.values(X);return W?A.filter(K,function(rt){return rt.w===W}):K}},T.prototype.nodeEdges=function(D,W){var X=this.inEdges(D,W);if(X)return X.concat(this.outEdges(D,W))};function k(D,W){D[W]?D[W]++:D[W]=1}function _(D,W){--D[W]||delete D[W]}function C(D,W,X,K){var rt=""+W,nt=""+X;if(!D&&rt>nt){var q=rt;rt=nt,nt=q}return rt+N+nt+N+(A.isUndefined(K)?Z:K)}function R(D,W,X,K){var rt=""+W,nt=""+X;if(!D&&rt>nt){var q=rt;rt=nt,nt=q}var it={v:rt,w:nt};return K&&(it.name=K),it}function z(D,W){return C(D,W.v,W.w,W.name)}},89224:function(U,Q,S){U.exports={Graph:S(55954),version:S(16544)}},17401:function(U,Q,S){var A=S(95329),Z=S(55954);U.exports={write:B,read:k};function B(_){var C={options:{directed:_.isDirected(),multigraph:_.isMultigraph(),compound:_.isCompound()},nodes:N(_),edges:T(_)};return A.isUndefined(_.graph())||(C.value=A.clone(_.graph())),C}function N(_){return A.map(_.nodes(),function(C){var R=_.node(C),z=_.parent(C),D={v:C};return A.isUndefined(R)||(D.value=R),A.isUndefined(z)||(D.parent=z),D})}function T(_){return A.map(_.edges(),function(C){var R=_.edge(C),z={v:C.v,w:C.w};return A.isUndefined(C.name)||(z.name=C.name),A.isUndefined(R)||(z.value=R),z})}function k(_){var C=new Z(_.options).setGraph(_.value);return A.each(_.nodes,function(R){C.setNode(R.v,R.value),R.parent&&C.setParent(R.v,R.parent)}),A.each(_.edges,function(R){C.setEdge({v:R.v,w:R.w,name:R.name},R.value)}),C}},95329:function(U,Q,S){var A;try{A={clone:S(76833),constant:S(13503),each:S(76934),filter:S(64725),has:S(99946),isArray:S(80744),isEmpty:S(61627),isFunction:S(9363),isUndefined:S(16513),keys:S(55451),map:S(9924),reduce:S(16473),size:S(40617),transform:S(91116),union:S(44065),values:S(81229)}}catch(Z){}A||(A=window._),U.exports=A},16544:function(U){U.exports="2.1.8"},34634:function(U,Q,S){"use strict";S.r(Q),S.d(Q,{isAnyArray:function(){return Z}});const A=Object.prototype.toString;function Z(B){const N=A.call(B);return N.endsWith("Array]")&&!N.includes("Big")}},55973:function(U){U.exports=function(S){return!S||typeof S=="string"?!1:S instanceof Array||Array.isArray(S)||S.length>=0&&(S.splice instanceof Function||Object.getOwnPropertyDescriptor(S,S.length-1)&&S.constructor.name!=="String")}},15584:function(U,Q,S){var A=S(73893),Z=S(33152),B=A(Z,"DataView");U.exports=B},97288:function(U,Q,S){var A=S(73893),Z=S(33152),B=A(Z,"Promise");U.exports=B},23599:function(U,Q,S){var A=S(73893),Z=S(33152),B=A(Z,"Set");U.exports=B},98924:function(U,Q,S){var A=S(52166),Z=S(34776),B=S(40393);function N(T){var k=-1,_=T==null?0:T.length;for(this.__data__=new A;++k<_;)this.add(T[k])}N.prototype.add=N.prototype.push=Z,N.prototype.has=B,U.exports=N},26873:function(U,Q,S){var A=S(73893),Z=S(33152),B=A(Z,"WeakMap");U.exports=B},74809:function(U){function Q(S,A){for(var Z=-1,B=S==null?0:S.length;++Z<B&&A(S[Z],Z,S)!==!1;);return S}U.exports=Q},86952:function(U){function Q(S,A){for(var Z=-1,B=S==null?0:S.length,N=0,T=[];++Z<B;){var k=S[Z];A(k,Z,S)&&(T[N++]=k)}return T}U.exports=Q},84271:function(U,Q,S){var A=S(17424);function Z(B,N){var T=B==null?0:B.length;return!!T&&A(B,N,0)>-1}U.exports=Z},94874:function(U){function Q(S,A,Z){for(var B=-1,N=S==null?0:S.length;++B<N;)if(Z(A,S[B]))return!0;return!1}U.exports=Q},75010:function(U){function Q(S,A){for(var Z=-1,B=S==null?0:S.length,N=Array(B);++Z<B;)N[Z]=A(S[Z],Z,S);return N}U.exports=Q},57095:function(U){function Q(S,A){for(var Z=-1,B=A.length,N=S.length;++Z<B;)S[N+Z]=A[Z];return S}U.exports=Q},99861:function(U){function Q(S,A,Z,B){var N=-1,T=S==null?0:S.length;for(B&&T&&(Z=S[++N]);++N<T;)Z=A(Z,S[N],N,S);return Z}U.exports=Q},64045:function(U){function Q(S,A){for(var Z=-1,B=S==null?0:S.length;++Z<B;)if(A(S[Z],Z,S))return!0;return!1}U.exports=Q},26539:function(U,Q,S){var A=S(22310),Z=A("length");U.exports=Z},91937:function(U,Q,S){var A=S(95378),Z=S(55451);function B(N,T){return N&&A(T,Z(T),N)}U.exports=B},26680:function(U,Q,S){var A=S(95378),Z=S(56730);function B(N,T){return N&&A(T,Z(T),N)}U.exports=B},99045:function(U,Q,S){var A=S(91866),Z=S(74809),B=S(60348),N=S(91937),T=S(26680),k=S(32315),_=S(47760),C=S(15168),R=S(71678),z=S(12076),D=S(22675),W=S(66139),X=S(79264),K=S(97541),rt=S(4084),nt=S(80744),q=S(57835),it=S(41626),at=S(20816),ut=S(65226),ht=S(55451),xt=S(56730),pt=1,wt=2,gt=4,Et="[object Arguments]",kt="[object Array]",zt="[object Boolean]",Ut="[object Date]",Qt="[object Error]",Ee="[object Function]",Le="[object GeneratorFunction]",tn="[object Map]",er="[object Number]",$r="[object Object]",la="[object RegExp]",as="[object Set]",Pt="[object String]",_t="[object Symbol]",It="[object WeakMap]",dt="[object ArrayBuffer]",St="[object DataView]",Ct="[object Float32Array]",Gt="[object Float64Array]",oe="[object Int8Array]",ye="[object Int16Array]",de="[object Int32Array]",_e="[object Uint8Array]",Mn="[object Uint8ClampedArray]",Nn="[object Uint16Array]",Pe="[object Uint32Array]",Se={};Se[Et]=Se[kt]=Se[dt]=Se[St]=Se[zt]=Se[Ut]=Se[Ct]=Se[Gt]=Se[oe]=Se[ye]=Se[de]=Se[tn]=Se[er]=Se[$r]=Se[la]=Se[as]=Se[Pt]=Se[_t]=Se[_e]=Se[Mn]=Se[Nn]=Se[Pe]=!0,Se[Qt]=Se[Ee]=Se[It]=!1;function re(Oe,cr,ca,ne,ss,Rr){var Yn,Lr=cr&pt,os=cr&wt,ua=cr&gt;if(ca&&(Yn=ss?ca(Oe,ne,ss,Rr):ca(Oe)),Yn!==void 0)return Yn;if(!at(Oe))return Oe;var qs=nt(Oe);if(qs){if(Yn=X(Oe),!Lr)return _(Oe,Yn)}else{var ha=W(Oe),Fo=ha==Ee||ha==Le;if(q(Oe))return k(Oe,Lr);if(ha==$r||ha==Et||Fo&&!ss){if(Yn=os||Fo?{}:rt(Oe),!Lr)return os?R(Oe,T(Yn,Oe)):C(Oe,N(Yn,Oe))}else{if(!Se[ha])return ss?Oe:{};Yn=K(Oe,ha,Lr)}}Rr||(Rr=new A);var ls=Rr.get(Oe);if(ls)return ls;Rr.set(Oe,Yn),ut(Oe)?Oe.forEach(function(Ai){Yn.add(re(Ai,cr,ca,Ai,Oe,Rr))}):it(Oe)&&Oe.forEach(function(Ai,Ti){Yn.set(Ti,re(Ai,cr,ca,Ti,Oe,Rr))});var cs=ua?os?D:z:os?xt:ht,us=qs?void 0:cs(Oe);return Z(us||Oe,function(Ai,Ti){us&&(Ti=Ai,Ai=Oe[Ti]),B(Yn,Ti,re(Ai,cr,ca,Ti,Oe,Rr))}),Yn}U.exports=re},44107:function(U,Q,S){var A=S(1585),Z=S(49164),B=Z(A);U.exports=B},2659:function(U,Q,S){var A=S(45029);function Z(B,N,T){for(var k=-1,_=B.length;++k<_;){var C=B[k],R=N(C);if(R!=null&&(z===void 0?R===R&&!A(R):T(R,z)))var z=R,D=C}return D}U.exports=Z},32872:function(U,Q,S){var A=S(44107);function Z(B,N){var T=[];return A(B,function(k,_,C){N(k,_,C)&&T.push(k)}),T}U.exports=Z},51533:function(U){function Q(S,A,Z,B){for(var N=S.length,T=Z+(B?1:-1);B?T--:++T<N;)if(A(S[T],T,S))return T;return-1}U.exports=Q},9256:function(U,Q,S){var A=S(57095),Z=S(88133);function B(N,T,k,_,C){var R=-1,z=N.length;for(k||(k=Z),C||(C=[]);++R<z;){var D=N[R];T>0&&k(D)?T>1?B(D,T-1,k,_,C):A(C,D):_||(C[C.length]=D)}return C}U.exports=B},1585:function(U,Q,S){var A=S(14018),Z=S(55451);function B(N,T){return N&&A(N,T,Z)}U.exports=B},89147:function(U,Q,S){var A=S(1186),Z=S(9171);function B(N,T){T=A(T,N);for(var k=0,_=T.length;N!=null&&k<_;)N=N[Z(T[k++])];return k&&k==_?N:void 0}U.exports=B},75635:function(U,Q,S){var A=S(57095),Z=S(80744);function B(N,T,k){var _=T(N);return Z(N)?_:A(_,k(N))}U.exports=B},40302:function(U){function Q(S,A){return S>A}U.exports=Q},3251:function(U){var Q=Object.prototype,S=Q.hasOwnProperty;function A(Z,B){return Z!=null&&S.call(Z,B)}U.exports=A},62348:function(U){function Q(S,A){return S!=null&&A in Object(S)}U.exports=Q},17424:function(U,Q,S){var A=S(51533),Z=S(8373),B=S(49237);function N(T,k,_){return k===k?B(T,k,_):A(T,Z,_)}U.exports=N},77295:function(U,Q,S){var A=S(84412),Z=S(93913);function B(N,T,k,_,C){return N===T?!0:N==null||T==null||!Z(N)&&!Z(T)?N!==N&&T!==T:A(N,T,k,_,B,C)}U.exports=B},84412:function(U,Q,S){var A=S(91866),Z=S(50401),B=S(57710),N=S(4983),T=S(66139),k=S(80744),_=S(57835),C=S(18397),R=1,z="[object Arguments]",D="[object Array]",W="[object Object]",X=Object.prototype,K=X.hasOwnProperty;function rt(nt,q,it,at,ut,ht){var xt=k(nt),pt=k(q),wt=xt?D:T(nt),gt=pt?D:T(q);wt=wt==z?W:wt,gt=gt==z?W:gt;var Et=wt==W,kt=gt==W,zt=wt==gt;if(zt&&_(nt)){if(!_(q))return!1;xt=!0,Et=!1}if(zt&&!Et)return ht||(ht=new A),xt||C(nt)?Z(nt,q,it,at,ut,ht):B(nt,q,wt,it,at,ut,ht);if(!(it&R)){var Ut=Et&&K.call(nt,"__wrapped__"),Qt=kt&&K.call(q,"__wrapped__");if(Ut||Qt){var Ee=Ut?nt.value():nt,Le=Qt?q.value():q;return ht||(ht=new A),ut(Ee,Le,it,at,ht)}}return zt?(ht||(ht=new A),N(nt,q,it,at,ut,ht)):!1}U.exports=rt},55005:function(U,Q,S){var A=S(66139),Z=S(93913),B="[object Map]";function N(T){return Z(T)&&A(T)==B}U.exports=N},51524:function(U,Q,S){var A=S(91866),Z=S(77295),B=1,N=2;function T(k,_,C,R){var z=C.length,D=z,W=!R;if(k==null)return!D;for(k=Object(k);z--;){var X=C[z];if(W&&X[2]?X[1]!==k[X[0]]:!(X[0]in k))return!1}for(;++z<D;){X=C[z];var K=X[0],rt=k[K],nt=X[1];if(W&&X[2]){if(rt===void 0&&!(K in k))return!1}else{var q=new A;if(R)var it=R(rt,nt,K,k,_,q);if(!(it===void 0?Z(nt,rt,B|N,R,q):it))return!1}}return!0}U.exports=T},8373:function(U){function Q(S){return S!==S}U.exports=Q},38652:function(U,Q,S){var A=S(66139),Z=S(93913),B="[object Set]";function N(T){return Z(T)&&A(T)==B}U.exports=N},95979:function(U,Q,S){var A=S(17632),Z=S(38933),B=S(46962),N=S(80744),T=S(35769);function k(_){return typeof _=="function"?_:_==null?B:typeof _=="object"?N(_)?Z(_[0],_[1]):A(_):T(_)}U.exports=k},6019:function(U,Q,S){var A=S(7975),Z=S(23730),B=Object.prototype,N=B.hasOwnProperty;function T(k){if(!A(k))return Z(k);var _=[];for(var C in Object(k))N.call(k,C)&&C!="constructor"&&_.push(C);return _}U.exports=T},93757:function(U){function Q(S,A){return S<A}U.exports=Q},65487:function(U,Q,S){var A=S(44107),Z=S(24665);function B(N,T){var k=-1,_=Z(N)?Array(N.length):[];return A(N,function(C,R,z){_[++k]=T(C,R,z)}),_}U.exports=B},17632:function(U,Q,S){var A=S(51524),Z=S(10261),B=S(24122);function N(T){var k=Z(T);return k.length==1&&k[0][2]?B(k[0][0],k[0][1]):function(_){return _===T||A(_,T,k)}}U.exports=N},38933:function(U,Q,S){var A=S(77295),Z=S(44231),B=S(37879),N=S(86773),T=S(88411),k=S(24122),_=S(9171),C=1,R=2;function z(D,W){return N(D)&&T(W)?k(_(D),W):function(X){var K=Z(X,D);return K===void 0&&K===W?B(X,D):A(W,K,C|R)}}U.exports=z},58506:function(U,Q,S){var A=S(75010),Z=S(89147),B=S(95979),N=S(65487),T=S(33065),k=S(38342),_=S(11249),C=S(46962),R=S(80744);function z(D,W,X){W.length?W=A(W,function(nt){return R(nt)?function(q){return Z(q,nt.length===1?nt[0]:nt)}:nt}):W=[C];var K=-1;W=A(W,k(B));var rt=N(D,function(nt,q,it){var at=A(W,function(ut){return ut(nt)});return{criteria:at,index:++K,value:nt}});return T(rt,function(nt,q){return _(nt,q,X)})}U.exports=z},88832:function(U,Q,S){var A=S(10867),Z=S(37879);function B(N,T){return A(N,T,function(k,_){return Z(N,_)})}U.exports=B},10867:function(U,Q,S){var A=S(89147),Z=S(36897),B=S(1186);function N(T,k,_){for(var C=-1,R=k.length,z={};++C<R;){var D=k[C],W=A(T,D);_(W,D)&&Z(z,B(D,T),W)}return z}U.exports=N},22310:function(U){function Q(S){return function(A){return A==null?void 0:A[S]}}U.exports=Q},96916:function(U,Q,S){var A=S(89147);function Z(B){return function(N){return A(N,B)}}U.exports=Z},36121:function(U){var Q=Math.ceil,S=Math.max;function A(Z,B,N,T){for(var k=-1,_=S(Q((B-Z)/(N||1)),0),C=Array(_);_--;)C[T?_:++k]=Z,Z+=N;return C}U.exports=A},30739:function(U){function Q(S,A,Z,B,N){return N(S,function(T,k,_){Z=B?(B=!1,T):A(Z,T,k,_)}),Z}U.exports=Q},36897:function(U,Q,S){var A=S(60348),Z=S(1186),B=S(70213),N=S(20816),T=S(9171);function k(_,C,R,z){if(!N(_))return _;C=Z(C,_);for(var D=-1,W=C.length,X=W-1,K=_;K!=null&&++D<W;){var rt=T(C[D]),nt=R;if(rt==="__proto__"||rt==="constructor"||rt==="prototype")return _;if(D!=X){var q=K[rt];nt=z?z(q,rt,K):void 0,nt===void 0&&(nt=N(q)?q:B(C[D+1])?[]:{})}A(K,rt,nt),K=K[rt]}return _}U.exports=k},33065:function(U){function Q(S,A){var Z=S.length;for(S.sort(A);Z--;)S[Z]=S[Z].value;return S}U.exports=Q},50230:function(U,Q,S){var A=S(91869),Z=S(75010),B=S(80744),N=S(45029),T=1/0,k=A?A.prototype:void 0,_=k?k.toString:void 0;function C(R){if(typeof R=="string")return R;if(B(R))return Z(R,C)+"";if(N(R))return _?_.call(R):"";var z=R+"";return z=="0"&&1/R==-T?"-0":z}U.exports=C},13927:function(U,Q,S){var A=S(15333),Z=/^\s+/;function B(N){return N&&N.slice(0,A(N)+1).replace(Z,"")}U.exports=B},29098:function(U,Q,S){var A=S(98924),Z=S(84271),B=S(94874),N=S(1931),T=S(47506),k=S(79679),_=200;function C(R,z,D){var W=-1,X=Z,K=R.length,rt=!0,nt=[],q=nt;if(D)rt=!1,X=B;else if(K>=_){var it=z?null:T(R);if(it)return k(it);rt=!1,X=N,q=new A}else q=z?[]:nt;t:for(;++W<K;){var at=R[W],ut=z?z(at):at;if(at=D||at!==0?at:0,rt&&ut===ut){for(var ht=q.length;ht--;)if(q[ht]===ut)continue t;z&&q.push(ut),nt.push(at)}else X(q,ut,D)||(q!==nt&&q.push(ut),nt.push(at))}return nt}U.exports=C},20720:function(U,Q,S){var A=S(75010);function Z(B,N){return A(N,function(T){return B[T]})}U.exports=Z},94484:function(U){function Q(S,A,Z){for(var B=-1,N=S.length,T=A.length,k={};++B<N;){var _=B<T?A[B]:void 0;Z(k,S[B],_)}return k}U.exports=Q},1931:function(U){function Q(S,A){return S.has(A)}U.exports=Q},11756:function(U,Q,S){var A=S(46962);function Z(B){return typeof B=="function"?B:A}U.exports=Z},1186:function(U,Q,S){var A=S(80744),Z=S(86773),B=S(40493),N=S(44140);function T(k,_){return A(k)?k:Z(k,_)?[k]:B(N(k))}U.exports=T},27984:function(U,Q,S){var A=S(20188);function Z(B,N){var T=N?A(B.buffer):B.buffer;return new B.constructor(T,B.byteOffset,B.byteLength)}U.exports=Z},78583:function(U){var Q=/\w*$/;function S(A){var Z=new A.constructor(A.source,Q.exec(A));return Z.lastIndex=A.lastIndex,Z}U.exports=S},28757:function(U,Q,S){var A=S(91869),Z=A?A.prototype:void 0,B=Z?Z.valueOf:void 0;function N(T){return B?Object(B.call(T)):{}}U.exports=N},83018:function(U,Q,S){var A=S(45029);function Z(B,N){if(B!==N){var T=B!==void 0,k=B===null,_=B===B,C=A(B),R=N!==void 0,z=N===null,D=N===N,W=A(N);if(!z&&!W&&!C&&B>N||C&&R&&D&&!z&&!W||k&&R&&D||!T&&D||!_)return 1;if(!k&&!C&&!W&&B<N||W&&T&&_&&!k&&!C||z&&T&&_||!R&&_||!D)return-1}return 0}U.exports=Z},11249:function(U,Q,S){var A=S(83018);function Z(B,N,T){for(var k=-1,_=B.criteria,C=N.criteria,R=_.length,z=T.length;++k<R;){var D=A(_[k],C[k]);if(D){if(k>=z)return D;var W=T[k];return D*(W=="desc"?-1:1)}}return B.index-N.index}U.exports=Z},15168:function(U,Q,S){var A=S(95378),Z=S(58966);function B(N,T){return A(N,Z(N),T)}U.exports=B},71678:function(U,Q,S){var A=S(95378),Z=S(66817);function B(N,T){return A(N,Z(N),T)}U.exports=B},49164:function(U,Q,S){var A=S(24665);function Z(B,N){return function(T,k){if(T==null)return T;if(!A(T))return B(T,k);for(var _=T.length,C=N?_:-1,R=Object(T);(N?C--:++C<_)&&k(R[C],C,R)!==!1;);return T}}U.exports=Z},19554:function(U,Q,S){var A=S(95979),Z=S(24665),B=S(55451);function N(T){return function(k,_,C){var R=Object(k);if(!Z(k)){var z=A(_,3);k=B(k),_=function(W){return z(R[W],W,R)}}var D=T(k,_,C);return D>-1?R[z?k[D]:D]:void 0}}U.exports=N},76106:function(U,Q,S){var A=S(36121),Z=S(8138),B=S(97341);function N(T){return function(k,_,C){return C&&typeof C!="number"&&Z(k,_,C)&&(_=C=void 0),k=B(k),_===void 0?(_=k,k=0):_=B(_),C=C===void 0?k<_?1:-1:B(C),A(k,_,C,T)}}U.exports=N},47506:function(U,Q,S){var A=S(23599),Z=S(9958),B=S(79679),N=1/0,T=A&&1/B(new A([,-0]))[1]==N?function(k){return new A(k)}:Z;U.exports=T},50401:function(U,Q,S){var A=S(98924),Z=S(64045),B=S(1931),N=1,T=2;function k(_,C,R,z,D,W){var X=R&N,K=_.length,rt=C.length;if(K!=rt&&!(X&&rt>K))return!1;var nt=W.get(_),q=W.get(C);if(nt&&q)return nt==C&&q==_;var it=-1,at=!0,ut=R&T?new A:void 0;for(W.set(_,C),W.set(C,_);++it<K;){var ht=_[it],xt=C[it];if(z)var pt=X?z(xt,ht,it,C,_,W):z(ht,xt,it,_,C,W);if(pt!==void 0){if(pt)continue;at=!1;break}if(ut){if(!Z(C,function(wt,gt){if(!B(ut,gt)&&(ht===wt||D(ht,wt,R,z,W)))return ut.push(gt)})){at=!1;break}}else if(!(ht===xt||D(ht,xt,R,z,W))){at=!1;break}}return W.delete(_),W.delete(C),at}U.exports=k},57710:function(U,Q,S){var A=S(91869),Z=S(77945),B=S(43607),N=S(50401),T=S(83383),k=S(79679),_=1,C=2,R="[object Boolean]",z="[object Date]",D="[object Error]",W="[object Map]",X="[object Number]",K="[object RegExp]",rt="[object Set]",nt="[object String]",q="[object Symbol]",it="[object ArrayBuffer]",at="[object DataView]",ut=A?A.prototype:void 0,ht=ut?ut.valueOf:void 0;function xt(pt,wt,gt,Et,kt,zt,Ut){switch(gt){case at:if(pt.byteLength!=wt.byteLength||pt.byteOffset!=wt.byteOffset)return!1;pt=pt.buffer,wt=wt.buffer;case it:return!(pt.byteLength!=wt.byteLength||!zt(new Z(pt),new Z(wt)));case R:case z:case X:return B(+pt,+wt);case D:return pt.name==wt.name&&pt.message==wt.message;case K:case nt:return pt==wt+"";case W:var Qt=T;case rt:var Ee=Et&_;if(Qt||(Qt=k),pt.size!=wt.size&&!Ee)return!1;var Le=Ut.get(pt);if(Le)return Le==wt;Et|=C,Ut.set(pt,wt);var tn=N(Qt(pt),Qt(wt),Et,kt,zt,Ut);return Ut.delete(pt),tn;case q:if(ht)return ht.call(pt)==ht.call(wt)}return!1}U.exports=xt},4983:function(U,Q,S){var A=S(12076),Z=1,B=Object.prototype,N=B.hasOwnProperty;function T(k,_,C,R,z,D){var W=C&Z,X=A(k),K=X.length,rt=A(_),nt=rt.length;if(K!=nt&&!W)return!1;for(var q=K;q--;){var it=X[q];if(!(W?it in _:N.call(_,it)))return!1}var at=D.get(k),ut=D.get(_);if(at&&ut)return at==_&&ut==k;var ht=!0;D.set(k,_),D.set(_,k);for(var xt=W;++q<K;){it=X[q];var pt=k[it],wt=_[it];if(R)var gt=W?R(wt,pt,it,_,k,D):R(pt,wt,it,k,_,D);if(!(gt===void 0?pt===wt||z(pt,wt,C,R,D):gt)){ht=!1;break}xt||(xt=it=="constructor")}if(ht&&!xt){var Et=k.constructor,kt=_.constructor;Et!=kt&&"constructor"in k&&"constructor"in _&&!(typeof Et=="function"&&Et instanceof Et&&typeof kt=="function"&&kt instanceof kt)&&(ht=!1)}return D.delete(k),D.delete(_),ht}U.exports=T},522:function(U,Q,S){var A=S(39807),Z=S(19652),B=S(71152);function N(T){return B(Z(T,void 0,A),T+"")}U.exports=N},12076:function(U,Q,S){var A=S(75635),Z=S(58966),B=S(55451);function N(T){return A(T,B,Z)}U.exports=N},22675:function(U,Q,S){var A=S(75635),Z=S(66817),B=S(56730);function N(T){return A(T,B,Z)}U.exports=N},10261:function(U,Q,S){var A=S(88411),Z=S(55451);function B(N){for(var T=Z(N),k=T.length;k--;){var _=T[k],C=N[_];T[k]=[_,C,A(C)]}return T}U.exports=B},58966:function(U,Q,S){var A=S(86952),Z=S(4134),B=Object.prototype,N=B.propertyIsEnumerable,T=Object.getOwnPropertySymbols,k=T?function(_){return _==null?[]:(_=Object(_),A(T(_),function(C){return N.call(_,C)}))}:Z;U.exports=k},66817:function(U,Q,S){var A=S(57095),Z=S(49217),B=S(58966),N=S(4134),T=Object.getOwnPropertySymbols,k=T?function(_){for(var C=[];_;)A(C,B(_)),_=Z(_);return C}:N;U.exports=k},66139:function(U,Q,S){var A=S(15584),Z=S(40164),B=S(97288),N=S(23599),T=S(26873),k=S(86756),_=S(63256),C="[object Map]",R="[object Object]",z="[object Promise]",D="[object Set]",W="[object WeakMap]",X="[object DataView]",K=_(A),rt=_(Z),nt=_(B),q=_(N),it=_(T),at=k;(A&&at(new A(new ArrayBuffer(1)))!=X||Z&&at(new Z)!=C||B&&at(B.resolve())!=z||N&&at(new N)!=D||T&&at(new T)!=W)&&(at=function(ut){var ht=k(ut),xt=ht==R?ut.constructor:void 0,pt=xt?_(xt):"";if(pt)switch(pt){case K:return X;case rt:return C;case nt:return z;case q:return D;case it:return W}return ht}),U.exports=at},63100:function(U,Q,S){var A=S(1186),Z=S(13053),B=S(80744),N=S(70213),T=S(11156),k=S(9171);function _(C,R,z){R=A(R,C);for(var D=-1,W=R.length,X=!1;++D<W;){var K=k(R[D]);if(!(X=C!=null&&z(C,K)))break;C=C[K]}return X||++D!=W?X:(W=C==null?0:C.length,!!W&&T(W)&&N(K,W)&&(B(C)||Z(C)))}U.exports=_},55015:function(U){var Q="\\ud800-\\udfff",S="\\u0300-\\u036f",A="\\ufe20-\\ufe2f",Z="\\u20d0-\\u20ff",B=S+A+Z,N="\\ufe0e\\ufe0f",T="\\u200d",k=RegExp("["+T+Q+B+N+"]");function _(C){return k.test(C)}U.exports=_},79264:function(U){var Q=Object.prototype,S=Q.hasOwnProperty;function A(Z){var B=Z.length,N=new Z.constructor(B);return B&&typeof Z[0]=="string"&&S.call(Z,"index")&&(N.index=Z.index,N.input=Z.input),N}U.exports=A},97541:function(U,Q,S){var A=S(20188),Z=S(27984),B=S(78583),N=S(28757),T=S(78358),k="[object Boolean]",_="[object Date]",C="[object Map]",R="[object Number]",z="[object RegExp]",D="[object Set]",W="[object String]",X="[object Symbol]",K="[object ArrayBuffer]",rt="[object DataView]",nt="[object Float32Array]",q="[object Float64Array]",it="[object Int8Array]",at="[object Int16Array]",ut="[object Int32Array]",ht="[object Uint8Array]",xt="[object Uint8ClampedArray]",pt="[object Uint16Array]",wt="[object Uint32Array]";function gt(Et,kt,zt){var Ut=Et.constructor;switch(kt){case K:return A(Et);case k:case _:return new Ut(+Et);case rt:return Z(Et,zt);case nt:case q:case it:case at:case ut:case ht:case xt:case pt:case wt:return T(Et,zt);case C:return new Ut;case R:case W:return new Ut(Et);case z:return B(Et);case D:return new Ut;case X:return N(Et)}}U.exports=gt},88133:function(U,Q,S){var A=S(91869),Z=S(13053),B=S(80744),N=A?A.isConcatSpreadable:void 0;function T(k){return B(k)||Z(k)||!!(N&&k&&k[N])}U.exports=T},86773:function(U,Q,S){var A=S(80744),Z=S(45029),B=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,N=/^\w*$/;function T(k,_){if(A(k))return!1;var C=typeof k;return C=="number"||C=="symbol"||C=="boolean"||k==null||Z(k)?!0:N.test(k)||!B.test(k)||_!=null&&k in Object(_)}U.exports=T},88411:function(U,Q,S){var A=S(20816);function Z(B){return B===B&&!A(B)}U.exports=Z},83383:function(U){function Q(S){var A=-1,Z=Array(S.size);return S.forEach(function(B,N){Z[++A]=[N,B]}),Z}U.exports=Q},24122:function(U){function Q(S,A){return function(Z){return Z==null?!1:Z[S]===A&&(A!==void 0||S in Object(Z))}}U.exports=Q},26332:function(U,Q,S){var A=S(52858),Z=500;function B(N){var T=A(N,function(_){return k.size===Z&&k.clear(),_}),k=T.cache;return T}U.exports=B},23730:function(U,Q,S){var A=S(31030),Z=A(Object.keys,Object);U.exports=Z},34776:function(U){var Q="__lodash_hash_undefined__";function S(A){return this.__data__.set(A,Q),this}U.exports=S},40393:function(U){function Q(S){return this.__data__.has(S)}U.exports=Q},79679:function(U){function Q(S){var A=-1,Z=Array(S.size);return S.forEach(function(B){Z[++A]=B}),Z}U.exports=Q},49237:function(U){function Q(S,A,Z){for(var B=Z-1,N=S.length;++B<N;)if(S[B]===A)return B;return-1}U.exports=Q},29405:function(U,Q,S){var A=S(26539),Z=S(55015),B=S(60844);function N(T){return Z(T)?B(T):A(T)}U.exports=N},40493:function(U,Q,S){var A=S(26332),Z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,B=/\\(\\)?/g,N=A(function(T){var k=[];return T.charCodeAt(0)===46&&k.push(""),T.replace(Z,function(_,C,R,z){k.push(R?z.replace(B,"$1"):C||_)}),k});U.exports=N},9171:function(U,Q,S){var A=S(45029),Z=1/0;function B(N){if(typeof N=="string"||A(N))return N;var T=N+"";return T=="0"&&1/N==-Z?"-0":T}U.exports=B},15333:function(U){var Q=/\s/;function S(A){for(var Z=A.length;Z--&&Q.test(A.charAt(Z)););return Z}U.exports=S},60844:function(U){var Q="\\ud800-\\udfff",S="\\u0300-\\u036f",A="\\ufe20-\\ufe2f",Z="\\u20d0-\\u20ff",B=S+A+Z,N="\\ufe0e\\ufe0f",T="["+Q+"]",k="["+B+"]",_="\\ud83c[\\udffb-\\udfff]",C="(?:"+k+"|"+_+")",R="[^"+Q+"]",z="(?:\\ud83c[\\udde6-\\uddff]){2}",D="[\\ud800-\\udbff][\\udc00-\\udfff]",W="\\u200d",X=C+"?",K="["+N+"]?",rt="(?:"+W+"(?:"+[R,z,D].join("|")+")"+K+X+")*",nt=K+X+rt,q="(?:"+[R+k+"?",k,z,D,T].join("|")+")",it=RegExp(_+"(?="+_+")|"+q+nt,"g");function at(ut){for(var ht=it.lastIndex=0;it.test(ut);)++ht;return ht}U.exports=at},76833:function(U,Q,S){var A=S(99045),Z=4;function B(N){return A(N,Z)}U.exports=B},20250:function(U,Q,S){var A=S(99045),Z=1,B=4;function N(T){return A(T,Z|B)}U.exports=N},28548:function(U,Q,S){var A=S(92918),Z=S(43607),B=S(8138),N=S(56730),T=Object.prototype,k=T.hasOwnProperty,_=A(function(C,R){C=Object(C);var z=-1,D=R.length,W=D>2?R[2]:void 0;for(W&&B(R[0],R[1],W)&&(D=1);++z<D;)for(var X=R[z],K=N(X),rt=-1,nt=K.length;++rt<nt;){var q=K[rt],it=C[q];(it===void 0||Z(it,T[q])&&!k.call(C,q))&&(C[q]=X[q])}return C});U.exports=_},76934:function(U,Q,S){U.exports=S(99204)},64725:function(U,Q,S){var A=S(86952),Z=S(32872),B=S(95979),N=S(80744);function T(k,_){var C=N(k)?A:Z;return C(k,B(_,3))}U.exports=T},79785:function(U,Q,S){var A=S(19554),Z=S(9991),B=A(Z);U.exports=B},9991:function(U,Q,S){var A=S(51533),Z=S(95979),B=S(12824),N=Math.max;function T(k,_,C){var R=k==null?0:k.length;if(!R)return-1;var z=C==null?0:B(C);return z<0&&(z=N(R+z,0)),A(k,Z(_,3),z)}U.exports=T},39807:function(U,Q,S){var A=S(9256);function Z(B){var N=B==null?0:B.length;return N?A(B,1):[]}U.exports=Z},99204:function(U,Q,S){var A=S(74809),Z=S(44107),B=S(11756),N=S(80744);function T(k,_){var C=N(k)?A:Z;return C(k,B(_))}U.exports=T},23190:function(U,Q,S){var A=S(14018),Z=S(11756),B=S(56730);function N(T,k){return T==null?T:A(T,Z(k),B)}U.exports=N},44231:function(U,Q,S){var A=S(89147);function Z(B,N,T){var k=B==null?void 0:A(B,N);return k===void 0?T:k}U.exports=Z},99946:function(U,Q,S){var A=S(3251),Z=S(63100);function B(N,T){return N!=null&&Z(N,T,A)}U.exports=B},37879:function(U,Q,S){var A=S(62348),Z=S(63100);function B(N,T){return N!=null&&Z(N,T,A)}U.exports=B},61627:function(U,Q,S){var A=S(6019),Z=S(66139),B=S(13053),N=S(80744),T=S(24665),k=S(57835),_=S(7975),C=S(18397),R="[object Map]",z="[object Set]",D=Object.prototype,W=D.hasOwnProperty;function X(K){if(K==null)return!0;if(T(K)&&(N(K)||typeof K=="string"||typeof K.splice=="function"||k(K)||C(K)||B(K)))return!K.length;var rt=Z(K);if(rt==R||rt==z)return!K.size;if(_(K))return!A(K).length;for(var nt in K)if(W.call(K,nt))return!1;return!0}U.exports=X},41626:function(U,Q,S){var A=S(55005),Z=S(38342),B=S(52495),N=B&&B.isMap,T=N?Z(N):A;U.exports=T},65226:function(U,Q,S){var A=S(38652),Z=S(38342),B=S(52495),N=B&&B.isSet,T=N?Z(N):A;U.exports=T},7941:function(U,Q,S){var A=S(86756),Z=S(80744),B=S(93913),N="[object String]";function T(k){return typeof k=="string"||!Z(k)&&B(k)&&A(k)==N}U.exports=T},45029:function(U,Q,S){var A=S(86756),Z=S(93913),B="[object Symbol]";function N(T){return typeof T=="symbol"||Z(T)&&A(T)==B}U.exports=N},16513:function(U){function Q(S){return S===void 0}U.exports=Q},55451:function(U,Q,S){var A=S(63333),Z=S(6019),B=S(24665);function N(T){return B(T)?A(T):Z(T)}U.exports=N},10611:function(U){function Q(S){var A=S==null?0:S.length;return A?S[A-1]:void 0}U.exports=Q},9924:function(U,Q,S){var A=S(75010),Z=S(95979),B=S(65487),N=S(80744);function T(k,_){var C=N(k)?A:B;return C(k,Z(_,3))}U.exports=T},70642:function(U,Q,S){var A=S(42813),Z=S(1585),B=S(95979);function N(T,k){var _={};return k=B(k,3),Z(T,function(C,R,z){A(_,R,k(C,R,z))}),_}U.exports=N},95987:function(U,Q,S){var A=S(2659),Z=S(40302),B=S(46962);function N(T){return T&&T.length?A(T,B,Z):void 0}U.exports=N},52858:function(U,Q,S){var A=S(52166),Z="Expected a function";function B(N,T){if(typeof N!="function"||T!=null&&typeof T!="function")throw new TypeError(Z);var k=function(){var _=arguments,C=T?T.apply(this,_):_[0],R=k.cache;if(R.has(C))return R.get(C);var z=N.apply(this,_);return k.cache=R.set(C,z)||R,z};return k.cache=new(B.Cache||A),k}B.Cache=A,U.exports=B},80991:function(U,Q,S){var A=S(2659),Z=S(93757),B=S(46962);function N(T){return T&&T.length?A(T,B,Z):void 0}U.exports=N},83296:function(U,Q,S){var A=S(2659),Z=S(95979),B=S(93757);function N(T,k){return T&&T.length?A(T,Z(k,2),B):void 0}U.exports=N},9958:function(U){function Q(){}U.exports=Q},5795:function(U,Q,S){var A=S(33152),Z=function(){return A.Date.now()};U.exports=Z},89409:function(U,Q,S){var A=S(88832),Z=S(522),B=Z(function(N,T){return N==null?{}:A(N,T)});U.exports=B},35769:function(U,Q,S){var A=S(22310),Z=S(96916),B=S(86773),N=S(9171);function T(k){return B(k)?A(N(k)):Z(k)}U.exports=T},60859:function(U,Q,S){var A=S(76106),Z=A();U.exports=Z},16473:function(U,Q,S){var A=S(99861),Z=S(44107),B=S(95979),N=S(30739),T=S(80744);function k(_,C,R){var z=T(_)?A:N,D=arguments.length<3;return z(_,B(C,4),R,D,Z)}U.exports=k},40617:function(U,Q,S){var A=S(6019),Z=S(66139),B=S(24665),N=S(7941),T=S(29405),k="[object Map]",_="[object Set]";function C(R){if(R==null)return 0;if(B(R))return N(R)?T(R):R.length;var z=Z(R);return z==k||z==_?R.size:A(R).length}U.exports=C},351:function(U,Q,S){var A=S(9256),Z=S(58506),B=S(92918),N=S(8138),T=B(function(k,_){if(k==null)return[];var C=_.length;return C>1&&N(k,_[0],_[1])?_=[]:C>2&&N(_[0],_[1],_[2])&&(_=[_[0]]),Z(k,A(_,1),[])});U.exports=T},4134:function(U){function Q(){return[]}U.exports=Q},97341:function(U,Q,S){var A=S(59406),Z=1/0,B=17976931348623157e292;function N(T){if(!T)return T===0?T:0;if(T=A(T),T===Z||T===-Z){var k=T<0?-1:1;return k*B}return T===T?T:0}U.exports=N},12824:function(U,Q,S){var A=S(97341);function Z(B){var N=A(B),T=N%1;return N===N?T?N-T:N:0}U.exports=Z},59406:function(U,Q,S){var A=S(13927),Z=S(20816),B=S(45029),N=NaN,T=/^[-+]0x[0-9a-f]+$/i,k=/^0b[01]+$/i,_=/^0o[0-7]+$/i,C=parseInt;function R(z){if(typeof z=="number")return z;if(B(z))return N;if(Z(z)){var D=typeof z.valueOf=="function"?z.valueOf():z;z=Z(D)?D+"":D}if(typeof z!="string")return z===0?z:+z;z=A(z);var W=k.test(z);return W||_.test(z)?C(z.slice(2),W?2:8):T.test(z)?N:+z}U.exports=R},44140:function(U,Q,S){var A=S(50230);function Z(B){return B==null?"":A(B)}U.exports=Z},91116:function(U,Q,S){var A=S(74809),Z=S(35024),B=S(1585),N=S(95979),T=S(49217),k=S(80744),_=S(57835),C=S(9363),R=S(20816),z=S(18397);function D(W,X,K){var rt=k(W),nt=rt||_(W)||z(W);if(X=N(X,4),K==null){var q=W&&W.constructor;nt?K=rt?new q:[]:R(W)?K=C(q)?Z(T(W)):{}:K={}}return(nt?A:B)(W,function(it,at,ut){return X(K,it,at,ut)}),K}U.exports=D},44065:function(U,Q,S){var A=S(9256),Z=S(92918),B=S(29098),N=S(41590),T=Z(function(k){return B(A(k,1,N,!0))});U.exports=T},95708:function(U,Q,S){var A=S(44140),Z=0;function B(N){var T=++Z;return A(N)+T}U.exports=B},81229:function(U,Q,S){var A=S(20720),Z=S(55451);function B(N){return N==null?[]:A(N,Z(N))}U.exports=B},65441:function(U,Q,S){var A=S(60348),Z=S(94484);function B(N,T){return Z(N||[],T||[],A)}U.exports=B},34402:function(U,Q,S){"use strict";S.r(Q),S.d(Q,{default:function(){return N}});var A=S(34634);function Z(T){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,A.isAnyArray)(T))throw new TypeError("input must be an array");if(T.length===0)throw new TypeError("input must not be empty");var _=k.fromIndex,C=_===void 0?0:_,R=k.toIndex,z=R===void 0?T.length:R;if(C<0||C>=T.length||!Number.isInteger(C))throw new Error("fromIndex must be a positive integer smaller than length");if(z<=C||z>T.length||!Number.isInteger(z))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var D=T[C],W=C+1;W<z;W++)T[W]>D&&(D=T[W]);return D}function B(T){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,A.isAnyArray)(T))throw new TypeError("input must be an array");if(T.length===0)throw new TypeError("input must not be empty");var _=k.fromIndex,C=_===void 0?0:_,R=k.toIndex,z=R===void 0?T.length:R;if(C<0||C>=T.length||!Number.isInteger(C))throw new Error("fromIndex must be a positive integer smaller than length");if(z<=C||z>T.length||!Number.isInteger(z))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var D=T[C],W=C+1;W<z;W++)T[W]<D&&(D=T[W]);return D}function N(T){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if((0,A.isAnyArray)(T)){if(T.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var _;if(k.output!==void 0){if(!(0,A.isAnyArray)(k.output))throw new TypeError("output option must be an array if specified");_=k.output}else _=new Array(T.length);var C=B(T),R=Z(T);if(C===R)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var z=k.min,D=z===void 0?k.autoMinMax?C:0:z,W=k.max,X=W===void 0?k.autoMinMax?R:1:W;if(D>=X)throw new RangeError("min option must be smaller than max option");for(var K=(X-D)/(R-C),rt=0;rt<T.length;rt++)_[rt]=(T[rt]-C)*K+D;return _}},81683:function(U,Q,S){"use strict";var A=S(55973),Z=Array.prototype.concat,B=Array.prototype.slice,N=U.exports=function(k){for(var _=[],C=0,R=k.length;C<R;C++){var z=k[C];A(z)?_=Z.call(_,B.call(z)):_.push(z)}return _};N.wrap=function(T){return function(){return T(N(arguments))}}},99755:function(U){"use strict";U.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABSCAYAAADKMvPcAAAAAXNSR0IArs4c6QAAFkdJREFUeF7NXXlsHNd5/2Z3Z3e5S3J5LClREklJlGxZtmzJUVo0boEICdI2BYICrQQ0PaJaV2JZSOO6NtC/+EfbFC36T902QBpFllxbDYXayFH1MArXQRugKIIojmQ7kSlKpMX7Wh6z3B3uvuJ7b76ZNzNvDl6ulqZI7szOfO/3ft/93lgDz+vP2ZuFHsh37YSOhkZIJ7zHN+NvHQAMMKEOrD4O8+YirCw0wNj9E9qJ2lqv389YoqP8/Z3bkoXmgpZPt+q6loa0Rtcxwy4YcBDl87/wXRMqwOr3K/OVCbN8/1zb0ZL3PPvGjDHtCvzX/r3Q1WQAfpmA9xP/bu4LRdOtrxzogN8MUuxOZXyxmimP/L52bCXqjv1sIN0De3b1mvkWTU9rhomSkrRRUqshs+8pDdk5E+UE0HUdCpDjv9+oTc3+XsMTQ7KsHFAE8zL898ECNGenoQQlG1BZyKghxjsuBEQ4gQOJoqGA+F3Ed0yAH+oj989rx8aDrvg37H/aHzGbesu6ppVMw5ZXkECgYWOi5EMEoNIFhKQosZA6ZwGKsnbpObhZG536QsPRYZKVA/rX7D/62iHfMgYlwG8EFL8/CoaK2dahCAUOaJf1832YmD+pPTXoBfVvjbe7e1OtndNgAH1zAkgMVWIYqGhRbBWQyoCinEU9Bz1QgHZoYO/lpn9yTjvK76D1s+/mdkPLI8NQgmGYBsFQ0+IozfRmqr0koCkU32aoLgDtgSL/OVKdXP585hPvE6hfK7+1e3uyvR1lxYnnspqmzVBOLElU+lUJGT8YBqb7mA2oJS+yEwHt04tQWl1c+O3Ckdsc0L9g1/tqUG8ZhGkOqGCnV3U2D1BSIT4cDigOC1VeAItAclB1AeoNY2TsxfxnRr86/73Wnlxx7xgYXE78KdQdJ9/kSMpSqsG0QPINxwMsHhc+yAU6gYqyFnUEU3x3QzP75dy+H2maxrQ/Zf/y+ATM6ggoqbsDZzy7uK6zLDDJopJzEmovwMTvJkixm0sjg9sbO/YsQjXJzZKJ7HQmnkMp/pNefoYhe2UnEyi3Gcxcbke5iUIbKgA9oBdhyJj52Ysdv7io/XH1n568q89qpO7k3dcFUpwP2aP2Dk14UbSo3EZZgCJrESqUC0EkMPFvLmsMp8PJZoEpyBcAWEwzQHKi2vdBkQNaSlTvPd98dFr7QzbwsfdhzGancEVb+FIA6iiWmP2cqUNBF8Di3wgBykUenUwSv1QMQPGcWMzEs2I4Lx6hmKj2OejRC3BIL0K+3lA53fbETe08e+XJ2zChOer+UYAZ7BBIpdC+oq0iNuE4bVZScLRmMEMcURx2WrYVQzuUiwBFtd9RbxaAnmXffPI2zHJARTi/Ra8AZvqGaNkvglJWTwrj7EtFORfu+Gg8ER49dODSZ63zUHMKus7tPKp8MZmtfLnt4ze1U+zykTswldhSQF3CKpwF2TVuEGXl9IOgtpkK5ln3JGcdaDdD1dy6rsvrSzEp6NwxHdALsCvbtvJs0+Fb2in2jSN3YH7rAF0jM4P1Iyjk8Yc29rREsjPMZkrX9U2OlTVZgKLK70w0rjzX/nO3tDPs0uEPYIaHI5uu8hFg0mHOnjgqF8Nh8AmJ64RCwiMxsX5VlxmPNp57er3oAHqyeunwPX2LALW9sNvHuhSb/xEEqCLgDok1bQgiHQyCHpFyEpghpkMAKmJRm6FPs4tPDMFcatMZGoOdwmHETP/W7NHX64TCWOl2cP8PgPoH5aiMZPCVhtM/MPdpfvZuPNZ0201ZVqFV7jtglCxUXmLoaXb58UGY0jeVoQp2knBC5Cib6XcI8cCMUOO4GuHRBnFVf3SiBrTy948PpkubA2iEV3XNbxwn5MuEFIC5HFCECQm1m/4owg+hM608W+J1hxz05SSGnmWXDt2GmXQchgbPf1hIExwj+jU9Ss39IZK3IqSyHsEaEcfpuWNjOYrI8XKj5eUzTSvPtR++pZ2sXDp0L60GlG4nV6194YSPRWr1sAdqMVMmKP1uvxfDAZFDQxm9KqlSUQJCKb93FmzT4JQEXSJZWqEE9BS78tgdmMx4GSoEFV+5atLMpFMzddBW8d6NSieCb+YDj8Cy/9ASANShqtVqtUYjBQUhtKqC5Fc+ki1T1eq5ZOO0vlqr8o+jCPxeIbJYotCp3jP5x/GfPMCyUWkwNdZW1WqanKVRO8TH0FOVbzx2Jz3vApTAxHy10dTrVX3bzR9q50KtXjCS8Y583Pir7pVqtdNQNgbd3hULJ9jbQRvWZiZ+9p2OU4vx7rK+sz7509eK5SzrdcqFpiCaHNiTyp9hLz/6AUxnZYaSwRWNs6zxz9pX3lufKPE/9bmpi00TubmHsKWBMyf+VYRdJgCqGsaAbSxf/07rF34U/y7rO7Of9SfeHj54hPfZrEK2wEjKlGxAKy8/ei8tAKXGHFXPsZKyHVrqZWi+dU07IVRqi16fW764YxYqXVjzVBW5KezCOiSykxp6zbXG2y+1f3Zhi8Tilz07+2bh/uLSPixwi2agmGoBqJUpEaDn2DcPDsFsgxdQwU5smGEronk1CdkZHUxTh5Tdyw8eBNa0Q17cSCFsGbacX4aFFS03Xy+13odFbToAUMrPHVWzZGON9Tqk5nS9oaxDWYtjO72S2bYU7U0O7SaAmauz5WWAWm0xs5hibaPl5ST2sdyASoE9AXqaXXlkGCZzKoYKQIsWqKLNKyzHWl7q2BHnWW5r2J3MmIBikwwdgmjmWdV93SlI+yRcgwfAU0WHwIQx04BhE/tYom29LkBlGyqaZYKt6AQIToV1i6gYuYfoCC0E5W1hC0xZ5bmqe6pHvLhr9capj4/FXvqiOyknPkbFSkw2gMFBFKCibMK+yyqvYOhZdunAXZjJywyVvTyt6PDBSYZEEjAss/AyRhh37KmLvjr110lgb0zqzqOFnvDWM3dQwkl5c233PaOCeOds4RQRUEs+q12NMlNPA69Gk8pzea1p5bkuEdgfGE27AcVLC1sl0ita3ZExswwrbdyeBZbcQvghgU+evGLWNEMX6kVmAK/AT7WZqY5Dian4M6MnGYc0Iv1VG6u0eFtyuyZUOUsrqzWN1F9ur7vDJgnQp9nFhz+EuUZvkw6FxC8EMw/J+XYwRq5p/Zvu6XFd1a8sXGydqRu9Fa2acHW1AsAh1UZWZrWM0VrO3r3WfaK8Fsse99zjkwONE4uwp8LMtB0jW006NDPYqHMx9Ay7/NA9mGpSqTyC2W5ma0/pf/ROv6bV4wqxnvOemnppR1mvd4ng2Un5VL0gco1c1Yu5d69pWwMmjePXh95oma6ZfRTY22ETb9JZxREnsPcD6qziKEAnFIxvaWc+ksB+Vq88JBZ+kdKrXB/ZzxxsSzXW/7H1Nz+SwP4Hw08cQbMke3nOUAKUbOg5dmn/ECw0j/F1TcJKcNtkiqUmPdBhfk37/DvrYd1aPnO8NNBWYqU9TmgSkCmRh+chUwG2FfI/7teO8RrDVr0u3L6eGUnXHyNPT/dRAnpy5dL+0Ywf0KJZEC1S6IIE1Ef/TPuNsa0SGO3omaVvHRirreRwqU3YciC+AMJapYe2qwFS83/S8infssfNlPXZ8bf3TFQW25zQSVxdLBpDlS/CTi0rvPwp9sq+cZgtiJV3FkNNEYZgUI9rdzB4zkCqnKhoq5lMGjJKadXvuk6tAOCHK/gTKrgknC1ABeZWzYYJbVEXAXQIoLYzcOqQyNJmlqqa9VQFJcikQ+SI5VLR41dhoVKBMmOsnNTSU5XFLAX3aI7IwtNyIV5gJkDPspf77kOpxQbUFCovqtEivaOlhRQ+BS8aCFpr5J8BVGgeg2ImgmtTEUwpuPd/QrRNeNJh2S6eFqNZ0gt2aBdYC42gLFlrCizQVoqgXmRJ7uBeyOGKQ9MWQ8+uvNx3P1NqwQFRcYQSf8rnaTUcBc+hgAYKLjkYa5YpsEdVotXIOBDlgiCr6EtJh2CHtfJZFxmcCPW8r7UlyrQskk+4FdBz+SyHROZIhJRC5Q/kCtBJDP0Se3XvMEy3IkvwAuQKKHB1gmchdHQ13BlQGPA8sLfA44EzpnuujQcSMJ5ekCvp4HVRAtMrXQCYvvTTfR7JJuf0fKGavVRIoOQsdChAJzH0NLuyZwzm2mSG4lCICQSs/XdgoytYeCq94bXksVC2RHGncqGvxUyZdwQbTbA3i49nksKZS3VPOxW267TutU2coXoAoGI7jXiR0DKwtIxPrdVulQ42WfJARLuDcmf/ZpjgdjNl7k4G74XRuo+iGCImWAG7JzXGMcjAyrqHQvPVd1am1JnGXP7RW9oX2dXdIzDZ7rWh1NYX+bEOmWRiKccS1Xolqh7q97Led4SXB0hkdFYGU6vVodGsmbqLoQpm0oAICmJoBjJG3VytZALiD/fkZn1zzd+xZKINUsm0zmpVUyuvmrmalsgQ0fiHJefoA/Q8e7X3LpSKY6YIm9BWyNUmtJwNK3DvP5ufn45wlOs+/Mm3+lPLB4oPr6RqWTIDYWuPZPuey2Qm/739t0bWffOID2KMfOzda33lhGgiykUbjDZ8gJ4qv9o7niwV5UxJ7MsQhZF2lqlez1z4yVYJTNf91MLl9qXK8m5h/MMMhuOEeMG7C25cW8eWxrWM5/jIQMP0kn5Qlo3CNwJ0V7pp5VlU+bPscs+kudzBvbwVsNgxFhSgg2XLr2aefnctAqznXGzSLULSyuWDthYKZefhCuRge6q1frHzs1ufy/f3J278zi8csdszcl9e13m1ybahz7Cr3aPmXKcLUBP4PhwM7Luhtf5Lev2d9WxsXQuwJ5cGtk+VzZ28++rZcyQ7A6zR2gE1FKDM0j/9u85j2OLfsteF29ebx7XkfpF6ikyJmx1ebdL5Uhyboc8YV7tHU25AaRcG3ykGRWhmueW76buDX9+i3vyFmevNtVpl7z3NSPL9R1Y86kZIsJMCarE5rAA7k9kqtMIHz2mf2JJ6aP/QUHYpObpvtFrJYLZEsnkBtRl6mv3DrmlzYZsd2OtihxuygNJOBBXrfllIsbxVeCYzt8Y8hJwkD0cqepXNmGVtAsraoDltN8IowfCGKbaztOqQCCiuHkY7ljVTLM/7SmGveNJiXFzRdVaqGjC5Wk4MG6JRh9mSC1BsI+eEytsM/SIb2DlulrbzXN7OlNy7xbBIItJPquOj0PGECxoe9WfQblNnUbBTxMK+hQ7WDJIERe5hRQMRf6JdRRX0QRri4AJlk/pJqOY8lzesbZBeledxaM6xoc+yqzs+NJe6BKAiEnRUy9l2jbkzDYZDGbmk2iuuJ72z7KTcoPOnn/7A3snlnU23GGCvr84QHPxTqimah4KZos4gXtzLc4YKQG2GPr18dces7gZUfEB8UZ7sgBmiVpEg+0GlYgMVRew4NGDDAA2HPwyA5LPy+cBNhyFJAoEjsnNMjZGC4ifP5a2Jp5+kOTag6OWxOEKZ0tnlV7om9ZUdVDqTAxZyA2IdiOMUYu3YIIJGFSKsJW1i5t13tw2uRHZKiZ1Jp8mnk5xJc2oIqrKiwmSFpJ6OdE7iKnt5KWwa2D5llnZyo+uqlbsFo4WtfjE879hChdhYhV1zv+VWRfeVFBIoNGPjBRJhbny23Jpl0g5SeRvQL7PXto2ay7vCAI3aoMrnLKCH7jf8UevrreMWvYhljhsMmsAQR6mYZOUkKR2YLIFjIILDpqXXtpXSXkCl20WorD2M2MwMYq7/ni6VVUUVLtkCrhtgP51rh43Va0aEpaValeyUnGrT4uudM5mF7mETH48h1coDZ8vDOes8j4HwEzPCMXBBPfeMd82IEC4EUNtfB4ZW8pQ6YJL9VtrQC2ygY9w0ehBQ53ETqghNbT1jq3qcHRjC8tthCf2ptIeRE2QBrQDLNVGhYEoCWcyUV/QrAT3LvlucM2Z6qUlnczSOqtureaMcUMhxgk8JpId9bpKEJxdxVT3UbnoZGsOGnmevt88ZC7sH6XlNyv3TG2Bn3NhUGpi4W5hN3AQ1l8nnU0i6N82goyviVHmNvScOPb/wevtc0gLUWp/pvr7fq0baNrrAGsD0WysFoFGOz2awW0IZlvh2U3ZIXtUQRsgpMEup51dKA20TKWMPFkeo3ucA6g8uYj9ZJnT7odqzBjIzhvmxiBPIbN+1I22nzQrrFzdrAwH9Evtea8koYSs5EtD4+9AjVFKxdTpUK1zqGWav1abJvnYsx+hFWgbSY0P5pgWPyv8Be6Nl0jD6/IAGsTO+g1HFCrZt9NhMRy39Jsbt99VX9W5RVEIbGR4FEUFWeSkOlQrMdhz6InuzMGJM7iNA8aOqOYql6pGhjF/VQ+2xy2b6LaHDvGCNsFU9EMwwWxl0zLKhUj3UBvQCu968YMztxwIvX0ooEcB2FJsZHknqGw/MGOYjTkIQGB7JtlJ2jWHvSy0Qbz30Bfbtpglj6aFBqTjiunecHD0uMwOD7CA1lxmiUHXPff3WLqpu4NhEd5hGghLA8nnid+6UpHqozdAXpr7dNJFzAJUXanEB44Qqa3zMhd9fSmC5QA+z12GrSiRWhzJTBZwKZH88agPqdUrPTA40LufhYVR550GscZ8sE8UAtc2MdkBrY6baKMSVTRW8e4H2MzWw2vQ8+7f8lFE64AU0cntKXDW3WK6yTi41i83M4PaLzyYHslM+oFJrWTNUzlDKlKwWiK3y/eyt7JAx9ShVm2ing7ASIZ418rkh7rqmn3PrCI8CJtGR1LpmqEf3jssbEpGdk8/zT4DNUMspFSFdfr73yXc13Lo8ahw6fNuc1cSGAff6O2XUt0Z2ulVSYRfjslNx33is9NpFFYiyw/CC6bb63nooLmdsyqbnX9h2aJDvLD658NqB0fpynnbbBoTO4u24YEog+Rgk38DHpgBHpPDosqVT1VOd26jY5o0JvDrkBV3+21pwIS0WSzYnBvtbj8xzQH93/Ep+Lrv68BSs8Kduh2pMnPTNuoBbucKACok1Q6KM+OwM89xes+aeJifMcdMC/8LFtrjIYlcmV+rv/tgHeBd77/vxyUvbp9OrO90LDaRZ8zw5Uc1iqxQch3UbUHM//GGPenMzi1oYjkNUHZftqHukCCQPmaxtibu0bLUwXHmv/5jYK+V6mMDx2YHCXHWuZzFZS+NtnI6fNIsK+op+tqeCGQcwF/toiYV4k/+rUHNnimV++sOzULO1zoOcLjp/RgFfWNGebZ6Z+d+RkWsnnP9DhO/pDOikfry4p3VxFfIsUUuximmdE3MfkktY/2ph5Vis/UtGHdJstZbjk2mB7fWvYu2qsGGJVKKerIGhJeurfPVy5P+fYZ1ISh9r1JN10FLV1qbC3Nd3HHUtbPYxdOO32/gVfvX29cxKcmm3gcvEPY8col44bi3Pa5mpo3s//eFWb+pd64hiPD9krZfc+Pm4DPvXhl7vmanXinJHhq+q1nVIm9m7bzzy6ZmN32nzr/BAAorDRNPzg8HHDxqwmhGlQwFmkTXMX96/tXs7NwLzAwsoDur4rX9tMzKre2jFMIYpzT3dN1/S9lt7NjYy9K357AMNKP6/koaG3zpCgHYmM7W/3PXUja2BYnOu+kADikO8MPb9DnM5qWUSZS2Xblr96q6ffyBtJ03H/wHu5An4eGwyKAAAAABJRU5ErkJggg=="},92691:function(U){"use strict";U.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABUCAYAAAB9czKDAAAAAXNSR0IArs4c6QAAD9VJREFUeF7tXWtsHFcVPrO7s4/Zlx9rx27IuiUkTeqEqk8VQYQqVYgfBYlSWS0tFQikAEKV2n8gEP7Bjz6iSK1KRalQW0RbCBIqlUBFqOIHCUIlTR8kbY1jx02J7cRO7F17Z707uzvo3MfszO7szJ19WdHuJI7t7J07957vnsc995wzErR46bouLbz7YjIg+aL+YCyglbb8LXbZ4dvDALAFAPjd/mr8CUAoKOuqulGRwaddVtWNfV/4zkYrA5aavfmTfx6N+IZ2p6PD10YBJAk0DfAP4Bd+6+Ald7Bv566rT5Zl/FkG0AuV7KWza2N/mjkvTU9XvA6tKQBmTj6X2jF+S1qTSpKmZgA0FTRQAUGwUL/DQDSerIlQbETtBU0GAoCsgCwrAHISCvk1bfT9K2ekqamyFxA8A3Dm77+Ije69ea+Wz0qaugqahl8q+aIA4OWB8tiUU6fmNisZvUxLrG1zoNC7zADISgrwq5RfV1MH7/lQ7Om0lWcAzp/944EASCE1swSaugQq4YAMaLWrn4+CExXHLYhLc4QhZGm43h37tFsEjcYry2y9IAcgJyRBVpIgJ8dBSY5DZmlufuLQD9ZEQfAEwEfHH48nxib3qpnzgF8GAETu14gfpxHUThjZmdxfT6bmwaADMNOxcV/s+USuuy8U0orpAOQEzgFyKg1ywL85cuM3ZzoCwNzJ59KBYGgkk5ljAKxS+W+IHjZpQlDRIYhIcufV7eVJrpxg6cydbZEfCAegGEqmIRDfWdl52/3viI7JEwfMv/fr6yv5tRgCoGWWQNVQ/FBK+wO+YiAQUIuaLIVCIdHnAxQAgDfHn/HC3/nPNj156L2mQ96xtx64WYrGKxQK4K8UQmVJD/O5oyKmAIyDktoH48PZ09Kehx1mUJ2UJwBmT/3yhlLuUoQDQBQvV0igrB164M/z4pS/elueevW+awKFrXHO/UQMoS4gAOyGnCzN7rnj4azIDD0B8MG/nzpQ2lgKqcgBxAKiqx9ZMCLH1m/92u/nRB56tbeZOfa9nRUtO6apKH4zKIQAFOQCCkBC8s8N3vnIusg8vQFw4skDpcJyiChhFeW/Rswxwn6RkcwtX372rMhDr/Y2Z197dJem50e1DNIAxTBZhSAnU6Ak0wCKPD9x6EdClpAnAGbfOjqZXVsIawiAhg9HY0ABRRkHX3Q0e9OXnpy92okrMv65v/0srRc2R1AP0o0oIQRZiMgBoMnzE3d3BIDHJvNri2GDA4j8TxL7NxIfy97wxZ/3BACL/3gsrWZyI7gQURR3HYBM5jyAmiG+HwpAGpTkjo39h6b/K7KCrvY2828emfCXMil11Q6ANICmdJ4DCOshAMQGToMS3rGx/64+AF0TQQgAcoDCAeghDlh888iE1pADuqQDKAeg8kclnAa55zhATamr1Bzvug6gfqDeBYByQD0ACprj3bKCDADQDE32FgdsHwDHH5vM56gZ2gcAOYB6hC0b0j4HdN7IrXIAmuNLxCVDPQLjgC7pzm3E+hxA0OUAaIwD+gB0ftFbnmAFgB7JGi7pPgd0Hg17DkBvaLLDVlBfBNmIoBoOQG8odMoZ1wegHoDMEjtEpu7oDivho5P53EKNGUq9ob20E7aIIDwTwJgoYAB0lgP6ANRbQTQwgRzIsIP5DoqgPgAGAHk1Rc4DajgAvQJa53RAH4A6DthOEUQDlHpUB2wnB5CYIHTDmo4ke04JbycA6IQi0QAMAIyH6W0AaFglj4rorA5YXwijB5AcRPQBoEqYW0EsLGUbAMDzgLGN/Xf9uCcO5RfffGYC8ldSxC1PlHA3OSC3ENZW0QVr5oBeA+DIBOTVKgA8LqgbHFDCnXAdAKgDdvUQB9gDoKArotP7gNI6uiKsHEDC8XpKBG0rABeoL4iHJpKwlHGQ470TF4S+IC6CIEODlI0Y2VSHd8IWDsCQSBYVHI6NqaFwdFkNxn1xiAMkyF9yZR0CtfWYphsefGrZGlc8Fql+xv43w9okYgr7rBqEzH9KlqN19/FO14DGzA6U6ttcYY0GSgXL/anBuL6Cn11agUpR1SV/YEd548qgcTbeLQA+Pn50Ul2v4QDmhCIeURKiOE6cUiQ5iKf8NDgjaZzR5XSo0mrSUpMHNpiGi7lwuOJRBPOwRAxQ6xYAs8ePTpY4AGwfwBPVSEwMIX6SxIvyHCo3UtpnhjVJpLrbvIPV6A6SC4HpWEhwND0xP4J8qTSzjYfpd1IEWTiAAMDsX5IvmwQgxGe5s2xQjqRkeWSEUURyylw4SqgPNqCmuI9wgUoDk9ETQBI0WJLK9gFAKM0SljFXBBOX6f81uuw/MZOkEV+YcnTtOie0sEGyJomQ3spG4QK+dVQsG5RxQ7U6AM2TIOcBXecAg1Y4VJZD6wIAmT/NaaCX7eo3wYTqBGSoyHK5DJCNyrES3lbQykaCSUj268Vy0Sdr/phWyYdoyQQRtrJfJgxq0wB5Ki0dMO262v/2AGDkBrusdiMP2Jkz7EhBICVlAWSIKvLZ3VN/qLGVrHdh8ZAPXvrGDT4tH+bJ48Yi56DzRdM8PtWH8j67zwG0RgTXA25q07s65IKC12RIwrAyMDM69eym27NmXvnWvkouF63mMJtWahtHTObEwewmACRHjIdlu1HDURu43UzSoNl5axJ8keFSJJZYiUnh3EZY9/n8IUlSg5LPvyXl8kUpoBf9uq+UrGxkY8Rby0zEWhnnvBhqlUJ9awtHcabmJQu6pwM4BzQmYrOrvtqjFQB66E0LY9AqJVTv8DIJxERE0xBtdQ6ASReIj8dZpDLfm3Xi3eeADgNAWJsrdWrmGiUBFNxncAC4LkQbHSu2sM0SL6PD9JQY8WutgupdtnqEQ0DWAStXQDgAOpMjxvcBZCeIZWpU+wIdlGytb7EMS4RkoiPBORBK/U6bb5QMO71av4isWDdpJ/C5E1+Q8RlmaIcAOHviqQOwuUoStXmSnpipV5WrvNiLwHyNJoYlxPUBFz2WBcsULatbZJTPqdsb2C+O1gCiC4TGhqbRPzY/IFiyxlOi9rm3nhgrr2XkcvFyRa8UdRVZvoUL17H4RVvjv3l/0H7ceYBIMKBjpJplZGSceCf/Lv7U2paNxiwFgpIUS0iR2A5JzUiru6YezYs8xRMAIh3223ijQB8Ab/Rqe+s+AG0nqbcO+wB4o1fbW/cBaDtJvXXoGYBzb70wlhz+9EgwFPZpuRzocqXh8Z+3odi0LuL/BV27cW/h2kXrDYJBgGIRSsXs5sBn7xauHOYJgMVTL08kd92cMmrkGO5YJ7eih01ZO72UgiT1MDrnHk2FXDfOv31x+I4H/ycyBGEAZv/128TI+Gf2UOKjz4VWS+Eu99Y2MiJDdZm/py48kJ2vrUZnF+SsAq+q01ALRPQLp5dPT05NER52uoQAQB/72swbB8v6lsyrRJEjObL9N69+syfRwyRtRtgWQM3eEGOYdFzN7MidCEkr6VJ/FSRToFW0zZHbplzrhwoBsHjypbQcHR6hsZAsMBfPQ0m9aPthuRPQvKTcW/OniLc0jcvl4KVV3xUZExdB3GOLEXLqeVeXhCsAs395OjRw7bWTWvaiVAUAD6X5YYzpeLEtMtzKOe0guHMf7k8Q42VWypgDkEpDQBnUojd/9T+SJDU0VFwBWHz/lX0AehTjYHg0sCF+LIu/3vtJptaGYz8ricTIYceXRj9ucr3u5uozHZ/OvbYsRhQdc6Gythr5/AMfNxJfjgAsnnwuJUd3TpDCRKReNK8SaFr9doPloRptdUu7qTOmCBs0sxDfrKpEunWsQV3DQdwrynKG5cSn9MzS0kfXfOWwreeyIQC6fsy/8kH0YGlrxc8BoCdO/EzcLvyDzoYopDaII3fh4K4ZCK1rIzCaAMAKr5P+wqopeDZAK+liAadyKLQ1fPu9Z+ywbgjApXde3iP55QQSv1702MkVk3XRBrHjvJ7NhG988GMhfgtj8iwCjVLGKYBUGpRUGvTs+oXYnd9ergXBFoC1d14YKIVHdhOxQ8QPFT28VnSdYGc0QGuCxEkSm7h5+S++8jlMDfQP10HmBSsocszN6O1edA97w4bBBWnQ46OVuVPLp289fNiyFOoAQJv/0unXD5aLazKpCMWKk5LzVv6OmJpJbB/h66lZt+qbXAj1atdd3FlAM5mlkKKFnHyafyNx6D5LGlcdAMTmDyZGSIFuYvlgSa4Gb8ggstW0Xltkc7FTZPeVaFhfTRK/ntTeeNK4n59jE12QpmGLamZ+4NADRl1pCwCzs0+HBjRm8xuih5ZjMcSOWdywNya1Y1cpNkUX4ruGO4rJn/qxiI2utndzTBMgCOP1ewMLAItv/24/QFnR8A0ZmAdGwq+pz8cq92ksjmHtiM3LwboW6cCZCHU2vllsi3RfF0DmZOm4d1jVG3gcjRYRC99PpaGoly8Pfu7+BezFAGD5xG9G/UNDu8w2P40ss5qvjmvQ1vfS2J5xFybuE3W1llh8UdVr6Px6lebWenWctgobxTRXyFjic2yXrsClGenGh3IEgDPHpoMjk7dPljYu+KjJycJOzFEPpGfBVWhHN04IYpkwWdHgxT31FogYEPatqmOuG715RyygvzyDY4TEMDeFiQsqodBW/PZ7zxAAVt47dj1IEKuufpb9zXZTEoAq++IZLSKVo2SW9N/tujr+9JxpZvgw8++Ck5aKJUnSKwmtXIqbE1kgieIoTfRBOZv/mALw4V9voXKfeztR7qPokUGqyOsHD7/WE68mEaStp2bLz3/3uoqqDhnyw7Q3qMQTBQLApXdfvSl/ZYGJH/ZaDnKHAnJo4PL++18kCqN/eafA8vM/vM6vbQ1ZXnjEnHX+wR0UgMUTz0xom+baB3T187yvYDixEvAN0LeGJpP0m/ex9MYdzFUmqVtSRS4kSmpmGI0ZHipv+IlSadgqRj8hAODu99wbP91b2Lgc47WQCQPwiF8eEs6jkquHcFclUd1NCbEtoe3k2SkhcdlnaLg8JnPTN46wjauSgkB8cHXw6z+hOoCCMO079/ransLmSoy6HXjjJGAKKs2ArKaferYI2gaV1UnQtm4FrCCRZ1FXCE1pJUQneQr4MzPnMbE9FL0y8NCRc9ifZSNGXs782vcnttTscNVu5q9s5d9rSe9g5omM2K2Ni6nY3oXQuDezV8P1mSSdlYOAx7aM+LIMvkj84vCDTxgRE7be0E+OPTK0CbmdoBWMkBsS/075wrodMCW+1R40Ge0tuQJ2uzXXKbUW3+9xdbe+pPhLratBCz5/IC/FlAtDU49bkgwbngdMT0/77tlzMRkJa1FtS7e8ppy+WzFM/haKNFWUv2+x4A9I+HORpZCStzaG+e8h9trI6gskeTs3RuCfN/c2SNHeWTvHt0BW30PpNpZg0F/WpNKWpqqZaw7/yvZE7P8Vipiu8V4ihQAAAABJRU5ErkJggg=="},46016:function(U){"use strict";U.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFYAAABWCAYAAABVVmH3AAAAAXNSR0IArs4c6QAAIABJREFUeF7tfXuwJFd53+/0Y3p65r53V8vu6slDKAghg4SE3kgCSwjjOCSlKuwKxIaUE7tC4nJRJtiFbxWOE5yKqxLsuMDBGMlAkHAcwBAS7AjbvFYsK7FiV4+VWImVFkm7e++dVz/Oo7/U1z09t6enZ6Z3JcgfydRu3ZmefpzzO7/v933nO48R+P+vWggcJfLC57FvEGCXA/i2Az828C2AKEHfBn545UV4TAhBfENR664/gZOOETV3DbASGCwqwqLvoZ0YNKSBIxzYQsKBDUoIyrKhJEHZAbSyEDVdbIaEzQtX0Mkr9mIU+b5j1GxbeJlN2J0YrCY2ElJIDIAk/Ze9yMCCA+EQQtPA/TdcIDb/rwFLRN5WhJfoBLsswk4Q2lqDwIXnsnLpkX4mrYfvAZicDAaCT3FESg4hDIQGSNjoJ4QNO8EzF52D588G6MPHaS3SuNh2sCfWIKWRCAuGy8fvidIGToHlolkCFv/3GnBAiJ5/Bf73TxRYIrIj4Fylcb6KcA5x4RhIg0TzewM2I1I2EhMBNkAMFtnpcQzBTi3NmAxQB4BkYAUsh48LWImBxYALCzqx8SxCnHjlefjRPJAfPE77jMErAaxECobBlBpGJUiMgpGERCRIlAJx40sbZBkI14GADdu14DRtuK0mvv8TAfZ5ooWGwiVWgr1Gwo6BxLZTBjA7UyZYNkykQQ6lhU6iFNEMUMXMzVg7ehkNoQWEw2gCgsEUTspcSySwLAcWg50I2CnoCZS28ITcgyeuFEIV73XgBO1EgsuExopUMIpgtIBOFEygkOgYxthIkgSJVClb0/9FKbA9WC0bTtNFo+3h9I8VWCJa6ir8vSTGPrApZSCmYNoEE+oM4CEDUhNjs2dmjABlc1egIhKRznwDA5qaI7NTQzTclMmWcCFS8zQZsA0LduLAshM4FrPOwpOnNY76Gg3LxattYHcOaGygKYGOE5hIwuRgMlOZoTmYatjQsQRZAsITEG4TdqsBz3cR/liAZf0MFF4jNc4zGsayoTXBEJsVYIhSMBPbQRKwWRESBi9MRTUrvGRGDNGUw2P8mQ+JTFdHJGZQNSBcF/xGRALCNrBcF4IS2JYLyxOwVZKBLACL9ZmZnfqeBCZMYLSEJgM9ICSxRGIlSLS1raWCWSvRtRrouAmCTY0FinEus5fBbdgpsI2VNuIXFVgiEp0YL1UGl7KFEqAVGzEDSjDMCtvJGMqsTEHM3qeaVQa0yFJV+DB6OwQ6Za+A0Gob9MSC5TpAEsOymb0WLKsBhslpZBLBoHIhWDMTEtB9CcOAMjuTITtTYgr0mg6ef8cV2BBCjKKBj/4t7bEMLuglGfhNC5bfgrvURvSiAXuCqOVHuBoJlhlQTdCkoROCDhUMV4CZmrKPgcwdQEGrcvCmATqUh4y2mfaOXmXgmUF8QqrDFizHBVLGssMj2Hl0kUYgFpJBkAGaWgq/mBkSGzvbeOZtV4pgXOGzT587RJec3MIOI6ClBDUaqdW4q8DGiwJsENA+beG1UsLmOJMIipmaAEbKzPRTL5qBm4I6BkoBpSo2ngmgIw0sPIBBZmfHrOb3+d/UQtgZ2SD+OwLPwcYS8Myd1wpWp6mvP/8OXddNYIUB1IBALgDfhbu0gKdfELBs+psSlwngpcxOxYBqaGJQKW3F2YBWmTczccxnD5lZg6U5jWc1GgObsrnwnNzDG3ZCDYgG4cl3XieenwXqVw/QctfC63shZF9BhTESvpaBXW7i0FkDy6B2Fa5OFHZHGZiK2cqAxir9zGY1Yug80y1WdMS6wpsz0du6DC8/hyWj5cD2mnB8G0//g9eKJ6eB+z8fp1d3etjTDRBHYRrKJZTAai9B/NPX41tnBex9RM4VEa6RCmsJQeagyiFLWU8LzmmmFk5l2RCduZJRxfBpllBu3ZJO58A6LlyOR1sOnr/jMny/3LFYJ7Ku+j7e1FEw3QHiWEPHBGoQ7MU2tn7pDeLIGQPLoL62jxsVYYEsSKmhpMyYmrBzOhMdnWH2JTUYk4cz1eGZ1lCgJLFXt2E1Xbg+B/pNNDwHp2+9GAeK4H7pIF1gHLyqFyDaCCCjYeTXdOD4Dh5+z7XizJwXm38vwvWxwiqDGkZQJoE0zNQM0GQYvoxZ0LxQqa7pvhiAVpA2syiV9vlFw4HdsmEza9tNuJ4Lr+ni+JsuEYf4NMbgS9/DG0MNdzNAPJCQLAN8bctD8s+uwXe4EWozNtXUEFdJjd2JhZhBTRKoFNRkGE6Vvf2c2LMuoMXzpknDGGCF+HZCrwtNXnaS6VfMWA+WTXCWm3AcN2Vtw7Pw6O2Xisf/1yO0N5K4vBtBdmLE7F/SDgLBbrVw4p9fk+lybWA3+nSZSXCRIkipIBnUKElDqyRRhfgv160z8OJ1HFve6xoDas4zpoFaBWjeYMw824JgcInBdeB4rLmcuTI4pAUuijT8QQgVKigpYBIB0UxgbZ7GgfU7hawN7GBAe3oGV5GGlGz6CWTMmsp96cxRbfehK5xObVAKCL8YZl/W6SqtnSYNbgLLZ+YCTtuB02jC4U4D96Olhu5oaGlgDMevMaxGC6f+5U3iaN6Ycxl74gS1nGW80cSAsRAHMjV/xaDGQ0dVLvDM0KiKZVMALVa6CPSE2XNkXhX7Fs2+gr4TDrKEsmtn4AqC7TRg2RYsNvuYe2gGJg5AnF3zBRz7Ihx47ytEXBvYjZBuiCWWJCGWCkpLqDhJdSWNUXPhn2XOdbX0x8HS1OxLwFcyuVSB/BwGl8MwDv6TLAcMxfnjYXaLv1tZxMavXC8eLbTjbI3dDOnCQOEyoxAzW+MgTadpk4VVo+zTNIa+mIDWarhizSpCuWlmP4/tNneJLQh7mK5k82ddZbAXbVi2xMH33rHN1pkae/gwNdbOxa2cb45DSC0QG5mFVZwBmrCskieeyuQqsy+BMNPsy+CVPtfV0XKjTwW98AU7tfyja8FqO7DdFp59303iWLkYUzX2mU16LWnsjQWiiGO1JJUAkwxBrdPFnMWyMwW+CrB5GlkFVhWgdUAtnsMAew7sBVeZi7bcB+68Mx1+G3tVAstDKeEmbuawClYKrIolDCeEixFAbW8/rYtZPl7h2MrPmArWHOdVF9D55ynOnAuvCXvVAf3aLVmHoBawT27R6yDxkjhBrGPEQ7YmHAWMJKBG8F9mWRVLp5r98EGVma5CLYr3nJCnGefVcWDTmMwObdFR9oLnNnwnPParN7WOzwWWw6ukiZs5+A0lYm0goyRja3pxWUurWFbQzLEK1NThOmZfRyPr6m25cfN7s8mbZDSgOYzpXLiJshZ92E1PNHZ4oPdc53y9zNoJKXh6ky6PFPZqBlUg7kloBpVkjeT0DCc0pskFKkzoZAWVzuacOo1TbnS+JmH9tEGxwWOWjYuRwOLMlUkUpXEbD//Yymo1XWvR042dbXhtzzn6C68TTxVZOwYs5wOePInbeCS1ZxArk/ayTBQP2VqMw6v642X2lj6XzXYsbq0b5NfR0jrnVOmGDYvNfMnBsffdJp5f/zKda2zsiwNFyrgJg8u3Tru8Duy1lnAWPXhtH9EvXeV+cyqwx0/RPqlweWQQSQ6vBtA9Zuv2+H6t8aZKyTgDllZ6+5LgTdXIOedNM3sGlP8v+Nj6jVuyYJ/zrt5X1BVBAqsbuQnHrxlzgaYLu+kIe7WNxkoTzRU4f1scyhlj7A9O0VWxxGpoEIVRxladpEPWLwzQCm0+I/2ry8Ap0ccEOUuWlIdPyz70+TfjwTt52sfw9R/+hs4bDHB+SEr3wtTXpKxt2LBaTVgrlnBX2vCabfPUe65oPp5fNwKWE9jnP4uf7hvEWqYJbMnj64aHdqc4rDFyTEvVzZCMounU8dKV5/DBgoycKZMZVA72PUfbCTmH1+8Q3WK5PnqA3F4PV3f62mxpMjzizN/zdY0E1oIn3KUW3F0LjnrPNeIbE8A+eZL2DDR+SsWIujrtEGieWjMWt9Z1TjVDsZLVjuozK603xr45TK5yTmXg2fyb7OGBE+9/s/hhEdT8/Ue+SZds9vWO0wHpiFlrg7iMzNrFFuwlT6ROTCjnW796s+jzdSPGPvEsXRZIcHowlhGkNtDRcCJC2WzHnE6hJNMko46HHoFcx+zrnFOy//FLhjRnc/Zgtdvo/8Z1ODJt0twf7KeLN3p6d7dPkuUgGoZgzFoOu1Y84bY8eEu+88REovvICboxSuCqAeRAQIZx5rQqh1WqmDtF3+YF+HW1tgr4s5aP3LOTshcWXaUsHFq/mWcpTb7uPkB7eqG+9NQA8ZYk1QtgpMk6SgyssGEtN4TDTuycVef0L18pHhoxloich57Gm8MY8UCnYZZmp8WzO6qEv1ihOsBP3GN4oI7J12VyOZSbKjNDQFhXFywlfMf9/vtuE4MqUD/+CC1aA31dL4DeGiA+HZEMojQXm+QYsBysNISz2ERjxYP69VuzsCuVAp5oqwivDw3iIIIMYmhtMpF+Mcy+qpK1gXjBZp9Blt0m6+dzz4klAL77+PrN4lQVqOv3kXPpMm7ajE2jE1DcjRFvBJROl8qlIGWtgfBbsHc0RWNt0XEH9+Fr6+siSYE9coIuCDReyRebADHPvONoYF6YVRlv1gGizjkVrVH5vNJ5U88Zao5ru1ajqSzPcp9bf8v0CRn3HFTXBEqs9RVJHuLu9iE3NaUykHZzh9EOy4Hvwt7ZEs6Kj+aq7xz8lRuGU+UPPkWvijlFGCGOAdmL07Gs0cVjplyKAUffzfPQVYI4OaIyGoousmg2WEVGjnNPpXfjbmh2B9ZDjj09z+399q14eJqzuufb8asiy37ZICK5lTIVqqMytqZxbKlADOxSU7hrbTTW2s4T/+oG8cOUsYeeoisijZWORjyIoHSUjmdNDBDO09tZujYvSz8k1BgydZzTVJkptTjnALgbutR25SWbOFSVQ+VL/vwI7QkG5vUDlUYAcktCbsWkBqyt0WhC9Fg5XRc26+xyG+45i+b4r93Q/EEK7LeO09VygHasU43VoRkydlqWanjbeR6/jo5WnTMTrCnRR3bNkKGFVuIjaSfAhrXaBCVN96H1m0VUpav3HKYFE5qb+hq0EVDcZ1AlKXZYDGye6SoTzHMyB7bURGN11fnRB24Qj6XA3v8MXRv04HVCyFhDKTO9G1sn8Vw1gDcVrHkSUqEJU5lcApRlwLZUCuqyD8Bzj6wPA/gysPcQ2eY7+o1dEs1AUtwJILcGUBthQVcLFxXLwMD6Puwdjmgse8npD97uHU6B/cZjdGNgYA0iyAFPx+SIoNwVreia1mHWbBC2S3o2jmmMpSPzcQsRQMZUlxdeWOFj67cvb1QxlY996kG6Ko7NOf2hrvZ60Kfktq5OlTmVWcRyC/ZOXzRWm9T94O2N72WMPUY3dSKIrQhShhmw02LVCZ3NZaHiyXU08myBH4GaWn/moIr34srySOqCD7tF7pPrbxXPTgP17u9Er9TkXBxpkhtd1lRIdlaprupqXS36hCKwOxedwW/eKg6mwP7NY3TjIILoh5CsrzwZoXhhhTWOlXGe1o4wr2v2tXU0K8a2tm5fOIoAYJ79N2/1x5LQxcJ/+iHaLSNzdaRInuxB9mPIriLdDdM1XvnqnTHTKpOBLIilFuw1T7gvWaTBB9/ceCAD9nG6dhDAZWBZCnS2SGziVcmuOmDNOefMgC+GUGz2k6XKQXXs5PS/u307lVeu0KcO0WpicO1gYKgjKd7ieDWA7qlMV4sdgZGlVtTFGcayuxeEe47vdNffIrIZ3X99mK7iBbcMbJczWnp7xKBSR3PnO4NZVYyvY/ZV52wDv/1gVZ7eMoyJ0zwpZ6xsd+NDP4PHp8Wqf/ZtWhKeub4fQHQlxd0QaqMPyaAO8k5AoSVmES0HdseCcHe3ks0P5c7rr4/S6wY9LHYiKJ6dnAP749TI0b3nNc7Q2KHypOskS/NbMKguwVp0k60P/aw3WoldZuoXD1BrS+DGQBu7F5LkCKAzgOKeVTDsBExjaBXRRsA2hXvOonPyd94iHk0Z+9WH6bIowo6tLNzSgxJj6+ptHbDqnLNd+DwUqTb5YsPnoHpN6n74rY1HpjH1E/dR013UNw6McAd9Upsx4l4I3SHSHK/Gua7WkMKcxQwsa+yOpnD3rpkT628adhD+7mG6eCPGPl6o0C8wtq72na3ZV8pMmV4lb191DWfyhQNrqeX2fvct07uqPBrQTlKm+v2QZFdCDiTUKVUAtU5YWTqHgW21tL3Ldxurrfjov3/rwrMpY79yhPYMJC7hLhzPJ9AmnZ81MbujjjTMBKuW2W9392Zq8vBBzNQcVO9+PMKZpUm3C3AHIH4QN4ShWQgiUhsy9SdpWDWLqeUyVGmt5ShrueXau3zR2LPmHOROSAosa452cc1AIhpEmRQkJWDPJiKoYvxsB5Z/O11HR6Cl4/uwGkOmem/BI+uF5ZhFcHlY/zPfxXWBMqvM1BzUvibT68JoGxTF40SqQ6I8IvEc11pb0M7OpmjsPtT8u1HaMAX3IXrjRgwe01GDsJArqGj+OqFYWUtnevtCC0wwpPj84Zf8h5nKoLYt6rYONR6dxlQG9VP71dURWbvyFCCbf87U/owcwMiBlcxwvIwK7YZrr3rC2eEr84f/qLWfTx+NeX3+IbqyG8CPePmigWE5mFrJGSY9dk0BiAnpHC2Izbz9XLMfVm4MVNfd+vDPbu/DUiUBd+2XV6rE2ttTFG+FUL2h+Xf6maMqJlYq61s6uP0xe8f6apGwdvpwz9lhn/6Dt3mPjAH7pQfp4k6APaHkhG7arR2fAzv1AVl16gOan51N16nqNY2xfRhlFUOq1Pz9ZPN37/COzto149Pfpdf0pbkw1CQ3A8iBgtqMSc0DtXoW+LZMZbXN5MoxEO2GsHe14exc9B//j39fPDcG7F88QCuRxk/1AkiODOJhyHU2Zl/lwMaODW860+wLDM2ZmE+SsJru6d+/DU/MAvVP748vVYn98mDIVE4BnuZeVUgmZ2o9v5GBuE2fgv4roMly5AtrzReN2G7uv7dq1cxnv0PX9TTQD6H7JQdWR8xnRwR5AXOzH5+sNcv7cpKDp6s3mrBalJz6vZ/zfjAL1LsPyssjaV0YaciNXjoKIDtyNqjp8yutcrvc6Smlc2wH1toC66sjP3ln47s5CcamGH3xAF3yrMGudJl4BJPLwUz9m6u3bO/bLX6mLC2C2m64z/zeHeLpKi3lY+yo7n5AXRFLax+D2pUkN3ps/lA5U+v1/8ssZcy3h3jyNmB99Rxh7fLh7myJ4x+70x9N+BgD9i8P0epGH6/psh5pGGbtpNMZb9kq0LMHDws3FKwq91TW5fK98nH7lg8s2O6xf3uHODkL1LsewBukNOcwqCd7lAb/DGoQUdJV6Ty0sdi8zNKxEYhRVregAqW3DOxKW6Q9Lu00789lYExj8xb/zP14QyeGtRlmOQOeYTeuj9tVm+vJp4A65pwmy50e4TEq1lTfQ9JuuUc//GbRmQZqGvwf1NeGUqymieoIahaos5cobTspVeFginVmfV1aEM6uRbt399u97xfLNzHx+E/up/MiiQu5B5bLQRmI6YBus3T7nG0trRs55KAuLrl6ReGR9bdVbx3CFbnnMDXCUF8XK7GYg5qGVBK6E1HCI6tFplY746KOuigDWlVfzsFyNLDmwVlZ8h+56+3i9Exg19fJOvc2XDMIQJsKWsU1Yr0xVc+95pkDyhXIx+kXPETKdh/5SGn9VLHwnFBpLOvrewPhc/CfM5VBTceqNJIc1PpmP6mlxWfmIDeJ59IK65wWqc/+4/bBsjVVrpq5az9dtCGxLxg6sXxOaLXeqtHQSB7bVRUkPTYs1TQHlvamiHcCcrdOxHj83oplPvm9eUS139fXSSkaOai8IntLw3QLoFbLzrinH5V7hiMuyiHHrk1HWGsLcNZW/MfvfvvkNieVwN53HzkPC1wzCKFPM2sLnYWJqKSOc5oCaH6v1PNzoN3kPQLdZz7yD6d7fr7mowdouUm4NlDG7gxIcTJli7upkvQgzsapmKmTLM2bZRvYOktCy43D2sps3bng6Ht+3j1YeznSpw/QzkGIV58OIHlxR5RGB+wzt5PNeUD3wkKx7Qm87KRMHDzxR7+wsjnNSfHxT+6nHQbmmtgA00ANSwmVsSil0GuaN4mkyidwJJCzdYetH73rXUtj2pqXfYKxHAve8yCu3RqgkWbWYyjeNDHKV40M9TR7aLFHcqbd2iGoPJTiuPGOVTw6bSJFXtiPf532km2ukAmSTkQqHfuXUOlwypCpZVC3wanv7adFQXyc2er5wtrn293PvtN7eBoJJoD9wmE6vx/hVZ0AERd8QyodaXe4xuvMkiWVmjx0UGz6nPZbqqGn3Nif/IZ8lXLsl4cSelOSDEMoBnWLzT9Cwmm/Me8/mhVTALRitslUiyvIV04fZitHAqttiAt3+w/McqwTy5E+/xBu3QpgbfBoQpoJglaRGg4DF6SgnJGao6M5yAwod035Tlbb/eF/njHeP9RT1yNcpYzZGcRQmyoL/Dd60IOE9FYvi1q2vX+un9vNOqJDHedUhfTwVgsNYS+3YS86+OG972o9M0uyxoD90hG6YBDg1d0E0amBjgeBo4JIJbzGqczVOjFpuYw5S5d9N45dHP3YjPiUC80jqdrRb5CRaHY1FHdRexF4zF9vJRlTTYGpk2Y/2befcL6lOcBVVsYkqCsBExrL5va5Q7ilF2lnIJ240+FurTIBb3oAGL65Jlij0KtO6w+fknt9Nv2FZnJqx895x6Zl+/OC/fG36VyLzOt4T9meIh5G0cxUHvfnGJUzVKOBv+JkuJFHmh/oV4di254jL0suAcsLpAdPtr73tfXqafXFRhkx9s++F5xrK//yQYJoo6tlRzoqiDMJ0Ik+YVt+30BdzMAamW4NOrY/YTGQGT1gWHIek+JllL7nHvvDUg+lzBBu4Lv2y8uUsF8aaKhekIZQsqehTwXQ3O+vBnW6c5oWN6fPnmH6/JU/jAIWFxzRpM6RL7x7V2+WBEww9r89SNf3Y90+HaTDwSok0hzj+Z6b2E08wIsfPvBXtFtLdRHvhRLobC5+8SFleeDP6XooG1Z72T36Rz8jZoZS64epcUGkr9ZKrHVjqL4ilTupzZAMmz6DOopRx5jKZj+JUiWoM8As1icPrdo+rNVl/7F77xRTJ9WVwU4Ze9f3qN1U5o1bimJeHTKQxPsTkMUbKCI5+Tt3NJ/IL/zNL9EFcaz3hknWDx9Lw1XIQzou1YTVEMLZueacXjsXx4qb0uT3/cQDtAKFN4TSNJipuZ5udKH7uZ4moHC45LK4aq7cETgTHS26uuJ7BpX/L7d5dMA/9pmfz0YG6r5SYD/3IF3akzivG+h0XmiXeM9xwCNh77ac75b3O/mtL0avUMbexTNH8unjuVmVycB7ZfP09GVXOEseGqtt3onNec5J8OS7rxepWf2Xb9AFwsLlIZmkH6U9Kd3hnlQ3m0eVZ/zDsbRfBsO8hEmVk50HDidYWAK4d7W45B//wjvEiXnXVDL2Mwfp1n6grdMxGFilLErcWFjLK073/beIw1U3/e2v0vm9gT63H2bglhPIeYVYClou7GVLOIuLcBYaaCy4wvVtOLZjb8RKhRDWPt4WJTf9Uxz0RzCZnqqkr91kWwzHh0YqtX14sMzkyUAsH73armFu/k0PYsU3x/7inYsztzudBrj4+Ndp0fXMDZshxZ0IEY+185wCX/DUb+coLy+fdvEHPk+7exoXdSKV6u34pgnZVekCYILV8GAt8XRyF47nw/Et3uxOpNs5x4p49w6dh1J97klFSPqF7FRxAK92V3SOlpaBzkFdajlYWnI5CVRbUycY+18fopd1A/3yToB4qwMZs8PnuUi8K9r97v3TxuvzG/36F2lnINXLeT7pYDjvafSQwpIdnk7e5p3XhLAXmrB93jN7uEFuyF3mGAmzNCQyW5EaBv3uMOOfITRvHm5V+JTr7fhw4CRVGFTbEdaOBdJLCy12VOma2LN9iT/9Ll0RhXotdVoDqIBlIBHW2pLT+cCbxJFpN07X8n8N58dS793oAjytPC5NfywCwcxl7eIIoZnuKix4Q/J0w3IepVCCkkiCWE9ZVsZ6UhXMO9sQqlyf3Enx2NWqqzvN1cWjs9KVdYEWn9ivbhjEaJwcIO4p4m1KqCWE015wnvytW8VEt40z9lEXL1NCn9cZACdZlwdQveEUyPJUnbIGckV4xzXHy1KFvFmgSRxix5R1TbONFuowNGdjdvJ2lXMTL5t6+XjO0uUmkee2jn/5F6dPp68LaH6e+MS36c2nBtps9BEHw2igxVq46Bz51zdkcScH7X/yAPZ4hPOFZXZHESgwWUjEE3Z5dQmPgrImTluyUyxYcfpjjsk2oGfvnOpWvshSr2FtNqLjT/2P975itC9h3fvMOk98/Bvqp5/Plt7IPv/ODwB2MqvLzrMLFDu27a00LbMLFmz+6RJtwYQx8cQ53Y94rJ5DI9JsxkVQyabQsYWjNBp8vJx9ygAd51B5JWGJiKN6VMWtVZUsx6gcQuVD1m3fiXzLfeq//6LYejGALN9D/PF+uuVkR5tTARRHBPyjDCwFTRfOkg+3acO2LWEREYUKFAOal9zHhgFGwh48BZVAPKnCst2YBJ7+9DuQJoDvvLe/00oW9mqpmtzpYO3k3K5OcseUm/38XtMI6CmamzuoWTq64CUhifbTX3k3Nuf9qM8LAVz8p2/Kq7b6wt8aAsskshsQS65weFtl3m2SBASvreWENy/8YEA5OaMMpYtAeDUQ/+yJsd0Td78dz5YLzFLyrrt6a+R5e7rStJV2wPFpzvDpyelx3ZzVry+DkAf5ZAleRIw2WZ2m7z3342LoBGM/sp8u2urqCza3stXNXNl0+6MGBPuXdDNaTsRoIElYWyndzSe/UcOFJOU+17PxXB0L1Ju/AAABOklEQVRv+i++fNTbPL13bUDOjlibNkcFzGKTUOrA8vtOG10d0+rhGAabNx/nv1niRKS7FrsNu++76nTwVPtUnYzUC2HoBLAcNvl/pa7aCIWzKUnlXp1bnH9GZFTRgvmxydugvorjH33ynYv8+ysTs7/rFPKKj5J7sTVYi22nHQnRTqCbscw6DXlPTsf8MzRDuSgMBjn8o1LD13DGDDUoiVqu3ZNCdpaWljp1GrpOOc/mnLRwv/9N8jcH8uW9rrXEixyYRflruHty+tG23cCR4aa17G/MS1KfTWFYMu68F030+wtd13KsSNjkCIeMcITk300DqAHjpD/mQEaJRDWarXCXRPiJf4L4bBv4bMo675qxEYT3/+XWahA1d1LLc2VfIkoodnUS+w0/jjex9bFfHv+BsXk3/3/5+/8DKIf6sstcS3AAAAAASUVORK5CYII="},37426:function(U){"use strict";U.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABGCAYAAABBovOlAAAAAXNSR0IArs4c6QAAEKNJREFUeF7tnAuQFdWZx/+nH/c1M84MyAzOIBpjBYRgNujWqMFE86AUNYpbRGMqmlTMEtmEGC2yZrfUcTdhw6KbJyYQNUIFycbEVMgTDBoRMwQzBAyia5AFBKI4w7zuq1/nbJ1+3Nu3b9/b3ffeGZDNqbIGb58+ffp3/v2d7/vO6SaIWD71ezYpl0OLoCJhyIgzBtFsQrMasv+Ut+o64FvH82PFdvg1qh10rqxa/7D/lPbHOV+ErgGaQDHa1YKBxz9CfKtHRFS1Ognb2CeeZglqYLouoCUK4EYMQM1teBRQbaANAiomcWDbx8hQWCa11AsFfNGPmChNwmwiQHZLuC6lcmlV63HQE2HDDNNGlAETxrC37w6SqwVmmHNCAb95C+vWCaZOmNlooHmKKgoiYXD7J8mBMPBqqRMInDFGbtyEd4sxkKrAgyCFsfMRTEAU1ZaBqdJXQsHObMee8bLngcC57VZVzA6cp6oBDzMhBpmQeo/7zOiV7kmn2Ne/mIzUouCgcwKBL3qStcoU53o7J4sYeuyDZH/QBU7m4z2PsFkwkCz00b5JXcTB/sVkYDz6Hgx8K5uCHKZ7L35KAP8umwURSe/srYs42r+Y/PWEAP/4JtaRB870XtzQMPTE1W9xhXPg1KVwO46IE7zedxs5cvIA1wADpxZwt8k8uYDb/rPwN+A1PQCBNnzhJtYhaUWT4ijhVAGueUwKp2gQvL77RJmUvwGvScgVTwqtcK9beEoq3L5JI3aCFc5cJsUZulMOuEtRJxb4E6yDxcrdwvECzhhLAJgKoBmADCDwKaz1odeqtC0DrNZ2AegAMgCOEULG3O0E3sxCP+AaIMiNdQt5zgZAB4BuTQMbHIRycEjRaK6uGy9llohHZ5hXop2TALraidx1eiwmy5A4dABHCCGUNxQNuDufIWPolw0MfBhjnQCmvXJAzaz8njY0eDxdg8KainD482EXQ8sG3mclqqKcKvYj7a7FBexfJLmJ6VqGLPt022kXz42fBuA4IVYGMrAjBYV7E1ANBG6bkVmvHFCzd60YOh5NUu7aJw9wp1eLb5ZbPnBhvB3Aq4SQ4XDAiWXDS5hTDP3yHxoT2jPGztY0tC/pzRytTdm8d42H7UArqDyCwt0yWH1fbGp7e0wnhLx0sgCfc+h1GLff90aNGToXbH6nzUA9ZsT7hNUL/K7PNLfOnYVWALtCAVdthZd0pLEKn/uHl5SxFd8cjpCD9kC2QTfCbjca+I1XSKnrFyROB/DiSQO8b6cyuvJ7w6OV7bcPYA/kYNgV2jA9uMqlXoUv+pCUXHRNYgqAvdGBF7cYNNKGzzWBb9CqAA8/lRbNSSXA1doqh3/igLtnTbGhk2ZdwP3tdRG2bruF83taYgveJzR1dcXiMYD8dRDqM8+PZH/+rJTLZLLmKEgFN7AI/sQA96wp8hWfBnopkYBXnhDLIU9qayI3XSWmLnpXvKm9yYxcy4qmwfjDXiW7/ql05tA+anihTzxwvTw9ezID54q+5MJm+cOXJ5tmdiMly8HxhjMK+w6p+Wf20PTGzUa+ODKW2kXFFQRVsfs88HGPanQbbgN3W5SGA9+rjH51zUhJ3iGc1S5V9Y1XxJLz57U2d7YjFu58/1oZDfq2PyqZB/9bH7PSIlZ2RJQc6NUjzZqBz3+CdcCl8IInIGJoS+MCn7l9ezH61TXHIgJ3wY7x8D2F1XfKU6Z1xuqC7dxjVgP93PKBNwaGkoYDvajyiQTO1zQTJwp4qefhTIhoSsHQcoTqIB9+b3P8ip5E6tzp4JnHyOWNIai/2a5kN242snmVMUnmCTSvWZlo4MDQlo81LLSPoHAf4DZsrnAaAzE0QnSSE5YsnJS8vgfNGQ2sLQWhGnmeoeT//eUo1DsezA2LMmOCCsb/IpOFxP+WmJWJAu6sijQY+NZdytgDj45U8MPL/emisjkFrm5CaCxrwqZyylT6LR8SUtdfGk9e25sfuepSErtqjpCY/TaZp0wL5cgwjCd3qfkntlDlnpuEJsbAvrjWGBE0MFHLMEECE02VTzRwj1sYoxg5LY5D7s63n2PnrvvLteT9qeUdxTz305fhfAu4Hjrw8QdeVLehp8glc4n8lVvibV/bqKR/3geNGiBnT4HwnllxKZlQSf9+pu/eD13QGbtgJhHv+Wi85ck/KdkHN9LMiQO+jnVALHcLS5CG2TvIT6iwRXn7rcDWXcroisdGI06ajrpz5oTpNieGnCJxHWTpIqHp2p5Y8s1h0J0HoW7fqxpHjjOqKMD0DpDzz4qLl8yA3N0B6eXDUJd9Oz+SZoyWA+feScblqYyXSXEBD9r6W+uO1nqBc+xFk9JEqAyi5fMCk5Pk7GlEXH+7mY8OLKt+pYxt2JTNy4kEFbQsEzXG5GSSTqwNt4HXCjPMnvLtt9Wq8JQJkXsnlsJLbbhOFCEmJ8jmf0tMln1jzNIx+NL3laHf76GaoOWYnExQc9IseCnWjFka/NizqGco6wp85q9jHZrLpBTaDto+bJsQp37ZgLl+ePY2oC/QpFhw/YoFHOATpSETQnU+cfJ/pwjTQX7wBbHtbd2lk6W3HU3TsOBu4029mjkpizYnCngQbNdecS4sX9j2AX6MK7wUeGW4XlAObOv3oh3nwPkA6IQI738nif37J8y1xYrlJ33IfPPHuYwg5ZjATQlLUq5ugLuElv02cyolqz4TATwkbI/AS2/UNSD8QBE4D6OjF8ekmCq3/XAO21I5IbKSF5be0JZceBF8R/LP+1X1jjV0RNUYkxio5YNnTXPC2yy4hBOq8CDQQSbEx7Y4TTrAl68dK9NPNPwuO64T0nVWSlxypdD8251MeWo3M3pmE+nG95HkOZ0xkadnXzsO/amdirLu6Zzyzu4E+ex1QurxZ2h6xytprWi/be/E7sjE2HAa4BZ6YEadYC3gGF2+dqAO4ClQPUuQskL8ZTc1N3/gwniTDBD+XuePn0Pm4U2KWrLLRAEEkbGr302kf7pOaEmlZHMu+NM+Nfef6/Xh0WMZcy/JxCuc4syoEAvK9ObRfWx6/cAtS8HNSVwmZMU/Jttm+eRRshrYtt2quuJnLKfqYJ+9Mh5///lITGkrD/uHMtD+5eu5wUNH0yX58QlTeCN8cF+7rgHblwJbdyhjKzeMRbThNmhT2ZYvvvafJ0+a1lk9NfuNjUg/96pi/OgLcb6SXrFkNBhLv5Y99vrBDHUmztIU7ThMmpetYs1Cs7nEX1J83xy1VqlCF6f685/B1OjAS2FzD2Xp9ammq3tQ1Rvh5mXhcmVoZCSPH97Telp3m/3qeoVe7z2k5pat0I5bGUPuimdcOfFxAB6aXh0VGWNzt+xQ0is3GJEUbtlsS9kc+Ia7k5M72v2X0ZzuDWdBr703P8z//9ufTzTPmVb9aeADdM0Xs0eLAZA7vP9/AtwBzW/Xgc1dwM1fTnaGiSgXfHlkeHAkTn/xr4k2P/vt1c5da/Jv7noprbmzhtWW2+qKNOsQbuhToyrcBM6L7ZFQM7pMkmceSPLdt4HlvnXK2PP/C/0X94bLsXzl4fzAs3uo6lZ5lPXNSGuagb1vQIVqwAtwvdexYXNTwhcbeDp22zfMzTaBZf0WNbdzP9Mf+HTc+jJGQLnv0fzgc/1pVaZJWlj9ibC+GRn4NatZalDEFEGAqBowk/KFPrrWtiv1u6yK54cdt2Py1t3K2MpHy224L3BzvrSX1OzFBp6oeu7+Nr6dLLD0vQx132HoH/+gf+TpbcABXlyMSLHSybN6qjYS8PnrWNNoDjMkAaRaAop3slbXsZ+7hbuVsRUPhYw0U06W0EpSOTmT392fOD1EUhB8lefV11TjvXPCLTZ/6bv5wf4XqWoBzzDTRSzxVhoEvLeXCZunYZbB4P/qQMhwPyho6r/TBv5YAHDHj3SZEyv3TQQmgzxye6J1xrTqXoojjOFhGFMCXEJel3s1N9x9fIBJCcMK98cR+HseZl06xRllz2gQ6KDjnsehUcCnnk7Ezy2Ip7omQyTQyvZNSrLMeNfMRKUGuD0aXbPq8zpm9zRgNA9j7a/zmT2vMU0Gs/PjfsD5Gf4q5x5LKJNy5a9YfOg1zGaCz66lal/ziQibV3/BV+HVU7SFRQfX6o654GAkCJVg5sG9zyUx/N8XMuvy10GkOAMUCCIYX+dU9TwTaYLKZo48y+QET9mOE/CLH2LnUuaKMCOC9LXpFdY+OfBtf1TS//F4+MDHDdyy4YpAbdgxiRC+YOw3e3KY/He+pskHhNvKnJEncSSgiXEWVxSoImOCDsbrSibsHJNZggqSlbItt+HVFR64P3zeetauZXFOSYcjAA+y2d7jT90KZEaQX7IqG+kDX+Y6pivvzZXKQZsKNxQTYkHldmYw2KlSIOhxEzbhoM31Te+WCe+kWRk4P2K/XMXTI7vLVHBZL5OyUzGbiOYrb2WuRzVPpSJoVzt+de6/Crh8OugNywePKVoy1NtrBYXrOYJksrC85pgHU+GV9l1VoO6oH8hDYnHKvRILNivsT6m8AlTZU/lOb3tHZ2eMEULK34C45CF2lsFQ9GeDlN2A4zPPAH56C9D3ZzVz7w/C703xha7nCfgnUJKAA7/4pFqkiZQoDqonCydK1ioPB23FG1mYwLmHYh/zX3LzB37zDa2p6y5LTAZwgBAyWKJwnhnMxTDDrewwqo1iryt5PEvnAbfNA55+QUn/16PptCJXV3pxLdPJGjpK5wvKxa8qVY6CXKRtxQvN1jU5bAs0//8sOHhFTbJUYX3TMiGla5zlwD/50damKy4W22VZHiWE7DMH2+kQfxP44ocwk/EQrl7VekYgyKY7fbjzcuDWHmA4A2P/UVU5PBDTRkejvQms2EZb1xQft5B7Ie5SuW2JFj2alpjbu8lDlr3tFNvkk3BnB5Gnd8bj7daWaZ6ZPEgI4a+DF4Ff+gibouaL37YKA6mmOj4nuX+aewbA1d4zvdRPrqxU60ihjRArTJXacnYYFKJV+x9holefNp137Ute9DVVcMFqJgsEswW9mIwPghkUxvuaGc/k6buFwlWHR/DemzWvW83OBX3x0yYT6vu1Pt+57ZyEIzuWIeh9UoMQ4jv5O8DfLhloq3ovDTQzYeaFege0UfdS1g4DPU/Bnv415amloKfQNCnzHmTtGnCO3w0yHbooIc8/URz42WGPOQxlecO0y3sZtW1XZ8P2u6y/BoggIaXR8gCKGhjIryIHwwD21iEXrWLnMYKUF7jIcGzHEhyu9GjUcrG32jnc1L68B7MYgeQ1Y+f9HV7oXxxd5eSCb7GZTHR/GcDCQsbx65RvFfDcc2v5PGZTHq96TGp3J1480EuCA1fPzZILVrNWZuDckt/5OzwEVBBwXNMRudFKb9RVf8Ha07MQlUNUKW20ygneQ4xAEIA2qpQvUhgGhpU15NVahONMmmcwA13exyZo4go6HmbiCvKGwrQRxiPyhRPkCPg0rEvIXXsp/ufxjxCjZuD8xL9fxaYaOrrrukGP21fWoQAfvFA/CEQDjzvXrJYjcuroFLk5DH+p1UMxTbUbCjcvqorpoBX2ati9qlnZQaA8o13tOmGejCDlhznu8KEy3rxrEg739lrfrqq1lIW/vYwJP/kOWomOJqr555TN3xOlySHmqlueNOL5NxSSd4GTgsdHC6zP796nUuB5FSoULs9AJQHZGQqG61G1e3D+Dy50RqLE9NSOAAAAAElFTkSuQmCC"},19150:function(U){"use strict";U.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAABGCAYAAAA3mEEuAAAAAXNSR0IArs4c6QAAEaRJREFUeF7dnHuQHMV5wL+v57Fv3UvHoUMCvYUNBpMirsiOsMSpXEiOcABLgAAXkkicwoQ4xFUJdipWGYfghMTP2I4jYqPEIUiAFQEWyIV0Fc4KihzAkiPkQgJ0Euhxx2n3HvuYR3+pnt3Zm92d3Z2ZnQ0i84dutTvzdff36+/7ur/uHoSQL9q7WYZz+7oBzE6QIApIMpiEoRSjA4DikCT+H9ZlyxZ/mcQBmQ6mmQVFTsPa584hIoVVlJuccBQEAESEsH1FHyjKhQCGFHqlnYoKXXhJYD2wJhWAxYbx9l3j7So6FBC0ba0EkZF5wLGjXRWFdoHwY1UavY0bBk+3o40tg7AsYeeKBW2D4EdRQTXkpwxMHsf1T48GLarec62D+PeBPuB8dtgVq5DnR1HNKtKqLI4EBj+MGwbzzYry83tLIGjvchnScDkAhhsT2umG7GDfChAJ03jLnmN+FN3s3tZAPPWJCwD1Oc0KCfR7K4qqV2BYMoWcyxcdxKt/EJZEaBHEwGJAngqk6HYrq1q+rTJhEWGorxAdxo27RsJqe4sgVlwJCHJYlQlFQW6VCUPx1XKZchZv3X0irLYHBmGNlnZc+xuhVMQ5UQtbaWHLsxusYxrvDC9OBAch5g7K6IdDASGEtENh7ZBp11WiDN4xeDSs9r83IISCZKUAnAqA3ASTK8CkOHCThdUwS06YIKpHcu9rEKbI4RgjEIuN4OpdBafSafNmBosOdICSnwXAYy0BCRNA2RWV8ly27PctCBPy0EPHcEXjiVAxZzXQD0AX+oLRDuU7IVRXxqAM3vV+c03IcqB1/xrXbTe9KpfEjL3gc8YeNoxGE8v3HQjhjnqM15pZghsgenJgPpi8qym8sGfiXuYcPkDQtrUqnBuZAUoMoVeewjVPZ6vb1P5greNpXLfn7abKdLmBfroqAuOFy4A1WM8I2woauSNnHT2AsABMjfSDgT3WOopdV6QMzOh90+kh2gtCFJyM/qo6MPuBQtuWLwSok15vBwSvMhuAsBbH3tw3C8DoLXeiarkc0/jZ6XlIm0GwHK574bAfxVffS9tW9QLkL6743quy/BTs1725gLDWZSbSfUDUB3LVUNytzh0zD+O67TlRzfaBsBqGabyhtdkn/cuqGaDmF5XnBWFkT+sB8gPYAcIaes/fNxN0fRZIpZSPF7CcjuNnB621jfaCkHAUb9pz3E/HrLGIrZ9IQFS/NPQJmj3hCwrWoAxs2nsMtq7sBo79gKbqarUNk4zsJP7eC2fCB1HdC5g8jp/+2estgdi2sgN0c2FFsGtFYPWzfqygMlgXQLY2FERrquPFGqyHPIAgIrHYIyi7px1GRxkc+ovFDXUiqzos+0ZrCyhDX+uB7PFeX7rXswCZU/VzHJ4V5avU4s2+ZDcAQURxABCLPckA1Th/HhEwhvcCvLwFQM/U1iuoJbi10Fa+DcKzFuqAIKJZANCvT6WN9JkDWeP0QS2XHXHfzxMFEAmhvGZUxZmoi60Wa1bQTPeYVGvcdWUU5VSXWdny+Mx5UqznciV5ydIYZDMIQw8BjL4coMd61mjABKMLCCLqBoB5E28PTRze9ZmMmc5STiOERLEyTvMQ35e+Bvt38YGJ++tcwszA+mf6ymvc82Bh+tE45PU65VSlClM9V0qzV/5dp5rsVmDHnQDZ0DdfBARg66AKBBGJ2H6ZNnZU+8U//Xa5tqGBiE8z8KN8J7QiiOK/XkFYHahzLltw0096YfQQwu77fXRxj7e25OJqQfQBwOxX/u1Tp3In9xt2FQSIZLnrT1fMt0W0G0SDpLn4qXvpVxIzr7w5BTtuKwVxj0pudltLEITwWhDzdH2q48A3F7zjLDunELpF7DIIB6QEJMCyoKrL6ZJaswZhCTF3V9YEhDp3tTL3uq/3wNADAMf2NlNv4999jYqaFVULYtHkuWORg4987GzoIErOPQiEypDiPTY42yAYMbkLF971Uh/s/xbAkR3NtFP/91AhuFvEYm1yWPnF9z9SsT3Ej0UwLe7aW+NxMbLyHpRr44IdE6oifbW266gvdBDBMbo8WWsRLYAo+ie3EZNQXV6uhFCrzmJPjyq58jDZTtZbz5dHSHVA1HFLzq9bsginFYS1J6qMpN0gSsHZtoSiQmOYnDWXpWZ/VInGZzOMdzPKjvF89iQffWPIkLPD1uqdlYrMFVFEOxKUzzQ5W/F/ASJUK3AKazMIVrICAaAQ7WL9v/kn8RkLr42qidnOYyYVzdOmTuqFEz/Pnxl6MMuNvGUdFpSKDy4aaRcIL6t0QQGVZbcIouyGLK9U6ZpsCEyPYf/H/yjWeen6lBLv9LxNRs+mefrQ1snMf33bsouowsgViAcAtp4Cu6aWh6d1SLULhA1GQBBWgHIM+1dv6UhevCzwthht+MXciWfunpgy8+QKo10gQh8ZNUgEKiFahD1ackKYe/OOLrXrA5Gglms/p505pJ14cn2azDzVWEeDUVL1T74tot2WYFcwbBDCCgSIAkXY/Ou+l0ouWtlgrNkYjz7yuqn0Liqft5g8uit3ZvcfTpCJZRiNwoaboXgG0S5rqNfksEAwRYxoEhaEhBzDzsXrohdc+0BnUEvQDv1Y006+YiZXPVyhz5HB+zPjh58pkJqnbK4qbjgKq+cHm4JohwV4SY2HAiIh5g5xZBpHpsQwkeK48NbBHkhcFGibvn54h0kvPqTBkuuZuvyLFW5NT79lntj2yTEyGAk3xRVWMapqFojeUxCNIIcGQo5jUiu6pFlXb4r2Lv2zYKdKR18j7ak/0DVukHrZDUxd9oWaYe74f3x1fPTIY4WsUSBuYkUAP29BNHMNLYNQCC1rEC5Jj6EUMVnfmq0dyTkfDRagf7LJmDr9OimqyWHuJ5k68MUaENqJfYW3d941kTOQVKZxO3g3a6s163fLNbXDHYnC/MhtBYSVeS25paTMUaIIYxGVzd9wYCYo7vmmhso6vJNr+x42gSPpoIPStQTUtT+s3BFhNTBLpx/52FiWaZyMAongbbuoZjBqQPhRVjPh9u9BJoCtg0hAUiPUohGW5CZLphbIfXc8L1b4/F3ZDMATt+haPksgGcVc00XLmXrdX7rOwE88OpA2Jk8ZHCXuHNI2K7QCxKEWsq/1Cgo62vIMwmVhyJq8JRIgc5OJkZJckKXUvKVq7/VbmscHsVQZnzndnAPfNbVXHjet2CAh4dUbZeWqjXWD/fgzG8bHTr6q84LGs8p0rHhPQQSxBN/ziDogmFKMDymKMIkpUmretZGZq7/T+HTp8H7QX/gqKWv+BmHmpQDZDGjbPq0VrQFJvfR3Jbcg7VTyxHOfnxw7ulfjqHOOGvfqntpiEUGtwNmgVi1CgLDiQzTCEgVFkrs+qPauf2JG3Z753z8kePVHBJyRvmQNKtfcx+DwdlP7+Td14AZB/xWorvn7aOWrZ2qlTTx+y0R24jU9WxAgiu7JS5z4fw1CpghLRlQmaYaUSHXJvZv2ubomXSxNDj7ILYVzgygWIfXWnYr21MaCln6Hq1KEcO2jMaWjv+mOjvEffXw8nztnmlw2s6i/NyDCDPQtWURp6CqTyZKRCEuwlCRxJneufTyl9C6ssyvwKOnP/bFJ2XFuBeVF16H22rOm5ZKW3a+oS66vmx4vD0pGjvL0U7dPEudmtjDBs8i412Fs2SKGQlgqFRUStTWoIOoPRsMtWI3DVztAdCy7L6Z+6LbaYaddlew7pD15jwbGKNdMnUATI6QrMfmp7zebj1kSpl7eqpsHvpvLl0BwZJx7nE+EAqI6JhBl4O69x+AHK3rAlPoBeNPOVEOlJRAaoYgRRYvoZAkmWxYR61mkJG/+53hDP58+yief2JQnrltD1ei6x2JK5yUe1ip00B6/I5tJv2UIizD5pHmuNLHzFSNasQgXEPi54mFGa1v+RS/2gmbOAvT4ghghL6G+iXc9PyZkWH6ZiNzXrBuMmkSwlpkqSVpKiscliZkozxz4chQW/07DXJP+5l5j/GdfKkQW3ygnl3/B00xc5KHyQ3+dz1POzHHTNLlhBgrWQUDUiwlEGRuE3dPLB1U06gNqcmZcyMXor/De4jHnlkCIWbUYvgqriMkxGeM9cnLdY1FQOhoG3snBBwuRq+5UvQRoPTsKhe0b85Q9ZeSJm5wbVqCuC6K8nDftCFiqtJ0mCAghxg2GC4gykH/4fQWMty4Echzdqp6Bi7Mj90yfHQkMQswjBIjeiMqYJktMYXIUYxLr+5CSWP0dFZRGLtOZI24Qz3QdtJ/eo2kjBw0ibubINHOazk3VMEWaY6qU/CtLcIEgfvMNwsscoQGIMpBvrYoATvUDl7rL5zuEWgr0Lnx++TDiZm7fGwiEc2ZtFAypOzKDiTgRRSYhkyR14YCsXvMlBZTA60MitwT6nq8YheEhC4KwBnvEJAK168w6LBD1rMDZZzyAcLgsFc6OFSe8CXPK7e1nvkFYPUzMrDWyArawikREtYJ2lMUlFDCQSWr3AglXPqQoHWKnv88rcwr0PX9uFM4cMUUuxbYG0nTudEtWBtYork00unxZhNd5gg8QzeoXKEYUQUynwQWIJFdZXLgoJkkxlIogSGJAEsOrbpeUD98mebIOcbjkl1u59uoTJmCOa4bJiZtmnhmcuFKMDdV5pjpW4Gy8ZxBeIRRHODXB2ovC690T0CKKIMR2Sm0qwiQyLauIRxQrXlguSpEtEKo4rC7FES9ZypQ51zDoXYSgdCLEO6x8E+hp0keOgHLyJa6/8Z+kFbLWuoRmSJzQ4JZb0gyeswL0dJAur0eEAcLLsma1Bs8LEKUDLPbikOWeJEJJUyQBI6oqDLVpGOJNyMgIldJrjHWTsCaWy0i6poOCjItsLCErQhAwmM5FfokMpIrY4AGCp2DtxxLKjv98sAgnCHvNWhYhVGWMuGUZqCosyotWgcQZMBnFtFtjZP2tuIQiJCSNMwJTJ2EJeVayCK1oCTkFyV4Q8mMNDUF4GR3V8yXnjUVYI4DSBgIBQY9hwoYR4YyRwjokFZFkpnGTRSQF0RBuSuz8UEEFzcpyWJeEROJ9qjKjgqmTygyeN5FEcLYgGEikFFfl/EJoCiKoYzcwjfe2dpjfWbQdIxZOnTsZ++UjV1uHr+2r6YmhEgirsaUtNUwvWkZMJtRIYTEpgihmmZKCUUZYMDjWTKdlVgKhkwAApkZiwpYzC0QtWEKZszi+teH5C2DobwGOPOtvXbkeKIPO4L2DJ4NyrH7OBnEJgN6z7+E5FYKbnqFzgLDPQdiWgRJhXI5gQUAxOIr/g7AQYRVVF4mD4yajPORB9HoyNAuAsIRItSWIZz3GBruYzivWRy4Y+HIXPHs/wKn94YDIq2/ifcU8URiXDUK8E2n+G0NfGzn90tfLr1r2A8K2Cmvvqx6zVvBQJ0RhETKhOMErPguLsE7zlo705kulkbAKYQ0ChuWKxObjHEQDuiOncvpv2tKRnPVbMXj0Bmui2PKF4h1UXQf9vAisWZk2CPF3ia5PRV/9x4+c1rPvWlNvLyCqz87Ze2DFAZNYLA7CVVmfozFAnaM4nC0AOSsmer/o5YJJpAqAxUxsKPNpBbb86BU3Ri4e+Ksu2L8F4OV/baYPb7+TchY/F947X0WhZYUQkeijH9D1NB/e+8DYmYM/LgQB4TwlVPwcQ+tgvF7cKV6EUtleoWPR88W3zv5qAQjgiqxnYqXTpB+8MQWjxwCevTscl2SAAWP0P7h5sHz61hu9xndV9kwiobO51oFmfcqYfPe4TpQrJ6bcRKGmT8uosyxkDVt1x31h1LyuDBXUVK+kJi8UuS60gvPQ98JxSWJkN0P+NX5m91TYTagNnOItkwA9ACA2E9d/KUp1TfQpCbLjDdYivMya/C9yuSpEvHtjdBjg2G6A4dKrH1rVnLCEXOoN/NOdE62Kcu3QYQqlbWuTkDk3BxTTW9rVC5sgFQxbrkhbZ3rfwc3by1OfINVq9EzTnRNBCqSn18ThbL4TkEeBuAJiyGr5pyDSWnwmSJmKYgLpOkRiU5BMZnBd+wDYrftf5H4s7DrfhR4AAAAASUVORK5CYII="},55303:function(U){"use strict";U.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABGCAYAAABBovOlAAAAAXNSR0IArs4c6QAAFIpJREFUeF7VnHt0HNV9x3/33pnZl6SVJXltyw9kGyMjBztgNwk05diFHmJIk7QElYQmYBxIUx9oCOSc0D8a9eQP2rTp6Ukf5NGWJqchB7vlD5pwTpwmuAnBGGJjbPzCdg0SRpK1eqz2OXNn7u25Mzs7M7szOyN5ZZT5w5K1d+7M/dzffO/v97u/WQS/wccAH2rLlUudhJAOpKO4zoHJTKkgrE1vS70/uw8NGotteGix3VDY/QzxIfydfL5LQtIyGkNxmcq+p2CNGIYOl9b3wKUDaEgP6/dKff4bA3wrf1DOQk+PXjQyTEGShVkGoEGorBZIAyYxnI116eMn0ZB2pcAGXWfRA+/lQ0mlUsmoxOiSgSDBt2bTAdbtalGbEASEA7DpnpIxfrh3qPRegV+UwDnnaC38ZVpTS8s4xm1uOAI2pQKpv5T4wXbOt86REJnFenz8XPfDs1ca/KICvp0PSW+D1k01I2MgXXHDM0HXrDtcShqlxpkge9IULJclWRs/1f74FEKIXwn4iwJ4Hx+Ka1DOANBuThH2WKlbQgQRU7Pnat117c0nxD5kYIxTjvilvhOl7IEdC7vAvmfAhWysh690aMAyBrAOc/i1BbARaNRF0tuPA7XGtw6226oRR4wTyKIp+dK5DQ+rC2HxVxz4XXwv+QW80g0AGQw85gZh/e6F7RUC96TU46i2bPBaGnpoOrH2hGFCphO8e/zY8s8WWwn+igG/mn8zVoK3MkChh8tCNlyHB1IjcFO75+CR1C+S9ZMavOA2ShYBXIxRMn5szRdmWqHzCw78av5QRwWkjAE4HWgpAVJSWyjnBdv7tJjT2ESyHCnyXx8UXVE1DS59Zv2fZIcQYvO1+gUBLqLBb4HaDVDJIMDxpjcXsAh6hCAkuAnTbceV9NF0+08RF2OscgNJeKJ9Fb50GH0+8M6CxtxS4AN8SMlBKQOg9TAgJJIV1A3U6/5VrdR3WC5LDJGksAU5kufjuoa4MuKEc86mlkN87MDaXZVIYxXnRW3YrJ1IIuXV4jIds85Aj62+gyi6HSF09w/taz6NGSRZ0xbgSkax7DrYnngAAAhFOd7RMXYyM1gI4zlv4MKtWwV/3sVM/5kkwy7U8LnPQD3WHajbdZ5MmHWH6XbESW0IvHwMiBGpmAQYe63vvlzQAjtn4EKfvwfaUgraMgN4UAQSzr+ZlMzR6mwbdl/U1u1WW3fDtXzcUMyhwhJo7NTKzzZEsHMCvpI/3g2grmKApHCiTVo0te5mYXs0Tfcukk1sIsz7qcmRNRZLSnz6CzAQBFiVSuTi8c33TNs0IgNfwR+9CgB6Lgu0fdcBemoOpum6HxTcNMqMT7jjvfUoklUHvCGl0ETOahejAHGITb628e63hcxEAt7Hv9ipAlnfGtheOA1hTpgL2CSStHtunk2cXz4m2LLrJtsDyTEgrMgTJ9cPDkcC3ssf7eEAwsLnfzTxt2uPapj7V3tC6tXa9f9armSeXkndPQQ+KWGLcf0ahVHxeP+nT0cCfhe/i/wS1vQjgMS8iAfcnAdJRD31Xt8n79J0wRXWHaTp/nLlOJjeSfVbqD335roO4kTtbMfnD64eLEcCLjrayr8tj8L5dRwMz4ZApAlo4pGYj78cpN0uCLZfZl7QJ9/i0Vs/qOIajgftO3G+1l3XV5huu8aKOONxLI19vP/uMTsdEBm4uEHhe/fBI8s1CitAJtHObSIlNSsJ0+0GKWmE4GuJbqqtWCQ99xEuWYizd08NfGbUfRuh0ATkeiu+Hf5BeUMdWYVirDPYwiN4FE00uzacMIuqQWjm/oUsbPYgqvrvPAfR0gc1BnXGhZl88eSmwbGmwKuAlwFAFwiPpkXhfyTpaVEjMe5hmoP99DQ8WToCJTu+b+jfaxQ+K4JzRrNF0vyMawCK4r5EKHDOuVgU1wJAYqQwrb6dm9YuieoOsdZoavOnwdlKcCZc07znxKzEoU9ToPVt7V48Q4g2I104gTd0ZOQ1bW2xLC3BY7n9cIh6nmzvOtCg3dF0W2g0wiSrsdx4u7G0u8zZisjAOecietw0Q4vwxK9+Mfm9068E1HCkAFKNA+dSHdxqEy7RKnQn3cKJ/be6fux+VfF5sENU+yTEZ/pQ11rp7zbe2rkstUT+aPZpOE+zrgs2Sl5UjwRznUnAJ+QcGz+8zUrRXn/6h71zBb4OANIfefY/xl7PjdQqlbhaDzIAuGjnOxELCDyCwXe1daADv7N76QjkyGB2H1B7799l1bYD1Bw4AMFYZ1i5tOzC+Yn6zeb+0z/sRS4LF30ZQRrOORfP+qZnh89O7/nZf+bd42gEDgCpRrJmu4jARTte8bFyz/lJgIbJdu5sLgHBvf0fin2t/+auB7I/hhfosNWJy430XSRdbTg2vffxT6793ETQbo9t4c7kyWAw8F80OeciR3LV7p8+N/r8Oyc8inbZwIU8mCBdGdwq2AboCwQ8gWV05qOPLP+X0hH4q9yhhnxNkGUjQKqRTI59esWbU0NoqOm2mltS7P6aARdiv2L5t/72HRSjnoKYKwrcNmB7gppYuN00qqUf3rkn8ys6Qh7LvlB7TILCdgKkDJiNvbFq93TUjWMBXK9JitVzM+C9FGD5mqeeGKmXxdYBt3uuWnqQrIhmcwAumkeBfnDnnqVH6Zj0Z9n9ZpzqjTktQIyxYjuD0cPrP5+LsDx4mjiSUo2a5SsB3GOh1n94TVLmAVyc0iIrdwMX3bqtG2FplhXZ2JmNuz3r11ygOxbueD8GCdbwy7ZwC66zcHJVttxBty6L34sA9W5hqqrvLMC1dA+8HIGCn8XbwB/L7q/1oCMyk1QSY60o9rGAkxXufH7rgAuKdR6J44enYHWM4xWdK7EYuIG9buUFqrKp/Ky1TqQAWNWC13d04TRucwIlF7VT46OsHJM5lJ0q4yjg3XNz1CUpEpenukh+7ODqL821m8Dp9gMeJ3DxVb/QnnMeaOHuKzh6XqVtexumZafMOfjHm29L375yY3szQ3ynWNS+dPD53OuVd4xd/b8Ve6jvgx0pWQ4sqygBZY++/OPpn2cvUDf4udASwEd5wfiUcuTsOXR7pLrBG1/amyi00bh7iyxoXCZwjXgizRYCr142larJSFKV0Y5118j/dvPHMxGeepihReOZkTeK96++ocNMz4Ycpwrj6t2/3DtTMXQu7Bwxy5uKCv3ELXt6MqlUHiF0Iexa2y88FR9VyQrEWRdmaOLkpnurznvwmX7A5yUp/hbuBZ5KpSAhyeiBjZuTX7zuw0vCBjSfz4WVb9//3axqGNwNvZXAB07sVRgu9gKgbntVxWo48J1nn4+NVEr9iDOP5SgSeffwwJ2N6dm5S4oDPCnJiEsy6iYS2n3dDYkvbNi2UMD57/38+5NUV5kNvcxkDlCKZOXNLHw7f0GaunhxOS1rGY6wJ+EWBlxMEjGgHwBcaTbL8SRENhI5eubgTYM1uzA7nx/wFIiFUlh33OBYicXx7ms3xx96301NcuTzsW3rHAqUf+zAD6byOmY5VuCVqqULaYli5X7AhzjHz5z6zjKUUJYxA/msITJgVQ+UlK2//rZM5XQ/R9gvAVp1PpGmaKtOH962zYzgLxu4sPBERxp1KnF817oNiUcGbgyukp0/bxP4H7y4b6aMwcgLKy8K6DovzwO4yPlvOPdUDyHGCsSaLCBUBsz8gW9/4QVpIjNxDTb84i5bWazwilO19Mkb/uiMyMPMH7i5YMoomZbRkhjDaXkJ/tg16+KPrLeAf/fc65Xj+Xe5hDEiCHke011rrpcHOpfWasS/f+ENejz/LgPZ9VRSDQzO+eeuukG0JRSAD770TK6CuZEvzLI8xaxi5OcMfPPw0zM6La/ktZcBmm+VBQG/7tgPlgDIIsPqc3hjWcS52jW15PSBHTv0ywJuWrcko1gsjpfGEbl19UD8y9d+0Hx9JEcpLwLllHqzguJWlibTyD3MHC3BDPXmcOxR9FbbCuD3HNw3W6EVY1LX2KyuMk3DrMyqPn3I0/Prj+zpeZ1O4Icn/4eE14k7dxcEXFxuy9G9KxmG5d5Le63bMKiR6Vx6+sDaHWaFbUuApxOYtCud+NbVa2vAT85MGCNawXTdMBIT6wziA50Zkpad7OGxXJaPa4W6bBwFqgH8dqYPp2VZvJ/J7zny3GxFV43JwqwFXMKsXNDNhTPsqEWao07yyvflrIZ9yWANF9K05di+Po7kLic7YydbrSoBhcO5w9sGa7mZ1gLP9Ma//P6bTQv/1/PH1BOFUW7KiawA0XXzp6FTdP/qLdK16Z6azPz7W0eNs+ok0ygAkWQuSIvtJiJJfNeaTdJAypKU+w79Vz5HVaOsCR2fYdOGIVI1bO7Am204ez9rZuFinKK49dljAxs4gjZnAi3tRpyPHNvyh5fcxtAy4CmeJLes36B8ZcEWzVYBfzH4YagrpbB2bYIt3O5ILKBTXdMbOdKr3ooMksSyrw3c+Xb9xVoGXEjKTT3LY1+9Ybu5aJYo5TVddhsNpUjosvtGcpTCDC3V8vCyLPxr6+iVk+biKiz8/iPPzU6XCsyycJVNGwVeKei8PofvR9SRlADgLilxL3kGkydObhoMjTRF8DOsVjZipkuIQ+H1zXe96ZdLXzDg3zh5qPyWkWOMYiSKBwxKkRJTgAFG9/b2K1s6e2teypMXjtD/y2eZUZUTXZY4qNYe9q61W+XrOzOSreGleuCGzu0wv5mONwXuU6xk20hU4OLaAyf2tskUX7VkS/eZA2iH7zdYtBT4B3ozytfe97tm4DNBS+ySpjHk9lLMUciwQUkRd/4kS0v8YrHIZRksy3Zt8vWlOklSlk0LF4tm64E3ltnV7UtGsnB7ssVC2myXqKXAt3RnlK9vtYC3+vAAF8FPoSopl2PhATWPllnUtsnmBDxs3C0Gnla+vnXnggGveSmBwINfNTq4c5e5xfbYqEvDm0iJ7XEYDBYhcMCkPd2J+9vSyjdvWnjgRV1j+bzGcpLKRHjvaPgcgIdZd1XWDLJYgEMKRFgvIs30FQAu6gMfOPKT2RzRjKII7XWN5agN3PFqgh5py8InpcdE4NPUsi1BsdeR9xS4ezB2HuWKAj/xk9lSqchmtLIhgFOxXWda+FyBe4MbbzDubAKL8S4u4CKXknYsfH2yXf7nD9+xYPnw+1/5UUHVNSMIuFkhEHC8/IkHe0wLHxahvbcixVN5VVfYaWgwcXJbuB8etljan89p0Wyw8CpwK3mVJOk4kf5p2x2dS5NWsNLK4+jMhPE3bx0q5nRHUmwLj7IDYQIvCUnxBj4e9D716osKuNjp6Uk72cKkkiBrEt3yHX3rYjLCIo2CMIjUrAwi66zrlgUKH3xzeilKgiyyinCqNCGyirX5Eb9JEnChoww4n+Uq++n429pUKW+IXIq5aLo0fL7AfYVlMVu42PFJSp1oSZzhdHoJTsYSpB2w1NGmEFniJEaSGLBhklfMxJWOzIy3LMO6VBe6b+UA+fu3XjWmNLUWymtV8AZnXOTDxU8dY6NSKbE8BaNkFNi0Vjaojq3Q3tD5fIB7M9Ze3XaeTBkMjS4eSbGAOzs+3XEgCSVBYnKMtMsKQVjCiThCSDdwLWNoArc2GnpiMTRetL4PwMwSVg+NakCqwHXGuMoMljMoE/pd0jVWKGhs1nQJrQ1lE3hIvdvLt3klxaviQd80tMiAi0IU9yZEexyRNimNOxUgmEg4QSRs7fhgxJD4KSSluqsTA5CotQEiDpE5wa4cisFlrsuM67zCixWDM0NnJYMyW07Uos4ryvyAu0N38+I+2m0trBQWkYZbxT+iHoWnrV17RYnjdkXBkqTglGRgLMlYRhgJ6OI9E1kTwGNgYAt0rArfqcqxElZCj1RVBZ3LnMqM00qZU2ZwAVtIib2JjA2Zm3v2c7Rwy7qDZMQ2ARk4MmhPNv/mgR3Rvw8lzFG4DC/FAi6qsey6lFiM4TjuQLJi4A7chhimSMEYyZggoeTmMLEFXRzMtHjnwNySFRWsKaCmf10BAVtjBhewxU9RJiFAm3IS8bAl5XHbSwl5jZBTg/Z0db9pb41FvExoMxt4YH14UA9W2ZtVY2gGQULPUymIGQwzIqE4kVAikQBGNKRUYTMsIfGqBTPrDa0XrMS/jV+nUzH/hpnCK1AGEdiIv6hM59hQTNg16w4dotXg5dseXPpqaZL8hQm82Yu4FCQdymoMzp3cNNjy76q1gQe+AdEcuPP6iZAWAV9EnpxoKAlJENWwTJWQWNCSyWStcDNGnJdqjWqwQmIyF79romjTNQvlqmRgRVg1mKDFPUUr/7HuXkz+yZ0PLXs6exq+kT0SALxavGPIkxvO0pF9gwvzVdg2cOsdn7PHp/e8+KNINdKews5aUaeMxOs/TtlyChLErp61JsAEYMqK41ZwjQq/kbt/io9LZQCsON7LXCC7DeWPr9oce+K6W5b86fCL8GJp1HeRFFVSFOjwiU2DUxEfmnk1q2ko53w9Bej4xPP7Ro+Mnwv9ovPmlbT2vYhFta5m3JXQi4t3M5NJKEEJxBNhWa71NpC9Dy/CdRSTOcfVnzPUfGKiLJSivy7Sjv731k/1jFGdDA5Xa8PrvBJJIllcyr5rvwI4L5IRT3IDF8/UwLSm8a++9LOpfReONi3pbQDuMDZ/q31eqyN3Km3tP5m5j6QzA0zTEFYULn6638FyxmK1reVMQnzvGztXkb++/tbOVakl8uD5/XC+5H2ThEh4lpRiFw9v+/3wOouIQMOaebwEzrkYkXgTOT5cmKqcmZnRJqaLRnV9C+vL//OYeIu5/l1PVyleDECv+9xTqFf9j65hJCkKr2/rd9GueAL3JTrlq9u6YiWg8PjoIThUyppSYhAwMFMme9rSE632QKIAasiucc5F4sl+114MNzADF+UC71WbUVqC/blheDJ7HPJMrwBIeWIk83ded0fucr5Z83LH0xRm9YsOFg3wfQDov8f3x0fYZAJUSSrrREK6JiGZSFQHwiQwFGroZUwoJxLlpTJVtP6CXbl6ubBacf7/A7kxJfsyNujOAAAAAElFTkSuQmCC"},22214:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return N}});var A=S(58289),Z=S(75538),B=S(85458);function N(T,k,_){return k=(0,A.Z)(k),(0,B.Z)(T,(0,Z.Z)()?Reflect.construct(k,_||[],(0,A.Z)(T).constructor):k.apply(T,_))}},30168:function(U,Q){"use strict";var S={value:()=>{}};function A(){for(var k=0,_=arguments.length,C={},R;k<_;++k){if(!(R=arguments[k]+"")||R in C||/[\s.]/.test(R))throw new Error("illegal type: "+R);C[R]=[]}return new Z(C)}function Z(k){this._=k}function B(k,_){return k.trim().split(/^|\s+/).map(function(C){var R="",z=C.indexOf(".");if(z>=0&&(R=C.slice(z+1),C=C.slice(0,z)),C&&!_.hasOwnProperty(C))throw new Error("unknown type: "+C);return{type:C,name:R}})}Z.prototype=A.prototype={constructor:Z,on:function(k,_){var C=this._,R=B(k+"",C),z,D=-1,W=R.length;if(arguments.length<2){for(;++D<W;)if((z=(k=R[D]).type)&&(z=N(C[z],k.name)))return z;return}if(_!=null&&typeof _!="function")throw new Error("invalid callback: "+_);for(;++D<W;)if(z=(k=R[D]).type)C[z]=T(C[z],k.name,_);else if(_==null)for(z in C)C[z]=T(C[z],k.name,null);return this},copy:function(){var k={},_=this._;for(var C in _)k[C]=_[C].slice();return new Z(k)},call:function(k,_){if((z=arguments.length-2)>0)for(var C=new Array(z),R=0,z,D;R<z;++R)C[R]=arguments[R+2];if(!this._.hasOwnProperty(k))throw new Error("unknown type: "+k);for(D=this._[k],R=0,z=D.length;R<z;++R)D[R].value.apply(_,C)},apply:function(k,_,C){if(!this._.hasOwnProperty(k))throw new Error("unknown type: "+k);for(var R=this._[k],z=0,D=R.length;z<D;++z)R[z].value.apply(_,C)}};function N(k,_){for(var C=0,R=k.length,z;C<R;++C)if((z=k[C]).name===_)return z.value}function T(k,_,C){for(var R=0,z=k.length;R<z;++R)if(k[R].name===_){k[R]=S,k=k.slice(0,R).concat(k.slice(R+1));break}return C!=null&&k.push({name:_,value:C}),k}Q.Z=A},12713:function(U,Q,S){"use strict";S.d(Q,{H:function(){return B},Z:function(){return A}});function A(N){const T=+this._x.call(null,N),k=+this._y.call(null,N),_=+this._z.call(null,N);return Z(this.cover(T,k,_),T,k,_,N)}function Z(N,T,k,_,C){if(isNaN(T)||isNaN(k)||isNaN(_))return N;var R,z=N._root,D={data:C},W=N._x0,X=N._y0,K=N._z0,rt=N._x1,nt=N._y1,q=N._z1,it,at,ut,ht,xt,pt,wt,gt,Et,kt,zt;if(!z)return N._root=D,N;for(;z.length;)if((wt=T>=(it=(W+rt)/2))?W=it:rt=it,(gt=k>=(at=(X+nt)/2))?X=at:nt=at,(Et=_>=(ut=(K+q)/2))?K=ut:q=ut,R=z,!(z=z[kt=Et<<2|gt<<1|wt]))return R[kt]=D,N;if(ht=+N._x.call(null,z.data),xt=+N._y.call(null,z.data),pt=+N._z.call(null,z.data),T===ht&&k===xt&&_===pt)return D.next=z,R?R[kt]=D:N._root=D,N;do R=R?R[kt]=new Array(8):N._root=new Array(8),(wt=T>=(it=(W+rt)/2))?W=it:rt=it,(gt=k>=(at=(X+nt)/2))?X=at:nt=at,(Et=_>=(ut=(K+q)/2))?K=ut:q=ut;while((kt=Et<<2|gt<<1|wt)===(zt=(pt>=ut)<<2|(xt>=at)<<1|ht>=it));return R[zt]=z,R[kt]=D,N}function B(N){Array.isArray(N)||(N=Array.from(N));const T=N.length,k=new Float64Array(T),_=new Float64Array(T),C=new Float64Array(T);let R=1/0,z=1/0,D=1/0,W=-1/0,X=-1/0,K=-1/0;for(let rt=0,nt,q,it,at;rt<T;++rt)isNaN(q=+this._x.call(null,nt=N[rt]))||isNaN(it=+this._y.call(null,nt))||isNaN(at=+this._z.call(null,nt))||(k[rt]=q,_[rt]=it,C[rt]=at,q<R&&(R=q),q>W&&(W=q),it<z&&(z=it),it>X&&(X=it),at<D&&(D=at),at>K&&(K=at));if(R>W||z>X||D>K)return this;this.cover(R,z,D).cover(W,X,K);for(let rt=0;rt<T;++rt)Z(this,k[rt],_[rt],C[rt],N[rt]);return this}},17646:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(Z,B,N){if(isNaN(Z=+Z)||isNaN(B=+B)||isNaN(N=+N))return this;var T=this._x0,k=this._y0,_=this._z0,C=this._x1,R=this._y1,z=this._z1;if(isNaN(T))C=(T=Math.floor(Z))+1,R=(k=Math.floor(B))+1,z=(_=Math.floor(N))+1;else{for(var D=C-T||1,W=this._root,X,K;T>Z||Z>=C||k>B||B>=R||_>N||N>=z;)switch(K=(N<_)<<2|(B<k)<<1|Z<T,X=new Array(8),X[K]=W,W=X,D*=2,K){case 0:C=T+D,R=k+D,z=_+D;break;case 1:T=C-D,R=k+D,z=_+D;break;case 2:C=T+D,k=R-D,z=_+D;break;case 3:T=C-D,k=R-D,z=_+D;break;case 4:C=T+D,R=k+D,_=z-D;break;case 5:T=C-D,R=k+D,_=z-D;break;case 6:C=T+D,k=R-D,_=z-D;break;case 7:T=C-D,k=R-D,_=z-D;break}this._root&&this._root.length&&(this._root=W)}return this._x0=T,this._y0=k,this._z0=_,this._x1=C,this._y1=R,this._z1=z,this}},39894:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var Z=[];return this.visit(function(B){if(!B.length)do Z.push(B.data);while(B=B.next)}),Z}},56033:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(Z){return arguments.length?this.cover(+Z[0][0],+Z[0][1],+Z[0][2]).cover(+Z[1][0],+Z[1][1],+Z[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}},77480:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(26805);function Z(B,N,T,k){var _,C=this._x0,R=this._y0,z=this._z0,D,W,X,K,rt,nt,q=this._x1,it=this._y1,at=this._z1,ut=[],ht=this._root,xt,pt;for(ht&&ut.push(new A.Z(ht,C,R,z,q,it,at)),k==null?k=1/0:(C=B-k,R=N-k,z=T-k,q=B+k,it=N+k,at=T+k,k*=k);xt=ut.pop();)if(!(!(ht=xt.node)||(D=xt.x0)>q||(W=xt.y0)>it||(X=xt.z0)>at||(K=xt.x1)<C||(rt=xt.y1)<R||(nt=xt.z1)<z))if(ht.length){var wt=(D+K)/2,gt=(W+rt)/2,Et=(X+nt)/2;ut.push(new A.Z(ht[7],wt,gt,Et,K,rt,nt),new A.Z(ht[6],D,gt,Et,wt,rt,nt),new A.Z(ht[5],wt,W,Et,K,gt,nt),new A.Z(ht[4],D,W,Et,wt,gt,nt),new A.Z(ht[3],wt,gt,X,K,rt,Et),new A.Z(ht[2],D,gt,X,wt,rt,Et),new A.Z(ht[1],wt,W,X,K,gt,Et),new A.Z(ht[0],D,W,X,wt,gt,Et)),(pt=(T>=Et)<<2|(N>=gt)<<1|B>=wt)&&(xt=ut[ut.length-1],ut[ut.length-1]=ut[ut.length-1-pt],ut[ut.length-1-pt]=xt)}else{var kt=B-+this._x.call(null,ht.data),zt=N-+this._y.call(null,ht.data),Ut=T-+this._z.call(null,ht.data),Qt=kt*kt+zt*zt+Ut*Ut;if(Qt<k){var Ee=Math.sqrt(k=Qt);C=B-Ee,R=N-Ee,z=T-Ee,q=B+Ee,it=N+Ee,at=T+Ee,_=ht.data}}return _}},72096:function(U,Q,S){"use strict";S.d(Q,{r:function(){return Z}});const A=(B,N,T,k,_,C)=>Math.sqrt(is(B-k,2)+is(N-_,2)+is(T-C,2));function Z(B,N,T,k){const _=[],C=B-k,R=N-k,z=T-k,D=B+k,W=N+k,X=T+k;return this.visit((K,rt,nt,q,it,at,ut)=>{if(!K.length)do{const ht=K.data;A(B,N,T,this._x(ht),this._y(ht),this._z(ht))<=k&&_.push(ht)}while(K=K.next);return rt>D||nt>W||q>X||it<C||at<R||ut<z}),_}},26805:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(Z,B,N,T,k,_,C){this.node=Z,this.x0=B,this.y0=N,this.z0=T,this.x1=k,this.y1=_,this.z1=C}},7695:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return rt}});var A=S(12713),Z=S(17646),B=S(39894),N=S(56033),T=S(77480),k=S(72096),_=S(36989),C=S(10325),R=S(15902),z=S(12027),D=S(66612),W=S(14763),X=S(94009),K=S(68889);function rt(at,ut,ht,xt){var pt=new nt(ut==null?W.P:ut,ht==null?X.q:ht,xt==null?K.i:xt,NaN,NaN,NaN,NaN,NaN,NaN);return at==null?pt:pt.addAll(at)}function nt(at,ut,ht,xt,pt,wt,gt,Et,kt){this._x=at,this._y=ut,this._z=ht,this._x0=xt,this._y0=pt,this._z0=wt,this._x1=gt,this._y1=Et,this._z1=kt,this._root=void 0}function q(at){for(var ut={data:at.data},ht=ut;at=at.next;)ht=ht.next={data:at.data};return ut}var it=rt.prototype=nt.prototype;it.copy=function(){var at=new nt(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),ut=this._root,ht,xt;if(!ut)return at;if(!ut.length)return at._root=q(ut),at;for(ht=[{source:ut,target:at._root=new Array(8)}];ut=ht.pop();)for(var pt=0;pt<8;++pt)(xt=ut.source[pt])&&(xt.length?ht.push({source:xt,target:ut.target[pt]=new Array(8)}):ut.target[pt]=q(xt));return at},it.add=A.Z,it.addAll=A.H,it.cover=Z.Z,it.data=B.Z,it.extent=N.Z,it.find=T.Z,it.findAllWithinRadius=k.r,it.remove=_.Z,it.removeAll=_.x,it.root=C.Z,it.size=R.Z,it.visit=z.Z,it.visitAfter=D.Z,it.x=W.Z,it.y=X.Z,it.z=K.Z},36989:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A},x:function(){return Z}});function A(B){if(isNaN(rt=+this._x.call(null,B))||isNaN(nt=+this._y.call(null,B))||isNaN(q=+this._z.call(null,B)))return this;var N,T=this._root,k,_,C,R=this._x0,z=this._y0,D=this._z0,W=this._x1,X=this._y1,K=this._z1,rt,nt,q,it,at,ut,ht,xt,pt,wt,gt;if(!T)return this;if(T.length)for(;;){if((ht=rt>=(it=(R+W)/2))?R=it:W=it,(xt=nt>=(at=(z+X)/2))?z=at:X=at,(pt=q>=(ut=(D+K)/2))?D=ut:K=ut,N=T,!(T=T[wt=pt<<2|xt<<1|ht]))return this;if(!T.length)break;(N[wt+1&7]||N[wt+2&7]||N[wt+3&7]||N[wt+4&7]||N[wt+5&7]||N[wt+6&7]||N[wt+7&7])&&(k=N,gt=wt)}for(;T.data!==B;)if(_=T,!(T=T.next))return this;return(C=T.next)&&delete T.next,_?(C?_.next=C:delete _.next,this):N?(C?N[wt]=C:delete N[wt],(T=N[0]||N[1]||N[2]||N[3]||N[4]||N[5]||N[6]||N[7])&&T===(N[7]||N[6]||N[5]||N[4]||N[3]||N[2]||N[1]||N[0])&&!T.length&&(k?k[gt]=T:this._root=T),this):(this._root=C,this)}function Z(B){for(var N=0,T=B.length;N<T;++N)this.remove(B[N]);return this}},10325:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){return this._root}},15902:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var Z=0;return this.visit(function(B){if(!B.length)do++Z;while(B=B.next)}),Z}},12027:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(26805);function Z(B){var N=[],T,k=this._root,_,C,R,z,D,W,X;for(k&&N.push(new A.Z(k,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));T=N.pop();)if(!B(k=T.node,C=T.x0,R=T.y0,z=T.z0,D=T.x1,W=T.y1,X=T.z1)&&k.length){var K=(C+D)/2,rt=(R+W)/2,nt=(z+X)/2;(_=k[7])&&N.push(new A.Z(_,K,rt,nt,D,W,X)),(_=k[6])&&N.push(new A.Z(_,C,rt,nt,K,W,X)),(_=k[5])&&N.push(new A.Z(_,K,R,nt,D,rt,X)),(_=k[4])&&N.push(new A.Z(_,C,R,nt,K,rt,X)),(_=k[3])&&N.push(new A.Z(_,K,rt,z,D,W,nt)),(_=k[2])&&N.push(new A.Z(_,C,rt,z,K,W,nt)),(_=k[1])&&N.push(new A.Z(_,K,R,z,D,rt,nt)),(_=k[0])&&N.push(new A.Z(_,C,R,z,K,rt,nt))}return this}},66612:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(26805);function Z(B){var N=[],T=[],k;for(this._root&&N.push(new A.Z(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));k=N.pop();){var _=k.node;if(_.length){var C,R=k.x0,z=k.y0,D=k.z0,W=k.x1,X=k.y1,K=k.z1,rt=(R+W)/2,nt=(z+X)/2,q=(D+K)/2;(C=_[0])&&N.push(new A.Z(C,R,z,D,rt,nt,q)),(C=_[1])&&N.push(new A.Z(C,rt,z,D,W,nt,q)),(C=_[2])&&N.push(new A.Z(C,R,nt,D,rt,X,q)),(C=_[3])&&N.push(new A.Z(C,rt,nt,D,W,X,q)),(C=_[4])&&N.push(new A.Z(C,R,z,q,rt,nt,K)),(C=_[5])&&N.push(new A.Z(C,rt,z,q,W,nt,K)),(C=_[6])&&N.push(new A.Z(C,R,nt,q,rt,X,K)),(C=_[7])&&N.push(new A.Z(C,rt,nt,q,W,X,K))}T.push(k)}for(;k=T.pop();)B(k.node,k.x0,k.y0,k.z0,k.x1,k.y1,k.z1);return this}},14763:function(U,Q,S){"use strict";S.d(Q,{P:function(){return A},Z:function(){return Z}});function A(B){return B[0]}function Z(B){return arguments.length?(this._x=B,this):this._x}},94009:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z},q:function(){return A}});function A(B){return B[1]}function Z(B){return arguments.length?(this._y=B,this):this._y}},68889:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z},i:function(){return A}});function A(B){return B[2]}function Z(B){return arguments.length?(this._z=B,this):this._z}},60272:function(U,Q,S){"use strict";S.d(Q,{H:function(){return B},Z:function(){return A}});function A(N){const T=+this._x.call(null,N),k=+this._y.call(null,N);return Z(this.cover(T,k),T,k,N)}function Z(N,T,k,_){if(isNaN(T)||isNaN(k))return N;var C,R=N._root,z={data:_},D=N._x0,W=N._y0,X=N._x1,K=N._y1,rt,nt,q,it,at,ut,ht,xt;if(!R)return N._root=z,N;for(;R.length;)if((at=T>=(rt=(D+X)/2))?D=rt:X=rt,(ut=k>=(nt=(W+K)/2))?W=nt:K=nt,C=R,!(R=R[ht=ut<<1|at]))return C[ht]=z,N;if(q=+N._x.call(null,R.data),it=+N._y.call(null,R.data),T===q&&k===it)return z.next=R,C?C[ht]=z:N._root=z,N;do C=C?C[ht]=new Array(4):N._root=new Array(4),(at=T>=(rt=(D+X)/2))?D=rt:X=rt,(ut=k>=(nt=(W+K)/2))?W=nt:K=nt;while((ht=ut<<1|at)===(xt=(it>=nt)<<1|q>=rt));return C[xt]=R,C[ht]=z,N}function B(N){var T,k,_=N.length,C,R,z=new Array(_),D=new Array(_),W=1/0,X=1/0,K=-1/0,rt=-1/0;for(k=0;k<_;++k)isNaN(C=+this._x.call(null,T=N[k]))||isNaN(R=+this._y.call(null,T))||(z[k]=C,D[k]=R,C<W&&(W=C),C>K&&(K=C),R<X&&(X=R),R>rt&&(rt=R));if(W>K||X>rt)return this;for(this.cover(W,X).cover(K,rt),k=0;k<_;++k)Z(this,z[k],D[k],N[k]);return this}},51097:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(Z,B){if(isNaN(Z=+Z)||isNaN(B=+B))return this;var N=this._x0,T=this._y0,k=this._x1,_=this._y1;if(isNaN(N))k=(N=Math.floor(Z))+1,_=(T=Math.floor(B))+1;else{for(var C=k-N||1,R=this._root,z,D;N>Z||Z>=k||T>B||B>=_;)switch(D=(B<T)<<1|Z<N,z=new Array(4),z[D]=R,R=z,C*=2,D){case 0:k=N+C,_=T+C;break;case 1:N=k-C,_=T+C;break;case 2:k=N+C,T=_-C;break;case 3:N=k-C,T=_-C;break}this._root&&this._root.length&&(this._root=R)}return this._x0=N,this._y0=T,this._x1=k,this._y1=_,this}},58007:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var Z=[];return this.visit(function(B){if(!B.length)do Z.push(B.data);while(B=B.next)}),Z}},12070:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(Z){return arguments.length?this.cover(+Z[0][0],+Z[0][1]).cover(+Z[1][0],+Z[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}},47064:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(44213);function Z(B,N,T){var k,_=this._x0,C=this._y0,R,z,D,W,X=this._x1,K=this._y1,rt=[],nt=this._root,q,it;for(nt&&rt.push(new A.Z(nt,_,C,X,K)),T==null?T=1/0:(_=B-T,C=N-T,X=B+T,K=N+T,T*=T);q=rt.pop();)if(!(!(nt=q.node)||(R=q.x0)>X||(z=q.y0)>K||(D=q.x1)<_||(W=q.y1)<C))if(nt.length){var at=(R+D)/2,ut=(z+W)/2;rt.push(new A.Z(nt[3],at,ut,D,W),new A.Z(nt[2],R,ut,at,W),new A.Z(nt[1],at,z,D,ut),new A.Z(nt[0],R,z,at,ut)),(it=(N>=ut)<<1|B>=at)&&(q=rt[rt.length-1],rt[rt.length-1]=rt[rt.length-1-it],rt[rt.length-1-it]=q)}else{var ht=B-+this._x.call(null,nt.data),xt=N-+this._y.call(null,nt.data),pt=ht*ht+xt*xt;if(pt<T){var wt=Math.sqrt(T=pt);_=B-wt,C=N-wt,X=B+wt,K=N+wt,k=nt.data}}return k}},44213:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(Z,B,N,T,k){this.node=Z,this.x0=B,this.y0=N,this.x1=T,this.y1=k}},14301:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return X}});var A=S(60272),Z=S(51097),B=S(58007),N=S(12070),T=S(47064),k=S(88866),_=S(10864),C=S(68984),R=S(3715),z=S(73607),D=S(56570),W=S(30992);function X(q,it,at){var ut=new K(it==null?D.P:it,at==null?W.q:at,NaN,NaN,NaN,NaN);return q==null?ut:ut.addAll(q)}function K(q,it,at,ut,ht,xt){this._x=q,this._y=it,this._x0=at,this._y0=ut,this._x1=ht,this._y1=xt,this._root=void 0}function rt(q){for(var it={data:q.data},at=it;q=q.next;)at=at.next={data:q.data};return it}var nt=X.prototype=K.prototype;nt.copy=function(){var q=new K(this._x,this._y,this._x0,this._y0,this._x1,this._y1),it=this._root,at,ut;if(!it)return q;if(!it.length)return q._root=rt(it),q;for(at=[{source:it,target:q._root=new Array(4)}];it=at.pop();)for(var ht=0;ht<4;++ht)(ut=it.source[ht])&&(ut.length?at.push({source:ut,target:it.target[ht]=new Array(4)}):it.target[ht]=rt(ut));return q},nt.add=A.Z,nt.addAll=A.H,nt.cover=Z.Z,nt.data=B.Z,nt.extent=N.Z,nt.find=T.Z,nt.remove=k.Z,nt.removeAll=k.x,nt.root=_.Z,nt.size=C.Z,nt.visit=R.Z,nt.visitAfter=z.Z,nt.x=D.Z,nt.y=W.Z},88866:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A},x:function(){return Z}});function A(B){if(isNaN(X=+this._x.call(null,B))||isNaN(K=+this._y.call(null,B)))return this;var N,T=this._root,k,_,C,R=this._x0,z=this._y0,D=this._x1,W=this._y1,X,K,rt,nt,q,it,at,ut;if(!T)return this;if(T.length)for(;;){if((q=X>=(rt=(R+D)/2))?R=rt:D=rt,(it=K>=(nt=(z+W)/2))?z=nt:W=nt,N=T,!(T=T[at=it<<1|q]))return this;if(!T.length)break;(N[at+1&3]||N[at+2&3]||N[at+3&3])&&(k=N,ut=at)}for(;T.data!==B;)if(_=T,!(T=T.next))return this;return(C=T.next)&&delete T.next,_?(C?_.next=C:delete _.next,this):N?(C?N[at]=C:delete N[at],(T=N[0]||N[1]||N[2]||N[3])&&T===(N[3]||N[2]||N[1]||N[0])&&!T.length&&(k?k[ut]=T:this._root=T),this):(this._root=C,this)}function Z(B){for(var N=0,T=B.length;N<T;++N)this.remove(B[N]);return this}},10864:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){return this._root}},68984:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var Z=0;return this.visit(function(B){if(!B.length)do++Z;while(B=B.next)}),Z}},3715:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(44213);function Z(B){var N=[],T,k=this._root,_,C,R,z,D;for(k&&N.push(new A.Z(k,this._x0,this._y0,this._x1,this._y1));T=N.pop();)if(!B(k=T.node,C=T.x0,R=T.y0,z=T.x1,D=T.y1)&&k.length){var W=(C+z)/2,X=(R+D)/2;(_=k[3])&&N.push(new A.Z(_,W,X,z,D)),(_=k[2])&&N.push(new A.Z(_,C,X,W,D)),(_=k[1])&&N.push(new A.Z(_,W,R,z,X)),(_=k[0])&&N.push(new A.Z(_,C,R,W,X))}return this}},73607:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z}});var A=S(44213);function Z(B){var N=[],T=[],k;for(this._root&&N.push(new A.Z(this._root,this._x0,this._y0,this._x1,this._y1));k=N.pop();){var _=k.node;if(_.length){var C,R=k.x0,z=k.y0,D=k.x1,W=k.y1,X=(R+D)/2,K=(z+W)/2;(C=_[0])&&N.push(new A.Z(C,R,z,X,K)),(C=_[1])&&N.push(new A.Z(C,X,z,D,K)),(C=_[2])&&N.push(new A.Z(C,R,K,X,W)),(C=_[3])&&N.push(new A.Z(C,X,K,D,W))}T.push(k)}for(;k=T.pop();)B(k.node,k.x0,k.y0,k.x1,k.y1);return this}},56570:function(U,Q,S){"use strict";S.d(Q,{P:function(){return A},Z:function(){return Z}});function A(B){return B[0]}function Z(B){return arguments.length?(this._x=B,this):this._x}},30992:function(U,Q,S){"use strict";S.d(Q,{Z:function(){return Z},q:function(){return A}});function A(B){return B[1]}function Z(B){return arguments.length?(this._y=B,this):this._y}},83833:function(U,Q,S){"use strict";S.d(Q,{HT:function(){return rt}});var A=0,Z=0,B=0,N=1e3,T,k,_=0,C=0,R=0,z=typeof performance=="object"&&performance.now?performance:Date,D=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(ht){setTimeout(ht,17)};function W(){return C||(D(X),C=z.now()+R)}function X(){C=0}function K(){this._call=this._time=this._next=null}K.prototype=rt.prototype={constructor:K,restart:function(ht,xt,pt){if(typeof ht!="function")throw new TypeError("callback is not a function");pt=(pt==null?W():+pt)+(xt==null?0:+xt),!this._next&&k!==this&&(k?k._next=this:T=this,k=this),this._call=ht,this._time=pt,ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,ut())}};function rt(ht,xt,pt){var wt=new K;return wt.restart(ht,xt,pt),wt}function nt(){W(),++A;for(var ht=T,xt;ht;)(xt=C-ht._time)>=0&&ht._call.call(void 0,xt),ht=ht._next;--A}function q(){C=(_=z.now())+R,A=Z=0;try{nt()}finally{A=0,at(),C=0}}function it(){var ht=z.now(),xt=ht-_;xt>N&&(R-=xt,_=ht)}function at(){for(var ht,xt=T,pt,wt=1/0;xt;)xt._call?(wt>xt._time&&(wt=xt._time),ht=xt,xt=xt._next):(pt=xt._next,xt._next=null,xt=ht?ht._next=pt:T=pt);k=ht,ut(wt)}function ut(ht){if(!A){Z&&(Z=clearTimeout(Z));var xt=ht-C;xt>24?(ht<1/0&&(Z=setTimeout(q,ht-z.now()-R)),B&&(B=clearInterval(B))):(B||(_=z.now(),B=setInterval(it,N)),A=1,D(q))}}},80813:function(U,Q,S){"use strict";S.d(Q,{CR:function(){return q},Jh:function(){return X},Q_:function(){return Qt},XA:function(){return nt},ZT:function(){return Z},_T:function(){return N},ev:function(){return ut},mG:function(){return W},pi:function(){return B},pr:function(){return at}});var A=function(Pt,_t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(It,dt){It.__proto__=dt}||function(It,dt){for(var St in dt)Object.prototype.hasOwnProperty.call(dt,St)&&(It[St]=dt[St])},A(Pt,_t)};function Z(Pt,_t){if(typeof _t!="function"&&_t!==null)throw new TypeError("Class extends value "+String(_t)+" is not a constructor or null");A(Pt,_t);function It(){this.constructor=Pt}Pt.prototype=_t===null?Object.create(_t):(It.prototype=_t.prototype,new It)}var B=function(){return B=Object.assign||function(_t){for(var It,dt=1,St=arguments.length;dt<St;dt++){It=arguments[dt];for(var Ct in It)Object.prototype.hasOwnProperty.call(It,Ct)&&(_t[Ct]=It[Ct])}return _t},B.apply(this,arguments)};function N(Pt,_t){var It={};for(var dt in Pt)Object.prototype.hasOwnProperty.call(Pt,dt)&&_t.indexOf(dt)<0&&(It[dt]=Pt[dt]);if(Pt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var St=0,dt=Object.getOwnPropertySymbols(Pt);St<dt.length;St++)_t.indexOf(dt[St])<0&&Object.prototype.propertyIsEnumerable.call(Pt,dt[St])&&(It[dt[St]]=Pt[dt[St]]);return It}function T(Pt,_t,It,dt){var St=arguments.length,Ct=St<3?_t:dt===null?dt=Object.getOwnPropertyDescriptor(_t,It):dt,Gt;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Ct=Reflect.decorate(Pt,_t,It,dt);else for(var oe=Pt.length-1;oe>=0;oe--)(Gt=Pt[oe])&&(Ct=(St<3?Gt(Ct):St>3?Gt(_t,It,Ct):Gt(_t,It))||Ct);return St>3&&Ct&&Object.defineProperty(_t,It,Ct),Ct}function k(Pt,_t){return function(It,dt){_t(It,dt,Pt)}}function _(Pt,_t,It,dt,St,Ct){function Gt(cr){if(cr!==void 0&&typeof cr!="function")throw new TypeError("Function expected");return cr}for(var oe=dt.kind,ye=oe==="getter"?"get":oe==="setter"?"set":"value",de=!_t&&Pt?dt.static?Pt:Pt.prototype:null,_e=_t||(de?Object.getOwnPropertyDescriptor(de,dt.name):{}),Mn,Nn=!1,Pe=It.length-1;Pe>=0;Pe--){var Se={};for(var re in dt)Se[re]=re==="access"?{}:dt[re];for(var re in dt.access)Se.access[re]=dt.access[re];Se.addInitializer=function(cr){if(Nn)throw new TypeError("Cannot add initializers after decoration has completed");Ct.push(Gt(cr||null))};var Oe=(0,It[Pe])(oe==="accessor"?{get:_e.get,set:_e.set}:_e[ye],Se);if(oe==="accessor"){if(Oe===void 0)continue;if(Oe===null||typeof Oe!="object")throw new TypeError("Object expected");(Mn=Gt(Oe.get))&&(_e.get=Mn),(Mn=Gt(Oe.set))&&(_e.set=Mn),(Mn=Gt(Oe.init))&&St.unshift(Mn)}else(Mn=Gt(Oe))&&(oe==="field"?St.unshift(Mn):_e[ye]=Mn)}de&&Object.defineProperty(de,dt.name,_e),Nn=!0}function C(Pt,_t,It){for(var dt=arguments.length>2,St=0;St<_t.length;St++)It=dt?_t[St].call(Pt,It):_t[St].call(Pt);return dt?It:void 0}function R(Pt){return typeof Pt=="symbol"?Pt:"".concat(Pt)}function z(Pt,_t,It){return typeof _t=="symbol"&&(_t=_t.description?"[".concat(_t.description,"]"):""),Object.defineProperty(Pt,"name",{configurable:!0,value:It?"".concat(It," ",_t):_t})}function D(Pt,_t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(Pt,_t)}function W(Pt,_t,It,dt){function St(Ct){return Ct instanceof It?Ct:new It(function(Gt){Gt(Ct)})}return new(It||(It=Promise))(function(Ct,Gt){function oe(_e){try{de(dt.next(_e))}catch(Mn){Gt(Mn)}}function ye(_e){try{de(dt.throw(_e))}catch(Mn){Gt(Mn)}}function de(_e){_e.done?Ct(_e.value):St(_e.value).then(oe,ye)}de((dt=dt.apply(Pt,_t||[])).next())})}function X(Pt,_t){var It={label:0,sent:function(){if(Ct[0]&1)throw Ct[1];return Ct[1]},trys:[],ops:[]},dt,St,Ct,Gt=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return Gt.next=oe(0),Gt.throw=oe(1),Gt.return=oe(2),typeof Symbol=="function"&&(Gt[Symbol.iterator]=function(){return this}),Gt;function oe(de){return function(_e){return ye([de,_e])}}function ye(de){if(dt)throw new TypeError("Generator is already executing.");for(;Gt&&(Gt=0,de[0]&&(It=0)),It;)try{if(dt=1,St&&(Ct=de[0]&2?St.return:de[0]?St.throw||((Ct=St.return)&&Ct.call(St),0):St.next)&&!(Ct=Ct.call(St,de[1])).done)return Ct;switch(St=0,Ct&&(de=[de[0]&2,Ct.value]),de[0]){case 0:case 1:Ct=de;break;case 4:return It.label++,{value:de[1],done:!1};case 5:It.label++,St=de[1],de=[0];continue;case 7:de=It.ops.pop(),It.trys.pop();continue;default:if(Ct=It.trys,!(Ct=Ct.length>0&&Ct[Ct.length-1])&&(de[0]===6||de[0]===2)){It=0;continue}if(de[0]===3&&(!Ct||de[1]>Ct[0]&&de[1]<Ct[3])){It.label=de[1];break}if(de[0]===6&&It.label<Ct[1]){It.label=Ct[1],Ct=de;break}if(Ct&&It.label<Ct[2]){It.label=Ct[2],It.ops.push(de);break}Ct[2]&&It.ops.pop(),It.trys.pop();continue}de=_t.call(Pt,It)}catch(_e){de=[6,_e],St=0}finally{dt=Ct=0}if(de[0]&5)throw de[1];return{value:de[0]?de[1]:void 0,done:!0}}}var K=Object.create?function(Pt,_t,It,dt){dt===void 0&&(dt=It);var St=Object.getOwnPropertyDescriptor(_t,It);(!St||("get"in St?!_t.__esModule:St.writable||St.configurable))&&(St={enumerable:!0,get:function(){return _t[It]}}),Object.defineProperty(Pt,dt,St)}:function(Pt,_t,It,dt){dt===void 0&&(dt=It),Pt[dt]=_t[It]};function rt(Pt,_t){for(var It in Pt)It!=="default"&&!Object.prototype.hasOwnProperty.call(_t,It)&&K(_t,Pt,It)}function nt(Pt){var _t=typeof Symbol=="function"&&Symbol.iterator,It=_t&&Pt[_t],dt=0;if(It)return It.call(Pt);if(Pt&&typeof Pt.length=="number")return{next:function(){return Pt&&dt>=Pt.length&&(Pt=void 0),{value:Pt&&Pt[dt++],done:!Pt}}};throw new TypeError(_t?"Object is not iterable.":"Symbol.iterator is not defined.")}function q(Pt,_t){var It=typeof Symbol=="function"&&Pt[Symbol.iterator];if(!It)return Pt;var dt=It.call(Pt),St,Ct=[],Gt;try{for(;(_t===void 0||_t-- >0)&&!(St=dt.next()).done;)Ct.push(St.value)}catch(oe){Gt={error:oe}}finally{try{St&&!St.done&&(It=dt.return)&&It.call(dt)}finally{if(Gt)throw Gt.error}}return Ct}function it(){for(var Pt=[],_t=0;_t<arguments.length;_t++)Pt=Pt.concat(q(arguments[_t]));return Pt}function at(){for(var Pt=0,_t=0,It=arguments.length;_t<It;_t++)Pt+=arguments[_t].length;for(var dt=Array(Pt),St=0,_t=0;_t<It;_t++)for(var Ct=arguments[_t],Gt=0,oe=Ct.length;Gt<oe;Gt++,St++)dt[St]=Ct[Gt];return dt}function ut(Pt,_t,It){if(It||arguments.length===2)for(var dt=0,St=_t.length,Ct;dt<St;dt++)(Ct||!(dt in _t))&&(Ct||(Ct=Array.prototype.slice.call(_t,0,dt)),Ct[dt]=_t[dt]);return Pt.concat(Ct||Array.prototype.slice.call(_t))}function ht(Pt){return this instanceof ht?(this.v=Pt,this):new ht(Pt)}function xt(Pt,_t,It){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var dt=It.apply(Pt,_t||[]),St,Ct=[];return St=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),oe("next"),oe("throw"),oe("return",Gt),St[Symbol.asyncIterator]=function(){return this},St;function Gt(Pe){return function(Se){return Promise.resolve(Se).then(Pe,Mn)}}function oe(Pe,Se){dt[Pe]&&(St[Pe]=function(re){return new Promise(function(Oe,cr){Ct.push([Pe,re,Oe,cr])>1||ye(Pe,re)})},Se&&(St[Pe]=Se(St[Pe])))}function ye(Pe,Se){try{de(dt[Pe](Se))}catch(re){Nn(Ct[0][3],re)}}function de(Pe){Pe.value instanceof ht?Promise.resolve(Pe.value.v).then(_e,Mn):Nn(Ct[0][2],Pe)}function _e(Pe){ye("next",Pe)}function Mn(Pe){ye("throw",Pe)}function Nn(Pe,Se){Pe(Se),Ct.shift(),Ct.length&&ye(Ct[0][0],Ct[0][1])}}function pt(Pt){var _t,It;return _t={},dt("next"),dt("throw",function(St){throw St}),dt("return"),_t[Symbol.iterator]=function(){return this},_t;function dt(St,Ct){_t[St]=Pt[St]?function(Gt){return(It=!It)?{value:ht(Pt[St](Gt)),done:!1}:Ct?Ct(Gt):Gt}:Ct}}function wt(Pt){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var _t=Pt[Symbol.asyncIterator],It;return _t?_t.call(Pt):(Pt=typeof nt=="function"?nt(Pt):Pt[Symbol.iterator](),It={},dt("next"),dt("throw"),dt("return"),It[Symbol.asyncIterator]=function(){return this},It);function dt(Ct){It[Ct]=Pt[Ct]&&function(Gt){return new Promise(function(oe,ye){Gt=Pt[Ct](Gt),St(oe,ye,Gt.done,Gt.value)})}}function St(Ct,Gt,oe,ye){Promise.resolve(ye).then(function(de){Ct({value:de,done:oe})},Gt)}}function gt(Pt,_t){return Object.defineProperty?Object.defineProperty(Pt,"raw",{value:_t}):Pt.raw=_t,Pt}var Et=Object.create?function(Pt,_t){Object.defineProperty(Pt,"default",{enumerable:!0,value:_t})}:function(Pt,_t){Pt.default=_t},kt=function(Pt){return kt=Object.getOwnPropertyNames||function(_t){var It=[];for(var dt in _t)Object.prototype.hasOwnProperty.call(_t,dt)&&(It[It.length]=dt);return It},kt(Pt)};function zt(Pt){if(Pt&&Pt.__esModule)return Pt;var _t={};if(Pt!=null)for(var It=kt(Pt),dt=0;dt<It.length;dt++)It[dt]!=="default"&&K(_t,Pt,It[dt]);return Et(_t,Pt),_t}function Ut(Pt){return Pt&&Pt.__esModule?Pt:{default:Pt}}function Qt(Pt,_t,It,dt){if(It==="a"&&!dt)throw new TypeError("Private accessor was defined without a getter");if(typeof _t=="function"?Pt!==_t||!dt:!_t.has(Pt))throw new TypeError("Cannot read private member from an object whose class did not declare it");return It==="m"?dt:It==="a"?dt.call(Pt):dt?dt.value:_t.get(Pt)}function Ee(Pt,_t,It,dt,St){if(dt==="m")throw new TypeError("Private method is not writable");if(dt==="a"&&!St)throw new TypeError("Private accessor was defined without a setter");if(typeof _t=="function"?Pt!==_t||!St:!_t.has(Pt))throw new TypeError("Cannot write private member to an object whose class did not declare it");return dt==="a"?St.call(Pt,It):St?St.value=It:_t.set(Pt,It),It}function Le(Pt,_t){if(_t===null||typeof _t!="object"&&typeof _t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof Pt=="function"?_t===Pt:Pt.has(_t)}function tn(Pt,_t,It){if(_t!=null){if(typeof _t!="object"&&typeof _t!="function")throw new TypeError("Object expected.");var dt,St;if(It){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");dt=_t[Symbol.asyncDispose]}if(dt===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");dt=_t[Symbol.dispose],It&&(St=dt)}if(typeof dt!="function")throw new TypeError("Object not disposable.");St&&(dt=function(){try{St.call(this)}catch(Ct){return Promise.reject(Ct)}}),Pt.stack.push({value:_t,dispose:dt,async:It})}else It&&Pt.stack.push({async:!0});return _t}var er=typeof SuppressedError=="function"?SuppressedError:function(Pt,_t,It){var dt=new Error(It);return dt.name="SuppressedError",dt.error=Pt,dt.suppressed=_t,dt};function $r(Pt){function _t(Ct){Pt.error=Pt.hasError?new er(Ct,Pt.error,"An error was suppressed during disposal."):Ct,Pt.hasError=!0}var It,dt=0;function St(){for(;It=Pt.stack.pop();)try{if(!It.async&&dt===1)return dt=0,Pt.stack.push(It),Promise.resolve().then(St);if(It.dispose){var Ct=It.dispose.call(It.value);if(It.async)return dt|=2,Promise.resolve(Ct).then(St,function(Gt){return _t(Gt),St()})}else dt|=1}catch(Gt){_t(Gt)}if(dt===1)return Pt.hasError?Promise.reject(Pt.error):Promise.resolve();if(Pt.hasError)throw Pt.error}return St()}function la(Pt,_t){return typeof Pt=="string"&&/^\.\.?\//.test(Pt)?Pt.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(It,dt,St,Ct,Gt){return dt?_t?".jsx":".js":St&&(!Ct||!Gt)?It:St+Ct+"."+Gt.toLowerCase()+"js"}):Pt}var as={__extends:Z,__assign:B,__rest:N,__decorate:T,__param:k,__esDecorate:_,__runInitializers:C,__propKey:R,__setFunctionName:z,__metadata:D,__awaiter:W,__generator:X,__createBinding:K,__exportStar:rt,__values:nt,__read:q,__spread:it,__spreadArrays:at,__spreadArray:ut,__await:ht,__asyncGenerator:xt,__asyncDelegator:pt,__asyncValues:wt,__makeTemplateObject:gt,__importStar:zt,__importDefault:Ut,__classPrivateFieldGet:Qt,__classPrivateFieldSet:Ee,__classPrivateFieldIn:Le,__addDisposableResource:tn,__disposeResources:$r,__rewriteRelativeImportExtension:la}}}]);
}());