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.
1 line
1.5 MiB
1 line
1.5 MiB
(self.webpackChunk=self.webpackChunk||[]).push([[45969,42441,43428],{680:function(t,e,n){"use strict";n.d(e,{Z:function(){return l}});var i=n(5891),r=n(59301),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},o=n(22589),s=function(t,e){return r.createElement(o.Z,(0,i.Z)({},t,{ref:e,icon:a}))};var l=r.forwardRef(s)},92275:function(t,e,n){"use strict";n.d(e,{kJ:function(){return jT},RN:function(){return eS}});var i={};n.r(i),n.d(i,{add:function(){return Pt},adjoint:function(){return $},clone:function(){return H},copy:function(){return V},create:function(){return U},determinant:function(){return K},equals:function(){return It},exactEquals:function(){return kt},frob:function(){return Nt},fromQuat:function(){return yt},fromQuat2:function(){return dt},fromRotation:function(){return st},fromRotationTranslation:function(){return ht},fromRotationTranslationScale:function(){return mt},fromRotationTranslationScaleOrigin:function(){return vt},fromScaling:function(){return ot},fromTranslation:function(){return at},fromValues:function(){return Z},fromXRotation:function(){return lt},fromYRotation:function(){return ut},fromZRotation:function(){return ct},frustum:function(){return xt},getRotation:function(){return gt},getScaling:function(){return pt},getTranslation:function(){return ft},identity:function(){return X},invert:function(){return q},lookAt:function(){return Ct},mul:function(){return Bt},multiply:function(){return Q},multiplyScalar:function(){return Rt},multiplyScalarAndAdd:function(){return Dt},ortho:function(){return St},orthoNO:function(){return Tt},orthoZO:function(){return Mt},perspective:function(){return _t},perspectiveFromFieldOfView:function(){return wt},perspectiveNO:function(){return bt},perspectiveZO:function(){return Et},rotate:function(){return et},rotateX:function(){return nt},rotateY:function(){return it},rotateZ:function(){return rt},scale:function(){return tt},set:function(){return W},str:function(){return Ot},sub:function(){return Ft},subtract:function(){return Lt},targetTo:function(){return At},translate:function(){return J},transpose:function(){return Y}});var r={};n.r(r),n.d(r,{circle:function(){return Fg},diamond:function(){return Gg},rect:function(){return Ug},simple:function(){return Vg},triangle:function(){return zg},triangleRect:function(){return Hg},vee:function(){return jg}});var a=n(57259),o=n(79545),s=n(68550),l=n(26390),u=n(43962),c=n(67785),h=n(81058);function d(t,e,n){return e=(0,u.Z)(e),(0,h.Z)(t,(0,c.Z)()?Reflect.construct(e,n||[],(0,u.Z)(t).constructor):e.apply(t,n))}var f=n(17928),p=n(29043),g=n(37271),m=1e-6,v="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function y(){var t=new v(3);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function x(t){var e=new v(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function b(t){var e=t[0],n=t[1],i=t[2];return Math.hypot(e,n,i)}function _(t,e,n){var i=new v(3);return i[0]=t,i[1]=e,i[2]=n,i}function E(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function w(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function T(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function S(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function M(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function C(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function A(t,e){var n=e[0],i=e[1],r=e[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function N(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[0],s=n[1],l=n[2];return t[0]=r*l-a*s,t[1]=a*o-i*l,t[2]=i*s-r*o,t}function P(t,e,n,i){var r=e[0],a=e[1],o=e[2];return t[0]=r+i*(n[0]-r),t[1]=a+i*(n[1]-a),t[2]=o+i*(n[2]-o),t}function L(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,t}function R(t,e,n){var i=n[0],r=n[1],a=n[2],o=n[3],s=e[0],l=e[1],u=e[2],c=r*u-a*l,h=a*s-i*u,d=i*l-r*s,f=r*d-a*h,p=a*c-i*d,g=i*h-r*c,m=2*o;return c*=m,h*=m,d*=m,f*=2,p*=2,g*=2,t[0]=s+c+f,t[1]=l+h+p,t[2]=u+d+g,t}function D(t,e){var n=t[0],i=t[1],r=t[2],a=e[0],o=e[1],s=e[2];return Math.abs(n-a)<=m*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-o)<=m*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(r-s)<=m*Math.max(1,Math.abs(r),Math.abs(s))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var k,I=S,B=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.hypot(n,i,r)},F=b;k=y();function z(){var t=new v(4);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function G(t,e,n,i){var r=new v(4);return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function j(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,t[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,t[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,t[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,t}!function(){var t=z()}();function U(){var t=new v(16);return v!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function H(t){var e=new v(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function V(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Z(t,e,n,i,r,a,o,s,l,u,c,h,d,f,p,g){var m=new v(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=i,m[4]=r,m[5]=a,m[6]=o,m[7]=s,m[8]=l,m[9]=u,m[10]=c,m[11]=h,m[12]=d,m[13]=f,m[14]=p,m[15]=g,m}function W(t,e,n,i,r,a,o,s,l,u,c,h,d,f,p,g,m){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t[9]=c,t[10]=h,t[11]=d,t[12]=f,t[13]=p,t[14]=g,t[15]=m,t}function X(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Y(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=a,t[11]=e[14],t[12]=r,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function q(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=n*s-i*o,x=n*l-r*o,b=n*u-a*o,_=i*l-r*s,E=i*u-a*s,w=r*u-a*l,T=c*g-h*p,S=c*m-d*p,M=c*v-f*p,C=h*m-d*g,A=h*v-f*g,O=d*v-f*m,N=y*O-x*A+b*C+_*M-E*S+w*T;return N?(N=1/N,t[0]=(s*O-l*A+u*C)*N,t[1]=(r*A-i*O-a*C)*N,t[2]=(g*w-m*E+v*_)*N,t[3]=(d*E-h*w-f*_)*N,t[4]=(l*M-o*O-u*S)*N,t[5]=(n*O-r*M+a*S)*N,t[6]=(m*b-p*w-v*x)*N,t[7]=(c*w-d*b+f*x)*N,t[8]=(o*A-s*M+u*T)*N,t[9]=(i*M-n*A-a*T)*N,t[10]=(p*E-g*b+v*y)*N,t[11]=(h*b-c*E-f*y)*N,t[12]=(s*S-o*C-l*T)*N,t[13]=(n*C-i*S+r*T)*N,t[14]=(g*x-p*_-m*y)*N,t[15]=(c*_-h*x+d*y)*N,t):null}function $(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(d*v-f*m)-h*(l*v-u*m)+g*(l*f-u*d),t[1]=-(i*(d*v-f*m)-h*(r*v-a*m)+g*(r*f-a*d)),t[2]=i*(l*v-u*m)-s*(r*v-a*m)+g*(r*u-a*l),t[3]=-(i*(l*f-u*d)-s*(r*f-a*d)+h*(r*u-a*l)),t[4]=-(o*(d*v-f*m)-c*(l*v-u*m)+p*(l*f-u*d)),t[5]=n*(d*v-f*m)-c*(r*v-a*m)+p*(r*f-a*d),t[6]=-(n*(l*v-u*m)-o*(r*v-a*m)+p*(r*u-a*l)),t[7]=n*(l*f-u*d)-o*(r*f-a*d)+c*(r*u-a*l),t[8]=o*(h*v-f*g)-c*(s*v-u*g)+p*(s*f-u*h),t[9]=-(n*(h*v-f*g)-c*(i*v-a*g)+p*(i*f-a*h)),t[10]=n*(s*v-u*g)-o*(i*v-a*g)+p*(i*u-a*s),t[11]=-(n*(s*f-u*h)-o*(i*f-a*h)+c*(i*u-a*s)),t[12]=-(o*(h*m-d*g)-c*(s*m-l*g)+p*(s*d-l*h)),t[13]=n*(h*m-d*g)-c*(i*m-r*g)+p*(i*d-r*h),t[14]=-(n*(s*m-l*g)-o*(i*m-r*g)+p*(i*l-r*s)),t[15]=n*(s*d-l*h)-o*(i*d-r*h)+c*(i*l-r*s),t}function K(t){var e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*o-n*a)*(h*m-d*g)-(e*s-i*a)*(c*m-d*p)+(e*l-r*a)*(c*g-h*p)+(n*s-i*o)*(u*m-d*f)-(n*l-r*o)*(u*g-h*f)+(i*l-r*s)*(u*p-c*f)}function Q(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=n[0],b=n[1],_=n[2],E=n[3];return t[0]=x*i+b*s+_*h+E*g,t[1]=x*r+b*l+_*d+E*m,t[2]=x*a+b*u+_*f+E*v,t[3]=x*o+b*c+_*p+E*y,x=n[4],b=n[5],_=n[6],E=n[7],t[4]=x*i+b*s+_*h+E*g,t[5]=x*r+b*l+_*d+E*m,t[6]=x*a+b*u+_*f+E*v,t[7]=x*o+b*c+_*p+E*y,x=n[8],b=n[9],_=n[10],E=n[11],t[8]=x*i+b*s+_*h+E*g,t[9]=x*r+b*l+_*d+E*m,t[10]=x*a+b*u+_*f+E*v,t[11]=x*o+b*c+_*p+E*y,x=n[12],b=n[13],_=n[14],E=n[15],t[12]=x*i+b*s+_*h+E*g,t[13]=x*r+b*l+_*d+E*m,t[14]=x*a+b*u+_*f+E*v,t[15]=x*o+b*c+_*p+E*y,t}function J(t,e,n){var i,r,a,o,s,l,u,c,h,d,f,p,g=n[0],m=n[1],v=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=d,t[10]=f,t[11]=p,t[12]=i*g+s*m+h*v+e[12],t[13]=r*g+l*m+d*v+e[13],t[14]=a*g+u*m+f*v+e[14],t[15]=o*g+c*m+p*v+e[15]),t}function tt(t,e,n){var i=n[0],r=n[1],a=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function et(t,e,n,i){var r,a,o,s,l,u,c,h,d,f,p,g,v,y,x,b,_,E,w,T,S,M,C,A,O=i[0],N=i[1],P=i[2],L=Math.hypot(O,N,P);return L<m?null:(O*=L=1/L,N*=L,P*=L,r=Math.sin(n),o=1-(a=Math.cos(n)),s=e[0],l=e[1],u=e[2],c=e[3],h=e[4],d=e[5],f=e[6],p=e[7],g=e[8],v=e[9],y=e[10],x=e[11],b=O*O*o+a,_=N*O*o+P*r,E=P*O*o-N*r,w=O*N*o-P*r,T=N*N*o+a,S=P*N*o+O*r,M=O*P*o+N*r,C=N*P*o-O*r,A=P*P*o+a,t[0]=s*b+h*_+g*E,t[1]=l*b+d*_+v*E,t[2]=u*b+f*_+y*E,t[3]=c*b+p*_+x*E,t[4]=s*w+h*T+g*S,t[5]=l*w+d*T+v*S,t[6]=u*w+f*T+y*S,t[7]=c*w+p*T+x*S,t[8]=s*M+h*C+g*A,t[9]=l*M+d*C+v*A,t[10]=u*M+f*C+y*A,t[11]=c*M+p*C+x*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function nt(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*r+u*i,t[5]=o*r+c*i,t[6]=s*r+h*i,t[7]=l*r+d*i,t[8]=u*r-a*i,t[9]=c*r-o*i,t[10]=h*r-s*i,t[11]=d*r-l*i,t}function it(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r-u*i,t[1]=o*r-c*i,t[2]=s*r-h*i,t[3]=l*r-d*i,t[8]=a*i+u*r,t[9]=o*i+c*r,t[10]=s*i+h*r,t[11]=l*i+d*r,t}function rt(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r+u*i,t[1]=o*r+c*i,t[2]=s*r+h*i,t[3]=l*r+d*i,t[4]=u*r-a*i,t[5]=c*r-o*i,t[6]=h*r-s*i,t[7]=d*r-l*i,t}function at(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function ot(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function st(t,e,n){var i,r,a,o=n[0],s=n[1],l=n[2],u=Math.hypot(o,s,l);return u<m?null:(o*=u=1/u,s*=u,l*=u,i=Math.sin(e),a=1-(r=Math.cos(e)),t[0]=o*o*a+r,t[1]=s*o*a+l*i,t[2]=l*o*a-s*i,t[3]=0,t[4]=o*s*a-l*i,t[5]=s*s*a+r,t[6]=l*s*a+o*i,t[7]=0,t[8]=o*l*a+s*i,t[9]=s*l*a-o*i,t[10]=l*l*a+r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function lt(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ut(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ct(t,e){var n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=i,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ht(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=i+i,l=r+r,u=a+a,c=i*s,h=i*l,d=i*u,f=r*l,p=r*u,g=a*u,m=o*s,v=o*l,y=o*u;return t[0]=1-(f+g),t[1]=h+y,t[2]=d-v,t[3]=0,t[4]=h-y,t[5]=1-(c+g),t[6]=p+m,t[7]=0,t[8]=d+v,t[9]=p-m,t[10]=1-(c+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function dt(t,e){var n=new v(3),i=-e[0],r=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=i*i+r*r+a*a+o*o;return h>0?(n[0]=2*(s*o+c*i+l*a-u*r)/h,n[1]=2*(l*o+c*r+u*i-s*a)/h,n[2]=2*(u*o+c*a+s*r-l*i)/h):(n[0]=2*(s*o+c*i+l*a-u*r),n[1]=2*(l*o+c*r+u*i-s*a),n[2]=2*(u*o+c*a+s*r-l*i)),ht(t,e,n),t}function ft(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function pt(t,e){var n=e[0],i=e[1],r=e[2],a=e[4],o=e[5],s=e[6],l=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(n,i,r),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(l,u,c),t}function gt(t,e){var n=new v(3);pt(n,e);var i=1/n[0],r=1/n[1],a=1/n[2],o=e[0]*i,s=e[1]*r,l=e[2]*a,u=e[4]*i,c=e[5]*r,h=e[6]*a,d=e[8]*i,f=e[9]*r,p=e[10]*a,g=o+c+p,m=0;return g>0?(m=2*Math.sqrt(g+1),t[3]=.25*m,t[0]=(h-f)/m,t[1]=(d-l)/m,t[2]=(s-u)/m):o>c&&o>p?(m=2*Math.sqrt(1+o-c-p),t[3]=(h-f)/m,t[0]=.25*m,t[1]=(s+u)/m,t[2]=(d+l)/m):c>p?(m=2*Math.sqrt(1+c-o-p),t[3]=(d-l)/m,t[0]=(s+u)/m,t[1]=.25*m,t[2]=(h+f)/m):(m=2*Math.sqrt(1+p-o-c),t[3]=(s-u)/m,t[0]=(d+l)/m,t[1]=(h+f)/m,t[2]=.25*m),t}function mt(t,e,n,i){var r=e[0],a=e[1],o=e[2],s=e[3],l=r+r,u=a+a,c=o+o,h=r*l,d=r*u,f=r*c,p=a*u,g=a*c,m=o*c,v=s*l,y=s*u,x=s*c,b=i[0],_=i[1],E=i[2];return t[0]=(1-(p+m))*b,t[1]=(d+x)*b,t[2]=(f-y)*b,t[3]=0,t[4]=(d-x)*_,t[5]=(1-(h+m))*_,t[6]=(g+v)*_,t[7]=0,t[8]=(f+y)*E,t[9]=(g-v)*E,t[10]=(1-(h+p))*E,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function vt(t,e,n,i,r){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,c=o+o,h=s+s,d=a*u,f=a*c,p=a*h,g=o*c,m=o*h,v=s*h,y=l*u,x=l*c,b=l*h,_=i[0],E=i[1],w=i[2],T=r[0],S=r[1],M=r[2],C=(1-(g+v))*_,A=(f+b)*_,O=(p-x)*_,N=(f-b)*E,P=(1-(d+v))*E,L=(m+y)*E,R=(p+x)*w,D=(m-y)*w,k=(1-(d+g))*w;return t[0]=C,t[1]=A,t[2]=O,t[3]=0,t[4]=N,t[5]=P,t[6]=L,t[7]=0,t[8]=R,t[9]=D,t[10]=k,t[11]=0,t[12]=n[0]+T-(C*T+N*S+R*M),t[13]=n[1]+S-(A*T+P*S+D*M),t[14]=n[2]+M-(O*T+L*S+k*M),t[15]=1,t}function yt(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n+n,s=i+i,l=r+r,u=n*o,c=i*o,h=i*s,d=r*o,f=r*s,p=r*l,g=a*o,m=a*s,v=a*l;return t[0]=1-h-p,t[1]=c+v,t[2]=d-m,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=f+g,t[7]=0,t[8]=d+m,t[9]=f-g,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function xt(t,e,n,i,r,a,o){var s=1/(n-e),l=1/(r-i),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(r+i)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t}function bt(t,e,n,i,r){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(a=1/(i-r),t[10]=(r+i)*a,t[14]=2*r*i*a):(t[10]=-1,t[14]=-2*i),t}var _t=bt;function Et(t,e,n,i,r){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(a=1/(i-r),t[10]=r*a,t[14]=r*i*a):(t[10]=-1,t[14]=-i),t}function wt(t,e,n,i){var r=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(r+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(r-a)*u*.5,t[10]=i/(n-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*n/(n-i),t[15]=0,t}function Tt(t,e,n,i,r,a,o){var s=1/(e-n),l=1/(i-r),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*l,t[14]=(o+a)*u,t[15]=1,t}var St=Tt;function Mt(t,e,n,i,r,a,o){var s=1/(e-n),l=1/(i-r),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=u,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*l,t[14]=a*u,t[15]=1,t}function Ct(t,e,n,i){var r,a,o,s,l,u,c,h,d,f,p=e[0],g=e[1],v=e[2],y=i[0],x=i[1],b=i[2],_=n[0],E=n[1],w=n[2];return Math.abs(p-_)<m&&Math.abs(g-E)<m&&Math.abs(v-w)<m?X(t):(c=p-_,h=g-E,d=v-w,r=x*(d*=f=1/Math.hypot(c,h,d))-b*(h*=f),a=b*(c*=f)-y*d,o=y*h-x*c,(f=Math.hypot(r,a,o))?(r*=f=1/f,a*=f,o*=f):(r=0,a=0,o=0),s=h*o-d*a,l=d*r-c*o,u=c*a-h*r,(f=Math.hypot(s,l,u))?(s*=f=1/f,l*=f,u*=f):(s=0,l=0,u=0),t[0]=r,t[1]=s,t[2]=c,t[3]=0,t[4]=a,t[5]=l,t[6]=h,t[7]=0,t[8]=o,t[9]=u,t[10]=d,t[11]=0,t[12]=-(r*p+a*g+o*v),t[13]=-(s*p+l*g+u*v),t[14]=-(c*p+h*g+d*v),t[15]=1,t)}function At(t,e,n,i){var r=e[0],a=e[1],o=e[2],s=i[0],l=i[1],u=i[2],c=r-n[0],h=a-n[1],d=o-n[2],f=c*c+h*h+d*d;f>0&&(c*=f=1/Math.sqrt(f),h*=f,d*=f);var p=l*d-u*h,g=u*c-s*d,m=s*h-l*c;return(f=p*p+g*g+m*m)>0&&(p*=f=1/Math.sqrt(f),g*=f,m*=f),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=h*m-d*g,t[5]=d*p-c*m,t[6]=c*g-h*p,t[7]=0,t[8]=c,t[9]=h,t[10]=d,t[11]=0,t[12]=r,t[13]=a,t[14]=o,t[15]=1,t}function Ot(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Nt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Pt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function Lt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Rt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function Dt(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t[9]=e[9]+n[9]*i,t[10]=e[10]+n[10]*i,t[11]=e[11]+n[11]*i,t[12]=e[12]+n[12]*i,t[13]=e[13]+n[13]*i,t[14]=e[14]+n[14]*i,t[15]=e[15]+n[15]*i,t}function kt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function It(t,e){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],f=t[11],p=t[12],g=t[13],v=t[14],y=t[15],x=e[0],b=e[1],_=e[2],E=e[3],w=e[4],T=e[5],S=e[6],M=e[7],C=e[8],A=e[9],O=e[10],N=e[11],P=e[12],L=e[13],R=e[14],D=e[15];return Math.abs(n-x)<=m*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-b)<=m*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(r-_)<=m*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(a-E)<=m*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(o-w)<=m*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-T)<=m*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(l-S)<=m*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(u-M)<=m*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(c-C)<=m*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(h-A)<=m*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-O)<=m*Math.max(1,Math.abs(d),Math.abs(O))&&Math.abs(f-N)<=m*Math.max(1,Math.abs(f),Math.abs(N))&&Math.abs(p-P)<=m*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-L)<=m*Math.max(1,Math.abs(g),Math.abs(L))&&Math.abs(v-R)<=m*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-D)<=m*Math.max(1,Math.abs(y),Math.abs(D))}var Bt=Q,Ft=Lt;function zt(){var t=new v(9);return v!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Gt(){var t=new v(4);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function jt(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function Ut(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=n[0],l=n[1],u=n[2],c=n[3];return t[0]=i*c+o*s+r*u-a*l,t[1]=r*c+o*l+a*s-i*u,t[2]=a*c+o*u+i*l-r*s,t[3]=o*c-i*s-r*l-a*u,t}function Ht(t,e,n,i){var r,a,o,s,l,u=e[0],c=e[1],h=e[2],d=e[3],f=n[0],p=n[1],g=n[2],v=n[3];return(a=u*f+c*p+h*g+d*v)<0&&(a=-a,f=-f,p=-p,g=-g,v=-v),1-a>m?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,l=Math.sin(i*r)/o):(s=1-i,l=i),t[0]=s*u+l*f,t[1]=s*c+l*p,t[2]=s*h+l*g,t[3]=s*d+l*v,t}function Vt(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*n+i*i+r*r+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-i*s,t[2]=-r*s,t[3]=a*s,t}function Zt(t,e,n,i){var r=.5*Math.PI/180;e*=r,n*=r,i*=r;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(n),l=Math.cos(n),u=Math.sin(i),c=Math.cos(i);return t[0]=a*l*c-o*s*u,t[1]=o*s*c+a*l*u,t[2]=o*l*u-a*s*c,t[3]=o*l*c+a*s*u,t}var Wt,Xt,Yt,qt,$t,Kt,Qt=G,Jt=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},te=function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},ee=Ut,ne=function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*n+i*i+r*r+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=i*o,t[2]=r*o,t[3]=a*o,t};Wt=y(),Xt=_(1,0,0),Yt=_(0,1,0),qt=Gt(),$t=Gt(),Kt=zt();function ie(){var t=new v(2);return v!=Float32Array&&(t[0]=0,t[1]=0),t}function re(t,e){return t[0]=e[0],t[1]=e[1],t}function ae(t,e,n){return t[0]=e,t[1]=n,t}!function(){var t=ie()}();var oe=n(25719);function se(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var le=n(23481),ue=n(18756),ce=function(t,e,n){return t<e?e:t>n?n:t},he=n(80813),de={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function fe(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return de[e]===t.length-1&&"achlmqstvz".includes(e)}))}function pe(t){return fe(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function ge(t){return pe(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}var me={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function ve(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),i=t.data;i.length>=de[n]&&("m"===n&&i.length>2?(t.segments.push([e].concat(i.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(i.splice(0,de[n]))),de[n]););}function ye(t){var e=t.index,n=t.pathValue,i=n.charCodeAt(e);return 48===i?(t.param=0,void(t.index+=1)):49===i?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function xe(t){return t>=48&&t<=57||43===t||45===t||46===t}function be(t){return t>=48&&t<=57}function _e(t){var e,n=t.max,i=t.pathValue,r=t.index,a=r,o=!1,s=!1,l=!1,u=!1;if(a>=n)t.err="[path-util]: Invalid path value at index ".concat(a,', "pathValue" is missing param');else if(43!==(e=i.charCodeAt(a))&&45!==e||(a+=1,e=i.charCodeAt(a)),be(e)||46===e){if(46!==e){if(o=48===e,a+=1,e=i.charCodeAt(a),o&&a<n&&e&&be(e))return void(t.err="[path-util]: Invalid path value at index ".concat(r,', "').concat(i[r],'" illegal number'));for(;a<n&&be(i.charCodeAt(a));)a+=1,s=!0;e=i.charCodeAt(a)}if(46===e){for(u=!0,a+=1;be(i.charCodeAt(a));)a+=1,l=!0;e=i.charCodeAt(a)}if(101===e||69===e){if(u&&!s&&!l)return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(i[a],'" invalid float exponent'));if(a+=1,43!==(e=i.charCodeAt(a))&&45!==e||(a+=1),!(a<n&&be(i.charCodeAt(a))))return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(i[a],'" invalid integer exponent'));for(;a<n&&be(i.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(r,a)}else t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(i[a],'" is not a number')}function Ee(t){for(var e,n=t.pathValue,i=t.max;t.index<i&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function we(t){var e=t.max,n=t.pathValue,i=t.index,r=n.charCodeAt(i),a=de[n[i].toLowerCase()];if(t.segmentStart=i,function(t){switch(32|t){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}}(r))if(t.index+=1,Ee(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(97!=(32|r)||3!==o&&4!==o?_e(t):ye(t),t.err.length)return;t.data.push(t.param),Ee(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,Ee(t))}if(t.index>=t.max)break;if(!xe(n.charCodeAt(t.index)))break}ve(t)}else ve(t);else t.err='[path-util]: Invalid path value "'.concat(n[i],'" is not a path command')}var Te=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Se(t){if(pe(t))return[].concat(t);var e=function(t){if(fe(t))return[].concat(t);var e=new Te(t);for(Ee(e);e.index<e.max&&!e.err.length;)we(e);return e.err?e.err:e.segments}(t),n=0,i=0,r=0,a=0;return e.map((function(t){var e,o=t.slice(1).map(Number),s=t[0],l=s.toUpperCase();if("M"===s)return n=o[0],i=o[1],r=n,a=i,["M",n,i];if(s!==l)switch(l){case"A":e=[l,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+i];break;case"V":e=[l,o[0]+i];break;case"H":e=[l,o[0]+n];break;default:var u=o.map((function(t,e){return t+(e%2?i:n)}));e=[l].concat(u)}else e=[l].concat(o);var c=e.length;switch(l){case"Z":n=r,i=a;break;case"H":n=e[1];break;case"V":i=e[1];break;default:n=e[c-2],i=e[c-1],"M"===l&&(r=n,a=i)}return e}))}function Me(t,e){var n=t[0],i=e.x1,r=e.y1,a=e.x2,o=e.y2,s=t.slice(1).map(Number),l=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)l=["L",t[1],r];else if("V"===n)l=["L",i,t[1]];else if("S"===n){var u=2*i-a,c=2*r-o;e.x1=u,e.y1=c,l=["C",u,c].concat(s)}else if("T"===n){var h=2*i-e.qx,d=2*r-e.qy;e.qx=h,e.qy=d,l=["Q",h,d].concat(s)}else if("Q"===n){var f=s[0],p=s[1];e.qx=f,e.qy=p}return l}function Ce(t){if(ge(t))return[].concat(t);for(var e=Se(t),n=(0,he.pi)({},me),i=0;i<e.length;i+=1){e[i]=Me(e[i],n);var r=e[i],a=r.length;n.x1=+r[a-2],n.y1=+r[a-1],n.x2=+r[a-4]||n.x1,n.y2=+r[a-3]||n.y1}return e}function Ae(t,e,n){var i=t[0],r=t[1];return[i+(e[0]-i)*n,r+(e[1]-r)*n]}function Oe(t,e,n,i,r){var a=se([t,e],[n,i]),o={x:0,y:0};if("number"==typeof r)if(r<=0)o={x:t,y:e};else if(r>=a)o={x:n,y:i};else{var s=Ae([t,e],[n,i],r/a);o={x:s[0],y:s[1]}}return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,i)},max:{x:Math.max(t,n),y:Math.max(e,i)}}}function Ne(t,e){var n=t.x,i=t.y,r=e.x,a=e.y,o=n*r+i*a,s=Math.sqrt((Math.pow(n,2)+Math.pow(i,2))*(Math.pow(r,2)+Math.pow(a,2)));return(n*a-i*r<0?-1:1)*Math.acos(o/s)}function Pe(t,e,n,i,r,a,o,s,l,u){var c=Math.abs,h=Math.sin,d=Math.cos,f=Math.sqrt,p=Math.PI,g=c(n),m=c(i),v=(r%360+360)%360*(p/180);if(t===s&&e===l)return{x:t,y:e};if(0===g||0===m)return Oe(t,e,s,l,u).point;var y=(t-s)/2,x=(e-l)/2,b={x:d(v)*y+h(v)*x,y:-h(v)*y+d(v)*x},_=Math.pow(b.x,2)/Math.pow(g,2)+Math.pow(b.y,2)/Math.pow(m,2);_>1&&(g*=f(_),m*=f(_));var E=(Math.pow(g,2)*Math.pow(m,2)-Math.pow(g,2)*Math.pow(b.y,2)-Math.pow(m,2)*Math.pow(b.x,2))/(Math.pow(g,2)*Math.pow(b.y,2)+Math.pow(m,2)*Math.pow(b.x,2)),w=(a!==o?1:-1)*f(E=E<0?0:E),T=w*(g*b.y/m),S=w*(-m*b.x/g),M=d(v)*T-h(v)*S+(t+s)/2,C=h(v)*T+d(v)*S+(e+l)/2,A={x:(b.x-T)/g,y:(b.y-S)/m},O=Ne({x:1,y:0},A),N=Ne(A,{x:(-b.x-T)/g,y:(-b.y-S)/m});!o&&N>0?N-=2*p:o&&N<0&&(N+=2*p);var P=O+(N%=2*p)*u,L=g*d(P),R=m*h(P);return{x:d(v)*L-h(v)*R+M,y:h(v)*L+d(v)*R+C}}function Le(t,e,n,i,r,a,o,s,l,u,c){var h,d=c.bbox,f=void 0===d||d,p=c.length,g=void 0===p||p,m=c.sampleSize,v=void 0===m?30:m,y="number"==typeof u,x=t,b=e,_=0,E=[x,b,_],w=[x,b],T={x:0,y:0},S=[{x:x,y:b}];y&&u<=0&&(T={x:x,y:b});for(var M=0;M<=v;M+=1){if(x=(h=Pe(t,e,n,i,r,a,o,s,l,M/v)).x,b=h.y,f&&S.push({x:x,y:b}),g&&(_+=se(w,[x,b])),w=[x,b],y&&_>=u&&u>E[2]){var C=(_-u)/(_-E[2]);T={x:w[0]*(1-C)+E[0]*C,y:w[1]*(1-C)+E[1]*C}}E=[x,b,_]}return y&&u>=_&&(T={x:s,y:l}),{length:_,point:T,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function Re(t,e,n,i,r,a,o,s,l){var u=1-l;return{x:Math.pow(u,3)*t+3*Math.pow(u,2)*l*n+3*u*Math.pow(l,2)*r+Math.pow(l,3)*o,y:Math.pow(u,3)*e+3*Math.pow(u,2)*l*i+3*u*Math.pow(l,2)*a+Math.pow(l,3)*s}}function De(t,e,n,i,r,a,o,s,l,u){var c,h=u.bbox,d=void 0===h||h,f=u.length,p=void 0===f||f,g=u.sampleSize,m=void 0===g?10:g,v="number"==typeof l,y=t,x=e,b=0,_=[y,x,b],E=[y,x],w={x:0,y:0},T=[{x:y,y:x}];v&&l<=0&&(w={x:y,y:x});for(var S=0;S<=m;S+=1){if(y=(c=Re(t,e,n,i,r,a,o,s,S/m)).x,x=c.y,d&&T.push({x:y,y:x}),p&&(b+=se(E,[y,x])),E=[y,x],v&&b>=l&&l>_[2]){var M=(b-l)/(b-_[2]);w={x:E[0]*(1-M)+_[0]*M,y:E[1]*(1-M)+_[1]*M}}_=[y,x,b]}return v&&l>=b&&(w={x:o,y:s}),{length:b,point:w,min:{x:Math.min.apply(null,T.map((function(t){return t.x}))),y:Math.min.apply(null,T.map((function(t){return t.y})))},max:{x:Math.max.apply(null,T.map((function(t){return t.x}))),y:Math.max.apply(null,T.map((function(t){return t.y})))}}}function ke(t,e,n,i,r,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*r,y:Math.pow(s,2)*e+2*s*o*i+Math.pow(o,2)*a}}function Ie(t,e,n,i,r,a,o,s){var l,u=s.bbox,c=void 0===u||u,h=s.length,d=void 0===h||h,f=s.sampleSize,p=void 0===f?10:f,g="number"==typeof o,m=t,v=e,y=0,x=[m,v,y],b=[m,v],_={x:0,y:0},E=[{x:m,y:v}];g&&o<=0&&(_={x:m,y:v});for(var w=0;w<=p;w+=1){if(m=(l=ke(t,e,n,i,r,a,w/p)).x,v=l.y,c&&E.push({x:m,y:v}),d&&(y+=se(b,[m,v])),b=[m,v],g&&y>=o&&o>x[2]){var T=(y-o)/(y-x[2]);_={x:b[0]*(1-T)+x[0]*T,y:b[1]*(1-T)+x[1]*T}}x=[m,v,y]}return g&&o>=y&&(_={x:r,y:a}),{length:y,point:_,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function Be(t,e,n){for(var i,r,a,o,s,l,u,c,h,d=Ce(t),f="number"==typeof e,p=[],g=0,m=0,v=0,y=0,x=[],b=[],_=0,E={x:0,y:0},w=E,T=E,S=E,M=0,C=0,A=d.length;C<A;C+=1)p=(u="M"===(c=(h=d[C])[0]))?p:[g,m].concat(h.slice(1)),u?(w=E={x:v=h[1],y:y=h[2]},_=0,f&&e<.001&&(S=E)):"L"===c?(_=(i=Oe(p[0],p[1],p[2],p[3],(e||0)-M)).length,E=i.min,w=i.max,T=i.point):"A"===c?(_=(r=Le(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-M,n||{})).length,E=r.min,w=r.max,T=r.point):"C"===c?(_=(a=De(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-M,n||{})).length,E=a.min,w=a.max,T=a.point):"Q"===c?(_=(o=Ie(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-M,n||{})).length,E=o.min,w=o.max,T=o.point):"Z"===c&&(_=(s=Oe((p=[g,m,v,y])[0],p[1],p[2],p[3],(e||0)-M)).length,E=s.min,w=s.max,T=s.point),f&&M<e&&M+_>=e&&(S=T),b.push(w),x.push(E),M+=_,g=(l="Z"!==c?h.slice(-2):[v,y])[0],m=l[1];return f&&e>=M&&(S={x:g,y:m}),{length:M,point:S,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,b.map((function(t){return t.x}))),y:Math.max.apply(null,b.map((function(t){return t.y})))}}}var Fe=n(1623),ze=function(t){if((0,Fe.Z)(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])};function Ge(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],i=1;i<e;i++)n=Math.max(n,t[i]);return n}function je(t,e,n){return void 0===n&&(n=1e-5),t===e||Math.abs(t-e)<n}var Ue=function(t,e){return(t%e+e)%e};function He(t,e,n){if(t[n].length>7){t[n].shift();for(var i=t[n],r=n;i.length;)e[n]="A",t.splice(r+=1,0,["C"].concat(i.splice(0,6)));t.splice(n,1)}}function Ve(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Ze(t,e,n,i,r,a,o,s,l,u){var c,h,d,f,p,g=t,m=e,v=n,y=i,x=s,b=l,_=120*Math.PI/180,E=Math.PI/180*(+r||0),w=[];if(u)h=u[0],d=u[1],f=u[2],p=u[3];else{g=(c=Ve(g,m,-E)).x,m=c.y;var T=(g-(x=(c=Ve(x,b,-E)).x))/2,S=(m-(b=c.y))/2,M=T*T/(v*v)+S*S/(y*y);M>1&&(v*=M=Math.sqrt(M),y*=M);var C=v*v,A=y*y,O=(a===o?-1:1)*Math.sqrt(Math.abs((C*A-C*S*S-A*T*T)/(C*S*S+A*T*T)));f=O*v*S/y+(g+x)/2,p=O*-y*T/v+(m+b)/2,h=Math.asin(((m-p)/y*Math.pow(10,9)>>0)/Math.pow(10,9)),d=Math.asin(((b-p)/y*Math.pow(10,9)>>0)/Math.pow(10,9)),h=g<f?Math.PI-h:h,d=x<f?Math.PI-d:d,h<0&&(h=2*Math.PI+h),d<0&&(d=2*Math.PI+d),o&&h>d&&(h-=2*Math.PI),!o&&d>h&&(d-=2*Math.PI)}var N=d-h;if(Math.abs(N)>_){var P=d,L=x,R=b;d=h+_*(o&&d>h?1:-1),w=Ze(x=f+v*Math.cos(d),b=p+y*Math.sin(d),v,y,r,0,o,L,R,[d,P,f,p])}N=d-h;var D=Math.cos(h),k=Math.sin(h),I=Math.cos(d),B=Math.sin(d),F=Math.tan(N/4),z=4/3*v*F,G=4/3*y*F,j=[g,m],U=[g+z*k,m-G*D],H=[x+z*B,b-G*I],V=[x,b];if(U[0]=2*j[0]-U[0],U[1]=2*j[1]-U[1],u)return U.concat(H,V,w);for(var Z=[],W=0,X=(w=U.concat(H,V,w)).length;W<X;W+=1)Z[W]=W%2?Ve(w[W-1],w[W],E).y:Ve(w[W],w[W+1],E).x;return Z}var We=function(t,e,n,i){var r=Ae([t,e],[n,i],.5);return(0,he.ev)((0,he.ev)([],r,!0),[n,i,n,i],!1)};function Xe(t,e){var n,i,r,a,o,s,l,u,c,h=t[0],d=t.slice(1).map(Number),f=d[0],p=d[1],g=e.x1,m=e.y1,v=e.x,y=e.y;switch("TQ".includes(h)||(e.qx=null,e.qy=null),h){case"M":return e.x=f,e.y=p,t;case"A":return n=[g,m].concat(d),["C"].concat(Ze(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=f,e.qy=p,n=[g,m].concat(d),["C"].concat((i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],[(u=1/3)*i+(c=2/3)*a,u*r+c*o,u*s+c*a,u*l+c*o,s,l]));case"L":return["C"].concat(We(g,m,f,p));case"Z":return g===v&&m===y?["C",g,m,v,y,v,y]:["C"].concat(We(g,m,v,y))}return t}function Ye(t,e){if(void 0===e&&(e=!1),function(t){return ge(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var i,r,a=Ce(t),o=(0,he.pi)({},me),s=[],l="",u=a.length,c=[],h=0;h<u;h+=1){a[h]&&(l=a[h][0]),s[h]=l;var d=Xe(a[h],o);a[h]=d,He(a,s,h),u=a.length,"Z"===l&&c.push(h),r=(i=a[h]).length,o.x1=+i[r-2],o.y1=+i[r-1],o.x2=+i[r-4]||o.x1,o.y2=+i[r-3]||o.y1}return e?[a,c]:a}function qe(t){return t.map((function(t,e,n){var i=e&&n[e-1].slice(-2).concat(t.slice(1)),r=e?De(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0;return{s:t,ss:e?r?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),i=t.slice(2,4),r=t.slice(4,6),a=t.slice(6,8),o=Ae(n,i,e),s=Ae(i,r,e),l=Ae(r,a,e),u=Ae(o,s,e),c=Ae(s,l,e),h=Ae(u,c,e);return[["C"].concat(o,u,h),["C"].concat(c,l,a)]}(i):[t,t]:[t],l:r}}))}function $e(t,e,n){var i=qe(t),r=qe(e),a=i.length,o=r.length,s=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/l||0,h=n||Math.max(a,o),d=[u,c],f=[h-a,h-o],p=0,g=[i,r].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&f[e]&&t.l>=d[e],f[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:$e(g[0],g[1],h)}function Ke(t){return function(t){var e=0,n=0,i=0;return Ye(t).map((function(t){var r;if("M"===t[0])return e=t[1],n=t[2],0;var a=t.slice(1),o=a[0],s=a[1],l=a[2],u=a[3],c=a[4],h=a[5];return i=function(t,e,n,i,r,a,o,s){return 3*((s-e)*(n+r)-(o-t)*(i+a)+i*(t-r)-n*(e-a)+s*(r+t/3)-o*(a+e/3))/20}(e,n,o,s,l,u,c,h),r=t.slice(-2),e=r[0],n=r[1],i})).reduce((function(t,e){return t+e}),0)}(t)>=0}var Qe=function(t){return void 0===t},Je=n(25737),tn=function(t){return(0,Je.Z)(t,"Boolean")},en=n(77817),nn=n(85266);function rn(t,e,n){return Be(t,e,(0,he.pi)((0,he.pi)({},n),{bbox:!1,length:!0})).point}var an=n(80962);function on(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=(0,u.Z)(t)););return t}function sn(){return sn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=on(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},sn.apply(null,arguments)}function ln(t,e,n,i){var r=sn((0,u.Z)(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof r?function(t){return r.apply(n,t)}:r}function un(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function cn(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function hn(){}var dn=.7,fn=1/dn,pn="\\s*([+-]?\\d+)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vn=/^#([0-9a-f]{3,8})$/,yn=new RegExp("^rgb\\(".concat(pn,",").concat(pn,",").concat(pn,"\\)$")),xn=new RegExp("^rgb\\(".concat(mn,",").concat(mn,",").concat(mn,"\\)$")),bn=new RegExp("^rgba\\(".concat(pn,",").concat(pn,",").concat(pn,",").concat(gn,"\\)$")),_n=new RegExp("^rgba\\(".concat(mn,",").concat(mn,",").concat(mn,",").concat(gn,"\\)$")),En=new RegExp("^hsl\\(".concat(gn,",").concat(mn,",").concat(mn,"\\)$")),wn=new RegExp("^hsla\\(".concat(gn,",").concat(mn,",").concat(mn,",").concat(gn,"\\)$")),Tn={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};function Sn(){return this.rgb().formatHex()}function Mn(){return this.rgb().formatRgb()}function Cn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=vn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?An(e):3===n?new Pn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?On(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?On(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=yn.exec(t))?new Pn(e[1],e[2],e[3],1):(e=xn.exec(t))?new Pn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=bn.exec(t))?On(e[1],e[2],e[3],e[4]):(e=_n.exec(t))?On(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=En.exec(t))?Bn(e[1],e[2]/100,e[3]/100,1):(e=wn.exec(t))?Bn(e[1],e[2]/100,e[3]/100,e[4]):Tn.hasOwnProperty(t)?An(Tn[t]):"transparent"===t?new Pn(NaN,NaN,NaN,0):null}function An(t){return new Pn(t>>16&255,t>>8&255,255&t,1)}function On(t,e,n,i){return i<=0&&(t=e=n=NaN),new Pn(t,e,n,i)}function Nn(t){return t instanceof hn||(t=Cn(t)),t?new Pn((t=t.rgb()).r,t.g,t.b,t.opacity):new Pn}function Pn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Ln(){return"#".concat(In(this.r)).concat(In(this.g)).concat(In(this.b))}function Rn(){var t=Dn(this.opacity);return"".concat(1===t?"rgb(":"rgba(").concat(kn(this.r),", ").concat(kn(this.g),", ").concat(kn(this.b)).concat(1===t?")":", ".concat(t,")"))}function Dn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function kn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function In(t){return((t=kn(t))<16?"0":"")+t.toString(16)}function Bn(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new zn(t,e,n,i)}function Fn(t){if(t instanceof zn)return new zn(t.h,t.s,t.l,t.opacity);if(t instanceof hn||(t=Cn(t)),!t)return new zn;if(t instanceof zn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),o=NaN,s=a-r,l=(a+r)/2;return s?(o=e===a?(n-i)/s+6*(n<i):n===a?(i-e)/s+2:(e-n)/s+4,s/=l<.5?a+r:2-a-r,o*=60):s=l>0&&l<1?0:o,new zn(o,s,l,t.opacity)}function zn(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Gn(t){return(t=(t||0)%360)<0?t+360:t}function jn(t){return Math.max(0,Math.min(1,t||0))}function Un(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Hn(t,e,n,i){var r=t-n,a=e-i;return Math.sqrt(r*r+a*a)}function Vn(t,e){var n=Math.min.apply(Math,(0,he.ev)([],(0,he.CR)(t),!1)),i=Math.min.apply(Math,(0,he.ev)([],(0,he.CR)(e),!1));return{x:n,y:i,width:Math.max.apply(Math,(0,he.ev)([],(0,he.CR)(t),!1))-n,height:Math.max.apply(Math,(0,he.ev)([],(0,he.CR)(e),!1))-i}}function Zn(t,e,n,i,r,a){return n*Math.cos(r)*Math.cos(a)-i*Math.sin(r)*Math.sin(a)+t}function Wn(t,e,n,i,r,a){return n*Math.sin(r)*Math.cos(a)+i*Math.cos(r)*Math.sin(a)+e}function Xn(t,e,n,i,r,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,i,r),l=1/0,u=-1/0,c=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var d=s+h;a<o?a<d&&d<o&&c.push(d):o<d&&d<a&&c.push(d)}for(h=0;h<c.length;h++){var f=Zn(t,0,n,i,r,c[h]);f<l&&(l=f),f>u&&(u=f)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,i,r),g=1/0,m=-1/0,v=[a,o];for(h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var y=p+h;a<o?a<y&&y<o&&v.push(y):o<y&&y<a&&v.push(y)}for(h=0;h<v.length;h++){var x=Wn(0,e,n,i,r,v[h]);x<g&&(g=x),x>m&&(m=x)}return{x:l,y:g,width:u-l,height:m-g}}un(hn,Cn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Sn,formatHex:Sn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Fn(this).formatHsl()},formatRgb:Mn,toString:Mn}),un(Pn,(function(t,e,n,i){return 1===arguments.length?Nn(t):new Pn(t,e,n,null==i?1:i)}),cn(hn,{brighter:function(t){return t=null==t?fn:Math.pow(fn,t),new Pn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?dn:Math.pow(dn,t),new Pn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},clamp:function(){return new Pn(kn(this.r),kn(this.g),kn(this.b),Dn(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ln,formatHex:Ln,formatHex8:function(){return"#".concat(In(this.r)).concat(In(this.g)).concat(In(this.b)).concat(In(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:Rn,toString:Rn})),un(zn,(function(t,e,n,i){return 1===arguments.length?Fn(t):new zn(t,e,n,null==i?1:i)}),cn(hn,{brighter:function(t){return t=null==t?fn:Math.pow(fn,t),new zn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?dn:Math.pow(dn,t),new zn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Pn(Un(t>=240?t-240:t+120,r,i),Un(t,r,i),Un(t<120?t+240:t-120,r,i),this.opacity)},clamp:function(){return new zn(Gn(this.h),jn(this.s),jn(this.l),Dn(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=Dn(this.opacity);return"".concat(1===t?"hsl(":"hsla(").concat(Gn(this.h),", ").concat(100*jn(this.s),"%, ").concat(100*jn(this.l),"%").concat(1===t?")":", ".concat(t,")"))}}));function Yn(t,e,n,i,r,a){var o=-1,s=1/0,l=[n,i],u=20;a&&a>200&&(u=a/10);for(var c=1/u,h=c/10,d=0;d<=u;d++){var f=d*c,p=[r.apply(void 0,(0,he.ev)([],(0,he.CR)(t.concat([f])),!1)),r.apply(void 0,(0,he.ev)([],(0,he.CR)(e.concat([f])),!1))];(y=Hn(l[0],l[1],p[0],p[1]))<s&&(o=f,s=y)}if(0===o)return{x:t[0],y:e[0]};if(1===o){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(d=0;d<32&&!(h<1e-4);d++){var m=o-h,v=o+h,y=(p=[r.apply(void 0,(0,he.ev)([],(0,he.CR)(t.concat([m])),!1)),r.apply(void 0,(0,he.ev)([],(0,he.CR)(e.concat([m])),!1))],Hn(l[0],l[1],p[0],p[1]));if(m>=0&&y<s)o=m,s=y;else{var x=[r.apply(void 0,(0,he.ev)([],(0,he.CR)(t.concat([v])),!1)),r.apply(void 0,(0,he.ev)([],(0,he.CR)(e.concat([v])),!1))],b=Hn(l[0],l[1],x[0],x[1]);v<=1&&b<s?(o=v,s=b):h*=.5}}return{x:r.apply(void 0,(0,he.ev)([],(0,he.CR)(t.concat([o])),!1)),y:r.apply(void 0,(0,he.ev)([],(0,he.CR)(e.concat([o])),!1))}}function qn(t,e,n,i){return Hn(t,e,n,i)}function $n(t,e,n,i,r){return{x:(1-r)*t+r*n,y:(1-r)*e+r*i}}function Kn(t,e,n,i,r,a){var o=[n-t,i-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(o,[0,0]))return Math.sqrt((r-t)*(r-t)+(a-e)*(a-e));var s=[-o[1],o[0]];!function(t,e){var n=e[0],i=e[1],r=n*n+i*i;r>0&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r}(s,s);var l=[r-t,a-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(l,s))}function Qn(t,e,n,i,r){var a=1-r;return a*a*a*t+3*e*r*a*a+3*n*r*r*a+i*r*r*r}function Jn(t,e,n,i){var r,a,o,s=-3*t+9*e-9*n+3*i,l=6*t-12*e+6*n,u=3*e-3*t,c=[];if(je(s,0))je(l,0)||(r=-u/l)>=0&&r<=1&&c.push(r);else{var h=l*l-4*s*u;je(h,0)?c.push(-l/(2*s)):h>0&&(a=(-l-(o=Math.sqrt(h)))/(2*s),(r=(-l+o)/(2*s))>=0&&r<=1&&c.push(r),a>=0&&a<=1&&c.push(a))}return c}function ti(t,e,n,i,r,a,o,s){for(var l=[t,o],u=[e,s],c=Jn(t,n,r,o),h=Jn(e,i,a,s),d=0;d<c.length;d++)l.push(Qn(t,n,r,o,c[d]));for(d=0;d<h.length;d++)u.push(Qn(e,i,a,s,h[d]));return Vn(l,u)}function ei(t,e,n,i,r,a,o,s,l,u,c){var h=function(t,e,n,i,r,a,o,s,l,u,c){return Yn([t,n,r,o],[e,i,a,s],l,u,Qn,c)}(t,e,n,i,r,a,o,s,l,u,c);return Hn(h.x,h.y,l,u)}function ni(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var i=t[n],r=t[n+1];e+=Hn(i[0],i[1],r[0],r[1])}return e}function ii(t,e,n,i){var r=1-i;return r*r*t+2*i*r*e+i*i*n}function ri(t,e,n){var i=t+n-2*e;if(je(i,0))return[.5];var r=(t-e)/i;return r<=1&&r>=0?[r]:[]}function ai(t,e,n,i,r,a){var o=ri(t,n,r)[0],s=ri(e,i,a)[0],l=[t,r],u=[e,a];return void 0!==o&&l.push(ii(t,n,r,o)),void 0!==s&&u.push(ii(e,i,a,s)),Vn(l,u)}function oi(t,e,n,i,r,a,o,s){var l=function(t,e,n,i,r,a,o,s){return Yn([t,n,r],[e,i,a],o,s,ii)}(t,e,n,i,r,a,o,s);return Hn(l.x,l.y,o,s)}var si=n(50204),li=n(20959),ui=n(36541);function ci(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=(0,ui.Z)(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}var hi=n(19149),di=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self&&self,{exports:{}});di.exports=function(){function t(t,n,r,a,o){e(t,n,r||0,a||t.length-1,o||i)}function e(t,i,r,a,o){for(;a>r;){if(a-r>600){var s=a-r+1,l=i-r+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);e(t,i,Math.max(r,Math.floor(i-l*c/s+h)),Math.min(a,Math.floor(i+(s-l)*c/s+h)),o)}var d=t[i],f=r,p=a;for(n(t,r,i),o(t[a],d)>0&&n(t,r,a);f<p;){for(n(t,f,p),f++,p--;o(t[f],d)<0;)f++;for(;o(t[p],d)>0;)p--}0===o(t[r],d)?n(t,r,p):n(t,++p,a),p<=i&&(r=p+1),i<=p&&(a=p-1)}}function n(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function i(t,e){return t<e?-1:t>e?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,i,r){r||(r=v(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var a=e;a<n;a++){var o=t.children[a];l(r,t.leaf?i(o):o)}return r}function l(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,a-i)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function m(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,i,r,a){for(var o=[n,i];o.length;)if(!((i=o.pop())-(n=o.pop())<=r)){var s=n+Math.ceil((i-n)/r/2)*r;t(e,s,n,i,a),o.push(n,s,s,i)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var i=this.toBBox,r=[];e;){for(var a=0;a<e.children.length;a++){var o=e.children[a],s=e.leaf?i(o):o;m(t,s)&&(e.leaf?n.push(o):g(t,s)?this._all(o,n):r.push(o))}e=r.pop()}return n},r.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var i=0;i<e.children.length;i++){var r=e.children[i],a=e.leaf?this.toBBox(r):r;if(m(t,a)){if(e.leaf||g(t,a))return!0;n.push(r)}}e=n.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var n,i,r,o=this.data,s=this.toBBox(t),l=[],u=[];o||l.length;){if(o||(o=l.pop(),i=l[l.length-1],n=u.pop(),r=!0),o.leaf){var c=a(t,o.children,e);if(-1!==c)return o.children.splice(c,1),l.push(o),this._condense(l),this}r||o.leaf||!g(o,s)?i?(n++,o=i.children[n],r=!1):o=null:(l.push(o),u.push(n),n=0,i=o,o=o.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},r.prototype._build=function(t,e,n,i){var r,a=n-e+1,s=this._maxEntries;if(a<=s)return o(r=v(t.slice(e,n+1)),this.toBBox),r;i||(i=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,i-1))),(r=v([])).leaf=!1,r.height=i;var l=Math.ceil(a/s),u=l*Math.ceil(Math.sqrt(s));y(t,e,n,u,this.compareMinX);for(var c=e;c<=n;c+=u){var h=Math.min(c+u-1,n);y(t,c,h,l,this.compareMinY);for(var d=c;d<=h;d+=l){var f=Math.min(d+l-1,h);r.children.push(this._build(t,d,f,i-1))}}return o(r,this.toBBox),r},r.prototype._chooseSubtree=function(t,e,n,i){for(;i.push(e),!e.leaf&&i.length-1!==n;){for(var r=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var l=e.children[s],u=h(l),c=f(t,l)-u;c<a?(a=c,r=u<r?u:r,o=l):c===a&&u<r&&(r=u,o=l)}e=o||e.children[0]}return e},r.prototype._insert=function(t,e,n){var i=n?t:this.toBBox(t),r=[],a=this._chooseSubtree(i,this.data,e,r);for(a.children.push(t),l(a,i);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(i,r,e)},r.prototype._split=function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var a=this._chooseSplitIndex(n,r,i),s=v(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var i,r=1/0,a=1/0,o=e;o<=n-e;o++){var l=s(t,0,o,this.toBBox),u=s(t,o,n,this.toBBox),c=p(l,u),d=h(l)+h(u);c<r?(r=c,i=o,a=d<a?d:a):c===r&&d<a&&(a=d,i=o)}return i||n-e},r.prototype._chooseSplitAxis=function(t,e,n){var i=t.leaf?this.compareMinX:u,r=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,r)&&t.children.sort(i)},r.prototype._allDistMargin=function(t,e,n,i){t.children.sort(i);for(var r=this.toBBox,a=s(t,0,e,r),o=s(t,n-e,n,r),u=d(a)+d(o),c=e;c<n-e;c++){var h=t.children[c];l(a,t.leaf?r(h):h),u+=d(a)}for(var f=n-e-1;f>=e;f--){var p=t.children[f];l(o,t.leaf?r(p):p),u+=d(o)}return u},r.prototype._adjustParentBBoxes=function(t,e,n){for(var i=n;i>=0;i--)l(e[i],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}();var fi=di.exports,pi=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),gi=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),mi=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.plugins=[]}),[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))}}])}(),vi=function(){return(0,s.Z)((function t(e){(0,o.Z)(this,t),this.clipSpaceNearZ=gi.NEGATIVE_ONE,this.plugins=[],this.config=(0,a.Z)({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}),[{key:"registerPlugin",value:function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),yi=T,xi=E,bi=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},_i=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Ei=C,wi=I,Ti=function(){function t(){(0,o.Z)(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return(0,s.Z)(t,[{key:"update",value:function(t,e){xi(this.center,t),xi(this.halfExtents,e),wi(this.min,this.center,this.halfExtents),yi(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){yi(this.center,e,t),Ei(this.center,this.center,.5),wi(this.halfExtents,e,t),Ei(this.halfExtents,this.halfExtents,.5),xi(this.min,t),xi(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,i=n[0],r=n[1],a=n[2],o=this.halfExtents,s=o[0],l=o[1],u=o[2],c=i-s,h=i+s,d=r-l,f=r+l,p=a-u,g=a+u,m=e.center,v=m[0],y=m[1],x=m[2],b=e.halfExtents,_=b[0],E=b[1],w=b[2],T=v-_,S=v+_,M=y-E,C=y+E,A=x-w,O=x+w;T<c&&(c=T),S>h&&(h=S),M<d&&(d=M),C>f&&(f=C),A<p&&(p=A),O>g&&(g=O),n[0]=.5*(c+h),n[1]=.5*(d+f),n[2]=.5*(p+g),o[0]=.5*(h-c),o[1]=.5*(f-d),o[2]=.5*(g-p),this.min[0]=c,this.min[1]=d,this.min[2]=p,this.max[0]=h,this.max[1]=f,this.max[2]=g}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,i=this.halfExtents,r=t.center,a=t.halfExtents,o=e[0],s=e[4],l=e[8],u=e[1],c=e[5],h=e[9],d=e[2],f=e[6],p=e[10],g=Math.abs(o),m=Math.abs(s),v=Math.abs(l),y=Math.abs(u),x=Math.abs(c),b=Math.abs(h),_=Math.abs(d),E=Math.abs(f),w=Math.abs(p);n[0]=e[12]+o*r[0]+s*r[1]+l*r[2],n[1]=e[13]+u*r[0]+c*r[1]+h*r[2],n[2]=e[14]+d*r[0]+f*r[1]+p*r[2],i[0]=g*a[0]+m*a[1]+v*a[2],i[1]=y*a[0]+x*a[1]+b*a[2],i[2]=_*a[0]+E*a[1]+w*a[2],wi(this.min,n,i),yi(this.max,n,i)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),i=t.getMax(),r=t.getMin();return n[0]<=i[0]&&e[0]>=r[0]&&n[1]<=i[1]&&e[1]>=r[1]&&n[2]<=i[2]&&e[2]>=r[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,i=bi([0,0,0],this.getMin(),e.getMin()),r=_i([0,0,0],this.getMax(),e.getMax());return n.setMinMax(i,r),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?xi([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?xi([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),Si=function(){return(0,s.Z)((function t(e,n){(0,o.Z)(this,t),this.distance=e||0,this.normal=n||_(0,1,0),this.updatePNVertexFlag()}),[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return O(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/F(this.normal);C(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var i=this.distanceToPoint(t),r=i/(i-this.distanceToPoint(e)),a=r>=0&&r<=1;return a&&n&&P(n,t,e,r),a}}])}(),Mi=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),Ci=function(){return(0,s.Z)((function t(e){if((0,o.Z)(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new Si)}),[{key:"extractFromVPMatrix",value:function(t){var e=(0,p.Z)(t,16),n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],g=e[12],m=e[13],v=e[14],y=e[15];w(this.planes[0].normal,a-n,u-o,f-c),this.planes[0].distance=y-g,w(this.planes[1].normal,a+n,u+o,f+c),this.planes[1].distance=y+g,w(this.planes[2].normal,a+i,u+s,f+h),this.planes[2].distance=y+m,w(this.planes[3].normal,a-i,u-s,f-h),this.planes[3].distance=y-m,w(this.planes[4].normal,a-r,u-l,f-d),this.planes[4].distance=y-v,w(this.planes[5].normal,a+r,u+l,f+d),this.planes[5].distance=y+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}])}(),Ai=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,o.Z)(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return(0,s.Z)(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),Oi=function(){function t(e,n,i,r){(0,o.Z)(this,t),this.x=e,this.y=n,this.width=i,this.height=r,this.left=e,this.right=e+i,this.top=n,this.bottom=n+r}return(0,s.Z)(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var i=G(e.x,e.y,0,1),r=G(e.x+e.width,e.y,0,1),a=G(e.x,e.y+e.height,0,1),o=G(e.x+e.width,e.y+e.height,0,1),s=z(),l=z(),u=z(),c=z();j(s,i,n),j(l,r,n),j(u,a,n),j(c,o,n);var h=Math.min(s[0],l[0],u[0],c[0]),d=Math.min(s[1],l[1],u[1],c[1]),f=Math.max(s[0],l[0],u[0],c[0]),p=Math.max(s[1],l[1],u[1],c[1]);return t.fromRect({x:h,y:d,width:f-h,height:p-d})}}])}(),Ni="Method not implemented.",Pi="Use document.documentElement instead.";function Li(t){return void 0===t?0:t>360||t<-360?t%360:t}var Ri=y();function Di(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)&&3===t.length?i?x(t):E(Ri,t):(0,oe.Z)(t)?i?_(t,e,n):w(Ri,t,e,n):i?_(t[0],t[1]||e,t[2]||n):w(Ri,t[0],t[1]||e,t[2]||n)}var ki=Math.PI/180;function Ii(t){return t*ki}var Bi=180/Math.PI;function Fi(t){return t*Bi}var zi=Math.PI/2;function Gi(t,e){return 16===e.length?function(t,e){var n,i,r=pt(y(),e),a=(0,p.Z)(r,3),o=a[0],s=a[1],l=a[2],u=Math.asin(-e[2]/o);return u<zi?u>-zi?(n=Math.atan2(e[6]/s,e[10]/l),i=Math.atan2(e[1]/o,e[0]/o)):(i=0,n=-Math.atan2(e[4]/s,e[5]/s)):(i=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=u,t[2]=i,t}(t,e):function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=i*i,s=r*r,l=a*a,u=n*n+o+s+l,c=n*a-i*r;return c>.499995*u?(t[0]=zi,t[1]=2*Math.atan2(i,n),t[2]=0):c<-.499995*u?(t[0]=-zi,t[1]=2*Math.atan2(i,n),t[2]=0):(t[0]=Math.asin(2*(n*r-a*i)),t[1]=Math.atan2(2*(n*a+i*r),1-2*(s+l)),t[2]=Math.atan2(2*(n*i+r*a),1-2*(o+s))),t}(t,e)}function ji(t,e,n,i,r){var a,o,s,l,u,c,h,d,f,p,g=Math.cos(t),m=Math.sin(t);return a=i*g,o=r*m,s=0,l=-i*m,u=r*g,c=0,h=e,d=n,f=1,(p=new v(9))[0]=a,p[1]=o,p[2]=s,p[3]=l,p[4]=u,p[5]=c,p[6]=h,p[7]=d,p[8]=f,p}function Ui(t){var e=t[0],n=t[1],i=t[3],r=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(i*i+r*r);if(e*r-n*i<0&&(e<r?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var l=1/o;i*=l,r*=l}var u=Fi(Math.atan2(n,e));return[t[6],t[7],a,o,u]}var Hi=U(),Vi=U(),Zi=z(),Wi=[y(),y(),y()],Xi=y();function Yi(t,e,n,i,r){t[0]=e[0]*i+n[0]*r,t[1]=e[1]*i+n[1]*r,t[2]=e[2]*i+n[2]*r}var qi=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),$i=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),Ki=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),Qi="updated",Ji=2e-4,tr=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.clipSpaceNearZ=gi.NEGATIVE_ONE,this.eventEmitter=new g,this.matrix=U(),this.right=_(1,0,0),this.up=_(0,1,0),this.forward=_(0,0,1),this.position=_(0,0,1),this.focalPoint=_(0,0,0),this.distanceVector=_(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=U(),this.projectionMatrixInverse=U(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=qi.EXPLORING,this.trackingMode=$i.DEFAULT,this.projectionMode=Ki.PERSPECTIVE,this.frustum=new Ci,this.orthoMatrix=U()}),[{key:"isOrtho",value:function(){return this.projectionMode===Ki.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(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.type===qi.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===qi.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==qi.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return q(U(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=at(U(),[t,e,0]);this.jitteredProjectionMatrix=Q(U(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===Ki.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===Ki.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,i,r,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.projectionMode===Ki.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 void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Ki.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(t){return this.zoom=t,this.projectionMode===Ki.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Ki.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),i=n.x,r=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(i,r),this.setFocalPoint(i,r),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=_(o.x-i,o.y-r,0),l=O(s,this.right)/b(this.right),u=O(s,this.up)/b(this.up),c=this.getPosition(),h=(0,p.Z)(c,2),d=h[0],f=h[1],g=this.getFocalPoint(),m=(0,p.Z)(g,2),v=m[0],y=m[1];return this.setPosition(d-l,f-u),this.setFocalPoint(v-l,y-u),this}},{key:"setPerspective",value:function(t,e,n,i){var r;this.projectionMode=Ki.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=i;var a=this.near*Math.tan(Ii(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,l=-.5*s;if(null!==(r=this.view)&&void 0!==r&&r.enabled){var u=this.view.fullWidth,c=this.view.fullHeight;l+=this.view.offsetX*s/u,a-=this.view.offsetY*o/c,s*=this.view.width/u,o*=this.view.height/c}return function(t,e,n,i,r,a,o){var s,l,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=2*a,h=n-e,d=i-r,f=c/h,p=c/d,g=(n+e)/h,m=(i+r)/d,v=o-a,y=o*a;u?(s=-o/v,l=-y/v):(s=-(o+a)/v,l=-2*y/v),t[0]=f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=p,t[6]=0,t[7]=0,t[8]=g,t[9]=m,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,l,l+s,a-o,a,t,this.far,this.clipSpaceNearZ===gi.ZERO),q(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,i,r,a){var o;this.projectionMode=Ki.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=i,this.near=r,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=u-s,d=u+s,f=c+l,p=c-l;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(h+=g*this.view.offsetX)+g*this.view.width,p=(f-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===gi.NEGATIVE_ONE?St(this.projectionMatrix,h,d,f,p,r,a):Mt(this.projectionMatrix,h,d,f,p,r,a),q(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2],i=Di(t,e,n);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],i=_(0,1,0);if(this.focalPoint=Di(t,e,n),this.trackingMode===$i.CINEMATIC){var r=S(y(),this.focalPoint,this.position);t=r[0],e=r[1],n=r[2];var a=b(r),o=Fi(Math.asin(e/a)),s=90+Fi(Math.atan2(n,t)),l=U();it(l,l,Ii(s)),nt(l,l,Ii(o)),i=L(y(),[0,1,0],l)}return q(this.matrix,Ct(U(),this.position,this.focalPoint,i)),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(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Ji&&(this.distance=Ji),this.dollyingStep=this.distance/100;var e=y();t=this.distance;var n=this.forward,i=this.focalPoint;return e[0]=t*n[0]+i[0],e[1]=t*n[1]+i[1],e[2]=t*n[2]+i[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=Li(t),this.computeMatrix(),this._getAxes(),this.type===qi.ORBITING||this.type===qi.EXPLORING?this._getPosition():this.type===qi.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Li(t),this.computeMatrix(),this._getAxes(),this.type===qi.ORBITING||this.type===qi.EXPLORING?this._getPosition():this.type===qi.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=Li(t),this.computeMatrix(),this._getAxes(),this.type===qi.ORBITING||this.type===qi.EXPLORING?this._getPosition():this.type===qi.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 t=jt(Gt(),[0,0,1],Ii(this.roll));X(this.matrix);var e=jt(Gt(),[1,0,0],Ii((this.rotateWorld&&this.type!==qi.TRACKING||this.type===qi.TRACKING?1:-1)*this.elevation)),n=jt(Gt(),[0,1,0],Ii((this.rotateWorld&&this.type!==qi.TRACKING||this.type===qi.TRACKING?1:-1)*this.azimuth)),i=Ut(Gt(),n,e);i=Ut(Gt(),i,t);var r=yt(U(),i);this.type===qi.ORBITING||this.type===qi.EXPLORING?(J(this.matrix,this.matrix,this.focalPoint),Q(this.matrix,this.matrix,r),J(this.matrix,this.matrix,[0,0,this.distance])):this.type===qi.TRACKING&&(J(this.matrix,this.matrix,this.position),Q(this.matrix,this.matrix,r))}},{key:"_setPosition",value:function(t,e,n){this.position=Di(t,e,n);var i=this.matrix;i[12]=this.position[0],i[13]=this.position[1],i[14]=this.position[2],i[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){E(this.right,Di(j(z(),[1,0,0,0],this.matrix))),E(this.up,Di(j(z(),[0,1,0,0],this.matrix))),E(this.forward,Di(j(z(),[0,0,1,0],this.matrix))),A(this.right,this.right),A(this.up,this.up),A(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],i=b(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===qi.TRACKING||this.rotateWorld?(this.elevation=Fi(Math.asin(e/i)),this.azimuth=Fi(Math.atan2(-t,-n))):(this.elevation=-Fi(Math.asin(e/i)),this.azimuth=-Fi(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){E(this.position,Di(j(z(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;!function(t,e,n){var i=e[0],r=e[1],a=e[2];t[0]=i*n[0]+r*n[3]+a*n[6],t[1]=i*n[1]+r*n[4]+a*n[7],t[2]=i*n[2]+r*n[5]+a*n[8]}(this.distanceVector,[0,0,-this.distance],(t=zt(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),T(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=S(y(),this.focalPoint,this.position),this.distance=b(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Ki.ORTHOGRAPHIC){var t=this.position,e=jt(Gt(),[0,0,1],-this.roll*Math.PI/180);vt(this.orthoMatrix,e,_((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),_(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=Q(U(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Qi)}}},{key:"rotate",value:function(t,e,n){throw new Error(Ni)}},{key:"pan",value:function(t,e){throw new Error(Ni)}},{key:"dolly",value:function(t){throw new Error(Ni)}},{key:"createLandmark",value:function(t,e){throw new Error(Ni)}},{key:"gotoLandmark",value:function(t,e){throw new Error(Ni)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(Ni)}}])}(),er=function(t){return t[t.Standard=0]="Standard",t}({}),nr=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),ir={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Oi(0,0,0,0)},rr=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function ar(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];var o=e?e.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var l=t.apply(this,r);return n.cache=s.set(o,l)||s,l};return n.cache=new(ar.Cache||Map),n}ar.Cache=Map;var or=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),sr=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),lr=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),ur=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),cr=[{name:"em",unit_type:or.kEms},{name:"px",unit_type:or.kPixels},{name:"deg",unit_type:or.kDegrees},{name:"rad",unit_type:or.kRadians},{name:"grad",unit_type:or.kGradians},{name:"ms",unit_type:or.kMilliseconds},{name:"s",unit_type:or.kSeconds},{name:"rem",unit_type:or.kRems},{name:"turn",unit_type:or.kTurns}],hr=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),dr=function(t){return t?"number"===t?or.kNumber:"percent"===t||"%"===t?or.kPercentage:function(t){return cr.find((function(e){return e.name===t})).unit_type}(t):or.kUnknown},fr=function(t){var e=1;switch(t){case or.kPixels:case or.kDegrees:case or.kSeconds:break;case or.kMilliseconds:e=.001;break;case or.kRadians:e=180/Math.PI;break;case or.kGradians:e=.9;break;case or.kTurns:e=360}return e},pr=function(t){switch(t){case or.kNumber:case or.kInteger:return"";case or.kPercentage:return"%";case or.kEms:return"em";case or.kRems:return"rem";case or.kPixels:return"px";case or.kDegrees:return"deg";case or.kRadians:return"rad";case or.kGradians:return"grad";case or.kMilliseconds:return"ms";case or.kSeconds:return"s";case or.kTurns:return"turn"}return""},gr=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"toString",value:function(){return this.buildCSSText(lr.kNo,ur.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=hr.kUnitType&&this.getType()<=hr.kClampType}}],[{key:"isAngle",value:function(t){return t===or.kDegrees||t===or.kRadians||t===or.kGradians||t===or.kTurns}},{key:"isLength",value:function(t){return t>=or.kEms&&t<or.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===or.kPercentage||t===or.kEms||t===or.kRems}},{key:"isTime",value:function(t){return t===or.kSeconds||t===or.kMilliseconds}}])}(),mr=function(t){function e(t){var n;return(0,o.Z)(this,e),(n=d(this,e)).colorSpace=t,n}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"getType",value:function(){return hr.kColorType}},{key:"to",value:function(t){return this}}])}(gr),vr=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),yr=function(t){function e(t,n){var i;return(0,o.Z)(this,e),(i=d(this,e)).type=t,i.value=n,i}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return hr.kColorType}}])}(gr),xr=function(t){function e(t){var n;return(0,o.Z)(this,e),(n=d(this,e)).value=t,n}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return hr.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(gr),br=function(t){return function(t){switch(t){case sr.kUNumber:return or.kNumber;case sr.kULength:return or.kPixels;case sr.kUPercent:return or.kPercentage;case sr.kUTime:return or.kSeconds;case sr.kUAngle:return or.kDegrees;default:return or.kUnknown}}(function(t){switch(t){case or.kNumber:case or.kInteger:return sr.kUNumber;case or.kPercentage:return sr.kUPercent;case or.kPixels:return sr.kULength;case or.kMilliseconds:case or.kSeconds:return sr.kUTime;case or.kDegrees:case or.kRadians:case or.kGradians:case or.kTurns:return sr.kUAngle;default:return sr.kUOther}}(t))},_r=function(t){function e(t){var n,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:or.kNumber;return(0,o.Z)(this,e),n=d(this,e),i="string"==typeof r?dr(r):r,n.unit=i,n.value=t,n}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){var e=t;return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return hr.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=br(this.unit);if(n!==br(t)||n===or.kUnknown)return null;var i=fr(this.unit)/fr(t);return new e(this.value*i,t)}},{key:"buildCSSText",value:function(t,e,n){var i;switch(this.unit){case or.kUnknown:break;case or.kInteger:i=Number(this.value).toFixed(0);break;case or.kNumber:case or.kPercentage:case or.kEms:case or.kRems:case or.kPixels:case or.kDegrees:case or.kRadians:case or.kGradians:case or.kMilliseconds:case or.kSeconds:case or.kTurns:var r=this.value,a=pr(this.unit);if(r<-999999||r>999999){var o=pr(this.unit);i=!Number.isFinite(r)||Number.isNaN(r)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(r,o):r+(o||"")}else i="".concat(r).concat(a)}return n+=i}}])}(gr),Er=new _r(0,"px");new _r(1,"px");var wr=new _r(0,"deg"),Tr=function(t){function e(t,n,i){var r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return(0,o.Z)(this,e),(r=d(this,e,["rgb"])).r=t,r.g=n,r.b=i,r.alpha=a,r.isNone=s,r}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(mr),Sr=new xr("unset"),Mr={"":Sr,unset:Sr,initial:new xr("initial"),inherit:new xr("inherit")},Cr=new Tr(0,0,0,0,!0),Ar=new Tr(0,0,0,0),Or=ar((function(t,e,n,i){return new Tr(t,e,n,i)}),(function(t,e,n,i){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(i,")")})),Nr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:or.kNumber;return new _r(t,e)};function Pr(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new _r(50,"%");var Lr=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,i=/^(repeating\-radial\-gradient)/i,r=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^\(/,f=/^\)/,p=/^,/,g=/^\#([0-9a-fA-F]+)/,m=/^([a-zA-Z]+)/,v=/^rgb/i,y=/^rgba/i,x=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,b="";function _(t){throw new Error("".concat(b,": ").concat(t))}function E(){var t=L(w);return b.length>0&&_("Invalid input not EOF"),t}function w(){return T("linear-gradient",t,M)||T("repeating-linear-gradient",e,M)||T("radial-gradient",n,C)||T("repeating-radial-gradient",i,C)||T("conic-gradient",r,C)}function T(t,e,n){return S(e,(function(e){var i=n();return i&&(F(p)||_("Missing comma before color stops")),{type:t,orientation:i,colorStops:L(R)}}))}function S(t,e){var n=F(t);if(n){F(d)||_("Missing (");var i=e(n);return F(f)||_("Missing )"),i}}function M(){return B("directional",a,1)||B("angular",h,1)}function C(){var t,e,n=A();return n&&((t=[]).push(n),e=b,F(p)&&((n=A())?t.push(n):b=e)),t}function A(){var t=function(){var t=B("shape",/^(circle)/i,0);t&&(t.style=I()||O());return t}()||function(){var t=B("shape",/^(ellipse)/i,0);t&&(t.style=k()||O());return t}();if(t)t.at=N();else{var e=O();if(e){t=e;var n=N();n&&(t.at=n)}else{var i=P();i&&(t={type:"default-radial",at:i})}}return t}function O(){return B("extent-keyword",o,1)}function N(){if(B("position",/^at/,0)){var t=P();return t||_("Missing positioning value"),t}}function P(){var t={x:k(),y:k()};if(t.x||t.y)return{type:"position",value:t}}function L(t){var e=t(),n=[];if(e)for(n.push(e);F(p);)(e=t())?n.push(e):_("One extra comma");return n}function R(){var t=B("hex",g,1)||S(y,(function(){return{type:"rgba",value:L(D)}}))||S(v,(function(){return{type:"rgb",value:L(D)}}))||B("literal",m,0);return t||_("Expected color definition"),t.length=k(),t}function D(){return F(x)[1]}function k(){return B("%",u,1)||B("position-keyword",s,1)||I()}function I(){return B("px",l,1)||B("em",c,1)}function B(t,e,n){var i=F(e);if(i)return{type:t,value:i[n]}}function F(t){var e=/^[\n\r\t\s]+/.exec(b);e&&z(e[0].length);var n=t.exec(b);return n&&z(n[0].length),n}function z(t){b=b.substring(t)}return function(t){return b=t,E()}}();var Rr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Dr=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,kr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Ir=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Br={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},Fr=ar((function(t){var e;return e="angular"===t.type?Number(t.value):Br[t.value]||0,Nr(e,"deg")})),zr=ar((function(t){var e=50,n=50,i="%",r="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(i=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(r=null==s?void 0:s.type,n=Number(s.value))}return{cx:Nr(e,i),cy:Nr(n,r)}})),Gr=ar((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Lr(t).map((function(t){var e=t.type,n=t.orientation,i=t.colorStops;!function(t){var e,n,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var r=0,a=Number(t[0].length.value),o=1;o<i;o++){var s,l=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!(0,le.Z)(l)&&!(0,le.Z)(a)){for(var u=1;u<o-r;u++)t[r+u].length={type:"%",value:"".concat(a+(Number(l)-a)*u/(o-r))};r=o,a=Number(l)}}}(i);var r,a=i.map((function(t){return{offset:Nr(Number(t.length.value),"%"),color:Pr(t)}}));if("linear-gradient"===e)return new yr(vr.LinearGradient,{angle:n?Fr(n):wr,steps:a});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o,s=zr(n[0].at),l=s.cx,u=s.cy;if(n[0].style){var c=n[0].style,h=c.type,d=c.value;"extent-keyword"===h?(Mr[r=d]||(Mr[r]=new xr(r)),o=Mr[r]):o=Nr(d,h)}return new yr(vr.RadialGradient,{cx:l,cy:u,size:o,steps:a})}}));var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=Rr.exec(t);if(n){var i,r=(null===(i=n[2].match(Ir))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new yr(vr.LinearGradient,{angle:Nr(parseFloat(n[1]),"deg"),steps:r.map((function(t){var e=(0,p.Z)(t,2),n=e[0],i=e[1];return{offset:Nr(100*Number(n),"%"),color:i}}))})]}}else if("r"===e){var a=function(t){var e=Dr.exec(t);if(e){var n,i=(null===(n=e[4].match(Ir))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:Nr(50,"%"),cy:Nr(50,"%"),steps:i.map((function(t){var e=(0,p.Z)(t,2),n=e[0],i=e[1];return{offset:Nr(100*Number(n),"%"),color:i}}))}}return null}(t);if(a){if(!(0,ue.Z)(a))return[new yr(vr.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=kr.exec(t);if(e){var n=e[1],i=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:i,repetition:n}}return null}(t)}));function jr(t){return t&&!!t.image}function Ur(t){return t&&!(0,le.Z)(t.r)&&!(0,le.Z)(t.g)&&!(0,le.Z)(t.b)}var Hr=ar((function(t){if(jr(t))return(0,a.Z)({repetition:"repeat"},t);if((0,le.Z)(t)&&(t=""),"transparent"===t)return Ar;if("currentColor"===t)t="black";else if("none"===t)return Cr;var e=Gr(t);if(e)return e;var n=Cn(t),i=[0,0,0,0];return null!==n&&(i[0]=n.r||0,i[1]=n.g||0,i[2]=n.b||0,i[3]=n.opacity),Or.apply(void 0,i)}));function Vr(t,e){if(Ur(t)&&Ur(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(ce(e[n],0,255));return e[3]=ce(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Zr(t,e){if((0,le.Z)(e))return Nr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Nr(Number(e),"px");if("deg".search(t)>=0)return Nr(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U".concat(t)}));var i="U(".concat(t.source,")");return n.map((function(t){return Nr(Number(e.replace(new RegExp("U".concat(t),"g"),"").replace(new RegExp(i,"g"),"*0")),t)}))[0]}var Wr=function(t){return Zr(new RegExp("px","g"),t)},Xr=ar(Wr);ar((function(t){return Zr(new RegExp("%","g"),t)}));var Yr=function(t){return(0,oe.Z)(t)||isFinite(Number(t))?Nr(Number(t)||0,"px"):Zr(new RegExp("px|%|em|rem","g"),t)},qr=ar(Yr),$r=function(t){return Zr(new RegExp("deg|rad|grad|turn","g"),t)},Kr=ar($r);function Qr(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,l=br(t.unit),u=t.convertTo(l),c=e.convertTo(l);return u&&c?(o=u.value,s=c.value,a=pr(t.unit)):(_r.isLength(t.unit)||_r.isLength(e.unit))&&(o=ea(t,r,n),s=ea(e,r,n),a="px"),[o,s,function(t){return i&&(t=Math.max(t,0)),t+a}]}function Jr(t){var e=0;return t.unit===or.kDegrees?e=t.value:t.unit===or.kRadians?e=Fi(Number(t.value)):t.unit===or.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function ta(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):(0,ue.Z)(t)?n=t.split(" ").map((function(t){return Number(t)})):(0,oe.Z)(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function ea(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===or.kPixels)return Number(t.value);if(t.unit===or.kPercentage&&n){var r=n.nodeName===pi.GROUP?n.getLocalBounds():n.getGeometryBounds();return(i?r.min[e]:0)+t.value/100*r.halfExtents[e]*2}return 0}var na=function(t){return Zr(/deg|rad|grad|turn|px|%/g,t)},ia=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ra(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,i=[],r=0;e=n.exec(t);){if(e.index!==r)return[];if(r=e.index+e[0].length,ia.indexOf(e[1])>-1&&i.push({name:e[1],params:e[2].split(" ").map((function(t){return na(t)||Hr(t)}))}),n.lastIndex===t.length)return i}return[]}function aa(t){return t.toString()}var oa=function(t){return"number"==typeof t?Nr(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Nr(Number(t)):Nr(0)},sa=ar(oa);function la(t,e){return[t,e,aa]}function ua(t,e){return function(n,i){return[n,i,function(n){return aa(ce(n,t,e))}]}}function ca(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function ha(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Be(t.parsedStyle.d.absolutePath,void 0,(0,he.pi)((0,he.pi)({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function da(t){return 0===t.parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=ni(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength}function fa(t,e){return t[0]===e[0]&&t[1]===e[1]}function pa(t,e){var n=t.prePoint,i=t.currentPoint,r=t.nextPoint,a=Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2),o=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2),l=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!l||0===Math.sin(l)||je(l,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(r[1]-i[1],r[0]-i[0])),c=Math.abs(Math.atan2(r[0]-i[0],r[1]-i[1]));return u=u>Math.PI/2?Math.PI-u:u,c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(l/2-u)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(c-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0}}function ga(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}ar((function(t){return(0,ue.Z)(t)?t.split(" ").map(sa):t.map(sa)}));var ma=function(t,e){var n=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)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/i)},va=function(t,e,n,i,r,a,o,s){e=Math.abs(e),n=Math.abs(n);var l=Ii(i=Ue(i,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var u=(t.x-o.x)/2,c=(t.y-o.y)/2,h={x:Math.cos(l)*u+Math.sin(l)*c,y:-Math.sin(l)*u+Math.cos(l)*c},d=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);d>1&&(e*=Math.sqrt(d),n*=Math.sqrt(d));var f=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2));f=f<0?0:f;var p=(r!==a?1:-1)*Math.sqrt(f),g=p*(e*h.y/n),m=p*(-n*h.x/e),v={x:Math.cos(l)*g-Math.sin(l)*m+(t.x+o.x)/2,y:Math.sin(l)*g+Math.cos(l)*m+(t.y+o.y)/2},y={x:(h.x-g)/e,y:(h.y-m)/n},x=ma({x:1,y:0},y),b=ma(y,{x:(-h.x-g)/e,y:(-h.y-m)/n});!a&&b>0?b-=2*Math.PI:a&&b<0&&(b+=2*Math.PI);var _=x+(b%=2*Math.PI)*s,E=e*Math.cos(_),w=n*Math.sin(_);return{x:Math.cos(l)*E-Math.sin(l)*w+v.x,y:Math.sin(l)*E+Math.cos(l)*w+v.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+b,ellipticalArcAngle:_,ellipticalArcCenter:v,resultantRx:e,resultantRy:n}};function ya(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.arcParams,r=i.rx,a=void 0===r?0:r,o=i.ry,s=void 0===o?0:o,l=i.xRotation,u=i.arcFlag,c=i.sweepFlag,h=va({x:t.prePoint[0],y:t.prePoint[1]},a,s,l,!!u,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=va({x:t.prePoint[0],y:t.prePoint[1]},a,s,l,!!u,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),f=d.x-h.x,p=d.y-h.y,g=Math.sqrt(f*f+p*p);return{x:-f/g,y:-p/g}}function xa(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ba(t,e){return xa(t)*xa(e)?(t[0]*e[0]+t[1]*e[1])/(xa(t)*xa(e)):1}function _a(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(ba(t,e))}function Ea(t,e){var n=e[1],i=e[2],r=Ue(Ii(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],l=t[1],u=e[6],c=e[7],h=Math.cos(r)*(s-u)/2+Math.sin(r)*(l-c)/2,d=-1*Math.sin(r)*(s-u)/2+Math.cos(r)*(l-c)/2,f=h*h/(n*n)+d*d/(i*i);f>1&&(n*=Math.sqrt(f),i*=Math.sqrt(f));var p=n*n*(d*d)+i*i*(h*h),g=p?Math.sqrt((n*n*(i*i)-p)/p):1;a===o&&(g*=-1),isNaN(g)&&(g=0);var m=i?g*n*d/i:0,v=n?g*-i*h/n:0,y=(s+u)/2+Math.cos(r)*m-Math.sin(r)*v,x=(l+c)/2+Math.sin(r)*m+Math.cos(r)*v,b=[(h-m)/n,(d-v)/i],_=[(-1*h-m)/n,(-1*d-v)/i],E=_a([1,0],b),w=_a(b,_);return ba(b,_)<=-1&&(w=Math.PI),ba(b,_)>=1&&(w=0),0===o&&w>0&&(w-=2*Math.PI),1===o&&w<0&&(w+=2*Math.PI),{cx:y,cy:x,rx:fa(t,[u,c])?0:n,ry:fa(t,[u,c])?0:i,startAngle:E,endAngle:E+w,xRotation:r,arcFlag:a,sweepFlag:o}}var wa=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Ce(t)}catch(n){e=Ce(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e<t.length;e++){var n=t[e-1],i=t[e];if("M"===i[0]&&n){var r=n[0],a=[i[1],i[2]],o=void 0;"L"===r||"M"===r?o=[n[1],n[2]]:"C"!==r&&"A"!==r&&"Q"!==r||(o=[n[n.length-2],n[n.length-1]]),o&&fa(a,o)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,i=0;i<n;i++){var r=t[i][0];if("C"===r||"A"===r||"Q"===r){e=!0;break}}return e}(e),i=function(t){for(var e=[],n=[],i=[],r=0;r<t.length;r++){var a=t[r],o=a[0];"M"===o?(i.length&&(n.push(i),i=[]),i.push([a[1],a[2]])):"Z"===o?i.length&&(e.push(i),i=[]):i.push([a[1],a[2]])}return i.length>0&&n.push(i),{polygons:e,polylines:n}}(e),r=i.polygons,a=i.polylines,o=function(t){for(var e=[],n=null,i=null,r=null,a=0,o=t.length,s=0;s<o;s++){var l=t[s];i=t[s+1];var u=l[0],c={command:u,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(u){case"M":r=[l[1],l[2]],a=s;break;case"A":var h=Ea(n,l);c.arcParams=h}if("Z"===u)n=r,i=t[a+1];else{var d=l.length;n=[l[d-2],l[d-1]]}i&&"Z"===i[0]&&(i=t[a],e[a]&&(e[a].prePoint=n)),c.currentPoint=n,e[a]&&fa(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint);var f=i?[i[i.length-2],i[i.length-1]]:null;c.nextPoint=f;var p=c.prePoint;if(["L","H","V"].includes(u))c.startTangent=[p[0]-n[0],p[1]-n[1]],c.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===u){var g=[l[1],l[2]];c.startTangent=[p[0]-g[0],p[1]-g[1]],c.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===u){var m=e[s-1],v=ga(m.currentPoint,p);"Q"===m.command?(c.command="Q",c.startTangent=[p[0]-v[0],p[1]-v[1]],c.endTangent=[n[0]-v[0],n[1]-v[1]]):(c.command="TL",c.startTangent=[p[0]-n[0],p[1]-n[1]],c.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===u){var y=[l[1],l[2]],x=[l[3],l[4]];c.startTangent=[p[0]-y[0],p[1]-y[1]],c.endTangent=[n[0]-x[0],n[1]-x[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[y[0]-x[0],y[1]-x[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[x[0]-y[0],x[1]-y[1]])}else if("S"===u){var b=e[s-1],_=ga(b.currentPoint,p),E=[l[1],l[2]];"C"===b.command?(c.command="C",c.startTangent=[p[0]-_[0],p[1]-_[1]],c.endTangent=[n[0]-E[0],n[1]-E[1]]):(c.command="SQ",c.startTangent=[p[0]-E[0],p[1]-E[1]],c.endTangent=[n[0]-E[0],n[1]-E[1]])}else if("A"===u){var w=ya(c,0),T=w.x,S=w.y,M=ya(c,1,!1),C=M.x,A=M.y;c.startTangent=[T,S],c.endTangent=[C,A]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],i=[],r=[],a=0;a<t.length;a++){var o=t[a],s=o.currentPoint,l=o.params,u=o.prePoint,c=void 0;switch(o.command){case"Q":c=ai(u[0],u[1],l[1],l[2],l[3],l[4]);break;case"C":c=ti(u[0],u[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=o.arcParams;c=Xn(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),i.push(s[1])}c&&(o.box=c,n.push(c.x,c.x+c.width),i.push(c.y,c.y+c.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&r.push(o)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),i=i.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var d=ze(n),f=ze(i),p=Ge(n),g=Ge(i);if(0===r.length)return{x:d,y:f,width:p-d,height:g-f};for(var m=0;m<r.length;m++){var v=r[m],y=v.currentPoint;y[0]===d?d-=pa(v,e).xExtra:y[0]===p&&(p+=pa(v,e).xExtra),y[1]===f?f-=pa(v,e).yExtra:y[1]===g&&(g+=pa(v,e).yExtra)}return{x:d,y:f,width:p-d,height:g-f}}(o,0),l=s.x,u=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:r,polylines:a,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(u)?u:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},Ta=ar(wa);function Sa(t){return(0,ue.Z)(t)?Ta(t):wa(t)}function Ma(t,e,n){var i=t.curve,r=e.curve;i&&0!==i.length||(i=Ye(t.absolutePath,!1),t.curve=i),r&&0!==r.length||(r=Ye(e.absolutePath,!1),e.curve=r);var a=[i,r];i.length!==r.length&&(a=$e(i,r));var o,s,l,u,c,h,d,f,p=Ke(a[0])!==Ke(a[1])?(o=a[0],s=o.slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):a[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[p,(l=a[1],u=p,c=l.length-1,h=[],d=0,f=function(t){var e=t.length,n=e-1;return t.map((function(i,r){return t.map((function(i,a){var o,s=r+a;return 0===a||t[s]&&"M"===t[s][0]?(o=t[s],["M"].concat(o.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(l),f.forEach((function(t,e){l.slice(1).forEach((function(t,n){d+=se(l[(e+n)%c].slice(-2),u[n%c].slice(-2))})),h[e]=d,d=0})),f[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Ca(t,e){return{points:(0,ue.Z)(t)?t.split(" ").map((function(t){var e=t.split(","),n=(0,p.Z)(e,2),i=n[0],r=n[1];return[Number(i),Number(r)]})):t,totalLength:0,segments:[]}}function Aa(t,e){return[t.points,e.points,function(t){return t}]}var Oa=null,Na=/\s*(\w+)\(([^)]*)\)/g;function Pa(t){return function(e){var n=0;return t.map((function(t){return t===Oa?e[n++]:t}))}}function La(t){return t}var Ra={matrix:["NNNNNN",[Oa,Oa,0,0,Oa,Oa,0,0,0,0,1,0,Oa,Oa,0,1],La],matrix3d:["NNNNNNNNNNNNNNNN",La],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Pa([Oa,Oa,new _r(1)]),La],scaleX:["N",Pa([Oa,new _r(1),new _r(1)]),Pa([Oa,new _r(1)])],scaleY:["N",Pa([new _r(1),Oa,new _r(1)]),Pa([new _r(1),Oa])],scaleZ:["N",Pa([new _r(1),new _r(1),Oa])],scale3d:["NNN",La],skew:["Aa",null,La],skewX:["A",null,Pa([Oa,wr])],skewY:["A",null,Pa([wr,Oa])],translate:["Tt",Pa([Oa,Oa,Er]),La],translateX:["T",Pa([Oa,Er,Er]),Pa([Oa,Er])],translateY:["T",Pa([Er,Oa,Er]),Pa([Er,Oa])],translateZ:["L",Pa([Er,Er,Oa])],translate3d:["TTL",La]};function Da(t){for(var e=[],n=t.length,i=0;i<n;i++){var r=t[i],a=r[0],o=r.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!Ra[a])return[];var s=o.map((function(t){return Nr(t)}));e.push({t:a,d:s})}return e}function ka(t){if(Array.isArray(t))return Da(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],i=0;for(Na.lastIndex=0;e=Na.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var r=e[1],a=Ra[r];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var l=[],u=0;u<s.length;u++){var c=o[u],h=s[u],d=void 0;if(void 0===(d=c?{A:function(t){return"0"===t.trim()?wr:Kr(t)},N:sa,T:qr,L:Xr}[h.toUpperCase()](c):{a:wr,n:l[0],t:Er}[h]))return[];l.push(d)}if(n.push({t:r,d:l}),Na.lastIndex===t.length)return n}return[]}function Ia(t){if(Array.isArray(t))return Da(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],i=0;for(Na.lastIndex=0;e=Na.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var r=e[1],a=Ra[r];if(!a)return[];var o=e[2].split(","),s=a[0];if(s.length<o.length)return[];for(var l=[],u=0;u<s.length;u++){var c=o[u],h=s[u],d=void 0;if(void 0===(d=c?{A:function(t){return"0"===t.trim()?wr:$r(t)},N:oa,T:Yr,L:Wr}[h.toUpperCase()](c):{a:wr,n:l[0],t:Er}[h]))return[];l.push(d)}if(n.push({t:r,d:l}),Na.lastIndex===t.length)return n}return[]}function Ba(t){var e,n,i,r;switch(t.t){case"rotateX":return r=Ii(Jr(t.d[0])),[1,0,0,0,0,Math.cos(r),Math.sin(r),0,0,-Math.sin(r),Math.cos(r),0,0,0,0,1];case"rotateY":return r=Ii(Jr(t.d[0])),[Math.cos(r),0,-Math.sin(r),0,0,1,0,0,Math.sin(r),0,Math.cos(r),0,0,0,0,1];case"rotate":case"rotateZ":return r=Ii(Jr(t.d[0])),[Math.cos(r),Math.sin(r),0,0,-Math.sin(r),Math.cos(r),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,i=t.d[2].value,r=Ii(Jr(t.d[3]));var a=e*e+n*n+i*i;if(0===a)e=1,n=0,i=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,i/=o}var s=Math.sin(r/2),l=s*Math.cos(r/2),u=s*s;return[1-2*(n*n+i*i)*u,2*(e*n*u+i*l),2*(e*i*u-n*l),0,2*(e*n*u-i*l),1-2*(e*e+i*i)*u,2*(n*i*u+e*l),0,2*(e*i*u+n*l),2*(n*i*u-e*l),1-2*(e*e+n*n)*u,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.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,t.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,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=Ii(Jr(t.d[0])),h=Ii(Jr(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return r=Ii(Jr(t.d[0])),[1,0,0,0,Math.tan(r),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return r=Ii(Jr(t.d[0])),[1,Math.tan(r),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ea(t.d[0],0,null)||0,n=ea(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ea(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=ea(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,i=ea(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ea(t.d[0],0,null)||0,n=ea(t.d[1],0,null)||0,i=ea(t.d[2],0,null)||0,1];case"perspective":var d=ea(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,d?-1/d:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function Fa(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function za(t){var e=[0,0,0],n=[1,1,1],i=[0,0,0],r=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,i,r,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var i=1/n,r=0;r<16;r++)t[r]=e[r]*i;return!0}(Hi,t))return!1;if(V(Vi,Hi),Vi[3]=0,Vi[7]=0,Vi[11]=0,Vi[15]=1,Math.abs(K(Vi))<1e-8)return!1;var o,s,l=Hi[3],u=Hi[7],c=Hi[11],h=Hi[12],d=Hi[13],f=Hi[14],p=Hi[15];if(0!==l||0!==u||0!==c){if(Zi[0]=l,Zi[1]=u,Zi[2]=c,Zi[3]=p,!q(Vi,Vi))return!1;Y(Vi,Vi),j(r,Zi,Vi)}else r[0]=r[1]=r[2]=0,r[3]=1;if(e[0]=h,e[1]=d,e[2]=f,s=Hi,(o=Wi)[0][0]=s[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=b(Wi[0]),A(Wi[0],Wi[0]),i[0]=O(Wi[0],Wi[1]),Yi(Wi[1],Wi[1],Wi[0],1,-i[0]),n[1]=b(Wi[1]),A(Wi[1],Wi[1]),i[0]/=n[1],i[1]=O(Wi[0],Wi[2]),Yi(Wi[2],Wi[2],Wi[0],1,-i[1]),i[2]=O(Wi[1],Wi[2]),Yi(Wi[2],Wi[2],Wi[1],1,-i[2]),n[2]=b(Wi[2]),A(Wi[2],Wi[2]),i[1]/=n[2],i[2]/=n[2],N(Xi,Wi[1],Wi[2]),O(Wi[0],Xi)<0)for(var g=0;g<3;g++)n[g]*=-1,Wi[g][0]*=-1,Wi[g][1]*=-1,Wi[g][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+Wi[0][0]-Wi[1][1]-Wi[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Wi[0][0]+Wi[1][1]-Wi[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Wi[0][0]-Wi[1][1]+Wi[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Wi[0][0]+Wi[1][1]+Wi[2][2],0)),Wi[2][1]>Wi[1][2]&&(a[0]=-a[0]),Wi[0][2]>Wi[2][0]&&(a[1]=-a[1]),Wi[1][0]>Wi[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Ba).reduce(Fa)}(t),e,n,i,r,a),[[e,n,i,a,r]]}var Ga=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],i=0;i<4;i++)for(var r=0;r<4;r++)for(var a=0;a<4;a++)n[i][r]+=e[i][a]*t[a][r];return n}return function(e,n,i,r,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)o[s][3]=a[s];for(var l=0;l<3;l++)for(var u=0;u<3;u++)o[3][l]+=e[u]*o[u][l];var c=r[0],h=r[1],d=r[2],f=r[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(h*h+d*d),p[0][1]=2*(c*h-d*f),p[0][2]=2*(c*d+h*f),p[1][0]=2*(c*h+d*f),p[1][1]=1-2*(c*c+d*d),p[1][2]=2*(h*d-c*f),p[2][0]=2*(c*d-h*f),p[2][1]=2*(h*d+c*f),p[2][2]=1-2*(c*c+h*h),o=t(o,p);var g,m=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];i[2]&&(m[2][1]=i[2],o=t(o,m)),i[1]&&(m[2][1]=0,m[2][0]=i[0],o=t(o,m)),i[0]&&(m[2][0]=0,m[1][0]=i[0],o=t(o,m));for(var v=0;v<3;v++)for(var y=0;y<3;y++)o[v][y]*=n[v];return 0===(g=o)[0][2]&&0===g[0][3]&&0===g[1][2]&&0===g[1][3]&&0===g[2][0]&&0===g[2][1]&&1===g[2][2]&&0===g[2][3]&&0===g[3][2]&&1===g[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function ja(t){return t.toFixed(6).replace(".000000","")}function Ua(t,e){var n,i;return t.decompositionPair!==e&&(t.decompositionPair=e,n=za(t)),e.decompositionPair!==t&&(e.decompositionPair=t,i=za(e)),null===n[0]||null===i[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),i[0].push(1),[n,i,function(t){var e=function(t,e,n){var i=function(t,e){for(var n=0,i=0;i<t.length;i++)n+=t[i]*e[i];return n}(t,e);i=ce(i,-1,1);var r=[];if(1===i)r=t;else for(var a=Math.acos(i),o=1*Math.sin(n*a)/Math.sqrt(1-i*i),s=0;s<4;s++)r.push(t[s]*(Math.cos(n*a)-i*o)+e[s]*o);return r}(n[0][3],i[0][3],t[5]);return Ga(t[0],t[1],t[2],e,t[4]).map(ja).join(",")}])}function Ha(t){return t.replace(/[XY]/,"")}function Va(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function Za(t,e,n){var i=!1;if(!t.length||!e.length){t.length||(i=!0,t=e,e=[]);for(var r=function(){var n=t[a],i=n.t,r=n.d,o="scale"===i.substring(0,5)?1:0;e.push({t:i,d:r.map((function(t){return"number"==typeof t?Nr(o):Nr(o,t.unit)}))})},a=0;a<t.length;a++)r()}var o,s,l=[],u=[],c=[];if(t.length!==e.length){var h=Ua(t,e);l=[h[0]],u=[h[1]],c=[["matrix",[h[2]]]]}else for(var d=0;d<t.length;d++){var f=t[d].t,p=e[d].t,g=t[d].d,m=e[d].d,v=Ra[f],y=Ra[p],x=void 0;if(s=p,"perspective"===(o=f)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var b=Ua([t[d]],[e[d]]);l.push(b[0]),u.push(b[1]),c.push(["matrix",[b[2]]])}else{if(f===p)x=f;else if(v[2]&&y[2]&&Ha(f)===Ha(p))x=Ha(f),g=v[2](g),m=y[2](m);else{if(!v[1]||!y[1]||Va(f)!==Va(p)){var _=Ua(t,e);l=[_[0]],u=[_[1]],c=[["matrix",[_[2]]]];break}x=Va(f),g=v[1](g),m=y[1](m)}for(var E=[],w=[],T=[],S=0;S<g.length;S++){var M=Qr(g[S],m[S],n,!1,S);E[S]=M[0],w[S]=M[1],T.push(M[2])}l.push(E),u.push(w),c.push([x,T])}}if(i){var C=l;l=u,u=C}return[l,u,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return c[e][1][n](t)})).join(",");return"matrix"===c[e][0]&&16===n.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===n.split(",").length&&(c[e][0]="matrix"),"".concat(c[e][0],"(").concat(n,")")})).join(" ")}]}var Wa=ar((function(t){if((0,ue.Z)(t)){if("text-anchor"===t)return[Nr(0,"px"),Nr(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[qr(Xa(e[0])),qr(Xa(e[1]))]}return[Nr(t[0]||0,"px"),Nr(t[1]||0,"px")]}));function Xa(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var Ya=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:rr.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:rr.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:rr.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:rr.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:rr.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:rr.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:rr.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:rr.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:rr.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:rr.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:rr.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:rr.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:rr.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:rr.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:rr.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:rr.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:rr.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:rr.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:rr.FILTER},{n:"clipPath",syntax:rr.DEFINED_PATH},{n:"textPath",syntax:rr.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:rr.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:rr.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:rr.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:rr.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:rr.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:rr.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:rr.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:rr.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:rr.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:rr.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:rr.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:rr.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:rr.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:rr.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:rr.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:rr.COORDINATE},{n:"y1",int:!0,l:!0,syntax:rr.COORDINATE},{n:"z1",int:!0,l:!0,syntax:rr.COORDINATE},{n:"x2",int:!0,l:!0,syntax:rr.COORDINATE},{n:"y2",int:!0,l:!0,syntax:rr.COORDINATE},{n:"z2",int:!0,l:!0,syntax:rr.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:rr.PATH,p:50},{n:"points",int:!0,l:!0,syntax:rr.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:rr.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:rr.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:rr.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:rr.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:rr.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:rr.NUMBER,d:function(t){return t===pi.PATH||t===pi.POLYGON||t===pi.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:rr.MARKER},{n:"markerEnd",syntax:rr.MARKER},{n:"markerMid",syntax:rr.MARKER},{n:"markerStartOffset",syntax:rr.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:rr.LENGTH,l:!0,int:!0,d:"0"}],qa=new Set(Ya.filter((function(t){return!!t.l})).map((function(t){return t.n}))),$a={},Ka=function(){return(0,s.Z)((function t(e){var n=this;(0,o.Z)(this,t),this.runtime=e,Ya.forEach((function(t){n.registerMetadata(t)}))}),[{key:"registerMetadata",value:function(t){[t.n].concat((0,l.Z)(t.a||[])).forEach((function(e){$a[e]=t}))}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var i=t.parsedStyle.clipPath,r=t.parsedStyle.offsetPath;Qa(t,e);var o=!!n.forceUpdateGeometry;if(!o)for(var s in e)if(qa.has(s)){o=!0;break}var l=Ja(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=Hr(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=Hr(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=Hr(e.shadowColor)),l.has("filter")&&e.filter&&(t.parsedStyle.filter=ra(e.filter)),l.has("radius")&&!(0,le.Z)(e.radius)&&(t.parsedStyle.radius=ta(e.radius,4)),l.has("lineDash")&&!(0,le.Z)(e.lineDash)&&(t.parsedStyle.lineDash=ta(e.lineDash,2)),l.has("points")&&e.points&&(t.parsedStyle.points=Ca(e.points)),l.has("d")&&""===e.d&&(t.parsedStyle.d=(0,a.Z)({},ir)),l.has("d")&&e.d&&(t.parsedStyle.d=Sa(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[rr.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!Qe(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[rr.DEFINED_PATH].calculator("clipPath",i,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[rr.DEFINED_PATH].calculator("offsetPath",r,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=ka(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=Wa(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[rr.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[rr.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[rr.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!(0,le.Z)(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[rr.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!(0,le.Z)(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[rr.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[rr.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[rr.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var i=t.geometry;i.contentBounds||(i.contentBounds=new Ti),i.renderBounds||(i.renderBounds=new Ti);var r=t.parsedStyle,a=n.update(r,t),o=a.cx,s=void 0===o?0:o,l=a.cy,u=void 0===l?0:l,c=a.cz,h=void 0===c?0:c,d=a.hwidth,f=void 0===d?0:d,p=a.hheight,g=void 0===p?0:p,m=a.hdepth,v=void 0===m?0:m,y=[Math.abs(f),Math.abs(g),v],x=r.stroke,b=r.lineWidth,_=void 0===b?1:b,E=r.increasedLineWidthForHitTesting,w=void 0===E?0:E,S=r.shadowType,M=void 0===S?"outer":S,C=r.shadowColor,A=r.filter,O=void 0===A?[]:A,N=r.transformOrigin,P=[s,u,h];i.contentBounds.update(P,y);var L=e===pi.POLYLINE||e===pi.POLYGON||e===pi.PATH?Math.SQRT2:.5;if(x&&!x.isNone){var R=((_||0)+(w||0))*L;y[0]+=R,y[1]+=R}if(i.renderBounds.update(P,y),C&&M&&"inner"!==M){var D=i.renderBounds,k=D.min,I=D.max,B=r.shadowBlur||0,F=r.shadowOffsetX||0,z=r.shadowOffsetY||0,G=k[0]-B+F,j=I[0]+B+F,U=k[1]-B+z,H=I[1]+B+z;k[0]=Math.min(k[0],G),I[0]=Math.max(I[0],j),k[1]=Math.min(k[1],U),I[1]=Math.max(I[1],H),i.renderBounds.setMinMax(k,I)}O.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,T(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,l=i.renderBounds,u=l.min,c=l.max,h=u[0]-s+a,d=c[0]+s+a,f=u[1]-s+o,p=c[1]+s+o;u[0]=Math.min(u[0],h),c[0]=Math.max(c[0],d),u[1]=Math.min(u[1],f),c[1]=Math.max(c[1],p),i.renderBounds.setMinMax(u,c)}})),t.geometry.dirty=!1;var V=g<0,Z=(f<0?-1:1)*(N?ea(N[0],0,t,!0):0),W=(V?-1:1)*(N?ea(N[1],1,t,!0):0);(Z||W)&&t.setOrigin(Z,W)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===pi.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===pi.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function Qa(t,e){var n=Ja(t);for(var i in e)n.has(i)&&(t.parsedStyle[i]=e[i])}function Ja(t){return t.constructor.PARSED_STYLE_LIST}var to=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=la}),[{key:"calculator",value:function(t,e,n,i){return Jr(n)}}])}(),eo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,i,r){return n instanceof xr&&(n=null),r.sceneGraphService.updateDisplayObjectDependency(t,e,n,i),"clipPath"===t&&i.forEach((function(t){0===t.childNodes.length&&r.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),no=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.parser=Hr,this.mixer=Vr}),[{key:"calculator",value:function(t,e,n,i){return n instanceof xr?"none"===n.value?Cr:Ar:n}}])}(),io=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof xr?[]:n}}])}();function ro(t){var e=t.parsedStyle.fontSize;return(0,le.Z)(e)?null:e}var ao=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=la}),[{key:"calculator",value:function(t,e,n,i,r){if((0,oe.Z)(n))return n;if(!_r.isRelativeUnit(n.unit))return n.value;if(n.unit===or.kPercentage)return 0;if(n.unit===or.kEms){if(i.parentNode){var a=ro(i.parentNode);if(a)return a*=n.value}return 0}if(n.unit===or.kRems){var o;if(null!=i&&null!==(o=i.ownerDocument)&&void 0!==o&&o.documentElement){var s=ro(i.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),oo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=ca}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),so=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=ca}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),lo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,i){var r;n instanceof xr&&(n=null);var a=null===(r=n)||void 0===r?void 0:r.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),uo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=la}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),co=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=ua(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath,i=e.offsetDistance;if(n){var r=n.nodeName;if(r===pi.LINE||r===pi.PATH||r===pi.POLYLINE){var a=n.getPoint(i);a&&t.setLocalPosition(a.x,a.y)}}}}])}(),ho=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=ua(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),fo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.parser=Sa,this.mixer=Ma}),[{key:"calculator",value:function(t,e,n){return n instanceof xr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Oi(0,0,0,0)}:n}}])}(),po=(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=Aa})),go=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).mixer=ua(0,1/0),t}return(0,f.Z)(e,t),(0,s.Z)(e)}(ao),mo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,i){return n instanceof xr?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),vo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,i){var r=i.getAttribute("text");if(r){var a=r;"capitalize"===n.value?a=r.charAt(0).toUpperCase()+r.slice(1):"lowercase"===n.value?a=r.toLowerCase():"uppercase"===n.value&&(a=r.toUpperCase()),i.parsedStyle.text=a}return n.value}}])}(),yo=new WeakMap;function xo(t,e,n){if(t){var i="string"==typeof t?document.getElementById(t):t;yo.has(i)&&yo.get(i).destroy(n),yo.set(i,e)}}var bo="undefined"!=typeof window&&void 0!==window.document;function _o(t){return!!t.getAttribute}function Eo(t,e){var n=Number(t.parsedStyle.zIndex||0),i=Number(e.parsedStyle.zIndex||0);if(n===i){var r=t.parentNode;if(r){var a=r.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-i}function wo(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function To(t,e){if(bo)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var So={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Mo="object"==typeof performance&&performance.now?performance:Date;function Co(t){return t.nodeName===pi.FRAGMENT||t.getRootNode().nodeName===pi.FRAGMENT}function Ao(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=!1,r=!1,a=!!e&&!e.isNone,o=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(i=a,r=o):"visiblefill"===t||"fill"===t?i=!0:"visiblestroke"===t||"stroke"===t?r=!0:"visible"!==t&&"all"!==t||(i=!0,r=!0),[i,r]}var Oo=1,No="object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:{},Po=Date.now(),Lo={},Ro=Date.now(),Do=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Ro,i=n>16?0:16-n,r=Oo++;return Lo[r]=t,Object.keys(Lo).length>1||setTimeout((function(){Ro=e;var t=Lo;Lo={},Object.keys(t).forEach((function(e){return t[e](No.performance&&"function"==typeof No.performance.now?No.performance.now():Date.now()-Po)}))}),i),r},ko=function(t){delete Lo[t]},Io=function(t){return"string"!=typeof t?Do:""===t?No.requestAnimationFrame:No["".concat(t,"RequestAnimationFrame")]},Bo=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Io(t)})),Fo=Io(Bo),zo=function(t){return"string"!=typeof t?ko:""===t?No.cancelAnimationFrame:No["".concat(t,"CancelAnimationFrame")]||No["".concat(t,"CancelRequestAnimationFrame")]}(Bo);No.requestAnimationFrame=Fo,No.cancelAnimationFrame=zo;var Go=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))}}])}(),jo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.callbacks=[]}),[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=(0,li.Z)((0,si.Z)().mark((function t(){var e,n,i,r,a=arguments;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,a);case 3:n=t.sent,i=0;case 5:if(!(i<this.callbacks.length-1)){t.next=13;break}return r=this.callbacks[i],t.next=9,r(n);case 9:n=t.sent;case 10:i++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),Uo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=arguments;this.callbacks.forEach((function(t){t.apply(void 0,i)}))}}])}(),Ho=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(this.callbacks.length){for(var i=arguments,r=this.callbacks[0].apply(void 0,i),a=0;a<this.callbacks.length-1;a++){var o=this.callbacks[a];r=o(r)}return r}return null}}])}(),Vo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Zo=/([\"\'])[^\'\"]+\1/;function Wo(t,e,n){return X(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var Xo=U(),Yo=U(),qo={scale:function(t){ot(Xo,[t[0].value,t[1].value,1])},scaleX:function(t){ot(Xo,[t[0].value,1,1])},scaleY:function(t){ot(Xo,[1,t[0].value,1])},scaleZ:function(t){ot(Xo,[1,1,t[0].value])},scale3d:function(t){ot(Xo,[t[0].value,t[1].value,t[2].value])},translate:function(t){at(Xo,[t[0].value,t[1].value,0])},translateX:function(t){at(Xo,[t[0].value,0,0])},translateY:function(t){at(Xo,[0,t[0].value,0])},translateZ:function(t){at(Xo,[0,0,t[0].value])},translate3d:function(t){at(Xo,[t[0].value,t[1].value,t[2].value])},rotate:function(t){ct(Xo,Ii(Jr(t[0])))},rotateX:function(t){lt(Xo,Ii(Jr(t[0])))},rotateY:function(t){ut(Xo,Ii(Jr(t[0])))},rotateZ:function(t){ct(Xo,Ii(Jr(t[0])))},rotate3d:function(t){st(Xo,Ii(Jr(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){Wo(Xo,Ii(t[0].value),Ii(t[1].value))},skewX:function(t){Wo(Xo,Ii(t[0].value),0)},skewY:function(t){Wo(Xo,0,Ii(t[0].value))},matrix:function(t){W(Xo,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){W.apply(i,[Xo].concat((0,l.Z)(t.map((function(t){return t.value})))))}},$o=_(1,1,1),Ko=y(),Qo={translate:function(t,e){ol.sceneGraphService.setLocalScale(t,$o,!1),ol.sceneGraphService.setLocalEulerAngles(t,Ko,void 0,void 0,!1),ol.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),ol.sceneGraphService.dirtifyLocal(t,t.transformable)}};function Jo(t,e){if(t.length){if(1===t.length&&Qo[t[0].t])return void Qo[t[0].t](e,t[0].d);for(var n=X(Yo),i=0;i<t.length;i++){var r=t[i],a=r.t,o=r.d,s=qo[a];s&&(s(o),Bt(n,n,Xo))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var ts=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.parser=Ia,this.mixer=Za}),[{key:"calculator",value:function(t,e,n,i){return n instanceof xr?[]:n}},{key:"postProcessor",value:function(t){Jo(t.parsedStyle.transform,t)}}])}(),es=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===or.kPixels&&e[1].unit===or.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),ns=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,i){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,i=e.sortable;n&&(n.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=nr.Z_INDEX_CHANGED)}}}])}(),is=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,i=void 0===n?0:n,r=t.cy,a=void 0===r?0:r,o=t.r,s=void 0===o?0:o;return{cx:i,cy:a,hwidth:s,hheight:s}}}])}(),rs=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,i=void 0===n?0:n,r=t.cy,a=void 0===r?0:r,o=t.rx,s=void 0===o?0:o,l=t.ry;return{cx:i,cy:a,hwidth:s,hheight:void 0===l?0:l}}}])}(),as=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"update",value:function(t){var e=t.x1,n=t.y1,i=t.x2,r=t.y2,a=Math.min(e,i),o=Math.max(e,i),s=Math.min(n,r),l=(o-a)/2,u=(Math.max(n,r)-s)/2;return{cx:a+l,cy:s+u,hwidth:l,hheight:u}}}])}(),os=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"update",value:function(t){var e=t.d.rect,n=e.x,i=e.y,r=e.width/2,a=e.height/2;return{cx:n+r,cy:i+a,hwidth:r,hheight:a}}}])}(),ss=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"update",value:function(t){if(t.points&&(0,Fe.Z)(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,(0,l.Z)(e.map((function(t){return t[0]})))),i=Math.max.apply(Math,(0,l.Z)(e.map((function(t){return t[0]})))),r=Math.min.apply(Math,(0,l.Z)(e.map((function(t){return t[1]})))),a=Math.max.apply(Math,(0,l.Z)(e.map((function(t){return t[1]})))),o=(i-n)/2,s=(a-r)/2;return{cx:n+o,cy:r+s,hwidth:o,hheight:s}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),ls=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"update",value:function(t,e){var n=t.x,i=void 0===n?0:n,r=t.y,a=void 0===r?0:r,o=t.src,s=t.width,l=void 0===s?0:s,u=t.height,c=l,h=void 0===u?0:u;return o&&!(0,ue.Z)(o)&&(c||(c=o.width,t.width=c),h||(h=o.height,t.height=h)),{cx:i+c/2,cy:a+h/2,hwidth:c/2,hheight:h/2}}}])}(),us=function(){return(0,s.Z)((function t(e){(0,o.Z)(this,t),this.globalRuntime=e}),[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,i=t.text,r=t.textAlign,a=void 0===r?"start":r,o=t.lineWidth,s=void 0===o?1:o,l=t.textBaseline,u=void 0===l?"alphabetic":l,c=t.dx,h=void 0===c?0:c,d=t.dy,f=void 0===d?0:d,p=t.x,g=void 0===p?0:p,m=t.y,v=void 0===m?0:m;if(!this.isReadyToMeasure(t,e))return t.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 y=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{}).offscreenCanvas,x=this.globalRuntime.textService.measureText(i,t,y);t.metrics=x;var b=x.width/2,_=x.height/2,E=g+b;"center"===a||"middle"===a?E+=s/2-b:"right"!==a&&"end"!==a||(E+=s-2*b);var w=v-_;return"middle"===u?w+=_:"top"===u||"hanging"===u?w+=2*_:"alphabetic"===u||"bottom"!==u&&"ideographic"!==u||(w+=0),h&&(E+=h),f&&(w+=f),{cx:E,cy:w,hwidth:b,hheight:_}}}])}(),cs=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),hs=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"update",value:function(t,e){var n=t.x,i=void 0===n?0:n,r=t.y,a=void 0===r?0:r,o=t.width,s=void 0===o?0:o,l=t.height,u=void 0===l?0:l;return{cx:i+s/2,cy:a+u/2,hwidth:s/2,hheight:u/2}}}])}();var ds=function(){return(0,s.Z)((function t(e){(0,o.Z)(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Ai,this.page=new Ai,this.canvas=new Ai,this.viewport=new Ai,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}),[{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(Ni)}}])}(),fs=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).client=new Ai,t.movement=new Ai,t.offset=new Ai,t.global=new Ai,t.screen=new Ai,t}return(0,f.Z)(e,t),(0,s.Z)(e,[{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(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw new Error(Ni)}}])}(ds),ps=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).width=0,t.height=0,t.isPrimary=!1,t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(fs),gs=function(t){function e(){return(0,o.Z)(this,e),d(this,e,arguments)}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(fs),ms=function(t){function e(t,n){var i;return(0,o.Z)(this,e),(i=d(this,e,[null])).type=t,i.detail=n,Object.assign(i,n),i}return(0,f.Z)(e,t),(0,s.Z)(e)}(ds),vs=new WeakMap,ys=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.emitter=new g}),[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var i=!1,r=!1;if(tn(n))i=n;else if(n){var a=n.capture;i=void 0!==a&&a;var o=n.once;r=void 0!==o&&o}i&&(t+="capture"),e=(0,en.Z)(e)?e:e.handleEvent;var s=(0,en.Z)(e)?void 0:e;return r?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var i;if(!this.emitter)return this;(tn(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=(0,en.Z)(e)?e:null===(i=e)||void 0===i?void 0:i.handleEvent;var r=(0,en.Z)(e)?void 0:e;return this.emitter.off(t,e,r),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new ms(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=vs.get(this);i||(i=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&vs.set(this,i);if(i){if(t.manager=i.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),xs=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"textContent",get:function(){var t="";this.nodeName===pi.TEXT&&(t+=this.style.text);var e,n=ci(this.childNodes);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.nodeName===pi.TEXT?t+=i.nodeValue:t+=i.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===pi.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw new Error(Ni)}},{key:"lookupNamespaceURI",value:function(t){throw new Error(Ni)}},{key:"lookupPrefix",value:function(t){throw new Error(Ni)}},{key:"normalize",value:function(){throw new Error(Ni)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{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(t){if(t===this)return 0;for(var n=t,i=this,r=[n],a=[i];null!==(o=n.parentNode)&&void 0!==o?o:i.parentNode;){var o;n=n.parentNode?(r.push(n.parentNode),n.parentNode):n,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i}if(n!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=r.length>a.length?r:a,l=s===r?a:r;if(s[s.length-l.length]===l[0])return s===r?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var u=s.length-l.length,c=l.length-1;c>=0;c--){var h=l[c],d=s[u+c];if(d!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(d)?l===r?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===r?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var i=n.childNodes.length-1;i>=0;i--)e.push(n.childNodes[i])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(ys);xs.DOCUMENT_POSITION_DISCONNECTED=1,xs.DOCUMENT_POSITION_PRECEDING=2,xs.DOCUMENT_POSITION_FOLLOWING=4,xs.DOCUMENT_POSITION_CONTAINS=8,xs.DOCUMENT_POSITION_CONTAINED_BY=16,xs.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var bs=function(){return(0,s.Z)((function t(e,n){var i=this;(0,o.Z)(this,t),this.emitter=new g,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=U(),this.tmpVec3=y(),this.onPointerDown=function(t){var e=i.createPointerEvent(t);if(i.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)i.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var n=2===e.button;i.dispatchEvent(e,n?"rightdown":"mousedown")}i.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),i.freeEvent(e)},this.onPointerUp=function(t){var e=Mo.now(),n=i.createPointerEvent(t,void 0,void 0,i.context.config.alwaysTriggerPointerEventOnCanvas?i.rootTarget:void 0);if(i.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)i.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){var r=2===n.button;i.dispatchEvent(n,r?"rightup":"mouseup")}var a=i.trackingData(t.pointerId),o=i.findMountedTarget(a.pressTargetsByButton[t.button]),s=o;if(o&&!n.composedPath().includes(o)){for(var l=o;l&&!n.composedPath().includes(l);){if(n.currentTarget=l,i.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)i.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){var u=2===n.button;i.notifyTarget(n,u?"rightupoutside":"mouseupoutside")}xs.isNode(l)&&(l=l.parentNode)}delete a.pressTargetsByButton[t.button],s=l}if(s){var c,h=i.clonePointerEvent(n,"click");h.target=s,h.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:h.target,timeStamp:e});var d=i.context.renderingContext.root.ownerDocument.defaultView,f=a.clicksByButton[t.button];f.target===h.target&&e-f.timeStamp<d.dblClickSpeed?++f.clickCount:f.clickCount=1,f.target=h.target,f.timeStamp=e,h.detail=f.clickCount,null!==(c=n.detail)&&void 0!==c&&c.preventClick||(i.context.config.useNativeClickEvent||"mouse"!==h.pointerType&&"touch"!==h.pointerType||i.dispatchEvent(h,"click"),i.dispatchEvent(h,"pointertap")),i.freeEvent(h)}i.freeEvent(n)},this.onPointerMove=function(t){var e=i.createPointerEvent(t,void 0,void 0,i.context.config.alwaysTriggerPointerEventOnCanvas?i.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,r=i.trackingData(t.pointerId),a=i.findMountedTarget(r.overTargets);if(r.overTargets&&a!==e.target){var o="mousemove"===t.type?"mouseout":"pointerout",s=i.createPointerEvent(t,o,a||void 0);if(i.dispatchEvent(s,"pointerout"),n&&i.dispatchEvent(s,"mouseout"),!e.composedPath().includes(a)){var l=i.createPointerEvent(t,"pointerleave",a||void 0);for(l.eventPhase=l.AT_TARGET;l.target&&!e.composedPath().includes(l.target);)l.currentTarget=l.target,i.notifyTarget(l),n&&i.notifyTarget(l,"mouseleave"),xs.isNode(l.target)&&(l.target=l.target.parentNode);i.freeEvent(l)}i.freeEvent(s)}if(a!==e.target){var u="mousemove"===t.type?"mouseover":"pointerover",c=i.clonePointerEvent(e,u);i.dispatchEvent(c,"pointerover"),n&&i.dispatchEvent(c,"mouseover");for(var h=a&&xs.isNode(a)&&a.parentNode;h&&h!==(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode)&&h!==e.target;)h=h.parentNode;if(!h||h===(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode)){var d=i.clonePointerEvent(e,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==a&&d.target!==(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode);)d.currentTarget=d.target,i.notifyTarget(d),n&&i.notifyTarget(d,"mouseenter"),xs.isNode(d.target)&&(d.target=d.target.parentNode);i.freeEvent(d)}i.freeEvent(c)}i.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&i.dispatchEvent(e,"touchmove"),n&&(i.dispatchEvent(e,"mousemove"),i.cursor=i.getCursor(e.target)),r.overTargets=e.composedPath(),i.freeEvent(e)},this.onPointerOut=function(t){var e=i.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,r=i.findMountedTarget(e.overTargets),a=i.createPointerEvent(t,"pointerout",r||void 0);i.dispatchEvent(a),n&&i.dispatchEvent(a,"mouseout");var o=i.createPointerEvent(t,"pointerleave",r||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode);)o.currentTarget=o.target,i.notifyTarget(o),n&&i.notifyTarget(o,"mouseleave"),xs.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,i.freeEvent(a),i.freeEvent(o)}i.cursor=null},this.onPointerOver=function(t){var e=i.trackingData(t.pointerId),n=i.createPointerEvent(t),r="mouse"===n.pointerType||"pen"===n.pointerType;i.dispatchEvent(n,"pointerover"),r&&i.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(i.cursor=i.getCursor(n.target));var a=i.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(xs.isNode(i.rootTarget)&&i.rootTarget.parentNode);)a.currentTarget=a.target,i.notifyTarget(a),r&&i.notifyTarget(a,"mouseenter"),xs.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),i.freeEvent(n),i.freeEvent(a)},this.onPointerUpOutside=function(t){var e=i.trackingData(t.pointerId),n=i.findMountedTarget(e.pressTargetsByButton[t.button]),r=i.createPointerEvent(t);if(n){for(var a=n;a;)r.currentTarget=a,i.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType||"mouse"!==r.pointerType&&"pen"!==r.pointerType||i.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),xs.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}i.freeEvent(r)},this.onWheel=function(t){var e=i.createWheelEvent(t);i.dispatchEvent(e),i.freeEvent(e)},this.onClick=function(t){if(i.context.config.useNativeClickEvent){var e=i.createPointerEvent(t);i.dispatchEvent(e),i.freeEvent(e)}},this.onPointerCancel=function(t){var e=i.createPointerEvent(t,void 0,void 0,i.context.config.alwaysTriggerPointerEventOnCanvas?i.rootTarget:void 0);i.dispatchEvent(e),i.freeEvent(e)},this.globalRuntime=e,this.context=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.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,i=this.context.contextService.getDomElement();if(i&&t){var r=i.offsetWidth,a=i.offsetHeight;r&&a&&(e=t.width/r,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.scaleX,i=e.scaleY,r=e.bbox;return new Ai((t.x-((null==r?void 0:r.left)||0))/n,(t.y-((null==r?void 0:r.top)||0))/i)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.scaleX,i=e.scaleY,r=e.bbox;return new Ai((t.x+((null==r?void 0:r.left)||0))*n,(t.y+((null==r?void 0:r.top)||0))*i)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,i=this.rootTarget.defaultView.getCamera(),r=this.context.config,a=r.width,o=r.height,s=i.getPerspectiveInverse(),l=i.getWorldTransform(),u=Q(this.tmpMatrix,l,s),c=w(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return L(c,c,u),new Ai(c[0],c[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),i=e.getViewTransform(),r=Q(this.tmpMatrix,n,i),a=w(this.tmpVec3,t.x,t.y,0);L(this.tmpVec3,this.tmpVec3,r);var o=this.context.config,s=o.width,l=o.height;return new Ai((a[0]+1)/2*s,(1-(a[1]+1)/2)*l)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,i=e.length;n<i;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var i=this.rootTarget.defaultView||null;t.currentTarget=i,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e);this.emitter.emit(e||t.type,t)}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=n.length-1;i>=1;i--)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var r=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=r+1;a<n.length;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var i=0;i<2048&&t!==this.rootTarget;i++)xs.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,i=this.context.config,r=i.width,a=i.height,o=i.disableHitTesting;return e<0||n<0||e>r||n>a?null:!o&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,i=null==e?void 0:e.target;if(null!==(n=i)&&void 0!==n&&n.shadowRoot&&(i=e.composedPath()[0]),i){if(i===t)return!0;if(t&&t.contains)return t.contains(i)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();e<n.length;e++){var i=n[e],r=this.nativeHTMLMap.get(i);if(r)return r}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,i){var r=this.allocateEvent(ps);this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t;var a=this.getExistedHTML(r),o=this.context.contextService.getDomElement();return r.target=null!=n?n:a||this.isNativeEventFromCanvas(o,r.nativeEvent)&&this.pickTarget(r)||i,"string"==typeof e&&(r.type=e),r}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(gs);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),i=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(i,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(gs);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(ps);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=Mo.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type;var i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,i=n._events[e];if(i)if("fn"in i)i.once&&n.removeListener(e,i.fn,void 0,!0),i.fn.call(t.currentTarget||i.context,t);else for(var r=0;r<i.length&&!t.propagationImmediatelyStopped;r++)i[r].once&&n.removeListener(e,i[r].fn,void 0,!0),i[r].fn.call(t.currentTarget||i[r].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var i=t[n];if(!(i===this.rootTarget||xs.isNode(i)&&i.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=_o(e)&&e.getAttribute("cursor");if(n)return n;e=xs.isNode(e)&&e.parentNode}}}])}(),_s=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||ol.offscreenCanvas)this.canvas=t||ol.offscreenCanvas,this.context=this.canvas.getContext("2d",(0,a.Z)({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",(0,a.Z)({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",(0,a.Z)({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Es=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),ws=function(){return(0,s.Z)((function t(e,n){(0,o.Z)(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Uo,initAsync:new Go,dirtycheck:new Ho,cull:new Ho,beginFrame:new Uo,beforeRender:new Uo,render:new Uo,afterRender:new Uo,endFrame:new Uo,destroy:new Uo,pick:new jo,pickSync:new Ho,pointerDown:new Uo,pointerUp:new Uo,pointerMove:new Uo,pointerOut:new Uo,pointerOver:new Uo,pointerWheel:new Uo,pointerCancel:new Uo,click:new Uo},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=(0,a.Z)((0,a.Z)({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Es.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var i=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited){r.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===r.renderReasons.size&&r.renderReasons.has(Es.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&a);o&&this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(e),o&&r.renderListCurrentFrame.forEach((function(t){i.hooks.beforeRender.call(t),i.hooks.render.call(t),i.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),r.renderListCurrentFrame=[],r.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var i=this,r=e.renderer.getConfig(),a=r.enableDirtyCheck,o=r.enableCulling;function s(t){var e=t.renderable,r=t.sortable,s=a?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var l=o?i.hooks.cull.call(s,i.context.camera):s;l&&(i.stats.rendered+=1,n.renderListCurrentFrame.push(l))}e.dirty=!1,r.renderOrder=i.zIndexCounter,i.zIndexCounter+=1,i.stats.total+=1,r.dirty&&(i.sort(t,r),r.dirty=!1,r.dirtyChildren=[],r.dirtyReason=void 0)}for(var l=[t];l.length>0;){var u=l.pop();s(u);for(var c=u.sortable.sorted||u.childNodes,h=c.length-1;h>=0;h--)l.push(c[h])}}},{key:"sort",value:function(t,e){e.sorted&&e.dirtyReason!==nr.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var i=e.sorted.indexOf(n);i>=0&&e.sorted.splice(i,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var r=function(t,e){for(var n=0,i=t.length;n<i;){var r=n+i>>>1;Eo(t[r],e)<0?n=r+1:i=r}return n}(e.sorted,n);e.sorted.splice(r,0,n)}})):e.sorted=t.childNodes.slice().sort(Eo)}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Es.DISPLAY_OBJECT_CHANGED)}}])}(),Ts=/\[\s*(.*)=(.*)\s*\]/,Ss=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var i=this.getAttribute(t),r=i.name,a=i.value;return r?e.find((function(t){return e!==t&&("name"===r?t.name===a:n.attributeToString(t,r)===a)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(i){return e!==i&&((null==i?void 0:i.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(i){return e!==i&&i.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var i=this.getAttribute(t),r=i.name,a=i.value;return r?e.findAll((function(t){return e!==t&&("name"===r?t.name===a:n.attributeToString(t,r)===a)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),i=n.name,r=n.value;return"name"===i?e.name===r:this.attributeToString(e,i)===r}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(Ts),n="",i="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),i=e[2].replace(/"/g,"")),{name:n,value:i}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return(0,le.Z)(n)?"":n.toString?n.toString():""}}])}(),Ms=function(t){return t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),Cs=function(t){function e(t,n,i,r,a,s,l,u){var c;return(0,o.Z)(this,e),(c=d(this,e,[null])).relatedNode=n,c.prevValue=i,c.newValue=r,c.attrName=a,c.attrChange=s,c.prevParsedValue=l,c.newParsedValue=u,c.type=t,c}return(0,f.Z)(e,t),(0,s.Z)(e)}(ds);function As(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}Cs.ADDITION=2,Cs.MODIFICATION=1,Cs.REMOVAL=3;var Os,Ns,Ps,Ls,Rs,Ds,ks=new Cs(Ms.REPARENT,null,"","","",0,"",""),Is=ie(),Bs=y(),Fs=_(1,1,1),zs=U(),Gs=ie(),js=y(),Us=U(),Hs=Gt(),Vs=y(),Zs=Gt(),Ws=y(),Xs=y(),Ys=y(),qs=U(),$s=Gt(),Ks=Gt(),Qs=Gt(),Js={affectChildren:!0},tl=function(){return(0,s.Z)((function t(e){(0,o.Z)(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new ms(Ms.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var i,r=!1;t.parentNode&&(r=t.parentNode!==e,this.detach(t));var a=t.nodeName===pi.FRAGMENT,o=Co(e);t.parentNode=e;var s=a?t.childNodes:[t];(0,oe.Z)(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var l=e.sortable;if((null!=l&&null!==(i=l.sorted)&&void 0!==i&&i.length||t.parsedStyle.zIndex)&&(-1===l.dirtyChildren.indexOf(t)&&l.dirtyChildren.push(t),l.dirty=!0,l.dirtyReason=nr.ADDED),!o){if(a)this.dirtifyFragment(t);else{var u=t.transformable;u&&this.dirtifyWorld(t,u)}r&&t.dispatchEvent(ks)}}},{key:"detach",value:function(t){if(t.parentNode){var e,n,i=t.transformable,r=t.parentNode.sortable;(null!=r&&null!==(e=r.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===r.dirtyChildren.indexOf(t)&&r.dirtyChildren.push(t),r.dirty=!0,r.dirtyReason=nr.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(t,i),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=[e,n,i]);var r=t.transformable;if(e[0]!==r.origin[0]||e[1]!==r.origin[1]||e[2]!==r.origin[2]){var a=r.origin;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,this.dirtifyLocal(t,r)}}},{key:"rotate",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=_(e,n,i));var r=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=Hs;Zt(a,e[0],e[1],e[2]);var o=this.getRotation(t),s=this.getRotation(t.parentNode);Jt(Qs,s),Vt(Qs,Qs),Ut(a,Qs,a),Ut(r.localRotation,a,o),ne(r.localRotation,r.localRotation),this.dirtifyLocal(t,r)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=_(e,n,i));var r=t.transformable;Zt(Ks,e[0],e[1],e[2]),ee(r.localRotation,r.localRotation,Ks),this.dirtifyLocal(t,r)}},{key:"setEulerAngles",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=_(e,n,i));var r=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Zt(r.localRotation,e[0],e[1],e[2]);var a=this.getRotation(t.parentNode);Jt($s,Vt(Hs,a)),ee(r.localRotation,r.localRotation,$s),this.dirtifyLocal(t,r)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];"number"==typeof e&&(e=_(e,n,i));var a=t.transformable;Zt(a.localRotation,e[0],e[1],e[2]),r&&this.dirtifyLocal(t,a)}},{key:"translateLocal",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=_(e,n,i));var r=t.transformable;D(e,Bs)||(R(e,e,r.localRotation),T(r.localPosition,r.localPosition,e),this.dirtifyLocal(t,r))}},{key:"setPosition",value:function(t,e){var n,i=t.transformable;if(Ys[0]=e[0],Ys[1]=e[1],Ys[2]=null!==(n=e[2])&&void 0!==n?n:0,!D(this.getPosition(t),Ys)){if(E(i.position,Ys),null!==t.parentNode&&t.parentNode.transformable){var r=t.parentNode.transformable;V(qs,r.worldTransform),q(qs,qs),L(i.localPosition,Ys,qs)}else E(i.localPosition,Ys);this.dirtifyLocal(t,i)}}},{key:"setLocalPosition",value:function(t,e){var n,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.transformable;Xs[0]=e[0],Xs[1]=e[1],Xs[2]=null!==(n=e[2])&&void 0!==n?n:0,D(r.localPosition,Xs)||(E(r.localPosition,Xs),i&&this.dirtifyLocal(t,r))}},{key:"scaleLocal",value:function(t,e){var n,i=t.transformable;M(i.localScale,i.localScale,w(js,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1)),this.dirtifyLocal(t,i)}},{key:"setLocalScale",value:function(t,e){var n,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.transformable;w(js,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:r.localScale[2]),D(js,r.localScale)||(E(r.localScale,js),i&&this.dirtifyLocal(t,r))}},{key:"translate",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=w(js,e,n,i)),D(e,Bs)||(T(js,this.getPosition(t),e),this.setPosition(t,js))}},{key:"setRotation",value:function(t,e,n,i,r){var a=t.transformable;if("number"==typeof e&&(e=Qt(e,n,i,r)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);Jt(Hs,o),Vt(Hs,Hs),Ut(a.localRotation,Hs,e),ne(a.localRotation,a.localRotation),this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,i,r){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];"number"==typeof e&&(e=te(Hs,e,n,i,r));var o=t.transformable;Jt(o.localRotation,e),a&&this.dirtifyLocal(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];"number"==typeof e&&(e=ae(Gs,e,n));var r=t.transformable;re(r.localSkew,e),i&&this.dirtifyLocal(t,r)}},{key:"dirtifyLocal",value:function(t,e){Co(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var i=t.childNodes.length,r=0;r<i;r++)this.dirtifyFragment(t.childNodes[r]);t.nodeName===pi.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,e=new Set,n=function(n,i){n.isConnected&&!e.has(n)&&n.nodeName!==pi.FRAGMENT&&(t.boundsChangedEvent.detail=i,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n))};this.pendingEvents.forEach((function(t,e){e.nodeName!==pi.FRAGMENT&&(Js.affectChildren=t,t?e.forEach((function(t){n(t,Js)})):n(e,Js))})),e.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)As(n),n=n.parentNode;e&&t.forEach((function(t){As(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value:function(t,e,n,i){if(e&&e!==n){var r=this.displayObjectDependencyMap.get(e);if(r&&r[t]){var a=r[t].indexOf(i);r[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(i)}}},{key:"informDependentDisplayObjects",value:function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new Cs(Ms.ATTR_MODIFIED,n,e,e,t,Cs.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return ft(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return gt(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return pt(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){vt(t.localTransform,t.localRotation,t.localPosition,_(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(X(Us),Us[4]=Math.tan(t.localSkew[0]),Us[1]=Math.tan(t.localSkew[1]),Q(t.localTransform,t.localTransform,Us));var e=vt(Us,te(Hs,0,0,0,1),w(js,1,1,1),t.localScale,t.origin);Q(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,i=t.localPosition,r=t.localRotation,a=t.localScale,o=t.origin,s=0!==i[0]||0!==i[1]||0!==i[2],l=1!==r[3]||0!==r[0]||0!==r[1]||0!==r[2],u=1!==a[0]||1!==a[1]||1!==a[2],c=0!==o[0]||0!==o[1]||0!==o[2];l||u||c?vt(n,r,i,a,o):s?at(n,i):X(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=ft(Vs,e),i=gt(Zs,e),r=pt(Ws,e);this.setLocalScale(t,r,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,i,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,Fs,!1),this.setLocalPosition(t,Bs,!1),this.setLocalEulerAngles(t,Bs,void 0,void 0,!1),this.setLocalSkew(t,Is,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=this.getGeometryBounds(t,e);if(!Ti.isEmpty(i)){var r=n||new Ti;return r.setFromTransformedAABB(i,this.getWorldTransform(t)),r}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t,i=n.geometry;i.dirty&&ol.styleValueRegistry.updateGeometry(t);var r=e?i.renderBounds:i.contentBounds||null;return r||new Ti}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t,r=i.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var a=n?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,n,a),s=t.childNodes;if(s.forEach((function(t){var i=e.getBounds(t,n);i&&(o?o.add(i):(o=a||new Ti).update(i.center,i.halfExtents))})),o||(o=new Ti),n){var l=wo(t);if(l){var u=l.parsedStyle.clipPath.getBounds(n);o?u&&(o=u.intersection(o)):o.update(u.center,u.halfExtents)}}return n?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=zs;t.parentNode.transformable&&(e=q(Us,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ti.isEmpty(n)){var i=new Ti;return i.setFromTransformedAABB(n,e),i}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,i=this.getGeometryBounds(t);Ti.isEmpty(i)||(n=new Ti).setFromTransformedAABB(i,this.getWorldTransform(t));var r=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=n.getMin(),o=(0,p.Z)(a,2),s=o[0],l=o[1],u=n.getMax(),c=(0,p.Z)(u,2),h=c[0],d=c[1];return new Oi(s+((null==r?void 0:r.left)||0),l+((null==r?void 0:r.top)||0),h-s,d-l)}return new Oi((null==r?void 0:r.left)||0,(null==r?void 0:r.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var i=t.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,i=0;i<n.length;i++)this.syncHierarchy(n[i])}}},{key:"sync",value:function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,i=n&&n.transformable;null!==n&&i?Q(e.worldTransform,i.worldTransform,e.localTransform):V(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}}}])}(),el={MetricsString:"|ÉqÅ",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]},nl=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,il=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),rl=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),al=function(){return(0,s.Z)((function t(e){var n=this;(0,o.Z)(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!rl.exec(e)&&!il.exec(t))},this.trimByKinsokuShorui=function(t){var e=(0,l.Z)(t),n=e[e.length-2];if(!n)return t;var i=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=i+e[e.length-1],e},this.runtime=e}),[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},i=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),r=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});r.font=t;var a=el.MetricsString+el.BaselineSymbol,o=Math.ceil(r.measureText(a).width),s=Math.ceil(r.measureText(el.BaselineSymbol).width),l=el.HeightMultiplier*s;s=s*el.BaselineMultiplier|0,i.width=o,i.height=l,r.fillStyle="#f00",r.fillRect(0,0,o,l),r.font=t,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(a,0,s);var u=r.getImageData(0,0,o||1,l||1).data,c=u.length,h=4*o,d=0,f=0,p=!1;for(d=0;d<s;++d){for(var g=0;g<h;g+=4)if(255!==u[f+g]){p=!0;break}if(p)break;f+=h}for(n.ascent=s-d,f=c-h,p=!1,d=l;d>s;--d){for(var m=0;m<h;m+=4)if(255!==u[f+m]){p=!0;break}if(p)break;f-=h}return n.descent=d-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var i=e.fontSize,r=void 0===i?16:i,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,l=e.lineWidth,u=void 0===l?1:l,c=e.textBaseline,h=void 0===c?"alphabetic":c,d=e.textAlign,f=void 0===d?"start":d,p=e.letterSpacing,g=void 0===p?0:p,m=e.textPath;e.textPathSide,e.textPathStartOffset;var v=e.leading,y=void 0===v?0:v,x=function(t){for(var e=t.fontSize,n=void 0===e?16:e,i=t.fontFamily,r=void 0===i?"sans-serif":i,a=t.fontStyle,o=void 0===a?"normal":a,s=t.fontVariant,l=void 0===s?"normal":s,u=t.fontWeight,c=void 0===u?"normal":u,h=(0,oe.Z)(n)&&"".concat(n,"px")||"16px",d=r.split(","),f=d.length-1;f>=0;f--){var p=d[f].trim();!Zo.test(p)&&Vo.indexOf(p)<0&&(p='"'.concat(p,'"')),d[f]=p}return"".concat(o," ").concat(l," ").concat(c," ").concat(h," ").concat(d.join(","))}(e),b=this.measureFont(x,n);0===b.fontSize&&(b.fontSize=r,b.ascent=r);var _=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);_.font=x,e.isOverflowing=!1;var E=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),w=new Array(E.length),T=0;if(!m){for(var S=0;S<E.length;S++){var M=_.measureText(E[S]).width+(E[S].length-1)*g;w[S]=M,T=Math.max(T,M)}var C=T+u,A=s||b.fontSize+u,O=Math.max(A,b.fontSize+u)+(E.length-1)*(A+y),N=0;return"middle"===h?N=-O/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?N=-O:"top"!==h&&"hanging"!==h||(N=0),{font:x,width:C,height:O,lines:E,lineWidths:w,lineHeight:A+=y,maxLineWidth:T,fontProperties:b,lineMetrics:w.map((function(t,e){var n=0;return"center"===f||"middle"===f?n-=t/2:"right"!==f&&"end"!==f||(n-=t),new Oi(n-u/2,N+e*A,t+u,A)}))}}m.getTotalLength();for(var P=0;P<E.length;P++)_.measureText(E[P]).width,E[P].length}},{key:"wordWrap",value:function(t,e,n){var i=this,r=e.wordWrapWidth,a=void 0===r?0:r,o=e.letterSpacing,s=void 0===o?0:o,l=e.maxLines,u=void 0===l?1/0:l,c=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),d=a+s,f="";"ellipsis"===c?f="...":c&&"clip"!==c&&(f=c);var p=[],g=0,m=0,v={},y=function(t){return i.getFromCache(t,s,v,h)},x=Array.from(f).reduce((function(t,e){return t+y(e)}),0);function b(t){if(!(x<=0||x>d)){for(var e=p[t].length,n=0,i=e,r=0;r<e;r++){var a=y(p[t][r]);if(n+a+x>d){i=r;break}n+=a}p[t]=(p[t]||"").slice(0,i)+f}}for(var _=Array.from(t),E=0;E<_.length;E++){var w=_[E],T=t[E-1],S=t[E+1],M=y(w);if(this.isNewline(w)){if(++g>=u){e.isOverflowing=!0,E<_.length-1&&b(g-1);break}m=0,p[g]=""}else{if(m>0&&m+M>d){if(g+1>=u){e.isOverflowing=!0,b(g);break}if(g++,m=0,p[g]="",this.isBreakingSpace(w))continue;this.canBreakInLastChar(w)||(p=this.trimToBreakable(p),m=this.sumTextWidthByCache(p[g]||"",v)),this.shouldBreakByKinsokuShorui(w,S)&&(p=this.trimByKinsokuShorui(p),m+=y(T||""))}m+=M,p[g]=(p[g]||"")+w}}return p.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&el.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&el.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=(0,l.Z)(t),n=e[e.length-2],i=this.findBreakableIndex(n);if(-1===i||!n)return e;var r=n.slice(i,i+1),a=i+1,o=i+(this.isBreakingSpace(r)?0:1);return e[e.length-1]+=n.slice(a,n.length),e[e.length-2]=n.slice(0,o),e}},{key:"canBreakInLastChar",value:function(t){return!t||!nl.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!nl.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,i){var r=n[t];if("number"!=typeof r){var a=t.length*e;r=i.measureText(t).width+a,n[t]=r}return r}}])}(),ol={},sl=(Ns=new ls,Ps=new ss,Os={},(0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)(Os,pi.FRAGMENT,null),pi.CIRCLE,new is),pi.ELLIPSE,new rs),pi.RECT,Ns),pi.IMAGE,Ns),pi.GROUP,new cs),pi.LINE,new as),pi.TEXT,new us(ol)),pi.POLYLINE,Ps),pi.POLYGON,Ps),(0,an.Z)((0,an.Z)((0,an.Z)(Os,pi.PATH,new os),pi.HTML,new hs),pi.MESH,null)),ll=(Rs=new no,Ds=new ao,Ls={},(0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)(Ls,rr.PERCENTAGE,null),rr.NUMBER,new uo),rr.ANGLE,new to),rr.DEFINED_PATH,new eo),rr.PAINT,Rs),rr.COLOR,Rs),rr.FILTER,new io),rr.LENGTH,Ds),rr.LENGTH_PERCENTAGE,Ds),rr.LENGTH_PERCENTAGE_12,new oo),(0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)(Ls,rr.LENGTH_PERCENTAGE_14,new so),rr.COORDINATE,new ao),rr.OFFSET_DISTANCE,new co),rr.OPACITY_VALUE,new ho),rr.PATH,new fo),rr.LIST_OF_POINTS,new po),rr.SHADOW_BLUR,new go),rr.TEXT,new mo),rr.TEXT_TRANSFORM,new vo),rr.TRANSFORM,new ts),(0,an.Z)((0,an.Z)((0,an.Z)(Ls,rr.TRANSFORM_ORIGIN,new es),rr.Z_INDEX,new ns),rr.MARKER,new lo));ol.CameraContribution=tr,ol.AnimationTimeline=null,ol.EasingFunction=null,ol.offscreenCanvasCreator=new _s,ol.sceneGraphSelector=new Ss,ol.sceneGraphService=new tl(ol),ol.textService=new al(ol),ol.geometryUpdaterFactory=sl,ol.CSSPropertySyntaxFactory=ll,ol.styleValueRegistry=new Ka(ol),ol.layoutRegistry=null,ol.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},ol.enableStyleSyntax=!0,ol.enableSizeAttenuation=!1;var ul=0;var cl=new Cs(Ms.INSERTED,null,"","","",0,"",""),hl=new Cs(Ms.REMOVED,null,"","","",0,"",""),dl=new ms(Ms.DESTROY),fl=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).entity=ul++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:er.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!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]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{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 t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw new Error(Ni)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return ol.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Co(this)||t.nodeName!==pi.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(cl.relatedNode=this,t.dispatchEvent(cl)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e;return hl.relatedNode=this,t.dispatchEvent(hl),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),ol.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return ol.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return ol.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return ol.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return ol.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return ol.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return ol.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return ol.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(ol.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(i){return i===e||!t(i)||(n=i,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(i){i!==e&&t(i)&&n.push(i)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];i.forEach((function(n,i){var r;return null===(r=t.parentNode)||void 0===r?void 0:r.appendChild(n,e+i+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var a=i[0],o=i.slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,(0,l.Z)(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{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(){this.destroyChildren(),this.dispatchEvent(dl),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return ol.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return ol.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return ol.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return ol.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return ol.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(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,i){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw new Error(Ni)}},{key:"getAttributeNode",value:function(t){throw new Error(Ni)}},{key:"getAttributeNodeNS",value:function(t,e){throw new Error(Ni)}},{key:"hasAttributeNS",value:function(t,e){throw new Error(Ni)}},{key:"removeAttributeNS",value:function(t,e){throw new Error(Ni)}},{key:"removeAttributeNode",value:function(t){throw new Error(Ni)}},{key:"setAttributeNS",value:function(t,e,n){throw new Error(Ni)}},{key:"setAttributeNode",value:function(t){throw new Error(Ni)}},{key:"setAttributeNodeNS",value:function(t){throw new Error(Ni)}},{key:"toggleAttribute",value:function(t,e){throw new Error(Ni)}}])}(xs);function pl(t){return!(null==t||!t.nodeName)}var gl=ol.globalThis.Proxy?ol.globalThis.Proxy:function(){},ml=new Cs(Ms.ATTR_MODIFIED,null,null,null,null,Cs.MODIFICATION,null,null),vl=y(),yl=Gt(),xl=function(t){function e(t){var n;return(0,o.Z)(this,e),(n=d(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||pi.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),ol.enableStyleSyntax&&(n.style=new gl({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,i){return n.setAttribute(e,i),!0}})),n}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"destroy",value:function(){ln(e,"destroy",this,3)([]),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=(0,a.Z)({},this.attributes);for(var i in n){var r=n[i];pl(r)&&"clipPath"!==i&&"offsetPath"!==i&&"textPath"!==i&&(n[i]=r.cloneNode(t)),e&&(n[i]=e(i,r))}var o=new this.constructor((0,a.Z)((0,a.Z)({},this.config),{},{style:n}));return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o}},{key:"initAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={forceUpdateGeometry:!0};ol.styleValueRegistry.processProperties(this,t,e),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];Qe(n)||(i||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:r}),ln(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.renderable,r=this.attributes[t],a=this.parsedStyle[t];ol.styleValueRegistry.processProperties(this,(0,an.Z)({},t,e),n),i.dirty=!0;var o,s,l=this.parsedStyle[t];(this.isConnected&&(ml.relatedNode=this,ml.prevValue=r,ml.newValue=e,ml.attrName=t,ml.prevParsedValue=a,ml.newParsedValue=l,this.isMutationObserved?this.dispatchEvent(ml):(ml.target=this,this.ownerDocument.defaultView.dispatchEvent(ml,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(o=(s=this).attributeChangedCallback)||void 0===o||o.call(s,t,r,e,a,l))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=t.getMin(),n=(0,p.Z)(e,2),i=n[0],r=n[1],a=t.getMax(),o=(0,p.Z)(a,2),s=o[0],l=o[1];return new Oi(i,r,s-i,l-r)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ol.sceneGraphService.setOrigin(this,Di(t,e,n,!1)),this}},{key:"getOrigin",value:function(){return ol.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ol.sceneGraphService.setPosition(this,Di(t,e,n,!1)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ol.sceneGraphService.setLocalPosition(this,Di(t,e,n,!1)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ol.sceneGraphService.translate(this,Di(t,e,n,!1)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ol.sceneGraphService.translateLocal(this,Di(t,e,n,!1)),this}},{key:"getPosition",value:function(){return ol.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return ol.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=Di(t,e=e||t,n=n||t,!1)),ol.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=Di(t,e=e||t,n=n||t,!1)),ol.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return ol.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return ol.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var t=Gi(vl,ol.sceneGraphService.getWorldTransform(this));return Fi((0,p.Z)(t,3)[2])}},{key:"getLocalEulerAngles",value:function(){var t=Gi(vl,ol.sceneGraphService.getLocalRotation(this));return Fi((0,p.Z)(t,3)[2])}},{key:"setEulerAngles",value:function(t){return ol.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return ol.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return(0,le.Z)(e)&&(0,le.Z)(n)?ol.sceneGraphService.rotateLocal(this,0,0,t):ol.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return(0,le.Z)(e)&&(0,le.Z)(n)?ol.sceneGraphService.rotate(this,0,0,t):ol.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,i){return ol.sceneGraphService.setRotation(this,t,e,n,i),this}},{key:"setLocalRotation",value:function(t,e,n,i){return ol.sceneGraphService.setLocalRotation(this,t,e,n,i),this}},{key:"setLocalSkew",value:function(t,e){return ol.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return ol.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return ol.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return ol.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return ol.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return ol.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return ol.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){ol.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,i=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return i?i.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{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,l.Z)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,(0,l.Z)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var r=n[0],a=n[1];return r?(0,nn.Z)(r)?(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),this):2===n.length?(this.setAttribute(r,a),this):this.attributes[r]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=ft(vl,e),i=(0,p.Z)(n,2),r=i[0],a=i[1],o=pt(vl,e),s=(0,p.Z)(o,2),l=s[0],u=s[1],c=gt(yl,e),h=Gi(vl,c),d=(0,p.Z)(h,3),f=d[0],g=d[2];return ji(f||g,r,a,l,u)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=Ui(t),n=(0,p.Z)(e,5),i=n[0],r=n[1],a=n[2],o=n[3],s=n[4];this.setEulerAngles(s).setPosition(i,r).setLocalScale(a,o)}},{key:"setLocalMatrix",value:function(t){var e=Ui(t),n=(0,p.Z)(e,5),i=n[0],r=n[1],a=n[2],o=n[3],s=n[4];this.setLocalEulerAngles(s).setLocalPosition(i,r).setLocalScale(a,o)}},{key:"show",value:function(){this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){this.forEach((function(t){t.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(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(fl);xl.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 bl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.CIRCLE},t)])}return(0,f.Z)(e,t),(0,s.Z)(e)}(xl);bl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(xl.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var _l=["style"],El=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=(0,hi.Z)(n,_l);return(0,o.Z)(this,e),(t=d(this,e,[(0,a.Z)({style:i},r)])).isCustomElement=!0,t}return(0,f.Z)(e,t),(0,s.Z)(e)}(xl),wl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.ELLIPSE},t)])}return(0,f.Z)(e,t),(0,s.Z)(e)}(xl);wl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(xl.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var Tl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.GROUP},t)])}return(0,f.Z)(e,t),(0,s.Z)(e)}(xl);Tl.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Sl=["style"],Ml=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=(0,hi.Z)(n,Sl);return(0,o.Z)(this,e),(t=d(this,e,[(0,a.Z)({type:pi.HTML,style:i},r)])).cullable.enable=!1,t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=q(U(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ti.isEmpty(e)){var n=new Ti;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(xl);Ml.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(xl.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Cl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.IMAGE},t)])}return(0,f.Z)(e,t),(0,s.Z)(e)}(xl);Cl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(xl.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var Al=["style"],Ol=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=(0,hi.Z)(n,Al);(0,o.Z)(this,e),(t=d(this,e,[(0,a.Z)({type:pi.LINE,style:(0,a.Z)({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},r)])).markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,l=s.markerStart,u=s.markerEnd;return l&&pl(l)&&(t.markerStartAngle=l.getLocalEulerAngles(),t.appendChild(l)),u&&pl(u)&&(t.markerEndAngle=u.getLocalEulerAngles(),t.appendChild(u)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"attributeChangedCallback",value:function(t,e,n,i,r){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&pl(i)&&(this.markerStartAngle=0,i.remove()),r&&pl(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===t&&(i&&pl(i)&&(this.markerEndAngle=0,i.remove()),r&&pl(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,i=e.markerEnd,r=e.markerStartOffset,a=e.markerEndOffset,o=e.x1,s=e.x2,l=e.y1,u=e.y2,c=t?n:i;if(c&&pl(c)){var h,d,f,p,g,m,v;t?(p=o,g=l,d=s-o,f=u-l,m=r||0,v=this.markerStartAngle):(p=s,g=u,d=o-s,f=l-u,m=a||0,v=this.markerEndAngle),h=Math.atan2(f,d),c.setLocalEulerAngles(180*h/Math.PI+v),c.setLocalPosition(p+Math.cos(h)*m,g+Math.sin(h)*m)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,i=n.x1,r=n.y1,a=n.x2,o=n.y2,s=$n(i,r,a,o,t),l=s.x,u=s.y,c=L(y(),_(l,u,0),e?this.getWorldTransform():this.getLocalTransform());return new Ai(c[0],c[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return qn(t.x1,t.y1,t.x2,t.y2)}}])}(xl);Ol.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(xl.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Nl=["style"],Pl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=(0,hi.Z)(n,Nl);(0,o.Z)(this,e),(t=d(this,e,[(0,a.Z)({type:pi.PATH,style:i,initialParsedStyle:{miterLimit:4,d:(0,a.Z)({},ir)}},r)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,l=s.markerStart,u=s.markerEnd,c=s.markerMid;return l&&pl(l)&&(t.markerStartAngle=l.getLocalEulerAngles(),t.appendChild(l)),c&&pl(c)&&t.placeMarkerMid(c),u&&pl(u)&&(t.markerEndAngle=u.getLocalEulerAngles(),t.appendChild(u)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"attributeChangedCallback",value:function(t,e,n,i,r){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&pl(i)&&(this.markerStartAngle=0,i.remove()),r&&pl(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===t?(i&&pl(i)&&(this.markerEndAngle=0,i.remove()),r&&pl(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(r)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,i=e.markerEnd,r=e.markerStartOffset,a=e.markerEndOffset,o=t?n:i;if(o&&pl(o)){var s,l,u,c,h,d,f;if(t){var g=this.getStartTangent(),m=(0,p.Z)(g,2),v=m[0],y=m[1];c=y[0],h=y[1],l=v[0]-y[0],u=v[1]-y[1],d=r||0,f=this.markerStartAngle}else{var x=this.getEndTangent(),b=(0,p.Z)(x,2),_=b[0],E=b[1];c=E[0],h=E[1],l=_[0]-E[0],u=_[1]-E[1],d=a||0,f=this.markerEndAngle}s=Math.atan2(u,l),o.setLocalEulerAngles(180*s/Math.PI+f),o.setLocalPosition(c+Math.cos(s)*d,h+Math.sin(s)*d)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&pl(t))for(var n=1;n<e.length-1;n++){var i=(0,p.Z)(e[n].currentPoint,2),r=i[0],a=i[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(r,a)}}},{key:"getTotalLength",value:function(){return ha(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.d.absolutePath,i=rn(n,t),r=i.x,a=i.y,o=L(y(),_(r,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Ai(o[0],o[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*ha(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,i=t[1].currentPoint,r=t[1].startTangent;e=[],r?(e.push([n[0]-r[0],n[1]-r[1]]),e.push([n[0],n[1]])):(e.push([i[0],i[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var i=t[e-2].currentPoint,r=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([r[0]-a[0],r[1]-a[1]]),n.push([r[0],r[1]])):(n.push([i[0],i[1]]),n.push([r[0],r[1]]))}return n}}])}(xl);Pl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(xl.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Ll=["style"],Rl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=(0,hi.Z)(n,Ll);(0,o.Z)(this,e),(t=d(this,e,[(0,a.Z)({type:pi.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},r)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,l=s.markerStart,u=s.markerEnd,c=s.markerMid;return l&&pl(l)&&(t.markerStartAngle=l.getLocalEulerAngles(),t.appendChild(l)),c&&pl(c)&&t.placeMarkerMid(c),u&&pl(u)&&(t.markerEndAngle=u.getLocalEulerAngles(),t.appendChild(u)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"attributeChangedCallback",value:function(t,e,n,i,r){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&pl(i)&&(this.markerStartAngle=0,i.remove()),r&&pl(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===t?(i&&pl(i)&&(this.markerEndAngle=0,i.remove()),r&&pl(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(r)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,i=e.markerEnd,r=e.markerStartOffset,a=e.markerEndOffset,o=(e.points||{}).points,s=t?n:i;if(s&&pl(s)&&o){var l,u,c,h,d,f,p;if(h=o[0][0],d=o[0][1],t)u=o[1][0]-o[0][0],c=o[1][1]-o[0][1],f=r||0,p=this.markerStartAngle;else{var g=o.length;this.parsedStyle.isClosed?(u=o[g-1][0]-o[0][0],c=o[g-1][1]-o[0][1]):(h=o[g-1][0],d=o[g-1][1],u=o[g-2][0]-o[g-1][0],c=o[g-2][1]-o[g-1][1]),f=a||0,p=this.markerEndAngle}l=Math.atan2(c,u),s.setLocalEulerAngles(180*l/Math.PI+p),s.setLocalPosition(h+Math.cos(l)*f,d+Math.sin(l)*f)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&pl(t)&&e)for(var n=1;n<(this.parsedStyle.isClosed?e.length:e.length-1);n++){var i=e[n][0],r=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,r)}}}])}(xl);Rl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(xl.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var Dl=["style"],kl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,i=(0,hi.Z)(t,Dl);return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i)])}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"getTotalLength",value:function(){return da(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var i,r,a=[],o=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((i=[0,0])[0]=o/s,r=qn(t[0],t[1],n[e+1][0],n[e+1][1]),o+=r,i[1]=o/s,a.push(i))})),this.parsedStyle.points.segments=a}var l=0,u=0;this.parsedStyle.points.segments.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(l=(t-e[0])/(e[1]-e[0]),u=n)}));var c=$n(n[u][0],n[u][1],n[u+1][0],n[u+1][1],l),h=c.x,d=c.y,f=L(y(),_(h,d,0),e?this.getWorldTransform():this.getLocalTransform());return new Ai(f[0],f[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(Rl);kl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(Rl.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var Il=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.RECT},t)])}return(0,f.Z)(e,t),(0,s.Z)(e)}(xl);Il.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(xl.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Bl=["style"],Fl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,i=(0,hi.Z)(t,Bl);return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.TEXT,style:(0,a.Z)({fill:"black"},n)},i)])}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(xl);Fl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(xl.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 zl=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.registry={},this.define(pi.CIRCLE,bl),this.define(pi.ELLIPSE,wl),this.define(pi.RECT,Il),this.define(pi.IMAGE,Cl),this.define(pi.LINE,Ol),this.define(pi.GROUP,Tl),this.define(pi.PATH,Pl),this.define(pi.POLYGON,Rl),this.define(pi.POLYLINE,kl),this.define(pi.TEXT,Fl),this.define(pi.HTML,Ml)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),Gl=function(t){function e(){var t;(0,o.Z)(this,e),(t=d(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new ol.AnimationTimeline(t)}catch(t){}var n={};return Ya.forEach((function(t){var e=t.n,i=t.inh,r=t.d;i&&r&&(n[e]=(0,en.Z)(r)?r(pi.GROUP):r)})),t.documentElement=new Tl({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return(0,f.Z)(e,t),(0,s.Z)(e,[{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(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Fl:Tl);var i=new n(e);return i.ownerDocument=this,i}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw new Error(Ni)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,i){var r=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:i}),a=[];return r.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,i=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!i||i&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),i=n.x,r=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(i<0||r<0||i>o||r>s)return null;var l=this.defaultView.viewport2Client({x:i,y:r}),u=l.x,c=l.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:i,viewportY:r,clientX:u,clientY:c},picked:[]}).picked;return h&&h[0]||this.documentElement}},{key:"elementFromPoint",value:(i=(0,li.Z)((0,si.Z)().mark((function t(e,n){var i,r,a,o,s,l,u,c,h,d,f;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,a=i.y,o=this.defaultView.getConfig(),s=o.width,l=o.height,!(r<0||a<0||r>s||a>l)){t.next=4;break}return t.abrupt("return",null);case 4:return u=this.defaultView.viewport2Client({x:r,y:a}),c=u.x,h=u.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:r,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return d=t.sent,f=d.picked,t.abrupt("return",f&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return i.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),i=n.x,r=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(i<0||r<0||i>o||r>s)return[];var l=this.defaultView.viewport2Client({x:i,y:r}),u=l.x,c=l.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:i,viewportY:r,clientX:u,clientY:c},picked:[]}).picked;return h[h.length-1]!==this.documentElement&&h.push(this.documentElement),h}},{key:"elementsFromPoint",value:(n=(0,li.Z)((0,si.Z)().mark((function t(e,n){var i,r,a,o,s,l,u,c,h,d,f;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,a=i.y,o=this.defaultView.getConfig(),s=o.width,l=o.height,!(r<0||a<0||r>s||a>l)){t.next=4;break}return t.abrupt("return",[]);case 4:return u=this.defaultView.viewport2Client({x:r,y:a}),c=u.x,h=u.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:r,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return d=t.sent,(f=d.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw new Error(Pi)}},{key:"insertBefore",value:function(t,e){throw new Error(Pi)}},{key:"removeChild",value:function(t,e){throw new Error(Pi)}},{key:"replaceChild",value:function(t,e,n){throw new Error(Pi)}},{key:"append",value:function(){throw new Error(Pi)}},{key:"prepend",value:function(){throw new Error(Pi)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,i}(xs),jl=function(){function t(e){(0,o.Z)(this,t),this.strategies=e}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=e.camera,i=e.renderingService,r=e.renderingContext,a=this.strategies;i.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===a.length?e.visible=r.unculledEntities.indexOf(t.entity)>-1:e.visible=a.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new ms(Ms.CULLED)),null)}return t})),i.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();jl.tag="Culling";var Ul=function(){function t(){var e=this;(0,o.Z)(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new ps(null),this.rootWheelEvent=new gs(null),this.onPointerMove=function(t){var n,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var r,a=ci(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=r.value,s=e.bootstrapEvent(e.rootPointerEvent,o,i,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,i,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=ci(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e.bootstrapEvent(e.rootPointerEvent,o,r,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=this;this.context=e;var i=e.renderingService,r=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),i.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),i.hooks.pointerDown.tap(t.tag,(function(t){if(!r.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,r);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var i,a=ci(e);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=n.bootstrapEvent(n.rootPointerEvent,o,r,t);n.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}})),i.hooks.pointerUp.tap(t.tag,(function(t){if(!r.supportsTouchEvents||"touch"!==t.pointerType){var e,i=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(i,t)?"":"outside",o=ci(n.normalizeToPointerEvent(t,r));try{for(o.s();!(e=o.n()).done;){var s=e.value,l=n.bootstrapEvent(n.rootPointerEvent,s,r,t);l.type+=a,n.context.eventService.mapEvent(l)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),i.hooks.pointerMove.tap(t.tag,this.onPointerMove),i.hooks.pointerOver.tap(t.tag,this.onPointerMove),i.hooks.pointerOut.tap(t.tag,this.onPointerMove),i.hooks.click.tap(t.tag,this.onClick),i.hooks.pointerCancel.tap(t.tag,(function(t){var e,i=ci(n.normalizeToPointerEvent(t,r));try{for(i.s();!(e=i.n()).done;){var a=e.value,o=n.bootstrapEvent(n.rootPointerEvent,a,r,t);n.context.eventService.mapEvent(o)}}catch(t){i.e(t)}finally{i.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(t,e,n,i){t.view=n,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);var r=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=r.x,o=r.y;t.viewport.x=a,t.viewport.y=o;var s=this.context.eventService.viewport2Canvas(t.viewport),l=s.x,u=s.y;return t.canvas.x=l,t.canvas.y=u,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=So[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),i=n.x,r=n.y;e.viewport.x=i,e.viewport.y=r;var a=this.context.eventService.viewport2Canvas(e.viewport),o=a.x,s=a.y;return e.canvas.x=o,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Mo.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}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var i=0;i<t.changedTouches.length;i++){var r=t.changedTouches[i];Qe(r.button)&&(r.button=0),Qe(r.buttons)&&(r.buttons=1),Qe(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),Qe(r.width)&&(r.width=r.radiusX||1),Qe(r.height)&&(r.height=r.radiusY||1),Qe(r.tiltX)&&(r.tiltX=0),Qe(r.tiltY)&&(r.tiltY=0),Qe(r.pointerType)&&(r.pointerType="touch"),Qe(r.pointerId)&&(r.pointerId=r.identifier||0),Qe(r.pressure)&&(r.pressure=r.force||.5),Qe(r.twist)&&(r.twist=0),Qe(r.tangentialPressure)&&(r.tangentialPressure=0),r.isNormalized=!0,r.type=t.type,n.push(r)}else if(e.isMouseEvent(t)){var a=t;Qe(a.isPrimary)&&(a.isPrimary=!0),Qe(a.width)&&(a.width=1),Qe(a.height)&&(a.height=1),Qe(a.tiltX)&&(a.tiltX=0),Qe(a.tiltY)&&(a.tiltY=0),Qe(a.pointerType)&&(a.pointerType="mouse"),Qe(a.pointerId)&&(a.pointerId=1),Qe(a.pressure)&&(a.pressure=.5),Qe(a.twist)&&(a.twist=0),Qe(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();Ul.tag="Event";var Hl=[pi.CIRCLE,pi.ELLIPSE,pi.IMAGE,pi.RECT,pi.LINE,pi.POLYLINE,pi.POLYGON,pi.TEXT,pi.PATH,pi.HTML],Vl=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"isVisible",value:function(t,e){var n,i=e.cullable;if(!i.enable)return!0;var r=e.getRenderBounds();if(Ti.isEmpty(r))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,r,o||Mi.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Mi.OUTSIDE,i.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,i){if(n===Mi.OUTSIDE||n===Mi.INSIDE)return n;for(var r=Mi.INSIDE,a=Hl.indexOf(t.nodeName)>-1,o=0,s=i.length;o<s;++o){var l=1<<o;if(0!=(n&l)&&(!a||4!==o&&5!==o)){var u=i[o],c=u.normal,h=u.distance;if(O(c,e.getPositiveFarPoint(i[o]))+h<0)return Mi.OUTSIDE;O(c,e.getNegativeFarPoint(i[o]))+h<0&&(r|=l)}}return r}}])}(),Zl=function(){function t(){(0,o.Z)(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return(0,s.Z)(t,[{key:"apply",value:function(e){var n,i=this,r=e.renderingService,a=e.renderingContext,o=e.rBushRoot,s=a.root.ownerDocument.defaultView;this.rBush=o;var l=function(t){t.target.renderable.dirty=!0,r.dirtify()},u=function(t){i.syncTasks.set(t.target,t.detail.affectChildren),r.dirtify()},c=function(t){var e=t.target;ol.enableSizeAttenuation&&ol.styleValueRegistry.updateSizeAttenuation(e,s.getCamera().getZoom())},h=function(t){var e=t.target,n=e.rBushNode;n.aabb&&i.rBush.remove(n.aabb),i.syncTasks.delete(e),ol.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(t.tag,(function(){s.addEventListener(Ms.MOUNTED,c),s.addEventListener(Ms.UNMOUNTED,h),s.addEventListener(Ms.ATTR_MODIFIED,l),s.addEventListener(Ms.BOUNDS_CHANGED,u)})),r.hooks.destroy.tap(t.tag,(function(){s.removeEventListener(Ms.MOUNTED,c),s.removeEventListener(Ms.UNMOUNTED,h),s.removeEventListener(Ms.ATTR_MODIFIED,l),s.removeEventListener(Ms.BOUNDS_CHANGED,u),i.syncTasks.clear()}));var d=null!==(n=ol.globalThis.requestIdleCallback)&&void 0!==n?n:Fo.bind(ol.globalThis);r.hooks.endFrame.tap(t.tag,(function(){i.isFirstTimeRendering?(i.isFirstTimeRendering=!1,i.syncing=!0,d((function(){i.syncRTree(!0),i.isFirstTimeRenderingFinished=!0}))):i.syncRTree()}))}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var i=t.getRenderBounds();if(i){var r=t.renderable;e&&(r.dirtyRenderBounds||(r.dirtyRenderBounds=new Ti),r.dirtyRenderBounds.update(i.center,i.halfExtents));var a=i.getMin(),o=(0,p.Z)(a,2),s=o[0],l=o[1],u=i.getMax(),c=(0,p.Z)(u,2),h=c[0],d=c[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=s,n.aabb.minY=l,n.aabb.maxX=h,n.aabb.maxY=d}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],i=new Set,r=function(r){if(!i.has(r)&&r.renderable){var a=t.syncNode(r,e);a&&(n.push(a),i.add(r))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(r);for(var n=e;n;)r(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();Zl.tag="Prepare";var Wl=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),Xl=new ms(Ms.MOUNTED),Yl=new ms(Ms.UNMOUNTED),ql=new ms(Wl.BEFORE_RENDER),$l=new ms(Wl.RERENDER),Kl=new ms(Wl.AFTER_RENDER),Ql=function(t){function e(t){var n;(0,o.Z)(this,e),(n=d(this,e)).Element=xl,n.inited=!1,n.context={},n.document=new Gl,n.document.defaultView=n,n.customElements=new zl;var i=t.container,r=t.canvas,a=t.offscreenCanvas,s=t.width,l=t.height,u=t.devicePixelRatio,c=t.renderer,h=t.background,f=t.cursor,p=t.document,g=t.requestAnimationFrame,m=t.cancelAnimationFrame,v=t.createImage,y=t.enableLargeImageOptimization,x=t.supportsPointerEvents,b=t.supportsTouchEvents,_=t.supportsCSSTransform,E=t.cleanUpOnDestroy,w=void 0===E||E,T=t.supportsMutipleCanvasesInOneContainer,S=t.useNativeClickEvent,M=t.alwaysTriggerPointerEventOnCanvas,C=t.isTouchEvent,A=t.isMouseEvent,O=t.dblClickSpeed;T||xo(i,n,w);var N=s,P=l,L=u;return r&&(L=(L=u||bo&&window.devicePixelRatio||1)>=1?Math.ceil(L):1,N=s||function(t){var e=To(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(r)||r.width/L,P=l||function(t){var e=To(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(r)||r.height/L),a&&(ol.offscreenCanvas=a),n.devicePixelRatio=L,n.requestAnimationFrame=null!=g?g:Fo.bind(ol.globalThis),n.cancelAnimationFrame=null!=m?m:zo.bind(ol.globalThis),n.supportsTouchEvents=null!=b?b:"ontouchstart"in ol.globalThis,n.supportsPointerEvents=null!=x?x:!!ol.globalThis.PointerEvent,n.isTouchEvent=null!=C?C:function(t){return n.supportsTouchEvents&&t instanceof ol.globalThis.TouchEvent},n.isMouseEvent=null!=A?A:function(t){return!ol.globalThis.MouseEvent||t instanceof ol.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof ol.globalThis.PointerEvent))},n.dblClickSpeed=null!=O?O:200,n.initRenderingContext({container:i,canvas:r,width:N,height:P,renderer:c,offscreenCanvas:a,devicePixelRatio:L,cursor:f||"default",background:h||"transparent",createImage:v,enableLargeImageOptimization:y,document:p,supportsCSSTransform:_,useNativeClickEvent:S,cleanUpOnDestroy:w,alwaysTriggerPointerEventOnCanvas:M}),n.initDefaultCamera(N,P,c.clipSpaceNearZ),n.initRenderer(c,!0),n}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var i=this,r=new ol.CameraContribution;r.clipSpaceNearZ=n,r.setType(qi.EXPLORING,$i.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),r.canvas=this,r.eventEmitter.on(Qi,(function(){i.context.renderingContext.renderReasons.add(Es.CAMERA_CHANGED),ol.enableSizeAttenuation&&i.getConfig().renderer.getConfig().enableSizeAttenuation&&i.updateSizeAttenuation()})),this.context.camera=r}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){ol.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{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 t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;e||this.dispatchEvent(new ms(Wl.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();t&&(this.unmountChildren(n),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new ms(Wl.AFTER_DESTROY));var i=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};i(Xl),i(Yl),i(ql),i($l),i(Kl),i(ml),i(cl),i(hl),i(dl)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var i=this.context.camera,r=i.getProjectionMode();i.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),r===Ki.ORTHOGRAPHIC?i.setOrthographic(t/-2,t/2,e/2,e/-2,i.getNear(),i.getFar()):i.setAspect(t/e),this.dispatchEvent(new ms(Wl.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(ql.detail=t,Kl.detail=t),this.dispatchEvent(ql),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent($l)})),this.dispatchEvent(Kl)}},{key:"run",value:function(){var t=this,e=function(n,i){t.render(i),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new fi,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Ul,new Zl,new jl([new Vl])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService((0,a.Z)((0,a.Z)({},ol),this.context)),this.context.renderingService=new ws(ol,this.context),this.context.eventService=new bs(ol,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,n)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?i?e.requestAnimationFrame((function(){e.dispatchEvent(new ms(Wl.READY))})):e.dispatchEvent(new ms(Wl.READY)):e.dispatchEvent(new ms(Wl.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(ol)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),(0,l.Z)((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(ol)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Yl):(Yl.target=t,this.dispatchEvent(Yl,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Co(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(Xl):(Xl.target=t,this.dispatchEvent(Xl,!0)))):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: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(ys),Jl=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).landmarks=[],t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=Li(e),this.relAzimuth=Li(t),this.relRoll=Li(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===qi.EXPLORING){var i=jt(Gt(),[1,0,0],Ii((this.rotateWorld?1:-1)*this.relElevation)),r=jt(Gt(),[0,1,0],Ii((this.rotateWorld?1:-1)*this.relAzimuth)),a=jt(Gt(),[0,0,1],Ii(this.relRoll)),o=Ut(Gt(),r,i);o=Ut(Gt(),o,a);var s=yt(U(),o);J(this.matrix,this.matrix,[0,0,-this.distance]),Q(this.matrix,this.matrix,s),J(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===qi.ORBITING||this.type===qi.EXPLORING?this._getPosition():this.type===qi.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=Di(t,e,0),i=x(this.position);return T(i,i,C(y(),this.right,n[0])),T(i,i,C(y(),this.up,n[1])),this._setPosition(i),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e=this.forward,n=x(this.position),i=this.dollyingStep,r=this.distance+t*this.dollyingStep;return i=Math.max(Math.min(r,this.maxDistance),this.minDistance)-this.distance,n[0]+=i*e[0],n[1]+=i*e[1],n[2]+=i*e[2],this._setPosition(n),this.type===qi.ORBITING||this.type===qi.EXPLORING?this._getDistance():this.type===qi.TRACKING&&T(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,i,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.position,s=void 0===o?this.position:o,l=a.focalPoint,u=void 0===l?this.focalPoint:l,c=a.roll,h=a.zoom,d=new ol.CameraContribution;d.setType(this.type,void 0),d.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),d.setFocalPoint(u[0],null!==(i=u[1])&&void 0!==i?i:this.focalPoint[1],null!==(r=u[2])&&void 0!==r?r:this.focalPoint[2]),d.setRoll(null!=c?c:this.roll),d.setZoom(null!=h?h:this.zoom);var f={name:t,matrix:H(d.getWorldTransform()),right:x(d.right),up:x(d.up),forward:x(d.forward),position:x(d.getPosition()),focalPoint:x(d.getFocalPoint()),distanceVector:x(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(f),f}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,ue.Z)(t)?this.landmarks.find((function(e){return e.name===t})):t;if(i){var r=(0,oe.Z)(n)?{duration:n}:n,a=r.easing,o=void 0===a?"linear":a,s=r.duration,l=void 0===s?100:s,u=r.easingFunction,c=void 0===u?void 0:u,h=r.onfinish,d=void 0===h?void 0:h,f=r.onframe,p=void 0===f?void 0:f,g=.01;this.cancelLandmarkAnimation();var m,v=i.position,x=i.focalPoint,b=i.zoom,_=i.roll,E=c||ol.EasingFunction(o),w=function(){e.setFocalPoint(x),e.setPosition(v),e.setRoll(_),e.setZoom(b),e.computeMatrix(),e.triggerUpdate(),null==d||d()};if(0===l)return w();var T=function(t){void 0===m&&(m=t);var n=t-m;if(n>=l)w();else{var i,r,a=E(n/l),o=y(),s=y();if(P(o,e.focalPoint,x,a),P(s,e.position,v,a),r=e.roll*(1-a)+_*a,i=e.zoom*(1-a)+b*a,e.setFocalPoint(o),e.setPosition(s),e.setRoll(r),e.setZoom(i),B(o,x)+B(s,v)<=g&&void 0===b&&void 0===_)return w();e.computeMatrix(),e.triggerUpdate(),n<l&&(null==p||p(a),e.landmarkAnimationID=e.canvas.requestAnimationFrame(T))}};this.canvas.requestAnimationFrame(T)}}}])}(tr);ol.CameraContribution=Jl;new WeakMap;var tu=function(t){function e(t,n,i,r){var a;return(0,o.Z)(this,e),(a=d(this,e,[t])).currentTime=i,a.timelineTime=r,a.target=n,a.type="finish",a.bubbles=!1,a.currentTarget=n,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=i,a.timelineTime=r,a}return(0,f.Z)(e,t),(0,s.Z)(e)}(ds),eu=0,nu=function(){return(0,s.Z)((function t(e,n){var i;(0,o.Z)(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(eu++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(i=this.effect)||void 0===i?void 0:i.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}),[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,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(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),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||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,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),-1===this.timeline.animations.indexOf(this)&&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._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,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 t=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 e=new tu(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}}},{key:"persist",value:function(){throw new Error(Ni)}},{key:"addEventListener",value:function(t,e,n){throw new Error(Ni)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(Ni)}},{key:"dispatchEvent",value:function(t){throw new Error(Ni)}},{key:"commitStyles",value:function(){throw new Error(Ni)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new tu(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var i=new tu(null,this,this.currentTime,t);this.onframe(i)}this._finishedFlag=!1}}}])}(),iu=.1,ru="function"==typeof Float32Array,au=function(t,e){return 1-3*e+3*t},ou=function(t,e){return 3*e-6*t},su=function(t){return 3*t},lu=function(t,e,n){return((au(e,n)*t+ou(e,n))*t+su(e))*t},uu=function(t,e,n){return 3*au(e,n)*t*t+2*ou(e,n)*t+su(e)},cu=function(t,e,n,i){if(!(t>=0&&t<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===i)return function(t){return t};for(var r=ru?new Float32Array(11):new Array(11),a=0;a<11;++a)r[a]=lu(a*iu,t,n);var o=function(e){for(var i=0,a=1;10!==a&&r[a]<=e;++a)i+=iu;--a;var o=i+(e-r[a])/(r[a+1]-r[a])*iu,s=uu(o,t,n);return s>=.001?function(t,e,n,i){for(var r=0;r<4;++r){var a=uu(e,n,i);if(0===a)return e;e-=(lu(e,n,i)-t)/a}return e}(e,o,t,n):0===s?o:function(t,e,n,i,r){var a,o,s=0;do{(a=lu(o=e+(n-e)/2,i,r)-t)>0?n=o:e=o}while(Math.abs(a)>1e-7&&++s<10);return o}(e,i,i+iu,t,n)};return function(t){return 0===t||1===t?t:lu(o(t),e,i)}},hu=function(t){return Math.pow(t,2)},du=function(t){return Math.pow(t,3)},fu=function(t){return Math.pow(t,4)},pu=function(t){return Math.pow(t,5)},gu=function(t){return Math.pow(t,6)},mu=function(t){return 1-Math.cos(t*Math.PI/2)},vu=function(t){return 1-Math.sqrt(1-t*t)},yu=function(t){return t*t*(3*t-2)},xu=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},bu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,p.Z)(e,2),i=n[0],r=void 0===i?1:i,a=n[1],o=void 0===a?.5:a,s=ce(Number(r),1,10),l=ce(Number(o),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-l/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/l)},_u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=(0,p.Z)(e,4),r=i[0],a=void 0===r?1:r,o=i[1],s=void 0===o?100:o,l=i[2],u=void 0===l?10:l,c=i[3],h=void 0===c?0:c;a=ce(a,.1,1e3),s=ce(s,.1,1e3),u=ce(u,.1,1e3),h=ce(h,.1,1e3);var d=Math.sqrt(s/a),f=u/(2*Math.sqrt(s*a)),g=f<1?d*Math.sqrt(1-f*f):0,m=1,v=f<1?(f*d-h)/g:-h+d,y=n?n*t/1e3:t;return y=f<1?Math.exp(-y*f*d)*(m*Math.cos(g*y)+v*Math.sin(g*y)):(m+v*y)*Math.exp(-y*d),0===t||1===t?t:1-y},Eu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e,i=(0,p.Z)(n,2),r=i[0],a=void 0===r?10:r,o=i[1],s="start"===o?Math.ceil:Math.floor;return s(ce(t,0,1)*a)/a},wu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,p.Z)(e,4),i=n[0],r=n[1],a=n[2],o=n[3];return cu(i,r,a,o)(t)},Tu=cu(.42,0,1,1),Su=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return 1-t(1-e,n,i)}},Mu=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,i)/2:1-t(-2*e+2,n,i)/2}},Cu=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,i))/2:(t(2*e-1,n,i)+1)/2}},Au={steps:Eu,"step-start":function(t){return Eu(t,[1,"start"])},"step-end":function(t){return Eu(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":wu,ease:function(t){return wu(t,[.25,.1,.25,1])},in:Tu,out:Su(Tu),"in-out":Mu(Tu),"out-in":Cu(Tu),"in-quad":hu,"out-quad":Su(hu),"in-out-quad":Mu(hu),"out-in-quad":Cu(hu),"in-cubic":du,"out-cubic":Su(du),"in-out-cubic":Mu(du),"out-in-cubic":Cu(du),"in-quart":fu,"out-quart":Su(fu),"in-out-quart":Mu(fu),"out-in-quart":Cu(fu),"in-quint":pu,"out-quint":Su(pu),"in-out-quint":Mu(pu),"out-in-quint":Cu(pu),"in-expo":gu,"out-expo":Su(gu),"in-out-expo":Mu(gu),"out-in-expo":Cu(gu),"in-sine":mu,"out-sine":Su(mu),"in-out-sine":Mu(mu),"out-in-sine":Cu(mu),"in-circ":vu,"out-circ":Su(vu),"in-out-circ":Mu(vu),"out-in-circ":Cu(vu),"in-back":yu,"out-back":Su(yu),"in-out-back":Mu(yu),"out-in-back":Cu(yu),"in-bounce":xu,"out-bounce":Su(xu),"in-out-bounce":Mu(xu),"out-in-bounce":Cu(xu),"in-elastic":bu,"out-elastic":Su(bu),"in-out-elastic":Mu(bu),"out-in-elastic":Cu(bu),spring:_u,"spring-in":_u,"spring-out":Su(_u),"spring-in-out":Mu(_u),"spring-out-in":Cu(_u)},Ou=function(t){return t};function Nu(t,e){return function(n){if(n>=1)return 1;var i=1/t;return(n+=e*i)-n%i}}var Pu="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Lu=new RegExp("cubic-bezier\\(".concat(Pu,",").concat(Pu,",").concat(Pu,",").concat(Pu,"\\)")),Ru=/steps\(\s*(\d+)\s*\)/,Du=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function ku(t){var e=Lu.exec(t);if(e)return cu.apply(void 0,(0,l.Z)(e.slice(1).map(Number)));var n=Ru.exec(t);if(n)return Nu(Number(n[1]),0);var i=Du.exec(t);return i?Nu(Number(i[1]),{start:1,middle:.5,end:0}[i[2]]):Au[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Au.linear}function Iu(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Bu(t,e,n){var i=function(t,e,n){if(null===e)return 0;var i=n.endTime;return e<Math.min(n.delay,i)?1:e>=Math.min(n.delay+t+n.endDelay,i)?2:3}(t,e,n),r=function(t,e,n,i,r){switch(i){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-r;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,i,n.delay);if(null===r)return null;var a="auto"===n.duration?0:n.duration,o=function(t,e,n,i,r){var a=r;return 0===t?1!==e&&(a+=n):a+=i/t,a}(a,i,n.iterations,r,n.iterationStart),s=function(t,e,n,i,r,a){var o=t===1/0?e%1:t%1;return 0!==o||2!==n||0===i||0===r&&0!==a||(o=1),o}(o,n.iterationStart,i,n.iterations,r,a),l=function(t,e,n,i){return 2===t&&e===1/0?1/0:1===n?Math.floor(i)-1:Math.floor(i)}(i,n.iterations,s,o),u=function(t,e,n){var i=t;if("normal"!==t&&"reverse"!==t){var r=e;"alternate-reverse"===t&&(r+=1),i="normal",r!==1/0&&r%2!=0&&(i="reverse")}return"normal"===i?n:1-n}(n.direction,l,s);return n.currentIteration=l,n.progress=u,n.easingFunction(u)}function Fu(t,e,n){var i=function(t,e){for(var n={},i=0;i<t.length;i++)for(var r in t[i])if(zu(r)){var a={offset:t[i].offset,computedOffset:t[i].computedOffset,easing:t[i].easing,easingFunction:ku(t[i].easing)||e.easingFunction,value:t[i][r]};n[r]=n[r]||[],n[r].push(a)}return n}(t,e),r=function(t,e){var n=[];for(var i in t)for(var r=t[i],a=0;a<r.length-1;a++){var o=a,s=a+1,l=r[o].computedOffset,u=r[s].computedOffset,c=l,h=u;0===a&&(c=-1/0,0===u&&(s=o)),a===r.length-2&&(h=1/0,1===l&&(o=s)),n.push({applyFrom:c,applyTo:h,startOffset:r[o].computedOffset,endOffset:r[s].computedOffset,easingFunction:r[o].easingFunction,property:i,interpolation:ju(i,r[o].value,r[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(i,n);return function(t,e){if(null!==e)r.filter((function(t){return e>=t.applyFrom&&e<t.applyTo})).forEach((function(n){var i=e-n.startOffset,r=n.endOffset-n.startOffset,a=0===r?0:i/r;t.setAttribute(n.property,n.interpolation(a),!1,!1)}));else for(var n in i)zu(n)&&t.setAttribute(n,null)}}function zu(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Gu=function(t,e,n){return function(i){var r=Uu(t,e,i);return(0,oe.Z)(r)?r:n(r)}};function ju(t,e,n,i){var r=$a[t];if(r&&r.syntax&&r.int){var a=ol.styleValueRegistry.getPropertySyntax(r.syntax);if(a){var o=a.parser,s=o?o(e,i):e,u=o?o(n,i):n,c=a.mixer(s,u,i);if(c){var h=Gu.apply(void 0,(0,l.Z)(c));return function(t){return 0===t?e:1===t?n:h(t)}}}}return Gu(!1,!0,(function(t){return t?n:e}))}function Uu(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var i=t.length,r=e.length,a=Math.max(i,r),o=[],s=0;s<a;s++)o.push(Uu(t[s<i?s:i-1],e[s<r?s:r-1],n));return o}throw new Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var Hu=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Ou,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}),[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=ku(t),this._easing=t}}])}();function Vu(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var i=t[n];Array.isArray(i)||(i=[i]);for(var r=i.length,a=0;a<r;a++){if(!e[a]){var o={};"offset"in t&&(o.offset=Number(t.offset)),"easing"in t&&(o.easing=t.easing),"composite"in t&&(o.composite=t.composite),e[a]=o}void 0!==i[a]&&null!==i[a]&&(e[a][n]=i[a])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var i in null!=e&&e.composite&&(n.composite="auto"),t){var r=t[i];if("offset"===i){if(null!==r){if(r=Number(r),!isFinite(r))throw new Error("Keyframe offsets must be numbers.");if(r<0||r>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===i&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error("".concat(r," compositing is not supported"));n[i]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),i=!0,r=-1/0,a=0;a<n.length;a++){var o=n[a].offset;if((0,le.Z)(o))i=!1;else{if(o<r)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}return n=n.filter((function(t){return Number(t.offset)>=0&&Number(t.offset)<=1})),i||function(){var t,e,i=n.length;n[i-1].computedOffset=Number(null!==(t=n[i-1].offset)&&void 0!==t?t:1),i>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var r=0,a=Number(n[0].computedOffset),o=1;o<i;o++){var s=n[o].computedOffset;if(!(0,le.Z)(s)&&!(0,le.Z)(a)){for(var l=1;l<o-r;l++)n[r+l].computedOffset=a+(Number(s)-a)*l/(o-r);r=o,a=Number(s)}}}(),n}var Zu="backwards|forwards|both|none".split("|"),Wu="reverse|alternate|alternate-reverse".split("|");function Xu(t,e){var n;return function(t,e){var n=new Hu;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Zu.indexOf(t[e]))return;if("direction"===e&&-1===Wu.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}var Yu=function(){return(0,s.Z)((function t(e,n,i){var r=this;(0,o.Z)(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=Xu(i,!1),this.timing.effect=this,this.timing.activeDuration=Iu(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Vu(n,this.timing),this.interpolations=Fu(this.normalizedKeyframes,this.timing,this.target);var a=ol.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}),[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=Bu(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=Vu(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))}}])}();function qu(t,e){return Number(t.id)-Number(e.id)}var $u=function(){return(0,s.Z)((function t(e){var n=this;(0,o.Z)(this,t),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(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],t<Number(n.currentTime)&&(t=Number(n.currentTime)),n.animations.sort(qu),n.animations=n.tick(t,!0,n.animations)[0],e.forEach((function(e){e[1](t)})),n.applyPendingEffects()},this.document=e}),[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var i=new Yu(t,e,n),r=new nu(i,this);return this.animations.push(r),this.restartWebAnimationsNextTick(),r.updatePromises(),r.play(),r.updatePromises(),r}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(qu),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,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(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))}},{key:"tick",value:function(t,e,n){var i,r,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var o=[],s=[],l=[],u=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(o.push(n.effect),n.unmarkTarget()),n._needsTick&&(a.ticking=!0);var i=n._inEffect||n._needsTick;n._inTimeline=i,i?l.push(n):u.push(n)})),(i=this.pendingEffects).push.apply(i,o),(r=this.pendingEffects).push.apply(r,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[l,u]}}])}();ol.EasingFunction=ku,ol.AnimationTimeline=$u;var Ku=function(t){return(0,le.Z)(t)?"":t.toString()},Qu=function(t){var e=Ku(t);return e.charAt(0).toUpperCase()+e.substring(1)},Ju=n(57594),tc=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},ec=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if((0,ue.Z)(t)||(0,ue.Z)(e))return!1;if(tc(t)||tc(e)){if(t.length!==e.length)return!1;for(var n=!0,i=0;i<t.length&&(n=ec(t[i],e[i]));i++);return n}if((0,Ju.Z)(t)||(0,Ju.Z)(e)){var r=Object.keys(t),a=Object.keys(e);if(r.length!==a.length)return!1;for(n=!0,i=0;i<r.length&&(n=ec(t[r[i]],e[r[i]]));i++);return n}return!1},nc=ec;const ic={duration:500},rc={duration:1e3,easing:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",iterations:1,fill:"both"};var ac,oc,sc,lc,uc,cc,hc,dc,fc,pc;!function(t){t.NodeAdded="NodeAdded",t.NodeUpdated="NodeUpdated",t.NodeRemoved="NodeRemoved",t.EdgeAdded="EdgeAdded",t.EdgeUpdated="EdgeUpdated",t.EdgeRemoved="EdgeRemoved",t.ComboAdded="ComboAdded",t.ComboUpdated="ComboUpdated",t.ComboRemoved="ComboRemoved"}(ac||(ac={})),function(t){t.DRAW="draw",t.COLLAPSE="collapse",t.EXPAND="expand",t.TRANSFORM="transform"}(oc||(oc={})),function(t){t.CLICK="canvas:click",t.DBLCLICK="canvas:dblclick",t.POINTER_OVER="canvas:pointerover",t.POINTER_LEAVE="canvas:pointerleave",t.POINTER_ENTER="canvas:pointerenter",t.POINTER_MOVE="canvas:pointermove",t.POINTER_OUT="canvas:pointerout",t.POINTER_DOWN="canvas:pointerdown",t.POINTER_UP="canvas:pointerup",t.CONTEXT_MENU="canvas:contextmenu",t.DRAG_START="canvas:dragstart",t.DRAG="canvas:drag",t.DRAG_END="canvas:dragend",t.DRAG_ENTER="canvas:dragenter",t.DRAG_OVER="canvas:dragover",t.DRAG_LEAVE="canvas:dragleave",t.DROP="canvas:drop",t.WHEEL="canvas:wheel"}(sc||(sc={})),function(t){t.CLICK="combo:click",t.DBLCLICK="combo:dblclick",t.POINTER_OVER="combo:pointerover",t.POINTER_LEAVE="combo:pointerleave",t.POINTER_ENTER="combo:pointerenter",t.POINTER_MOVE="combo:pointermove",t.POINTER_OUT="combo:pointerout",t.POINTER_DOWN="combo:pointerdown",t.POINTER_UP="combo:pointerup",t.CONTEXT_MENU="combo:contextmenu",t.DRAG_START="combo:dragstart",t.DRAG="combo:drag",t.DRAG_END="combo:dragend",t.DRAG_ENTER="combo:dragenter",t.DRAG_OVER="combo:dragover",t.DRAG_LEAVE="combo:dragleave",t.DROP="combo:drop"}(lc||(lc={})),function(t){t.CLICK="click",t.DBLCLICK="dblclick",t.POINTER_OVER="pointerover",t.POINTER_LEAVE="pointerleave",t.POINTER_ENTER="pointerenter",t.POINTER_MOVE="pointermove",t.POINTER_OUT="pointerout",t.POINTER_DOWN="pointerdown",t.POINTER_UP="pointerup",t.CONTEXT_MENU="contextmenu",t.DRAG_START="dragstart",t.DRAG="drag",t.DRAG_END="dragend",t.DRAG_ENTER="dragenter",t.DRAG_OVER="dragover",t.DRAG_LEAVE="dragleave",t.DROP="drop",t.KEY_DOWN="keydown",t.KEY_UP="keyup",t.WHEEL="wheel"}(uc||(uc={})),function(t){t.KEY_DOWN="keydown",t.KEY_UP="keyup"}(cc||(cc={})),function(t){t.CLICK="edge:click",t.DBLCLICK="edge:dblclick",t.POINTER_OVER="edge:pointerover",t.POINTER_LEAVE="edge:pointerleave",t.POINTER_ENTER="edge:pointerenter",t.POINTER_MOVE="edge:pointermove",t.POINTER_OUT="edge:pointerout",t.POINTER_DOWN="edge:pointerdown",t.POINTER_UP="edge:pointerup",t.CONTEXT_MENU="edge:contextmenu",t.DRAG_ENTER="edge:dragenter",t.DRAG_OVER="edge:dragover",t.DRAG_LEAVE="edge:dragleave",t.DROP="edge:drop"}(hc||(hc={})),function(t){t.BEFORE_CANVAS_INIT="beforecanvasinit",t.AFTER_CANVAS_INIT="aftercanvasinit",t.BEFORE_SIZE_CHANGE="beforesizechange",t.AFTER_SIZE_CHANGE="aftersizechange",t.BEFORE_ELEMENT_CREATE="beforeelementcreate",t.AFTER_ELEMENT_CREATE="afterelementcreate",t.BEFORE_ELEMENT_UPDATE="beforeelementupdate",t.AFTER_ELEMENT_UPDATE="afterelementupdate",t.BEFORE_ELEMENT_DESTROY="beforeelementdestroy",t.AFTER_ELEMENT_DESTROY="afterelementdestroy",t.BEFORE_ELEMENT_TRANSLATE="beforeelementtranslate",t.AFTER_ELEMENT_TRANSLATE="afterelementtranslate",t.BEFORE_DRAW="beforedraw",t.AFTER_DRAW="afterdraw",t.BEFORE_RENDER="beforerender",t.AFTER_RENDER="afterrender",t.BEFORE_ANIMATE="beforeanimate",t.AFTER_ANIMATE="afteranimate",t.BEFORE_LAYOUT="beforelayout",t.AFTER_LAYOUT="afterlayout",t.BEFORE_STAGE_LAYOUT="beforestagelayout",t.AFTER_STAGE_LAYOUT="afterstagelayout",t.BEFORE_TRANSFORM="beforetransform",t.AFTER_TRANSFORM="aftertransform",t.BATCH_START="batchstart",t.BATCH_END="batchend",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.BEFORE_RENDERER_CHANGE="beforerendererchange",t.AFTER_RENDERER_CHANGE="afterrendererchange"}(dc||(dc={})),function(t){t.UNDO="undo",t.REDO="redo",t.CANCEL="cancel",t.ADD="add",t.CLEAR="clear",t.CHANGE="change"}(fc||(fc={})),function(t){t.CLICK="node:click",t.DBLCLICK="node:dblclick",t.POINTER_OVER="node:pointerover",t.POINTER_LEAVE="node:pointerleave",t.POINTER_ENTER="node:pointerenter",t.POINTER_MOVE="node:pointermove",t.POINTER_OUT="node:pointerout",t.POINTER_DOWN="node:pointerdown",t.POINTER_UP="node:pointerup",t.CONTEXT_MENU="node:contextmenu",t.DRAG_START="node:dragstart",t.DRAG="node:drag",t.DRAG_END="node:dragend",t.DRAG_ENTER="node:dragenter",t.DRAG_OVER="node:dragover",t.DRAG_LEAVE="node:dragleave",t.DROP="node:drop"}(pc||(pc={}));const gc="combo",mc="tree";var vc;!function(t){t.NODE="node",t.EDGE="edge",t.COMBO="combo",t.THEME="theme",t.PALETTE="palette",t.LAYOUT="layout",t.BEHAVIOR="behavior",t.PLUGIN="plugin",t.ANIMATION="animation",t.TRANSFORM="transform",t.SHAPE="shape"}(vc||(vc={}));const yc={animation:{},behavior:{},combo:{},edge:{},layout:{},node:{},palette:{},theme:{},plugin:{},transform:{},shape:{}};function xc(t,e){var n;const i=null===(n=yc[t])||void 0===n?void 0:n[e];if(i)return i}function bc(t){return`[G6 v5.0.32] ${t}`}const _c={mute:!1,debug:t=>{!_c.mute&&console.debug(bc(t))},info:t=>{!_c.mute&&console.info(bc(t))},warn:t=>{!_c.mute&&console.warn(bc(t))},error:t=>{!_c.mute&&console.error(bc(t))}};function Ec(t){const{theme:e}=t;if(!e)return{};const n=xc(vc.THEME,e);return n||(_c.warn(`The theme of ${e} is not registered.`),{})}function wc(t,e){if(Array.isArray(t)&&0===t.length)return null;const n=Array.isArray(t)?t[0]:t,i=Array.isArray(t)?t.slice(1):e||[];return new Proxy(n,{get(t,e){return"function"!=typeof t[e]||["onframe","onfinish"].includes(e)?"finished"===e?Promise.all([n.finished,...i.map((t=>t.finished))]):Reflect.get(t,e):(...n)=>{t[e](...n),i.forEach((t=>{var i;return null===(i=t[e])||void 0===i?void 0:i.call(t,...n)}))}},set(t,e,n){return["onframe","onfinish"].includes(e)||i.forEach((t=>{t[e]=n})),Reflect.set(t,e,n)}})}function Tc(t){const e=t.reduce(((t,e)=>(Object.entries(e).forEach((([e,n])=>{void 0===t[e]?t[e]=[n]:t[e].push(n)})),t)),{});Object.entries(e).forEach((([n,i])=>{(i.length!==t.length||i.some((t=>(0,le.Z)(t)))||i.every((t=>!["sourceNode","targetNode","childrenNode"].includes(n)&&nc(t,i[0]))))&&delete e[n]}));const n=Object.entries(e).reduce(((t,[e,n])=>(n.forEach(((n,i)=>{t[i]?t[i][e]=n:t[i]={[e]:n}})),t)),[]);return 0!==t.length&&0===n.length&&n.push({_:0},{_:0}),n}function Sc(t){switch(t){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 Mc(t,e){const{animation:n}=t;if(!1===n||!1===e)return!1;const i=Object.assign({},ic);return(0,nn.Z)(n)&&Object.assign(i,n),(0,nn.Z)(e)&&Object.assign(i,e),i}function Cc(t,e,n,i){var r,a;const{animation:o}=t,s=null===(r=null==t?void 0:t[e])||void 0===r?void 0:r.animation;if(!1===s)return[];const l=null==s?void 0:s[n];if(!1===l)return[];if(!1===o||!1===i)return[];const u=null===(a=Ec(t)[e])||void 0===a?void 0:a.animation,c=(t=[])=>function(t){if("string"==typeof t){return xc(vc.ANIMATION,t)||(_c.warn(`The animation of ${t} is not registered.`),[])}return t}(t).map((t=>Object.assign(Object.assign(Object.assign(Object.assign({},rc),(0,nn.Z)(o)&&o),t),(0,nn.Z)(i)&&i)));if(l)return c(l);if(!u)return[];const h=u[n];return!1===h?[]:c(h)}function Ac(t,e,n,i){if(Array.isArray(i)){let r=!1;const a=[];for(let o=0;o<i.length;o++){const s=i[o];if("translate"===s[0]){if(s[1]===t&&s[2]===e)return null;r=!0,a.push(["translate",t,e])}else if("translate3d"===s[0]){if(s[1]===t&&s[2]===e&&s[3]===n)return null;r=!0,a.push(["translate3d",t,e,n])}else a.push(s)}return r||a.splice(0,0,0===n?["translate",t,e]:["translate3d",t,e,n]),a}const r=i?i.replace(/translate(3d)?\([^)]*\)/g,""):"";return 0===n?`translate(${t}, ${e})${r}`:`translate3d(${t}, ${e}, ${n})${r}`}var Oc=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const Nc=(t,e,n)=>{if(!n.length)return null;const[i,r]=e;let a;const o=n.map((e=>{var{fields:n,shape:o,states:s}=e,l=Oc(e,["fields","shape","states"]);const u=(e=>{var n;if(e){const a=t.getShape(e);if(!a)return null;const o=`get${Qu(e)}Style`,s=(null===(n=null==t?void 0:t[o])||void 0===n?void 0:n.bind(t))||(t=>t);return{shape:a,fromStyle:(null==s?void 0:s(i))||{},toStyle:(null==s?void 0:s(r))||{}}}return{shape:t,fromStyle:i,toStyle:r}})(o);if(!u)return null;const{shape:c,fromStyle:h,toStyle:d}=u,f=[{},{}];if(n.forEach((t=>{var e,n;Object.assign(f[0],{[t]:null!==(e=h[t])&&void 0!==e?e:Sc(t)}),Object.assign(f[1],{[t]:null!==(n=d[t])&&void 0!==n?n:Sc(t)})})),f.some((t=>Object.keys(t).some((t=>["x","y","z"].includes(t)))))){const{x:t=0,y:e=0,z:n=0,transform:i=""}=c.attributes||{};f.forEach((r=>{r.transform=Ac(r.x||t,r.y||e,r.z||n,i)}))}const p=c.animate(Tc(f),l);return void 0===o&&(a=p),p})).filter(Boolean),s=a||(null==o?void 0:o[0]);return s?wc(s,o.filter((t=>t!=t))):null},Pc=[{fields:["x","y"]}],Lc=Pc,Rc=[{fields:["sourceNode","targetNode"]}],Dc=Rc,kc=[{fields:["childrenNode","x","y"]}],Ic=kc;var Bc=Object.prototype.hasOwnProperty;var Fc=function(t,e){if(!e||!(0,Fe.Z)(t))return{};for(var n,i={},r=(0,en.Z)(e)?e:function(t){return t[e]},a=0;a<t.length;a++){var o=t[a];n=r(o),Bc.call(i,n)?i[n].push(o):i[n]=[o]}return i},zc=function(t,e,n){var i,r,a,o,s=0;n||(n={});var l=function(){s=!1===n.leading?0:Date.now(),i=null,o=t.apply(r,a),i||(r=a=null)},u=function(){var u=Date.now();s||!1!==n.leading||(s=u);var c=e-(u-s);return r=this,a=arguments,c<=0||c>e?(i&&(clearTimeout(i),i=null),s=u,o=t.apply(r,a),i||(r=a=null)):i||!1===n.trailing||(i=setTimeout(l,c)),o};return u.cancel=function(){clearTimeout(i),s=0,i=r=a=null},u},Gc=n(83559);function jc(t){return t instanceof Float32Array||!(!Array.isArray(t)||2!==t.length&&3!==t.length)&&t.every((t=>"number"==typeof t))}function Uc(t,e,n){return t>=e&&t<=n}function Hc(t=0){if(Array.isArray(t)){const[e=0,n=e,i=e,r=n]=t;return[e,n,i,r]}return[t,t,t,t]}function Vc(t=0){const e=Hc(t);return e[0]+e[2]}function Zc(t){return t.max[0]-t.min[0]}function Wc(t){return t.max[1]-t.min[1]}function Xc(t){return[Zc(t),Wc(t)]}function Yc(t,e){const n=jc(t)?qc(t):t.getShape("key").getBounds();return e?$c(n,e):n}function qc(t){const[e,n,i=0]=t,r=new Ti;return r.setMinMax([e,n,i],[e,n,i]),r}function $c(t,e){const[n,i,r,a]=Hc(e),[o,s,l]=t.min,[u,c,h]=t.max,d=new Ti;return d.setMinMax([o-a,s-n,l],[u+i,c+r,h]),d}function Kc(t){if(0===t.length)return new Ti;if(1===t.length)return t[0];const e=new Ti;e.setMinMax(t[0].min,t[0].max);for(let n=1;n<t.length;n++){const i=t[n];e.setMinMax([Math.min(e.min[0],i.min[0]),Math.min(e.min[1],i.min[1]),Math.min(e.min[2],i.min[2])],[Math.max(e.max[0],i.max[0]),Math.max(e.max[1],i.max[1]),Math.max(e.max[2],i.max[2])])}return e}function Qc(t,e){return Uc(t[0],e.min[0],e.max[0])&&Uc(t[1],e.min[1],e.max[1])}function Jc(t,e,n=!1){const{min:[i,r],max:[a,o]}=e,s=(t[1]===r||t[1]===o)&&(n||Uc(t[0],i,a)),l=(t[0]===i||t[0]===a)&&(n||Uc(t[1],r,o));return s||l}function th(t,e){const{center:n}=e;return t[0]===n[0]&&t[1]===n[1]}function eh(t,e){const[n,i]=t,[r,a]=e.min,[o,s]=e.max,l=n-r,u=o-n,c=i-a,h=s-i,d=Math.min(l,u,c,h);return d===l?"left":d===u?"right":d===c?"top":d===h?"bottom":"left"}function nh(t,e){const n=(0,Gc.Z)(t);if(Qc(t,e)){switch(eh(t,e)){case"left":n[0]=e.min[0];break;case"right":n[0]=e.max[0];break;case"top":n[1]=e.min[1];break;case"bottom":n[1]=e.max[1]}}else{const[i,r]=t,[a,o]=e.min,[s,l]=e.max;n[0]=Uc(i,a,s)?i:i<a?a:s,n[1]=Uc(r,o,l)?r:r<o?o:l}return n}var ih=function(t,e){return t===e},rh=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},t}(),ah=function(){function t(t){void 0===t&&(t=ih),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new rh(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new rh(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(null!==n)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},t.prototype.find=function(t){var e=t.value,n=void 0===e?void 0:e,i=t.callback,r=void 0===i?void 0:i;if(!this.head)return null;for(var a=this.head;a;){if(r&&r(a.value))return a;if(void 0!==n&&this.compare(a.value,n))return a;a=a.next}return null},t.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},t.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},t.prototype.fromArray=function(t){var e=this;return t.forEach((function(t){return e.append(t)})),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map((function(e){return e.toString(t)})).toString()},t}(),oh=(function(){function t(){this.linkedList=new ah}t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)}}(),function(t,e,n){void 0===e&&(e=[]);var i=e.filter((function(e){return e.source===t||e.target===t}));if("target"===n){return i.filter((function(e){return e.source===t})).map((function(t){return t.target}))}if("source"===n){return i.filter((function(e){return e.target===t})).map((function(t){return t.source}))}return i.map((function(e){return e.source===t?e.target:e.source}))}),sh=function(t,e){return e.filter((function(e){return e.source===t||e.target===t}))};var lh=function(t){var e={},n=t.nodes,i=void 0===n?[]:n,r=t.edges,a=void 0===r?[]:r;return i.forEach((function(t){e[t.id]={degree:0,inDegree:0,outDegree:0}})),a.forEach((function(t){e[t.source].degree++,e[t.source].outDegree++,e[t.target].degree++,e[t.target].inDegree++})),e},uh=lh;var ch={}.toString,hh=function(t,e){return ch.call(t)==="[object "+e+"]"},dh=function(t){return hh(t,"Function")},fh=function(t){return Array.isArray?Array.isArray(t):hh(t,"Array")};var ph=function(t,e){var n,i;if(t)if(fh(t))for(var r=0,a=t.length;r<a&&!1!==e(t[r],r);r++);else if(i=typeof(n=t),null!==n&&"object"===i||"function"===i)for(var o in t)if(t.hasOwnProperty(o)&&!1===e(t[o],o))break};Object.keys;var gh=Array.prototype,mh=(gh.splice,gh.indexOf,Array.prototype.splice,function(t){return hh(t,"String")});Object.prototype.hasOwnProperty;var vh=function(t){return hh(t,"Number")},yh=(Number.isInteger&&Number.isInteger,Math.PI,Math.PI,Object.values?function(t){return Object.values(t)}:function(t){var e=[];return ph(t,(function(n,i){dh(t)&&"prototype"===i||e.push(n)})),e});Object.prototype;var xh=function(t){if("object"!=typeof t||null===t)return t;var e;if(fh(t)){e=[];for(var n=0,i=t.length;n<i;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=xh(t[n]):e[n]=t[n]}else for(var r in e={},t)"object"==typeof t[r]&&null!=t[r]?e[r]=xh(t[r]):e[r]=t[r];return e},bh=xh;Object.prototype.hasOwnProperty;Object.prototype.hasOwnProperty,function(t,e){if(!dh(t))throw new TypeError("Expected a function");var n=function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var a=e?e.apply(this,i):i[0],o=n.cache;if(o.has(a))return o.get(a);var s=t.apply(this,i);return o.set(a,s),s};n.cache=new Map}((function(t,e){void 0===e&&(e={});var n=e.fontSize,i=e.fontFamily,r=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return _h||(_h=document.createElement("canvas").getContext("2d")),_h.font=[a,o,r,n+"px",i].join(" "),_h.measureText(mh(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),(0,he.pr)([t],yh(e)).join("")})),function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();var _h,Eh=function(t,e,n,i){var r=t.nodes,a=void 0===r?[]:r,o=t.edges,s=void 0===o?[]:o,l=[],u={},c={},h={};a.forEach((function(t,n){var i=t.id;l.push(i),c[i]=1/0,i===e&&(c[i]=0)}));for(var d=a.length,f=function(t){var e=function(t,e,n){for(var i,r=1/0,a=0;a<e.length;a++){var o=e[a].id;!n[o]&&t[o]<=r&&(r=t[o],i=e[a])}return i}(c,a,u),r=e.id;if(u[r]=!0,c[r]===1/0)return"continue";var o=[];o=n?function(t,e){return e.filter((function(e){return e.source===t}))}(r,s):sh(r,s),o.forEach((function(t){var n=t.target,a=t.source,o=n===r?a:n,s=i&&t[i]?t[i]:1;c[o]>c[e.id]+s?(c[o]=c[e.id]+s,h[o]=[e.id]):c[o]===c[e.id]+s&&h[o].push(e.id)}))},p=0;p<d;p++)f();h[e]=[e];var g={};for(var m in c)c[m]!==1/0&&wh(e,m,h,g);var v={};for(var m in g)v[m]=g[m][0];return{length:c,path:v,allPath:g}};function wh(t,e,n,i){if(t===e)return[t];if(i[e])return i[e];for(var r=[],a=0,o=n[e];a<o.length;a++){var s=wh(t,o[a],n,i);if(!s)return;for(var l=0,u=s;l<u.length;l++){var c=u[l];fh(c)?r.push((0,he.ev)((0,he.ev)([],c,!0),[e],!1)):r.push([c,e])}}return i[e]=r,i[e]}var Th,Sh=function(t,e,n,i,r){var a=Eh(t,e,i,r),o=a.length,s=a.path,l=a.allPath;return{length:o[n],path:s[n],allPath:l[n]}};!function(){function t(t){this.arr=t}t.prototype.getArr=function(){return this.arr||[]},t.prototype.add=function(e){var n,i=e.arr;if(!(null===(n=this.arr)||void 0===n?void 0:n.length))return new t(i);if(!(null==i?void 0:i.length))return new t(this.arr);if(this.arr.length===i.length){var r=[];for(var a in this.arr)r[a]=this.arr[a]+i[a];return new t(r)}},t.prototype.subtract=function(e){var n,i=e.arr;if(!(null===(n=this.arr)||void 0===n?void 0:n.length))return new t(i);if(!(null==i?void 0:i.length))return new t(this.arr);if(this.arr.length===i.length){var r=[];for(var a in this.arr)r[a]=this.arr[a]-i[a];return new t(r)}},t.prototype.avg=function(e){var n=[];if(0!==e)for(var i in this.arr)n[i]=this.arr[i]/e;return new t(n)},t.prototype.negate=function(){var e=[];for(var n in this.arr)e[n]=-this.arr[n];return new t(e)},t.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null==n?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var r in this.arr)i+=Math.pow(this.arr[r]-t.arr[r],2);return i}},t.prototype.euclideanDistance=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null==n?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var r in this.arr)i+=Math.pow(this.arr[r]-t.arr[r],2);return Math.sqrt(i)}console.error("The two vectors are unequal in length.")},t.prototype.normalize=function(){var e=[],n=bh(this.arr);n.sort((function(t,e){return t-e}));var i=n[n.length-1],r=n[0];for(var a in this.arr)e[a]=(this.arr[a]-r)/(i-r);return new t(e)},t.prototype.norm2=function(){var t;if(!(null===(t=this.arr)||void 0===t?void 0:t.length))return 0;var e=0;for(var n in this.arr)e+=Math.pow(this.arr[n],2);return Math.sqrt(e)},t.prototype.dot=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null==n?void 0:n.length))return 0;if(this.arr.length===n.length){var i=0;for(var r in this.arr)i+=this.arr[r]*t.arr[r];return i}console.error("The two vectors are unequal in length.")},t.prototype.equal=function(t){var e,n=t.arr;if((null===(e=this.arr)||void 0===e?void 0:e.length)!==(null==n?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0}}();!function(t){t.EuclideanDistance="euclideanDistance"}(Th||(Th={}));!function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var i=n[e];this.parent[i]=i}}t.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},t.prototype.union=function(t,e){var n=this.find(t),i=this.find(e);n!==i&&(n<i?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},t.prototype.connected=function(t,e){return this.find(t)===this.find(e)}}();var Mh=function(t,e){return t-e},Ch=(function(){function t(t){void 0===t&&(t=Mh),this.compareFn=t,this.list=[]}t.prototype.getLeft=function(t){return 2*t+1},t.prototype.getRight=function(t){return 2*t+2},t.prototype.getParent=function(t){return 0===t?null:Math.floor((t-1)/2)},t.prototype.isEmpty=function(){return this.list.length<=0},t.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},t.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,i=this.getLeft(t),r=this.getRight(t),a=this.list.length;null!==i&&i<a&&this.compareFn(this.list[n],this.list[i])>0?n=i:null!==r&&r<a&&this.compareFn(this.list[n],this.list[r])>0&&(n=r),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))}}(),function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var i,r=1,a=0,o=1e3,s=t.nodes,l=void 0===s?[]:s,u=t.edges,c=void 0===u?[]:u,h=l.length,d={},f={},p=0;p<h;++p){d[m=(_=l[p]).id]=1/h,f[m]=1/h}for(var g=uh(t);o>0&&r>e;){a=0;for(p=0;p<h;++p){var m=(_=l[p]).id;if(i=0,0===g[_.id].inDegree)d[m]=0;else{for(var v=oh(m,c,"source"),y=0;y<v.length;++y){var x=v[y],b=g[x].outDegree;b>0&&(i+=f[x]/b)}d[m]=n*i,a+=d[m]}}a=(1-a)/h,r=0;for(p=0;p<h;++p){var _;i=d[m=(_=l[p]).id]+a,r+=Math.abs(i-f[m]),f[m]=i}o-=1}return f}),Ah="-1",Oh=function(t,e,n,i){void 0===t&&(t=-1),void 0===e&&(e=-1),void 0===n&&(n=-1),void 0===i&&(i="-1"),this.id=t,this.from=e,this.to=n,this.label=i},Nh=function(){function t(t,e){void 0===t&&(t=-1),void 0===e&&(e=Ah),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return t.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},t}(),Ph=function(){function t(t,e,n){void 0===t&&(t=-1),void 0===e&&(e=!0),void 0===n&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return t.prototype.getNodeNum=function(){return this.nodes.length},t.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new Nh(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},t.prototype.addEdge=function(t,e,n,i){if((this.edgeIdAutoIncrease||void 0===t)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var r=new Oh(t,e,n,i);if(this.edges.push(r),this.edgeMap[t]=r,this.nodeMap[e].addEdge(r),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(r),!this.directed){var a=new Oh(t,n,e,i);this.nodeMap[n].addEdge(a),this.edgeLabelMap[i].push(a)}}},t}(),Lh=function(){function t(t,e,n,i,r){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||Ah,edgeLabel:i||"-1",nodeLabel2:r||Ah}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),Rh=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var n=0;n<e;n++)if(this.dfsEdgeList[n]!==t[n])return!1;return!0},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t.prototype.pushBack=function(t,e,n,i,r){return this.dfsEdgeList.push(new Lh(t,e,n,i,r)),this.dfsEdgeList},t.prototype.toGraph=function(t,e){void 0===t&&(t=-1),void 0===e&&(e=!1);var n=new Ph(t,!0,e);return this.dfsEdgeList.forEach((function(t){var e=t.fromNode,i=t.toNode,r=t.nodeEdgeNodeLabel,a=r.nodeLabel1,o=r.edgeLabel,s=r.nodeLabel2;a!==Ah&&n.addNode(e,a),s!==Ah&&n.addNode(i,s),a!==Ah&&s!==a&&n.addEdge(void 0,e,i,o)})),n},t.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length-1;e>=0;e--){var n=this.dfsEdgeList[e],i=n.fromNode,r=n.toNode;i<r&&(void 0===t||r===t)&&(this.rmpath.push(e),t=i)}return this.rmpath},t.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},t}(),Dh=function(){function t(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 t.prototype.hasNode=function(t){return 1===this.nodesUsed[t.id]},t.prototype.hasEdge=function(t){return 1===this.edgesUsed[t.id]},t}();(function(){function t(t){var e=t.graphs,n=t.minSupport,i=void 0===n?2:n,r=t.minNodeNum,a=void 0===r?1:r,o=t.maxNodeNum,s=void 0===o?4:o,l=t.top,u=void 0===l?10:l,c=t.directed,h=void 0!==c&&c,d=t.verbose,f=void 0!==d&&d;this.graphs=e,this.dfsCode=new Rh,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=u,this.directed=h,this.counter=0,this.maxNodeNum=s,this.minNodeNum=a,this.verbose=f,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}t.prototype.findForwardRootEdges=function(t,e){var n=this,i=[],r=t.nodeMap;return e.edges.forEach((function(t){(n.directed||e.label<=r[t.to].label)&&i.push(t)})),i},t.prototype.findBackwardEdge=function(t,e,n,i){if(!this.directed&&e===n)return null;for(var r=t.nodeMap,a=r[n.to].edges,o=a.length,s=0;s<o;s++){var l=a[s];if(!i.hasEdge(l)&&l.to===e.from)if(this.directed){if(r[e.from].label<r[n.to].label||r[e.from].label===r[n.to].label&&e.label<=l.label)return l}else if(e.label<l.label||e.label===l.label&&r[e.to].label<=r[n.to].label)return l}return null},t.prototype.findForwardPureEdges=function(t,e,n,i){for(var r=[],a=e.to,o=t.nodeMap[a].edges,s=o.length,l=0;l<s;l++){var u=o[l],c=t.nodeMap[u.to];n<=c.label&&!i.hasNode(c)&&r.push(u)}return r},t.prototype.findForwardRmpathEdges=function(t,e,n,i){for(var r=[],a=t.nodeMap,o=a[e.to].label,s=a[e.from].edges,l=s.length,u=0;u<l;u++){var c=s[u],h=a[c.to].label;e.to===c.to||n>h||i.hasNode(a[c.to])||(e.label<c.label||e.label===c.label&&o<=h)&&r.push(c)}return r},t.prototype.getSupport=function(t){var e={};return t.forEach((function(t){e[t.graphId]||(e[t.graphId]=!0)})),Object.keys(e).length},t.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach((function(n){var i=t[n],r=i.nodeLabel1,a=i.edgeLabel,o=i.nodeLabel2;e?(r<e.nodeLabel1||r===e.nodeLabel1&&a<e.edgeLabel||r===e.nodeLabel1&&a===e.edgeLabel&&o<e.nodeLabel2)&&(e={nodeLabel1:r,edgeLabel:a,nodeLabel2:o}):e={nodeLabel1:r,edgeLabel:a,nodeLabel2:o}})),e},t.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),1===e.dfsEdgeList.length)return!0;var n=this.directed,i=e.toGraph(-1,n),r=i.nodeMap,a=new Rh,o={};i.nodes.forEach((function(e){t.findForwardRootEdges(i,e).forEach((function(t){var n=r[t.to],a="".concat(e.label,"-").concat(t.label,"-").concat(n.label);o[a]||(o[a]={projected:[],nodeLabel1:e.label,edgeLabel:t.label,nodeLabel2:n.label});var s={graphId:i.id,edge:t,preNode:null};o[a].projected.push(s)}))}));var s=this.findMinLabel(o);if(s){a.dfsEdgeList.push(new Lh(0,1,s.nodeLabel1,s.edgeLabel,s.nodeLabel2));var l="".concat(s.nodeLabel1,"-").concat(s.edgeLabel,"-").concat(s.nodeLabel2);return function o(s){for(var l=a.buildRmpath(),u=a.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,c=a.dfsEdgeList[l[0]].toNode,h={},d=!1,f=0,p=n?-1:0,g=function(e){if(d)return"break";s.forEach((function(n){var r=new Dh(n),o=t.findBackwardEdge(i,r.edges[l[e]],r.edges[l[0]],r);o&&(h[o.label]||(h[o.label]={projected:[],edgeLabel:o.label}),h[o.label].projected.push({graphId:i.id,edge:h,preNode:n}),f=a.dfsEdgeList[l[e]].fromNode,d=!0)}))},m=l.length-1;m>p;m--){if("break"===g(m))break}if(d){var v=t.findMinLabel(h);a.dfsEdgeList.push(new Lh(c,f,Ah,v.edgeLabel,Ah));var y=a.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[y]===a.dfsEdgeList[y]&&o(h[v.edgeLabel].projected)}var x={};d=!1;var b=0;s.forEach((function(e){var n=new Dh(e),a=t.findForwardPureEdges(i,n.edges[l[0]],u,n);a.length>0&&(d=!0,b=c,a.forEach((function(t){var n="".concat(t.label,"-").concat(r[t.to].label);x[n]||(x[n]={projected:[],edgeLabel:t.label,nodeLabel2:r[t.to].label}),x[n].projected.push({graphId:i.id,edge:t,preNode:e})})))}));var _=l.length,E=function(e){if(d)return"break";var n=l[e];s.forEach((function(e){var o=new Dh(e),s=t.findForwardRmpathEdges(i,o.edges[n],u,o);s.length>0&&(d=!0,b=a.dfsEdgeList[n].fromNode,s.forEach((function(t){var n="".concat(t.label,"-").concat(r[t.to].label);x[n]||(x[n]={projected:[],edgeLabel:t.label,nodeLabel2:r[t.to].label}),x[n].projected.push({graphId:i.id,edge:t,preNode:e})})))}))};for(m=0;m<_;m++){if("break"===E(m))break}if(!d)return!0;var w=t.findMinLabel(x);a.dfsEdgeList.push(new Lh(b,c+1,Ah,w.edgeLabel,w.nodeLabel2));var T=a.dfsEdgeList.length-1;return e.dfsEdgeList[T]===a.dfsEdgeList[T]&&o(x["".concat(w.edgeLabel,"-").concat(w.nodeLabel2)].projected)}(o[l].projected)}},t.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(bh(t))}},t.prototype.subGraphMining=function(t){var e=this;if(!(this.getSupport(t)<this.minSupport)&&this.isMin()){this.report();var n=this.dfsCode.getNodeNum(),i=this.dfsCode.buildRmpath(),r=this.dfsCode.dfsEdgeList[i[0]].toNode,a=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,o={},s={};t.forEach((function(t){for(var l=e.graphs[t.graphId],u=l.nodeMap,c=new Dh(t),h=i.length-1;h>=0;h--){var d=e.findBackwardEdge(l,c.edges[i[h]],c.edges[i[0]],c);if(d){var f="".concat(e.dfsCode.dfsEdgeList[i[h]].fromNode,"-").concat(d.label);s[f]||(s[f]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[i[h]].fromNode,edgeLabel:d.label}),s[f].projected.push({graphId:t.graphId,edge:d,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(l,c.edges[i[0]],a,c).forEach((function(e){var n="".concat(r,"-").concat(e.label,"-").concat(u[e.to].label);o[n]||(o[n]={projected:[],fromNodeId:r,edgeLabel:e.label,nodeLabel2:u[e.to].label}),o[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var p=function(n){e.findForwardRmpathEdges(l,c.edges[i[n]],a,c).forEach((function(r){var a="".concat(e.dfsCode.dfsEdgeList[i[n]].fromNode,"-").concat(r.label,"-").concat(u[r.to].label);o[a]||(o[a]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[i[n]].fromNode,edgeLabel:r.label,nodeLabel2:u[r.to].label}),o[a].projected.push({graphId:t.graphId,edge:r,preNode:t})}))};for(h=0;h<i.length;h++)p(h)}})),Object.keys(s).forEach((function(t){var n=s[t],i=n.toNodeId,a=n.edgeLabel;e.dfsCode.dfsEdgeList.push(new Lh(r,i,"-1",a,"-1")),e.subGraphMining(s[t].projected),e.dfsCode.dfsEdgeList.pop()})),Object.keys(o).forEach((function(t){var n=o[t],i=n.fromNodeId,a=n.edgeLabel,s=n.nodeLabel2;e.dfsCode.dfsEdgeList.push(new Lh(i,r+1,Ah,a,s)),e.subGraphMining(o[t].projected),e.dfsCode.dfsEdgeList.pop()}))}},t.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,r={},a={},o={},s={};return Object.keys(t).forEach((function(n){var i=t[n],l=i.nodeMap;i.nodes.forEach((function(t,i){var u=t.label,c="".concat(n,"-").concat(u);if(!o[c]){var h=r[u]||0;h++,r[u]=h}o[c]={graphKey:n,label:u},t.edges.forEach((function(t){var i=u,r=l[t.to].label;if(!e&&i>r){var o=r;r=i,i=o}var c=t.label,h="".concat(n,"-").concat(i,"-").concat(c,"-").concat(r),d="".concat(i,"-").concat(c,"-").concat(r);if(!a[d]){var f=a[d]||0;f++,a[d]=f}s[h]={graphId:n,nodeLabel1:i,edgeLabel:c,nodeLabel2:r}}))}))})),Object.keys(r).forEach((function(t){if(!(r[t]<n)){var e={nodes:[],edges:[]};e.nodes.push({id:"0",label:t}),i.push(e)}})),i},t.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,n=(this.directed,{});Object.keys(e).forEach((function(i){var r=e[i],a=r.nodeMap;r.nodes.forEach((function(e){t.findForwardRootEdges(r,e).forEach((function(t){var r=a[t.to],o="".concat(e.label,"-").concat(t.label,"-").concat(r.label);n[o]||(n[o]={projected:[],nodeLabel1:e.label,edgeLabel:t.label,nodeLabel2:r.label});var s={graphId:i,edge:t,preNode:null};n[o].projected.push(s)}))}))})),Object.keys(n).forEach((function(e){var i=n[e],r=i.projected,a=i.nodeLabel1,o=i.edgeLabel,s=i.nodeLabel2;t.dfsCode.dfsEdgeList.push(new Lh(0,1,a,o,s)),t.subGraphMining(r),t.dfsCode.dfsEdgeList.pop()}))}}})(),function(){function t(t){void 0===t&&(t=10),this.linkedList=new ah,this.maxStep=t}Object.defineProperty(t.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map((function(t){return t.value}))},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()}}();function kh(t){if(void 0!==t.id)return t.id;if(void 0!==t.source&&void 0!==t.target)return`${t.source}-${t.target}`;throw new Error(bc("The datum does not have available id."))}function Ih(t){return t.combo}function Bh(t,e){const n={nodes:(t.nodes||[]).map(kh),edges:(t.edges||[]).map(kh),combos:(t.combos||[]).map(kh)};return e?Object.values(n).flat():n}const Fh=(t,e,n)=>{var i;switch(n.type){case"degree":{const r=new Map;return null===(i=t.nodes)||void 0===i||i.forEach((t=>{const i=e(kh(t),n.direction).length;r.set(kh(t),i)})),r}case"betweenness":return Gh(t,n.directed,n.weightPropertyName);case"closeness":return jh(t,n.directed,n.weightPropertyName);case"eigenvector":return Hh(t,n.directed);case"pagerank":return Uh(t,n.epsilon,n.linkProb);default:return zh(t)}},zh=t=>{var e;const n=new Map;return null===(e=t.nodes)||void 0===e||e.forEach((t=>{n.set(kh(t),0)})),n},Gh=(t,e,n)=>{const i=zh(t),{nodes:r=[]}=t;return r.forEach((a=>{r.forEach((r=>{if(a!==r){const{allPath:o}=Sh(t,kh(a),kh(r),e,n),s=o.length;o.flat().forEach((t=>{t!==kh(a)&&t!==kh(r)&&i.set(t,i.get(t)+1/s)}))}}))})),i},jh=(t,e,n)=>{const i=new Map,{nodes:r=[]}=t;return r.forEach((a=>{const o=r.reduce(((i,r)=>{if(a!==r){const{length:o}=Sh(t,kh(a),kh(r),e,n);i+=o}return i}),0);i.set(kh(a),1/o)})),i},Uh=(t,e,n)=>{var i;const r=new Map,a=Ch(t,e,n);return null===(i=t.nodes)||void 0===i||i.forEach((t=>{r.set(kh(t),a[kh(t)])})),r},Hh=(t,e)=>{const{nodes:n=[]}=t,i=Vh(t,e),r=Zh(i,n.length),a=new Map;return n.forEach(((t,e)=>{a.set(kh(t),r[e])})),a},Vh=(t,e)=>{const{nodes:n=[],edges:i=[]}=t,r=Array(n.length).fill(null).map((()=>Array(n.length).fill(0)));return i.forEach((({source:t,target:i})=>{const a=n.findIndex((e=>kh(e)===t)),o=n.findIndex((t=>kh(t)===i));e?r[a][o]=1:(r[a][o]=1,r[o][a]=1)})),r},Zh=(t,e,n=100,i=1e-6)=>{let r=Array(e).fill(1),a=1/0;for(let o=0;o<n&&a>i;o++){const n=Array(e).fill(0);for(let i=0;i<e;i++)for(let a=0;a<e;a++)n[i]+=t[i][a]*r[a];const i=Math.sqrt(n.reduce(((t,e)=>t+e*e),0));for(let t=0;t<e;t++)n[t]/=i;a=Math.sqrt(n.reduce(((t,e,n)=>t+(e-r[n])*e),0)),r=n}return r};function Wh(t,e,n,i=nc){const r=new Map(t.map((t=>[n(t),t]))),a=new Map(e.map((t=>[n(t),t]))),o=new Set(r.keys()),s=new Set(a.keys()),l=[],u=[],c=[],h=[];return s.forEach((t=>{o.has(t)?i(r.get(t),a.get(t))?h.push(a.get(t)):u.push(a.get(t)):l.push(a.get(t))})),o.forEach((t=>{s.has(t)||c.push(r.get(t))})),{enter:l,exit:c,keep:h,update:u}}const Xh=new WeakMap;function Yh(t,e,n=!1,i){if(void 0===e)return;const r=(a,o=e)=>{const s=(t=o)=>a.childNodes.forEach((e=>r(e,t)));if(i&&!i(a))return s();if(n||a!==t){Xh.has(a)||Xh.set(a,a.style.visibility);const t="hidden"===o||"hidden"===function(t){return Xh.has(t)?Xh.get(t):t.style.visibility}(a)?"hidden":"visible";a.style.visibility=t,s(t)}else t.style.visibility=e,Xh.delete(t),s(e)};r(t)}class qh{constructor(t){this.extensions=[],this.extensionMap={},this.context=t}setExtensions(t){const e=function(t,e,n){const i={},r=t=>(t in i||(i[t]=0),`${e}-${t}-${i[t]++}`);return n.map((e=>"string"==typeof e?{type:e,key:r(e)}:"function"==typeof e?e.call(t):e.key?e:Object.assign(Object.assign({},e),{key:r(e.type)})))}(this.context.graph,this.category,t),{enter:n,update:i,exit:r,keep:a}=Wh(this.extensions,e,(t=>t.key));this.createExtensions(n),this.updateExtensions([...i,...a]),this.destroyExtensions(r),this.extensions=e}createExtension(t){const{category:e}=this,{key:n,type:i}=t,r=xc(e,i);if(!r)return _c.warn(`The extension ${i} of ${e} is not registered.`);const a=new r(this.context,t);this.extensionMap[n]=a}createExtensions(t){t.forEach((t=>this.createExtension(t)))}updateExtension(t){const{key:e}=t,n=this.extensionMap[e];n&&n.update(t)}updateExtensions(t){t.forEach((t=>this.updateExtension(t)))}destroyExtension(t){const e=this.extensionMap[t];e&&(e.destroy(),delete this.extensionMap[t])}destroyExtensions(t){t.forEach((({key:t})=>this.destroyExtension(t)))}destroy(){Object.values(this.extensionMap).forEach((t=>t.destroy())),this.context={},this.extensions=[],this.extensionMap={}}}class $h{constructor(t,e){this.events=[],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 Kh extends $h{}class Qh extends Kh{constructor(t,e){super(t,Object.assign({},Qh.defaultOptions,e)),this.isOverlapping=(t,e)=>e.some((e=>t.intersects(e))),this.occupiedBounds=[],this.detectLabelCollision=t=>{const e=this.context.viewport,n={show:[],hide:[]};return this.occupiedBounds=[],t.forEach((t=>{const i=t.getShape("label").getRenderBounds();e.isInViewport(i,!0)&&!this.isOverlapping(i,this.occupiedBounds)?(n.show.push(t),this.occupiedBounds.push($c(i,this.options.padding))):n.hide.push(t)})),n},this.hideLabelIfExceedViewport=(t,e)=>{const{exit:n}=Wh(t,e,(t=>t.id));null==n||n.forEach(this.hideLabel)},this.nodeCentralities=new Map,this.sortNodesByCentrality=(t,e)=>{const{model:n}=this.context,i=n.getData(),r=n.getRelatedEdgesData.bind(n);return t.map((t=>(this.nodeCentralities.has(t.id)||(this.nodeCentralities=Fh(i,r,e)),{node:t,centrality:this.nodeCentralities.get(t.id)}))).sort(((t,e)=>e.centrality-t.centrality)).map((t=>t.node))},this.sortLabelElementsInView=t=>{const{sort:e,sortNode:n,sortCombo:i,sortEdge:r}=this.options,{model:a}=this.context;if((0,en.Z)(e))return t.sort(((t,n)=>e(a.getElementDataById(t.id),a.getElementDataById(n.id))));const{node:o=[],edge:s=[],combo:l=[]}=Fc(t,(t=>t.type));return[...(0,en.Z)(i)?l.sort(((t,e)=>i(...a.getComboData([t.id,e.id])))):l,...(0,en.Z)(n)?o.sort(((t,e)=>n(...a.getNodeData([t.id,e.id])))):this.sortNodesByCentrality(o,n),...(0,en.Z)(r)?s.sort(((t,e)=>r(...a.getEdgeData([t.id,e.id])))):s]},this.labelElementsInView=[],this.isFirstRender=!0,this.onToggleVisibility=t=>{var e;if("zIndex"===(null===(e=t.data)||void 0===e?void 0:e.stage))return;if(!this.validate(t))return void(this.hiddenElements.size>0&&(this.hiddenElements.forEach(this.showLabel),this.hiddenElements.clear()));const n=this.isFirstRender?this.getLabelElements():this.getLabelElementsInView();this.hideLabelIfExceedViewport(this.labelElementsInView,n),this.labelElementsInView=n;const i=this.sortLabelElementsInView(this.labelElementsInView),{show:r,hide:a}=this.detectLabelCollision(i);for(let t=r.length-1;t>=0;t--)this.showLabel(r[t]);a.forEach(this.hideLabel)},this.hiddenElements=new Map,this.hideLabel=t=>{const e=t.getShape("label");e&&Yh(e,"hidden"),this.hiddenElements.set(t.id,t)},this.showLabel=t=>{const e=t.getShape("label");e&&Yh(e,"visible"),t.toFront(),this.hiddenElements.delete(t.id)},this.onTransform=zc(this.onToggleVisibility,this.options.throttle,{leading:!0}),this.enableToggle=!0,this.toggle=t=>{this.enableToggle&&this.onToggleVisibility(t)},this.onBeforeRender=()=>{this.enableToggle=!1},this.onAfterRender=t=>{this.onToggleVisibility(t),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 n in t){const i=t[n];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(dc.BEFORE_RENDER,this.onBeforeRender),t.on(dc.AFTER_RENDER,this.onAfterRender),t.on(dc.AFTER_DRAW,this.toggle),t.on(dc.AFTER_LAYOUT,this.toggle),t.on(dc.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(dc.BEFORE_RENDER,this.onBeforeRender),t.off(dc.AFTER_RENDER,this.onAfterRender),t.off(dc.AFTER_DRAW,this.toggle),t.off(dc.AFTER_LAYOUT,this.toggle),t.off(dc.AFTER_TRANSFORM,this.onTransform)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Qh.defaultOptions={enable:!0,throttle:100,padding:0,sortNode:{type:"degree"}};var Jh=n(58212);const td=[0,0,0];function ed(t,e){return t.map(((t,n)=>t+e[n]))}function nd(t,e){return t.map(((t,n)=>t-e[n]))}function id(t,e){return"number"==typeof e?t.map((t=>t*e)):t.map(((t,n)=>t*e[n]))}function rd(t,e){return"number"==typeof e?t.map((t=>t/e)):t.map(((t,n)=>t/e[n]))}function ad(t,e){return t.map((t=>t*e))}function od(t,e){return Math.sqrt(t.reduce(((t,n,i)=>t+Math.pow(n-e[i]||0,2)),0))}function sd(t,e){return t.reduce(((t,n,i)=>t+Math.abs(n-e[i])),0)}function ld(t){const e=t.reduce(((t,e)=>t+Math.pow(e,2)),0);return t.map((t=>t/Math.sqrt(e)))}function ud(t,e,n=!1){const i=t[0]*e[1]-t[1]*e[0];let r=Math.acos(id(t,e).reduce(((t,e)=>t+e),0)/(od(t,td)*od(e,td)));return n&&i<0&&(r=2*Math.PI-r),r}function cd(t,e=!0){return e?[-t[1],t[0]]:[t[1],-t[0]]}function hd(t){return[t[0],t[1]]}function dd(t){return function(t){return 2===t.length}(t)?[t[0],t[1],0]:t}function fd(t){const[e,n]=t;return e||n?Math.atan2(n,e):0}function pd(t,e){const[n,i]=t,[r,a]=e;return function(t,e){const n=dd(t),i=dd(e);return[n[1]*i[2]-n[2]*i[1],n[2]*i[0]-n[0]*i[2],n[0]*i[1]-n[1]*i[0]]}(nd(n,i),nd(r,a)).every((t=>0===t))}function gd(t,e,n=!1){if(pd(t,e))return;const[i,r]=t,[a,o]=e,s=((i[0]-a[0])*(a[1]-o[1])-(i[1]-a[1])*(a[0]-o[0]))/((i[0]-r[0])*(a[1]-o[1])-(i[1]-r[1])*(a[0]-o[0])),l=o[0]-a[0]?(i[0]-a[0]+s*(r[0]-i[0]))/(o[0]-a[0]):(i[1]-a[1]+s*(r[1]-i[1]))/(o[1]-a[1]);return n||Uc(s,0,1)&&Uc(l,0,1)?[i[0]+s*(r[0]-i[0]),i[1]+s*(r[1]-i[1])]:void 0}function md(t){if(Array.isArray(t))return Uc(t[0],0,1)&&Uc(t[1],0,1)?t:[.5,.5];const e=t.split("-");return[e.includes("left")?0:e.includes("right")?1:.5,e.includes("top")?0:e.includes("bottom")?1:.5]}function vd(t){const{x:e=0,y:n=0,z:i=0}=t.style||{};return[+e,+n,+i]}function yd(t){const{x:e,y:n,z:i}=t.style||{};return void 0!==e||void 0!==n||void 0!==i}function xd(t,e){const[n,i]=e,{min:r,max:a}=t;return[r[0]+n*(a[0]-r[0]),r[1]+i*(a[1]-r[1])]}function bd(t,e="center"){return xd(t,md(e))}function _d(t){var e;return[t.x,t.y,null!==(e=t.z)&&void 0!==e?e:0]}function Ed(t){var e;return{x:t[0],y:t[1],z:null!==(e=t[2])&&void 0!==e?e:0}}function wd(t,e=0){return t.map((t=>parseFloat(t.toFixed(e))))}function Td(t,e,n,i=!1){if(nc(t,e))return t;const r=ld(i?nd(t,e):nd(e,t)),a=[r[0]*n,r[1]*n];return ed(hd(t),a)}function Sd(t,e){return t[1]===e[1]}function Md(t,e){return[2*e[0]-t[0],2*e[1]-t[1]]}function Cd(t,e,n,i=!0,r=!1){for(let a=0;a<n.length;a++){let o=n[a],s=n[(a+1)%n.length];i&&(o=ed(e,o),s=ed(e,s));const l=gd([e,r?Md(t,e):t],[o,s]);if(l)return{point:l,line:[o,s]}}return{point:e,line:void 0}}function Ad(t,e,n=!1){const i=e.center,r=nd(n?Md(t,i):t,e.center),a=Math.atan2(r[1],r[0]);if(isNaN(a))return i;const o=Zc(e)/2,s=Wc(e)/2;return[i[0]+o*Math.cos(a),i[1]+s*Math.sin(a)]}function Od(t,e){let n=1/0,i=[[0,0],[0,0]];return e.forEach((e=>{const r=function(t,e){const n=Nd(t,e);return od(t,n)}(t,e);r<n&&(n=r,i=e)})),i}function Nd(t,e){const[n,i]=e[0],[r,a]=e[1],[o,s]=t,l=r-n,u=a-i;if(0===l&&0===u)return[n,i];let c=((o-n)*l+(s-i)*u)/(l*l+u*u);c>1?c=1:c<0&&(c=0);return[n+c*l,i+c*u]}function Pd(t,e=!0){const n=function(t){return rd(t.reduce(((t,e)=>ed(t,e)),[0,0]),t.length)}(t);return t.sort((([t,i],[r,a])=>{const o=Math.atan2(i-n[1],t-n[0]),s=Math.atan2(a-n[1],r-n[0]);return e?s-o:o-s}))}function Ld(t,e){return[t,[t[0],e[1]],e,[e[0],t[1]]]}const Rd=t=>t.map((t=>(0,ue.Z)(t)?t.toLocaleLowerCase():t));class Dd{constructor(t){this.map=new Map,this.recordKey=new Set,this.onKeyDown=t=>{(null==t?void 0:t.key)&&(this.recordKey.add(t.key),this.trigger(t))},this.onKeyUp=t=>{(null==t?void 0:t.key)&&this.recordKey.delete(t.key)},this.onWheel=t=>{this.triggerExtendKey(uc.WHEEL,t)},this.onDrag=t=>{this.triggerExtendKey(uc.DRAG,t)},this.onFocus=()=>{this.recordKey.clear()},this.emitter=t,this.bindEvents()}bind(t,e){0!==t.length&&this.map.set(t,e)}unbind(t,e){this.map.forEach(((n,i)=>{nc(i,t)&&(e&&e!==n||this.map.delete(i))}))}unbindAll(){this.map.clear()}match(t){const e=Rd(Array.from(this.recordKey)).sort(),n=Rd(t).sort();return nc(e,n)}bindEvents(){var t;const{emitter:e}=this;e.on(uc.KEY_DOWN,this.onKeyDown),e.on(uc.KEY_UP,this.onKeyUp),e.on(uc.WHEEL,this.onWheel),e.on(uc.DRAG,this.onDrag),null===(t=globalThis.addEventListener)||void 0===t||t.call(globalThis,"focus",this.onFocus)}trigger(t){this.map.forEach(((e,n)=>{this.match(n)&&e(t)}))}triggerExtendKey(t,e){this.map.forEach(((n,i)=>{i.includes(t)&&nc(Array.from(this.recordKey),i.filter((e=>e!==t)))&&n(e)}))}destroy(){var t;this.unbindAll(),this.emitter.off(uc.KEY_DOWN,this.onKeyDown),this.emitter.off(uc.KEY_UP,this.onKeyUp),this.emitter.off(uc.WHEEL,this.onWheel),this.emitter.off(uc.DRAG,this.onDrag),null===(t=globalThis.removeEventListener)||void 0===t||t.call(globalThis,"blur",this.onFocus)}}class kd extends Kh{constructor(t,e){super(t,(0,Jh.Z)({},kd.defaultOptions,e)),this.shortcut=new Dd(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:n}=this.context,i=Object.assign({},this.options.style);this.options.style.lineWidth&&(i.lineWidth=+this.options.style.lineWidth/n.getZoom()),this.rectShape=new Il({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:n,mode:i}=this.options;this.endPoint=Id(t),null===(e=this.rectShape)||void 0===e||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])}),n&&"default"===i&&this.updateElementsStates(Ld(this.startPoint,this.endPoint))}onPointerUp(t){this.startPoint&&(this.endPoint?(this.endPoint=Id(t),this.updateElementsStates(Ld(this.startPoint,this.endPoint)),this.clearBrush()):this.clearBrush())}clearStates(){this.endPoint||this.clearElementsStates()}clearElementsStates(){const{graph:t}=this.context,e=Object.values(t.getData()).reduce(((t,e)=>Object.assign({},t,e.reduce(((t,e)=>(t[kh(e)]=[],t)),{}))),{});t.setElementState(e,this.options.animation)}updateElementsStates(t){const{graph:e}=this.context,{enableElements:n,state:i,mode:r,onSelect:a}=this.options,o=this.selector(e,t,n);let s={};switch(r){case"union":o.forEach((t=>{s[t]=[...e.getElementState(t),i]}));break;case"diff":o.forEach((t=>{const n=e.getElementState(t);s[t]=n.includes(i)?n.filter((t=>t!==i)):[...n,i]}));break;case"intersect":o.forEach((t=>{const n=e.getElementState(t);s[t]=n.includes(i)?[i]:[]}));break;default:o.forEach((t=>{s[t]=[i]}))}(0,en.Z)(a)&&(s=a(s)),e.setElementState(s,this.options.animation)}selector(t,e,n){if(!n||0===n.length)return[];const i=[],r=t.getData();if(n.forEach((n=>{r[`${n}s`].forEach((n=>{const r=kh(n);"hidden"!==t.getElementVisibility(r)&&function(t,e,n,i){const r=t[0],a=t[1];let o=!1;void 0===n&&(n=0),void 0===i&&(i=e.length);const s=i-n;for(let t=0,i=s-1;t<s;i=t++){const s=e[t+n][0],l=e[t+n][1],u=e[i+n][0],c=e[i+n][1];l>a!=c>a&&r<(u-s)*(a-l)/(c-l)+s&&(o=!o)}return o}(t.getElementPosition(r),e)&&i.push(r)}))})),n.includes("edge")){const t=r.edges;null==t||t.forEach((t=>{const{source:e,target:n}=t;i.includes(e)&&i.includes(n)&&i.push(kh(t))}))}return i}clearBrush(){var t;null===(t=this.rectShape)||void 0===t||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((t=>"drag"!==t)))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}bindEvents(){const{graph:t}=this.context;t.on(uc.POINTER_DOWN,this.onPointerDown),t.on(uc.POINTER_MOVE,this.onPointerMove),t.on(uc.POINTER_UP,this.onPointerUp),t.on(sc.CLICK,this.clearStates)}unbindEvents(){const{graph:t}=this.context;t.off(uc.POINTER_DOWN,this.onPointerDown),t.off(uc.POINTER_MOVE,this.onPointerMove),t.off(uc.POINTER_UP,this.onPointerUp),t.off(sc.CLICK,this.clearStates)}update(t){this.unbindEvents(),this.options=(0,Jh.Z)(this.options,t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}kd.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 Id=t=>[t.canvas.x,t.canvas.y],Bd=.8,Fd=["node","edge","combo"];function zd(t,e,n,i,r=0){"TB"===i&&e(t,r);const a=n(t);if(a)for(const t of a)zd(t,e,n,i,r+1);"BT"===i&&e(t,r)}function Gd(t,e,n,i,r="both"){if("combo"===e||"node"===e)return jd(t,n,i,r);const a=t.getEdgeData(n);if(!a)return[];const o=jd(t,a.source,i-1,r),s=jd(t,a.target,i-1,r);return Array.from(new Set([...o,...s,n]))}function jd(t,e,n,i="both"){const r=new Set,a=new Set,o=new Set;return function(t,e,n){const i=[[t,0]];for(;i.length;){const[t,r]=i.shift();e(t,r);const a=n(t);if(a)for(const t of a)i.push([t,r+1])}}(e,((e,r)=>{r>n||(o.add(e),t.getRelatedEdgesData(e,i).forEach((t=>{const e=kh(t);!a.has(e)&&r<n&&(o.add(e),a.add(e))})))}),(e=>t.getRelatedEdgesData(e,i).map((t=>t.source===e?t.target:t.source)).filter((t=>!r.has(t)&&(r.add(t),!0))))),Array.from(o)}function Ud(t){return t.states||[]}var Hd=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Vd extends Kh{constructor(t,e){super(t,Object.assign({},Vd.defaultOptions,e)),this.onClickSelect=t=>Hd(this,void 0,void 0,(function*(){var e,n;this.validate(t)&&(yield this.updateState(t),null===(n=(e=this.options).onClick)||void 0===n||n.call(e,t))})),this.onClickCanvas=t=>Hd(this,void 0,void 0,(function*(){var e,n;this.validate(t)&&(yield this.clearState(),null===(n=(e=this.options).onClick)||void 0===n||n.call(e,t))})),this.shortcut=new Dd(t.graph),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Fd.forEach((e=>{t.on(`${e}:${uc.CLICK}`,this.onClickSelect)})),t.on(sc.CLICK,this.onClickCanvas)}get isMultipleSelect(){const{multiple:t,trigger:e}=this.options;return t&&this.shortcut.match(e)}getNeighborIds(t){const{target:e,targetType:n}=t,{graph:i}=this.context,{degree:r}=this.options;return Gd(i,n,e.id,"function"==typeof r?r(t):r).filter((t=>t!==e.id))}updateState(t){return Hd(this,void 0,void 0,(function*(){const{state:e,unselectedState:n,neighborState:i,animation:r}=this.options;if(!e&&!i&&!n)return;const{target:a}=t,{graph:o}=this.context,s=Ud(o.getElementData(a.id)).includes(e)?"unselect":"select",l={},u=this.isMultipleSelect,c=[a.id],h=this.getNeighborIds(t);if(u)if(Object.assign(l,this.getDataStates()),"select"===s){const t=(t,e)=>{t.forEach((t=>{const i=new Set(o.getElementState(t));i.add(e),i.delete(n),l[t]=Array.from(i)}))};t(c,e),t(h,i),n&&Object.keys(l).forEach((t=>{const r=l[t];r.includes(e)||r.includes(i)||r.includes(n)||l[t].push(n)}))}else{const t=l[a.id];l[a.id]=t.filter((t=>t!==e&&t!==i)),t.includes(n)||l[a.id].push(n),h.forEach((t=>{l[t]=l[t].filter((t=>t!==i)),l[t].includes(e)||l[t].push(n)}))}else if("select"===s){Object.assign(l,this.getClearStates(!!n));const t=(t,e)=>{t.forEach((t=>{l[t]||(l[t]=o.getElementState(t)),l[t].push(e)}))};t(c,e),t(h,i),n&&Object.keys(l).forEach((t=>{c.includes(t)||h.includes(t)||l[t].push(n)}))}else Object.assign(l,this.getClearStates());yield o.setElementState(l,r)}))}getDataStates(){const{graph:t}=this.context,{nodes:e,edges:n,combos:i}=t.getData(),r={};return[...e,...n,...i].forEach((t=>{r[kh(t)]=Ud(t)})),r}getClearStates(t=!1){const{graph:e}=this.context,{state:n,unselectedState:i,neighborState:r}=this.options,a=new Set([n,i,r]),{nodes:o,edges:s,combos:l}=e.getData(),u={};return[...o,...s,...l].forEach((e=>{const n=Ud(e),i=n.filter((t=>!a.has(t)));(t||i.length!==n.length)&&(u[kh(e)]=i)})),u}clearState(){return Hd(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(0,en.Z)(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Fd.forEach((e=>{t.off(`${e}:${uc.CLICK}`,this.onClickSelect)})),t.off(sc.CLICK,this.onClickCanvas)}destroy(){this.unbindEvents(),super.destroy()}}function Zd(t){var e;return!!(null===(e=t.style)||void 0===e?void 0:e.collapsed)}Vd.defaultOptions={animation:!0,enable:!0,multiple:!1,trigger:["shift"],state:"selected",neighborState:"selected",unselectedState:void 0,degree:0};var Wd=function(t,e,n){for(var i=0,r=(0,ue.Z)(e)?e.split("."):e;t&&i<r.length;)t=t[r[i++]];return void 0===t||i<r.length?n:t},Xd=function(t,e,n){var i=t,r=(0,ue.Z)(e)?e.split("."):e;return r.forEach((function(t,e){e<r.length-1?((0,nn.Z)(i[t])||(i[t]=(0,oe.Z)(r[e+1])?[]:{}),i=i[t]):i[t]=n})),t},Yd=function(t){var e=Ku(t);return e.charAt(0).toLowerCase()+e.substring(1)};function qd(t,e){if(!t.startsWith(e))return!1;const n=t[e.length];return n>="A"&&n<="Z"}function $d(t,e){return`${e}${Qu(t)}`}function Kd(t,e,n=!0){if(!e)return t;if(!qd(t,e))return t;const i=t.slice(e.length);return n?Yd(i):i}function Qd(t,e){const n=Object.entries(t).reduce(((t,[n,i])=>("className"===n||"class"===n||qd(n,e)&&Object.assign(t,{[Kd(n,e)]:i}),t)),{});if("opacity"in t){const i=$d("opacity",e),r=t.opacity;if(i in t){const e=t[i];Object.assign(n,{opacity:r*e})}else Object.assign(n,{opacity:r})}return n}function Jd(t,e){const n=e.length;return Object.keys(t).reduce(((i,r)=>{if(r.startsWith(e)){i[r.slice(n)]=t[r]}return i}),{})}function tf(t,e){const n="string"==typeof e?[e]:e,i={};return Object.keys(t).forEach((e=>{n.find((t=>e.startsWith(t)))||(i[e]=t[e])})),i}function ef(t=0){if("number"==typeof t)return[t,t,t];const[e,n=e,i=e]=t;return[e,n,i]}var nf=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function rf(t,e){const{datum:n,graph:i}=e;return"function"==typeof t?t.call(i,n):Object.fromEntries(Object.entries(t).map((([t,e])=>"function"==typeof e?[t,e.call(i,n)]:[t,e])))}function af(t,e){const n=(null==t?void 0:t.style)||{},i=(null==e?void 0:e.style)||{};return Object.assign({},t,e,{style:(null==t?void 0:t.style)?Object.assign({},n,i):i})}const of=new WeakMap;function sf(t,e,n){of.has(t)||of.set(t,{});const i=of.get(t);if(!i[e])return i[e]=n,!0;const r=i[e];return!lf(r,n)&&(i[e]=n,!0)}const lf=(t,e,n=2)=>{if("object"!=typeof t||"object"!=typeof e)return t===e;const i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length)return!1;for(const r of i){const i=t[r],a=e[r];if(n>1&&"object"==typeof i&&"object"==typeof a){if(!lf(i,a,n-1))return!1}else if(i!==a)return!1}return!0};function uf(t){if(t)return"string"==typeof t||"function"==typeof t||Array.isArray(t)?{type:"group",field:t=>t.id,color:t,invert:!1}:t}function cf(t){const e="string"==typeof t?xc("palette",t):t;if("function"!=typeof e)return e}function hf(t,e){let n=2*t;return"string"==typeof e?n=t*Number(e.replace("%",""))/100:"number"==typeof e&&(n=e),isNaN(n)&&(n=2*t),n}function df(t,e,n=1,i=!1){const r=i?n:1;return hf((t.max[0]-t.min[0])*r,e)}var ff={}.toString,pf=function(t){return ff.call(t).replace(/^\[object /,"").replace(/]$/,"")},gf=Object.prototype,mf=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||gf)},vf=Object.prototype.hasOwnProperty;var yf=function(t){if((0,le.Z)(t))return!0;if(tc(t))return!t.length;var e=pf(t);if("Map"===e||"Set"===e)return!t.size;if(mf(t))return!Object.keys(t).length;for(var n in t)if(vf.call(t,n))return!1;return!0};class xf extends El{constructor(t){super(t),this.shapeMap={},this.animateMap={},this.transformPosition(this.attributes),this.render(this.attributes,this),this.setVisibility(),this.bindEvents()}get parsedAttributes(){return this.attributes}upsert(t,e,n,i,r){var a,o,s,l,u,c,h,d;const f=this.shapeMap[t];if(!1===n)return void(f&&(null===(a=null==r?void 0:r.beforeDestroy)||void 0===a||a.call(r,f),i.removeChild(f),delete this.shapeMap[t],null===(o=null==r?void 0:r.afterDestroy)||void 0===o||o.call(r,f)));const p="string"==typeof e?xc(vc.SHAPE,e):e;if(!p)throw new Error(bc(`Shape ${e} not found`));if(!f||f.destroyed||!(f instanceof p)){f&&(null===(s=null==r?void 0:r.beforeDestroy)||void 0===s||s.call(r,f),null==f||f.destroy(),null===(l=null==r?void 0:r.afterDestroy)||void 0===l||l.call(r,f)),null===(u=null==r?void 0:r.beforeCreate)||void 0===u||u.call(r);const e=new p({className:t,style:n});return i.appendChild(e),this.shapeMap[t]=e,null===(c=null==r?void 0:r.afterCreate)||void 0===c||c.call(r,e),e}return null===(h=null==r?void 0:r.beforeUpdate)||void 0===h||h.call(r,f),wm(f,n),null===(d=null==r?void 0:r.afterUpdate)||void 0===d||d.call(r,f),f}transformPosition(t){if("x"in t||"y"in t||"z"in t){const{x:e=0,y:n=0,z:i=0,transform:r}=t,a=Ac(+e,+n,+i,r);a&&(this.style.transform=a)}}update(t={}){const e=Object.assign({},this.attributes,t);this.attr(e),this.render(e,this),this.transformPosition(e),this.setVisibility()}bindEvents(){}getGraphicStyle(t){return function(t){const{x:e,y:n,z:i,class:r,className:a,transform:o,transformOrigin:s,zIndex:l,visibility:u}=t;return nf(t,["x","y","z","class","className","transform","transformOrigin","zIndex","visibility"])}(t)}get compositeShapes(){return[["badges","badge-"],["ports","port-"]]}animate(t,e){if(0===t.length)return null;const n=[];if(void 0!==t[0].x||void 0!==t[0].y||void 0!==t[0].z){const{x:e=0,y:n=0,z:i=0}=this.attributes;t.forEach((t=>{const{x:r=e,y:a=n,z:o=i}=t;Object.assign(t,{transform:o?[["translate3d",r,a,o]]:[["translate",r,a]]})}))}const i=super.animate(t,e);if(i&&(bf(this,i),n.push(i)),Array.isArray(t)&&t.length>0){const i=["transform","transformOrigin","x","y","z","zIndex"];if(Object.keys(t[0]).some((t=>!i.includes(t)))){Object.entries(this.shapeMap).forEach((([i,r])=>{const a=this[`get${Qu(i)}Style`];if((0,en.Z)(a)){const i=t.map((t=>a.call(this,Object.assign(Object.assign({},this.attributes),t)))),o=r.animate(Tc(i),e);o&&(bf(r,o),n.push(o))}}));const i=(i,r)=>{if(!yf(i)){const a=this[`get${Qu(r)}Style`];if((0,en.Z)(a)){const r=t.map((t=>a.call(this,Object.assign(Object.assign({},this.attributes),t))));Object.entries(r[0]).map((([t])=>{const a=r.map((e=>e[t])),o=i[t];if(o){const t=o.animate(Tc(a),e);t&&(bf(o,t),n.push(t))}}))}}};this.compositeShapes.forEach((([t,e])=>{const n=Jd(this.shapeMap,e);i(n,t)}))}}return wc(n)}getShape(t){return this.shapeMap[t]}setVisibility(){const{visibility:t}=this.attributes;Yh(this,t,!0)}destroy(){this.shapeMap={},this.animateMap={},super.destroy()}}function bf(t,e){null==e||e.finished.then((()=>{const n=t.activeAnimations.findIndex((t=>t===e));n>-1&&t.activeAnimations.splice(n,1)}))}var _f=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class Ef extends xf{constructor(t){super(af({style:Ef.defaultStyleProps},t))}isTextStyle(t){return qd(t,"label")}isBackgroundStyle(t){return qd(t,"background")}getTextStyle(t){const e=this.getGraphicStyle(t),{padding:n}=e;return tf(_f(e,["padding"]),"background")}getBackgroundStyle(t){if(!1===t.background)return!1;const e=this.getGraphicStyle(t),{wordWrap:n,wordWrapWidth:i,padding:r}=e,a=Qd(e,"background"),{min:[o,s],center:[l,u],halfExtents:[c,h]}=this.shapeMap.text.getGeometryBounds(),[d,f,p,g]=Hc(r),m=2*c+g+f,{width:v,height:y}=a;v&&y?Object.assign(a,{x:l-Number(v)/2,y:u-Number(y)/2}):Object.assign(a,{x:o-g,y:s-d,width:n?Math.min(m,i+g+f):m,height:2*h+d+p});const{radius:x}=a;if("string"==typeof x&&x.endsWith("%")){const t=Number(x.replace("%",""))/100;a.radius=Math.min(+a.width,+a.height)*t}return a}render(t=this.parsedAttributes,e=this){this.upsert("text",Fl,this.getTextStyle(t),e),this.upsert("background",Il,this.getBackgroundStyle(t),e)}getGeometryBounds(){return(this.getShape("background")||this.getShape("text")).getGeometryBounds()}}Ef.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 wf extends xf{constructor(t){super(af({style:wf.defaultStyleProps},t))}getBadgeStyle(t){return this.getGraphicStyle(t)}render(t=this.parsedAttributes,e=this){this.upsert("label",Ef,this.getBadgeStyle(t),e)}getGeometryBounds(){const t=this.getShape("label");return(t.getShape("background")||t.getShape("text")).getGeometryBounds()}}wf.defaultStyleProps={padding:[2,4,2,4],fontSize:10,wordWrap:!1,backgroundRadius:"50%",backgroundOpacity:1};const Tf={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 Sf(t){const e=[],n="string"==typeof t?function(t){const e=t.replace(/[\n\r]/g,"").replace(/-/g," -").replace(/(\d*\.)(\d+)(?=\.)/g,"$1$2 ").trim().split(/\s*,|\s+/),n=[];let i="",r={};for(;e.length>0;){let t=e.shift();t in Tf?i=t:e.unshift(t),r={type:i},Tf[i].forEach((n=>{t=e.shift(),r[n]=t})),"M"===i?i="L":"m"===i&&(i="l");const[a,...o]=Object.values(r);n.push([a,...o.map(Number)])}return n}(t):t;return n.forEach((t=>{const n=t[0];if("Z"!==n)if("A"!==n)for(let n=1;n<t.length;n+=2)e.push([t[n],t[n+1],0]);else{const n=t.length;e.push([t[n-2],t[n-1],0])}else e.push(e[0])})),e}const Mf=t=>{if(t.length<2)return[["M",0,0],["L",0,0]];const e=t[0],n=t[1],i=t[t.length-1],r=t[t.length-2];t.unshift(r,i),t.push(e,n);const a=[["M",i[0],i[1]]];for(let e=1;e<t.length-2;e+=1){const[n,i]=t[e-1],[r,o]=t[e],[s,l]=t[e+1],[u,c]=e!==t.length-2?t[e+2]:[s,l],h=r+(s-n)/6,d=o+(l-i)/6,f=s-(u-r)/6,p=l-(c-o)/6;a.push(["C",h,d,f,p,s,l])}return a};var Cf=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class Af extends xf{constructor(t){super(af({style:Af.defaultStyleProps},t))}getLabelStyle(t){if(!t.label||!t.d||0===t.d.length)return!1;const e=Qd(this.getGraphicStyle(t),"label"),{maxWidth:n,offsetX:i,offsetY:r,autoRotate:a,placement:o,closeToPath:s}=e,l=Cf(e,["maxWidth","offsetX","offsetY","autoRotate","placement","closeToPath"]),u=this.shapeMap.key,c=null==u?void 0:u.getRenderBounds();return Object.assign(function(t,e,n,i,r,a,o){const[s,l]=bd(t,e),u={textAlign:"left"===e?"right":"right"===e?"left":"center",textBaseline:"top"===e?"bottom":"bottom"===e?"top":"middle",transform:[["translate",s+n,l+i]]};if("center"===e||!r)return u;const c=Sf(a);if(!c||c.length<=3)return u;const h=c.map(((t,e)=>{const n=t,i=c[(e+1)%c.length];return nc(n,i)?null:[n,i]})).filter(Boolean),d=Od([s,l],h),f=Nd([s,l],d);if(f&&d&&(u.transform=[["translate",f[0]+n,f[1]+i]],o)){const t=Math.atan((d[0][1]-d[1][1])/(d[0][0]-d[1][0]));u.transform.push(["rotate",t/Math.PI*180]),u.textAlign="center","right"!==e&&"left"!==e||(u.textBaseline=t>0?"right"===e?"bottom":"top":"right"===e?"top":"bottom")}return u}(c,o,i,r,s,t.d,a),{wordWrapWidth:df(c,n)},l)}getKeyStyle(t){return this.getGraphicStyle(t)}render(t,e){this.upsert("key",Pl,this.getKeyStyle(t),e),this.upsert("label",Ef,this.getLabelStyle(t),e)}}Af.defaultStyleProps={label:!0,labelPlacement:"bottom",labelCloseToPath:!0,labelAutoRotate:!0,labelOffsetX:0,labelOffsetY:0};class Of extends Cl{constructor(t){super(t),this.onMounted=()=>{this.handleRadius()},this.onAttrModified=()=>{this.handleRadius()},Pf=this,this.isMutationObserved=!0,this.addEventListener(Ms.MOUNTED,this.onMounted),this.addEventListener(Ms.ATTR_MODIFIED,this.onAttrModified)}handleRadius(){const{radius:t,clipPath:e,width:n=0,height:i=0}=this.attributes;if(t&&n&&i){const[r,a]=this.getBounds().min,o={x:r,y:a,radius:t,width:n,height:i};if(e)Object.assign(this.parsedStyle.clipPath.style,o);else{const t=new Il({style:o});this.style.clipPath=t}}else e&&(this.style.clipPath=null)}}const Nf=new WeakMap;let Pf=null;const Lf=t=>{if(Pf&&function(t){const e=[];let n=t.parentNode;for(;n;)e.push(n),n=n.parentNode;return e}(Pf).includes(t)){const e=Nf.get(t);e?e.includes(Pf)||e.push(Pf):Nf.set(t,[Pf])}},Rf=t=>{const e=Nf.get(t);e&&e.forEach((t=>t.handleRadius()))};class Df extends xf{constructor(t){super(t)}isImage(){const{src:t}=this.attributes;return!!t}getIconStyle(t=this.attributes){const{width:e=0,height:n=0}=t,i=this.getGraphicStyle(t);return this.isImage()?Object.assign({x:-e/2,y:-n/2},i):Object.assign({textBaseline:"middle",textAlign:"center"},i)}render(t=this.attributes,e=this){this.upsert("icon",this.isImage()?Of:Fl,this.getIconStyle(t),e)}}class kf extends xf{get context(){return this.config.context}get parsedAttributes(){return this.attributes}onframe(){}animate(t,e){const n=super.animate(t,e);return n&&(n.onframe=()=>this.onframe(),n.finished.then((()=>this.onframe()))),n}}var If=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class Bf extends kf{constructor(t){super(af({style:Bf.defaultStyleProps},t)),this.type="node"}getSize(t=this.attributes){const{size:e}=t;return ef(e)}getKeyStyle(t){const e=this.getGraphicStyle(t);return Object.assign(tf(e,["label","halo","icon","badge","port"]))}getLabelStyle(t){if(!1===t.label||!t.labelText)return!1;const e=Qd(this.getGraphicStyle(t),"label"),{placement:n,maxWidth:i,offsetX:r,offsetY:a}=e,o=If(e,["placement","maxWidth","offsetX","offsetY"]),s=this.getShape("key").getLocalBounds();return Object.assign(Em(s,n,r,a),{wordWrapWidth:df(s,i)},o)}getHaloStyle(t){if(!1===t.halo)return!1;const e=this.getKeyStyle(t),{fill:n}=e,i=If(e,["fill"]),r=Qd(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign(Object.assign({},i),{stroke:n}),r)}getIconStyle(t){if(!1===t.icon||!t.iconText&&!t.iconSrc)return!1;const e=Qd(this.getGraphicStyle(t),"icon");return Object.assign(function(t,e){const n=ef(t);let i={};return e.text&&!e.fontSize&&(i={fontSize:.5*Math.min(...n)}),!e.src||e.width&&e.height||(i={width:.5*n[0],height:.5*n[1]}),i}(t.size,e),e)}getBadgesStyle(t){var e;const n=Jd(this.shapeMap,"badge-"),i={};if(Object.keys(n).forEach((t=>{i[t]=!1})),!1===t.badge||!(null===(e=t.badges)||void 0===e?void 0:e.length))return i;const{badges:r=[],badgePalette:a,opacity:o=1}=t,s=If(t,["badges","badgePalette","opacity"]),l=cf(a),u=Qd(this.getGraphicStyle(s),"badge");return r.forEach(((t,e)=>{i[e]=Object.assign(Object.assign({backgroundFill:l?l[e%(null==l?void 0:l.length)]:void 0,opacity:o},u),this.getBadgeStyle(t))})),i}getBadgeStyle(t){const e=this.getShape("key"),{placement:n="top",offsetX:i,offsetY:r}=t,a=If(t,["placement","offsetX","offsetY"]),o=Em(e.getLocalBounds(),n,i,r,!0);return Object.assign(Object.assign({},o),a)}getPortsStyle(t){var e;const n=this.getPorts(),i={};if(Object.keys(n).forEach((t=>{i[t]=!1})),!1===t.port||!(null===(e=t.ports)||void 0===e?void 0:e.length))return i;const r=Qd(this.getGraphicStyle(t),"port"),{ports:a=[]}=t;return a.forEach(((e,n)=>{const a=e.key||n,o=Object.assign(Object.assign({},r),e);if(mm(o))i[a]=!1;else{const[n,r]=this.getPortXY(t,e);i[a]=Object.assign({transform:[["translate",n,r]]},o)}})),i}getPortXY(t,e){const{placement:n="left"}=e,i=this.getShape("key");return pm(function(t,e){if(!t)return e.getLocalBounds();const n=t.canvas.getLayer(),i=e.cloneNode();Yh(i,"hidden"),n.appendChild(i);const r=i.getLocalBounds();return i.destroy(),r}(this.context,i),n)}getPorts(){return Jd(this.shapeMap,"port-")}getCenter(){return this.getShape("key").getBounds().center}getIntersectPoint(t,e=!1){return function(t,e,n=!1){return Cd(t,bd(e,"center"),[bd(e,"left-top"),bd(e,"right-top"),bd(e,"right-bottom"),bd(e,"left-bottom")],!1,n).point}(t,this.getShape("key").getBounds(),e)}drawHaloShape(t,e){const n=this.getHaloStyle(t);if(!sf(this,"halo",n))return;const i=this.getShape("key");this.upsert("halo",i.constructor,n,e)}drawIconShape(t,e){const n=this.getIconStyle(t);sf(this,"icon",n)&&(this.upsert("icon",Df,n,e),Lf(this))}drawBadgeShapes(t,e){const n=this.getBadgesStyle(t);Object.keys(n).forEach((t=>{const i=n[t];sf(this,`badge-${t}`,i)&&this.upsert(`badge-${t}`,wf,i,e)}))}drawPortShapes(t,e){const n=this.getPortsStyle(t);Object.keys(n).forEach((t=>{const i=n[t],r=`port-${t}`;sf(this,r,i)&&this.upsert(r,bl,i,e)}))}drawLabelShape(t,e){const n=this.getLabelStyle(t);sf(this,"label",n)&&this.upsert("label",Ef,n,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)&&Rf(this)}onframe(){this.drawBadgeShapes(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this)}}Bf.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};class Ff extends Bf{constructor(t){super(af({style:Ff.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",bl,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:n}=this.getShape("key").attributes,i=2*n*Bd;return!!e&&Object.assign({width:i,height:i},e)}getIntersectPoint(t,e=!1){return Ad(t,this.getShape("key").getBounds(),e)}}Ff.defaultStyleProps={size:32};class zf extends Bf{constructor(t){super(t)}get parsedAttributes(){return this.attributes}drawKeyShape(t,e){return this.upsert("key",Rl,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 n,i;const{points:r}=this.getShape("key").attributes;return Cd(t,[+((null===(n=this.attributes)||void 0===n?void 0:n.x)||0),+((null===(i=this.attributes)||void 0===i?void 0:i.y)||0)],r,!0,e).point}}var Gf=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class jf extends Ff{constructor(t){super(af({style:jf.defaultStyleProps},t))}parseOuterR(){const{size:t}=this.parsedAttributes;return Math.min(...ef(t))/2}parseInnerR(){const{innerR:t}=this.parsedAttributes;return(0,ue.Z)(t)?parseInt(t)/100*this.parseOuterR():t}drawDonutShape(t,e){const{donuts:n}=t;if(!(null==n?void 0:n.length))return;const i=n.map((t=>(0,oe.Z)(t)?{value:t}:t)),r=Qd(this.getGraphicStyle(t),"donut"),a=cf(t.donutPalette);if(!a)return;const o=i.reduce(((t,e)=>{var n;return t+(null!==(n=e.value)&&void 0!==n?n:0)}),0),s=this.parseOuterR(),l=this.parseInnerR();let u=0;i.forEach(((t,n)=>{const{value:c=0,color:h=a[n%a.length]}=t,d=Gf(t,["value","color"]),f=360*(0===o?1/i.length:c/o);this.upsert(`round${n}`,Pl,Object.assign(Object.assign(Object.assign({},r),{d:Hf(s,l,u,u+f),fill:h}),d),e),u+=f}))}render(t,e=this){super.render(t,e),this.drawDonutShape(t,e)}}jf.defaultStyleProps={innerR:"50%",donuts:[],donutPalette:"tableau"};const Uf=(t,e,n,i)=>[t+Math.sin(i)*n,e-Math.cos(i)*n],Hf=(t=0,e=0,n,i)=>{const[r,a]=[0,0];return Math.abs(n-i)%360<1e-6?((t,e,n,i)=>i<=0||n<=i?[["M",t-n,e],["A",n,n,0,1,1,t+n,e],["A",n,n,0,1,1,t-n,e],["Z"]]:[["M",t-n,e],["A",n,n,0,1,1,t+n,e],["A",n,n,0,1,1,t-n,e],["Z"],["M",t+i,e],["A",i,i,0,1,0,t-i,e],["A",i,i,0,1,0,t+i,e],["Z"]])(r,a,t,e):((t,e,n,i,r,a)=>{const[o,s]=[r/360*2*Math.PI,a/360*2*Math.PI],l=[Uf(t,e,i,o),Uf(t,e,n,o),Uf(t,e,n,s),Uf(t,e,i,s)],u=s-o>Math.PI?1:0;return[["M",l[0][0],l[0][1]],["L",l[1][0],l[1][1]],["A",n,n,0,u,1,l[2][0],l[2][1]],["L",l[3][0],l[3][1]],["A",i,i,0,u,0,l[0][0],l[0][1]],["Z"]]})(r,a,t,e,n,i)};class Vf extends Bf{constructor(t){super(af({style:Vf.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",wl,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t),[n,i]=this.getSize(t);return Object.assign(Object.assign({},e),{rx:n/2,ry:i/2})}getIconStyle(t){const e=super.getIconStyle(t),{rx:n,ry:i}=this.getShape("key").attributes,r=2*Math.min(+n,+i)*Bd;return!!e&&Object.assign({width:r,height:r},e)}getIntersectPoint(t,e=!1){return Ad(t,this.getShape("key").getBounds(),e)}}Vf.defaultStyleProps={size:[45,35]};function Zf(t,e){var n=e.cx,i=void 0===n?0:n,r=e.cy,a=void 0===r?0:r,o=e.r;t.arc(i,a,o,0,2*Math.PI,!1)}function Wf(t,e){var n=e.cx,i=void 0===n?0:n,r=e.cy,a=void 0===r?0:r,o=e.rx,s=e.ry;if(t.ellipse)t.ellipse(i,a,o,s,0,0,2*Math.PI,!1);else{var l=o>s?o:s,u=o>s?1:o/s,c=o>s?s/o:1;t.save(),t.scale(u,c),t.arc(i,a,l,0,2*Math.PI)}}function Xf(t,e){var n,i,r=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.markerStart,u=e.markerEnd,c=e.markerStartOffset,h=e.markerEndOffset,d=0,f=0,p=0,g=0,m=0;l&&pl(l)&&c&&(n=o-r,i=s-a,m=Math.atan2(i,n),d=Math.cos(m)*(c||0),f=Math.sin(m)*(c||0)),u&&pl(u)&&h&&(n=r-o,i=a-s,m=Math.atan2(i,n),p=Math.cos(m)*(h||0),g=Math.sin(m)*(h||0)),t.moveTo(r+d,a+f),t.lineTo(o+p,s+g)}function Yf(t,e){var n,i,r=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.d,u=l.absolutePath,c=l.segments,h=0,d=0,f=0,g=0,m=0;if(r&&pl(r)&&o){var v=r.parentNode.getStartTangent(),y=(0,p.Z)(v,2),x=y[0],b=y[1];n=x[0]-b[0],i=x[1]-b[1],m=Math.atan2(i,n),h=Math.cos(m)*(o||0),d=Math.sin(m)*(o||0)}if(a&&pl(a)&&s){var _=a.parentNode.getEndTangent(),E=(0,p.Z)(_,2),w=E[0],T=E[1];n=w[0]-T[0],i=w[1]-T[1],m=Math.atan2(i,n),f=Math.cos(m)*(s||0),g=Math.sin(m)*(s||0)}for(var S=0;S<u.length;S++){var M=u[S],C=M[0],A=u[S+1],O=0===S&&(0!==h||0!==d),N=(S===u.length-1||A&&("M"===A[0]||"Z"===A[0]))&&0!==f&&0!==g,P=O?[h,d]:[0,0],L=(0,p.Z)(P,2),R=L[0],D=L[1],k=N?[f,g]:[0,0],I=(0,p.Z)(k,2),B=I[0],F=I[1];switch(C){case"M":t.moveTo(M[1]+R,M[2]+D);break;case"L":t.lineTo(M[1]+B,M[2]+F);break;case"Q":t.quadraticCurveTo(M[1],M[2],M[3]+B,M[4]+F);break;case"C":t.bezierCurveTo(M[1],M[2],M[3],M[4],M[5]+B,M[6]+F);break;case"A":var z=c[S].arcParams,G=z.cx,j=z.cy,U=z.rx,H=z.ry,V=z.startAngle,Z=z.endAngle,W=z.xRotation,X=z.sweepFlag;if(t.ellipse)t.ellipse(G,j,U,H,W,V,Z,!!(1-X));else{var Y=U>H?U:H,q=U>H?1:U/H,$=U>H?H/U:1;t.translate(G,j),t.rotate(W),t.scale(q,$),t.arc(0,0,Y,V,Z,!!(1-X)),t.scale(1/q,1/$),t.rotate(-W),t.translate(-G,-j)}N&&t.lineTo(M[6]+f,M[7]+g);break;case"Z":t.closePath()}}}function qf(t,e){var n,i,r=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,u=l.length,c=l[0][0],h=l[0][1],d=l[u-1][0],f=l[u-1][1],p=0,g=0,m=0,v=0,y=0;r&&pl(r)&&o&&(n=l[1][0]-l[0][0],i=l[1][1]-l[0][1],y=Math.atan2(i,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&pl(a)&&s&&(n=l[u-1][0]-l[0][0],i=l[u-1][1]-l[0][1],y=Math.atan2(i,n),m=Math.cos(y)*(s||0),v=Math.sin(y)*(s||0)),t.moveTo(c+(p||m),h+(g||v));for(var x=1;x<u-1;x++){var b=l[x];t.lineTo(b[0],b[1])}t.lineTo(d,f)}function $f(t,e){var n,i,r=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,u=l.length,c=l[0][0],h=l[0][1],d=l[u-1][0],f=l[u-1][1],p=0,g=0,m=0,v=0,y=0;r&&pl(r)&&o&&(n=l[1][0]-l[0][0],i=l[1][1]-l[0][1],y=Math.atan2(i,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&pl(a)&&s&&(n=l[u-2][0]-l[u-1][0],i=l[u-2][1]-l[u-1][1],y=Math.atan2(i,n),m=Math.cos(y)*(s||0),v=Math.sin(y)*(s||0)),t.moveTo(c+p,h+g);for(var x=1;x<u-1;x++){var b=l[x];t.lineTo(b[0],b[1])}t.lineTo(d+m,f+v)}function Kf(t,e){var n=e.x,i=void 0===n?0:n,r=e.y,a=void 0===r?0:r,o=e.radius,s=e.width,l=e.height,u=s,c=l;if(o&&o.some((function(t){return 0!==t}))){var h=s>0?1:-1,d=l>0?1:-1,f=h+d===0,g=o.map((function(t){return ce(t,0,Math.min(Math.abs(u)/2,Math.abs(c)/2))})),m=(0,p.Z)(g,4),v=m[0],y=m[1],x=m[2],b=m[3];t.moveTo(h*v+i,a),t.lineTo(u-h*y+i,a),0!==y&&t.arc(u-h*y+i,d*y+a,y,-d*Math.PI/2,h>0?0:Math.PI,f),t.lineTo(u+i,c-d*x+a),0!==x&&t.arc(u-h*x+i,c-d*x+a,x,h>0?0:Math.PI,d>0?Math.PI/2:1.5*Math.PI,f),t.lineTo(h*b+i,c+a),0!==b&&t.arc(h*b+i,c-d*b+a,b,d>0?Math.PI/2:-Math.PI/2,h>0?Math.PI:0,f),t.lineTo(i,d*v+a),0!==v&&t.arc(h*v+i,d*v+a,v,h>0?Math.PI:0,d>0?1.5*Math.PI:Math.PI/2,f)}else t.rect(i,a,u,c)}var Qf=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).name="canvas-path-generator",t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){var t,e=(t={},(0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)(t,pi.CIRCLE,Zf),pi.ELLIPSE,Wf),pi.RECT,Kf),pi.LINE,Xf),pi.POLYLINE,$f),pi.POLYGON,qf),pi.PATH,Yf),pi.TEXT,void 0),pi.GROUP,void 0),pi.IMAGE,void 0),(0,an.Z)((0,an.Z)((0,an.Z)(t,pi.HTML,void 0),pi.MESH,void 0),pi.FRAGMENT,void 0));this.context.pathGeneratorFactory=e}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(mi),Jf=y(),tp=y(),ep=y(),np=U(),ip=function(){function t(){var e=this;(0,o.Z)(this,t),this.isHit=function(t,n,i,r){var a=e.context.pointInPathPickerFactory[t.nodeName];if(a){var o=q(np,i),s=L(tp,w(ep,n[0],n[1],0),o);if(a(t,new Ai(s[0],s[1]),r,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(t,n){var i=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),r=e.context.pathGeneratorFactory[t.nodeName];return r&&(i.beginPath(),r(i,t.parsedStyle),i.closePath()),i.isPointInPath(n.x,n.y)}}return(0,s.Z)(t,[{key:"apply",value:function(e,n){var i,r=this,a=e.renderingService,o=e.renderingContext;this.context=e,this.runtime=n;var s=null===(i=o.root)||void 0===i?void 0:i.ownerDocument;a.hooks.pick.tapPromise(t.tag,function(){var t=(0,li.Z)((0,si.Z)().mark((function t(e){return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.pick(s,e));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),a.hooks.pickSync.tap(t.tag,(function(t){return r.pick(s,t)}))}},{key:"pick",value:function(t,e){var n,i=e.topmost,r=e.position,a=r.x,o=r.y,s=w(Jf,a,o,0),l=[],u=ci(t.elementsFromBBox(s[0],s[1],s[0],s[1]));try{for(u.s();!(n=u.n()).done;){var c=n.value,h=c.getWorldTransform();if(this.isHit(c,s,h,!1)){var d=wo(c);if(d){var f=d.parsedStyle.clipPath;if(this.isHit(f,s,f.getWorldTransform(),!0)){if(i)return e.picked=[c],e;l.push(c)}}else{if(i)return e.picked=[c],e;l.push(c)}}}}catch(t){u.e(t)}finally{u.f()}return e.picked=l,e}}])}();function rp(t,e,n){var i=t.parsedStyle,r=i.cx,a=void 0===r?0:r,o=i.cy,s=void 0===o?0:o,l=i.r,u=i.fill,c=i.stroke,h=i.lineWidth,d=void 0===h?1:h,f=i.increasedLineWidthForHitTesting,g=void 0===f?0:f,m=i.pointerEvents,v=void 0===m?"auto":m,y=(d+g)/2,x=Hn(a,s,e.x,e.y),b=Ao(v,u,c),_=(0,p.Z)(b,2),E=_[0],w=_[1];return E&&w||n?x<=l+y:E?x<=l:!!w&&(x>=l-y&&x<=l+y)}function ap(t,e,n,i){return t/(n*n)+e/(i*i)}function op(t,e,n){var i=t.parsedStyle,r=i.cx,a=void 0===r?0:r,o=i.cy,s=void 0===o?0:o,l=i.rx,u=i.ry,c=i.fill,h=i.stroke,d=i.lineWidth,f=void 0===d?1:d,g=i.increasedLineWidthForHitTesting,m=void 0===g?0:g,v=i.pointerEvents,y=void 0===v?"auto":v,x=e.x,b=e.y,_=Ao(y,c,h),E=(0,p.Z)(_,2),w=E[0],T=E[1],S=(f+m)/2,M=(x-a)*(x-a),C=(b-s)*(b-s);return w&&T||n?ap(M,C,l+S,u+S)<=1:w?ap(M,C,l,u)<=1:!!T&&(ap(M,C,l-S,u-S)>=1&&ap(M,C,l+S,u+S)<=1)}function sp(t,e,n,i,r,a){return r>=t&&r<=t+n&&a>=e&&a<=e+i}function lp(t,e,n,i,r,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),u={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return Hn(u.x,u.y,o,s)<=a/2}function up(t,e,n,i,r,a,o){var s=Math.min(t,n),l=Math.max(t,n),u=Math.min(e,i),c=Math.max(e,i),h=r/2;return a>=s-h&&a<=l+h&&o>=u-h&&o<=c+h&&Kn(t,e,n,i,a,o)<=r/2}function cp(t,e,n,i,r){var a=t.length;if(a<2)return!1;for(var o=0;o<a-1;o++){if(up(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,i))return!0}if(r){var s=t[0],l=t[a-1];if(up(s[0],s[1],l[0],l[1],e,n,i))return!0}return!1}ip.tag="CanvasPicker";function hp(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function dp(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function fp(t,e,n){var i=!1,r=t.length;if(r<=2)return!1;for(var a=0;a<r;a++){var o=t[a],s=t[(a+1)%r];if(dp(o,s,[e,n]))return!0;hp(o[1]-n)>0!=hp(s[1]-n)>0&&hp(e-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(i=!i)}return i}function pp(t,e,n){for(var i=!1,r=0;r<t.length;r++){if(i=fp(t[r],e,n))break}return i}function gp(t,e,n){var i=t.parsedStyle,r=i.x1,a=i.y1,o=i.x2,s=i.y2,l=i.lineWidth,u=void 0===l?1:l,c=i.increasedLineWidthForHitTesting,h=void 0===c?0:c,d=i.pointerEvents,f=Ao(void 0===d?"auto":d,i.fill,i.stroke);return!(!(0,p.Z)(f,2)[1]&&!n||!u)&&up(r,a,o,s,u+h,e.x,e.y)}function mp(t,e,n,i,r,a){var o=t.parsedStyle,s=o.lineWidth,l=void 0===s?1:s,u=o.increasedLineWidthForHitTesting,c=void 0===u?0:u,h=o.stroke,d=o.fill,f=o.d,g=o.pointerEvents,m=void 0===g?"auto":g,v=f.segments,y=f.hasArc,x=f.polylines,b=f.polygons,_=Ao(m,(null==b?void 0:b.length)&&d,h),E=(0,p.Z)(_,2),w=E[0],T=E[1],S=ha(t),M=!1;return w||n?M=y?i(t,e):pp(b,e.x,e.y)||pp(x,e.x,e.y):((T||n)&&(M=function(t,e,n,i,r){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],u=l.currentPoint,c=l.params,h=l.prePoint,d=l.box;if(!d||sp(d.x-o,d.y-o,d.width+e,d.height+e,n,i))switch(l.command){case"L":case"Z":if(a=up(h[0],h[1],u[0],u[1],e,n,i))return!0;break;case"Q":if(a=oi(h[0],h[1],c[1],c[2],c[3],c[4],n,i)<=e/2)return!0;break;case"C":if(a=ei(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],n,i,r)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=Ze(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],c[7],void 0));for(var f=l.cubicParams,p=h,g=0;g<f.length;g+=6){var m=ei(p[0],p[1],f[g],f[g+1],f[g+2],f[g+3],f[g+4],f[g+5],n,i,r);if(p=[f[g+4],f[g+5]],a=m<=e/2)return!0}}}return a}(v,l+c,e.x,e.y,S)),M)}function vp(t,e,n){var i=t.parsedStyle,r=i.stroke,a=i.fill,o=i.lineWidth,s=void 0===o?1:o,l=i.increasedLineWidthForHitTesting,u=void 0===l?0:l,c=i.points,h=i.pointerEvents,d=Ao(void 0===h?"auto":h,a,r),f=(0,p.Z)(d,2),g=f[0],m=!1;return(f[1]||n)&&(m=cp(c.points,s+u,e.x,e.y,!0)),m||!g&&!n||(m=fp(c.points,e.x,e.y)),m}function yp(t,e,n){var i=t.parsedStyle,r=i.lineWidth,a=void 0===r?1:r,o=i.increasedLineWidthForHitTesting,s=void 0===o?0:o,l=i.points,u=i.pointerEvents,c=Ao(void 0===u?"auto":u,i.fill,i.stroke);return!(!(0,p.Z)(c,2)[1]&&!n||!a)&&cp(l.points,a+s,e.x,e.y,!1)}function xp(t,e,n,i,r){var a=t.parsedStyle,o=a.radius,s=a.fill,l=a.stroke,u=a.lineWidth,c=void 0===u?1:u,h=a.increasedLineWidthForHitTesting,d=void 0===h?0:h,f=a.x,g=void 0===f?0:f,m=a.y,v=void 0===m?0:m,y=a.width,x=a.height,b=a.pointerEvents,_=Ao(void 0===b?"auto":b,s,l),E=(0,p.Z)(_,2),w=E[0],T=E[1],S=c+d;if(o&&o.some((function(t){return 0!==t}))){var M=!1;return(T||n)&&(M=function(t,e,n,i,r,a,o,s){var l=(0,p.Z)(r,4),u=l[0],c=l[1],h=l[2],d=l[3];return up(t+u,e,t+n-c,e,a,o,s)||up(t+n,e+c,t+n,e+i-h,a,o,s)||up(t+n-h,e+i,t+d,e+i,a,o,s)||up(t,e+i-d,t,e+u,a,o,s)||lp(t+n-c,e+c,c,Math.PI,Math.PI,a,o,s)||lp(t+n-h,e+i-h,h,0,Math.PI,a,o,s)||lp(t+d,e+i-d,d,Math.PI,Math.PI,a,o,s)||lp(t+u,e+u,u,Math.PI,Math.PI,a,o,s)}(g,v,y,x,o.map((function(t){return ce(t,0,Math.min(Math.abs(y)/2,Math.abs(x)/2))})),S,e.x,e.y)),M||!w&&!n||(M=i(t,e)),M}var C=S/2;return w&&T||n?sp(g-C,v-C,y+C,x+C,e.x,e.y):w?sp(g,v,y,x,e.x,e.y):!!T&&function(t,e,n,i,r,a,o){var s=r/2;return sp(t-s,e-s,n,r,a,o)||sp(t+n-s,e-s,r,i,a,o)||sp(t+s,e+i-s,n,r,a,o)||sp(t-s,e+s,r,i,a,o)}(g,v,y,x,S,e.x,e.y)}function bp(t,e,n,i,r,o){var s=t.parsedStyle,l=s.pointerEvents,u=void 0===l?"auto":l,c=s.x,h=void 0===c?0:c,d=s.y,f=void 0===d?0:d,p=s.width,g=s.height;if("non-transparent-pixel"===u){var m=r.config.offscreenCanvas,v=o.offscreenCanvasCreator.getOrCreateCanvas(m),y=o.offscreenCanvasCreator.getOrCreateContext(m,{willReadFrequently:!0});return v.width=p,v.height=g,r.defaultStyleRendererFactory[pi.IMAGE].render(y,(0,a.Z)((0,a.Z)({},t.parsedStyle),{},{x:0,y:0}),t,void 0,void 0,void 0),y.getImageData(e.x-h,e.y-f,1,1).data.every((function(t){return 0!==t}))}return!0}function _p(t,e,n,i){var r=t.getGeometryBounds();return e.x>=r.min[0]&&e.y>=r.min[1]&&e.x<=r.max[0]&&e.y<=r.max[1]}var Ep=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).name="canvas-picker",t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){var t,e=(t={},(0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)(t,pi.CIRCLE,rp),pi.ELLIPSE,op),pi.RECT,xp),pi.LINE,gp),pi.POLYLINE,yp),pi.POLYGON,vp),pi.PATH,mp),pi.TEXT,_p),pi.GROUP,null),pi.IMAGE,bp),(0,an.Z)((0,an.Z)(t,pi.HTML,null),pi.MESH,null));this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new ip)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(mi);function wp(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Tp=0;function Sp(t){return"__private_"+Tp+++"_"+t}var Mp=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.cacheStore=new Map}),[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e)||(n.counter.add(e),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var i=this.cacheStore.get(t);return!!i&&(i.value=(0,a.Z)((0,a.Z)({},i.value),e),i.counter.has(n)||(i.counter.add(n),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e),n.counter.size<=0&&this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach((function(n){e.release(n,t)}))}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),Cp=[],Ap=[],Op=function(){function t(){(0,o.Z)(this,t)}return(0,s.Z)(t,null,[{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;Cp.length<=0&&Ap.length<=0||(Ap.forEach((function(t){return t()})),Ap=Cp.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame((function(){t.executeTask(e)})))}},{key:"sliceImage",value:function(e,n,i,r){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,l=e.naturalHeight||e.height,u=n-a,c=i-a,h=Math.ceil(s/u),d=Math.ceil(l/c),f={tileSize:[n,i],gridSize:[d,h],tiles:Array(d).fill(null).map((function(){return Array(h).fill(null)}))},p=function(t){for(var a=function(a){Cp.push((function(){var h=a*u,d=t*c,p=[Math.min(n,s-h),Math.min(i,l-d)],g=p[0],m=p[1],v=o.createCanvas();v.width=n,v.height=i,v.getContext("2d").drawImage(e,h,d,g,m,0,0,g,m),f.tiles[t][a]={x:h,y:d,tileX:a,tileY:t,data:v},r()}))},d=0;d<h;d++)a(d)},g=0;g<d;g++)p(g);return t.stop(),t.executeTask(),f}}])}();Op.TASK_NUM_PER_FRAME=10;var Np=new Mp;Np.onRefAdded=function(t){var e=this;t.addEventListener(Ms.DESTROY,(function(){e.releaseRef(t)}),{once:!0})};var Pp=function(){return(0,s.Z)((function t(e,n){(0,o.Z)(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n}),[{key:"getImageSync",value:function(t,e,n){var i=(0,ue.Z)(t)?t:t.src;if(Np.has(i)){var r=Np.get(i,e);if(r.img.complete)return null==n||n(r),r}return this.getOrCreateImage(t,e).then((function(t){null==n||n(t)})).catch((function(){})),null}},{key:"getOrCreateImage",value:function(t,e){var n=(0,ue.Z)(t)?t:t.src;if(!(0,ue.Z)(t)&&!Np.has(n)){var i={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:Lp(t)};Np.put(n,i,e)}if(Np.has(n)){var r=Np.get(n,e);return r.img.complete?Promise.resolve(r):new Promise((function(t,e){r.img.addEventListener("load",(function(){r.size=[r.img.naturalWidth||r.img.width,r.img.naturalHeight||r.img.height],r.tileSize=Lp(r.img),t(r)})),r.img.addEventListener("error",(function(t){e(t)}))}))}var a=this.context.config.createImage;return new Promise((function(t,i){var r;if(a?r=a(n):bo&&(r=new window.Image),r){var o={img:r,size:[0,0],tileSize:Lp(r)};Np.put(n,o,e),r.onload=function(){o.size=[r.naturalWidth||r.width,r.naturalHeight||r.height],o.tileSize=Lp(o.img),t(o)},r.onerror=function(t){i(t)},r.crossOrigin="Anonymous",r.src=n}}))}},{key:"createDownSampledImage",value:(e=(0,li.Z)((0,si.Z)().mark((function t(e,n){var i,r,o,s,l,u,c,h,d,f,g,m,v,y;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getOrCreateImage(e,n);case 2:if(void 0===(i=t.sent).downSamplingRate){t.next=5;break}return t.abrupt("return",i);case 5:if(r=this.context.config.enableLargeImageOptimization,s=(o="boolean"==typeof r?{}:r).maxDownSampledImageSize,l=void 0===s?2048:s,u=o.downSamplingRateThreshold,c=void 0===u?.5:u,h=this.runtime.globalThis.createImageBitmap,d=(0,p.Z)(i.size,2),f=d[0],g=d[1],m=i.img,v=Math.min((l+l)/(f+g),Math.max(.01,Math.min(c,.5))),y=(0,a.Z)((0,a.Z)({},i),{},{downSamplingRate:v}),Np.update(i.img.src,y,n),!h){t.next=25;break}return t.prev=14,t.next=17,h(i.img,{resizeWidth:f*v,resizeHeight:g*v});case 17:m=t.sent,t.next=23;break;case 20:t.prev=20,t.t0=t.catch(14),v=1;case 23:t.next=26;break;case 25:v=1;case 26:return y=(0,a.Z)((0,a.Z)({},this.getImageSync(e,n)),{},{downSampled:m,downSamplingRate:v}),Np.update(i.img.src,y,n),t.abrupt("return",y);case 29:case"end":return t.stop()}}),t,this,[[14,20]])}))),function(t,n){return e.apply(this,arguments)})},{key:"createImageTiles",value:(t=(0,li.Z)((0,si.Z)().mark((function t(e,n,i,r){var o,s,l,u,c;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getOrCreateImage(e,r);case 2:return o=t.sent,s=r.ownerDocument.defaultView,l=s.requestAnimationFrame,u=s.cancelAnimationFrame,Op.api={requestAnimationFrame:l,cancelAnimationFrame:u,createCanvas:function(){return _s.createCanvas()}},c=(0,a.Z)((0,a.Z)({},o),Op.sliceImage(o.img,o.tileSize[0],o.tileSize[0],i)),Np.update(o.img.src,c,r),t.abrupt("return",c);case 8:case"end":return t.stop()}}),t,this)}))),function(e,n,i,r){return t.apply(this,arguments)})},{key:"releaseImage",value:function(t,e){Np.release((0,ue.Z)(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){Np.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,n,i,r,a,o){var s=this.generatePatternKey(e);if(s&&this.patternCache[s])return this.patternCache[s];var l,u=e.image,c=e.repetition,h=e.transform,d=!1;if((0,ue.Z)(u)){var f=this.getImageSync(u,t,o);l=null==f?void 0:f.img}else i?(l=i,d=!0):l=u;var p,g=l&&n.createPattern(l,c);g&&(p=h?Jo(ka(h),new xl({})):X(U()),d&&tt(p,p,[1/r,1/r,1]),g.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12]+a[0],f:p[13]+a[1]}));return s&&g&&(this.patternCache[s]=g),g}},{key:"getOrCreateGradient",value:function(t,e){var n=this.generateGradientKey(t),i=t.type,r=t.steps,a=t.min,o=t.width,s=t.height,l=t.angle,u=t.cx,c=t.cy,h=t.size;if(this.gradientCache[n])return this.gradientCache[n];var d=null;if(i===vr.LinearGradient){var f=function(t,e,n,i){var r=Ii(i.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(r))+Math.abs(n*Math.sin(r));return{x1:t[0]+a-Math.cos(r)*s/2,y1:t[1]+o-Math.sin(r)*s/2,x2:t[0]+a+Math.cos(r)*s/2,y2:t[1]+o+Math.sin(r)*s/2}}(a,o,s,l),p=f.x1,g=f.y1,m=f.x2,v=f.y2;d=e.createLinearGradient(p,g,m,v)}else if(i===vr.RadialGradient){var y=function(t,e,n,i,r,a){var o=i.value,s=r.value;i.unit===or.kPercentage&&(o=i.value/100*e),r.unit===or.kPercentage&&(s=r.value/100*n);var l=Math.max(se([0,0],[o,s]),se([0,n],[o,s]),se([e,n],[o,s]),se([e,0],[o,s]));return a&&(a instanceof _r?l=a.value:a instanceof xr&&("closest-side"===a.value?l=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?l=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(l=Math.min(se([0,0],[o,s]),se([0,n],[o,s]),se([e,n],[o,s]),se([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:l}}(a,o,s,u,c,h),x=y.x,b=y.y,_=y.r;d=e.createRadialGradient(x,b,0,x,b,_)}return d&&(r.forEach((function(t){var e,n=t.offset,i=t.color;n.unit===or.kPercentage&&(null===(e=d)||void 0===e||e.addColorStop(n.value/100,i.toString()))})),this.gradientCache[n]=d),this.gradientCache[n]}},{key:"generateGradientKey",value:function(t){var e=t.type,n=t.min,i=t.width,r=t.height,a=t.steps,o=t.angle,s=t.cx,l=t.cy,u=t.size;return"gradient-".concat(e,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==l?void 0:l.toString())||0,"-").concat((null==u?void 0:u.toString())||0,"-").concat(n[0],"-").concat(n[1],"-").concat(i,"-").concat(r,"-").concat(a.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,n=t.repetition;return(0,ue.Z)(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0}}]);var t,e}();function Lp(t){if(!t.complete)return[0,0];var e=t.naturalWidth||t.width,n=t.naturalHeight||t.height,i=256;return[256,512].forEach((function(t){Math.ceil(n/t)*Math.ceil(e/t)<1e3&&(i=t)})),[i,i]}Pp.isSupportTile=!!_s.createCanvas();var Rp=function(){function t(){(0,o.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=e.renderingService,i=e.renderingContext,r=e.imagePool,a=i.root.ownerDocument.defaultView,o=function(t,e,n){var i=t.parsedStyle,r=i.width,a=i.height;r&&!a?t.setAttribute("height",n/e*r):!r&&a&&t.setAttribute("width",e/n*a)},s=function(t){var e=t.target,i=e.nodeName,a=e.attributes;if(i===pi.IMAGE){var s=a.src,l=a.keepAspectRatio;r.getImageSync(s,e,(function(t){var i=t.img,r=i.width,a=i.height;l&&o(e,r,a),e.renderable.dirty=!0,n.dirtify()}))}},l=function(t){var e=t.target,i=t.attrName,a=t.prevValue,s=t.newValue;e.nodeName===pi.IMAGE&&"src"===i&&(a!==s&&r.releaseImage(a,e),(0,ue.Z)(s)&&r.getOrCreateImage(s,e).then((function(t){var i=t.img,r=i.width,a=i.height;e.attributes.keepAspectRatio&&o(e,r,a),e.renderable.dirty=!0,n.dirtify()})).catch((function(){})))};n.hooks.init.tap(t.tag,(function(){a.addEventListener(Ms.MOUNTED,s),a.addEventListener(Ms.ATTR_MODIFIED,l)})),n.hooks.destroy.tap(t.tag,(function(){a.removeEventListener(Ms.MOUNTED,s),a.removeEventListener(Ms.ATTR_MODIFIED,l)}))}}])}();Rp.tag="LoadImage";var Dp=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).name="image-loader",t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(t){this.context.imagePool=new Pp(this.context,t),this.addRenderingPlugin(new Rp)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(mi),kp=Sp("renderState"),Ip=function(){function t(e){(0,o.Z)(this,t),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,kp,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=U(),this.dprMatrix=U(),this.tmpMat4=U(),this.vec3a=y(),this.vec3b=y(),this.vec3c=y(),this.vec3d=y(),this.canvasRendererPluginOptions=e}return(0,s.Z)(t,[{key:"apply",value:function(e,n){var i=this;this.context=e;var r=this.context,a=r.config,o=r.camera,s=r.renderingService,u=r.renderingContext,c=r.rBushRoot,h=r.pathGeneratorFactory,d=a.renderer.getConfig().enableRenderingOptimization;a.renderer.getConfig().enableDirtyCheck=!1,a.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=c,this.pathGeneratorFactory=h;var f=e.contextService,p=u.root.ownerDocument.defaultView,g=function(t){var e=t.target.rBushNode;e.aabb&&i.removedRBushNodeAABBs.push(e.aabb)},m=function(t){var e=t.target.rBushNode;e.aabb&&i.removedRBushNodeAABBs.push(e.aabb)};s.hooks.init.tap(t.tag,(function(){p.addEventListener(Ms.UNMOUNTED,g),p.addEventListener(Ms.CULLED,m);var t=f.getDPR(),e=a.width,n=a.height,r=f.getContext();i.clearRect(r,0,0,e*t,n*t,a.background)})),s.hooks.destroy.tap(t.tag,(function(){p.removeEventListener(Ms.UNMOUNTED,g),p.removeEventListener(Ms.CULLED,m),i.renderQueue=[],i.removedRBushNodeAABBs=[],wp(i,kp)[kp]={restoreStack:[],prevObject:null,currentContext:null}})),s.hooks.beginFrame.tap(t.tag,(function(){var t,e=f.getContext(),n=f.getDPR(),r=a.width,o=a.height,l=i.canvasRendererPluginOptions,u=l.dirtyObjectNumThreshold,c=l.dirtyObjectRatioThreshold,h=s.getStats(),d=h.total,g=h.rendered,m=g/d;i.clearFullScreen=i.clearFullScreenLastFrame||!(null!==(t=p.context.renderingPlugins[1])&&void 0!==t&&t.isFirstTimeRenderingFinished)||s.disableDirtyRectangleRendering()||g>u&&m>c,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),i.clearFullScreen&&i.clearRect(e,0,0,r*n,o*n,a.background))}));var v=function(t,e){for(var r=[t];r.length>0;){var a=r.pop();a.isVisible()&&!a.isCulled()&&(d?i.renderDisplayObjectOptimized(a,e,i.context,wp(i,kp)[kp],n):i.renderDisplayObject(a,e,i.context,wp(i,kp)[kp],n));for(var o=a.sortable.sorted||a.childNodes,s=o.length-1;s>=0;s--)r.push(o[s])}};s.hooks.endFrame.tap(t.tag,(function(){if(0!==u.root.childNodes.length){d=a.renderer.getConfig().enableRenderingOptimization,wp(i,kp)[kp]={restoreStack:[],prevObject:null,currentContext:wp(i,kp)[kp].currentContext},wp(i,kp)[kp].currentContext.clear(),i.clearFullScreenLastFrame=!1;var t=f.getContext(),e=f.getDPR();if(ot(i.dprMatrix,[e,e,1]),Q(i.vpMatrix,i.dprMatrix,o.getOrthoMatrix()),i.clearFullScreen)d?(t.save(),v(u.root,t),t.restore()):v(u.root,t),i.removedRBushNodeAABBs=[];else{var r=i.safeMergeAABB.apply(i,[i.mergeDirtyAABBs(i.renderQueue)].concat((0,l.Z)(i.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,i=t.maxX,r=t.maxY,a=new Ti;return a.setMinMax([e,n,0],[i,r,0]),a})))));if(i.removedRBushNodeAABBs=[],Ti.isEmpty(r))return void(i.renderQueue=[]);var s=i.convertAABB2Rect(r),c=s.x,h=s.y,g=s.width,m=s.height,y=L(i.vec3a,[c,h,0],i.vpMatrix),x=L(i.vec3b,[c+g,h,0],i.vpMatrix),b=L(i.vec3c,[c,h+m,0],i.vpMatrix),_=L(i.vec3d,[c+g,h+m,0],i.vpMatrix),E=Math.min(y[0],x[0],_[0],b[0]),w=Math.min(y[1],x[1],_[1],b[1]),T=Math.max(y[0],x[0],_[0],b[0]),S=Math.max(y[1],x[1],_[1],b[1]),M=Math.floor(E),C=Math.floor(w),A=Math.ceil(T-E),O=Math.ceil(S-w);t.save(),i.clearRect(t,M,C,A,O,a.background),t.beginPath(),t.rect(M,C,A,O),t.clip(),t.setTransform(i.vpMatrix[0],i.vpMatrix[1],i.vpMatrix[4],i.vpMatrix[5],i.vpMatrix[12],i.vpMatrix[13]),a.renderer.getConfig().enableDirtyRectangleRenderingDebug&&p.dispatchEvent(new ms(Wl.DIRTY_RECTANGLE,{dirtyRect:{x:M,y:C,width:A,height:O}})),i.searchDirtyObjects(r).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&i.renderDisplayObject(e,t,i.context,wp(i,kp)[kp],n)})),t.restore(),i.renderQueue.forEach((function(t){i.saveDirtyAABB(t)})),i.renderQueue=[]}wp(i,kp)[kp].restoreStack.forEach((function(){t.restore()})),wp(i,kp)[kp].restoreStack=[]}else i.clearFullScreenLastFrame=!0})),s.hooks.render.tap(t.tag,(function(t){i.clearFullScreen||i.renderQueue.push(t)}))}},{key:"clearRect",value:function(t,e,n,i,r,a){t.clearRect(e,n,i,r),a&&(t.fillStyle=a,t.fillRect(e,n,i,r))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,i,r){var a=t.nodeName,o=!1,s=this.context.styleRendererFactory[a],l=this.pathGeneratorFactory[a],u=t.parsedStyle.clipPath;if(u){(!i.prevObject||!kt(u.getWorldTransform(),i.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,u),i.prevObject=null);var c=this.pathGeneratorFactory[u.nodeName];c&&(e.save(),o=!0,e.beginPath(),c(e,u.parsedStyle),e.closePath(),e.clip())}if(s){(!i.prevObject||!kt(t.getWorldTransform(),i.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var h=!i.prevObject;if(!h){var d=i.prevObject.nodeName;h=a===pi.TEXT?d!==pi.TEXT:a===pi.IMAGE?d!==pi.IMAGE:d===pi.TEXT||d===pi.IMAGE}s.applyStyleToContext(e,t,h,i),i.prevObject=t}l&&(e.beginPath(),l(e,t.parsedStyle),a!==pi.LINE&&a!==pi.PATH&&a!==pi.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,wp(this,kp)[kp],this,r),o&&e.restore(),t.renderable.dirty=!1}},{key:"renderDisplayObject",value:function(t,e,n,i,r){var a=t.nodeName,o=i.restoreStack[i.restoreStack.length-1];!o||t.compareDocumentPosition(o)&xs.DOCUMENT_POSITION_CONTAINS||(e.restore(),i.restoreStack.pop());var s=this.context.styleRendererFactory[a],l=this.pathGeneratorFactory[a],u=t.parsedStyle.clipPath;if(u){this.applyWorldTransform(e,u);var c=this.pathGeneratorFactory[u.nodeName];c&&(e.save(),i.restoreStack.push(t),e.beginPath(),c(e,u.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),l&&(e.beginPath(),l(e,t.parsedStyle),a!==pi.LINE&&a!==pi.PATH&&a!==pi.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,r),e.restore()),t.renderable.dirty=!1}},{key:"applyAttributesToContext",value:function(t,e){var n=e.parsedStyle,i=n.stroke,r=n.fill,a=n.opacity,o=n.lineDash,s=n.lineDashOffset;o&&t.setLineDash(o),(0,le.Z)(s)||(t.lineDashOffset=s),(0,le.Z)(a)||(t.globalAlpha*=a),(0,le.Z)(i)||Array.isArray(i)||i.isNone||(t.strokeStyle=e.attributes.stroke),(0,le.Z)(r)||Array.isArray(r)||r.isNone||(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),i=Math.floor(e[0]),r=Math.floor(e[1]);return{x:i,y:r,width:Math.ceil(n[0])-i,height:Math.ceil(n[1])-r}}},{key:"mergeDirtyAABBs",value:function(t){var e=new Ti;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var i=t.renderable.dirtyRenderBounds;i&&e.add(i)})),e}},{key:"searchDirtyObjects",value:function(t){var e=t.getMin(),n=(0,p.Z)(e,2),i=n[0],r=n[1],a=t.getMax(),o=(0,p.Z)(a,2),s=o[0],l=o[1];return this.rBush.search({minX:i,minY:r,maxX:s,maxY:l}).map((function(t){return t.displayObject}))}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Ti);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,n){n?(V(this.tmpMat4,e.getLocalTransform()),Q(this.tmpMat4,n,this.tmpMat4),Q(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(V(this.tmpMat4,e.getWorldTransform()),Q(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.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 t=new Ti,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return n.forEach((function(e){t.add(e)})),t}}])}();function Bp(t,e,n,i,r,a,o){var s,l;if("rect"===t.image.nodeName){var u=t.image.parsedStyle,c=u.width,h=u.height;l=i.contextService.getDPR();var d=i.config.offscreenCanvas;(s=a.offscreenCanvasCreator.getOrCreateCanvas(d)).width=c*l,s.height=h*l;var f=a.offscreenCanvasCreator.getOrCreateContext(d),p={restoreStack:[],prevObject:null,currentContext:new Map};t.image.forEach((function(t){r.renderDisplayObject(t,f,i,p,a)})),p.restoreStack.forEach((function(){f.restore()}))}return o.getOrCreatePatternSync(e,t,n,s,l,e.getGeometryBounds().min,(function(){e.renderable.dirty=!0,i.renderingService.dirtify()}))}function Fp(t,e,n,i){var r;if(t.type===vr.LinearGradient||t.type===vr.RadialGradient){var o=e.getGeometryBounds(),s=o&&2*o.halfExtents[0]||1,l=o&&2*o.halfExtents[1]||1,u=o&&o.min||[0,0];r=i.getOrCreateGradient((0,a.Z)((0,a.Z)({type:t.type},t.value),{},{min:u,width:s,height:l}),n)}return r}Ip.tag="CanvasRenderer";var zp=["shadowBlur","shadowOffsetX","shadowOffsetY"],Gp=["lineCap","lineJoin","miterLimit"],jp={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},Up={};function Hp(t,e,n,i){var r=i.has(e)?i.get(e):jp[e];return r!==n&&("lineDash"===e?t.setLineDash(n):t[e]=n,i.set(e,n)),r}var Vp=function(){return(0,s.Z)((function t(e){(0,o.Z)(this,t),this.imagePool=e}),[{key:"applyAttributesToContext",value:function(t,e){}},{key:"render",value:function(t,e,n,i,r,a){}},{key:"applyCommonStyleToContext",value:function(t,e,n,i){var r=n?Up:i.prevObject.parsedStyle,a=e.parsedStyle;(n||a.opacity!==r.opacity)&&Hp(t,"globalAlpha",(0,le.Z)(a.opacity)?jp.globalAlpha:a.opacity,i.currentContext),(n||a.blend!==r.blend)&&Hp(t,"globalCompositeOperation",(0,le.Z)(a.blend)?jp.globalCompositeOperation:a.blend,i.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,e,n,i){var r=n?Up:i.prevObject.parsedStyle,a=e.parsedStyle,o=a.lineWidth,s=void 0===o?jp.lineWidth:o,l=a.fill&&!a.fill.isNone;if(a.stroke&&!a.stroke.isNone&&s>0){if(n||e.attributes.stroke!==i.prevObject.attributes.stroke)Hp(t,"strokeStyle",(0,le.Z)(a.stroke)||Array.isArray(a.stroke)||a.stroke.isNone?jp.strokeStyle:e.attributes.stroke,i.currentContext);(n||a.lineWidth!==r.lineWidth)&&Hp(t,"lineWidth",(0,le.Z)(a.lineWidth)?jp.lineWidth:a.lineWidth,i.currentContext),(n||a.lineDash!==r.lineDash)&&Hp(t,"lineDash",a.lineDash||jp.lineDash,i.currentContext),(n||a.lineDashOffset!==r.lineDashOffset)&&Hp(t,"lineDashOffset",(0,le.Z)(a.lineDashOffset)?jp.lineDashOffset:a.lineDashOffset,i.currentContext);for(var u=0;u<Gp.length;u++){var c=Gp[u];(n||a[c]!==r[c])&&Hp(t,c,(0,le.Z)(a[c])?jp[c]:a[c],i.currentContext)}}l&&(n||e.attributes.fill!==i.prevObject.attributes.fill)&&Hp(t,"fillStyle",(0,le.Z)(a.fill)||Array.isArray(a.fill)||a.fill.isNone?jp.fillStyle:e.attributes.fill,i.currentContext)}},{key:"applyStyleToContext",value:function(t,e,n,i){var r=e.nodeName;this.applyCommonStyleToContext(t,e,n,i),r===pi.IMAGE||this.applyStrokeFillStyleToContext(t,e,n,i)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,e,n,i){var r=e.parsedStyle;if(n){Hp(t,"shadowColor",r.shadowColor.toString(),i.currentContext);for(var a=0;a<zp.length;a++){var o=zp[a];Hp(t,o,r[o]||jp[o],i.currentContext)}}r.filter&&r.filter.length&&Hp(t,"filter",e.attributes.filter,i.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e){Hp(t,"shadowColor",jp.shadowColor,i.currentContext);for(var a=0;a<zp.length;a++){var o=zp[a];Hp(t,o,jp[o],i.currentContext)}}if(n)if(e&&r){var s=t.filter;!(0,le.Z)(s)&&s.indexOf("drop-shadow")>-1&&Hp(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||jp.filter,i.currentContext)}else Hp(t,"filter",jp.filter,i.currentContext)}},{key:"fillToContext",value:function(t,e,n,i,r){var a=this,o=e.parsedStyle,s=o.fill,l=o.fillRule,u=null;if(Array.isArray(s)&&s.length>0)s.forEach((function(i){var r,o=Hp(t,"fillStyle",Fp(i,e,t,a.imagePool),n.currentContext);u=null!==(r=u)&&void 0!==r?r:o,l?t.fill(l):t.fill()}));else{if(jr(s)){var c=Bp(s,e,t,e.ownerDocument.defaultView.context,i,r,this.imagePool);c&&(t.fillStyle=c,u=!0)}l?t.fill(l):t.fill()}null!==u&&Hp(t,"fillStyle",u,n.currentContext)}},{key:"strokeToContext",value:function(t,e,n,i,r){var a=this,o=e.parsedStyle.stroke,s=null;if(Array.isArray(o)&&o.length>0)o.forEach((function(i){var r,o=Hp(t,"strokeStyle",Fp(i,e,t,a.imagePool),n.currentContext);s=null!==(r=s)&&void 0!==r?r:o,t.stroke()}));else{if(jr(o)){var l=Bp(o,e,t,e.ownerDocument.defaultView.context,i,r,this.imagePool);if(l){var u,c=Hp(t,"strokeStyle",l,n.currentContext);s=null!==(u=s)&&void 0!==u?u:c}}t.stroke()}null!==s&&Hp(t,"strokeStyle",s,n.currentContext)}},{key:"drawToContext",value:function(t,e,n,i,r){var a,o=e.nodeName,s=e.parsedStyle,l=s.opacity,u=void 0===l?jp.globalAlpha:l,c=s.fillOpacity,h=void 0===c?jp.fillOpacity:c,d=s.strokeOpacity,f=void 0===d?jp.strokeOpacity:d,p=s.lineWidth,g=void 0===p?jp.lineWidth:p,m=s.fill&&!s.fill.isNone,v=s.stroke&&!s.stroke.isNone&&g>0;if(m||v){var y=!(0,le.Z)(s.shadowColor)&&s.shadowBlur>0,x="inner"===s.shadowType,b=0===(null===(a=s.fill)||void 0===a?void 0:a.alpha),_=!(!s.filter||!s.filter.length),E=y&&v&&(o===pi.PATH||o===pi.LINE||o===pi.POLYLINE||b||x),w=null;if(m)E||this.applyShadowAndFilterStyleToContext(t,e,y,n),w=Hp(t,"globalAlpha",u*h,n.currentContext),this.fillToContext(t,e,n,i,r),E||this.clearShadowAndFilterStyleForContext(t,y,_,n);if(v){var T=!1,S=Hp(t,"globalAlpha",u*f,n.currentContext);if(w=m?w:S,E&&(this.applyShadowAndFilterStyleToContext(t,e,y,n),T=!0,x)){var M=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,n,i,r),t.globalCompositeOperation=M,this.clearShadowAndFilterStyleForContext(t,y,_,n,!0)}this.strokeToContext(t,e,n,i,r),T&&this.clearShadowAndFilterStyleForContext(t,y,_,n)}null!==w&&Hp(t,"globalAlpha",w,n.currentContext)}}}])}(),Zp=function(t){function e(){return(0,o.Z)(this,e),d(this,e,arguments)}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"render",value:function(t,e,n,i,r,a){var o=e.fill,s=e.fillRule,l=e.opacity,u=void 0===l?1:l,c=e.fillOpacity,h=void 0===c?1:c,d=e.stroke,f=e.strokeOpacity,p=void 0===f?1:f,g=e.lineWidth,m=void 0===g?1:g,v=e.lineCap,y=e.lineJoin,x=e.shadowType,b=e.shadowColor,_=e.shadowBlur,E=e.filter,w=e.miterLimit,T=o&&!o.isNone,S=d&&!d.isNone&&m>0,M=0===(null==o?void 0:o.alpha),C=!(!E||!E.length),A=!(0,le.Z)(b)&&_>0,O=n.nodeName,N="inner"===x,P=S&&A&&(O===pi.PATH||O===pi.LINE||O===pi.POLYLINE||M||N);T&&(t.globalAlpha=u*h,P||Wp(n,t,A),Xp(t,n,o,s,i,r,a,this.imagePool),P||this.clearShadowAndFilter(t,C,A)),S&&(t.globalAlpha=u*p,t.lineWidth=m,(0,le.Z)(w)||(t.miterLimit=w),(0,le.Z)(v)||(t.lineCap=v),(0,le.Z)(y)||(t.lineJoin=y),P&&(N&&(t.globalCompositeOperation="source-atop"),Wp(n,t,!0),N&&(Yp(t,n,d,i,r,a,this.imagePool),t.globalCompositeOperation=jp.globalCompositeOperation,this.clearShadowAndFilter(t,C,!0))),Yp(t,n,d,i,r,a,this.imagePool))}},{key:"clearShadowAndFilter",value:function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var i=t.filter;!(0,le.Z)(i)&&i.indexOf("drop-shadow")>-1&&(t.filter=i.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(Vp);function Wp(t,e,n){var i=t.parsedStyle,r=i.filter,a=i.shadowColor,o=i.shadowBlur,s=i.shadowOffsetX,l=i.shadowOffsetY;r&&r.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=l||0)}function Xp(t,e,n,i,r,a,o,s){var l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach((function(n){t.fillStyle=Fp(n,e,t,s),l||(i?t.fill(i):t.fill())})):(jr(n)&&(t.fillStyle=Bp(n,e,t,r,a,o,s)),l||(i?t.fill(i):t.fill()))}function Yp(t,e,n,i,r,a,o){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach((function(n){t.strokeStyle=Fp(n,e,t,o),s||t.stroke()})):(jr(n)&&(t.strokeStyle=Bp(n,e,t,i,r,a,o)),s||t.stroke())}var qp=function(t){function e(){return(0,o.Z)(this,e),d(this,e,arguments)}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"renderDownSampled",value:function(t,e,n,i){var r=i.src,a=i.imageCache;a.downSampled?t.drawImage(a.downSampled,Math.floor(i.drawRect[0]),Math.floor(i.drawRect[1]),Math.ceil(i.drawRect[2]),Math.ceil(i.drawRect[3])):this.imagePool.createDownSampledImage(r,n).then((function(t){n.renderable.dirty=!0,n.ownerDocument.defaultView.context.renderingService.dirtify()})).catch((function(){}))}},{key:"renderTile",value:function(t,e,n,i){var r=i.src,a=i.imageCache,o=i.imageRect,s=i.drawRect,l=a.size,u=t.getTransform(),c=u.a,h=u.b,d=u.c,f=u.d,p=u.e,g=u.f;if(t.resetTransform(),null!=a&&a.gridSize){for(var m=[l[0]/o[2],l[1]/o[3]],v=[a.tileSize[0]/m[0],a.tileSize[1]/m[1]],y=[Math.floor((s[0]-o[0])/v[0]),Math.ceil((s[0]+s[2]-o[0])/v[0])],x=y[0],b=y[1],_=[Math.floor((s[1]-o[1])/v[1]),Math.ceil((s[1]+s[3]-o[1])/v[1])],E=_[1],w=_[0];w<=E;w++)for(var T=x;T<=b;T++){var S=a.tiles[w][T];if(S){var M=[Math.floor(o[0]+S.tileX*v[0]),Math.floor(o[1]+S.tileY*v[1]),Math.ceil(v[0]),Math.ceil(v[1])];t.drawImage(S.data,M[0],M[1],M[2],M[3])}}t.setTransform(c,h,d,f,p,g)}else this.imagePool.createImageTiles(r,[],(function(){n.renderable.dirty=!0,n.ownerDocument.defaultView.context.renderingService.dirtify()}),n).catch((function(){}))}},{key:"render",value:function(t,n,i){var r=n.x,a=void 0===r?0:r,o=n.y,s=void 0===o?0:o,l=n.width,u=n.height,c=n.src,h=n.shadowColor,d=n.shadowBlur,f=this.imagePool.getImageSync(c,i),g=null==f?void 0:f.img,m=l,v=u;if(g){var x,b,_,E,w,T,S,M,C,A,O,N,P,R,D,k;m||(m=g.width),v||(v=g.height),Wp(i,t,!(0,le.Z)(h)&&d>0);try{var I=i.ownerDocument.defaultView.getContextService().getDomElement(),B=I.width,F=I.height,z=t.getTransform(),G=z.a,j=z.b,U=function(t,e){var n=L(y(),[t[0],t[1],0],e),i=L(y(),[t[0]+t[2],t[1],0],e),r=L(y(),[t[0],t[1]+t[3],0],e),a=L(y(),[t[0]+t[2],t[1]+t[3],0],e);return[Math.min(n[0],i[0],r[0],a[0]),Math.min(n[1],i[1],r[1],a[1]),Math.max(n[0],i[0],r[0],a[0])-Math.min(n[0],i[0],r[0],a[0]),Math.max(n[1],i[1],r[1],a[1])-Math.min(n[1],i[1],r[1],a[1])]}([a,s,m,v],Z(G,z.c,0,0,j,z.d,0,0,0,0,1,0,z.e,z.f,0,1)),H=(x=[0,0,B,F],b=U,_=(0,p.Z)(x,4),E=_[0],w=_[1],T=_[2],S=_[3],M=(0,p.Z)(b,4),C=M[0],A=M[1],O=M[2],N=M[3],P=Math.max(E,C),R=Math.max(w,A),D=Math.min(E+T,C+O),k=Math.min(w+S,A+N),D<=P||k<=R?null:[P,R,D-P,k-R]);if(!H)return;if(!i.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,n,i,{image:g,drawRect:[a,s,m,v]});if(U[2]/f.size[0]<(f.downSamplingRate||.5))return void this.renderDownSampled(t,n,i,{src:c,imageCache:f,drawRect:[a,s,m,v]});if(!Pp.isSupportTile)return void e.renderFull(t,n,i,{image:g,drawRect:[a,s,m,v]});this.renderTile(t,n,i,{src:c,imageCache:f,imageRect:U,drawRect:H})}catch(t){}}}},{key:"drawToContext",value:function(t,e,n,i,r){this.render(t,e.parsedStyle,e)}}],[{key:"renderFull",value:function(t,e,n,i){t.drawImage(i.image,Math.floor(i.drawRect[0]),Math.floor(i.drawRect[1]),Math.ceil(i.drawRect[2]),Math.ceil(i.drawRect[3]))}}])}(Zp),$p=function(t){function e(){return(0,o.Z)(this,e),d(this,e,arguments)}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"render",value:function(t,e,n,i,r,a){n.getBounds();var o=e.lineWidth,s=void 0===o?1:o,l=e.textAlign,u=void 0===l?"start":l,c=e.textBaseline,h=void 0===c?"alphabetic":c,d=e.lineJoin,f=void 0===d?"miter":d,p=e.miterLimit,g=void 0===p?10:p,m=e.letterSpacing,v=void 0===m?0:m,y=e.stroke,x=e.fill,b=e.fillRule,_=e.fillOpacity,E=void 0===_?1:_,w=e.strokeOpacity,T=void 0===w?1:w,S=e.opacity,M=void 0===S?1:S,C=e.metrics,A=e.x,O=void 0===A?0:A,N=e.y,P=void 0===N?0:N,L=e.dx,R=e.dy,D=e.shadowColor,k=e.shadowBlur,I=C.font,B=C.lines,F=C.height,z=C.lineHeight,G=C.lineMetrics;t.font=I,t.lineWidth=s,t.textAlign="middle"===u?"center":u;var j=h;"alphabetic"===j&&(j="bottom"),t.lineJoin=f,(0,le.Z)(g)||(t.miterLimit=g);var U=P;"middle"===h?U+=-F/2-z/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?U+=-F:"top"!==h&&"hanging"!==h||(U+=-z);var H=O+(L||0);U+=R||0,1===B.length&&("bottom"===j?(j="middle",U-=.5*F):"top"===j&&(j="middle",U+=.5*F)),t.textBaseline=j,Wp(n,t,!(0,le.Z)(D)&&k>0);for(var V=0;V<B.length;V++){var Z=s/2+H;U+=z,(0,le.Z)(y)||y.isNone||!s||this.drawLetterSpacing(t,n,B[V],G[V],u,Z,U,v,x,b,E,y,T,M,!0,i,r,a),(0,le.Z)(x)||this.drawLetterSpacing(t,n,B[V],G[V],u,Z,U,v,x,b,E,y,T,M,!1,i,r,a)}}},{key:"drawLetterSpacing",value:function(t,e,n,i,r,a,o,s,l,u,c,h,d,f,p,g,m,v){if(0!==s){var y=t.textAlign;t.textAlign="left";var x=a;"center"===r||"middle"===r?x=a-i.width/2:"right"!==r&&"end"!==r||(x=a-i.width);for(var b=Array.from(n),_=t.measureText(n).width,E=0,w=0;w<b.length;++w){var T=b[w];p?this.strokeText(t,e,T,x,o,h,d,g,m,v):this.fillText(t,e,T,x,o,l,u,c,f,g,m,v),x+=_-(E=t.measureText(n.substring(w+1)).width)+s,_=E}t.textAlign=y}else p?this.strokeText(t,e,n,a,o,h,d,g,m,v):this.fillText(t,e,n,a,o,l,u,c,f,g,m,v)}},{key:"fillText",value:function(t,e,n,i,r,a,o,s,l,u,c,h){var d;Xp(t,e,a,o,u,c,h,this.imagePool,!0);var f=!(0,le.Z)(s)&&1!==s;f&&(d=t.globalAlpha,t.globalAlpha=s*l),t.fillText(n,i,r),f&&(t.globalAlpha=d)}},{key:"strokeText",value:function(t,e,n,i,r,a,o,s,l,u){var c;Yp(t,e,a,s,l,u,this.imagePool,!0);var h=!(0,le.Z)(o)&&1!==o;h&&(c=t.globalAlpha,t.globalAlpha=o),t.strokeText(n,i,r),h&&(t.globalAlpha=c)}},{key:"drawToContext",value:function(t,e,n,i,r){this.render(t,e.parsedStyle,e,e.ownerDocument.defaultView.context,i,r)}}])}(Zp),Kp=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),(t=d(this,e)).name="canvas-renderer",t.options=n,t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){var t,e=(0,a.Z)({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,i=new Zp(n),r=(t={},(0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)(t,pi.CIRCLE,i),pi.ELLIPSE,i),pi.RECT,i),pi.IMAGE,new qp(n)),pi.TEXT,new $p(n)),pi.LINE,i),pi.POLYLINE,i),pi.POLYGON,i),pi.PATH,i),pi.GROUP,void 0),(0,an.Z)((0,an.Z)((0,an.Z)(t,pi.HTML,void 0),pi.MESH,void 0),pi.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=r,this.context.styleRendererFactory=r,this.addRenderingPlugin(new Ip(e))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(mi),Qp=function(){function t(){(0,o.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(e,n){var i=this,r=e.renderingService,a=e.renderingContext,o=e.config;this.context=e;var s=a.root.ownerDocument.defaultView,l=function(t){r.hooks.pointerMove.call(t)},u=function(t){r.hooks.pointerUp.call(t)},c=function(t){r.hooks.pointerDown.call(t)},h=function(t){r.hooks.pointerOver.call(t)},d=function(t){r.hooks.pointerOut.call(t)},f=function(t){r.hooks.pointerCancel.call(t)},p=function(t){r.hooks.pointerWheel.call(t)},g=function(t){r.hooks.click.call(t)};r.hooks.init.tap(t.tag,(function(){var t=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",l,!0),t.addEventListener("pointerdown",c,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",h,!0),n.globalThis.addEventListener("pointerup",u,!0),n.globalThis.addEventListener("pointercancel",f,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",l,!0),t.addEventListener("mousedown",c,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",h,!0),n.globalThis.addEventListener("mouseup",u,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",c,!0),t.addEventListener("touchend",u,!0),t.addEventListener("touchmove",l,!0),t.addEventListener("touchcancel",f,!0)}(t),o.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),r.hooks.destroy.tap(t.tag,(function(){var t=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",l,!0),t.removeEventListener("pointerdown",c,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",h,!0),n.globalThis.removeEventListener("pointerup",u,!0),n.globalThis.removeEventListener("pointercancel",f,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",l,!0),t.removeEventListener("mousedown",c,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",h,!0),n.globalThis.removeEventListener("mouseup",u,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",c,!0),t.removeEventListener("touchend",u,!0),t.removeEventListener("touchmove",l,!0),t.removeEventListener("touchcancel",f,!0)}(t),o.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))}}])}();Qp.tag="DOMInteraction";var Jp=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).name="dom-interaction",t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){this.addRenderingPlugin(new Qp)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(mi),tg=function(){function t(){(0,o.Z)(this,t),this.displayObjectHTMLElementMap=new WeakMap}return(0,s.Z)(t,[{key:"joinTransformMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var i=this,r=e.camera,a=e.renderingContext,o=e.renderingService;this.context=e;var s=a.root.ownerDocument.defaultView,l=s.context.eventService.nativeHTMLMap,u=function(t,e){e.style.transform=i.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},c=function(t){var e=t.target;if(e.nodeName===pi.HTML){i.$camera||(i.$camera=i.createCamera(r));var n=i.getOrCreateEl(e);i.$camera.appendChild(n),Object.keys(e.attributes).forEach((function(t){i.updateAttribute(t,e)})),u(e,n),l.set(n,e)}},h=function(t){var e=t.target;if(e.nodeName===pi.HTML&&i.$camera){var n=i.getOrCreateEl(e);n&&(n.remove(),l.delete(n))}},d=function(t){var e=t.target;if(e.nodeName===pi.HTML){var n=t.attrName;i.updateAttribute(n,e)}},f=function(t){var e=t.target;(e.nodeName===pi.FRAGMENT?e.childNodes:[e]).forEach((function(t){if(t.nodeName===pi.HTML){var e=i.getOrCreateEl(t);u(t,e)}}))},p=function(){if(i.$camera){var t=i.context.config,e=t.width,n=t.height;i.$camera.parentElement.style.width="".concat(e||0,"px"),i.$camera.parentElement.style.height="".concat(n||0,"px")}};o.hooks.init.tap(t.tag,(function(){s.addEventListener(Wl.RESIZE,p),s.addEventListener(Ms.MOUNTED,c),s.addEventListener(Ms.UNMOUNTED,h),s.addEventListener(Ms.ATTR_MODIFIED,d),s.addEventListener(Ms.BOUNDS_CHANGED,f)})),o.hooks.endFrame.tap(t.tag,(function(){i.$camera&&a.renderReasons.has(Es.CAMERA_CHANGED)&&(i.$camera.style.transform=i.joinTransformMatrix(r.getOrthoMatrix()))})),o.hooks.destroy.tap(t.tag,(function(){i.$camera&&i.$camera.remove(),s.removeEventListener(Wl.RESIZE,p),s.removeEventListener(Ms.MOUNTED,c),s.removeEventListener(Ms.UNMOUNTED,h),s.removeEventListener(Ms.ATTR_MODIFIED,d),s.removeEventListener(Ms.BOUNDS_CHANGED,f)}))}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,i=e.width,r=e.height,a=this.context.contextService.getDomElement(),o=a.parentNode;if(o){var s="g-canvas-camera",l=o.querySelector("#".concat(s));if(!l){var u=(n||document).createElement("div");u.style.overflow="hidden",u.style.pointerEvents="none",u.style.position="absolute",u.style.left="0px",u.style.top="0px",u.style.width="".concat(i||0,"px"),u.style.height="".concat(r||0,"px");var c=(n||document).createElement("div");l=c,c.id=s,c.style.position="absolute",c.style.left="".concat(a.offsetLeft||0,"px"),c.style.top="".concat(a.offsetTop||0,"px"),c.style.transformOrigin="left top",c.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),c.style.pointerEvents="none",c.style.width="100%",c.style.height="100%",u.appendChild(c),o.appendChild(u)}return l}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var i=e.parsedStyle.innerHTML;(0,ue.Z)(i)?n.innerHTML=i:(n.innerHTML="",n.appendChild(i));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var r=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(r[0].buildCSSText(null,null,"")," ").concat(r[1].buildCSSText(null,null,""));break;case"width":var a=e.parsedStyle.width;n.style.width=(0,oe.Z)(a)?"".concat(a,"px"):a.toString();break;case"height":var o=e.parsedStyle.height;n.style.height=(0,oe.Z)(o)?"".concat(o,"px"):o.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var l=e.parsedStyle.visibility;n.style.visibility=l;break;case"pointerEvents":var u=e.parsedStyle.pointerEvents,c=void 0===u?"auto":u;n.style.pointerEvents=c;break;case"opacity":var h=e.parsedStyle.opacity;n.style.opacity="".concat(h);break;case"fill":var d=e.parsedStyle.fill,f="";Ur(d)?f=d.isNone?"transparent":e.getAttribute("fill"):Array.isArray(d)?f=e.getAttribute("fill"):jr(d),n.style.background=f;break;case"stroke":var p=e.parsedStyle.stroke,g="";Ur(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)?g=e.getAttribute("stroke"):jr(p),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var m=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(m||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var v=e.style.filter;n.style.filter=v;break;default:(0,le.Z)(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();tg.tag="HTMLRendering";var eg=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).name="html-renderer",t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){this.addRenderingPlugin(new tg)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(mi),ng=function(){return(0,s.Z)((function t(e){(0,o.Z)(this,t),this.renderingContext=e.renderingContext,this.canvasConfig=e.config}),[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=(0,ue.Z)(e)?document.getElementById(e):e,this.$container)){var i=document.createElement("canvas");this.$container.appendChild(i),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=i}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(t,e){var n=this.canvasConfig.devicePixelRatio||bo&&window.devicePixelRatio||1;n=n>=1?Math.ceil(n):1,this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){bo&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Es.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(t=(0,li.Z)((0,si.Z)().mark((function t(){var e,n,i,r=arguments;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},n=e.type,i=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,i));case 3:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),ig=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=d(this,e,[].concat(i))).name="canvas-context-register",t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){this.context.ContextService=ng}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(mi),rg=function(t){function e(t){var n;return(0,o.Z)(this,e),(n=d(this,e,[t])).registerPlugin(new ig),n.registerPlugin(new Dp),n.registerPlugin(new Qf),n.registerPlugin(new Kp),n.registerPlugin(new Jp),n.registerPlugin(new Ep),n.registerPlugin(new eg),n}return(0,f.Z)(e,t),(0,s.Z)(e)}(vi),ag=n(84942),og=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class sg extends Bf{constructor(t){super(Object.assign(Object.assign({},t),{style:Object.assign({},sg.defaultStyleProps,t.style)})),this.rootPointerEvent=new ps(null),this.forwardEvents=t=>{const e=this.context.canvas,n=e.context.renderingContext.root.ownerDocument.defaultView;this.normalizeToPointerEvent(t,n).forEach((i=>{const r=this.bootstrapEvent(this.rootPointerEvent,i,n,t);Xd(e.context.eventService,"mappingTable.pointerupoutside",[]),e.context.eventService.mapEvent(r)}))}}get eventService(){return this.context.canvas.context.eventService}get events(){return[uc.CLICK,uc.POINTER_DOWN,uc.POINTER_MOVE,uc.POINTER_UP,uc.POINTER_OVER,uc.POINTER_LEAVE]}getDomElement(){return this.getShape("key").getDomElement()}getKeyStyle(t){const e=(0,ag.Z)(t,["dx","dy","innerHTML","pointerEvents","cursor"]),{dx:n=0,dy:i=0}=e,r=og(e,["dx","dy"]),[a,o]=this.getSize(t);return Object.assign(Object.assign({x:n,y:i},r),{width:a,height:o})}drawKeyShape(t,e){const n=this.getKeyStyle(t),{x:i,y:r,width:a=0,height:o=0}=n,s=this.upsert("key-container",Il,{x:i,y:r,width:a,height:o,opacity:0},e);return this.upsert("key",Ml,n,s)}connectedCallback(){if(!(this.context.canvas.getRenderer("main")instanceof rg))return;const t=this.getDomElement();this.events.forEach((e=>{t.addEventListener(e,this.forwardEvents)}))}attributeChangedCallback(t,e,n){"zIndex"===t&&e!==n&&(this.getDomElement().style.zIndex=n)}destroy(){const t=this.getDomElement();this.events.forEach((e=>{t.removeEventListener(e,this.forwardEvents)})),super.destroy()}normalizeToPointerEvent(t,e){const n=[];if(e.isTouchEvent(t))for(let e=0;e<t.changedTouches.length;e++){const i=t.changedTouches[e];Qe(i.button)&&(i.button=0),Qe(i.buttons)&&(i.buttons=1),Qe(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Qe(i.width)&&(i.width=i.radiusX||1),Qe(i.height)&&(i.height=i.radiusY||1),Qe(i.tiltX)&&(i.tiltX=0),Qe(i.tiltY)&&(i.tiltY=0),Qe(i.pointerType)&&(i.pointerType="touch"),Qe(i.pointerId)&&(i.pointerId=i.identifier||0),Qe(i.pressure)&&(i.pressure=i.force||.5),Qe(i.twist)&&(i.twist=0),Qe(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){const e=t;Qe(e.isPrimary)&&(e.isPrimary=!0),Qe(e.width)&&(e.width=1),Qe(e.height)&&(e.height=1),Qe(e.tiltX)&&(e.tiltX=0),Qe(e.tiltY)&&(e.tiltY=0),Qe(e.pointerType)&&(e.pointerType="mouse"),Qe(e.pointerId)&&(e.pointerId=1),Qe(e.pressure)&&(e.pressure=.5),Qe(e.twist)&&(e.twist=0),Qe(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)}else n.push(t);return n}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,n,i){t.view=n,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:r,y:a}=this.getViewportXY(e);t.viewport.x=r,t.viewport.y=a;const[o,s]=this.context.canvas.getCanvasByViewport([r,a]);return t.canvas.x=o,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t}getViewportXY(t){let e,n;const{offsetX:i,offsetY:r,clientX:a,clientY:o}=t;if(!this.context.canvas.context.config.supportsCSSTransform||(0,le.Z)(i)||(0,le.Z)(r)){const t=this.eventService.client2Viewport({x:a,y:o});e=t.x,n=t.y}else e=i,n=r;return{x:e,y:n}}onframe(){super.onframe();const{opacity:t}=this.attributes;this.getDomElement().style.opacity=`${t}`}}sg.defaultStyleProps={size:[160,80],halo:!1,icon:!1,label:!1,pointerEvents:"auto"};var lg=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class ug extends Bf{constructor(t){super(af({style:ug.defaultStyleProps},t))}getKeyStyle(t){const[e,n]=this.getSize(t),i=super.getKeyStyle(t),{fillOpacity:r,opacity:a=r}=i,o=lg(i,["fillOpacity","opacity"]);return Object.assign(Object.assign({opacity:a},o),{width:e,height:n,x:-e/2,y:-n/2})}getHaloStyle(t){if(!1===t.halo)return!1;const e=this.getShape("key").attributes,{fill:n,stroke:i}=e,r=(lg(e,["fill","stroke"]),Qd(this.getGraphicStyle(t),"halo")),a=Number(r.lineWidth),[o,s]=ed(this.getSize(t),[a,a]);return Object.assign(Object.assign({},r),{width:o,height:s,fill:"transparent",x:-o/2,y:-s/2})}getIconStyle(t){const e=super.getIconStyle(t),[n,i]=this.getSize(t);return!!e&&Object.assign({width:n*Bd,height:i*Bd},e)}drawKeyShape(t,e){const n=this.upsert("key",Of,this.getKeyStyle(t),e);return Lf(this),n}drawHaloShape(t,e){this.upsert("halo",Il,this.getHaloStyle(t),e)}update(t){super.update(t),t&&("x"in t||"y"in t||"z"in t)&&Rf(this)}}ug.defaultStyleProps={size:32};class cg extends zf{constructor(t){super(af({style:cg.defaultStyleProps},t))}getPoints(t){const{direction:e}=t,[n,i]=this.getSize(t);return function(t,e,n){const i=e/2,r=t/2,a={up:[[-r,i],[r,i],[0,-i]],left:[[-r,0],[r,i],[r,-i]],right:[[-r,i],[-r,-i],[r,0]],down:[[-r,-i],[r,-i],[0,i]]};return a[n]||a.up}(n,i,e)}getPortXY(t,e){const{direction:n}=t,{placement:i="top"}=e,r=this.getShape("key").getLocalBounds(),[a,o]=this.getSize(t),s=function(t,e,n){const i=e/2,r=t/2,a={};"down"===n?(a.bottom=a.default=[0,i],a.right=[r,-i],a.left=[-r,-i]):"left"===n?(a.top=[r,-i],a.bottom=[r,i],a.left=a.default=[-r,0]):"right"===n?(a.top=[-r,-i],a.bottom=[-r,i],a.right=a.default=[r,0]):(a.left=[-r,i],a.top=a.default=[0,-i],a.right=[r,i]);return a}(a,o,n);return pm(r,i,s,!1)}getIconStyle(t){const{icon:e,iconText:n,iconSrc:i,direction:r}=t;if(!1===e||yf(n||i))return!1;const a=Qd(this.getGraphicStyle(t),"icon"),o=this.getShape("key").getLocalBounds(),[s,l]=function(t,e){const{center:n}=t,[i,r]=Xc(t);return["up"===e||"down"===e?n[0]:"right"===e?n[0]-i/6:n[0]+i/6,"left"===e||"right"===e?n[1]:"down"===e?n[1]-r/6:n[1]+r/6]}(o,r),u=2*function(t,e){let[n,i]=Xc(t);return[n,i]="up"===e||"down"===e?[n,i]:[i,n],(Math.pow(i,2)-Math.pow(Math.sqrt(Math.pow(n/2,2)+Math.pow(i,2))-n/2,2))/(2*i)}(o,r)*Bd;return Object.assign({x:s,y:l,width:u,height:u},a)}}cg.defaultStyleProps={size:40,direction:"up"};var hg=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class dg extends Bf{constructor(t){super(af({style:dg.defaultStyleProps},t)),this.type="combo",this.updateComboPosition(this.parsedAttributes)}getKeySize(t){const{collapsed:e,childrenNode:n=[]}=t;return 0===n.length?this.getEmptyKeySize(t):e?this.getCollapsedKeySize(t):this.getExpandedKeySize(t)}getEmptyKeySize(t){const{padding:e,collapsedSize:n}=t,[i,r,a,o]=Hc(e);return ed(ef(n),[o+r,i+a,0])}getCollapsedKeySize(t){return ef(t.collapsedSize)}getExpandedKeySize(t){const e=this.getContentBBox(t);return[Zc(e),Wc(e),0]}getContentBBox(t){const{childrenNode:e=[],padding:n}=t,i=e.map((t=>this.context.element.getElement(t))).filter(Boolean);if(0===i.length){const e=new Ti,{x:n=0,y:i=0,size:r}=t,[a,o]=ef(r);return e.setMinMax([n-a/2,i-o/2,0],[n+a/2,i+o/2,0]),e}const r=Kc(i.map((t=>t.getBounds())));return n?$c(r,n):r}drawCollapsedMarkerShape(t,e){const n=this.getCollapsedMarkerStyle(t);sf(this,"collapsedMarker",n)&&(this.upsert("collapsed-marker",Df,n,e),Lf(this))}getCollapsedMarkerStyle(t){if(!t.collapsed||!t.collapsedMarker)return!1;const e=Qd(this.getGraphicStyle(t),"collapsedMarker"),{type:n}=e,i=hg(e,["type"]),r=this.getShape("key"),[a,o]=bd(r.getLocalBounds(),"center"),s=Object.assign(Object.assign({},i),{x:a,y:o});if(n){const e=this.getCollapsedMarkerText(n,t);Object.assign(s,{text:e})}return s}getCollapsedMarkerText(t,e){const{childrenData:n=[]}=e,{model:i}=this.context;return"descendant-count"===t?i.getDescendantsData(this.id).length.toString():"child-count"===t?n.length.toString():"node-count"===t?i.getDescendantsData(this.id).filter((t=>"node"===i.getElementType(kh(t)))).length.toString():(0,en.Z)(t)?t(n):""}getComboPosition(t){const{x:e=0,y:n=0,collapsed:i,childrenData:r=[]}=t;if(0===r.length)return[+e,+n,0];if(i){const{model:t}=this.context,i=t.getDescendantsData(this.id).filter((e=>!t.isCombo(kh(e))));if(i.length>0&&i.some(yd)){return rd(i.reduce(((t,e)=>ed(t,vd(e))),[0,0,0]),i.length)}return[+e,+n,0]}return this.getContentBBox(t).center}getComboStyle(t){const[e,n]=this.getComboPosition(t);return{x:e,y:n,transform:[["translate",e,n]]}}updateComboPosition(t){const e=this.getComboStyle(t);Object.assign(this.style,e);const{x:n,y:i}=e;this.context.model.syncComboDatum({id:this.id,style:{x:n,y:i}}),Rf(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 n=super.animate(this.attributes.collapsed?t:t.map((t=>{var{x:e,y:n,z:i,transform:r}=t;return hg(t,["x","y","z","transform"])})),e);return n?new Proxy(n,{set:(t,e,n)=>("currentTime"===e&&Promise.resolve().then((()=>this.onframe())),Reflect.set(t,e,n))}):n}}dg.defaultStyleProps={childrenNode:[],droppable:!0,draggable:!0,collapsed:!1,collapsedSize:32,collapsedMarker:!0,collapsedMarkerZIndex:1,collapsedMarkerFontSize:12,collapsedMarkerTextAlign:"center",collapsedMarkerTextBaseline:"middle",collapsedMarkerType:"child-count"};var fg=function(t,e){if(!tc(t))return t;for(var n=[],i=0;i<t.length;i++){var r=t[i];e(r,i)&&n.push(r)}return n},pg=function(t,e){return!!tc(t)&&t.indexOf(e)>-1},gg=function(t,e){return void 0===e&&(e=[]),fg(t,(function(t){return!pg(e,t)}))};const mg={padding:10};function vg(t,e,n,i,r,a){const{padding:o}=Object.assign(mg,a),s=Yc(n,o),l=Yc(i,o),u=[t,...r,e];let c=null;const h=[];for(let t=0,e=u.length;t<e-1;t++){const n=t+1,i=u[t],r=u[n],a=Sd(d=i,f=r)||function(t,e){return t[0]===e[0]}(d,f);let p=null;if(0===t)if(n===e-1)if(s.intersects(l))p=Mg(i,r,s,l);else if(th(i,s)||th(r,l))a||(p=Sg(i,r,s,l));else{const t=nh(i,s),e=nh(r,l);p=Eg(t,e,bg(t,e)),p.points.unshift(t),p.points.push(e)}else Qc(r,s)?p=Mg(i,r,s,Yc(r,o),c):a||(p=wg(i,r,s));else n===e-1?Qc(i,l)?p=Mg(i,r,Yc(i,o),l,c):a||(p=Tg(i,r,l,c)):a||(p=Eg(i,r,c));p?(h.push(...p.points),c=p.direction):c=bg(i,r),n<e-1&&h.push(r)}var d,f;return h.map(hd)}const yg={N:"S",S:"N",W:"E",E:"W"},xg={N:-Math.PI/2,S:Math.PI/2,E:0,W:Math.PI};function bg(t,e){const[n,i]=t,[r,a]=e;return n===r?i>a?"N":"S":i===a?n>r?"W":"E":null}function _g(t,e){return"N"===e||"S"===e?Wc(t):Zc(t)}function Eg(t,e,n){const i=[t[0],e[1]],r=[e[0],t[1]],a=bg(t,i),o=bg(t,r),s=a===n||a!==(n?yg[n]:null)&&o!==n?i:r;return{points:[s],direction:bg(s,e)}}function wg(t,e,n){if(th(t,n)){const i=Cg(t,e,n);return{points:[i],direction:bg(i,e)}}{const i=nh(t,n),r=["left","right"].includes(eh(t,n))?[e[0],i[1]]:[i[0],e[1]];return{points:[r],direction:bg(r,e)}}}function Tg(t,e,n,i){const r=th(e,n)?e:nh(e,n),a=[[r[0],t[1]],[t[0],r[1]]],o=a.filter((t=>function(t,e){return!Qc(t,e)}(t,n)&&!Jc(t,n,!0))),s=o.filter((e=>bg(e,t)!==i));if(s.length>0){const n=s.find((e=>bg(t,e)===i))||s[0];return{points:[n],direction:bg(n,e)}}{const r=Td(e,gg(a,o)[0],_g(n,i)/2);return{points:[Cg(r,t,n),r],direction:bg(r,e)}}}function Sg(t,e,n,i){let r=wg(t,e,n);const a=dd(r.points[0]);if(Qc(a,i)){r=wg(e,t,i);const o=dd(r.points[0]);if(Qc(o,n)){const s=Td(t,a,_g(n,bg(t,a))/2),l=Td(e,o,_g(i,bg(e,o))/2),u=[(s[0]+l[0])/2,(s[1]+l[1])/2],c=wg(t,u,n),h=Tg(u,e,i,c.direction);r.points=[c.points[0],h.points[0]],r.direction=h.direction}}return r}function Mg(t,e,n,i,r){const a=.01,o=Kc([n,i]),s=od(e,o.center)>od(t,o.center),[l,u]=s?[e,t]:[t,e],c=Wc(o)+Zc(o);let h;if(r){const t=[l[0]+c*Math.cos(xg[r]),l[1]+c*Math.sin(xg[r])];h=Td(nh(t,o),t,a)}else h=Td(nh(l,o),l,-.01);let d=Cg(h,u,o),f=[wd(h,2),wd(d,2)];if(nc(wd(h),wd(d))){const t=ud(nd(h,l),[1,0,0])+Math.PI/2;d=[u[0]+c*Math.cos(t),u[1]+c*Math.sin(t),0],d=wd(Td(nh(d,o),u,-.01),2);f=[h,Cg(h,d,o),d]}return{points:s?f.reverse():f,direction:bg(s?h:d,e)}}function Cg(t,e,n){let i=[t[0],e[1]];return Qc(i,n)&&(i=[e[0],t[1]]),i}function Ag(t,e,n,i,r){let a="number"==typeof e?e:.5;"start"===e&&(a=0),"end"===e&&(a=.99);const o=_d(t.getPoint(a)),s=_d(t.getPoint(a+.01));let l="start"===e?"left":"end"===e?"right":"center";if(Sd(o,s)||!n){const[e,n]=Og(t,a,i,r);return{transform:[["translate",e,n]],textAlign:l}}let u=Math.atan2(s[1]-o[1],s[0]-o[0]);s[0]<o[0]&&(l="center"===l?l:"left"===l?"right":"left",i*=-1,u+=Math.PI);const[c,h]=Og(t,a,i,r,u);return{textAlign:l,transform:[["translate",c,h],["rotate",u/Math.PI*180]]}}function Og(t,e,n,i,r){const[a,o]=_d(t.getPoint(e));let s=n,l=i;return r&&(s=n*Math.cos(r)-i*Math.sin(r),l=n*Math.sin(r)+i*Math.cos(r)),[a+s,o+l]}function Ng(t,e,n,i){if(nc(t,e))return t;const r=nd(e,t),a=[t[0]+n*r[0],t[1]+n*r[1]],o=ld(cd(r,!1));return a[0]+=i*o[0],a[1]+=i*o[1],a}function Pg(t,e,n){return[["M",t[0],t[1]],["C",n[0][0],n[0][1],n[1][0],n[1][1],e[0],e[1]]]}function Lg(t,e=0,n=!1){const i=t[0],r=t[t.length-1],a=t.slice(1,t.length-1),o=[["M",i[0],i[1]]];return a.forEach(((t,n)=>{const s=a[n-1]||i,l=a[n+1]||r;if(!pd([s,u=t],[u,l])&&e){const[n,i]=function(t,e,n,i){const r=sd(t,e),a=sd(n,e),o=Math.min(i,Math.min(r,a)/2),s=[e[0]-o/r*(e[0]-t[0]),e[1]-o/r*(e[1]-t[1])],l=[e[0]-o/a*(e[0]-n[0]),e[1]-o/a*(e[1]-n[1])];return[s,l]}(s,t,l,e);o.push(["L",n[0],n[1]],["Q",t[0],t[1],i[0],i[1]],["L",i[0],i[1]])}else o.push(["L",t[0],t[1]]);var u})),o.push(["L",r[0],r[1]]),n&&o.push(["Z"]),o}function Rg(t,e,n,i,r){const a=Yc(t),o=t.getCenter();let s=i&&vm(i),l=r&&vm(r);if(!s||!l){const i=(t=>{const e=Math.PI/2,n=Wc(t)/2,i=Zc(t)/2,r=Math.atan2(n,i)/2,a=Math.atan2(i,n)/2;return{top:[-e-a,-e+a],"top-right":[-e+a,-r],"right-top":[-e+a,-r],right:[-r,r],"bottom-right":[r,e-a],"right-bottom":[r,e-a],bottom:[e-a,e+a],"bottom-left":[e+a,Math.PI-r],"left-bottom":[e+a,Math.PI-r],left:[Math.PI-r,Math.PI+r],"top-left":[Math.PI+r,-e-a],"left-top":[Math.PI+r,-e-a]}})(a),r=i[e][0],u=i[e][1],[c,h]=Xc(a),d=Math.max(c,h),f=ed(o,[d*Math.cos(r),d*Math.sin(r),0]),p=ed(o,[d*Math.cos(u),d*Math.sin(u),0]);s=_m(t,f),l=_m(t,p),n||([s,l]=[l,s])}return[s,l]}function Dg(t,e,n,i,r,a){const o=t.getPorts()[r||a],s=t.getPorts()[a||r];let[l,u]=Rg(t,e,n,o,s);const c=function(t,e,n,i){const r=t.getCenter();if(nc(e,n)){const t=nd(e,r),a=[i*Math.sign(t[0])||i/2,i*Math.sign(t[1])||-i/2,0];return[ed(e,a),ed(n,id(a,[1,-1,1]))]}return[Td(r,e,od(r,e)+i),Td(r,n,od(r,n)+i)]}(t,l,u,i);return o&&(l=bm(o,c[0])),s&&(u=bm(s,c[c.length-1])),Pg(l,u,c)}function kg(t,e,n,i,r,a,o){const s=gm(t),l=s[a||o],u=s[o||a];let[c,h]=Rg(t,n,i,l,u);const d=function(t,e,n,i){const r=[],a=Yc(t);if(nc(e,n)){switch(eh(e,a)){case"left":r.push([e[0]-i,e[1]]),r.push([e[0]-i,e[1]+i]),r.push([e[0],e[1]+i]);break;case"right":r.push([e[0]+i,e[1]]),r.push([e[0]+i,e[1]+i]),r.push([e[0],e[1]+i]);break;case"top":r.push([e[0],e[1]-i]),r.push([e[0]+i,e[1]-i]),r.push([e[0]+i,e[1]]);break;case"bottom":r.push([e[0],e[1]+i]),r.push([e[0]+i,e[1]+i]),r.push([e[0]+i,e[1]])}}else{const t=eh(e,a),o=eh(n,a);if(t===o){let a,o;switch(t){case"left":a=Math.min(e[0],n[0])-i,r.push([a,e[1]]),r.push([a,n[1]]);break;case"right":a=Math.max(e[0],n[0])+i,r.push([a,e[1]]),r.push([a,n[1]]);break;case"top":o=Math.min(e[1],n[1])-i,r.push([e[0],o]),r.push([n[0],o]);break;case"bottom":o=Math.max(e[1],n[1])+i,r.push([e[0],o]),r.push([n[0],o])}}else{const s=(t,e)=>({left:[e[0]-i,e[1]],right:[e[0]+i,e[1]],top:[e[0],e[1]-i],bottom:[e[0],e[1]+i]}[t]),l=s(t,e),u=s(o,n),c=Cg(l,u,a);r.push(l,c,u)}}return r}(t,c,h,r);return l&&(c=bm(l,d[0])),u&&(h=bm(u,d[d.length-1])),Lg([c,...d,h],e)}function Ig(t,e){const n=new Set,i=new Set,r=new Set;return t.forEach((a=>{e(a).forEach((e=>{n.add(e),t.includes(e.source)&&t.includes(e.target)?i.add(e):r.add(e)}))})),{edges:Array.from(n),internal:Array.from(i),external:Array.from(r)}}function Bg(t,e){const n=[];let i=t;for(;i;){n.push(i);const t=e(kh(i));if(!t)break;i=t}if(n.some((t=>{var e;return null===(e=t.style)||void 0===e?void 0:e.collapsed}))){const t=n.reverse().findIndex(Zd);return n[t]||n.at(-1)}return t}const Fg=(t,e)=>{const n=Math.max(t,e)/2;return[["M",-t/2,0],["A",n,n,0,1,0,2*n-t/2,0],["A",n,n,0,1,0,-t/2,0],["Z"]]},zg=(t,e)=>[["M",-t/2,0],["L",t/2,-e/2],["L",t/2,e/2],["Z"]],Gg=(t,e)=>[["M",-t/2,0],["L",0,-e/2],["L",t/2,0],["L",0,e/2],["Z"]],jg=(t,e)=>[["M",-t/2,0],["L",t/2,-e/2],["L",4*t/5-t/2,0],["L",t/2,e/2],["Z"]],Ug=(t,e)=>[["M",-t/2,-e/2],["L",t/2,-e/2],["L",t/2,e/2],["L",-t/2,e/2],["Z"]],Hg=(t,e)=>{const n=t/2,i=t/7,r=t-i;return[["M",-n,0],["L",0,-e/2],["L",0,e/2],["Z"],["M",r-n,-e/2],["L",r+i-n,-e/2],["L",r+i-n,e/2],["L",r-n,e/2],["Z"]]},Vg=(t,e)=>[["M",t/2,-e/2],["L",-t/2,0],["L",t/2,0],["L",-t/2,0],["L",t/2,e/2]];var Zg=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class Wg extends kf{constructor(t){super(af({style:Wg.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:n}=e,i=Zg(e,["loop"]),{sourceNode:r,targetNode:a}=this,o=n&&(l=a,(s=r)&&l&&s===l)?this.getLoopPath(t):this.getKeyPath(t);var s,l;return Object.assign({d:o},tf(i,["halo","label","startArrow","endArrow"]))}getLoopPath(t){const{sourcePort:e,targetPort:n}=t,i=this.sourceNode,r=Yc(i),a=Math.max(Zc(r),Wc(r)),{placement:o,clockwise:s,dist:l=a}=Qd(this.getGraphicStyle(t),"loop");return Dg(i,o,s,l,e,n)}getEndpoints(t,e=!0,n=[]){const{sourcePort:i,targetPort:r}=t,{sourceNode:a,targetNode:o}=this,[s,l]=function(t,e,n,i){const r=ym(t,e,n,i),a=ym(e,t,i,n);return[r,a]}(a,o,i,r);if(!e){return[s?vm(s):a.getCenter(),l?vm(l):o.getCenter()]}const u="function"==typeof n?n():n;return[xm(s||a,u[0]||l||o),xm(l||o,u[u.length-1]||s||a)]}getHaloStyle(t){if(!1===t.halo)return!1;const e=this.getKeyStyle(t),n=Qd(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign({},e),n)}getLabelStyle(t){if(!1===t.label||!t.labelText)return!1;const e=Qd(this.getGraphicStyle(t),"label"),{placement:n,offsetX:i,offsetY:r,autoRotate:a,maxWidth:o}=e,s=Zg(e,["placement","offsetX","offsetY","autoRotate","maxWidth"]),l=Ag(this.shapeMap.key,n,a,i,r),u=this.shapeMap.key.getLocalBounds(),c=function(t,e,n=1){return hf(od(t[0],t[1])*n,e)}([u.min,u.max],o);return Object.assign({wordWrapWidth:c},l,s)}getBadgeStyle(t){if(!1===t.badge||!t.badgeText)return!1;const e=Qd(t,"badge"),{offsetX:n,offsetY:i,placement:r}=e,a=Zg(e,["offsetX","offsetY","placement"]);return Object.assign(a,function(t,e,n,i,r){var a,o;const s=2*(null===(a=t.badge)||void 0===a?void 0:a.getGeometryBounds().halfExtents[0])||0,l=2*(null===(o=t.label)||void 0===o?void 0:o.getGeometryBounds().halfExtents[0])||0;return Ag(t.key,n,!0,(l?(l/2+s/2)*("suffix"===e?1:-1):0)+i,r)}(this.shapeMap,r,t.labelPlacement,n,i))}drawArrow(t,e){var n;const i="start"===e,r=t["start"===e?"startArrow":"endArrow"],a=this.shapeMap.key;if(r){const n=this.getArrowStyle(t,i);if(!sf(this,`arrow-${e}`,n))return;const[r,o,s]=i?["markerStart","markerStartOffset","startArrowOffset"]:["markerEnd","markerEndOffset","endArrowOffset"],l=a.parsedStyle[r];if(l)l.attr(n);else{const t=new(n.src?Cl:Pl)({style:n});a.style[r]=t}a.style[o]=t[s]||n.width/2+ +n.lineWidth}else{const t=i?"markerStart":"markerEnd";null===(n=a.style[t])||void 0===n||n.destroy(),a.style[t]=null}}getArrowStyle(t,e){const n=this.getShape("key").attributes,i=e?"startArrow":"endArrow",a=Qd(this.getGraphicStyle(t),i),{size:o,type:s}=a,l=Zg(a,["size","type"]),[u,c]=ef(function(t,e){return e||(t<4?10:4===t?12:2.5*t)}(n.lineWidth,o)),h=((0,en.Z)(s)?s:r[s]||zg)(u,c);return Object.assign((0,ag.Z)(n,["stroke","strokeOpacity","fillOpacity"]),{width:u,height:c},Object.assign({},h&&{d:h,fill:"simple"===s?"":n.stroke}),l)}drawLabelShape(t,e){const n=this.getLabelStyle(t);sf(this,"label",n)&&this.upsert("label",Ef,n,e)}drawHaloShape(t,e){const n=this.getHaloStyle(t);sf(this,"halo",n)&&this.upsert("halo",Pl,n,e)}drawBadgeShape(t,e){const n=this.getBadgeStyle(t);sf(this,"badge",n)&&this.upsert("badge",wf,n,e)}drawSourceArrow(t){this.drawArrow(t,"start")}drawTargetArrow(t){this.drawArrow(t,"end")}drawKeyShape(t,e){const n=this.getKeyStyle(t);if(sf(this,"key",n))return this.upsert("key",Pl,n,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 n=super.animate(t,e);return n?new Proxy(n,{set:(t,e,n)=>("currentTime"===e&&Promise.resolve().then((()=>this.onframe())),Reflect.set(t,e,n))}):n}}Wg.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 Xg extends Wg{constructor(t){super(af({style:Xg.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t),{controlPoints:i,curvePosition:r,curveOffset:a}=t,o=this.getControlPoints(e,n,function(t){return(0,oe.Z)(t)?[t,1-t]:t}(r),function(t){return(0,oe.Z)(t)?[t,-t]:t}(a),i);return Pg(e,n,o)}getControlPoints(t,e,n,i,r){return 2===(null==r?void 0:r.length)?r:[Ng(t,e,n[0],i[0]),Ng(t,e,n[1],i[1])]}}Xg.defaultStyleProps={curvePosition:.5,curveOffset:20};class Yg extends Xg{constructor(t){super(af({style:Yg.defaultStyleProps},t))}getControlPoints(t,e,n,i){const r=e[0]-t[0];return[[t[0]+r*n[0]+i[0],t[1]],[e[0]-r*n[1]+i[1],e[1]]]}}Yg.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class qg extends Xg{constructor(t){super(af({style:qg.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=vd(this.ref);return[this.sourceNode.getIntersectPoint(e,!0),this.targetNode.getIntersectPoint(e)]}toRadialCoordinate(t){const e=vd(this.ref);return[od(t,e),fd(nd(t,e))]}getControlPoints(t,e,n,i){const[r,a]=this.toRadialCoordinate(t),[o]=this.toRadialCoordinate(e),s=o-r;return[[t[0]+(s*n[0]+i[0])*Math.cos(a),t[1]+(s*n[0]+i[0])*Math.sin(a)],[e[0]-(s*n[1]-i[0])*Math.cos(a),e[1]-(s*n[1]-i[0])*Math.sin(a)]]}}qg.defaultStyleProps={curvePosition:.5,curveOffset:20};class $g extends Xg{constructor(t){super(af({style:$g.defaultStyleProps},t))}getControlPoints(t,e,n,i){const r=e[1]-t[1];return[[t[0],t[1]+r*n[0]+i[0]],[e[0],e[1]-r*n[1]+i[1]]]}}$g.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class Kg extends Wg{constructor(t){super(af({style:Kg.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t);return[["M",e[0],e[1]],["L",n[0],n[1]]]}}Kg.defaultStyleProps={};const Qg={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:sd},Jg=t=>`${Math.round(t[0])}|||${Math.round(t[1])}`;function tm(t,e){const n=t=>Math.round(t/e);return(0,oe.Z)(t)?n(t):t.map(n)}function em(t,e){const n=e[0]-t[0],i=e[1]-t[1];return n||i?Math.atan2(i,n):0}function nm(t,e,n,i){const r=em(t,e),a=n[Jg(t)];return function(t,e){const n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n}(em(a||i,t),r)}function im(t,e,n){return Math.min(...e.map((e=>n(t,e))))}const rm=(t,e,n,i)=>{if(!e)return[t];const{directionMap:r,offset:a}=i,o=$c(e.getRenderBounds(),a),s=Object.keys(r).reduce(((e,i)=>{if(n.includes(i)){const n=r[i],[a,s]=Xc(o),l=[t[0]+n.stepX*a,t[1]+n.stepY*s],u=function(t){const{min:[e,n],max:[i,r]}=t,a=[e,r],o=[i,r],s=[i,n],l=[e,n];return[[a,o],[o,s],[s,l],[l,a]]}(o);for(let n=0;n<u.length;n++){const i=gd([t,l],u[n]);i&&Jc(i,o)&&e.push(i)}}return e}),[]);return Qc(t,o)||s.push(t),s.map((t=>tm(t,i.gridSize)))},am=(t,e,n,i,r,a,o)=>{const s=[];let l=[a[0]===i[0]?i[0]:t[0]*o,a[1]===i[1]?i[1]:t[1]*o];s.unshift(l);let u=t,c=e[Jg(u)];for(;c;){const t=c,i=u;nm(t,i,e,n)&&(l=[t[0]===i[0]?l[0]:t[0]*o,t[1]===i[1]?l[1]:t[1]*o],s.unshift(l)),c=e[Jg(t)],u=t}const h=r.map((t=>[t[0]*o,t[1]*o])),d=function(t,e,n){let i=t[0],r=n(t[0],e);for(let a=0;a<t.length;a++){const o=t[a],s=n(o,e);s<r&&(i=o,r=s)}return i}(h,l,sd);return s.unshift(d),s};function om(t,e,n,i){const r=hd(t.getCenter()),a=hd(e.getCenter()),o=Object.assign(Qg,i),{gridSize:s}=o,l=((t,e)=>{const{offset:n,gridSize:i}=e,r={};return t.forEach((t=>{if(!t||t.destroyed||!t.isVisible())return;const e=$c(t.getRenderBounds(),n);for(let t=tm(e.min[0],i);t<=tm(e.max[0],i);t+=1)for(let n=tm(e.min[1],i);n<=tm(e.max[1],i);n+=1)r[`${t}|||${n}`]=!0})),r})(o.enableObstacleAvoidance?n:[t,e],o),u=tm(r,s),c=tm(a,s),h=rm(r,t,o.startDirections,o),d=rm(a,e,o.endDirections,o);h.forEach((t=>delete l[Jg(t)])),d.forEach((t=>delete l[Jg(t)]));const f={},p={},g={},m={},v={},y=new sm;for(let t=0;t<h.length;t++){const e=h[t],n=Jg(e);f[n]=e,m[n]=0,v[n]=im(e,d,o.distFunc),y.add({id:n,value:v[n]})}const x=d.map((t=>Jg(t)));let b,_=o.maximumLoops,E=1/0;for(const[t,e]of Object.entries(f))v[t]<=E&&(E=v[t],b=e);for(;Object.keys(f).length>0&&_>0;){const t=y.minId(!1);if(!t)break;b=f[t];const e=Jg(b);if(x.includes(e))return am(b,g,u,a,h,c,s);delete f[e],y.remove(e),p[e]=!0;for(const t of Object.values(o.directionMap)){const n=ed(b,[t.stepX,t.stepY]),i=Jg(n);if(p[i])continue;const r=nm(b,n,g,u);if(r>o.maxAllowedDirectionChange)continue;if(l[i])continue;f[i]||(f[i]=n);const a=o.penalties[r],c=o.distFunc(b,n)+(isNaN(a)?s:a),h=m[e]+c,x=m[i];x&&h>=x||(g[i]=b,m[i]=h,v[i]=h+im(n,d,o.distFunc),y.add({id:i,value:v[i]}))}_-=1}return[]}class sm{constructor(){this.arr=[],this.map={},this.arr=[],this.map={}}_innerAdd(t,e){let n=0,i=e-1;for(;i-n>1;){const e=Math.floor((n+i)/2);if(this.arr[e].value>t.value)i=e;else{if(!(this.arr[e].value<t.value))return this.arr.splice(e,0,t),void(this.map[t.id]=!0);n=e}}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)return this.arr.push(t),void(this.map[t.id]=!0);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 lm extends Wg{constructor(t){super(af({style:lm.defaultStyleProps},t))}getControlPoints(t){const{router:e}=t,{sourceNode:n,targetNode:i}=this,[r,a]=this.getEndpoints(t,!1);let o=[];if(e)if("shortest-path"===e.type){o=om(n,i,this.context.element.getNodes(),e),o.length||(o=vg(r,a,n,i,t.controlPoints,{padding:e.offset}))}else"orth"===e.type&&(o=vg(r,a,n,i,t.controlPoints,e));else o=t.controlPoints;return o}getPoints(t){const e=this.getControlPoints(t),[n,i]=this.getEndpoints(t,!0,e);return[n,...e,i]}getKeyPath(t){return Lg(this.getPoints(t),t.radius)}getLoopPath(t){const{sourcePort:e,targetPort:n,radius:i}=t,r=this.sourceNode,a=Yc(r),o=Math.max(Zc(a),Wc(a))/4,{placement:s,clockwise:l,dist:u=o}=Qd(this.getGraphicStyle(t),"loop");return kg(r,i,s,l,u,e,n)}}lm.defaultStyleProps={radius:0,controlPoints:[],router:!1};class um extends Wg{constructor(t){super(af({style:um.defaultStyleProps},t))}getKeyPath(t){const{curvePosition:e,curveOffset:n}=t,[i,r]=this.getEndpoints(t);return function(t,e,n){return[["M",t[0],t[1]],["Q",n[0],n[1],e[0],e[1]]]}(i,r,t.controlPoint||Ng(i,r,e,n))}}function cm(t){return t instanceof Bf&&"node"===t.type}function hm(t){return t instanceof Wg}function dm(t){return t instanceof dg}um.defaultStyleProps={curvePosition:.5,curveOffset:30};const fm={top:[.5,0],right:[1,.5],bottom:[.5,1],left:[0,.5],default:[.5,.5]};function pm(t,e,n=fm,i=!0){const r=[.5,.5],a=(0,ue.Z)(e)?Wd(n,e.toLocaleLowerCase(),r):e;if(!i&&(0,ue.Z)(e))return a;const[o,s]=a||r;return[t.min[0]+Zc(t)*o,t.min[1]+Wc(t)*s]}function gm(t){if(!t)return{};const e=t.getPorts();return(t.attributes.ports||[]).forEach(((n,i)=>{var r;const{key:a,placement:o}=n;mm(n)&&(e[r=a||i]||(e[r]=bd(t.getShape("key").getBounds(),o)))})),e}function mm(t){const{r:e}=t;return!e||0===Number(e)}function vm(t){return jc(t)?t:t.getPosition()}function ym(t,e,n,i){const r=gm(t);if(n)return r[n];const a=Object.values(r);if(0===a.length)return;const o=a.map((t=>vm(t))),s=function(t,e){const n=gm(t);if(e)return[vm(n[e])];const i=Object.values(n);return i.length>0?i.map((t=>vm(t))):[t.getCenter()]}(e,i),[l]=function(t,e){let n=1/0,i=[t[0],e[0]];return t.forEach((t=>{e.forEach((e=>{const r=od(t,e);r<n&&(n=r,i=[t,e])}))})),i}(o,s);return a.find((t=>vm(t)===l))}function xm(t,e){return dm(t)||cm(t)?_m(t,e):bm(t,e)}function bm(t,e){if(!t||!e)return[0,0,0];if(jc(t))return t;if(t.attributes.linkToCenter)return t.getPosition();return Ad(jc(e)?e:cm(e)?e.getCenter():e.getPosition(),t.getBounds())}function _m(t,e){if(!t||!e)return[0,0,0];const n=jc(e)?e:cm(e)?e.getCenter():e.getPosition();return t.getIntersectPoint(n)||t.getCenter()}function Em(t,e="bottom",n=0,i=0,r=!1){const a=e.split("-"),[o,s]=bd(t,e),l=a.includes("left")?"right":a.includes("right")?"left":"center";let u=a.includes("top")?"bottom":a.includes("bottom")?"top":"middle";return r&&(u="top"===u?"bottom":"bottom"===u?"top":u),{transform:[["translate",o+n,s+i]],textBaseline:u,textAlign:l}}function wm(t,e){"update"in t?t.update(e):t.attr(e)}function Tm(t){return Wd(t,"__to_be_destroyed__",!1)}var Sm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Mm extends Kh{constructor(t,e){super(t,Object.assign({},Mm.defaultOptions,e)),this.onCollapseExpand=t=>Sm(this,void 0,void 0,(function*(){if(!this.validate(t))return;const{target:e}=t;if(!(cm(n=e)||hm(n)||dm(n)))return;var n;const i=e.id,{model:r,graph:a}=this.context,o=r.getElementDataById(i);if(!o)return!1;const{onCollapse:s,onExpand:l,animation:u}=this.options;Zd(o)?(yield a.expandElement(i,u),null==l||l(i)):(yield a.collapseElement(i,u),null==s||s(i))})),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(0,en.Z)(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Mm.defaultOptions={enable:!0,animation:!0,trigger:uc.DBLCLICK};var Cm={},Am=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};const Om="g6-create-edge-assist-node-id";class Nm extends Kh{constructor(t,e){super(t,Object.assign({},Nm.defaultOptions,e)),this.drop=t=>Am(this,void 0,void 0,(function*(){const{targetType:e}=t;["combo","node"].includes(e)&&this.source?yield this.handleCreateEdge(t):yield this.cancelEdge()})),this.handleCreateEdge=t=>Am(this,void 0,void 0,(function*(){var e,n,i;if(!this.validate(t))return;const{graph:r,canvas:a,batch:o,element:s}=this.context,{style:l}=this.options;if(this.source)return this.createEdge(t),void(yield this.cancelEdge());o.startBatch(),a.setCursor("crosshair"),this.source=this.getSelectedNodeIDs([t.target.id])[0];const u=r.getElementData(this.source);r.addNodeData([{id:Om,style:{visibility:"hidden",ports:[{key:"port-1",placement:[.5,.5]}],x:null===(e=u.style)||void 0===e?void 0:e.x,y:null===(n=u.style)||void 0===n?void 0:n.y}}]),r.addEdgeData([{id:"g6-create-edge-assist-edge-id",source:this.source,target:Om,style:Object.assign({pointerEvents:"none"},l)}]),yield null===(i=s.draw({animation:!1}))||void 0===i?void 0:i.finished})),this.updateAssistEdge=t=>Am(this,void 0,void 0,(function*(){var e;if(!this.source)return;const{model:n,element:i}=this.context;n.translateNodeTo(Om,[t.canvas.x,t.canvas.y]),yield null===(e=i.draw({animation:!1,silence:!0}))||void 0===e?void 0:e.finished})),this.createEdge=t=>{var e,n;const{graph:i}=this.context,{style:r,onFinish:a,onCreate:o}=this.options;if(void 0===(null===(e=t.target)||void 0===e?void 0:e.id)||void 0===this.source)return;const s=null===(n=this.getSelectedNodeIDs([t.target.id]))||void 0===n?void 0:n[0];var l;const u=o({id:`${this.source}-${s}-${Cm[l=l||"g"]?Cm[l]+=1:Cm[l]=1,l+Cm[l]}`,source:this.source,target:s,style:r});i.addEdgeData([u]),a(u)},this.cancelEdge=()=>Am(this,void 0,void 0,(function*(){var t;if(!this.source)return;const{graph:e,element:n,batch:i}=this.context;e.removeNodeData([Om]),this.source=void 0,yield null===(t=n.draw({animation:!1}))||void 0===t?void 0:t.finished,i.endBatch()})),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;this.unbindEvents(),"click"===e?(t.on(pc.CLICK,this.handleCreateEdge),t.on(lc.CLICK,this.handleCreateEdge),t.on(sc.CLICK,this.cancelEdge),t.on(hc.CLICK,this.cancelEdge)):(t.on(pc.DRAG_START,this.handleCreateEdge),t.on(lc.DRAG_START,this.handleCreateEdge),t.on(uc.POINTER_UP,this.drop)),t.on(uc.POINTER_MOVE,this.updateAssistEdge)}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map((t=>t.id)).concat(t)))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;t.off(pc.CLICK,this.handleCreateEdge),t.off(lc.CLICK,this.handleCreateEdge),t.off(sc.CLICK,this.cancelEdge),t.off(hc.CLICK,this.cancelEdge),t.off(pc.DRAG_START,this.handleCreateEdge),t.off(lc.DRAG_START,this.handleCreateEdge),t.off(uc.POINTER_UP,this.drop),t.off(uc.POINTER_MOVE,this.updateAssistEdge)}destroy(){this.unbindEvents(),super.destroy()}}Nm.defaultOptions={animation:!0,enable:!0,style:{},trigger:"drag",onCreate:t=>t,onFinish:()=>{}};var Pm=function(t,e,n){var i;return function(){var r=this,a=arguments,o=function(){i=null,n||t.apply(r,a)},s=n&&!i;clearTimeout(i),i=setTimeout(o,e),s&&t.apply(r,a)}},Lm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Rm extends Kh{constructor(t,e){super(t,Object.assign({},Rm.defaultOptions,e)),this.isDragging=!1,this.onDragStart=t=>{this.validate(t)&&(this.isDragging=!0,this.context.canvas.setCursor("grabbing"))},this.onDrag=t=>{if(!this.isDragging)return;const{x:e,y:n}=t.movement;0!=(e|n)&&this.translate([e,n],!1)},this.onDragEnd=()=>{var t,e;this.isDragging=!1,this.context.canvas.setCursor(this.defaultCursor),null===(e=(t=this.options).onFinish)||void 0===e||e.call(t)},this.invokeOnFinish=Pm((()=>{var t,e;null===(e=(t=this.options).onFinish)||void 0===e||e.call(t)}),300),this.shortcut=new Dd(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((0,nn.Z)(t)){const{up:e=[],down:n=[],left:i=[],right:r=[]}=t;this.shortcut.bind(e,(t=>this.onTranslate([0,1],t))),this.shortcut.bind(n,(t=>this.onTranslate([0,-1],t))),this.shortcut.bind(i,(t=>this.onTranslate([1,0],t))),this.shortcut.bind(r,(t=>this.onTranslate([-1,0],t)))}else{const{graph:t}=this.context;t.on(uc.DRAG_START,this.onDragStart),t.on(uc.DRAG,this.onDrag),t.on(uc.DRAG_END,this.onDragEnd)}}onTranslate(t,e){return Lm(this,void 0,void 0,(function*(){if(!this.validate(e))return;const{sensitivity:n}=this.options,i=-1*n;yield this.translate(id(t,i),this.options.animation),this.invokeOnFinish()}))}translate(t,e){return Lm(this,void 0,void 0,(function*(){t=this.clampByDirection(t),t=this.clampByRange(t),yield this.context.graph.translateBy(t,e)}))}clampByDirection([t,e]){const{direction:n}=this.options;return"x"===n?e=0:"y"===n&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:n,canvas:i}=this.context,[r,a]=i.getSize(),[o,s,l,u]=Hc(this.options.range),c=[a*o,r*s,a*l,r*u],h=$c(qc(n.getCanvasCenter()),c),d=nd(n.getViewportCenter(),[t,e,0]);if(!Qc(d,h)){const{min:[n,i],max:[r,a]}=h;(d[0]<n&&t>0||d[0]>r&&t<0)&&(t=0),(d[1]<i&&e>0||d[1]>a&&e<0)&&(e=0)}return[t,e]}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return"function"==typeof e?e(t):!!e}unbindEvents(){this.shortcut.unbindAll();const{graph:t}=this.context;t.off(uc.DRAG_START,this.onDragStart),t.off(uc.DRAG,this.onDrag),t.off(uc.DRAG_END,this.onDragEnd)}destroy(){this.shortcut.destroy(),this.unbindEvents(),this.context.canvas.setCursor(this.defaultCursor),super.destroy()}}Rm.defaultOptions={enable:t=>!("targetType"in t)||"canvas"===t.targetType,sensitivity:10,direction:"both",range:1/0};var Dm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class km extends Kh{constructor(t,e){super(t,Object.assign({},km.defaultOptions,e)),this.enable=!1,this.enableElements=["node","combo"],this.target=[],this.shadowOrigin=[0,0],this.hiddenEdges=[],this.isDragging=!1,this.onDrop=t=>Dm(this,void 0,void 0,(function*(){var e;if("link"!==this.options.dropEffect)return;const{model:n,element:i}=this.context,r=t.target.id;this.target.forEach((t=>{const e=n.getParentData(t,gc);e&&kh(e)===r&&n.refreshComboData(r),n.setParent(t,r,gc)})),yield null===(e=null==i?void 0:i.draw({animation:!0}))||void 0===e?void 0:e.finished})),this.setCursor=t=>{if(this.isDragging)return;const{type:e}=t,{canvas:n}=this.context,{cursor:i}=this.options;e===uc.POINTER_ENTER?n.setCursor((null==i?void 0:i.grab)||"grab"):n.setCursor((null==i?void 0:i.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,n=e.getLayer().getContextService().$canvas;n&&(n.addEventListener("blur",this.onDragEnd),n.addEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach((e=>{t.on(`${e}:${uc.DRAG_START}`,this.onDragStart),t.on(`${e}:${uc.DRAG}`,this.onDrag),t.on(`${e}:${uc.DRAG_END}`,this.onDragEnd),t.on(`${e}:${uc.POINTER_ENTER}`,this.setCursor),t.on(`${e}:${uc.POINTER_LEAVE}`,this.setCursor)})),["link"].includes(this.options.dropEffect)&&(t.on(lc.DROP,this.onDrop),t.on(sc.DROP,this.onDrop))}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map((t=>t.id)).concat(t)))}getDelta(t){const e=this.context.graph.getZoom();return rd([t.dx,t.dy],e)}onDragStart(t){var e;if(this.enable=this.validate(t),!this.enable)return;const{batch:n,canvas:i}=this.context;i.setCursor((null===(e=this.options.cursor)||void 0===e?void 0:e.grabbing)||"grabbing"),this.isDragging=!0,n.startBatch(),this.target=this.getSelectedNodeIDs([t.target.id]),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,n;if(this.enable=!1,this.options.shadow){if(!this.shadow)return;this.shadow.style.visibility="hidden";const{x:t=0,y:e=0}=this.shadow.attributes,[n,i]=nd([+t,+e],this.shadowOrigin);this.moveElement(this.target,[n,i])}this.showEdges(),null===(e=(t=this.options).onFinish)||void 0===e||e.call(t,this.target);const{batch:i,canvas:r}=this.context;i.endBatch(),r.setCursor((null===(n=this.options.cursor)||void 0===n?void 0:n.grab)||"grab"),this.isDragging=!1,this.target=[]}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}moveElement(t,e){return Dm(this,void 0,void 0,(function*(){const{graph:n,model:i}=this.context,{dropEffect:r}=this.options;"move"===r&&t.forEach((t=>i.refreshComboData(t))),n.translateElementBy(Object.fromEntries(t.map((t=>[t,e]))),!1)}))}moveShadow(t){if(!this.shadow)return;const{x:e=0,y:n=0}=this.shadow.attributes,[i,r]=t;this.shadow.attr({x:+e+i,y:+n+r})}createShadow(t){const e=Qd(this.options,"shadow"),n=Kc(t.map((t=>this.context.element.getElement(t).getBounds()))),[i,r]=n.min;this.shadowOrigin=[i,r];const[a,o]=Xc(n),s={width:a,height:o,x:i,y:r};this.shadow?this.shadow.attr(Object.assign(Object.assign(Object.assign({},e),s),{visibility:"visible"})):(this.shadow=new Il({style:Object.assign(Object.assign(Object.assign({$layer:"transient"},e),s),{pointerEvents:"none"})}),this.context.canvas.appendChild(this.shadow))}showEdges(){this.options.shadow||0===this.hiddenEdges.length||(this.context.graph.showElement(this.hiddenEdges),this.hiddenEdges=[])}hideEdge(){const{hideEdge:t,shadow:e}=this.options;if("none"===t||e)return;const{graph:n}=this.context;this.hiddenEdges="all"===t?n.getEdgeData().map(kh):Array.from(new Set(this.target.map((e=>n.getRelatedEdgesData(e,t).map(kh))).flat())),n.hideElement(this.hiddenEdges)}unbindEvents(){const{graph:t,canvas:e}=this.context,n=e.getLayer().getContextService().$canvas;n&&(n.removeEventListener("blur",this.onDragEnd),n.removeEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach((e=>{t.off(`${e}:${uc.DRAG_START}`,this.onDragStart),t.off(`${e}:${uc.DRAG}`,this.onDrag),t.off(`${e}:${uc.DRAG_END}`,this.onDragEnd),t.off(`${e}:${uc.POINTER_ENTER}`,this.setCursor),t.off(`${e}:${uc.POINTER_LEAVE}`,this.setCursor)})),t.off(`combo:${uc.DROP}`,this.onDrop),t.off(`canvas:${uc.DROP}`,this.onDrop)}destroy(){var t;this.unbindEvents(),null===(t=this.shadow)||void 0===t||t.destroy(),super.destroy()}}km.defaultOptions={animation:!0,enable:t=>["node","combo"].includes(t.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 Im=n(56354);class Bm{constructor(t,e){this.context=t,this.options=e||{}}}var Fm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},zm=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function Gm(t){const{nodes:e,edges:n}=t,i={nodes:[],edges:[],combos:[]};return e.forEach((t=>{const e=t.data._isCombo?i.combos:i.nodes,{x:n,y:r,z:a=0}=t.data;null==e||e.push({id:t.id,style:{x:n,y:r,z:a}})})),n.forEach((t=>{const{id:e,source:n,target:r,data:{points:a=[],controlPoints:o=a.slice(1,a.length-1)}}=t;i.edges.push({id:e,source:n,target:r,style:Object.assign({},(null==o?void 0:o.length)?{controlPoints:o.map(_d)}:{})})})),i}function jm(t,e,...n){if(e in t)return t[e](...n);if("instance"in t){const i=t.instance;if(e in i)return i[e](...n)}return null}function Um(t,e){if(e in t)return t[e];if("instance"in t){const n=t.instance;if(e in n)return n[e]}return null}var Hm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};var Vm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Zm extends Kh{constructor(t,e){super(t,Object.assign({},Zm.defaultOptions,e)),this.isZoomEvent=t=>Boolean(t.data&&"scale"in t.data),this.relatedEdgeToUpdate=new Set,this.zoom=this.context.graph.getZoom(),this.fixElementSize=t=>Vm(this,void 0,void 0,(function*(){if(!this.validate(t))return;const{graph:e}=this.context,{state:n,nodeFilter:i,edgeFilter:r,comboFilter:a}=this.options,o=(n?e.getElementDataByState("node",n):e.getNodeData()).filter(i),s=(n?e.getElementDataByState("edge",n):e.getEdgeData()).filter(r),l=(n?e.getElementDataByState("combo",n):e.getComboData()).filter(a),u=this.isZoomEvent(t)?this.zoom=Math.max(.01,Math.min(t.data.scale,10)):this.zoom,c=[...o,...l];c.length>0&&c.forEach((t=>this.fixNodeLike(t,u))),this.updateRelatedEdges(),s.length>0&&s.forEach((t=>this.fixEdge(t,u)))})),this.cachedStyles=new Map,this.getOriginalFieldValue=(t,e,n)=>{var i;const r=this.cachedStyles.get(t)||[],a=(null===(i=r.find((t=>t.shape===e)))||void 0===i?void 0:i.style)||{};return n in a||(a[n]=e.attributes[n],this.cachedStyles.set(t,[...r.filter((t=>t.shape!==e)),{shape:e,style:a}])),a[n]},this.scaleEntireElement=(t,e,n)=>{e.setLocalScale(1/n);const i=this.cachedStyles.get(t)||[];i.push({shape:e}),this.cachedStyles.set(t,i)},this.scaleSpecificShapes=(t,e,n)=>{const i=function(t){const e=[],n=t=>{(null==t?void 0:t.children.length)&&t.children.forEach((t=>{e.push(t),n(t)}))};return n(t),e}(t);(Array.isArray(n)?n:[n]).forEach((n=>{const{shape:r,fields:a}=n,o="function"==typeof r?r(i):t.getShape(r);o&&(a?a.forEach((n=>{const i=this.getOriginalFieldValue(t.id,o,n);(0,oe.Z)(i)&&(o.style[n]=i/e)})):this.scaleEntireElement(t.id,o,e))}))},this.skipIfExceedViewport=t=>{const{viewport:e}=this.context;return!(null==e?void 0:e.isInViewport(t.getRenderBounds(),!1,30))},this.fixNodeLike=(t,e)=>{const n=kh(t),{element:i,model:r}=this.context,a=i.getElement(n);if(!a||this.skipIfExceedViewport(a))return;r.getRelatedEdgesData(n).forEach((t=>this.relatedEdgeToUpdate.add(kh(t))));const o=this.options[a.type];o?this.scaleSpecificShapes(a,e,o):this.scaleEntireElement(n,a,e)},this.fixEdge=(t,e)=>{const n=kh(t),i=this.context.element.getElement(n);if(!i||this.skipIfExceedViewport(i))return;const r=this.options.edge;if(!r)return i.style.transformOrigin="center",void this.scaleEntireElement(n,i,e);this.scaleSpecificShapes(i,e,r)},this.updateRelatedEdges=()=>{const{element:t}=this.context;this.relatedEdgeToUpdate.size>0&&this.relatedEdgeToUpdate.forEach((e=>{const n=t.getElement(e);null==n||n.update({})})),this.relatedEdgeToUpdate.clear()},this.resetTransform=t=>Vm(this,void 0,void 0,(function*(){var e;(null===(e=t.data)||void 0===e?void 0:e.firstRender)||(this.options.reset?this.restoreCachedStyles():this.fixElementSize({data:{scale:this.zoom}}))})),this.bindEvents()}restoreCachedStyles(){if(this.cachedStyles.size>0){this.cachedStyles.forEach((t=>{t.forEach((({shape:t,style:e})=>{if(yf(e))t.setLocalScale(1);else{if(this.options.state)return;Object.entries(e).forEach((([e,n])=>t.style[e]=n))}}))}));const{graph:t,element:e}=this.context,n=Object.keys(Object.fromEntries(this.cachedStyles)).filter((e=>e&&"node"===t.getElementType(e)));if(n.length>0){const i=new Set;n.forEach((e=>{t.getRelatedEdgesData(e).forEach((t=>i.add(kh(t))))})),i.forEach((t=>{const n=null==e?void 0:e.getElement(t);null==n||n.update({})}))}}}bindEvents(){const{graph:t}=this.context;t.on(dc.AFTER_DRAW,this.resetTransform),t.on(dc.AFTER_TRANSFORM,this.fixElementSize)}unbindEvents(){const{graph:t}=this.context;t.off(dc.AFTER_DRAW,this.resetTransform),t.off(dc.AFTER_TRANSFORM,this.fixElementSize)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Zm.defaultOptions={enable:t=>t.data.scale<1,nodeFilter:()=>!0,edgeFilter:()=>!0,comboFilter:()=>!0,edge:[{shape:"key",fields:["lineWidth"]},{shape:"halo",fields:["lineWidth"]},{shape:"label"}],reset:!1};var Wm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Xm extends Kh{constructor(t,e){super(t,Object.assign({},Xm.defaultOptions,e)),this.focus=t=>Wm(this,void 0,void 0,(function*(){if(!this.validate(t))return;const{graph:e}=this.context;yield e.focusElement(t.target.id,this.options.animation)})),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Fd.forEach((e=>{t.on(`${e}:${uc.CLICK}`,this.focus)}))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Fd.forEach((e=>{t.off(`${e}:${uc.CLICK}`,this.focus)}))}destroy(){this.unbindEvents(),super.destroy()}}Xm.defaultOptions={animation:{easing:"ease-in",duration:500},enable:!0};class Ym extends Kh{constructor(t,e){super(t,Object.assign({},Ym.defaultOptions,e)),this.isFrozen=!1,this.toggleFrozen=t=>{this.isFrozen="dragstart"===t.type},this.hoverElement=t=>{if(!this.validate(t))return;const e=t.type===uc.POINTER_ENTER;this.updateElementsState(t,e);const{onHover:n,onHoverEnd:i}=this.options;e?null==n||n(t):null==i||i(t)},this.updateElementsState=(t,e)=>{if(!this.options.state&&!this.options.inactiveState)return;const{graph:n}=this.context,{state:i,animation:r,inactiveState:a}=this.options,o=this.getActiveIds(t),s={};if(i&&Object.assign(s,this.getElementsState(o,i,e)),a){const t=Bh(n.getData(),!0).filter((t=>!o.includes(t)));Object.assign(s,this.getElementsState(t,a,e))}n.setElementState(s,r)},this.getElementsState=(t,e,n)=>{const{graph:i}=this.context,r={};return t.forEach((t=>{const a=i.getElementState(t);r[t]=n?a.includes(e)?a:[...a,e]:a.filter((t=>t!==e))})),r},this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Fd.forEach((e=>{t.on(`${e}:${uc.POINTER_ENTER}`,this.hoverElement),t.on(`${e}:${uc.POINTER_LEAVE}`,this.hoverElement)}));const e=this.context.canvas.document;e.addEventListener(`${uc.DRAG_START}`,this.toggleFrozen),e.addEventListener(`${uc.DRAG_END}`,this.toggleFrozen)}getActiveIds(t){const{graph:e}=this.context,{degree:n,direction:i}=this.options,r=t.target.id;return n?Gd(e,t.targetType,r,"function"==typeof n?n(t):n,i):[r]}validate(t){if(this.destroyed||this.isFrozen||Tm(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Fd.forEach((e=>{t.off(`${e}:${uc.POINTER_ENTER}`,this.hoverElement),t.off(`${e}:${uc.POINTER_LEAVE}`,this.hoverElement)}));const e=this.context.canvas.document;e.removeEventListener(`${uc.DRAG_START}`,this.toggleFrozen),e.removeEventListener(`${uc.DRAG_END}`,this.toggleFrozen)}destroy(){this.unbindEvents(),super.destroy()}}Ym.defaultOptions={animation:!1,enable:!0,degree:0,direction:"both",state:"active",inactiveState:void 0};class qm extends Kh{constructor(t,e){super(t,Object.assign({},qm.defaultOptions,e)),this.hiddenShapes=[],this.isVisible=!0,this.setElementsVisibility=(t,e,n)=>{t.filter(Boolean).forEach((t=>{"hidden"!==e||t.isVisible()?"visible"===e&&this.hiddenShapes.includes(t)?this.hiddenShapes.splice(this.hiddenShapes.indexOf(t),1):Yh(t,e,!1,n):this.hiddenShapes.push(t)}))},this.filterShapes=(t,e)=>{if((0,en.Z)(e))return n=>!e(t,n);const n=null==e?void 0:e[t];return t=>!t.className||!(null==n?void 0:n.includes(t.className))},this.hideShapes=t=>{if(!this.validate(t)||!this.isVisible)return;const{element:e}=this.context,{shapes:n={}}=this.options;this.setElementsVisibility(e.getNodes(),"hidden",this.filterShapes("node",n)),this.setElementsVisibility(e.getEdges(),"hidden",this.filterShapes("edge",n)),this.setElementsVisibility(e.getCombos(),"hidden",this.filterShapes("combo",n)),this.isVisible=!1},this.showShapes=Pm((t=>{if(!this.validate(t)||this.isVisible)return;const{element:e}=this.context;this.setElementsVisibility(e.getNodes(),"visible"),this.setElementsVisibility(e.getEdges(),"visible"),this.setElementsVisibility(e.getCombos(),"visible"),this.isVisible=!0}),this.options.debounce),this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(dc.BEFORE_TRANSFORM,this.hideShapes),t.on(dc.AFTER_TRANSFORM,this.showShapes)}unbindEvents(){const{graph:t}=this.context;t.off(dc.BEFORE_TRANSFORM,this.hideShapes),t.off(dc.AFTER_TRANSFORM,this.showShapes)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}qm.defaultOptions={enable:!0,debounce:200,shapes:t=>"node"===t};var $m=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Km extends Kh{constructor(t,e){super(t,Object.assign({},Km.defaultOptions,e)),this.onWheel=t=>$m(this,void 0,void 0,(function*(){this.options.preventDefault&&t.preventDefault();const e=t.deltaX,n=t.deltaY;yield this.scroll([-e,-n],t)})),this.shortcut=new Dd(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){var t,e;const{trigger:n}=this.options;if(this.shortcut.unbindAll(),(0,nn.Z)(n)){null===(t=this.graphDom)||void 0===t||t.removeEventListener(uc.WHEEL,this.onWheel);const{up:e=[],down:i=[],left:r=[],right:a=[]}=n;this.shortcut.bind(e,(t=>this.scroll([0,-10],t))),this.shortcut.bind(i,(t=>this.scroll([0,10],t))),this.shortcut.bind(r,(t=>this.scroll([-10,0],t))),this.shortcut.bind(a,(t=>this.scroll([10,0],t)))}else null===(e=this.graphDom)||void 0===e||e.addEventListener(uc.WHEEL,this.onWheel,{passive:!1})}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}formatDisplacement(t){const{sensitivity:e}=this.options;return t=id(t,e),t=this.clampByDirection(t),t=this.clampByRange(t)}clampByDirection([t,e]){const{direction:n}=this.options;return"x"===n?e=0:"y"===n&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:n,canvas:i}=this.context,[r,a]=i.getSize(),[o,s,l,u]=Hc(this.options.range),c=[a*o,r*s,a*l,r*u],h=$c(qc(n.getCanvasCenter()),c),d=nd(n.getViewportCenter(),[t,e,0]);if(!Qc(d,h)){const{min:[n,i],max:[r,a]}=h;(d[0]<n&&t>0||d[0]>r&&t<0)&&(t=0),(d[1]<i&&e>0||d[1]>a&&e<0)&&(e=0)}return[t,e]}scroll(t,e){return $m(this,void 0,void 0,(function*(){if(!this.validate(e))return;const{onFinish:n}=this.options,i=this.context.graph,r=this.formatDisplacement(t);yield i.translateBy(r,!1),null==n||n()}))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),null===(t=this.graphDom)||void 0===t||t.removeEventListener(uc.WHEEL,this.onWheel),super.destroy()}}Km.defaultOptions={enable:!0,sensitivity:1,preventDefault:!0,range:1/0};var Qm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Jm extends Kh{constructor(t,e){super(t,Object.assign({},Jm.defaultOptions,e)),this.zoom=(t,e,n)=>Qm(this,void 0,void 0,(function*(){if(!this.validate(e))return;const{graph:i}=this.context;let r;"viewport"in e&&(r=_d(e.viewport));const{sensitivity:a,onFinish:o}=this.options,s=1+ce(t,-50,50)*a/100,l=i.getZoom();yield i.zoomTo(l*s,n,r),null==o||o()})),this.onReset=()=>Qm(this,void 0,void 0,(function*(){yield this.context.graph.zoomTo(1,this.options.animation)})),this.preventDefault=t=>{this.options.preventDefault&&t.preventDefault()},this.shortcut=new Dd(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){var t;const{trigger:e}=this.options;if(this.shortcut.unbindAll(),Array.isArray(e)&&(null===(t=this.context.canvas.getContainer())||void 0===t||t.addEventListener(uc.WHEEL,this.preventDefault),this.shortcut.bind([...e,uc.WHEEL],(t=>{const{deltaX:e,deltaY:n}=t;this.zoom(-(null!=n?n:e),t,!1)}))),"object"==typeof e){const{zoomIn:t=[],zoomOut:n=[],reset:i=[]}=e;this.shortcut.bind(t,(t=>this.zoom(10,t,this.options.animation))),this.shortcut.bind(n,(t=>this.zoom(-10,t,this.options.animation))),this.shortcut.bind(i,this.onReset)}}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),null===(t=this.context.canvas.getContainer())||void 0===t||t.removeEventListener(uc.WHEEL,this.preventDefault),super.destroy()}}Jm.defaultOptions={animation:{duration:200},enable:!0,sensitivity:1,trigger:[],preventDefault:!0};var tv=n(13722),ev=n(7499),nv=n(64589),iv=n(70709),rv=n(73510),av=n(31392),ov=n(14742),sv=n(71636),lv=n(93712),uv=n(79189),cv=n(93786),hv=n(8421),dv=n(16589),fv=n(61649);function pv(t){var e,n,i,r=t||1;function a(t,a){++e>r&&(i=n,o(1),++e),n[t]=a}function o(t){e=0,n=Object.create(null),t||(i=Object.create(null))}return o(),{clear:o,has:function(t){return void 0!==n[t]||void 0!==i[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=i[t])?(a(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:a(t,e)}}}var gv=new Map;function mv(t,e,n){void 0===n&&(n=128);return function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];var a=e?e.apply(this,i):i[0];gv.has(t)||gv.set(t,pv(n));var o=gv.get(t);if(o.has(a))return o.get(a);var s=t.apply(this,i);return o.set(a,s),s}}var vv=n(99682),yv=n(38586),xv=function(t,e,n){if(!(0,Fe.Z)(t)&&!(0,yv.Z)(t))return t;var i=n;return(0,vv.Z)(t,(function(t,n){i=e(i,t,n)})),i},bv=function(t,e){return xv(t,(function(t,n,i){return e.includes(i)||(t[i]=n),t}),{})};class _v extends $h{}function Ev(t,e=!0,n){const i=document.createElement("div");return i.setAttribute("class",`g6-${t}`),Object.assign(i.style,{position:"absolute",display:"block"}),e&&Object.assign(i.style,{position:"unset",gridArea:"1 / 1 / 2 / 2",inset:"0px",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none"}),n&&Object.assign(i.style,n),i}function wv(t,e="div",n={},i="",r=document.body){const a=document.getElementById(t);a&&a.remove();const o=document.createElement(e);return o.innerHTML=i,o.id=t,Object.assign(o.style,n),r.appendChild(o),o}var Tv,Sv,Mv=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Cv extends _v{constructor(t,e){super(t,Object.assign({},Cv.defaultOptions,e)),this.$element=Ev("background");this.context.canvas.getContainer().prepend(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return Mv(this,void 0,void 0,(function*(){e.update.call(this,t),Object.assign(this.$element.style,bv(this.options,["key","type"]))}))}destroy(){super.destroy(),this.$element.remove()}}function Av(t,e,n,i,r,a){const o=n-t,s=i-e;let l=r-t,u=a-e,c=l*o+u*s,h=0;c<=0?h=0:(l=o-l,u=s-u,c=l*o+u*s,h=c<=0?0:c*c/(o*o+s*s));const d=l*l+u*u-h;return d<0?0:d}function Ov(t,e,n,i){return(t-n)*(t-n)+(e-i)*(e-i)}function Nv(t,e,n,i,r){return Ov(t,e,n,i)<r*r}function Pv(t){const e=Math.min(t.x1,t.x2),n=Math.max(t.x1,t.x2),i=Math.min(t.y1,t.y2),r=Math.max(t.y1,t.y2);return{x:e,y:i,x2:n,y2:r,width:n-e,height:r-i}}Cv.defaultOptions={transition:"background 0.5s",backgroundSize:"cover"};class Lv{constructor(t,e,n,i){this.x1=t,this.y1=e,this.x2=n,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 Lv(t.x1,t.y1,t.x2,t.y2)}cuts(t,e){if(this.y1===this.y2)return!1;if(e<this.y1&&e<=this.y2||e>this.y1&&e>=this.y2)return!1;if(t>this.x1&&t>=this.x2)return!1;if(t<this.x1&&t<=this.x2)return!0;return t<=this.x1+(e-this.y1)*(this.x2-this.x1)/(this.y2-this.y1)}distSquare(t,e){return Av(this.x1,this.y1,this.x2,this.y2,t,e)}ptClose(t,e,n){if(this.x1<this.x2){if(t<this.x1-n||t>this.x2+n)return!1}else if(t<this.x2-n||t>this.x1+n)return!1;if(this.y1<this.y2){if(e<this.y1-n||e>this.y2+n)return!1}else if(e<this.y2-n||e>this.y1+n)return!1;return!0}}!function(t){t[t.POINT=1]="POINT",t[t.PARALLEL=2]="PARALLEL",t[t.COINCIDENT=3]="COINCIDENT",t[t.NONE=4]="NONE"}(Tv||(Tv={}));class Rv{constructor(t,e=0,n=0){this.state=t,this.x=e,this.y=n}}function Dv(t,e){const n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),i=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),r=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(r){const e=n/r,a=i/r;return 0<=e&&e<=1&&0<=a&&a<=1?new Rv(Tv.POINT,t.x1+e*(t.x2-t.x1),t.y1+e*(t.y2-t.y1)):new Rv(Tv.NONE)}return new Rv(0===n||0===i?Tv.COINCIDENT:Tv.PARALLEL)}function kv(t,e){const n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),i=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),r=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(r){const t=n/r,e=i/r;if(0<=t&&t<=1&&0<=e&&e<=1)return t}return Number.POSITIVE_INFINITY}function Iv(t,e,n){const i=new Set;return t.width<=0?(i.add(Sv.LEFT),i.add(Sv.RIGHT)):e<t.x?i.add(Sv.LEFT):e>t.x+t.width&&i.add(Sv.RIGHT),t.height<=0?(i.add(Sv.TOP),i.add(Sv.BOTTOM)):n<t.y?i.add(Sv.TOP):n>t.y+t.height&&i.add(Sv.BOTTOM),i}function Bv(t,e){let n=e.x1,i=e.y1;const r=e.x2,a=e.y2,o=Array.from(Iv(t,r,a));if(0===o.length)return!0;let s=Iv(t,n,i);for(;0!==s.size;){for(const t of o)if(s.has(t))return!1;if(s.has(Sv.RIGHT)||s.has(Sv.LEFT)){let e=t.x;s.has(Sv.RIGHT)&&(e+=t.width),i+=(e-n)*(a-i)/(r-n),n=e}else{let e=t.y;s.has(Sv.BOTTOM)&&(e+=t.height),n+=(e-i)*(r-n)/(a-i),i=e}s=Iv(t,n,i)}return!0}function Fv(t,e){let n=Number.POSITIVE_INFINITY,i=0;function r(t,r,a,o){let s=kv(e,new Lv(t,r,a,o));s=Math.abs(s-.5),s>=0&&s<=1&&(i++,s<n&&(n=s))}return r(t.x,t.y,t.x2,t.y),r(t.x,t.y,t.x,t.y2),i>1?n:(r(t.x,t.y2,t.x2,t.y2),i>1?n:(r(t.x2,t.y,t.x2,t.y2),0===i?-1:n))}function zv(t,e){let n=0;const i=Dv(t,new Lv(e.x,e.y,e.x2,e.y));n+=i.state===Tv.POINT?1:0;const r=Dv(t,new Lv(e.x,e.y,e.x,e.y2));n+=r.state===Tv.POINT?1:0;const a=Dv(t,new Lv(e.x,e.y2,e.x2,e.y2));n+=a.state===Tv.POINT?1:0;const o=Dv(t,new Lv(e.x2,e.y,e.x2,e.y2));return n+=o.state===Tv.POINT?1:0,{top:i,left:r,bottom:a,right:o,count:n}}!function(t){t[t.LEFT=0]="LEFT",t[t.TOP=1]="TOP",t[t.RIGHT=2]="RIGHT",t[t.BOTTOM=3]="BOTTOM"}(Sv||(Sv={}));class Gv{constructor(t,e,n,i){this.x=t,this.y=e,this.width=n,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 Gv(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 Gv(this.x,this.y,this.width,this.height)}add(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x2,t.x+t.width),r=Math.max(this.y2,t.y+t.height);this.x=e,this.y=n,this.width=i-e,this.height=r-n}addPoint(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x2,t.x),r=Math.max(this.y2,t.y);this.x=e,this.y=n,this.width=i-e,this.height=r-n}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)&&(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 n=Iv(this,t,e);return n.has(Sv.TOP)?n.has(Sv.LEFT)?Ov(t,e,this.x,this.y):n.has(Sv.RIGHT)?Ov(t,e,this.x2,this.y):(this.y-e)*(this.y-e):n.has(Sv.BOTTOM)?n.has(Sv.LEFT)?Ov(t,e,this.x,this.y2):n.has(Sv.RIGHT)?Ov(t,e,this.x2,this.y2):(e-this.y2)*(e-this.y2):n.has(Sv.LEFT)?(this.x-t)*(this.x-t):n.has(Sv.RIGHT)?(t-this.x2)*(t-this.x2):0}}class jv{constructor(t,e,n){this.cx=t,this.cy=e,this.radius=n}get x(){return this.cx-this.radius}get x2(){return this.cx+this.radius}get width(){return 2*this.radius}get y(){return this.cy-this.radius}get y2(){return this.cy+this.radius}get height(){return 2*this.radius}static from(t){return new jv(t.cx,t.cy,t.radius)}containsPt(t,e){return Ov(this.cx,this.cy,t,e)<this.radius*this.radius}distSquare(t,e){const n=Ov(this.cx,this.cy,t,e);if(n<this.radius*this.radius)return 0;const i=Math.sqrt(n)-this.radius;return i*i}draw(t){t.ellipse(this.cx,this.cy,this.radius,this.radius,0,0,2*Math.PI)}}class Uv{constructor(t,e=0,n=0,i=0,r=0,a=10,o=10,s=new Float32Array(Math.max(0,a*o)).fill(0)){this.pixelGroup=t,this.i=e,this.j=n,this.pixelX=i,this.pixelY=r,this.width=a,this.height=o,this.area=s}createSub(t,e){return new Uv(this.pixelGroup,t.x,t.y,e.x,e.y,t.width,t.height)}static fromPixelRegion(t,e){return new Uv(e,0,0,t.x,t.y,Math.ceil(t.width/e),Math.ceil(t.height/e))}copy(t,e){return new Uv(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),n=this.scaleY(t.y),i=this.boundX(Math.ceil((t.x+t.width-this.pixelX)/this.pixelGroup)),r=this.boundY(Math.ceil((t.y+t.height-this.pixelY)/this.pixelGroup));return new Gv(e,n,i-e,r-n)}invertScaleX(t){return Math.round(t*this.pixelGroup+this.pixelX)}invertScaleY(t){return Math.round(t*this.pixelGroup+this.pixelY)}addPadding(t,e){const n=Math.ceil(e/this.pixelGroup),i=this.boundX(t.x-n),r=this.boundY(t.y-n),a=this.boundX(t.x2+n),o=this.boundY(t.y2+n);return new Gv(i,r,a-i,o-r)}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,n){t<0||e<0||t>=this.width||e>=this.height||(this.area[t+e*this.width]+=n)}set(t,e,n){t<0||e<0||t>=this.width||e>=this.height||(this.area[t+e*this.width]=n)}incArea(t,e){if(t.width<=0||t.height<=0||0===e)return;const n=this.width,i=t.width,r=Math.max(0,t.i),a=Math.max(0,t.j),o=Math.min(t.i+t.width,n),s=Math.min(t.j+t.height,this.height);if(!(s<=0||o<=0||r>=n||s>=this.height))for(let l=a;l<s;l++){const a=(l-t.j)*i,s=l*n;for(let n=r;n<o;n++){const i=t.area[n-t.i+a];0!==i&&(this.area[n+s]+=e*i)}}}fill(t){this.area.fill(t)}fillArea(t,e){const n=t.x+t.y*this.width;for(let i=0;i<t.height;i++){const r=n+i*this.width;this.area.fill(e,r,r+t.width)}}fillHorizontalLine(t,e,n,i){const r=t+e*this.width;this.area.fill(i,r,r+n)}fillVerticalLine(t,e,n,i){const r=t+e*this.width;for(let t=0;t<n;t++)this.area[r+t*this.width]=i}clear(){this.area.fill(0)}toString(){let t="";for(let e=0;e<this.height;e++){const n=e*this.width;for(let e=0;e<this.width;e++){t+=this.area[n+e].toFixed(1).padStart(6),t+=" "}t+="\n"}return t}draw(t,e=!0){if(this.width<=0||this.height<=0)return;t.save(),e&&t.translate(this.pixelX,this.pixelY);const n=this.area.reduce(((t,e)=>Math.min(t,e)),Number.POSITIVE_INFINITY),i=this.area.reduce(((t,e)=>Math.max(t,e)),Number.NEGATIVE_INFINITY),r=t=>(t-n)/(i-n);t.scale(this.pixelGroup,this.pixelGroup);for(let e=0;e<this.width;e++)for(let n=0;n<this.height;n++){const i=this.area[e+n*this.width];t.fillStyle=`rgba(0, 0, 0, ${r(i)})`,t.fillRect(e,n,1,1)}t.restore()}drawThreshold(t,e,n=!0){if(!(this.width<=0||this.height<=0)){t.save(),n&&t.translate(this.pixelX,this.pixelY),t.scale(this.pixelGroup,this.pixelGroup);for(let n=0;n<this.width;n++)for(let i=0;i<this.height;i++){const r=this.area[n+i*this.width];t.fillStyle=r>e?"black":"white",t.fillRect(n,i,1,1)}t.restore()}}}function Hv(t,e){const n=t=>({x:t.x-e,y:t.y-e,width:t.width+2*e,height:t.height+2*e});return Array.isArray(t)?t.map(n):n(t)}function Vv(t,e,n){return Zv(Object.assign(Pv(t),{distSquare:(e,n)=>Av(t.x1,t.y1,t.x2,t.y2,e,n)}),e,n)}function Zv(t,e,n){const i=Hv(t,n),r=e.scale(i),a=e.createSub(r,i);return function(t,e,n,i){const r=n*n;for(let a=0;a<t.height;a++)for(let o=0;o<t.width;o++){const s=i(e.invertScaleX(t.i+o),e.invertScaleY(t.j+a));if(0!==s){if(s<r){const e=n-Math.sqrt(s);t.set(o,a,e*e)}}else t.set(o,a,r)}}(a,e,n,((e,n)=>t.distSquare(e,n))),a}function Wv(t,e){return{x:t,y:e}}function Xv(t,e,n,i){if(0===t.length)return[];const r=function(t){if(t.length<2)return t;let e=0,n=0;return t.forEach((t=>{e+=t.cx,n+=t.cy})),e/=t.length,n/=t.length,t.map((t=>{const i=e-t.cx,r=n-t.cy;return[t,i*i+r*r]})).sort(((t,e)=>t[1]-e[1])).map((t=>t[0]))}(t);return r.map(((t,a)=>{const o=r.slice(0,a);return function(t,e,n,i,r){const a=Wv(e.cx,e.cy),o=function(t,e,n){let i=Number.POSITIVE_INFINITY;return e.reduce(((e,r)=>{const a=Ov(t.x,t.y,r.cx,r.cy);if(a>i)return e;const o=new Lv(t.x,t.y,r.cx,r.cy),s=function(t,e){return t.reduce(((t,n)=>Bv(n,e)&&function(t,e){function n(t,n,i,r){let a=kv(e,new Lv(t,n,i,r));return a=Math.abs(a-.5),a>=0&&a<=1?1:0}let i=n(t.x,t.y,t.x2,t.y);return i+=n(t.x,t.y,t.x,t.y2),i>1||(i+=n(t.x,t.y2,t.x2,t.y2),i>1||(i+=n(t.x2,t.y,t.x2,t.y2),i>0))}(n,e)?t+1:t),0)}(n,o);return a*(s+1)*(s+1)<i&&(e=r,i=a*(s+1)*(s+1)),e}),null)}(a,n,t);if(null==o)return[];const s=function(t,e,n,i){const r=[],a=[];a.push(t);let o=!0;for(let t=0;t<n&&o;t++)for(o=!1;!o&&a.length>0;){const t=a.pop(),n=$v(e,t),s=n?zv(t,n):null;if(!n||!s||2!==s.count){o||r.push(t);continue}let l=i,u=Kv(n,l,s,!0),c=qv(u,a)||qv(u,r),h=Yv(u,e);for(;!c&&h&&l>=1;)l/=1.5,u=Kv(n,l,s,!0),c=qv(u,a)||qv(u,r),h=Yv(u,e);if(!u||c||h||(a.push(new Lv(t.x1,t.y1,u.x,u.y)),a.push(new Lv(u.x,u.y,t.x2,t.y2)),o=!0),o)continue;l=i,u=Kv(n,l,s,!1);let d=qv(u,a)||qv(u,r);for(h=Yv(u,e);!d&&h&&l>=1;)l/=1.5,u=Kv(n,l,s,!1),d=qv(u,a)||qv(u,r),h=Yv(u,e);u&&!d&&(a.push(new Lv(t.x1,t.y1,u.x,u.y)),a.push(new Lv(u.x,u.y,t.x2,t.y2)),o=!0),o||r.push(t)}for(;a.length>0;)r.push(a.pop());return r}(new Lv(a.x,a.y,o.cx,o.cy),t,i,r);return function(t,e){const n=[];for(;t.length>0;){const i=t.pop();if(0===t.length){n.push(i);break}const r=t.pop(),a=new Lv(i.x1,i.y1,r.x2,r.y2);$v(e,a)?(n.push(i),t.push(r)):t.push(a)}return n}(s,t)}(e,t,o,n,i)})).flat()}function Yv(t,e){return e.some((e=>e.containsPt(t.x,t.y)))}function qv(t,e){return e.some((e=>!!Nv(e.x1,e.y1,t.x,t.y,.001)||!!Nv(e.x2,e.y2,t.x,t.y,.001)))}function $v(t,e){let n=Number.POSITIVE_INFINITY,i=null;for(const r of t){if(!Bv(r,e))continue;const t=Fv(r,e);t>=0&&t<n&&(i=r,n=t)}return i}function Kv(t,e,n,i){const r=n.top,a=n.left,o=n.bottom,s=n.right;if(i){if(a.state===Tv.POINT){if(r.state===Tv.POINT)return Wv(t.x-e,t.y-e);if(o.state===Tv.POINT)return Wv(t.x-e,t.y2+e);const n=t.width*t.height;return t.width*(.5*(a.y-t.y+(s.y-t.y)))<.5*n?a.y>s.y?Wv(t.x-e,t.y-e):Wv(t.x2+e,t.y-e):a.y<s.y?Wv(t.x-e,t.y2+e):Wv(t.x2+e,t.y2+e)}if(s.state===Tv.POINT){if(r.state===Tv.POINT)return Wv(t.x2+e,t.y-e);if(o.state===Tv.POINT)return Wv(t.x2+e,t.y2+e)}const n=t.height*t.width;return t.height*(.5*(r.x-t.x+(s.x-t.x)))<.5*n?r.x>o.x?Wv(t.x-e,t.y-e):Wv(t.x-e,t.y2+e):r.x<o.x?Wv(t.x2+e,t.y-e):Wv(t.x2+e,t.y2+e)}if(a.state===Tv.POINT){if(r.state===Tv.POINT)return Wv(t.x2+e,t.y2+e);if(o.state===Tv.POINT)return Wv(t.x2+e,t.y-e);const n=t.height*t.width;return t.width*(.5*(a.y-t.y+(s.y-t.y)))<.5*n?a.y>s.y?Wv(t.x2+e,t.y2+e):Wv(t.x-e,t.y2+e):a.y<s.y?Wv(t.x2+e,t.y-e):Wv(t.x-e,t.y-e)}if(s.state===Tv.POINT){if(r.state===Tv.POINT)return Wv(t.x-e,t.y2+e);if(o.state===Tv.POINT)return Wv(t.x-e,t.y-e)}const l=t.height*t.width;return t.height*(.5*(r.x-t.x+(s.x-t.x)))<.5*l?r.x>o.x?Wv(t.x2+e,t.y2+e):Wv(t.x2+e,t.y-e):r.x<o.x?Wv(t.x-e,t.y2+e):Wv(t.x-e,t.y-e)}function Qv(t,e,n,i){if(!(t.closed?n<t.length:n<t.length-1))return!1;const r=t.get(e),a=t.get(n+1);for(let o=e+1;o<=n;o++){const e=t.get(o);if(Av(r.x,r.y,a.x,a.y,e.x,e.y)>i)return!1}return!0}function Jv(t,e){switch(t){case-2:return(((3-e)*e-3)*e+1)/6;case-1:return((3*e-6)*e*e+4)/6;case 0:return(((-3*e+3)*e+3)*e+1)/6;case 1:return e*e*e/6;default:throw new Error("unknown error")}}class ty{constructor(t=[],e=!0){this.points=t,this.closed=e}get(t){const e=t,n=this.points.length;return t<0?this.closed?this.get(t+n):this.points[0]:t>=n?this.closed?this.get(t-n):this.points[n-1]:this.points[e]}get length(){return this.points.length}toString(t=1/0){const e=this.points;if(0===e.length)return"";const n="function"==typeof t?t:function(t){if(!Number.isFinite(t))return t=>t;if(0===t)return Math.round;const e=Math.pow(10,t);return t=>Math.round(t*e)/e}(t);let i="M";for(const t of e)i+=`${n(t.x)},${n(t.y)} L`;return i=i.slice(0,-1),this.closed&&(i+=" Z"),i}draw(t){const e=this.points;if(0!==e.length){t.beginPath(),t.moveTo(e[0].x,e[0].y);for(const n of e)t.lineTo(n.x,n.y);this.closed&&t.closePath()}}sample(t){return function(t=8){return e=>{let n=t,i=e.length;if(n>1)for(i=Math.floor(e.length/n);i<3&&n>1;)n-=1,i=Math.floor(e.length/n);const r=[];for(let t=0,a=0;a<i;a++,t+=n)r.push(e.get(t));return new ty(r)}}(t)(this)}simplify(t){return function(t=0){return e=>{if(t<0||e.length<3)return e;const n=[];let i=0;const r=t*t;for(;i<e.length;){let t=i+1;for(;Qv(e,i,t,r);)t++;n.push(e.get(i)),i=t}return new ty(n)}}(t)(this)}bSplines(t){return function(t=6){function e(t,e,n){let i=0,r=0;for(let a=-2;a<=1;a++){const o=t.get(e+a),s=Jv(a,n);i+=s*o.x,r+=s*o.y}return{x:i,y:r}}return n=>{if(n.length<3)return n;const i=[],r=n.closed,a=n.length+3-1+(r?0:2);i.push(e(n,2-(r?0:2),0));for(let o=2-(r?0:2);o<a;o++)for(let r=1;r<=t;r++)i.push(e(n,o,r/t));return new ty(i)}}(t)(this)}apply(t){return t(this)}containsElements(t){const e=function(t){if(0===t.length)return null;const e=t[0],n=new Gv(e.x,e.y,0,0);for(const e of t)n.addPoint(e);return n}(this.points);return!!e&&t.every((t=>e.containsPt(t.cx,t.cy)&&this.withinArea(t.cx,t.cy)))}withinArea(t,e){if(0===this.length)return!1;let n=0;const i=this.points[0],r=new Lv(i.x,i.y,i.x,i.y);for(let i=1;i<this.points.length;i++){const a=this.points[i];r.x1=r.x2,r.y1=r.y2,r.x2=a.x,r.y2=a.y,r.cuts(t,e)&&n++}return r.x1=r.x2,r.y1=r.y2,r.x2=i.x,r.y2=i.y,r.cuts(t,e)&&n++,n%2==1}}class ey{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(0===this.count)return!1;const e=this.arr[0];return null!=e&&e.x===t.x&&e.y===t.y}path(){return new ty(this.arr.slice(0,this.count))}clear(){this.set.clear(),this.count=0}get(t){return this.arr[t]}get length(){return this.count}}function ny(t,e){const n=2*(Math.floor(t.width)+Math.floor(t.height)),i=new ey(n);function r(n,i,r,a){const o=t.get(n,i);return Number.isNaN(o)?Number.NaN:o>e?r+a:r}function a(t,e){let n=0;return n=r(t,e,n,1),n=r(t+1,e,n,2),n=r(t,e+1,n,4),n=r(t+1,e+1,n,8),Number.isNaN(n)?-1:n}let o=1;function s(e,n){let r=e,s=n,l=t.invertScaleX(r),u=t.invertScaleY(s);for(let e=0;e<t.width*t.height;e++){const e={x:l,y:u};if(i.contains(e)){if(i.isFirst(e))return!0}else i.add(e);const n=a(r,s);switch(n){case-1:return!0;case 0:case 3:case 2:case 7:o=2;break;case 12:case 14:case 4:o=3;break;case 6:o=0===o?3:2;break;case 1:case 13:case 5:o=0;break;case 9:o=2===o?0:1;break;case 10:case 8:case 11:o=1;break;default:return console.warn("Marching squares invalid state: "+n),!0}switch(o){case 0:s--,u-=t.pixelGroup;break;case 1:s++,u+=t.pixelGroup;break;case 3:r--,l-=t.pixelGroup;break;case 2:r++,l+=t.pixelGroup;break;default:return console.warn("Marching squares invalid state: "+n),!0}}return!0}for(let n=0;n<t.width;n++)for(let r=0;r<t.height;r++){if(t.get(n,r)<=e)continue;const o=a(n,r);if(!(o<0||15===o)&&s(n,r))return i.path()}return null}const iy={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 ry(t){return null!=t&&"number"==typeof t.radius}function ay(t,e){if(ry(t)!==ry(e))return!1;if(ry(t)){const n=e;return t.cx===n.cx&&t.cy===n.cy&&t.radius===n.radius}const n=e;return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}var oy;!function(t){t[t.MEMBERS=0]="MEMBERS",t[t.NON_MEMBERS=1]="NON_MEMBERS",t[t.EDGES=2]="EDGES"}(oy||(oy={}));class sy{constructor(t={}){this.dirty=new Set,this.members=[],this.nonMembers=[],this.virtualEdges=[],this.edges=[],this.activeRegion=new Gv(0,0,0,0),this.potentialArea=new Uv(1,0,0,0,0,0,0),this.o=Object.assign({},iy,t)}pushMember(...t){if(0!==t.length){this.dirty.add(oy.MEMBERS);for(const e of t)this.members.push({raw:e,obj:ry(e)?jv.from(e):Gv.from(e),area:null})}}removeMember(t){const e=this.members.findIndex((e=>ay(e.raw,t)));return!(e<0)&&(this.members.splice(e,1),this.dirty.add(oy.MEMBERS),!0)}removeNonMember(t){const e=this.nonMembers.findIndex((e=>ay(e.raw,t)));return!(e<0)&&(this.nonMembers.splice(e,1),this.dirty.add(oy.NON_MEMBERS),!0)}removeEdge(t){const e=this.edges.findIndex((e=>e.obj.equals(t)));return!(e<0)&&(this.edges.splice(e,1),this.dirty.add(oy.NON_MEMBERS),!0)}pushNonMember(...t){if(0!==t.length){this.dirty.add(oy.NON_MEMBERS);for(const e of t)this.nonMembers.push({raw:e,obj:ry(e)?jv.from(e):Gv.from(e),area:null})}}pushEdge(...t){if(0!==t.length){this.dirty.add(oy.EDGES);for(const e of t)this.edges.push({raw:e,obj:Lv.from(e),area:null})}}update(){const t=this.dirty.has(oy.MEMBERS),e=this.dirty.has(oy.NON_MEMBERS);let n=this.dirty.has(oy.EDGES);this.dirty.clear();const i=this.members.map((t=>t.obj));if(this.o.virtualEdges&&(t||e)){const t=Xv(i,this.nonMembers.map((t=>t.obj)),this.o.maxRoutingIterations,this.o.morphBuffer),e=new Map(this.virtualEdges.map((t=>[t.obj.toString(),t.area])));this.virtualEdges=t.map((t=>{var n;return{raw:t,obj:t,area:null!==(n=e.get(t.toString()))&&void 0!==n?n:null}})),n=!0}let r=!1;if(t||n){const t=function(t,e){if(0===t.length)return new Gv(0,0,0,0);const n=Gv.from(t[0]);for(const e of t)n.add(e);for(const t of e)n.add(Pv(t));return n}(i,this.virtualEdges.concat(this.edges).map((t=>t.obj))),e=Math.max(this.o.edgeR1,this.o.nodeR1)+this.o.morphBuffer,n=Gv.from(Hv(t,e));n.equals(this.activeRegion)||(r=!0,this.activeRegion=n)}if(r){const t=Math.ceil(this.activeRegion.width/this.o.pixelGroup),e=Math.ceil(this.activeRegion.height/this.o.pixelGroup);this.activeRegion.x!==this.potentialArea.pixelX||this.activeRegion.y!==this.potentialArea.pixelY?(this.potentialArea=Uv.fromPixelRegion(this.activeRegion,this.o.pixelGroup),this.members.forEach((t=>t.area=null)),this.nonMembers.forEach((t=>t.area=null)),this.edges.forEach((t=>t.area=null)),this.virtualEdges.forEach((t=>t.area=null))):t===this.potentialArea.width&&e===this.potentialArea.height||(this.potentialArea=Uv.fromPixelRegion(this.activeRegion,this.o.pixelGroup))}const a=new Map,o=t=>{if(t.area){const e=`${t.obj.width}x${t.obj.height}x${t.obj instanceof Gv?"R":"C"}`;a.set(e,t.area)}},s=t=>{if(t.area)return;const e=`${t.obj.width}x${t.obj.height}x${t.obj instanceof Gv?"R":"C"}`;if(a.has(e)){const n=a.get(e);return void(t.area=this.potentialArea.copy(n,{x:t.obj.x-this.o.nodeR1,y:t.obj.y-this.o.nodeR1}))}const n=t.obj instanceof Gv?function(t,e,n){const i=e.scale(t),r=e.addPadding(i,n),a=e.createSub(r,{x:t.x-n,y:t.y-n}),o=i.x-r.x,s=i.y-r.y,l=r.x2-i.x2,u=r.y2-i.y2,c=r.width-o-l,h=r.height-s-u,d=n*n;a.fillArea({x:o,y:s,width:c+1,height:h+1},d);const f=[0],p=Math.max(s,o,l,u);{const r=e.invertScaleX(i.x+i.width/2);for(let a=1;a<p;a++){const o=e.invertScaleY(i.y-a),s=t.distSquare(r,o);if(!(s<d))break;{const t=n-Math.sqrt(s);f.push(t*t)}}}const g=[],m=Math.max(o,l),v=Math.max(s,l);for(let r=1;r<m;r++){const a=e.invertScaleX(i.x-r),o=[];for(let r=1;r<v;r++){const s=e.invertScaleY(i.y-r),l=t.distSquare(a,s);if(l<d){const t=n-Math.sqrt(l);o.push(t*t)}else o.push(0)}g.push(o)}for(let t=1;t<Math.min(s,f.length);t++){const e=f[t];a.fillHorizontalLine(o,s-t,c+1,e)}for(let t=1;t<Math.min(u,f.length);t++){const e=f[t];a.fillHorizontalLine(o,s+h+t,c+1,e)}for(let t=1;t<Math.min(o,f.length);t++){const e=f[t];a.fillVerticalLine(o-t,s,h+1,e)}for(let t=1;t<Math.min(u,f.length);t++){const e=f[t];a.fillVerticalLine(o+c+t,s,h+1,e)}for(let t=1;t<o;t++){const e=g[t-1],n=o-t;for(let t=1;t<s;t++)a.set(n,s-t,e[t-1]);for(let t=1;t<u;t++)a.set(n,s+h+t,e[t-1])}for(let t=1;t<l;t++){const e=g[t-1],n=o+c+t;for(let t=1;t<s;t++)a.set(n,s-t,e[t-1]);for(let t=1;t<u;t++)a.set(n,s+h+t,e[t-1])}return a}(t.obj,this.potentialArea,this.o.nodeR1):Zv(t.obj,this.potentialArea,this.o.nodeR1);t.area=n,a.set(e,n)};this.members.forEach(o),this.nonMembers.forEach(o),this.members.forEach(s),this.nonMembers.forEach((t=>{this.activeRegion.intersects(t.obj)?s(t):t.area=null})),this.edges.forEach((t=>{t.area||(t.area=Vv(t.obj,this.potentialArea,this.o.edgeR1))})),this.virtualEdges.forEach((t=>{t.area||(t.area=Vv(t.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(0===this.members.length)return new ty([]);this.dirty.size>0&&this.update();const{o:t,potentialArea:e}=this,n=this.members.map((t=>t.area)),i=this.virtualEdges.concat(this.edges).map((t=>t.area)),r=this.nonMembers.filter((t=>null!=t.area)).map((t=>t.area)),a=this.members.map((t=>t.obj));return function(t,e,n,i,r,a={}){const o=Object.assign({},iy,a);let s=o.threshold,l=o.memberInfluenceFactor,u=o.edgeInfluenceFactor,c=o.nonMemberInfluenceFactor;const h=(o.nodeR0-o.nodeR1)*(o.nodeR0-o.nodeR1),d=(o.edgeR0-o.edgeR1)*(o.edgeR0-o.edgeR1);for(let a=0;a<o.maxMarchingIterations;a++){if(t.clear(),0!==l){const n=l/h;for(const i of e)t.incArea(i,n)}if(0!==u){const e=u/d;for(const i of n)t.incArea(i,e)}if(0!==c){const e=c/h;for(const n of i)t.incArea(n,e)}const f=ny(t,s);if(f&&r(f))return f;if(s*=.95,a<=.5*o.maxMarchingIterations)l*=1.2,u*=1.2;else{if(!(0!==c&&i.length>0))break;c*=.8}}return new ty([])}(e,n,i,r,(t=>t.containsElements(a)),t)}}var ly=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class uy extends _v{constructor(t,e){super(t,(0,Jh.Z)({},uy.defaultOptions,e)),this.members=new Map,this.avoidMembers=new Map,this.bubbleSetOptions={},this.drawBubbleSets=()=>{const{style:t,bubbleSetOptions:e}=this.parseOptions();nc(this.bubbleSetOptions,e)||this.init(),this.bubbleSetOptions=Object.assign({},e);const n=Object.assign(Object.assign({},t),{d:this.getPath()});this.shape?this.shape.update(n):(this.shape=new Af({style:n}),this.context.canvas.appendChild(this.shape))},this.updateBubbleSetsPath=t=>{if(!this.shape)return;const e=kh(t.data);[...this.options.members,...this.options.avoidMembers].includes(e)&&this.shape.update(Object.assign(Object.assign({},this.parseOptions().style),{d:this.getPath(e)}))},this.getPath=t=>{const{graph:e}=this.context,n=this.options.members,i=[...this.members.keys()],r=this.options.avoidMembers,a=[...this.avoidMembers.keys()];if(!t&&nc(n,i)&&nc(r,a))return this.path;const{enter:o=[],exit:s=[]}=Wh(i,n,(t=>t)),{enter:l=[],exit:u=[]}=Wh(a,r,(t=>t));t&&(s.push(t),o.push(t));const c=(t,n,i)=>{t.forEach((t=>{const r=i?this.members:this.avoidMembers,a=i?"pushMember":"pushNonMember",o=i?"removeMember":"removeNonMember";if(n){let n;"edge"===e.getElementType(t)?([n]=hy(e,t),this.bubbleSets.pushEdge(n)):([n]=cy(e,t),this.bubbleSets[a](n)),r.set(t,n)}else{const n=r.get(t);n&&("edge"===e.getElementType(t)?this.bubbleSets.removeEdge(n):this.bubbleSets[o](n),r.delete(t))}}))};c(s,!1,!0),c(o,!0,!0),c(u,!1,!1),c(l,!0,!1);const h=this.bubbleSets.compute().sample(8).simplify(0).bSplines().simplify(0);return this.path=Mf(h.points.map(_d)),this.path},this.bindEvents(),this.bubbleSets=new sy(this.options)}bindEvents(){this.context.graph.on(dc.AFTER_RENDER,this.drawBubbleSets),this.context.graph.on(dc.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath)}init(){this.bubbleSets=new sy(this.options),this.members=new Map,this.avoidMembers=new Map}parseOptions(){const t=this.options,{type:e,key:n,members:i,avoidMembers:r}=t,a=ly(t,["type","key","members","avoidMembers"]),o=Object.keys(a).reduce(((t,e)=>(e in iy?t.bubbleSetOptions[e]=a[e]:t.style[e]=a[e],t)),{style:{},bubbleSetOptions:{}});return Object.assign({type:e,key:n,members:i,avoidMembers:r},o)}addMember(t){const e=Array.isArray(t)?t:[t];e.some((t=>this.options.avoidMembers.includes(t)))&&(this.options.avoidMembers=this.options.avoidMembers.filter((t=>!e.includes(t)))),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((t=>!e.includes(t))),this.drawBubbleSets()}updateMember(t){this.options.members=(0,en.Z)(t)?t(this.options.members):t,this.drawBubbleSets()}getMember(){return this.options.members}addAvoidMember(t){const e=Array.isArray(t)?t:[t];e.some((t=>this.options.members.includes(t)))&&(this.options.members=this.options.members.filter((t=>!e.includes(t)))),this.options.avoidMembers=[...new Set([...this.options.avoidMembers,...e])],this.drawBubbleSets()}removeAvoidMember(t){const e=Array.isArray(t)?t:[t];this.options.avoidMembers.some((t=>e.includes(t)))&&(this.options.avoidMembers=this.options.avoidMembers.filter((t=>!e.includes(t))),this.drawBubbleSets())}updateAvoidMember(t){this.options.avoidMembers=Array.isArray(t)?t:[t],this.drawBubbleSets()}getAvoidMember(){return this.options.avoidMembers}destroy(){this.context.graph.off(dc.AFTER_RENDER,this.drawBubbleSets),this.context.graph.off(dc.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath),this.shape.destroy(),super.destroy()}}uy.defaultOptions=Object.assign({members:[],avoidMembers:[],fill:"lightblue",fillOpacity:.2,stroke:"blue",strokeOpacity:.2},iy);const cy=(t,e)=>(Array.isArray(e)?e:[e]).map((e=>{const n=t.getElementRenderBounds(e);return new Gv(n.min[0],n.min[1],Zc(n),Wc(n))})),hy=(t,e)=>(Array.isArray(e)?e:[e]).map((e=>{const n=t.getEdgeData(e),i=t.getElementPosition(n.source),r=t.getElementPosition(n.target);return Lv.from({x1:i[0],y1:i[1],x2:r[0],y2:r[1]})}));var dy=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class fy extends _v{constructor(t,e){super(t,Object.assign({},fy.defaultOptions,e)),this.targetElement=null,this.onTriggerEvent=t=>{var e;null===(e=t.preventDefault)||void 0===e||e.call(t),this.show(t)},this.onMenuItemClick=t=>{const{onClick:e,trigger:n}=this.options;if(t.target instanceof HTMLElement&&t.target.className.includes("g6-contextmenu-li")){const n=t.target.getAttribute("value");null==e||e(n,t.target,this.targetElement),this.hide()}"click"!==n&&this.hide()},this.initElement(),this.update(e)}initElement(){this.$element=Ev("contextmenu",!1,{zIndex:"99"});const{className:t}=this.options;t&&this.$element.classList.add(t);this.context.canvas.getContainer().appendChild(this.$element),wv("g6-contextmenu-css","style",{},"\n .g6-contextmenu {\n font-size: 12px;\n background-color: rgba(255, 255, 255, 0.96);\n border-radius: 4px;\n overflow: hidden;\n box-shadow: rgba(0, 0, 0, 0.12) 0px 6px 12px 0px;\n 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;\n }\n\n .g6-contextmenu-ul {\n max-width: 256px;\n min-width: 96px;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n .g6-contextmenu-li {\n padding: 8px 12px;\n cursor: pointer;\n user-select: none;\n }\n\n .g6-contextmenu-li:hover {\n background-color: #f5f5f5;\n cursor: pointer;\n }\n",document.head)}show(t){return dy(this,void 0,void 0,(function*(){const{enable:e,offset:n}=this.options;if("function"==typeof e&&!e(t)||!e)return void this.hide();const i=yield this.getDOMContent(t);i instanceof HTMLElement?(this.$element.innerHTML="",this.$element.appendChild(i)):this.$element.innerHTML=i;const r=this.context.graph.getCanvas().getContainer().getBoundingClientRect();this.$element.style.left=`${t.client.x-r.left+n[0]}px`,this.$element.style.top=`${t.client.y-r.top+n[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 dy(this,void 0,void 0,(function*(){const{getContent:e,getItems:n}=this.options;return n?`\n <ul class="g6-contextmenu-ul">\n ${(yield n(t)).map((t=>`<li class="g6-contextmenu-li" value="${t.value}">${t.name}</li>`)).join("")}\n </ul>\n `: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)}}fy.defaultOptions={trigger:"contextmenu",offset:[4,4],loadingContent:'<div class="g6-contextmenu-loading">Loading...</div>',getContent:()=>"It is a empty context menu.",enable:()=>!0};class py extends _v{constructor(t,e){super(t,Object.assign({},py.defaultOptions,e)),this.edgeBundles={},this.edgePoints={},this.onBundle=()=>{const{model:t,element:e}=this.context,n=t.getEdgeData();this.divideEdges(this.options.divisions);const{cycles:i,iterRate:r,divRate:a}=this.options;let{lambda:o,divisions:s,iterations:l}=this.options;for(let t=0;t<i;t++){for(let t=0;t<l;t++){const t={};n.forEach((e=>{var n;if(e.source===e.target)return;const i=kh(e);t[i]=this.getEdgeForces(e,s,o);for(let e=0;e<s+1;e++)(n=this.edgePoints)[i]||(n[i]=[]),this.edgePoints[i][e]=ed(this.edgePoints[i][e],t[i][e])}))}o/=2,s*=a,l*=r,this.divideEdges(s)}n.forEach((t=>{const n=kh(t),i=e.getElement(n);null==i||i.update({d:Lg(this.edgePoints[n])})}))},this.bindEvents()}get nodeMap(){const t=this.context.model.getNodeData();return Object.fromEntries(t.map((t=>[kh(t),hd(vd(t))])))}divideEdges(t){this.context.model.getEdgeData().forEach((e=>{var n;const i=kh(e);(n=this.edgePoints)[i]||(n[i]=[]);const r=this.nodeMap[e.source],a=this.nodeMap[e.target];if(1===t)this.edgePoints[i].push(r),this.edgePoints[i].push(rd(ed(r,a),2)),this.edgePoints[i].push(a);else{const e=(0===this.edgePoints[i].length?od(r,a):_y(this.edgePoints[i]))/(t+1);let n=e;const o=[r];for(let t=1;t<this.edgePoints[i].length;t++){const r=this.edgePoints[i][t-1],a=this.edgePoints[i][t];let s=od(a,r);for(;s>n;){const t=n/s,i=ed(r,id(nd(a,r),t));o.push(i),s-=n,n=e}n-=s}o.push(a),this.edgePoints[i]=o}}))}getVectorPosition(t){const e=this.nodeMap[t.source],n=this.nodeMap[t.target],[i,r]=nd(n,e);return{source:e,target:n,vx:i,vy:r,length:od(e,n)}}measureEdgeCompatibility(t,e){const n=this.getVectorPosition(t),i=this.getVectorPosition(e);return gy(n,i)*my(n,i)*vy(n,i)*by(n,i)}getEdgeBundles(){const t={},e=this.options.bundleThreshold,n=this.context.model.getEdgeData();return n.forEach(((i,r)=>{n.forEach(((n,a)=>{var o,s;if(a<=r)return;this.measureEdgeCompatibility(i,n)>=e&&(t[o=kh(i)]||(t[o]=[]),t[kh(i)].push(n),t[s=kh(n)]||(t[s]=[]),t[kh(n)].push(i))}))})),t}getSpringForce(t,e){const{pre:n,cur:i,next:r}=t;return id(nd(ed(n,r),id(i,2)),e)}getElectrostaticForce(t,e){yf(this.edgeBundles)&&(this.edgeBundles=this.getEdgeBundles());const n=this.edgeBundles[kh(e)];let i=[0,0];return null==n||n.forEach((n=>{const r=this.edgePoints[kh(n)][t],a=this.edgePoints[kh(e)][t],o=nd(r,a),s=od(r,a);i=ed(i,id(o,1/s))})),i}getEdgeForces(t,e,n){const i=this.nodeMap[t.source],r=this.nodeMap[t.target],a=this.options.K/(od(i,r)*(e+1)),o=[[0,0]],s=kh(t);for(let i=1;i<e;i++){const e=this.getSpringForce({pre:this.edgePoints[s][i-1],cur:this.edgePoints[s][i],next:this.edgePoints[s][i+1]||[0,0]},a),r=this.getElectrostaticForce(i,t);o.push(id(ed(e,r),n))}return o.push([0,0]),o}bindEvents(){const{graph:t}=this.context;t.on(dc.AFTER_RENDER,this.onBundle)}unbindEvents(){const{graph:t}=this.context;t.off(dc.AFTER_RENDER,this.onBundle)}destroy(){this.unbindEvents(),super.destroy()}}py.defaultOptions={K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:2/3,bundleThreshold:.6};const gy=(t,e)=>{return Math.abs((n=[t.vx,t.vy],i=[e.vx,e.vy],n.reduce(((t,e,n)=>t+e*i[n]),0)/(t.length*e.length)));var n,i},my=(t,e)=>{const n=(t.length+e.length)/2;return 2/(n/Math.min(t.length,e.length)+Math.max(t.length,e.length)/n)},vy=(t,e)=>{const n=(t.length+e.length)/2;return n/(n+od(rd(ed(t.source,t.target),2),rd(ed(e.source,e.target),2)))},yy=(t,e)=>{if(e.source[0]===e.target[0])return[e.source[0],t[1]];if(e.source[1]===e.target[1])return[t[0],e.source[1]];const n=(e.source[1]-e.target[1])/(e.source[0]-e.target[0]),i=(n*n*e.source[0]+n*(t[1]-e.source[1])+t[0])/(n*n+1);return[i,n*(i-e.source[0])+e.source[1]]},xy=(t,e)=>{const n=yy(e.source,t),i=yy(e.target,t),r=rd(ed(n,i),2),a=rd(ed(t.source,t.target),2);return 0===od(n,i)?0:Math.max(0,1-2*od(a,r)/od(n,i))},by=(t,e)=>Math.min(xy(t,e),xy(e,t)),_y=t=>{let e=0;for(let n=1;n<t.length;n++)e+=od(t[n],t[n-1]);return e},Ey={fill:"#fff",fillOpacity:1,lineWidth:1,stroke:"#000",strokeOpacity:.8,zIndex:-1/0};class wy extends _v{constructor(t,e){super(t,Object.assign({},wy.defaultOptions,e)),this.shapes=new Map,this.r=this.options.r,this.onEdgeFilter=t=>{if("drag"===this.options.trigger&&this.isLensOn)return;const e=_d(t.canvas);this.renderLens(e),this.renderFocusElements()},this.renderLens=t=>{const e=Object.assign({},Ey,this.options.style);this.isLensOn||(this.lens=new Ff({style:e}),this.canvas.appendChild(this.lens)),Object.assign(e,Ed(t),{size:2*this.r}),this.lens.update(e)},this.getFilterData=()=>{const{filter:t}=this.options,{model:e}=this.context,n=e.getData();if(!t)return n;const{nodes:i,edges:r,combos:a}=n;return{nodes:i.filter((e=>t(kh(e),"node"))),edges:r.filter((e=>t(kh(e),"edge"))),combos:a.filter((e=>t(kh(e),"combo")))}},this.getFocusElements=t=>{const{nodes:e,edges:n}=this.getFilterData(),i=e.filter((e=>od(vd(e),t)<this.r)),r=i.map((t=>kh(t)));return{nodes:i,edges:n.filter((t=>{const{source:e,target:n}=t,i=r.includes(e),a=r.includes(n);switch(this.options.nodeType){case"both":return i&&a;case"either":return i!==a;case"source":return i&&!a;case"target":return!i&&a;default:return!1}}))}},this.renderFocusElements=()=>{const{element:t,graph:e}=this.context;if(!this.isLensOn)return;const n=this.lens.getCenter(),{nodes:i,edges:r}=this.getFocusElements(n),a=new Set,o=n=>{const i=kh(n);a.add(i);const r=t.getElement(i);if(!r)return;const o=this.shapes.get(i)||r.cloneNode();o.setPosition(r.getPosition()),o.id=r.id,this.shapes.has(i)?Object.entries(r.attributes).forEach((([t,e])=>{o.style[t]!==e&&(o.style[t]=e)})):(this.canvas.appendChild(o),this.shapes.set(i,o));const s=e.getElementType(i),l=this.getElementStyle(s,n);o.update(l)};i.forEach(o),r.forEach(o),this.shapes.forEach(((t,e)=>{a.has(e)||(t.destroy(),this.shapes.delete(e))}))},this.scaleRByWheel=t=>{var e;this.options.preventDefault&&t.preventDefault();const{clientX:n,clientY:i,deltaX:r,deltaY:a}=t,{graph:o,canvas:s}=this.context,l=o.getCanvasByClient([n,i]),u=null===(e=this.lens)||void 0===e?void 0:e.getCenter();if(!this.isLensOn||od(l,u)>this.r)return;const{maxR:c,minR:h}=this.options,d=r+a>0?1/.95:.95,f=Math.min(...s.getSize())/2;this.r=Math.max(h||0,Math.min(c||f,this.r*d)),this.renderLens(u),this.renderFocusElements()},this.isLensDragging=!1,this.onDragStart=t=>{var e;const n=_d(t.canvas),i=null===(e=this.lens)||void 0===e?void 0:e.getCenter();!this.isLensOn||od(n,i)>this.r||(this.isLensDragging=!0)},this.onDrag=t=>{if(!this.isLensDragging)return;const e=_d(t.canvas);this.renderLens(e),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 n="node"===t?this.options.nodeStyle:this.options.edgeStyle;return"function"==typeof n?n(e):n}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i}=this.options,r=e.getCanvas().getLayer();["click","drag"].includes(n)&&r.addEventListener(uc.CLICK,this.onEdgeFilter),"pointermove"===n?r.addEventListener(uc.POINTER_MOVE,this.onEdgeFilter):"drag"===n&&(r.addEventListener(uc.DRAG_START,this.onDragStart),r.addEventListener(uc.DRAG,this.onDrag),r.addEventListener(uc.DRAG_END,this.onDragEnd)),"wheel"===i&&(null===(t=this.graphDom)||void 0===t||t.addEventListener(uc.WHEEL,this.scaleRByWheel,{passive:!1}))}unbindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i}=this.options,r=e.getCanvas().getLayer();["click","drag"].includes(n)&&r.removeEventListener(uc.CLICK,this.onEdgeFilter),"pointermove"===n?r.removeEventListener(uc.POINTER_MOVE,this.onEdgeFilter):"drag"===n&&(r.removeEventListener(uc.DRAG_START,this.onDragStart),r.removeEventListener(uc.DRAG,this.onDrag),r.removeEventListener(uc.DRAG_END,this.onDragEnd)),"wheel"===i&&(null===(t=this.graphDom)||void 0===t||t.removeEventListener(uc.WHEEL,this.scaleRByWheel))}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),this.isLensOn&&this.lens.destroy(),this.shapes.forEach(((t,e)=>{t.destroy(),this.shapes.delete(e)})),super.destroy()}}wy.defaultOptions={trigger:"pointermove",r:60,nodeType:"both",filter:()=>!0,style:{lineWidth:2},nodeStyle:{label:!1},edgeStyle:{label:!0},scaleRBy:"wheel",preventDefault:!0};const Ty={fill:"#ccc",fillOpacity:.1,lineWidth:2,stroke:"#000",strokeOpacity:.8,labelFontSize:12};class Sy extends _v{constructor(t,e){super(t,Object.assign({},Sy.defaultOptions,e)),this.r=this.options.r,this.d=this.options.d,this.onCreateFisheye=t=>{if("drag"===this.options.trigger&&this.isLensOn)return;const e=_d(t.canvas);this.onMagnify(e)},this.onMagnify=t=>{t.some(isNaN)||(this.renderLens(t),this.renderFocusElements())},this.renderLens=t=>{const e=Object.assign({},Ty,this.options.style);this.isLensOn||(this.lens=new Ff({style:e}),this.canvas.appendChild(this.lens)),Object.assign(e,Ed(t),{size:2*this.r,label:this.options.showDPercent,labelText:this.getDPercent()}),this.lens.update(e)},this.getDPercent=()=>{const{minD:t,maxD:e}=this.options;return`${Math.round((this.d-t)/(e-t)*100)}%`},this.prevMagnifiedStyleMap=new Map,this.prevOriginStyleMap=new Map,this.renderFocusElements=()=>{if(!this.isLensOn)return;const{graph:t}=this.context,e=this.lens.getCenter(),n=(this.d+1)*this.r,i=new Map,r=new Map;t.getNodeData().forEach((a=>{const o=vd(a),s=od(o,e);if(s>this.r)return;const l=n*s/(this.d*s+this.r),[u,c]=o,[h,d]=e,f=[h+l*((u-h)/s),d+l*((c-d)/s)],p=kh(a),g=this.getNodeStyle(a),m=(0,ag.Z)(t.getElementRenderStyle(p),Object.keys(g));i.set(p,Object.assign(Object.assign({},Ed(f)),g)),r.set(p,Object.assign(Object.assign({},Ed(o)),m))})),this.updateStyle(i,r)},this.getNodeStyle=t=>{const{nodeStyle:e}=this.options;return"function"==typeof e?e(t):e},this.updateStyle=(t,e)=>{const{graph:n,element:i}=this.context,{enter:r,exit:a,keep:o}=Wh(Array.from(this.prevMagnifiedStyleMap.keys()),Array.from(t.keys()),(t=>t)),s=new Set,l=(t,e)=>{const r=i.getElement(t);null==r||r.update(e),n.getRelatedEdgesData(t).forEach((t=>{s.add(kh(t))}))};[...r,...o].forEach((e=>{l(e,t.get(e))})),a.forEach((t=>{l(t,this.prevOriginStyleMap.get(t)),this.prevOriginStyleMap.delete(t)})),s.forEach((t=>{const e=i.getElement(t);null==e||e.update({})})),this.prevMagnifiedStyleMap=t,e.forEach(((t,e)=>{this.prevOriginStyleMap.has(e)||this.prevOriginStyleMap.set(e,t)}))},this.isWheelValid=t=>{if(this.options.preventDefault&&t.preventDefault(),!this.isLensOn)return!1;const{clientX:e,clientY:n}=t;return!(od(this.context.graph.getCanvasByClient([e,n]),this.lens.getCenter())>this.r)},this.scaleR=t=>{const{maxR:e,minR:n}=this.options,i=t?1/.95:.95,r=Math.min(...this.context.canvas.getSize())/2;this.r=Math.max(n||0,Math.min(e||r,this.r*i))},this.scaleD=t=>{const{maxD:e,minD:n}=this.options,i=t?this.d+.1:this.d-.1;this.d=Math.max(n,Math.min(e,i))},this.scaleRByWheel=t=>{if(!this.isWheelValid(t))return;const{deltaX:e,deltaY:n}=t;this.scaleR(e+n>0);const i=this.lens.getCenter();this.onMagnify(i)},this.scaleDByWheel=t=>{if(!this.isWheelValid(t))return;const{deltaX:e,deltaY:n}=t;this.scaleD(e+n>0);const i=this.lens.getCenter();this.onMagnify(i)},this.isDragValid=t=>{if(this.options.preventDefault&&t.preventDefault(),!this.isLensOn)return!1;return!(od(_d(t.canvas),this.lens.getCenter())>this.r)},this.isLensDragging=!1,this.onDragStart=t=>{this.isDragValid(t)&&(this.isLensDragging=!0)},this.onDrag=t=>{if(!this.isLensDragging)return;const e=_d(t.canvas);this.onMagnify(e)},this.onDragEnd=()=>{this.isLensDragging=!1},this.scaleRByDrag=t=>{if(!this.isLensDragging)return;const{dx:e,dy:n}=t;this.scaleR(e-n>0);const i=this.lens.getCenter();this.onMagnify(i)},this.scaleDByDrag=t=>{if(!this.isLensDragging)return;const{dx:e,dy:n}=t;this.scaleD(e-n>0);const i=this.lens.getCenter();this.onMagnify(i)},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:n,scaleRBy:i,scaleDBy:r}=this.options,a=e.getCanvas().getLayer();if(["click","drag"].includes(n)&&a.addEventListener(uc.CLICK,this.onCreateFisheye),"pointermove"===n&&a.addEventListener(uc.POINTER_MOVE,this.onCreateFisheye),"drag"===n||"drag"===i||"drag"===r){a.addEventListener(uc.DRAG_START,this.onDragStart),a.addEventListener(uc.DRAG_END,this.onDragEnd);const t="drag"===n?this.onDrag:"drag"===i?this.scaleRByDrag:this.scaleDByDrag;a.addEventListener(uc.DRAG,t)}if("wheel"===i||"wheel"===r){const e="wheel"===i?this.scaleRByWheel:this.scaleDByWheel;null===(t=this.graphDom)||void 0===t||t.addEventListener(uc.WHEEL,e,{passive:!1})}}unbindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i,scaleDBy:r}=this.options,a=e.getCanvas().getLayer();if(["click","drag"].includes(n)&&a.removeEventListener(uc.CLICK,this.onCreateFisheye),"pointermove"===n&&a.removeEventListener(uc.POINTER_MOVE,this.onCreateFisheye),"drag"===n||"drag"===i||"drag"===r){a.removeEventListener(uc.DRAG_START,this.onDragStart),a.removeEventListener(uc.DRAG_END,this.onDragEnd);const t="drag"===n?this.onDrag:"drag"===i?this.scaleRByDrag:this.scaleDByDrag;a.removeEventListener(uc.DRAG,t)}if("wheel"===i||"wheel"===r){const e="wheel"===i?this.scaleRByWheel:this.scaleDByWheel;null===(t=this.graphDom)||void 0===t||t.removeEventListener(uc.WHEEL,e)}}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){var t;this.unbindEvents(),this.isLensOn&&(null===(t=this.lens)||void 0===t||t.destroy()),this.prevMagnifiedStyleMap.clear(),this.prevOriginStyleMap.clear(),super.destroy()}}Sy.defaultOptions={trigger:"pointermove",r:120,d:1.5,maxD:5,minD:0,showDPercent:!0,style:{},nodeStyle:{label:!0},preventDefault:!0};class My extends _v{constructor(t,e){super(t,Object.assign({},My.defaultOptions,e)),this.$el=this.context.canvas.getContainer(),this.graphSize=[0,0],this.onFullscreenChange=()=>{var t,e,n,i;const r=!!document.fullscreenElement;this.options.autoFit&&this.setGraphSize(r),r?null===(e=(t=this.options).onEnter)||void 0===e||e.call(t):null===(i=(n=this.options).onExit)||void 0===i||i.call(n)},this.shortcut=new Dd(t.graph),this.bindEvents(),this.style=document.createElement("style"),document.head.appendChild(this.style),this.style.innerHTML="\n :not(:root):fullscreen::backdrop {\n background: transparent;\n }\n "}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((t=>{document.addEventListener(t,this.onFullscreenChange,!1)}))}unbindEvents(){this.shortcut.unbindAll();["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach((t=>{document.removeEventListener(t,this.onFullscreenChange,!1)}))}setGraphSize(t=!0){var e,n;let i,r;t?(i=(null===(e=globalThis.screen)||void 0===e?void 0:e.width)||0,r=(null===(n=globalThis.screen)||void 0===n?void 0:n.height)||0,this.graphSize=this.context.graph.getSize()):[i,r]=this.graphSize,this.context.graph.setSize(i,r),this.context.graph.render()}request(){!document.fullscreenElement&&(document.fullscreenEnabled||Reflect.get(document,"webkitFullscreenEnabled")||Reflect.get(document,"mozFullscreenEnabled")||Reflect.get(document,"msFullscreenEnabled"))&&this.$el.requestFullscreen().catch((t=>{_c.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()}}My.defaultOptions={trigger:{},autoFit:!0};class Cy extends _v{constructor(t,e){super(t,Object.assign({},Cy.defaultOptions,e)),this.$element=Ev("grid-line",!0),this.offset=[0,0],this.onTransform=t=>{if(!this.options.follow)return;const{data:{translate:e}}=t;e&&this.updateOffset(e)};this.context.canvas.getContainer().prepend(this.$element),this.updateStyle(),this.bindEvents()}update(t){super.update(t),this.updateStyle()}bindEvents(){const{graph:t}=this.context;t.on(dc.AFTER_TRANSFORM,this.onTransform)}updateStyle(){const{size:t,stroke:e,lineWidth:n,border:i,borderLineWidth:r,borderStroke:a,borderStyle:o}=this.options;Object.assign(this.$element.style,{border:i?`${r}px ${o} ${a}`:"none",backgroundImage:`linear-gradient(${e} ${n}px, transparent ${n}px), linear-gradient(90deg, ${e} ${n}px, transparent ${n}px)`,backgroundSize:`${t}px ${t}px`})}updateOffset(t){var e,n;this.offset=(e=ed(this.offset,t),n=this.options.size,e.map((t=>t%n))),this.$element.style.backgroundPosition=`${this.offset[0]}px ${this.offset[1]}px`}destroy(){this.context.graph.off(dc.AFTER_TRANSFORM,this.onTransform),this.$element.remove(),super.destroy()}}Cy.defaultOptions={border:!0,borderLineWidth:1,borderStroke:"#eee",borderStyle:"solid",lineWidth:1,size:20,stroke:"#eee"};var Ay=n(49336);function Oy(t){const e={Added:new Map,Updated:new Map,Removed:new Map};return t.forEach((t=>{const{type:n,value:i}=t,r=kh(i);if("NodeAdded"===n||"EdgeAdded"===n||"ComboAdded"===n)e.Added.set(r,t);else if("NodeUpdated"===n||"EdgeUpdated"===n||"ComboUpdated"===n)if(e.Added.has(r))e.Added.set(r,{type:n.replace("Updated","Added"),value:i});else if(e.Updated.has(r)){const{original:t}=e.Updated.get(r);e.Updated.set(r,{type:n,value:i,original:t})}else e.Removed.has(r)||e.Updated.set(r,t);else"NodeRemoved"!==n&&"EdgeRemoved"!==n&&"ComboRemoved"!==n||(e.Added.has(r)?e.Added.delete(r):e.Updated.has(r)?(e.Updated.delete(r),e.Removed.set(r,t)):e.Removed.set(r,t))})),[...Array.from(e.Added.values()),...Array.from(e.Updated.values()),...Array.from(e.Removed.values())]}function Ny(t){const{NodeAdded:e=[],NodeUpdated:n=[],NodeRemoved:i=[],EdgeAdded:r=[],EdgeUpdated:a=[],EdgeRemoved:o=[],ComboAdded:s=[],ComboUpdated:l=[],ComboRemoved:u=[]}=Fc(t,(t=>t.type));return{add:{nodes:e,edges:r,combos:s},update:{nodes:n,edges:a,combos:l},remove:{nodes:i,edges:o,combos:u}}}function Py(t,e){for(const n in t)(0,nn.Z)(t[n])&&!Array.isArray(t[n])&&null!==t[n]?(e[n]||(e[n]={}),Py(t[n],e[n])):void 0===e[n]&&(e[n]=Sc(n))}function Ly(t,e=!1,n){const i={animation:e,current:{add:{},update:{},remove:{}},original:{add:{},update:{},remove:{}}},{add:r,update:a,remove:o}=Ny(Oy(t));return["nodes","edges","combos"].forEach((t=>{a[t]&&a[t].forEach((e=>{var r,a;const o=Object.assign({},e.value);let s=Object.assign({},e.original);if(n){const t=n.graph.getElementType(kh(e.original)),i="edge"===t?"stroke":"fill",r=n.element.getElementComputedStyle(t,e.original);s=Object.assign(Object.assign({},e.original),{style:Object.assign({[i]:r[i]},e.original.style)})}Py(o,s),(r=i.current.update)[t]||(r[t]=[]),i.current.update[t].push(o),(a=i.original.update)[t]||(a[t]=[]),i.original.update[t].push(s)})),r[t]&&r[t].forEach((e=>{var n,r;const a=Object.assign({},e.value);(n=i.current.add)[t]||(n[t]=[]),i.current.add[t].push(a),(r=i.original.remove)[t]||(r[t]=[]),i.original.remove[t].push(a)})),o[t]&&o[t].forEach((e=>{var n,r;const a=Object.assign({},e.value);(n=i.current.remove)[t]||(n[t]=[]),i.current.remove[t].push(a),(r=i.original.add)[t]||(r[t]=[]),i.original.add[t].push(a)}))})),i}class Ry extends _v{constructor(t,e){super(t,Object.assign({},Ry.defaultOptions,e)),this.batchChanges=null,this.batchAnimation=!1,this.undoStack=[],this.redoStack=[],this.freezed=!1,this.executeCommand=(t,e=!0)=>{var n,i,r;this.freezed=!0,null===(i=(n=this.options).executeCommand)||void 0===i||i.call(n,t);const a=e?t.original:t.current;this.context.graph.addData(a.add),this.context.graph.updateData(a.update),this.context.graph.removeData(Bh(a.remove,!1)),null===(r=this.context.element)||void 0===r||r.draw({silence:!0,animation:t.animation}),this.freezed=!1},this.addCommand=t=>{var e;if(!this.freezed){if(t.type===dc.AFTER_DRAW){const{dataChanges:n=[],animation:i=!0}=t.data;if(null===(e=this.context.batch)||void 0===e?void 0:e.isBatching){if(!this.batchChanges)return;return this.batchChanges.push(n),void(this.batchAnimation&&(this.batchAnimation=i))}this.batchChanges=[n],this.batchAnimation=i}this.undoStackPush(Ly(this.batchChanges.flat(),this.batchAnimation,this.context)),this.notify(fc.ADD,this.undoStack[this.undoStack.length-1])}},this.initBatchCommand=t=>{const{initiate:e}=t.data;if(this.batchAnimation=!1,e)this.batchChanges=[];else{this.undoStack.pop()||(this.batchChanges=null)}},this.emitter=new Ay.Z;const{graph:n}=this.context;n.on(dc.AFTER_DRAW,this.addCommand),n.on(dc.BATCH_START,this.initBatchCommand),n.on(dc.BATCH_END,this.addCommand)}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){var t,e,n,i;const r=this.undoStack.pop();if(r){this.executeCommand(r);if(!1===(null===(e=(t=this.options).beforeAddCommand)||void 0===e?void 0:e.call(t,r,!1)))return;this.redoStack.push(r),null===(i=(n=this.options).afterAddCommand)||void 0===i||i.call(n,r,!1),this.notify(fc.UNDO,r)}return this}redo(){const t=this.redoStack.pop();return t&&(this.executeCommand(t,!1),this.undoStackPush(t),this.notify(fc.REDO,t)),this}undoAndCancel(){const t=this.undoStack.pop();return t&&(this.executeCommand(t,!1),this.redoStack=[],this.notify(fc.CANCEL,t)),this}undoStackPush(t){var e,n,i,r;const{stackSize:a}=this.options;0!==a&&this.undoStack.length>=a&&this.undoStack.shift();!1!==(null===(n=(e=this.options).beforeAddCommand)||void 0===n?void 0:n.call(e,t,!0))&&(this.undoStack.push(t),null===(r=(i=this.options).afterAddCommand)||void 0===r||r.call(i,t,!0))}clear(){this.undoStack=[],this.redoStack=[],this.batchChanges=null,this.batchAnimation=!1,this.notify(fc.CLEAR,null)}notify(t,e){this.emitter.emit(t,{cmd:e}),this.emitter.emit(fc.CHANGE,{cmd:e})}on(t,e){this.emitter.on(t,e)}destroy(){const{graph:t}=this.context;t.off(dc.AFTER_DRAW,this.addCommand),t.off(dc.BATCH_START,this.initBatchCommand),t.off(dc.BATCH_END,this.addCommand),this.emitter.off(),super.destroy(),this.undoStack=[],this.redoStack=[]}}Ry.defaultOptions={stackSize:0};var Dy=n(76117),ky=n.n(Dy);const Iy=(t,e,n)=>{if("sharp"===n)return[["M",t[0]-e,t[1]-e],["L",t[0]+e,t[1]-e],["L",t[0]+e,t[1]+e],["L",t[0]-e,t[1]+e],["Z"]];const i=[e,e,0,0,0];return[["M",t[0],t[1]-e],["A",...i,t[0],t[1]+e],["A",...i,t[0],t[1]-e]]},By=(t,e,n)=>{const i=[e,e,0,0,0],r="sharp"===n?ed(t[0],ad(ld(nd(t[0],t[1])),e)):t[0],a="sharp"===n?ed(t[1],ad(ld(nd(t[1],t[0])),e)):t[1],o=ad(ld(cd(nd(r,a),!1)),e),s=ad(o,-1),l=ed(r,o),u=ed(a,o),c=ed(a,s),h=ed(r,s);return"sharp"===n?[["M",l[0],l[1]],["L",u[0],u[1]],["L",c[0],c[1]],["L",h[0],h[1]],["Z"]]:[["M",l[0],l[1]],["L",u[0],u[1]],["A",...i,c[0],c[1]],["L",h[0],h[1]],["A",...i,l[0],l[1]]]},Fy=(t,e)=>{const n=Pd(t).map(((n,i)=>{const r=(i-2+t.length)%t.length,a=(i-1+t.length)%t.length,o=(i+1)%t.length,s=t[r],l=t[a],u=t[o],c=nd(s,l),h=nd(l,n),d=nd(n,u),f=(t,e)=>ud(t,e,!0)<Math.PI,p=f(c,h),g=f(h,d),m=t=>ad(ld(cd(t,!1)),e),v=m(h);return[{p:hd(ed(l,p?m(c):v)),concave:p&&l},{p:hd(ed(n,g?m(d):v)),concave:g&&n}]})),i=[e,e,0,0,0],r=n.findIndex(((t,e)=>!(n[(e-1+n.length)%n.length][0].concave||n[(e-1+n.length)%n.length][1].concave||t[0].concave||t[0].concave||t[1].concave))),a=n.slice(r).concat(n.slice(0,r));let o=[];return a.flatMap(((t,e)=>{const r=[],s=a[n.length-1];return 0===e&&r.push(["M",...s[1].p]),t[0].concave?o.push(t[0].p,t[1].p):r.push(["A",...i,...t[0].p]),t[1].concave?o.unshift(t[1].p):r.push(["L",...t[1].p]),3===o.length&&(r.pop(),r.push(["C",...o.flat()]),o=[]),r}))},zy=(t,e)=>{const n=Pd(t).map(((e,n)=>({p:e,v:ld(nd(t[(n+1)%t.length],e))})));return n.forEach(((i,r)=>{const a=r>0?r-1:t.length-1,o=n[a].v,s=ld(ed(o,ad(i.v,ud(o,i.v,!0)<Math.PI?1:-1)));i.p=ed(i.p,ad(s,e))})),Mf(n.map((t=>t.p)))},Gy=(t,e)=>{const n=t.map(((n,i)=>{const r=t[0===i?t.length-1:i-1],a=dd(ad(ld(cd(nd(r,n),!1)),e));return[ed(r,a),ed(n,a)]})),i=n.flat();return i.map(((t,e)=>{if(e%2==0)return null;return gd([i[(e-1)%i.length],i[e%i.length]],[i[(e+1)%i.length],i[(e+2)%i.length]],!0)})).filter(Boolean).map(((t,e)=>[0===e?"M":"L",t[0],t[1]])).concat([["Z"]])};var jy=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class Uy extends _v{constructor(t,e){super(t,Object.assign({},Uy.defaultOptions,e)),this.hullMemberIds=[],this.drawHull=()=>{if(this.shape){const t=!nc(this.optionsCache,this.options);this.shape.update(this.getHullStyle(t))}else this.shape=new Af({style:this.getHullStyle()}),this.context.canvas.appendChild(this.shape);this.optionsCache=Object.assign({},this.options)},this.updateHullPath=t=>{this.shape&&this.options.members.includes(kh(t.data))&&this.shape.update({d:this.getHullPath(!0)})},this.getHullPath=(t=!1)=>{const{graph:e}=this.context,n=this.getMember();if(0===n.length)return"";const i=n.map((t=>e.getNodeData(t))),r=ky()(i.map(vd),this.options.concavity).slice(1).reverse(),a=r.flatMap((t=>i.filter((e=>nc(vd(e),t))).map(kh)));return nc(a,this.hullMemberIds)&&!t||(this.hullMemberIds=a,this.path=function(t,e,n){if(1===t.length)return Iy(t[0],e,n);if(2===t.length)return By(t,e,n);switch(n){case"smooth":return zy(t,e);case"sharp":return Gy(t,e);default:return Fy(t,e)}}(r,this.getPadding(),this.options.corner)),this.path},this.bindEvents()}bindEvents(){this.context.graph.on(dc.AFTER_RENDER,this.drawHull),this.context.graph.on(dc.AFTER_ELEMENT_UPDATE,this.updateHullPath)}getHullStyle(t){const e=this.options,{members:n,padding:i,corner:r}=e,a=jy(e,["members","padding","corner"]);return Object.assign(Object.assign({},a),{d:this.getHullPath(t)})}getPadding(){const{graph:t}=this.context,e=this.hullMemberIds.reduce(((e,n)=>{const{halfExtents:i}=t.getElementRenderBounds(n),r=Math.max(i[0],i[1]);return Math.max(e,r)}),0);return e+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((t=>!e.includes(t))),e.some((t=>this.hullMemberIds.includes(t)))&&this.shape.update({d:this.getHullPath()})}updateMember(t){this.options.members=(0,en.Z)(t)?t(this.options.members):t,this.shape.update(this.getHullStyle(!0))}getMember(){return this.options.members}destroy(){this.context.graph.off(dc.AFTER_DRAW,this.drawHull),this.shape.destroy(),this.hullMemberIds=[],super.destroy()}}function Hy(t,e){e(t),t.children&&t.children.forEach((function(t){t&&Hy(t,e)}))}function Vy(t){Wy(t,!0)}function Zy(t){Wy(t,!1)}function Wy(t,e){var n=e?"visible":"hidden";Hy(t,(function(t){t.attr("visibility",n)}))}Uy.defaultOptions={members:[],padding:10,corner:"rounded",concavity:1/0,fill:"lightblue",fillOpacity:.2,labelOpacity:1,stroke:"blue",strokeOpacity:.2};var Xy=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=5),Object.entries(e).forEach((function(r){var a=(0,he.CR)(r,2),o=a[0],s=a[1],l=t;Object.prototype.hasOwnProperty.call(e,o)&&(s?(0,yv.Z)(s)?((0,yv.Z)(t[o])||(l[o]={}),n<i?Xy(t[o],s,n+1,i):l[o]=e[o]):(0,Fe.Z)(s)?(l[o]=[],l[o]=l[o].concat(s)):l[o]=s:l[o]=s)}))},Yy=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i+=1)Xy(t,e[i]);return t},qy=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=t.apply(this,(0,he.ev)([],(0,he.CR)(e),!1))||this;return i.isMutationObserved=!0,i.addEventListener(Ms.INSERTED,(function(){Zy(i)})),i}return(0,he.ZT)(e,t),e}(Tl);function $y(t){var e=t.appendChild(new qy({class:"offscreen"}));return Zy(e),e}function Ky(){Wy(this,"hidden"!==this.attributes.visibility)}var Qy=function(t){function e(e,n){void 0===n&&(n={});var i=t.call(this,Yy({},{style:n},e))||this;return i.initialized=!1,i._defaultOptions=n,i}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=$y(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&Ky.call(this)},e.prototype.update=function(t,e){var n;return this.attr(Yy({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){t.x,t.y,t.transform,t.transformOrigin,t.class,t.className,t.zIndex;return(0,he._T)(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(El);function Jy(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function tx(t,e,n){var i;void 0===n&&(n=!0);var r=e||(null===(i=t.match(/^([a-z][a-z0-9]+)/))||void 0===i?void 0:i[0])||"",a=t.replace(new RegExp("^(".concat(r,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(a):a}var ex=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function nx(t,e,n){void 0===n&&(n=!1);var i={};return Object.entries(t).forEach((function(t){var r=(0,he.CR)(t,2),a=r[0],o=r[1];if("className"===a||"class"===a);else if(ex(a,"show")&&ex(tx(a,"show"),e)!==n)a===function(t,e){return"".concat(e).concat(Jy(t))}(e,"show")?i[a]=o:i[a.replace(new RegExp(Jy(e)),"")]=o;else if(!ex(a,"show")&&ex(a,e)!==n){var s=tx(a,e);"filter"===s&&"function"==typeof o||(i[s]=o)}})),i}function ix(t,e){return Object.entries(t).reduce((function(t,n){var i=(0,he.CR)(n,2),r=i[0],a=i[1];return r.startsWith("show")?t["show".concat(e).concat(r.slice(4))]=a:t["".concat(e).concat(Jy(r))]=a,t}),{})}function rx(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},r={};return Object.entries(t).forEach((function(t){var a=(0,he.CR)(t,2),o=a[0],s=a[1];e.includes(o)||(-1!==n.indexOf(o)?r[o]=s:i[o]=s)})),[i,r]}var ax=function(t){function e(e){void 0===e&&(e={});var n=e.style,i=(0,he._T)(e,["style"]);return t.call(this,(0,he.pi)({style:(0,he.pi)({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},i))||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=$y(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(Fl);var ox=function(){function t(t,n,i,r,a,o,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===i&&(i=null),void 0===r&&(r=null),void 0===a&&(a=[null,null,null,null,null]),void 0===o&&(o=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=i,this._document=r,this._enter=a[0],this._update=a[1],this._exit=a[2],this._merge=a[3],this._split=a[4],this._transitions=o,this._facetElements=s}var e,n,i;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,i="function"==typeof t?t:function(){return e.createElement(t)},r=[];if(null!==this._data){for(var a=0;a<this._data.length;a++){var o=this._data[a],s=(0,he.CR)(Array.isArray(o)?o:[o,null],2),l=s[0],u=s[1];(h=i(l,a)).__data__=l,null!==u&&(h.__fromElements__=u),this._parent.appendChild(h),r.push(h)}return new n(r,null,this._parent,this._document)}for(a=0;a<this._elements.length;a++){var c=this._elements[a],h=i(l=c.__data__,a);c.appendChild(h),r.push(h)}return new n(r,null,r[0],this._document)},t.prototype.maybeAppend=function(t,n){var r=(0,he.Q_)(this,e,"m",i).call(this,"#"===t[0]?t:"#".concat(t),n);return r.attr("id",t),r},t.prototype.maybeAppendByClassName=function(t,n){var r=t.toString(),a=(0,he.Q_)(this,e,"m",i).call(this,"."===r[0]?r:".".concat(r),n);return a.attr("className",r),a},t.prototype.maybeAppendByName=function(t,n){var r=(0,he.Q_)(this,e,"m",i).call(this,'[name="'.concat(t,'"]'),n);return r.attr("name",t),r},t.prototype.data=function(t,e,i){var r,a;void 0===e&&(e=function(t){return t}),void 0===i&&(i=function(){return null});for(var o,s,l,u=[],c=[],h=new Set(this._elements),d=[],f=new Set,p=new Map(this._elements.map((function(t,n){return[e(t.__data__,n),t]}))),g=new Map(this._facetElements.map((function(t,n){return[e(t.__data__,n),t]}))),m=(o=this._elements,s=function(t){return i(t.__data__)},l=new Map,o.forEach((function(t){var e=s(t);l.has(e)||l.set(e,[]),l.get(e).push(t)})),l),v=0;v<t.length;v++){var y=t[v],x=e(y,v),b=i(y,v);if(p.has(x))(T=p.get(x)).__data__=y,T.__facet__=!1,c.push(T),h.delete(T),p.delete(x);else if(g.has(x)){(T=g.get(x)).__data__=y,T.__facet__=!0,c.push(T),g.delete(x)}else if(m.has(x)){var _=m.get(x);d.push([y,_]);try{for(var E=(r=void 0,(0,he.XA)(_)),w=E.next();!w.done;w=E.next()){var T=w.value;h.delete(T)}}catch(t){r={error:t}}finally{try{w&&!w.done&&(a=E.return)&&a.call(E)}finally{if(r)throw r.error}}m.delete(x)}else if(p.has(b)){(T=p.get(b)).__toData__?T.__toData__.push(y):T.__toData__=[y],f.add(T),h.delete(T)}else u.push(y)}var S=[new n([],u,this._parent,this._document),new n(c,null,this._parent,this._document),new n(h,null,this._parent,this._document),new n([],d,this._parent,this._document),new n(f,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,S)},t.prototype.merge=function(t){var e=(0,he.ev)((0,he.ev)([],(0,he.CR)(this._elements),!1),(0,he.CR)(t._elements),!1),i=(0,he.ev)((0,he.ev)([],(0,he.CR)(this._transitions),!1),(0,he.CR)(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,i)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,i,r){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===i&&(i=function(t){return t}),void 0===r&&(r=function(t){return t.remove()});var a=t(this._enter),o=e(this._update),s=n(this._exit),l=i(this._merge),u=r(this._split);return o.merge(a).merge(s).merge(l).merge(u)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],i=e._transitions[t];i?i.then((function(){return n.remove()})):n.remove()},e=this,i=0;i<this._elements.length;i++)t(i);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],i=n.__data__;t.call(n,i,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each((function(i,r){void 0!==e&&(this[t]=n.call(this,i,r))}))},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var i="function"==typeof e&&n?e:function(){return e};return this.each((function(n,r){void 0!==e&&(this.style[t]=i.call(this,n,r))}))},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each((function(n,i){var r=this;Object.entries(t).forEach((function(t){var a=(0,he.CR)(t,2),o=a[0],s=a[1],l="function"==typeof s&&e?s:function(){return s};void 0!==s&&r.attr(o,l.call(r,n,i))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,i){t&&this.update&&this.update(n.call(this,e,i))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,i){t&&this.update&&this.update(n.call(this,e,i))}))},t.prototype.transition=function(t){var e=this._transitions;return this.each((function(n,i){e[i]=t.call(this,n,i)}))},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,(0,he.ev)([this._parent,this],(0,he.CR)(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter((function(t){return!!t}))},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,i=function(t,e){var i=this._elements[0],r=i.querySelector(t);if(r)return new n([r],null,this._parent,this._document);var a="string"==typeof e?this.createElement(e):e();return i.appendChild(a),new n([a],null,this._parent,this._document)},t.registry={g:Tl,rect:Il,circle:bl,path:Pl,text:ax,ellipse:wl,image:Cl,line:Ol,polygon:Rl,polyline:kl,html:Ml},t}();function sx(t){return new ox([t],null,t,t.ownerDocument)}var lx=function(){function t(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=i}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.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}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();var ux=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},i=Object.fromEntries(Object.entries(t).map((function(t){var e=(0,he.CR)(t,2),i=e[0],r=e[1],a=n(r);return[i,{name:a,class:".".concat(a),id:"#".concat(a),toString:function(){return a}}]})));return Object.assign(i,{prefix:n}),i};function cx(t){if((0,oe.Z)(t))return[t,t,t,t];if((0,Fe.Z)(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function hx(t,e,n,i,r){return void 0===i&&(i=!0),void 0===r&&(r=function(t){t.node().removeChildren()}),t?n(e):(i&&r(e),null)}var dx=ux({text:"text"},"title");function fx(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function px(t,e){var n=Object.entries(e).reduce((function(e,n){var i=(0,he.CR)(n,2),r=i[0],a=i[1];return t.node().attr(r)||(e[r]=a),e}),{});t.styles(n)}var gx=function(t){function e(e){return t.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(0,he.ZT)(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,i=t.position,r=t.spacing,a=t.inset,o=this.querySelector(dx.text.class);if(!o)return new lx(0,0,+e,+n);var s=o.getBBox(),l=s.width,u=s.height,c=(0,he.CR)(cx(r),4),h=c[0],d=c[1],f=c[2],p=c[3],g=(0,he.CR)([0,0,+e,+n],4),m=g[0],v=g[1],y=g[2],x=g[3],b=fx(i);if(b.includes("i"))return new lx(m,v,y,x);b.forEach((function(t,i){var r,a,o,s;"t"===t&&(r=(0,he.CR)(0===i?[u+f,+n-u-f]:[0,+n],2),v=r[0],x=r[1]),"r"===t&&(a=(0,he.CR)([+e-l-p],1),y=a[0]),"b"===t&&(o=(0,he.CR)([+n-u-h],1),x=o[0]),"l"===t&&(s=(0,he.CR)(0===i?[l+d,+e-l-d]:[0,+e],2),m=s[0],y=s[1])}));var _=(0,he.CR)(cx(a),4),E=_[0],w=_[1],T=_[2],S=_[3],M=(0,he.CR)([S+w,E+T],2),C=M[0],A=M[1];return new lx(m+S,v+E,y-C,x-A)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new lx(0,0,0,0)},e.prototype.render=function(t,e){var n=this,i=(t.width,t.height,t.position,t.spacing,(0,he._T)(t,["width","height","position","spacing"])),r=(0,he.CR)(rx(i),1)[0],a=function(t){var e,n,i,r,a=t,o=a.width,s=a.height,l=a.position,u=(0,he.CR)([+o/2,+s/2],2),c=u[0],h=u[1],d=(0,he.CR)([+c,+h,"center","middle"],4),f=d[0],p=d[1],g=d[2],m=d[3],v=fx(l);return v.includes("l")&&(f=(e=(0,he.CR)([0,"start"],2))[0],g=e[1]),v.includes("r")&&(f=(n=(0,he.CR)([+o,"end"],2))[0],g=n[1]),v.includes("t")&&(p=(i=(0,he.CR)([0,"top"],2))[0],m=i[1]),v.includes("b")&&(p=(r=(0,he.CR)([+s,"bottom"],2))[0],m=r[1]),{x:f,y:p,textAlign:g,textBaseline:m}}(t),o=a.x,s=a.y,l=a.textAlign,u=a.textBaseline;hx(!!i.text,sx(e),(function(t){n.title=t.maybeAppendByClassName(dx.text,"text").styles(r).call(px,{x:o,y:s,textAlign:l,textBaseline:u}).node()}))},e}(Qy),mx=function(){};function vx(t,e){return(0,en.Z)(t)?t.apply(void 0,(0,he.ev)([],(0,he.CR)(e),!1)):t}function yx(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=(0,he.CR)(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,(0,he.pi)((0,he.pi)({},t[e]),n)]:[e,n]})))}function xx(t,e){t?t.finished.then(e):e()}function bx(t,e){"update"in t?t.update(e):t.attr(e)}function _x(t,e,n){return 0===e.length?null:n?t.animate(e,n):(bx(t,{style:e.slice(-1)[0]}),null)}function Ex(t,e,n){var i={},r={};return Object.entries(e).forEach((function(e){var n=(0,he.CR)(e,2),a=n[0],o=n[1];if(!(0,le.Z)(o)){var s=t.style[a]||t.parsedStyle[a]||0;s!==o&&(i[a]=s,r[a]=o)}})),n?_x(t,[i,r],(0,he.pi)({fill:"both"},n)):(bx(t,r),null)}function wx(t,e,n){void 0===n&&(n=!1);var i=t.getBBox(),r=i.width,a=i.height,o=e/Math.max(r,a);return n&&(t.style.transform="scale(".concat(o,")")),o}var Tx=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},Sx=Tx,Mx=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Cx=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Ax=Cx;var Ox=ux({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"),Nx=function(t){function e(e){var n,i,r,a=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:(n=0,i=0,r=6,[["M",n-r,i-r],["L",n+r,i],["L",n-r,i+r],["Z"]]),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return a.playState="idle",a.contentGroup=a.appendChild(new Tl({class:Ox.contentGroup.name})),a.playWindow=a.contentGroup.appendChild(new Tl({class:Ox.playWindow.name})),a.innerCurrPage=a.defaultPage,a}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return ce(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=this.pageViews,e=(0,he.CR)(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(t.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,(0,he.ev)([],(0,he.CR)(t),!1))})),2),n=e[0],i=e[1],r=this.attributes,a=r.pageWidth,o=void 0===a?n:a,s=r.pageHeight;return{pageWidth:o,pageHeight:void 0===s?i:s}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,i=e.y,r=this.controllerShape,a=this.pageShape,o=a.pageWidth,s=a.pageHeight;return new lx(n,i,o+r.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,i=this,r=i.currPage,a=i.playState,o=i.playWindow,s=i.pageViews;if("idle"!==a||t<0||s.length<=0||t>=s.length)return null;s[r].setLocalPosition(0,0),this.prepareFollowingPage(t);var l=(0,he.CR)(this.getFollowingPageDiff(t),2),u=l[0],c=l[1];this.playState="running";var h=_x(o,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-u,", ").concat(-c,")")}],n);return xx(h,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),h},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var i=t?(n-1+e)%e:ce(n-1,0,e);return this.goTo(i)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var i=t?(n+1)%e:ce(n+1,0,e);return this.goTo(i)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,i=e.pageHeight;n&&i?(this.clipPath=t.maybeAppendByClassName(Ox.clipPath,"rect").styles({width:n,height:i}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?Vy(e):Zy(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,i=t.pageInfoGroup,r=this.attributes,a=r.orientation,o=r.controllerPadding,s=i.getBBox(),l=s.width,u=(s.height,(0,he.CR)("horizontal"===a?[-180,0]:[-90,90],2)),c=u[0],h=u[1];e.setLocalEulerAngles(c),n.setLocalEulerAngles(h);var d=e.getBBox(),f=d.width,p=d.height,g=n.getBBox(),m=g.width,v=g.height,y=Math.max(f,l,m),x="horizontal"===a?{offset:[[0,0],[f/2+o,0],[f+l+2*o,0]],textAlign:"start"}:{offset:[[y/2,-p-o],[y/2,0],[y/2,v+o]],textAlign:"center"},b=(0,he.CR)(x.offset,3),_=(0,he.CR)(b[0],2),E=_[0],w=_[1],T=(0,he.CR)(b[1],2),S=T[0],M=T[1],C=(0,he.CR)(b[2],2),A=C[0],O=C[1],N=x.textAlign,P=i.querySelector("text");P&&(P.style.textAlign=N),e.setLocalPosition(E,w),i.setLocalPosition(S,M),n.setLocalPosition(A,O)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,i=e.pageViews,r=e.attributes.formatter;i.length<2||(null===(t=this.pageInfoGroup.querySelector(Ox.pageInfo.class))||void 0===t||t.attr("text",r(n+1,i.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,i=this.pageShape,r=i.pageWidth,a=i.pageHeight,o=t<e?-1:1;return"horizontal"===n?[o*r,0]:[0,o*a]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var i=(0,he.CR)(this.getFollowingPageDiff(t),2),r=i[0],a=i[1];n[t].setLocalPosition(r,a)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,i=this.pageShape,r=i.pageWidth,a=i.pageHeight,o=this.pageViews.length>=2,s=t.maybeAppendByClassName(Ox.controller,"g");if(Wy(s.node(),o),o){var l=nx(this.attributes,"button"),u=nx(this.attributes,"pageNum"),c=(0,he.CR)(rx(l),2),h=c[0],d=c[1],f=h.size,p=(0,he._T)(h,["size"]),g=!s.select(Ox.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(Ox.prevBtnGroup,"g").styles(d);this.prevBtnGroup=m.node();var v=m.maybeAppendByClassName(Ox.prevBtn,"path"),y=s.maybeAppendByClassName(Ox.nextBtnGroup,"g").styles(d);this.nextBtnGroup=y.node(),[v,y.maybeAppendByClassName(Ox.nextBtn,"path")].forEach((function(t){t.styles((0,he.pi)((0,he.pi)({},p),{transformOrigin:"center"})),wx(t.node(),f,!0)}));var x=s.maybeAppendByClassName(Ox.pageInfoGroup,"g");this.pageInfoGroup=x.node(),x.maybeAppendByClassName(Ox.pageInfo,"text").styles(u),this.updatePageInfo(),s.node().setLocalPosition(r+n,a/2),g&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=t.x,i=void 0===n?0:n,r=t.y,a=void 0===r?0:r;this.attr("transform","translate(".concat(i,", ").concat(a,")"));var o=sx(e);this.renderClipPath(o),this.renderController(o),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=Pm((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(Ms.INSERTED,e),this.playWindow.addEventListener(Ms.REMOVED,e)},e}(Qy);function Px(t){var e=function(t){var e="default";if((0,nn.Z)(t)&&t instanceof Image)e="image";else if((0,en.Z)(t))e="symbol";else if((0,ue.Z)(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var Lx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),e.prototype.render=function(t,n){var i=t.x,r=void 0===i?0:i,a=t.y,o=void 0===a?0:a,s=this.getSubShapeStyle(t),l=s.symbol,u=s.size,c=void 0===u?16:u,h=(0,he._T)(s,["symbol","size"]),d=Px(l);hx(!!d,sx(n),(function(t){t.maybeAppendByClassName("marker",d).attr("className","marker ".concat(d,"-marker")).call((function(t){if("image"===d){var n=2*c;t.styles({img:l,width:n,height:n,x:r-c,y:o-c})}else{n=c/2;var i=(0,en.Z)(l)?l:e.getSymbol(l);t.styles((0,he.pi)({d:null==i?void 0:i(r,o,n)},h))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(Qy);Lx.registerSymbol("cross",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]})),Lx.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),Lx.registerSymbol("line",Mx),Lx.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),Lx.registerSymbol("tick",(function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]})),Lx.registerSymbol("circle",Tx),Lx.registerSymbol("point",Sx),Lx.registerSymbol("bowtie",(function(t,e,n){var i=n-1.5;return[["M",t-n,e-i],["L",t+n,e+i],["L",t+n,e-i],["L",t-n,e+i],["Z"]]})),Lx.registerSymbol("hexagon",(function(t,e,n){var i=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+i,e-n/2],["L",t+i,e+n/2],["L",t,e+n],["L",t-i,e+n/2],["L",t-i,e-n/2],["Z"]]})),Lx.registerSymbol("square",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]})),Lx.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),Lx.registerSymbol("triangle",(function(t,e,n){var i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+i],["L",t,e-i],["L",t+n,e+i],["Z"]]})),Lx.registerSymbol("triangle-down",(function(t,e,n){var i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-i],["L",t+n,e-i],["L",t,e+i],["Z"]]})),Lx.registerSymbol("line",Mx),Lx.registerSymbol("dot",Cx),Lx.registerSymbol("dash",Ax),Lx.registerSymbol("smooth",(function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]})),Lx.registerSymbol("hv",(function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]})),Lx.registerSymbol("vh",(function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]})),Lx.registerSymbol("hvh",(function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]})),Lx.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));Lx.registerSymbol("hiddenHandle",(function(t,e,n){var i=1.4*n;return[["M",t-n,e-i],["L",t+n,e-i],["L",t+n,e+i],["L",t-n,e+i],["Z"]]})),Lx.registerSymbol("verticalHandle",(function(t,e,n){var i=1.4*n,r=n/2,a=n/6,o=t+.4*i;return[["M",t,e],["L",o,e+r],["L",t+i,e+r],["L",t+i,e-r],["L",o,e-r],["Z"],["M",o,e+a],["L",t+i-2,e+a],["M",o,e-a],["L",t+i-2,e-a]]})),Lx.registerSymbol("horizontalHandle",(function(t,e,n){var i=1.4*n,r=n/2,a=n/6,o=e+.4*i;return[["M",t,e],["L",t-r,o],["L",t-r,e+i],["L",t+r,e+i],["L",t+r,o],["Z"],["M",t-a,o],["L",t-a,e+i-2],["M",t+a,o],["L",t+a,e+i-2]]}));var Rx,Dx;function kx(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}function Ix(t){var e=t.getLocalBounds(),n=e.min,i=e.max,r=(0,he.CR)([n,i],2),a=(0,he.CR)(r[0],2),o=a[0],s=a[1],l=(0,he.CR)(r[1],2),u=l[0],c=l[1];return{x:o,y:s,width:u-o,height:c-s,left:o,bottom:c,top:s,right:u}}function Bx(t,e){var n=(0,he.CR)(t,2),i=n[0],r=n[1],a=(0,he.CR)(e,2),o=a[0],s=a[1];return i!==o&&r===s}function Fx(t){return"function"==typeof t?t():(0,ue.Z)(t)||(0,oe.Z)(t)?new ax({style:{text:String(t)}}):t}var zx=mv((function(t,e){var n=e.fontSize,i=e.fontFamily,r=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return Dx?Dx(t,n):(Rx||(Rx=ol.offscreenCanvasCreator.getOrCreateContext(void 0)),Rx.font=[a,o,r,"".concat(n,"px"),i].join(" "),Rx.measureText(t).width)}),(function(t,e){return[t,Object.values(e||Gx(t)).join()].join("")}),4096),Gx=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",i=t.style.fontStyle||"normal",r=t.style.fontVariant,a=t.style.fontSize;return{fontSize:a="object"==typeof a?a.value:a,fontFamily:e,fontWeight:n,fontStyle:i,fontVariant:r}};function jx(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Ux(t,e){var n=jx(t);n&&n.attr(e)}function Hx(t,e,n){void 0===n&&(n="..."),Ux(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}var Vx=ux({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var Zx=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new bl({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,i=t.node().getBBox(),r=i.width,a=i.height,o=e.node().getBBox(),s=o.width,l=o.height;return{markerWidth:n,labelWidth:r,valueWidth:s,height:Math.max(n,a,l)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=(0,he.CR)(cx(t),2),n=e[0],i=e[1],r=this.showValue?i:0,a=n+r;return[n/a,r/a]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,i=e.width,r=this.actualSpace,a=r.markerWidth,o=r.height,s=this.actualSpace,l=s.labelWidth,u=s.valueWidth,c=(0,he.CR)(this.spacing,2),h=c[0],d=c[1];if(i){var f=i-n-h-d,p=(0,he.CR)(this.span,2),g=p[0],m=p[1];l=(t=(0,he.CR)([g*f,m*f],2))[0],u=t[1]}return{width:a+l+u+h+d,height:o,markerWidth:a,labelWidth:l,valueWidth:u}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=(0,he.CR)(cx(t),2),n=e[0],i=e[1];return this.showValue?[n,i]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,i=t.valueWidth,r=t.width,a=t.height,o=(0,he.CR)(this.spacing,2),s=o[0];return{height:a,width:r,markerWidth:e,labelWidth:n,valueWidth:i,position:[e/2,e+s,e+n+s+o[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(Vx.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,i=e.markerStrokeWidth,r=void 0===i?t.strokeWidth:i,a=e.markerLineWidth,o=void 0===a?t.lineWidth:a,s=e.markerStroke,l=void 0===s?t.stroke:s,u=+(r||o||(l?1:0))*Math.sqrt(2),c=this.markerGroup.node().getBBox(),h=c.width,d=c.height;return(1-u/Math.max(h,d))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,i=nx(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Vx.markerGroup,"g").style("zIndex",0),hx(!!n,this.markerGroup,(function(){var t,r=e.markerGroup.node(),a=null===(t=r.childNodes)||void 0===t?void 0:t[0],o="string"==typeof n?new Lx({style:{symbol:n},className:Vx.marker.name}):n();a?o.nodeName===a.nodeName?a instanceof Lx?a.update((0,he.pi)((0,he.pi)({},i),{symbol:n})):(!function(t,e){var n,i,r=e.attributes;try{for(var a=(0,he.XA)(Object.entries(r)),o=a.next();!o.done;o=a.next()){var s=(0,he.CR)(o.value,2),l=s[0],u=s[1];"id"!==l&&"className"!==l&&t.attr(l,u)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}(a,o),sx(a).styles(i)):(a.remove(),sx(o).attr("className",Vx.marker.name).styles(i),r.appendChild(o)):(o instanceof Lx||sx(o).attr("className",Vx.marker.name).styles(i),r.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=wx(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")}))},e.prototype.renderLabel=function(t){var e=nx(this.attributes,"label"),n=e.text,i=(0,he._T)(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Vx.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Vx.label,(function(){return Fx(n)})).styles(i)},e.prototype.renderValue=function(t){var e=this,n=nx(this.attributes,"value"),i=n.text,r=(0,he._T)(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Vx.valueGroup,"g").style("zIndex",0),hx(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(Vx.value,(function(){return Fx(i)})).styles(r)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,i=e.height,r=nx(this.attributes,"background");this.background=t.maybeAppendByClassName(Vx.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Vx.background,"rect").styles((0,he.pi)({width:n,height:i},r))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,i=t.height,r=(0,he.CR)(t.position,3),a=r[0],o=r[1],s=r[2],l=i/2;this.markerGroup.styles({transform:"translate(".concat(a,", ").concat(l,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(o,", ").concat(l,")")}),Hx(this.labelGroup.select(Vx.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(l,")")}),Hx(this.valueGroup.select(Vx.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=sx(e),i=t.x,r=void 0===i?0:i,a=t.y,o=void 0===a?0:a;n.styles({transform:"translate(".concat(r,", ").concat(o,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(Qy),Wx=ux({page:"item-page",navigator:"navigator",item:"item"},"items"),Xx=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Yx=function(t){function e(e){var n=t.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:mx,mouseenter:mx,mouseleave:mx})||this;return n.navigatorShape=[0,0],n}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,i=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,i.length]:[i.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,i=nx(this.attributes,"item"),r=e.map((function(t,r){var a=t.id,o=void 0===a?r:a,s=t.label,l=t.value;return{id:"".concat(o),index:r,style:(0,he.pi)({layout:n,labelText:s,valueText:l},Object.fromEntries(Object.entries(i).map((function(n){var i=(0,he.CR)(n,2);return[i[0],vx(i[1],[t,r,e])]}))))}}));return r},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,i=e.width,r=e.rowPadding,a=e.colPadding,o=(0,he.CR)(this.navigatorShape,1)[0],s=(0,he.CR)(this.grid,2),l=s[0],u=s[1],c=u*l,h=0;return this.pageViews.children.map((function(e,s){var d,f,p=Math.floor(s/c),g=s%c,m=t.ifHorizontal(u,l),v=[Math.floor(g/m),g%m];"vertical"===n&&v.reverse();var y=(0,he.CR)(v,2),x=y[0],b=y[1],_=(i-o-(u-1)*a)/u,E=e.getBBox().height,w=(0,he.CR)([0,0],2),T=w[0],S=w[1];return"horizontal"===n?(T=(d=(0,he.CR)([h,x*(E+r)],2))[0],S=d[1],h=b===u-1?0:h+_+a):(T=(f=(0,he.CR)([b*(_+a),h],2))[0],S=f[1],h=x===l-1?0:h+E+r),{page:p,index:s,row:x,col:b,pageIndex:g,width:_,height:E,x:T,y:S}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,i=t.rowPadding,r=t.colPadding,a=(0,he.CR)(this.navigatorShape,1)[0],o=(0,he.CR)(this.grid,2),s=o[0],l=o[1],u=(0,he.CR)([e-a,n],2),c=u[0],h=u[1],d=(0,he.CR)([0,0,0,0,0,0,0,0],8),f=d[0],p=d[1],g=d[2],m=d[3],v=d[4],y=d[5],x=d[6],b=d[7];return this.pageViews.children.map((function(t,e){var n,a,o,u,d=t.getBBox(),_=d.width,E=d.height,w=0===x?0:r,T=x+w+_;return T<=c&&Xx(v,(function(t){return t<l}))?(n=(0,he.CR)([x+w,b,T],3),f=n[0],p=n[1],x=n[2],{width:_,height:E,x:f,y:p,page:g,index:e,pageIndex:m++,row:y,col:v++}):(a=(0,he.CR)([y+1,0,0,b+E+i],4),y=a[0],v=a[1],x=a[2],(b=a[3])+E<=h&&Xx(y,(function(t){return t<s}))?(o=(0,he.CR)([x,b,_],3),f=o[0],p=o[1],x=o[2],{width:_,height:E,x:f,y:p,page:g,index:e,pageIndex:m++,row:y,col:v++}):(u=(0,he.CR)([0,0,_,0,g+1,0,0,0],8),f=u[0],p=u[1],x=u[2],b=u[3],g=u[4],m=u[5],y=u[6],v=u[7],{width:_,height:E,x:f,y:p,page:g,index:e,pageIndex:m++,row:y,col:v++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return kx(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Wx.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Wx.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,i=e.mouseenter,r=e.mouseleave;this.flattenPage(t);var a=this.dispatchCustomEvent.bind(this);sx(t).selectAll(Wx.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Zx({style:e})})).attr("className",Wx.item.name).on("click",(function(){null==n||n(this),a("itemClick",{item:this})})).on("pointerenter",(function(){null==i||i(this),a("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==r||r(this),a("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,i=e.width,r=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,a=(0,he.CR)(this.navigatorShape,2),o=a[0],s=a[1];this.navigator.update("grid"===n?{pageWidth:i-o,pageHeight:r-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,i=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=(0,he.CR)(t,2);return{page:e[0],layouts:e[1]}})),r=(0,he.ev)([],(0,he.CR)(this.navigator.getContainer().children),!1);i.forEach((function(t){var e=t.layouts,i=n.pageViews.appendChild(new Tl({className:Wx.page.name}));e.forEach((function(t){var e=t.x,n=t.y,a=t.index,o=t.width,s=t.height,l=r[a];i.appendChild(l),Xd(l,"__layout__",t),l.update({x:e,y:n,width:o,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=nx(this.attributes,"nav"),i=Yy({orientation:e},n),r=this;return t.selectAll(Wx.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new Nx({style:i})})).attr("className",Wx.navigator.name).each((function(){r.navigator=this}))}),(function(t){return t.each((function(){this.update(i)}))}),(function(t){return t.remove()})),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var i=this.renderNavigator(sx(e));this.renderItems(i.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new ms(t,{detail:e});this.dispatchEvent(n)},e}(Qy),qx=ux({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),$x={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},Kx=(function(t){function e(e){return t.call(this,e,$x)||this}(0,he.ZT)(e,t),e.prototype.render=function(t,e){var n=sx(e).maybeAppendByClassName(qx.markerGroup,"g");this.renderMarker(n);var i=sx(e).maybeAppendByClassName(qx.labelGroup,"g");this.renderLabel(i)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,i=n.orientation,r=n.markerSymbol,a=void 0===r?kx(i,"horizontalHandle","verticalHandle"):r;hx(!!a,t,(function(t){var n=nx(e.attributes,"marker"),i=(0,he.pi)({symbol:a},n);e.marker=t.maybeAppendByClassName(qx.marker,(function(){return new Lx({style:i})})).update(i)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,i=n.showLabel,r=n.orientation,a=n.spacing,o=void 0===a?0:a,s=n.formatter;hx(i,t,(function(t){var n,i=nx(e.attributes,"label"),a=i.text,l=(0,he._T)(i,["text"]),u=(null===(n=t.select(qx.marker.class))||void 0===n?void 0:n.node().getBBox())||{},c=u.width,h=void 0===c?0:c,d=u.height,f=void 0===d?0:d,p=(0,he.CR)(kx(r,[0,f+o,"center","top"],[h+o,0,"start","middle"]),4),g=p[0],m=p[1],v=p[2],y=p[3];t.maybeAppendByClassName(qx.label,"text").styles((0,he.pi)((0,he.pi)({},l),{x:g,y:m,text:s(a).toString(),textAlign:v,textBaseline:y}))}))}}(Qy),{showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12}),Qx=Yy({},Kx,{}),Jx=(Yy({},Kx,ix($x,"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"}),ux({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")),tb=function(t){function e(e){return t.call(this,e,Qx)||this}return(0,he.ZT)(e,t),e.prototype.renderTitle=function(t,e,n){var i=this.attributes,r=i.showTitle,a=i.titleText,o=nx(this.attributes,"title"),s=(0,he.CR)(rx(o),2),l=s[0],u=s[1];this.titleGroup=t.maybeAppendByClassName(Jx.titleGroup,"g").styles(u);var c=(0,he.pi)((0,he.pi)({width:e,height:n},l),{text:r?a:""});this.title=this.titleGroup.maybeAppendByClassName(Jx.title,(function(){return new gx({style:c})})).update(c)},e.prototype.renderItems=function(t,e){var n=e.x,i=e.y,r=e.width,a=e.height,o=nx(this.attributes,"title",!0),s=(0,he.CR)(rx(o),2),l=s[0],u=s[1],c=(0,he.pi)((0,he.pi)({},l),{width:r,height:a,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Jx.itemsGroup,"g").styles((0,he.pi)((0,he.pi)({},u),{transform:"translate(".concat(n,", ").concat(i,")")}));var h=this;this.itemsGroup.selectAll(Jx.items.class).data(["items"]).join((function(t){return t.append((function(){return new Yx({style:c})})).attr("className",Jx.items.name).each((function(){h.items=sx(this)}))}),(function(t){return t.update(c)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,i=t.height;return e?this.title.node().getAvailableSpace():new lx(0,0,n,i)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,i=null===(e=this.title)||void 0===e?void 0:e.node(),r=null===(n=this.items)||void 0===n?void 0:n.node();return i&&r?function(t,e){var n=t.attributes,i=n.position,r=n.spacing,a=n.inset,o=n.text,s=t.getBBox(),l=e.getBBox(),u=fx(i),c=(0,he.CR)(cx(o?r:0),4),h=c[0],d=c[1],f=c[2],p=c[3],g=(0,he.CR)(cx(a),4),m=g[0],v=g[1],y=g[2],x=g[3],b=(0,he.CR)([p+d,h+f],2),_=b[0],E=b[1],w=(0,he.CR)([x+v,m+y],2),T=w[0],S=w[1];if("l"===u[0])return new lx(s.x,s.y,l.width+s.width+_+T,Math.max(l.height+S,s.height));if("t"===u[0])return new lx(s.x,s.y,Math.max(l.width+T,s.width),l.height+s.height+E+S);var M=(0,he.CR)([e.attributes.width||l.width,e.attributes.height||l.height],2),C=M[0],A=M[1];return new lx(l.x,l.y,C+s.width+_+T,A+s.height+E+S)}(i,r):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,i=n.width,r=n.height,a=n.x,o=void 0===a?0:a,s=n.y,l=void 0===s?0:s,u=sx(e);e.style.transform="translate(".concat(o,", ").concat(l,")"),this.renderTitle(u,i,r),this.renderItems(u,this.availableSpace),this.adjustLayout()},e}(Qy);function eb(t){const{width:e,height:n,renderer:i,containerStyle:r}=t,a=function(t){var e;const{container:n,className:i,graphCanvas:r}=t;if(n)return"string"==typeof n?document.getElementById(n):n;const a=Ev(i,!1);return null===(e=r.getContainer())||void 0===e||e.appendChild(a),a}(t),[o,s]=function(t){const{width:e,height:n,placement:i,graphCanvas:r}=t,[a,o]=r.getSize(),[s,l]=md(i);return[s*(a-e),l*(o-n)]}(t);Object.assign(a.style,Object.assign({position:"absolute",left:o+"px",top:s+"px",width:e+"px",height:n+"px"},r));return[a,new Ql({width:e,height:n,container:a,renderer:i||new rg})]}var nb=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class ib extends _v{constructor(t,e){super(t,Object.assign({},ib.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:t}=this.context;t.on(dc.AFTER_DRAW,this.createElement)},this.changeState=(t,e)=>{const{graph:n}=this.context,{typePrefix:i}=this,r=Wd(t,[i,"id"]),a=Wd(t,[i,"style","labelText"]),[o]=r.split("__"),s=this.fieldMap[o].get(a)||[];n.setElementState(Object.fromEntries(null==s?void 0:s.map((t=>[t,e]))))},this.click=t=>{if("hover"===this.options.trigger)return;const e=Wd(t,[this.typePrefix,"id"]);this.selectedItems.includes(e)?(this.selectedItems=this.selectedItems.filter((t=>t!==e)),this.changeState(t,[])):(this.selectedItems.push(e),this.changeState(t,"selected"))},this.mouseleave=t=>{"click"!==this.options.trigger&&(this.selectedItems=[],this.changeState(t,[]))},this.mouseenter=t=>{if("click"===this.options.trigger)return;const e=Wd(t,[this.typePrefix,"id"]);this.selectedItems.includes(e)?this.selectedItems=this.selectedItems.filter((t=>t!==e)):(this.selectedItems.push(e),this.changeState(t,"active"))},this.setFieldMap=(t,e,n)=>{if(!t)return;const i=this.fieldMap[n];if(i)if(i.has(t)){const n=i.get(t);n&&(n.push(e),i.set(t,n))}else i.set(t,[e])},this.getEvents=()=>({mouseenter:this.mouseenter,mouseleave:this.mouseleave,click:this.click}),this.getMarkerData=(t,e)=>{if(!t)return[];const{model:n,element:i}=this.context,{nodes:r,edges:a,combos:o}=n.getData(),s={},l=e=>(0,en.Z)(t)?t(e):t,u={node:"circle",edge:"line",combo:"rect"},c={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"},h=(t,e)=>{t.forEach((t=>{const{id:n}=t,r=Wd(t,["data",l(t)]),a=(null==i?void 0:i.getElementType(e,t))||"circle",o=((t,e)=>null==i?void 0:i.getElementComputedStyle(t,e))(e,t),h=("edge"===e?null==o?void 0:o.stroke:null==o?void 0:o.fill)||"#1783ff";n&&r&&r.replace(/\s+/g,"")&&(this.setFieldMap(r,n,e),s[r]||(s[r]={id:`${e}__${n}`,label:r,marker:c[a]||u[e],elementType:e,lineWidth:1,stroke:h,fill:h}))}))};switch(e){case"node":h(r,"node");break;case"edge":h(a,"edge");break;case"combo":h(o,"combo");break;default:return[]}return Object.values(s)},this.createElement=()=>{if(this.draw)return void this.updateElement();const t=this.options,{width:e,height:n,nodeField:i,edgeField:r,comboField:a,trigger:o,position:s,container:l,containerStyle:u,className:c}=t,h=nb(t,["width","height","nodeField","edgeField","comboField","trigger","position","container","containerStyle","className"]),d=this.getMarkerData(i,"node"),f=this.getMarkerData(r,"edge"),p=this.getMarkerData(a,"combo"),g=[...d,...p,...f],m=Object.assign({width:e,height:n,data:g,itemMarkerLineWidth:({lineWidth:t})=>t,itemMarker:({marker:t})=>t,itemMarkerStroke:({stroke:t})=>t,itemMarkerFill:({fill:t})=>t,gridCol:d.length},h,this.getEvents()),v=new tb({className:"legend",style:m});this.category=v;this.upsertCanvas().appendChild(v),this.draw=!0},this.bindEvents()}update(t){super.update(t),this.clear(),this.createElement()}clear(){var t,e;null===(t=this.canvas)||void 0===t||t.destroy(),null===(e=this.container)||void 0===e||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,n]=t.getSize(),{width:i=e,height:r=n,position:a,container:o,containerStyle:s,className:l}=this.options,[u,c]=eb({width:i,height:r,graphCanvas:t,container:o,containerStyle:s,placement:a,className:"legend"});return this.container=u,l&&u.classList.add(l),this.canvas=c,this.canvas}destroy(){this.clear(),this.context.graph.off(dc.AFTER_DRAW,this.createElement),super.destroy()}}ib.defaultOptions={position:"bottom",trigger:"hover",orientation:"horizontal",layout:"flex",itemSpacing:4,rowPadding:10,colPadding:10,itemMarkerSize:16,itemLabelFontSize:16,width:240,height:160};class rb extends _v{constructor(t,e){super(t,Object.assign({},rb.defaultOptions,e)),this.onDraw=t=>{var e;(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.render)||this.onRender()},this.shapes=new Map,this.landmarkMap=new Map,this.mask=null,this.isMaskDragging=!1,this.onMaskDragStart=t=>{this.mask&&(this.isMaskDragging=!0,this.mask.setPointerCapture(t.pointerId),this.mask.addEventListener("pointermove",this.onMaskDrag),this.mask.addEventListener("pointerup",this.onMaskDragEnd),this.mask.addEventListener("pointercancel",this.onMaskDragEnd))},this.onMaskDrag=t=>{if(!this.mask||!this.isMaskDragging)return;const{size:[e,n]}=this.options,{movementX:i,movementY:r}=t,{left:a,top:o,width:s,height:l}=this.mask.style,[,,u,c]=this.maskBBox;let h=parseInt(a)+i,d=parseInt(o)+r,f=parseInt(s),p=parseInt(l);h<0&&(h=0),d<0&&(d=0),h+f>e&&(h=ob(e-f,0)),d+p>n&&(d=ob(n-p,0)),f<u&&(i>0?(h=ob(h-i,0),f=ab(f+i,e)):i<0&&(f=ab(f-i,e))),p<c&&(r>0?(d=ob(d-r,0),p=ab(p+r,n)):r<0&&(p=ab(p-r,n))),Object.assign(this.mask.style,{left:h+"px",top:d+"px",width:f+"px",height:p+"px"});const g=parseInt(a)-h,m=parseInt(o)-d;if(0===g&&0===m)return;const v=this.context.canvas.getCamera().getZoom()/this.canvas.getCamera().getZoom();this.context.graph.translateBy([g*v,m*v],!1)},this.onMaskDragEnd=t=>{this.mask&&(this.isMaskDragging=!1,this.mask.releasePointerCapture(t.pointerId),this.mask.removeEventListener("pointermove",this.onMaskDrag),this.mask.removeEventListener("pointerup",this.onMaskDragEnd),this.mask.removeEventListener("pointercancel",this.onMaskDragEnd))},this.onTransform=zc((()=>{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=Pm((()=>{this.renderMinimap(),this.renderMask()}),this.options.delay,!0)}bindEvents(){const{graph:t}=this.context;t.on(dc.AFTER_DRAW,this.onDraw),t.on(dc.AFTER_RENDER,this.onRender),t.on(dc.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(dc.AFTER_DRAW,this.onDraw),t.off(dc.AFTER_RENDER,this.onRender),t.off(dc.AFTER_TRANSFORM,this.onTransform)}renderMinimap(){const t=this.getElements(),e=this.initCanvas();this.setShapes(e,t)}getElements(){const{filter:t}=this.options,{model:e}=this.context,n=e.getData();if(!t)return n;const{nodes:i,edges:r,combos:a}=n;return{nodes:i.filter((e=>t(kh(e),"node"))),edges:r.filter((e=>t(kh(e),"edge"))),combos:a.filter((e=>t(kh(e),"combo")))}}setShapes(t,e){const{nodes:n,edges:i,combos:r}=e,{shape:a}=this.options,{element:o}=this.context;if("key"===a){const e=new Set,a=n=>{const i=kh(n);e.add(i);const r=o.getElement(i);if(!r)return;const a=r.getShape("key"),s=this.shapes.get(i)||a.cloneNode();s.setPosition(a.getPosition()),r.style.zIndex&&(s.style.zIndex=r.style.zIndex),s.id=r.id,this.shapes.has(i)?Object.entries(a.attributes).forEach((([t,e])=>{s.style[t]!==e&&(s.style[t]=e)})):(t.appendChild(s),this.shapes.set(i,s))};return i.forEach(a),r.forEach(a),n.forEach(a),void this.shapes.forEach(((n,i)=>{e.has(i)||(t.removeChild(n),this.shapes.delete(i))}))}const s=(t,e)=>{const n=o.getElement(t).getPosition();return e.setPosition(n),e};t.removeChildren(),i.forEach((e=>t.appendChild(a(kh(e),"edge")))),r.forEach((e=>{t.appendChild(s(kh(e),a(kh(e),"combo")))})),n.forEach((e=>{t.appendChild(s(kh(e),a(kh(e),"node")))}))}initCanvas(){const{renderer:t,size:[e,n]}=this.options;if(this.canvas){const{width:i,height:r}=this.canvas.getConfig();e===i&&n===r||this.canvas.resize(e,n),t&&this.canvas.setRenderer(t)}else{const{className:i,position:r,container:a,containerStyle:o}=this.options,[s,l]=eb({renderer:t,width:e,height:n,placement:r,className:"minimap",container:a,containerStyle:o,graphCanvas:this.context.canvas});i&&s.classList.add(i),this.container=s,this.canvas=l}return this.setCamera(),this.canvas}createLandmark(t,e,n){const i=`${t.join(",")}-${e.join(",")}-${n}`;if(this.landmarkMap.has(i))return this.landmarkMap.get(i);const r=this.canvas.getCamera().createLandmark(i,{position:t,focalPoint:e,zoom:n});return this.landmarkMap.set(i,r),r}setCamera(){var t;const{canvas:e}=this.context,n=null===(t=this.canvas)||void 0===t?void 0:t.getCamera();if(!n)return;const{size:[i,r],padding:a}=this.options,[o,s,l,u]=Hc(a),{min:c,max:h,center:d}=e.getBounds("elements"),f=(i-u-s)/(h[0]-c[0]),p=(r-o-l)/(h[1]-c[1]),g=Math.min(f,p),m=this.createLandmark(d,d,g);n.gotoLandmark(m,0)}get maskBBox(){const{canvas:t}=this.context,e=t.getSize(),n=t.getCanvasByViewport([0,0]),i=t.getCanvasByViewport(e),r=this.canvas.canvas2Viewport(Ed(n)),a=this.canvas.canvas2Viewport(Ed(i)),o=a.x-r.x,s=a.y-r.y;return[r.x,r.y,o,s]}calculateMaskBBox(){const{size:[t,e]}=this.options;let[n,i,r,a]=this.maskBBox;return n<0&&(r=ab(r+n,t),n=0),i<0&&(a=ab(a+i,e),i=0),n+r>t&&(r=ob(t-n,0)),i+a>e&&(a=ob(e-i,0)),[ab(n,t),ab(i,e),ob(r,0),ob(a,0)]}renderMask(){const{maskStyle:t}=this.options;this.mask||(this.mask=document.createElement("div"),this.mask.addEventListener("pointerdown",this.onMaskDragStart)),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,n,i]=this.calculateMaskBBox();Object.assign(this.mask.style,{top:e+"px",left:t+"px",width:n+"px",height:i+"px"})}destroy(){var t;this.unbindEvents(),this.canvas.destroy(),null===(t=this.mask)||void 0===t||t.remove(),super.destroy()}}rb.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 ab=(t,e)=>Math.min(t,e),ob=(t,e)=>Math.max(t,e);var sb=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};const lb={x1:0,y1:0,x2:0,y2:0,visibility:"hidden"};class ub extends _v{constructor(t,e){super(t,Object.assign({},ub.defaultOptions,e)),this.initSnapline=()=>{const t=this.context.canvas.getLayer("transient");this.horizontalLine||(this.horizontalLine=t.appendChild(new Ol({style:Object.assign(Object.assign({},lb),this.options.horizontalLineStyle)}))),this.verticalLine||(this.verticalLine=t.appendChild(new Ol({style:Object.assign(Object.assign({},lb),this.options.verticalLineStyle)})))},this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!0,this.autoSnapToLine=(t,e,n)=>sb(this,void 0,void 0,(function*(){const{verticalX:i,horizontalY:r}=n,{tolerance:a}=this.options,{min:[o,s],max:[l,u],center:[c,h]}=e;let d=0,f=0;null!==i&&(cb(l,i)<a&&(d=i-l),cb(o,i)<a&&(d=i-o),cb(c,i)<a&&(d=i-c),0!==d&&(this.isVerticalSticking=!0)),null!==r&&(cb(u,r)<a&&(f=r-u),cb(s,r)<a&&(f=r-s),cb(h,r)<a&&(f=r-h),0!==f&&(this.isHorizontalSticking=!0)),0===d&&0===f||(yield this.context.graph.translateElementBy({[t]:[d,f]},!1))})),this.enableSnap=t=>{const{target:e}=t,n=.5;if(this.isHorizontalSticking||this.isVerticalSticking){const[i,r]=this.getDelta(t);if(this.isHorizontalSticking&&this.isVerticalSticking&&Math.abs(i)<=n&&Math.abs(r)<=n)return this.context.graph.translateElementBy({[e.id]:[-i,-r]},!1),!1;if(this.isHorizontalSticking&&Math.abs(r)<=n)return this.context.graph.translateElementBy({[e.id]:[0,-r]},!1),!1;if(this.isVerticalSticking&&Math.abs(i)<=n)return this.context.graph.translateElementBy({[e.id]:[-i,0]},!1),!1;this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!1,setTimeout((()=>{this.enableStick=!0}),200)}return this.enableStick},this.calcSnaplineMetadata=(t,e)=>{const{tolerance:n,shape:i}=this.options,{min:[r,a],max:[o,s],center:[l,u]}=e;let c=null,h=null,d=null,f=null,p=null,g=null;return this.getNodes().some((e=>{if(nc(t.id,e.id))return!1;const m=hb(e,i).getRenderBounds(),{min:[v,y],max:[x,b],center:[_,E]}=m;return null===c&&(cb(_,l)<n?c=_:cb(v,r)<n||cb(v,o)<n?c=v:(cb(x,o)<n||cb(x,r)<n)&&(c=x),null!==c&&(h=Math.min(y,a),d=Math.max(b,s))),null===f&&(cb(E,u)<n?f=E:cb(y,a)<n||cb(y,s)<n?f=y:(cb(b,s)<n||cb(b,a)<n)&&(f=b),null!==f&&(p=Math.min(v,r),g=Math.max(x,o))),null!==c&&null!==f})),{verticalX:c,verticalMinY:h,verticalMaxY:d,horizontalY:f,horizontalMinX:p,horizontalMaxX:g}},this.onDragStart=()=>{this.initSnapline()},this.onDrag=t=>sb(this,void 0,void 0,(function*(){const{target:e}=t;if(this.options.autoSnap){if(!this.enableSnap(t))return}const n=hb(e,this.options.shape).getRenderBounds(),i=this.calcSnaplineMetadata(e,n);this.hideSnapline(),null===i.verticalX&&null===i.horizontalY||this.updateSnapline(i),this.options.autoSnap&&(yield this.autoSnapToLine(e.id,n,i))})),this.onDragEnd=()=>{this.hideSnapline()},this.bindEvents()}getNodes(){var t;const{filter:e}=this.options,n=((null===(t=this.context.element)||void 0===t?void 0:t.getNodes())||[]).filter((t=>{var e;return"hidden"!==Wd(t,["style","visibility"])&&(null===(e=this.context.viewport)||void 0===e?void 0:e.isInViewport(t.getRenderBounds()))}));return e?n.filter((t=>e(t))):n}hideSnapline(){this.horizontalLine.style.visibility="hidden",this.verticalLine.style.visibility="hidden"}getLineWidth(t){const{lineWidth:e}=this.options[`${t}LineStyle`];return+(e||lb.lineWidth||1)/this.context.graph.getZoom()}updateSnapline(t){const{verticalX:e,verticalMinY:n,verticalMaxY:i,horizontalY:r,horizontalMinX:a,horizontalMaxX:o}=t,[s,l]=this.context.canvas.getSize(),{offset:u}=this.options;null!==r?Object.assign(this.horizontalLine.style,{x1:u===1/0?0:a-u,y1:r,x2:u===1/0?s:o+u,y2:r,visibility:"visible",lineWidth:this.getLineWidth("horizontal")}):this.horizontalLine.style.visibility="hidden",null!==e?Object.assign(this.verticalLine.style,{x1:e,y1:u===1/0?0:n-u,x2:e,y2:u===1/0?l:i+u,visibility:"visible",lineWidth:this.getLineWidth("vertical")}):this.verticalLine.style.visibility="hidden"}getDelta(t){const e=this.context.graph.getZoom();return rd([t.dx,t.dy],e)}bindEvents(){return sb(this,void 0,void 0,(function*(){const{graph:t}=this.context;t.on(pc.DRAG_START,this.onDragStart),t.on(pc.DRAG,this.onDrag),t.on(pc.DRAG_END,this.onDragEnd)}))}unbindEvents(){const{graph:t}=this.context;t.off(pc.DRAG_START,this.onDragStart),t.off(pc.DRAG,this.onDrag),t.off(pc.DRAG_END,this.onDragEnd)}destroyElements(){var t,e;null===(t=this.horizontalLine)||void 0===t||t.destroy(),null===(e=this.verticalLine)||void 0===e||e.destroy()}destroy(){this.destroyElements(),this.unbindEvents(),super.destroy()}}ub.defaultOptions={tolerance:5,offset:20,autoSnap:!0,shape:"key",verticalLineStyle:{stroke:"#1783FF"},horizontalLineStyle:{stroke:"#1783FF"},filter:()=>!0};const cb=(t,e)=>Math.abs(t-e),hb=(t,e)=>"function"==typeof e?e(t):t.getShape(e);function db(t,e){var n={YYYY:t.getFullYear(),MM:t.getMonth()+1,DD:t.getDate(),HH:t.getHours(),mm:t.getMinutes(),ss:t.getSeconds()},i=e;return Object.keys(n).forEach((function(t){var e=n[t];i=i.replace(t,"YYYY"===t?"".concat(e):"".concat(e).padStart(2,"0"))})),i}var fb={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 Pl({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:[]},pb=((0,Jh.Z)({},fb,{style:{type:"arc"}}),(0,Jh.Z)({},fb,{style:{}}),ux({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 gb(t,e){return[t[0]*e,t[1]*e]}function mb(t,e){return[t[0]+e[0],t[1]+e[1]]}function vb(t,e){return[t[0]-e[0],t[1]-e[1]]}function yb(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function xb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function bb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function _b(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function Eb(t){return t*Math.PI/180}function wb(t){return Number((180*t/Math.PI).toPrecision(5))}function Tb(t,e){return t.style.opacity||(t.style.opacity=1),Ex(t,{opacity:0},e)}var Sb=["$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 Mb(t){return Sb.includes(t)}function Cb(t){var e={};for(var n in t)Mb(n)&&(e[n]=t[n]);return e}var Ab=ux({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Ob(t){return t.reduce((function(t,e,n){return t.push((0,he.ev)([0===n?"M":"L"],(0,he.CR)(e),!1)),t}),[])}function Nb(t,e,n){return"surround"===e.type?function(t,e,n){var i=e.connect,r=void 0===i?"line":i,a=e.center;if("line"===r)return Ob(t);if(!a)return[];var o=bb(t[0],a),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push((0,he.ev)(["M"],(0,he.CR)(e),!1)):t.push((0,he.ev)(["A",o,o,0,0,s],(0,he.CR)(e),!1)),t}),[])}(t,e,n):Ob(t)}function Pb(t,e,n){var i=n.type,r=n.connect,a=n.center,o=n.closed?[["Z"]]:[],s=(0,he.CR)([Nb(t,n),Nb(e.slice().reverse(),n,!0)],2),l=s[0],u=s[1],c=(0,he.CR)([t[0],e.slice(-1)[0]],2),h=c[0],d=c[1],f=function(t,e){return[l,t,u,e,o].flat()};if("line"===r||"surround"===i)return f([(0,he.ev)(["L"],(0,he.CR)(d),!1)],[(0,he.ev)(["L"],(0,he.CR)(h),!1)]);if(!a)throw new Error("Arc grid need to specified center");var p=(0,he.CR)([bb(d,a),bb(h,a)],2),g=p[0],m=p[1];return f([(0,he.ev)(["A",g,g,0,0,1],(0,he.CR)(d),!1),(0,he.ev)(["L"],(0,he.CR)(d),!1)],[(0,he.ev)(["A",m,m,0,0,0],(0,he.CR)(h),!1),(0,he.ev)(["L"],(0,he.CR)(h),!1)])}var Lb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),e.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n=(0,he._T)(t,["type","center","areaFill","closed"]),i=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=(0,he.CR)(e,1)[0];return(0,he.pi)((0,he.pi)({},t),{points:(0,he.ev)((0,he.ev)([],(0,he.CR)(e),!1),[n],!1)})})):n}(t),r=sx(e).maybeAppendByClassName(Ab.lineGroup,"g"),a=sx(e).maybeAppendByClassName(Ab.regionGroup,"g"),o=function(t,e,n,i){var r=n.animate,a=n.isBillboard,o=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),d:Nb(t.points,n)}}));return t.selectAll(Ab.line.class).data(o,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=vx(Cb((0,he.pi)({d:t.d},i)),[t,e,o]);this.attr((0,he.pi)({class:Ab.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},n))}))}),(function(t){return t.transition((function(t,e){return Ex(this,vx(Cb((0,he.pi)({d:t.d},i)),[t,e,o]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Tb(this,r.exit);return xx(e,(function(){return t.remove()})),e}))})).transitions()}(r,i,t,n),s=function(t,e,n){var i=n.animate,r=n.connect,a=n.areaFill;if(e.length<2||!a||!r)return[];for(var o=Array.isArray(a)?a:[a,"transparent"],s=function(t){return o[t%o.length]},l=[],u=0;u<e.length-1;u++){var c=(0,he.CR)([e[u].points,e[u+1].points],2),h=Pb(c[0],c[1],n);l.push({d:h,fill:s(u)})}return t.selectAll(Ab.region.class).data(l,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=vx(t,[t,e,l]);this.attr(n)})).attr("className",Ab.region.name)}),(function(t){return t.transition((function(t,e){return Ex(this,vx(t,[t,e,l]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=Tb(this,i.exit);return xx(e,(function(){return t.remove()})),e}))})).transitions()}(a,i,t);return(0,he.ev)((0,he.ev)([],(0,he.CR)(o),!1),(0,he.CR)(s),!1)},e}(Qy);function Rb(t,e){return"number"==typeof t&&"number"==typeof e?function(t,e){return function(n){return t*(1-n)+e*n}}(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,i=t?Math.min(n,t.length):0;return function(r){var a=new Array(i),o=new Array(n),s=0;for(s=0;s<i;++s)a[s]=Rb(t[s],e[s]);for(;s<n;++s)o[s]=e[s];for(s=0;s<i;++s)o[s]=a[s](r);return o}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},i={};return Object.entries(e).forEach((function(e){var r=(0,he.CR)(e,2),a=r[0],o=r[1];a in t?n[a]=Rb(t[a],o):i[a]=o})),function(t){return Object.entries(n).forEach((function(e){var n=(0,he.CR)(e,2),r=n[0],a=n[1];return i[r]=a(t)})),i}}(t,e):function(e){return t}}function Db(t,e){var n={},i=Array.isArray(e)?e:[e];for(var r in t)i.includes(r)||(n[r]=t[r]);return n}function kb(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=(0,he.CR)(t,2);return[n[0],vx(n[1],e)]})))}function Ib(t,e){return e&&(0,en.Z)(e)?t.filter(e):t}function Bb(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Fb(t,e){if("linear"===e.type){var n=(0,he.CR)(e.startPos,2),i=n[0],r=n[1],a=(0,he.CR)(e.endPos,2),o=a[0],s=a[1],l=(0,he.CR)([o-i,s-r],2);return _b([l[0],l[1]])}var u=Eb(Bb(t,e));return[-Math.sin(u),Math.cos(u)]}function zb(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Fb(t,n),"positive"!==e)}function Gb(t,e){return zb(t,e.labelDirection,e)}function jb(t,e){return"linear"===e.type?function(t,e){var n=(0,he.CR)(e.startPos,2),i=n[0],r=n[1],a=(0,he.CR)(e.endPos,2),o=a[0],s=a[1],l=(0,he.CR)([o-i,s-r],2);return[i+l[0]*t,r+l[1]*t]}(t,e):function(t,e){var n=e.radius,i=(0,he.CR)(e.center,2),r=i[0],a=i[1],o=Eb(Bb(t,e));return[r+n*Math.cos(o),a+n*Math.sin(o)]}(t,e)}function Ub(t){return 0===Fb(0,t)[1]}function Hb(t){return 0===Fb(0,t)[0]}function Vb(t,e){return e-t==360}function Zb(t,e,n,i,r){var a=e-t,o=(0,he.CR)([r,r],2),s=o[0],l=o[1],u=(0,he.CR)([Eb(t),Eb(e)],2),c=u[0],h=u[1],d=function(t){return[n+r*Math.cos(t),i+r*Math.sin(t)]},f=(0,he.CR)(d(c),2),p=f[0],g=f[1],m=(0,he.CR)(d(h),2),v=m[0],y=m[1];if(Vb(t,e)){var x=(h+c)/2,b=(0,he.CR)(d(x),2);return[["M",p,g],["A",s,l,0,1,0,b[0],b[1]],["A",s,l,0,1,0,v,y]]}var _=a>180?1:0,E=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(l,",0,").concat(_,",").concat(E,",").concat(v,",").concat(y)}function Wb(t,e,n,i){var r=e.startAngle,a=e.endAngle,o=e.center,s=e.radius;return t.selectAll(pb.line.class).data([{d:Zb.apply(void 0,(0,he.ev)((0,he.ev)([r,a],(0,he.CR)(o),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",pb.line.name).styles(e).styles({d:function(t){return t.d}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,i){if(!i)return t.attr("__keyframe_data__",n),null;var r=i.duration,a=void 0===r?0:r,o=Rb(e,n),s=Math.ceil(+a/16),l=new Array(s).fill(0).map((function(t,e,n){return{__keyframe_data__:o(e/(n.length-1))}}));return t.animate(l,(0,he.pi)({fill:"both"},i))}(this,function(t){var e=t.attributes,n=e.startAngle,i=e.endAngle,r=e.center,a=e.radius;return(0,he.ev)((0,he.ev)([n,i],(0,he.CR)(r),!1),[a],!1)}(this),(0,he.ev)((0,he.ev)([r,a],(0,he.CR)(o),!1),[s],!1),i.update);if(e){var n=function(){var e=Wd(t.attributes,"__keyframe_data__");t.style.d=Zb.apply(void 0,(0,he.ev)([],(0,he.CR)(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Xb(t){var e=(0,he.CR)(t,2),n=(0,he.CR)(e[0],2),i=n[0],r=n[1],a=(0,he.CR)(e[1],2);return{x1:i,y1:r,x2:a[0],y2:a[1]}}function Yb(t,e,n,i){var r=e.showTrunc,a=e.startPos,o=e.endPos,s=e.truncRange,l=e.lineExtension,u=(0,he.CR)([a,o],2),c=(0,he.CR)(u[0],2),h=c[0],d=c[1],f=(0,he.CR)(u[1],2),p=f[0],g=f[1],m=(0,he.CR)(l?function(t,e,n){void 0===n&&(n=[0,0]);var i=(0,he.CR)([t,e,n],3),r=(0,he.CR)(i[0],2),a=r[0],o=r[1],s=(0,he.CR)(i[1],2),l=s[0],u=s[1],c=(0,he.CR)(i[2],2),h=c[0],d=c[1],f=(0,he.CR)([l-a,u-o],2),p=f[0],g=f[1],m=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),v=(0,he.CR)([-h/m,d/m],2),y=v[0],x=v[1];return[y*p,y*g,x*p,x*g]}(a,o,l):new Array(4).fill(0),4),v=m[0],y=m[1],x=m[2],b=m[3],_=function(e){return t.selectAll(pb.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(pb.line.name," ").concat(t.className)})).styles(n).transition((function(t){return Ex(this,Xb(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return Ex(this,Xb(t.line),i.update)}))}),(function(t){return t.remove()})).transitions()};if(!r||!s)return _([{line:[[h+v,d+y],[p+x,g+b]],className:pb.line.name}]);var E=(0,he.CR)(s,2),w=E[0],T=E[1],S=p-h,M=g-d,C=(0,he.CR)([h+S*w,d+M*w],2),A=C[0],O=C[1],N=(0,he.CR)([h+S*T,d+M*T],2),P=N[0],L=N[1],R=_([{line:[[h+v,d+y],[A,O]],className:pb.lineFirst.name},{line:[[P,L],[p+x,g+b]],className:pb.lineSecond.name}]);return function(t,e){e.truncRange,e.truncShape,e.lineExtension}(0,e),R}function qb(t,e,n){var i,r=e.type,a=nx(e,"line");return i="linear"===r?Yb(t,e,Db(a,"arrow"),n):Wb(t,e,Db(a,"arrow"),n),function(t,e,n,i){var r,a=n.showArrow,o=n.showTrunc,s=n.lineArrow,l=n.lineArrowOffset,u=n.lineArrowSize;if(r="arc"===e?t.select(pb.line.class):o?t.select(pb.lineSecond.class):t.select(pb.line.class),!a||!s||"arc"===n.type&&Vb(n.startAngle,n.endAngle)){var c=r.node();c&&(c.style.markerEnd=void 0)}else{var h=Fx(s);h.attr(i),wx(h,u,!0),r.style("markerEnd",h).style("markerEndOffset",-l)}}(t,r,e,a),i}function $b(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Kb(t,e){var n=e.gridLength;return t.map((function(t,i){var r=t.value,a=(0,he.CR)(jb(r,e),2),o=a[0],s=a[1],l=(0,he.CR)(gb(function(t,e){return zb(t,e.gridDirection,e)}(r,e),n),2);return{id:i,points:[[o,s],[o+l[0],s+l[1]]]}}))}function Qb(t,e,n,i){var r=nx(n,"grid"),a=r.type,o=r.areaFill,s=$b(n),l=Ib(e,n.gridFilter),u="segment"===a?Kb(l,n):function(t,e){var n=e.gridControlAngles,i=$b(e);if(!i)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var r=(0,he.CR)(i,2),a=r[0],o=r[1];return t.map((function(t,i){var r=t.value,s=(0,he.CR)(jb(r,e),2),l=s[0],u=s[1],c=(0,he.CR)([l-a,u-o],2),h=c[0],d=c[1],f=[];return n.forEach((function(t){var e=Eb(t),n=(0,he.CR)([Math.cos(e),Math.sin(e)],2),i=n[0],r=n[1],s=h*i-d*r+a,l=h*r+d*i+o;f.push([s,l])})),{points:f,id:i}}))}(l,n),c=(0,he.pi)((0,he.pi)({},r),{center:s,areaFill:(0,en.Z)(o)?l.map((function(t,e){return vx(o,[t,e,l])})):o,animate:i,data:u});return t.selectAll(pb.grid.class).data([1]).join((function(t){return t.append((function(){return new Lb({style:c})})).attr("className",pb.grid.name)}),(function(t){return t.transition((function(){return this.update(c)}))}),(function(t){return t.remove()})).transitions()}function Jb(t,e,n,i,r){return void 0===i&&(i=!0),void 0===r&&(r=!1),!!(i&&t===e||r&&t===n)||t>e&&t<n}function t_(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,(function(e,n,i){return"translate(".concat(function(t,e,n){var i=t.getBBox(),r=i.width,a=i.height,o=(0,he.CR)([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?r:a):t})),2);return[o[0],o[1]]}(t,n,i),")")}));t.attr("transform",n)}catch(t){}}var e_=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},n_=function(){function t(t,e,n,i){this.set(t,e,n,i)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var i=this,r=i.x1,a=i.y1,o=i.x2,s=i.y2,l=Math.cos(t),u=Math.sin(t),c=e-e*l+n*u,h=n-e*u-n*l;return[[l*r-u*s+c,u*r+l*s+h],[l*o-u*s+c,u*o+l*s+h],[l*r-u*a+c,u*r+l*a+h],[l*o-u*a+c,u*o+l*a+h]]},t.prototype.set=function(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function i_(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var i=t.getBounds(),r=(0,he.CR)(i.min,2),a=r[0],o=r[1],s=(0,he.CR)(i.max,2),l=s[0],u=s[1],c=t.getBBox(),h=c.width,d=c.height,f=0,p=0,g=a,m=o,v=jx(t);if(v){d-=1.5;var y=v.style.textAlign,x=v.style.textBaseline;"center"===y?g=(a+l)/2:"right"!==y&&"end"!==y||(g=l),"middle"===x?m=(o+u)/2:"bottom"===x&&(m=u)}var b=(0,he.CR)(cx(e),4),_=b[0],E=void 0===_?0:_,w=b[1],T=void 0===w?0:w,S=b[2],M=void 0===S?E:S,C=b[3],A=new n_((f+=a)-(void 0===C?T:C),(p+=o)-E,f+h+T,p+d+M);return t.setEulerAngles(n),A.rotatedPoints(Eb(n),g,m)}function r_(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function a_(t,e,n){var i=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===i?0:i<0?2:1}function o_(t,e){return e.every((function(e){return function(t,e){var n=t.length;if(n<3)return!1;var i,r,a,o,s,l,u=[e,[9999,e[1]]],c=0,h=0;do{var d=[t[h],t[(h+1)%n]];if(r=u,a=void 0,o=void 0,s=void 0,l=void 0,a=a_((i=d)[0],i[1],r[0]),o=a_(i[0],i[1],r[1]),s=a_(r[0],r[1],i[0]),l=a_(r[0],r[1],i[1]),a!==o&&s!==l||0===a&&r_(i,r[0])||0===o&&r_(i,r[1])||0===s&&r_(r,i[0])||0===l&&r_(r,i[1])){if(0===a_(d[0],e,d[1]))return r_(d,e);c++}h=(h+1)%n}while(0!==h);return!!(1&c)}(t,e)}))}function s_(t,e){var n=(0,he.CR)(t,4),i=n[0],r=n[1],a=n[2],o=n[3],s=(0,he.CR)(e,4),l=s[0],u=s[1],c=a-i,h=o-r,d=s[2]-l,f=s[3]-u,p=c*f-d*h;if(0===p)return!1;var g=p>0,m=i-l,v=r-u,y=c*v-h*m;if(y<0===g)return!1;var x=d*v-f*m;return x<0!==g&&(y>p!==g&&x>p!==g)}function l_(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((function(t){return s_(e,t)}))}function u_(t,e,n){var i,r,a=e.crossPadding,o=new Set,s=null,l=function(t,e){var n=t.type,i=t.labelDirection,r=t.crossSize;if(!r)return!1;if("arc"===n){var a=t.center,o=t.radius,s=(0,he.CR)(a,2),l=s[0],u=s[1],c="negative"===i?0:r,h=-o-c,d=o+c,f=(0,he.CR)(cx(e),4),p=f[0],g=f[1],m=f[2],v=f[3];return new n_(l+h-v,u+h-p,l+d+g,u+d+m)}var y=(0,he.CR)(t.startPos,2),x=y[0],b=y[1],_=(0,he.CR)(t.endPos,2),E=_[0],w=_[1],T=(0,he.CR)(Hb(t)?[-e,0,e,0]:[0,e,0,-e],4),S=T[0],M=T[1],C=T[2],A=T[3],O=gb(Gb(0,t),r),N=new n_(x,b,E,w);return N.x1+=A,N.y1+=S,N.x2+=M+O[0],N.y2+=C+O[1],N}(e,a),u=function(t){return!l||function(t,e,n){var i=t.x1,r=t.x2,a=t.y1,o=t.y2;return o_([[i,a],[r,a],[r,o],[i,o]],i_(e,n))}(l,t)},c=function(t,e){return!t||!t.firstChild||!function(t,e,n){var i,r,a=i_(t,n).flat(1),o=i_(e,n).flat(1),s=[[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,he.XA)(s),u=l.next();!u.done;u=l.next())if(l_(o,u.value))return!0}catch(t){i={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return!1}(t.firstChild,e.firstChild,cx(n))};try{for(var h=(0,he.XA)(t),d=h.next();!d.done;d=h.next()){var f=d.value;u(f)?!s||c(s,f)?s=f:(o.add(s),o.add(f)):o.add(f)}}catch(t){i={error:t}}finally{try{d&&!d.done&&(r=h.return)&&r.call(h)}finally{if(i)throw i.error}}return Array.from(o)}function c_(t,e){return void 0===e&&(e={}),(0,le.Z)(t)?0:"number"==typeof t?t:Math.floor(zx(t,e))}var h_=function(t,e){var n=e.seq,i=void 0===n?2:n;return t.filter((function(t,e){return!(e%i)||(Zy(t),!1)}))};var d_=new Map([["hide",function(t,e,n,i){var r=t.length,a=e.keepHeader,o=e.keepTail;if(!(r<=1||2===r&&a&&o)){var s,l,u,c=h_,h=function(t){return t.forEach(i.show),t},d=2,f=t.slice(),p=t.slice(),g=Math.min.apply(Math,(0,he.ev)([1],(0,he.CR)(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(Ub(n)||Hb(n))){var m=Ix(t[0]).left,v=Ix(t[r-1]).right,y=Math.abs(v-m)||1;d=Math.max(Math.floor(r*g/y),d)}for(a&&(s=f.splice(0,1)[0]),o&&(l=f.splice(-1,1)[0],f.reverse()),h(f);d<t.length&&u_((u=l?(0,he.ev)((0,he.ev)([l],(0,he.CR)(p),!1),[s],!1):(0,he.ev)([s],(0,he.CR)(p),!1),u.filter(e_)),n,null==e?void 0:e.margin).length;){if(l&&!s&&d%2==0)f.splice(0,1).forEach(i.hide);else if(l&&s){f.splice(0,1).forEach(i.hide)}p=c(h(f),{seq:d}),d++}}}],["rotate",function(t,e,n,i){var r,a,o=e.optionalAngles,s=void 0===o?[0,45,90]:o,l=e.margin,u=e.recoverWhenFailed,c=void 0===u||u,h=t.map((function(t){return t.getLocalEulerAngles()})),d=function(e){return t.forEach((function(t,n){var r=Array.isArray(e)?e[n]:e;i.rotate(t,+r)}))};try{for(var f=(0,he.XA)(s),p=f.next();!p.done;p=f.next()){if(d(p.value),u_(t,n,l).length<1)return}}catch(t){r={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}c&&d(h)}],["ellipsis",function(t,e,n,i){if(!(t.length<=1)){var r=e.suffix,a=void 0===r?"...":r,o=e.minLength,s=e.maxLength,l=void 0===s?1/0:s,u=e.step,c=void 0===u?" ":u,h=e.margin,d=void 0===h?[0,0,0,0]:h,f=Gx(i.getTextShape(t[0])),p=c_(c,f),g=o?c_(o,f):p,m=c_(l,f);((0,le.Z)(m)||m===1/0)&&(m=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));for(var v=t.slice(),y=(0,he.CR)(d,4),x=(y[0],y[1],y[2],y[3],function(e){if(v.forEach((function(t){i.ellipsis(i.getTextShape(t),e,a)})),(v=u_(t,n,d)).length<1)return{value:void 0}}),b=m;b>g+p;b-=p){var _=x(b);if("object"==typeof _)return _.value}}}],["wrap",function(t,e,n,i){var r=e.wordWrapWidth,a=void 0===r?50:r,o=e.maxLines,s=void 0===o?3:o,l=e.recoverWhenFailed,u=void 0===l||l,c=e.margin,h=void 0===c?[0,0,0,0]:c,d=t.map((function(t){return t.attr("maxLines")||1})),f=Math.min.apply(Math,(0,he.ev)([],(0,he.CR)(d),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Ub(t)?"negative"===n?"bottom":"top":"middle"}(n),g=function(e){return t.forEach((function(t,n){var r=Array.isArray(e)?e[n]:e;i.wrap(t,a,r,p)}))};if(!(f>s)){for(var m=f;m<=s;m++)if(g(m),u_(t,n,h).length<1)return;u&&g(d)}}]]);function f_(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(t){return"positive"===t?-1:1};return t.reduce((function(t,e){return t*n(e)}),1)}function p_(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function g_(t,e){var n=(0,he.CR)(t,2),i=n[0],r=n[1],a=(0,he.CR)(e,2),o=a[0],s=a[1],l=(0,he.CR)([i*o+r*s,i*s-r*o],2),u=l[0],c=l[1];return Math.atan2(c,u)}function m_(t,e,n){var i,r=n.labelAlign;if(null===(i=e.style.transform)||void 0===i?void 0:i.includes("rotate"))return e.getLocalEulerAngles();var a=Gb(t.value,n),o=Fb(t.value,n);return"horizontal"===r?0:function(t){var e=(t+360)%180;return Jb(e,-90,90)||(e+=180),e}(wb("perpendicular"===r?g_([1,0],a):g_([o[0]<0?-1:1,0],o)))}function v_(t,e,n){var i=n.type,r=n.labelAlign,a=Gb(t,n),o=p_(e),s=p_(wb(g_([1,0],a))),l="center",u="middle";return"linear"===i?[90,270].includes(s)&&0===o?(l="center",u=1===a[1]?"top":"bottom"):s%180||![90,270].includes(o)?0===s?(Jb(o,0,90,!1,!0)||Jb(o,0,90)||Jb(o,270,360))&&(l="start"):90===s?Jb(o,0,90,!1,!0)?l="start":(Jb(o,90,180)||Jb(o,270,360))&&(l="end"):270===s?Jb(o,0,90,!1,!0)?l="end":(Jb(o,90,180)||Jb(o,270,360))&&(l="start"):180===s&&(90===o?l="start":(Jb(o,0,90)||Jb(o,270,360))&&(l="end")):l="center":"parallel"===r?u=Jb(s,0,180,!0)?"top":"bottom":"horizontal"===r?Jb(s,90,270,!1)?l="end":(Jb(s,270,360,!1)||Jb(s,0,90))&&(l="start"):"perpendicular"===r&&(l=Jb(s,90,270)?"end":"start"),{textAlign:l,textBaseline:u}}function y_(t,e,n){var i=n.showTick,r=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),u=vx(s,[t,l,e]),c=(0,he.CR)([Gb(t.value,n),f_(o,a)],2),h=c[0],d=1===c[1]?vx(i?r:0,[t,l,e]):0,f=(0,he.CR)(mb(gb(h,u+d),jb(t.value,n)),2);return{x:f[0],y:f[1]}}function x_(t,e){"text"===t.nodeName&&t.attr(e)}function b_(t){!function(t,e,n){var i=e.labelOverlap,r=void 0===i?[]:i;r.length&&r.forEach((function(i){var r=i.type,a=d_.get(r);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some((function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((function(t){return t.querySelector("text")})).length>1)})(t,e,r)&&(null==a||a(t,i,e,n))}))}(this.node().childNodes,t,{hide:Zy,show:Vy,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var i=v_(e.__data__.value,t,n),r=e.querySelector(pb.labelItem.class);r&&x_(r,i)}(+n,e,t)},ellipsis:function(t,e,n){t&&Hx(t,e||1/0,n)},wrap:function(t,e,n){var i,r;t&&(void 0===(i=n)&&(i=2),void 0===r&&(r="top"),Ux(t,{wordWrap:!0,wordWrapWidth:e,maxLines:i,textBaseline:r}))},getTextShape:function(t){return t.querySelector("text")}})}function __(t,e,n,i,r){var a=n.indexOf(e),o=sx(t).append(function(t,e,n,i){var r=i.labelFormatter;return(0,en.Z)(r)?function(){return Fx(vx(r,[t,e,n,Gb(t.value,i)]))}:function(){return Fx(t.label||"")}}(e,a,n,r)).attr("className",pb.labelItem.name).node(),s=(0,he.CR)(rx(kb(i,[e,a,n])),2),l=s[0],u=s[1],c=u.transform,h=(0,he._T)(u,["transform"]);t_(o,c);var d=m_(e,o,r);return o.getLocalEulerAngles()||o.setLocalEulerAngles(d),x_(o,(0,he.pi)((0,he.pi)({},v_(e.value,d,r)),l)),t.attr(h),o}function E_(t,e,n,i){var r=Ib(e,n.labelFilter),a=nx(n,"label");return t.selectAll(pb.label.class).data(r,(function(t,e){return e})).join((function(i){return i.append("g").attr("className",pb.label.name).transition((function(t){__(this,t,e,a,n);var i=y_(t,e,n),r=i.x,o=i.y;return this.style.transform="translate(".concat(r,", ").concat(o,")"),null})).call((function(){b_.call(t,n)}))}),(function(r){return r.transition((function(t){var r=function(t,e,n,i){if(void 0===i&&(i="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var r=function(){"destroy"===i?t.destroy():"hide"===i&&Zy(t),e.isVisible()&&Vy(e)};if(!n)return r(),[null];var a=n.duration,o=void 0===a?0:a,s=n.delay,l=void 0===s?0:s,u=Math.ceil(+o/2),c=+o/4,h=(0,he.CR)(t.getGeometryBounds().center,2),d=h[0],f=h[1],p=(0,he.CR)(e.getGeometryBounds().center,2),g=p[0],m=p[1],v=(0,he.CR)([(d+g)/2-d,(f+m)/2-f],2),y=v[0],x=v[1],b=t.style.opacity,_=void 0===b?1:b,E=e.style.opacity,w=void 0===E?1:E,T=t.style.transform||"",S=e.style.transform||"",M=t.animate([{opacity:_,transform:"translate(0, 0) ".concat(T)},{opacity:0,transform:"translate(".concat(y,", ").concat(x,") ").concat(T)}],(0,he.pi)((0,he.pi)({fill:"both"},n),{duration:l+u+c})),C=e.animate([{opacity:0,transform:"translate(".concat(-y,", ").concat(-x,") ").concat(S),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(S)}],(0,he.pi)((0,he.pi)({fill:"both"},n),{duration:u+c,delay:l+u-c}));return xx(C,r),[M,C]}(this.querySelector(pb.labelItem.class),__(this,t,e,a,n),i.update),o=y_(t,e,n),s=o.x,l=o.y,u=Ex(this,{transform:"translate(".concat(s,", ").concat(l,")")},i.update);return(0,he.ev)((0,he.ev)([],(0,he.CR)(r),!1),[u],!1)})).call((function(e){var i,r,a=Wd(e,"_transitions").flat().filter(e_);r=function(){b_.call(t,n)},0===(i=a).length?r():Promise.all(i.map((function(t){return null==t?void 0:t.finished}))).then(r)}))}),(function(t){return t.transition((function(){var t=this,e=Tb(this.childNodes[0],i.exit);return xx(e,(function(){return sx(t).remove()})),e}))})).transitions()}function w_(t,e){return zb(t,e.tickDirection,e)}function T_(t,e,n,i,r){var a=r.tickLength,o=(0,he.CR)(function(t,e){var n=(0,he.CR)(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(i,vx(a,[t,e,n])),2),s=(0,he.CR)(o[0],2),l=s[0],u=s[1],c=(0,he.CR)(o[1],2);return{x1:l,x2:c[0],y1:u,y2:c[1]}}function S_(t,e,n,i,r,a){var o=function(t,e,n,i,r){var a=r.tickFormatter,o=w_(e.value,r),s="line";return(0,en.Z)(a)&&(s=function(){return vx(a,[e,n,i,o])}),t.append(s).attr("className",pb.tickItem.name)}(sx(this),t,e,n,i);!function(t,e,n,i,r,a,o){var s=w_(t.value,a),l=T_(t,e,n,s,a),u=l.x1,c=l.x2,h=l.y1,d=l.y2,f=(0,he.CR)(rx(kb(o,[t,e,n,s])),2),p=f[0],g=f[1];"line"===i.node().nodeName&&i.styles((0,he.pi)({x1:u,x2:c,y1:h,y2:d},p)),r.attr(g),i.styles(p)}(t,e,n,o,this,i,r);var s=(0,he.CR)(jb(t.value,i),2),l=s[0],u=s[1];return Ex(this,{transform:"translate(".concat(l,", ").concat(u,")")},a)}function M_(t,e,n,i,r){var a=nx(i,"title"),o=(0,he.CR)(rx(a),2),s=o[0],l=o[1],u=l.transform,c=l.transformOrigin,h=(0,he._T)(l,["transform","transformOrigin"]);e.styles(h);var d=u||function(t,e,n){var i=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(i/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(i/2,")")}return""}(t.node(),s.direction,s.position);t.styles((0,he.pi)((0,he.pi)({},s),{transformOrigin:c})),t_(t.node(),d);var f=function(t,e,n){var i=n.titlePosition,r=void 0===i?"lb":i,a=n.titleSpacing,o=fx(r),s=t.node().getLocalBounds(),l=(0,he.CR)(s.min,2),u=l[0],c=l[1],h=(0,he.CR)(s.halfExtents,2),d=h[0],f=h[1],p=(0,he.CR)(e.node().getLocalBounds().halfExtents,2),g=p[0],m=p[1],v=(0,he.CR)([u+d,c+f],2),y=v[0],x=v[1],b=(0,he.CR)(cx(a),4),_=b[0],E=b[1],w=b[2],T=b[3];if(["start","end"].includes(r)&&"linear"===n.type){var S=n.startPos,M=n.endPos,C=(0,he.CR)("start"===r?[S,M]:[M,S],2),A=C[0],O=C[1],N=_b([-O[0]+A[0],-O[1]+A[1]]),P=(0,he.CR)(gb(N,_),2),L=P[0],R=P[1];return{x:A[0]+L,y:A[1]+R}}return o.includes("t")&&(x-=f+m+_),o.includes("r")&&(y+=d+g+E),o.includes("l")&&(y-=d+g+T),o.includes("b")&&(x+=f+m+w),{x:y,y:x}}(sx(n._offscreen||n.querySelector(pb.mainGroup.class)),e,i),p=f.x,g=f.y;return Ex(e.node(),{transform:"translate(".concat(p,", ").concat(g,")")},r)}function C_(t,e,n,i){var r=t.showLine,a=t.showTick,o=t.showLabel,s=hx(r,e.maybeAppendByClassName(pb.lineGroup,"g"),(function(e){return qb(e,t,i)}))||[],l=hx(a,e.maybeAppendByClassName(pb.tickGroup,"g"),(function(e){return function(t,e,n,i){var r=Ib(e,n.tickFilter),a=nx(n,"tick");return t.selectAll(pb.tick.class).data(r,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",pb.tick.name).transition((function(t,e){return S_.call(this,t,e,r,n,a,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),S_.call(this,t,e,r,n,a,i.update)}))}),(function(t){return t.transition((function(){var t=this,e=Tb(this.childNodes[0],i.exit);return xx(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,i)}))||[],u=hx(o,e.maybeAppendByClassName(pb.labelGroup,"g"),(function(e){return E_(e,n,t,i)}))||[];return(0,he.ev)((0,he.ev)((0,he.ev)([],(0,he.CR)(s),!1),(0,he.CR)(l),!1),(0,he.CR)(u),!1).filter((function(t){return!!t}))}var A_=function(t){function e(e){return t.call(this,e,fb)||this}return(0,he.ZT)(e,t),e.prototype.render=function(t,e,n){var i=this,r=t.titleText,a=t.data,o=t.animate,s=t.showTitle,l=t.showGrid,u=t.dataThreshold,c=t.truncRange,h=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),i=[],r=0;r<t.length;r+=n)i.push(t[r]);return i}(a,u).filter((function(t){var e=t.value;return!(c&&e>c[0]&&e<c[1])})),d=yx(void 0===n?o:n),f=hx(l,sx(e).maybeAppendByClassName(pb.gridGroup,"g"),(function(e){return Qb(e,h,t,d)}))||[],p=sx(e).maybeAppendByClassName(pb.mainGroup,"g");r&&(!this.initialized&&d.enter||this.initialized&&d.update)&&C_(t,sx(this.offscreenGroup),h,yx(!1));var g=C_(t,sx(p.node()),h,d),m=hx(s,sx(e).maybeAppendByClassName(pb.titleGroup,"g"),(function(e){return function(t,e,n,i){var r=n.titleText;return t.selectAll(pb.title.class).data([{title:r}].filter((function(t){return!!t.title})),(function(t,e){return t.title})).join((function(a){return a.append((function(){return Fx(r)})).attr("className",pb.title.name).transition((function(){return M_(sx(this),t,e,n,i.enter)}))}),(function(r){return r.transition((function(){return M_(sx(this),t,e,n,i.update)}))}),(function(t){return t.remove()})).transitions()}(e,i,t,d)}))||[];return(0,he.ev)((0,he.ev)((0,he.ev)([],(0,he.CR)(f),!1),(0,he.CR)(g),!1),(0,he.CR)(m),!1).flat().filter((function(t){return!!t}))},e}(Qy);function O_(t){var e=t.canvas,n=t.touches,i=t.offsetX,r=t.offsetY;if(e)return[e.x,e.y];if(n){var a=n[0];return[a.clientX,a.clientY]}return i&&r?[i,r]:[0,0]}function N_(t,e){return+t.toPrecision(e)}var P_=function(t){return t};class L_{constructor(t){this.options=(0,Jh.Z)({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=(0,Jh.Z)({},this.options,t),this.rescale(t)}rescale(t){}}function R_(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function D_(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}var k_=n(75196),I_=n.n(k_);function B_(t,e,n){let i=n;return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function F_(t){const e=I_().get(t);if(!e)return null;const{model:n,value:i}=e;return"rgb"===n?i:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,i=t[2]/100,r=t[3];if(0===n)return[255*i,255*i,255*i,r];const a=i<.5?i*(1+n):i+n-i*n,o=2*i-a;return[255*B_(o,a,e+1/3),255*B_(o,a,e),255*B_(o,a,e-1/3),r]}(i):null}const z_=(t,e)=>n=>t*(1-n)+e*n,G_=(t,e)=>"number"==typeof t&&"number"==typeof e?z_(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=F_(t),i=F_(e);return null===n||null===i?n?()=>t:()=>e:t=>{const e=new Array(4);for(let r=0;r<4;r+=1){const a=n[r],o=i[r];e[r]=a*(1-t)+o*t}const[r,a,o,s]=e;return`rgba(${Math.round(r)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}})(t,e):()=>t,j_=(t,e)=>{const n=z_(t,e);return t=>Math.round(n(t))};function U_(t){return!(Qe(t)||(e=t,null===e)||Number.isNaN(t));var e}const H_=Math.sqrt(50),V_=Math.sqrt(10),Z_=Math.sqrt(2);function W_(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),a=i/10**r;return r>=0?(a>=H_?10:a>=V_?5:a>=Z_?2:1)*10**r:-(10**-r)/(a>=H_?10:a>=V_?5:a>=Z_?2:1)}const X_=(t,e,n=5)=>{const i=[t,e];let r,a=0,o=i.length-1,s=i[a],l=i[o];return l<s&&([s,l]=[l,s],[a,o]=[o,a]),r=W_(s,l,n),r>0?(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,r=W_(s,l,n)):r<0&&(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,r=W_(s,l,n)),r>0?(i[a]=Math.floor(s/r)*r,i[o]=Math.ceil(l/r)*r):r<0&&(i[a]=Math.ceil(s*r)/r,i[o]=Math.floor(l*r)/r),i};const Y_=(t,e,n)=>{const[i,r]=t,[a,o]=e;let s,l;return i<r?(s=R_(i,r),l=n(a,o)):(s=R_(r,i),l=n(o,a)),D_(l,s)},q_=(t,e,n)=>{const i=Math.min(t.length,e.length)-1,r=new Array(i),a=new Array(i),o=t[0]>t[i],s=o?[...t].reverse():t,l=o?[...e].reverse():e;for(let t=0;t<i;t+=1)r[t]=R_(s[t],s[t+1]),a[t]=n(l[t],l[t+1]);return e=>{const n=function(t,e,n,i,r){let a=n||0,o=i||t.length;const s=r||(t=>t);for(;a<o;){const n=Math.floor((a+o)/2);s(t[n])>e?o=n:a=n+1}return a}(t,e,1,i)-1,o=r[n];return D_(a[n],o)(e)}},$_=(t,e,n,i)=>(Math.min(t.length,e.length)>2?q_:Y_)(t,e,i?j_:n);class K_ extends L_{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:z_,tickCount:5}}map(t){return U_(t)?this.output(t):this.options.unknown}invert(t){return U_(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...i)}getTicks(){const{tickMethod:t}=this.options,[e,n,i,...r]=this.getTickMethodOptions();return t(e,n,i,...r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return X_}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:n}=this.options,i=this.options.domain.map(t),r=Math.min(i.length,n.length);return e?function(t,e){const n=e<t?e:t,i=t>e?t:e;return t=>Math.min(Math.max(n,t),i)}(i[0],i[r-1]):P_}composeOutput(t,e){const{domain:n,range:i,round:r,interpolate:a}=this.options,o=$_(n.map(t),i,a,r);this.output=D_(o,e,t)}composeInput(t,e,n){const{domain:i,range:r}=this.options,a=$_(r,i.map(t),z_);this.input=D_(e,n,a)}}const Q_=(t,e,n)=>{let i,r,a=t,o=e;if(a===o&&n>0)return[a];let s=W_(a,o,n);if(0===s||!Number.isFinite(s))return[];if(s>0){a=Math.ceil(a/s),o=Math.floor(o/s),r=new Array(i=Math.ceil(o-a+1));for(let t=0;t<i;t+=1)r[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),r=new Array(i=Math.ceil(o-a+1));for(let t=0;t<i;t+=1)r[t]=(a+t)/s}return r};class J_ extends K_{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:G_,tickMethod:Q_,tickCount:5}}chooseTransforms(){return[P_,P_]}clone(){return new J_(this.options)}}function tE({map:t,initKey:e},n){const i=e(n);return t.has(i)?t.get(i):n}function eE(t){return"object"==typeof t?t.valueOf():t}class nE extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=eE,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(tE({map:this.map,initKey:this.initKey},t))}has(t){return super.has(tE({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const i=e(n);return t.has(i)&&(n=t.get(i),t.delete(i)),n}({map:this.map,initKey:this.initKey},t))}}const iE=Symbol("defaultUnknown");function rE(t,e,n){for(let i=0;i<e.length;i+=1)t.has(e[i])||t.set(n(e[i]),i)}function aE(t){const{value:e,from:n,to:i,mapper:r,notFoundReturn:a}=t;let o=r.get(e);if(void 0===o){if(a!==iE)return a;o=n.push(e)-1,r.set(e,o)}return i[o%i.length]}function oE(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class sE extends L_{getDefaultOptions(){return{domain:[],range:[],unknown:iE}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&rE(this.domainIndexMap,this.getDomain(),this.domainKey),aE({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&rE(this.rangeIndexMap,this.getRange(),this.rangeKey),aE({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=oE(e),this.rangeKey=oE(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new sE(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 lE(t){return Math.round(1e12*t)/1e12}function uE(t){const{domain:e,range:n,paddingOuter:i,paddingInner:r,flex:a,round:o,align:s}=t,l=e.length,u=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(a,l),[c,h]=n,d=h-c,f=d/(2/l*i+1-1/l*r),p=f*r/l,g=f-l*p,m=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(u),v=g/m.reduce(((t,e)=>t+e)),y=new nE(e.map(((t,e)=>{const n=m[e]*v;return[t,o?Math.floor(n):n]}))),x=new nE(e.map(((t,e)=>{const n=m[e]*v+p;return[t,o?Math.floor(n):n]}))),b=Array.from(x.values()).reduce(((t,e)=>t+e)),_=c+(d-(b-b/l*r))*s;let E=o?Math.round(_):_;const w=new Array(l);for(let t=0;t<l;t+=1){w[t]=lE(E);const n=e[t];E+=x.get(n)}return{valueBandWidth:y,valueStep:x,adjustedRange:w}}class cE extends sE{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:iE,flex:[]}}constructor(t){super(t)}clone(){return new cE(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?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:n,round:i,flex:r}=this.options,{adjustedRange:a,valueBandWidth:o,valueStep:s}=function(t){var e;const{domain:n}=t,i=n.length;if(0===i)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return uE(t);const{range:r,paddingOuter:a,paddingInner:o,round:s,align:l}=t;let u,c,h=r[0];const d=r[1]-h,f=2*a,p=i-o;u=d/Math.max(1,f+p),s&&(u=Math.floor(u)),h+=(d-u*(i-o))*l,c=u*(1-o),s&&(h=Math.round(h),c=Math.round(c));const g=new Array(i).fill(0).map(((t,e)=>h+e*u));return{valueStep:u,valueBandWidth:c,adjustedRange:g}}({align:t,range:n,round:i,flex:r,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=o,this.adjustedRange=a}}var hE=function(t){function e(e){var n=this,i=e.style,r=(0,he._T)(e,["style"]);return(n=t.call(this,(0,Jh.Z)({},{type:"column"},(0,he.pi)({style:i},r)))||this).columnsGroup=new Tl({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return(0,he.ZT)(e,t),e.prototype.render=function(){var t=this.attributes,e=t.columns,n=t.x,i=t.y;this.columnsGroup.style.transform="translate(".concat(n,", ").concat(i,")"),sx(this.columnsGroup).selectAll(".column").data(e.flat()).join((function(t){return t.append("rect").attr("className","column").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.update=function(t){this.attr(Yy({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(xl),dE=function(t){function e(e){var n=this,i=e.style,r=(0,he._T)(e,["style"]);return(n=t.call(this,(0,Jh.Z)({},{type:"lines"},(0,he.pi)({style:i},r)))||this).linesGroup=n.appendChild(new Tl),n.areasGroup=n.appendChild(new Tl),n.render(),n}return(0,he.ZT)(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas,i=t.x,r=t.y;this.style.transform="translate(".concat(i,", ").concat(r,")"),e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(Yy({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){sx(this.linesGroup).selectAll(".line").data(t).join((function(t){return t.append("path").attr("className","line").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.renderAreas=function(t){sx(this.linesGroup).selectAll(".area").data(t).join((function(t){return t.append("path").attr("className","area").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.style(t)}))}),(function(t){return t.remove()}))},e}(xl);function fE(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var i=!!e,r=[],a=0,o=t.length;a<o;a+=2)r.push([t[a],t[a+1]]);var s,l,u,c=function(t,e,n,i){var r,a,o,s,l,u,c=[],h=!!i,d=[1/0,1/0],f=[-1/0,-1/0];if(h){d=(r=(0,he.CR)(i,2))[0],f=r[1];for(var p=0,g=t.length;p<g;p+=1)d=yb(d,v=t[p]),f=xb(f,v)}p=0;for(var m=t.length;p<m;p+=1){var v=t[p];if(0!==p||n)if(p!==m-1||n){a=t[[p?p-1:m-1,p-1][n?0:1]];var y=[0,0];y=gb(y=vb(o=t[n?(p+1)%m:p+1],a),e);var x=bb(v,a),b=bb(v,o),_=x+b;0!==_&&(x/=_,b/=_);var E=gb(y,-x),w=gb(y,b);l=mb(v,E),s=yb(s=mb(v,w),xb(o,v)),s=xb(s,yb(o,v)),l=yb(l=mb(v,E=gb(E=vb(s,v),-x/b)),xb(a,v)),s=mb(v,w=gb(w=vb(v,l=xb(l,yb(a,v))),b/x)),h&&(l=yb(l=xb(l,d),f),s=yb(s=xb(s,d),f)),c.push(u),c.push(l),u=s}else l=v,c.push(u),c.push(l);else u=v}return n&&c.push(c.shift()),c}(r,.4,i,n),h=r.length,d=[];for(a=0;a<h-1;a+=1)s=c[2*a],l=c[2*a+1],u=r[a+1],d.push(["C",s[0],s[1],l[0],l[1],u[0],u[1]]);return i&&(s=c[h],l=c[h+1],u=(0,he.CR)(r,1)[0],d.push(["C",s[0],s[1],l[0],l[1],u[0],u[1]])),d}function pE(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,i=t.map((function(t,e){return(0,he.ev)([e===n?"M":"L"],(0,he.CR)(t),!1)}));return e?i.reverse():i}function gE(t,e){if(void 0===e&&(e=!1),t.length<=2)return pE(t);for(var n=[],i=t.length,r=0;r<i;r+=1){var a=e?t[i-r-1]:t[r];nc(a,n.slice(-2))||n.push.apply(n,(0,he.ev)([],(0,he.CR)(a),!1))}var o=fE(n,!1);return e?o.unshift((0,he.ev)(["M"],(0,he.CR)(t[i-1]),!1)):o.unshift((0,he.ev)(["M"],(0,he.CR)(t[0]),!1)),o}function mE(t,e,n){var i=(0,Gc.Z)(t);return i.push(["L",e,n],["L",0,n],["Z"]),i}var vE=function(t,e){if((0,Fe.Z)(t)){for(var n,i=1/0,r=0;r<t.length;r++){var a=t[r],o=(0,en.Z)(e)?e(a):a[e];o<i&&(n=a,i=o)}return n}},yE=function(t,e){if((0,Fe.Z)(t)){for(var n,i=-1/0,r=0;r<t.length;r++){var a=t[r],o=(0,en.Z)(e)?e(a):a[e];o>i&&(n=a,i=o)}return n}};function xE(t){return 0===t.length?[0,0]:[ze(vE(t,(function(t){return ze(t)||0}))),Ge(yE(t,(function(t){return Ge(t)||0})))]}function bE(t){for(var e=(0,Gc.Z)(t),n=e[0].length,i=(0,he.CR)([Array(n).fill(0),Array(n).fill(0)],2),r=i[0],a=i[1],o=0;o<e.length;o+=1)for(var s=e[o],l=0;l<n;l+=1)s[l]>=0?(s[l]+=r[l],r[l]=s[l]):(s[l]+=a[l],a[l]=s[l]);return e}var _E=function(t){function e(e){return t.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(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=(0,Gc.Z)(t);return(0,oe.Z)(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?bE(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=(0,he.CR)(t.getOptions().domain||[0,0],2),n=e[0],i=e[1];return i<0?t.map(i):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,i=e.isStack,r=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var a=nx(this.attributes,"area"),o=nx(this.attributes,"line"),s=this.containerShape.width,l=this.data;if(0===l[0].length)return{lines:[],areas:[]};var u=this.scales,c=function(t,e){var n,i=e.x,r=e.y,a=(0,he.CR)(r.getOptions().range||[0,0],2),o=a[0],s=a[1];return s>o&&(n=(0,he.CR)([o,s],2),s=n[0],o=n[1]),t.map((function(t){return t.map((function(t,e){return[i.map(e),ce(r.map(t),s,o)]}))}))}(l,{type:"line",x:u.x,y:u.y}),h=[];if(a){var d=this.baseline;h=i?r?function(t,e,n){for(var i=[],r=t.length-1;r>=0;r-=1){var a=t[r],o=gE(a),s=void 0;if(0===r)s=mE(o,e,n);else{var l=gE(t[r-1],!0),u=a[0];l[0][0]="L",s=(0,he.ev)((0,he.ev)((0,he.ev)([],(0,he.CR)(o),!1),(0,he.CR)(l),!1),[(0,he.ev)(["M"],(0,he.CR)(u),!1),["Z"]],!1)}i.push(s)}return i}(c,s,d):function(t,e,n){for(var i=[],r=t.length-1;r>=0;r-=1){var a=pE(t[r]),o=void 0;if(0===r)o=mE(a,e,n);else{var s=pE(t[r-1],!0);s[0][0]="L",o=(0,he.ev)((0,he.ev)((0,he.ev)([],(0,he.CR)(a),!1),(0,he.CR)(s),!1),[["Z"]],!1)}i.push(o)}return i}(c,s,d):function(t,e,n,i){return t.map((function(t){return mE(e?gE(t):pE(t),n,i)}))}(c,r,s,d)}return{lines:c.map((function(e,n){return(0,he.pi)({stroke:t.getColor(n),d:r?gE(e):pE(e)},o)})),areas:h.map((function(e,n){return(0,he.pi)({d:e,fill:t.getColor(n)},a)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=nx(this.attributes,"column"),n=this.attributes,i=n.isStack,r=n.type,a=n.scale;if("column"!==r)throw new Error("columnsStyle can only be used in column type");var o=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};i&&(s=bE(s));var l=this.createScales(s),u=l.x,c=l.y,h=(0,he.CR)(xE(s),2),d=h[0],f=h[1],p=new J_({domain:[0,f-(d>0?0:d)],range:[0,o*a]}),g=u.getBandWidth(),m=this.rawData;return{columns:s.map((function(n,r){return n.map((function(n,a){var o=g/s.length;return(0,he.pi)((0,he.pi)({fill:t.getColor(r)},e),i?{x:u.map(a),y:c.map(n),width:g,height:p.map(m[r][a])}:{x:u.map(a)+o*r,y:n>=0?c.map(n):c.map(0),width:o,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,i,r;(n=e,i=".container",r="rect",n.querySelector(i)?sx(n).select(i):sx(n).append(r)).attr("className","container").node();var a=t.type,o=t.x,s=t.y,l="spark".concat(a),u=(0,he.pi)({x:o,y:s},"line"===a?this.linesStyle:this.columnsStyle);sx(e).selectAll(".spark").data([a]).join((function(t){return t.append((function(t){return"line"===t?new dE({className:l,style:u}):new hE({className:l,style:u})})).attr("className","spark ".concat(l))}),(function(t){return t.update(u)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return(0,Fe.Z)(e)?e[t%e.length]:(0,en.Z)(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,i=this.attributes,r=i.type,a=i.scale,o=i.range,s=void 0===o?[]:o,l=i.spacing,u=this.containerShape,c=u.width,h=u.height,d=(0,he.CR)(xE(t),2),f=d[0],p=d[1],g=new J_({domain:[null!==(e=s[0])&&void 0!==e?e:f,null!==(n=s[1])&&void 0!==n?n:p],range:[h,h*(1-a)]});return"line"===r?{type:r,x:new J_({domain:[0,t[0].length-1],range:[0,c]}),y:g}:{type:r,x:new cE({domain:t[0].map((function(t,e){return e})),range:[0,c],paddingInner:l,paddingOuter:l/2,align:.5}),y:g}},e.tag="sparkline",e}(Qy),EE={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},wE={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},TE={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},SE=ux({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),ME=ux({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),CE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),e.prototype.render=function(t,e){var n=t.x,i=t.y,r=t.size,a=void 0===r?10:r,o=t.radius,s=void 0===o?a/4:o,l=t.orientation,u=(0,he._T)(t,["x","y","size","radius","orientation"]),c=a,h=2.4*c,d=sx(e).maybeAppendByClassName(ME.iconRect,"rect").styles((0,he.pi)((0,he.pi)({},u),{width:c,height:h,radius:s,x:n-c/2,y:i-h/2,transformOrigin:"center"})),f=n+1/3*c-c/2,p=n+2/3*c-c/2,g=i+1/4*h-h/2,m=i+3/4*h-h/2;d.maybeAppendByClassName("".concat(ME.iconLine,"-1"),"line").styles((0,he.pi)({x1:f,x2:f,y1:g,y2:m},u)),d.maybeAppendByClassName("".concat(ME.iconLine,"-2"),"line").styles((0,he.pi)({x1:p,x2:p,y1:g,y2:m},u)),"vertical"===l&&(d.node().style.transform="rotate(90)")},e}(Qy),AE=function(t){function e(e){return t.call(this,e,TE)||this}return(0,he.ZT)(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,i=n.x,r=n.y,a=n.showLabel,o=nx(this.attributes,"label"),s=o.x,l=void 0===s?0:s,u=o.y,c=void 0===u?0:u,h=o.transform,d=o.transformOrigin,f=(0,he._T)(o,["x","y","transform","transformOrigin"]),p=(0,he.CR)(rx(f,[]),2),g=p[0],m=p[1],v=sx(t).maybeAppendByClassName(ME.labelGroup,"g").styles(m),y=(0,he.pi)((0,he.pi)({},wE),g),x=y.text,b=(0,he._T)(y,["text"]);hx(!!a,v,(function(t){e.label=t.maybeAppendByClassName(ME.label,"text").styles((0,he.pi)((0,he.pi)({},b),{x:i+l,y:r+c,transform:h,transformOrigin:d,text:"".concat(x)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,i=e.y,r=e.orientation,a=e.type,o=(0,he.pi)((0,he.pi)({x:n,y:i,orientation:r},EE),nx(this.attributes,"icon")),s=this.attributes.iconShape,l=void 0===s?function(){return new CE({style:o})}:s;sx(t).maybeAppendByClassName(ME.iconGroup,"g").selectAll(ME.icon.class).data([l]).join((function(t){return t.append("string"==typeof l?l:function(){return l(a)}).attr("className",ME.icon.name)}),(function(t){return t.update(o)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(Qy),OE=function(t){function e(e){var n=t.call(this,e,(0,he.pi)((0,he.pi)((0,he.pi)({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.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},ix(TE,"handle")),ix(EE,"handleIcon")),ix(wE,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(O_(e));var i=n.availableSpace,r=i.x,a=i.y,o=n.getBBox(),s=o.x,l=o.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([r,a])-n.getOrientVal([+s,+l])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,i=e.slidable,r=e.brushable,a=e.type;t.stopPropagation();var o=n.getOrientVal(O_(t)),s=o-n.prevPos;if(s){var l=n.getRatio(s);switch(n.target){case"start":i&&n.setValuesOffset(l);break;case"end":i&&n.setValuesOffset(0,l);break;case"selection":i&&n.setValuesOffset(l,l);break;case"track":if(!r)return;n.selectionWidth+=l,"range"===a?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=o}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,i=e.onChange,r=e.type,a="range"===r?t:t[1],o="range"===r?n.getValues():n.getValues()[1],s=new ms("valuechange",{detail:{oldValue:a,value:o}});n.dispatchEvent(s),null==i||i(o)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=nx(this.attributes,"sparkline");return(0,he.pi)((0,he.pi)({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,i=(0,he.CR)(this.getOrientVal([[e,n],[n,e]]),2);return{width:i[0],height:i[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=(t.x,t.y,t.padding),n=(0,he.CR)(cx(e),4),i=n[0],r=n[1],a=n[2],o=n[3],s=this.shape;return{x:o,y:i,width:s.width-(o+r),height:s.height-(i+a)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(SE.selection.class).each((function(n,i){Ex(this,e[i],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&Ex(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&Ex(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,i=this.clampValues(t);this.attributes.values=i,this.setValues(i),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,i=e.y,r=nx(this.attributes,"track");this.trackShape=sx(t).maybeAppendByClassName(SE.track,"rect").styles((0,he.pi)((0,he.pi)({x:n,y:i},this.shape),r))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,i=e.y,r=e.brushable;this.brushArea=sx(t).maybeAppendByClassName(SE.brushArea,"rect").styles((0,he.pi)({x:n,y:i,fill:"transparent",cursor:r?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,i=n.x,r=n.y;hx("horizontal"===n.orientation,sx(t).maybeAppendByClassName(SE.sparklineGroup,"g"),(function(t){var n=(0,he.pi)((0,he.pi)({},e.sparklineStyle),{x:i,y:r});t.maybeAppendByClassName(SE.sparkline,(function(){return new _E({style:n})})).update(n)}))},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,i=n.showHandle,r=n.type,a=i?"range"===r?["start","end"]:["end"]:[],o=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(SE.handle.class).data(a.map((function(t){return{type:t}})),(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new AE({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(SE.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");o[n]=this,this.addEventListener("pointerdown",o.onDragStart(e))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(o.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");o[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,i=e.y,r=e.type,a=e.selectionType;this.foregroundGroup=sx(t).maybeAppendByClassName(SE.foreground,"g");var o=nx(this.attributes,"selection"),s=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===a?"grab":"invert"===a?"crosshair":"default"})).styles((0,he.pi)((0,he.pi)({},o),{transform:"translate(".concat(n,", ").concat(i,")")}))},l=this;this.foregroundGroup.selectAll(SE.selection.class).data("value"===r?[]:this.calcSelectionArea().map((function(t,e){return{style:(0,he.pi)({},t),index:e,show:"select"===a?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",SE.selection.name).call(s).each((function(t,e){var n=this;1===e?(l.selectionShape=sx(this),this.on("pointerdown",(function(t){n.attr("cursor","grabbing"),l.onDragStart("selection")(t)})),l.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),l.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),l.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(function(){n.attr("cursor","grabbing")})),this.addEventListener("pointerup",(function(){n.attr("cursor","pointer")})),this.addEventListener("pointerover",(function(){n.attr("cursor","pointer")}))):this.on("pointerdown",l.onDragStart("track"))}))}),(function(t){return t.call(s)}),(function(t){return t.remove()})),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var i=(0,he.CR)(this.range,2),r=i[0],a=i[1],o=(0,he.CR)(this.getValues().map((function(t){return N_(t,e)})),2),s=o[0],l=o[1],u=Array.isArray(t)?t:[s,null!=t?t:l],c=(0,he.CR)((u||[s,l]).map((function(t){return N_(t,e)})),2),h=c[0],d=c[1];if("value"===this.attributes.type)return[0,ce(d,r,a)];h>d&&(h=(n=(0,he.CR)([d,h],2))[0],d=n[1]);var f=d-h;return f>a-r?[r,a]:h<r?s===r&&l===d?[r,d]:[r,f+r]:d>a?l===a&&s===h?[h,a]:[a-f,a]:[h,d]},e.prototype.calcSelectionArea=function(t){var e=(0,he.CR)(this.clampValues(t),2),n=e[0],i=e[1],r=this.availableSpace,a=r.x,o=r.y,s=r.width,l=r.height;return this.getOrientVal([[{y:o,height:l,x:a,width:n*s},{y:o,height:l,x:n*s+a,width:(i-n)*s},{y:o,height:l,x:i*s,width:(1-i)*s}],[{x:a,width:s,y:o,height:n*l},{x:a,width:s,y:n*l+o,height:(i-n)*l},{x:a,width:s,y:i*l,height:(1-i)*l}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,i=n.x,r=n.y,a=n.width,o=n.height,s=(0,he.CR)(this.clampValues(),2),l=s[0],u=s[1],c="start"===t?-e:e,h=("start"===t?l:u)*this.getOrientVal([a,o])+c;return{x:i+this.getOrientVal([h,a/2]),y:r+this.getOrientVal([o/2,h])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,i=n.type,r=n.orientation,a=n.formatter,o=n.autoFitLabel,s=nx(this.attributes,"handle"),l=nx(s,"label"),u=s.spacing,c=this.getHandleSize(),h=this.clampValues(),d=a("start"===t?h[0]:h[1]),f=new ax({style:(0,he.pi)((0,he.pi)((0,he.pi)({},l),this.inferTextStyle(t)),{text:d})}),p=f.getBBox(),g=p.width,m=p.height;if(f.destroy(),!o){if("value"===i)return{text:d,x:0,y:-m-u};var v=u+c+("horizontal"===r?g/2:0);return(e={text:d})["horizontal"===r?"x":"y"]="start"===t?-v:v,e}var y=0,x=0,b=this.availableSpace,_=b.width,E=b.height,w=this.calcSelectionArea()[1],T=w.x,S=w.y,M=w.width,C=w.height,A=u+c;if("horizontal"===r){var O=A+g/2;if("start"===t)y=T-A-g>0?-O:O;else y=_-T-M-A>g?O:-O}else{var N=m+A;x="start"===t?S-c>m?-N:A:E-(S+C)-c>m?N:-A}return{x:y,y:x,text:d}},e.prototype.getHandleLabelStyle=function(t){var e=nx(this.attributes,"handleLabel");return(0,he.pi)((0,he.pi)((0,he.pi)({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=nx(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),i=this.getHandleSize();return(0,he.pi)({cursor:n,shape:t,size:i},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,i=e.y,r=e.showLabel,a=e.showLabelOnInteraction,o=e.orientation,s=this.calcHandlePosition(t),l=s.x,u=s.y,c=this.calcHandleText(t),h=r;return!r&&a&&(h=!!this.target),(0,he.pi)((0,he.pi)((0,he.pi)({},ix(this.getHandleIconStyle(),"icon")),ix((0,he.pi)((0,he.pi)({},this.getHandleLabelStyle(t)),c),"label")),{transform:"translate(".concat(l+n,", ").concat(u+i,")"),orientation:o,showLabel:h,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,i=t.height;return e||Math.floor((this.getOrientVal([+i,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=(0,he.CR)(t,2),n=e[0],i=e[1];return"horizontal"===this.attributes.orientation?n:i},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var i=this.attributes.type,r=(0,he.CR)(this.getValues(),2),a=[r[0]+("range"===i?t:0),r[1]+e].sort();n?this.setValues(a):this.innerSetValues(a,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,i=e.height;return t/this.getOrientVal([n,i])},e.prototype.dispatchCustomEvent=function(t,e,n){var i=this;t.on(e,(function(t){t.stopPropagation(),i.dispatchEvent(new ms(n,{detail:t}))}))},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,i=this.getRatio(n);this.setValuesOffset(i,i,!0)}},e.tag="slider",e}(Qy),NE={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},PE=ux({background:"background",labelGroup:"label-group",label:"label"},"indicator"),LE=function(t){function e(e){var n=t.call(this,e,NE)||this;return n.point=[0,0],n.group=n.appendChild(new Tl({})),n.isMutationObserved=!0,n}return(0,he.ZT)(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=t.padding,i=(0,he.CR)(cx(n),4),r=i[0],a=i[1],o=i[2],s=i[3],l=this.label.node().getLocalBounds(),u=l.min,c=l.max,h=new lx(u[0]-s,u[1]-r,c[0]+a-u[0]+s,c[1]+o-u[1]+r),d=this.getPath(e,h),f=nx(this.attributes,"background");this.background=sx(this.group).maybeAppendByClassName(PE.background,"path").styles((0,he.pi)((0,he.pi)({},f),{d:d})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,i=nx(this.attributes,"label"),r=(0,he.CR)(rx(i),2),a=r[0],o=r[1],s=(a.text,(0,he._T)(a,["text"]));(this.label=sx(this.group).maybeAppendByClassName(PE.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(PE.label,(function(){return Fx(e(n))})).style("text",e(n).toString()).selectAll("text").styles(s)},e.prototype.adjustLayout=function(){var t=(0,he.CR)(this.point,2),e=t[0],n=t[1],i=this.attributes,r=i.x,a=i.y;this.group.attr("transform","translate(".concat(r-e,", ").concat(a-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,i=e.x,r=e.y,a=e.width,o=e.height,s=[["M",i+n,r],["L",i+a-n,r],["A",n,n,0,0,1,i+a,r+n],["L",i+a,r+o-n],["A",n,n,0,0,1,i+a-n,r+o],["L",i+n,r+o],["A",n,n,0,0,1,i,r+o-n],["L",i,r+n],["A",n,n,0,0,1,i+n,r],["Z"]],l={top:4,right:6,bottom:0,left:2}[t],u=this.createCorner([s[l].slice(-2),s[l+1].slice(-2)]);return s.splice.apply(s,(0,he.ev)([l+1,1],(0,he.CR)(u),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Bx.apply(void 0,(0,he.ev)([],(0,he.CR)(t),!1)),i=(0,he.CR)(t,2),r=(0,he.CR)(i[0],2),a=r[0],o=r[1],s=(0,he.CR)(i[1],2),l=s[0],u=s[1],c=(0,he.CR)(n?[l-a,[a,l]]:[u-o,[o,u]],2),h=c[0],d=(0,he.CR)(c[1],2),f=d[0],p=d[1],g=h/2,m=e*(h/Math.abs(h)),v=m/2,y=m*Math.sqrt(3)/2*.8,x=(0,he.CR)([f,f+g-v,f+g,f+g+v,p],5),b=x[0],_=x[1],E=x[2],w=x[3],T=x[4];return n?(this.point=[E,o-y],[["L",b,o],["L",_,o],["L",E,o-y],["L",w,o],["L",T,o]]):(this.point=[a+y,E],[["L",a,b],["L",a,_],["L",a+y,E],["L",a,w],["L",a,T]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?Zy(this):Vy(this)},e.prototype.bindEvents=function(){this.label.on(Ms.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Qy),RE=function(t){function e(n){var i=t.call(this,Yy({},e.defaultOptions,n))||this;return i.hoverColor="#f5f5f5",i.selectedColor="#e6f7ff",i.background=i.appendChild(new Il({})),i.label=i.background.appendChild(new Tl({})),i}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return cx(this.style.padding)},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(){var t=this.style,e=t.label,n=t.value,i=nx(this.attributes,"label");sx(this.label).maybeAppend(".label",(function(){return Fx(e)})).attr("className","label").styles(i),this.label.attr("__data__",n)},e.prototype.renderBackground=function(){var t=this.label.getBBox(),e=(0,he.CR)(this.padding,4),n=e[0],i=e[1],r=e[2],a=e[3],o=t.width,s=t.height,l=o+a+i,u=s+n+r,c=nx(this.attributes,"background"),h=this.style,d=h.width,f=void 0===d?0:d,p=h.height,g=void 0===p?0:p,m=h.selected;this.background.attr((0,he.pi)((0,he.pi)({},c),{width:Math.max(l,f),height:Math.max(u,g),fill:m?this.selectedColor:"#fff"})),this.label.attr({transform:"translate(".concat(a,", ").concat((u-s)/2,")")})},e.prototype.render=function(){this.renderLabel(),this.renderBackground()},e.prototype.bindEvents=function(){var t=this;this.addEventListener("pointerenter",(function(){t.style.selected||t.background.attr("fill",t.hoverColor)})),this.addEventListener("pointerleave",(function(){t.style.selected||t.background.attr("fill",t.style.backgroundFill)}));var e=this;this.addEventListener("click",(function(){var n=t.style,i=n.label,r=n.value,a=n.onClick;null==a||a(r,{label:i,value:r},e)}))},e.defaultOptions={style:{value:"",label:"",cursor:"pointer"}},e}(Qy),DE=function(t){function e(n){var i,r,a=t.call(this,Yy({},e.defaultOptions,n))||this;a.currentValue=null===(i=e.defaultOptions.style)||void 0===i?void 0:i.defaultValue,a.isPointerInSelect=!1,a.select=a.appendChild(new Il({className:"select",style:{cursor:"pointer",width:0,height:0}})),a.dropdown=a.appendChild(new Il({className:"dropdown"}));var o=a.style.defaultValue;return o&&(null===(r=a.style.options)||void 0===r?void 0:r.some((function(t){return t.value===o})))&&(a.currentValue=o),a}return(0,he.ZT)(e,t),e.prototype.setValue=function(t){this.currentValue=t,this.render()},e.prototype.getValue=function(){return this.currentValue},Object.defineProperty(e.prototype,"dropdownPadding",{get:function(){return cx(this.style.dropdownPadding)},enumerable:!1,configurable:!0}),e.prototype.renderSelect=function(){var t,e=this,n=this.style,i=n.x,r=n.y,a=n.width,o=n.height,s=n.bordered,l=n.showDropdownIcon,u=nx(this.attributes,"select"),c=nx(this.attributes,"placeholder");this.select.attr((0,he.pi)((0,he.pi)({x:i,y:r,width:a,height:o},u),{fill:"#fff",strokeWidth:s?1:0}));var h=this.dropdownPadding;l&&sx(this.select).maybeAppend(".dropdown-icon","path").style("d","M-5,-3.5 L0,3.5 L5,-3.5").style("transform","translate(".concat(i+a-10-h[1]-h[3],", ").concat(r+o/2,")")).style("lineWidth",1).style("stroke",this.select.style.stroke);var d=null===(t=this.style.options)||void 0===t?void 0:t.find((function(t){return t.value===e.currentValue})),f=(0,he.pi)({x:i+h[3]},c);sx(this.select).selectAll(".placeholder").data(d?[]:[1]).join((function(t){return t.append("text").attr("className","placeholder").styles(f).style("y",(function(){var t=this.getBBox();return r+(o-t.height)/2}))}),(function(t){return t.styles(f)}),(function(t){return t.remove()}));var p=nx(this.attributes,"optionLabel"),g=(0,he.pi)({x:i+h[3]},p);sx(this.select).selectAll(".value").data(d?[d]:[]).join((function(t){return t.append((function(t){return Fx(t.label)})).attr("className","value").styles(g).style("y",(function(){var t=this.getBBox();return r+(o-t.height)/2}))}),(function(t){return t.styles(g)}),(function(t){return t.remove()}))},e.prototype.renderDropdown=function(){var t,e,n=this,i=this.style,r=i.x,a=i.y,o=i.width,s=i.height,l=i.options,u=i.onSelect,c=i.open,h=nx(this.attributes,"dropdown"),d=nx(this.attributes,"option"),f=this.dropdownPadding;sx(this.dropdown).maybeAppend(".dropdown-container","g").attr("className","dropdown-container").selectAll(".dropdown-item").data(l,(function(t){return t.value})).join((function(t){return t.append((function(t){return new RE({className:"dropdown-item",style:(0,he.pi)((0,he.pi)((0,he.pi)({},t),d),{width:o-f[1]-f[3],selected:t.value===n.currentValue,onClick:function(t,e,i){n.setValue(t),null==u||u(t,e,i),n.dispatchEvent(new ms("change",{detail:{value:t,option:e,item:i}})),Zy(n.dropdown)}})})})).each((function(t,e){var n,i=(null===(n=this.parentNode)||void 0===n?void 0:n.children).reduce((function(t,n,i){return i<e&&(t+=n.getBBox().height),t}),0);this.attr("transform","translate(".concat(f[3],", ").concat(f[0]+i,")"))}))}),(function(t){return t.update((function(t){return{selected:t.value===n.currentValue}}))}),(function(t){return t.remove()}));var p=null===(e=null===(t=this.dropdown.getElementsByClassName("dropdown-container"))||void 0===t?void 0:t[0])||void 0===e?void 0:e.getBBox(),g=h.spacing;this.dropdown.attr((0,he.pi)({transform:"translate(".concat(r,", ").concat(a+s+g,")"),width:p.width+f[1]+f[3],height:p.height+f[0]+f[2]},h)),!c&&Zy(this.dropdown)},e.prototype.render=function(){this.renderSelect(),this.renderDropdown()},e.prototype.bindEvents=function(){var t=this;this.addEventListener("click",(function(t){t.stopPropagation()})),this.select.addEventListener("click",(function(){"visible"===t.dropdown.style.visibility?Zy(t.dropdown):Vy(t.dropdown)})),this.addEventListener("pointerenter",(function(){t.isPointerInSelect=!0})),this.addEventListener("pointerleave",(function(){t.isPointerInSelect=!1})),null===document||void 0===document||document.addEventListener("click",(function(){t.isPointerInSelect||Zy(t.dropdown)}))},e.defaultOptions={style:{x:0,y:0,width:140,height:32,options:[],bordered:!0,defaultValue:"",selectRadius:8,selectStroke:"#d9d9d9",showDropdownIcon:!0,placeholderText:"请选择",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"}},e}(Qy),kE=function(t){function e(n){var i=t.call(this,Yy({},{style:{backgroundOpacity:e.backgroundOpacities.default}},e.defaultOptions,n))||this;return i.showBackground=!0,i.background=i.appendChild(new Il({})),i.icon=i.appendChild(new Tl({})),i}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"BaseIcon"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return Math.log10(this.attributes.size)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return cx(this.attributes.size/5)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iconSize",{get:function(){var t=this.attributes.size,e=(0,he.CR)(this.padding,4),n=e[0],i=e[1],r=e[2],a=e[3];return Math.max(t-Math.max(a+i,n+r),2*this.lineWidth+1)},enumerable:!1,configurable:!0}),e.prototype.renderBackground=function(){var t=this.attributes,e=t.x,n=t.y,i=t.size,r=i/2,a=nx(this.attributes,"background");this.background.attr((0,he.pi)({x:e-r,y:n-r,width:i,height:i},a))},e.prototype.showIndicator=function(){if(this.label){var t=this.attributes.size,e=this.background.getBBox(),n=e.x,i=e.y;this.indicator.update({x:n+t/2,y:i-5,labelText:this.label,visibility:"visible"})}},e.prototype.hideIndicator=function(){this.indicator.update({visibility:"hidden"})},e.prototype.connectedCallback=function(){var e;t.prototype.connectedCallback.call(this);var n=this.attributes.size,i=this.background.getBBox(),r=i.x,a=i.y,o=null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView;o&&(this.indicator=o.appendChild(new LE({style:{x:r+n/2,y:a-n/2,visibility:"hidden",position:"top",radius:3,zIndex:100}})))},e.prototype.disconnectedCallback=function(){this.indicator.destroy()},e.prototype.render=function(){this.renderIcon(),this.showBackground&&this.renderBackground()},e.prototype.bindEvents=function(){var t=this,n=this.attributes.onClick;if(this.addEventListener("click",(function(){null==n||n(t)})),this.showBackground){var i=function(){return t.background.attr({opacity:e.backgroundOpacities.default})};this.addEventListener("pointerenter",(function(){t.background.attr({opacity:e.backgroundOpacities.hover}),t.showIndicator()})),this.addEventListener("pointerleave",(function(){i(),t.hideIndicator()})),this.addEventListener("pointerdown",(function(){t.background.attr({opacity:e.backgroundOpacities.active})})),this.addEventListener("pointerup",(function(){i()}))}},e.tag="IconBase",e.defaultOptions={style:{x:0,y:0,size:10,color:"#565758",backgroundRadius:4,backgroundFill:"#e2e2e2"}},e.backgroundOpacities={default:0,hover:.8,active:1},e}(Qy),IE=function(t,e){return void 0===e&&(e="#565758"),new Pl({style:{fill:e,d:"M ".concat(t,",").concat(t," L -").concat(t,",0 L ").concat(t,",-").concat(t," Z"),transformOrigin:"center"}})},BE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),e.prototype.arcPath=function(t,e,n){var i=(0,he.CR)([n,n],2),r=i[0],a=i[1],o=function(i){return[t+n*Math.cos(i),e+n*Math.sin(i)]},s=(0,he.CR)(o(-5/4*Math.PI),2),l=s[0],u=s[1],c=(0,he.CR)(o(1/4*Math.PI),2),h=c[0],d=c[1];return"M".concat(l,",").concat(u,",A").concat(r,",").concat(a,",0,1,1,").concat(h,",").concat(d)},Object.defineProperty(e.prototype,"label",{get:function(){return"重置"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,i=t.color,r=this.iconSize,a=this.lineWidth,o=a+.5;sx(this.icon).maybeAppend(".reset","path").styles({stroke:i,lineWidth:a,d:this.arcPath(e,n,r/2-a),markerStart:IE(o,i)})},e}(kE),FE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"快退"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,i=t.color,r=this.iconSize,a=r/2,o=r/2/Math.pow(3,.5),s=[[e,n],[e,n-o],[e-a,n],[e,n+o],[e,n],[e+a,n-o],[e+a,n+o],[e,n]];sx(this.icon).maybeAppend(".backward","polygon").styles({points:s,fill:i})},e}(kE),zE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"快进"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,i=t.color,r=this.iconSize,a=r/2,o=r/2/Math.pow(3,.5),s=[[e,n],[e,n-o],[e+a,n],[e,n+o],[e,n],[e-a,n-o],[e-a,n+o],[e,n]];sx(this.icon).maybeAppend(".forward","polygon").styles({points:s,fill:i})},e}(kE),GE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"播放"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,i=t.color,r=this.iconSize,a=r/3*Math.pow(3,.5)*.8,o=[[e+a,n],[e-a/2,n-r/2*.8],[e-a/2,n+r/2*.8],[e+a,n]];sx(this.icon).maybeAppend(".play","polygon").styles({points:o,fill:i})},e}(kE),jE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"暂停"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,i=t.color,r=this.iconSize,a=r/3,o=[[e-a,n-r/2],[e-a,n+r/2],[e-a/2,n+r/2],[e-a/2,n-r/2],[e-a,n-r/2],[e+a/2,n-r/2],[e+a/2,n+r/2],[e+a,n+r/2],[e+a,n-r/2]];sx(this.icon).maybeAppend(".pause","polygon").styles({points:o,fill:i})},e}(kE),UE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"范围时间"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,i=t.color,r=this.iconSize,a=this.lineWidth,o=a;sx(this.icon).maybeAppend(".left-line","line").styles({x1:e-r/2,y1:n-r/2,x2:e-r/2,y2:n+r/2,stroke:i,lineWidth:a}),sx(this.icon).maybeAppend(".right-line","line").styles({x1:e+r/2,y1:n-r/2,x2:e+r/2,y2:n+r/2,stroke:i,lineWidth:a}),sx(this.icon).maybeAppend(".left-arrow","line").styles({x1:e,y1:n,x2:e-r/2+2*o,y2:n,stroke:i,lineWidth:a,markerEnd:IE(2*a,i)}),sx(this.icon).maybeAppend(".right-arrow","line").styles({x1:e,y1:n,x2:e+r/2-2*o,y2:n,stroke:i,lineWidth:a,markerEnd:IE(2*a,i)})},e}(kE),HE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"单一时间"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,i=t.color,r=this.iconSize,a=this.lineWidth;sx(this.icon).maybeAppend(".line","line").styles({x1:e,y1:n-r/2,x2:e,y2:n+r/2,stroke:i,lineWidth:a});var o=a;sx(this.icon).maybeAppend(".left-arrow","line").styles({x1:e-r/2-2*o,y1:n,x2:e-2*o,y2:n,stroke:i,lineWidth:a,markerEnd:IE(2*a,i)}),sx(this.icon).maybeAppend(".right-arrow","line").styles({x1:e+r/2+2*o,y1:n,x2:e+2*o,y2:n,stroke:i,lineWidth:a,markerEnd:IE(2*a,i)})},e}(kE),VE=function(t){return[[-t/2,-t/2],[-t/2,t/2],[t/2,t/2]]},ZE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"折线图"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,i=t.color,r=this.iconSize,a=this.lineWidth,o=a,s=(r-2*o-a)/4,l=(r-2*o-a)/2,u=(0,he.CR)([e-r/2+o,n+r/2-2*o],2),c=u[0],h=u[1];sx(this.icon).maybeAppend(".coordinate","polyline").styles({points:VE(r).map((function(t){var i=(0,he.CR)(t,2),r=i[0],a=i[1];return[r+e,a+n]})),stroke:i,lineWidth:a}),sx(this.icon).maybeAppend(".line","polyline").styles({points:[[c,h],[c+s,h-l],[c+2*s,h],[c+4*s,h-2*l]],stroke:i,lineWidth:a})},e}(kE),WE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"条形图"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return[1,4,2,4,3]},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.data,e=this.attributes,n=e.x,i=e.y,r=e.color,a=this.iconSize,o=this.lineWidth,s=o,l=(a-s)/t.length,u=(a-2*s)/4,c=(0,he.CR)([n-a/2+2*s,i+a/2-s],2),h=c[0],d=c[1];sx(this.icon).maybeAppend(".coordinate","polyline").styles({points:VE(a).map((function(t){var e=(0,he.CR)(t,2),r=e[0],a=e[1];return[r+n,a+i]})),stroke:r,lineWidth:o}),sx(this.icon).maybeAppend(".bars","g").selectAll(".column").data(this.data.map((function(t,e){return{value:t,index:e}}))).join((function(t){return t.append("line").attr("className","column").style("x1",(function(t){var e=t.index;return h+l*e})).style("y1",d).style("x2",(function(t){var e=t.index;return h+l*e})).style("y2",(function(t){var e=t.value;return d-u*e})).styles({y1:d,stroke:r,lineWidth:o})}))},e}(kE),XE=function(t){function e(e){var n=t.call(this,Yy({},{style:{color:"#d8d9d9"}},e))||this;return n.showBackground=!1,n}return(0,he.ZT)(e,t),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,i=t.color,r=this.iconSize,a=this.lineWidth;sx(this.icon).maybeAppend(".split","line").styles({x1:e,y1:n-r/2,x2:e,y2:n+r/2,stroke:i,lineWidth:a})},e}(kE),YE=function(t){function e(){var e=t.apply(this,(0,he.ev)([],(0,he.CR)(arguments),!1))||this;return e.showBackground=!1,e}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return cx(0)},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.iconSize,e=this.attributes,n=e.x,i=e.y,r=e.speed,a=void 0===r?1:r,o=bv(this.attributes,["x","y","transform","transformOrigin","width","height","size","color","speed"]),s=ce(t,20,1/0),l=(0,he.pi)((0,he.pi)({},o),{x:n-s/2,y:i-10,width:s,height:20,defaultValue:a,bordered:!1,showDropdownIcon:!1,selectRadius:2,dropdownPadding:this.padding,dropdownRadius:2,dropdownSpacing:t/5,placeholderFontSize:t/2,optionPadding:0,optionLabelFontSize:t/2,optionBackgroundRadius:1,options:[{label:"1x",value:1},{label:"1.5x",value:1.5},{label:"2x",value:2}]});sx(this.icon).maybeAppend(".speed",(function(){return new DE({style:l})})).attr("className","speed").each((function(){this.update(l)}))},e.tag="SpeedSelect",e}(kE),qE=function(t){function e(e){var n=t.call(this,e)||this;return n.icon=n.appendChild(new Tl({})),n.currentType=n.attributes.type,n}return(0,he.ZT)(e,t),e.prototype.getType=function(){return this.currentType},e.prototype.render=function(){var t=this,e=this.attributes,n=(e.onChange,(0,he._T)(e,["onChange"]));sx(this.icon).selectAll(".icon").data([this.currentType]).join((function(e){return e.append((function(e){var n,i=null===(n=t.toggles.find((function(t){return(0,he.CR)(t,1)[0]===e})))||void 0===n?void 0:n[1];if(!i)throw new Error("Invalid type: ".concat(e));return new i({})})).attr("className","icon").styles(n,!1).update({})}),(function(t){return t.styles({restStyles:n}).update({})}),(function(t){return t.remove()}))},e.prototype.bindEvents=function(){var t=this,e=this.attributes.onChange;this.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var i=(t.toggles.findIndex((function(e){return(0,he.CR)(e,1)[0]===t.currentType}))+1)%t.toggles.length,r=t.toggles[i][0];null==e||e(t.currentType),t.currentType=r,t.render()}))},e.tag="ToggleIcon",e}(Qy),$E=function(t){function e(e){var n=t.call(this,Yy({},{style:{type:"play"}},e))||this;return n.toggles=[["play",GE],["pause",jE]],n}return(0,he.ZT)(e,t),e}(qE),KE=function(t){function e(e){var n=t.call(this,Yy({},{style:{type:"range"}},e))||this;return n.toggles=[["range",UE],["value",HE]],n}return(0,he.ZT)(e,t),e}(qE),QE=function(t){function e(e){var n=t.call(this,Yy({},{style:{type:"column"}},e))||this;return n.toggles=[["line",ZE],["column",WE]],n}return(0,he.ZT)(e,t),e}(qE),JE={reset:BE,speed:YE,backward:FE,playPause:$E,forward:zE,selectionType:KE,chartType:QE,split:XE},tw=function(t){function e(n){var i=t.call(this,Yy({},e.defaultOptions,n))||this;return i.background=i.appendChild(new Il({})),i.functions=i.appendChild(new Tl({})),i}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return cx(this.attributes.padding)},enumerable:!1,configurable:!0}),e.prototype.renderBackground=function(){var t=this.style,e=t.x,n=t.y,i=t.width,r=t.height,a=nx(this.attributes,"background");this.background.attr((0,he.pi)({x:e,y:n,width:i,height:r},a))},e.prototype.renderFunctions=function(){var t,e=this,n=this.attributes,i=n.functions,r=n.iconSize,a=n.iconSpacing,o=n.x,s=n.y,l=n.width,u=n.height,c=n.align,h=(0,he.CR)(this.padding,4),d=h[1],f=h[3],p=i.reduce((function(t,e){return t.length&&e.length?t.concat.apply(t,(0,he.ev)(["split"],(0,he.CR)(e),!1)):t.concat.apply(t,(0,he.ev)([],(0,he.CR)(e),!1))}),[]),g=p.length*(r+a)-a,m={left:f+r/2,center:(l-g)/2+r/2,right:l-g-f-d+r/2}[c]||0;null===(t=this.speedSelect)||void 0===t||t.destroy(),this.functions.removeChildren(),p.forEach((function(t,n){var i,l=JE[t],c={x:o+n*(r+a)+m,y:s+u/2,size:r};if(l===YE?(c.speed=e.attributes.speed,c.onSelect=function(n){return e.handleFunctionChange(t,{value:n})}):[$E,KE,QE].includes(l)?(c.onChange=function(n){return e.handleFunctionChange(t,{value:n})},l===$E&&(c.type="play"===e.attributes.state?"pause":"play"),l===KE&&(c.type="range"===e.attributes.selectionType?"value":"range"),l===QE&&(c.type="line"===e.attributes.chartType?"column":"line")):c.onClick=function(){return e.handleFunctionChange(t,{value:t})},l===YE){var h=null===(i=e.ownerDocument)||void 0===i?void 0:i.defaultView;h&&(e.speedSelect=new l({style:(0,he.pi)((0,he.pi)({},c),{zIndex:100})}),h.appendChild(e.speedSelect))}else e.functions.appendChild(new l({style:c}))}))},e.prototype.disconnectedCallback=function(){var e;t.prototype.disconnectedCallback.call(this),null===(e=this.speedSelect)||void 0===e||e.destroy()},e.prototype.render=function(){this.renderBackground(),this.renderFunctions()},e.prototype.handleFunctionChange=function(t,e){var n=this.attributes.onChange;null==n||n(t,e)},e.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"]]}},e}(Qy),ew=function(t){function e(n){var i=t.call(this,Yy({},e.defaultOptions,n))||this;return i.bindEvents(),i}return(0,he.ZT)(e,t),e.prototype.bindEvents=function(){var t=this;this.addEventListener("mouseenter",(function(){t.attr("lineWidth",Math.ceil(+(t.style.r||0)/2))})),this.addEventListener("mouseleave",(function(){t.attr("lineWidth",0)}))},e.defaultOptions={style:{r:5,fill:"#3f7cf7",lineWidth:0,stroke:"#3f7cf7",strokeOpacity:.5,cursor:"pointer"}},e}(bl),nw=function(t){function e(n){return t.call(this,Yy({},e.defaultOptions,n))||this}return(0,he.ZT)(e,t),e.prototype.renderBackground=function(){var t=this.attributes,e=t.x,n=t.y,i=t.width,r=t.height,a=nx(this.attributes,"background");sx(this).maybeAppend("background","rect").attr("className","background").styles((0,he.pi)({x:e-i/2,y:n-r/2,width:i,height:r},a))},e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,i=t.iconSize,r=nx(this.attributes,"icon"),a=i/2;sx(this).maybeAppend("icon-left-line","line").attr("className","icon-left-line").styles((0,he.pi)({x1:e-1,y1:n-a,x2:e-1,y2:n+a},r)),sx(this).maybeAppend("icon-right-line","line").attr("className","icon-right-line").styles((0,he.pi)({x1:e+1,y1:n-a,x2:e+1,y2:n+a},r))},e.prototype.renderBorder=function(){var t=this.attributes,e=t.x,n=t.y,i=t.width,r=t.height,a=t.type,o=nx(this.attributes,"border"),s="start"===a?+i/2:-i/2;sx(this).maybeAppend("border","line").attr("className","border").styles((0,he.pi)({x1:s+e,y1:n-r/2,x2:s+e,y2:n+r/2},o))},e.prototype.render=function(){this.renderBackground(),this.renderIcon(),this.renderBorder()},e.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}},e}(Qy);function iw(t,e){return"number"==typeof t?rw(t):function(t,e){var n=new Date(t);switch(e){case"half-hour":case"hour":case"four-hour":return[0,6,12,18].includes(n.getHours())&&0===n.getMinutes()?db(n,"HH:mm\nYYYY-MM-DD"):db(n,"HH:mm");case"half-day":return n.getHours()<12?"AM\n".concat(db(n,"YYYY-MM-DD")):"PM";case"day":return[1,10,20].includes(n.getDate())?db(n,"DD\nYYYY-MM"):db(n,"DD");case"week":return n.getDate()<=7?db(n,"DD\nYYYY-MM"):db(n,"DD");case"month":return[0,6].includes(n.getMonth())?db(n,"MM月\nYYYY"):db(n,"MM月");case"season":return[0].includes(n.getMonth())?db(n,"MM月\nYYYY"):db(n,"MM月");case"year":return db(n,"YYYY");default:return db(n,"YYYY-MM-DD HH:mm")}}(t,e)}function rw(t){var e=String(Math.floor(t/3600)).padStart(2,"0"),n=String(Math.floor(t%3600/60)).padStart(2,"0"),i=String(Math.floor(t%60)).padStart(2,"0");return t<3600?"".concat(n,":").concat(i):"".concat(e,":").concat(n,":").concat(i)}var aw=function(t){function e(n){var i=t.call(this,Yy({},e.defaultOptions,n))||this;i.axis=i.appendChild(new A_({style:{type:"linear",startPos:[0,0],endPos:[0,0],data:[],showArrow:!1,animate:!1}})),i.timeline=i.appendChild(new OE({style:{onChange:function(t){i.handleSliderChange(t)}}})),i.controller=i.appendChild(new tw({})),i.states={},i.handleSliderChange=function(t){var e,n=(e=i.states.values,Array.isArray(e)?(0,he.ev)([],(0,he.CR)(e),!1):e);i.setBySliderValues(t),i.dispatchOnChange(n)};var r=i.attributes,a=r.selectionType,o=r.chartType,s=r.speed,l=r.state,u=r.playMode,c=r.values;return i.states={chartType:o,playMode:u,selectionType:a,speed:s,state:l},i.setByTimebarValues(c),i}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.data.sort((function(t,e){return t.time<e.time?-1:t.time>e.time?1:0}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"space",{get:function(){var t=this.attributes,e=t.x,n=t.y,i=t.width,r=t.height,a=t.type,o=t.controllerHeight,s=ce(+r-o,0,+r),l=new lx(e,n+ +r-o,+i,o),u=0,c="time"===a?10:s;return{axisBBox:"chart"===a?new lx(e,n+s-(u=35),+i,u):new lx,controllerBBox:l,timelineBBox:new lx(e,n+("time"===a?s:s-c),+i,c-u)}},enumerable:!1,configurable:!0}),e.prototype.setBySliderValues=function(t){var e,n,i=this.data,r=(0,he.CR)(Array.isArray(t)?t:[0,t],2),a=r[0],o=r[1],s=i.length,l=i[Math.floor(a*s)],u=i[Math.ceil(o*s)-(Array.isArray(t)?0:1)];this.states.values=[null!==(e=null==l?void 0:l.time)&&void 0!==e?e:i[0].time,null!==(n=null==u?void 0:u.time)&&void 0!==n?n:1/0]},e.prototype.setByTimebarValues=function(t){var e,n,i,r=this.data,a=(0,he.CR)(Array.isArray(t)?t:[void 0,t],2),o=a[0],s=a[1],l=r.find((function(t){return t.time===o})),u=r.find((function(t){return t.time===s}));this.states.values=[null!==(e=null==l?void 0:l.time)&&void 0!==e?e:null===(n=r[0])||void 0===n?void 0:n.time,null!==(i=null==u?void 0:u.time)&&void 0!==i?i:1/0]},e.prototype.setByIndex=function(t){var e,n,i,r,a=this.data,o=(0,he.CR)(t,2),s=o[0],l=o[1];this.states.values=[null!==(n=null===(e=a[s])||void 0===e?void 0:e.time)&&void 0!==n?n:a[0].time,null!==(r=null===(i=this.data[l])||void 0===i?void 0:i.time)&&void 0!==r?r:1/0]},Object.defineProperty(e.prototype,"sliderValues",{get:function(){var t,e=this.states,n=e.values,i=e.selectionType,r=(0,he.CR)(Array.isArray(n)?n:[void 0,n],2),a=r[0],o=r[1],s=this.data,l=s.length,u="value"===i;return[(t=s.findIndex((function(t){return t.time===a})),u?0:t>-1?t/l:0),function(){if(o===1/0)return 1;var t=s.findIndex((function(t){return t.time===o}));return t>-1?t/l:u?.5:1}()]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){var t=this.states,e=t.values,n=t.selectionType,i=(0,he.CR)(Array.isArray(e)?e:[this.data[0].time,e],2),r=i[0],a=i[1];return"value"===n?a:[r,a]},enumerable:!1,configurable:!0}),e.prototype.getDatumByRatio=function(t){var e=this.data,n=e.length;return e[Math.floor(t*(n-1))]},Object.defineProperty(e.prototype,"chartHandleIconShape",{get:function(){var t=this.states.selectionType,e=this.space.timelineBBox.height;return"range"===t?function(t){return new nw({style:{type:t,height:e,iconSize:e/6}})}:function(){return new Ol({style:{x1:0,y1:-e/2,x2:0,y2:e/2,lineWidth:2,stroke:"#c8c8c8"}})}},enumerable:!1,configurable:!0}),e.prototype.getChartStyle=function(t){var e=this,n=t.x,i=t.y,r=t.width,a=t.height,o=this.states,s=o.selectionType,l=o.chartType,u=this.data,c=this.attributes,h=c.type,d=c.labelFormatter,f=nx(this.attributes,"chart"),p=(f.type,(0,he._T)(f,["type"])),g="range"===s;if("time"===h)return(0,he.pi)({handleIconShape:function(){return new ew({})},selectionFill:"#2e7ff8",selectionFillOpacity:1,showLabelOnInteraction:!0,handleLabelDy:g?-15:0,autoFitLabel:g,handleSpacing:g?-15:0,trackFill:"#edeeef",trackLength:r,trackOpacity:.5,trackRadius:a/2,trackSize:a/2,type:s,values:this.sliderValues,formatter:function(t){if(d)return d(t);var n=e.getDatumByRatio(t).time;return"number"==typeof n?rw(n):db(n,"YYYY-MM-DD HH:mm:ss")},transform:"translate(".concat(n,", ").concat(i,")"),zIndex:1},p);var m="range"===s?5:0,v=u.map((function(t){return t.value}));return(0,he.pi)({handleIconOffset:m,handleIconShape:this.chartHandleIconShape,selectionFill:"#fff",selectionFillOpacity:.5,selectionType:"invert",sparklineSpacing:.1,sparklineColumnLineWidth:0,sparklineColor:"#d4e5fd",sparklineAreaOpacity:1,sparklineAreaLineWidth:0,sparklineData:v,sparklineType:l,sparklineScale:.8,trackLength:r,trackSize:a,type:s,values:this.sliderValues,transform:"translate(".concat(n,", ").concat(i,")"),zIndex:1},p)},e.prototype.renderChart=function(t){void 0===t&&(t=this.space.timelineBBox),this.timeline.update(this.getChartStyle(t))},e.prototype.updateSelection=function(){this.timeline.setValues(this.sliderValues,!0),this.handleSliderChange(this.sliderValues)},e.prototype.getAxisStyle=function(t){var e=this.data,n=this.attributes,i=n.interval,r=n.labelFormatter,a=nx(this.attributes,"axis"),o=t.x,s=t.y,l=t.width,u=(0,he.ev)((0,he.ev)([],(0,he.CR)(e),!1),[{time:0}],!1).map((function(t,e,n){var i=t.time;return{label:"".concat(i),value:e/(n.length-1),time:i}})),c=(0,he.pi)({startPos:[o,s],endPos:[o+l,s],data:u,labelFilter:function(t,e){return e<u.length-1},labelFormatter:function(t){var e=t.time;return r?r(e):iw(e,i)}},a);return c},e.prototype.renderAxis=function(t){void 0===t&&(t=this.space.axisBBox),"chart"===this.attributes.type&&this.axis.update(this.getAxisStyle(t))},e.prototype.renderController=function(t){void 0===t&&(t=this.space.controllerBBox);var e=this.attributes.type,n=this.states,i=n.state,r=n.speed,a=n.selectionType,o=n.chartType,s=nx(this.attributes,"controller"),l=this,u=(0,he.pi)((0,he.pi)((0,he.pi)({},t),{iconSize:20,speed:r,state:i,selectionType:a,chartType:o,onChange:function(t,e){var n=e.value;switch(t){case"reset":l.internalReset();break;case"speed":l.handleSpeedChange(n);break;case"backward":l.internalBackward();break;case"playPause":"play"===n?l.internalPlay():l.internalPause();break;case"forward":l.internalForward();break;case"selectionType":l.handleSelectionTypeChange(n);break;case"chartType":l.handleChartTypeChange(n)}}}),s);"time"===e&&(u.functions=[["reset","speed"],["backward","playPause","forward"],["selectionType"]]),this.controller.update(u)},e.prototype.dispatchOnChange=function(t){var e=this.data,n=this.attributes.onChange,i=this.states,r=i.values,a=i.selectionType,o=(0,he.CR)(r,2),s=o[0],l=o[1],u=l===1/0?e.at(-1).time:l;t&&function(t,e){if(Array.isArray(t)){if(!Array.isArray(e))return!1;if(t[0]===e[0]){if(t[1]===e[1])return!0;if(t[1]===1/0||e[1]===1/0)return!0}return!1}return!Array.isArray(e)&&t===e}(t,"range"===a?[s,u]:u)||null==n||n("range"===a?[s,u]:u)},e.prototype.internalReset=function(t){var e,n,i=this.states.selectionType;this.internalPause(),this.setBySliderValues("range"===i?[0,1]:[0,0]),this.renderController(),this.updateSelection(),t||(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onReset)||void 0===n||n.call(e),this.dispatchOnChange())},e.prototype.reset=function(){this.internalReset()},e.prototype.moveSelection=function(t,e){var n=this.data,i=n.length,r=this.states,a=r.values,o=r.selectionType,s=r.playMode,l=(0,he.CR)(a,2),u=l[0],c=l[1],h=n.findIndex((function(t){return t.time===u})),d=n.findIndex((function(t){return t.time===c}));-1===d&&(d=i);var f,p="backward"===t?-1:1;"range"===o?"acc"===s?(f=[h,d+p],-1===p&&h===d&&(f=[h,i])):f=[h+p,d+p]:f=[h,d+p];var g=function(t){var e=(0,he.CR)(t.sort((function(t,e){return t-e})),2),n=e[0],r=e[1],a=function(t){return ce(t,0,i)};return r>i?"value"===o?[0,0]:"acc"===s?[a(n),a(n)]:[0,a(r-n)]:n<0?"acc"===s?[0,a(r)]:[a(n+i-r),i]:[a(n),a(r)]}(f);return this.setByIndex(g),this.updateSelection(),g},e.prototype.internalBackward=function(t){var e,n,i=this.moveSelection("backward",t);return t||(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onBackward)||void 0===n||n.call(e),this.dispatchOnChange()),i},e.prototype.backward=function(){this.internalBackward()},e.prototype.internalPlay=function(t){var e,n,i=this,r=this.data,a=this.attributes.loop,o=this.states.speed,s=void 0===o?1:o;this.playInterval=window.setInterval((function(){i.internalForward()[1]!==r.length||a||(i.internalPause(),i.renderController())}),1e3/s),this.states.state="play",!t&&(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onPlay)||void 0===n||n.call(e))},e.prototype.play=function(){this.internalPlay()},e.prototype.internalPause=function(t){var e,n;clearInterval(this.playInterval),this.states.state="pause",!t&&(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onPause)||void 0===n||n.call(e))},e.prototype.pause=function(){this.internalPause()},e.prototype.internalForward=function(t){var e,n,i=this.moveSelection("forward",t);return t||(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onForward)||void 0===n||n.call(e),this.dispatchOnChange()),i},e.prototype.forward=function(){this.internalForward()},e.prototype.handleSpeedChange=function(t){var e,n;this.states.speed=t,"play"===this.states.state&&(this.internalPause(!0),this.internalPlay(!0)),null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onSpeedChange)||void 0===n||n.call(e,t)},e.prototype.handleSelectionTypeChange=function(t){var e,n;this.states.selectionType=t,this.renderChart(),null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onSelectionTypeChange)||void 0===n||n.call(e,t)},e.prototype.handleChartTypeChange=function(t){var e,n;this.states.chartType=t,this.renderChart(),null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onChartTypeChange)||void 0===n||n.call(e,t)},e.prototype.render=function(){var t=this.space,e=t.axisBBox,n=t.controllerBBox,i=t.timelineBBox;this.renderController(n),this.renderAxis(e),this.renderChart(i),"play"===this.states.state&&this.internalPlay()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.internalPause(!0)},e.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"}},e}(Qy);var ow=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},sw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const lw=["timestamp","time","date","datetime"];class uw extends _v{get padding(){return Hc(this.options.padding)}constructor(t,e){super(t,Object.assign({},uw.defaultOptions,e)),this.backup(),this.upsertTimebar()}play(){var t;null===(t=this.timebar)||void 0===t||t.play()}pause(){var t;null===(t=this.timebar)||void 0===t||t.pause()}forward(){var t;null===(t=this.timebar)||void 0===t||t.forward()}backward(){var t;null===(t=this.timebar)||void 0===t||t.backward()}reset(){var t;null===(t=this.timebar)||void 0===t||t.reset()}update(t){super.update(t),this.backup(),this.upsertTimebar()}backup(){this.originalData=cw(this.context.graph.getData())}upsertTimebar(){const{canvas:t}=this.context,e=this.options,{onChange:n,timebarType:i,data:r,x:a,y:o,width:s,height:l,mode:u}=e,c=sw(e,["onChange","timebarType","data","x","y","width","height","mode"]),h=t.getSize(),[d]=this.padding;this.upsertCanvas().ready.then((()=>{var t;const e=Object.assign(Object.assign({x:h[0]/2-s/2,y:d,onChange:t=>{const e=((0,Fe.Z)(t)?t:[t,t]).map((t=>function(t){return t instanceof Date}(t)?t.getTime():t));"modify"===this.options.mode?this.filterElements(e):this.hiddenElements(e),null==n||n(e)}},c),{data:r.map((t=>(0,oe.Z)(t)?{time:t,value:0}:t)),width:s,height:l,type:i});this.timebar?this.timebar.update(e):(this.timebar=new aw({style:e}),null===(t=this.canvas)||void 0===t||t.appendChild(this.timebar))}))}upsertCanvas(){if(this.canvas)return this.canvas;const{className:t,height:e,position:n}=this.options,i=this.context.canvas,[r]=i.getSize(),[a,,o]=this.padding,[s,l]=eb({width:r,height:e+a+o,graphCanvas:i,className:"timebar",placement:n});return this.container=s,t&&s.classList.add(t),this.canvas=l,this.canvas}filterElements(t){return ow(this,void 0,void 0,(function*(){var e;if(!this.originalData)return;const{elementTypes:n,getTime:i}=this.options,{graph:r,element:a}=this.context,o=cw(this.originalData);n.forEach((e=>{const n=`${e}s`;o[n]=(this.originalData[n]||[]).filter((e=>{const n=i(e);return!!hw(n,t)}))}));const s=[...o.nodes,...o.combos].map((t=>kh(t)));o.edges=o.edges.filter((t=>{const e=t.source,n=t.target;return s.includes(e)&&s.includes(n)})),r.setData(o),yield null===(e=a.draw({animation:!1,silence:!0}))||void 0===e?void 0:e.finished}))}hiddenElements(t){const{graph:e}=this.context,{elementTypes:n,getTime:i}=this.options,r=[],a=[];n.forEach((e=>{var n;const o=`${e}s`;((null===(n=this.originalData)||void 0===n?void 0:n[o])||[]).forEach((e=>{const n=kh(e),o=i(e);hw(o,t)?a.push(n):r.push(n)}))})),e.hideElement(r,!1),e.showElement(a,!1)}destroy(){var t,e,n;const{graph:i}=this.context;this.originalData&&i.setData(Object.assign({},this.originalData)),null===(t=this.timebar)||void 0===t||t.destroy(),null===(e=this.canvas)||void 0===e||e.destroy(),null===(n=this.container)||void 0===n||n.remove(),this.originalData=void 0,this.container=void 0,this.timebar=void 0,this.canvas=void 0,super.destroy()}}uw.defaultOptions={position:"bottom",enable:!0,timebarType:"time",className:"g6-timebar",width:450,height:60,zIndex:3,elementTypes:["node"],padding:10,mode:"modify",getTime:t=>dw(t,lw,void 0),loop:!1};const cw=t=>{const{nodes:e=[],edges:n=[],combos:i=[]}=t;return{nodes:[...e],edges:[...n],combos:[...i]}},hw=(t,e)=>{if((0,oe.Z)(e))return t===e;const[n,i]=e;return t>=n&&t<=i},dw=(t,e,n)=>{var i;for(let n=0;n<e.length;n++){const r=e[n],a=null===(i=t.data)||void 0===i?void 0:i[r];if(a)return a}return n};var fw=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class pw extends _v{constructor(t,e){super(t,Object.assign({},pw.defaultOptions,e)),this.$element=Ev("toolbar",!1),this.onToolbarItemClick=t=>{const{onClick:e}=this.options;if(t.target instanceof Element&&t.target.className.includes("g6-toolbar-item")){const n=t.target.getAttribute("value");null==e||e(n,t.target)}};const n=this.context.canvas.getContainer();this.$element.style.display="flex",n.appendChild(this.$element),wv("g6-toolbar-css","style",{},"\n .g6-toolbar {\n position: absolute;\n z-index: 100;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);\n opacity: 0.65;\n }\n .g6-toolbar .g6-toolbar-item {\n display: inline-block;\n width: 16px;\n height: 16px;\n padding: 4px;\n cursor: pointer;\n box-sizing: content-box;\n }\n\n .g6-toolbar .g6-toolbar-item:hover {\n background-color: #f0f0f0;\n }\n\n .g6-toolbar .g6-toolbar-item svg {\n display: inline-block;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n",document.head),wv("g6-toolbar-svgicon","div",{display:"none"},'\n <svg>\n <symbol id="zoom-in" viewBox="64 64 896 896">\n <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>\n </symbol>\n <symbol id="zoom-out" viewBox="64 64 896 896">\n <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>\n </symbol>\n <symbol id="edit" viewBox="64 64 896 896">\n <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>\n </symbol>\n <symbol id="delete" viewBox="64 64 896 896">\n <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>\n </symbol>\n <symbol id="redo" viewBox="64 64 896 896">\n <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>\n </symbol>\n <symbol id="undo" viewBox="64 64 896 896">\n <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>\n </symbol>\n <symbol id="export" viewBox="64 64 896 896">\n <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>\n </symbol>\n <symbol id="auto-fit" viewBox="64 64 896 896">\n <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>\n <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>\n </symbol>\n <symbol id="reset" viewBox="64 64 896 896">\n <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>\n </symbol>\n <symbol id="exit-fullscreen" viewBox="0 0 1024 1024">\n <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>\n <symbol id="request-fullscreen" viewBox="0 0 1024 1024">\n <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>\n </svg>\n'),this.$element.addEventListener("click",this.onToolbarItemClick),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return fw(this,void 0,void 0,(function*(){e.update.call(this,t);const{className:n,position:i,style:r}=this.options;this.$element.className=`g6-toolbar ${n||""}`,Object.assign(this.$element.style,r,function(t){const e={top:"unset",right:"unset",bottom:"unset",left:"unset"};return t.split("-").forEach((t=>{e[t]="8px"})),e.flexDirection=t.startsWith("top")||t.startsWith("bottom")?"row":"column",e}(i)),this.$element.innerHTML=yield this.getDOMContent()}))}destroy(){this.$element.removeEventListener("click",this.onToolbarItemClick),this.$element.remove(),super.destroy()}getDOMContent(){return fw(this,void 0,void 0,(function*(){return(yield this.options.getItems()).map((t=>`\n <div class="g6-toolbar-item" value="${t.value}">\n <svg aria-hidden="true" focusable="false">\n <use xlink:href="#${t.id}"></use>\n </svg>\n </div>`)).join("")}))}}function gw(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}pw.defaultOptions={position:"top-left"};var mw=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t},vw=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,(0,he.ev)([],(0,he.CR)(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach((function(e){return t.appendChild(e)})):t.appendChild(e)):t.innerHTML=""};function yw(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var xw={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function bw(t){var e;void 0===t&&(t="");var n=yw(t);return(e={})[".".concat(n.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"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=(0,he.pi)({flex:1},xw),e[".".concat(n.VALUE)]=(0,he.pi)({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},xw),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var _w=function(t){function e(e){var n,i,r=this,a=null===(i=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===i?void 0:i.prefixCls,o=yw(a);return(r=t.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}>\n <span class="').concat(o.NAME,'">\n <span class="').concat(o.MARKER,'" style="background:{color}"></span>\n <span class="').concat(o.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(o.VALUE,'" title="{value}">{value}</span>\n </li>')},style:bw(a)})||this).timestamp=-1,r.prevCustomContentKey=r.attributes.contentKey,r.initShape(),r.render(r.attributes,r),r}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var i=t.name,r=void 0===i?"":i,a=t.color,o=void 0===a?"black":a,s=t.index,l=(0,he._T)(t,["name","color","index"]),u=(0,he.pi)({name:r,color:o,index:null!=s?s:e},l);return gw(mw(n.item,u))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var i=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(i):i()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=gw(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:vw(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,i=n.template,r=n.title,a=n.enterable,o=n.style,s=n.content,l=yw(i.prefixCls),u=this.element;if(this.element.style.pointerEvents=a?"auto":"none",s)this.renderCustomContent();else{r?(u.innerHTML=i.title,u.getElementsByClassName(l.TITLE)[0].innerHTML=r):null===(e=null===(t=u.getElementsByClassName(l.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var c=this.HTMLTooltipItemsElements,h=document.createElement("ul");h.className=l.LIST,vw(h,c);var d=this.element.querySelector(".".concat(l.LIST));d?d.replaceWith(h):u.appendChild(h)}!function(t,e){Object.entries(e).forEach((function(e){var n=(0,he.CR)(e,2),i=n[0],r=n[1];(0,he.ev)([t],(0,he.CR)(t.querySelectorAll(i)),!1).filter((function(t){return t.matches(i)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(r).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(u,o)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,i=e.offset,r=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},o=this.elementSize,s=o.width,l=o.height,u=[-s/2,-l/2];return r.forEach((function(t){var e=(0,he.CR)(u,2),n=e[0],r=e[1],o=(0,he.CR)(a[t],2),c=o[0],h=o[1];u=[n+(s/2+i[0])*c,r+(l/2+i[1])*h]})),u},e.prototype.setOffsetPosition=function(t){var e=(0,he.CR)(t,2),n=e[0],i=e[1],r=this.attributes,a=r.x,o=void 0===a?0:a,s=r.y,l=void 0===s?0:s,u=r.container,c=u.x,h=u.y;this.element.style.left="".concat(+o+c+n,"px"),this.element.style.top="".concat(+l+h+i,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestamp<e||(this.timestamp=n,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var e=(0,he.CR)(t,2),n=e[0],i=e[1],r=this.attributes,a=r.x,o=r.y,s=r.bounding,l=r.position;if(!s)return[n,i];var u=this.element,c=u.offsetWidth,h=u.offsetHeight,d=(0,he.CR)([+a+n,+o+i],2),f=d[0],p=d[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},m=s.x,v=s.y,y={left:f<m,right:f+c>m+s.width,top:p<v,bottom:p+h>v+s.height},x=[];l.split("-").forEach((function(t){y[t]?x.push(g[t]):x.push(t)}));var b=x.join("-");return this.getRelativeOffsetFromCursor(b)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),i=n.x,r=n.y,a=n.width,o=n.height;return new lx(i,r,a,o).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout((function(){e.element.style.transition=n}),10)},e.tag="tooltip",e}(Qy);class Ew extends _v{constructor(t,e){super(t,Object.assign({},Ew.defaultOptions,e)),this.currentTarget=null,this.tooltipElement=null,this.container=null,this.isEnable=t=>{const{enable:e}=this.options;return"function"==typeof e?e(t):e},this.onClick=t=>{const{target:{id:e}}=t;this.currentTarget===e?(this.hide(t),this.currentTarget=null):(this.currentTarget=e,this.show(t))},this.onPointerMove=t=>{const{target:e}=t;this.currentTarget&&e.id!==this.currentTarget&&this.show(t)},this.onPointerLeave=t=>{this.hide(t),this.currentTarget=null},this.onCanvasMove=t=>{this.hide(t),this.currentTarget=null},this.onPointerEnter=t=>{this.show(t)},this.showById=t=>{const e={target:{id:t}};this.show(e)},this.getElementData=(t,e)=>{const{model:n}=this.context;switch(e){case"node":return n.getNodeData([t]);case"edge":return n.getEdgeData([t]);case"combo":return n.getComboData([t]);default:return[]}},this.show=t=>{const{client:e,target:{id:n}}=t;if(Tm(t.target))return;if(!this.tooltipElement||!this.isEnable(t))return;const i=this.context.graph.getElementType(n),{getContent:r,title:a}=this.options;this.currentTarget=n;const o=this.getElementData(n,i);let s,l;if(e)s=e.x,l=e.y;else{const t=Wd(o,"0.style",{x:0,y:0});s=t.x,l=t.y}let u={};if(r)u.content=r(t,o);else{const t=this.context.graph.getElementRenderStyle(n),e="node"===i?t.fill:t.stroke;u={title:a||i,data:o.map((t=>({name:"ID",value:t.id||`${t.source} -> ${t.target}`,color:e})))}}this.tooltipElement.update(Object.assign(Object.assign(Object.assign({},this.tooltipStyleProps),{x:s,y:l,style:{".tooltip":{visibility:"visible"}}}),u))},this.hide=t=>{var e;if(!t)return void(null===(e=this.tooltipElement)||void 0===e||e.hide());if(!this.tooltipElement)return;if(!this.currentTarget)return;const{client:{x:n,y:i}}=t;this.tooltipElement.hide(n,i)},this.initTooltip=()=>{var t;const e=new _w({className:"tooltip",style:this.tooltipStyleProps});return null===(t=this.container)||void 0===t||t.appendChild(e.HTMLTooltipElement),e},this.render(),this.bindEvents()}getEvents(){return"click"===this.options.trigger?{"node:click":this.onClick,"edge:click":this.onClick,"combo:click":this.onClick,"canvas:click":this.onPointerLeave,contextmenu:this.onPointerLeave,drag:this.onPointerLeave}:{"node:pointerenter":this.onPointerEnter,"node:pointermove":this.onPointerMove,"canvas:pointermove":this.onCanvasMove,"edge:pointerenter":this.onPointerEnter,"edge:pointermove":this.onPointerMove,"combo:pointerenter":this.onPointerEnter,"combo:pointermove":this.onPointerMove,contextmenu:this.onPointerLeave,"node:drag":this.onPointerLeave}}update(t){var e;this.unbindEvents(),super.update(t),this.tooltipElement&&(null===(e=this.container)||void 0===e||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((n=>{t.off(n,e[n])}))}bindEvents(){const{graph:t}=this.context,e=this.getEvents();Object.keys(e).forEach((n=>{t.on(n,e[n])}))}get tooltipStyleProps(){const{canvas:t}=this.context,{center:e}=t.getBounds(),n=t.getContainer(),{top:i,left:r}=n.getBoundingClientRect(),{style:a,position:o,enterable:s,container:l={x:-r,y:-i},title:u,offset:c}=this.options,[h,d]=e,[f,p]=t.getSize();return{x:h,y:d,container:l,title:u,bounding:{x:0,y:0,width:f,height:p},position:o,enterable:s,offset:c,style:a}}destroy(){var t;this.unbindEvents(),this.tooltipElement&&(null===(t=this.container)||void 0===t||t.removeChild(this.tooltipElement.HTMLTooltipElement)),super.destroy()}}Ew.defaultOptions={trigger:"hover",position:"top-right",enterable:!1,enable:!0,offset:[10,10],style:{".tooltip":{visibility:"hidden"}}};var ww=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};let Tw;function Sw(t,e){Tw||(Tw=document.createElement("canvas")),Tw.width=t,Tw.height=e;return Tw.getContext("2d").clearRect(0,0,t,e),Tw}var Mw=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},Cw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class Aw extends _v{constructor(t,e){super(t,Object.assign({},Aw.defaultOptions,e)),this.$element=Ev("watermark");this.context.canvas.getContainer().appendChild(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return Mw(this,void 0,void 0,(function*(){e.update.call(this,t);const n=this.options,{width:i,height:r,text:a,imageURL:o}=n,s=Cw(n,["width","height","text","imageURL"]);Object.keys(s).forEach((e=>{e.startsWith("background")&&(this.$element.style[e]=t[e])}));const l=o?yield function(t,e,n,i){return ww(this,void 0,void 0,(function*(){const r=Sw(t,e),a=r.getContext("2d"),{rotate:o,opacity:s}=i;o&&a.rotate(o),s&&(a.globalAlpha=s);const l=new Image;return l.crossOrigin="anonymous",l.src=n,new Promise((n=>{l.onload=function(){const i=t>l.width?(t-l.width)/2:0,o=e>l.height?(e-l.height)/2:0;a.drawImage(l,0,0,l.width,l.height,i,o,t-2*i,e-2*o),n(r.toDataURL())}}))}))}(i,r,o,s):yield function(t,e,n,i){return ww(this,void 0,void 0,(function*(){const r=Sw(t,e),a=r.getContext("2d"),{rotate:o,opacity:s,textFill:l,textFontSize:u,textFontFamily:c,textFontVariant:h,textFontWeight:d,textAlign:f,textBaseline:p}=i;return a.textAlign=f,a.textBaseline=p,a.translate(t/2,e/2),a.font=`${u}px ${c} ${h} ${d}`,o&&a.rotate(o),s&&(a.globalAlpha=s),l&&(a.fillStyle=l,a.fillText(`${n}`,0,0)),r.toDataURL()}))}(i,r,a,s);this.$element.style.backgroundImage=`url(${l})`}))}destroy(){super.destroy(),this.$element.remove()}}Aw.defaultOptions={width:200,height:100,opacity:.2,rotate:Math.PI/12,text:"",textFill:"#000",textFontSize:16,textAlign:"center",textBaseline:"middle",backgroundRepeat:"repeat"};var Ow=function(){function t(e){(0,o.Z)(this,t),this.dragndropPluginOptions=e}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=this,i=e.renderingService,r=e.renderingContext.root.ownerDocument,a=r.defaultView,o=function(t){var e=t.target,i=e===r,o=i&&n.dragndropPluginOptions.isDocumentDraggable?r:e.closest&&e.closest("[draggable=true]");if(o){var s=!1,l=t.timeStamp,u=[t.clientX,t.clientY],c=null,h=[t.clientX,t.clientY],d=function(){var t=(0,li.Z)((0,si.Z)().mark((function t(a){var d,f,p,g,m,v;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=8;break}if(d=a.timeStamp-l,f=se([a.clientX,a.clientY],u),!(d<=n.dragndropPluginOptions.dragstartTimeThreshold||f<=n.dragndropPluginOptions.dragstartDistanceThreshold)){t.next=5;break}return t.abrupt("return");case 5:a.type="dragstart",o.dispatchEvent(a),s=!0;case 8:if(a.type="drag",a.dx=a.clientX-h[0],a.dy=a.clientY-h[1],o.dispatchEvent(a),h=[a.clientX,a.clientY],i){t.next=21;break}return p="pointer"===n.dragndropPluginOptions.overlap?[a.canvasX,a.canvasY]:e.getBounds().center,t.next=17,r.elementsFromPoint(p[0],p[1]);case 17:g=t.sent,m=g[g.indexOf(e)+1],v=(null==m?void 0:m.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?r:null),c!==v&&(c&&(a.type="dragleave",a.target=c,c.dispatchEvent(a)),v&&(a.type="dragenter",a.target=v,v.dispatchEvent(a)),(c=v)&&(a.type="dragover",a.target=c,c.dispatchEvent(a)));case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();a.addEventListener("pointermove",d);var f=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();c&&(e.type="drop",e.target=c,c.dispatchEvent(e)),e.type="dragend",o.dispatchEvent(e),s=!1}a.removeEventListener("pointermove",d)};e.addEventListener("pointerup",f,{once:!0}),e.addEventListener("pointerupoutside",f,{once:!0})}};i.hooks.init.tap(t.tag,(function(){a.addEventListener("pointerdown",o)})),i.hooks.destroy.tap(t.tag,(function(){a.removeEventListener("pointerdown",o)}))}}])}();Ow.tag="Dragndrop";var Nw=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),(t=d(this,e)).name="dragndrop",t.options=n,t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){this.addRenderingPlugin(new Ow((0,a.Z)({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(mi),Pw=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},Lw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const Rw=["main"],Dw=["background","main","label","transient"];class kw{getConfig(){return this.config}getLayer(t="main"){return this.extends.layers[t]||this.getLayers().main}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:n,background:i,cursor:r,enableMultiLayer:a}=e,o=Lw(e,["renderer","background","cursor","enableMultiLayer"]),s=a?Dw:Rw,l=Iw(n,s),u=Object.fromEntries(s.map((t=>[t,new Ql(Object.assign(Object.assign({},o),{supportsMutipleCanvasesInOneContainer:a,renderer:l[t],background:a?"background"===t?i:void 0:i}))])));Bw(u),this.extends={config:this.config,renderer:n,renderers:l,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((n=>{const i=n.getCamera(),r=i.getPosition(),a=i.getFocalPoint();n.resize(t,e),i.setPosition(r),i.setFocalPoint(a)}))}getBounds(t){return Kc(Object.values(this.getLayers()).map((e=>t?e.getRoot().childNodes.find((e=>e.classList.includes(t))):e.getRoot())).filter((t=>(null==t?void 0:t.childNodes.length)>0)).map((t=>t.getBounds())))}getContainer(){const t=this.extends.config.container;return"string"==typeof t?document.getElementById(t):t}getSize(){return[this.extends.config.width||0,this.extends.config.height||0]}appendChild(t,e){var n;const i=(null===(n=t.style)||void 0===n?void 0:n.$layer)||"main";return this.getLayer(i).appendChild(t,e)}setRenderer(t){if(t===this.extends.renderer)return;const e=Iw(t,this.config.enableMultiLayer?Dw:Rw);this.extends.renderers=e,Object.entries(e).forEach((([t,e])=>this.getLayer(t).setRenderer(e))),Bw(this.getLayers())}getCanvasByViewport(t){return _d(this.getLayer().viewport2Canvas(Ed(t)))}getViewportByCanvas(t){return _d(this.getLayer().canvas2Viewport(Ed(t)))}getViewportByClient(t){return _d(this.getLayer().client2Viewport(Ed(t)))}getClientByViewport(t){return _d(this.getLayer().viewport2Client(Ed(t)))}getClientByCanvas(t){return this.getClientByViewport(this.getViewportByCanvas(t))}getCanvasByClient(t){const e=this.getLayer(),n=e.client2Viewport(Ed(t));return _d(e.viewport2Canvas(n))}toDataURL(){return Pw(this,arguments,void 0,(function*(t={}){const e=globalThis.devicePixelRatio||1,{mode:n="viewport"}=t,i=Lw(t,["mode"]);let[r,a,o,s]=[0,0,0,0];if("viewport"===n)[o,s]=this.getSize();else if("overall"===n){const t=this.getBounds(),e=Xc(t);[r,a]=t.min,[o,s]=e}const l=gw('<div id="virtual-image"></div>'),u=new Ql({width:o,height:s,renderer:new rg,devicePixelRatio:e,container:l,background:this.extends.config.background});yield u.ready,u.appendChild(this.getLayer("background").getRoot().cloneNode(!0)),u.appendChild(this.getRoot().cloneNode(!0));const c=this.getLayer("label").getRoot().cloneNode(!0),h=u.viewport2Canvas({x:0,y:0}),d=this.getCanvasByViewport([0,0]);c.translate([d[0]-h.x,d[1]-h.y]),c.scale(1/this.getCamera().getZoom()),u.appendChild(c),u.appendChild(this.getLayer("transient").getRoot().cloneNode(!0));const f=this.getCamera(),p=u.getCamera();if("viewport"===n)p.setZoom(f.getZoom()),p.setPosition(f.getPosition()),p.setFocalPoint(f.getFocalPoint());else if("overall"===n){const[t,e,n]=p.getPosition(),[i,o,s]=p.getFocalPoint();p.setPosition([t+r,e+a,n]),p.setFocalPoint([i+r,o+a,s])}const g=u.getContextService();return new Promise((t=>{u.addEventListener(Wl.RERENDER,(()=>Pw(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,300)));const e=yield g.toDataURL(i);t(e)}))))}))}))}destroy(){Object.values(this.getLayers()).forEach((t=>{t.getCamera().cancelLandmarkAnimation(),t.destroy()}))}}function Iw(t,e){return Object.fromEntries(e.map((e=>{const n=(null==t?void 0:t(e))||new rg;return"main"===e?n.registerPlugin(new Nw({isDocumentDraggable:!0,isDocumentDroppable:!0,dragstartDistanceThreshold:10,dragstartTimeThreshold:100})):n.unregisterPlugin(n.getPlugin("dom-interaction")),[e,n]})))}function Bw(t){Object.entries(t).forEach((([t,e])=>{const n=e.getContextService().getDomElement();(null==n?void 0:n.style)&&(n.style.gridArea="1 / 1 / 2 / 2",n.style.outline="none",n.tabIndex=1,"main"!==t&&(n.style.pointerEvents="none")),(null==n?void 0:n.parentElement)&&(n.parentElement.style.display="grid")}))}const Fw=t=>t?parseInt(t):0;function zw(t){if(!t)return[0,0];let e=640,n=480;const[i,r]=function(t){const e=getComputedStyle(t),n=t.clientWidth||Fw(e.width),i=t.clientHeight||Fw(e.height);return[n-(Fw(e.paddingLeft)+Fw(e.paddingRight)),i-(Fw(e.paddingTop)+Fw(e.paddingBottom))]}(t);e=i||e,n=r||n;return[Math.max((0,oe.Z)(e)?e:1,1),Math.max((0,oe.Z)(n)?n:1,1)]}class Gw{constructor(t){this.type=t}}class jw extends Gw{constructor(t,e){super(t),this.data=e}}class Uw extends Gw{constructor(t,e,n,i){super(t),this.animationType=e,this.animation=n,this.data=i}}class Hw extends Gw{constructor(t,e,n){super(t),this.elementType=e,this.data=n}}class Vw extends Gw{constructor(t,e){super(t),this.data=e}}function Zw(t,e){t.emit(e.type,e)}function Ww(t){var e;return(null===(e=null==t?void 0:t.style)||void 0===e?void 0:e.zIndex)||0}const Xw="cachedStyle",Yw=t=>`__${t}__`;function qw(t,e){return Wd(t,[Xw,Yw(e)])}class $w{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,n){var i,r,a;null===(i=null==e?void 0:e.before)||void 0===i||i.call(e);const o=this.getTasks().map((([e,i])=>{var r,a,o;const{element:s,elementType:l,stage:u}=e,c=Cc(this.context.options,l,u,t);null===(r=null==i?void 0:i.before)||void 0===r||r.call(i);const h=c.length?Nc(s,this.inferStyle(e,n),c):null;return h?(null===(a=null==i?void 0:i.beforeAnimate)||void 0===a||a.call(i,h),h.finished.then((()=>{var t,e;null===(t=null==i?void 0:i.afterAnimate)||void 0===t||t.call(i,h),null===(e=null==i?void 0:i.after)||void 0===e||e.call(i),this.animations.delete(h)}))):null===(o=null==i?void 0:i.after)||void 0===o||o.call(i),h})).filter(Boolean);o.forEach((t=>this.animations.add(t)));const s=wc(o);return s?(null===(r=null==e?void 0:e.beforeAnimate)||void 0===r||r.call(e,s),s.finished.then((()=>{var t,n;null===(t=null==e?void 0:e.afterAnimate)||void 0===t||t.call(e,s),null===(n=null==e?void 0:e.after)||void 0===n||n.call(e),this.release()}))):null===(a=null==e?void 0:e.after)||void 0===a||a.call(e),s}inferStyle(t,e){var n,i;const{element:r,elementType:a,stage:o,originalStyle:s,updatedStyle:l={}}=t;t.modifiedStyle||(t.modifiedStyle=Object.assign(Object.assign({},s),l));const{modifiedStyle:u}=t,c={},h={};if("enter"===o)Object.assign(c,{opacity:0});else if("exit"===o)Object.assign(h,{opacity:0});else if("show"===o)Object.assign(c,{opacity:0}),Object.assign(h,{opacity:null!==(n=qw(r,"opacity"))&&void 0!==n?n:Sc("opacity")});else if("hide"===o)Object.assign(c,{opacity:null!==(i=qw(r,"opacity"))&&void 0!==i?i:Sc("opacity")}),Object.assign(h,{opacity:0});else if("collapse"===o){const{collapse:t}=e||{},{target:n,descendants:i,position:o}=t;if("node"===a){if(i.includes(r.id)){const[t,e,n]=o;Object.assign(h,{x:t,y:e,z:n})}}else if("combo"===a){if(r.id===n||i.includes(r.id)){const[t,e]=o;Object.assign(h,{x:t,y:e,childrenNode:s.childrenNode})}}else"edge"===a&&Object.assign(h,{sourceNode:u.sourceNode,targetNode:u.targetNode})}else if("expand"===o){const{expand:t}=e||{},{target:n,descendants:i,position:o}=t;if("node"===a){if(r.id===n||i.includes(r.id)){const[t,e,n]=o;Object.assign(c,{x:t,y:e,z:n})}}else if("combo"===a){if(r.id===n||i.includes(r.id)){const[t,e,n]=o;Object.assign(c,{x:t,y:e,z:n,childrenNode:u.childrenNode})}}else"edge"===a&&Object.assign(c,{sourceNode:u.sourceNode,targetNode:u.targetNode})}return[Object.keys(c).length>0?Object.assign({},s,c):s,Object.keys(h).length>0?Object.assign({},u,h):u]}stop(){this.animations.forEach((t=>t.cancel()))}clear(){this.tasks=[]}release(){var t,e;const{canvas:n}=this.context,i=null===(e=null===(t=n.document)||void 0===t?void 0:t.timeline)||void 0===e?void 0:e.animationsWithPromises;i&&(n.document.timeline.animationsWithPromises=i.filter((t=>"finished"!==t.playState)))}destroy(){this.stop(),this.animations.clear(),this.tasks=[]}}class Kw{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++,1===this.batchCount&&this.emit(new jw(dc.BATCH_START,{initiate:t}))}endBatch(){this.batchCount--,0===this.batchCount&&this.emit(new jw(dc.BATCH_END))}get isBatching(){return this.batchCount>0}destroy(){this.context=null}}class Qw extends qh{constructor(t){super(t),this.currentTarget=null,this.currentTargetType=null,this.category="behavior",this.forwardCanvasEvents=t=>{const{target:e}=t,n=function(t){if(!t)return null;if(t instanceof Gl)return{type:"canvas",element:t};let e=t;for(;e;){if(cm(e))return{type:"node",element:e};if(hm(e))return{type:"edge",element:e};if(dm(e))return{type:"combo",element:e};e=e.parentElement}return null}(e);if(!n)return;const{graph:i,canvas:r}=this.context,{type:a,element:o}=n;if("destroyed"in o&&(Tm(o)||o.destroyed))return;const{type:s,detail:l,button:u}=t,c=Object.assign(Object.assign({},t),{target:o,targetType:a,originalTarget:e});s===uc.POINTER_MOVE&&(this.currentTarget!==o&&(this.currentTarget&&i.emit(`${this.currentTargetType}:${uc.POINTER_LEAVE}`,Object.assign(Object.assign({},c),{type:uc.POINTER_LEAVE,target:this.currentTarget,targetType:this.currentTargetType})),o&&(Object.assign(c,{type:uc.POINTER_ENTER}),i.emit(`${a}:${uc.POINTER_ENTER}`,c))),this.currentTarget=o,this.currentTargetType=a),s===uc.CLICK&&2===u||(i.emit(`${a}:${s}`,c),i.emit(s,c)),s===uc.CLICK&&2===l&&(Object.assign(c,{type:uc.DBLCLICK}),i.emit(`${a}:${uc.DBLCLICK}`,c),i.emit(uc.DBLCLICK,c)),s===uc.POINTER_DOWN&&2===u&&(Object.assign(c,{type:uc.CONTEXT_MENU,preventDefault:()=>{var t;null===(t=r.getContainer())||void 0===t||t.addEventListener(uc.CONTEXT_MENU,(t=>t.preventDefault()),{once:!0})}}),i.emit(`${a}:${uc.CONTEXT_MENU}`,c),i.emit(uc.CONTEXT_MENU,c))},this.forwardContainerEvents=t=>{this.context.graph.emit(t.type,t)},this.forwardEvents(),this.setBehaviors(this.context.options.behaviors||[])}setBehaviors(t){this.setExtensions(t)}forwardEvents(){const t=this.context.canvas.getContainer();t&&[cc.KEY_DOWN,cc.KEY_UP].forEach((e=>{t.addEventListener(e,this.forwardContainerEvents)}));const e=this.context.canvas.document;e&&[uc.CLICK,uc.DBLCLICK,uc.POINTER_OVER,uc.POINTER_LEAVE,uc.POINTER_ENTER,uc.POINTER_MOVE,uc.POINTER_OUT,uc.POINTER_DOWN,uc.POINTER_UP,uc.CONTEXT_MENU,uc.DRAG_START,uc.DRAG,uc.DRAG_END,uc.DRAG_ENTER,uc.DRAG_OVER,uc.DRAG_LEAVE,uc.DROP,uc.WHEEL].forEach((t=>{e.addEventListener(t,this.forwardCanvasEvents)}))}destroy(){const t=this.context.canvas.getContainer();t&&[cc.KEY_DOWN,cc.KEY_UP].forEach((e=>{t.removeEventListener(e,this.forwardContainerEvents)})),this.context.canvas.document.removeAllEventListeners(),super.destroy()}}var Jw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function tT(t,e){const{data:n,style:i}=t,r=Jw(t,["data","style"]),{data:a,style:o}=e,s=Jw(e,["data","style"]),l=Object.assign(Object.assign({},r),s);return(n||a)&&Object.assign(l,{data:Object.assign(Object.assign({},n),a)}),(i||o)&&Object.assign(l,{style:Object.assign(Object.assign({},i),o)}),l}function eT(t){const{data:e,style:n}=t,i=Jw(t,["data","style"]);return e&&(i.data=Object.assign({},e)),n&&(i.style=Object.assign({},n)),i}function nT(t={},e={}){const{states:n=[],data:i={},style:r={},children:a=[]}=t,o=Jw(t,["states","data","style","children"]),{states:s=[],data:l={},style:u={},children:c=[]}=e,h=(t,e)=>t.length===e.length&&t.every(((t,n)=>t===e[n])),d=(t,e)=>{const n=Object.keys(t),i=Object.keys(e);return n.length===i.length&&n.every((n=>t[n]===e[n]))};return!!d(o,Jw(e,["states","data","style","children"]))&&(!!h(a,c)&&(!!h(n,s)&&(!!d(i,l)&&!!d(r,u))))}var iT=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function rT(t){const{id:e=kh(t),style:n,data:i}=t,r=iT(t,["id","style","data"]),a=Object.assign(Object.assign({},t),{style:Object.assign({},n),data:Object.assign({},i)});return function(t){return"source"in t&&"target"in t}(t)?Object.assign({id:e,data:a},r):{id:e,data:a}}function aT(t){return t.data}class oT{constructor(){this.latestRemovedComboIds=new Set,this.comboIds=new Set,this.changes=[],this.batchCount=0,this.isTraceless=!1,this.enableUpdateNodeLikeHierarchy=!0,this.model=new Im.k}pushChange(t){if(this.isTraceless)return;const{type:e}=t;if(e===ac.NodeUpdated||e===ac.EdgeUpdated||e===ac.ComboUpdated){const{value:n,original:i}=t;this.changes.push({value:eT(n),original:eT(i),type:e})}else this.changes.push({value:eT(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,n)=>{const i=aT(n);return this.isCombo(kh(i))||(void 0===t||t.includes(kh(i)))&&e.push(i),e}),[])}getEdgeDatum(t){return aT(this.model.getEdge(t))}getEdgeData(t){return this.model.getAllEdges().reduce(((e,n)=>{const i=aT(n);return(void 0===t||t.includes(kh(i)))&&e.push(i),e}),[])}getComboData(t){return this.model.getAllNodes().reduce(((e,n)=>{const i=aT(n);return this.isCombo(kh(i))?((void 0===t||t.includes(kh(i)))&&e.push(i),e):e}),[])}getRootsData(t=mc){return this.model.getRoots(t).map(aT)}getAncestorsData(t,e){const{model:n}=this;return n.hasNode(t)&&n.hasTreeStructure(e)?n.getAncestors(t,e).map(aT):[]}getDescendantsData(t){const e=this.getElementDataById(t),n=[];return zd(e,(t=>{t!==e&&n.push(t)}),(t=>this.getChildrenData(kh(t))),"TB"),n}getParentData(t,e){const{model:n}=this;if(!e)return void _c.warn("The hierarchy structure key is not specified");if(!n.hasNode(t)||!n.hasTreeStructure(e))return;const i=n.getParent(t,e);return i?aT(i):void 0}getChildrenData(t){const e="node"===this.getElementType(t)?mc:gc,{model:n}=this;return n.hasNode(t)&&n.hasTreeStructure(e)?n.getChildren(t,e).map(aT):[]}getElementsDataByType(t){return"node"===t?this.getNodeData():"edge"===t?this.getEdgeData():"combo"===t?this.getComboData():[]}getElementDataById(t){return"edge"===this.getElementType(t)?this.getEdgeDatum(t):this.getNodeLikeDatum(t)}getNodeLikeDatum(t){return aT(this.model.getNode(t))}getNodeLikeData(t){return this.model.getAllNodes().reduce(((e,n)=>{const i=aT(n);return t?t.includes(kh(i))&&e.push(i):e.push(i),e}),[])}getElementDataByState(t,e){return this.getElementsDataByType(t).filter((t=>{var n;return null===(n=t.states)||void 0===n?void 0:n.includes(e)}))}getElementState(t){var e;return(null===(e=this.getElementDataById(t))||void 0===e?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(aT)}getNeighborNodesData(t){return this.model.getNeighbors(t).map(aT)}setData(t){const{nodes:e=[],edges:n=[],combos:i=[]}=t,{nodes:r,edges:a,combos:o}=this.getData(),s=Wh(r,e,(t=>kh(t)),nT),l=Wh(a,n,(t=>kh(t)),nT),u=Wh(o,i,(t=>kh(t)),nT);this.batch((()=>{const t={nodes:s.enter,edges:l.enter,combos:u.enter};this.addData(t),this.computeZIndex(t,"add",!0);const e={nodes:s.update,edges:l.update,combos:u.update};this.updateData(e),this.computeZIndex(e,"update",!0);const n={nodes:s.exit.map(kh),edges:l.exit.map(kh),combos:u.exit.map(kh)};this.removeData(n)}))}addData(t){const{nodes:e,edges:n,combos:i}=t;this.batch((()=>{this.addComboData(i),this.addNodeData(e),this.addEdgeData(n)})),this.computeZIndex(t,"add")}addNodeData(t=[]){t.length&&(this.model.addNodes(t.map((t=>(this.pushChange({value:t,type:ac.NodeAdded}),rT(t))))),this.updateNodeLikeHierarchy(t),this.computeZIndex({nodes:t},"add"))}addEdgeData(t=[]){t.length&&(this.model.addEdges(t.map((t=>(this.pushChange({value:t,type:ac.EdgeAdded}),rT(t))))),this.computeZIndex({edges:t},"add"))}addComboData(t=[]){if(!t.length)return;const{model:e}=this;e.hasTreeStructure(gc)||e.attachTreeStructure(gc),e.addNodes(t.map((t=>(this.comboIds.add(kh(t)),this.pushChange({value:t,type:ac.ComboAdded}),rT(t))))),this.updateNodeLikeHierarchy(t),this.computeZIndex({combos:t},"add")}addChildrenData(t,e){const n=this.getNodeLikeDatum(t),i=e.map(kh);this.addNodeData(e),this.updateNodeData([{id:t,children:[...n.children||[],...i]}]),this.addEdgeData(i.map((e=>({source:t,target:e}))))}computeZIndex(t,e,n=!1){!n&&this.isBatching()||this.batch((()=>{const{nodes:n=[],edges:i=[],combos:r=[]}=t;r.forEach((t=>{var n,i,r;const a=kh(t);if("add"===e&&(0,oe.Z)(null===(n=t.style)||void 0===n?void 0:n.zIndex))return;if("update"===e&&!("combo"in t))return;const o=this.getParentData(a,gc),s=o?(null!==(r=null===(i=o.style)||void 0===i?void 0:i.zIndex)&&void 0!==r?r:0)+1:0;this.preventUpdateNodeLikeHierarchy((()=>{this.updateComboData([{id:a,style:{zIndex:s}}])}))})),n.forEach((t=>{var n,i,r;const a=kh(t);if("add"===e&&(0,oe.Z)(null===(n=t.style)||void 0===n?void 0:n.zIndex))return;if("update"===e&&!("combo"in t)&&!("children"in t))return;let o=0;const s=this.getParentData(a,gc);if(s)o=((null===(i=s.style)||void 0===i?void 0:i.zIndex)||0)+1;else{const t=this.getParentData(a,mc);t&&(o=(null===(r=null==t?void 0:t.style)||void 0===r?void 0:r.zIndex)||0)}this.preventUpdateNodeLikeHierarchy((()=>{this.updateNodeData([{id:a,style:{zIndex:o}}])}))})),i.forEach((t=>{var e,n,i,r,a;if((0,oe.Z)(null===(e=t.style)||void 0===e?void 0:e.zIndex))return;let{id:o,source:s,target:l}=t;if(o){const t=this.getEdgeDatum(o);s=t.source,l=t.target}else o=kh(t);if(!s||!l)return;const u=(null===(i=null===(n=this.getNodeLikeDatum(s))||void 0===n?void 0:n.style)||void 0===i?void 0:i.zIndex)||0,c=(null===(a=null===(r=this.getNodeLikeDatum(l))||void 0===r?void 0:r.style)||void 0===a?void 0:a.zIndex)||0;this.updateEdgeData([{id:kh(t),style:{zIndex:Math.max(u,c)-1}}])}))}))}getFrontZIndex(t){var e;const n=this.getElementType(t),i=this.getElementDataById(t),r=this.getData();if(Object.assign(r,{[`${n}s`]:r[`${n}s`].filter((e=>kh(e)!==t))}),"combo"===n&&!Zd(i)){const e=new Set(this.getAncestorsData(t,gc).map(kh));r.nodes=r.nodes.filter((t=>!e.has(kh(t)))),r.combos=r.combos.filter((t=>!e.has(kh(t)))),r.edges=r.edges.filter((({source:t,target:n})=>!e.has(t)&&!e.has(n)))}return Math.max((null===(e=i.style)||void 0===e?void 0:e.zIndex)||0,0,...Object.values(r).flat().map((t=>{var e;return((null===(e=null==t?void 0:t.style)||void 0===e?void 0:e.zIndex)||0)+1})))}updateNodeLikeHierarchy(t){if(!this.enableUpdateNodeLikeHierarchy)return;const{model:e}=this;t.forEach((t=>{const n=kh(t);Ih(t)&&(e.hasTreeStructure(gc)||e.attachTreeStructure(gc),this.setParent(n,Ih(t),gc));const i=t.children||[];if(i.length){e.hasTreeStructure(mc)||e.attachTreeStructure(mc);const t=i.filter((t=>e.hasNode(t)));t.forEach((t=>this.setParent(t,n,mc))),t.length!==i.length&&this.updateNodeData([{id:n,children:t}])}}))}preventUpdateNodeLikeHierarchy(t){this.enableUpdateNodeLikeHierarchy=!1,t(),this.enableUpdateNodeLikeHierarchy=!0}updateData(t){const{nodes:e,edges:n,combos:i}=t;this.batch((()=>{this.updateNodeData(e),this.updateComboData(i),this.updateEdgeData(n)})),this.computeZIndex(t,"update")}updateNodeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch((()=>{const n=[];t.forEach((t=>{const i=kh(t),r=aT(e.getNode(i));if(nT(r,t))return;const a=tT(r,t);this.pushChange({value:a,original:r,type:ac.NodeUpdated}),e.mergeNodeData(i,a),n.push(a)})),this.updateNodeLikeHierarchy(n)})),this.computeZIndex({nodes:t},"update")}refreshData(){const{nodes:t,edges:e,combos:n}=this.getData();t.forEach((t=>{this.pushChange({value:t,original:t,type:ac.NodeUpdated})})),e.forEach((t=>{this.pushChange({value:t,original:t,type:ac.EdgeUpdated})})),n.forEach((t=>{this.pushChange({value:t,original:t,type:ac.ComboUpdated})}))}syncNodeDatum(t){const{model:e}=this,n=kh(t),i=tT(aT(e.getNode(n)),t);e.mergeNodeData(n,i)}updateEdgeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch((()=>{t.forEach((t=>{const n=kh(t),i=aT(e.getEdge(n));if(nT(i,t))return;t.source&&i.source!==t.source&&e.updateEdgeSource(n,t.source),t.target&&i.target!==t.target&&e.updateEdgeTarget(n,t.target);const r=tT(i,t);this.pushChange({value:r,original:i,type:ac.EdgeUpdated}),e.mergeEdgeData(n,r)}))})),this.computeZIndex({edges:t},"update")}updateComboData(t=[]){if(!t.length)return;const{model:e}=this;e.batch((()=>{const n=[];t.forEach((t=>{const i=kh(t),r=aT(e.getNode(i));if(nT(r,t))return;const a=tT(r,t);this.pushChange({value:a,original:r,type:ac.ComboUpdated}),e.mergeNodeData(i,a),n.push(a)})),this.updateNodeLikeHierarchy(n)})),this.computeZIndex({combos:t},"update")}setParent(t,e,n,i=!0){if(t===e)return;const r=Ih(this.getNodeLikeDatum(t));if(r!==e&&n===gc){const n={id:t,combo:e};this.isCombo(t)?this.syncComboDatum(n):this.syncNodeDatum(n)}this.model.setParent(t,e,n),i&&n===gc&&function(t,e){void 0===e&&(e=new Map);var n=[];if(Array.isArray(t))for(var i=0,r=t.length;i<r;i++){var a=t[i];e.has(a)||(n.push(a),e.set(a,!0))}return n}([r,e]).forEach((t=>{void 0!==t&&this.refreshComboData(t)}))}refreshComboData(t){const e=this.getComboData([t])[0],n=this.getAncestorsData(t,gc);e&&this.pushChange({value:e,original:e,type:ac.ComboUpdated}),n.forEach((t=>{this.pushChange({value:t,original:t,type:ac.ComboUpdated})}))}syncComboDatum(t){const{model:e}=this,n=kh(t);if(!e.hasNode(n))return;const i=tT(aT(e.getNode(n)),t);e.mergeNodeData(n,i)}getElementPosition(t){return vd(this.getElementDataById(t))}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 n=ed(this.getElementPosition(t),[...e,0].slice(0,3));this.translateNodeTo(t,n)}translateNodeTo(t,e){const[n=0,i=0,r=0]=e;this.preventUpdateNodeLikeHierarchy((()=>{this.updateNodeData([{id:t,style:{x:n,y:i,z:r}}])}))}translateComboBy(t,e){const[n=0,i=0,r=0]=e;if([n,i,r].some(isNaN)||[n,i,r].every((t=>0===t)))return;const a=this.getComboData([t])[0];if(!a)return;const o=new Set;zd(a,(t=>{const e=kh(t);if(o.has(e))return;o.add(e);const[a,s,l]=vd(t),u=tT(t,{style:{x:a+n,y:s+i,z:l+r}});this.pushChange({value:u,original:t,type:this.isCombo(e)?ac.ComboUpdated:ac.NodeUpdated}),this.model.mergeNodeData(e,u)}),(t=>this.getChildrenData(kh(t))),"BT")}translateComboTo(t,e){var n;if(e.some(isNaN))return;const[i=0,r=0,a=0]=e,o=null===(n=this.getComboData([t]))||void 0===n?void 0:n[0];if(!o)return;const[s,l,u]=vd(o),c=i-s,h=r-l,d=a-u;zd(o,(t=>{const e=kh(t),[n,i,r]=vd(t),a=tT(t,{style:{x:n+c,y:i+h,z:r+d}});this.pushChange({value:a,original:t,type:this.isCombo(e)?ac.ComboUpdated:ac.NodeUpdated}),this.model.mergeNodeData(e,a)}),(t=>this.getChildrenData(kh(t))),"BT")}removeData(t){const{nodes:e,edges:n,combos:i}=t;this.batch((()=>{this.removeEdgeData(n),this.removeNodeData(e),this.removeComboData(i),this.latestRemovedComboIds=new Set(i)}))}removeNodeData(t=[]){t.length&&this.batch((()=>{t.forEach((t=>{this.removeEdgeData(this.getRelatedEdgesData(t).map(kh)),this.pushChange({value:this.getNodeData([t])[0],type:ac.NodeRemoved}),this.removeNodeLikeHierarchy(t)})),this.model.removeNodes(t)}))}removeEdgeData(t=[]){t.length&&(t.forEach((t=>this.pushChange({value:this.getEdgeData([t])[0],type:ac.EdgeRemoved}))),this.model.removeEdges(t))}removeComboData(t=[]){t.length&&this.batch((()=>{t.forEach((t=>{this.pushChange({value:this.getComboData([t])[0],type:ac.ComboRemoved}),this.removeNodeLikeHierarchy(t),this.comboIds.delete(t)})),this.model.removeNodes(t)}))}removeNodeLikeHierarchy(t){if(this.model.hasTreeStructure(gc)){const e=Ih(this.getNodeLikeDatum(t));this.setParent(t,void 0,gc,!1),this.model.getChildren(t,gc).forEach((t=>{const n=aT(t),i=kh(n);this.setParent(kh(n),e,gc,!1);const r=tT(n,{id:kh(n),combo:e});this.pushChange({value:r,original:n,type:this.isCombo(i)?ac.ComboUpdated:ac.NodeUpdated}),this.model.mergeNodeData(kh(n),r)})),Qe(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(bc(`Unknown element type of id: ${t}`))}destroy(){const{model:t}=this,e=t.getAllNodes(),n=t.getAllEdges();t.removeEdges(n.map((t=>t.id))),t.removeNodes(e.map((t=>t.id))),this.context={}}}var sT=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class lT{constructor(t){this.elementMap={},this.shapeTypeMap={},this.paletteStyle={},this.defaultStyle={},this.stateStyle={},this.visibilityCache=new WeakMap,this.context=t}init(){if(!this.container){const{canvas:t}=this.context;this.container=t.appendChild(new Tl({className:"elements"}))}}emit(t,e){e.silence||Zw(this.context.graph,t)}forEachElementData(t){Fd.forEach((e=>{const n=this.context.model.getElementsDataByType(e);t(e,n)}))}getElementType(t,e){var n;const{options:i,graph:r}=this.context,a=(null===(n=i[t])||void 0===n?void 0:n.type)||e.type;return a?"string"==typeof a?a:a.call(r,e):"edge"===t?"line":"circle"}getTheme(t){return Ec(this.context.options)[t]||{}}getThemeStyle(t){return this.getTheme(t).style||{}}getThemeStateStyle(t,e){const{state:n={}}=this.getTheme(t);return Object.assign({},...e.map((t=>n[t]||{})))}computePaletteStyle(){const{options:t}=this.context;this.paletteStyle={},this.forEachElementData(((e,n)=>{var i,r;const a=Object.assign({},uf(null===(i=this.getTheme(e))||void 0===i?void 0:i.palette),uf(null===(r=t[e])||void 0===r?void 0:r.palette));(null==a?void 0:a.field)&&Object.assign(this.paletteStyle,function(t,e){if(!e)return{};const{type:n,color:i,field:r,invert:a}=e,o=t=>{const e="string"==typeof i?xc("palette",i):i;if("function"==typeof e){const n={};return t.forEach((([t,i])=>{n[t]=e(a?1-i:i)})),n}if(Array.isArray(e)){const n=a?[...e].reverse():e,i={};return t.forEach((([t,r])=>{i[t]=n[r%e.length]})),i}return{}},s=(t,e)=>{var n;return"string"==typeof t?null===(n=e.data)||void 0===n?void 0:n[t]:null==t?void 0:t(e)};if("group"===n){const e=Fc(t,(t=>{if(!r)return"default";const e=s(r,t);return e?String(e):"default"})),n=o(Object.keys(e).map(((t,e)=>[t,e]))),i={};return Object.entries(e).forEach((([t,e])=>{e.forEach((e=>{i[kh(e)]=n[t]}))})),i}if("value"===n){const[e,n]=t.reduce((([t,e],n)=>{const i=s(r,n);if("number"!=typeof i)throw new Error(bc(`Palette field ${r} is not a number`));return[Math.min(t,i),Math.max(e,i)]}),[1/0,-1/0]),i=n-e;return o(t.map((t=>[t.id,(s(r,t)-e)/i])))}}(n,a))}))}getPaletteStyle(t,e){const n=this.paletteStyle[e];return n?"edge"===t?{stroke:n}:{fill:n}:{}}computeElementDefaultStyle(t,e){var n;const{options:i}=this.context,r=(null===(n=i[t])||void 0===n?void 0:n.style)||{};"transform"in r&&Array.isArray(r.transform)&&(r.transform=[...r.transform]),this.defaultStyle[kh(e.datum)]=rf(r,e)}computeElementsDefaultStyle(t){const{graph:e}=this.context;this.forEachElementData(((n,i)=>{const r=i.length;for(let a=0;a<r;a++){const r=i[a];(void 0===t||t.includes(kh(r)))&&this.computeElementDefaultStyle(n,{datum:r,graph:e})}}))}getDefaultStyle(t){return this.defaultStyle[t]||{}}getElementState(t){try{const{model:e}=this.context;return e.getElementState(t)}catch(t){return[]}}getElementStateStyle(t,e,n){var i,r;const{options:a}=this.context;return rf((null===(r=null===(i=a[t])||void 0===i?void 0:i.state)||void 0===r?void 0:r[e])||{},n)}computeElementStatesStyle(t,e,n){this.stateStyle[kh(n.datum)]=Object.assign({},...e.map((e=>this.getElementStateStyle(t,e,n))))}computeElementsStatesStyle(t){const{graph:e}=this.context;this.forEachElementData(((n,i)=>{const r=i.length;for(let a=0;a<r;a++){const r=i[a];if(void 0===t||t.includes(kh(r))){const t=this.getElementState(kh(r));this.computeElementStatesStyle(n,t,{datum:r,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[kh(t)]))}getCombos(){return this.context.model.getComboData().map((({id:t})=>this.elementMap[t]))}getElementComputedStyle(t,e){const n=kh(e),i=this.getThemeStyle(t),r=this.getPaletteStyle(t,n),a=e.style||{},o=this.getDefaultStyle(n),s=this.getThemeStateStyle(t,this.getElementState(n)),l=this.getStateStyle(n),u=Object.assign({},i,r,a,o,s,l);if("combo"===t){const t=this.context.model.getChildrenData(n),e=!!u.collapsed?[]:t.map(kh).filter((t=>this.getElement(t)));Object.assign(u,{childrenNode:e,childrenData:t})}return u}draw(t={animation:!0}){this.init();const e=this.computeChangesAndDrawData(t);if(!e)return null;const{type:n="draw",stage:i=n,animation:r,silence:a}=t,{dataChanges:o,drawData:s}=e;this.markDestroyElement(s),this.computeStyle(i);const{add:l,update:u,remove:c}=s;return this.destroyElements(c,t),this.createElements(l,t),this.updateElements(u,t),this.context.animation.animate(r,a?{}:{before:()=>this.emit(new jw(dc.BEFORE_DRAW,{dataChanges:o,animation:r,stage:i,render:"render"===n}),t),beforeAnimate:e=>this.emit(new Uw(dc.BEFORE_ANIMATE,oc.DRAW,e,s),t),afterAnimate:e=>this.emit(new Uw(dc.AFTER_ANIMATE,oc.DRAW,e,s),t),after:()=>this.emit(new jw(dc.AFTER_DRAW,{dataChanges:o,animation:r,stage:i,render:"render"===n,firstRender:!1===this.context.graph.rendered}),t)})}computeChangesAndDrawData(t){const{model:e}=this.context,n=e.getChanges(),i=Oy(n);if(0===i.length)return null;const{NodeAdded:r=[],NodeUpdated:a=[],NodeRemoved:o=[],EdgeAdded:s=[],EdgeUpdated:l=[],EdgeRemoved:u=[],ComboAdded:c=[],ComboUpdated:h=[],ComboRemoved:d=[]}=Fc(i,(t=>t.type)),f=t=>new Map(t.map((t=>{const e=t.value;return[kh(e),e]}))),p={add:{nodes:f(r),edges:f(s),combos:f(c)},update:{nodes:f(a),edges:f(l),combos:f(h)},remove:{nodes:f(o),edges:f(u),combos:f(d)}},g=this.transformData(p,t);return e.clearChanges(),{dataChanges:n,drawData:g}}transformData(t,e){const n=this.context.transform.getTransformInstance();return Object.values(n).reduce(((t,n)=>n.beforeDraw(t,e)),t)}createElement(t,e,n){var i;const r=kh(e);if(this.getElement(r))return;const a=this.getElementType(t,e),o=this.getElementComputedStyle(t,e),s=xc(t,a);if(!s)return _c.warn(`The element ${a} of ${t} is not registered.`);this.emit(new Hw(dc.BEFORE_ELEMENT_CREATE,t,e),n);const l=this.container.appendChild(new s({id:r,context:this.context,style:Object.assign({},o)}));this.shapeTypeMap[r]=a,this.elementMap[r]=l;const{stage:u="enter"}=n;null===(i=this.context.animation)||void 0===i||i.add({element:l,elementType:t,stage:u,originalStyle:Object.assign({},l.attributes),updatedStyle:o},{after:()=>{var i;this.emit(new Hw(dc.AFTER_ELEMENT_CREATE,t,e),n),null===(i=l.onCreate)||void 0===i||i.call(l)}})}createElements(t,e){const{nodes:n,edges:i,combos:r}=t;[["node",n],["combo",r],["edge",i]].forEach((([t,n])=>{n.forEach((n=>this.createElement(t,n,e)))}))}getUpdateStageStyle(t,e,n){const{stage:i="update"}=n;if("translate"===i){if("node"===t||"combo"===t){const{style:{x:t=0,y:n=0,z:i=0}={}}=e;return{x:t,y:n,z:i}}return{}}return this.getElementComputedStyle(t,e)}updateElement(t,e,n){var i;const r=kh(e),{stage:a="update"}=n,o=this.getElement(r);if(!o)return()=>null;this.emit(new Hw(dc.BEFORE_ELEMENT_UPDATE,t,e),n);const s=this.getElementType(t,e),l=this.getUpdateStageStyle(t,e,n);this.shapeTypeMap[r]!==s&&(o.destroy(),delete this.shapeTypeMap[r],delete this.elementMap[r],this.createElement(t,e,{animation:!1,silence:!0}));const u="visibility"!==a?a:"hidden"===l.visibility?"hide":"show";"hide"===u&&delete l.visibility,null===(i=this.context.animation)||void 0===i||i.add({element:o,elementType:t,stage:u,originalStyle:Object.assign({},o.attributes),updatedStyle:l},{before:()=>{const t=this.elementMap[r];"collapse"!==a&&wm(t,l),"visibility"===a&&(function(t,e){return Yw(e)in(Wd(t,Xw)||{})}(t,"opacity")||function(t,e){const n=Array.isArray(e)?e:[e];Wd(t,Xw)||Xd(t,Xw,{}),n.forEach((e=>{Xd(Wd(t,Xw),Yw(e),t.attributes[e])}))}(t,"opacity"),this.visibilityCache.set(t,"show"===u?"visible":"hidden"),"show"===u&&Yh(t,"visible"))},after:()=>{var i;const o=this.elementMap[r];"collapse"===a&&wm(o,l),"hide"===u&&Yh(o,this.visibilityCache.get(o)),this.emit(new Hw(dc.AFTER_ELEMENT_UPDATE,t,e),n),null===(i=o.onUpdate)||void 0===i||i.call(o)}})}updateElements(t,e){const{nodes:n,edges:i,combos:r}=t;[["node",n],["combo",r],["edge",i]].forEach((([t,n])=>{n.forEach((n=>this.updateElement(t,n,e)))}))}markDestroyElement(t){Object.values(t.remove).forEach((t=>{t.forEach((t=>{const e=kh(t),n=this.getElement(e);n&&function(t){Xd(t,"__to_be_destroyed__",!0)}(n)}))}))}destroyElement(t,e,n){var i;const{stage:r="exit"}=n,a=kh(e),o=this.elementMap[a];if(!o)return()=>null;this.emit(new Hw(dc.BEFORE_ELEMENT_DESTROY,t,e),n),null===(i=this.context.animation)||void 0===i||i.add({element:o,elementType:t,stage:r,originalStyle:Object.assign({},o.attributes),updatedStyle:{}},{after:()=>{var i;this.clearElement(a),o.destroy(),null===(i=o.onDestroy)||void 0===i||i.call(o),this.emit(new Hw(dc.AFTER_ELEMENT_DESTROY,t,e),n)}})}destroyElements(t,e){const{nodes:n,edges:i,combos:r}=t;[["combo",r],["edge",i],["node",n]].forEach((([t,n])=>{n.forEach((n=>this.destroyElement(t,n,e)))}))}clearElement(t){delete this.paletteStyle[t],delete this.defaultStyle[t],delete this.stateStyle[t],delete this.elementMap[t],delete this.shapeTypeMap[t]}collapseNode(t,e){return sT(this,void 0,void 0,(function*(){var n;const{model:i,layout:r}=this.context,a=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!a)return;this.markDestroyElement(a.drawData);const o=yield r.simulate();i.updateData(o);const s=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!s)return;const{drawData:l}=s,{add:u,remove:c,update:h}=l;this.markDestroyElement(l);const d={animation:e,stage:"collapse",data:l};this.destroyElements(c,d),this.createElements(u,d),this.updateElements(h,d),yield null===(n=this.context.animation.animate(e,{beforeAnimate:t=>this.emit(new Uw(dc.BEFORE_ANIMATE,oc.COLLAPSE,t,l),d),afterAnimate:t=>this.emit(new Uw(dc.AFTER_ANIMATE,oc.COLLAPSE,t,l),d)},{collapse:{target:t,descendants:Array.from(c.nodes).map((([,t])=>kh(t))),position:vd(h.nodes.get(t))}}))||void 0===n?void 0:n.finished}))}expandNode(t,e){return sT(this,void 0,void 0,(function*(){var n;const{model:i,layout:r}=this.context;if(!i.getAncestorsData(t,gc).every((t=>Zd(t))))return;const a=vd(i.getNodeData([t])[0]),o=this.computeChangesAndDrawData({stage:"expand",animation:e});if(!o)return;const{drawData:{add:s}}=o;this.createElements(s,{animation:!1,stage:"expand",target:t}),this.context.animation.clear();const l=yield r.simulate();i.updateData(l),this.computeStyle("expand");const u=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!u)return;const{drawData:c}=u,{update:h}=c,d={animation:e,stage:"expand",data:c};s.edges.forEach((t=>h.edges.set(kh(t),t))),s.nodes.forEach((t=>h.nodes.set(kh(t),t))),this.updateElements(h,d),yield null===(n=this.context.animation.animate(e,{beforeAnimate:t=>this.emit(new Uw(dc.BEFORE_ANIMATE,oc.EXPAND,t,c),d),afterAnimate:t=>this.emit(new Uw(dc.AFTER_ANIMATE,oc.EXPAND,t,c),d)},{expand:{target:t,descendants:Array.from(s.nodes).map((([,t])=>kh(t))),position:a}}))||void 0===n?void 0:n.finished}))}collapseCombo(t,e){return sT(this,void 0,void 0,(function*(){var n;const{model:i,element:r}=this.context;if(i.getAncestorsData(t,gc).some((t=>Zd(t))))return;const a=r.getElement(t),o=a.getComboPosition(Object.assign(Object.assign({},a.attributes),{collapsed:!0})),s=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!s)return;const{dataChanges:l,drawData:u}=s;this.markDestroyElement(u);const{update:c,remove:h}=u,d={animation:e,stage:"collapse",data:u};this.destroyElements(h,d),this.updateElements(c,d);const f=t=>Array.from(t).map((([,t])=>kh(t)));yield null===(n=this.context.animation.animate(e,{before:()=>this.emit(new jw(dc.BEFORE_DRAW,{dataChanges:l,animation:e}),d),beforeAnimate:t=>this.emit(new Uw(dc.BEFORE_ANIMATE,oc.COLLAPSE,t,u),d),afterAnimate:t=>this.emit(new Uw(dc.AFTER_ANIMATE,oc.COLLAPSE,t,u),d),after:()=>this.emit(new jw(dc.AFTER_DRAW,{dataChanges:l,animation:e}),d)},{collapse:{target:t,descendants:[...f(h.nodes),...f(h.combos)],position:o}}))||void 0===n?void 0:n.finished}))}expandCombo(t,e){return sT(this,void 0,void 0,(function*(){var n;const{model:i}=this.context,r=vd(i.getComboData([t])[0]);this.computeStyle("expand");const a=this.computeChangesAndDrawData({stage:"expand",animation:e});if(!a)return;const{dataChanges:o,drawData:s}=a,{add:l,update:u}=s,c={animation:e,stage:"expand",data:s,target:t};this.createElements(l,c),this.updateElements(u,c);const h=t=>Array.from(t).map((([,t])=>kh(t)));yield null===(n=this.context.animation.animate(e,{before:()=>this.emit(new jw(dc.BEFORE_DRAW,{dataChanges:o,animation:e}),c),beforeAnimate:t=>this.emit(new Uw(dc.BEFORE_ANIMATE,oc.EXPAND,t,s),c),afterAnimate:t=>this.emit(new Uw(dc.AFTER_ANIMATE,oc.EXPAND,t,s),c),after:()=>this.emit(new jw(dc.AFTER_DRAW,{dataChanges:o,animation:e}),c)},{expand:{target:t,descendants:[...h(l.nodes),...h(l.combos)],position:r}}))||void 0===n?void 0:n.finished}))}destroy(){this.container.destroy(),this.elementMap={},this.shapeTypeMap={},this.defaultStyle={},this.stateStyle={},this.paletteStyle={},this.context={}}}const uT=Symbol("Comlink.proxy"),cT=Symbol("Comlink.endpoint"),hT=Symbol("Comlink.releaseProxy"),dT=Symbol("Comlink.finalizer"),fT=Symbol("Comlink.thrown"),pT=t=>"object"==typeof t&&null!==t||"function"==typeof t,gT=new Map([["proxy",{canHandle:t=>pT(t)&&t[uT],serialize(t){const{port1:e,port2:n}=new MessageChannel;return mT(t,e),[n,[n]]},deserialize(t){return t.start(),yT(t)}}],["throw",{canHandle:t=>pT(t)&&fT in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function mT(t,e=globalThis,n=["*"]){e.addEventListener("message",(function i(r){if(!r||!r.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,r.origin))return void console.warn(`Invalid origin '${r.origin}' for comlink proxy`);const{id:a,type:o,path:s}=Object.assign({path:[]},r.data),l=(r.data.argumentList||[]).map(CT);let u;try{const e=s.slice(0,-1).reduce(((t,e)=>t[e]),t),n=s.reduce(((t,e)=>t[e]),t);switch(o){case"GET":u=n;break;case"SET":e[s.slice(-1)[0]]=CT(r.data.value),u=!0;break;case"APPLY":u=n.apply(e,l);break;case"CONSTRUCT":u=function(t){return Object.assign(t,{[uT]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;mT(t,n),u=function(t,e){return ST.set(t,e),t}(e,[e])}break;case"RELEASE":u=void 0;break;default:return}}catch(t){u={value:t,[fT]:0}}Promise.resolve(u).catch((t=>({value:t,[fT]:0}))).then((n=>{const[r,s]=MT(n);e.postMessage(Object.assign(Object.assign({},r),{id:a}),s),"RELEASE"===o&&(e.removeEventListener("message",i),vT(e),dT in t&&"function"==typeof t[dT]&&t[dT]())})).catch((t=>{const[n,i]=MT({value:new TypeError("Unserializable return value"),[fT]:0});e.postMessage(Object.assign(Object.assign({},n),{id:a}),i)}))})),e.start&&e.start()}function vT(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function yT(t,e){const n=new Map;return t.addEventListener("message",(function(t){const{data:e}=t;if(!e||!e.id)return;const i=n.get(e.id);if(i)try{i(e)}finally{n.delete(e.id)}})),wT(t,n,[],e)}function xT(t){if(t)throw new Error("Proxy has been released and is not useable")}function bT(t){return AT(t,new Map,{type:"RELEASE"}).then((()=>{vT(t)}))}const _T=new WeakMap,ET="FinalizationRegistry"in globalThis&&new FinalizationRegistry((t=>{const e=(_T.get(t)||0)-1;_T.set(t,e),0===e&&bT(t)}));function wT(t,e,n=[],i=function(){}){let r=!1;const a=new Proxy(i,{get(i,o){if(xT(r),o===hT)return()=>{!function(t){ET&&ET.unregister(t)}(a),bT(t),e.clear(),r=!0};if("then"===o){if(0===n.length)return{then:()=>a};const i=AT(t,e,{type:"GET",path:n.map((t=>t.toString()))}).then(CT);return i.then.bind(i)}return wT(t,e,[...n,o])},set(i,a,o){xT(r);const[s,l]=MT(o);return AT(t,e,{type:"SET",path:[...n,a].map((t=>t.toString())),value:s},l).then(CT)},apply(i,a,o){xT(r);const s=n[n.length-1];if(s===cT)return AT(t,e,{type:"ENDPOINT"}).then(CT);if("bind"===s)return wT(t,e,n.slice(0,-1));const[l,u]=TT(o);return AT(t,e,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:l},u).then(CT)},construct(i,a){xT(r);const[o,s]=TT(a);return AT(t,e,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:o},s).then(CT)}});return function(t,e){const n=(_T.get(e)||0)+1;_T.set(e,n),ET&&ET.register(t,e,t)}(a,t),a}function TT(t){const e=t.map(MT);return[e.map((t=>t[0])),(n=e.map((t=>t[1])),Array.prototype.concat.apply([],n))];var n}const ST=new WeakMap;function MT(t){for(const[e,n]of gT)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},ST.get(t)||[]]}function CT(t){switch(t.type){case"HANDLER":return gT.get(t.name).deserialize(t.value);case"RAW":return t.value}}function AT(t,e,n,i){return new Promise((r=>{const a=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.set(a,r),t.start&&t.start(),t.postMessage(Object.assign({id:a},n),i)}))}class OT extends Ay.Z{constructor(t,e,n){super(),this.graph=t,this.layout=e,this.options=n,this.spawnWorker()}spawnWorker(){this.proxy=yT(new Worker(new URL(n.p+n.u(46122),n.b),{type:void 0})),this.running&&(this.running=!1,this.execute())}execute(){var t;return(0,he.mG)(this,void 0,void 0,(function*(){if(this.running)return this;this.running=!0;const e=this.layout.options,{onTick:n}=e,i=(0,he._T)(e,["onTick"]),r={};Object.keys(i).forEach((t=>{(0,en.Z)(i[t])||(r[t]=i[t])}));const a={layout:{id:this.layout.id,options:r,iterations:null===(t=this.options)||void 0===t?void 0:t.iterations},nodes:this.graph.getAllNodes(),edges:this.graph.getAllEdges()},o=new Float32Array([0]),[s]=yield this.proxy.calculateLayout(a,[o]);return s}))}stop(){return this.running=!1,this.proxy.stopLayout(),this}kill(){this.proxy[hT]()}isRunning(){return this.running}}var NT=n(31350),PT=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},LT=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class RT{get presetOptions(){return{animation:!!Mc(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}layout(){return PT(this,void 0,void 0,(function*(){if(!this.options)return;const t=Array.isArray(this.options)?this.options:[this.options],{graph:e}=this.context;Zw(e,new jw(dc.BEFORE_LAYOUT));for(const n of t){const i=t.indexOf(n),r=this.getLayoutData(n),a=Object.assign(Object.assign({},this.presetOptions),n);Zw(e,new jw(dc.BEFORE_STAGE_LAYOUT,{options:a,index:i}));const o=yield this.stepLayout(r,a,i);Zw(e,new jw(dc.AFTER_STAGE_LAYOUT,{options:a,index:i})),n.animation||this.updateElementPosition(o,!1)}Zw(e,new jw(dc.AFTER_LAYOUT)),this.transformDataAfterLayout()}))}transformDataAfterLayout(){const t=this.context.transform.getTransformInstance();Object.values(t).forEach((t=>t.afterLayout()))}simulate(){return PT(this,void 0,void 0,(function*(){if(!this.options)return{};const t=Array.isArray(this.options)?this.options:[this.options];let e={};for(const n of t){const i=t.indexOf(n),r=this.getLayoutData(n);e=yield this.stepLayout(r,Object.assign(Object.assign(Object.assign({},this.presetOptions),n),{animation:!1}),i)}return e}))}stepLayout(t,e,n){return PT(this,void 0,void 0,(function*(){return function(t){const{type:e}=t;return["compact-box","mindmap","dendrogram","indented"].includes(e)}(e)?yield this.treeLayout(t,e,n):yield this.graphLayout(t,e,n)}))}graphLayout(t,e,n){return PT(this,void 0,void 0,(function*(){const{animation:i,enableWorker:r,iterations:a=300}=e,o=this.initGraphLayout(e);if(!o)return{};if(this.instances[n]=o,this.instance=o,r){const e=o;return this.supervisor=new OT(e.graphData2LayoutModel(t),e.instance,{iterations:a}),Gm(yield this.supervisor.execute())}if((0,NT.h)(o))return i?yield o.execute(t,{onTick:t=>{this.updateElementPosition(t,!1)}}):(o.execute(t),o.stop(),o.tick(a));const s=yield o.execute(t);if(i){const t=this.updateElementPosition(s,i);yield null==t?void 0:t.finished}return s}))}treeLayout(t,e,n){return PT(this,void 0,void 0,(function*(){const{type:n,animation:i}=e,r=xc("layout",n);if(!r)return{};const{nodes:a=[],edges:o=[]}=t,s=new Im.k({nodes:a.map((t=>({id:kh(t),data:t.data||{}}))),edges:o.map((t=>({id:kh(t),source:t.source,target:t.target,data:t.data||{}})))});!function(t){if(t.hasTreeStructure(mc))return;t.attachTreeStructure(mc);const e=t.getAllEdges();for(const n of e){const{source:e,target:i}=n;t.setParent(i,e,mc)}}(s);const l={nodes:[],edges:[]},u={nodes:[],edges:[]};s.getRoots(mc).forEach((t=>{zd(t,(t=>{t.children=s.getSuccessors(t.id)}),(t=>s.getSuccessors(t.id)),"TB");const n=r(t,e),{x:i,y:a,z:o=0}=n;zd(n,(t=>{const{id:e,x:n,y:r,z:s=0}=t;l.nodes.push({id:e,style:{x:i,y:a,z:o}}),u.nodes.push({id:e,style:{x:n,y:r,z:s}})}),(t=>t.children),"TB")}));const c=this.inferTreeLayoutOffset(u);if(DT(u,c),i){DT(l,c),this.updateElementPosition(l,!1);const t=this.updateElementPosition(u,i);yield null==t?void 0:t.finished}return u}))}inferTreeLayoutOffset(t){var e;let[n,i]=[1/0,-1/0],[r,a]=[1/0,-1/0];null===(e=t.nodes)||void 0===e||e.forEach((t=>{const{x:e=0,y:o=0}=t.style||{};n=Math.min(n,e),i=Math.max(i,e),r=Math.min(r,o),a=Math.max(a,o)}));const{canvas:o}=this.context,s=o.getSize(),[l,u]=o.getCanvasByViewport([0,0]),[c,h]=o.getCanvasByViewport(s);if(n>=l&&i<=c&&r>=u&&a<=h)return[0,0];return[(l+c)/2-(n+i)/2,(u+h)/2-(r+a)/2]}stopLayout(){this.instance&&(0,NT.h)(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)}=t,{nodes:n,edges:i,combos:r}=this.context.model.getData(),a=t=>this.context.element.getElement(t),o=n.filter((t=>{const n=kh(t),i=a(n);return!!i&&(!Tm(i)&&e(t))})),s=new Map(o.map((t=>[kh(t),t])));return{nodes:o,edges:i.filter((t=>{const{source:e,target:n}=t;return!(!s.has(e)||!s.has(n))})),combos:r}}initGraphLayout(t){var e;const{element:n,viewport:i}=this.context,{type:r,enableWorker:a,animation:o,iterations:s}=t,l=LT(t,["type","enableWorker","animation","iterations"]),[u,c]=i.getCanvasSize(),h=[u/2,c/2],d=null!==(e=null==t?void 0:t.nodeSize)&&void 0!==e?e:t=>{const e=null==n?void 0:n.getElement(t.id),{size:i}=(null==e?void 0:e.attributes)||{};return i},f=xc("layout",r);if(!f)return _c.warn(`The layout of ${r} is not registered.`);const p=Object.getPrototypeOf(f.prototype)===Bm.prototype?f:function(t,e){return class extends Bm{constructor(e,n){if(super(e,n),this.instance=new t({}),this.id=this.instance.id,"stop"in this.instance&&"tick"in this.instance){const t=this.instance;this.stop=t.stop.bind(t),this.tick=e=>Gm(t.tick(e))}}execute(t,e){return Fm(this,void 0,void 0,(function*(){return Gm(yield this.instance.execute(this.graphData2LayoutModel(t),this.transformOptions((0,Jh.Z)({},this.options,e))))}))}transformOptions(t){const{onTick:e}=t;return e?(t.onTick=t=>e(Gm(t)),t):t}graphData2LayoutModel(t){const{nodes:n=[],edges:i=[],combos:r=[]}=t,a=n.map((t=>{const e=kh(t),{data:n,style:i,combo:r}=t,a=zm(t,["data","style","combo"]),o={id:e,data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),{data:n}),r?{parentId:r}:{}),{style:i}),a)};return(null==i?void 0:i.x)&&Object.assign(o.data,{x:i.x}),(null==i?void 0:i.y)&&Object.assign(o.data,{y:i.y}),(null==i?void 0:i.z)&&Object.assign(o.data,{z:i.z}),o})),o=new Map(a.map((t=>[t.id,t]))),s=i.filter((t=>{const{source:e,target:n}=t;return o.has(e)&&o.has(n)})).map((t=>{const{source:e,target:n,data:i,style:r}=t;return{id:kh(t),source:e,target:n,data:Object.assign({},i),style:Object.assign({},r)}})),l=r.map((t=>({id:kh(t),data:Object.assign({_isCombo:!0},t.data),style:Object.assign({},t.style)}))),u=new Im.k({nodes:[...a,...l],edges:s});return e.model.model.hasTreeStructure(gc)&&(u.attachTreeStructure(gc),a.forEach((t=>{const n=e.model.model.getParent(t.id,gc);n&&u.hasNode(n.id)&&u.setParent(t.id,n.id,gc)}))),u}}}(f,this.context),g=new p(this.context),m={nodeSize:d,width:u,height:c,center:h};switch(g.id){case"d3-force":case"d3-force-3d":Object.assign(m,{center:{x:u/2,y:c/2,z:0}})}return(0,Jh.Z)(g.options,m,l),g}updateElementPosition(t,e){const{model:n,element:i}=this.context;return i?(n.updateData(t),i.draw({animation:e,silence:!0})):null}destroy(){var t;this.stopLayout(),this.context={},null===(t=this.supervisor)||void 0===t||t.kill(),this.supervisor=void 0,this.instance=void 0,this.instances=[],this.animationResult=void 0}}const DT=(t,e)=>{var n;const[i,r]=e;null===(n=t.nodes)||void 0===n||n.forEach((t=>{if(t.style){const{x:e=0,y:n=0}=t.style;t.style.x=e+i,t.style.y=n+r}else t.style={x:i,y:r}}))};class kT extends qh{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;_c.warn(`Cannot find the plugin ${t}, will try to find it by type.`);const n=this.extensions.find((e=>e.type===t));return n?this.extensionMap[n.key]:void 0}}const IT=["update-related-edges","collapse-expand-node","collapse-expand-combo","get-edge-actual-ends","arrange-draw-order"];class BT extends qh{constructor(t){super(t),this.category="transform",this.setTransforms(this.context.options.transforms||[])}getTransforms(){}setTransforms(t){this.setExtensions([...IT.slice(0,IT.length-1),...t,IT[IT.length-1]])}getTransformInstance(t){return t?this.extensionMap[t]:this.extensionMap}}var FT=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class zT{get padding(){return Hc(this.context.options.padding)}get paddingOffset(){const[t,e,n,i]=this.padding,[r,a,o]=[(i-e)/2,(t-n)/2,0];return[r,a,o]}constructor(t){this.landmarkCounter=0,this.context=t;const[e,n]=this.paddingOffset,{zoom:i,rotation:r,x:a=e,y:o=n}=t.options;this.transform({mode:"absolute",scale:i,translate:[a,o],rotate:r},!1)}get camera(){const{canvas:t}=this.context;return new Proxy(t.getCamera(),{get:(e,n)=>{const i=Object.entries(t.getLayers()).filter((([t])=>!["main"].includes(t))).map((([,t])=>t.getCamera())),r=e[n];if("function"==typeof r)return(...t)=>{const a=r.apply(e,t);return i.forEach((e=>{e[n].apply(e,t)})),a}}})}createLandmark(t){return this.camera.createLandmark("landmark-"+this.landmarkCounter++,t)}getAnimation(t){const e=Mc(this.context.options,t);return!!e&&(0,ag.Z)(Object.assign({},e),["easing","duration"])}getCanvasSize(){const{canvas:t}=this.context,{width:e=0,height:n=0}=t.getConfig();return[e,n]}getCanvasCenter(){const{canvas:t}=this.context,{width:e=0,height:n=0}=t.getConfig();return[e/2,n/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:n,translate:i=[]}=t,r=this.getZoom(),a=e.getPosition(),o=e.getFocalPoint(),[s,l]=this.getCanvasCenter(),[u=0,c=0,h=0]=i,d=rd([-u,-c,-h],r);return"relative"===n?{position:ed(a,d),focalPoint:ed(o,d)}:{position:ed([s,l,a[2]],d),focalPoint:ed([s,l,o[2]],d)}}getRotateOptions(t){const{mode:e,rotate:n=0}=t;return{roll:"relative"===e?this.camera.getRoll()+n:n}}getZoomOptions(t){const{zoomRange:e}=this.context.options,n=this.camera.getZoom(),{mode:i,scale:r=1}=t;return ce("relative"===i?n*r:r,...e)}transform(t,e){return FT(this,void 0,void 0,(function*(){const{graph:n}=this.context,{translate:i,rotate:r,scale:a,origin:o}=t;this.cancelAnimation();const s=this.getAnimation(e);if(Zw(n,new Vw(dc.BEFORE_TRANSFORM,t)),!r&&a&&!i&&o&&!s)return this.camera.setZoomByViewportPoint(this.getZoomOptions(t),o),void Zw(n,new Vw(dc.AFTER_TRANSFORM,t));const l={};if(i&&Object.assign(l,this.getTranslateOptions(t)),(0,oe.Z)(r)&&Object.assign(l,this.getRotateOptions(t)),(0,oe.Z)(a)&&Object.assign(l,{zoom:this.getZoomOptions(t)}),s)return Zw(n,new Uw(dc.BEFORE_ANIMATE,oc.TRANSFORM,null,t)),new Promise((e=>{this.transformResolver=e,this.camera.gotoLandmark(this.createLandmark(l),Object.assign(Object.assign({},s),{onfinish:()=>{Zw(n,new Uw(dc.AFTER_ANIMATE,oc.TRANSFORM,null,t)),Zw(n,new Vw(dc.AFTER_TRANSFORM,t)),this.transformResolver=void 0,e()}}))}));this.camera.gotoLandmark(this.createLandmark(l),{duration:0}),Zw(n,new Vw(dc.AFTER_TRANSFORM,t))}))}fitView(t,e){return FT(this,void 0,void 0,(function*(){const[n,i,r,a]=this.padding,{when:o="always",direction:s="both"}=t||{},[l,u]=this.context.canvas.getSize(),c=l-a-i,h=u-n-r,d=this.context.canvas.getBounds(),f=this.getBBoxInViewport(d),[p,g]=Xc(f);if("overflow"===o&&!("x"===s&&p>=c||"y"===s&&g>=h||"both"===s&&p>=c&&g>=h))return yield this.fitCenter(e);const m=c/p,v=h/g,y="x"===s?m:"y"===s?v:Math.min(m,v),x=this.getAnimation(e);yield this.transform({mode:"relative",scale:y,translate:ed(nd(this.getCanvasCenter(),this.getBBoxInViewport(d).center),rd(this.paddingOffset,y))},x)}))}fitCenter(t){return FT(this,void 0,void 0,(function*(){const e=this.context.canvas.getBounds();yield this.focus(e,t)}))}focusElements(t,e){return FT(this,void 0,void 0,(function*(){const{element:n}=this.context;if(!n)return;const i=Kc(t.map((t=>n.getElement(t).getRenderBounds())));yield this.focus(i,e)}))}focus(t,e){return FT(this,void 0,void 0,(function*(){const n=this.context.graph.getViewportByCanvas(t.center),i=nd(this.getCanvasCenter(),n);yield this.transform({mode:"relative",translate:ed(i,this.paddingOffset)},e)}))}getBBoxInViewport(t){const{min:e,max:n}=t,{graph:i}=this.context,[r,a]=i.getViewportByCanvas(e),[o,s]=i.getViewportByCanvas(n),l=new Ti;return l.setMinMax([r,a,0],[o,s,0]),l}isInViewport(t,e=!1,n=0){const{graph:i}=this.context,r=this.getCanvasSize(),[a,o]=i.getCanvasByViewport([0,0]),[s,l]=i.getCanvasByViewport(r);let u=new Ti;return u.setMinMax([a,o,0],[s,l,0]),n&&(u=$c(u,n)),jc(t)?Qc(t,u):e?function(t,e){const[n,i]=t.min,[r,a]=t.max,[o,s]=e.min,[l,u]=e.max;return n>=o&&r<=l&&i>=s&&a<=u}(t,u):u.intersects(t)}cancelAnimation(){var t,e;(null===(t=this.camera.landmarks)||void 0===t?void 0:t.length)&&this.camera.cancelLandmarkAnimation(),null===(e=this.transformResolver)||void 0===e||e.call(this)}}var GT=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class jT extends Ay.Z{constructor(t){var e;super(),this.rendered=!1,this.destroyed=!1,this.context={model:new oT},this.isCollapsingExpanding=!1,this.onResize=Pm((()=>{this.resize()}),300),this.options=Object.assign({},jT.defaultOptions,t),this._setOptions(this.options,!0),this.context.graph=this,this.options.autoResize&&(null===(e=globalThis.addEventListener)||void 0===e||e.call(globalThis,"resize",this.onResize))}getOptions(){return this.options}setOptions(t){this._setOptions(t,!1)}_setOptions(t,e){if(this.updateCanvas(t),e){const{data:e}=t;return void(e&&this.addData(e))}Object.assign(this.options,t);const{behaviors:n,combo:i,data:r,edge:a,layout:o,node:s,plugins:l,theme:u,transforms:c}=t;n&&this.setBehaviors(n),r&&this.setData(r),s&&this.setNode(s),a&&this.setEdge(a),i&&this.setCombo(i),o&&this.setLayout(o),u&&this.setTheme(u),l&&this.setPlugins(l),c&&this.setTransforms(c)}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=(0,en.Z)(t)?t(this.getTheme()):t}setLayout(t){this.options.layout=(0,en.Z)(t)?t(this.getLayout()):t}getLayout(){return this.options.layout}setBehaviors(t){var e;this.options.behaviors=(0,en.Z)(t)?t(this.getBehaviors()):t,null===(e=this.context.behavior)||void 0===e||e.setBehaviors(this.options.behaviors)}updateBehavior(t){this.setBehaviors((e=>e.map((e=>"object"==typeof e&&e.key===t.key?Object.assign(Object.assign({},e),t):e))))}getBehaviors(){return this.options.behaviors||[]}setPlugins(t){var e;this.options.plugins=(0,en.Z)(t)?t(this.getPlugins()):t,null===(e=this.context.plugin)||void 0===e||e.setPlugins(this.options.plugins)}updatePlugin(t){this.setPlugins((e=>e.map((e=>"object"==typeof e&&e.key===t.key?Object.assign(Object.assign({},e),t):e))))}getPlugins(){return this.options.plugins||[]}getPluginInstance(t){return this.context.plugin.getPluginInstance(t)}setTransforms(t){var e;this.options.transforms=(0,en.Z)(t)?t(this.getTransforms()):t,null===(e=this.context.transform)||void 0===e||e.setTransforms(this.options.transforms)}updateTransform(t){this.setTransforms((e=>e.map((e=>"object"==typeof e&&e.key===t.key?Object.assign(Object.assign({},e),t):e)))),this.context.model.refreshData()}getTransforms(){return this.options.transforms||[]}getData(){return this.context.model.getData()}getElementData(t){return Array.isArray(t)?t.map((t=>this.context.model.getElementDataById(t))):this.context.model.getElementDataById(t)}getNodeData(t){var e;return void 0===t?this.context.model.getNodeData():Array.isArray(t)?this.context.model.getNodeData(t):null===(e=this.context.model.getNodeData([t]))||void 0===e?void 0:e[0]}getEdgeData(t){var e;return void 0===t?this.context.model.getEdgeData():Array.isArray(t)?this.context.model.getEdgeData(t):null===(e=this.context.model.getEdgeData([t]))||void 0===e?void 0:e[0]}getComboData(t){var e;return void 0===t?this.context.model.getComboData():Array.isArray(t)?this.context.model.getComboData(t):null===(e=this.context.model.getComboData([t]))||void 0===e?void 0:e[0]}setData(t){this.context.model.setData((0,en.Z)(t)?t(this.getData()):t)}addData(t){this.context.model.addData((0,en.Z)(t)?t(this.getData()):t)}addNodeData(t){this.context.model.addNodeData((0,en.Z)(t)?t(this.getNodeData()):t)}addEdgeData(t){this.context.model.addEdgeData((0,en.Z)(t)?t(this.getEdgeData()):t)}addComboData(t){this.context.model.addComboData((0,en.Z)(t)?t(this.getComboData()):t)}addChildrenData(t,e){this.context.model.addChildrenData(t,e)}updateData(t){this.context.model.updateData((0,en.Z)(t)?t(this.getData()):t)}updateNodeData(t){this.context.model.updateNodeData((0,en.Z)(t)?t(this.getNodeData()):t)}updateEdgeData(t){this.context.model.updateEdgeData((0,en.Z)(t)?t(this.getEdgeData()):t)}updateComboData(t){this.context.model.updateComboData((0,en.Z)(t)?t(this.getComboData()):t)}removeData(t){this.context.model.removeData((0,en.Z)(t)?t(this.getData()):t)}removeNodeData(t){this.context.model.removeNodeData((0,en.Z)(t)?t(this.getNodeData()):t)}removeEdgeData(t){this.context.model.removeEdgeData((0,en.Z)(t)?t(this.getEdgeData()):t)}removeComboData(t){this.context.model.removeComboData((0,en.Z)(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 GT(this,void 0,void 0,(function*(){var t;if(this.context.canvas)return yield this.context.canvas.ready;const{container:e="container",width:n,height:i,renderer:r,cursor:a,background:o,canvas:s,devicePixelRatio:l=(null!==(t=globalThis.devicePixelRatio)&&void 0!==t?t:1)}=this.options;if(e instanceof kw)this.context.canvas=e,a&&e.setCursor(a),r&&e.setRenderer(r),yield e.ready;else{const t=(0,ue.Z)(e)?document.getElementById(e):e,u=zw(t);this.emit(dc.BEFORE_CANVAS_INIT,{container:t,width:n,height:i});const c=Object.assign(Object.assign({},s),{container:t,width:n||u[0],height:i||u[1],background:o,renderer:r,cursor:a,devicePixelRatio:l}),h=new kw(c);this.context.canvas=h,yield h.ready,this.emit(dc.AFTER_CANVAS_INIT,{canvas:h})}}))}updateCanvas(t){var e,n;const{renderer:i,cursor:r,height:a,width:o}=t,s=this.context.canvas;s&&(i&&(this.emit(dc.BEFORE_RENDERER_CHANGE,{renderer:this.options.renderer}),s.setRenderer(i),this.emit(dc.AFTER_RENDERER_CHANGE,{renderer:i})),r&&s.setCursor(r),((0,oe.Z)(o)||(0,oe.Z)(a))&&this.setSize(null!==(e=null!=o?o:this.options.width)&&void 0!==e?e:0,null!==(n=null!=a?a:this.options.height)&&void 0!==n?n:0))}initRuntime(){this.context.options=this.options,this.context.batch||(this.context.batch=new Kw(this.context)),this.context.plugin||(this.context.plugin=new kT(this.context)),this.context.viewport||(this.context.viewport=new zT(this.context)),this.context.transform||(this.context.transform=new BT(this.context)),this.context.element||(this.context.element=new lT(this.context)),this.context.animation||(this.context.animation=new $w(this.context)),this.context.layout||(this.context.layout=new RT(this.context)),this.context.behavior||(this.context.behavior=new Qw(this.context))}prepare(){return GT(this,void 0,void 0,(function*(){if(yield Promise.resolve(),this.destroyed)throw new Error(bc("The graph instance has been destroyed"));yield this.initCanvas(),this.initRuntime()}))}render(){return GT(this,void 0,void 0,(function*(){yield this.prepare(),Zw(this,new jw(dc.BEFORE_RENDER));const t=this.context.element.draw({type:"render"});yield Promise.all([null==t?void 0:t.finished,this.context.layout.layout()]),yield this.autoFit(),this.rendered=!0,Zw(this,new jw(dc.AFTER_RENDER))}))}draw(){return GT(this,void 0,void 0,(function*(){var t;yield this.prepare(),yield null===(t=this.context.element.draw())||void 0===t?void 0:t.finished}))}layout(){return GT(this,void 0,void 0,(function*(){yield this.context.layout.layout()}))}stopLayout(){this.context.layout.stopLayout()}clear(){return GT(this,void 0,void 0,(function*(){this.context.model.setData({}),yield this.draw()}))}destroy(){var t;Zw(this,new jw(dc.BEFORE_DESTROY));const{layout:e,animation:n,element:i,model:r,canvas:a,behavior:o,plugin:s}=this.context;null==s||s.destroy(),null==o||o.destroy(),null==e||e.destroy(),null==n||n.destroy(),null==i||i.destroy(),r.destroy(),null==a||a.destroy(),this.options={},this.context={},this.off(),null===(t=globalThis.removeEventListener)||void 0===t||t.call(globalThis,"resize",this.onResize),this.destroyed=!0,Zw(this,new jw(dc.AFTER_DESTROY))}getCanvas(){return this.context.canvas}resize(t,e){var n;const i=zw(null===(n=this.context.canvas)||void 0===n?void 0:n.getContainer()),r=[t||i[0],e||i[1]];if(!this.context.canvas)return;const a=this.context.canvas.getSize();nc(r,a)||(Zw(this,new jw(dc.BEFORE_SIZE_CHANGE,{size:r})),this.context.canvas.resize(...r),Zw(this,new jw(dc.AFTER_SIZE_CHANGE,{size:r})))}fitView(t,e){return GT(this,void 0,void 0,(function*(){var n;yield null===(n=this.context.viewport)||void 0===n?void 0:n.fitView(t,e)}))}fitCenter(t){return GT(this,void 0,void 0,(function*(){var e;yield null===(e=this.context.viewport)||void 0===e?void 0:e.fitCenter(t)}))}autoFit(){return GT(this,void 0,void 0,(function*(){const{autoFit:t}=this.context.options;if(t)if((0,ue.Z)(t))"view"===t?yield this.fitView():"center"===t&&(yield this.fitCenter());else{const{type:e,animation:n}=t;"view"===e?yield this.fitView(t.options,n):"center"===e&&(yield this.fitCenter(n))}}))}focusElement(t,e){return GT(this,void 0,void 0,(function*(){var n;yield null===(n=this.context.viewport)||void 0===n?void 0:n.focusElements(Array.isArray(t)?t:[t],e)}))}zoomBy(t,e,n){return GT(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"relative",scale:t,origin:n},e)}))}zoomTo(t,e,n){return GT(this,void 0,void 0,(function*(){this.context.viewport.transform({mode:"absolute",scale:t,origin:n},e)}))}getZoom(){return this.context.viewport.getZoom()}rotateBy(t,e,n){return GT(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"relative",rotate:t,origin:n},e)}))}rotateTo(t,e,n){return GT(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"absolute",rotate:t,origin:n},e)}))}getRotation(){return this.context.viewport.getRotation()}translateBy(t,e){return GT(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"relative",translate:t},e)}))}translateTo(t,e){return GT(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"absolute",translate:t},e)}))}getPosition(){return nd([0,0],this.getCanvasByViewport([0,0]))}translateElementBy(t,e){return GT(this,arguments,void 0,(function*(t,e,n=!0){var i,r;const[a,o]=(0,nn.Z)(t)?[t,null===(i=e)||void 0===i||i]:[{[t]:e},n];Object.entries(a).forEach((([t,e])=>this.context.model.translateNodeLikeBy(t,e))),yield null===(r=this.context.element.draw({animation:o,stage:"translate"}))||void 0===r?void 0:r.finished}))}translateElementTo(t,e){return GT(this,arguments,void 0,(function*(t,e,n=!0){var i,r;const[a,o]=(0,nn.Z)(t)?[t,null===(i=e)||void 0===i||i]:[{[t]:e},n];Object.entries(a).forEach((([t,e])=>this.context.model.translateNodeLikeTo(t,e))),yield null===(r=this.context.element.draw({animation:o,stage:"translate"}))||void 0===r?void 0:r.finished}))}getElementPosition(t){return this.context.model.getElementPosition(t)}getElementRenderStyle(t){return bv(this.context.element.getElement(t).attributes,["context"])}setElementVisibility(t,e){return GT(this,arguments,void 0,(function*(t,e,n=!0){var i,r;const[a,o]=(0,nn.Z)(t)?[t,null===(i=e)||void 0===i||i]:[{[t]:e},n],s={nodes:[],edges:[],combos:[]};Object.entries(a).forEach((([t,e])=>{const n=this.getElementType(t);s[`${n}s`].push({id:t,style:{visibility:e}})}));const{model:l,element:u}=this.context;l.preventUpdateNodeLikeHierarchy((()=>{l.updateData(s)})),yield null===(r=u.draw({animation:o,stage:"visibility"}))||void 0===r?void 0:r.finished}))}showElement(t,e){return GT(this,void 0,void 0,(function*(){const n=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(n.map((t=>[t,"visible"]))),e)}))}hideElement(t,e){return GT(this,void 0,void 0,(function*(){const n=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(n.map((t=>[t,"hidden"]))),e)}))}getElementVisibility(t){var e,n;const i=this.context.element.getElement(t);return null!==(n=null===(e=null==i?void 0:i.style)||void 0===e?void 0:e.visibility)&&void 0!==n?n:"visible"}setElementZIndex(t,e){return GT(this,void 0,void 0,(function*(){var n;const i={nodes:[],edges:[],combos:[]},r=(0,nn.Z)(t)?t:{[t]:e};Object.entries(r).forEach((([t,e])=>{const n=this.getElementType(t);i[`${n}s`].push({id:t,style:{zIndex:e}})}));const{model:a,element:o}=this.context;a.preventUpdateNodeLikeHierarchy((()=>a.updateData(i))),yield null===(n=o.draw({animation:!1,stage:"zIndex"}))||void 0===n?void 0:n.finished}))}frontElement(t){return GT(this,void 0,void 0,(function*(){const e=Array.isArray(t)?t:[t],{model:n}=this.context,i={};e.map((t=>{const e=n.getFrontZIndex(t);if("combo"===n.getElementType(t)){const r=n.getAncestorsData(t,gc).at(-1)||this.getComboData(t),a=[r,...n.getDescendantsData(kh(r))],o=e-Ww(r);a.forEach((t=>{i[kh(t)]=this.getElementZIndex(kh(t))+o}));const{internal:s}=Ig(a.map(kh),(t=>n.getRelatedEdgesData(t)));s.forEach((t=>{const e=kh(t);i[e]=this.getElementZIndex(e)+o}))}else i[t]=e})),yield this.setElementZIndex(i)}))}getElementZIndex(t){return Ww(this.context.model.getElementDataById(t))}setElementState(t,e){return GT(this,arguments,void 0,(function*(t,e,n=!0){var i,r;const[a,o]=(0,nn.Z)(t)?[t,null===(i=e)||void 0===i||i]:[{[t]:e},n],s={nodes:[],edges:[],combos:[]};Object.entries(a).forEach((([t,e])=>{const n=this.getElementType(t);var i;s[`${n}s`].push({id:t,states:(i=e,i?Array.isArray(i)?i:[i]:[])})})),this.updateData(s),yield null===(r=this.context.element.draw({animation:o,stage:"state"}))||void 0===r?void 0:r.finished}))}getElementState(t){return this.context.model.getElementState(t)}getElementRenderBounds(t){return this.context.element.getElement(t).getRenderBounds()}collapseElement(t){return GT(this,arguments,void 0,(function*(t,e=!0){const{model:n,element:i}=this.context;if(Zd(n.getNodeLikeData([t])[0]))return;if(this.isCollapsingExpanding)return;const r=n.getElementType(t);yield this.frontElement(t),this.isCollapsingExpanding=!0,this.setElementCollapsibility(t,!0),"node"===r?yield i.collapseNode(t,e):"combo"===r&&(yield i.collapseCombo(t,e)),this.isCollapsingExpanding=!1}))}expandElement(t){return GT(this,arguments,void 0,(function*(t,e=!0){const{model:n,element:i}=this.context;if(!Zd(n.getNodeLikeData([t])[0]))return;if(this.isCollapsingExpanding)return;const r=n.getElementType(t);this.isCollapsingExpanding=!0,this.setElementCollapsibility(t,!1),"node"===r?yield i.expandNode(t,e):"combo"===r&&(yield i.expandCombo(t,e)),this.isCollapsingExpanding=!1}))}setElementCollapsibility(t,e){const n=this.getElementType(t);"node"===n?this.updateNodeData([{id:t,style:{collapsed:e}}]):"combo"===n&&this.updateComboData([{id:t,style:{collapsed:e}}])}toDataURL(){return GT(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,n){return super.on(t,e,n)}once(t,e){return super.once(t,e)}off(t,e){return super.off(t,e)}}jT.defaultOptions={autoResize:!1,theme:"light",rotation:0,zoom:1,zoomRange:[.01,10]};class UT extends $h{beforeDraw(t,e){return t}afterLayout(){}}function HT(t,e,n,i,r){const a=kh(i),o=`${n}s`,s=r?i:t.add[o].get(a)||t.update[o].get(a)||t.remove[o].get(a)||i;Object.entries(t).forEach((([t,n])=>{e===t?n[o].set(a,s):n[o].delete(a)}))}function VT(t,e){return Object.keys(t).every((n=>t[n]===e[n]))}const ZT=(t,e,n,i)=>{const r=`${n}s`,a=kh(i);t.add[r].has(a)||t.update[r].has(a)||t[e][r].set(kh(i),i)};const WT=(t,e)=>{const{source:n,target:i}=e,r=t.getElementDataById(n),a=t.getElementDataById(i),o=Bg(r,(e=>t.getParentData(e,gc))),s=Bg(a,(e=>t.getParentData(e,gc))),l={sourceNode:kh(o),targetNode:kh(s)};return e.style?Object.assign(e.style,l):e.style=l,e};class XT extends UT{constructor(t,e){super(t,(0,Jh.Z)({},XT.defaultOptions,e)),this.assignSizeByCentrality=(t,e,n,i,r,a)=>{const o=[e,n],s=[i[0],r[0]],l=[i[1],r[1]],u=[i[2],r[2]],c=(t,e)=>{if("function"==typeof a)return a(t,o,e);switch(a){case"linear":return((t,e,n)=>{const[i,r]=e,[a,o]=n;return r===i?a:a+(t-i)/(r-i)*(o-a)})(t,o,e);case"log":return((t,e,n)=>{const[i,r]=e,[a,o]=n;return a+Math.log(t-i+1)/Math.log(r-i+1)*(o-a)})(t,o,e);case"pow":return((t,e,n,i=2)=>{const[r,a]=e,[o,s]=n;return o+Math.pow((t-r)/(a-r),i)*(s-o)})(t,o,e,2);case"sqrt":return((t,e,n)=>{const[i,r]=e,[a,o]=n;return a+Math.sqrt((t-i)/(r-i))*(o-a)})(t,o,e);default:return e[0]}};return[c(t,s),c(t,l),c(t,u)]}}beforeDraw(t){const{model:e}=this.context,n=e.getNodeData(),i=ef(this.options.maxSize),r=ef(this.options.minSize),a=this.getCentralities(this.options.centrality),o=a.size>0?Math.max(...a.values()):0,s=a.size>0?Math.min(...a.values()):0;return n.forEach((e=>{var n;const l=this.assignSizeByCentrality(a.get(kh(e))||0,s,o,r,i,this.options.scale),u=null===(n=this.context.element)||void 0===n?void 0:n.getElement(kh(e)),c={size:l};this.assignLabelStyle(c,l,e,u),u&&VT(c,u.attributes)||HT(t,u?"update":"add","node",(0,Jh.Z)(e,{style:c}),!0)})),t}assignLabelStyle(t,e,n,i){var r;const a=i?i.config.style:null===(r=this.context.element)||void 0===r?void 0:r.getElementComputedStyle("node",n);if(Object.assign(t,(0,ag.Z)(a,["labelFontSize","labelLineHeight"])),this.options.mapLabelSize){const n=this.getLabelSizeByNodeSize(e,1/0,Number(t.labelFontSize));Object.assign(t,{labelFontSize:n,labelLineHeight:n+Vc(t.labelPadding)})}return t}getLabelSizeByNodeSize(t,e,n){const i=Math.min(...t)/2,[r,a]=Array.isArray(this.options.mapLabelSize)?this.options.mapLabelSize:[n,e];return Math.min(a,Math.max(i,r))}getCentralities(t){const{model:e}=this.context,n=e.getData();if("function"==typeof t)return t(n);const i=e.getRelatedEdgesData.bind(e);return Fh(n,i,t)}}XT.defaultOptions={centrality:{type:"degree"},maxSize:80,minSize:20,scale:"linear",mapLabelSize:!1};class YT extends UT{constructor(t,e){super(t,Object.assign({},YT.defaultOptions,e))}get ref(){return this.context.model.getRootsData()[0]}afterLayout(){var t;const e=vd(this.ref),{graph:n,model:i}=this.context;null===(t=i.getData().nodes)||void 0===t||t.forEach((t=>{if(kh(t)===kh(this.ref))return;const r=fd(nd(vd(t),e)),a=Math.abs(r)>Math.PI/2,o=!t.children||0===t.children.length,s=(o?1:-1)*(ef(n.getElementRenderStyle(kh(t)).size)[0]/2+this.options.offset),l=[["translate",s*Math.cos(r),s*Math.sin(r)],["rotate",a?Fi(r)+180:Fi(r)]];i.updateNodeData([{id:kh(t),style:{labelTextAlign:a===o?"right":"left",labelTextBaseline:"middle",labelTransform:l}}])})),n.draw()}}YT.defaultOptions={offset:5};const qT=["top","top-right","right","right-bottom","bottom","bottom-left","left","left-top"];class $T extends UT{constructor(t,e){super(t,Object.assign({},$T.defaultOptions,e)),this.cacheMergeStyle=new Map,this.getAffectedParallelEdges=t=>{const{add:{edges:e},update:{nodes:n,edges:i,combos:r},remove:{edges:a}}=t,{model:o}=this.context,s=new Map,l=(t,e)=>{o.getRelatedEdgesData(e).forEach((t=>!s.has(kh(t))&&s.set(kh(t),t)))};n.forEach(l),r.forEach(l);const u=t=>{const e=o.getEdgeData().map((t=>WT(o,t)));QT(t,e,!0).forEach((t=>!s.has(kh(t))&&s.set(kh(t),t)))};if(a.size&&a.forEach(u),e.size&&e.forEach(u),i.size){const t=Ny(Oy(o.getChanges())).update.edges;i.forEach((e=>{var n;u(e);const i=null===(n=t.find((t=>kh(t.value)===kh(e))))||void 0===n?void 0:n.original;i&&!JT(e,i)&&u(i)}))}yf(this.options.edges)||s.forEach(((t,e)=>!this.options.edges.includes(e)&&s.delete(e)));const c=o.getEdgeData().map(kh);return new Map([...s].sort(((t,e)=>c.indexOf(t[0])-c.indexOf(e[0]))))},this.applyBundlingStyle=(t,e,n)=>{const{edgeMap:i,reverses:r}=KT(e);i.forEach((e=>{e.forEach(((e,i,a)=>{var o;const s=a.length,l=e.style||{};if(e.source===e.target){const t=qT.length;l.loopPlacement=qT[i%t],l.loopDist=Math.floor(i/t)*n+50}else if(1===s)l.curveOffset=0;else{const t=(i%2==0?1:-1)*(r[`${e.source}|${e.target}|${i}`]?-1:1);l.curveOffset=s%2==1?t*Math.ceil(i/2)*n*2:t*(Math.floor(i/2)*n*2+n)}const u=Object.assign(e,{type:"quadratic",style:l}),c=null===(o=this.context.element)||void 0===o?void 0:o.getElement(kh(e));c&&VT(u.style,c.attributes)||HT(t,c?"update":"add","edge",u,!0)}))}))},this.resetEdgeStyle=t=>{const e=t.style||{},n=this.cacheMergeStyle.get(kh(t))||{};return Object.keys(n).forEach((i=>{nc(e[i],n[i])&&(t[i]?e[i]=t[i]:delete e[i])})),Object.assign(t,{style:e})},this.applyMergingStyle=(t,e)=>{const{edgeMap:n,reverses:i}=KT(e);n.forEach((e=>{var n;if(1===e.length){const i=e[0],r=null===(n=this.context.element)||void 0===n?void 0:n.getElement(kh(i)),a=this.resetEdgeStyle(i);return void(r&&VT(a,r.attributes)||HT(t,r?"update":"add","edge",a))}const r=e.map((({source:t,target:e,style:n={}},r)=>{const{startArrow:a,endArrow:o}=n,s={},[l,u]=i[`${t}|${e}|${r}`]?["endArrow","startArrow"]:["startArrow","endArrow"];return tn(a)&&(s[l]=a),tn(o)&&(s[u]=o),s})).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{});e.forEach(((e,n,i)=>{var a;if(0!==n)return void HT(t,"remove","edge",e);const o=Object.assign({},(0,en.Z)(this.options.style)?this.options.style(i):this.options.style,{childrenData:i});this.cacheMergeStyle.set(kh(e),o);const s=Object.assign(Object.assign({},e),{type:"line",style:Object.assign(Object.assign(Object.assign({},e.style),r),o)}),l=null===(a=this.context.element)||void 0===a?void 0:a.getElement(kh(e));l&&VT(s.style,l.attributes)||HT(t,l?"update":"add","edge",s,!0)}))}))}}beforeDraw(t){const e=this.getAffectedParallelEdges(t);return 0===e.size||("bundle"===this.options.mode?this.applyBundlingStyle(t,e,this.options.distance):this.applyMergingStyle(t,e)),t}}$T.defaultOptions={mode:"bundle",distance:15};const KT=t=>{const e=new Map,n=new Set,i={};for(const[r,a]of t){if(n.has(r))continue;const{source:o,target:s}=a,l=`${o}-${s}`;e.has(l)||e.set(l,[]),e.get(l).push(a),n.add(r);for(const[r,u]of t)n.has(r)||JT(a,u)&&(e.get(l).push(u),n.add(r),o===u.target&&s===u.source&&(i[`${u.source}|${u.target}|${e.get(l).length-1}`]=!0))}return{edgeMap:e,reverses:i}},QT=(t,e,n)=>e.filter((e=>(n||kh(e)!==kh(t))&&JT(e,t))),JT=(t,e)=>{const{sourceNode:n,targetNode:i}=t.style||{},{sourceNode:r,targetNode:a}=e.style||{};return n===r&&i===a||n===a&&i===r};var tS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function eS(t,e){const{getNodeData:n=((t,e)=>{if(t.depth=e,!t.children)return t;const{children:n}=t,i=tS(t,["children"]);return Object.assign(Object.assign({},i),{children:n.map((t=>t.id))})}),getEdgeData:i=((t,e)=>({source:t.id,target:e.id})),getChildren:r=(t=>t.children||[])}=e||{},a=[],o=[];return zd(t,((t,e)=>{a.push(n(t,e));const s=r(t);for(const e of s)o.push(i(t,e))}),(t=>r(t)),"TB"),{nodes:a,edges:o}}var nS=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class iS extends Bm{constructor(){super(...arguments),this.id="fishbone"}getRoot(){const t=this.context.model.getRootsData();if(!(yf(t)||t.length>2))return t[0]}formatSize(t){const e="function"==typeof t?t:()=>t;return t=>ef(e(t))}doLayout(t,e){const{hGap:n,getRibSep:i,vGap:r,nodeSize:a,height:o}=e,{model:s}=this.context,l=this.formatSize(a);let u=l(t)[0]+i(t);const c=(t,e=0)=>{var i;return e+=n*((t.children||[]).length+1),null===(i=t.children)||void 0===i||i.forEach((t=>{var n;null===(n=s.getNodeLikeDatum(t).children)||void 0===n||n.forEach((t=>{const n=s.getNodeLikeDatum(t);e=c(n,e)}))})),e},h=t=>{if(1===t.depth)return u;const e=s.getParentData(t.id,"tree");if(oS(t)){const i=s.getParentData(e.id,"tree"),a=p(t)-p(i);return h(e)+a*n/r}{const n=(e.children||[]).indexOf(t.id),i=s.getNodeData((e.children||[]).slice(n));return d(e)-i.reduce(((t,e)=>t+c(e)),0)-l(e)[0]/2}},d=mv((t=>{if(aS(t))return l(t)[0]/2;const e=s.getParentData(t.id,"tree");if(oS(t))return h(t)+c(t)+l(t)[0]/2;{const i=p(t)-p(e),a=n/r;return h(t)+i*a}}),(t=>t.id)),f=t=>p(s.getParentData(t,"tree")),p=mv((t=>{if(aS(t))return o/2;if(oS(t)){const e=s.getParentData(t.id,"tree"),n=e.children.indexOf(t.id);if(0===n)return f(e.id)+r;const i=s.getNodeLikeDatum(e.children[n-1]);if(yf(i.children))return p(i)+r;const a=s.getDescendantsData(i.id);return Math.max(...a.map((t=>oS(t)?f(t.id):p(t))))+r}{if(yf(t.children))return f(t.id)+r;const e=s.getNodeLikeDatum(t.children.slice(-1)[0]);if(yf(e.children))return p(e)+r;const n=s.getDescendantsData(t.id).slice(-1)[0];return(oS(n)?f(n.id):p(n))+r}}),(t=>t.id));let g=0;const m={nodes:[],edges:[]},v=t=>{var e;null===(e=t.children)||void 0===e||e.forEach((t=>v(s.getNodeLikeDatum(t))));const n=p(t),r=d(t);if(m.nodes.push({id:t.id,x:r,y:n}),aS(t))return;const a=s.getRelatedEdgesData(t.id,"in")[0],o=[h(t),oS(t)?n:f(t.id)];m.edges.push({id:kh(a),controlPoints:[o],relatedNodeId:t.id}),g=Math.max(g,r+i(t)),1===t.depth&&(u=g)};return v(t),m}placeAlterative(t,e){const n=(e.children||[]).filter(((t,e)=>e%2!=0));if(0===n.length)return t;const{model:i}=this.context,r=t.nodes.find((t=>t.id===e.id)).y,a=t=>{const e=i.getAncestorsData(t,"tree");if(yf(e))return!1;const r=1===e.length?t:e[e.length-2].id;return n.includes(r)};t.nodes.forEach((t=>{a(t.id)&&(t.y=2*r-t.y)})),t.edges.forEach((t=>{a(t.relatedNodeId)&&(t.controlPoints=t.controlPoints.map((t=>[t[0],2*r-t[1]])))}))}rightToLeft(t,e){return t.nodes.forEach((t=>t.x=e.width-t.x)),t.edges.forEach((t=>{t.controlPoints=t.controlPoints.map((t=>[e.width-t[0],t[1]]))})),t}execute(t,e){return nS(this,void 0,void 0,(function*(){const n=Object.assign(Object.assign(Object.assign({},iS.defaultOptions),this.options),e),{direction:i,nodeSize:r}=n,a=this.getRoot();if(!a)return t;const o=this.formatSize(r);n.vGap||(n.vGap=Math.max(...(t.nodes||[]).map((t=>o(t)[1])))),n.hGap||(n.hGap=Math.max(...(t.nodes||[]).map((t=>o(t)[0]))));let s=this.doLayout(a,n);this.placeAlterative(s,a),"RL"===i&&(s=this.rightToLeft(s,n));const{model:l}=this.context,u=[],c=[];return s.nodes.forEach((t=>{const{id:e,x:n,y:i}=t,r=l.getNodeLikeDatum(e);u.push(rS(r,{x:n,y:i}))})),s.edges.forEach((t=>{const{id:e,controlPoints:n}=t,i=l.getEdgeDatum(e);c.push(rS(i,{controlPoints:n}))})),{nodes:u,edges:c}}))}}iS.defaultOptions={direction:"RL",getRibSep:()=>60};const rS=(t,e)=>Object.assign(Object.assign({},t),{style:Object.assign(Object.assign({},t.style||{}),e)}),aS=t=>0===t.depth,oS=t=>(t.depth||(t.depth=0))%2==0,sS=["#7E92B5","#F4664A","#FFBE3A"],lS={type:"group",color:["#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]},uS={type:"group",color:["#99ADD1","#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]};function cS(t){const{bgColor:e,textColor:n,nodeColor:i,nodeColorDisabled:r,nodeStroke:a,nodeHaloStrokeOpacityActive:o=.15,nodeHaloStrokeOpacitySelected:s=.25,nodeOpacityDisabled:l=.06,nodeIconOpacityInactive:u=.85,nodeOpacityInactive:c=.25,nodeBadgePalette:h=sS,nodePaletteOptions:d=lS,edgeColor:f,edgeColorDisabled:p,edgePaletteOptions:g=uS,comboColor:m,comboColorDisabled:v,comboStroke:y,comboStrokeDisabled:x,edgeColorInactive:b}=t;return{background:e,node:{palette:d,style:{donutOpacity:1,badgeBackgroundOpacity:1,badgeFill:"#fff",badgeFontSize:8,badgePadding:[0,4],badgePalette:h,fill:i,fillOpacity:1,halo:!1,iconFill:"#fff",iconOpacity:1,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelFill:n,labelFillOpacity:.85,labelLineHeight:16,labelPadding:[0,2],labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelOffsetY:2,lineWidth:0,portFill:i,portLineWidth:1,portStroke:a,portStrokeOpacity:.65,size:32,stroke:a,strokeOpacity:1,zIndex:2},state:{selected:{halo:!0,haloLineWidth:24,haloStrokeOpacity:s,labelFontSize:12,labelFontWeight:"bold",lineWidth:4,stroke:a},active:{halo:!0,haloLineWidth:12,haloStrokeOpacity:o},highlight:{labelFontWeight:"bold",lineWidth:4,stroke:a,strokeOpacity:.85},inactive:{badgeBackgroundOpacity:c,donutOpacity:c,fillOpacity:c,iconOpacity:u,labelFill:n,labelFillOpacity:c,strokeOpacity:c},disabled:{badgeBackgroundOpacity:.25,donutOpacity:l,fill:r,fillOpacity:l,iconFill:r,iconOpacity:.25,labelFill:n,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:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[4,4,4,4],labelFill:n,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:b,fillOpacity:.08,labelOpacity:.25,strokeOpacity:.08,badgeBackgroundOpacity:.25},disabled:{stroke:p,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:e,collapsedMarkerFontSize:12,collapsedMarkerFillOpacity:1,collapsedSize:32,collapsedFillOpacity:1,fill:m,halo:!1,haloLineWidth:12,haloStroke:y,haloStrokeOpacity:.25,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[2,4,2,4],labelFill:n,labelFontSize:12,labelFontWeight:400,labelOpacity:1,lineDash:0,lineWidth:1,fillOpacity:.04,strokeOpacity:1,padding:10,stroke:y},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:v,fillOpacity:.25,labelOpacity:.25,stroke:x,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 hS=cS({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"}),dS=cS({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"}),fS={animation:{"combo-collapse":kc,"combo-expand":Ic,"node-collapse":Pc,"node-expand":Lc,"path-in":Rc,"path-out":Dc,fade:[{fields:["opacity"]}],translate:[{fields:["x","y"]}]},behavior:{"brush-select":kd,"click-select":Vd,"collapse-expand":Mm,"create-edge":Nm,"drag-canvas":Rm,"drag-element-force":class extends km{get forceLayoutInstance(){return this.context.layout.getLayoutInstance().find((t=>["d3-force","d3-force-3d"].includes(null==t?void 0:t.id)))}validate(t){return!!this.context.layout&&(this.forceLayoutInstance?super.validate(t):(_c.warn("DragElementForce only works with d3-force or d3-force-3d layout"),!1))}moveElement(t,e){return Hm(this,void 0,void 0,(function*(){const n=this.forceLayoutInstance;this.context.graph.getNodeData(t).forEach(((i,r)=>{const{x:a=0,y:o=0}=i.style||{};n&&jm(n,"setFixedPosition",t[r],[...ed([+a,+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&&Um(e,"simulation").alphaTarget(.3).restart(),this.context.graph.getNodeData(this.target).forEach((t=>{const{x:n=0,y:i=0}=t.style||{};e&&jm(e,"setFixedPosition",kh(t),[+n,+i])}))}onDrag(t){if(!this.enable)return;const e=this.getDelta(t);this.moveElement(this.target,e)}onDragEnd(){const t=this.forceLayoutInstance;t&&Um(t,"simulation").alphaTarget(0),this.context.graph.getNodeData(this.target).forEach((e=>{t&&jm(t,"setFixedPosition",kh(e),[null,null,null])}))}},"drag-element":km,"fix-element-size":Zm,"focus-element":Xm,"hover-activate":Ym,"lasso-select":class extends kd{onPointerDown(t){if(!super.validate(t)||!super.isKeydown()||this.points)return;const{canvas:e}=this.context;this.pathShape=new Pl({id:"g6-lasso-select",style:this.options.style}),e.appendChild(this.pathShape),this.points=[Id(t)]}onPointerMove(t){var e;if(!this.points)return;const{immediately:n,mode:i}=this.options;this.points.push(Id(t)),null===(e=this.pathShape)||void 0===e||e.setAttribute("d",function(t,e=!0){const n=[];return t.forEach(((t,e)=>{n.push([0===e?"M":"L",...t])})),e&&n.push(["Z"]),n}(this.points)),n&&"default"===i&&this.points.length>2&&super.updateElementsStates(this.points)}onPointerUp(){this.points&&(this.points.length<2||super.updateElementsStates(this.points),this.clearLasso())}clearLasso(){var t;null===(t=this.pathShape)||void 0===t||t.remove(),this.pathShape=void 0,this.points=void 0}},"auto-adapt-label":Qh,"optimize-viewport-transform":qm,"scroll-canvas":Km,"zoom-canvas":Jm},combo:{circle:class extends dg{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",bl,this.getKeyStyle(t),e)}getKeyStyle(t){const{collapsed:e}=t,n=super.getKeyStyle(t),[i]=this.getKeySize(t);return Object.assign(Object.assign(Object.assign({},n),e&&Qd(n,"collapsed")),{r:i/2})}getCollapsedKeySize(t){const[e,n]=ef(t.collapsedSize),i=Math.max(e,n)/2;return[2*i,2*i,0]}getExpandedKeySize(t){const e=this.getContentBBox(t),[n,i]=Xc(e),r=Math.sqrt(Math.pow(n,2)+Math.pow(i,2))/2;return[2*r,2*r,0]}getIntersectPoint(t,e=!1){return Ad(t,this.getShape("key").getBounds(),e)}},rect:class extends dg{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",Il,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t),[n,i]=this.getKeySize(t);return Object.assign(Object.assign(Object.assign({},e),t.collapsed&&Qd(e,"collapsed")),{width:n,height:i,x:-n/2,y:-i/2})}}},edge:{cubic:Xg,line:Kg,polyline:lm,quadratic:um,"cubic-horizontal":Yg,"cubic-radial":qg,"cubic-vertical":$g},layout:{"antv-dagre":ev.b,"combo-combined":iv.u,"compact-box":tv.compactBox,"d3-force":av.j,"force-atlas2":sv.E,circular:nv.S,concentric:rv.W,dagre:ov.V,dendrogram:tv.dendrogram,fishbone:iS,force:lv.y,fruchterman:uv.O,grid:cv.M,indented:tv.indented,mds:hv.A,mindmap:tv.mindmap,radial:dv.D,random:fv._},node:{circle:Ff,diamond:class extends zf{constructor(t){super(t)}getPoints(t){const[e,n]=this.getSize(t);return function(t,e){return[[0,-e/2],[t/2,0],[0,e/2],[-t/2,0]]}(e,n)}},ellipse:Vf,hexagon:class extends zf{constructor(t){super(t)}getOuterR(t){return t.outerR||Math.min(...this.getSize(t))/2}getPoints(t){return[[0,e=this.getOuterR(t)],[e*Math.sqrt(3)/2,e/2],[e*Math.sqrt(3)/2,-e/2],[0,-e],[-e*Math.sqrt(3)/2,-e/2],[-e*Math.sqrt(3)/2,e/2]];var e}getIconStyle(t){const e=super.getIconStyle(t),n=this.getOuterR(t)*Bd;return!!e&&Object.assign({width:n,height:n},e)}},html:sg,image:ug,rect:class extends Bf{constructor(t){super(t)}getKeyStyle(t){const[e,n]=this.getSize(t);return Object.assign(Object.assign({},super.getKeyStyle(t)),{width:e,height:n,x:-e/2,y:-n/2})}getIconStyle(t){const e=super.getIconStyle(t),{width:n,height:i}=this.getShape("key").attributes;return!!e&&Object.assign({width:n*Bd,height:i*Bd},e)}drawKeyShape(t,e){return this.upsert("key",Il,this.getKeyStyle(t),e)}},star:class extends zf{constructor(t){super(t)}getInnerR(t){return t.innerR||3*this.getOuterR(t)/8}getOuterR(t){return Math.min(...this.getSize(t))/2}getPoints(t){return e=this.getOuterR(t),n=this.getInnerR(t),[[0,-e],[n*Math.cos(3*Math.PI/10),-n*Math.sin(3*Math.PI/10)],[e*Math.cos(Math.PI/10),-e*Math.sin(Math.PI/10)],[n*Math.cos(Math.PI/10),n*Math.sin(Math.PI/10)],[e*Math.cos(3*Math.PI/10),e*Math.sin(3*Math.PI/10)],[0,n],[-e*Math.cos(3*Math.PI/10),e*Math.sin(3*Math.PI/10)],[-n*Math.cos(Math.PI/10),n*Math.sin(Math.PI/10)],[-e*Math.cos(Math.PI/10),-e*Math.sin(Math.PI/10)],[-n*Math.cos(3*Math.PI/10),-n*Math.sin(3*Math.PI/10)]];var e,n}getIconStyle(t){const e=super.getIconStyle(t),n=2*this.getInnerR(t)*Bd;return!!e&&Object.assign({width:n,height:n},e)}getPortXY(t,e){const{placement:n="top"}=e;return pm(this.getShape("key").getLocalBounds(),n,function(t,e){const n={};return n.top=[0,-t],n.left=[-t*Math.cos(Math.PI/10),-t*Math.sin(Math.PI/10)],n["left-bottom"]=[-t*Math.cos(3*Math.PI/10),t*Math.sin(3*Math.PI/10)],n.bottom=[0,e],n["right-bottom"]=[t*Math.cos(3*Math.PI/10),t*Math.sin(3*Math.PI/10)],n.right=n.default=[t*Math.cos(Math.PI/10),-t*Math.sin(Math.PI/10)],n}(this.getOuterR(t),this.getInnerR(t)),!1)}},donut:jf,triangle:cg},palette:{spectral:["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)"],tableau:["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)"],oranges:["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)"],greens:["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)"],blues:["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)"]},theme:{dark:hS,light:dS},plugin:{"bubble-sets":uy,"edge-bundling":py,"edge-filter-lens":wy,"grid-line":Cy,background:Cv,contextmenu:fy,fisheye:Sy,fullscreen:My,history:Ry,hull:Uy,legend:ib,minimap:rb,snapline:ub,timebar:uw,toolbar:pw,tooltip:Ew,watermark:Aw},transform:{"arrange-draw-order":class extends UT{beforeDraw(t){const{model:e}=this.context,n=t.add.combos,i=t=>{const n=[];return t.forEach(((t,i)=>{const r=e.getAncestorsData(i,"combo").map((t=>kh(t))).reverse();n.push([i,t,r.length])})),new Map(n.sort((([,,t],[,,e])=>e-t)).map((([t,e])=>[t,e])))};return t.add.combos=i(n),t.update.combos=i(t.update.combos),t}},"collapse-expand-combo":class extends UT{beforeDraw(t,e){if("visibility"===e.stage)return t;if(!this.context.model.model.hasTreeStructure(gc))return t;const{model:n}=this.context,{add:i,update:r}=t,a=[...t.update.combos.entries(),...t.add.combos.entries()];for(;a.length;){const[e,o]=a.pop();if(Zd(o)){const o=n.getDescendantsData(e),s=o.map(kh),{internal:l,external:u}=Ig(s,(t=>n.getRelatedEdgesData(t)));o.forEach((e=>{const i=kh(e),r=a.findIndex((([t])=>t===i));-1!==r&&a.splice(r,1);const o=n.getElementType(i);HT(t,"remove",o,e)})),l.forEach((e=>HT(t,"remove","edge",e))),u.forEach((t=>{var e;const n=kh(t);(null===(e=this.context.element)||void 0===e?void 0:e.getElement(n))?r.edges.set(n,t):i.edges.set(n,t)}))}else{const i=n.getChildrenData(e),r=i.map(kh),{edges:o}=Ig(r,(t=>n.getRelatedEdgesData(t)));[...i,...o].forEach((e=>{var i;const r=kh(e),o=n.getElementType(r),s=null===(i=this.context.element)||void 0===i?void 0:i.getElement(r);HT(t,s?"update":"add",o,e),"combo"===o&&a.push([r,e])}))}}return t}},"collapse-expand-node":class extends UT{getElement(t){return this.context.element.getElement(t)}handleExpand(t,e){if(ZT(e,"add","node",t),Zd(t))return;const n=kh(t);ZT(e,"add","node",t);this.context.model.getRelatedEdgesData(n,"out").forEach((t=>{HT(e,"add","edge",t)}));this.context.model.getChildrenData(n).forEach((t=>{this.handleExpand(t,e)}))}beforeDraw(t){const{graph:e,model:n}=this.context;if(!n.model.hasTreeStructure(mc))return t;const{add:{nodes:i,edges:r},update:{nodes:a}}=t,o=new Map,s=new Map;i.forEach(((t,e)=>{Zd(t)&&o.set(e,t)})),r.forEach((t=>{if("node"!==e.getElementType(t.source))return;const n=e.getNodeData(t.source);Zd(n)&&o.set(t.source,n)})),a.forEach(((t,e)=>{const n=this.getElement(e);if(!n)return;const i=n.attributes.collapsed;Zd(t)?i||o.set(e,t):i&&s.set(e,t)}));const l=new Set;return o.forEach(((e,i)=>{n.getDescendantsData(i).forEach((e=>{const i=kh(e);if(l.has(i))return;HT(t,"remove","node",e);n.getRelatedEdgesData(i).forEach((e=>{HT(t,"remove","edge",e)})),l.add(i)}))})),s.forEach(((e,i)=>{n.getAncestorsData(i,mc).some(Zd)?HT(t,"remove","node",e):this.handleExpand(e,t)})),t}},"get-edge-actual-ends":class extends UT{beforeDraw(t){const{add:e,update:n}=t,{model:i}=this.context;return[...e.edges.entries(),...n.edges.entries()].forEach((([,t])=>{WT(i,t)})),t}},"map-node-size":XT,"place-radial-labels":YT,"process-parallel-edges":$T,"update-related-edges":class extends UT{beforeDraw(t,e){const{stage:n}=e;if("visibility"===n)return t;const{model:i}=this.context,{update:{nodes:r,edges:a,combos:o}}=t,s=(t,e)=>{i.getRelatedEdgesData(e).forEach((t=>!a.has(kh(t))&&a.set(kh(t),t)))};return r.forEach(s),o.forEach(s),t}}},shape:{circle:bl,ellipse:wl,group:Tl,html:Ml,image:Of,line:Ol,path:Pl,polygon:Rl,polyline:kl,rect:Il,text:Fl,label:Ef,badge:wf}};ol.enableMassiveParsedStyleAssignOptimization=!0,Object.entries(fS).forEach((([t,e])=>{Object.entries(e).forEach((([e,n])=>{!function(t,e,n,i=!1){const r=yc[t][e];!i&&r?r!==n&&_c.warn(`The extension ${e} of ${t} has been registered before.`):Object.assign(yc[t],{[e]:n})}(t,e,n)}))}))},13722:function(t){var e;"undefined"!=typeof self&&self,e=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e){t.exports={assign:Object.assign,getHeight:function(t,e,n,i){return void 0===i&&(i="height"),"center"===n?(t[i]+e[i])/2:t.height}}},function(t,e,n){var i=n(3),r=function(){function t(t,e){void 0===e&&(e={}),this.options=e,this.rootNode=i(t,e)}return t.prototype.execute=function(){throw new Error("please override this method")},t}();t.exports=r},function(t,e,n){var i=n(4),r=["LR","RL","TB","BT","H","V"],a=["LR","RL","H"],o=r[0];t.exports=function(t,e,n){var s=e.direction||o;if(e.isHorizontal=function(t){return a.indexOf(t)>-1}(s),s&&-1===r.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===r[0])n(t,e);else if(s===r[1])n(t,e),t.right2left();else if(s===r[2])n(t,e);else if(s===r[3])n(t,e),t.bottom2top();else if(s===r[4]||s===r[5]){var l=i(t,e),u=l.left,c=l.right;n(u,e),n(c,e),e.isHorizontal?u.right2left():u.bottom2top(),c.translate(u.x-c.x,u.y-c.y),t.x=u.x,t.y=c.y;var h=t.getBoundingBox();e.isHorizontal?h.top<0&&t.translate(0,-h.top):h.left<0&&t.translate(-h.left,0)}var d=e.fixedRoot;return void 0===d&&(d=!0),d&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),function(t,e){if(e.radial){var n=e.isHorizontal?["x","y"]:["y","x"],i=n[0],r=n[1],a={x:1/0,y:1/0},o={x:-1/0,y:-1/0},s=0;t.DFTraverse((function(t){s++;var e=t.x,n=t.y;a.x=Math.min(a.x,e),a.y=Math.min(a.y,n),o.x=Math.max(o.x,e),o.y=Math.max(o.y,n)}));var l=o[r]-a[r];if(0===l)return;var u=2*Math.PI/s;t.DFTraverse((function(e){var n=(e[r]-a[r])/l*(2*Math.PI-u)+u,o=e[i]-t[i];e.x=Math.cos(n)*o,e.y=Math.sin(n)*o}))}}(t,e),t}},function(t,e,n){var i=n(0),r={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function a(t,e){var n=this;if(n.vgap=n.hgap=0,t instanceof a)return t;n.data=t;var i=e.getHGap(t),r=e.getVGap(t);return n.preH=e.getPreH(t),n.preV=e.getPreV(t),n.width=e.getWidth(t),n.height=e.getHeight(t),n.width+=n.preH,n.height+=n.preV,n.id=e.getId(t),n.x=n.y=0,n.depth=0,n.children||(n.children=[]),n.addGap(i,r),n}i.assign(a.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){var n=this;n.hgap+=t,n.vgap+=e,n.width+=2*t,n.height+=2*e},eachNode:function(t){for(var e,n=[this];e=n.shift();)t(e),n=e.children.concat(n)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,n=[this];e=n.shift();)t(e),n=n.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)})),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode((function(n){n.x+=t,n.y+=e,n.x+=n.preH,n.y+=n.preV}))},right2left:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.x=t.x-2*(t.x-e.left)-t.width})),t.translate(e.width,0)},bottom2top:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.y=t.y-2*(t.y-e.top)-t.height})),t.translate(0,e.height)}}),t.exports=function(t,e,n){void 0===e&&(e={});var o,s=new a(t,e=i.assign({},r,e)),l=[s];if(!n&&!t.collapsed)for(;o=l.shift();)if(!o.data.collapsed){var u=e.getChildren(o.data),c=u?u.length:0;if(o.children=new Array(c),u&&c)for(var h=0;h<c;h++){var d=new a(u[h],e);o.children[h]=d,l.push(d),d.parent=o,d.depth=o.depth+1}}return s}},function(t,e,n){var i=n(3);t.exports=function(t,e){for(var n=i(t.data,e,!0),r=i(t.data,e,!0),a=t.children.length,o=Math.round(a/2),s=e.getSide||function(t,e){return e<o?"right":"left"},l=0;l<a;l++){var u=t.children[l];"right"===s(u,l)?r.children.push(u):n.children.push(u)}return n.eachNode((function(t){t.isRoot()||(t.side="left")})),r.eachNode((function(t){t.isRoot()||(t.side="right")})),{left:n,right:r}}},function(t,e,n){var i={compactBox:n(6),dendrogram:n(8),indented:n(10),mindmap:n(12)};t.exports=i},function(t,e,n){function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var r=n(1),a=n(7),o=n(2),s=n(0),l=function(t){function e(){return t.apply(this,arguments)||this}var n,r;return r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,i(n,r),e.prototype.execute=function(){return o(this.rootNode,this.options,a)},e}(r),u={};t.exports=function(t,e){return e=s.assign({},u,e),new l(t,e).execute()}},function(t,e){function n(t,e,n,i){void 0===i&&(i=[]);var r=this;r.w=t||0,r.h=e||0,r.y=n||0,r.x=0,r.c=i||[],r.cs=i.length,r.prelim=0,r.mod=0,r.shift=0,r.change=0,r.tl=null,r.tr=null,r.el=null,r.er=null,r.msel=0,r.mser=0}function i(t,e,n){n?t.y+=e:t.x+=e,t.children.forEach((function(t){i(t,e,n)}))}function r(t,e){var n=e?t.y:t.x;return t.children.forEach((function(t){n=Math.min(r(t,e),n)})),n}function a(t,e){i(t,-r(t,e),e)}function o(t,e,n){n?e.y=t.x:e.x=t.x,t.c.forEach((function(t,i){o(t,e.children[i],n)}))}function s(t,e,n){void 0===n&&(n=0),e?(t.x=n,n+=t.width):(t.y=n,n+=t.height),t.children.forEach((function(t){s(t,e,n)}))}n.fromNode=function(t,e){if(!t)return null;var i=[];return t.children.forEach((function(t){i.push(n.fromNode(t,e))})),e?new n(t.height,t.width,t.x,i):new n(t.width,t.height,t.y,i)},t.exports=function(t,e){void 0===e&&(e={});var i=e.isHorizontal;function r(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function l(t,e,n){for(var i=t.c[e-1],r=i.mod,a=t.c[e],o=a.mod;null!==i&&null!==a;){d(i)>n.low&&(n=n.nxt);var s=r+i.prelim+i.w-(o+a.prelim);s>0&&(o+=s,u(t,e,n.index,s));var l=d(i),f=d(a);l<=f&&null!==(i=h(i))&&(r+=i.mod),l>=f&&null!==(a=c(a))&&(o+=a.mod)}!i&&a?function(t,e,n,i){var r=t.c[0].el;r.tl=n;var a=i-n.mod-t.c[0].msel;r.mod+=a,r.prelim-=a,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,a,o):i&&!a&&function(t,e,n,i){var r=t.c[e].er;r.tr=n;var a=i-n.mod-t.c[e].mser;r.mod+=a,r.prelim-=a,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,i,r)}function u(t,e,n,i){t.c[e].mod+=i,t.c[e].msel+=i,t.c[e].mser+=i,function(t,e,n,i){if(n!==e-1){var r=e-n;t.c[n+1].shift+=i/r,t.c[e].shift-=i/r,t.c[e].change-=i-i/r}}(t,e,n,i)}function c(t){return 0===t.cs?t.tl:t.c[0]}function h(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function d(t){return t.y+t.h}function f(t,e,n){for(;null!==n&&t>=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}s(t,i);var p=n.fromNode(t,i);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=f(d(e.c[0].el),0,null),i=1;i<e.cs;++i){t(e.c[i]);var a=d(e.c[i].er);l(e,i,n),n=f(a,i,n)}!function(t){t.prelim=(t.c[0].prelim+t.c[0].mod+t.c[t.cs-1].mod+t.c[t.cs-1].prelim+t.c[t.cs-1].w)/2-t.w/2}(e),r(e)}else r(e)}(p),function t(e,n){n+=e.mod,e.x=e.prelim+n,function(t){for(var e=0,n=0,i=0;i<t.cs;i++)n+=(e+=t.c[i].shift)+t.c[i].change,t.c[i].mod+=n}(e);for(var i=0;i<e.cs;i++)t(e.c[i],n)}(p,0),o(p,t,i),a(t,i),t}},function(t,e,n){function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var r=n(1),a=n(9),o=n(2),s=n(0),l=function(t){function e(){return t.apply(this,arguments)||this}var n,r;return r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,i(n,r),e.prototype.execute=function(){var t=this;return t.rootNode.width=0,o(t.rootNode,t.options,a)},e}(r),u={};t.exports=function(t,e){return e=s.assign({},u,e),new l(t,e).execute()}},function(t,e,n){var i=n(0);function r(t,e){void 0===t&&(t=0),void 0===e&&(e=[]);var n=this;n.x=n.y=0,n.leftChild=n.rightChild=null,n.height=0,n.children=e}var a={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function o(t,e,n){n?(e.x=t.x,e.y=t.y):(e.x=t.y,e.y=t.x),t.children.forEach((function(t,i){o(t,e.children[i],n)}))}t.exports=function(t,e){void 0===e&&(e={}),e=i.assign({},a,e);var n,s=0,l=function t(e){if(!e)return null;e.width=0,e.depth&&e.depth>s&&(s=e.depth);var n=e.children,i=n.length,a=new r(e.height,[]);return n.forEach((function(e,n){var r=t(e);a.children.push(r),0===n&&(a.leftChild=r),n===i-1&&(a.rightChild=r)})),a.originNode=e,a.isLeaf=e.isLeaf(),a}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=s;else{var n=e.children.map((function(e){return t(e)})),i=Math.min.apply(null,n);e.drawingDepth=i-1}return e.drawingDepth}(l),function t(i){i.x=i.drawingDepth*e.rankSep,i.isLeaf?(i.y=0,n&&(i.y=n.y+n.height+e.nodeSep,i.originNode.parent!==n.originNode.parent&&(i.y+=e.subTreeSep)),n=i):(i.children.forEach((function(e){t(e)})),i.y=(i.leftChild.y+i.rightChild.y)/2)}(l),o(l,t,e.isHorizontal),t}},function(t,e,n){function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var r=n(1),a=n(11),o=n(4),s=n(0),l=["LR","RL","H"],u=l[0],c=function(t){function e(){return t.apply(this,arguments)||this}var n,r;return r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,i(n,r),e.prototype.execute=function(){var t=this.options,e=this.rootNode;t.isHorizontal=!0;var n=t.indent,i=void 0===n?20:n,r=t.dropCap,s=void 0===r||r,c=t.direction,h=void 0===c?u:c,d=t.align;if(h&&-1===l.indexOf(h))throw new TypeError("Invalid direction: "+h);if(h===l[0])a(e,i,s,d);else if(h===l[1])a(e,i,s,d),e.right2left();else if(h===l[2]){var f=o(e,t),p=f.left,g=f.right;a(p,i,s,d),p.right2left(),a(g,i,s,d);var m=p.getBoundingBox();g.translate(m.width,0),e.x=g.x-e.width/2}return e},e}(r),h={};t.exports=function(t,e){return e=s.assign({},h,e),new c(t,e).execute()}},function(t,e,n){var i=n(0);t.exports=function(t,e,n,r){var a=null;t.eachNode((function(t){!function(t,e,n,r,a){var o=("function"==typeof n?n(t):n)*t.depth;if(!r)try{if(t.id===t.parent.children[0].id)return t.x+=o,void(t.y=e?e.y:0)}catch(t){}if(t.x+=o,e){if(t.y=e.y+i.getHeight(e,t,a),e.parent&&t.parent.id!==e.parent.id){var s=e.parent,l=s.y+i.getHeight(s,t,a);t.y=l>t.y?l:t.y}}else t.y=0}(t,a,e,n,r),a=t}))}},function(t,e,n){function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var r=n(1),a=n(13),o=n(2),s=n(0),l=function(t){function e(){return t.apply(this,arguments)||this}var n,r;return r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,i(n,r),e.prototype.execute=function(){return o(this.rootNode,this.options,a)},e}(r),u={};t.exports=function(t,e){return e=s.assign({},u,e),new l(t,e).execute()}},function(t,e,n){var i=n(0);function r(t,e){var n=0;return t.children.length?t.children.forEach((function(t){n+=r(t,e)})):n=t.height,t._subTreeSep=e.getSubTreeSep(t.data),t.totalHeight=Math.max(t.height,n)+2*t._subTreeSep,t.totalHeight}function a(t){var e=t.children,n=e.length;if(n){e.forEach((function(t){a(t)}));var i=e[0],r=e[n-1],o=r.y-i.y+r.height,s=0;if(e.forEach((function(t){s+=t.totalHeight})),o>t.height)t.y=i.y+o/2-t.height/2;else if(1!==e.length||t.height>s){var l=t.y+(t.height-o)/2-i.y;e.forEach((function(t){t.translate(0,l)}))}else t.y=(i.y+i.height/2+r.y+r.height/2)/2-t.height/2}}var o={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=i.assign({},o,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse((function(t){t.x=t.parent.x+t.parent.width})),t.parent=null,r(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode((function(t){var e=t.children,n=e.length;if(n){var i=e[0];if(i.startY=t.startY+t._subTreeSep,1===n)i.y=t.y+t.height/2-i.height/2;else{i.y=i.startY+i.totalHeight/2-i.height/2;for(var r=1;r<n;r++){var a=e[r];a.startY=e[r-1].startY+e[r-1].totalHeight,a.y=a.startY+a.totalHeight/2-a.height/2}}}})),a(t)}}])},t.exports=e()},88522:function(t,e,n){"use strict";var i=n(92310),r=n.n(i),a=n(75440),o=n(55405),s=n(59301),l=n(53487),u=n(92343),c=n(36355),h=n(57809);const{Option:d}=h.default;function f(t){return t&&t.type&&(t.type.isSelectOption||t.type.isSelectOptGroup)}const p=(t,e)=>{const{prefixCls:n,className:i,popupClassName:l,dropdownClassName:p,children:g,dataSource:m}=t,v=(0,a.Z)(g);let y;1===v.length&&(0,u.l$)(v[0])&&!f(v[0])&&([y]=v);const x=y?()=>y:void 0;let b;b=v.length&&f(v[0])?g:m?m.map((t=>{if((0,u.l$)(t))return t;switch(typeof t){case"string":return s.createElement(d,{key:t,value:t},t);case"object":{const{value:e}=t;return s.createElement(d,{key:e,value:e},t.text)}default:return}})):[];const{getPrefixCls:_}=s.useContext(c.E_),E=_("select",n);return s.createElement(h.default,Object.assign({ref:e,suffixIcon:null},(0,o.Z)(t,["dataSource","dropdownClassName"]),{prefixCls:E,popupClassName:l||p,className:r()(`${E}-auto-complete`,i),mode:h.default.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:x}),b)},g=s.forwardRef(p),m=(0,l.Z)(g);g.Option=d,g._InternalPanelDoNotUseOrYouWillBeFired=m,e.Z=g},28103:function(t,e,n){"use strict";n.d(e,{Z:function(){return f}});var i=n(92310),r=n.n(i),a=n(59301),o=n(36355),s=n(17313),l=n(83116),u=n(37613);const c=t=>{const{componentCls:e,sizePaddingEdgeHorizontal:n,colorSplit:i,lineWidth:r,textPaddingInline:a,orientationMargin:o,verticalMarginInline:l}=t;return{[e]:Object.assign(Object.assign({},(0,s.Wf)(t)),{borderBlockStart:`${r}px solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:l,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${r}px solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${t.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${e}-with-text`]:{display:"flex",alignItems:"center",margin:`${t.dividerHorizontalWithTextGutterMargin}px 0`,color:t.colorTextHeading,fontWeight:500,fontSize:t.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${r}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${e}-with-text-left`]:{"&::before":{width:100*o+"%"},"&::after":{width:100-100*o+"%"}},[`&-horizontal${e}-with-text-right`]:{"&::before":{width:100-100*o+"%"},"&::after":{width:100*o+"%"}},[`${e}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:a},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${r}px 0 0`},[`&-horizontal${e}-with-text${e}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${e}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${e}-with-text`]:{color:t.colorText,fontWeight:"normal",fontSize:t.fontSize},[`&-horizontal${e}-with-text-left${e}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${e}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${e}-with-text-right${e}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${e}-inner-text`]:{paddingInlineEnd:n}}})}};var h=(0,l.Z)("Divider",(t=>{const e=(0,u.TS)(t,{dividerHorizontalWithTextGutterMargin:t.margin,dividerHorizontalGutterMargin:t.marginLG,sizePaddingEdgeHorizontal:0});return[c(e)]}),(t=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:t.marginXS}))),d=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};var f=t=>{const{getPrefixCls:e,direction:n,divider:i}=a.useContext(o.E_),{prefixCls:s,type:l="horizontal",orientation:u="center",orientationMargin:c,className:f,rootClassName:p,children:g,dashed:m,plain:v,style:y}=t,x=d(t,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),b=e("divider",s),[_,E]=h(b),w=u.length>0?`-${u}`:u,T=!!g,S="left"===u&&null!=c,M="right"===u&&null!=c,C=r()(b,null==i?void 0:i.className,E,`${b}-${l}`,{[`${b}-with-text`]:T,[`${b}-with-text${w}`]:T,[`${b}-dashed`]:!!m,[`${b}-plain`]:!!v,[`${b}-rtl`]:"rtl"===n,[`${b}-no-default-orientation-margin-left`]:S,[`${b}-no-default-orientation-margin-right`]:M},f,p),A=a.useMemo((()=>"number"==typeof c?c:/^\d+$/.test(c)?Number(c):c),[c]),O=Object.assign(Object.assign({},S&&{marginLeft:A}),M&&{marginRight:A});return _(a.createElement("div",Object.assign({className:C,style:Object.assign(Object.assign({},null==i?void 0:i.style),y)},x,{role:"separator"}),g&&"vertical"!==l&&a.createElement("span",{className:`${b}-inner-text`,style:O},g)))}},43428:function(t,e,n){"use strict";n.d(e,{Z:function(){return j}});var i=n(92310),r=n.n(i),a=n(57259),o=n(29043),s=n(43403),l=n(19171),u=n(59301),c=u.createContext(null),h=u.createContext({}),d=c,f=n(80962),p=n(5891),g=n(43167),m=n(20287),v=n(47413),y=n(83794);var x=function(t){var e=t.prefixCls,n=t.className,i=t.style,o=t.children,s=t.containerRef,l=t.id,c={onMouseEnter:t.onMouseEnter,onMouseOver:t.onMouseOver,onMouseLeave:t.onMouseLeave,onClick:t.onClick,onKeyDown:t.onKeyDown,onKeyUp:t.onKeyUp},d=u.useContext(h).panel,f=(0,y.useComposeRef)(d,s);return u.createElement(u.Fragment,null,u.createElement("div",(0,p.Z)({id:l,className:r()("".concat(e,"-content"),n),style:(0,a.Z)({},i),"aria-modal":"true",role:"dialog",ref:f},c),o))},b=n(85870);function _(t){return"string"==typeof t&&String(Number(t))===t?((0,b.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(t)):t}var E={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function w(t,e){var n,i,s,l,c=t.prefixCls,h=t.open,y=t.placement,b=t.inline,w=t.push,T=t.forceRender,S=t.autoFocus,M=t.keyboard,C=t.rootClassName,A=t.rootStyle,O=t.zIndex,N=t.className,P=t.id,L=t.style,R=t.motion,D=t.width,k=t.height,I=t.children,B=t.contentWrapperStyle,F=t.mask,z=t.maskClosable,G=t.maskMotion,j=t.maskClassName,U=t.maskStyle,H=t.afterOpenChange,V=t.onClose,Z=t.onMouseEnter,W=t.onMouseOver,X=t.onMouseLeave,Y=t.onClick,q=t.onKeyDown,$=t.onKeyUp,K=u.useRef(),Q=u.useRef(),J=u.useRef();u.useImperativeHandle(e,(function(){return K.current}));u.useEffect((function(){var t;h&&S&&(null===(t=K.current)||void 0===t||t.focus({preventScroll:!0}))}),[h]);var tt=u.useState(!1),et=(0,o.Z)(tt,2),nt=et[0],it=et[1],rt=u.useContext(d),at=null!==(n=null!==(i=null===(s=!1===w?{distance:0}:!0===w?{}:w||{})||void 0===s?void 0:s.distance)&&void 0!==i?i:null==rt?void 0:rt.pushDistance)&&void 0!==n?n:180,ot=u.useMemo((function(){return{pushDistance:at,push:function(){it(!0)},pull:function(){it(!1)}}}),[at]);u.useEffect((function(){var t,e;h?null==rt||null===(t=rt.push)||void 0===t||t.call(rt):null==rt||null===(e=rt.pull)||void 0===e||e.call(rt)}),[h]),u.useEffect((function(){return function(){var t;null==rt||null===(t=rt.pull)||void 0===t||t.call(rt)}}),[]);var st=F&&u.createElement(g.default,(0,p.Z)({key:"mask"},G,{visible:h}),(function(t,e){var n=t.className,i=t.style;return u.createElement("div",{className:r()("".concat(c,"-mask"),n,j),style:(0,a.Z)((0,a.Z)({},i),U),onClick:z&&h?V:void 0,ref:e})})),lt="function"==typeof R?R(y):R,ut={};if(nt&&at)switch(y){case"top":ut.transform="translateY(".concat(at,"px)");break;case"bottom":ut.transform="translateY(".concat(-at,"px)");break;case"left":ut.transform="translateX(".concat(at,"px)");break;default:ut.transform="translateX(".concat(-at,"px)")}"left"===y||"right"===y?ut.width=_(D):ut.height=_(k);var ct={onMouseEnter:Z,onMouseOver:W,onMouseLeave:X,onClick:Y,onKeyDown:q,onKeyUp:$},ht=u.createElement(g.default,(0,p.Z)({key:"panel"},lt,{visible:h,forceRender:T,onVisibleChanged:function(t){null==H||H(t)},removeOnLeave:!1,leavedClassName:"".concat(c,"-content-wrapper-hidden")}),(function(e,n){var i=e.className,o=e.style;return u.createElement("div",(0,p.Z)({className:r()("".concat(c,"-content-wrapper"),i),style:(0,a.Z)((0,a.Z)((0,a.Z)({},ut),o),B)},(0,v.Z)(t,{data:!0})),u.createElement(x,(0,p.Z)({id:P,containerRef:n,prefixCls:c,className:N,style:L},ct),I))})),dt=(0,a.Z)({},A);return O&&(dt.zIndex=O),u.createElement(d.Provider,{value:ot},u.createElement("div",{className:r()(c,"".concat(c,"-").concat(y),C,(l={},(0,f.Z)(l,"".concat(c,"-open"),h),(0,f.Z)(l,"".concat(c,"-inline"),b),l)),style:dt,tabIndex:-1,ref:K,onKeyDown:function(t){var e=t.keyCode,n=t.shiftKey;switch(e){case m.Z.TAB:var i;if(e===m.Z.TAB)if(n||document.activeElement!==J.current){if(n&&document.activeElement===Q.current){var r;null===(r=J.current)||void 0===r||r.focus({preventScroll:!0})}}else null===(i=Q.current)||void 0===i||i.focus({preventScroll:!0});break;case m.Z.ESC:V&&M&&(t.stopPropagation(),V(t))}}},st,u.createElement("div",{tabIndex:0,ref:Q,style:E,"aria-hidden":"true","data-sentinel":"start"}),ht,u.createElement("div",{tabIndex:0,ref:J,style:E,"aria-hidden":"true","data-sentinel":"end"})))}var T=u.forwardRef(w);var S=function(t){var e=t.open,n=void 0!==e&&e,i=t.prefixCls,r=void 0===i?"rc-drawer":i,c=t.placement,d=void 0===c?"right":c,f=t.autoFocus,p=void 0===f||f,g=t.keyboard,m=void 0===g||g,v=t.width,y=void 0===v?378:v,x=t.mask,b=void 0===x||x,_=t.maskClosable,E=void 0===_||_,w=t.getContainer,S=t.forceRender,M=t.afterOpenChange,C=t.destroyOnClose,A=t.onMouseEnter,O=t.onMouseOver,N=t.onMouseLeave,P=t.onClick,L=t.onKeyDown,R=t.onKeyUp,D=t.panelRef,k=u.useState(!1),I=(0,o.Z)(k,2),B=I[0],F=I[1];var z=u.useState(!1),G=(0,o.Z)(z,2),j=G[0],U=G[1];(0,l.Z)((function(){U(!0)}),[]);var H=!!j&&n,V=u.useRef(),Z=u.useRef();(0,l.Z)((function(){H&&(Z.current=document.activeElement)}),[H]);var W=u.useMemo((function(){return{panel:D}}),[D]);if(!S&&!B&&!H&&C)return null;var X={onMouseEnter:A,onMouseOver:O,onMouseLeave:N,onClick:P,onKeyDown:L,onKeyUp:R},Y=(0,a.Z)((0,a.Z)({},t),{},{open:H,prefixCls:r,placement:d,autoFocus:p,keyboard:m,width:y,mask:b,maskClosable:E,inline:!1===w,afterOpenChange:function(t){var e,n;(F(t),null==M||M(t),t||!Z.current||null!==(e=V.current)&&void 0!==e&&e.contains(Z.current))||(null===(n=Z.current)||void 0===n||n.focus({preventScroll:!0}))},ref:V},X);return u.createElement(h.Provider,{value:W},u.createElement(s.Z,{open:H||S||B,autoDestroy:!1,getContainer:w,autoLock:b&&(H||B)},u.createElement(T,Y)))},M=n(62892),C=n(36355),A=n(32441),O=n(47729);var N=t=>{const{prefixCls:e,title:n,footer:i,extra:a,closeIcon:o,closable:s,onClose:l,headerStyle:c,drawerStyle:h,bodyStyle:d,footerStyle:f,children:p}=t,g=u.useCallback((t=>u.createElement("button",{type:"button",onClick:l,"aria-label":"Close",className:`${e}-close`},t)),[l]),[m,v]=(0,O.Z)(s,o,g,void 0,!0),y=u.useMemo((()=>n||m?u.createElement("div",{style:c,className:r()(`${e}-header`,{[`${e}-header-close-only`]:m&&!n&&!a})},u.createElement("div",{className:`${e}-header-title`},v,n&&u.createElement("div",{className:`${e}-title`},n)),a&&u.createElement("div",{className:`${e}-extra`},a)):null),[m,v,a,c,e,n]),x=u.useMemo((()=>{if(!i)return null;const t=`${e}-footer`;return u.createElement("div",{className:t,style:f},i)}),[i,f,e]);return u.createElement("div",{className:`${e}-wrapper-body`,style:h},y,u.createElement("div",{className:`${e}-body`,style:d},p),x)},P=n(33234),L=n(83116),R=n(37613);var D=t=>{const{componentCls:e,motionDurationSlow:n}=t,i={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${n}`}}};return{[e]:{[`${e}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${n}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${e}-panel-motion`]:{"&-left":[i,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[i,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[i,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[i,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const k=t=>{const{componentCls:e,zIndexPopup:n,colorBgMask:i,colorBgElevated:r,motionDurationSlow:a,motionDurationMid:o,padding:s,paddingLG:l,fontSizeLG:u,lineHeightLG:c,lineWidth:h,lineType:d,colorSplit:f,marginSM:p,colorIcon:g,colorIconHover:m,colorText:v,fontWeightStrong:y,footerPaddingBlock:x,footerPaddingInline:b}=t,_=`${e}-content-wrapper`;return{[e]:{position:"fixed",inset:0,zIndex:n,pointerEvents:"none","&-pure":{position:"relative",background:r,[`&${e}-left`]:{boxShadow:t.boxShadowDrawerLeft},[`&${e}-right`]:{boxShadow:t.boxShadowDrawerRight},[`&${e}-top`]:{boxShadow:t.boxShadowDrawerUp},[`&${e}-bottom`]:{boxShadow:t.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${e}-mask`]:{position:"absolute",inset:0,zIndex:n,background:i,pointerEvents:"auto"},[_]:{position:"absolute",zIndex:n,maxWidth:"100vw",transition:`all ${a}`,"&-hidden":{display:"none"}},[`&-left > ${_}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:t.boxShadowDrawerLeft},[`&-right > ${_}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:t.boxShadowDrawerRight},[`&-top > ${_}`]:{top:0,insetInline:0,boxShadow:t.boxShadowDrawerUp},[`&-bottom > ${_}`]:{bottom:0,insetInline:0,boxShadow:t.boxShadowDrawerDown},[`${e}-content`]:{width:"100%",height:"100%",overflow:"auto",background:r,pointerEvents:"auto"},[`${e}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${e}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${s}px ${l}px`,fontSize:u,lineHeight:c,borderBottom:`${h}px ${d} ${f}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${e}-extra`]:{flex:"none"},[`${e}-close`]:{display:"inline-block",marginInlineEnd:p,color:g,fontWeight:y,fontSize:u,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${o}`,textRendering:"auto","&:focus, &:hover":{color:m,textDecoration:"none"}},[`${e}-title`]:{flex:1,margin:0,color:v,fontWeight:t.fontWeightStrong,fontSize:u,lineHeight:c},[`${e}-body`]:{flex:1,minWidth:0,minHeight:0,padding:l,overflow:"auto"},[`${e}-footer`]:{flexShrink:0,padding:`${x}px ${b}px`,borderTop:`${h}px ${d} ${f}`},"&-rtl":{direction:"rtl"}}}};var I=(0,L.Z)("Drawer",(t=>{const e=(0,R.TS)(t,{});return[k(e),D(e)]}),(t=>({zIndexPopup:t.zIndexPopupBase,footerPaddingBlock:t.paddingXS,footerPaddingInline:t.padding}))),B=n(11575),F=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const z={distance:180},G=t=>{const{rootClassName:e,width:n,height:i,size:a="default",mask:o=!0,push:s=z,open:l,afterOpenChange:c,onClose:h,prefixCls:d,getContainer:f,style:p,className:g,visible:m,afterVisibleChange:v}=t,y=F(t,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:x,getPrefixCls:b,direction:_,drawer:E}=u.useContext(C.E_),w=b("drawer",d),[T,O]=I(w),L=void 0===f&&x?()=>x(document.body):f,R=r()({"no-mask":!o,[`${w}-rtl`]:"rtl"===_},e,O);const D=u.useMemo((()=>null!=n?n:"large"===a?736:378),[n,a]),k=u.useMemo((()=>null!=i?i:"large"===a?736:378),[i,a]),G={motionName:(0,M.m)(w,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},j=(0,B.H)();return T(u.createElement(P.BR,null,u.createElement(A.Ux,{status:!0,override:!0},u.createElement(S,Object.assign({prefixCls:w,onClose:h,maskMotion:G,motion:t=>({motionName:(0,M.m)(w,`panel-motion-${t}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500})},y,{open:null!=l?l:m,mask:o,push:s,width:D,height:k,style:Object.assign(Object.assign({},null==E?void 0:E.style),p),className:r()(null==E?void 0:E.className,g),rootClassName:R,getContainer:L,afterOpenChange:null!=c?c:v,panelRef:j}),u.createElement(N,Object.assign({prefixCls:w},y,{onClose:h}))))))};G._InternalPanelDoNotUseOrYouWillBeFired=t=>{const{prefixCls:e,style:n,className:i,placement:a="right"}=t,o=F(t,["prefixCls","style","className","placement"]),{getPrefixCls:s}=u.useContext(C.E_),l=s("drawer",e),[c,h]=I(l),d=r()(l,`${l}-pure`,`${l}-${a}`,h,i);return c(u.createElement("div",{className:d,style:n},u.createElement(N,Object.assign({prefixCls:l},o))))};var j=G},45411:function(t){"use strict";t.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(t,e,n){var i=n(45411),r=n(75029),a=Object.hasOwnProperty,o=Object.create(null);for(var s in i)a.call(i,s)&&(o[i[s]]=s);var l=t.exports={to:{},get:{}};function u(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}l.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=l.get.hsl(t),n="hsl";break;case"hwb":e=l.get.hwb(t),n="hwb";break;default:e=l.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},l.get.rgb=function(t){if(!t)return null;var e,n,r,o=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var s=2*n;o[n]=parseInt(e.slice(s,s+2),16)}r&&(o[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)o[n]=parseInt(e[n]+e[n],16);r&&(o[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)o[n]=parseInt(e[n+1],0);e[4]&&(e[5]?o[3]=.01*parseFloat(e[4]):o[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:a.call(i,e[1])?((o=i[e[1]])[3]=1,o):null:null;for(n=0;n<3;n++)o[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?o[3]=.01*parseFloat(e[4]):o[3]=parseFloat(e[4]))}for(n=0;n<3;n++)o[n]=u(o[n],0,255);return o[3]=u(o[3],0,1),o},l.get.hsl=function(t){if(!t)return null;var e=t.match(/^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*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},l.get.hwb=function(t){if(!t)return null;var e=t.match(/^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*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},l.to.hex=function(){var t=r(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},l.to.rgb=function(){var t=r(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},l.to.rgb.percent=function(){var t=r(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+i+"%)":"rgba("+e+"%, "+n+"%, "+i+"%, "+t[3]+")"},l.to.hsl=function(){var t=r(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},l.to.hwb=function(){var t=r(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},l.to.keyword=function(t){return o[t.slice(0,3)]}},97774:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(59301),o=h(a),s=h(n(12708)),l=h(n(53291)),u=n(47242),c=n(65429);function h(t){return t&&t.__esModule?t:{default:t}}var d=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.getEchartsInstance=function(){return n.echartsLib.getInstanceByDom(n.echartsElement)||n.echartsLib.init(n.echartsElement,n.props.theme,n.props.opts)},n.dispose=function(){if(n.echartsElement){try{(0,u.clear)(n.echartsElement)}catch(t){console.warn(t)}n.echartsLib.dispose(n.echartsElement)}},n.rerender=function(){var t=n.props,e=t.onEvents,i=t.onChartReady,r=n.renderEchartDom();n.bindEvents(r,e||{}),"function"==typeof i&&n.props.onChartReady(r),n.echartsElement&&(0,u.bind)(n.echartsElement,(function(){try{r.resize()}catch(t){console.warn(t)}}))},n.bindEvents=function(t,e){var n=function(e,n){"string"==typeof e&&"function"==typeof n&&t.on(e,(function(e){n(e,t)}))};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n(i,e[i])},n.renderEchartDom=function(){var t=n.getEchartsInstance();return t.setOption(n.props.option,n.props.notMerge||!1,n.props.lazyUpdate||!1),n.props.showLoading?t.showLoading(n.props.loadingOption||null):t.hideLoading(),t},n.echartsLib=t.echarts,n.echartsElement=null,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),r(e,[{key:"componentDidMount",value:function(){this.rerender()}},{key:"componentDidUpdate",value:function(t){if("function"!=typeof this.props.shouldSetOption||this.props.shouldSetOption(t,this.props)){if(!(0,l.default)(t.theme,this.props.theme)||!(0,l.default)(t.opts,this.props.opts)||!(0,l.default)(t.onEvents,this.props.onEvents))return this.dispose(),void this.rerender();var e=["option","notMerge","lazyUpdate","showLoading","loadingOption"];if(!(0,l.default)((0,c.pick)(this.props,e),(0,c.pick)(t,e))){var n=this.renderEchartDom();if(!(0,l.default)(t.style,this.props.style)||!(0,l.default)(t.className,this.props.className))try{n.resize()}catch(t){console.warn(t)}}}}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"render",value:function(){var t=this,e=this.props,n=e.style,r=e.className,a=i({height:300},n);return o.default.createElement("div",{ref:function(e){t.echartsElement=e},style:a,className:"echarts-for-react "+r})}}]),e}(a.Component);e.default=d,d.propTypes={option:s.default.object.isRequired,echarts:s.default.object,notMerge:s.default.bool,lazyUpdate:s.default.bool,style:s.default.object,className:s.default.string,theme:s.default.oneOfType([s.default.string,s.default.object]),onChartReady:s.default.func,showLoading:s.default.bool,loadingOption:s.default.object,onEvents:s.default.object,opts:s.default.shape({devicePixelRatio:s.default.number,renderer:s.default.oneOf(["canvas","svg"]),width:s.default.oneOfType([s.default.number,s.default.oneOf([null,void 0,"auto"])]),height:s.default.oneOfType([s.default.number,s.default.oneOf([null,void 0,"auto"])])}),shouldSetOption:s.default.func},d.defaultProps={echarts:{},notMerge:!1,lazyUpdate:!1,style:{},className:"",theme:null,onChartReady:function(){},showLoading:!1,loadingOption:null,onEvents:{},opts:{},shouldSetOption:function(){return!0}}},42441:function(t,e,n){"use strict";e.Z=void 0;var i=r(n(76411));function r(t){return t&&t.__esModule?t:{default:t}}var a=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.echartsLib=i.default,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e}(r(n(97774)).default);e.Z=a},65429:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.pick=function(t,e){var n={};return e.forEach((function(e){n[e]=t[e]})),n}},48961:function(t,e,n){var i;i=function(t){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=87)}([function(e,n){e.exports=t},function(t,e,n){!function(t){"use strict";var n={};n.exports=e,function(t){if(!e)var e=1e-6;if(!n)var n="undefined"!=typeof Float32Array?Float32Array:Array;if(!i)var i=Math.random;var r={setMatrixArrayType:function(t){n=t}};void 0!==t&&(t.glMatrix=r);var a=Math.PI/180;r.toRadian=function(t){return t*a};var o,s={create:function(){var t=new n(2);return t[0]=0,t[1]=0,t},clone:function(t){var e=new n(2);return e[0]=t[0],e[1]=t[1],e},fromValues:function(t,e){var i=new n(2);return i[0]=t,i[1]=e,i},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},set:function(t,e,n){return t[0]=e,t[1]=n,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},subtract:function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}};s.sub=s.subtract,s.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},s.mul=s.multiply,s.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},s.div=s.divide,s.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},s.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},s.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},s.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},s.distance=function(t,e){var n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)},s.dist=s.distance,s.squaredDistance=function(t,e){var n=e[0]-t[0],i=e[1]-t[1];return n*n+i*i},s.sqrDist=s.squaredDistance,s.length=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},s.len=s.length,s.squaredLength=function(t){var e=t[0],n=t[1];return e*e+n*n},s.sqrLen=s.squaredLength,s.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},s.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},s.normalize=function(t,e){var n=e[0],i=e[1],r=n*n+i*i;return r>0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},s.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},s.cross=function(t,e,n){var i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t},s.lerp=function(t,e,n,i){var r=e[0],a=e[1];return t[0]=r+i*(n[0]-r),t[1]=a+i*(n[1]-a),t},s.random=function(t,e){e=e||1;var n=2*i()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},s.transformMat2=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t},s.transformMat2d=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t},s.transformMat3=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t},s.transformMat4=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t},s.forEach=(o=s.create(),function(t,e,n,i,r,a){var s,l;for(e||(e=2),n||(n=0),l=i?Math.min(i*e+n,t.length):t.length,s=n;s<l;s+=e)o[0]=t[s],o[1]=t[s+1],r(o,o,a),t[s]=o[0],t[s+1]=o[1];return t}),s.str=function(t){return"vec2("+t[0]+", "+t[1]+")"},void 0!==t&&(t.vec2=s);var l={create:function(){var t=new n(3);return t[0]=0,t[1]=0,t[2]=0,t},clone:function(t){var e=new n(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},fromValues:function(t,e,i){var r=new n(3);return r[0]=t,r[1]=e,r[2]=i,r},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},set:function(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},subtract:function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}};l.sub=l.subtract,l.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t},l.mul=l.multiply,l.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t},l.div=l.divide,l.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},l.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},l.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},l.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t},l.distance=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.sqrt(n*n+i*i+r*r)},l.dist=l.distance,l.squaredDistance=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return n*n+i*i+r*r},l.sqrDist=l.squaredDistance,l.length=function(t){var e=t[0],n=t[1],i=t[2];return Math.sqrt(e*e+n*n+i*i)},l.len=l.length,l.squaredLength=function(t){var e=t[0],n=t[1],i=t[2];return e*e+n*n+i*i},l.sqrLen=l.squaredLength,l.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},l.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},l.normalize=function(t,e){var n=e[0],i=e[1],r=e[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},l.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},l.cross=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[0],s=n[1],l=n[2];return t[0]=r*l-a*s,t[1]=a*o-i*l,t[2]=i*s-r*o,t},l.lerp=function(t,e,n,i){var r=e[0],a=e[1],o=e[2];return t[0]=r+i*(n[0]-r),t[1]=a+i*(n[1]-a),t[2]=o+i*(n[2]-o),t},l.random=function(t,e){e=e||1;var n=2*i()*Math.PI,r=2*i()-1,a=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*a,t[1]=Math.sin(n)*a,t[2]=r*e,t},l.transformMat4=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,t},l.transformMat3=function(t,e,n){var i=e[0],r=e[1],a=e[2];return t[0]=i*n[0]+r*n[3]+a*n[6],t[1]=i*n[1]+r*n[4]+a*n[7],t[2]=i*n[2]+r*n[5]+a*n[8],t},l.transformQuat=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[0],s=n[1],l=n[2],u=n[3],c=u*i+s*a-l*r,h=u*r+l*i-o*a,d=u*a+o*r-s*i,f=-o*i-s*r-l*a;return t[0]=c*u+f*-o+h*-l-d*-s,t[1]=h*u+f*-s+d*-o-c*-l,t[2]=d*u+f*-l+c*-s-h*-o,t},l.rotateX=function(t,e,n,i){var r=[],a=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},l.rotateY=function(t,e,n,i){var r=[],a=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},l.rotateZ=function(t,e,n,i){var r=[],a=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},l.forEach=function(){var t=l.create();return function(e,n,i,r,a,o){var s,l;for(n||(n=3),i||(i=0),l=r?Math.min(r*n+i,e.length):e.length,s=i;s<l;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}(),l.angle=function(t,e){var n=l.fromValues(t[0],t[1],t[2]),i=l.fromValues(e[0],e[1],e[2]);l.normalize(n,n),l.normalize(i,i);var r=l.dot(n,i);return r>1?0:Math.acos(r)},l.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},void 0!==t&&(t.vec3=l);var u={create:function(){var t=new n(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},clone:function(t){var e=new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},fromValues:function(t,e,i,r){var a=new n(4);return a[0]=t,a[1]=e,a[2]=i,a[3]=r,a},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},set:function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},subtract:function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}};u.sub=u.subtract,u.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t},u.mul=u.multiply,u.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t},u.div=u.divide,u.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},u.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},u.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},u.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t},u.distance=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(n*n+i*i+r*r+a*a)},u.dist=u.distance,u.squaredDistance=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],a=e[3]-t[3];return n*n+i*i+r*r+a*a},u.sqrDist=u.squaredDistance,u.length=function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.sqrt(e*e+n*n+i*i+r*r)},u.len=u.length,u.squaredLength=function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r},u.sqrLen=u.squaredLength,u.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},u.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},u.normalize=function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*n+i*i+r*r+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t[3]=e[3]*o),t},u.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},u.lerp=function(t,e,n,i){var r=e[0],a=e[1],o=e[2],s=e[3];return t[0]=r+i*(n[0]-r),t[1]=a+i*(n[1]-a),t[2]=o+i*(n[2]-o),t[3]=s+i*(n[3]-s),t},u.random=function(t,e){return e=e||1,t[0]=i(),t[1]=i(),t[2]=i(),t[3]=i(),u.normalize(t,t),u.scale(t,t,e),t},u.transformMat4=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,t[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,t[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,t[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,t},u.transformQuat=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[0],s=n[1],l=n[2],u=n[3],c=u*i+s*a-l*r,h=u*r+l*i-o*a,d=u*a+o*r-s*i,f=-o*i-s*r-l*a;return t[0]=c*u+f*-o+h*-l-d*-s,t[1]=h*u+f*-s+d*-o-c*-l,t[2]=d*u+f*-l+c*-s-h*-o,t},u.forEach=function(){var t=u.create();return function(e,n,i,r,a,o){var s,l;for(n||(n=4),i||(i=0),l=r?Math.min(r*n+i,e.length):e.length,s=i;s<l;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}(),u.str=function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},void 0!==t&&(t.vec4=u);var c={create:function(){var t=new n(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},clone:function(t){var e=new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},transpose:function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},invert:function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*a-r*i;return o?(o=1/o,t[0]=a*o,t[1]=-i*o,t[2]=-r*o,t[3]=n*o,t):null},adjoint:function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},determinant:function(t){return t[0]*t[3]-t[2]*t[1]},multiply:function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=n[0],l=n[1],u=n[2],c=n[3];return t[0]=i*s+a*l,t[1]=r*s+o*l,t[2]=i*u+a*c,t[3]=r*u+o*c,t}};c.mul=c.multiply,c.rotate=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=i*l+a*s,t[1]=r*l+o*s,t[2]=i*-s+a*l,t[3]=r*-s+o*l,t},c.scale=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=n[0],l=n[1];return t[0]=i*s,t[1]=r*s,t[2]=a*l,t[3]=o*l,t},c.str=function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},c.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},c.LDU=function(t,e,n,i){return t[2]=i[2]/i[0],n[0]=i[0],n[1]=i[1],n[3]=i[3]-t[2]*n[1],[t,e,n]},void 0!==t&&(t.mat2=c);var h={create:function(){var t=new n(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},clone:function(t){var e=new n(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},invert:function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=n*a-i*r;return l?(l=1/l,t[0]=a*l,t[1]=-i*l,t[2]=-r*l,t[3]=n*l,t[4]=(r*s-a*o)*l,t[5]=(i*o-n*s)*l,t):null},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},multiply:function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=n[0],c=n[1],h=n[2],d=n[3],f=n[4],p=n[5];return t[0]=i*u+a*c,t[1]=r*u+o*c,t[2]=i*h+a*d,t[3]=r*h+o*d,t[4]=i*f+a*p+s,t[5]=r*f+o*p+l,t}};h.mul=h.multiply,h.rotate=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=Math.sin(n),c=Math.cos(n);return t[0]=i*c+a*u,t[1]=r*c+o*u,t[2]=i*-u+a*c,t[3]=r*-u+o*c,t[4]=s,t[5]=l,t},h.scale=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=n[0],c=n[1];return t[0]=i*u,t[1]=r*u,t[2]=a*c,t[3]=o*c,t[4]=s,t[5]=l,t},h.translate=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=n[0],c=n[1];return t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=i*u+a*c+s,t[5]=r*u+o*c+l,t},h.str=function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},h.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)},void 0!==t&&(t.mat2d=h);var d={create:function(){var t=new n(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromMat4:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},clone:function(t){var e=new n(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},transpose:function(t,e){if(t===e){var n=e[1],i=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=i,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},invert:function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=c*o-s*u,d=-c*a+s*l,f=u*a-o*l,p=n*h+i*d+r*f;return p?(p=1/p,t[0]=h*p,t[1]=(-c*i+r*u)*p,t[2]=(s*i-r*o)*p,t[3]=d*p,t[4]=(c*n-r*l)*p,t[5]=(-s*n+r*a)*p,t[6]=f*p,t[7]=(-u*n+i*l)*p,t[8]=(o*n-i*a)*p,t):null},adjoint:function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8];return t[0]=o*c-s*u,t[1]=r*u-i*c,t[2]=i*s-r*o,t[3]=s*l-a*c,t[4]=n*c-r*l,t[5]=r*a-n*s,t[6]=a*u-o*l,t[7]=i*l-n*u,t[8]=n*o-i*a,t},determinant:function(t){var e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8];return e*(u*a-o*l)+n*(-u*r+o*s)+i*(l*r-a*s)},multiply:function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=n[0],f=n[1],p=n[2],g=n[3],m=n[4],v=n[5],y=n[6],x=n[7],b=n[8];return t[0]=d*i+f*o+p*u,t[1]=d*r+f*s+p*c,t[2]=d*a+f*l+p*h,t[3]=g*i+m*o+v*u,t[4]=g*r+m*s+v*c,t[5]=g*a+m*l+v*h,t[6]=y*i+x*o+b*u,t[7]=y*r+x*s+b*c,t[8]=y*a+x*l+b*h,t}};d.mul=d.multiply,d.translate=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=n[0],f=n[1];return t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=d*i+f*o+u,t[7]=d*r+f*s+c,t[8]=d*a+f*l+h,t},d.rotate=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=Math.sin(n),f=Math.cos(n);return t[0]=f*i+d*o,t[1]=f*r+d*s,t[2]=f*a+d*l,t[3]=f*o-d*i,t[4]=f*s-d*r,t[5]=f*l-d*a,t[6]=u,t[7]=c,t[8]=h,t},d.scale=function(t,e,n){var i=n[0],r=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},d.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},d.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n+n,s=i+i,l=r+r,u=n*o,c=i*o,h=i*s,d=r*o,f=r*s,p=r*l,g=a*o,m=a*s,v=a*l;return t[0]=1-h-p,t[3]=c-v,t[6]=d+m,t[1]=c+v,t[4]=1-u-p,t[7]=f-g,t[2]=d-m,t[5]=f+g,t[8]=1-u-h,t},d.normalFromMat4=function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=n*s-i*o,x=n*l-r*o,b=n*u-a*o,_=i*l-r*s,E=i*u-a*s,w=r*u-a*l,T=c*g-h*p,S=c*m-d*p,M=c*v-f*p,C=h*m-d*g,A=h*v-f*g,O=d*v-f*m,N=y*O-x*A+b*C+_*M-E*S+w*T;return N?(N=1/N,t[0]=(s*O-l*A+u*C)*N,t[1]=(l*M-o*O-u*S)*N,t[2]=(o*A-s*M+u*T)*N,t[3]=(r*A-i*O-a*C)*N,t[4]=(n*O-r*M+a*S)*N,t[5]=(i*M-n*A-a*T)*N,t[6]=(g*w-m*E+v*_)*N,t[7]=(m*b-p*w-v*x)*N,t[8]=(p*E-g*b+v*y)*N,t):null},d.str=function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},d.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))},void 0!==t&&(t.mat3=d);var f={create:function(){var t=new n(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},clone:function(t){var e=new n(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},transpose:function(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=a,t[11]=e[14],t[12]=r,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},invert:function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=n*s-i*o,x=n*l-r*o,b=n*u-a*o,_=i*l-r*s,E=i*u-a*s,w=r*u-a*l,T=c*g-h*p,S=c*m-d*p,M=c*v-f*p,C=h*m-d*g,A=h*v-f*g,O=d*v-f*m,N=y*O-x*A+b*C+_*M-E*S+w*T;return N?(N=1/N,t[0]=(s*O-l*A+u*C)*N,t[1]=(r*A-i*O-a*C)*N,t[2]=(g*w-m*E+v*_)*N,t[3]=(d*E-h*w-f*_)*N,t[4]=(l*M-o*O-u*S)*N,t[5]=(n*O-r*M+a*S)*N,t[6]=(m*b-p*w-v*x)*N,t[7]=(c*w-d*b+f*x)*N,t[8]=(o*A-s*M+u*T)*N,t[9]=(i*M-n*A-a*T)*N,t[10]=(p*E-g*b+v*y)*N,t[11]=(h*b-c*E-f*y)*N,t[12]=(s*S-o*C-l*T)*N,t[13]=(n*C-i*S+r*T)*N,t[14]=(g*x-p*_-m*y)*N,t[15]=(c*_-h*x+d*y)*N,t):null},adjoint:function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(d*v-f*m)-h*(l*v-u*m)+g*(l*f-u*d),t[1]=-(i*(d*v-f*m)-h*(r*v-a*m)+g*(r*f-a*d)),t[2]=i*(l*v-u*m)-s*(r*v-a*m)+g*(r*u-a*l),t[3]=-(i*(l*f-u*d)-s*(r*f-a*d)+h*(r*u-a*l)),t[4]=-(o*(d*v-f*m)-c*(l*v-u*m)+p*(l*f-u*d)),t[5]=n*(d*v-f*m)-c*(r*v-a*m)+p*(r*f-a*d),t[6]=-(n*(l*v-u*m)-o*(r*v-a*m)+p*(r*u-a*l)),t[7]=n*(l*f-u*d)-o*(r*f-a*d)+c*(r*u-a*l),t[8]=o*(h*v-f*g)-c*(s*v-u*g)+p*(s*f-u*h),t[9]=-(n*(h*v-f*g)-c*(i*v-a*g)+p*(i*f-a*h)),t[10]=n*(s*v-u*g)-o*(i*v-a*g)+p*(i*u-a*s),t[11]=-(n*(s*f-u*h)-o*(i*f-a*h)+c*(i*u-a*s)),t[12]=-(o*(h*m-d*g)-c*(s*m-l*g)+p*(s*d-l*h)),t[13]=n*(h*m-d*g)-c*(i*m-r*g)+p*(i*d-r*h),t[14]=-(n*(s*m-l*g)-o*(i*m-r*g)+p*(i*l-r*s)),t[15]=n*(s*d-l*h)-o*(i*d-r*h)+c*(i*l-r*s),t},determinant:function(t){var e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*o-n*a)*(h*m-d*g)-(e*s-i*a)*(c*m-d*p)+(e*l-r*a)*(c*g-h*p)+(n*s-i*o)*(u*m-d*f)-(n*l-r*o)*(u*g-h*f)+(i*l-r*s)*(u*p-c*f)},multiply:function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=n[0],b=n[1],_=n[2],E=n[3];return t[0]=x*i+b*s+_*h+E*g,t[1]=x*r+b*l+_*d+E*m,t[2]=x*a+b*u+_*f+E*v,t[3]=x*o+b*c+_*p+E*y,x=n[4],b=n[5],_=n[6],E=n[7],t[4]=x*i+b*s+_*h+E*g,t[5]=x*r+b*l+_*d+E*m,t[6]=x*a+b*u+_*f+E*v,t[7]=x*o+b*c+_*p+E*y,x=n[8],b=n[9],_=n[10],E=n[11],t[8]=x*i+b*s+_*h+E*g,t[9]=x*r+b*l+_*d+E*m,t[10]=x*a+b*u+_*f+E*v,t[11]=x*o+b*c+_*p+E*y,x=n[12],b=n[13],_=n[14],E=n[15],t[12]=x*i+b*s+_*h+E*g,t[13]=x*r+b*l+_*d+E*m,t[14]=x*a+b*u+_*f+E*v,t[15]=x*o+b*c+_*p+E*y,t},multiplyAffine:function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[4],s=e[5],l=e[6],u=e[8],c=e[9],h=e[10],d=e[12],f=e[13],p=e[14],g=n[0],m=n[1],v=n[2];return t[0]=g*i+m*o+v*u,t[1]=g*r+m*s+v*c,t[2]=g*a+m*l+v*h,g=n[4],m=n[5],v=n[6],t[4]=g*i+m*o+v*u,t[5]=g*r+m*s+v*c,t[6]=g*a+m*l+v*h,g=n[8],m=n[9],v=n[10],t[8]=g*i+m*o+v*u,t[9]=g*r+m*s+v*c,t[10]=g*a+m*l+v*h,g=n[12],m=n[13],v=n[14],t[12]=g*i+m*o+v*u+d,t[13]=g*r+m*s+v*c+f,t[14]=g*a+m*l+v*h+p,t}};f.mul=f.multiply,f.mulAffine=f.multiplyAffine,f.translate=function(t,e,n){var i,r,a,o,s,l,u,c,h,d,f,p,g=n[0],m=n[1],v=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=d,t[10]=f,t[11]=p,t[12]=i*g+s*m+h*v+e[12],t[13]=r*g+l*m+d*v+e[13],t[14]=a*g+u*m+f*v+e[14],t[15]=o*g+c*m+p*v+e[15]),t},f.scale=function(t,e,n){var i=n[0],r=n[1],a=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},f.rotate=function(t,n,i,r){var a,o,s,l,u,c,h,d,f,p,g,m,v,y,x,b,_,E,w,T,S,M,C,A,O=r[0],N=r[1],P=r[2],L=Math.sqrt(O*O+N*N+P*P);return Math.abs(L)<e?null:(O*=L=1/L,N*=L,P*=L,a=Math.sin(i),s=1-(o=Math.cos(i)),l=n[0],u=n[1],c=n[2],h=n[3],d=n[4],f=n[5],p=n[6],g=n[7],m=n[8],v=n[9],y=n[10],x=n[11],b=O*O*s+o,_=N*O*s+P*a,E=P*O*s-N*a,w=O*N*s-P*a,T=N*N*s+o,S=P*N*s+O*a,M=O*P*s+N*a,C=N*P*s-O*a,A=P*P*s+o,t[0]=l*b+d*_+m*E,t[1]=u*b+f*_+v*E,t[2]=c*b+p*_+y*E,t[3]=h*b+g*_+x*E,t[4]=l*w+d*T+m*S,t[5]=u*w+f*T+v*S,t[6]=c*w+p*T+y*S,t[7]=h*w+g*T+x*S,t[8]=l*M+d*C+m*A,t[9]=u*M+f*C+v*A,t[10]=c*M+p*C+y*A,t[11]=h*M+g*C+x*A,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t)},f.rotateX=function(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],c=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*r+u*i,t[5]=o*r+c*i,t[6]=s*r+h*i,t[7]=l*r+d*i,t[8]=u*r-a*i,t[9]=c*r-o*i,t[10]=h*r-s*i,t[11]=d*r-l*i,t},f.rotateY=function(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],c=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r-u*i,t[1]=o*r-c*i,t[2]=s*r-h*i,t[3]=l*r-d*i,t[8]=a*i+u*r,t[9]=o*i+c*r,t[10]=s*i+h*r,t[11]=l*i+d*r,t},f.rotateZ=function(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],c=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r+u*i,t[1]=o*r+c*i,t[2]=s*r+h*i,t[3]=l*r+d*i,t[4]=u*r-a*i,t[5]=c*r-o*i,t[6]=h*r-s*i,t[7]=d*r-l*i,t},f.fromRotationTranslation=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=i+i,l=r+r,u=a+a,c=i*s,h=i*l,d=i*u,f=r*l,p=r*u,g=a*u,m=o*s,v=o*l,y=o*u;return t[0]=1-(f+g),t[1]=h+y,t[2]=d-v,t[3]=0,t[4]=h-y,t[5]=1-(c+g),t[6]=p+m,t[7]=0,t[8]=d+v,t[9]=p-m,t[10]=1-(c+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},f.fromQuat=function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n+n,s=i+i,l=r+r,u=n*o,c=i*o,h=i*s,d=r*o,f=r*s,p=r*l,g=a*o,m=a*s,v=a*l;return t[0]=1-h-p,t[1]=c+v,t[2]=d-m,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=f+g,t[7]=0,t[8]=d+m,t[9]=f-g,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},f.frustum=function(t,e,n,i,r,a,o){var s=1/(n-e),l=1/(r-i),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(r+i)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t},f.perspective=function(t,e,n,i,r){var a=1/Math.tan(e/2),o=1/(i-r);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(r+i)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*r*i*o,t[15]=0,t},f.ortho=function(t,e,n,i,r,a,o){var s=1/(e-n),l=1/(i-r),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*l,t[14]=(o+a)*u,t[15]=1,t},f.lookAt=function(t,n,i,r){var a,o,s,l,u,c,h,d,p,g,m=n[0],v=n[1],y=n[2],x=r[0],b=r[1],_=r[2],E=i[0],w=i[1],T=i[2];return Math.abs(m-E)<e&&Math.abs(v-w)<e&&Math.abs(y-T)<e?f.identity(t):(h=m-E,d=v-w,p=y-T,a=b*(p*=g=1/Math.sqrt(h*h+d*d+p*p))-_*(d*=g),o=_*(h*=g)-x*p,s=x*d-b*h,(g=Math.sqrt(a*a+o*o+s*s))?(a*=g=1/g,o*=g,s*=g):(a=0,o=0,s=0),l=d*s-p*o,u=p*a-h*s,c=h*o-d*a,(g=Math.sqrt(l*l+u*u+c*c))?(l*=g=1/g,u*=g,c*=g):(l=0,u=0,c=0),t[0]=a,t[1]=l,t[2]=h,t[3]=0,t[4]=o,t[5]=u,t[6]=d,t[7]=0,t[8]=s,t[9]=c,t[10]=p,t[11]=0,t[12]=-(a*m+o*v+s*y),t[13]=-(l*m+u*v+c*y),t[14]=-(h*m+d*v+p*y),t[15]=1,t)},f.str=function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},f.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))},void 0!==t&&(t.mat4=f);var p,g,m,v,y={create:function(){var t=new n(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}};y.rotationTo=(p=l.create(),g=l.fromValues(1,0,0),m=l.fromValues(0,1,0),function(t,e,n){var i=l.dot(e,n);return i<-.999999?(l.cross(p,g,e),l.length(p)<1e-6&&l.cross(p,m,e),l.normalize(p,p),y.setAxisAngle(t,p,Math.PI),t):i>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(l.cross(p,e,n),t[0]=p[0],t[1]=p[1],t[2]=p[2],t[3]=1+i,y.normalize(t,t))}),y.setAxes=(v=d.create(),function(t,e,n,i){return v[0]=n[0],v[3]=n[1],v[6]=n[2],v[1]=i[0],v[4]=i[1],v[7]=i[2],v[2]=-e[0],v[5]=-e[1],v[8]=-e[2],y.normalize(t,y.fromMat3(t,v))}),y.clone=u.clone,y.fromValues=u.fromValues,y.copy=u.copy,y.set=u.set,y.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},y.setAxisAngle=function(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t},y.add=u.add,y.multiply=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=n[0],l=n[1],u=n[2],c=n[3];return t[0]=i*c+o*s+r*u-a*l,t[1]=r*c+o*l+a*s-i*u,t[2]=a*c+o*u+i*l-r*s,t[3]=o*c-i*s-r*l-a*u,t},y.mul=y.multiply,y.scale=u.scale,y.rotateX=function(t,e,n){n*=.5;var i=e[0],r=e[1],a=e[2],o=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=i*l+o*s,t[1]=r*l+a*s,t[2]=a*l-r*s,t[3]=o*l-i*s,t},y.rotateY=function(t,e,n){n*=.5;var i=e[0],r=e[1],a=e[2],o=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=i*l-a*s,t[1]=r*l+o*s,t[2]=a*l+i*s,t[3]=o*l-r*s,t},y.rotateZ=function(t,e,n){n*=.5;var i=e[0],r=e[1],a=e[2],o=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=i*l+r*s,t[1]=r*l-i*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},y.calculateW=function(t,e){var n=e[0],i=e[1],r=e[2];return t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),t},y.dot=u.dot,y.lerp=u.lerp,y.slerp=function(t,e,n,i){var r,a,o,s,l,u=e[0],c=e[1],h=e[2],d=e[3],f=n[0],p=n[1],g=n[2],m=n[3];return(a=u*f+c*p+h*g+d*m)<0&&(a=-a,f=-f,p=-p,g=-g,m=-m),1-a>1e-6?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,l=Math.sin(i*r)/o):(s=1-i,l=i),t[0]=s*u+l*f,t[1]=s*c+l*p,t[2]=s*h+l*g,t[3]=s*d+l*m,t},y.invert=function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*n+i*i+r*r+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-i*s,t[2]=-r*s,t[3]=a*s,t},y.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},y.length=u.length,y.len=y.length,y.squaredLength=u.squaredLength,y.sqrLen=y.squaredLength,y.normalize=u.normalize,y.fromMat3=function(t,e){var n,i=e[0]+e[4]+e[8];if(i>0)n=Math.sqrt(i+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*a+a]-e[3*o+o]+1),t[r]=.5*n,n=.5/n,t[3]=(e[3*a+o]-e[3*o+a])*n,t[a]=(e[3*a+r]+e[3*r+a])*n,t[o]=(e[3*o+r]+e[3*r+o])*n}return t},y.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},void 0!==t&&(t.quat=y)}(n.exports)}()},function(t,e,n){"use strict";var i=n(24),r=n(46),a=n(5),o=n(6),s=n(7),l=n(17),u=n(28),c=n(13),h=n(0),d=n.n(h),f=n(29),p=n(53),g=n.n(p),m=n(54),v=n(106),y=n(107),x=n(113),b=n(114),_=n(3),E=n(68),w=n(37),T=n(69),S=n(116),M=n(70),C=n(71),A=n(72),O=n(36),N=n(30),P=n(23),L=n(4),R=n(117),D=n(50),k=n(118),I=n(119),B=n(120),F=n(9),z=n(67),G=n(49),j=n(15),U=n(52),H=n(121),V=n(126),Z=n(63),W=n(127),X=n(128),Y=n(129),q=n(130),$=n(131),K=n(132);function Q(t){return t instanceof HTMLCanvasElement||t instanceof HTMLImageElement||t instanceof Image}d.a.util.extend(u.a.prototype,H.a),s.a.import(V.a),s.a.import(Z.a),s.a.import(W.a),s.a.import(X.a),s.a.import(Y.a),s.a.import(q.a),s.a.import($.a),s.a.import(K.a);var J=f.a.prototype.addToScene,tt=f.a.prototype.removeFromScene;f.a.prototype.addToScene=function(t){if(J.call(this,t),this.__zr){var e=this.__zr;t.traverse((function(t){t.__zr=e,t.addAnimatorsToZr&&t.addAnimatorsToZr(e)}))}},f.a.prototype.removeFromScene=function(t){tt.call(this,t),t.traverse((function(t){var e=t.__zr;t.__zr=null,e&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(e)}))},l.a.prototype.setTextureImage=function(t,e,n,i){if(this.shader){var r,a,o=n.getZr(),s=this;return s.autoUpdateTextureStatus=!1,s.disableTexture(t),(a=e)&&"none"!==a&&(r=et.loadTexture(e,n,i,(function(e){s.enableTexture(t),o&&o.refresh()})),s.set(t,r)),r}};var et={};et.Renderer=r.a,et.Node=u.a,et.Mesh=i.a,et.Shader=s.a,et.Material=l.a,et.Texture=o.a,et.Texture2D=a.a,et.Geometry=c.a,et.SphereGeometry=E.a,et.PlaneGeometry=w.a,et.CubeGeometry=T.a,et.AmbientLight=S.a,et.DirectionalLight=M.a,et.PointLight=C.a,et.SpotLight=A.a,et.PerspectiveCamera=O.a,et.OrthographicCamera=N.a,et.Vector2=P.a,et.Vector3=L.a,et.Vector4=R.a,et.Quaternion=D.a,et.Matrix2=k.a,et.Matrix2d=I.a,et.Matrix3=B.a,et.Matrix4=F.a,et.Plane=z.a,et.Ray=G.a,et.BoundingBox=j.a,et.Frustum=U.a;var nt=m.a.createBlank("rgba(255,255,255,0)").image;function it(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function rt(t){if((t.wrapS===o.a.REPEAT||t.wrapT===o.a.REPEAT)&&t.image){var e=it(t.width),n=it(t.height);if(e!==t.width||n!==t.height){var i=document.createElement("canvas");i.width=e,i.height=n,i.getContext("2d").drawImage(t.image,0,0,e,n),t.image=i}}}et.loadTexture=function(t,e,n,i){"function"==typeof n&&(i=n,n={}),n=n||{};for(var r=Object.keys(n).sort(),a="",o=0;o<r.length;o++)a+=r[o]+"_"+n[r[o]]+"_";var s,l=e.__textureCache=e.__textureCache||new g.a(20);if((s=t).getZr&&s.setOption){var u=t.__textureid__;if(h=l.get(a+u))h.texture.surface.setECharts(t),i&&i(h.texture);else{var c=new v.a(t);for(c.onupdate=function(){e.getZr().refresh()},h={texture:c.getTexture()},o=0;o<r.length;o++)h.texture[r[o]]=n[r[o]];u=t.__textureid__||"__ecgl_ec__"+h.texture.__uid__,t.__textureid__=u,l.put(a+u,h),i&&i(h.texture)}return h.texture}if(Q(t)){var h;if(u=t.__textureid__,!(h=l.get(a+u))){for(h={texture:new et.Texture2D({image:t})},o=0;o<r.length;o++)h.texture[r[o]]=n[r[o]];u=t.__textureid__||"__ecgl_image__"+h.texture.__uid__,t.__textureid__=u,l.put(a+u,h),rt(h.texture),i&&i(h.texture)}return h.texture}if(h=l.get(a+t))h.callbacks?h.callbacks.push(i):i&&i(h.texture);else if(t.match(/.hdr$|^data:application\/octet-stream/)){h={callbacks:[i]};var d=m.a.loadTexture(t,{exposure:n.exposure,fileType:"hdr"},(function(){d.dirty(),h.callbacks.forEach((function(t){t&&t(d)})),h.callbacks=null}));h.texture=d,l.put(a+t,h)}else{for(d=new et.Texture2D({image:new Image}),o=0;o<r.length;o++)d[r[o]]=n[r[o]];h={texture:d,callbacks:[i]};var f=d.image;f.onload=function(){d.image=f,rt(d),d.dirty(),h.callbacks.forEach((function(t){t&&t(d)})),h.callbacks=null},f.src=t,d.image=nt,l.put(a+t,h)}return h.texture},et.createAmbientCubemap=function(t,e,n,i){var r=(t=t||{}).texture,a=_.a.firstNotNull(t.exposure,1),o=new y.a({intensity:_.a.firstNotNull(t.specularIntensity,1)}),s=new x.a({intensity:_.a.firstNotNull(t.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return o.cubemap=et.loadTexture(r,n,{exposure:a},(function(){o.cubemap.flipY=!1,o.prefilter(e,32),s.coefficients=b.a.projectEnvironmentMap(e,o.cubemap,{lod:1}),i&&i()})),{specular:o,diffuse:s}},et.createBlankTexture=m.a.createBlank,et.isImage=Q,et.additiveBlend=function(t){t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)},et.parseColor=function(t,e){return t instanceof Array?(e||(e=[]),e[0]=t[0],e[1]=t[1],e[2]=t[2],t.length>3?e[3]=t[3]:e[3]=1,e):((e=d.a.color.parse(t||"#000",e)||[0,0,0,0])[0]/=255,e[1]/=255,e[2]/=255,e)},et.directionFromAlphaBeta=function(t,e){var n=t/180*Math.PI+Math.PI/2,i=-e/180*Math.PI+Math.PI/2,r=[],a=Math.sin(n);return r[0]=a*Math.cos(i),r[1]=-Math.cos(n),r[2]=a*Math.sin(i),r},et.getShadowResolution=function(t){var e=1024;switch(t){case"low":e=512;break;case"medium":break;case"high":e=2048;break;case"ultra":e=4096}return e},et.COMMON_SHADERS=["lambert","color","realistic","hatching"],et.createShader=function(t){var e=s.a.source(t+".vertex"),n=s.a.source(t+".fragment");e||console.error("Vertex shader of '%s' not exits",t),n||console.error("Fragment shader of '%s' not exits",t);var i=new s.a(e,n);return i.name=t,i},et.createMaterial=function(t,e){e instanceof Array||(e=[e]);var n=et.createShader(t),i=new l.a({shader:n});return e.forEach((function(t){"string"==typeof t&&i.define(t)})),i},et.setMaterialFromModel=function(t,e,n,i){e.autoUpdateTextureStatus=!1;var r=n.getModel(t+"Material"),a=r.get("detailTexture"),o=_.a.firstNotNull(r.get("textureTiling"),1),s=_.a.firstNotNull(r.get("textureOffset"),0);"number"==typeof o&&(o=[o,o]),"number"==typeof s&&(s=[s,s]);var l=o[0]>1||o[1]>1?et.Texture.REPEAT:et.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===t){var c=r.get("roughness"),h=r.get("metalness");null!=h?isNaN(h)&&(e.setTextureImage("metalnessMap",h,i,u),h=_.a.firstNotNull(r.get("metalnessAdjust"),.5)):h=0,null!=c?isNaN(c)&&(e.setTextureImage("roughnessMap",c,i,u),c=_.a.firstNotNull(r.get("roughnessAdjust"),.5)):c=.5;var d=r.get("normalTexture");e.setTextureImage("detailMap",a,i,u),e.setTextureImage("normalMap",d,i,u),e.set({roughness:c,metalness:h,detailUvRepeat:o,detailUvOffset:s})}else if("lambert"===t)e.setTextureImage("detailMap",a,i,u),e.set({detailUvRepeat:o,detailUvOffset:s});else if("color"===t)e.setTextureImage("detailMap",a,i,u),e.set({detailUvRepeat:o,detailUvOffset:s});else if("hatching"===t){var f=r.get("hatchingTextures")||[];f.length<6&&console.error("Invalid hatchingTextures.");for(var p=0;p<6;p++)e.setTextureImage("hatch"+(p+1),f[p],i,{anisotropic:8,wrapS:et.Texture.REPEAT,wrapT:et.Texture.REPEAT});e.set({detailUvRepeat:o,detailUvOffset:s})}},et.updateVertexAnimation=function(t,e,n,i){var r=i.get("animation"),a=i.get("animationDurationUpdate"),o=i.get("animationEasingUpdate"),s=n.shadowDepthMaterial;if(r&&e&&a>0&&e.geometry.vertexCount===n.geometry.vertexCount){n.material.define("vertex","VERTEX_ANIMATION"),n.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l<t.length;l++)n.geometry.attributes[t[l][0]].value=e.geometry.attributes[t[l][1]].value;n.geometry.dirty(),n.__percent=0,n.material.set("percent",0),n.stopAnimation(),n.animate().when(a,{__percent:1}).during((function(){n.material.set("percent",n.__percent),s&&s.set("percent",n.__percent)})).done((function(){n.ignorePreZ=!1,n.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")})).start(o)}else n.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")},e.a=et},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a={firstNotNull:function(){for(var t=0,e=arguments.length;t<e;t++)if(null!=arguments[t])return arguments[t]},queryDataIndex:function(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?r.a.util.isArray(e.dataIndex)?r.a.util.map(e.dataIndex,(function(e){return t.indexOfRawIndex(e)})):t.indexOfRawIndex(e.dataIndex):null!=e.name?r.a.util.isArray(e.name)?r.a.util.map(e.name,(function(e){return t.indexOfName(e)})):t.indexOfName(e.name):void 0}};e.a=a},function(t,e,n){"use strict";var i=n(1),r=n.n(i).a.vec3,a=function(t,e,n){t=t||0,e=e||0,n=n||0,this.array=r.fromValues(t,e,n),this._dirty=!0};a.prototype={constructor:a,add:function(t){return r.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e,n){return this.array[0]=t,this.array[1]=e,this.array[2]=n,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this._dirty=!0,this},clone:function(){return new a(this.x,this.y,this.z)},copy:function(t){return r.copy(this.array,t.array),this._dirty=!0,this},cross:function(t,e){return r.cross(this.array,t.array,e.array),this._dirty=!0,this},dist:function(t){return r.dist(this.array,t.array)},distance:function(t){return r.distance(this.array,t.array)},div:function(t){return r.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return r.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return r.dot(this.array,t.array)},len:function(){return r.len(this.array)},length:function(){return r.length(this.array)},lerp:function(t,e,n){return r.lerp(this.array,t.array,e.array,n),this._dirty=!0,this},min:function(t){return r.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return r.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return r.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return r.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return r.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return r.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return r.random(this.array,t),this._dirty=!0,this},scale:function(t){return r.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return r.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return r.sqrDist(this.array,t.array)},squaredDistance:function(t){return r.squaredDistance(this.array,t.array)},sqrLen:function(){return r.sqrLen(this.array)},squaredLength:function(){return r.squaredLength(this.array)},sub:function(t){return r.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return r.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat3:function(t){return r.transformMat3(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return r.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},transformQuat:function(t){return r.transformQuat(this.array,this.array,t.array),this._dirty=!0,this},applyProjection:function(t){var e=this.array;if(0===(t=t.array)[15]){var n=-1/e[2];e[0]=t[0]*e[0]*n,e[1]=t[5]*e[1]*n,e[2]=(t[10]*e[2]+t[14])*n}else e[0]=t[0]*e[0]+t[12],e[1]=t[5]*e[1]+t[13],e[2]=t[10]*e[2]+t[14];return this._dirty=!0,this},eulerFromQuat:function(t,e){a.eulerFromQuat(this,t,e)},eulerFromMat3:function(t,e){a.eulerFromMat3(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var o=Object.defineProperty;if(o){var s=a.prototype;o(s,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),o(s,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),o(s,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}})}function l(t,e,n){return t<e?e:t>n?n:t}a.add=function(t,e,n){return r.add(t.array,e.array,n.array),t._dirty=!0,t},a.set=function(t,e,n,i){r.set(t.array,e,n,i),t._dirty=!0},a.copy=function(t,e){return r.copy(t.array,e.array),t._dirty=!0,t},a.cross=function(t,e,n){return r.cross(t.array,e.array,n.array),t._dirty=!0,t},a.distance=a.dist=function(t,e){return r.distance(t.array,e.array)},a.divide=a.div=function(t,e,n){return r.divide(t.array,e.array,n.array),t._dirty=!0,t},a.dot=function(t,e){return r.dot(t.array,e.array)},a.len=function(t){return r.length(t.array)},a.lerp=function(t,e,n,i){return r.lerp(t.array,e.array,n.array,i),t._dirty=!0,t},a.min=function(t,e,n){return r.min(t.array,e.array,n.array),t._dirty=!0,t},a.max=function(t,e,n){return r.max(t.array,e.array,n.array),t._dirty=!0,t},a.multiply=a.mul=function(t,e,n){return r.multiply(t.array,e.array,n.array),t._dirty=!0,t},a.negate=function(t,e){return r.negate(t.array,e.array),t._dirty=!0,t},a.normalize=function(t,e){return r.normalize(t.array,e.array),t._dirty=!0,t},a.random=function(t,e){return r.random(t.array,e),t._dirty=!0,t},a.scale=function(t,e,n){return r.scale(t.array,e.array,n),t._dirty=!0,t},a.scaleAndAdd=function(t,e,n,i){return r.scaleAndAdd(t.array,e.array,n.array,i),t._dirty=!0,t},a.squaredDistance=a.sqrDist=function(t,e){return r.sqrDist(t.array,e.array)},a.squaredLength=a.sqrLen=function(t){return r.sqrLen(t.array)},a.subtract=a.sub=function(t,e,n){return r.subtract(t.array,e.array,n.array),t._dirty=!0,t},a.transformMat3=function(t,e,n){return r.transformMat3(t.array,e.array,n.array),t._dirty=!0,t},a.transformMat4=function(t,e,n){return r.transformMat4(t.array,e.array,n.array),t._dirty=!0,t},a.transformQuat=function(t,e,n){return r.transformQuat(t.array,e.array,n.array),t._dirty=!0,t};var u=Math.atan2,c=Math.asin,h=Math.abs;a.eulerFromQuat=function(t,e,n){t._dirty=!0,e=e.array;var i=t.array,r=e[0],a=e[1],o=e[2],s=e[3],h=r*r,d=a*a,f=o*o,p=s*s;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":i[0]=u(2*(r*s-a*o),p-h-d+f),i[1]=c(l(2*(r*o+a*s),-1,1)),i[2]=u(2*(o*s-r*a),p+h-d-f);break;case"YXZ":i[0]=c(l(2*(r*s-a*o),-1,1)),i[1]=u(2*(r*o+a*s),p-h-d+f),i[2]=u(2*(r*a+o*s),p-h+d-f);break;case"ZXY":i[0]=c(l(2*(r*s+a*o),-1,1)),i[1]=u(2*(a*s-o*r),p-h-d+f),i[2]=u(2*(o*s-r*a),p-h+d-f);break;case"ZYX":i[0]=u(2*(r*s+o*a),p-h-d+f),i[1]=c(l(2*(a*s-r*o),-1,1)),i[2]=u(2*(r*a+o*s),p+h-d-f);break;case"YZX":i[0]=u(2*(r*s-o*a),p-h+d-f),i[1]=u(2*(a*s-r*o),p+h-d-f),i[2]=c(l(2*(r*a+o*s),-1,1));break;case"XZY":i[0]=u(2*(r*s+a*o),p-h+d-f),i[1]=u(2*(r*o+a*s),p+h-d-f),i[2]=c(l(2*(o*s-r*a),-1,1));break;default:console.warn("Unkown order: "+n)}return t},a.eulerFromMat3=function(t,e,n){var i=e.array,r=i[0],a=i[3],o=i[6],s=i[1],d=i[4],f=i[7],p=i[2],g=i[5],m=i[8],v=t.array;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":v[1]=c(l(o,-1,1)),h(o)<.99999?(v[0]=u(-f,m),v[2]=u(-a,r)):(v[0]=u(g,d),v[2]=0);break;case"YXZ":v[0]=c(-l(f,-1,1)),h(f)<.99999?(v[1]=u(o,m),v[2]=u(s,d)):(v[1]=u(-p,r),v[2]=0);break;case"ZXY":v[0]=c(l(g,-1,1)),h(g)<.99999?(v[1]=u(-p,m),v[2]=u(-a,d)):(v[1]=0,v[2]=u(s,r));break;case"ZYX":v[1]=c(-l(p,-1,1)),h(p)<.99999?(v[0]=u(g,m),v[2]=u(s,r)):(v[0]=0,v[2]=u(-a,d));break;case"YZX":v[2]=c(l(s,-1,1)),h(s)<.99999?(v[0]=u(-f,d),v[1]=u(-p,r)):(v[0]=0,v[1]=u(o,m));break;case"XZY":v[2]=c(-l(a,-1,1)),h(a)<.99999?(v[0]=u(g,d),v[1]=u(o,r)):(v[0]=u(-f,m),v[1]=0);break;default:console.warn("Unkown order: "+n)}return t._dirty=!0,t},a.POSITIVE_X=new a(1,0,0),a.NEGATIVE_X=new a(-1,0,0),a.POSITIVE_Y=new a(0,1,0),a.NEGATIVE_Y=new a(0,-1,0),a.POSITIVE_Z=new a(0,0,1),a.NEGATIVE_Z=new a(0,0,-1),a.UP=new a(0,1,0),a.ZERO=new a(0,0,0),e.a=a},function(t,e,n){"use strict";var i=n(6),r=n(11),a=n(66).a.isPowerOfTwo,o=i.a.extend((function(){return{image:null,pixels:null,mipmaps:[]}}),{update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(t);var n=this.format,i=this.type;e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var a=t.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_2D,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===i&&(t.getGLExtension("OES_texture_half_float")||(i=r.a.FLOAT)),this.mipmaps.length)for(var o=this.width,s=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(e,u,l,o,s,n,i),o/=2,s/=2}else this._updateTextureData(e,this,0,this.width,this.height,n,i),this.useMipmap&&!this.NPOT&&e.generateMipmap(e.TEXTURE_2D);e.bindTexture(e.TEXTURE_2D,null)},_updateTextureData:function(t,e,n,r,a,o,s){e.image?t.texImage2D(t.TEXTURE_2D,n,o,o,s,e.image):o<=i.a.COMPRESSED_RGBA_S3TC_DXT5_EXT&&o>=i.a.COMPRESSED_RGB_S3TC_DXT1_EXT?t.compressedTexImage2D(t.TEXTURE_2D,n,o,r,a,0,e.pixels):t.texImage2D(t.TEXTURE_2D,n,o,r,a,0,o,s,e.pixels)},generateMipmap:function(t){var e=t.gl;this.useMipmap&&!this.NPOT&&(e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),e.generateMipmap(e.TEXTURE_2D))},isPowerOfTwo:function(){var t,e;return this.image?(t=this.image.width,e=this.image.height):(t=this.width,e=this.height),a(t)&&a(e)},isRenderable:function(){return this.image?"CANVAS"===this.image.nodeName||"VIDEO"===this.image.nodeName||this.image.complete:!(!this.width||!this.height)},bind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,this.getWebGLTexture(t))},unbind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,null)},load:function(t,e){var n=new Image;e&&(n.crossOrigin=e);var i=this;return n.onload=function(){i.dirty(),i.trigger("success",i),n.onload=null},n.onerror=function(){i.trigger("error",i),n.onerror=null},n.src=t,this.image=n,this}});Object.defineProperty(o.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(t){this.image?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}}),Object.defineProperty(o.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(t){this.image?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}}),e.a=o},function(t,e,n){"use strict";var i=n(8),r=n(11),a=n(48),o=i.a.extend({width:512,height:512,type:r.a.UNSIGNED_BYTE,format:r.a.RGBA,wrapS:r.a.REPEAT,wrapT:r.a.REPEAT,minFilter:r.a.LINEAR_MIPMAP_LINEAR,magFilter:r.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1},(function(){this._cache=new a.a}),{getWebGLTexture:function(t){var e=t.gl,n=this._cache;return n.use(t.__uid__),n.miss("webgl_texture")&&n.put("webgl_texture",e.createTexture()),this.dynamic?this.update(t):n.isDirty()&&(this.update(t),n.fresh()),n.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(t){},updateCommon:function(t){var e=t.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,this.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===r.a.DEPTH_COMPONENT&&(this.useMipmap=!1);var n=t.getGLExtension("EXT_sRGB");this.format!==o.SRGB||n||(this.format=o.RGB),this.format!==o.SRGB_ALPHA||n||(this.format=o.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?r.a.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?r.a.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var t=this.minFilter;return this.NPOT||!this.useMipmap?t==r.a.NEAREST_MIPMAP_NEAREST||t==r.a.NEAREST_MIPMAP_LINEAR?r.a.NEAREST:t==r.a.LINEAR_MIPMAP_LINEAR||t==r.a.LINEAR_MIPMAP_NEAREST?r.a.LINEAR:t:t},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(t){--t;for(var e=1;e<32;e<<=1)t|=t>>e;return t+1},dispose:function(t){var e=this._cache;e.use(t.__uid__);var n=e.get("webgl_texture");n&&t.gl.deleteTexture(n),e.deleteContext(t.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(o.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t}}),Object.defineProperty(o.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t}}),o.BYTE=r.a.BYTE,o.UNSIGNED_BYTE=r.a.UNSIGNED_BYTE,o.SHORT=r.a.SHORT,o.UNSIGNED_SHORT=r.a.UNSIGNED_SHORT,o.INT=r.a.INT,o.UNSIGNED_INT=r.a.UNSIGNED_INT,o.FLOAT=r.a.FLOAT,o.HALF_FLOAT=36193,o.UNSIGNED_INT_24_8_WEBGL=34042,o.DEPTH_COMPONENT=r.a.DEPTH_COMPONENT,o.DEPTH_STENCIL=r.a.DEPTH_STENCIL,o.ALPHA=r.a.ALPHA,o.RGB=r.a.RGB,o.RGBA=r.a.RGBA,o.LUMINANCE=r.a.LUMINANCE,o.LUMINANCE_ALPHA=r.a.LUMINANCE_ALPHA,o.SRGB=35904,o.SRGB_ALPHA=35906,o.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,o.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,o.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,o.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,o.NEAREST=r.a.NEAREST,o.LINEAR=r.a.LINEAR,o.NEAREST_MIPMAP_NEAREST=r.a.NEAREST_MIPMAP_NEAREST,o.LINEAR_MIPMAP_NEAREST=r.a.LINEAR_MIPMAP_NEAREST,o.NEAREST_MIPMAP_LINEAR=r.a.NEAREST_MIPMAP_LINEAR,o.LINEAR_MIPMAP_LINEAR=r.a.LINEAR_MIPMAP_LINEAR,o.REPEAT=r.a.REPEAT,o.CLAMP_TO_EDGE=r.a.CLAMP_TO_EDGE,o.MIRRORED_REPEAT=r.a.MIRRORED_REPEAT,e.a=o},function(t,e,n){"use strict";var i=n(21),r=n(18),a=n(1),o=n.n(a),s=o.a.mat2,l=o.a.mat3,u=o.a.mat4,c=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\w\,]+)?(\[.*?\])?\s*(:\s*([\S\s]+?))?;/g,h=/attribute\s+(float|int|vec2|vec3|vec4)\s+(\w*)\s*(:\s*(\w+))?;/g,d=/#define\s+(\w+)?(\s+[\w-.]+)?\s*;?\s*\n/g,f={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"},p={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return[0,0]},vec3:function(){return[0,0,0]},vec4:function(){return[0,0,0,0]},ivec2:function(){return[0,0]},ivec3:function(){return[0,0,0]},ivec4:function(){return[0,0,0,0]},mat2:function(){return s.create()},mat3:function(){return l.create()},mat4:function(){return u.create()},array:function(){return[]}},g=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],m=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],v=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],y={},x={};function b(t,e){"object"==typeof t&&(e=t.fragment,t=t.vertex),this._shaderID=function(t,e){var n="vertex:"+t+"fragment:"+e;if(y[n])return y[n];var r=i.a.genGUID();return y[n]=r,x[r]={vertex:t,fragment:e},r}(t,e),this._vertexCode=b.parseImport(t),this._fragmentCode=b.parseImport(e),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}b.prototype={constructor:b,createUniforms:function(){var t={};for(var e in this.uniformTemplates){var n=this.uniformTemplates[e];t[e]={type:n.type,value:n.value()}}return t},_parseImport:function(){this._vertexCode=b.parseImport(this.vertex),this._fragmentCode=b.parseImport(this.fragment)},_parseUniforms:function(){var t={},e=this;function n(n,i,r,a,o,s){if(i&&r){var l,u=f[i],c=!0;if(u){if(e._uniformList.push(r),"sampler2D"!==i&&"samplerCube"!==i||(e.textures[r]={shaderType:"fragment",type:i}),a&&(u+="v"),s)if(g.indexOf(s)>=0)e.attributeSemantics[s]={symbol:r,type:u},c=!1;else if(v.indexOf(s)>=0){var h=!1,d=s;s.match(/TRANSPOSE$/)&&(h=!0,d=s.slice(0,-9)),e.matrixSemantics[s]={symbol:r,type:u,isTranspose:h,semanticNoTranspose:d},c=!1}else if(m.indexOf(s)>=0)e.uniformSemantics[s]={symbol:r,type:u},c=!1;else if("unconfigurable"===s)c=!1;else{if(!(l=e._parseDefaultValue(i,s)))throw new Error('Unkown semantic "'+s+'"');s=""}c&&(t[r]={type:u,value:a?p.array:l||p[i],semantic:s||null})}return["uniform",i,r,a].join(" ")+";\n"}}this._uniformList=[],this._vertexCode=this._vertexCode.replace(c,n),this._fragmentCode=this._fragmentCode.replace(c,n),e.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=t},_parseDefaultValue:function(t,e){if("vec2"!==t&&"vec3"!==t&&"vec4"!==t)return"bool"===t?function(){return"true"===e.toLowerCase()}:"float"===t?function(){return parseFloat(e)}:"int"===t?function(){return parseInt(e)}:void 0;var n=/\[\s*(.*)\s*\]/.exec(e)[1];if(n){var i=n.split(/\s*,\s*/);return function(){return new r.a.Float32Array(i)}}},_parseAttributes:function(){var t={},e=this;this._vertexCode=this._vertexCode.replace(h,(function(n,i,r,a,o){if(i&&r){var s=1;switch(i){case"vec4":s=4;break;case"vec3":s=3;break;case"vec2":s=2;break;case"float":s=1}if(t[r]={type:"float",size:s,semantic:o||null},o){if(g.indexOf(o)<0)throw new Error('Unkown semantic "'+o+'"');e.attributeSemantics[o]={symbol:r,type:i}}}return["attribute",i,r].join(" ")+";\n"})),this.attributes=t},_parseDefines:function(){var t=this;function e(e,n,i){var r=t.fragmentDefines;return r[n]||(r[n]="false"!=i&&("true"==i||(i?isNaN(parseFloat(i))?i.trim():parseFloat(i):null))),""}this._vertexCode=this._vertexCode.replace(d,e),this._fragmentCode=this._fragmentCode.replace(d,e)},clone:function(){var t=x[this._shaderID];return new b(t.vertex,t.fragment)}},Object.defineProperty&&(Object.defineProperty(b.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(b.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(b.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(b.prototype,"uniforms",{get:function(){return this._uniformList}}));var _=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;b.parseImport=function(t){return t=t.replace(_,(function(t,e,n){return(t=b.source(n))?b.parseImport(t):(console.error('Shader chunk "'+n+'" not existed in library'),"")}))};var E=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;b.import=function(t){t.replace(E,(function(t,e,n,i){if(i=i.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var r,a=n.split("."),o=b.codes,s=0;s<a.length-1;)o[r=a[s++]]||(o[r]={}),o=o[r];o[r=a[s]]=i}return i}))},b.codes={},b.source=function(t){for(var e=t.split("."),n=b.codes,i=0;n&&i<e.length;)n=n[e[i++]];return"string"!=typeof n?(console.error('Shader "'+t+'" not existed in library'),""):n},e.a=b},function(t,e,n){"use strict";var i=n(91),r=n(47),a=n(21),o=function(){this.__uid__=a.a.genGUID()};o.__initializers__=[function(t){a.a.extend(this,t)}],a.a.extend(o,i.a),a.a.extend(o.prototype,r.a),e.a=o},function(t,e,n){"use strict";var i,r,a,o,s=n(1),l=n.n(s),u=n(4),c=l.a.mat4,h=l.a.vec3,d=l.a.mat3,f=l.a.quat,p=function(){this._axisX=new u.a,this._axisY=new u.a,this._axisZ=new u.a,this.array=c.create(),this._dirty=!0};p.prototype={constructor:p,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},adjoint:function(){return c.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new p).copy(this)},copy:function(t){return c.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return c.determinant(this.array)},fromQuat:function(t){return c.fromQuat(this.array,t.array),this._dirty=!0,this},fromRotationTranslation:function(t,e){return c.fromRotationTranslation(this.array,t.array,e.array),this._dirty=!0,this},fromMat2d:function(t){return p.fromMat2d(this,t),this},frustum:function(t,e,n,i,r,a){return c.frustum(this.array,t,e,n,i,r,a),this._dirty=!0,this},identity:function(){return c.identity(this.array),this._dirty=!0,this},invert:function(){return c.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(t,e,n){return c.lookAt(this.array,t.array,e.array,n.array),this._dirty=!0,this},mul:function(t){return c.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return c.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return c.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return c.multiply(this.array,t.array,this.array),this._dirty=!0,this},ortho:function(t,e,n,i,r,a){return c.ortho(this.array,t,e,n,i,r,a),this._dirty=!0,this},perspective:function(t,e,n,i){return c.perspective(this.array,t,e,n,i),this._dirty=!0,this},rotate:function(t,e){return c.rotate(this.array,this.array,t,e.array),this._dirty=!0,this},rotateX:function(t){return c.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return c.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return c.rotateZ(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return c.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return c.translate(this.array,this.array,t.array),this._dirty=!0,this},transpose:function(){return c.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:(i=h.create(),r=h.create(),a=h.create(),o=d.create(),function(t,e,n){var s=this.array;h.set(i,s[0],s[1],s[2]),h.set(r,s[4],s[5],s[6]),h.set(a,s[8],s[9],s[10]);var l=h.length(i),u=h.length(r),c=h.length(a);this.determinant()<0&&(l=-l),t&&t.set(l,u,c),n.set(s[12],s[13],s[14]),d.fromMat4(o,s),o[0]/=l,o[1]/=l,o[2]/=l,o[3]/=u,o[4]/=u,o[5]/=u,o[6]/=c,o[7]/=c,o[8]/=c,f.fromMat3(e.array,o),f.normalize(e.array,e.array),e._dirty=!0,n._dirty=!0}),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var g=Object.defineProperty;if(g){var m=p.prototype;g(m,"z",{get:function(){var t=this.array;return this._axisZ.set(t[8],t[9],t[10]),this._axisZ},set:function(t){var e=this.array;t=t.array,e[8]=t[0],e[9]=t[1],e[10]=t[2],this._dirty=!0}}),g(m,"y",{get:function(){var t=this.array;return this._axisY.set(t[4],t[5],t[6]),this._axisY},set:function(t){var e=this.array;t=t.array,e[4]=t[0],e[5]=t[1],e[6]=t[2],this._dirty=!0}}),g(m,"x",{get:function(){var t=this.array;return this._axisX.set(t[0],t[1],t[2]),this._axisX},set:function(t){var e=this.array;t=t.array,e[0]=t[0],e[1]=t[1],e[2]=t[2],this._dirty=!0}})}p.adjoint=function(t,e){return c.adjoint(t.array,e.array),t._dirty=!0,t},p.copy=function(t,e){return c.copy(t.array,e.array),t._dirty=!0,t},p.determinant=function(t){return c.determinant(t.array)},p.identity=function(t){return c.identity(t.array),t._dirty=!0,t},p.ortho=function(t,e,n,i,r,a,o){return c.ortho(t.array,e,n,i,r,a,o),t._dirty=!0,t},p.perspective=function(t,e,n,i,r){return c.perspective(t.array,e,n,i,r),t._dirty=!0,t},p.lookAt=function(t,e,n,i){return c.lookAt(t.array,e.array,n.array,i.array),t._dirty=!0,t},p.invert=function(t,e){return c.invert(t.array,e.array),t._dirty=!0,t},p.multiply=p.mul=function(t,e,n){return c.mul(t.array,e.array,n.array),t._dirty=!0,t},p.fromQuat=function(t,e){return c.fromQuat(t.array,e.array),t._dirty=!0,t},p.fromRotationTranslation=function(t,e,n){return c.fromRotationTranslation(t.array,e.array,n.array),t._dirty=!0,t},p.fromMat2d=function(t,e){return t._dirty=!0,e=e.array,(t=t.array)[0]=e[0],t[4]=e[2],t[12]=e[4],t[1]=e[1],t[5]=e[3],t[13]=e[5],t},p.rotate=function(t,e,n,i){return c.rotate(t.array,e.array,n,i.array),t._dirty=!0,t},p.rotateX=function(t,e,n){return c.rotateX(t.array,e.array,n),t._dirty=!0,t},p.rotateY=function(t,e,n){return c.rotateY(t.array,e.array,n),t._dirty=!0,t},p.rotateZ=function(t,e,n){return c.rotateZ(t.array,e.array,n),t._dirty=!0,t},p.scale=function(t,e,n){return c.scale(t.array,e.array,n.array),t._dirty=!0,t},p.transpose=function(t,e){return c.transpose(t.array,e.array),t._dirty=!0,t},p.translate=function(t,e,n){return c.translate(t.array,e.array,n.array),t._dirty=!0,t},e.a=p},function(t,e,n){"use strict";var i=n(8),r=n(6),a=n(25),o=n(11),s=n(48),l="framebuffer",u="renderbuffer",c=u+"_width",h=u+"_height",d=u+"_attached",f="depthtexture_attached",p=o.a.FRAMEBUFFER,g=o.a.RENDERBUFFER,m=o.a.DEPTH_ATTACHMENT,v=o.a.COLOR_ATTACHMENT0,y=i.a.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},(function(){this._cache=new s.a,this._textures={}}),{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(t){if(t.__currentFrameBuffer){if(t.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}t.__currentFrameBuffer=this;var e=t.gl;e.bindFramebuffer(p,this._getFrameBufferGL(t)),this._boundRenderer=t;var n=this._cache;n.put("viewport",t.viewport);var i,r,a=!1;for(var o in this._textures){a=!0;var s=this._textures[o];s&&(i=s.texture.width,r=s.texture.height,this._doAttach(t,s.texture,o,s.target))}this._width=i,this._height=r,!a&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?t.setViewport(this.viewport):t.setViewport(0,0,i,r,1);var l=n.get("attached_textures");if(l)for(var o in l)if(!this._textures[o]){var v=l[o];this._doDetach(e,o,v)}if(!n.get(f)&&this.depthBuffer){n.miss(u)&&n.put(u,e.createRenderbuffer());var y=n.get(u);i===n.get(c)&&r===n.get(h)||(e.bindRenderbuffer(g,y),e.renderbufferStorage(g,e.DEPTH_COMPONENT16,i,r),n.put(c,i),n.put(h,r),e.bindRenderbuffer(g,null)),n.get(d)||(e.framebufferRenderbuffer(p,m,g,y),n.put(d,!0))}},unbind:function(t){t.__currentFrameBuffer=null,t.gl.bindFramebuffer(p,null),this._boundRenderer=null,this._cache.use(t.__uid__);var e=this._cache.get("viewport");e&&t.setViewport(e),this.updateMipmap(t)},updateMipmap:function(t){var e=t.gl;for(var n in this._textures){var i=this._textures[n];if(i){var s=i.texture;if(!s.NPOT&&s.useMipmap&&s.minFilter===r.a.LINEAR_MIPMAP_LINEAR){var l=s instanceof a.a?o.a.TEXTURE_CUBE_MAP:o.a.TEXTURE_2D;e.bindTexture(l,s.getWebGLTexture(t)),e.generateMipmap(l),e.bindTexture(l,null)}}}},checkStatus:function(t){return t.checkFramebufferStatus(p)},_getFrameBufferGL:function(t){var e=this._cache;return e.use(t.__uid__),e.miss(l)&&e.put(l,t.gl.createFramebuffer()),e.get(l)},attach:function(t,e,n){if(!t.width)throw new Error("The texture attached to color buffer is not a valid.");e=e||v,n=n||o.a.TEXTURE_2D;var i,r=this._boundRenderer;if(r&&r.gl){var a=this._cache;a.use(r.__uid__),i=a.get("attached_textures")}var s=this._textures[e];if(!s||s.target!==n||s.texture!==t||!i||null==i[e]){var l=!0;r&&(l=this._doAttach(r,t,e,n),this.viewport||r.setViewport(0,0,t.width,t.height,1)),l&&(this._textures[e]=this._textures[e]||{},this._textures[e].texture=t,this._textures[e].target=n)}},_doAttach:function(t,e,n,i){var r=t.gl,a=e.getWebGLTexture(t),s=this._cache.get("attached_textures");if(s&&s[n]){var l=s[n];if(l.texture===e&&l.target===i)return}var c=!0;if(((n=+n)===m||n===o.a.DEPTH_STENCIL_ATTACHMENT)&&(t.getGLExtension("WEBGL_depth_texture")||(console.error("Depth texture is not supported by the browser"),c=!1),e.format!==o.a.DEPTH_COMPONENT&&e.format!==o.a.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),c=!1),c)){var h=this._cache.get(u);h&&(r.framebufferRenderbuffer(p,m,g,null),r.deleteRenderbuffer(h),this._cache.put(u,!1)),this._cache.put(d,!1),this._cache.put(f,!0)}return r.framebufferTexture2D(p,n,i,a,0),s||(s={},this._cache.put("attached_textures",s)),s[n]=s[n]||{},s[n].texture=e,s[n].target=i,c},_doDetach:function(t,e,n){t.framebufferTexture2D(p,e,n,null,0);var i=this._cache.get("attached_textures");i&&i[e]&&(i[e]=null),e!==m&&e!==o.a.DEPTH_STENCIL_ATTACHMENT||this._cache.put(f,!1)},detach:function(t,e){this._textures[t]=null,this._boundRenderer&&(this._cache.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,t,e))},dispose:function(t){var e=t.gl,n=this._cache;n.use(t.__uid__);var i=n.get(u);i&&e.deleteRenderbuffer(i);var r=n.get(l);r&&e.deleteFramebuffer(r),n.deleteContext(t.__uid__),this._textures={}}});y.DEPTH_ATTACHMENT=m,y.COLOR_ATTACHMENT0=v,y.STENCIL_ATTACHMENT=o.a.STENCIL_ATTACHMENT,y.DEPTH_STENCIL_ATTACHMENT=o.a.DEPTH_STENCIL_ATTACHMENT,e.a=y},function(t,e,n){"use strict";e.a={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444}},function(t,e){var n={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},i={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},r=Object.prototype.toString,a=Array.prototype,o=a.forEach,s=a.filter,l=a.slice,u=a.map,c=a.reduce,h={};function d(t){if(null==t||"object"!=typeof t)return t;var e=t,a=r.call(t);if("[object Array]"===a){if(!T(t)){e=[];for(var o=0,s=t.length;o<s;o++)e[o]=d(t[o])}}else if(i[a]){if(!T(t)){var l=t.constructor;if(t.constructor.from)e=l.from(t);else for(e=new l(t.length),o=0,s=t.length;o<s;o++)e[o]=d(t[o])}}else if(!n[a]&&!T(t)&&!E(t))for(var u in e={},t)t.hasOwnProperty(u)&&(e[u]=d(t[u]));return e}function f(t,e,n){if(!b(e)||!b(t))return n?d(e):t;for(var i in e)if(e.hasOwnProperty(i)){var r=t[i],a=e[i];!b(a)||!b(r)||x(a)||x(r)||E(a)||E(r)||_(a)||_(r)||T(a)||T(r)?!n&&i in t||(t[i]=d(e[i])):f(r,a,n)}return t}function p(t,e,n){for(var i in e)e.hasOwnProperty(i)&&(n?null!=e[i]:null==t[i])&&(t[i]=e[i]);return t}var g,m=function(){return h.createCanvas()};function v(t,e,n){if(t&&e)if(t.forEach&&t.forEach===o)t.forEach(e,n);else if(t.length===+t.length)for(var i=0,r=t.length;i<r;i++)e.call(n,t[i],i,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(n,t[a],a,t)}function y(t,e){var n=l.call(arguments,2);return function(){return t.apply(e,n.concat(l.call(arguments)))}}function x(t){return"[object Array]"===r.call(t)}function b(t){var e=typeof t;return"function"===e||!!t&&"object"==e}function _(t){return!!n[r.call(t)]}function E(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}h.createCanvas=function(){return document.createElement("canvas")};var w="__ec_primitive__";function T(t){return t[w]}function S(t){var e=x(t);t&&v(t,(function(t,n){e?this.set(t,1):this.set(n,t)}),this)}var M="_ec_";S.prototype={constructor:S,get:function(t){return this[M+t]},set:function(t,e){return this[M+t]=e,e},each:function(t,e){for(var n in void 0!==e&&(t=y(t,e)),this)this.hasOwnProperty(n)&&t(this[n],n.slice(4))},removeKey:function(t){delete this[M+t]}},e.$override=function(t,e){h[t]=e},e.clone=d,e.merge=f,e.mergeAll=function(t,e){for(var n=t[0],i=1,r=t.length;i<r;i++)n=f(n,t[i],e);return n},e.extend=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},e.defaults=p,e.createCanvas=m,e.getContext=function(){return g||(g=m().getContext("2d")),g},e.indexOf=function(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n}return-1},e.inherits=function(t,e){var n=t.prototype;function i(){}for(var r in i.prototype=e.prototype,t.prototype=new i,n)t.prototype[r]=n[r];t.prototype.constructor=t,t.superClass=e},e.mixin=function(t,e,n){p(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,n)},e.isArrayLike=function(t){if(t)return"string"!=typeof t&&"number"==typeof t.length},e.each=v,e.map=function(t,e,n){if(t&&e){if(t.map&&t.map===u)return t.map(e,n);for(var i=[],r=0,a=t.length;r<a;r++)i.push(e.call(n,t[r],r,t));return i}},e.reduce=function(t,e,n,i){if(t&&e){if(t.reduce&&t.reduce===c)return t.reduce(e,n,i);for(var r=0,a=t.length;r<a;r++)n=e.call(i,n,t[r],r,t);return n}},e.filter=function(t,e,n){if(t&&e){if(t.filter&&t.filter===s)return t.filter(e,n);for(var i=[],r=0,a=t.length;r<a;r++)e.call(n,t[r],r,t)&&i.push(t[r]);return i}},e.find=function(t,e,n){if(t&&e)for(var i=0,r=t.length;i<r;i++)if(e.call(n,t[i],i,t))return t[i]},e.bind=y,e.curry=function(t){var e=l.call(arguments,1);return function(){return t.apply(this,e.concat(l.call(arguments)))}},e.isArray=x,e.isFunction=function(t){return"function"==typeof t},e.isString=function(t){return"[object String]"===r.call(t)},e.isObject=b,e.isBuiltInObject=_,e.isTypedArray=function(t){return!!i[r.call(t)]},e.isDom=E,e.eqNaN=function(t){return t!=t},e.retrieve=function(t){for(var e=0,n=arguments.length;e<n;e++)if(null!=arguments[e])return arguments[e]},e.retrieve2=function(t,e){return null!=t?t:e},e.retrieve3=function(t,e,n){return null!=t?t:null!=e?e:n},e.slice=function(){return Function.call.apply(l,arguments)},e.normalizeCssArray=function(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t},e.assert=function(t,e){if(!t)throw new Error(e)},e.setAsPrimitive=function(t){t[w]=!0},e.isPrimitive=T,e.createHashMap=function(t){return new S(t)},e.concatArray=function(t,e){for(var n=new t.constructor(t.length+e.length),i=0;i<t.length;i++)n[i]=t[i];var r=t.length;for(i=0;i<e.length;i++)n[i+r]=e[i];return n},e.noop=function(){}},function(t,e,n){"use strict";var i=n(8),r=n(11),a=n(48),o=n(18),s=n(1),l=n.n(s),u=n(15),c=l.a.vec3,h=l.a.mat4,d=c.create,f=c.add,p=c.set;function g(t){return{byte:o.a.Int8Array,ubyte:o.a.Uint8Array,short:o.a.Int16Array,ushort:o.a.Uint16Array}[t]||o.a.Float32Array}function m(t){return"attr_"+t}function v(t,e,n,i){switch(this.name=t,this.type=e,this.size=n,this.semantic=i||"",this.value=null,n){case 1:this.get=function(t){return this.value[t]},this.set=function(t,e){this.value[t]=e},this.copy=function(t,e){this.value[t]=this.value[t]};break;case 2:this.get=function(t,e){var n=this.value;return e[0]=n[2*t],e[1]=n[2*t+1],e},this.set=function(t,e){var n=this.value;n[2*t]=e[0],n[2*t+1]=e[1]},this.copy=function(t,e){var n=this.value;e*=2,n[t*=2]=n[e],n[t+1]=n[e+1]};break;case 3:this.get=function(t,e){var n=3*t,i=this.value;return e[0]=i[n],e[1]=i[n+1],e[2]=i[n+2],e},this.set=function(t,e){var n=3*t,i=this.value;i[n]=e[0],i[n+1]=e[1],i[n+2]=e[2]},this.copy=function(t,e){var n=this.value;e*=3,n[t*=3]=n[e],n[t+1]=n[e+1],n[t+2]=n[e+2]};break;case 4:this.get=function(t,e){var n=this.value,i=4*t;return e[0]=n[i],e[1]=n[i+1],e[2]=n[i+2],e[3]=n[i+3],e},this.set=function(t,e){var n=this.value,i=4*t;n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3]},this.copy=function(t,e){var n=this.value;e*=4,n[t*=4]=n[e],n[t+1]=n[e+1],n[t+2]=n[e+2],n[t+3]=n[e+3]}}}function y(t,e,n,i,r){this.name=t,this.type=e,this.buffer=n,this.size=i,this.semantic=r,this.symbol="",this.needsRemove=!1}function x(t){this.buffer=t,this.count=0}v.prototype.init=function(t){if(!this.value||this.value.length!=t*this.size){var e=g(this.type);this.value=new e(t*this.size)}},v.prototype.fromArray=function(t){var e,n=g(this.type);if(t[0]&&t[0].length){var i=0,r=this.size;e=new n(t.length*r);for(var a=0;a<t.length;a++)for(var o=0;o<r;o++)e[i++]=t[a][o]}else e=new n(t);this.value=e},v.prototype.clone=function(t){var e=new v(this.name,this.type,this.size,this.semantic);return t&&console.warn("todo"),e};var b=i.a.extend((function(){return{attributes:{position:new v("position","float",3,"POSITION"),texcoord0:new v("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new v("texcoord1","float",2,"TEXCOORD_1"),normal:new v("normal","float",3,"NORMAL"),tangent:new v("tangent","float",4,"TANGENT"),color:new v("color","float",4,"COLOR"),weight:new v("weight","float",3,"WEIGHT"),joint:new v("joint","float",4,"JOINT"),barycentric:new v("barycentric","float",3,null)},boundingBox:null,indices:null,dynamic:!0,_enabledAttributes:null}}),(function(){this._cache=new a.a,this._attributeList=Object.keys(this.attributes)}),{mainAttribute:"position",pick:null,pickByRay:null,updateBoundingBox:function(){var t=this.boundingBox;t||(t=this.boundingBox=new u.a);var e=this.attributes.position.value;if(e&&e.length){var n=t.min,i=t.max,r=n.array,a=i.array;c.set(r,e[0],e[1],e[2]),c.set(a,e[0],e[1],e[2]);for(var o=3;o<e.length;){var s=e[o++],l=e[o++],h=e[o++];s<r[0]&&(r[0]=s),l<r[1]&&(r[1]=l),h<r[2]&&(r[2]=h),s>a[0]&&(a[0]=s),l>a[1]&&(a[1]=l),h>a[2]&&(a[2]=h)}n._dirty=!0,i._dirty=!0}},dirty:function(){for(var t=this.getEnabledAttributes(),e=0;e<t.length;e++)this.dirtyAttribute(t[e]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(t){this._cache.dirtyAll(m(t)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(t,e){if(t<this.triangleCount&&t>=0){e||(e=d());var n=this.indices;return e[0]=n[3*t],e[1]=n[3*t+1],e[2]=n[3*t+2],e}},setTriangleIndices:function(t,e){var n=this.indices;n[3*t]=e[0],n[3*t+1]=e[1],n[3*t+2]=e[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(t){var e,n=this.vertexCount>65535?o.a.Uint32Array:o.a.Uint16Array;if(t[0]&&t[0].length){var i=0;e=new n(3*t.length);for(var r=0;r<t.length;r++)for(var a=0;a<3;a++)e[i++]=t[r][a]}else e=new n(t);this.indices=e},createAttribute:function(t,e,n,i){var r=new v(t,e,n,i);return this.attributes[t]&&this.removeAttribute(t),this.attributes[t]=r,this._attributeList.push(t),r},removeAttribute:function(t){var e=this._attributeList,n=e.indexOf(t);return n>=0&&(e.splice(n,1),delete this.attributes[t],!0)},getAttribute:function(t){return this.attributes[t]},getEnabledAttributes:function(){var t=this._enabledAttributes,e=this._attributeList;if(t)return t;for(var n=[],i=this.vertexCount,r=0;r<e.length;r++){var a=e[r],o=this.attributes[a];o.value&&o.value.length===i*o.size&&n.push(a)}return this._enabledAttributes=n,n},getBufferChunks:function(t){var e=this._cache;e.use(t.__uid__);var n=e.isDirty("attributes"),i=e.isDirty("indices");if(n||i){this._updateBuffer(t.gl,n,i);for(var r=this.getEnabledAttributes(),a=0;a<r.length;a++)e.fresh(m(r[a]));e.fresh("attributes"),e.fresh("indices")}return e.fresh("any"),e.get("chunks")},_updateBuffer:function(t,e,n){var i=this._cache,a=i.get("chunks"),o=!1;a||((a=[])[0]={attributeBuffers:[],indicesBuffer:null},i.put("chunks",a),o=!0);var s=a[0],l=s.attributeBuffers,u=s.indicesBuffer;if(e||o){var c=this.getEnabledAttributes(),h={};if(!o)for(var d=0;d<l.length;d++)h[l[d].name]=l[d];for(var f=0;f<c.length;f++){var p,g,v=c[f],b=this.attributes[v];o||(p=h[v]),g=p?p.buffer:t.createBuffer(),i.isDirty(m(v))&&(t.bindBuffer(t.ARRAY_BUFFER,g),t.bufferData(t.ARRAY_BUFFER,b.value,this.dynamic?r.a.DYNAMIC_DRAW:r.a.STATIC_DRAW)),l[f]=new y(v,b.type,g,b.size,b.semantic)}for(d=f;d<l.length;d++)t.deleteBuffer(l[d].buffer);l.length=f}this.isUseIndices()&&(n||o)&&(u||(u=new x(t.createBuffer()),s.indicesBuffer=u),u.count=this.indices.length,t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,u.buffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?r.a.DYNAMIC_DRAW:r.a.STATIC_DRAW))},generateVertexNormals:function(){if(this.vertexCount){var t=this.indices,e=this.attributes,n=e.position.value,i=e.normal.value;if(i&&i.length===n.length)for(var r=0;r<i.length;r++)i[r]=0;else i=e.normal.value=new o.a.Float32Array(n.length);for(var a,s,l,u=d(),h=d(),f=d(),g=d(),m=d(),v=d(),y=t?t.length:this.vertexCount,x=0;x<y;)for(t?(a=t[x++],s=t[x++],l=t[x++]):(a=x++,s=x++,l=x++),p(u,n[3*a],n[3*a+1],n[3*a+2]),p(h,n[3*s],n[3*s+1],n[3*s+2]),p(f,n[3*l],n[3*l+1],n[3*l+2]),c.sub(g,u,h),c.sub(m,h,f),c.cross(v,g,m),r=0;r<3;r++)i[3*a+r]=i[3*a+r]+v[r],i[3*s+r]=i[3*s+r]+v[r],i[3*l+r]=i[3*l+r]+v[r];for(r=0;r<i.length;)p(v,i[r],i[r+1],i[r+2]),c.normalize(v,v),i[r++]=v[0],i[r++]=v[1],i[r++]=v[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var t=this.indices,e=this.attributes,n=e.position.value,i=e.normal.value,r=d(),a=d(),o=d(),s=d(),l=d(),u=d();i||(i=e.normal.value=new Float32Array(n.length));for(var h,f,g,m=t?t.length:this.vertexCount,v=0;v<m;){t?(h=t[v++],f=t[v++],g=t[v++]):(h=v++,f=v++,g=v++),p(r,n[3*h],n[3*h+1],n[3*h+2]),p(a,n[3*f],n[3*f+1],n[3*f+2]),p(o,n[3*g],n[3*g+1],n[3*g+2]),c.sub(s,r,a),c.sub(l,a,o),c.cross(u,s,l),c.normalize(u,u);for(var y=0;y<3;y++)i[3*h+y]=u[y],i[3*f+y]=u[y],i[3*g+y]=u[y]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var t=this.vertexCount,e=this.attributes;e.tangent.value||(e.tangent.value=new Float32Array(4*t));var n=e.texcoord0.value,i=e.position.value,r=e.tangent.value,a=e.normal.value;if(n){for(var o=[],s=[],l=0;l<t;l++)o[l]=[0,0,0],s[l]=[0,0,0];var u,h,p,g=[0,0,0],m=[0,0,0],v=this.indices,y=v?v.length:this.vertexCount;for(l=0;l<y;){v?(u=v[l++],h=v[l++],p=v[l++]):(u=l++,h=l++,p=l++);var x=n[2*u],b=n[2*h],_=n[2*p],E=n[2*u+1],w=n[2*h+1],T=n[2*p+1],S=i[3*u],M=i[3*h],C=i[3*p],A=i[3*u+1],O=i[3*h+1],N=i[3*p+1],P=i[3*u+2],L=M-S,R=C-S,D=O-A,k=N-A,I=i[3*h+2]-P,B=i[3*p+2]-P,F=b-x,z=_-x,G=w-E,j=T-E,U=1/(F*j-G*z);g[0]=(j*L-G*R)*U,g[1]=(j*D-G*k)*U,g[2]=(j*I-G*B)*U,m[0]=(F*R-z*L)*U,m[1]=(F*k-z*D)*U,m[2]=(F*B-z*I)*U,f(o[u],o[u],g),f(o[h],o[h],g),f(o[p],o[p],g),f(s[u],s[u],m),f(s[h],s[h],m),f(s[p],s[p],m)}var H=d(),V=d(),Z=d();for(l=0;l<t;l++){Z[0]=a[3*l],Z[1]=a[3*l+1],Z[2]=a[3*l+2];var W=o[l];c.scale(H,Z,c.dot(Z,W)),c.sub(H,W,H),c.normalize(H,H),c.cross(V,Z,W),r[4*l]=H[0],r[4*l+1]=H[1],r[4*l+2]=H[2],r[4*l+3]=c.dot(V,s[l])<0?-1:1}this.dirty()}else console.warn("Geometry without texcoords can't generate tangents.")}},isUniqueVertex:function(){return!this.isUseIndices()||this.vertexCount===this.indices.length},generateUniqueVertex:function(){if(this.vertexCount&&this.indices){this.indices.length>65535&&(this.indices=new o.a.Uint32Array(this.indices));for(var t=this.attributes,e=this.indices,n=this.getEnabledAttributes(),i={},r=0;r<n.length;r++)i[u=n[r]]=t[u].value,t[u].init(this.indices.length);for(var a=0,s=0;s<e.length;s++){var l=e[s];for(r=0;r<n.length;r++)for(var u,c=t[u=n[r]].value,h=t[u].size,d=0;d<h;d++)c[a*h+d]=i[u][l*h+d];e[s]=a,a++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var t=this.attributes,e=t.barycentric.value,n=this.indices;if(!e||e.length!==3*n.length){e=t.barycentric.value=new Float32Array(3*n.length);for(var i=0;i<(n?n.length:this.vertexCount/3);)for(var r=0;r<3;r++)e[3*(n?n[i++]:3*i+r)+r]=1;this.dirty()}}},applyTransform:function(t){var e=this.attributes,n=e.position.value,i=e.normal.value,r=e.tangent.value;t=t.array;var a=h.create();h.invert(a,t),h.transpose(a,a);var o=c.transformMat4,s=c.forEach;s(n,3,0,null,o,t),i&&s(i,3,0,null,o,a),r&&s(r,4,0,null,o,a),this.boundingBox&&this.updateBoundingBox()},dispose:function(t){var e=this._cache;e.use(t.__uid__);var n=e.get("chunks");if(n)for(var i=0;i<n.length;i++){for(var r=n[i],a=0;a<r.attributeBuffers.length;a++){var o=r.attributeBuffers[a];t.gl.deleteBuffer(o.buffer)}r.indicesBuffer&&t.gl.deleteBuffer(r.indicesBuffer.buffer)}e.deleteContext(t.__uid__)}});Object.defineProperty&&(Object.defineProperty(b.prototype,"vertexCount",{enumerable:!1,get:function(){var t=this.attributes[this.mainAttribute];return t&&t.value?t.value.length/t.size:0}}),Object.defineProperty(b.prototype,"triangleCount",{enumerable:!1,get:function(){var t=this.indices;return t?t.length/3:0}})),b.STATIC_DRAW=r.a.STATIC_DRAW,b.DYNAMIC_DRAW=r.a.DYNAMIC_DRAW,b.STREAM_DRAW=r.a.STREAM_DRAW,b.AttributeBuffer=y,b.IndicesBuffer=x,b.Attribute=v,e.a=b},function(t,e,n){"use strict";var i=n(8),r=n(30),a=n(37),o=n(7),s=n(17),l=n(24),u=n(11),c=n(109);o.a.import(c.a);var h=new a.a,d=new l.a({geometry:h,frustumCulling:!1}),f=new r.a,p=i.a.extend((function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}}),(function(){var t=new o.a(o.a.source("clay.compositor.vertex"),this.fragment),e=new s.a({shader:t});e.enableTexturesAll(),this.material=e}),{setUniform:function(t,e){this.material.setUniform(t,e)},getUniform:function(t){var e=this.material.uniforms[t];if(e)return e.value},attachOutput:function(t,e){this.outputs||(this.outputs={}),e=e||u.a.COLOR_ATTACHMENT0,this.outputs[e]=t},detachOutput:function(t){for(var e in this.outputs)this.outputs[e]===t&&(this.outputs[e]=null)},bind:function(t,e){if(this.outputs)for(var n in this.outputs){var i=this.outputs[n];i&&e.attach(i,n)}e&&e.bind(t)},unbind:function(t,e){e.unbind(t)},render:function(t,e){var n=t.gl;if(e){this.bind(t,e);var i=t.getGLExtension("EXT_draw_buffers");if(i&&this.outputs){var r=[];for(var a in this.outputs)(a=+a)>=n.COLOR_ATTACHMENT0&&a<=n.COLOR_ATTACHMENT0+8&&r.push(a);i.drawBuffersEXT(r)}}this.trigger("beforerender",this,t);var o=this.clearDepth?n.DEPTH_BUFFER_BIT:0;if(n.depthMask(!0),this.clearColor){o|=n.COLOR_BUFFER_BIT,n.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&n.clearColor(s[0],s[1],s[2],s[3])}n.clear(o),this.blendWithPrevious?(n.enable(n.BLEND),this.material.transparent=!0):(n.disable(n.BLEND),this.material.transparent=!1),this.renderQuad(t),this.trigger("afterrender",this,t),e&&this.unbind(t,e)},renderQuad:function(t){d.material=this.material,t.renderPass([d],f)},dispose:function(t){}});e.a=p},function(t,e,n){"use strict";var i,r,a,o,s,l,u=n(4),c=n(1),h=n.n(c).a.vec3,d=h.copy,f=h.set,p=function(t,e){this.min=t||new u.a(1/0,1/0,1/0),this.max=e||new u.a(-1/0,-1/0,-1/0)};p.prototype={constructor:p,updateFromVertices:function(t){if(t.length>0){var e=this.min,n=this.max,i=e.array,r=n.array;d(i,t[0]),d(r,t[0]);for(var a=1;a<t.length;a++){var o=t[a];o[0]<i[0]&&(i[0]=o[0]),o[1]<i[1]&&(i[1]=o[1]),o[2]<i[2]&&(i[2]=o[2]),o[0]>r[0]&&(r[0]=o[0]),o[1]>r[1]&&(r[1]=o[1]),o[2]>r[2]&&(r[2]=o[2])}e._dirty=!0,n._dirty=!0}},union:function(t){var e=this.min,n=this.max;return h.min(e.array,e.array,t.min.array),h.max(n.array,n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},intersection:function(t){var e=this.min,n=this.max;return h.max(e.array,e.array,t.min.array),h.min(n.array,n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},intersectBoundingBox:function(t){var e=this.min.array,n=this.max.array,i=t.min.array,r=t.max.array;return!(e[0]>r[0]||e[1]>r[1]||e[2]>r[2]||n[0]<i[0]||n[1]<i[1]||n[2]<i[2])},containBoundingBox:function(t){var e=this.min.array,n=this.max.array,i=t.min.array,r=t.max.array;return e[0]<=i[0]&&e[1]<=i[1]&&e[2]<=i[2]&&n[0]>=r[0]&&n[1]>=r[1]&&n[2]>=r[2]},containPoint:function(t){var e=this.min.array,n=this.max.array,i=t.array;return e[0]<=i[0]&&e[1]<=i[1]&&e[2]<=i[2]&&n[0]>=i[0]&&n[1]>=i[1]&&n[2]>=i[2]},isFinite:function(){var t=this.min.array,e=this.max.array;return isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])},applyTransform:(i=h.create(),r=h.create(),a=h.create(),o=h.create(),s=h.create(),l=h.create(),function(t){var e=this.min.array,n=this.max.array,u=t.array;return i[0]=u[0]*e[0],i[1]=u[1]*e[0],i[2]=u[2]*e[0],r[0]=u[0]*n[0],r[1]=u[1]*n[0],r[2]=u[2]*n[0],a[0]=u[4]*e[1],a[1]=u[5]*e[1],a[2]=u[6]*e[1],o[0]=u[4]*n[1],o[1]=u[5]*n[1],o[2]=u[6]*n[1],s[0]=u[8]*e[2],s[1]=u[9]*e[2],s[2]=u[10]*e[2],l[0]=u[8]*n[2],l[1]=u[9]*n[2],l[2]=u[10]*n[2],e[0]=Math.min(i[0],r[0])+Math.min(a[0],o[0])+Math.min(s[0],l[0])+u[12],e[1]=Math.min(i[1],r[1])+Math.min(a[1],o[1])+Math.min(s[1],l[1])+u[13],e[2]=Math.min(i[2],r[2])+Math.min(a[2],o[2])+Math.min(s[2],l[2])+u[14],n[0]=Math.max(i[0],r[0])+Math.max(a[0],o[0])+Math.max(s[0],l[0])+u[12],n[1]=Math.max(i[1],r[1])+Math.max(a[1],o[1])+Math.max(s[1],l[1])+u[13],n[2]=Math.max(i[2],r[2])+Math.max(a[2],o[2])+Math.max(s[2],l[2])+u[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(t){var e=this.min.array,n=this.max.array,i=t.array,r=e[0],a=e[1],o=e[2],s=n[0],l=n[1],u=e[2],c=n[0],h=n[1],d=n[2];if(1===i[15])e[0]=i[0]*r+i[12],e[1]=i[5]*a+i[13],n[2]=i[10]*o+i[14],n[0]=i[0]*c+i[12],n[1]=i[5]*h+i[13],e[2]=i[10]*d+i[14];else{var f=-1/o;e[0]=i[0]*r*f,e[1]=i[5]*a*f,n[2]=(i[10]*o+i[14])*f,f=-1/u,n[0]=i[0]*s*f,n[1]=i[5]*l*f,f=-1/d,e[2]=(i[10]*d+i[14])*f}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){if(!(t=this.vertices)){for(var t=[],e=0;e<8;e++)t[e]=h.fromValues(0,0,0);this.vertices=t}var n=this.min.array,i=this.max.array;return f(t[0],n[0],n[1],n[2]),f(t[1],n[0],i[1],n[2]),f(t[2],i[0],n[1],n[2]),f(t[3],i[0],i[1],n[2]),f(t[4],n[0],n[1],i[2]),f(t[5],n[0],i[1],i[2]),f(t[6],i[0],n[1],i[2]),f(t[7],i[0],i[1],i[2]),this},copy:function(t){var e=this.min,n=this.max;return d(e.array,t.min.array),d(n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},clone:function(){var t=new p;return t.copy(this),t}},e.a=p},function(t,e,n){"use strict";e.a=function(t,e,n){return{seriesType:t,reset:function(t,e){var n=t.getData(),i=t.visualColorAccessPath.split(".");i[i.length-1]="opacity";var r=t.get(i);return n.setVisual("opacity",null==r?1:r),{dataEach:n.hasItemOption?function(t){var e=n.getItemModel(t).get(i);null!=e&&n.setItemVisual(t,"opacity",e)}:null}}}}},function(t,e,n){"use strict";var i=n(8),r=n(6),a=n(21),o=n(93).a.parseToFloat,s={};function l(t,e,n){var i=Object.keys(t);i.sort();for(var r=[],a=0;a<i.length;a++){var o=i[a],s=t[o];null===s?r.push(o):r.push(o+" "+s.toString())}return r.join("\n")}var u=i.a.extend((function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}}),(function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)}),{precision:"highp",bind:function(t,e,n,i){for(var a=t.gl,o=e.currentTextureSlot(),s=0;s<this._enabledUniforms.length;s++){var l=this._enabledUniforms[s];if((c=this.uniforms[l].value)instanceof r.a)c.__slot=-1;else if(Array.isArray(c))for(var u=0;u<c.length;u++)c[u]instanceof r.a&&(c[u].__slot=-1)}for(s=0;s<this._enabledUniforms.length;s++){l=this._enabledUniforms[s];var c,h=this.uniforms[l];if(null!==(c=h.value))if(c instanceof r.a)if(c.__slot<0){if(p=e.currentTextureSlot(),!e.setUniform(a,"1i",l,p))continue;e.takeCurrentTextureSlot(t,c),c.__slot=p}else e.setUniform(a,"1i",l,c.__slot);else if(Array.isArray(c)){if(0===c.length)continue;if(c[0]instanceof r.a){if(!e.hasUniform(l))continue;var d=[];for(u=0;u<c.length;u++){var f=c[u];f.__slot<0?(p=e.currentTextureSlot(),d.push(p),e.takeCurrentTextureSlot(t,f),f.__slot=p):d.push(f.__slot)}e.setUniform(a,"1iv",l,d)}else e.setUniform(a,h.type,l,c)}else e.setUniform(a,h.type,l,c);else if("t"===h.type){var p=e.currentTextureSlot();e.setUniform(a,"1i",l,p)&&e.takeCurrentTextureSlot(t,null)}}e.resetTextureSlot(o)},setUniform:function(t,e){void 0===e&&console.warn('Uniform value "'+t+'" is undefined');var n=this.uniforms[t];n&&("string"==typeof e&&(e=o(e)||e),n.value=e,this.autoUpdateTextureStatus&&"t"===n.type&&(e?this.enableTexture(t):this.disableTexture(t)))},setUniforms:function(t){for(var e in t){var n=t[e];this.setUniform(e,n)}},isUniformEnabled:function(t){return this._enabledUniforms.indexOf(t)>=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(t,e){if("object"==typeof t)for(var n in t){var i=t[n];this.setUniform(n,i)}else this.setUniform(t,e)},get:function(t){var e=this.uniforms[t];if(e)return e.value},attachShader:function(t,e){var n=this.uniforms;this.uniforms=t.createUniforms(),this.shader=t;var i=this.uniforms;this._enabledUniforms=Object.keys(i),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(t){var e=this.uniforms[t].type;return"t"===e||"tv"===e}),this);var r=this.vertexDefines,o=this.fragmentDefines;if(this.vertexDefines=a.a.clone(t.vertexDefines),this.fragmentDefines=a.a.clone(t.fragmentDefines),e){for(var s in n)i[s]&&(i[s].value=n[s].value);a.a.defaults(this.vertexDefines,r),a.a.defaults(this.fragmentDefines,o)}var l={};for(var u in t.textures)l[u]={shaderType:t.textures[u].shaderType,type:t.textures[u].type,enabled:!(!e||!this._textureStatus[u])&&this._textureStatus[u].enabled};this._textureStatus=l,this._programKey=""},clone:function(){var t=new this.constructor({name:this.name,shader:this.shader});for(var e in this.uniforms)t.uniforms[e].value=this.uniforms[e].value;return t.depthTest=this.depthTest,t.depthMask=this.depthMask,t.transparent=this.transparent,t.blend=this.blend,t.vertexDefines=a.a.clone(this.vertexDefines),t.fragmentDefines=a.a.clone(this.fragmentDefines),t.enableTexture(this.getEnabledTextures()),t.precision=this.precision,t},define:function(t,e,n){var i=this.vertexDefines,r=this.fragmentDefines;"vertex"!==t&&"fragment"!==t&&"both"!==t&&arguments.length<3&&(n=e,e=t,t="both"),n=null!=n?n:null,"vertex"!==t&&"both"!==t||i[e]!==n&&(i[e]=n,this._programKey=""),"fragment"!==t&&"both"!==t||r[e]!==n&&(r[e]=n,"both"!==t&&(this._programKey=""))},undefine:function(t,e){"vertex"!==t&&"fragment"!==t&&"both"!==t&&arguments.length<2&&(e=t,t="both"),"vertex"!==t&&"both"!==t||this.isDefined("vertex",e)&&(delete this.vertexDefines[e],this._programKey=""),"fragment"!==t&&"both"!==t||this.isDefined("fragment",e)&&(delete this.fragmentDefines[e],"both"!==t&&(this._programKey=""))},isDefined:function(t,e){switch(t){case"vertex":return void 0!==this.vertexDefines[e];case"fragment":return void 0!==this.fragmentDefines[e]}},getDefine:function(t,e){switch(t){case"vertex":return this.vertexDefines[e];case"fragment":return this.fragmentDefines[e]}},enableTexture:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this.enableTexture(t[e]);else{var n=this._textureStatus[t];n&&(n.enabled||(n.enabled=!0,this._programKey=""))}},enableTexturesAll:function(){var t=this._textureStatus;for(var e in t)t[e].enabled=!0;this._programKey=""},disableTexture:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this.disableTexture(t[e]);else{var n=this._textureStatus[t];n&&(!n.enabled||(n.enabled=!1,this._programKey=""))}},disableTexturesAll:function(){var t=this._textureStatus;for(var e in t)t[e].enabled=!1;this._programKey=""},isTextureEnabled:function(t){var e=this._textureStatus;return!!e[t]&&e[t].enabled},getEnabledTextures:function(){var t=[],e=this._textureStatus;for(var n in e)e[n].enabled&&t.push(n);return t},dirtyDefines:function(){this._programKey=""}});Object.defineProperty&&(Object.defineProperty(u.prototype,"shader",{get:function(){return this._shader||null},set:function(t){this._shader=t}}),Object.defineProperty(u.prototype,"programKey",{get:function(){return this._programKey||(this._programKey=function(t,e,n){n.sort();for(var i=[],r=0;r<n.length;r++){var o=n[r];i.push(o)}var u=l(t)+"\n"+l(e)+"\n"+i.join("\n");if(s[u])return s[u];var c=a.a.genGUID();return s[u]=c,c}(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}})),e.a=u},function(t,e,n){"use strict";var i=!0;try{var r=document.createElement("canvas");if(!r.getContext("webgl")&&!r.getContext("experimental-webgl"))throw new Error}catch(t){i=!1}var a={supportWebGL:function(){return i}};a.Int8Array="undefined"==typeof Int8Array?Array:Int8Array,a.Uint8Array="undefined"==typeof Uint8Array?Array:Uint8Array,a.Uint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,a.Uint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,a.Int16Array="undefined"==typeof Int16Array?Array:Int16Array,a.Float32Array="undefined"==typeof Float32Array?Array:Float32Array,a.Float64Array="undefined"==typeof Float64Array?Array:Float64Array,e.a=a},function(t,e,n){"use strict";var i=n(28),r=i.a.extend((function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}}),{type:"",clone:function(){var t=i.a.prototype.clone.call(this);return t.color=Array.prototype.slice.call(this.color),t.intensity=this.intensity,t.castShadow=this.castShadow,t.shadowResolution=this.shadowResolution,t}});e.a=r},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(29),o=n(152),s=n(36),l=n(30),u=n(9),c=n(4),h=n(23),d=n(47),f=n(155),p=n(182),g=n(43);function m(t){t=t||"perspective",this.layer=null,this.scene=new a.a,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(t),this._compositor=new f.a,this._temporalSS=new p.a,this._shadowMapPass=new o.a;for(var e=[],n=0,i=0;i<30;i++){for(var r=[],s=0;s<6;s++)r.push(4*Object(g.a)(n,2)-2),r.push(4*Object(g.a)(n,3)-2),n++;e.push(r)}this._pcfKernels=e,this.scene.on("beforerender",(function(t,e,n){this.needsTemporalSS()&&this._temporalSS.jitterProjection(t,n)}),this)}m.prototype.setProjection=function(t){var e=this.camera;e&&e.update(),"perspective"===t?this.camera instanceof s.a||(this.camera=new s.a,e&&this.camera.setLocalTransform(e.localTransform)):this.camera instanceof l.a||(this.camera=new l.a,e&&this.camera.setLocalTransform(e.localTransform)),this.camera.near=.1,this.camera.far=2e3},m.prototype.setViewport=function(t,e,n,i,r){this.camera instanceof s.a&&(this.camera.aspect=n/i),r=r||1,this.viewport.x=t,this.viewport.y=e,this.viewport.width=n,this.viewport.height=i,this.viewport.devicePixelRatio=r,this._compositor.resize(n*r,i*r),this._temporalSS.resize(n*r,i*r)},m.prototype.containPoint=function(t,e){var n=this.viewport;return e=this.layer.renderer.getHeight()-e,t>=n.x&&e>=n.y&&t<=n.x+n.width&&e<=n.y+n.height};var v=new h.a;m.prototype.castRay=function(t,e,n){var i=this.layer.renderer,r=i.viewport;return i.viewport=this.viewport,i.screenToNDC(t,e,v),this.camera.castRay(v,n),i.viewport=r,n},m.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this._needsSortProgressively=!1;for(var t=0;t<this.scene.transparentList.length;t++){var e=this.scene.transparentList[t].geometry;e.needsSortVerticesProgressively&&e.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),e.needsSortTrianglesProgressively&&e.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()},m.prototype.render=function(t,e){this._doRender(t,e,this._frame),this._frame++},m.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively},m.prototype.needsTemporalSS=function(){var t=this._enableTemporalSS;return"auto"==t&&(t=this._enablePostEffect),t},m.prototype.hasDOF=function(){return this._enableDOF},m.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30},m.prototype._doRender=function(t,e,n){var i,r=this.scene,a=this.camera;n=n||0,this._updateTransparent(t,r,a,n),e||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(t,r,a,!0)),this._updateShadowPCFKernel(n),t.gl.clearColor(0,0,0,0),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(t,a),this._compositor.updateNormal(t,r,a,this._temporalSS.getFrame())),this._updateSSAO(t,r,a,this._temporalSS.getFrame()),this._enablePostEffect?((i=this._compositor.getSourceFrameBuffer()).bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT),t.render(r,a,!0,!0),i.unbind(t),this.needsTemporalSS()&&e?(this._compositor.composite(t,a,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),t.setViewport(this.viewport),this._temporalSS.render(t)):(t.setViewport(this.viewport),this._compositor.composite(t,a,null,0))):this.needsTemporalSS()&&e?((i=this._temporalSS.getSourceFrameBuffer()).bind(t),t.saveClear(),t.clearBit=t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT,t.render(r,a,!0,!0),t.restoreClear(),i.unbind(t),t.setViewport(this.viewport),this._temporalSS.render(t)):(t.setViewport(this.viewport),t.render(r,a,!0,!0))},m.prototype._updateTransparent=function(t,e,n,i){for(var r=new c.a,a=new u.a,o=n.getWorldPosition(),s=0;s<e.transparentList.length;s++){var l=e.transparentList[s],h=l.geometry;u.a.invert(a,l.worldTransform),c.a.transformMat4(r,o,a),h.needsSortTriangles&&h.needsSortTriangles()&&h.doSortTriangles(r,i),h.needsSortVertices&&h.needsSortVertices()&&h.doSortVertices(r,i)}},m.prototype._updateSSAO=function(t,e,n,i){var r=this._enableSSAO&&this._enablePostEffect;r&&this._compositor.updateSSAO(t,e,n,this._temporalSS.getFrame());for(var a=0;a<e.opaqueList.length;a++){var o=e.opaqueList[a];o.renderNormal&&o.material[r?"enableTexture":"disableTexture"]("ssaoMap"),r&&o.material.set("ssaoMap",this._compositor.getSSAOTexture())}},m.prototype._updateShadowPCFKernel=function(t){for(var e=this._pcfKernels[t%this._pcfKernels.length],n=this.scene.opaqueList,i=0;i<n.length;i++)n[i].receiveShadow&&(n[i].material.set("pcfKernel",e),n[i].material.define("fragment","PCF_KERNEL_SIZE",e.length/2))},m.prototype.dispose=function(t){this._compositor.dispose(t.gl),this._temporalSS.dispose(t.gl),this._shadowMapPass.dispose(t)},m.prototype.setPostEffect=function(t,e){var n=this._compositor;this._enablePostEffect=t.get("enable");var i=t.getModel("bloom"),r=t.getModel("edge"),a=t.getModel("DOF",t.getModel("depthOfField")),o=t.getModel("SSAO",t.getModel("screenSpaceAmbientOcclusion")),s=t.getModel("SSR",t.getModel("screenSpaceReflection")),l=t.getModel("FXAA"),u=t.getModel("colorCorrection");i.get("enable")?n.enableBloom():n.disableBloom(),a.get("enable")?n.enableDOF():n.disableDOF(),s.get("enable")?n.enableSSR():n.disableSSR(),u.get("enable")?n.enableColorCorrection():n.disableColorCorrection(),r.get("enable")?n.enableEdge():n.disableEdge(),l.get("enable")?n.enableFXAA():n.disableFXAA(),this._enableDOF=a.get("enable"),this._enableSSAO=o.get("enable"),this._enableSSAO?n.enableSSAO():n.disableSSAO(),n.setBloomIntensity(i.get("intensity")),n.setEdgeColor(r.get("color")),n.setColorLookupTexture(u.get("lookupTexture"),e),n.setExposure(u.get("exposure")),["radius","quality","intensity"].forEach((function(t){n.setSSAOParameter(t,o.get(t))})),["quality","maxRoughness"].forEach((function(t){n.setSSRParameter(t,s.get(t))})),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach((function(t){n.setDOFParameter(t,a.get(t))})),["brightness","contrast","saturation"].forEach((function(t){n.setColorCorrection(t,u.get(t))}))},m.prototype.setDOFFocusOnPoint=function(t){if(this._enablePostEffect){if(t>this.camera.far||t<this.camera.near)return;return this._compositor.setDOFParameter("focalDistance",t),!0}},m.prototype.setTemporalSuperSampling=function(t){this._enableTemporalSS=t.get("enable")},m.prototype.isLinearSpace=function(){return this._enablePostEffect},m.prototype.setRootNode=function(t){if(this.rootNode!==t){for(var e=this.rootNode.children(),n=0;n<e.length;n++)t.add(e[n]);t!==this.scene&&this.scene.add(t),this.rootNode=t}},m.prototype.add=function(t){this.rootNode.add(t)},m.prototype.remove=function(t){this.rootNode.remove(t)},m.prototype.removeAll=function(t){this.rootNode.removeAll(t)},r.a.util.extend(m.prototype,d.a),e.a=m},function(t,e,n){"use strict";var i=0,r=Array.prototype.forEach,a={genGUID:function(){return++i},relative2absolute:function(t,e){if(!e||t.match(/^\//))return t;for(var n=t.split("/"),i=e.split("/"),r=n[0];"."===r||".."===r;)".."===r&&i.pop(),n.shift(),r=n[0];return i.join("/")+"/"+n.join("/")},extend:function(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},defaults:function(t,e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n]);return t},extendWithPropList:function(t,e,n){if(e)for(var i=0;i<n.length;i++){var r=n[i];t[r]=e[r]}return t},defaultsWithPropList:function(t,e,n){if(e)for(var i=0;i<n.length;i++){var r=n[i];null==t[r]&&(t[r]=e[r])}return t},each:function(t,e,n){if(t&&e)if(t.forEach&&t.forEach===r)t.forEach(e,n);else if(t.length===+t.length)for(var i=0,a=t.length;i<a;i++)e.call(n,t[i],i,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)},isObject:function(t){return t===Object(t)},isArray:function(t){return Array.isArray(t)},isArrayLike:function(t){return!!t&&t.length===+t.length},clone:function(t){if(a.isObject(t)){if(a.isArray(t))return t.slice();if(a.isArrayLike(t)){for(var e=new t.constructor(t.length),n=0;n<t.length;n++)e[n]=t[n];return e}return a.extend({},t)}return t}};e.a=a},function(t,e,n){"use strict";var i=n(13),r=n(0),a=n.n(r),o=n(33),s=n(1),l=n.n(s).a.vec3,u=[[0,0],[1,1]],c=i.a.extend((function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new i.a.Attribute("position","float",3,"POSITION"),positionPrev:new i.a.Attribute("positionPrev","float",3),positionNext:new i.a.Attribute("positionNext","float",3),prevPositionPrev:new i.a.Attribute("prevPositionPrev","float",3),prevPosition:new i.a.Attribute("prevPosition","float",3),prevPositionNext:new i.a.Attribute("prevPositionNext","float",3),offset:new i.a.Attribute("offset","float",1),color:new i.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(t){var e=this.attributes;this.vertexCount!==t&&(e.position.init(t),e.color.init(t),this.useNativeLine||(e.positionPrev.init(t),e.positionNext.init(t),e.offset.init(t)),t>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(t){this.triangleCount!==t&&(this.indices=0===t?null:this.vertexCount>65535?new Uint32Array(3*t):new Uint16Array(3*t))},_getCubicCurveApproxStep:function(t,e,n,i){return 1/(l.dist(t,e)+l.dist(n,e)+l.dist(i,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(u)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(u)},getPolylineVertexCount:function(t){var e;return e="number"==typeof t?t:"number"!=typeof t[0]?t.length:t.length/3,this.useNativeLine?2*(e-1):2*(e-1)+2},getPolylineTriangleCount:function(t){var e;return e="number"==typeof t?t:"number"!=typeof t[0]?t.length:t.length/3,this.useNativeLine?0:2*Math.max(e-1,0)},addCubicCurve:function(t,e,n,i,r,a){null==a&&(a=1);var o=t[0],s=t[1],l=t[2],u=e[0],c=e[1],h=e[2],d=n[0],f=n[1],p=n[2],g=i[0],m=i[1],v=i[2],y=this._getCubicCurveApproxStep(t,e,n,i),x=y*y,b=x*y,_=3*y,E=3*x,w=6*x,T=6*b,S=o-2*u+d,M=s-2*c+f,C=l-2*h+p,A=3*(u-d)-o+g,O=3*(c-f)-s+m,N=3*(h-p)-l+v,P=o,L=s,R=l,D=(u-o)*_+S*E+A*b,k=(c-s)*_+M*E+O*b,I=(h-l)*_+C*E+N*b,B=S*w+A*T,F=M*w+O*T,z=C*w+N*T,G=A*T,j=O*T,U=N*T,H=0,V=0,Z=Math.ceil(1/y),W=new Float32Array(3*(Z+1)),X=(W=[],0);for(V=0;V<Z+1;V++)W[X++]=P,W[X++]=L,W[X++]=R,P+=D,L+=k,R+=I,D+=B,k+=F,I+=z,B+=G,F+=j,z+=U,(H+=y)>1&&(P=D>0?Math.min(P,g):Math.max(P,g),L=k>0?Math.min(L,m):Math.max(L,m),R=I>0?Math.min(R,v):Math.max(R,v));return this.addPolyline(W,r,a)},addLine:function(t,e,n,i){return this.addPolyline([t,e],n,i)},addPolyline:function(t,e,n,i,r){if(t.length){var a="number"!=typeof t[0];if(null==r&&(r=a?t.length:t.length/3),!(r<2)){null==i&&(i=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);var o,s,l=(a="number"!=typeof t[0])?"number"!=typeof e[0]:e.length/4===r,u=this.attributes.position,c=this.attributes.positionPrev,h=this.attributes.positionNext,d=this.attributes.color,f=this.attributes.offset,p=this.indices,g=this._vertexOffset;n=Math.max(n,.01);for(var m=i;m<r;m++){if(a)o=t[m],s=l?e[m]:e;else{var v=3*m;if((o=o||[])[0]=t[v],o[1]=t[v+1],o[2]=t[v+2],l){var y=4*m;(s=s||[])[0]=e[y],s[1]=e[y+1],s[2]=e[y+2],s[3]=e[y+3]}else s=e}if(this.useNativeLine?m>1&&(u.copy(g,g-1),d.copy(g,g-1),g++):(m<r-1&&(c.set(g+2,o),c.set(g+3,o)),m>0&&(h.set(g-2,o),h.set(g-1,o)),u.set(g,o),u.set(g+1,o),d.set(g,s),d.set(g+1,s),f.set(g,n/2),f.set(g+1,-n/2),g+=2),this.useNativeLine)d.set(g,s),u.set(g,o),g++;else if(m>0){var x=3*this._triangleOffset;(p=this.indices)[x]=g-4,p[x+1]=g-3,p[x+2]=g-2,p[x+3]=g-3,p[x+4]=g-1,p[x+5]=g-2,this._triangleOffset+=2}}if(!this.useNativeLine){var b=this._vertexOffset,_=this._vertexOffset+2*r;c.copy(b,b+2),c.copy(b+1,b+3),h.copy(_-1,_-3),h.copy(_-2,_-4)}return this._vertexOffset=g,this._vertexOffset}}},setItemColor:function(t,e){for(var n=this._itemVertexOffsets[t],i=t<this._itemVertexOffsets.length-1?this._itemVertexOffsets[t+1]:this._vertexOffset,r=n;r<i;r++)this.attributes.color.set(r,e);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});a.a.util.defaults(c.prototype,o.a),e.a=c},function(t,e,n){"use strict";var i=n(1),r=n.n(i).a.vec2,a=function(t,e){t=t||0,e=e||0,this.array=r.fromValues(t,e),this._dirty=!0};if(a.prototype={constructor:a,add:function(t){return r.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e){return this.array[0]=t,this.array[1]=e,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this._dirty=!0,this},clone:function(){return new a(this.x,this.y)},copy:function(t){return r.copy(this.array,t.array),this._dirty=!0,this},cross:function(t,e){return r.cross(t.array,this.array,e.array),t._dirty=!0,this},dist:function(t){return r.dist(this.array,t.array)},distance:function(t){return r.distance(this.array,t.array)},div:function(t){return r.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return r.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return r.dot(this.array,t.array)},len:function(){return r.len(this.array)},length:function(){return r.length(this.array)},lerp:function(t,e,n){return r.lerp(this.array,t.array,e.array,n),this._dirty=!0,this},min:function(t){return r.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return r.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return r.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return r.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return r.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return r.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return r.random(this.array,t),this._dirty=!0,this},scale:function(t){return r.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return r.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return r.sqrDist(this.array,t.array)},squaredDistance:function(t){return r.squaredDistance(this.array,t.array)},sqrLen:function(){return r.sqrLen(this.array)},squaredLength:function(){return r.squaredLength(this.array)},sub:function(t){return r.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return r.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat2:function(t){return r.transformMat2(this.array,this.array,t.array),this._dirty=!0,this},transformMat2d:function(t){return r.transformMat2d(this.array,this.array,t.array),this._dirty=!0,this},transformMat3:function(t){return r.transformMat3(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return r.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},Object.defineProperty){var o=a.prototype;Object.defineProperty(o,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),Object.defineProperty(o,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}})}a.add=function(t,e,n){return r.add(t.array,e.array,n.array),t._dirty=!0,t},a.set=function(t,e,n){return r.set(t.array,e,n),t._dirty=!0,t},a.copy=function(t,e){return r.copy(t.array,e.array),t._dirty=!0,t},a.cross=function(t,e,n){return r.cross(t.array,e.array,n.array),t._dirty=!0,t},a.distance=a.dist=function(t,e){return r.distance(t.array,e.array)},a.divide=a.div=function(t,e,n){return r.divide(t.array,e.array,n.array),t._dirty=!0,t},a.dot=function(t,e){return r.dot(t.array,e.array)},a.len=function(t){return r.length(t.array)},a.lerp=function(t,e,n,i){return r.lerp(t.array,e.array,n.array,i),t._dirty=!0,t},a.min=function(t,e,n){return r.min(t.array,e.array,n.array),t._dirty=!0,t},a.max=function(t,e,n){return r.max(t.array,e.array,n.array),t._dirty=!0,t},a.multiply=a.mul=function(t,e,n){return r.multiply(t.array,e.array,n.array),t._dirty=!0,t},a.negate=function(t,e){return r.negate(t.array,e.array),t._dirty=!0,t},a.normalize=function(t,e){return r.normalize(t.array,e.array),t._dirty=!0,t},a.random=function(t,e){return r.random(t.array,e),t._dirty=!0,t},a.scale=function(t,e,n){return r.scale(t.array,e.array,n),t._dirty=!0,t},a.scaleAndAdd=function(t,e,n,i){return r.scaleAndAdd(t.array,e.array,n.array,i),t._dirty=!0,t},a.squaredDistance=a.sqrDist=function(t,e){return r.sqrDist(t.array,e.array)},a.squaredLength=a.sqrLen=function(t){return r.sqrLen(t.array)},a.subtract=a.sub=function(t,e,n){return r.subtract(t.array,e.array,n.array),t._dirty=!0,t},a.transformMat2=function(t,e,n){return r.transformMat2(t.array,e.array,n.array),t._dirty=!0,t},a.transformMat2d=function(t,e,n){return r.transformMat2d(t.array,e.array,n.array),t._dirty=!0,t},a.transformMat3=function(t,e,n){return r.transformMat3(t.array,e.array,n.array),t._dirty=!0,t},a.transformMat4=function(t,e,n){return r.transformMat4(t.array,e.array,n.array),t._dirty=!0,t},e.a=a},function(t,e,n){"use strict";var i=n(64),r=n(11),a=n(5),o=i.a.extend({skeleton:null,joints:null,useSkinMatricesTexture:!1},(function(){this.joints||(this.joints=[])}),{isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},render:function(t,e,n){var r=t.gl;if(this.skeleton){this.skeleton.update();var a=this.skeleton.getSubSkinMatrices(this.__uid__,this.joints);n.setUniformOfSemantic(r,"SKIN_MATRIX",a)}return i.a.prototype.render.call(this,t,e,n)},getSkinMatricesTexture:function(){return this._skinMatricesTexture=this._skinMatricesTexture||new a.a({type:r.a.FLOAT,minFilter:r.a.NEAREST,magFilter:r.a.NEAREST,useMipmap:!1,flipY:!1}),this._skinMatricesTexture}});o.POINTS=r.a.POINTS,o.LINES=r.a.LINES,o.LINE_LOOP=r.a.LINE_LOOP,o.LINE_STRIP=r.a.LINE_STRIP,o.TRIANGLES=r.a.TRIANGLES,o.TRIANGLE_STRIP=r.a.TRIANGLE_STRIP,o.TRIANGLE_FAN=r.a.TRIANGLE_FAN,o.BACK=r.a.BACK,o.FRONT=r.a.FRONT,o.FRONT_AND_BACK=r.a.FRONT_AND_BACK,o.CW=r.a.CW,o.CCW=r.a.CCW,e.a=o},function(t,e,n){"use strict";var i=n(6),r=n(11),a=n(21),o=n(66).a.isPowerOfTwo,s=["px","nx","py","ny","pz","nz"],l=i.a.extend((function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}}),{update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(t);var n=this.format,i=this.type;e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_S,this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_T,this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var a=t.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_CUBE_MAP,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===i&&(t.getGLExtension("OES_texture_half_float")||(i=r.a.FLOAT)),this.mipmaps.length)for(var o=this.width,s=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(e,u,l,o,s,n,i),o/=2,s/=2}else this._updateTextureData(e,this,0,this.width,this.height,n,i),!this.NPOT&&this.useMipmap&&e.generateMipmap(e.TEXTURE_CUBE_MAP);e.bindTexture(e.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(t,e,n,i,r,a,o){for(var l=0;l<6;l++){var u=s[l],c=e.image&&e.image[u];c?t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+l,n,a,a,o,c):t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+l,n,a,i,r,0,a,o,e.pixels&&e.pixels[u])}},generateMipmap:function(t){var e=t.gl;this.useMipmap&&!this.NPOT&&(e.bindTexture(e.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),e.generateMipmap(e.TEXTURE_CUBE_MAP))},bind:function(t){t.gl.bindTexture(t.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(t))},unbind:function(t){t.gl.bindTexture(t.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?o(this.image.px.width)&&o(this.image.px.height):o(this.width)&&o(this.height)},isRenderable:function(){return this.image.px?u(this.image.px)&&u(this.image.nx)&&u(this.image.py)&&u(this.image.ny)&&u(this.image.pz)&&u(this.image.nz):!(!this.width||!this.height)},load:function(t,e){var n=0,i=this;return a.a.each(t,(function(t,r){var a=new Image;e&&(a.crossOrigin=e),a.onload=function(){0==--n&&(i.dirty(),i.trigger("success",i)),a.onload=null},a.onerror=function(){n--,a.onerror=null},n++,a.src=t,i.image[r]=a})),this}});function u(t){return"CANVAS"===t.nodeName||"VIDEO"===t.nodeName||t.complete}Object.defineProperty(l.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(t){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}}),Object.defineProperty(l.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(t){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}}),e.a=l},function(t,e,n){"use strict";e.a={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}}},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a={getFormattedLabel:function(t,e,n,i,a){n=n||"normal";var o=t.getData(i).getItemModel(e),s=t.getDataParams(e,i);null!=a&&s.value instanceof Array&&(s.value=s.value[a]);var l,u=o.get("normal"===n?["label","formatter"]:["emphasis","label","formatter"]);return null==u&&(u=o.get(["label","formatter"])),"function"==typeof u?(s.status=n,l=u(s)):"string"==typeof u&&(l=r.a.format.formatTpl(u,s)),l},normalizeToArray:function(t){return t instanceof Array?t:null==t?[]:[t]}};e.a=a},function(t,e,n){"use strict";var i,r,a,o,s=n(8),l=n(4),u=n(50),c=n(9),h=n(1),d=n.n(h),f=n(15),p=d.a.mat4,g=0,m=s.a.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},(function(){this.name||(this.name=(this.type||"NODE")+"_"+g++),this.position||(this.position=new l.a),this.rotation||(this.rotation=new u.a),this.scale||(this.scale=new l.a(1,1,1)),this.worldTransform=new c.a,this.localTransform=new c.a,this._children=[]}),{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(t){var e=this._scene;if(e){var n=e._nodeRepository;delete n[this.name],n[t]=this}this.name=t},add:function(t){this._inIterating&&console.warn("Add operation can cause unpredictable error when in iterating");var e=t._parent;if(e!==this){e&&e.remove(t),t._parent=this,this._children.push(t);var n=this._scene;n&&n!==t.scene&&t.traverse(this._addSelfToScene,this),t._needsUpdateWorldTransform=!0}},remove:function(t){this._inIterating&&console.warn("Remove operation can cause unpredictable error when in iterating");var e=this._children,n=e.indexOf(t);n<0||(e.splice(n,1),t._parent=null,this._scene&&t.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var t=this._children,e=0;e<t.length;e++)t[e]._parent=null,this._scene&&t[e].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(t){t._scene.removeFromScene(t),t._scene=null},_addSelfToScene:function(t){this._scene.addToScene(t),t._scene=this._scene},isAncestor:function(t){for(var e=t._parent;e;){if(e===this)return!0;e=e._parent}return!1},children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},getChildByName:function(t){for(var e=this._children,n=0;n<e.length;n++)if(e[n].name===t)return e[n]},getDescendantByName:function(t){for(var e=this._children,n=0;n<e.length;n++){var i=e[n];if(i.name===t)return i;var r=i.getDescendantByName(t);if(r)return r}},queryNode:function(t){if(t){for(var e=t.split("/"),n=this,i=0;i<e.length;i++){var r=e[i];if(r){for(var a=!1,o=n._children,s=0;s<o.length;s++){var l=o[s];if(l.name===r){n=l,a=!0;break}}if(!a)return}}return n}},getPath:function(t){if(!this._parent)return"/";for(var e=this._parent,n=this.name;e._parent&&(n=e.name+"/"+n,e._parent!=t);)e=e._parent;return!e._parent&&t?null:n},traverse:function(t,e,n){this._inIterating=!0,n&&!n.call(e,this)||t.call(e,this);for(var i=this._children,r=0,a=i.length;r<a;r++)i[r].traverse(t,e,n);this._inIterating=!1},eachChild:function(t,e,n){this._inIterating=!0;for(var i=this._children,r=null==n,a=0,o=i.length;a<o;a++){var s=i[a];(r||s.constructor===n)&&t.call(e,s,a)}this._inIterating=!1},setLocalTransform:function(t){p.copy(this.localTransform.array,t.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(t){var e=t?null:this.scale;this.localTransform.decomposeMatrix(e,this.rotation,this.position)},setWorldTransform:function(t){p.copy(this.worldTransform.array,t.array),this.decomposeWorldTransform()},decomposeWorldTransform:(o=p.create(),function(t){var e=this.localTransform,n=this.worldTransform;this._parent?(p.invert(o,this._parent.worldTransform.array),p.multiply(e.array,o,n.array)):p.copy(e.array,n.array);var i=t?null:this.scale;e.decomposeMatrix(i,this.rotation,this.position)}),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var t=this.position,e=this.rotation,n=this.scale;if(this.transformNeedsUpdate()){var i=this.localTransform.array;p.fromRotationTranslation(i,e.array,t.array),p.scale(i,i,n.array),e._dirty=!1,n._dirty=!1,t._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var t=this.localTransform.array,e=this.worldTransform.array;this._parent?p.multiplyAffine(e,this._parent.worldTransform.array,t):p.copy(e,t)},updateWorldTransform:function(){for(var t=this;t&&t.getParent()&&t.getParent().transformNeedsUpdate();)t=t.getParent();t.update()},update:function(t){this.autoUpdateLocalTransform?this.updateLocalTransform():t=!0,(t||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),t=!0,this._needsUpdateWorldTransform=!1);for(var e=this._children,n=0,i=e.length;n<i;n++)e[n].update(t)},getBoundingBox:function(){function t(t){return!t.invisible&&t.geometry}var e=new f.a,n=new c.a,i=new c.a;return function(r,a){return a=a||new f.a,r=r||t,this._parent?c.a.invert(i,this._parent.worldTransform):c.a.identity(i),this.traverse((function(t){t.geometry&&t.geometry.boundingBox&&(e.copy(t.geometry.boundingBox),c.a.multiply(n,i,t.worldTransform),e.applyTransform(n),a.union(e))}),this,t),a}}(),getWorldPosition:function(t){this.transformNeedsUpdate()&&this.updateWorldTransform();var e=this.worldTransform.array;if(t){var n=t.array;return n[0]=e[12],n[1]=e[13],n[2]=e[14],t}return new l.a(e[12],e[13],e[14])},clone:function(){var t=new this.constructor,e=this._children;t.setName(this.name),t.position.copy(this.position),t.rotation.copy(this.rotation),t.scale.copy(this.scale);for(var n=0;n<e.length;n++)t.add(e[n].clone());return t},rotateAround:(r=new l.a,a=new c.a,function(t,e,n){r.copy(this.position).subtract(t);var i=this.localTransform;i.identity(),i.translate(t),i.rotate(n,e),a.fromRotationTranslation(this.rotation,r),i.multiply(a),i.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}),lookAt:(i=new c.a,function(t,e){i.lookAt(this.position,t,e||this.localTransform.y).invert(),this.setLocalTransform(i),this.target=t})});e.a=m},function(t,e,n){"use strict";var i=n(28),r=n(19),a=n(51),o=n(15),s=n(21),l={};function u(t){var e=[],n=Object.keys(t);n.sort();for(var i=0;i<n.length;i++){var r=t[i];e.push(r+" "+t[r])}var a=e.join("\n");if(l[a])return l[a];var o=s.a.genGUID();return l[a]=o,o}var c=i.a.extend((function(){return{material:null,autoUpdate:!0,opaqueList:[],transparentList:[],lights:[],viewBoundingBoxLastFrame:new o.a,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_opaqueObjectCount:0,_transparentObjectCount:0,_nodeRepository:{}}}),(function(){this._scene=this}),{addToScene:function(t){t instanceof a.a&&(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(t)),t.name&&(this._nodeRepository[t.name]=t)},removeFromScene:function(t){if(t instanceof a.a){var e=this._cameraList.indexOf(t);e>=0&&this._cameraList.splice(e,1)}t.name&&delete this._nodeRepository[t.name]},getNode:function(t){return this._nodeRepository[t]},cloneNode:function(t){var e=t.clone(),n={},i=function(r,a){r.skeleton&&(a.skeleton=r.skeleton.clone(t,e),a.joints=r.joints.slice()),r.material&&(n[r.material.__uid__]={oldMat:r.material});for(var o=0;o<r._children.length;o++)i(r._children[o],a._children[o])};for(var r in i(t,e),n)n[r].newMat=n[r].oldMat.clone();return e.traverse((function(t){t.material&&(t.material=n[t.material.__uid__].newMat)})),e},update:function(t,e){if(this.autoUpdate||t){i.a.prototype.update.call(this,t);var n=this.lights,r=this.material&&this.material.transparent;if(this._opaqueObjectCount=0,this._transparentObjectCount=0,n.length=0,this._updateRenderList(this,r),this.opaqueList.length=this._opaqueObjectCount,this.transparentList.length=this._transparentObjectCount,!e){this._previousLightNumber=this._lightNumber;for(var a={},o=0;o<n.length;o++){var s=n[o],l=s.group;a[l]||(a[l]={}),a[l][s.type]=a[l][s.type]||0,a[l][s.type]++}for(var c in this._lightNumber=a,a)this._lightProgramKeys[c]=u(a[c]);this._updateLightUniforms()}}},getMainCamera:function(){return this._cameraList[0]},_updateRenderList:function(t,e){if(!t.invisible)for(var n=0;n<t._children.length;n++){var i=t._children[n];i instanceof r.a?this.lights.push(i):i.isRenderable()&&(i.material.transparent||e?this.transparentList[this._transparentObjectCount++]=i:this.opaqueList[this._opaqueObjectCount++]=i),i._children.length>0&&this._updateRenderList(i)}},_updateLightUniforms:function(){var t=this.lights;t.sort(h);var e=this._lightUniforms;for(var n in e)for(var i in e[n])e[n][i].value.length=0;for(var r=0;r<t.length;r++){var a=t[r];for(var i in n=a.group,a.uniformTemplates){var o=a.uniformTemplates[i],s=o.value(a);if(null!=s){e[n]||(e[n]={}),e[n][i]||(e[n][i]={type:"",value:[]});var l=e[n][i];switch(l.type=o.type+"v",o.type){case"1i":case"1f":case"t":l.value.push(s);break;case"2f":case"3f":case"4f":for(var u=0;u<s.length;u++)l.value.push(s[u]);break;default:console.error("Unkown light uniform type "+o.type)}}}}},getLightGroups:function(){var t=[];for(var e in this._lightNumber)t.push(e);return t},getNumberChangedLightGroups:function(){var t=[];for(var e in this._lightNumber)this.isLightNumberChanged(e)&&t.push(e);return t},isLightNumberChanged:function(t){var e=this._previousLightNumber,n=this._lightNumber;for(var i in n[t]){if(!e[t])return!0;if(n[t][i]!==e[t][i])return!0}for(var i in e[t]){if(!n[t])return!0;if(n[t][i]!==e[t][i])return!0}return!1},getLightsNumbers:function(t){return this._lightNumber[t]},getProgramKey:function(t){return this._lightProgramKeys[t]},setLightUniforms:function(){function t(t,e,n){for(var i in t){var r=t[i];if("tv"===r.type){if(!e.hasUniform(i))continue;for(var a=[],o=0;o<r.value.length;o++){var s=r.value[o],l=e.takeCurrentTextureSlot(n,s);a.push(l)}e.setUniform(n.gl,"1iv",i,a)}else e.setUniform(n.gl,r.type,i,r.value)}}return function(e,n,i){t(this._lightUniforms[n],e,i),t(this.shadowUniforms,e,i)}}(),dispose:function(){this.material=null,this.opaqueList=[],this.transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function h(t,e){if(e.castShadow&&!t.castShadow)return!0}e.a=c},function(t,e,n){"use strict";var i=n(51),r=i.a.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array;this.left=(-1-t[12])/t[0],this.right=(1-t[12])/t[0],this.top=(1-t[13])/t[5],this.bottom=(-1-t[13])/t[5],this.near=-(-1-t[14])/t[10],this.far=-(1-t[14])/t[10]},clone:function(){var t=i.a.prototype.clone.call(this);return t.left=this.left,t.right=this.right,t.near=this.near,t.far=this.far,t.top=this.top,t.bottom=this.bottom,t}});e.a=r},function(t,e,n){"use strict";e.a={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}}},function(t,e,n){"use strict";e.a={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}}},function(t,e,n){"use strict";e.a={convertToDynamicArray:function(t){t&&this.resetOffset();var e=this.attributes;for(var n in e)t||!e[n].value?e[n].value=[]:e[n].value=Array.prototype.slice.call(e[n].value);t||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var t=this.attributes;for(var e in t)t[e].value&&t[e].value.length>0?t[e].value=new Float32Array(t[e].value):t[e].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}}},function(t,e,n){"use strict";var i=n(2),r=n(57),a=n(56),o=n(0),s=n.n(o);function l(){}l.prototype={constructor:l,setScene:function(t){this._scene=t,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(t){this._lightRoot=t,this.mainLight=new i.a.DirectionalLight({shadowBias:.005}),this.ambientLight=new i.a.AmbientLight,t.add(this.mainLight),t.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(t){var e=this.mainLight,n=this.ambientLight,r=t.getModel("light"),a=r.getModel("main"),o=r.getModel("ambient");e.intensity=a.get("intensity"),n.intensity=o.get("intensity"),e.color=i.a.parseColor(a.get("color")).slice(0,3),n.color=i.a.parseColor(o.get("color")).slice(0,3);var s=a.get("alpha")||0,l=a.get("beta")||0;e.position.setArray(i.a.directionFromAlphaBeta(s,l)),e.lookAt(i.a.Vector3.ZERO),e.castShadow=a.get("shadow"),e.shadowResolution=i.a.getShadowResolution(a.get("shadowQuality"))},updateAmbientCubemap:function(t,e,n){var a=e.getModel("light.ambientCubemap"),o=a.get("texture");if(o){this._cubemapLightsCache=this._cubemapLightsCache||{};var s=this._cubemapLightsCache[o];if(!s){var l=this;s=this._cubemapLightsCache[o]=i.a.createAmbientCubemap(a.option,t,n,(function(){l._skybox instanceof r.a&&l._skybox.setEnvironmentMap(s.specular.cubemap),n.getZr().refresh()}))}this._lightRoot.add(s.diffuse),this._lightRoot.add(s.specular),this._currentCubemapLights=s}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(t,e,n){var o=e.get("environment"),l=this;function u(){return l._skybox instanceof a.a||(l._skybox&&l._skybox.dispose(t),l._skybox=new a.a),l._skybox}if(o&&"none"!==o)if("auto"===o)if(this._currentCubemapLights){var c=(l._skybox instanceof r.a||(l._skybox&&l._skybox.dispose(t),l._skybox=new r.a),l._skybox),h=this._currentCubemapLights.specular.cubemap;c.setEnvironmentMap(h),this._scene&&c.attachScene(this._scene),c.material.set("lod",2)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof o&&o.colorStops||"string"==typeof o&&s.a.color.parse(o)){var d=u(),f=new i.a.Texture2D({anisotropic:8,flipY:!1});d.setEnvironmentMap(f);var p=f.image=document.createElement("canvas");p.width=p.height=16;var g=p.getContext("2d");new s.a.graphic.Rect({shape:{x:0,y:0,width:16,height:16},style:{fill:o}}).brush(g),d.attachScene(this._scene)}else d=u(),f=i.a.loadTexture(o,n,{anisotropic:8,flipY:!1}),d.setEnvironmentMap(f),d.attachScene(this._scene);else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var m=e.coordinateSystem;if(this._skybox)if(!m||!m.viewGL||"auto"===o||o.match&&o.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var v=m.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[v]("fragment","SRGB_DECODE")}}},e.a=l},function(t,e,n){"use strict";var i=n(0),r=n.n(i);e.a=function(t,e,n){var i=t.getData(),a=t.getRawValue(e),o=r.a.util.isArray(a)?function(t){var a=[],o=function(t,e){var n=[];return r.a.util.each(t.dimensions,(function(i){var r=t.getDimensionInfo(i),a=r.otherDims[e];null!=a&&!1!==a&&(n[a]=r.name)})),n}(i,"tooltip");function s(t,e){var o=i.getDimensionInfo(e);if(o&&!1!==o.otherDims.tooltip){var s=o.type,l="- "+(o.tooltipName||o.name)+": "+("ordinal"===s?t+"":"time"===s?n?"":r.a.format.formatTime("yyyy/MM/dd hh:mm:ss",t):r.a.format.addCommas(t));l&&a.push(r.a.format.encodeHTML(l))}}return o.length?r.a.util.each(o,(function(t){s(i.get(t,e),t)})):r.a.util.each(t,s),"<br/>"+a.join("<br/>")}(a):r.a.format.encodeHTML(r.a.format.addCommas(a)),s=i.getName(e),l=i.getItemVisual(e,"color");r.a.util.isObject(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var u=r.a.format.getTooltipMarker(l),c=t.name;return"\0-"===c&&(c=""),c=c?r.a.format.encodeHTML(c)+(n?": ":"<br/>"):"",n?u+c+o:c+u+(s?r.a.format.encodeHTML(s)+": "+o:o)}},function(t,e,n){"use strict";var i=n(51),r=i.a.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var t=this.fov/180*Math.PI;this.projectionMatrix.perspective(t,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array,e=2*Math.atan(1/t[5]);this.fov=e/Math.PI*180,this.aspect=t[5]/t[0],this.near=t[14]/(t[10]-1),this.far=t[14]/(t[10]+1)},clone:function(){var t=i.a.prototype.clone.call(this);return t.fov=this.fov,t.aspect=this.aspect,t.near=this.near,t.far=this.far,t}});e.a=r},function(t,e,n){"use strict";var i=n(13),r=n(15),a=i.a.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var t=this.heightSegments,e=this.widthSegments,n=this.attributes,i=[],a=[],o=[],s=[],l=0;l<=t;l++)for(var u=l/t,c=0;c<=e;c++){var h=c/e;if(i.push([2*h-1,2*u-1,0]),a&&a.push([h,u]),o&&o.push([0,0,1]),c<e&&l<t){var d=c+l*(e+1);s.push([d,d+1,d+e+1]),s.push([d+e+1,d+1,d+e+2])}}n.position.fromArray(i),n.texcoord0.fromArray(a),n.normal.fromArray(o),this.initIndicesFromArray(s),this.boundingBox=new r.a,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}});e.a=a},function(t,e,n){"use strict";e.a={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(t){t=t||{},this.option.viewControl=this.option.viewControl||{},null!=t.alpha&&(this.option.viewControl.alpha=t.alpha),null!=t.beta&&(this.option.viewControl.beta=t.beta),null!=t.distance&&(this.option.viewControl.distance=t.distance),null!=t.center&&(this.option.viewControl.center=t.center)}}},function(t,e,n){"use strict";var i=n(8),r=n(23),a=n(4),o=(n(50),n(3).a.firstNotNull),s={left:0,middle:1,right:2};function l(t){return t instanceof Array||(t=[t,t]),t}var u=i.a.extend((function(){return{zr:null,viewGL:null,_center:new a.a,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new r.a,_panVelocity:new r.a,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}}),(function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach((function(t){this[t]=this[t].bind(this)}),this)}),{init:function(){var t=this.zr;t&&(t.on("mousedown",this._mouseDownHandler),t.on("globalout",this._mouseUpHandler),t.on("mousewheel",this._mouseWheelHandler),t.on("pinch",this._pinchHandler),t.animation.on("frame",this._update),t.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var t=this.zr;t&&(t.off("mousedown",this._mouseDownHandler),t.off("mousemove",this._mouseMoveHandler),t.off("mouseup",this._mouseUpHandler),t.off("mousewheel",this._mouseWheelHandler),t.off("pinch",this._pinchHandler),t.off("globalout",this._mouseUpHandler),t.dom.removeEventListener("contextmenu",this._contextMenuHandler),t.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(t){this._distance=t,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(t){this._orthoSize=t,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(t){t=Math.max(Math.min(this.maxAlpha,t),this.minAlpha),this._theta=t/180*Math.PI,this._needsUpdate=!0},setBeta:function(t){t=Math.max(Math.min(this.maxBeta,t),this.minBeta),this._phi=-t/180*Math.PI,this._needsUpdate=!0},setCenter:function(t){this._center.setArray(t)},setViewGL:function(t){this.viewGL=t},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(t,e){var n=(e=e||{}).baseDistance||0,i=e.baseOrthoSize||1,r=t.get("projection");"perspective"!==r&&"orthographic"!==r&&"isometric"!==r&&(console.error("Unkown projection type %s, use perspective projection instead.",r),r="perspective"),this._projection=r,this.viewGL.setProjection(r);var a=t.get("distance")+n,s=t.get("orthographicSize")+i;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach((function(e){this[e[0]]=o(t.get(e[0]),e[1])}),this),this.minDistance+=n,this.maxDistance+=n,this.minOrthographicSize+=i,this.maxOrthographicSize+=i;var l=t.ecModel,u={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach((function(e){u[e]=o(t.get(e),l&&l.get(e))}));var c=o(e.alpha,t.get("alpha"))||0,h=o(e.beta,t.get("beta"))||0,d=o(e.center,t.get("center"))||[0,0,0];u.animation&&u.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:c,beta:h,center:d,distance:a,targetOrthographicSize:s,easing:u.animationEasingUpdate,duration:u.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(c),this.setBeta(h),this.setCenter(d),this.setOrthographicSize(s)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){null==s[this.panMouseButton]&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),null==s[this.rotateMouseButton]&&console.error("Unkown rotateMouseButton %s. It should be left|middle|right",this.rotateMouseButton),"cw"!==this.autoRotateDirection&&"ccw"!==this.autoRotateDirection&&console.error("Unkown autoRotateDirection %s. It should be cw|ccw",this.autoRotateDirection)},animateTo:function(t){var e=this.zr,n=this,i={},r={};return null!=t.distance&&(i.distance=this.getDistance(),r.distance=t.distance),null!=t.orthographicSize&&(i.orthographicSize=this.getOrthographicSize(),r.orthographicSize=t.orthographicSize),null!=t.alpha&&(i.alpha=this.getAlpha(),r.alpha=t.alpha),null!=t.beta&&(i.beta=this.getBeta(),r.beta=t.beta),null!=t.center&&(i.center=this.getCenter(),r.center=t.center),this._addAnimator(e.animation.animate(i).when(t.duration||1e3,r).during((function(){null!=i.alpha&&n.setAlpha(i.alpha),null!=i.beta&&n.setBeta(i.beta),null!=i.distance&&n.setDistance(i.distance),null!=i.center&&n.setCenter(i.center),null!=i.orthographicSize&&n.setOrthographicSize(i.orthographicSize),n._needsUpdate=!0}))).start(t.easing||"linear")},stopAllAnimation:function(){for(var t=0;t<this._animators.length;t++)this._animators[t].stop();this._animators.length=0},_isAnimating:function(){return this._animators.length>0},_update:function(t){if(this._rotating){var e=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=e*t/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(t=Math.min(t,50),this._updateDistanceOrSize(t),this._updatePan(t),this._updateRotate(t),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(t){var e=this._rotateVelocity;this._phi=e.y*t/20+this._phi,this._theta=e.x*t/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(e,Math.pow(this.damping,t/16))},_updateDistanceOrSize:function(t){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*t/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*t/20),this._zoomSpeed*=Math.pow(this.damping,t/16)},_setDistance:function(t){this._distance=Math.max(Math.min(t,this.maxDistance),this.minDistance)},_setOrthoSize:function(t){this._orthoSize=Math.max(Math.min(t,this.maxOrthographicSize),this.minOrthographicSize);var e=this.getCamera(),n=this._orthoSize,i=n/this.viewGL.viewport.height*this.viewGL.viewport.width;e.left=-i/2,e.right=i/2,e.top=n/2,e.bottom=-n/2},_updatePan:function(t){var e=this._panVelocity,n=this._distance,i=this.getCamera(),r=i.worldTransform.y,a=i.worldTransform.x;this._center.scaleAndAdd(a,-e.x*n/200).scaleAndAdd(r,-e.y*n/200),this._vectorDamping(e,0)},_updateTransform:function(){var t=this.getCamera(),e=new a.a,n=this._theta+Math.PI/2,i=this._phi+Math.PI/2,r=Math.sin(n);e.x=r*Math.cos(i),e.y=-Math.cos(n),e.z=r*Math.sin(i),t.position.copy(this._center).scaleAndAdd(e,this._distance),t.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var t=this.autoRotateAfterStill,e=this;!isNaN(t)&&t>0&&(this._stillTimeout=setTimeout((function(){e._rotating=!0}),1e3*t))},_vectorDamping:function(t,e){var n=t.len();(n*=e)<1e-4&&(n=0),t.normalize().scale(n)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var t=this.getCamera().worldTransform.z,e=Math.asin(t.y),n=Math.atan2(t.x,t.z);this._theta=e,this._phi=-n,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(t){if(!t.target&&!this._isAnimating()){var e=t.offsetX,n=t.offsetY;this.viewGL&&!this.viewGL.containPoint(e,n)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),t.event.targetTouches?1===t.event.targetTouches.length&&(this._mode="rotate"):t.event.button===s[this.rotateMouseButton]?this._mode="rotate":t.event.button===s[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=t.offsetX,this._mouseY=t.offsetY)}},_mouseMoveHandler:function(t){if(!(t.target&&t.target.__isGLToZRProxy||this._isAnimating())){var e=l(this.panSensitivity),n=l(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(t.offsetX-this._mouseX)/this.zr.getHeight()*2*n[0],this._rotateVelocity.x=(t.offsetY-this._mouseY)/this.zr.getWidth()*2*n[1]):"pan"===this._mode&&(this._panVelocity.x=(t.offsetX-this._mouseX)/this.zr.getWidth()*e[0]*400,this._panVelocity.y=(-t.offsetY+this._mouseY)/this.zr.getHeight()*e[1]*400),this._mouseX=t.offsetX,this._mouseY=t.offsetY,t.event.preventDefault()}},_mouseWheelHandler:function(t){if(!this._isAnimating()){var e=t.event.wheelDelta||-t.event.detail;this._zoomHandler(t,e)}},_pinchHandler:function(t){this._isAnimating()||(this._zoomHandler(t,t.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(t,e){if(0!==e){var n,i=t.offsetX,r=t.offsetY;this.viewGL&&!this.viewGL.containPoint(i,r)||(n="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(e>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),t.event.preventDefault())}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(t){this._isRightMouseButtonUsed()&&t.preventDefault()},_addAnimator:function(t){var e=this._animators;return e.push(t),t.done((function(){var n=e.indexOf(t);n>=0&&e.splice(n,1)})),t}});Object.defineProperty(u.prototype,"autoRotate",{get:function(t){return this._autoRotate},set:function(t){this._autoRotate=t,this._rotating=t}}),e.a=u},function(t,e,n){"use strict";e.a="@export ecgl.lines3D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, 1.0);\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n}\n@end\n\n\n\n@export ecgl.lines3D.clipNear\n\nvec4 clipNear(vec4 p1, vec4 p2) {\n float n = (p1.w - near) / (p1.w - p2.w);\n return vec4(mix(p1.xy, p2.xy, n), -near, near);\n}\n\n@end\n\n@export ecgl.lines3D.expandLine\n#ifdef VERTEX_ANIMATION\n vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);\n vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);\n vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);\n#else\n vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);\n vec4 currProj = worldViewProjection * vec4(position, 1.0);\n vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);\n#endif\n\n if (currProj.w < 0.0) {\n if (nextProj.w > 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(t,e,n){var i=n(12),r=n(75),a=n(78).parsePercent,o=n(149),s=i.each,l=["left","right","top","bottom","width","height"],u=[["width","left","right"],["height","top","bottom"]];function c(t,e,n,i,r){var a=0,o=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;e.eachChild((function(l,u){var c,h,d=l.position,f=l.getBoundingRect(),p=e.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===t){var m=f.width+(g?-g.x+f.x:0);(c=a+m)>i||l.newline?(a=0,c=m,o+=s+n,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(h=o+v)>r||l.newline?(a+=s+n,o=0,h=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=o,"horizontal"===t?a=c+n:o=h+n)}))}var h=c,d=i.curry(c,"vertical"),f=i.curry(c,"horizontal");function p(t,e,n){n=o.normalizeCssArray(n||0);var i=e.width,s=e.height,l=a(t.left,i),u=a(t.top,s),c=a(t.right,i),h=a(t.bottom,s),d=a(t.width,i),f=a(t.height,s),p=n[2]+n[0],g=n[1]+n[3],m=t.aspect;switch(isNaN(d)&&(d=i-c-g-l),isNaN(f)&&(f=s-h-p-u),null!=m&&(isNaN(d)&&isNaN(f)&&(m>i/s?d=.8*i:f=.8*s),isNaN(d)&&(d=m*f),isNaN(f)&&(f=d/m)),isNaN(l)&&(l=i-c-d-g),isNaN(u)&&(u=s-h-f-p),t.left||t.right){case"center":l=i/2-d/2-n[3];break;case"right":l=i-d-g}switch(t.top||t.bottom){case"middle":case"center":u=s/2-f/2-n[0];break;case"bottom":u=s-f-p}l=l||0,u=u||0,isNaN(d)&&(d=i-g-l-(c||0)),isNaN(f)&&(f=s-p-u-(h||0));var v=new r(l+n[3],u+n[0],d,f);return v.margin=n,v}function g(t,e){return e&&t&&s(l,(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}e.LOCATION_PARAMS=l,e.HV_NAMES=u,e.box=h,e.vbox=d,e.hbox=f,e.getAvailableSize=function(t,e,n){var i=e.width,r=e.height,s=a(t.x,i),l=a(t.y,r),u=a(t.x2,i),c=a(t.y2,r);return(isNaN(s)||isNaN(parseFloat(t.x)))&&(s=0),(isNaN(u)||isNaN(parseFloat(t.x2)))&&(u=i),(isNaN(l)||isNaN(parseFloat(t.y)))&&(l=0),(isNaN(c)||isNaN(parseFloat(t.y2)))&&(c=r),n=o.normalizeCssArray(n||0),{width:Math.max(u-s-n[1]-n[3],0),height:Math.max(c-l-n[0]-n[2],0)}},e.getLayoutRect=p,e.positionElement=function(t,e,n,a,o){var s=!o||!o.hv||o.hv[0],l=!o||!o.hv||o.hv[1],u=o&&o.boundingMode||"all";if(s||l){var c;if("raw"===u)c="group"===t.type?new r(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(c=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();(c=c.clone()).applyTransform(h)}e=p(i.defaults({width:c.width,height:c.height},e),n,a);var d=t.position,f=s?e.x-c.x:0,g=l?e.y-c.y:0;t.attr("position","raw"===u?[f,g]:[d[0]+f,d[1]+g])}},e.sizeCalculable=function(t,e){return null!=t[u[e][0]]||null!=t[u[e][1]]&&null!=t[u[e][2]]},e.mergeLayoutParam=function(t,e,n){!i.isObject(n)&&(n={});var r=n.ignoreSize;!i.isArray(r)&&(r=[r,r]);var a=l(u[0],0),o=l(u[1],1);function l(n,i){var a={},o=0,l={},u=0;if(s(n,(function(e){l[e]=t[e]})),s(n,(function(t){c(e,t)&&(a[t]=l[t]=e[t]),h(a,t)&&o++,h(l,t)&&u++})),r[i])return h(e,n[1])?l[n[2]]=null:h(e,n[2])&&(l[n[1]]=null),l;if(2!==u&&o){if(o>=2)return a;for(var d=0;d<n.length;d++){var f=n[d];if(!c(a,f)&&c(t,f)){a[f]=t[f];break}}return a}return l}function c(t,e){return t.hasOwnProperty(e)}function h(t,e){return null!=t[e]&&"auto"!==t[e]}function d(t,e,n){s(t,(function(t){e[t]=n[t]}))}d(u[0],t,a),d(u[1],t,o)},e.getLayoutParams=function(t){return g({},t)},e.copyLayoutParams=g},function(t,e,n){"use strict";var i=n(8).a.extend((function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),{updateParameter:function(t,e){var n,i,r=this.outputs[t],a=r.parameters,o=r._parametersCopy;if(o||(o=r._parametersCopy={}),a)for(var s in a)"width"!==s&&"height"!==s&&(o[s]=a[s]);return n=a.width instanceof Function?a.width.call(this,e):a.width,i=a.height instanceof Function?a.height.call(this,e):a.height,o.width===n&&o.height===i||this._outputTextures[t]&&this._outputTextures[t].dispose(e.gl),o.width=n,o.height=i,o},setParameter:function(t,e){},getParameter:function(t){},setParameters:function(t){for(var e in t)this.setParameter(e,t[e])},render:function(){},getOutput:function(t,e){if(null==e)return e=t,this._outputTextures[e];var n=this.outputs[e];return n?this._rendered?n.outputLastFrame?this._prevOutputTextures[e]:this._outputTextures[e]:this._rendering?(this._prevOutputTextures[e]||(this._prevOutputTextures[e]=this._compositor.allocateTexture(n.parameters||{})),this._prevOutputTextures[e]):(this.render(t),this._outputTextures[e]):void 0},removeReference:function(t){this._outputReferences[t]--,0===this._outputReferences[t]&&(this.outputs[t].keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t]))},link:function(t,e,n){this.inputLinks[t]={node:e,pin:n},e.outputLinks[n]||(e.outputLinks[n]=[]),e.outputLinks[n].push({node:this,pin:t}),this.pass.material.enableTexture(t)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(t){if(!this._rendering){for(var e in this._rendering=!0,this.inputLinks){var n=this.inputLinks[e];n.node.updateReference(n.pin)}this._rendering=!1}t&&this._outputReferences[t]++},beforeFrame:function(){for(var t in this._rendered=!1,this.outputLinks)this._outputReferences[t]=0},afterFrame:function(){for(var t in this.outputLinks)this._outputReferences[t]>0&&(this.outputs[t].keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t]))}});e.a=i},function(t,e,n){"use strict";e.a=function(t,e){for(var n=0,i=1/e,r=t;r>0;)n+=i*(r%e),r=Math.floor(r/e),i/=e;return n}},function(t,e,n){"use strict";var i=n(0),r=n.n(i);e.a=function(t,e,n){n=n||t.getSource();var i=e||r.a.getCoordinateSystemDimensions(t.get("coordinateSystem"))||["x","y","z"],a=r.a.helper.createDimensions(n,{dimensionsDefine:n.dimensionsDefine||t.get("dimensions"),encodeDefine:n.encodeDefine||t.get("encode"),coordDimensions:i.map((function(e){var n=t.getReferringComponents(e+"Axis3D")[0];return{type:n&&"category"===n.get("type")?"ordinal":"float",name:e,stackable:"z"===e}}))});"cartesian3D"===t.get("coordinateSystem")&&a.forEach((function(e){if(i.indexOf(e.coordDim)>=0){var n=t.getReferringComponents(e.coordDim+"Axis3D")[0];n&&"category"===n.get("type")&&(e.ordinalMeta=n.getOrdinalMeta())}}));var o=new r.a.List(a,t);return o.initData(n),o}},function(t,e){t.exports=function(t,e,n){return{seriesType:t,performRawSeries:!0,reset:function(t,i,r){var a=t.getData(),o=t.get("symbol")||e,s=t.get("symbolSize");if(a.setVisual({legendSymbol:n||o,symbol:o,symbolSize:s}),!i.isSeriesFiltered(t)){var l="function"==typeof s;return{dataEach:a.hasItemOption||l?function(e,n){if("function"==typeof s){var i=t.getRawValue(n),r=t.getDataParams(n);e.setItemVisual(n,"symbolSize",s(i,r))}if(e.hasItemOption){var a=e.getItemModel(n),o=a.getShallow("symbol",!0),l=a.getShallow("symbolSize",!0);null!=o&&e.setItemVisual(n,"symbol",o),null!=l&&e.setItemVisual(n,"symbolSize",l)}}:null}}}}}},function(t,e,n){"use strict";var i=n(8),r=n(92),a=n(11),o=(n(18),n(15)),s=n(9),l=n(17),u=n(23),c=n(96),h=n(7),d=n(98),f=n(63),p=n(1),g=n.n(p);h.a.import(d.a),h.a.import(f.a);var m=g.a.mat4,v=g.a.vec3,y=m.create,x={};function b(t){return t.material}function _(){}var E,w,T=i.a.extend((function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}}),(function(){this.canvas||(this.canvas=document.createElement("canvas"));var t=this.canvas;try{var e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!this.gl)throw new Error;this._glinfo=new r.a(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(t){throw"Error creating WebGL Context "+t}this._programMgr=new c.a(this)}),{resize:function(t,e){var n=this.canvas,i=this.devicePixelRatio;null!=t?(n.style.width=t+"px",n.style.height=e+"px",n.width=t*i,n.height=e*i,this._width=t,this._height=e):(this._width=n.width/i,this._height=n.height/i),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var t=this.viewport;return t.width/t.height},setDevicePixelRatio:function(t){this.devicePixelRatio=t,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(t){return this._glinfo.getExtension(t)},getGLParameter:function(t){return this._glinfo.getParameter(t)},setViewport:function(t,e,n,i,r){if("object"==typeof t){var a=t;t=a.x,e=a.y,n=a.width,i=a.height,r=a.devicePixelRatio}r=r||this.devicePixelRatio,this.gl.viewport(t*r,e*r,n*r,i*r),this.viewport={x:t,y:e,width:n,height:i,devicePixelRatio:r}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var t=this._clearStack.pop();this.clearColor=t.clearColor,this.clearBit=t.clearBit}},bindSceneRendering:function(t){this._sceneRendering=t},render:function(t,e,n,i){var r=this.gl,a=this.clearColor;if(this.clearBit){r.colorMask(!0,!0,!0,!0),r.depthMask(!0);var o=this.viewport,s=!1,l=o.devicePixelRatio;(o.width!==this._width||o.height!==this._height||l&&l!==this.devicePixelRatio||o.x||o.y)&&(s=!0,r.enable(r.SCISSOR_TEST),r.scissor(o.x*l,o.y*l,o.width*l,o.height*l)),r.clearColor(a[0],a[1],a[2],a[3]),r.clear(this.clearBit),s&&r.disable(r.SCISSOR_TEST)}if(n||t.update(!1),e=e||t.getMainCamera()){e.getScene()||e.update(!0),this._sceneRendering=t,t.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),t.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0);var u=this.cullRenderList(t.opaqueList,t,e),c=this.cullRenderList(t.transparentList,t,e),h=t.material;t.trigger("beforerender",this,t,e),i?(this.renderPreZ(u,t,e),r.depthFunc(r.LEQUAL)):r.depthFunc(r.LESS);for(var d=y(),f=v.create(),p=0;p<c.length;p++){var g=c[p];m.multiplyAffine(d,e.viewMatrix.array,g.worldTransform.array),v.transformMat4(f,g.position.array,d),g.__depth=f[2]}var x=this.renderPass(u,e,{getMaterial:function(t){return h||t.material},sortCompare:this.opaqueSortCompare}),b=this.renderPass(c,e,{getMaterial:function(t){return h||t.material},sortCompare:this.transparentSortCompare}),_={};for(var E in x)_[E]=x[E]+b[E];return t.trigger("afterrender",this,t,e,_),this._sceneRendering=null,_}console.error("Can't find camera in the scene.")},getProgram:function(t,e,n){return e=e||t.material,this._programMgr.getProgram(t,e,n)},validateProgram:function(t){if(t.__error){var e=t.__error;if(x[t.__uid__])return;if(x[t.__uid__]=!0,this.throwError)throw new Error(e);this.trigger("error",e)}},updatePrograms:function(t,e,n){var i=n&&n.getMaterial||b;e=e||null;for(var r=0;r<t.length;r++){var a=t[r],o=i.call(this,a);if(r>0){var s=t[r-1],l=s.joints?s.joints.length:0;if((a.joints.length?a.joints.length:0)===l&&a.material===s.material&&a.lightGroup===s.lightGroup){a.__program=s.__program;continue}}var u=this._programMgr.getProgram(a,o,e);this.validateProgram(u),a.__program=u}},cullRenderList:function(t,e,n){for(var i=[],r=0;r<t.length;r++){var a=t[r],o=a.isSkinnedMesh()?S.IDENTITY:a.worldTransform.array,s=a.geometry;m.multiplyAffine(S.WORLDVIEW,n.viewMatrix.array,o),s.boundingBox&&this.isFrustumCulled(a,e,n,S.WORLDVIEW,n.projectionMatrix.array)||i.push(a)}return i},renderPass:function(t,e,n){this.trigger("beforerenderpass",this,t,e,n);var i={triangleCount:0,vertexCount:0,drawCallCount:0,meshCount:t.length,renderedMeshCount:0};(n=n||{}).getMaterial=n.getMaterial||b,n.beforeRender=n.beforeRender||_,n.afterRender=n.afterRender||_,this.updatePrograms(t,this._sceneRendering,n),n.sortCompare&&t.sort(n.sortCompare);var r=this.viewport,a=r.devicePixelRatio,o=[r.x*a,r.y*a,r.width*a,r.height*a],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],u=[o[2],o[3]],c=Date.now();m.copy(S.VIEW,e.viewMatrix.array),m.copy(S.PROJECTION,e.projectionMatrix.array),m.multiply(S.VIEWPROJECTION,e.projectionMatrix.array,S.VIEW),m.copy(S.VIEWINVERSE,e.worldTransform.array),m.invert(S.PROJECTIONINVERSE,S.PROJECTION),m.invert(S.VIEWPROJECTIONINVERSE,S.VIEWPROJECTION);for(var h,d,f,p,g,v,y,x,E=this.gl,w=this._sceneRendering,T=0;T<t.length;T++){var M=t[T];if(!n.ifRender||n.ifRender(M)){var C=M.isSkinnedMesh()?S.IDENTITY:M.worldTransform.array,A=n.getMaterial.call(this,M),O=M.__program,N=A.shader;m.copy(S.WORLD,C),m.multiply(S.WORLDVIEWPROJECTION,S.VIEWPROJECTION,C),(N.matrixSemantics.WORLDINVERSE||N.matrixSemantics.WORLDINVERSETRANSPOSE)&&m.invert(S.WORLDINVERSE,C),(N.matrixSemantics.WORLDVIEWINVERSE||N.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&m.invert(S.WORLDVIEWINVERSE,S.WORLDVIEW),(N.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||N.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&m.invert(S.WORLDVIEWPROJECTIONINVERSE,S.WORLDVIEWPROJECTION),M.beforeRender(this),n.beforeRender.call(this,M,A,h);var P=O!==d;P?(O.bind(this),O.setUniformOfSemantic(E,"VIEWPORT",o),O.setUniformOfSemantic(E,"WINDOW_SIZE",l),O.setUniformOfSemantic(E,"NEAR",e.near),O.setUniformOfSemantic(E,"FAR",e.far),O.setUniformOfSemantic(E,"DEVICEPIXELRATIO",a),O.setUniformOfSemantic(E,"TIME",c),O.setUniformOfSemantic(E,"VIEWPORT_SIZE",u),w&&w.setLightUniforms(O,M.lightGroup,this)):O=d,(h!==A||P)&&(A.depthTest!==f&&(A.depthTest?E.enable(E.DEPTH_TEST):E.disable(E.DEPTH_TEST),f=A.depthTest),A.depthMask!==p&&(E.depthMask(A.depthMask),p=A.depthMask),A.transparent!==x&&(A.transparent?E.enable(E.BLEND):E.disable(E.BLEND),x=A.transparent),A.transparent&&(A.blend?A.blend(E):(E.blendEquationSeparate(E.FUNC_ADD,E.FUNC_ADD),E.blendFuncSeparate(E.SRC_ALPHA,E.ONE_MINUS_SRC_ALPHA,E.ONE,E.ONE_MINUS_SRC_ALPHA))),A.bind(this,O,h,d),h=A);for(var L=N.matrixSemanticKeys,R=0;R<L.length;R++){var D=L[R],k=N.matrixSemantics[D],I=S[D];if(k.isTranspose){var B=S[k.semanticNoTranspose];m.transpose(I,B)}O.setUniform(E,k.type,k.symbol,I)}M.cullFace!==v&&(v=M.cullFace,E.cullFace(v)),M.frontFace!==y&&(y=M.frontFace,E.frontFace(y)),M.culling!==g&&((g=M.culling)?E.enable(E.CULL_FACE):E.disable(E.CULL_FACE));var F=M.render(this,A,O);F&&(i.triangleCount+=F.triangleCount,i.vertexCount+=F.vertexCount,i.drawCallCount+=F.drawCallCount,i.renderedMeshCount++),n.afterRender.call(this,M,F),M.afterRender(this,F),d=O}}for(T=0;T<t.length;T++)t[T].__program=null;return this.trigger("afterrenderpass",this,t,e,n),i},renderPreZ:function(t,e,n){var i=this.gl,r=this._prezMaterial||new l.a({shader:new h.a(h.a.source("clay.prez.vertex"),h.a.source("clay.prez.fragment"))});this._prezMaterial=r,i.colorMask(!1,!1,!1,!1),i.depthMask(!0),this.renderPass(t,n,{ifRender:function(t){return!t.ignorePreZ},getMaterial:function(){return r},sort:this.opaqueSortCompare}),i.colorMask(!0,!0,!0,!0),i.depthMask(!0)},isFrustumCulled:(E=new o.a,w=new s.a,function(t,e,n,i,r){var a=t.boundingBox||t.geometry.boundingBox;if(w.array=i,E.copy(a),E.applyTransform(w),e&&t.isRenderable()&&t.castShadow&&e.viewBoundingBoxLastFrame.union(E),t.frustumCulling&&!t.isSkinnedMesh()){if(!E.intersectBoundingBox(n.frustum.boundingBox))return!0;w.array=r,E.max.array[2]>0&&E.min.array[2]<0&&(E.max.array[2]=-1e-20),E.applyProjection(w);var o=E.min.array,s=E.max.array;if(s[0]<-1||o[0]>1||s[1]<-1||o[1]>1||s[2]<-1||o[2]>1)return!0}return!1}),disposeScene:function(t){this.disposeNode(t,!0,!0),t.dispose()},disposeNode:function(t,e,n){t.getParent()&&t.getParent().remove(t),t.traverse((function(t){t.geometry&&e&&t.geometry.dispose(this),t.dispose&&t.dispose(this)}),this)},disposeGeometry:function(t){t.dispose(this)},disposeTexture:function(t){t.dispose(this)},disposeFrameBuffer:function(t){t.dispose(this)},dispose:function(){},screenToNDC:function(t,e,n){n||(n=new u.a),e=this._height-e;var i=this.viewport,r=n.array;return r[0]=(t-i.x)/i.width,r[0]=2*r[0]-1,r[1]=(e-i.y)/i.height,r[1]=2*r[1]-1,n}});T.opaqueSortCompare=T.prototype.opaqueSortCompare=function(t,e){return t.renderOrder===e.renderOrder?t.__program===e.__program?t.material===e.material?t.geometry.__uid__-e.geometry.__uid__:t.material.__uid__-e.material.__uid__:t.__program&&e.__program?t.__program.__uid__-e.__program.__uid__:0:t.renderOrder-e.renderOrder},T.transparentSortCompare=T.prototype.transparentSortCompare=function(t,e){return t.renderOrder===e.renderOrder?t.__depth===e.__depth?t.__program===e.__program?t.material===e.material?t.geometry.__uid__-e.geometry.__uid__:t.material.__uid__-e.material.__uid__:t.__program&&e.__program?t.__program.__uid__-e.__program.__uid__:0:t.__depth-e.__depth:t.renderOrder-e.renderOrder};var S={IDENTITY:y(),WORLD:y(),VIEW:y(),PROJECTION:y(),WORLDVIEW:y(),VIEWPROJECTION:y(),WORLDVIEWPROJECTION:y(),WORLDINVERSE:y(),VIEWINVERSE:y(),PROJECTIONINVERSE:y(),WORLDVIEWINVERSE:y(),VIEWPROJECTIONINVERSE:y(),WORLDVIEWPROJECTIONINVERSE:y(),WORLDTRANSPOSE:y(),VIEWTRANSPOSE:y(),PROJECTIONTRANSPOSE:y(),WORLDVIEWTRANSPOSE:y(),VIEWPROJECTIONTRANSPOSE:y(),WORLDVIEWPROJECTIONTRANSPOSE:y(),WORLDINVERSETRANSPOSE:y(),VIEWINVERSETRANSPOSE:y(),PROJECTIONINVERSETRANSPOSE:y(),WORLDVIEWINVERSETRANSPOSE:y(),VIEWPROJECTIONINVERSETRANSPOSE:y(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:y()};T.COLOR_BUFFER_BIT=a.a.COLOR_BUFFER_BIT,T.DEPTH_BUFFER_BIT=a.a.DEPTH_BUFFER_BIT,T.STENCIL_BUFFER_BIT=a.a.STENCIL_BUFFER_BIT,e.a=T},function(t,e,n){"use strict";function i(t,e){this.action=t,this.context=e}var r={trigger:function(t){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(t)){var e=this.__handlers__[t],n=e.length,i=-1,r=arguments;switch(r.length){case 1:for(;++i<n;)e[i].action.call(e[i].context);return;case 2:for(;++i<n;)e[i].action.call(e[i].context,r[1]);return;case 3:for(;++i<n;)e[i].action.call(e[i].context,r[1],r[2]);return;case 4:for(;++i<n;)e[i].action.call(e[i].context,r[1],r[2],r[3]);return;case 5:for(;++i<n;)e[i].action.call(e[i].context,r[1],r[2],r[3],r[4]);return;default:for(;++i<n;)e[i].action.apply(e[i].context,Array.prototype.slice.call(r,1));return}}},on:function(t,e,n){if(t&&e){var r=this.__handlers__||(this.__handlers__={});if(r[t]){if(this.has(t,e))return}else r[t]=[];var a=new i(e,n||this);return r[t].push(a),this}},once:function(t,e,n){if(t&&e){var i=this;return this.on(t,(function n(){i.off(t,n),e.apply(this,arguments)}),n)}},before:function(t,e,n){if(t&&e)return t="before"+t,this.on(t,e,n)},after:function(t,e,n){if(t&&e)return t="after"+t,this.on(t,e,n)},success:function(t,e){return this.once("success",t,e)},error:function(t,e){return this.once("error",t,e)},off:function(t,e){var n=this.__handlers__||(this.__handlers__={});if(e){if(n[t]){for(var i=n[t],r=[],a=0;a<i.length;a++)e&&i[a].action!==e&&r.push(i[a]);n[t]=r}return this}n[t]=[]},has:function(t,e){var n=this.__handlers__;if(!n||!n[t])return!1;for(var i=n[t],r=0;r<i.length;r++)if(i[r].action===e)return!0}};e.a=r},function(t,e,n){"use strict";var i="__dt__",r=function(){this._contextId=0,this._caches=[],this._context={}};(r.prototype={use:function(t,e){var n=this._caches;n[t]||(n[t]={},e&&(n[t]=e())),this._contextId=t,this._context=n[t]},put:function(t,e){this._context[t]=e},get:function(t){return this._context[t]},dirty:function(t){var e=i+(t=t||"");this.put(e,!0)},dirtyAll:function(t){for(var e=i+(t=t||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][e]=!0)},fresh:function(t){var e=i+(t=t||"");this.put(e,!1)},freshAll:function(t){for(var e=i+(t=t||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][e]=!1)},isDirty:function(t){var e=i+(t=t||""),n=this._context;return!n.hasOwnProperty(e)||!0===n[e]},deleteContext:function(t){delete this._caches[t],this._context={}},delete:function(t){delete this._context[t]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(t,e){Object.keys(this._caches).forEach((function(n){t&&t.call(e,n)}))},miss:function(t){return!this._context.hasOwnProperty(t)}}).constructor=r,e.a=r},function(t,e,n){"use strict";var i,r,a,o,s,l=n(4),u=n(1),c=n.n(u).a.vec3,h=1e-5,d=function(t,e){this.origin=t||new l.a,this.direction=e||new l.a};d.prototype={constructor:d,intersectPlane:function(t,e){var n=t.normal.array,i=t.distance,r=this.origin.array,a=this.direction.array,o=c.dot(n,a);if(0===o)return null;e||(e=new l.a);var s=(c.dot(n,r)-i)/o;return c.scaleAndAdd(e.array,r,a,-s),e._dirty=!0,e},mirrorAgainstPlane:function(t){var e=c.dot(t.normal.array,this.direction.array);c.scaleAndAdd(this.direction.array,this.direction.array,t.normal.array,2*-e),this.direction._dirty=!0},distanceToPoint:(s=c.create(),function(t){c.sub(s,t,this.origin.array);var e=c.dot(s,this.direction.array);if(e<0)return c.distance(this.origin.array,t);var n=c.lenSquared(s);return Math.sqrt(n-e*e)}),intersectSphere:function(){var t=c.create();return function(e,n,i){var r=this.origin.array,a=this.direction.array;e=e.array,c.sub(t,e,r);var o=c.dot(t,a),s=c.squaredLength(t)-o*o,u=n*n;if(!(s>u)){var h=Math.sqrt(u-s),d=o-h,f=o+h;return i||(i=new l.a),d<0?f<0?null:(c.scaleAndAdd(i.array,r,a,f),i):(c.scaleAndAdd(i.array,r,a,d),i)}}}(),intersectBoundingBox:function(t,e){var n,i,r,a,o,s,u=this.direction.array,h=this.origin.array,d=t.min.array,f=t.max.array,p=1/u[0],g=1/u[1],m=1/u[2];if(p>=0?(n=(d[0]-h[0])*p,i=(f[0]-h[0])*p):(i=(d[0]-h[0])*p,n=(f[0]-h[0])*p),g>=0?(r=(d[1]-h[1])*g,a=(f[1]-h[1])*g):(a=(d[1]-h[1])*g,r=(f[1]-h[1])*g),n>a||r>i)return null;if((r>n||n!=n)&&(n=r),(a<i||i!=i)&&(i=a),m>=0?(o=(d[2]-h[2])*m,s=(f[2]-h[2])*m):(s=(d[2]-h[2])*m,o=(f[2]-h[2])*m),n>s||o>i)return null;if((o>n||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0)return null;var v=n>=0?n:i;return e||(e=new l.a),c.scaleAndAdd(e.array,h,u,v),e},intersectTriangle:(i=c.create(),r=c.create(),a=c.create(),o=c.create(),function(t,e,n,s,u,d){var f=this.direction.array,p=this.origin.array;t=t.array,e=e.array,n=n.array,c.sub(i,e,t),c.sub(r,n,t),c.cross(o,r,f);var g=c.dot(i,o);if(s){if(g>-1e-5)return null}else if(g>-1e-5&&g<h)return null;c.sub(a,p,t);var m=c.dot(o,a)/g;if(m<0||m>1)return null;c.cross(o,i,a);var v=c.dot(f,o)/g;if(v<0||v>1||m+v>1)return null;c.cross(o,i,r);var y=-c.dot(a,o)/g;return y<0?null:(u||(u=new l.a),d&&l.a.set(d,1-m-v,m,v),c.scaleAndAdd(u.array,p,f,y),u)}),applyTransform:function(t){l.a.add(this.direction,this.direction,this.origin),l.a.transformMat4(this.origin,this.origin,t),l.a.transformMat4(this.direction,this.direction,t),l.a.sub(this.direction,this.direction,this.origin),l.a.normalize(this.direction,this.direction)},copy:function(t){l.a.copy(this.origin,t.origin),l.a.copy(this.direction,t.direction)},clone:function(){var t=new d;return t.copy(this),t}},e.a=d},function(t,e,n){"use strict";var i,r,a=n(1),o=n.n(a),s=o.a.quat,l=function(t,e,n,i){t=t||0,e=e||0,n=n||0,i=void 0===i?1:i,this.array=s.fromValues(t,e,n,i),this._dirty=!0};l.prototype={constructor:l,add:function(t){return s.add(this.array,this.array,t.array),this._dirty=!0,this},calculateW:function(){return s.calculateW(this.array,this.array),this._dirty=!0,this},set:function(t,e,n,i){return this.array[0]=t,this.array[1]=e,this.array[2]=n,this.array[3]=i,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this.array[3]=t[3],this._dirty=!0,this},clone:function(){return new l(this.x,this.y,this.z,this.w)},conjugate:function(){return s.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(t){return s.copy(this.array,t.array),this._dirty=!0,this},dot:function(t){return s.dot(this.array,t.array)},fromMat3:function(t){return s.fromMat3(this.array,t.array),this._dirty=!0,this},fromMat4:(i=o.a.mat3,r=i.create(),function(t){return i.fromMat4(r,t.array),i.transpose(r,r),s.fromMat3(this.array,r),this._dirty=!0,this}),identity:function(){return s.identity(this.array),this._dirty=!0,this},invert:function(){return s.invert(this.array,this.array),this._dirty=!0,this},len:function(){return s.len(this.array)},length:function(){return s.length(this.array)},lerp:function(t,e,n){return s.lerp(this.array,t.array,e.array,n),this._dirty=!0,this},mul:function(t){return s.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return s.multiply(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return s.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return s.multiply(this.array,t.array,this.array),this._dirty=!0,this},normalize:function(){return s.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(t){return s.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return s.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return s.rotateZ(this.array,this.array,t),this._dirty=!0,this},rotationTo:function(t,e){return s.rotationTo(this.array,t.array,e.array),this._dirty=!0,this},setAxes:function(t,e,n){return s.setAxes(this.array,t.array,e.array,n.array),this._dirty=!0,this},setAxisAngle:function(t,e){return s.setAxisAngle(this.array,t.array,e),this._dirty=!0,this},slerp:function(t,e,n){return s.slerp(this.array,t.array,e.array,n),this._dirty=!0,this},sqrLen:function(){return s.sqrLen(this.array)},squaredLength:function(){return s.squaredLength(this.array)},fromEuler:function(t,e){return l.fromEuler(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var u=Object.defineProperty;if(u){var c=l.prototype;u(c,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),u(c,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),u(c,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),u(c,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}l.add=function(t,e,n){return s.add(t.array,e.array,n.array),t._dirty=!0,t},l.set=function(t,e,n,i,r){s.set(t.array,e,n,i,r),t._dirty=!0},l.copy=function(t,e){return s.copy(t.array,e.array),t._dirty=!0,t},l.calculateW=function(t,e){return s.calculateW(t.array,e.array),t._dirty=!0,t},l.conjugate=function(t,e){return s.conjugate(t.array,e.array),t._dirty=!0,t},l.identity=function(t){return s.identity(t.array),t._dirty=!0,t},l.invert=function(t,e){return s.invert(t.array,e.array),t._dirty=!0,t},l.dot=function(t,e){return s.dot(t.array,e.array)},l.len=function(t){return s.length(t.array)},l.lerp=function(t,e,n,i){return s.lerp(t.array,e.array,n.array,i),t._dirty=!0,t},l.slerp=function(t,e,n,i){return s.slerp(t.array,e.array,n.array,i),t._dirty=!0,t},l.multiply=l.mul=function(t,e,n){return s.multiply(t.array,e.array,n.array),t._dirty=!0,t},l.rotateX=function(t,e,n){return s.rotateX(t.array,e.array,n),t._dirty=!0,t},l.rotateY=function(t,e,n){return s.rotateY(t.array,e.array,n),t._dirty=!0,t},l.rotateZ=function(t,e,n){return s.rotateZ(t.array,e.array,n),t._dirty=!0,t},l.setAxisAngle=function(t,e,n){return s.setAxisAngle(t.array,e.array,n),t._dirty=!0,t},l.normalize=function(t,e){return s.normalize(t.array,e.array),t._dirty=!0,t},l.squaredLength=l.sqrLen=function(t){return s.sqrLen(t.array)},l.fromMat3=function(t,e){return s.fromMat3(t.array,e.array),t._dirty=!0,t},l.setAxes=function(t,e,n,i){return s.setAxes(t.array,e.array,n.array,i.array),t._dirty=!0,t},l.rotationTo=function(t,e,n){return s.rotationTo(t.array,e.array,n.array),t._dirty=!0,t},l.fromEuler=function(t,e,n){t._dirty=!0,e=e.array;var i=t.array,r=Math.cos(e[0]/2),a=Math.cos(e[1]/2),o=Math.cos(e[2]/2),s=Math.sin(e[0]/2),l=Math.sin(e[1]/2),u=Math.sin(e[2]/2);switch(n=(n||"XYZ").toUpperCase()){case"XYZ":i[0]=s*a*o+r*l*u,i[1]=r*l*o-s*a*u,i[2]=r*a*u+s*l*o,i[3]=r*a*o-s*l*u;break;case"YXZ":i[0]=s*a*o+r*l*u,i[1]=r*l*o-s*a*u,i[2]=r*a*u-s*l*o,i[3]=r*a*o+s*l*u;break;case"ZXY":i[0]=s*a*o-r*l*u,i[1]=r*l*o+s*a*u,i[2]=r*a*u+s*l*o,i[3]=r*a*o-s*l*u;break;case"ZYX":i[0]=s*a*o-r*l*u,i[1]=r*l*o+s*a*u,i[2]=r*a*u-s*l*o,i[3]=r*a*o+s*l*u;break;case"YZX":i[0]=s*a*o+r*l*u,i[1]=r*l*o+s*a*u,i[2]=r*a*u-s*l*o,i[3]=r*a*o-s*l*u;break;case"XZY":i[0]=s*a*o-r*l*u,i[1]=r*l*o-s*a*u,i[2]=r*a*u+s*l*o,i[3]=r*a*o+s*l*u}},e.a=l},function(t,e,n){"use strict";var i,r=n(28),a=n(9),o=n(52),s=n(49),l=n(1),u=n.n(l),c=u.a.vec3,h=u.a.vec4,d=r.a.extend((function(){return{projectionMatrix:new a.a,invProjectionMatrix:new a.a,viewMatrix:new a.a,frustum:new o.a}}),(function(){this.update(!0)}),{update:function(t){r.a.prototype.update.call(this,t),a.a.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),a.a.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(t){a.a.copy(this.viewMatrix,t),a.a.invert(this.worldTransform,t),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(t){a.a.copy(this.projectionMatrix,t),a.a.invert(this.invProjectionMatrix,t),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(i=h.create(),function(t,e){var n=void 0!==e?e:new s.a,r=t.array[0],a=t.array[1];return h.set(i,r,a,-1,1),h.transformMat4(i,i,this.invProjectionMatrix.array),h.transformMat4(i,i,this.worldTransform.array),c.scale(n.origin.array,i,1/i[3]),h.set(i,r,a,1,1),h.transformMat4(i,i,this.invProjectionMatrix.array),h.transformMat4(i,i,this.worldTransform.array),c.scale(i,i,1/i[3]),c.sub(n.direction.array,i,n.origin.array),c.normalize(n.direction.array,n.direction.array),n.direction._dirty=!0,n.origin._dirty=!0,n})});e.a=d},function(t,e,n){"use strict";n(4);var i,r=n(15),a=n(67),o=n(1),s=n.n(o).a.vec3,l=s.set,u=s.copy,c=s.transformMat4,h=Math.min,d=Math.max,f=function(){this.planes=[];for(var t=0;t<6;t++)this.planes.push(new a.a);for(this.boundingBox=new r.a,this.vertices=[],t=0;t<8;t++)this.vertices[t]=s.fromValues(0,0,0)};f.prototype={setFromProjection:function(t){var e=this.planes,n=t.array,i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],u=n[5],c=n[6],h=n[7],d=n[8],f=n[9],p=n[10],g=n[11],m=n[12],v=n[13],y=n[14],x=n[15];l(e[0].normal.array,o-i,h-s,g-d),e[0].distance=-(x-m),e[0].normalize(),l(e[1].normal.array,o+i,h+s,g+d),e[1].distance=-(x+m),e[1].normalize(),l(e[2].normal.array,o+r,h+u,g+f),e[2].distance=-(x+v),e[2].normalize(),l(e[3].normal.array,o-r,h-u,g-f),e[3].distance=-(x-v),e[3].normalize(),l(e[4].normal.array,o-a,h-c,g-p),e[4].distance=-(x-y),e[4].normalize(),l(e[5].normal.array,o+a,h+c,g+p),e[5].distance=-(x+y),e[5].normalize();var b=this.boundingBox;if(0===x){var _=u/i,E=-y/(p-1),w=-y/(p+1),T=-w/u,S=-E/u;b.min.set(-T*_,-T,w),b.max.set(T*_,T,E);var M=this.vertices;l(M[0],-T*_,-T,w),l(M[1],-T*_,T,w),l(M[2],T*_,-T,w),l(M[3],T*_,T,w),l(M[4],-S*_,-S,E),l(M[5],-S*_,S,E),l(M[6],S*_,-S,E),l(M[7],S*_,S,E)}else{var C=(-1-m)/i,A=(1-m)/i,O=(1-v)/u,N=(-1-v)/u,P=(-1-y)/p,L=(1-y)/p;b.min.set(Math.min(C,A),Math.min(N,O),Math.min(L,P)),b.max.set(Math.max(A,C),Math.max(O,N),Math.max(P,L));var R=b.min.array,D=b.max.array;M=this.vertices,l(M[0],R[0],R[1],R[2]),l(M[1],R[0],D[1],R[2]),l(M[2],D[0],R[1],R[2]),l(M[3],D[0],D[1],R[2]),l(M[4],R[0],R[1],D[2]),l(M[5],R[0],D[1],D[2]),l(M[6],D[0],R[1],D[2]),l(M[7],D[0],D[1],D[2])}},getTransformedBoundingBox:(i=s.create(),function(t,e){var n=this.vertices,r=e.array,a=t.min,o=t.max,s=a.array,l=o.array,f=n[0];c(i,f,r),u(s,i),u(l,i);for(var p=1;p<8;p++)f=n[p],c(i,f,r),s[0]=h(i[0],s[0]),s[1]=h(i[1],s[1]),s[2]=h(i[2],s[2]),l[0]=d(i[0],l[0]),l[1]=d(i[1],l[1]),l[2]=d(i[2],l[2]);return a._dirty=!0,o._dirty=!0,t})},e.a=f},function(t,e){var n=function(){this.head=null,this.tail=null,this._len=0},i=n.prototype;i.insert=function(t){var e=new r(t);return this.insertEntry(e),e},i.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},i.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},i.len=function(){return this._len},i.clear=function(){this.head=this.tail=null,this._len=0};var r=function(t){this.value=t,this.next,this.prev},a=function(t){this._list=new n,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},o=a.prototype;o.put=function(t,e){var n=this._list,i=this._map,a=null;if(null==i[t]){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new r(e),s.key=t,n.insertEntry(s),i[t]=s}return a},o.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},o.clear=function(){this._list.clear(),this._map={}};var s=a;t.exports=s},function(t,e,n){"use strict";var i=n(5),r=n(25),a=n(102),o=n(55),s=n(56),l=n(29),u=n(104),c=n(105),h={loadTexture:function(t,e,n,a){if("function"==typeof e?(a=n=e,e={}):e=e||{},"string"==typeof t){if(t.match(/.hdr$/)||"hdr"===e.fileType)return o=new i.a({width:0,height:0,sRGB:!1}),h._fetchTexture(t,(function(t){c.a.parseRGBE(t,o,e.exposure),o.dirty(),n&&n(o)}),a),o;t.match(/.dds$/)||"dds"===e.fileType?(o=new i.a({width:0,height:0}),h._fetchTexture(t,(function(t){u.a.parse(t,o),o.dirty(),n&&n(o)}),a)):((o=new i.a).load(t),o.success(n),o.error(a))}else if("object"==typeof t&&void 0!==t.px){var o;(o=new r.a).load(t),o.success(n),o.error(a)}return o},loadPanorama:function(t,e,n,i,r,a){var o=this;"function"==typeof i?(a=r=i,i={}):i=i||{},h.loadTexture(e,i,(function(e){e.flipY=i.flipY||!1,o.panoramaToCubeMap(t,e,n,i),e.dispose(t),r&&r(n)}),a)},panoramaToCubeMap:function(t,e,n,i){var r=new o.a,a=new s.a({scene:new l.a});return a.material.set("diffuseMap",e),(i=i||{}).encodeRGBM&&a.material.define("fragment","RGBM_ENCODE"),n.sRGB=e.sRGB,r.texture=n,r.render(t,a.scene),r.texture=null,r.dispose(t),n},heightToNormal:function(t,e){var n=document.createElement("canvas"),i=n.width=t.width,r=n.height=t.height,a=n.getContext("2d");a.drawImage(t,0,0,i,r),e=e||!1;for(var o=a.getImageData(0,0,i,r),s=a.createImageData(i,r),l=0;l<o.data.length;l+=4){if(e){var u=o.data[l],c=o.data[l+1],h=o.data[l+2];if(Math.abs(u-c)+Math.abs(c-h)>20)return console.warn("Given image is not a height map"),t}var d,f,p,g;l%(4*i)==0?(d=o.data[l],p=o.data[l+4]):l%(4*i)==4*(i-1)?(d=o.data[l-4],p=o.data[l]):(d=o.data[l-4],p=o.data[l+4]),l<4*i?(f=o.data[l],g=o.data[l+4*i]):l>i*(r-1)*4?(f=o.data[l-4*i],g=o.data[l]):(f=o.data[l-4*i],g=o.data[l+4*i]),s.data[l]=d-p+127,s.data[l+1]=f-g+127,s.data[l+2]=255,s.data[l+3]=255}return a.putImageData(s,0,0),n},isHeightImage:function(t,e,n){if(!t||!t.width||!t.height)return!1;var i=document.createElement("canvas"),r=i.getContext("2d"),a=e||32;n=n||20,i.width=i.height=a,r.drawImage(t,0,0,a,a);for(var o=r.getImageData(0,0,a,a),s=0;s<o.data.length;s+=4){var l=o.data[s],u=o.data[s+1],c=o.data[s+2];if(Math.abs(l-u)+Math.abs(u-c)>n)return!1}return!0},_fetchTexture:function(t,e,n){a.a.get({url:t,responseType:"arraybuffer",onload:e,onerror:n})},createChessboard:function(t,e,n,r){t=t||512,e=e||64,n=n||"black",r=r||"white";var a=Math.ceil(t/e),o=document.createElement("canvas");o.width=t,o.height=t;var s=o.getContext("2d");s.fillStyle=r,s.fillRect(0,0,t,t),s.fillStyle=n;for(var l=0;l<a;l++)for(var u=0;u<a;u++)(u%2?l%2:l%2-1)&&s.fillRect(l*e,u*e,e,e);return new i.a({image:o,anisotropic:8})},createBlank:function(t){var e=document.createElement("canvas");e.width=1,e.height=1;var n=e.getContext("2d");return n.fillStyle=t,n.fillRect(0,0,1,1),new i.a({image:e})}};e.a=h},function(t,e,n){"use strict";var i=n(8),r=n(4),a=n(36),o=n(10),s=["px","nx","py","ny","pz","nz"],l=i.a.extend((function(){var t={position:new r.a,far:1e3,near:.1,texture:null,shadowMapPass:null},e=t._cameras={px:new a.a({fov:90}),nx:new a.a({fov:90}),py:new a.a({fov:90}),ny:new a.a({fov:90}),pz:new a.a({fov:90}),nz:new a.a({fov:90})};return e.px.lookAt(r.a.POSITIVE_X,r.a.NEGATIVE_Y),e.nx.lookAt(r.a.NEGATIVE_X,r.a.NEGATIVE_Y),e.py.lookAt(r.a.POSITIVE_Y,r.a.POSITIVE_Z),e.ny.lookAt(r.a.NEGATIVE_Y,r.a.NEGATIVE_Z),e.pz.lookAt(r.a.POSITIVE_Z,r.a.NEGATIVE_Y),e.nz.lookAt(r.a.NEGATIVE_Z,r.a.NEGATIVE_Y),t._frameBuffer=new o.a,t}),{getCamera:function(t){return this._cameras[t]},render:function(t,e,n){var i=t.gl;n||e.update();for(var a=this.texture.width,o=2*Math.atan(a/(a-.5))/Math.PI*180,l=0;l<6;l++){var u=s[l],c=this._cameras[u];if(r.a.copy(c.position,this.position),c.far=this.far,c.near=this.near,c.fov=o,this.shadowMapPass){c.update();var h=e.getBoundingBox();h.applyTransform(c.viewMatrix),e.viewBoundingBoxLastFrame.copy(h),this.shadowMapPass.render(t,e,c,!0)}this._frameBuffer.attach(this.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+l),this._frameBuffer.bind(t),t.render(e,c,!0),this._frameBuffer.unbind(t)}},dispose:function(t){this._frameBuffer.dispose(t)}});e.a=l},function(t,e,n){"use strict";var i=n(24),r=n(68),a=n(7),o=n(17),s=n(103);a.a.import(s.a);var l=i.a.extend((function(){var t=new a.a(a.a.source("clay.basic.vertex"),a.a.source("clay.basic.fragment")),e=new o.a({shader:t,depthMask:!1});return e.enableTexture("diffuseMap"),{scene:null,geometry:new r.a({widthSegments:30,heightSegments:30}),material:e,environmentMap:null,culling:!1}}),(function(){var t=this.scene;t&&this.attachScene(t),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)}),{attachScene:function(t){this.scene&&this.detachScene(),t.skydome=this,this.scene=t,t.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skydome=null),this.scene=null},_beforeRenderScene:function(t,e,n){this.position.copy(n.getWorldPosition()),this.update(),t.renderPass([this],n)},setEnvironmentMap:function(t){this.material.set("diffuseMap",t)},getEnvironmentMap:function(){return this.material.get("diffuseMap")},dispose:function(t){this.detachScene(),this.geometry.dispose(t)}});e.a=l},function(t,e,n){"use strict";var i=n(24),r=n(69),a=n(7),o=n(17),s=n(110);a.a.import(s.a);var l=i.a.extend((function(){var t=new a.a({vertex:a.a.source("clay.skybox.vertex"),fragment:a.a.source("clay.skybox.fragment")}),e=new o.a({shader:t,depthMask:!1});return{scene:null,geometry:new r.a,material:e,environmentMap:null,culling:!1}}),(function(){var t=this.scene;t&&this.attachScene(t),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)}),{attachScene:function(t){this.scene&&this.detachScene(),t.skybox=this,this.scene=t,t.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(t){this.detachScene(),this.geometry.dispose(t)},setEnvironmentMap:function(t){this.material.set("environmentMap",t)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(t,e,n){this.renderSkybox(t,n)},renderSkybox:function(t,e){this.position.copy(e.getWorldPosition()),this.update(),t.gl.disable(t.gl.BLEND),this.material.get("lod")>0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),t.renderPass([this],e)}});e.a=l},function(t,e,n){"use strict";var i=n(2),r=n(143),a=n(144);i.a.Shader.import(a.a),e.a=i.a.Mesh.extend((function(){return{geometry:new r.a({dynamic:!0}),material:new i.a.Material({shader:i.a.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(186),s=n(22),l=n(3),u=n(1),c=n.n(u),h=n(60),d=n(61),f=n(40),p=c.a.vec3;function g(t){this.rootNode=new a.a.Node,this._triangulationResults={},this._shadersMap=a.a.COMMON_SHADERS.reduce((function(t,e){return t[e]=a.a.createShader("ecgl."+e),t}),{}),this._linesShader=a.a.createShader("ecgl.meshLines3D");var e={};a.a.COMMON_SHADERS.forEach((function(t){e[t]=new a.a.Material({shader:a.a.createShader("ecgl."+t)})})),this._groundMaterials=e,this._groundMesh=new a.a.Mesh({geometry:new a.a.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new d.a(512,512,t),this._labelsBuilder.getMesh().renderOrder=100,this._labelsBuilder.getMesh().material.depthTest=!1,this.rootNode.add(this._labelsBuilder.getMesh()),this._initMeshes(),this._api=t}a.a.Shader.import(f.a),g.prototype={constructor:g,extrudeY:!0,update:function(t,e,n,i,r){var a=t.getData();null==i&&(i=0),null==r&&(r=a.count()),this._startIndex=i,this._endIndex=r-1,this._triangulation(t,i,r);var o=this._getShader(t.get("shading"));this._prepareMesh(t,o,n,i,r),this.rootNode.updateWorldTransform(),this._updateRegionMesh(t,n,i,r);var s=t.coordinateSystem;"geo3D"===s.type&&this._updateGroundPlane(t,s,n);var l=this;this._labelsBuilder.updateData(a,i,r),this._labelsBuilder.getLabelPosition=function(t,e,n){var i=a.getName(t),r=n;if("geo3D"===s.type)return u=s.getRegion(i).center,s.dataToPoint([u[0],u[1],r]);var o=l._triangulationResults[t-l._startIndex],u=l.extrudeY?[(o.max[0]+o.min[0])/2,o.max[1]+r,(o.max[2]+o.min[2])/2]:[(o.max[0]+o.min[0])/2,(o.max[1]+o.min[1])/2,o.max[2]+r]},this._data=a,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(t),this._lastHoverDataIndex=0},_initMeshes:function(){this.rootNode.removeAll();var t,e=this,n=(t=new a.a.Mesh({name:"Polygon",material:new a.a.Material({shader:e._shadersMap.lambert}),culling:!1,geometry:new a.a.Geometry({sortTriangles:!0,dynamic:!0}),ignorePicking:!0,renderNormal:!0}),r.a.util.extend(t.geometry,h.a),t),i=new a.a.Mesh({material:new a.a.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new s.a({useNativeLine:!1})});this.rootNode.add(n),this.rootNode.add(i),n.material.define("both","VERTEX_COLOR"),n.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=n,this._linesMesh=i,this.rootNode.add(this._groundMesh)},_getShader:function(t){var e=this._shadersMap[t];return e||(console.warn("Unkown shading "+t),e=this._shadersMap.lambert),e.__shading=t,e},_prepareMesh:function(t,e,n,i,r){for(var o=0,s=0,l=0,u=0,c=i;c<r;c++){var h=this._getRegionPolygonInfo(c),d=this._getRegionLinesInfo(c,t,this._linesMesh.geometry);o+=h.vertexCount,s+=h.triangleCount,l+=d.vertexCount,u+=d.triangleCount}var f=this._polygonMesh,p=f.geometry;["position","normal","texcoord0","color"].forEach((function(t){p.attributes[t].init(o)})),p.indices=o>65535?new Uint32Array(3*s):new Uint16Array(3*s),f.material.shader!==e&&f.material.attachShader(e,!0),a.a.setMaterialFromModel(e.__shading,f.material,t,n),l>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(l),this._linesMesh.geometry.setTriangleCount(u)),this._dataIndexOfVertex=new Uint32Array(o),this._vertexRangeOfDataIndex=new Uint32Array(2*(r-i))},_updateRegionMesh:function(t,e,n,i){for(var r=t.getData(),o=0,s=0,u=!1,c=this._polygonMesh,h=this._linesMesh,d=n;d<i;d++){var f=t.getRegionModel(d),p=f.getModel("itemStyle"),g=p.get("color"),m=l.a.firstNotNull(p.get("opacity"),1),v=r.getItemVisual(d,"color",!0);null!=v&&r.hasValue(d)&&(g=v),r.setItemVisual(d,"color",g),r.setItemVisual(d,"opacity",m),g=a.a.parseColor(g);var y=a.a.parseColor(p.get("borderColor"));g[3]*=m,y[3]*=m;var x=g[3]<.99;c.material.set("color",[1,1,1,1]),u=u||x;for(var b=l.a.firstNotNull(f.get("height",!0),t.get("regionHeight")),_=this._updatePolygonGeometry(t,c.geometry,d,b,o,s,g),E=o;E<_.vertexOffset;E++)this._dataIndexOfVertex[E]=d;this._vertexRangeOfDataIndex[2*(d-n)]=o,this._vertexRangeOfDataIndex[2*(d-n)+1]=_.vertexOffset,o=_.vertexOffset,s=_.triangleOffset;var w=p.get("borderWidth"),T=w>0;T&&(w*=e.getDevicePixelRatio(),this._updateLinesGeometry(h.geometry,t,d,b,w,t.coordinateSystem.transform)),h.invisible=!T,h.material.set({color:y})}(c=this._polygonMesh).material.transparent=u,c.material.depthMask=!u,c.geometry.updateBoundingBox(),c.material.get("normalMap")&&c.geometry.generateTangents(),c.seriesIndex=t.seriesIndex,c.on("mousemove",this._onmousemove,this),c.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(t){var e=t.getModel("debug.wireframe");if(e.get("show")){var n=a.a.parseColor(e.get("lineStyle.color")||"rgba(0,0,0,0.5)"),i=l.a.firstNotNull(e.get("lineStyle.width"),1),r=this._polygonMesh;r.geometry.generateBarycentric(),r.material.define("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",n),r.material.set("wireframeLineWidth",i)}},_onmousemove:function(t){var e=this._dataIndexOfVertex[t.triangle[0]];null==e&&(e=-1),e!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(e)),this._lastHoverDataIndex=e,this._polygonMesh.dataIndex=e},_onmouseover:function(t){if(t.target){var e=t.target.eventData?this._data.indexOfName(t.target.eventData.name):t.target.dataIndex;null!=e&&(this.highlight(e),this._labelsBuilder.updateLabels([e]))}},_onmouseout:function(t){t.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1)},_updateGroundPlane:function(t,e,n){var i=t.getModel("groundPlane",t);if(this._groundMesh.invisible=!i.get("show",!0),!this._groundMesh.invisible){var r=t.get("shading"),o=this._groundMaterials[r];o||(console.warn("Unkown shading "+r),o=this._groundMaterials.lambert),a.a.setMaterialFromModel(r,o,i,n),o.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=o,this._groundMesh.material.set("color",a.a.parseColor(i.get("color"))),this._groundMesh.scale.set(e.size[0],e.size[2],1)}},_triangulation:function(t,e,n){this._triangulationResults=[];for(var i=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0],a=t.coordinateSystem,s=e;s<n;s++){for(var l=[],u=t.getRegionPolygonCoords(s),c=0;c<u.length;c++){var h=u[c].exterior,d=u[c].interiors,f=[],g=[];if(!(h.length<3)){for(var m=0,v=0;v<h.length;v++){var y=h[v];f[m++]=y[0],f[m++]=y[1]}for(v=0;v<d.length;v++)if(!(d[v].length<3)){for(var x=f.length/2,b=0;b<d[v].length;b++)y=d[v][b],f.push(y[0]),f.push(y[1]);g.push(x)}var _=Object(o.a)(f,g),E=new Float64Array(f.length/2*3),w=[],T=[1/0,1/0,1/0],S=[-1/0,-1/0,-1/0],M=0;for(v=0;v<f.length;)p.set(w,f[v++],0,f[v++]),a&&a.transform&&p.transformMat4(w,w,a.transform),p.min(T,T,w),p.max(S,S,w),E[M++]=w[0],E[M++]=w[1],E[M++]=w[2];p.min(i,i,T),p.max(r,r,S),l.push({points:E,indices:_,min:T,max:S})}}this._triangulationResults.push(l)}this._geoBoundingBox=[i,r]},_getRegionPolygonInfo:function(t){for(var e=this._triangulationResults[t-this._startIndex],n=0,i=0,r=0;r<e.length;r++)n+=e[r].points.length/3,i+=e[r].indices.length/3;return{vertexCount:2*n+4*n,triangleCount:2*i+2*n}},_updatePolygonGeometry:function(t,e,n,i,r,a,o){var s=t.get("projectUVOnGround"),l=e.attributes.position,u=e.attributes.normal,c=e.attributes.texcoord0,h=e.attributes.color,d=this._triangulationResults[n-this._startIndex],f=h.value&&o,g=e.indices,m=this.extrudeY?1:2,v=this.extrudeY?2:1,y=[this.rootNode.worldTransform.x.len(),this.rootNode.worldTransform.y.len(),this.rootNode.worldTransform.z.len()],x=p.mul([],this._geoBoundingBox[0],y),b=p.mul([],this._geoBoundingBox[1],y),_=Math.max(b[0]-x[0],b[2]-x[2]);function E(t,e,n){var i=r;!function(t,e,n){for(var i=t.points,a=i.length,s=[],u=[],d=0;d<a;d+=3)s[0]=i[d],s[m]=e,s[v]=i[d+2],u[0]=(i[d]*y[0]-x[0])/_,u[1]=(i[d+2]*y[v]-x[2])/_,l.set(r,s),f&&h.set(r,o),c.set(r++,u)}(t,e);for(var s=0;s<t.indices.length;s++)g[3*a+s]=t.indices[s]+i;a+=t.indices.length/3}for(var w=this.extrudeY?[0,1,0]:[0,0,1],T=p.negate([],w),S=0;S<d.length;S++){var M=r,C=d[S];E(C,0),E(C,i);for(var A=C.points.length/3,O=0;O<A;O++)u.set(M+O,T),u.set(M+O+A,w);var N=[0,3,1,1,3,2],P=[[],[],[],[]],L=[],R=[],D=[],k=[],I=0;for(O=0;O<A;O++){for(var B=(O+1)%A,F=(C.points[3*B]-C.points[3*O])*y[0],z=(C.points[3*B+2]-C.points[3*O+2])*y[v],G=Math.sqrt(F*F+z*z),j=0;j<4;j++){var U=0===j||3===j,H=3*(U?O:B);P[j][0]=C.points[H],P[j][m]=j>1?i:0,P[j][v]=C.points[H+2],l.set(r+j,P[j]),s?(k[0]=(C.points[H]*y[0]-x[0])/_,k[1]=(C.points[H+2]*y[v]-x[v])/_):(k[0]=(U?I:I+G)/_,k[1]=(P[j][m]*y[m]-x[m])/_),c.set(r+j,k)}for(p.sub(L,P[1],P[0]),p.sub(R,P[3],P[0]),p.cross(D,L,R),p.normalize(D,D),j=0;j<4;j++)u.set(r+j,D),f&&h.set(r+j,o);for(j=0;j<6;j++)g[3*a+j]=N[j]+r;r+=4,a+=2,I+=G}}return e.dirty(),{vertexOffset:r,triangleOffset:a}},_getRegionLinesInfo:function(t,e,n){var i=0,r=0;return e.getRegionModel(t).getModel("itemStyle").get("borderWidth")>0&&e.getRegionPolygonCoords(t).forEach((function(t){var e=t.exterior,a=t.interiors;i+=n.getPolylineVertexCount(e),r+=n.getPolylineTriangleCount(e);for(var o=0;o<a.length;o++)i+=n.getPolylineVertexCount(a[o]),r+=n.getPolylineTriangleCount(a[o])}),this),{vertexCount:i,triangleCount:r}},_updateLinesGeometry:function(t,e,n,i,r,a){function o(t){for(var e=new Float64Array(3*t.length),n=0,r=[],o=0;o<t.length;o++)r[0]=t[o][0],r[1]=i+.1,r[2]=t[o][1],a&&p.transformMat4(r,r,a),e[n++]=r[0],e[n++]=r[1],e[n++]=r[2];return e}var s=[1,1,1,1];e.getRegionPolygonCoords(n).forEach((function(e){var n=e.exterior,i=e.interiors;t.addPolyline(o(n),s,r);for(var a=0;a<i.length;a++)t.addPolyline(o(i[a]),s,r)}))},highlight:function(t){var e=this._data;if(e){var n=e.getItemModel(t).getModel("emphasis.itemStyle"),i=n.get("color"),o=l.a.firstNotNull(n.get("opacity"),e.getItemVisual(t,"opacity"),1);if(null==i){var s=e.getItemVisual(t,"color");i=r.a.color.lift(s,-.4)}null==o&&(o=e.getItemVisual(t,"opacity"));var u=a.a.parseColor(i);u[3]*=o,this._setColorOfDataIndex(e,t,u)}},downplay:function(t){var e=this._data;if(e){var n=e.getItemVisual(t,"color"),i=l.a.firstNotNull(e.getItemVisual(t,"opacity"),1),r=a.a.parseColor(n);r[3]*=i,this._setColorOfDataIndex(e,t,r)}},_setColorOfDataIndex:function(t,e,n){if(!(e<this._startIndex&&e>this._endIndex)){e-=this._startIndex;for(var i=this._vertexRangeOfDataIndex[2*e];i<this._vertexRangeOfDataIndex[2*e+1];i++)this._polygonMesh.geometry.attributes.color.set(i,n);this._polygonMesh.geometry.dirty(),this._api.getZr().refresh()}}},e.a=g},function(t,e,n){"use strict";var i=n(81),r=n(1),a=n.n(r).a.vec3,o=a.create(),s=a.create(),l=a.create();e.a={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(t,e){var n=this.indices;if(0===e){var i=this.attributes.position;t=t.array,this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new n.constructor(n.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var r,u=0,c=0;c<n.length;){i.get(n[c++],o),i.get(n[c++],s),i.get(n[c++],l);var h=a.sqrDist(o,t),d=a.sqrDist(s,t),f=a.sqrDist(l,t),p=Math.min(h,d);p=Math.min(p,f),3===c?(r=p,p=0):p-=r,this._triangleZList[u++]=p}}var g=this._sortedTriangleIndices;for(c=0;c<g.length;c++)g[c]=c;if(this.triangleCount<2e4)0===e&&this._simpleSort(!0);else for(c=0;c<3;c++)this._progressiveQuickSort(3*e+c);var m=this._indicesTmp,v=this._triangleZListTmp,y=this._triangleZList;for(c=0;c<this.triangleCount;c++){var x=3*g[c],b=3*c;m[b++]=n[x++],m[b++]=n[x++],m[b]=n[x],v[c]=y[g[c]]}var _=this._indicesTmp;this._indicesTmp=this.indices,this.indices=_,_=this._triangleZListTmp,this._triangleZListTmp=this._triangleZList,this._triangleZList=_,this.dirtyIndices()},_simpleSort:function(t){var e=this._triangleZList,n=this._sortedTriangleIndices;function r(t,n){return e[n]-e[t]}t?Array.prototype.sort.call(n,r):i.a.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(t){var e=this._triangleZList,n=this._sortedTriangleIndices;this._quickSort=this._quickSort||new i.a,this._quickSort.step(n,(function(t,n){return e[n]-e[t]}),t)}}},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(73),o=n(58),s=n(3);function l(t,e,n){this._labelsMesh=new o.a,this._labelTextureSurface=new a.a({width:512,height:512,devicePixelRatio:n.getDevicePixelRatio(),onupdate:function(){n.getZr().refresh()}}),this._api=n,this._labelsMesh.material.set("textureAtlas",this._labelTextureSurface.getTexture())}l.prototype.getLabelPosition=function(t,e,n){return[0,0,0]},l.prototype.getLabelDistance=function(t,e,n){return 0},l.prototype.getMesh=function(){return this._labelsMesh},l.prototype.updateData=function(t,e,n){null==e&&(e=0),null==n&&(n=t.count()),this._labelsVisibilitiesBits&&this._labelsVisibilitiesBits.length===n-e||(this._labelsVisibilitiesBits=new Uint8Array(n-e));for(var i=["label","show"],r=["emphasis","label","show"],a=e;a<n;a++){var o=t.getItemModel(a),s=o.get(i),l=o.get(r);null==l&&(l=s);var u=(s?1:0)|(l?2:0);this._labelsVisibilitiesBits[a-e]=u}this._start=e,this._end=n,this._data=t},l.prototype.updateLabels=function(t){if(this._data){for(var e=(t=t||[]).length>0,n={},i=0;i<t.length;i++)n[t[i]]=!0;this._labelsMesh.geometry.convertToDynamicArray(!0),this._labelTextureSurface.clear();for(var a=["label"],o=["emphasis","label"],l=this._data.hostModel,u=this._data,c=l.getModel(a),h=l.getModel(o,c),d={left:"right",right:"left",top:"center",bottom:"center"},f={left:"middle",right:"middle",top:"bottom",bottom:"top"},p=this._start;p<this._end;p++){var g=!1;if(e&&n[p]&&(g=!0),this._labelsVisibilitiesBits[p-this._start]&(g?2:1)){var m=u.getItemModel(p).getModel(g?o:a,g?h:c),v=m.get("distance")||0,y=m.get("position"),x=m.getModel("textStyle"),b=this._api.getDevicePixelRatio(),_=l.getFormattedLabel(p,g?"emphasis":"normal");if(null==_||""===_)return;var E=new r.a.graphic.Text;r.a.graphic.setTextStyle(E.style,x,{text:_,textFill:x.get("color")||u.getItemVisual(p,"color")||"#000",textAlign:"left",textVerticalAlign:"top",opacity:s.a.firstNotNull(x.get("opacity"),u.getItemVisual(p,"opacity"),1)});var w=E.getBoundingRect();w.height*=1.2;var T=this._labelTextureSurface.add(E),S=d[y]||"center",M=f[y]||"bottom";this._labelsMesh.geometry.addSprite(this.getLabelPosition(p,y,v),[w.width*b,w.height*b],T,S,M,this.getLabelDistance(p,y,v)*b)}}this._labelsMesh.material.set("uvScale",this._labelTextureSurface.getCoordsScale()),this._labelTextureSurface.getZr().refreshImmediately(),this._labelsMesh.geometry.convertToTypedArray(),this._labelsMesh.geometry.dirty()}},e.a=l},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(216),s=n(217),l=n(61),u=n(9),c=n(3);function h(t,e){this.rootNode=new a.a.Node,this.is2D=t,this._labelsBuilder=new l.a(256,256,e),this._labelsBuilder.getMesh().renderOrder=100,this.rootNode.add(this._labelsBuilder.getMesh()),this._api=e,this._spriteImageCanvas=document.createElement("canvas"),this._startDataIndex=0,this._endDataIndex=0,this._sizeScale=1}h.prototype={constructor:h,highlightOnMouseover:!0,update:function(t,e,n,i,r){var o=this._prevMesh;this._prevMesh=this._mesh,this._mesh=o;var l=t.getData();if(null==i&&(i=0),null==r&&(r=l.count()),this._startDataIndex=i,this._endDataIndex=r-1,!this._mesh){var u=this._prevMesh&&this._prevMesh.material;this._mesh=new s.a({renderOrder:10,frustumCulling:!1}),u&&(this._mesh.material=u)}u=this._mesh.material;var c=this._mesh.geometry,h=c.attributes;this.rootNode.remove(this._prevMesh),this.rootNode.add(this._mesh),this._setPositionTextureToMesh(this._mesh,this._positionTexture);var d=this._getSymbolInfo(t,i,r),f=n.getDevicePixelRatio(),p=t.getModel("itemStyle").getItemStyle(),g=t.get("large"),m=1;d.maxSize>2?(m=this._updateSymbolSprite(t,p,d,f),u.enableTexture("sprite")):u.disableTexture("sprite"),h.position.init(r-i);var v=[];if(g){u.undefine("VERTEX_SIZE"),u.undefine("VERTEX_COLOR");var y=l.getVisual("color"),x=l.getVisual("opacity");a.a.parseColor(y,v),v[3]*=x,u.set({color:v,u_Size:d.maxSize*this._sizeScale})}else u.set({color:[1,1,1,1]}),u.define("VERTEX_SIZE"),u.define("VERTEX_COLOR"),h.size.init(r-i),h.color.init(r-i),this._originalOpacity=new Float32Array(r-i);for(var b=l.getLayout("points"),_=h.position.value,E=0;E<r-i;E++){var w=3*E,T=2*E;if(this.is2D?(_[w]=b[T],_[w+1]=b[T+1],_[w+2]=-10):(_[w]=b[w],_[w+1]=b[w+1],_[w+2]=b[w+2]),!g){y=l.getItemVisual(E,"color"),x=l.getItemVisual(E,"opacity"),a.a.parseColor(y,v),v[3]*=x,h.color.set(E,v),v[3];var S=l.getItemVisual(E,"symbolSize");S=S instanceof Array?Math.max(S[0],S[1]):S,isNaN(S)&&(S=0),h.size.value[E]=S*m*this._sizeScale,this._originalOpacity[E]=v[3]}}this._mesh.sizeScale=m,c.updateBoundingBox(),c.dirty(),this._updateMaterial(t,p);var M=t.coordinateSystem;M&&M.viewGL&&u[M.viewGL.isLinearSpace()?"define":"undefine"]("fragment","SRGB_DECODE"),g||this._updateLabelBuilder(t,i,r),this._updateHandler(t,e,n),this._updateAnimation(t),this._api=n},getPointsMesh:function(){return this._mesh},updateLabels:function(t){this._labelsBuilder.updateLabels(t)},hideLabels:function(){this.rootNode.remove(this._labelsBuilder.getMesh())},showLabels:function(){this.rootNode.add(this._labelsBuilder.getMesh())},_updateSymbolSprite:function(t,e,n,i){n.maxSize=Math.min(2*n.maxSize,200);var r,a,s=[];return n.aspect>1?(s[0]=n.maxSize,s[1]=n.maxSize/n.aspect):(s[1]=n.maxSize,s[0]=n.maxSize*n.aspect),s[0]=s[0]||1,s[1]=s[1]||1,this._symbolType===n.type&&(r=this._symbolSize,a=s,r&&a&&r[0]===a[0]&&r[1]===a[1])&&this._lineWidth===e.lineWidth||(o.a.createSymbolSprite(n.type,s,{fill:"#fff",lineWidth:e.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(s[0]/2,10)},this._spriteImageCanvas),o.a.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=n.type,this._symbolSize=s,this._lineWidth=e.lineWidth),this._spriteImageCanvas.width/n.maxSize*i},_updateMaterial:function(t,e){var n="lighter"===t.get("blendMode")?a.a.additiveBlend:null,i=this._mesh.material;i.blend=n,i.set("lineWidth",e.lineWidth/20);var r=a.a.parseColor(e.stroke);i.set("strokeColor",r),i.transparent=!0,i.depthMask=!1,i.depthTest=!this.is2D,i.sortVertices=!this.is2D},_updateLabelBuilder:function(t,e,n){var i=t.getData(),r=this._mesh.geometry,a=r.attributes.position.value,o=(e=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(i,e,n),this._labelsBuilder.getLabelPosition=function(t,n,i){var r=3*(t-e);return[a[r],a[r+1],a[r+2]]},this._labelsBuilder.getLabelDistance=function(t,n,i){return r.attributes.size.get(t-e)/o/2+i},this._labelsBuilder.updateLabels()},_updateAnimation:function(t){a.a.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,t)},_updateHandler:function(t,e,n){var i,r=t.getData(),a=this._mesh,o=this,s=-1,l=t.coordinateSystem&&"cartesian3D"===t.coordinateSystem.type;l&&(i=t.coordinateSystem.model),a.seriesIndex=t.seriesIndex,a.off("mousemove"),a.off("mouseout"),a.on("mousemove",(function(e){var u=e.vertexIndex+o._startDataIndex;u!==s&&(this.highlightOnMouseover&&(this.downplay(r,s),this.highlight(r,u),this._labelsBuilder.updateLabels([u])),l&&n.dispatchAction({type:"grid3DShowAxisPointer",value:[r.get(t.coordDimToDataDim("x")[0],u),r.get(t.coordDimToDataDim("y")[0],u),r.get(t.coordDimToDataDim("z")[0],u)],grid3DIndex:i.componentIndex})),a.dataIndex=u,s=u}),this),a.on("mouseout",(function(t){var e=t.vertexIndex+o._startDataIndex;this.highlightOnMouseover&&(this.downplay(r,e),this._labelsBuilder.updateLabels()),s=-1,a.dataIndex=-1,l&&n.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:i.componentIndex})}),this)},updateLayout:function(t,e,n){var i=t.getData();if(this._mesh){var r=this._mesh.geometry.attributes.position.value,a=i.getLayout("points");if(this.is2D)for(var o=0;o<a.length/2;o++){var s=3*o,l=2*o;r[s]=a[l],r[s+1]=a[l+1],r[s+2]=-10}else for(o=0;o<a.length;o++)r[o]=a[o];this._mesh.geometry.dirty(),n.getZr().refresh()}},updateView:function(t){if(this._mesh){var e=new u.a;u.a.mul(e,t.viewMatrix,this._mesh.worldTransform),u.a.mul(e,t.projectionMatrix,e),this._mesh.updateNDCPosition(e,this.is2D,this._api)}},highlight:function(t,e){if(!(e>this._endDataIndex||e<this._startDataIndex)){var n=t.getItemModel(e).getModel("emphasis.itemStyle"),i=n.get("color"),o=n.get("opacity");if(null==i){var s=t.getItemVisual(e,"color");i=r.a.color.lift(s,-.4)}null==o&&(o=t.getItemVisual(e,"opacity"));var l=a.a.parseColor(i);l[3]*=o,this._mesh.geometry.attributes.color.set(e-this._startDataIndex,l),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},downplay:function(t,e){if(!(e>this._endDataIndex||e<this._startDataIndex)){var n=t.getItemVisual(e,"color"),i=t.getItemVisual(e,"opacity"),r=a.a.parseColor(n);r[3]*=i,this._mesh.geometry.attributes.color.set(e-this._startDataIndex,r),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeOutAll:function(t){if(this._originalOpacity){for(var e=this._mesh.geometry,n=0;n<e.vertexCount;n++){var i=this._originalOpacity[n]*t;e.attributes.color.value[4*n+3]=i}e.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeInAll:function(){this.fadeOutAll(1)},setPositionTexture:function(t){this._mesh&&this._setPositionTextureToMesh(this._mesh,t),this._positionTexture=t},removePositionTexture:function(){this._positionTexture=null,this._mesh&&this._setPositionTextureToMesh(this._mesh,null)},setSizeScale:function(t){if(t!==this._sizeScale){if(this._mesh){var e=this._mesh.material.get("u_Size");this._mesh.material.set("u_Size",e/this._sizeScale*t);var n=this._mesh.geometry.attributes;if(n.size.value)for(var i=0;i<n.size.value.length;i++)n.size.value[i]=n.size.value[i]/this._sizeScale*t}this._sizeScale=t}},_setPositionTextureToMesh:function(t,e){e&&t.material.set("positionTexture",e),t.material[e?"enableTexture":"disableTexture"]("positionTexture")},_getSymbolInfo:function(t,e,n){if(t.get("large"))return(d=c.a.firstNotNull(t.get("symbolSize"),1))instanceof Array?(l=Math.max(d[0],d[1]),i=d[0]/d[1]):(l=d,i=1),{maxSize:d,type:t.get("symbol"),aspect:i};for(var i,r=t.getData(),a=!1,o=r.getItemVisual(0,"symbol")||"circle",s=!1,l=0,u=e;u<n;u++){var h,d=r.getItemVisual(u,"symbolSize"),f=r.getItemVisual(u,"symbol");if(d instanceof Array)h=d[0]/d[1],l=Math.max(Math.max(d[0],d[1]),l);else{if(isNaN(d))return;h=1,l=Math.max(d,l)}null!=i&&Math.abs(h-i)>.05&&(a=!0),f!==o&&(s=!0),o=f,i=h}return a&&console.warn("Different symbol width / height ratio will be ignored."),s&&console.warn("Different symbol type will be ignored."),{maxSize:l,type:o,aspect:i}}},e.a=h},function(t,e,n){"use strict";e.a="@export clay.prez.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvoid main()\n{\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n gl_Position = worldViewProjection * vec4(skinnedPosition, 1.0);\n}\n@end\n@export clay.prez.fragment\nvoid main()\n{\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}\n@end"},function(t,e,n){"use strict";var i,r=n(28),a=n(11),o=0,s=null,l=!0,u=function(){this.triangleCount=0,this.vertexCount=0,this.drawCallCount=0};function c(t,e,n){this.availableAttributes=t,this.availableAttributeSymbols=e,this.indicesBuffer=n,this.vao=null}var h,d=r.a.extend({material:null,geometry:null,mode:a.a.TRIANGLES,_drawCache:null,_renderInfo:null},(function(){this._drawCache={},this._renderInfo=new u}),{__program:null,lightGroup:0,renderOrder:0,lineWidth:1,culling:!0,cullFace:a.a.BACK,frontFace:a.a.CCW,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&this.geometry.vertexCount>0},beforeRender:function(t){},afterRender:function(t,e){},getBoundingBox:function(t,e){return e=r.a.prototype.getBoundingBox.call(this,t,e),this.geometry&&this.geometry.boundingBox&&e.union(this.geometry.boundingBox),e},render:function(t,e,n){var r=t.gl,u=(e=e||this.material).shader,h=this.geometry,d=this.mode,f=h.vertexCount,p=(h.isUseIndices(),t.getGLExtension("OES_element_index_uint")&&f>65535?r.UNSIGNED_INT:r.UNSIGNED_SHORT),g=t.getGLExtension("OES_vertex_array_object"),m=!h.dynamic,v=this._renderInfo;v.vertexCount=f,v.triangleCount=0,v.drawCallCount=0;var y=!1;if(((i=t.__uid__+"-"+h.__uid__+"-"+n.__uid__)!==o||g&&m||h._cache.isDirty("any"))&&(y=!0),o=i,y){var x=this._drawCache[i];if(!x){var b=h.getBufferChunks(t);if(!b)return;x=[];for(var _=0;_<b.length;_++){for(var E=b[_],w=E.attributeBuffers,T=E.indicesBuffer,S=[],M=[],C=0;C<w.length;C++){var A,O=(B=w[C]).name,N=B.semantic;if(N){var P=u.attributeSemantics[N];A=P&&P.symbol}else A=O;A&&n.attributes[A]&&(S.push(B),M.push(A))}var L=new c(S,M,T);x.push(L)}m&&(this._drawCache[i]=x)}for(var R=0;R<x.length;R++){L=x[R];var D=!0;if(g&&m&&(null==L.vao?L.vao=g.createVertexArrayOES():D=!1,g.bindVertexArrayOES(L.vao)),S=L.availableAttributes,T=L.indicesBuffer,D){var k=n.enableAttributes(t,L.availableAttributeSymbols,g&&m&&L.vao);for(C=0;C<S.length;C++){var I=k[C];if(-1!==I){var B,F,z=(B=S[C]).buffer,G=B.size;switch(B.type){case"float":default:F=r.FLOAT;break;case"byte":F=r.BYTE;break;case"ubyte":F=r.UNSIGNED_BYTE;break;case"short":F=r.SHORT;break;case"ushort":F=r.UNSIGNED_SHORT}r.bindBuffer(r.ARRAY_BUFFER,z),r.vertexAttribPointer(I,G,F,!1,0,0)}}}d!=a.a.LINES&&d!=a.a.LINE_STRIP&&d!=a.a.LINE_LOOP||r.lineWidth(this.lineWidth),s=T,(l=h.isUseIndices())?(D&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,T.buffer),r.drawElements(d,T.count,p,0),v.triangleCount+=T.count/3):r.drawArrays(d,0,f),g&&m&&g.bindVertexArrayOES(null),v.drawCallCount++}}else l?(r.drawElements(d,s.count,p,0),v.triangleCount=s.count/3):r.drawArrays(d,0,f),v.drawCallCount=1;return v},clone:(h=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"],function(){var t=r.a.prototype.clone.call(this);t.geometry=this.geometry,t.material=this.material;for(var e=0;e<h.length;e++){var n=h[e];t[n]!==this[n]&&(t[n]=this[n])}return t})});d.POINTS=a.a.POINTS,d.LINES=a.a.LINES,d.LINE_LOOP=a.a.LINE_LOOP,d.LINE_STRIP=a.a.LINE_STRIP,d.TRIANGLES=a.a.TRIANGLES,d.TRIANGLE_STRIP=a.a.TRIANGLE_STRIP,d.TRIANGLE_FAN=a.a.TRIANGLE_FAN,d.BACK=a.a.BACK,d.FRONT=a.a.FRONT,d.FRONT_AND_BACK=a.a.FRONT_AND_BACK,d.CW=a.a.CW,d.CCW=a.a.CCW,d.RenderInfo=u,e.a=d},function(t,e){var n="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){setTimeout(t,16)};t.exports=n},function(t,e,n){"use strict";var i={isPowerOfTwo:function(t){return 0==(t&t-1)},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}};e.a=i},function(t,e,n){"use strict";var i,r,a,o,s=n(4),l=n(1),u=n.n(l),c=u.a.vec3,h=u.a.mat4,d=u.a.vec4,f=function(t,e){this.normal=t||new s.a(0,1,0),this.distance=e||0};f.prototype={constructor:f,distanceToPoint:function(t){return c.dot(t.array,this.normal.array)-this.distance},projectPoint:function(t,e){e||(e=new s.a);var n=this.distanceToPoint(t);return c.scaleAndAdd(e.array,t.array,this.normal.array,-n),e._dirty=!0,e},normalize:function(){var t=1/c.len(this.normal.array);c.scale(this.normal.array,t),this.distance*=t},intersectFrustum:function(t){for(var e=t.vertices,n=this.normal.array,i=c.dot(e[0].array,n)>this.distance,r=1;r<8;r++)if(c.dot(e[r].array,n)>this.distance!=i)return!0},intersectLine:(o=c.create(),function(t,e,n){var i=this.distanceToPoint(t),r=this.distanceToPoint(e);if(i>0&&r>0||i<0&&r<0)return null;var a=this.normal.array,l=this.distance,u=t.array;c.sub(o,e.array,t.array),c.normalize(o,o);var h=c.dot(a,o);if(0===h)return null;n||(n=new s.a);var d=(c.dot(a,u)-l)/h;return c.scaleAndAdd(n.array,u,o,-d),n._dirty=!0,n}),applyTransform:(i=h.create(),r=d.create(),a=d.create(),a[3]=1,function(t){t=t.array,c.scale(a,this.normal.array,this.distance),d.transformMat4(a,a,t),this.distance=c.dot(a,this.normal.array),h.invert(i,t),h.transpose(i,i),r[3]=0,c.copy(r,this.normal.array),d.transformMat4(r,r,i),c.copy(this.normal.array,r)}),copy:function(t){c.copy(this.normal.array,t.normal.array),this.normal._dirty=!0,this.distance=t.distance},clone:function(){var t=new f;return t.copy(this),t}},e.a=f},function(t,e,n){"use strict";var i=n(13),r=n(15),a=i.a.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI,radius:1},(function(){this.build()}),{build:function(){var t=this.heightSegments,e=this.widthSegments,n=this.attributes.position,i=this.attributes.texcoord0,a=this.attributes.normal,o=(e+1)*(t+1);n.init(o),i.init(o),a.init(o);var s,l,u,c,h,d,f,p,g,m,v,y=o>65535?Uint32Array:Uint16Array,x=this.indices=new y(e*t*6),b=this.radius,_=this.phiStart,E=this.phiLength,w=this.thetaStart,T=this.thetaLength,S=[],M=[],C=0,A=1/(b=this.radius);for(f=0;f<=t;f++)for(d=0;d<=e;d++)c=d/e,h=f/t,s=-b*Math.cos(_+c*E)*Math.sin(w+h*T),l=b*Math.cos(w+h*T),u=b*Math.sin(_+c*E)*Math.sin(w+h*T),S[0]=s,S[1]=l,S[2]=u,M[0]=c,M[1]=h,n.set(C,S),i.set(C,M),S[0]*=A,S[1]*=A,S[2]*=A,a.set(C,S),C++;var O=e+1,N=0;for(f=0;f<t;f++)for(d=0;d<e;d++)g=f*O+d,p=f*O+d+1,v=(f+1)*O+d+1,m=(f+1)*O+d,x[N++]=p,x[N++]=g,x[N++]=v,x[N++]=g,x[N++]=m,x[N++]=v;this.boundingBox=new r.a,this.boundingBox.max.set(b,b,b),this.boundingBox.min.set(-b,-b,-b)}});e.a=a},function(t,e,n){"use strict";var i=n(13),r=n(37),a=n(9),o=n(4),s=n(15),l=n(18),u=new a.a,c=i.a.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},(function(){this.build()}),{build:function(){var t={px:h("px",this.depthSegments,this.heightSegments),nx:h("nx",this.depthSegments,this.heightSegments),py:h("py",this.widthSegments,this.depthSegments),ny:h("ny",this.widthSegments,this.depthSegments),pz:h("pz",this.widthSegments,this.heightSegments),nz:h("nz",this.widthSegments,this.heightSegments)},e=["position","texcoord0","normal"],n=0,i=0;for(var r in t)n+=t[r].vertexCount,i+=t[r].indices.length;for(var a=0;a<e.length;a++)this.attributes[e[a]].init(n);this.indices=new l.a.Uint16Array(i);var o=0,u=0;for(var r in t){var c=t[r];for(a=0;a<e.length;a++)for(var d=e[a],f=c.attributes[d].value,p=c.attributes[d].size,g="normal"===d,m=0;m<f.length;m++){var v=f[m];this.inside&&g&&(v=-v),this.attributes[d].value[m+p*u]=v}var y=c.indices.length;for(m=0;m<c.indices.length;m++)this.indices[m+o]=u+c.indices[this.inside?y-m-1:m];o+=c.indices.length,u+=c.vertexCount}this.boundingBox=new s.a,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function h(t,e,n){u.identity();var i=new r.a({widthSegments:e,heightSegments:n});switch(t){case"px":a.a.translate(u,u,o.a.POSITIVE_X),a.a.rotateY(u,u,Math.PI/2);break;case"nx":a.a.translate(u,u,o.a.NEGATIVE_X),a.a.rotateY(u,u,-Math.PI/2);break;case"py":a.a.translate(u,u,o.a.POSITIVE_Y),a.a.rotateX(u,u,-Math.PI/2);break;case"ny":a.a.translate(u,u,o.a.NEGATIVE_Y),a.a.rotateX(u,u,Math.PI/2);break;case"pz":a.a.translate(u,u,o.a.POSITIVE_Z);break;case"nz":a.a.translate(u,u,o.a.NEGATIVE_Z),a.a.rotateY(u,u,Math.PI)}return i.applyTransform(u),i}e.a=c},function(t,e,n){"use strict";var i=n(19),r=n(4),a=i.a.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(t){return t.__dir=t.__dir||new r.a,t.__dir.copy(t.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}}},clone:function(){var t=i.a.prototype.clone.call(this);return t.shadowBias=this.shadowBias,t.shadowSlopeScale=this.shadowSlopeScale,t}});e.a=a},function(t,e,n){"use strict";var i=n(19),r=i.a.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(t){return t.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(t){return t.range}},pointLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}}},clone:function(){var t=i.a.prototype.clone.call(this);return t.range=this.range,t}});e.a=r},function(t,e,n){"use strict";var i=n(19),r=n(4),a=i.a.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:2e-4,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(t){return t.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(t){return t.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(t){return Math.cos(t.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(t){return Math.cos(t.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(t){return t.falloffFactor}},spotLightDirection:{type:"3f",value:function(t){return t.__dir=t.__dir||new r.a,t.__dir.copy(t.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}}},clone:function(){var t=i.a.prototype.clone.call(this);return t.range=this.range,t.umbraAngle=this.umbraAngle,t.penumbraAngle=this.penumbraAngle,t.falloffFactor=this.falloffFactor,t.shadowBias=this.shadowBias,t.shadowSlopeScale=this.shadowSlopeScale,t}});e.a=a},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(5);function o(t,e,n,i,r,a,o){this._zr=t,this._x=0,this._y=0,this._rowHeight=0,this.width=i,this.height=r,this.offsetX=e,this.offsetY=n,this.dpr=o,this.gap=a}function s(t){(t=t||{}).width=t.width||512,t.height=t.height||512,t.devicePixelRatio=t.devicePixelRatio||1,t.gap=null==t.gap?2:t.gap;var e=document.createElement("canvas");e.width=t.width*t.devicePixelRatio,e.height=t.height*t.devicePixelRatio,this._canvas=e,this._texture=new a.a({image:e,flipY:!1});var n=this;this._zr=r.a.zrender.init(e);var i=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){i.call(this),n._texture.dirty(),n.onupdate&&n.onupdate()},this._dpr=t.devicePixelRatio,this._coords={},this.onupdate=t.onupdate,this._gap=t.gap,this._textureAtlasNodes=[new o(this._zr,0,0,t.width,t.height,this._gap,this._dpr)],this._nodeWidth=t.width,this._nodeHeight=t.height,this._currentNodeIdx=0}o.prototype={constructor:o,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(t,e,n){var i=t.getBoundingRect();null==e&&(e=i.width),null==n&&(n=i.height),e*=this.dpr,n*=this.dpr,this._fitElement(t,e,n);var r=this._x,a=this._y,o=this.width*this.dpr,s=this.height*this.dpr,l=this.gap;if(r+e+l>o&&(r=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=e+l,this._rowHeight=Math.max(this._rowHeight,n),a+n+l>s)return null;t.position[0]+=this.offsetX*this.dpr+r,t.position[1]+=this.offsetY*this.dpr+a,this._zr.add(t);var u=[this.offsetX/this.width,this.offsetY/this.height];return[[r/o+u[0],a/s+u[1]],[(r+e)/o+u[0],(a+n)/s+u[1]]]},_fitElement:function(t,e,n){var i=t.getBoundingRect(),r=e/i.width,a=n/i.height;t.position=[-i.x*r,-i.y*a],t.scale=[r,a],t.update()}},s.prototype={clear:function(){for(var t=0;t<this._textureAtlasNodes.length;t++)this._textureAtlasNodes[t].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var t=4096/this._dpr,e=this._textureAtlasNodes.length,n=e*this._nodeWidth%t,i=Math.floor(e*this._nodeWidth/t)*this._nodeHeight;if(!(i>=t)){var r=(n+this._nodeWidth)*this._dpr,a=(i+this._nodeHeight)*this._dpr;try{this._zr.resize({width:r,height:a})}catch(t){this._canvas.width=r,this._canvas.height=a}var s=new o(this._zr,n,i,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(s),s}console.error("Too much labels. Some will be ignored.")},add:function(t,e,n){if(this._coords[t.id])return console.warn("Element already been add"),this._coords[t.id];var i=this._getCurrentNode().add(t,e,n);if(!i){var r=this._expand();if(!r)return;i=r.add(t,e,n)}return this._coords[t.id]=i,i},getCoordsScale:function(){var t=this._dpr;return[this._nodeWidth/this._canvas.width*t,this._nodeHeight/this._canvas.height*t]},getCoords:function(t){return this._coords[t]}},e.a=s},function(t,e,n){"use strict";e.a=function(t,e,n){var i,r=t.scale;return"ordinal"===r.type&&("function"==typeof n?(i=r.getTicks()[e],!n(i,r.getLabel(i))):e%(n+1))}},function(t,e,n){var i,r,a,o,s=n(76),l=n(77),u=s.applyTransform,c=Math.min,h=Math.max;function d(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}d.prototype={constructor:d,union:function(t){var e=c(t.x,this.x),n=c(t.y,this.y);this.width=h(t.x+t.width,this.x+this.width)-e,this.height=h(t.y+t.height,this.y+this.height)-n,this.x=e,this.y=n},applyTransform:(i=[],r=[],a=[],o=[],function(t){if(t){i[0]=a[0]=this.x,i[1]=o[1]=this.y,r[0]=o[0]=this.x+this.width,r[1]=a[1]=this.y+this.height,u(i,i,t),u(r,r,t),u(a,a,t),u(o,o,t),this.x=c(i[0],r[0],a[0],o[0]),this.y=c(i[1],r[1],a[1],o[1]);var e=h(i[0],r[0],a[0],o[0]),n=h(i[1],r[1],a[1],o[1]);this.width=e-this.x,this.height=n-this.y}}),calculateTransform:function(t){var e=this,n=t.width/e.width,i=t.height/e.height,r=l.create();return l.translate(r,r,[-e.x,-e.y]),l.scale(r,r,[n,i]),l.translate(r,r,[t.x,t.y]),r},intersect:function(t){if(!t)return!1;t instanceof d||(t=d.create(t));var e=this,n=e.x,i=e.x+e.width,r=e.y,a=e.y+e.height,o=t.x,s=t.x+t.width,l=t.y,u=t.y+t.height;return!(i<o||s<n||a<l||u<r)},contain:function(t,e){var n=this;return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},clone:function(){return new d(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},d.create=function(t){return new d(t.x,t.y,t.width,t.height)};var f=d;t.exports=f},function(t,e){var n="undefined"==typeof Float32Array?Array:Float32Array;function i(t){return Math.sqrt(a(t))}var r=i;function a(t){return t[0]*t[0]+t[1]*t[1]}var o=a;function s(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var l=s;function u(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var c=u;e.create=function(t,e){var i=new n(2);return null==t&&(t=0),null==e&&(e=0),i[0]=t,i[1]=e,i},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.clone=function(t){var e=new n(2);return e[0]=t[0],e[1]=t[1],e},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},e.sub=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},e.len=i,e.length=r,e.lenSquare=a,e.lengthSquare=o,e.mul=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},e.div=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.normalize=function(t,e){var n=i(e);return 0===n?(t[0]=0,t[1]=0):(t[0]=e[0]/n,t[1]=e[1]/n),t},e.distance=s,e.dist=l,e.distanceSquare=u,e.distSquare=c,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.lerp=function(t,e,n,i){return t[0]=e[0]+i*(n[0]-e[0]),t[1]=e[1]+i*(n[1]-e[1]),t},e.applyTransform=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}},function(t,e){var n="undefined"==typeof Float32Array?Array:Float32Array;function i(){var t=new n(6);return r(t),t}function r(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}e.create=i,e.identity=r,e.copy=a,e.mul=function(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],a=e[0]*n[2]+e[2]*n[3],o=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t},e.translate=function(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t},e.rotate=function(t,e,n){var i=e[0],r=e[2],a=e[4],o=e[1],s=e[3],l=e[5],u=Math.sin(n),c=Math.cos(n);return t[0]=i*c+o*u,t[1]=-i*u+o*c,t[2]=r*c+s*u,t[3]=-r*u+c*s,t[4]=c*a+u*l,t[5]=c*l-u*a,t},e.scale=function(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t},e.invert=function(t,e){var n=e[0],i=e[2],r=e[4],a=e[1],o=e[3],s=e[5],l=n*o-a*i;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-o*r)*l,t[5]=(a*r-n*s)*l,t):null},e.clone=function(t){var e=i();return a(e,t),e}},function(t,e,n){var i=n(12),r=1e-4,a=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function o(t){return Math.floor(Math.log(t)/Math.LN10)}e.linearMap=function(t,e,n,i){var r=e[1]-e[0],a=n[1]-n[0];if(0===r)return 0===a?n[0]:(n[0]+n[1])/2;if(i)if(r>0){if(t<=e[0])return n[0];if(t>=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*a+n[0]},e.parsePercent=function(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?(n=t,n.replace(/^\s+/,"").replace(/\s+$/,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var n},e.round=function(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t},e.asc=function(t){return t.sort((function(t,e){return t-e})),t},e.getPrecision=function(t){if(t=+t,isNaN(t))return 0;for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n},e.getPrecisionSafe=function(t){var e=t.toString(),n=e.indexOf("e");if(n>0){var i=+e.slice(n+1);return i<0?-i:0}var r=e.indexOf(".");return r<0?0:e.length-1-r},e.getPixelPrecision=function(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),a=Math.round(n(Math.abs(e[1]-e[0]))/i),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20},e.getPercentWithPrecision=function(t,e,n){if(!t[e])return 0;var r=i.reduce(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===r)return 0;for(var a=Math.pow(10,n),o=i.map(t,(function(t){return(isNaN(t)?0:t)/r*a*100})),s=100*a,l=i.map(o,(function(t){return Math.floor(t)})),u=i.reduce(l,(function(t,e){return t+e}),0),c=i.map(o,(function(t,e){return t-l[e]}));u<s;){for(var h=Number.NEGATIVE_INFINITY,d=null,f=0,p=c.length;f<p;++f)c[f]>h&&(h=c[f],d=f);++l[d],c[d]=0,++u}return l[e]/a},e.MAX_SAFE_INTEGER=9007199254740991,e.remRadian=function(t){var e=2*Math.PI;return(t%e+e)%e},e.isRadianAroundZero=function(t){return t>-1e-4&&t<r},e.parseDate=function(t){if(t instanceof Date)return t;if("string"==typeof t){var e=a.exec(t);if(!e)return new Date(NaN);if(e[8]){var n=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(n-=e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,n,+(e[5]||0),+e[6]||0,+e[7]||0))}return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,+e[7]||0)}return null==t?new Date(NaN):new Date(Math.round(t))},e.quantity=function(t){return Math.pow(10,o(t))},e.nice=function(t,e){var n=o(t),i=Math.pow(10,n),r=t/i;return t=(e?r<1.5?1:r<2.5?2:r<4?3:r<7?5:10:r<1?1:r<2?2:r<3?3:r<5?5:10)*i,n>=-20?+t.toFixed(n<0?-n:0):t},e.reformIntervals=function(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-1/0,n=1,i=0;i<t.length;){for(var r=t[i].interval,a=t[i].close,o=0;o<2;o++)r[o]<=e&&(r[o]=e,a[o]=o?1:1-n),e=r[o],n=a[o];r[0]===r[1]&&a[0]*a[1]!=1?t.splice(i,1):i++}return t;function s(t,e,n){return t.interval[n]<e.interval[n]||t.interval[n]===e.interval[n]&&(t.close[n]-e.close[n]==(n?-1:1)||!n&&s(t,e,1))}},e.isNumeric=function(t){return t-parseFloat(t)>=0}},function(t,e,n){"use strict";var i=n(5),r=n(11),a=n(21),o=function(){this._pool={},this._allocatedTextures=[]};o.prototype={constructor:o,get:function(t){var e=u(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]);var n=this._pool[e];if(!n.length){var r=new i.a(t);return this._allocatedTextures.push(r),r}return n.pop()},put:function(t){var e=u(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]),this._pool[e].push(t)},clear:function(t){for(var e=0;e<this._allocatedTextures.length;e++)this._allocatedTextures[e].dispose(t);this._pool={},this._allocatedTextures=[]}};var s={width:512,height:512,type:r.a.UNSIGNED_BYTE,format:r.a.RGBA,wrapS:r.a.CLAMP_TO_EDGE,wrapT:r.a.CLAMP_TO_EDGE,minFilter:r.a.LINEAR_MIPMAP_LINEAR,magFilter:r.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},l=Object.keys(s);function u(t){var e,n,i,o;a.a.defaultsWithPropList(t,s,l),n=(e=t).width,i=e.height,o=0==(n&n-1)&&0==(i&i-1),e.format===r.a.DEPTH_COMPONENT&&(e.useMipmap=!1),o&&e.useMipmap||(e.minFilter==r.a.NEAREST_MIPMAP_NEAREST||e.minFilter==r.a.NEAREST_MIPMAP_LINEAR?e.minFilter=r.a.NEAREST:e.minFilter!=r.a.LINEAR_MIPMAP_LINEAR&&e.minFilter!=r.a.LINEAR_MIPMAP_NEAREST||(e.minFilter=r.a.LINEAR)),o||(e.wrapS=r.a.CLAMP_TO_EDGE,e.wrapT=r.a.CLAMP_TO_EDGE);for(var u="",c=0;c<l.length;c++)u+=t[l[c]].toString();return u}e.a=o},function(t,e,n){"use strict";var i=n(0),r=n.n(i);e.a={getFilledRegions:function(t,e){var n,i=(t||[]).slice();if("string"==typeof e?n=(e=r.a.getMap(e))&&e.geoJson:e&&e.features&&(n=e),!n)return console.error("Map "+e+" not exists. You can download map file on http://echarts.baidu.com/download-map.html"),n.features||console.error("Invalid GeoJSON for map3D"),[];for(var a={},o=n.features,s=0;s<i.length;s++)a[i[s].name]=i[s];for(s=0;s<o.length;s++){var l=o[s].properties.name;a[l]||i.push({name:l})}return i},defaultOption:{show:!0,zlevel:-10,map:"",left:0,top:0,width:"100%",height:"100%",boxWidth:100,boxHeight:10,boxDepth:"auto",regionHeight:3,environment:"auto",groundPlane:{show:!1,color:"#aaa"},shading:"lambert",light:{main:{alpha:40,beta:30}},viewControl:{alpha:40,beta:0,distance:100,orthographicSize:60,minAlpha:5,minBeta:-80,maxBeta:80},label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}}},function(t,e,n){"use strict";function i(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function r(t,e,n,r,a){var o=n,s=t[e];i(t,e,r);for(var l=n;l<r;l++)a(t[l],s)<0&&(i(t,l,o),o++);return i(t,r,o),o}function a(t,e,n,i){if(n<i){var o=r(t,Math.floor((n+i)/2),n,i,e);a(t,e,n,o-1),a(t,e,o+1,i)}}function o(){this._parts=[]}o.prototype.step=function(t,e,n){var i=t.length;if(0===n){this._parts=[],this._sorted=!1;var o=Math.floor(i/2);this._parts.push({pivot:o,left:0,right:i-1}),this._currentSortPartIdx=0}if(!this._sorted){var s=this._parts;if(0===s.length)return this._sorted=!0,!0;if(s.length<512){for(var l=0;l<s.length;l++)s[l].pivot=r(t,s[l].pivot,s[l].left,s[l].right,e);var u=[];for(l=0;l<s.length;l++){var c,h=s[l].left;(c=s[l].pivot-1)>h&&u.push({pivot:Math.floor((c+h)/2),left:h,right:c}),h=s[l].pivot+1,(c=s[l].right)>h&&u.push({pivot:Math.floor((c+h)/2),left:h,right:c})}s=this._parts=u}else for(l=0;l<Math.floor(s.length/10);l++){var d=s.length-1-this._currentSortPartIdx;if(a(t,e,s[d].left,s[d].right),this._currentSortPartIdx++,this._currentSortPartIdx===s.length)return this._sorted=!0,!0}return!1}},o.sort=a,e.a=o},function(t,e,n){"use strict";var i=n(83),r=n(0),a=n.n(r),o=n(41),s=n.n(o),l=n(20),u=n(3);function c(t,e){var n=t.getBoxLayoutParams(),i=s.a.getLayoutRect(n,{width:e.getWidth(),height:e.getHeight()});i.y=e.getHeight()-i.y-i.height,this.viewGL.setViewport(i.x,i.y,i.width,i.height,e.getDevicePixelRatio());var r=this.getGeoBoundingRect(),a=r.width/r.height*(t.get("aspectScale")||.75),o=t.get("boxWidth"),l=t.get("boxDepth"),u=t.get("boxHeight");null==u&&(u=5),isNaN(o)&&isNaN(l)&&(o=100),isNaN(l)?l=o/a:isNaN(o)&&(o=l/a),this.setSize(o,u,l),this.regionHeight=t.get("regionHeight"),this.altitudeAxis&&this.altitudeAxis.setExtent(0,Math.max(u-this.regionHeight,0))}function h(t,e){var n=[1/0,-1/0];if(t.eachSeries((function(t){if(t.coordinateSystem===this&&"series.map3D"!==t.type){var e=t.getData(),i=t.coordDimToDataDim("alt")[0];if(i){var r=e.getDataExtent(i,!0);n[0]=Math.min(n[0],r[0]),n[1]=Math.max(n[1],r[1])}}}),this),n&&isFinite(n[1]-n[0])){var i=a.a.helper.createScale(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new a.a.Axis("altitude",i),this.resize(this.model,e)}}var d=function(t){console.error("Map "+t+" not exists. You can download map file on http://echarts.baidu.com/download-map.html")},f=0,p={dimensions:i.a.prototype.dimensions,create:function(t,e){var n=[];if(!a.a.getMap)throw new Error("geo3D component depends on geo component");function i(t,i){var r=p.createGeo3D(t);t.__viewGL=t.__viewGL||new l.a,r.viewGL=t.__viewGL,t.coordinateSystem=r,r.model=t,n.push(r),r.resize=c,r.resize(t,e),r.update=h}return t.eachComponent("geo3D",(function(t,e){i(t)})),t.eachSeriesByType("map3D",(function(t,e){var n=t.get("coordinateSystem");null==n&&(n="geo3D"),"geo3D"===n&&i(t)})),t.eachSeries((function(e){if("geo3D"===e.get("coordinateSystem")){if("series.map3D"===e.type)return;var n=e.getReferringComponents("geo3D")[0];if(n||(n=t.getComponent("geo3D")),!n)throw new Error('geo "'+u.a.firstNotNull(e.get("geo3DIndex"),e.get("geo3DId"),0)+'" not found');e.coordinateSystem=n.coordinateSystem}})),n},createGeo3D:function(t){var e,n=t.get("map");if("string"==typeof n?(e=n,n=a.a.getMap(n)):n&&n.features&&(n={geoJson:n}),n||d(n),!n.geoJson.features)throw new Error("Invalid GeoJSON for map3D");return null==e&&(e="GEO_ANONYMOUS_"+f++),new i.a(e+f++,e,n&&n.geoJson,n&&n.specialAreas,t.get("nameMap"))}};a.a.registerCoordinateSystem("geo3D",p),e.a=p},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(1),o=n.n(a),s=n(187),l=n.n(s),u=n(188),c=n.n(u),h=o.a.vec3,d=o.a.mat4,f=[l.a,c.a];function p(t,e,n,i,r){this.name=t,this.map=e,this.regionHeight=0,this.regions=[],this._nameCoordMap={},this.loadGeoJson(n,i,r),this.transform=d.identity(new Float64Array(16)),this.invTransform=d.identity(new Float64Array(16)),this.extrudeY=!0,this.altitudeAxis}p.prototype={constructor:p,type:"geo3D",dimensions:["lng","lat","alt"],containPoint:function(){},loadGeoJson:function(t,e,n){var i=r.a.parseGeoJSON||r.a.parseGeoJson;try{this.regions=t?i(t):[]}catch(t){throw"Invalid geoJson format\n"+t}e=e||{},n=n||{};for(var a=this.regions,o={},s=0;s<a.length;s++){var l=a[s].name;l=n[l]||l,a[s].name=l,o[l]=a[s],this.addGeoCoord(l,a[s].center);var u=e[l];u&&a[s].transformTo(u.left,u.top,u.width,u.height)}this._regionsMap=o,this._geoRect=null,f.forEach((function(t){t(this)}),this)},getGeoBoundingRect:function(){if(this._geoRect)return this._geoRect;for(var t,e=this.regions,n=0;n<e.length;n++){var i=e[n].getBoundingRect();(t=t||i.clone()).union(i)}return this._geoRect=t||new r.a.graphic.BoundingRect(0,0,0,0)},addGeoCoord:function(t,e){this._nameCoordMap[t]=e},getRegion:function(t){return this._regionsMap[t]},getRegionByCoord:function(t){for(var e=this.regions,n=0;n<e.length;n++)if(e[n].contain(t))return e[n]},setSize:function(t,e,n){this.size=[t,e,n];var i=this.getGeoBoundingRect(),r=t/i.width,a=-n/i.height,o=-t/2-i.x*r,s=n/2-i.y*a,l=this.extrudeY?[o,0,s]:[o,s,0],u=this.extrudeY?[r,1,a]:[r,a,1],c=this.transform;d.identity(c),d.translate(c,c,l),d.scale(c,c,u),d.invert(this.invTransform,c)},dataToPoint:function(t,e){e=e||[];var n=this.extrudeY?1:2,i=this.extrudeY?2:1,r=t[2];return isNaN(r)&&(r=0),e[0]=t[0],e[i]=t[1],this.altitudeAxis?e[n]=this.altitudeAxis.dataToCoord(r):e[n]=0,e[n]+=this.regionHeight,h.transformMat4(e,e,this.transform),e},pointToData:function(t,e){}},e.a=p},function(t,e,n){"use strict";var i=n(77),r=n.n(i),a=n(76),o=n.n(a);function s(t){this.viewGL=t}s.prototype.reset=function(t,e){this._updateCamera(e.getWidth(),e.getHeight(),e.getDevicePixelRatio()),this._viewTransform=r.a.create(),this.updateTransform(t,e)},s.prototype.updateTransform=function(t,e){var n=t.coordinateSystem;n.getRoamTransform&&(r.a.invert(this._viewTransform,n.getRoamTransform()),this._setCameraTransform(this._viewTransform),e.getZr().refresh())},s.prototype.dataToPoint=function(t,e,n){n=t.dataToPoint(e,null,n);var i=this._viewTransform;i&&o.a.applyTransform(n,n,i)},s.prototype.removeTransformInPoint=function(t){return this._viewTransform&&o.a.applyTransform(t,t,this._viewTransform),t},s.prototype.getZoom=function(){if(this._viewTransform){var t=this._viewTransform;return 1/Math.max(Math.sqrt(t[0]*t[0]+t[1]*t[1]),Math.sqrt(t[2]*t[2]+t[3]*t[3]))}return 1},s.prototype._setCameraTransform=function(t){var e=this.viewGL.camera;e.position.set(t[4],t[5],0),e.scale.set(Math.sqrt(t[0]*t[0]+t[1]*t[1]),Math.sqrt(t[2]*t[2]+t[3]*t[3]),1)},s.prototype._updateCamera=function(t,e,n){this.viewGL.setViewport(0,0,t,e,n);var i=this.viewGL.camera;i.left=i.top=0,i.bottom=e,i.right=t,i.near=0,i.far=100},e.a=s},function(t,e,n){(function(t){var n;"undefined"!=typeof window?n=window.__DEV__:void 0!==t&&(n=t.__DEV__),void 0===n&&(n=!0);var i=n;e.__DEV__=i}).call(e,n(243))},function(t,e,n){"use strict";var i,r,a,o,s,l,u,c=n(13),h=n(0),d=n.n(h),f=n(33),p=n(1),g=n.n(p).a.vec2,m=[[0,0],[1,1]],v=c.a.extend((function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new c.a.Attribute("position","float",2,"POSITION"),normal:new c.a.Attribute("normal","float",2),offset:new c.a.Attribute("offset","float",1),color:new c.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(t){var e=this.attributes;this.vertexCount!==t&&(e.position.init(t),e.color.init(t),this.useNativeLine||(e.offset.init(t),e.normal.init(t)),t>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(t){this.triangleCount!==t&&(this.indices=0===t?null:this.vertexCount>65535?new Uint32Array(3*t):new Uint16Array(3*t))},_getCubicCurveApproxStep:function(t,e,n,i){return 1/(g.dist(t,e)+g.dist(n,e)+g.dist(i,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(m)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(m)},getPolylineVertexCount:function(t){var e;return e="number"==typeof t?t:"number"!=typeof t[0]?t.length:t.length/2,this.useNativeLine?2*(e-1):2*(e-1)+2},getPolylineTriangleCount:function(t){var e;return e="number"==typeof t?t:"number"!=typeof t[0]?t.length:t.length/2,this.useNativeLine?0:2*(e-1)},addCubicCurve:function(t,e,n,i,r,a){null==a&&(a=1);var o=t[0],s=t[1],l=e[0],u=e[1],c=n[0],h=n[1],d=i[0],f=i[1],p=this._getCubicCurveApproxStep(t,e,n,i),g=p*p,m=g*p,v=3*p,y=3*g,x=6*g,b=6*m,_=o-2*l+c,E=s-2*u+h,w=3*(l-c)-o+d,T=3*(u-h)-s+f,S=o,M=s,C=(l-o)*v+_*y+w*m,A=(u-s)*v+E*y+T*m,O=_*x+w*b,N=E*x+T*b,P=w*b,L=T*b,R=0,D=0,k=Math.ceil(1/p),I=new Float32Array(3*(k+1)),B=(I=[],0);for(D=0;D<k+1;D++)I[B++]=S,I[B++]=M,S+=C,M+=A,C+=O,A+=N,O+=P,N+=L,(R+=p)>1&&(S=C>0?Math.min(S,d):Math.max(S,d),M=A>0?Math.min(M,f):Math.max(M,f));this.addPolyline(I,r,a)},addLine:function(t,e,n,i){this.addPolyline([t,e],n,i)},addPolyline:(i=g.create(),r=g.create(),a=g.create(),o=g.create(),s=[],l=[],u=[],function(t,e,n,c,h){if(t.length){var d="number"!=typeof t[0];if(null==h&&(h=d?t.length:t.length/2),!(h<2)){null==c&&(c=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);for(var f,p=d?"number"!=typeof e[0]:e.length/4===h,m=this.attributes.position,v=this.attributes.color,y=this.attributes.offset,x=this.attributes.normal,b=this.indices,_=this._vertexOffset,E=0;E<h;E++){if(d)s=t[E+c],f=p?e[E+c]:e;else{var w=2*E+c;if((s=s||[])[0]=t[w],s[1]=t[w+1],p){var T=4*E+c;(f=f||[])[0]=e[T],f[1]=e[T+1],f[2]=e[T+2],f[3]=e[T+3]}else f=e}if(this.useNativeLine)E>1&&(m.copy(_,_-1),v.copy(_,_-1),_++);else{var S;if(E<h-1)if(d?g.copy(l,t[E+1]):(w=2*(E+1)+c,(l=l||[])[0]=t[w],l[1]=t[w+1]),E>0){g.sub(i,s,u),g.sub(r,l,s),g.normalize(i,i),g.normalize(r,r),g.add(o,i,r),g.normalize(o,o);var M=n/2*Math.min(1/g.dot(i,o),2);a[0]=-o[1],a[1]=o[0],S=M}else g.sub(i,l,s),g.normalize(i,i),a[0]=-i[1],a[1]=i[0],S=n/2;else g.sub(i,s,u),g.normalize(i,i),a[0]=-i[1],a[1]=i[0],S=n/2;x.set(_,a),x.set(_+1,a),y.set(_,S),y.set(_+1,-S),g.copy(u,s),m.set(_,s),m.set(_+1,s),v.set(_,f),v.set(_+1,f),_+=2}if(this.useNativeLine)v.set(_,f),m.set(_,s),_++;else if(E>0){var C=3*this._faceOffset;(b=this.indices)[C]=_-4,b[C+1]=_-3,b[C+2]=_-2,b[C+3]=_-3,b[C+4]=_-1,b[C+5]=_-2,this._faceOffset+=2}}this._vertexOffset=_}}}),setItemColor:function(t,e){for(var n=this._itemVertexOffsets[t],i=t<this._itemVertexOffsets.length-1?this._itemVertexOffsets[t+1]:this._vertexOffset,r=n;r<i;r++)this.attributes.color.set(r,e);this.dirty("color")}});d.a.util.defaults(v.prototype,f.a),e.a=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(88),n(133),n(183),n(189),n(195),n(202),n(209),n(213),n(220),n(226),n(229),n(233),n(236),n(239),n(253),n(259)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(89),o=n(90),s=n(101),l=n(2),u={echarts:"4.0.0",claygl:"1.0.0"};function c(t,e){t.replace(".","")-0<u[e].replace(".","")-0&&function(t){throw new Error(t+" version is too old, needs "+u[t]+" or higher")}(e),console.log("Loaded "+e+", version "+t)}function h(t){this._layers={},this._zr=t}c(a.a,"claygl"),c(r.a.version,"echarts"),h.prototype.update=function(t,e){var n=this,i=e.getZr();if(i.getWidth()&&i.getHeight()){for(var a in this._layers)this._layers[a].removeViewsAll();t.eachComponent((function(n,i){if("series"!==n){var r=e.getViewOfComponentModel(i),a=i.coordinateSystem;if(r.__ecgl__){if(a){if(!a.viewGL)return void console.error("Can't find viewGL in coordinateSystem of component "+i.id);o=a.viewGL}else{if(!i.viewGL)return void console.error("Can't find viewGL of component "+i.id);o=a.viewGL}var o=a.viewGL,u=s(i);u.addView(o),r.afterRender&&r.afterRender(i,t,e,u),l(r.groupGL,i.get("silent"))}}})),t.eachSeries((function(n){var i=e.getViewOfSeriesModel(n),r=n.coordinateSystem;if(i.__ecgl__){if(r&&!r.viewGL&&!i.viewGL)return void console.error("Can't find viewGL of series "+i.id);var a=r&&r.viewGL||i.viewGL,o=s(n);o.addView(a),i.afterRender&&i.afterRender(n,t,e,o),l(i.groupGL,n.get("silent"))}}))}else console.warn("Dom has no width or height");function s(t){var e;t.coordinateSystem&&t.coordinateSystem.model,e=t.get("zlevel");var a=n._layers,s=a[e];if(!s){if(s=a[e]=new o.a("gl-"+e,i),i.painter.isSingleCanvas()){s.virtual=!0;var l=new r.a.graphic.Image({z:1e4,style:{image:s.renderer.canvas},silent:!0});s.__hostImage=l,i.add(l)}i.painter.insertLayer(e,s)}return s.__hostImage&&s.__hostImage.setStyle({width:s.renderer.getWidth(),height:s.renderer.getHeight()}),s}function l(t,e){t&&t.traverse((function(t){t.isRenderable&&t.isRenderable()&&(t.ignorePicking=null!=t.$ignorePicking?t.$ignorePicking:e)}))}};var d=r.a.init;r.a.init=function(){var t=d.apply(this,arguments);return t.getZr().painter.getRenderedCanvas=function(t){if(t=t||{},this._singleCanvas)return this._layers[0].dom;var e=document.createElement("canvas"),n=t.pixelRatio||this.dpr;e.width=this.getWidth()*n,e.height=this.getHeight()*n;var i=e.getContext("2d");i.dpr=n,i.clearRect(0,0,e.width,e.height),t.backgroundColor&&(i.fillStyle=t.backgroundColor,i.fillRect(0,0,e.width,e.height));var r,a=this.storage.getDisplayList(!0),o={},s=this;function l(t,e){var n,r=s._zlevelList;null==t&&(t=-1/0);for(var a=0;a<r.length;a++){var o=r[a],l=s._layers[o];if(!l.__builtin__&&o>t&&o<e){n=l;break}}n&&n.renderToCanvas&&(i.save(),n.renderToCanvas(i),i.restore())}for(var u={ctx:i},c=0;c<a.length;c++){var h=a[c];h.zlevel!==r&&(l(r,h.zlevel),r=h.zlevel),this._doPaintEl(h,u,!0,o)}return l(r,1/0),e},t},r.a.registerPostUpdate((function(t,e){var n=e.getZr();(n.__egl=n.__egl||new h(n)).update(t,e)})),r.a.registerPreprocessor(s.a),r.a.graphicGL=l.a},function(t,e,n){"use strict";e.a="1.0.0"},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(46),o=n(100),s=n(6),l=n(47),u=n(65),c=n.n(u),h=function(t,e){this.id=t,this.zr=e;try{this.renderer=new a.a({clearBit:0,devicePixelRatio:e.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(e.painter.getWidth(),e.painter.getHeight())}catch(t){return this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does support WebGL",void console.error(t)}this.onglobalout=this.onglobalout.bind(this),e.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var n=this.dom.style;n.position="absolute",n.left="0",n.top="0",this.views=[],this._picking=new o.a({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new r.a.graphic.Rect({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0})};function d(t){var e=t.__zr;t.__zr=null,e&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(e)}h.prototype.addView=function(t){if(t.layer!==this){var e=this._viewsToDispose.indexOf(t);e>=0&&this._viewsToDispose.splice(e,1),this.views.push(t),t.layer=this;var n=this.zr;t.scene.traverse((function(t){t.__zr=n,t.addAnimatorsToZr&&t.addAnimatorsToZr(n)}))}},h.prototype.removeView=function(t){if(t.layer===this){var e=this.views.indexOf(t);e>=0&&(this.views.splice(e,1),t.scene.traverse(d,this),t.layer=null,this._viewsToDispose.push(t))}},h.prototype.removeViewsAll=function(){this.views.forEach((function(t){t.scene.traverse(d,this),t.layer=null,this._viewsToDispose.push(t)}),this),this.views.length=0},h.prototype.resize=function(t,e){this.renderer.resize(t,e)},h.prototype.clear=function(){var t=this.renderer.gl;t.clearColor(0,0,0,0),t.depthMask(!0),t.colorMask(!0,!0,!0,!0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT)},h.prototype.clearDepth=function(){var t=this.renderer.gl;t.clear(t.DEPTH_BUFFER_BIT)},h.prototype.clearColor=function(){var t=this.renderer.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},h.prototype.needsRefresh=function(){this.zr.refresh()},h.prototype.refresh=function(){for(var t=0;t<this.views.length;t++)this.views[t].prepareRender();for(this._doRender(!1),this._trackAndClean(),t=0;t<this._viewsToDispose.length;t++)this._viewsToDispose[t].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()},h.prototype.renderToCanvas=function(t){this._startAccumulating(!0),t.drawImage(this.dom,0,0,t.canvas.width,t.canvas.height)},h.prototype._doRender=function(t){this.clear(),this.renderer.saveViewport();for(var e=0;e<this.views.length;e++)this.views[e].render(this.renderer,t);this.renderer.restoreViewport()},h.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var f=1;function p(t){for(var e=0;e<t.length;e++)t[e].__used__=0}function g(t,e){for(var n=0;n<e.length;n++)e[n].__used__||e[n].dispose(t)}function m(t,e){t.__used__=t.__used__||0,t.__used__++,1===t.__used__&&e.push(t)}function v(t,e,n){function i(t){for(var i,r,a=0;a<t.length;a++){var o=t[a],l=o.geometry,u=o.material;if(u!==i)for(var c=u.getTextureUniforms(),h=0;h<c.length;h++){var d=c[h],f=u.uniforms[d].value;if(f)if(f instanceof s.a)m(f,e);else if(f instanceof Array)for(var p=0;p<f.length;p++)f[p]instanceof s.a&&m(f[p],e)}l!==r&&m(l,n),i=u,r=l}}i(t.opaqueList),i(t.transparentList);for(var r=0;r<t.lights.length;r++)t.lights[r].cubemap&&m(t.lights[r].cubemap,e)}h.prototype._startAccumulating=function(t){var e=this;this._stopAccumulating();for(var n=!1,i=0;i<this.views.length;i++)n=this.views[i].needsAccumulate()||n;function r(i){if(e._accumulatingId&&i===e._accumulatingId){for(var a=!0,o=0;o<e.views.length;o++)a=e.views[o].isAccumulateFinished()&&n;a||(e._doRender(!0),t?r(i):c()((function(){r(i)})))}}n&&(this._accumulatingId=f++,t?r(e._accumulatingId):this._accumulatingTimeout=setTimeout((function(){r(e._accumulatingId)}),50))},h.prototype._trackAndClean=function(){var t=[],e=[];this._textureList&&(p(this._textureList),p(this._geometriesList));for(var n=0;n<this.views.length;n++)v(this.views[n].scene,t,e);this._textureList&&(g(this.renderer,this._textureList),g(this.renderer,this._geometriesList)),this._textureList=t,this._geometriesList=e},h.prototype.dispose=function(){this._stopAccumulating(),this.renderer.disposeScene(this.scene),this.zr.off("globalout",this.onglobalout)},h.prototype.onmousedown=function(t){if(!t.target||!t.target.__isGLToZRProxy){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY);e&&(this._dispatchEvent("mousedown",t,e),this._dispatchDataEvent("mousedown",t,e)),this._downX=t.offsetX,this._downY=t.offsetY}},h.prototype.onmousemove=function(t){if(!t.target||!t.target.__isGLToZRProxy){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY),n=e&&e.target,i=this._hovered;this._hovered=e,i&&n!==i.target&&(i.relatedTarget=n,this._dispatchEvent("mouseout",t,i),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",t,e),e&&(this.zr.setCursorStyle("pointer"),i&&n===i.target||this._dispatchEvent("mouseover",t,e)),this._dispatchDataEvent("mousemove",t,e)}},h.prototype.onmouseup=function(t){if(!t.target||!t.target.__isGLToZRProxy){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY);e&&(this._dispatchEvent("mouseup",t,e),this._dispatchDataEvent("mouseup",t,e)),this._upX=t.offsetX,this._upY=t.offsetY}},h.prototype.onclick=h.prototype.dblclick=function(t){if(!t.target||!t.target.__isGLToZRProxy){var e=this._upX-this._downX,n=this._upY-this._downY;if(!(Math.sqrt(e*e+n*n)>20)){t=t.event;var i=this.pickObject(t.offsetX,t.offsetY);i&&(this._dispatchEvent(t.type,t,i),this._dispatchDataEvent(t.type,t,i));var r=this._clickToSetFocusPoint(t);r&&r.view.setDOFFocusOnPoint(r.distance)&&this.zr.refresh()}}},h.prototype._clickToSetFocusPoint=function(t){for(var e=this.renderer,n=e.viewport,i=this.views.length-1;i>=0;i--){var r=this.views[i];if(r.hasDOF()&&r.containPoint(t.offsetX,t.offsetY)){this._picking.scene=r.scene,this._picking.camera=r.camera,e.viewport=r.viewport;var a=this._picking.pick(t.offsetX,t.offsetY,!0);if(a)return a.view=r,a}}e.viewport=n},h.prototype.onglobalout=function(t){var e=this._hovered;e&&this._dispatchEvent("mouseout",t,{target:e.target})},h.prototype.pickObject=function(t,e){for(var n=[],i=this.renderer,r=i.viewport,a=0;a<this.views.length;a++){var o=this.views[a];o.containPoint(t,e)&&(this._picking.scene=o.scene,this._picking.camera=o.camera,i.viewport=o.viewport,this._picking.pickAll(t,e,n))}return i.viewport=r,n.sort((function(t,e){return t.distance-e.distance})),n[0]},h.prototype._dispatchEvent=function(t,e,n){n||(n={});var i=n.target;for(n.cancelBubble=!1,n.event=e,n.type=t,n.offsetX=e.offsetX,n.offsetY=e.offsetY;i&&(i.trigger(t,n),i=i.getParent(),!n.cancelBubble););this._dispatchToView(t,n)},h.prototype._dispatchDataEvent=function(t,e,n){var i=n&&n.target,r=i&&i.dataIndex,a=i&&i.seriesIndex,o=i&&i.eventData,s=!1,l=this._zrEventProxy;l.position=[e.offsetX,e.offsetY],l.update();var u={target:l};"mousemove"===t&&(null!=r?r!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(l.dataIndex=this._lastDataIndex,l.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0):null!=o&&o!==this._lastEventData&&(null!=this._lastEventData&&(l.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0),this._lastEventData=o,this._lastDataIndex=r,this._lastSeriesIndex=a),l.eventData=o,l.dataIndex=r,l.seriesIndex=a,(null!=o||parseInt(r,10)>=0)&&(this.zr.handler.dispatchToElement(u,t,e),s&&this.zr.handler.dispatchToElement(u,"mouseover",e))},h.prototype._dispatchToView=function(t,e){for(var n=0;n<this.views.length;n++)this.views[n].containPoint(e.offsetX,e.offsetY)&&this.views[n].trigger(t,e)},r.a.util.extend(h.prototype,l.a),e.a=h},function(t,e,n){"use strict";function i(t,e,n){"object"==typeof e&&(n=e,e=null);var i,o=this;if(!(t instanceof Function))for(var s in i=[],t)t.hasOwnProperty(s)&&i.push(s);var l=function(e){if(o.apply(this,arguments),t instanceof Function?r(this,t.call(this,e)):a(this,t,i),this.constructor===l)for(var n=l.__initializers__,s=0;s<n.length;s++)n[s].apply(this,arguments)};l.__super__=o,o.__initializers__?l.__initializers__=o.__initializers__.slice():l.__initializers__=[],e&&l.__initializers__.push(e);var u=function(){};return u.prototype=o.prototype,l.prototype=new u,l.prototype.constructor=l,r(l.prototype,n),l.extend=o.extend,l.derive=o.extend,l}function r(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function a(t,e,n){for(var i=0;i<n.length;i++){var r=n[i];t[r]=e[r]}}e.a={extend:i,derive:i}},function(t,e,n){"use strict";var i=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB"],r=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];e.a=function(t){for(var e={},n={},a=0;a<i.length;a++)s(i[a]);for(a=0;a<r.length;a++){var o=r[a];n[o]=t.getParameter(t[o])}function s(n){var i=t.getExtension(n);i||(i=t.getExtension("MOZ_"+n)),i||(i=t.getExtension("WEBKIT_"+n)),e[n]=i}this.getExtension=function(t){return t in e||s(t),e[t]},this.getParameter=function(t){return n[t]}}},function(t,e,n){"use strict";var i=n(94),r={},a={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function o(t){return(t=Math.round(t))<0?0:t>255?255:t}function s(t){return t<0?0:t>1?1:t}function l(t){return t.length&&"%"===t.charAt(t.length-1)?o(parseFloat(t)/100*255):o(parseInt(t,10))}function u(t){return t.length&&"%"===t.charAt(t.length-1)?s(parseFloat(t)/100):s(parseFloat(t))}function c(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function h(t,e,n){return t+(e-t)*n}function d(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var p=new i.a(20),g=null;function m(t,e){g&&f(g,e),g=p.put(t,g||e.slice())}function v(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=u(t[1]),r=u(t[2]),a=r<=.5?r*(i+1):r+i-r*i,s=2*r-a;return d(e=e||[],o(255*c(s,a,n+1/3)),o(255*c(s,a,n)),o(255*c(s,a,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}r.parse=function(t,e){if(t){e=e||[];var n=p.get(t);if(n)return f(e,n);var i,r=(t+="").replace(/ /g,"").toLowerCase();if(r in a)return f(e,a[r]),m(t,e),e;if("#"===r.charAt(0))return 4===r.length?(i=parseInt(r.substr(1),16))>=0&&i<=4095?(d(e,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1),m(t,e),e):void d(e,0,0,0,1):7===r.length?(i=parseInt(r.substr(1),16))>=0&&i<=16777215?(d(e,(16711680&i)>>16,(65280&i)>>8,255&i,1),m(t,e),e):void d(e,0,0,0,1):void 0;var o=r.indexOf("("),s=r.indexOf(")");if(-1!==o&&s+1===r.length){var c=r.substr(0,o),h=r.substr(o+1,s-(o+1)).split(","),g=1;switch(c){case"rgba":if(4!==h.length)return void d(e,0,0,0,1);g=u(h.pop());case"rgb":return 3!==h.length?void d(e,0,0,0,1):(d(e,l(h[0]),l(h[1]),l(h[2]),g),m(t,e),e);case"hsla":return 4!==h.length?void d(e,0,0,0,1):(h[3]=u(h[3]),v(h,e),m(t,e),e);case"hsl":return 3!==h.length?void d(e,0,0,0,1):(v(h,e),m(t,e),e);default:return}}d(e,0,0,0,1)}},r.parseToFloat=function(t,e){if(e=r.parse(t,e))return e[0]/=255,e[1]/=255,e[2]/=255,e},r.lift=function(t,e){var n=r.parse(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0;return r.stringify(n,4===n.length?"rgba":"rgb")}},r.toHex=function(t){var e=r.parse(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},r.fastLerp=function(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),a=Math.ceil(i),l=e[r],u=e[a],c=i-r;return n[0]=o(h(l[0],u[0],c)),n[1]=o(h(l[1],u[1],c)),n[2]=o(h(l[2],u[2],c)),n[3]=s(h(l[3],u[3],c)),n}},r.fastMapToColor=r.fastLerp,r.lerp=function(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),a=Math.floor(i),l=Math.ceil(i),u=r.parse(e[a]),c=r.parse(e[l]),d=i-a,f=r.stringify([o(h(u[0],c[0],d)),o(h(u[1],c[1],d)),o(h(u[2],c[2],d)),s(h(u[3],c[3],d))],"rgba");return n?{color:f,leftIndex:a,rightIndex:l,value:i}:f}},r.mapToColor=r.lerp,r.modifyHSL=function(t,e,n,i){if(t=r.parse(t))return t=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,a=t[2]/255,o=Math.min(i,r,a),s=Math.max(i,r,a),l=s-o,u=(s+o)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+o):l/(2-s-o);var c=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;i===s?e=d-h:r===s?e=1/3+c-d:a===s&&(e=2/3+h-c),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}(t),null!=e&&(t[0]=(a=e,(a=Math.round(a))<0?0:a>360?360:a)),null!=n&&(t[1]=u(n)),null!=i&&(t[2]=u(i)),r.stringify(v(t),"rgba");var a},r.modifyAlpha=function(t,e){if((t=r.parse(t))&&null!=e)return t[3]=s(e),r.stringify(t,"rgba")},r.stringify=function(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}},e.a=r},function(t,e,n){"use strict";var i=n(95),r=function(t){this._list=new i.a,this._map={},this._maxSize=t||10};r.prototype.setMaxSize=function(t){this._maxSize=t},r.prototype.put=function(t,e){if(void 0===this._map[t]){var n=this._list.length();if(n>=this._maxSize&&n>0){var i=this._list.head;this._list.remove(i),delete this._map[i.key]}var r=this._list.insert(e);r.key=t,this._map[t]=r}},r.prototype.get=function(t){var e=this._map[t];if(void 0!==e)return e!==this._list.tail&&(this._list.remove(e),this._list.insertEntry(e)),e.value},r.prototype.remove=function(t){var e=this._map[t];void 0!==e&&(delete this._map[t],this._list.remove(e))},r.prototype.clear=function(){this._list.clear(),this._map={}},e.a=r},function(t,e,n){"use strict";var i=function(){this.head=null,this.tail=null,this._length=0};i.prototype.insert=function(t){var e=new i.Entry(t);return this.insertEntry(e),e},i.prototype.insertAt=function(t,e){if(!(t<0)){for(var n=this.head,r=0;n&&r!=t;)n=n.next,r++;if(n){var a=new i.Entry(e),o=n.prev;o?(o.next=a,a.prev=o):this.head=a,a.next=n,n.prev=a}else this.insert(e)}},i.prototype.insertBeforeEntry=function(t,e){var n=new i.Entry(t),r=e.prev;r?(r.next=n,n.prev=r):this.head=n,n.next=e,e.prev=n,this._length++},i.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,this.tail=t):this.head=this.tail=t,this._length++},i.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._length--},i.prototype.removeAt=function(t){if(!(t<0)){for(var e=this.head,n=0;e&&n!=t;)e=e.next,n++;return e?(this.remove(e),e.value):void 0}},i.prototype.getHead=function(){if(this.head)return this.head.value},i.prototype.getTail=function(){if(this.tail)return this.tail.value},i.prototype.getAt=function(t){if(!(t<0)){for(var e=this.head,n=0;e&&n!=t;)e=e.next,n++;return e.value}},i.prototype.indexOf=function(t){for(var e=this.head,n=0;e;){if(e.value===t)return n;e=e.next,n++}},i.prototype.length=function(){return this._length},i.prototype.isEmpty=function(){return 0===this._length},i.prototype.forEach=function(t,e){for(var n=this.head,i=0,r=void 0!==e;n;)r?t.call(e,n.value,i):t(n.value,i),n=n.next,i++},i.prototype.clear=function(){this.tail=this.head=null,this._length=0},i.Entry=function(t){this.value=t,this.next=null,this.prev=null},e.a=i},function(t,e,n){"use strict";var i=n(97),r=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function a(t,e,n){var i={};for(var a in n)i[a+"_COUNT"]=n[a];return t.replace(r,(function(t,n,r,a){var o="";isNaN(n)&&(n=n in e?e[n]:i[n]),isNaN(r)&&(r=r in e?e[r]:i[r]);for(var s=parseInt(n);s<parseInt(r);s++)o+="{"+a.replace(/float\s*\(\s*_idx_\s*\)/g,s.toFixed(1)).replace(/_idx_/g,s)+"}";return o}))}function o(t,e,n){var i=[];if(e)for(var r in e){var a=e[r];a>0&&i.push("#define "+r.toUpperCase()+"_COUNT "+a)}if(n)for(var o=0;o<n.length;o++){var s=n[o];i.push("#define "+s.toUpperCase()+"_ENABLED")}for(var s in t){var l=t[s];null===l?i.push("#define "+s):i.push("#define "+s+" "+l.toString())}return i.join("\n")}function s(t){this._renderer=t,this._cache={}}s.prototype.getProgram=function(t,e,n){var r=this._cache,s="s"+e.shader.shaderID+"m"+e.programKey;if(n&&(s+="se"+n.getProgramKey(t.lightGroup)),t.isSkinnedMesh()&&(s+=","+t.joints.length),f=r[s])return f;var l=n?n.getLightsNumbers(t.lightGroup):{},u=this._renderer.gl,c=e.getEnabledTextures(),h="";t.isSkinnedMesh()&&(h="\n"+o({SKINNING:null,JOINT_COUNT:t.joints.length})+"\n");var d,f,p=h+o(e.vertexDefines,l,c),g=h+o(e.fragmentDefines,l,c),m=p+"\n"+e.shader.vertex,v=function(t){for(var e=[],n=0;n<t.length;n++)e.push("#extension GL_"+t[n]+" : enable");return e.join("\n")}(["OES_standard_derivatives","EXT_shader_texture_lod"])+"\n"+["precision",d=e.precision,"float"].join(" ")+";\n"+["precision",d,"int"].join(" ")+";\n"+["precision",d,"sampler2D"].join(" ")+";\n\n"+g+"\n"+e.shader.fragment,y=a(m,e.vertexDefines,l),x=a(v,e.fragmentDefines,l);(f=new i.a).uniformSemantics=e.shader.uniformSemantics,f.attributes=e.shader.attributes;var b=f.buildProgram(u,e.shader,y,x);return f.__error=b,r[s]=f,f},e.a=s},function(t,e,n){"use strict";var i=n(18),r=n(8),a={};function o(t){for(var e=t.split("\n"),n=0,i=e.length;n<i;n++)e[n]=n+1+": "+e[n];return e.join("\n")}function s(t,e,n){if(!t.getShaderParameter(e,t.COMPILE_STATUS))return[t.getShaderInfoLog(e),o(n)].join("\n")}var l=r.a.extend({uniformSemantics:{},attributes:{}},(function(){this._locations={},this._textureSlot=0,this._program=null}),{bind:function(t){this._textureSlot=0,t.gl.useProgram(this._program)},hasUniform:function(t){var e=this._locations[t];return null!=e},useTextureSlot:function(t,e,n){e&&(t.gl.activeTexture(t.gl.TEXTURE0+n),e.isRenderable()?e.bind(t):e.unbind(t))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(t){this._textureSlot=t||0},takeCurrentTextureSlot:function(t,e){var n=this._textureSlot;return this.useTextureSlot(t,e,n),this._textureSlot++,n},setUniform:function(t,e,n,r){var a=this._locations[n];if(null==a)return!1;switch(e){case"m4":t.uniformMatrix4fv(a,!1,r);break;case"2i":t.uniform2i(a,r[0],r[1]);break;case"2f":t.uniform2f(a,r[0],r[1]);break;case"3i":t.uniform3i(a,r[0],r[1],r[2]);break;case"3f":t.uniform3f(a,r[0],r[1],r[2]);break;case"4i":t.uniform4i(a,r[0],r[1],r[2],r[3]);break;case"4f":t.uniform4f(a,r[0],r[1],r[2],r[3]);break;case"1i":t.uniform1i(a,r);break;case"1f":t.uniform1f(a,r);break;case"1fv":t.uniform1fv(a,r);break;case"1iv":t.uniform1iv(a,r);break;case"2iv":t.uniform2iv(a,r);break;case"2fv":t.uniform2fv(a,r);break;case"3iv":t.uniform3iv(a,r);break;case"3fv":t.uniform3fv(a,r);break;case"4iv":t.uniform4iv(a,r);break;case"4fv":t.uniform4fv(a,r);break;case"m2":case"m2v":t.uniformMatrix2fv(a,!1,r);break;case"m3":case"m3v":t.uniformMatrix3fv(a,!1,r);break;case"m4v":if(Array.isArray(r)){for(var o=new i.a.Float32Array(16*r.length),s=0,l=0;l<r.length;l++)for(var u=r[l],c=0;c<16;c++)o[s++]=u[c];t.uniformMatrix4fv(a,!1,o)}else r instanceof i.a.Float32Array&&t.uniformMatrix4fv(a,!1,r)}return!0},setUniformOfSemantic:function(t,e,n){var i=this.uniformSemantics[e];return!!i&&this.setUniform(t,i.type,i.symbol,n)},enableAttributes:function(t,e,n){var i,r=t.gl,o=this._program,s=this._locations;(i=n?n.__enabledAttributeList:a[t.__uid__])||(i=n?n.__enabledAttributeList=[]:a[t.__uid__]=[]);for(var l=[],u=0;u<e.length;u++){var c=e[u];if(this.attributes[c]){var h=s[c];if(null==h){if(-1===(h=r.getAttribLocation(o,c))){l[u]=-1;continue}s[c]=h}l[u]=h,i[h]?i[h]=2:i[h]=1}else l[u]=-1}for(u=0;u<i.length;u++)switch(i[u]){case 1:r.enableVertexAttribArray(u),i[u]=3;break;case 2:i[u]=3;break;case 3:r.disableVertexAttribArray(u),i[u]=0}return l},buildProgram:function(t,e,n,i){var r=t.createShader(t.VERTEX_SHADER),a=t.createProgram();t.shaderSource(r,n),t.compileShader(r);var o=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(o,i),t.compileShader(o);var l=s(t,r,n);if(l)return l;if(l=s(t,o,i))return l;if(t.attachShader(a,r),t.attachShader(a,o),e.attributeSemantics.POSITION)t.bindAttribLocation(a,0,e.attributeSemantics.POSITION.symbol);else{var u=Object.keys(this.attributes);t.bindAttribLocation(a,0,u[0])}if(t.linkProgram(a),!t.getProgramParameter(a,t.LINK_STATUS))return"Could not link program\nVALIDATE_STATUS: "+t.getProgramParameter(a,t.VALIDATE_STATUS)+", gl error ["+t.getError()+"]";for(var c=0;c<e.uniforms.length;c++){var h=e.uniforms[c];this._locations[h]=t.getUniformLocation(a,h)}t.deleteShader(r),t.deleteShader(o),this._program=a,this.vertexCode=n,this.fragmentCode=i}});e.a=l},function(t,e,n){"use strict";var i=n(99),r="uniform vec3 ",a="uniform float ",o="@export clay.header.",s="@end",l=":unconfigurable;";e.a=[o+"directional_light",r+"directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+l,r+"directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+l,s,o+"ambient_light",r+"ambientLightColor[AMBIENT_LIGHT_COUNT]"+l,s,o+"ambient_sh_light",r+"ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+l,r+"ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+l,i.a,s,o+"ambient_cubemap_light",r+"ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+l,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+l,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+l,s,o+"point_light",r+"pointLightPosition[POINT_LIGHT_COUNT]"+l,a+"pointLightRange[POINT_LIGHT_COUNT]"+l,r+"pointLightColor[POINT_LIGHT_COUNT]"+l,s,o+"spot_light",r+"spotLightPosition[SPOT_LIGHT_COUNT]"+l,r+"spotLightDirection[SPOT_LIGHT_COUNT]"+l,a+"spotLightRange[SPOT_LIGHT_COUNT]"+l,a+"spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+l,a+"spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+l,a+"spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+l,r+"spotLightColor[SPOT_LIGHT_COUNT]"+l,s].join("\n")},function(t,e,n){"use strict";e.a="vec3 calcAmbientSHLight(int idx, vec3 N) {\n int offset = 9 * idx;\n return ambientSHLightCoefficients[0]\n + ambientSHLightCoefficients[1] * N.x\n + ambientSHLightCoefficients[2] * N.y\n + ambientSHLightCoefficients[3] * N.z\n + ambientSHLightCoefficients[4] * N.x * N.z\n + ambientSHLightCoefficients[5] * N.z * N.y\n + ambientSHLightCoefficients[6] * N.y * N.x\n + ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)\n + ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);\n}"},function(t,e,n){"use strict";var i,r,a,o,s,l=n(8),u=n(49),c=n(23),h=n(4),d=n(9),f=n(64),p=n(11),g=n(1),m=n.n(g).a.vec3,v=l.a.extend({scene:null,camera:null,renderer:null},(function(){this._ray=new u.a,this._ndc=new c.a}),{pick:function(t,e,n){return this.pickAll(t,e,[],n)[0]||null},pickAll:function(t,e,n,i){return this.renderer.screenToNDC(t,e,this._ndc),this.camera.castRay(this._ndc,this._ray),n=n||[],this._intersectNode(this.scene,n,i||!1),n.sort(this._intersectionCompareFunc),n},_intersectNode:function(t,e,n){t instanceof f.a&&t.isRenderable()&&(t.ignorePicking&&!n||!(t.mode===p.a.TRIANGLES&&t.geometry.isUseIndices()||t.geometry.pickByRay||t.geometry.pick)||this._intersectRenderable(t,e));for(var i=0;i<t._children.length;i++)this._intersectNode(t._children[i],e,n)},_intersectRenderable:(i=new h.a,r=new h.a,a=new h.a,o=new u.a,s=new d.a,function(t,e){var n=t.isSkinnedMesh();o.copy(this._ray),d.a.invert(s,t.worldTransform),n||o.applyTransform(s);var l=t.geometry;if(n||!l.boundingBox||o.intersectBoundingBox(l.boundingBox))if(l.pick)l.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,t,e);else if(l.pickByRay)l.pickByRay(o,t,e);else{var u,c,f=t.cullFace===p.a.BACK&&t.frontFace===p.a.CCW||t.cullFace===p.a.FRONT&&t.frontFace===p.a.CW,g=l.indices,y=l.attributes.position,x=l.attributes.weight,b=l.attributes.joint,_=[];if(y&&y.value&&g){if(n){c=t.skeleton.getSubSkinMatrices(t.__uid__,t.joints);for(var E=0;E<t.joints.length;E++){_[E]=_[E]||[];for(var w=0;w<16;w++)_[E][w]=c[16*E+w]}var T=[],S=[],M=[],C=[],A=[],O=l.attributes.skinnedPosition;for(O&&O.value||(l.createAttribute("skinnedPosition","f",3),(O=l.attributes.skinnedPosition).init(l.vertexCount)),E=0;E<l.vertexCount;E++){for(y.get(E,T),x.get(E,S),b.get(E,M),S[3]=1-S[0]-S[1]-S[2],m.set(C,0,0,0),w=0;w<4;w++)M[w]>=0&&S[w]>1e-4&&(m.transformMat4(A,T,_[M[w]]),m.scaleAndAdd(C,C,A,S[w]));O.set(E,C)}}for(E=0;E<g.length;E+=3){var N=g[E],P=g[E+1],L=g[E+2],R=n?l.attributes.skinnedPosition:y;if(R.get(N,i.array),R.get(P,r.array),R.get(L,a.array),u=f?o.intersectTriangle(i,r,a,t.culling):o.intersectTriangle(i,a,r,t.culling)){var D=new h.a;n?h.a.copy(D,u):h.a.transformMat4(D,u,t.worldTransform),e.push(new v.Intersection(u,D,t,[N,P,L],E/3,h.a.dist(D,this._ray.origin)))}}}}}),_intersectionCompareFunc:function(t,e){return t.distance-e.distance}});v.Intersection=function(t,e,n,i,r,a){this.point=t,this.pointWorld=e,this.target=n,this.triangle=i,this.triangleIndex=r,this.distance=a},e.a=v},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function o(t,e){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var n=t[e].normal,i=t[e].emphasis;n&&(t[e]=n),i&&(t.emphasis=t.emphasis||{},t.emphasis[e]=i)}}function s(t){t&&(t instanceof Array||(t=[t]),r.a.util.each(t,(function(t){if(t.axisLabel){var e=t.axisLabel;r.a.util.extend(e,e.textStyle),e.textStyle=null}})))}e.a=function(t){r.a.util.each(t.series,(function(e){r.a.util.indexOf(a,e.type)>=0&&(function(t){o(t,"itemStyle"),o(t,"lineStyle"),o(t,"areaStyle"),o(t,"label")}(e),"mapbox"===e.coordinateSystem&&(e.coordinateSystem="mapbox3D",t.mapbox3D=t.mapbox))})),s(t.xAxis3D),s(t.yAxis3D),s(t.zAxis3D),s(t.grid3D),o(t.geo3D)}},function(t,e,n){"use strict";e.a={get:function(t){var e=new XMLHttpRequest;e.open("get",t.url),e.responseType=t.responseType||"text",t.onprogress&&(e.onprogress=function(e){if(e.lengthComputable){var n=e.loaded/e.total;t.onprogress(n,e.loaded,e.total)}else t.onprogress(null)}),e.onload=function(n){e.status>=400?t.onerror&&t.onerror():t.onload&&t.onload(e.response)},t.onerror&&(e.onerror=t.onerror),e.send(null)}}},function(t,e,n){"use strict";e.a="@export clay.basic.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position : POSITION;\nattribute vec3 barycentric;\n@import clay.chunk.skinning_header\nvarying vec2 v_Texcoord;\nvarying vec3 v_Barycentric;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\nvoid main()\n{\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n v_Texcoord = texcoord * uvRepeat + uvOffset;\n v_Barycentric = barycentric;\n gl_Position = worldViewProjection * vec4(skinnedPosition, 1.0);\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n}\n@end\n@export clay.basic.fragment\nvarying vec2 v_Texcoord;\nuniform sampler2D diffuseMap;\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform vec3 emission : [0.0, 0.0, 0.0];\nuniform float alpha : 1.0;\n#ifdef ALPHA_TEST\nuniform float alphaCutoff: 0.9;\n#endif\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nuniform float lineWidth : 0.0;\nuniform vec4 lineColor : [0.0, 0.0, 0.0, 0.6];\nvarying vec3 v_Barycentric;\n@import clay.util.edge_factor\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n#ifdef RENDER_TEXCOORD\n gl_FragColor = vec4(v_Texcoord, 1.0, 1.0);\n return;\n#endif\n gl_FragColor = vec4(color, alpha);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n#ifdef DIFFUSEMAP_ENABLED\n vec4 tex = decodeHDR(texture2D(diffuseMap, v_Texcoord));\n#ifdef SRGB_DECODE\n tex = sRGBToLinear(tex);\n#endif\n#if defined(DIFFUSEMAP_ALPHA_ALPHA)\n gl_FragColor.a = tex.a;\n#endif\n gl_FragColor.rgb *= tex.rgb;\n#endif\n gl_FragColor.rgb += emission;\n if( lineWidth > 0.)\n {\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor(lineWidth)) * lineColor.a);\n }\n#ifdef ALPHA_TEST\n if (gl_FragColor.a < alphaCutoff) {\n discard;\n }\n#endif\n#ifdef TONEMAPPING\n gl_FragColor.rgb = ACESToneMapping(gl_FragColor.rgb);\n#endif\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n}\n@end"},function(t,e,n){"use strict";var i=n(6),r=n(5);function a(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}n(25);var o=a("DXT1"),s=a("DXT3"),l=a("DXT5"),u={parse:function(t,e){var n=new Int32Array(t,0,31);if(542327876!==n[0])return null;if(4&!n(20))return null;var a,u,c=n(21),h=n[4],d=n[3],f=512&n[28],p=131072&n[2];switch(c){case o:a=8,u=i.a.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case s:a=16,u=i.a.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case l:a=16,u=i.a.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var g=n[1]+4,m=f?6:1,v=1;p&&(v=Math.max(1,n[7]));for(var y=[],x=0;x<m;x++){var b=h,_=d;y[x]=new r.a({width:b,height:_,format:u});for(var E=[],w=0;w<v;w++){var T=Math.max(4,b)/4*Math.max(4,_)/4*a,S=new Uint8Array(t,g,T);g+=T,b*=.5,_*=.5,E[w]=S}y[x].pixels=E[0],p&&(y[x].mipmaps=E)}if(!e)return y[0];e.width=y[0].width,e.height=y[0].height,e.format=y[0].format,e.pixels=y[0].pixels,e.mipmaps=y[0].mipmaps}};e.a=u},function(t,e,n){"use strict";var i=n(6),r=n(5),a=String.fromCharCode;function o(t,e,n,i){if(t[3]>0){var r=Math.pow(2,t[3]-128-8+i);e[n+0]=t[0]*r,e[n+1]=t[1]*r,e[n+2]=t[2]*r}else e[n+0]=0,e[n+1]=0,e[n+2]=0;return e[n+3]=1,e}function s(t,e,n,i){for(var r,a,o=0,s=0,l=i;l>0;)if(t[s][0]=e[n++],t[s][1]=e[n++],t[s][2]=e[n++],t[s][3]=e[n++],1===t[s][0]&&1===t[s][1]&&1===t[s][2]){for(var u=t[s][3]<<o>>>0;u>0;u--)r=t[s-1],(a=t[s])[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],s++,l--;o+=8}else s++,l--,o=0;return n}function l(t,e,n,i){if(i<8|i>32767)return s(t,e,n,i);if(2!=(r=e[n++]))return s(t,e,n-1,i);if(t[0][1]=e[n++],t[0][2]=e[n++],r=e[n++],(t[0][2]<<8>>>0|r)>>>0!==i)return null;for(var r=0;r<4;r++)for(var a=0;a<i;){var o=e[n++];if(o>128){o=(127&o)>>>0;for(var l=e[n++];o--;)t[a++][r]=l}else for(;o--;)t[a++][r]=e[n++]}return n}var u={parseRGBE:function(t,e,n){null==n&&(n=0);var s=new Uint8Array(t),u=s.length;if("#?"===function(t,e,n){for(var i="",r=e;r<n;r++)i+=a(t[r]);return i}(s,0,2)){for(var c=2;c<u&&("\n"!==a(s[c])||"\n"!==a(s[c+1]));c++);if(!(c>=u)){c+=2;for(var h="";c<u;c++){var d=a(s[c]);if("\n"===d)break;h+=d}var f=h.split(" "),p=parseInt(f[1]),g=parseInt(f[3]);if(g&&p){for(var m=c+1,v=[],y=0;y<g;y++){v[y]=[];for(var x=0;x<4;x++)v[y][x]=0}for(var b=new Float32Array(g*p*4),_=0,E=0;E<p;E++){if(!(m=l(v,s,m,g)))return null;for(y=0;y<g;y++)o(v[y],b,_,n),_+=4}return e||(e=new r.a),e.width=g,e.height=p,e.pixels=b,e.type=i.a.FLOAT,e}}}},parseRGBEFromPNG:function(t){}};e.a=u},function(t,e,n){"use strict";var i=n(5),r=n(4),a=n(23),o=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function s(t){return"_on"+t}var l,u,c,h,d,f,p,g,m=function(t){var e=this;this._texture=new i.a({anisotropic:32,flipY:!1,surface:this,dispose:function(t){e.dispose(),i.a.prototype.dispose.call(this,t)}}),o.forEach((function(t){this[s(t)]=function(e){e.triangle&&this._meshes.forEach((function(n){this.dispatchEvent(t,n,e.triangle,e.point)}),this)}}),this),this._meshes=[],t&&this.setECharts(t),this.onupdate=null};m.prototype={constructor:m,getTexture:function(){return this._texture},setECharts:function(t){this._chart=t;var e=t.getDom();if(e instanceof HTMLCanvasElement){var n=this,i=t.getZr(),r=i.__oldRefreshImmediately||i.refreshImmediately;i.refreshImmediately=function(){r.call(this),n._texture.dirty(),n.onupdate&&n.onupdate()},i.__oldRefreshImmediately=r}else console.error("ECharts must init on canvas if it is used as texture."),e=document.createElement("canvas");this._texture.image=e,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:(l=new r.a,u=new r.a,c=new r.a,h=new a.a,d=new a.a,f=new a.a,p=new a.a,g=new r.a,function(t,e,n,i){var o=e.geometry,s=o.attributes.position,m=o.attributes.texcoord0,v=r.a.dot,y=r.a.cross;s.get(n[0],l.array),s.get(n[1],u.array),s.get(n[2],c.array),m.get(n[0],h.array),m.get(n[1],d.array),m.get(n[2],f.array),y(g,u,c);var x=v(l,g),b=v(i,g)/x;y(g,c,l);var _=v(i,g)/x;y(g,l,u);var E=v(i,g)/x;a.a.scale(p,h,b),a.a.scaleAndAdd(p,p,d,_),a.a.scaleAndAdd(p,p,f,E);var w=p.x*this._chart.getWidth(),T=p.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(t,{zrX:w,zrY:T})}),attachToMesh:function(t){this._meshes.indexOf(t)>=0||(o.forEach((function(e){t.on(e,this[s(e)],this)}),this),this._meshes.push(t))},detachFromMesh:function(t){var e=this._meshes.indexOf(t);e>=0&&this._meshes.splice(e,1),o.forEach((function(e){t.off(e,this[s(e)])}),this)},dispose:function(){this._meshes.forEach((function(t){this.detachFromMesh(t)}),this)}},e.a=m},function(t,e,n){"use strict";var i=n(19),r=n(108),a=i.a.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(t,e){this._brdfLookup||(this._normalDistribution=r.a.generateNormalDistribution(),this._brdfLookup=r.a.integrateBRDF(t,this._normalDistribution));var n=this.cubemap;if(!n.__prefiltered){var i=r.a.prefilterEnvironmentMap(t,n,{encodeRGBM:!0,width:e,height:e},this._normalDistribution,this._brdfLookup);this.cubemap=i.environmentMap,this.cubemap.__prefiltered=!0,n.dispose(t)}},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}},ambientCubemapLightCubemap:{type:"t",value:function(t){return t.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(t){return t._brdfLookup}}}});e.a=a},function(t,e,n){"use strict";var i=n(5),r=n(25),a=n(6),o=n(10),s=n(14),l=n(17),u=n(7),c=n(57),h=n(29),d=n(55),f=n(18),p=n(54),g=n(111),m=n(112),v={},y=["px","nx","py","ny","pz","nz"];v.prefilterEnvironmentMap=function(t,e,n,s,g){g&&s||(s=v.generateNormalDistribution(),g=v.integrateBRDF(t,s));var x=(n=n||{}).width||64,b=n.height||64,_=n.type||e.type,E=new r.a({width:x,height:b,type:_,flipY:!1,mipmaps:[]});E.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var w=Math.min(x,b),T=Math.log(w)/Math.log(2)+1,S=new l.a({shader:new u.a({vertex:u.a.source("clay.skybox.vertex"),fragment:m.a})});S.set("normalDistribution",s),n.encodeRGBM&&S.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&S.define("fragment","RGBM_DECODE");var M,C=new h.a;if(e instanceof i.a){var A=new r.a({width:x,height:b,type:_===a.a.FLOAT?a.a.HALF_FLOAT:_});p.a.panoramaToCubeMap(t,e,A,{encodeRGBM:n.decodeRGBM}),e=A}(M=new c.a({scene:C,material:S})).material.set("environmentMap",e);var O=new d.a({texture:E});n.encodeRGBM&&(_=E.type=a.a.UNSIGNED_BYTE);for(var N=new i.a({width:x,height:b,type:_}),P=new o.a({depthBuffer:!1}),L=f.a[_===a.a.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],R=0;R<T;R++){E.mipmaps[R]={pixels:{}},M.material.set("roughness",R/(y.length-1));for(var D=N.width,k=2*Math.atan(D/(D-.5))/Math.PI*180,I=0;I<y.length;I++){var B=new L(N.width*N.height*4);P.attach(N),P.bind(t);var F=O.getCamera(y[I]);F.fov=k,t.render(C,F),t.gl.readPixels(0,0,N.width,N.height,a.a.RGBA,_,B),P.unbind(t),E.mipmaps[R].pixels[y[I]]=B}N.width/=2,N.height/=2,N.dirty()}return P.dispose(t),N.dispose(t),M.dispose(t),s.dispose(t),{environmentMap:E,brdfLookup:g,normalDistribution:s,maxMipmapLevel:T}},v.integrateBRDF=function(t,e){e=e||v.generateNormalDistribution();var n=new o.a({depthBuffer:!1}),r=new s.a({fragment:g.a}),l=new i.a({width:512,height:256,type:a.a.HALF_FLOAT,minFilter:a.a.NEAREST,magFilter:a.a.NEAREST,useMipmap:!1});return r.setUniform("normalDistribution",e),r.setUniform("viewportSize",[512,256]),r.attachOutput(l),r.render(t,n),n.dispose(t),l},v.generateNormalDistribution=function(t,e){t=t||256,e=e||1024;for(var n=new i.a({width:t,height:e,type:a.a.FLOAT,minFilter:a.a.NEAREST,magFilter:a.a.NEAREST,useMipmap:!1}),r=new Float32Array(e*t*4),o=0;o<e;o++){var s=o/e,l=(o<<16|o>>>16)>>>0;l=(((16711935&(l=((252645135&(l=((858993459&(l=((1431655765&l)<<1|(2863311530&l)>>>1)>>>0))<<2|(3435973836&l)>>>2)>>>0))<<4|(4042322160&l)>>>4)>>>0))<<8|(4278255360&l)>>>8)>>>0)/4294967296;for(var u=0;u<t;u++){var c=u/t,h=c*c,d=2*Math.PI*s,f=Math.sqrt((1-l)/(1+(h*h-1)*l)),p=Math.sqrt(1-f*f),g=4*(o*t+u);r[g]=p*Math.cos(d),r[g+1]=p*Math.sin(d),r[g+2]=f,r[g+3]=1}}return n.pixels=r,n},e.a=v},function(t,e,n){"use strict";e.a="\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end"},function(t,e,n){"use strict";e.a="@export clay.skybox.vertex\nuniform mat4 world : WORLD;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nvarying vec3 v_WorldPosition;\nvoid main()\n{\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n@export clay.skybox.fragment\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform float lod: 0.0;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n vec3 eyePos = viewInverse[3].xyz;\n vec3 viewDirection = normalize(v_WorldPosition - eyePos);\n#ifdef LOD\n vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, viewDirection, lod));\n#else\n vec4 texel = decodeHDR(textureCube(environmentMap, viewDirection));\n#endif\n#ifdef SRGB_DECODE\n texel = sRGBToLinear(texel);\n#endif\n#ifdef TONEMAPPING\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n#ifdef SRGB_ENCODE\n texel = linearTosRGB(texel);\n#endif\n gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));\n}\n@end"},function(t,e,n){"use strict";e.a="#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\n vec3 tangentX = normalize(cross(upVector, N));\n vec3 tangentY = cross(N, tangentX);\n return tangentX * H.x + tangentY * H.y + N * H.z;\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n"},function(t,e,n){"use strict";e.a="#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\nconst float fSampleNumber = float(SAMPLE_NUMBER);\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);\n vec3 tangentX = normalize(cross(upVector, N));\n vec3 tangentY = cross(N, tangentX);\n return tangentX * H.x + tangentY * H.y + N * H.z;\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 R = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n"},function(t,e,n){"use strict";var i=n(19),r=n(18),a=i.a.extend({castShadow:!1,coefficients:[]},(function(){this._coefficientsTmpArr=new r.a.Float32Array(27)}),{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}},ambientSHLightCoefficients:{type:"3f",value:function(t){for(var e=t._coefficientsTmpArr,n=0;n<t.coefficients.length;n++)e[n]=t.coefficients[n];return e}}}});e.a=a},function(t,e,n){"use strict";var i=n(6),r=n(10),a=n(5),o=(n(14),n(18)),s=n(57),l=n(56),u=n(55),c=n(29),h=n(1),d=n.n(h),f=(n(115),d.a.vec3),p={},g=["px","nx","py","ny","pz","nz"];function m(t,e){var n=t[0],i=t[1],r=t[2];return 0===e?1:1===e?n:2===e?i:3===e?r:4===e?n*r:5===e?i*r:6===e?n*i:7===e?3*r*r-1:n*n-i*i}var v={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};p.projectEnvironmentMap=function(t,e,n){var h;(n=n||{}).lod=n.lod||0;var d=new c.a,p=64;e instanceof a.a?h=new l.a({scene:d,environmentMap:e}):(p=e.image&&e.image.px?e.image.px.width:e.width,h=new s.a({scene:d,environmentMap:e}));var y=Math.ceil(p/Math.pow(2,n.lod)),x=Math.ceil(p/Math.pow(2,n.lod)),b=new a.a({width:y,height:x}),_=new r.a;h.material.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&h.material.define("fragment","RGBM_DECODE"),h.material.set("lod",n.lod);for(var E=new u.a({texture:b}),w={},T=0;T<g.length;T++){w[g[T]]=new Uint8Array(y*x*4);var S=E.getCamera(g[T]);S.fov=90,_.attach(b),_.bind(t),t.render(d,S),t.gl.readPixels(0,0,y,x,i.a.RGBA,i.a.UNSIGNED_BYTE,w[g[T]]),_.unbind(t)}return h.dispose(t),_.dispose(t),b.dispose(t),function(t,e,n,i){for(var r=new o.a.Float32Array(27),a=f.create(),s=f.create(),l=f.create(),u=0;u<9;u++){for(var c=f.create(),h=0;h<g.length;h++){for(var d=e[g[h]],p=f.create(),y=0,x=0,b=v[g[h]],_=0;_<i;_++)for(var E=0;E<n;E++){a[0]=E/(n-1)*2-1,a[1]=_/(i-1)*2-1,a[2]=-1,f.normalize(a,a),l[0]=a[b[0]]*b[3],l[1]=a[b[1]]*b[4],l[2]=a[b[2]]*b[5],s[0]=d[x++]/255,s[1]=d[x++]/255,s[2]=d[x++]/255;var w=d[x++]/255*51.5;s[0]*=w,s[1]*=w,s[2]*=w,f.scaleAndAdd(p,p,s,m(l,u)*-a[2]),y+=-a[2]}f.scaleAndAdd(c,c,p,1/y)}r[3*u]=c[0]/6,r[3*u+1]=c[1]/6,r[3*u+2]=c[2]/6}return r}(0,w,y,x)},e.a=p},function(t,e,n){"use strict";e.a="uniform samplerCube environmentMap;\nvarying vec2 v_Texcoord;\n#define TEXTURE_SIZE 16\nmat3 front = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, 1.0\n);\nmat3 back = mat3(\n -1.0, 0.0, 0.0,\n 0.0, 1.0, 0.0,\n 0.0, 0.0, -1.0\n);\nmat3 left = mat3(\n 0.0, 0.0, -1.0,\n 0.0, 1.0, 0.0,\n 1.0, 0.0, 0.0\n);\nmat3 right = mat3(\n 0.0, 0.0, 1.0,\n 0.0, 1.0, 0.0,\n -1.0, 0.0, 0.0\n);\nmat3 up = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 0.0, 1.0,\n 0.0, -1.0, 0.0\n);\nmat3 down = mat3(\n 1.0, 0.0, 0.0,\n 0.0, 0.0, -1.0,\n 0.0, 1.0, 0.0\n);\nfloat harmonics(vec3 normal){\n int index = int(gl_FragCoord.x);\n float x = normal.x;\n float y = normal.y;\n float z = normal.z;\n if(index==0){\n return 1.0;\n }\n else if(index==1){\n return x;\n }\n else if(index==2){\n return y;\n }\n else if(index==3){\n return z;\n }\n else if(index==4){\n return x*z;\n }\n else if(index==5){\n return y*z;\n }\n else if(index==6){\n return x*y;\n }\n else if(index==7){\n return 3.0*z*z - 1.0;\n }\n else{\n return x*x - y*y;\n }\n}\nvec3 sampleSide(mat3 rot)\n{\n vec3 result = vec3(0.0);\n float divider = 0.0;\n for (int i = 0; i < TEXTURE_SIZE * TEXTURE_SIZE; i++) {\n float x = mod(float(i), float(TEXTURE_SIZE));\n float y = float(i / TEXTURE_SIZE);\n vec2 sidecoord = ((vec2(x, y) + vec2(0.5, 0.5)) / vec2(TEXTURE_SIZE)) * 2.0 - 1.0;\n vec3 normal = normalize(vec3(sidecoord, -1.0));\n vec3 fetchNormal = rot * normal;\n vec3 texel = textureCube(environmentMap, fetchNormal).rgb;\n result += harmonics(fetchNormal) * texel * -normal.z;\n divider += -normal.z;\n }\n return result / divider;\n}\nvoid main()\n{\n vec3 result = (\n sampleSide(front) +\n sampleSide(back) +\n sampleSide(left) +\n sampleSide(right) +\n sampleSide(up) +\n sampleSide(down)\n ) / 6.0;\n gl_FragColor = vec4(result, 1.0);\n}"},function(t,e,n){"use strict";var i=n(19).a.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}}}});e.a=i},function(t,e,n){"use strict";var i=n(1),r=n.n(i).a.vec4,a=function(t,e,n,i){t=t||0,e=e||0,n=n||0,i=i||0,this.array=r.fromValues(t,e,n,i),this._dirty=!0};a.prototype={constructor:a,add:function(t){return r.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e,n,i){return this.array[0]=t,this.array[1]=e,this.array[2]=n,this.array[3]=i,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this.array[3]=t[3],this._dirty=!0,this},clone:function(){return new a(this.x,this.y,this.z,this.w)},copy:function(t){return r.copy(this.array,t.array),this._dirty=!0,this},dist:function(t){return r.dist(this.array,t.array)},distance:function(t){return r.distance(this.array,t.array)},div:function(t){return r.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return r.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return r.dot(this.array,t.array)},len:function(){return r.len(this.array)},length:function(){return r.length(this.array)},lerp:function(t,e,n){return r.lerp(this.array,t.array,e.array,n),this._dirty=!0,this},min:function(t){return r.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return r.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return r.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return r.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return r.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return r.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return r.random(this.array,t),this._dirty=!0,this},scale:function(t){return r.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return r.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return r.sqrDist(this.array,t.array)},squaredDistance:function(t){return r.squaredDistance(this.array,t.array)},sqrLen:function(){return r.sqrLen(this.array)},squaredLength:function(){return r.squaredLength(this.array)},sub:function(t){return r.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return r.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return r.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},transformQuat:function(t){return r.transformQuat(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var o=Object.defineProperty;if(o){var s=a.prototype;o(s,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),o(s,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),o(s,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),o(s,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}a.add=function(t,e,n){return r.add(t.array,e.array,n.array),t._dirty=!0,t},a.set=function(t,e,n,i,a){r.set(t.array,e,n,i,a),t._dirty=!0},a.copy=function(t,e){return r.copy(t.array,e.array),t._dirty=!0,t},a.distance=a.dist=function(t,e){return r.distance(t.array,e.array)},a.divide=a.div=function(t,e,n){return r.divide(t.array,e.array,n.array),t._dirty=!0,t},a.dot=function(t,e){return r.dot(t.array,e.array)},a.len=function(t){return r.length(t.array)},a.lerp=function(t,e,n,i){return r.lerp(t.array,e.array,n.array,i),t._dirty=!0,t},a.min=function(t,e,n){return r.min(t.array,e.array,n.array),t._dirty=!0,t},a.max=function(t,e,n){return r.max(t.array,e.array,n.array),t._dirty=!0,t},a.multiply=a.mul=function(t,e,n){return r.multiply(t.array,e.array,n.array),t._dirty=!0,t},a.negate=function(t,e){return r.negate(t.array,e.array),t._dirty=!0,t},a.normalize=function(t,e){return r.normalize(t.array,e.array),t._dirty=!0,t},a.random=function(t,e){return r.random(t.array,e),t._dirty=!0,t},a.scale=function(t,e,n){return r.scale(t.array,e.array,n),t._dirty=!0,t},a.scaleAndAdd=function(t,e,n,i){return r.scaleAndAdd(t.array,e.array,n.array,i),t._dirty=!0,t},a.squaredDistance=a.sqrDist=function(t,e){return r.sqrDist(t.array,e.array)},a.squaredLength=a.sqrLen=function(t){return r.sqrLen(t.array)},a.subtract=a.sub=function(t,e,n){return r.subtract(t.array,e.array,n.array),t._dirty=!0,t},a.transformMat4=function(t,e,n){return r.transformMat4(t.array,e.array,n.array),t._dirty=!0,t},a.transformQuat=function(t,e,n){return r.transformQuat(t.array,e.array,n.array),t._dirty=!0,t},e.a=a},function(t,e,n){"use strict";var i=n(1),r=n.n(i).a.mat2,a=function(){this.array=r.create(),this._dirty=!0};a.prototype={constructor:a,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},clone:function(){return(new a).copy(this)},copy:function(t){return r.copy(this.array,t.array),this._dirty=!0,this},adjoint:function(){return r.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return r.determinant(this.array)},identity:function(){return r.identity(this.array),this._dirty=!0,this},invert:function(){return r.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return r.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return r.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return r.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return r.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return r.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return r.scale(this.array,this.array,t.array),this._dirty=!0,this},transpose:function(){return r.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},a.adjoint=function(t,e){return r.adjoint(t.array,e.array),t._dirty=!0,t},a.copy=function(t,e){return r.copy(t.array,e.array),t._dirty=!0,t},a.determinant=function(t){return r.determinant(t.array)},a.identity=function(t){return r.identity(t.array),t._dirty=!0,t},a.invert=function(t,e){return r.invert(t.array,e.array),t._dirty=!0,t},a.multiply=a.mul=function(t,e,n){return r.mul(t.array,e.array,n.array),t._dirty=!0,t},a.rotate=function(t,e,n){return r.rotate(t.array,e.array,n),t._dirty=!0,t},a.scale=function(t,e,n){return r.scale(t.array,e.array,n.array),t._dirty=!0,t},a.transpose=function(t,e){return r.transpose(t.array,e.array),t._dirty=!0,t},e.a=a},function(t,e,n){"use strict";var i=n(1),r=n.n(i).a.mat2d,a=function(){this.array=r.create(),this._dirty=!0};a.prototype={constructor:a,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},clone:function(){return(new a).copy(this)},copy:function(t){return r.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return r.determinant(this.array)},identity:function(){return r.identity(this.array),this._dirty=!0,this},invert:function(){return r.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return r.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return r.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return r.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return r.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return r.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return r.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return r.translate(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},a.copy=function(t,e){return r.copy(t.array,e.array),t._dirty=!0,t},a.determinant=function(t){return r.determinant(t.array)},a.identity=function(t){return r.identity(t.array),t._dirty=!0,t},a.invert=function(t,e){return r.invert(t.array,e.array),t._dirty=!0,t},a.multiply=a.mul=function(t,e,n){return r.mul(t.array,e.array,n.array),t._dirty=!0,t},a.rotate=function(t,e,n){return r.rotate(t.array,e.array,n),t._dirty=!0,t},a.scale=function(t,e,n){return r.scale(t.array,e.array,n.array),t._dirty=!0,t},a.translate=function(t,e,n){return r.translate(t.array,e.array,n.array),t._dirty=!0,t},e.a=a},function(t,e,n){"use strict";var i=n(1),r=n.n(i).a.mat3,a=function(){this.array=r.create(),this._dirty=!0};a.prototype={constructor:a,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},adjoint:function(){return r.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new a).copy(this)},copy:function(t){return r.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return r.determinant(this.array)},fromMat2d:function(t){return r.fromMat2d(this.array,t.array),this._dirty=!0,this},fromMat4:function(t){return r.fromMat4(this.array,t.array),this._dirty=!0,this},fromQuat:function(t){return r.fromQuat(this.array,t.array),this._dirty=!0,this},identity:function(){return r.identity(this.array),this._dirty=!0,this},invert:function(){return r.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return r.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return r.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return r.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return r.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return r.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return r.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return r.translate(this.array,this.array,t.array),this._dirty=!0,this},normalFromMat4:function(t){return r.normalFromMat4(this.array,t.array),this._dirty=!0,this},transpose:function(){return r.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},a.adjoint=function(t,e){return r.adjoint(t.array,e.array),t._dirty=!0,t},a.copy=function(t,e){return r.copy(t.array,e.array),t._dirty=!0,t},a.determinant=function(t){return r.determinant(t.array)},a.identity=function(t){return r.identity(t.array),t._dirty=!0,t},a.invert=function(t,e){return r.invert(t.array,e.array),t},a.multiply=a.mul=function(t,e,n){return r.mul(t.array,e.array,n.array),t._dirty=!0,t},a.fromMat2d=function(t,e){return r.fromMat2d(t.array,e.array),t._dirty=!0,t},a.fromMat4=function(t,e){return r.fromMat4(t.array,e.array),t._dirty=!0,t},a.fromQuat=function(t,e){return r.fromQuat(t.array,e.array),t._dirty=!0,t},a.normalFromMat4=function(t,e){return r.normalFromMat4(t.array,e.array),t._dirty=!0,t},a.rotate=function(t,e,n){return r.rotate(t.array,e.array,n),t._dirty=!0,t},a.scale=function(t,e,n){return r.scale(t.array,e.array,n.array),t._dirty=!0,t},a.transpose=function(t,e){return r.transpose(t.array,e.array),t._dirty=!0,t},a.translate=function(t,e,n){return r.translate(t.array,e.array,n.array),t._dirty=!0,t},e.a=a},function(t,e,n){"use strict";var i=n(122),r=n.n(i),a={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(t,e){var n;if(this._animators=this._animators||[],t){for(var i=t.split("."),a=this,o=0,s=i.length;o<s;o++)a&&(a=a[i[o]]);a&&(n=a)}else n=this;if(null==n)throw new Error("Target "+t+" not exists");var l=this._animators,u=new r.a(n,e),c=this;return u.during((function(){c.__zr&&c.__zr.refresh()})).done((function(){var t=l.indexOf(u);t>=0&&l.splice(t,1)})),l.push(u),this.__zr&&this.__zr.animation.addAnimator(u),u},stopAnimation:function(t){this._animators=this._animators||[];for(var e=this._animators,n=e.length,i=0;i<n;i++)e[i].stop(t);return e.length=0,this},addAnimatorsToZr:function(t){if(this._animators)for(var e=0;e<this._animators.length;e++)t.animation.addAnimator(this._animators[e])},removeAnimatorsFromZr:function(t){if(this._animators)for(var e=0;e<this._animators.length;e++)t.animation.removeAnimator(this._animators[e])}};e.a=a},function(t,e,n){var i=n(123),r=n(125),a=n(12).isArrayLike,o=Array.prototype.slice;function s(t,e){return t[e]}function l(t,e,n){t[e]=n}function u(t,e,n){return(e-t)*n+t}function c(t,e,n){return n>.5?e:t}function h(t,e,n,i,r){var a=t.length;if(1==r)for(var o=0;o<a;o++)i[o]=u(t[o],e[o],n);else{var s=a&&t[0].length;for(o=0;o<a;o++)for(var l=0;l<s;l++)i[o][l]=u(t[o][l],e[o][l],n)}}function d(t,e,n){var i=t.length,r=e.length;if(i!==r)if(i>r)t.length=r;else for(var a=i;a<r;a++)t.push(1===n?e[a]:o.call(e[a]));var s=t[0]&&t[0].length;for(a=0;a<t.length;a++)if(1===n)isNaN(t[a])&&(t[a]=e[a]);else for(var l=0;l<s;l++)isNaN(t[a][l])&&(t[a][l]=e[a][l])}function f(t,e,n){if(t===e)return!0;var i=t.length;if(i!==e.length)return!1;if(1===n){for(var r=0;r<i;r++)if(t[r]!==e[r])return!1}else{var a=t[0].length;for(r=0;r<i;r++)for(var o=0;o<a;o++)if(t[r][o]!==e[r][o])return!1}return!0}function p(t,e,n,i,r,a,o,s,l){var u=t.length;if(1==l)for(var c=0;c<u;c++)s[c]=g(t[c],e[c],n[c],i[c],r,a,o);else{var h=t[0].length;for(c=0;c<u;c++)for(var d=0;d<h;d++)s[c][d]=g(t[c][d],e[c][d],n[c][d],i[c][d],r,a,o)}}function g(t,e,n,i,r,a,o){var s=.5*(n-t),l=.5*(i-e);return(2*(e-n)+s+l)*o+(-3*(e-n)-2*s-l)*a+s*r+e}function m(t){if(a(t)){var e=t.length;if(a(t[0])){for(var n=[],i=0;i<e;i++)n.push(o.call(t[i]));return n}return o.call(t)}return t}function v(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}function y(t,e,n,o,s,l){var m=t._getter,y=t._setter,x="spline"===e,b=o.length;if(b){var _,E=o[0].value,w=a(E),T=!1,S=!1,M=w?function(t){var e=t[t.length-1].value;return a(e&&e[0])?2:1}(o):0;o.sort((function(t,e){return t.time-e.time})),_=o[b-1].time;for(var C=[],A=[],O=o[0].value,N=!0,P=0;P<b;P++){C.push(o[P].time/_);var L=o[P].value;if(w&&f(L,O,M)||!w&&L===O||(N=!1),O=L,"string"==typeof L){var R=r.parse(L);R?(L=R,T=!0):S=!0}A.push(L)}if(l||!N){var D=A[b-1];for(P=0;P<b-1;P++)w?d(A[P],D,M):!isNaN(A[P])||isNaN(D)||S||T||(A[P]=D);w&&d(m(t._target,s),D,M);var k,I,B,F,z,G=0,j=0;if(T)var U=[0,0,0,0];var H=new i({target:t._target,life:_,loop:t._loop,delay:t._delay,onframe:function(t,e){var n;if(e<0)n=0;else if(e<j){for(n=Math.min(G+1,b-1);n>=0&&!(C[n]<=e);n--);n=Math.min(n,b-2)}else{for(n=G;n<b&&!(C[n]>e);n++);n=Math.min(n-1,b-2)}G=n,j=e;var i=C[n+1]-C[n];if(0!==i)if(k=(e-C[n])/i,x)if(B=A[n],I=A[0===n?n:n-1],F=A[n>b-2?b-1:n+1],z=A[n>b-3?b-1:n+2],w)p(I,B,F,z,k,k*k,k*k*k,m(t,s),M);else{if(T)r=p(I,B,F,z,k,k*k,k*k*k,U,1),r=v(U);else{if(S)return c(B,F,k);r=g(I,B,F,z,k,k*k,k*k*k)}y(t,s,r)}else if(w)h(A[n],A[n+1],k,m(t,s),M);else{var r;if(T)h(A[n],A[n+1],k,U,1),r=v(U);else{if(S)return c(A[n],A[n+1],k);r=u(A[n],A[n+1],k)}y(t,s,r)}},ondestroy:n});return e&&"spline"!==e&&(H.easing=e),H}}}var x=function(t,e,n,i){this._tracks={},this._target=t,this._loop=e||!1,this._getter=n||s,this._setter=i||l,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};x.prototype={when:function(t,e){var n=this._tracks;for(var i in e)if(e.hasOwnProperty(i)){if(!n[i]){n[i]=[];var r=this._getter(this._target,i);if(null==r)continue;0!==t&&n[i].push({time:0,value:m(r)})}n[i].push({time:t,value:e[i]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].pause();this._paused=!0},resume:function(){for(var t=0;t<this._clipList.length;t++)this._clipList[t].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var t=this._doneList,e=t.length,n=0;n<e;n++)t[n].call(this)},start:function(t,e){var n,i=this,r=0,a=function(){--r||i._doneCallback()};for(var o in this._tracks)if(this._tracks.hasOwnProperty(o)){var s=y(this,t,a,this._tracks[o],o,e);s&&(this._clipList.push(s),r++,this.animation&&this.animation.addClip(s),n=s)}if(n){var l=n.onframe;n.onframe=function(t,e){l(t,e);for(var n=0;n<i._onframeList.length;n++)i._onframeList[n](t,e)}}return r||this._doneCallback(),this},stop:function(t){for(var e=this._clipList,n=this.animation,i=0;i<e.length;i++){var r=e[i];t&&r.onframe(this._target,1),n&&n.removeClip(r)}e.length=0},delay:function(t){return this._delay=t,this},done:function(t){return t&&this._doneList.push(t),this},getClips:function(){return this._clipList}};var b=x;t.exports=b},function(t,e,n){var i=n(124);function r(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}r.prototype={constructor:r,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var n=(t-this._startTime-this._pausedTime)/this._life;if(!(n<0)){n=Math.min(n,1);var r=this.easing,a="string"==typeof r?i[r]:r,o="function"==typeof a?a(n):n;return this.fire("frame",o),1==n?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var a=r;t.exports=a},function(t,e){var n={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1,i=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=i*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-n.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*n.bounceIn(2*t):.5*n.bounceOut(2*t-1)+.5}},i=n;t.exports=i},function(t,e,n){var i=n(53),r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function a(t){return(t=Math.round(t))<0?0:t>255?255:t}function o(t){return t<0?0:t>1?1:t}function s(t){return t.length&&"%"===t.charAt(t.length-1)?a(parseFloat(t)/100*255):a(parseInt(t,10))}function l(t){return t.length&&"%"===t.charAt(t.length-1)?o(parseFloat(t)/100):o(parseFloat(t))}function u(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function c(t,e,n){return t+(e-t)*n}function h(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function d(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var f=new i(20),p=null;function g(t,e){p&&d(p,e),p=f.put(t,p||e.slice())}function m(t,e){if(t){e=e||[];var n=f.get(t);if(n)return d(e,n);var i,a=(t+="").replace(/ /g,"").toLowerCase();if(a in r)return d(e,r[a]),g(t,e),e;if("#"===a.charAt(0))return 4===a.length?(i=parseInt(a.substr(1),16))>=0&&i<=4095?(h(e,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1),g(t,e),e):void h(e,0,0,0,1):7===a.length?(i=parseInt(a.substr(1),16))>=0&&i<=16777215?(h(e,(16711680&i)>>16,(65280&i)>>8,255&i,1),g(t,e),e):void h(e,0,0,0,1):void 0;var o=a.indexOf("("),u=a.indexOf(")");if(-1!==o&&u+1===a.length){var c=a.substr(0,o),p=a.substr(o+1,u-(o+1)).split(","),m=1;switch(c){case"rgba":if(4!==p.length)return void h(e,0,0,0,1);m=l(p.pop());case"rgb":return 3!==p.length?void h(e,0,0,0,1):(h(e,s(p[0]),s(p[1]),s(p[2]),m),g(t,e),e);case"hsla":return 4!==p.length?void h(e,0,0,0,1):(p[3]=l(p[3]),v(p,e),g(t,e),e);case"hsl":return 3!==p.length?void h(e,0,0,0,1):(v(p,e),g(t,e),e);default:return}}h(e,0,0,0,1)}}function v(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=l(t[1]),r=l(t[2]),o=r<=.5?r*(i+1):r+i-r*i,s=2*r-o;return h(e=e||[],a(255*u(s,o,n+1/3)),a(255*u(s,o,n)),a(255*u(s,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function y(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),s=Math.ceil(i),l=e[r],u=e[s],h=i-r;return n[0]=a(c(l[0],u[0],h)),n[1]=a(c(l[1],u[1],h)),n[2]=a(c(l[2],u[2],h)),n[3]=o(c(l[3],u[3],h)),n}}var x=y;function b(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),s=Math.ceil(i),l=m(e[r]),u=m(e[s]),h=i-r,d=E([a(c(l[0],u[0],h)),a(c(l[1],u[1],h)),a(c(l[2],u[2],h)),o(c(l[3],u[3],h))],"rgba");return n?{color:d,leftIndex:r,rightIndex:s,value:i}:d}}var _=b;function E(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}e.parse=m,e.lift=function(t,e){var n=m(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0;return E(n,4===n.length?"rgba":"rgb")}},e.toHex=function(t){var e=m(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},e.fastLerp=y,e.fastMapToColor=x,e.lerp=b,e.mapToColor=_,e.modifyHSL=function(t,e,n,i){if(t=m(t))return t=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,a=t[2]/255,o=Math.min(i,r,a),s=Math.max(i,r,a),l=s-o,u=(s+o)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+o):l/(2-s-o);var c=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;i===s?e=d-h:r===s?e=1/3+c-d:a===s&&(e=2/3+h-c),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}(t),null!=e&&(t[0]=(r=e,(r=Math.round(r))<0?0:r>360?360:r)),null!=n&&(t[1]=l(n)),null!=i&&(t[2]=l(i)),E(v(t),"rgba");var r},e.modifyAlpha=function(t,e){if((t=m(t))&&null!=e)return t[3]=o(e),E(t,"rgba")},e.stringify=E},function(t,e,n){"use strict";e.a="\n@export clay.util.rand\nhighp float rand(vec2 uv) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);\n return fract(sin(sn) * c);\n}\n@end\n@export clay.util.calculate_attenuation\nuniform float attenuationFactor : 5.0;\nfloat lightAttenuation(float dist, float range)\n{\n float attenuation = 1.0;\n attenuation = dist*dist/(range*range+1.0);\n float att_s = attenuationFactor;\n attenuation = 1.0/(attenuation*att_s+1.0);\n att_s = 1.0/(att_s+1.0);\n attenuation = attenuation - att_s;\n attenuation /= 1.0 - att_s;\n return clamp(attenuation, 0.0, 1.0);\n}\n@end\n@export clay.util.edge_factor\nfloat edgeFactor(float width)\n{\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n@end\n@export clay.util.encode_float\nvec4 encodeFloat(const in float depth)\n{\n const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n vec4 res = fract(depth * bitShifts);\n res -= res.xxyz * bit_mask;\n return res;\n}\n@end\n@export clay.util.decode_float\nfloat decodeFloat(const in vec4 color)\n{\n const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);\n return dot(color, bitShifts);\n}\n@end\n@export clay.util.float\n@import clay.util.encode_float\n@import clay.util.decode_float\n@end\n@export clay.util.rgbm_decode\nvec3 RGBMDecode(vec4 rgbm, float range) {\n return range * rgbm.rgb * rgbm.a;\n}\n@end\n@export clay.util.rgbm_encode\nvec4 RGBMEncode(vec3 color, float range) {\n if (dot(color, color) == 0.0) {\n return vec4(0.0);\n }\n vec4 rgbm;\n color /= range;\n rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);\n rgbm.a = ceil(rgbm.a * 255.0) / 255.0;\n rgbm.rgb = color / rgbm.a;\n return rgbm;\n}\n@end\n@export clay.util.rgbm\n@import clay.util.rgbm_decode\n@import clay.util.rgbm_encode\nvec4 decodeHDR(vec4 color)\n{\n#if defined(RGBM_DECODE) || defined(RGBM)\n return vec4(RGBMDecode(color, 51.5), 1.0);\n#else\n return color;\n#endif\n}\nvec4 encodeHDR(vec4 color)\n{\n#if defined(RGBM_ENCODE) || defined(RGBM)\n return RGBMEncode(color.xyz, 51.5);\n#else\n return color;\n#endif\n}\n@end\n@export clay.util.srgb\nvec4 sRGBToLinear(in vec4 value) {\n return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);\n}\nvec4 linearTosRGB(in vec4 value) {\n return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);\n}\n@end\n@export clay.chunk.skinning_header\n#ifdef SKINNING\nattribute vec3 weight : WEIGHT;\nattribute vec4 joint : JOINT;\nuniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;\nmat4 getSkinMatrix(float idx) {\n return skinMatrix[int(idx)];\n}\n#endif\n@end\n@export clay.chunk.skin_matrix\nmat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;\nif (weight.y > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end"},function(t,e,n){"use strict";e.a="\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n"},function(t,e,n){"use strict";e.a="@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"},function(t,e,n){"use strict";e.a="/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(t,e,n){"use strict";e.a="@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 51.5);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(t,e,n){"use strict";e.a="@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n"},function(t,e,n){"use strict";e.a="@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end"},function(t,e,n){"use strict";n(134),n(138),n(139),n(145);var i=n(0),r=n.n(i);r.a.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},(function(t,e){e.eachComponent({mainType:"grid3D",query:t},(function(e){e.setView(t)}))})),r.a.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},(function(t,e){})),r.a.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},(function(t,e){}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(135),o=r.a.extendComponentModel({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});function s(t,e){return e.type||(e.data?"category":"value")}r.a.helper.mixinAxisModelCommonMethods(o),Object(a.a)("x",o,s,{name:"X"}),Object(a.a)("y",o,s,{name:"Y"}),Object(a.a)("z",o,s,{name:"Z"})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(136),o=n(137),s=n.n(o),l=["value","category","time","log"];e.a=function(t,e,n,i){r.a.util.each(l,(function(o){e.extend({type:t+"Axis3D."+o,__ordinalMeta:null,mergeDefaultAndTheme:function(e,i){var a=i.getTheme();r.a.util.merge(e,a.get(o+"Axis3D")),r.a.util.merge(e,this.getDefaultOption()),e.type=n(t,e)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=s.a.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:r.a.util.merge(r.a.util.clone(a.a[o+"Axis3D"]),i||{},!0)})})),e.superClass.registerSubTypeDefaulter(t+"Axis3D",r.a.util.curry(n,t))}},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},o=r.a.util.merge({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},a),s=r.a.util.merge({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},a),l=r.a.util.defaults({scale:!0,min:"dataMin",max:"dataMax"},s),u=r.a.util.defaults({logBase:10},s);u.scale=!0,e.a={categoryAxis3D:o,valueAxis3D:s,timeAxis3D:l,logAxis3D:u}},function(t,e,n){var i=n(12),r=i.createHashMap,a=i.isObject,o=i.map;function s(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this._map}s.createByAxisModel=function(t){var e=t.option,n=e.data,i=n&&o(n,c);return new s({categories:i,needCollect:!i,deduplication:!1!==e.dedplication})};var l=s.prototype;function u(t){return t._map||(t._map=r(t.categories))}function c(t){return a(t)&&null!=t.value?t.value:t+""}l.getOrdinal=function(t){return u(this).get(t)},l.parseAndCollect=function(t){var e,n=this._needCollect;if("string"!=typeof t&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=u(this);return null==(e=i.get(t))&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e};var h=s;t.exports=h},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(38),o=n(31),s=n(32),l=r.a.extendComponentModel({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,o.a),r.a.util.merge(l.prototype,s.a)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(39),s=n(22),l=n(3),u=n(73),c=n(34),h=n(140),d=n(142),f=n(58),p=n(40),g=l.a.firstNotNull;a.a.Shader.import(p.a),["x","y","z"].forEach((function(t){r.a.extendComponentView({type:t+"Axis3D"})}));var m={x:0,y:2,z:1};r.a.extendComponentView({type:"grid3D",__ecgl__:!0,init:function(t,e){var n=new a.a.Material({shader:a.a.createShader("ecgl.color"),depthMask:!1,transparent:!0}),i=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new a.a.Node,this._control=new o.a({zr:e.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map((function(t){var e=new h.a(t,i,n);return this.groupGL.add(e.rootNode),e}),this),this._axes=["x","y","z"].map((function(t){var e=new d.a(t,i);return this.groupGL.add(e.rootNode),e}),this);var r=e.getDevicePixelRatio();this._axisLabelSurface=new u.a({width:256,height:256,devicePixelRatio:r}),this._axisLabelSurface.onupdate=function(){e.getZr().refresh()},this._axisPointerLineMesh=new a.a.Mesh({geometry:new s.a({useNativeLine:!1}),material:i,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new u.a({width:128,height:128,devicePixelRatio:r}),this._axisPointerLabelsMesh=new f.a({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new a.a.Node,this._sceneHelper=new c.a,this._sceneHelper.initLight(this._lightRoot)},render:function(t,e,n){this._model=t,this._api=n;var i=t.coordinateSystem;i.viewGL.add(this._lightRoot),t.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(i.viewGL);var a=t.getModel("viewControl");r.setFromViewControlModel(a,0),this._axisLabelSurface.clear();var o=["x","y","z"].reduce((function(e,n){var r=i.getAxis(n),a=r.model;return e[n]=g(a.get("axisLabel.interval"),t.get("axisLabel.interval")),"ordinal"===r.scale.type&&(null!=e[n]&&"auto"!=e[n]||(e[n]=Math.floor(r.scale.getTicks().length/8))),e}),{});r.off("update"),t.get("show")&&(this._faces.forEach((function(i){i.update(o,t,e,n)}),this),this._axes.forEach((function(e){e.update(t,o,this._axisLabelSurface,n)}),this)),r.on("update",this._onCameraChange.bind(this,t,n),this),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(t),i.viewGL.setPostEffect(t.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._initMouseHandler(t)},afterRender:function(t,e,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n)},showAxisPointer:function(t,e,n,i){this._doShowAxisPointer(),this._updateAxisPointer(i.value)},hideAxisPointer:function(t,e,n,i){this._doHideAxisPointer()},_initMouseHandler:function(t){var e=t.coordinateSystem.viewGL;t.get("show")&&t.get("axisPointer.show")?e.on("mousemove",this._updateAxisPointerOnMousePosition,this):e.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(t){if(!t.target){for(var e,n=this._model.coordinateSystem,i=n.viewGL,r=i.castRay(t.offsetX,t.offsetY,new a.a.Ray),o=0;o<this._faces.length;o++){var s=this._faces[o];if(!s.rootNode.invisible){s.plane.normal.dot(i.camera.worldTransform.z)<0&&s.plane.normal.negate();var l=r.intersectPlane(s.plane);if(l){var u=n.getAxis(s.faceInfo[0]),c=n.getAxis(s.faceInfo[1]),h=m[s.faceInfo[0]],d=m[s.faceInfo[1]];u.contain(l.array[h])&&c.contain(l.array[d])&&(e=l)}}}if(e){var f=n.pointToData(e.array,[],!0);this._updateAxisPointer(f),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(t,e){t.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var n=this._control;e.dispatchAction({type:"grid3DChangeCamera",alpha:n.getAlpha(),beta:n.getBeta(),distance:n.getDistance(),center:n.getCenter(),from:this.uid,grid3DId:t.id})},_updateFaceVisibility:function(){var t=this._control.getCamera(),e=new a.a.Vector3;t.update();for(var n=0;n<this._faces.length/2;n++){for(var i=[],r=0;r<2;r++)this._faces[2*n+r].rootNode.getWorldPosition(e),e.transformMat4(t.viewMatrix),i[r]=e.z;var o=i[0]>i[1]?0:1,s=this._faces[2*n+o],l=this._faces[2*n+1-o];s.rootNode.invisible=!0,l.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var t=this._model.coordinateSystem,e=t.getAxis("x"),n=t.getAxis("y"),i=t.getAxis("z"),r=i.getExtentMax(),a=i.getExtentMin(),o=e.getExtentMin(),s=e.getExtentMax(),l=n.getExtentMax(),u=n.getExtentMin(),c=this._axes[0].rootNode,h=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,p=f[4].rootNode.invisible?u:l,g=f[2].rootNode.invisible?r:a,m=f[0].rootNode.invisible?o:s,v=f[2].rootNode.invisible?r:a,y=f[0].rootNode.invisible?s:o,x=f[4].rootNode.invisible?u:l;c.rotation.identity(),h.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,c.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,h.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),c.position.set(0,g,p),h.position.set(m,v,0),d.position.set(y,0,x),c.update(),h.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var t=this._control.getCamera(),e=[new a.a.Vector4,new a.a.Vector4],n=new a.a.Vector4;this.groupGL.getWorldPosition(n),n.w=1,n.transformMat4(t.viewMatrix).transformMat4(t.projectionMatrix),n.x/=n.w,n.y/=n.w,this._axes.forEach((function(i){for(var r=i.axisLineCoords,a=(i.labelsMesh.geometry,0);a<e.length;a++)e[a].setArray(r[a]),e[a].w=1,e[a].transformMat4(i.rootNode.worldTransform).transformMat4(t.viewMatrix).transformMat4(t.projectionMatrix),e[a].x/=e[a].w,e[a].y/=e[a].w;var o,s,l=e[1].x-e[0].x,u=e[1].y-e[0].y,c=(e[1].x+e[0].x)/2,h=(e[1].y+e[0].y)/2;Math.abs(u/l)<.5?(o="center",s=h>n.y?"bottom":"top"):(s="middle",o=c>n.x?"left":"right"),i.setSpriteAlign(o,s,this._api)}),this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(t){var e=this._model.coordinateSystem,n=e.dataToPoint(t),i=this._axisPointerLineMesh.geometry,r=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function s(t){return l.a.firstNotNull(t.model.get("axisPointer.show"),r.get("show"))}function u(t){var e=t.model.getModel("axisPointer",r).getModel("lineStyle"),n=a.a.parseColor(e.get("color")),i=g(e.get("width"),1),o=g(e.get("opacity"),1);return n[3]*=o,{color:n,lineWidth:i}}i.convertToDynamicArray(!0);for(var c=0;c<this._faces.length;c++){var h=this._faces[c];if(!h.rootNode.invisible){for(var d=h.faceInfo,f=d[3]<0?e.getAxis(d[2]).getExtentMin():e.getAxis(d[2]).getExtentMax(),p=m[d[2]],v=0;v<2;v++){var y=d[v],x=d[1-v],b=e.getAxis(y),_=e.getAxis(x);if(s(b)){var E=m[y],w=m[x];(M=[0,0,0])[E]=(S=[0,0,0])[E]=n[E],M[p]=S[p]=f,M[w]=_.getExtentMin(),S[w]=_.getExtentMax();var T=u(b);i.addLine(M,S,T.color,T.lineWidth*o)}}if(s(e.getAxis(d[2]))){var S,M=n.slice();(S=n.slice())[p]=f,T=u(e.getAxis(d[2])),i.addLine(M,S,T.color,T.lineWidth*o)}}}i.convertToTypedArray(),this._updateAxisPointerLabelsMesh(t),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(t){var e=this._model,n=this._axisPointerLabelsMesh,i=this._axisPointerLabelsSurface,a=e.coordinateSystem,o=e.getModel("axisPointer");n.geometry.convertToDynamicArray(!0),i.clear();var s={x:"y",y:"x",z:"y"};this._axes.forEach((function(e,l){var u=a.getAxis(e.dim),c=u.model.getModel("axisPointer",o),h=c.getModel("label"),d=c.get("lineStyle.color");if(h.get("show")&&c.get("show")){var f=t[l],p=h.get("formatter"),g=u.scale.getLabel(f);if(null!=p)g=p(g,t);else if("interval"===u.scale.type||"log"===u.scale.type){var v=r.a.number.getPrecisionSafe(u.scale.getTicks()[0]);g=f.toFixed(v+2)}var y=h.getModel("textStyle"),x=y.get("color"),b=new r.a.graphic.Text;r.a.graphic.setTextStyle(b.style,y,{text:g,textFill:x||d,textAlign:"left",textVerticalAlign:"top"});var _=i.add(b),E=b.getBoundingRect(),w=this._api.getDevicePixelRatio(),T=e.rootNode.position.toArray();T[m[s[e.dim]]]+=(e.flipped?-1:1)*h.get("margin"),T[m[e.dim]]=u.dataToCoord(t[l]),n.geometry.addSprite(T,[E.width*w,E.height*w],_,e.textAlign,e.textVerticalAlign)}}),this),i.getZr().refreshImmediately(),n.material.set("uvScale",i.getCoordsScale()),n.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(3),s=n(22),l=n(141),u=n(74),c=o.a.firstNotNull,h={x:0,y:2,z:1};function d(t,e,n){this.rootNode=new a.a.Node;var i=new a.a.Mesh({geometry:new s.a({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,renderOrder:1}),r=new a.a.Mesh({geometry:new l.a,material:n,castShadow:!1,culling:!1,ignorePicking:!0,renderOrder:0});this.rootNode.add(r),this.rootNode.add(i),this.faceInfo=t,this.plane=new a.a.Plane,this.linesMesh=i,this.quadsMesh=r}d.prototype.update=function(t,e,n,i){var r=e.coordinateSystem,a=[r.getAxis(this.faceInfo[0]),r.getAxis(this.faceInfo[1])],o=this.linesMesh.geometry,s=this.quadsMesh.geometry;o.convertToDynamicArray(!0),s.convertToDynamicArray(!0),this._updateSplitLines(o,a,e,t,i),this._udpateSplitAreas(s,a,e,t,i),o.convertToTypedArray(),s.convertToTypedArray();var l=r.getAxis(this.faceInfo[2]);!function(t,e,n,i){var r=[0,0,0],a=i<0?n.getExtentMin():n.getExtentMax();r[h[n.dim]]=a,t.position.setArray(r),t.rotation.identity(),e.distance=-Math.abs(a),e.normal.set(0,0,0),"x"===n.dim?(t.rotation.rotateY(i*Math.PI/2),e.normal.x=-i):"z"===n.dim?(t.rotation.rotateX(-i*Math.PI/2),e.normal.y=-i):(i>0&&t.rotation.rotateY(Math.PI),e.normal.z=-i)}(this.rootNode,this.plane,l,this.faceInfo[3])},d.prototype._updateSplitLines=function(t,e,n,i,o){var s=o.getDevicePixelRatio();e.forEach((function(o,l){var h=o.model,d=e[1-l].getExtent();if(!o.scale.isBlank()){var f=h.getModel("splitLine",n.getModel("splitLine"));if(f.get("show")){var p=f.getModel("lineStyle"),g=p.get("color"),m=c(p.get("opacity"),1),v=c(p.get("width"),1),y=f.get("interval");null!=y&&"auto"!==y||(y=i[o.dim]),g=r.a.util.isArray(g)?g:[g];for(var x=o.getTicksCoords(),b=0,_=0;_<x.length;_++)if(!Object(u.a)(o,_,y)){var E=x[_],w=a.a.parseColor(g[b%g.length]);w[3]*=m;var T=[0,0,0],S=[0,0,0];T[l]=S[l]=E,T[1-l]=d[0],S[1-l]=d[1],t.addLine(T,S,w,v*s),b++}}}}))},d.prototype._udpateSplitAreas=function(t,e,n,i,o){e.forEach((function(o,s){var l=o.model,h=e[1-s].getExtent();if(!o.scale.isBlank()){var d=l.getModel("splitArea",n.getModel("splitArea"));if(d.get("show")){var f=d.getModel("areaStyle"),p=f.get("color"),g=c(f.get("opacity"),1),m=d.get("interval");null!=m&&"auto"!==m||(m=i[o.dim]),p=r.a.util.isArray(p)?p:[p];for(var v=o.getTicksCoords(),y=0,x=[0,0,0],b=[0,0,0],_=0;_<v.length;_++){var E=v[_],w=[0,0,0],T=[0,0,0];if(w[s]=T[s]=E,w[1-s]=h[0],T[1-s]=h[1],0!==_){if(!Object(u.a)(o,_,m)){var S=a.a.parseColor(p[y%p.length]);S[3]*=g,t.addQuad([x,w,T,b],S),x=w,b=T,y++}}else x=w,b=T}}}}))},e.a=d},function(t,e,n){"use strict";var i,r,a,o,s=n(13),l=n(0),u=n.n(l),c=n(33),h=n(1),d=n.n(h).a.vec3,f=s.a.extend((function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new s.a.Attribute("position","float",3,"POSITION"),normal:new s.a.Attribute("normal","float",3,"NORMAL"),color:new s.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(t){var e=this.attributes,n=this.getQuadVertexCount()*t,i=this.getQuadTriangleCount()*t;this.vertexCount!==n&&(e.position.init(n),e.normal.init(n),e.color.init(n)),this.triangleCount!==i&&(this.indices=n>65535?new Uint32Array(3*i):new Uint16Array(3*i))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:(i=d.create(),r=d.create(),a=d.create(),o=[0,3,1,3,2,1],function(t,e){var n=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;d.sub(i,t[1],t[0]),d.sub(r,t[2],t[1]),d.cross(a,i,r),d.normalize(a,a);for(var u=0;u<4;u++)n.set(this._vertexOffset+u,t[u]),l.set(this._vertexOffset+u,e),s.set(this._vertexOffset+u,a);var c=3*this._faceOffset;for(u=0;u<6;u++)this.indices[c+u]=o[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2})});u.a.util.defaults(f.prototype,c.a),e.a=f},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(22),s=n(3),l=n(58),u=n(74),c=s.a.firstNotNull,h={x:0,y:2,z:1};function d(t,e){var n=new a.a.Mesh({geometry:new o.a({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,renderOrder:2}),i=new l.a;i.material.depthMask=!1;var r=new a.a.Node;r.add(n),r.add(i),this.rootNode=r,this.dim=t,this.linesMesh=n,this.labelsMesh=i,this.axisLineCoords=null,this.labelElements=[]}var f={x:"y",y:"x",z:"y"};d.prototype.update=function(t,e,n,i){var o=t.coordinateSystem.getAxis(this.dim),s=e[this.dim],l=this.linesMesh.geometry,d=this.labelsMesh.geometry;l.convertToDynamicArray(!0),d.convertToDynamicArray(!0);var p=o.model,g=o.getExtent(),m=i.getDevicePixelRatio(),v=p.getModel("axisLine",t.getModel("axisLine")),y=p.getModel("axisTick",t.getModel("axisTick")),x=p.getModel("axisLabel",t.getModel("axisLabel")),b=v.get("lineStyle.color");if(v.get("show")){var _=v.getModel("lineStyle"),E=[0,0,0];(L=[0,0,0])[R=h[o.dim]]=g[0],E[R]=g[1],this.axisLineCoords=[L,E];var w=a.a.parseColor(b),T=c(_.get("width"),1),S=c(_.get("opacity"),1);w[3]*=S,l.addLine(L,E,w,T*m)}if(y.get("show")){var M=y.getModel("lineStyle"),C=a.a.parseColor(c(M.get("color"),b));T=c(M.get("width"),1),C[3]*=c(M.get("opacity"),1);var A=o.getTicksCoords();null!=(B=y.get("interval"))&&"auto"!==B||(B=s);for(var O=y.get("length"),N=0;N<A.length;N++)if(!Object(u.a)(o,N,B)){var P=A[N],L=[0,0,0],R=(E=[0,0,0],h[o.dim]),D=h[f[o.dim]];L[R]=E[R]=P,E[D]=O,l.addLine(L,E,C,T*m)}}if(this.labelElements=[],m=i.getDevicePixelRatio(),x.get("show")){var k=o.getLabelsCoords(),I=p.get("data"),B=s,F=x.get("margin"),z=p.getFormattedLabels(),G=o.scale.getTicks();for(N=0;N<k.length;N++)if(!Object(u.a)(o,N,B)){P=k[N];var j=[0,0,0];R=h[o.dim],D=h[f[o.dim]],j[R]=j[R]=P,j[D]=F;var U=x;I&&I[G[N]]&&I[G[N]].textStyle&&(U=new r.a.Model(I[G[N]].textStyle,x,p.ecModel));var H=c(U.get("color"),b),V=new r.a.graphic.Text;r.a.graphic.setTextStyle(V.style,U,{text:z[N],textFill:"function"==typeof H?H("category"===o.type?z[N]:"value"===o.type?G[N]+"":G[N],N):H,textVerticalAlign:"top",textAlign:"left"});var Z=n.add(V),W=V.getBoundingRect();d.addSprite(j,[W.width*m,W.height*m],Z),this.labelElements.push(V)}}if(p.get("name")){var X=p.getModel("nameTextStyle"),Y=(j=[0,0,0],R=h[o.dim],D=h[f[o.dim]],c(X.get("color"),b)),q=X.get("borderColor");T=X.get("borderWidth"),j[R]=j[R]=(g[0]+g[1])/2,j[D]=p.get("nameGap"),V=new r.a.graphic.Text,r.a.graphic.setTextStyle(V.style,X,{text:p.get("name"),textFill:Y,textStroke:q,lineWidth:T}),Z=n.add(V),W=V.getBoundingRect(),d.addSprite(j,[W.width*m,W.height*m],Z),V.__idx=this.labelElements.length,this.nameLabelElement=V}this.labelsMesh.material.set("textureAtlas",n.getTexture()),this.labelsMesh.material.set("uvScale",n.getCoordsScale()),l.convertToTypedArray(),d.convertToTypedArray()},d.prototype.setSpriteAlign=function(t,e,n){for(var i=n.getDevicePixelRatio(),r=this.labelsMesh.geometry,a=0;a<this.labelElements.length;a++){var o=this.labelElements[a].getBoundingRect();r.setSpriteAlign(a,[o.width*i,o.height*i],t,e)}var s=this.nameLabelElement;s&&(o=s.getBoundingRect(),r.setSpriteAlign(s.__idx,[o.width*i,o.height*i],t,e),r.dirty()),this.textAlign=t,this.textVerticalAlign=e},e.a=d},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(13),o=n(33),s=[0,1,2,0,2,3],l=a.a.extend((function(){return{attributes:{position:new a.a.Attribute("position","float",3,"POSITION"),texcoord:new a.a.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new a.a.Attribute("offset","float",2),color:new a.a.Attribute("color","float",4,"COLOR")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(t){this._spriteCount=t;var e=4*t,n=2*t;this.vertexCount!==e&&(this.attributes.position.init(e),this.attributes.offset.init(e),this.attributes.color.init(e)),this.triangleCount!==n&&(this.indices=e>65535?new Uint32Array(3*n):new Uint16Array(3*n))},setSpriteAlign:function(t,e,n,i,r){var a,o,s,l;switch(null==n&&(n="left"),null==i&&(i="top"),r=r||0,n){case"left":a=r,s=e[0]+r;break;case"center":case"middle":a=-e[0]/2,s=e[0]/2;break;case"right":a=-e[0]-r,s=-r}switch(i){case"bottom":o=r,l=e[1]+r;break;case"middle":o=-e[1]/2,l=e[1]/2;break;case"top":o=-e[1]-r,l=-r}var u=4*t,c=this.attributes.offset;c.set(u,[a,l]),c.set(u+1,[s,l]),c.set(u+2,[s,o]),c.set(u+3,[a,o])},addSprite:function(t,e,n,i,r,a){var o=this._vertexOffset;this.setSprite(this._vertexOffset/4,t,e,n,i,r,a);for(var l=0;l<s.length;l++)this.indices[3*this._faceOffset+l]=s[l]+o;return this._faceOffset+=2,this._vertexOffset+=4,o/4},setSprite:function(t,e,n,i,r,a,o){for(var s=4*t,l=this.attributes,u=0;u<4;u++)l.position.set(s+u,e);var c=l.texcoord;c.set(s,[i[0][0],i[0][1]]),c.set(s+1,[i[1][0],i[0][1]]),c.set(s+2,[i[1][0],i[1][1]]),c.set(s+3,[i[0][0],i[1][1]]),this.setSpriteAlign(t,n,r,a,o)}});r.a.util.defaults(l.prototype,o.a),e.a=l},function(t,e,n){"use strict";e.a="@export ecgl.labels.vertex\n\nattribute vec3 position: POSITION;\nattribute vec2 texcoord: TEXCOORD_0;\nattribute vec2 offset;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n vec4 proj = worldViewProjection * vec4(position, 1.0);\n\n vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;\n\n screen += offset;\n\n proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);\n gl_Position = proj;\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n v_Texcoord = texcoord;\n}\n@end\n\n\n@export ecgl.labels.fragment\n\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform float alpha : 1.0;\nuniform sampler2D textureAtlas;\nuniform vec2 uvScale: [1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nvarying float v_Miter;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n}\n\n@end"},function(t,e,n){"use strict";var i=n(146),r=n(148),a=n(0),o=n.n(a),s=n(41),l=n.n(s),u=n(20),c=n(3);function h(t,e){var n=t.getBoxLayoutParams(),i=l.a.getLayoutRect(n,{width:e.getWidth(),height:e.getHeight()});i.y=e.getHeight()-i.y-i.height,this.viewGL.setViewport(i.x,i.y,i.width,i.height,e.getDevicePixelRatio());var r=t.get("boxWidth"),a=t.get("boxHeight"),o=t.get("boxDepth");["x","y","z"].forEach((function(e){if(!this.getAxis(e))throw new Error("Grid"+t.id+" don't have "+e+"Axis")}),this),this.getAxis("x").setExtent(-r/2,r/2),this.getAxis("y").setExtent(o/2,-o/2),this.getAxis("z").setExtent(-a/2,a/2),this.size=[r,a,o]}function d(t,e){var n={};t.eachSeries((function(t){if(t.coordinateSystem===this){var e=t.getData();["x","y","z"].forEach((function(i){!function(t,e){n[t]=n[t]||[1/0,-1/0],n[t][0]=Math.min(e[0],n[t][0]),n[t][1]=Math.max(e[1],n[t][1])}(i,e.getDataExtent(t.coordDimToDataDim(i)[0],!0))}))}}),this),["xAxis3D","yAxis3D","zAxis3D"].forEach((function(e){t.eachComponent(e,(function(t){var i=e.charAt(0),a=t.getReferringComponents("grid3D")[0].coordinateSystem;if(a===this){var s=a.getAxis(i);if(s)console.warn("Can't have two %s in one grid3D",e);else{var l=o.a.helper.createScale(n[i]||[1/0,-1/0],t);(s=new r.a(i,l)).type=t.get("type");var u="category"===s.type;s.onBand=u&&t.get("boundaryGap"),s.inverse=t.get("inverse"),t.axis=s,s.model=t,a.addAxis(s)}}}),this)}),this),this.resize(this.model,e)}var f={dimensions:i.a.prototype.dimensions,create:function(t,e){var n=[];t.eachComponent("grid3D",(function(t){t.__viewGL=t.__viewGL||new u.a;var e=new i.a;e.model=t,e.viewGL=t.__viewGL,t.coordinateSystem=e,n.push(e),e.resize=h,e.update=d}));var r=["xAxis3D","yAxis3D","zAxis3D"];return t.eachSeries((function(e){if("cartesian3D"===e.get("coordinateSystem")){if(null==(i=e.getReferringComponents("grid3D")[0])){var n=function(t,e){return r.map((function(n){var i=t.getReferringComponents(n)[0];if(null==i&&(i=e.getComponent(n)),!i)throw new Error(n+' "'+c.a.firstNotNull(t.get(n+"Index"),t.get(n+"Id"),0)+'" not found');return i}))}(e,t),i=n[0].getCoordSysModel();n.forEach((function(t){var e=t.getCoordSysModel();if(!e)throw new Error('grid3D "'+c.a.firstNotNull(t.get("gridIndex"),t.get("gridId"),0)+'" not found');if(e!==i)throw new Error("xAxis3D, yAxis3D, zAxis3D must use the same grid")}))}var a=i.coordinateSystem;e.coordinateSystem=a}})),n}};o.a.registerCoordinateSystem("grid3D",f)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(147),o=n.n(a);function s(t){o.a.call(this,t),this.size=[0,0,0]}s.prototype={constructor:s,type:"cartesian3D",dimensions:["x","y","z"],model:null,containPoint:function(t){return this.getAxis("x").contain(t[0])&&this.getAxis("y").contain(t[2])&&this.getAxis("z").contain(t[1])},containData:function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])&&this.getAxis("z").containData(t[2])},dataToPoint:function(t,e,n){return(e=e||[])[0]=this.getAxis("x").dataToCoord(t[0],n),e[2]=this.getAxis("y").dataToCoord(t[1],n),e[1]=this.getAxis("z").dataToCoord(t[2],n),e},pointToData:function(t,e,n){return(e=e||[])[0]=this.getAxis("x").coordToData(t[0],n),e[1]=this.getAxis("y").coordToData(t[2],n),e[2]=this.getAxis("z").coordToData(t[1],n),e}},r.a.util.inherits(s,o.a),e.a=s},function(t,e,n){var i=n(12);function r(t){return this._axes[t]}var a=function(t){this._axes={},this._dimList=[],this.name=t||""};a.prototype={constructor:a,type:"cartesian",getAxis:function(t){return this._axes[t]},getAxes:function(){return i.map(this._dimList,r,this)},getAxesByScale:function(t){return t=t.toLowerCase(),i.filter(this.getAxes(),(function(e){return e.scale.type===t}))},addAxis:function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},dataToCoord:function(t){return this._dataCoordConvert(t,"dataToCoord")},coordToData:function(t){return this._dataCoordConvert(t,"coordToData")},_dataCoordConvert:function(t,e){for(var n=this._dimList,i=t instanceof Array?[]:{},r=0;r<n.length;r++){var a=n[r],o=this._axes[a];i[a]=o[e](t[a])}return i}};var o=a;t.exports=o},function(t,e,n){"use strict";var i=n(0),r=n.n(i);function a(t,e,n){r.a.Axis.call(this,t,e,n)}a.prototype={constructor:a,getExtentMin:function(){var t=this._extent;return Math.min(t[0],t[1])},getExtentMax:function(){var t=this._extent;return Math.max(t[0],t[1])}},r.a.util.inherits(a,r.a.Axis),e.a=a},function(t,e,n){var i=n(12),r=n(150),a=n(78),o=i.normalizeCssArray;function s(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var l=["a","b","c","d","e","f","g"],u=function(t,e){return"{"+t+(null==e?"":e)+"}"},c=function(t){return t<10?"0"+t:t},h=r.truncateText,d=r.getBoundingRect;e.addCommas=function(t){return isNaN(t)?"-":(t=(t+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")},e.toCamelCase=function(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t},e.normalizeCssArray=o,e.encodeHTML=s,e.formatTpl=function(t,e,n){i.isArray(e)||(e=[e]);var r=e.length;if(!r)return"";for(var a=e[0].$vars||[],o=0;o<a.length;o++){var c=l[o];t=t.replace(u(c),u(c,0))}for(var h=0;h<r;h++)for(var d=0;d<a.length;d++){var f=e[h][a[d]];t=t.replace(u(l[d],h),n?s(f):f)}return t},e.formatTplSimple=function(t,e,n){return i.each(e,(function(e,i){t=t.replace("{"+i+"}",n?s(e):e)})),t},e.getTooltipMarker=function(t,e){var n=(t=i.isString(t)?{color:t,extraCssText:e}:t||{}).color,r=t.type;return e=t.extraCssText,n?"subItem"===r?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+s(n)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+s(n)+";"+(e||"")+'"></span>':""},e.formatTime=function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=a.parseDate(e),r=n?"UTC":"",o=i["get"+r+"FullYear"](),s=i["get"+r+"Month"]()+1,l=i["get"+r+"Date"](),u=i["get"+r+"Hours"](),h=i["get"+r+"Minutes"](),d=i["get"+r+"Seconds"]();return t=t.replace("MM",c(s)).replace("M",s).replace("yyyy",o).replace("yy",o%100).replace("dd",c(l)).replace("d",l).replace("hh",c(u)).replace("h",u).replace("mm",c(h)).replace("m",h).replace("ss",c(d)).replace("s",d)},e.capitalFirst=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},e.truncateText=h,e.getTextRect=d},function(t,e,n){var i=n(75),r=n(151),a=n(12),o=a.getContext,s=a.extend,l=a.retrieve2,u=a.retrieve3,c={},h=0,d=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,f="12px sans-serif",p={};function g(t,e){var n=t+":"+(e=e||f);if(c[n])return c[n];for(var i=(t+"").split("\n"),r=0,a=0,o=i.length;a<o;a++)r=Math.max(w(i[a],e).width,r);return h>5e3&&(h=0,c={}),h++,c[n]=r,r}function m(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function v(t,e,n){return"middle"===n?t-=e/2:"bottom"===n&&(t-=e),t}function y(t,e,n,i,r){if(!e)return"";var a=(t+"").split("\n");r=x(e,n,i,r);for(var o=0,s=a.length;o<s;o++)a[o]=b(a[o],r);return a.join("\n")}function x(t,e,n,i){(i=s({},i)).font=e,n=l(n,"..."),i.maxIterations=l(i.maxIterations,2);var r=i.minChar=l(i.minChar,0);i.cnCharWidth=g("国",e);var a=i.ascCharWidth=g("a",e);i.placeholder=l(i.placeholder,"");for(var o=t=Math.max(0,t-1),u=0;u<r&&o>=a;u++)o-=a;var c=g(n);return c>o&&(n="",c=0),o=t-c,i.ellipsis=n,i.ellipsisWidth=c,i.contentWidth=o,i.containerWidth=t,i}function b(t,e){var n=e.containerWidth,i=e.font,r=e.contentWidth;if(!n)return"";var a=g(t,i);if(a<=n)return t;for(var o=0;;o++){if(a<=r||o>=e.maxIterations){t+=e.ellipsis;break}var s=0===o?_(t,r,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*r/a):0;a=g(t=t.substr(0,s),i)}return""===t&&(t=e.placeholder),t}function _(t,e,n,i){for(var r=0,a=0,o=t.length;a<o&&r<e;a++){var s=t.charCodeAt(a);r+=0<=s&&s<=127?n:i}return a}function E(t){return g("国",t)}function w(t,e){return p.measureText(t,e)}function T(t,e,n,i){null!=t&&(t+="");var r=E(e),a=t?t.split("\n"):[],o=a.length*r,s=o;if(n&&(s+=n[0]+n[2]),t&&i){var l=i.outerHeight,u=i.outerWidth;if(null!=l&&s>l)t="",a=[];else if(null!=u)for(var c=x(u-(n?n[1]+n[3]:0),e,i.ellipsis,{minChar:i.minChar,placeholder:i.placeholder}),h=0,d=a.length;h<d;h++)a[h]=b(a[h],c)}return{lines:a,height:o,outerHeight:s,lineHeight:r}}function S(t,e){var n={lines:[],width:0,height:0};if(null!=t&&(t+=""),!t)return n;for(var i,a=d.lastIndex=0;null!=(i=d.exec(t));){var o=i.index;o>a&&M(n,t.substring(a,o)),M(n,i[2],i[1]),a=d.lastIndex}a<t.length&&M(n,t.substring(a,t.length));var s=n.lines,c=0,h=0,f=[],p=e.textPadding,m=e.truncate,v=m&&m.outerWidth,x=m&&m.outerHeight;p&&(null!=v&&(v-=p[1]+p[3]),null!=x&&(x-=p[0]+p[2]));for(var b=0;b<s.length;b++){for(var _=s[b],w=0,T=0,S=0;S<_.tokens.length;S++){var C=(B=_.tokens[S]).styleName&&e.rich[B.styleName]||{},A=B.textPadding=C.textPadding,O=B.font=C.font||e.font,N=B.textHeight=l(C.textHeight,E(O));if(A&&(N+=A[0]+A[2]),B.height=N,B.lineHeight=u(C.textLineHeight,e.textLineHeight,N),B.textAlign=C&&C.textAlign||e.textAlign,B.textVerticalAlign=C&&C.textVerticalAlign||"middle",null!=x&&c+B.lineHeight>x)return{lines:[],width:0,height:0};B.textWidth=g(B.text,O);var P=C.textWidth,L=null==P||"auto"===P;if("string"==typeof P&&"%"===P.charAt(P.length-1))B.percentWidth=P,f.push(B),P=0;else{if(L){P=B.textWidth;var R=C.textBackgroundColor,D=R&&R.image;D&&(D=r.findExistImage(D),r.isImageReady(D)&&(P=Math.max(P,D.width*N/D.height)))}var k=A?A[1]+A[3]:0;P+=k;var I=null!=v?v-T:null;null!=I&&I<P&&(!L||I<k?(B.text="",B.textWidth=P=0):(B.text=y(B.text,I-k,O,m.ellipsis,{minChar:m.minChar}),B.textWidth=g(B.text,O),P=B.textWidth+k))}T+=B.width=P,C&&(w=Math.max(w,B.lineHeight))}_.width=T,_.lineHeight=w,c+=w,h=Math.max(h,T)}for(n.outerWidth=n.width=l(e.textWidth,h),n.outerHeight=n.height=l(e.textHeight,c),p&&(n.outerWidth+=p[1]+p[3],n.outerHeight+=p[0]+p[2]),b=0;b<f.length;b++){var B,F=(B=f[b]).percentWidth;B.width=parseInt(F,10)/100*h}return n}function M(t,e,n){for(var i=""===e,r=e.split("\n"),a=t.lines,o=0;o<r.length;o++){var s=r[o],l={styleName:n,text:s,isLineHolder:!s&&!i};if(o)a.push({tokens:[l]});else{var u=(a[a.length-1]||(a[0]={tokens:[]})).tokens,c=u.length;1===c&&u[0].isLineHolder?u[0]=l:(s||!c||i)&&u.push(l)}}}p.measureText=function(t,e){var n=o();return n.font=e||f,n.measureText(t)},e.DEFAULT_FONT=f,e.$override=function(t,e){p[t]=e},e.getWidth=g,e.getBoundingRect=function(t,e,n,r,a,o,s){return o?function(t,e,n,r,a,o,s){var l=S(t,{rich:o,truncate:s,font:e,textAlign:n,textPadding:a}),u=l.outerWidth,c=l.outerHeight,h=m(0,u,n),d=v(0,c,r);return new i(h,d,u,c)}(t,e,n,r,a,o,s):function(t,e,n,r,a,o){var s=T(t,e,a,o),l=g(t,e);a&&(l+=a[1]+a[3]);var u=s.outerHeight,c=m(0,l,n),h=v(0,u,r),d=new i(c,h,l,u);return d.lineHeight=s.lineHeight,d}(t,e,n,r,a,s)},e.adjustTextX=m,e.adjustTextY=v,e.adjustTextPositionOnRect=function(t,e,n){var i=e.x,r=e.y,a=e.height,o=e.width,s=a/2,l="left",u="top";switch(t){case"left":i-=n,r+=s,l="right",u="middle";break;case"right":i+=n+o,r+=s,u="middle";break;case"top":i+=o/2,r-=n,l="center",u="bottom";break;case"bottom":i+=o/2,r+=a+n,l="center";break;case"inside":i+=o/2,r+=s,l="center",u="middle";break;case"insideLeft":i+=n,r+=s,u="middle";break;case"insideRight":i+=o-n,r+=s,l="right",u="middle";break;case"insideTop":i+=o/2,r+=n,l="center";break;case"insideBottom":i+=o/2,r+=a-n,l="center",u="bottom";break;case"insideTopLeft":i+=n,r+=n;break;case"insideTopRight":i+=o-n,r+=n,l="right";break;case"insideBottomLeft":i+=n,r+=a-n,u="bottom";break;case"insideBottomRight":i+=o-n,r+=a-n,l="right",u="bottom"}return{x:i,y:r,textAlign:l,textVerticalAlign:u}},e.truncateText=y,e.getLineHeight=E,e.measureText=w,e.parsePlainText=T,e.parseRichText=S,e.makeFont=function(t){return(t.fontSize||t.fontFamily)&&[t.fontStyle,t.fontWeight,(t.fontSize||12)+"px",t.fontFamily||"sans-serif"].join(" ")||t.textFont||t.font}},function(t,e,n){var i=new(n(53))(50);function r(){var t=this.__cachedImgObj;this.onload=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var n=t.pending[e],i=n.cb;i&&i(this,n.cbPayload),n.hostEl.dirty()}t.pending.length=0}function a(t){return t&&t.width&&t.height}e.findExistImage=function(t){if("string"==typeof t){var e=i.get(t);return e&&e.image}return t},e.createOrUpdateImage=function(t,e,n,o,s){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var l=i.get(t),u={hostEl:n,cb:o,cbPayload:s};return l?!a(e=l.image)&&l.pending.push(u):(!e&&(e=new Image),e.onload=r,i.put(t,e.__cachedImgObj={image:e,pending:[u]}),e.src=e.__zrImageSrc=t),e}return t}return e},e.isImageReady=a},function(t,e,n){"use strict";var i=n(8),r=n(11),a=n(4),o=n(15),s=n(52),l=n(9),u=n(46),c=n(7),h=(n(19),n(24),n(72)),d=n(70),f=n(71),p=(n(153),n(17)),g=n(10),m=n(6),v=n(5),y=n(25),x=n(36),b=n(30),_=n(14),E=n(79),w=n(1),T=n.n(w),S=n(154),M=T.a.mat4,C=(T.a.vec3,["px","nx","py","ny","pz","nz"]);c.a.import(S.a);var A,O,N,P,L,R,D,k=i.a.extend((function(){return{softShadow:k.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"mediump",_lastRenderNotCastShadow:!1,_frameBuffer:new g.a,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_opaqueCasters:[],_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new E.a}}),(function(){this._gaussianPassH=new _.a({fragment:c.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new _.a({fragment:c.a.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new _.a({fragment:c.a.source("clay.sm.debug_depth")})}),{render:function(t,e,n,i){n||(n=e.getMainCamera()),this.trigger("beforerender",this,t,e,n),this._renderShadowPass(t,e,n,i),this.trigger("afterrender",this,t,e,n)},renderDebug:function(t,e){t.saveClear();var n=t.viewport,i=0,r=e||n.width/4,a=r;for(var o in this.softShadow===k.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var s=this._textures[o];t.setViewport(i,0,r*s.width/s.height,a),this._outputDepthPass.setUniform("depthMap",s),this._outputDepthPass.render(t),i+=r*s.width/s.height}t.setViewport(n),t.restoreClear()},_updateCasterAndReceiver:function(t,e){if(e.castShadow&&this._opaqueCasters.push(e),e.receiveShadow?(this._receivers.push(e),e.material.set("shadowEnabled",1),e.material.set("pcfKernel",this.kernelPCF)):e.material.set("shadowEnabled",0),!e.material.shader&&e.material.updateShader&&e.material.updateShader(t),this.softShadow===k.VSM)e.material.define("fragment","USE_VSM"),e.material.undefine("fragment","PCF_KERNEL_SIZE");else{e.material.undefine("fragment","USE_VSM");var n=this.kernelPCF;n&&n.length?e.material.define("fragment","PCF_KERNEL_SIZE",n.length/2):e.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(t,e){for(var n=0;n<e.opaqueList.length;n++)this._updateCasterAndReceiver(t,e.opaqueList[n]);for(n=0;n<e.transparentList.length;n++)this._updateCasterAndReceiver(t,e.transparentList[n]);for(n=0;n<e.lights.length;n++){var i=e.lights[n];i.castShadow&&this._lightsCastShadow.push(i)}},_renderShadowPass:function(t,e,n,i){for(var r in this._shadowMapNumber)this._shadowMapNumber[r]=0;this._lightsCastShadow.length=0,this._opaqueCasters.length=0,this._receivers.length=0;var a=t.gl;if(i||e.update(),n&&n.update(),this._update(t,e),this._lightsCastShadow.length||!this._lastRenderNotCastShadow){this._lastRenderNotCastShadow=0===this._lightsCastShadow,a.enable(a.DEPTH_TEST),a.depthMask(!0),a.disable(a.BLEND),a.clearColor(1,1,1,1);for(var o,s=[],l=[],u=[],c=[],p=[],g=[],m=0;m<this._lightsCastShadow.length;m++){var v=this._lightsCastShadow[m];if(v instanceof d.a){if(o){console.warn("Only one direectional light supported with shadow cascade");continue}if(v.shadowCascade>4){console.warn("Support at most 4 cascade");continue}v.shadowCascade>1&&(o=v.shadowCascade),this.renderDirectionalLightShadow(t,e,n,v,this._opaqueCasters,p,c,u)}else v instanceof h.a?this.renderSpotLightShadow(t,e,v,this._opaqueCasters,l,s):v instanceof f.a&&this.renderPointLightShadow(t,e,v,this._opaqueCasters,g);this._shadowMapNumber[v.type]++}for(var y in this._shadowMapNumber){var x=this._shadowMapNumber[y],b=y+"_SHADOWMAP_COUNT";for(m=0;m<this._receivers.length;m++)(_=this._receivers[m].material).fragmentDefines[b]!==x&&(x>0?_.define("fragment",b,x):_.isDefined("fragment",b)&&_.undefine("fragment",b))}for(m=0;m<this._receivers.length;m++){var _=this._receivers[m].material;o?_.define("fragment","SHADOW_CASCADE",o.shadowCascade):_.undefine("fragment","SHADOW_CASCADE")}var E=e.shadowUniforms;if(u.length>0){var w=u.map(C);if(E.directionalLightShadowMaps={value:u,type:"tv"},E.directionalLightMatrices={value:c,type:"m4v"},E.directionalLightShadowMapSizes={value:w,type:"1fv"},o){var T=p.slice(),S=p.slice();T.pop(),S.shift(),T.reverse(),S.reverse(),c.reverse(),E.shadowCascadeClipsNear={value:T,type:"1fv"},E.shadowCascadeClipsFar={value:S,type:"1fv"}}}if(s.length>0){var M=s.map(C);(E=e.shadowUniforms).spotLightShadowMaps={value:s,type:"tv"},E.spotLightMatrices={value:l,type:"m4v"},E.spotLightShadowMapSizes={value:M,type:"1fv"}}g.length>0&&(E.pointLightShadowMaps={value:g,type:"tv"})}function C(t){return t.height}},renderDirectionalLightShadow:(A=new s.a,O=new l.a,N=new o.a,P=new l.a,L=new l.a,R=new l.a,D=new l.a,function(t,e,n,i,r,a,o,s){var c=this._getDepthMaterial(i),h={getMaterial:function(t){return t.shadowDepthMaterial||c},sortCompare:u.a.opaqueSortCompare};if(!e.viewBoundingBoxLastFrame.isFinite()){var d=e.getBoundingBox();e.viewBoundingBoxLastFrame.copy(d).applyTransform(n.viewMatrix)}var f=Math.min(-e.viewBoundingBoxLastFrame.min.z,n.far),p=Math.max(-e.viewBoundingBoxLastFrame.max.z,n.near),g=this._getDirectionalLightCamera(i,e,n),m=R.array;D.copy(g.projectionMatrix),M.invert(L.array,g.worldTransform.array),M.multiply(L.array,L.array,n.worldTransform.array),M.multiply(m,D.array,L.array);for(var v=[],y=n instanceof x.a,b=(n.near+n.far)/(n.near-n.far),_=2*n.near*n.far/(n.near-n.far),E=0;E<=i.shadowCascade;E++){var w=p*Math.pow(f/p,E/i.shadowCascade),T=p+(f-p)*E/i.shadowCascade,S=w*i.cascadeSplitLogFactor+T*(1-i.cascadeSplitLogFactor);v.push(S),a.push(-(-S*b+_)/-S)}var C=this._getTexture(i,i.shadowCascade);s.push(C);var I=t.viewport,B=t.gl;for(this._frameBuffer.attach(C),this._frameBuffer.bind(t),B.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT),E=0;E<i.shadowCascade;E++){var F=v[E],z=v[E+1];y?M.perspective(O.array,n.fov/180*Math.PI,n.aspect,F,z):M.ortho(O.array,n.left,n.right,n.bottom,n.top,F,z),A.setFromProjection(O),A.getTransformedBoundingBox(N,L),N.applyProjection(D);var G=N.min.array,j=N.max.array;G[0]=Math.max(G[0],-1),G[1]=Math.max(G[1],-1),j[0]=Math.min(j[0],1),j[1]=Math.min(j[1],1),P.ortho(G[0],j[0],G[1],j[1],1,-1),g.projectionMatrix.multiplyLeft(P);var U=i.shadowResolution||512;t.setViewport((i.shadowCascade-E-1)*U,0,U,U,1),t.renderPass(r,g,h),this.softShadow===k.VSM&&this._gaussianFilter(t,C,C.width);var H=new l.a;H.copy(g.viewMatrix).multiplyLeft(g.projectionMatrix),o.push(H.array),g.projectionMatrix.copy(D)}this._frameBuffer.unbind(t),t.setViewport(I)}),renderSpotLightShadow:function(t,e,n,i,r,a){var o=this._getTexture(n),s=this._getSpotLightCamera(n),c=t.gl;this._frameBuffer.attach(o),this._frameBuffer.bind(t),c.clear(c.COLOR_BUFFER_BIT|c.DEPTH_BUFFER_BIT);var h=this._getDepthMaterial(n),d={getMaterial:function(t){return t.shadowDepthMaterial||h},sortCompare:u.a.opaqueSortCompare};t.renderPass(t.cullRenderList(i,null,s),s,d),this._frameBuffer.unbind(t),this.softShadow===k.VSM&&this._gaussianFilter(t,o,o.width);var f=new l.a;f.copy(s.worldTransform).invert().multiplyLeft(s.projectionMatrix),a.push(o),r.push(f.array)},renderPointLightShadow:function(t,e,n,i,r){var a=this._getTexture(n),o=t.gl;r.push(a);for(var s=this._getDepthMaterial(n),l={getMaterial:function(t){return t.shadowDepthMaterial||s},sortCompare:u.a.opaqueSortCompare},c=0;c<6;c++){var h=C[c],d=this._getPointLightCamera(n,h);this._frameBuffer.attach(a,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+c),this._frameBuffer.bind(t),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),t.renderPass(t.cullRenderList(i,null,d),d,l)}this._frameBuffer.unbind(t)},_getDepthMaterial:function(t){var e=this._lightMaterials[t.__uid__],n=t instanceof f.a;if(!e){var i=n?"clay.sm.distance.":"clay.sm.depth.";e=new p.a({precision:this.precision,shader:new c.a(c.a.source(i+"vertex"),c.a.source(i+"fragment"))}),this._lightMaterials[t.__uid__]=e}return null!=t.shadowSlopeScale&&e.setUniform("slopeScale",t.shadowSlopeScale),null!=t.shadowBias&&e.setUniform("shadowBias",t.shadowBias),this.softShadow===k.VSM?e.define("fragment","USE_VSM"):e.undefine("fragment","USE_VSM"),n&&(e.set("lightPosition",t.getWorldPosition().array),e.set("range",t.range)),e},_gaussianFilter:function(t,e,n){var i={width:n,height:n,type:m.a.FLOAT},r=this._texturePool.get(i);this._frameBuffer.attach(r),this._frameBuffer.bind(t),this._gaussianPassH.setUniform("texture",e),this._gaussianPassH.setUniform("textureWidth",n),this._gaussianPassH.render(t),this._frameBuffer.attach(e),this._gaussianPassV.setUniform("texture",r),this._gaussianPassV.setUniform("textureHeight",n),this._gaussianPassV.render(t),this._frameBuffer.unbind(t),this._texturePool.put(r)},_getTexture:function(t,e){var n=t.__uid__,i=this._textures[n],a=t.shadowResolution||512;return e=e||1,i||((i=t instanceof f.a?new y.a:new v.a).width=a*e,i.height=a,this.softShadow===k.VSM?(i.type=m.a.FLOAT,i.anisotropic=4):(i.minFilter=r.a.NEAREST,i.magFilter=r.a.NEAREST,i.useMipmap=!1),this._textures[n]=i),i},_getPointLightCamera:function(t,e){this._lightCameras.point||(this._lightCameras.point={px:new x.a,nx:new x.a,py:new x.a,ny:new x.a,pz:new x.a,nz:new x.a});var n=this._lightCameras.point[e];switch(n.far=t.range,n.fov=90,n.position.set(0,0,0),e){case"px":n.lookAt(a.a.POSITIVE_X,a.a.NEGATIVE_Y);break;case"nx":n.lookAt(a.a.NEGATIVE_X,a.a.NEGATIVE_Y);break;case"py":n.lookAt(a.a.POSITIVE_Y,a.a.POSITIVE_Z);break;case"ny":n.lookAt(a.a.NEGATIVE_Y,a.a.NEGATIVE_Z);break;case"pz":n.lookAt(a.a.POSITIVE_Z,a.a.NEGATIVE_Y);break;case"nz":n.lookAt(a.a.NEGATIVE_Z,a.a.NEGATIVE_Y)}return t.getWorldPosition(n.position),n.update(),n},_getDirectionalLightCamera:function(){var t=new l.a,e=new o.a,n=new o.a;return function(i,r,a){this._lightCameras.directional||(this._lightCameras.directional=new b.a);var o=this._lightCameras.directional;e.copy(r.viewBoundingBoxLastFrame),e.intersection(a.frustum.boundingBox),o.position.copy(e.min).add(e.max).scale(.5).transformMat4(a.worldTransform),o.rotation.copy(i.rotation),o.scale.copy(i.scale),o.updateWorldTransform(),l.a.invert(t,o.worldTransform),l.a.multiply(t,t,a.worldTransform),n.copy(e).applyTransform(t);var s=n.min.array,u=n.max.array;return o.position.set((s[0]+u[0])/2,(s[1]+u[1])/2,u[2]).transformMat4(o.worldTransform),o.near=0,o.far=-s[2]+u[2],isNaN(this.lightFrustumBias)?o.far*=4:o.far+=this.lightFrustumBias,o.left=s[0],o.right=u[0],o.top=u[1],o.bottom=s[1],o.update(!0),o}}(),_getSpotLightCamera:function(t){this._lightCameras.spot||(this._lightCameras.spot=new x.a);var e=this._lightCameras.spot;return e.fov=2*t.penumbraAngle,e.far=t.range,e.worldTransform.copy(t.worldTransform),e.updateProjectionMatrix(),M.invert(e.viewMatrix.array,e.worldTransform.array),e},dispose:function(t){var e=t.gl||t;for(var n in this._frameBuffer&&this._frameBuffer.dispose(e),this._textures)this._textures[n].dispose(e);this._texturePool.clear(t.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var i=0;i<this._receivers.length;i++){var r=this._receivers[i];if(r.material&&r.material.shader){var a=r.material,o=a.shader;o.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),o.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),o.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),a.set("shadowEnabled",0)}}this._opaqueCasters=[],this._receivers=[],this._lightsCastShadow=[]}});k.VSM=1,k.PCF=2,e.a=k},function(t,e,n){"use strict";var i=n(7),r={};function a(){this._pool={}}a.prototype.get=function(t){var e=t;if(this._pool[e])return this._pool[e];var n=r[t];if(n){var a=new i.a(n.vertex,n.fragment);return this._pool[e]=a,a}console.error('Shader "'+t+'" is not in the library')},a.prototype.clear=function(){this._pool={}},new a},function(t,e,n){"use strict";e.a="@export clay.sm.depth.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\n#ifdef SHADOW_TRANSPARENT\nattribute vec2 texcoord : TEXCOORD_0;\n#endif\n@import clay.chunk.skinning_header\nvarying vec4 v_ViewPosition;\n#ifdef SHADOW_TRANSPARENT\nvarying vec2 v_Texcoord;\n#endif\nvoid main(){\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n v_ViewPosition = worldViewProjection * vec4(skinnedPosition, 1.0);\n gl_Position = v_ViewPosition;\n#ifdef SHADOW_TRANSPARENT\n v_Texcoord = texcoord;\n#endif\n}\n@end\n@export clay.sm.depth.fragment\nvarying vec4 v_ViewPosition;\n#ifdef SHADOW_TRANSPARENT\nvarying vec2 v_Texcoord;\n#endif\nuniform float bias : 0.001;\nuniform float slopeScale : 1.0;\n#ifdef SHADOW_TRANSPARENT\nuniform sampler2D transparentMap;\n#endif\n@import clay.util.encode_float\nvoid main(){\n float depth = v_ViewPosition.z / v_ViewPosition.w;\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n#ifdef SHADOW_TRANSPARENT\n if (texture2D(transparentMap, v_Texcoord).a <= 0.1) {\n gl_FragColor = encodeFloat(0.9999);\n return;\n }\n#endif\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n gl_Position = worldViewProjection * vec4(skinnedPosition , 1.0);\n v_WorldPosition = (world * vec4(skinnedPosition, 1.0)).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end"},function(t,e,n){"use strict";var i=n(7),r=n(5),a=n(6),o=n(10),s=n(156),l=n(162),u=n(164),c=n(166),h=n(2),d=n(167),f=n(169),p=(n(9),n(170)),g=n(171),m=n(172),v=n(173),y=n(174),x=n(175),b=n(176),_=n(177),E=n(178),w=n(179),T=n(180),S=n(181);i.a.import(g.a),i.a.import(m.a),i.a.import(v.a),i.a.import(y.a),i.a.import(x.a),i.a.import(b.a),i.a.import(_.a),i.a.import(E.a),i.a.import(w.a),i.a.import(T.a),i.a.import(S.a);var M={color:{parameters:{width:function(t){return t.getWidth()},height:function(t){return t.getHeight()}}}},C=["composite","FXAA"];function A(){this._sourceTexture=new r.a({type:a.a.HALF_FLOAT}),this._depthTexture=new r.a({format:a.a.DEPTH_COMPONENT,type:a.a.UNSIGNED_INT}),this._framebuffer=new o.a,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,o.a.DEPTH_ATTACHMENT),this._normalPass=new d.a,this._compositor=Object(s.a)(p.a);var t=this._compositor.getNodeByName("source");t.texture=this._sourceTexture;var e=this._compositor.getNodeByName("coc");this._sourceNode=t,this._cocNode=e,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map((function(t){return this._compositor.getNodeByName(t)}),this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=C.map((function(t){return this._compositor.getNodeByName(t)}),this);var n={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new l.a(n),this._ssrPass=new u.a(n),this._edgePass=new f.a(n)}A.prototype.resize=function(t,e,n){t*=n=n||1,e*=n;var i=this._sourceTexture,r=this._depthTexture;i.width=t,i.height=e,r.width=t,r.height=e},A.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},A.prototype._getPrevNode=function(t){for(var e=C.indexOf(t.name)-1,n=this._finalNodesChain[e];n&&!this._compositor.getNodeByName(n.name);)e-=1,n=this._finalNodesChain[e];return n},A.prototype._getNextNode=function(t){for(var e=C.indexOf(t.name)+1,n=this._finalNodesChain[e];n&&!this._compositor.getNodeByName(n.name);)e+=1,n=this._finalNodesChain[e];return n},A.prototype._addChainNode=function(t){var e=this._getPrevNode(t),n=this._getNextNode(t);e&&(e.outputs=M,t.inputs.texture=e.name,n?(t.outputs=M,n.inputs.texture=t.name):t.outputs=null,this._compositor.addNode(t))},A.prototype._removeChainNode=function(t){var e=this._getPrevNode(t),n=this._getNextNode(t);e&&(n?(e.outputs=M,n.inputs.texture=e.name):e.outputs=null,this._compositor.removeNode(t))},A.prototype.updateNormal=function(t,e,n,i){this._ifRenderNormalPass()&&this._normalPass.update(t,e,n)},A.prototype.updateSSAO=function(t,e,n,i){this._ssaoPass.update(t,n,i)},A.prototype.enableSSAO=function(){this._enableSSAO=!0},A.prototype.disableSSAO=function(){this._enableSSAO=!1},A.prototype.enableSSR=function(){this._enableSSR=!0},A.prototype.disableSSR=function(){this._enableSSR=!1},A.prototype.getSSAOTexture=function(t,e,n,i){return this._ssaoPass.getTargetTexture()},A.prototype.getSourceFrameBuffer=function(){return this._framebuffer},A.prototype.getSourceTexture=function(){return this._sourceTexture},A.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},A.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},A.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},A.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},A.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},A.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},A.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},A.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},A.prototype.enableEdge=function(){this._enableEdge=!0},A.prototype.disableEdge=function(){this._enableEdge=!1},A.prototype.setBloomIntensity=function(t){this._compositeNode.setParameter("bloomIntensity",t)},A.prototype.setSSAOParameter=function(t,e){switch(t){case"quality":var n={low:6,medium:12,high:32,ultra:62}[e]||12;this._ssaoPass.setParameter("kernelSize",n);break;case"radius":this._ssaoPass.setParameter(t,e),this._ssaoPass.setParameter("bias",e/200);break;case"intensity":this._ssaoPass.setParameter(t,e);break;default:console.warn("Unkown SSAO parameter "+t)}},A.prototype.setDOFParameter=function(t,e){switch(t){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(t,e);break;case"blurRadius":for(var n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].setParameter("blurRadius",e);break;case"quality":var i={low:4,medium:8,high:16,ultra:32}[e]||8;for(this._dofBlurKernelSize=i,n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].pass.material.define("POISSON_KERNEL_SIZE",i);this._dofBlurKernel=new Float32Array(2*i);break;default:console.warn("Unkown DOF parameter "+t)}},A.prototype.setSSRParameter=function(t,e){switch(t){case"quality":var n={low:10,medium:20,high:40,ultra:80}[e]||20,i={low:32,medium:16,high:8,ultra:4}[e]||16;this._ssrPass.setParameter("maxIteration",n),this._ssrPass.setParameter("pixelStride",i);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-e,1),0));break;default:console.warn("Unkown SSR parameter "+t)}},A.prototype.setEdgeColor=function(t){var e=h.a.parseColor(t);this._edgePass.setParameter("edgeColor",e)},A.prototype.setExposure=function(t){this._compositeNode.setParameter("exposure",Math.pow(2,t))},A.prototype.setColorLookupTexture=function(t,e){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?t:"none",e,{minFilter:h.a.Texture.NEAREST,magFilter:h.a.Texture.NEAREST,flipY:!1})},A.prototype.setColorCorrection=function(t,e){this._compositeNode.setParameter(t,e)},A.prototype.composite=function(t,e,n,i){var r=this._sourceTexture,a=r;this._enableEdge&&(this._edgePass.update(t,e,r,i),r=a=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(t,e,r,i),a=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=a,this._cocNode.setParameter("depth",this._depthTexture);for(var o=this._dofBlurKernel,s=this._dofBlurKernelSize,l=i%Math.floor(c.a.length/2/s),u=0;u<2*s;u++)o[u]=c.a[u+l*s*2];for(u=0;u<this._dofBlurNodes.length;u++)this._dofBlurNodes[u].setParameter("percent",i/30),this._dofBlurNodes[u].setParameter("poissonKernel",o);this._cocNode.setParameter("zNear",e.near),this._cocNode.setParameter("zFar",e.far),this._compositor.render(t,n)},A.prototype.dispose=function(t){this._sourceTexture.dispose(t),this._depthTexture.dispose(t),this._framebuffer.dispose(t),this._compositor.dispose(t),this._normalPass.dispose(t),this._ssaoPass.dispose(t)},e.a=A},function(t,e,n){"use strict";var i=n(21),r=n(157),a=n(159),o=n(160),s=n(161),l=n(7),u=n(6),c=n(5),h=n(25),d=/^#source\((.*?)\)/;function f(t,e,n){var i,r,u,c,h=t.type||"filter";if("filter"===h){var f=t.shader.trim(),v=d.exec(f);if(v?i=l.a.source(v[1].trim()):"#"===f.charAt(0)&&(i=e.shaders[f.substr(1)]),i||(i=f),!i)return}if(t.inputs)for(var y in r={},t.inputs)"string"==typeof t.inputs[y]?r[y]=t.inputs[y]:r[y]={node:t.inputs[y].node,pin:t.inputs[y].pin};if(t.outputs)for(var y in u={},t.outputs){var x=t.outputs[y];u[y]={},null!=x.attachment&&(u[y].attachment=x.attachment),null!=x.keepLastFrame&&(u[y].keepLastFrame=x.keepLastFrame),null!=x.outputLastFrame&&(u[y].outputLastFrame=x.outputLastFrame),x.parameters&&(u[y].parameters=p(x.parameters))}if(c="scene"===h?new a.a({name:t.name,scene:n.scene,camera:n.camera,outputs:u}):"texture"===h?new o.a({name:t.name,outputs:u}):new s.a({name:t.name,shader:i,inputs:r,outputs:u})){if(t.parameters)for(var y in t.parameters)"string"==typeof(b=t.parameters[y])&&("#"===(b=b.trim()).charAt(0)?b=e.textures[b.substr(1)]:c.on("beforerender",g(y,m(b)))),c.setParameter(y,b);if(t.defines&&c.pass)for(var y in t.defines){var b=t.defines[y];c.pass.material.define("fragment",y,b)}}return c}function p(t){var e={};return t?(["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach((function(n){var i=t[n];null!=i&&("string"==typeof i&&(i=u.a[i]),e[n]=i)})),["width","height"].forEach((function(n){if(null!=t[n]){var i=t[n];"string"==typeof i?(i=i.trim(),e[n]=(r=m(i),function(t){var e=t.getDevicePixelRatio(),n=t.getWidth(),i=t.getHeight();return r(n,i,e)})):e[n]=i}var r})),null!=t.useMipmap&&(e.useMipmap=t.useMipmap),e):e}function g(t,e){return function(n){var i=n.getDevicePixelRatio(),r=n.getWidth(),a=n.getHeight(),o=e(r,a,i);this.setParameter(t,o)}}function m(t){var e=/^expr\((.*)\)$/.exec(t);if(e)try{var n=new Function("width","height","dpr","return "+e[1]);return n(1,1),n}catch(t){throw new Error("Invalid expression.")}}e.a=function(t,e){var n=new r.a;e=e||{};var a={textures:{},parameters:{}};for(var o in t.parameters){var s=t.parameters[o];a.parameters[o]=p(s)}return function(t,e,n,r){if(t.textures){var a={},o=0,s=!1,l=n.textureRootPath;i.a.each(t.textures,(function(t,e){var n,u=t.path,d=p(t.parameters);if(Array.isArray(u)&&6===u.length)l&&(u=u.map((function(t){return i.a.relative2absolute(t,l)}))),n=new h.a(d);else{if("string"!=typeof u)return;l&&(u=i.a.relative2absolute(u,l)),n=new c.a(d)}n.load(u),o++,n.once("success",(function(){a[e]=n,0==--o&&(r(a),s=!0)}))})),0!==o||s||r(a)}else r({})}(t,0,e,(function(i){a.textures=i,function(i,r){for(var o=0;o<t.nodes.length;o++){var s=f(t.nodes[o],a,e);s&&n.addNode(s)}}()})),n}},function(t,e,n){"use strict";var i=n(158),r=n(79),a=n(10),o=i.a.extend((function(){return{_outputs:[],_texturePool:new r.a,_frameBuffer:new a.a({depthBuffer:!1})}}),{addNode:function(t){i.a.prototype.addNode.call(this,t),t._compositor=this},render:function(t,e){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var n=0;n<this.nodes.length;n++)this.nodes[n].outputs||this._outputs.push(this.nodes[n])}for(n=0;n<this.nodes.length;n++)this.nodes[n].beforeFrame();for(n=0;n<this._outputs.length;n++)this._outputs[n].updateReference();for(n=0;n<this._outputs.length;n++)this._outputs[n].render(t,e);for(n=0;n<this.nodes.length;n++)this.nodes[n].afterFrame()},allocateTexture:function(t){return this._texturePool.get(t)},releaseTexture:function(t){this._texturePool.put(t)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(t){this._texturePool.clear(t)}});e.a=o},function(t,e,n){"use strict";var i=n(8),r=n(42),a=i.a.extend((function(){return{nodes:[]}}),{dirty:function(){this._dirty=!0},addNode:function(t){this.nodes.indexOf(t)>=0||(this.nodes.push(t),this._dirty=!0)},removeNode:function(t){"string"==typeof t&&(t=this.getNodeByName(t));var e=this.nodes.indexOf(t);e>=0&&(this.nodes.splice(e,1),this._dirty=!0)},getNodeByName:function(t){for(var e=0;e<this.nodes.length;e++)if(this.nodes[e].name===t)return this.nodes[e]},update:function(){for(var t=0;t<this.nodes.length;t++)this.nodes[t].clear();for(t=0;t<this.nodes.length;t++){var e=this.nodes[t];if(e.inputs)for(var n in e.inputs)if(e.inputs[n])if(!e.pass||e.pass.material.isUniformEnabled(n)){var i=e.inputs[n],r=this.findPin(i);r?e.link(n,r.node,r.pin):"string"==typeof i?console.warn("Node "+i+" not exist"):console.warn("Pin of "+i.node+"."+i.pin+" not exist")}else console.warn("Pin "+e.name+"."+n+" not used.")}},findPin:function(t){var e;if(("string"==typeof t||t instanceof r.a)&&(t={node:t}),"string"==typeof t.node)for(var n=0;n<this.nodes.length;n++){var i=this.nodes[n];i.name===t.node&&(e=i)}else e=t.node;if(e){var a=t.pin;if(a||e.outputs&&(a=Object.keys(e.outputs)[0]),e.outputs[a])return{node:e,pin:a}}}});e.a=a},function(t,e,n){"use strict";var i=n(42),r=n(11),a=n(10),o=i.a.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},(function(){this.frameBuffer=new a.a}),{render:function(t){this._rendering=!0;var e,n=t.gl;if(this.trigger("beforerender"),this.outputs){var i=this.frameBuffer;for(var a in this.outputs){var o=this.updateParameter(a,t),s=this.outputs[a],l=this._compositor.allocateTexture(o);this._outputTextures[a]=l,"string"==typeof(h=s.attachment||n.COLOR_ATTACHMENT0)&&(h=n[h]),i.attach(l,h)}i.bind(t);var u=t.getGLExtension("EXT_draw_buffers");if(u){var c=[];for(var h in this.outputs)(h=parseInt(h))>=n.COLOR_ATTACHMENT0&&h<=n.COLOR_ATTACHMENT0+8&&c.push(h);u.drawBuffersEXT(c)}t.saveClear(),t.clearBit=r.a.DEPTH_BUFFER_BIT|r.a.COLOR_BUFFER_BIT,e=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),t.restoreClear(),i.unbind(t)}else e=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",e),this._rendering=!1,this._rendered=!0}});e.a=o},function(t,e,n){"use strict";var i=n(42).a.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(t,e){return this.texture},beforeFrame:function(){},afterFrame:function(){}});e.a=i},function(t,e,n){"use strict";var i=n(14),r=n(42),a=r.a.extend((function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),(function(){var t=new i.a({fragment:this.shader});this.pass=t}),{render:function(t,e){this.trigger("beforerender",t),this._rendering=!0;var n=t.gl;for(var i in this.inputLinks){var r=(h=this.inputLinks[i]).node.getOutput(t,h.pin);this.pass.setUniform(i,r)}if(this.outputs){this.pass.outputs={};var a={};for(var o in this.outputs){var s=this.updateParameter(o,t);isNaN(s.width)&&this.updateParameter(o,t);var l=this.outputs[o],u=this._compositor.allocateTexture(s);this._outputTextures[o]=u,"string"==typeof(c=l.attachment||n.COLOR_ATTACHMENT0)&&(c=n[c]),a[c]=u}for(var c in this._compositor.getFrameBuffer().bind(t),a)this._compositor.getFrameBuffer().attach(a[c],c);this.pass.render(t),this._compositor.getFrameBuffer().updateMipmap(t.gl)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(t),this.pass.render(t,e);for(var i in this.inputLinks){var h;(h=this.inputLinks[i]).node.removeReference(h.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",t)},updateParameter:function(t,e){var n,i,r=this.outputs[t],a=r.parameters,o=r._parametersCopy;if(o||(o=r._parametersCopy={}),a)for(var s in a)"width"!==s&&"height"!==s&&(o[s]=a[s]);return n=a.width instanceof Function?a.width.call(this,e):a.width,i=a.height instanceof Function?a.height.call(this,e):a.height,o.width===n&&o.height===i||this._outputTextures[t]&&this._outputTextures[t].dispose(e),o.width=n,o.height=i,o},setParameter:function(t,e){this.pass.setUniform(t,e)},getParameter:function(t){return this.pass.getUniform(t)},setParameters:function(t){for(var e in t)this.setParameter(e,t[e])},define:function(t,e){this.pass.material.define("fragment",t,e)},undefine:function(t){this.pass.material.undefine("fragment",t)},removeReference:function(t){this._outputReferences[t]--,0===this._outputReferences[t]&&(this.outputs[t].keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t]))},clear:function(){r.a.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});e.a=a},function(t,e,n){"use strict";var i=n(9),r=n(4),a=n(5),o=n(6),s=n(14),l=n(7),u=n(10),c=n(43),h=n(163);function d(t){for(var e=new Uint8Array(t*t*4),n=0,i=new r.a,a=0;a<t;a++)for(var o=0;o<t;o++)i.set(2*Math.random()-1,2*Math.random()-1,0).normalize(),e[n++]=255*(.5*i.x+.5),e[n++]=255*(.5*i.y+.5),e[n++]=0,e[n++]=255;return e}function f(t){return new a.a({pixels:d(t),wrapS:o.a.REPEAT,wrapT:o.a.REPEAT,width:t,height:t})}function p(t,e,n){var i=new Float32Array(3*t);e=e||0;for(var r=0;r<t;r++){var a=Object(c.a)(r+e,2)*(n?1:2)*Math.PI,o=Object(c.a)(r+e,3)*Math.PI,s=Math.random(),l=Math.cos(a)*Math.sin(o)*s,u=Math.cos(o)*s,h=Math.sin(a)*Math.sin(o)*s;i[3*r]=l,i[3*r+1]=u,i[3*r+2]=h}return i}function g(t){t=t||{},this._ssaoPass=new s.a({fragment:l.a.source("ecgl.ssao.estimate")}),this._blurPass=new s.a({fragment:l.a.source("ecgl.ssao.blur")}),this._framebuffer=new u.a({depthBuffer:!1}),this._ssaoTexture=new a.a,this._blurTexture=new a.a,this._blurTexture2=new a.a,this._depthTex=t.depthTexture,this._normalTex=t.normalTexture,this.setNoiseSize(4),this.setKernelSize(t.kernelSize||12),null!=t.radius&&this.setParameter("radius",t.radius),null!=t.power&&this.setParameter("power",t.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}l.a.import(h.a),g.prototype.setDepthTexture=function(t){this._depthTex=t},g.prototype.setNormalTexture=function(t){this._normalTex=t,this._ssaoPass.material[t?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},g.prototype.update=function(t,e,n){var r=t.getWidth(),a=t.getHeight(),o=this._ssaoPass,s=this._blurPass;o.setUniform("kernel",this._kernels[n%this._kernels.length]),o.setUniform("depthTex",this._depthTex),null!=this._normalTex&&o.setUniform("normalTex",this._normalTex),o.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var l=new i.a;i.a.transpose(l,e.worldTransform),o.setUniform("projection",e.projectionMatrix.array),o.setUniform("projectionInv",e.invProjectionMatrix.array),o.setUniform("viewInverseTranspose",l.array);var u=this._ssaoTexture,c=this._blurTexture,h=this._blurTexture2;u.width=r/2,u.height=a/2,c.width=r,c.height=a,h.width=r,h.height=a,this._framebuffer.attach(u),this._framebuffer.bind(t),t.gl.clearColor(1,1,1,1),t.gl.clear(t.gl.COLOR_BUFFER_BIT),o.render(t),s.setUniform("textureSize",[r/2,a/2]),s.setUniform("projection",e.projectionMatrix.array),this._framebuffer.attach(c),s.setUniform("direction",0),s.setUniform("ssaoTexture",u),s.render(t),this._framebuffer.attach(h),s.setUniform("textureSize",[r,a]),s.setUniform("direction",1),s.setUniform("ssaoTexture",c),s.render(t),this._framebuffer.unbind(t);var d=t.clearColor;t.gl.clearColor(d[0],d[1],d[2],d[3])},g.prototype.getTargetTexture=function(){return this._blurTexture2},g.prototype.setParameter=function(t,e){"noiseTexSize"===t?this.setNoiseSize(e):"kernelSize"===t?this.setKernelSize(e):"intensity"===t?this._ssaoPass.material.set("intensity",e):this._ssaoPass.setUniform(t,e)},g.prototype.setKernelSize=function(t){this._kernelSize=t,this._ssaoPass.material.define("fragment","KERNEL_SIZE",t),this._kernels=this._kernels||[];for(var e=0;e<30;e++)this._kernels[e]=p(t,e*t,!!this._normalTex)},g.prototype.setNoiseSize=function(t){var e=this._ssaoPass.getUniform("noiseTex");e?(e.data=d(t),e.width=e.height=t,e.dirty()):(e=f(t),this._ssaoPass.setUniform("noiseTex",f(t))),this._ssaoPass.setUniform("noiseTexSize",[t,t])},g.prototype.dispose=function(t){this._blurTexture.dispose(t),this._ssaoTexture.dispose(t),this._blurTexture2.dispose(t)},e.a=g},function(t,e,n){"use strict";e.a="@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n"},function(t,e,n){"use strict";var i=n(9),r=(n(4),n(5)),a=n(6),o=n(14),s=n(7),l=n(10),u=(n(43),n(165));function c(t){t=t||{},this._ssrPass=new o.a({fragment:s.a.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new o.a({fragment:s.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new o.a({fragment:s.a.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._ssrPass.setUniform("gBufferTexture1",t.normalTexture),this._ssrPass.setUniform("gBufferTexture2",t.depthTexture),this._blurPass1.setUniform("gBufferTexture1",t.normalTexture),this._blurPass1.setUniform("gBufferTexture2",t.depthTexture),this._blurPass2.setUniform("gBufferTexture1",t.normalTexture),this._blurPass2.setUniform("gBufferTexture2",t.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._texture1=new r.a({type:a.a.HALF_FLOAT}),this._texture2=new r.a({type:a.a.HALF_FLOAT}),this._texture3=new r.a({type:a.a.HALF_FLOAT}),this._frameBuffer=new l.a({depthBuffer:!1})}s.a.import(u.a),c.prototype.update=function(t,e,n,r){var a=t.getWidth(),o=t.getHeight(),s=t.getDevicePixelRatio(),l=this._texture1,u=this._texture2,c=this._texture3;u.width=a/2,u.height=o/2,l.width=a,l.height=o,c.width=a*s,c.height=o*s;var h=this._frameBuffer,d=this._ssrPass,f=this._blurPass1,p=this._blurPass2,g=new i.a;i.a.transpose(g,e.worldTransform),d.setUniform("sourceTexture",n),d.setUniform("projection",e.projectionMatrix.array),d.setUniform("projectionInv",e.invProjectionMatrix.array),d.setUniform("viewInverseTranspose",g.array),d.setUniform("nearZ",e.near),d.setUniform("jitterOffset",r/30),f.setUniform("textureSize",[a/2,o/2]),p.setUniform("textureSize",[a,o]),p.setUniform("sourceTexture",n),f.setUniform("projection",e.projectionMatrix.array),p.setUniform("projection",e.projectionMatrix.array),h.attach(l),h.bind(t),d.render(t),h.attach(u),f.setUniform("texture",l),f.render(t),h.attach(c),p.setUniform("texture",u),p.render(t),h.unbind(t)},c.prototype.getTargetTexture=function(){return this._texture3},c.prototype.setParameter=function(t,e){"maxIteration"===t?this._ssrPass.material.define("fragment","MAX_ITERATION",e):this._ssrPass.setUniform(t,e)},c.prototype.setSSAOTexture=function(t){var e=this._blurPass2;t?(e.material.enableTexture("ssaoTex"),e.material.set("ssaoTex",t)):e.material.disableTexture("ssaoTex")},c.prototype.dispose=function(t){this._texture1.dispose(t),this._texture2.dispose(t),this._texture3.dispose(t),this._frameBuffer.dispose(t)},e.a=c},function(t,e,n){"use strict";e.a="@export ecgl.ssr.main\n\n#define MAX_ITERATION 20;\n\nuniform sampler2D sourceTexture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\n\nuniform mat4 projection;\nuniform mat4 projectionInv;\nuniform mat4 viewInverseTranspose;\n\nuniform float maxRayDistance: 50;\n\nuniform float pixelStride: 16;\nuniform float pixelStrideZCutoff: 50; \nuniform float screenEdgeFadeStart: 0.9; \nuniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; \nuniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 10;\n\nuniform float nearZ;\nuniform vec2 viewportSize : VIEWPORT_SIZE;\n\nuniform float jitterOffset: 0;\n\nvarying vec2 v_Texcoord;\n\n#ifdef DEPTH_DECODE\n@import clay.util.decode_float\n#endif\n\nfloat fetchDepth(sampler2D depthTexture, vec2 uv)\n{\n vec4 depthTexel = texture2D(depthTexture, uv);\n return depthTexel.r * 2.0 - 1.0;\n}\n\nfloat linearDepth(float depth)\n{\n if (projection[3][3] == 0.0) {\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n }\n else {\n return (depth - projection[3][2]) / projection[2][2];\n }\n}\n\nbool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)\n{\n if (rayZFar > rayZNear)\n {\n float t = rayZFar; rayZFar = rayZNear; rayZNear = t;\n }\n float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));\n return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;\n}\n\n\nbool traceScreenSpaceRay(\n vec3 rayOrigin, vec3 rayDir, float jitter,\n out vec2 hitPixel, out vec3 hitPoint, out float iterationCount\n)\n{\n float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)\n ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;\n\n vec3 rayEnd = rayOrigin + rayDir * rayLength;\n\n vec4 H0 = projection * vec4(rayOrigin, 1.0);\n vec4 H1 = projection * vec4(rayEnd, 1.0);\n\n float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;\n\n vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;\n\n vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;\n vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;\n\n P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;\n vec2 delta = P1 - P0;\n\n bool permute = false;\n if (abs(delta.x) < abs(delta.y)) {\n permute = true;\n delta = delta.yx;\n P0 = P0.yx;\n P1 = P1.yx;\n }\n float stepDir = sign(delta.x);\n float invdx = stepDir / delta.x;\n\n vec3 dQ = (Q1 - Q0) * invdx;\n float dk = (k1 - k0) * invdx;\n\n vec2 dP = vec2(stepDir, delta.y * invdx);\n\n float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);\n float pixStride = 1.0 + strideScaler * pixelStride;\n\n dP *= pixStride; dQ *= pixStride; dk *= pixStride;\n\n vec4 pqk = vec4(P0, Q0.z, k0);\n vec4 dPQK = vec4(dP, dQ.z, dk);\n\n pqk += dPQK * jitter;\n float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n float rayZNear;\n\n bool intersect = false;\n\n vec2 texelSize = 1.0 / viewportSize;\n\n iterationCount = 0.0;\n\n for (int i = 0; i < MAX_ITERATION; i++)\n {\n pqk += dPQK;\n\n rayZNear = rayZFar;\n rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n\n hitPixel = permute ? pqk.yx : pqk.xy;\n hitPixel *= texelSize;\n\n intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);\n\n iterationCount += 1.0;\n\n if (intersect) {\n break;\n }\n }\n\n\n Q0.xy += dQ.xy * iterationCount;\n Q0.z = pqk.z;\n hitPoint = Q0 / pqk.w;\n\n return intersect;\n}\n\nfloat calculateAlpha(\n float iterationCount, float reflectivity,\n vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir\n)\n{\n float alpha = clamp(reflectivity, 0.0, 1.0);\n alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));\n vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;\n float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));\n alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);\n\n float _eyeFadeStart = eyeFadeStart;\n float _eyeFadeEnd = eyeFadeEnd;\n if (_eyeFadeStart > _eyeFadeEnd) {\n float tmp = _eyeFadeEnd;\n _eyeFadeEnd = _eyeFadeStart;\n _eyeFadeStart = tmp;\n }\n\n float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);\n alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);\n\n alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);\n\n return alpha;\n}\n\n@import clay.util.rand\n\n@import clay.util.rgbm\n\nvoid main()\n{\n vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);\n\n if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {\n discard;\n }\n\n float g = normalAndGloss.a;\n if (g <= minGlossiness) {\n discard;\n }\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalAndGloss.rgb * 2.0 - 1.0;\n N = normalize((viewInverseTranspose * vec4(N, 0.0)).xyz);\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);\n vec4 pos = projectionInv * projectedPos;\n vec3 rayOrigin = pos.xyz / pos.w;\n\n vec3 rayDir = normalize(reflect(normalize(rayOrigin), N));\n vec2 hitPixel;\n vec3 hitPoint;\n float iterationCount;\n\n vec2 uv2 = v_Texcoord * viewportSize;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n float alpha = calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir) * float(intersect);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((viewInverseTranspose * vec4(hitNormal, 0.0)).xyz);\n\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n\n \n if (!intersect) {\n discard;\n }\n vec4 color = decodeHDR(texture2D(sourceTexture, hitPixel));\n gl_FragColor = encodeHDR(vec4(color.rgb * alpha, color.a));\n}\n@end\n\n@export ecgl.ssr.blur\n\nuniform sampler2D texture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform mat4 projection;\nuniform float depthRange : 0.05;\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 4.0;\n\n#ifdef BLEND\n #ifdef SSAOTEX_ENABLED\nuniform sampler2D ssaoTex;\n #endif\nuniform sampler2D sourceTexture;\n#endif\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n\n@import clay.util.rgbm\n\n\nvoid main()\n{\n @import clay.compositor.kernel.gaussian_9\n\n vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);\n float g = centerNTexel.a;\n float maxBlurSize = clamp(1.0 - g + 0.1, 0.0, 1.0) * blurSize;\n#ifdef VERTICAL\n vec2 off = vec2(0.0, maxBlurSize / textureSize.y);\n#else\n vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);\n#endif\n\n vec2 coord = v_Texcoord;\n\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n\n vec3 cN = centerNTexel.rgb * 2.0 - 1.0;\n float cD = getLinearDepth(v_Texcoord);\n for (int i = 0; i < 9; i++) {\n vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));\n float w = gaussianKernel[i]\n * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));\n\n weightAll += w;\n sum += decodeHDR(texture2D(texture, coord)) * w;\n }\n\n#ifdef BLEND\n float aoFactor = 1.0;\n #ifdef SSAOTEX_ENABLED\n aoFactor = texture2D(ssaoTex, v_Texcoord).r;\n #endif\n gl_FragColor = encodeHDR(\n sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))\n );\n#else\n gl_FragColor = encodeHDR(sum / weightAll);\n#endif\n}\n\n@end"},function(t,e,n){"use strict";e.a=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925]},function(t,e,n){"use strict";var i=n(5),r=n(6),a=n(7),o=n(10),s=n(17),l=n(14),u=n(54),c=n(168);function h(t,e,n,i,r){var a=t.gl;e.setUniform(a,"1i",n,r),a.activeTexture(a.TEXTURE0+r),i.isRenderable()?i.bind(t):i.unbind(t)}function d(t,e,n,i,r){var a,o,s,l,u=t.gl;return function(r,c,d){if(!l||l.material!==r.material){var f=r.material,p=r.__program,g=f.get("roughness");null==g&&(g=1);var m=f.get("normalMap")||e,v=f.get("roughnessMap"),y=f.get("bumpMap"),x=f.get("uvRepeat"),b=f.get("uvOffset"),_=f.get("detailUvRepeat"),E=f.get("detailUvOffset"),w=!!y&&f.isTextureEnabled("bumpMap"),T=!!v&&f.isTextureEnabled("roughnessMap"),S=f.isDefined("fragment","DOUBLE_SIDED");y=y||n,v=v||i,d!==c?(c.set("normalMap",m),c.set("bumpMap",y),c.set("roughnessMap",v),c.set("useBumpMap",w),c.set("useRoughnessMap",T),c.set("doubleSide",S),null!=x&&c.set("uvRepeat",x),null!=b&&c.set("uvOffset",b),null!=_&&c.set("detailUvRepeat",_),null!=E&&c.set("detailUvOffset",E),c.set("roughness",g)):(p.setUniform(u,"1f","roughness",g),a!==m&&h(t,p,"normalMap",m,0),o!==y&&y&&h(t,p,"bumpMap",y,1),s!==v&&v&&h(t,p,"roughnessMap",v,2),null!=x&&p.setUniform(u,"2f","uvRepeat",x),null!=b&&p.setUniform(u,"2f","uvOffset",b),null!=_&&p.setUniform(u,"2f","detailUvRepeat",_),null!=E&&p.setUniform(u,"2f","detailUvOffset",E),p.setUniform(u,"1i","useBumpMap",+w),p.setUniform(u,"1i","useRoughnessMap",+T),p.setUniform(u,"1i","doubleSide",+S)),a=m,o=y,s=v,l=r}}}function f(t){t=t||{},this._depthTex=new i.a({format:r.a.DEPTH_COMPONENT,type:r.a.UNSIGNED_INT}),this._normalTex=new i.a({type:r.a.HALF_FLOAT}),this._framebuffer=new o.a,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,o.a.DEPTH_ATTACHMENT),this._normalMaterial=new s.a({shader:new a.a(a.a.source("ecgl.normal.vertex"),a.a.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=u.a.createBlank("#000"),this._defaultBumpMap=u.a.createBlank("#000"),this._defaultRoughessMap=u.a.createBlank("#000"),this._debugPass=new l.a({fragment:a.a.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}a.a.import(c.a),f.prototype.getDepthTexture=function(){return this._depthTex},f.prototype.getNormalTexture=function(){return this._normalTex},f.prototype.update=function(t,e,n){var i=t.getWidth(),r=t.getHeight(),a=this._depthTex,o=this._normalTex,s=this._normalMaterial;a.width=i,a.height=r,o.width=i,o.height=r;var l=e.opaqueList;this._framebuffer.bind(t),t.gl.clearColor(0,0,0,0),t.gl.clear(t.gl.COLOR_BUFFER_BIT|t.gl.DEPTH_BUFFER_BIT),t.gl.disable(t.gl.BLEND),t.renderPass(l,n,{getMaterial:function(){return s},ifRender:function(t){return t.renderNormal},beforeRender:d(t,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:t.opaqueSortCompare}),this._framebuffer.unbind(t)},f.prototype.renderDebug=function(t){this._debugPass.render(t)},f.prototype.dispose=function(t){this._depthTex.dispose(t),this._normalTex.dispose(t)},e.a=f},function(t,e,n){"use strict";e.a="@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end"},function(t,e,n){"use strict";n(9),n(4);var i=n(5),r=n(6),a=n(14),o=n(7),s=n(10);function l(t){t=t||{},this._edgePass=new a.a({fragment:o.a.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",t.normalTexture),this._edgePass.setUniform("depthTexture",t.depthTexture),this._targetTexture=new i.a({type:r.a.HALF_FLOAT}),this._frameBuffer=new s.a,this._frameBuffer.attach(this._targetTexture)}l.prototype.update=function(t,e,n,i){var r=t.getWidth(),a=t.getHeight(),o=this._targetTexture;o.width=r,o.height=a;var s=this._frameBuffer;s.bind(t),this._edgePass.setUniform("projectionInv",e.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[r,a]),this._edgePass.setUniform("texture",n),this._edgePass.render(t),s.unbind(t)},l.prototype.getTargetTexture=function(){return this._targetTexture},l.prototype.setParameter=function(t,e){this._edgePass.setUniform(t,e)},l.prototype.dispose=function(t){this._targetTexture.dispose(t),this._frameBuffer.dispose(t)},e.a=l},function(t,e,n){"use strict";e.a={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]}},function(t,e,n){"use strict";e.a="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n"},function(t,e,n){"use strict";e.a="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end"},function(t,e,n){"use strict";e.a="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end"},function(t,e,n){"use strict";e.a="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n"},function(t,e,n){"use strict";e.a="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end"},function(t,e,n){"use strict";e.a="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end"},function(t,e,n){"use strict";e.a="@export clay.compositor.hdr.composite\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end"},function(t,e,n){"use strict";e.a="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end"},function(t,e,n){"use strict";e.a="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end"},function(t,e,n){"use strict";e.a="@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = decodeHDR(texture2D(blurred, v_Texcoord));\n vec4 originalColor = decodeHDR(texture2D(original, v_Texcoord));\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = decodeHDR(texture2D(nearfield, v_Texcoord));\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = decodeHDR(texel);\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n gl_FragColor = encodeHDR(color);\n#endif\n}\n\n@end"},function(t,e,n){"use strict";e.a="@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end"},function(t,e,n){"use strict";var i=n(43),r=n(14),a=n(10),o=n(5),s=n(7),l=n(9);function u(t){for(var e=[],n=0;n<30;n++)e.push([Object(i.a)(n,2),Object(i.a)(n,3)]);this._haltonSequence=e,this._frame=0,this._sourceTex=new o.a,this._sourceFb=new a.a,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new o.a,this._outputTex=new o.a;var l=this._blendPass=new r.a({fragment:s.a.source("clay.compositor.blend")});l.material.disableTexturesAll(),l.material.enableTexture(["texture1","texture2"]),this._blendFb=new a.a({depthBuffer:!1}),this._outputPass=new r.a({fragment:s.a.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(t){t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)}}u.prototype={constructor:u,jitterProjection:function(t,e){var n=t.viewport,i=n.devicePixelRatio||t.getDevicePixelRatio(),r=n.width*i,a=n.height*i,o=this._haltonSequence[this._frame%this._haltonSequence.length],s=new l.a;s.array[12]=(2*o[0]-1)/r,s.array[13]=(2*o[1]-1)/a,l.a.mul(e.projectionMatrix,s,e.projectionMatrix),l.a.invert(e.invProjectionMatrix,e.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(t,e){this._prevFrameTex.width=t,this._prevFrameTex.height=e,this._outputTex.width=t,this._outputTex.height=e,this._sourceTex.width=t,this._sourceTex.height=e,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(t,e,n){var i=this._blendPass;0===this._frame?(i.setUniform("weight1",0),i.setUniform("weight2",1)):(i.setUniform("weight1",.9),i.setUniform("weight2",.1)),i.setUniform("texture1",this._prevFrameTex),i.setUniform("texture2",e||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(t),i.render(t),this._blendFb.unbind(t),n||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(t));var r=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=r,this._frame++},dispose:function(t){this._sourceFb.dispose(t),this._blendFb.dispose(t),this._prevFrameTex.dispose(t),this._outputTex.dispose(t),this._sourceTex.dispose(t),this._outputPass.dispose(t),this._blendPass.dispose(t)}},e.a=u},function(t,e,n){"use strict";var i=n(0),r=n.n(i);n(184),n(185),n(82),r.a.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},(function(t,e){e.eachComponent({mainType:"geo3D",query:t},(function(e){e.setView(t)}))}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(38),o=n(31),s=n(32),l=n(26),u=n(80),c=r.a.extendComponentModel({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var t=this.option;t.regions=this.getFilledRegions(t.regions,t.map);var e=r.a.helper.completeDimensions(["value"],t.data,{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),n=new r.a.List(e,this);n.initData(t.regions);var i={};n.each((function(t){var e=n.getName(t),r=n.getItemModel(t);i[e]=r})),this._regionModelMap=i,this._data=n},getData:function(){return this._data},getRegionModel:function(t){var e=this.getData().getName(t);return this._regionModelMap[e]||new r.a.Model(null,this)},getRegionPolygonCoords:function(t){var e=this.getData().getName(t),n=this.coordinateSystem.getRegion(e);return n?n.geometries:[]},getFormattedLabel:function(t,e){var n=this._data.getName(t),i=this.getRegionModel(n),r=i.get("normal"===e?["label","formatter"]:["emphasis","label","formatter"]);null==r&&(r=i.get(["label","formatter"]));var a={name:n};if("function"==typeof r)return a.status=e,r(a);if("string"==typeof r){var o=a.seriesName;return r.replace("{a}",null!=o?o:"")}return n},defaultOption:{regions:[]}});r.a.util.merge(c.prototype,u.a),r.a.util.merge(c.prototype,a.a),r.a.util.merge(c.prototype,o.a),r.a.util.merge(c.prototype,s.a),r.a.util.merge(c.prototype,l.a)},function(t,e,n){"use strict";var i=n(59),r=n(0),a=n.n(r),o=n(2),s=n(39),l=n(34);a.a.extendComponentView({type:"geo3D",__ecgl__:!0,init:function(t,e){this._geo3DBuilder=new i.a(e),this.groupGL=new o.a.Node,this._lightRoot=new o.a.Node,this._sceneHelper=new l.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new s.a({zr:e.getZr()}),this._control.init()},render:function(t,e,n){this.groupGL.add(this._geo3DBuilder.rootNode);var i=t.coordinateSystem;if(i&&i.viewGL){i.viewGL.add(this._lightRoot),t.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(i.viewGL);var a=t.getModel("viewControl");r.setFromViewControlModel(a,0),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(t),i.viewGL.setPostEffect(t.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._geo3DBuilder.update(t,e,n,0,t.getData().count());var o=i.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(t){t.material&&t.material[o]("fragment","SRGB_DECODE")})),r.off("update"),r.on("update",(function(){n.dispatchAction({type:"geo3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),center:r.getCenter(),from:this.uid,geo3DId:t.id})}))}},afterRender:function(t,e,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n)},dispose:function(){this._control.dispose()}})},function(t,e,n){"use strict";function i(t,e,n){n=n||2;var i,s,l,u,c,f,g,m=e&&e.length,v=m?e[0]*n:t.length,y=r(t,0,v,n,!0),x=[];if(!y)return x;if(m&&(y=function(t,e,n,i){var o,s,l,u=[];for(o=0,s=e.length;o<s;o++)(l=r(t,e[o]*i,o<s-1?e[o+1]*i:t.length,i,!1))===l.next&&(l.steiner=!0),u.push(p(l));for(u.sort(h),o=0;o<u.length;o++)d(u[o],n),n=a(n,n.next);return n}(t,e,y,n)),t.length>80*n){i=l=t[0],s=u=t[1];for(var b=n;b<v;b+=n)(c=t[b])<i&&(i=c),(f=t[b+1])<s&&(s=f),c>l&&(l=c),f>u&&(u=f);g=Math.max(l-i,u-s)}return o(y,x,n,i,s,g),x}function r(t,e,n,i,r){var a,o;if(r===S(t,e,n,i)>0)for(a=e;a<n;a+=i)o=E(a,t[a],t[a+1],o);else for(a=n-i;a>=e;a-=i)o=E(a,t[a],t[a+1],o);return o&&y(o,o.next)&&(w(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==v(i.prev,i,i.next))i=i.next;else{if(w(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e}function o(t,e,n,i,r,h,d){if(t){!d&&h&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=f(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,a,o,s,l,u=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,i=n,s=0,e=0;e<u&&(s++,i=i.nextZ);e++);for(l=u;s>0||l>0&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,l--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;n=i}a.nextZ=null,u*=2}while(o>1)}(r)}(t,i,r,h);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,h?l(t,i,r,h):s(t))e.push(p.i/n),e.push(t.i/n),e.push(g.i/n),w(t),t=g.next,m=g.next;else if((t=g)===m){d?1===d?o(t=u(t,e,n),e,n,i,r,h,2):2===d&&c(t,e,n,i,r,h):o(a(t),e,n,i,r,h,1);break}}}function s(t){var e=t.prev,n=t,i=t.next;if(v(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(g(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&v(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function l(t,e,n,i){var r=t.prev,a=t,o=t.next;if(v(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,l=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,u=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,c=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,h=f(s,l,e,n,i),d=f(u,c,e,n,i),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function u(t,e,n){var i=t;do{var r=i.prev,a=i.next.next;!y(r,a)&&x(r,i,i.next,a)&&b(r,a)&&b(a,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(a.i/n),w(i),w(i.next),i=t=a),i=i.next}while(i!==t);return i}function c(t,e,n,i,r,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&m(l,u)){var c=_(l,u);return l=a(l,l.next),c=a(c,c.next),o(l,e,n,i,r,s),void o(c,e,n,i,r,s)}u=u.next}l=l.next}while(l!==t)}function h(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var n,i=e,r=t.x,a=t.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===o)return n.prev;var l,u=n,c=n.x,h=n.y,d=1/0;for(i=n.next;i!==u;)r>=i.x&&i.x>=c&&r!==i.x&&g(a<h?r:o,a,c,h,a<h?o:r,a,i.x,i.y)&&((l=Math.abs(a-i.y)/(r-i.x))<d||l===d&&i.x>n.x)&&b(i,t)&&(n=i,d=l),i=i.next;return n}(t,e),e){var n=_(e,t);a(n,n.next)}}function f(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)/r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)/r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}function g(t,e,n,i,r,a,o,s){return(r-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(i-s)-(n-o)*(e-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&x(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&b(t,e)&&b(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)}function v(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,n,i){return!!(y(t,e)&&y(n,i)||y(t,i)&&y(n,e))||v(t,e,n)>0!=v(t,e,i)>0&&v(n,i,t)>0!=v(n,i,e)>0}function b(t,e){return v(t.prev,t,t.next)<0?v(t,e,t.next)>=0&&v(t,t.prev,e)>=0:v(t,e,t.prev)<0||v(t,t.next,e)<0}function _(t,e){var n=new T(t.i,t.x,t.y),i=new T(e.i,e.x,e.y),r=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function E(t,e,n,i){var r=new T(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function w(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function T(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,n,i){for(var r=0,a=e,o=n-i;a<n;a+=i)r+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return r}e.a=i,i.deviation=function(t,e,n,i){var r=e&&e.length,a=r?e[0]*n:t.length,o=Math.abs(S(t,0,a,n));if(r)for(var s=0,l=e.length;s<l;s++){var u=e[s]*n,c=s<l-1?e[s+1]*n:t.length;o-=Math.abs(S(t,u,c,n))}var h=0;for(s=0;s<i.length;s+=3){var d=i[s]*n,f=i[s+1]*n,p=i[s+2]*n;h+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)}},function(t,e,n){var i=n(12),r={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};t.exports=function(t){i.each(t.regions,(function(t){var e=r[t.name];if(e){var n=t.center;n[0]+=e[0]/10.5,n[1]+=-e[1]/14}}))}},function(t,e,n){var i=n(12),r={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};t.exports=function(t){i.each(t.regions,(function(t){var e=r[t.name];if(e){var n=t.center;n[0]=e[0],n[1]=e[1]}}))}},function(t,e,n){"use strict";var i=n(0),r=n.n(i);n(190),n(191),n(193),r.a.registerAction({type:"globeChangeCamera",event:"globecamerachanged",update:"series:updateCamera"},(function(t,e){e.eachComponent({mainType:"globe",query:t},(function(e){e.setView(t)}))})),r.a.registerAction({type:"globeUpdateDisplacment",event:"globedisplacementupdated",update:"update"},(function(t,e){}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(38),o=n(31),s=n(32),l=n(26);function u(t,e){t.id=t.id||t.name||e+""}var c=r.a.extendComponentModel({type:"globe",layoutMode:"box",coordinateSystem:null,init:function(){c.superApply(this,"init",arguments),r.a.util.each(this.option.layers,(function(t,e){r.a.util.merge(t,this.defaultLayerOption),u(t,e)}),this)},mergeOption:function(t){var e=this.option.layers;function n(t){return r.a.util.reduce(t,(function(t,e,n){return u(e,n),t[e.id]=e,t}),{})}if(this.option.layers=null,c.superApply(this,"mergeOption",arguments),e&&e.length){var i=n(t.layers),a=n(e);for(var o in i)a[o]?r.a.util.merge(a[o],i[o],!0):e.push(t.layers[o]);this.option.layers=e}r.a.util.each(this.option.layers,(function(t){r.a.util.merge(t,this.defaultLayerOption)}),this)},optionUpdated:function(){this.updateDisplacementHash()},defaultLayerOption:{show:!0,type:"overlay"},defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",baseColor:"#fff",baseTexture:"",heightTexture:"",displacementTexture:"",displacementScale:0,displacementQuality:"medium",globeRadius:100,globeOuterRadius:150,shading:"lambert",light:{main:{time:""}},viewControl:{autoRotate:!0,panSensitivity:0,targetCoord:null},layers:[]},setDisplacementData:function(t,e,n){this.displacementData=t,this.displacementWidth=e,this.displacementHeight=n},getDisplacementTexture:function(){return this.get("displacementTexture")||this.get("heightTexture")},getDisplacemenScale:function(){var t=this.getDisplacementTexture(),e=this.get("displacementScale");return t&&"none"!==t||(e=0),e},hasDisplacement:function(){return this.getDisplacemenScale()>0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var t=this.getDisplacementTexture(),e=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==t||this._displacementScale!==e,this._displacementTexture=t,this._displacementScale=e},isDisplacementChanged:function(){return this._displacementChanged}});r.a.util.merge(c.prototype,a.a),r.a.util.merge(c.prototype,o.a),r.a.util.merge(c.prototype,s.a),r.a.util.merge(c.prototype,l.a)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(39),s=n(34),l=n(192),u=n(3);r.a.extendComponentView({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(t,e){this.groupGL=new a.a.Node,this._sphereGeometry=new a.a.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new a.a.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new a.a.PlaneGeometry,this._earthMesh=new a.a.Mesh({renderNormal:!0}),this._lightRoot=new a.a.Node,this._sceneHelper=new s.a,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._earthMesh),this._control=new o.a({zr:e.getZr()}),this._control.init(),this._layerMeshes={}},render:function(t,e,n){var i=t.coordinateSystem,r=t.get("shading");i.viewGL.add(this._lightRoot),t.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL),this._sceneHelper.setScene(i.viewGL.scene),i.viewGL.setPostEffect(t.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var s="ecgl."+r;o.material&&o.material.shader.name===s||(o.material=a.a.createMaterial(s)),a.a.setMaterialFromModel(r,o.material,t,n),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(t){var e=o.material.get(t);e&&(e.flipY=!1)})),o.material.set("color",a.a.parseColor(t.get("baseColor")));var l=.99*i.radius;o.scale.set(l,l,l);var u=o.material.setTextureImage("diffuseMap",t.get("baseTexture"),n,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(o);var c=o.material.setTextureImage("bumpMap",t.get("heightTexture"),n,{flipY:!1,anisotropic:8});c&&c.surface&&c.surface.attachToMesh(o),o.material[t.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(t,n),this._displaceVertices(t,n),this._updateViewControl(t,n),this._updateLayers(t,n)},afterRender:function(t,e,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n)},_updateLayers:function(t,e){var n=t.coordinateSystem,i=t.get("layers"),o=n.radius,s=[],l=[],c=[],h=[];r.a.util.each(i,(function(t){var i=new r.a.Model(t),d=i.get("type"),f=a.a.loadTexture(i.get("texture"),e,{flipY:!1,anisotropic:8});if(f.surface&&f.surface.attachToMesh(this._earthMesh),"blend"===d){var p=i.get("blendTo"),g=u.a.firstNotNull(i.get("intensity"),1);"emission"===p?(c.push(f),h.push(g)):(s.push(f),l.push(g))}else{var m=i.get("id"),v=this._layerMeshes[m];v||(v=this._layerMeshes[m]=new a.a.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===i.get("shading")?(v.material=v.__lambertMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),v.__lambertMaterial=v.material):(v.material=v.__colorMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.color"),transparent:!0,depthMask:!1}),v.__colorMaterial=v.material),v.material.enableTexture("diffuseMap");var y=i.get("distance"),x=o+(null==y?n.radius/100:y);v.scale.set(x,x,x),o=x;var b=this._blankTexture||(this._blankTexture=a.a.createBlankTexture("rgba(255, 255, 255, 0)"));v.material.set("diffuseMap",b),a.a.loadTexture(i.get("texture"),e,{flipY:!1,anisotropic:8},(function(t){t.surface&&t.surface.attachToMesh(v),v.material.set("diffuseMap",t),e.getZr().refresh()})),i.get("show")?this.groupGL.add(v):this.groupGL.remove(v)}}),this);var d=this._earthMesh.material;d.define("fragment","LAYER_DIFFUSEMAP_COUNT",s.length),d.define("fragment","LAYER_EMISSIVEMAP_COUNT",c.length),d.set("layerDiffuseMap",s),d.set("layerDiffuseIntensity",l),d.set("layerEmissiveMap",c),d.set("layerEmissionIntensity",h);var f=t.getModel("debug.wireframe");if(f.get("show")){d.define("both","WIREFRAME_TRIANGLE");var p=a.a.parseColor(f.get("lineStyle.color")||"rgba(0,0,0,0.5)"),g=u.a.firstNotNull(f.get("lineStyle.width"),1);d.set("wireframeLineWidth",g),d.set("wireframeLineColor",p)}else d.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(t,e){var n=t.coordinateSystem,i=t.getModel("viewControl"),r=(n.viewGL.camera,this),a=this._control;a.setViewGL(n.viewGL);var o,s,l=i.get("targetCoord");null!=l&&(s=l[0]+90,o=l[1]),a.setFromViewControlModel(i,{baseDistance:n.radius,alpha:o,beta:s}),a.off("update"),a.on("update",(function(){e.dispatchAction({type:"globeChangeCamera",alpha:a.getAlpha(),beta:a.getBeta(),distance:a.getDistance()-n.radius,center:a.getCenter(),from:r.uid,globeId:t.id})}))},_displaceVertices:function(t,e){var n=t.get("displacementQuality"),i=t.get("debug.wireframe.show"),r=t.coordinateSystem;if(t.isDisplacementChanged()||n!==this._displacementQuality||i!==this._showDebugWireframe){this._displacementQuality=n,this._showDebugWireframe=i;var a=this._sphereGeometry,o={low:100,medium:200,high:400,ultra:800}[n]||200,s=o/2;(a.widthSegments!==o||i)&&(a.widthSegments=o,a.heightSegments=s,a.build()),this._doDisplaceVertices(a,r),i&&a.generateBarycentric()}},_doDisplaceVertices:function(t,e){var n=t.attributes.position.value,i=t.attributes.texcoord0.value,r=t.__originalPosition;r&&r.length===n.length||((r=new Float32Array(n.length)).set(n),t.__originalPosition=r);for(var a=e.displacementWidth,o=e.displacementHeight,s=e.displacementData,l=0;l<t.vertexCount;l++){var u=3*l,c=2*l,h=r[u+1],d=r[u+2],f=r[u+3],p=i[c++],g=i[c++],m=Math.round(p*(a-1)),v=Math.round(g*(o-1)),y=s?s[v*a+m]:0;n[u+1]=h+h*y,n[u+2]=d+d*y,n[u+3]=f+f*y}t.generateVertexNormals(),t.dirty(),t.updateBoundingBox()},_updateLight:function(t,e){var n=this._earthMesh;this._sceneHelper.updateLight(t);var i=this._sceneHelper.mainLight,a=t.get("light.main.time")||new Date,o=l.a.getPosition(r.a.number.parseDate(a),0,0),s=Math.cos(o.altitude);i.position.y=-s*Math.cos(o.azimuth),i.position.x=Math.sin(o.altitude),i.position.z=s*Math.sin(o.azimuth),i.lookAt(n.getWorldPosition())},dispose:function(t,e){this.groupGL.removeAll(),this._control.dispose()}})},function(t,e,n){"use strict";var i=Math.PI,r=Math.sin,a=Math.cos,o=Math.tan,s=Math.asin,l=Math.atan2,u=i/180,c=23.4397*u;function h(t,e){return l(r(t)*a(c)-o(e)*r(c),a(t))}function d(t,e,n){return l(r(t),a(t)*r(e)-o(n)*a(e))}function f(t,e,n){return s(r(e)*r(n)+a(e)*a(n)*a(t))}function p(t){var e,n,o=function(t){return u*(357.5291+.98560028*t)}(t),l=function(t){return t+u*(1.9148*r(t)+.02*r(2*t)+3e-4*r(3*t))+102.9372*u+i}(o);return{dec:(e=l,n=0,s(r(n)*a(c)+a(n)*r(c)*r(e))),ra:h(l,0)}}var g={getPosition:function(t,e,n){var i=u*-n,r=u*e,a=function(t){return function(t){return t.valueOf()/864e5-.5+2440588}(t)-2451545}(t),o=p(a),s=function(t,e){return u*(280.16+360.9856235*t)-e}(a,i)-o.ra;return{azimuth:d(s,r,o.dec),altitude:f(s,r,o.dec)}}};e.a=g},function(t,e,n){"use strict";var i=n(194),r=n(0),a=n.n(r),o=n(41),s=n.n(o),l=n(20),u=n(3),c=n(2);function h(t,e){var n=t.getBoxLayoutParams(),i=s.a.getLayoutRect(n,{width:e.getWidth(),height:e.getHeight()});i.y=e.getHeight()-i.y-i.height,this.viewGL.setViewport(i.x,i.y,i.width,i.height,e.getDevicePixelRatio()),this.radius=t.get("globeRadius");var r=t.get("globeOuterRadius");this.altitudeAxis&&this.altitudeAxis.setExtent(0,r-this.radius)}function d(t,e){var n=[1/0,-1/0];if(t.eachSeries((function(t){if(t.coordinateSystem===this){var e=t.getData(),i=t.coordDimToDataDim("alt")[0];if(i){var r=e.getDataExtent(i,!0);n[0]=Math.min(n[0],r[0]),n[1]=Math.max(n[1],r[1])}}}),this),n&&isFinite(n[1]-n[0])){var i=a.a.helper.createScale(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new a.a.Axis("altitude",i),this.resize(this.model,e)}}var f={dimensions:i.a.prototype.dimensions,create:function(t,e){var n=[];return t.eachComponent("globe",(function(t){t.__viewGL=t.__viewGL||new l.a;var r=new i.a;r.viewGL=t.__viewGL,t.coordinateSystem=r,r.model=t,n.push(r),r.resize=h,r.resize(t,e),r.update=d})),t.eachSeries((function(e){if("globe"===e.get("coordinateSystem")){var n=e.getReferringComponents("globe")[0];if(n||(n=t.getComponent("globe")),!n)throw new Error('globe "'+u.a.firstNotNull(e.get("globe3DIndex"),e.get("globe3DId"),0)+'" not found');var i=n.coordinateSystem;e.coordinateSystem=i}})),t.eachComponent("globe",(function(t,n){var i=t.coordinateSystem,r=t.getDisplacementTexture(),a=t.getDisplacemenScale();if(t.isDisplacementChanged()){if(t.hasDisplacement()){var o=!0;c.a.loadTexture(r,e,(function(n){var i=function(t,e){var n=document.createElement("canvas"),i=n.getContext("2d"),r=t.width,a=t.height;n.width=r,n.height=a,i.drawImage(t,0,0,r,a);for(var o=i.getImageData(0,0,r,a).data,s=new Float32Array(o.length/4),l=0;l<o.length/4;l++){var u=o[4*l];s[l]=u/255*e}return{data:s,width:r,height:a}}(n.image,a);t.setDisplacementData(i.data,i.width,i.height),o||e.dispatchAction({type:"globeUpdateDisplacment"})})),o=!1}else i.setDisplacementData(null,0,0);i.setDisplacementData(t.displacementData,t.displacementWidth,t.displacementHeight)}})),n}};a.a.registerCoordinateSystem("globe",f)},function(t,e,n){"use strict";var i=n(1),r=n.n(i).a.vec3;function a(t){this.radius=t,this.viewGL=null,this.altitudeAxis,this.displacementData=null,this.displacementWidth,this.displacementHeight}a.prototype={constructor:a,dimensions:["lng","lat","alt"],type:"globe",containPoint:function(){},setDisplacementData:function(t,e,n){this.displacementData=t,this.displacementWidth=e,this.displacementHeight=n},_getDisplacementScale:function(t,e){var n=(t+180)/360*(this.displacementWidth-1),i=(90-e)/180*(this.displacementHeight-1),r=Math.round(n)+Math.round(i)*this.displacementWidth;return this.displacementData[r]},dataToPoint:function(t,e){var n=t[0],i=t[1],r=t[2]||0,a=this.radius;this.displacementData&&(a*=1+this._getDisplacementScale(n,i)),this.altitudeAxis&&(a+=this.altitudeAxis.dataToCoord(r)),n=n*Math.PI/180,i=i*Math.PI/180;var o=Math.cos(i)*a;return(e=e||[])[0]=-o*Math.cos(n+Math.PI),e[1]=Math.sin(i)*a,e[2]=o*Math.sin(n+Math.PI),e},pointToData:function(t,e){var n=t[0],i=t[1],a=t[2],o=r.len(t);n/=o,i/=o,a/=o;var s=Math.asin(i),l=Math.atan2(a,-n);l<0&&(l=2*Math.PI+l);var u=180*s/Math.PI,c=180*l/Math.PI-180;return(e=e||[])[0]=c,e[1]=u,e[2]=o-this.radius,this.altitudeAxis&&(e[2]=this.altitudeAxis.coordToData(e[2])),e}},e.a=a},function(t,e,n){"use strict";var i=n(0),r=n.n(i);n(196),n(198),n(199),r.a.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},(function(t,e){e.eachComponent({mainType:"mapbox3D",query:t},(function(e){e.setMapboxCameraOption(t)}))}))},function(t,e,n){"use strict";var i=n(197),r=n(0),a=n.n(r),o=n(3),s=n(2),l=n(20);function u(t,e){var n=e.getWidth(),i=e.getHeight(),r=e.getDevicePixelRatio();this.viewGL.setViewport(0,0,n,i,r),this.width=n,this.height=i,this.altitudeScale=t.get("altitudeScale"),this.boxHeight=t.get("boxHeight")}function c(t,e){if("auto"!==this.model.get("boxHeight")){var n=[1/0,-1/0];t.eachSeries((function(t){if(t.coordinateSystem===this){var e=t.getData(),i=t.coordDimToDataDim("alt")[0];if(i){var r=e.getDataExtent(i,!0);n[0]=Math.min(n[0],r[0]),n[1]=Math.max(n[1],r[1])}}}),this),n&&isFinite(n[1]-n[0])&&(this.altitudeExtent=n)}}var h={dimensions:i.a.prototype.dimensions,create:function(t,e){var n=[];return t.eachComponent("mapbox3D",(function(t){var r=t.__viewGL;r||(r=t.__viewGL=new l.a).setRootNode(new s.a.Node);var a=new i.a;a.viewGL=t.__viewGL,a.resize=u,a.resize(t,e),n.push(a),t.coordinateSystem=a,a.model=t,a.setCameraOption(t.getMapboxCameraOption()),a.update=c})),t.eachSeries((function(e){if("mapbox3D"===e.get("coordinateSystem")){var n=e.getReferringComponents("mapbox3D")[0];if(n||(n=t.getComponent("mapbox3D")),!n)throw new Error('mapbox3D "'+o.a.firstNotNull(e.get("mapbox3DIndex"),e.get("mapbox3DId"),0)+'" not found');e.coordinateSystem=n.coordinateSystem}})),n}};a.a.registerCoordinateSystem("mapbox3D",h)},function(t,e,n){"use strict";var i=n(1),r=n.n(i).a.mat4,a=512,o=.6435011087932844,s=Math.PI,l=.1;function u(){this.width=0,this.height=0,this.altitudeScale=1,this.boxHeight="auto",this.altitudeExtent,this.bearing=0,this.pitch=0,this.center=[0,0],this._origin,this.zoom=0,this._initialZoom}u.prototype={constructor:u,type:"mapbox3D",dimensions:["lng","lat","alt"],containPoint:function(){},setCameraOption:function(t){this.bearing=t.bearing,this.pitch=t.pitch,this.center=t.center,this.zoom=t.zoom,this._origin||(this._origin=this.projectOnTileWithScale(this.center,a)),null==this._initialZoom&&(this._initialZoom=this.zoom),this.updateTransform()},updateTransform:function(){if(this.height){var t=.5/Math.tan(o/2)*this.height*l,e=Math.max(Math.min(this.pitch,60),0)/180*Math.PI,n=o/2,i=Math.PI/2+e,s=Math.sin(n)*t/Math.sin(Math.PI-i-n),u=1.1*(Math.cos(Math.PI/2-e)*s+t),c=new Float64Array(16);r.perspective(c,o,this.width/this.height,1,u),this.viewGL.camera.projectionMatrix.setArray(c),this.viewGL.camera.decomposeProjectionMatrix(),c=r.identity(new Float64Array(16));var h=this.dataToPoint(this.center);r.scale(c,c,[1,-1,1]),r.translate(c,c,[0,0,-t]),r.rotateX(c,c,e),r.rotateZ(c,c,-this.bearing/180*Math.PI),r.translate(c,c,[-h[0]*this.getScale()*l,-h[1]*this.getScale()*l,0]),this.viewGL.camera.viewMatrix.array=c;var d=new Float64Array(16);r.invert(d,c),this.viewGL.camera.worldTransform.array=d,this.viewGL.camera.decomposeWorldTransform();var f,p=a*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var g=this.altitudeExtent[1]-this.altitudeExtent[0];f=this.boxHeight/g*this.getScale()/Math.pow(2,this._initialZoom)}else f=p/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*l;this.viewGL.rootNode.scale.set(this.getScale()*l,this.getScale()*l,f)}},getScale:function(){return Math.pow(2,this.zoom)},projectOnTile:function(t,e){return this.projectOnTileWithScale(t,this.getScale()*a,e)},projectOnTileWithScale:function(t,e,n){var i=t[0],r=t[1]*s/180,a=e*(i*s/180+s)/(2*s),o=e*(s-Math.log(Math.tan(s/4+.5*r)))/(2*s);return(n=n||[])[0]=a,n[1]=o,n},unprojectFromTile:function(t,e){return this.unprojectOnTileWithScale(t,this.getScale()*a,e)},unprojectOnTileWithScale:function(t,e,n){var i=t[0],r=t[1],a=i/e*(2*s)-s,o=2*(Math.atan(Math.exp(s-r/e*(2*s)))-s/4);return(n=n||[])[0]=180*a/s,n[1]=180*o/s,n},dataToPoint:function(t,e){return(e=this.projectOnTileWithScale(t,a,e))[0]-=this._origin[0],e[1]-=this._origin[1],e[2]=isNaN(t[2])?0:t[2],isNaN(t[2])||(e[2]=t[2],this.altitudeExtent&&(e[2]-=this.altitudeExtent[0])),e}},e.a=u},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(31),o=n(32),s=["zoom","center","pitch","bearing"],l=r.a.extendComponentModel({type:"mapbox3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,style:"mapbox://styles/mapbox/light-v9",center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMapboxCameraOption:function(){var t=this;return s.reduce((function(e,n){return e[n]=t.get(n),e}),{})},setMapboxCameraOption:function(t){null!=t&&s.forEach((function(e){null!=t[e]&&(this.option[e]=t[e])}),this)},getMapbox:function(){return this._mapbox},setMapbox:function(t){this._mapbox=t}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,o.a)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(200),o=n(34),s=n(2),l=n(201);s.a.Shader.import(l.a),r.a.extendComponentView({type:"mapbox3D",__ecgl__:!0,init:function(t,e){var n=e.getZr();this._zrLayer=new a.a("mapbox3D",n),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new s.a.Node,this._sceneHelper=new o.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var i=this._zrLayer.getMapbox(),r=this._dispatchInteractAction.bind(this,e,i);["zoom","rotate","drag","pitch","rotate","move"].forEach((function(t){i.on(t,r)})),this._groundMesh=new s.a.Mesh({geometry:new s.a.PlaneGeometry,material:new s.a.Material({shader:new s.a.Shader({vertex:s.a.Shader.source("ecgl.displayShadow.vertex"),fragment:s.a.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},render:function(t,e,n){var i=this._zrLayer.getMapbox(),r=t.get("style"),a=JSON.stringify(r);a!==this._oldStyleStr&&r&&i.setStyle(r),this._oldStyleStr=a,i.setCenter(t.get("center")),i.setZoom(t.get("zoom")),i.setPitch(t.get("pitch")),i.setBearing(t.get("bearing")),t.setMapbox(i);var o=t.coordinateSystem;o.viewGL.scene.add(this._lightRoot),o.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(o.viewGL.scene),this._sceneHelper.updateLight(t),o.viewGL.setPostEffect(t.getModel("postEffect"),n),o.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._mapbox3DModel=t},afterRender:function(t,e,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n),t.coordinateSystem.viewGL.scene.traverse((function(t){t.material&&(t.material.define("fragment","NORMAL_UP_AXIS",2),t.material.define("fragment","NORMAL_FRONT_AXIS",1))}))},updateCamera:function(t,e,n,i){t.coordinateSystem.setCameraOption(i),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(t,e,n){t.dispatchAction({type:"mapbox3DChangeCamera",pitch:e.getPitch(),zoom:e.getZoom(),center:e.getCenter().toArray(),bearing:e.getBearing(),mapbox3DId:this._mapbox3DModel&&this._mapbox3DModel.id})},_updateGroundMesh:function(){if(this._mapbox3DModel){var t=this._mapbox3DModel.coordinateSystem,e=t.dataToPoint(t.center);this._groundMesh.position.set(e[0],e[1],-.001);var n=new s.a.Plane(new s.a.Vector3(0,0,1),0),i=t.viewGL.camera.castRay(new s.a.Vector2(-1,-1)),r=t.viewGL.camera.castRay(new s.a.Vector2(1,1)),a=i.intersectPlane(n),o=r.intersectPlane(n),l=a.dist(o)/t.viewGL.rootNode.scale.x;this._groundMesh.scale.set(l,l,1)}},dispose:function(t,e){e.getZr().delLayer(-1e3)}})},function(t,e,n){"use strict";function i(t,e){if(this.id=t,this.zr=e,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!mapboxgl)throw new Error("Mapbox GL library must be included. See https://www.mapbox.com/mapbox-gl-js/api/");this._mapbox=new mapboxgl.Map({container:this.dom}),this._initEvents()}i.prototype.resize=function(){this._mapbox.resize()},i.prototype.getMapbox=function(){return this._mapbox},i.prototype.clear=function(){},i.prototype.refresh=function(){this._mapbox.resize()};var r=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel"];i.prototype._initEvents=function(){var t=this._mapbox.getCanvasContainer();this._handlers=this._handlers||{contextmenu:function(t){return t.preventDefault(),!1}},r.forEach((function(e){this._handlers[e]=function(e){var n={};for(var i in e)n[i]=e[i];n.bubbles=!1;var r=new e.constructor(e.type,n);t.dispatchEvent(r)},this.zr.dom.addEventListener(e,this._handlers[e])}),this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},i.prototype.dispose=function(){r.forEach((function(t){this.zr.dom.removeEventListener(t,this._handlers[t])}),this)},e.a=i},function(t,e,n){"use strict";e.a="\n@export ecgl.displayShadow.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_WorldPosition;\n\nvarying vec3 v_Normal;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n\n@end\n\n\n@export ecgl.displayShadow.fragment\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform float roughness: 0.2;\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.ssaoMap.header\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n float shadow = 1.0;\n\n @import ecgl.common.ssaoMap.main\n\n#if defined(DIRECTIONAL_LIGHT_COUNT) && defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++) {\n shadow = min(shadow, shadowContribsDir[i] * 0.5 + 0.5);\n }\n#endif\n\n shadow *= 0.5 + ao * 0.5;\n shadow = clamp(shadow, 0.0, 1.0);\n\n gl_FragColor = vec4(vec3(0.0), 1.0 - shadow);\n}\n\n@end"},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(203),n(206),n(208),n(16));r.a.registerVisual(Object(a.a)("bar3D")),r.a.registerProcessor((function(t,e){t.eachSeriesByType("bar3d",(function(t){var e=t.getData();e.filterSelf((function(t){return e.hasValue(t)}))}))}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(4),o=n(1),s=n.n(o),l=n(204),u=n(205),c=s.a.vec3;r.a.registerLayout((function(t,e){t.eachSeriesByType("bar3D",(function(t){var e=t.coordinateSystem,n=e&&e.type;if("globe"===n)!function(t,e){var n=t.getData(),i=t.get("minHeight")||0,o=t.get("barSize"),s=["lng","lat","alt"].map((function(e){return t.coordDimToDataDim(e)[0]}));if(null==o){var l=e.radius*Math.PI,h=Object(u.a)(n,s[0],s[1]);o=[l/Math.sqrt(n.count()/h),l/Math.sqrt(n.count()/h)]}else r.a.util.isArray(o)||(o=[o,o]);n.each(s,(function(t,r,a,l){var u=n.get(s[2],l,!0),h=n.stackedOn?u-a:e.altitudeAxis.scale.getExtent()[0],d=Math.max(e.altitudeAxis.dataToCoord(a),i),f=e.dataToPoint([t,r,h]),p=e.dataToPoint([t,r,u]),g=c.sub([],p,f);c.normalize(g,g);var m=[o[0],d,o[1]];n.setItemLayout(l,[f,g,m])})),n.setLayout("orient",a.a.UP.array)}(t,e);else if("cartesian3D"===n)Object(l.a)(t,e);else if("geo3D"===n)!function(t,e){var n=t.getData(),i=t.get("barSize"),a=t.get("minHeight")||0,o=["lng","lat","alt"].map((function(e){return t.coordDimToDataDim(e)[0]}));if(null==i){var s=Math.min(e.size[0],e.size[2]),l=Object(u.a)(n,o[0],o[1]);i=[s/Math.sqrt(n.count()/l),s/Math.sqrt(n.count()/l)]}else r.a.util.isArray(i)||(i=[i,i]);var c=[0,1,0];n.each(o,(function(t,r,s,l){var u=n.get(o[2],l,!0),h=n.stackedOn?u-s:e.altitudeAxis.scale.getExtent()[0],d=Math.max(e.altitudeAxis.dataToCoord(s),a),f=e.dataToPoint([t,r,h]),p=[i[0],d,i[1]];n.setItemLayout(l,[f,c,p])})),n.setLayout("orient",[1,0,0])}(t,e);else{if("mapbox3D"!==n)throw e?new Error("bar3D doesn't support coordinate system "+e.type):new Error("bar3D doesn't have coordinate system.");!function(t,e){var n=t.getData(),i=t.coordDimToDataDim("lng")[0],a=t.coordDimToDataDim("lat")[0],o=t.coordDimToDataDim("alt")[0],s=t.get("barSize"),l=t.get("minHeight")||0;if(null==s){var c=n.getDataExtent(i),h=n.getDataExtent(a),d=e.dataToPoint([c[0],h[0]]),f=e.dataToPoint([c[1],h[1]]),p=Math.min(Math.abs(d[0]-f[0]),Math.abs(d[1]-f[1]))||1,g=Object(u.a)(n,i,a);s=[p/Math.sqrt(n.count()/g),p/Math.sqrt(n.count()/g)]}else r.a.util.isArray(s)||(s=[s,s]),s[0]/=e.getScale()/16,s[1]/=e.getScale()/16;var m=[0,0,1];n.each([i,a,o],(function(t,i,r,a){var u=n.get(o,a,!0),c=n.stackedOn?u-r:0,h=e.dataToPoint([t,i,c]),d=e.dataToPoint([t,i,u]),f=Math.max(d[2]-h[2],l),p=[s[0],f,s[1]];n.setItemLayout(a,[h,m,p])})),n.setLayout("orient",[1,0,0])}(t,e)}}))}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(1),o=n.n(a).a.vec3;e.a=function(t,e){var n=t.getData(),i=t.get("barSize");if(null==i){var a,s,l=e.size,u=e.getAxis("x"),c=e.getAxis("y");a="category"===u.type?.7*u.getBandWidth():.6*Math.round(l[0]/Math.sqrt(n.count())),s="category"===c.type?.7*c.getBandWidth():.6*Math.round(l[1]/Math.sqrt(n.count())),i=[a,s]}else r.a.util.isArray(i)||(i=[i,i]);var h,d,f,p=e.getAxis("z").scale.getExtent(),g=(d=(h=p)[0],f=h[1],!(d>0&&f>0||d<0&&f<0)),m=["x","y","z"].map((function(e){return t.coordDimToDataDim(e)[0]}));n.each(m,(function(t,r,a,s){var l=n.get(m[2],s,!0),u=n.stackedOn?l-a:g?0:p[0],c=e.dataToPoint([t,r,u]),h=e.dataToPoint([t,r,l]),d=o.dist(c,h),f=[0,h[1]<c[1]?-1:1,0];0===Math.abs(d)&&(d=.1);var v=[i[0],d,i[1]];n.setItemLayout(s,[c,f,v])})),n.setLayout("orient",[1,0,0])}},function(t,e,n){"use strict";e.a=function(t,e,n){for(var i=t.getDataExtent(e),r=t.getDataExtent(n),a=i[1]-i[0]||i[0],o=r[1]-r[0]||r[0],s=new Uint8Array(2500),l=0;l<t.count();l++){var u=t.get(e,l),c=t.get(n,l),h=Math.floor((u-i[0])/a*49),d=50*Math.floor((c-r[0])/o*49)+h;s[d]=s[d]||1}var f=0;for(l=0;l<s.length;l++)s[l]&&f++;return f/s.length}},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(3),s=n(27),l=n(207),u=n(61),c=n(1),h=n.n(c).a.vec3;r.a.extendChartView({type:"bar3D",__ecgl__:!0,init:function(t,e){this.groupGL=new a.a.Node,this._api=e,this._labelsBuilder=new u.a(256,256,e);var n=this;this._labelsBuilder.getLabelPosition=function(t,e,i){if(n._data){var r=n._data.getItemLayout(t),a=r[0],o=r[1],s=r[2][1];return h.scaleAndAdd([],a,o,i+s)}return[0,0]},this._labelsBuilder.getMesh().renderOrder=100},render:function(t,e,n){var i=this._prevBarMesh;this._prevBarMesh=this._barMesh,this._barMesh=i,this._barMesh||(this._barMesh=new a.a.Mesh({geometry:new l.a,shadowDepthMaterial:new a.a.Material({shader:new a.a.Shader(a.a.Shader.source("ecgl.sm.depth.vertex"),a.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:"cartesian3D"===t.coordinateSystem.type,renderOrder:10,renderNormal:!0})),this.groupGL.remove(this._prevBarMesh),this.groupGL.add(this._barMesh),this.groupGL.add(this._labelsBuilder.getMesh());var r=t.coordinateSystem;if(this._doRender(t,n),r&&r.viewGL){r.viewGL.add(this.groupGL);var o=r.viewGL.isLinearSpace()?"define":"undefine";this._barMesh.material[o]("fragment","SRGB_DECODE")}this._data=t.getData(),this._labelsBuilder.updateData(this._data),this._labelsBuilder.updateLabels(),this._updateAnimation(t)},_updateAnimation:function(t){a.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevBarMesh,this._barMesh,t)},_doRender:function(t,e){var n=t.getData(),i=t.get("shading"),r="color"!==i,o=this,s=this._barMesh,l="ecgl."+i;s.material&&s.material.shader.name===l||(s.material=a.a.createMaterial(l,["VERTEX_COLOR"])),a.a.setMaterialFromModel(i,s.material,t,e),s.geometry.enableNormal=r,s.geometry.resetOffset();var u=t.get("bevelSize"),c=t.get("bevelSmoothness");s.geometry.bevelSegments=c,s.geometry.bevelSize=u;var h=[],d=new Float32Array(4*n.count()),f=0,p=0,g=!1;n.each((function(t){if(n.hasValue(t)){var e=n.getItemVisual(t,"color"),i=n.getItemVisual(t,"opacity");null==i&&(i=1),a.a.parseColor(e,h),h[3]*=i,d[f++]=h[0],d[f++]=h[1],d[f++]=h[2],d[f++]=h[3],h[3]>0&&(p++,h[3]<.99&&(g=!0))}})),s.geometry.setBarCount(p);var m=n.getLayout("orient"),v=this._barIndexOfData=new Int32Array(n.count());p=0,n.each((function(t){if(n.hasValue(t)){var e=n.getItemLayout(t),i=e[0],r=e[1],a=e[2],s=4*t;h[0]=d[s++],h[1]=d[s++],h[2]=d[s++],h[3]=d[s++],h[3]>0&&(o._barMesh.geometry.addBar(i,r,m,a,h,t),v[t]=p++)}else v[t]=-1})),s.geometry.dirty(),s.geometry.updateBoundingBox();var y=s.material;y.transparent=g,y.depthMask=!g,s.geometry.sortTriangles=g,this._initHandler(t,e)},_initHandler:function(t,e){var n=t.getData(),i=this._barMesh,r="cartesian3D"===t.coordinateSystem.type;i.seriesIndex=t.seriesIndex;var a=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(t){var o=i.geometry.getDataIndexOfVertex(t.triangle[0]);o!==a&&(this._downplay(a),this._highlight(o),this._labelsBuilder.updateLabels([o]),r&&e.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",o),n.get("y",o),n.get("z",o,!0)]})),a=o,i.dataIndex=o}),this),i.on("mouseout",(function(t){this._downplay(a),this._labelsBuilder.updateLabels(),a=-1,i.dataIndex=-1,r&&e.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(t){var e=this._data;if(e){var n=this._barIndexOfData[t];if(!(n<0)){var i=e.getItemModel(t).getModel("emphasis.itemStyle"),o=i.get("color"),s=i.get("opacity");if(null==o){var l=e.getItemVisual(t,"color");o=r.a.color.lift(l,-.4)}null==s&&(s=e.getItemVisual(t,"opacity"));var u=a.a.parseColor(o);u[3]*=s,this._barMesh.geometry.setColor(n,u),this._api.getZr().refresh()}}},_downplay:function(t){var e=this._data;if(e){var n=this._barIndexOfData[t];if(!(n<0)){var i=e.getItemVisual(t,"color"),r=e.getItemVisual(t,"opacity"),o=a.a.parseColor(i);o[3]*=r,this._barMesh.geometry.setColor(n,o),this._api.getZr().refresh()}}},highlight:function(t,e,n,i){this._toggleStatus("highlight",t,e,n,i)},downplay:function(t,e,n,i){this._toggleStatus("downplay",t,e,n,i)},_toggleStatus:function(t,e,n,i,a){var l=e.getData(),u=o.a.queryDataIndex(l,a),c=this;null!=u?r.a.util.each(s.a.normalizeToArray(u),(function(e){"highlight"===t?this._highlight(e):this._downplay(e)}),this):l.each((function(e){"highlight"===t?c._highlight(e):c._downplay(e)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(t,e,n){"use strict";var i,r,a,o,s,l,u,c,h=n(0),d=n.n(h),f=n(33),p=n(60),g=n(13),m=n(1),v=n.n(m),y=v.a.vec3,x=v.a.mat3,b=g.a.extend((function(){return{attributes:{position:new g.a.Attribute("position","float",3,"POSITION"),normal:new g.a.Attribute("normal","float",3,"NORMAL"),color:new g.a.Attribute("color","float",4,"COLOR"),prevPosition:new g.a.Attribute("prevPosition","float",3),prevNormal:new g.a.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(t){var e=this.enableNormal,n=this.getBarVertexCount()*t,i=this.getBarTriangleCount()*t;this.vertexCount!==n&&(this.attributes.position.init(n),e?this.attributes.normal.init(n):this.attributes.normal.value=null,this.attributes.color.init(n)),this.triangleCount!==i&&(this.indices=n>65535?new Uint32Array(3*i):new Uint16Array(3*i),this._dataIndices=new Uint32Array(n))},getBarVertexCount:function(){var t=this.bevelSize>0?this.bevelSegments:0;return t>0?this._getBevelBarVertexCount(t):this.enableNormal?24:8},getBarTriangleCount:function(){var t=this.bevelSize>0?this.bevelSegments:0;return t>0?this._getBevelBarTriangleCount(t):12},_getBevelBarVertexCount:function(t){return 4*(t+1)*(t+1)*2},_getBevelBarTriangleCount:function(t){return(4*t+3+1)*(2*t+1)*2+4},setColor:function(t,e){for(var n=this.getBarVertexCount(),i=n*(t+1),r=n*t;r<i;r++)this.attributes.color.set(r,e);this.dirtyAttribute("color")},getDataIndexOfVertex:function(t){return this._dataIndices?this._dataIndices[t]:null},addBar:function(){for(var t=y.create,e=y.scaleAndAdd,n=t(),i=t(),r=t(),a=t(),o=t(),s=t(),l=t(),u=[],c=[],h=0;h<8;h++)u[h]=t();var d=[[0,1,5,4],[2,3,7,6],[4,5,6,7],[3,2,1,0],[0,4,7,3],[1,2,6,5]],f=[0,1,2,0,2,3],p=[];for(h=0;h<d.length;h++)for(var g=d[h],m=0;m<2;m++){for(var v=[],x=0;x<3;x++)v.push(g[f[3*m+x]]);p.push(v)}return function(t,h,g,m,v,x){var b=this._vertexOffset;if(this.bevelSize>0&&this.bevelSegments>0)this._addBevelBar(t,h,g,m,this.bevelSize,this.bevelSegments,v);else{y.copy(r,h),y.normalize(r,r),y.cross(a,g,r),y.normalize(a,a),y.cross(i,r,a),y.normalize(a,a),y.negate(o,i),y.negate(s,r),y.negate(l,a),e(u[0],t,i,m[0]/2),e(u[0],u[0],a,m[2]/2),e(u[1],t,i,m[0]/2),e(u[1],u[1],l,m[2]/2),e(u[2],t,o,m[0]/2),e(u[2],u[2],l,m[2]/2),e(u[3],t,o,m[0]/2),e(u[3],u[3],a,m[2]/2),e(n,t,r,m[1]),e(u[4],n,i,m[0]/2),e(u[4],u[4],a,m[2]/2),e(u[5],n,i,m[0]/2),e(u[5],u[5],l,m[2]/2),e(u[6],n,o,m[0]/2),e(u[6],u[6],l,m[2]/2),e(u[7],n,o,m[0]/2),e(u[7],u[7],a,m[2]/2);var _=this.attributes;if(this.enableNormal){c[0]=i,c[1]=o,c[2]=r,c[3]=s,c[4]=a,c[5]=l;for(var E=this._vertexOffset,w=0;w<d.length;w++){for(var T=3*this._triangleOffset,S=0;S<6;S++)this.indices[T++]=E+f[S];E+=4,this._triangleOffset+=2}for(w=0;w<d.length;w++){var M=c[w];for(S=0;S<4;S++){var C=d[w][S];_.position.set(this._vertexOffset,u[C]),_.normal.set(this._vertexOffset,M),_.color.set(this._vertexOffset++,v)}}}else{for(w=0;w<p.length;w++){for(T=3*this._triangleOffset,S=0;S<3;S++)this.indices[T+S]=p[w][S]+this._vertexOffset;this._triangleOffset++}for(w=0;w<u.length;w++)_.position.set(this._vertexOffset,u[w]),_.color.set(this._vertexOffset++,v)}}var A=this._vertexOffset;for(w=b;w<A;w++)this._dataIndices[w]=x}}(),_addBevelBar:(i=y.create(),r=y.create(),a=y.create(),o=x.create(),s=[],l=[1,-1,-1,1],u=[1,1,-1,-1],c=[2,0],function(t,e,n,h,d,f,p){y.copy(r,e),y.normalize(r,r),y.cross(a,n,r),y.normalize(a,a),y.cross(i,r,a),y.normalize(a,a),o[0]=i[0],o[1]=i[1],o[2]=i[2],o[3]=r[0],o[4]=r[1],o[5]=r[2],o[6]=a[0],o[7]=a[1],o[8]=a[2],d=Math.min(h[0],h[2])/2*d;for(var g=0;g<3;g++)s[g]=Math.max(h[g]-2*d,0);var m=(h[0]-s[0])/2,v=(h[1]-s[1])/2,x=(h[2]-s[2])/2,b=[],_=[],E=this._vertexOffset,w=[];for(g=0;g<2;g++){w[g]=w[g]=[];for(var T=0;T<=f;T++)for(var S=0;S<4;S++){(0===T&&0===g||1===g&&T===f)&&w[g].push(E);for(var M=0;M<=f;M++){var C=M/f*Math.PI/2+Math.PI/2*S,A=T/f*Math.PI/2+Math.PI/2*g;_[0]=m*Math.cos(C)*Math.sin(A),_[1]=v*Math.cos(A),_[2]=x*Math.sin(C)*Math.sin(A),b[0]=_[0]+l[S]*s[0]/2,b[1]=_[1]+v+c[g]*s[1]/2,b[2]=_[2]+u[S]*s[2]/2,Math.abs(m-v)<1e-6&&Math.abs(v-x)<1e-6||(_[0]/=m*m,_[1]/=v*v,_[2]/=x*x),y.normalize(_,_),y.transformMat3(b,b,o),y.transformMat3(_,_,o),y.add(b,b,t),this.attributes.position.set(E,b),this.enableNormal&&this.attributes.normal.set(E,_),this.attributes.color.set(E,p),E++}}}var O=4*f+3,N=2*f+1,P=O+1;for(S=0;S<N;S++)for(g=0;g<=O;g++){var L=S*P+g+this._vertexOffset,R=S*P+(g+1)%P+this._vertexOffset,D=(S+1)*P+(g+1)%P+this._vertexOffset,k=(S+1)*P+g+this._vertexOffset;this.setTriangleIndices(this._triangleOffset++,[D,L,R]),this.setTriangleIndices(this._triangleOffset++,[D,k,L])}this.setTriangleIndices(this._triangleOffset++,[w[0][0],w[0][2],w[0][1]]),this.setTriangleIndices(this._triangleOffset++,[w[0][0],w[0][3],w[0][2]]),this.setTriangleIndices(this._triangleOffset++,[w[1][0],w[1][1],w[1][2]]),this.setTriangleIndices(this._triangleOffset++,[w[1][0],w[1][2],w[1][3]]),this._vertexOffset=E})});d.a.util.defaults(b.prototype,f.a),d.a.util.defaults(b.prototype,p.a),e.a=b},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(26),o=n(27),s=n(35),l=n(44),u=r.a.extendSeriesModel({type:"series.bar3D",dependencies:["globe"],visualColorAccessPath:"itemStyle.color",getInitialData:function(t,e){return Object(l.a)(this)},getFormattedLabel:function(t,e,n,i){var r=o.a.getFormattedLabel(this,t,e,n,i);return null==r&&(r=this.getData().get("z",t)),r},formatTooltip:function(t){return Object(s.a)(this,t)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});r.a.util.merge(u.prototype,a.a)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(210),n(211),n(45)),o=n.n(a),s=n(16);r.a.registerVisual(o()("line3D","circle",null)),r.a.registerVisual(Object(s.a)("line3D")),r.a.registerLayout((function(t,e){t.eachSeriesByType("line3D",(function(t){var e=t.getData(),n=t.coordinateSystem;if(n){if("cartesian3D"!==n.type)return void console.error("line3D needs cartesian3D coordinateSystem");var i=new Float32Array(3*e.count()),r=[],a=[],o=n.dimensions.map((function(e){return t.coordDimToDataDim(e)[0]}));n&&e.each(o,(function(t,e,o,s){r[0]=t,r[1]=e,r[2]=o,n.dataToPoint(r,a),i[3*s]=a[0],i[3*s+1]=a[1],i[3*s+2]=a[2]})),e.setLayout("points",i)}}))}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(35),o=n(44);r.a.extendSeriesModel({type:"series.line3D",dependencies:["grid3D"],visualColorAccessPath:"lineStyle.color",getInitialData:function(t,e){return Object(o.a)(this)},formatTooltip:function(t){return Object(a.a)(this,t)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(3),s=n(22),l=n(9),u=n(4),c=n(212),h=n.n(c),d=n(1),f=n.n(d),p=n(40),g=f.a.vec3;a.a.Shader.import(p.a),r.a.extendChartView({type:"line3D",__ecgl__:!0,init:function(t,e){this.groupGL=new a.a.Node,this._api=e},render:function(t,e,n){var i=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=i,this._line3DMesh||(this._line3DMesh=new a.a.Mesh({geometry:new s.a({useNativeLine:!1,sortTriangles:!0}),material:new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var r=t.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this.groupGL);var o=r.viewGL.isLinearSpace()?"define":"undefine";this._line3DMesh.material[o]("fragment","SRGB_DECODE")}this._doRender(t,n),this._data=t.getData(),this._camera=r.viewGL.camera,this.updateCamera(),this._updateAnimation(t)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(t,e){var n=t.getData(),i=this._line3DMesh;i.geometry.resetOffset();var r=n.getLayout("points"),s=[],l=new Float32Array(r.length/3*4),u=0,c=!1;n.each((function(t){var e=n.getItemVisual(t,"color"),i=n.getItemVisual(t,"opacity");null==i&&(i=1),a.a.parseColor(e,s),s[3]*=i,l[u++]=s[0],l[u++]=s[1],l[u++]=s[2],l[u++]=s[3],s[3]<.99&&(c=!0)})),i.geometry.setVertexCount(i.geometry.getPolylineVertexCount(r)),i.geometry.setTriangleCount(i.geometry.getPolylineTriangleCount(r)),i.geometry.addPolyline(r,l,o.a.firstNotNull(t.get("lineStyle.width"),1)),i.geometry.dirty(),i.geometry.updateBoundingBox();var h=i.material;h.transparent=c,h.depthMask=!c;var d=t.getModel("debug.wireframe");d.get("show")?(i.geometry.createAttribute("barycentric","float",3),i.geometry.generateBarycentric(),i.material.set("both","WIREFRAME_TRIANGLE"),i.material.set("wireframeLineColor",a.a.parseColor(d.get("lineStyle.color")||"rgba(0,0,0,0.5)")),i.material.set("wireframeLineWidth",o.a.firstNotNull(d.get("lineStyle.width"),1))):i.material.set("both","WIREFRAME_TRIANGLE"),this._points=r,this._initHandler(t,e)},_updateAnimation:function(t){a.a.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,t)},_initHandler:function(t,e){var n=t.getData(),i=t.coordinateSystem,r=this._line3DMesh,a=-1;r.seriesIndex=t.seriesIndex,r.off("mousemove"),r.off("mouseout"),r.on("mousemove",(function(t){var o=i.pointToData(t.point.array),s=n.indicesOfNearest("x",o[0])[0];s!==a&&(e.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",s),n.get("y",s),n.get("z",s)]}),r.dataIndex=s),a=s}),this),r.on("mouseout",(function(t){a=-1,r.dataIndex=-1,e.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateNDCPosition:function(){var t=new l.a,e=this._camera;l.a.multiply(t,e.projectionMatrix,e.viewMatrix);var n=this._positionNDC,i=this._points,r=i.length/3;n&&n.length/2===r||(n=this._positionNDC=new Float32Array(2*r));for(var a=[],o=0;o<r;o++){var s=3*o,u=2*o;a[0]=i[s],a[1]=i[s+1],a[2]=i[s+2],a[3]=1,g.transformMat4(a,a,t.array),n[u]=a[0]/a[3],n[u+1]=a[1]/a[3]}},_pick:function(t,e,n,i,r,a){var o=this._positionNDC,s=this._data.hostModel.get("lineStyle.width"),l=-1,c=.5*n.viewport.width,d=.5*n.viewport.height;t=(t+1)*c,e=(e+1)*d;for(var f=1;f<o.length/2;f++){var p=(o[2*(f-1)]+1)*c,g=(o[2*(f-1)+1]+1)*d,m=(o[2*f]+1)*c,v=(o[2*f+1]+1)*d;h.a.containStroke(p,g,m,v,s,t,e)&&(l=(p-t)*(p-t)+(g-e)*(g-e)<(m-t)*(m-t)+(v-e)*(v-e)?f-1:f)}if(l>=0){var y=3*l,x=new u.a(this._points[y],this._points[y+1],this._points[y+2]);a.push({dataIndex:l,point:x,pointWorld:x.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(x)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(t,e){e.containStroke=function(t,e,n,i,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>e+s&&o>i+s||o<e-s&&o<i-s||a>t+s&&a>n+s||a<t-s&&a<n-s)return!1;if(t===n)return Math.abs(a-t)<=s/2;var u=(l=(e-i)/(t-n))*a-o+(t*i-n*e)/(t-n);return u*u/(l*l+1)<=s/2*s/2}},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(214),n(215),n(45)),o=n.n(a),s=n(16);r.a.registerVisual(o()("scatter3D","circle",null)),r.a.registerVisual(Object(s.a)("scatter3D")),r.a.registerLayout({seriesType:"scatter3D",reset:function(t){var e=t.coordinateSystem;if(e){var n=e.dimensions;if(n.length<3)return void console.error("scatter3D needs 3D coordinateSystem");var i=n.map((function(e){return t.coordDimToDataDim(e)[0]})),r=[],a=[];return{progress:function(t,n){for(var o=new Float32Array(3*(t.end-t.start)),s=t.start;s<t.end;s++){var l=3*(s-t.start);r[0]=n.get(i[0],s),r[1]=n.get(i[1],s),r[2]=n.get(i[2],s),e.dataToPoint(r,a),o[l]=a[0],o[l+1]=a[1],o[l+2]=a[2]}n.setLayout("points",o)}}}}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(27),o=n(35),s=n(44);r.a.extendSeriesModel({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",getInitialData:function(t,e){return Object(s.a)(this)},getFormattedLabel:function(t,e,n,i){var r=a.a.getFormattedLabel(this,t,e,n,i);if(null==r){var o=this.getData(),s=o.dimensions[o.dimensions.length-1];r=o.get(s,t)}return r},formatTooltip:function(t){return Object(o.a)(this,t)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(3),s=n(27),l=n(62);r.a.extendChartView({type:"scatter3D",__ecgl__:!0,init:function(t,e){this.groupGL=new a.a.Node,this._pointsBuilderList=[],this._currentStep=0},render:function(t,e,n){if(this.groupGL.removeAll(),t.getData().count()){var i=t.coordinateSystem;if(!i||!i.viewGL)throw new Error("Invalid coordinate system");i.viewGL.add(this.groupGL),this._camera=i.viewGL.camera;var r=this._pointsBuilderList[0];r||(r=this._pointsBuilderList[0]=new l.a(!1,n)),this._pointsBuilderList.length=1,this.groupGL.add(r.rootNode),r.update(t,e,n),r.updateView(i.viewGL.camera)}},incrementalPrepareRender:function(t,e,n){var i=t.coordinateSystem;if(!i||!i.viewGL)throw new Error("Invalid coordinate system");i.viewGL.add(this.groupGL),this._camera=i.viewGL.camera,this.groupGL.removeAll(),this._currentStep=0},incrementalRender:function(t,e,n,i){if(!(t.end<=t.start)){var r=this._pointsBuilderList[this._currentStep];r||(r=new l.a(!1,i),this._pointsBuilderList[this._currentStep]=r),this.groupGL.add(r.rootNode),r.update(e,n,i,t.start,t.end),r.updateView(e.coordinateSystem.viewGL.camera),this._currentStep++}},updateCamera:function(){this._pointsBuilderList.forEach((function(t){t.updateView(this._camera)}),this)},highlight:function(t,e,n,i){this._toggleStatus("highlight",t,e,n,i)},downplay:function(t,e,n,i){this._toggleStatus("downplay",t,e,n,i)},_toggleStatus:function(t,e,n,i,a){var l=e.getData(),u=o.a.queryDataIndex(l,a),c="highlight"===t;null!=u?r.a.util.each(s.a.normalizeToArray(u),(function(t){for(var e=0;e<this._pointsBuilderList.length;e++){var n=this._pointsBuilderList[e];c?n.highlight(l,t):n.downplay(l,t)}}),this):l.each((function(t){for(var e=0;e<this._pointsBuilderList.length;e++){var n=this._pointsBuilderList[e];c?n.highlight(l,t):n.downplay(l,t)}}))},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i);function a(t,e,n){(e=e||document.createElement("canvas")).width=t,e.height=t;var i=e.getContext("2d");return n&&n(i),e}var o={getMarginByStyle:function(t){var e=t.minMargin||0,n=0;t.stroke&&"none"!==t.stroke&&(n=null==t.lineWidth?1:t.lineWidth);var i=t.shadowBlur||0,r=t.shadowOffsetX||0,a=t.shadowOffsetY||0,o={};return o.left=Math.max(n/2,-r+i,e),o.right=Math.max(n/2,r+i,e),o.top=Math.max(n/2,-a+i,e),o.bottom=Math.max(n/2,a+i,e),o},createSymbolSprite:function(t,e,n,i){var s=function(t,e,n,i){r.a.util.isArray(e)||(e=[e,e]);var a=o.getMarginByStyle(n,i),s=e[0]+a.left+a.right,l=e[1]+a.top+a.bottom,u=r.a.helper.createSymbol(t,0,0,e[0],e[1]),c=Math.max(s,l);u.position=[a.left,a.top],s>l?u.position[1]+=(c-l)/2:u.position[0]+=(c-s)/2;var h=u.getBoundingRect();return u.position[0]-=h.x,u.position[1]-=h.y,u.setStyle(n),u.update(),u.__size=c,u}(t,e,n),l=o.getMarginByStyle(n);return{image:a(s.__size,i,(function(t){s.brush(t)})),margin:l}},createSDFFromCanvas:function(t,e,n,i){return a(e,i,(function(e){var i=t.getContext("2d").getImageData(0,0,t.width,t.height);e.putImageData(function(t,e,n){var i=e.width,r=e.height,a=t.canvas.width,o=t.canvas.height,s=i/a,l=r/o;function u(t){return t<128?1:-1}function c(t,a){var o=1/0;t=Math.floor(t*s);for(var c=(a=Math.floor(a*l))*i+t,h=u(e.data[4*c]),d=Math.max(a-n,0);d<Math.min(a+n,r);d++)for(var f=Math.max(t-n,0);f<Math.min(t+n,i);f++){c=d*i+f;var p=f-t,g=d-a;if(h!==u(e.data[4*c])){var m=p*p+g*g;m<o&&(o=m)}}return h*Math.sqrt(o)}for(var h=t.createImageData(a,o),d=0;d<o;d++)for(var f=0;f<a;f++){var p=c(f,d)/n*.5+.5,g=4*(d*a+f);h.data[g++]=255*(1-p),h.data[g++]=255*(1-p),h.data[g++]=255*(1-p),h.data[g++]=255}return h}(e,i,n),0,0)}))},createSimpleSprite:function(t,e){return a(t,e,(function(e){var n=t/2;e.beginPath(),e.arc(n,n,60,0,2*Math.PI,!1),e.closePath();var i=e.createRadialGradient(n,n,0,n,n,n);i.addColorStop(0,"rgba(255, 255, 255, 1)"),i.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),i.addColorStop(1,"rgba(255, 255, 255, 0)"),e.fillStyle=i,e.fill()}))}};e.a=o},function(t,e,n){"use strict";var i=n(2),r=n(218),a=n(0),o=n.n(a),s=n(1),l=n.n(s),u=n(219),c=l.a.vec4;i.a.Shader.import(u.a);var h=i.a.Mesh.extend((function(){var t=new i.a.Geometry({dynamic:!0,attributes:{color:new i.a.Geometry.Attribute("color","float",4,"COLOR"),position:new i.a.Geometry.Attribute("position","float",3,"POSITION"),size:new i.a.Geometry.Attribute("size","float",1),prevPosition:new i.a.Geometry.Attribute("prevPosition","float",3),prevSize:new i.a.Geometry.Attribute("prevSize","float",1)}});o.a.util.extend(t,r.a);var e=new i.a.Material({shader:i.a.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});e.enableTexture("sprite"),e.define("both","VERTEX_COLOR"),e.define("both","VERTEX_SIZE");var n=new i.a.Texture2D({image:document.createElement("canvas"),flipY:!1});return e.set("sprite",n),t.pick=this._pick.bind(this),{geometry:t,material:e,mode:i.a.Mesh.POINTS,sizeScale:1}}),{_pick:function(t,e,n,r,a,o){var s=this._positionNDC;if(s)for(var l=n.viewport,u=2/l.width,c=2/l.height,h=this.geometry.vertexCount-1;h>=0;h--){var d,f=s[2*(d=this.geometry.indices?this.geometry.indices[h]:h)],p=s[2*d+1],g=this.geometry.attributes.size.get(d)/this.sizeScale/2;if(t>f-g*u&&t<f+g*u&&e>p-g*c&&e<p+g*c){var m=new i.a.Vector3,v=new i.a.Vector3;this.geometry.attributes.position.get(d,m.array),i.a.Vector3.transformMat4(v,m,this.worldTransform),o.push({vertexIndex:d,point:m,pointWorld:v,target:this,distance:v.distance(r.getWorldPosition())})}}},updateNDCPosition:function(t,e,n){var i=this._positionNDC,r=this.geometry;i&&i.length/2===r.vertexCount||(i=this._positionNDC=new Float32Array(2*r.vertexCount));for(var a=c.create(),o=0;o<r.vertexCount;o++)r.attributes.position.get(o,a),a[3]=1,c.transformMat4(a,a,t.array),c.scale(a,a,1/a[3]),i[2*o]=a[0],i[2*o+1]=a[1]}});e.a=h},function(t,e,n){"use strict";var i=n(81),r=n(1),a=n.n(r).a.vec3;e.a={needsSortVertices:function(){return this.sortVertices},needsSortVerticesProgressively:function(){return this.needsSortVertices()&&this.vertexCount>=2e4},doSortVertices:function(t,e){var n=this.indices,i=a.create();if(!n){n=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var r=0;r<n.length;r++)n[r]=r}if(0===e){var o,s=this.attributes.position,l=(t=t.array,0);for(this._zList&&this._zList.length===this.vertexCount||(this._zList=new Float32Array(this.vertexCount)),r=0;r<this.vertexCount;r++){s.get(r,i);var u=a.sqrDist(i,t);isNaN(u)&&(u=1e7,l++),0===r?(o=u,u=0):u-=o,this._zList[r]=u}this._noneCount=l}if(this.vertexCount<2e4)0===e&&this._simpleSort(this._noneCount/this.vertexCount>.05);else for(r=0;r<3;r++)this._progressiveQuickSort(3*e+r);this.dirtyIndices()},_simpleSort:function(t){var e=this._zList,n=this.indices;function r(t,n){return e[n]-e[t]}t?Array.prototype.sort.call(n,r):i.a.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(t){var e=this._zList,n=this.indices;this._quickSort=this._quickSort||new i.a,this._quickSort.step(n,(function(t,n){return e[n]-e[t]}),t)}}},function(t,e,n){"use strict";e.a="@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end"},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(221),n(222),n(225),n(16));r.a.registerVisual(Object(a.a)("lines3D")),r.a.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},(function(){})),r.a.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},(function(){})),r.a.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},(function(){}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(1),o=n.n(a),s=o.a.vec3,l=o.a.vec2,u=s.normalize,c=s.cross,h=s.sub,d=s.add,f=s.create,p=f(),g=f(),m=f(),v=f(),y=[],x=[];function b(t,e){l.copy(y,t[0]),l.copy(x,t[1]);var n=[],i=n[0]=f(),r=n[1]=f(),a=n[2]=f(),o=n[3]=f();e.dataToPoint(y,i),e.dataToPoint(x,o),u(p,i),h(g,o,i),u(g,g),c(m,g,p),u(m,m),c(g,p,m),d(r,p,g),u(r,r),u(p,o),h(g,i,o),u(g,g),c(m,g,p),u(m,m),c(g,p,m),d(a,p,g),u(a,a),d(v,i,o),u(v,v);var b=s.dot(i,v),_=s.dot(v,r),E=(Math.max(s.len(i),s.len(o))-b)/_*2;return s.scaleAndAdd(r,i,r,E),s.scaleAndAdd(a,o,a,E),n}function _(t,e){for(var n=new Float32Array(3*t.length),i=0,r=[],a=0;a<t.length;a++)e.dataToPoint(t[a],r),n[i++]=r[0],n[i++]=r[1],n[i++]=r[2];return n}function E(t){var e=[];return t.each((function(n){var i=t.getItemModel(n),r=i.option instanceof Array?i.option:i.getShallow("coords",!0);if(!(r instanceof Array&&r.length>0&&r[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(r)+". Lines must have 2d coords array in data item.");e.push(r)})),{coordsList:e}}function w(t,e,n){var i=t.getData(),r=t.get("polyline"),a=E(i);i.setLayout("lineType",r?"polyline":"cubicBezier"),i.each((function(t){var o=a.coordsList[t],l=r?_(o,e):function(t,e,n){var i=[],r=i[0]=s.create(),a=i[1]=s.create(),o=i[2]=s.create(),l=i[3]=s.create();e.dataToPoint(t[0],r),e.dataToPoint(t[1],l);var u=s.dist(r,l);return s.lerp(a,r,l,.3),s.lerp(o,r,l,.3),s.scaleAndAdd(a,a,n,Math.min(.1*u,10)),s.scaleAndAdd(o,o,n,Math.min(.1*u,10)),i}(o,e,n);i.setItemLayout(t,l)}))}r.a.registerLayout((function(t,e){t.eachSeriesByType("lines3D",(function(t){var e=t.coordinateSystem;"globe"===e.type?function(t,e){var n=t.getData(),i=t.get("polyline");n.setLayout("lineType",i?"polyline":"cubicBezier");var r=E(n);n.each((function(t){var a=r.coordsList[t],o=i?_:b;n.setItemLayout(t,o(a,e))}))}(t,e):"geo3D"===e.type?w(t,e,[0,1,0]):"mapbox3D"===e.type&&w(t,e,[0,0,1])}))}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(22),s=n(223),l=n(40);a.a.Shader.import(l.a),r.a.extendChartView({type:"lines3D",__ecgl__:!0,init:function(t,e){this.groupGL=new a.a.Node,this._meshLinesMaterial=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new a.a.Mesh({geometry:new o.a,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new s.a},render:function(t,e,n){this.groupGL.add(this._linesMesh);var i=t.coordinateSystem,r=t.getData();if(i&&i.viewGL){i.viewGL.add(this.groupGL),this._updateLines(t,e,n);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[o]("fragment","SRGB_DECODE"),this._trailMesh.material[o]("fragment","SRGB_DECODE")}var s=this._trailMesh;if(s.stopAnimation(),t.get("effect.show")){this.groupGL.add(s),s.updateData(r,n,this._linesMesh.geometry),s.__time=s.__time||0;var l=36e5;this._curveEffectsAnimator=s.animate("",{loop:!0}).when(l,{__time:l}).during((function(){s.setAnimationTime(s.__time)})).start()}else this.groupGL.remove(s),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===t.get("blendMode")?a.a.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var t=this._curveEffectsAnimator;t&&(t.isPaused()?t.resume():t.pause())},_updateLines:function(t,e,n){var i=t.getData(),r=t.coordinateSystem,o=this._linesMesh.geometry,s=t.get("polyline");o.expandLine=!0;var l=function(t){return null!=t.radius?t.radius:null!=t.size?Math.max(t.size[0],t.size[1],t.size[2]):100}(r);o.segmentScale=l/20;var u="lineStyle.width".split("."),c=n.getDevicePixelRatio(),h=0;i.each((function(t){var e=i.getItemModel(t).get(u);null==e&&(e=1),i.setItemVisual(t,"lineWidth",e),h=Math.max(e,h)})),o.useNativeLine=!1;var d=0,f=0;i.each((function(t){var e=i.getItemLayout(t);s?(d+=o.getPolylineVertexCount(e),f+=o.getPolylineTriangleCount(e)):(d+=o.getCubicCurveVertexCount(e[0],e[1],e[2],e[3]),f+=o.getCubicCurveTriangleCount(e[0],e[1],e[2],e[3]))})),o.setVertexCount(d),o.setTriangleCount(f),o.resetOffset();var p=[];i.each((function(t){var e=i.getItemLayout(t),n=i.getItemVisual(t,"color"),r=i.getItemVisual(t,"opacity"),l=i.getItemVisual(t,"lineWidth")*c;null==r&&(r=1),(p=a.a.parseColor(n,p))[3]*=r,s?o.addPolyline(e,p,l):o.addCubicCurve(e[0],e[1],e[2],e[3],p,l)})),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(t,e,n){"use strict";var i=n(0),r=(n.n(i),n(2)),a=n(1),o=n.n(a),s=n(22),l=n(224),u=o.a.vec3;r.a.Shader.import(l.a),e.a=r.a.Mesh.extend((function(){var t=new r.a.Material({shader:new r.a.Shader(r.a.Shader.source("ecgl.trail2.vertex"),r.a.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),e=new s.a({dynamic:!0});return e.createAttribute("dist","float",1),e.createAttribute("distAll","float",1),e.createAttribute("start","float",1),{geometry:e,material:t,culling:!1,$ignorePicking:!0}}),{updateData:function(t,e,n){var i=t.hostModel,a=this.geometry,o=i.getModel("effect"),s=o.get("trailWidth")*e.getDevicePixelRatio(),l=o.get("trailLength"),c=i.get("effect.constantSpeed"),h=1e3*i.get("effect.period"),d=null!=c;this.getScene()||console.error("TrailMesh must been add to scene before updateData"),d?this.material.set("speed",c/1e3):this.material.set("period",h),this.material[d?"define":"undefine"]("vertex","CONSTANT_SPEED");var f=i.get("polyline");a.trailLength=l,this.material.set("trailLength",l),a.resetOffset(),["position","positionPrev","positionNext"].forEach((function(t){a.attributes[t].value=n.attributes[t].value})),["dist","distAll","start","offset","color"].forEach((function(t){a.attributes[t].init(a.vertexCount)})),a.indices=n.indices;var p=[],g=o.get("trailColor"),m=o.get("trailOpacity"),v=null!=g,y=null!=m;this.updateWorldTransform();var x=this.worldTransform.x.len(),b=this.worldTransform.y.len(),_=this.worldTransform.z.len(),E=0,w=0;t.each((function(e){var i=t.getItemLayout(e),o=y?m:t.getItemVisual(e,"opacity"),l=t.getItemVisual(e,"color");null==o&&(o=1),(p=r.a.parseColor(v?g:l,p))[3]*=o;for(var c=f?n.getPolylineVertexCount(i):n.getCubicCurveVertexCount(i[0],i[1],i[2],i[3]),T=0,S=[],M=[],C=E;C<E+c;C++)a.attributes.position.get(C,S),S[0]*=x,S[1]*=b,S[2]*=_,C>E&&(T+=u.dist(S,M)),a.attributes.dist.set(C,T),u.copy(M,S);w=Math.max(w,T);var A=Math.random()*(d?T:h);for(C=E;C<E+c;C++)a.attributes.distAll.set(C,T),a.attributes.start.set(C,A),a.attributes.offset.set(C,(n.attributes.offset.get(C)>0?1:-1)*s/2),a.attributes.color.set(C,p);E+=c})),this.material.set("spotSize",.1*w*l),this.material.set("spotIntensity",o.get("spotIntensity")),a.dirty()},setAnimationTime:function(t){this.material.set("time",t)}})},function(t,e,n){"use strict";e.a="@export ecgl.trail2.vertex\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute float dist;\nattribute float distAll;\nattribute float start;\n\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nuniform float speed : 0;\nuniform float trailLength: 0.3;\nuniform float time;\nuniform float period: 1000;\n\nuniform float spotSize: 1;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n\n#ifdef CONSTANT_SPEED\n float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;\n#else\n float t = mod((time + start) / period, 1. + trailLength) - trailLength;\n#endif\n\n float trailLen = distAll * trailLength;\n\n v_Percent = (dist - t * distAll) / trailLen;\n\n v_SpotPercent = spotSize / distAll;\n\n }\n@end\n\n\n@export ecgl.trail2.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform float spotIntensity: 5;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n if (v_Percent > 1.0 || v_Percent < 0.0) {\n discard;\n }\n\n float fade = v_Percent;\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n\n if (v_Percent > (1.0 - v_SpotPercent)) {\n gl_FragColor.rgb *= spotIntensity;\n }\n\n gl_FragColor.a *= fade;\n}\n\n@end"},function(t,e,n){"use strict";var i=n(0),r=n.n(i);r.a.extendSeriesModel({type:"series.lines3D",dependencies:["globe"],visualColorAccessPath:"lineStyle.color",getInitialData:function(t,e){var n=new r.a.List(["value"],this);return n.hasItemOption=!1,n.initData(t.data,[],(function(t,e,i,r){if(t instanceof Array)return NaN;n.hasItemOption=!0;var a=t.value;return null!=a?a instanceof Array?a[r]:a:void 0})),n},defaultOption:{coordinateSystem:"globe",globeIndex:0,geo3DIndex:0,zlevel:-10,polyline:!1,effect:{show:!1,period:4,trailWidth:4,trailLength:.2,spotIntensity:6},silent:!0,blendMode:"source-over",lineStyle:{width:1,opacity:.5}}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(227),n(228),n(16));r.a.registerVisual(Object(a.a)("polygons3D"))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(26);function o(t,e){for(var n=[],i=0;i<e.length;i++)n.push(t.dataToPoint(e[i]));return n}var s=r.a.extendSeriesModel({type:"series.polygons3D",getRegionModel:function(t){return this.getData().getItemModel(t)},getRegionPolygonCoords:function(t){var e=this.coordinateSystem,n=this.getData().getItemModel(t),i=n.option instanceof Array?n.option:n.getShallow("coords");n.get("multiPolygon")||(i=[i]);for(var r=[],a=0;a<i.length;a++){for(var s=[],l=1;l<i[a].length;l++)s.push(o(e,i[a][l]));r.push({exterior:o(e,i[a][0]),interiors:s})}return r},getInitialData:function(t){var e=new r.a.List(["value"],this);return e.hasItemOption=!1,e.initData(t.data,[],(function(t,n,i,r){if(t instanceof Array)return NaN;e.hasItemOption=!0;var a=t.value;return null!=a?a instanceof Array?a[r]:a:void 0})),e},defaultOption:{show:!0,data:null,multiPolygon:!1,progressiveThreshold:1e3,progressive:1e3,zlevel:-10,label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}});r.a.util.merge(s.prototype,a.a)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(59),o=n(2);r.a.extendChartView({type:"polygons3D",__ecgl__:!0,init:function(t,e){this.groupGL=new o.a.Node,this._geo3DBuilderList=[],this._currentStep=0},render:function(t,e,n){this.groupGL.removeAll();var i=t.coordinateSystem;i&&i.viewGL&&i.viewGL.add(this.groupGL);var r=this._geo3DBuilderList[0];r||((r=new a.a(n)).extrudeY="mapbox3D"!==i.type,this._geo3DBuilderList[0]=r),this._updateShaderDefines(i,r),r.update(t,e,n),this._geo3DBuilderList.length=1,this.groupGL.add(r.rootNode)},incrementalPrepareRender:function(t,e,n){this.groupGL.removeAll();var i=t.coordinateSystem;i&&i.viewGL&&i.viewGL.add(this.groupGL),this._currentStep=0},incrementalRender:function(t,e,n,i){var r=this._geo3DBuilderList[this._currentStep],o=e.coordinateSystem;r||((r=new a.a(i)).extrudeY="mapbox3D"!==o.type,this._geo3DBuilderList[this._currentStep]=r),r.update(e,n,i,t.start,t.end),this.groupGL.add(r.rootNode),this._updateShaderDefines(o,r),this._currentStep++},_updateShaderDefines:function(t,e){var n=t.viewGL.isLinearSpace()?"define":"undefine";e.rootNode.traverse((function(e){e.material&&(e.material[n]("fragment","SRGB_DECODE"),"mapbox3D"===t.type&&(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1)))}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(230),n(231),n(232),n(16));r.a.registerVisual(Object(a.a)("surface"))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(26),o=n(35),s=n(44),l=r.a.extendSeriesModel({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualColorAccessPath:"itemStyle.color",formatTooltip:function(t){return Object(o.a)(this,t)},getInitialData:function(t,e){var n=t.data;function i(t){return!(isNaN(t.min)||isNaN(t.max)||isNaN(t.step))}function a(t){var e=r.a.number.getPrecisionSafe;return Math.max(e(t.min),e(t.max),e(t.step))+1}if(!n)if(n=[],t.parametric){var o=t.parametricEquation||{},l=o.u||{},u=o.v||{};["u","v"].forEach((function(t){i(o[t])||console.error("Invalid parametricEquation.%s",t)})),["x","y","z"].forEach((function(t){"function"==typeof o[t]||console.error("parametricEquation.%s needs to be function",t)}));for(var c=a(l),h=a(u),d=u.min;d<u.max+.999*u.step;d+=u.step)for(var f=l.min;f<l.max+.999*l.step;f+=l.step){var p=r.a.number.round(Math.min(f,l.max),c),g=r.a.number.round(Math.min(d,u.max),h);E=o.x(p,g),_=o.y(p,g),S=o.z(p,g),n.push([E,_,S,p,g])}}else{var m=t.equation||{},v=m.x||{},y=m.y||{};if(["x","y"].forEach((function(t){i(m[t])||console.error("Invalid equation.%s",t)})),"function"!=typeof m.z)return void console.error("equation.z needs to be function");for(var x=a(v),b=a(y),_=y.min;_<y.max+.999*y.step;_+=y.step)for(var E=v.min;E<v.max+.999*v.step;E+=v.step){var w=r.a.number.round(Math.min(E,v.max),x),T=r.a.number.round(Math.min(_,y.max),b),S=m.z(w,T);n.push([w,T,S])}}var M=["x","y","z"];return t.parametric&&M.push("u","v"),Object(s.a)(this,M,t.data||n)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},itemStyle:{},animationDurationUpdate:500}});r.a.util.merge(l.prototype,a.a)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=(n(3),n(1)),s=n.n(o),l=n(60),u=s.a.vec3;r.a.extendChartView({type:"surface",__ecgl__:!0,init:function(t,e){this.groupGL=new a.a.Node},render:function(t,e,n){var i=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=i,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var r=t.coordinateSystem,o=t.get("shading"),s=t.getData(),l="ecgl."+o;if(this._surfaceMesh.material&&this._surfaceMesh.material.shader.name===l||(this._surfaceMesh.material=a.a.createMaterial(l,["VERTEX_COLOR","DOUBLE_SIDED"])),a.a.setMaterialFromModel(o,this._surfaceMesh.material,t,n),r&&r.viewGL){r.viewGL.add(this.groupGL);var u=r.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[u]("fragment","SRGB_DECODE")}var c=t.get("parametric"),h=this._getDataShape(s,c),d=t.getModel("wireframe"),f=d.get("lineStyle.width"),p=d.get("show")&&f>0;this._updateSurfaceMesh(this._surfaceMesh,t,h,p);var g=this._surfaceMesh.material;p?(g.define("WIREFRAME_QUAD"),g.set("wireframeLineWidth",f),g.set("wireframeLineColor",a.a.parseColor(d.get("lineStyle.color")))):g.undefine("WIREFRAME_QUAD"),this._initHandler(t,n),this._updateAnimation(t)},_updateAnimation:function(t){a.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,t)},_createSurfaceMesh:function(){var t=new a.a.Mesh({geometry:new a.a.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new a.a.Material({shader:new a.a.Shader(a.a.Shader.source("ecgl.sm.depth.vertex"),a.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return t.geometry.createAttribute("barycentric","float",4),t.geometry.createAttribute("prevPosition","float",3),t.geometry.createAttribute("prevNormal","float",3),r.a.util.extend(t.geometry,l.a),t},_initHandler:function(t,e){var n=t.getData(),i=this._surfaceMesh,r=t.coordinateSystem;i.seriesIndex=t.seriesIndex;var a=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(t){var o=function(t,e){for(var n=1/0,r=-1,a=[],o=0;o<t.length;o++){i.geometry.attributes.position.get(t[o],a);var s=u.dist(e.array,a);s<n&&(n=s,r=t[o])}return r}(t.triangle,t.point);if(o>=0){var s=[];i.geometry.attributes.position.get(o,s);for(var l=r.pointToData(s),c=1/0,h=-1,d=[],f=0;f<n.count();f++){d[0]=n.get("x",f),d[1]=n.get("y",f),d[2]=n.get("z",f);var p=u.squaredDistance(d,l);p<c&&(h=f,c=p)}h!==a&&e.dispatchAction({type:"grid3DShowAxisPointer",value:l}),a=h,i.dataIndex=h}else i.dataIndex=-1}),this),i.on("mouseout",(function(t){a=-1,i.dataIndex=-1,e.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_updateSurfaceMesh:function(t,e,n,i){var r=t.geometry,o=e.getData(),s=o.getLayout("points"),l=0;o.each((function(t){o.hasValue(t)||l++}));var c=l||i,h=r.attributes.position,d=r.attributes.normal,f=r.attributes.texcoord0,p=r.attributes.barycentric,g=r.attributes.color,m=n.row,v=n.column,y="color"!==e.get("shading");if(c){var x=(m-1)*(v-1)*4;h.init(x),i&&p.init(x)}else h.value=new Float32Array(s);g.init(r.vertexCount),f.init(r.vertexCount);var b,_=[0,3,1,1,3,2],E=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],w=r.indices=new(r.vertexCount>65535?Uint32Array:Uint16Array)((m-1)*(v-1)*6),T=function(t,e,n){n[1]=t*v+e,n[0]=t*v+e+1,n[3]=(t+1)*v+e+1,n[2]=(t+1)*v+e},S=!1;if(c){var M=[],C=[],A=0;y?d.init(r.vertexCount):d.value=null;for(var O=[[],[],[]],N=[],P=[],L=u.create(),R=function(t,e,n){var i=3*e;return n[0]=t[i],n[1]=t[i+1],n[2]=t[i+2],n},D=new Float32Array(s.length),k=new Float32Array(s.length/3*4),I=0;I<o.count();I++)if(o.hasValue(I)){var B=a.a.parseColor(o.getItemVisual(I,"color")),F=o.getItemVisual(I,"opacity");B[3]*=F,B[3]<.99&&(S=!0);for(var z=0;z<4;z++)k[4*I+z]=B[z]}var G=[1e7,1e7,1e7];for(I=0;I<m-1;I++)for(var j=0;j<v-1;j++){var U=4*(I*(v-1)+j);T(I,j,M);var H=!1;for(z=0;z<4;z++)R(s,M[z],C),b=C,(isNaN(b[0])||isNaN(b[1])||isNaN(b[2]))&&(H=!0);for(z=0;z<4;z++)H?h.set(U+z,G):(R(s,M[z],C),h.set(U+z,C)),i&&p.set(U+z,E[z]);for(z=0;z<6;z++)w[A++]=_[z]+U;if(y&&!H)for(z=0;z<2;z++){for(var V=3*z,Z=0;Z<3;Z++)R(s,Y=M[_[V]+Z],O[Z]);for(u.sub(N,O[0],O[1]),u.sub(P,O[1],O[2]),u.cross(L,N,P),Z=0;Z<3;Z++){var W=3*M[_[V]+Z];D[W]=D[W]+L[0],D[W+1]=D[W+1]+L[1],D[W+2]=D[W+2]+L[2]}}}if(y)for(I=0;I<D.length/3;I++)R(D,I,L),u.normalize(L,L),D[3*I]=L[0],D[3*I+1]=L[1],D[3*I+2]=L[2];B=[];var X=[];for(I=0;I<m-1;I++)for(j=0;j<v-1;j++)for(U=4*(I*(v-1)+j),T(I,j,M),z=0;z<4;z++){for(Z=0;Z<4;Z++)B[Z]=k[4*M[z]+Z];g.set(U+z,B),y&&(R(D,M[z],L),d.set(U+z,L));var Y=M[z];X[0]=Y%v/(v-1),X[1]=Math.floor(Y/v)/(m-1),f.set(U+z,X)}}else{for(X=[],I=0;I<o.count();I++)X[0]=I%v/(v-1),X[1]=Math.floor(I/v)/(m-1),B=a.a.parseColor(o.getItemVisual(I,"color")),F=o.getItemVisual(I,"opacity"),B[3]*=F,B[3]<.99&&(S=!0),g.set(I,B),f.set(I,X);M=[];var q=0;for(I=0;I<m-1;I++)for(j=0;j<v-1;j++)for(T(I,j,M),z=0;z<6;z++)w[q++]=M[_[z]];y?r.generateVertexNormals():d.value=null}t.material.get("normalMap")&&r.generateTangents(),r.updateBoundingBox(),r.dirty(),t.material.transparent=S,t.material.depthMask=!S},_getDataShape:function(t,e){for(var n=-1/0,i=0,r=0,a=0,o=e?"u":"x",s=0;s<t.count();s++){var l=t.get(o,s);if(l<n){if(a&&a!==r)throw new Error("Invalid data. data should be a row major 2d array.");a=r,r=0,i++}n=l,r++}return{row:i+1,column:r}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(t,e,n){"use strict";var i=n(0);n.n(i).a.registerLayout((function(t,e){t.eachSeriesByType("surface",(function(t){var e=t.coordinateSystem;e&&"cartesian3D"===e.type||console.error("Surface chart only support cartesian3D coordinateSystem");var n=t.getData(),i=new Float32Array(3*n.count()),r=[NaN,NaN,NaN];if(e&&"cartesian3D"===e.type){var a=e.dimensions.map((function(e){return t.coordDimToDataDim(e)[0]}));n.each(a,(function(t,a,o,s){var l;l=n.hasValue(s)?e.dataToPoint([t,a,o]):r,i[3*s]=l[0],i[3*s+1]=l[1],i[3*s+2]=l[2]}))}n.setLayout("points",i)}))}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(83),n(234),n(235),n(16));r.a.registerVisual(Object(a.a)("map3D")),r.a.registerAction({type:"map3DChangeCamera",event:"map3dcamerachanged",update:"series:updateCamera"},(function(t,e){e.eachComponent({mainType:"series",subType:"map3D",query:t},(function(e){e.setView(t)}))}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(38),o=n(31),s=n(32),l=n(26),u=n(80),c=n(27),h=n(35),d=n(82);function f(t,e){for(var n=[],i=0;i<e.length;i++)n.push(t.dataToPoint(e[i]));return n}var p=r.a.extendSeriesModel({type:"series.map3D",layoutMode:"box",coordinateSystem:null,visualColorAccessPath:"itemStyle.color",optionUpdated:function(t){t=t||{};var e=this.get("coordinateSystem");if(null!=e&&"geo3D"!==e){var n=[];["left","top","width","height","boxWidth","boxDepth","boxHeight","light","viewControl","postEffect","temporalSuperSampling","environment","groundPlane"].forEach((function(e){null!=t[e]&&n.push(e)})),n.length&&console.warn("Property %s in map3D series will be ignored if coordinate system is %s",n.join(", "),e),this.get("groundPlane.show")&&(this.option.groundPlane.show=!1),this._geo=null}},getInitialData:function(t){t.data=this.getFilledRegions(t.data,t.map);var e=r.a.helper.completeDimensions(["value"],t.data),n=new r.a.List(e,this);n.initData(t.data);var i={};return n.each((function(t){var e=n.getName(t),r=n.getItemModel(t);i[e]=r})),this._regionModelMap=i,n},formatTooltip:function(t){return Object(h.a)(this,t)},getRegionModel:function(t){var e=this.getData().getName(t);return this._regionModelMap[e]||new r.a.Model(null,this)},getRegionPolygonCoords:function(t){var e=this.coordinateSystem,n=this.getData().getName(t);if(e.transform)return(i=e.getRegion(n))?i.geometries:[];this._geo||(this._geo=d.a.createGeo3D(this));for(var i=this._geo.getRegion(n),r=[],a=0;a<i.geometries.length;a++){var o=i.geometries[a],s=[],l=f(e,o.exterior);if(s&&s.length)for(var u=0;u<o.interiors.length;u++)s.push(f(e,s[u]));r.push({interiors:s,exterior:l})}return r},getFormattedLabel:function(t,e){var n=c.a.getFormattedLabel(this,t,e);return null==n&&(n=this.getData().getName(t)),n},defaultOption:{coordinateSystem:"geo3D",data:null}});r.a.util.merge(p.prototype,u.a),r.a.util.merge(p.prototype,a.a),r.a.util.merge(p.prototype,o.a),r.a.util.merge(p.prototype,s.a),r.a.util.merge(p.prototype,l.a)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(39),s=n(34),l=n(59);r.a.extendChartView({type:"map3D",__ecgl__:!0,init:function(t,e){this._geo3DBuilder=new l.a(e),this.groupGL=new a.a.Node},render:function(t,e,n){var i=t.coordinateSystem;if(i&&i.viewGL){if(this.groupGL.add(this._geo3DBuilder.rootNode),i.viewGL.add(this.groupGL),"geo3D"===i.type){this._sceneHelper||(this._sceneHelper=new s.a,this._sceneHelper.initLight(this.groupGL)),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(t),i.viewGL.setPostEffect(t.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling"));var r=this._control;r||(r=this._control=new o.a({zr:n.getZr()}),this._control.init());var a=t.getModel("viewControl");r.setViewGL(i.viewGL),r.setFromViewControlModel(a,0),r.off("update"),r.on("update",(function(){n.dispatchAction({type:"map3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),from:this.uid,map3DId:t.id})})),this._geo3DBuilder.extrudeY=!0}else this._control&&(this._control.dispose(),this._control=null),this._sceneHelper&&(this._sceneHelper.dispose(),this._sceneHelper=null),t.getData().getLayout("geo3D"),this._geo3DBuilder.extrudeY=!1;this._geo3DBuilder.update(t,e,n,0,t.getData().count());var l=i.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(t){t.material&&t.material[l]("fragment","SRGB_DECODE")}))}},afterRender:function(t,e,n,i){var r=i.renderer,a=t.coordinateSystem;a&&"geo3D"===a.type&&(this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n))},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(237),n(238),n(45)),o=n.n(a),s=n(16);r.a.registerVisual(o()("scatterGL","circle",null)),r.a.registerVisual(Object(s.a)("scatterGL")),r.a.registerLayout({seriesType:"scatterGL",reset:function(t){var e,n=t.coordinateSystem;if(n){var i=n.dimensions,r=[];1===i.length?e=function(t,e){for(var r=new Float32Array(2*(t.end-t.start)),a=t.start;a<t.end;a++){var o=2*(a-t.start),s=e.get(i[0],a),l=n.dataToPoint(s);r[o]=l[0],r[o+1]=l[1]}e.setLayout("points",r)}:2===i.length&&(e=function(t,e){for(var a=new Float32Array(2*(t.end-t.start)),o=t.start;o<t.end;o++){var s=2*(o-t.start),l=e.get(i[0],o),u=e.get(i[1],o);r[0]=l,r[1]=u,r=n.dataToPoint(r),a[s]=r[0],a[s+1]=r[1]}e.setLayout("points",a)})}return{progress:e}}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i);r.a.extendSeriesModel({type:"series.scatterGL",dependencies:["grid","polar","geo","singleAxis"],visualColorAccessPath:"itemStyle.color",getInitialData:function(){return r.a.helper.createList(this)},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,progressive:1e5,progressiveThreshold:1e5,large:!1,symbol:"circle",symbolSize:10,zoomScale:0,blendMode:"source-over",itemStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(20),s=n(62),l=n(84);n(3),r.a.extendChartView({type:"scatterGL",__ecgl__:!0,init:function(t,e){this.groupGL=new a.a.Node,this.viewGL=new o.a("orthographic"),this.viewGL.add(this.groupGL),this._pointsBuilderList=[],this._currentStep=0,this._sizeScale=1,this._glViewHelper=new l.a(this.viewGL)},render:function(t,e,n){if(this.groupGL.removeAll(),this._glViewHelper.reset(t,n),t.getData().count()){var i=this._pointsBuilderList[0];i||(i=this._pointsBuilderList[0]=new s.a(!0,n)),this._pointsBuilderList.length=1,this.groupGL.add(i.rootNode),this._removeTransformInPoints(t.getData().getLayout("points")),i.update(t,e,n),this.viewGL.setPostEffect(t.getModel("postEffect"),n)}},incrementalPrepareRender:function(t,e,n){this.groupGL.removeAll(),this._glViewHelper.reset(t,n),this._currentStep=0,this.viewGL.setPostEffect(t.getModel("postEffect"),n)},incrementalRender:function(t,e,n,i){if(!(t.end<=t.start)){var r=this._pointsBuilderList[this._currentStep];r||(r=new s.a(!0,i),this._pointsBuilderList[this._currentStep]=r),this.groupGL.add(r.rootNode),this._removeTransformInPoints(e.getData().getLayout("points")),r.setSizeScale(this._sizeScale),r.update(e,n,i,t.start,t.end),i.getZr().refresh(),this._currentStep++}},updateTransform:function(t,e,n){if(t.coordinateSystem.getRoamTransform){this._glViewHelper.updateTransform(t,n);var i=this._glViewHelper.getZoom(),r=Math.max((t.get("zoomScale")||0)*(i-1)+1,0);this._sizeScale=r,this._pointsBuilderList.forEach((function(t){t.setSizeScale(r)}))}},_removeTransformInPoints:function(t){if(t)for(var e=[],n=0;n<t.length;n+=2)e[0]=t[n],e[1]=t[n+1],this._glViewHelper.removeTransformInPoint(e),t[n]=e[0],t[n+1]=e[1]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(240),n(246),n(45)),o=n.n(a),s=n(16);function l(){}r.a.registerVisual(o()("graphGL","circle",null)),r.a.registerVisual(Object(s.a)("graphGL")),r.a.registerVisual((function(t){var e={};t.eachSeriesByType("graphGL",(function(t){var n=t.getCategoriesData(),i=t.getData(),r={};n.each((function(i){var a=n.getName(i);r[a]=i;var o=n.getItemModel(i).get("itemStyle.color")||t.getColorFromPalette(a,e);n.setItemVisual(i,"color",o)})),n.count()&&i.each((function(t){var e=i.getItemModel(t).getShallow("category");null!=e&&("string"==typeof e&&(e=r[e]),i.getItemVisual(t,"color",!0)||i.setItemVisual(t,"color",n.getItemVisual(e,"color")))}))}))})),r.a.registerVisual((function(t){t.eachSeriesByType("graphGL",(function(t){var e=t.getGraph(),n=t.getEdgeData(),i="lineStyle.color".split("."),r="lineStyle.opacity".split(".");n.setVisual("color",t.get(i)),n.setVisual("opacity",t.get(r)),n.each((function(t){var a=n.getItemModel(t),o=e.getEdgeByIndex(t),s=a.get(i),l=a.get(r);switch(s){case"source":s=o.node1.getVisual("color");break;case"target":s=o.node2.getVisual("color")}o.setVisual("color",s),o.setVisual("opacity",l)}))}))})),r.a.registerAction({type:"graphGLRoam",event:"graphglroam",update:"series.graphGL:roam"},(function(t,e){e.eachComponent({mainType:"series",query:t},(function(e){e.setView(t)}))})),r.a.registerAction({type:"graphGLStartLayout",event:"graphgllayoutstarted",update:"series.graphGL:startLayout"},l),r.a.registerAction({type:"graphGLStopLayout",event:"graphgllayoutstopped",update:"series.graphGL:stopLayout"},l),r.a.registerAction({type:"graphGLFocusNodeAdjacency",event:"graphGLFocusNodeAdjacency",update:"series.graphGL:focusNodeAdjacency"},l),r.a.registerAction({type:"graphGLUnfocusNodeAdjacency",event:"graphGLUnfocusNodeAdjacency",update:"series.graphGL:unfocusNodeAdjacency"},l)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(241),o=n(27),s=r.a.extendSeriesModel({type:"series.graphGL",visualColorAccessPath:"itemStyle.color",init:function(t){s.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(t){s.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(t,e,n,i){var r=o.a.getFormattedLabel(this,t,e,n,i);if(null==r){var a=this.getData(),s=a.dimensions[a.dimensions.length-1];r=a.get(s,t)}return r},getInitialData:function(t,e){var n=t.edges||t.links||[],i=t.data||t.nodes||[],o=this;if(i&&n)return Object(a.a)(i,n,this,!0,(function(t,n){t.wrapMethod("getItemModel",(function(t){var e=o._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t}));var i=o.getModel("edgeLabel"),a=new r.a.Model({label:i.option},i.parentModel,e);function s(t){return(t=this.parsePath(t))&&"label"===t[0]?a:this.parentModel}n.wrapMethod("getItemModel",(function(t){return t.customizeGetParent(s),t}))})).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(t,e,n){if("edge"===n){var i=this.getData(),a=this.getDataParams(t,n),o=i.graph.getEdgeByIndex(t),l=i.getName(o.node1.dataIndex),u=i.getName(o.node2.dataIndex),c=[];return null!=l&&c.push(l),null!=u&&c.push(u),c=r.a.format.encodeHTML(c.join(" > ")),a.value&&(c+=" : "+r.a.format.encodeHTML(a.value)),c}return s.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var t=(this.option.categories||[]).map((function(t){return null!=t.value?t:r.a.util.extend({value:0},t)})),e=new r.a.List(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t,!0)}))},setView:function(t){null!=t.zoom&&(this.option.zoom=t.zoom),null!=t.offset&&(this.option.offset=t.offset)},setNodePosition:function(t){for(var e=0;e<t.length/2;e++){var n=t[2*e],i=t[2*e+1],r=this.getData().getRawDataItem(e);r.x=n,r.y=i}},isAnimationEnabled:function(){return s.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:10,z:2,legendHoverLink:!0,layout:"forceAtlas2",forceAtlas2:{initLayout:null,GPU:!0,steps:1,maxSteps:1e3,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,edgeWeightInfluence:1,edgeWeight:[1,4],nodeWeight:[1,4],preventOverlap:!1,gravityCenter:null},focusNodeAdjacency:!0,focusNodeAdjacencyOn:"mouseover",left:"center",top:"center",symbol:"circle",symbolSize:5,roam:!1,center:null,zoom:1,label:{show:!1,formatter:"{b}",position:"right",distance:5,textStyle:{fontSize:14}},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}},animation:!1}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(242),o=n.n(a),s=n(245),l=n.n(s),u=n(3);e.a=function(t,e,n,i,a){for(var s=new o.a(i),c=0;c<t.length;c++)s.addNode(u.a.firstNotNull(t[c].id,t[c].name,c),c);var h,d=[],f=[],p=0;for(c=0;c<e.length;c++){var g=e[c],m=g.source,v=g.target;s.addEdge(m,v,p)&&(f.push(g),d.push(u.a.firstNotNull(g.id,m+" > "+v)),p++)}var y=r.a.helper.completeDimensions(["value"],t);(h=new r.a.List(y,n)).initData(t);var x=new r.a.List(["value"],n);return x.initData(f,d),a&&a(h,x),l()({mainData:h,struct:s,structAttr:"graph",datas:{node:h,edge:x},datasAttr:{node:"data",edge:"edgeData"}}),s.update(),s}},function(t,e,n){n(85).__DEV__;var i=n(12),r=n(244).enableClassCheck;function a(t){return"_EC_"+t}var o=function(t){this._directed=t||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},s=o.prototype;function l(t,e){this.id=null==t?"":t,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==e?-1:e}function u(t,e,n){this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}s.type="graph",s.isDirected=function(){return this._directed},s.addNode=function(t,e){t=t||""+e;var n=this._nodesMap;if(!n[a(t)]){var i=new l(t,e);return i.hostGraph=this,this.nodes.push(i),n[a(t)]=i,i}},s.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},s.getNodeById=function(t){return this._nodesMap[a(t)]},s.addEdge=function(t,e,n){var i=this._nodesMap,r=this._edgesMap;if("number"==typeof t&&(t=this.nodes[t]),"number"==typeof e&&(e=this.nodes[e]),l.isInstance(t)||(t=i[a(t)]),l.isInstance(e)||(e=i[a(e)]),t&&e){var o=t.id+"-"+e.id;if(!r[o]){var s=new u(t,e,n);return s.hostGraph=this,this._directed&&(t.outEdges.push(s),e.inEdges.push(s)),t.edges.push(s),t!==e&&e.edges.push(s),this.edges.push(s),r[o]=s,s}}},s.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},s.getEdge=function(t,e){l.isInstance(t)&&(t=t.id),l.isInstance(e)&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},s.eachNode=function(t,e){for(var n=this.nodes,i=n.length,r=0;r<i;r++)n[r].dataIndex>=0&&t.call(e,n[r],r)},s.eachEdge=function(t,e){for(var n=this.edges,i=n.length,r=0;r<i;r++)n[r].dataIndex>=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&t.call(e,n[r],r)},s.breadthFirstTraverse=function(t,e,n,i){if(l.isInstance(e)||(e=this._nodesMap[a(e)]),e){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!t.call(i,e,null))for(var s=[e];s.length;){var u=s.shift(),c=u[r];for(o=0;o<c.length;o++){var h=c[o],d=h.node1===u?h.node2:h.node1;if(!d.__visited){if(t.call(i,d,u))return;s.push(d),d.__visited=!0}}}}},s.update=function(){for(var t=this.data,e=this.edgeData,n=this.nodes,i=this.edges,r=0,a=n.length;r<a;r++)n[r].dataIndex=-1;for(r=0,a=t.count();r<a;r++)n[t.getRawIndex(r)].dataIndex=r;for(e.filterSelf((function(t){var n=i[e.getRawIndex(t)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0})),r=0,a=i.length;r<a;r++)i[r].dataIndex=-1;for(r=0,a=e.count();r<a;r++)i[e.getRawIndex(r)].dataIndex=r},s.clone=function(){for(var t=new o(this._directed),e=this.nodes,n=this.edges,i=0;i<e.length;i++)t.addNode(e[i].id,e[i].dataIndex);for(i=0;i<n.length;i++){var r=n[i];t.addEdge(r.node1.id,r.node2.id,r.dataIndex)}return t},l.prototype={constructor:l,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(t){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)}},u.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)};var c=function(t,e){return{getValue:function(n){var i=this[t][e];return i.get(i.getDimension(n||"value"),this.dataIndex)},setVisual:function(n,i){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n,i){return this[t][e].getItemVisual(this.dataIndex,n,i)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}};i.mixin(l,c("hostGraph","data")),i.mixin(u,c("hostGraph","edgeData")),o.Node=l,o.Edge=u,r(l),r(u);var h=o;t.exports=h},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){n(85).__DEV__;var i=n(12),r="___EC__COMPONENT__CONTAINER___";function a(t){var e={main:"",sub:""};return t&&(t=t.split("."),e.main=t[0]||"",e.sub=t[1]||""),e}var o=0;function s(t,e){var n=i.slice(arguments,2);return this.superClass.prototype[e].apply(t,n)}function l(t,e,n){return this.superClass.prototype[e].apply(t,n)}e.parseClassType=a,e.enableClassExtend=function(t,e){t.$constructor=t,t.extend=function(t){var e=this,n=function(){t.$constructor?t.$constructor.apply(this,arguments):e.apply(this,arguments)};return i.extend(n.prototype,t),n.extend=this.extend,n.superCall=s,n.superApply=l,i.inherits(n,this),n.superClass=e,n}},e.enableClassCheck=function(t){var e=["__\0is_clz",o++,Math.random().toFixed(3)].join("_");t.prototype[e]=!0,t.isInstance=function(t){return!(!t||!t[e])}},e.enableClassManagement=function(t,e){e=e||{};var n={};if(t.registerClass=function(t,e){if(e)if(function(t){i.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}(e),(e=a(e)).sub){if(e.sub!==r){var o=function(t){var e=n[t.main];return e&&e[r]||((e=n[t.main]={})[r]=!0),e}(e);o[e.sub]=t}}else n[e.main]=t;return t},t.getClass=function(t,e,i){var a=n[t];if(a&&a[r]&&(a=e?a[e]:null),i&&!a)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return a},t.getClassesByMainType=function(t){t=a(t);var e=[],o=n[t.main];return o&&o[r]?i.each(o,(function(t,n){n!==r&&e.push(t)})):e.push(o),e},t.hasClass=function(t){return t=a(t),!!n[t.main]},t.getAllClassMainTypes=function(){var t=[];return i.each(n,(function(e,n){t.push(n)})),t},t.hasSubTypes=function(t){t=a(t);var e=n[t.main];return e&&e[r]},t.parseClassType=a,e.registerWhenExtend){var o=t.extend;o&&(t.extend=function(e){var n=o.call(this,e);return t.registerClass(n,e.type)})}return t},e.setReadOnly=function(t,e){}},function(t,e,n){var i=n(12),r=i.each,a="\0__link_datas",o="\0__link_mainData";function s(t,e){if((r=this)[o]===r){var n=i.extend({},this[a]);n[this.dataType]=e,h(e,n,t)}else d(e,this.dataType,this[o],t);var r;return e}function l(t,e){return t.struct&&t.struct.update(this),e}function u(t,e){return r(e[a],(function(n,i){n!==e&&d(n.cloneShallow(),i,e,t)})),e}function c(t){var e=this[o];return null==t||null==e?e:e[a][t]}function h(t,e,n){t[a]={},r(e,(function(e,i){d(e,i,t,n)}))}function d(t,e,n,i){n[a][e]=t,t[o]=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),t.getLinkedData=c}var f=function(t){var e=t.mainData,n=t.datas;n||(n={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,h(e,n,t),r(n,(function(n){r(e.TRANSFERABLE_METHODS,(function(e){n.wrapMethod(e,i.curry(s,t))}))})),e.wrapMethod("cloneShallow",i.curry(u,t)),r(e.CHANGABLE_METHODS,(function(n){e.wrapMethod(n,i.curry(l,t))})),i.assert(n[e.dataType]===e)};t.exports=f},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(41),o=n.n(a),s=n(2),l=n(20),u=n(86),c=n(3),h=n(247),d=n(249),f=n(65),p=n.n(f),g=n(1),m=n.n(g),v=n(251),y=n(62),x=n(252),b=m.a.vec2;s.a.Shader.import(x.a);var _,E=1;r.a.extendChartView({type:"graphGL",__ecgl__:!0,init:function(t,e){this.groupGL=new s.a.Node,this.viewGL=new l.a("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new y.a(!0,e),this._forceEdgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new s.a.Geometry({attributes:{node:new s.a.Geometry.Attribute("node","float",2),color:new s.a.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:s.a.Mesh.LINES}),this._edgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new u.a({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new v.a({zr:e.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(t,e,n){this.groupGL.add(this._pointsBuilder.rootNode),this._model=t,this._api=n,this._initLayout(t,e,n),this._pointsBuilder.update(t,e,n),this._forceLayoutInstance instanceof h.a||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(t,n),this._control.off("update"),this._control.on("update",(function(){n.dispatchAction({type:"graphGLRoam",seriesId:t.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(c.a.firstNotNull(t.get("zoom"),1)),this._control.setOffset(t.get("offset")||[0,0]);var i=this._pointsBuilder.getPointsMesh();if(i.off("mousemove",this._mousemoveHandler),i.off("mouseout",this._mouseOutHandler,this),n.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,t.get("focusNodeAdjacency")){var r=t.get("focusNodeAdjacencyOn");"click"===r?n.getZr().on("click",this._clickHandler):"mouseover"===r?(i.on("mousemove",this._mousemoveHandler,this),i.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):console.warn("Unkown focusNodeAdjacencyOn value s"+r)}this._lastMouseOverDataIndex=-1},_clickHandler:function(t){if(!this._layouting){var e=this._pointsBuilder.getPointsMesh().dataIndex;e>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:e}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(t){if(!this._layouting){var e=this._pointsBuilder.getPointsMesh().dataIndex;e>=0?e!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:e}):this._mouseOutHandler(t),this._lastMouseOverDataIndex=e}},_mouseOutHandler:function(t){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(t,e){var n=this._forceEdgesMesh.geometry,i=e.getEdgeData(),r=0,a=this._forceLayoutInstance,o=2*i.count();n.attributes.node.init(o),n.attributes.color.init(o),i.each((function(e){var o=t[e];n.attributes.node.set(r,a.getNodeUV(o.node1)),n.attributes.node.set(r+1,a.getNodeUV(o.node2));var l=i.getItemVisual(o.dataIndex,"color"),u=s.a.parseColor(l);u[3]*=c.a.firstNotNull(i.getItemVisual(o.dataIndex,"opacity"),1),n.attributes.color.set(r,u),n.attributes.color.set(r+1,u),r+=2})),n.dirty()},_updateMeshLinesGeometry:function(){var t=this._model.getEdgeData(),e=this._edgesMesh.geometry,n=(t=this._model.getEdgeData(),this._model.getData().getLayout("points"));e.resetOffset(),e.setVertexCount(t.count()*e.getLineVertexCount()),e.setTriangleCount(t.count()*e.getLineTriangleCount());var i=[],r=[],a=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*t.count()),this._edgeIndicesMap=new Float32Array(t.count()),t.each((function(o){var l=t.graph.getEdgeByIndex(o),u=2*l.node1.dataIndex,h=2*l.node2.dataIndex;i[0]=n[u],i[1]=n[u+1],r[0]=n[h],r[1]=n[h+1];var d=t.getItemVisual(l.dataIndex,"color"),f=s.a.parseColor(d);f[3]*=c.a.firstNotNull(t.getItemVisual(l.dataIndex,"opacity"),1);var p=t.getItemModel(l.dataIndex),g=c.a.firstNotNull(p.get(a),1)*this._api.getDevicePixelRatio();e.addLine(i,r,f,g);for(var m=0;m<4;m++)this._originalEdgeColors[4*l.dataIndex+m]=f[m];this._edgeIndicesMap[l.dataIndex]=o}),!1,this),e.dirty()},_updateForceNodesGeometry:function(t){for(var e=this._pointsBuilder.getPointsMesh(),n=[],i=0;i<t.count();i++)this._forceLayoutInstance.getNodeUV(i,n),e.geometry.attributes.position.set(i,n);e.geometry.dirty("position")},_initLayout:function(t,e,n){var i=t.get("layout"),a=t.getGraph(),s=t.getBoxLayoutParams(),l=o.a.getLayoutRect(s,{width:n.getWidth(),height:n.getHeight()});"force"===i&&(console.warn("Currently only forceAtlas2 layout supported."),i="forceAtlas2"),this.stopLayout(t,e,n,{beforeLayout:!0});var u=t.getData(),f=t.getData();if("forceAtlas2"===i){var p=t.getModel("forceAtlas2"),g=this._forceLayoutInstance,m=[],v=[],y=u.getDataExtent("value"),x=f.getDataExtent("value"),b=c.a.firstNotNull(p.get("edgeWeight"),1),_=c.a.firstNotNull(p.get("nodeWeight"),1);"number"==typeof b&&(b=[b,b]),"number"==typeof _&&(_=[_,_]);var E=0,w={},T=new Float32Array(2*u.count());if(a.eachNode((function(t){var e,n,i=t.dataIndex,a=u.get("value",i);if(u.hasItemOption){var o=u.getItemModel(i);e=o.get("x"),n=o.get("y")}null==e&&(e=l.x+Math.random()*l.width,n=l.y+Math.random()*l.height),T[2*E]=e,T[2*E+1]=n,w[t.id]=E++;var s=r.a.number.linearMap(a,y,_);isNaN(s)&&(s=isNaN(_[0])?1:_[0]),m.push({x:e,y:n,mass:s,size:u.getItemVisual(i,"symbolSize")})})),u.setLayout("points",T),a.eachEdge((function(t){var e=t.dataIndex,n=u.get("value",e),i=r.a.number.linearMap(n,x,b);isNaN(i)&&(i=isNaN(b[0])?1:b[0]),v.push({node1:w[t.node1.id],node2:w[t.node2.id],weight:i,dataIndex:e})})),!g){var S=p.get("GPU");this._forceLayoutInstance&&((!S||this._forceLayoutInstance instanceof h.a)&&(S||this._forceLayoutInstance instanceof d.a)||(this._forceLayoutInstanceToDispose=this._forceLayoutInstance)),g=this._forceLayoutInstance=S?new h.a:new d.a}g.initData(m,v),g.updateOption(p.option),this._updateForceEdgesGeometry(g.getEdges(),t),this._updatePositionTexture(),n.dispatchAction({type:"graphGLStartLayout",from:this.uid})}else T=new Float32Array(2*u.count()),E=0,a.eachNode((function(t){var e,n,i=t.dataIndex;if(u.hasItemOption){var r=u.getItemModel(i);e=r.get("x"),n=r.get("y")}T[E++]=e,T[E++]=n})),u.setLayout("points",T),this._updateAfterLayout(t,e,n)},_updatePositionTexture:function(){var t=this._forceLayoutInstance.getNodePositionTexture();this._pointsBuilder.setPositionTexture(t),this._forceEdgesMesh.material.set("positionTex",t)},startLayout:function(t,e,n,i){if(!i||null==i.from||i.from===this.uid){var r=this.viewGL,a=(n=this._api,this._forceLayoutInstance),o=this._model.getData(),s=this._model.getModel("forceAtlas2");if(a){if(this.groupGL.remove(this._edgesMesh),this.groupGL.add(this._forceEdgesMesh),this._forceLayoutInstance){this._updateForceNodesGeometry(t.getData()),this._pointsBuilder.hideLabels();var l=this,u=this._layoutId=E++,c=s.getShallow("maxSteps"),h=s.getShallow("steps"),d=0,f=Math.max(2*h,20),g=function(e){if(e===l._layoutId)return a.isFinished(c)?(n.dispatchAction({type:"graphGLStopLayout",from:l.uid}),void n.dispatchAction({type:"graphGLFinishLayout",points:o.getLayout("points"),from:l.uid})):void a.update(r.layer.renderer,h,(function(){l._updatePositionTexture(),(d+=h)>=f&&(l._syncNodePosition(t),d=0),n.getZr().refresh(),p()((function(){g(e)}))}))};p()((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(r.layer.renderer),l._forceLayoutInstanceToDispose=null),g(u)})),this._layouting=!0}}else console.error("None layout don't have startLayout action")}},stopLayout:function(t,e,n,i){i&&null!=i.from&&i.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(i&&i.beforeLayout||(this._syncNodePosition(t),this._updateAfterLayout(t,e,n)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(t){var e=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);t.getData().setLayout("points",e),t.setNodePosition(e)},_updateAfterLayout:function(t,e,n){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(t,e,n),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(t,e,n,i){var r=this._model.getData();this._downplayAll();var a=i.dataIndex,o=r.graph,s=[],l=o.getNodeByIndex(a);s.push(l),l.edges.forEach((function(t){t.dataIndex<0||(t.node1!==l&&s.push(t.node1),t.node2!==l&&s.push(t.node2))}),this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach((function(t){this._pointsBuilder.highlight(r,t.dataIndex)}),this),this._pointsBuilder.updateLabels(s.map((function(t){return t.dataIndex})));var u=[];l.edges.forEach((function(t){t.dataIndex>=0&&(this._highlightEdge(t.dataIndex),u.push(t))}),this),this._focusNodes=s,this._focusEdges=u},unfocusNodeAdjacency:function(t,e,n,i){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(t){var e=this._model.getEdgeData().getItemModel(t),n=s.a.parseColor(e.get("emphasis.lineStyle.color")||e.get("lineStyle.color")),i=c.a.firstNotNull(e.get("emphasis.lineStyle.opacity"),e.get("lineStyle.opacity"),1);n[3]*=i,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],n)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach((function(t){this._pointsBuilder.downplay(this._model.getData(),t.dataIndex)}),this),this._focusEdges&&this._focusEdges.forEach((function(t){this._downplayEdge(t.dataIndex)}),this)},_downplayEdge:function(t){var e=this._getColor(t,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)},_setEdgeFade:(_=[],function(t,e){this._getColor(t,_),_[3]*=e,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],_)}),_getColor:function(t,e){for(var n=0;n<4;n++)e[n]=this._originalEdgeColors[4*t+n];return e},_fadeOutEdgesAll:function(t){this._model.getData().graph.eachEdge((function(e){this._setEdgeFade(e.dataIndex,t)}),this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(t,e){this.viewGL.setViewport(0,0,e.getWidth(),e.getHeight(),e.getDevicePixelRatio());for(var n=this.viewGL.camera,i=t.getData().getLayout("points"),r=b.create(1/0,1/0),a=b.create(-1/0,-1/0),o=[],s=0;s<i.length;)o[0]=i[s++],o[1]=i[s++],b.min(r,r,o),b.max(a,a,o);var l=(a[1]+r[1])/2,u=(a[0]+r[0])/2;if(!(u>n.left&&u<n.right&&l<n.bottom&&l>n.top)){var c=Math.max(a[0]-r[0],10),h=c/e.getWidth()*e.getHeight();c*=1.4,h*=1.4,r[0]-=.2*c,n.left=r[0],n.top=l-h/2,n.bottom=l+h/2,n.right=c+r[0],n.near=0,n.far=100}},dispose:function(){var t=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(t),this.groupGL.removeAll(),this._layoutId=-1},remove:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(14),s=n(10),l=n(248);a.a.Shader.import(l.a);var u={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function c(t){var e={type:a.a.Texture.FLOAT,minFilter:a.a.Texture.NEAREST,magFilter:a.a.Texture.NEAREST};this._positionSourceTex=new a.a.Texture2D(e),this._positionSourceTex.flipY=!1,this._positionTex=new a.a.Texture2D(e),this._positionPrevTex=new a.a.Texture2D(e),this._forceTex=new a.a.Texture2D(e),this._forcePrevTex=new a.a.Texture2D(e),this._weightedSumTex=new a.a.Texture2D(e),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new a.a.Texture2D(e),this._globalSpeedPrevTex=new a.a.Texture2D(e),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new o.a({fragment:a.a.Shader.source("clay.compositor.output")});var n=function(t){t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE)};this._edgeForceMesh=new a.a.Mesh({geometry:new a.a.Geometry({attributes:{node1:new a.a.Geometry.Attribute("node1","float",2),node2:new a.a.Geometry.Attribute("node2","float",2),weight:new a.a.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new a.a.Material({transparent:!0,shader:a.a.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:n,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._weightedSumMesh=new a.a.Mesh({geometry:new a.a.Geometry({attributes:{node:new a.a.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new a.a.Material({transparent:!0,shader:a.a.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:n,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._framebuffer=new s.a({depthBuffer:!1}),this._dummyCamera=new a.a.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}c.prototype.updateOption=function(t){for(var e in u)this[e]=u[e];var n=this._nodes.length;if(this.jitterTolerence=n>5e4?10:n>5e3?1:.1,this.scaling=n>100?2:10,t)for(var e in u)null!=t[e]&&(this[e]=t[e]);if(this.repulsionByDegree)for(var i=this._positionSourceTex.pixels,r=0;r<this._nodes.length;r++)i[4*r+2]=(this._nodes[r].degree||0)+1},c.prototype._updateGravityCenter=function(t){var e=this._nodes,n=this._edges;if(this.gravityCenter)this._gravityCenter=this.gravityCenter;else{for(var i=[1/0,1/0],r=[-1/0,-1/0],a=0;a<e.length;a++)i[0]=Math.min(e[a].x,i[0]),i[1]=Math.min(e[a].y,i[1]),r[0]=Math.max(e[a].x,r[0]),r[1]=Math.max(e[a].y,r[1]);this._gravityCenter=[.5*(i[0]+r[0]),.5*(i[1]+r[1])]}for(a=0;a<n.length;a++){var o=n[a].node1,s=n[a].node2;e[o].degree=(e[o].degree||0)+1,e[s].degree=(e[s].degree||0)+1}},c.prototype.initData=function(t,e){this._nodes=t,this._edges=e,this._updateGravityCenter();var n=Math.ceil(Math.sqrt(t.length)),i=n,r=new Float32Array(n*i*4);this._resize(n,i);for(var a=0,o=0;o<t.length;o++){var s=t[o];r[a++]=s.x||0,r[a++]=s.y||0,r[a++]=s.mass||1,r[a++]=s.size||1}this._positionSourceTex.pixels=r;var l=this._edgeForceMesh.geometry,u=e.length;l.attributes.node1.init(2*u),l.attributes.node2.init(2*u),l.attributes.weight.init(2*u);var c=[];for(o=0;o<e.length;o++){var h=l.attributes,d=e[o].weight;null==d&&(d=1),h.node1.set(o,this.getNodeUV(e[o].node1,c)),h.node2.set(o,this.getNodeUV(e[o].node2,c)),h.weight.set(o,d),h.node1.set(o+u,this.getNodeUV(e[o].node2,c)),h.node2.set(o+u,this.getNodeUV(e[o].node1,c)),h.weight.set(o+u,d)}var f=this._weightedSumMesh.geometry;for(f.attributes.node.init(t.length),o=0;o<t.length;o++)f.attributes.node.set(o,this.getNodeUV(o,c));l.dirty(),f.dirty(),this._nodeRepulsionPass.material.define("fragment","NODE_COUNT",t.length),this._nodeRepulsionPass.material.setUniform("textureSize",[n,i]),this._inited=!1,this._frame=0},c.prototype.getNodes=function(){return this._nodes},c.prototype.getEdges=function(){return this._edges},c.prototype.step=function(t){this._inited||(this._initFromSource(t),this._inited=!0),this._frame++,this._framebuffer.attach(this._forceTex),this._framebuffer.bind(t);var e=this._nodeRepulsionPass;e.setUniform("strongGravityMode",this.strongGravityMode),e.setUniform("gravity",this.gravity),e.setUniform("gravityCenter",this._gravityCenter),e.setUniform("scaling",this.scaling),e.setUniform("preventOverlap",this.preventOverlap),e.setUniform("positionTex",this._positionPrevTex),e.render(t);var n=this._edgeForceMesh;n.material.set("linLogMode",this.linLogMode),n.material.set("edgeWeightInfluence",this.edgeWeightInfluence),n.material.set("preventOverlap",this.preventOverlap),n.material.set("positionTex",this._positionPrevTex),t.gl.enable(t.gl.BLEND),t.renderPass([n],this._dummyCamera),this._framebuffer.attach(this._weightedSumTex),t.gl.clearColor(0,0,0,0),t.gl.clear(t.gl.COLOR_BUFFER_BIT),t.gl.enable(t.gl.BLEND);var i=this._weightedSumMesh;i.material.set("positionTex",this._positionPrevTex),i.material.set("forceTex",this._forceTex),i.material.set("forcePrevTex",this._forcePrevTex),t.renderPass([i],this._dummyCamera),this._framebuffer.attach(this._globalSpeedTex);var r=this._globalSpeedPass;r.setUniform("globalSpeedPrevTex",this._globalSpeedPrevTex),r.setUniform("weightedSumTex",this._weightedSumTex),r.setUniform("jitterTolerence",this.jitterTolerence),t.gl.disable(t.gl.BLEND),r.render(t);var a=this._positionPass;this._framebuffer.attach(this._positionTex),a.setUniform("globalSpeedTex",this._globalSpeedTex),a.setUniform("positionTex",this._positionPrevTex),a.setUniform("forceTex",this._forceTex),a.setUniform("forcePrevTex",this._forcePrevTex),a.render(t),this._framebuffer.unbind(t),this._swapTexture()},c.prototype.update=function(t,e,n){null==e&&(e=1),e=Math.max(e,1);for(var i=0;i<e;i++)this.step(t);n&&n()},c.prototype.getNodePositionTexture=function(){return this._inited?this._positionPrevTex:this._positionSourceTex},c.prototype.getNodeUV=function(t,e){e=e||[];var n=this._positionTex.width,i=this._positionTex.height;return e[0]=t%n/(n-1),e[1]=Math.floor(t/n)/(i-1)||0,e},c.prototype.getNodePosition=function(t,e){var n=this._positionArr,i=this._positionTex.width,r=this._positionTex.height,a=i*r;n&&n.length===4*a||(n=this._positionArr=new Float32Array(4*a)),this._framebuffer.bind(t),this._framebuffer.attach(this._positionPrevTex),t.gl.readPixels(0,0,i,r,t.gl.RGBA,t.gl.FLOAT,n),this._framebuffer.unbind(t),e||(e=new Float32Array(2*this._nodes.length));for(var o=0;o<this._nodes.length;o++)e[2*o]=n[4*o],e[2*o+1]=n[4*o+1];return e},c.prototype.getTextureData=function(t,e){var n=this["_"+e+"Tex"],i=n.width,r=n.height;this._framebuffer.bind(t),this._framebuffer.attach(n);var a=new Float32Array(i*r*4);return t.gl.readPixels(0,0,i,r,t.gl.RGBA,t.gl.FLOAT,a),this._framebuffer.unbind(t),a},c.prototype.getTextureSize=function(){return{width:this._positionTex.width,height:this._positionTex.height}},c.prototype.isFinished=function(t){return this._frame>t},c.prototype._swapTexture=function(){var t=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=t,t=this._forcePrevTex,this._forcePrevTex=this._forceTex,this._forceTex=t,t=this._globalSpeedPrevTex,this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=t},c.prototype._initFromSource=function(t){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(t),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(t),t.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),t.gl.clear(t.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),t.gl.clear(t.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(t)},c.prototype._resize=function(t,e){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(n){this[n].width=t,this[n].height=e,this[n].dirty()}),this)},c.prototype.dispose=function(t){this._framebuffer.dispose(t),this._copyPass.dispose(t),this._nodeRepulsionPass.dispose(t),this._positionPass.dispose(t),this._globalSpeedPass.dispose(t),this._edgeForceMesh.geometry.dispose(t),this._weightedSumMesh.geometry.dispose(t),this._positionSourceTex.dispose(t),this._positionTex.dispose(t),this._positionPrevTex.dispose(t),this._forceTex.dispose(t),this._forcePrevTex.dispose(t),this._weightedSumTex.dispose(t),this._globalSpeedTex.dispose(t),this._globalSpeedPrevTex.dispose(t)},r.a.ForceAtlas2GPU=c,e.a=c},function(t,e,n){"use strict";e.a="@export ecgl.forceAtlas2.updateNodeRepulsion\n\n#define NODE_COUNT 0\n\nuniform sampler2D positionTex;\n\nuniform vec2 textureSize;\nuniform float gravity;\nuniform float scaling;\nuniform vec2 gravityCenter;\n\nuniform bool strongGravityMode;\nuniform bool preventOverlap;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, v_Texcoord);\n\n vec2 force = vec2(0.0);\n for (int i = 0; i < NODE_COUNT; i++) {\n vec2 uv = vec2(\n mod(float(i), textureSize.x) / (textureSize.x - 1.0),\n floor(float(i) / textureSize.x) / (textureSize.y - 1.0)\n );\n vec4 n1 = texture2D(positionTex, uv);\n\n vec2 dir = n0.xy - n1.xy;\n float d2 = dot(dir, dir);\n\n if (d2 > 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end"},function(t,e,n){"use strict";var i=n(5),r=n(6),a=n(250).a.toString();a=a.slice(a.indexOf("{")+1,a.lastIndexOf("}"));var o={barnesHutOptimize:!0,barnesHutTheta:1.5,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null},s=function(t){for(var e in o)this[e]=o[e];if(t)for(var e in t)this[e]=t[e];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new i.a({type:r.a.FLOAT,flipY:!1,minFilter:r.a.NEAREST,magFilter:r.a.NEAREST})};s.prototype.initData=function(t,e){var n=new Blob([a]),i=window.URL.createObjectURL(n);this._worker=new Worker(i),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=t,this._edges=e,this._frame=0;for(var r=t.length,o=e.length,s=new Float32Array(2*r),l=new Float32Array(r),u=new Float32Array(r),c=new Float32Array(2*o),h=new Float32Array(o),d=0;d<t.length;d++){var f=t[d];s[2*d]=f.x,s[2*d+1]=f.y,l[d]=null==f.mass?1:f.mass,u[d]=null==f.size?1:f.size}for(d=0;d<e.length;d++){var p=e[d],g=p.node1,m=p.node2;c[2*d]=g,c[2*d+1]=m,h[d]=null==p.weight?1:p.weight}var v=Math.ceil(Math.sqrt(t.length)),y=v,x=new Float32Array(v*y*4),b=this._positionTex;b.width=v,b.height=y,b.pixels=x,this._worker.postMessage({cmd:"init",nodesPosition:s,nodesMass:l,nodesSize:u,edges:c,edgesWeight:h}),this._globalSpeed=1/0},s.prototype.updateOption=function(t){var e={};for(var n in o)e[n]=o[n];var i=this._nodes,r=this._edges,a=i.length;if(e.jitterTolerence=a>5e4?10:a>5e3?1:.1,e.scaling=a>100?2:10,e.barnesHutOptimize=a>1e3,t)for(var n in o)null!=t[n]&&(e[n]=t[n]);if(!e.gravityCenter){for(var s=[1/0,1/0],l=[-1/0,-1/0],u=0;u<i.length;u++)s[0]=Math.min(i[u].x,s[0]),s[1]=Math.min(i[u].y,s[1]),l[0]=Math.max(i[u].x,l[0]),l[1]=Math.max(i[u].y,l[1]);e.gravityCenter=[.5*(s[0]+l[0]),.5*(s[1]+l[1])]}for(u=0;u<r.length;u++){var c=r[u].node1,h=r[u].node2;i[c].degree=(i[c].degree||0)+1,i[h].degree=(i[h].degree||0)+1}this._worker&&this._worker.postMessage({cmd:"updateConfig",config:e})},s.prototype.update=function(t,e,n){null==e&&(e=1),e=Math.max(e,1),this._frame+=e,this._onupdate=n,this._worker&&this._worker.postMessage({cmd:"update",steps:Math.round(e)})},s.prototype._$onupdate=function(t){if(!this._disposed){var e=new Float32Array(t.data.buffer);this._globalSpeed=t.data.globalSpeed,this._positionArr=e,this._updateTexture(e),this._onupdate&&this._onupdate()}},s.prototype.getNodePositionTexture=function(){return this._positionTex},s.prototype.getNodeUV=function(t,e){e=e||[];var n=this._positionTex.width,i=this._positionTex.height;return e[0]=t%n/(n-1),e[1]=Math.floor(t/n)/(i-1),e},s.prototype.getNodes=function(){return this._nodes},s.prototype.getEdges=function(){return this._edges},s.prototype.isFinished=function(t){return this._frame>t},s.prototype.getNodePosition=function(t,e){if(e||(e=new Float32Array(2*this._nodes.length)),this._positionArr)for(var n=0;n<this._positionArr.length;n++)e[n]=this._positionArr[n];return e},s.prototype._updateTexture=function(t){for(var e=this._positionTex.pixels,n=0,i=0;i<t.length;)e[n++]=t[i++],e[n++]=t[i++],e[n++]=1,e[n++]=1;this._positionTex.dirty()},s.prototype.dispose=function(t){this._disposed=!0,this._worker=null},e.a=s},function(t,e,n){"use strict";e.a=function(){var t=function(){return new Float32Array(2)},e=function(t,e){var n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)},n=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},i=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},r=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},a=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},o=function(t,e){return t[0]=e[0],t[1]=e[1],t},s=function(t,e,n){return t[0]=e,t[1]=n,t};function l(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}var u=l.prototype;function c(){this.position=new Float32Array(2),this.force=t(),this.forcePrev=t(),this.mass=1,this.inDegree=0,this.outDegree=0}function h(t,e){this.source=t,this.target=e,this.weight=1}function d(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new l,this.rootRegion.centerOfMass=t(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}u.beforeUpdate=function(){for(var t=0;t<this.nSubRegions;t++)this.subRegions[t].beforeUpdate();this.mass=0,this.centerOfMass&&(this.centerOfMass[0]=0,this.centerOfMass[1]=0),this.nSubRegions=0,this.node=null},u.afterUpdate=function(){this.subRegions.length=this.nSubRegions;for(var t=0;t<this.nSubRegions;t++)this.subRegions[t].afterUpdate()},u.addNode=function(t){if(0===this.nSubRegions){if(null==this.node)return void(this.node=t);this._addNodeToSubRegion(this.node),this.node=null}this._addNodeToSubRegion(t),this._updateCenterOfMass(t)},u.findSubRegion=function(t,e){for(var n=0;n<this.nSubRegions;n++){var i=this.subRegions[n];if(i.contain(t,e))return i}},u.contain=function(t,e){return this.bbox[0]<=t&&this.bbox[2]>=t&&this.bbox[1]<=e&&this.bbox[3]>=e},u.setBBox=function(t,e,n,i){this.bbox[0]=t,this.bbox[1]=e,this.bbox[2]=n,this.bbox[3]=i,this.size=(n-t+i-e)/2},u._newSubRegion=function(){var t=this.subRegions[this.nSubRegions];return t||(t=new l,this.subRegions[this.nSubRegions]=t),this.nSubRegions++,t},u._addNodeToSubRegion=function(t){var e=this.findSubRegion(t.position[0],t.position[1]),n=this.bbox;if(!e){var i=(n[0]+n[2])/2,r=(n[1]+n[3])/2,a=(n[2]-n[0])/2,o=(n[3]-n[1])/2,s=t.position[0]>=i?1:0,l=t.position[1]>=r?1:0;(e=this._newSubRegion()).setBBox(s*a+n[0],l*o+n[1],(s+1)*a+n[0],(l+1)*o+n[1])}e.addNode(t)},u._updateCenterOfMass=function(t){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var e=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;e+=t.position[0]*t.mass,n+=t.position[1]*t.mass,this.mass+=t.mass,this.centerOfMass[0]=e/this.mass,this.centerOfMass[1]=n/this.mass};var f,p=d.prototype;p.initNodes=function(t,e,n){var i=e.length;this.nodes.length=0;for(var r=void 0!==n,a=0;a<i;a++){var o=new c;o.position[0]=t[2*a],o.position[1]=t[2*a+1],o.mass=e[a],r&&(o.size=n[a]),this.nodes.push(o)}this._massArr=e,this._swingingArr=new Float32Array(i),r&&(this._sizeArr=n)},p.initEdges=function(t,e){var n=t.length/2;this.edges.length=0;for(var i=0;i<n;i++){var r=t[2*i],a=t[2*i+1],o=this.nodes[r],s=this.nodes[a];if(!o||!s)return void console.error("Node not exists, try initNodes before initEdges");o.outDegree++,s.inDegree++;var l=new h(o,s);e&&(l.weight=e[i]),this.edges.push(l)}},p.updateSettings=function(){if(this.repulsionByDegree)for(var t=0;t<this.nodes.length;t++)(e=this.nodes[t]).mass=e.inDegree+e.outDegree+1;else for(t=0;t<this.nodes.length;t++){var e;(e=this.nodes[t]).mass=this._massArr[t]}},p.update=function(){var a=this.nodes.length;if(this.updateSettings(),this.updateBBox(),this.barnesHutOptimize){this.rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this.rootRegion.beforeUpdate();for(var l=0;l<a;l++)this.rootRegion.addNode(this.nodes[l]);this.rootRegion.afterUpdate()}for(l=0;l<a;l++){var u=this.nodes[l];o(u.forcePrev,u.force),s(u.force,0,0)}for(l=0;l<a;l++){var c=this.nodes[l];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this.rootRegion,c);else for(var h=l+1;h<a;h++){var d=this.nodes[h];this.applyNodeToNodeRepulsion(c,d,!1)}this.gravity>0&&(this.strongGravityMode?this.applyNodeStrongGravity(c):this.applyNodeGravity(c))}for(l=0;l<this.edges.length;l++)this.applyEdgeAttraction(this.edges[l]);var f=0,p=0,g=t();for(l=0;l<a;l++)u=this.nodes[l],f+=(v=e(u.force,u.forcePrev))*u.mass,r(g,u.force,u.forcePrev),p+=.5*n(g)*u.mass,this._swingingArr[l]=v;var m=this.jitterTolerence*this.jitterTolerence*p/f;for(this._globalSpeed>0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m,l=0;l<a;l++){u=this.nodes[l];var v=this._swingingArr[l],y=.1*m/(1+m*Math.sqrt(v)),x=n(u.force);x>0&&(y=Math.min(x*y,10)/x,i(u.position,u.position,u.force,y))}},p.applyRegionToNodeRepulsion=(f=t(),function(t,e){if(t.node)this.applyNodeToNodeRepulsion(t.node,e,!0);else{a(f,e.position,t.centerOfMass);var n=f[0]*f[0]+f[1]*f[1];if(n>this.barnesHutTheta*t.size*t.size){var r=this.scaling*e.mass*t.mass/n;i(e.force,e.force,f,r)}else for(var o=0;o<t.nSubRegions;o++)this.applyRegionToNodeRepulsion(t.subRegions[o],e)}}),p.applyNodeToNodeRepulsion=function(){var e=t();return function(t,n,r){if(t!=n){a(e,t.position,n.position);var o=e[0]*e[0]+e[1]*e[1];if(0!==o){var s;if(this.preventOverlap){var l=Math.sqrt(o);if((l=l-t.size-n.size)>0)s=this.scaling*t.mass*n.mass/(l*l);else{if(!(l<0))return;s=100*this.scaling*t.mass*n.mass}}else s=this.scaling*t.mass*n.mass/o;i(t.force,t.force,e,s),i(n.force,n.force,e,-s)}}}}(),p.applyEdgeAttraction=function(){var e=t();return function(t){var r=t.source,o=t.target;a(e,r.position,o.position);var s,l,u=n(e);s=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?t.weight:Math.pow(t.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-r.size-o.size)<=0||(l=this.linLogMode?-s*Math.log(u+1)/(u+1):-s,i(r.force,r.force,e,l),i(o.force,o.force,e,-l))}}(),p.applyNodeGravity=function(){var e=t();return function(t){a(e,this.gravityCenter,t.position);var r=n(e);i(t.force,t.force,e,this.gravity*t.mass/(r+1))}}(),p.applyNodeStrongGravity=function(){var e=t();return function(t){a(e,this.gravityCenter,t.position),i(t.force,t.force,e,this.gravity*t.mass)}}(),p.updateBBox=function(){for(var t=1/0,e=1/0,n=-1/0,i=-1/0,r=0;r<this.nodes.length;r++){var a=this.nodes[r].position;t=Math.min(t,a[0]),e=Math.min(e,a[1]),n=Math.max(n,a[0]),i=Math.max(i,a[1])}this.bbox[0]=t,this.bbox[1]=e,this.bbox[2]=n,this.bbox[3]=i},p.getGlobalSpeed=function(){return this._globalSpeed};var g=null;self.onmessage=function(t){switch(t.data.cmd){case"init":(g=new d).initNodes(t.data.nodesPosition,t.data.nodesMass,t.data.nodesSize),g.initEdges(t.data.edges,t.data.edgesWeight);break;case"updateConfig":if(g)for(var e in t.data.config)g[e]=t.data.config[e];break;case"update":var n=t.data.steps;if(g){for(var i=0;i<n;i++)g.update();var r=g.nodes.length,a=new Float32Array(2*r);for(i=0;i<r;i++){var o=g.nodes[i];a[2*i]=o.position[0],a[2*i+1]=o.position[1]}self.postMessage({buffer:a.buffer,globalSpeed:g.getGlobalSpeed()},[a.buffer])}else{var s=new Float32Array;self.postMessage({buffer:s.buffer,globalSpeed:g.getGlobalSpeed()},[s.buffer])}}}}},function(t,e,n){"use strict";var i=n(8),r=(n(3),i.a.extend((function(){return{zr:null,viewGL:null,minZoom:.2,maxZoom:5,_needsUpdate:!1,_dx:0,_dy:0,_zoom:1}}),(function(){this._mouseDownHandler=this._mouseDownHandler.bind(this),this._mouseWheelHandler=this._mouseWheelHandler.bind(this),this._mouseMoveHandler=this._mouseMoveHandler.bind(this),this._mouseUpHandler=this._mouseUpHandler.bind(this),this._update=this._update.bind(this)}),{init:function(){var t=this.zr;t.on("mousedown",this._mouseDownHandler),t.on("mousewheel",this._mouseWheelHandler),t.on("globalout",this._mouseUpHandler),t.animation.on("frame",this._update)},setTarget:function(t){this._target=t},setZoom:function(t){this._zoom=Math.max(Math.min(t,this.maxZoom),this.minZoom),this._needsUpdate=!0},setOffset:function(t){this._dx=t[0],this._dy=t[1],this._needsUpdate=!0},getZoom:function(){return this._zoom},getOffset:function(){return[this._dx,this._dy]},_update:function(){if(this._target&&this._needsUpdate){var t=this._target,e=this._zoom;t.position.x=this._dx,t.position.y=this._dy,t.scale.set(e,e,e),this.zr.refresh(),this._needsUpdate=!1,this.trigger("update")}},_mouseDownHandler:function(t){if(!t.target){var e=t.offsetX,n=t.offsetY;if(!this.viewGL||this.viewGL.containPoint(e,n)){this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler);var i=this._convertPos(e,n);this._x=i.x,this._y=i.y}}},_convertPos:function(t,e){var n=this.viewGL.camera,i=this.viewGL.viewport;return{x:(t-i.x)/i.width*(n.right-n.left)+n.left,y:(e-i.y)/i.height*(n.bottom-n.top)+n.top}},_mouseMoveHandler:function(t){var e=this._convertPos(t.offsetX,t.offsetY);this._dx+=e.x-this._x,this._dy+=e.y-this._y,this._x=e.x,this._y=e.y,this._needsUpdate=!0},_mouseUpHandler:function(t){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_mouseWheelHandler:function(t){var e=(t=t.event).wheelDelta||-t.detail;if(0!==e){var n=t.offsetX,i=t.offsetY;if(!this.viewGL||this.viewGL.containPoint(n,i)){var r=e>0?1.1:.9,a=Math.max(Math.min(this._zoom*r,this.maxZoom),this.minZoom);r=a/this._zoom;var o=this._convertPos(n,i),s=(o.x-this._dx)*(r-1),l=(o.y-this._dy)*(r-1);this._dx-=s,this._dy-=l,this._zoom=a,this._needsUpdate=!0}}},dispose:function(){var t=this.zr;t.off("mousedown",this._mouseDownHandler),t.off("mousemove",this._mouseMoveHandler),t.off("mouseup",this._mouseUpHandler),t.off("mousewheel",this._mouseWheelHandler),t.off("globalout",this._mouseUpHandler),t.animation.off("frame",this._update)}}));e.a=r},function(t,e,n){"use strict";e.a="@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end"},function(t,e,n){"use strict";var i=n(0);n.n(i),n(254),n(258)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(3),s=n(20),l=n(255);r.a.extendChartView({type:"flowGL",__ecgl__:!0,init:function(t,e){this.viewGL=new s.a("orthographic"),this.groupGL=new a.a.Node,this.viewGL.add(this.groupGL),this._particleSurface=new l.a;var n=new a.a.Mesh({geometry:new a.a.PlaneGeometry,material:new a.a.Material({shader:new a.a.Shader({vertex:a.a.Shader.source("ecgl.color.vertex"),fragment:a.a.Shader.source("ecgl.color.fragment")}),transparent:!0})});n.material.enableTexture("diffuseMap"),this.groupGL.add(n),this._planeMesh=n},render:function(t,e,n){var i=this._particleSurface;i.setParticleType(t.get("particleType")),i.setSupersampling(t.get("supersampling")),this._updateData(t,n),this._updateCamera(n.getWidth(),n.getHeight(),n.getDevicePixelRatio());var r=o.a.firstNotNull(t.get("particleDensity"),128);i.setParticleDensity(r,r);var s=this._planeMesh,l=+new Date,u=this,c=!0;s.__percent=0,s.stopAnimation(),s.animate("",{loop:!0}).when(1e5,{__percent:1}).during((function(){var t=+new Date,e=Math.min(t-l,20);l+=e,u._renderer&&(i.update(u._renderer,n,e/1e3,c),s.material.set("diffuseMap",i.getSurfaceTexture())),c=!1})).start();var h=t.getModel("itemStyle"),d=a.a.parseColor(h.get("color"));d[3]*=o.a.firstNotNull(h.get("opacity"),1),s.material.set("color",d),i.setColorTextureImage(t.get("colorTexture"),n),i.setParticleSize(t.get("particleSize")),i.particleSpeedScaling=t.get("particleSpeed"),i.motionBlurFactor=1-Math.pow(.1,t.get("particleTrail"))},updateTransform:function(t,e,n){this._updateData(t,n)},afterRender:function(t,e,n,i){var r=i.renderer;this._renderer=r},_updateData:function(t,e){var n=t.coordinateSystem,i=n.dimensions.map((function(e){return t.coordDimToDataDim(e)[0]})),r=t.getData(),a=r.getDataExtent(i[0]),o=r.getDataExtent(i[1]),s=t.get("gridWidth"),l=t.get("gridHeight");if(null==s||"auto"===s){var u=(a[1]-a[0])/(o[1]-o[0]);s=Math.round(Math.sqrt(u*r.count()))}null!=l&&"auto"!==l||(l=Math.ceil(r.count()/s));var c=this._particleSurface.vectorFieldTexture,h=c.pixels;if(h&&h.length===l*s*4)for(var d=0;d<h.length;d++)h[d]=0;else h=c.pixels=new Float32Array(s*l*4);var f=0,p=1/0,g=new Float32Array(2*r.count()),m=0,v=[[1/0,1/0],[-1/0,-1/0]];r.each([i[0],i[1],"vx","vy"],(function(t,e,i,r){var a=n.dataToPoint([t,e]);g[m++]=a[0],g[m++]=a[1],v[0][0]=Math.min(a[0],v[0][0]),v[0][1]=Math.min(a[1],v[0][1]),v[1][0]=Math.max(a[0],v[1][0]),v[1][1]=Math.max(a[1],v[1][1]);var o=Math.sqrt(i*i+r*r);f=Math.max(f,o),p=Math.min(p,o)})),r.each(["vx","vy"],(function(t,e,n){var i=Math.round((g[2*n]-v[0][0])/(v[1][0]-v[0][0])*(s-1)),r=4*((l-1-Math.round((g[2*n+1]-v[0][1])/(v[1][1]-v[0][1])*(l-1)))*s+i);h[r]=t/f*.5+.5,h[r+1]=e/f*.5+.5,h[r+3]=1})),c.width=s,c.height=l,"bmap"===t.get("coordinateSystem")&&this._fillEmptyPixels(c),c.dirty(),this._updatePlanePosition(v[0],v[1],t,e),this._updateGradientTexture(r.getVisual("visualMeta"),[p,f])},_fillEmptyPixels:function(t){var e=t.pixels,n=t.width,i=t.height;function r(t,r,a){t=Math.max(Math.min(t,n-1),0);var o=4*((r=Math.max(Math.min(r,i-1),0))*(n-1)+t);return 0!==e[o+3]&&(a[0]=e[o],a[1]=e[o+1],!0)}function a(t,e,n){n[0]=t[0]+e[0],n[1]=t[1]+e[1]}for(var o=[],s=[],l=[],u=[],c=[],h=0,d=0;d<i;d++)for(var f=0;f<n;f++){var p=4*(d*(n-1)+f);0===e[p+3]&&(h=o[0]=o[1]=0,r(f-1,d,s)&&(h++,a(s,o,o)),r(f+1,d,l)&&(h++,a(l,o,o)),r(f,d-1,u)&&(h++,a(u,o,o)),r(f,d+1,c)&&(h++,a(c,o,o)),o[0]/=h,o[1]/=h,e[p]=o[0],e[p+1]=o[1]),e[p+3]=1}},_updateGradientTexture:function(t,e){if(t&&t.length){this._gradientTexture=this._gradientTexture||new a.a.Texture2D({image:document.createElement("canvas")});var n=this._gradientTexture,i=n.image;i.width=200,i.height=1;var r=i.getContext("2d"),o=r.createLinearGradient(0,.5,i.width,.5);t[0].stops.forEach((function(t){var n;e[1]===e[0]?n=0:(n=t.value/e[1],n=Math.min(Math.max(n,0),1)),o.addColorStop(n,t.color)})),r.fillStyle=o,r.fillRect(0,0,i.width,i.height),n.dirty(),this._particleSurface.setGradientTexture(this._gradientTexture)}else this._particleSurface.setGradientTexture(null)},_updatePlanePosition:function(t,e,n,i){var r=this._limitInViewportAndFullFill(t,e,n,i);t=r.leftTop,e=r.rightBottom,this._particleSurface.setRegion(r.region),this._planeMesh.position.set((t[0]+e[0])/2,i.getHeight()-(t[1]+e[1])/2,0);var a=e[0]-t[0],o=e[1]-t[1];this._planeMesh.scale.set(a/2,o/2,1),this._particleSurface.resize(Math.max(Math.min(a,2048),1),Math.max(Math.min(o,2048),1)),this._renderer&&this._particleSurface.clearFrame(this._renderer)},_limitInViewportAndFullFill:function(t,e,n,i){var r=[Math.max(t[0],0),Math.max(t[1],0)],a=[Math.min(e[0],i.getWidth()),Math.min(e[1],i.getHeight())];if("bmap"===n.get("coordinateSystem")){var o=n.getData().getDataExtent(n.coordDimToDataDim("lng")[0]);Math.floor(o[1]-o[0])>=359&&(r[0]>0&&(r[0]=0),a[0]<i.getWidth()&&(a[0]=i.getWidth()))}var s=e[0]-t[0],l=e[1]-t[1],u=a[0]-r[0],c=a[1]-r[1];return{leftTop:r,rightBottom:a,region:[(r[0]-t[0])/s,1-c/l-(r[1]-t[1])/l,u/s,c/l]}},_updateCamera:function(t,e,n){this.viewGL.setViewport(0,0,t,e,n);var i=this.viewGL.camera;i.left=i.bottom=0,i.top=e,i.right=t,i.near=0,i.far=100,i.position.z=10},remove:function(){this._planeMesh.stopAnimation(),this.groupGL.removeAll()},dispose:function(){this._renderer&&this._particleSurface.dispose(this._renderer),this.groupGL.removeAll()}})},function(t,e,n){"use strict";var i=n(14),r=n(13),a=n(24),o=n(17),s=n(7),l=n(5),u=n(6),c=n(30),h=n(37),d=n(10),f=n(256),p=n(257);s.a.import(p.a);var g=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new l.a({type:u.a.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()};g.prototype={constructor:g,init:function(){var t={type:u.a.FLOAT,minFilter:u.a.NEAREST,magFilter:u.a.NEAREST,useMipmap:!1};this._spawnTexture=new l.a(t),this._particleTexture0=new l.a(t),this._particleTexture1=new l.a(t),this._frameBuffer=new d.a({depthBuffer:!1}),this._particlePass=new i.a({fragment:s.a.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new i.a({fragment:s.a.source("clay.compositor.downsample")});var e=new a.a({renderOrder:10,material:new o.a({shader:new s.a(s.a.source("ecgl.vfParticle.renderPoints.vertex"),s.a.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:a.a.POINTS,geometry:new r.a({dynamic:!0,mainAttribute:"texcoord0"})}),n=new a.a({renderOrder:10,material:new o.a({shader:new s.a(s.a.source("ecgl.vfParticle.renderLines.vertex"),s.a.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new f.a,culling:!1}),p=new a.a({material:new o.a({shader:new s.a(s.a.source("ecgl.color.vertex"),s.a.source("ecgl.color.fragment"))}),geometry:new h.a});p.material.enableTexture("diffuseMap"),this._particlePointsMesh=e,this._particleLinesMesh=n,this._lastFrameFullQuadMesh=p,this._camera=new c.a,this._thisFrameTexture=new l.a,this._lastFrameTexture=new l.a},setParticleDensity:function(t,e){for(var n=new Float32Array(t*e*4),i=0,r=this.particleLife,a=0;a<t;a++)for(var o=0;o<e;o++,i++){n[4*i]=Math.random(),n[4*i+1]=Math.random(),n[4*i+2]=Math.random();var s=(r[1]-r[0])*Math.random()+r[0];n[4*i+3]=s}"line"===this._particleType?this._setLineGeometry(t,e):this._setPointsGeometry(t,e),this._spawnTexture.width=t,this._spawnTexture.height=e,this._spawnTexture.pixels=n,this._particleTexture0.width=this._particleTexture1.width=t,this._particleTexture0.height=this._particleTexture1.height=e,this._particlePass.setUniform("textureSize",[t,e])},_setPointsGeometry:function(t,e){var n=t*e,i=this._particlePointsMesh.geometry,r=i.attributes;r.texcoord0.init(n);for(var a=0,o=0;o<t;o++)for(var s=0;s<e;s++,a++)r.texcoord0.value[2*a]=o/t,r.texcoord0.value[2*a+1]=s/e;i.dirty()},_setLineGeometry:function(t,e){var n=t*e,i=this._getParticleMesh().geometry;i.setLineCount(n),i.resetOffset();for(var r=0;r<t;r++)for(var a=0;a<e;a++)i.addLine([r/t,a/e]);i.dirty()},_getParticleMesh:function(){return"line"===this._particleType?this._particleLinesMesh:this._particlePointsMesh},update:function(t,e,n,i){var r=this._getParticleMesh(),a=this._frameBuffer,o=this._particlePass;i&&this._updateDownsampleTextures(t,e),r.material.set("size",this._particleSize*this._supersampling),r.material.set("color",this.particleColor),o.setUniform("speedScaling",this.particleSpeedScaling),a.attach(this._particleTexture1),o.setUniform("firstFrameTime",i?(this.particleLife[1]+this.particleLife[0])/2:0),o.setUniform("particleTexture",this._particleTexture0),o.setUniform("deltaTime",n),o.setUniform("elapsedTime",this._elapsedTime),o.render(t,a),r.material.set("particleTexture",this._particleTexture1),r.material.set("prevParticleTexture",this._particleTexture0),a.attach(this._thisFrameTexture),a.bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT);var s=this._lastFrameFullQuadMesh;s.material.set("diffuseMap",this._lastFrameTexture),s.material.set("color",[1,1,1,this.motionBlurFactor]),this._camera.update(!0),t.renderPass([s,r],this._camera),a.unbind(t),this._downsample(t),this._swapTexture(),this._elapsedTime+=n},_downsample:function(t){var e=this._downsampleTextures;if(0!==e.length)for(var n=0,i=this._thisFrameTexture,r=e[n];r;)this._frameBuffer.attach(r),this._downsamplePass.setUniform("texture",i),this._downsamplePass.setUniform("textureSize",[i.width,i.height]),this._downsamplePass.render(t,this._frameBuffer),i=r,r=e[++n]},getSurfaceTexture:function(){var t=this._downsampleTextures;return t.length>0?t[t.length-1]:this._lastFrameTexture},setRegion:function(t){this._particlePass.setUniform("region",t)},resize:function(t,e){this._lastFrameTexture.width=t*this._supersampling,this._lastFrameTexture.height=e*this._supersampling,this._thisFrameTexture.width=t*this._supersampling,this._thisFrameTexture.height=e*this._supersampling,this._width=t,this._height=e},setParticleSize:function(t){var e=this._getParticleMesh();if(t<=2)return e.material.disableTexture("spriteTexture"),void(e.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new l.a),this._spriteTexture.image&&this._spriteTexture.image.width===t||(this._spriteTexture.image=function(t){var e=document.createElement("canvas");e.width=e.height=t;var n=e.getContext("2d");return n.fillStyle="#fff",n.arc(t/2,t/2,t/2,0,2*Math.PI),n.fill(),e}(t),this._spriteTexture.dirty()),e.material.transparent=!0,e.material.enableTexture("spriteTexture"),e.material.set("spriteTexture",this._spriteTexture),this._particleSize=t},setGradientTexture:function(t){var e=this._getParticleMesh().material;e[t?"enableTexture":"disableTexture"]("gradientTexture"),e.setUniform("gradientTexture",t)},setColorTextureImage:function(t,e){this._getParticleMesh().material.setTextureImage("colorTexture",t,e,{flipY:!0})},setParticleType:function(t){this._particleType=t},clearFrame:function(t){var e=this._frameBuffer;e.attach(this._lastFrameTexture),e.bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT),e.unbind(t)},setSupersampling:function(t){this._supersampling=t,this.resize(this._width,this._height)},_updateDownsampleTextures:function(t,e){for(var n=this._downsampleTextures,i=Math.max(Math.floor(Math.log(this._supersampling/e.getDevicePixelRatio())/Math.log(2)),0),r=2,a=this._width*this._supersampling,o=this._height*this._supersampling,s=0;s<i;s++)n[s]=n[s]||new l.a,n[s].width=a/r,n[s].height=o/r,r*=2;for(;s<n.length;s++)n[s].dispose(t);n.length=i},_swapTexture:function(){var t=this._particleTexture0;this._particleTexture0=this._particleTexture1,this._particleTexture1=t,t=this._thisFrameTexture,this._thisFrameTexture=this._lastFrameTexture,this._lastFrameTexture=t},dispose:function(t){t.disposeFrameBuffer(this._frameBuffer),t.disposeTexture(this.vectorFieldTexture),t.disposeTexture(this._spawnTexture),t.disposeTexture(this._particleTexture0),t.disposeTexture(this._particleTexture1),t.disposeTexture(this._thisFrameTexture),t.disposeTexture(this._lastFrameTexture),t.disposeGeometry(this._particleLinesMesh.geometry),t.disposeGeometry(this._particlePointsMesh.geometry),t.disposeGeometry(this._lastFrameFullQuadMesh.geometry),this._spriteTexture&&t.disposeTexture(this._spriteTexture),this._particlePass.dispose(t),this._downsamplePass.dispose(t),this._downsampleTextures.forEach((function(e){e.dispose(t)}))}},e.a=g},function(t,e,n){"use strict";var i=n(13),r=n(0),a=(n.n(r),i.a.extend((function(){return{dynamic:!0,attributes:{position:new i.a.Attribute("position","float",3,"POSITION")}}}),{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setLineCount:function(t){var e=this.attributes,n=4*t,i=2*t;this.vertexCount!==n&&e.position.init(n),this.triangleCount!==i&&(this.indices=0===i?null:this.vertexCount>65535?new Uint32Array(3*i):new Uint16Array(3*i))},addLine:function(t){var e=this._vertexOffset;this.attributes.position.set(e,[t[0],t[1],1]),this.attributes.position.set(e+1,[t[0],t[1],-1]),this.attributes.position.set(e+2,[t[0],t[1],2]),this.attributes.position.set(e+3,[t[0],t[1],-2]),this.setTriangleIndices(this._faceOffset++,[e,e+1,e+2]),this.setTriangleIndices(this._faceOffset++,[e+1,e+2,e+3]),this._vertexOffset+=4}}));e.a=a},function(t,e,n){"use strict";e.a="@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n"},function(t,e,n){"use strict";var i=n(0),r=n.n(i);r.a.extendSeriesModel({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualColorAccessPath:"itemStyle.color",getInitialData:function(t,e){var n=r.a.getCoordinateSystemDimensions(this.get("coordinateSystem"))||["x","y"];if(n.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");n.push("vx","vy");var i=r.a.helper.completeDimensions(n,this.getSource(),{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),a=new r.a.List(i,this);return a.initData(this.getSource()),a},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,supersampling:1,particleType:"point",particleDensity:128,particleSize:1,particleSpeed:1,particleTrail:2,colorTexture:null,gridWidth:"auto",gridHeight:"auto",itemStyle:{color:"#fff",opacity:.8}}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(260),n(261),n(16));r.a.registerVisual(Object(a.a)("linesGL"))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(12),o=(n.n(a),r.a.extendSeriesModel({type:"series.linesGL",dependencies:["grid","geo"],visualColorAccessPath:"lineStyle.color",streamEnabled:!0,init:function(t){var e=this._processFlatCoordsArray(t.data);this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset,e.flatCoords&&(t.data=new Float32Array(e.count)),o.superApply(this,"init",arguments)},mergeOption:function(t){var e=this._processFlatCoordsArray(t.data);this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset,e.flatCoords&&(t.data=new Float32Array(e.count)),o.superApply(this,"mergeOption",arguments)},appendData:function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=Object(a.concatArray)(this._flatCoords,e.flatCoords),this._flatCoordsOffset=Object(a.concatArray)(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},_getCoordsFromItemModel:function(t){var e=this.getData().getItemModel(t),n=e.option instanceof Array?e.option:e.getShallow("coords");if(!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},getLineCoordsCount:function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},getLineCoords:function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],r=0;r<i;r++)e[r]=e[r]||[],e[r][0]=this._flatCoords[n+2*r],e[r][1]=this._flatCoords[n+2*r+1];return i}var a=this._getCoordsFromItemModel(t);for(r=0;r<a.length;r++)e[r]=e[r]||[],e[r][0]=a[r][0],e[r][1]=a[r][1];return a.length},_processFlatCoordsArray:function(t){var e=0;if(this._flatCoords&&(e=this._flatCoords.length),"number"==typeof t[0]){for(var n=t.length,i=new Uint32Array(n),r=new Float64Array(n),a=0,o=0,s=0,l=0;l<n;){s++;var u=t[l++];i[o++]=a+e,i[o++]=u;for(var c=0;c<u;c++){var h=t[l++],d=t[l++];if(r[a++]=h,r[a++]=d,l>n)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(i.buffer,0,o),flatCoords:r,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},getInitialData:function(t,e){var n=new r.a.List(["value"],this);return n.hasItemOption=!1,n.initData(t.data,[],(function(t,e,i,r){if(t instanceof Array)return NaN;n.hasItemOption=!0;var a=t.value;return null!=a?a instanceof Array?a[r]:a:void 0})),n},defaultOption:{coordinateSystem:"geo",zlevel:10,progressive:1e4,progressiveThreshold:5e4,blendMode:"source-over",lineStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(20),s=n(86),l=n(84),u=n(3);r.a.extendChartView({type:"linesGL",__ecgl__:!0,init:function(t,e){this.groupGL=new a.a.Node,this.viewGL=new o.a("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new l.a(this.viewGL),this._nativeLinesShader=a.a.createShader("ecgl.lines3D"),this._meshLinesShader=a.a.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(t,e,n){this.groupGL.removeAll(),this._glViewHelper.reset(t,n);var i=this._linesMeshes[0];i||(i=this._linesMeshes[0]=this._createLinesMesh(t)),this._linesMeshes.length=1,this.groupGL.add(i),this._updateLinesMesh(t,i,0,t.getData().count()),this.viewGL.setPostEffect(t.getModel("postEffect"),n)},incrementalPrepareRender:function(t,e,n){this.groupGL.removeAll(),this._glViewHelper.reset(t,n),this._currentStep=0,this.viewGL.setPostEffect(t.getModel("postEffect"),n)},incrementalRender:function(t,e,n,i){var r=this._linesMeshes[this._currentStep];r||(r=this._createLinesMesh(e),this._linesMeshes[this._currentStep]=r),this._updateLinesMesh(e,r,t.start,t.end),this.groupGL.add(r),i.getZr().refresh(),this._currentStep++},updateTransform:function(t,e,n){t.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(t,n)},_createLinesMesh:function(t){return new a.a.Mesh({$ignorePicking:!0,material:new a.a.Material({shader:a.a.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new s.a({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:a.a.Mesh.LINES,culling:!1})},_updateLinesMesh:function(t,e,n,i){var r=t.getData();e.material.blend="lighter"===t.get("blendMode")?a.a.additiveBlend:null;var o=t.get("lineStyle.curveness")||0,s=t.get("polyline"),l=e.geometry,c=t.coordinateSystem,h=u.a.firstNotNull(t.get("lineStyle.width"),1);h>1?(e.material.shader!==this._meshLinesShader&&e.material.attachShader(this._meshLinesShader),e.mode=a.a.Mesh.TRIANGLES):(e.material.shader!==this._nativeLinesShader&&e.material.attachShader(this._nativeLinesShader),e.mode=a.a.Mesh.LINES),n=n||0,i=i||r.count(),l.resetOffset();var d=0,f=0,p=[],g=[],m=[],v=[],y=[],x=.3,b=.7;function _(){g[0]=p[0]*b+v[0]*x-(p[1]-v[1])*o,g[1]=p[1]*b+v[1]*x-(v[0]-p[0])*o,m[0]=p[0]*x+v[0]*b-(p[1]-v[1])*o,m[1]=p[1]*x+v[1]*b-(v[0]-p[0])*o}if(s||0!==o)for(var E=n;E<i;E++)if(s){var w=t.getLineCoordsCount(E);d+=l.getPolylineVertexCount(w),f+=l.getPolylineTriangleCount(w)}else t.getLineCoords(E,y),this._glViewHelper.dataToPoint(c,y[0],p),this._glViewHelper.dataToPoint(c,y[1],v),_(),d+=l.getCubicCurveVertexCount(p,g,m,v),f+=l.getCubicCurveTriangleCount(p,g,m,v);else{var T=i-n;d+=T*l.getLineVertexCount(),f+=T*l.getLineVertexCount()}l.setVertexCount(d),l.setTriangleCount(f);var S=n,M=[];for(E=n;E<i;E++){a.a.parseColor(r.getItemVisual(S,"color"),M);var C=u.a.firstNotNull(r.getItemVisual(S,"opacity"),1);M[3]*=C,w=t.getLineCoords(E,y);for(var A=0;A<w;A++)this._glViewHelper.dataToPoint(c,y[A],y[A]);s?l.addPolyline(y,M,h,0,w):0!==o?(p=y[0],v=y[1],_(),l.addCubicCurve(p,g,m,v,M,h)):l.addPolyline(y,M,h,0,2),S++}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}})}])},t.exports=i(n(76411))},37271:function(t){"use strict";var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,i,a,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,a||t,o),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],s]:t._events[l].push(s):(t._events[l]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,a=i.length,o=new Array(a);r<a;r++)o[r]=i[r].fn;return o},s.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},s.prototype.emit=function(t,e,i,r,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var l,u,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,r),!0;case 5:return c.fn.call(c.context,e,i,r,a),!0;case 6:return c.fn.call(c.context,e,i,r,a,o),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,f=c.length;for(u=0;u<f;u++)switch(c[u].once&&this.removeListener(t,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,e);break;case 3:c[u].fn.call(c[u].context,e,i);break;case 4:c[u].fn.call(c[u].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,i,r){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||r&&!s.once||i&&s.context!==i||o(this,a);else{for(var l=0,u=[],c=s.length;l<c;l++)(s[l].fn!==e||r&&!s[l].once||i&&s[l].context!==i)&&u.push(s[l]);u.length?this._events[a]=1===u.length?u[0]:u:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s},53291:function(t){"use strict";var e=Array.isArray,n=Object.keys,i=Object.prototype.hasOwnProperty;t.exports=function t(r,a){if(r===a)return!0;if(r&&a&&"object"==typeof r&&"object"==typeof a){var o,s,l,u=e(r),c=e(a);if(u&&c){if((s=r.length)!=a.length)return!1;for(o=s;0!=o--;)if(!t(r[o],a[o]))return!1;return!0}if(u!=c)return!1;var h=r instanceof Date,d=a instanceof Date;if(h!=d)return!1;if(h&&d)return r.getTime()==a.getTime();var f=r instanceof RegExp,p=a instanceof RegExp;if(f!=p)return!1;if(f&&p)return r.toString()==a.toString();var g=n(r);if((s=g.length)!==n(a).length)return!1;for(o=s;0!=o--;)if(!i.call(a,g[o]))return!1;for(o=s;0!=o--;)if(!t(r[l=g[o]],a[l]))return!1;return!0}return r!=r&&a!=a}},95328:function(t){function e(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}t.exports=function(t){const n=function(t){const n=[];for(let i=0;i<t.length;i++){for(;n.length>=2&&e(n[n.length-2],n[n.length-1],t[i])<=0;)n.pop();n.push(t[i])}return n.pop(),n}(t),i=function(t){const n=t.reverse(),i=[];for(let t=0;t<n.length;t++){for(;i.length>=2&&e(i[i.length-2],i[i.length-1],n[t])<=0;)i.pop();i.push(n[t])}return i.pop(),i}(t).concat(n);return i.push(t[0]),i}},11950:function(t){t.exports={toXy:function(t,e){return void 0===e?t.slice():t.map((function(t){return new Function("pt","return [pt"+e[0]+",pt"+e[1]+"];")(t)}))},fromXy:function(t,e){return void 0===e?t.slice():t.map((function(t){return new Function("pt","const o = {}; o"+e[0]+"= pt[0]; o"+e[1]+"= pt[1]; return o;")(t)}))}}},98204:function(t){function e(t,e){this._cells=[],this._cellSize=e,this._reverseCellSize=1/e;for(let e=0;e<t.length;e++){const n=t[e],i=this.coordToCellNum(n[0]),r=this.coordToCellNum(n[1]);if(this._cells[i])this._cells[i][r]?this._cells[i][r].push(n):this._cells[i][r]=[n];else{const t=[];t[r]=[n],this._cells[i]=t}}}e.prototype={cellPoints:function(t,e){return void 0!==this._cells[t]&&void 0!==this._cells[t][e]?this._cells[t][e]:[]},rangePoints:function(t){const e=this.coordToCellNum(t[0]),n=this.coordToCellNum(t[1]),i=this.coordToCellNum(t[2]),r=this.coordToCellNum(t[3]),a=[];for(let t=e;t<=i;t++)for(let e=n;e<=r;e++)for(let n=0;n<this.cellPoints(t,e).length;n++)a.push(this.cellPoints(t,e)[n]);return a},removePoint:function(t){const e=this.coordToCellNum(t[0]),n=this.coordToCellNum(t[1]),i=this._cells[e][n];let r;for(let e=0;e<i.length;e++)if(i[e][0]===t[0]&&i[e][1]===t[1]){r=e;break}return i.splice(r,1),i},trunc:Math.trunc||function(t){return t-t%1},coordToCellNum:function(t){return this.trunc(t*this._reverseCellSize)},extendBbox:function(t,e){return[t[0]-e*this._cellSize,t[1]-e*this._cellSize,t[2]+e*this._cellSize,t[3]+e*this._cellSize]}},t.exports=function(t,n){return new e(t,n)}},76117:function(t,e,n){"use strict";const i=n(86972),r=n(98204),a=n(11950),o=n(95328);function s(t,e){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function l(t,e,n){const i=[e[0]-t[0],e[1]-t[1]],r=[n[0]-t[0],n[1]-t[1]],a=s(t,e),o=s(t,n);return(i[0]*r[0]+i[1]*r[1])/Math.sqrt(a*o)}function u(t,e){for(let n=0;n<e.length-1;n++){const r=[e[n],e[n+1]];if(!(t[0][0]===r[0][0]&&t[0][1]===r[0][1]||t[0][0]===r[1][0]&&t[0][1]===r[1][1])&&i(t,r))return!0}return!1}function c(t){return[Math.min(t[0][0],t[1][0]),Math.min(t[0][1],t[1][1]),Math.max(t[0][0],t[1][0]),Math.max(t[0][1],t[1][1])]}function h(t,e,n){let i,r,a=null,o=f,s=f;for(let c=0;c<e.length;c++)i=l(t[0],t[1],e[c]),r=l(t[1],t[0],e[c]),i>o&&r>s&&!u([t[0],e[c]],n)&&!u([t[1],e[c]],n)&&(o=i,s=r,a=e[c]);return a}function d(t,e,n,i,r){let a=!1;for(let o=0;o<t.length-1;o++){const l=[t[o],t[o+1]],u=l[0][0]+","+l[0][1]+","+l[1][0]+","+l[1][1];if(s(l[0],l[1])<e||r.has(u))continue;let d,f,p,g=0,m=c(l);do{m=i.extendBbox(m,g),d=m[2]-m[0],f=m[3]-m[1],p=h(l,i.rangePoints(m),t),g++}while(null===p&&(n[0]>d||n[1]>f));d>=n[0]&&f>=n[1]&&r.add(u),null!==p&&(t.splice(o+1,0,p),i.removePoint(p),a=!0)}return a?d(t,e,n,i,r):t}const f=Math.cos(90/(180/Math.PI)),p=.6;t.exports=function(t,e,n){let i=e||20;const s=function(t){const e=[t[0]];let n=t[0];for(let i=1;i<t.length;i++){const r=t[i];n[0]===r[0]&&n[1]===r[1]||e.push(r),n=r}return e}(function(t){return t.sort((function(t,e){return t[0]-e[0]||t[1]-e[1]}))}(a.toXy(t,n)));if(s.length<4){const t=s.concat([s[0]]);return n?a.fromXy(t,n):t}const l=function(t){let e=1/0,n=1/0,i=-1/0,r=-1/0;for(let a=t.length-1;a>=0;a--)t[a][0]<e&&(e=t[a][0]),t[a][1]<n&&(n=t[a][1]),t[a][0]>i&&(i=t[a][0]),t[a][1]>r&&(r=t[a][1]);return[i-e,r-n]}(s),u=[l[0]*p,l[1]*p],c=o(s),h=s.filter((function(t){return c.indexOf(t)<0})),f=Math.ceil(1/(s.length/(l[0]*l[1]))),g=d(c,Math.pow(i,2),u,r(h,f),new Set);return n?a.fromXy(g,n):g}},86972:function(t){function e(t,e,n,i,r,a){const o=(a-e)*(n-t)-(i-e)*(r-t);return o>0||!(o<0)}t.exports=function(t,n){const i=t[0][0],r=t[0][1],a=t[1][0],o=t[1][1],s=n[0][0],l=n[0][1],u=n[1][0],c=n[1][1];return e(i,r,s,l,u,c)!==e(a,o,s,l,u,c)&&e(i,r,a,o,s,l)!==e(i,r,a,o,u,c)}},22948:function(t){t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},51581:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(59301),a=s(r),o=s(n(12708));function s(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),i(e,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var t=this.getParentElement(this.scrollComponent);t.scrollTop=t.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var t=!1,e={get passive(){t=!0}};try{document.addEventListener("test",null,e),document.removeEventListener("test",null,e)}catch(t){}return t}},{key:"eventListenerOptions",value:function(){var t=this.props.useCapture;return this.isPassiveSupported()&&(t={useCapture:this.props.useCapture,passive:!0}),t}},{key:"setDefaultLoader",value:function(t){this.defaultLoader=t}},{key:"detachMousewheelListener",value:function(){var t=window;!1===this.props.useWindow&&(t=this.scrollComponent.parentNode),t.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var t=window;!1===this.props.useWindow&&(t=this.getParentElement(this.scrollComponent)),t.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(t){var e=this.props.getScrollParent&&this.props.getScrollParent();return null!=e?e:t&&t.parentNode}},{key:"filterProps",value:function(t){return t}},{key:"attachScrollListener",value:function(){var t=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&t){var e=window;!1===this.props.useWindow&&(e=t),e.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),e.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(t){1!==t.deltaY||this.isPassiveSupported()||t.preventDefault()}},{key:"scrollListener",value:function(){var t=this.scrollComponent,e=window,n=this.getParentElement(t),i=void 0;if(this.props.useWindow){var r=document.documentElement||document.body.parentNode||document.body,a=void 0!==e.pageYOffset?e.pageYOffset:r.scrollTop;i=this.props.isReverse?a:this.calculateOffset(t,a)}else i=this.props.isReverse?n.scrollTop:t.scrollHeight-n.scrollTop-n.clientHeight;i<Number(this.props.threshold)&&t&&null!==t.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(t,e){return t?this.calculateTopPosition(t)+(t.offsetHeight-e-window.innerHeight):0}},{key:"calculateTopPosition",value:function(t){return t?t.offsetTop+this.calculateTopPosition(t.offsetParent):0}},{key:"render",value:function(){var t=this,e=this.filterProps(this.props),n=e.children,i=e.element,r=e.hasMore,o=(e.initialLoad,e.isReverse),s=e.loader,l=(e.loadMore,e.pageStart,e.ref),u=(e.threshold,e.useCapture,e.useWindow,e.getScrollParent,function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(e,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));u.ref=function(e){t.scrollComponent=e,l&&l(e)};var c=[n];return r&&(s?o?c.unshift(s):c.push(s):this.defaultLoader&&(o?c.unshift(this.defaultLoader):c.push(this.defaultLoader))),a.default.createElement(i,u,c)}}]),e}(r.Component);l.propTypes={children:o.default.node.isRequired,element:o.default.node,hasMore:o.default.bool,initialLoad:o.default.bool,isReverse:o.default.bool,loader:o.default.node,loadMore:o.default.func.isRequired,pageStart:o.default.number,ref:o.default.func,getScrollParent:o.default.func,threshold:o.default.number,useCapture:o.default.bool,useWindow:o.default.bool},l.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},e.default=l,t.exports=e.default},26724:function(t,e,n){t.exports=n(51581)},75029:function(t,e,n){"use strict";var i=n(22948),r=Array.prototype.concat,a=Array.prototype.slice,o=t.exports=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var s=t[n];i(s)?e=r.call(e,a.call(s)):e.push(s)}return e};o.wrap=function(t){return function(){return t(o(arguments))}}},27774:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SizeSensorId=e.SensorTabIndex=e.SensorClassName=void 0;e.SizeSensorId="size-sensor-id";e.SensorClassName="size-sensor-object";e.SensorTabIndex="-1"},79301:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,n=null;return function(){for(var i=this,r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];clearTimeout(n),n=setTimeout((function(){t.apply(i,a)}),e)}}},79789:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=1;e.default=function(){return"".concat(n++)}},47242:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ver=e.clear=e.bind=void 0;var i=n(95270);e.bind=function(t,e){var n=(0,i.getSensor)(t);return n.bind(e),function(){n.unbind(e)}};e.clear=function(t){var e=(0,i.getSensor)(t);(0,i.removeSensor)(e)};e.ver="1.0.2"},95270:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.removeSensor=e.getSensor=e.Sensors=void 0;var i,r=(i=n(79789))&&i.__esModule?i:{default:i},a=n(57829),o=n(27774);var s={};function l(t){t&&s[t]&&delete s[t]}e.Sensors=s;e.getSensor=function(t){var e=t.getAttribute(o.SizeSensorId);if(e&&s[e])return s[e];var n=(0,r.default)();t.setAttribute(o.SizeSensorId,n);var i=(0,a.createSensor)(t,(function(){return l(n)}));return s[n]=i,i};e.removeSensor=function(t){var e=t.element.getAttribute(o.SizeSensorId);t.destroy(),l(e)}},57829:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createSensor=void 0;var i=n(20953),r=n(55202),a="undefined"!=typeof ResizeObserver?r.createSensor:i.createSensor;e.createSensor=a},20953:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createSensor=void 0;var i,r=(i=n(79301))&&i.__esModule?i:{default:i},a=n(27774);e.createSensor=function(t,e){var n=void 0,i=[],o=(0,r.default)((function(){i.forEach((function(e){e(t)}))})),s=function(){n&&n.parentNode&&(n.contentDocument&&n.contentDocument.defaultView.removeEventListener("resize",o),n.parentNode.removeChild(n),t.removeAttribute(a.SizeSensorId),n=void 0,i=[],e&&e())};return{element:t,bind:function(e){n||(n=function(){"static"===getComputedStyle(t).position&&(t.style.position="relative");var e=document.createElement("object");return e.onload=function(){e.contentDocument.defaultView.addEventListener("resize",o),o()},e.style.display="block",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.height="100%",e.style.width="100%",e.style.overflow="hidden",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.opacity="0",e.setAttribute("class",a.SensorClassName),e.setAttribute("tabindex",a.SensorTabIndex),e.type="text/html",t.appendChild(e),e.data="about:blank",e}()),-1===i.indexOf(e)&&i.push(e)},destroy:s,unbind:function(t){var e=i.indexOf(t);-1!==e&&i.splice(e,1),0===i.length&&n&&s()}}}},55202:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createSensor=void 0;var i,r=n(27774),a=(i=n(79301))&&i.__esModule?i:{default:i};e.createSensor=function(t,e){var n=void 0,i=[],o=(0,a.default)((function(){i.forEach((function(e){e(t)}))})),s=function(){n.disconnect(),i=[],n=void 0,t.removeAttribute(r.SizeSensorId),e&&e()};return{element:t,bind:function(e){var r;n||((r=new ResizeObserver(o)).observe(t),o(),n=r),-1===i.indexOf(e)&&i.push(e)},destroy:s,unbind:function(t){var e=i.indexOf(t);-1!==e&&i.splice(e,1),0===i.length&&n&&s()}}}},80813:function(t,e,n){"use strict";n.d(e,{CR:function(){return c},Jh:function(){return l},Q_:function(){return f},XA:function(){return u},ZT:function(){return r},_T:function(){return o},ev:function(){return d},mG:function(){return s},pi:function(){return a},pr:function(){return h}});var i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)};function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},a.apply(this,arguments)};function o(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}function s(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))}function l(t,e){var n,i,r,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}Object.create;function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}function h(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),r=0;for(e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,r++)i[r]=a[o];return i}function d(t,e,n){if(n||2===arguments.length)for(var i,r=0,a=e.length;r<a;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}Object.create;function f(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}"function"==typeof SuppressedError&&SuppressedError}}]); |