@wcardinal/wcardinal-ui 0.311.0 → 0.313.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /*
2
- Winter Cardinal UI v0.311.0
2
+ Winter Cardinal UI v0.313.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
6
6
  Material Design icons by Google
7
7
  Apache license version 2.0.
8
8
  */
9
- !function(t){"use strict";var n={},i={},r={CIRCLE:0,RECTANGLE:1,RECTANGLE_ROUNDED:2,TRIANGLE:3,TRIANGLE_ROUNDED:4,LINE:5,IMAGE:6,IMAGE_SDF:7,GROUP:8,BAR:9,LABEL:10,NULL:11,GROUP_SHADOWED:12,LINE_OF_CIRCLES:13,LINE_OF_RECTANGLES:14,LINE_OF_RECTANGLE_ROUNDEDS:15,LINE_OF_TRIANGLES:16,LINE_OF_TRIANGLE_ROUNDEDS:17,EMBEDDED:18,EMBEDDED_LAYER:19,BUTTON:20,RECTANGLE_PIVOTED:21,CONNECTOR_LINE:22,CONNECTOR_ELBOW:23,SEMICIRCLE:24,EXTENSION:1e3},e={},u=function(){function t(t,n,i,r,e,u){this.buffer=t,this.i=u,this.u=n,this.h=i,this.o=r,this.l=e}return t.prototype.init=function(t){t.uploaded=this;for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].init(n);return this.update(t),this},t.prototype.update=function(t){for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].update(n,t)},t.prototype.isCompatible=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)if(!n[i].isCompatible(t))return!1;return!0},t.prototype.getBuffer=function(){return this.buffer},t.prototype.getVertexOffset=function(){return this.u},t.prototype.getVertexCount=function(){return this.o},t.prototype.getIndexOffset=function(){return this.h},t.prototype.getIndexCount=function(){return this.l},t.prototype.buildUnit=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)n[i].buildUnit(t)},t}(),s={NONE:0,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING:14,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896},h=function(t,n,i,r){return i&s.DOTTED_MASK?i&s.DOTTED?r.set(n,n):i&s.DOTTED_DENSELY?r.set(n,.5*n):r.set(n,2*n):i&s.DASHED_MASK?i&s.DASHED?r.set(2*n,n):i&s.DASHED_DENSELY?r.set(2*n,.5*n):r.set(2*n,2*n):r.set(2*t,0),r},o=function(t){var n=t&s.NON_EXPANDING_WIDTH?1:0,i=t&s.NON_SHRINKING_WIDTH?2:0;return t&(s.DOTTED_MASK||s.DASHED_MASK)?n|i|(t&s.NON_SCALING_DOT_AND_DASH?4:0):n|i},a=new t.Point,c=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5,t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5},f=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+2,t[++r]=n+1,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3},l=function(t,n,i,r,e,u,s,c,f){var l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty,w=e[0],p=e[1],O=l*w+b*p+g,D=v*w+d*p+m,E=e[2],M=e[3],S=l*E+b*M+g,T=v*E+d*M+m,j=S-O,N=T-D,I=Math.sqrt(j*j+N*N),C=I;if(0<=u&&1e-5<I){var A=u/I;S=O+(j*=A),T=D+(N*=A),C=u}var R=O-j,k=D-N,L=S+j,y=T+N,x=o(c),B=h(C,s,c,a),_=B.x,P=B.y,F=(r<<1)-1,U=(r<<2)-1,G=6*r-1;t[++F]=O,t[++F]=D,t[++F]=O,t[++F]=D,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=k,n[++G]=S,n[++G]=T,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=k,n[++G]=S,n[++G]=T,i[++U]=0,i[++U]=_,i[++U]=P,i[++U]=C,i[++U]=0,i[++U]=_,i[++U]=P,i[++U]=C,t[++F]=S,t[++F]=T,t[++F]=S,t[++F]=T,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=L,n[++G]=y,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=L,n[++G]=y,i[++U]=C,i[++U]=_,i[++U]=P,i[++U]=C,i[++U]=C,i[++U]=_,i[++U]=P,i[++U]=C},v=function(t,n,i){var r=(n<<1)-1;t[++r]=i.x0,t[++r]=i.y0,t[++r]=i.x3,t[++r]=i.y3,t[++r]=i.x1,t[++r]=i.y1,t[++r]=i.x2,t[++r]=i.y2},b=function(){function t(){this.target="",this.position=0}return t.prototype.init=function(t){this.target=t,this.position=0},t.prototype.hasNext=function(){return this.position<this.target.length},t.prototype.findNextBreak=function(t,n){for(var i=t.length,r=n;r<i;++r){var e=t.charCodeAt(r);if(!this.isLowSurrogate(e)&&!this.isVariationSelector(e))return r}return i},t.prototype.isHighSurrogate=function(t){return 55296<=t&&t<=56319},t.prototype.isLowSurrogate=function(t){return 56320<=t&&t<=57343},t.prototype.isVariationSelector=function(t){return 65024<=t&&t<=65039},t.prototype.next=function(){var t=this.target,n=this.position,i=this.findNextBreak(t,n+1),r=t.substring(n,i);return this.position=i,r},t.prototype.advance=function(t){var n=this.target,i=this.position,r=this.findNextBreak(n,i+1);return n.substring(i,r)!==t&&(this.position=r,!0)},t.prototype.close=function(){var t=this.target.length;return this.position<t&&(this.position=t,!0)},t.from=function(n){null==t.v&&(t.v=new t);var i=t.v;return i.init(n),i},t.v=null,t}(),d={NORMAL:0,BOLD:1},g={NORMAL:0,ITALIC:1},m={LEFT:0,CENTER:1,RIGHT:2,OUTSIDE_LEFT:3,OUTSIDE_RIGHT:4},w={TOP:0,MIDDLE:1,BOTTOM:2,OUTSIDE_TOP:3,OUTSIDE_BOTTOM:4},p={LEFT_TO_RIGHT:0,TOP_TO_BOTTOM:1,BOTTOM_TO_TOP:2,RIGHT_TO_LEFT:3},O=function(t,n,i,r){var e=i-t,u=r-n;return Math.sqrt(e*e+u*u)},D=1e-5,E=new t.Point,M=function(t){return 12*Math.ceil(t.text.value.length/12)},S=function(t,n,i){for(var r=3*n-1,e=3*(n+i)-1;r<e;)t[++r]=0,t[++r]=0,t[++r]=2},T=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s,t[++e]=s+1,t[++e]=s+3,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=4},j=function(t,n,i,r,e,u,h,a,c){var f=6*n-1,l=6*(n+i)-1,v=o(s.NONE);if(null!=r)for(var b=r.font.size/(e*(a+c)*.5),g=h===d.NORMAL?0:.05;f<l;)t[++f]=u,t[++f]=v,t[++f]=b,t[++f]=1,t[++f]=0,t[++f]=g;else for(;f<l;)t[++f]=0,t[++f]=v,t[++f]=0,t[++f]=1,t[++f]=0,t[++f]=0},N=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g,p,O,D,E){switch(t){case m.LEFT:switch(n){case w.TOP:E.x=o+g*(i+e)+O*(r+u),E.y=a+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i+e)+O*(r-.5*h),E.y=.5*(a+d)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i+e)+O*(r-u-h),E.y=d+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i+e)+O*(r-u-h),E.y=a+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i+e)+O*(r+u),E.y=d+p*(i+e)+D*(r+u)}break;case m.CENTER:switch(n){case w.TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r+u),E.y=.5*(a+f)+p*(i-.5*s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+l)+g*(i-.5*s)+O*(r-.5*h),E.y=.5*(a+v)+p*(i-.5*s)+D*(r-.5*h);break;case w.BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(d+v)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(a+f)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r+u),E.y=.5*(d+v)+p*(i-.5*s)+D*(r+u)}break;case m.RIGHT:switch(n){case w.TOP:E.x=c+g*(i-e-s)+O*(r+u),E.y=f+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(f+v)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i-e-s)+O*(r-u-h),E.y=v+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i-e-s)+O*(r-u-h),E.y=f+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i-e-s)+O*(r+u),E.y=v+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_LEFT:switch(n){case w.TOP:E.x=o+g*(i-e-s)+O*(r+u),E.y=a+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(a+d)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i-e-s)+O*(r-u-h),E.y=d+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i-e-s)+O*(r-u-h),E.y=a+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i-e-s)+O*(r+u),E.y=d+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_RIGHT:switch(n){case w.TOP:E.x=c+g*(i+e)+O*(r+u),E.y=f+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i+e)+O*(r-.5*h),E.y=.5*(f+v)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i+e)+O*(r-u-h),E.y=v+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i+e)+O*(r-u-h),E.y=f+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i+e)+O*(r+u),E.y=v+p*(i+e)+D*(r+u)}}},I=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,d,M,S,T,j,I,k,L,y,B,_,P){var F=.5*s,U=.5*h,G=P.a,H=P.b,z=P.c,V=P.d,W=P.tx,X=P.ty,K=e-F,Y=u-U,J=e+F,Z=u-U,q=e+F,Q=u+U,$=G*K+z*Y+W,tt=H*K+V*Y+X,nt=G*J+z*Z+W,it=H*J+V*Z+X,rt=G*q+z*Q+W,et=H*q+V*Q+X,ut=$+(rt-nt),st=tt+(et-it),ht=O($,tt,nt,it),ot=O(0,0,G,H),at=1,ct=0;if(D<ot){var ft=1/ot;at=G*ft,ct=H*ft}var lt=O($,tt,ut,st),vt=O(0,0,z,V),bt=0,dt=1;if(D<ot){var gt=1/vt;bt=z*gt,dt=V*gt}var mt=E;switch(j){case p.LEFT_TO_RIGHT:break;case p.TOP_TO_BOTTOM:mt.set(bt,dt),bt=-at,dt=-ct,at=mt.x,ct=mt.y,mt.x=vt,vt=ot,ot=mt.x;break;case p.BOTTOM_TO_TOP:mt.set(bt,dt),bt=at,dt=ct,at=-mt.x,ct=-mt.y,mt.x=vt,vt=ot,ot=mt.x;break;case p.RIGHT_TO_LEFT:at=-at,ct=-ct,bt=-bt,dt=-dt}for(var wt=0,pt=0,Ot=0,Dt=a*vt,Et=Math.max(0,a+T)*vt,Mt=0,St=1,Tt=o.characters,jt=b.from(c),Nt=0;jt.hasNext();)"\n"!==(vn=jt.next())?(0<Nt&&(Mt+=Math.max(0,Nt+S)),(dn=Tt[vn])?(Nt=dn.advance,Ot=dn.height):Nt=0):(Mt+=Nt,Nt=0,wt=Math.max(wt,Mt),Mt=0,pt+=Et,St+=1);if(Mt+=Nt,wt=Math.max(wt,Mt),pt+=Dt,Mt=0,y&&C(l,v)){var It=0,Ct=0;switch(j){case p.LEFT_TO_RIGHT:case p.RIGHT_TO_LEFT:It=Math.max(0,ht-2*I),Ct=Math.max(0,lt-2*k);break;case p.TOP_TO_BOTTOM:case p.BOTTOM_TO_TOP:It=Math.max(0,lt-2*k),Ct=Math.max(0,ht-2*I)}var At=wt*ot*(a/o.font.size),Rt=pt,kt=Math.min(1,Math.min(It/At,Ct/Rt));a*=kt,Dt*=kt,Et*=kt,pt*=kt}var Lt=a/o.font.size,yt=ot*Lt;wt*=yt,Ot*=vt*Lt;var xt=0,Bt=0,_t=NaN;switch(j){case p.LEFT_TO_RIGHT:N(l,v,d,M,I,k,wt,pt,$,tt,nt,it,rt,et,ut,st,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=ht-2*I);break;case p.TOP_TO_BOTTOM:N(function(t){switch(t){case w.TOP:return m.LEFT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.RIGHT;case w.OUTSIDE_TOP:return m.OUTSIDE_LEFT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_RIGHT}}(v),function(t){switch(t){case m.LEFT:return w.BOTTOM;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.TOP;case m.OUTSIDE_LEFT:return w.OUTSIDE_BOTTOM;case m.OUTSIDE_RIGHT:return w.OUTSIDE_TOP}}(l),M,d,k,I,wt,pt,nt,it,rt,et,ut,st,$,tt,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=lt-2*k);break;case p.BOTTOM_TO_TOP:N(function(t){switch(t){case w.TOP:return m.RIGHT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.LEFT;case w.OUTSIDE_TOP:return m.OUTSIDE_RIGHT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_LEFT}}(v),function(t){switch(t){case m.LEFT:return w.TOP;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.BOTTOM;case m.OUTSIDE_LEFT:return w.OUTSIDE_TOP;case m.OUTSIDE_RIGHT:return w.OUTSIDE_BOTTOM}}(l),M,d,k,I,wt,pt,ut,st,$,tt,nt,it,rt,et,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=lt-2*k);break;case p.RIGHT_TO_LEFT:N(function(t){switch(t){case m.LEFT:return m.RIGHT;case m.CENTER:return m.CENTER;case m.RIGHT:return m.LEFT;case m.OUTSIDE_LEFT:return m.OUTSIDE_RIGHT;case m.OUTSIDE_RIGHT:return m.OUTSIDE_LEFT}}(l),function(t){switch(t){case w.TOP:return w.BOTTOM;case w.MIDDLE:return w.MIDDLE;case w.BOTTOM:return w.TOP;case w.OUTSIDE_TOP:return w.OUTSIDE_BOTTOM;case w.OUTSIDE_BOTTOM:return w.OUTSIDE_TOP}}(v),d,M,I,k,wt,pt,rt,et,ut,st,$,tt,nt,it,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=ht-2*I)}if(_t<wt){var Pt=.5*(wt-_t);B[0]=xt+at*Pt,B[1]=Bt+ct*Pt,B[2]=at,B[3]=ct,B[4]=bt,B[5]=dt,B[6]=_t,B[7]=pt,B[8]=ot,B[9]=vt}else B[0]=xt,B[1]=Bt,B[2]=at,B[3]=ct,B[4]=bt,B[5]=dt,B[6]=wt,B[7]=pt,B[8]=ot,B[9]=vt;var Ft=_.x0,Ut=_.x1,Gt=_.x3,Ht=_.y0,zt=_.y1,Vt=_.y3,Wt=Ut-Ft,Xt=zt-Ht,Kt=Gt-Ft,Yt=Vt-Ht,Jt=Et*bt,Zt=Et*dt,qt=yt*at,Qt=yt*ct,$t=.5*(Ot-Dt),tn=$t*bt,nn=$t*dt,rn=f===g.NORMAL?0:.25*a,en=xt-tn+rn*qt,un=Bt-nn+rn*Qt,sn=xt+tn+Dt*bt,hn=Bt+nn+Dt*dt,on=en,an=un,cn=sn,fn=hn;Mt=0,Nt=0,jt.position=0,St=0;for(var ln=2*i;jt.hasNext();ln+=8){var vn;if("\n"!==(vn=jt.next())){var bn=Mt;0<Nt&&(Mt+=Math.max(0,Nt+S));var dn,gn=Mt*qt,mn=Mt*Qt;if(on=en+gn,an=un+mn,cn=sn+gn,fn=hn+mn,St+=1,dn=Tt[vn]){var wn=dn.advance;if(_t<(Mt+wn)*yt){var pn=Tt["..."];if(pn){if(1<St&&_t<(Mt+pn.advance)*yt){ln-=8,St-=1;var On=(Mt=bn)*qt,Dn=Mt*Qt;on=en+On,an=un+Dn,cn=sn+On,fn=hn+Dn}for(Nt=pn.advance,R(t,n,ln,pn,o,qt,Qt,on,an,cn,fn,Wt,Xt,Kt,Yt,Ft,Ht),ln+=8;;ln+=8){if(!jt.hasNext()||!jt.advance("\n")){ln-=8;break}A(t,n,ln,on,an,cn,fn,Ft,Ht,Gt,Vt),St+=1}}else Nt=wn,A(t,n,ln,on,an,cn,fn,Ft,Ht,Gt,Vt)}else Nt=wn,R(t,n,ln,dn,o,qt,Qt,on,an,cn,fn,Wt,Xt,Kt,Yt,Ft,Ht)}else Nt=0,A(t,n,ln,on,an,cn,fn,Ft,Ht,Gt,Vt)}else Mt+=Nt,Nt=0,A(t,n,ln,on=en+=Jt,an=un+=Zt,cn=sn+=Jt,fn=hn+=Zt,Ft,Ht,Gt,Vt),x(t,at,ct,St,ln,wt-Mt*yt,j,l,v),Mt=0,St=0}x(t,at,ct,St,ln,wt-(Mt+=Nt)*yt,j,l,v);for(var En=2*(i+r);ln<En;ln+=2)t[ln+0]=xt,t[ln+1]=Bt,n[ln+0]=Ft,n[ln+1]=Ht},C=function(t,n){switch(t){case m.LEFT:case m.CENTER:case m.RIGHT:switch(n){case w.TOP:case w.MIDDLE:case w.BOTTOM:return!0}}return!1},A=function(t,n,i,r,e,u,s,h,o,a,c){t[i+0]=r,t[i+1]=e,t[i+2]=r,t[i+3]=e,t[i+4]=u,t[i+5]=s,t[i+6]=u,t[i+7]=s,n[i+0]=h,n[i+1]=o,n[i+2]=h,n[i+3]=o,n[i+4]=a,n[i+5]=c,n[i+6]=a,n[i+7]=c},R=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=r.x-r.origin.x,w=r.width,p=m*u,O=m*s,D=(m+w)*u,E=(m+w)*s;t[i+0]=h+p,t[i+1]=o+O,t[i+2]=h+D,t[i+3]=o+E,t[i+4]=a+D,t[i+5]=c+E,t[i+6]=a+p,t[i+7]=c+O;var M=r.x/e.width,S=r.y/e.height,T=(r.x+r.width)/e.width,j=(r.y+r.height)/e.height,N=f*M,I=l*M,C=f*T,A=l*T,R=v*S,k=b*S,L=v*j,y=b*j;n[i+0]=d+N+R,n[i+1]=g+I+k,n[i+2]=d+C+R,n[i+3]=g+A+k,n[i+4]=d+C+L,n[i+5]=g+A+y,n[i+6]=d+N+L,n[i+7]=g+I+y},k=function(t,n,i,r,e){for(var u=n-8*i-1,s=0;s<i;++s)t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e},L=function(t,n,i,r,e,u){k(t,n,i,(r*=.5)*e,r*u)},y=function(t,n,i,r,e,u){k(t,n,i,r*e,r*u)},x=function(t,n,i,r,e,u,s,h,o){if(D<u)switch(s){case p.LEFT_TO_RIGHT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:break;case m.CENTER:L(t,e,r,u,n,i);break;case m.OUTSIDE_LEFT:case m.RIGHT:y(t,e,r,u,n,i)}break;case p.TOP_TO_BOTTOM:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:break;case w.MIDDLE:L(t,e,r,u,n,i);break;case w.OUTSIDE_TOP:case w.BOTTOM:y(t,e,r,u,n,i)}break;case p.BOTTOM_TO_TOP:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:y(t,e,r,u,n,i);break;case w.MIDDLE:L(t,e,r,u,n,i)}break;case p.RIGHT_TO_LEFT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:y(t,e,r,u,n,i);break;case m.CENTER:L(t,e,r,u,n,i)}}},B=function(t,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};function _(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}B(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var P,F,U,G,H,z={NONE:0,CLOSED:1,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896,CURVE:1024,FORMATTER_SHIFT:10,FORMATTER_MASK:1047552,FORMATTER_EXTENSION_LOWEST:512,FORMATTER_EXTENSION_HIGHEST:1023,FORMATTER_CURVE:1},V=function(t,n,i,r,e){for(var u=(t>>16&255)/255*n,s=(t>>8&255)/255*n,h=(t>>0&255)/255*n,o=n,a=(i<<2)-1,c=(i+r<<2)-1;a<c;)e[++a]=u,e[++a]=s,e[++a]=h,e[++a]=o},W=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=-1,this.strokeAlign=NaN,this.strokeWidth=NaN,this.strokeSide=NaN,this.strokeStyle=NaN,this.colorFill=NaN,this.alphaFill=-1,this.colorStroke=NaN,this.alphaStroke=-1,this.texture=null,this.textureTransformId=NaN}return n.prototype.isCompatible=function(t){return!0},n.prototype.updateColorFill=function(t,n){var i=n.fill,r=n.visible&&i.enable,e=i.color,u=r?i.alpha:0;e===this.colorFill&&u===this.alphaFill||(this.colorFill=e,this.alphaFill=u,t.updateColorFills(),V(e,u,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.stroke,r=n.visible&&i.enable&&0<i.width,e=i.color,u=r?i.alpha:0;e===this.colorStroke&&u===this.alphaStroke||(this.colorStroke=e,this.alphaStroke=u,t.updateColorStrokes(),V(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),X=function(t){return t.updateTransform(),t.transform.getLocalId()},K=function(n){return n.texture||t.Texture.WHITE},Y=function(t){var n=t;return null==n._uvs&&t.updateUvs(),n._updateID},J=function(t){return t._uvs},Z=function(){function t(){}return t.setDefaultThemeClass=function(t){this.DEFAULT_THEME_CLASS=t},t.getDefaultThemeClass=function(){return this.DEFAULT_THEME_CLASS},t.getInstance=function(){if(null==this.INSTANCE){var t=this.getDefaultThemeClass();if(null==t)throw new Error("No default theme class found");this.INSTANCE=new t}return this.INSTANCE},t.setInstance=function(t){var n=this.INSTANCE;return this.INSTANCE=t,n},t.get=function(t){return this.getInstance().get(t)},t.set=function(t,n){this.getInstance().set(t,n)},t.getClass=function(t){return this.getInstance().getClass(t)},t.setClass=function(t,n){this.getInstance().setClass(t,n)},t.getAtlas=function(){return this.getInstance().getAtlas()},t.DEFAULT_THEME_CLASS=null,t.INSTANCE=null,t}(),q=function(){function t(){}return Object.defineProperty(t,"THEME",{get:function(){var t=this.g;if(null!=t)return t;var n=Z.getInstance().get("EShape");return this.g=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_COLOR",{get:function(){return this.THEME.getFillColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_ALPHA",{get:function(){return this.THEME.getFillAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_COLOR",{get:function(){return this.THEME.getStrokeColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALPHA",{get:function(){return this.THEME.getStrokeAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_WIDTH",{get:function(){return this.THEME.getStrokeWidth()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALIGN",{get:function(){return this.THEME.getStrokeAlign()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_SIDE",{get:function(){return this.THEME.getStrokeSide()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_STYLE",{get:function(){return this.THEME.getStrokeStyle()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_VALUE",{get:function(){return this.THEME.getTextValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_COLOR",{get:function(){return this.THEME.getTextColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_ALPHA",{get:function(){return this.THEME.getTextAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_FAMILY",{get:function(){return this.THEME.getTextFamily()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_SIZE",{get:function(){return this.THEME.getTextSize()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"RADIUS",{get:function(){return this.THEME.getRadius()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_X",{get:function(){return this.THEME.getSizeX()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_Y",{get:function(){return this.THEME.getSizeY()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HIGHLIGHT_COLOR",{get:function(){return this.THEME.getHighlightColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"CURVE_SEGMENT_COUNT",{get:function(){return this.THEME.getCurveSegmentCount()},enumerable:!1,configurable:!0}),t}(),Q={NONE:0,CIRCLE:1,TRIANGLE:2,RECTANGLE:3},$=function(){function t(t,n,i,r){this.p=t,this.O=n,this.S=i,this.T=r}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha)},t.prototype.set=function(t,n,i){var r=!1;void 0!==t&&this.O!==t&&(this.O=t,r=!0),void 0!==n&&this.S!==n&&(this.S=n,r=!0),void 0!==i&&this.T!==i&&(this.T=i,r=!0),r&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T}},t.prototype.serialize=function(t){var n="[".concat(this.O?1:0,",").concat(this.S,",").concat(this.T,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getFill(t);if(null!=r)this.set(!!r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setFill(t,e),this.set(!!e[0],e[1],e[2])}}},t}(),tt=function(){function n(){}return n.prototype.lock=function(){return this},n.prototype.unlock=function(){return this},Object.defineProperty(n.prototype,"type",{get:function(){return Q.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var n=this.j;return null==n&&(n=new t.Point,this.j=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transform",{get:function(){var n=this.I;return null==n&&(n=new t.Matrix,this.I=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){var t=this.C;return null==t&&(t=new $(this,!0,q.FILL_COLOR,1),this.C=t),t},enumerable:!1,configurable:!0}),n.prototype.updateUploaded=function(){},n.prototype.copy=function(t){return this},n.prototype.set=function(t,n,i){return this},n.prototype.serialize=function(t){return-1},n.prototype.deserialize=function(t,n){},n}(),nt=function(){function t(){this.A=new tt}return t.prototype.lock=function(){return this},t.prototype.unlock=function(){return this},Object.defineProperty(t.prototype,"head",{get:function(){return this.A},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.A},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t.getInstance=function(){var n=this.INSTANCE;return null==n&&(n=new t,this.INSTANCE=n),n},t}(),it={TOP:0,LEFT:1,RIGHT:2,BOTTOM:3},rt=function(){function n(t){this.p=t,this.R=0,this.k=[0,0,0,0],this.L=[],this.B=z.NONE,this.j=-1,this._=it.TOP,this.P=NaN,this.F=NaN,this.U=NaN,this.G=NaN}return n.prototype.getComputedSize=function(t,n,i,r){if(0<=t)return t;switch(n){case it.TOP:case it.BOTTOM:return Math.abs(r);case it.RIGHT:case it.LEFT:return Math.abs(i)}return 0},n.prototype.update=function(){var t=this.p.size,n=t.x,i=t.y,r=this._,e=this.j;if(this.P!==e||this.F!==n||this.U!==i||this.G!==r){this.R+=1,this.P=e,this.F=n,this.U=i,this.G=r;var u=.5*n,s=.5*i,h=this.getComputedSize(e,r,n,i),o=this.k;switch(r){case it.TOP:o[0]=0,o[1]=-s,o[2]=0,o[3]=-s+h;break;case it.RIGHT:o[0]=u,o[1]=0,o[2]=u-h,o[3]=0;break;case it.BOTTOM:o[0]=0,o[1]=s,o[2]=0,o[3]=s-h;break;case it.LEFT:o[0]=-u,o[1]=0,o[2]=-u+h,o[3]=0}}},Object.defineProperty(n.prototype,"length",{get:function(){return 2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.update(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.update(),this.k},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){this.moveTo(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"position",{get:function(){return this._},set:function(t){this.moveTo(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.moveTo(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=nt.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return t instanceof n?this.moveTo(t.position,t.size,t.style):this.moveTo(void 0,void 0,t.style)},n.prototype.set=function(t,n,i){var r,e;if(null!=t){var u=t[0];if(0===u){var s=t[1];r=s<=0?it.TOP:it.BOTTOM,e=Math.abs(t[3]-s)}else r=u<=0?it.LEFT:it.RIGHT,e=Math.abs(t[2]-u)}return this.moveTo(r,e,i)},n.prototype.moveTo=function(t,n,i){var r=!1;return null!=i&&this.B!==i&&(this.B=i,r=!0),null!=t&&this._!==t&&(this._=t,r=!0),null!=n&&this.j!==n&&(this.j=n,r=!0),r&&this.p.updateUploaded(),this},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[".concat(this._,",").concat(this.j,",").concat(this.B,"]"))},n.prototype.deserialize=function(t,n){if(0<=t&&t<n.resources.length){var i=n.resources[t],r=JSON.parse(i);this.moveTo(r[0],r[1],r[2])}},n.prototype.calcHitPointAbs=function(t,n,i,r,e,u,s,h){if(2<=this.length){var o=this.k;if(s(t,n,o[0],o[1],o[2],o[3],0,e,h))return!0}return!1},n}(),et={NONE:0,LINE:1,MARKER_TAIL:2,MARKER_HEAD:3,TEXT:4,CHILDREN:5},ut={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},st=function(){function t(){}return t.add=function(n){t.INSTANCES.push(n)},t.first=function(){var n=t.INSTANCES;if(0<n.length)return n[0];throw new Error("No application found.")},t.last=function(){var n=t.INSTANCES;if(0<n.length)return n[n.length-1];throw new Error("No application found.")},t.get=function(n){var i=t.INSTANCES;return 0<=n&&n<i.length?i[n]:null},t.indexOf=function(n){return t.INSTANCES.indexOf(n)},t.size=function(){return t.INSTANCES.length},t.getStage=function(t){for(var n=t;n.parent;)n=n.parent;return"application"in n&&"layer"in n?n:null},t.find=function(t){var n=this.getStage(t);return n?n.layer.application:null},t.getLayerBase=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerBase():null},t.getLayerOverlay=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerOverlay():null},t.getLayer=function(t){var n=this.getStage(t);return n?n.layer:null},t.getResolution=function(t){var n,i=this.getLayer(t);return i?i.renderer.resolution:null!==(n=window.devicePixelRatio)&&void 0!==n?n:1},t.update=function(n){if(n){var i=this.getStage(n);i&&i.layer.update()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].update()},t.render=function(n){if(n){var i=this.getStage(n);i&&i.layer.render()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].render()},t.INSTANCES=[],t}(),ht=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if(n[i]===t)return i;for(i=0,r=n.length;i<r;++i)if(n[i].isEquals(t))return i;return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.serialize=function(t){for(var n=[],i=this.values,r=0,e=i.length;r<e;++r)n.push(i[r].serialize(t));return n},t}(),ot=function(){function t(t){this.p=t,this.V=new Set}return t.prototype.add=function(t){var n=this.V;return!n.has(t)&&(n.add(t),!0)},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.size=function(){return this.V.size},t.prototype.remove=function(t){return this.V.delete(t)},t.prototype.clear=function(){return 0<this.V.size&&(this.V.clear(),!0)},t.prototype.copy=function(t){var n=this.V;return n.clear(),t.each((function(t){n.add(t)})),this},t.prototype.each=function(t){return this.V.forEach(t),this},t.prototype.fit=function(t){this.V.forEach(this.toOnFitBound(t))},t.prototype.toOnFitBound=function(t){var n;return t?(null==(n=this.W)&&(n=this.newOnFitBound(!0),this.W=n),n):(null==(n=this.K)&&(n=this.newOnFitBound(!1),this.K=n),n)},t.prototype.newOnFitBound=function(t){var n=this;return function(i){n.onFit(i,t)}},t.prototype.onFit=function(t,n){t.fit(n)},t.prototype.attach=function(){var t=this.p;return this.V.forEach((function(n){n.set(t)})),this},t.prototype.detach=function(){return this.V.forEach((function(t){t.set(null)})),this},t}(),at={NONE:0,TRANSFORM:1,SIZE:2,STYLE:4,ACTION:8,POINTS:16,STATE:32,IMAGE:64,DATA:128,TAG:128,CONNECTOR:256,CAPABILITY:512,ALL:1023},ct={HOVERED:"HOVERED",ACTIVE:"ACTIVE",FOCUSED:"FOCUSED",UNFOCUSABLE:"UNFOCUSABLE",FOCUS_ROOT:"FOCUS_ROOT",FOCUS_REVERSE:"FOCUS_REVERSE",READ_ONLY:"READ_ONLY",DISABLED:"DISABLED",GESTURING:"GESTURING",PRESSED:"PRESSED",INVALID:"INVALID",SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",WARNED:"WARNED",CHANGED:"CHANGED",ALTERNATED:"ALTERNATED",NEW_WINDOW:"NEW_WINDOW"},ft=function(){function t(t){var n=this;this.J=new Map,this.Z=t,this.q=function(){return n.onTime()}}return Object.defineProperty(t.prototype,"interval",{get:function(){return this.Z},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.J,r=i.get(t);return null==r?((r=new Set).add(n),i.set(t,r),i.size<=1&&this.start()):r.add(n),this},t.prototype.remove=function(t,n){var i=this.J,r=i.get(t);return null!=r&&r.has(n)&&(r.delete(n),n.remove(t),r.size<=0&&i.delete(t),i.size<=0&&this.stop()),this},t.prototype.start=function(){return null==this.$&&this.onTime(),this},t.prototype.stop=function(){var t=this.$;return null!=t&&(clearTimeout(t),this.$=void 0),this},t.prototype.onTime=function(){var t=Date.now(),n=this.interval,i=this.newValue(t,n),r=this.newOn(t,n);this.J.forEach((function(t,n){t.forEach((function(t){t.set(n,i,r)}))})),this.$=window.setTimeout(this.q,Math.max(0,n-t%n))},t}(),lt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newValue=function(t,n){return null},n.prototype.newOn=function(t,n){return Math.round(t/n)%2==0},n}(ft),vt=function(){function t(t,n){this.p=t,this.tt=new Map,this.nt=n}return t.prototype.add=function(t,n){var i=this.tt,r=i.get(t);if(r===n)return this;if(null!=r){i.delete(t);var e=this.nt.get(r);null!=e&&e.remove(t,this.p)}i.set(t,n);var u=this.nt.get(n);return null==u&&(u=this.newDatum(n),this.nt.set(n,u)),u.add(t,this.p),this},t.prototype.remove=function(t){var n=this.tt.get(t);if(null==n)return this;this.tt.delete(t);var i=this.nt.get(n);return null==i||i.remove(t,this.p),this},t.prototype.set=function(t,n,i){return i?this.add(t,n):this.remove(t)},t.prototype.has=function(t){return this.tt.has(t)},t.prototype.clear=function(){var t=this,n=this.p,i=this.tt;return i.forEach((function(i,r){var e=t.nt.get(i);null!=e&&e.remove(r,n)})),i.clear(),this},t}(),bt=function(t){function n(n){return t.call(this,n,null!=P?P:P=new Map)||this}return _(n,t),n.prototype.newDatum=function(t){return new lt(t)},n}(vt),dt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newValue=function(t,n){return Math.round(t/n)},n.prototype.newOn=function(t,n){return!0},n}(ft),gt=function(t){function n(n){return t.call(this,n,null!=F?F:F=new Map)||this}return _(n,t),n.prototype.newDatum=function(t){return new dt(t)},n}(vt),mt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},wt=function(t){return"function"==typeof t},pt=function(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)},Ot=function(t){return"string"==typeof t||"[object String]"===Object.prototype.toString.call(t)},Dt=function(){function t(){this.it=new Map,this.p=null}return Object.defineProperty(t.prototype,"local",{get:function(){return this.it},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},set:function(t){this.p!==t&&(this.begin(),this.p=t,this.end())},enumerable:!1,configurable:!0}),t.prototype.onParentChange=function(t,n){this.p=n,this.begin(),this.p=t,this.end()},Object.defineProperty(t.prototype,"blinker",{get:function(){var t=this.rt;return null==t&&(t=this.newBlinker(),this.rt=t),t},enumerable:!1,configurable:!0}),t.prototype.newBlinker=function(){return new bt(this)},Object.defineProperty(t.prototype,"ticker",{get:function(){var t=this.et;return null==t&&(t=this.newTicker(),this.et=t),t},enumerable:!1,configurable:!0}),t.prototype.newTicker=function(){return new gt(this)},t.prototype.is=function(t,n){var i=this.it.get(t);return void 0!==i&&(void 0===n||n===i)},t.prototype.in=function(t,n){return this.is(t,n)||this.under(t,n)},t.prototype.on=function(t,n){var i=this.p;return null!=i&&i.is(t,n)},t.prototype.under=function(t,n){var i=this.p;return null!=i&&i.in(t,n)},t.prototype.lock=function(t){return this},t.prototype.unlock=function(){return this},t.prototype.begin=function(){return this},t.prototype.end=function(){return this},t.prototype.checkAdded=function(t,n){var i=this.it.get(t);return void 0===i||i!==n},t.prototype.add=function(t,n){return void 0===n&&(n=null),this.checkAdded(t,n)&&(this.begin(),this.it.set(t,n),this.end()),this},t.prototype.checkAddedsString=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i){var e=n.get(t[i]);if(void 0===e||null!==e)return!0}return!1},t.prototype.checkAddedsObject=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(e.state);if(void 0===u||u!==e.value)return!0}return!1},t.prototype.addAll=function(t){if(Ot(t))return this.addAllString(arguments);if(mt(t)){if(0<t.length){var n=t[0];return Ot(n)?this.addAllString(t):this.addAllObject(t)}return this}return this.addAllObject(arguments)},t.prototype.addAllString=function(t){if(this.checkAddedsString(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i)n.set(t[i],null);this.end()}return this},t.prototype.addAllObject=function(t){if(this.checkAddedsObject(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i){var e=t[i];n.set(e.state,e.value)}this.end()}return this},t.prototype.checkRemoved=function(t){return this.it.has(t)},t.prototype.remove=function(t){return this.checkRemoved(t)&&(this.begin(),this.it.delete(t),this.end()),this},t.prototype.checkRemovedsString=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i)if(n.has(t[i]))return!0;return!1},t.prototype.checkRemovedsObject=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i)if(n.has(t[i].state))return!0;return!1},t.prototype.removeAll=function(t){if(wt(t))return this.removeAllMatcher(t);if(Ot(t))return this.removeAllString(arguments);if(mt(t)){if(0<t.length){var n=t[0];return Ot(n)?this.removeAllString(t):this.removeAllObject(t)}return this}return this.removeAllObject(arguments)},t.prototype.removeAllMatcher=function(t){var n=this,i=!1,r=this.it;return r.forEach((function(e,u){t(u)&&(i||(i=!0,n.begin()),r.delete(u))})),i&&this.end(),this},t.prototype.removeAllString=function(t){if(this.checkRemovedsString(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i)n.delete(t[i]);this.end()}return this},t.prototype.removeAllObject=function(t){if(this.checkRemovedsObject(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i)n.delete(t[i].state);this.end()}return this},t.prototype.set=function(t,n,i){if(!0===n)null!=t&&this.add(t);else if(!1===n)null!=t&&this.remove(t);else{if(null!=n&&!pt(n))return this.doSet(t,null,n);if(!0===i)null!=t&&this.add(t,n);else{if(!1!==i)return this.doSet(t,n,i);null!=t&&this.remove(t)}}return this},t.prototype.doSet=function(t,n,i){return null!=t?null!=i?(this.checkAdded(t,n)||this.checkRemoved(i))&&(this.begin(),this.it.set(t,n).delete(i),this.end()):this.add(t,n):null!=i&&this.remove(i),this},t.prototype.setAll=function(t,n){if(!0===n)null!=t&&this.addAll(t);else if(!1===n)null!=t&&this.removeAll(t);else if(null!=t&&0<t.length){if(null!=n&&0<n.length){var i=t[0];return Ot(i)?this.setAllString(t,n):this.setAllObject(t,n)}this.addAll(t)}else null!=n&&this.removeAll(n);return this},t.prototype.setAllString=function(t,n){if(this.checkAddedsString(t)||this.checkRemovedsString(n)){this.begin();for(var i=this.it,r=0,e=t.length;r<e;++r)i.set(t[r],null);for(r=0,e=n.length;r<e;++r)i.delete(n[r]);this.end()}return this},t.prototype.setAllObject=function(t,n){if(this.checkAddedsObject(t)||this.checkRemovedsString(n)){this.begin();for(var i=this.it,r=0,e=t.length;r<e;++r){var u=t[r];i.set(u.state,u.value)}for(r=0,e=n.length;r<e;++r)i.delete(n[r]);this.end()}return this},t.prototype.clear=function(){var t=this.it;return 0<t.size&&(this.begin(),t.clear(),this.end()),this},t.prototype.valueOf=function(t,n){var i=this.it.get(t);if(void 0!==i)return i;var r=this.p;return null!=r?r.valueOf(t,n):n},t.prototype.each=function(t){return this.it.forEach((function(n,i){t(i,n)})),this},t.prototype.size=function(){return this.it.size},t.prototype.copy=function(n){if(n instanceof t){this.begin();var i=this.it;i.clear(),n.local.forEach((function(t,n){i.set(n,t)})),this.p=n.parent,this.end()}return this},Object.defineProperty(t.prototype,"isHovered",{get:function(){return this.is(ct.HOVERED)},set:function(t){this.set(ct.HOVERED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inHovered",{get:function(){return this.in(ct.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHovered",{get:function(){return this.on(ct.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underHovered",{get:function(){return this.under(ct.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this.is(ct.ACTIVE)},set:function(t){this.set(ct.ACTIVE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inActive",{get:function(){return this.in(ct.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onActive",{get:function(){return this.on(ct.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underActive",{get:function(){return this.under(ct.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPressed",{get:function(){return this.is(ct.PRESSED)},set:function(t){this.set(ct.PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inPressed",{get:function(){return this.in(ct.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onPressed",{get:function(){return this.on(ct.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underPressed",{get:function(){return this.under(ct.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return this.is(ct.READ_ONLY)},set:function(t){this.set(ct.READ_ONLY,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inReadOnly",{get:function(){return this.in(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onReadOnly",{get:function(){return this.on(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underReadOnly",{get:function(){return this.under(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return!this.is(ct.DISABLED)},set:function(t){this.set(ct.DISABLED,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inEnabled",{get:function(){return!this.in(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onEnabled",{get:function(){return!this.on(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underEnabled",{get:function(){return!this.under(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.is(ct.DISABLED)},set:function(t){this.set(ct.DISABLED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisabled",{get:function(){return this.in(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDisabled",{get:function(){return this.on(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underDisabled",{get:function(){return this.under(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActionable",{get:function(){return!this.in(ct.DISABLED)&&!this.in(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGesturing",{get:function(){return this.is(ct.GESTURING)},set:function(t){this.set(ct.GESTURING,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inGesturing",{get:function(){return this.in(ct.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onGesturing",{get:function(){return this.on(ct.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underGesturing",{get:function(){return this.under(ct.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocused",{get:function(){return this.is(ct.FOCUSED)},set:function(t){this.set(ct.FOCUSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocused",{get:function(){return this.in(ct.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocused",{get:function(){return this.on(ct.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocused",{get:function(){return this.under(ct.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusRoot",{get:function(){return this.is(ct.FOCUS_ROOT)},set:function(t){this.set(ct.FOCUS_ROOT,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusRoot",{get:function(){return this.in(ct.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusRoot",{get:function(){return this.on(ct.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusRoot",{get:function(){return this.under(ct.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusReverse",{get:function(){return this.is(ct.FOCUS_REVERSE)},set:function(t){this.set(ct.FOCUS_REVERSE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusReverse",{get:function(){return this.in(ct.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusReverse",{get:function(){return this.on(ct.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusReverse",{get:function(){return this.under(ct.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusable",{get:function(){return!this.is(ct.UNFOCUSABLE)},set:function(t){this.set(ct.UNFOCUSABLE,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusable",{get:function(){return!this.in(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusable",{get:function(){return!this.on(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusable",{get:function(){return!this.under(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUnfocusable",{get:function(){return this.is(ct.UNFOCUSABLE)},set:function(t){this.set(ct.UNFOCUSABLE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inUnfocusable",{get:function(){return this.in(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUnfocusable",{get:function(){return this.on(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underUnfocusable",{get:function(){return this.under(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isInvalid",{get:function(){return this.is(ct.INVALID)},set:function(t){this.set(ct.INVALID,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inInvalid",{get:function(){return this.in(ct.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onInvalid",{get:function(){return this.on(ct.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underInvalid",{get:function(){return this.on(ct.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSucceeded",{get:function(){return this.is(ct.SUCCEEDED)},set:function(t){this.set(ct.SUCCEEDED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inSucceeded",{get:function(){return this.in(ct.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSucceeded",{get:function(){return this.on(ct.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underSucceeded",{get:function(){return this.under(ct.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFailed",{get:function(){return this.is(ct.FAILED)},set:function(t){this.set(ct.FAILED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFailed",{get:function(){return this.in(ct.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFailed",{get:function(){return this.on(ct.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFailed",{get:function(){return this.under(ct.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isWarned",{get:function(){return this.is(ct.WARNED)},set:function(t){this.set(ct.WARNED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inWarned",{get:function(){return this.in(ct.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onWarned",{get:function(){return this.on(ct.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underWarned",{get:function(){return this.on(ct.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.is(ct.CHANGED)},set:function(t){this.set(ct.CHANGED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inChanged",{get:function(){return this.in(ct.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onChanged",{get:function(){return this.on(ct.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underChanged",{get:function(){return this.on(ct.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlternated",{get:function(){return this.is(ct.ALTERNATED)},set:function(t){this.set(ct.ALTERNATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inAlternated",{get:function(){return this.in(ct.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAlternated",{get:function(){return this.on(ct.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underAlternated",{get:function(){return this.on(ct.ALTERNATED)},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){var t=[];return this.it.forEach((function(n,i){t.push(i)})),{local:t}},t.prototype.toString=function(){return JSON.stringify(this.toObject())},t}(),Et=function(t){function n(n){var i=t.call(this)||this;return i.ut=n,i.st=0,i.ht=!1,i.ot=!0,i}return _(n,t),n.prototype.lock=function(t){return this.st+=1,!1===t&&(this.ot=!1),this},n.prototype.unlock=function(){return this.st-=1,this.end()},Object.defineProperty(n.prototype,"saved",{get:function(){var t=this.ct;return null==t&&(t=new Dt,this.ct=t),t},enumerable:!1,configurable:!0}),n.prototype.begin=function(){return this.ot&&!this.ht&&(this.ht=!0,this.saved.copy(this)),this},n.prototype.end=function(){return this.st<=0&&(this.ot=!0,this.ht&&(this.ht=!1,this.onChange(this,this.saved))),this},n.prototype.onChange=function(t,n){this.ut(t,n)},n}(Dt),Mt={CLICKED:"CLICKED",DBL_CLICKED:"DBL_CLICKED",DOWN:"DOWN",UP:"UP",UP_OUTSIDE:"UP_OUTSIDE",RIGHT_CLICKED:"RIGHT_CLICKED",RIGHT_DOWN:"RIGHT_DOWN",RIGHT_UP:"RIGHT_UP",RIGHT_UP_OUTSIDE:"RIGHT_UP_OUTSIDE",RIGHT_PRESSED:"RIGHT_PRESSED",ACTIVATED:"ACTIVATED",DEACTIVATED:"DEACTIVATED"},St=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onChange=function(n,i){n.isActive?i.isActive||this.it.set(Mt.ACTIVATED,null).delete(Mt.DEACTIVATED):i.isActive&&this.it.set(Mt.DEACTIVATED,null).delete(Mt.ACTIVATED),t.prototype.onChange.call(this,n,i)},Object.defineProperty(n.prototype,"isClicked",{get:function(){return this.is(Mt.CLICKED)},set:function(t){this.set(Mt.CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inClicked",{get:function(){return this.in(Mt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onClicked",{get:function(){return this.on(Mt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underClicked",{get:function(){return this.under(Mt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDblClicked",{get:function(){return this.is(Mt.DBL_CLICKED)},set:function(t){this.set(Mt.DBL_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDblClicked",{get:function(){return this.in(Mt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDblClicked",{get:function(){return this.on(Mt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDblClicked",{get:function(){return this.under(Mt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDown",{get:function(){return this.is(Mt.DOWN)},set:function(t){this.set(Mt.DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDown",{get:function(){return this.in(Mt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDown",{get:function(){return this.on(Mt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDown",{get:function(){return this.under(Mt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUp",{get:function(){return this.is(Mt.UP)},set:function(t){this.set(Mt.UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUp",{get:function(){return this.in(Mt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUp",{get:function(){return this.on(Mt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUp",{get:function(){return this.under(Mt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUpOutside",{get:function(){return this.is(Mt.UP_OUTSIDE)},set:function(t){this.set(Mt.UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUpOutside",{get:function(){return this.in(Mt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUpOutside",{get:function(){return this.on(Mt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUpOutside",{get:function(){return this.under(Mt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightClicked",{get:function(){return this.is(Mt.RIGHT_CLICKED)},set:function(t){this.set(Mt.RIGHT_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightClicked",{get:function(){return this.in(Mt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightClicked",{get:function(){return this.on(Mt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightClicked",{get:function(){return this.under(Mt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightDown",{get:function(){return this.is(Mt.RIGHT_DOWN)},set:function(t){this.set(Mt.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightDown",{get:function(){return this.in(Mt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightDown",{get:function(){return this.on(Mt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightDown",{get:function(){return this.under(Mt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUp",{get:function(){return this.is(Mt.RIGHT_UP)},set:function(t){this.set(Mt.RIGHT_UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUp",{get:function(){return this.in(Mt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUp",{get:function(){return this.on(Mt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUp",{get:function(){return this.under(Mt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUpOutside",{get:function(){return this.is(Mt.RIGHT_UP_OUTSIDE)},set:function(t){this.set(Mt.RIGHT_UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUpOutside",{get:function(){return this.in(Mt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUpOutside",{get:function(){return this.on(Mt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUpOutside",{get:function(){return this.under(Mt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightPressed",{get:function(){return this.is(Mt.RIGHT_PRESSED)},set:function(t){this.set(Mt.RIGHT_PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightPressed",{get:function(){return this.in(Mt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightPressed",{get:function(){return this.on(Mt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightPressed",{get:function(){return this.under(Mt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isActivated",{get:function(){return this.is(Mt.ACTIVATED)},set:function(t){this.set(Mt.ACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inActivated",{get:function(){return this.in(Mt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onActivated",{get:function(){return this.on(Mt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underActivated",{get:function(){return this.under(Mt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDeactivated",{get:function(){return this.is(Mt.DEACTIVATED)},set:function(t){this.set(Mt.DEACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDeactivated",{get:function(){return this.in(Mt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDeactivated",{get:function(){return this.on(Mt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDeactivated",{get:function(){return this.under(Mt.DEACTIVATED)},enumerable:!1,configurable:!0}),n}(Et),Tt=function(n){function i(i){var r=n.call(this)||this;return r.internalTransform=new t.Matrix,r.p=i,r}return _(i,n),i.prototype.onChange=function(){n.prototype.onChange.call(this),this.p.onTransformChange()},i.prototype.updateSkew=function(){n.prototype.updateSkew.call(this),this.p.onTransformChange()},i.prototype.getLocalIdCurrent=function(){return this._currentLocalID},i.prototype.getLocalId=function(){return this._localID},i.prototype.getParentId=function(){return this._parentID},i.prototype.getWorldId=function(){return this._worldID},i.prototype.updateTransform=function(t){var r=this._currentLocalID,e=this._worldID;n.prototype.updateTransform.call(this,t);var u=this._currentLocalID,s=this._worldID;if(r!==u){var h=this.localTransform,o=this.internalTransform;h.copyTo(o),t instanceof i&&o.prepend(t.internalTransform)}else e!==s&&(h=this.localTransform,o=this.internalTransform,t instanceof i&&(h.copyTo(o).prepend(t.internalTransform),this._currentLocalID+=1,this._localID=this._currentLocalID))},i}(t.Transform),jt=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0,this.strokeWidth=0,this.strokeScale=1,this.strokeAlign=0}return t.prototype.set=function(t,n,i,r,e,u,s){return this.x=t,this.y=n,this.width=i,this.height=r,this.strokeWidth=e,this.strokeScale=u,this.strokeAlign=s,this},t}(),Nt=function(t,n,i,r){return-i<=t&&t<=+i&&-r<=n&&n<=+r},It=function(t){for(var n=t.points,i="[".concat(t.direction),r=0,e=n.length,u=1;r<e;r+=1,u+=3){var s=n[r];i+=",".concat(s.color,",").concat(s.alpha,",").concat(s.position)}return i+"]"},Ct={NONE:0,ID:1,POSITION:2,WIDTH:4,HEIGHT:8,ROTATION:16,SKEW:32,ALIGN:0,REPLACING:64,GROUPING:128,UNGROUPING:256,FILL:512,STROKE:1024,STROKE_SIDE:2048,BORDER_RADIUS:4096,TEXT:8192,TEXTURE:16384,TAG:32768,DATA:32768,DATA_MAPPING:1048576,ACTION:65536,CURSOR:131072,ORDER_IN_LAYER:262144,CHILDREN:524288,COORDINATE:62,SHAPE:1728,LAYER:262144,PRIMITIVE:1042175,GROUP:1042431,EMBEDDED:1417471,CONNECTOR:1041985,ALL:2097151},At=function(){function t(){this.added=Ct.NONE,this.removed=Ct.NONE,this.locked=Ct.NONE}return t.prototype.add=function(t){return this.removed&=~t,this.added|=t,this},t.prototype.remove=function(t){return this.added&=~t,this.removed|=t,this},t.prototype.lock=function(t){return this.locked|=t,this},t.prototype.unlock=function(t){return this.locked&=~t,this},t.prototype.clear=function(){return this.added=Ct.NONE,this.removed=Ct.NONE,this.locked=Ct.NONE,this},t.prototype.set=function(t,n,i){return null!=t&&(this.added=t),null!=n&&(this.removed=n),null!=i&&(this.locked=i),this},t.prototype.copy=function(t){return this.added=t.added,this.removed=t.removed,this.locked=t.locked,this},t}(),Rt=function(n){function i(t){var i=n.call(this)||this;return i.id="",i.uuid=0,i.type=t,i.transform=i.newTransform(),i.ft=0,i.lt=!1,i.action=new ht,i.vt=!0,i.bt=0,i.gt=!1,i.wt=!1,i.Ot=NaN,i.Dt=NaN,i.Et=NaN,i.interactive=!1,i.parent=null,i.children=[],i.selected=!1,i.index=0,i.reference=0,i}return _(i,n),i.prototype.newTransform=function(){return new Tt(this)},i.prototype.onSizeChange=function(){this.Ot=NaN,this.Dt=NaN,this.Et=NaN,this.Mt(),this.updateUploaded();var t=this.St;null!=t&&t.fit(!0);var n=this.runtime;null!=n&&n.onResize(this)},i.prototype.onTransformChange=function(){this.Mt(),this.onParentTransformChange()},i.prototype.onParentTransformChange=function(){this.updateUploaded();var t=this.St;null!=t&&t.fit(!0);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onParentTransformChange()},i.prototype.Mt=function(){if(0===this.ft){var t=this.parent;null!=t&&t.onChildTransformChange()}else this.lt=!0},i.prototype.disallowOnTransformChange=function(){this.ft+=1,1===this.ft&&(this.lt=!1)},i.prototype.allowOnTransformChange=function(t){this.ft-=1,0===this.ft&&this.lt&&(this.lt=!1,t&&this.onTransformChange())},i.prototype.onChildTransformChange=function(){},i.prototype.disallowUploadedUpdate=function(){this.bt+=1,1===this.bt&&(this.gt=!1,this.wt=!1)},i.prototype.allowUploadedUpdate=function(){this.bt-=1,0===this.bt&&(this.wt?(this.wt=!1,this.gt=!1,this.updateUploadedRecursively()):this.gt&&(this.gt=!1,this.updateUploaded()))},i.prototype.updateUploadedRecursively=function(){if(0===this.bt){this.updateUploaded();for(var t=this.children,n=0,i=t.length;n<i;++n)t[n].updateUploadedRecursively()}else this.wt=!0},i.prototype.updateUploaded=function(){if(0===this.bt){var t=this.uploaded;null!=t&&t.update(this)}else this.gt=!0},Object.defineProperty(i.prototype,"image",{get:function(){return this.Tt},set:function(t){this.Tt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){for(var t=this;t.parent instanceof i;)t=t.parent;return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"connector",{get:function(){var t=this.St;return null==t&&(t=new ot(this),this.St=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){if(this.vt){var t=this.parent;return!(t instanceof i)||t.visible}return!1},set:function(t){this.vt!==t&&(this.vt=t,this.updateUploadedRecursively())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"worldVisible",{get:function(){if(this.vt){var t=this.parent;return!t||t.worldVisible}return!1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){var t=this.parent;null!=t&&t.toDirty()},i.prototype.attach=function(t,n){this.detach(),this.parent=t;var i=t.children;return null!=n&&0<=n&&n<i.length?i.splice(n,0,this):i.push(this),t.onChildTransformChange(),t.toDirty(),this.onAttach(),this},i.prototype.onAttach=function(){this.uploaded=void 0;var t=this.St;t&&(t.attach(),t.fit(!0));for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onAttach()},i.prototype.detach=function(){var t=this.parent;if(t){this.parent=null;var n=t.children,i=n.indexOf(this);0<=i&&(n.splice(i,1),t.onChildTransformChange(),t.toDirty(),this.onDetach())}return this},i.prototype.onDetach=function(){this.uploaded=void 0;var t=this.St;t&&t.detach();for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onDetach()},i.prototype.updateTransform=function(){var n=this.parent;n?(n.parent&&n.updateTransform(),this.transform.updateTransform(n.transform)):this.transform.updateTransform(t.Transform.IDENTITY)},i.prototype.serializeChildren=function(t){for(var n=this.children,i=[],r=0,e=n.length;r<e;++r){var u=n[r];i.push(u.serialize(t))}return i},i.prototype.serializeImage=function(t){var n=this.Tt;return null!=n?t.addResource(n.src):-1},i.prototype.serializeGradient=function(t){var n=this.gradient;return null!=n?(null==n.serialized&&(n.serialized=It(n)),t.addResource(n.serialized)):-1},i.prototype.serializeState=function(t){var n=this.state;return(this.interactive?1:0)|(n.isFocusable?0:2)|(n.isActive?4:0)},i.prototype.serialize=function(t){var n=this.transform,i=n.position,r=n.pivot,e=this.size,u=this.shortcut,s=null!=u?t.addResource(u):-1,h=this.cursor,o=null!=h?t.addResource(h):-1,a=this.title,c=null!=a?t.addResource(a):-1,f=Ct.NONE,l=Ct.NONE,v=Ct.NONE,b=this.Nt;return null!=b&&(f=b.added,l=b.removed,v=b.locked),[this.type,t.addResource(this.id),i.x,i.y,e.x,e.y,n.rotation,n.skew.x,this.fill.serialize(t),this.stroke.serialize(t),o,this.text.serialize(t),this.data.serialize(t),this.radius,this.corner,-1,-1,this.action.serialize(t),this.serializeImage(t),this.serializeGradient(t),this.serializeChildren(t),r.x,r.y,this.serializeState(t),s,c,this.uuid,f,l,v]},i.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},i.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},i.prototype.getShapeScale=function(){var t=this.root.parent;return null!=t&&null!=t.getShapeScale?t.getShapeScale():1},i.prototype.getStrokeWidthScale=function(t){return t&s.NON_EXPANDING_WIDTH?t&s.NON_SHRINKING_WIDTH?this.getShapeScale():Math.min(1,this.getShapeScale()):t&s.NON_SHRINKING_WIDTH?Math.max(1,this.getShapeScale()):1},i.prototype.getHitTestSize=function(t){var n=this.size;return t.width=.5*n.x,t.height=.5*n.y,t},i.prototype.toHitTestData=function(t,n){var r,e=this.getHitTestSize(null!==(r=i.WORK_HIT_TEST_DATA)&&void 0!==r?r:i.WORK_HIT_TEST_DATA=new jt),u=e.width,s=e.height,h=this.transform.pivot,o=t-h.x,a=n-h.y,c=this.stroke,f=c.enable?c.width:0,l=this.getStrokeWidthScale(c.style),v=c.align,b=f*l*v;return e.set(0<=u?+o:-o,0<=s?+a:-a,Math.abs(u)+b,Math.abs(s)+b,f,l,v)},i.prototype.contains=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbs(i.x,i.y,i.width,i.height,i.strokeWidth,i.strokeScale,i.strokeAlign)?this:this.containsText(t,n)||this.containsChildren(t,n)},i.prototype.containsText=function(t,n){var i=this.text;if(null!=i.atlas){var r=i.world;if(null!=r){var e=this.transform.internalTransform,u=e.a*t+e.c*n+e.tx-r[0],s=e.b*t+e.d*n+e.ty-r[1],h=r[2]*u+r[3]*s,o=r[4]*u+r[5]*s,a=r[6],c=r[7];if(0<=h&&h<=a&&0<=o&&o<=c)return this}}return null},i.prototype.containsChildren=function(t,n){for(var i=this.children,r=i.length-1;0<=r;--r){var e=i[r];e.updateTransform();var u=e.transform.localTransform,s=u.a,h=u.b,o=u.c,a=u.d,c=u.tx,f=u.ty,l=1/(s*a-o*h),v=(a*t-o*n+f*o-c*a)*l,b=(s*n-h*t-f*s+c*h)*l,d=e.contains(v,b);if(null!=d)return d}return null},i.prototype.containsBBox=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbsBBox(i.x,i.y,i.width,i.height)},i.prototype.containsAbs=function(t,n,i,r,e,u,s){return this.containsAbsBBox(t,n,i,r)},i.prototype.containsAbsBBox=function(t,n,i,r){return Nt(t,n,i,r)},i.prototype.select=function(t){return!1},i.prototype.toGlobal=function(t,n,i){return!0!==i&&this.updateTransform(),n.copyFrom(t),this.transform.worldTransform.apply(n,n),n},i.prototype.toLocal=function(n,i,r,e){return!0!==e&&this.updateTransform(),void 0===r&&(r=new t.Point),r.copyFrom(n),this.transform.worldTransform.applyInverse(r,r),r},i.prototype.getBounds=function(n,i){!0!==n&&this.updateTransform();var r=this._bounds||new t.Rectangle;this._bounds=r;var e=this.transform.getWorldId();return e!==this.Ot&&(this.Ot=e,this.It(this.transform.worldTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsInternal=function(n,i){!0!==n&&this.updateTransform();var r=this.Ct||new t.Rectangle;this.Ct=r;var e=this.transform.getLocalIdCurrent();return e!==this.Dt&&(this.Dt=e,this.It(this.transform.internalTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsLocal=function(n,i){!0!==n&&this.updateTransform();var r=this.At||new t.Rectangle;this.At=r;var e=this.transform.getLocalIdCurrent();return e!==this.Et&&(this.Et=e,this.It(this.transform.localTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsSize=function(){return this.size},i.prototype.It=function(t,n){var i=this.transform.pivot,r=i.x,e=i.y,u=this.getBoundsSize(),s=.5*u.x,h=.5*u.y,o=t.a,a=t.b,c=t.c,f=t.d,l=-s+r,v=-h+e,b=o*l+c*v,d=a*l+f*v,g=o*(l=+s+r)+c*(v=-h+e),m=a*l+f*v,w=o*(l=-s+r)+c*(v=+h+e),p=a*l+f*v,O=o*(l=+s+r)+c*(v=+h+e),D=a*l+f*v,E=Math.min(b,g,w,O),M=Math.min(d,m,p,D),S=Math.max(b,g,w,O),T=Math.max(d,m,p,D);return n.x=E+t.tx,n.y=M+t.ty,n.width=S-E,n.height=T-M,n},i.prototype.destroy=function(){for(var t=this.children,n=t.length-1;0<=n;--n)t[n].destroy();t.length=0},i.prototype.onStateChange=function(t,n){var r=this.runtime;null!=r&&r.onStateChange(this,t,n);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}},Object.defineProperty(i.prototype,"state",{get:function(){var t=this,n=this.Rt;return null==n&&(n=new St((function(n,i){t.onStateChange(n,i)})),this.Rt=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"capability",{get:function(){var t=this.Nt;return null==t&&(t=new At,this.Nt=t),t},enumerable:!1,configurable:!0}),i.prototype.getCapability=function(){return this.Nt},i.prototype.focus=function(){return this.setFocused(!0),this},i.prototype.blur=function(){return this.setFocused(!1),this},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=st.getLayer(this);n&&n.getFocusController().set(this,t)}},i.prototype.onKeyDown=function(t){var n=this.runtime;return!!n&&n.onKeyDown(this,t)},i.prototype.onKeyUp=function(t){var n=this.runtime;return!!n&&n.onKeyUp(this,t)},i.prototype.update=function(t){var n=this.runtime;n&&n.update(this,t)},i.prototype.onRender=function(t,n){var i=this.runtime;i&&i.onRender(this,t,n)},i.prototype.updateRecursively=function(t){this.update(t);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].update(t)},i.prototype.copy=function(t,n){if(void 0===n&&(n=at.ALL),this.id=t.id,this.uuid=t.uuid,n&at.TRANSFORM){var r=this.transform,e=t.transform;r.position.copyFrom(e.position),r.rotation=e.rotation,r.skew.copyFrom(e.skew),r.pivot.copyFrom(e.pivot),r.scale.copyFrom(e.scale)}if(n&at.SIZE&&this.size.copyFrom(t.size),n&at.STYLE&&(this.fill.copy(t.fill),this.stroke.copy(t.stroke),this.text.copy(t.text),this.radius=t.radius,this.corner=t.corner),n&at.DATA&&this.data.copy(t.data),n&at.IMAGE&&(this.image=t.image),n&at.ACTION&&(this.action.clearAndAddAll(t.action.values),this.interactive=t.interactive,this.cursor=t.cursor,this.shortcut=t.shortcut),n&at.POINTS){var u=t.points;if(null!=u){var s=this.points;null!=s&&s.copy(u)}}if(n&at.STATE&&this.state.lock(!1).copy(t.state).unlock(),n&at.CONNECTOR)if(t instanceof i){var h=t.St;h?this.connector.copy(h):(o=this.St)&&o.clear()}else{var o;(o=this.St)&&o.clear()}if(n&at.CAPABILITY){var a=t.getCapability();if(null!=a)this.capability.copy(a);else{var c=this.Nt;null!=c&&c.clear()}}return this},i}(t.utils.EventEmitter),kt=function(){function t(t,n,i,r,e,u,s,h){this.p=t,this.O=n,this.S=i,this.T=r,this.kt=e,this.Lt=u,this.yt=s,this.B=h}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this.Lt},set:function(t){this.Lt!==t&&(this.Lt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return this.yt},set:function(t){this.yt!==t&&(this.yt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width,t.align,t.side,t.style)},t.prototype.set=function(t,n,i,r,e,u,s){var h=!1;void 0!==t&&this.O!==t&&(this.O=t,h=!0),void 0!==n&&this.S!==n&&(this.S=n,h=!0),void 0!==i&&this.T!==i&&(this.T=i,h=!0),void 0!==r&&this.kt!==r&&(this.kt=r,h=!0),void 0!==e&&this.Lt!==e&&(this.Lt=e,h=!0),void 0!==u&&this.yt!==u&&(this.yt=u,h=!0),void 0!==s&&this.B!==s&&(this.B=s,h=!0),h&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T,this.kt,this.Lt,this.yt,this.B)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T,width:this.kt,align:this.Lt,side:this.yt,style:this.B}},t.prototype.serialize=function(t){var n=this.O?1:0,i="[".concat(n,",").concat(this.S,",").concat(this.T,",").concat(this.kt,",").concat(this.Lt,",").concat(this.yt,",").concat(this.B,"]");return t.addResource(i)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getStroke(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3],r[4],r[5],r[6]);else{var e=JSON.parse(i[t]);n.setStroke(t,e),this.set(!!e[0],e[1],e[2],e[3],e[4],e[5],e[6])}}},t}(),Lt={NONE:0,FROM:1,TO:2,FROM_TO:3},yt=function(){function t(){this.xt=Lt.NONE,this.Bt=0,this.Pt=1}return Object.defineProperty(t.prototype,"type",{get:function(){return this.xt},set:function(t){if(this.xt!==t){this.xt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},set:function(t){if(this.Bt!==t){this.Bt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},set:function(t){if(this.Pt!==t){this.Pt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;if(void 0!==t&&void 0!==n)if(null!==t&&null!==n){var r=this.xt|Lt.FROM|Lt.TO;this.xt===r&&this.Bt===t&&this.Pt===n||(this.xt=r,this.Bt=t,this.Pt=n,i=!0)}else null!==t?(r=(this.xt|Lt.FROM)&~Lt.TO,this.xt===r&&this.Bt===t||(this.xt=r,this.Bt=t,i=!0)):null!==n?(r=(this.xt|Lt.TO)&~Lt.FROM,this.xt===r&&this.Bt===t||(this.xt=r,this.Pt=n,i=!0)):(r=this.xt&~(Lt.TO|Lt.FROM),this.xt!==r&&(this.xt=r,i=!0));else void 0!==t?null!==t?(r=this.xt|Lt.FROM,this.xt===r&&this.Bt===t||(this.xt=r,this.Bt=t,i=!0)):(r=this.xt&~Lt.FROM,this.xt!==r&&(this.xt=r,i=!0)):void 0!==n&&(null!==n?(r=this.xt|Lt.TO,this.xt===r&&this.Pt===n||(this.xt=r,this.Pt=n,i=!0)):(r=this.xt&~Lt.TO,this.xt!==r&&(this.xt=r,i=!0)));if(i){var e=this.parent;null!=e&&(e.isChanged=!0)}return i},t.prototype.normalize=function(t){var n=this.xt,i=this.Bt,r=this.Pt;switch(n){case Lt.FROM_TO:return(t-i)/(r-i);case Lt.FROM:return t-i;case Lt.TO:return r-t;case Lt.NONE:default:return t}},t.prototype.isEquals=function(t){return this.xt===t.type&&this.Bt===t.from&&this.Pt===t.to},t.prototype.copy=function(t){return this.Ft(t.type,t.from,t.to)},t.prototype.Ft=function(t,n,i){var r=!1;if(this.xt!==t&&(this.xt=t,r=!0),this.Bt!==n&&(this.Bt=n,r=!0),this.Pt!==i&&(this.Pt=i,r=!0),r){var e=this.parent;null!=e&&(e.isChanged=!0)}return this},t.prototype.toObject=function(){return{type:this.type,from:this.from,to:this.to}},t.prototype.serialize=function(t){var n="[".concat(this.xt,",").concat(this.Bt,",").concat(this.Pt,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getRange(t);if(null!=r)this.Ft(r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setRange(t,e),this.Ft(e[0],e[1],e[2])}}},t}(),xt={ASCENDING:0,DESCENDING:1},Bt={BOOLEAN:7,BOOLEAN_ARRAY:8,NUMBER:0,NUMBER_ARRAY:1,STRING:2,STRING_ARRAY:3,OBJECT:4,OBJECT_ARRAY:5,TICKER:6,EXTENSION:1e3},_t={PRIVATE:0,PUBLIC:1,PROTECTED:2},Pt={UNKNOWN:-1,FOUND:0,NOT_FOUND:1,BAD_REQUEST:2,SERVER_ERROR:3,SERVICE_UNAVAILABLE:4,FORBIDDEN:5,NOT_DEFINED:6},Ft=function(t,n){return t-n},Ut=function(){function t(){this.id="",this.as="",this.type=Bt.NUMBER,this.scope=_t.PUBLIC,this.initial="",this.format="",this.range=new yt,this.Ut=0,this.Gt=0,this.Rt=Pt.UNKNOWN,this.Ht=0,this.zt=xt.ASCENDING}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},set:function(t){this.p!==t&&(this.p=t,this.range.parent=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Ut},set:function(t){var n=this.formatter;null!=n&&(t=n(t));var i=this.Ht;if(i<=0){if(this.Ut!==t){this.Ut=t;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.k;null==e&&(e=[],this.k=e),this.Ut=t;var u=this.zt;u===xt.ASCENDING?e.push(t):e.unshift(t);var s=e.length-i;if(0<s)if(u===xt.ASCENDING)for(var h=0;h<s;++h)e.shift();else e.length=i;var o=this.parent;null!=o&&(o.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){return this.range.normalize(this.Ut)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.k;return null==t&&(t=[],this.k=t),t},set:function(t){var n=t.length;if(0<n){var i=this.Ht;if(i<=0){var r=t[n-1];if(null!=(s=this.formatter)&&(r=s(r)),this.Ut!==r){this.Ut=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.k;null==u&&(u=[],this.k=u);var s,h=this.zt;if(null!=(s=this.formatter))if(this.Ut=s(t[n-1]),h===xt.ASCENDING)for(var o=0;o<n;++o)u.push(s(t[o]));else for(o=0;o<n;++o)u.unshift(s(t[o]));else if(this.Ut=t[n-1],h===xt.ASCENDING)for(o=0;o<n;++o)u.push(t[o]);else for(o=0;o<n;++o)u.unshift(t[o]);var a=u.length-i;if(0<a)if(h===xt.ASCENDING)for(o=0;o<a;++o)u.shift();else u.length=i;var c=this.parent;null!=c&&(c.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.Gt},set:function(t){var n=this.Ht;if(n<=0){if(this.Gt!==t){this.Gt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Vt;null==r&&(r=[],this.Vt=r),this.Gt=t;var e=this.zt;e===xt.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===xt.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"times",{get:function(){var t=this.Vt;return null==t&&(t=[],this.Vt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.Ht;if(i<=0){var r=t[n-1];if(this.Gt!==r){this.Gt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.Vt;null==u&&(u=[],this.Vt=u),this.Gt=t[n-1];var s=this.zt;if(s===xt.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===xt.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.Rt},set:function(t){var n=this.Ht;if(n<=0){if(this.Rt!==t){this.Rt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Wt;null==r&&(r=[],this.Wt=r),this.Rt=t;var e=this.zt;e===xt.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===xt.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"states",{get:function(){var t=this.Wt;return null==t&&(t=[],this.Wt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.Ht;if(i<=0){var r=t[n-1];if(this.Rt!==r){this.Rt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.Wt;null==u&&(u=[],this.Wt=u),this.Rt=t[n-1];var s=this.zt;if(s===xt.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===xt.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){return this.Ht},set:function(t){if(this.Ht<t)this.Ht=t;else if(t<this.Ht){this.Ht=t;var n=!1,i=this.zt,r=this.k;if(null!=r&&0<(s=r.length-t)){if(i===xt.ASCENDING)for(var e=0;e<s;++e)r.shift();else r.length=t;n=!0}var u=this.Vt;if(null!=u&&0<(s=u.length-t)){if(i===xt.ASCENDING)for(e=0;e<s;++e)u.shift();else u.length=t;n=!0}var s,h=this.Wt;if(null!=h&&0<(s=h.length-t)){if(i===xt.ASCENDING)for(e=0;e<s;++e)h.shift();else h.length=t;n=!0}if(n){var o=this.parent;null!=o&&(o.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.zt},set:function(t){this.zt=t},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){var n=!1,i=this.k;null!=i&&0<=t&&t<i.length&&(i.splice(t,1),n=!0);var r=this.Vt;null!=r&&0<=t&&t<r.length&&(r.splice(t,1),n=!0);var e=this.Wt;if(null!=e&&0<=t&&t<e.length&&(e.splice(t,1),n=!0),n){var u=this.parent;null!=u&&(u.isChanged=!0)}},t.prototype.removeAll=function(t){var n=!1,i=t.slice(0).sort(Ft),r=i.length,e=this.k;if(null!=e)for(var u=r-1;0<=u;--u)0<=(o=i[u])&&o<e.length&&(e.splice(o,1),n=!0);var s=this.Vt;if(null!=s)for(u=r-1;0<=u;--u)0<=(o=i[u])&&o<s.length&&(s.splice(o,1),n=!0);var h=this.Wt;if(null!=h)for(u=r-1;0<=u;--u){var o;0<=(o=i[u])&&o<h.length&&(h.splice(o,1),n=!0)}if(n){var a=this.parent;null!=a&&(a.isChanged=!0)}},t.prototype.clear=function(){var t=!1,n=this.k;null!=n&&(n.length=0,t=!0);var i=this.Vt;null!=i&&(i.length=0,t=!0);var r=this.Wt;if(null!=r&&(r.length=0,t=!0),t){var e=this.parent;null!=e&&(e.isChanged=!0)}},t.prototype.toDirty=function(){var t=this.parent;null!=t&&(t.isChanged=!0)},t.prototype.copy=function(t){return this.id=t.id,this.as=t.as,this.type=t.type,this.scope=t.scope,this.initial=t.initial,this.format=t.format,this.formatter=t.formatter,this.range.copy(t.range),this.Ut=t.value,this.Gt=t.time,this.Rt=t.state,this.Ht=t.capacity,this},t.prototype.isEquals=function(t){return this.id===t.id&&this.as===t.as&&this.type===t.type&&this.scope===t.scope&&this.initial===t.initial&&this.formatter===t.formatter&&this.range.isEquals(t.range)},t.prototype.serialize=function(t){var n=t.addData(this.id),i=t.addResource(this.as),r=t.addResource(this.initial),e=t.addResource(this.format.trim()),u=this.range.serialize(t);return t.addResource("[".concat(n,",").concat(r,",").concat(e,",").concat(u,",").concat(this.Ht,",").concat(this.zt,",").concat(this.type,",").concat(this.scope,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i,r,e=n.resources;if(0<=t&&t<e.length){var u=n.getDataValue(t);null==u&&(u=JSON.parse(e[t]),n.setDataValue(t,u)),this.id=n.data[u[0]]||"";var s=u[8];this.as=null!=s&&e[s]||"",this.type=null!==(i=u[6])&&void 0!==i?i:Bt.NUMBER,this.scope=null!==(r=u[7])&&void 0!==r?r:_t.PUBLIC,this.initial=e[u[1]]||"",this.format=e[u[2]]||"",this.range.deserialize(u[3],n),this.Ht=u[4],this.zt=u[5]}return this},t}(),Gt=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if((e=n[i])===t)return i;for(i=0,r=n.length;i<r;++i){var e;if((e=n[i])[0]===t[0]&&e[1]===t[1]&&e[2]===t[2])return i}return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.copy=function(t){this.clearAndAddAll(t.values)},t.prototype.serialize=function(t){var n=this.values;if(n.length<=0)return-1;for(var i="[",r="",e=0,u=n.length;e<u;++e){var s=n[e],h=t.addResource(s[0]),o=t.addResource(s[1]),a=t.addResource(s[2]);i+="".concat(r).concat(h,",").concat(o,",").concat(a),r=","}return i+="]",t.addResource(i)},t.prototype.deserialize=function(t,n){var i=this.values;i.length=0;var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataMapping(t);null==u&&(u=JSON.parse(r[t]),n.setDataMapping(t,u));for(var s=0,h=u.length;s<h;s+=3){var o=u[s],a=u[s+1],c=u[s+2];i.push([0<=o&&o<e?r[o]:"",0<=a&&a<e?r[a]:"",0<=c&&c<e?r[c]:""])}}},t}(),Ht=function(){function t(){}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Xt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i,r=null!==(i=this.Xt)&&void 0!==i?i:this.Xt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Xt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),c.value=n}return!0},t.prototype.toDirty=function(t){var n=this.Xt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.each=function(t){var n=this.Xt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t}(),zt=function(){function t(){this.Xt=new Map}return t.prototype.set=function(t,n){return this.Xt.set(t,n),this},t.prototype.get=function(t){var n;return null!==(n=this.Xt.get(t))&&void 0!==n?n:null},t.prototype.contains=function(t){return this.Xt.has(t)},t.prototype.remove=function(t){var n=this.Xt,i=n.get(t);return n.delete(t),null!=i?i:null},t.prototype.clear=function(){return this.Xt.clear(),this},t.prototype.size=function(){return this.Xt.size},t.prototype.each=function(t){var n=!1;return this.Xt.forEach((function(i,r){n||!1===t(i,r)&&(n=!0)})),this},t.prototype.copy=function(t){var n=this.Xt;return n.clear(),t.each((function(t,i){n.set(i,t)})),this},t.prototype.serialize=function(t){var n=this.Xt;if(n.size<=0)return-1;var i=[];return n.forEach((function(n,r){var e=t.addResource(n),u=t.addResource(r);i.push(u,e)})),t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=this.Xt;i.clear();var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataSystem(t);null==u&&(u=JSON.parse(r[t]),n.setDataSystem(t,u));for(var s=0,h=u.length;s<h;s+=2){var o=u[s];if(0<=o&&o<e){var a=r[o],c=u[s+1];0<=c&&c<e&&i.set(a,r[c])}}}},t}(),Vt=function(){function t(){this.k=[],this.Kt=!0}return Object.defineProperty(t.prototype,"values",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.Kt},set:function(t){this.Kt=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.k;return 0<t.length?t[0].id:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"as",{get:function(){var t=this.k;return 0<t.length?t[0].as:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var t=this.k;return 0<t.length?t[0].type:Bt.NUMBER},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scope",{get:function(){var t=this.k;return 0<t.length?t[0].scope:_t.PRIVATE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initial",{get:function(){var t=this.k;return 0<t.length?t[0].initial:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){var t=this.k;return 0<t.length?t[0].format:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.k;return 0<t.length?t[0].range:null!=U?U:U=new yt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this.k;return 0<t.length?t[0].value:0},set:function(t){var n=this.k;0<n.length&&(n[0].value=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){var t=this.k;return 0<t.length?t[0].nvalue:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){var t=this.k;return 0<t.length?t[0].time:0},set:function(t){var n=this.k;0<n.length&&(n[0].time=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){var t=this.k;return 0<t.length?t[0].state:Pt.UNKNOWN},set:function(t){var n=this.k;0<n.length&&(n[0].state=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){var t=this.k;return 0<t.length?t[0].capacity:0},set:function(t){var n=this.k;0<n.length&&(n[0].capacity=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alias",{get:function(){var t=this.Yt;return null==t&&(t=this.newAlias(),this.Yt=t),t},enumerable:!1,configurable:!0}),t.prototype.newAlias=function(){var t=this.k,n=t.length;if(0<n){for(var i={},r=0;r<n;++r){var e=t[r];i[e.as||e.id]=e}return i}return null!=G?G:G={}},Object.defineProperty(t.prototype,"mapping",{get:function(){var t=this.Jt;return null==t&&(t=this.newMapping(),this.Jt=t),t},enumerable:!1,configurable:!0}),t.prototype.newMapping=function(){return new Gt},t.prototype.getMapping=function(){return this.Jt},Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Zt;return null==t&&(t=this.newPrivate(),this.Zt=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new Ht},t.prototype.getPrivate=function(){return this.Zt},Object.defineProperty(t.prototype,"system",{get:function(){var t=this.qt;return null==t&&(t=this.newSystem(),this.qt=t),t},enumerable:!1,configurable:!0}),t.prototype.newSystem=function(){return new zt},t.prototype.getSystem=function(){return this.qt},t.prototype.add=function(t,n){var i=this.k;t.parent=this,void 0===n?i.push(t):i.splice(n,0,t)},t.prototype.set=function(t,n){var i=this.k;if(0<=t&&t<i.length){var r=i[t];return n.parent=this,i[t]=n,r.parent=void 0,r}return null},t.prototype.remove=function(t){var n=this.k;0<=t&&t<n.length&&(n.splice(t,1)[0].parent=void 0)},t.prototype.indexOf=function(t){for(var n=this.k,i=n.length,r=0;r<i;++r)if(n[r]===t)return r;for(r=0;r<i;++r)if(n[r].isEquals(t))return r;for(r=0;r<i;++r)if(n[r].id===t.id)return r;return-1},t.prototype.get=function(t){var n=this.k;return 0<=t&&t<n.length?n[t]:null},t.prototype.size=function(){return this.k.length},t.prototype.swap=function(t,n){var i=this.k,r=i[n];i[n]=i[t],i[t]=r},t.prototype.copy=function(t){var n=this.k;n.length=0;for(var i=0,r=t.size();i<r;++i){var e=t.get(i);if(null!=e){var u=(new Ut).copy(e);u.parent=this,n.push(u)}}var s=t.getMapping();s&&this.mapping.copy(s);var h=t.getSystem();return h&&this.system.copy(h),this},t.prototype.serialize=function(t){for(var n=this.k,i=[],r=0,e=n.length;r<e;++r)i.push(n[r].serialize(t));var u,s=this.Jt;return null!=s?(i.push(s.serialize(t)),null!=(u=this.qt)?t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]")):t.addResource("[".concat(JSON.stringify(i),"]"))):null!=(u=this.qt)?(i.push(-1),t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]"))):t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getData(t);null==r&&(r=JSON.parse(i[t]),n.setData(t,r));var e=this.k;if(e.length=0,this.isMapped(r)){for(var u=r[0],s=u.length,h=0,o=s-1;h<o;++h){var a=u[h];(l=new Ut).parent=this,l.deserialize(a,n),e.push(l)}var c=u[s-1];0<=c&&this.mapping.deserialize(c,n);var f=r[1];null!=f&&0<=f&&this.system.deserialize(f,n)}else for(h=0,o=r.length;h<o;++h){var l;a=r[h],(l=new Ut).parent=this,l.deserialize(a,n),e.push(l)}}},t.prototype.isMapped=function(t){return 0<t.length&&mt(t[0])},t}(),Wt=function(){function t(t,n,i){this.p=t,this.Qt=n,this.$t=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Qt},set:function(t){this.Qt!==t&&(this.Qt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.$t},set:function(t){this.$t!==t&&(this.$t=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Qt!==t&&(this.Qt=t,i=!0),null!=n&&this.$t!==n&&(this.$t=n,i=!0),i&&this.p.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Qt,vertical:this.$t}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Qt,",").concat(this.$t,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getAlign(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setAlign(t,e),this.set(e[0],e[1])}}},t}(),Xt=function(){function t(t,n,i){this.p=t,this.Qt=n,this.$t=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Qt},set:function(t){this.Qt!==t&&(this.Qt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.$t},set:function(t){this.$t!==t&&(this.$t=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Qt!==t&&(this.Qt=t,i=!0),null!=n&&this.$t!==n&&(this.$t=n,i=!0),i&&this.p.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Qt,vertical:this.$t}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Qt,",").concat(this.$t,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getMargin(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setMargin(t,e),this.set(e[0],e[1])}}},t}(),Kt=function(){function t(t,n,i,r,e){this.p=t,this.O=n,this.S=i,this.T=r,this.kt=e}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width)},t.prototype.set=function(t,n,i,r){var e=!1;void 0!==t&&this.O!==t&&(this.O=t,e=!0),void 0!==n&&this.S!==n&&(this.S=n,e=!0),void 0!==i&&this.T!==i&&(this.T=i,e=!0),void 0!==r&&this.kt!==r&&(this.kt=r,e=!0),e&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T,this.kt)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T,width:this.kt}},t.prototype.serialize=function(t){var n="[".concat(this.O?1:0,",").concat(this.S,",").concat(this.T,",").concat(this.kt,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getTextOutline(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3]);else{var e=JSON.parse(i[t]);n.setTextOutline(t,e),this.set(!!e[0],e[1],e[2],e[3])}}},t}(),Yt=function(){function t(t,n,i,r,e,u){this.p=t,this.O=!0,this.Ut=n,this.S=i,this.T=r,this.tn=e,this.j=u,this.nn=d.NORMAL,this.align=new Wt(t,m.CENTER,w.MIDDLE),this.offset=new Xt(t,0,0),this.B=g.NORMAL,this.spacing=new Xt(t,0,0),this.outline=new Kt(t,!1,16777215,1,.5),this.rn=p.LEFT_TO_RIGHT,this.padding=new Xt(t,10,10),this.en=!1,this.un=!1}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Ut},set:function(t){if(this.Ut!==t){this.Ut=t;var n=this.p,i=n.uploaded;if(null==i||!i.isCompatible(n))return this.atlas=void 0,void n.toDirty();var r=this.atlas,e=r&&r.characters;if(null==e)return this.atlas=void 0,void n.toDirty();for(var u=0,s=t.length;u<s;++u)if(!(t[u]in e))return this.atlas=void 0,void n.toDirty();n.updateUploaded()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){return this.tn},set:function(t){this.tn!==t&&(this.tn=t,this.p.toDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this.nn},set:function(t){this.nn!==t&&(this.nn=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this.rn},set:function(t){this.rn!==t&&(this.rn=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){return this.en},set:function(t){this.en!==t&&(this.en=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fitting",{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return t&&(this.set(t.value,t.color,t.alpha,t.family,t.size,t.weight,t.style,t.direction,t.clipping,t.fitting),this.align.copy(t.align),this.offset.copy(t.offset),this.outline.copy(t.outline),this.spacing.copy(t.spacing),this.padding.copy(t.padding)),this},t.prototype.set=function(t,n,i,r,e,u,s,h,o,a){var c=!1,f=!1;return null!=t&&this.Ut!==t&&(this.Ut=t,c=!0),null!=n&&this.S!==n&&(this.S=n,f=!0),null!=i&&this.T!==i&&(this.T=i,f=!0),null!=r&&this.tn!==r&&(this.tn=r,c=!0),null!=e&&this.j!==e&&(this.j=e,f=!0),null!=u&&this.nn!==u&&(this.nn=u,f=!0),null!=s&&this.B!==s&&(this.B=s,f=!0),null!=h&&this.rn!==h&&(this.rn=h,f=!0),null!=o&&this.en!==o&&(this.en=o,f=!0),null!=a&&this.un!==a&&(this.un=a,f=!0),c?this.p.toDirty():f&&this.p.updateUploaded(),this},t.prototype.toObject=function(){return{value:this.Ut,color:this.S,alpha:this.T,family:this.tn,size:this.j,weight:this.nn,align:this.align.toObject(),offset:this.offset.toObject(),style:this.B,outline:this.outline.toObject(),direction:this.rn,spacing:this.spacing.toObject(),padding:this.padding.toObject(),clipping:this.en,fitting:this.un}},t.prototype.serialize=function(t){var n=t.addResource(this.Ut),i=t.addResource(this.tn),r=this.align.serialize(t),e=this.offset.serialize(t),u=this.outline.serialize(t),s=this.spacing.serialize(t),h=this.padding.serialize(t),o=this.en?1:0,a=this.un?1:0,c="[".concat(n,",").concat(this.S,",").concat(this.T,",").concat(i,",").concat(this.j,",")+"".concat(this.nn,",").concat(r,",").concat(e,",").concat(this.B,",").concat(u,",")+"".concat(s,",").concat(this.rn,",").concat(h,",").concat(o,",").concat(a,"]");return t.addResource(c)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getText(t);null==r&&(r=JSON.parse(i[t]),n.setText(t,r)),this.set(i[r[0]]||"",r[1],r[2],i[r[3]]||"auto",r[4],r[5],r[8],r[11],!!r[13],!!r[14]),this.align.deserialize(r[6],n),this.offset.deserialize(r[7],n),this.outline.deserialize(r[9],n),this.spacing.deserialize(r[10],n),this.padding.deserialize(r[12],n)}},t}(),Jt=function(n){function i(t){var i=n.call(this,t)||this;i.size=i.newSize(),i.fill=i.newFill(),i.stroke=i.newStroke(),i.sn=q.RADIUS,i.hn=ut.ALL;var r=new Vt;return i.data=r,i.tag=r,i.text=i.newText(),i}return _(i,n),i.prototype.newSize=function(){var n=this;return new t.ObservablePoint((function(){n.onSizeChange()}),void 0,q.SIZE_X,q.SIZE_Y)},i.prototype.newFill=function(){return new $(this,!0,q.FILL_COLOR,q.FILL_ALPHA)},i.prototype.newStroke=function(){return new kt(this,!0,q.STROKE_COLOR,q.STROKE_ALPHA,q.STROKE_WIDTH,q.STROKE_ALIGN,q.STROKE_SIDE,q.STROKE_STYLE)},i.prototype.newText=function(){return new Yt(this,q.TEXT_VALUE,q.TEXT_COLOR,q.TEXT_ALPHA,q.TEXT_FAMILY,q.TEXT_SIZE)},Object.defineProperty(i.prototype,"corner",{get:function(){return this.hn},set:function(t){this.hn!==t&&(this.hn=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"radius",{get:function(){return this.sn},set:function(t){this.sn!==t&&(this.sn=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"image",{get:function(){return this.Tt},set:function(t){if(this.Tt!==t){null!=t?(this.Tt=t,this.imageSrc=t.src):(this.Tt=void 0,this.imageSrc=void 0);var n=this.parent;null!=n&&n.toDirty()}},enumerable:!1,configurable:!0}),i}(Rt),Zt=function(t,n,i,r,e,u,s){if(t.fill.enable){if((c=n*n)*(o=e*e)+(f=i*i)*(h=r*r)<=h*o)return!0}else if(0<u){var h,o,a=u*s,c=n*n,f=i*i,l=Math.max(0,r-a),v=Math.max(0,e-a),b=l*l,d=v*v;if(b*d<=c*d+f*b&&c*(o=e*e)+f*(h=r*r)<=h*o)return!0}return!1},qt={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_OR_LEFT:9,TOP_OR_RIGHT:3,BOTTOM_OR_LEFT:12,BOTTOM_OR_RIGHT:6,ALL:15},Qt=function(t,n,i,r,e,u,s){if(Nt(n,i,r,e)){if(t.fill.enable)return!0;var h=t.stroke.side;if(0<u&&h!==qt.NONE){var o=u*s,a=Math.max(0,r-o),c=Math.max(0,e-o);if(!Nt(n,i,a,c))return!(h!==qt.ALL&&!(n<=-a?i<=-c?h&qt.TOP_OR_LEFT:+c<=i?h&qt.BOTTOM_OR_LEFT:h&qt.LEFT:+a<=n?i<=-c?h&qt.TOP_OR_RIGHT:+c<=i?h&qt.BOTTOM_OR_RIGHT:h&qt.RIGHT:i<=-c?h&qt.TOP:+c<=i&&h&qt.BOTTOM))}}return!1},$t=function(t,n,i,r,e){return+i*t+r-n<=0&&-i*t+r-n<=0&&n<=e},tn=function(t,n,i,r,e,u,s){var h=2*e/r;if(t.fill.enable){if($t(n,i,h,-e,+e))return!0}else if(0<u){var o=u*s;if($t(n,i,h,-e,+e)){var a=2*r*e/(r+Math.sqrt(r*r+4*e*e)),c=e-a,f=c+(-e-c)*Math.max(0,a-o)/a;if(!$t(n,i,h,f,e-o))return!0}}return!1},nn=function(t,n,i){return.5*(i+t*n)},rn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getHitTestSize=function(n){var i=this.jt.formatted;if("boundary"in i){var r=i.boundary;n.width=Math.max(Math.abs(r[0]),Math.abs(r[2])),n.height=Math.max(Math.abs(r[1]),Math.abs(r[3]))}else t.prototype.getHitTestSize.call(this,n);return n},n.prototype.toMarkerSize=function(t){var n=0,i=t.getMarker();if(i){var r=i.head;if(r.type!==Q.NONE){var e=r.size;n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y)))}var u=i.tail;u.type!==Q.NONE&&(e=u.size,n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y))))}return n},n.prototype.containsAbsMarker=function(t,n,i,r,e,u){var s=t.type;if(s!==Q.NONE){var h=t.transform,o=h.a,a=h.b,c=h.c,f=h.d,l=h.tx,v=h.ty,b=1/(o*f-c*a),d=(f*n-c*i+v*c-l*f)*b,g=(o*i-a*n-v*o+l*a)*b,m=t.size,w=.5*m.x,p=.5*m.y;w<0&&(w=-w,n=-n),p<0&&(p=-p,i=-i);var O=r*e*u;switch(w+=O,p+=O,s){case Q.CIRCLE:return Zt(this,d,g,w,p,r,e);case Q.TRIANGLE:return tn(this,d,g,w,p,r,e);case Q.RECTANGLE:return Qt(this,d,g,w,p,r,e)}}return!1},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=this.jt,o=nn(e,u,0),a=o+this.toMarkerSize(h);if(this.containsAbsBBox(t,n,i+a,r+a)){var c=h.getMarker();if(c){if(this.containsAbsMarker(c.head,t,n,e,u,s))return!0;if(this.containsAbsMarker(c.tail,t,n,e,u,s))return!0}var f=this.calcHitPointAbsHitTester;return h.calcHitPointAbs(t,n,i,r,o,null,f,null)}return!1},n.prototype.calcHitPart=function(t,n){var i=this.toHitTestData(t,n),r=i.strokeWidth,e=i.strokeScale,u=nn(r,e,0),s=this.jt,h=u+this.toMarkerSize(s),o=i.x,a=i.y,c=i.width,f=i.height;if(this.containsAbsBBox(o,a,c+h,f+h)){var l=s.getMarker();if(l){var v=i.strokeAlign;if(this.containsAbsMarker(l.head,o,a,r,e,v))return et.MARKER_HEAD;if(this.containsAbsMarker(l.tail,o,a,r,e,v))return et.MARKER_TAIL}var b=this.calcHitPointAbsHitTester;if(s.calcHitPointAbs(o,a,c,f,u,null,b,null))return et.LINE}return this.containsText(t,n)?et.TEXT:this.containsChildren(t,n)?et.CHILDREN:et.NONE},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.jt,h=this.toHitTestData(t,n),o=(i||nn)(h.strokeWidth,h.strokeScale,0);return!!this.containsAbsBBox(h.x,h.y,h.width+o,h.height+o)&&s.calcHitPointAbs(h.x,h.y,h.width,h.height,o,r,e,u)},n.prototype.calcHitPointAbsHitTester=function(t,n,i,r,e,u,s,h,o){var a=e-i,c=u-r,f=t-i,l=n-r,v=a*a+c*c,b=a*f+c*l,d=f*f+l*l;if(1e-4<v){var g=Math.max(0,Math.min(1,b/v));if(v*g*g-2*b*g+d<h*h)return!0}return!1},n}(Jt),en=function(t){function n(n){void 0===n&&(n=r.BAR);var i=t.call(this,n)||this;return i.jt=new rt(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbsBBox=function(n,i,r,e){var u=Math.max(0,this.jt.size);return t.prototype.containsAbsBBox.call(this,n,i,r+u,e+u)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.jt.serialize(n),i},n}(rn),un=function(t){function n(n,i){var r=t.call(this,n,i,4,2)||this;return r.pointsId=NaN,r.pointsStyle=z.NONE,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset,i=this.indexOffset;t.updateClippings(),t.updateIndices(),c(t.clippings,n),f(t.indices,n,i)},n.prototype.update=function(t,n){this.updateVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexStepAndColorFill=function(t,n){if(n instanceof en){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.stroke,h=s.enable?s.width:0,o=s.style,a=h!==this.strokeWidth||o!==this.strokeStyle,c=X(n),f=this.transformLocalId!==c,v=n.points,b=v.id,d=b!==this.pointsId,g=v.style,m=g!==this.pointsStyle;(u||f||a||d||m)&&(this.sizeX=r,this.sizeY=e,this.strokeWidth=h,this.strokeStyle=o,this.transformLocalId=c,this.pointsId=b,this.pointsStyle=g,d&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),l(t.vertices,t.steps,t.colorFills,this.vertexOffset,v.values,v.size,h,o,n.transform.internalTransform))}},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),v(t.uvs,this.vertexOffset,J(i)))},n}(W),sn=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=NaN,this.scaleX=1,this.scaleY=1,this.size=NaN,this.family="auto",this.value="",this.texture=null,this.textureTransformId=NaN,this.color=NaN,this.alpha=NaN,this.weight=NaN,this.style=NaN,this.alignHorizontal=NaN,this.alignVertical=NaN,this.offsetHorizontal=NaN,this.offsetVertical=NaN,this.outlineWidth=NaN,this.outlineColor=NaN,this.outlineAlpha=NaN,this.spacingHorizontal=NaN,this.spacingVertical=NaN,this.direction=NaN,this.paddingHorizontal=NaN,this.paddingVertical=NaN,this.clipping=!1,this.fitting=!1}return n.prototype.init=function(t){var n=this.vertexCount;if(0<n){var i=this.vertexOffset;t.updateClippings(),S(t.clippings,i,n),t.updateIndices(),T(t.indices,i,this.indexOffset,this.indexCount)}},n.prototype.isCompatible=function(t){return 4*M(t)===this.vertexCount},n.prototype.update=function(t,n){if(0<this.vertexCount){var i=n.text.atlas;null!=i&&(this.updateVertex(t,n,i),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateStep(t,n))}},n.prototype.updateVertex=function(n,i,r){var e=i.size,u=e.x,s=e.y,h=u!==this.sizeX||s!==this.sizeY,o=X(i),a=this.transformLocalId!==o,c=i.text,f=c.size,l=c.family,v=c.value,b=c.style,d=c.align.horizontal,g=c.align.vertical,m=c.offset.horizontal,w=c.offset.vertical,p=c.spacing.horizontal,O=c.spacing.vertical,D=c.direction,E=c.padding.horizontal,M=c.padding.vertical,S=c.clipping,T=c.fitting,j=c.texture||t.Texture.WHITE,N=Y(j),C=v!==this.value||l!==this.family,A=f!==this.size,R=b!==this.style,k=d!==this.alignHorizontal||g!==this.alignVertical,L=m!==this.offsetHorizontal||w!==this.offsetVertical,y=p!==this.spacingHorizontal||O!==this.spacingVertical||E!==this.paddingHorizontal||M!==this.paddingVertical,x=D!==this.direction,B=this.clipping!==S,_=this.fitting!==T,P=j!==this.texture||N!==this.textureTransformId;if(h||a||C||A||R||k||L||y||x||B||_||P){this.size=f,this.family=l,this.value=v,this.style=b,this.alignHorizontal=d,this.alignVertical=g,this.offsetHorizontal=m,this.offsetVertical=w,this.spacingHorizontal=p,this.spacingVertical=O,this.direction=D,this.paddingHorizontal=E,this.paddingVertical=M,this.clipping=S,this.fitting=T,this.texture=j,this.textureTransformId=N,(A||_||T&&h)&&(this.weight=NaN),n.updateVertices(),n.updateUvs();var F=i.size,U=c.world;null==U&&(U=[0,0,0,0,0,0,0,0],c.world=U),I(n.vertices,n.uvs,this.vertexOffset,this.vertexCount,0,0,F.x,F.y,r,f,v,b,d,g,m,w,p,O,D,E,M,S,T,U,J(j),i.transform.internalTransform)}},n.prototype.updateColorFill=function(t,n){var i=n.text,r=i.color,e=n.visible&&i.enable?i.alpha:0;r===this.color&&e===this.alpha||(this.color=r,this.alpha=e,t.updateColorFills(),V(r,e,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.text,r=i.outline,e=r.color,u=n.visible&&i.enable?r.alpha:0;e===this.outlineColor&&u===this.outlineAlpha||(this.outlineColor=e,this.outlineAlpha=u,t.updateColorStrokes(),V(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.updateStep=function(t,n){var i=n.text,r=i.outline,e=r.enable?r.width:0,u=e!==this.outlineWidth,s=i.weight,h=s!==this.weight,o=1,a=1,c=i.world;null!=c&&(o=c[8],a=c[9]);var f=D<Math.abs(this.scaleX-o)||D<Math.abs(this.scaleY-a);(h||u||f)&&(this.weight=s,this.outlineWidth=e,this.scaleX=o,this.scaleY=a,t.updateSteps(),j(t.steps,this.vertexOffset,this.vertexCount,i.atlas,i.size,e,s,this.scaleX,this.scaleY))},n.prototype.buildUnit=function(n){if(0<this.vertexCount){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;r!==n.baseTexture&&(n.baseTexture=r,n.push(i,this.indexOffset))}},n}(),hn=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=4+h,c=2+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new un(i,r),new sn(i+4,r+2,h,o)]).init(n):null},on=function(t,n,i){var r=t.length;if(n<r)return t;for(var e="",u=0,s=n-r;u<s;++u)e+=i;return e+t},an=function(){function t(){}return t.toCode=function(t){return on(t.toString(16).toUpperCase(),6,"0")},t.fromCode=function(t){var n=t.trim().toLowerCase();if(6===n.length){var i=Number("0x".concat(n));if(i==i)return i}return null},t.fromRgb=function(t,n,i){return 255*t<<16|255*n<<8|255*i|0},t.blend=function(t,n,i){var r=t>>16&255,e=t>>8&255,u=255&(0|t),s=n>>16&255,h=n>>8&255,o=255&(0|n),a=Math.max(0,Math.min(1,i)),c=1-a;return Math.max(0,Math.min(255,r*c+s*a))<<16|Math.max(0,Math.min(255,e*c+h*a))<<8|0|Math.max(0,Math.min(255,u*c+o*a))},t.brighten=function(t,n){return 0<=n?this.blend(t,16777215,n):this.blend(t,0,-n)},t.darken=function(t,n){return 0<=n?this.blend(t,0,n):this.blend(t,16777215,-n)},t.toGrayscale=function(t){var n=this.toLuma(t);return n<<16|n<<8|n},t.toLuma=function(t){return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(255&(0|t))&255},t}(),cn={NONE:0,POSITION_X:1,POSITION_Y:2,POSITION:3,ROTATION:4,COLOR_FILL:8,COLOR_STROKE:16,COLOR_FILL_AND_STROKE:24,COLOR_TEXT:32,COLOR_TEXT_OUTLINE:64,COLOR:120,VISIBILITY:128,HEIGHT:256,WIDTH:512,SIZE:768,TEXT:1024,CURSOR:2048},fn=function(){function t(){}return t.toBaseFill=function(t,n){return(n.written&cn.COLOR_FILL?t:n).fill},t.toBaseStroke=function(t,n){return(n.written&cn.COLOR_STROKE?t:n).stroke},t.toBaseText=function(t,n){return(n.written&cn.COLOR_TEXT?t:n).text},t.toBaseTextOutline=function(t,n){return(n.written&cn.COLOR_TEXT_OUTLINE?t:n).text.outline},t}(),ln={isInitializing:!1},vn=function(){function t(){}return t.from=function(t,n,i,r,e,u){if(t.trim().length<=0)return i;try{var s="try {with (shape) {with (state) {with (data.alias) {with (environment) {"+(e?"var result = (".concat(t,");")+"return (result != null ? ".concat(n,"(result) : null);"):"return ".concat(n,"(").concat(t,");"))+"}}}}} catch (e) {"+"return ".concat(r,";")+"}";return null==u?Function("shape","time","environment",s):Function("shape","time","environment",u,s)}catch(t){return i}},t.ofNumberOrNull=function(t){return this.from(t,"Number",this.NULL,"null",!0)},t.ofStringOrNull=function(t){return this.from(t,"String",this.NULL,"null",!0)},t.ofUnknown=function(t){return this.from(t,"",this.NULL,"null",!1)},t.ofNumber=function(t){return this.from(t,"Number",this.ZERO,"0",!1)},t.ofNumberOrOne=function(t){return this.from(t,"Number",this.ONE,"1",!1)},t.ofNumberOrOneHundred=function(t){return this.from(t,"Number",this.ONE_HUNDRED,"100",!1)},t.ofString=function(t){return this.from(t,"String",this.EMPTY,'""',!1)},t.ofBoolean=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrTrue=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrFalse=function(t){return this.from(t,"Boolean",this.FALSE,"false",!1)},t.ofElementOrNull=function(t){return this.from(t,"",void 0,"null",!1,"container")},t.NULL=function(){return null},t.ZERO=function(){return 0},t.ONE=function(){return 1},t.ONE_HUNDRED=function(){return 100},t.EMPTY=function(){return""},t.TRUE=function(){return!0},t.FALSE=function(){return!1},t}(),bn=function(){function t(t){this.reset=t||cn.NONE}return t.prototype.initialize=function(t,n){},t.prototype.execute=function(t,n,i){},t.prototype.onResize=function(t,n){},t.prototype.onFocus=function(t,n){},t.prototype.onBlur=function(t,n){},t.prototype.onClick=function(t,n,i){},t.prototype.onDblClick=function(t,n,i,r){},t.prototype.onDowning=function(t,n,i){},t.prototype.onDown=function(t,n,i){},t.prototype.onMove=function(t,n,i){},t.prototype.onOver=function(t,n,i){},t.prototype.onOut=function(t,n,i){},t.prototype.onUp=function(t,n,i){},t.prototype.onUpOutside=function(t,n,i){},t.prototype.onPressed=function(t,n,i){},t.prototype.onUnpressed=function(t,n,i){},t.prototype.onKeyDown=function(t,n,i){},t.prototype.onKeyUp=function(t,n,i){},t.prototype.onRightClick=function(t,n,i){},t.prototype.onRightDowning=function(t,n,i){},t.prototype.onRightDown=function(t,n,i){},t.prototype.onRightUp=function(t,n,i){},t.prototype.onRightUpOutside=function(t,n,i){},t.prototype.onRightPressed=function(t,n,i){},t.prototype.onRightUnpressed=function(t,n,i){},t.prototype.onRender=function(t,n,i,r){},t}(),dn=function(t){function n(n,i){var r=t.call(this,i)||this;return r.condition=vn.ofBoolean(n.condition),r}return _(n,t),n}(bn),gn=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.interval=n.interval,r}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.interval,e=r<<1,u=i%e;u<r?(this.toOff(t,n),n.effect=i+(r-u)):(this.toOn(t,n),n.effect=i+(e-u))}},n.prototype.toOn=function(t,n){},n.prototype.toOff=function(t,n){},n}(dn),mn=function(t){function n(n){return t.call(this,n,cn.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=fn.toBaseFill(t,n);t.fill.set(void 0,an.brighten(i.color,.5),i.alpha);var r=fn.toBaseStroke(t,n);t.stroke.set(void 0,an.brighten(r.color,.5),r.alpha);var e=fn.toBaseText(t,n);t.text.set(void 0,an.brighten(e.color,.5),e.alpha);var u=fn.toBaseTextOutline(t,n);t.text.outline.set(void 0,an.brighten(u.color,.5),u.alpha),n.written|=this.reset},n}(gn),wn=function(t){function n(n){var i=t.call(this,n,cn.COLOR_FILL)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.fill.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(gn),pn=function(t){function n(n){var i=t.call(this,n,cn.COLOR_STROKE)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.stroke.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(gn),On=function(t){function n(n){return t.call(this,n,cn.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=fn.toBaseFill(t,n);t.fill.set(void 0,an.darken(i.color,.5),i.alpha);var r=fn.toBaseStroke(t,n);t.stroke.set(void 0,an.darken(r.color,.5),r.alpha);var e=fn.toBaseText(t,n);t.text.set(void 0,an.darken(e.color,.5),e.alpha);var u=fn.toBaseTextOutline(t,n);t.text.outline.set(void 0,an.darken(u.color,.5),u.alpha),n.written|=this.reset},n}(gn),Dn=function(t){function n(n){return t.call(this,n,cn.COLOR_FILL_AND_STROKE)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=fn.toBaseFill(t,n);t.fill.set(void 0,i.color,.5*i.alpha);var r=fn.toBaseStroke(t,n);t.stroke.set(void 0,r.color,.5*r.alpha),n.written|=this.reset},n}(gn),En=function(t){function n(n){return t.call(this,n,cn.VISIBILITY)||this}return _(n,t),n.prototype.toOn=function(t,n){t.visible=!0,n.written|=this.reset},n.prototype.toOff=function(t,n){t.visible=!1,n.written|=this.reset},n}(gn),Mn={VISIBILITY:0,BRIGHTEN:1,DARKEN:2,OPACITY:3,COLOR_FILL:4,COLOR_STROKE:5},Sn=function(){function t(t,n){this.type=t,this.condition=n}return t.prototype.isEquals=function(t){return this.type===t.type&&this.condition===t.condition},t.prototype.toLabel=function(){return this.getTheme().toLabel(this)},t.prototype.getTheme=function(){var n;return null!==(n=t.THEME)&&void 0!==n?n:t.THEME=Z.getInstance().get("EShapeActionValue")},t}(),Tn=function(t){function n(n,i,r){var e=t.call(this,n,i)||this;return e.subtype=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.subtype===i.subtype},n}(Sn),jn={SHOW_HIDE:0,BLINK:1,TRANSFORM:2,OPEN:3,EMIT_EVENT:4,CHANGE_COLOR_LEGACY:5,CHANGE_TEXT:6,CHANGE_CURSOR:7,MISC:8,CHANGE_COLOR:9,GESTURE:10,EXTENSION:1e3},Nn=function(){function t(){}return t.toResource=function(t,n,i){if(0<=t&&t<n.length){var r=n[t];if(pt(r)&&0<=r&&r<i.length)return i[r]}return""},t}(),In=function(t){function n(n,i,r,e,u){var s=t.call(this,jn.BLINK,i,n)||this;return s.interval=r,s.color=e,s.alpha=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.interval===i.interval&&this.color===i.color&&this.alpha===i.alpha},n.prototype.toRuntime=function(){switch(this.subtype){case Mn.BRIGHTEN:return new mn(this);case Mn.COLOR_FILL:return new wn(this);case Mn.COLOR_STROKE:return new pn(this);case Mn.DARKEN:return new On(this);case Mn.OPACITY:return new Dn(this);case Mn.VISIBILITY:return new En(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.interval,",").concat(this.color,",").concat(this.alpha,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources);return new n(t[2],r,t[3],t[4],t[5])},n}(Tn),Cn=function(){function t(){}return t.blend=function(t,n,i){var r=Math.max(0,Math.min(1,i));return Math.max(0,Math.min(1,t*(1-r)+n*r))},t}(),An=function(t){function n(n){return t.call(this,n,n.subtype<<3)||this}return _(n,t),n.prototype.set=function(t,n,i,r,e,u){var s=this.reset;if(null!=r){if(null!=e)if(null!=u){if(s&cn.COLOR_FILL){var h=fn.toBaseFill(t,n);t.fill.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u))}s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u)))}else s&cn.COLOR_FILL&&t.fill.set(void 0,r,e),s&cn.COLOR_STROKE&&t.stroke.set(void 0,r,e),s&cn.COLOR_TEXT&&t.text.set(void 0,r,e),s&cn.COLOR_TEXT_OUTLINE&&t.text.outline.set(void 0,r,e);else null!=u?(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,an.blend(h.color,r,u),h.alpha)),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,an.blend(h.color,r,u),h.alpha)),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,an.blend(h.color,r,u),h.alpha)),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,an.blend(h.color,r,u),h.alpha))):(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,r,h.alpha)),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,r,h.alpha)),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,r,h.alpha)),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,r,h.alpha)));n.written|=s}else null!=e&&(null!=u?(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,h.color,Cn.blend(h.alpha,e,u))),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,h.color,Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,Cn.blend(h.alpha,e,u)))):(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,h.color,e)),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,e)),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,h.color,e)),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,e))),n.written|=s)},n}(dn),Rn={COLOR_AND_ALPHA:0,COLOR:1,ALPHA:2,CODE:3,BRIGHTNESS:4},kn=function(t){function n(n){var i=t.call(this,n)||this;switch(n.target){case Rn.COLOR:i.color=n.color,i.alpha=null;break;case Rn.ALPHA:i.color=null,i.alpha=n.alpha;break;default:i.color=n.color,i.alpha=n.alpha}return i.blend=vn.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.color,e=this.alpha,u=this.blend(t,i,ln);this.set(t,n,i,r,e,u)}},n}(An),Ln={NONE:0,FILL:1,STROKE:2,TEXT:4,TEXT_OUTLINE:8,FILL_AND_STROKE:3,ALL:15},yn={FILL:0,STROKE:1,FILL_AND_STROKE:2,TEXT:3,TEXT_OUTLINE:4,ALL:5},xn=function(){function t(){}return t.from=function(t){if(t[0]===jn.CHANGE_COLOR)return t[2];switch(t[2]){case yn.FILL:return Ln.FILL;case yn.STROKE:return Ln.STROKE;case yn.FILL_AND_STROKE:return Ln.FILL_AND_STROKE;case yn.TEXT:return Ln.TEXT;case yn.TEXT_OUTLINE:return Ln.TEXT_OUTLINE;case yn.ALL:return Ln.ALL}},t.unpack=function(t){var n=[];return t&Ln.FILL&&n.push(Ln.FILL),t&Ln.STROKE&&n.push(Ln.STROKE),t&Ln.TEXT&&n.push(Ln.TEXT),t&Ln.TEXT_OUTLINE&&n.push(Ln.TEXT_OUTLINE),n},t.pack=function(t){for(var n=Ln.NONE,i=0,r=t.length;i<r;++i)n|=t[i];return n},t}(),Bn=function(t){function n(n,i,r,e,u,s){var h=t.call(this,jn.CHANGE_COLOR,i,n)||this;return h.target=r,h.color=e,h.alpha=u,h.blend=s,h}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new kn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.target,",").concat(this.color,",").concat(this.alpha,",").concat(i,"]"))},n.deserialize=function(t,i){var r=xn.from(t),e=Nn.toResource(1,t,i.resources),u=Nn.toResource(6,t,i.resources);return new n(r,e,t[3],t[4],t[5],u)},n}(Tn),_n=function(t){function n(n){var i=t.call(this,n)||this;return i.brightness=vn.ofNumberOrNull(n.brightness),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.brightness(t,i,ln);this.set(t,n,i,r)}},n.prototype.set=function(t,n,i,r){var e=this.reset;if(null!=r){var u=this.toAdjusted;if(e&cn.COLOR_FILL){var s=fn.toBaseFill(t,n);t.fill.set(void 0,u(s.color,r),s.alpha)}e&cn.COLOR_STROKE&&(s=fn.toBaseStroke(t,n),t.stroke.set(void 0,u(s.color,r),s.alpha)),e&cn.COLOR_TEXT&&(s=fn.toBaseText(t,n),t.text.set(void 0,u(s.color,r),s.alpha)),e&cn.COLOR_TEXT_OUTLINE&&(s=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,u(s.color,r),s.alpha)),n.written|=e}},n.prototype.toAdjusted=function(t,n){return 0<=n?an.brighten(t,+n):an.darken(t,-n)},n}(An),Pn=function(t){function n(n,i,r){var e=t.call(this,jn.CHANGE_COLOR,i,n)||this;return e.brightness=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.brightness===i.brightness},n.prototype.toRuntime=function(){return new _n(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=Rn.BRIGHTNESS,r=t.addResource(this.brightness);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(xn.from(t),Nn.toResource(1,t,i.resources),Nn.toResource(4,t,i.resources))},n}(Tn),Fn=function(t){function n(n){var i=t.call(this,n)||this;return i.color=vn.ofNumberOrNull(n.color),i.alpha=vn.ofNumberOrNull(n.alpha),i.blend=vn.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.color(t,i,ln),e=this.alpha(t,i,ln),u=this.blend(t,i,ln);this.set(t,n,i,r,e,u)}},n}(An),Un=function(t){function n(n,i,r,e,u){var s=t.call(this,jn.CHANGE_COLOR,i,n)||this;return s.color=r,s.alpha=e,s.blend=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new Fn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=Rn.CODE,r=t.addResource(this.color),e=t.addResource(this.alpha),u=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,",").concat(e,",").concat(u,"]"))},n.deserialize=function(t,i){return new n(xn.from(t),Nn.toResource(1,t,i.resources),Nn.toResource(4,t,i.resources),Nn.toResource(5,t,i.resources),Nn.toResource(6,t,i.resources))},n}(Tn),Gn=function(t){function n(n){var i=t.call(this,n,cn.CURSOR)||this;return i.name=vn.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.name(t,i,ln);null!=r&&(t.cursor=r,n.written|=this.reset)}},n}(dn),Hn=function(t){function n(n,i){var r=t.call(this,jn.CHANGE_CURSOR,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new Gn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),Nn.toResource(2,t,i.resources))},n}(Sn),zn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"AM":"PM"},t}(),Vn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"am":"pm"},t}(),Wn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getDate())},t}(),Xn=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t)},t}(),Kn=function(t){this.precision=null!=t?+t.substring(1,t.length):void 0},Yn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toExponential(this.precision)},n}(Kn),Jn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toFixed(this.precision)},n}(Kn),Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){var r=this.toAbs(t,n,i);return r<1e-24?this.an(t,1,""):r<1e-21?this.an(t,1e24,"y"):r<1e-18?this.an(t,1e21,"z"):r<1e-15?this.an(t,1e18,"a"):r<1e-12?this.an(t,1e15,"f"):r<1e-9?this.an(t,1e12,"p"):r<1e-6?this.an(t,1e9,"n"):r<.001?this.an(t,1e6,"μ"):r<1?this.an(t,1e3,"m"):r<1e3?this.an(t,1,""):r<1e6?this.an(t,.001,"k"):r<1e9?this.an(t,1e-6,"M"):r<1e12?this.an(t,1e-9,"G"):r<1e15?this.an(t,1e-12,"T"):r<1e18?this.an(t,1e-15,"P"):r<1e21?this.an(t,1e-18,"E"):r<1e24?this.an(t,1e-21,"Z"):this.an(t,1e-24,"Y")},n.prototype.toAbs=function(t,n,i){return Math.abs(t)},n.prototype.an=function(t,n,i){return"".concat((t*n).toFixed(this.precision)).concat(i)},n}(Kn),qn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toPrecision(this.precision)},n}(Kn),Qn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours())},t}(),$n=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours()%12)},t}(),ti=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMonth()+1)},t}(),ni=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMinutes())},t}(),ii=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMilliseconds())},t}(),ri=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(100*t|0,"%")},t}(),ei=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t,"%")},t}(),ui=function(){function t(t,n,i){this.length=t,this.character=n,this.node=i}return t.prototype.format=function(t,n,i){return on(this.node.format(t,n,i),this.length,this.character)},t}(),si=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"===r[0]?"(".concat(r.substring(1,r.length),")"):r},t}(),hi=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?"+".concat(r):r},t}(),oi=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(100*t),"%")},t}(),ai=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t),"%")},t}(),ci=function(){function t(t,n,i,r,e,u,s){this.Y=t,this.M=n,this.D=i,this.H=r,this.m=e,this.s=u,this.mi=s}return t.prototype.format=function(t,n,i){if(n<1e3)return"".concat(this.s.format(t,n,i),".").concat(this.mi.format(t,n,i));if(n<6e4)return"".concat(this.m.format(t,n,i),":").concat(this.s.format(t,n,i));if(n<36e5)return"".concat(this.H.format(t,n,i),":").concat(this.m.format(t,n,i));if(n<864e5){var r=this.M.format(t,n,i),e=this.D.format(t,n,i);return"".concat(r,"/").concat(e," ").concat(this.H.format(t,n,i))}return n<2592e6?"".concat(this.M.format(t,n,i),"/").concat(this.D.format(t,n,i)):"".concat(this.Y.format(t,n,i),"/").concat(this.M.format(t,n,i))},t}(),fi=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?" ".concat(r):r},t}(),li=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toAbs=function(t,n,i){return Math.abs(n)},n}(Zn),vi=function(){function t(t){this.str=t}return t.prototype.format=function(t,n,i){return this.str},t}(),bi=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear())},t}(),di=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear()%100)},t}(),gi=function(){function t(){}return t.prototype.format=function(t,n,i){var r=i.getTimezoneOffset(),e=r<=0?"+":"-",u=on(String(Math.floor(Math.abs(r)/60)),2,"0"),s=on(String(Math.floor(Math.abs(r)%60)),2,"0");return"".concat(e).concat(u,":").concat(s)},t}(),mi=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t))},t}(),wi=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getSeconds())},t}(),pi=void 0,Oi=function(t,n,i){switch(t){case"_":return new ui(n," ",i);case"-":return i;default:return new ui(n,"0",i)}},Di=function(t,n){switch(t){case"_":return new fi(n);case"+":return new hi(n);case"(":return new si(n);default:return n}},Ei=function(){function t(t){var n=function(t){for(var n=0,i=!1,r=[],e=function(){var t=pi;return t?t.lastIndex=0:pi=t=/%(0|_|-|\+|\()?(\.\d+)?(Y(?:MD?)?|y(?:MD?)?|MD?|D|H(?:ms?)?|h(?:ms?)?|m(?:i|s)?|a|A|s(?:s?i|dt)?|z|%|f(?:si)?|e|g|d|r(?:d|p)|p|P|RP)/g,t}();;){var u=e.exec(t);if(null==u){n<t.length&&r.push(new vi(t.substring(n,t.length)));break}var s=u.index;n<s&&r.push(new vi(t.substring(n,s))),n=s+u[0].length;var h=u[0],o=u[1],a=u[2];switch(u[3]){case"Y":i=!0,r.push(new bi);break;case"YM":i=!0,r.push(new bi,new vi("/"),Oi(o,2,new ti));break;case"YMD":i=!0,r.push(new bi,new vi("/"),Oi(o,2,new ti),new vi("/"),Oi(o,2,new Wn));break;case"y":i=!0,r.push(Oi(o,2,new di));break;case"yM":i=!0,r.push(Oi(o,2,new di),new vi("/"),Oi(o,2,new ti));break;case"yMD":r.push(Oi(o,2,new di),new vi("/"),Oi(o,2,new ti),new vi("/"),Oi(o,2,new Wn));break;case"M":i=!0,r.push(Oi(o,2,new ti));break;case"MD":i=!0,r.push(Oi(o,2,new ti),new vi("/"),Oi(o,2,new Wn));break;case"D":i=!0,r.push(Oi(o,2,new Wn));break;case"H":i=!0,r.push(Oi(o,2,new Qn));break;case"Hm":i=!0,r.push(Oi(o,2,new Qn),new vi(":"),Oi(o,2,new ni));break;case"Hms":i=!0,r.push(Oi(o,2,new Qn),new vi(":"),Oi(o,2,new ni),new vi(":"),Oi(o,2,new wi));break;case"h":i=!0,r.push(Oi(o,2,new $n));break;case"hm":i=!0,r.push(Oi(o,2,new $n),new vi(":"),Oi(o,2,new ni));break;case"hms":i=!0,r.push(Oi(o,2,new $n),new vi(":"),Oi(o,2,new ni),new vi(":"),Oi(o,2,new wi));break;case"m":i=!0,r.push(Oi(o,2,new ni));break;case"ms":i=!0,r.push(Oi(o,2,new ni),new vi(":"),Oi(o,2,new wi));break;case"mi":i=!0,r.push(Oi(o,3,new ii));break;case"a":i=!0,r.push(new Vn);break;case"A":i=!0,r.push(new zn);break;case"s":i=!0,r.push(Oi(o,2,new wi));break;case"sdt":i=!0,r.push(new ci(new bi,Oi(o,2,new ti),Oi(o,2,new Wn),Oi(o,2,new Qn),Oi(o,2,new ni),Oi(o,2,new wi),Oi(o,3,new ii)));break;case"z":i=!0,r.push(new gi);break;case"%":r.push(new vi("%"));break;case"f":r.push(Di(o,new Jn(a)));break;case"e":r.push(Di(o,new Yn(a)));break;case"g":r.push(Di(o,new qn(a)));break;case"rd":r.push(Di(o,new mi));break;case"d":r.push(Di(o,new Xn));break;case"P":r.push(Di(o,new ri));break;case"p":r.push(Di(o,new ei));break;case"RP":r.push(Di(o,new oi));break;case"rp":r.push(Di(o,new ai));break;case"fsi":r.push(Di(o,new Zn(a)));break;case"ssi":r.push(Di(o,new li(a)));break;default:r.push(new vi(h))}}return{nodes:r,date:i}}(t);this.date=n.date,this.nodes=n.nodes}return t.prototype.format=function(n,i){var r=this.nodes,e=t.DATE;null==e&&(e=new Date,t.DATE=e),this.date&&e.setTime(n);for(var u="",s=0,h=r.length;s<h;++s)u+=r[s].format(n,i,e);return u},t}(),Mi=function(){function t(){}return t.create=function(t){return new Ei(t)},t}(),Si=function(t){function n(n){var i=t.call(this,n,cn.TEXT)||this;return i.number=vn.ofNumber(n.value),i.formatters=new Map,i}return _(n,t),n.prototype.getFormatter=function(t,n){var i=this.formatters,r=n.text.value,e=i.get(r);return void 0===e&&(e=this.newFormatter(r),i.set(r,e)),e},n.prototype.newFormatter=function(t){return 0<(t=t.trim()).length?Mi.create(t):null},n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.number(t,i,ln),e=this.getFormatter(t,n);t.text.value=null!=e?e.format(r,0):String(r),n.written|=this.reset}},n}(dn),Ti=function(t){function n(n){var i=t.call(this,n,cn.TEXT)||this;return i.text=vn.ofString(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,ln)&&(t.text.value=this.text(t,i,ln),n.written|=this.reset)},n}(dn),ji={TEXT:0,NUMBER:1},Ni=function(t){function n(n,i,r){var e=t.call(this,jn.CHANGE_TEXT,i,n)||this;return e.value=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.value===i.value},n.prototype.toRuntime=function(){switch(this.subtype){case ji.TEXT:return new Ti(this);case ji.NUMBER:return new Si(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(3,t,i.resources);return new n(t[2],r,e)},n}(Tn),Ii=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.background;r&&(this.S=r.color,this.T=r.alpha)}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBackgroundColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBackgroundAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.fn;null!=t&&t()},t}(),Ci={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_RIGHT:3,TOP_BOTTOM:5,TOP_LEFT:9,RIGHT_BOTTOM:6,RIGHT_LEFT:10,BOTTOM_LEFT:12,NOT_TOP:14,NOT_RIGHT:13,NOT_BOTTOM:11,NOT_LEFT:7,ALL:15},Ai=function(t,n){return Ot(t)?n[t]:t},Ri=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.border;r&&(this.S=r.color,this.T=r.alpha,this.kt=r.width,this.Lt=r.align,this.ln=Ai(r.mask,Ci))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.kt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Lt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Lt},set:function(t){this.Lt!==t&&(this.Lt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.ln;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.ln},set:function(t){this.ln!==t&&(this.ln=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.fn;null!=t&&t()},t}(),ki={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},Li=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.corner;r&&(pt(r)?(this.sn=r,this.ln=void 0):(this.sn=r.radius,this.ln=Ai(r.mask,ki)))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getRadius=function(){var t;return null!==(t=this.sn)&&void 0!==t?t:this.cn.getCornerRadius()},Object.defineProperty(t.prototype,"radius",{get:function(){return this.sn},set:function(t){if(this.sn!==t){this.sn=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(){var t;return null!==(t=this.ln)&&void 0!==t?t:this.cn.getCornerMask()},Object.defineProperty(t.prototype,"mask",{get:function(){return this.ln},set:function(t){if(this.ln!==t){this.ln=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;this.sn!==t&&(this.sn=t,i=!0),this.ln!==n&&(this.ln=n,i=!0);var r=this.fn;i&&null!=r&&r()},t}(),yi={NONE:0,SELF:1,CHILDREN:2,BOTH:3},xi=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.outline;r&&(this.S=r.color,this.T=r.alpha,this.kt=r.width,this.vn=r.offset,this.Lt=r.align,this.ln=Ai(r.mask,Ci))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){if(this.S!==t){this.S=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){if(this.T!==t){this.T=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.kt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){if(this.kt!==t){this.kt=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getOffset=function(t){var n=this.vn;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineOffset(t)},Object.defineProperty(t.prototype,"offset",{get:function(){return this.vn},set:function(t){if(this.vn!==t){this.vn=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Lt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Lt},set:function(t){if(this.Lt!==t){this.Lt=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.ln;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.ln},set:function(t){if(this.ln!==t){this.ln=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t}(),Bi=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.padding;null!=r&&(pt(r)?(this.bn=r,this.dn=r,this.gn=r,this.mn=r):(this.bn=r.left,this.dn=r.top,this.gn=r.right,this.mn=r.bottom))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getCallback=function(){return this.fn},t.prototype.getLeft=function(){var t;return null!==(t=this.bn)&&void 0!==t?t:this.cn.getPaddingLeft()},Object.defineProperty(t.prototype,"left",{get:function(){return this.bn},set:function(t){this.bn!==t&&(this.bn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){var t;return null!==(t=this.dn)&&void 0!==t?t:this.cn.getPaddingTop()},Object.defineProperty(t.prototype,"top",{get:function(){return this.dn},set:function(t){this.dn!==t&&(this.dn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){var t;return null!==(t=this.gn)&&void 0!==t?t:this.cn.getPaddingRight()},Object.defineProperty(t.prototype,"right",{get:function(){return this.gn},set:function(t){this.gn!==t&&(this.gn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){var t;return null!==(t=this.mn)&&void 0!==t?t:this.cn.getPaddingBottom()},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.mn},set:function(t){this.mn!==t&&(this.mn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r),null!=this.fn&&this.fn()},t}(),_i=function(){function t(t,n){this.wn=t,this.ut=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this.wn.x},set:function(t){var n=this.wn,i=n.x;if(i!==t){n.x=t;var r=n.y;this.ut(t,r,i,r)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.wn.y},set:function(t){var n=this.wn,i=n.y;if(i!==t){n.y=t;var r=n.x;this.ut(r,t,r,i)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=this.wn,r=i.x,e=i.y;return r===t&&e===n||(i.set(t,n),this.ut(t,n,r,e)),this},t.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.wn,e=r.x,u=r.y;return e===n&&u===i||(r.copyFrom(t),this.ut(n,i,e,u)),this},t.prototype.copyTo=function(t){return t.copyFrom(this.wn)},t.prototype.copy=function(){return this.copyFrom(arguments[0])},t.prototype.clone=function(n){return new t(this.wn,n||this.ut)},t.prototype.equals=function(t){return this.wn.equals(t)},t}(),Pi=function(t){function n(n,i,r){var e=t.call(this,n,i,r)||this;return e.kt=100,e.pn=100,e.On=0,e.Dn=ki.NONE,e.En=!0,e.Mn=1,e.Sn=e.getBuffer("aVertexPosition"),e.Tn=e.Sn.data,e.jn=e.getBuffer("aTextureCoord"),e._uvs=e.jn.data,e.Nn=e.getIndex(),e.In=e.Nn.data,e}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.pn},set:function(t){this.pn!==t&&(this.pn=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerRadius",{get:function(){return this.On},set:function(t){this.On!==t&&(this.On=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerMask",{get:function(){return this.Dn},set:function(t){this.Dn!==t&&(this.Dn=t,this.En=!0)},enumerable:!1,configurable:!0}),n.prototype.getTables=function(){var t=n.TABLES;return null==t&&(t=this.newTables(n.N),n.TABLES=t),t},n.prototype.newTables=function(t){var n=1/(t-1)*.5;return[this.newTable(t,1,n),this.newTable(t,.5,n),this.newTable(t,0,n),this.newTable(t,1.5,n)]},n.prototype.newTable=function(t,n,i){for(var r=[],e=[],u=Math.PI,s=0,h=n;s<t;s+=1,h-=i){var o=h*u,a=+Math.cos(o),c=-Math.sin(o);r.push(a),e.push(c)}return{cos:r,sin:e}},n.N=4,n}(t.MeshGeometry),Fi=function(t){function n(){return t.call(this,new Float32Array(16*Pi.N),new Float32Array(16*Pi.N),new Uint16Array(3*(12*Pi.N-2)))||this}return _(n,t),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a){for(var c=a.cos,f=a.sin,l=c[0],v=f[0],b=c[e-1],d=f[e-1],g=0;g<e;++g){var m=c[g],w=f[g],p=o,O=m*l+w*v;1e-4<O&&(p=Math.min(p,(1/O-1)*h));var D=m*b+w*d;1e-4<D&&(p=Math.min(p,(1/D-1)*h));var E=h+p;t[++i]=u+m*h,t[++i]=s+w*h,t[++i]=u+m*E,t[++i]=s+w*E,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+m),n[++r]=.5*(1+w)}},n.prototype.fillIndices=function(t,n,i,r){for(var e=0;e<r;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2},n.prototype.fillIndicesEnd=function(t,n,i,r){for(var e=0,u=r-1;e<u;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2;t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=2},n.prototype.update=function(t){var n=t.resolution;if(this.En||this.Mn!==n){this.En=!1,this.Mn=n;var i=this.Tn,r=this._uvs,e=this.In,u=this.kt,s=this.pn,h=Math.min(.5*u,.5*s,this.On),o=1/n,a=h,c=u-h,f=u,l=h,v=s-h,b=s,d=this.Dn,g=!(d&ki.TOP_LEFT),m=!(d&ki.TOP_RIGHT),w=!(d&ki.BOTTOM_LEFT),p=!(d&ki.BOTTOM_RIGHT),O=-1,D=-1,E=0,M=-1,S=Pi.N,T=S<<2,j=S<<1,N=6*S,I=this.getTables(),C=I[0],A=I[1],R=I[2],k=I[3];g?this.fillVertices(i,r,O,D,S,a,l,h,o,C):this.fillVertices(i,r,O,D,S,0,0,0,0,C),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,m?this.fillVertices(i,r,O,D,S,c,l,h,o,A):this.fillVertices(i,r,O,D,S,f,0,0,0,A),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,p?this.fillVertices(i,r,O,D,S,c,v,h,o,R):this.fillVertices(i,r,O,D,S,f,b,0,0,R),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,w?this.fillVertices(i,r,O,D,S,a,v,h,o,k):this.fillVertices(i,r,O,D,S,0,b,0,0,k),this.fillIndicesEnd(e,E,M,S),O+=T,D+=T,E+=j,M+=N,E=2;for(var L=1,y=4*S-1;L<y;L+=1,E+=2)e[++M]=0,e[++M]=E,e[++M]=E+2;this.Sn.update(),this.jn.update(),this.Nn.update()}},n}(Pi),Ui=function(n){function i(i){var r=n.call(this,new Fi,new t.MeshMaterial(i))||this;return i.on("update",(function(){st.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Gi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Cn;return null==i&&((i=new Ui(n.getBackgroundTexture())).parent=t,this.Cn=i),i},t.prototype.hide=function(){var t=this.Cn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.background,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=this.get(t,r);c.tint=o,c.alpha=a,c.width=n,c.height=i,c.cornerRadius=u,c.cornerMask=s,c.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Cn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Cn)||void 0===t||t.updateTransform()},t}(),Hi=function(t){function n(){var n=t.call(this,new Float32Array(32*Pi.N),new Float32Array(32*Pi.N),new Uint16Array(72*Pi.N))||this;return n.An=0,n.Rn=Ci.NONE,n}return _(n,t),Object.defineProperty(n.prototype,"borderWidth",{get:function(){return this.An},set:function(t){this.An!==t&&(this.An=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"borderMask",{get:function(){return this.Rn},set:function(t){this.Rn!==t&&(this.Rn=t,this.En=!0)},enumerable:!1,configurable:!0}),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=.5*a,l=h-f,v=h+f,b=c.cos,d=c.sin,g=b[0],m=d[0],w=b[e-1],p=d[e-1],O=u+(g+w)*l,D=s+(m+p)*l,E=0;E<e;++E){var M=b[E],S=d[E],T=o,j=o,N=M*g+S*m;if(1e-4<N){var I=1/N-1;T=Math.min(T,I*l),j=Math.min(j,I*v)}var C=M*w+S*p;if(1e-4<C){var A=1/C-1;T=Math.min(T,A*l),j=Math.min(j,A*v)}var R=l+T,k=v+j;0<l?(t[++i]=u+M*l,t[++i]=s+S*l,t[++i]=u+M*R,t[++i]=s+S*R):(t[++i]=O,t[++i]=D,t[++i]=O,t[++i]=D),t[++i]=u+M*v,t[++i]=s+S*v,t[++i]=u+M*k,t[++i]=s+S*k,n[++r]=.5*(1+M),n[++r]=.5*(1+S),n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+M),n[++r]=.5*(1+S)}},n.prototype.fillIndices=function(t,n,i,r,e,u){for(var s=0,h=r-1;s<h;++s)t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2;e?u?(t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=1,t[++i]=1,t[++i]=n+1,t[++i]=2,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=2,t[++i]=2,t[++i]=n+1,t[++i]=3,n+=2):(t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2):(t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=2)},n.prototype.update=function(t){var n=t.resolution;if(this.En||this.Mn!==n){this.En=!1,this.Mn=n;var i=this.Tn,r=this._uvs,e=this.In,u=this.kt,s=this.pn,h=this.An,o=Math.min(.5*u,.5*s,this.On),a=1/n,c=o,f=u-o,l=u,v=o,b=s-o,d=s,g=this.Rn,m=!(g&Ci.TOP),w=!(g&Ci.BOTTOM),p=!(g&Ci.LEFT),O=!(g&Ci.RIGHT),D=this.Dn,E=!(D&ki.TOP_LEFT),M=!(D&ki.TOP_RIGHT),S=!(D&ki.BOTTOM_LEFT),T=!(D&ki.BOTTOM_RIGHT),j=-1,N=-1,I=0,C=-1,A=Pi.N,R=A<<2,k=A<<3,L=18*A,y=this.getTables(),x=y[0],B=y[1],_=y[2],P=y[3];E?p||m?this.fillVertices(i,r,j,N,A,c,v,o,a,h,x):this.fillVertices(i,r,j,N,A,c,v,o,0,0,x):p||m?this.fillVertices(i,r,j,N,A,0,0,0,0,h,x):this.fillVertices(i,r,j,N,A,0,0,0,0,0,x),this.fillIndices(e,I,C,A,m,!1),j+=k,N+=k,I+=R,C+=L,M?m||O?this.fillVertices(i,r,j,N,A,f,v,o,a,h,B):this.fillVertices(i,r,j,N,A,f,v,o,0,0,B):m||O?this.fillVertices(i,r,j,N,A,l,0,0,0,h,B):this.fillVertices(i,r,j,N,A,l,0,0,0,0,B),this.fillIndices(e,I,C,A,O,!1),j+=k,N+=k,I+=R,C+=L,T?O||w?this.fillVertices(i,r,j,N,A,f,b,o,a,h,_):this.fillVertices(i,r,j,N,A,f,b,o,0,0,_):O||w?this.fillVertices(i,r,j,N,A,l,d,0,0,h,_):this.fillVertices(i,r,j,N,A,l,d,0,0,0,_),this.fillIndices(e,I,C,A,w,!1),j+=k,N+=k,I+=R,C+=L,S?w||p?this.fillVertices(i,r,j,N,A,c,b,o,a,h,P):this.fillVertices(i,r,j,N,A,c,b,o,0,0,P):w||p?this.fillVertices(i,r,j,N,A,0,d,0,0,h,P):this.fillVertices(i,r,j,N,A,0,d,0,0,0,P),this.fillIndices(e,I,C,A,p,!0),j+=k,N+=k,I+=R,C+=L,this.Sn.update(),this.jn.update(),this.Nn.update()}},n}(Pi),zi=function(n){function i(i){var r=n.call(this,new Hi,new t.MeshMaterial(i))||this;return i.on("update",(function(){st.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderWidth",{get:function(){return this.geometry.borderWidth},set:function(t){this.geometry.borderWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderMask",{get:function(){return this.geometry.borderMask},set:function(t){this.geometry.borderMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Vi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Cn;return null==i&&((i=new zi(n.getBorderTexture())).parent=t,this.Cn=i),i},t.prototype.hide=function(){var t=this.Cn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.border,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Cn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Cn)||void 0===t||t.updateTransform()},t}(),Wi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Cn;return null==i&&((i=new zi(n.getBorderTexture())).parent=t,this.Cn=i),i},t.prototype.hide=function(){var t=this.Cn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.outline,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=h.getOffset(e)+(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Cn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Cn)||void 0===t||t.updateTransform()},t}(),Xi=function(){function t(t){var n=new Gi;this.kn=n,t.snippet.add(n,!0);var i=new Vi;this.Ln=i,t.snippet.add(i,!0);var r=new Wi;this.yn=r,t.snippet.add(r,!1),t.reflowable.add(this)}return t.prototype.onReflow=function(t,n,i){var r=t.theme,e=t.state,u=t.corner,s=u.getRadius(),h=u.getMask();this.kn.onReflow(t,n,i,r,e,s,h),this.Ln.onReflow(t,n,i,r,e,s,h),this.yn.onReflow(t,n,i,r,e,s,h)},t}(),Ki={NONE:0,BEFORE:1,AFTER:2,BOTH:3},Yi={OPEN:0,CLOSE:1,PARENSESIS:2,ADD_OR_PLUS:3,SUB_OR_MINUS:4,PLUS:5,MINUS:6,ADD:7,SUB:8,MUL:9,DIV:10,MIN:11,MAX:12,COMMA:13,PARENT:14,SELF:15,PADDING:16,CURRENT:17,NUMBER:18},Ji=function(){function t(t){var n=this.toToken(t),i=0;do{i=this.toParensesis(n,i)}while(i<n.length);if(this.toUnary(n),this.toArithmetic(n,Yi.MUL,Yi.DIV),this.toArithmetic(n,Yi.ADD,Yi.SUB),1===n.length){var r=n[0];if(!pt(r))return void(this.xn=r)}throw new Error("Failed to parse '".concat(t,"'"))}return t.prototype.toParensesis=function(t,n){for(var i=t.length,r=n;r<i;++r)if(t[r]===Yi.OPEN){var e=r,u=Yi.PARENSESIS;if(0<r){var s=t[r-1];s!==Yi.MIN&&s!==Yi.MAX||(e-=1,u=s)}for(var h=r+1;h<i;++h){var o=t[h];if(o===Yi.CLOSE)return t[e]=[u,this.toComma(t,r+1,h)],t.splice(e+1,h-e),e+1;o===Yi.OPEN&&(h=this.toParensesis(t,h)-1,i=t.length)}throw new Error("Malformed parensesis")}return i},t.prototype.toCommaOf=function(t,n,i){var r=i-n;if(r<=0)return[Yi.NUMBER,0];if(r<=1)return t[n];for(var e=[],u=n;u<i;++u)e.push(t[u]);return[Yi.PARENSESIS,e]},t.prototype.toComma=function(t,n,i){for(var r=null,e=n,u=n;u<i;++u)t[u]===Yi.COMMA&&((r=r||[]).push(this.toCommaOf(t,e,u)),e=u+1);if(e<i){if(null==r){var s=[];for(u=e;u<i;++u)s.push(t[u]);return s}r.push(this.toCommaOf(t,e,i))}return r||[]},t.prototype.toUnaryNode=function(t){pt(t)||t[0]!==Yi.PARENSESIS&&t[0]!==Yi.MIN&&t[0]!==Yi.MAX||this.toUnary(t[1])},t.prototype.toUnary=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r===Yi.ADD_OR_PLUS||r===Yi.SUB_OR_MINUS)if(n<=0||pt(t[n-1])){if(!(n+1<i)||pt(t[n+1]))throw new Error("Malformed unary operator");var e=t.splice(n+1,1)[0],u=r===Yi.ADD_OR_PLUS?Yi.PLUS:Yi.MINUS;t[n]=[u,e],i=t.length,this.toUnaryNode(e)}else u=r===Yi.ADD_OR_PLUS?Yi.ADD:Yi.SUB,t[n]=u;else this.toUnaryNode(r),i=t.length}},t.prototype.toArithmeticNode=function(t,n,i){pt(t)||(t[0]===Yi.PARENSESIS||t[0]===Yi.MIN||t[0]===Yi.MAX?this.toArithmetic(t[1],n,i):t[0]===Yi.PLUS||t[0]===Yi.MINUS?this.toArithmeticNode(t[1],n,i):t[0]!==Yi.ADD&&t[0]!==Yi.SUB&&t[0]!==Yi.MUL&&t[0]!==Yi.DIV||(this.toArithmeticNode(t[1],n,i),this.toArithmeticNode(t[2],n,i)))},t.prototype.toArithmetic=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(u===n||u===i){if(0<r&&r+1<e){var s=t[r-1],h=t[r+1];if(!pt(s)&&!pt(h)){t.splice(r,2),t[r-1]=[u,s,h],r-=1,e=t.length,this.toArithmeticNode(s,n,i),this.toArithmeticNode(h,n,i);continue}}throw new Error("Malformed operands for the operator ".concat(u))}this.toArithmeticNode(u,n,i),e=t.length}},t.prototype.toToken=function(n){for(var i=[];;){var r=t.TOKEN_REGEX.exec(n);if(null==r)break;var e=r[0],u=this.toTokenOperator(e);if(null!=u)i.push(u);else{var s=parseFloat(e);if(s!=s)throw new Error("Unexpected token '".concat(e,"' at ").concat(r.index," in '").concat(n,"'"));var h=this.toTokenLiteral(e);null!=h?i.push([h,.01*s]):i.push([Yi.NUMBER,s])}}return i},t.prototype.toTokenOperator=function(t){switch(t){case"+":return Yi.ADD_OR_PLUS;case"-":return Yi.SUB_OR_MINUS;case"*":return Yi.MUL;case"/":return Yi.DIV;case"(":return Yi.OPEN;case")":return Yi.CLOSE;case",":return Yi.COMMA;case"min":return Yi.MIN;case"max":return Yi.MAX}return null},t.prototype.toTokenLiteral=function(t){var n=t.length;if(0<n)switch(t[n-1]){case"%":return Yi.PARENT;case"s":return Yi.SELF;case"p":return Yi.PADDING;case"c":return Yi.CURRENT}return null},t.prototype.evaluate=function(t,n,i,r,e){switch(t[0]){case Yi.PARENSESIS:var u=t[1];return this.evaluate(u[u.length-1],n,i,r,e);case Yi.PLUS:return+this.evaluate(t[1],n,i,r,e);case Yi.MINUS:return-this.evaluate(t[1],n,i,r,e);case Yi.ADD:return this.evaluate(t[1],n,i,r,e)+this.evaluate(t[2],n,i,r,e);case Yi.SUB:return this.evaluate(t[1],n,i,r,e)-this.evaluate(t[2],n,i,r,e);case Yi.MUL:return this.evaluate(t[1],n,i,r,e)*this.evaluate(t[2],n,i,r,e);case Yi.DIV:return this.evaluate(t[1],n,i,r,e)/this.evaluate(t[2],n,i,r,e);case Yi.MIN:if(0<t[1].length){for(var s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.min(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Yi.MAX:if(0<t[1].length){for(s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.max(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Yi.PARENT:return t[1]*n;case Yi.SELF:return t[1]*i;case Yi.PADDING:return t[1]*r;case Yi.CURRENT:return t[1]*e;case Yi.NUMBER:return t[1]}return 0},t.prototype.calculate=function(t,n,i,r){return this.evaluate(this.xn,t,n,i,r)},t.TOKEN_REGEX=/(?:\+|-|\*|\/|\(|\)|min|max|,|(?:\d+(?:\.\d*)?[%psc]?))/g,t}(),Zi=function(t,n){return.5*(t-n)},qi=function(t,n,i){return i},Qi=function(t){return t},$i=function(t,n,i){return t-i},tr=function(){function t(){}return t.position=function(t){if(null==t||pt(t))return null;if(Ot(t)){switch(t){case"center":case"CENTER":return Zi;case"padding":case"PADDING":return qi}var n=new Ji(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(wt(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t.size=function(t){if(null==t||pt(t))return null;if(Ot(t)){switch(t){case"100%":case"maximized":case"MAXIMIZED":return Qi;case"padding":case"PADDING":return $i}var n=new Ji(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(wt(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t}(),nr=function(){function t(){}return t.isActivateKey=function(t){return"Space"===t.key||"Enter"===t.key||32===t.which||13===t.which},t.isArrowUpKey=function(t){return"ArrowUp"===t.key||38===t.which},t.isArrowDownKey=function(t){return"ArrowDown"===t.key||40===t.which},t.isArrowLeftKey=function(t){return"ArrowLeft"===t.key||37===t.which},t.isArrowRightKey=function(t){return"ArrowRight"===t.key||39===t.which},t.isCancelKey=function(t){return"Esc"===t.key||27===t.which},t.isFocusKey=function(t){return"Tab"===t.key||9===t.which},t.isUndoKey=function(t){return t.ctrlKey&&("z"===t.key||90===t.which)},t.isRedoKey=function(t){return t.ctrlKey&&("y"===t.key||89===t.which)},t.isSaveKey=function(t){return t.ctrlKey&&!t.shiftKey&&("s"===t.key||83===t.which)},t.isSaveAsKey=function(t){return t.ctrlKey&&t.shiftKey&&("S"===t.key||83===t.which)},t.isDeleteKey=function(t){return"Delete"===t.key||46===t.which},t.isSelectAllKey=function(t){return t.ctrlKey&&!t.shiftKey&&("a"===t.key||65===t.which)},t.isOkKey=function(t){return"Enter"===t.key||13===t.which},t.getFocusDirection=function(t){return!0!==t.shiftKey},t.toShortcut=function(t){if(Ot(t)){var n,i=t,r=i.indexOf("->"),e=void 0;0<=r?(e=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+2).trim()):e=i.trim().toLowerCase();for(var u=!1,s=!1,h=!1,o="a",a=e.length,c=0,f=1;f<a;++f)if("+"===e.charAt(f)){var l=e.substring(c,f);switch(l){case"alt":u=!0;break;case"ctrl":s=!0;break;case"shift":h=!0;break;default:o=l}c=f+=1}return c!==f&&(o=e.substring(c,f)),function(t){var n=t.key;if(n.length<=1){t.shift&&(t.key=n.toUpperCase());var i=n.charCodeAt(0);t.which=97<=i&&i<=122?i-32:i}else switch(n){case"enter":t.key="Enter",t.which=13;break;case"space":t.key=" ",t.which=32;break;case"escape":t.key="Escape",t.which=27;break;case"f1":t.key="F1",t.which=112;break;case"f2":t.key="F2",t.which=113;break;case"f3":t.key="F3",t.which=114;break;case"f4":t.key="F4",t.which=115;break;case"f5":t.key="F5",t.which=116;break;case"f6":t.key="F6",t.which=117;break;case"f7":t.key="F7",t.which=118;break;case"f8":t.key="F8",t.which=119;break;case"f9":t.key="F9",t.which=120;break;case"f10":t.key="F10",t.which=121;break;case"f11":t.key="F11",t.which=122;break;case"f12":t.key="F12",t.which=123;break;case"capslock":t.key="CapsLock",t.shift?t.which=20:t.which=240;break;case"arrowup":t.key="ArrowUp",t.which=38;break;case"arrowdown":t.key="ArrowDown",t.which=40;break;case"arrowleft":t.key="ArrowLeft",t.which=37;break;case"arrowright":t.key="ArrowRight",t.which=39;break;case"insert":t.key="Insert",t.which=45;break;case"delete":t.key="Delete",t.which=46;break;case"pageup":t.key="PageUp",t.which=33;break;case"pagedown":t.key="PageDown",t.which=34;break;case"backspace":t.key="Backspace",t.which=8;break;case"colon":t.key=":",t.which=186;break;case"semicolon":t.key=";",t.which=187;break;case"pause":t.key="Pause",t.which=19;break;case"scrolllock":t.key="ScrollLock",t.which=145;break;case"tab":t.key="Tab",t.which=9;break;case"plus":t.key="+",t.which=187;break;case"minus":t.key="-",t.which=189}return t}({alt:u,ctrl:s,shift:h,key:o,which:0,event:n})}return t},t.toString=function(t){var n=[];return t.ctrl&&n.push("Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),n.push(t.key.toUpperCase()),n.join("+")},t.on=function(t,n,i){var r=this.toShortcut(n);document.body.addEventListener("keydown",(function(n){n.altKey!==r.alt||n.ctrlKey!==r.ctrl||n.shiftKey!==r.shift||n.key!==r.key&&n.which!==r.which||(t.state.isActionable&&(null!=r.event?t.emit(r.event):null!=i&&i(n)),n.preventDefault())}))},t.moveFocusVertically=function(n,i,r){if(i.state.isActionable){var e=t.isArrowUpKey(n),u=t.isArrowDownKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocusHorizontally=function(n,i,r){if(i.state.isActionable){var e=t.isArrowLeftKey(n),u=t.isArrowRightKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocus=function(t,n,i){var r,e=null!==(r=null==i?void 0:i.picked)&&void 0!==r?r:st.getLayer(n);if(e){var u=e.getFocusController(),s=u.get();if(null!=s){var h=u.find(s,!1,s.state.isFocusRoot||t,t,n);if(null!=h)return u.focus(h),!0}}return!1},t}(),ir=function(){function t(){}return Object.defineProperty(t,"touchable",{get:function(){return"ontouchstart"in document},enumerable:!1,configurable:!0}),Object.defineProperty(t,"tap",{get:function(){return"pointertap"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"down",{get:function(){return"pointerdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"enter",{get:function(){return"pointerenter"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"leave",{get:function(){return"pointerleave"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"move",{get:function(){return"pointermove"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"out",{get:function(){return"pointerout"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"over",{get:function(){return"pointerover"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"up",{get:function(){return"pointerup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"upoutside",{get:function(){return"pointerupoutside"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cancel",{get:function(){return"pointercancel"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"righttap",{get:function(){return"rightclick"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightdown",{get:function(){return"rightdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightup",{get:function(){return"rightup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightupoutside",{get:function(){return"rightupoutside"},enumerable:!1,configurable:!0}),t.toGlobal=function(t,n,i){if("touches"in t){var r=t.changedTouches,e=r[r.length-1];null!=e?n.mapPositionToPoint(i,e.clientX,e.clientY):n.mapPositionToPoint(i,0,0)}else n.mapPositionToPoint(i,t.clientX,t.clientY);return i},t.onDblClick=function(t,n){var i=this;if(t.addEventListener("dblclick",(function(t){return n(t,!1)})),this.touchable){var r=0,e=0,u=0,s=0;t.addEventListener("touchstart",(function(t){if(0===r||2===r){var n=t.touches,i=n.length;if(i<=0)r=0;else{var s=n.item(i-1);null!=s?(r+=1,e=s.clientX,u=s.clientY):r=0}}else r=0})),t.addEventListener("touchend",(function(t){if(1===r||3===r){var h=t.changedTouches,o=h.length;if(o<=0)r=0;else{var a=h[o-1];if(null!=a){var c=e-a.clientX,f=u-a.clientY;i.CLICK_DISTANCE_THRESHOLD<=Math.abs(c)+Math.abs(f)?r=0:1===r?(s=t.timeStamp,r=2):t.timeStamp-s<i.DBLCLICK_INTERVAL_THRESHOLD?(r=0,n(t,!0)):(s=t.timeStamp,r=2)}else r=0}}else r=0})),t.addEventListener("touchcancel",(function(){r=0}))}},t.contains=function(t,n){for(var i=n;null!=i&&i!==t;)i=i.parent;return i===t},t.CLICK_DISTANCE_THRESHOLD=10,t.DBLCLICK_INTERVAL_THRESHOLD=333,t.LONG_CLICK_THRESHOLD=750,t}(),rr=function(){function t(){this.Bn=!1}return Object.defineProperty(t.prototype,"isOff",{get:function(){return!this.Bn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOn",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),t.prototype.toCoordinate=function(t){return this.Bn?"auto":t},t.prototype.from=function(t){return"auto"===t||"AUTO"===t?(this.Bn=!0,!0):(this.Bn=!1,!1)},t}(),er=function(){this.width=new rr,this.height=new rr},ur=function(){function t(t){this.p=t,this._n=[],this.Pn=[],this.Fn=!0}return Object.defineProperty(t.prototype,"renderable",{get:function(){return this.Fn},set:function(t){this.Fn=t},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){(n?this._n:this.Pn).push(t),"parent"in t&&(t.parent=this.p)},t.prototype.addAt=function(t,n,i){var r=n?this._n:this.Pn;0===i?r.unshift(t):0<i&&i<r.length?r.splice(i,0,t):r.push(t),"parent"in t&&(t.parent=this.p)},t.prototype.remove=function(t,n){var i=n?this._n:this.Pn,r=i.indexOf(t);0<=r&&(i.splice(r,1),"parent"in t&&(t.parent=null))},t.prototype.render=function(t,n){if(this.Fn)for(var i=n?this._n:this.Pn,r=0,e=i.length;r<e;++r){var u=i[r];u.updateTransform(),u.render(t)}},t}(),sr=function(){function t(){this.Un=[]}return t.prototype.add=function(t){this.Un.push(t)},t.prototype.remove=function(t){var n=this.Un,i=n.indexOf(t);0<=i&&n.splice(i,1)},t.prototype.onReflow=function(t,n,i){for(var r=this.Un,e=0,u=r.length;e<u;++e)r[e].onReflow(t,n,i)},t}(),hr=function(n){function i(t){var r,e,u,s,h,o,a,c,f,l=this,v=(l=n.call(this)||this).transform;l._=new _i(v.position,(function(t,n,i,r){l.onMove(t,n,i,r)})),l.Gn=new _i(v.scale,(function(t,n,i,r){l.onScale(t,n,i,r)})),l.Hn=new _i(v.skew,(function(t,n,i,r){l.onSkew(t,n,i,r)})),l.zn=t;var b=l.Vn={};l.Wn=new er,l.En=!0,l.Xn=!1,l.Kn=!1,l.Yn=null,l.name=null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"";var d=function(t){var n=null==t?void 0:t.theme;if(n)return Ot(n)?Z.getInstance().get(n):n}(t)||l.getThemeDefault();l.cn=d,l.Jn=new ur(l),l.Zn=new sr,l.qn=Ai(null!==(e=null==t?void 0:t.clear)&&void 0!==e?e:d.getClearType(),Ki),l.Qn=new Bi(d,t,(function(){l.toParentResized(),l.toHierarchyDirty(),st.update(l)}));var g=function(){l.toDirty(),st.update(l)};l.kn=new Ii(d,t,g),l.Ln=new Ri(d,t,g),l.yn=new xi(d,t,g),l.hn=new Li(d,t,g);var m=v.position,w=null!==(u=null==t?void 0:t.x)&&void 0!==u?u:d.getX();pt(w)?m.x=w:(m.x=0,b.x=tr.position(w));var p=null!==(s=null==t?void 0:t.y)&&void 0!==s?s:d.getY();pt(p)?m.y=p:(m.y=0,b.y=tr.position(p));var O=null!==(h=null==t?void 0:t.width)&&void 0!==h?h:d.getWidth();l.Wn.width.from(O)?l.kt=100:pt(O)?l.kt=O:(l.kt=100,b.width=tr.size(O));var D=null!==(o=null==t?void 0:t.height)&&void 0!==o?o:d.getHeight();if(l.Wn.height.from(D)?l.pn=100:pt(D)?l.pn=D:(l.pn=100,b.height=tr.size(D)),null!=t){var E=t.visible;null!=E&&(l.visible=E)}if(null!=t){var M=t.renderable;null!=M&&(l.renderable=M)}l.Rt=new Et((function(t,n){l.onStateChange(t,n)}));var S,T=Ai(null!==(a=null==t?void 0:t.interactive)&&void 0!==a?a:d.getInteractive(),yi);if(l.interactive=!!(T&yi.SELF),l.interactiveChildren=!!(T&yi.CHILDREN),null!=t){var j=t.on;if(null!=j)for(var N in j){var I=j[N];I&&l.on(N,I)}}if(l.$n=null!==(c=null==t?void 0:t.title)&&void 0!==c?c:d.getTitle(),l.nn=null!==(f=null==t?void 0:t.weight)&&void 0!==f?f:d.getWeight(),l.initReflowable(),l.ti=function(){st.update(l)},null!=t&&(S=t.shadow),void 0===S&&(S=d.getShadow()),S)if(Ot(S))switch(S){case"WEAK":l.shadow=d.newShadowWeak();break;case"DEFAULT":l.shadow=d.newShadow()}else l.shadow=S;l.on(ir.over,(function(t){l.onOver(t)})),l.on(ir.out,(function(t){l.onOut(t)})),l.on(ir.down,(function(t){l.onDown(t)})),l.on(ir.up,(function(t){l.onUp(t)})),l.on("added",(function(){l.toParentResized(),(l.isDirty()||l.hasDirty())&&l.toParentHasDirty(),l.Kn&&l.toParentHierarchyDirty();var t=l.parent;t instanceof i&&(l.state.parent=t.state),st.update(l)})),l.on("removed",(function(){l.blur(!0),l.state.parent=null,st.update(l)}));var C,A=function(t){if(t){var n=t.shortcut,i=t.shortcuts;if(null!=i||null!=n){var r=[];if(null!=n&&r.push(nr.toShortcut(n)),null!=i)for(var e=0,u=i.length;e<u;++e)r.push(nr.toShortcut(i[e]));return r}}}(t);if(l.ni=A,null!=A)for(var R=function(t){l.onShortcut(t)},k=0,L=A.length;k<L;++k)nr.on(l,A[k],R);if(l.init(t),d.newState(l.Rt),null!=t){var y=t.state;if(null!=y){var x=l.Rt;if(Ot(y))x.add(y);else if(mt(y))x.addAll(y);else{var B=y.values;null!=B&&(Ot(B)?x.add(B):x.addAll(B));var _=y.blinkers;if(null!=_){var P=x.blinker;for(k=0,L=_.length;k<L;++k){var F=_[k];P.add(F.state,F.interval)}}var U=y.tickers;if(null!=U){var G=x.ticker;for(k=0,L=U.length;k<L;++k){var H=U[k];G.add(H.state,H.interval)}}}}}if(null!=t){var z=t.parent;null!=z&&z.addChild(l)}if(null!=t){var V=t.children;if(null!=V)for(k=0,L=V.length;k<L;++k){var W=V[k];null!=W&&l.addChild(W)}}return null!=t&&(C=t.cursor,l.ii=C),l.cursor=l.toCursor(C,l.Rt),l.emit("init",l),l}return _(i,n),i.prototype.toCursor=function(t,n){if(t)if(wt(t)){var i=t(n);if(void 0!==i)return i}else if(void 0!==t)return t;return this.theme.getCursor(n)},Object.defineProperty(i.prototype,"snippet",{get:function(){return this.Jn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"reflowable",{get:function(){return this.Zn},enumerable:!1,configurable:!0}),i.prototype.initReflowable=function(){new Xi(this)},i.prototype.onChildrenChange=function(){this.toHierarchyDirty(),n.prototype.onChildrenChange.call(this)},i.prototype.onShortcut=function(t){this.emit("shortcut",t,this)},i.prototype.init=function(t){},Object.defineProperty(i.prototype,"weight",{get:function(){return this.nn},enumerable:!1,configurable:!0}),i.prototype.onMove=function(t,n,r,e){for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof i&&o.onParentMove(t,n,r,e)}st.update(this),this.emit("move",t,n,r,e,this)},i.prototype.resize=function(t,n){var i=this.kt,r=this.pn,e=null!=t?t:i,u=null!=n?n:r,s=i!==e,h=r!==u;s&&(this.kt=e),h&&(this.pn=u);var o,a=s||h;if(a&&this.onResize(e,u,i,r),s&&null!=(o=this.Vn).x){var c=this._,f=this.getParentOfSize();f&&(this._.x=o.x(f.width,e,f.padding.getLeft(),c.x))}if(h&&null!=(o=this.Vn).y){c=this._;var l=this.getParentOfSize();l&&(this._.y=o.y(l.height,u,l.padding.getTop(),c.y))}return a},i.prototype.getClearType=function(){return this.qn},i.prototype.onResize=function(t,n,r,e){this.toDirty(),this.toHierarchyDirty();for(var u=this.Qn,s=this.children,h=0,o=s.length;h<o;++h){var a=s[h];a instanceof i&&a.onParentResize(t,n,u)}st.update(this),this.emit("resize",t,n,r,e,this)},i.prototype.onScale=function(t,n,i,r){st.update(this),this.emit("scale",t,n,i,r,this)},i.prototype.onSkew=function(t,n,i,r){st.update(this),this.emit("skew",t,n,i,r,this)},Object.defineProperty(i.prototype,"type",{get:function(){return this.getType()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"x",{get:function(){return this._.x},set:function(t){this.setX(t)},enumerable:!1,configurable:!0}),i.prototype.getX=function(){var t=this.Vn;return null!=t.x?t.x:this._.x},i.prototype.setX=function(t){var n=this.Vn;if(pt(t)){var i=this._;i.x!==t?(n.x=void 0,i.x=t):void 0!==n.x&&(n.x=void 0,this.toParentResized())}else{var r=tr.position(t);n.x!==r&&(n.x=r,this.toParentResized())}},Object.defineProperty(i.prototype,"y",{get:function(){return this._.y},set:function(t){this.setY(t)},enumerable:!1,configurable:!0}),i.prototype.getY=function(){var t=this.Vn;return null!=t.y?t.y:this._.y},i.prototype.setY=function(t){var n=this.Vn;if(pt(t)){var i=this._;i.y!==t?(n.y=void 0,i.y=t):void 0!==n.y&&(n.y=void 0,this.toParentResized())}else{var r=tr.position(t);n.y!==r&&(n.y=r,this.toParentResized())}},Object.defineProperty(i.prototype,"width",{get:function(){return this.kt},set:function(t){this.setWidth(t)},enumerable:!1,configurable:!0}),i.prototype.getWidth=function(){return this.Wn.width.toCoordinate(this.Vn.width||this.kt)},i.prototype.setWidth=function(t){var n=this.Wn.width,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),st.update(this)),!r){var e=this.Vn;if(pt(t)){var u=this.kt;if(u!==t){e.width=void 0,this.kt=t;var s=this.pn;if(this.onResize(t,s,u,s),null!=e.x){var h=this._,o=this.getParentOfSize();o&&(h.x=e.x(o.width,t,o.padding.getLeft(),h.x))}}else void 0!==e.width&&(e.width=void 0,this.toParentResized())}else{var a=tr.size(t);e.width!==a&&(e.width=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"height",{get:function(){return this.pn},set:function(t){this.setHeight(t)},enumerable:!1,configurable:!0}),i.prototype.getHeight=function(){return this.Wn.height.toCoordinate(this.Vn.height||this.pn)},i.prototype.setHeight=function(t){var n=this.Wn.height,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),st.update(this)),!r){var e=this.Vn;if(pt(t)){var u=this.pn;if(u!==t){e.height=void 0,this.pn=t;var s=this.kt;if(this.onResize(s,t,s,u),null!=e.y){var h=this._,o=this.getParentOfSize();o&&(h.y=e.y(o.height,t,o.padding.getTop(),h.y))}}else void 0!==e.height&&(e.height=void 0,this.toParentResized())}else{var a=tr.size(t);e.height!==a&&(e.height=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Gn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"skew",{get:function(){return this.Hn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Qn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"corner",{get:function(){return this.hn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"background",{get:function(){return this.kn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"border",{get:function(){return this.Ln},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outline",{get:function(){return this.yn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"unsafe",{get:function(){return this.transform},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this.$n},set:function(t){this.$n!==t&&(this.$n=t,this.state.isHovered&&this.applyTitle())},enumerable:!1,configurable:!0}),i.prototype.applyTitle=function(){var t=st.getLayer(this);t&&(t.view.title=this.$n)},i.prototype.show=function(){return this.visible||(this.visible=!0,this.toParentHierarchyDirty(),st.update(this)),this},i.prototype.isShown=function(){return this.visible},i.prototype.hide=function(){return this.visible&&(this.visible=!1,this.toParentHierarchyDirty(),this.blur(!0),st.update(this)),this},i.prototype.isHidden=function(){return!this.visible},i.prototype.toDirty=function(){return!this.En&&(this.En=!0,this.toParentHasDirty(),!0)},i.prototype.toHasDirty=function(){return!this.Xn&&(this.Xn=!0,this.toParentHasDirty(),!0)},i.prototype.toParentHasDirty=function(){var t=this.parent;t instanceof i&&t.toHasDirty()},i.prototype.toHierarchyDirty=function(){return!this.Kn&&(this.Kn=!0,this.onHierarchyDirty(),this.toParentHierarchyDirty(),!0)},i.prototype.toParentHierarchyDirty=function(){var t=this.parent;t instanceof i&&t.toHierarchyDirty()},i.prototype.isHierarchyDirty=function(){return this.Kn},i.prototype.onHierarchyDirty=function(){},i.prototype.isDirty=function(){return this.En},i.prototype.hasDirty=function(){return this.Xn},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=st.getLayer(this);n&&n.getFocusController().set(this,t)}return this},i.prototype.focus=function(){return this.setFocused(!0)},i.prototype.blur=function(t){if(t){var n=st.getLayer(this);if(n){var r=n.getFocusController().get();if(r instanceof i)for(var e=r;e;){if(e===this){r.setFocused(!1);break}e=e.parent}}}else this.setFocused(!1);return this},i.prototype.onStateChange=function(t,n){var r=this;this.toDirty(),st.update(this),this.emit("statechange",t,n,this);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}t.isFocused?(n.isFocused||this.onFocus(),t.inDisabled&&!n.inDisabled&&setTimeout((function(){r.blur()}),0)):n.isFocused&&this.onBlur(),this.cursor=this.toCursor(this.ii,t)},i.prototype.onChildFocus=function(t){var n=this.parent;n instanceof i&&n.onChildFocus(t)},i.prototype.onFocus=function(){var t=this.parent;t instanceof i&&t.onChildFocus(this)},i.prototype.onChildBlur=function(t){var n=this.parent;n instanceof i&&n.onChildBlur(t)},i.prototype.onBlur=function(){var t=this.parent;t instanceof i&&t.onChildBlur(this)},Object.defineProperty(i.prototype,"state",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"options",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"theme",{get:function(){return this.cn},set:function(t){this.cn!==t&&(this.cn=t,this.Qn.setTheme(t),this.kn.setTheme(t),this.Ln.setTheme(t),this.yn.setTheme(t),this.hn.setTheme(t),this.toDirty(),st.update(this))},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){var t=this.En;t&&(this.onReflow(),this.En=!1);var n=this.Xn,r=this.Kn;if(n||r){this.Xn=!1,this.Kn=!1;for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.reflow()}}(t||n||r)&&this.onRefit()},i.prototype.onRefit=function(){var t=this.Wn,n=t.width.isOn,i=t.height.isOn;if(n&&i){for(var r=0,e=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&(this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width)),this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height)));var h=this.padding;this.resize(r+h.getRight(),e+h.getBottom())}else if(n){for(r=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width));this.resize(r+this.padding.getRight(),void 0)}else if(i){var o;for(e=0,u=0,s=(o=this.children).length;u<s;++u){var a;(a=o[u]).visible&&this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height))}this.resize(void 0,e+this.padding.getBottom())}},i.prototype.isRefitable=function(t){return t instanceof i},i.prototype.hasRefitableHeight=function(t){return this.isRefitable(t)&&!(t instanceof i&&wt(t.getHeight()))},i.prototype.hasRefitableWidth=function(t){return this.isRefitable(t)&&!(t instanceof i&&wt(t.getWidth()))},i.prototype.onReflow=function(){this.Zn.onReflow(this,this.kt,this.pn)},Object.defineProperty(i.prototype,"shadow",{get:function(){return this.Yn},set:function(t){var n=this.Yn;if(n!==t){var i=this.Zn,r=this.Jn,e=this.ti;null!=n&&(n.off("update",e),i.remove(n),r.remove(n,!0)),this.Yn=t,null!=t&&(t.on("update",e),i.add(t),r.addAt(t,!0,0)),st.update(this)}},enumerable:!1,configurable:!0}),i.prototype.toParentResized=function(){var t=this.getParentOfSize();t&&this.onParentResize(t.width,t.height,t.padding)},i.prototype.getParentOfSize=function(){var t=this.parent;return t instanceof i?t:st.getLayer(this)},i.prototype.onParentResize=function(t,n,i){var r=this.Vn,e=this.transform.position,u=e.x,s=e.y,h=this.kt,o=this.pn,a=i.getLeft()+i.getRight(),c=i.getTop()+i.getBottom(),f=null!=r.width?r.width(t,h,a,h):h,l=null!=r.height?r.height(n,o,c,o):o;this.resize(f,l);var v=null!=r.x?r.x(t,this.kt,i.getLeft(),u):u,b=null!=r.y?r.y(n,this.pn,i.getTop(),s):s;this.position.set(v,b)},i.prototype.onParentMove=function(t,n,i,r){},i.prototype.onWheel=function(t,n,i){return this.emit("wheel",t,n,i,this),!1},i.prototype.onKeyDown=function(t){return this.emit("keydown",t,this),!1},i.prototype.onKeyUp=function(t){return this.emit("keyup",t,this),!1},i.prototype.isEventTarget=function(t){var n=t.target;if(n===this)return!0;if(null!=n&&!(n instanceof i&&n.interactive)){for(var r=n.parent;null!=r&&!(r instanceof i&&r.interactive);)r=r.parent;return r===this}return!1},i.prototype.onDown=function(t){this.isEventTarget(t)&&this.onDownThis(t),this.emit("down",t,this)},i.prototype.onDownThis=function(n){if("touches"in n.data.originalEvent){var i=this.ri||new t.Point;this.ri=i,i.copyFrom(n.data.global)}else this.focusOnClosest()},i.prototype.onUp=function(t){this.isEventTarget(t)&&this.onUpThis(t),this.emit("up",t,this)},i.prototype.onUpThis=function(t){if("touches"in t.data.originalEvent){var n=this.ri;if(n){var i=t.data.global,r=Math.abs(i.x-n.x),e=Math.abs(i.y-n.y),u=ir.CLICK_DISTANCE_THRESHOLD;r<u&&e<u&&this.focusOnClosest()}}},i.prototype.focusOnClosest=function(){var t=st.getLayer(this);if(t){var n=t.getFocusController();n.focus(n.findParent(this))}},i.prototype.onOver=function(t){this.state.isHovered=!0,t.target===this&&this.applyTitle(),this.emit("over",t,this)},i.prototype.onOut=function(t){this.state.isHovered=!1,this.emit("out",t,this)},i.prototype.onDblClick=function(t,n){return this.emit("dblclick",t,n,this),!1},i.prototype.render=function(t){if(this.visible&&0<this.worldAlpha&&this.renderable){var i=this.Jn;i.render(t,!0),n.prototype.render.call(this,t),i.render(t,!1)}},i.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},i.prototype.getType=function(){return"DBase"},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,r=this._bounds,e=i.WORK_CONTAINS_POINT;e.set(0,0),t.apply(e,e),r.addPoint(e),e.set(this.kt,this.pn),t.apply(e,e),r.addPoint(e),n.prototype._calculateBounds.call(this)},i.prototype.containsPoint=function(t){return this.containsGlobalPoint(t)||this.containsLocalPoint(this.worldTransform.applyInverse(t,i.WORK_CONTAINS_POINT))},i.prototype.containsGlobalPoint=function(t){return!1},i.prototype.containsLocalPoint=function(t){var n=t.x,i=t.y,r=this.kt,e=this.pn;return 0<=n&&n<=r&&0<=i&&i<=e},i.prototype.getClippingRect=function(t,n){n.x=0,n.y=0,n.width=this.kt,n.height=this.pn},i.prototype.destroy=function(){var t=this.Vn;t.x=null,t.y=null,t.width=null,t.height=null;var i=this.Yn;i&&(this.Yn=null,i.destroy());for(var r=this.children,e=r.length-1;0<=e;--e)r[e].destroy();r.length=0,n.prototype.destroy.call(this)},i.WORK_CONTAINS_POINT=new t.Point,i}(t.Container),or=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){var r=t.corner,e=Math.max(0,r.getRadius()-.5),u=r.getMask(),s=u&ki.TOP_LEFT?0:e,h=u&ki.TOP_RIGHT?0:e,o=u&ki.BOTTOM_LEFT?0:e,a=u&ki.BOTTOM_RIGHT?0:e;this.clear(),this.beginFill(16777215,1),this.lineStyle(0,0,0,0,!1),s<=0&&h<=0&&o<=0&&a<=0?this.drawRect(0,0,n,i):(this.moveTo(0+s,0),0<h?this.arcTo(0+n,0,0+n,0+i,h):this.lineTo(0+n,0),0<a?this.arcTo(0+n,0+i,0,0+i,a):this.lineTo(0+n,0+i),0<o?this.arcTo(0,0+i,0,0,o):this.lineTo(0,0+i),0<s?this.arcTo(0,0,0+n,0,s):this.lineTo(0,0)),this.endFill()},n}(t.Graphics),ar={NONE:0,CTRL:1,SHIFT:2,ALT:4,AND:8,OR:16,NOT_NONE:23},cr=function(){function t(){}return t.from=function(t){var n="data"in t?t.data.originalEvent:t;return(n.ctrlKey?ar.CTRL:ar.NONE)|(n.altKey?ar.ALT:ar.NONE)|(n.shiftKey?ar.SHIFT:ar.NONE)},t.match=function(n,i){return i&ar.OR?!!(t.from(n)&i):t.from(n)===i},t}(),fr={OFF:0,ON:1,TOUCH:2},lr=function(){function n(){this.pointers=new Map,this.center=new t.Point,this.scale=0,this.time=0}return n.prototype.start=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.isUpdatable=function(t){var n=t.data.originalEvent;return!("pointerId"in n)||this.pointers.has(n.pointerId)},n.prototype.update=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.end=function(t){var n=!0,i=t.data.originalEvent;if("touches"in i)n=i.touches.length<=0;else if("pointerId"in i){var r=this.pointers;r.delete(i.pointerId),n=r.size<=0}return this.doUpdate(t),n},n.prototype.bind=function(t){var n=this.interactionManager;if(n){var i=this.onMove;i&&n.on(ir.move,i);var r=this.onEnd;r&&(n.on(ir.up,r),n.on(ir.upoutside,r),n.on(ir.cancel,r))}},n.prototype.unbind=function(){var t=this.interactionManager;if(t){var n=this.onMove;n&&t.off(ir.move,n);var i=this.onEnd;i&&(t.off(ir.up,i),t.off(ir.upoutside,i),t.off(ir.cancel,i))}},n.prototype.doUpdate=function(t){var n=this.interactionManager,i=this.center,r=t.data.originalEvent;if(this.scale=0,this.time=r.timeStamp,"touches"in r){var e=r.touches,u=e.length;if(0<u){for(var s=0,h=0,o=0,a=e.length;o<a;++o)s+=(f=e[o]).clientX,h+=f.clientY;if(s/=u,h/=u,n?n.mapPositionToPoint(i,s,h):i.set(s,h),1<u){var c=0;for(o=1,a=e.length;o<a;++o){var f,l=(f=e[o]).clientX-s,v=f.clientY-h;c=Math.max(c,l*l+v*v)}this.scale=Math.sqrt(c)}}}else if("pointerId"in r){var b=this.pointers,d=b.size;if(0<d){var g=0,m=0;if(b.forEach((function(t){g+=t.clientX,m+=t.clientY})),g/=d,m/=d,n?n.mapPositionToPoint(i,g,m):i.set(g,m),1<d){var w=0;b.forEach((function(t){var n=t.clientX-g,i=t.clientY-m;w=Math.max(w,n*n+i*i)})),this.scale=Math.sqrt(w)}}}else i.copyFrom(t.data.global)},n}(),vr=function(){function t(){}return t.LINEAR=function(t){return t},t.ELASTIC=function(t){return t*(3*(1-t)*(1-t)+t*(3*(1-t)+t))},t.QUAD_IN_OUT=function(t){return t<.5?2*t*t:(4-2*t)*t-1},t}(),br=function(t){function n(n){var i,r,e,u=this;(u=t.call(this)||this).R=null,u.ei=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,u.si=0,u.hi=null!==(r=null==n?void 0:n.duration)&&void 0!==r?r:200,u.oi=1/Math.max(1,u.hi),u.ai=!1,u.ci=null==n?void 0:n.onTime,u.fi=function(){u.onTimeBase()},u.li=null==n?void 0:n.onStart,u.vi=null==n?void 0:n.onEnd,u.bi=null!==(e=null==n?void 0:n.timing)&&void 0!==e?e:vr.ELASTIC;var s=null==n?void 0:n.on;if(s)for(var h in s){var o=s[h];o&&u.on(h,o)}return u}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.ei},set:function(t){this.ei=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return this.hi},set:function(t){this.hi=t,this.oi=1/Math.max(1,t)},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.si=Date.now(),this.ai=t,this.R=window.setTimeout(this.fi,0),this.onStart(t);var n=this.hi,i=this.toTime(t?n:0);this.onTime(i,t,0)},n.prototype.onStart=function(t){var n=this.li;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ci;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.vi;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return null!=this.R},n.prototype.isReverse=function(){return this.ai},n.prototype.onTimeBase=function(){if(null!=this.R){this.R=null;var t=Date.now()-this.si,n=this.hi,i=this.ai;if(t<n){this.R=window.setTimeout(this.fi,0);var r=this.toTime(i?n-t:t);this.onTime(r,i,t)}else r=this.toTime(i?0:n),this.onTime(r,i,t),this.onEnd(i)}},n.prototype.toTime=function(t){return this.bi(t*this.oi,this)},n.prototype.stop=function(){var t=this.R;null!=t&&(this.R=null,window.clearTimeout(t))},n.prototype.end=function(){var t=this.R;if(null!=t){this.R=null,window.clearTimeout(t);var n=this.ai,i=Date.now()-this.si,r=this.hi,e=this.toTime(n?0:r);this.onTime(e,n,i),this.onEnd(n)}},n}(t.utils.EventEmitter),dr=function(){function t(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r}return t.prototype.set=function(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r},t}(),gr=function(){function t(t,n,i){var r,e=this;this.di=[],this.gi=[],this.wi=0,this.pi=-1,this.Oi=0,this.Di=0,this.Ei=0,this.Mi=0,this.Si=0,this._t=0,this.Ti=new br({onTime:function(t){e.onEase(t)},onEnd:function(){e.onEaseEnd()},timing:vr.LINEAR,duration:333*(null!==(r=null==i?void 0:i.duration)&&void 0!==r?r:1)}),this.ji=t,this.vi=n}return t.prototype.onStart=function(){for(var n=this.di,i=n.length,r=t.HISTORY_CAPACITY;i<r;++i)n.push(new dr(0,0,1,0));this.wi=0,this.pi=-1,this.Ti.stop()},t.prototype.onMove=function(n,i,r,e){var u=t.HISTORY_CAPACITY,s=this.pi,h=(s+1)%u;this.pi=h;var o=this.wi;(h<s||0<=s&&s<o)&&(this.wi=(o+1)%u),this.di[h].set(n,i,r,e)},t.prototype.updateHistoriesSorted=function(t){var n=this.di,i=this.gi,r=this.wi,e=this.pi,u=n.length;if(e<0)return i.length=0,t;if(e<r){var s=t;i.length=0;for(var h=e;0<=h;--h){var o=n[h];if(!(s+o.dt<160))return s;s+=o.dt,i.push(o)}for(h=u-1;r<=h;--h){var a=n[h];if(!(s+a.dt<160))return s;s+=a.dt,i.push(a)}return s}for(s=t,i.length=0,h=e;r<=h;--h){var c=n[h];if(!(s+c.dt<160))return s;s+=c.dt,i.push(c)}return s},t.prototype.onEnd=function(t){this.updateHistoriesSorted(t);var n=this.gi,i=n.length;if(i<=0)return this.onEaseEnd();for(var r=0,e=0,u=0,s=0,h=0;h<i;++h){var o=n[h];r+=o.dx,e+=o.dy,u+=o.ds,s+=o.dt}if(s<=0)return this.onEaseEnd();var a=1/i;r*=a,e*=a,u*=a,s*=a,this.Oi=r,this.Di=e,this.Ei=u,this.Mi=s;var c=this.Ti,f=c.duration;this._t=-t/f,this.Si=f/s,c.start()},t.prototype.onEase=function(t){var n=this._t;this._t=t;var i=(1-.5*(t+n))*(t-n)*this.Si;this.ji(this.Oi*i,this.Di*i,1+(this.Ei-1)*i,t)},t.prototype.onEaseEnd=function(){this.vi()},t.prototype.stop=function(){this.Ti.stop()},t.HISTORY_CAPACITY=5,t}(),mr=function(){function t(t){var n,i,r,e=t.on;e&&(this.li=e.start,this.ji=e.move,this.vi=e.end),this.Ni=null!==(n=null==t?void 0:t.modifier)&&void 0!==n?n:ar.NONE;var u=t.checker,s=cr.match;this.Ii=null!==(i=null==u?void 0:u.start)&&void 0!==i?i:s,this.Ci=null!==(r=null==u?void 0:u.move)&&void 0!==r?r:s,this.Ai=t.easing,this.Ri=!!t.touch,this.ki=[],this.Li=new Map;var h=t.bind;null!=h&&this.bind(h)}return t.prototype.newData=function(t){var n=this.Li,i=n.get(t);if(null!=i)return i;var r=this.ki.pop();if(null!=r)return n.set(t,r),r;var e=new lr;return e.easing=this.newEasing(e),e.onMove=this.newOnMove(e),e.onEnd=this.newOnEnd(e),n.set(t,e),e},t.prototype.newEasing=function(t){var n=this,i=this.Ai;if(null==i||!1!==i)return new gr((function(i,r,e,u){n.onEasingMove(i,r,e,u,t)}),(function(){n.onEasingEnd(t)}),this.toEasingOptions(i))},t.prototype.toEasingOptions=function(t){return null==t||!0===t?void 0:t},t.prototype.deleteData=function(t){var n=t.target;n&&this.Li.delete(n)&&(t.target=void 0,t.pointers.clear(),this.ki.push(t))},t.prototype.bind=function(t){var n=this;return t.on(ir.down,(function(i){n.onDown(t,i)})),this},t.prototype.isTouch=function(t){var n=t.data.originalEvent;return"touches"in n||"pointerId"in n&&"mouse"!==n.pointerType},t.prototype.onDown=function(t,n){var i;if((!this.Ri||this.isTouch(n))&&this.Ii(n,this.Ni,t)){var r=st.getLayer(t);if(null!=r)if(n.stopPropagation(),t.state.isGesturing)null===(i=this.Li.get(t))||void 0===i||i.start(n);else{var e=this.li;null!=e&&e(t);var u=this.newData(t);u.target=t,t.state.isGesturing=!0;var s=r.renderer.plugins.interaction;u.interactionManager=s,u.start(n);var h=u.easing;h&&h.onStart(),u.bind(n)}}},t.prototype.newOnMove=function(t){var n=this;return function(i){n.onMove(i,t)}},t.prototype.newOnEnd=function(t){var n=this;return function(i){n.onEnd(i,t)}},t.prototype.onMove=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.isUpdatable(t)&&this.Ci(t,this.Ni,i)){var r=n.center,e=r.x,u=r.y,s=n.scale,h=n.time;n.update(t);var o=r.x,a=r.y,c=n.scale,f=o-e,l=a-u,v=n.time-h,b=1e-5,d=b<s&&b<c?c/s:1,g=n.easing;g&&g.onMove(f,l,d,v);var m=this.ji;null!=m&&(0===f&&0===l&&1===d||m(i,f,l,o,a,d))}},t.prototype.onEnd=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.end(t)){i.state.isGesturing=!1;var r=n.interactionManager;if(n.interactionManager=void 0,r){var e=n.onMove;e&&r.off(ir.move,e);var u=n.onEnd;u&&(r.off(ir.up,u),r.off(ir.cancel,u))}var s=this.vi;null!=s&&s(i);var h=n.easing;h?h.onEnd(t.data.originalEvent.timeStamp-n.time):this.deleteData(n)}},t.prototype.onEasingMove=function(t,n,i,r,e){if(null!=e.target){var u=this.ji;if(null!=u&&(0!==t||0!==n||1!==i)){var s=e.center,h=s.x+t,o=s.y+n;s.set(h,o),u(e.target,t,n,h,o,i)}}},t.prototype.onEasingEnd=function(t){this.deleteData(t)},t.prototype.stop=function(t){var n,i=this.Li.get(t);null!=i&&(null===(n=i.easing)||void 0===n||n.stop(),this.deleteData(i))},t}(),wr=function(){function t(t,n,i,r,e,u){var s,h,o=this;this.p=t,this.yi=i,this.xi=r;var a=Ai(null!==(s=null==u?void 0:u.mode)&&void 0!==s?s:e.getGestureMode(),fr),c=Ai(null!==(h=null==u?void 0:u.modifier)&&void 0!==h?h:e.getGestureModifier(),ar);a!==fr.ON&&a!==fr.TOUCH||(this.Bi=new mr({touch:a===fr.TOUCH,modifier:c,checker:u&&u.checker,easing:{duration:null==u?void 0:u.duration},on:{start:function(){o.yi.stop()},move:function(i,r,e,u,s,h){o.onGestureMove(n(t),r,e,u,s,h)}}}))}return t.prototype.onGestureMove=function(t,n,i,r,e,u){if(t){var s=this.yi,h=t.scale,o=h.x,a=h.y,c=s.toNormalizedScale(o*u),f=s.toNormalizedScale(a*u),l=c/o,v=f/a,b=u<1?Math.max(l,v):Math.min(l,v);c=b*o,f=b*a;var d=r-n,g=e-i,m=t.position,w=(m.x-d)*b+r,p=(m.y-g)*b+e;this.xi(t,w,p,c,f)}},t.prototype.stop=function(){var t;null===(t=this.Bi)||void 0===t||t.stop(this.p)},t.prototype.onDown=function(t){var n;null===(n=this.Bi)||void 0===n||n.onDown(this.p,t)},t}(),pr=function(){function t(t,n,i,r,e){var u=this;this.p=t,this._i=n,this.xi=r,this.Pi=1,this.Fi=1,this.Ui=0,this.Gi=0,this.Hi=1,this.zi=1,this.Vi=0,this.Wi=0,this.Ti=new br({onTime:function(t){u.onTime(t)},duration:e}),this.yi=i,this.hi=e}return t.prototype.onTime=function(t){var n=1-t,i=t,r=this.Hi*n+this.Pi*i,e=this.zi*n+this.Fi*i,u=this.Vi*n+this.Ui*i,s=this.Wi*n+this.Gi*i,h=this._i(this.p);null!=h&&this.xi(h,u,s,r,e)},t.prototype.start=function(t,n,i,r,e,u,s){if(!1!==s&&this.yi.stop(),null==u&&(u=this.hi),u<=0)this.xi(t,n,i,r,e);else{var h=t.position,o=t.scale;this.Vi=h.x,this.Wi=h.y,this.Hi=o.x,this.zi=o.y,this.Ui=n,this.Gi=i,this.Pi=r,this.Fi=e,this.Ti.duration=u,this.Ti.start()}},t.prototype.stop=function(){this.Ti.stop()},t}(),Or=function(){function n(i,r,e){var u,s,h,o,a,c,f,l,v,b,d,g,m,w,p,O,D;this.p=i,this._i=r,this.xi=e&&e.constraint||n.CONSTRAINT,this.Xi=new t.Rectangle;var E=this.toTheme(e)||this.getThemeDefault(),M=null==e?void 0:e.zoom;this.Ki=new t.Point,this.Yi=null!==(u=null==M?void 0:M.min)&&void 0!==u?u:E.getZoomMin(),this.Ji=null!==(s=null==M?void 0:M.max)&&void 0!==s?s:E.getZoomMax(),this.Zi=null!==(h=null==M?void 0:M.keepRatio)&&void 0!==h?h:E.getZoomKeepRatio();var S=null==M?void 0:M.wheel;this.qi=null!==(o=null==S?void 0:S.enable)&&void 0!==o?o:E.isWheelZoomEnabled(),this.Qi=null!==(a=null==S?void 0:S.speed)&&void 0!==a?a:E.getWheelZoomSpeed(),this.$i=Ai(null!==(c=null==S?void 0:S.modifier)&&void 0!==c?c:E.getWheelZoomModifier(),ar),this.tr=null!==(f=null==S?void 0:S.checker)&&void 0!==f?f:cr.match;var T=null==M?void 0:M.dblclick;this.nr=null!==(l=null==T?void 0:T.enable)&&void 0!==l?l:E.isDblClickZoomEnabled(),this.ir=null!==(v=null==T?void 0:T.amount)&&void 0!==v?v:E.getDblClickZoomSpeed(),this.rr=Ai(null!==(b=null==T?void 0:T.modifier)&&void 0!==b?b:E.getDblClickZoomModifier(),ar),this.er=null!==(d=null==T?void 0:T.checker)&&void 0!==d?d:cr.match,this.ur=null!==(g=null==T?void 0:T.duration)&&void 0!==g?g:E.getDblClickZoomDuration();var j=null===(m=null==e?void 0:e.translation)||void 0===m?void 0:m.wheel;this.sr=null!==(w=null==j?void 0:j.enable)&&void 0!==w?w:E.isWheelTranslationEnabled(),this.hr=null!==(p=null==j?void 0:j.speed)&&void 0!==p?p:E.getWheelTranslationSpeed(),this.ar=Ai(null!==(O=null==j?void 0:j.modifier)&&void 0!==O?O:E.getWheelTranslationModifier(),ar),this.cr=null!==(D=null==j?void 0:j.checker)&&void 0!==D?D:cr.match,this.lr=new wr(i,r,this,this.xi,E,null==e?void 0:e.gesture),this.I=new pr(i,r,this,this.xi,this.ur)}return Object.defineProperty(n.prototype,"gesture",{get:function(){return this.lr},enumerable:!1,configurable:!0}),n.prototype.stop=function(){this.lr.stop(),this.I.stop()},n.prototype.reset=function(t,n){var i=this.p,r=this._i(i);if(r){var e=r.getLocalBounds(this.Xi),u=.5*(i.width-e.width)-e.x,s=.5*(i.height-e.height)-e.y;this.I.start(r,u,s,1,1,t,n)}},n.prototype.fit=function(t,n){var i=this.p,r=this._i(i);if(r){var e=i.padding,u=i.width,s=i.height,h=r.getLocalBounds(this.Xi),o=h.x,a=h.y,c=h.width,f=h.height,l=(u-e.getLeft()-e.getRight())/c,v=(s-e.getTop()-e.getBottom())/f;if(this.Zi){var b=this.toNormalizedScale(Math.min(l,v));l=b,v=b}else l=this.toNormalizedScale(l),v=this.toNormalizedScale(v);var d=.5*(u-c*l)-o*l,g=.5*(s-f*v)-a*v;this.I.start(r,d,g,l,v,t,n)}},n.prototype.zoomIn=function(t,n){var i=this._i(this.p);if(i){var r=this.ir,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomOut=function(t,n){var i=this._i(this.p);if(i){var r=1/this.ir,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomAt=function(t,n,i,r,e,u){var s=this._i(this.p);if(s){var h=s.scale.x,o=s.scale.y,a=this.toNormalizedScale(i),c=this.toNormalizedScale(r),f=a/h,l=c/o,v=(s.position.x-t)*f+t,b=(s.position.y-n)*l+n;this.I.start(s,v,b,a,c,e,u)}},n.prototype.zoomAtGlobal=function(t,n,i,r,e,u){var s=this.Ki;s.set(t,n),this.toLocal(s,s),this.zoomAt(s.x,s.y,i,r,e,u)},n.prototype.zoom=function(t,n,i,r){var e=this.p;this.zoomAt(.5*e.width,.5*e.height,t,n,i,r)},Object.defineProperty(n.prototype,"scale",{get:function(){var n=this._i(this.p);return n?n.scale:new t.Point(1,1)},set:function(t){var n=this._i(this.p);if(n){var i=this.toNormalizedScale(t.x),r=this.toNormalizedScale(t.y),e=n.position;this.xi(n,e.x,e.y,i,r)}},enumerable:!1,configurable:!0}),n.prototype.moveTo=function(t,n,i,r){var e=this._i(this.p);if(e){var u=e.scale;this.I.start(e,t,n,u.x,u.y,i,r)}},Object.defineProperty(n.prototype,"position",{get:function(){var n=this._i(this.p);return n?n.position:new t.Point(0,0)},set:function(t){var n=this._i(this.p);if(n){var i=n.scale;this.xi(n,t.x,t.y,i.x,i.y)}},enumerable:!1,configurable:!0}),n.prototype.transform=function(t,n,i,r,e,u){var s=this._i(this.p);s&&this.I.start(s,t,n,i,r,e,u)},n.prototype.toLocal=function(t,n,i){return this.p.toLocal(t,void 0,n,i)},n.prototype.toGlobal=function(t,n,i){return this.p.toGlobal(t,n,i)},n.prototype.toNormalizedScale=function(t){return Math.min(this.Ji,Math.max(this.Yi,t))},n.prototype.onWheel=function(t,n,i){var r;if(this.qi&&this.tr(t,this.$i,this.p)&&0!==n.deltaY&&(r=this._i(this.p))){var e=n.lowest*this.Qi,u=1+n.deltaY*e,s=r.scale;return this.zoomAtGlobal(i.x,i.y,s.x*u,s.y*u,0),!0}if(this.sr&&this.cr(t,this.ar,this.p)&&(r=this._i(this.p))){this.stop(),e=n.lowest*this.hr;var h=r.position,o=h.x-n.deltaX*e,a=h.y+n.deltaY*e;return s=r.scale,this.xi(r,o,a,s.x,s.y),!0}return!1},n.prototype.onDown=function(t){this.lr.onDown(t)},n.prototype.onDblClick=function(t,n){if(this.nr&&this.er(t,this.rr,this.p)){var i=this._i(this.p);if(i){var r=this.Ki;ir.toGlobal(t,n,r);var e=this.ir,u=i.scale;return this.zoomAtGlobal(r.x,r.y,u.x*e,u.y*e,this.ur),!0}}return!1},n.prototype.toTheme=function(t){if(t&&t.theme){var n=t.theme;return Ot(n)?Z.getInstance().get(n):n}return null},n.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},n.prototype.getType=function(){return"DView"},n.CONSTRAINT=function(t,n,i,r,e){t.scale.set(r,e),t.position.set(n,i)},n}(),Dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n),this.vr=null;var e=this.theme;this.br=new Or(this,(function(){return r.vr}),null==n?void 0:n.view);var u=null==n?void 0:n.canvas;u&&(this.canvas=u),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(this.mask=this.getOverflowMask())},n.prototype.getType=function(){return"DCanvasContainer"},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateContentSize(n,i,r,e)},Object.defineProperty(n.prototype,"canvas",{get:function(){return this.vr},set:function(t){var n=this.vr;null!=n&&(this.vr=null,this.removeChild(n),this.emit("unset",n,this),n.destroy()),this.vr=t,null!=t?(this.addChild(t),this.br.reset(0),this.emit("set",t,this)):st.update(this)},enumerable:!1,configurable:!0}),n.prototype.getOverflowMask=function(){return null==this.dr&&(this.dr=new or(this),this.Zn.add(this.dr),this.toDirty()),this.dr},n.prototype.updateContentSize=function(t,n,i,r){var e=this.vr;if(null!=e){var u=e.x+.5*(t-i),s=e.y+.5*(n-r);e.position.set(u,s)}},Object.defineProperty(n.prototype,"view",{get:function(){return this.br},enumerable:!1,configurable:!0}),n.prototype.onWheel=function(n,i,r){var e=this.br.onWheel(n,i,r),u=t.prototype.onWheel.call(this,n,i,r);return e||u},n.prototype.onDblClick=function(n,i,r){if(!0!==r){var e=this.br.onDblClick(n,i),u=t.prototype.onDblClick.call(this,n,i);return e||u}return t.prototype.onDblClick.call(this,n,i)},n.prototype.onDown=function(n,i){!0!==i&&this.br.onDown(n),t.prototype.onDown.call(this,n)},n.prototype.destroy=function(){var n=this.dr;null!=n&&(this.dr=null,n.destroy()),this.mask=null,t.prototype.destroy.call(this)},n}(hr),Er={DIAGRAM:0,PAGE:1,EXTENSION:1e3},Mr=function(){function t(t){this.gr=this.newSources(t)}return t.prototype.map=function(n,i,r){var e=this.gr;if(null==e)return!1;var u=n.id,s=u.toLowerCase(),h=s.length;if(h!==u.length)return!1;var o=e[0],a=o.length;if(0!==a&&0!==s.indexOf(o))return!1;var c=t.SPANS;c[0]=0,c[1]=a;for(var f=e.length,l=1;l<f;++l){var v=l<<1,b=e[l],d=b.length;if(0===d)c[v]=h,c[v+1]=h;else{var g=s.indexOf(b,c[v-1]);if(g<0)return!1;c[v]=g,c[v+1]=g+d}}if(null!=i){for(var m=i.length,w="",p=(l=0,f);l<p;++l){var O=l<m?i[l]:e[l],D=c[1+(v=l<<1)],E=c[v+2];w+=O+u.substring(D,l+1<p?E:h)}n.id=w}return 0<r.length&&(n.initial=r),!0},t.prototype.newSources=function(n){if(null==n)return null;var i=n.trim();return i.length<=0?null:i.toLowerCase().split(t.WILDCARD)},t.split=function(t){if(null==t)return null;var n=t.trim();return n.length<=0?null:n.split(this.WILDCARD)},t.WILDCARD="*",t.SPANS=[],t}(),Sr=function(){function t(t,n,i,r,e){this.resources=t.resources,this.data=t.data||t.tags||t.resources,this.pieces=n,this.pieceData=i,this.mode=r,this.depth=e,this.mr=new Map,this.wr=new Map,this.pr=new Map,this.Xt=new Map,this.Or=new Map,this.Dr=new Map,this.Er=new Map,this.Mr=new Map,this.Sr=new Map,this.Tr=new Map,this.jr=new Map,this.Nr=new Map,this.Ir=new Map,this.Cr=new Map,this.Ar=new Map,this.Rr=new Map}return t.prototype.getAction=function(t){return this.mr.get(t)},t.prototype.setAction=function(t,n){this.mr.set(t,n)},t.prototype.getFill=function(t){return this.wr.get(t)},t.prototype.setFill=function(t,n){this.wr.set(t,n)},t.prototype.getStroke=function(t){return this.pr.get(t)},t.prototype.setStroke=function(t,n){this.pr.set(t,n)},t.prototype.getData=function(t){return this.Xt.get(t)},t.prototype.setData=function(t,n){this.Xt.set(t,n)},t.prototype.getDataValue=function(t){return this.Or.get(t)},t.prototype.setDataValue=function(t,n){this.Or.set(t,n)},t.prototype.getDataMapping=function(t){return this.Dr.get(t)},t.prototype.setDataMapping=function(t,n){this.Dr.set(t,n)},t.prototype.getDataMapper=function(t){var n=this.Er,i=n.get(t);return void 0===i&&(i=new Mr(t),n.set(t,i)),i},t.prototype.getDataDestination=function(t){var n=this.Mr,i=n.get(t);return void 0===i&&(i=Mr.split(t),n.set(t,i)),i},t.prototype.getDataSystem=function(t){return this.Sr.get(t)},t.prototype.setDataSystem=function(t,n){this.Sr.set(t,n)},t.prototype.getRange=function(t){return this.Tr.get(t)},t.prototype.setRange=function(t,n){this.Tr.set(t,n)},t.prototype.getAlign=function(t){return this.jr.get(t)},t.prototype.setAlign=function(t,n){this.jr.set(t,n)},t.prototype.getMargin=function(t){return this.Nr.get(t)},t.prototype.setMargin=function(t,n){this.Nr.set(t,n)},t.prototype.getText=function(t){return this.Ir.get(t)},t.prototype.setText=function(t,n){this.Ir.set(t,n)},t.prototype.getTextOutline=function(t){return this.Cr.get(t)},t.prototype.setTextOutline=function(t,n){this.Cr.set(t,n)},t.prototype.getCapability=function(t){return this.Ar.get(t)},t.prototype.setCapability=function(t,n){this.Ar.set(t,n)},t.prototype.getExtension=function(t){return this.Rr.get(t)},t.prototype.setExtension=function(t,n){this.Rr.set(t,n)},t}(),Tr={VIEWER:0,EDITOR_DATA_MAPPED:1,EDITOR:2},jr=function(){function t(){}return t.get=function(t){var n=this.mappings[t];return null!=n?n:Ct.PRIMITIVE},t.contains=function(t,n){if(null!=t){var i=this.get(t.type),r=t.getCapability();return null!=r&&(i&=~r.removed,i|=r.added,i&=~r.locked),(i&n)===n}return!1},t.set=function(t,n){this.mappings[t]=n},t.mappings={},t}(),Nr=function(){this.localTransform=new t.Matrix,this.internalTransform=new t.Matrix,this.internalTransformParentInverse=new t.Matrix,this.rotation=0,this.size=new t.Point},Ir=function(t){return Math.abs(t)<.001?t<0?-.001:.001:t},Cr=function(){function t(){}return t.prepare=function(t){var n=t.editor||new Nr;t.editor=n,t.updateTransform();var i=t.parent;i instanceof Rt?i.transform.internalTransform.copyTo(n.internalTransformParentInverse).invert():n.internalTransformParentInverse.identity(),t.transform.internalTransform.copyTo(n.internalTransform),n.rotation=t.transform.rotation,n.size.copyFrom(t.size),t.disallowOnTransformChange()},t.finalize=function(t){t.allowOnTransformChange(!0)},t.apply=function(t,n,i){var r=t.editor;if(null!=r){var e=r.localTransform;r.internalTransformParentInverse.copyTo(e).append(n).append(r.internalTransform),this.applyLocal(t,e,i,r.size)}},t.applyLocal=function(t,n,i,r){t.disallowUploadedUpdate();var e=n.a,u=n.b,s=n.c,h=n.d,o=n.tx,a=n.ty,c=t.transform,f=!!(i&Ct.POSITION),l=!!(i&Ct.ROTATION),v=!!(i&Ct.SKEW),b=!!(i&Ct.WIDTH),d=!!(i&Ct.HEIGHT);if(l||v){var g=Math.atan2(-s,h),m=Math.atan2(+u,e);if(l&&(c.rotation=.5*(g+m)),v){var w=.5*(m-g);c.skew.set(w,w)}}if(f){var p=c.pivot,O=p.x,D=p.y;c.position.set(o+(e*O+s*D),a+(u*O+h*D))}if(null!=r&&(b||d)){var E=Ir(r.x*Math.sqrt(e*e+u*u)),M=Ir(r.y*Math.sqrt(s*s+h*h)),S=t.size;b&&d?S.set(E,M):b?S.x=E:S.y=M}t.allowUploadedUpdate()},t}(),Ar=function(){function n(n,i,r){this.shape=n,this.base=new t.Point(i,r);var e=n.size;this.shapeBase=new t.Point(e.x,e.y),this.transform=new t.Matrix,n.updateTransform(),n.transform.localTransform.copyTo(this.transform),this.capable=jr.contains(n,Ct.POSITION)&&jr.contains(n,Ct.WIDTH)&&jr.contains(n,Ct.HEIGHT)&&jr.contains(n,Ct.ROTATION)&&jr.contains(n,Ct.SKEW)}return n.prototype.isCompatible=function(t){return this.shape===t},n.prototype.reset=function(t,n,i){this.base.set(n,i);var r=t.size;this.shapeBase.copyFrom(r),t.updateTransform(),t.transform.localTransform.copyTo(this.transform)},n.prototype.update=function(t,i,r,e,u){if(this.capable){var s=i/this.base.x,h=r/this.base.y,o=this.shapeBase,a=n.WORK_TRANSFORM;a.identity().append(this.transform).translate(-e,-u).scale(s,h).translate(+e,+u),t.disallowOnTransformChange(),Cr.applyLocal(t,a,Ct.ALL,o),t.allowOnTransformChange(!1)}},n.WORK_TRANSFORM=new t.Matrix,n}(),Rr=function(){function n(n,i,r,e){this.kr=new t.Rectangle,this.Lr=new t.Rectangle,this.p=n,this.yr=[],this.j=new t.Point(i,r),this.Br=e}return n.prototype.init=function(){return this},Object.defineProperty(n.prototype,"x",{get:function(){return this.j.x},set:function(t){var n=this.j;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.j.y},set:function(t){var n=this.j;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.j,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.j;return new n(this.p,t.x,t.y,this.Br)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.j,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.j.copyTo(t)},n.prototype.equals=function(t){return this.j.equals(t)},n.prototype.fit=function(){return this.Br&&this.doFit(),this},n.prototype.doFit=function(){var t=this.p;t.disallowOnTransformChange();var n=this.calcRect(this.Lr),i=this.j;i.set(n.width,n.height),t.updateTransform();var r=t.transform,e=n.x+.5*n.width,u=n.y+.5*n.height,s=r.position,h=r.localTransform,o=h.a,a=h.b,c=h.c,f=h.d,l=r.pivot;s.set(s.x+(o*e+c*u)-(o*l.x+c*l.y),s.y+(a*e+f*u)-(a*l.x+f*l.y)),l.set(e,u),this.reset(t.children,this.yr,i),t.allowOnTransformChange(!0)},n.prototype.reset=function(t,n,i){for(var r=0,e=Math.min(n.length,t.length);r<e;++r){var u=t[r],s=n[r];if(!s.isCompatible(u)){n.length=r;break}s.reset(u,i.x,i.y)}t.length<n.length&&(n.length=t.length)},n.prototype.calcRect=function(t){var n=this.p.children;if(n.length<=0)t.x=0,t.y=0,t.width=0,t.height=0;else{var i=this.kr;n[0].getBoundsLocal(!1,t);for(var r=1,e=n.length;r<e;++r)n[r].getBoundsLocal(!1,i),t.enlarge(i)}return t},n.prototype.onChange=function(t,n){var i=this.p,r=this.j,e=i.transform.pivot;this._r(i.children,this.yr,r.x,r.y,e.x,e.y,t,n),i.onSizeChange()},n.prototype._r=function(t,n,i,r,e,u,s,h){for(var o=0,a=Math.min(n.length,t.length);o<a;++o){var c=t[o];if(!(f=n[o]).isCompatible(c)){n.length=o;break}f.update(c,i,r,e,u)}for(o=n.length,a=t.length;o<a;++o){var f;c=t[o],(f=this.newLayout(c,s,h)).update(c,i,r,e,u),n.push(f)}n.length!==t.length&&(n.length=t.length)},n.prototype.newLayout=function(t,n,i){return t.layout||new Ar(t,n,i)},n}(),kr=function(){function n(n,i,r,e,u){this.p=n,this._x=i,this._y=r,this.Pr=new t.Point(e,u)}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"base",{get:function(){return this.Pr},enumerable:!1,configurable:!0}),n.prototype.init=function(){return this.Pr.copyFrom(this),this.onChange(),this},n.prototype.clone=function(){var t=this.Pr;return new n(this.p,this._x,this._y,t.x,t.y)},n.prototype.set=function(t,n){var i=!1;return null!=t&&this._x!==t&&(this._x=t,i=!0),null!=n&&this._y!==n&&(this._y=n,i=!0),i&&this.onChange(),this},n.prototype.copyFrom=function(t){return t instanceof n&&this.Pr.copyFrom(t.base),this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.onChange()),this},n.prototype.copyTo=function(t){return t instanceof n&&this.Pr.copyTo(t.base),t.set(this._x,this._y),t},n.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},n.prototype.fit=function(){return this},n.prototype.onChange=function(){var t=this.Pr;this.p.transform.scale.set(this._x/t.x,this._y/t.y)},n}(),Lr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),yr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return qt.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return s.NONE},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i,r,e,u,s){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!1,color:16777215,alpha:1,width:1,align:0,side:qt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),xr=function(t){function n(n,i,r){var e=t.call(this,r)||this;e.Fr=n,e.Ur=i;var u=e.newData();return e.data=u,e.tag=u,e.size=e.newGroupSize(n,i),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e}return _(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Fr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"depth",{get:function(){return this.Ur},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t,n){var i=q.SIZE_X,r=q.SIZE_Y;return t!==Tr.VIEWER?new Rr(this,i,r,this.isGroupSizeFittable()):new kr(this,i,r,i,r)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newData=function(){return new Vt},n.prototype.newGroupFill=function(){return new Lr},n.prototype.newGroupStroke=function(){return new yr},n.prototype.newGroupText=function(){return new Yt(this,q.TEXT_VALUE,q.TEXT_COLOR,q.TEXT_ALPHA,q.TEXT_FAMILY,q.TEXT_SIZE)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof kr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){return ut.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Rt),Br=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED);var s=t.call(this,i,e,u)||this;return s.Gr=n,s.Ur=e,s}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=q.SIZE_X,r=q.SIZE_Y;return t!==Tr.VIEWER&&n<=0?new Rr(this,i,r,this.isGroupSizeFittable()):new kr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Gr,this.Fr,this.Ur,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=n.addPiece(this.Gr),i},n.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid)},n.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid)},n}(xr),_r=function(){function t(t){this.Hr=t}return t.prototype.find=function(t){return this.getUuidToShape().get(t)},t.prototype.getUuidToShape=function(){var t=this.zr;return null==t&&(t=this.newUuidToShape(),this.zr=t),t},t.prototype.newUuidToShape=function(){var t=new Map;return this.fillUuidToShape(this.Hr,t),t},t.prototype.fillUuidToShape=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];if(n.set(e.uuid,e),!(e instanceof Br)){var u=e.children;0<u.length&&this.fillUuidToShape(u,n)}}},t}(),Pr=function(t,i){var e=n[t[0]]||n[r.NULL];if(null!=e){var u=e(t,i);if(null!=u)return u}throw new Error("Missing shape deserializers")},Fr=function(t,n){for(var i=[],r=0,e=t.length;r<e;++r)i.push(Pr(t[r],n));return 0<i.length?Promise.all(i).then((function(i){return Ur(t,i,new _r(i),n),i})):null},Ur=function(t,n,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u],o=n[u],a=i[h[0]];a&&a(h,o,r,e),Ur(h[20],o.children,r,e)}},Gr=function(t,n,i,r){this.name=t,this.width=n,this.height=i,this.layer=r},Hr=function(){function t(){this.V=new Map}return t.prototype.add=function(t,n,i,r,e,u){return this.V.set(t,{type:n,x:i,y:r,normal:this.toNormal(i,r,e,u)}),!0},t.prototype.toNormal=function(t,n,i,r){if(null!=i&&null!=r)return{x:i,y:r};var e=t*t+n*n;if(1e-5<e){var u=1/Math.sqrt(e);return{x:t*u,y:n*u}}return{x:0,y:0}},t.prototype.remove=function(t){var n=this.V,i=n.get(t);return null!=i?(n.delete(t),i):null},t.prototype.size=function(){return this.V.size},t.prototype.get=function(t,n){return this.V.get(n)||null},t.prototype.each=function(t,n){return this.V.forEach(n),this},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.clear=function(){var t=this.V;return 0<t.size&&(t.clear(),!0)},t}(),zr={TAIL:1,HEAD:2,ALL:3},Vr=function(){function t(){}return t.set=function(t,n){var i=this.Vr;null==i&&(i=new Map,this.Vr=i),i.set(t,n)},t.get=function(t){var n;return(null===(n=this.Vr)||void 0===n?void 0:n.get(t))||this.getDefault()},t.getDefault=function(){var t=this.Wr;return null==t&&(t=this.newDefault(),this.Wr=t),t},t.newDefault=function(){var t=new Hr,n=1/Math.sqrt(2);return t.add("TOP",zr.ALL,0,-.5,0,-1),t.add("LEFT",zr.ALL,-.5,0,-1,0),t.add("RIGHT",zr.ALL,.5,0,1,0),t.add("BOTTOM",zr.ALL,0,.5,0,1),t.add("CENTER",zr.ALL,0,0,0,0),t.add("TOP_LEFT",zr.ALL,-.5,-.5,-n,-n),t.add("TOP_RIGHT",zr.ALL,.5,-.5,n,-n),t.add("BOTTOM_LEFT",zr.ALL,-.5,.5,-n,n),t.add("BOTTOM_RIGHT",zr.ALL,.5,.5,n,n),t},t}(),Wr=function(){function t(t){this.p=t,this.Xr=null,this.Kr=null}return Object.defineProperty(t.prototype,"shape",{get:function(){return this.Xr},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this.Kr},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.set(t.shape,t.edge)},t.prototype.set=function(t,n){var i=!1;return void 0!==t&&this.Xr!==t&&(this.Xr=t,i=!0),void 0!==n&&this.Kr!==n&&(this.Kr=n,i=!0),i&&this.p.onAcceptorChange(),this},t}(),Xr=function(){function n(n,i){var r=this;this.p=n,this.ut=i,this.Yr=new Wr(this),this.it=new t.ObservablePoint((function(){r.onLocalChange()}),void 0),this.Jr=0,this.Zr=0,this.qr=new t.ObservablePoint((function(){r.onNormalChange()}),void 0),this.Qr=0,this.$r=0,this.te=0,this.ne=0,this.ie=!1,this.re=!1,this.ee=!1,this.ue=!1}return n.prototype.lock=function(){this.ne+=1,1===this.ne&&(this.ie=!1,this.re=!1,this.ee=!1,this.ue=!1)},n.prototype.unlock=function(){if(this.ne-=1,0===this.ne){var t=!1;this.re&&(this.Jr+=1,this.Zr=this.Jr,t=!0),this.ee&&(this.Qr+=1,this.$r=this.Qr,t=!0),this.ue&&(t=!0),this.ie&&(this.re||(this.Jr+=1),this.ee||(this.Qr+=1),this.doFit()&&(t=!1)),t&&this.ut()}},Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"acceptor",{get:function(){return this.Yr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"local",{get:function(){return this.it},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localId",{get:function(){return this.Zr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normal",{get:function(){return this.qr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normalId",{get:function(){return this.$r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},set:function(t){this.te!==t&&(this.te=t,this.onOtherChange())},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u,s){this.lock(),this.Yr.set(t,n);var h=this.it;null!=r&&null!=e?h.set(r,e):null!=r?h.x=r:null!=e&&(h.y=e);var o=this.qr;return null!=u&&null!=s?o.set(u,s):null!=u?o.x=u:null!=s&&(o.y=s),null!=i&&(this.margin=i),this.unlock(),this},n.prototype.copy=function(t){return this.lock(),this.Yr.copy(t.acceptor),this.it.copyFrom(t.local),this.qr.copyFrom(t.normal),this.margin=t.margin,this.unlock(),this},n.prototype.serialize=function(t){var n=this.Yr,i=n.shape,r=i?i.uuid:null,e=n.edge,u=null!=e?t.addResource(e):-1,s=this.it,h=this.qr;return t.addResource("[".concat(r,",").concat(u,",").concat(s.x,",").concat(s.y,",").concat(this.te,",").concat(h.x,",").concat(h.y,"]"))},n.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e));var u=null,s=e[0];null!=s&&(u=n.find(s)||null),this.lock();var h=this.Yr;h.shape=u;var o=e[1];h.edge=0<=o&&o<r.length?r[o]:null,this.it.set(e[2],e[3]);var a=e[5],c=e[6],f=this.qr;null!=a&&null!=c?f.set(a,c):f.set(1,0),this.margin=e[4]||0,this.unlock(),u&&u.connector.add(this)}},n.prototype.fit=function(t){return t&&(this.Jr+=1,this.Qr+=1),this.doFit(),this},n.prototype.doFit=function(){var t=this.Jr,n=this.Zr!==t,i=this.Qr,r=this.$r!==i;if(n||r){this.Zr=t,this.$r=i;var e=this.Yr,u=e.shape,s=e.edge;if(null!=u&&null!=s){var h=Vr.get(u.type).get(u,s);if(h){var o=this.toAcceptorTransform(u),a=o.a,c=o.b,f=o.c,l=o.d,v=o.tx,b=o.ty;if(this.lock(),n){var d=u.size,g=u.transform.pivot,m=g.x+d.x*h.x,w=g.y+d.y*h.y;this.it.set(a*m+f*w+v,c*m+l*w+b)}if(r){var p=h.normal,O=p.x,D=p.y,E=a*O+f*D,M=c*O+l*D,S=E*E+M*M,T=this.qr;if(1e-6<S){var j=1/Math.sqrt(S);T.set(E*j,M*j)}else T.set(O,D)}var N=this.re||this.ee;return this.unlock(),N}}}return!1},n.prototype.toAcceptorTransform=function(i){var r;i.updateTransform();var e=this.p,u=e.parent;return u?(e.updateTransform(),(null!==(r=n.WORK_MATRIX)&&void 0!==r?r:n.WORK_MATRIX=new t.Matrix).copyFrom(u.transform.worldTransform).invert().append(i.transform.worldTransform)):i.transform.worldTransform},n.prototype.onAcceptorChange=function(){if(0<this.ne)return this.re=!1,this.ee=!1,void(this.ie=!0);this.fit(!0)},n.prototype.onLocalChange=function(){0<this.ne?this.re=!0:(this.Jr+=1,this.Zr=this.Jr,this.ut())},n.prototype.onNormalChange=function(){0<this.ne?this.ee=!0:(this.Qr+=1,this.$r=this.Qr,this.ut())},n.prototype.onOtherChange=function(){0<this.ne?this.ue=!0:this.ut()},n.prototype.attach=function(){var t=this.Yr.shape;return t&&t.connector.add(this),this},n.prototype.detach=function(){var t=this.Yr.shape;return t&&t.connector.remove(this),this},n}(),Kr=function(){function t(t,n){var i=this;this.p=t,this.ne=0,this.Kt=!1,this.ut=n;var r=function(){i.onChange()};this.se=new Xr(t,r),this.he=new Xr(t,r)}return t.prototype.lock=function(){return this.ne+=1,1===this.ne&&(this.Kt=!1),this},t.prototype.unlock=function(){return this.ne-=1,0===this.ne&&this.Kt&&this.ut(),this},t.prototype.onChange=function(){0<this.ne?this.Kt=!0:this.ut()},Object.defineProperty(t.prototype,"tail",{get:function(){return this.se},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.he},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.lock(),this.se.copy(t.tail),this.he.copy(t.head),this.unlock(),this},t.prototype.fit=function(t){return this.lock(),this.se.fit(t),this.he.fit(t),this.unlock(),this},t.prototype.serialize=function(t){var n=this.se.serialize(t),i=this.he.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.lock(),this.se.deserialize(e[0],n,i),this.he.deserialize(e[1],n,i),this.unlock()}},t.prototype.attach=function(){this.lock();var t=this.se,n=this.he;return t.attach(),n.attach(),t.fit(!0),n.fit(!0),this.unlock(),this},t.prototype.detach=function(){return this.lock(),this.se.detach(),this.he.detach(),this.unlock(),this},t}(),Yr=function(t,n){for(var i=0,r=t.length-1;i<=r;){var e=i+(r-i>>1),u=t[e];if(n<u)r=e-1;else{if(!(u<n))return e;i=e+1}}return-1},Jr=function(t,n){if(2<=t.length){for(var i=t[0],r=t[1],e=i,u=r,s=2,h=t.length;s<h;s+=2){var o=t[s],a=t[s+1];i=Math.min(i,o),r=Math.min(r,a),e=Math.max(e,o),u=Math.max(u,a)}n[0]=i,n[1]=r,n[2]=e,n[3]=u}else n[0]=0,n[1]=0,n[2]=0,n[3]=0;return n},Zr=function(){function n(n){var i=this;this.p=n,this.ne=0,this.oe=!1,this.ae=!1,this.ce=!1,this.xt=Q.NONE,this.j=new t.ObservablePoint((function(){i.onSizeChange()}),void 0,.15*q.SIZE_X,.15*q.SIZE_Y),this.C=this.newFill(),this.fe=0}return n.prototype.newFill=function(){return new $(this,!0,q.FILL_COLOR,1)},n.prototype.lock=function(){return this.ne+=1,1===this.ne&&(this.oe=!1,this.ae=!1,this.ce=!1),this},n.prototype.unlock=function(){return this.ne-=1,0===this.ne&&(this.oe?this.onTypeChange():this.ae?this.onSizeChange():this.ce&&this.onFillChange(),this.oe=!1,this.ae=!1,this.ce=!1),this},Object.defineProperty(n.prototype,"type",{get:function(){return this.xt},set:function(t){this.xt!==t&&(this.xt=t,this.onTypeChange())},enumerable:!1,configurable:!0}),n.prototype.onTypeChange=function(){0<this.ne?this.oe=!0:this.p.onTypeChange()},Object.defineProperty(n.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),n.prototype.onSizeChange=function(){0<this.ne?this.ae=!0:this.p.onSizeChange()},Object.defineProperty(n.prototype,"transform",{get:function(){return this.updateTransform()},enumerable:!1,configurable:!0}),n.prototype.updateTransform=function(){var n=this.I;null==n&&(n=new t.Matrix,this.I=n);var i=this.p.parent,r=i.id;if(this.fe!==r){this.fe=r;var e=i.formatted;2<=e.length?this.toTransform(e.values,n):n.identity()}return n},n.prototype.toTransformMatrix=function(t,n,i,r,e){var u=t-i,s=n-r,h=u*u+s*s;if(1e-5<h){var o=1/Math.sqrt(h),a=u*o,c=s*o;e.set(c,-a,-a,-c,t,n)}else e.set(1,0,0,1,t,n);return e},Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),n.prototype.onFillChange=function(){0<this.ne?this.ce=!0:this.p.onFillChange()},n.prototype.updateUploaded=function(){this.onFillChange()},n.prototype.copy=function(t){var n=t.size;return this.set(t.type,n.x,n.y),this},n.prototype.set=function(t,n,i){return this.lock(),null!=t&&(this.type=t),this.size.set(n,i),this.unlock(),this},n.prototype.serialize=function(t){var n=this.j,i=this.C.serialize(t);return t.addResource("[".concat(this.xt,",").concat(n.x,",").concat(n.y,",").concat(i,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.type=r[0],this.j.set(r[1],r[2]),this.C.deserialize(r[3],n),this.unlock()}},n}(),qr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){var i=t.length;return 4<=i?this.toTransformMatrix(t[i-2],t[i-1],t[i-4],t[i-3],n):(n.identity(),n)},n}(Zr),Qr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){return 4<=t.length?this.toTransformMatrix(t[0],t[1],t[2],t[3],n):(n.identity(),n)},n}(Zr),$r=function(){function t(t){this.p=t,this.ne=0,this.oe=!1,this.ae=!1,this.ce=!1,this.he=new qr(this),this.se=new Qr(this)}return t.prototype.lock=function(){return this.ne+=1,1===this.ne&&(this.oe=!1,this.ae=!1,this.ce=!1),this},t.prototype.unlock=function(){return this.ne-=1,0===this.ne&&(this.oe?this.onTypeChange():this.ae?this.onSizeChange():this.ce&&this.onFillChange(),this.oe=!1,this.ae=!1,this.ce=!1),this},Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.he},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.se},enumerable:!1,configurable:!0}),t.prototype.onTypeChange=function(){0<this.ne?this.oe=!0:this.p.onMarkerTypeChange()},t.prototype.onSizeChange=function(){0<this.ne?this.ae=!0:this.p.onMarkerSizeChange()},t.prototype.onFillChange=function(){0<this.ne?this.ce=!0:this.p.onMarkerFillChange()},t.prototype.copy=function(t){return this.lock(),this.he.copy(t.head),this.se.copy(t.tail),this.unlock(),this},t.prototype.serialize=function(t){var n=this.he.serialize(t),i=this.se.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.he.deserialize(r[0],n),this.se.deserialize(r[1],n),this.unlock()}},t}(),te=2*Math.PI,ne=.5*Math.PI,ie=function(t,n,i,r){return t*i+n*r},re=function(t,n){return Math.sqrt(ie(t,n,t,n))},ee=function(t,n,i,r){return t*r-n*i},ue=function(t,n,i,r,e,u,s,h,o,a){var c=a.center;c[0]=t,c[1]=n;var f=a.axis1;f[0]=i,f[1]=r;var l=a.axis2;l[0]=e,l[1]=u;var v=a.angle;return v[0]=s,v[1]=h,v[2]=o,a},se=function(t,n){var i=t.center,r=t.axis1,e=t.axis2,u=t.angle;return ue(i[0],i[1],r[0],r[1],e[0],e[1],u[0],u[1],u[2],n)},he=function(t,n){for(var i=t.length,r=0;r<i;++r)n[r]=t[r];return n.length!==i&&(n.length=i),n},oe=function(){function t(){}return t.set=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){for(var d=Math.max(Math.abs(n-i),Math.abs(s-h)),g=f?Math.max(1,Math.round(c*(d/ne))):c,m=l?g+1:g,w=0;w<m;++w){var p=w/g,O=1-p,D=p,E=O*n+D*i,M=Math.cos(E),S=Math.sin(E),T=t[0]+M*r[0]+S*e[0],j=t[1]+M*r[1]+S*e[1],N=O*s+D*h,I=Math.cos(N),C=Math.sin(N),A=u[0]+I*o[0]+C*a[0],R=u[1]+I*o[1]+C*a[1],k=ne*p,L=Math.cos(k),y=Math.sin(k),x=L*L,B=y*y,_=x*T+B*A,P=x*j+B*R;v[++b]=_,v[++b]=P}return b},t.interpolate=function(t,n,i,r,e,u,s,h){var o=h.values,a=h.segments;if(t<=2)return he(n,o),he(i,a),h;var c=this.WORK_P0||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},f=this.WORK_P1||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},l=this.WORK_P2||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]};this.WORK_P0=c,this.WORK_P1=f,this.WORK_P2=l;var v=-1,b=-1;if(e){r(0,t,n,c),se(c,f);for(var d=1;d<t;++d){if(r(d,t,n,l),0<=Yr(i,d)){var g=d-1<<1;o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1}else v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v);var m=f;f=l,l=m}0<=Yr(i,0)?(g=t-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a.unshift(0),b+=1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v)}else{r(1,t,n,c),0<=Yr(i,1)?(o[++v]=n[0],o[++v]=n[1],a[++b]=1):v=this.set(c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v),se(c,f),d=2;for(var w=t-1;d<w;++d)r(d,t,n,l),0<=Yr(i,d)?(g=d-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v),m=f,f=l,l=m;0<=Yr(i,t-1)?(g=t-2<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,u,s,!0,o,v)}return v+=1,o.length!==v&&(o.length=v),b+=1,a.length!==b&&(a.length=b),h},t.toCircle=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=a-h,b=c-o,d=f-a,g=l-c,m=h+.5*v,w=o+.5*b,p=a+.5*d,O=c+.5*g,D=-b,E=+v,M=-g,S=+d,T=ee(D,E,M,S);if(Math.abs(T)<.001){if(0<=ie(v,b,d,g)||n<=2){var j=.01,N=Math.sin(j),I=re(v,b),C=re(d,g);return ue(a,c,0,0,d/N,g/N,-j*I/C,0,j,r)}T=.001}var A=(S*(p-m)+M*(w-O))/T,R=m+A*D,k=w+A*E,L=a-R,y=c-k,x=-y,B=+L,_=f-R,P=l-k,F=Math.atan2(ie(x,B,_,P),ie(L,y,_,P)),U=h-R,G=o-k,H=Math.atan2(ie(x,B,U,G),ie(L,y,U,G));return 0<H*F&&(Math.abs(H)<Math.abs(F)&&(0<F?F-=te:F+=te),Math.abs(F)<Math.abs(H)&&(0<H?H-=te:H+=te)),ue(R,k,L,y,x,B,H,0,F,r)},t.toEllipse=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=h-a,b=o-c,d=f-a,g=l-c;if(n<=2){var m=.01,w=Math.sin(m);return ue(a,c,0,0,d/w,g/w,-m,0,m,r)}for(var p=re(v,b),O=re(d,g),D=ie(v,b,d,g)/(p*O),E=Math.acos(D),M=.5*E,S=.25*E,T=0,j=0,N=0,I=0,C=Math.max(p,O),A=Math.min(p,O),R=0;R<16;++R){var k=.5*M,L=E-k;T=C*Math.sin(k),j=C*Math.cos(k),N=A*Math.sin(L),1<(1-(I=A*Math.cos(L))/j)*(1-I/j)+N*N/(T*T)?M+=S:M-=S,S*=.5}var y=Math.asin(Math.min(N/T,1));if(p<O){var x=d/O,B=g/O,_=void 0,P=void 0;return 0<ee(v,b,d,g)?(_=+B,P=-x):(_=-B,P=+x),ue(z=a-(G=(F=-j*j/O)*x+(U=-j*T/O)*_),V=c-(H=F*B+U*P),G,H,f-z,l-V,-y,0,ne,r)}var F,U,G,H,z,V,W=v/p,X=b/p;return _=void 0,P=void 0,ee(v,b,d,g)<0?(_=+X,P=-W):(_=-X,P=+W),ue(z=a-(G=(F=-j*j/p)*W+(U=-j*T/p)*_),V=c-(H=F*X+U*P),G,H,-(h-z),-(o-V),-ne,0,y,r)},t.toHybrid=function(n,i,r,e){var u=t.toCircle(n,i,r,e),s=u.angle[0],h=u.angle[2],o=Math.min(s,h),a=Math.max(s,h);return o<-ne||ne<a?t.toEllipse(n,i,r,e):u},t}(),ae=function(t,n,i,r,e){return oe.interpolate(t,n,i,oe.toHybrid,!!(r&z.CLOSED),q.CURVE_SEGMENT_COUNT,!0,e),e.length=e.values.length>>1,e.style=r,e},ce=function(){function t(){}return t.set=function(t,n){null==this.FORMATTERS&&(this.FORMATTERS=this.newFormatters()),this.FORMATTERS.set(t,n)},t.get=function(t){return null==this.FORMATTERS&&(this.FORMATTERS=this.newFormatters()),this.FORMATTERS.get(t)},t.find=function(t){return this.get((t&z.FORMATTER_MASK)>>z.FORMATTER_SHIFT)},t.newFormatters=function(){var t=new Map;return t.set(z.FORMATTER_CURVE,ae),t},t}(),fe=function(){function n(n){this.p=n,this.le=0,this.k=[],this.L=[];var i=n.size,r=i.x,e=i.y;this.ve=new t.Point(r,e),this.be=new t.Point(r,e),this.R=0,this.B=z.NONE,this.de=-1}return Object.defineProperty(n.prototype,"length",{get:function(){return this.k.length>>1},enumerable:!1,configurable:!0}),n.prototype.toFitted=function(){this.ge=void 0;var t=this.p.size;this.be.copyFrom(t),this.ve.copyFrom(t)},n.prototype.fit=function(){var t=this.be,n=this.p.size,i=n.x,r=n.y,e=1e-5;if(e<Math.abs(i-t.x)||e<Math.abs(r-t.y)){t.set(i,r);var u=this.ve,s=e<Math.abs(u.x),h=e<Math.abs(u.y);if(s||h){var o=s?i/u.x:1,a=h?r/u.y:1,c=this.k,f=this.ge;if(null==f){f=[],this.ge=f;for(var l=0,v=c.length;l<v;l+=2){var b=c[l],d=c[l+1];c[l]=b*o,c[l+1]=d*a,f.push(b,d)}}else for(l=0,v=c.length;l<v;l+=2)c[l]=f[l]*o,c[l+1]=f[l+1]*a;if(this.R===this.de){var g=this.me;if(null!=g){var m=g.values,w=this.we;if(null==w)for(w=[],this.we=w,l=0,v=m.length;l<v;l+=2)b=m[l],d=m[l+1],m[l]=b*o,m[l+1]=d*a,w.push(b,d);else for(l=0,v=m.length;l<v;l+=2)m[l]=w[l]*o,m[l+1]=w[l+1]*a;var p=g.boundary,O=this.pe;if(null==O)for(O=[0,0,0,0],this.pe=O,l=0,v=p.length;l<v;l+=2)b=p[l],d=p[l+1],p[l]=b*o,p[l+1]=d*a,O[l]=b,O[l+1]=d;else for(l=0,v=p.length;l<v;l+=2)p[l]=O[l]*o,p[l+1]=O[l+1]*a;this.de+=1}}this.R+=1}}},Object.defineProperty(n.prototype,"id",{get:function(){return this.fit(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.fit(),this.k},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.L},set:function(t){this.set(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=this.newMarker(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){return this.A},n.prototype.newMarker=function(){return new $r(this)},n.prototype.onMarkerTypeChange=function(){var t=this.p;t.uploaded=void 0,t.toDirty()},n.prototype.onMarkerSizeChange=function(){this.p.updateUploaded()},n.prototype.onMarkerFillChange=function(){this.p.updateUploaded()},Object.defineProperty(n.prototype,"formatter",{get:function(){return this.Oe||null},set:function(t){this.Oe!==t&&(this.de=-1,this.Oe=t,this.toDirty(!0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){this.fit();var t=this.R,n=this.me;if(this.de!==t){this.de=t;var i=this.B,r=this.Oe||ce.find(i);if(null!=r){null==n&&(n={length:0,values:[],segments:[],boundary:[0,0,0,0],style:z.NONE});var e=this.ge,u=this.L;if(null!=e){r(e.length>>1,e,u,i,n),Jr(n.values,n.boundary);var s=n.values,h=s.splice(0);this.we=h;var o=n.boundary,a=[o[0],o[1],o[2],o[3]];this.pe=a,this.toScaled(s,h,o,a)}else{var c=this.k;r(c.length>>1,c,u,i,n),Jr(n.values,n.boundary),this.we=void 0,this.pe=void 0}}else n=void 0,this.we=void 0,this.pe=void 0;this.me=n}return n||this},enumerable:!1,configurable:!0}),n.prototype.toScaled=function(t,n,i,r){var e=this.be,u=this.ve,s=1e-5,h=s<Math.abs(u.x),o=s<Math.abs(u.y);if(h||o){for(var a=h?e.x/u.x:1,c=o?e.y/u.y:1,f=0,l=n.length;f<l;f+=2)t[f]=n[f]*a,t[f+1]=n[f+1]*c;for(f=0,l=r.length;f<l;f+=2)i[f]=r[f]*a,i[f+1]=r[f+1]*c}},n.prototype.copy=function(t){this.set(t.values,t.segments,t.style);var n=t.getMarker();return n&&this.marker.copy(n),this},n.prototype.set=function(t,n,i){var r=!1,e=!1,u=this.B,s=u&z.FORMATTER_MASK,h=this.Oe;if(null!=t){var o=this.k,a=this.le,c=t.length,f=Math.min(c,a);if(this.toFitted(),o!==t){for(var l=0;l<f;++l)o[l]=t[l];for(l=f;l<c;++l)o.push(t[l]);a!==c?(o.length=c,this.le=c,r=!0):null!=h||s?r=!0:e=!0}else a!==c?(this.le=c,r=!0):null!=h||s?r=!0:e=!0}if(null!=n){var v=this.L;if(v!==n){var b=n.length;for(f=Math.min(v.length,b),l=0;l<f;++l)v[l]=n[l];for(l=f;l<b;++l)v.push(n[l]);v.length!==b&&(v.length=b)}null!=h||s?r=!0:e=!0}return null!=i&&u!==i&&(s!==(i&z.FORMATTER_MASK)||(null!=h||s)&&(u&z.CLOSED)!=(i&z.CLOSED)?r=!0:e=!0,this.B=i),(e||r)&&this.toDirty(r),this},n.prototype.toDirty=function(t){if(t){this.R+=1;var n=this.p,i=n.uploaded;i?i.isCompatible(n)?n.updateUploaded():(n.uploaded=void 0,n.toDirty()):n.updateUploaded()}else this.R+=1,this.p.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){var n=JSON.stringify(this.k),i=JSON.stringify(this.L),r=this.B,e=-1,u=this.A;return u&&(e=u.serialize(t)),t.addResource("[".concat(n,",").concat(i,",").concat(r,",").concat(e,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.set(r[0],r[1],r[2]);var e=r[3];null!=e&&0<=e&&this.marker.deserialize(e,n)}},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o){var a=this.formatted,c=a.length;if(2<=c){var f=a.values,l=a.segments,v=a.style,b=0,d=c;if(s){var g=n.WORK_RANGE;s(t,i,u,f,g),b=g[0],d=g[1]}for(var m=b,w=Math.min(d,c-1);m<w;++m){var p;if(Yr(l,m+1)<0&&h(t,i,f[0+(p=m<<1)],f[p+1],f[p+2],f[p+3],m,u,o))return!0}if(2<c&&c<=d&&v&z.CLOSED&&Yr(l,0)<0&&h(t,i,f[0+(p=(m=c-1)<<1)],f[p+1],f[0],f[1],m,u,o))return!0}return!1},n.WORK_RANGE=[0,0],n}(),le=function(){function t(t,n){this.p=t,this.R=0,this.k=[],this.ne=0,this.Kt=!1,this.ut=n}return t.prototype.lock=function(){this.ne+=1,1===this.ne&&(this.Kt=!1)},t.prototype.unlock=function(){this.ne-=1,0===this.ne&&(this.Kt&&this.onChange(),this.Kt=!1)},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this.k},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t){if(null!=t){if(this.R+=1,this.k!==t){for(var n=t.length,i=this.k,r=0;r<n;++r)i[r]=t[r];i.length=n}this.onChange()}return this},t.prototype.copy=function(t){return this.set(t.values)},t.prototype.serialize=function(t){return t.addResource(JSON.stringify(this.k))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.set(e)}},t.prototype.onChange=function(){0<this.ne?this.Kt=!0:this.ut()},t}(),ve=function(t){function n(n){void 0===n&&(n=r.CONNECTOR_LINE);var i=t.call(this,n)||this;i.De=0,i.Ee=0,i.Me=0,i.Se=0,i.Te=0,i.je=0,i.Ne=0,i.ne=0,i.Kt=!1;var e=.5*q.SIZE_X,u=.5*q.SIZE_Y;i.jt=new fe(i).set([-e,-u,+e,+u]);var s=function(){i.onChange()};return i.Kr=new Kr(i,s),i.Ie=new le(i,s),i}return _(n,t),n.prototype.lock=function(){this.ne+=1,1===this.ne&&(this.Kt=!1)},n.prototype.unlock=function(){this.ne-=1,0===this.ne&&(this.Kt&&this.onChange(),this.Kt=!1)},Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edge",{get:function(){return this.Kr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this.Ie},enumerable:!1,configurable:!0}),n.prototype.onAttach=function(){t.prototype.onAttach.call(this),this.Kr.attach()},n.prototype.onDetach=function(){this.Kr.detach(),t.prototype.onDetach.call(this)},n.prototype.onChange=function(){var t;if(0<this.ne)this.Kt=!0;else{var i=this.Kr,r=i.tail,e=r.localId,u=r.normalId,s=r.margin,h=i.head,o=h.localId,a=h.normalId,c=h.margin,f=this.Ie,l=f.id;if(this.De!==e||this.Ee!==u||this.Me!==s||this.Se!==o||this.Te!==a||this.je!==c||this.Ne!==l){this.De=e,this.Ee=u,this.Me=s,this.Se=o,this.Te=a,this.je=c,this.Ne;var v=this.transform,b=v.position,d=b.x,g=b.y,m=this.jt,w=m.values;this.fillPoints(r,s,h,c,f,d,g,w);var p=null!==(t=n.WORK_BOUNDARY)&&void 0!==t?t:n.WORK_BOUNDARY=[0,0,0,0];Jr(w,p);for(var O=.5*(p[2]+p[0]),D=.5*(p[3]+p[1]),E=p[2]-p[0],M=p[3]-p[1],S=0,T=w.length;S<T;S+=2)w[S+0]-=O,w[S+1]-=D;this.disallowUploadedUpdate(),b.set(d+O,g+D),v.scale.set(1,1),v.rotation=0,v.skew.set(0,0),this.size.set(E,M),m.toFitted(),m.set(w),this.allowUploadedUpdate()}}},n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=1e-6,a=t.local,c=a.x-u,f=a.y-s,l=i.local,v=l.x-u,b=l.y-s,d=e.values,g=d.length;if(h[0]=c,h[1]=f,0<g)for(var m=.5*(v+c),w=.5*(b+f),p=v-c,O=b-f,D=Math.atan2(O,p),E=Math.cos(D),M=Math.sin(D),S=Math.sqrt(p*p+O*O),T=0;T<g;T+=2){var j=d[T+0],N=d[T+1];h[T+2]=m+(E*j-M*N)*S,h[T+3]=w+(E*N+M*j)*S}if(h[2+g]=v,h[3+g]=b,0!==n&&o<(p=h[2]-c)*p+(O=h[3]-f)*O){var I=n/Math.sqrt(p*p+O*O);h[0]=c+p*I,h[1]=f+O*I}0!==r&&o<(p=h[0+g]-v)*p+(O=h[1+g]-b)*O&&(I=r/Math.sqrt(p*p+O*O),h[2+g]=v+p*I,h[3+g]=b+O*I),h.length=g+4},n.prototype.copy=function(i,r){return void 0===r&&(r=at.ALL),t.prototype.copy.call(this,i,r),i instanceof n&&(this.Kr.copy(i.edge),this.Ie.copy(i.body)),this},n.prototype.clone=function(){return new(0,this.constructor)(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.Kr.serialize(n),e=this.Ie.serialize(n),u=this.jt.serialize(n);return i[15]=n.addResource("[".concat(r,",").concat(u,",").concat(e,"]")),i},n}(rn),be=function(){function t(){}return t.isConnector=function(t){return t instanceof ve},t.newMapping=function(n,i,r){var e;null==r&&(r=null!==(e=t.Ce)&&void 0!==e?e:t.Ce=new Map).clear();for(var u=0,s=n.length;u<s;++u){var h=n[u],o=i[u];r.set(h,o),this.newMapping(h.children,o.children,r)}return r},t.moveAll=function(t,n,i,r,e){for(var u=0,s=i.length;u<s;++u){var h=i[u],o=r[u];if(this.isConnector(h)&&this.isConnector(o)){var a=h.edge,c=o.edge,f=a.head,l=f.acceptor.shape;if(l){null==e&&(e=this.newMapping(t,n));var v=e.get(l);if(v){var b=c.head;b.detach(),b.set(v),b.attach(),v.connector.remove(f)}}var d=a.tail,g=d.acceptor.shape;if(g){null==e&&(e=this.newMapping(t,n));var m=e.get(g);if(m){var w=c.tail;w.detach(),w.set(m),w.attach(),m.connector.remove(d)}}}e=this.moveAll(t,n,h.children,o.children,e)}return e},t.move=function(t,n){var i=t.children,r=n.children;this.moveAll(i,r,i,r)},t}(),de=function(){function n(n,i,r,e,u){this.id=n,this.ref=0;var s=u.resolution;this.frame=new t.Rectangle(0,0,i*s,r*s),this.texture=new t.Texture(u,new t.Rectangle(0,0,1,1)),this.width=i,this.height=r,this.strokeWidth=e}return n.prototype.applyFrame=function(){var t=1/this.texture.baseTexture.resolution;this.texture.frame.x=this.frame.x*t,this.texture.frame.y=this.frame.y*t,this.texture.frame.width=this.width,this.texture.frame.height=this.height,this.texture.updateUvs(),this.texture.emit("update",this)},n.prototype.destroy=function(){this.texture.destroy()},n}(),ge=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){},n}(de),me=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.save(),t.fillStyle="#ffffff",t.fillRect(n.x-1,n.y-1,n.width+2,n.height+2),t.restore()},n}(de),we=function(){function n(n){var i=this.vr=document.createElement("canvas");i.width=i.height=256;var r=this.Ae=t.BaseTexture.from(i,{mipmap:t.MIPMAP_MODES.OFF,resolution:n});this.Re={},this.ke=[],this.Le={empty:new ge("empty",10,10,0,r),white:new me("white",10,10,0,r)},this.En=!0}return n.prototype.updateFrames=function(t,n){for(var i=4,r=4,e=0,u=0,s=n.length;u<s;++u){var h=n[u];t<i+h.frame.width+4&&(i=4,r+=e+4,e=0),h.frame.x=0|i,h.frame.y=0|r,i+=h.frame.width+4,e=Math.max(e,h.frame.height)}for(var o=r+e+4,a=256;a<o;)a<<=1;return Math.min(4096,a)},n.prototype.renderFrames=function(t,n,i){var r=this.vr;r.width=t,r.height=n;var e=r.getContext("2d");if(null!=e)for(var u=0,s=i.length;u<s;++u)i[u].render(e)},n.prototype.applyFrames=function(t){for(var n=0,i=t.length;n<i;++n)t[n].applyFrame()},n.prototype.calcCanvasWidth=function(t){for(var n=128,i=t.length-1;0<=i;--i)for(var r=t[i],e=Math.max(r.frame.width,r.frame.height);n<e;)n<<=1;return Math.min(4096,n<<1)},n.prototype.cleanup=function(t){t.sort(n.ITEM_COMPARATOR);for(var i=t.length-1;0<=i;--i)if(0<t[i].ref)return void(t.length=i+1);t.length=0},n.prototype.begin=function(){for(var t=this.ke,n=0,i=t.length;n<i;++n)t[n].ref=0;this.En=!1},n.prototype.end=function(){for(var t=this.Re,n=this.ke,i=0,r=n.length;i<r;++i){var e=n[i];e.ref<=0&&(e.id in this.Le||e.destroy(),delete t[e.id],this.En=!0)}},n.prototype.repack=function(t){if(!0===t||this.En){this.En=!1;var n=this.ke;this.cleanup(n);var i=this.calcCanvasWidth(n),r=this.updateFrames(i,n);this.renderFrames(i,r,n),this.Ae.setRealSize(i,r),this.applyFrames(n)}},n.prototype.get=function(t){var n=this.Re[t];if(null!=n)return n.ref+=1,n;var i=this.Le[t];return null!=i?(this.set(t,i),i):null},n.prototype.set=function(t,n){var i=this.Re[t];return n.ref+=1,this.Re[t]=n,this.ke.push(n),this.En=!0,i},n.prototype.toDirty=function(){this.En=!0},n.prototype.getDefaultTexture=function(){return this.get("white").texture},n.prototype.getBaseTexture=function(){return this.Ae},n.prototype.release=function(t){var n=this.Re,i=n[t];null!=i&&(i.ref-=1,i.ref<=0&&(i.id in this.Le||i.destroy(),delete n[t],this.En=!0))},n.ITEM_COMPARATOR=function(t,n){return t.ref<=0?n.ref<=0?0:1:n.ref<=0||t.frame.height<n.frame.height?-1:n.frame.height<t.frame.height?1:t.frame.width-n.frame.width},n}(),pe=function(t){function n(n,i){var r=t.call(this,n.id,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.canvas=n.canvas,r}return _(n,t),n.prototype.render=function(t){var n=this.canvas;if(null!=n){var i=this.frame;t.drawImage(n,i.x,i.y,i.width,i.height)}},n}(de),Oe="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",De=function(t,n){this.x=t,this.y=n},Ee=function(t,n,i,r,e){this.ref=1,this.life=10,this.character=t,this.x=0,this.y=0,this.width=i,this.height=r,this.advance=n,this.origin=new De(0,0),this.type=e},Me={RESERVED:1,NON_BREAKING:2,SPACE:4,SPACE_R:5,SPACE_NB:6,SPACE_RNB:7,LETTER:8,LETTER_R:9,LETTER_NB:10,LETTER_RNB:11},Se=function(){function t(){var t=this;this.ye=null,this.xe=null,this.Be=null,this._e=NaN,this.Pe=NaN,this.Fe=NaN,this.Ue=NaN,this.Ge=null,this.He=null;var n=this.vr=document.createElement("canvas");n.width=64,n.height=64,this.ze=function(t){t.preventDefault()},this.Ve=function(){t.restore()},this.We=function(){t.destroy()},n.addEventListener("webglcontextlost",this.ze,!1),n.addEventListener("webglcontextrestored",this.Ve,!1),window.addEventListener("unload",this.We,!1)}return t.prototype.init=function(){var t=this.vr;if(null!=t&&(null==this.ye||this.ye.isContextLost())){var n={alpha:!0,antialias:!1,depth:!1,stencil:!1,premultipliedAlpha:!1},i=t.getContext("webgl",n)||t.getContext("experimental-webgl",n);this.ye=i,null!=i&&(i.clearColor(1,1,1,0),this.makeVertexBuffer(),this.makeUvBuffer(),this.makeShaders(),this.xe=null)}return this},t.prototype.restore=function(){this.init()},t.prototype.getCanvas=function(){return this.vr},t.prototype.getShader=function(t,n,i){var r=i?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);return null==r||(t.shaderSource(r,n),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))?r:(console&&console.error("Failed to compile the shader: ".concat(t.getShaderInfoLog(r))),null)},t.prototype.makeShaders=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.getShader(t,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying mediump vec2 vTextureCoord;\nvoid main(void) {\n\tgl_Position = vec4(aVertexPosition, 0.0, 1.0);\n\tvTextureCoord = aTextureCoord;\n}\n",!1);if(null!=n){var i=this.getShader(t,"\nprecision mediump float;\n\nvarying mediump vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec2 uSize;\n\nfloat calcDistance( float x, float y, float dx, float dy ) {\n\tfloat xd = x + dx;\n\tfloat yd = y + dy;\n\tfloat u = xd / uSize.x;\n\tfloat v = yd / uSize.y;\n\tfloat ul = (xd - 1.0) / uSize.x;\n\tfloat vt = (yd - 1.0) / uSize.y;\n\n\tfloat m = texture2D(uSampler, vec2(u , v )).a;\n\tfloat l = texture2D(uSampler, vec2(ul, v )).a;\n\tfloat t = texture2D(uSampler, vec2(u , vt)).a;\n\tfloat ddx = -(0.5 - m) / (l - m);\n\tfloat ddy = -(0.5 - m) / (t - m);\n\tbool bl = min(l,m) < 0.5 && 0.5 <= max(l,m);\n\tbool bt = min(t,m) < 0.5 && 0.5 <= max(t,m);\n\treturn (\n\t\tbl ?\n\t\t(bt ?\n\t\t\tlength(vec2(dx + ddx * 0.5, dy + ddy * 0.5)) :\n\t\t\tlength(vec2(dx + ddx, dy))\n\t\t) :\n\t\t(bt ?\n\t\t\tlength(vec2(dx, dy + ddy)) :\n\t\t\t100.0\n\t\t)\n\t);\n}\n\nfloat calcDistancesY( float x, float y, float dx ) {\n\tfloat d = 100.0;\n\tfor( float dy=-6.0; dy<6.5; dy++ ) {\n\t\td = min( d, calcDistance( x, y, dx, dy ) );\n\t}\n\treturn d;\n}\n\nfloat calcDistances( float x, float y ) {\n\tfloat d = 100.0;\n\tfor( float dx=-6.0; dx<6.5; dx++ ) {\n\t\td = min( d, calcDistancesY( x, y, dx ) );\n\t}\n\treturn d;\n}\n\nvoid main(void) {\n\tfloat t = texture2D(uSampler, vTextureCoord).a;\n\tfloat x = vTextureCoord.x * uSize.x;\n\tfloat y = vTextureCoord.y * uSize.y;\n\tfloat d = min( 6.0, calcDistances( x, y ) ) / 12.0;\n\td = clamp( mix( 0.5 - d, 0.5 + d, step( 0.5, t ) ), 0.0, 1.0 );\n\tgl_FragColor = vec4(1.0, 1.0, 1.0, d);\n}\n",!0);if(null!=i){var r=this.Be=t.createProgram();if(null!=r)return t.attachShader(r,n),t.attachShader(r,i),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)?(t.deleteShader(n),t.deleteShader(i),t.useProgram(r),this._e=t.getAttribLocation(r,"aVertexPosition"),this.Pe=t.getAttribLocation(r,"aTextureCoord"),this.Fe=t.getUniformLocation(r,"uSampler"),this.Ue=t.getUniformLocation(r,"uSize"),t.useProgram(null),r):(console&&console.error("Failed to link the program: ".concat(t.getError())),t.deleteShader(n),t.deleteShader(i),null);t.deleteShader(n),t.deleteShader(i)}else t.deleteShader(n)}}return null},t.prototype.destroyShaders=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.Be;null!=n&&(this.Be=null,t.useProgram(null),t.deleteProgram(n))}},t.prototype.updateTexture=function(t){var n=this.ye,i=this.vr;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=t.width,e=t.height;i.width===r&&i.height===e||(i.width=r,i.height=e,n.viewport(0,0,r,e));var u=this.xe;return null==u?(u=this.xe=n.createTexture(),n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.bindTexture(n.TEXTURE_2D,null)):(n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.bindTexture(n.TEXTURE_2D,null)),u}return null},t.prototype.destroyTexture=function(){var t=this.ye,n=this.xe;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.xe=null,t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n))},t.prototype.makeVertexBuffer=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.Ge=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,1,1,1,-1,-1,1,-1]),t.STATIC_DRAW),n}return null},t.prototype.destroyVertexBuffer=function(){var t=this.ye,n=this.Ge;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.Ge=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.makeUvBuffer=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.He=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),t.STATIC_DRAW),n}return null},t.prototype.destroyUvBuffer=function(){var t=this.ye,n=this.He;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.He=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.render=function(){var t=this.ye,n=this.vr,i=this.Be,r=this.Ge,e=this.He,u=this.xe;if(null!=t&&!0!==t.isContextLost()&&null!=n&&null!=i&&null!=r&&null!=e&&null!=u){t.clear(t.COLOR_BUFFER_BIT),t.useProgram(i),t.bindBuffer(t.ARRAY_BUFFER,r);var s=this._e;t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,e);var h=this.Pe;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,u),t.uniform1i(this.Fe,0),t.uniform2f(this.Ue,n.width,n.height),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.bindTexture(t.TEXTURE_2D,null),t.bindBuffer(t.ARRAY_BUFFER,null),t.useProgram(null)}},t.prototype.read=function(t){var n=this.ye,i=this.vr;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=i.width,e=i.height;t.width=r,t.height=e;var u=t.getContext("2d");null!=u&&u.drawImage(i,0,0)}},t.prototype.destroy=function(){this.destroyVertexBuffer(),this.destroyUvBuffer(),this.destroyShaders();var t=this.vr;null!=t&&(this.vr=null,t.removeEventListener("webglcontextlost",this.ze,!1),t.removeEventListener("webglcontextrestored",this.Ve,!1),window.removeEventListener("unload",this.We,!1));var n=this.ye;if(null!=n){this.ye=null;var i=n.getExtension("WEBGL_lose_context");null!=i&&i.loseContext()}},t.getInstance=function(){return null==t.Xe&&(t.Xe=new t),t.Xe},t.Xe=null,t}(),Te=function(){function t(n){this.R="font-atlas:".concat(n),this.Ke=Se.getInstance().init(),this.vr=document.createElement("canvas"),this.Ye={family:t.toFontFamily(n),size:32,italic:!1},this.Je={},this.Ze=0,this.kt=1,this.pn=1,this.En=!0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.Ye},set:function(t){this.Ye.family=t.family,this.Ye.size=t.size,this.Ye.italic=t.italic},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this.vr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generator",{get:function(){return this.Ke},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"characters",{get:function(){return this.Je},enumerable:!1,configurable:!0}),t.prototype.begin=function(){this.Ze=0;var t=this.Je;for(var n in t)t[n].ref=0},t.prototype.end=function(){var t=this.Je;for(var n in t){var i=t[n];i.ref<=0&&(i.life-=1,i.life<=0&&(delete t[n],this.En=!0))}},t.prototype.addAscii=function(){this.addChar(" "," ",Me.SPACE_R),this.addChar("\t"," ",Me.SPACE_R),this.addChar("...","...",Me.LETTER_RNB);for(var t=0,n=Oe.length;t<n;++t){var i=Oe[t];this.addChar(i,i,Me.LETTER_RNB)}},t.prototype.addChar=function(t,n,i){var r=this.Je;if(!this.isIgnored(n)){var e=r[t];null!=e?(e.ref<=0&&(this.Ze+=1),e.ref+=1):(r[t]=new Ee(n,0,1,1,i),this.Ze+=1,this.En=!0)}},t.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},t.prototype.add=function(t,n){void 0===n&&(n=Me.LETTER);for(var i=b.from(t);i.hasNext();){var r=i.next();this.addChar(r,r,n)}},t.prototype.get=function(t){return this.Je[t]},t.prototype.update=function(){if(this.En){var n=this.vr,i=this.Ke;if(null!=n&&null!=i){var r=n.getContext("2d");if(null!=r){this.En=!1;var e=this.Ye,u=this.Je,s=e.size+14,h=t.toPowerOf2(Math.ceil(Math.sqrt(this.Ze))*s);this.kt=h;var o=(e.italic?"italic ":"")+e.size+"px "+e.family;r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=0,r.fillStyle="#FFFFFF";var a=s>>1,c=0,f=0;for(var l in u){var v=u[l],b=r.measureText(v.character).width,d=Math.ceil(7+b+7),g=s;h<=c+d&&(c=0,f+=s),v.x=c,v.y=f,v.width=d,v.height=g,v.advance=b,v.origin.x=c+7,v.origin.y=f+a,c+=d}var m=this.pn=f+s;for(var l in n.width=h,n.height=m,r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=4,r.fillStyle="#FFFFFF",r.clearRect(0,0,h,m),u)v=u[l],r.fillText(v.character,v.origin.x,v.origin.y);return i.updateTexture(n),i.render(),i.read(n),!0}}}return!1},Object.defineProperty(t.prototype,"length",{get:function(){return this.Ze},enumerable:!1,configurable:!0}),t.prototype.toJson=function(){return{width:this.kt,height:this.pn,font:this.Ye,characters:this.Je}},t.prototype.toString=function(){return JSON.stringify(this.toJson())},t.prototype.destroy=function(){null!=this.Ke&&(this.Ke=null),null!=this.vr&&(this.vr=null);var t=this.Je;for(var n in t)delete t[n]},t.toFontFamily=function(n){return"auto"===n?t.getAutoFontFamily():n},t.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},t.getAutoFontFamily=function(){return null==t.FONT_FAMILY_AUTO&&(t.FONT_FAMILY_AUTO=Z.getInstance().get("DBase").getFontFamilly()),t.FONT_FAMILY_AUTO},t.FONT_FAMILY_AUTO=null,t}(),je=function(){function t(){this.qe={}}return t.prototype.begin=function(){var t=this.qe;for(var n in t)t[n].begin()},t.prototype.end=function(){var t=this.qe;for(var n in t){var i=t[n];0<i.length&&i.addAscii(),i.end(),i.length<=0&&(i.destroy(),delete t[n])}},t.prototype.add=function(t,n){var i=this.qe[t];if(null!=i)i.add(n);else{var r=new Te(t);r.add(n),this.qe[t]=r}},t.prototype.get=function(t){var n=this.qe[t];return null!=n?n:null},t.prototype.update=function(t){var n=this.qe,i=t.getBaseTexture();for(var r in n){var e=n[r];if(e.update()){var u=e.id,s=t.get(u);if(null!=s){var h=e.width,o=e.height,a=i.resolution;s.frame.width=h,s.frame.height=o,s.width=h/a,s.height=o/a,t.toDirty()}else t.set(u,new pe(e,i))}}},t.prototype.destroy=function(){var t=this.qe;for(var n in t)t[n].destroy();this.qe={}},t}(),Ne=function(t){function n(n,i){var r=t.call(this,n.src,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.image=n,r}return _(n,t),n.prototype.render=function(t){var n=this.frame,i=n.x,r=n.y,e=n.width,u=n.height,s=this.image;t.drawImage(s,i,r,e,u),t.drawImage(s,0,0,1,u,i-1,r-1,1,u+2),t.drawImage(s,0,0,e,1,i,r-1,e,1),t.drawImage(s,e-1,0,1,u,i+e,r-1,1,u+2),t.drawImage(s,0,u-1,e,1,i,r+u,e,1)},n}(de),Ie=function(t,n){this.texture=t,this.indexOffset=n},Ce=function(){function t(){this.index=0,this.baseTexture=null,this.units=[]}return t.prototype.begin=function(){this.index=0,this.baseTexture=null},t.prototype.push=function(t,n){if(this.index<this.units.length){var i=this.units[this.index];i.texture=t,i.indexOffset=n}else this.units.push(new Ie(t,n));this.index+=1},t.prototype.end=function(){this.units.length!==this.index&&(this.units.length=this.index)},t.prototype.destroy=function(){this.units.length=0},t}(),Ae=function(){function n(t,n){var i=3*t,r=i;this.vertices=new Float32Array(2*r),this.Qe=r,this.o=0,this.Sn=null,this.clippings=new Float32Array(3*r),this.$e=null,this.steps=new Float32Array(6*r),this.tu=null,this.colorFills=new Float32Array(4*r),this.nu=null,this.colorStrokes=new Float32Array(4*r),this.iu=null,this.uvs=new Float32Array(2*r),this.jn=null;var e=r<=65535;this.indices=e?new Uint16Array(i):new Uint32Array(i),this.ru=t,this.l=0,this.indexCountRequested=0,this.Nn=null,this.eu=n,this.uu=new Ce,this.su=null}return n.prototype.updateVertices=function(){var t=this.Sn;t&&t.update()},n.prototype.updateClippings=function(){var t=this.$e;t&&t.update()},n.prototype.updateSteps=function(){var t=this.tu;t&&t.update()},n.prototype.updateColorFills=function(){var t=this.nu;t&&t.update()},n.prototype.updateColorStrokes=function(){var t=this.iu;t&&t.update()},n.prototype.updateUvs=function(){var t=this.jn;t&&t.update()},n.prototype.updateIndices=function(){var t=this.Nn;t&&t.update()},n.prototype.getGeometry=function(){var n=this.su;return null==n&&(this.Sn=new t.Buffer(this.vertices,!1,!1),this.$e=new t.Buffer(this.clippings,!1,!1),this.tu=new t.Buffer(this.steps,!1,!1),this.nu=new t.Buffer(this.colorFills,!1,!1),this.iu=new t.Buffer(this.colorStrokes,!1,!1),this.jn=new t.Buffer(this.uvs,!1,!1),this.Nn=new t.Buffer(this.indices,!1,!0),this.su=n=(new t.Geometry).addIndex(this.Nn).addAttribute("aPosition",this.Sn,2).addAttribute("aClipping",this.$e,3).addAttribute("aStep",this.tu,2).addAttribute("aAntialias",this.tu,4).addAttribute("aColorFill",this.nu,4).addAttribute("aColorStroke",this.iu,4).addAttribute("aUv",this.jn,2)),n},n.prototype.upload=function(){this.eu.geometry.bind(this.getGeometry())},n.prototype.render=function(n){var i=this.eu;i.geometry.bind(this.getGeometry());var r=this.uu.units,e=r.length;if(0<e){for(var u=t.DRAW_MODES.TRIANGLES,s=null,h=r[0],o=0,a=3*h.indexOffset,c=0,f=t.Texture.WHITE,l=0,v=e-1;l<v;++l)s=h,o=a,c=(a=3*(h=r[l+1]).indexOffset)-o,f=s.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,o));c=3*this.l-a,f=h.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,a))}},n.prototype.isCompatible=function(t,n,i,r){return n.getBuffer()===this&&n.getVertexOffset()===i&&n.getIndexOffset()===r&&n.isCompatible(t)},n.prototype.update=function(t,n,i){var u=this.uu;u.begin();for(var s=0,h=0,o=t.get();null!=o&&null!=(a=o.uploaded)&&this.isCompatible(o,a,s,h);o=t.next())if(a.update(o),a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i)return t.next(),u.end(),this.o=s,this.l=h,0<u.units.length;for(;null!=o;o=t.next()){var a,c=e[o.type]||e[r.GROUP];if(null==c)break;if(null==(a=c(this,o,s,h,n)))break;if(a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i){t.next();break}}return u.end(),this.o=s,this.l=h,0<u.units.length},n.prototype.check=function(t,n,i,r){return this.indexCountRequested=r,t+i<=this.Qe&&n+r<=this.ru},n.prototype.destroy=function(){var t=this.su;t&&t.destroy(),this.uu.destroy()},n}(),Re=[],ke=function(){this.index=0,this.shapes=Re,this.current=null},Le=function(){function t(){this.hu=-1,this.ou=new ke,this.Xt=[this.ou],this.au=null}return t.prototype.reset=function(t,n){this.hu=0;var i=this.Xt[0];return i.index=-1,i.shapes=n,i.current=null,this.ou=i,null!=t?(this.au=t,t):this.next()},t.prototype.get=function(){return this.au},t.prototype.next=function(){for(;;){var t=this.ou,n=t.index+=1,i=t.shapes,r=n<i.length?t.current=i[n]:t.current=null;if(null==r)return e=this.hu-=1,u=this.Xt,0<=e?(h=u[e],this.ou=h,this.au=h.current):this.au=null;var e,u,s=r.children;if(!(0<s.length))return this.au=r,r;if((e=this.hu+=1)<(u=this.Xt).length)(h=u[e]).index=-1,h.shapes=s,h.current=null,this.ou=h;else{var h=new ke;u.push(h),h.index=-1,h.shapes=s,h.current=null,this.ou=h}}},t}(),ye=function(n){function i(r){var e=n.call(this,r)||this;return i.SHADER=i.SHADER||t.Shader.from("\nattribute vec2 aPosition;\nattribute vec3 aClipping;\nattribute vec2 aStep;\nattribute vec4 aAntialias;\nattribute vec4 aColorFill;\nattribute vec4 aColorStroke;\nattribute vec2 aUv;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mediump float shapeScale;\nuniform mediump float pixelScale;\nuniform mediump float antialiasWeight;\n\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nvec2 toInverse( in vec2 v ) {\n\treturn vec2( -v.y, v.x );\n}\n\nvec2 toTransformedPosition( in vec2 v ) {\n\treturn (projectionMatrix * translationMatrix * vec3(v, 1.0)).xy;\n}\n\nvec4 toAntialias01( in vec4 antialias ) {\n\t// Taylor series of 1 / ( 1 - a ) = 1 + a + a^2 + ....\n\treturn 1.0 + min( vec4( 1.0 ), antialias * pixelScale );\n}\n\nvec4 toAntialias2( in vec4 antialias, in float strokeWidth ) {\n\tfloat x = min( 0.4, 0.4 / 12.0 * antialias.x * pixelScale * antialiasWeight );\n\tfloat w = clamp( strokeWidth / antialias.y, 0.0, 1.0 ) * 0.4;\n\tfloat p = w * antialias.z + antialias.w;\n\tfloat y = 0.5 - p;\n\tfloat z = 0.5 - p - w;\n\treturn vec4( y, z, y - max( 0.01, y - x ), z - max( 0.01, z - x ) );\n}\n\nvec2 toPosition3456( in float type, in vec2 p, in vec2 pprev, in vec2 pnext, in float strokeWidth, out float shift ) {\n\tvec2 d0 = p - pprev;\n\tvec2 d1 = pnext - p;\n\tfloat l0 = dot( d0, d0 );\n\tfloat l1 = dot( d1, d1 );\n\tvec2 nd0 = normalize( toInverse( d0 ) );\n\tvec2 nd1 = normalize( toInverse( d1 ) );\n\tvec2 nd2 = 0.00001 < l1 ? nd1 : vec2(0.0, 0.0);\n\tvec2 n0 = 0.00001 < l0 ? nd0 : nd2;\n\tvec2 n1 = 0.00001 < l1 ? nd1 : n0;\n\tvec2 n0i = toInverse( n0 );\n\tvec2 n1i = toInverse( n1 );\n\tfloat direction = sign( 4.5 - type );\n\n\t// Offset\n\tfloat cross = dot( n0i, n1 );\n\tfloat crossInverse = ( 0.00001 < abs( cross ) ? 1.0 / cross : 0.0 );\n\tfloat b = dot(n1 - n0, n0) * crossInverse;\n\tfloat offsetSize = direction * strokeWidth * 0.5;\n\tvec2 offset = n1 + n1i * b;\n\n\t// Miter\n\tvec2 pmiter = p + offsetSize * offset;\n\tfloat miterAngle0 = dot( n0i, pmiter - pprev );\n\tfloat miterAngle1 = dot( n1i, pmiter - pnext );\n\tfloat miterLength = dot( offset, offset );\n\tfloat miterSide = direction * cross;\n\n\t// Bevel\n\tvec2 n = ( type == 4.0 || type == 6.0 ? n1 : n0 );\n\tvec2 pbevel = p + offsetSize * n;\n\n\t//\n\tvec2 presult = (\n\t\t0.0 <= miterSide ?\n\t\t( miterAngle0 < 0.0 && 0.0 <= miterAngle1 ? pmiter : pbevel ) :\n\t\t( miterLength < 6.0 ? pmiter : pbevel )\n\t);\n\tvec2 ni = ( type == 4.0 || type == 6.0 ? n1i : n0i );\n\tshift = dot( ni, p - presult );\n\treturn toTransformedPosition( presult );\n}\n\nvec2 toStep3456( in float type ) {\n\treturn ( type < 4.5 ? vec2( 1.0, 0.0 ) : vec2( 0.0, 1.0 ) );\n}\n\nvec4 toAntialias3456( in float strokeWidth ) {\n\tfloat a = antialiasWeight / max( 0.0001, strokeWidth );\n\treturn toAntialias01( vec4( a, a, a, a ) );\n}\n\nfloat toDotAndDashScale( in float scale, in float strokeWidthScale ) {\n\treturn (\n\t\tscale == 4.0 || scale == 5.0 || scale == 6.0 || scale == 7.0 ?\n\t\tstrokeWidthScale : 1.0\n\t);\n}\n\nvec4 toColorStroke3456( in float shift, in float scale ) {\n\tfloat x = aColorFill.x + shift;\n\tfloat y = scale * aColorFill.y;\n\tfloat z = scale * aColorFill.z;\n\tfloat w = aColorFill.w;\n\treturn vec4( x, y, z, w );\n}\n\nfloat toStrokeWidthScale( in float scale ) {\n\treturn (\n\t\tscale == 3.0 || scale == 7.0 ?\n\t\tshapeScale : (\n\t\t\tscale == 1.0 || scale == 5.0 ?\n\t\t\tmin( 1.0, shapeScale ) : (\n\t\t\t\tscale == 2.0 || scale == 6.0 ?\n\t\t\t\tmax( 1.0, shapeScale ) : 1.0\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec2 toStep01(in vec2 size, in vec2 weight, in vec2 strokeWidth) {\n\treturn weight / max(vec2(0.00001), vec2(1.0) - strokeWidth / size);\n}\n\nvec4 toAntialias01b(in vec2 size, in vec2 strokeWidth) {\n\treturn antialiasWeight / max(vec4(0.00001), vec4(size - strokeWidth, size));\n}\n\nvoid main(void) {\n\tvec2 p012 = toTransformedPosition( aPosition );\n\n\tfloat type = aClipping.z;\n\tfloat strokeWidthScale = toStrokeWidthScale( aStep.y );\n\tfloat strokeWidth = strokeWidthScale * aStep.x;\n\n\t// type === 0 or 1\n\tvec2 size01 = aAntialias.xy;\n\tvec2 weight01 = abs(aAntialias.zw - sign(aAntialias.zw));\n\tvec2 strokeWidth01 = step(vec2(0.0), aAntialias.zw) * strokeWidth;\n\tvec2 step01 = toStep01( size01, weight01, strokeWidth01 );\n\tvec4 a01 = toAntialias01( toAntialias01b( size01, strokeWidth01 ) );\n\n\t// type === 2\n\tvec4 a2 = toAntialias2( aAntialias, strokeWidth );\n\n\t// type === 3, 4, 5 or 6\n\tfloat shift3456 = 0.0;\n\tvec2 p3456 = toPosition3456( type, aPosition, aAntialias.xy, aAntialias.zw, strokeWidth, shift3456 );\n\tvec2 step3456 = toStep3456( type );\n\tvec4 a3456 = toAntialias3456( strokeWidth );\n\tvec4 colorStroke3456 = toColorStroke3456( shift3456, toDotAndDashScale( aStep.y, strokeWidthScale ) );\n\n\t//\n\tgl_Position = vec4( ( 2.5 < type ? p3456 : p012 ), 0.0, 1.0 );\n\tvAntialias = ( 1.5 < type ? ( 2.5 < type ? a3456 : a2 ) : a01 );\n\tvClipping = aClipping;\n\tvStep = ( 2.5 < type ? step3456 : step01 );\n\tvColorFill = ( 2.5 < type ? aColorStroke : aColorFill );\n\tvColorStroke = ( 2.5 < type ? colorStroke3456 : aColorStroke );\n\tvUv = aUv;\n}","\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float pixelScale;\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tfloat type = vClipping.z;\n\tvec2 v0 = vStep;\n\tvec2 v1 = vClipping.xy;\n\tvec2 v2 = v0 * vAntialias.xy;\n\tvec2 v3 = v1 * vAntialias.zw;\n\tvec2 d01 = ( v0.x < v0.y ? vec2( v0.y, v2.y ) : vec2( v0.x, v2.x ) );\n\tvec2 d02 = ( v1.x < v1.y ? vec2( v1.y, v3.y ) : vec2( v1.x, v3.x ) );\n\tvec4 d0 = vec4( d01.x, d02.x, d01.y, d02.y );\n\tvec4 d1 = vec4( dot( v0, v0 ), dot( v1, v1 ), dot( v2, v2 ), dot( v3, v3 ) );\n\tvec4 d = ( type == 1.0 ? d1 : d0 );\n\tvec2 s = smoothstep( 1.0 - (d.zw - d.xy), vec2( 1.0 ), d.xy );\n\tvec4 color01 = texture * (vColorStroke * (s.x - s.y) + vColorFill * (1.0 - s.x));\n\n\tfloat l = vColorStroke.x;\n\tfloat lp0 = vColorStroke.y;\n\tfloat lp1 = vColorStroke.z;\n\tfloat lt = vColorStroke.w;\n\tfloat ld = 0.5 * pixelScale;\n\tfloat lm = mod( l, lp0 + lp1 );\n\tfloat ls0 = ( 0.0 < lp1 ? smoothstep( 0.0, ld, lm ) - smoothstep( lp0, lp0 + ld, lm ) : 1.0 );\n\tfloat ls1 = ( 0.0 <= lt ? smoothstep( 0.0, ld, l ) - smoothstep( lt - ld, lt, l ) : 1.0 );\n\tvec4 color3456 = color01 * ls0 * ls1;\n\n\tvec2 a0 = vAntialias.xy;\n\tvec2 a1 = vAntialias.zw;\n\tvec2 a2 = vec2( texture.a );\n\tvec2 a = smoothstep( a0 - a1, a0 + a1, a2 );\n\tvec4 color2 = a.x * vColorFill + ( a.y - a.x ) * vColorStroke;\n\tgl_FragColor = ( type == 2.0 ? color2 : (2.5 < type ? color3456 : color01) );\n}"),e.cu=i.SHADER,e.fu=new Le,e.lu=e.getBufferSizeMax(r),e}return _(i,n),i.prototype.getBufferSizeMax=function(t){var n=t.context,i=n.extensions;return 1<n.webGLVersion||i.uint32ElementIndex?1431655765:21845},i.prototype.updateAtlas=function(t,n,i,r,e){var u=t.imageSrc;if(null!=u){var s=n.get(u);if(null!=s)t.texture=s.texture;else{var h=t.image;if(null!=h){var o=new Ne(h,e);t.texture=o.texture,n.set(o.id,o)}else t.texture=r}}else t.texture=r;var a=t.text,c=a.value;0<c.length&&i.add(a.family,c)},i.prototype.updateAtlases=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];this.updateAtlas(h,n,i,r,e);for(var o=h.children,a=0,c=o.length;a<c;++a){var f=o[a];this.updateAtlas(f,n,i,r,e),this.updateAtlases(f.children,n,i,r,e)}}},i.prototype.updateFontAtlas=function(t,n,i,r){var e=t.text,u=i.get(e.family);if(null!=u){var s=n.get(u.id);null!=s?(e.atlas=u,e.texture=s.texture):(e.atlas=void 0,e.texture=r)}else e.atlas=void 0,e.texture=r},i.prototype.updateFontAtlases=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];this.updateFontAtlas(s,n,i,r);for(var h=s.children,o=0,a=h.length;o<a;++o){var c=h[o];this.updateFontAtlas(c,n,i,r),this.updateFontAtlases(c.children,n,i,r)}}},i.prototype.vu=function(n,i,r,e){var u=this.renderer,s=this.cu;if(null!=s&&(null!=i||0<r.length)){var h=u.resolution,o=n.getBuffers(),a=n.getAntialiasWeight(h);if(e){var c=n.getAtlas(h),f=n.getFontAtlases();c.begin(),f.begin();var l=c.getDefaultTexture(),v=c.getBaseTexture();this.updateAtlases(r,c,f,l,v),f.end(),f.update(c),this.updateFontAtlases(r,c,f,l),c.end(),c.repack(),this.updateBuffers(i,r,o,u,a)}s.uniforms.shapeScale=n.toShapeScale(),s.uniforms.pixelScale=n.toPixelScale(h),s.uniforms.antialiasWeight=a,s.uniforms.translationMatrix=n.worldTransform.toArray(!0),u.shader.bind(s,!1),u.state.setBlendMode(t.utils.correctBlendMode(t.BLEND_MODES.NORMAL,!0));var b=o.length;if(1<b)for(var d=0;d<b;++d)o[d].upload();for(d=0;d<b;++d)o[d].render(s)}},i.prototype.updateBuffers=function(t,n,i,r,e){var u=this.fu;u.reset(t,n);for(var s=0,h=0,o=5e3,a=this.lu;null!=u.get();){var c=null,f=!1;if(0<h?(c=new Ae(h,r),i.splice(s,0,c),f=!0):s<i.length?(c=i[s],f=!1):(c=new Ae(o,r),i.push(c),f=!1),c.update(u,e,f))h=0,s+=1;else{if(!((h=c.indexCountRequested)<=a))break;h=Math.ceil(h/o)*o,h=Math.min(h,a)}}if(s<i.length){for(var l=s,v=i.length;l<v;++l)i[l].destroy();i.length=s}},i.SHADER=null,i}(t.ObjectRenderer),xe=function(n){function i(){var i=n.call(this)||this;return i.bu=null,i.children=[],i.Xr=null,i.du=0,i.gu=-1,i.mu=null,i.wu=new je,i.pu=1,i.Ou=NaN,i.Du=1,i.Eu=NaN,i.Mu=new t.Point,i.Su=[],i}return _(i,n),i.prototype.calculateBounds=function(){this._bounds.clear()},i.prototype.onChildTransformChange=function(){},i.prototype.toDirty=function(){return this.du+=1},i.prototype.isDirty=function(){return this.gu<this.du},i.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var n=this.du,i=this.gu;this.gu=n;var r=i<n,e=this.bu;null==e&&(e=this.bu=new ye(t)),t.batch.setObjectRenderer(e);var u=this.mask,s=this.Xr,h=this.children;u?(t.mask.push(this,u),e.vu(this,s,h,r),t.mask.pop(this)):e.vu(this,s,h,r)}},i.prototype.containsPoint=function(t){return!1},i.prototype.getFontAtlases=function(){return this.wu},i.prototype.getAtlas=function(t){var n=this.mu;return null==n&&(n=new we(t),this.mu=n),n},i.prototype.getBuffers=function(){return this.Su},i.prototype.toShapeScale=function(){this.updateTransform();var t=this.transform,n=t._worldID;if(n!==this.Eu){this.Eu=n;var i=t.worldTransform,r=i.a,e=i.b;this.Du=1/Math.sqrt(r*r+e*e)}return this.Du},i.prototype.getShapeScale=function(){return this.Du},i.prototype.toPixelScale=function(t){var n=this.toShapeScale(),i=this.Eu;return this.Ou!==i&&(this.Ou=i,this.pu=1/t*n),this.pu},i.prototype.getPixelScale=function(){return this.pu},i.prototype.getAntialiasWeight=function(t){return 1.25/t},i.prototype.hitTest=function(t,n){for(var i=this.Mu,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible){u.toLocal(t,void 0,i);var s=u.contains(i.x,i.y);if(null!=s&&(null==n||n(s)))return s}}return null},i.prototype.hitTestBBox=function(t,n){for(var i=this.Mu,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible&&(u.toLocal(t,void 0,i),u.containsBBox(i.x,i.y)&&(null==n||n(u))))return u}return null},i.prototype.destroy=function(){var t=this.Su;if(null!=t)for(var i=0,r=t.length;i<r;++i)t[i].destroy();this.Su.length=0;var e=this.children;for(i=e.length-1;0<=i;--i)e[i].destroy();e.length=0,n.prototype.destroy.call(this)},i}(t.DisplayObject),Be=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED_LAYER);var s=t.call(this,i,e,u)||this;return s.Gr=n,s}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),n.prototype.newGroupFill=function(){return new $(this,!1,16777215,1)},n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=q.SIZE_X,r=q.SIZE_Y;return new kr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}t.onChildTransformChange(),t.toDirty();var u=this.size;if(u instanceof kr){var s=u.base;t.size.set(s.x,s.y).init().set(u.x,u.y)}else t.size.init();return t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Gr,this.Fr,this.Ur,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n}(xr),_e=function(){function t(){}return t.toLayers=function(t,n){var i=[],r=this.toLayer(t);if(r){var e=r.parent;if(e)for(var u=e.children,s=u.length,h=0,o=n.length;h<o;++h){var a=n[h];0<=a&&a<s&&i.push(u[a])}}return i},t.toLayer=function(t){for(var n=t.parent;null!=n;){if(n instanceof xe)return n;if(n instanceof Be)return n;n=n.parent}return null},t.show=function(t){return!t.visible&&(t.visible=!0,!0)},t.showAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible||(e.visible=!0,n=!0)}return n},t.hide=function(t){return!!t.visible&&(t.visible=!1,!0)},t.hideAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible&&(e.visible=!1,n=!0)}return n},t.bringToFront=function(t){var n=t.parent;return!!n&&this.doBringToFront(t,n.children,0)},t.bringAllToFront=function(t){var n=t.length;if(0<n){var i=t[0].parent;if(i){for(var r=!1,e=i.children,u=0;u<n;++u){var s=t[n-1-u];this.doBringToFront(s,e,u)&&(r=!0)}return r}}return!1},t.doBringToFront=function(t,n,i){for(var r=n.length-1-i,e=r;0<=e;--e){var u=n[e];if(u===t){if(e!==r){for(var s=e+1;s<=r;++s)n[s-1]=n[s];return n[r]=u,!0}return!1}}return!1},t}(),Pe={NONE:0,DRAG:1,PINCH:2,ALL:3},Fe=t.interaction.InteractionEvent,Ue=function(n){function i(t){var i=n.call(this,t,cn.NONE)||this;return i.Tu=new Map,i.ju=t.operationType,i.Nu=t.scaleMin,i.Iu=t.scaleMax,i}return _(i,n),i.prototype.initialize=function(t,i){if(n.prototype.initialize.call(this,t,i),null==this.Tu.get(t)){var r=_e.toLayer(t);null!=r&&this.Tu.set(t,r)}},i.prototype.onDown=function(t,i,r){if(n.prototype.onDown.call(this,t,i,r),r instanceof Fe){var e=this.Tu.get(t),u=r.data.originalEvent.timeStamp;e&&this.condition(t,u,ln)&&this.getGestureUtil().onDown(e,r)}},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new mr({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.ju,c=!1,f=1;if(a&Pe.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Iu,Math.max(this.Nu,v*u));f=b/v,l.set(b,b),c=!0}if(a&Pe.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&st.update(t)}},i.prototype.toSize=function(t,n){return"size"in t?n.copyFrom(t.size):n.set(t.width,t.height),n},i}(dn),Ge=t.interaction.InteractionEvent,He=function(n){function i(t){var i=n.call(this,t,cn.NONE)||this;return i.ju=t.operationType,i.Nu=t.scaleMin,i.Iu=t.scaleMax,i}return _(i,n),i.prototype.onDown=function(t,i,r){n.prototype.onDown.call(this,t,i,r),r instanceof Ge&&this.condition(t,r.data.originalEvent.timeStamp,ln)&&this.getGestureUtil().onDown(t,r)},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new mr({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.ju,c=!1,f=1;if(a&Pe.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Iu,Math.max(this.Nu,v*u));f=b/v,l.set(b,b),c=!0}if(a&Pe.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&st.update(t)}},i}(dn),ze={SHAPE:0,LAYER:1},Ve={INPUT_TEXT:0,INPUT_INTEGER:1,INPUT_REAL:2,EMIT_EVENT:3,WRITE_BOTH:4,WRITE_LOCAL:5,WRITE_REMOTE:6,HTML_ELEMENT:7,HTML_ELEMENT_WITHOUT_POINTER_EVENTS:8,SHOW_HIDE_LAYER:9,GESTURE_LAYER:10,GESTURE:11,EXECUTE:12},We=function(t){function n(n,i,r,e,u){void 0===n&&(n=""),void 0===e&&(e=.05),void 0===u&&(u=20);var s=t.call(this,jn.GESTURE,n,i)||this;return s.operationType=r,s.scaleMin=e,s.scaleMax=u,s}return _(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case ze.SHAPE:return new He(this);case ze.LAYER:return new Ue(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.operationType,",").concat(this.scaleMin,",").concat(this.scaleMax,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),this.toSubType(t),t[3],t[4],t[5])},n.toSubType=function(t){if(t[0]!==jn.MISC)return t[2];switch(t[2]){case Ve.GESTURE:return ze.SHAPE;case Ve.GESTURE_LAYER:return ze.LAYER}},n}(Tn),Xe={INVISIBLE:"INVISIBLE",INTERACTIVE:"INTERACTIVE",DRAGGABLE:"DRAGGABLE",PINCHABLE:"PINCHABLE"},Ke=function(t,n,i,r,e){var u,s,h,o=function(t,n){if(Ot(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""}(t[0],n),a=e?e(o,n):new Be(o,n.mode,n.depth),c=t[1];null==c||2&c||(a.visible=!1,a.state.add(Xe.INVISIBLE));var f=-.5*i+(t[2]||0),l=-.5*r+(t[3]||0);a.transform.position.set(f,l);var v=null!==(u=t[4])&&void 0!==u?u:i,b=null!==(s=t[5])&&void 0!==s?s:r;a.size.set(v,b),a.size.init();var d=t[6];if(null!=d&&a.fill.deserialize(d,n),n.mode===Tr.VIEWER){var g=null!==(h=t[7])&&void 0!==h?h:1,m=1&g,w=2&g,p=4&g;if(w||p){var O=(w?Pe.DRAG:Pe.NONE)|(p?Pe.PINCH:Pe.NONE);a.action.add(new We("",ze.LAYER,O))}(m||w||p)&&(a.interactive=!0)}return a},Ye=function(){function t(t,n){this.children=[],this.kt=t,this.pn=n}return t.prototype.hasConnectors=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r instanceof ve)return!0;var e=r.children;if(0<e.length&&this.hasConnectors(e))return!0}return!1},t.prototype.newHasConnectors=function(){for(var t=new Map,n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];t.set(e,this.hasConnectors(e.children))}return t},t.prototype.copyTo=function(t){for(var n,i=null!==(n=this.Cu)&&void 0!==n?n:this.Cu=this.newHasConnectors(),r=this.children,e=t.children,u=0,s=r.length;u<s;++u){var h=r[u],o=h.clone();o.parent=t,e.push(o),i.get(h)&&be.move(h,o)}t.onChildTransformChange(),t.toDirty(),t.onAttach()},t.prototype.deserialize=function(t,n){var i=t.length;if(0<i)for(var r=this.kt,e=this.pn,u=0;u<i;++u)this.children.push(Ke(t[u],n,r,e))},t}(),Je=function(){function t(){}return t.toSimple=function(t){return{version:t.version,id:t.id,name:t.name,thumbnail:t.thumbnail,data:JSON.stringify({width:t.width,height:t.height,background:t.background,tile:t.tile,resources:t.resources,data:t.data||t.tags,pieces:t.pieces,layers:t.layers,items:t.items,snap:t.snap})}},t.toSerialized=function(t){if(!("items"in t)){var n=JSON.parse(t.data),i={version:t.version,id:t.id,name:t.name,width:n.width,height:n.height,background:n.background,tile:n.tile,resources:n.resources,data:n.data||n.tags,pieces:n.pieces,layers:n.layers,items:n.items,snap:n.snap,thumbnail:t.thumbnail};if(null==i.data){var r=t.tags;null!=r&&(i.data=JSON.parse(r))}if(null==i.pieces){var e=t.pieces;null!=e&&(i.pieces=JSON.parse(e))}return i}return t},t.newLayer=function(t,n,i){n.deserialize(t.layers,i);var r=t.items,e=Fr(r,i);return null!=e?e.then((function(t){for(var i=n.children,e=0,u=t.length;e<u;++e){var s=r[e],h=t[e];null!=(o=i[s[16]])&&(h.parent=o,h.uploaded=void 0,o.children.push(h))}for(e=0,u=i.length;e<u;++e){var o;(o=i[e]).onChildTransformChange(),o.toDirty();for(var a=o.children,c=0,f=a.length;c<f;++c)a[c].onAttach()}return t})):Promise.resolve([])},t.toPieceData=function(t,n,i){var r=new Map,e=new Map,u=function(){return r};return this.Au(t,n,r,e,i,0).then(u,u)},t.Au=function(t,n,i,r,e,u){var s=this,h=[];if(n&&0<n.length&&t)for(var o=function(o,a){var c=n[o],f=r.get(c);if(null!=f)h.push(f);else{var l=t.piece.getByName(c).then((function(n){return s.Ru(t,c,n,e,u+1,i,r)}),(function(){return null}));r.set(c,l),h.push(l)}},a=0,c=n.length;a<c;++a)o(a);return Promise.all(h)},t.Ru=function(t,n,i,r,e,u,s){var h=this,o=this.toSerialized(i),a=o.width,c=o.height,f=new Ye(a,c);u.set(n,new Gr(n,a,c,f));var l=o.pieces;return this.Au(t,l,u,s,r,e).then((function(){return h.newLayer(o,f,new Sr(o,l,u,r,e))}))},t}(),Ze={},qe=function(){function t(){}return t.isContainer=function(t){return t instanceof Dr},t.isEmbedded=function(t){return t instanceof Br},t.toContainer=function(t){for(var n=t;null!=n;){if(this.isContainer(n))return n;n=n.parent}return null},t.open=function(t,n,i,r){var e=Ze[n];if(null!=e)e(i,r,t);else switch(n){case Er.DIAGRAM:var u=this.toContainer(t);if(u){var s=u.controller;s&&s.getByName(i).then((function(t){u.set(Je.toSerialized(t))}))}break;case Er.PAGE:r?window.open(i):window.location.href=i}},t.writeLocal=function(t,n,i,r,e){var u;void 0===e&&(e=Pt.FOUND);for(var s=t;null!=s;){if(this.isContainer(s))return(s.data.private.set(n,i,r,e)||s.data.protected.set(n,i,r,e)||!!s.data.set(n,i,r,e))&&(st.update(s),!0);if(this.isEmbedded(s)&&(null===(u=s.data.getPrivate())||void 0===u?void 0:u.set(n,i,r,e)))return st.update(s),!0;s=s.parent}return!1},t.writeRemote=function(t,n,i){var r=this.toContainer(t);return!!r&&r.data.remote.set(n,i)},t.emit=function(n,i,r,e){var u=t.toContainer(n);void 0===e?(n.emit(i,n),u&&u.shape.emit(i,n)):(n.emit(i,r,e,n),u&&u.shape.emit(i,r,e,n))},t}(),Qe=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.name=vn.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.name(t,i,ln);null!=r&&qe.emit(t,r)}},n}(dn),$e=function(t){function n(n,i){var r=t.call(this,jn.EMIT_EVENT,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new Qe(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),Nn.toResource(2,t,i.resources))},n}(Sn),tu=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofStringOrNull(n.target),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.target(t,i,ln);null!=r&&qe.emit(t,r)}},n}(dn),nu={NO_POINTER_EVENTS:"NO_POINTER_EVENTS"},iu=function(){function n(t){var n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg");i.setAttribute("style","position: absolute;"),i.setAttribute("width","0px"),i.setAttribute("height","0px");var r=document.createElementNS(n,"defs"),e=document.createElementNS(n,"clipPath"),u="clipper_ex_".concat(Math.random().toString(32).substring(2));e.setAttribute("id",u),e.setAttribute("clipPathUnits","objectBoundingBox");var s=document.createElementNS(n,"path");this.ku=s,this.Lu="",s.setAttribute("clip-rule","evenodd"),e.appendChild(s),r.appendChild(e),i.appendChild(r),this.R=u,t.appendChild(i)}return Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.update=function(t,n,i){var r=this.toD(t,n,i);this.Lu!=r&&(this.ku.setAttribute("d",r),this.Lu=r)},n.prototype.toD=function(i,r,e){var u,s;if(null==i)return"";var h=i.width,o=i.height,a=1e-4;if(h<a||o<a)return"";if(e.size<=0)return"M0,0 h1 v1 h-1z";var c=null!==(u=n.WORK_MATRIX)&&void 0!==u?u:n.WORK_MATRIX=new t.Matrix;null!=r?(c.copyFrom(r),c.invert()):c.identity(),c.translate(-i.x,-i.y),c.scale(1/h,1/o);for(var f=-1,l=2,v=-1,b=2,d="",g=c.a,m=c.b,w=c.c,p=c.d,O=c.tx,D=c.ty,E=null!==(s=n.WORK_RECTS)&&void 0!==s?s:n.WORK_RECTS=[],M=this.toRects(e,E),S=0;S<M;S+=4){var T=E[S+0],j=E[S+1],N=E[S+2],I=E[S+3],C=g*T+w*j+O,A=m*T+p*j+D,R=g*N+w*j+O,k=m*N+p*j+D,L=g*N+w*I+O,y=m*N+p*I+D,x=g*T+w*I+O,B=m*T+p*I+D;f=Math.min(f,C,R,L,x),l=Math.max(l,C,R,L,x),v=Math.min(v,A,k,y,B),b=Math.max(b,A,k,y,B);var _=C.toFixed(5),P=A.toFixed(5),F=R.toFixed(5),U=k.toFixed(5),G=L.toFixed(5),H=y.toFixed(5),z=x.toFixed(5),V=B.toFixed(5);d+=" M".concat(_,",").concat(P," L").concat(F,",").concat(U," L").concat(G,",").concat(H," L").concat(z,",").concat(V,"Z")}return"M".concat(f,",").concat(v," L").concat(l,",").concat(v," L").concat(l,",").concat(b," L").concat(f,",").concat(b,"Z")+d},n.prototype.toRects=function(t,n){for(var i=t.data,r=t.size<<2,e=0;e<r;e+=4){var u=i[e+0],s=i[e+1],h=i[e+2],o=i[e+3];u<h?(n[e+0]=u,n[e+2]=h):(n[e+0]=h,n[e+2]=u),s<o?(n[e+1]=s,n[e+3]=o):(n[e+1]=o,n[e+3]=s)}for(e=4;e<r;e+=4){u=n[e+0],s=n[e+1],h=n[e+2],o=n[e+3];for(var a=0;a<e;a+=4){var c=n[a+0],f=n[a+1],l=n[a+2],v=n[a+3],b=0,d=0;if(u<=c)if(h<=l){if(h<=c)continue;b=2,d=1}else d=3;else if(h<=l)b=3;else{if(l<=u)continue;b=1,d=2}var g,m,w=0,p=0;if(s<=f)if(o<=v){if(o<=f)continue;w=2,p=1}else p=3;else if(o<=v)w=3;else{if(v<=s)continue;w=1,p=2}if(4==(g=0===b||0===w?0:1===b||2===b?3===w?2:1:3===w?4:2)){e+4<r&&(n[e+0]=n[r+0],n[e+1]=n[r+1],n[e+2]=n[r+2],n[e+3]=n[r+3]),e-=4,r-=4;break}if(4!=(m=0===d||0===p?0:1===d||2===d?3===p?2:1:3===p?4:2))if(0===g)if(0===m){for(O=r-4;a<O;O-=4)n[O+4]=n[O+0],n[O+5]=n[O+1],n[O+6]=n[O+2],n[O+7]=n[O+3];0===d?(n[a+3]=s,n[a+4]=c,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=h,n[a+5]=f,n[a+6]=l,n[a+7]=v),e+=4,r+=4,a+=4}else 2===m&&(1===d?n[a+0]=h:2===d?n[a+2]=u:1===p?n[a+1]=o:2===p&&(n[a+3]=s));else if(1===g){for(O=r-4;a<O;O-=4)n[O+4]=n[O+0],n[O+5]=n[O+1],n[O+6]=n[O+2],n[O+7]=n[O+3];1===d?1===p?(n[a+0]=h,n[a+4]=c,n[a+5]=o,n[a+6]=h,n[a+7]=v):(n[a+0]=h,n[a+4]=c,n[a+5]=f,n[a+6]=h,n[a+7]=s):1===p?(n[a+2]=u,n[a+4]=u,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=u,n[a+5]=f,n[a+6]=l,n[a+7]=s),e+=4,r+=4,a+=4}else 2===g&&(1===b?(n[e+0]=l,u=l):2===b?(n[e+2]=c,h=c):1===w?(n[e+1]=v,s=v):2===w&&(n[e+3]=f,o=f));else{for(var O=a+4;O<r;O+=4)n[O-4]=n[O+0],n[O-3]=n[O+1],n[O-2]=n[O+2],n[O-1]=n[O+3];e-=4,r-=4,a-=4}}}return r},n}(),ru=function(){function t(){this.Xt=[],this.j=0,this.hu=0,this.En=!0}return Object.defineProperty(t.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),t.prototype.isDirty=function(){return this.En},t.prototype.toClean=function(){this.En=!1},t.prototype.begin=function(){return this.hu=0,this},t.prototype.end=function(){var t=this.hu;this.j=t;var n=this.Xt,i=t<<2;return n.length!==i&&(n.length=i,this.En=!0),this},t.prototype.add=function(t,n,i,r){var e=this.hu<<2;this.hu+=1;var u=this.Xt;return e<u.length?u[e+0]===t&&u[e+1]===n&&u[e+2]===i&&u[e+3]===r||(u[e+0]=t,u[e+1]=n,u[e+2]=i,u[e+3]=r,this.En=!0):(u.push(t,n,i,r),this.En=!0),this},t}(),eu={CLICKED:0,DOUBLE_CLICKED:1,FOCUSED:2,ALWAYS:3},uu=function(){function n(t,n,i,r){var e=this;this.ei=t,this.yu=n;var u=this.toData(i,r);this.Xt=u,this.xu=!1,this.Bu=function(t){e.onElementFocus(t)},this._u=function(t){e.onBeforeFocus(t)},this.Pu=function(t){e.onAfterFocus(t)},this.Fu=!1,this.Uu=!1,this.Gu=function(){e.doSelect()},this.Hu=this.Xt.when===eu.ALWAYS,this.zu=function(){e.updateElement(e.Vu)}}return n.prototype.toData=function(t,n){var i,r;return{element:this.toElementData(t,null==n?void 0:n.element),clipper:this.toClipperData(t,null==n?void 0:n.clipper),before:this.toBeforeData(t,null==n?void 0:n.before),after:this.toAfterData(t,null==n?void 0:n.after),when:Ai(null!==(i=null==n?void 0:n.when)&&void 0!==i?i:t.getWhen(),eu),select:null!==(r=null==n?void 0:n.select)&&void 0!==r?r:t.getSelect()}},n.prototype.toElementData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getElementCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newElementStyler(t)}},n.prototype.newElementStyler=function(t){return function(n,i,r,e,u,s,h){return t.setElementStyle(n,i,r,e,u,s,h)}},n.prototype.toClipperData=function(t,n){var i,r,e;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getClipperCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newClipperStyler(t),extended:null!==(e=null==n?void 0:n.extended)&&void 0!==e?e:t.isClipperExEnabled()}},n.prototype.newClipperStyler=function(t){return function(n,i,r,e,u,s,h){return t.setClipperStyle(n,i,r,e,u,s,h)}},n.prototype.toBeforeData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getBeforeCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newBeforeStyler(t)}},n.prototype.newBeforeStyler=function(t){return function(n){t.setBeforeStyle(n)}},n.prototype.toAfterData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getAfterCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newAfterStyler(t)}},n.prototype.newAfterStyler=function(t){return function(n){t.setAfterStyle(n)}},Object.defineProperty(n.prototype,"element",{get:function(){var t;return null!==(t=this.Wu)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"when",{get:function(){return this.Xt.when},enumerable:!1,configurable:!0}),n.prototype.onDowning=function(t){switch(this.Uu=this.Fu,this.when){case eu.CLICKED:this.start();break;case eu.FOCUSED:this.ei.state.isFocused&&this.start()}},n.prototype.onDown=function(t){!this.Uu&&this.Fu&&("data"in t?t.data.originalEvent.preventDefault():t.preventDefault())},n.prototype.onDblClick=function(t,n){switch(this.when){case eu.DOUBLE_CLICKED:this.start()}},n.prototype.onFocus=function(){var t;switch(this.when){case eu.FOCUSED:this.start();break;default:null===(t=this.Wu)||void 0===t||t.focus()}},n.prototype.onBlur=function(){var t;switch(this.when){case eu.CLICKED:case eu.DOUBLE_CLICKED:case eu.FOCUSED:this.onEndByBlur(),this.cancel();break;default:null===(t=this.Wu)||void 0===t||t.blur()}},n.prototype.isStartable=function(){switch(this.when){case eu.CLICKED:case eu.DOUBLE_CLICKED:case eu.FOCUSED:return this.ei.state.isActionable;default:return!0}},n.prototype.start=function(){!this.Fu&&this.isStartable()&&(this.Fu=!0,this.ei.worldVisible?this.doStart():this.Hu=!0,st.update(this.ei))},n.prototype.isShown=function(){return this.xu},n.prototype.onRender=function(t){(this.Hu||!this.xu&&this.when===eu.ALWAYS)&&(this.Hu=!1,this.doStart(t)),this.Fu&&(this.Fu=!1)},n.prototype.getElementRect=function(n){var i=this.wn||new t.Point(0,0);this.wn=i;var r=this.Xu||new t.Rectangle;return this.Xu=r,this.yu.getElementRect(n,i,r)},n.prototype.getElementMatrix=function(){return this.yu.getElementMatrix()},n.prototype.getClipperRect=function(n){var i=this.wn||new t.Point(0,0);this.wn=i;var r=this.Ku||new t.Rectangle;return this.Ku=r,this.yu.getClipperRect(n,i,r)},n.prototype.fillClipperExRects=function(t,n){var i=this.yu;return i.getClipperExRects&&i.getClipperExRects(n),n.isDirty()},n.prototype.doStart=function(t){var n,i;if(!this.xu){this.xu=!0;var r=this.Vu;null!=r&&(this.Vu=void 0,r.off("postrender",this.zu));var e=this.ei;null==t&&(t=null===(n=st.getLayer(e))||void 0===n?void 0:n.renderer),t&&(this.Vu=t,t.on("postrender",this.zu)),this.onStart();var u=this.getClipper();if(u){var s=this.getBefore(u),h=this.getElement(u),o=this.getAfter(u),a=this.getClipperEx(u);if(h){var c=null!==(i=null==t?void 0:t.resolution)&&void 0!==i?i:st.getResolution(e),f=this.getElementRect(c),l=this.getElementMatrix(),v=this.toClipperRectAdjusted(f,l,this.getClipperRect(c)),b=e.state,d=this.yu.getPadding(),g=this.Xt;if(g.clipper.styler(u,b,d,f,l,v,a),g.element.styler(h,b,d,f,l,v,a),s&&g.before.styler(s),o&&g.after.styler(o),this.onElementAttached(h,s,o),a){var m=this.getClipperExRects();m&&this.fillClipperExRects(c,m)&&(a.update(f,l,m),m.toClean())}u.style.display="",b.isFocused&&this.toElementFocused(h),u.scrollTop=0,u.scrollLeft=0,this.Xt.select&&setTimeout(this.Gu,0)}}}},n.prototype.toElementFocused=function(t){t.focus({preventScroll:!0})},n.prototype.onStart=function(){this.yu.onStart()},n.prototype.doSelect=function(){var t=this.Wu;t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select()},n.prototype.cancel=function(){var t;if(this.xu){this.xu=!1;var n=this.Vu;null!=n&&(this.Vu=void 0,n.off("postrender",this.zu)),this.onCancel();var i=this.ei,r=st.getLayer(i);if(r){var e=r.view;switch(this.when){case eu.CLICKED:case eu.DOUBLE_CLICKED:case eu.FOCUSED:document.activeElement===this.Wu&&e.focus()}var u=i.state,s=r.renderer.plugins.interaction;this.yu.containsPoint(s.mouse.global)&&!u.isHovered&&(u.isHovered=!0,e.style.cursor=null!==(t=i.cursor)&&void 0!==t?t:""),r.update()}var h=this.Wu;null!=h&&this.onElementDetached(h,this.Yu,this.Ju);var o=this.Zu;null!=o&&(o.style.display="none")}},n.prototype.onCancel=function(){this.yu.onCancel()},n.prototype.onElementAttached=function(t,n,i){null==n||n.addEventListener("focus",this._u),null==i||i.addEventListener("focus",this.Pu),t.addEventListener("focus",this.Bu,!0)},n.prototype.onElementDetached=function(t,n,i){null==n||n.removeEventListener("focus",this._u),null==i||i.removeEventListener("focus",this.Pu),t.removeEventListener("focus",this.Bu,!0)},n.prototype.getClipper=function(){var t=this.Zu;if(null==t){var n=st.getLayer(this.ei);t=n?this.Xt.clipper.creator(n.getElementContainer()):null,this.Zu=t}return t},n.prototype.getClipperEx=function(t){var n=this.qu;return void 0===n&&(n=null!=this.getClipperExRects()?new iu(t):null,this.qu=n),n},n.prototype.getClipperExRects=function(){var t=this.Qu;return void 0===t&&(t=this.Xt.clipper.extended?new ru:null,this.Qu=t),t},n.prototype.getElement=function(t){var n=this.Wu;return null==n&&(n=this.Xt.element.creator(t),this.Wu=n),n},n.prototype.getBefore=function(t){var n=this.Yu;return null==n&&(n=this.Xt.before.creator(t),this.Yu=n),n},n.prototype.getAfter=function(t){var n=this.Ju;return null==n&&(n=this.Xt.after.creator(t),this.Ju=n),n},n.prototype.onBeforeFocus=function(t){var n=this.ei,i=st.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!1);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onAfterFocus=function(t){var n=this.ei,i=st.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!0);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onElementFocus=function(t){if(this.when===eu.ALWAYS){var n=this.ei;n.state.isFocused||n.focus()}},n.prototype.onEndByBlur=function(){this.onEnd()},n.prototype.onEnd=function(){this.yu.onEnd()},n.prototype.end=function(){this.onEnd(),this.cancel()},n.prototype.select=function(){return this.xu&&this.Xt.select&&this.doSelect(),this},n.prototype.toClipperRectAdjusted=function(t,n,i){if(i&&t&&null==n){var r=t.x,e=t.y,u=r+t.width,s=e+t.height,h=i.x,o=i.y,a=h+i.width,c=o+i.height,f=Math.min(Math.max(h,r),a),l=Math.min(Math.max(h,u),a),v=Math.min(Math.max(o,e),c),b=Math.min(Math.max(o,s),c);i.x=f,i.y=v,i.width=l-f,i.height=b-v}return i},n.prototype.updateElement=function(t){if(this.xu){var n=this.ei;if(n.worldVisible){var i=this.Wu,r=this.Zu,e=this.qu;if(i&&r){var u=t.resolution,s=this.getElementRect(u),h=this.getElementMatrix(),o=this.toClipperRectAdjusted(s,h,this.getClipperRect(u)),a=n.state,c=this.yu.getPadding(),f=this.Xt;if(f.clipper.styler(r,a,c,s,h,o,e),f.element.styler(i,a,c,s,h,o,e),e){var l=this.getClipperExRects();l&&this.fillClipperExRects(u,l)&&(e.update(s,h,l),l.toClean())}}}else switch(this.when){case eu.ALWAYS:(r=this.Zu)&&(r.style.display="none");break;default:this.cancel()}}},n.getClipperRect=function(t,n,i,r,e){for(var u=!0,s=0,h=0,o=0,a=0,c=t;c instanceof hr;){c.getClippingRect(n,e),r.set(e.x,e.y),c.toGlobal(r,r,!1);var f=(r.x*i|0)/i,l=(r.y*i|0)/i;r.set(e.x+e.width,e.y+e.height),c.toGlobal(r,r,!0);var v=r.x,b=r.y,d=Math.min(f,v),g=Math.min(l,b),m=Math.max(f,v),w=Math.max(l,b);u?(u=!1,s=d,h=g,o=m,a=w):(s=Math.min(Math.max(s,d),m),h=Math.min(Math.max(h,g),w),o=Math.min(Math.max(o,d),m),a=Math.min(Math.max(a,g),w)),c=c.parent}return u?null:(e.x=s,e.y=h,e.width=o-s,e.height=a-h,e)},n}(),su=function(){function t(t){var n=t.transform,i=n.position;this.x=i.x,this.y=i.y;var r=t.size;this.sizeX=r.x,this.sizeY=r.y,this.rotation=n.rotation,this.actions=[],this.fill=t.fill.toObject(),this.stroke=t.stroke.toObject(),this.text=t.text.toObject(),this.cursor=t.cursor,this.reset=cn.NONE,this.written=cn.NONE,this.effect=NaN,this.isStateChanged=!1,this.interactive=!1}return t.prototype.initialize=function(t){t.disallowUploadedUpdate();for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].initialize(t,this);t.allowUploadedUpdate()},t.prototype.isActionable=function(){return 0<this.actions.length},t.prototype.onResize=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onResize(t,this)},t.prototype.onClick=function(t,n){var i=t.state;i.isActionable&&(i.isClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onClick(t,this,n)},t.prototype.onDblClick=function(t,n,i){var r=t.state;r.isActionable&&(r.isDblClicked=!0);for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onDblClick(t,this,n,i);return!1},t.prototype.onOver=function(t,n){var i=t.state;if(!i.isHovered){i.isHovered=!0;for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onOver(t,this,n)}},t.prototype.onOut=function(t,n){if(t.state.isHovered){t.state.isHovered=!1;for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onOut(t,this,n)}},t.prototype.onDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onDowning(t,this,n);var u=t.state;if(!u.isDown)if(u.isPressed)for(u.addAll(Mt.DOWN,ct.PRESSED),(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onDown(t,this,n),s.onPressed(t,this,n)}else{var h,o;for(u.isDown=!1,(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onDown(t,this,n)}},t.prototype.onUp=function(t,n){var i=t.state;if(!i.isUp)if(i.isPressed){i.set(Mt.UP,ct.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUp(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUp(t,this,n)}},t.prototype.onUpOutside=function(t,n){var i=t.state;if(i.isPressed){i.set(Mt.UP_OUTSIDE,ct.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUpOutside(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUpOutside(t,this,n)}},t.prototype.onMove=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onMove(t,this,n)},t.prototype.onKeyDown=function(t,n){nr.isActivateKey(n)&&this.onDown(t,n);for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onKeyDown(t,this,n);return!1},t.prototype.onKeyUp=function(t,n){if(nr.isActivateKey(n)){var i=t.state;if(i.isPressed){var r=i.isUp;this.onUp(t,n),!r&&i.isUp&&this.onClick(t,n)}}for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onKeyUp(t,this,n);return!1},t.prototype.onStateChange=function(t,n,i){this.isStateChanged=!0,st.update(t),n.isFocused?i.isFocused||this.onFocus(t):i.isFocused&&this.onBlur(t)},t.prototype.onFocus=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onFocus(t,this)},t.prototype.onBlur=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onBlur(t,this)},t.prototype.onRightClick=function(t,n){var i=t.state;i.isActionable&&(i.isRightClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRightClick(t,this,n)},t.prototype.onRightDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onRightDowning(t,this,n);var u=t.state;if(!u.isRightDown)if(u.isRightPressed)for(u.addAll(Mt.RIGHT_DOWN,Mt.RIGHT_PRESSED),(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onRightDown(t,this,n),s.onRightPressed(t,this,n)}else{var h,o;for(u.isRightDown=!1,(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onRightDown(t,this,n)}},t.prototype.onRightUp=function(t,n){var i=t.state;if(!i.isRightUp)if(i.isRightPressed){i.set(Mt.RIGHT_UP,Mt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUp(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUp(t,this,n)}},t.prototype.onRightUpOutside=function(t,n){var i=t.state;if(i.isRightPressed){i.set(Mt.RIGHT_UP_OUTSIDE,Mt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUpOutside(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUpOutside(t,this,n)}},t.prototype.update=function(n,i){var r=n.data,e=this.effect<=i;if(r.isChanged||this.isStateChanged||e){this.isStateChanged=!1,r.isChanged=!1,e&&(this.effect=NaN),n.disallowUploadedUpdate(),this.onUpdate(n,i),n.allowUploadedUpdate();var u=this.isStateChanged;n.state.removeAll(t.TRANSIENT_STATES),this.isStateChanged=u}},t.prototype.onRender=function(t,n,i){for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRender(t,this,n,i);this.update(t,n)},t.prototype.onUpdate=function(t,n){var i=this.actions;if(0<i.length){this.written=cn.NONE;for(var r=0,e=i.length;r<e;++r)i[r].execute(t,this,n);this.doReset(t)}},t.prototype.doReset=function(t){var n=~this.written&this.reset;if(n!==cn.NONE){if(n&cn.POSITION_X&&(t.transform.position.x=this.x),n&cn.POSITION_Y&&(t.transform.position.y=this.y),n&cn.VISIBILITY&&(t.visible=!0),n&cn.COLOR_FILL){var i=this.fill;t.fill.set(void 0,i.color,i.alpha)}if(n&cn.COLOR_STROKE){var r=this.stroke;t.stroke.set(void 0,r.color,r.alpha)}if(n&cn.COLOR_TEXT){var e=this.text;t.text.set(void 0,e.color,e.alpha)}if(n&cn.COLOR_TEXT_OUTLINE){var u=this.text.outline;t.text.outline.set(void 0,u.color,u.alpha)}n&cn.HEIGHT&&(t.size.y=this.sizeY),n&cn.WIDTH&&(t.size.x=this.sizeX),n&cn.ROTATION&&(t.transform.rotation=this.rotation),n&cn.TEXT&&(t.text.value=this.text.value),n&cn.CURSOR&&(t.cursor=this.cursor)}},t.TRANSIENT_STATES=[Mt.CLICKED,Mt.DBL_CLICKED,Mt.DOWN,Mt.UP,Mt.UP_OUTSIDE,Mt.RIGHT_CLICKED,Mt.RIGHT_DOWN,Mt.RIGHT_UP,Mt.RIGHT_UP_OUTSIDE,Mt.ACTIVATED,Mt.DEACTIVATED],t}(),hu=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Qt(this,n,i,r,e,u,s)},n}(Jt),ou=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_PIVOTED),t.call(this,n)||this}return _(n,t),n.prototype.toHitTestData=function(n,i){var r=t.prototype.toHitTestData.call(this,n,i);return r.x-=r.width,r.y-=r.height,r},n}(hu),au=function(t){function n(n){var i=t.call(this)||this;i.name=n,i.interactive=!1,i.reference=0;var r=i.newShape();return r.parent=i,i.Xr=r,i.interactives=[],i}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.Xr.size.x},set:function(t){this.Xr.size.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.Xr.size.y},set:function(t){this.Xr.size.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"background",{get:function(){return this.Xr.fill},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Xr.state},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){var t=new ou;return t.fill.set(!1,16777215,1),t.stroke.set(!1),t.state.add(Xe.INTERACTIVE),t},n.prototype.initialize=function(t){var n=this.interactives,i=this.Xr,r=i.state.is(Xe.INTERACTIVE),e=i.state.is(Xe.DRAGGABLE),u=i.state.is(Xe.PINCHABLE);if(e||u){var s=new su(i);i.runtime=s;var h=(e?Pe.DRAG:Pe.NONE)|(u?Pe.PINCH:Pe.NONE);s.actions.push(new We("",ze.LAYER,h).toRuntime()),t.push(i),s.initialize(i)}(r||e||u)&&(i.interactive=!0,n.push(i)),this.doInitialize(this.children,n)},n.prototype.doInitialize=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i],u=e.runtime;if(u)if(e.interactive||u.interactive)n.push(e);else{var s=e.cursor;null!=s&&0<s.length&&n.push(e)}var h=e.children;0<h.length&&this.doInitialize(h,n)}},n.prototype.update=function(t){this.doUpdate(this.children,t)},n.prototype.doUpdate=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];e.update(n);var u=e.children;0<u.length&&this.doUpdate(u,n)}},n.prototype.hitTestInteractives=function(t){for(var n=this.Mu,i=this.interactives,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible&&(e.toLocal(t,void 0,n),null!=e.contains(n.x,n.y)))return e}return null},n.prototype.addUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},n.prototype.updateUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},n.prototype.destroy=function(){if(!this._destroyed){for(var n=this.children,i=n.length-1;0<=i;--i)n[i].destroy();n.length=0,t.prototype.destroy.call(this)}},n.prototype.serialize=function(t,n,i){for(var r=this.children,e=0,u=r.length;e<u;++e){var s=r[e].serialize(n);s[16]=t,i.push(s)}var h=this.Xr,o=n.addResource(this.name||""),a=(this.visible?1:0)|(h.state.is(Xe.INVISIBLE)?0:2),c=this.position,f=h.size,l=h.fill.serialize(n),v=h.state.is(Xe.INTERACTIVE)?1:0,b=h.state.is(Xe.DRAGGABLE)?2:0,d=h.state.is(Xe.PINCHABLE)?4:0;return[o,a,c.x,c.y,f.x,f.y,l,v|b|d]},n.deserialize=function(t,i,r,e){var u,s,h,o=new n(this.deserializeName(t[0],i)),a=o.Xr,c=t[1];if(null!=c){var f=i.mode!==Tr.VIEWER;!f||1&c||(o.visible=!1),2&c||(a.state.add(Xe.INVISIBLE),f||(o.visible=!1))}var l=t[2],v=t[3];o.position.set(l,v);var b=null!==(u=t[4])&&void 0!==u?u:r,d=null!==(s=t[5])&&void 0!==s?s:e;a.size.set(b,d);var g=t[6];null!=g&&a.fill.deserialize(g,i);var m=null!==(h=t[7])&&void 0!==h?h:1;return a.state.set(Xe.INTERACTIVE,!!(1&m)),a.state.set(Xe.DRAGGABLE,!!(2&m)),a.state.set(Xe.PINCHABLE,!!(4&m)),o},n.deserializeName=function(t,n){if(Ot(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""},n}(xe),cu=!1,fu=function(){return cu},lu=function(n){function i(t){var i=n.call(this)||this;return i.condition=vn.ofString(t.condition),i.utils=new Map,i}return _(i,n),i.prototype.getUtil=function(t,n){var i=this.utils,r=i.get(t);return null==r&&(r=this.newUtil(t,n),i.set(t,r)),r},i.prototype.newUtil=function(t,n){return new uu(t,this.newOperation(t,n),Z.getInstance().get("DHtmlElement"),this.newUtilOptions(t,n))},i.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},i.prototype.newUtilOptions=function(t,n){return{element:{creator:this.newElementCreator(t,n)},when:this.toWhen(t,n),clipper:{extended:fu()}}},i.prototype.toWhen=function(t,n){var i=this.condition(t,Date.now(),ln);if(null!=i&&i in eu)return eu[i]},i.prototype.containsPoint=function(n,r,e){var u;if(n.visible){var s=null!==(u=i.WORK)&&void 0!==u?u:i.WORK=new t.Point;return n.toLocal(e,void 0,s),null!=n.contains(s.x,s.y)}return!1},i.prototype.getPadding=function(t,n){return null},i.prototype.getElementRect=function(t,n,i,r,e){var u=t.transform.pivot,s=t.size,h=s.x,o=s.y;return e.x=-.5*h+u.x,e.y=-.5*o+u.y,e.width=h,e.height=o,e},i.prototype.getElementMatrix=function(t,n){return t.updateTransform(),t.transform.worldTransform},i.prototype.getClipperToRect=function(t,n,i,r,e){var u=qe.toContainer(t);return uu.getClipperRect(u,t,i,r,e)},i.prototype.getClipperExRects=function(t,n){n.begin();var i=t.root.parent;if(i instanceof au){var r=i.parent;if(null!=r){var e=r.children,u=e.indexOf(i);if(0<=u)for(var s=u+1,h=e.length;s<h;++s){var o=e[s];if(o.visible){var a=o.width,c=o.height,f=o.transform.worldTransform,l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty;n.add(g,m,l*a+b*c+g,v*a+d*c+m)}}}}n.end()},i.prototype.onRender=function(t,n,i,r){this.getUtil(t,n).onRender(r)},i.prototype.onFocus=function(t,n){this.getUtil(t,n).onFocus()},i.prototype.onBlur=function(t,n){this.getUtil(t,n).onBlur()},i.prototype.onDowning=function(t,n,i){this.getUtil(t,n).onDowning(i)},i.prototype.onDown=function(t,n,i){this.getUtil(t,n).onDown(i)},i.prototype.onDblClick=function(t,n,i,r){this.getUtil(t,n).onDblClick(i,r)},i}(bn),vu=function(t){function n(n){var i=t.call(this,n)||this;return i.elementCreator=vn.ofElementOrNull(n.value),i.noPointerEvent=n.subtype===Ve.HTML_ELEMENT_WITHOUT_POINTER_EVENTS,i}return _(n,t),n.prototype.newUtil=function(n,i){return this.noPointerEvent&&n.state.add(nu.NO_POINTER_EVENTS),t.prototype.newUtil.call(this,n,i)},n.prototype.newElementCreator=function(t,n){var i=this.elementCreator;if(i)return function(n){return i(t,Date.now(),ln,n)}},n}(lu),bu=function(t){function n(n,i,r,e){var u,s,h,o,a,c,f=this;(f=t.call(this,n,i,r,e)||this).yu=i,f.$u=function(t){f.onInputKeyDown(t)},f.ts=function(){f.onInputChange()},f.ns=function(t){f.onInputInput(t)},f.rs=null!==(u=null==e?void 0:e.description)&&void 0!==u?u:"";var l=null==e?void 0:e.editing;return f.es=null!==(o=null!==(s=null==l?void 0:l.formatter)&&void 0!==s?s:null===(h=null==e?void 0:e.text)||void 0===h?void 0:h.formatter)&&void 0!==o?o:r.getEditingFormatter(),f.us=null!==(a=null==l?void 0:l.unformatter)&&void 0!==a?a:r.getEditingUnformatter(),f.ss=null!==(c=null==l?void 0:l.validator)&&void 0!==c?c:r.getEditingValidator(),f}return _(n,t),n.prototype.onEnd=function(){t.prototype.onEnd.call(this),this.onInputChange()},n.prototype.onElementAttached=function(n,i,r){n.value=this.fromValue(this.yu.getValue()),n.addEventListener("change",this.ts),n.addEventListener("input",this.ns),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){t.prototype.onElementDetached.call(this,n,i,r),n.removeEventListener("change",this.ts),n.removeEventListener("input",this.ns)},n.prototype.onInputKeyDown=function(t){nr.isOkKey(t)?(this.end(),this.yu.onEnter()):nr.isCancelKey(t)&&this.cancel()},n.prototype.toElementFocused=function(n){t.prototype.toElementFocused.call(this,n),n.scrollTop=0,n.scrollLeft=0},n.prototype.onInputChange=function(){if(this.isShown()){var t=this.element;if(null!=t){var n=this.yu,i=this.toValue(t.value),r=n.getValue();r!==i&&n.onValueChange(i,r)}}},n.prototype.toValue=function(t){return this.us(t,this)},n.prototype.fromValue=function(t){return void 0!==t?this.es(t,this):""},n.prototype.onInputInput=function(t){var n=t.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&this.yu.onValueInput(this.toValue(n.value))},n.prototype.validate=function(){var t=this.yu.getValue();if(void 0!==t){var n=this.ss(t,this);if(this.hs!==n){this.hs=n;var i=this.ei.state;i.isInvalid=null!=n,i.isHovered&&this.yu.applyTitle()}return n}return null},n.prototype.applyTitle=function(){var t=this.hs;if(Ot(t)){var n=st.getLayer(this.ei);return n&&(n.view.title=t),!0}return!1},n}(uu),du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.$u),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.$u),t.prototype.onElementDetached.call(this,n,i,r)},n}(bu),gu=function(t){function n(n,i,r,e){var u,s,h,o=this;return(o=t.call(this,n,i,r,e)||this).os=null!==(u=null==e?void 0:e.step)&&void 0!==u?u:r.getStep(),o.cs=null!==(s=null==e?void 0:e.min)&&void 0!==s?s:r.getMin(),o.fs=null!==(h=null==e?void 0:e.max)&&void 0!==h?h:r.getMax(),o}return _(n,t),Object.defineProperty(n.prototype,"step",{get:function(){return this.os},set:function(t){this.os!==t&&(this.os=t,this.onStepChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.cs},set:function(t){this.cs!==t&&(this.cs=t,this.onMinChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.fs},set:function(t){this.fs!==t&&(this.fs=t,this.onMaxChange())},enumerable:!1,configurable:!0}),n.prototype.toValue=function(n){var i=t.prototype.toValue.call(this,n);if(i==i){var r=this.cs;if(null!=r&&i<r)return r;var e=this.fs;return null!=e&&e<i?e:i}return 0},n.prototype.fromValue=function(t){return void 0!==t?this.es(t,this):"0"},n.prototype.onStepChange=function(){if(this.isShown()){var t=this.element;t&&this.updateStep(t)}},n.prototype.onMinChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMin(t)}},n.prototype.onMaxChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMax(t)}},n.prototype.updateStep=function(t){var n=this.step;t.step=null!=n?"".concat(n):"any"},n.prototype.updateMin=function(t){var n=this.min;null!=n?t.min="".concat(n):t.removeAttribute("min")},n.prototype.updateMax=function(t){var n=this.max;null!=n?t.max="".concat(n):t.removeAttribute("max")},n.prototype.onElementAttached=function(n,i,r){n.type="number",t.prototype.onElementAttached.call(this,n,i,r),this.updateStep(n),this.updateMin(n),this.updateMax(n)},n}(du),mu={EMIT_EVENT:0,WRITE_BOTH:1,WRITE_LOCAL:2,WRITE_REMOTE:3},wu=function(){function t(){}return t.execute=function(t,n,i,r,e){switch(n){case mu.EMIT_EVENT:t.emit(i,t,r),qe.emit(t,i,r,e);break;case mu.WRITE_LOCAL:qe.writeLocal(t,i,r,e);break;case mu.WRITE_REMOTE:qe.writeRemote(t,i,r);break;case mu.WRITE_BOTH:qe.writeLocal(t,i,r,e),qe.writeRemote(t,i,r)}},t}(),pu=function(t){function n(n){var i=t.call(this,n)||this;return i.target=vn.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i}return _(n,t),n.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){t.text.enable=!1},onCancel:function(){t.text.enable=!0},onEnd:function(){},getValue:function(){return i.getUtil(t,n).toValue(t.text.value)},onValueInput:function(t){},onValueChange:function(r,e){i.onValueChange(t,n,r,e)},onEnter:function(){},applyTitle:function(){}}},n.prototype.newElementCreator=function(t,n){},n.prototype.getPadding=function(t,n){return t.text.padding},n.prototype.onValueChange=function(t,n,i,r){t.text.value=this.getUtil(t,n).fromValue(i);var e=Date.now(),u=this.target(t,e,ln);null!=u&&wu.execute(t,this.onInputAction,u,i,e)},n}(lu),Ou=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(pu),Du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Ou),Eu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new gu(t,this.newOperation(t,n),Z.getInstance().get("DInputInteger"),this.newUtilOptions(t,n))},n}(Du),Mu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new gu(t,this.newOperation(t,n),Z.getInstance().get("DInputReal"),this.newUtilOptions(t,n))},n}(Du),Su=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.type="text",t.prototype.onElementAttached.call(this,n,i,r)},n}(du),Tu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new Su(t,this.newOperation(t,n),Z.getInstance().get("DInputText"),this.newUtilOptions(t,n))},n}(Ou),ju=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofStringOrNull(n.target),i.value=vn.ofUnknown(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.target(t,i,ln);null!=r&&this.write(t,r,this.value(t,i,ln),i)}},n}(dn),Nu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){qe.writeLocal(t,n,i,r),qe.writeRemote(t,n,i)},n}(ju),Iu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){qe.writeLocal(t,n,i,r)},n}(ju),Cu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){qe.writeRemote(t,n,i)},n}(ju),Au=function(t){function n(n,i,r,e,u){var s=t.call(this,jn.MISC,i,n)||this;return s.target=r,s.onInputAction=e,s.value=u,s}return _(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case Ve.INPUT_TEXT:return new Tu(this);case Ve.INPUT_INTEGER:return new Eu(this);case Ve.INPUT_REAL:return new Mu(this);case Ve.EMIT_EVENT:return new tu(this);case Ve.WRITE_BOTH:return new Nu(this);case Ve.WRITE_LOCAL:return new Iu(this);case Ve.WRITE_REMOTE:return new Cu(this);case Ve.HTML_ELEMENT:case Ve.HTML_ELEMENT_WITHOUT_POINTER_EVENTS:return new vu(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,"]"))},n.deserialize=function(t,i){var r=i.resources,e=Nn.toResource(1,t,r),u=Nn.toResource(3,t,r),s=Nn.toResource(5,t,r);return new n(t[2],e,u,t[4],s)},n}(Tn),Ru=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofUnknown(n.target),i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,ln)&&this.target(t,i,ln)},n}(dn),ku=function(t){function n(n,i){var r=t.call(this,jn.MISC,n,Ve.EXECUTE)||this;return r.target=i,r}return _(n,t),n.prototype.toRuntime=function(){return new Ru(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=i.resources;return new n(Nn.toResource(1,t,r),Nn.toResource(3,t,r))},n}(Tn),Lu=function(t){function n(n,i){var r=t.call(this,n,cn.NONE)||this;return r.subtype=i,r.target=vn.ofStringOrNull(n.target),r.inNewWindow=n.inNewWindow,r}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.target(t,i,ln);null!=r&&qe.open(t,this.subtype,r,this.inNewWindow)}},n}(dn),yu={DIAGRAM_LEGACY:0,PAGE_LEGACY:1,PAGE_INPLACE_LEGACY:2,DIALOG_TEXT:3,DIALOG_INTEGER:4,DIALOG_REAL:5,DIALOG_BOOLEAN:6,DIALOG_DATE:7,DIALOG_TIME:8,DIALOG_DATETIME:9,DIAGRAM:10,PAGE:11,DIALOG:12,EXTENSION:Er.EXTENSION},xu=function(t){function n(n,i,r,e){var u=t.call(this,jn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){switch(this.subtype){case yu.DIAGRAM:return new Lu(this,Er.DIAGRAM);case yu.PAGE:return new Lu(this,Er.PAGE)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(3,t,i.resources);return new n(this.toSubType(t),r,e,this.inNewWindow(t))},n.toSubType=function(t){if(6!==t.length)return t[2];switch(t[2]){case yu.DIAGRAM_LEGACY:return yu.DIAGRAM;case yu.PAGE_LEGACY:case yu.PAGE_INPLACE_LEGACY:return yu.PAGE}},n.inNewWindow=function(t){if(6!==t.length)return!!t[4];switch(t[2]){case yu.DIAGRAM_LEGACY:return!1;case yu.PAGE_LEGACY:return!0;case yu.PAGE_INPLACE_LEGACY:return!1}},n}(Tn),Bu={TOP:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,LEFT:4,LEFT_TOP:5,LEFT_MIDDLE:6,LEFT_BOTTOM:7,RIGHT:8,RIGHT_TOP:9,RIGHT_MIDDLE:10,RIGHT_BOTTOM:11,BOTTOM:12,BOTTOM_LEFT:13,BOTTOM_CENTER:14,BOTTOM_RIGHT:15,OVER:16},_u=function(){function t(){}return t.attach=function(t,n,i,r,e,u,s){var h=t.width,o=t.height,a=0;switch(s){case Bu.LEFT:case Bu.LEFT_TOP:case Bu.LEFT_MIDDLE:case Bu.LEFT_BOTTOM:(a=n.left-h-i)<i&&e-i<(a=n.right+i)+h&&(a=i);break;case Bu.RIGHT:case Bu.RIGHT_TOP:case Bu.RIGHT_MIDDLE:case Bu.RIGHT_BOTTOM:e-i<(a=n.right+i)+h&&(a=n.left-h-i)<i&&(a=e-h-i);break;case Bu.TOP:case Bu.TOP_LEFT:case Bu.BOTTOM:case Bu.BOTTOM_LEFT:a=this.adjust(n.left,h,i,e);break;case Bu.TOP_RIGHT:case Bu.BOTTOM_RIGHT:a=this.adjust(n.right-h,h,i,e);break;case Bu.TOP_CENTER:case Bu.BOTTOM_CENTER:case Bu.OVER:a=this.adjust(.5*(n.left+n.right-h),h,i,e)}var c=0;switch(s){case Bu.LEFT:case Bu.LEFT_TOP:case Bu.RIGHT:case Bu.RIGHT_TOP:c=this.adjust(n.top,o,r,u);break;case Bu.LEFT_MIDDLE:case Bu.RIGHT_MIDDLE:case Bu.OVER:c=this.adjust(.5*(n.top+n.bottom-o),o,r,u);break;case Bu.LEFT_BOTTOM:case Bu.RIGHT_BOTTOM:c=this.adjust(n.bottom,o,r,u);break;case Bu.TOP:case Bu.TOP_LEFT:case Bu.TOP_RIGHT:case Bu.TOP_CENTER:(c=n.top-o-r)<r&&u<(c=n.bottom+r)+o&&(c=r);break;case Bu.BOTTOM:case Bu.BOTTOM_LEFT:case Bu.BOTTOM_RIGHT:case Bu.BOTTOM_CENTER:u-r<(c=n.bottom+r)+o&&(c=n.top-o-r)<r&&(c=u-o-r)}t.position.set(a,c)},t.adjust=function(t,n,i,r){return t<i?r-i<t+n?.5*(r-n):i:r-i<t+n?r<n?.5*(r-n):r-n-i:t},t}(),Pu={NONE:0,ESC:1,CLICK_OUTSIDE:2},Fu={DIRTY:0,CLEAN:1},Uu=function(){function n(t,n){var i;this.p=t,this.zn=n,n.enable&&(this.ls=this.newUtil()),this.Fr=Ai(null!==(i=n.mode)&&void 0!==i?i:Fu.DIRTY,Fu),this.vs=!0,this.En=!1}return Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Fr},set:function(t){this.Fr=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"constraint",{get:function(){var t,n,i=this.xi;return null==i&&(i=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.constraint)&&void 0!==n?n:this.newConstraint(),this.xi=i),i},set:function(t){this.xi=t},enumerable:!1,configurable:!0}),n.prototype.newConstraint=function(){var t=this;return function(n,i,r,e){t.toConstrained(n,i,r,e)}},n.prototype.isDirty=function(){return this.En},n.prototype.isClean=function(){return!this.En},n.prototype.toClean=function(){this.En&&(this.En=!1)},n.prototype.newUtil=function(){var n=this,i=new t.Point,r=this.p,e=r.position;return new mr({bind:r,checker:{start:function(t){if(t.target!==r)return!1;i.copyFrom(t.data.global),r.toLocal(i,void 0,i,!0);var n=i.x,e=i.y;return!(n<0||e<0||r.width<n||r.height<e)}},on:{start:function(){i.copyFrom(e)},move:function(t,u,s){i.set(i.x+u,i.y+s),n.En||(n.En=!0,r.setX(e.x),r.setY(e.y));var h=r.layer;null!=h&&n.constraint(r,h,i.x,i.y)}}})},n.prototype.toConstrained=function(i,r,e,u){var s,h=i.position;if(r){var o=i.getBounds(!1,null!==(s=n.WORK_BOUNDS)&&void 0!==s?s:n.WORK_BOUNDS=new t.Rectangle),a=o.x+e-h.x,c=o.y+u-h.y,f=Math.min(Math.max(0,a),r.width-o.width),l=Math.min(Math.max(0,c),r.height-o.height);h.set(e+f-a,u+l-c)}else h.set(e,u)},n}(),Gu={MODAL:0,MODELESS:1,MENU:2},Hu={MODAL:"MODAL",MODELESS:"MODELESS",MENU:"MENU"},zu=function(){function n(){}return n.apply=function(t,n){var i=this;t.on(ir.down,(function(r){if(r.target===t){var e=i.point;e.copyFrom(r.data.global),t.toLocal(e,void 0,e,!0);var u=e.x,s=e.y;(u<0||s<0||t.width<u||t.height<s)&&setTimeout((function(){n(r)}),0)}}))},n.point=new t.Point,n}(),Vu=function(){function t(t){this.bs=null,this.gs=null==(null==t?void 0:t.parent)?st.last():null}return Object.defineProperty(t.prototype,"picked",{get:function(){return this.bs},enumerable:!1,configurable:!0}),t.prototype.pick=function(t){var n=this.bs;if(null==n){if(!(n=st.getLayerOverlay(t))){var i=this.gs;n=i?i.getLayerOverlay():st.last().getLayerOverlay()}this.bs=n}return n},t}(),Wu=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i,r,e=this;n.prototype.init.call(this,t),this.ws=function(){e.onPrerender()},this.bs=null;var u=this.theme,s=Ai(null!==(i=null==t?void 0:t.mode)&&void 0!==i?i:u.getMode(),Gu);this.Fr=s,this.ps=null!==(r=null==t?void 0:t.sticky)&&void 0!==r?r:u.isSticky(s);var h=this.toCloseOn(s,u,t);switch(this.Os=h,this.Lt=this.toAlign(s,u,t),this.Ds=new Vu,this.lr=new Uu(this,this.toGestureOptions(s,u,t)),this.visible=!1,s){case Gu.MODAL:this.state.addAll(ct.FOCUS_ROOT,Hu.MODAL);break;case Gu.MODELESS:this.state.add(Hu.MODELESS);break;case Gu.MENU:this.state.addAll(ct.FOCUS_ROOT,Hu.MENU)}h&Pu.CLICK_OUTSIDE&&zu.apply(this,(function(){e.onCloseOn()}))},i.prototype.toCloseOn=function(t,n,i){var r=null==i?void 0:i.closeOn;if(null==r)return n.closeOn(t);if(mt(r)){for(var e=Pu.NONE,u=0,s=r.length;u<s;++u)e|=Pu[r[u]];return e}return Ot(r)?Pu[r]:r},i.prototype.toAlign=function(t,n,i){var r=null==i?void 0:i.align;return null===r?null:void 0===r?n.getAlign(t):Ai(r,Bu)},Object.defineProperty(i.prototype,"mode",{get:function(){return this.Fr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"align",{get:function(){return this.Lt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"algin",{set:function(t){this.Lt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gesture",{get:function(){return this.lr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"layer",{get:function(){return this.bs},enumerable:!1,configurable:!0}),i.prototype.toGestureOptions=function(t,n,i){var r=null==i?void 0:i.gesture;return!0===r?{enable:!0,mode:n.getGestureMode(t)}:!1===r?{enable:!1,mode:n.getGestureMode(t)}:null!=r?(void 0===r.enable&&(r.enable=n.isGestureEnabled(t)),void 0===r.mode&&(r.mode=n.getGestureMode(t)),r):{enable:n.isGestureEnabled(t),mode:n.getGestureMode(t)}},i.prototype.onParentResize=function(t,i,r){if(this.isOpened()){var e=this.bs;if(null!=e){var u=this.lr;if(u.isDirty()){var s=this.position;u.constraint(this,e,s.x,s.y)}}}n.prototype.onParentResize.call(this,t,i,r)},i.prototype.getAnimation=function(){var t,n,i=this,r=this.Ti;return void 0===r&&((r=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.animation)&&void 0!==n?n:this.theme.newAnimation(this.Fr))&&(r.target=this,r.on("end",(function(t){i.onAnimationEnd(t)}))),this.Ti=r),r},i.prototype.onAnimationEnd=function(t){if(t)if(this.Fr===Gu.MODELESS)this.hide();else{var n=this.parent;n&&n.removeChild(this)}else{var i=st.getLayer(this);if(i){var r=i.getFocusController();this.Es=r.get(),r.focus(this.findFirstFocusable(r)||this)}}},i.prototype.findFirstFocusable=function(t){return t.find(this,!1,!0,!0)},i.prototype.open=function(t){var n=this,i=this.Ms;if(null==i){i=new Promise((function(t,i){n.Ss=t,n.Ts=i})),this.Ms=i,this.js=t;var r=null;switch(this.Fr){case Gu.MODAL:case Gu.MENU:(r=this.Ds.pick(this)).stage.addChild(this);break;case Gu.MODELESS:r=st.getLayer(this),this.show()}this.bs=r;var e=this.lr;if(e.mode===Fu.CLEAN&&e.toClean(),null!=r)if(e.isClean()){var u=r.renderer,s=this.ws;this.ps?u.on("prerender",s):u.once("prerender",s)}else{var h=this.position;e.constraint(this,r,h.x,h.y)}this.onOpen()}return i},i.prototype.onPrerender=function(){var n,r=this.bs;if(null!=r){var e=this.Lt,u=this.js;if(null!=e&&null!=u){var s=this.Fr,h=u.getBounds(!1,null!==(n=i.WORK_BOUNDS)&&void 0!==n?n:i.WORK_BOUNDS=new t.Rectangle),o=this.theme;_u.attach(this,h,o.getOffsetX(s),o.getOffsetY(s),r.width,r.height,e)}else this.position.set(.5*(r.width-this.width),.5*(r.height-this.height))}},i.prototype.onOpen=function(){this.emit("open",this);var t=this.getAnimation();t?t.start():this.Fr===Gu.MENU&&(this.visible=!0,this.onAnimationEnd(!1))},i.prototype.isOpened=function(){return null!=this.Ms},i.prototype.close=function(){this.doReject()},i.prototype.doResolve=function(t){var n=this.Ss;n&&(this.Ms=void 0,this.Ss=void 0,this.Ts=void 0,this.onClose(),n(t))},i.prototype.doReject=function(t){var n=this.Ts;n&&(this.Ms=void 0,this.Ss=void 0,this.Ts=void 0,this.onClose(),n(t))},i.prototype.onClose=function(){var t=this.bs,n=this.Es;if(null!=n)if(this.Es=null,t){var i=st.getLayer(n);null!=i&&t!==i&&i.view.focus(),t.getFocusController().focus(n)}else this.blur(!0);else this.blur(!0);t&&(t.renderer.off("prerender",this.ws),this.bs=null),this.js=null;var r=this.getAnimation();r?r.start(!0):(this.visible=!1,this.onAnimationEnd(!0)),this.emit("close",this)},i.prototype.onKeyDown=function(t){return this.Os&Pu.ESC&&nr.isCancelKey(t)&&this.onCloseOn(),n.prototype.onKeyDown.call(this,t)},i.prototype.onCloseOn=function(){this.close()},i.prototype.containsGlobalPoint=function(t){switch(this.Fr){case Gu.MODAL:case Gu.MENU:return!0;case Gu.MODELESS:return n.prototype.containsGlobalPoint.call(this,t)}},i.prototype.getType=function(){return"DDialog"},i}(hr),Xu={VERTICAL:0,HORIZONTAL:1},Ku=function(t){function n(n){var i=t.call(this,n)||this;return i.visible=!1,i}return _(n,t),n.prototype.getType=function(){return"DLayoutSpace"},n}(hr),Yu=function(t){return t instanceof hr&&(t.visible||t instanceof Ku)},Ju=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n);var i=this.theme;this.te=function(t,n){var i,r,e=null==n?void 0:n.margin;if(null!=e){if(pt(e))return{horizontal:e,vertical:e};var u=t.getMargin();return{horizontal:null!==(i=e.horizontal)&&void 0!==i?i:u,vertical:null!==(r=e.vertical)&&void 0!==r?r:u}}return{horizontal:u=t.getMargin(),vertical:u}}(i,n),this.rn=function(t,n){var i=null==n?void 0:n.direction;return null!=i?Ot(i)?Xu[i]:i:t.getDirection()}(i,n),this.Ns=function(t,n){var i=null==n?void 0:n.corner;if(null!=i&&!pt(i)){var r=i.adjust;if(null!=r)return r}return t.getCornerAdjust()}(i,n),this.Is=function(t,n){if(n){var i=n.row;if(null!=i)return i;var r=n.column;if(null!=r)return r}return t.getMultiplicity()}(i,n),this.ai=function(t,n){var i;return null!==(i=null==n?void 0:n.reverse)&&void 0!==i?i:t.getReverse()}(i,n)},Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"multiplicity",{get:function(){return this.Is},enumerable:!1,configurable:!0}),n.prototype.getWeightTotal=function(){for(var t=this.children,n=0,i=this.Is,r=this.ai,e=0,u=t.length;e<u;){for(var s=-1,h=0;h<i&&e+h<u;++h){var o=t[r?u-1-(e+h):e+h];if(Yu(o)){var a=o.getClearType();if(0!==h&&a&Ki.BEFORE)break;if(s=Math.max(s,o.weight),a&&Ki.AFTER){h+=1;break}}else e+=1,h-=1}e+=h,0<=s&&(n+=s)}return n},n.prototype.getSpaceLeft=function(t,n){var i=this.children,r=this.Is,e=this.ai;if(this.rn===Xu.VERTICAL){for(var u=t,s=0,h=0,o=i.length;h<o;){for(var a=0,c=-1,f=0;f<r&&h+f<o;++f){var l=i[e?o-1-(h+f):h+f];if(Yu(l)){var v=l.getClearType();if(0!==f&&v&Ki.BEFORE)break;if(a=(c=Math.max(c,l.weight))<0?Math.max(a,l.height+s):s,v&Ki.AFTER){f+=1;break}}else h+=1,f-=1}h+=f,u-=a,s=n}return Math.max(0,u)}for(u=t,s=0,h=0,o=i.length;h<o;){var b=0;for(c=-1,f=0;f<r&&h+f<o;++f)if(l=i[e?o-1-(h+f):h+f],Yu(l)){if(v=l.getClearType(),0!==f&&v&Ki.BEFORE)break;if(b=(c=Math.max(c,l.weight))<0?Math.max(b,l.width+s):s,v&Ki.AFTER){f+=1;break}}else h+=1,f-=1;h+=f,u-=b,s=n}return Math.max(0,u)},n.prototype.calcSpaceLeft=function(t,n,i,r){return t?0:this.getSpaceLeft(n-i,r)},n.prototype.onRefit=function(){var i=this.children,r=this.Qn,e=r.getTop(),u=r.getBottom(),s=r.getLeft(),h=r.getRight(),o=this.te,a=o.vertical,c=o.horizontal,f=this.getWeightTotal(),l=this.Is,v=this.ai,b=this.Wn,d=null;if(this.Ns){var g=4+(i.length<<1);(null==n.CORNER_ADJUST_WORK||n.CORNER_ADJUST_WORK.length<g)&&(n.CORNER_ADJUST_WORK=new Float32Array(g)),(d=n.CORNER_ADJUST_WORK)[0]=-2,d[1]=-2,d[g-2]=-3,d[g-1]=-3}if(this.rn===Xu.VERTICAL){var m=0,w=e-a;if(0<f){for(var p=1/f,O=this.calcSpaceLeft(b.height.isOn,this.height,e+u,a),D=0,E=i.length;D<E;){for(var M=s-c,S=0,T=0;T<l&&D+T<E;++T){var j=i[v?E-1-(D+T):D+T];if(Yu(j)){var N=j.getClearType();if(0!==T&&N&Ki.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.height=O*(U*p)),M+=c+j.width,S=Math.max(S,j.height),N&Ki.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1}w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],Yu(j)){var I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2;if(!((N=j.getClearType())&Ki.BEFORE)){var R=this.findRowIndexPrevious(H,C,d);this.hasClearTypeAfter(i,R)||(A=d[R])}var k=-2;if(!(N&Ki.AFTER)){var L=this.findRowIndexNext(H,C,d);this.hasClearTypeBefore(i,L)||(k=d[L])}var y=this.countColumn(H,C,d);j.corner.mask=this.toCornerMaskColumn(A,I,k,y)}}else{for(D=0,E=i.length;D<E;){for(M=s-c,S=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Yu(j)){if(N=j.getClearType(),0!==T&&N&Ki.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.height=0),M+=c+j.width,S=Math.max(S,j.height),N&Ki.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1;w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)j=i[v?E-1-D:D],Yu(j)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2,(N=j.getClearType())&Ki.BEFORE||(R=this.findRowIndexPrevious(H,C,d),this.hasClearTypeAfter(i,R)||(A=d[R])),k=-2,N&Ki.AFTER||(L=this.findRowIndexNext(H,C,d),this.hasClearTypeBefore(i,L)||(k=d[L])),y=this.countColumn(H,C,d),j.corner.mask=this.toCornerMaskColumn(A,I,k,y))}}else{var x=0;if(M=s-c,0<f){for(p=1/f,O=this.calcSpaceLeft(b.width.isOn,this.width,s+h,c),D=0,E=i.length;D<E;){w=e-a;var B=0;for(T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Yu(j)){if(N=j.getClearType(),0!==T&&N&Ki.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.width=O*(U*p)),B=Math.max(B,j.width),w+=a+j.height,N&Ki.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1;M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],Yu(j)){I=d[0+(H=2+(D<<1))],C=d[H+1];var _=-2;(N=j.getClearType())&Ki.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1]));var P=-2;N&Ki.AFTER||(L=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,L)||(P=d[L+1]));var F=this.countRow(H,I,d);j.corner.mask=this.toCornerMaskRow(_,C,P,F)}}else{for(D=0,E=i.length;D<E;){for(w=e-a,B=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Yu(j)){var U;if(N=j.getClearType(),0!==T&&N&Ki.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.width=0),B=Math.max(B,j.width),w+=a+j.height,N&Ki.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else{var G;null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1}M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D){var H;j=i[v?E-1-D:D],Yu(j)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],_=-2,(N=j.getClearType())&Ki.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1])),P=-2,N&Ki.AFTER||(L=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,L)||(P=d[L+1])),F=this.countRow(H,I,d),j.corner.mask=this.toCornerMaskRow(_,C,P,F))}}}t.prototype.onRefit.call(this)},n.prototype.hasClearTypeBefore=function(t,n){return this.hasClearType(t,n,Ki.BEFORE)},n.prototype.hasClearTypeAfter=function(t,n){return this.hasClearType(t,n,Ki.AFTER)},n.prototype.hasClearType=function(t,n,i){if(2<=n){var r=n-2>>1;if(0<=r&&r<t.length){var e=t[r];if(e instanceof hr)return!!(e.getClearType()&i)}}return!1},n.prototype.findColumnIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r]!==n)return r;return 0},n.prototype.findColumnIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s]!==u)return s-2;return r}}return i.length-2},n.prototype.countRow=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r]!==n)return i[r-2+1]+1;return 0},n.prototype.findRowIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r+1]!==n)return r;return 0},n.prototype.findRowIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r+1];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s+1]!==u)return s-2;return r}}return i.length-2},n.prototype.countColumn=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r+1]!==n)return i[r-2+0]+1;return 0},n.prototype.toCornerMaskColumn=function(t,n,i,r){var e=ki.NONE;return t+1<n&&0===n&&(e|=ki.TOP_LEFT),i+1<n&&0===n&&(e|=ki.BOTTOM_LEFT),t<n&&n+1===r&&(e|=ki.TOP_RIGHT),i<n&&n+1===r&&(e|=ki.BOTTOM_RIGHT),ki.ALL&~e},n.prototype.toCornerMaskRow=function(t,n,i,r){var e=ki.NONE;return t+1<n&&0===n&&(e|=ki.TOP_LEFT),i+1<n&&0===n&&(e|=ki.TOP_RIGHT),t<n&&n+1===r&&(e|=ki.BOTTOM_LEFT),i<n&&n+1===r&&(e|=ki.BOTTOM_RIGHT),ki.ALL&~e},n.prototype.addSpace=function(t){return this.addChild(new Ku(t))},n.prototype.getType=function(){return"DLayout"},n.CORNER_ADJUST_WORK=null,n}(hr),Zu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutVertical"},n}(Ju),qu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredContent"},n}(Zu),Qu={CLICKED:0,DOUBLE_CLICKED:1},$u=function(){function t(t){this.cn=t}return t.prototype.getImageAlignHorizontal=function(){return this.cn.getSecondaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.cn.getSecondaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.cn.getSecondaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.cn.getSecondaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.cn.getSecondaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.cn.getSecondaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.cn.getSecondaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.cn.getSecondaryImageSource(t)},t}(),ts=function(){function t(t){this.cn=t}return t.prototype.getImageAlignHorizontal=function(){return this.cn.getTertiaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.cn.getTertiaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.cn.getTertiaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.cn.getTertiaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.cn.getTertiaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.cn.getTertiaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.cn.getTertiaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.cn.getTertiaryImageSource(t)},t}(),ns={LEFT:0,CENTER:1,RIGHT:2},is={TOP:0,MIDDLE:1,BOTTOM:2},rs={TEXT:0,PADDING:1,BORDER:2},es=function(){function n(n,i,r,e){var u=this;this.p=n,this.cn=i,this.Cs=r,this.Tt=null,this.Lt=function(t,n){var i,r,e,u=null==n?void 0:n.align;return{with:Ai(null!==(i=null==u?void 0:u.with)&&void 0!==i?i:t.getImageAlignWith(),rs),vertical:Ai(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getImageAlignVertical(),is),horizontal:Ai(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getImageAlignHorizontal(),ns)}}(i,e),this.te=function(t,n){var i,r,e=null==n?void 0:n.margin;return{vertical:null!==(i=null==e?void 0:e.vertical)&&void 0!==i?i:t.getImageMarginVertial(),horizontal:null!==(r=null==e?void 0:e.horizontal)&&void 0!==r?r:t.getImageMarginHorizontal()}}(i,e),this.As=null==e?void 0:e.tint,this.Rs=new t.Rectangle,this.ks=null==e?void 0:e.source,this.Ls=null,this.ys=function(){u.onUpdate()}}return Object.defineProperty(n.prototype,"image",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"align",{get:function(){return this.Lt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bound",{get:function(){return this.Rs},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"source",{get:function(){return this.ks},set:function(t){this.ks!==t&&(this.ks=t,this.onUpdate())},enumerable:!1,configurable:!0}),n.prototype.computeSource=function(){var t=this.ks;if(void 0!==t){if(!wt(t))return t;var n=t(this.p.state);if(void 0!==n)return n}return this.cn.getImageSource(this.p.state)},n.prototype.onStateChange=function(t,n){this.updateTint()},n.prototype.updateBound=function(){var t=this.Rs,n=this.Tt;if(null!=n){n.updateTransform(),n.getLocalBounds(t);var i=t.left,r=t.top,e=t.right,u=t.bottom,s=n.localTransform,h=s.a,o=s.b,a=s.c,c=s.d,f=h*i+a*r,l=o*i+c*r,v=h*e+a*r,b=o*e+c*r,d=h*e+a*u,g=o*e+c*u,m=h*i+a*u,w=o*i+c*u,p=Math.min(f,v,d,m),O=Math.max(f,v,d,m),D=Math.min(l,b,g,w),E=Math.max(l,b,g,w);t.x=p+s.tx,t.y=D+s.ty,t.width=O-p,t.height=E-D}else t.x=0,t.y=0,t.width=0,t.height=0},n.prototype.isTintAware=function(t){return null!=t&&"tint"in t},n.prototype.toTintColor=function(t,n){var i=this.As;if(i){var r=i.color;if(void 0!==r){if(!wt(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintColor(n)},n.prototype.toTintAlpha=function(t,n){var i=this.As;if(i){var r=i.alpha;if(void 0!==r){if(!wt(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintAlpha(n)},n.prototype.updateTint=function(){var t=this.Tt;if(t&&this.isTintAware(t)){var n=this.cn,i=this.p.state,r=this.toTintColor(n,i);if(null!=r){var e=!1;t.tint!==r&&(t.tint=r,e=!0);var u=this.toTintAlpha(n,i);return t.alpha!==u&&(t.alpha=u,e=!0),e}}return!1},n.prototype.updateSource=function(){var n=this.computeSource(),i=this.Ls;if(n!==i){this.Ls=n;var r,e=this.p,u=this.Tt,s=this.ys;if(n instanceof t.Texture)if(i instanceof t.Texture)i.off("update",s),u instanceof t.Sprite&&(u.texture=n,n.on("update",s));else{null!=u&&e.removeChild(u);var h=new t.Sprite(n);(r=e.getOverflowMask())&&(h.mask=r),n.on("update",s),e.addChild(h),this.Tt=h}else i instanceof t.Texture?(i.off("update",s),null!=u&&(e.removeChild(u),u.destroy())):null!=u&&e.removeChild(u),null!=n&&((r=e.getOverflowMask())&&(n.mask=r),e.addChild(n)),this.Tt=n;return!0}return!1},n.prototype.isRefitable=function(t){return null!=t&&t===this.Tt},n.prototype.destroy=function(){var n=this.Tt;if(n){this.Tt=null;var i=this.Ls;i instanceof t.Texture&&(i.off("update",this.ys,this),n.destroy())}},n.prototype.onUpdate=function(){this.p.toDirty(),st.update(this.p)},n}(),us=function(){function t(){this.xs=[],this.j=0,this.te=0}return t.prototype.clear=function(){this.xs.length=0,this.j=0,this.te=0,this.Bs=void 0},t.prototype.add=function(t,n,i){this.xs.push(t),this.j+=i+n,this.te=i},t.prototype.set=function(t){this.Bs=t},Object.defineProperty(t.prototype,"size",{get:function(){return this.j-(null===this.Bs?this.te:0)},enumerable:!1,configurable:!0}),t}(),ss=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t,n){var i=this.xs,r=n-t;if(void 0!==this.Bs)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.height,h.image.y=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.height,h.image.y=r}},n}(us),hs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.add=function(t,n,i){this.xs.push(t),this.j=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.xs,u=0,s=e.length;u<s;++u){var h=e[u];h.image.x=r-.5*h.bound.width}},n}(us),os=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t){var n=this.xs,i=t;if(void 0!==this.Bs)for(var r=0,e=n.length;r<e;++r)(u=n[r]).image.x=i,i+=u.bound.width+u.margin.horizontal;else for(r=0,e=n.length;r<e;++r){var u;i+=(u=n[r]).margin.horizontal,u.image.x=i,i+=u.bound.width}},n}(us),as=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.add=function(t,n,i){this.xs.push(t),this.j=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.xs,u=0,s=e.length;u<s;++u){var h=e[u];h.image.y=r-.5*h.bound.height}},n}(us),cs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t,n){var i=this.xs,r=n-t;if(void 0!==this.Bs)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.width,h.image.x=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.width,h.image.x=r}},n}(us),fs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t){var n=this.xs,i=t;if(void 0!==this.Bs)for(var r=0,e=0,u=n.length;e<u;++e)(s=n[e]).image.y=r+i,i+=s.bound.height,r=s.margin.vertical;else for(e=0,u=n.length;e<u;++e){var s;i+=(s=n[e]).margin.vertical,s.image.y=i,i+=s.bound.height}},n}(us),ls=function(){function t(){this.left=new os,this.center=new hs,this.right=new cs,this.top=new fs,this.middle=new as,this.bottom=new ss}return t.prototype.clear=function(){this.left.clear(),this.center.clear(),this.right.clear(),this.top.clear(),this.middle.clear(),this.bottom.clear(),this.text=void 0},t.prototype.add=function(t){if(null!=t.image){var n=t.bound,i=n.width,r=n.height,e=t.margin,u=e.horizontal,s=e.vertical,h=t.align;switch(h.horizontal){case ns.LEFT:this.left.add(t,i,u);break;case ns.CENTER:this.center.add(t,i,u);break;case ns.RIGHT:this.right.add(t,i,u)}switch(h.vertical){case is.TOP:this.top.add(t,r,s);break;case is.MIDDLE:this.middle.add(t,r,s);break;case is.BOTTOM:this.bottom.add(t,r,s)}}},t.prototype.set=function(t){this.left.set(t),this.center.set(t),this.right.set(t),this.top.set(t),this.middle.set(t),this.bottom.set(t),this.text=t},Object.defineProperty(t.prototype,"width",{get:function(){var t=this.text,n=this.left.size,i=this.center.size,r=this.right.size;return void 0!==t?null!==t?Math.max(n+t.width+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var t=this.text,n=this.top.size,i=this.middle.size,r=this.bottom.size;return void 0!==t?null!==t?Math.max(n+t.height+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,n,i,r,e,u,s){var h=this.left,o=this.center,a=this.right,c=this.top,f=this.middle,l=this.bottom,v=this.text;if(void 0!==v){var b=h.size,d=a.size,g=c.size,m=l.size,w=0,p=0,O=0;switch(null!=v&&(p=v.width,O=v.height),e.horizontal){case ns.LEFT:w=t+b;break;case ns.CENTER:w=t+.5*(u-t-i-(b+p+d))+b;break;case ns.RIGHT:w=u-i-d-p}var D=0;switch(e.vertical){case is.TOP:D=n+g;break;case is.MIDDLE:D=n+.5*(s-n-r-(g+O+m))+g;break;case is.BOTTOM:D=s-r-m-O}null!=v&&(v.position.set(w,D),v.setClippingDelta(b+d,g+m)),h.execute(w-b),o.execute(0,0,2*w+p),a.execute(0,w+p+d),c.execute(D-g),f.execute(0,0,2*D+O),l.execute(0,D+O+m)}else h.execute(t),o.execute(t,i,u),a.execute(i,u),c.execute(n),f.execute(n,r,s),l.execute(r,s)},t}(),vs=function(){function t(){this.text=new ls,this.padding=new ls,this.border=new ls}return t.prototype.clear=function(){this.text.clear(),this.padding.clear(),this.border.clear()},t.prototype.add=function(t){if(t.image)switch(t.align.with){case rs.TEXT:this.text.add(t);break;case rs.PADDING:this.padding.add(t);break;case rs.BORDER:this.border.add(t)}},t.prototype.set=function(t){this.text.set(t)},t.prototype.execute=function(t,n,i,r){var e=t.getLeft(),u=t.getTop(),s=t.getRight(),h=t.getBottom();null==i&&(i=e+this.width+s),null==r&&(r=u+this.height+h),this.border.execute(0,0,0,0,n,i,r),this.padding.execute(e,u,s,h,n,i,r),this.text.execute(e,u,s,h,n,i,r)},Object.defineProperty(t.prototype,"width",{get:function(){return Math.max(this.border.width,this.padding.width,this.text.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return Math.max(this.border.height,this.padding.height,this.text.height)},enumerable:!1,configurable:!0}),t}(),bs=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){this.clear(),this.beginFill(16777215,1),this.drawRect(0,0,n,i),this.endFill()},n}(t.Graphics),ds=function(){function t(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r}return t.prototype.set=function(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r},t}(),gs=function(){function t(){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.characters=[],this.scale=1,this.scaled=!1,this.clipped=!1,this.x=0,this.y=0}return t.prototype.start=function(t,n){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.scale=1,this.scaled=!1,this.clipped=!1,this.x=0,this.y=.5*(t-n)},t.prototype.isPushable=function(t,n){return!(t<this.x+n.advance&&!(n.type&Me.SPACE))},t.prototype.isPushableAtNewLine=function(t,n,i){return this.y+1.5*n+.5*i<=t},t.prototype.push=function(t,n){var i=this.x;this.x+=t.advance;var r=this.y,e=this.count,u=this.characters;e<u.length?u[e].set(i,r,t,n):u.push(new ds(i,r,t,n)),this.count+=1,this.countPerLine+=1},t.prototype.newLine=function(t){this.width=Math.max(this.width,this.x),this.x=0,this.y+=t,this.countPerLine=0},t.prototype.wordWrap=function(t){var n=this.countPerLine,i=this.characters;if(0<n){for(var r=this.count,e=r-1,u=r-n;u<e;--e){var s=i[e];if(s.wrappable){var h=s.character.advance,o=s.y+t;s.x=0,s.y=o;for(var a=e+1;a<r;++a)(s=i[a]).x=h,s.y=o,h+=s.character.advance;return this.x=h,this.y=o,this.countPerLine=r-e,!0}}var c=i[r-1];return c.x=0,c.y=c.y+t,this.x=c.character.advance,this.y=c.y,this.countPerLine=1,!1}return!1},t.prototype.pop=function(){var t=this.countPerLine,n=this.characters;if(0<t){var i=n[this.count-1];return this.x-=i.character.advance,this.count-=1,this.countPerLine-=1,!0}return!1},t.prototype.fit=function(t,n){var i=this.width,r=this.height;1e-4<i&&t<i?1e-4<r&&n<r?(this.scale=Math.min(t/i,n/r),this.scaled=!0):(this.scale=t/i,this.scaled=!0):1e-4<r&&n<r&&(this.scale=n/r,this.scaled=!0)},t.prototype.end=function(t,n){this.newLine(t),this.y-=.5*(t-n),this.height=this.y},t}(),ms={NONE:0,NORMAL:1,BREAK_ALL:2},ws="\n",ps=function(){function t(){}return t.measure=function(n,i,r){var e=t.RESULT||new gs;if(t.RESULT=e,null!=i){var u=b.from(n),s=i.font.height,h=r.lineHeight,o=r.fitting,a=!o&&r.clipping,c=r.width,f=r.height,l=!o&&r.wordWrap;switch(e.start(h,s),l){case ms.BREAK_ALL:a?this.measure1(u,c,f,s,h,i,e):this.measure2(u,c,h,i,e);break;case ms.NORMAL:var v=this.newLineBreaker(n);v?a?this.measure1a(v,u,c,f,s,h,i,e):this.measure2a(v,u,c,h,i,e):a?this.measure1b(u,c,f,s,h,i,e):this.measure2b(u,c,h,i,e);break;default:a?this.measure3(u,c,h,i,e):this.measure4(u,h,i,e)}e.end(h,s),o&&e.fit(c,f)}else e.start(0,0),e.end(0,0);return e},t.measure1a=function(t,n,i,r,e,u,s,h){for(var o=t.next();n.hasNext();){var a=n.position,c=n.next();if(c===ws)h.newLine(u);else{var f=s.get(c);if(null==f)continue;o=this.advance(a,o,t);var l=this.isWrappable1(a,o);h.isPushable(i,f)?h.push(f,l):h.isPushableAtNewLine(r,u,e)?(h.push(f,l),h.wordWrap(u)):this.measure5(n,i,u,s,h,!0)}}},t.measure1b=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===ws)s.newLine(e);else{var o=u.get(h);if(null==o)continue;var a=this.isWrappable2(s,o);s.isPushable(n,o)?s.push(o,a):s.isPushableAtNewLine(i,e,r)?(s.push(o,a),s.wordWrap(e)):this.measure5(t,n,e,u,s,!0)}}},t.measure1=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===ws)s.newLine(e);else{var o=u.get(h);if(null==o)continue;s.isPushable(n,o)?s.push(o,!0):s.isPushableAtNewLine(i,e,r)?(s.newLine(e),s.push(o,!0)):this.measure5(t,n,e,u,s,!0)}}},t.measure2a=function(t,n,i,r,e,u){for(var s=t.next();n.hasNext();){var h=n.position,o=n.next();if(o===ws)u.newLine(r);else{var a=e.get(o);if(null==a)continue;s=this.advance(h,s,t);var c=this.isWrappable1(h,s);u.isPushable(i,a)?u.push(a,c):(u.push(a,c),u.wordWrap(r))}}},t.measure2b=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===ws)e.newLine(i);else{var s=r.get(u);if(null==s)continue;var h=this.isWrappable2(e,s);e.isPushable(n,s)?e.push(s,h):(e.push(s,h),e.wordWrap(i))}}},t.measure2=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===ws)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)||e.newLine(i),e.push(s,!1)}}},t.measure3=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===ws)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)?e.push(s,!1):this.measure5(t,n,i,r,e,!1)}}},t.measure4=function(t,n,i,r){for(;t.hasNext();){var e=t.next();if(e===ws)r.newLine(n);else{var u=i.get(e);if(null==u)continue;r.push(u,!1)}}},t.measure5=function(t,n,i,r,e,u){e.clipped=!0;var s=r.get("...");if(null!=s){for(;!e.isPushable(n,s)&&e.pop(););e.isPushable(n,s)&&e.push(s,!1)}if(u)t.close();else for(;t.hasNext();)if(t.next()===ws){e.newLine(i);break}},t.isWrappable2=function(t,n){if(t.countPerLine<=0)return!1;var i=t.characters[t.count-1].character.type,r=n.type;return i&Me.SPACE?!(r&Me.SPACE||i&Me.NON_BREAKING):!(r&Me.SPACE||i&Me.NON_BREAKING&&r&Me.NON_BREAKING)},t.advance=function(t,n,i){return n.done||t<=n.value.end?n:n=i.next()},t.isWrappable1=function(t,n){if(n.done)return!1;var i=n.value;return i.start===t||i.end===t},t.newLineBreaker=function(t){return"css-line-break"in window?window["css-line-break"].LineBreaker(t,{lineBreak:"strict",wordBreak:"normal"}):null},t.RESULT=null,t}(),Os=function(t){function n(){var n=t.call(this,new Float32Array(64),new Float32Array(64),new Uint16Array(48))||this;return n.width=0,n.height=0,n.scale=1,n.scaled=!1,n.clipped=!1,n}return _(n,t),n.prototype.update=function(t,n,i){var r=this.getBuffer("aVertexPosition"),e=this.getBuffer("aTextureCoord"),u=this.getIndex(),s=ps.measure(t,n,i),h=Math.ceil(s.count/8)<<3,o=h<<3;r.data.length<o&&(r.data=new Float32Array(o),e.data=new Float32Array(o));var a=6*h;u.data.length<a&&(u.data=new Uint16Array(a));var c=r.data,f=e.data,l=u.data;if(null!=n){for(var v=s.count,b=s.characters,d=s.scale,g=0;g<v;++g){var m=b[g],w=m.x,p=m.y,O=m.character,D=n.width,E=n.height;this.writeCharacter(c,f,l,g,w,p,d,O,D,E)}g=v;for(var M=c.length>>3;g<M;++g)this.writeCharacterEmpty(c,f,l,g);this.width=s.width*d,this.height=s.height*d,this.scale=d,this.scaled=s.scaled,this.clipped=s.clipped}else{for(g=0,M=c.length>>3;g<M;++g)this.writeCharacterEmpty(c,f,l,g);this.width=0,this.height=0,this.scale=1,this.scaled=!1,this.clipped=!1}r.update(),e.update(),u.update()},n.prototype.writeCharacter=function(t,n,i,r,e,u,s,h,o,a){var c=h.x,f=h.y,l=h.width,v=h.height,b=(e+(c-h.origin.x))*s,d=u*s,g=b+l*s,m=d+v*s,w=r<<3;t[w+0]=b,t[w+1]=d,t[w+2]=g,t[w+3]=d,t[w+4]=g,t[w+5]=m,t[w+6]=b,t[w+7]=m;var p=c/o,O=f/a,D=(c+l)/o,E=(f+v)/a;n[w+0]=p,n[w+1]=O,n[w+2]=D,n[w+3]=O,n[w+4]=D,n[w+5]=E,n[w+6]=p,n[w+7]=E;var M=6*r,S=r<<2;i[M+0]=S+0,i[M+1]=S+1,i[M+2]=S+3,i[M+3]=S+1,i[M+4]=S+2,i[M+5]=S+3},n.prototype.writeCharacterEmpty=function(t,n,i,r){var e=r<<3;t[e+0]=0,t[e+1]=0,t[e+2]=0,t[e+3]=0,t[e+4]=0,t[e+5]=0,t[e+6]=0,t[e+7]=0,n[e+0]=0,n[e+1]=0,n[e+2]=0,n[e+3]=0,n[e+4]=0,n[e+5]=0,n[e+6]=0,n[e+7]=0;var u=6*r,s=r<<2;i[u+0]=s+0,i[u+1]=s+1,i[u+2]=s+3,i[u+3]=s+1,i[u+4]=s+2,i[u+5]=s+3},n}(t.MeshGeometry),Ds=function(){function t(t,n){var i,r,e,u,s,h,o,a,c,f,l;this.R=0,this._s=-1;var v=this.getDefaultOptions();t?(this.Lt=null!==(i=t.align)&&void 0!==i?i:v.align,this.Ps=null!==(r=t.fontFamily)&&void 0!==r?r:v.fontFamily,this.Fs=null!==(e=t.fontSize)&&void 0!==e?e:v.fontSize,this.Us=null!==(u=t.fontStyle)&&void 0!==u?u:v.fontStyle,this.Gs=null!==(s=t.fontVariant)&&void 0!==s?s:v.fontVariant,this.Hs=null!==(h=t.fontWeight)&&void 0!==h?h:v.fontWeight,this.C=null!==(o=t.fill)&&void 0!==o?o:v.fill,this.en=null!==(a=t.clipping)&&void 0!==a?a:v.clipping,this.un=null!==(c=t.fitting)&&void 0!==c?c:v.fitting,this.zs=Ai(null!==(f=t.wordWrap)&&void 0!==f?f:v.wordWrap,ms),this.Vs=null!==(l=t.lineHeight)&&void 0!==l?l:v.lineHeight):(this.Lt=v.align,this.Ps=v.fontFamily,this.Fs=v.fontSize,this.Us=v.fontStyle,this.Gs=v.fontVariant,this.Hs=v.fontWeight,this.C=v.fill,this.en=v.clipping,this.un=v.fitting,this.zs=Ai(v.wordWrap,ms),this.Vs=v.lineHeight),this.Ws=this.Fs,this.Xs=this.Vs,this.Ks=!1,this.Ys=this.Fs,this.Js=-1,this.Zs="",this.qs="",this.Qs=0,this.ut=n}return t.prototype.getDefaultOptions=function(){var n=t.DEFAULT_OPTIONS;return null==n&&(n=this.newDefaultOptions(),t.DEFAULT_OPTIONS=n),n},t.prototype.newDefaultOptions=function(){var t=Z.getInstance().get("DBase");return{align:"left",fontFamily:t.getFontFamilly(),fontSize:t.getFontSize(),fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fill:t.getColor(new Dt),clipping:!0,fitting:!1,wordWrap:ms.NONE,lineHeight:t.getLineHeight()}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idApproved",{get:function(){return this._s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontId",{get:function(){return this.update(),this.Zs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdFontSize",{get:function(){return this.update(),this.Ws},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdApproved",{get:function(){return this.qs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this.C},set:function(t){this.C!==t&&(this.C=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){this.R+=1,this.ut()},Object.defineProperty(t.prototype,"fillApproved",{get:function(){return this.Qs},enumerable:!1,configurable:!0}),t.prototype.approve=function(){this.update(),this._s=this.R,this.qs=this.Zs,this.Qs=this.C},Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this.Ps},set:function(t){this.Ps!==t&&(this.Ps=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.Fs},set:function(t){this.Fs!==t&&(this.Fs=t,this.Ws=t,this.Xs=this.Vs,this.Ks=!1,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSizeFitted",{get:function(){return this.Ws},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFontFitted",{get:function(){return this.Ks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this.Us},set:function(t){this.Us!==t&&(this.Us=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this.Gs},set:function(t){this.Gs!==t&&(this.Gs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this.Hs},set:function(t){this.Hs!==t&&(this.Hs=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.update=function(){if(this.Js!==this.R){this.Js=this.R;var t=this.un?this.Ws:this.Fs;this.Ys=t,this.Zs=this.toFontId(t)}},t.prototype.toFontId=function(t){return"".concat(this.Us," ").concat(this.Gs," ").concat(this.Hs," ").concat(t,"px ").concat(this.Ps)},Object.defineProperty(t.prototype,"clipping",{get:function(){return this.en},set:function(t){this.en!==t&&(this.en=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fitting",{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this.zs},set:function(t){this.zs!==t&&(this.zs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.Vs},set:function(t){this.Vs!==t&&(this.Vs=t,this.Ws=this.Fs,this.Xs=t,this.Ks=!1,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeightFitted",{get:function(){return this.Xs},set:function(t){this.Xs!==t&&(this.Xs=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n){var i=!1;return t<this.Ws&&(this.Ws=t,i=!0),this.Xs!==n&&(this.Xs=n,i=!0),!0!==this.Ks&&(this.Ks=!0,i=!0),i&&this.onChange(),i},t.prototype.unfit=function(){var t=!1;return!1!==this.Ks&&(this.Ks=!1,t=!0),this.Ws!==this.Fs&&(this.Ws=this.Fs,t=!0),this.Xs!==this.Vs&&(this.Xs=this.Vs,t=!0),t&&this.onChange(),t},t}(),Es=function(){function t(){}return t.measure=function(t){var n=this.$s;null==n&&(n=new Map,this.$s=n);var i=n.get(t);if(null!=i)return i;this.setup(t);var r=this.th.getBoundingClientRect().top,e=this.nh.getBoundingClientRect();return i={ascent:r-e.top,descent:e.bottom-r},n.set(t,i),i},t.toSize=function(t){return this.setup(t),parseFloat(window.getComputedStyle(this.nh).fontSize)},t.setup=function(t){var n=this.nh;null==n&&((n=document.createElement("span")).innerText="|ÉqÅ",n.style.border="none",n.style.margin="0px",this.nh=n);var i=this.th;null==i&&((i=document.createElement("div")).style.display="inline-block",i.style.width="0px",i.style.height="0px",i.style.border="none",i.style.margin="0px",i.style.verticalAlign="baseline",this.th=i);var r=this.ih;null==r&&((r=document.createElement("div")).style.position="absolute",r.style.padding="0px",r.style.margin="0px",r.style.visibility="hidden",r.appendChild(n),r.appendChild(i),document.body.appendChild(r),this.ih=r),n.style.font=t},t}(),Ms=function(n){function i(i,r){var e=n.call(this,new Os,new t.MeshMaterial(t.Texture.EMPTY))||this;return e.B=new Ds(r,(function(){e.En=!0,e.rh=!0,e.mu=null,e.eh()})),e.Bs=i,e.uh="",e.En=!0,e.rh=!0,e.mu=null,e.sh=0,e.kt=0,e.pn=0,e.Ni={clipping:!1,fitting:!1,wordWrap:ms.NONE,width:0,height:0,lineHeight:0,delta:{width:0,height:0}},e.eh(),e}return _(i,n),i.prototype.eh=function(){var t=st.getLayer(this);if(t){var n=this.B;if(this.En){this.En=!1;var i=this.Bs,r=this.uh;this.uh=i;var e=n.fontId,u=n.fontIdApproved,s=n.fontIdFontSize,h=n.fill,o=n.fillApproved;n.approve();var a=t.getDynamicFontAtlases();i===r&&e===u&&h===o||(a.add(e,s,h,i),a.remove(u,o,r))}}},Object.defineProperty(i.prototype,"text",{get:function(){return this.Bs},set:function(t){this.Bs!==t&&(this.Bs=t,this.B.unfit()||(this.En=!0,this.rh=!0,this.eh()))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this.update(),Math.abs(this.scale.x)*this.geometry.width},set:function(t){this.update();var n=this.geometry.width;if(1e-4<n){var i=t/n;this.scale.x=0<=this.scale.x?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.update(),Math.abs(this.scale.y)*this.geometry.height},set:function(t){this.update();var n=this.geometry.height;if(1e-4<n){var i=t/n;this.scale.y=0<=this.scale.y?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clipped",{get:function(){return this.geometry.clipped},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"style",{get:function(){return this.B},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this;this.eh();var n=this.B,i=this.mu;if(null==i){var r=st.getLayer(this);r&&null!=(i=r.getDynamicFontAtlases().get(n.fontId,n.fill))&&(this.sh=i.getRevisionUpdate(),this.mu=i,this.texture=i.texture,this.rh=!0)}else{var e=i.getRevisionUpdate();e!==this.sh&&(this.sh=e,this.rh=!0)}var u=this.Ni;if(this.updateClipping(n,u)&&(this.rh=!0),this.rh){this.rh=!1;var s=this.geometry;if(s.update(this.Bs,i,u),u.fitting&&!n.isFontFitted&&s.scaled){var h=s.scale,o=n.fontSize,a=n.toFontId(Math.ceil(o*h*1e3)/1e3),c=Es.toSize(a),f=c/o,l=n.lineHeight*f;n.fit(c,l)&&setTimeout((function(){st.update(t)}),0)}}},i.prototype.updateClipping=function(t,n){var i=!1,r=t.clipping;n.clipping!==r&&(n.clipping=r,i=!0);var e=t.fitting;n.fitting!==e&&(n.fitting=e,i=!0);var u=t.wordWrap;n.wordWrap!==u&&(n.wordWrap=u,i=!0);var s=e?t.lineHeightFitted:t.lineHeight;if(n.lineHeight!==s&&(n.lineHeight=s,i=!0),r||e||u){var h=this.parent;if(h instanceof hr){var o=h.width-h.padding.getLeft()-h.padding.getRight()-n.delta.width;n.width!==o&&(n.width=o,i=!0);var a=h.height-h.padding.getTop()-h.padding.getBottom()-n.delta.height;n.height!==a&&(n.height=a,i=!0)}}return i},i.prototype.setClippingDelta=function(t,n){var i=this.Ni.delta;i.width=t,i.height=n},i.prototype._calculateBounds=function(){this.update(),n.prototype._calculateBounds.call(this)},i.prototype._render=function(t){this.update(),n.prototype._render.call(this,t)},i}(t.Mesh),Ss=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u;t.prototype.init.call(this,n);var s=this.theme;this.hh=null!==(r=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.value)&&void 0!==r?r:s.newTextValue(),this.oh=this.computeTextValue();var h=null==n?void 0:n.text;this.ah=null==h?void 0:h.color,this.fh=null==h?void 0:h.alpha,this.lh=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v,b=null===(r=null==n?void 0:n.text)||void 0===r?void 0:r.style;return null!=b?{fill:null!==(e=b.fill)&&void 0!==e?e:t.getColor(i),fontSize:null!==(u=b.fontSize)&&void 0!==u?u:t.getFontSize(),fontFamily:null!==(s=b.fontFamily)&&void 0!==s?s:t.getFontFamilly(),fontWeight:null!==(h=b.fontWeight)&&void 0!==h?h:t.getFontWeight(),fontStyle:null!==(o=b.fontStyle)&&void 0!==o?o:t.getFontStyle(),fontVariant:null!==(a=b.fontVariant)&&void 0!==a?a:t.getFontVariant(),clipping:null!==(c=b.clipping)&&void 0!==c?c:t.getTextStyleClipping(),fitting:null!==(f=b.fitting)&&void 0!==f?f:t.getTextStyleFitting(),wordWrap:null!==(l=b.wordWrap)&&void 0!==l?l:t.getTextStyleWordWrap(),lineHeight:null!==(v=b.lineHeight)&&void 0!==v?v:t.getLineHeight()}:{fill:t.getColor(i),fontSize:t.getFontSize(),fontFamily:t.getFontFamilly(),fontWeight:t.getFontWeight(),fontStyle:t.getFontStyle(),fontVariant:t.getFontVariant(),clipping:t.getTextStyleClipping(),fitting:t.getTextStyleFitting(),wordWrap:t.getTextStyleWordWrap(),lineHeight:t.getLineHeight()}}(s,n,this.state),this.Cs=function(t,n){var i,r,e,u=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.align;return{vertical:Ai(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getTextAlignVertical(),is),horizontal:Ai(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getTextAlignHorizontal(),ns)}}(s,n),this.bh=null!==(e=null==h?void 0:h.formatter)&&void 0!==e?e:s.getTextFormatter(),this.dh=!0,this.gh=null!==(u=null==n?void 0:n.mask)&&void 0!==u?u:s.isOverflowMaskEnabled(),this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"text",{get:function(){return this.hh},set:function(t){this.hh!==t&&(this.hh=t,this.updateTextValue())},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){},n.prototype.computeTextValue=function(){var t=this.hh;if(void 0!==t){if(!wt(t))return t;var n=t(this.state);if(void 0!==n)return n}return this.theme.getTextValue(this.state)},n.prototype.createOrUpdateText=function(){var t=this.oh;if(void 0!==t){var n=this.bh(t,this),i=this.Bs;if(null==i){if(0<n.length){var r=this.createText(n);r.visible=this.dh,this.Bs=r,this.addChild(r),this.updateTextPosition(r);var e=this.getOverflowMask();e&&(r.mask=e),this.toDirty(),st.update(this)}}else i.text=n,this.toDirty(),st.update(this)}},n.prototype.createText=function(t){return new Ms(t,this.lh)},n.prototype.getOverflowMask=function(){return this.gh?(null==this.dr&&(this.dr=new bs(this),this.Zn.add(this.dr),this.toDirty()),this.dr):null},n.prototype.updateTextPosition=function(t){var n=this.Cs,i=this.Qn,r=this.Wn,e=0,u=i.getLeft(),s=n.horizontal;if(r.width.isOn||s===ns.LEFT)e=u;else{var h=this.width,o=t.width,a=i.getRight();e=s===ns.CENTER?u+.5*(h-u-a-o):h-o-a}var c=0,f=i.getTop(),l=n.vertical;if(r.height.isOn||l===is.TOP)c=f;else{var v=this.height,b=t.height,d=i.getBottom();c=l===is.MIDDLE?f+.5*(v-f-d-b):v-b-d}t.position.set(e,c)},n.prototype.getTextColor=function(t,n){var i=this.ah;if(void 0!==i){if(!wt(i))return i;var r=i(n);if(void 0!==r)return r}return t.getColor(n)},n.prototype.getTextAlpha=function(t,n){var i=this.fh;if(void 0!==i){if(!wt(i))return i;var r=i(n);if(void 0!==r)return r}return t.getAlpha(n)},n.prototype.updateTextColor=function(t){var n=this.theme,i=this.state;t.style.fill=this.getTextColor(n,i),t.alpha=this.getTextAlpha(n,i)},n.prototype.updateTextValue=function(){var t=this.computeTextValue();this.oh!==t&&(this.oh=t,this.onTextChange(),this.createOrUpdateText())},n.prototype.updateText=function(){var t=this.Bs;t&&(this.updateTextValue(),this.updateTextPosition(t),this.updateTextColor(t))},n.prototype.showText=function(){var t=this.Bs;t&&(t.visible=!0),this.dh=!0},n.prototype.hideText=function(){var t=this.Bs;t&&(t.visible=!1),this.dh=!1},n.prototype.onReflow=function(){t.prototype.onReflow.call(this),this.updateText()},n.prototype.isRefitable=function(n){return t.prototype.isRefitable.call(this,n)||null!=n&&n===this.Bs},n.prototype.applyTitle=function(){var n=this.Bs;if(this.$n.length<=0&&n&&"clipped"in n&&n.clipped){var i=st.getLayer(this);i&&(i.view.title=n.text)}else t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DTextBase"},n.prototype.destroy=function(){var n=this.Bs;n&&(this.Bs=null,n.destroy());var i=this.dr;i&&(this.dr=null,i.destroy()),t.prototype.destroy.call(this)},n}(hr),Ts=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){this.mh=this.newImages(this.theme,n),t.prototype.init.call(this,n)},n.prototype.newImages=function(t,n){var i=[];return i.push(this.newImage(t,this.toImageOptions(t,null==n?void 0:n.image))),function(t){return!!t.getSecondaryImageSource}(t)&&i.push(this.newImage(new $u(t))),function(t){return!!t.getTertiaryImageSource}(t)&&i.push(this.newImage(new ts(t))),i},n.prototype.toImageOptions=function(t,n){return n},n.prototype.newImage=function(t,n){return new es(this,t,this.Cs,n)},Object.defineProperty(n.prototype,"image",{get:function(){return this.mh[0].source},set:function(t){var n=this.mh[0];n.source=t,n.updateSource()},enumerable:!1,configurable:!0}),n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i);for(var r=this.mh,e=0,u=r.length;e<u;++e)r[e].onStateChange(n,i)},n.prototype.updateText=function(){this.updateTextValue(),this.updateTextAndImage()},n.prototype.updateTextAndImage=function(){for(var t,i=this.mh,r=null!==(t=n.LAYOUTER)&&void 0!==t?t:n.LAYOUTER=new vs,e=0,u=i.length;e<u;++e){var s=i[e];s.updateSource(),s.updateTint(),s.updateBound(),r.add(s)}var h=this.Bs;null!=h?(this.updateTextColor(h),r.set(h)):r.set(null);var o=this.Wn;r.execute(this.Qn,this.Cs,o.width.isOn?null:this.width,o.height.isOn?null:this.height),r.clear()},n.prototype.isRefitable=function(n){if(t.prototype.isRefitable.call(this,n))return!0;for(var i=this.mh,r=0,e=i.length;r<e;++r)if(i[r].isRefitable(n))return!0;return!1},n.prototype.getType=function(){return"DImageBase"},n.prototype.destroy=function(){for(var n=this.mh,i=0,r=n.length;i<r;++i)n[i].destroy();t.prototype.destroy.call(this)},n}(Ss),js=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e=this;t.prototype.init.call(this,n);var u=this.theme;this.wh=null!==(i=null==n?void 0:n.toggle)&&void 0!==i?i:u.isToggle(),this.ph=Ai(null!==(r=null==n?void 0:n.when)&&void 0!==r?r:u.getWhen(),Qu),this.on(ir.tap,(function(t){e.onClick(t)})),this.initOnPress();var s=null==n?void 0:n.group;s&&s.add(this)},n.prototype.onShortcut=function(n){this.state.isActionable&&this.activate(n),t.prototype.onShortcut.call(this,n)},Object.defineProperty(n.prototype,"isToggle",{get:function(){return!!this.wh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return!!this.Oh},set:function(t){this.Oh=t},enumerable:!1,configurable:!0}),n.prototype.initOnPress=function(){var t=this,n=null,i=function(){t.state.isPressed=!1,null!=n&&(n.off(ir.up,i),n.off(ir.upoutside,i),n.off(ir.cancel,i),n=null)};this.on(ir.down,(function(){if(t.state.isActionable){t.state.isPressed=!0;var r=st.getLayer(t);r&&((n=r.renderer.plugins.interaction).on(ir.up,i),n.on(ir.upoutside,i),n.on(ir.cancel,i))}}))},n.prototype.getType=function(){return"DButton"},n.prototype.onClick=function(t){this.ph===Qu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.ph===Qu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.wh?this.Oh&&this.state.isActive||(this.onToggleStart(t),this.onToggleEnd(t)):this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onInactivate=function(t){this.emit("inactive",this)},n.prototype.toggle=function(){this.state.isActionable&&this.wh&&(this.onToggleStart(),this.onToggleEnd())},n.prototype.onToggleStart=function(t){this.state.isActive=!this.state.isActive},n.prototype.onToggleEnd=function(t){this.state.isActive?this.onActivate(t):this.onInactivate(t)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.wh?this.onToggleStart(t):this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.wh?this.onToggleEnd(t):(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1))},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isPressed?i.isPressed||this.onPress():i.isPressed&&this.onUnpress()},n.prototype.onPress=function(){this.emit("press",this)},n.prototype.onUnpress=function(){this.emit("unpress",this)},n.prototype.destroy=function(){var n,i;null===(i=null===(n=this.zn)||void 0===n?void 0:n.group)||void 0===i||i.remove(this),t.prototype.destroy.call(this)},n}(Ts),Ns=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButton"},n}(js),Is=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonPrimary"},n}(Ns),Cs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutHorizontal"},n}(Ju),As=function(t){function n(n,i){var r=t.call(this,i)||this;r.p=n;var e=r.buttonOk,u=r.buttonCancel;return null==e&&null==u||(r.addChild(r.newButtonSpace()),u&&r.addChild(u),e&&r.addChild(e),r.addChild(r.newButtonSpace())),r}return _(n,t),Object.defineProperty(n.prototype,"buttonCancel",{get:function(){var t=this.Dh;return void 0===t&&(t=this.newButtonCancel(),this.Dh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonCancel=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.cancel;return void 0===r&&(r=this.theme.getButtonCancel()),null!=r?new Is({text:{value:r},on:{active:function(){i.p.cancel()}}}):null},Object.defineProperty(n.prototype,"buttonOk",{get:function(){var t=this.Eh;return void 0===t&&(t=this.newButtonOk(),this.Eh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonOk=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.ok;return void 0===r&&(r=this.theme.getButtonOk()),null!=r?null!=this.buttonCancel?new Ns({text:{value:r},on:{active:function(){i.p.ok()}}}):new Is({text:{value:r},on:{active:function(){i.p.ok()}}}):null},n.prototype.newButtonSpace=function(){return new Ku({weight:1})},n.prototype.getType=function(){return"DDialogLayeredFooter"},n}(Cs),Rs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonAmbient"},n}(Ns),ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderButtonClose"},n}(Rs),Ls=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderSeparator"},n}(Ts),ys=function(t){function n(n,i){var r=t.call(this,i)||this;r.p=n;var e=r.separator;e&&r.addChild(e);var u=r.buttonClose;return u&&(r.addChild(u),u.on("active",(function(){r.p.cancel()}))),r}return _(n,t),Object.defineProperty(n.prototype,"buttonClose",{get:function(){var t=this.Mh;return void 0===t&&(t=this.newButtonClose(),this.Mh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonClose=function(){var t,n;return!1!==(null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.close)?new ks:null},Object.defineProperty(n.prototype,"separator",{get:function(){var t=this.Sh;return void 0===t&&(t=this.newSeparator(),this.Sh=t),t},enumerable:!1,configurable:!0}),n.prototype.newSeparator=function(){var t;return!1!==(null===(t=this.zn)||void 0===t?void 0:t.separator)?new Ls:null},n.prototype.getType=function(){return"DDialogLayeredHeader"},n}(Ts),xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.addChild(this.layout)},Object.defineProperty(n.prototype,"layout",{get:function(){var t=this.Th;return null==t&&(t=this.newLayout(),this.Th=t),t},enumerable:!1,configurable:!0}),n.prototype.newLayout=function(){return new Zu(this.toLayoutOptions(this.theme,this.zn))},n.prototype.toLayoutOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.layout)&&void 0!==i?i:t.getLayout())&&void 0!==r?r:this.newLayoutOptions(t,n);return void 0===e.children&&(e.children=this.newLayoutChildren(t,n)),e},n.prototype.newLayoutOptions=function(t,n){return{width:"padding",height:"auto",margin:0}},n.prototype.newLayoutChildren=function(t,n){return[this.header,this.content,this.footer]},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.jh;return void 0===t&&(t=this.newHeader(),this.jh=t),t},enumerable:!1,configurable:!0}),n.prototype.newHeader=function(){var t=this.toHeaderOptions(this.theme,this.zn);return null!==t?new ys(this,t):null},n.prototype.toHeaderOptions=function(t,n){if(n){var i=n.header;if(void 0!==i)return i}return t.getHeader()},Object.defineProperty(n.prototype,"content",{get:function(){var t=this.Nh;return null==t&&(t=this.newContent(),this.Nh=t),t},enumerable:!1,configurable:!0}),n.prototype.newContent=function(){return new qu(this.toContentOptions(this.theme,this.zn))},n.prototype.toContentOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.content)&&void 0!==i?i:t.getContent())&&void 0!==r?r:{};return void 0===e.children&&(e.children=this.newContentChildren(t,n)),e},n.prototype.newContentChildren=function(t,n){return[]},Object.defineProperty(n.prototype,"footer",{get:function(){var t=this.Ih;return void 0===t&&(t=this.newFooter(),this.Ih=t),t},enumerable:!1,configurable:!0}),n.prototype.newFooter=function(){var t=this.toFooterOptions(this.theme,this.zn);return null!==t?new As(this,t):null},n.prototype.toFooterOptions=function(t,n){if(n){var i=n.footer;if(void 0!==i)return i}return t.getFooter()},n.prototype.findFirstFocusable=function(t){return t.find(this.content,!1,!0,!0)},n.prototype.ok=function(){this.onOk(this.getResolvedValue())},n.prototype.onOk=function(t){this.doResolve(t),this.emit("ok",t,this)},n.prototype.cancel=function(){this.onCancel(this.getRejectReason())},n.prototype.onCancel=function(t){this.doReject(t),this.emit("cancel",t,this)},n.prototype.getRejectReason=function(){},n.prototype.getType=function(){return"DDialogLayered"},n}(Wu),Bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout),r},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.Ch;return null==t&&(t=this.newInputLayout(),this.Ch=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(){var t=this.toInputMargin(this.theme,this.zn);return new Cs({width:"padding",height:"auto",margin:0,children:[new Ku({width:t}),this.input,new Ku({width:t})]})},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.Ah;if(null==t){var n=this.zn;t=this.newInput(null==n?void 0:n.input),this.Ah=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.input.value},set:function(t){this.input.value=t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.input.value},n.prototype.getType=function(){return"DDialogInput"},n}(xs),_s=function(t){function n(n){var i=t.call(this)||this;i.Rh=[],i.kh=null,i.Lh=function(t){i.active=t};var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i.emit("init",i),i}return _(n,t),n.prototype.add=function(t){if(this.Rh.indexOf(t)<0){this.Rh.push(t),t.isGrouped=!0;var n=this.vs;null!=n&&(t.state.isEnabled=n),t.on("active",this.Lh),t.state.isActive&&(this.active=t)}},Object.defineProperty(n.prototype,"active",{get:function(){return this.kh},set:function(t){if((null==t||t.isToggle)&&this.kh!==t){var n=this.kh;this.kh=null;for(var i=this.Rh,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u.isToggle&&u.state.isActive&&u.toggle()}this.emit("active",t,n,this)}},enumerable:!1,configurable:!0}),n.prototype.remove=function(t){var n=this.Rh,i=n.indexOf(t);0<=i&&(n.splice(i,1),t.isGrouped=!1,t.off("active",this.Lh),this.kh===t&&(this.active=null))},n.prototype.contains=function(t){return 0<=this.Rh.indexOf(t)},n.prototype.clear=function(){for(var t=this.Rh,n=0,i=t.length;n<i;++n)t[n].isGrouped=!1;t.length=0,this.active=null},n.prototype.size=function(){return this.Rh.length},n.prototype.each=function(t){for(var n=this.Rh,i=0,r=n.length;i<r&&!1!==t(n[i]);++i);},n.prototype.disable=function(){for(var t=this.Rh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!0;this.vs=!1},n.prototype.enable=function(){for(var t=this.Rh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!1;this.vs=!0},n.prototype.destroy=function(){this.clear()},n}(t.utils.EventEmitter),Ps=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOff"},n}(Ns),Fs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOn"},n}(Ns),Us=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.getButtonOff()),i.addChild(i.getButtonOn());var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i.getButtonGroup().on("active",(function(){var t=i.value;i.emit("change",t,!t,i)})),i}return _(n,t),n.prototype.getButtonGroup=function(){var t=this.yh;return null==t&&(t=this.newButtonGroup(),this.yh=t),t},n.prototype.newButtonGroup=function(){return new _s},n.prototype.getButtonOn=function(){var t=this.xh;return null==t&&(t=this.newButtonOn(),this.xh=t),t},n.prototype.newButtonOn=function(){return new Fs({weight:1,group:this.getButtonGroup()})},n.prototype.getButtonOff=function(){var t=this.Bh;return null==t&&(t=this.newButtonOff(),this.Bh=t),t},n.prototype.newButtonOff=function(){return new Ps({weight:1,group:this.getButtonGroup(),state:ct.ACTIVE})},Object.defineProperty(n.prototype,"value",{get:function(){return this.getButtonOn().state.isActive},set:function(t){this.value!==t&&(t?this.getButtonOn().activate():this.getButtonOff().activate())},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputBoolean"},n}(Cs),Gs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){return new Us(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputBoolean"},n}(Bs),Hs=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i.isOpened=!1,i.step=vn.ofNumberOrNull(n.step),i.min=vn.ofNumberOrNull(n.min),i.max=vn.ofNumberOrNull(n.max),i}return _(n,t),n.prototype.execute=function(t,n,i){var r=this;if(!this.isOpened&&this.condition(t,i,ln)){var e=this.target(t,i,ln);if(null!=e){var u=this.initial(t,i,ln),s=this.step(t,i,ln),h=this.min(t,i,ln),o=this.max(t,i,ln);this.isOpened=!0,setTimeout((function(){r.open(t,e,u,s,h,o).then((function(n){r.isOpened=!1,wu.execute(t,r.onInputAction,e,n,i)}),(function(){r.isOpened=!1}))}),0)}}},n}(dn),zs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofBooleanOrFalse(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Gs({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Hs),Vs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getUtil=function(){var t=this.ls;return null==t&&(t=this.newUtil(),this.ls=t),t},n.prototype.newUtil=function(){return new uu(this,this.newOperation(),this.theme,this.zn)},n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},Object.defineProperty(n.prototype,"element",{get:function(){return this.getUtil().element},enumerable:!1,configurable:!0}),n.prototype.onDownThis=function(n){var i=this.getUtil();i.onDowning(n),t.prototype.onDownThis.call(this,n),i.onDown(n)},n.prototype.onDblClick=function(n,i){return this.getUtil().onDblClick(n,i),t.prototype.onDblClick.call(this,n,i)},n.prototype.onFocus=function(){t.prototype.onFocus.call(this),this.getUtil().onFocus()},n.prototype.onBlur=function(){t.prototype.onBlur.call(this),this.getUtil().onBlur()},n.prototype.start=function(){this.getUtil().start()},n.prototype.render=function(n){this.getUtil().onRender(n),t.prototype.render.call(this,n)},n.prototype.getElementRect=function(t,n,i){return n.set(0,0),this.toGlobal(n,n,!1),i.x=n.x,i.y=n.y,n.set(this.width,this.height),this.toGlobal(n,n,!0),i.width=n.x-i.x,i.height=n.y-i.y,i},n.prototype.getClipperRect=function(t,n,i){return uu.getClipperRect(this.parent,this,t,n,i)},n.prototype.cancel=function(){this.getUtil().cancel()},n.prototype.end=function(){this.getUtil().end()},n.prototype.select=function(){return this.getUtil().select(),this},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.start(),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DHtmlElement"},n}(Ts),Ws=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){t.hideText()},onCancel:function(){t.showText()},onEnd:function(){},getValue:function(){return t.oh},onValueInput:function(n){t.onValueInput(n)},onValueChange:function(n,i){t.text=n,t.onValueChange(n,i)},onEnter:function(){t.onEnter()},applyTitle:function(){t.applyTitle()}}},Object.defineProperty(n.prototype,"value",{get:function(){return this.oh},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){t.prototype.onTextChange.call(this),this.validate()},n.prototype.onValueChange=function(t,n){this.emit("change",t,n,this)},n.prototype.onValueInput=function(t){this.emit("input",t,this)},n.prototype.onEnter=function(){this.emit("enter",this)},n.prototype.validate=function(){return this.getUtil().validate()},n.prototype.applyTitle=function(){this.getUtil().applyTitle()||t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DInput"},n}(Vs),Xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInput"},n}(Ws),Ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new gu(this,this.newOperation(),this.theme,this.zn)},Object.defineProperty(n.prototype,"step",{get:function(){return this.getUtil().step},set:function(t){this.getUtil().step=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.getUtil().min},set:function(t){this.getUtil().min=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.getUtil().max},set:function(t){this.getUtil().max=t},enumerable:!1,configurable:!0}),n}(Xs),Ys=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInteger"},n}(Ks),Js=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new Ys(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputInteger"},n}(Bs),Zs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Js({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Hs),qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputReal"},n}(Ks),Qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new qs(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputReal"},n}(Bs),$s=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Qs({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Hs),th=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Su(this,this.newOperation(),this.theme,this.zn)},n.prototype.getType=function(){return"DInputText"},n}(Xs),nh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new th(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputText"},n}(Bs),ih=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofString(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new nh({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Hs),rh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogFittedContent"},n}(qu),eh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLayoutOptions=function(t,n){return{width:"auto",height:"auto",margin:0}},n.prototype.newContent=function(){return new rh(this.toContentOptions(this.theme,this.zn))},n.prototype.getType=function(){return"DDialogFitted"},n}(xs),uh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonBack"},n}(Rs),sh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonDate"},n}(Rs),hh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonNext"},n}(Rs),oh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DText"},n}(Ss),ah=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabel"},n}(oh),ch=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabelDate"},n}(oh),fh=function(t){function n(n){var i=t.call(this,n)||this;return i.renderable=!1,i}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeSpace"},n}(hr),lh={NONE:0,DATE:1,HOURS:2,MINUTES:4,SECONDS:8,TIME:14,ALL:15},vh=function(){function t(){}return t.from=function(t,n){var i=null==n?void 0:n.mask;if(null==i){if(Ot(t)){var r=Z.getInstance().get(t);if(null!=r)return r.getMask()}else if(null!=t)return t.getMask();return lh.NONE}if(Ot(i))return lh[i];if(pt(i))return i;for(var e=lh.NONE,u=0,s=i.length;u<s;++u)e|=lh[i[u]];return e},t}(),bh=function(){function t(t,n){var i,r;this._h=null!==(i=null==t?void 0:t.date)&&void 0!==i?i:null,this.Ph=null!==(r=null==t?void 0:t.inclusive)&&void 0!==r&&r,this.ut=n}return Object.defineProperty(t.prototype,"date",{get:function(){return this._h},set:function(t){this._h!==t&&(this._h=t,this.ut())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inclusive",{get:function(){return this.Ph},set:function(t){this.Ph!==t&&(this.Ph=t,this.ut())},enumerable:!1,configurable:!0}),t}(),dh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(r.getFullYear()<t.getFullYear())return e.hour.min;if(r.getMonth()<t.getMonth())return e.hour.min;if(r.getDate()<t.getDate())return e.hour.min}var s=r.getHours();return i.inclusive||u&lh.SECONDS&&r.getSeconds()<e.second.max||u&lh.MINUTES&&r.getMinutes()<e.minute.max?s:s+1}return e.hour.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(t.getFullYear()<r.getFullYear())return e.hour.max;if(t.getMonth()<r.getMonth())return e.hour.max;if(t.getDate()<r.getDate())return e.hour.max}var s=r.getHours();return i.inclusive||u&lh.SECONDS&&e.second.min<r.getSeconds()||u&lh.MINUTES&&e.minute.min<r.getMinutes()?s:s-1}return e.hour.max},t}(),gh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(r.getFullYear()<t.getFullYear())return e.minute.min;if(r.getMonth()<t.getMonth())return e.minute.min;if(r.getDate()<t.getDate())return e.minute.min}if(u&lh.HOURS&&r.getHours()<t.getHours())return e.minute.min;var s=r.getMinutes();return i.inclusive||u&lh.SECONDS&&r.getSeconds()<e.second.max?s:s+1}return e.minute.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(t.getFullYear()<r.getFullYear())return e.minute.max;if(t.getMonth()<r.getMonth())return e.minute.max;if(t.getDate()<r.getDate())return e.minute.max}if(u&lh.HOURS&&t.getHours()<r.getHours())return e.minute.max;var s=r.getMinutes();return i.inclusive||u&lh.SECONDS&&e.second.min<r.getSeconds()?s:s-1}return e.minute.max},t}(),mh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(r.getFullYear()<t.getFullYear())return e.second.min;if(r.getMonth()<t.getMonth())return e.second.min;if(r.getDate()<t.getDate())return e.second.min}return u&lh.HOURS&&r.getHours()<t.getHours()||u&lh.MINUTES&&r.getMinutes()<t.getMinutes()?e.second.min:r.getSeconds()+(i.inclusive?0:1)}return e.second.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(t.getFullYear()<r.getFullYear())return e.second.max;if(t.getMonth()<r.getMonth())return e.second.max;if(t.getDate()<r.getDate())return e.second.max}return u&lh.HOURS&&t.getHours()<r.getHours()||u&lh.MINUTES&&t.getMinutes()<r.getMinutes()?e.second.max:r.getSeconds()-(i.inclusive?0:1)}return e.second.max},t}(),wh=function(){function t(t,n){this.constant=this.newConstant(),this.lower=new bh(t&&t.lower,n),this.upper=new bh(t&&t.upper,n),this.mask=lh.ALL,this.hours=new dh(this),this.minutes=new gh(this),this.seconds=new mh(this)}return t.prototype.newConstant=function(){return{second:{min:0,max:59},minute:{min:0,max:59},hour:{min:0,max:23}}},t.prototype.adjust=function(t){var n=this.test(t);if(n<0){var i=this.lower,r=i.date;if(r)return t.setTime(r.getTime()),i.inclusive||((e=this.mask)&lh.SECONDS?t.setSeconds(r.getSeconds()+1):e&lh.MINUTES?t.setMinutes(r.getMinutes()+1):e&lh.HOURS?t.setHours(r.getHours()+1):e&lh.DATE&&t.setDate(r.getDate()+1)),!0}else if(0<n){var e,u=this.upper,s=u.date;if(s)return t.setTime(s.getTime()),u.inclusive||((e=this.mask)&lh.SECONDS?t.setSeconds(s.getSeconds()-1):e&lh.MINUTES?t.setMinutes(s.getMinutes()-1):e&lh.HOURS?t.setHours(s.getHours()-1):e&lh.DATE&&t.setDate(s.getDate()-1)),!0}return!1},t.prototype.compare=function(t,n){var i=this.mask;if(i&lh.DATE){var r,e,u,s,h=t.getFullYear(),o=n.getFullYear();if(h!==o)return h<o?-1:1;if((r=t.getMonth())!==(e=n.getMonth()))return r<e?-1:1;if((u=t.getDate())!==(s=n.getDate()))return u<s?-1:1}if(i&lh.HOURS){var a=t.getHours(),c=n.getHours();if(a!==c)return a<c?-1:1}return i&lh.MINUTES&&(r=t.getMinutes())!==(e=n.getMinutes())?r<e?-1:1:i&lh.SECONDS&&(u=t.getSeconds())!==(s=n.getSeconds())?u<s?-1:1:0},t.prototype.test=function(t){var n=this.lower,i=n.date;if(null!=i){var r=this.compare(i,t);return n.inclusive?r<=0?0:-1:r<0?0:-1}var e=this.upper,u=e.date;return null!=u?(r=this.compare(t,u),e.inclusive?r<=0?0:1:r<0?0:1):0},t.prototype.contains=function(t){return 0===this.test(t)},t}(),ph=function(t,n,i){if(t){var r=t.date,e=t.inclusive;return{date:void 0!==r?r:n,inclusive:void 0!==e?e:i}}return{date:n,inclusive:i}},Oh=function(t){function n(n){var i=t.call(this,n)||this;return i.onNewChange(),i}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n);var e=this.theme;this.Fh=new Date;var u=this.Fh.getTime();this.Uh=new Date(u),this.Gh=new wh(function(t,n){return n?{lower:ph(n.lower,t.getLowerBound(),t.isLowerBoundInclusive()),upper:ph(n.upper,t.getUpperBound(),t.isUpperBoundInclusive())}:{lower:{date:t.getLowerBound(),inclusive:t.isLowerBoundInclusive()},upper:{date:t.getUpperBound(),inclusive:t.isUpperBoundInclusive()}}}(e,null==n?void 0:n.bounds),(function(){r.onNewChange()}));var s=null!==(i=null==n?void 0:n.margin)&&void 0!==i?i:e.getMargin();new Zu({parent:this,x:"padding",y:"padding",width:"auto",height:"auto",margin:s,children:this.newChildren(e,n,s)})},Object.defineProperty(n.prototype,"current",{get:function(){return this.Fh},set:function(t){this.Fh.getTime()!==t.getTime()&&(this.Fh=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.Uh},set:function(t){this.Uh.getTime()!==t.getTime()&&(this.Uh=t,this.onNewChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bounds",{get:function(){return this.Gh},enumerable:!1,configurable:!0}),n.prototype.hasHours=function(){return null!=this.Hh},n.prototype.hasMinutes=function(){return null!=this.zh},n.prototype.hasSeconds=function(){return null!=this.Vh},n.prototype.reset=function(){var t=this.Fh.getTime();this.Uh.setTime(t),this.onReset()},n.prototype.onReset=function(){this.onNewChange()},n.prototype.onNewChange=function(){var t=this.Uh,n=this.Gh;n.adjust(this.Uh);var i=this.Hh;if(i){var r=n.hours;i.value=t.getHours(),i.min=r.min(t),i.max=r.max(t)}var e=this.zh;if(e){var u=n.minutes;e.value=t.getMinutes(),e.min=u.min(t),e.max=u.max(t)}var s=this.Vh;if(s){var h=n.seconds;s.value=t.getSeconds(),s.min=h.min(t),s.max=h.max(t)}},n.prototype.newChildren=function(t,n,i){var r=vh.from(t,n);return this.Gh.mask=r,this.Hh=r&lh.HOURS?this.newInputHours(t,n):null,this.zh=r&lh.MINUTES?this.newInputMinutes(t,n):null,this.Vh=r&lh.SECONDS?this.newInputSeconds(t,n):null,[this.newTimeLayout(this.Hh,this.zh,this.Vh,i)]},n.prototype.newTimeLayout=function(t,n,i,r){var e=this.newTimeLayoutChildren(t,n,i);return 0<e.length?new Cs({width:this.getTimeLayoutWidth(),height:this.getTimeLayoutHeight(),margin:r,children:e}):null},n.prototype.getTimeLayoutWidth=function(){return"auto"},n.prototype.getTimeLayoutHeight=function(){return"auto"},n.prototype.newTimeLayoutChildren=function(t,n,i){var r=[];return null!=t&&r.push(t),null!=n&&(0<r.length&&r.push(this.newMinuteSeparator()),r.push(n)),null!=i&&(0<r.length&&r.push(this.newSecondSeparator()),r.push(i)),r},n.prototype.newMinuteSeparator=function(){return new oh({width:"auto",text:{value:this.getMinuteSeparator()}})},n.prototype.getMinuteSeparator=function(){return":"},n.prototype.newSecondSeparator=function(){return new oh({width:"auto",text:{value:this.getSecondSeparator()}})},n.prototype.getSecondSeparator=function(){return":"},n.prototype.adjustInputOptions=function(t,n,i){return null==n.step&&(n.step=1),null==n.min&&(n.min=0),null==n.max&&(n.max=i),n},n.prototype.newInputHours=function(t,n){var i,r=this,e=null!==(i=null==n?void 0:n.hours)&&void 0!==i?i:t.getHoursOptions(),u=this.Gh.constant.hour.max,s=new Ys(this.adjustInputOptions(t,e,u));return s.on("change",(function(t){r.onHoursChange(t)})),s},n.prototype.onHoursChange=function(t){this.Uh.setHours(t),this.onNewChange()},n.prototype.newInputMinutes=function(t,n){var i=this,r=(null==n?void 0:n.minutes)||t.getMinutesOptions(),e=this.Gh.constant.minute.max,u=new Ys(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onMinutesChange(t)})),u},n.prototype.onMinutesChange=function(t){this.Uh.setMinutes(t),this.onNewChange()},n.prototype.newInputSeconds=function(t,n){var i=this,r=(null==n?void 0:n.seconds)||t.getSecondsOptions(),e=this.Gh.constant.second.max,u=new Ys(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onSecondsChange(t)})),u},n.prototype.onSecondsChange=function(t){this.Uh.setSeconds(t)},n.prototype.getType=function(){return"DPickerTime"},n}(hr),Dh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.Wh=new Date(this.Fh.getTime())},n.prototype.newChildren=function(n,i,r){var e,u;this.Xh=this.newDateButtons(n,i),this.Kh=null!==(u=null===(e=null==i?void 0:i.date)||void 0===e?void 0:e.decorator)&&void 0!==u?u:n.getDateDecorator(),this.Yh=this.newLabel(n,i);var s=t.prototype.newChildren.call(this,n,i,r);return s.unshift(new Cs({width:"100%",height:"auto",children:[this.newBackButton(n,i),this.Yh,this.newNextButton(n,i)]}),new Cs({width:"auto",height:"auto",margin:r,children:this.newDateLabels(n,i)}),new Zu({width:"auto",height:"auto",margin:r,column:7,children:this.Xh})),s},Object.defineProperty(n.prototype,"page",{get:function(){return this.Wh},set:function(t){this.Wh.getTime()!==t.getTime()&&(this.Wh=t,this.onPageChange())},enumerable:!1,configurable:!0}),n.prototype.onReset=function(){this.Wh.setTime(this.Fh.getTime()),t.prototype.onReset.call(this)},n.prototype.next=function(){var t=this.Wh;t.setFullYear(t.getFullYear(),t.getMonth()+1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.back=function(){var t=this.Wh;t.setFullYear(t.getFullYear(),t.getMonth()-1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.onNewChange=function(){this.Gh.adjust(this.Wh),t.prototype.onNewChange.call(this),this.onPageChange()},n.prototype.onPageChange=function(){var t=this.Xh,n=this.Gh,i=this.Wh,r=this.Uh,e=new Date(i.getTime());e.setDate(1),e.setHours(0,0,0,0);for(var u=this.theme,s=(e.getDay()-u.getDayStart()+7)%7,h=0;h<s;++h)t[h].show();for(h=s;h<7;++h)t[h].hide();var o=this.Kh;e.setFullYear(e.getFullYear(),e.getMonth()+1,0);var a=e.getDate(),c=r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()?r.getDate():0;for(h=0;h<a;++h)e.setDate(h+1),(f=t[h+7]).state.isActive=c===h+1,f.state.isDisabled=!n.contains(e),f.show(),o(e,f);for(h=a;h<31;++h){var f;(f=t[h+7]).state.isActive=!1,f.hide()}e.setTime(i.getTime()),this.Yh.text=e},n.prototype.adjustInputOptions=function(n,i,r){return null==i.weight&&(i.weight=1),t.prototype.adjustInputOptions.call(this,n,i,r)},n.prototype.getTimeLayoutWidth=function(){return"100%"},n.prototype.toLabelOptions=function(t,n){var i=n&&n.label||{};void 0===i.weight&&(i.weight=1),void 0===i.padding&&(i.padding=0);var r=i.text=i.text||{},e=r.align=r.align||{};return void 0===e.horizontal&&(e.horizontal="CENTER"),void 0===r.formatter&&(r.formatter=t.getLabelFormatter()),i},n.prototype.newLabel=function(t,n){return new ah(this.toLabelOptions(t,n))},n.prototype.newBackButton=function(t,n){var i=this,r=null==n?void 0:n.back;if(void 0===r&&(r=t.getBackButtonOptions()),null!=r){var e=new uh(r);return e.on("active",(function(){i.back()})),e}return null},n.prototype.newNextButton=function(t,n){var i=this,r=null==n?void 0:n.next;if(void 0===r&&(r=t.getNextButtonOptions()),null!=r){var e=new hh(r);return e.on("active",(function(){i.next()})),e}return null},n.prototype.newDateLabels=function(t,n){for(var i=t.getDayLabels(),r=t.getDayStart(),e=[],u=0;u<7;++u){var s=i[(r+u)%7];e.push(this.newDateLabel(t,n,s))}return e},n.prototype.newDateLabel=function(t,n,i){return new ch({text:{value:i}})},n.prototype.newDateButtons=function(t,n){for(var i=[],r=0;r<7;++r)i.push(this.newSpace(t,n));for(r=1;r<=31;++r)i.push(this.newDateButton(t,n,r));return i},n.prototype.newSpace=function(t,n){return new fh},n.prototype.newDateButton=function(t,n,i){var r=this;return new sh({text:{value:String(i)},on:{active:function(){r.onDateButtonClicked(i)}}})},n.prototype.onDateButtonClicked=function(t){var n=this.Uh;if(n.getDate()!==t){var i=this.Wh;n.setFullYear(i.getFullYear()),n.setMonth(i.getMonth()),n.setDate(t),this.onNewChange()}},n.prototype.getType=function(){return"DPickerDatetime"},n}(Oh),Eh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new Dh(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDatetime"},n}(eh),Mh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;return null==h&&(h=new Eh,n.DIALOG=h),h.new=h.current=this.toDate(r),h.open(t).then((function(t){return t.toISOString()}))},n.prototype.toDate=function(t){return Ot(t)||pt(t)?new Date(t):t instanceof Date?t:new Date},n}(Hs),Sh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new Oh(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogTime"},n}(eh),Th=function(t){return t!=t},jh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new Sh,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){if(pt(t))return new Date(t);if(Ot(t)){var n=new Date,i=this.getPattern().exec(t);if(null!=i){var r=this.toHours(i[1]);null!=r&&n.setHours(r);var e=this.toMinutes(i[2]);null!=e&&n.setMinutes(e);var u=this.toSeconds(i[3]);null!=u&&n.setSeconds(u);var s=this.toMilliseconds(i[4]);null!=s&&n.setMilliseconds(s)}return n}return t instanceof Date?t:new Date},n.prototype.toHours=function(t){return this.toNumber(t,0,23)},n.prototype.toMinutes=function(t){return this.toNumber(t,0,59)},n.prototype.toSeconds=function(t){return this.toNumber(t,0,59)},n.prototype.toMilliseconds=function(t){var n=this.toNumber(t,0,999);if(null!=n){var i=t.length;return 1===i?100*n:2===i?10*n:n}return n},n.prototype.toNumber=function(t,n,i){if(null!=t){var r=+t;if(!Th(r))return Math.min(i,Math.max(n,r))}return null},n.prototype.getPattern=function(){var t=n.PATTERN;return null==t&&(t=this.newPattern(),n.PATTERN=t),t},n.prototype.newPattern=function(){return/^\s*(?:(\d+)(?::(\d+)(?::(\d+))?)?)?(?:\.(\d+))?\s*$/},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return Mi.create("%Hm")},n}(Hs),Nh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDate"},n}(Dh),Ih=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new Nh(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDate"},n}(eh),Ch=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new Ih,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){return Ot(t)||pt(t)?new Date(t):t instanceof Date?t:new Date},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return Mi.create("%Y-%M-%D")},n}(Hs),Ah={TEXT:0,INTEGER:1,REAL:2,BOOLEAN:3,DATE:4,TIME:5,DATETIME:6,EXTENSION:1e3},Rh=function(t){function n(n,i,r,e,u,s,h,o){var a=t.call(this,jn.OPEN,n,yu.DIALOG)||this;return a.target=i,a.onInputAction=r,a.initial=e,a.step=u,a.min=s,a.max=h,a.dialogType=o,a}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.dialogType===i.dialogType&&this.onInputAction===i.onInputAction&&this.initial===i.initial&&this.step===i.step&&this.min===i.min&&this.max===i.max},n.prototype.toRuntime=function(){switch(this.dialogType){case Ah.TEXT:return new ih(this);case Ah.INTEGER:return new Zs(this);case Ah.REAL:return new $s(this);case Ah.BOOLEAN:return new zs(this);case Ah.DATE:return new Ch(this);case Ah.TIME:return new jh(this);case Ah.DATETIME:return new Mh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.initial),e=t.addResource(this.step),u=t.addResource(this.min),s=t.addResource(this.max);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,",").concat(this.dialogType,",").concat(e,",").concat(u,",").concat(s,"]"))},n.deserialize=function(t,i){var r=i.resources,e=Nn.toResource(1,t,r),u=Nn.toResource(3,t,r),s=Nn.toResource(5,t,r),h=Nn.toResource(7,t,r),o=Nn.toResource(8,t,r),a=Nn.toResource(9,t,r);return new n(e,u,t[4],s,h,o,a,this.toDialogType(t))},n.toDialogType=function(t){if(t[2]===yu.DIALOG)return t[6];switch(t[2]){case yu.DIALOG_TEXT:return Ah.TEXT;case yu.DIALOG_INTEGER:return Ah.INTEGER;case yu.DIALOG_REAL:return Ah.REAL;case yu.DIALOG_BOOLEAN:return Ah.BOOLEAN;case yu.DIALOG_DATE:return Ah.DATE;case yu.DIALOG_TIME:return Ah.TIME;case yu.DIALOG_DATETIME:return Ah.DATETIME}},n}(Tn),kh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.Zh)&&void 0!==n?n:this.Zh=new Map).set(t.type,t),(null!==(i=this.Xt)&&void 0!==i?i:this.Xt=[]).push(t)},t.get=function(t){var n=this.Zh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Xt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Lh=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;i.target=vn.ofStringOrNull(n.target),i.argument=vn.ofUnknown(n.argument);var r=kh.get(n.dialogType);return r&&(i.opener=r.opener),i}return _(n,t),n.prototype.execute=function(t,n,i){var r=this.opener;if(r&&this.condition(t,i,ln)){var e=this.target(t,i,ln);if(null!=e){var u=this.argument(t,i,ln);setTimeout((function(){r(e,u,t)}),0)}}},n}(dn),yh=function(t){function n(n,i,r,e){var u=t.call(this,jn.OPEN,n,yu.DIALOG)||this;return u.target=i,u.argument=r,u.dialogType=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.argument===i.argument&&this.dialogType===i.dialogType},n.prototype.toRuntime=function(){return new Lh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.argument);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",0,-1,").concat(this.dialogType,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),Nn.toResource(3,t,i.resources),Nn.toResource(7,t,i.resources),t[6])},n}(Tn),xh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.Zh)&&void 0!==n?n:this.Zh=new Map).set(t.type,t),(null!==(i=this.Xt)&&void 0!==i?i:this.Xt=[]).push(t),Ze[t.type]=t.opener},t.get=function(t){var n=this.Zh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Xt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Bh=function(t){function n(n,i,r,e){var u=t.call(this,jn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){return new Lu(this,this.subtype)},n.prototype.toLabel=function(){var t=this.getTheme().toTypeLabel(this.type),n=xh.get(this.subtype);return"".concat(t,": ").concat(null!=n?n.label:"Unknown")},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(3,t,i.resources);return new n(t[2],r,e,!!t[4])},n}(Tn),_h={SHAPE_SHOW:0,SHAPE_HIDE:1,SHAPE:2,LAYER:3},Ph=function(t){function n(n){var i=t.call(this,n,cn.VISIBILITY)||this;return i.visibility=n.subtype===_h.SHAPE_SHOW,i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,ln)&&(t.visible=this.visibility,n.written|=this.reset)},n}(dn),Fh=function(t){function n(n,i){return t.call(this,jn.SHOW_HIDE,i,n)||this}return _(n,t),n.prototype.toRuntime=function(){return new Ph(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources);return new n(t[2],r)},n}(Tn),Uh=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.Xt=new Map,i.Tu=n.layers,i.qh=n.bringToFront,i}return _(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i);var r=this.Xt.get(n);null==r&&null!=(r=this.newData(n))&&this.Xt.set(n,r)},n.prototype.execute=function(t,n,i){var r=this.Xt.get(t);if(r){var e=this.condition(t,i,ln);if(r.condition!==e){r.condition=e;var u=r.layers;e?r.bringToFront?(_e.bringAllToFront(u),_e.showAll(u)):_e.showAll(u):_e.hideAll(u)}}},n.prototype.newData=function(t){var n=_e.toLayers(t,this.Tu);if(0<n.length)return{layers:n,bringToFront:this.qh,condition:null}},n}(dn),Gh=function(t){function n(n,i,r){var e=t.call(this,jn.SHOW_HIDE,n,_h.LAYER)||this;return e.layers=i,e.bringToFront=r,e}return _(n,t),n.prototype.toRuntime=function(){return new Uh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=this.serializeLayers(t),r=this.bringToFront?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.prototype.serializeLayers=function(t){for(var n=this.layers,i="[",r="",e=0,u=n.length;e<u;++e)i+=r+n[e],r=",";return i+="]",t.addResource(i)},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),this.deserializeLayers(t[3],i),!!t[4])},n.deserializeLayers=function(t,n){var i=n.resources,r=i.length;return 0<=t&&t<r?JSON.parse(i[t]):[]},n}(Tn),Hh=function(t){function n(n){return t.call(this,n,cn.VISIBILITY)||this}return _(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i)},n.prototype.execute=function(t,n,i){t.visible=this.condition(t,i,ln),n.written|=this.reset},n}(dn),zh=function(t){function n(n){return t.call(this,jn.SHOW_HIDE,n,_h.SHAPE)||this}return _(n,t),n.prototype.toRuntime=function(){return new Hh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources))},n}(Tn),Vh=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.amount=vn.ofNumber(n.amount),r}return _(n,t),n}(dn),Wh=function(t){function n(n){return t.call(this,n,cn.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln);t.transform.position.x=r,n.written|=this.reset}},n}(Vh),Xh=function(t){function n(n){return t.call(this,n,cn.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln);t.transform.position.y=r,n.written|=this.reset}},n}(Vh),Kh=function(t){function n(n){return t.call(this,n,cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=e.position,s=!!(n.written&cn.POSITION_X),h=!!(n.written&cn.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o-c.c*r,a-c.d*r),n.written|=this.reset}},n}(Vh),Yh=function(t){function n(n){return t.call(this,n,cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=e.position,s=!!(n.written&cn.POSITION_X),h=!!(n.written&cn.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o+c.a*r,a+c.b*r),n.written|=this.reset}},n}(Vh),Jh=function(t){function n(n){return t.call(this,n,cn.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=!!(n.written&cn.POSITION_X),u=t.transform.position,s=e?u.x:n.x;u.x=s+r,n.written|=this.reset}},n}(Vh),Zh=function(t){function n(n){return t.call(this,n,cn.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=!!(n.written&cn.POSITION_Y),u=t.transform.position,s=e?u.y:n.y;u.y=s+r,n.written|=this.reset}},n}(Vh),qh=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r)||this;return u.opetype=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.opetype===i.opetype},n}(Tn),Qh={RELATIVE_X:0,RELATIVE_Y:1,ABSOLUTE_X:2,ABSOLUTE_Y:3,FORWARD_OR_BACKWARD:4,LEFT_OR_RIGHT:5},$h={RESIZE:0,MOVE:1,ROTATE:2},to=function(t){function n(n,i,r){var e=t.call(this,jn.TRANSFORM,i,$h.MOVE,n)||this;return e.amount=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case Qh.ABSOLUTE_X:return new Wh(this);case Qh.ABSOLUTE_Y:return new Xh(this);case Qh.FORWARD_OR_BACKWARD:return new Kh(this);case Qh.LEFT_OR_RIGHT:return new Yh(this);case Qh.RELATIVE_X:return new Jh(this);case Qh.RELATIVE_Y:return new Zh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(4,t,i.resources);return new n(t[3],r,e)},n}(qh),no={RELATIVE_SIZE:0,RELATIVE_HEIGHT:1,RELATIVE_WIDTH:2,ABSOLUTE_SIZE:3,ABSOLUTE_HEIGHT:4,ABSOLUTE_WIDTH:5},io=function(t){function n(n,i){var r=t.call(this,n,i)||this;switch(n.opetype){case no.RELATIVE_SIZE:r.size=vn.ofNumberOrOne(n.amount);break;case no.ABSOLUTE_SIZE:r.size=vn.ofNumberOrOneHundred(n.amount);break;case no.RELATIVE_HEIGHT:r.size=vn.ofNumberOrOne(n.amount);break;case no.ABSOLUTE_HEIGHT:r.size=vn.ofNumberOrOneHundred(n.amount);break;case no.RELATIVE_WIDTH:r.size=vn.ofNumberOrOne(n.amount);break;case no.ABSOLUTE_WIDTH:r.size=vn.ofNumberOrOneHundred(n.amount);break;default:r.size=vn.ONE}return r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=(-.5+e)*i,h=(-.5+u)*r;t.updateTransform();var o=t.transform,a=o.position,c=o.localTransform,f=!!(n.written&cn.POSITION_X),l=!!(n.written&cn.POSITION_Y),v=f?a.x:n.x,b=l?a.y:n.y;n.written|=cn.POSITION,a.set(v+s*c.a+h*c.c,b+s*c.b+h*c.d)},n}(dn),ro=function(t){function n(n){var i=t.call(this,n,cn.HEIGHT|cn.POSITION)||this;return i.origin=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.HEIGHT?e.y:n.sizeY;e.y=Ir(r),n.written|=cn.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(io),eo=function(t){function n(n){var i=t.call(this,n,cn.HEIGHT|cn.POSITION)||this;return i.origin=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.HEIGHT?e.y:n.sizeY;e.y=Ir(u*r),n.written|=cn.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(io),uo=function(t){function n(n){var i=t.call(this,n,cn.SIZE|cn.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=Ir(this.size(t,i,ln)),e=t.size,u=!!(n.written&cn.WIDTH),s=!!(n.written&cn.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(r,r),n.written|=cn.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(io),so=function(t){function n(n){var i=t.call(this,n,cn.SIZE|cn.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=!!(n.written&cn.WIDTH),s=!!(n.written&cn.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(Ir(h*r),Ir(o*r)),n.written|=cn.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(io),ho=function(t){function n(n){var i=t.call(this,n,cn.WIDTH|cn.POSITION)||this;return i.origin=n.originX,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.WIDTH?e.x:n.sizeX;e.x=Ir(r),n.written|=cn.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(io),oo=function(t){function n(n){var i=t.call(this,n,cn.WIDTH|cn.POSITION)||this;return i.origin=n.originX,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.WIDTH?e.x:n.sizeX;e.x=Ir(u*r),n.written|=cn.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(io),ao=function(t){function n(n,i,r,e,u){var s=t.call(this,jn.TRANSFORM,i,$h.RESIZE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case no.ABSOLUTE_HEIGHT:return new ro(this);case no.ABSOLUTE_WIDTH:return new ho(this);case no.ABSOLUTE_SIZE:return new uo(this);case no.RELATIVE_HEIGHT:return new eo(this);case no.RELATIVE_WIDTH:return new oo(this);case no.RELATIVE_SIZE:return new so(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(qh),co=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.originX=n.originX,r.originY=n.originY,r.amount=vn.ofNumber("(".concat(n.amount,") * (Math.PI / 180)")),r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=!!(n.written&cn.WIDTH),h=!!(n.written&cn.HEIGHT),o=(-.5+e)*(s?t.size.x:n.sizeX),a=(-.5+u)*(h?t.size.y:n.sizeY),c=Math.sin(i)-Math.sin(r),f=Math.cos(i)-Math.cos(r),l=t.transform.position,v=!!(n.written&cn.POSITION_X),b=!!(n.written&cn.POSITION_Y),d=v?l.x:n.x,g=b?l.y:n.y;n.written|=cn.POSITION,l.set(d+o*f-a*c,g+o*c+a*f)},n}(dn),fo=function(t){function n(n){return t.call(this,n,cn.ROTATION|cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=n.written&cn.ROTATION?e.rotation:n.rotation;e.rotation=r,n.written|=cn.ROTATION,this.adjustPosition(t,n,u,r,this.originX,this.originY)}},n}(co),lo=function(t){function n(n){return t.call(this,n,cn.ROTATION|cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=n.written&cn.ROTATION?e.rotation:n.rotation;e.rotation=u+r,n.written|=cn.ROTATION,this.adjustPosition(t,n,u,e.rotation,this.originX,this.originY)}},n}(co),vo={RELATIVE:0,ABSOLUTE:1},bo=function(t){function n(n,i,r,e,u){var s=t.call(this,jn.TRANSFORM,i,$h.ROTATE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case vo.ABSOLUTE:return new fo(this);case vo.RELATIVE:return new lo(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(qh),go=function(t,n){switch(t[0]){case jn.SHOW_HIDE:switch(t[2]){case _h.SHAPE_SHOW:case _h.SHAPE_HIDE:return Fh.deserialize(t,n);case _h.SHAPE:return zh.deserialize(t,n);case _h.LAYER:return Gh.deserialize(t,n)}break;case jn.BLINK:return In.deserialize(t,n);case jn.CHANGE_COLOR:case jn.CHANGE_COLOR_LEGACY:switch(t[3]){case Rn.COLOR_AND_ALPHA:case Rn.COLOR:case Rn.ALPHA:return Bn.deserialize(t,n);case Rn.CODE:return Un.deserialize(t,n);case Rn.BRIGHTNESS:return Pn.deserialize(t,n)}break;case jn.CHANGE_TEXT:return Ni.deserialize(t,n);case jn.CHANGE_CURSOR:return Hn.deserialize(t,n);case jn.EMIT_EVENT:return $e.deserialize(t,n);case jn.OPEN:switch(t[2]){case yu.DIALOG_TEXT:case yu.DIALOG_INTEGER:case yu.DIALOG_REAL:case yu.DIALOG_BOOLEAN:case yu.DIALOG_DATE:case yu.DIALOG_TIME:case yu.DIALOG_DATETIME:case yu.DIALOG:return Ah.EXTENSION<=t[6]?yh.deserialize(t,n):Rh.deserialize(t,n);case yu.DIAGRAM_LEGACY:case yu.PAGE_LEGACY:case yu.PAGE_INPLACE_LEGACY:case yu.DIAGRAM:case yu.PAGE:return xu.deserialize(t,n);default:if(yu.EXTENSION<=t[2])return Bh.deserialize(t,n)}break;case jn.TRANSFORM:switch(t[2]){case $h.MOVE:return to.deserialize(t,n);case $h.RESIZE:return ao.deserialize(t,n);case $h.ROTATE:return bo.deserialize(t,n)}break;case jn.GESTURE:return We.deserialize(t,n);case jn.MISC:switch(t[2]){case Ve.GESTURE:return We.deserialize(t,n);case Ve.SHOW_HIDE_LAYER:return Gh.deserialize(t,n);case Ve.GESTURE_LAYER:return We.deserialize(t,n);case Ve.EXECUTE:return ku.deserialize(t,n);default:return Au.deserialize(t,n)}}return null},mo={},wo=function(t){try{var n=JSON.parse(t);return mt(n)&&2<=n.length?n:null}catch(t){return null}},po=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];Ot(e)&&(i.gradient=function(t){var n=function(t){try{return JSON.parse(t)}catch(t){return null}}(t);if(!(null==n||n.length<7)){for(var i=n[0],r=[],e=1,u=n.length;e<u;e+=3)r.push({color:n[e+0],alpha:n[e+1],position:n[e+2]});return{points:r,direction:i}}}(e))}},Oo={},Do=function(t){var n=Oo[t];if(null!=n)return n instanceof HTMLImageElement?Promise.resolve(n):n;var i=new Promise((function(n,i){var r=document.createElement("img");r.onload=function(){Oo[t]=r,n(r)},r.onabort=r.onerror=function(){i()},r.src=t}));return Oo[t]=i,i},Eo=function(t,n,i){var r=n.resources;i.id=r[t[1]]||"";var e=i.transform;e.position.set(t[2],t[3]),e.rotation=t[6],e.skew.set(t[7],t[7]),e.pivot.set(t[21],t[22]),i.size.set(Ir(t[4]),Ir(t[5])),i.fill.deserialize(t[8],n),i.stroke.deserialize(t[9],n);var u=t[10];i.cursor=0<=u?r[u]:void 0,i.text.deserialize(t[11],n),i.data.deserialize(t[12],n),i.radius=t[13],i.corner=t[14];var s=t[23];i.interactive=!!(1&s);var h=i.state;h.isFocusable=!(2&s),h.isActive=!!(4&s);var o=t[24];i.shortcut=0<=o?r[o]:void 0;var a=t[25];i.title=0<=a?r[a]:void 0;var c=t[26];i.uuid=null!=c?c:0;var f=t[27],l=t[28],v=t[29];(null!=f&&f!==Ct.NONE||null!=l&&l!==Ct.NONE||null!=v&&v!==Ct.NONE)&&i.capability.set(f,l,v);var b=function(t,n,i){if(0<t.length){for(var r=[],e=0,u=t.length;e<u;++e)r.push(Pr(t[e],n));return Promise.all(r).then((function(t){i.children=t;for(var n=0,r=t.length;n<r;++n)t[n].parent=i;return i.onChildTransformChange(),i.toDirty(),i}))}return null}(t[20],n,i);!function(t,n,i){for(var r=i.action,e=n.resources,u=0,s=t.length;u<s;++u){var h=t[u],o=n.getAction(h);if(null!=o)r.add(o);else{var a=e[h];if(null!=a){var c=wo(a);if(null!=c&&0<c.length){var f=c[0],l=jn.EXTENSION<=f?mo[f]:go;if(null!=l){var v=l(c,n);null!=v&&(n.setAction(h,v),r.add(v))}}}}}}(t[17],n,i),po(t[19],n,i);var d=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];if(Ot(e))return Do(e).then((function(t){return i.image=t,i}))}return null}(t[18],n,i);return null!=b?null!=d?Promise.all([b,d]).then((function(){return i})):b:null!=d?d:i},Mo=function(t,n,i){i=i||new en;var r=Eo(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=z.NON_SCALING_MASK|z.DOTTED_MASK|z.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},So=function(){e[r.BAR]=hn,n[r.BAR]=Mo},To={},jo=36,No=[0,0,0],Io=new t.Point,Co=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+2,t[++r]=n+1,t[++r]=n+3,t[++r]=n+2,t[++r]=n+4,t[++r]=n+5,t[++r]=n+6,t[++r]=n+5,t[++r]=n+7,t[++r]=n+6,t[++r]=n+8,t[++r]=n+9,t[++r]=n+10,t[++r]=n+9,t[++r]=n+11,t[++r]=n+10,t[++r]=n+12,t[++r]=n+13,t[++r]=n+14,t[++r]=n+13,t[++r]=n+15,t[++r]=n+14,t[++r]=n+16,t[++r]=n+17,t[++r]=n+20,t[++r]=n+17,t[++r]=n+21,t[++r]=n+20,t[++r]=n+17,t[++r]=n+18,t[++r]=n+21,t[++r]=n+18,t[++r]=n+22,t[++r]=n+21,t[++r]=n+19,t[++r]=n+21,t[++r]=n+24,t[++r]=n+21,t[++r]=n+25,t[++r]=n+24,t[++r]=n+21,t[++r]=n+23,t[++r]=n+26,t[++r]=n+23,t[++r]=n+27,t[++r]=n+26,t[++r]=n+24,t[++r]=n+25,t[++r]=n+28,t[++r]=n+25,t[++r]=n+30,t[++r]=n+28,t[++r]=n+26,t[++r]=n+27,t[++r]=n+30,t[++r]=n+27,t[++r]=n+32,t[++r]=n+30,t[++r]=n+29,t[++r]=n+30,t[++r]=n+33,t[++r]=n+30,t[++r]=n+34,t[++r]=n+33,t[++r]=n+30,t[++r]=n+31,t[++r]=n+34,t[++r]=n+31,t[++r]=n+35,t[++r]=n+34},Ao=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.abs(l),d=Math.abs(v),g=o*Math.min(b,d),m=g/b,w=g/d,p=Io;p.set(i-l,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r-v),a.apply(p,p);var M=p.x,S=p.y,T=M-D,j=S-E,N=m*T,I=m*j,C=D+N,A=E+I,R=M+T,k=S+j,L=R-N,y=k-I;p.set(i,r),a.apply(p,p);var x=p.x,B=p.y,_=x-M,P=B-S,F=w*_,U=w*P,G=M+F,H=S+U,z=G-T,V=H-j,W=z+N,X=V+I,K=G+T,Y=H+j,J=K-N,Z=Y-I,q=x-T,Q=B-j,$=x+T,tt=B+j,nt=x+_,it=B+P,rt=nt-F,et=it-U,ut=rt-T,st=et-j,ht=ut+N,ot=st+I,at=rt+T,ct=et+j,ft=at-N,lt=ct-I,vt=nt-T,bt=it-j,dt=vt+N,gt=bt+I,mt=nt+T,wt=it+j,pt=mt-N,Ot=wt-I;c[0]=O(D,E,C,A),c[1]=O(D,E,M,S),c[2]=O(D,E,q,Q);var Dt=2*n-1;t[++Dt]=D,t[++Dt]=E,t[++Dt]=C,t[++Dt]=A,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=L,t[++Dt]=y,t[++Dt]=R,t[++Dt]=k,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=vt,t[++Dt]=bt,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=pt,t[++Dt]=Ot,t[++Dt]=mt,t[++Dt]=wt,t[++Dt]=C,t[++Dt]=A,t[++Dt]=M,t[++Dt]=S,t[++Dt]=L,t[++Dt]=y,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=G,t[++Dt]=H,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=q,t[++Dt]=Q,t[++Dt]=x,t[++Dt]=B,t[++Dt]=x,t[++Dt]=B,t[++Dt]=$,t[++Dt]=tt,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=rt,t[++Dt]=et,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=nt,t[++Dt]=it,t[++Dt]=pt,t[++Dt]=Ot},Ro=function(t,n,i,r){var e=3*n-1,u=1-r[0]/r[1],s=1-r[0]/r[2];i&ut.TOP_LEFT?(t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1):(t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0),i&ut.TOP_RIGHT?(t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1):(t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0),i&ut.BOTTOM_LEFT?(t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&ut.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0),t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0},ko=function(t,n,i,r,e,u,s){var h,a,c,f,l,v,b,d,g,m,w,p,O=o(e),D=s[0],E=s[1],M=s[2],S=Math.max(0,1-s[0]/s[1]),T=Math.max(0,1-s[0]/s[2]);r&qt.TOP?(h=2,a=1,c=1+T):(h=-2,a=-1,c=-1-T),r&qt.RIGHT?(f=2,l=1,v=1+S):(f=-2,l=-1,v=-1-S),r&qt.BOTTOM?(b=2,d=1,g=1+T):(b=-2,d=-1,g=-1-T),r&qt.LEFT?(m=2,w=1,p=1+S):(m=-2,w=-1,p=-1-S);var j=6*n-1;u&ut.TOP_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c),u&ut.TOP_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c),u&ut.BOTTOM_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b),u&ut.BOTTOM_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=b),t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b},Lo=function(t,n,i,r){var e=i.x0,u=i.x1,s=i.x2,h=i.x3,o=i.y0,a=i.y1,c=i.y2,f=i.y3,l=.5*(e+u),v=.5*(o+a),b=.5*(h+s),d=.5*(f+c),g=.5*r[0]/r[1],m=.5*r[0]/r[2],w=g*(u-e),p=g*(a-o),O=m*(h-e),D=m*(f-o),E=2*n-1;t[++E]=e,t[++E]=o,t[++E]=e+w,t[++E]=o+p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+w+O,t[++E]=o+p+D,t[++E]=u-w,t[++E]=a-p,t[++E]=u,t[++E]=a,t[++E]=u-w+O,t[++E]=a-p+D,t[++E]=u+O,t[++E]=a+D,t[++E]=h-O,t[++E]=f-D,t[++E]=h+w-O,t[++E]=f+p-D,t[++E]=h,t[++E]=f,t[++E]=h+w,t[++E]=f+p,t[++E]=s-w-O,t[++E]=c-p-D,t[++E]=s-O,t[++E]=c-D,t[++E]=s-w,t[++E]=c-p,t[++E]=s,t[++E]=c,t[++E]=e+w,t[++E]=o+p,t[++E]=l,t[++E]=v,t[++E]=u-w,t[++E]=a-p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+O+w,t[++E]=o+D+p,t[++E]=l+O,t[++E]=v+D,t[++E]=u+O-w,t[++E]=a+D-p,t[++E]=u+O,t[++E]=a+D;var M=.5*(e+s),S=.5*(o+c);t[++E]=.5*(e+h),t[++E]=.5*(o+f),t[++E]=M,t[++E]=S,t[++E]=M,t[++E]=S,t[++E]=.5*(u+s),t[++E]=.5*(a+c),t[++E]=h-O,t[++E]=f-D,t[++E]=h-O+w,t[++E]=f-D+p,t[++E]=b-O,t[++E]=d-D,t[++E]=s-O-w,t[++E]=c-D-p,t[++E]=s-O,t[++E]=c-D,t[++E]=h+w,t[++E]=f+p,t[++E]=b,t[++E]=d,t[++E]=s-w,t[++E]=c-p},yo=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Co(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=n.radius,s=r!==this.sizeX||e!==this.sizeY||u!==this.radius,h=X(n),o=this.transformLocalId!==h,a=n.stroke,c=a.align,f=a.enable?a.width:0,l=a.side,v=a.style,b=this.strokeAlign!==c||this.strokeWidth!==f||this.strokeSide!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=K(n),w=Y(m),p=m!==this.texture||w!==this.textureTransformId,O=s||b;if(O||o||g||p){this.sizeX=r,this.sizeY=e,this.radius=u,this.transformLocalId=h,this.strokeAlign=c,this.strokeWidth=f,this.strokeSide=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Ao(t.vertices,D,0,0,r,e,c,f,u,n.transform.internalTransform,No),(O||g||o)&&(t.updateSteps(),ko(t.steps,D,f,l,v,d,No)),(O||g)&&(t.updateClippings(),Ro(t.clippings,D,d,No)),(O||p)&&(t.updateUvs(),Lo(t.uvs,D,J(m),No))}},n}(W),xo=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=jo+h,c=24+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new yo(i,r,a-h,c-o),new sn(i+jo,r+24,h,o)]).init(n):null},Bo=function(t,n,i,r,e){return xo(t,n,i,r)},_o=function(t,n,i,r,e,u){var s=-i+e;if(t<=s)return n<=(h=-r+e)&&u&ut.TOP_LEFT?(a=t-s)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&ut.BOTTOM_LEFT?(a=t-s)*a+(c=n-o)*c<=e*e:-i<=t;var h,o,a,c,f=+i-e;return f<=t?n<=(h=-r+e)&&u&ut.TOP_RIGHT?(a=t-f)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&ut.BOTTOM_RIGHT?(a=t-f)*a+(c=n-o)*c<=e*e:t<=+i:-r<=n&&n<=+r},Po=function(t,n,i,r,e,u,s){var h=t.fill;if(h.enable||0<u){var o=t.radius*Math.min(r,e),a=t.corner;if(_o(n,i,r,e,o,a)){if(h.enable)return!0;var c=u*s,f=Math.max(0,r-c),l=Math.max(0,e-c),v=Math.max(0,o-c);if(!_o(n,i,f,l,v,a)){var b=t.stroke.side;if(b===qt.ALL)return!0;if(n<=-f+v){var d=!!(b&qt.LEFT);return i<=-l+v?!(!(g=!!(b&qt.TOP))||!d)||(g?-f<=i:!!d&&n<=-f):+l-v<=i?!(!(m=!!(b&qt.BOTTOM))||!d)||(m?+f<=i:!!d&&n<=-f):d}if(+f-v<=n){var g,m,w=!!(b&qt.RIGHT);return i<=-l+v?!(!(g=!!(b&qt.TOP))||!w)||(g?-f<=i:!!w&&+f<=n):+l-v<=i?!(!(m=!!(b&qt.BOTTOM))||!w)||(m?+f<=i:!!w&&+f<=n):w}return i<=-l+v?!!(b&qt.TOP):+l-v<=i&&!!(b&qt.BOTTOM)}}}return!1},Fo=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Po(this,n,i,r,e,u,s)},n}(Jt),Uo=function(t){function n(n){void 0===n&&(n=r.BUTTON);var i=t.call(this,n)||this;return i.wh=!1,i.Oh=!1,i}return _(n,t),Object.defineProperty(n.prototype,"isToggle",{get:function(){return this.wh},set:function(t){this.wh=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return this.Oh},set:function(t){this.Oh=t},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.wh?1:0,e=this.Oh?2:0;return i[15]=n.addResource("[".concat(r|e,"]")),i},n}(Fo),Go=function(t,n,i){i=i||new Uo;var r=n.resources,e=t[15];if(0<=e&&e<r.length){var u=n.getExtension(e);null==u&&(u=JSON.parse(r[e]),n.setExtension(e,u)),i.isToggle=!!(1&u[0]),i.isGrouped=!!(2&u[0])}return Eo(t,n,i)},Ho=function(t){function n(n){var i=t.call(this,cn.COLOR_FILL_AND_STROKE|cn.COLOR_TEXT|cn.COLOR_TEXT_OUTLINE|cn.CURSOR)||this,r=n.fill,e=r.color,u=i.toOnHovered(e),s=2*u;i.Qh=e,i.$h=an.toGrayscale(e),i.no=an.darken(e,s),i.io=an.darken(e,u);var h=r.alpha;i.ro=h,i.eo=.5*h;var o=n.stroke,a=o.color,c=i.toOnHovered(a),f=2*c;i.uo=a,i.so=an.toGrayscale(a),i.ho=an.darken(a,f),i.oo=an.darken(a,c);var l=o.alpha;i.ao=l,i.co=.5*l;var v=n.text,b=v.color;i.ah=b,i.fo=an.toGrayscale(b);var d=v.alpha;i.fh=d,i.lo=.5*d;var g=v.outline,m=g.color;i.vo=m,i.bo=an.toGrayscale(m);var w=g.alpha;return i.do=w,i.mo=.5*w,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=an.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.$h:t.isPressed||t.isActive?this.no:t.isFocused||t.isHovered?this.io:this.Qh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.eo:this.ro},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.so:t.isPressed||t.isActive?this.ho:t.isFocused||t.isHovered?this.oo:this.uo},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.co:this.ao},n.prototype.getTextColor=function(t){return t.inDisabled?this.fo:this.ah},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.lo:this.fh},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.bo:this.vo},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.mo:this.do},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(bn),zo=function(t){function n(n){var i=t.call(this,cn.COLOR_FILL_AND_STROKE|cn.COLOR_TEXT|cn.COLOR_TEXT_OUTLINE|cn.CURSOR)||this,r=n.fill,e=r.color;i.wo=e;var u=i.toOnHovered(e),s=2*u;i.po=an.darken(e,s),i.Oo=an.darken(e,u);var h=15197671;i.Qh=h;var o=i.toOnHovered(h),a=2*o;i.no=an.darken(h,a),i.io=an.darken(h,o);var c=r.alpha;i.ro=c,i.eo=.5*c;var f=n.stroke,l=f.color;i.Do=l;var v=i.toOnHovered(l),b=2*v;i.Eo=an.darken(l,b),i.Mo=an.darken(l,v);var d=15197671;i.uo=d;var g=i.toOnHovered(d),m=2*g;i.ho=an.darken(d,m),i.So=an.darken(d,g);var w=f.alpha;i.ao=w,i.co=.5*w;var p=n.text,O=p.color;i.To=O,i.fo=an.toGrayscale(O),i.ah=5197647;var D=p.alpha;i.fh=D,i.lo=.5*D;var E=p.outline,M=E.color;i.vo=M,i.bo=an.toGrayscale(M);var S=E.alpha;return i.do=S,i.mo=.5*S,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=an.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.Qh:t.isActive?t.isPressed?this.po:t.isFocused||t.isHovered?this.Oo:this.wo:t.isPressed?this.no:t.isFocused||t.isHovered?this.io:this.Qh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.eo:this.ro},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.uo:t.isActive?t.isPressed?this.Eo:t.isFocused||t.isHovered?this.Mo:this.Do:t.isPressed?this.ho:t.isFocused||t.isHovered?this.So:this.uo},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.co:this.ao},n.prototype.getTextColor=function(t){return t.inDisabled?this.fo:t.isActive?this.To:this.ah},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.lo:this.fh},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.bo:this.vo},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.mo:this.do},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(bn),Vo=function(t){function n(n){var i=t.call(this,n)||this;return n instanceof Uo&&(i.wh=n.isToggle,i.Oh=n.isGrouped),i}return _(n,t),n.prototype.isActionable=function(){return!0},n.prototype.initialize=function(n){this.actions.unshift(this.wh?new zo(this):new Ho(this)),t.prototype.initialize.call(this,n)},n.prototype.onClick=function(n,i){var r=n.state,e=r.isClicked;r.lock(),t.prototype.onClick.call(this,n,i),!e&&r.isClicked&&(this.wh?r.isActive=!r.isActive:r.isActive||(r.isActivated=!0)),r.unlock()},n.prototype.onStateChange=function(n,i,r){t.prototype.onStateChange.call(this,n,i,r),this.wh&&this.Oh&&i.is(Mt.ACTIVATED)&&this.onActivated(n)},n.prototype.onActivated=function(t){var n=t.parent;if(null!=n)for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u instanceof Uo&&u.isToggle&&u.isGrouped&&(u.state.isActive=!1)}},n}(su),Wo=function(){e[r.BUTTON]=Bo,n[r.BUTTON]=Go,To[r.BUTTON]=Vo,jr.set(r.BUTTON,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},Xo=[0,0],Ko=new t.Point,Yo=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1},Jo=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Zo=function(t,n,i,r,e,u,s,h,o,a){var c=Ko,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D+(D-g),S=E+(E-m),T=D-w,j=E-p,N=2*n-1;t[++N]=b,t[++N]=d,t[++N]=g,t[++N]=m,t[++N]=g+w,t[++N]=m+p,t[++N]=T,t[++N]=j,t[++N]=D,t[++N]=E,t[++N]=D+w,t[++N]=E+p,t[++N]=M-w,t[++N]=S-p,t[++N]=M,t[++N]=S,t[++N]=M+w,t[++N]=S+p,a[0]=O(b,d,g,m),a[1]=O(b,d,T,j)},qo=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<9;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},Qo=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a),t[++f]=s,t[++f]=c,t[++f]=.5*(s+u),t[++f]=.5*(c+a),t[++f]=u,t[++f]=a},$o=function(t){function n(n,i){return t.call(this,n,i,9,8)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;Yo(t.clippings,n),Jo(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),Zo(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,Xo),qo(t.steps,t.clippings,this.vertexOffset,c,f,Xo))},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=J(i);Qo(t.uvs,this.vertexOffset,e)}},n}(W),ta=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new $o(i,r),new sn(i+9,r+8,h,o)]).init(n):null},na=function(t){function n(n){return void 0===n&&(n=r.CIRCLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Zt(this,n,i,r,e,u,s)},n}(Jt),ia=function(t,n,i){return Eo(t,n,i||new na)},ra=function(){e[r.CIRCLE]=ta,n[r.CIRCLE]=ia},ea=new t.Point,ua=function(t){return t?t.formatted.length:0},sa=function(t){return 12*Math.ceil(ua(t)/12)},ha=function(t,n){return n?4*t+2:4*t},oa=function(t,n){return ha(t,n)-2},aa=function(t,n,i,r){for(var e=3*n-1,u=3*(n+i)-1,s=0;s<r;++s)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5,t[++e]=1,t[++e]=0,t[++e]=4,t[++e]=0,t[++e]=1,t[++e]=6;for(;e<u;)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5},ca=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s+0,t[++e]=s+2,t[++e]=s+1,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=2},fa=function(t,n,i,r,e,u){for(var s=1/Math.max(1e-5,u),h=e.x0,o=e.x1,a=e.x2,c=e.x3,f=e.y0,l=e.y1,v=e.y2,b=e.y3,d=o-h,g=l-f,m=a-c,w=v-b,p=(i<<1)-1,O=(i+r<<1)-1,D=(i<<2)-8;p<O;){var E=n[D+=8]*s;t[++p]=h+E*d,t[++p]=f+E*g,t[++p]=c+E*m,t[++p]=b+E*w}},la=function(t,n,i,r,e,u,s,h,o,a,c,f){var l=H;null==l&&(H=l=[]);for(var v=f.a,b=f.b,d=f.c,g=f.d,m=f.tx,w=f.ty,p=0;p<u;++p){var O=p<<1,D=h[O],E=h[O+1];l[O]=v*D+d*E+m,l[O+1]=b*D+g*E+w}return ba(t,n,i,r,e,u,s,l,o,a,c)},va=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=1]=b,n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=4]=b},ba=function(t,n,i,r,e,u,s,h,o,a,c){var f=o.length;if(0<f){if(s){for(var l=0,v=0,b=r,d=0,g=o[0],m=1;m<f;++m)2<=(d=o[m])-g&&(v=ga(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=ha(d-g,!1)),g=d;return 2<=(d=o[0]+u)-g?(v=ga(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=ha(d-g,!1)):da(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}for(l=0,v=0,b=r,2<=(d=o[0])&&(v=ga(t,n,i,b,-1,h,0,d,u,a,c,v),l=Math.max(l,v),b+=ha(d,!1)),g=d,m=1;m<f;++m)2<=(d=o[m])-g&&(v=ga(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=ha(d-g,!1)),g=d;return 2<=(d=u)-g?(v=ga(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=ha(d-g,!1)):da(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}return s?ma(t,n,i,r,e,h,0,u,u,a,c):ga(t,n,i,r,e,h,0,u,u,a,c,0)},da=function(t,n,i,r,e,u,s,h,a,c,f,l){if(0<=e)for(var v=o(f),b=(r<<1)-1,d=6*r-1,g=(r<<2)-1,m=(r+e<<1)-1,w=s%a<<1,p=u[w],O=u[w+1];b<m;)t[++b]=p,t[++b]=O,n[++d]=0,n[++d]=v,n[++d]=-1,n[++d]=0,n[++d]=1,n[++d]=0,i[++g]=l,i[++g]=0,i[++g]=0,i[++g]=l;return 0},ga=function(t,n,i,r,e,u,s,a,c,f,l,v){var b=o(l),d=s%c<<1,g=u[d],m=u[d+1],w=(s+1)%c<<1,p=u[w],D=u[w+1],E=g-(p-g),M=m-(D-m),S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=0;va(S,t,T,n,j,i,g,m,f,b,E,M,p,D,v),va(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;for(var I=s+1,C=a-1;I<C;++I){E=g,M=m,g=p,m=D;var A=(I+1)%c<<1;p=u[A],D=u[A+1],N+=O(E,M,g,m),va(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),va(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8}E=g,M=m,p=(g=p)+(g-E),D=(m=D)+(m-M),N+=O(E,M,g,m),va(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),va(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;var R=h(N,f,l,ea),k=R.x,L=R.y,y=(r<<2)-1;for(I=y,C=y+8;I<C;I+=4)i[I+2]=k,i[I+3]=L,i[I+4]=v;for(I=y+8;I<j;I+=4)i[I+2]=k,i[I+3]=L,i[I+4]=N;if(0<=e)for(var x=(r+e<<1)-1;S<x;)t[++S]=g,t[++S]=m,n[++T]=0,n[++T]=b,n[++T]=E,n[++T]=M,n[++T]=p,n[++T]=D,i[++j]=N,i[++j]=k,i[++j]=L,i[++j]=N;return N},ma=function(t,n,i,r,e,u,s,a,c,f,l){for(var v=o(l),b=(a-1)%c<<1,d=0,g=0,m=u[b],w=u[b+1],p=s%c<<1,D=u[p],E=u[p+1],M=0,S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=s;N<a;++N){d=m,g=w,m=D,w=E;var I=(N+1)%c<<1;D=u[I],E=u[I+1],M+=O(d,g,m,w),va(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),va(S+=4,t,T+=12,n,j+=8,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8}d=m,g=w,m=D,w=E;var C=(s+1)%c<<1;D=u[C],E=u[C+1],M+=O(d,g,m,w),va(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8;var A=h(M,f,l,ea),R=A.x,k=A.y;for(N=(r<<2)-1;N<j;N+=4)i[N+2]=R,i[N+3]=k,i[N+4]=-1;if(0<=e)for(var L=(r+e<<1)-1;S<L;)t[++S]=m,t[++S]=w,n[++T]=f,n[++T]=v,n[++T]=d,n[++T]=g,n[++T]=D,n[++T]=E,i[++j]=M,i[++j]=R,i[++j]=k,i[++j]=-1;return M},wa=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.pointId=-1,u.pointCount=0,u.pointsClosed=!1,u.length=1,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),ca(t.indices,this.vertexOffset,this.indexOffset,this.indexCount)},n.prototype.isCompatible=function(t){return ha(sa(t.points),!0)===this.vertexCount},n.prototype.update=function(t,n){this.updateLineClipping(t,n),this.updateLineVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateLineUv(t,n)},n.prototype.updateLineClipping=function(t,n){var i=n.points;if(i){var r=i.formatted.length;this.pointCount!==r&&(this.pointCount=r,this.pointId=-1,t.updateClippings(),aa(t.clippings,this.vertexOffset,this.vertexCount,r))}},n.prototype.updateLineVertexStepAndColorFill=function(t,n){var i=n.points;if(i){var r=i.id,e=i.formatted,u=!!(e.style&z.CLOSED),s=r!==this.pointId||u!==this.pointsClosed,h=n.stroke,o=h.enable?h.width:0,a=h.style,c=this.strokeWidth!==o||this.strokeStyle!==a,f=X(n),l=this.transformLocalId!==f;(s||l||c)&&(this.pointId=r,this.pointsClosed=u,this.strokeWidth=o,this.strokeStyle=a,this.transformLocalId=f,s&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),this.length=la(t.vertices,t.steps,t.colorFills,this.vertexOffset,this.vertexCount,this.pointCount,this.pointsClosed,e.values,e.segments,o,a,n.transform.internalTransform))}},n.prototype.updateLineUv=function(t,n){var i=K(n),r=Y(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),fa(t.uvs,t.colorFills,this.vertexOffset,this.vertexCount,J(i),this.length))},n}(W),pa=[0,0,0],Oa=new t.Point,Da=function(t,n){var i=3*n-1;t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0},Ea=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+2,t[++r]=n+0,t[++r]=n+3,t[++r]=n+4,t[++r]=n+0,t[++r]=n+5,t[++r]=n+6},Ma=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=2*f*l/(f+Math.sqrt(f*f+4*l*l)),b=Oa;b.set(i,r-l),o.apply(b,b);var d=b.x,g=b.y;b.set(i,r),o.apply(b,b);var m=b.x,w=b.y;b.set(i+f,r),o.apply(b,b);var p=m-d,D=w-g,E=b.x+p,M=b.y+D,S=m+(m-b.x)+p,T=w+(w-b.y)+D;b.set(i,r+l-v),o.apply(b,b);var j=b.x,N=b.y,I=m+p,C=w+D;a[0]=O(I,C,j,N),a[1]=O(E,M,I,C),a[2]=O(d,g,m,w);var A=(n<<1)-1;t[++A]=j,t[++A]=N,t[++A]=d,t[++A]=g,t[++A]=E,t[++A]=M,t[++A]=E,t[++A]=M,t[++A]=S,t[++A]=T,t[++A]=S,t[++A]=T,t[++A]=d,t[++A]=g},Sa=function(t,n,i,r,e,u,s){for(var h=o(u),a=s[0],c=6*i-1,f=3*i,l=0;l<r;l+=1,f+=3)t[++c]=e,t[++c]=h,t[++c]=a,t[++c]=a,t[++c]=1+n[f],t[++c]=1+n[f+1]},Ta=function(t,n,i,r){var e=n.x0,u=n.x1,s=n.x2,h=n.x3,o=n.y0,a=n.y1,c=n.y2,f=n.y3,l=.5*(e+u),v=.5*(o+a),b=1-.5*r[0]/r[2],d=l+b*(h-e),g=v+b*(f-o),m=(i<<1)-1;t[++m]=d,t[++m]=g,t[++m]=l,t[++m]=v,t[++m]=s,t[++m]=c,t[++m]=s,t[++m]=c,t[++m]=h,t[++m]=f,t[++m]=h,t[++m]=f,t[++m]=l,t[++m]=v},ja=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.updateColorFill=function(t,n){var i=n.points;if(null!=i){var r=i.getMarker();if(null!=r){var e=this.toMarker(r).fill,u=n.visible&&e.enable,s=e.color,h=u?e.alpha:0;s===this.colorFill&&h===this.alphaFill||(this.colorFill=s,this.alphaFill=h,t.updateColorFills(),V(s,h,this.vertexOffset,this.vertexCount,t.colorFills))}}},n}(W),Na=function(n){function i(t,i){var r=n.call(this,t,i,7,3)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices(),Da(t.clippings,this.vertexOffset),Ea(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=X(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=K(r),O=Y(p),D=p!==this.texture||O!==this.textureTransformId,E=f||w,M=u.id,S=M!==this.pointId;if(E||v||D||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.texture=p,this.textureTransformId=O,this.pointId=M;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),Ma(n.vertices,T,0,0,a,c,d,g,j,pa),(E||v)&&(n.updateSteps(),Sa(n.steps,n.clippings,T,7,g,m,pa)),(E||D)&&(n.updateUvs(),Ta(n.uvs,J(p),T,pa))}}}},i}(ja),Ia=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Na),Ca=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Na),Aa=function(n){function i(t,i){var r=n.call(this,t,i,9,8)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;Yo(t.clippings,n),Jo(t.indices,n,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},i.prototype.updateVertexAndStep=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=X(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=u.id,O=p!==this.pointId;if(f||v||w||O){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.pointId=p;var D=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;D.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),n.updateSteps(),Zo(n.vertices,this.vertexOffset,0,0,a,c,d,g,D,Xo),qo(n.steps,n.clippings,this.vertexOffset,g,m,Xo)}}}},i.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=J(i);Qo(t.uvs,this.vertexOffset,e)}},i}(ja),Ra=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Aa),ka=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Aa),La=function(){function n(t,n){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=0,this.indexCount=0,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=K(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),ya=24,xa=16,Ba=[0,0,0,0],_a=new t.Point,Pa=function(t,n,i){var r=1-i[0],e=1-i[1],u=3*n-1;t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0},Fa=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+4,t[++r]=n+4,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+5,t[++r]=n+2,t[++r]=n+3,t[++r]=n+8,t[++r]=n+6,t[++r]=n+9,t[++r]=n+9,t[++r]=n+6,t[++r]=n+7,t[++r]=n+9,t[++r]=n+7,t[++r]=n+10,t[++r]=n+10,t[++r]=n+7,t[++r]=n+11,t[++r]=n+12,t[++r]=n+16,t[++r]=n+13,t[++r]=n+13,t[++r]=n+16,t[++r]=n+17,t[++r]=n+13,t[++r]=n+17,t[++r]=n+14,t[++r]=n+14,t[++r]=n+17,t[++r]=n+15,t[++r]=n+18,t[++r]=n+20,t[++r]=n+21,t[++r]=n+18,t[++r]=n+21,t[++r]=n+22,t[++r]=n+18,t[++r]=n+22,t[++r]=n+19,t[++r]=n+19,t[++r]=n+22,t[++r]=n+23},Ua=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=_a;v.set(i-f,r-l),o.apply(v,v);var b=v.x,d=v.y;v.set(i+f,r-l),o.apply(v,v);var g=v.x,m=v.y;v.set(i+f,r+l),o.apply(v,v);var w=v.x,p=v.y,D=b+(w-g),E=d+(p-m),M=.5*O(b,d,g,m),S=.5*O(g,m,w,p),T=1,j=1;M<=S?j=M/S:T=S/M,a[0]=T,a[1]=j,a[2]=M,a[3]=S;var N=T*(g-b)*.5,I=T*(m-d)*.5,C=j*(D-b)*.5,A=j*(E-d)*.5,R=(n<<1)-1;t[++R]=b,t[++R]=d,t[++R]=b+N,t[++R]=d+I,t[++R]=g-N,t[++R]=m-I,t[++R]=g,t[++R]=m,t[++R]=b+N+C,t[++R]=d+I+A,t[++R]=g-N+C,t[++R]=m-I+A,t[++R]=D+N-C,t[++R]=E+I-A,t[++R]=w-N-C,t[++R]=p-I-A,t[++R]=D,t[++R]=E,t[++R]=D+N,t[++R]=E+I,t[++R]=w-N,t[++R]=p-I,t[++R]=w,t[++R]=p,t[++R]=b,t[++R]=d,t[++R]=b+C,t[++R]=d+A,t[++R]=D-C,t[++R]=E-A,t[++R]=D,t[++R]=E,t[++R]=b+C+N,t[++R]=d+A+I,t[++R]=D-C+N,t[++R]=E-A+I,t[++R]=g+C-N,t[++R]=m+A-I,t[++R]=w-C-N,t[++R]=p-A-I,t[++R]=g,t[++R]=m,t[++R]=g+C,t[++R]=m+A,t[++R]=w-C,t[++R]=p-A,t[++R]=w,t[++R]=p},Ga=function(t,n,i,r,e,u){var s,h,a,c,f,l,v,b,d=o(e),g=u[0],m=u[1],w=Math.max(0,1-g),p=Math.max(0,1-m),O=u[2],D=u[3];r&qt.TOP?(s=2,h=1+p):(s=-2,h=-1-p),r&qt.RIGHT?(a=2,c=1+w):(a=-2,c=-1-w),r&qt.BOTTOM?(f=2,l=1+p):(f=-2,l=-1-p),r&qt.LEFT?(v=2,b=1+w):(v=-2,b=-1-w);var E=6*(t-1)-1;Ha(n,E+=6,i,d,O,D,v,s),Ha(n,E+=6,i,d,O,D,b,s),Ha(n,E+=6,i,d,O,D,c,s),Ha(n,E+=6,i,d,O,D,a,s),Ha(n,E+=6,i,d,O,D,b,h),Ha(n,E+=6,i,d,O,D,c,h),Ha(n,E+=6,i,d,O,D,b,l),Ha(n,E+=6,i,d,O,D,c,l),Ha(n,E+=6,i,d,O,D,v,f),Ha(n,E+=6,i,d,O,D,b,f),Ha(n,E+=6,i,d,O,D,c,f),Ha(n,E+=6,i,d,O,D,a,f),Ha(n,E+=6,i,d,O,D,v,s),Ha(n,E+=6,i,d,O,D,v,h),Ha(n,E+=6,i,d,O,D,v,l),Ha(n,E+=6,i,d,O,D,v,f),Ha(n,E+=6,i,d,O,D,b,h),Ha(n,E+=6,i,d,O,D,b,l),Ha(n,E+=6,i,d,O,D,c,h),Ha(n,E+=6,i,d,O,D,c,l),Ha(n,E+=6,i,d,O,D,a,s),Ha(n,E+=6,i,d,O,D,a,h),Ha(n,E+=6,i,d,O,D,a,l),Ha(n,E+=6,i,d,O,D,a,f)},Ha=function(t,n,i,r,e,u,s,h){t[++n]=i,t[++n]=r,t[++n]=e,t[++n]=u,t[++n]=s,t[++n]=h},za=function(t,n,i,r){var e=i.x0,u=i.y0,s=i.y1,h=i.x1,o=i.y2,a=i.x2,c=i.y3,f=i.x3,l=r[0],v=r[1],b=l*(h-e)*.5,d=l*(s-u)*.5,g=v*(f-e)*.5,m=v*(c-u)*.5,w=(n<<1)-1;t[++w]=e,t[++w]=u,t[++w]=e+b,t[++w]=u+d,t[++w]=h-b,t[++w]=s-d,t[++w]=h,t[++w]=s,t[++w]=e+b+g,t[++w]=u+d+m,t[++w]=h-b+g,t[++w]=s-d+m,t[++w]=f+b-g,t[++w]=c+d-m,t[++w]=a-b-g,t[++w]=o-d-m,t[++w]=f,t[++w]=c,t[++w]=f+b,t[++w]=c+d,t[++w]=a-b,t[++w]=o-d,t[++w]=a,t[++w]=o,t[++w]=e,t[++w]=u,t[++w]=e+g,t[++w]=u+m,t[++w]=f-g,t[++w]=c-m,t[++w]=f,t[++w]=c,t[++w]=e+g+b,t[++w]=u+m+d,t[++w]=f-g+b,t[++w]=c-m+d,t[++w]=h+g-b,t[++w]=s+m-d,t[++w]=a-g-b,t[++w]=o-m-d,t[++w]=h,t[++w]=s,t[++w]=h+g,t[++w]=s+m,t[++w]=a-g,t[++w]=o-m,t[++w]=a,t[++w]=o},Va=function(n){function i(t,i){var r=n.call(this,t,i,ya,xa)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateIndices(),Fa(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexClippingStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=X(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.side,w=b.style,p=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeSide!==m||this.strokeStyle!==w,O=K(r),D=Y(O),E=O!==this.texture||D!==this.textureTransformId,M=f||p,S=u.id!==this.pointId;if(M||v||E||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeSide=m,this.strokeStyle=w,this.texture=O,this.textureTransformId=D;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),Ua(n.vertices,T,0,0,a,c,d,g,j,Ba),(M||v)&&(n.updateSteps(),Ga(T,n.steps,g,m,w,Ba)),M&&(n.updateClippings(),Pa(n.clippings,T,Ba)),(M||E)&&(n.updateUvs(),za(n.uvs,T,J(O),Ba))}}}},i}(ja),Wa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Va),Xa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Va),Ka=function(t){switch(t){case Q.NONE:return 0;case Q.CIRCLE:return 9;case Q.TRIANGLE:return 7;case Q.RECTANGLE:return ya}return 0},Ya=function(t){switch(t){case Q.NONE:return 0;case Q.CIRCLE:return 8;case Q.TRIANGLE:return 3;case Q.RECTANGLE:return xa}return 0},Ja=function(t,n,i){switch(t){case Q.NONE:return new La(n,i);case Q.CIRCLE:return new Ra(n,i);case Q.TRIANGLE:return new Ia(n,i);case Q.RECTANGLE:return new Xa(n,i)}return new La(n,i)},Za=function(t,n,i){switch(t){case Q.NONE:return new La(n,i);case Q.CIRCLE:return new ka(n,i);case Q.TRIANGLE:return new Ca(n,i);case Q.RECTANGLE:return new Wa(n,i)}return new La(n,i)},qa=function(t,n,i,r,e){var s=n.points,h=sa(s),o=ha(h,!0),a=oa(h,!0),c=Q.NONE,f=Q.NONE;if(s&&s instanceof fe){var l=s.getMarker();l&&(c=l.tail.type,f=l.head.type)}var v=Ka(c),b=Ya(c),d=i+o,g=r+a,m=Ka(f),w=Ya(f),p=d+v,O=g+b,D=M(n),E=4*D,S=2*D,T=p+m,j=O+w,N=o+m+v+E,I=a+w+b+S;return t.check(i,r,N,I)?new u(t,i,r,N,I,[new wa(i,r,o,a),Za(c,d,g),Ja(f,p,O),new sn(T,j,E,S)]).init(n):null},Qa=function(){function t(t,n,i){this.jo=1e-6,this._x=t,this._y=n,this._z=0,this.k=i,i[0]=t,i[1]=n,this.index=0}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){if(0===this._z||this.jo<Math.abs(this._x-t)){this._x=t;var n=this.index,i=this.k;1===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=1)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){if(0===this._z||this.jo<Math.abs(this._y-t)){this._y=t;var n=this.index,i=this.k;2===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=2)}},enumerable:!1,configurable:!0}),t.prototype.toAxis=function(t,n,i,r){var e=Math.abs(i),u=Math.abs(r),s=this.jo;if(e<s&&u<s)return Math.abs(t)<Math.abs(n)?0<=n?2:0:0<=t?1:3;var h=.2;return 0<=i?0<=r?h<e&&h<u?t<n?2:1:h<e?1:2:h<e&&h<u?t<-n?0:1:h<e?1:0:0<=r?h<e&&h<u?-t<n?2:3:h<e?3:2:h<e&&h<u?n<t?0:3:h<e?3:0},t.prototype.toTailAxis=function(t,n,i,r){return this.toAxis(t-this.x,n-this.y,i,r)},t.prototype.tail=function(t,n,i,r,e,u,s){switch(this.toTailAxis(t,n,i,r)){case 0:this.y-s<=n?(this.y-=Math.max(s,u),this.x=t):this.y=n;break;case 1:t<=this.x+s?(this.x+=Math.max(s,e),this.y=n):this.x=t;break;case 2:n<=this.y+s?(this.y+=Math.max(s,e),this.x=t):this.y=n;break;case 3:this.x-s<=t?(this.x-=Math.max(s,e),this.y=n):this.x=t}},t.prototype.middle=function(t,n){var i=t-this._x,r=n-this._y;Math.abs(i)<Math.abs(r)?this.y=n:this.x=t},t.prototype.toHeadAxis=function(t,n,i,r){return this.toAxis(this.x-t,this.y-n,i,r)},t.prototype.head=function(t,n,i,r,e,u,s){switch(this.toHeadAxis(t,n,i,r)){case 0:n-s<=this.y&&(this.y=n-Math.max(s,u)),this.x=t,this.y=n;break;case 1:this.x<=t+s&&(this.x=t+Math.max(s,e)),this.y=n,this.x=t;break;case 2:this.y<=n+s&&(this.y=n+Math.max(s,u)),this.x=t,this.y=n;break;case 3:t-s<=this.x&&(this.x=t-Math.max(s,e)),this.y=n,this.x=t}},t.prototype.margin=function(t,n){var i=this.k,r=this.index;if(0!==t&&2<=r){var e=i[0],u=i[1],s=(o=i[2]-e)*o+(a=i[3]-u)*a;if((c=this.jo)<s){var h=t/Math.sqrt(o*o+a*a);c<Math.abs(h-1)?(i[0]=e+o*h,i[1]=u+a*h):this.index-=2}}if(r=this.index,0!==n&&2<=r){var o,a,c,f=i[r+0],l=i[r+1];s=(o=i[r-2]-f)*o+(a=i[r-1]-l)*a,(c=this.jo)<s&&(h=n/Math.sqrt(o*o+a*a),c<Math.abs(h-1)?(i[r+0]=f+o*h,i[r+1]=l+a*h):this.index-=2)}i.length=this.index+2},t}(),$a=function(t){function n(n){return void 0===n&&(n=r.CONNECTOR_ELBOW),t.call(this,n)||this}return _(n,t),n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=t.local,a=o.x,c=o.y,f=t.normal,l=f.x,v=f.y,b=i.local,d=b.x,g=b.y,m=i.normal,w=m.x,p=m.y,O=e.values,D=O.length,E=a-u,M=c-s,S=d-u,T=g-s,j=.5*(S+E),N=.5*(T+M),I=S-E,C=T-M,A=.5*q.SIZE_X,R=.5*q.SIZE_Y,k=1e-6;if(Math.abs(I)<k&&Math.abs(C)<k)h[0]=E,h[1]=M,h[2]=S,h[3]=T,h.length=4;else{var L=new Qa(E,M,h);if(0<D){var y=Math.atan2(C,I),x=Math.sqrt(I*I+C*C),B=Math.cos(y)*x,_=Math.sin(y)*x,P=O[0],F=O[1],U=j+B*P-_*F,G=N+B*F+_*P;L.tail(U,G,l,v,A,R,n);for(var H=2;H<D;H+=2){var z=O[H+0],V=O[H+1],W=j+B*z-_*V,X=N+B*V+_*z;L.middle(W,X)}L.head(S,T,w,p,A,R,r)}else L.tail(j,N,l,v,A,R,n),L.head(S,T,w,p,A,R,r);L.margin(n,r)}},n}(ve),tc=function(t,n,i){return Eo(t,n,i||new $a)},nc=function(){function t(){}return t.from=function(t,n,i){var r=[],e=t.length;if(4<e){var u=1e-6,s=t[0],h=t[1];0!==n&&u<(c=(o=s-t[2])*o+(a=h-t[3])*a)&&(s+=o*(f=n/Math.sqrt(c)),h+=a*f);var o,a,c,f,l=t[e-2],v=t[e-1];0!==i&&u<(c=(o=l-t[e-4])*o+(a=v-t[e-3])*a)&&(l+=o*(f=i/Math.sqrt(c)),v+=a*f);for(var b=.5*(l+s),d=.5*(v+h),g=l-s,m=v-h,w=Math.atan2(m,g),p=Math.cos(w),O=Math.sin(w),D=g*g+m*m,E=u<D?1/Math.sqrt(D):1,M=2,S=e-2;M<S;M+=2){var T=t[M+0]-b,j=t[M+1]-d;r.push((p*T+O*j)*E,(p*j-O*T)*E)}}return r},t}(),ic=function(t,n,i){return Eo(t,n,i||new ve)},rc=function(t,n,i,r){if(n instanceof ve){var e=r.resources,u=t[15];if(0<=u&&u<e.length){var s=r.getExtension(u);null==s&&(s=JSON.parse(e[u]),r.setExtension(u,s)),n.lock();var h=n.points;h.deserialize(s[1],r);var o=n.edge;o.deserialize(s[0],i,r);var a=n.body,c=s[2];null!=c?a.deserialize(c,i,r):a.set(nc.from(h.values,o.tail.margin,o.head.margin)),n.unlock()}}},ec=function(){e[r.CONNECTOR_ELBOW]=qa,n[r.CONNECTOR_ELBOW]=tc,i[r.CONNECTOR_ELBOW]=rc,jr.set(r.CONNECTOR_ELBOW,Ct.CONNECTOR)},uc=function(){e[r.CONNECTOR_LINE]=qa,n[r.CONNECTOR_LINE]=ic,i[r.CONNECTOR_LINE]=rc,jr.set(r.CONNECTOR_LINE,Ct.CONNECTOR)},sc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Fa(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=K(n),d=Y(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Ua(t.vertices,w,.5*r,.5*e,r,e,a,c,n.transform.internalTransform,Ba),(m||h)&&(t.updateSteps(),Ga(w,t.steps,c,f,l,Ba)),m&&(t.updateClippings(),Pa(t.clippings,w,Ba)),(m||g)&&(t.updateUvs(),za(t.uvs,w,J(b),Ba))}},n}(W),hc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=ya+h,c=xa+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new sc(i,r,a-h,c-o),new sn(i+ya,r+xa,h,o)]).init(n):null},oc=function(t,n,i,r){var e=M(n),s=4*e,h=2*e,o=s,a=h;return t.check(i,r,o,a)?new u(t,i,r,o,a,[new sn(i,r,s,h)]).init(n):null},ac=function(t,n){var i=t.data.getMapping();if(null!=i)for(var r=i.values,e=0,u=r.length;e<u;++e){var s=r[e],h=s[0],o=n.getDataMapper(h);if(null!=o){var a=t.children,c=n.getDataDestination(s[1]),f=s[2];cc(a,o,c,f)}}},cc=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){for(var s=t[e],h=s.data,o=0,a=h.size();o<a;++o){var c=h.get(o);c&&c.scope!==_t.PRIVATE&&n.map(c,i,r)}var f=s.children;0<f.length&&cc(f,n,i,r)}},fc=function(t,n,i){var r=n.pieces,e=t[15];if(r&&0<=e&&e<r.length){var u=n.pieceData;if(u){var s=r[e],h=u.get(s),o=i&&i(s,n);return h?function(t,n,i,r,e,u,s){var h=e.mode,o=e.depth;s=s||new Br(t,h,o);var a=Eo(u,e,s),c=s.size,f=c.x,l=c.y;return s.size.set(n,i),r.copyTo(s),s.size.init(),s.size.set(f,l),h===Tr.EDITOR?0<o&&ac(s,e):ac(s,e),a}(s,h.width,h.height,h.layer,n,t,o):function(t,n,i,r){var e=n.mode,u=n.depth;r=r||new Br(t,e,u);var s=Eo(i,n,r),h=r.size,o=h.x,a=h.y,c=r.children,f=new Be("missing",e,u),l=.5*o,v=.5*o;f.transform.position.set(-l,-v),f.size.set(o,a),f.size.init(),f.parent=r;var b=new hu;return b.stroke.color=16711680,b.transform.position.set(l,v),b.size.copyFrom(r.size),b.attach(f),c.push(f),r.onChildTransformChange(),r.toDirty(),r.onAttach(),r.size.init(),e===Tr.EDITOR?0<u&&ac(r,n):ac(r,n),s}(s,n,t,o)}}return null},lc=function(){e[r.EMBEDDED]=oc,n[r.EMBEDDED]=fc,jr.set(r.EMBEDDED,Ct.EMBEDDED),e[r.EMBEDDED_LAYER]=hc},vc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.p.children;return!(0<t.length)||t[t.length-1].fill.enable},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.color:16777215},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.alpha:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.alpha=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.copy(t)},t.prototype.set=function(t,n,i){for(var r=this.p.children,e=0,u=r.length;e<u;++e)r[e].fill.set(t,n,i)},t.prototype.clone=function(){return new t(this.p)},t.prototype.toObject=function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.toObject():{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),bc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"length",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.length}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.id}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.values}return[]},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.values=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.segments}return[]},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.segments=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.style}return z.NONE},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.style=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marker",{get:function(){for(var t=this.p.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.marker}return nt.getInstance()},enumerable:!1,configurable:!0}),t.prototype.getMarker=function(){for(var t=this.p.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.getMarker()}},Object.defineProperty(t.prototype,"formatter",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatter}return null},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.formatter=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formatted",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatted}return this},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&e.copy(t)}return this},t.prototype.set=function(t,n,i){for(var r=this.p.children,e=0,u=r.length;e<u;++e){var s=r[e].points;null!=s&&s.set(t,n,i)}return this},t.prototype.clone=function(n){return new t(n)},t.prototype.toPoints=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.toPoints(t)}return[]},t.prototype.serialize=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.serialize(t)}return-1},t}(),dc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.p.children;return 0<t.length&&t[t.length-1].stroke.enable},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.color:16777215},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.alpha:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.width:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.align:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.side:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.side=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.style:s.NONE},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.style=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.copy(t)},t.prototype.set=function(t,n,i,r,e){for(var u=this.p.children,s=0,h=u.length;s<h;++s)u[s].stroke.set(t,n,i,r,e)},t.prototype.clone=function(){return new t(this.p)},t.prototype.toObject=function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.toObject():{enable:!1,color:16777215,alpha:1,width:1,align:0,side:qt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),gc=function(t){function n(n,i){void 0===i&&(i=r.GROUP);var e=t.call(this,i)||this;e.Fr=n;var u=new Vt;return e.data=u,e.tag=u,e.size=e.newGroupSize(n),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e.jt=e.newGroupPoints(),e}return _(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Fr},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t){var n=q.SIZE_X,i=q.SIZE_Y;return t!==Tr.VIEWER?new Rr(this,n,i,this.isGroupSizeFittable()):new kr(this,n,i,n,i)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newGroupFill=function(){return new vc(this)},n.prototype.newGroupStroke=function(){return new dc(this)},n.prototype.newGroupText=function(){return new Yt(this,q.TEXT_VALUE,q.TEXT_COLOR,q.TEXT_ALPHA,q.TEXT_FAMILY,q.TEXT_SIZE)},n.prototype.newGroupPoints=function(){return new bc(this)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof kr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].corner:ut.ALL},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].corner=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].gradient;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].gradient=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].radius:.5},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].radius=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].image;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].image=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n)if(null!=t[n].points)return this.jt},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Fr,this.type)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Rt),mc=function(t,n,i){i=i||new gc(n.mode);var r=Eo(t,n,i);return i.size.init(),r},wc=function(){e[r.GROUP]=oc,n[r.GROUP]=mc,jr.set(r.GROUP,Ct.GROUP)},pc=function(){function n(n,i,r){this.p=n,this.j=new t.Point(i,r)}return n.prototype.init=function(){return this},Object.defineProperty(n.prototype,"x",{get:function(){return this.j.x},set:function(t){var n=this.j;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.j.y},set:function(t){var n=this.j;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.j,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.j;return new n(this.p,t.x,t.y)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.j,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.j.copyTo(t)},n.prototype.equals=function(t){return this.j.equals(t)},n.prototype.fit=function(){return this},n.prototype.onChange=function(t,n){this.p.onSizeChange()},n}(),Oc=function(t){function n(n,i){return void 0===i&&(i=r.GROUP_SHADOWED),t.call(this,n,i)||this}return _(n,t),n.prototype.newGroupSize=function(n){return n!==Tr.VIEWER?new pc(this,q.SIZE_X,q.SIZE_Y):t.prototype.newGroupSize.call(this,n)},n}(gc),Dc=function(t,n,i){i=i||new Oc(n.mode);var r=Eo(t,n,i);return i.size.init(),r},Ec=function(){e[r.GROUP_SHADOWED]=oc,n[r.GROUP_SHADOWED]=Dc,jr.set(r.GROUP_SHADOWED,Ct.GROUP)},Mc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Fa(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=K(n),d=Y(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Ua(t.vertices,w,0,0,r,e,a,c,n.transform.internalTransform,Ba),(m||h)&&(t.updateSteps(),Ga(w,t.steps,c,f,l,Ba)),m&&(t.updateClippings(),Pa(t.clippings,w,Ba)),(m||g)&&(t.updateUvs(),za(t.uvs,w,J(b),Ba))}},n}(W),Sc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=ya+h,c=xa+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Mc(i,r,a-h,c-o),new sn(i+ya,r+xa,h,o)]).init(n):null},Tc=function(t){function n(n,i){void 0===i&&(i=r.IMAGE);var e=t.call(this,i)||this;return null!=n&&(e.image=n,e.size.set(n.width,n.height)),e.fill.alpha=1,e}return _(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(hu),jc=function(t,n,i){return Eo(t,n,i||new Tc)},Nc=function(){e[r.IMAGE]=Sc,n[r.IMAGE]=jc},Ic=[0,0],Cc=new t.Point,Ac=function(t,n){for(var i=3*n-1,r=3*(n+9)-1;i<r;)t[++i]=0,t[++i]=0,t[++i]=2},Rc=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},kc=function(t,n,i,r,e,u,s,h){var a=o(e),c=u/h[0],f=s/h[1],l=.5*(c+f),v=12,b=-1+i,d=6*n-1;t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0},Lc=function(t,n,i,r,e,u,s,h){var o=Cc,a=.5*e,c=.5*u;o.set(i-a,r-c),s.apply(o,o);var f=o.x,l=o.y;o.set(i+a,r-c),s.apply(o,o);var v=o.x,b=o.y;o.set(i+a,r+c),s.apply(o,o);var d=o.x,g=o.y,m=f+(d-v),w=l+(g-b),p=(n<<1)-1;t[++p]=f,t[++p]=l,t[++p]=.5*(f+v),t[++p]=.5*(l+b),t[++p]=v,t[++p]=b,t[++p]=.5*(f+m),t[++p]=.5*(l+w),t[++p]=.5*(f+d),t[++p]=.5*(l+g),t[++p]=.5*(v+d),t[++p]=.5*(b+g),t[++p]=m,t[++p]=w,t[++p]=.5*(m+d),t[++p]=.5*(w+g),t[++p]=d,t[++p]=g,h[0]=.5*O(f,l,v,b),h[1]=.5*O(f,l,m,w)},yc=function(t,n,i){var r=i.x0,e=i.y0,u=i.x1,s=i.y1,h=i.x2,o=i.y2,a=i.x3,c=i.y3,f=(n<<1)-1;t[++f]=r,t[++f]=e,t[++f]=.5*(u+r),t[++f]=.5*(s+e),t[++f]=u,t[++f]=s,t[++f]=.5*(r+a),t[++f]=.5*(e+c),t[++f]=.5*(r+h),t[++f]=.5*(e+o),t[++f]=.5*(u+h),t[++f]=.5*(s+o),t[++f]=a,t[++f]=c,t[++f]=.5*(a+h),t[++f]=.5*(c+o),t[++f]=h,t[++f]=o},xc=function(t){function n(n,i){var r=t.call(this,n,i,9,8)||this;return r.textureWidth=-1,r.textureHeight=-1,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset;t.updateClippings(),t.updateIndices(),Ac(t.clippings,n),Rc(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=K(n),b=v.width*v.resolution,d=v.height*v.resolution,g=this.textureWidth!==b||this.textureHeight!==d;(u||h||l||g)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.textureWidth=b,this.textureHeight=d,t.updateVertices(),Lc(t.vertices,this.vertexOffset,0,0,r,e,n.transform.internalTransform,Ic),t.updateSteps(),kc(t.steps,this.vertexOffset,a,c,f,b,d,Ic))},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),yc(t.uvs,this.vertexOffset,J(i)))},n}(W),Bc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new xc(i,r),new sn(i+9,r+8,h,o)]).init(n):null},_c=function(t){function n(n,i){return void 0===i&&(i=r.IMAGE_SDF),t.call(this,n,i)||this}return _(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(Tc),Pc=function(t,n,i){return Eo(t,n,i||new _c)},Fc=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=K(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Uc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=h,c=o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Fc(i,r,a-h,c-o),new sn(i,r,h,o)]).init(n):null},Gc=function(t){function n(n){return void 0===n&&(n=r.LABEL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Jt),Hc=function(t,n,i){return Eo(t,n,i||new Gc)},zc=function(){e[r.LABEL]=Uc,n[r.LABEL]=Hc},Vc=function(t){function n(n){void 0===n&&(n=r.LINE);var i=t.call(this,n)||this;return i.jt=new fe(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.jt.serialize(n),i},n}(rn),Wc=function(t,n,i){i=i||new Vc;var r=Eo(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=z.NON_SCALING_MASK|z.DOTTED_MASK|z.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},Xc=function(){e[r.LINE]=qa,n[r.LINE]=Wc},Kc=function(t,n,i){for(var r=3*n,e=3*(n+i);r<e;r+=3)t[r+0]=0,t[r+1]=0,t[r+2]=0},Yc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Jc=function(t,n,i){for(var r=6*n,e=6*(n+i);r<e;r+=6)t[r+0]=0,t[r+1]=0,t[r+2]=0,t[r+3]=0,t[r+4]=0,t[r+5]=0},Zc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},qc=function(t){return 12*Math.ceil(t/12)},Qc=function(t,n,i,r,e,u,s,h){if(u)if(i.isStaticColor()){var o=i.getColor(0,s);if(i.isStaticAlpha()){var a=i.getAlpha(0,h);V(o,a,t,n*r,e)}else for(var c=0,f=t;c<r;c+=1,f+=n)a=i.getAlpha(c,h),V(o,a,f,n,e)}else if(i.isStaticAlpha())for(a=i.getAlpha(0,h),c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),V(o,a,f,n,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),a=i.getAlpha(c,h),V(o,a,f,n,e);else if(i.isStaticColor())o=i.getColor(0,s),V(o,0,t,n*r,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),V(o,0,f,n,e)},$c=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e)||this;return s.pointId=-1,s.pointCount=0,s.pointCountReserved=u,s.pointSizeId=-1,s.pointOffsetId=-1,s.pointFillId=-1,s.pointStrokeId=-1,s}return _(n,t),n.prototype.isCompatible=function(t){return qc(ua(t.points))===this.pointCountReserved},n.prototype.updateLineOfAnyColorFill=function(t,n,i,r){var e=i.fill,u=e.id,s=u!==this.pointFillId,h=n.fill,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorFill||c!==this.alphaFill;(s||f)&&(this.colorFill=a,this.alphaFill=c,this.pointFillId=u,t.updateColorFills(),Qc(this.vertexOffset,r,e,this.pointCountReserved,t.colorFills,o,a,c))},n.prototype.updateLineOfAnyColorStroke=function(t,n,i,r){var e=i.stroke,u=e.id,s=u!==this.pointStrokeId,h=n.stroke,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorStroke||c!==this.alphaStroke;(s||f)&&(this.colorStroke=a,this.alphaStroke=c,this.pointStrokeId=u,t.updateColorStrokes(),Qc(this.vertexOffset,r,e,this.pointCountReserved,t.colorStrokes,o,a,c))},n}(W),tf=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=3*e,h=3*n,o=0;o<i;++o)t[s+0]=t[h+0],t[s+1]=t[h+1],t[s+2]=t[h+2],s+=3,h+=3;e+=i}},nf=function(t,n,i,r,e){for(var u=n,s=i+r,h=1;h<e;++h){for(var o=3*s,a=3*i,c=0;c<r;++c)t[o+0]=t[a+0]+u,t[o+1]=t[a+1]+u,t[o+2]=t[a+2]+u,o+=3,a+=3;u+=n,s+=r}},rf=function(t,n,i,r){for(var e=6*n,u=6*(n+i),s=1;s<r;++s)for(var h=e,o=0;o<i;++o)t[u+0]=t[h+0],t[u+1]=t[h+1],t[u+2]=t[h+2],t[u+3]=t[h+3],t[u+4]=t[h+4],t[u+5]=t[h+5],u+=6,h+=6},ef=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=e<<1,h=n<<1,o=0;o<i;++o)t[s]=t[h],t[s+1]=t[h+1],s+=2,h+=2;e+=i}},uf=function(t,n,i,r,e,u,s){var h=n.a,o=n.b,a=n.c,c=n.d,f=e-1,l=i+f*r;if(s.isStaticX()&&s.isStaticY())for(var v=s.getX(0),b=s.getY(0);0<=f;--f){for(var d=h*(D=u[O=f<<1]+v)+a*(E=u[O+1]+b),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}else for(;0<=f;--f){var O,D,E;for(d=h*(D=u[O=f<<1]+s.getX(f))+a*(E=u[O+1]+s.getY(f)),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}},sf=function(t){return pt(t)||null==t},hf=function(t,n,i){return pt(n)?n:wt(n)?n(t):n?n[t%n.length]:i},of=function(){function t(t){this.p=t,this.R=0,this.S=null,this.T=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.T!==n&&(i=!0,this.T=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getColor=function(t,n){return hf(t,this.S,n)},t.prototype.getAlpha=function(t,n){return hf(t,this.T,n)},t.prototype.isStaticColor=function(){return sf(this.S)},t.prototype.isStaticAlpha=function(){return sf(this.T)},t.prototype.toDirty=function(){this.R+=1},t}(),af=function(){function t(t,n,i){this.p=t,this.R=0,this._x=null,this._y=null,this.No=n,this.Io=i,this.Co=null,this.Ao=0,this.Ro=-1,this.ko=0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"limit",{get:function(){return this.Co},set:function(t){this.Co=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this._x!==t&&(i=!0,this._x=t),void 0!==n&&this._y!==n&&(i=!0,this._y=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getX=function(t){return hf(t,this._x,this.No)},t.prototype.getY=function(t){return hf(t,this._y,this.Io)},t.prototype.getLimit=function(){var t=this.Co;return null!=t?t:(this.updateLimitComputed(),this.Ao)},t.prototype.updateLimitComputed=function(){var t=this.R,n=this.p.length;this.Ro===t&&this.ko===n||(this.Ro=t,this.ko=n,this.Ao=Math.max(this.calcLimit(this._x,n,this.No),this.calcLimit(this._y,n,this.Io)))},t.prototype.calcLimit=function(t,n,i){if(pt(t))return Math.abs(t);if(wt(t)){if(0<n){for(var r=Math.abs(t(0)),e=1;e<n;++e)r=Math.max(r,Math.abs(t(e)));return r}return 0}if(null!=t){var u=t.length;if(0<u){for(r=t[0],e=1;e<u;++e)r=Math.max(r,Math.abs(t[e]));return r}return 0}return Math.abs(i)},t.prototype.isStaticX=function(){return sf(this._x)},t.prototype.isStaticY=function(){return sf(this._y)},t.prototype.toDirty=function(){this.R+=1},t}(),cf=function(){function t(t){this.p=t,this.R=0,this.S=null,this.T=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.T!==n&&(i=!0,this.T=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getColor=function(t,n){return hf(t,this.S,n)},t.prototype.getAlpha=function(t,n){return hf(t,this.T,n)},t.prototype.isStaticColor=function(){return sf(this.S)},t.prototype.isStaticAlpha=function(){return sf(this.T)},t.prototype.toDirty=function(){this.R+=1},t}(),ff=function(){function n(t){this.p=t,this.k=[],this.Lo=0,this.L=[],this.j=new af(this,q.SIZE_X,q.SIZE_Y),this.vn=new af(this,0,0),this.C=new of(t),this.yo=new cf(t),this.R=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this.k.length>>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.k},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return z.NONE},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=nt.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"offset",{get:function(){return this.vn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"stroke",{get:function(){return this.yo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return this.set(t.values,t.segments,t.style)},n.prototype.set=function(t,n,i){var r=!1,e=!1;if(null!=t){var u=this.k,s=this.Lo,h=t.length;if(u!==t){for(var o=Math.min(s,h),a=0;a<o;++a)u[a]=t[a];for(a=o;a<h;++a)u.push(t[a]);s!==h?(u.length=h,this.Lo=h,r=!0):e=!0}else s!==h?(this.Lo=h,r=!0):e=!0}if(r){this.R+=1;var c=this.p,f=c.uploaded;f?f.isCompatible(c)?c.updateUploaded():(c.uploaded=void 0,c.toDirty()):c.updateUploaded()}else e&&(this.R+=1,this.p.updateUploaded());return this},n.prototype.updateUploaded=function(){this.p.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[]")},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o,a){var c=this.formatted,f=c.length,l=c.values,v=this.j,b=this.vn,d=0,g=f;if(h){var m=.5*v.getLimit(),w=b.getLimit(),p=n.WORK_RANGE;h(t,i,m,m,w,w,s,l,p),d=p[0],g=p[1]}for(var O=d,D=Math.min(g,f);O<D;++O){var E=O<<1,M=l[E],S=l[E+1];if(o(t,i,.5*v.getX(O),.5*v.getY(O),b.getX(O),b.getY(O),M,S,r,e,u,O,s,a))return!0}return!1},n.WORK_RANGE=[0,0],n}(),lf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(Yo(n,r),tf(n,r,9,u),Jo(i,r,e),nf(i,9,e,8,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof ff&&(this.updateVertexAndStep(t,n,i),this.updateLineOfAnyColorFill(t,n,i,9),this.updateLineOfAnyColorStroke(t,n,i,9),this.updateUv(t,n))},n.prototype.updateVertexAndStep=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=X(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p;if(s||a||v||d||O){this.pointId=r;var D=i.formatted;this.pointCount=D.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeStyle=p,t.updateVertices(),t.updateSteps();var E=this.pointCount,M=D.values,S=this.vertexOffset,T=t.vertices,j=t.steps,N=t.clippings,I=n.transform.internalTransform;if(0<E&&h.isStaticX()&&h.isStaticY()){var C=h.getX(0),A=h.getY(0);Zo(T,S,0,0,C,A,m,w,I,Xo),uf(T,I,S,9,E,M,e),qo(j,N,S,w,p,Xo),rf(j,S,9,E)}else for(var R=0;R<E;++R){var k=R<<1,L=M[k]+e.getX(R),y=M[k+1]+e.getY(R),x=(C=h.getX(R),A=h.getY(R),S+9*R);Zo(T,x,L,y,C,A,m,w,I,Xo),qo(j,N,x,w,p,Xo)}var B=S+9*E,_=9*(this.pointCountReserved-E);Yc(T,B,_),Jc(j,B,_)}},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=t.uvs,u=this.vertexOffset,s=J(i),h=this.pointCountReserved;0<h&&(Qo(e,u,s),ef(e,u,9,h))}},n}($c),vf=function(t,n,i,r,e,s,h,o){var a=M(n),c=4*a,f=2*a,l=n.points,v=qc(ua(l)),b=v*r,d=v*s,g=b+c,m=d+f;return t.check(i,e,g,m)?new u(t,i,e,g,m,[new o(i,e,b,d,v),new sn(i+b,e+d,c,f)]).init(n):null},bf=function(t,n,i,r,e){return vf(t,n,i,9,r,8,0,lf)},df=function(t){function n(n){void 0===n&&(n=r.LINE_OF_CIRCLES);var i=t.call(this,n)||this;return i.jt=new ff(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.jt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.jt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.jt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.jt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(na),gf=function(t,n,i){return Eo(t,n,i||new df)},mf=function(){e[r.LINE_OF_CIRCLES]=bf,n[r.LINE_OF_CIRCLES]=gf},wf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(Co(n,i,r),nf(n,jo,r,24,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof ff&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,jo),this.updateLineOfAnyColorStroke(t,n,i,jo))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=n.radius,b=f!==this.sizeX||l!==this.sizeY||v!==this.radius,d=X(n),g=this.transformLocalId!==d,m=n.stroke,w=m.align,p=m.enable?m.width:0,O=m.side,D=m.style,E=this.strokeAlign!==w||this.strokeWidth!==p||this.strokeSide!==O||this.strokeStyle!==D,M=n.corner,S=M!==this.corner,T=K(n),j=Y(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||b||E;if(I||g||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=v,this.transformLocalId=d,this.strokeAlign=w,this.strokeWidth=p,this.strokeSide=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||g)&&t.updateSteps(),(I||S)&&t.updateClippings(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,k=this.vertexOffset,L=t.vertices,y=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=J(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var F=h.getX(0),U=h.getY(0);Ao(L,k,0,0,F,U,w,p,v,_,No),uf(L,_,k,jo,A,R,e),(I||g)&&(ko(x,k,p,O,D,M,No),rf(x,k,jo,A)),(I||S)&&(Ro(y,k,M,No),tf(y,k,jo,A)),(I||N)&&(Lo(B,k,P,No),ef(B,k,jo,A))}else for(var G=0;G<A;++G){var H=G<<1,z=R[H]+e.getX(G),V=R[H+1]+e.getY(G),W=(F=h.getX(G),U=h.getY(G),k+G*jo);Ao(L,W,z,V,F,U,w,p,v,_,No),(I||g)&&ko(x,W,p,O,D,M,No),(I||S)&&Ro(y,W,M,No),(I||N)&&Lo(B,W,P,No)}var Z=this.pointCountReserved,q=k+A*jo,Q=jo*(Z-A);Yc(L,q,Q),Jc(x,q,Q),Kc(y,q,Q),Zc(B,q,Q)}},n}($c),pf=function(t,n,i,r,e){return vf(t,n,i,jo,r,24,0,wf)},Of=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.jt=new ff(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.jt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.jt.calcHitPointAbs(t,n,h,e,u,s,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.jt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.jt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(Fo),Df=function(t,n,i){return Eo(t,n,i||new Of)},Ef=function(){e[r.LINE_OF_RECTANGLE_ROUNDEDS]=pf,n[r.LINE_OF_RECTANGLE_ROUNDEDS]=Df,jr.set(r.LINE_OF_RECTANGLE_ROUNDEDS,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},Mf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(Fa(n,i,r),nf(n,ya,r,xa,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof ff&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,ya),this.updateLineOfAnyColorStroke(t,n,i,ya))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=X(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.side,O=g.style,D=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeSide!==p||this.strokeStyle!==O,E=K(n),M=Y(E),S=E!==this.texture||M!==this.textureTransformId,T=s||a||v||D;if(T||d||S){this.pointId=r;var j=i.formatted;this.pointCount=j.length,this.pointOffsetId=u,this.pointSizeId=o,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeSide=p,this.strokeStyle=O,this.texture=E,this.textureTransformId=M,t.updateVertices(),(T||d)&&t.updateSteps(),T&&t.updateClippings(),(T||S)&&t.updateUvs();var N=this.pointCount,I=j.values,C=this.vertexOffset,A=t.vertices,R=t.clippings,k=t.steps,L=t.uvs,y=n.transform.internalTransform,x=J(E);if(0<N&&h.isStaticX()&&h.isStaticY()){var B=h.getX(0),_=h.getY(0);Ua(A,C,0,0,B,_,m,w,y,Ba),uf(A,y,C,ya,N,I,e),(T||d)&&(Ga(C,k,w,p,O,Ba),rf(k,C,ya,N)),T&&(Pa(R,C,Ba),tf(R,C,ya,N)),(T||S)&&(za(L,C,x,Ba),ef(L,C,ya,N))}else for(var P=0;P<N;++P){var F=P<<1,U=I[F]+e.getX(P),G=I[F+1]+e.getY(P),H=(B=h.getX(P),_=h.getY(P),C+P*ya);Ua(A,H,U,G,B,_,m,w,y,Ba),(T||d)&&Ga(H,k,w,p,O,Ba),T&&Pa(R,H,Ba),(T||S)&&za(L,H,x,Ba)}var z=this.pointCountReserved,V=C+N*ya,W=ya*(z-N);Yc(A,V,W),Jc(k,V,W),Kc(R,V,W),Zc(L,V,W)}},n}($c),Sf=function(t,n,i,r,e){return vf(t,n,i,ya,r,xa,0,Mf)},Tf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLES);var i=t.call(this,n)||this;return i.jt=new ff(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.jt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.jt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.jt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.jt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(hu),jf=function(t,n,i){return Eo(t,n,i||new Tf)},Nf=function(){e[r.LINE_OF_RECTANGLES]=Sf,n[r.LINE_OF_RECTANGLES]=jf,jr.set(r.LINE_OF_RECTANGLES,Ct.PRIMITIVE|Ct.STROKE_SIDE)},If=22,Cf=[0,0,0,0,0],Af=new t.Point,Rf=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+6,t[++r]=n+7,t[++r]=n+8,t[++r]=n+9,t[++r]=n+11,t[++r]=n+9,t[++r]=n+10,t[++r]=n+11,t[++r]=n+12,t[++r]=n+13,t[++r]=n+16,t[++r]=n+13,t[++r]=n+14,t[++r]=n+16,t[++r]=n+14,t[++r]=n+15,t[++r]=n+16,t[++r]=n+12,t[++r]=n+16,t[++r]=n+19,t[++r]=n+16,t[++r]=n+17,t[++r]=n+19,t[++r]=n+17,t[++r]=n+18,t[++r]=n+19,t[++r]=n+12,t[++r]=n+19,t[++r]=n+13,t[++r]=n+19,t[++r]=n+20,t[++r]=n+13,t[++r]=n+20,t[++r]=n+21,t[++r]=n+13},kf=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.sqrt(l*l+4*v*v),d=2*l*v/(l+b),g=d*o/(2*v),m=.5*(b-d)*o/b,w=g*b/(2*l),p=Af;p.set(i,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r),a.apply(p,p);var M=p.x,S=p.y;p.set(i+l,r),a.apply(p,p);var T=M-D,j=S-E,N=p.x+T,I=p.y+j,C=M+(M-p.x)+T,A=S+(S-p.y)+j,R=N-D,k=I-E,L=D+m*R,y=E+m*k,x=N-g*R,B=I-g*k,_=w*(C-N),P=w*(A-I),F=N+_,U=I+P,G=C-_,H=A-P,z=D-C,V=E-A,W=C+g*z,X=A+g*V,K=D-m*z,Y=E-m*V;p.set(i,r+v-d),a.apply(p,p);var J=p.x,Z=p.y,q=D+o*(J-D),Q=E+o*(Z-E),$=N+o*(J-N),tt=I+o*(Z-I),nt=C+o*(J-C),it=A+o*(Z-A),rt=M+T,et=S+j;c[0]=O(rt,et,J,Z),c[1]=w,c[2]=g,c[3]=m,c[4]=1-.5*d/v;var ut=2*n-1;t[++ut]=q,t[++ut]=Q,t[++ut]=K,t[++ut]=Y,t[++ut]=D,t[++ut]=E,t[++ut]=L,t[++ut]=y,t[++ut]=$,t[++ut]=tt,t[++ut]=x,t[++ut]=B,t[++ut]=N,t[++ut]=I,t[++ut]=F,t[++ut]=U,t[++ut]=nt,t[++ut]=it,t[++ut]=G,t[++ut]=H,t[++ut]=C,t[++ut]=A,t[++ut]=W,t[++ut]=X,t[++ut]=J,t[++ut]=Z,t[++ut]=q,t[++ut]=Q,t[++ut]=L,t[++ut]=y,t[++ut]=x,t[++ut]=B,t[++ut]=$,t[++ut]=tt,t[++ut]=F,t[++ut]=U,t[++ut]=G,t[++ut]=H,t[++ut]=nt,t[++ut]=it,t[++ut]=W,t[++ut]=X,t[++ut]=K,t[++ut]=Y},Lf=function(t,n,i,r){var e=3*n-1,u=1-r;i&ut.TOP?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&ut.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&ut.BOTTOM_LEFT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0},yf=function(t,n,i,r,e,u,s){for(var h=o(e),a=s[0],c=u*a,f=3*i,l=6*i-1,v=0;v<If;v+=1,f+=3)t[++l]=r,t[++l]=h,.5<n[f+2]?(t[++l]=c,t[++l]=c,t[++l]=1+n[f],t[++l]=1+n[f+1]):(t[++l]=a,t[++l]=a,t[++l]=1+n[f],t[++l]=1+n[f+1])},xf=function(t,n,i,r,e){var u=i.x0,s=i.x1,h=i.x2,o=i.x3,a=i.y0,c=i.y1,f=i.y2,l=i.y3,v=.5*(u+s),b=.5*(a+c),d=e[4],g=v+d*(o-u),m=b+d*(l-a),w=e[1],p=e[2],O=e[3],D=v+O*(o-v),E=b+O*(l-b),M=v+r*(g-v),S=b+r*(m-b),T=v+O*(h-v),j=b+O*(f-b),N=h+p*(v-h),I=f+p*(b-f),C=h+r*(g-h),A=f+r*(m-f),R=h+w*(o-h),k=f+w*(l-f),L=o+w*(h-o),y=l+w*(f-l),x=o+r*(g-o),B=l+r*(m-l),_=o+p*(v-o),P=l+p*(b-l),F=2*n-1;t[++F]=M,t[++F]=S,t[++F]=D,t[++F]=E,t[++F]=v,t[++F]=b,t[++F]=T,t[++F]=j,t[++F]=C,t[++F]=A,t[++F]=N,t[++F]=I,t[++F]=h,t[++F]=f,t[++F]=R,t[++F]=k,t[++F]=x,t[++F]=B,t[++F]=L,t[++F]=y,t[++F]=o,t[++F]=l,t[++F]=_,t[++F]=P,t[++F]=g,t[++F]=m,t[++F]=M,t[++F]=S,t[++F]=T,t[++F]=j,t[++F]=N,t[++F]=I,t[++F]=C,t[++F]=A,t[++F]=R,t[++F]=k,t[++F]=L,t[++F]=y,t[++F]=x,t[++F]=B,t[++F]=_,t[++F]=P,t[++F]=D,t[++F]=E},Bf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=this.vertexOffset,i=this.indexOffset,r=this.pointCountReserved;0<r&&(Rf(t.indices,n,i),nf(t.indices,If,i,15,r))},n.prototype.update=function(t,n){var i=n.points;i instanceof ff&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,If),this.updateLineOfAnyColorStroke(t,n,i,If))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=n.radius,d=b!==this.radius,g=X(n),m=this.transformLocalId!==g,w=n.stroke,p=w.align,O=w.enable?w.width:0,D=w.style,E=this.strokeAlign!==p||this.strokeWidth!==O||this.strokeStyle!==D,M=n.corner,S=this.corner!==M,T=K(n),j=Y(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||v||d||E;if(I||m||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=b,this.transformLocalId=g,this.strokeAlign=p,this.strokeWidth=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||S)&&t.updateClippings(),(I||m||S)&&t.updateSteps(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,k=this.vertexOffset,L=t.vertices,y=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=J(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var F=h.getX(0),U=h.getY(0);kf(L,k,0,0,F,U,p,O,b,_,Cf),uf(L,_,k,If,A,R,e),(I||S)&&(Lf(y,k,M,b),tf(y,k,If,A)),(I||m||S)&&(yf(x,y,k,O,D,b,Cf),rf(x,k,If,A)),(I||N)&&(xf(B,k,P,b,Cf),ef(B,k,If,A))}else for(var G=0;G<A;++G){var H=G<<1,z=R[H]+e.getX(G),V=R[H+1]+e.getY(G),W=(F=h.getX(G),U=h.getY(G),k+G*If);kf(L,W,z,V,F,U,p,O,b,_,Cf),(I||S)&&Lf(y,W,M,b),(I||m||S)&&yf(x,y,W,O,D,b,Cf),(I||N)&&xf(B,W,P,b,Cf)}var Z=this.pointCountReserved,q=k+A*If,Q=If*(Z-A);Yc(L,q,Q),Jc(x,q,Q),Kc(y,q,Q),Zc(B,q,Q)}},n}($c),_f=function(t,n,i,r,e){return vf(t,n,i,If,r,15,0,Bf)},Pf=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=u+f*(h-u)-r,w=s+f*(o-s)-e,p=Math.sqrt(m*m+w*w),O=1e-5;if(O<p){var D=1/p,E=m*D,M=w*D,S=(u+l*(a-u)-r)*D,T=(s+l*(c-s)-e)*D,j=E*T-S*M;if(O<Math.abs(j)){var N=1/j,I=n-r,C=i-e;if(function(t,n,i,r,e,u,s){if(t.fill.enable){if(n*n+i*i<=r*r)return!0}else if(0<u){var h=n*n+i*i;if(h<=r*r){var o=Math.max(0,r*(1-u*s/e));if(o*o<=h)return!0}}return!1}(t,(+T*I-S*C)*N,(-M*I+E*C)*N,p,v*b,d,g))return!0}}return!1},Ff=function(t,n,i,r,e,u,s){var h=2*e/r;if($t(n,i,h,-e,+e)){var o=Math.sqrt(r*r+4*e*e),a=2*r*e/(r+o),c=t.radius,f=e-a,l=-e,v=+r,b=+e,d=-v,g=+b,m=0+0*c,w=l+c*(f-l),p=v+c*(0-v),O=b+c*(f-b),D=+O,E=-p,M=-h*n+w-i<=0,S=+h*n+w-i<=0,T=i<=O,j=t.corner;if(!M&&!S&&j&ut.TOP){var N=.5*(o-a)*c/o;if(Pf(t,n,i,m,w,0,l,d,g,v,b,N,N,a,c,u,s))return!0}else if(!M&&!T&&j&ut.BOTTOM_LEFT){if(Pf(t,n,i,E,D,d,g,v,b,0,l,(I=a*c/(2*e))*o/(2*r),I,a,c,u,s))return!0}else if(!S&&!T&&j&ut.BOTTOM_RIGHT){var I;if(Pf(t,n,i,p,O,v,b,0,l,d,g,I=a*c/(2*e),I*o/(2*r),a,c,u,s))return!0}else{if(t.fill.enable)return!0;if(0<u){var C=u*s,A=e-a,R=A+(-e-A)*Math.max(0,a-C)/a;if(!$t(n,i,h,R,e-C))return!0}}}return!1},Uf=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Ff(this,n,i,r,e,u,s)},n}(Jt),Gf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.jt=new ff(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.jt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.jt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.jt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.jt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(Uf),Hf=function(t,n,i){return Eo(t,n,i||new Gf)},zf=function(){e[r.LINE_OF_TRIANGLE_ROUNDEDS]=_f,n[r.LINE_OF_TRIANGLE_ROUNDEDS]=Hf,jr.set(r.LINE_OF_TRIANGLE_ROUNDEDS,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},Vf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(Da(n,r),tf(n,r,7,u),Ea(i,r,e),nf(i,7,e,3,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof ff&&(this.updateVertexStepAndUvs(t,n,i),this.updateLineOfAnyColorFill(t,n,i,7),this.updateLineOfAnyColorStroke(t,n,i,7))},n.prototype.updateVertexStepAndUvs=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=X(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p,D=K(n),E=Y(D),M=D!==this.texture||E!==this.textureTransformId,S=s||a||v||O;if(S||d||M){this.pointId=r;var T=i.formatted;this.pointCount=T.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeAlign=m,this.strokeWidth=w,this.strokeStyle=p,t.updateVertices(),(S||d)&&t.updateSteps(),(S||M)&&t.updateUvs();var j=this.pointCount,N=T.values,I=this.vertexOffset,C=t.vertices,A=t.steps,R=t.clippings,k=t.uvs,L=J(D),y=n.transform.internalTransform;if(0<j&&h.isStaticX()&&h.isStaticY()){var x=h.getX(0),B=h.getY(0);Ma(C,I,0,0,x,B,m,w,y,pa),uf(C,y,I,7,j,N,e),(S||d)&&(Sa(A,R,I,7,w,p,pa),rf(A,I,7,j)),(S||M)&&(Ta(k,L,I,pa),ef(k,I,7,j))}else for(var _=0;_<j;++_){var P=_<<1,F=N[P]+e.getX(_),U=N[P+1]+e.getY(_),G=(x=h.getX(_),B=h.getY(_),I+7*_);Ma(C,G,F,U,x,B,m,w,y,pa),(S||d)&&Sa(A,R,G,7,w,p,pa),(S||M)&&Ta(k,L,G,pa)}var H=I+7*j,z=7*(this.pointCountReserved-j);Yc(C,H,z),Jc(A,H,z),Zc(k,H,z)}},n}($c),Wf=function(t,n,i,r,e){return vf(t,n,i,7,r,3,0,Vf)},Xf=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&tn(this,n,i,r,e,u,s)},n}(Jt),Kf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLES);var i=t.call(this,n)||this;return i.jt=new ff(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.jt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.jt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.jt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.jt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(Xf),Yf=function(t,n,i){return Eo(t,n,i||new Kf)},Jf=function(){e[r.LINE_OF_TRIANGLES]=Wf,n[r.LINE_OF_TRIANGLES]=Yf},Zf=function(t,n,i,r){return new u(t,i,r,0,0,[new La(i,r)]).init(n)},qf=function(t){function n(n){return void 0===n&&(n=r.NULL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Jt),Qf=function(t,n,i){return Eo(t,n,i||new qf)},$f=function(){e[r.NULL]=Zf,n[r.NULL]=Qf},tl=function(t,n,i){return Eo(t,n,i||new hu)},nl=function(){e[r.RECTANGLE]=Sc,n[r.RECTANGLE]=tl,jr.set(r.RECTANGLE,Ct.PRIMITIVE|Ct.STROKE_SIDE)},il=function(t,n,i){return Eo(t,n,i||new ou)},rl=function(t,n,i){return Eo(t,n,i||new Fo)},el=function(){e[r.RECTANGLE_ROUNDED]=xo,n[r.RECTANGLE_ROUNDED]=rl,jr.set(r.RECTANGLE_ROUNDED,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},ul=[0,0],sl=new t.Point,hl=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1},ol=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4},al=function(t,n,i,r,e,u,s,h,o,a){var c=sl,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D-w,S=E-p,T=2*n-1;t[++T]=b,t[++T]=d,t[++T]=g,t[++T]=m,t[++T]=g+w,t[++T]=m+p,t[++T]=M,t[++T]=S,t[++T]=D,t[++T]=E,t[++T]=D+w,t[++T]=E+p,a[0]=O(b,d,g,m),a[1]=O(b,d,M,S)},cl=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<6;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},fl=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a)},ll=function(t){function n(n,i){return t.call(this,n,i,6,4)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;hl(t.clippings,n),ol(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),al(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,ul),cl(t.steps,t.clippings,this.vertexOffset,c,f,ul))},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=J(i);fl(t.uvs,this.vertexOffset,e)}},n}(W),vl=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=6+h,c=4+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new ll(i,r),new sn(i+6,r+4,h,o)]).init(n):null},bl=function(t,n,i,r,e,u,s){return i<=0&&Zt(t,n,i,r,e,u,s)},dl=function(t){function n(n){void 0===n&&(n=r.SEMICIRCLE);var i=t.call(this,n)||this;return i.stroke.side=qt.ALL&~qt.BOTTOM,i}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&bl(this,n,i,r,e,u,s)},n}(Jt),gl=function(t,n,i){return Eo(t,n,i||new dl)},ml=function(){e[r.SEMICIRCLE]=vl,n[r.SEMICIRCLE]=gl},wl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices(),Da(t.clippings,this.vertexOffset),Ea(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=K(n),b=Y(v),d=v!==this.texture||b!==this.textureTransformId,g=u||l;if(g||h||d){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.texture=v,this.textureTransformId=b;var m=this.vertexOffset;t.updateVertices(),Ma(t.vertices,m,0,0,r,e,a,c,n.transform.internalTransform,pa),(g||h)&&(t.updateSteps(),Sa(t.steps,t.clippings,m,7,c,f,pa)),(g||d)&&(t.updateUvs(),Ta(t.uvs,J(v),m,pa))}},n}(W),pl=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=7+h,c=3+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new wl(i,r,a-h,c-o),new sn(i+7,r+3,h,o)]).init(n):null},Ol=function(t,n,i){return Eo(t,n,i||new Xf)},Dl=function(){e[r.TRIANGLE]=pl,n[r.TRIANGLE]=Ol},El=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Rf(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.radius,h=s!==this.radius,o=X(n),a=this.transformLocalId!==o,c=n.stroke,f=c.align,l=c.enable?c.width:0,v=c.style,b=this.strokeAlign!==f||this.strokeWidth!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=K(n),w=Y(m),p=m!==this.texture||w!==this.textureTransformId,O=u||h||b;if(O||a||g||p){this.sizeX=r,this.sizeY=e,this.radius=s,this.transformLocalId=o,this.strokeAlign=f,this.strokeWidth=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),kf(t.vertices,D,0,0,r,e,f,l,s,n.transform.internalTransform,Cf),(h||g)&&(t.updateClippings(),Lf(t.clippings,D,d,s)),(O||a||g)&&(t.updateSteps(),yf(t.steps,t.clippings,D,l,v,n.radius,Cf)),(O||p)&&(t.updateUvs(),xf(t.uvs,D,J(m),s,Cf))}},n}(W),Ml=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=If+h,c=15+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new El(i,r,a-h,c-o),new sn(i+If,r+15,h,o)]).init(n):null},Sl=function(t,n,i){return Eo(t,n,i||new Uf)},Tl=function(){e[r.TRIANGLE_ROUNDED]=Ml,n[r.TRIANGLE_ROUNDED]=Sl,jr.set(r.TRIANGLE_ROUNDED,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},jl=function(){So(),Wo(),ra(),ec(),uc(),lc(),Ec(),wc(),Nc(),e[r.IMAGE_SDF]=Bc,n[r.IMAGE_SDF]=Pc,zc(),Xc(),$f(),e[r.RECTANGLE_PIVOTED]=hc,n[r.RECTANGLE_PIVOTED]=il,jr.set(r.RECTANGLE_PIVOTED,Ct.PRIMITIVE|Ct.STROKE_SIDE),el(),nl(),ml(),Tl(),Dl(),mf(),Ef(),Nf(),zf(),Jf()},Nl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DImage"},n}(Ts),Il=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).Ut=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:null,r}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.on(ir.tap,(function(t){i.onClick(t)}))},n.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){this.onSelect(t)},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),n.prototype.hasSelection=function(t){return t&&t.selection&&t.selection.add},n.prototype.getSelection=function(){for(var t=this.parent;t;){if(this.hasSelection(t))return t.selection;t=t.parent}return null},n.prototype.onSelect=function(t){this.emit("select",this.Ut,this);var n=this.getSelection();n&&n.add(this)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DMenuItemBase"},n}(Nl),Cl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getContext=function(){for(var t=this.parent;t;){if(t.getContext)return t.getContext();t=t.parent}return null},n.prototype.getCloseable=function(){for(var t=this.parent;t;){if(t.getCloseable)return t.getCloseable();t=t.parent}return null},n.prototype.getType=function(){return"DMenuItem"},n}(Il),Al=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.initOnOver(n),this.initShortcuts(n)},n.prototype.initOnOver=function(t){var n=this;this.on(ir.over,(function(){var t=n.getContext();null!=t&&n.parent instanceof hr&&t.trim(n.getCloseable())}))},n.prototype.initShortcuts=function(t){var n=this.ni;if(null!=n&&0<n.length){var i=n[0],r=nr.toString(i);this.Bo=this.createText(r),this.snippet.add(this.Bo,!0)}else this.Bo=null;this._o=this.theme.getShortcutTextMargin()},n.prototype.updateShortcutText=function(){var t=this.Bo,n=this._o;if(null!=t&&null!=n){var i,r=this.Wn;i=r.width.isOn?n:this.width-t.width-n;var e,u=this.Qn,s=u.getTop();e=r.height.isOn?s:s+.5*(this.height-s-u.getBottom()-t.height),t.position.set(i,e)}},n.prototype.updateTextColor=function(n){t.prototype.updateTextColor.call(this,n);var i=this.Bo;if(null!=i){var r=this.theme,e=this.state;i.style.fill=r.getShortcutColor(e),i.alpha=r.getShortcutAlpha(e)}},n.prototype.updateText=function(){t.prototype.updateText.call(this),this.updateShortcutText()},n.prototype.getType=function(){return"DMenuItemText"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n);var i=this.getCloseable();null!=i&&i.emit("select",this.value,this,i)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(Cl),Rl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),(null==n?void 0:n.check)&&(this.state.isActive=!0)},n.prototype.getType=function(){return"DMenuItemCheck"},n.prototype.onSelect=function(n){this.state.isActive=!this.state.isActive,t.prototype.onSelect.call(this,n)},n}(Al),kl=function(t){return"check"in t},Ll={OPEN_LINK:0,OPEN_LINK_IN_NEW_WINDOW:1,COPY_LINK_ADDRESS:2},yl=function(){function n(){}return n.addItemCreator=function(t){this.CREATORS.push(t)},n.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},n.setMenuCreator=function(t){this.MENU_CREATOR=t},n.newItemOf=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e](i,r);if(null!=s)return s}return n?n(i,r):null},n.newItem=function(t,n){return this.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)},n.newItemsOf=function(n,i,r,e){for(var u=0,s=r.length;u<s;++u){var h=r[u];if(h instanceof t.DisplayObject)i.addChild(h);else if(null!=h){var o=n.newItem(h,e);if(null==o)throw new Error("No matching menu item creator found: ".concat(JSON.stringify(h)));i.addChild(o)}}},n.newItems=function(t,n,i){this.newItemsOf(this,t,n,i)},n.newMenu=function(t){if(null!=this.MENU_CREATOR)return this.MENU_CREATOR(t);throw new Error("Missing DMenu creator.")},n.CREATORS=[],n.CREATOR_DEFAULT=null,n}(),xl=function(){function n(t,n){this.p=t,this.zn=n,this.vs=!0}return Object.defineProperty(n.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs=t},enumerable:!1,configurable:!0}),n.prototype.open=function(t){this.get().open(t)},n.prototype.get=function(){var t=this,n=this.Po;return null==n&&(n=this.toMenu(this.zn),this.Po=n,n.on("select",(function(n,i,r){t.onSelect(n,i,r)}))),n},n.prototype.toMenu=function(n){return n instanceof t.DisplayObject?n:this.newMenu(n)},n.prototype.newMenu=function(t){return yl.newMenu(t)},n.prototype.onSelect=function(t,n,i){var r=this.p;switch(t){case Ll.OPEN_LINK:r.open(!1);break;case Ll.OPEN_LINK_IN_NEW_WINDOW:r.open(!0);break;case Ll.COPY_LINK_ADDRESS:r.copy()}},n}(),Bl={AUTO:0,THIS_WINDOW:1,NEW_WINDOW:2},_l=function(t){var n=document.getSelection();if(n){var i=document.createRange();i.selectNodeContents(t),n.removeAllRanges(),n.addRange(i)}return n},Pl=function(t){return t.clipboardData||window.clipboardData},Fl=function(t){function n(){var n=t.call(this)||this,i=document.body;return i.addEventListener("copy",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("copy",Pl(t)))})),i.addEventListener("cut",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("cut",Pl(t)))})),i.addEventListener("paste",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("paste",Pl(t)))})),n}return _(n,t),n.copy=function(t){var n=navigator.clipboard;n&&n.writeText?n.writeText(t):function(t,n){if("undefined"==typeof ClipboardEvent){var i=t.clipboardData;if(void 0!==i&&void 0!==i.setData)return i.setData("Text",n),!0}return!1}(window,t)||function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important"),n.textContent="Dummy",document.body.appendChild(n);var i=_l(n),r=!1;if(i){var e=function(i){if(i.target===n){var e=Pl(i);e.setData("text/plain",t),r=e.getData("text/plain")===t,i.preventDefault()}};document.addEventListener("copy",e);try{document.execCommand("copy")}finally{document.removeEventListener("copy",e)}i.removeAllRanges()}return document.body.removeChild(n),r}(t)||navigator.userAgent.indexOf("Edge")<0&&function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important");var i=document.createElement("span");i.innerText=t,(n.attachShadow?n.attachShadow({mode:"open"}):n).appendChild(i),document.body.appendChild(n);var r=_l(n);r&&(document.execCommand("copy"),r.removeAllRanges()),document.body.removeChild(n)}(t)},n}(t.utils.EventEmitter),Ul=t.interaction.InteractionEvent,Gl=function(){function t(t){this.zn=t,this.Fo=null==t?void 0:t.url,this.ei=this.toNormalizedTarget(null==t?void 0:t.target),this.Uo=null==t?void 0:t.checker,this.vs=!0}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.Fo},set:function(t){this.Fo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this.ei},set:function(t){this.ei=this.toNormalizedTarget(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checker",{get:function(){return this.Uo},set:function(t){this.Uo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"menu",{get:function(){var t=this.Po;return null==t&&(t=this.newMenu(),this.Po=t),t},enumerable:!1,configurable:!0}),t.prototype.newMenu=function(){var n=this.zn;if(n){var i=n.menu;if(i)return new xl(this,i)}var r=t.MENU;return null==r&&(r=new xl(this,Z.getInstance().get("DLink").getMenuOptions()),t.MENU=r),r},t.prototype.toStringifiedUrl=function(t,n){var i=wt(t)?t():t;null!=i&&(Ot(i)?n(i):i.then((function(t){null!=t&&n(t)})))},t.prototype.toNormalizedUrl=function(n){var i=t.ANCHOR_ELEMENT||document.createElement("a");return t.ANCHOR_ELEMENT=i,i.href=n,i.href},t.prototype.toNormalizedTarget=function(t){return Ai(null!=t?t:Bl.AUTO,Bl)},t.prototype.copy=function(){var t=this;this.toStringifiedUrl(this.Fo,(function(n){Fl.copy(t.toNormalizedUrl(n))}))},t.prototype.open=function(t){var n=this;this.toStringifiedUrl(this.Fo,(function(i){var r=!0===t||!1===t?t:n.inNewWindow(t);n.check(i,r,(function(){n.exec(i,r)}))}))},t.prototype.check=function(t,n,i){var r=this.Uo;if(r){var e=r();!0===e?i():!1===e||e.then((function(t){t&&i()}))}else i()},t.prototype.exec=function(t,n){if(n){var i=document.createElement("a");i.href=t,i.target="_blank",i.style.display="none",i.rel="noopener noreferrer",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),100)}else window.location.href=t},t.prototype.inNewWindow=function(t){switch(this.ei){case Bl.NEW_WINDOW:return!0;case Bl.THIS_WINDOW:return!1;case Bl.AUTO:if(null!=t){var n=t instanceof Ul?t.data.originalEvent:t;return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey||"button"in n&&0!==n.button}return!1}},t.prototype.onClick=function(t,n){if(this.ei===Bl.AUTO){var i=n.data.originalEvent;if("pointerType"in i&&"mouse"!==i.pointerType||"touches"in i){var r=this.menu;if(r.enable)return this.vs&&t.state.isActionable&&r.open(t),!0}}return!this.vs},t}(),Hl=function(){function t(){}return t.toStateOptions=function(t,n){if(n&&(t===Bl.NEW_WINDOW||"NEW_WINDOW"===t)){var i=n.state;if(null==i)n.state=ct.NEW_WINDOW;else if(Ot(i))i!==ct.NEW_WINDOW&&(n.state=[i,ct.NEW_WINDOW]);else if(mt(i))i.indexOf(ct.NEW_WINDOW)<0&&i.push(ct.NEW_WINDOW);else{var r=i.values;null==r?i.values=ct.NEW_WINDOW:Ot(r)?r!==ct.NEW_WINDOW&&(i.values=[r,ct.NEW_WINDOW]):r.indexOf(ct.NEW_WINDOW)<0&&r.push(ct.NEW_WINDOW)}}return n},t}(),zl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toLinkOptions=function(t){if(t)return{url:this.toUrl(t.url),target:t.target,checker:this.toChecker(t.checker),menu:t.menu}},n.prototype.toUrl=function(t){var n=this;return Ot(t)||null==t?t:function(){return t(n)}},n.prototype.toChecker=function(t){var n=this;if(null!=t)return function(){return t(n)}},n.prototype.init=function(n){t.prototype.init.call(this,Hl.toStateOptions(null==n?void 0:n.target,n))},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return null==t&&(t=new Gl(this.toLinkOptions(this.zn)),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},n.prototype.getType=function(){return"DMenuItemLink"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(Al),Vl=function(t){return"url"in t},Wl=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t),this.initHover(t)},i.prototype.initHover=function(t){var n=this;this.on(ir.over,(function(){n.state.isActionable&&n.open()}))},i.prototype.toMenu=function(n){var i=null==n?void 0:n.menu;return i instanceof t.DisplayObject?i:this.newMenu(i)},i.prototype.newMenu=function(t){return yl.newMenu(t)},Object.defineProperty(i.prototype,"menu",{get:function(){var t=this,n=this.Po;return null==n&&((n=this.toMenu(this.zn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Po=n),n},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DMenuItemMenu"},i.prototype.open=function(){var t=this.menu;t.isHidden()&&this.onOpen(t)},i.prototype.onOpen=function(t){var n=this.getContext();null!=n&&t.open(this,this.getCloseable(),n)},i.prototype.close=function(){this.menu.close()},i.prototype.toggle=function(){var t=this.menu;t.isHidden()?this.onOpen(t):t.close()},i.prototype.onSelect=function(t){this.open(),n.prototype.onSelect.call(this,t)},i.prototype.onMenuSelect=function(t,n,i){var r=this.getCloseable();null!=r&&r.emit("select",t,n,r)},i.prototype.onKeyDown=function(t){return nr.isArrowRightKey(t)&&this.onKeyDownArrowRight(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyDownArrowRight=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},i}(Cl),Xl=function(t){return"menu"in t},Kl=function(n,i){var r=n.menu;return r instanceof t.DisplayObject||(null==r.sticky&&(r.sticky=i),null==r.align&&(r.align=Bu.RIGHT)),n},Yl=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){var r=t.state,e=t.border,u=e.getWidth(r),s=e.getColor(r);if(null!=s){var h=e.getAlpha(r),o=e.getAlign(r),a=t.padding,c=.5*i;this.clear(),this.lineStyle(u,s,h,o),this.moveTo(a.getLeft(),c),this.lineTo(n-a.getRight(),c),this.visible=!0}else this.clear(),this.visible=!1},n}(t.Graphics),Jl=function(t){return"separator"in t},Zl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){new Yl(this)},n.prototype.getType=function(){return"DMenuItemSeparator"},n}(Il),ql=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemSpace"},n}(Ku),Ql=function(t){return"space"in t},$l=function(){yl.addItemCreator((function(t){return kl(t)?new Rl(t):null})),yl.addItemCreator((function(t){return Vl(t)?new zl(t):null})),yl.addItemCreator((function(t,n){return Xl(t)?new Wl(Kl(t,n)):null})),yl.addItemCreator((function(t){return Jl(t)?new Zl(t):null})),yl.addItemCreator((function(t){return Ql(t)?new ql(t):null})),yl.setItemCreatorDefault((function(t){return new Al(t)}))},tv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableBody"},n}(Zu),nv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuItemExpandableHeader"},n}(Il),iv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return yl.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||yl.newItem(t,n)},t.newItems=function(t,n,i){yl.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),rv=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i,r=this;n.prototype.init.call(this,t);var e=this.theme,u=this.toHeader(e,t);this.jh=u,u.on("select",(function(){r.toggle()})),this.addChild(u);var s=this.toBody(e,t);this.Ie=s;var h=null!==(i=null==t?void 0:t.sticky)&&void 0!==i&&i;this.newItems(s,h,e,t),this.addChild(s),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.newItems=function(t,n,i,r){var e=null==r?void 0:r.items;null!=e&&iv.newItems(t,e,n)},i.prototype.toHeader=function(n,i){return i?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new nv(n)},i.prototype.toBody=function(n,i){var r=null==i?void 0:i.body;return r?r instanceof t.DisplayObject?r:this.newBody(n,r):this.newBody(n)},i.prototype.newBody=function(t,n){return new tv(n)},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.Ie;t instanceof hr?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.Ie;t instanceof hr?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.onKeyDown=function(t){if(nr.isArrowRightKey(t))this.state.isActionable&&!this.state.isActive&&(i=this.jh)instanceof hr&&i.state.isFocused&&(this.state.isActive=!0);else if(nr.isArrowLeftKey(t)){var i;if(this.state.isActionable&&this.state.isActive)return(i=this.jh)instanceof hr?i.focus():this.focus(),this.state.isActive=!1,n.prototype.onKeyDown.call(this,t),!0}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuItemExpandable"},i}(Zu),ev=function(t){return"header"in t},uv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemCheck"},n}(Rl),sv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemLink"},n}(zl),hv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSeparator"},n}(Zl),ov=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSpace"},n}(ql),av=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemText"},n}(Al),cv=function(){yl.addItemCreator((function(t){return ev(t)?new rv(t):null})),iv.addItemCreator((function(t){return kl(t)?new uv(t):null})),iv.addItemCreator((function(t){return Vl(t)?new sv(t):null})),iv.addItemCreator((function(t){return Jl(t)?new hv(t):null})),iv.addItemCreator((function(t){return Ql(t)?new ov(t):null})),iv.setItemCreatorDefault((function(t){return new av(t)}))},fv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemCheck"},n}(Rl),lv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemLink"},n}(zl),vv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initHover=function(t){},n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=t.prototype.getSelection.call(this);e&&e.add(i)},n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemMenu"},n}(Wl),bv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(Zl),dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSpace"},n}(ql),gv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemText"},n}(Al),mv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return yl.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||yl.newItem(t,n)},t.newItems=function(t,n,i){yl.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),wv=function(){mv.setItemCreatorDefault((function(t){return new gv(t)})),mv.addItemCreator((function(t){return Ql(t)?new dv(t):null})),mv.addItemCreator((function(t){return Jl(t)?new bv(t):null})),mv.addItemCreator((function(t,n){return Xl(t)?new vv(Kl(t,n)):null})),mv.addItemCreator((function(t){return Vl(t)?new lv(t):null})),mv.addItemCreator((function(t){return kl(t)?new fv(t):null}))},pv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return yl.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||mv.newItem(t,n)},t.newItems=function(t,n,i){yl.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),Ov=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItems=function(t,n,i,r){null!=r&&null!=r.items&&pv.newItems(t,r.items,n)},n.prototype.getType=function(){return"DMenuSidedItemExpandable"},n}(rv),Dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemCheck"},n}(uv),Ev=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemLink"},n}(zl),Mv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemMenu"},n}(Wl),Sv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getType=function(){return"DMenuSidedItemExpandableItemMenu"},n}(Mv),Tv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(hv),jv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemSpace"},n}(ov),Nv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemText"},n}(av),Iv=function(){mv.addItemCreator((function(t){return ev(t)?new Ov(t):null})),pv.addItemCreator((function(t){return kl(t)?new Dv(t):null})),pv.addItemCreator((function(t){return Vl(t)?new Ev(t):null})),pv.addItemCreator((function(t,n){return Xl(t)?new Sv(Kl(t,n)):null})),pv.addItemCreator((function(t){return Jl(t)?new Tv(t):null})),pv.addItemCreator((function(t){return Ql(t)?new jv(t):null})),pv.setItemCreatorDefault((function(t){return new Nv(t)}))},Cv=function(){$l(),cv(),wv(),Iv()},Av=function(){Cv(),jl()},Rv=function(){function t(){}return t.add=function(t,n){var i=this.Ho;null==i&&(i=new Map,this.Ho=i);var r=i.get(t);null==r?(r=[n],i.set(t,r)):r.push(n)},t.get=function(t){var n=this.Ho;if(null!=n)return n.get(t)},t}(),kv=function(t){function n(n,i){return t.call(this,Ve.EMIT_EVENT,n,i,mu.EMIT_EVENT,"")||this}return _(n,t),n}(Au),Lv=function(t){function n(n,i,r){return t.call(this,n,i,"",mu.EMIT_EVENT,r)||this}return _(n,t),n}(Au),yv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e,"")||this}return _(n,t),n}(Au),xv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,mu.EMIT_EVENT,e)||this}return _(n,t),n}(Au),Bv=function(t,n){return n?Do(t).then((function(t){var n=Se.getInstance().init();n.updateTexture(t),n.render();var i=document.createElement("canvas");return n.read(i),Bv(i.toDataURL(),!1)})):Do(t).then((function(t){return new _c(t)}))},_v=function(){function t(){}return t.from=function(t,n,i){var r=this,e=Je.toSerialized(t),u=e.pieces;return Je.toPieceData(n,u,i).then((function(t){return r.zo(e,i,u,t)}))},t.zo=function(t,n,i,r){var e=this,u=t.width,s=t.height,h=new Ye(u,s),o=new Sr(t,i,r,n,1);return Je.newLayer(t,h,o).then((function(){return e.create(t.name,u,s,h,n,0)}))},t.create=function(t,n,i,r,e,u){var s=new Br(t,e,u);return s.size.set(n,i),r.copyTo(s),s.size.init(),s},t}(),Pv=function(t){return"data:image/svg+xml;base64,".concat(btoa(t))},Fv=function(t){return Math.round(100*t)/100},Uv=function(){function t(){}return t.add=function(t){var n,i,r;(null!==(n=this.Zh)&&void 0!==n?n:this.Zh=new Map).set(t.type,t),(null!==(i=this.Re)&&void 0!==i?i:this.Re=new Map).set(t.id,t),(null!==(r=this.Xt)&&void 0!==r?r:this.Xt=[]).push(t)},t.get=function(t){var n=this.Zh;if(null!=n)return n.get(t)},t.getById=function(t){var n=this.Re;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Xt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Gv=function(){function t(){}return t.toIndices=function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(t[i].index);return n},t.toDepth=function(t){for(var n=0,i=t.parent;i instanceof Rt;)n+=1,i=i.parent;return n},t.toSharedParent=function(t,n){if(this.toDepth(t)<this.toDepth(n)){for(var i=t.parent;i instanceof Rt;){if(this.isParent(n,i))return i;i=i.parent}return i}for(var r=n.parent;r instanceof Rt;){if(this.isParent(t,r))return r;r=r.parent}return r},t.toOfParent=function(t,n){for(var i=t.parent;i!==n&&i instanceof Rt;)t=i,i=i.parent;return t},t.isParent=function(t,n){for(var i=t.parent;i instanceof Rt;){if(i===n)return!0;i=i.parent}return!1},t.toSelected=function(t){for(var n=t;n instanceof Rt;){if(n.selected)return n;n=n.parent}return null},t.findChildById=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.id===i)return h;if(!0===r){var o=t.findChildById(h,i,r);if(null!=o)return o}}return null},t.findChildByType=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.type===i)return h;if(!0===r){var o=t.findChildByType(h,i,r);if(null!=o)return o}}return null},t.findChild=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(i(h))return h;if(!0===r){var o=t.findChild(h,i,r);if(null!=o)return o}}return null},t.findChildrenByType=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];o.type===i&&e.push(o),!0===r&&t.findChildrenByType(o,i,r,e)}return e},t.findChildren=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];i(o)&&e.push(o),!0===r&&t.findChildren(o,i,r,e)}return e},t.COMPARATOR_INDEX=function(t,n){return t.index-n.index},t}(),Hv=function(){function t(){}return t.delete=function(t,n,i){for(var r=t.children,e=r.length,u=0;u<e;++u)(o=r[u]).selected?o.index=e+u:o.index=u;if(r.sort(Gv.COMPARATOR_INDEX),!0===i){for(u=e-1;0<=u;--u){if(!(o=r[u]).selected){var s=r.length-(u+1);if(0<s){var h=r.splice(u+1,s);return null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h}return null!=n&&(n.length=0),null}o.index-=e,o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(h=r.splice(0,r.length),null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h):(null!=n&&(n.length=0),null)}for(u=e-1;0<=u;--u){var o;if(!(o=r[u]).selected)return r.length=u+1,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),null;o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(r.length=0,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty()):null!=n&&(n.length=0),null},t}(),zv=function(){function t(){}return t.from=function(t){if(Ot(t))return z[t];if(pt(t))return t;if(null!=t){for(var n=z.NONE,i=0,r=t.length;i<r;++i)n|=z[t[i]];return n}return z.NONE},t}(),Vv=function(){function t(){this.resources=[],this.resourceToIndex=new Map,this.data=[],this.dataToIndex=new Map,this.pieces=[],this.pieceToIndex=new Map,this.uuids=new Set,this.uuidNext=0}return t.prototype.addResource=function(t){return this.Vo(t,this.resources,this.resourceToIndex)},t.prototype.addData=function(t){return this.Vo(t,this.data,this.dataToIndex)},t.prototype.addPiece=function(t){return this.Vo(t,this.pieces,this.pieceToIndex)},t.prototype.addUuid=function(t){if(0!==t){var n=this.uuids;return n.has(t)?0:(n.add(t),t)}return 0},t.prototype.updateUuid=function(t){var n=this.uuids;if(0!==t)return t;var i=this.newUuid();return n.add(i),i},t.prototype.newUuid=function(){for(var t=this.uuids,n=this.uuidNext;;)if(0!==(n+=1)&&!t.has(n))return this.uuidNext=n,n},t.prototype.Vo=function(t,n,i){var r=i.get(t);if(null!=r)return r;var e=n.length;return n.push(t),i.set(t,e),e},t}(),Wv=function(t){function n(n,i){var r,e,u,s=this;return(s=t.call(this)||this).Wo=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapGridVisible(),s.Xo=s.Wo,s.Ko=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapGridEnabled(),s.vs=s.Ko,s.Yo=null!==(u=null==i?void 0:i.size)&&void 0!==u?u:n.getSnapGridSize(),s.j=s.Yo,s}return _(n,t),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Xo},set:function(t){this.Xo!==t&&(this.Xo=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs!==t&&(this.vs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.emit("change",t,this))},enumerable:!1,configurable:!0}),n.prototype.snap=function(t,n){if(this.vs){var i=this.j;n.set(t,Math.round(t/i)*i)}},n.prototype.reset=function(){this.Xo=this.Wo,this.vs=this.Ko,this.j=this.Yo,this.emit("change",this)},n.prototype.serialize=function(){return[this.vs?1:0,this.Xo?1:0,this.j]},n.prototype.deserialize=function(t){this.enable=!!t[0],2 in t?(this.visible=!!t[1],this.size=t[2]):(this.visible=!1,this.size=t[1])},n}(t.utils.EventEmitter),Xv=function(){function t(){this.distance=NaN,this.result=0,this.threshold=10}return t.prototype.reset=function(t,n){this.distance=NaN,this.result=t,this.threshold=1e-4<n?10/n:10},t.prototype.set=function(t,n){var i=Math.abs(n-t);if(i<=this.threshold){var r=this.distance;(r!=r||i<r)&&(this.distance=i,this.result=n)}},t}(),Kv={HORIZONTAL:0,VERTICAL:1},Yv=function(){function t(t,n){this.type=t,this.position=n}return t.prototype.serialize=function(){return[this.type,this.position]},t}(),Jv=function(t){function n(n,i){var r,e,u=this;return(u=t.call(this)||this).values=[],u.Wo=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapTargetVisible(),u.Xo=u.Wo,u.Ko=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapTargetEnabled(),u.vs=u.Ko,u}return _(n,t),Object.defineProperty(n.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs!==t&&(this.vs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Xo},set:function(t){this.Xo!==t&&(this.Xo=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.values.length},enumerable:!1,configurable:!0}),n.prototype.add=function(t,n){null!=n?this.values.splice(n,0,t):this.values.push(t),this.emit("change",this)},n.prototype.remove=function(t){var n=this.values;0<=t&&t<n.length&&(n.splice(t,1),this.emit("change",this))},n.prototype.replace=function(t,n){var i=this.values;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.emit("change",this),r}return null},n.prototype.swap=function(t,n){if(t!==n){var i=this.values,r=i[t];i[t]=i[n],i[n]=r,this.emit("change",this)}},n.prototype.snap=function(t,n,i,r){if(this.vs)for(var e=this.values,u=0,s=e.length;u<s;++u){var h=e[u];h.type===Kv.VERTICAL?i.set(t,h.position):r.set(n,h.position)}},n.prototype.reset=function(){this.vs=this.Ko,this.Xo=this.Wo,this.values.length=0,this.emit("change",this)},n.prototype.serialize=function(){for(var t=[],n=this.values,i=0,r=n.length;i<r;++i)t.push(n[i].serialize());return[this.vs?1:0,this.Xo?1:0,t]},n.prototype.deserialize=function(t){this.vs=!!t[0],this.Xo=!!t[1];var n=t[2],i=this.values;i.length=0;for(var r=0,e=n.length;r<e;++r){var u=n[r];i.push(new Yv(u[0],u[1]))}this.emit("change",this)},n}(t.utils.EventEmitter),Zv=1e-5,qv={NONE:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,MIDDLE_LEFT:4,MIDDLE_RIGHT:5,BOTTOM_LEFT:6,BOTTOM_CENTER:7,BOTTOM_RIGHT:8,ROTATION:9},Qv=function(n){function i(i,r,e){var u,s=this;return(s=n.call(this)||this).jt=[new t.Point,new t.Point,new t.Point,new t.Point,new t.Point],s.Jo=[new t.Point,new t.Point],s.Zo=[1,1],s.qo=new t.Point,s.Qo=new Xv,s.$o=new Xv,s.ta={distance:0,scale:new t.Point},s.na=new t.Point,s.ia=new t.Rectangle,s.ra=new t.Point,s.grid=new Wv(r,null==e?void 0:e.grid),s.target=new Jv(r,null==e?void 0:e.target),s.p=i,s.Ko=null!==(u=null==e?void 0:e.enable)&&void 0!==u?u:r.isSnapEnabled(),s.vs=s.Ko,s}return _(i,n),Object.defineProperty(i.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs!==t&&(this.vs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),i.prototype.prepare=function(t){t.updateTransform();var n=t.transform.localTransform,i=t.width,r=t.height,e=this.jt;e[0].set(0,0),e[1].set(i,0),e[2].set(i,r),e[3].set(0,r),e[4].set(.5*i,.5*r),n.apply(e[0],e[0]),n.apply(e[1],e[1]),n.apply(e[2],e[2]),n.apply(e[3],e[3]),n.apply(e[4],e[4])},i.prototype.prepareForTranslate=function(t){this.vs&&this.prepare(t)},i.prototype.snap=function(t,n){var i=t.x,r=t.y,e=this.p.canvas,u=this.Qo,s=this.$o;if(null!=e){var h=Math.max(e.scale.x,e.scale.y);u.reset(i,h),s.reset(r,h),u.set(i,0),u.set(i,e.width),s.set(r,0),s.set(r,e.height)}else u.reset(i,1),s.reset(r,1);return this.target.snap(i,r,u,s),this.grid.snap(i,u),this.grid.snap(r,s),n.x=Th(u.distance)?NaN:u.result,n.y=Th(s.distance)?NaN:s.result,n},i.prototype.toSnapped=function(t,n){var i=t.x,r=t.y;if(this.vs){this.snap(t,n);var e=n.x,u=n.y;n.set(Th(e)?i:e,Th(u)?r:u)}else n.set(i,r);return n},i.prototype.toTranslationSnapped=function(t,n){var i=t.x,r=t.y,e=NaN,u=NaN;if(this.vs)for(var s=this.na,h=this.jt,o=0,a=h.length;o<a;++o){var c=h[o];if(s.set(c.x+i,c.y+r),this.snap(s,s),!Th(s.x)){var f=s.x-c.x;(Th(e)||Math.abs(f-i)<Math.abs(e-i))&&(e=f)}if(!Th(s.y)){var l=s.y-c.y;(Th(u)||Math.abs(l-r)<Math.abs(u-r))&&(u=l)}}return n.x=Th(e)?i:e,n.y=Th(u)?r:u,n},i.prototype.prepareForRotate=function(t){},i.prototype.getGridSizeRotation=function(){return 5},i.prototype.toRadian=function(t){return t/180*Math.PI},i.prototype.toDegree=function(t){return t/Math.PI*180},i.prototype.toRotationSnapped=function(t,n){if(this.vs){var i=this.getGridSizeRotation(),r=t+n,e=Math.round(this.toDegree(r)),u=e%90;return Math.abs(u)<=i?this.toRadian(e-u)-t:90-i<=u?this.toRadian(e+(90-u))-t:u<=-90+i?this.toRadian(e-(90+u))-t:n}return n},i.prototype.calcNormalizedVector=function(t,n,i){var r=n.x-t.x,e=n.y-t.y,u=Math.sqrt(r*r+e*e);if(Zv<u){var s=1/u;i.x=r*s,i.y=e*s}else i.x=1,i.y=0;return u},i.prototype.prepareForScale=function(t,n){if(this.vs){this.prepare(t);var i=this.jt,r=this.Jo,e=this.Zo;switch(n){case qv.TOP_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]),e[1]=this.calcNormalizedVector(i[3],i[0],r[1]);break;case qv.TOP_CENTER:e[0]=this.calcNormalizedVector(i[3],i[0],r[0]);break;case qv.TOP_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]),e[1]=this.calcNormalizedVector(i[2],i[1],r[1]);break;case qv.MIDDLE_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]);break;case qv.NONE:break;case qv.MIDDLE_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]);break;case qv.BOTTOM_LEFT:e[0]=this.calcNormalizedVector(i[2],i[3],r[0]),e[1]=this.calcNormalizedVector(i[0],i[3],r[1]);break;case qv.BOTTOM_CENTER:e[0]=this.calcNormalizedVector(i[0],i[3],r[0]);break;case qv.BOTTOM_RIGHT:e[0]=this.calcNormalizedVector(i[3],i[2],r[0]),e[1]=this.calcNormalizedVector(i[1],i[2],r[1])}}},i.prototype.setScaleSnappedResult=function(t,n,i,r,e){if(Zv<n&&(Th(e.distance)||t<e.distance)){e.distance=t;var u=1+i/n;r?e.scale.x=u:e.scale.y=u}},i.prototype.calcScaleSnapped1D=function(t,n,i,r,e,u){var s=this.qo;t.apply(n,s);var h=s.x,o=s.y;this.snap(s,s);var a=s.x,c=s.y;if(!Th(a)){var f=Math.abs(i.x);if(Zv<f){var l=(a-h)/i.x,v=Math.abs(l),b=(a-n.x)/i.x;this.setScaleSnappedResult(v,r,b,e,u)}}if(!Th(c)){var d=Math.abs(i.y);if(Zv<d){var g=(c-o)/i.y,m=(v=Math.abs(g),(c-n.y)/i.y);this.setScaleSnappedResult(v,r,m,e,u)}}},i.prototype.calcScaleSnappedX=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!0,e)},i.prototype.calcScaleSnappedY=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!1,e)},i.prototype.calcScaleSnapped2D=function(t,n,i,r,e){var u=this.qo;t.apply(n,u);var s=u.x,h=u.y;this.snap(u,u);var o=u.x,a=u.y;if(Th(o)){if(Th(a))return;o=s}else Th(a)&&(a=h);var c=i[0].x*i[1].y-i[1].x*i[0].y;if(Zv<Math.abs(c)){var f=o-s,l=a-h,v=Math.abs(f*f+l*l);if(Th(e.distance)||v<e.distance){e.distance=v;var b=o-n.x,d=a-n.y,g=(+i[1].y*b-i[1].x*d)/c,m=(-i[0].y*b+i[0].x*d)/c;e.scale.set(1+g/r[0],1+m/r[1])}}},i.prototype.calcScaleSnappedXY=function(t,n,i,r,e,u,s){this.calcScaleSnapped2D(t,n,e,u,s),this.calcScaleSnappedX(t,r,e[0],u[0],s),this.calcScaleSnappedY(t,i,e[1],u[1],s)},i.prototype.toScaleSnapped=function(t,n,i,r){if(this.vs){var e=this.jt,u=this.Jo,s=this.Zo,h=this.ta;switch(h.distance=NaN,h.scale.set(r.x,r.y),n){case qv.TOP_LEFT:this.calcScaleSnappedXY(t,e[0],e[1],e[3],u,s,h);break;case qv.TOP_CENTER:this.calcScaleSnappedY(t,e[0],u[0],s[0],h),this.calcScaleSnappedY(t,e[1],u[0],s[0],h);break;case qv.TOP_RIGHT:this.calcScaleSnappedXY(t,e[1],e[0],e[2],u,s,h);break;case qv.MIDDLE_LEFT:this.calcScaleSnappedX(t,e[0],u[0],s[0],h),this.calcScaleSnappedX(t,e[3],u[0],s[0],h);break;case qv.NONE:break;case qv.MIDDLE_RIGHT:this.calcScaleSnappedX(t,e[1],u[0],s[0],h),this.calcScaleSnappedX(t,e[2],u[0],s[0],h);break;case qv.BOTTOM_LEFT:this.calcScaleSnappedXY(t,e[3],e[2],e[0],u,s,h);break;case qv.BOTTOM_CENTER:this.calcScaleSnappedY(t,e[2],u[0],s[0],h),this.calcScaleSnappedY(t,e[3],u[0],s[0],h);break;case qv.BOTTOM_RIGHT:this.calcScaleSnappedXY(t,e[2],e[3],e[1],u,s,h)}if(!Th(h.distance)){if(r.copyFrom(h.scale),i)switch(n){case qv.TOP_LEFT:case qv.TOP_RIGHT:case qv.BOTTOM_LEFT:case qv.BOTTOM_RIGHT:r.x=r.y=Math.max(r.x,r.y);break;case qv.TOP_CENTER:case qv.BOTTOM_CENTER:r.x=r.y;break;case qv.MIDDLE_LEFT:case qv.MIDDLE_RIGHT:r.y=r.x}return!0}}return!1},i.prototype.reset=function(){this.enable=this.Ko,this.target.reset(),this.grid.reset()},i.prototype.serialize=function(){return[this.vs?1:0,this.target.serialize(),this.grid.serialize()]},i.prototype.deserialize=function(t){this.enable=!!t[0],this.target.deserialize(t[1]),this.grid.deserialize(t[2])},i}(t.utils.EventEmitter),$v=function(t){function n(n,i,r){var e=t.call(this,n,i.width,i.height,0,r)||this;return e.Bs=i,e}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.drawImage(this.Bs.canvas,n.x,n.y,n.width,n.height)},n}(de),tb=function(n,i,r,e){this.id=n,this.size=i,this.color=t.utils.hex2string(r),this.height=i+2*e;var u=Es.measure(n);this.ascent=u.ascent,this.descent=u.descent},nb=function(){function n(n,i,r,e){this.R=n,this.vr=document.createElement("canvas"),this.ea=null;var u=this.toPadding(i);this.Qn=u,this.Ye=new tb(n,i,r,u),this.Je={},this.Ze=0,this.ua=0,this.kt=1,this.pn=1,this.sa=0,this.ha=0,this.xe=t.Texture.from(this.vr,{mipmap:t.MIPMAP_MODES.OFF,resolution:e,scaleMode:t.SCALE_MODES.NEAREST});var s=this.Je;this.Vo(" "," ",s,Me.SPACE_R),this.Vo("\t"," ",s,Me.SPACE_R),this.Vo("...","...",s,Me.LETTER_RNB);for(var h=0,o=Oe.length;h<o;++h){var a=Oe[h];this.Vo(a,a,s,Me.LETTER_RNB)}}return n.prototype.toPadding=function(t){return Math.max(3,Math.ceil(.2*t))},Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"font",{get:function(){return this.Ye},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this.kt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvas",{get:function(){return this.vr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"characters",{get:function(){return this.Je},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){return this.xe},enumerable:!1,configurable:!0}),n.prototype.Vo=function(t,n,i,r){if(!this.isIgnored(n)){var e=i[t];if(null!=e)e.type&Me.RESERVED||(0===e.ref&&(this.ua-=1),e.ref+=1);else{var u=this.getAdvance(n),s=this.Qn,h=Math.ceil(s+u+s),o=this.font.height;i[t]=new Ee(n,u,h,o,r),this.Ze+=1,this.sa+=1}}},n.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},n.prototype.oa=function(t,n){var i=n[t];null!=i&&!(i.type&Me.RESERVED)&&0<i.ref&&(i.ref-=1,0===i.ref&&(this.ua+=1))},n.prototype.aa=function(){if(this.Ze>>1<=this.ua){var t=this.Je;for(var n in t)t[n].ref<=0&&delete t[n];this.Ze-=this.ua,this.sa+=1,this.ua=0}},n.prototype.add=function(t,n){void 0===n&&(n=Me.LETTER);for(var i=this.Je,r=b.from(t);r.hasNext();){var e=r.next();this.Vo(e,e,i,n)}},n.prototype.remove=function(t){for(var n=this.Je,i=b.from(t);i.hasNext();)this.oa(i.next(),n)},n.prototype.get=function(t){return this.Je[t]},n.prototype.getAdvance=function(t){var n=this.getContext();return null!=n?n.measureText(t).width:0},n.prototype.getContext=function(){var t=this.ea;if(null==t){var n=this.vr;if(null==n)return null;if(null==(t=this.ea=n.getContext("2d",{alpha:!0})))return null}var i=this.Ye;return t.font!==i.id&&(t.font=i.id,i.id=t.font,t.textAlign="left",t.textBaseline="alphabetic",t.lineWidth=0,t.lineCap="round",t.lineJoin="miter",t.miterLimit=0,t.fillStyle=i.color,t.strokeStyle="#0000ff"),t},n.prototype.update=function(){if(this.aa(),this.ha<this.sa){this.ha=this.sa;var t=this.vr;if(null!=t){var n=this.Ye,i=n.height,r=this.Je,e=this.kt=this.toPowerOf2(Math.ceil(Math.sqrt(this.Ze))*i),u=this.Qn,s=Math.round(.5*(i-(n.ascent+n.descent))+n.ascent),h=0,o=0;for(var a in r)e<=h+(g=r[a]).width&&(h=0,o+=i),g.x=h,g.y=o,g.origin.x=h+u,g.origin.y=o+s,h+=g.width;var c=this.pn=o+i,f=this.xe.baseTexture,l=f.resolution,v=Math.ceil(e*l),b=Math.ceil(c*l);t.width=v,t.height=b;var d=this.getContext();if(null!=d){for(var a in d.save(),d.scale(l,l),d.clearRect(0,0,e,c),r){var g=r[a];d.fillText(a,g.origin.x,g.origin.y)}d.restore()}return f.setRealSize(v,b),!0}}return!1},n.prototype.getRevision=function(){return this.sa},n.prototype.getRevisionUpdate=function(){return this.ha},Object.defineProperty(n.prototype,"length",{get:function(){return this.Ze},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){null!=this.vr&&(this.vr=null);var t=this.Je;for(var n in t)delete t[n]},n.prototype.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},n}(),ib=function(t){t.update()},rb=function(t){t.forEach(ib)},eb=function(t){t.update()},ub=function(t){t.forEach(eb)},sb=function(){function t(t){var n=this;this.qe=new Map,this.Mn=t.renderer.resolution,t.renderer.on("prerender",(function(){n.update()}))}return t.prototype.add=function(t,n,i,r){var e=this.qe,u=e.get(t);null==u&&(u=new Map,e.set(t,u));var s=u.get(i);null==s&&(s=new nb(t,n,i,this.Mn),u.set(i,s)),s.add(r)},t.prototype.remove=function(t,n,i){var r=this.qe.get(t);if(null!=r){var e=r.get(n);null!=e&&e.remove(i)}},t.prototype.get=function(t,n){var i=this.qe.get(t);if(null==i)return null;var r=i.get(n);return null==r?null:r},t.prototype.update=function(){this.qe.forEach(rb)},t.prototype.destroy=function(){var t=this.qe;t.forEach(ub),t.clear()},t}(),hb=function(t){if("object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)){var n=Object.getPrototypeOf(t);return null==n||n===Object.prototype}return!1},ob=function(){function t(t,n,i){var r=this;this.instance=null,this.newInstance=t,this.options=n,null!=i&&(i.state.isActive&&setTimeout((function(){r.get()}),0),i.on("active",(function(){r.get()})))}return t.prototype.get=function(){var t=this.instance;return null==t&&(t=new this.newInstance(this.options),this.instance=t),t},t}(),ab=function(t,n,i,r){for(var e=0,u=Math.floor(t.length/i)-1;e<=u;){var s=e+(u-e>>1),h=t[s*i+r];if(n<h)u=s-1;else{if(!(h<n))return s;e=s+1}}return Math.max(e,u)},cb=function(t){return mt(t)?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n[i]=t[i];return n}(t):hb(t)?function(t){var n={};for(var i in t)Object.hasOwnProperty.call(t,i)&&(n[i]=cb(t[i]));return n}(t):t},fb=function(t){if(null!=t){if(Ot(t))return t;if(pt(t))return String(t);if("name"in t)return t.name;if("label"in t)return t.label;if("id"in t)return t.id}return""},lb=function(t,n){if(null!=t){var i=cb(t);if(null!=n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var e=n[r];if(hb(e))if(Object.prototype.hasOwnProperty.call(i,r)){var u=i[r];hb(u)&&lb(u,e)}else i[r]=cb(e);else Object.prototype.hasOwnProperty.call(i,r)||(i[r]=e)}return i}return null!=n?cb(n):{}},vb=function(){function n(t,n,i){this.kt=t,this.ca=n,this.te=i,this.fa={},this.la="",this.va=0,this.ba=0,this.pn=0}return Object.defineProperty(n.prototype,"width",{get:function(){return this.kt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ratio",{get:function(){return this.ca},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},enumerable:!1,configurable:!0}),n.prototype.add=function(n,i,r,e){var u=this.fa;if(!(n in u)){var s=this.te,h=this.va,o=this.ba;this.kt<=h+i?(h=0,o=this.ba+this.pn+s,this.pn=r,this.ba=o):this.pn=Math.max(this.pn,r),this.va=h+i+s,u[n]=new t.Rectangle(h,o,i,r);var a=this.ca;return this.la+='<g transform="translate('.concat(h*a,",").concat(o*a,')">').concat(e,"</g>"),!0}return!1},n.prototype.has=function(t){return t in this.fa},Object.defineProperty(n.prototype,"mappings",{get:function(){return this.build()},enumerable:!1,configurable:!0}),n.prototype.build=function(n){var i,r,e,u=this.da;if(null==u||(null==n?void 0:n.force)){var s=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1,h=this.kt,o=Math.pow(2,Math.ceil(Math.log(this.ba+this.pn)/Math.LN2)),a=h*s,c=o*s,f=this.ca,l='width="'.concat(a,'"'),v='height="'.concat(c,'"'),b='viewBox="0 0 '.concat(h*f," ").concat(o*f,'"'),d=Pv("<svg ".concat(l," ").concat(v," ").concat(b," ").concat('xmlns="http://www.w3.org/2000/svg"',">").concat(this.la,"</svg>")),g=null!==(e=null==n?void 0:n.scaling)&&void 0!==e?e:t.SCALE_MODES.NEAREST,m=t.BaseTexture.from(d,{resolution:s,scaleMode:g}),w=this.fa;for(var p in u=this.da={},w)u[p]=new t.Texture(m,w[p])}return u},n}(),bb=function(){function n(){}return n.toTexture=function(n,i,r,e){var u=n.transform.scale,s=t.RenderTexture.create({width:n.width*u.x,height:n.height*u.y,scaleMode:t.SCALE_MODES.LINEAR,resolution:i}),h=new t.Matrix(void 0,void 0,void 0,void 0,-n.position.x,-n.position.y),o=st.getLayer(n);return o&&o.renderer.render(n,s,r,h,e),s},n.toPixels=function(t,n){var i=t.resolution,r=t.frame,e=Math.floor(r.width*i),u=Math.floor(r.height*i),s=new Uint8Array(4*e*u);n.renderTexture.bind(t);var h=n.gl;return h.readPixels(r.x*i,r.y*i,e,u,h.RGBA,h.UNSIGNED_BYTE,s),{width:e,height:u,array:s}},n.toCanvas=function(n,i,r){var e=n.width,u=n.height,s=n.array,h=new t.utils.CanvasRenderTarget(e,u,1),o=h.context.getImageData(0,0,e,u);if(r?o.data.set(s):t.Extract.arrayPostDivide(s,o.data),h.context.putImageData(o,0,0),null!=i&&1!==i){h.context.scale(i,i),h.context.drawImage(h.canvas,0,0);var a=Math.floor(e*i),c=Math.floor(u*i),f=h.context.getImageData(0,0,a,c);h.resize(a,c),h.context.putImageData(f,0,0)}return h},n.toBase64=function(t,n,i){return t.toDataURL(n,i)},n}(),db=function(){function t(){}return t.downloadUrl=function(t,n){var i=document.createElement("a");"download"in i?(i.href=n,i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),66)):window.open(n)||(location.href=n)},t.download=function(t,n,i){var r=new Blob(!1!==i?["\ufeff",n]:[n],{type:"text/plain"}),e=window.navigator;"msSaveBlob"in e?e.msSaveBlob(r,t):this.downloadUrl(t,URL.createObjectURL(r))},t}(),gb=function(){function t(){}return t.texture=function(t){var n,i=t.target,r=function(t){var n,i=t.target,r=t.resolution;if(null!=r){if(pt(r))return r;var e=i.transform.scale,u=Math.max(i.width*e.x,i.height*e.y);return Math.min(1,r.size/u)}return null!==(n=window.devicePixelRatio)&&void 0!==n?n:1}(t),e=null===(n=t.transform)||void 0===n?void 0:n.update;return bb.toTexture(i,r,t.clear,e)},t.pixels=function(t){var n=function(t){var n=t.renderer;if(n)return n;var i=t.application;if(i)return i.getLayerBase().renderer;var r=t.layer||st.getLayer(t.target);if(r)return r.renderer;throw new Error("No renderer / application / layer found.")}(t),i=this.texture(t);try{return bb.toPixels(i,n)}finally{i&&i.destroy()}},t.canvas=function(t){var n,i,r=this.pixels(t),e=null===(i=null===(n=t.alpha)||void 0===n?void 0:n.premultiplied)||void 0===i?void 0:i.ignore,u=function(t,n){var i=n.scale;if(null!=i){if(pt(i))return i;var r=i.size;return Math.min(1,r/t.width,r/t.height)}}(r,t);return bb.toCanvas(r,u,e)},t.base64=function(t){var n=this.canvas(t);try{return bb.toBase64(n.canvas,t.format,t.quality)}finally{n&&n.destroy()}},t.file=function(t){db.downloadUrl(t.filename,this.base64(t))},t}(),mb={TEXT:0,DATA_URL:1,BINARY_STRING:2,ARRAY_BUTTER:3,FILE:4},wb=function(){function t(t,n){this.Ah=null,this.ga=t,this.ma=n}return t.prototype.open=function(){var t=this.getOrCreateInput();null!=t?t.click():this.onCancel()},t.prototype.getOrCreateInput=function(){var t=this;if("FileReader"in window&&null==this.Ah){var n=document.createElement("input");this.Ah=n,n.setAttribute("type","file"),n.setAttribute("style","display:none"),n.addEventListener("change",(function(i){t.onInputChange(n),n.value="",i.stopImmediatePropagation(),i.preventDefault()})),document.body.appendChild(n)}return this.Ah},t.prototype.onInputChange=function(t){var n=this,i=t.files;if(null!=i&&0<i.length){var r=i[0];if(this.ga===mb.FILE)this.onOpen(r,r);else{var e=new FileReader;switch(e.onload=function(t){if(null!=t.target){var i=t.target;n.onOpen(i.result,r)}},e.onabort=function(t){n.onAboart(t)},this.ga){case mb.TEXT:e.readAsText(r);break;case mb.DATA_URL:e.readAsDataURL(r);break;case mb.BINARY_STRING:e.readAsBinaryString(r);break;case mb.ARRAY_BUTTER:e.readAsArrayBuffer(r);break;default:e.readAsText(r)}}}else this.onCancel()},t.prototype.onOpen=function(t,n){var i=this.ma;i.emit("open",t,n,i)},t.prototype.onAboart=function(t){var n=this.ma;n.emit("abort",t,n)},t.prototype.onCancel=function(){var t=this.ma;t.emit("cancel",t)},t}(),pb=function(){function t(){}return t.fromRgb=function(t){var n=(16711680&t)>>16,i=(65280&t)>>8,r=255&t|0,e=Math.max(n,i,r),u=e-Math.min(n,i,r),s=0;return 0<u&&(n===e?s=60*(i-r)/u:i===e?s=60*(r-n)/u+120:r===e&&(s=60*(n-i)/u+240),s<0&&(s+=360)),[s,u/e*255,e]},t.toRgb=function(t,n,i){var r=i-n/255*i,e=i-r,u=0,s=0,h=0;return t<=60?(u=i,s=t/60*e+r,h=r):t<=120?(u=(120-t)/60*e+r,s=i,h=r):t<=180?(u=r,s=i,h=(t-120)/60*e+r):t<=240?(u=r,s=(240-t)/60*e+r,h=i):t<=300?(u=(t-240)/60*e+r,s=r,h=i):(u=i,s=r,h=(360-t)/60*e+r),(u=Math.max(0,Math.min(255,u)))<<16|(s=Math.max(0,Math.min(255,s)))<<8|Math.max(0,Math.min(255,h))},t}(),Ob=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.$u),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.$u),t.prototype.onElementDetached.call(this,n,i,r)},n.prototype.onInputKeyDown=function(t){nr.isOkKey(t)&&this.yu.onEnter()},n}(bu),Db=function(){function t(){}return t.create=function(t){var n=this.Jt;return t in n?"".concat(t," ").concat(++n[t]):(n[t]=1,"".concat(t," 1"))},t.Jt={},t}(),Eb=function(){function t(){}return t.toCode=function(t,n){var i=t>>8&255,r=255&t;return"rgba(".concat(t>>16&255,",").concat(i,",").concat(r,",").concat(n,")")},t}(),Mb=function(){function t(t,n,i){var r=this;this.wa=new Set,this.Rt=t,this.pa=n,this.Z=i,this.Oa=null,this.Da=function(){r.update()}}return t.prototype.start=function(){return null==this.Oa&&(this.Oa=window.setTimeout(this.Da,this.pa)),this},t.prototype.stop=function(){var t=this.Oa;return null!=t&&(this.Oa=null,clearTimeout(t)),this},t.prototype.add=function(t){return this.wa.add(t),t.state.set(this.Rt,this.isOn(Date.now())),this},t.prototype.remove=function(t){return!!this.wa.delete(t)&&(t.state.remove(this.Rt),!0)},t.prototype.contains=function(t){return this.wa.has(t)},t.prototype.clear=function(){return this.wa.clear(),this},t.prototype.isOn=function(t){return Math.floor(t/this.Z)%2==0},t.prototype.update=function(){var t=Date.now(),n=this.isOn(t),i=this.Rt;this.wa.forEach((function(t){t.state.set(i,n)}));var r=this.Z;return this.Oa=window.setTimeout(this.Da,r-t%r),this},t}(),Sb=function(){function t(t){var n;this.hi=null!==(n=null==t?void 0:t.duration)&&void 0!==n?n:300,this.au=null,this.Ea=0,this.Ma=null}return t.prototype.show=function(t,n){var i=this,r=this.Ma;null!=r&&clearTimeout(r);var e=this.au;if(t!==e){var u=this.hi,s=this.Ea,h=Date.now(),o=s+u-h;!0===n||o<=0?this.update(h,t):this.Ma=window.setTimeout((function(){i.update(Date.now(),t)}),o)}},t.prototype.update=function(t,n){var i=this.au;i!==n&&(this.Ea=t,null!=i&&i.hide(),this.au=n,null!=n&&n.show())},t.prototype.hide=function(){this.show(null)},t}(),Tb=function(){function t(){this.Sa=null,this.Ta=0,this.Vs=null,this.ja=null}return t.prototype.getNames=function(){var t=this.Na;return null==t&&(t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DOMMouseScroll","MozMousePixelScroll"],this.Na=t),t},t.prototype.on=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.addEventListener(u,n,i)}},t.prototype.off=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.removeEventListener(u,n,i)}},t.prototype.getLineHeight=function(){if(null==this.Vs){var t=Z.getInstance().get("DBase");this.Vs=t.getLineHeight()}return this.Vs},t.prototype.getPageHeight=function(){return null==this.ja&&(this.ja=12*this.getLineHeight()),this.ja},t.prototype.normalize=function(t){var n=0,i=0;if("detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(n=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(n=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(n=t.deltaX),0===i&&0===n)return null;var r=Math.max(Math.abs(i),Math.abs(n)),e=Date.now();this.Ta+200<=e&&(this.Sa=null),this.Ta=e;var u="mousewheel"===t.type&&r%120==0;(!this.Sa||r<this.Sa)&&(this.Sa=r,u&&(this.Sa/=40)),u&&(r/=40,n/=40,i/=40);var s=this.Sa;r=Math.floor(r/s),n=Math[1<=n?"floor":"ceil"](n/s),i=Math[1<=i?"floor":"ceil"](i/s);var h=t.deltaMode||0;if(0!==h){var o=1===h?this.getLineHeight():this.getPageHeight();r*=o,n*=o,i*=o}return{mode:h,delta:r,deltaX:n,deltaY:i,lowest:s}},t.getInstance=function(){return null==this.INSTANCE&&(this.INSTANCE=new t),this.INSTANCE},t}(),jb=function(t){function n(n){var i,r=this;return(r=t.call(this)||this).ei=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,r.ai=!1,r.Fu=!1,r.ci=null==n?void 0:n.onTime,r.li=null==n?void 0:n.onStart,r.vi=null==n?void 0:n.onEnd,r}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.ei},set:function(t){this.ei=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.Fu=!0,this.ai=t,this.onStart(t),this.Fu&&(this.onTime(t?1:0,t,0),this.Fu&&(this.onTime(t?0:1,t,0),this.Fu||this.onEnd(t)))},n.prototype.onStart=function(t){var n=this.li;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ci;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.vi;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return this.Fu},n.prototype.isReverse=function(){return this.ai},n.prototype.stop=function(){this.Fu=!1},n.prototype.end=function(){if(this.Fu){this.Fu=!1;var t=this.ai,n=t?0:1;this.onTime(n,t,0),this.onEnd(t)}},n}(t.utils.EventEmitter),Nb=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Ia=0,e.Ca=0,e.Aa=0,e.Ra=0,e.ka=null,e.bs=null;var u=null==n?void 0:n.shift;return e.La=null!==(i=null==u?void 0:u.x)&&void 0!==i?i:0,e.ya=null!==(r=null==u?void 0:u.y)&&void 0!==r?r:15,e.ws=function(){e.onPrerender()},e.xa=function(){e.onPostrender()},e}return _(n,t),n.prototype.stop=function(){this.Ra=0,this.removeEventListeners(),t.prototype.stop.call(this)},n.prototype.addEventListeners=function(t){var n=st.getLayer(t);if(n){this.bs=n;var i=n.renderer;i.on("prerender",this.ws),i.on("postrender",this.xa)}},n.prototype.removeEventListeners=function(){var t=this.bs;if(t){this.bs=null;var n=t.renderer;n.off("prerender",this.ws),n.off("postrender",this.xa)}},n.prototype.onStart=function(n){var i=this.ka=this.ei;null!=i&&(this.Ra=0,this.removeEventListeners(),this.addEventListeners(i),n||(i.visible=!0),t.prototype.onStart.call(this,n))},n.prototype.onTime=function(n,i,r){if(null!=this.ka){var e=this.bs;e?(this.Ra=n,t.prototype.onTime.call(this,n,i,r),e.update()):(this.Ra=n,t.prototype.onTime.call(this,n,i,r))}},n.prototype.onEnd=function(n){var i=this.ka;null!=i&&(this.removeEventListeners(),n&&(i.visible=!1),t.prototype.onEnd.call(this,n))},n.prototype.onPrerender=function(){var t=this.ka;if(null!=t){var n=this.Ra,i=t.unsafe.position;this.Ia=i.x,this.Ca=i.y,i.set(i.x-this.La*(1-n),i.y-this.ya*(1-n)),this.Aa=t.alpha,t.alpha=n}},n.prototype.onPostrender=function(){var t=this.ka;null!=t&&(t.unsafe.position.set(this.Ia,this.Ca),t.alpha=this.Aa)},n}(br),Ib=function(){function t(t){var n,i,r,e;pt(t)?(this.top=t,this.right=t,this.bottom=t,this.left=t):null!=t?(this.top=null!==(n=t.top)&&void 0!==n?n:6,this.right=null!==(i=t.right)&&void 0!==i?i:6,this.bottom=null!==(r=t.bottom)&&void 0!==r?r:6,this.left=null!==(e=t.left)&&void 0!==e?e:6):(this.top=6,this.right=6,this.bottom=6,this.left=6)}return t.prototype.getTheme=function(){throw new Error("Not supported")},t.prototype.setTheme=function(t){throw new Error("Not supported")},t.prototype.getTop=function(){return this.left},t.prototype.getRight=function(){return this.right},t.prototype.getBottom=function(){return this.bottom},t.prototype.getLeft=function(){return this.left},t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r)},t}(),Cb=function(){function t(t){var n,i=t.root;this.Ba=i,this.Ds=t.overlay,this.Qn=new Ib(null==t?void 0:t.padding);var r=100,e=100;if(t)if(null!=t.width)r=t.width,e=null!=t.height?t.height:i.getBoundingClientRect().height;else if(null!=t.height)r=i.getBoundingClientRect().width,e=t.height;else{var u;r=(u=i.getBoundingClientRect()).width,e=u.height}else r=(u=i.getBoundingClientRect()).width,e=u.height;var s=null==t?void 0:t.background,h=0,o=!0;if(null!=s){var a=s.color;null!=a&&(h=a,o=!1)}var c=t.resolution,f=null!==(n=null==t?void 0:t.antialias)&&void 0!==n&&n;this.Pa={width:r,height:e,autoStart:!1,backgroundColor:h,transparent:o,resolution:c,antialias:f}}return t.prototype.getRootElement=function(){return this.Ba},t.prototype.setRootElement=function(t,n){if(this.Ba!==t&&(this.Ba=t,!1!==n)){var i=t.getBoundingClientRect(),r=this.Pa;r.width=i.width,r.height=i.height}return this},t.prototype.getWidth=function(){return this.Pa.width},t.prototype.setWidth=function(t){return this.Pa.width=t,this},t.prototype.getHeight=function(){return this.Pa.height},t.prototype.setHeight=function(t){return this.Pa.height=t,this},t.prototype.getPadding=function(){return this.Qn},t.prototype.setPadding=function(t,n,i,r){var e=this.Qn;return e.left=t,e.top=n,e.right=i,e.bottom=r,this},t.prototype.getBackgroundColor=function(){return this.Pa.backgroundColor},t.prototype.setBackgroundColor=function(t){return this.Pa.backgroundColor=t,this},t.prototype.getAntialias=function(){return this.Pa.antialias},t.prototype.setAntialias=function(t){return this.Pa.antialias=t,this},t.prototype.isOverlay=function(){return this.Ds},t.prototype.getPixiApplicationOptions=function(){return this.Pa},t}(),Ab=function(){function t(){}return t.prototype.isStorable=function(){return!0},t.prototype.isClear=function(){return!1},t.prototype.isClean=function(){return!1},t.prototype.execute=function(){return!0},t.prototype.merge=function(t){return!1},t.prototype.isMerged=function(){return!1},t.prototype.redo=function(){return!0},t.prototype.undo=function(){return!0},t.prototype.destroy=function(){},t}(),Rb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(Ab),kb=function(t){function n(){var n=t.call(this)||this;return n._=0,n.Fa=[],n}return _(n,t),n.prototype.last=function(){var t=this.Fa,n=t.length;return 0<n?t[n-1]:null},n.prototype.push=function(t){this.merge(t),this.execute(t)},n.prototype.merge=function(t){var n=this.Fa,i=t.isClear(),r=t.isStorable();if(i||r){var e=i?n.length:this._;0<e&&(this.remove(e),this._=0,this.emit("change",this)),this.cleanup()}var u=n.length;0<u&&t.merge(n[u-1])},n.prototype.execute=function(t){return this.emit("executing",t,this),t.execute()?this.onSuccess(t):this.onFail(t)},n.prototype.onSuccess=function(t){t.isStorable()&&(t.isMerged()||this.Fa.push(t),t.isClean()||this.emit("dirty",this)),this.emit("change",this),this.emit("executed",t,this)},n.prototype.onFail=function(t){t.destroy(),this.emit("change",this)},n.prototype.cleanup=function(){var t=this.Fa,n=t.length-100;if(0<n)for(var i=0;i<n;++i)t[i].destroy(),t.shift()},n.prototype.remove=function(t){var n=this.Fa;if(0<t){var i=Math.max(0,n.length-t);if(0<(t=n.length-i)){for(var r=i,e=n.length;r<e;++r)n[r].destroy();return n.splice(i,n.length-i),!0}}return!1},n.prototype.size=function(){return this.Fa.length},n.prototype.clear=function(){this.push(new Rb)},n.prototype.redo=function(){this.isRedoable()&&this.doRedo()},n.prototype.doRedo=function(){var t=this.Fa;if(0<this._){var n=t[t.length-this._];this._-=1,this.emit("change",this),this.emit("redoing",n,this),!0===n.redo()?this.onRedoSuccess(n):this.onRedoFail(n)}},n.prototype.onRedoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("redoed",t,this)},n.prototype.onRedoFail=function(t){this.emit("change",this)},n.prototype.isRedoable=function(){return 0<this._},n.prototype.undo=function(){this.isUndoable()&&this.doUndo()},n.prototype.doUndo=function(){var t=this.Fa;if(this._<t.length){var n=t[t.length-1-this._];this._+=1,this.emit("change",this),this.emit("undoing",n,this),!0===n.undo()?this.onUndoSuccess(n):this.onUndoFail(n)}},n.prototype.onUndoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("undoed",t,this)},n.prototype.onUndoFail=function(t){this.emit("change",this)},n.prototype.isUndoable=function(){return this._<this.Fa.length},n}(t.utils.EventEmitter),Lb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t,n,i){var r=this;t.addEventListener("keydown",(function(t){r.emit("keydown",t);var e=i.get();if(null!=e)for(var u=e;null!=u;){if(r.hasOnKeyDown(u)&&u.onKeyDown(t))return;u=u.parent}if(nr.isFocusKey(t)){var s=nr.getFocusDirection(t),h=null!=e?i.find(e,!1,e.state.isFocusRoot||s,s):i.find(n,!1,!0,s);null!=h&&(i.focus(h),t.preventDefault(),t.stopImmediatePropagation())}})),t.addEventListener("keyup",(function(t){r.emit("keyup",t);var n=i.get();if(null!=n)for(var e=n;null!=e;){if(r.hasOnKeyUp(e)&&e.onKeyUp(t))return;e=e.parent}}))},n.prototype.hasOnKeyDown=function(t){return"onKeyDown"in t},n.prototype.hasOnKeyUp=function(t){return"onKeyUp"in t},n}(t.utils.EventEmitter),yb=function(){function t(){}return t.getKeyboardController=function(){return null==this.KEYBOARD&&(this.KEYBOARD=new Lb),this.KEYBOARD},t.setKeyboardController=function(t){var n=this.KEYBOARD;return this.KEYBOARD=t,n},t.getCommandController=function(){return null==this.COMMAND&&(this.COMMAND=new kb),this.COMMAND},t.setCommandController=function(t){var n=this.COMMAND;return this.COMMAND=t,n},t.getDocumentController=function(){if(null==this.DOCUMENT)throw new Error("Not supported");return this.DOCUMENT},t.setDocumentController=function(t){var n=this.DOCUMENT;return this.DOCUMENT=t,n},t}(),xb=function(n){function i(t,i){var r=n.call(this,i.getPixiApplicationOptions())||this;return r.Ua=null,r.Ga=null,r.zn=i,r.st=!1,r.Xo=!0,r.Ha=i.isOverlay(),r.Qn=i.getPadding(),r.za=i.getRootElement(),r.Va=5,r.Wa=r.newElementContainer(),r.application=t,r.Xa=function(){null!=r.Ua&&r.render()},r.initStage(),r.initView(),r.initRootElement(),r.initFocusHandling(),r.initResizeHandling(),r.initWheelHandling(),r.initDoubleClickHandling(),r}return _(i,n),i.prototype.newElementContainer=function(){var t=document.createElement("div");return t.setAttribute("style","position: absolute; top: 0; left: 0; width: 0; height: 0;margin: 0; padding: 0; outline: none;"),t},i.prototype.initStage=function(){var t=this.stage;t.layer=this,t.application=this.application,t.interactive=!0},i.prototype.initView=function(){var t=this.view.style;t.position="absolute",t.top="0",t.left="0",t.width="100%",t.height="100%",t.display="block",t.outline="none",t.webkitTapHighlightColor="rgba(255,255,255,0)",t.webkitUserSelect="none",t.setProperty("-khtml-user-select","none"),t.setProperty("-moz-user-select","none"),t.setProperty("-ms-user-select","none"),t.userSelect="none"},i.prototype.initRootElement=function(){var t=this,n=this.view,i=this.Ha,r=this.za,e=this.Wa,u=i?2:0,s=r.children;if(u<s.length){var h=s[u];r.insertBefore(n,h),r.insertBefore(e,h)}else r.appendChild(n),r.appendChild(e);if(i){var o=this.stage,a=o.onChildrenChange;o.onChildrenChange=function(){t.onStageDirty(),a.call(o)}}var c=r.style;r!==document.body&&"static"===window.getComputedStyle(r).position&&(c.position="relative"),c.margin="0",c.padding="0",c.overflow="hidden"},i.prototype.initFocusHandling=function(){var t=this.view,n=this.stage,i=this.getFocusController();t.setAttribute("tabindex","0"),yb.getKeyboardController().init(t,n,i),this.renderer.plugins.interaction.on(ir.down,(function(t){null!=t.target&&t.target!==n||i.clear()}))},i.prototype.initResizeHandling=function(){var t=this,n=function(){t.onResize()};window.addEventListener("resize",n),window.addEventListener("orientationchange",n)},i.prototype.onResize=function(){var t=this.za.getBoundingClientRect(),n=t.width,i=t.height;this.renderer.resize(n,i);for(var r=this.Qn,e=this.stage.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof hr&&h.onParentResize(n,i,r)}this.update()},i.prototype.initWheelHandling=function(){var n=new t.Point,i=Tb.getInstance(),r=this.renderer.plugins.interaction;i.on(this.view,(function(t){var e=t;ir.toGlobal(e,r,n);var u,s=r.hitTest(n),h=i.normalize(t);if(null!=h)for(;null!=s;){if(null!=(u=s)&&null!=u.onWheel&&s.onWheel(e,h,n)){e.preventDefault();break}s=s.parent}}))},i.prototype.initDoubleClickHandling=function(){var t=this.getFocusController(),n=this.renderer.plugins.interaction;ir.onDblClick(this.view,(function(i){var r,e=t.get();if(null!=e)for(var u=e;null!=u&&(null==(r=u)||null==r.onDblClick||!u.onDblClick(i,n));)u=u.parent}))},i.prototype.lock=function(){this.st=!0},i.prototype.unlock=function(){this.st=!1},i.prototype.update=function(){this.st||null!=this.Ua||(this.Ua=requestAnimationFrame(this.Xa))},i.prototype.onStageDirty=function(){this.Ha&&(0<this.stage.children.length?this.Xo||(this.Xo=!0,this.view.style.display="block"):this.Xo&&(this.Xo=!1,this.view.style.display="none"))},i.prototype.render=function(){this.reflow(),this.Ua=null,n.prototype.render.call(this)},Object.defineProperty(i.prototype,"width",{get:function(){return this.screen.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.screen.height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Qn},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){for(var t=this.stage.children,n=0,i=this.Va;n<i;++n){for(var r=!1,e=0,u=t.length;e<u;++e){var s=t[e];s instanceof hr&&(s.reflow(),r=r||s.isDirty()||s.hasDirty()||s.isHierarchyDirty())}if(!r)break}},i.prototype.getFocusController=function(){return this.application.getFocusController()},i.prototype.getRootElement=function(){return this.za},i.prototype.getElementContainer=function(){return this.Wa},i.prototype.getDynamicFontAtlases=function(){return null==this.Ga&&(this.Ga=new sb(this)),this.Ga},i}(t.Application),Bb=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.Es=null,n}return _(n,t),n.prototype.focus=function(t){var n=this.Es;return n!==t?(null!=n&&(n.state.isFocused=!1),this.Es=t,this.isFocusable(t)&&(t.state.isFocused=!0),this.emit("change",t,n,this),n):null},n.prototype.blur=function(t){return null!=t&&this.Es===t?(this.Es=null,t.state.isFocused=!1,this.emit("change",null,t,this),t):null},n.prototype.clear=function(){return this.focus(null)},n.prototype.set=function(t,n){return n?this.focus(t):this.blur(t)},n.prototype.get=function(){return this.Es},n.prototype.findParent=function(t){for(var n=t;null!=n;){if(this.isFocusable(n))return n;n=n.parent}return null},n.prototype.find=function(t,n,i,r,e){if(r){if(null!=(o=this.findNext(t,n,i)))return o;if(this.isFocusRoot(t,e))return null;var u=t.parent;if(null!=u&&0<=(c=(a=u.children).indexOf(t))){var s=a.length;if(this.isFocusReverse(u)){for(var h=c-1;0<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=s-1;c<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}else{for(h=c+1;h<s;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}}}else{var o;if(null!=(o=this.findPrevious(t,n,i)))return o;var a,c,f=t.parent;if(null!=f&&0<=(c=(a=f.children).indexOf(t)))if(s=a.length,this.isFocusReverse(f)){for(h=c+1;h<s;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}else{for(h=c-1;0<=h;--h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=s-1;c<=h;--h){var l;if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}}}return null},n.prototype.findNext=function(t,n,i){if(n&&this.isFocusable(t))return t;if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=e-1;0<=u;--u)if(null!=(s=this.findNext(r[u],!0,!0)))return s}else for(u=0;u<e;++u){var s;if(null!=(s=this.findNext(r[u],!0,!0)))return s}}return null},n.prototype.findPrevious=function(t,n,i){if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=0;u<e;++u)if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}else for(u=e-1;0<=u;--u){var s;if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}}return n&&this.isFocusable(t)?t:null},n.prototype.isFocusable=function(t){return null!=t&&"state"in t&&t.state.inEnabled&&t.state.isFocusable&&t.visible},n.prototype.isFocusableContainer=function(t){return null!=t&&"children"in t},n.prototype.isFocusRoot=function(t,n){return t===n||null!=t&&"state"in t&&t.state.isFocusRoot&&t.visible},n.prototype.isFocusReverse=function(t){return null!=t&&"state"in t&&t.state.isFocusReverse},n}(t.utils.EventEmitter),_b=function(){function n(n){var i,r;st.add(this);var e=this.toRootElement(n);this.Ba=e,this.initFocusHandling(e);var u=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1;this.Mn=u,delete t.Renderer.__plugins.accessibility,this.zn=n;var s=this.newLayerBase(n);this.Pr=s,this.Ka=!!(null==n?void 0:n.overlay),this.Ka||(this.Ds=s)}return Object.defineProperty(n.prototype,"stage",{get:function(){return this.Pr.stage},enumerable:!1,configurable:!0}),n.prototype.getRootElement=function(){return this.Ba},n.prototype.getResolution=function(){return this.Mn},n.prototype.toRootElement=function(t){var n=null==t?void 0:t.root;if(null!=n){if(!Ot(n))return n;var i=document.querySelector(n);if(i)return i}return document.body},n.prototype.toLayerBaseOptions=function(t){var n=this.Ba,i=this.Mn;return new Cb(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:t.background,resolution:i,antialias:t.antialias,overlay:!1}:{root:n,resolution:i,overlay:!1})},n.prototype.getFocusController=function(){return null==this.Ya&&(this.Ya=new Bb),this.Ya},n.prototype.initFocusHandling=function(t){var n=this,i=!1,r=function(){i||n.getFocusController().clear()};t.addEventListener("focus",(function(){i=!0}),!0),t.addEventListener("blur",(function(){i=!1,setTimeout(r,0)}),!0)},n.prototype.newLayerBase=function(t){return new xb(this,this.toLayerBaseOptions(t))},n.prototype.getLayerBase=function(){return this.Pr},n.prototype.toLayerOverlayOptions=function(t){var n=this.Ba,i=this.Mn;return new Cb(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:{color:null},resolution:i,antialias:t.antialias,overlay:!0}:{root:n,resolution:i,overlay:!0})},n.prototype.newLayerOverlay=function(t){return new xb(this,this.toLayerOverlayOptions(t))},n.prototype.getLayerOverlay=function(){return this.Ka?(null==this.Ds&&(this.Ds=this.newLayerOverlay(this.zn)),this.Ds):this.Pr},n.prototype.update=function(){if(!this.Ka)return this.Pr.update();this.Pr.update();var t=this.Ds;t&&t.update()},n.prototype.render=function(){if(!this.Ka)return this.Pr.render();this.Pr.render();var t=this.Ds;t&&t.render()},n}(),Pb=function(){function t(t){this.ei=t,this.dn=0,this.gn=0,this.mn=0,this.bn=0,t instanceof Bi&&(this.fn=t.getCallback())}return t.prototype.getTheme=function(){return this.ei.getTheme()},t.prototype.setTheme=function(t){this.ei.setTheme(t)},t.prototype.getLeft=function(){return this.ei.getLeft()+this.bn},t.prototype.adjLeft=function(t){if(this.bn!==t){this.bn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"left",{get:function(){return this.ei.left},set:function(t){this.ei.left=t},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){return this.ei.getTop()+this.dn},t.prototype.adjTop=function(t){if(this.dn!==t){this.dn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"top",{get:function(){return this.ei.top},set:function(t){this.ei.top=t},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){return this.ei.getRight()+this.gn},t.prototype.adjRight=function(t){if(this.gn!==t){this.gn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"right",{get:function(){return this.ei.right},set:function(t){this.ei.right=t},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){return this.ei.getBottom()+this.mn},t.prototype.adjBottom=function(t){if(this.mn!==t){this.mn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.ei.bottom},set:function(t){this.ei.bottom=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){var e=this.ei;null==n?e.set(t):null==i?e.set(t,n):null==r?e.set(t,n,i):e.set(t,n,i,r)},t}(),Fb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DBoard"},n}(hr),Ub=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheck"},n}(js),Gb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheckRight"},n}(Ub),Hb=function(){function t(t,n,i,r,e){this.S=t,this.T=n,this._=i,this.fn=e,this.Ja=r}return t.prototype.set=function(t,n,i,r){this.S===t&&this.T===n&&this._===i&&this.Ja===r||(this.S=t,this.T=n,this._=i,this.Ja=r,this.fn(this))},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.fn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.fn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._},set:function(t){this._!==t&&(this._=t,this.fn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this.Ja},set:function(t){this.Ja!==t&&(this.Ja=t,this.fn(this))},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){return{color:this.S,alpha:this.T,position:this._}},t}(),zb=function(t,n){return t.position-n.position},Vb=function(n){function i(){var t=n.call(this)||this,i=function(n){t.onChange(n)};t.Za=i;var r=new Hb(16777215,1,0,!1,i),e=new Hb(8421504,1,1,!0,i);return t.jt=[r,e],t.rn=-90,t.Ja=e,t.qa=[0,0,0],t}return _(i,n),i.prototype.onChange=function(t){var n=t.selected&&this.Ja!==t;if(n){var i=this.Ja;null!=i&&(i.Ja=!1),this.Ja=t}this.jt.sort(zb),n&&this.emit("selectionchange",this.Ja,this),this.emit("change",this)},Object.defineProperty(i.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"direction",{get:function(){return this.rn},set:function(t){this.rn!==t&&(this.rn=t,this.emit("directionchange",t,this),this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selected",{get:function(){return this.Ja},enumerable:!1,configurable:!0}),i.prototype.size=function(){return this.jt.length},i.prototype.get=function(t){var n=this.jt;return 0<=t&&t<n.length?n[t]:null},i.prototype.addAt=function(n){for(var i=this.jt,r=null,e=0,u=i.length;e<u;++e){var s=i[e];if(n<=s.position){if(null==r)return this.add(s.color,s.alpha,n,!0);var h=s.position-r.position;if(.001<h){var o=t.utils.hex2rgb(s.color,this.qa),a=o[0],c=o[1],f=o[2],l=t.utils.hex2rgb(r.color,this.qa),v=l[0],b=l[1],d=l[2],g=(n-r.position)/h,m=a*g+v*(1-g),w=c*g+b*(1-g),p=f*g+d*(1-g),O=this.qa;O[0]=m,O[1]=w,O[2]=p;var D=t.utils.rgb2hex(O),E=s.alpha*g+r.alpha*(1-g);return this.add(D,E,n,!0)}}r=s}return null!=r?this.add(r.color,r.alpha,n,!0):this.add(16777215,1,n,!0)},i.prototype.add=function(t,n,i,r){var e=this.Za,u=new Hb(t,n,i,r,e);return this.jt.push(u),e(u),u},i.prototype.remove=function(t){var n=this.jt;if(2<n.length)for(var i=0,r=n.length;i<r;++i)if(n[i]===t){n.splice(i,1);var e=this.Ja===t;return e&&(this.Ja=i+1<r?n[i]:n[i-1]),e&&this.emit("selectionchange",this.Ja,this),this.emit("change",this),!0}return!1},i.prototype.reset=function(){var t=this.rn;this.rn=-90;var n=this.jt,i=this.Ja,r=i?n.indexOf(i):-1;n.length=0;var e=this.Za;if(n.push(new Hb(16777215,0,0,!1,e)),n.push(new Hb(16777215,0,1,!1,e)),0<=r&&r<n.length)(u=n[r]).Ja=!0,this.Ja=u;else if(0<n.length){var u;(u=n[n.length-1]).Ja=!0,this.Ja=u}else this.Ja=null;return i!==this.Ja&&this.emit("selectionchange",this.Ja,this),t!==this.rn&&this.emit("directionchange",this.rn,this),this.emit("change",this),this},i.prototype.toObject=function(){for(var t=[],n=this.jt,i=0,r=n.length;i<r;++i)t.push(n[i].toObject());return{points:t,direction:this.rn}},i.prototype.fromObject=function(t){var n=this.rn;this.rn=t.direction;var i=this.jt,r=this.Ja,e=r?i.indexOf(r):-1;i.length=0;for(var u=this.Za,s=0,h=t.points.length;s<h;++s){var o=t.points[s],a=new Hb(o.color,o.alpha,o.position,!1,u);i.push(a)}return i.sort(zb),0<=e&&e<i.length?((a=i[e]).Ja=!0,this.Ja=a):0<i.length?((a=i[i.length-1]).Ja=!0,this.Ja=a):this.Ja=null,r!==this.Ja&&this.emit("selectionchange",this.Ja,this),n!==this.rn&&this.emit("directionchange",this.rn,this),this.emit("change",this),this},i}(t.utils.EventEmitter),Wb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputLabel"},n}(oh),Xb=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.Yh=new Wb(null==n?void 0:n.label)),i.addChild(i.Ah=i.createInput(null==n?void 0:n.input));var r=null==n?void 0:n.space;return null!=r&&i.addChild(new Ku(r)),i}return _(n,t),Object.defineProperty(n.prototype,"input",{get:function(){return this.Ah},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"label",{get:function(){return this.Yh},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputAndLabel"},n}(Cs),Kb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new qs(t)},n}(Xb),Yb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new th(t)},n}(Xb),Jb=function(){function t(t,n,i){this.Qa=t,this.$a=n,this.tc=i}return Object.defineProperty(t.prototype,"color",{get:function(){return this.Qa.color},set:function(t){if(this.Qa.color!==t){var n=this.$a;null!=n&&n(t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.Qa.alpha},set:function(t){if(this.Qa.alpha!==t){var n=this.tc;null!=n&&n(t)}},enumerable:!1,configurable:!0}),t}(),Zb=function(t){function n(n,i){var r=t.call(this)||this;return r.nc=n,r.Ht=i,r}return _(n,t),n.prototype.get=function(t){var n=this.nc;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.nc;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]={color:n.color,alpha:n.alpha},this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.nc,i=0,r=n.length;i<r;++i){var e=n[i];if(e.color===t.color&&e.alpha===t.alpha)return!0}return!1},n.prototype.add=function(t){var n=this.nc;return n.push({color:t.color,alpha:t.alpha}),this.Ht<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.nc.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.nc.length},n}(t.utils.EventEmitter),qb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),Object.defineProperty(i.prototype,"current",{get:function(){return this.ic},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"new",{get:function(){return this.rc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.ec},enumerable:!1,configurable:!0}),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r),this.Pr=16711680,this.uc={color:16777215,alpha:1},this.rc=new Jb(this.uc,(function(t){e.setColorNew(t)}),(function(t){e.setAlphaNew(t)})),this.au={color:16777215,alpha:1},this.ic=new Jb(this.au,(function(t){e.setColorCurrent(t)}),(function(t){e.setAlphaCurrent(t)}));var u=this.theme,s=this.Qn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.sc=new t.Point;var f=u.getMainWidth(),l=u.getMainHeight(),v=new t.Sprite(t.Texture.WHITE);this.hc=v,v.x=c,v.y=h,v.width=f,v.height=l,v.interactive=!0,this.addChild(v);var b=new t.Sprite(u.getMainTexture());this.oc=b,b.x=c,b.y=h,b.tint=this.Pr,b.interactive=!1,this.addChild(b),this.ac=function(t){e.onMainMove(t)},this.cc=function(t){e.onMainUp(t)},v.on(ir.down,(function(t){e.onMainDown(t)}));var d=new t.Sprite(u.getBaseTexture());this.fc=d,d.x=c,d.y=v.y+v.height+u.getBaseMargin(),d.interactive=!0,this.addChild(d),this.lc=function(t){e.onBaseMove(t)},this.vc=function(t){e.onBaseUp(t)},d.on(ir.down,(function(t){e.onBaseDown(t)}));var g=new t.Sprite(u.getAlphaCheckerboardTexture());this.bc=g,g.x=s.getLeft(),g.y=d.y+u.getBaseHeight()+u.getBaseMargin(),g.interactive=!1,this.addChild(g);var m=new t.Sprite(u.getAlphaTexture());m.tint=this.uc.color,m.interactive=!0,g.addChild(m),this.dc=function(t){e.onAlphaMove(t)},this.gc=function(t){e.onAlphaUp(t)},m.on(ir.down,(function(t){e.onAlphaDown(t)}));var w=new t.Sprite(u.getMainPointerTexture());this.mc=w,w.x=c,w.y=h,w.anchor.x=.5,w.anchor.y=.5,w.tint=u.getMainPointerColor(),w.alpha=u.getMainPointerAlpha(),w.interactive=!1,this.addChild(w);var p=new t.Sprite(u.getAlphaPointerTexture());this.wc=p,p.x=f,p.y=.5*g.height,p.tint=u.getAlphaPointerColor(),p.alpha=u.getAlphaPointerAlpha(),p.anchor.set(.5,.5),p.interactive=!1,g.addChild(p);var O=new t.Sprite(u.getBasePointerTexture());this.Oc=O,O.x=0,O.y=.5*d.height,O.tint=u.getBasePointerColor(),O.alpha=u.getBasePointerAlpha(),O.anchor.set(.5,.5),O.interactive=!1,d.addChild(O),this.Dc=[];var D=this.Dc,E=u.getRecentColorCount(),M=u.getRecentColorWidth(),S=u.getRecentColorHeight(),T=.5*M,j=.5*S,N=u.getRecentColorMargin(),I=g.y+u.getAlphaHeight()+u.getRecentMargin(),C=u.getRecentCheckerboardTexture();null==i.RECENT_COLORS&&(i.RECENT_COLORS=new Zb(u.getRecents().slice(0),E));var A=this.ec=i.RECENT_COLORS;A.on("change",(function(){e.onRecentChange()}));for(var R=function(n){var i=n.currentTarget;if(i instanceof t.Container){var r=i.children[0];r instanceof t.Sprite&&(e.setColorNew(r.tint),e.setAlphaNew(r.alpha))}},k=0;k<E;++k){var L=c+k*(M+N),y=new t.Sprite(C);y.x=L+T,y.y=I+j,y.anchor.x=.5,y.anchor.y=.5,y.buttonMode=!0,y.interactive=!0,y.on(ir.tap,R),this.addChild(y);var x=new t.Sprite(t.Texture.WHITE),B=A.get(k);null!=B?(x.tint=B.color,x.alpha=B.alpha):(x.tint=16777215,x.alpha=0),x.width=M,x.height=S,x.anchor.x=.5,x.anchor.y=.5,x.interactive=!1,y.addChild(x),D.push(x)}var _=u.getInputMargin(),P=u.getInputLabelWidth(),F=I+S+_,U=.5*(f-_),G=new Yb({parent:this,x:c,y:F,width:U,label:{width:P,text:{value:"#"},interactive:yi.NONE},input:{weight:1,text:{value:"FFFFFF"},on:{input:function(t){var n=an.fromCode(t);null!=n&&e.setColorNew(n)}}}});this.Ec=G;var H=G.height,z=new Kb({parent:this,x:c,y:F+H+_,width:U,label:{width:P,text:{value:"A"},interactive:yi.NONE},input:{weight:1,text:{value:1},min:0,max:1,on:{input:function(t){e.setAlphaNew(t)}}}});this.Mc=z;var V=.5*(U-P-_),W=H+_+H,X=c+.5*(f-_)+_,K=F+.5*(H+_+z.height-W),Y=new t.Sprite(u.getSampleCheckerboardTexture());this.Sc=Y,Y.x=X,Y.y=K,Y.width=V,Y.height=W,Y.interactive=!1,this.addChild(Y);var J=this.au,Z=new t.Sprite(t.Texture.WHITE);this.Tc=Z,Z.x=X,Z.y=K,Z.tint=J.color,Z.alpha=J.alpha,Z.width=V,Z.height=W,Z.interactive=!0,Z.buttonMode=!0,Z.on(ir.tap,(function(){e.setColorNew(J.color),e.setAlphaNew(J.alpha)})),this.addChild(Z);var q=new t.Sprite(u.getSampleCheckerboardTexture());this.jc=q,q.x=X+V,q.y=K,q.width=V,q.height=W,q.interactive=!1,this.addChild(q);var Q=new t.Sprite(t.Texture.WHITE);this.Nc=Q,Q.x=X+V,Q.y=K,Q.tint=this.uc.color,Q.alpha=this.uc.alpha,Q.width=V,Q.height=W,Q.interactive=!1,this.addChild(Q),null!=r&&null!=r.width||(this.width=c+f+o),null!=r&&null!=r.height||(this.height=F+G.height+_+z.height+a)},i.prototype.onMainDown=function(t){this.onMainPick(t.data.global);var n=st.getLayer(this);if(n){var i=n.stage;i.on(ir.move,this.ac),i.on(ir.up,this.cc)}},i.prototype.onMainMove=function(t){this.onMainPick(t.data.global)},i.prototype.onMainUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.ac),i.off(ir.up,this.cc)}},i.prototype.toMainHex=function(t,n,i,r){return Math.max(0,Math.min(255,255*n+i*(t>>r&255)))<<r},i.prototype.toMainColor=function(t,n,i,r,e){var u=.5*r,s=Math.max(0,Math.min(1,((n-u)*(1-i/e)+u)/r)),h=Math.max(0,Math.min(1,i/e)),o=Math.abs(.5*h-s),a=1-o-h;return this.toMainHex(t,a,o,16)|this.toMainHex(t,a,o,8)|this.toMainHex(t,a,o,0)},i.prototype.onMainPick=function(t){var n=this.sc,i=this.Qn,r=i.getLeft(),e=i.getTop(),u=this.theme,s=u.getMainWidth(),h=u.getMainHeight();this.toLocal(t,void 0,n);var o=Math.max(0,Math.min(s,n.x-r)),a=Math.max(0,Math.min(h,n.y-e));this.mc.position.set(r+o,e+a),this.onColorNew(this.toMainColor(this.Pr,o,a,s,h))},i.prototype.setColorCurrent=function(t){this.Tc.tint=this.au.color=t},i.prototype.setAlphaCurrent=function(t){this.Tc.alpha=this.au.alpha=t},i.prototype.setColorNew=function(t){var n=this.theme,i=n.getMainWidth(),r=n.getMainHeight(),e=this.Qn,u=pb.fromRgb(t);this.oc.tint=this.Pr=pb.toRgb(u[0],255,255),this.Oc.x=Math.max(0,Math.min(1,u[0]/360))*i;var s=Math.max(0,Math.min(1,u[1]/255)),h=Math.max(0,Math.min(1,1-u[2]/255)),o=this.mc;o.tint=h<.45?n.getMainPointerColor():16777215,o.position.set(e.getLeft()+s*i,e.getTop()+h*r),this.onColorNew(t)},i.prototype.onColorNew=function(t){var n=st.getLayer(this);n&&n.lock(),this.Nc.tint=this.uc.color=t,this.Ec.input.value=an.toCode(t),this.emit("newcolorchange",t,this),n&&(n.unlock(),n.update())},i.prototype.onBaseDown=function(t){this.onBasePick(t.data.global);var n=st.getLayer(this);if(n){var i=n.stage;i.on(ir.move,this.lc),i.on(ir.up,this.vc)}},i.prototype.onBaseMove=function(t){this.onBasePick(t.data.global)},i.prototype.onBaseUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.lc),i.off(ir.up,this.vc)}},i.prototype.toBaseHex=function(t,n){return Math.max(0,Math.min(255,6*t*255))<<n},i.prototype.toBaseColor=function(t){return t<=.167?16711680+this.toBaseHex(t,8):t<=.333?(t=.333-t,65280+this.toBaseHex(t,16)):t<=.5?(t-=.333,65280+this.toBaseHex(t,0)):t<.667?(t=.667-t,255+this.toBaseHex(t,8)):t<.883?(t-=.667,255+this.toBaseHex(t,16)):(t=.883-t,16711680+this.toBaseHex(t,0))},i.prototype.onBasePick=function(t){var n=this.sc,i=this.Qn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.Oc.x=e,this.onColorBase(this.toBaseColor(e/r))},i.prototype.setColorBase=function(t){var n=this.theme.getMainWidth();this.Oc.x=Math.max(0,Math.min(1,t/360))*n,this.onColorBase(pb.toRgb(t,255,255))},i.prototype.onColorBase=function(t){this.oc.tint=this.Pr=t;var n=this.mc,i=this.theme,r=i.getMainWidth(),e=i.getMainHeight(),u=this.Qn;this.onColorNew(this.toMainColor(this.Pr,n.x-u.getLeft(),n.y-u.getTop(),r,e))},i.prototype.onAlphaDown=function(t){this.onAlphaPick(t.data.global);var n=st.getLayer(this);if(n){var i=n.stage;i.on(ir.move,this.dc),i.on(ir.up,this.gc)}},i.prototype.onAlphaMove=function(t){this.onAlphaPick(t.data.global)},i.prototype.onAlphaUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.dc),i.off(ir.up,this.gc)}},i.prototype.onAlphaPick=function(t){var n=this.sc,i=this.Qn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.wc.x=e,this.onAlphaNew(e/r)},i.prototype.setAlphaNew=function(t){var n=this.theme.getMainWidth();this.wc.x=Math.max(0,Math.min(1,t))*n,this.onAlphaNew(t)},i.prototype.onAlphaNew=function(t){var n=st.getLayer(this);n&&n.lock(),this.Nc.alpha=this.uc.alpha=t,this.Mc.input.value=Number(t.toFixed(2)),this.emit("newalphachange",t,this),n&&(n.unlock(),n.update())},i.prototype.onRecentChange=function(){for(var t=this.Dc,n=this.ec,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(i);null!=u?(e.tint=u.color,e.alpha=u.alpha):(e.tint=16777215,e.alpha=0)}},i.prototype.getType=function(){return"DPickerColor"},i.RECENT_COLORS=null,i}(hr),Qb=function(t,n){if(t.direction!==n.direction)return!1;var i=t.points,r=n.points;if(i.length!==r.length)return!1;for(var e=0,u=i.length;e<u;++e){var s=i[e],h=r[e];if(s.color!==h.color||s.alpha!==h.alpha||s.position!==h.position)return!1}return!0},$b=function(t){function n(n,i){var r=t.call(this)||this;return r.nc=n,r.Ht=i,r}return _(n,t),n.prototype.getCapacity=function(){return this.Ht},n.prototype.get=function(t){var n=this.nc;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.nc;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]=n,this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.nc,i=0,r=n.length;i<r;++i)if(Qb(n[i],t))return!0;return!1},n.prototype.add=function(t){var n=this.nc;return n.push(t),this.Ht<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.nc.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.nc.length},n}(t.utils.EventEmitter),td=function(n){function i(i,r,e,u,s,h,o,a){var c=n.call(this,o,a)||this;return c.interactive=!0,c.interactiveChildren=!1,c.cursor="pointer",c.Ic=i,c.Tn=r,c._uvs=e,c.Cc=u,c.In=s,c.Ac=-1,c.qa=[0,0,0],c.Rc=new t.Point,c.kc=h,a.uniforms.uSampler.on("update",(function(){c.update(),st.update(c)})),c.update(),c}return _(i,n),i.prototype.getRectangle=function(t){var n=this.kc;return 0<=t&&t<n.length?n[t].rect:null},i.prototype.setRectangle=function(t,n,i,r,e){var u=this.kc;if(0<=t&&t<u.length){var s=u[t].rect;s.x=n,s.y=i,s.width=r,s.height=e}},i.prototype.getData=function(t){var n=this.kc;return 0<=t&&t<n.length?n[t].data:null},i.prototype.setData=function(t,n){var i=this.kc;0<=t&&t<i.length&&(i[t].data=n)},i.prototype.getLastHitIndex=function(){return this.Ac},i.prototype.setColors=function(t,n,i,r){n[t+0]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=r,n[t+4]=i[0],n[t+5]=i[1],n[t+6]=i[2],n[t+7]=r},i.prototype.setColorsHex=function(n,i,r,e){var u=t.utils.hex2rgb(r,this.qa);this.setColors(n,i,u,e)},i.prototype.setColorsWhite=function(t,n){var i=this.qa;i[0]=1,i[1]=1,i[2]=1,this.setColors(t,n,i,0)},i.prototype.setColorsPoint=function(t,n,i,r){var e=n.points[i];null!=e?this.setColorsHex(t,r,e.color,e.alpha):this.setColorsWhite(t,r)},i.prototype.setVertices=function(t,n,i,r){var e=r.y+r.height*i;n[t+0]=r.x,n[t+1]=e,n[t+2]=r.x+r.width,n[t+3]=e},i.prototype.setUvs=function(t,n,i,r){var e=r.x0+(r.x3-r.x0)*i,u=r.y0+(r.y3-r.y0)*i,s=r.x1+(r.x2-r.x1)*i,h=r.y1+(r.y2-r.y1)*i;n[t+0]=e,n[t+1]=u,n[t+2]=s,n[t+3]=h},i.prototype.newIndices=function(t,n,i,r){for(var e=0;e<i;++e)r[t+0]=n+0,r[t+1]=n+1,r[t+2]=n+2,r[t+3]=n+2,r[t+4]=n+1,r[t+5]=n+3,t+=6,n+=2;return r},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,n=this.kc[0].rect,i=this._bounds,r=this.Rc;r.set(n.x,n.y),t.apply(r,r),i.addPoint(r),r.set(n.x+n.width,n.y+n.height),t.apply(r,r),i.addPoint(r)},i.prototype.update=function(){var t=this.Tn,n=this._uvs,i=this.Cc,r=this.In,e=this.shader.uniforms.uSampler;null==e._uvs&&e.updateUvs();for(var u=e._uvs,s=0,h=0,o=0,a=0,c=this.kc,f=0,l=c.length;f<l;++f){var v=c[f].data,b=c[f].rect;if(null==v)this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsWhite(o,i),this.setVertices(s+4,t,1,b),this.setUvs(s,n,1,u),this.setColorsWhite(o+8,i),this.newIndices(a,h,1,r),s+=8,o+=16,h+=4,a+=6;else{this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsPoint(o,v,0,i),s+=4,o+=8;for(var d=v.points.length,g=0,m=Math.min(d,this.Ic);g<m;++g){var w=v.points[g];this.setVertices(s,t,w.position,b),this.setUvs(s,n,w.position,u),this.setColorsHex(o,i,w.color,w.alpha),s+=4,o+=8}this.setVertices(s,t,1,b),this.setUvs(s,n,1,u),this.setColorsPoint(o,v,d-1,i),s+=4,o+=8,this.newIndices(a,h,d+1,r),a+=6*(d+1),h+=2*(d+2)}}this.size=a;var p=this.geometry;p.getBuffer("aPosition").update(),p.getBuffer("aUv").update(),p.getBuffer("aColor").update(),p.getIndex().update()},i.prototype.containsPoint=function(t){for(var n=this.toLocal(t,void 0,this.Rc),i=this.kc,r=0,e=i.length;r<e;++r)if(i[r].rect.contains(n.x,n.y))return this.Ac=r,!0;return!1},i.from=function(n,r,e,u){void 0===u&&(u=t.Texture.WHITE);for(var s=new Float32Array(n*(r+2)*2*2),h=new Float32Array(n*(r+2)*2*2),o=new Float32Array(n*(r+2)*2*4),a=new Uint16Array(n*(r+1)*6),c=[],f=0;f<n;++f)c.push({data:null,rect:new t.Rectangle});return new i(r,s,h,o,a,c,(new t.Geometry).addIndex(new t.Buffer(a,!1,!0)).addAttribute("aPosition",new t.Buffer(s,!1,!1),2).addAttribute("aUv",new t.Buffer(h,!1,!1),2).addAttribute("aColor",new t.Buffer(o,!1,!1),4),t.Shader.from("\nattribute vec2 aPosition;\nattribute vec2 aUv;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\n\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nvoid main(void) {\n\tvec3 position = vec3(aPosition.x, aPosition.y, 1.0);\n\tgl_Position = vec4((projectionMatrix * translationMatrix * position).xy, 0.0, 1.0);\n\tvUv = aUv;\n\tvColor = aColor;\n}\n","\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform vec2 uCheckerColors;\n\nvoid main(void) {\n\tvec4 texture = texture2D(uSampler, vUv);\n\tfloat cy = step( 1.0, mod( gl_FragCoord.y / 10.0, 2.0 ) );\n\tfloat cx = step( 1.0, mod( gl_FragCoord.x / 10.0 + cy, 2.0 ) );\n\tfloat c = mix( uCheckerColors.x, uCheckerColors.y, cx );\n\tgl_FragColor = texture * vec4( mix( vec3( c ), vColor.xyz, vColor.a ), 1.0 );\n}",{uSampler:u,uCheckerColors:e}))},i}(t.Mesh),nd=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r);var u=this.theme,s=this.Qn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.Mu=new t.Point;var f=u.getGradientPointsWidth(),l=u.getGradientPointsMargin(),v=new qb({x:c+f+l,y:h});this.Jh=v,v.on("newcolorchange",(function(t){e.onAnchorColorChange(t)})),v.on("newalphachange",(function(t){e.onAnchorAlphaChange(t)})),this.addChild(v);var b=this.br=td.from(17,10,u.getGradientCheckerColors());b.setRectangle(0,c,h,f,v.height),this.addChild(b),b.on(ir.down,(function(t){0===b.getLastHitIndex()&&e.onViewDown(t)})),this.Lc=function(t){e.onAnchorDown(t)},this.yc=function(t){e.onAnchorMove(t)},this.xc=function(t){e.onAnchorUp(t)},this.Bc=[];var d=u.getGradientRecentColumn(),g=u.getGradientRecentWidth(),m=u.getGradientRecentMargin(),w=g+m,p=v.theme.getInputLabelWidth(),O=g*d+m*(d-1),D=u.getGradientDirectionMargin(),E=u.getGradientDirectionTexture(),M=v.x+v.width+D,S=new qs({parent:this,x:M+p+5,y:h,width:O-2*(p+5),step:1,image:{source:E,align:{with:rs.BORDER},margin:{horizontal:-E.width-5}},on:{change:function(t){e.Ut.rn=t}}}),T=M,j=S.y+S.height+D;null==i.RECENT_COLOR_GRADIENT&&(i.RECENT_COLOR_GRADIENT=new $b(u.getGradientRecents(),u.getGradientRecentCount())),this.ec=i.RECENT_COLOR_GRADIENT;for(var N=this.ec,I=0,C=N.getCapacity();I<C;++I){var A=T+I%d*w,R=j+(I/d|0)*w;b.setRectangle(1+I,A,R,g,g)}N.on("change",(function(){e.onRecentUpdate()})),b.on(ir.tap,(function(t){var n=b.getLastHitIndex();1<=n&&e.onRecentClick(b.getData(n))}));var k=new Vb;this.Ut=k,k.on("change",(function(){e.updateAnchors(),b.update()})),k.on("selectionchange",(function(t){e.onAnchorSelect(t)})),k.on("directionchange",(function(t){S.value=t})),b.setData(0,k),b.update(),S.value=k.direction,this.updateAnchors();var L=k.selected;null!=L&&this.onAnchorSelect(L),null!=r&&null!=r.width||(this.width=c+f+l+v.width+D+(d-1)*m+d*g+o),null!=r&&null!=r.height||(this.height=h+v.height+a)},Object.defineProperty(i.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.ec},enumerable:!1,configurable:!0}),i.prototype.onRecentClick=function(t){var n=this.Ut;null!=t?n.fromObject(t):n.reset()},i.prototype.onRecentUpdate=function(){for(var t=this.ec,n=this.br,i=0,r=t.size();i<r;++i)n.setData(1+i,t.get(i));n.update(),st.update(this)},i.prototype.toAnchorPosition=function(t){var n=this.toLocal(t.data.global,void 0,this.Mu);return Math.max(0,Math.min(1,(n.y-this.padding.getTop())/this.Jh.height))},i.prototype.onViewDown=function(t){this.Ut.addAt(this.toAnchorPosition(t)),this.onAnchorDragStart()},i.prototype.onAnchorDown=function(n){var i=n.target;if(i instanceof t.Sprite){var r=this.Ut,e=this.Bc.indexOf(i);0<=e&&e<r.points.length&&(r.points[e].selected=!0,this.onAnchorDragStart())}},i.prototype.onAnchorSelect=function(t){var n=this.Jh;n.current.color=t.color,n.current.alpha=t.alpha,n.new.color=t.color,n.new.alpha=t.alpha},i.prototype.onAnchorColorChange=function(t){var n=this.Ut;if(null!=n){var i=n.selected;null!=i&&(i.color=t)}},i.prototype.onAnchorAlphaChange=function(t){var n=this.Ut;if(null!=n){var i=n.selected;null!=i&&(i.alpha=t)}},i.prototype.onAnchorDragStart=function(){var t=st.getLayer(this);if(t){var n=t.stage;n.on(ir.move,this.yc),n.on(ir.up,this.xc)}},i.prototype.onAnchorMove=function(t){var n=this.Ut;if(null!=n){var i=n.selected;null!=i&&(i.position=this.toAnchorPosition(t))}},i.prototype.onAnchorUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.yc),i.off(ir.up,this.xc)}},i.prototype.updateAnchors=function(){for(var n=this.theme,i=n.getGradientAnchorTexture(),r=n.getGradientAnchorOutlinedTexture(),e=n.getGradientPointsWidth(),u=this.Ut,s=u.points.length,h=this.Bc,o=h.length,a=o;a<s;++a){var c=new t.Sprite(i);c.anchor.set(.5,.5),c.cursor="pointer",c.interactive=!0,c.on(ir.down,this.Lc),h.push(c),this.addChild(c)}for(a=o-1;s<=a;--a){var f=h[a];f.off(ir.down,this.Lc),f.destroy()}h.length=s;var l=this.padding.getTop(),v=this.padding.getLeft()+e,b=this.Jh.height;for(a=0;a<s;++a){var d=u.points[a],g=h[a];g.tint=d.color,g.position.set(v,l+b*d.position),g.texture=d.selected?r:i}st.update(this)},i.prototype.onKeyDown=function(t){if(nr.isDeleteKey(t)){var i=this.Ut;if(null!=i){var r=i.selected;if(null!=r)return i.remove(r),n.prototype.onKeyDown.call(this,t),!0}}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DPickerColorGradient"},i.RECENT_COLOR_GRADIENT=null,i}(hr),id=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.value,e=i.recent;e.contains(r)||e.add(r.toObject())},Object.defineProperty(n.prototype,"value",{get:function(){return this.picker.value},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new nd(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.value},n.prototype.onKeyDown=function(n){return this.picker.onKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DDialogColorGradient"},n}(eh),rd=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r;if(n.prototype.init.call(this,i),void 0===(null===(r=null==i?void 0:i.image)||void 0===r?void 0:r.source)){var e=this.theme,u=e.getViewBaseTexture();if(u instanceof t.Texture){var s=e.getCheckerColors(),h=td.from(1,10,s,u);this.br=h,h.setRectangle(0,0,0,u.width,u.height),h.setData(0,this.oh),h.update(),this.image=h}}},i.prototype.onActivate=function(t){var i=this;n.prototype.onActivate.call(this,t);var r=this.oh,e=this.dialog;null!=r&&e.value.fromObject(r),e.open(this).then((function(t){i.onValueChange(t,i.toClone(r))}))},i.prototype.toClone=function(t){var n=new Vb;return null!=t&&n.fromObject(t),n},i.prototype.onValueChange=function(t,n){var i=this.oh;null!=i&&i.fromObject(t);var r=this.br;null!=r&&r.update(),this.onTextChange(),this.createOrUpdateText(),st.update(this),this.emit("change",t,n,this)},Object.defineProperty(i.prototype,"dialog",{get:function(){var t,n=this._c;if(null==n){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?n=this.newDialog(r):(null==i.DIALOG&&(i.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),n=i.DIALOG),this._c=n}return n},enumerable:!1,configurable:!0}),i.prototype.newDialog=function(t){return new id(t)},Object.defineProperty(i.prototype,"value",{get:function(){return this.oh},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DButtonColorGradient"},i}(Ns),ed=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.recent;r.contains(i.new)||r.add(i.new)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new qb(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogColor"},n}(eh),ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.dialog,e=this.oh;if(null!=e){var u=r.current;u.color=e.color,u.alpha=e.alpha;var s=r.new;s.color=e.color,s.alpha=e.alpha}r.open(this).then((function(){i.onValueChange(i.toClone(r.new),i.toClone(r.current))}))},n.prototype.toClone=function(t){return{color:t.color,alpha:t.alpha}},n.prototype.onValueChange=function(t,n){var i=this.oh;null!=i&&(i.color=t.color,i.alpha=t.alpha),this.onColorChange(),this.emit("change",t,n,this)},n.prototype.toImageTintOptions=function(t){var n=this,i=function(){return n.oh.color};return t?{color:t.color||i,alpha:t.alpha}:{color:i}},n.prototype.toImageOptions=function(t,n){return n?{source:n.source,tint:this.toImageTintOptions(n.tint),align:n.align,margin:n.margin}:{tint:this.toImageTintOptions()}},n.prototype.onColorChange=function(){this.mh[0].updateTint()&&st.update(this),this.updateTextForcibly()},n.prototype.updateTextForcibly=function(){this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new ed(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Ut;return null==t&&(t=this.newValue(),this.Ut=t),t},enumerable:!1,configurable:!0}),n.prototype.newValue=function(){var t=this,n=this.oh;return new Jb(n,(function(i){n.color=i,t.onColorChange()}),(function(i){n.alpha=i,t.updateTextForcibly()}))},n.prototype.getType=function(){return"DButtonColor"},n}(Ns),sd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonDanger"},n}(Ns),hd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.oh)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Ih(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:new Date},set:function(t){var n=this.oh;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDate"},n}(Ns),od=function(){function t(){}return t.format=function(t){var n=on(String(t.getFullYear()),4,"0"),i=on(String(t.getMonth()+1),2,"0"),r=on(String(t.getDate()),2,"0");return"".concat(n,"/").concat(i,"/").concat(r)},t}(),ad=function(){function t(){}return t.format=function(t,n){var i="";return n&lh.HOURS&&(i+=on(String(t.getHours()),2,"0")),n&lh.MINUTES&&(0<i.length&&(i+=":"),i+=on(String(t.getMinutes()),2,"0")),n&lh.SECONDS&&(0<i.length&&(i+=":"),i+=on(String(t.getSeconds()),2,"0")),i},t.toMask=function(t){return vh.from("DPickerTime",t)},t}(),cd=function(){function t(){}return t.format=function(t,n){var i=ad.format(t,n);return 0<i.length?"".concat(od.format(t)," ").concat(i):"".concat(od.format(t))},t.toMask=function(t){return vh.from("DPickerDatetime",t)},t}(),fd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.oh)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.Pc;return null==i&&(i=cd.toMask(null===(n=null===(t=this.zn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Pc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Eh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:new Date},set:function(t){var n=this.oh;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDatetime"},n}(Ns),ld=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getChecker=function(){var t,n,i=this.Uo;return void 0===i&&(i=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.checker)&&void 0!==n?n:null,this.Uo=i),i},n.prototype.getOpener=function(){var t=this.js;return null==t&&(t=this.newOpener(),this.js=t),t},n.prototype.newOpener=function(){var t,n;return new wb(Ai(null!==(n=null===(t=this.zn)||void 0===t?void 0:t.as)&&void 0!==n?n:mb.TEXT,mb),this)},n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n),this.check((function(){i.open()}))},n.prototype.check=function(t){var n=this.getChecker();if(null!=n){var i=n();!0===i?t():!1===i||i.then((function(){t()}))}else t()},n.prototype.open=function(){this.getOpener().open()},n.prototype.getType=function(){return"DButtonFile"},n}(Ns),vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return null==t&&(t=new Gl(this.zn),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.getType=function(){return"DButtonLink"},n}(js),bd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadio"},n}(js),dd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadioRight"},n}(bd),gd=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=yb.getCommandController();return r.isDisabled=!e.isRedoable(),e.on("change",(function(){r.isDisabled=!e.isRedoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),yb.getCommandController().redo()},n}(Ns),md=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonSecondary"},n}(Ns),wd={NONE:0,SINGLE:1,MULTIPLE:2},pd=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Xt=n,r.on(ir.tap,(function(t){r.onClick(t)})),r}return _(n,t),Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return void 0===t&&(t=this.newLink(),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t=this.Xt.accessor.link;return t?new Gl(this.toLinkOptions(t)):null},n.prototype.onClick=function(t){var n;!0!==(null===(n=this.link)||void 0===n?void 0:n.onClick(this,t))&&this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){var n=this.Ut;void 0!==n&&this.onSelect(t,n)},n.prototype.toLinkOptions=function(t){return{url:this.toLinkUrl(t.toUrl),target:t.target,checker:this.toLinkChecker(t.checker)}},n.prototype.toLinkUrl=function(t){var n=this;return function(){var i=n.Ut;if(void 0!==i)return t(i)}},n.prototype.toLinkChecker=function(t){var n=this;if(t)return function(){var i=n.Ut;return null!=i&&t(i)}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),n.prototype.onSelect=function(t,n){var i;this.emit("select",n,this);var r=this.Xt,e=r.selection;if(e.type!==wd.MULTIPLE)e.clearAndAdd(n);else{var u=t&&"data"in t?t.data.originalEvent:t;if(null==u?void 0:u.ctrlKey)e.toggle(n);else if(null==u?void 0:u.shiftKey){var s=r.mapped,h=e.last;if(n===h)e.clearAndAdd(n);else{var o=!1,a=!1,c=[];s.each((function(t){if(o){if(a){if(c.unshift(t),t===n)return!1}else if(c.push(t),t===h)return!1}else t===n?(o=!0,a=!1,c.push(t)):t===h&&(o=!0,a=!0,c.push(t))})),e.clearAndAddAll(c)}}else e.clearAndAdd(n)}null===(i=this.Go)||void 0===i||i.open(t)},n.prototype.set=function(t,n,i){var r=this.Xt,e=i||this.Ut!==t;if(e){this.Ut=t,this.hu=n;var u=r.accessor;this.text=u.toLabel(t),this.title=u.toTitle(t)||"",this.image=u.toImage(t)}var s=this.state;s.lock(),s.set(ct.ACTIVE,r.selection.contains(t)),s.remove(ct.DISABLED),s.unlock(),e&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Ut){this.Ut=void 0,this.hu=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ct.DISABLED),t.remove(ct.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DListItem"},n}(Ts),Od=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogSelectListItem"},n}(pd),Dd=function(){function t(t,n,i,r){this.Fc=0,this.Uc=!1,this.Gc=!1,this.Hc=-1,this.zc=-1,this.Is=1,this.Vc=0,this.Wc=0,this.Xc=[],this.Xt=t,this.Nh=n,this.Kc=i,this.Yc=this.toNewItem(r),this.Jc=this.toInitItem(r)}return t.prototype.toNewItem=function(t){return(null==t?void 0:t.newItem)||this.newItem},t.prototype.toInitItem=function(t){return t?t.initItem||(!1!==t.stripe?this.initItem:this.initItemNoStriping):this.initItem},t.prototype.initItem=function(t,n,i){return t.state.isAlternated=n%2==1,t},t.prototype.initItemNoStriping=function(t,n,i){return t},Object.defineProperty(t.prototype,"multiplicity",{get:function(){return this.Is},enumerable:!1,configurable:!0}),t.prototype.lock=function(){this.Fc+=1,1===this.Fc&&(this.Uc=!1,this.Gc=!1)},t.prototype.unlock=function(t){this.Fc-=1,0===this.Fc&&(t&&this.Uc&&this.update(this.Gc),this.Uc=!1,this.Gc=!1)},t.prototype.update=function(t){var n=this;if(0<this.Fc)return this.Uc=!0,void(t&&(this.Gc=!0));var i=this.Nh,r=i.parent;if(null!=r){var e=this.Kc,u=e.children,s=r.height,h=this.Xt,o=this.toMapped(h),a=o.size(),c=this.Vc,f=this.Wc,l=f-c,v=this.Yc,b=this.Jc,d=this.Hc,g=this.zc;if(this.Hc<0){var m=void 0;0<u.length?m=u[0]:(m=b(v(h),c,h),e.addChild(m),f+=1,l+=1),d=Math.max(1,m.height),pt(m.getWidth())&&(g=Math.max(1,m.width)),this.Hc=d,this.zc=g}var w=i.padding,p=w.getTop(),O=w.getBottom(),D=w.getLeft(),E=w.getRight(),M=Math.max(0,i.width-D-E),S=0<g?Math.max(1,Math.floor(M/g)):1;this.Is=S;var T=i!==e?e.transform.position.y:p,j=Math.ceil(a/S)*d,N=Math.max(s,p+j+O),I=Math.max(s-N,i.position.y),C=Math.floor((0-(I+T))*S/d),A=Math.floor((s-(I+T))*S/d),R=C-S;R%2!=0&&(R-=1);var k=A+S+S;k%2!=0&&(k+=1);var L=k-R;if(L<l&&l-2<=L&&(k=R+(L=l)),l<L){for(var y=l;y<L;++y){var x=c+y;m=b(v(h),x,h),e.addChild(m)}f=c+(l=L)}else if(L<l){for(y=l-1;L<=y;--y)e.removeChild(u[y]);f=c+(l=L)}this.Vc=R,this.Wc=k;var B=R-c,_=Math.abs(B),P=u.length;if(0<_&&_<P){var F=this.Xc;if(0<B){for(y=0;y<_;++y)m=u[y],this.reset(m),F.push(m);for(y=_;y<P;++y)u[y-_]=u[y];for(y=0;y<_;++y)u[P-_+y]=F[y]}else{for(y=0;y<_;++y)m=u[P-_+y],this.reset(m),F.push(m);for(y=P-_-1;0<=y;--y)u[y+_]=u[y];for(y=0;y<_;++y)u[y]=F[y]}F.length=0}var U=0,G=0;for(i===e&&(U=D,G=p),o.each((function(i,r){var e=u[r-R],s=r%S,h=Math.floor(r/S);e.position.set(U+s*g,G+h*d),n.set(e,i,r,t)}),R,R+P),y=0;R+y<0&&y<P;++y){m=u[y];var H=(V=R+y)%S,z=Math.floor(V/S);m.position.set(U+H*g,G+z*d),this.unset(m)}for(y=P-1;a<=R+y&&0<=y;--y){var V;m=u[y],H=(V=R+y)%S,z=Math.floor(V/S),m.position.set(U+H*g,G+z*d),this.unset(m)}this.lock(),i.position.y=I,i.height=N,i!==e&&(e.height=j),this.unlock(!1)}},t.prototype.set=function(t,n,i,r){t.set(n,i,r)},t.prototype.unset=function(t){t.unset()},t.prototype.reset=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof hr){var u=e.state;u.lock(),u.isPressed=!1,u.isHovered=!1,u.unlock()}}return t.state.isHovered=!1,t},t.prototype.moveFocus=function(t,n,i,r){if(!i&&!r)return!1;var e=i&&nr.isArrowUpKey(t),u=i&&nr.isArrowDownKey(t),s=r&&nr.isArrowLeftKey(t),h=r&&nr.isArrowRightKey(t);if(!(e||u||s||h))return!1;if(!n.state.isActionable)return!1;var o=st.getLayer(n);if(null==o)return!1;var a=o.getFocusController(),c=a.get();if(null==c)return!1;var f=this.Kc;if(c.parent!==f)return!1;var l=c,v=l.index;if(null==v)return!1;var b=this.Is,d=this.Xt,g=this.toMapped(d).size(),m=v;if((s||h)&&(s?0<=m-1&&(m-=1):m+1<g&&(m+=1)),(e||u)&&(e?0<=m-b&&(m-=b):m+b<g&&(m+=b)),m===v)return!1;var w=f.children,p=w.indexOf(l);if(p<0)return!1;var O=p+(m-v);if(O<0||w.length<=O)return!1;var D=w[O];return a.focus(D),!0},t}(),Ed=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new pd(t)},n}(Dd),Md=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItem=function(t){return new Od(t)},n}(Ed),Sd=function(){function t(t){this.p=t}return t.prototype.size=function(){var t=this.p;return t.before.length+t.items.length+t.after.length},t.prototype.each=function(t,n,i){var r=this.p,e=this.Zc(t,r.before,0,n,i);if(!(e<0)){var u=this.Zc(t,r.items,e,n,i);u<0||this.Zc(t,r.after,u,n,i)}},t.prototype.Zc=function(t,n,i,r,e){for(var u=i+n.length,s=null!=r?Math.max(i,r):i,h=null!=e?Math.min(u,e):u,o=s;o<h;++o)if(!1===t(n[o-i],o))return-1;return h},t}(),Td=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n,e.qc=i,e.Qc=new Set;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return wd.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.get(0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.Qc;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.Qc;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.Qc;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.Qc;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.Qc;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.Qc;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.Qc,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.Qc=i,this.onChange()),n},n.prototype.contains=function(t){return this.Qc.has(t)},n.prototype.size=function(){return this.Qc.size},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=!1;this.Qc.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.Qc.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toItemIdMap=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];i.set(n(u),u)}},n.prototype.toItemSet=function(t,n){for(var i=0,r=t.length;i<r;++i)n.add(t[i])},n.prototype.onItemChange=function(t,n,i){var r=this.Qc,e=new Set,u=this.qc.toId;if(u){var s=new Map;this.toItemIdMap(t,u,s),this.toItemIdMap(n,u,s),this.toItemIdMap(i,u,s),r.forEach((function(t){var n=u(t),i=s.get(n);null!=i&&e.add(i)})),this.Qc=e,this.onChange()}else{var h=new Set;this.toItemSet(t,h),this.toItemSet(n,h),this.toItemSet(i,h),r.forEach((function(t){h.has(t)&&e.add(t)})),r.size!==e.size&&(this.Qc=e,this.onChange())}},n.prototype.newItems=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];n.has(u)&&i.add(u)}return i},n}(t.utils.EventEmitter),jd=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return wd.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onItemChange=function(t,n,i){},n}(t.utils.EventEmitter),Nd=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n,e.qc=i,e.$c=null;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return wd.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.$c},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.$c:null},n.prototype.add=function(t){return this.$c!==t&&(this.$c=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.$c===t&&(this.$c=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.$c===t?this.$c=null:this.$c=t,this.onChange(),!0},n.prototype.clear=function(){null!=this.$c&&(this.$c=null,this.onChange())},n.prototype.clearAndAdd=function(t){return this.$c!==t&&(this.$c=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){var n=t.length;if(0<n){var i=t[n-1];if(this.$c!==i)return this.$c=i,this.onChange(),!0}else if(null!=this.$c)return this.$c=null,this.onChange(),!0;return!1},n.prototype.contains=function(t){return this.$c===t},n.prototype.size=function(){return null!=this.$c?1:0},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=this.$c;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.$c;return null!=t?[t]:[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.findById=function(t,n,i){for(var r=0,e=i.length;r<e;++r){var u=i[r];if(t===n(u))return u}return null},n.prototype.find=function(t,n){for(var i=0,r=n.length;i<r;++i){var e=n[i];if(t===e)return e}return null},n.prototype.onItemChange=function(t,n,i){var r=this.$c;if(null!=r){var e=null,u=this.qc.toId;if(u){var s=u(r);e=this.findById(s,u,t)||this.findById(s,u,n)||this.findById(s,u,i)}else e=this.find(r,t)||this.find(r,n)||this.find(r,i);r!==e&&(this.$c=e,this.onChange())}},n}(t.utils.EventEmitter),Id=function(t){return t.image},Cd=function(t){return t.title},Ad=function(t){return t.url},Rd=function(){function t(t){this.toLabel=(null==t?void 0:t.toLabel)||fb,this.toTitle=(null==t?void 0:t.toTitle)||Cd,this.toImage=(null==t?void 0:t.toImage)||Id,this.toId=null==t?void 0:t.toId,this.link=this.toLink(t)}return t.prototype.toLink=function(t){if(t){var n=t.link;if(n){var i=n.toUrl,r=n.target,e=n.checker;if(void 0!==i||void 0!==r||void 0!==e)return{toUrl:i||Ad,target:r,checker:e}}}},t}(),kd=function(){function t(t,n){this.p=t,n?(this.Yu=n.before||[],this.Qc=n.items||[],this.Ju=n.after||[]):(this.Yu=[],this.Qc=[],this.Ju=[]);var i=new Rd(n);this.qc=i,this.tf=this.toSelection(i,n),this.nf=new Sd(this)}return t.prototype.toSelection=function(t,n){var i=null==n?void 0:n.selection;switch(null==i?void 0:i.type){case wd.NONE:case"NONE":return new jd(this,t,i);case wd.MULTIPLE:case"MULTIPLE":return new Td(this,t,i);default:return new Nd(this,t,i)}},Object.defineProperty(t.prototype,"before",{get:function(){return this.Yu},set:function(t){this.Yu=t,this.tf.onItemChange(t,this.Qc,this.Ju),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this.Qc},set:function(t){this.Qc=t,this.tf.onItemChange(this.Yu,t,this.Ju),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.Ju},set:function(t){this.Ju=t,this.tf.onItemChange(this.Yu,this.Qc,t),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.qc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),t.prototype.update=function(t){this.p.update(t)},t.prototype.size=function(){return this.Qc.length},t.prototype.clear=function(){var t=this.Qc;return 0<t.length&&(t.length=0,this.onChange(),!0)},t.prototype.clearAndAdd=function(t){var n=this.Qc;return 1===n.length?n[0]!==t&&(n[0]=t,this.onChange(),!0):(n.length=0,n.push(t),this.onChange(),!0)},t.prototype.clearAndAddAll=function(t){var n=!1,i=this.Qc;if(0<i.length&&(i.length=0,n=!0),0<t.length){for(var r=0,e=t.length;r<e;++r)i.push(t[r]);n=!0}return!!n&&(this.onChange(),!0)},t.prototype.add=function(t,n){var i=this.Qc;return null==n?(i.push(t),this.onChange(),!0):0<=n&&n<i.length&&(i.splice(n,0,t),this.onChange(),!0)},t.prototype.addAll=function(t,n){if(0<t.length){var i=this.Qc,r=i.length;if(null==n){for(var e=0,u=t.length;e<u;++e)i.push(t[e]);return this.onChange(),!0}if(0<=n&&n<r){for(e=0,u=t.length;e<u;++e)i.splice(n+e,0,t[e]);return this.onChange(),!0}}return!1},t.prototype.get=function(t){var n=this.Qc;return 0<=t&&t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.Qc;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.onChange(),r}return null},t.prototype.remove=function(t){var n=this.Qc;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.onChange(),i}return null},t.prototype.each=function(t,n,i){for(var r=this.Qc,e=r.length,u=null!=n?Math.max(0,n):0,s=null!=i?Math.min(e,i):e,h=u;h<s&&!1!==t(r[h],h);++h);},t.prototype.onChange=function(){this.update()},t}(),Ld=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DContent"},n}(hr),yd=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).if=0,e.rf=1,e.visible=!1,e.ef=-1,e.uf=!1,e.sf=null,e.hf=null!==(r=null===(i=null==n?void 0:n.fadeOut)||void 0===i?void 0:i.delay)&&void 0!==r?r:e.theme.getFadeOutDelay(),e.af=!0,e.cf=function(){e.onFadeOutTimeout()};var u=e.newThumb(null==n?void 0:n.thumb);return u.on("statechange",(function(t,n){e.onThumbStateChange(t,n)})),e.ff=u,e.addChild(u),e}return _(n,t),Object.defineProperty(n.prototype,"thumb",{get:function(){return this.ff},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"start",{get:function(){return this.if},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"end",{get:function(){return this.rf},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r){i<1?(t=0,n=1):(t=Math.max(0,Math.min(1,t/i)),n=Math.max(t,Math.min(1,n/i))),this.if===t&&this.rf===n||(this.if=t,this.rf=n,this.onChange(r))},n.prototype.onChange=function(t){this.updateThumb(this.width,this.height),t&&(this.af=!0),this.uf||(this.uf=!0,st.update(this))},n.prototype.touch=function(t){this.onChange(t)},n.prototype.isRegionVisible=function(){return 0<this.if||this.rf<1},n.prototype.render=function(n){if(this.uf)if(this.uf=!1,!this.af&&this.isRegionVisible()){var i=this.hf;0<=i&&(this.ef=Date.now(),null==this.sf&&(this.sf=window.setTimeout(this.cf,i))),this.visible||(this.visible=!0)}else this.hf<0&&this.visible&&(this.visible=!1);this.af&&(this.af=!1),t.prototype.render.call(this,n)},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateThumb(n,i)},n.prototype.onFadeOutTimeout=function(){this.sf=null;var t=this.hf,n=this.cf,i=this.state;if(i.isGesturing||i.onHovered||i.isHovered||i.isPressed)this.sf=window.setTimeout(n,t);else{var r=this.ff.state;if(r.isGesturing||r.isHovered||r.isPressed)this.sf=window.setTimeout(n,t);else{var e=t-(Date.now()-this.ef);0<e?this.sf=window.setTimeout(n,e):this.visible&&(this.visible=!1,st.update(this))}}},n.prototype.onThumbStateChange=function(t,n){t.isGesturing||t.isHovered||t.isPressed||(n.isGesturing||n.isHovered||n.isPressed)&&(this.ef=Date.now())},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isGesturing||n.isHovered||n.isPressed||(i.isGesturing||i.isHovered||i.isPressed)&&(this.ef=Date.now())},n.prototype.getType=function(){return"DScrollBar"},n}(hr),xd=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r=this;n.prototype.init.call(this,i);var e=new t.Point;this.Bi=new mr({bind:this,on:{start:function(){e.copyFrom(r.position)},move:function(t,n,i){e.set(e.x+n,e.y+i),r.onGestureMove(e.x,e.y)}}})},i.prototype.getMinimumLength=function(){return this.theme.getThumbMinimumLength()},i.prototype.getType=function(){return"DScrollBarThumb"},i}(hr),Bd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(0,o*(i-h),n,h),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),_d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",t,this)},n.prototype.initReflowable=function(){new Bd(this)},n}(xd),Pd=function(t){function n(n){var i=t.call(this,n)||this;return i.ff.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.width;if(0<n){var i=this.rf-this.if,r=Math.min(1-i,Math.max(0,t/n));this.if!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.width;if(0<i){var r=this.rf-this.if,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.x/i-.5*r));this.if!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new _d(t)},n.prototype.updateThumb=function(t,n){var i=this.ff,r=Math.min(.5*t,i.getMinimumLength()),e=t-r,u=e*this.if,s=e*this.rf+r-u;i.position.set(u,0),i.resize(s,n)},n}(yd),Fd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(o*(n-h),0,h,i),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",n,this)},n.prototype.initReflowable=function(){new Fd(this)},n}(xd),Gd=function(t){function n(n){var i=t.call(this,n)||this;return i.ff.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.height;if(0<n){var i=this.rf-this.if,r=Math.min(1-i,Math.max(0,t/n));this.if!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.height;if(0<i){var r=this.rf-this.if,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.y/i-.5*r));this.if!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Ud(t)},n.prototype.updateThumb=function(t,n){var i=this.ff,r=Math.min(.5*n,i.getMinimumLength()),e=n-r,u=e*this.if,s=e*this.rf+r-u;i.position.set(0,u),i.resize(t,s),i.updateTransform()},n}(yd),Hd=function(){function t(t,n,i){this.p=t,this.lf=i,this.st=0,this.vf=!1,this.vertical=new Gd(null==n?void 0:n.vertical),this.horizontal=new Pd(null==n?void 0:n.horizontal)}return t.prototype.lock=function(){this.st+=1,1===this.st&&(this.vf=!1,this.bf=void 0)},t.prototype.unlock=function(t){this.st-=1,0===this.st&&(t&&this.vf&&this.update(this.bf),this.vf=!1,this.bf=void 0)},t.prototype.update=function(t){if(0<this.st)return this.vf=!0,void(null!=t&&(this.bf||(this.bf=t)));var n=this.p,i=n.width,r=n.height,e=n.content,u=-e.x,s=-e.y,h=this.vertical,o=h.width,a=this.getOffsetVerticalStart(o),c=this.getOffsetVerticalEnd(o);h.set(s,s+r,e.height,t),h.position.set(i-o,a),h.height=r-a-c;var f=this.horizontal,l=f.height,v=this.getOffsetHorizontalStart(l),b=this.getOffsetHorizontalEnd(l);f.set(u,u+i,e.width,t),f.position.set(v,r-l),f.width=i-v-b,this.lf(h.isRegionVisible()||f.isRegionVisible())},t.prototype.touch=function(t){this.vertical.touch(t),this.horizontal.touch(t)},t.prototype.getOffsetHorizontalStart=function(t){return.5*t},t.prototype.getOffsetHorizontalEnd=function(t){return.5*t},t.prototype.getOffsetVerticalStart=function(t){return.5*t},t.prototype.getOffsetVerticalEnd=function(t){return.5*t},t}(),zd=function(n){function i(t){var i,r=this,e=(r=n.call(this,t)||this).theme;(null!==(i=null==t?void 0:t.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(r.mask=r.getOverflowMask()),r.addChild(r.content);var u=r.scrollbar;return r.addChild(u.vertical),r.addChild(u.horizontal),u.update(),r.initGesture(e,t),r}return _(i,n),i.prototype.initGesture=function(n,i){var r,e,u=this,s=Ai(null!==(e=null===(r=null==i?void 0:i.gesture)||void 0===r?void 0:r.mode)&&void 0!==e?e:n.getGestureMode(),fr);if(s===fr.ON||s===fr.TOUCH){var h=new t.Point,o=this.content;this.Bi=new mr({bind:this,touch:s===fr.TOUCH,on:{start:function(){h.copyFrom(o.position)},move:function(t,n,i){h.set(h.x+n,h.y+i),o.position.set(u.toContentX(o,h.x),u.toContentY(o,h.y))}}})}},Object.defineProperty(i.prototype,"scrollbar",{get:function(){var t,n=this.df;return null==n&&(n=this.newScrollBar(null===(t=this.zn)||void 0===t?void 0:t.scrollbar),this.initScrollBar(n),this.df=n),n},enumerable:!1,configurable:!0}),i.prototype.newScrollBar=function(t){var n=this;return new Hd(this,t,(function(t){n.onScrollBarUpdate(t)}))},i.prototype.onScrollBarUpdate=function(t){var n=this.dr;if(null!=n){var i=this.content;t?i.mask!==n&&(i.mask=n,st.update(this)):i.mask&&(i.mask=null,st.update(this))}},i.prototype.initScrollBar=function(t){var n=this;t.vertical.on("regionmove",(function(t){n.onScrollBarMoveY(t)})),t.horizontal.on("regionmove",(function(t){n.onScrollBarMoveX(t)}))},i.prototype.onScrollBarMoveX=function(t){var n=this.Bi;null!=n&&n.stop(this);var i=this.content;i.x=-i.width*t},i.prototype.onScrollBarMoveY=function(t){var n=this.Bi;null!=n&&n.stop(this);var i=this.content;i.y=-i.height*t},i.prototype.onOver=function(t){n.prototype.onOver.call(this,t),this.scrollbar.touch()},i.prototype.getType=function(){return"DPane"},Object.defineProperty(i.prototype,"content",{get:function(){var t=this.Nh;return null==t&&(t=this.toContent(this.zn),this.initContent(t),this.Nh=t),t},enumerable:!1,configurable:!0}),i.prototype.toContent=function(t){var n=null==t?void 0:t.content;return n?n instanceof hr?n:this.newContent(n):this.newContent()},i.prototype.newContent=function(t){return new Ld(t)},i.prototype.initContent=function(t){var n=this;t.on("move",(function(){n.onContentChange()})),t.on("resize",(function(){n.onContentChange()}))},i.prototype.getOverflowMask=function(){var t=this.dr;return null==t&&(t=new or(this),this.dr=t,this.reflowable.add(t),this.toDirty()),t},i.prototype.onWheel=function(t,n,i){var r=this.content,e=this.getWheelContentX(r,n.deltaX*n.lowest),u=this.getWheelContentY(r,n.deltaY*n.lowest);if(r.x!==e||r.y!==u){var s=this.Bi;return null!=s&&s.stop(this),r.position.set(e,u),!0}return!1},i.prototype.getWheelContentX=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentX(t,t.x-n*i)}return t.x},i.prototype.getWheelContentY=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentY(t,t.y+n*i)}return t.y},i.prototype.toContentX=function(t,n){return Math.min(0,Math.max(this.width-t.width,n))},i.prototype.toContentY=function(t,n){return Math.min(0,Math.max(this.height-t.height,n))},i.prototype.isRefitable=function(t){return n.prototype.isRefitable.call(this,t)&&!(t instanceof yd)},i.prototype.onResize=function(t,i,r,e){var u=this.scrollbar;u.lock(),n.prototype.onResize.call(this,t,i,r,e),u.update(),u.unlock(!0)},i.prototype.onContentChange=function(){this.scrollbar.update()},i.prototype.getFocusedChildClippingRect=function(t,n,i,r,e,u,s,h){return h.x=0,h.y=0,h.width=u,h.height=s,h},i.prototype.onChildFocus=function(r){var e=i.WORK_POINT||new t.Point;i.WORK_POINT=e;var u=this.content,s=u.x,h=u.y,o=u.width,a=u.height;e.set(0,0),r.toGlobal(e,e,!1),u.toLocal(e,void 0,e,!1);var c=s+Math.min(o,Math.max(0,e.x)),f=h+Math.min(a,Math.max(0,e.y));e.set(r.width,r.height),r.toGlobal(e,e,!0),u.toLocal(e,void 0,e,!0);var l=s+Math.min(o,Math.max(0,e.x)),v=h+Math.min(a,Math.max(0,e.y)),b=this.width,d=this.height,g=i.WORK_RECTANGLE||new t.Rectangle;i.WORK_RECTANGLE=g,this.getFocusedChildClippingRect(r,s,h,o,a,b,d,g);var m=g.x,w=g.y,p=m,O=w,D=m+g.width,E=w+g.height,M=null;c<p?l<=D&&(M=s+Math.min(p-c,D-l),M=Math.max(b-o,Math.min(0,M))):D<l&&(M=s-Math.min(c-p,l-D),M=Math.max(b-o,Math.min(0,M)));var S=null;f<O?v<=E&&(S=h+Math.min(O-f,E-v),S=Math.max(d-a,Math.min(0,S))):E<v&&(S=h-Math.min(f-O,v-E),S=Math.max(d-a,Math.min(0,S)));var T=u.position;null!=M?null!=S?T.set(M,S):T.x=M:null!=S&&(T.y=S),n.prototype.onChildFocus.call(this,r)},i.prototype.destroy=function(){var t=this.dr;null!=t&&(this.dr=null,t.destroy()),this.mask=null,n.prototype.destroy.call(this)},i}(hr),Vd=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.gf;return null==t&&(t=this.newUpdater(this.data,this.content,this.zn),this.gf=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new Ed(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Xt;return null==t&&(t=this.toData(this.zn),this.Xt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.items),i=null==t?void 0:t.selection;return null==n?i?new kd(this,{selection:i}):new kd(this):mt(n)?new kd(this,i?{items:n,selection:i}:{items:n}):"each"in n?n:i?(void 0===n.selection&&(n.selection=i),new kd(this,n)):new kd(this,n)},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!0),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DList"},n}(zd),Wd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUpdater=function(t,n,i){return new Md(t,n,n,null==i?void 0:i.updater)},n.prototype.getType=function(){return"DDialogSelectList"},n}(Vd),Xd=function(t){function n(n){var i=t.call(this)||this;return i.mf=n||function(t){return Promise.resolve([])},i.R=0,i.wf=0,i}return _(n,t),n.prototype.create=function(t){var n=this,i=++this.R;this.mf(t[0]).then((function(t){n.R===i&&(n.wf=i,n.emit("success",n,t),n.emit("change",n))}),(function(){n.R===i&&(n.wf=i,n.emit("fail",n),n.emit("change",n))})),this.emit("change",this)},n.prototype.isDone=function(){return this.R===this.wf},n}(t.utils.EventEmitter),Kd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputSearch"},n}(th),Yd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNote"},n}(Ts),Jd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmall"},n}(Yd),Zd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallError"},n}(Jd),qd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallNoItemsFound"},n}(Jd),Qd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallSearching"},n}(Jd),$d=function(t){function n(n,i){var r=t.call(this)||this;return r.ei=n,r.Ut=i.value,r.pf=i.filter,n.on("change",(function(){r.emit("change",r)})),n.on("success",(function(t,n){r.emit("success",r,r.toDismissable(n))})),n.on("fail",(function(){r.emit("fail",r)})),r}return _(n,t),n.prototype.toDismissValue=function(t){if(null!=t){var n=this.Ut;if(void 0!==n){var i=this.pf;if(null==i||i(n,t[0]))return n}}},n.prototype.toDismissable=function(t){var n=this.toDismissValue(this.Of);if(void 0===n)return t;for(var i=[],r=0,e=t.length;r<e;++r)i.push(t[r]);return i.push(n),i},n.prototype.create=function(t){this.Of=t,this.ei.create(t)},n.prototype.isDone=function(){return this.ei.isDone()},n}(t.utils.EventEmitter),tg=function(t){function n(n){var i=t.call(this,n)||this;i.Ut=null;var r=new Sb,e=i.search;return e.on("success",(function(t,n){0<n.length?r.hide():r.show(i.noteNoItemsFound),i.onSearched(n)})),e.on("fail",(function(){r.show(i.noteError),i.onSearched([])})),e.on("change",(function(){if(!e.isDone()){var t=i.noteSearching;t&&r.show(t)}})),i}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout,this.list),r},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.Ch;return null==t&&(t=this.newInputLayout(this.input,this.theme,this.zn),this.Ch=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(t,n,i){return new Cs(this.toInputLayoutOptions(t,n,i))},n.prototype.toInputLayoutOptions=function(t,n,i){var r=this.toInputMargin(n,i);return{width:"padding",height:"auto",children:[new Ku({width:r}),t,new Ku({width:r})]}},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.Ah;return null==t&&(t=this.newInput(),this.Ah=t),t},enumerable:!1,configurable:!0}),n.prototype.newInput=function(){var t=this,n=new Kd(this.toInputOptions(this.theme,this.zn));return n.on("input",(function(n){t.search.create([n])})),n},n.prototype.toInputOptions=function(t,n){var i=(null==n?void 0:n.input)||{};return void 0===i.width&&void 0===i.weight&&(i.weight=1),i},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"list",{get:function(){var t=this.Un;return null==t&&(t=this.newList(),this.Un=t),t},enumerable:!1,configurable:!0}),n.prototype.newList=function(){var t=this,n=new Wd(this.toListOptions(this.theme,this.zn));return n.selection.on("change",(function(n){t.onListSelectionChange(n)})),n},n.prototype.onListSelectionChange=function(t){var n=t.first;if(null!=n){var i=this.zn;if(i){var r=i.dismiss;r&&n===r.value&&(n=null)}this.Ut=n,this.onOk(n)}},n.prototype.toListOptions=function(t,n){var i=(null==n?void 0:n.list)||{};return void 0===i.width&&(i.width="padding"),i},Object.defineProperty(n.prototype,"noteError",{get:function(){var t=this.Df;return null==t&&(t=this.newNoteError(),this.Df=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteError=function(){var t,n,i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.error;return null!==i?new Zd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteNoItemsFound",{get:function(){var t=this.Ef;return null==t&&(t=this.newNoteNoItemsFound(),this.Ef=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteNoItemsFound=function(){var t,n,i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.noItemsFound;return null!==i?new qd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteSearching",{get:function(){var t=this.Mf;return null==t&&(t=this.newNoteSearching(),this.Mf=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteSearching=function(){var t,n,i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.searching;return null!=i?new Qd(this.toNoteOptions(this.list,i)):null},n.prototype.toNoteOptions=function(t,n){return null!=n?(null==n.parent&&(n.parent=t),null==n.visible&&(n.visible=!1),n):{parent:t,visible:!1}},Object.defineProperty(n.prototype,"search",{get:function(){var t=this.mf;return null==t&&(t=this.newSearch(),this.mf=t),t},enumerable:!1,configurable:!0}),n.prototype.newSearch=function(){var t=this.zn;if(t){var n=t.controller;if(n){var i=t.dismiss,r=n.search;return"create"in r?null!=i?new $d(r,i):r:null!=i?new $d(new Xd(r),i):new Xd(r)}}return new Xd},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),n.prototype.onSearched=function(t){this.list.data.items=t},n.prototype.getResolvedValue=function(){return this.Ut},n.prototype.getType=function(){return"DDialogSelect"},n.prototype.onOpen=function(){t.prototype.onOpen.call(this),this.list.selection.clear(),this.search.create([this.input.value])},n.prototype.onOk=function(n){this.emit("select",n,this),t.prototype.onOk.call(this,n)},n.prototype.destroy=function(){var n=this.Ah;n&&n.destroy();var i=this.Df;i&&i.destroy();var r=this.Ef;r&&(null==r||r.destroy());var e=this.Mf;e&&(null==e||e.destroy());var u=this.Un;u&&u.destroy(),t.prototype.destroy.call(this)},n}(xs),ng=function(t){return t.value},ig=function(){},rg=function(t){function n(n){var i,r,e=this;return(e=t.call(this,function(t){var n,i,r;if(t){var e,u=null===(n=t.text)||void 0===n?void 0:n.formatter;if(void 0!==u){if(!(e=t.dialog)||!("open"in e)){var s=(e=e||{}).item=e.item||{};void 0===(o=s.text=s.text||{}).formatter&&(o.formatter=u)}}else if(!(e=t.dialog)||!("open"in e)){var h=null===(r=null===(i=null==e?void 0:e.item)||void 0===i?void 0:i.text)||void 0===r?void 0:r.formatter;if(void 0!==h){var o=t.text||{};t.text=o,void 0===o.formatter&&(o.formatter=h)}}}return t}(n))||this).Sf=null!==(i=null==n?void 0:n.getter)&&void 0!==i?i:ng,e.Tf=null!==(r=null==n?void 0:n.setter)&&void 0!==r?r:ig,e}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.dialog,u=null!==(i=this.oh)&&void 0!==i?i:null;this.Tf(e,u),e.open(this).then((function(){var t=r.Sf(e);t!==u&&(r.text=t,r.emit("change",t,u,r))}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this._c;if(null==n){var i=null===(t=this.zn)||void 0===t?void 0:t.dialog;n=i&&"open"in i?i:new tg(i),this._c=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonSelect"},n}(Ns),eg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.oh)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.Pc;return null==i&&(i=ad.toMask(null===(n=null===(t=this.zn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Pc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Sh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:new Date},set:function(t){var n=this.oh;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonTime"},n}(Ns),ug=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=yb.getCommandController();return r.isDisabled=!e.isUndoable(),e.on("change",(function(){r.isDisabled=!e.isUndoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),yb.getCommandController().undo()},n}(Ns),sg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DCanvas"},n}(hr),hg={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3},og=function(){function t(t){this.jf=t,this.hu=0}return Object.defineProperty(t.prototype,"shape",{get:function(){var t=this.Xr;return null==t&&(t=this.newShape(),this.Xr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShape=function(){var t,n=this.jf,i=n.bar,r=new en;return r.points.position=this.newShapePosition(),r.points.style=null!==(t=i.style)&&void 0!==t?t:z.NONE,r.stroke.copy(i.stroke),r.text.copy(n.label),r},t.prototype.newShapePosition=function(){switch(this.jf.position){case hg.LEFT:case hg.RIGHT:return it.TOP;default:return it.LEFT}},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.shape.attach(t.container)},t.prototype.unbind=function(){var t=this.Xr;null!=t&&t.detach(),this.hu=0,this.Kc=void 0},t.prototype.update=function(){var t=this.Kc,n=this.hu,i=this.Xr;if(null!=i&&null!=t){var r=t.plotArea,e=r.width,u=r.height,s=this.jf.padding*n;i.disallowUploadedUpdate();var h=i.transform.position,o=i.size;switch(this.jf.position){case hg.TOP:h.set(.5*e,0-s),o.set(e,0);break;case hg.BOTTOM:h.set(.5*e,u+s),o.set(e,0);break;case hg.LEFT:h.set(0-s,.5*u),o.set(0,u);break;case hg.RIGHT:h.set(e+s,.5*u),o.set(0,u)}return i.allowUploadedUpdate(),!0}return!1},t.prototype.destroy=function(){var t=this.Xr;null!=t&&t.destroy(),this.hu=0,this.Kc=void 0},t}(),ag=function(){function t(t){this.Nf=t,this.hu=0,this.Un=[]}return t.prototype.add=function(t){this.Un.push(t);var n=this.Kc,i=this.hu;return null!=n&&t.bind(n,i,this.Nf),this},t.prototype.get=function(t){var n=this.Un;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Un.indexOf(t)},t.prototype.clear=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Un.length},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n;for(var i=this.Nf,r=this.Un,e=0,u=r.length;e<u;++e)r[e].bind(t,n,i)},t.prototype.unbind=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].unbind();this.hu=0,this.Kc=void 0},t.prototype.update=function(){for(var t=!1,n=this.Un,i=0,r=n.length;i<r;++i)n[i].update()&&(t=!0);return t},t.prototype.destroy=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].destroy();this.hu=0,this.Kc=void 0},t}(),cg={INSIDE:0,OUTSIDE:1},fg=function(){function t(t,n){var i,r;this.coordinate=null!==(i=null==n?void 0:n.coordinate)&&void 0!==i?i:0,this.position=this.toPosition(t,n),this.tick=this.toTick(t,n),this.label=this.toLabel(t,n),this.padding=null!==(r=null==n?void 0:n.padding)&&void 0!==r?r:t.getPadding(),this.bar=this.toBar(t,n),this.guide=this.toGuide(t,n)}return t.prototype.toPosition=function(t,n){var i=null==n?void 0:n.position;return Ot(i)?hg[i]:null!=i?i:t.getPosition()},t.prototype.toGuide=function(t,n){var i,r;return{list:null!==(r=null===(i=null==n?void 0:n.guide)||void 0===i?void 0:i.list)&&void 0!==r?r:[]}},t.prototype.toBar=function(t,n){var i;return{style:null!==(i=null==n?void 0:n.style)&&void 0!==i?i:t.getStyle(),stroke:this.toBarStroke(t,null==n?void 0:n.stroke)}},t.prototype.toTick=function(t,n){var i,r=null==n?void 0:n.tick;return{enable:null!==(i=null==r?void 0:r.enable)&&void 0!==i?i:t.getTickEnable(),major:this.toTickMajor(t,r),minor:this.toTickMinor(t,r)}},t.prototype.toTickMajor=function(t,n){var i,r,e,u,s,h,o,a,c=null==n?void 0:n.major,f=null!==(r=null!==(i=null==c?void 0:c.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMajorTickPosition(),l=null==n?void 0:n.style,v=zv.from(null!==(u=null!==(e=null==c?void 0:c.style)&&void 0!==e?e:l)&&void 0!==u?u:t.getMajorTickStyle()),b=null==n?void 0:n.stroke,d=this.toTickMajorStroke(t,null==c?void 0:c.stroke,b),g=null!==(s=null==c?void 0:c.count)&&void 0!==s?s:t.getMajorTickCount();return{count:g,capacity:null!==(h=null==c?void 0:c.capacity)&&void 0!==h?h:t.getMajorTickCapacity(g),step:null!==(o=null==c?void 0:c.step)&&void 0!==o?o:t.getMajorTickStep(),size:null!==(a=null==c?void 0:c.size)&&void 0!==a?a:t.getMajorTickSize(),position:this.toTickPosition(f),style:v,stroke:d,text:this.toTickMajorText(t,null==c?void 0:c.text),formatter:this.toTickMajorFormatter(t,c),gridline:this.toTickMajorGridline(t,null==c?void 0:c.gridline,l,b)}},t.prototype.toTickMajorGridline=function(t,n,i,r){var e,u,s,h=zv.from(null!==(u=null!==(e=null==n?void 0:n.style)&&void 0!==e?e:i)&&void 0!==u?u:t.getMajorTickGridlineStyle());return{enable:null!==(s=null==n?void 0:n.enable)&&void 0!==s?s:t.getMajorTickGridlineEnable(),style:h,stroke:this.toTickMajorGridlineStroke(t,null==n?void 0:n.stroke,r)}},t.prototype.toTickPosition=function(t){var n=this.position;if(t===cg.OUTSIDE||"OUTSIDE"===t)switch(n){case hg.TOP:return it.BOTTOM;case hg.BOTTOM:return it.TOP;case hg.LEFT:return it.RIGHT;case hg.RIGHT:return it.LEFT;default:return it.TOP}else switch(n){case hg.TOP:return it.TOP;case hg.BOTTOM:return it.BOTTOM;case hg.LEFT:return it.LEFT;case hg.RIGHT:return it.RIGHT;default:return it.TOP}},t.prototype.toTickMinor=function(t,n){var i,r,e,u,s,h,o,a=null==n?void 0:n.minor,c=null!==(r=null!==(i=null==a?void 0:a.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMinorTickPosition(),f=zv.from(null!==(u=null!==(e=null==a?void 0:a.style)&&void 0!==e?e:null==n?void 0:n.style)&&void 0!==u?u:t.getMinorTickStyle());return{count:null!==(s=null==a?void 0:a.count)&&void 0!==s?s:t.getMinorTickCount(),step:null!==(h=null==a?void 0:a.step)&&void 0!==h?h:t.getMinorTickStep(),size:null!==(o=null==a?void 0:a.size)&&void 0!==o?o:t.getMinorTickSize(),position:this.toTickPosition(c),style:f,stroke:this.toTickMinorStroke(t,null==a?void 0:a.stroke,null==n?void 0:n.stroke),text:this.toTickMinorText(t,null==a?void 0:a.text),formatter:this.toTickMinorFormatter(t,a)}},t.prototype.toBarStroke=function(t,n){return this.toStroke(n,void 0,t.getStrokeEnable(),t.getStrokeColor(),t.getStrokeAlpha(),t.getStrokeWidth(),t.getStrokeAlign(),t.getStrokeSide(),t.getStrokeStyle())},t.prototype.toTickMajorStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickStrokeEnable(),t.getMajorTickStrokeColor(),t.getMajorTickStrokeAlpha(),t.getMajorTickStrokeWidth(),t.getMajorTickStrokeAlign(),t.getMajorTickStrokeSide(),t.getMajorTickStrokeStyle())},t.prototype.toTickMajorGridlineStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickGridlineStrokeEnable(),t.getMajorTickGridlineStrokeColor(),t.getMajorTickGridlineStrokeAlpha(),t.getMajorTickGridlineStrokeWidth(),t.getMajorTickGridlineStrokeAlign(),t.getMajorTickGridlineStrokeSide(),t.getMajorTickGridlineStrokeStyle())},t.prototype.toTickMinorStroke=function(t,n,i){return this.toStroke(n,i,t.getMinorTickStrokeEnable(),t.getMinorTickStrokeColor(),t.getMinorTickStrokeAlpha(),t.getMinorTickStrokeWidth(),t.getMinorTickStrokeAlign(),t.getMinorTickStrokeSide(),t.getMinorTickStrokeStyle())},t.prototype.toStroke=function(t,n,i,r,e,u,s,h,o){var a,c,f,l,v,b,d,g,m,w,p,O,D,E,M,S,T,j,N,I,C,A,R,k,L,y,x,B;return t?n?{enable:null!==(c=null!==(a=t.enable)&&void 0!==a?a:n.enable)&&void 0!==c?c:i,color:null!==(l=null!==(f=t.color)&&void 0!==f?f:n.color)&&void 0!==l?l:r,alpha:null!==(b=null!==(v=t.alpha)&&void 0!==v?v:n.alpha)&&void 0!==b?b:e,width:null!==(g=null!==(d=t.width)&&void 0!==d?d:n.width)&&void 0!==g?g:u,align:null!==(w=null!==(m=t.align)&&void 0!==m?m:n.align)&&void 0!==w?w:s,side:null!==(O=null!==(p=t.side)&&void 0!==p?p:n.side)&&void 0!==O?O:h,style:this.toStrokeStyle(null!==(E=null!==(D=t.style)&&void 0!==D?D:n.style)&&void 0!==E?E:o)}:{enable:null!==(M=t.enable)&&void 0!==M?M:i,color:null!==(S=t.color)&&void 0!==S?S:r,alpha:null!==(T=t.alpha)&&void 0!==T?T:e,width:null!==(j=t.width)&&void 0!==j?j:u,align:null!==(N=t.align)&&void 0!==N?N:s,side:null!==(I=t.side)&&void 0!==I?I:h,style:this.toStrokeStyle(null!==(C=t.style)&&void 0!==C?C:o)}:n?{enable:null!==(A=n.enable)&&void 0!==A?A:i,color:null!==(R=n.color)&&void 0!==R?R:r,alpha:null!==(k=n.alpha)&&void 0!==k?k:e,width:null!==(L=n.width)&&void 0!==L?L:u,align:null!==(y=n.align)&&void 0!==y?y:s,side:null!==(x=n.side)&&void 0!==x?x:h,style:this.toStrokeStyle(null!==(B=n.style)&&void 0!==B?B:o)}:{enable:i,color:r,alpha:e,width:u,align:s,side:h,style:o}},t.prototype.toStrokeStyle=function(t){if(Ot(t))return s[t];if(mt(t)){for(var n=s.NONE,i=0,r=t.length;i<r;++i)n|=s[t[i]];return n}return t},t.prototype.toTickMajorFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null===r)return;if(null!=r)return Mi.create(r);var e=i.formatter;if(e)return{format:e}}var u=t.getMajorTickTextFormat();if(null!=u)return Mi.create(u)},t.prototype.toTickMajorText=function(t,n){return{format:(n=n||{}).format,color:this.toTickMajorTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:Ai(n.weight,d),align:this.toTickMajorTextAlign(t,n.align),offset:this.toTickMajorTextOffset(t,n.offset),style:Ai(n.style,g),outline:this.toTickMajorTextOutline(t,n.outline),spacing:this.toTickMajorTextSpacing(t,n.spacing),direction:this.toTickMajorTextDirection(t,n.direction),padding:this.toTickMajorTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toTickMajorTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toTickMajorTextAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextAlignVertical(e)}},t.prototype.toTickMajorTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMajorTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMajorTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextPaddingVertical()}},t.prototype.toTickMajorTextDirection=function(t,n){return Ai(null!=n?n:t.getMajorTickTextDirection(),p)},t.prototype.toTickMajorTextColor=function(t,n){return null!=n?n:t.getMajorTickTextColor()},t.prototype.toTickMinorFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null===r)return;if(null!=r)return Mi.create(r);var e=i.formatter;if(e)return{format:e}}var u=t.getMinorTickTextFormat();if(null!=u)return Mi.create(u)},t.prototype.toTickMinorText=function(t,n){return{format:(n=n||{}).format,color:this.toTickMinorTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:Ai(n.weight,d),align:this.toTickMinorTextAlign(t,n.align),offset:this.toTickMinorTextOffset(t,n.offset),style:Ai(n.style,g),outline:this.toTickMinorTextOutline(t,n.outline),spacing:this.toTickMinorTextSpacing(t,n.spacing),direction:this.toTickMinorTextDirection(t,n.direction),padding:this.toTickMinorTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toTickMinorTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toTickMinorTextAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMinorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMinorTickTextAlignVertical(e)}},t.prototype.toTickMinorTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMinorTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMinorTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMinorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMinorTickTextPaddingVertical()}},t.prototype.toTickMinorTextDirection=function(t,n){return Ai(null!=n?n:t.getMinorTickTextDirection(),p)},t.prototype.toTickMinorTextColor=function(t,n){return null!=n?n:t.getMinorTickTextColor()},t.prototype.toLabel=function(t,n){var i=null==n?void 0:n.label;if(i)return{value:i.value,color:this.toLabelColor(t,i.color),alpha:i.alpha,family:i.family,size:i.size,weight:Ai(i.weight,d),align:this.toLabelAlign(t,i.align),offset:this.toLabelOffset(t,i.offset),style:Ai(i.style,g),outline:this.toLabelOutline(t,i.outline),spacing:this.toLabelSpacing(t,i.spacing),direction:this.toLabelDirection(t,i.direction),padding:this.toLabelPadding(t,i.padding),clipping:i.clipping}},t.prototype.toLabelOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toLabelAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelAlignVertical(e)}},t.prototype.toLabelOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelPaddingVertical()}},t.prototype.toLabelDirection=function(t,n){return Ai(null!=n?n:t.getLabelDirection(),p)},t.prototype.toLabelColor=function(t,n){return null!=n?n:t.getLabelColor()},t}(),lg=function(){function t(t){this.jf=t,this.hu=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Hr;return null==t&&(t=this.newShapes(),this.Hr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.jf.tick,r=i.major,e=r.gridline;if(i.enable&&e.enable)for(var u=r.capacity,s=null!==(t=e.style)&&void 0!==t?t:z.NONE,h=this.newShapePosition(),o=0;o<u;++o){var a=new en;a.points.position=h,a.points.style=s,a.stroke.copy(e.stroke),n.push(a)}return n},t.prototype.newShapePosition=function(){switch(this.jf.position){case hg.LEFT:case hg.RIGHT:return it.LEFT;default:return it.TOP}},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.hu=0,this.Kc=void 0},t.prototype.destroy=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.hu=0,this.Kc=void 0},t}(),vg=function(){function t(t){this.jf=t,this.hu=0,this.If=new lg(t)}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Hr;return null==t&&(t=this.newShapes(),this.Hr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.jf.tick;if(i.enable)for(var r=i.major,e=r.capacity,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:z.NONE,o=0;o<e;++o){var a=new en;a.points.position=s,a.points.size=u,a.points.style=h,a.stroke.copy(r.stroke),a.text.copy(r.text),a.size.set(0,0),n.push(a)}return n},Object.defineProperty(t.prototype,"gridline",{get:function(){return this.If},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.If.bind(t,n);for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.If.unbind(),this.hu=0,this.Kc=void 0},t.prototype.destroy=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.If.destroy(),this.hu=0,this.Kc=void 0},t}(),bg=function(){function t(t){this.jf=t,this.hu=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Hr;return null==t&&(t=this.newShapes(),this.Hr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.jf.tick;if(i.enable)for(var r=i.minor,e=r.count,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:z.NONE,o=0,a=(i.major.capacity+1)*e;o<a;++o){var c=new en;c.points.position=s,c.points.size=u,c.points.style=h,c.stroke.copy(r.stroke),c.text.copy(r.text),c.size.set(0,0),n.push(c)}return n},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.hu=0,this.Kc=void 0},t.prototype.destroy=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.hu=0,this.Kc=void 0},t}(),dg=function(){function t(t,n){this.from=t,this.to=n}return t.prototype.set=function(t,n){return null!=t&&(this.from=t),null!=n&&(this.to=n),this},t.prototype.add=function(t,n){return Th(t)||(this.from=Th(this.from)?t:Math.min(this.from,t)),Th(n)||(this.to=Th(this.to)?n:Math.max(this.to,n)),this},t.prototype.clear=function(){return this.from=NaN,this.to=NaN,this},t}(),gg=function(){function t(t,n){this.jf=t,this.hu=0,this.Cf=this.newMajor(t,n),this.Af=this.newMinor(t,n),this.Rf=[],this.kf=[],this.Mu=new dg(0,0)}return Object.defineProperty(t.prototype,"major",{get:function(){return this.Cf},enumerable:!1,configurable:!0}),t.prototype.newMajor=function(t,n){return new vg(t)},Object.defineProperty(t.prototype,"minor",{get:function(){return this.Af},enumerable:!1,configurable:!0}),t.prototype.newMinor=function(t,n){return new bg(t)},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.Cf.bind(t,n),this.Af.bind(t,n)},t.prototype.unbind=function(){this.Af.unbind(),this.Cf.unbind(),this.hu=0,this.Kc=void 0},t.prototype.update=function(){var t=this.Kc,n=this.Cf.shapes,i=this.Af.shapes;if(null!=t&&n&&i){var r=t.plotArea,e=r.container.transform.localTransform,u=this.Cf.gridline.shapes,s=this.jf,h=s.padding*this.hu,o=this.Mu,a=void 0;switch(s.position){case hg.TOP:if(a=r.coordinate.x.get(s.coordinate)){var c=(d=this.getDomain(r,a,o)).from,f=d.to,l=(g=this.getDomainVisible(r,a,o)).from,v=g.to,b=r.height;return this.updateX(c,f,l,v,a,n,i,u,0-h,e,b)}break;case hg.BOTTOM:var d,g;if(a=r.coordinate.x.get(s.coordinate))return c=(d=this.getDomain(r,a,o)).from,f=d.to,l=(g=this.getDomainVisible(r,a,o)).from,v=g.to,b=r.height,this.updateX(c,f,l,v,a,n,i,u,b+h,e,b);break;case hg.LEFT:if(a=r.coordinate.y.get(s.coordinate)){var m=(E=this.getRange(r,a,o)).from,w=E.to,p=(M=this.getRangeVisible(r,a,o)).from,O=M.to,D=r.width;return this.updateY(m,w,p,O,a,n,i,u,0-h,e,D)}break;case hg.RIGHT:var E,M;if(a=r.coordinate.y.get(s.coordinate))return m=(E=this.getRange(r,a,o)).from,w=E.to,p=(M=this.getRangeVisible(r,a,o)).from,O=M.to,D=r.width,this.updateY(m,w,p,O,a,n,i,u,D+h,e,D)}}return!1},t.prototype.getDomain=function(t,n,i){var r=t.getBoundsInContainer(),e=n.transform;return i.set(n.unmap(e.unmap(r.x)),n.unmap(e.unmap(r.x+r.width)))},t.prototype.getDomainVisible=function(t,n,i){return i},t.prototype.getRange=function(t,n,i){var r=t.getBoundsInContainer(),e=n.transform;return i.set(n.unmap(e.unmap(r.y)),n.unmap(e.unmap(r.y+r.height)))},t.prototype.getRangeVisible=function(t,n,i){return i},t.prototype.updateX=function(t,n,i,r,e,u,s,h,o,a,c){var f=this.jf.tick,l=f.major,v=l.count,b=l.capacity,d=l.step,g=l.formatter,m=f.minor,w=m.count,p=(b+1)*w,O=m.step,D=m.formatter,E=this.Rf,M=this.kf;this.newTicks(e,t,n,i,r,v,b,d,w,p,O,E,M);for(var S=a.a,T=a.tx,j=0;j<b;++j){var N=u[j],I=3*j,C=E[I+0];if(isNaN(C))this.hideMajor(N),j<h.length&&this.hideMajorGridline(h[j]);else{var A=S*E[I+1]+T,R=E[I+2];this.showMajor(N,A,o,null==g?void 0:g.format(C,R)),j<h.length&&this.showMajorGridline(h[j],C,A,.5*c,0,c)}}for(j=0;j<p;++j){var k=s[j],L=3*j,y=M[L+0];if(isNaN(y))this.hideMinor(k);else{var x=S*M[L+1]+T,B=M[L+2];this.showMinor(k,x,o,null==D?void 0:D.format(y,B))}}return!0},t.prototype.updateY=function(t,n,i,r,e,u,s,h,o,a,c){var f=this.jf.tick,l=f.major,v=l.count,b=l.capacity,d=l.step,g=l.formatter,m=f.minor,w=m.count,p=(b+1)*w,O=m.step,D=m.formatter,E=this.Rf,M=this.kf;this.newTicks(e,t,n,i,r,v,b,d,w,p,O,E,M);for(var S=a.d,T=a.ty,j=0;j<b;++j){var N=u[j],I=3*j,C=E[I+0];if(isNaN(C))this.hideMajor(N),j<h.length&&this.hideMajorGridline(h[j]);else{var A=S*E[I+1]+T,R=E[I+2];this.showMajor(N,o,A,null==g?void 0:g.format(C,R)),j<h.length&&this.showMajorGridline(h[j],C,.5*c,A,c,0)}}for(j=0;j<p;++j){var k=s[j],L=3*j,y=M[L+0];if(isNaN(y))this.hideMinor(k);else{var x=S*M[L+1]+T,B=M[L+2];this.showMinor(k,o,x,null==D?void 0:D.format(y,B))}}return!0},t.prototype.showMajor=function(t,n,i,r){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(n,i),t.text.value=null!=r?r:"",t.allowUploadedUpdate()},t.prototype.showMajorGridline=function(t,n,i,r,e,u){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(i,r),t.size.set(e,u),t.allowUploadedUpdate()},t.prototype.hideMajor=function(t){t.visible=!1},t.prototype.hideMajorGridline=function(t){t.visible=!1},t.prototype.showMinor=function(t,n,i,r){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(n,i),t.text.value=null!=r?r:"",t.allowUploadedUpdate()},t.prototype.hideMinor=function(t){t.visible=!1},t.prototype.newTicks=function(t,n,i,r,e,u,s,h,o,a,c,f,l){t.ticks(n,i,r,e,u,s,h,o,a,c,f,l)},t.prototype.destroy=function(){this.Cf.destroy(),this.Af.destroy(),this.hu=0,this.Kc=void 0},t}(),mg=function(){function t(t){var n=this.toTheme(t);this.cn=n;var i=this.newParser(n,t);this.jf=i,this.hu=0,this.Lf=this.newBar(i,n,t),this.yf=this.newTick(i,n,t),this.xf=this.newGuide(i,n,t)}return t.prototype.newParser=function(t,n){return new fg(t,n)},Object.defineProperty(t.prototype,"position",{get:function(){return this.jf.position},set:function(t){this.jf.position=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"coordinate",{get:function(){return this.jf.coordinate},set:function(t){this.jf.coordinate=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this.jf.padding},set:function(t){this.jf.padding=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bar",{get:function(){return this.Lf},enumerable:!1,configurable:!0}),t.prototype.newBar=function(t,n,i){return new og(t)},Object.defineProperty(t.prototype,"tick",{get:function(){return this.yf},enumerable:!1,configurable:!0}),t.prototype.newTick=function(t,n,i){return new gg(t)},Object.defineProperty(t.prototype,"guide",{get:function(){return this.xf},enumerable:!1,configurable:!0}),t.prototype.newGuide=function(t,n,i){for(var r=new ag(this),e=t.guide.list,u=0,s=e.length;u<s;++u)r.add(e[u]);return r},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.Lf.bind(t,n),this.yf.bind(t,n),this.xf.bind(t,n)},t.prototype.unbind=function(){this.xf.unbind(),this.yf.unbind(),this.Lf.unbind(),this.hu=0,this.Kc=void 0},t.prototype.update=function(){var t=this.Lf.update(),n=this.yf.update(),i=this.xf.update();if(t||n||i){var r=this.Kc;r&&st.update(r.plotArea)}},t.prototype.onRender=function(){this.Lf.update(),this.yf.update(),this.xf.update()},t.prototype.destroy=function(){this.Lf.destroy(),this.yf.destroy(),this.xf.destroy(),this.Kc=void 0},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartAxisBase"},t}(),wg=function(){function t(t,n){this.Bf=t,this.Kc=new xe,this.Un=new Map}return Object.defineProperty(t.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Bf},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var n=this.Un,i=n.get(t.position);null==i&&(i=[],n.set(t.position,i)),i.push(t),t.bind(this,i.length-1)},t.prototype.get=function(t,n){var i=this.Un.get(Ai(t,hg));return i&&0<=n&&n<i.length?i[n]:null},t.prototype.indexOf=function(t){var n=this.Un.get(t.position);return n?n.indexOf(t):-1},t.prototype.clear=function(t){var n=this.Un.get(Ai(t,hg));if(n){for(var i=0,r=n.length;i<r;++i)n[i].destroy();n.length=0}return this},t.prototype.size=function(t){var n=this.Un.get(Ai(t,hg));return n?n.length:0},t.prototype.update=function(){this.Un.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].update()}))},t.prototype.onRender=function(){this.Un.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].onRender()}))},t.prototype.destroy=function(){this.Un.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].destroy();t.length=0}))},t}(),pg=function(){function t(t){this.zn=t}return Object.defineProperty(t.prototype,"bar",{get:function(){var t=this.Lf;return void 0===t&&(t=this.newBar(),this.Lf=t),t},enumerable:!1,configurable:!0}),t.prototype.newBar=function(){var t,n,i=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.bar)&&void 0!==n?n:{};if(!1!==i.enable){var r=new en;return r.stroke.copy(this.toStrokeOptions(i.stroke,s.DASHED)),r.text.copy(this.toTextOptions(i.text)),r}return null},t.prototype.toStrokeOptions=function(t,n){var i;return{enable:(t=t||{}).enable,color:t.color,alpha:t.alpha,width:t.width,align:t.align,side:Ai(t.side,qt),style:Ai(null!==(i=t.style)&&void 0!==i?i:n,s)}},t.prototype.toTextOptions=function(t){return{value:(t=t||{}).value,color:t.color,alpha:t.alpha,family:t.family,size:t.size,weight:Ai(t.weight,d),align:this.toTextAlignOptions(t.align),offset:t.offset,style:Ai(t.style,g),outline:t.outline,spacing:t.spacing,direction:Ai(t.direction,p),padding:t.padding,clipping:t.clipping,fitting:t.fitting}},t.prototype.toTextAlignOptions=function(t){return{horizontal:Ai(null==(t=t||{})?void 0:t.horizontal,m),vertical:Ai(null==t?void 0:t.vertical,w)}},t.prototype.toBarPosition=function(t){switch(t.position){case hg.LEFT:case hg.RIGHT:return it.LEFT;default:return it.TOP}},Object.defineProperty(t.prototype,"label",{get:function(){var t=this.Yh;return void 0===t&&(t=this.newLabel(),this.Yh=t),t},enumerable:!1,configurable:!0}),t.prototype.newLabel=function(){var t,n,i,r,e=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.label)&&void 0!==n?n:{};if(!0===e.enable){var u=new Fo;return u.stroke.copy(this.toStrokeOptions(e.stroke)),u.fill.copy(e.fill),u.text.copy(this.toTextOptions(e.text)),u.size.set(null!==(i=e.width)&&void 0!==i?i:50,null!==(r=e.height)&&void 0!==r?r:30),u}return null},Object.defineProperty(t.prototype,"labelMargin",{get:function(){var t=this._f;return null==t&&(t=this.newLabelMargin(),this._f=t),t},enumerable:!1,configurable:!0}),t.prototype.newLabelMargin=function(){var t=this.zn;if(null!=t){var n=t.label;if(null!=n){var i=n.margin;if(null!=i)return i}}return 10},Object.defineProperty(t.prototype,"tick",{get:function(){var t=this.yf;return void 0===t&&(t=this.newTick(),this.yf=t),t},enumerable:!1,configurable:!0}),t.prototype.newTick=function(){var t,n,i,r=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.tick)&&void 0!==n?n:{};if(!0===r.enable){var e=new en;e.stroke.copy(this.toStrokeOptions(r.stroke)),e.text.copy(this.toTextOptions(r.text));var u=null!==(i=r.size)&&void 0!==i?i:5;return e.size.set(u,u),e}return null},Object.defineProperty(t.prototype,"tickMargin",{get:function(){var t=this.Pf;return null==t&&(t=this.newTickMargin(),this.Pf=t),t},enumerable:!1,configurable:!0}),t.prototype.newTickMargin=function(){var t=this.zn;if(null!=t){var n=t.tick;if(null!=n){var i=n.margin;if(null!=i)return i}}return 0},t.prototype.toTickPosition=function(t){switch(t.position){case hg.LEFT:case hg.RIGHT:return it.LEFT;default:return it.TOP}},t.prototype.bind=function(t,n,i){var r=this.bar;null!=r&&(r.points.position=this.toBarPosition(i),r.attach(t.container));var e=this.label;null!=e&&e.attach(t.container);var u=this.tick;null!=u&&(u.points.position=this.toTickPosition(i),u.attach(t.container))},t.prototype.unbind=function(){var t=this.Lf;null!=t&&t.detach();var n=this.Yh;null!=n&&n.detach();var i=this.yf;null!=i&&i.detach()},t.prototype.update=function(t,n,i,r,e,u,s){var h=this.Lf;if(null!=h){switch(h.disallowUploadedUpdate(),t){case hg.TOP:case hg.BOTTOM:h.transform.position.set(n,i),h.size.set(0,u),h.visible=r;break;case hg.LEFT:case hg.RIGHT:h.transform.position.set(n,i),h.size.set(e,0),h.visible=r}h.allowUploadedUpdate()}var o=this.Yh;if(null!=o){var a=this.labelMargin,c=s+.5*(v=o.size).x+a,f=s+.5*v.y+a;switch(o.disallowUploadedUpdate(),t){case hg.TOP:o.transform.position.set(n,-f),o.visible=r;break;case hg.BOTTOM:o.transform.position.set(n,u+f),o.visible=r;break;case hg.LEFT:o.transform.position.set(-c,i),o.visible=r;break;case hg.RIGHT:o.transform.position.set(e+c,i),o.visible=r}o.allowUploadedUpdate()}var l=this.yf;if(null!=l){var v;switch(a=this.tickMargin,c=s+.5*(v=l.size).x+a,f=s+.5*v.y+a,l.disallowUploadedUpdate(),t){case hg.TOP:l.transform.position.set(n,-f),l.visible=r;break;case hg.BOTTOM:l.transform.position.set(n,u+f),l.visible=r;break;case hg.LEFT:l.transform.position.set(-c,i),l.visible=r;break;case hg.RIGHT:l.transform.position.set(e+c,i),l.visible=r}l.allowUploadedUpdate()}return!0},t.prototype.destroy=function(){var t=this.Lf;null!=t&&t.destroy();var n=this.Yh;null!=n&&n.destroy();var i=this.yf;null!=i&&i.destroy()},t}(),Og=function(){function n(n){var i;this.zn=n,this.hu=0,this._=null!==(i=null==n?void 0:n.position)&&void 0!==i?i:0,this.Mu=new t.Point,this.Ff=!0}return Object.defineProperty(n.prototype,"shape",{get:function(){var t=this.Xr;return null==t&&(t=this.newShape(),this.Xr=t),t},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){return new pg(this.zn)},Object.defineProperty(n.prototype,"position",{get:function(){return this._},set:function(t){this._=t},enumerable:!1,configurable:!0}),n.prototype.show=function(){return this.Ff=!0,this},n.prototype.isShown=function(){return this.Ff},n.prototype.hide=function(){return this.Ff=!1,this},n.prototype.isHidden=function(){return!this.Ff},n.prototype.bind=function(t,n,i){this.Kc=t,this.hu=n,this.Nf=i,this.shape.bind(t,n,i)},n.prototype.unbind=function(){var t=this.Xr;null!=t&&t.unbind(),this.Nf=void 0,this.hu=0,this.Kc=void 0},n.prototype.update=function(){var t=this.Kc,n=this.hu,i=this.Xr,r=this.Nf;if(null!=i&&null!=t&&null!=r){var e=t.plotArea,u=e.container.transform.localTransform,s=e.width,h=e.height,o=r.padding*n;switch(r.position){case hg.TOP:case hg.BOTTOM:var a=e.coordinate.x.get(r.coordinate);if(a){(l=this.Mu).set(a.transform.map(a.map(this._)),0),u.apply(l,l);var c=l.x;i.update(r.position,c,.5*h,this.Ff&&0<=c&&c<=s,s,h,o)}else i.update(r.position,0,.5*h,!1,s,h,o);break;case hg.LEFT:case hg.RIGHT:var f=e.coordinate.y.get(r.coordinate);if(f){var l;(l=this.Mu).set(0,f.transform.map(f.map(this._))),u.apply(l,l);var v=l.y;i.update(r.position,.5*s,v,this.Ff&&0<=v&&v<=h,s,h,o)}else i.update(r.position,.5*s,0,!1,s,h,o)}return!0}return!1},n.prototype.destroy=function(){var t=this.Xr;null!=t&&t.destroy(),this.hu=0,this.Kc=void 0},n}(),Dg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisX"},n}(mg),Eg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisXDatetime"},n}(Dg),Mg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisY"},n}(mg),Sg=[1095651,16667680,15778578,1858929],Tg=[Sg[0],an.brighten(Sg[0],.4),Sg[1],an.brighten(Sg[1],.4),Sg[2],an.brighten(Sg[2],.4),Sg[3],an.brighten(Sg[3],.4)],jg=function(t){return Tg[t%Tg.length]},Ng={X:0,Y:1},Ig=function(){function t(t){this.cn=this.toTheme(t),this.R=0,this.Uf=null==t?void 0:t.translation,this.Gf=0,this.Hf=null==t?void 0:t.scaling,this.Gn=1,this.zf=0,this.Vf=1}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translate",{get:function(){return this.Gf},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this.Gn},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.set(0,n===Ng.X?1:-1)},t.prototype.unbind=function(){},t.prototype.set=function(t,n){var i=!1;null!=t&&!1!==this.Uf&&this.Gf!==t&&(i=!0,this.Gf=t),null!=n&&!1!==this.Hf&&this.Gn!==n&&(i=!0,this.Gn=n),i&&(this.R+=1,this.Vf=this.cn.isZero(this.Gn)?0:1/this.Gn,this.zf=-this.Gf*this.Vf)},t.prototype.blend=function(t,n){var i=1-t,r=n.newTranslate*t+n.oldTranslate*i,e=n.newScale*t+n.oldScale*i;this.set(r,e)},t.prototype.map=function(t){return this.Gf+this.Gn*t},t.prototype.mapAll=function(t,n,i,r,e){for(var u=this.Gf,s=this.Gn,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.unmap=function(t){return this.zf+this.Vf*t},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=this.zf,s=this.Vf,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTransform"},t}(),Cg=function(){function t(){this.oldTranslate=0,this.oldScale=1,this.newTranslate=0,this.newScale=1}return t.prototype.set=function(t,n){null!=t&&(this.newTranslate=t),null!=n&&(this.newScale=n)},t}(),Ag=function(){function t(t){this.R=0,this.rn=Ng.X,this.cn=this.toTheme(t),this.I=this.newTransform(null==t?void 0:t.transform),this.yf=this.newTick(null==t?void 0:t.tick),this.Mu=this.newRegion(),this.Wf=this.newMark(),this.Bt=null==t?void 0:t.from,this.Pt=null==t?void 0:t.to}return t.prototype.newTransform=function(t){return new Ig(t)},t.prototype.newRegion=function(){return new dg(NaN,NaN)},t.prototype.newMark=function(){return new Cg},Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},set:function(t){this.Bt=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},set:function(t){this.Pt=t},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.Kc=t,this.rn=n,this.I.bind(t,n)},t.prototype.unbind=function(){this.Kc=void 0,this.I.unbind()},t.prototype.fit=function(t,n){this.doFit(t,n,this.I)},t.prototype.mark=function(t,n){var i=this.Wf,r=this.I;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.I.blend(t,this.Wf)},t.prototype.doFit=function(t,n,i){var r=this.Kc;if(r){var e=r.container.plotArea,u=this.Mu;switch(this.rn){case Ng.X:this.getPixelDomain(e,u),this.Xf(u.from,u.to,this.toFitDomain(t,n,e,u),i);break;case Ng.Y:this.getPixelRange(e,u),this.Xf(u.from,u.to,this.toFitRange(t,n,e,u),i)}}},t.prototype.getPixelDomain=function(t,n){var i=t.padding;return n.set(i.getLeft(),t.width-i.getRight())},t.prototype.getPixelRange=function(t,n){var i=t.padding;return n.set(t.height-i.getBottom(),i.getTop())},t.prototype.toFitDomain=function(t,n,i,r){return null==t&&(t=this.Bt),null==n&&(n=this.Pt),null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null==t&&(t=this.Bt),null==n&&(n=this.Pt),null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.Xf=function(t,n,i,r){var e=i.from,u=i.to;if(!Th(e)&&!Th(u)){var s,h=this.map(e),o=this.map(u)-h,a=t-h*(s=this.cn.isZero(o)?n<t?-1:1:(n-t)/o);r.set(a,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.I},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return t},t.prototype.mapAll=function(t,n,i,r,e){},t.prototype.unmap=function(t){return t},t.prototype.unmapAll=function(t,n,i,r,e){},t.prototype.ticks=function(t,n,i,r,e,u,s,h,o,a,c,f){this.yf.calculate(t,n,i,r,e,u,s,h,o,a,c,f,this)},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinate"},t}(),Rg=function(){function t(t,n){this.Kc=t,this.rn=n,this.Un=[]}return Object.defineProperty(t.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.Un;return null==n?i.push(t):0<=n&&n<i.length?i.splice(n,0,t):i.push(t),t.bind(this,this.rn),this},t.prototype.get=function(t){var n=this.Un;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Un.indexOf(t)},t.prototype.remove=function(t){var n=this.Un;if(pt(t)){if(0<=(r=t)&&r<n.length){var i=n.splice(r,1)[0];return i.unbind(),i}}else{var r,e=t;if(0<=(r=n.indexOf(e)))return n.splice(r,1),e.unbind(),e}return null},t.prototype.clear=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].unbind();return t.length=0,this},t.prototype.destroy=function(){return this.clear()},t.prototype.size=function(){return this.Un.length},t.prototype.fit=function(t,n){for(var i=this.Un,r=0,e=i.length;r<e;++r)i[r].fit(t,n);return this},t.prototype.mark=function(t,n){for(var i=this.Un,r=0,e=i.length;r<e;++r)i[r].mark(t,n);return this},t.prototype.blend=function(t){for(var n=this.Un,i=0,r=n.length;i<r;++i)n[i].blend(t);return this},t}(),kg=function(){function t(t,n){this.Bf=t;var i=new Rg(this,Ng.X);this._x=i;var r=new Rg(this,Ng.Y);if(this._y=r,n){var e=n.x;if(e)if(mt(e))for(var u=0,s=e.length;u<s;++u)i.add(e[u]);else i.add(e);var h=n.y;if(h)if(mt(h))for(u=0,s=h.length;u<s;++u)r.add(h[u]);else r.add(h)}}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Bf},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n,i,r){return this._x.fit(t,n),this._y.fit(i,r),this},t.prototype.mark=function(t,n,i,r){return this._x.mark(t,n),this._y.mark(i,r),this},t.prototype.blend=function(t){return this._x.blend(t),this._y.blend(t),this},t}(),Lg=function(){function t(t){this.cn=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.cn.toStep(t,n,i):-1:pt(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:pt(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c,f,l){if(!(e<=0)){var v=l.transform,b=Math.min(t,n),d=Math.max(t,n),g=Math.min(i,r),m=Math.max(i,r),w=l.map(g),p=l.map(m),O=Math.min(w,p),D=Math.max(w,p),E=l.map(b),M=l.map(d),S=Math.min(E,M),T=Math.max(E,M),j=Math.max(O,S),N=Math.min(D,T),I=0,C=0,A=this.toMajorStep(E,M,e,s);if(A<=0)j<=E&&E<=N&&(c[0]=b,c[1]=v.map(E),c[2]=0,I+=1);else for(var R=Math.floor(E/A)-1,k=Math.ceil(M/A)+1,L=this.toMinorStep(A,h,a),y=R;y<=k;++y){var x=y*A;I<u&&j<=x&&x<=N&&(c[0+(P=3*I)]=l.unmap(x),c[P+1]=v.map(x),c[P+2]=A,I+=1);for(var B=0;B<h;B+=1)if(C<o){var _=x+(B+1)*L;j<=_&&_<=N&&(f[0+(F=3*C)]=l.unmap(_),f[F+1]=v.map(_),f[F+2]=L,C+=1)}}for(y=I;y<u;++y){var P;c[0+(P=3*y)]=NaN,c[P+1]=NaN,c[P+2]=NaN}for(y=C;y<o;++y){var F;f[0+(F=3*y)]=NaN,f[F+1]=NaN,f[F+2]=NaN}}},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),yg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newTick=function(t){return new Lg(t)},n}(Ag),xg=function(){function t(t){this.cn=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.cn.toStep(t,n,i):-1:pt(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:pt(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c,f,l){if(!(e<=0)){var v=l.transform,b=Math.min(t,n),d=Math.max(t,n),g=Math.min(i,r),m=Math.max(i,r),w=l.map(g),p=l.map(m),O=Math.min(w,p),D=Math.max(w,p),E=l.map(b),M=l.map(d),S=Math.min(E,M),T=Math.max(E,M),j=Math.max(O,S),N=Math.min(D,T),I=0,C=0,A=this.toMajorStep(E,M,e,s);if(A<=0)j<=E&&E<=N&&(c[0]=b,c[1]=v.map(E),c[2]=0,I+=1);else for(var R=Math.floor(E/A)-1,k=Math.ceil(M/A)+1,L=this.toMinorStep(A,h,a),y=R;y<=k;++y){var x=y*A;I<u&&j<=x&&x<=N&&(c[0+(P=3*I)]=l.unmap(x),c[P+1]=v.map(x),c[P+2]=l.unmap(x-1),I+=1);for(var B=0;B<h;B+=1)if(C<o){var _=x+(B+1)*L;j<=_&&_<=N&&(f[0+(F=3*C)]=l.unmap(_),f[F+1]=v.map(_),f[F+2]=l.unmap(_-1),C+=1)}}for(y=I;y<u;++y){var P;c[0+(P=3*y)]=NaN,c[P+1]=NaN,c[P+2]=NaN}for(y=C;y<o;++y){var F;f[0+(F=3*y)]=NaN,f[F+1]=NaN,f[F+2]=NaN}}},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),Bg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newTick=function(t){return new xg(t)},n.prototype.map=function(t){return Math.log(Math.max(0,t))/Math.LN10},n.prototype.mapAll=function(t,n,i,r,e){for(var u=1/Math.LN10,s=n+e;s<i;s+=r){var h=t[s];t[s]=Math.log(Math.max(0,h))*u}},n.prototype.unmap=function(t){return Math.pow(10,t)},n.prototype.unmapAll=function(t,n,i,r,e){for(var u=n+e;u<i;u+=r)t[u]=Math.pow(10,t[u])},n}(Ag),_g=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegendItem"},n}(hr),Pg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegend"},n}(hr),Fg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartOverview"},n}(hr),Ug=function(n){function i(i){var r=n.call(this)||this,e=r.transform;return r._=new _i(e.position,i),r.Gn=new _i(e.scale,i),r.Xi=new t.Rectangle,r}return _(i,n),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Gn},enumerable:!1,configurable:!0}),i.prototype.getBounds=function(t,i){return this._lastBoundsID=-1,n.prototype.getBounds.call(this,t,i)},i.prototype.calculateBounds=function(){var t=this._bounds,n=this.Mu,i=this.Xi,r=this.transform.worldTransform,e=0,u=0,s=0,h=0,o=this.children;if(0<o.length)for(var a=!0,c=0,f=o.length;c<f;++c){var l=o[c];l.visible&&(l.getBoundsInternal(!1,i),a?(a=!1,e=i.x,s=i.y,u=i.x+i.width,h=i.y+i.height):(e=Math.min(e,i.x),s=Math.min(s,i.y),u=Math.max(u,i.x+i.width),h=Math.max(h,i.y+i.height)))}t.clear(),n.set(e,s),r.apply(n,n),t.addPoint(n),n.set(u,h),r.apply(n,n),t.addPoint(n)},i}(xe),Gg=function(){function t(){this.shape=null,this.x=0,this.y=0,this.p0x=0,this.p0y=0,this.p1x=0,this.p1y=0,this.index=0,this.t=0,this.distance=0}return t.prototype.copyFrom=function(t){return this.shape=t.shape,this.x=t.x,this.y=t.y,this.p0x=t.p0x,this.p0y=t.p0y,this.p1x=t.p1x,this.p1y=t.p1y,this.index=t.index,this.t=t.t,this.distance=t.distance,this},t}(),Hg=function(){function t(t,n,i){this.enable=t,this.color=n,this.alpha=i}return t.from=function(n,i,r){var e,u,s;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i))},t}(),zg=function(){function t(){}return t.from=function(t,n){return mt(t)?function(n){return t[n%t.length]}:wt(t)?t:null!=t?function(){return t}:mt(n)?function(t){return n[t%n.length]}:wt(n)?n:function(){return n}},t}(),Vg=function(t){this.enable=zg.from(null==t?void 0:t.enable,!0),this.color=zg.from(null==t?void 0:t.color,jg),this.alpha=zg.from(null==t?void 0:t.alpha,q.FILL_ALPHA)},Wg=function(){function t(t,n){this.outer=t,this.inner=n}return t.from=function(n,i,r){var e,u;return new t(null!==(e=null==r?void 0:r.outer)&&void 0!==e?e:n.outer(i),null!==(u=null==r?void 0:r.inner)&&void 0!==u?u:n.inner(i))},t}(),Xg=function(t){this.outer=zg.from(null==t?void 0:t.outer,.2),this.inner=zg.from(null==t?void 0:t.inner,.1)},Kg=function(){function t(t,n){this.x=t,this.y=n}return t.from=function(n,i,r,e,u){var s,h;return new t(null!==(s=null==r?void 0:r.x)&&void 0!==s?s:null!=n.x?n.x(i):e,null!==(h=null==r?void 0:r.y)&&void 0!==h?h:null!=n.y?n.y(i):u)},t}(),Yg=function(t){t&&(null!=t.x&&(this.x=zg.from(t.x,0)),null!=t.y&&(this.y=zg.from(t.y,0)))},Jg=function(){function t(t,n,i,r,e,u,s){this.enable=t,this.color=n,this.alpha=i,this.width=r,this.align=e,this.side=u,this.style=s}return t.from=function(n,i,r){var e,u,s,h,o,a,c;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i),null!==(h=null==r?void 0:r.width)&&void 0!==h?h:n.width(i),null!==(o=null==r?void 0:r.align)&&void 0!==o?o:n.align(i),null!==(a=null==r?void 0:r.side)&&void 0!==a?a:n.side(i),null!==(c=null==r?void 0:r.style)&&void 0!==c?c:n.style(i))},t}(),Zg=function(t){this.enable=zg.from(null==t?void 0:t.enable,!0),this.color=zg.from(null==t?void 0:t.color,jg),this.alpha=zg.from(null==t?void 0:t.alpha,q.STROKE_ALPHA),this.width=zg.from(null==t?void 0:t.width,q.STROKE_WIDTH),this.align=zg.from(null==t?void 0:t.width,q.STROKE_ALIGN),this.side=zg.from(null==t?void 0:t.side,qt.ALL),this.style=zg.from(null==t?void 0:t.style,s.NON_SCALING)},qg=function(){function t(t,n){var i;this.Bf=t,this.Kf=new dg(NaN,NaN),this.Yf=new dg(NaN,NaN),this.tf=null!==(i=null==n?void 0:n.selection)&&void 0!==i?i:null,this.C=new Vg(null==n?void 0:n.fill),this.yo=new Zg(null==n?void 0:n.stroke),this.j=new Yg(null==n?void 0:n.size),this.vn=new Yg(null==n?void 0:n.offset),this.Qn=new Xg(null==n?void 0:n.padding),this.Un=[]}return t.prototype.newFill=function(t,n){return Hg.from(this.C,t,n)},t.prototype.newStroke=function(t,n){return Jg.from(this.yo,t,n)},t.prototype.newSize=function(t,n,i,r){return Kg.from(this.j,t,n,i,r)},t.prototype.newOffset=function(t,n,i,r){return Kg.from(this.vn,t,n,i,r)},t.prototype.newPadding=function(t,n){return Wg.from(this.Qn,t,n)},Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Bf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),t.prototype.update=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].update();var r=this.tf;r&&r.update()},t.prototype.onRender=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].onRender();var r=this.tf;r&&r.onRender()},t.prototype.add=function(t){var n=this.Un;t.bind(this,n.length),n.push(t)},t.prototype.get=function(t){var n=this.Un;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Un.indexOf(t)},t.prototype.clear=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Un.length},t.prototype.destroy=function(){this.clear();var t=this.tf;t&&t.unbind()},t.prototype.getDomain=function(t,n){n.clear();for(var i=this.Un,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.x===t){var s=u.domain;n.add(s.from,s.to)}}return n},t.prototype.getRange=function(t,n){n.clear();for(var i=this.Un,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.y===t){var s=u.range;n.add(s.from,s.to)}}return n},Object.defineProperty(t.prototype,"domain",{get:function(){var t=this.Kf;t.clear();for(var n=this.Un,i=0,r=n.length;i<r;++i){var e=n[i].domain;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.Yf;t.clear();for(var n=this.Un,i=0,r=n.length;i<r;++i){var e=n[i].range;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(t,n){for(var i=this.Un,r=i.length-1;0<=r;--r){var e=i[r];if(e.hitTest(t,n))return e}return null},t.prototype.calcHitPoint=function(n,i,r){var e=r,u=t.WORK_CALCHITPOINT,s=this.Un,h=null;u.distance=1/0;for(var o=s.length-1;0<=o;--o){var a=s[o];if(a.calcHitPoint(n,i,e)&&e.distance<u.distance){h=a;var c=e;e=u,u=c}}return h&&u!==r&&r.copyFrom(u),h},t.WORK_CALCHITPOINT=new Gg,t}(),Qg=function(n){function i(t,i){var r=n.call(this,i)||this;return r.Jf=t,r.Zf=0,r.qf=1e3,r.Qf=null,r.$f=function(){r.onBlend()},r}return _(i,n),i.prototype.init=function(i){var r,e=this;n.prototype.init.call(this,i),this.tl=!0,this.nl=new t.Rectangle,this.Rc=new t.Point;var u=new Ug((function(){e.il=!0,e.tl=!0,st.update(e)}));this.Kc=u,this.addChild(u),this.il=!0,this.br=new Or(this,(function(){return u}),null==i?void 0:i.view),this.rl=new kg(this,null==i?void 0:i.coordinate);var s=new qg(this,null==i?void 0:i.series);this.el=s;var h=new wg(this,null==i?void 0:i.axis);this.Nf=h,this.addChild(h.container);var o=s.selection;if(o&&o.bind(s),(null!==(r=null==i?void 0:i.mask)&&void 0!==r?r:this.theme.isOverflowMaskEnabled())&&(u.mask=this.getOverflowMask()),null!=i){var a=i.series;if(null!=a&&(l=a.list)){var c=l.length;if(0<c){for(var f=0;f<c;++f)s.add(l[f]);s.update()}}var l,v=i.axis;if(null!=v&&(l=v.list)){f=0;for(var b=l.length;f<b;++f)h.add(l[f])}}},i.prototype.onResize=function(t,i,r,e){this.il=!0,this.tl=!0,n.prototype.onResize.call(this,t,i,r,e)},i.prototype.getOverflowMask=function(){return null==this.dr&&(this.dr=new or(this),this.reflowable.add(this.dr),this.toDirty()),this.dr},Object.defineProperty(i.prototype,"chart",{get:function(){return this.Jf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"series",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"axis",{get:function(){return this.Nf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"view",{get:function(){return this.br},enumerable:!1,configurable:!0}),i.prototype.onWheel=function(t,i,r){var e=this.br.onWheel(t,i,r),u=n.prototype.onWheel.call(this,t,i,r);return e||u},i.prototype.onDblClick=function(t,i){var r=this.br.onDblClick(t,i),e=n.prototype.onDblClick.call(this,t,i);return r||e},i.prototype.onDown=function(t){this.br.onDown(t),n.prototype.onDown.call(this,t)},i.prototype.render=function(t){this.il&&(this.il=!1,this.rl.fit(),this.Nf.onRender(),this.el.onRender()),n.prototype.render.call(this,t)},i.prototype.destroy=function(){this.Kc.destroy(),this.el.destroy(),this.Nf.destroy()},i.prototype.getType=function(){return"DChartPlotArea"},i.prototype.getBoundsInContainer=function(){var t=this.nl;if(this.tl){this.tl=!1;var n=this.container;n.updateTransform();var i=n.transform.localTransform,r=this.Rc;r.set(0,0),i.applyInverse(r,r),t.x=r.x,t.y=r.y,r.set(this.width,this.height),i.applyInverse(r,r),t.width=r.x-t.x,t.height=r.y-t.y}return t},i.prototype.fit=function(t,n,i,r,e){var u=this.rl,s=this.Nf,h=this.el;if(null!=t&&t<=0)u.fit(n,i,r,e),s.update(),h.update();else{this.qf=null!=t?t:200,this.Zf=Date.now(),u.mark(n,i,r,e);var o=this.Qf;null!=o&&window.clearTimeout(o),this.Qf=window.setTimeout(this.$f,0)}return this},i.prototype.onBlend=function(){var t=(Date.now()-this.Zf)/this.qf;t<1?this.Qf=window.setTimeout(this.$f,0):(this.Qf=null,t=1),this.rl.blend(vr.ELASTIC(t)),this.Nf.update(),this.el.update()},i}(hr),$g=function(){function t(t,n,i){this.Bt=t,this.Pt=n,this.ut=i}return Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;return null!=t&&this.Bt!==t&&(Th(this.Bt)&&Th(t)||(this.Bt=t,i=!0)),null!=n&&this.Pt!==n&&(Th(this.Pt)&&Th(n)||(this.Pt=n,i=!0)),i&&this.ut(),this},t.prototype.add=function(t,n){var i,r;return Th(t)||(i=Th(this.from)?t:Math.min(this.from,t)),Th(n)||(r=Th(this.to)?n:Math.max(this.to,n)),this.set(i,r)},t.prototype.clear=function(){return this.set(NaN,NaN)},t}(),tm=function(){function t(t,n){this._x=t,this._y=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),t.prototype.bind=function(t){this._x.bind(t),this._y.bind(t)},t.prototype.unbind=function(){this._x.unbind(),this._y.unbind()},t.prototype.set=function(t,n,i,r){this._x.set(t,n,i,r),this._y.set(t,n,i,r)},t.prototype.unset=function(){this._x.unset(),this._y.unset()},t.prototype.update=function(t,n,i){var r=this._x.update(t,n,i),e=this._y.update(t,n,i);return r||e},t}(),nm=function(){function t(t){var n,i,r,e=this.toTheme(t);this.cn=e;var u=(new Dt).add(null!==(n=null==t?void 0:t.state)&&void 0!==n?n:ct.HOVERED);if(this.Rt=u,this.vs=null!==(i=null==t?void 0:t.enable)&&void 0!==i?i:e.isEnabled(u),null!=t){var s=t.shape;null!=s&&(wt(s)?this.ul=s:this.Xr=s)}this.B=null!==(r=null==t?void 0:t.style)&&void 0!==r?r:this.setStyle}return t.prototype.bind=function(t){if(this.vs){var n=this.Xr;if(null==n){var i=this.Rt,r=this.ul;n=null!=r?r(i):this.newShape(i,this.cn)}this.Xr=n,n.attach(t.plotArea.axis.container),n.visible=!1}},t.prototype.unbind=function(){var t=this.Xr;t&&t.detach()},t.prototype.newShape=function(t,n){return n.newShape(t)},t.prototype.set=function(t,n,i,r){this.update(t,n,i);var e=this.Xr;e&&this.B(e,r)},t.prototype.setStyle=function(t,n){},t.prototype.unset=function(){var t=this.Xr;t&&(t.visible=!1)},t.prototype.toTheme=function(t){var n=null==t?void 0:t.theme;return Ot(n)?this.getTheme(n):null!=n?n:this.getTheme(this.getType())},t.prototype.getTheme=function(t){return Z.getInstance().get(t)},t}(),im=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Xr;if(r){var e=i.x,u=t.plotArea.height;return r.transform.position.set(e,.5*u),r.size.set(0,u),r.visible=this.isVisible(t,n,i),!0}return!1},n.prototype.isVisible=function(t,n,i){var r=i.x;return 0<=r&&r<=t.plotArea.width},n.prototype.getType=function(){return"DChartSelectionGridlineX"},n}(nm),rm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Xr;if(r){var e=i.y,u=t.plotArea.width;return r.transform.position.set(.5*u,e),r.size.set(u,0),r.visible=this.isVisible(t,n,i),!0}return!1},n.prototype.isVisible=function(t,n,i){var r=i.y;return 0<=r&&r<=t.plotArea.height},n.prototype.getType=function(){return"DChartSelectionGridlineY"},n}(nm),em=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Xr;return!!r&&(r.transform.position.copyFrom(i),r.visible=this.isVisible(t,n,i),!0)},n.prototype.isVisible=function(t,n,i){var r=i.x,e=i.y,u=t.plotArea;return 0<=r&&r<=u.width&&0<=e&&e<=u.height},n.prototype.getType=function(){return"DChartSelectionMarker"},n}(nm),um={PREVIOUS:0,NEXT:1,CLOSER:2,INTERSECTION:3},sm=function(n){function i(i){var r,e,u,s,h,o=this;(o=n.call(this)||this).Kc=null,o.el=null,o.vs=null===(r=i.enable)||void 0===r||r,o.If=new tm(new im(null===(e=i.gridline)||void 0===e?void 0:e.x),new rm(null===(u=i.gridline)||void 0===u?void 0:u.y)),o.A=new em(i.marker),o.Rt=null!==(s=i.state)&&void 0!==s?s:ct.HOVERED,o.sl=null,o.hl=null,o._=new t.Point,o.wn=null!==(h=i.point)&&void 0!==h?h:um.CLOSER,o.Mu=new t.Point;var a=i.on;if(a)for(var c in a){var f=a[c];f&&o.on(c,f)}return o}return _(i,n),i.prototype.bind=function(t){this.vs&&(this.Kc=t,this.If.bind(t),this.A.bind(t))},i.prototype.unbind=function(){this.A.unbind(),this.If.unbind(),this.Kc=null,this.sl=null,this.hl=null},Object.defineProperty(i.prototype,"series",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gridline",{get:function(){return this.If},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"marker",{get:function(){return this.A},enumerable:!1,configurable:!0}),i.prototype.set=function(t,n){var i=this.Kc,r=this.sl=t.coordinate.x,e=this.hl=t.coordinate.y;if(i&&r&&e){var u=i.plotArea.container.localTransform,s=this._,h=this.Mu;if(n instanceof Gg){var o=n.x,a=n.y;switch(this.wn){case um.PREVIOUS:o=n.p0x,a=n.p0y;break;case um.NEXT:o=n.p1x,a=n.p1y;break;case um.CLOSER:Math.abs(n.p0x-n.x)<Math.abs(n.p1x-n.x)?(o=n.p0x,a=n.p0y):(o=n.p1x,a=n.p1y)}h.set(o,a),u.apply(h,h),s.set(r.unmap(r.transform.unmap(o)),e.unmap(e.transform.unmap(a)))}else s.copyFrom(n.position),h.set(r.transform.map(r.map(s.x)),e.transform.map(e.map(s.y))),u.apply(h,h);this.If.set(i,s,h,t),this.A.set(i,s,h,t),st.update(i.plotArea)}var c=this.el;if(c!==t){var f=this.Rt;c&&c.state.remove(f),this.el=t,t.state.add(f)}this.emit("change",this)},i.prototype.unset=function(){var t=this.el;t&&(this.el=null,this.sl=null,this.hl=null,t.state.remove(this.Rt),this.If.unset(),this.A.unset(),this.emit("change",this))},i.prototype.update=function(){var t=this.Kc,n=this.sl,i=this.hl;if(t&&n&&i){var r=this._,e=this.Mu;e.set(n.transform.map(n.map(r.x)),i.transform.map(i.map(r.y))),t.plotArea.container.localTransform.apply(e,e);var u=this.If.update(t,r,e),s=this.A.update(t,r,e);return u||s}return!1},i}(t.utils.EventEmitter),hm=function(t){function n(n){var i,r=this;(r=t.call(this)||this).Kc=null;var e=Ai(null!==(i=null==n?void 0:n.point)&&void 0!==i?i:um.CLOSER,um);r.Ja=r.newSelected(e,null==n?void 0:n.selected),r.ol=r.newHovered(e,null==n?void 0:n.hovered);var u=null==n?void 0:n.on;if(null!=u)for(var s in u){var h=u[s];h&&r.on(s,h)}return r.al=function(t){r.onMove(t)},r.cl=function(t){r.onClick(t)},r}return _(n,t),n.prototype.newSelected=function(t,n){return new sm(this.toSelectedOptions(t,n))},n.prototype.newHovered=function(t,n){return new sm(this.toHoveredOptions(t,n))},n.prototype.toSelectedOptions=function(t,n){return this.toSubOptions(t,n,ct.ACTIVE)},n.prototype.toHoveredOptions=function(t,n){return this.toSubOptions(t,n,ct.HOVERED)},n.prototype.toSubOptions=function(t,n,i){var r,e,u,s,h,o,a;null==(n=n||{}).point&&(n.point=t),null==n.state&&(n.state=i);var c=null!==(r=n.gridline)&&void 0!==r?r:n.gridline={},f=null!==(e=c.x)&&void 0!==e?e:c.x={};null==f.state&&(f.state=i);var l=null!==(u=c.y)&&void 0!==u?u:c.y={};null==l.state&&(l.state=i);var v=null!==(s=n.marker)&&void 0!==s?s:n.marker={};null==v.state&&(v.state=i);var b=null!==(h=n.label)&&void 0!==h?h:n.label={},d=null!==(o=b.x)&&void 0!==o?o:b.x={};null==d.state&&(d.state=i);var g=null!==(a=b.y)&&void 0!==a?a:b.y={};return null==g.state&&(g.state=i),n},n.prototype.onClick=function(t){var i=this.Kc;if(i&&t.target===i.plotArea){var r=n.WORK_SELECT,e=t.data.global,u=i.calcHitPoint(e.x,e.y,r),s=this.Ja;u?s.set(u,r):s.unset()}},n.prototype.onMove=function(t){var i=this.Kc;if(i){var r=this.ol;if(t.target===i.plotArea){var e=n.WORK_SELECT,u=t.data.global,s=i.calcHitPoint(u.x,u.y,e);s?r.set(s,e):r.unset()}else r.unset()}},n.prototype.bind=function(t){this.Kc=t,this.Ja.bind(t),this.ol.bind(t);var n=t.plotArea;n.on(ir.move,this.al),n.on(ir.tap,this.cl)},n.prototype.unbind=function(){var t=this.Kc;this.Kc=null,t&&t.plotArea.off(ir.move,this.al),this.Ja.unbind(),this.ol.unbind()},Object.defineProperty(n.prototype,"selected",{get:function(){return this.Ja},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hovered",{get:function(){return this.ol},enumerable:!1,configurable:!0}),n.prototype.update=function(){var t=this.Ja.update(),n=this.ol.update();if(t||n){var i=this.Kc;null!=i&&st.update(i.plotArea)}},n.prototype.onRender=function(){this.Ja.update(),this.ol.update()},n.WORK_SELECT=new Gg,n}(t.utils.EventEmitter),om=function(){function t(t,n){var i,r;this.p=t,this.fl=null!==(i=null==n?void 0:n.x)&&void 0!==i?i:0,this.ll=null!==(r=null==n?void 0:n.y)&&void 0!==r?r:0,this.vl=NaN,this.bl=NaN,this.dl=NaN,this.ml=NaN}return Object.defineProperty(t.prototype,"x",{get:function(){var t=this.p.container;return t?t.plotArea.coordinate.x.get(this.fl):null},set:function(t){var n=this.toIndexX(t);this.fl!==n&&(this.fl=n,this.vl=NaN,this.dl=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexX=function(t){if(pt(t))return t;if(null!=t){var n=this.p.container;if(n)return n.plotArea.coordinate.x.indexOf(t)}return-1},Object.defineProperty(t.prototype,"y",{get:function(){var t=this.p.container;return t?t.plotArea.coordinate.y.get(this.ll):null},set:function(t){var n=this.toIndexY(t);this.ll!==n&&(this.ll=n,this.bl=NaN,this.ml=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexY=function(t){if(pt(t))return t;if(null!=t){var n=this.p.container;if(n)return n.plotArea.coordinate.y.indexOf(t)}return-1},t.prototype.isDirty=function(t,n){var i=t.id,r=n.id,e=i!==this.vl,u=r!==this.bl;return this.vl=i,this.bl=r,e||u},t.prototype.isTransformDirty=function(t,n){var i=t.transform.id,r=n.transform.id,e=i!==this.dl,u=r!==this.ml;return this.dl=i,this.ml=r,e||u},t.prototype.reset=function(){this.vl=NaN,this.bl=NaN},t.prototype.destroy=function(){this.reset()},t}(),am=function(t){function n(n){var i=t.call(this)||this;i.rl=new om(i,null==n?void 0:n.coordinate),i.hu=0,i.Kf=new dg(NaN,NaN),i.Yf=new dg(NaN,NaN),i.wl=NaN,i.Ff=!0,i.Rt=new Et((function(t,n){i.onStateChange(t,n)}));var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i}return _(n,t),n.prototype.bind=function(t,n){this.Kc=t,this.rl.reset(),this.hu=n;var i=t.plotArea.chart;return i&&(this.Rt.parent=i.state),this},n.prototype.unbind=function(){return this.Kc=void 0,this},Object.defineProperty(n.prototype,"domain",{get:function(){return this.updateRegion(),this.Kf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"range",{get:function(){return this.updateRegion(),this.Yf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"container",{get:function(){return this.Kc||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinate",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),n.prototype.show=function(){return!0!==this.Ff&&(this.Ff=!0,this.onShow()),this},n.prototype.onShow=function(){var t=this.shape;null!=t&&(t.visible=!0)},n.prototype.isShown=function(){return this.Ff},n.prototype.hide=function(){return!1!==this.Ff&&(this.Ff=!1,this.onHide()),this},n.prototype.onHide=function(){var t=this.shape;null!=t&&(t.visible=!1)},n.prototype.isHidden=function(){return!this.Ff},n.prototype.destroy=function(){return this.Kc=void 0,this.rl.destroy(),this},n.prototype.hitTest=function(t,n){return!1},n.prototype.calcHitPoint=function(t,n,i){return!1},n.prototype.onStateChange=function(t,n){var i;this.toDirty();var r=null===(i=this.Kc)||void 0===i?void 0:i.plotArea.chart;st.update(r),this.emit("statechange",t,n,this)},n}(t.utils.EventEmitter),cm=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).pl=null,r.zn=t,r.jt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.Ol=0,r.Dl=NaN,r}return _(i,n),i.prototype.getSizeDefault=function(){return 10},i.prototype.getOffsetDefault=function(){return 0},i.prototype.bind=function(t,i){var r=this.pl;if(!r){(r=this.pl=this.newLineOfAny()).visible=this.Ff;var e=this.zn;this.initLine(r,e,t,i)}return r.attach(t.plotArea.container,i),this.Dl=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.initLine=function(t,n,i,r){var e=i.newFill(r,null==n?void 0:n.fill);this.C=e,t.fill.copy(e);var u=i.newStroke(r,null==n?void 0:n.stroke);this.yo=u,t.stroke.copy(u);var s=this.getSizeDefault(),h=i.newSize(r,null==n?void 0:n.size,s,s);this.j=h,t.points.size.set(h.x,h.y);var o=this.getOffsetDefault(),a=i.newOffset(r,n&&n.offset,o,o);this.vn=a,t.points.offset.set(a.x,a.y)},i.prototype.unbind=function(){var t=this.pl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.pl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.jt},set:function(t){this.jt=t,this.Ol+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.Ol+=1,this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.pl;if(n){var i=this.rl,r=i.x,e=i.y;if(r&&e){var u=this.Ol,s=u!==this.Dl,h=i.isDirty(r,e),o=i.isTransformDirty(r,e);if(s||h||o)return this.Dl=u,this.doUpdateLine(n,r,e),t&&st.update(n),!0}}return!1},i.prototype.doUpdateLine=function(t,n,r){for(var e=t.points.values,u=e.length,s=0,h=this.jt,o=NaN,a=NaN,c=NaN,f=NaN,l=0,v=h.length;l<v;l+=2){var b=h[l],d=h[l+1];null!=b&&null!=d&&(s<u?(e[s]=b,e[s+1]=d):e.push(b,d),s+=2,o!=o?(o=b,a=b,c=d,f=d):(o=Math.min(o,b),a=Math.max(a,b),c=Math.min(c,d),f=Math.max(f,d)))}e.length!==s&&(e.length=s),n.mapAll(e,0,s,2,0),r.mapAll(e,0,s,2,1),n.transform.mapAll(e,0,s,2,0),r.transform.mapAll(e,0,s,2,1),o!=o&&(o=0,a=0,c=0,f=0);var g=i.WORK_REGION||{xmin:0,xmax:0,ymin:0,ymax:0};i.WORK_REGION=g,this.adjustLineRegion(o,a,c,f,g),o=n.transform.map(n.map(g.xmin)),a=n.transform.map(n.map(g.xmax)),c=r.transform.map(r.map(g.ymin)),f=r.transform.map(r.map(g.ymax));var m=Math.abs(a-o),w=Math.abs(f-c),p=.5*(o+a),O=.5*(c+f);for(l=0,v=e.length;l<v;l+=2)e[l+0]-=p,e[l+1]-=O;t.disallowUploadedUpdate(),this.applyLine(t,n,r,m,w,p,O,e),t.allowUploadedUpdate()},i.prototype.adjustLineRegion=function(t,n,i,r,e){return e.xmin=t,e.xmax=n,e.ymin=i,e.ymax=r,e},i.prototype.applyLine=function(t,n,i,r,e,u,s,h){t.points.set(h),t.size.set(r,e),t.transform.position.set(u,s)},i.prototype.updateRegion=function(){var t=this.Ol;if(this.wl!==t){this.wl=t;var n=this.jt,i=this.Kf,r=this.Yf;i.clear(),r.clear(),this.calcRegion(n,i,r)}},i.prototype.calcRegion=function(t,n,i){for(var r=0,e=t.length;r<e;r+=2){var u=t[r];null!=u&&n.add(u,u);var s=t[r+1];null!=s&&i.add(s,s)}},i.prototype.destroy=function(){var t=this.pl;return t&&(this.pl=null,t.detach(),t.destroy()),this.jt.length=0,this.Ol=0,this.Dl=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.pl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.pl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,null,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.calcHitPointTestRange=function(t,n,i,r,e,u,s,h,o){for(var a=ab(h,t+i+e,2,0),c=0,f=a-1,l=f<<1;0<=f;f-=1,l-=2)if(h[l]<=t-i){c=f;break}return o[0]=c,o[1]=c!==a?a:Math.min(h.length<<1,a+1),o},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v){var b=v.shape;if(b.containsPointAbs(t,n,i,r,e,u,s,h,o,a,c)){var d=b.transform,g=d.position,m=d.scale;v.x=v.p0x=v.p1x=g.x+m.x*s,v.y=v.p0y=v.p1y=g.y+m.y*h,v.t=l,v.index=f;var w=t-(s+e),p=n-(h+u);return v.distance=Math.sqrt(w*w+p*p),!0}return!1},i.WORK=new t.Point,i}(am),fm=function(t){function n(n){var i=t.call(this,n)||this;return i.El=-1,i.Ml=-1,i.Sl=-1,i.Tl=-1,i.jl=!1!==(n&&n.size&&n.size.auto),i}return _(n,t),n.prototype.bind=function(n,i){return this.El=-1,this.Ml=-1,this.Sl=-1,this.Tl=-1,t.prototype.bind.call(this,n,i),this},n.prototype.initLine=function(n,i,r,e){t.prototype.initLine.call(this,n,i,r,e),this.Qn=r.newPadding(e,i&&i.padding)},n.prototype.newLineOfAny=function(){return new Tf},n.prototype.getSizeDefault=function(){return 1},n.prototype.adjustLineRegion=function(n,i,r,e,u){return t.prototype.adjustLineRegion.call(this,n,i,Math.min(0,r),Math.max(0,e),u)},n.prototype.updateBarCountAndIndex=function(){if(this.Ml<0||this.El<0){var t=0,i=0,r=this.Kc;if(r)for(var e=0,u=r.size();e<u;++e){var s=r.get(e);s===this&&(t=i),s instanceof n&&(i+=1)}return i=Math.max(1,i),this.El=i,this.Ml=t,!0}return!1},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=n.points,c=a.offset,f=a.size,l=this.j,v=this.vn,b=this.Qn;if(l&&v&&b){var d=i.id,g=i.transform.id;if(this.updateBarCountAndIndex()||this.Sl!==d||this.Tl!==g){var m=this.El,w=this.Ml;this.Sl=d,this.Tl=g;var p=i.transform.map(i.map(0)),O=i.transform.map(i.map(l.x)),D=Math.abs(p-O)*(1-b.outer);if(m<=1)c.x=v.x,f.x=D;else{var E=D*(1-b.inner),M=E/m,S=M*(w+.5)+w*((D-E)/(m-1));c.x=v.x+S-.5*D,f.x=M}}}var T=f.y;mt(T)||(T=[]);var j=T.length,N=c.y;mt(N)||(N=[]);for(var I=N.length,C=0,A=r.transform.map(r.map(0))-h,R=0,k=o.length;R<k;R+=2,C+=1){var L=o[R+1]-A,y=Math.abs(L);C<j?T[C]=y:T.push(y);var x=-.5*L;C<I?N[C]=x:N.push(x)}T.length!==C&&(T.length=C),N.length!==C&&(N.length=C),c.y=N,f.y=T,t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n.prototype.calcSizeX=function(t){var n=this.jt;if(2<n.length)for(var i=n.length,r=n[i-2],e=i-4;0<=e;e-=2){var u=n[e];if(null!=r&&null!=u)return Math.abs(r-u);r=u}return t},n.prototype.calcRegion=function(n,i,r){t.prototype.calcRegion.call(this,n,i,r);var e=this.j;if(e){var u=e.x;this.jl&&(u=this.calcSizeX(u),e.x=u);var s=.5*u;i.set(i.from-s,i.to+s)}r.add(0,0)},n}(cm),lm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new df},n}(cm),vm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Of},n}(cm),bm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Tf},n}(cm),dm=function(t){function n(n){var i=t.call(this,n)||this;return i.Nl=0,i}return _(n,t),n.prototype.newLineOfAny=function(){return new Kf},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=this.j,c=this.vn;a&&c&&this.Nl!==a.y&&(this.Nl=a.y,n.points.offset.y=c.y-.2*a.y),t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n}(cm),gm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Gf},n}(dm),mm=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).pl=null,r.zn=t,r.jt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.Ol=0,r.Dl=NaN,r.Il=0,r.Cl=0,r}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.pl;if(!e){var u=t.newStroke(i,null===(r=this.zn)||void 0===r?void 0:r.stroke);this.yo=u,(e=new Vc).stroke.copy(u),e.visible=this.Ff,this.pl=e}return e.attach(t.plotArea.container,i),this.Dl=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.pl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.pl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.jt},set:function(t){this.jt=t,this.Ol+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.Ol+=1,this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.pl;if(n){var i=this.rl,r=i.x,e=i.y;if(r&&e){var u=this.Ol,s=u!==this.Dl,h=i.isDirty(r,e),o=i.isTransformDirty(r,e);if(s||h||o)return this.Dl=u,this.doUpdateLine(n,r,e,s||h),t&&st.update(n),!0}}return!1},i.prototype.doUpdateLine=function(t,n,i,r){if(t.disallowUploadedUpdate(),r){for(var e=t.points.values,u=t.points.segments,s=e.length,h=u.length,o=0,a=0,c=this.jt,f=NaN,l=NaN,v=NaN,b=NaN,d=0,g=c.length;d<g;d+=2){var m=c[d],w=c[d+1];if(null!=m&&null!=w)o<s?(e[o]=m,e[o+1]=w):e.push(m,w),o+=2,f!=f?(f=m,l=m,v=w,b=w):(f=Math.min(f,m),l=Math.max(l,m),v=Math.min(v,w),b=Math.max(b,w));else{var p=(d>>1)-a;a<h?u[a]=p:u.push(p),a+=1}}e.length!==o&&(e.length=o),u.length!==a&&(u.length=a),n.mapAll(e,0,o,2,0),i.mapAll(e,0,o,2,1),f!=f&&(f=0,l=0,v=0,b=0),f=n.map(f),l=n.map(l),v=i.map(v),b=i.map(b);var O=Math.abs(l-f),D=Math.abs(b-v),E=.5*(f+l),M=.5*(v+b);for(d=0,g=e.length;d<g;d+=2)e[d+0]-=E,e[d+1]-=M;t.size.set(O,D),t.points.set(e,u),this.Il=E,this.Cl=M}t.transform.position.set(n.transform.map(this.Il),i.transform.map(this.Cl)),t.transform.scale.set(n.transform.scale,i.transform.scale),t.allowUploadedUpdate()},i.prototype.updateRegion=function(){var t=this.Ol;if(this.wl!==t){this.wl=t;var n=this.jt,i=this.Kf,r=this.Yf;if(i.clear(),r.clear(),null!=n)for(var e=0,u=n.length;e<u;e+=2){var s=n[e];null!=s&&i.add(s,s);var h=n[e+1];null!=h&&r.add(h,h)}}},i.prototype.destroy=function(){var t=this.pl;return t&&(this.pl=null,t.detach(),t.destroy()),this.jt.length=0,this.Ol=0,this.Dl=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.pl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.pl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointTestRange=function(t,n,i,r,e){var u=ab(r,t,2,0);return e[0]=Math.max(0,u-1),e[1]=u,e},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=g+p*f,o.y=m+O*l,o.p0x=g+p*i,o.p0y=m+O*r,o.p1x=g+p*e,o.p1y=m+O*u,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(am),wm=function(){function t(t,n,i,r){this.R=0,this.Al=NaN,this._a=t,this._b=n,this._x0=i,this._y0=r}return Object.defineProperty(t.prototype,"a",{get:function(){return this._a},set:function(t){this._a!==t&&(this.R+=1,this._a=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},set:function(t){this._b!==t&&(this.R+=1,this._b=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x0",{get:function(){return this._x0},set:function(t){this._x0!==t&&(this.R+=1,this._x0=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y0",{get:function(){return this._y0},set:function(t){this._y0!==t&&(this.R+=1,this._y0=t)},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.R+=1},t.prototype.isDirty=function(){return this.R!==this.Al},t.prototype.toClean=function(){this.Al=this.R},t.from=function(n){var i,r,e,u;return new t(null!==(i=null==n?void 0:n.a)&&void 0!==i?i:1,null!==(r=null==n?void 0:n.b)&&void 0!==r?r:1,null!==(e=null==n?void 0:n.x0)&&void 0!==e?e:0,null!==(u=null==n?void 0:n.y0)&&void 0!==u?u:0)},t}(),pm=function(n){function i(t){var i=n.call(this,t)||this;return i.pl=null,i.zn=t,i.Rl=wm.from(t),i}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.pl;if(!e){var u=t.newStroke(i,null===(r=this.zn)||void 0===r?void 0:r.stroke);this.yo=u,(e=new Vc).stroke.copy(u),e.visible=this.Ff,this.pl=e}return e.attach(t.plotArea.container,i),n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.pl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.pl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parameters",{get:function(){return this.Rl},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.Rl.toDirty(),this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.pl,i=this.Kc;if(n&&i){var r=this.rl,e=r.x,u=r.y;if(e&&u)return this.doUpdateLine(n,i,e,u),t&&st.update(n),!0}return!1},i.prototype.doUpdateLine=function(t,n,i,r){var e=t.points.values,u=t.points.segments,s=this.Rl,h=s.a,o=s.b,a=s.x0,c=s.y0,f=Math.abs(h),l=Math.abs(o),v=NaN,b=NaN,d=NaN,g=NaN,m=1e-5,w=n.plotArea.getBoundsInContainer();if(l<=f){var p=i.unmap(i.transform.unmap(w.x)),O=i.unmap(i.transform.unmap(w.x+w.width));v=Math.min(p,O),d=Math.max(p,O);var D=r.unmap(r.transform.unmap(w.y)),E=r.unmap(r.transform.unmap(w.y+w.height));if(b=Math.min(D,E),g=Math.max(D,E),m<l){var M=(N=o/h)*(D-c)+a,S=N*(E-c)+a,T=Math.min(M,S),j=Math.max(M,S);b=(I=1/N)*((v=Math.max(v,T))-a)+o*c,g=I*((d=Math.min(d,j))-a)+o*c}else v=a,d=a}else if(D=r.unmap(r.transform.unmap(w.y)),E=r.unmap(r.transform.unmap(w.y+w.height)),b=Math.min(D,E),g=Math.max(D,E),p=i.unmap(i.transform.unmap(w.x)),O=i.unmap(i.transform.unmap(w.x+w.width)),v=Math.min(p,O),d=Math.max(p,O),m<f){var N,I,C=(N=h/o)*(p-a)+c,A=N*(O-a)+c,R=Math.min(C,A),k=Math.max(C,A);v=(I=1/N)*((b=Math.max(b,R))-c)+h*a,d=I*((g=Math.min(g,k))-c)+h*a}else b=c,g=c;v=i.transform.map(i.map(v)),b=r.transform.map(r.map(b));var L=.5*(v+(d=i.transform.map(i.map(d)))),y=.5*(b+(g=r.transform.map(r.map(g)))),x=Math.abs(d-v),B=Math.abs(g-b);v-=L,b-=y,d-=L,g-=y,4!==e.length?(e.length=0,e.push(v,b,d,g)):(e[0]=v,e[1]=b,e[2]=d,e[3]=g),0<u.length&&(u.length=0),t.disallowUploadedUpdate(),t.points.set(e,u),t.size.set(x,B),t.points.toFitted(),t.transform.position.set(L,y),t.allowUploadedUpdate()},i.prototype.updateRegion=function(){},i.prototype.destroy=function(){var t=this.pl;return t&&(this.pl=null,t.detach(),t.destroy()),n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.pl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.pl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,null,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=o.p0x=o.p1x=g+p*f,o.y=o.p0y=o.p1y=m+O*l,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(am),Om=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n);var r=this.plotArea;this.addChild(r),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:this.theme.isOverflowMaskEnabled())&&(r.axis.container.mask=this.getOverflowMask())},n.prototype.getOverflowMask=function(){return null==this.dr&&(this.dr=new or(this),this.reflowable.add(this.dr),this.toDirty()),this.dr},Object.defineProperty(n.prototype,"plotArea",{get:function(){var t=this.Bf;return null==t&&(t=this.newPlotArea(),this.Bf=t),t},enumerable:!1,configurable:!0}),n.prototype.newPlotArea=function(){var t;return new Qg(this,null===(t=this.zn)||void 0===t?void 0:t.plotArea)},n.prototype.getType=function(){return"DChart"},n.prototype.destroy=function(){var n;this._destroyed||(null===(n=this.Bf)||void 0===n||n.destroy(),t.prototype.destroy.call(this))},n}(hr),Dm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(Ab),Em=function(t){function n(n){var i=t.call(this)||this;return i.Gr=n,i}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return yb.getDocumentController().saveAs(this.Gr),!0},n}(Ab),Mm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return yb.getDocumentController().save(),!0},n}(Ab),Sm=function(t){function n(n,i){var r=t.call(this)||this;r.p=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),n.prototype.createAsUrl=function(t){return null==t||pt(t)?this.create({size:t,extractor:function(t){return gb.base64({target:t})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(t){return gb.base64({target:t})}})},n.prototype.createAsFile=function(t,n){Ot(t)?this.create({extractor:function(n){gb.file({target:n,filename:t})}}):null===t||pt(t)?this.create({size:t,extractor:function(t){gb.file({target:t,filename:n})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(n){gb.file({target:n,filename:t.filename})}})},n.prototype.toScale=function(t,n){return null==t?1:t/st.getResolution(n)/Math.max(n.width,n.height)},n.prototype.toCleanupSnap=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.snap},n.prototype.toCleanupBackground=function(t){if(null==t)return!1;var n=t.cleanup;return null!=n&&!1!==n&&(!0===n||!0===n.background)},n.prototype.toCleanupReflow=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.reflow},n.prototype.create=function(t){var n=this.p,i=n.canvas;if(i){var r=n.view,e=r.position,u=r.scale,s=e.x,h=e.y,o=u.x,a=u.y,c=this.toScale(t.size,i);r.transform(0,0,c,c,0);var f=void 0;if(this.toCleanupSnap(t)&&"snap"in i){var l=i.snap;null!=l&&((f=l.container).renderable?f.renderable=!1:f=void 0)}var v=void 0;if(this.toCleanupBackground(t)&&((v=i.snippet).renderable?v.renderable=!1:v=void 0),this.toCleanupReflow(t)){var b=st.getLayer(i);b&&b.reflow()}this.emit("taking",i,this);var d=t.extractor(i);return this.emit("took",i,null,this),v&&(v.renderable=!0),null!=f&&(f.renderable=!0),r.transform(s,h,o,a,0),d}},n}(t.utils.EventEmitter),Tm=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).kl=null,r.Ll=null==n?void 0:n.tile,r.yl=null==n?void 0:n.controller,r.xl=null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:r.theme.isAmbient(),r.Bl=new Sm(r,null==n?void 0:n.snapshot),r.Fr=r.toMode(n),r}return _(n,t),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.Bl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"controller",{get:function(){return this.yl||null},enumerable:!1,configurable:!0}),n.prototype.set=function(t){var n=this,i=this.kl;if(i!==t){if(i&&(this.kl=null,this.canvas&&(this.canvas=null),this.onUnset()),this.kl=t,t){var r=this.newCanvas(t),e=t.pieces,u=this.Fr,s=Je.toPieceData(this.yl,e,u).then((function(i){return n.newLayer(t,r,u,e,i)}));return this.onSet(t,r),this.canvas=r,s}return Promise.resolve(null)}return Promise.resolve(this.canvas)},n.prototype.onSet=function(t,n){},n.prototype.newLayer=function(t,n,i,r,e){var u=this,s=new Sr(t,r,e,i,0),h=Je.newLayer(t,n.layer,s).then((function(t){return u.initLayer(n,t)}));if(this.xl){var o=this.toCanvasBaseBackgroundOptions(t,this.theme,!1);this.background.color=o.color,this.background.alpha=o.alpha}return h},n.prototype.initLayer=function(t,n,i){return t.layer.init(),t.initialize(n,i),st.update(this),this.emit("ready",this),t},n.prototype.toCanvasBaseOptions=function(t){var n,i=this.theme,r=this.xl;return{name:t.name,width:t.width,height:t.height,background:this.toCanvasBaseBackgroundOptions(t,i,r),border:r?{color:null}:void 0,outline:r?{color:null}:void 0,shadow:r?null:i.getCanvasShadow(),tile:{factory:this.Ll,mapping:null===(n=t.tile)||void 0===n?void 0:n.mapping},ambient:r}},n.prototype.toCanvasBaseBackgroundOptions=function(t,n,i){var r,e;if(i)return{color:null};var u=t.background;return{color:null!==(r=null==u?void 0:u.color)&&void 0!==r?r:n.getCanvasBackgroundColor(),alpha:null!==(e=null==u?void 0:u.alpha)&&void 0!==e?e:n.getCanvasBackgroundAlpha()}},n.prototype.onUnset=function(){},n.prototype.get=function(){return this.kl},Object.defineProperty(n.prototype,"layer",{get:function(){var t=this.canvas;return t?t.layer.active:null},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DDiagramBase"},n}(Dr),jm=function(){function t(t,n){this.ei=t,this.Pr=n}return t.prototype.getTheme=function(){return this.ei.getTheme()},t.prototype.setTheme=function(t){this.ei.setTheme(t)},t.prototype.getBaseColor=function(){return this.Pr},t.prototype.setBaseColor=function(t){this.Pr=t},t.prototype.getColor=function(t){var n=this.ei,i=this.Pr,r=n.getColor(t);return null!=i?null!=r?an.blend(i,r,n.getAlpha(t)):i:r},Object.defineProperty(t.prototype,"color",{get:function(){return this.ei.color},set:function(t){this.ei.color=t},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){return null!=this.Pr?1:this.ei.getAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.ei.alpha},set:function(t){this.ei.alpha=t},enumerable:!1,configurable:!0}),t}(),Nm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),Object.defineProperty(n.prototype,"lon",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lat",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!0}),n.prototype.toObject=function(){return{lon:this.x,lat:this.y}},n}(t.ObservablePoint),Im=function(){function t(t,n,i,r,e,u){if(this._l=t,!0===n||!1===n)this.O=n,this.Bt=new Nm(t,null,i,r),this.Pt=new Nm(t,null,e,u);else if(null!=n){this.O=n.enable;var s=n.from,h=n.to;this.Bt=new Nm(t,null,s.lon,s.lat),this.Pt=new Nm(t,null,h.lon,h.lat)}else this.O=!1,this.Bt=new Nm(t,null,-180,85.05112877980659),this.Pt=new Nm(t,null,180,-85.05112877980659)}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this._l())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{enable:this.O,from:this.Bt.toObject(),to:this.Pt.toObject()}},t}(),Cm=function(){function t(t,n){var i=this;this.vr=t,this.Pl=null==n?void 0:n.factory,this.Jt=new Im((function(){i.onMappingChange()}),null==n?void 0:n.mapping)}return t.prototype.init=function(){this.onMappingChange()},t.prototype.onMappingChange=function(){var t=this.Pl;if(t){var n,i=this.Jt;i.enable?(n=this.Fl)?n.mapping=i:this.Fl=t(this.vr).fit():(n=this.Fl)&&(this.Fl=void 0,n.destroy())}},Object.defineProperty(t.prototype,"pyramid",{get:function(){return this.Fl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"factory",{get:function(){return this.Pl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapping",{get:function(){return this.Jt},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{mapping:this.Jt.serialize()}},t.prototype.destroy=function(){var t=this.Fl;null!=t&&(this.Fl=void 0,t.destroy())},t}(),Am=function(t){function n(n,i){var r=t.call(this)||this;return r.kh=null,r.kt=n,r.pn=i,r.interactive=!1,r.interactiveChildren=!1,r}return _(n,t),n.prototype.init=function(){if(null==this.kh){var t=this.children,n=t.length;0<n&&(this.kh=t[n-1])}},Object.defineProperty(n.prototype,"active",{get:function(){return this.kh},set:function(t){this.kh!==t&&(null==t||0<=this.children.indexOf(t))&&(this.kh=t,this.onLayerChange())},enumerable:!1,configurable:!0}),n.prototype.create=function(t,n){var i=new au(t);return this.attach(i,n),i},n.prototype.attach=function(t,n){this.addChild(t),!0===n&&(this.kh=t),this.onLayerChange(),st.update(this)},n.prototype.attachAt=function(t,n,i){this.addChildAt(t,n),!0===i&&(this.kh=t),this.onLayerChange(),st.update(this)},n.prototype.detach=function(t,n){var i=this.children,r=i.indexOf(t);0<=r&&(this.kh=n,i.splice(r,1),t.parent=void 0,this.onLayerChange(),st.update(this))},n.prototype.delete=function(t,n){var i=this.children,r=i.indexOf(t);return 0<=r&&(i.splice(r,1),t.parent=void 0,this.kh===t&&(!0===n?r<i.length?this.kh=i[r]:0<i.length?this.kh=i[r-1]:this.kh=null:this.kh=null),this.onLayerChange(),st.update(this)),r},n.prototype.get=function(t){var n=this.children[t];return null!=n?n:null},n.prototype.clear=function(){var t=this.children;if(0<t.length){for(var n=t.length-1;0<=n;--n){var i=t[n];i.parent=null,i.destroy()}t.length=0,this.onLayerChange(),st.update(this)}},n.prototype.destroy=function(){this._destroyed||(this.clear(),t.prototype.destroy.call(this))},n.prototype.size=function(){return this.children.length},n.prototype.onLayerChange=function(){this.emit("change",this)},n.prototype.serialize=function(t,n){for(var i=[],r=this.children,e=0,u=r.length;e<u;++e)r[e].addUuid(t);for(e=0,u=r.length;e<u;++e)r[e].updateUuid(t);for(e=0,u=r.length;e<u;++e)i.push(r[e].serialize(e,t,n));return i},n.prototype.deserialize=function(t,n){var i=t.length;if(0<i){for(var r=this.kt,e=this.pn,u=0;u<i;++u)this.addChild(au.deserialize(t[u],n,r,e));this.onLayerChange(),st.update(this)}},n}(t.Container),Rm=function(t){function n(n){var i=t.call(this,n)||this,r=i.theme;i.isAmbient(r,n)||(i.kn=new jm(i.kn,i.toBackgroundBase(r,n)));var e=new Am(i.width,i.height);i.bs=e,i.addChild(e);var u=new Cm(i,null==n?void 0:n.tile);return i.Ul=u,u.init(),i}return _(n,t),n.prototype.isAmbient=function(t,n){var i;return null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:t.isAmbient()},n.prototype.toBackgroundBase=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.background)||void 0===i?void 0:i.base)&&void 0!==r?r:t.getBackgroundBase()},Object.defineProperty(n.prototype,"tile",{get:function(){return this.Ul},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"layer",{get:function(){return this.bs},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,n){},n.prototype.destroy=function(){this._destroyed||(this.onDestroy(),t.prototype.destroy.call(this))},n.prototype.onDestroy=function(){this.Ul.destroy(),this.bs.destroy()},n.prototype.hitTest=function(t,n){for(var i=this.bs.children,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible){var u=e.hitTest(t,n);if(null!=u)return u}}return null},n.prototype.getType=function(){return"DDiagramCanvasBase"},n}(sg),km=function(){function t(t){this.vr=t}return t.prototype.each=function(t,n){for(var i=this.vr.layer.children,r=0,e=i.length;r<e&&!1!==this.Zc(i[r].children,t,n);++r);return this},t.prototype.Zc=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(!1===n(u))return!1;if(i||jr.contains(u,Ct.CHILDREN)){var s=u.children;if(0<s.length&&!1===this.Zc(s,n,i))return!1}}},t}(),Lm=function(){function t(){}return Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Zt;return null==t&&(t=this.newPrivate(),this.Zt=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new Ht},Object.defineProperty(t.prototype,"protected",{get:function(){var t=this.Gl;return null==t&&(t=this.newProtected(),this.Gl=t),t},enumerable:!1,configurable:!0}),t.prototype.newProtected=function(){return new Ht},Object.defineProperty(t.prototype,"extended",{get:function(){var t=this.Hl;return null==t&&(t=this.newExtended(),this.Hl=t),t},enumerable:!1,configurable:!0}),t.prototype.newExtended=function(){return new Ht},Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Xt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Xt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t.prototype.add=function(t,n){var i,r=null!==(i=this.Xt)&&void 0!==i?i:this.Xt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Xt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),void 0!==n&&(c.value=n)}return!0},t.prototype.get=function(t){var n=this.Xt;if(null==n)return null;var i=n.get(t);return null==i?null:i},t.prototype.clear=function(t){var n=this.Xt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].clear();return!0},t.prototype.toDirty=function(t){var n=this.Xt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Xt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.times=i),void 0!==r&&(c.states=r),void 0!==n&&(c.values=n)}return!0},t.prototype.setValue=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].value=n;return!0},t.prototype.setValues=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].values=n;return!0},t.prototype.setTime=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].time=n;return!0},t.prototype.setTimes=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].times=n;return!0},t.prototype.setState=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].state=n;return!0},t.prototype.setStates=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].states=n;return!0},t.prototype.setRange=function(t,n,i){var r=this.Xt;if(null==r)return!1;var e=r.get(t);if(null==e)return!1;var u=e.length;if(u<=0)return!1;for(var s=0;s<u;++s){var h=e[s].range;void 0!==n&&(null!==n?(h.type|=Lt.FROM,h.from=n):h.type&=~Lt.FROM),void 0!==i&&(null!==i?(h.type|=Lt.TO,h.to=i):h.type&=~Lt.TO)}return!0},t}(),ym=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(km),xm=function(){function t(t,n,i){var r=this;this.p=t;var e=i.controller;this.yl=e;var u=function(){r.onChange()};e.grid.on("change",u),e.target.on("change",u);var s=new xe;s.visible=!1,this.Kc=s,t.addChildAt(s,t.children.length-1),this.zl=this.toGrid(n,i.grid),this.ei=this.toTarget(n,i.target)}return t.prototype.toGrid=function(t,n){var i;return{major:this.toGridMajor(t,null==n?void 0:n.major),minor:this.toGridMinor(t,null==n?void 0:n.minor),size:null!==(i=null==n?void 0:n.size)&&void 0!==i?i:t.getSnapGridSize()}},t.prototype.toGridMajor=function(t,n){var i,r,e,u,s;return{interval:null!==(i=null==n?void 0:n.interval)&&void 0!==i?i:t.getSnapGridMajorInterval(),color:null!==(r=null==n?void 0:n.color)&&void 0!==r?r:t.getSnapGridMajorColor(),alpha:null!==(e=null==n?void 0:n.alpha)&&void 0!==e?e:t.getSnapGridMajorAlpha(),width:null!==(u=null==n?void 0:n.width)&&void 0!==u?u:t.getSnapGridMajorWidth(),style:null!==(s=null==n?void 0:n.style)&&void 0!==s?s:t.getSnapGridMajorStyle()}},t.prototype.toGridMinor=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapGridMinorColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapGridMinorAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapGridMinorWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapGridMinorStyle()}},t.prototype.toTarget=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapTargetColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapTargetAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapTargetWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapTargetStyle()}},t.prototype.onChange=function(){var t=this.p;t.toDirty(),st.update(t)},Object.defineProperty(t.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return this.yl.serialize()},t.prototype.onReflow=function(){var t=this.p,n=this.Kc,i=this.yl,r=i.grid.visible,e=i.target.visible;if(r||e){var u=t.width,s=t.height,h=.5*u,o=.5*s,a=it.TOP,c=it.LEFT,f=n.children,l=0;if(r){for(var v=this.zl,b=v.major,d=v.minor,g=b.interval,m=v.size(i.grid.size,u,s),w=m,p=1;w<u;w+=m,p+=1,l+=1){var O=p%g==0?b:d;this.update(n,f,l,w,o,a,u,s,O)}for(var D=m,E=1;D<s;D+=m,E+=1,l+=1)O=E%g==0?b:d,this.update(n,f,l,h,D,c,u,s,O)}if(e)for(var M=i.target.values,S=this.ei,T=0,j=M.length;T<j;T+=1,l+=1){var N=M[T],I=N.position;N.type===Kv.VERTICAL?this.update(n,f,l,I,o,a,u,s,S):this.update(n,f,l,h,I,c,u,s,S)}for(T=l,j=f.length;T<j;++T)f[T].visible=!1;n.visible=!0}else n.visible=!1},t.prototype.update=function(t,n,i,r,e,u,s,h,o){var a=null;i<n.length?((a=n[i]).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate()):((a=new en).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate(),a.attach(t))},t}(),Bm=function(t){function n(n){var i=t.call(this,n)||this;return i.Vl=i.toSnap(i.theme,n.snap),i}return _(n,t),n.prototype.toSnap=function(t,n){return n?new xm(this,t,n):null},Object.defineProperty(n.prototype,"snap",{get:function(){return this.Vl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shape",{get:function(){var t=this.Xr;return null==t&&(t=this.newShape(),this.Xr=t),t},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){return new ym(this)},n.prototype.serialize=function(t,n){var i,r=new Vv,e=[],u=this.kn,s=u.color,h=u.alpha;return{version:1,id:t,name:this.name,width:this.width,height:this.height,background:{color:pt(s)?s:16777215,alpha:pt(h)?h:0},tile:this.Ul.serialize(),resources:r.resources,data:r.data,pieces:r.pieces,layers:this.bs.serialize(r,e),items:e,snap:null===(i=this.Vl)||void 0===i?void 0:i.serialize(),thumbnail:null==n?void 0:n.serialize()}},n.prototype.onReflow=function(){var n;t.prototype.onReflow.call(this),null===(n=this.Vl)||void 0===n||n.onReflow()},n.prototype.getType=function(){return"DDiagramCanvasEditor"},n}(Rm),_m=function(t){function n(n){var i=t.call(this,n)||this;return i.Xt=new Map,i}return _(n,t),n.prototype.add=function(t,n){var i=this.Xt,r=i.get(t);null==r?i.set(t,[n]):r.push(n)},n.prototype.get=function(t){var n=this.Xt.get(t);return n&&0<n.length?n[0]:null},n.prototype.getAll=function(t){return this.Xt.get(t)||[]},n}(km),Pm=function(){function t(t,n){var i=this;this.p=t,this.k=[],this.Z=n,this.q=function(){i.onTime()}}return t.prototype.add=function(t){this.k.push(t)},t.prototype.start=function(){null==this.$&&this.onTime()},t.prototype.getInterval=function(){var t=Date.now(),n=this.Z;return Math.max(0,n-t%n)},t.prototype.onTime=function(){var t=this.k;if(0<t.length){for(var n=Date.now()/this.Z,i=0,r=t.length;i<r;++i)t[i].value=n;st.update(this.p)}this.$=window.setTimeout(this.q,this.getInterval())},t.prototype.stop=function(){var t=this.$;null!=t&&(clearTimeout(t),this.$=void 0)},t}(),Fm=function(){function t(t){this.p=t,this.Xt=new Map}return t.prototype.add=function(t){var n=this.Xt,i=this.toNormalized(t),r=n.get(i);if(null!=r)return r;var e=new Pm(this.p,i);return n.set(i,e),e},t.prototype.toNormalized=function(t){return pt(t)?Math.max(1,Math.round(t)):1e3},t.prototype.start=function(){this.Xt.forEach((function(t){t.start()}))},t.prototype.stop=function(){this.Xt.forEach((function(t){t.stop()}))},t}(),Um="[]",Gm=function(){return 0},Hm=function(){return[]},zm=function(){return""},Vm=function(){return{}},Wm=function(){return!1},Xm=function(n){function i(t){var i=n.call(this,t)||this;return i.Xt=new Lm,i.Xr=new _m(i),i.et=new Fm(i),i.Wl=[],i.Xl=new Set,i.Da=function(){st.update(i)},i}return _(i,n),Object.defineProperty(i.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"shape",{get:function(){return this.Xr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ticker",{get:function(){return this.et},enumerable:!1,configurable:!0}),i.prototype.initialize=function(t,n){var i=this,r=this.Wl,e=this.Xt;this.Kl(t,null,null,n,new Map,new Map,new Map,this.et,this.Xr,e,r);for(var u=this.bs.children,s=u.length,h=0;h<s;++h)u[h].initialize(r);ln.isInitializing=!0;var o=Date.now();for(h=0;h<s;++h)u[h].update(o);ln.isInitializing=!1,e.extended.each((function(t){var n=Uv.getById(t);if(n){var r=n.start;r&&r(i)}})),this.et.start()},i.prototype.Kl=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=function(f,v){var b=t[f],d=b.id;0<d.length&&o.add(d,b),l.initData(b,n,i,r,e,u,h,a);var g=new(To[b.type]||su)(b);b.runtime=g,l.initActions(b,g,s),g.initialize(b);var m=b.shortcut;null!=m&&nr.on(b,m,(function(t){g.onClick(b,t)})),g.isActionable()&&c.push(b);var w=b.children;if(0<w.length){var p=n,O=i;b instanceof Br&&(null==p&&(p=b),O=b),l.Kl(w,p,O,r,e,u,s,h,o,a,c)}},l=this,v=0,b=t.length;v<b;++v)f(v)},i.prototype.initData=function(t,n,i,r,e,u,s,h){for(var o=t.data,a=0,c=o.size();a<c;++a){var f=o.get(a);if(null!=f)switch(f.type){case Bt.BOOLEAN:case Bt.BOOLEAN_ARRAY:case Bt.NUMBER:case Bt.NUMBER_ARRAY:case Bt.STRING:case Bt.STRING_ARRAY:case Bt.OBJECT:case Bt.OBJECT_ARRAY:this.initDataValue(f,t,n,i,r,e,u,h);break;case Bt.TICKER:this.initDataTicker(f,u,s);break;default:this.initDataExtension(f,h)}}},i.prototype.initDataValue=function(t,n,i,r,e,u,s,h){if(t.scope===_t.PRIVATE)0<(o=t.id).length&&(r?r.data.private.add(o,t):h.private.add(o,t));else if(t.scope===_t.PROTECTED)0<(o=t.id).length&&h.protected.add(o,t);else{var o;e&&e(t,i||n),0<(o=t.id).length&&h.add(o,t)}var a=t.format,c=t.initial,f=u.get(t.type);null==f&&(f=new Map,u.set(t.type,f));var l=f.get(a);if(null!=l)t.formatter=l;else if(0<a.length){var v=this.calcFormatter(t,a,c);f.set(a,v),t.formatter=v}var b=s.get(t.type);null==b&&(b=new Map,s.set(t.type,b));var d=b.get(c);if(null!=d)t.value=d();else{var g=this.calcInitial(t,c);b.set(c,g),t.value=g()}},i.prototype.initDataTicker=function(t,n,i){var r=t.initial,e=n.get(t.type);null==e&&(e=new Map,n.set(t.type,e));var u=e.get(r);if(void 0!==u)t.value=0,i.add(u()).add(t);else{var s=this.calcInitial(t,r);e.set(r,s),t.value=0,i.add(s()).add(t)}},i.prototype.initDataExtension=function(t,n){var i=Uv.get(t.type);i&&(n.extended.add(i.id,t),t.value=i.initial)},i.prototype.initActions=function(t,n,i){var r=t.action.values,e=n.actions,u=Rv.get(t.type);if(null!=u)for(var s=0,h=u.length;s<h;++s){var o=u[s];e.push(o),n.reset|=o.reset}for(s=0,h=r.length;s<h;++s){var a=r[s],c=i.get(a);null==c?null!=(c=a.toRuntime())&&(i.set(a,c),e.push(c),n.reset|=c.reset):(e.push(c),n.reset|=c.reset)}},i.prototype.calcFormatter=function(t,n,i){var r=this.toInitial(t);try{return Function("value","try {"+"return (".concat(n,");")+"} catch( e1 ) {try {"+"return (".concat(0<i.length?i:r,");")+"} catch( e2 ) {"+"return ".concat(r,";")+"}}")}catch(n){return this.toInitializer(t)}},i.prototype.calcInitial=function(t,n){if(n.length<=0)return this.toInitializer(t);try{return Function("try {"+"return (".concat(n,");")+"} catch( e ) {"+"return ".concat(this.toInitial(t),";")+"}")}catch(n){return this.toInitializer(t)}},i.prototype.toInitial=function(t){switch(t.type){case Bt.BOOLEAN:return"false";case Bt.BOOLEAN_ARRAY:return Um;case Bt.NUMBER:return"0";case Bt.NUMBER_ARRAY:return Um;case Bt.STRING:return'""';case Bt.STRING_ARRAY:return Um;case Bt.OBJECT:return"{}";case Bt.OBJECT_ARRAY:return Um;case Bt.TICKER:default:return"0"}},i.prototype.toInitializer=function(t){switch(t.type){case Bt.BOOLEAN:return Wm;case Bt.BOOLEAN_ARRAY:return Hm;case Bt.NUMBER:return Gm;case Bt.NUMBER_ARRAY:return Hm;case Bt.STRING:return zm;case Bt.STRING_ARRAY:return Hm;case Bt.OBJECT:return Vm;case Bt.OBJECT_ARRAY:return Hm;case Bt.TICKER:default:return Gm}},i.prototype.onDestroy=function(){var t=this;this.Xt.extended.each((function(n){var i=Uv.getById(n);if(i){var r=i.stop;r&&r(t)}})),this.et.stop(),n.prototype.onDestroy.call(this)},i.prototype.hitTestInteractives=function(t){for(var n=this.bs.children,i=n.length-1;0<=i;--i){var r=n[i];if(r.visible){var e=r.hitTestInteractives(t);if(null!=e)return e}}return null},i.prototype.onShapeMove=function(t){var n=this.hitTestInteractives(t.data.global);this.cursor=this.ii=this.toShapeCursor(n);var i=st.getLayer(this);if(i){var r=this.toShapeTitle(n),e=i.view;e.title!==r&&(e.title=r)}var u=this.Yl;if(this.Yl=n,n===u){if(null!=n){var s=n.runtime;s&&s.onMove(n,t)}}else this.onShapeOut(t,u,n),this.onShapeOver(t,n);return null!=n},i.prototype.toShapeCursor=function(t){if(null!=t)for(var n=t;;){var i=n.cursor;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof Rt))break;n=r}return"auto"},i.prototype.toShapeTitle=function(t){if(null!=t)for(var n=t;;){var i=n.title;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof Rt))break;n=r}return""},i.prototype.onShapeOut=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Rt;){var r=n.runtime;r&&r.onOut(n,t),n=n.parent}},i.prototype.onShapeOver=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Rt;){var r=n.runtime;r&&r.onOver(n,t),n=n.parent}},i.prototype.onShapeDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Jl=n,n){this.Xl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onDown(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeUp=function(t){var n=this.Xl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onUp(r,t);var u=r.parent;if(!(u instanceof Rt))break;r=u}}return this.onShapeCancel(t),null!=i},i.prototype.onShapeCancel=function(t){var n=this.Xl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onUpOutside(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}})),n.clear(),!0)},i.prototype.onShapeClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Jl===n){for(var i=n;;){var r=i.runtime;r&&r.onClick(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeDblClick=function(n,r){var e,u=null!==(e=i.WORK_DBLCLICK)&&void 0!==e?e:i.WORK_DBLCLICK=new t.Point;ir.toGlobal(n,r,u);var s=this.hitTestInteractives(u);if(s){for(var h=s;;){var o=h.runtime;o&&o.onDblClick(h,n,r);var a=h.parent;if(!(a instanceof Rt))break;h=a}return!0}return!1},i.prototype.onShapeRightClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Jl===n){for(var i=n;;){var r=i.runtime;r&&r.onRightClick(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeRightDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Jl=n,n){this.Xl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onRightDown(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeRightUp=function(t){var n=this.Xl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onRightUp(r,t);var u=r.parent;if(!(u instanceof Rt))break;r=u}}return this.onShapeRightCancel(t),null!=i},i.prototype.onShapeRightCancel=function(t){var n=this.Xl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onRightUpOutside(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}})),n.clear(),!0)},i.prototype.update=function(){var t=this.Wl;if(0<t.length){for(var n=-1,i=Date.now(),r=0,e=t.length;r<e;++r){var u=t[r];u.update(i);var s=u.runtime;if(s){var h=s.effect;i<h&&(n=n<0?h:Math.min(n,h))}}0<=n&&window.setTimeout(this.Da,n-Date.now())}},i.prototype.onRender=function(t){var n=this.Wl;if(0<n.length){for(var i=-1,r=Date.now(),e=0,u=n.length;e<u;++e){var s=n[e];s.onRender(r,t);var h=s.runtime;if(h){var o=h.effect;r<o&&(i=i<0?o:Math.min(i,o))}}0<=i&&window.setTimeout(this.Da,i-Date.now())}},i.prototype.getType=function(){return"DDiagramCanvas"},i}(Rm),Km=function(){function t(t){this.Zl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return null!=t?t.data.private.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.private.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.private.toDirty(t)},t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.private.each(t):null},t}(),Ym=function(){function t(t){this.Zl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return null!=t?t.data.protected.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.protected.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.protected.toDirty(t)},t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.protected.each(t):null},t}(),Jm=function(){function t(t){this.yl=t&&t.controller}return t.prototype.set=function(t,n){var i=this.yl;return!!i&&(i.write(t,n),!0)},t}(),Zm=function(){function t(t){this.Zl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return null!=t?t.data.extended.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.extended.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.extended.toDirty(t)},t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.extended.each(t):null},t}(),qm=function(){function t(t,n){this.Zl=t,this.ql=n&&n.mapper||null,this.Ql=new Jm(n&&n.remote),this.Zt=new Km(t),this.Gl=new Ym(t),this.Hl=new Zm(t)}return t.prototype.update=function(){},Object.defineProperty(t.prototype,"mapper",{get:function(){return this.ql},set:function(t){this.ql=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remote",{get:function(){return this.Ql},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"private",{get:function(){return this.Zt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protected",{get:function(){return this.Gl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extended",{get:function(){return this.Hl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return t?t.data.ids:[]},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.each(t):null},t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.set(t,n,i,r,e,u)},t.prototype.get=function(t){var n=this.Zl.canvas;return null!=n?n.data.get(t):null},t.prototype.clear=function(t){var n=this.Zl.canvas;return null!=n&&n.data.clear(t)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.toDirty(t)},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.setAll(t,n,i,r,e,u)},t.prototype.setValue=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setValue(t,n)},t.prototype.setValues=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setValues(t,n)},t.prototype.setTime=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setTime(t,n)},t.prototype.setTimes=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setTimes(t,n)},t.prototype.setState=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setState(t,n)},t.prototype.setStates=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setStates(t,n)},t.prototype.setRange=function(t,n,i){var r=this.Zl.canvas;return null!=r&&r.data.setRange(t,n,i)},t}(),Qm=function(){function t(t,n,i){this.Bl=t,this.vs=this.toIsEnabled(n,i),this.zn=this.toCreateAsUrlOptions(n,i)}return t.prototype.toIsEnabled=function(t,n){var i;return null!==(i=null==n?void 0:n.enable)&&void 0!==i?i:t.isThumbnailEnabled()},t.prototype.toSize=function(t,n){return void 0!==n?n:t.getThumbnailSize()},t.prototype.toCleanup=function(t,n){var i,r;return null==n||!0===n?{snap:!0,background:!0}:!1===n?{snap:!1,background:!1}:{snap:null===(i=n.snap)||void 0===i||i,background:null===(r=n.background)||void 0===r||r}},t.prototype.toCreateAsUrlOptions=function(t,n){return{size:this.toSize(t,null==n?void 0:n.size),cleanup:this.toCleanup(t,null==n?void 0:n.cleanup)}},Object.defineProperty(t.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.zn.size},set:function(t){this.zn.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cleanup",{get:function(){return this.zn.cleanup},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){if(this.vs)return this.Bl.createAsUrl(this.zn)},t}(),$m=function(t){function n(n){var i=t.call(this,n)||this;i.Kt=!1,i.Kt=!1,yb.getCommandController().on("dirty",(function(){!0!==i.Kt&&(i.Kt=!0,i.emit("change",i))}));var r=i.theme;return i.$l=new Qv(i,r,null==n?void 0:n.snapper),i.tv=new Qm(i.Bl,r,null==n?void 0:n.thumbnail),i}return _(n,t),Object.defineProperty(n.prototype,"thumbnail",{get:function(){return this.tv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"snapper",{get:function(){return this.$l},enumerable:!1,configurable:!0}),n.prototype.toMode=function(t){return(null==t?void 0:t.mapping)?Tr.EDITOR_DATA_MAPPED:Tr.EDITOR},n.prototype.newCanvas=function(t){return new Bm(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){var n=this.toCanvasBaseOptions(t),i=this.$l,r=n.snap;return null==r?n.snap={controller:i}:null==r.controller&&(r.controller=i),n},n.prototype.serialize=function(){var t=this.canvas,n=this.kl;if(null!=t&&null!=n){this.emit("serializing",t,this);try{var i=t.serialize(n.id,this.tv);return this.emit("serialized",t,null,this),i}catch(n){return this.emit("serialized",t,"exception",this),null}}return null},n.prototype.save=function(){var t=this,n=this.serialize();if(null!=n){var i=this.yl;if(i){var r=Je.toSimple(n);return this.emit("saving",r,this),i.save(r).then((function(i){t.Kt=!1,n.id=i,t.kl=n,t.emit("change",t),t.emit("saved",null,t)}),(function(n){t.emit("saved",n,t)}))}return this.emit("saved","no-controller",this),Promise.reject()}return this.emit("saved",null,this),Promise.resolve()},n.prototype.saveAs=function(t){var n=this,i=this.serialize();if(null!=i){var r=this.yl;if(r){i.id=void 0,i.name=t;var e=Je.toSimple(i);return this.emit("saving",e,this),r.save(e).then((function(r){n.Kt=!1,i.id=r,n.kl=i;var e=n.canvas;null!=e&&(e.name=t),n.emit("change",n),n.emit("saved",null,n)}),(function(t){n.emit("saved",t,n)}))}return this.emit("saved","no-controller",this),Promise.reject("no-controller")}return this.emit("saved",null,this),Promise.resolve()},n.prototype.delete=function(){var t=this,n=this.kl;if(n&&null!=n.id){var i=this.yl;return i?(this.emit("deleting",this),i.delete(n.id).then((function(){var n=t.set(null);return t.emit("deleted",null,t),n}),(function(n){return t.emit("deleted",n,t),Promise.reject(n)}))):(this.emit("deleted","no-controller",this),Promise.reject("no-controller"))}return this.set(null),this.emit("deleted",null,this),Promise.resolve(null)},n.prototype.create=function(t,n,i){return this.set({version:1,id:void 0,name:t,width:n,height:i,resources:[],data:[],layers:[["Default layer"]],items:[],snap:void 0})},n.prototype.onSet=function(n,i){t.prototype.onSet.call(this,n,i);var r=n.snap,e=this.$l;null!=r?e.deserialize(r):e.reset(),this.xl&&(e.target.visible=!1,e.grid.visible=!1),this.Kt=!1,this.emit("change",this)},n.prototype.onUnset=function(){t.prototype.onUnset.call(this),this.Kt=!1,this.emit("change",this)},n.prototype.open=function(t){var n=this,i=this.yl;return i?(this.emit("opening",this),i.get(t).then((function(t){var i=n.set(Je.toSerialized(t));return n.emit("opened",null,n),i}),(function(t){return n.emit("opened",t,n),Promise.reject(t)}))):(this.emit("opened","no-controller",this),Promise.reject("no-controller"))},n.prototype.close=function(){return this.set(null)},n.prototype.isChanged=function(){return this.Kt||this.isNew()},n.prototype.isNew=function(){var t=this.kl;return null!=t&&null==t.id},n.prototype.getName=function(){var t=this.kl;return null!=t?t.name:null},n.prototype.getType=function(){return"DDiagramEditor"},n}(Tm),tw=function(t){function n(n){var i=t.call(this)||this;return i.Zl=n,i.Da=function(){st.update(n)},i}return _(n,t),n.prototype.update=function(){var t=this.Zl.canvas;t&&t.update()},n.prototype.onRender=function(t){var n=this.Zl.canvas;n&&n.onRender(t)},n.prototype.get=function(t){var n=this.Zl.canvas;return n?n.shape.get(t):null},n.prototype.getAll=function(t){var n=this.Zl.canvas;return n?n.shape.getAll(t):[]},n.prototype.each=function(t,n){void 0===n&&(n=!1);var i=this.Zl.canvas;if(null!=i){var r=i.layer.children;if(n){for(e=r.length-1;0<=e;--e)for(h=(s=r[e].children).length-1;0<=h;--h)if(!1===t(a=s[h]))return a}else for(var e=0,u=r.length;e<u;++e)for(var s,h=0,o=(s=r[e].children).length;h<o;++h){var a;if(!1===t(a=s[h]))return a}}return null},n}(t.utils.EventEmitter),nw=function(t){function n(n){var i=t.call(this,n)||this;i.on(ir.move,(function(t){i.onShapeMove(t)})),i.on(ir.up,(function(t){i.onShapeUp(t)})),i.on(ir.upoutside,(function(t){i.onShapeCancel(t)})),i.on(ir.cancel,(function(t){i.onShapeCancel(t)})),i.on(ir.tap,(function(t){i.onShapeClick(t)})),i.on(ir.righttap,(function(t){i.onShapeRightClick(t)})),i.on(ir.rightdown,(function(t){i.onShapeRightDown(t)})),i.on(ir.rightup,(function(t){i.onShapeRightUp(t)})),i.on(ir.rightupoutside,(function(t){i.onShapeRightCancel(t)}));var r=new qm(i,n&&(n.data||n.tag));return i.data=r,i.tag=r,i.shape=new tw(i),i}return _(n,t),n.prototype.initLayer=function(n,i,r){return t.prototype.initLayer.call(this,n,i,r||this.data.mapper)},n.prototype.toMode=function(t){return Tr.VIEWER},n.prototype.newCanvas=function(t){return new Xm(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){return this.toCanvasBaseOptions(t)},n.prototype.onDown=function(n){var i=this.canvas;i?t.prototype.onDown.call(this,n,i.onShapeDown(n)):t.prototype.onDown.call(this,n)},n.prototype.onShapeMove=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeMove(t)}},n.prototype.onShapeUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeUp(t)}},n.prototype.onShapeCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeCancel(t)}},n.prototype.onShapeClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeClick(t)}},n.prototype.onShapeRightClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightClick(t)}},n.prototype.onShapeRightDown=function(t){var n=this.canvas;n&&n.onShapeRightDown(t)},n.prototype.onShapeRightUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightUp(t)}},n.prototype.onShapeRightCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightCancel(t)}},n.prototype.onDblClick=function(n,i){var r=this.canvas;return r?t.prototype.onDblClick.call(this,n,i,r.onShapeDblClick(n,i)):t.prototype.onDblClick.call(this,n,i)},n.prototype.render=function(n){this.shape.onRender(n),t.prototype.render.call(this,n)},n.prototype.getType=function(){return"DDiagram"},n}(Tm),iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmMessage"},n}(Nl),rw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.message),r},n.prototype.toMessage=function(t,n){var i=null==n?void 0:n.message;return null!=i?Ot(i)||wt(i)?this.newMessage(this.toMessageOptions(i)):i instanceof hr?i:this.newMessage(this.toMessageOptionsMerged(i,t.getMessage())):this.newMessage(this.toMessageOptions(t.getMessage()))},n.prototype.toMessageOptionsMerged=function(t,n){var i=t.text;return null==i&&(i={},t.text=i),void 0===i.value&&(i.value=n),t},n.prototype.toMessageOptions=function(t){return{text:{value:t}}},n.prototype.newMessage=function(t){return new iw(t)},Object.defineProperty(n.prototype,"message",{get:function(){var t=this.nv;return null==t&&(t=this.toMessage(this.theme,this.zn),this.nv=t),t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){},n.prototype.getType=function(){return"DDialogConfirm"},n}(xs),ew=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDelete"},n}(rw),uw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDiscard"},n}(rw),sw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogMessage"},n}(rw),hw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogProcessingMessage"},n}(iw),ow=function(t){function n(n){var i,r=this;(r=t.call(this,n)||this).iv=!0,r.si=0;var e=null==n?void 0:n.delay;r.rv=null!==(i=null==e?void 0:e.done)&&void 0!==i?i:r.theme.getDoneDelay();var u=null==e?void 0:e.close;return r.ev=void 0!==u?u:r.theme.getCloseDelay(),r.uv=r.message.text,r}return _(n,t),n.prototype.newMessage=function(t){return new hw(t)},n.prototype.onOpen=function(){this.iv=!1,this.si=Date.now();var n=this.$;null!=n&&clearTimeout(n);var i=this.sv;null!=i&&clearTimeout(i);var r=this.message;r.text=this.uv,r.state.removeAll(ct.SUCCEEDED,ct.FAILED);var e=this.Ih;null!=e&&e.hide(),t.prototype.onOpen.call(this)},n.prototype.onDone=function(t){var n=this;null!=t?this.sv=window.setTimeout((function(){n.close()}),t):this.close()},n.prototype.onResolved=function(t){null!=t&&(this.message.text=t),this.message.state.set(ct.SUCCEEDED,ct.FAILED);var n=this.ev;if(null!=n)this.onDone(n);else{var i=this.Ih;null!=i?i.show():this.close()}},n.prototype.onRejected=function(t){null!=t&&(this.message.text=t),this.message.state.set(ct.FAILED,ct.SUCCEEDED);var n=this.Ih;null!=n?n.show():this.onDone(this.ev)},n.prototype.resolve=function(t){var n=this;if(!this.iv){this.iv=!0;var i=Date.now()-this.si,r=this.rv-i;0<r?this.$=window.setTimeout((function(){n.$=void 0,n.onResolved(t)}),r):this.onResolved(t)}},n.prototype.reject=function(t){var n=this;if(!this.iv){this.iv=!0;var i=Date.now()-this.si,r=this.rv-i;0<r?this.$=window.setTimeout((function(){n.$=void 0,n.onRejected(t)}),r):this.onRejected(t)}},n.prototype.onCloseOn=function(){this.iv&&t.prototype.onCloseOn.call(this)},n.prototype.getType=function(){return"DDialogProcessing"},n}(rw),aw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(){var n=yb.getDocumentController().getName();null!=n&&(this.input.value=n),t.prototype.onOpen.call(this)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=yb.getCommandController();Ot(n)?i.push(new Em(n)):n.then((function(t){i.push(new Em(t))}))},n.prototype.getType=function(){return"DDialogSaveAs"},n}(nh),cw=function(){function t(t){this.hv=t,this.ov=[]}return t.prototype.indexOf=function(t){return this.ov.indexOf(t)},t.prototype.close=function(t){for(var n=this.ov,i=Math.max(0,t),r=n.length-1;i<=r;--r)n[r].close()},t.prototype.add=function(t){this.ov.push(t)},t.prototype.trim=function(t){this.close(this.indexOf(t)+1)},t.prototype.remove=function(t){var n=this.indexOf(t);0<=n&&(this.close(n+1),this.ov.splice(n,1))},t}(),fw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u=this;t.prototype.init.call(this,n),this.ws=function(){u.onPrerender()},this.Lt=Ai(null!==(i=null==n?void 0:n.align)&&void 0!==i?i:Bu.BOTTOM,Bu),this.av=null!==(r=null==n?void 0:n.fit)&&void 0!==r&&r,this.ps=null!==(e=null==n?void 0:n.sticky)&&void 0!==e&&e,this.cv=!1,this.hv=null,this.ea=null,this.visible=!1,zu.apply(this,(function(){u.close()})),this.on("select",(function(){u.close()}));var s=null==n?void 0:n.items;s&&yl.newItems(this,s,this.ps),this.Ds=new Vu(n)},n.prototype.findItem=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof Cl&&e.value===t)return e}return null},n.prototype.getType=function(){return"DMenu"},n.prototype.getContext=function(){return this.ea},n.prototype.getCloseable=function(){return this},n.prototype.open=function(n,i,r){if(this.isHidden()){var e=this.Ds.pick(this);this.hv=n;for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof hr&&o.state.removeAll(ct.FOCUSED,ct.HOVERED)}var a=e.renderer,c=this.ws;if(this.ps?a.on("prerender",c):a.once("prerender",c),this.av){var f=n.getBounds();null!=f&&(this.width=f.width)}this.cv=null!=r,r=r||new cw(n),null!=i&&r.trim(i),r.add(this),this.ea=r,e.stage.addChild(this),this.Es=e.getFocusController().get(),this.focus(),t.prototype.show.call(this),this.emit("open",this)}return this},n.prototype.onPrerender=function(){var t=this.hv;if(t){var n=t.getBounds();if(n){this.av&&(this.width=n.width);var i=this.Ds.picked;if(i){var r=this.theme;_u.attach(this,n,r.getOffsetX(),r.getOffsetY(),i.width,i.height,this.Lt)}}}},n.prototype.close=function(){if(this.isShown()){var n=this.ea;n&&n.remove(this);var i=this.Ds.picked;i&&i.renderer.off("prerender",this.ws),this.hv=null;var r=this.Es;if(null!=r)if(this.Es=null,i){var e=st.getLayer(r);null!=e&&i!==e&&e.view.focus(),i.getFocusController().focus(r)}else this.blur(!0);else this.blur(!0);t.prototype.hide.call(this);var u=this.parent;u&&u.removeChild(this),this.emit("close",this)}return this},n.prototype.onKeyDown=function(n){return nr.moveFocusVertically(n,this,this.Ds),this.state.isActionable&&(nr.isArrowLeftKey(n)||nr.isCancelKey(n))&&this.close(),t.prototype.onKeyDown.call(this,n)},n.prototype.containsGlobalPoint=function(t){return!this.cv},n}(Zu);yl.setMenuCreator((function(t){return new fw(t)}));var lw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this)},n.prototype.onMenuClose=function(t){if(t){var n=this.fv;n&&t.off("select",n);var i=this.lv;i&&t.off("close",i)}},n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof fw?i:new fw(this.toMenuOptions(t,i))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!0),n):{fit:!0}},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this.Po;return null==t&&(t=this.toMenu(this.theme,this.zn),this.Po=t),t},set:function(t){var n=this.Po;n!=t&&(this.Po=t,this.onMenuReplaced(t,n))},enumerable:!1,configurable:!0}),n.prototype.onMenuReplaced=function(t,n){null!=n&&this.onMenuClose(n)},n.prototype.getType=function(){return"DDropdownBase"},n.prototype.onKeyDown=function(n){return nr.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){var t=this,n=this.menu;if(n.isHidden()){var i=this.fv;null==i&&(i=function(n,i,r){t.onMenuSelect(n,i,r)},this.fv=i);var r=this.lv;null==r&&(r=function(){t.onMenuClose(t.Po)}),n.on("select",i),n.on("close",r),n.open(this),this.emit("open",n,this)}},n.prototype.close=function(){this.menu.close()},n}(js),vw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDropdown"},n}(lw),bw=function(t){function n(n){var i=t.call(this,n)||this;return i.on(ir.down,(function(t){i.state.isActionable&&i.onSelect(t)})),i}return _(n,t),n.prototype.onSelect=function(t){this.emit("select",this)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},n.prototype.getType=function(){return"DExpandableHeader"},n}(Nl),dw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i=this;n.prototype.init.call(this,t);var r=this.theme,e=this.toHeader(r,t);this.jh=e,e.on("select",(function(){i.toggle()})),this.addChild(e);var u=this.toBody(r,t);this.Ie=u,this.addChild(u),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.toHeader=function(n,i){return i&&i.header?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new bw(n)},i.prototype.toBody=function(t,n){return n.body},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.Ie;t instanceof hr?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.Ie;t instanceof hr?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.getType=function(){return"DExpandable"},i}(Zu),gw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new Ys(t)},n}(Xb),mw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Ob(this,this.newOperation(),this.theme,this.zn)},n.prototype.getType=function(){return"DInputTextArea"},n}(Ws),ww=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DListItemAmbient"},n}(pd),pw=function(){function t(t){void 0===t&&(t=256),this.vv=t}return t.prototype.getTileSize=function(){return this.vv},t.prototype.lonLatToMeters=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x*r/180,i.y=Math.log(Math.tan((90+n.y)*Math.PI/360))*r/Math.PI,i},t.prototype.metersToLonLat=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x/r*180,i.y=360*Math.atan(Math.exp(n.y*Math.PI/r))/Math.PI-90,i},t.prototype.pixelsToMeters=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=n.x*u-s,e.y=s-n.y*u,e},t.prototype.metersToPixels=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=(n.x+s)/u,e.y=(s-n.y)/u,e},t.prototype.pixelsToTile=function(t,n,i){return i.x=Math.ceil(t.x/n)-1,i.y=Math.ceil(t.y/n)-1,i},t.prototype.metersToTile=function(n,i,r){var e=t.CIRCUMFERENCE_HALF,u=1<<i;return r.x=Math.ceil(.5*(n.x/e+1)*u)-1,r.y=Math.ceil(.5*(1-n.y/e)*u)-1,r},t.prototype.lonLatToTile=function(t,n,i){return this.metersToTile(this.lonLatToMeters(t,i),n,i)},t.prototype.lonLatToPixels=function(t,n,i,r){return this.metersToPixels(this.lonLatToMeters(t,r),n,i,r)},t.prototype.pixelsToLonLat=function(t,n,i,r){return this.metersToLonLat(this.pixelsToMeters(t,n,i,r),r)},t.prototype.tileToPixels=function(t,n,i){return i.x=t.x*n,i.y=t.y*n,i},t.prototype.tileToMeters=function(n,i,r){var e=this.toResolutionMeter(i),u=t.CIRCUMFERENCE_HALF;return r.x=n.x*e+u,r.y=u-n.y*e,r},t.prototype.toResolutionMeter=function(n){return 2*t.CIRCUMFERENCE_HALF/(1<<n)},t.prototype.toResolution=function(n,i){return 2*t.CIRCUMFERENCE_HALF/(i<<n)},t.prototype.toTileCount=function(t){return 1<<t},t.prototype.toTileCode=function(t,n,i){return(n<<t)+i},t.CIRCUMFERENCE_HALF=6378137*Math.PI,t}(),Ow=function(){function t(){}return Object.defineProperty(t,"DEFAULT",{get:function(){return null==this.Wr&&(this.Wr=new pw),this.Wr},enumerable:!1,configurable:!0}),t}(),Dw=function(){function n(n,i,r,e,u,s){this.tx=i,this.ty=r;var h=new t.Sprite(t.Texture.EMPTY);h.parent=n,h.position.set(e,u),h.scale.set(s,s),this.bv=h}return n.prototype.load=function(n,i){var r=t.Texture.from(n,{resolution:1});this.bv.texture=r,r.valid?i():r.on("update",i)},n.prototype.transform=function(t,n,i){var r=this.bv;r.position.set(t,n),r.scale.set(i,i)},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.bv.texture.valid},enumerable:!1,configurable:!0}),n.prototype.render=function(t){var n=this.bv;n.updateTransform(),n.render(t)},n.prototype.destroy=function(){var n=this.bv,i=n.texture,r=i.baseTexture.resource,e=null;r instanceof t.resources.BaseImageResource&&r.source instanceof HTMLImageElement&&(e=r.source),i.destroy(!0),n.destroy(),e&&(e.src="")},n}(),Ew=function(){function n(t,n,i,r,e,u){var s=this;this.p=t,this.uu=n,this.dv=u,this.gv=!1,this.mv=!0,this.wv=function(){s.onLoaded()},this.pv=i,this._lon0=NaN,this._lat0=NaN,this._lon1=NaN,this._lat1=NaN,this.Ov=new Map,this.Dv=function(t){s.renderTile(t)},this.Ev=NaN,this.Mv=NaN,this.Sv=NaN,this.Tv=NaN,this.jv=function(t,n,i){s.deleteTile(t,n,i)},this.Nv=function(t){s.destroyTile(t)},this.Iv=function(t){t.loaded||(s.Cv=!1)},this.Av=e.toTileCount(i),this.Rv=1/this.Av,this.kv=r.scale*this.Rv,this.vv=e.getTileSize()*r.scale,this.Jt=r,this.rl=e,this.Cv=!0}return n.prototype.newTile=function(t,n,i,r,e){return new Dw(this.p,t,n,i,r,e)},n.prototype.renderTile=function(t){t.render(this.eu)},Object.defineProperty(n.prototype,"tz",{get:function(){return this.pv},enumerable:!1,configurable:!0}),n.prototype.render=function(t){this.eu=t,this.Ov.forEach(this.Dv)},n.prototype.move=function(t,i,r,e){var u=this._lon0,s=this._lat0,h=this._lon1,o=this._lat1;if(u!==t||s!==i||h!==r||o!==e){this._lon0=t,this._lat0=i,this._lon1=r,this._lat1=e;var a=this.pv,c=this.rl,f=n.WORK;f.set(t,i),c.lonLatToTile(f,a,f);var l=f.x,v=f.y;f.set(r,e),c.lonLatToTile(f,a,f);var b=f.x,d=f.y,g=this.Av,m=Math.max(0,l),w=Math.min(g-1,b),p=Math.max(0,v),O=Math.min(g-1,d),D=m-this.Ev,E=w-this.Mv,M=p-this.Sv,S=O-this.Tv,T=D!=D||D<0||1<D,j=E!=E||0<E||E<-1,N=M!=M||M<0||1<M,I=S!=S||0<S||S<-1;if(T||j||N||I){T?this.Ev=m:m=this.Ev,j?this.Mv=w:w=this.Mv,N?this.Sv=p:p=this.Sv,I?this.Tv=O:O=this.Tv,this.Ov.forEach(this.jv);var C=m+w>>1,A=p+O>>1,R=Math.max(C-m,w-C),k=Math.max(A-p,O-A),L=Math.max(R,k);this.toOffset(f);var y=f.x,x=f.y;this.gv=!1,this.mv=!1,this.loadTile(a,C,A,y,x,f);for(var B=1;B<=L;++B){var _=C-B;m<=_&&this.loadTilesY(a,_,A,B,p,O,y,x,f);var P=C+B;P<=w&&this.loadTilesY(a,P,A,B,p,O,y,x,f);var F=A-B;p<=F&&this.loadTilesX(a,C,B-1,m,w,F,y,x,f);var U=A+B;U<=O&&this.loadTilesX(a,C,B-1,m,w,U,y,x,f)}this.mv=!0,this.gv&&this.onLoaded()}}},n.prototype.loadTilesX=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,u,s,h,o);for(var a=1;a<=i;++a){var c=n-a;r<=c&&this.loadTile(t,c,u,s,h,o);var f=n+a;f<=e&&this.loadTile(t,f,u,s,h,o)}},n.prototype.loadTilesY=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,i,s,h,o);for(var a=1;a<=r;++a){var c=i-a;e<=c&&this.loadTile(t,n,c,s,h,o);var f=i+a;f<=u&&this.loadTile(t,n,f,s,h,o)}},n.prototype.loadTile=function(t,n,i,r,e,u){var s=this.rl.toTileCode(t,n,i),h=this.Ov,o=h.get(s);null==o&&(this.toTilePosition(n,i,r,e,u),o=this.newTile(n,i,u.x,u.y,this.kv),h.set(s,o),o.load(this.uu(t,n,i),this.wv),this.Cv=!1)},n.prototype.toTilePosition=function(t,n,i,r,e){var u=this.vv,s=this.Rv;return e.set(t,n),this.rl.tileToPixels(e,u,e),e.set(e.x*s+i,e.y*s+r),e},n.prototype.toOffset=function(t){var n=this.p,i=this.Jt,r=this.vv;return t.set(-i.x*r+.5*n.width,-i.y*r+.5*n.height),t},n.prototype.deleteTile=function(t,n,i){var r=t.tx,e=t.ty;(r<this.Ev||this.Mv<r||e<this.Sv||this.Tv<e)&&(i.delete(n),t.destroy())},n.prototype.destroy=function(){var t=this.Ov;t.forEach(this.Nv),t.clear()},n.prototype.destroyTile=function(t){t.destroy()},n.prototype.updateLoadingState=function(){this.Cv=!0,this.Ov.forEach(this.Iv)},n.prototype.onLoaded=function(){this.mv?this.dv():this.gv=!0},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.Cv||this.updateLoadingState(),this.Cv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mapping",{get:function(){return this.Jt},set:function(t){var i=this,r=this.rl,e=t.scale*this.Rv,u=r.getTileSize()*t.scale;this.kv=e,this.vv=u,this.Jt=t;var s=n.WORK;this.toOffset(s);var h=s.x,o=s.y;this.Ov.forEach((function(t){i.toTilePosition(t.tx,t.ty,h,o,s),t.transform(s.x,s.y,e)}))},enumerable:!1,configurable:!0}),n.WORK=new t.Point,n}(),Mw=function(n){function i(t){var i=n.call(this)||this,r=t.canvas;i.vr=r,i.uu=t.builder;var e=t.mapping;i.Jt=e;var u=t.coordinate;i.rl=u,i.Lv=i.toMapping(r,e,u),i._z=NaN,i.pv=NaN,i.yv=t.plane.min,i.xv=t.plane.max,i.Bv=[],i.wv=function(){i.onLoaded()},i._v=function(){i.Pv=void 0,i.fit()},i.Fv=t.plane.throttle;var s=function(){i.fitThrottled()};return i.Uv=s,r.on("scale",s),r.on("move",s),r.snippet.add(i,!0),i}return _(i,n),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.rl},enumerable:!1,configurable:!0}),i.prototype.fitThrottled=function(){null==this.Pv&&(this.Pv=window.setTimeout(this._v,this.Fv))},i.prototype.toMapping=function(t,n,r){var e=i.WORK_LONLAT,u=r.getTileSize();e.set(n.from.lon,n.from.lat),r.lonLatToPixels(e,0,u,e);var s=e.x,h=e.y;e.set(n.to.lon,n.to.lat),r.lonLatToPixels(e,0,u,e);var o=e.x,a=e.y,c=Math.abs(o-s),f=Math.abs(a-h),l=1e-7,v=1;return l<c?v=l<f?Math.max(t.width/c,t.height/f):t.width/c:l<f&&(v=t.height/f),{scale:v,x:.5*(o+s)/u,y:.5*(a+h)/u}},Object.defineProperty(i.prototype,"mapping",{get:function(){return this.Jt},set:function(t){var n=this.Lv,i=this.toMapping(this.vr,t,this.rl),r=1e-7;if(r<Math.abs(n.scale-i.scale)||r<Math.abs(n.x-i.x)||r<Math.abs(n.y-i.y)){this.Lv=i;for(var e=this.Bv,u=0,s=e.length;u<s;++u){var h=e[u];h&&(h.mapping=i)}st.update(this.vr),this.Uv()}},enumerable:!1,configurable:!0}),i.prototype.newPlane=function(t){return new Ew(this.vr,this.uu,t,this.Lv,this.rl,this.wv)},i.prototype.render=function(t){for(var n=this.pv,i=this.Bv,r=0;r<n;++r)null!=(e=i[r])&&e.render(t);for(r=i.length-1;n<r;--r){var e;null!=(e=i[r])&&e.render(t)}var u=i[n];null!=u&&u.render(t)},i.prototype.toTileZ=function(t){return Math.min(this.xv,Math.max(this.yv,Math.floor(t)))},i.prototype.updateTransform=function(){},i.prototype.toZ=function(t){return Math.log(this.Lv.scale*t)/Math.log(2)},i.prototype.move=function(t,n,i,r,e){var u=this.Bv,s=this.toZ(t);if(this._z!==s){this._z=s;var h=this.toTileZ(s);if(this.pv!==h){this.pv=h;var o=u[h];null==o&&(o=this.newPlane(h),u[h]=o)}}var a=u[this.pv];return null!=a&&a.move(n,i,r,e),this},i.prototype.fit=function(){var t=this.vr;if(null!=t){var n=t.parent;if(null!=n){var r=t.scale,e=r.x,u=r.y,s=t.x,h=t.y,o=this.rl,a=this.Lv,c=o.getTileSize()*a.scale,f=a.x*c-(s/e+.5*t.width),l=f+n.width/e,v=a.y*c-(h/u+.5*t.height),b=v+n.height/u,d=i.WORK_LONLAT;d.set(f,v),o.pixelsToLonLat(d,0,c,d);var g=d.x,m=d.y;d.set(l,b),o.pixelsToLonLat(d,0,c,d);var w=d.x,p=d.y;this.move(e,g,m,w,p)}}return this},i.prototype.destroyPlanesBefore=function(t,n){for(var i=0;i<t;++i){var r=n[i];r&&(r.destroy(),n[i]=void 0)}},i.prototype.destroyPlanesAfter=function(t,n){for(var i=t+1,r=n.length;i<r;++i){var e=n[i];e&&(e.destroy(),n[i]=void 0)}},i.prototype.cleanup=function(){var t=this.pv,n=this.Bv,i=n[t];if(i&&i.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(t,n);for(var r=t+1,e=n.length;r<e;++r)if((u=n[r])&&u.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(r,n);for(r=t-1;0<=r;--r){var u;if((u=n[r])&&u.loaded)return void this.destroyPlanesBefore(r,n)}},i.prototype.onLoaded=function(){this.cleanup(),st.update(this.vr)},i.prototype.destroy=function(){for(var t=this.Bv,n=0,i=t.length;n<i;++n){var r=t[n];r&&(r.destroy(),t[n]=void 0)}var e=this.vr,u=this.Uv;return e.off("scale",u),e.off("move",u),e.snippet.remove(this,!0),this},i.WORK_LONLAT=new t.Point,i}(t.utils.EventEmitter),Sw=function(t,n,i){return"https://j.tile.openstreetmap.jp/".concat(t,"/").concat(n,"/").concat(i,".png")},Tw=function(){function t(){}return t.toPlaneOptions=function(t){var n,i,r,e=t.plane;return{min:null!==(n=null==e?void 0:e.min)&&void 0!==n?n:this.MIN,max:null!==(i=null==e?void 0:e.max)&&void 0!==i?i:this.MAX,throttle:null!==(r=null==e?void 0:e.throttle)&&void 0!==r?r:this.THROTTLE}},t.from=function(t){return new Mw({canvas:t.canvas,builder:t.builder||Sw,mapping:t.canvas.tile.mapping,coordinate:t.coordinate||Ow.DEFAULT,plane:this.toPlaneOptions(t)})},t.MIN=0,t.MAX=18,t.THROTTLE=333,t}(),jw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof fw?i:new fw(this.toMenuOptions(t,i))},n.prototype.newMenu=function(t,n){return new fw(this.toMenuOptions(t,n))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!1),n):{fit:!1}},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){this.menu.open(this)},n.prototype.close=function(){this.menu.close()},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this,n=this.Po;return null==n&&((n=this.toMenu(this.theme,this.zn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Po=n),n},enumerable:!1,configurable:!0}),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this);var r=this.parent;r&&r.emit("select",t,n,r)},n.prototype.onKeyDown=function(n){return nr.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onActivate(t),0))},n.prototype.getType=function(){return"DMenuBarItem"},n}(Ns),Nw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t);var i=null==t?void 0:t.items;if(i)for(var r=0,e=i.length;r<e;++r){var u=this.toItem(i[r]);u&&this.addChild(u)}},i.prototype.toItem=function(n){return null==n?null:n instanceof t.DisplayObject?n:"space"in n?new Ku(n):new jw(n)},i.prototype.onKeyDown=function(t){return nr.moveFocusHorizontally(t,this),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuBar"},i}(Cs),Iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DMenuSidedContent"},n}(Cs),Cw={NONE:0,SINGLE:1,SINGLE_ONCE:2},Aw=function(){return!0},Rw=function(n){function i(t,i){var r,e,u,s=this;(s=n.call(this)||this).Nh=t,s.$c=null,s.En=!0,s.xt=Ai(null!==(e=null!==(r=null==i?void 0:i.mode)&&void 0!==r?r:null==i?void 0:i.type)&&void 0!==e?e:Cw.SINGLE_ONCE,Cw),s.pf=null!==(u=null==i?void 0:i.filter)&&void 0!==u?u:s.getFilterDefault();var h=null==i?void 0:i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return _(i,n),i.prototype.first=function(){return this.$c},i.prototype.toDirty=function(){this.En=!0},i.prototype.update=function(){this.En&&(this.En=!1,this.eh(this.Nh))},i.prototype.hasMenu=function(t){return t&&t.menu instanceof fw},i.prototype.eh=function(n){for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u instanceof Il&&u.state.isActive&&this.Gv(u,!1),u instanceof t.Container&&this.eh(u),this.hasMenu(u)&&this.eh(u.menu)}},i.prototype.add=function(t){this.update(),this.Gv(t,!0)},i.prototype.set=function(t){this.update(),this.Gv(t,!0)},i.prototype.get=function(t){return this.update(),this.$c},i.prototype.getIndex=function(t){return null},i.prototype.size=function(){return this.$c?1:0},i.prototype.isEmpty=function(){return null==this.$c},i.prototype.remove=function(t){this.update(),this.$c===t&&this.Gv(null,!0)},i.prototype.clear=function(){this.update(),this.Gv(null,!0)},i.prototype.getFilterDefault=function(){return Aw},i.prototype.Gv=function(t,n){var i=this.$c,r=this.xt;r!==Cw.NONE&&this.pf(t)&&i!==t&&(this.setState(i,r,!1),this.$c=t,this.setState(t,r,!0),n&&this.emit("change",this))},i.prototype.setState=function(t,n,i){t&&(n===Cw.SINGLE?t.state.isActive=i:i?t.state.addAll(ct.ACTIVE,ct.READ_ONLY):t.state.removeAll(ct.ACTIVE,ct.READ_ONLY))},i}(t.utils.EventEmitter),kw=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=new cw(r);r.ea=e,e.add(r);var u=null==n?void 0:n.items;if(null!=u){var s=null!==(i=null==n?void 0:n.sticky)&&void 0!==i&&i;r.newItems(u,s)}var h=null==n?void 0:n.selection;return r.tf=h instanceof Rw?h:r.newSelection(h),r}return _(n,t),n.prototype.newSelection=function(t){return new Rw(this.content,t)},n.prototype.onHierarchyDirty=function(){var n=this.tf;null!=n&&n.toDirty(),t.prototype.onHierarchyDirty.call(this)},n.prototype.newItems=function(t,n){mv.newItems(this.content,t,n)},n.prototype.newContent=function(t){return new Iw(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),n.prototype.getContext=function(){return this.ea},n.prototype.getCloseable=function(){return this},n.prototype.open=function(){},n.prototype.close=function(){},n.prototype.onKeyDown=function(n){return nr.moveFocusVertically(n,this),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DMenuSided"},n}(zd),Lw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteError"},n}(Yd),yw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteNoItemsFound"},n}(Yd),xw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSearching"},n}(Yd),Bw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(hr),_w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonLast"},n}(Rs),Pw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonNext"},n}(Rs),Fw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonPage"},n}(Rs),Uw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonPrevious"},n}(Rs),Gw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonTop"},n}(Rs),Hw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationDots"},n}(Ts),zw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationPage"},n}(Ts),Vw=function(t){function n(n){var i,r,e,u,s=this;s=t.call(this,n)||this,null!=n?(s.j=null!==(r=null!==(i=n.size)&&void 0!==i?i:n.total)&&void 0!==r?r:10,s.Ut=null!==(u=null!==(e=n.value)&&void 0!==e?e:n.selected)&&void 0!==u?u:0):(s.j=10,s.Ut=0);var h=s.buttonTop,o=s.buttonPrevious;null!=h&&s.addChild(h),null!=o&&s.addChild(o),null==h&&null==o||s.addChild(s.newSpace());var a=s.buttonPages0,c=a.length;s.addChild(a[c-1]),s.addChild(s.dots0);for(var f=c-2;0<=f;--f)s.addChild(a[f]);s.addChild(s.page);for(var l=s.buttonPages1,v=l.length,b=(f=0,v-1);f<b;++f)s.addChild(l[f]);s.addChild(s.dots1),s.addChild(l[v-1]);var d=s.buttonNext,g=s.buttonLast;return null==d&&null==g||s.addChild(s.newSpace()),null!=d&&s.addChild(d),null!=g&&s.addChild(g),s.update(),s}return _(n,t),n.prototype.newSpace=function(){var t,n,i;return new Ku({width:null!==(i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.space)&&void 0!==i?i:this.theme.getButtonSpace()})},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){0<=t&&t<this.j&&this.Ut!==t&&(this.Ut=t,this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){0<=t&&this.j!==t&&(this.j=t,this.Ut=0===t?-1:Math.max(0,Math.min(this.j-1,this.Ut)),this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"total",{get:function(){return this.size},set:function(t){this.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots0",{get:function(){var t=this._dots0;return null==t&&(t=this.newDots(),this._dots0=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots1",{get:function(){var t=this._dots1;return null==t&&(t=this.newDots(),this._dots1=t),t},enumerable:!1,configurable:!0}),n.prototype.newDots=function(){return new Hw},Object.defineProperty(n.prototype,"buttonLast",{get:function(){var t=this.Hv;return void 0===t&&(t=this.newButtonLast(),this.Hv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonLast=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.last;if(null!==r&&!1!==r&&void 0!==r){var e=new _w(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonLastActive()})),e}return null},n.prototype.onButtonLastActive=function(){this.moveTo(this.j-1)},n.prototype.moveTo=function(t){if(0<=t&&t<this.j&&this.Ut!==t){var n=this.Ut;this.Ut=t,this.emit("change",t,n,this),this.update()}},Object.defineProperty(n.prototype,"buttonNext",{get:function(){var t=this.zv;return void 0===t&&(t=this.newButtonNext(),this.zv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonNext=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.next;if(null!==r&&!1!==r){var e=new Pw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonNextActive()})),e}return null},n.prototype.onButtonNextActive=function(){this.moveTo(this.Ut+1)},Object.defineProperty(n.prototype,"buttonPrevious",{get:function(){var t=this.Vv;return void 0===t&&(t=this.newButtonPrevious(),this.Vv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPrevious=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.previous;if(null!==r&&!1!==r){var e=new Uw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonPreviousActive()})),e}return null},n.prototype.onButtonPreviousActive=function(){this.moveTo(this.Ut-1)},Object.defineProperty(n.prototype,"buttonTop",{get:function(){var t=this.Wv;return void 0===t&&(t=this.newButtonTop(),this.Wv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonTop=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.top;if(null!==r&&!1!==r&&void 0!==r){var e=new Gw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonTopActive()})),e}return null},n.prototype.onButtonTopActive=function(){this.moveTo(0)},n.prototype.newButtonPage=function(){var t,n,i=this,r=new Fw(null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.page);return r.on("active",(function(){i.onButtonPageActive(r)})),r},Object.defineProperty(n.prototype,"buttonPages0",{get:function(){var t=this._buttonPages0;return null==t&&(t=this.newButtonPages0(),this._buttonPages0=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages0=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"buttonPages1",{get:function(){var t=this._buttonPages1;return null==t&&(t=this.newButtonPages1(),this._buttonPages1=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages1=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"page",{get:function(){var t=this.Xv;return null==t&&(t=this.newPage(),this.Xv=t),t},enumerable:!1,configurable:!0}),n.prototype.newPage=function(){var t;return new zw(null===(t=this.zn)||void 0===t?void 0:t.page)},n.prototype.onButtonPageActive=function(t){var n=t.text;pt(n)&&(this.moveTo(n-1),t.state.isFocused&&(t.state.isHovered=!1,this.page.focus()))},n.prototype.update=function(){var t=this.j,n=this.Ut;if(t<=0){null!=(o=this.buttonTop)&&(o.state.isEnabled=!1),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=!1),this.hideDots(this.dots0);for(var i=0,r=(l=this.buttonPages0).length;i<r;++i)this.hidePage(l[i]);for(this.hidePage(this.page),i=0,r=(v=this.buttonPages1).length;i<r;++i)this.hidePage(v[i]);this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=!1),(f=this.buttonLast)&&(f.state.isEnabled=!1)}else{var e=n-2,u=n+2;if(e<0)u-=e,e=0;else if(t<=u){var s=u-t+1;u-=s,e-=s}var h=!1;0<e&&(h=!0,e=Math.min(e+1,n));var o,a,c,f,l,v,b=!1;for(u<t-1&&(b=!0,u=Math.max(u-1,n)),null!=(o=this.buttonTop)&&(o.state.isEnabled=0<n),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=0<n),h?this.showDots(this.dots0,1,e-1):this.hideDots(this.dots0),i=0,r=(l=this.buttonPages0).length;i<r;++i){var d=n-i-1,g=l[i];e<=d&&d<=u&&0<=d?this.showPage(g,d):h&&i===r-1?this.showPage(g,0):this.hidePage(g)}for(this.showPage(this.page,n),i=0,r=(v=this.buttonPages1).length;i<r;++i)d=n+i+1,g=v[i],e<=d&&d<=u&&d<t?this.showPage(g,d):b&&i===r-1?this.showPage(g,t-1):this.hidePage(g);b?this.showDots(this.dots1,u+1,t-2):this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=n<t-1),null!=(f=this.buttonLast)&&(f.state.isEnabled=n<t-1)}},n.prototype.showPage=function(t,n){t.text=n+1,t.show()},n.prototype.hidePage=function(t){t.hide()},n.prototype.showDots=function(t,n,i){t.show()},n.prototype.hideDots=function(t){t.hide()},n.prototype.getType=function(){return"DPagination"},n}(Cs),Ww=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(hr),Xw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(hr),Kw=function(t){function n(n){var i=t.call(this,n)||this;i.k=[];var r=null==n?void 0:n.values;return r&&(i.values=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){if(t.prototype.onMenuSelect.call(this,n,i,r),i instanceof Rl){var e=this.k,u=[],s=[];i.state.isActive?this.updateMenuItems(r,e,n,void 0,u,s):this.updateMenuItems(r,e,void 0,n,u,s),this.k=u,this.text=s,this.onValueChange(u,e,s)}},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.k,e=[],u=[];this.updateMenuItems(n,r,void 0,void 0,e,u),this.k=e,this.text=u},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.open=function(){this.updateMenuItems(this.menu,this.k),t.prototype.open.call(this)},Object.defineProperty(n.prototype,"values",{get:function(){return this.k},set:function(t){var n=this.k;if(!this.isSameValues(t,n)){var i=[],r=[];this.updateMenuItems(this.menu,t,void 0,void 0,i,r),this.k=i,this.text=r}},enumerable:!1,configurable:!0}),n.prototype.isSameValues=function(t,n){if(t.length===n.length)for(var i=0,r=t.length;i<r;++i)if(n.indexOf(t[i])<0)return!1;return!1},n.prototype.updateMenuItems=function(t,n,i,r,e,u){for(var s=t.children,h=0,o=s.length;h<o;++h){var a=s[h];if(a instanceof Wl)this.updateMenuItems(a.menu,n,i,r,e,u);else if(a instanceof Rl){var c=a.value;void 0!==r&&r===c?a.state.isActive=!1:void 0!==i&&a.value===i||0<=n.indexOf(a.value)?(e&&e.push(a.value),u&&u.push(a),a.state.isActive=!0):a.state.isActive=!1}}},n.prototype.getType=function(){return"DSelectMultiple"},n}(lw),Yw=function(t){function n(n){var i=t.call(this,n)||this;i.Ut=null;var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=this.Ut;e!==n&&(this.Ut=n,this.text=i,this.onValueChange(n,e,i))},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.Ut;if(null!=r){var e=this.findMenuItem(n,r);null!=e?(this.Ut=r,this.text=e):(this.Ut=null,this.text=null)}else this.Ut=null,this.text=null},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.findMenuItem=function(t,n){for(var i=t.children,r=0,e=i.length;r<e;++r){var u=i[r];if(u instanceof Wl){var s=this.findMenuItem(u.menu,n);if(null!=s)return s}else if(u instanceof Cl&&u.value===n)return u}return null},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){if(this.Ut!==t){var n=this.findMenuItem(this.menu,t);null!=n?(this.Ut=t,this.text=n):(this.Ut=null,this.text=null)}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSelect"},n}(lw),Jw=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,i,r)||this;return s.Kv=e,s.Yv=u,s.La=.5*i,s.ya=.5*r,s.interactive=!1,s.interactiveChildren=!1,n.on("update",(function(){s.onTextureUpdate()})),s}return _(n,t),n.prototype.onTextureUpdate=function(){this.emit("update",this)},n.prototype.onReflow=function(t,n,i){var r=this.La,e=this.ya;this.x=-r+this.Kv,this.y=-e+this.Yv,this.width=r+n+r,this.height=e+i+e},n.prototype.render=function(n){var i=this.parent;if(i){var r=i.alpha;this.alpha=r*r*r}t.prototype.render.call(this,n)},n}(t.NineSlicePlane),Zw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n),this.Ut=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderLabel"},n}(Ss),qw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderThumb"},n}(Ns),Qw=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).Ut=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0,e.Jv=e.toRounder(n),e.Zv=null!==(r=null==n?void 0:n.delta)&&void 0!==r?r:1,e}return _(n,t),n.prototype.toRounder=function(t){var n,i=null==t?void 0:t.rounder;if(i)return i;var r=null!==(n=null==t?void 0:t.precision)&&void 0!==n?n:this.theme.getPrecision(),e=Math.pow(10,r);return function(t){return Math.round(t*e)/e}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rounder",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"delta",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderValue"},n}(Ss),$w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.qv=0,this.Qv=this.newTrack(n),this.addChild(this.Qv),this.$v=this.newTrackSelected(n),this.$v.state.isActive=!0,this.addChild(this.$v),this.ff=this.newThumb(n),this.addChild(this.ff),this.cs=this.newLabelMin(n),this.addChild(this.cs),this.fs=this.newLabelMax(n),this.addChild(this.fs),this.Ut=this.newValue(n),this.addChild(this.Ut),this.Qv.on(ir.down,(function(t){i.Ut.visible=i.state.inEnabled,i.onTrackDown(t.data.global)})),this.$v.on(ir.down,(function(t){i.Ut.visible=i.state.inEnabled,i.onTrackSelectedDown(t.data.global)})),this.tb=function(t){i.onTrackUpBound(t),i.Ut.visible=!1},this.nb=function(t){i.onTrackSelectedUpBound(t),i.Ut.visible=!1},this.ff.on(ir.down,(function(t){i.Ut.visible=!0,i.onThumbDown(t)})),this.ib=function(t){i.onThumbMove(t)},this.rb=function(t){i.onThumbUp(t),i.Ut.visible=!1},this.onValuesChange()},n.prototype.newThumb=function(t){return new qw(null==t?void 0:t.thumb)},n.prototype.newValue=function(t){return new Qw(this.toValueOptions(null==t?void 0:t.value))},n.prototype.toValueOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value=t.value),null==t.visible&&(t.visible=!1),t},n.prototype.newLabelMin=function(t){return new Zw(this.toLabelMinOptions(null==t?void 0:t.min))},n.prototype.toLabelMinOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.newLabelMax=function(t){return new Zw(this.toLabelMaxOptions(null==t?void 0:t.max))},n.prototype.toLabelMaxOptions=function(t){null==(t=t||{}).value&&(t.value=1);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.getValueMargin=function(){return 14},n.prototype.onTrackDown=function(t){if(!this.state.inDisabled){var n=st.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.eb=i;var r=this.tb;i.on(ir.up,r),i.on(ir.upoutside,r),i.on(ir.cancel,r)}this.onPick(t)}},n.prototype.onTrackSelectedDown=function(t){if(!this.state.inDisabled){var n=st.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.eb=i;var r=this.nb;i.on(ir.up,r),i.on(ir.upoutside,r),i.on(ir.cancel,r)}this.onPick(t)}},n.prototype.onTrackUpBound=function(t){var n=this.eb;if(n){this.eb=void 0;var i=this.tb;n.off(ir.up,i),n.off(ir.upoutside,i),n.off(ir.cancel,i)}},n.prototype.onTrackSelectedUpBound=function(t){var n=this.eb;if(n){this.eb=void 0;var i=this.nb;n.off(ir.up,i),n.off(ir.upoutside,i),n.off(ir.cancel,i)}},n.prototype.onThumbMove=function(t){this.state.inDisabled||this.onPick(t.data.global)},n.prototype.onThumbDown=function(t){var n=st.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.eb=i;var r=this.ib;i.on(ir.move,r);var e=this.rb;i.on(ir.up,e),i.on(ir.upoutside,e),i.on(ir.cancel,e)}},n.prototype.onThumbUp=function(t){var n=this.eb;if(n){this.eb=void 0;var i=this.ib;n.off(ir.move,i);var r=this.rb;n.off(ir.up,r),n.off(ir.upoutside,r),n.off(ir.cancel,r)}},n.prototype.updateValue=function(){var t=this.cs.value,n=this.fs.value,i=this.Ut,r=i.rounder(t+this.qv*(n-t)),e=i.value;r!==e&&(i.value=r,i.text=i.value,this.emit("change",r,e,this))},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.onValuesChange()},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut.value},set:function(t){t=Math.max(this.cs.value,Math.min(this.fs.value,t)),this.Ut.value!==t&&(this.Ut.value=t,this.onValuesChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.cs.value},set:function(t){var n=this.cs;if(t=Math.min(this.fs.value,t),n.value!==t){var i=this.Ut;n.text=n.value=t,i.value=Math.max(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.fs.value},set:function(t){var n=this.fs;if(t=Math.max(this.cs.value,t),n.value!==t){var i=this.Ut;n.text=n.value=t,i.value=Math.min(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSlider"},n}(hr),tp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrack"},n}(Ns),np=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackHorizontal"},n}(tp),ip=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new np(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new np(null==t?void 0:t.track)},i.prototype.toValueOptions=function(t){var i=this;return null==(t=n.prototype.toValueOptions.call(this,t)).y&&(t.y=function(t,n){return.5*t-n-i.getValueMargin()}),t},i.prototype.toLabelMinOptions=function(t){return null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return.5*-n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.toLabelMaxOptions=function(t){return null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return t-.5*n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=Math.max(0,Math.min(this.Qv.width,i.x));this.qv=r/this.Qv.width,this.moveThumbPosition(r)},i.prototype.onValuesChange=function(){var t=this.cs.value,n=this.fs.value,i=this.Ut.value;this.qv=(i-t)/(n-t);var r=this.qv*this.Qv.width;this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.ff;n.x=t-.5*n.width,this.$v.width=t;var i=this.Ut;i.x=t-.5*i.width,this.updateValue()},i.prototype.onKeyDown=function(t){return nr.isArrowRightKey(t)?this.value+=this.Ut.delta:nr.isArrowLeftKey(t)&&(this.value-=this.Ut.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderHorizontal"},i}($w),rp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackVertical"},n}(tp),ep=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new rp(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new rp(null==t?void 0:t.track)},i.prototype.toLabelMinOptions=function(t){null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return t-.5*n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=ns.RIGHT),t},i.prototype.toLabelMaxOptions=function(t){null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return.5*-n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=ns.RIGHT),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=this.height,e=Math.max(0,Math.min(r,i.y));this.qv=(r-e)/r,this.moveThumbPosition(e)},i.prototype.onValuesChange=function(){var t=this.cs.value,n=this.fs.value,i=this.Ut.value;this.qv=(i-t)/(n-t);var r=this.height*(1-this.qv);this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.ff;n.y=t-.5*n.height;var i=this.$v;i.y=t,i.height=this.height-t;var r=this.Ut;r.y=t-r.height-this.getValueMargin(),this.updateValue()},i.prototype.onKeyDown=function(t){return nr.isArrowUpKey(t)?this.value+=this.Ut.delta:nr.isArrowDownKey(t)&&(this.value-=this.Ut.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderVertical"},i}($w),up=function(){function t(){}return t.set=function(t,n,i,r,e){var u,s=this.toRenderable(n,i,r);t.renderable=s;var h=t.state;h.lock(),h.isDisabled=!s,!1!==e&&(h.isReadOnly=this.toReadOnly(n,i,r));var o=null===(u=r.state)||void 0===u?void 0:u.modifier;o&&o(n,i,t.state),h.unlock()},t.toReadOnly=function(t,n,i){var r=i.editing.enable;return!0!==r&&(!1===r||!r(t,n))},t.toRenderable=function(t,n,i){var r=i.renderable;return!0===r||!1!==r&&r(t,n)},t}(),sp=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).ub=-1,s.sb=n,s.hb=i,s.ut=r,s.ob=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.hb.selecting,u=e.dialog;if(u){var s=null!==(i=this.oh)&&void 0!==i?i:null;e.setter(u,s),u.open(this).then((function(){var t=e.getter(u);r.ob?t!==s&&(r.text=t,r.onValueChange(t,s)):r.onValueChange(t,null)}))}},n.prototype.onValueChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb;this.hb.setter(i,e,t),this.emit("change",t,n,this),this.ut(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.oh;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectDialog"},n}(Ns),hp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionDialog"},n}(sp),op=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){var e=this.ab;if(void 0!==e){var u=this.ub,s=this.sb;this.hb.setter(e,s,n),t.prototype.onMenuSelect.call(this,n,i,r),this.ut(n,null,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellActionMenu"},n}(vw),ap=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).ub=-1,s.sb=n,s.hb=i,s.ut=r,s.ob=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.hb.selecting.promise;r&&r().then((function(t){var n;if(i.ob){var r=null!==(n=i.oh)&&void 0!==n?n:null;t!==r&&(i.text=t,i.onValueChange(t,r))}else i.onValueChange(t,null)}))},n.prototype.onValueChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb;this.hb.setter(i,e,t),this.emit("change",t,n,this),this.ut(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.oh;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectPromise"},n}(Ns),cp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionPromise"},n}(ap),fp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellText"},n}(Ts),lp=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,e)||this).ph=Ai(null!==(u=null==e?void 0:e.when)&&void 0!==u?u:Qu.CLICKED,Qu),s.on(ir.tap,(function(t){s.onClick(t)})),s}return _(n,t),n.prototype.onClick=function(t){this.ph===Qu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.ph===Qu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this);var n=this.ab;if(void 0!==n){var i=this.ub,r=this.sb;this.emit("change",null,null,this),this.ut(null,null,n,i,r,this)}},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTableBodyCellButton"},n}(fp),vp={INDEX:0,TEXT:1,INTEGER:2,REAL:3,CHECK:4,CHECK_SINGLE:5,COLOR:6,BUTTON:7,SELECT:8,DATE:9,DATETIME:10,TIME:11,ACTION:12,LINK:13,TREE:14},bp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.onValueChange(!0,!1)},n.prototype.onInactivate=function(n){t.prototype.onInactivate.call(this,n),this.onValueChange(!1,!0)},n.prototype.onValueChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb,u=this.hb;u.setter(i,e,t),this.emit("change",t,n,this);var s=this.ut;s(t,n,i,r,e,this),t&&u.type===vp.CHECK_SINGLE&&this.onChangeSingle(r,e,u,s)}},n.prototype.onChangeSingle=function(t,n,i,r){var e=this,u=this.parent;if(u){var s=u.parent;if(s){var h=!1,o=i.getter,a=i.setter;s.data.each((function(i,u){return t===u||!o(i,n)||(a(i,n,!1),h=!0,r(!1,!0,i,u,n,e),!1)})),h&&s.update(!0)}}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.state.isActive=!!t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellCheck"},n}(Ub),dp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r;var s=this.value;if(pt(t))s.color=t,s.alpha=1;else if(Ot(t)){var h=Number(t);s.color=h==h?h:16777215,s.alpha=1}else if(null!=t){var o=t.color,a=t.alpha;s.color=pt(o)?o:16777215,s.alpha=pt(a)?a:1}else s.color=16777215,s.alpha=1;up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellColor"},n}(ud),gp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.ab=n,this.ub=r,t instanceof Date)u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(pt(t)){var s=this.oh;void 0===s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellDate"},n}(hd),mp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.ab=n,this.ub=r,t instanceof Date)u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(pt(t)){var s=this.oh;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellDatetime"},n}(fd),wp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=r,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellIndex"},n}(Ts),pp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=Number(t),up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellInputInteger"},n}(Ys),Op=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=Number(t),up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellInputReal"},n}(qs),Dp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=String(t),up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellInputText"},n}(th),Ep=function(t){function n(n){var i=t.call(this,n)||this;return i.Qn=new Pb(i.Qn),i}return _(n,t),Object.defineProperty(n.prototype,"padding",{get:function(){return this.Qn},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellInputTreeInput"},n}(th),Mp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellInputTreeMarker"},n}(js),Sp={START:"START",END:"END",FROZEN:"FROZEN",FROZEN_END:"FROZEN_END",SORTABLE:"SORTABLE",SORTED_ASCENDING:"SORTED_ASCENDING",SORTED_DESCENDING:"SORTED_DESCENDING",HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED",CHECKABLE:"CHECKABLE",SELECTABLE:"SELECTABLE"},Tp=function(t){function n(n,i,r,e){var u=t.call(this,function(t){if(null!=t)return{weight:t.weight,width:t.width}}(e))||this;u.ub=-1,u.sb=n,u.hb=i,u.ut=r;var s=u.newInput(e);u.Ah=s,u.addChild(s);var h=u.newMarker(e);return u.A=h,u.addChild(h),u}return _(n,t),n.prototype.newInput=function(t){return new Ep(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){var n=this;return{weight:1,text:null==t?void 0:t.text,editing:null==t?void 0:t.editing,when:null==t?void 0:t.when,cursor:null==t?void 0:t.cursor,on:{change:function(t,i){n.onInputChange(t,i)}}}},n.prototype.onInputChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb;this.hb.setter(i,e,t),this.emit("change",t,n,this),this.ut(t,n,i,r,e,this)}},n.prototype.newMarker=function(t){var n=this;return new Mp({visible:!1,on:{active:function(){n.onMarkerActive()}}})},n.prototype.onMarkerActive=function(){this.A.state.is(Sp.HAS_CHILDREN)&&this.toggle()},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.ab;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.Ah.padding.getLeft()},n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r;var s=this.Ah;s.visible=!0,s.text=String(t);var h=this.A;if(pt(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=h.state;f.lock(),f.set(Sp.HAS_CHILDREN,a),f.set(ct.DISABLED,!a),f.set(Sp.OPENED,o),f.unlock();var l=this.theme.getLevelPadding(c);h.width=l,a?h.show():h.hide(),s.padding.adjLeft(l)}else h.state.removeAll(Sp.OPENED,Sp.HAS_CHILDREN),h.hide(),s.padding.adjLeft(0);up.set(this.Ah,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1,this.Ah.visible=!1,this.A.hide()},n.prototype.getType=function(){return"DTableBodyCellInputTree"},n}(hr),jp=function(t,n){if(n)return{url:Np(t,n.url),target:n.target,checker:Ip(t,n.checker),menu:n.menu}},Np=function(t,n){return Ot(n)||null==n?n:function(){var i=t.row;return void 0!==i?n(i,t.rowIndex,t.columnIndex,t):null}},Ip=function(t,n){if(null!=n)return function(){var i=t.row;return void 0!==i&&n(i,t.rowIndex,t.columnIndex,t)}},Cp=function(t){function n(n,i,r,e){var u;return t.call(this,n,i,r,Hl.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this}return _(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t,n=this.Go;return null==n&&(n=new Gl(jp(this,null===(t=this.zn)||void 0===t?void 0:t.link)),this.Go=n),n},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellLink"},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n}(lp),Ap=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.ab;if(void 0!==e){var u=this.ub,s=this.sb;this.hb.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.ut(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.value=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMenu"},n}(Yw),Rp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.ab;if(void 0!==e){var u=this.ub,s=this.sb;this.hb.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.ut(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.values=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMultiple"},n}(Kw),kp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.ab=n,this.ub=r,t instanceof Date)u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(pt(t)){var s=this.oh;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellTime"},n}(eg),Lp=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,Hl.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this).Qn=new Pb(s.Qn),s}return _(n,t),n.prototype.onClick=function(n){var i;!0!==(null===(i=this.link)||void 0===i?void 0:i.onClick(this,n))&&t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return void 0===t&&(t=this.newLink(),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t,n=null===(t=this.zn)||void 0===t?void 0:t.link;return n?new Gl(jp(this,n)):null},n.prototype.onActivate=function(n){var i;t.prototype.onActivate.call(this,n),this.state.is(Sp.HAS_CHILDREN)?this.toggle():null===(i=this.link)||void 0===i||i.open(n)},n.prototype.toggle=function(){var t=this.ab;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.padding.getLeft()&&(this.toggle(),!0)},n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=t,up.set(this,n,e,this.hb,!1);var s=this.link,h=this.Qn;if(pt(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=this.state;f.lock(),f.set(Sp.HAS_CHILDREN,a),f.set(Sp.OPENED,o),f.unlock(),h.adjLeft(this.theme.getLevelPadding(c)),s&&(s.menu.enable=!a)}else this.state.removeAll(Sp.OPENED,Sp.HAS_CHILDREN),h.adjLeft(0),s&&(s.menu.enable=!1)},n.prototype.getType=function(){return"DTableBodyCellTree"},n}(lp),yp={NONE:0,SINGLE:1,MULTIPLE:2},xp=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).ai=!0,e.cb=null!==(i=n.frozen)&&void 0!==i?i:0,e.fb=null!==(r=n.columns)&&void 0!==r?r:[],e}return _(n,t),n.prototype.initCells=function(t,n,i){for(var r=this.toIndexEnd(n),e=n.length-1;0<=e;--e){var u=this.newCell(e,n[e],n,t),s=u.state;s.lock(!1),0===e&&s.add(Sp.START),e===r&&s.add(Sp.END),e<i&&s.add(Sp.FROZEN),e===i-1&&s.add(Sp.FROZEN_END),s.unlock(),this.addChild(u)}},n.prototype.toIndexEnd=function(t){for(var n=t.length,i=0;i<n;++i)if(void 0!==t[i].weight)return n-1;return n},n.prototype.onRefit=function(){t.prototype.onRefit.call(this),this.resetFrozenCellPosition()},n.prototype.updateFrozenCellPosition=function(t){for(var n=this.fb,i=this.children,r=i.length,e=this.cb,u=0;u<e;++u){var s=n[u];i[r-1-u].position.x=-t+s.offset}},n.prototype.resetFrozenCellPosition=function(){for(var t=this.fb,n=this.children,i=n.length,r=this.cb,e=this.getContentPositionX(),u=0;u<r;++u){var s=t[u],h=n[i-1-u];s.offset=h.position.x,h.position.x=-e+s.offset}},n.prototype.getClippingRect=function(n,i){t.prototype.getClippingRect.call(this,n,i);var r=this.cb;if(0<r){var e=n;if(e&&e.parent===this){var u=this.children,s=u.indexOf(e);if(0<=s&&r<=u.length-1-s){var h=u[s+1],o=h.position.x+h.width;i.x+=o,i.width-=o}}}},n.prototype.getType=function(){return"DTableRow"},n}(Cs),Bp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.hu=-1,u.lb=function(t,i,r,e,s){u.emit("change",t,i,r,e,s,u),n(t,i,r,e,s,u)},u.vb=r,u.state.isAlternated=!i,u.initCells(e,u.fb,u.cb),u}return _(n,t),n.prototype.newCell=function(t,n,i,r){var e=this.lb,u=this.vb,s=u.get(t);if(null==s&&(s=this.toCellOptions(t,n,r),u.set(t,s)),!1!==n.editing.enable)return this.newCellEditable(t,n,e,s);var h=this.newCellUnediable(t,n,e,s);return n.type!==vp.TREE&&(h.state.isReadOnly=!0),h},n.prototype.newCellEditable=function(t,n,i,r){switch(n.type){case vp.INDEX:return new wp(t,n,i,r);case vp.TEXT:return new Dp(t,n,i,r);case vp.TREE:return new Tp(t,n,i,r);case vp.INTEGER:return new pp(t,n,i,r);case vp.REAL:return new Op(t,n,i,r);case vp.CHECK:case vp.CHECK_SINGLE:return new bp(t,n,i,r);case vp.COLOR:return new dp(t,n,i,r);case vp.BUTTON:return new lp(t,n,i,r);case vp.LINK:return new Cp(t,n,i,r);case vp.SELECT:return this.newCellSelect(t,n,i,r);case vp.ACTION:return this.newCellAction(t,n,i,r);case vp.DATE:return new gp(t,n,i,r);case vp.DATETIME:return new mp(t,n,i,r);case vp.TIME:return new kp(t,n,i,r);default:return new fp(t,n,i,r)}},n.prototype.newCellUnediable=function(t,n,i,r){switch(n.type){case vp.INDEX:return new wp(t,n,i,r);case vp.TEXT:return new fp(t,n,i,r);case vp.TREE:return new Lp(t,n,i,r);case vp.INTEGER:case vp.REAL:return new fp(t,n,i,r);case vp.CHECK:case vp.CHECK_SINGLE:return new bp(t,n,i,r);case vp.COLOR:return new dp(t,n,i,r);case vp.BUTTON:return new lp(t,n,i,r);case vp.LINK:return new Cp(t,n,i,r);case vp.SELECT:return this.newCellSelect(t,n,i,r);case vp.ACTION:return this.newCellAction(t,n,i,r);case vp.DATE:return new gp(t,n,i,r);case vp.DATETIME:return new mp(t,n,i,r);case vp.TIME:return new kp(t,n,i,r);default:return new fp(t,n,i,r)}},n.prototype.newCellSelect=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new Ap(t,n,i,r):null!=e.multiple?new Rp(t,n,i,r):null!=e.dialog?new sp(t,n,i,r):null!=e.promise?new ap(t,n,i,r):new fp(t,n,i,r)},n.prototype.newCellAction=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new op(t,n,i,r):null!=e.dialog?new hp(t,n,i,r):null!=e.promise?new cp(t,n,i,r):new fp(t,n,i,r)},n.prototype.toCellOptions=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v,b,d,g,m=lb(n.body,i.cell);m.weight=n.weight,m.width=n.width,null!==(r=m.state)&&void 0!==r||(m.state=n.state.initial);var w=n.formatter;null!=w&&(null!==(u=(O=null!==(e=m.text)&&void 0!==e?e:m.text={}).formatter)&&void 0!==u||(O.formatter=w));var p=n.align;if(null!=p){var O,D=null!==(h=(O=null!==(s=m.text)&&void 0!==s?s:m.text={}).align)&&void 0!==h?h:O.align={};null!==(o=D.horizontal)&&void 0!==o||(D.horizontal=p)}var E=n.editing;if(!1!==E.enable){var M=null!==(a=(g=m).editing)&&void 0!==a?a:g.editing={};null!==(c=M.formatter)&&void 0!==c||(M.formatter=E.formatter),null!==(f=M.unformatter)&&void 0!==f||(M.unformatter=E.unformatter),null!==(l=M.validator)&&void 0!==l||(M.validator=E.validator)}var S=n.link;void 0!==S&&(m.link=S);var T=n.selecting,j=null!==(v=T.menu)&&void 0!==v?v:T.multiple;return void 0!==j&&(m.menu=j),(null!==(d=null===(b=null==i?void 0:i.selection)||void 0===b?void 0:b.type)&&void 0!==d?d:yp.NONE)!==yp.NONE&&(m.when="DOUBLE_CLICKED",m.cursor=function(t){if(t.in(Sp.SELECTABLE))return"pointer"}),m},n.prototype.getType=function(){return"DTableBodyRow"},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),n.prototype.isCell=function(t){return null!=t&&"set"in t},n.prototype.set=function(t,n,i,r){if(r||this.Ut!==t||this.hu!==i){this.Ut=t,this.hu=i;for(var e=this.children,u=e.length,s=this.fb,h=s.length,o=0;o<u;++o){var a=e[o],c=h-1-o,f=s[c];this.isCell(a)&&a.set(f.getter(t,c),t,n,i,c,r)}this.onSet(t,i)}},n.prototype.onSet=function(t,n){this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Ut){this.Ut=void 0,this.hu=-1;for(var t=this.children,n=t.length,i=0;i<n;++i){var r=t[i];this.isCell(r)&&r.unset()}this.onUnset()}},n.prototype.onUnset=function(){this.emit("unset",this)},n.prototype.getContentPositionX=function(){var t=this.parent;if(t){var n=t.parent;if(n)return n.position.x}return 0},n}(xp),_p=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.Al=-1,i.bb=!1,i.gb=-1,i.p=n,i.pf=null,i.mb=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.bb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.bb&&(this.bb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.bb},n.prototype.newFiltered=function(){var t=this.pf;if(null!=t){var n,i=[],r=this.p,e=r.sorter,u=r.rows;if(wt(t))if(n=e.indices)for(var s=0,h=n.length;s<h;++s)t(u[o=n[s]],o)&&i.push(s);else for(s=0,h=u.length;s<h;++s)t(u[s],s)&&i.push(s);else if(n=e.indices)for(s=0,h=n.length;s<h;++s){var o=n[s];t.test(u[o],o)&&i.push(s)}else for(s=0,h=u.length;s<h;++s)t.test(u[s],s)&&i.push(s);return i}return null},n.prototype.get=function(){return this.pf},n.prototype.set=function(t){this.pf!==t&&(this.pf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R===this.Al&&this.p.sorter.id===this.gb||(this.Al=this.R,this.gb=this.p.sorter.id,this.bb?(this.mb=this.newFiltered(),this.emit("change",this)):null!=this.mb&&(this.mb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.mb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Pp=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"rows",{get:function(){var t=[];return this.each((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),t.prototype.map=function(t){var n=this.p,i=n.sorter.map(t);return null!=i?n.filter.map(i):null},t.prototype.unmap=function(t){var n=this.p;return n.sorter.unmap(n.filter.unmap(t))},t.prototype.size=function(){var t=this.p,n=t.filter.indices;return null!=n?n.length:t.size()},t.prototype.get=function(t){return this.p.get(this.unmap(t))},t.prototype.each=function(t,n,i){var r=this.p,e=r.rows,u=r.supplimentals,s=r.filter.indices,h=r.sorter.indices;if(n=null!=n?Math.max(0,n):0,s){var o=s.length;if(i=null!=i?Math.min(o,i):o,h)for(var a=n;a<i&&!1!==t(e[c=h[s[a]]],u?u[c]:null,a,c);++a);else for(a=n;a<i&&!1!==t(e[c=s[a]],u?u[c]:null,a,c);++a);}else if(o=e.length,i=null!=i?Math.min(o,i):o,h)for(a=n;a<i;++a){var c;if(!1===t(e[c=h[a]],u?u[c]:null,a,c))break}else for(a=n;a<i&&!1!==t(e[a],u?u[a]:null,a,a);++a);},t}(),Fp=function(t,n){return t[0]-n[0]},Up=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).p=n,e.xt=Ai(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:yp.NONE,yp),e.In=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.xt},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.In;n.has(t)?n.delete(t):n.add(t),this.onChange()},n.prototype.add=function(t){var n=this.In,i=n.size;n.add(t),i!==n.size&&this.onChange()},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.In;if(0<t.size){var n=NaN;return t.forEach((function(t){n!=n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.In;if(0<t.size){var n=0;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.In,u=e.size;if(t<i)for(var s=i+(r?1:0),h=t+(n?0:1);h<s;++h)e.add(h);else for(s=t+(n?1:0),h=i+(r?0:1);h<s;++h)e.add(h);u!==e.size&&this.onChange()},n.prototype.addAll=function(t){for(var n=this.In,i=n.size,r=0,e=t.length;r<e;++r)n.add(t[r]);i!==n.size&&this.onChange()},n.prototype.contains=function(t){return this.In.has(t)},n.prototype.remove=function(t){this.In.delete(t)&&this.onChange()},n.prototype.clear=function(){var t=this.In;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.In;n.has(t)&&1===n.size||(n.clear(),n.add(t),this.onChange())},n.prototype.clearAndAddAll=function(t){var n=this.In;if(0<n.size||0<t.length){n.clear();for(var i=0,r=t.length;i<r;++i)n.add(t[i]);this.onChange()}},n.prototype.shift=function(t,n){var i=[],r=this.In;if(r.forEach((function(n){t<=n&&i.push(n)})),0<i.length){for(var e=0,u=i.length;e<u;++e)r.delete(i[e]);for(e=0,u=i.length;e<u;++e)r.add(i[e]+n);this.onChange()}},n.prototype.size=function(){return this.In.size},n.prototype.isEmpty=function(){return 0===this.In.size},n.prototype.each=function(t){var n=!1;this.In.forEach((function(i){n||!1===t(i)&&(n=!0)}))},Object.defineProperty(n.prototype,"indices",{get:function(){var t=[];return this.In.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[],n=this.p;return this.In.forEach((function(i){t.push(n.get(i))})),t},enumerable:!1,configurable:!0}),n.prototype.toArray=function(){var t=[],n=this.p;return this.In.forEach((function(i){t.push([i,n.get(i)])})),t},n.prototype.toSortedArray=function(){return this.toArray().sort(Fp)},n.prototype.toObject=function(){var t={},n=this.p;return this.In.forEach((function(i){t[i]=n.get(i)})),t},n.prototype.toMap=function(){var t=new Map,n=this.p;return this.In.forEach((function(i){t.set(i,n.get(i))})),t},n}(t.utils.EventEmitter),Gp={ASCENDING:0,DESCENDING:1},Hp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.Al=-1,i.bb=!1,i.p=n,i.wb=null,i.pb=null,i.zt=Gp.ASCENDING,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return this.zt},set:function(t){this.zt=t},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.bb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.bb&&(this.bb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.bb},n.prototype.newSorted=function(){var t=this.wb;if(null!=t){for(var n=[],i=this.p.rows,r=0,e=i.length;r<e;++r)n.push(r);return n.sort(this.toComparator(i,t)),n}return null},n.prototype.toComparator=function(t,n){var i=this.zt;return wt(n)?i===Gp.ASCENDING?function(i,r){return n(t[i],t[r],i,r)}:function(i,r){return n(t[r],t[i],r,i)}:i===Gp.ASCENDING?function(i,r){return n.compare(t[i],t[r],i,r)}:function(i,r){return n.compare(t[r],t[i],r,i)}},n.prototype.get=function(){return this.wb},n.prototype.set=function(t){this.wb!==t&&(this.wb=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.Al&&(this.Al=this.R,this.bb?(this.pb=this.newSorted(),this.emit("change",this)):null!=this.pb&&(this.pb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.pb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),zp=function(n){function i(t){var i=n.call(this)||this;if(i.p=null,i.Ob=i.toRows(null==t?void 0:t.rows),i.nf=new Pp(i),i.tf=i.toSelection(null==t?void 0:t.selection),i.pf=new _p(i),i.Db=new Hp(i),t){var r=t.filter;r&&i.pf.set(r);var e=t.comparator;e&&i.Db.set(e);var u=t.on;if(u)for(var s in u){var h=u[s];h&&i.on(s,h)}}return i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:wt(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new Up(this,t)},i.prototype.bind=function(t){this.p=t},i.prototype.toRows=function(t){var n=[];if(null!=t)for(var i=0,r=t.length;i<r;++i)n.push(t[i]);return n},Object.defineProperty(i.prototype,"rows",{get:function(){return this.Ob},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this.p;t&&t.update()},i.prototype.lock=function(){var t=this.p;t&&t.lock()},i.prototype.unlock=function(){var t=this.p;t&&(t.unlock(!1),t.update())},i.prototype.size=function(){return this.Ob.length},i.prototype.clear=function(){var t=this.Ob;0<t.length&&(t.length=0,this.lock(),this.tf.clear(),this.Db.toDirty(),this.pf.toDirty(),this.unlock())},i.prototype.clearAndAdd=function(t){var n=this.Ob;n.length=0,n.push(t),this.lock(),this.tf.clear(),this.Db.toDirty(),this.pf.toDirty(),this.unlock()},i.prototype.clearAndAddAll=function(t){var n=this.Ob;n.length=0;for(var i=0,r=t.length;i<r;++i)n.push(t[i]);this.lock(),this.tf.clear(),this.Db.toDirty(),this.pf.toDirty(),this.unlock()},i.prototype.add=function(t,n){var i=this.Ob,r=this.tf,e=this.Db,u=this.pf;null==n?(i.push(t),this.lock(),e.toDirty(),u.toDirty(),this.unlock()):0<=n&&n<i.length&&(i.splice(n,0,t),this.lock(),r.shift(n,1),e.toDirty(),u.toDirty(),this.unlock())},i.prototype.addAll=function(t,n){var i=this.Ob,r=i.length,e=this.tf,u=this.Db,s=this.pf;if(null==n){for(var h=0,o=a=t.length;h<o;++h)i.push(t[h]);this.lock(),u.toDirty(),s.toDirty(),this.unlock()}else if(0<=n&&n<r){var a=t.length;for(h=0;h<a;++h)i.splice(n+h,0,t[h]);this.lock(),e.shift(n,a),u.toDirty(),s.toDirty(),this.unlock()}},i.prototype.get=function(t){var n=this.Ob;return 0<=t&&t<n.length?n[t]:null},i.prototype.set=function(t,n){var i=this.Ob;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.lock(),this.Db.toDirty(),this.pf.toDirty(),this.unlock(),r}return null},i.prototype.remove=function(t){var n=this.Ob;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.lock(),this.tf.remove(t),this.Db.toDirty(),this.pf.toDirty(),this.unlock(),i}return null},i.prototype.each=function(t,n,i){var r=this.Ob;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.pf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.Db},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),Vp=function(n){function i(t){var i,r=this;(r=n.call(this,t)||this).transform.position.y=null!==(i=t.offset)&&void 0!==i?i:0;var e=r.toData(t.data);r.Xt=e,e.bind(r);var u=r.theme,s=function(t,n,i){var r=n.columns||[],e=n.row;return null!=e?(null==e.height&&(e.height=t.getRowHeight()),void 0===e.columns&&(e.columns=r),null==e.frozen&&(e.frozen=n.frozen),void 0===e.selection?e.selection={type:i}:void 0===e.selection.type&&(e.selection.type=i)):e={columns:r,height:t.getRowHeight(),frozen:n.frozen,selection:{type:i}},e}(u,t,e.selection.type);return r.Eb=s,r.Mb=null!=s.height?s.height:u.getRowHeight(),r.fb=s.columns||[],r.Sb=0,r.Tb=0,r.jb=0,r.Nb=!1,r.Ib=!1,r.Cb=[],r.Ab=function(t,n,i,r,u){e.emit("change",t,n,i,r,u,e)},r.vb=new Map,r.Xt.emit("init",r.Xt),r}return _(i,n),i.prototype.toData=function(t){return this.isData(t)?t:new zp(t)},i.prototype.isData=function(t){return null!=t&&"mapped"in t},i.prototype.onResize=function(t,i,r,e){n.prototype.onResize.call(this,t,i,r,e),this.update()},Object.defineProperty(i.prototype,"selection",{get:function(){return this.Xt.selection},enumerable:!1,configurable:!0}),i.prototype.lock=function(){this.jb+=1,1===this.jb&&(this.Nb=!1,this.Ib=!1)},i.prototype.unlock=function(t){this.jb-=1,0===this.jb&&(t&&this.Nb&&this.update(this.Ib),this.Nb=!1,this.Ib=!1)},i.prototype.update=function(t){if(0<this.jb)return this.Nb=!0,void(t&&(this.Ib=!0));var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=this.children,e=i.height,u=this.Mb,s=this.Xt,h=s.mapped.size(),o=this.Sb,a=this.Tb,c=a-o,f=this.transform.position.y,l=f+h*u,v=Math.max(e,l),b=Math.max(e-v,n.position.y),d=-b/u,g=(e-(b+f))/u,m=Math.floor(d);m-=m%2==0?2:1;var w=Math.floor(g),p=(w+=(w-m)%2==1?3:2)-m;if(p<c&&c-2<=p&&(w=m+(p=c)),c<p){for(var O=c;O<p;++O){var D=o+O,E=this.newRow(D%2==0);this.addChild(E)}a=o+(c=p)}else if(p<c){for(O=c-1;p<=O;--O)this.removeChild(r[O]);a=o+(c=p)}this.Sb=m,this.Tb=w;var M=m-o,S=Math.abs(M),T=r.length;if(0<S&&S<T){var j=this.Cb;if(0<M){for(O=0;O<S;++O)j.push(this.resetRow(r[O]));for(O=S;O<T;++O)r[O-S]=r[O];for(O=0;O<S;++O)r[T-S+O]=j[O]}else{for(O=0;O<S;++O)j.push(this.resetRow(r[T-S+O]));for(O=T-S-1;0<=O;--O)r[O+S]=r[O];for(O=0;O<S;++O)r[O]=j[O]}j.length=0}var N=s.selection,I=N.type!==yp.NONE;for(s.mapped.each((function(n,i,e,s){var h=r[e-m];h.position.y=e*u;var o=h.state;o.lock(),o.set(Sp.SELECTABLE,I),o.set(ct.ACTIVE,N.contains(s)),o.remove(ct.DISABLED),o.unlock(),h.set(n,i,s,t)}),m,m+T),O=0;m+O<0&&O<T;++O)(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ct.DISABLED),A.removeAll(Sp.SELECTABLE,ct.ACTIVE),A.unlock(),C.unset();for(O=T-1;h<=m+O&&0<=O;--O){var C,A;(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ct.DISABLED),A.removeAll(Sp.SELECTABLE,ct.ACTIVE),A.unlock(),C.unset()}this.lock(),n.position.y=b,n.height=v,this.height=l,this.unlock(!1),this.emit("update",d,g,this)}}},i.prototype.resetRow=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];e instanceof hr&&(e.state.isPressed=!1)}return t},i.prototype.newRow=function(t){return new Bp(this.Ab,t,this.vb,this.Eb)},i.prototype.onParentMove=function(t,i,r,e){n.prototype.onParentMove.call(this,t,i,r,e),this.updateFrozenCellPosition(t)},i.prototype.updateFrozenCellPosition=function(t){var n=this.Eb.frozen;if(null!=n&&0<n)for(var i=this.children,r=0,e=i.length;r<e;++r)i[r].updateFrozenCellPosition(t)},i.prototype.getClippingRect=function(t,i){n.prototype.getClippingRect.call(this,t,i);var r=this.parent;if(r){var e=-r.transform.position.y;i.y+=e,i.height-=e}},i.prototype.scrollTo=function(t){var n=this.parent;if(null==n)return!1;var i=n.parent;if(null==i)return!1;var r=-1;return pt(t)?0<=t&&t<this.data.mapped.size()&&(r=t):this.data.mapped.each((function(n,i,e){return n!==t||(r=e,!1)})),!(r<0||(n.position.y=Math.max(Math.min(0,i.height-n.height),-r*this.Mb),st.update(this),0))},i.prototype.toRowIndexMapped=function(t){return 0<=this.parent.position.y+t.y?Math.floor(t.y/this.Mb):-1},i.prototype.toRow=function(t){var n=t-this.Sb,i=this.children;return 0<=n&&n<i.length?i[n]:null},i.prototype.toCell=function(t,n){for(var i=t.children,r=i.length,e=this.fb.length,u=0,s=Math.min(r,e);u<s;++u){var h=i[r-u-1],o=n.x-h.position.x;if(0<=o&&o<=h.width)return h}return null},i.prototype.onRowClick=function(t){if(this.state.isActionable){var n=i.WORK_ON_CLICK;n.copyFrom(t.data.global),this.toLocal(n,void 0,n,!1);var r=this.toRowIndexMapped(n);if(0<=r&&r<this.Xt.mapped.size()){var e=this.toRow(r);if(e){var u=this.toCell(e,n);if(u&&u.onRowSelect&&u.onRowSelect(t,n))return}this.onRowSelect(t,r)}}},i.prototype.onRowSelect=function(t,n){var i=this.Xt,r=i.selection,e=r.type===yp.SINGLE,u=!e,s=i.mapped.unmap(n),h=t.data.originalEvent,o=h.ctrlKey,a=h.shiftKey;if(e||r.isEmpty()||!u||!o&&!a)r.clearAndAdd(s);else if(o)r.toggle(s);else if(a){var c=r.last;if(null!=c){var f=i.sorter,l=i.filter,v=f.map(s),b=f.map(c);if(null!=v&&null!=b){var d=b+1,g=v+1;if(v<b&&(d=v,g=b),d<g){var m=[],w=l.indices,p=f.indices;if(w)if(p)for(var O=0,D=w.length;O<D;++O)d<=(E=w[O])&&E<g&&m.push(p[E]);else for(O=0,D=w.length;O<D;++O){var E;d<=(E=w[O])&&E<g&&m.push(E)}else if(p)for(O=d;O<g;++O)m.push(p[O]);else for(O=d;O<g;++O)m.push(O);r.addAll(m)}}}}},i.prototype.onDblClick=function(t,i){return n.prototype.onDblClick.call(this,t,i)},i.prototype.getType=function(){return"DTableBody"},Object.defineProperty(i.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),i.WORK_ON_CLICK=new t.Point,i}(hr),Wp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableCategoryCell"},n}(Nl),Xp=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=null!==(i=n.offset)&&void 0!==i?i:0;return r.vn=e,r.transform.position.y=e,r.initCells(n,r.fb,r.cb),r}return _(n,t),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.vn,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new Wp(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=i.cell;if(r){r.weight=n.weight,r.width=n.width;var e=r.text||{};return r.text=e,e.value=e.value||n.label,r}return{weight:n.weight,width:n.width,text:{value:n.label}}},n.prototype.getType=function(){return"DTableCategory"},n}(xp),Kp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.Al=-1,i.bb=!1,i.p=n,i.pf=null,i.mb=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.bb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.bb&&(this.bb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.bb},n.prototype.isFiltered=function(t,n,i){return wt(i)?i(t,n):i.test(t,n)},n.prototype.hasFiltered=function(t,n,i){for(var r=this.p.accessor,e=r.toChildren,u=r.hasChildren,s=0,h=n.length;s<h;++s){var o=n[s];if(this.isFiltered(o,-1,i))return!0;var a=e(o);if(u(o,a)&&this.hasFiltered(t,a,i))return!0}return!1},n.prototype.addAllToFiltered=function(t,n,i,r){for(var e=this.p.accessor,u=e.toChildren,s=e.hasChildren,h=0,o=n.length;h<o;++h){var a=n[h];i.push(r[0]),r[0]+=1;var c=u(a);s(a,c)&&t.isOpened(a)&&this.addAllToFiltered(t,c,i,r)}},n.prototype.newFilteredSub=function(t,n,i,r,e){for(var u=!1,s=this.p.accessor,h=s.toChildren,o=s.hasChildren,a=0,c=n.length;a<c;++a){var f=n[a],l=e[0];e[0]+=1;var v=this.isFiltered(f,l,i),b=h(f);if(o(f,b))if(t.isOpened(f))if(v)r.push(l),u=!0,this.addAllToFiltered(t,b,r,e);else{var d=r.length;this.newFilteredSub(t,b,i,r,e)&&(r.splice(d,0,l),u=!0)}else(v||this.hasFiltered(t,b,i))&&(r.push(l),u=!0);else v&&(r.push(l),u=!0)}return u},n.prototype.newFiltered=function(){var t=this.pf;if(null!=t){var n=[],i=this.p,r=i.nodes;return r&&this.newFilteredSub(i,r,t,n,[0]),n}return null},n.prototype.get=function(){return this.pf},n.prototype.set=function(t){this.pf!==t&&(this.pf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.Al&&(this.Al=this.R,this.bb?(this.mb=this.newFiltered(),this.emit("change",this)):null!=this.mb&&(this.mb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.mb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Yp=function(t){return t.parent},Jp=function(t){return t.children},Zp=function(t,n){return null!=n&&0<n.length},qp=function(t){null!=t?(this.toParent=t.toParent||Yp,this.toChildren=t.toChildren||Jp,this.hasChildren=t.hasChildren||Zp):(this.toParent=Yp,this.toChildren=Jp,this.hasChildren=Zp)},Qp=function(t,n){return t[0]-n[0]},$p=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).p=n,e.xt=Ai(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:yp.NONE,yp),e.Ob=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),n.prototype.onNodeChange=function(t){if(null!=t){var n=this.p.accessor,i=n.toChildren,r=n.hasChildren,e=this.Ob,u=this.newRows(t,i,r,e,new Set);e.size!==u.size&&(this.Ob=u,this.onChange())}else{var s=this.Ob;0<s.size&&(s.clear(),this.onChange())}},n.prototype.newRows=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];r.has(h)&&e.add(h);var o=n(h);i(h,o)&&this.newRows(o,n,i,r,e)}return e},Object.defineProperty(n.prototype,"indices",{get:function(){var t=this.Ob,n=[];return this.p.each((function(i,r){t.has(i)&&n.push(r)})),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[];return this.Ob.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.xt},enumerable:!1,configurable:!0}),n.prototype.getFirst=function(){var t=this.Ob;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},n.prototype.getLast=function(){var t=this.Ob;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},n.prototype.toIndex=function(t){var n=null;return this.p.each((function(i,r){return t!==i||(n=r,!1)})),n},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.getFirst();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.getLast();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)?i.delete(n):i.add(n),this.onChange()}},n.prototype.add=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)||(i.add(n),this.onChange())}},n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.Ob,u=e.size,s=this.p;t<i?s.each((function(t){e.add(t)}),t+(n?0:1),i+(r?1:0)):s.each((function(t){e.add(t)}),i+(r?0:1),t+(n?1:0)),u!==e.size&&this.onChange()},n.prototype.addAll=function(t){if(0<t.length){for(var n=this.Ob,i=this.p,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.contains=function(t){var n=this.p.get(t);return!!n&&this.Ob.has(n)},n.prototype.remove=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)&&(i.delete(n),this.onChange())}},n.prototype.clear=function(){var t=this.Ob;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)?1<i.size&&(i.clear(),i.add(n),this.onChange()):(i.clear(),i.add(n),this.onChange())}},n.prototype.clearAndAddAll=function(t){var n=this.Ob;if(0<n.size||0<t.length){n.clear();for(var i=this.p,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.shift=function(t,n){},n.prototype.size=function(){return this.Ob.size},n.prototype.isEmpty=function(){return this.Ob.size<=0},n.prototype.each=function(t){var n=this.Ob;this.p.each((function(i,r){return!n.has(i)||!1!==t(r)}))},n.prototype.toArray=function(){var t=this.Ob,n=[];return this.p.each((function(i,r){t.has(i)&&n.push([r,i])})),n},n.prototype.toSortedArray=function(){return this.toArray().sort(Qp)},n.prototype.toObject=function(){var t=this.Ob,n={};return this.p.each((function(i,r){t.has(i)&&(n[r]=i)})),n},n.prototype.toMap=function(){var t=this.Ob,n=new Map;return this.p.each((function(i,r){t.has(i)&&n.set(r,i)})),n},n}(t.utils.EventEmitter),tO=function(t){function n(){return t.call(this)||this}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return Gp.ASCENDING},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.apply=function(){},n.prototype.unapply=function(){},n.prototype.isApplied=function(){return!1},n.prototype.get=function(){return null},n.prototype.set=function(t){},n.prototype.toDirty=function(){},n.prototype.update=function(){},Object.defineProperty(n.prototype,"indices",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.map=function(t){return t},n.prototype.unmap=function(t){return t},n}(t.utils.EventEmitter),nO=function(n){function i(t){var i=n.call(this)||this;if(i.p=null,i.qc=i.toAccessor(t),i.nf=new Pp(i),i.Ob=[],i.Rb=!1,i.kb=[],i.Lb=new WeakMap,i.ai=!!(null==t?void 0:t.reverse),i.tf=i.toSelection(null==t?void 0:t.selection),i.pf=new Kp(i),i.Db=new tO,t){var r=t.filter;r&&i.pf.set(r);var e=t.on;if(e)for(var u in e){var s=e[u];s&&i.on(u,s)}}return i.nodes=null==t?void 0:t.nodes,i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:wt(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new $p(this,t)},i.prototype.toAccessor=function(t){return new qp(t)},i.prototype.bind=function(t){this.p=t},Object.defineProperty(i.prototype,"nodes",{get:function(){return this.yb},set:function(t){this.yb=t,this.Rb=!0,this.tf.onNodeChange(t),this.pf.toDirty(),this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rows",{get:function(){return this.Rb&&(this.Rb=!1,this.updateRows(this.yb)),this.Ob},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supplimentals",{get:function(){return this.kb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"accessor",{get:function(){return this.qc},enumerable:!1,configurable:!0}),i.prototype.updateRows=function(t){var n=this.Ob,i=this.kb,r=this.Lb;if(null!=t){var e=this.qc,u=this.newRows(t,0,0,n,i,r,this.ai,e.toChildren,e.hasChildren);u!==n.length&&(n.length=u,i.length=u)}else n.length=0,i.length=0},i.prototype.toSupplimental=function(t,n,i){return t<<2|(n?2:0)|(i?1:0)},i.prototype.newRows=function(t,n,i,r,e,u,s,h,o){for(var a=t.length,c=s?-1:1,f=s?a-1:0;0<=f&&f<a;f+=c){var l=t[f],v=h(l),b=u.has(l),d=this.toSupplimental(i,o(l,v),b);n<r.length?(r[n]=l,e[n]=d):(r.push(l),e.push(d)),n+=1,b&&v&&(n=this.newRows(v,n,i+1,r,e,u,s,h,o))}return n},i.prototype.update=function(t){var n=this.p;n&&n.update(t)},i.prototype.size=function(){return this.rows.length},i.prototype.get=function(t){var n=this.rows;return 0<=t&&t<n.length?n[t]:null},i.prototype.expand=function(t){var n=this.Lb;return!n.has(t)&&(n.set(t,1),this.Rb=!0,this.pf.toDirty(),this.update(!0),!0)},i.prototype.collapse=function(t){var n=this.Lb;return!!n.has(t)&&(n.delete(t),this.Rb=!0,this.pf.toDirty(),this.update(!0),!0)},i.prototype.isCollapsed=function(t){return!this.Lb.has(t)},i.prototype.isExpanded=function(t){return this.Lb.has(t)},i.prototype.toggle=function(t){return this.isExpanded(t)?this.collapse(t):this.expand(t)},i.prototype.open=function(t){return this.expand(t)},i.prototype.close=function(t){return this.collapse(t)},i.prototype.isOpened=function(t){return this.isExpanded(t)},i.prototype.each=function(t,n,i){var r=this.rows;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.pf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.Db},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),iO=function(){function t(t,n){var i,r,e;this.p=t,this.vs=null!==(i=null==n?void 0:n.enable)&&void 0!==i&&i,this.xb=null===(r=null==n?void 0:n.filterable)||void 0===r||r,this.Bb=null===(e=null==n?void 0:n.emittable)||void 0===e||e}return Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this.vs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFilterable",{get:function(){return this.xb},set:function(t){this.xb=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmittable",{get:function(){return this.Bb},set:function(t){this.Bb=t},enumerable:!1,configurable:!0}),t.prototype.newIteratee=function(t,n){var i=this.p,r=i.column,e=i.columnIndex;if(null!=r&&null!=e){var u=r.getter,s=r.setter;if(this.Bb){var h=t.data;return function(t,i){return u(t,e)!==n&&(s(t,e,n),h.emit("change",n,!n,t,i,e,h),!0)}}return function(t){return u(t,e)!==n&&(s(t,e,n),!0)}}return null},t.prototype.execute=function(t){var n,i=null===(n=this.p.header)||void 0===n?void 0:n.table;if(i){var r=this.newIteratee(i,t);if(r){var e=!1;this.xb?i.data.mapped.each((function(t,n,i,u){r(t,u)&&(e=!0)})):i.data.each((function(t,n){r(t,n)&&(e=!0)})),e&&i.body.update(!0)}}},t}(),rO=t.interaction.InteractionEvent,eO=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){null!=t?(this.jh=t.header,this.hb=t.column,this.sb=t.columnIndex,this.Pb=new iO(this,t.check)):this.Pb=new iO(this),n.prototype.init.call(this,t),this.initOnClick(t)},Object.defineProperty(i.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"header",{get:function(){return this.jh},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"check",{get:function(){return this.Pb},enumerable:!1,configurable:!0}),i.prototype.initOnClick=function(t){var n=this,i=this.hb;if(i){var r=i.sorting.enable,e=this.Pb.isEnabled;if(e||r){this.on(ir.tap,(function(t){n.onClick(t)}));var u=this.state;u.lock(),u.set(Sp.SORTABLE,r),u.set(Sp.CHECKABLE,e),u.unlock()}}},Object.defineProperty(i.prototype,"sorter",{get:function(){var t=this,n=this.Db;if(null==n){var i=this.jh;if(!i)return null;var r=i.table;if(!r)return null;n=r.data.sorter,this.Db=n,this.Fb=this.Fb||function(){t.onSorterChange()},n.on("change",this.Fb)}return n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comparator",{get:function(){var t=this.hb;return t&&t.sorting.comparator||null},enumerable:!1,configurable:!0}),i.prototype.onSorterChange=function(){var t=this.comparator;if(t){var n=this.Db;if(n){var i=Sp.SORTED_ASCENDING,r=Sp.SORTED_DESCENDING;n.isApplied()&&n.get()===t?n.order===Gp.ASCENDING?this.state.set(i,r):this.state.set(r,i):this.state.removeAll(i,r)}}},i.prototype.toClickPosition=function(n){var i=this.Ub||new t.Point;return this.Ub=i,n.data.getLocalPosition(this,i).x},i.prototype.isCheckClicked=function(t){if(t instanceof rO&&this.Pb.isEnabled){if(!this.isSortable)return!0;var n=this.mh[1];if(n&&null!=n.image){var i=this.toClickPosition(t),r=n.bound,e=n.margin.horizontal;return r.left-e<=i&&i<=r.right+e}}return!1},i.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},i.prototype.activate=function(t){this.onActivate(t)},i.prototype.onActivate=function(t){this.isCheckClicked(t)?(this.onToggleStart(),this.onToggleEnd()):(this.doSort(t),this.emit("active",this))},i.prototype.doSort=function(t){if(this.isSortable){var n=this.comparator;if(n){var i=this.sorter;i&&(i.get()===n?i.order===Gp.ASCENDING?(i.order=Gp.DESCENDING,i.apply()):(i.set(null),i.apply()):(i.set(n),i.order=Gp.ASCENDING,i.apply()))}}},Object.defineProperty(i.prototype,"isSortable",{get:function(){var t=this.hb;return!!t&&t.sorting.enable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isToggle",{get:function(){return this.Pb.isEnabled},enumerable:!1,configurable:!0}),i.prototype.toggle=function(){this.state.isActionable&&this.isToggle&&(this.onToggleStart(),this.onToggleEnd())},i.prototype.onToggleStart=function(){this.state.isActive=!this.state.isActive},i.prototype.onToggleEnd=function(){this.state.isActive?(this.Pb.execute(!0),this.emit("active",this)):(this.Pb.execute(!1),this.emit("inactive",this))},i.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.isToggle?this.onToggleStart():this.state.isPressed=!0)},i.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.isToggle?this.onToggleEnd():(this.state.isPressed&&this.activate(t),this.state.isPressed=!1))},i.prototype.onKeyDown=function(t){return nr.isActivateKey(t)&&this.onActivateKeyDown(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyUp=function(t){return nr.isActivateKey(t)&&this.onActivateKeyUp(t),n.prototype.onKeyUp.call(this,t)},i.prototype.getType=function(){return"DTableHeaderCell"},i.prototype.destroy=function(){var t=this.Db,i=this.Fb;t&&i&&t.off("change",i),this.Db=void 0,this.Fb=void 0,n.prototype.destroy.call(this)},i}(Nl),uO=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Gb=null!==(i=n.table)&&void 0!==i?i:null;var u=null!==(r=n.offset)&&void 0!==r?r:0;return e.vn=u,e.transform.position.y=u,e.initCells(n,e.fb,e.cb),e}return _(n,t),Object.defineProperty(n.prototype,"table",{get:function(){return this.Gb},enumerable:!1,configurable:!0}),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.vn,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new eO(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=n.header||i.cell;return null!=r?(void 0===r.weight&&(r.weight=n.weight),void 0===r.width&&(r.width=n.width),void 0===r.text?r.text={value:n.label}:void 0===r.text.value&&(r.text.value=n.label),void 0===r.header&&(r.header=this),void 0===r.column&&(r.column=n),void 0===r.columnIndex&&(r.columnIndex=t),r):{weight:n.weight,width:n.width,text:{value:n.label},header:this,column:n,columnIndex:t}},n.prototype.getType=function(){return"DTableHeader"},n}(xp),sO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getOffsetVerticalStart=function(t){return.5*t+this.p.body.position.y},n}(Hd),hO=function(t,n){return t[n]},oO=function(t,n,i){t[n]=i},aO=function(){return""},cO=function(){},fO=function(t){if(null!=t){var n=t.length;if(n<=1){var i=t[0];return function(t){return Object.prototype.hasOwnProperty.call(t,i)}}return function(i){for(var r=0;r<n;++r){var e=t[r];if(!(e in i))return!1;i=i[e]}return!0}}return function(t,n){return n<t.length}},lO=function(t,n){return Ot(t)?fO(n):null!=t&&t},vO=function(t,n){var i,r=t.editing,e=t.editable;return r?{enable:lO(null!==(i=r.enable)&&void 0!==i?i:e,n),formatter:r.formatter,unformatter:r.unformatter,validator:r.validator}:{enable:lO(e,n)}},bO=function(t,n){return function(i,r){var e=t(i,n),u=t(r,n);return e<u?-1:u<e?1:0}},dO=function(t,n,i){var r=i.sorting,e=i.sortable;return r?r.enable||e?{enable:!0,comparator:r.comparator||bO(t,n)}:{enable:!1}:e?{enable:!0,comparator:bO(t,n)}:{enable:!1}},gO=function(t){return null==t?void 0:t instanceof fw?t:new fw(t)},mO=function(t){return null==t?void 0:"open"in t?t:new tg(t)},wO=function(t){return t.value},pO=function(){},OO=function(t){return t?{getter:t.getter||wO,setter:t.setter||pO,menu:gO(t.menu),multiple:gO(t.multiple),dialog:mO(t.dialog),promise:t.promise}:{getter:wO,setter:pO}},DO=function(t){var n=t.state;return null!=n?Ot(n)||mt(n)?{initial:n,modifier:void 0}:{initial:void 0,modifier:n}:{initial:void 0,modifier:void 0}},EO=function(t,n){var i=t.renderable;return Ot(i)?fO(n):null==i||i},MO=function(t,n){var i,r=n.weight,e=n.width;null!=r?null!=e&&(e=void 0):null==e&&(r=1);var u=Ai(null!==(i=n.type)&&void 0!==i?i:vp.TEXT,vp),s=function(t,n){var i=t.align;if(null!=i)return Ot(i)?ns[i]:i;switch(n){case vp.TEXT:return ns.LEFT;case vp.REAL:case vp.INTEGER:return ns.RIGHT;case vp.BUTTON:case vp.INDEX:case vp.SELECT:case vp.ACTION:case vp.LINK:case vp.CHECK:case vp.CHECK_SINGLE:case vp.COLOR:return ns.CENTER;default:return ns.LEFT}}(n,u),h=n.label||"",o=function(t){return null!=t.path?t.path.split("."):null}(n),a=function(t,n,i){var r=t.getter;if(r)return r;switch(n){case vp.ACTION:case vp.LINK:return aO;default:return null==i?hO:function(t,n){if(t.length<=1){var i=t[0];return void 0===n?function(t){return t[i]}:function(t){return Object.prototype.hasOwnProperty.call(t,i)?t[i]:n}}return void 0===n?function(n){for(var i=0,r=t.length-1;i<r;++i)n=n[t[i]];return n[t[t.length-1]]}:function(i){for(var r=0,e=t.length-1;r<e;++r)i=i[t[r]];var u=t[t.length-1];return Object.prototype.hasOwnProperty.call(i,u)?i[u]:n}}(i,t.default)}}(n,u,o);return{weight:r,width:e,type:u,label:h,getter:a,setter:function(t,n,i){var r=t.setter;if(r)return r;switch(n){case vp.BUTTON:case vp.ACTION:case vp.LINK:return cO;default:return null==i?oO:function(t){if(t.length<=1){var n=t[0];return function(t,i,r){t[n]=r}}return function(n,i,r){for(var e=0,u=t.length-1;e<u;++e)n=n[t[e]]||{};n[t[t.length-1]]=r}}(i)}}(n,u,o),formatter:n.formatter,renderable:EO(n,o),align:s,state:DO(n),editing:vO(n,o),sorting:dO(a,t,n),header:n.header,body:n.body,selecting:OO(n.selecting),category:n.category,frozen:n.frozen,offset:0,link:n.link}},SO=function(t){function n(n){var i=t.call(this,n)||this,r=i.content;r.setWidth(i.toContentWidth(n));var e=i.body;r.addChild(e),e.data.selection.type!==yp.NONE&&i.on(ir.tap,(function(t){e.onRowClick(t)}));var u=i.header;u&&r.addChild(u);for(var s=i.categories,h=s.length-1;0<=h;--h)r.addChild(s[h]);return e.update(),i}return _(n,t),Object.defineProperty(n.prototype,"columns",{get:function(){var t=this.fb;if(null==t){var n=this.zn;t=n?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(MO(i,t[i]));return n}(n.columns):[],this.fb=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"frozen",{get:function(){var t=this.cb;return null==t&&(t=function(t){for(var n=t.length-1;0<=n;--n)if(!0===t[n].frozen)return n+1;return 0}(this.columns),this.cb=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"categories",{get:function(){var t=this.Hb;return null==t&&(t=this.newCategories(this.zn,this.columns,this.frozen),this.Hb=t),t},enumerable:!1,configurable:!0}),n.prototype.initContent=function(n){t.prototype.initContent.call(this,n),n.state.isFocusReverse=!0},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.body.update()},n.prototype.onResize=function(n,i,r,e){var u=this.scrollbar;u.lock();var s=this.body;s.lock(),t.prototype.onResize.call(this,n,i,r,e),s.update(),s.unlock(!0),u.unlock(!0)},n.prototype.getCategoryCount=function(t){for(var n=0,i=0,r=t.length;i<r;++i){var e=t[i].category;if(null!=e){var u=Ot(e)?1:e.length;n=Math.max(n,u)}}return n},n.prototype.toCategoryLabel=function(t,n){if(n)if(Ot(n)){if(0===t)return n}else if(t<n.length)return n[t]},n.prototype.isSameCategory=function(t,n,i){if(null!=n){if(null!=i){if(Ot(n))return Ot(i)?0<t||n===i:0<t?i.length<=t:1===i.length&&n===i[0];if(Ot(i))return 0<t?n.length<=t:1===n.length&&n[0]===i;if(n.length<=t&&i.length<=t)return!0;if(i.length===n.length){for(var r=t,e=n.length;r<e;++r)if(n[r]!==i[r])return!1;return!0}return!1}return Ot(n)?0<t:n.length<=t}return null==i||(Ot(i)?0<t:i.length<=t)},n.prototype.toCategoryColumns=function(t,n,i){for(var r=[],e=null,u=null,s=0,h=n.length;s<h;++s){var o=n[s];s!==i&&u&&e&&this.isSameCategory(t,e.category,o.category)?null!=u.weight&&null!=o.weight?u.weight+=o.weight:null!=u.width&&null!=o.width?u.width+=o.width:(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u)):(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u))}return r},n.prototype.toCategoryOptions=function(t,n,i,r,e){return n?(void 0===n.columns&&(n.columns=this.toCategoryColumns(t,i,r)),null==n.frozen&&(n.frozen=r),null==n.offset&&(n.offset=e),n):{columns:this.toCategoryColumns(t,i,r),frozen:r,offset:e}},n.prototype.newCategories=function(t,n,i){for(var r=[],e=0,u=this.getCategoryCount(n)-1;0<=u;--u){var s=new Xp(this.toCategoryOptions(u,null==t?void 0:t.category,n,i,e));r.push(s),e+=s.height}return r},n.prototype.onDblClick=function(n,i){var r=this.body.onDblClick(n,i);return t.prototype.onDblClick.call(this,n,i)||r},n.prototype.newScrollBar=function(t){var n=this;return new sO(this,t,(function(t){n.onScrollBarUpdate(t)}))},n.prototype.toContentWidth=function(t){var n=0,i=null==t?void 0:t.columns;if(i)for(var r=0,e=i.length;r<e;++r){var u=i[r].width;null!=u&&(n+=u)}return 0<n?function(t){return Math.max(t,n)}:"100%"},n.prototype.getHeaderOffset=function(){var t=this.zb;return null==t&&(t=this.newHeaderOffset(),this.zb=t),t},n.prototype.newHeaderOffset=function(){for(var t=0,n=this.categories,i=0,r=n.length;i<r;++i)t+=n[i].height;return t},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.jh;return void 0===t&&(t=this.newHeader(this.zn,this.columns,this.frozen,this.getHeaderOffset()),this.jh=t),t},enumerable:!1,configurable:!0}),n.prototype.hasHeader=function(t){if(t)for(var n=t.columns,i=0,r=n.length;i<r;++i)if(null!=n[i].label)return!0;return!1},n.prototype.newHeader=function(t,n,i,r){return this.hasHeader(t)?new uO(this.toHeaderOptions(null==t?void 0:t.header,n,i,r)):null},n.prototype.toHeaderOptions=function(t,n,i,r){return t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.table&&(t.table=this),t):{columns:n,frozen:i,offset:r,table:this}},n.prototype.getBodyOffset=function(){var t=this.Vb;return null==t&&(t=this.newBodyOffset(),this.Vb=t),t},n.prototype.newBodyOffset=function(){var t,n;return this.getHeaderOffset()+(null!==(n=null===(t=this.header)||void 0===t?void 0:t.height)&&void 0!==n?n:0)},Object.defineProperty(n.prototype,"body",{get:function(){var t=this.Ie;return null==t&&(t=this.newBody(this.zn,this.columns,this.frozen,this.getBodyOffset()),this.Ie=t),t},enumerable:!1,configurable:!0}),n.prototype.newBody=function(t,n,i,r){return new Vp(this.toBodyOptions(null==t?void 0:t.body,n,i,r,null==t?void 0:t.data))},n.prototype.toBodyOptions=function(t,n,i,r,e){return null!=t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.data&&void 0!==e&&(mt(e)?t.data={rows:e}:t.data=e),void 0===t.height&&void 0===t.weight&&(t.weight=1),t):mt(e)?{columns:n,frozen:i,offset:r,data:{rows:e},weight:1}:{columns:n,frozen:i,offset:r,data:e,weight:1}},Object.defineProperty(n.prototype,"data",{get:function(){return this.body.data},enumerable:!1,configurable:!0}),n.prototype.getFocusedChildClippingRect=function(n,i,r,e,u,s,h,o){t.prototype.getFocusedChildClippingRect.call(this,n,i,r,e,u,s,h,o);var a=this.toCell(n);if(a){var c=i+this.toFrozenCellX(a)-o.x;if(0<c&&(o.x+=c,o.width-=c),a.parent.parent===this.body){var f=this.getBodyOffset();o.y+=f,o.height-=f}}return o},n.prototype.toFrozenCellX=function(t){var n=this.frozen;if(0<n){var i=t.parent.children,r=i.indexOf(t);if(0<=r){var e=i.length;if(n<=e-1-r){var u=i[e-n];return u.position.x+u.width}}}return 0},n.prototype.onKeyDown=function(n){nr.moveFocusHorizontally(n,this);var i=nr.isArrowUpKey(n),r=nr.isArrowDownKey(n);return(i||r)&&this.onKeyDownArrowUpOrDown(n,r),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowUpOrDown=function(t,n){var i=st.getLayer(this);if(null==i)return!1;var r=i.getFocusController(),e=r.get();if(null==e)return!1;var u=this.toCell(e);if(null==u)return!1;var s=u.parent;if(null==s)return!1;var h=r.find(s,!1,!1,n,this);if(null==h)return!1;var o=this.toCell(h);if(null==o)return!1;var a=o.parent;if(null==a)return!1;var c=s.children.indexOf(u);if(c<0)return!1;var f=a.children[c];if(null==f||f===u||!("state"in f))return!1;var l=r.find(f,!0,!0,n,this);return null!=l&&(r.focus(l),!0)},n.prototype.toCell=function(t){for(var n=t;null!=n;){var i=n.parent;if(i instanceof xp)return n instanceof hr?n:null;n=i}return null},n.prototype.getType=function(){return"DTable"},n}(zd),TO=function(t){var n=t.text;if(Ot(n))return n;var i=t.label;if(Ot(i))return i;var r=t.name;return Ot(r)?r:void 0},jO=function(t){var n=t.title;if(Ot(n))return n},NO=function(t){return t.image},IO=function(t){return t.children},CO=function(t){return t.children=[]},AO=function(t){var n,i,r,e,u;this.toLabel=null!==(n=null==t?void 0:t.toLabel)&&void 0!==n?n:TO,this.toTitle=null!==(i=null==t?void 0:t.toTitle)&&void 0!==i?i:jO,this.toImage=null!==(r=null==t?void 0:t.toImage)&&void 0!==r?r:NO,this.toChildren=null!==(e=null==t?void 0:t.toChildren)&&void 0!==e?e:IO,this.newChildren=null!==(u=null==t?void 0:t.newChildren)&&void 0!==u?u:CO},RO={NONE:0,SINGLE:1,MULTIPLE:2},kO=function(){function t(t,n){this.p=t,this.yb=[],this.Wb=[],this.ai=n,this.En=!1}return Object.defineProperty(t.prototype,"nodes",{get:function(){return this.update(),this.yb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"levels",{get:function(){return this.update(),this.Wb},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.En=!0},t.prototype.size=function(){return this.update(),this.yb.length},t.prototype.each=function(t,n,i){this.update();for(var r=this.yb,e=null!=n?Math.max(0,n):0,u=null!=i?Math.min(r.length,i):r.length,s=e;s<u&&!1!==t(r[s],s);++s);},t.prototype.update=function(){if(this.En){this.En=!1;var t=this.p,n=t.nodes,i=t.accessor.toChildren,r=this.yb,e=this.Wb,u=this.newNodes(t,n,0,0,r,e,this.ai,i);r.length!==u&&(r.length=u,e.length=u)}},t.prototype.newNodes=function(t,n,i,r,e,u,s,h){for(var o=n.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=n[c];i<e.length?(e[i]=f,u[i]=r):(e.push(f),u.push(r)),i+=1;var l=h(f);l&&t.isExpanded(f)&&(i=this.newNodes(t,l,i,r+1,e,u,s,h))}return i},t}(),LO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n,r.yb=new Set;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return RO.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){var t=this.yb;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.yb;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.yb;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.yb;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.yb;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.yb;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.yb;return 0<t.size&&(t.clear(),this.onChange(),!0)},n.prototype.clearAndAdd=function(t){var n=this.yb;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.yb,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.yb=i,this.onChange()),n},n.prototype.contains=function(t){return this.yb.has(t)},n.prototype.size=function(){return this.yb.size},n.prototype.isEmpty=function(){return this.yb.size<=0},n.prototype.each=function(t){var n=!1;this.yb.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.yb.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.yb;if(0<n.size){var i=this.newNodes(t,n,new Set);n.size!==i.size&&(this.yb=i,this.onChange())}},n.prototype.newNodes=function(t,n,i){for(var r=this.p.accessor.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];n.has(s)&&i.add(s);var h=r(s);h&&this.newNodes(h,n,i)}return i},n}(t.utils.EventEmitter),yO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n,r.xn=null;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return RO.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.xn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.xn},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.xn:null},n.prototype.add=function(t){return this.xn!==t&&(this.xn=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.xn===t&&(this.xn=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.xn===t?this.xn=null:this.xn=t,this.onChange(),!0},n.prototype.clear=function(){return null!=this.xn&&(this.xn=null,this.onChange(),!0)},n.prototype.clearAndAdd=function(t){return this.xn!==t&&(this.xn=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){if(0<t.length){var n=t[t.length-1];return this.clearAndAdd(n)}return this.clear()},n.prototype.contains=function(t){return this.xn===t},n.prototype.size=function(){return null!=this.xn?1:0},n.prototype.isEmpty=function(){return null==this.xn},n.prototype.each=function(t){var n=this.xn;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.xn;return null!=t?[t]:[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.xn;if(null!=n){var i=this.newNode(t,n);n!==i&&(this.xn=i,this.onChange())}},n.prototype.newNode=function(t,n){for(var i=this.p.accessor.toChildren,r=0,e=t.length;r<e;++r){var u=t[r];if(n===u)return u;var s=i(u);if(s){var h=this.newNode(s,n);if(null!=h)return h}}return null},n}(t.utils.EventEmitter),xO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return RO.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){return!1},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onNodeChange=function(t){},n}(t.utils.EventEmitter),BO=function(){function t(t,n){this.p=t,this.Xb=new WeakMap,this.tf=this.toSelection(n),this.qc=new AO(n);var i=new kO(this,!!(null==n?void 0:n.reverse));this.nf=i;var r=null==n?void 0:n.nodes;null!=r?(this.yb=r,i.toDirty()):this.yb=[]}return t.prototype.toSelection=function(t){var n=null==t?void 0:t.selection;switch(null==n?void 0:n.type){case RO.NONE:case"NONE":return new xO(this,n);case RO.MULTIPLE:case"MULTIPLE":return new LO(this,n);default:return new yO(this,n)}},Object.defineProperty(t.prototype,"nodes",{get:function(){return this.yb},set:function(t){this.yb=t,this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.qc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),t.prototype.update=function(t){t&&(this.nf.toDirty(),this.tf.onNodeChange(this.yb)),this.p.update(t)},t.prototype.toggle=function(t){var n=this.Xb;return n.has(t)?n.delete(t):n.set(t,1),this.nf.toDirty(),this.update(),!0},t.prototype.expand=function(t){var n=this.Xb;return!n.has(t)&&(n.set(t,1),this.nf.toDirty(),this.update(),!0)},t.prototype.collapse=function(t){var n=this.Xb;return!!n.has(t)&&(n.delete(t),this.nf.toDirty(),this.update(),!0)},t.prototype.expandAll=function(){var t=!1,n=this.Xb;return this.each((function(i){n.has(i)||(n.set(i,1),t=!0)})),!!t&&(this.nf.toDirty(),this.update(),!0)},t.prototype.collapseAll=function(){var t=!1,n=this.Xb;return this.each((function(i){n.has(i)&&(n.delete(i),t=!0)})),!!t&&(this.nf.toDirty(),this.update(),!0)},t.prototype.isCollapsed=function(t){return!this.isExpanded(t)},t.prototype.isExpanded=function(t){return this.Xb.has(t)},t.prototype.clear=function(){var t=this.yb;return 0<t.length&&(t.length=0,this.nf.toDirty(),this.tf.clear(),this.update(),!0)},t.prototype.remove=function(t){var n=!1;return this.each((function(i,r,e){return i!==t||(e.splice(r,1),n=!0,!1)})),!!n&&(this.nf.toDirty(),this.tf.remove(t),this.update(),!0)},t.prototype.add=function(t,n){var i=!1;if(n){var r=this.qc,e=r.toChildren(n);if(e)e.push(t),i=!0;else{var u=r.newChildren(n);u&&(u.push(t),i=!0)}}else{var s=this.yb;s?s.push(t):this.yb=[t],i=!0}return i&&(this.nf.toDirty(),this.update()),!0},t.prototype.addBefore=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e,0,t),i=!0,!1)})),i&&(this.nf.toDirty(),this.update()),i},t.prototype.addAfter=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e+1,0,t),i=!0,!1)})),i&&(this.nf.toDirty(),this.update()),i},t.prototype.each=function(t){var n=this.yb;n&&this.Zc(n,null,t)},t.prototype.Zc=function(t,n,i){for(var r=this.qc.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];if(!1===i(s,e,t,n))return;var h=r(s);h&&this.Zc(h,s,i)}},t}(),_O={HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED"},PO=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Qn=new Pb(r.Qn),r.Xt=n,r}return _(n,t),Object.defineProperty(n.prototype,"node",{get:function(){return this.xn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.xn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.xn;void 0!==t&&this.Xt.toggle(t)},n.prototype.set=function(t,n,i){var r,e=this.Xt,u=i||this.xn!==t;if(u){this.xn=t,this.hu=n;var s=e.accessor;this.text=s.toLabel(t),this.title=null!==(r=s.toTitle(t))&&void 0!==r?r:"",this.image=s.toImage(t)}var h=e.mapped.levels[n];this.Qn.adjLeft(this.theme.getLevelPadding(h));var o=e.accessor.toChildren(t),a=!!(o&&0<o.length),c=this.state;c.lock(),c.set(ct.ACTIVE,e.selection.contains(t)),c.remove(ct.DISABLED),c.set(_O.HAS_CHILDREN,a),c.set(_O.OPENED,e.isExpanded(t)),c.unlock(),u&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.xn){this.xn=void 0,this.hu=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ct.DISABLED),t.remove(ct.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onSelect=function(t,n){var i=this.Xt,r=i.selection;if(r.type!==RO.MULTIPLE)r.clearAndAdd(n);else{var e=t&&"data"in t?t.data.originalEvent:t;if(null==e?void 0:e.ctrlKey)r.toggle(n);else if(null==e?void 0:e.shiftKey){var u=i.mapped,s=r.last;if(n===s)r.clearAndAdd(n);else{var h=!1,o=!1,a=[];u.each((function(t){if(h){if(o){if(a.unshift(t),t===n)return!1}else if(a.push(t),t===s)return!1}else t===n?(h=!0,o=!1,a.push(t)):t===s&&(h=!0,o=!0,a.push(t))})),r.clearAndAddAll(a)}}else r.clearAndAdd(n)}},n.prototype.onKeyDown=function(n){var i;return nr.isActivateKey(n)&&this.onKeyDownActivate(n),nr.isArrowRightKey(n)&&void 0!==(i=this.xn)&&this.state.is(_O.HAS_CHILDREN)&&this.Xt.expand(i),nr.isArrowLeftKey(n)&&void 0!==(i=this.xn)&&this.state.is(_O.HAS_CHILDREN)&&this.Xt.collapse(i),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){if(this.state.isActionable&&this.state.isFocused){var n=this.xn;return void 0!==n&&this.onSelect(t,n),!0}return!1},n.prototype.getType=function(){return"DTreeItemText"},n}(Ts),FO=function(t){function n(n,i){var r,e=this;return(e=t.call(this,n,i)||this).ph=Ai(null!==(r=null==i?void 0:i.when)&&void 0!==r?r:Qu.CLICKED,Qu),e.on(ir.tap,(function(t){e.onClick(t)})),e}return _(n,t),n.prototype.onClick=function(t){this.ph===Qu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.ph===Qu.DOUBLE_CLICKED&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.activate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTreeItemButton"},n}(PO),UO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(i){t.prototype.onActivate.call(this,i);var r=this.xn;void 0!==r&&(this.state.is(_O.HAS_CHILDREN)?i&&"data"in i&&(this.toLocal(i.data.global,void 0,n.WORK_CONTAINS_POINT).x<=this.padding.getLeft()?this.toggle():this.onSelect(i,r)):this.onSelect(i,r))},n.prototype.getType=function(){return"DTreeItemNonEditable"},n}(FO),GO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new UO(t)},n}(Dd),HO=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.gf;return null==t&&(t=this.newUpdater(this.data,this.content,this.zn),this.gf=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new GO(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Xt;return null==t&&(t=this.toData(this.zn),this.Xt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.nodes||t.value)||[];return mt(n)?new BO(this,{nodes:n}):"add"in n?n:new BO(this,n)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nodes",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),n.prototype.toggle=function(t){return this.data.toggle(t)},n.prototype.expand=function(t){return this.data.expand(t)},n.prototype.collapse=function(t){return this.data.collapse(t)},n.prototype.expandAll=function(){return this.data.expandAll()},n.prototype.collapseAll=function(){return this.data.collapseAll()},n.prototype.isCollapsed=function(t){return this.data.isCollapsed(t)},n.prototype.isExpanded=function(t){return this.data.isExpanded(t)},n.prototype.clear=function(){return this.data.clear()},n.prototype.remove=function(t){return this.data.remove(t)},n.prototype.add=function(t,n){return this.data.add(t,n)},n.prototype.addBefore=function(t,n){return this.data.addBefore(t,n)},n.prototype.addAfter=function(t,n){return this.data.addAfter(t,n)},n.prototype.each=function(t){return this.data.each(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!1),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DTree"},n}(zd),zO={__proto__:null,loadAll:Av,loadMenuItemAll:Cv,loadMenuItemExpandable:cv,loadMenuItem:$l,loadMenuSidedItemExpandable:Iv,loadMenuSidedItem:wv,deserializeActionValue:go,EShapeActionBases:fn,EShapeActionEnvironment:ln,EShapeActionExpressions:vn,EShapeActionOpenDialogExtensions:kh,EShapeActionOpenExtensions:xh,EShapeActionOpenOpeners:Ze,EShapeActionRuntimeBase:bn,EShapeActionRuntimeBlinkBrighten:mn,EShapeActionRuntimeBlinkColorFill:wn,EShapeActionRuntimeBlinkColorStroke:pn,EShapeActionRuntimeBlinkDarken:On,EShapeActionRuntimeBlinkOpacity:Dn,EShapeActionRuntimeBlinkVisibility:En,EShapeActionRuntimeBlink:gn,EShapeActionRuntimeChangeColorBrightness:_n,EShapeActionRuntimeChangeColorCode:Fn,EShapeActionRuntimeChangeColor:kn,EShapeActionRuntimeChangeCursor:Gn,EShapeActionRuntimeChangeTextNumber:Si,EShapeActionRuntimeChangeTextText:Ti,EShapeActionRuntimeConditional:dn,EShapeActionRuntimeEmitEvent:Qe,EShapeActionRuntimeGestureLayer:Ue,EShapeActionRuntimeGestureShape:He,EShapeActionRuntimeMiscEmitEvent:tu,EShapeActionRuntimeMiscExecute:Ru,EShapeActionRuntimeMiscHtmlElement:vu,EShapeActionRuntimeMiscInputInput:Ou,EShapeActionRuntimeMiscInputInteger:Eu,EShapeActionRuntimeMiscInputNumber:Du,EShapeActionRuntimeMiscInputReal:Mu,EShapeActionRuntimeMiscInputText:Tu,EShapeActionRuntimeMiscInput:pu,EShapeActionRuntimeMiscWriteBoth:Nu,EShapeActionRuntimeMiscWriteLocal:Iu,EShapeActionRuntimeMiscWriteRemote:Cu,EShapeActionRuntimeMiscWrite:ju,EShapeActionRuntimeOpenDialogBoolean:zs,EShapeActionRuntimeOpenDialogDate:Ch,EShapeActionRuntimeOpenDialogDatetime:Mh,EShapeActionRuntimeOpenDialogExtension:Lh,EShapeActionRuntimeOpenDialogInteger:Zs,EShapeActionRuntimeOpenDialogReal:$s,EShapeActionRuntimeOpenDialogText:ih,EShapeActionRuntimeOpenDialogTime:jh,EShapeActionRuntimeOpenDialog:Hs,EShapeActionRuntimeOpen:Lu,EShapeActionRuntimeShowHideLayer:Uh,EShapeActionRuntimeShowHideShape:Hh,EShapeActionRuntimeShowHide:Ph,EShapeActionRuntimeTransformMoveAbsoluteX:Wh,EShapeActionRuntimeTransformMoveAbsoluteY:Xh,EShapeActionRuntimeTransformMoveForwardOrBackward:Kh,EShapeActionRuntimeTransformMoveLeftOrRight:Yh,EShapeActionRuntimeTransformMoveRelativeX:Jh,EShapeActionRuntimeTransformMoveRelativeY:Zh,EShapeActionRuntimeTransformMove:Vh,EShapeActionRuntimeTransformResizeHeightAbsolute:ro,EShapeActionRuntimeTransformResizeHeightRelative:eo,EShapeActionRuntimeTransformResizeSizeAbsolute:uo,EShapeActionRuntimeTransformResizeSizeRelative:so,EShapeActionRuntimeTransformResizeWidthAbsolute:ho,EShapeActionRuntimeTransformResizeWidthRelative:oo,EShapeActionRuntimeTransformResize:io,EShapeActionRuntimeTransformRotateAbsolute:fo,EShapeActionRuntimeTransformRotateRelative:lo,EShapeActionRuntimeTransformRotate:co,EShapeActionRuntimes:Rv,EShapeActionValueBase:Sn,EShapeActionValueBlinkType:Mn,EShapeActionValueBlink:In,EShapeActionValueChangeColorBrightness:Pn,EShapeActionValueChangeColorCode:Un,EShapeActionValueChangeColorTarget:Rn,EShapeActionValueChangeColorTypeLegacy:yn,EShapeActionValueChangeColorType:Ln,EShapeActionValueChangeColorTypes:xn,EShapeActionValueChangeColor:Bn,EShapeActionValueChangeCursor:Hn,EShapeActionValueChangeTextType:ji,EShapeActionValueChangeText:Ni,EShapeActionValueDeserializers:mo,EShapeActionValueEmitEvent:$e,EShapeActionValueGestureOperationType:Pe,EShapeActionValueGestureType:ze,EShapeActionValueGesture:We,EShapeActionValueMiscEmitEvent:kv,EShapeActionValueMiscExecute:ku,EShapeActionValueMiscHtmlElement:Lv,EShapeActionValueMiscInput:yv,EShapeActionValueMiscType:Ve,EShapeActionValueMiscWrite:xv,EShapeActionValueMisc:Au,EShapeActionValueOnInputAction:mu,EShapeActionValueOnInputActions:wu,EShapeActionValueOpenDialogExtension:yh,EShapeActionValueOpenDialogType:Ah,EShapeActionValueOpenDialog:Rh,EShapeActionValueOpenExtension:Bh,EShapeActionValueOpenType:yu,EShapeActionValueOpen:xu,EShapeActionValueOpetyped:qh,EShapeActionValueShowHideLayer:Gh,EShapeActionValueShowHideShape:zh,EShapeActionValueShowHideType:_h,EShapeActionValueShowHide:Fh,EShapeActionValueSubtyped:Tn,EShapeActionValueTransformMoveType:Qh,EShapeActionValueTransformMove:to,EShapeActionValueTransformResizeType:no,EShapeActionValueTransformResize:ao,EShapeActionValueTransformRotateType:vo,EShapeActionValueTransformRotate:bo,EShapeActionValueTransformType:$h,EShapeActionValueType:jn,EShapeActionValues:Nn,EShapeAction:ht,EShapeActions:qe,loadShapeAll:jl,loadShapeBar:So,loadShapeButton:Wo,loadShapeCircle:ra,loadShapeClipperEx:function(){cu=!0},isShapeClipperExLoaded:fu,loadShapeConnectorElbow:ec,loadShapeConnectorLine:uc,loadShapeEmbedded:lc,loadShapeGroupShadowed:Ec,loadShapeGroup:wc,loadShapeImage:Nc,loadShapeLabel:zc,loadShapeLineOfCircles:mf,loadShapeLineOfRectangleRoundeds:Ef,loadShapeLineOfRectangles:Nf,loadShapeLineOfTriangleRoundeds:zf,loadShapeLineOfTriangles:Jf,loadShapeLine:Xc,loadShapeNull:$f,loadShapeRectangleRounded:el,loadShapeRectangle:nl,loadShapeSemicircle:ml,loadShapeTriangleRounded:Tl,loadShapeTriangle:Dl,BAR_VERTEX_COUNT:4,BAR_INDEX_COUNT:2,buildBarClipping:c,buildBarIndex:f,buildBarVertexStepAndColorFill:l,buildBarUv:v,CIRCLE_VERTEX_COUNT:9,CIRCLE_INDEX_COUNT:8,CIRCLE_WORLD_SIZE:Xo,buildCircleClipping:Yo,buildCircleIndex:Jo,buildCircleVertex:Zo,buildCircleStep:qo,buildCircleUv:Qo,buildColor:V,IMAGE_SDF_VERTEX_COUNT:9,IMAGE_SDF_INDEX_COUNT:8,IMAGE_SDF_WORLD_SIZE:Ic,buildImageSdfClipping:Ac,buildImageSdfIndex:Rc,buildImageSdfStep:kc,buildImageSdfVertex:Lc,buildImageSdfUv:yc,toLineOfAnyPointCount:qc,buildLineOfAnyColor:Qc,toPointsCount:ua,toLinePointCount:sa,toLineVertexCount:ha,toLineIndexCount:oa,buildLineClipping:aa,buildLineIndex:ca,buildLineUv:fa,buildLineVertexStepAndColorFill:la,buildNullClipping:Kc,buildNullIndex:function(t,n,i,r){for(var e=3*i,u=3*(i+r);e<u;e+=3)t[e+0]=n,t[e+1]=n,t[e+2]=n},buildNullVertex:Yc,buildNullStep:Jc,buildNullUv:Zc,RECTANGLE_ROUNDED_VERTEX_COUNT:jo,RECTANGLE_ROUNDED_INDEX_COUNT:24,RECTANGLE_ROUNDED_WORLD_SIZE:No,buildRectangleRoundedIndex:Co,buildRectangleRoundedVertex:Ao,buildRectangleRoundedClipping:Ro,buildRectangleRoundedStep:ko,buildRectangleRoundedUv:Lo,RECTANGLE_VERTEX_COUNT:ya,RECTANGLE_INDEX_COUNT:xa,RECTANGLE_WORLD_SIZE:Ba,buildRectangleClipping:Pa,buildRectangleIndex:Fa,buildRectangleVertex:Ua,buildRectangleStep:Ga,buildRectangleUv:za,SEMICIRCLE_VERTEX_COUNT:6,SEMICIRCLE_INDEX_COUNT:4,SEMICIRCLE_WORLD_SIZE:ul,buildSemicircleClipping:hl,buildSemicircleIndex:ol,buildSemicircleVertex:al,buildSemicircleStep:cl,buildSemicircleUv:fl,TEXT_VERTEX_COUNT:4,TEXT_INDEX_COUNT:2,TEXT_FMIN:D,toTextBufferCount:M,buildTextClipping:S,buildTextIndex:T,buildTextStep:j,buildTextVertex:I,TRIANGLE_ROUNDED_VERTEX_COUNT:If,TRIANGLE_ROUNDED_INDEX_COUNT:15,TRIANGLE_ROUNDED_WORLD_SIZE:Cf,buildTriangleRoundedIndex:Rf,buildTriangleRoundedVertex:kf,buildTriangleRoundedClipping:Lf,buildTriangleRoundedStep:yf,buildTriangleRoundedUv:xf,TRIANGLE_VERTEX_COUNT:7,TRIANGLE_INDEX_COUNT:3,TRIANGLE_WORLD_SIZE:pa,buildTriangleClipping:Da,buildTriangleIndex:Ea,buildTriangleVertex:Ma,buildTriangleStep:Sa,buildTriangleUv:Ta,BuilderBar:un,BuilderBase:W,BuilderCircle:$o,BuilderImageSdf:xc,BuilderLabel:Fc,BuilderLineOfAny:$c,BuilderLineOfCircles:lf,BuilderLineOfRectangleRoundeds:wf,BuilderLineOfRectangles:Mf,BuilderLineOfTriangleRoundeds:Bf,BuilderLineOfTriangles:Vf,BuilderLine:wa,BuilderMarkerCircleHead:Ra,BuilderMarkerCircleTail:ka,BuilderMarkerCircle:Aa,BuilderMarkerRectangleHead:Xa,BuilderMarkerRectangleTail:Wa,BuilderMarkerRectangle:Va,BuilderMarkerTriangleHead:Ia,BuilderMarkerTriangleTail:Ca,BuilderMarkerTriangle:Na,BuilderNull:La,BuilderRectanglePivoted:sc,BuilderRectangleRounded:yo,BuilderRectangle:Mc,BuilderSemicircle:ll,BuilderText:sn,BuilderTriangleRounded:El,BuilderTriangle:wl,toTransformLocalId:X,toTexture:K,toTextureTransformId:Y,toTextureUvs:J,copyClipping:tf,copyIndex:nf,copyStep:rf,copyUvs:ef,copyVertex:uf,createBarUploaded:hn,createButtonUploaded:Bo,createCircleUploaded:ta,createRectanglePivotedUploaded:hc,createGroupUploaded:oc,createImageSdfUploaded:Bc,createImageSdf:Bv,createImage:function(t){return Do(t).then((function(t){return new Tc(t)}))},createLabelUploaded:Uc,createLineOfAnyUploaded:vf,createLineOfCirclesUploaded:bf,createLineOfRectangleRoundedsUploaded:pf,createLineOfRectanglesUploaded:Sf,createLineOfTriangleRoundedsUploaded:_f,createLineOfTrianglesUploaded:Wf,createLineUploaded:qa,createLine:function(t,n,i,r){for(var e=Jr(t,[0,0,0,0]),u=.5*(e[2]+e[0]),s=.5*(e[3]+e[1]),h=e[2]-e[0],o=e[3]-e[1],a=[],c=0,f=t.length;c<f;c+=2)a.push(t[c]-u,t[c+1]-s);var l=new Vc;return l.stroke.set(!0,void 0,void 0,i),l.transform.position.set(u,s),l.size.set(h,o),l.points.set(a,n,r),l},createNullUploaded:Zf,createRectangleRoundedUploaded:xo,createRectangleUploaded:Sc,createSemicircleUploaded:vl,createTriangleRoundedUploaded:Ml,createTriangleUploaded:pl,deserializeAll:Fr,deserializeBar:Mo,deserializeBase:Eo,deserializeButton:Go,deserializeCircle:ia,deserializeConnectorElbow:tc,deserializeConnectorLine:ic,onDeserializedConnectorLine:rc,deserializeEmbedded:fc,deserializeEmbeddedLayer:Ke,deserializeGradient:po,deserializeGroupShadowed:Dc,deserializeGroup:mc,deserializeImageSdf:Pc,deserializeImage:jc,deserializeLabel:Hc,deserializeLineOfCircles:gf,deserializeLineOfRectangleRoundeds:Df,deserializeLineOfRectangles:jf,deserializeLineOfTriangleRoundeds:Hf,deserializeLineOfTriangles:Yf,deserializeLine:Wc,deserializeNull:Qf,deserializeRectanglePivoted:il,deserializeRectangleRounded:rl,deserializeRectangle:tl,deserializeSemicircle:gl,deserializeTriangleRounded:Sl,deserializeTriangle:Ol,deserialize:Pr,EShapeBarPoints:rt,EShapeBarPosition:it,EShapeBar:en,EShapeBaseHitTestData:jt,EShapeBase:Rt,EShapeButtonRuntimeActionToggle:zo,EShapeButtonRuntimeAction:Ho,EShapeButtonRuntime:Vo,EShapeButton:Uo,EShapeCircle:na,EShapeConnectorElbowPointsFiller:Qa,EShapeConnectorElbow:$a,EShapeConnectorLine:ve,EShapeEmbeddedDatum:Gr,EShapeEmbeddedLayerContainer:Ye,EShapeEmbeddedLayer:Be,EShapeEmbedded:Br,EShapeEmbeddeds:_v,EShapeFillImpl:$,EShapeGroupFillEditor:vc,EShapeGroupFillViewer:Lr,EShapeGroupPoints:bc,EShapeGroupShadowed:Oc,EShapeGroupSizeEditor:Rr,EShapeGroupSizeLayout:Ar,EShapeGroupSizeShadowed:pc,EShapeGroupSizeViewer:kr,EShapeGroupStrokeEditor:dc,EShapeGroupStrokeViewer:yr,EShapeGroupViewer:xr,EShapeGroup:gc,EShapeImageSdf:_c,EShapeImage:Tc,EShapeLabel:Gc,EShapeLineBaseHitPart:et,EShapeLineBase:rn,EShapeLineOfAnyPointsFillImpl:of,EShapeLineOfAnyPointsImpl:ff,EShapeLineOfAnyPointsPointImpl:af,EShapeLineOfAnyPointsStrokeImpl:cf,EShapeLineOfCircles:df,EShapeLineOfRectangleRoundeds:Of,EShapeLineOfRectangles:Tf,EShapeLineOfTriangleRoundeds:Gf,EShapeLineOfTriangles:Kf,EShapeLinePoints:fe,EShapeLine:Vc,EShapeNull:qf,EShapePrimitive:Jt,EShapeRectanglePivoted:ou,EShapeRectangleRounded:Fo,EShapeRectangle:hu,EShapeSemicircle:dl,EShapeStrokeImpl:kt,EShapeTextAlignImpl:Wt,EShapeTextImpl:Yt,EShapeTextOffsetImpl:Xt,EShapeTextOutlineImpl:Kt,EShapeTriangleRounded:Uf,EShapeTriangle:Xf,hitTestBBox:Nt,hitTestCircle:Zt,hitTestSemicircle:bl,hitTestRectangleRounded:Po,hitTestRectangle:Qt,hitTestTriangleRounded:Ff,hitTestTriangleFilled:$t,hitTestTriangle:tn,isStatic:sf,toComputed:hf,toDash:h,toGradientImageUrl:function(t){for(var n=t.direction,i=t.points,r="",e=0,u=i.length;e<u;++e){var s=i[e],h=an.toCode(s.color),o=s.alpha,a=100*s.position;r+='<stop offset="'.concat(a,'%" stop-color="#').concat(h,'" stop-opacity="').concat(o,'" />')}var c=n*Math.PI/180,f=.5*Math.cos(c),l=-.5*Math.sin(c);return Pv('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><defs>'+'<linearGradient id="o2glkm3aeu2oio" x1="'.concat(.5-f,'" x2="').concat(.5+f,'" y1="').concat(.5-l,'" y2="').concat(.5+l,'">')+r+'</linearGradient></defs><rect x="0" y="0" width="32" height="32" stroke="none" fill="url(#o2glkm3aeu2oio)" /></svg>')},toGradientSerialized:It,toImageElement:Do,toLength:O,toResized:function(t,n,i,r,e){var u=jr.contains(t,Ct.POSITION),s=jr.contains(t,Ct.WIDTH),h=jr.contains(t,Ct.HEIGHT);t.disallowUploadedUpdate();var o=t.transform.position;if(r){var a=Math.abs(i.x-n.x),c=Math.abs(i.y-n.y);if(e){var f=Math.max(a,c),l=Ir(f+f),v=Fv(n.x),b=Fv(n.y),d=t.size;s&&h?d.set(l,l):s?d.x=l:h&&(d.y=l),u&&o.set(v,b)}else{var g=Ir(a+a),m=Ir(c+c);v=Fv(n.x),b=Fv(n.y),d=t.size,s&&h?d.set(g,m):s?d.x=g:h&&(d.y=m),u&&o.set(v,b)}}else if(e){a=i.x-n.x,c=i.y-n.y,f=Math.max(Math.abs(a),Math.abs(c));var w=n.x+(a<0?-f:+f),p=n.y+(c<0?-f:+f),O=.5*f;l=Ir(f),v=Fv(Math.min(n.x,w)+O),b=Fv(Math.min(n.y,p)+O),d=t.size,s&&h?d.set(l,l):s?d.x=l:h&&(d.y=l),u&&o.set(v,b)}else{var D=Math.min(n.x,i.x),E=Math.min(n.y,i.y),M=.5*(a=Math.max(n.x,i.x)-D),S=.5*(c=Math.max(n.y,i.y)-E);g=Ir(a),m=Ir(c),v=Fv(D+M),b=Fv(E+S),d=t.size,s&&h?d.set(g,m):s?d.x=g:h&&(d.y=m),u&&o.set(v,b)}t.allowUploadedUpdate()},toScaleInvariant:o,toSizeNormalized:Ir,toSizeRounded:Fv,toThresholdDefault:nn,EShapeAcceptorImpl:Hr,EShapeAcceptorType:zr,EShapeAcceptors:Vr,EShapeBufferUnitBuilder:Ce,EShapeBufferUnit:Ie,EShapeBuffer:Ae,EShapeCapabilities:jr,EShapeCapabilityContainerImpl:At,EShapeCapability:Ct,EShapeConnectorBodies:nc,EShapeConnectorBodyImpl:le,EShapeConnectorContainerImpl:ot,EShapeConnectorEdgeAcceptorImpl:Wr,EShapeConnectorEdgeContainerImpl:Kr,EShapeConnectorEdgeImpl:Xr,EShapeConnectors:be,EShapeContainer:xe,EShapeCopyPart:at,EShapeCorner:ut,EShapeDataImpl:Vt,EShapeDataMapperImpl:Mr,EShapeDataMappingImpl:Gt,EShapeDataScopedImpl:Ht,EShapeDataSystemImpl:zt,EShapeDataValueExtensions:Uv,EShapeDataValueImpl:Ut,EShapeDataValueOrder:xt,EShapeDataValueRangeImpl:yt,EShapeDataValueRangeType:Lt,EShapeDataValueScope:_t,EShapeDataValueState:Pt,EShapeDataValueType:Bt,EShapeDefaults:q,EShapeDeleter:Hv,EShapeDeserializers:n,EShapeOnDeserializeds:i,EShapeEditor:Nr,EShapeLayerState:Xe,toPointsBoundary:Jr,eShapePointsFormatterCurve:ae,EShapePointsMarkerBase:Zr,EShapePointsMarkerContainerImplNoop:nt,EShapePointsMarkerContainerImpl:$r,EShapePointsMarkerHead:qr,EShapePointsMarkerNoop:tt,EShapePointsMarkerTail:Qr,EShapePointsMarkerType:Q,EShapePointsStyle:z,EShapePointsStyles:zv,EShapeRendererIteratorDatum:ke,EShapeRendererIterator:Le,EShapeRenderer:ye,EShapeResourceManagerDeserializationMode:Tr,EShapeResourceManagerDeserialization:Sr,EShapeResourceManagerSerialization:Vv,EShapeRuntimeImpl:su,EShapeRuntimeReset:cn,EShapeRuntimes:To,EShapeSearch:Gv,EShapeStateSetImplObservable:St,EShapeState:Mt,EShapeStrokeSide:qt,EShapeStrokeStyle:s,EShapeTextAlignHorizontal:m,EShapeTextAlignVertical:w,EShapeTextDirection:p,EShapeTextWeight:d,EShapeTextStyle:g,EShapeTransformImpl:Tt,EShapeTransforms:Cr,EShapeType:r,EShapeUploadedImpl:u,EShapeUploadeds:e,EShapeUuidMappingImpl:_r,ESnapperGrid:Wv,ESnapperResultScale:function(){this.distance=NaN,this.scale=new t.Point},ESnapperResult:Xv,ESnapperTargetValueType:Kv,ESnapperTargetValue:Yv,ESnapperTarget:Jv,ESnapperModifierAnchor:qv,ESnapper:Qv,DThemes:Z,FormatNodeA:zn,FormatNodea:Vn,FormatNodeD:Wn,FormatNoded:Xn,FormatNodee:Yn,FormatNodef:Jn,FormatNodefsi:Zn,FormatNodeg:qn,FormatNodeH:Qn,FormatNodeh:$n,FormatNodeM:ti,FormatNodem:ni,FormatNodemi:ii,FormatNodeP:ri,FormatNodep:ei,FormatNodePadding:ui,FormatNodeParenthesis:si,FormatNodePlus:hi,FormatNodePrecision:Kn,FormatNoderd:mi,FormatNodeRP:oi,FormatNoderp:ai,FormatNodesdt:ci,FormatNodeSpace:fi,FormatNodessi:li,FormatNodeString:vi,FormatNodeY:bi,FormatNodey:di,FormatNodez:gi,FormatNodes:wi,DynamicAtlasItemEmpty:ge,DynamicAtlasItemFontAtlas:pe,DynamicAtlasItemImage:Ne,DynamicAtlasItemText:$v,DynamicAtlasItemWhite:me,DynamicAtlasItem:de,DynamicAtlas:we,DynamicFontAtlasCharacterOrigin:De,DynamicFontAtlasCharacterType:Me,DynamicFontAtlasCharacter:Ee,DynamicFontAtlasFont:tb,DynamicFontAtlas:nb,DynamicFontAtlases:sb,DynamicSDFFontAtlas:Te,DynamicSDFFontAtlases:je,DynamicSDFFontGenerator:Se,isArray:mt,isFunction:wt,isNaN:Th,isNumber:pt,isObject:hb,isString:Ot,Lazy:ob,NumberFormatterImpl:Ei,NumberFormatters:Mi,toCeilingIndex:ab,toCloned:cb,toEnum:Ai,toIndexOf:Yr,toLabel:fb,toMerged:lb,toPadded:on,toString:function(t){return null!=t?String(t):""},toSvgTexture:function(n,i){return t.Texture.from(Pv(n),{resolution:i})},toSvgUrl:Pv,UtilAlpha:Cn,UtilSvgAtlasBuilder:vb,UtilAttachAlign:Bu,UtilAttach:_u,UtilCharacterIterator:b,UtilClickOutside:zu,UtilClipboard:Fl,UtilGestureData:lr,UtilGestureEasingHistory:dr,UtilGestureEasing:gr,UtilGestureMode:fr,UtilGestureModifier:ar,UtilGestureModifiers:cr,UtilGesture:mr,UtilExtract:gb,UtilExtractor:bb,UtilFileDownloader:db,UtilFileAs:mb,UtilFileOpener:wb,UtilFont:Es,UtilHsv:pb,UtilHtmlElementClipperExImpl:iu,UtilHtmlElementClipperExRectsImpl:ru,UtilHtmlElementWhen:eu,UtilHtmlElement:uu,UtilInputInput:du,UtilInputNumber:gu,UtilInputTextArea:Ob,UtilInputText:Su,UtilInput:bu,UtilKeyboardEvent:nr,UtilName:Db,UtilOverlay:Vu,UtilPointerEvent:ir,UtilRgb:an,UtilRgba:Eb,UtilStateBlinker:Mb,UtilTransition:Sb,UtilWheelEvent:Tb,DAlignHorizontal:ns,DAlignVertical:is,DAlignWith:rs,DAnimationBase:br,DAnimationEmpty:jb,DAnimationFadeIn:Nb,DAnimationTimings:vr,DApplicationLayerOptions:Cb,DApplicationLayer:xb,DApplicationPadding:Ib,DApplication:_b,DApplications:st,DBaseAutoSet:er,DBaseAuto:rr,DBaseBackgroundMeshGeometry:Fi,DBaseBackgroundMesh:Ui,DBaseBackgroundSnippet:Gi,DBaseBackground:Ii,DBaseBorderMeshGeometry:Hi,DBaseBorderMesh:zi,DBaseBorderSnippet:Vi,DBaseBorder:Ri,DBaseCorner:Li,DBaseInteractive:yi,DBaseMeshGeometry:Pi,DBaseOutlineSnippet:Wi,DBaseOutline:xi,DBaseOverflowMaskSimple:bs,DBaseOverflowMask:or,DBasePaddingAdjustable:Pb,DBasePadding:Bi,DBasePoint:_i,DBaseReflowableContainer:sr,DBaseReflowableImpl:Xi,DBaseSnippetContainer:ur,DBaseStateSetBlinkerDatumImpl:lt,DBaseStateSetBlinkerImpl:bt,DBaseStateSetImplObservable:Et,DBaseStateSetImpl:Dt,DBaseStateSetSubDatumImp:ft,DBaseStateSetSubImpl:vt,DBaseStateSetTickerDatumImpl:dt,DBaseStateSetTickerImpl:gt,DBaseState:ct,DBase:hr,DBoard:Fb,DBorderMask:Ci,DButtonAmbient:Rs,DButtonBaseWhen:Qu,DButtonBase:js,DButtonCheckRight:Gb,DButtonCheck:Ub,DButtonColorGradient:rd,DButtonColor:ud,DButtonDanger:sd,DButtonDate:hd,DButtonDatetime:fd,DButtonFileAs:mb,DButtonFile:ld,DButtonGroup:_s,DButtonLink:vd,DButtonPrimary:Is,DButtonRadioRight:dd,DButtonRadio:bd,DButtonRedo:gd,DButtonSecondary:md,DButtonSelect:rg,DButtonTime:eg,DButtonUndo:ug,DButton:Ns,DCanvasContainer:Dr,DCanvas:sg,DChartAxisBaseBar:og,DChartAxisBaseGuideContainer:ag,DChartAxisBaseOptionParser:fg,DChartAxisBaseTickContainer:gg,DChartAxisBaseTickMajorGridline:lg,DChartAxisBaseTickMajor:vg,DChartAxisBaseTickMinor:bg,DChartAxisBase:mg,DChartAxisContainerImpl:wg,DChartAxisGuideSimpleShapeImpl:pg,DChartAxisGuideSimple:Og,DChartAxisPosition:hg,DChartAxisTickPosition:cg,DChartAxisXDatetime:Eg,DChartAxisX:Dg,DChartAxisY:Mg,DChartColorSet1:function(t){return Sg[t%Sg.length]},DChartColorSet2:jg,DChartCoordinateBase:Ag,DChartCoordinateContainerImpl:kg,DChartCoordinateContainerSubImpl:Rg,DChartCoordinateDirection:Ng,DChartCoordinateLinearTick:Lg,DChartCoordinateLinear:yg,DChartCoordinateLogTick:xg,DChartCoordinateLog:Bg,DChartCoordinateTransformImpl:Ig,DChartCoordinateTransformMarkImpl:Cg,DChartLegendItem:_g,DChartLegend:Pg,DChartOverview:Fg,DChartPlotAreaContainer:Ug,DChartPlotAreaImpl:Qg,DChartRegionImplObservable:$g,DChartRegionImpl:dg,DChartSelectionContainerImpl:tm,DChartSelectionGridlineX:im,DChartSelectionGridlineY:rm,DChartSelectionMarker:em,DChartSelectionShapeBase:nm,DChartSelectionSimple:hm,DChartSelectionSubImpl:sm,DChartSelectionPoint:um,DChartSeriesBar:fm,DChartSeriesBaseCoordinateContainer:om,DChartSeriesBase:am,DChartSeriesContainerImpl:qg,DChartSeriesFillComputedImpl:Hg,DChartSeriesFillImpl:Vg,DChartSeriesLineOfAny:cm,DChartSeriesLineOfCircles:lm,DChartSeriesLineOfRectangleRoundeds:vm,DChartSeriesLineOfRectangles:bm,DChartSeriesLineOfTriangleRoundeds:gm,DChartSeriesLineOfTriangles:dm,DChartSeriesLine:mm,DChartSeriesExpressionParametersImpl:wm,DChartSeriesLinear:pm,DChartSeriesPaddingComputedImpl:Wg,DChartSeriesPaddingImpl:Xg,DChartSeriesPointComputedImpl:Kg,DChartSeriesPointImpl:Yg,DChartSeriesScalars:zg,DChartSeriesStrokeComputedImpl:Jg,DChartSeriesStrokeImpl:Zg,DChartSeriesHitResult:Gg,DChart:Om,DColorGradientObservable:Vb,DColorGradientPointObservable:Hb,DCommandBase:Ab,DCommandClear:Rb,DCommandCreate:Dm,DCommandSaveAs:Em,DCommandSave:Mm,DContent:Ld,DControllerCommandImpl:kb,DControllerFocusImpl:Bb,DControllerKeyboardImpl:Lb,DControllers:yb,DCornerMask:ki,DDiagramBaseControllerOpenType:Er,DDiagramBase:Tm,DDiagramCanvasBase:Rm,DDiagramCanvasBaseShapeImpl:km,DDiagramCanvasDataImpl:Lm,DDiagramCanvasEditorBackground:jm,DDiagramCanvasEditorShapeImpl:ym,DDiagramCanvasEditorSnap:xm,DDiagramCanvasEditor:Bm,DDiagramCanvasTileMappingImpl:Im,DDiagramCanvasTileMappingPointImpl:Nm,DDiagramCanvasShapeImpl:_m,DDiagramCanvasTickerImpl:Fm,DDiagramCanvasTile:Cm,DDiagramCanvas:Xm,DDiagramDataImpl:qm,DDiagramDataPrivateImpl:Km,DDiagramDataRemoteImpl:Jm,DDiagramEditorThumbnail:Qm,DDiagramEditor:$m,DDiagramLayerContainer:Am,DDiagramLayer:au,DDiagramLayers:_e,DDiagramSerializedVersion:1,DDiagramShape:tw,DDiagramSnapshot:Sm,DDiagramTicker:Pm,DDiagram:nw,DDiagrams:Je,DDialogAlign:Bu,DDialogCloseOn:Pu,DDialogColorGradient:id,DDialogColor:ed,DDialogConfirmDelete:ew,DDialogConfirmDiscard:uw,DDialogConfirmMessage:iw,DDialogConfirm:rw,DDialogDate:Ih,DDialogDatetime:Eh,DDialogFittedContent:rh,DDialogFitted:eh,DDialogGestureImpl:Uu,DDialogGestureMode:Fu,DDialogInputBoolean:Gs,DDialogInputInteger:Js,DDialogInputReal:Qs,DDialogInputText:nh,DDialogInput:Bs,DDialogLayeredContent:qu,DDialogLayeredFooter:As,DDialogLayeredHeaderButtonClose:ks,DDialogLayeredHeaderSeparator:Ls,DDialogLayeredHeader:ys,DDialogLayered:xs,DDialogMessage:sw,DDialogMode:Gu,DDialogProcessingMessage:hw,DDialogProcessing:ow,DDialogSaveAs:aw,DDialogSelectListItemUpdater:Md,DDialogSelectListItem:Od,DDialogSelectList:Wd,DDialogSelectSearhDismissableImpl:$d,DDialogSelectSearhImpl:Xd,DDialogSelect:tg,DDialogState:Hu,DDialogTime:Sh,DDialog:Wu,DDropdownBase:lw,DDropdown:vw,DDynamicTextGeometry:Os,DDynamicTextMeasureResultCharacter:ds,DDynamicTextMeasureResult:gs,DDynamicTextMeasure:ps,DDynamicTextStyleWordWrap:ms,DDynamicTextStyle:Ds,DDynamicText:Ms,DExpandableHeader:bw,DExpandable:dw,DHtmlElementState:nu,DHtmlElement:Vs,DImageBaseThemeWrapperSecondary:$u,DImageBaseThemeWrapperTertiary:ts,DImageBase:Ts,DImagePieceLayouterPartBottom:ss,DImagePieceLayouterPartCenter:hs,DImagePieceLayouterPartContainer:ls,DImagePieceLayouterPartLeft:os,DImagePieceLayouterPartMiddle:as,DImagePieceLayouterPartRight:cs,DImagePieceLayouterPartTop:fs,DImagePieceLayouterPart:us,DImagePieceLayouter:vs,DImagePiece:es,DImage:Nl,DInputAndLabel:Xb,DInputBooleanButtonOff:Ps,DInputBooleanButtonOn:Fs,DInputBoolean:Us,DInputInput:Xs,DInputIntegerAndLabel:gw,DInputInteger:Ys,DInputLabel:Wb,DInputNumber:Ks,DInputRealAndLabel:Kb,DInputReal:qs,DInputSearch:Kd,DInputTextAndLabel:Yb,DInputTextArea:mw,DInputText:th,DInput:Ws,DItemUpdater:Dd,DLayoutClearType:Ki,DLayoutDirection:Xu,DLayoutHorizontal:Cs,DLayoutSpace:Ku,DLayoutVertical:Zu,DLayout:Ju,DLinkMenuItemId:Ll,DLinkMenu:xl,DLinkTarget:Bl,DLink:Gl,DLinks:Hl,DListDataImpl:kd,DListDataMappedImpl:Sd,DListDataSelectionMultiple:Td,DListDataSelectionNone:jd,DListDataSelectionSingle:Nd,DListDataSelectionType:wd,DListItemAccessorImpl:Rd,DListItemAmbient:ww,DListItemUpdater:Ed,DListItem:pd,DList:Vd,DMapCoordinateEPSG3857:pw,DMapCoordinates:Ow,DMapTilePlane:Ew,DMapTilePyramidImpl:Mw,DMapTileUrlBuilderKokudo:function(t,n,i){return 5<=t?"https://cyberjapandata.gsi.go.jp/xyz/pale/".concat(t,"/").concat(n,"/").concat(i,".png"):2<=t?"https://cyberjapandata.gsi.go.jp/xyz/std/".concat(t,"/").concat(n,"/").concat(i,".png"):"https://cyberjapandata.gsi.go.jp/xyz/earthhillshade/".concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsm:function(t,n,i){return"https://".concat("abc"[(n+i)%3],".tile.openstreetmap.org/").concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsmfj:Sw,DMapTilePyramids:Tw,DMapTile:Dw,DMenuAlign:Bu,DMenuBarItem:jw,DMenuBar:Nw,DMenuContext:cw,DMenuItemBase:Il,DMenuItemCheckIsCompatible:kl,DMenuItemCheck:Rl,DMenuItemExpandableBody:tv,DMenuItemExpandableHeader:nv,DMenuItemExpandableIsCompatible:ev,DMenuItemExpandableItemCheck:uv,DMenuItemExpandableItemLink:sv,DMenuItemExpandableItemMenu:Mv,DMenuItemExpandableItemSeparator:hv,DMenuItemExpandableItemSpace:ov,DMenuItemExpandableItemText:av,DMenuItemExpandable:rv,DMenuItemExpandables:iv,DMenuItemLinkIsCompatible:Vl,DMenuItemLink:zl,DMenuItemMenuIsCompatible:Xl,DMenuItemMenuToSubMenuOptions:Kl,DMenuItemMenu:Wl,DMenuItemSeparatorReflowable:Yl,DMenuItemSeparatorIsCompatible:Jl,DMenuItemSeparator:Zl,DMenuItemSpaceIsCompatible:Ql,DMenuItemSpace:ql,DMenuItemText:Al,DMenuItem:Cl,DMenuSidedContent:Iw,DMenuSidedItemCheck:fv,DMenuSidedItemExpandableItemCheck:Dv,DMenuSidedItemExpandableItemLink:Ev,DMenuSidedItemExpandableItemMenu:Sv,DMenuSidedItemExpandableItemSeparator:Tv,DMenuSidedItemExpandableItemSpace:jv,DMenuSidedItemExpandableItemText:Nv,DMenuSidedItemExpandable:Ov,DMenuSidedItemExpandables:pv,DMenuSidedItemLink:lv,DMenuSidedItemMenu:vv,DMenuSidedItemSeparator:bv,DMenuSidedItemSpace:dv,DMenuSidedItemText:gv,DMenuSidedSelectionType:Cw,DMenuSidedSelection:Rw,DMenuSided:kw,DMenuSideds:mv,DMenu:fw,DMenus:yl,DNoteError:Lw,DNoteNoItemsFound:yw,DNoteSearching:xw,DNoteSmallError:Zd,DNoteSmallNoItemsFound:qd,DNoteSmallSearching:Qd,DNoteSmall:Jd,DNote:Yd,DNotification:Bw,DPaginationButtonLast:_w,DPaginationButtonNext:Pw,DPaginationButtonPage:Fw,DPaginationButtonPrevious:Uw,DPaginationButtonTop:Gw,DPaginationDots:Hw,DPaginationPage:zw,DPagination:Vw,DPaneScrollBar:Hd,DPane:zd,DPickerColorAndAlpha:Jb,DPickerColorGradientRecent:$b,DPickerColorGradientView:td,DPickerColorGradient:nd,DPickerColorRecent:Zb,DPickerColor:qb,DPickerDate:Nh,DPickerDates:od,DPickerDatetimeButtonBack:uh,DPickerDatetimeButtonDate:sh,DPickerDatetimeButtonNext:hh,DPickerDatetimeLabelDate:ch,DPickerDatetimeLabel:ah,DPickerDatetimeMask:lh,DPickerDatetimeMasks:vh,DPickerDatetimeRange:Ww,DPickerDatetimeSpace:fh,DPickerDatetime:Dh,DPickerDatetimes:cd,DPickerTimeBoundHours:dh,DPickerTimeBoundMinutes:gh,DPickerTimeBoundSeconds:mh,DPickerTimeBound:bh,DPickerTimeBounds:wh,DPickerTimeRange:Xw,DPickerTime:Oh,DPickerTimes:ad,DScalarExpressionNodeType:Yi,DScalarExpression:Ji,DScalarFunctions:tr,DScrollBarHorizontal:Pd,DScrollBarThumbHorizontal:_d,DScrollBarThumbReflowableHorizontal:Bd,DScrollBarThumbReflowableVertical:Fd,DScrollBarThumbVertical:Ud,DScrollBarThumb:xd,DScrollBarVertical:Gd,DScrollBar:yd,DSelectMultiple:Kw,DSelect:Yw,DShadowImpl:Jw,DSliderHorizontal:ip,DSliderLabel:Zw,DSliderThumb:qw,DSliderTrackHorizontal:np,DSliderTrackVertical:rp,DSliderTrack:tp,DSliderValue:Qw,DSliderVertical:ep,DSlider:$w,DTableBodyCellActionDialog:hp,DTableBodyCellActionMenu:op,DTableBodyCellActionPromise:cp,DTableBodyCellButton:lp,DTableBodyCellCheck:bp,DTableBodyCellColor:dp,DTableBodyCellDate:gp,DTableBodyCellDatetime:mp,DTableBodyCellIndex:wp,DTableBodyCellInputInteger:pp,DTableBodyCellInputReal:Op,DTableBodyCellInputText:Dp,DTableBodyCellInputTreeInput:Ep,DTableBodyCellInputTreeMarker:Mp,DTableBodyCellInputTree:Tp,toLinkOptions:jp,toUrl:Np,toChecker:Ip,DTableBodyCellLink:Cp,DTableBodyCellSelectDialog:sp,DTableBodyCellSelectMenu:Ap,DTableBodyCellSelectMultiple:Rp,DTableBodyCellSelectPromise:ap,DTableBodyCellText:fp,DTableBodyCellTime:kp,DTableBodyCellTree:Lp,DTableBodyCells:up,DTableBodyRow:Bp,DTableBody:Vp,DTableCategoryCell:Wp,DTableCategory:Xp,DTableColumnType:vp,DTableDataListFilter:_p,DTableDataListMapped:Pp,DTableDataListSelection:Up,DTableDataListSorter:Hp,DTableDataList:zp,DTableDataSelectionType:yp,DTableDataOrder:Gp,DTableDataTreeFilter:Kp,DTableDataTreeItemAccessor:qp,DTableDataTreeSelectionImpl:$p,DTableDataTreeSorter:tO,DTableDataTree:nO,DTableHeaderCellCheck:iO,DTableHeaderCell:eO,DTableHeader:uO,DTableRow:xp,DTableScrollBar:sO,DTableState:Sp,DTable:SO,DTextBase:Ss,DText:oh,DTreeDataImpl:BO,DTreeDataMappedImpl:kO,DTreeDataSelectionMultiple:LO,DTreeDataSelectionNone:xO,DTreeDataSelectionSingle:yO,DTreeDataSelectionType:RO,DTreeItemButton:FO,DTreeItemNonEditable:UO,DTreeItemState:_O,DTreeItemText:PO,DTreeItemUpdater:GO,DTreeNodeAccessorImpl:AO,DTree:HO,DViewGestureImpl:wr,DViewImpl:Or,DViewTransformImpl:pr};Av();var VO=window;VO.wcardinal=VO.wcardinal||{},VO.wcardinal.ui=zO}(PIXI);
9
+ !function(t){"use strict";var n={},i={},r={CIRCLE:0,RECTANGLE:1,RECTANGLE_ROUNDED:2,TRIANGLE:3,TRIANGLE_ROUNDED:4,LINE:5,IMAGE:6,IMAGE_SDF:7,GROUP:8,BAR:9,LABEL:10,NULL:11,GROUP_SHADOWED:12,LINE_OF_CIRCLES:13,LINE_OF_RECTANGLES:14,LINE_OF_RECTANGLE_ROUNDEDS:15,LINE_OF_TRIANGLES:16,LINE_OF_TRIANGLE_ROUNDEDS:17,EMBEDDED:18,EMBEDDED_LAYER:19,BUTTON:20,RECTANGLE_PIVOTED:21,CONNECTOR_LINE:22,CONNECTOR_ELBOW:23,SEMICIRCLE:24,EXTENSION:1e3},e={},u=function(){function t(t,n,i,r,e,u){this.buffer=t,this.i=u,this.u=n,this.h=i,this.o=r,this.l=e}return t.prototype.init=function(t){t.uploaded=this;for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].init(n);return this.update(t),this},t.prototype.update=function(t){for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].update(n,t)},t.prototype.isCompatible=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)if(!n[i].isCompatible(t))return!1;return!0},t.prototype.getBuffer=function(){return this.buffer},t.prototype.getVertexOffset=function(){return this.u},t.prototype.getVertexCount=function(){return this.o},t.prototype.getIndexOffset=function(){return this.h},t.prototype.getIndexCount=function(){return this.l},t.prototype.buildUnit=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)n[i].buildUnit(t)},t}(),s={NONE:0,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING:14,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896},h=function(t,n,i,r){return i&s.DOTTED_MASK?i&s.DOTTED?r.set(n,n):i&s.DOTTED_DENSELY?r.set(n,.5*n):r.set(n,2*n):i&s.DASHED_MASK?i&s.DASHED?r.set(2*n,n):i&s.DASHED_DENSELY?r.set(2*n,.5*n):r.set(2*n,2*n):r.set(2*t,0),r},o=function(t){var n=t&s.NON_EXPANDING_WIDTH?1:0,i=t&s.NON_SHRINKING_WIDTH?2:0;return t&(s.DOTTED_MASK||s.DASHED_MASK)?n|i|(t&s.NON_SCALING_DOT_AND_DASH?4:0):n|i},a=new t.Point,c=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5,t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5},f=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+2,t[++r]=n+1,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3},l=function(t,n,i,r,e,u,s,c,f){var l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty,w=e[0],p=e[1],O=l*w+b*p+g,D=v*w+d*p+m,E=e[2],M=e[3],S=l*E+b*M+g,T=v*E+d*M+m,j=S-O,N=T-D,I=Math.sqrt(j*j+N*N),C=I;if(0<=u&&1e-5<I){var A=u/I;S=O+(j*=A),T=D+(N*=A),C=u}var R=O-j,k=D-N,L=S+j,y=T+N,x=o(c),B=h(C,s,c,a),_=B.x,P=B.y,F=(r<<1)-1,U=(r<<2)-1,G=6*r-1;t[++F]=O,t[++F]=D,t[++F]=O,t[++F]=D,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=k,n[++G]=S,n[++G]=T,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=k,n[++G]=S,n[++G]=T,i[++U]=0,i[++U]=_,i[++U]=P,i[++U]=C,i[++U]=0,i[++U]=_,i[++U]=P,i[++U]=C,t[++F]=S,t[++F]=T,t[++F]=S,t[++F]=T,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=L,n[++G]=y,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=L,n[++G]=y,i[++U]=C,i[++U]=_,i[++U]=P,i[++U]=C,i[++U]=C,i[++U]=_,i[++U]=P,i[++U]=C},v=function(t,n,i){var r=(n<<1)-1;t[++r]=i.x0,t[++r]=i.y0,t[++r]=i.x3,t[++r]=i.y3,t[++r]=i.x1,t[++r]=i.y1,t[++r]=i.x2,t[++r]=i.y2},b=function(){function t(){this.target="",this.position=0}return t.prototype.init=function(t){this.target=t,this.position=0},t.prototype.hasNext=function(){return this.position<this.target.length},t.prototype.findNextBreak=function(t,n){for(var i=t.length,r=n;r<i;++r){var e=t.charCodeAt(r);if(!this.isLowSurrogate(e)&&!this.isVariationSelector(e))return r}return i},t.prototype.isHighSurrogate=function(t){return 55296<=t&&t<=56319},t.prototype.isLowSurrogate=function(t){return 56320<=t&&t<=57343},t.prototype.isVariationSelector=function(t){return 65024<=t&&t<=65039},t.prototype.next=function(){var t=this.target,n=this.position,i=this.findNextBreak(t,n+1),r=t.substring(n,i);return this.position=i,r},t.prototype.advance=function(t){var n=this.target,i=this.position,r=this.findNextBreak(n,i+1);return n.substring(i,r)!==t&&(this.position=r,!0)},t.prototype.close=function(){var t=this.target.length;return this.position<t&&(this.position=t,!0)},t.from=function(n){null==t.v&&(t.v=new t);var i=t.v;return i.init(n),i},t.v=null,t}(),d={NORMAL:0,BOLD:1},g={NORMAL:0,ITALIC:1},m={LEFT:0,CENTER:1,RIGHT:2,OUTSIDE_LEFT:3,OUTSIDE_RIGHT:4},w={TOP:0,MIDDLE:1,BOTTOM:2,OUTSIDE_TOP:3,OUTSIDE_BOTTOM:4},p={LEFT_TO_RIGHT:0,TOP_TO_BOTTOM:1,BOTTOM_TO_TOP:2,RIGHT_TO_LEFT:3},O=function(t,n,i,r){var e=i-t,u=r-n;return Math.sqrt(e*e+u*u)},D=1e-5,E=new t.Point,M=function(t){return 12*Math.ceil(t.text.value.length/12)},S=function(t,n,i){for(var r=3*n-1,e=3*(n+i)-1;r<e;)t[++r]=0,t[++r]=0,t[++r]=2},T=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s,t[++e]=s+1,t[++e]=s+3,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=4},j=function(t,n,i,r,e,u,h,a,c){var f=6*n-1,l=6*(n+i)-1,v=o(s.NONE);if(null!=r)for(var b=r.font.size/(e*(a+c)*.5),g=h===d.NORMAL?0:.05;f<l;)t[++f]=u,t[++f]=v,t[++f]=b,t[++f]=1,t[++f]=0,t[++f]=g;else for(;f<l;)t[++f]=0,t[++f]=v,t[++f]=0,t[++f]=1,t[++f]=0,t[++f]=0},N=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g,p,O,D,E){switch(t){case m.LEFT:switch(n){case w.TOP:E.x=o+g*(i+e)+O*(r+u),E.y=a+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i+e)+O*(r-.5*h),E.y=.5*(a+d)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i+e)+O*(r-u-h),E.y=d+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i+e)+O*(r-u-h),E.y=a+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i+e)+O*(r+u),E.y=d+p*(i+e)+D*(r+u)}break;case m.CENTER:switch(n){case w.TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r+u),E.y=.5*(a+f)+p*(i-.5*s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+l)+g*(i-.5*s)+O*(r-.5*h),E.y=.5*(a+v)+p*(i-.5*s)+D*(r-.5*h);break;case w.BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(d+v)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(a+f)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r+u),E.y=.5*(d+v)+p*(i-.5*s)+D*(r+u)}break;case m.RIGHT:switch(n){case w.TOP:E.x=c+g*(i-e-s)+O*(r+u),E.y=f+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(f+v)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i-e-s)+O*(r-u-h),E.y=v+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i-e-s)+O*(r-u-h),E.y=f+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i-e-s)+O*(r+u),E.y=v+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_LEFT:switch(n){case w.TOP:E.x=o+g*(i-e-s)+O*(r+u),E.y=a+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(a+d)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i-e-s)+O*(r-u-h),E.y=d+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i-e-s)+O*(r-u-h),E.y=a+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i-e-s)+O*(r+u),E.y=d+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_RIGHT:switch(n){case w.TOP:E.x=c+g*(i+e)+O*(r+u),E.y=f+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i+e)+O*(r-.5*h),E.y=.5*(f+v)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i+e)+O*(r-u-h),E.y=v+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i+e)+O*(r-u-h),E.y=f+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i+e)+O*(r+u),E.y=v+p*(i+e)+D*(r+u)}}},I=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,d,M,S,T,j,I,k,L,y,B,_,P){var F=.5*s,U=.5*h,G=P.a,H=P.b,z=P.c,V=P.d,W=P.tx,X=P.ty,K=e-F,Y=u-U,J=e+F,Z=u-U,q=e+F,Q=u+U,$=G*K+z*Y+W,tt=H*K+V*Y+X,nt=G*J+z*Z+W,it=H*J+V*Z+X,rt=G*q+z*Q+W,et=H*q+V*Q+X,ut=$+(rt-nt),st=tt+(et-it),ht=O($,tt,nt,it),ot=O(0,0,G,H),at=1,ct=0;if(D<ot){var ft=1/ot;at=G*ft,ct=H*ft}var lt=O($,tt,ut,st),vt=O(0,0,z,V),bt=0,dt=1;if(D<ot){var gt=1/vt;bt=z*gt,dt=V*gt}var mt=E;switch(j){case p.LEFT_TO_RIGHT:break;case p.TOP_TO_BOTTOM:mt.set(bt,dt),bt=-at,dt=-ct,at=mt.x,ct=mt.y,mt.x=vt,vt=ot,ot=mt.x;break;case p.BOTTOM_TO_TOP:mt.set(bt,dt),bt=at,dt=ct,at=-mt.x,ct=-mt.y,mt.x=vt,vt=ot,ot=mt.x;break;case p.RIGHT_TO_LEFT:at=-at,ct=-ct,bt=-bt,dt=-dt}for(var wt=0,pt=0,Ot=0,Dt=a*vt,Et=Math.max(0,a+T)*vt,Mt=0,St=1,Tt=o.characters,jt=b.from(c),Nt=0;jt.hasNext();)"\n"!==(vn=jt.next())?(0<Nt&&(Mt+=Math.max(0,Nt+S)),(dn=Tt[vn])?(Nt=dn.advance,Ot=dn.height):Nt=0):(Mt+=Nt,Nt=0,wt=Math.max(wt,Mt),Mt=0,pt+=Et,St+=1);if(Mt+=Nt,wt=Math.max(wt,Mt),pt+=Dt,Mt=0,y&&C(l,v)){var It=0,Ct=0;switch(j){case p.LEFT_TO_RIGHT:case p.RIGHT_TO_LEFT:It=Math.max(0,ht-2*I),Ct=Math.max(0,lt-2*k);break;case p.TOP_TO_BOTTOM:case p.BOTTOM_TO_TOP:It=Math.max(0,lt-2*k),Ct=Math.max(0,ht-2*I)}var At=wt*ot*(a/o.font.size),Rt=pt,kt=Math.min(1,Math.min(It/At,Ct/Rt));a*=kt,Dt*=kt,Et*=kt,pt*=kt}var Lt=a/o.font.size,yt=ot*Lt;wt*=yt,Ot*=vt*Lt;var xt=0,Bt=0,_t=NaN;switch(j){case p.LEFT_TO_RIGHT:N(l,v,d,M,I,k,wt,pt,$,tt,nt,it,rt,et,ut,st,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=ht-2*I);break;case p.TOP_TO_BOTTOM:N(function(t){switch(t){case w.TOP:return m.LEFT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.RIGHT;case w.OUTSIDE_TOP:return m.OUTSIDE_LEFT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_RIGHT}}(v),function(t){switch(t){case m.LEFT:return w.BOTTOM;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.TOP;case m.OUTSIDE_LEFT:return w.OUTSIDE_BOTTOM;case m.OUTSIDE_RIGHT:return w.OUTSIDE_TOP}}(l),M,d,k,I,wt,pt,nt,it,rt,et,ut,st,$,tt,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=lt-2*k);break;case p.BOTTOM_TO_TOP:N(function(t){switch(t){case w.TOP:return m.RIGHT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.LEFT;case w.OUTSIDE_TOP:return m.OUTSIDE_RIGHT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_LEFT}}(v),function(t){switch(t){case m.LEFT:return w.TOP;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.BOTTOM;case m.OUTSIDE_LEFT:return w.OUTSIDE_TOP;case m.OUTSIDE_RIGHT:return w.OUTSIDE_BOTTOM}}(l),M,d,k,I,wt,pt,ut,st,$,tt,nt,it,rt,et,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=lt-2*k);break;case p.RIGHT_TO_LEFT:N(function(t){switch(t){case m.LEFT:return m.RIGHT;case m.CENTER:return m.CENTER;case m.RIGHT:return m.LEFT;case m.OUTSIDE_LEFT:return m.OUTSIDE_RIGHT;case m.OUTSIDE_RIGHT:return m.OUTSIDE_LEFT}}(l),function(t){switch(t){case w.TOP:return w.BOTTOM;case w.MIDDLE:return w.MIDDLE;case w.BOTTOM:return w.TOP;case w.OUTSIDE_TOP:return w.OUTSIDE_BOTTOM;case w.OUTSIDE_BOTTOM:return w.OUTSIDE_TOP}}(v),d,M,I,k,wt,pt,rt,et,ut,st,$,tt,nt,it,at,ct,bt,dt,mt),xt=mt.x,Bt=mt.y,L&&C(l,v)&&(_t=ht-2*I)}if(_t<wt){var Pt=.5*(wt-_t);B[0]=xt+at*Pt,B[1]=Bt+ct*Pt,B[2]=at,B[3]=ct,B[4]=bt,B[5]=dt,B[6]=_t,B[7]=pt,B[8]=ot,B[9]=vt}else B[0]=xt,B[1]=Bt,B[2]=at,B[3]=ct,B[4]=bt,B[5]=dt,B[6]=wt,B[7]=pt,B[8]=ot,B[9]=vt;var Ft=_.x0,Ut=_.x1,Gt=_.x3,Ht=_.y0,zt=_.y1,Vt=_.y3,Wt=Ut-Ft,Xt=zt-Ht,Kt=Gt-Ft,Yt=Vt-Ht,Jt=Et*bt,Zt=Et*dt,qt=yt*at,Qt=yt*ct,$t=.5*(Ot-Dt),tn=$t*bt,nn=$t*dt,rn=f===g.NORMAL?0:.25*a,en=xt-tn+rn*qt,un=Bt-nn+rn*Qt,sn=xt+tn+Dt*bt,hn=Bt+nn+Dt*dt,on=en,an=un,cn=sn,fn=hn;Mt=0,Nt=0,jt.position=0,St=0;for(var ln=2*i;jt.hasNext();ln+=8){var vn;if("\n"!==(vn=jt.next())){var bn=Mt;0<Nt&&(Mt+=Math.max(0,Nt+S));var dn,gn=Mt*qt,mn=Mt*Qt;if(on=en+gn,an=un+mn,cn=sn+gn,fn=hn+mn,St+=1,dn=Tt[vn]){var wn=dn.advance;if(_t<(Mt+wn)*yt){var pn=Tt["..."];if(pn){if(1<St&&_t<(Mt+pn.advance)*yt){ln-=8,St-=1;var On=(Mt=bn)*qt,Dn=Mt*Qt;on=en+On,an=un+Dn,cn=sn+On,fn=hn+Dn}for(Nt=pn.advance,R(t,n,ln,pn,o,qt,Qt,on,an,cn,fn,Wt,Xt,Kt,Yt,Ft,Ht),ln+=8;;ln+=8){if(!jt.hasNext()||!jt.advance("\n")){ln-=8;break}A(t,n,ln,on,an,cn,fn,Ft,Ht,Gt,Vt),St+=1}}else Nt=wn,A(t,n,ln,on,an,cn,fn,Ft,Ht,Gt,Vt)}else Nt=wn,R(t,n,ln,dn,o,qt,Qt,on,an,cn,fn,Wt,Xt,Kt,Yt,Ft,Ht)}else Nt=0,A(t,n,ln,on,an,cn,fn,Ft,Ht,Gt,Vt)}else Mt+=Nt,Nt=0,A(t,n,ln,on=en+=Jt,an=un+=Zt,cn=sn+=Jt,fn=hn+=Zt,Ft,Ht,Gt,Vt),x(t,at,ct,St,ln,wt-Mt*yt,j,l,v),Mt=0,St=0}x(t,at,ct,St,ln,wt-(Mt+=Nt)*yt,j,l,v);for(var En=2*(i+r);ln<En;ln+=2)t[ln+0]=xt,t[ln+1]=Bt,n[ln+0]=Ft,n[ln+1]=Ht},C=function(t,n){switch(t){case m.LEFT:case m.CENTER:case m.RIGHT:switch(n){case w.TOP:case w.MIDDLE:case w.BOTTOM:return!0}}return!1},A=function(t,n,i,r,e,u,s,h,o,a,c){t[i+0]=r,t[i+1]=e,t[i+2]=r,t[i+3]=e,t[i+4]=u,t[i+5]=s,t[i+6]=u,t[i+7]=s,n[i+0]=h,n[i+1]=o,n[i+2]=h,n[i+3]=o,n[i+4]=a,n[i+5]=c,n[i+6]=a,n[i+7]=c},R=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=r.x-r.origin.x,w=r.width,p=m*u,O=m*s,D=(m+w)*u,E=(m+w)*s;t[i+0]=h+p,t[i+1]=o+O,t[i+2]=h+D,t[i+3]=o+E,t[i+4]=a+D,t[i+5]=c+E,t[i+6]=a+p,t[i+7]=c+O;var M=r.x/e.width,S=r.y/e.height,T=(r.x+r.width)/e.width,j=(r.y+r.height)/e.height,N=f*M,I=l*M,C=f*T,A=l*T,R=v*S,k=b*S,L=v*j,y=b*j;n[i+0]=d+N+R,n[i+1]=g+I+k,n[i+2]=d+C+R,n[i+3]=g+A+k,n[i+4]=d+C+L,n[i+5]=g+A+y,n[i+6]=d+N+L,n[i+7]=g+I+y},k=function(t,n,i,r,e){for(var u=n-8*i-1,s=0;s<i;++s)t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e},L=function(t,n,i,r,e,u){k(t,n,i,(r*=.5)*e,r*u)},y=function(t,n,i,r,e,u){k(t,n,i,r*e,r*u)},x=function(t,n,i,r,e,u,s,h,o){if(D<u)switch(s){case p.LEFT_TO_RIGHT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:break;case m.CENTER:L(t,e,r,u,n,i);break;case m.OUTSIDE_LEFT:case m.RIGHT:y(t,e,r,u,n,i)}break;case p.TOP_TO_BOTTOM:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:break;case w.MIDDLE:L(t,e,r,u,n,i);break;case w.OUTSIDE_TOP:case w.BOTTOM:y(t,e,r,u,n,i)}break;case p.BOTTOM_TO_TOP:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:y(t,e,r,u,n,i);break;case w.MIDDLE:L(t,e,r,u,n,i)}break;case p.RIGHT_TO_LEFT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:y(t,e,r,u,n,i);break;case m.CENTER:L(t,e,r,u,n,i)}}},B=function(t,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};function _(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}B(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var P,F,U,G,H,z={NONE:0,CLOSED:1,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896,CURVE:1024,FORMATTER_SHIFT:10,FORMATTER_MASK:1047552,FORMATTER_EXTENSION_LOWEST:512,FORMATTER_EXTENSION_HIGHEST:1023,FORMATTER_CURVE:1},V=function(t,n,i,r,e){for(var u=(t>>16&255)/255*n,s=(t>>8&255)/255*n,h=(t>>0&255)/255*n,o=n,a=(i<<2)-1,c=(i+r<<2)-1;a<c;)e[++a]=u,e[++a]=s,e[++a]=h,e[++a]=o},W=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=-1,this.strokeAlign=NaN,this.strokeWidth=NaN,this.strokeSide=NaN,this.strokeStyle=NaN,this.colorFill=NaN,this.alphaFill=-1,this.colorStroke=NaN,this.alphaStroke=-1,this.texture=null,this.textureTransformId=NaN}return n.prototype.isCompatible=function(t){return!0},n.prototype.updateColorFill=function(t,n){var i=n.fill,r=n.visible&&i.enable,e=i.color,u=r?i.alpha:0;e===this.colorFill&&u===this.alphaFill||(this.colorFill=e,this.alphaFill=u,t.updateColorFills(),V(e,u,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.stroke,r=n.visible&&i.enable&&0<i.width,e=i.color,u=r?i.alpha:0;e===this.colorStroke&&u===this.alphaStroke||(this.colorStroke=e,this.alphaStroke=u,t.updateColorStrokes(),V(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),X=function(t){return t.updateTransform(),t.transform.getLocalId()},K=function(n){return n.texture||t.Texture.WHITE},Y=function(t){var n=t;return null==n._uvs&&t.updateUvs(),n._updateID},J=function(t){return t._uvs},Z=function(){function t(){}return t.setDefaultThemeClass=function(t){this.DEFAULT_THEME_CLASS=t},t.getDefaultThemeClass=function(){return this.DEFAULT_THEME_CLASS},t.getInstance=function(){if(null==this.INSTANCE){var t=this.getDefaultThemeClass();if(null==t)throw new Error("No default theme class found");this.INSTANCE=new t}return this.INSTANCE},t.setInstance=function(t){var n=this.INSTANCE;return this.INSTANCE=t,n},t.get=function(t){return this.getInstance().get(t)},t.set=function(t,n){this.getInstance().set(t,n)},t.getClass=function(t){return this.getInstance().getClass(t)},t.setClass=function(t,n){this.getInstance().setClass(t,n)},t.getAtlas=function(){return this.getInstance().getAtlas()},t.DEFAULT_THEME_CLASS=null,t.INSTANCE=null,t}(),q=function(){function t(){}return Object.defineProperty(t,"THEME",{get:function(){var t=this.g;if(null!=t)return t;var n=Z.getInstance().get("EShape");return this.g=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_COLOR",{get:function(){return this.THEME.getFillColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_ALPHA",{get:function(){return this.THEME.getFillAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_COLOR",{get:function(){return this.THEME.getStrokeColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALPHA",{get:function(){return this.THEME.getStrokeAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_WIDTH",{get:function(){return this.THEME.getStrokeWidth()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALIGN",{get:function(){return this.THEME.getStrokeAlign()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_SIDE",{get:function(){return this.THEME.getStrokeSide()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_STYLE",{get:function(){return this.THEME.getStrokeStyle()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_VALUE",{get:function(){return this.THEME.getTextValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_COLOR",{get:function(){return this.THEME.getTextColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_ALPHA",{get:function(){return this.THEME.getTextAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_FAMILY",{get:function(){return this.THEME.getTextFamily()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_SIZE",{get:function(){return this.THEME.getTextSize()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"RADIUS",{get:function(){return this.THEME.getRadius()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_X",{get:function(){return this.THEME.getSizeX()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_Y",{get:function(){return this.THEME.getSizeY()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HIGHLIGHT_COLOR",{get:function(){return this.THEME.getHighlightColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"CURVE_SEGMENT_COUNT",{get:function(){return this.THEME.getCurveSegmentCount()},enumerable:!1,configurable:!0}),t}(),Q={NONE:0,CIRCLE:1,TRIANGLE:2,RECTANGLE:3},$=function(){function t(t,n,i,r){this.p=t,this.O=n,this.S=i,this.T=r}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha)},t.prototype.set=function(t,n,i){var r=!1;void 0!==t&&this.O!==t&&(this.O=t,r=!0),void 0!==n&&this.S!==n&&(this.S=n,r=!0),void 0!==i&&this.T!==i&&(this.T=i,r=!0),r&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T}},t.prototype.serialize=function(t){var n="[".concat(this.O?1:0,",").concat(this.S,",").concat(this.T,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getFill(t);if(null!=r)this.set(!!r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setFill(t,e),this.set(!!e[0],e[1],e[2])}}},t}(),tt=function(){function n(){}return n.prototype.lock=function(){return this},n.prototype.unlock=function(){return this},Object.defineProperty(n.prototype,"type",{get:function(){return Q.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var n=this.j;return null==n&&(n=new t.Point,this.j=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transform",{get:function(){var n=this.I;return null==n&&(n=new t.Matrix,this.I=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){var t=this.C;return null==t&&(t=new $(this,!0,q.FILL_COLOR,1),this.C=t),t},enumerable:!1,configurable:!0}),n.prototype.updateUploaded=function(){},n.prototype.copy=function(t){return this},n.prototype.set=function(t,n,i){return this},n.prototype.serialize=function(t){return-1},n.prototype.deserialize=function(t,n){},n}(),nt=function(){function t(){this.A=new tt}return t.prototype.lock=function(){return this},t.prototype.unlock=function(){return this},Object.defineProperty(t.prototype,"head",{get:function(){return this.A},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.A},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t.getInstance=function(){var n=this.INSTANCE;return null==n&&(n=new t,this.INSTANCE=n),n},t}(),it={TOP:0,LEFT:1,RIGHT:2,BOTTOM:3},rt=function(){function n(t){this.p=t,this.R=0,this.k=[0,0,0,0],this.L=[],this.B=z.NONE,this.j=-1,this._=it.TOP,this.P=NaN,this.F=NaN,this.U=NaN,this.G=NaN}return n.prototype.getComputedSize=function(t,n,i,r){if(0<=t)return t;switch(n){case it.TOP:case it.BOTTOM:return Math.abs(r);case it.RIGHT:case it.LEFT:return Math.abs(i)}return 0},n.prototype.update=function(){var t=this.p.size,n=t.x,i=t.y,r=this._,e=this.j;if(this.P!==e||this.F!==n||this.U!==i||this.G!==r){this.R+=1,this.P=e,this.F=n,this.U=i,this.G=r;var u=.5*n,s=.5*i,h=this.getComputedSize(e,r,n,i),o=this.k;switch(r){case it.TOP:o[0]=0,o[1]=-s,o[2]=0,o[3]=-s+h;break;case it.RIGHT:o[0]=u,o[1]=0,o[2]=u-h,o[3]=0;break;case it.BOTTOM:o[0]=0,o[1]=s,o[2]=0,o[3]=s-h;break;case it.LEFT:o[0]=-u,o[1]=0,o[2]=-u+h,o[3]=0}}},Object.defineProperty(n.prototype,"length",{get:function(){return 2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.update(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.update(),this.k},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){this.moveTo(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"position",{get:function(){return this._},set:function(t){this.moveTo(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.moveTo(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=nt.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return t instanceof n?this.moveTo(t.position,t.size,t.style):this.moveTo(void 0,void 0,t.style)},n.prototype.set=function(t,n,i){var r,e;if(null!=t){var u=t[0];if(0===u){var s=t[1];r=s<=0?it.TOP:it.BOTTOM,e=Math.abs(t[3]-s)}else r=u<=0?it.LEFT:it.RIGHT,e=Math.abs(t[2]-u)}return this.moveTo(r,e,i)},n.prototype.moveTo=function(t,n,i){var r=!1;return null!=i&&this.B!==i&&(this.B=i,r=!0),null!=t&&this._!==t&&(this._=t,r=!0),null!=n&&this.j!==n&&(this.j=n,r=!0),r&&this.p.updateUploaded(),this},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[".concat(this._,",").concat(this.j,",").concat(this.B,"]"))},n.prototype.deserialize=function(t,n){if(0<=t&&t<n.resources.length){var i=n.resources[t],r=JSON.parse(i);this.moveTo(r[0],r[1],r[2])}},n.prototype.calcHitPointAbs=function(t,n,i,r,e,u,s,h){if(2<=this.length){var o=this.k;if(s(t,n,o[0],o[1],o[2],o[3],0,e,h))return!0}return!1},n}(),et={NONE:0,LINE:1,MARKER_TAIL:2,MARKER_HEAD:3,TEXT:4,CHILDREN:5},ut={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},st=function(){function t(){}return t.add=function(n){t.INSTANCES.push(n)},t.first=function(){var n=t.INSTANCES;if(0<n.length)return n[0];throw new Error("No application found.")},t.last=function(){var n=t.INSTANCES;if(0<n.length)return n[n.length-1];throw new Error("No application found.")},t.get=function(n){var i=t.INSTANCES;return 0<=n&&n<i.length?i[n]:null},t.indexOf=function(n){return t.INSTANCES.indexOf(n)},t.size=function(){return t.INSTANCES.length},t.getStage=function(t){for(var n=t;n.parent;)n=n.parent;return"application"in n&&"layer"in n?n:null},t.find=function(t){var n=this.getStage(t);return n?n.layer.application:null},t.getLayerBase=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerBase():null},t.getLayerOverlay=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerOverlay():null},t.getLayer=function(t){var n=this.getStage(t);return n?n.layer:null},t.getResolution=function(t){var n,i=this.getLayer(t);return i?i.renderer.resolution:null!==(n=window.devicePixelRatio)&&void 0!==n?n:1},t.update=function(n){if(n){var i=this.getStage(n);i&&i.layer.update()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].update()},t.render=function(n){if(n){var i=this.getStage(n);i&&i.layer.render()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].render()},t.INSTANCES=[],t}(),ht=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if(n[i]===t)return i;for(i=0,r=n.length;i<r;++i)if(n[i].isEquals(t))return i;return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.serialize=function(t){for(var n=[],i=this.values,r=0,e=i.length;r<e;++r)n.push(i[r].serialize(t));return n},t}(),ot=function(){function t(t){this.p=t,this.V=new Set}return t.prototype.add=function(t){var n=this.V;return!n.has(t)&&(n.add(t),!0)},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.size=function(){return this.V.size},t.prototype.remove=function(t){return this.V.delete(t)},t.prototype.clear=function(){return 0<this.V.size&&(this.V.clear(),!0)},t.prototype.copy=function(t){var n=this.V;return n.clear(),t.each((function(t){n.add(t)})),this},t.prototype.each=function(t){return this.V.forEach(t),this},t.prototype.fit=function(t){this.V.forEach(this.toOnFitBound(t))},t.prototype.toOnFitBound=function(t){var n;return t?(null==(n=this.W)&&(n=this.newOnFitBound(!0),this.W=n),n):(null==(n=this.K)&&(n=this.newOnFitBound(!1),this.K=n),n)},t.prototype.newOnFitBound=function(t){var n=this;return function(i){n.onFit(i,t)}},t.prototype.onFit=function(t,n){t.fit(n)},t.prototype.attach=function(){var t=this.p;return this.V.forEach((function(n){n.set(t)})),this},t.prototype.detach=function(){return this.V.forEach((function(t){t.set(null)})),this},t}(),at={NONE:0,TRANSFORM:1,SIZE:2,STYLE:4,ACTION:8,POINTS:16,STATE:32,IMAGE:64,DATA:128,TAG:128,CONNECTOR:256,CAPABILITY:512,ALL:1023},ct={HOVERED:"HOVERED",ACTIVE:"ACTIVE",FOCUSED:"FOCUSED",UNFOCUSABLE:"UNFOCUSABLE",FOCUS_ROOT:"FOCUS_ROOT",FOCUS_REVERSE:"FOCUS_REVERSE",READ_ONLY:"READ_ONLY",DISABLED:"DISABLED",GESTURING:"GESTURING",PRESSED:"PRESSED",INVALID:"INVALID",SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",WARNED:"WARNED",CHANGED:"CHANGED",ALTERNATED:"ALTERNATED",NEW_WINDOW:"NEW_WINDOW"},ft=function(){function t(t){var n=this;this.J=new Map,this.Z=t,this.q=function(){return n.onTime()}}return Object.defineProperty(t.prototype,"interval",{get:function(){return this.Z},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.J,r=i.get(t);return null==r?((r=new Set).add(n),i.set(t,r),i.size<=1&&this.start()):r.add(n),this},t.prototype.remove=function(t,n){var i=this.J,r=i.get(t);return null!=r&&r.has(n)&&(r.delete(n),n.remove(t),r.size<=0&&i.delete(t),i.size<=0&&this.stop()),this},t.prototype.start=function(){return null==this.$&&this.onTime(),this},t.prototype.stop=function(){var t=this.$;return null!=t&&(clearTimeout(t),this.$=void 0),this},t.prototype.onTime=function(){var t=Date.now(),n=this.interval,i=this.newValue(t,n),r=this.newOn(t,n);this.J.forEach((function(t,n){t.forEach((function(t){t.set(n,i,r)}))})),this.$=window.setTimeout(this.q,Math.max(0,n-t%n))},t}(),lt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newValue=function(t,n){return null},n.prototype.newOn=function(t,n){return Math.round(t/n)%2==0},n}(ft),vt=function(){function t(t,n){this.p=t,this.tt=new Map,this.nt=n}return t.prototype.add=function(t,n){var i=this.tt,r=i.get(t);if(r===n)return this;if(null!=r){i.delete(t);var e=this.nt.get(r);null!=e&&e.remove(t,this.p)}i.set(t,n);var u=this.nt.get(n);return null==u&&(u=this.newDatum(n),this.nt.set(n,u)),u.add(t,this.p),this},t.prototype.remove=function(t){var n=this.tt.get(t);if(null==n)return this;this.tt.delete(t);var i=this.nt.get(n);return null==i||i.remove(t,this.p),this},t.prototype.set=function(t,n,i){return i?this.add(t,n):this.remove(t)},t.prototype.has=function(t){return this.tt.has(t)},t.prototype.clear=function(){var t=this,n=this.p,i=this.tt;return i.forEach((function(i,r){var e=t.nt.get(i);null!=e&&e.remove(r,n)})),i.clear(),this},t}(),bt=function(t){function n(n){return t.call(this,n,null!=P?P:P=new Map)||this}return _(n,t),n.prototype.newDatum=function(t){return new lt(t)},n}(vt),dt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newValue=function(t,n){return Math.round(t/n)},n.prototype.newOn=function(t,n){return!0},n}(ft),gt=function(t){function n(n){return t.call(this,n,null!=F?F:F=new Map)||this}return _(n,t),n.prototype.newDatum=function(t){return new dt(t)},n}(vt),mt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},wt=function(t){return"function"==typeof t},pt=function(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)},Ot=function(t){return"string"==typeof t||"[object String]"===Object.prototype.toString.call(t)},Dt=function(){function t(){this.it=new Map,this.p=null}return Object.defineProperty(t.prototype,"local",{get:function(){return this.it},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},set:function(t){this.p!==t&&(this.begin(),this.p=t,this.end())},enumerable:!1,configurable:!0}),t.prototype.onParentChange=function(t,n){this.p=n,this.begin(),this.p=t,this.end()},Object.defineProperty(t.prototype,"blinker",{get:function(){var t=this.rt;return null==t&&(t=this.newBlinker(),this.rt=t),t},enumerable:!1,configurable:!0}),t.prototype.newBlinker=function(){return new bt(this)},Object.defineProperty(t.prototype,"ticker",{get:function(){var t=this.et;return null==t&&(t=this.newTicker(),this.et=t),t},enumerable:!1,configurable:!0}),t.prototype.newTicker=function(){return new gt(this)},t.prototype.is=function(t,n){var i=this.it.get(t);return void 0!==i&&(void 0===n||n===i)},t.prototype.in=function(t,n){return this.is(t,n)||this.under(t,n)},t.prototype.on=function(t,n){var i=this.p;return null!=i&&i.is(t,n)},t.prototype.under=function(t,n){var i=this.p;return null!=i&&i.in(t,n)},t.prototype.lock=function(t){return this},t.prototype.unlock=function(){return this},t.prototype.begin=function(){return this},t.prototype.end=function(){return this},t.prototype.checkAdded=function(t,n){var i=this.it.get(t);return void 0===i||i!==n},t.prototype.add=function(t,n){return void 0===n&&(n=null),this.checkAdded(t,n)&&(this.begin(),this.it.set(t,n),this.end()),this},t.prototype.checkAddedsString=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i){var e=n.get(t[i]);if(void 0===e||null!==e)return!0}return!1},t.prototype.checkAddedsObject=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(e.state);if(void 0===u||u!==e.value)return!0}return!1},t.prototype.addAll=function(t){if(Ot(t))return this.addAllString(arguments);if(mt(t)){if(0<t.length){var n=t[0];return Ot(n)?this.addAllString(t):this.addAllObject(t)}return this}return this.addAllObject(arguments)},t.prototype.addAllString=function(t){if(this.checkAddedsString(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i)n.set(t[i],null);this.end()}return this},t.prototype.addAllObject=function(t){if(this.checkAddedsObject(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i){var e=t[i];n.set(e.state,e.value)}this.end()}return this},t.prototype.checkRemoved=function(t){return this.it.has(t)},t.prototype.remove=function(t){return this.checkRemoved(t)&&(this.begin(),this.it.delete(t),this.end()),this},t.prototype.checkRemovedsString=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i)if(n.has(t[i]))return!0;return!1},t.prototype.checkRemovedsObject=function(t){for(var n=this.it,i=0,r=t.length;i<r;++i)if(n.has(t[i].state))return!0;return!1},t.prototype.removeAll=function(t){if(wt(t))return this.removeAllMatcher(t);if(Ot(t))return this.removeAllString(arguments);if(mt(t)){if(0<t.length){var n=t[0];return Ot(n)?this.removeAllString(t):this.removeAllObject(t)}return this}return this.removeAllObject(arguments)},t.prototype.removeAllMatcher=function(t){var n=this,i=!1,r=this.it;return r.forEach((function(e,u){t(u)&&(i||(i=!0,n.begin()),r.delete(u))})),i&&this.end(),this},t.prototype.removeAllString=function(t){if(this.checkRemovedsString(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i)n.delete(t[i]);this.end()}return this},t.prototype.removeAllObject=function(t){if(this.checkRemovedsObject(t)){this.begin();for(var n=this.it,i=0,r=t.length;i<r;++i)n.delete(t[i].state);this.end()}return this},t.prototype.set=function(t,n,i){if(!0===n)null!=t&&this.add(t);else if(!1===n)null!=t&&this.remove(t);else{if(null!=n&&!pt(n))return this.doSet(t,null,n);if(!0===i)null!=t&&this.add(t,n);else{if(!1!==i)return this.doSet(t,n,i);null!=t&&this.remove(t)}}return this},t.prototype.doSet=function(t,n,i){return null!=t?null!=i?(this.checkAdded(t,n)||this.checkRemoved(i))&&(this.begin(),this.it.set(t,n).delete(i),this.end()):this.add(t,n):null!=i&&this.remove(i),this},t.prototype.setAll=function(t,n){if(!0===n)null!=t&&this.addAll(t);else if(!1===n)null!=t&&this.removeAll(t);else if(null!=t&&0<t.length){if(null!=n&&0<n.length){var i=t[0];return Ot(i)?this.setAllString(t,n):this.setAllObject(t,n)}this.addAll(t)}else null!=n&&this.removeAll(n);return this},t.prototype.setAllString=function(t,n){if(this.checkAddedsString(t)||this.checkRemovedsString(n)){this.begin();for(var i=this.it,r=0,e=t.length;r<e;++r)i.set(t[r],null);for(r=0,e=n.length;r<e;++r)i.delete(n[r]);this.end()}return this},t.prototype.setAllObject=function(t,n){if(this.checkAddedsObject(t)||this.checkRemovedsString(n)){this.begin();for(var i=this.it,r=0,e=t.length;r<e;++r){var u=t[r];i.set(u.state,u.value)}for(r=0,e=n.length;r<e;++r)i.delete(n[r]);this.end()}return this},t.prototype.clear=function(){var t=this.it;return 0<t.size&&(this.begin(),t.clear(),this.end()),this},t.prototype.valueOf=function(t,n){var i=this.it.get(t);if(void 0!==i)return i;var r=this.p;return null!=r?r.valueOf(t,n):n},t.prototype.each=function(t){return this.it.forEach((function(n,i){t(i,n)})),this},t.prototype.size=function(){return this.it.size},t.prototype.copy=function(n){if(n instanceof t){this.begin();var i=this.it;i.clear(),n.local.forEach((function(t,n){i.set(n,t)})),this.p=n.parent,this.end()}return this},Object.defineProperty(t.prototype,"isHovered",{get:function(){return this.is(ct.HOVERED)},set:function(t){this.set(ct.HOVERED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inHovered",{get:function(){return this.in(ct.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHovered",{get:function(){return this.on(ct.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underHovered",{get:function(){return this.under(ct.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this.is(ct.ACTIVE)},set:function(t){this.set(ct.ACTIVE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inActive",{get:function(){return this.in(ct.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onActive",{get:function(){return this.on(ct.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underActive",{get:function(){return this.under(ct.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPressed",{get:function(){return this.is(ct.PRESSED)},set:function(t){this.set(ct.PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inPressed",{get:function(){return this.in(ct.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onPressed",{get:function(){return this.on(ct.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underPressed",{get:function(){return this.under(ct.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return this.is(ct.READ_ONLY)},set:function(t){this.set(ct.READ_ONLY,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inReadOnly",{get:function(){return this.in(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onReadOnly",{get:function(){return this.on(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underReadOnly",{get:function(){return this.under(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return!this.is(ct.DISABLED)},set:function(t){this.set(ct.DISABLED,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inEnabled",{get:function(){return!this.in(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onEnabled",{get:function(){return!this.on(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underEnabled",{get:function(){return!this.under(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.is(ct.DISABLED)},set:function(t){this.set(ct.DISABLED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisabled",{get:function(){return this.in(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDisabled",{get:function(){return this.on(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underDisabled",{get:function(){return this.under(ct.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActionable",{get:function(){return!this.in(ct.DISABLED)&&!this.in(ct.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGesturing",{get:function(){return this.is(ct.GESTURING)},set:function(t){this.set(ct.GESTURING,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inGesturing",{get:function(){return this.in(ct.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onGesturing",{get:function(){return this.on(ct.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underGesturing",{get:function(){return this.under(ct.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocused",{get:function(){return this.is(ct.FOCUSED)},set:function(t){this.set(ct.FOCUSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocused",{get:function(){return this.in(ct.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocused",{get:function(){return this.on(ct.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocused",{get:function(){return this.under(ct.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusRoot",{get:function(){return this.is(ct.FOCUS_ROOT)},set:function(t){this.set(ct.FOCUS_ROOT,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusRoot",{get:function(){return this.in(ct.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusRoot",{get:function(){return this.on(ct.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusRoot",{get:function(){return this.under(ct.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusReverse",{get:function(){return this.is(ct.FOCUS_REVERSE)},set:function(t){this.set(ct.FOCUS_REVERSE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusReverse",{get:function(){return this.in(ct.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusReverse",{get:function(){return this.on(ct.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusReverse",{get:function(){return this.under(ct.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusable",{get:function(){return!this.is(ct.UNFOCUSABLE)},set:function(t){this.set(ct.UNFOCUSABLE,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusable",{get:function(){return!this.in(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusable",{get:function(){return!this.on(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusable",{get:function(){return!this.under(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUnfocusable",{get:function(){return this.is(ct.UNFOCUSABLE)},set:function(t){this.set(ct.UNFOCUSABLE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inUnfocusable",{get:function(){return this.in(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUnfocusable",{get:function(){return this.on(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underUnfocusable",{get:function(){return this.under(ct.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isInvalid",{get:function(){return this.is(ct.INVALID)},set:function(t){this.set(ct.INVALID,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inInvalid",{get:function(){return this.in(ct.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onInvalid",{get:function(){return this.on(ct.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underInvalid",{get:function(){return this.on(ct.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSucceeded",{get:function(){return this.is(ct.SUCCEEDED)},set:function(t){this.set(ct.SUCCEEDED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inSucceeded",{get:function(){return this.in(ct.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSucceeded",{get:function(){return this.on(ct.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underSucceeded",{get:function(){return this.under(ct.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFailed",{get:function(){return this.is(ct.FAILED)},set:function(t){this.set(ct.FAILED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFailed",{get:function(){return this.in(ct.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFailed",{get:function(){return this.on(ct.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFailed",{get:function(){return this.under(ct.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isWarned",{get:function(){return this.is(ct.WARNED)},set:function(t){this.set(ct.WARNED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inWarned",{get:function(){return this.in(ct.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onWarned",{get:function(){return this.on(ct.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underWarned",{get:function(){return this.on(ct.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.is(ct.CHANGED)},set:function(t){this.set(ct.CHANGED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inChanged",{get:function(){return this.in(ct.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onChanged",{get:function(){return this.on(ct.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underChanged",{get:function(){return this.on(ct.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlternated",{get:function(){return this.is(ct.ALTERNATED)},set:function(t){this.set(ct.ALTERNATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inAlternated",{get:function(){return this.in(ct.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAlternated",{get:function(){return this.on(ct.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underAlternated",{get:function(){return this.on(ct.ALTERNATED)},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){var t=[];return this.it.forEach((function(n,i){t.push(i)})),{local:t}},t.prototype.toString=function(){return JSON.stringify(this.toObject())},t}(),Et=function(t){function n(n){var i=t.call(this)||this;return i.ut=n,i.st=0,i.ht=!1,i.ot=!0,i}return _(n,t),n.prototype.lock=function(t){return this.st+=1,!1===t&&(this.ot=!1),this},n.prototype.unlock=function(){return this.st-=1,this.end()},Object.defineProperty(n.prototype,"saved",{get:function(){var t=this.ct;return null==t&&(t=new Dt,this.ct=t),t},enumerable:!1,configurable:!0}),n.prototype.begin=function(){return this.ot&&!this.ht&&(this.ht=!0,this.saved.copy(this)),this},n.prototype.end=function(){return this.st<=0&&(this.ot=!0,this.ht&&(this.ht=!1,this.onChange(this,this.saved))),this},n.prototype.onChange=function(t,n){this.ut(t,n)},n}(Dt),Mt={CLICKED:"CLICKED",DBL_CLICKED:"DBL_CLICKED",DOWN:"DOWN",UP:"UP",UP_OUTSIDE:"UP_OUTSIDE",RIGHT_CLICKED:"RIGHT_CLICKED",RIGHT_DOWN:"RIGHT_DOWN",RIGHT_UP:"RIGHT_UP",RIGHT_UP_OUTSIDE:"RIGHT_UP_OUTSIDE",RIGHT_PRESSED:"RIGHT_PRESSED",ACTIVATED:"ACTIVATED",DEACTIVATED:"DEACTIVATED"},St=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onChange=function(n,i){n.isActive?i.isActive||this.it.set(Mt.ACTIVATED,null).delete(Mt.DEACTIVATED):i.isActive&&this.it.set(Mt.DEACTIVATED,null).delete(Mt.ACTIVATED),t.prototype.onChange.call(this,n,i)},Object.defineProperty(n.prototype,"isClicked",{get:function(){return this.is(Mt.CLICKED)},set:function(t){this.set(Mt.CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inClicked",{get:function(){return this.in(Mt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onClicked",{get:function(){return this.on(Mt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underClicked",{get:function(){return this.under(Mt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDblClicked",{get:function(){return this.is(Mt.DBL_CLICKED)},set:function(t){this.set(Mt.DBL_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDblClicked",{get:function(){return this.in(Mt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDblClicked",{get:function(){return this.on(Mt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDblClicked",{get:function(){return this.under(Mt.DBL_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDown",{get:function(){return this.is(Mt.DOWN)},set:function(t){this.set(Mt.DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDown",{get:function(){return this.in(Mt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDown",{get:function(){return this.on(Mt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDown",{get:function(){return this.under(Mt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUp",{get:function(){return this.is(Mt.UP)},set:function(t){this.set(Mt.UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUp",{get:function(){return this.in(Mt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUp",{get:function(){return this.on(Mt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUp",{get:function(){return this.under(Mt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUpOutside",{get:function(){return this.is(Mt.UP_OUTSIDE)},set:function(t){this.set(Mt.UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUpOutside",{get:function(){return this.in(Mt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUpOutside",{get:function(){return this.on(Mt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUpOutside",{get:function(){return this.under(Mt.UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightClicked",{get:function(){return this.is(Mt.RIGHT_CLICKED)},set:function(t){this.set(Mt.RIGHT_CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightClicked",{get:function(){return this.in(Mt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightClicked",{get:function(){return this.on(Mt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightClicked",{get:function(){return this.under(Mt.RIGHT_CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightDown",{get:function(){return this.is(Mt.RIGHT_DOWN)},set:function(t){this.set(Mt.RIGHT_DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightDown",{get:function(){return this.in(Mt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightDown",{get:function(){return this.on(Mt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightDown",{get:function(){return this.under(Mt.RIGHT_DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUp",{get:function(){return this.is(Mt.RIGHT_UP)},set:function(t){this.set(Mt.RIGHT_UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUp",{get:function(){return this.in(Mt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUp",{get:function(){return this.on(Mt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUp",{get:function(){return this.under(Mt.RIGHT_UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightUpOutside",{get:function(){return this.is(Mt.RIGHT_UP_OUTSIDE)},set:function(t){this.set(Mt.RIGHT_UP_OUTSIDE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightUpOutside",{get:function(){return this.in(Mt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightUpOutside",{get:function(){return this.on(Mt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightUpOutside",{get:function(){return this.under(Mt.RIGHT_UP_OUTSIDE)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRightPressed",{get:function(){return this.is(Mt.RIGHT_PRESSED)},set:function(t){this.set(Mt.RIGHT_PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inRightPressed",{get:function(){return this.in(Mt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRightPressed",{get:function(){return this.on(Mt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underRightPressed",{get:function(){return this.under(Mt.RIGHT_PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isActivated",{get:function(){return this.is(Mt.ACTIVATED)},set:function(t){this.set(Mt.ACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inActivated",{get:function(){return this.in(Mt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onActivated",{get:function(){return this.on(Mt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underActivated",{get:function(){return this.under(Mt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDeactivated",{get:function(){return this.is(Mt.DEACTIVATED)},set:function(t){this.set(Mt.DEACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDeactivated",{get:function(){return this.in(Mt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDeactivated",{get:function(){return this.on(Mt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDeactivated",{get:function(){return this.under(Mt.DEACTIVATED)},enumerable:!1,configurable:!0}),n}(Et),Tt=function(n){function i(i){var r=n.call(this)||this;return r.internalTransform=new t.Matrix,r.p=i,r}return _(i,n),i.prototype.onChange=function(){n.prototype.onChange.call(this),this.p.onTransformChange()},i.prototype.updateSkew=function(){n.prototype.updateSkew.call(this),this.p.onTransformChange()},i.prototype.getLocalIdCurrent=function(){return this._currentLocalID},i.prototype.getLocalId=function(){return this._localID},i.prototype.getParentId=function(){return this._parentID},i.prototype.getWorldId=function(){return this._worldID},i.prototype.updateTransform=function(t){var r=this._currentLocalID,e=this._worldID;n.prototype.updateTransform.call(this,t);var u=this._currentLocalID,s=this._worldID;if(r!==u){var h=this.localTransform,o=this.internalTransform;h.copyTo(o),t instanceof i&&o.prepend(t.internalTransform)}else e!==s&&(h=this.localTransform,o=this.internalTransform,t instanceof i&&(h.copyTo(o).prepend(t.internalTransform),this._currentLocalID+=1,this._localID=this._currentLocalID))},i}(t.Transform),jt=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0,this.strokeWidth=0,this.strokeScale=1,this.strokeAlign=0}return t.prototype.set=function(t,n,i,r,e,u,s){return this.x=t,this.y=n,this.width=i,this.height=r,this.strokeWidth=e,this.strokeScale=u,this.strokeAlign=s,this},t}(),Nt=function(t,n,i,r){return-i<=t&&t<=+i&&-r<=n&&n<=+r},It=function(t){for(var n=t.points,i="[".concat(t.direction),r=0,e=n.length,u=1;r<e;r+=1,u+=3){var s=n[r];i+=",".concat(s.color,",").concat(s.alpha,",").concat(s.position)}return i+"]"},Ct={NONE:0,ID:1,POSITION:2,WIDTH:4,HEIGHT:8,ROTATION:16,SKEW:32,ALIGN:0,REPLACING:64,GROUPING:128,UNGROUPING:256,FILL:512,STROKE:1024,STROKE_SIDE:2048,BORDER_RADIUS:4096,TEXT:8192,TEXTURE:16384,TAG:32768,DATA:32768,DATA_MAPPING:1048576,ACTION:65536,CURSOR:131072,ORDER_IN_LAYER:262144,CHILDREN:524288,COORDINATE:62,SHAPE:1728,LAYER:262144,PRIMITIVE:1042175,GROUP:1042431,EMBEDDED:1417471,CONNECTOR:1041985,ALL:2097151},At=function(){function t(){this.added=Ct.NONE,this.removed=Ct.NONE,this.locked=Ct.NONE}return t.prototype.add=function(t){return this.removed&=~t,this.added|=t,this},t.prototype.remove=function(t){return this.added&=~t,this.removed|=t,this},t.prototype.lock=function(t){return this.locked|=t,this},t.prototype.unlock=function(t){return this.locked&=~t,this},t.prototype.clear=function(){return this.added=Ct.NONE,this.removed=Ct.NONE,this.locked=Ct.NONE,this},t.prototype.set=function(t,n,i){return null!=t&&(this.added=t),null!=n&&(this.removed=n),null!=i&&(this.locked=i),this},t.prototype.copy=function(t){return this.added=t.added,this.removed=t.removed,this.locked=t.locked,this},t}(),Rt=function(n){function i(t){var i=n.call(this)||this;return i.id="",i.uuid=0,i.type=t,i.transform=i.newTransform(),i.ft=0,i.lt=!1,i.action=new ht,i.vt=!0,i.bt=0,i.gt=!1,i.wt=!1,i.Ot=NaN,i.Dt=NaN,i.Et=NaN,i.interactive=!1,i.parent=null,i.children=[],i.selected=!1,i.index=0,i.reference=0,i}return _(i,n),i.prototype.newTransform=function(){return new Tt(this)},i.prototype.onSizeChange=function(){this.Ot=NaN,this.Dt=NaN,this.Et=NaN,this.Mt(),this.updateUploaded();var t=this.St;null!=t&&t.fit(!0);var n=this.runtime;null!=n&&n.onResize(this)},i.prototype.onTransformChange=function(){this.Mt(),this.onParentTransformChange()},i.prototype.onParentTransformChange=function(){this.updateUploaded();var t=this.St;null!=t&&t.fit(!0);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onParentTransformChange()},i.prototype.Mt=function(){if(0===this.ft){var t=this.parent;null!=t&&t.onChildTransformChange()}else this.lt=!0},i.prototype.disallowOnTransformChange=function(){this.ft+=1,1===this.ft&&(this.lt=!1)},i.prototype.allowOnTransformChange=function(t){this.ft-=1,0===this.ft&&this.lt&&(this.lt=!1,t&&this.onTransformChange())},i.prototype.onChildTransformChange=function(){},i.prototype.disallowUploadedUpdate=function(){this.bt+=1,1===this.bt&&(this.gt=!1,this.wt=!1)},i.prototype.allowUploadedUpdate=function(){this.bt-=1,0===this.bt&&(this.wt?(this.wt=!1,this.gt=!1,this.updateUploadedRecursively()):this.gt&&(this.gt=!1,this.updateUploaded()))},i.prototype.updateUploadedRecursively=function(){if(0===this.bt){this.updateUploaded();for(var t=this.children,n=0,i=t.length;n<i;++n)t[n].updateUploadedRecursively()}else this.wt=!0},i.prototype.updateUploaded=function(){if(0===this.bt){var t=this.uploaded;null!=t&&t.update(this)}else this.gt=!0},Object.defineProperty(i.prototype,"image",{get:function(){return this.Tt},set:function(t){this.Tt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){for(var t=this;t.parent instanceof i;)t=t.parent;return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"connector",{get:function(){var t=this.St;return null==t&&(t=new ot(this),this.St=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){if(this.vt){var t=this.parent;return!(t instanceof i)||t.visible}return!1},set:function(t){this.vt!==t&&(this.vt=t,this.updateUploadedRecursively())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"worldVisible",{get:function(){if(this.vt){var t=this.parent;return!t||t.worldVisible}return!1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){var t=this.parent;null!=t&&t.toDirty()},i.prototype.attach=function(t,n){this.detach(),this.parent=t;var i=t.children;return null!=n&&0<=n&&n<i.length?i.splice(n,0,this):i.push(this),t.onChildTransformChange(),t.toDirty(),this.onAttach(),this},i.prototype.onAttach=function(){this.uploaded=void 0;var t=this.St;t&&(t.attach(),t.fit(!0));for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onAttach()},i.prototype.detach=function(){var t=this.parent;if(t){this.parent=null;var n=t.children,i=n.indexOf(this);0<=i&&(n.splice(i,1),t.onChildTransformChange(),t.toDirty(),this.onDetach())}return this},i.prototype.onDetach=function(){this.uploaded=void 0;var t=this.St;t&&t.detach();for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onDetach()},i.prototype.updateTransform=function(){var n=this.parent;n?(n.parent&&n.updateTransform(),this.transform.updateTransform(n.transform)):this.transform.updateTransform(t.Transform.IDENTITY)},i.prototype.serializeChildren=function(t){for(var n=this.children,i=[],r=0,e=n.length;r<e;++r){var u=n[r];i.push(u.serialize(t))}return i},i.prototype.serializeImage=function(t){var n=this.Tt;return null!=n?t.addResource(n.src):-1},i.prototype.serializeGradient=function(t){var n=this.gradient;return null!=n?(null==n.serialized&&(n.serialized=It(n)),t.addResource(n.serialized)):-1},i.prototype.serializeState=function(t){var n=this.state;return(this.interactive?1:0)|(n.isFocusable?0:2)|(n.isActive?4:0)},i.prototype.serialize=function(t){var n=this.transform,i=n.position,r=n.pivot,e=this.size,u=this.shortcut,s=null!=u?t.addResource(u):-1,h=this.cursor,o=null!=h?t.addResource(h):-1,a=this.title,c=null!=a?t.addResource(a):-1,f=Ct.NONE,l=Ct.NONE,v=Ct.NONE,b=this.Nt;return null!=b&&(f=b.added,l=b.removed,v=b.locked),[this.type,t.addResource(this.id),i.x,i.y,e.x,e.y,n.rotation,n.skew.x,this.fill.serialize(t),this.stroke.serialize(t),o,this.text.serialize(t),this.data.serialize(t),this.radius,this.corner,-1,-1,this.action.serialize(t),this.serializeImage(t),this.serializeGradient(t),this.serializeChildren(t),r.x,r.y,this.serializeState(t),s,c,this.uuid,f,l,v]},i.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},i.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},i.prototype.getShapeScale=function(){var t=this.root.parent;return null!=t&&null!=t.getShapeScale?t.getShapeScale():1},i.prototype.getStrokeWidthScale=function(t){return t&s.NON_EXPANDING_WIDTH?t&s.NON_SHRINKING_WIDTH?this.getShapeScale():Math.min(1,this.getShapeScale()):t&s.NON_SHRINKING_WIDTH?Math.max(1,this.getShapeScale()):1},i.prototype.getHitTestSize=function(t){var n=this.size;return t.width=.5*n.x,t.height=.5*n.y,t},i.prototype.toHitTestData=function(t,n){var r,e=this.getHitTestSize(null!==(r=i.WORK_HIT_TEST_DATA)&&void 0!==r?r:i.WORK_HIT_TEST_DATA=new jt),u=e.width,s=e.height,h=this.transform.pivot,o=t-h.x,a=n-h.y,c=this.stroke,f=c.enable?c.width:0,l=this.getStrokeWidthScale(c.style),v=c.align,b=f*l*v;return e.set(0<=u?+o:-o,0<=s?+a:-a,Math.abs(u)+b,Math.abs(s)+b,f,l,v)},i.prototype.contains=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbs(i.x,i.y,i.width,i.height,i.strokeWidth,i.strokeScale,i.strokeAlign)?this:this.containsText(t,n)||this.containsChildren(t,n)},i.prototype.containsText=function(t,n){var i=this.text;if(null!=i.atlas){var r=i.world;if(null!=r){var e=this.transform.internalTransform,u=e.a*t+e.c*n+e.tx-r[0],s=e.b*t+e.d*n+e.ty-r[1],h=r[2]*u+r[3]*s,o=r[4]*u+r[5]*s,a=r[6],c=r[7];if(0<=h&&h<=a&&0<=o&&o<=c)return this}}return null},i.prototype.containsChildren=function(t,n){for(var i=this.children,r=i.length-1;0<=r;--r){var e=i[r];e.updateTransform();var u=e.transform.localTransform,s=u.a,h=u.b,o=u.c,a=u.d,c=u.tx,f=u.ty,l=1/(s*a-o*h),v=(a*t-o*n+f*o-c*a)*l,b=(s*n-h*t-f*s+c*h)*l,d=e.contains(v,b);if(null!=d)return d}return null},i.prototype.containsBBox=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbsBBox(i.x,i.y,i.width,i.height)},i.prototype.containsAbs=function(t,n,i,r,e,u,s){return this.containsAbsBBox(t,n,i,r)},i.prototype.containsAbsBBox=function(t,n,i,r){return Nt(t,n,i,r)},i.prototype.select=function(t){return!1},i.prototype.toGlobal=function(t,n,i){return!0!==i&&this.updateTransform(),n.copyFrom(t),this.transform.worldTransform.apply(n,n),n},i.prototype.toLocal=function(n,i,r,e){return!0!==e&&this.updateTransform(),void 0===r&&(r=new t.Point),r.copyFrom(n),this.transform.worldTransform.applyInverse(r,r),r},i.prototype.getBounds=function(n,i){!0!==n&&this.updateTransform();var r=this._bounds||new t.Rectangle;this._bounds=r;var e=this.transform.getWorldId();return e!==this.Ot&&(this.Ot=e,this.It(this.transform.worldTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsInternal=function(n,i){!0!==n&&this.updateTransform();var r=this.Ct||new t.Rectangle;this.Ct=r;var e=this.transform.getLocalIdCurrent();return e!==this.Dt&&(this.Dt=e,this.It(this.transform.internalTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsLocal=function(n,i){!0!==n&&this.updateTransform();var r=this.At||new t.Rectangle;this.At=r;var e=this.transform.getLocalIdCurrent();return e!==this.Et&&(this.Et=e,this.It(this.transform.localTransform,r)),i.copyFrom(r),i},i.prototype.getBoundsSize=function(){return this.size},i.prototype.It=function(t,n){var i=this.transform.pivot,r=i.x,e=i.y,u=this.getBoundsSize(),s=.5*u.x,h=.5*u.y,o=t.a,a=t.b,c=t.c,f=t.d,l=-s+r,v=-h+e,b=o*l+c*v,d=a*l+f*v,g=o*(l=+s+r)+c*(v=-h+e),m=a*l+f*v,w=o*(l=-s+r)+c*(v=+h+e),p=a*l+f*v,O=o*(l=+s+r)+c*(v=+h+e),D=a*l+f*v,E=Math.min(b,g,w,O),M=Math.min(d,m,p,D),S=Math.max(b,g,w,O),T=Math.max(d,m,p,D);return n.x=E+t.tx,n.y=M+t.ty,n.width=S-E,n.height=T-M,n},i.prototype.destroy=function(){for(var t=this.children,n=t.length-1;0<=n;--n)t[n].destroy();t.length=0},i.prototype.onStateChange=function(t,n){var r=this.runtime;null!=r&&r.onStateChange(this,t,n);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}},Object.defineProperty(i.prototype,"state",{get:function(){var t=this,n=this.Rt;return null==n&&(n=new St((function(n,i){t.onStateChange(n,i)})),this.Rt=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"capability",{get:function(){var t=this.Nt;return null==t&&(t=new At,this.Nt=t),t},enumerable:!1,configurable:!0}),i.prototype.getCapability=function(){return this.Nt},i.prototype.focus=function(){return this.setFocused(!0),this},i.prototype.blur=function(){return this.setFocused(!1),this},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=st.getLayer(this);n&&n.getFocusController().set(this,t)}},i.prototype.onKeyDown=function(t){var n=this.runtime;return!!n&&n.onKeyDown(this,t)},i.prototype.onKeyUp=function(t){var n=this.runtime;return!!n&&n.onKeyUp(this,t)},i.prototype.update=function(t){var n=this.runtime;n&&n.update(this,t)},i.prototype.onRender=function(t,n){var i=this.runtime;i&&i.onRender(this,t,n)},i.prototype.updateRecursively=function(t){this.update(t);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].update(t)},i.prototype.copy=function(t,n){if(void 0===n&&(n=at.ALL),this.id=t.id,this.uuid=t.uuid,n&at.TRANSFORM){var r=this.transform,e=t.transform;r.position.copyFrom(e.position),r.rotation=e.rotation,r.skew.copyFrom(e.skew),r.pivot.copyFrom(e.pivot),r.scale.copyFrom(e.scale)}if(n&at.SIZE&&this.size.copyFrom(t.size),n&at.STYLE&&(this.fill.copy(t.fill),this.stroke.copy(t.stroke),this.text.copy(t.text),this.radius=t.radius,this.corner=t.corner),n&at.DATA&&this.data.copy(t.data),n&at.IMAGE&&(this.image=t.image),n&at.ACTION&&(this.action.clearAndAddAll(t.action.values),this.interactive=t.interactive,this.cursor=t.cursor,this.shortcut=t.shortcut),n&at.POINTS){var u=t.points;if(null!=u){var s=this.points;null!=s&&s.copy(u)}}if(n&at.STATE&&this.state.lock(!1).copy(t.state).unlock(),n&at.CONNECTOR)if(t instanceof i){var h=t.St;h?this.connector.copy(h):(o=this.St)&&o.clear()}else{var o;(o=this.St)&&o.clear()}if(n&at.CAPABILITY){var a=t.getCapability();if(null!=a)this.capability.copy(a);else{var c=this.Nt;null!=c&&c.clear()}}return this},i}(t.utils.EventEmitter),kt=function(){function t(t,n,i,r,e,u,s,h){this.p=t,this.O=n,this.S=i,this.T=r,this.kt=e,this.Lt=u,this.yt=s,this.B=h}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this.Lt},set:function(t){this.Lt!==t&&(this.Lt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return this.yt},set:function(t){this.yt!==t&&(this.yt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width,t.align,t.side,t.style)},t.prototype.set=function(t,n,i,r,e,u,s){var h=!1;void 0!==t&&this.O!==t&&(this.O=t,h=!0),void 0!==n&&this.S!==n&&(this.S=n,h=!0),void 0!==i&&this.T!==i&&(this.T=i,h=!0),void 0!==r&&this.kt!==r&&(this.kt=r,h=!0),void 0!==e&&this.Lt!==e&&(this.Lt=e,h=!0),void 0!==u&&this.yt!==u&&(this.yt=u,h=!0),void 0!==s&&this.B!==s&&(this.B=s,h=!0),h&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T,this.kt,this.Lt,this.yt,this.B)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T,width:this.kt,align:this.Lt,side:this.yt,style:this.B}},t.prototype.serialize=function(t){var n=this.O?1:0,i="[".concat(n,",").concat(this.S,",").concat(this.T,",").concat(this.kt,",").concat(this.Lt,",").concat(this.yt,",").concat(this.B,"]");return t.addResource(i)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getStroke(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3],r[4],r[5],r[6]);else{var e=JSON.parse(i[t]);n.setStroke(t,e),this.set(!!e[0],e[1],e[2],e[3],e[4],e[5],e[6])}}},t}(),Lt={NONE:0,FROM:1,TO:2,FROM_TO:3},yt=function(){function t(){this.xt=Lt.NONE,this.Bt=0,this.Pt=1}return Object.defineProperty(t.prototype,"type",{get:function(){return this.xt},set:function(t){if(this.xt!==t){this.xt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},set:function(t){if(this.Bt!==t){this.Bt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},set:function(t){if(this.Pt!==t){this.Pt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;if(void 0!==t&&void 0!==n)if(null!==t&&null!==n){var r=this.xt|Lt.FROM|Lt.TO;this.xt===r&&this.Bt===t&&this.Pt===n||(this.xt=r,this.Bt=t,this.Pt=n,i=!0)}else null!==t?(r=(this.xt|Lt.FROM)&~Lt.TO,this.xt===r&&this.Bt===t||(this.xt=r,this.Bt=t,i=!0)):null!==n?(r=(this.xt|Lt.TO)&~Lt.FROM,this.xt===r&&this.Bt===t||(this.xt=r,this.Pt=n,i=!0)):(r=this.xt&~(Lt.TO|Lt.FROM),this.xt!==r&&(this.xt=r,i=!0));else void 0!==t?null!==t?(r=this.xt|Lt.FROM,this.xt===r&&this.Bt===t||(this.xt=r,this.Bt=t,i=!0)):(r=this.xt&~Lt.FROM,this.xt!==r&&(this.xt=r,i=!0)):void 0!==n&&(null!==n?(r=this.xt|Lt.TO,this.xt===r&&this.Pt===n||(this.xt=r,this.Pt=n,i=!0)):(r=this.xt&~Lt.TO,this.xt!==r&&(this.xt=r,i=!0)));if(i){var e=this.parent;null!=e&&(e.isChanged=!0)}return i},t.prototype.normalize=function(t){var n=this.xt,i=this.Bt,r=this.Pt;switch(n){case Lt.FROM_TO:return(t-i)/(r-i);case Lt.FROM:return t-i;case Lt.TO:return r-t;case Lt.NONE:default:return t}},t.prototype.isEquals=function(t){return this.xt===t.type&&this.Bt===t.from&&this.Pt===t.to},t.prototype.copy=function(t){return this.Ft(t.type,t.from,t.to)},t.prototype.Ft=function(t,n,i){var r=!1;if(this.xt!==t&&(this.xt=t,r=!0),this.Bt!==n&&(this.Bt=n,r=!0),this.Pt!==i&&(this.Pt=i,r=!0),r){var e=this.parent;null!=e&&(e.isChanged=!0)}return this},t.prototype.toObject=function(){return{type:this.type,from:this.from,to:this.to}},t.prototype.serialize=function(t){var n="[".concat(this.xt,",").concat(this.Bt,",").concat(this.Pt,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getRange(t);if(null!=r)this.Ft(r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setRange(t,e),this.Ft(e[0],e[1],e[2])}}},t}(),xt={ASCENDING:0,DESCENDING:1},Bt={BOOLEAN:7,BOOLEAN_ARRAY:8,NUMBER:0,NUMBER_ARRAY:1,STRING:2,STRING_ARRAY:3,OBJECT:4,OBJECT_ARRAY:5,TICKER:6,EXTENSION:1e3},_t={PRIVATE:0,PUBLIC:1,PROTECTED:2},Pt={UNKNOWN:-1,FOUND:0,NOT_FOUND:1,BAD_REQUEST:2,SERVER_ERROR:3,SERVICE_UNAVAILABLE:4,FORBIDDEN:5,NOT_DEFINED:6},Ft=function(t,n){return t-n},Ut=function(){function t(){this.id="",this.as="",this.type=Bt.NUMBER,this.scope=_t.PUBLIC,this.initial="",this.format="",this.range=new yt,this.Ut=0,this.Gt=0,this.Rt=Pt.UNKNOWN,this.Ht=0,this.zt=xt.ASCENDING}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},set:function(t){this.p!==t&&(this.p=t,this.range.parent=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Ut},set:function(t){var n=this.formatter;null!=n&&(t=n(t));var i=this.Ht;if(i<=0){if(this.Ut!==t){this.Ut=t;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.k;null==e&&(e=[],this.k=e),this.Ut=t;var u=this.zt;u===xt.ASCENDING?e.push(t):e.unshift(t);var s=e.length-i;if(0<s)if(u===xt.ASCENDING)for(var h=0;h<s;++h)e.shift();else e.length=i;var o=this.parent;null!=o&&(o.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){return this.range.normalize(this.Ut)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.k;return null==t&&(t=[],this.k=t),t},set:function(t){var n=t.length;if(0<n){var i=this.Ht;if(i<=0){var r=t[n-1];if(null!=(s=this.formatter)&&(r=s(r)),this.Ut!==r){this.Ut=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.k;null==u&&(u=[],this.k=u);var s,h=this.zt;if(null!=(s=this.formatter))if(this.Ut=s(t[n-1]),h===xt.ASCENDING)for(var o=0;o<n;++o)u.push(s(t[o]));else for(o=0;o<n;++o)u.unshift(s(t[o]));else if(this.Ut=t[n-1],h===xt.ASCENDING)for(o=0;o<n;++o)u.push(t[o]);else for(o=0;o<n;++o)u.unshift(t[o]);var a=u.length-i;if(0<a)if(h===xt.ASCENDING)for(o=0;o<a;++o)u.shift();else u.length=i;var c=this.parent;null!=c&&(c.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.Gt},set:function(t){var n=this.Ht;if(n<=0){if(this.Gt!==t){this.Gt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Vt;null==r&&(r=[],this.Vt=r),this.Gt=t;var e=this.zt;e===xt.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===xt.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"times",{get:function(){var t=this.Vt;return null==t&&(t=[],this.Vt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.Ht;if(i<=0){var r=t[n-1];if(this.Gt!==r){this.Gt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.Vt;null==u&&(u=[],this.Vt=u),this.Gt=t[n-1];var s=this.zt;if(s===xt.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===xt.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.Rt},set:function(t){var n=this.Ht;if(n<=0){if(this.Rt!==t){this.Rt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Wt;null==r&&(r=[],this.Wt=r),this.Rt=t;var e=this.zt;e===xt.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===xt.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"states",{get:function(){var t=this.Wt;return null==t&&(t=[],this.Wt=t),t},set:function(t){var n=t.length;if(0<n){var i=this.Ht;if(i<=0){var r=t[n-1];if(this.Rt!==r){this.Rt=r;var e=this.parent;null!=e&&(e.isChanged=!0)}}else{var u=this.Wt;null==u&&(u=[],this.Wt=u),this.Rt=t[n-1];var s=this.zt;if(s===xt.ASCENDING)for(var h=0;h<n;++h)u.push(t[h]);else for(h=0;h<n;++h)u.unshift(t[h]);var o=u.length-i;if(0<o)if(s===xt.ASCENDING)for(h=0;h<o;++h)u.shift();else u.length=i;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){return this.Ht},set:function(t){if(this.Ht<t)this.Ht=t;else if(t<this.Ht){this.Ht=t;var n=!1,i=this.zt,r=this.k;if(null!=r&&0<(s=r.length-t)){if(i===xt.ASCENDING)for(var e=0;e<s;++e)r.shift();else r.length=t;n=!0}var u=this.Vt;if(null!=u&&0<(s=u.length-t)){if(i===xt.ASCENDING)for(e=0;e<s;++e)u.shift();else u.length=t;n=!0}var s,h=this.Wt;if(null!=h&&0<(s=h.length-t)){if(i===xt.ASCENDING)for(e=0;e<s;++e)h.shift();else h.length=t;n=!0}if(n){var o=this.parent;null!=o&&(o.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.zt},set:function(t){this.zt=t},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){var n=!1,i=this.k;null!=i&&0<=t&&t<i.length&&(i.splice(t,1),n=!0);var r=this.Vt;null!=r&&0<=t&&t<r.length&&(r.splice(t,1),n=!0);var e=this.Wt;if(null!=e&&0<=t&&t<e.length&&(e.splice(t,1),n=!0),n){var u=this.parent;null!=u&&(u.isChanged=!0)}},t.prototype.removeAll=function(t){var n=!1,i=t.slice(0).sort(Ft),r=i.length,e=this.k;if(null!=e)for(var u=r-1;0<=u;--u)0<=(o=i[u])&&o<e.length&&(e.splice(o,1),n=!0);var s=this.Vt;if(null!=s)for(u=r-1;0<=u;--u)0<=(o=i[u])&&o<s.length&&(s.splice(o,1),n=!0);var h=this.Wt;if(null!=h)for(u=r-1;0<=u;--u){var o;0<=(o=i[u])&&o<h.length&&(h.splice(o,1),n=!0)}if(n){var a=this.parent;null!=a&&(a.isChanged=!0)}},t.prototype.clear=function(){var t=!1,n=this.k;null!=n&&(n.length=0,t=!0);var i=this.Vt;null!=i&&(i.length=0,t=!0);var r=this.Wt;if(null!=r&&(r.length=0,t=!0),t){var e=this.parent;null!=e&&(e.isChanged=!0)}},t.prototype.toDirty=function(){var t=this.parent;null!=t&&(t.isChanged=!0)},t.prototype.copy=function(t){return this.id=t.id,this.as=t.as,this.type=t.type,this.scope=t.scope,this.initial=t.initial,this.format=t.format,this.formatter=t.formatter,this.range.copy(t.range),this.Ut=t.value,this.Gt=t.time,this.Rt=t.state,this.Ht=t.capacity,this},t.prototype.isEquals=function(t){return this.id===t.id&&this.as===t.as&&this.type===t.type&&this.scope===t.scope&&this.initial===t.initial&&this.formatter===t.formatter&&this.range.isEquals(t.range)},t.prototype.serialize=function(t){var n=t.addData(this.id),i=t.addResource(this.as),r=t.addResource(this.initial),e=t.addResource(this.format.trim()),u=this.range.serialize(t);return t.addResource("[".concat(n,",").concat(r,",").concat(e,",").concat(u,",").concat(this.Ht,",").concat(this.zt,",").concat(this.type,",").concat(this.scope,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i,r,e=n.resources;if(0<=t&&t<e.length){var u=n.getDataValue(t);null==u&&(u=JSON.parse(e[t]),n.setDataValue(t,u)),this.id=n.data[u[0]]||"";var s=u[8];this.as=null!=s&&e[s]||"",this.type=null!==(i=u[6])&&void 0!==i?i:Bt.NUMBER,this.scope=null!==(r=u[7])&&void 0!==r?r:_t.PUBLIC,this.initial=e[u[1]]||"",this.format=e[u[2]]||"",this.range.deserialize(u[3],n),this.Ht=u[4],this.zt=u[5]}return this},t}(),Gt=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if((e=n[i])===t)return i;for(i=0,r=n.length;i<r;++i){var e;if((e=n[i])[0]===t[0]&&e[1]===t[1]&&e[2]===t[2])return i}return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.copy=function(t){this.clearAndAddAll(t.values)},t.prototype.serialize=function(t){var n=this.values;if(n.length<=0)return-1;for(var i="[",r="",e=0,u=n.length;e<u;++e){var s=n[e],h=t.addResource(s[0]),o=t.addResource(s[1]),a=t.addResource(s[2]);i+="".concat(r).concat(h,",").concat(o,",").concat(a),r=","}return i+="]",t.addResource(i)},t.prototype.deserialize=function(t,n){var i=this.values;i.length=0;var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataMapping(t);null==u&&(u=JSON.parse(r[t]),n.setDataMapping(t,u));for(var s=0,h=u.length;s<h;s+=3){var o=u[s],a=u[s+1],c=u[s+2];i.push([0<=o&&o<e?r[o]:"",0<=a&&a<e?r[a]:"",0<=c&&c<e?r[c]:""])}}},t}(),Ht=function(){function t(){}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Xt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i,r=null!==(i=this.Xt)&&void 0!==i?i:this.Xt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Xt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),c.value=n}return!0},t.prototype.toDirty=function(t){var n=this.Xt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.each=function(t){var n=this.Xt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t}(),zt=function(){function t(){this.Xt=new Map}return t.prototype.set=function(t,n){return this.Xt.set(t,n),this},t.prototype.get=function(t){var n;return null!==(n=this.Xt.get(t))&&void 0!==n?n:null},t.prototype.contains=function(t){return this.Xt.has(t)},t.prototype.remove=function(t){var n=this.Xt,i=n.get(t);return n.delete(t),null!=i?i:null},t.prototype.clear=function(){return this.Xt.clear(),this},t.prototype.size=function(){return this.Xt.size},t.prototype.each=function(t){var n=!1;return this.Xt.forEach((function(i,r){n||!1===t(i,r)&&(n=!0)})),this},t.prototype.copy=function(t){var n=this.Xt;return n.clear(),t.each((function(t,i){n.set(i,t)})),this},t.prototype.serialize=function(t){var n=this.Xt;if(n.size<=0)return-1;var i=[];return n.forEach((function(n,r){var e=t.addResource(n),u=t.addResource(r);i.push(u,e)})),t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=this.Xt;i.clear();var r=n.resources,e=r.length;if(0<=t&&t<e){var u=n.getDataSystem(t);null==u&&(u=JSON.parse(r[t]),n.setDataSystem(t,u));for(var s=0,h=u.length;s<h;s+=2){var o=u[s];if(0<=o&&o<e){var a=r[o],c=u[s+1];0<=c&&c<e&&i.set(a,r[c])}}}},t}(),Vt=function(){function t(){this.k=[],this.Kt=!0}return Object.defineProperty(t.prototype,"values",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.Kt},set:function(t){this.Kt=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.k;return 0<t.length?t[0].id:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"as",{get:function(){var t=this.k;return 0<t.length?t[0].as:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){var t=this.k;return 0<t.length?t[0].type:Bt.NUMBER},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scope",{get:function(){var t=this.k;return 0<t.length?t[0].scope:_t.PRIVATE},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initial",{get:function(){var t=this.k;return 0<t.length?t[0].initial:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){var t=this.k;return 0<t.length?t[0].format:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.k;return 0<t.length?t[0].range:null!=U?U:U=new yt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this.k;return 0<t.length?t[0].value:0},set:function(t){var n=this.k;0<n.length&&(n[0].value=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){var t=this.k;return 0<t.length?t[0].nvalue:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){var t=this.k;return 0<t.length?t[0].time:0},set:function(t){var n=this.k;0<n.length&&(n[0].time=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){var t=this.k;return 0<t.length?t[0].state:Pt.UNKNOWN},set:function(t){var n=this.k;0<n.length&&(n[0].state=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){var t=this.k;return 0<t.length?t[0].capacity:0},set:function(t){var n=this.k;0<n.length&&(n[0].capacity=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alias",{get:function(){var t=this.Yt;return null==t&&(t=this.newAlias(),this.Yt=t),t},enumerable:!1,configurable:!0}),t.prototype.newAlias=function(){var t=this.k,n=t.length;if(0<n){for(var i={},r=0;r<n;++r){var e=t[r];i[e.as||e.id]=e}return i}return null!=G?G:G={}},Object.defineProperty(t.prototype,"mapping",{get:function(){var t=this.Jt;return null==t&&(t=this.newMapping(),this.Jt=t),t},enumerable:!1,configurable:!0}),t.prototype.newMapping=function(){return new Gt},t.prototype.getMapping=function(){return this.Jt},Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Zt;return null==t&&(t=this.newPrivate(),this.Zt=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new Ht},t.prototype.getPrivate=function(){return this.Zt},Object.defineProperty(t.prototype,"system",{get:function(){var t=this.qt;return null==t&&(t=this.newSystem(),this.qt=t),t},enumerable:!1,configurable:!0}),t.prototype.newSystem=function(){return new zt},t.prototype.getSystem=function(){return this.qt},t.prototype.add=function(t,n){var i=this.k;t.parent=this,void 0===n?i.push(t):i.splice(n,0,t)},t.prototype.set=function(t,n){var i=this.k;if(0<=t&&t<i.length){var r=i[t];return n.parent=this,i[t]=n,r.parent=void 0,r}return null},t.prototype.remove=function(t){var n=this.k;0<=t&&t<n.length&&(n.splice(t,1)[0].parent=void 0)},t.prototype.indexOf=function(t){for(var n=this.k,i=n.length,r=0;r<i;++r)if(n[r]===t)return r;for(r=0;r<i;++r)if(n[r].isEquals(t))return r;for(r=0;r<i;++r)if(n[r].id===t.id)return r;return-1},t.prototype.get=function(t){var n=this.k;return 0<=t&&t<n.length?n[t]:null},t.prototype.size=function(){return this.k.length},t.prototype.swap=function(t,n){var i=this.k,r=i[n];i[n]=i[t],i[t]=r},t.prototype.copy=function(t){var n=this.k;n.length=0;for(var i=0,r=t.size();i<r;++i){var e=t.get(i);if(null!=e){var u=(new Ut).copy(e);u.parent=this,n.push(u)}}var s=t.getMapping();s&&this.mapping.copy(s);var h=t.getSystem();return h&&this.system.copy(h),this},t.prototype.serialize=function(t){for(var n=this.k,i=[],r=0,e=n.length;r<e;++r)i.push(n[r].serialize(t));var u,s=this.Jt;return null!=s?(i.push(s.serialize(t)),null!=(u=this.qt)?t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]")):t.addResource("[".concat(JSON.stringify(i),"]"))):null!=(u=this.qt)?(i.push(-1),t.addResource("[".concat(JSON.stringify(i),",").concat(u.serialize(t),"]"))):t.addResource(JSON.stringify(i))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getData(t);null==r&&(r=JSON.parse(i[t]),n.setData(t,r));var e=this.k;if(e.length=0,this.isMapped(r)){for(var u=r[0],s=u.length,h=0,o=s-1;h<o;++h){var a=u[h];(l=new Ut).parent=this,l.deserialize(a,n),e.push(l)}var c=u[s-1];0<=c&&this.mapping.deserialize(c,n);var f=r[1];null!=f&&0<=f&&this.system.deserialize(f,n)}else for(h=0,o=r.length;h<o;++h){var l;a=r[h],(l=new Ut).parent=this,l.deserialize(a,n),e.push(l)}}},t.prototype.isMapped=function(t){return 0<t.length&&mt(t[0])},t}(),Wt=function(){function t(t,n,i){this.p=t,this.Qt=n,this.$t=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Qt},set:function(t){this.Qt!==t&&(this.Qt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.$t},set:function(t){this.$t!==t&&(this.$t=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Qt!==t&&(this.Qt=t,i=!0),null!=n&&this.$t!==n&&(this.$t=n,i=!0),i&&this.p.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Qt,vertical:this.$t}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Qt,",").concat(this.$t,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getAlign(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setAlign(t,e),this.set(e[0],e[1])}}},t}(),Xt=function(){function t(t,n,i){this.p=t,this.Qt=n,this.$t=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Qt},set:function(t){this.Qt!==t&&(this.Qt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.$t},set:function(t){this.$t!==t&&(this.$t=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Qt!==t&&(this.Qt=t,i=!0),null!=n&&this.$t!==n&&(this.$t=n,i=!0),i&&this.p.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Qt,vertical:this.$t}},t.prototype.serialize=function(t){return t.addResource("[".concat(this.Qt,",").concat(this.$t,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getMargin(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setMargin(t,e),this.set(e[0],e[1])}}},t}(),Kt=function(){function t(t,n,i,r,e){this.p=t,this.O=n,this.S=i,this.T=r,this.kt=e}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width)},t.prototype.set=function(t,n,i,r){var e=!1;void 0!==t&&this.O!==t&&(this.O=t,e=!0),void 0!==n&&this.S!==n&&(this.S=n,e=!0),void 0!==i&&this.T!==i&&(this.T=i,e=!0),void 0!==r&&this.kt!==r&&(this.kt=r,e=!0),e&&this.p.updateUploaded()},t.prototype.clone=function(){return new t(this.p,this.O,this.S,this.T,this.kt)},t.prototype.toObject=function(){return{enable:this.O,color:this.S,alpha:this.T,width:this.kt}},t.prototype.serialize=function(t){var n="[".concat(this.O?1:0,",").concat(this.S,",").concat(this.T,",").concat(this.kt,"]");return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getTextOutline(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3]);else{var e=JSON.parse(i[t]);n.setTextOutline(t,e),this.set(!!e[0],e[1],e[2],e[3])}}},t}(),Yt=function(){function t(t,n,i,r,e,u){this.p=t,this.O=!0,this.Ut=n,this.S=i,this.T=r,this.tn=e,this.j=u,this.nn=d.NORMAL,this.align=new Wt(t,m.CENTER,w.MIDDLE),this.offset=new Xt(t,0,0),this.B=g.NORMAL,this.spacing=new Xt(t,0,0),this.outline=new Kt(t,!1,16777215,1,.5),this.rn=p.LEFT_TO_RIGHT,this.padding=new Xt(t,10,10),this.en=!1,this.un=!1}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.Ut},set:function(t){if(this.Ut!==t){this.Ut=t;var n=this.p,i=n.uploaded;if(null==i||!i.isCompatible(n))return this.atlas=void 0,void n.toDirty();var r=this.atlas,e=r&&r.characters;if(null==e)return this.atlas=void 0,void n.toDirty();for(var u=0,s=t.length;u<s;++u)if(!(t[u]in e))return this.atlas=void 0,void n.toDirty();n.updateUploaded()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){return this.tn},set:function(t){this.tn!==t&&(this.tn=t,this.p.toDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this.nn},set:function(t){this.nn!==t&&(this.nn=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this.B},set:function(t){this.B!==t&&(this.B=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this.rn},set:function(t){this.rn!==t&&(this.rn=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){return this.en},set:function(t){this.en!==t&&(this.en=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fitting",{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t,this.p.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return t&&(this.set(t.value,t.color,t.alpha,t.family,t.size,t.weight,t.style,t.direction,t.clipping,t.fitting),this.align.copy(t.align),this.offset.copy(t.offset),this.outline.copy(t.outline),this.spacing.copy(t.spacing),this.padding.copy(t.padding)),this},t.prototype.set=function(t,n,i,r,e,u,s,h,o,a){var c=!1,f=!1;return null!=t&&this.Ut!==t&&(this.Ut=t,c=!0),null!=n&&this.S!==n&&(this.S=n,f=!0),null!=i&&this.T!==i&&(this.T=i,f=!0),null!=r&&this.tn!==r&&(this.tn=r,c=!0),null!=e&&this.j!==e&&(this.j=e,f=!0),null!=u&&this.nn!==u&&(this.nn=u,f=!0),null!=s&&this.B!==s&&(this.B=s,f=!0),null!=h&&this.rn!==h&&(this.rn=h,f=!0),null!=o&&this.en!==o&&(this.en=o,f=!0),null!=a&&this.un!==a&&(this.un=a,f=!0),c?this.p.toDirty():f&&this.p.updateUploaded(),this},t.prototype.toObject=function(){return{value:this.Ut,color:this.S,alpha:this.T,family:this.tn,size:this.j,weight:this.nn,align:this.align.toObject(),offset:this.offset.toObject(),style:this.B,outline:this.outline.toObject(),direction:this.rn,spacing:this.spacing.toObject(),padding:this.padding.toObject(),clipping:this.en,fitting:this.un}},t.prototype.serialize=function(t){var n=t.addResource(this.Ut),i=t.addResource(this.tn),r=this.align.serialize(t),e=this.offset.serialize(t),u=this.outline.serialize(t),s=this.spacing.serialize(t),h=this.padding.serialize(t),o=this.en?1:0,a=this.un?1:0,c="[".concat(n,",").concat(this.S,",").concat(this.T,",").concat(i,",").concat(this.j,",")+"".concat(this.nn,",").concat(r,",").concat(e,",").concat(this.B,",").concat(u,",")+"".concat(s,",").concat(this.rn,",").concat(h,",").concat(o,",").concat(a,"]");return t.addResource(c)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getText(t);null==r&&(r=JSON.parse(i[t]),n.setText(t,r)),this.set(i[r[0]]||"",r[1],r[2],i[r[3]]||"auto",r[4],r[5],r[8],r[11],!!r[13],!!r[14]),this.align.deserialize(r[6],n),this.offset.deserialize(r[7],n),this.outline.deserialize(r[9],n),this.spacing.deserialize(r[10],n),this.padding.deserialize(r[12],n)}},t}(),Jt=function(n){function i(t){var i=n.call(this,t)||this;i.size=i.newSize(),i.fill=i.newFill(),i.stroke=i.newStroke(),i.sn=q.RADIUS,i.hn=ut.ALL;var r=new Vt;return i.data=r,i.tag=r,i.text=i.newText(),i}return _(i,n),i.prototype.newSize=function(){var n=this;return new t.ObservablePoint((function(){n.onSizeChange()}),void 0,q.SIZE_X,q.SIZE_Y)},i.prototype.newFill=function(){return new $(this,!0,q.FILL_COLOR,q.FILL_ALPHA)},i.prototype.newStroke=function(){return new kt(this,!0,q.STROKE_COLOR,q.STROKE_ALPHA,q.STROKE_WIDTH,q.STROKE_ALIGN,q.STROKE_SIDE,q.STROKE_STYLE)},i.prototype.newText=function(){return new Yt(this,q.TEXT_VALUE,q.TEXT_COLOR,q.TEXT_ALPHA,q.TEXT_FAMILY,q.TEXT_SIZE)},Object.defineProperty(i.prototype,"corner",{get:function(){return this.hn},set:function(t){this.hn!==t&&(this.hn=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"radius",{get:function(){return this.sn},set:function(t){this.sn!==t&&(this.sn=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"image",{get:function(){return this.Tt},set:function(t){if(this.Tt!==t){null!=t?(this.Tt=t,this.imageSrc=t.src):(this.Tt=void 0,this.imageSrc=void 0);var n=this.parent;null!=n&&n.toDirty()}},enumerable:!1,configurable:!0}),i}(Rt),Zt=function(t,n,i,r,e,u,s){if(t.fill.enable){if((c=n*n)*(o=e*e)+(f=i*i)*(h=r*r)<=h*o)return!0}else if(0<u){var h,o,a=u*s,c=n*n,f=i*i,l=Math.max(0,r-a),v=Math.max(0,e-a),b=l*l,d=v*v;if(b*d<=c*d+f*b&&c*(o=e*e)+f*(h=r*r)<=h*o)return!0}return!1},qt={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_OR_LEFT:9,TOP_OR_RIGHT:3,BOTTOM_OR_LEFT:12,BOTTOM_OR_RIGHT:6,ALL:15},Qt=function(t,n,i,r,e,u,s){if(Nt(n,i,r,e)){if(t.fill.enable)return!0;var h=t.stroke.side;if(0<u&&h!==qt.NONE){var o=u*s,a=Math.max(0,r-o),c=Math.max(0,e-o);if(!Nt(n,i,a,c))return!(h!==qt.ALL&&!(n<=-a?i<=-c?h&qt.TOP_OR_LEFT:+c<=i?h&qt.BOTTOM_OR_LEFT:h&qt.LEFT:+a<=n?i<=-c?h&qt.TOP_OR_RIGHT:+c<=i?h&qt.BOTTOM_OR_RIGHT:h&qt.RIGHT:i<=-c?h&qt.TOP:+c<=i&&h&qt.BOTTOM))}}return!1},$t=function(t,n,i,r,e){return+i*t+r-n<=0&&-i*t+r-n<=0&&n<=e},tn=function(t,n,i,r,e,u,s){var h=2*e/r;if(t.fill.enable){if($t(n,i,h,-e,+e))return!0}else if(0<u){var o=u*s;if($t(n,i,h,-e,+e)){var a=2*r*e/(r+Math.sqrt(r*r+4*e*e)),c=e-a,f=c+(-e-c)*Math.max(0,a-o)/a;if(!$t(n,i,h,f,e-o))return!0}}return!1},nn=function(t,n,i){return.5*(i+t*n)},rn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getHitTestSize=function(n){var i=this.jt.formatted;if("boundary"in i){var r=i.boundary;n.width=Math.max(Math.abs(r[0]),Math.abs(r[2])),n.height=Math.max(Math.abs(r[1]),Math.abs(r[3]))}else t.prototype.getHitTestSize.call(this,n);return n},n.prototype.toMarkerSize=function(t){var n=0,i=t.getMarker();if(i){var r=i.head;if(r.type!==Q.NONE){var e=r.size;n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y)))}var u=i.tail;u.type!==Q.NONE&&(e=u.size,n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y))))}return n},n.prototype.containsAbsMarker=function(t,n,i,r,e,u){var s=t.type;if(s!==Q.NONE){var h=t.transform,o=h.a,a=h.b,c=h.c,f=h.d,l=h.tx,v=h.ty,b=1/(o*f-c*a),d=(f*n-c*i+v*c-l*f)*b,g=(o*i-a*n-v*o+l*a)*b,m=t.size,w=.5*m.x,p=.5*m.y;w<0&&(w=-w,n=-n),p<0&&(p=-p,i=-i);var O=r*e*u;switch(w+=O,p+=O,s){case Q.CIRCLE:return Zt(this,d,g,w,p,r,e);case Q.TRIANGLE:return tn(this,d,g,w,p,r,e);case Q.RECTANGLE:return Qt(this,d,g,w,p,r,e)}}return!1},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=this.jt,o=nn(e,u,0),a=o+this.toMarkerSize(h);if(this.containsAbsBBox(t,n,i+a,r+a)){var c=h.getMarker();if(c){if(this.containsAbsMarker(c.head,t,n,e,u,s))return!0;if(this.containsAbsMarker(c.tail,t,n,e,u,s))return!0}var f=this.calcHitPointAbsHitTester;return h.calcHitPointAbs(t,n,i,r,o,null,f,null)}return!1},n.prototype.calcHitPart=function(t,n){var i=this.toHitTestData(t,n),r=i.strokeWidth,e=i.strokeScale,u=nn(r,e,0),s=this.jt,h=u+this.toMarkerSize(s),o=i.x,a=i.y,c=i.width,f=i.height;if(this.containsAbsBBox(o,a,c+h,f+h)){var l=s.getMarker();if(l){var v=i.strokeAlign;if(this.containsAbsMarker(l.head,o,a,r,e,v))return et.MARKER_HEAD;if(this.containsAbsMarker(l.tail,o,a,r,e,v))return et.MARKER_TAIL}var b=this.calcHitPointAbsHitTester;if(s.calcHitPointAbs(o,a,c,f,u,null,b,null))return et.LINE}return this.containsText(t,n)?et.TEXT:this.containsChildren(t,n)?et.CHILDREN:et.NONE},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.jt,h=this.toHitTestData(t,n),o=(i||nn)(h.strokeWidth,h.strokeScale,0);return!!this.containsAbsBBox(h.x,h.y,h.width+o,h.height+o)&&s.calcHitPointAbs(h.x,h.y,h.width,h.height,o,r,e,u)},n.prototype.calcHitPointAbsHitTester=function(t,n,i,r,e,u,s,h,o){var a=e-i,c=u-r,f=t-i,l=n-r,v=a*a+c*c,b=a*f+c*l,d=f*f+l*l;if(1e-4<v){var g=Math.max(0,Math.min(1,b/v));if(v*g*g-2*b*g+d<h*h)return!0}return!1},n}(Jt),en=function(t){function n(n){void 0===n&&(n=r.BAR);var i=t.call(this,n)||this;return i.jt=new rt(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbsBBox=function(n,i,r,e){var u=Math.max(0,this.jt.size);return t.prototype.containsAbsBBox.call(this,n,i,r+u,e+u)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.jt.serialize(n),i},n}(rn),un=function(t){function n(n,i){var r=t.call(this,n,i,4,2)||this;return r.pointsId=NaN,r.pointsStyle=z.NONE,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset,i=this.indexOffset;t.updateClippings(),t.updateIndices(),c(t.clippings,n),f(t.indices,n,i)},n.prototype.update=function(t,n){this.updateVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexStepAndColorFill=function(t,n){if(n instanceof en){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.stroke,h=s.enable?s.width:0,o=s.style,a=h!==this.strokeWidth||o!==this.strokeStyle,c=X(n),f=this.transformLocalId!==c,v=n.points,b=v.id,d=b!==this.pointsId,g=v.style,m=g!==this.pointsStyle;(u||f||a||d||m)&&(this.sizeX=r,this.sizeY=e,this.strokeWidth=h,this.strokeStyle=o,this.transformLocalId=c,this.pointsId=b,this.pointsStyle=g,d&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),l(t.vertices,t.steps,t.colorFills,this.vertexOffset,v.values,v.size,h,o,n.transform.internalTransform))}},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),v(t.uvs,this.vertexOffset,J(i)))},n}(W),sn=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=NaN,this.scaleX=1,this.scaleY=1,this.size=NaN,this.family="auto",this.value="",this.texture=null,this.textureTransformId=NaN,this.color=NaN,this.alpha=NaN,this.weight=NaN,this.style=NaN,this.alignHorizontal=NaN,this.alignVertical=NaN,this.offsetHorizontal=NaN,this.offsetVertical=NaN,this.outlineWidth=NaN,this.outlineColor=NaN,this.outlineAlpha=NaN,this.spacingHorizontal=NaN,this.spacingVertical=NaN,this.direction=NaN,this.paddingHorizontal=NaN,this.paddingVertical=NaN,this.clipping=!1,this.fitting=!1}return n.prototype.init=function(t){var n=this.vertexCount;if(0<n){var i=this.vertexOffset;t.updateClippings(),S(t.clippings,i,n),t.updateIndices(),T(t.indices,i,this.indexOffset,this.indexCount)}},n.prototype.isCompatible=function(t){return 4*M(t)===this.vertexCount},n.prototype.update=function(t,n){if(0<this.vertexCount){var i=n.text.atlas;null!=i&&(this.updateVertex(t,n,i),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateStep(t,n))}},n.prototype.updateVertex=function(n,i,r){var e=i.size,u=e.x,s=e.y,h=u!==this.sizeX||s!==this.sizeY,o=X(i),a=this.transformLocalId!==o,c=i.text,f=c.size,l=c.family,v=c.value,b=c.style,d=c.align.horizontal,g=c.align.vertical,m=c.offset.horizontal,w=c.offset.vertical,p=c.spacing.horizontal,O=c.spacing.vertical,D=c.direction,E=c.padding.horizontal,M=c.padding.vertical,S=c.clipping,T=c.fitting,j=c.texture||t.Texture.WHITE,N=Y(j),C=v!==this.value||l!==this.family,A=f!==this.size,R=b!==this.style,k=d!==this.alignHorizontal||g!==this.alignVertical,L=m!==this.offsetHorizontal||w!==this.offsetVertical,y=p!==this.spacingHorizontal||O!==this.spacingVertical||E!==this.paddingHorizontal||M!==this.paddingVertical,x=D!==this.direction,B=this.clipping!==S,_=this.fitting!==T,P=j!==this.texture||N!==this.textureTransformId;if(h||a||C||A||R||k||L||y||x||B||_||P){this.size=f,this.family=l,this.value=v,this.style=b,this.alignHorizontal=d,this.alignVertical=g,this.offsetHorizontal=m,this.offsetVertical=w,this.spacingHorizontal=p,this.spacingVertical=O,this.direction=D,this.paddingHorizontal=E,this.paddingVertical=M,this.clipping=S,this.fitting=T,this.texture=j,this.textureTransformId=N,(A||_||T&&h)&&(this.weight=NaN),n.updateVertices(),n.updateUvs();var F=i.size,U=c.world;null==U&&(U=[0,0,0,0,0,0,0,0],c.world=U),I(n.vertices,n.uvs,this.vertexOffset,this.vertexCount,0,0,F.x,F.y,r,f,v,b,d,g,m,w,p,O,D,E,M,S,T,U,J(j),i.transform.internalTransform)}},n.prototype.updateColorFill=function(t,n){var i=n.text,r=i.color,e=n.visible&&i.enable?i.alpha:0;r===this.color&&e===this.alpha||(this.color=r,this.alpha=e,t.updateColorFills(),V(r,e,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.text,r=i.outline,e=r.color,u=n.visible&&i.enable?r.alpha:0;e===this.outlineColor&&u===this.outlineAlpha||(this.outlineColor=e,this.outlineAlpha=u,t.updateColorStrokes(),V(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.updateStep=function(t,n){var i=n.text,r=i.outline,e=r.enable?r.width:0,u=e!==this.outlineWidth,s=i.weight,h=s!==this.weight,o=1,a=1,c=i.world;null!=c&&(o=c[8],a=c[9]);var f=D<Math.abs(this.scaleX-o)||D<Math.abs(this.scaleY-a);(h||u||f)&&(this.weight=s,this.outlineWidth=e,this.scaleX=o,this.scaleY=a,t.updateSteps(),j(t.steps,this.vertexOffset,this.vertexCount,i.atlas,i.size,e,s,this.scaleX,this.scaleY))},n.prototype.buildUnit=function(n){if(0<this.vertexCount){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;r!==n.baseTexture&&(n.baseTexture=r,n.push(i,this.indexOffset))}},n}(),hn=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=4+h,c=2+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new un(i,r),new sn(i+4,r+2,h,o)]).init(n):null},on=function(t,n,i){var r=t.length;if(n<r)return t;for(var e="",u=0,s=n-r;u<s;++u)e+=i;return e+t},an=function(){function t(){}return t.toCode=function(t){return on(t.toString(16).toUpperCase(),6,"0")},t.fromCode=function(t){var n=t.trim().toLowerCase();if(6===n.length){var i=Number("0x".concat(n));if(i==i)return i}return null},t.fromRgb=function(t,n,i){return 255*t<<16|255*n<<8|255*i|0},t.blend=function(t,n,i){var r=t>>16&255,e=t>>8&255,u=255&(0|t),s=n>>16&255,h=n>>8&255,o=255&(0|n),a=Math.max(0,Math.min(1,i)),c=1-a;return Math.max(0,Math.min(255,r*c+s*a))<<16|Math.max(0,Math.min(255,e*c+h*a))<<8|0|Math.max(0,Math.min(255,u*c+o*a))},t.brighten=function(t,n){return 0<=n?this.blend(t,16777215,n):this.blend(t,0,-n)},t.darken=function(t,n){return 0<=n?this.blend(t,0,n):this.blend(t,16777215,-n)},t.toGrayscale=function(t){var n=this.toLuma(t);return n<<16|n<<8|n},t.toLuma=function(t){return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(255&(0|t))&255},t}(),cn={NONE:0,POSITION_X:1,POSITION_Y:2,POSITION:3,ROTATION:4,COLOR_FILL:8,COLOR_STROKE:16,COLOR_FILL_AND_STROKE:24,COLOR_TEXT:32,COLOR_TEXT_OUTLINE:64,COLOR:120,VISIBILITY:128,HEIGHT:256,WIDTH:512,SIZE:768,TEXT:1024,CURSOR:2048},fn=function(){function t(){}return t.toBaseFill=function(t,n){return(n.written&cn.COLOR_FILL?t:n).fill},t.toBaseStroke=function(t,n){return(n.written&cn.COLOR_STROKE?t:n).stroke},t.toBaseText=function(t,n){return(n.written&cn.COLOR_TEXT?t:n).text},t.toBaseTextOutline=function(t,n){return(n.written&cn.COLOR_TEXT_OUTLINE?t:n).text.outline},t}(),ln={isInitializing:!1},vn=function(){function t(){}return t.from=function(t,n,i,r,e,u){if(t.trim().length<=0)return i;try{var s="try {with (shape) {with (state) {with (data.alias) {with (environment) {"+(e?"var result = (".concat(t,");")+"return (result != null ? ".concat(n,"(result) : null);"):"return ".concat(n,"(").concat(t,");"))+"}}}}} catch (e) {"+"return ".concat(r,";")+"}";return null==u?Function("shape","time","environment",s):Function("shape","time","environment",u,s)}catch(t){return i}},t.ofNumberOrNull=function(t){return this.from(t,"Number",this.NULL,"null",!0)},t.ofStringOrNull=function(t){return this.from(t,"String",this.NULL,"null",!0)},t.ofUnknown=function(t){return this.from(t,"",this.NULL,"null",!1)},t.ofNumber=function(t){return this.from(t,"Number",this.ZERO,"0",!1)},t.ofNumberOrOne=function(t){return this.from(t,"Number",this.ONE,"1",!1)},t.ofNumberOrOneHundred=function(t){return this.from(t,"Number",this.ONE_HUNDRED,"100",!1)},t.ofString=function(t){return this.from(t,"String",this.EMPTY,'""',!1)},t.ofBoolean=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrTrue=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrFalse=function(t){return this.from(t,"Boolean",this.FALSE,"false",!1)},t.ofElementOrNull=function(t){return this.from(t,"",void 0,"null",!1,"container")},t.NULL=function(){return null},t.ZERO=function(){return 0},t.ONE=function(){return 1},t.ONE_HUNDRED=function(){return 100},t.EMPTY=function(){return""},t.TRUE=function(){return!0},t.FALSE=function(){return!1},t}(),bn=function(){function t(t){this.reset=t||cn.NONE}return t.prototype.initialize=function(t,n){},t.prototype.execute=function(t,n,i){},t.prototype.onResize=function(t,n){},t.prototype.onFocus=function(t,n){},t.prototype.onBlur=function(t,n){},t.prototype.onClick=function(t,n,i){},t.prototype.onDblClick=function(t,n,i,r){},t.prototype.onDowning=function(t,n,i){},t.prototype.onDown=function(t,n,i){},t.prototype.onMove=function(t,n,i){},t.prototype.onOver=function(t,n,i){},t.prototype.onOut=function(t,n,i){},t.prototype.onUp=function(t,n,i){},t.prototype.onUpOutside=function(t,n,i){},t.prototype.onPressed=function(t,n,i){},t.prototype.onUnpressed=function(t,n,i){},t.prototype.onKeyDown=function(t,n,i){},t.prototype.onKeyUp=function(t,n,i){},t.prototype.onRightClick=function(t,n,i){},t.prototype.onRightDowning=function(t,n,i){},t.prototype.onRightDown=function(t,n,i){},t.prototype.onRightUp=function(t,n,i){},t.prototype.onRightUpOutside=function(t,n,i){},t.prototype.onRightPressed=function(t,n,i){},t.prototype.onRightUnpressed=function(t,n,i){},t.prototype.onRender=function(t,n,i,r){},t}(),dn=function(t){function n(n,i){var r=t.call(this,i)||this;return r.condition=vn.ofBoolean(n.condition),r}return _(n,t),n}(bn),gn=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.interval=n.interval,r}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.interval,e=r<<1,u=i%e;u<r?(this.toOff(t,n),n.effect=i+(r-u)):(this.toOn(t,n),n.effect=i+(e-u))}},n.prototype.toOn=function(t,n){},n.prototype.toOff=function(t,n){},n}(dn),mn=function(t){function n(n){return t.call(this,n,cn.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=fn.toBaseFill(t,n);t.fill.set(void 0,an.brighten(i.color,.5),i.alpha);var r=fn.toBaseStroke(t,n);t.stroke.set(void 0,an.brighten(r.color,.5),r.alpha);var e=fn.toBaseText(t,n);t.text.set(void 0,an.brighten(e.color,.5),e.alpha);var u=fn.toBaseTextOutline(t,n);t.text.outline.set(void 0,an.brighten(u.color,.5),u.alpha),n.written|=this.reset},n}(gn),wn=function(t){function n(n){var i=t.call(this,n,cn.COLOR_FILL)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.fill.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(gn),pn=function(t){function n(n){var i=t.call(this,n,cn.COLOR_STROKE)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.stroke.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(gn),On=function(t){function n(n){return t.call(this,n,cn.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=fn.toBaseFill(t,n);t.fill.set(void 0,an.darken(i.color,.5),i.alpha);var r=fn.toBaseStroke(t,n);t.stroke.set(void 0,an.darken(r.color,.5),r.alpha);var e=fn.toBaseText(t,n);t.text.set(void 0,an.darken(e.color,.5),e.alpha);var u=fn.toBaseTextOutline(t,n);t.text.outline.set(void 0,an.darken(u.color,.5),u.alpha),n.written|=this.reset},n}(gn),Dn=function(t){function n(n){return t.call(this,n,cn.COLOR_FILL_AND_STROKE)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=fn.toBaseFill(t,n);t.fill.set(void 0,i.color,.5*i.alpha);var r=fn.toBaseStroke(t,n);t.stroke.set(void 0,r.color,.5*r.alpha),n.written|=this.reset},n}(gn),En=function(t){function n(n){return t.call(this,n,cn.VISIBILITY)||this}return _(n,t),n.prototype.toOn=function(t,n){t.visible=!0,n.written|=this.reset},n.prototype.toOff=function(t,n){t.visible=!1,n.written|=this.reset},n}(gn),Mn={VISIBILITY:0,BRIGHTEN:1,DARKEN:2,OPACITY:3,COLOR_FILL:4,COLOR_STROKE:5},Sn=function(){function t(t,n){this.type=t,this.condition=n}return t.prototype.isEquals=function(t){return this.type===t.type&&this.condition===t.condition},t.prototype.toLabel=function(){return this.getTheme().toLabel(this)},t.prototype.getTheme=function(){var n;return null!==(n=t.THEME)&&void 0!==n?n:t.THEME=Z.getInstance().get("EShapeActionValue")},t}(),Tn=function(t){function n(n,i,r){var e=t.call(this,n,i)||this;return e.subtype=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.subtype===i.subtype},n}(Sn),jn={SHOW_HIDE:0,BLINK:1,TRANSFORM:2,OPEN:3,EMIT_EVENT:4,CHANGE_COLOR_LEGACY:5,CHANGE_TEXT:6,CHANGE_CURSOR:7,MISC:8,CHANGE_COLOR:9,GESTURE:10,EXTENSION:1e3},Nn=function(){function t(){}return t.toResource=function(t,n,i){if(0<=t&&t<n.length){var r=n[t];if(pt(r)&&0<=r&&r<i.length)return i[r]}return""},t}(),In=function(t){function n(n,i,r,e,u){var s=t.call(this,jn.BLINK,i,n)||this;return s.interval=r,s.color=e,s.alpha=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.interval===i.interval&&this.color===i.color&&this.alpha===i.alpha},n.prototype.toRuntime=function(){switch(this.subtype){case Mn.BRIGHTEN:return new mn(this);case Mn.COLOR_FILL:return new wn(this);case Mn.COLOR_STROKE:return new pn(this);case Mn.DARKEN:return new On(this);case Mn.OPACITY:return new Dn(this);case Mn.VISIBILITY:return new En(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.interval,",").concat(this.color,",").concat(this.alpha,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources);return new n(t[2],r,t[3],t[4],t[5])},n}(Tn),Cn=function(){function t(){}return t.blend=function(t,n,i){var r=Math.max(0,Math.min(1,i));return Math.max(0,Math.min(1,t*(1-r)+n*r))},t}(),An=function(t){function n(n){return t.call(this,n,n.subtype<<3)||this}return _(n,t),n.prototype.set=function(t,n,i,r,e,u){var s=this.reset;if(null!=r){if(null!=e)if(null!=u){if(s&cn.COLOR_FILL){var h=fn.toBaseFill(t,n);t.fill.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u))}s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,an.blend(h.color,r,u),Cn.blend(h.alpha,e,u)))}else s&cn.COLOR_FILL&&t.fill.set(void 0,r,e),s&cn.COLOR_STROKE&&t.stroke.set(void 0,r,e),s&cn.COLOR_TEXT&&t.text.set(void 0,r,e),s&cn.COLOR_TEXT_OUTLINE&&t.text.outline.set(void 0,r,e);else null!=u?(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,an.blend(h.color,r,u),h.alpha)),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,an.blend(h.color,r,u),h.alpha)),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,an.blend(h.color,r,u),h.alpha)),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,an.blend(h.color,r,u),h.alpha))):(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,r,h.alpha)),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,r,h.alpha)),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,r,h.alpha)),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,r,h.alpha)));n.written|=s}else null!=e&&(null!=u?(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,h.color,Cn.blend(h.alpha,e,u))),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,h.color,Cn.blend(h.alpha,e,u))),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,Cn.blend(h.alpha,e,u)))):(s&cn.COLOR_FILL&&(h=fn.toBaseFill(t,n),t.fill.set(void 0,h.color,e)),s&cn.COLOR_STROKE&&(h=fn.toBaseStroke(t,n),t.stroke.set(void 0,h.color,e)),s&cn.COLOR_TEXT&&(h=fn.toBaseText(t,n),t.text.set(void 0,h.color,e)),s&cn.COLOR_TEXT_OUTLINE&&(h=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,e))),n.written|=s)},n}(dn),Rn={COLOR_AND_ALPHA:0,COLOR:1,ALPHA:2,CODE:3,BRIGHTNESS:4},kn=function(t){function n(n){var i=t.call(this,n)||this;switch(n.target){case Rn.COLOR:i.color=n.color,i.alpha=null;break;case Rn.ALPHA:i.color=null,i.alpha=n.alpha;break;default:i.color=n.color,i.alpha=n.alpha}return i.blend=vn.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.color,e=this.alpha,u=this.blend(t,i,ln);this.set(t,n,i,r,e,u)}},n}(An),Ln={NONE:0,FILL:1,STROKE:2,TEXT:4,TEXT_OUTLINE:8,FILL_AND_STROKE:3,ALL:15},yn={FILL:0,STROKE:1,FILL_AND_STROKE:2,TEXT:3,TEXT_OUTLINE:4,ALL:5},xn=function(){function t(){}return t.from=function(t){if(t[0]===jn.CHANGE_COLOR)return t[2];switch(t[2]){case yn.FILL:return Ln.FILL;case yn.STROKE:return Ln.STROKE;case yn.FILL_AND_STROKE:return Ln.FILL_AND_STROKE;case yn.TEXT:return Ln.TEXT;case yn.TEXT_OUTLINE:return Ln.TEXT_OUTLINE;case yn.ALL:return Ln.ALL}},t.unpack=function(t){var n=[];return t&Ln.FILL&&n.push(Ln.FILL),t&Ln.STROKE&&n.push(Ln.STROKE),t&Ln.TEXT&&n.push(Ln.TEXT),t&Ln.TEXT_OUTLINE&&n.push(Ln.TEXT_OUTLINE),n},t.pack=function(t){for(var n=Ln.NONE,i=0,r=t.length;i<r;++i)n|=t[i];return n},t}(),Bn=function(t){function n(n,i,r,e,u,s){var h=t.call(this,jn.CHANGE_COLOR,i,n)||this;return h.target=r,h.color=e,h.alpha=u,h.blend=s,h}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new kn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.target,",").concat(this.color,",").concat(this.alpha,",").concat(i,"]"))},n.deserialize=function(t,i){var r=xn.from(t),e=Nn.toResource(1,t,i.resources),u=Nn.toResource(6,t,i.resources);return new n(r,e,t[3],t[4],t[5],u)},n}(Tn),_n=function(t){function n(n){var i=t.call(this,n)||this;return i.brightness=vn.ofNumberOrNull(n.brightness),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.brightness(t,i,ln);this.set(t,n,i,r)}},n.prototype.set=function(t,n,i,r){var e=this.reset;if(null!=r){var u=this.toAdjusted;if(e&cn.COLOR_FILL){var s=fn.toBaseFill(t,n);t.fill.set(void 0,u(s.color,r),s.alpha)}e&cn.COLOR_STROKE&&(s=fn.toBaseStroke(t,n),t.stroke.set(void 0,u(s.color,r),s.alpha)),e&cn.COLOR_TEXT&&(s=fn.toBaseText(t,n),t.text.set(void 0,u(s.color,r),s.alpha)),e&cn.COLOR_TEXT_OUTLINE&&(s=fn.toBaseTextOutline(t,n),t.text.outline.set(void 0,u(s.color,r),s.alpha)),n.written|=e}},n.prototype.toAdjusted=function(t,n){return 0<=n?an.brighten(t,+n):an.darken(t,-n)},n}(An),Pn=function(t){function n(n,i,r){var e=t.call(this,jn.CHANGE_COLOR,i,n)||this;return e.brightness=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.brightness===i.brightness},n.prototype.toRuntime=function(){return new _n(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=Rn.BRIGHTNESS,r=t.addResource(this.brightness);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(xn.from(t),Nn.toResource(1,t,i.resources),Nn.toResource(4,t,i.resources))},n}(Tn),Fn=function(t){function n(n){var i=t.call(this,n)||this;return i.color=vn.ofNumberOrNull(n.color),i.alpha=vn.ofNumberOrNull(n.alpha),i.blend=vn.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.color(t,i,ln),e=this.alpha(t,i,ln),u=this.blend(t,i,ln);this.set(t,n,i,r,e,u)}},n}(An),Un=function(t){function n(n,i,r,e,u){var s=t.call(this,jn.CHANGE_COLOR,i,n)||this;return s.color=r,s.alpha=e,s.blend=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new Fn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=Rn.CODE,r=t.addResource(this.color),e=t.addResource(this.alpha),u=t.addResource(this.blend);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,",").concat(e,",").concat(u,"]"))},n.deserialize=function(t,i){return new n(xn.from(t),Nn.toResource(1,t,i.resources),Nn.toResource(4,t,i.resources),Nn.toResource(5,t,i.resources),Nn.toResource(6,t,i.resources))},n}(Tn),Gn=function(t){function n(n){var i=t.call(this,n,cn.CURSOR)||this;return i.name=vn.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.name(t,i,ln);null!=r&&(t.cursor=r,n.written|=this.reset)}},n}(dn),Hn=function(t){function n(n,i){var r=t.call(this,jn.CHANGE_CURSOR,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new Gn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),Nn.toResource(2,t,i.resources))},n}(Sn),zn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"AM":"PM"},t}(),Vn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"am":"pm"},t}(),Wn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getDate())},t}(),Xn=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t)},t}(),Kn=function(t){this.precision=null!=t?+t.substring(1,t.length):void 0},Yn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toExponential(this.precision)},n}(Kn),Jn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toFixed(this.precision)},n}(Kn),Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){var r=this.toAbs(t,n,i);return r<1e-24?this.an(t,1,""):r<1e-21?this.an(t,1e24,"y"):r<1e-18?this.an(t,1e21,"z"):r<1e-15?this.an(t,1e18,"a"):r<1e-12?this.an(t,1e15,"f"):r<1e-9?this.an(t,1e12,"p"):r<1e-6?this.an(t,1e9,"n"):r<.001?this.an(t,1e6,"μ"):r<1?this.an(t,1e3,"m"):r<1e3?this.an(t,1,""):r<1e6?this.an(t,.001,"k"):r<1e9?this.an(t,1e-6,"M"):r<1e12?this.an(t,1e-9,"G"):r<1e15?this.an(t,1e-12,"T"):r<1e18?this.an(t,1e-15,"P"):r<1e21?this.an(t,1e-18,"E"):r<1e24?this.an(t,1e-21,"Z"):this.an(t,1e-24,"Y")},n.prototype.toAbs=function(t,n,i){return Math.abs(t)},n.prototype.an=function(t,n,i){return"".concat((t*n).toFixed(this.precision)).concat(i)},n}(Kn),qn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toPrecision(this.precision)},n}(Kn),Qn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours())},t}(),$n=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours()%12)},t}(),ti=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMonth()+1)},t}(),ni=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMinutes())},t}(),ii=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMilliseconds())},t}(),ri=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(100*t|0,"%")},t}(),ei=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(0|t,"%")},t}(),ui=function(){function t(t,n,i){this.length=t,this.character=n,this.node=i}return t.prototype.format=function(t,n,i){return on(this.node.format(t,n,i),this.length,this.character)},t}(),si=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"===r[0]?"(".concat(r.substring(1,r.length),")"):r},t}(),hi=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?"+".concat(r):r},t}(),oi=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(100*t),"%")},t}(),ai=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t),"%")},t}(),ci=function(){function t(t,n,i,r,e,u,s){this.Y=t,this.M=n,this.D=i,this.H=r,this.m=e,this.s=u,this.mi=s}return t.prototype.format=function(t,n,i){if(n<1e3)return"".concat(this.s.format(t,n,i),".").concat(this.mi.format(t,n,i));if(n<6e4)return"".concat(this.m.format(t,n,i),":").concat(this.s.format(t,n,i));if(n<36e5)return"".concat(this.H.format(t,n,i),":").concat(this.m.format(t,n,i));if(n<864e5){var r=this.M.format(t,n,i),e=this.D.format(t,n,i);return"".concat(r,"/").concat(e," ").concat(this.H.format(t,n,i))}return n<2592e6?"".concat(this.M.format(t,n,i),"/").concat(this.D.format(t,n,i)):"".concat(this.Y.format(t,n,i),"/").concat(this.M.format(t,n,i))},t}(),fi=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?" ".concat(r):r},t}(),li=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toAbs=function(t,n,i){return Math.abs(n)},n}(Zn),vi=function(){function t(t){this.str=t}return t.prototype.format=function(t,n,i){return this.str},t}(),bi=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear())},t}(),di=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear()%100)},t}(),gi=function(){function t(){}return t.prototype.format=function(t,n,i){var r=i.getTimezoneOffset(),e=r<=0?"+":"-",u=on(String(Math.floor(Math.abs(r)/60)),2,"0"),s=on(String(Math.floor(Math.abs(r)%60)),2,"0");return"".concat(e).concat(u,":").concat(s)},t}(),mi=function(){function t(){}return t.prototype.format=function(t,n,i){return"".concat(Math.round(t))},t}(),wi=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getSeconds())},t}(),pi=void 0,Oi=function(t,n,i){switch(t){case"_":return new ui(n," ",i);case"-":return i;default:return new ui(n,"0",i)}},Di=function(t,n){switch(t){case"_":return new fi(n);case"+":return new hi(n);case"(":return new si(n);default:return n}},Ei=function(){function t(t){var n=function(t){for(var n=0,i=!1,r=[],e=function(){var t=pi;return t?t.lastIndex=0:pi=t=/%(0|_|-|\+|\()?(\.\d+)?(Y(?:MD?)?|y(?:MD?)?|MD?|D|H(?:ms?)?|h(?:ms?)?|m(?:i|s)?|a|A|s(?:s?i|dt)?|z|%|f(?:si)?|e|g|d|r(?:d|p)|p|P|RP)/g,t}();;){var u=e.exec(t);if(null==u){n<t.length&&r.push(new vi(t.substring(n,t.length)));break}var s=u.index;n<s&&r.push(new vi(t.substring(n,s))),n=s+u[0].length;var h=u[0],o=u[1],a=u[2];switch(u[3]){case"Y":i=!0,r.push(new bi);break;case"YM":i=!0,r.push(new bi,new vi("/"),Oi(o,2,new ti));break;case"YMD":i=!0,r.push(new bi,new vi("/"),Oi(o,2,new ti),new vi("/"),Oi(o,2,new Wn));break;case"y":i=!0,r.push(Oi(o,2,new di));break;case"yM":i=!0,r.push(Oi(o,2,new di),new vi("/"),Oi(o,2,new ti));break;case"yMD":r.push(Oi(o,2,new di),new vi("/"),Oi(o,2,new ti),new vi("/"),Oi(o,2,new Wn));break;case"M":i=!0,r.push(Oi(o,2,new ti));break;case"MD":i=!0,r.push(Oi(o,2,new ti),new vi("/"),Oi(o,2,new Wn));break;case"D":i=!0,r.push(Oi(o,2,new Wn));break;case"H":i=!0,r.push(Oi(o,2,new Qn));break;case"Hm":i=!0,r.push(Oi(o,2,new Qn),new vi(":"),Oi(o,2,new ni));break;case"Hms":i=!0,r.push(Oi(o,2,new Qn),new vi(":"),Oi(o,2,new ni),new vi(":"),Oi(o,2,new wi));break;case"h":i=!0,r.push(Oi(o,2,new $n));break;case"hm":i=!0,r.push(Oi(o,2,new $n),new vi(":"),Oi(o,2,new ni));break;case"hms":i=!0,r.push(Oi(o,2,new $n),new vi(":"),Oi(o,2,new ni),new vi(":"),Oi(o,2,new wi));break;case"m":i=!0,r.push(Oi(o,2,new ni));break;case"ms":i=!0,r.push(Oi(o,2,new ni),new vi(":"),Oi(o,2,new wi));break;case"mi":i=!0,r.push(Oi(o,3,new ii));break;case"a":i=!0,r.push(new Vn);break;case"A":i=!0,r.push(new zn);break;case"s":i=!0,r.push(Oi(o,2,new wi));break;case"sdt":i=!0,r.push(new ci(new bi,Oi(o,2,new ti),Oi(o,2,new Wn),Oi(o,2,new Qn),Oi(o,2,new ni),Oi(o,2,new wi),Oi(o,3,new ii)));break;case"z":i=!0,r.push(new gi);break;case"%":r.push(new vi("%"));break;case"f":r.push(Di(o,new Jn(a)));break;case"e":r.push(Di(o,new Yn(a)));break;case"g":r.push(Di(o,new qn(a)));break;case"rd":r.push(Di(o,new mi));break;case"d":r.push(Di(o,new Xn));break;case"P":r.push(Di(o,new ri));break;case"p":r.push(Di(o,new ei));break;case"RP":r.push(Di(o,new oi));break;case"rp":r.push(Di(o,new ai));break;case"fsi":r.push(Di(o,new Zn(a)));break;case"ssi":r.push(Di(o,new li(a)));break;default:r.push(new vi(h))}}return{nodes:r,date:i}}(t);this.date=n.date,this.nodes=n.nodes}return t.prototype.format=function(n,i){var r=this.nodes,e=t.DATE;null==e&&(e=new Date,t.DATE=e),this.date&&e.setTime(n);for(var u="",s=0,h=r.length;s<h;++s)u+=r[s].format(n,i,e);return u},t}(),Mi=function(){function t(){}return t.create=function(t){return new Ei(t)},t}(),Si=function(t){function n(n){var i=t.call(this,n,cn.TEXT)||this;return i.number=vn.ofNumber(n.value),i.formatters=new Map,i}return _(n,t),n.prototype.getFormatter=function(t,n){var i=this.formatters,r=n.text.value,e=i.get(r);return void 0===e&&(e=this.newFormatter(r),i.set(r,e)),e},n.prototype.newFormatter=function(t){return 0<(t=t.trim()).length?Mi.create(t):null},n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.number(t,i,ln),e=this.getFormatter(t,n);t.text.value=null!=e?e.format(r,0):String(r),n.written|=this.reset}},n}(dn),Ti=function(t){function n(n){var i=t.call(this,n,cn.TEXT)||this;return i.text=vn.ofString(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,ln)&&(t.text.value=this.text(t,i,ln),n.written|=this.reset)},n}(dn),ji={TEXT:0,NUMBER:1},Ni=function(t){function n(n,i,r){var e=t.call(this,jn.CHANGE_TEXT,i,n)||this;return e.value=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.value===i.value},n.prototype.toRuntime=function(){switch(this.subtype){case ji.TEXT:return new Ti(this);case ji.NUMBER:return new Si(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(3,t,i.resources);return new n(t[2],r,e)},n}(Tn),Ii=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.background;r&&(this.S=r.color,this.T=r.alpha)}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBackgroundColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBackgroundAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.fn;null!=t&&t()},t}(),Ci={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_RIGHT:3,TOP_BOTTOM:5,TOP_LEFT:9,RIGHT_BOTTOM:6,RIGHT_LEFT:10,BOTTOM_LEFT:12,NOT_TOP:14,NOT_RIGHT:13,NOT_BOTTOM:11,NOT_LEFT:7,ALL:15},Ai=function(t,n){return Ot(t)?n[t]:t},Ri=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.border;r&&(this.S=r.color,this.T=r.alpha,this.kt=r.width,this.Lt=r.align,this.ln=Ai(r.mask,Ci))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.kt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Lt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Lt},set:function(t){this.Lt!==t&&(this.Lt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.ln;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getBorderMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.ln},set:function(t){this.ln!==t&&(this.ln=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.fn;null!=t&&t()},t}(),ki={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},Li=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.corner;r&&(pt(r)?(this.sn=r,this.ln=void 0):(this.sn=r.radius,this.ln=Ai(r.mask,ki)))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getRadius=function(){var t;return null!==(t=this.sn)&&void 0!==t?t:this.cn.getCornerRadius()},Object.defineProperty(t.prototype,"radius",{get:function(){return this.sn},set:function(t){if(this.sn!==t){this.sn=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(){var t;return null!==(t=this.ln)&&void 0!==t?t:this.cn.getCornerMask()},Object.defineProperty(t.prototype,"mask",{get:function(){return this.ln},set:function(t){if(this.ln!==t){this.ln=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;this.sn!==t&&(this.sn=t,i=!0),this.ln!==n&&(this.ln=n,i=!0);var r=this.fn;i&&null!=r&&r()},t}(),yi={NONE:0,SELF:1,CHILDREN:2,BOTH:3},xi=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.outline;r&&(this.S=r.color,this.T=r.alpha,this.kt=r.width,this.vn=r.offset,this.Lt=r.align,this.ln=Ai(r.mask,Ci))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getColor=function(t){var n=this.S;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){if(this.S!==t){this.S=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.T;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){if(this.T!==t){this.T=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.kt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},set:function(t){if(this.kt!==t){this.kt=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getOffset=function(t){var n=this.vn;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineOffset(t)},Object.defineProperty(t.prototype,"offset",{get:function(){return this.vn},set:function(t){if(this.vn!==t){this.vn=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.Lt;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.Lt},set:function(t){if(this.Lt!==t){this.Lt=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.ln;if(void 0!==n){if(!wt(n))return n;var i=n(t);if(void 0!==i)return i}return this.cn.getOutlineMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.ln},set:function(t){if(this.ln!==t){this.ln=t;var n=this.fn;null!=n&&n()}},enumerable:!1,configurable:!0}),t}(),Bi=function(){function t(t,n,i){this.cn=t,this.fn=i;var r=null==n?void 0:n.padding;null!=r&&(pt(r)?(this.bn=r,this.dn=r,this.gn=r,this.mn=r):(this.bn=r.left,this.dn=r.top,this.gn=r.right,this.mn=r.bottom))}return t.prototype.getTheme=function(){return this.cn},t.prototype.setTheme=function(t){this.cn=t},t.prototype.getCallback=function(){return this.fn},t.prototype.getLeft=function(){var t;return null!==(t=this.bn)&&void 0!==t?t:this.cn.getPaddingLeft()},Object.defineProperty(t.prototype,"left",{get:function(){return this.bn},set:function(t){this.bn!==t&&(this.bn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){var t;return null!==(t=this.dn)&&void 0!==t?t:this.cn.getPaddingTop()},Object.defineProperty(t.prototype,"top",{get:function(){return this.dn},set:function(t){this.dn!==t&&(this.dn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){var t;return null!==(t=this.gn)&&void 0!==t?t:this.cn.getPaddingRight()},Object.defineProperty(t.prototype,"right",{get:function(){return this.gn},set:function(t){this.gn!==t&&(this.gn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){var t;return null!==(t=this.mn)&&void 0!==t?t:this.cn.getPaddingBottom()},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.mn},set:function(t){this.mn!==t&&(this.mn=t,null!=this.fn&&this.fn())},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r),null!=this.fn&&this.fn()},t}(),_i=function(){function t(t,n){this.wn=t,this.ut=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this.wn.x},set:function(t){var n=this.wn,i=n.x;if(i!==t){n.x=t;var r=n.y;this.ut(t,r,i,r)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.wn.y},set:function(t){var n=this.wn,i=n.y;if(i!==t){n.y=t;var r=n.x;this.ut(r,t,r,i)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=this.wn,r=i.x,e=i.y;return r===t&&e===n||(i.set(t,n),this.ut(t,n,r,e)),this},t.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.wn,e=r.x,u=r.y;return e===n&&u===i||(r.copyFrom(t),this.ut(n,i,e,u)),this},t.prototype.copyTo=function(t){return t.copyFrom(this.wn)},t.prototype.copy=function(){return this.copyFrom(arguments[0])},t.prototype.clone=function(n){return new t(this.wn,n||this.ut)},t.prototype.equals=function(t){return this.wn.equals(t)},t}(),Pi=function(t){function n(n,i,r){var e=t.call(this,n,i,r)||this;return e.kt=100,e.pn=100,e.On=0,e.Dn=ki.NONE,e.En=!0,e.Mn=1,e.Sn=e.getBuffer("aVertexPosition"),e.Tn=e.Sn.data,e.jn=e.getBuffer("aTextureCoord"),e._uvs=e.jn.data,e.Nn=e.getIndex(),e.In=e.Nn.data,e}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.kt},set:function(t){this.kt!==t&&(this.kt=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.pn},set:function(t){this.pn!==t&&(this.pn=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerRadius",{get:function(){return this.On},set:function(t){this.On!==t&&(this.On=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerMask",{get:function(){return this.Dn},set:function(t){this.Dn!==t&&(this.Dn=t,this.En=!0)},enumerable:!1,configurable:!0}),n.prototype.getTables=function(){var t=n.TABLES;return null==t&&(t=this.newTables(n.N),n.TABLES=t),t},n.prototype.newTables=function(t){var n=1/(t-1)*.5;return[this.newTable(t,1,n),this.newTable(t,.5,n),this.newTable(t,0,n),this.newTable(t,1.5,n)]},n.prototype.newTable=function(t,n,i){for(var r=[],e=[],u=Math.PI,s=0,h=n;s<t;s+=1,h-=i){var o=h*u,a=+Math.cos(o),c=-Math.sin(o);r.push(a),e.push(c)}return{cos:r,sin:e}},n.N=4,n}(t.MeshGeometry),Fi=function(t){function n(){return t.call(this,new Float32Array(16*Pi.N),new Float32Array(16*Pi.N),new Uint16Array(3*(12*Pi.N-2)))||this}return _(n,t),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a){for(var c=a.cos,f=a.sin,l=c[0],v=f[0],b=c[e-1],d=f[e-1],g=0;g<e;++g){var m=c[g],w=f[g],p=o,O=m*l+w*v;1e-4<O&&(p=Math.min(p,(1/O-1)*h));var D=m*b+w*d;1e-4<D&&(p=Math.min(p,(1/D-1)*h));var E=h+p;t[++i]=u+m*h,t[++i]=s+w*h,t[++i]=u+m*E,t[++i]=s+w*E,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+m),n[++r]=.5*(1+w)}},n.prototype.fillIndices=function(t,n,i,r){for(var e=0;e<r;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2},n.prototype.fillIndicesEnd=function(t,n,i,r){for(var e=0,u=r-1;e<u;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2;t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=2},n.prototype.update=function(t){var n=t.resolution;if(this.En||this.Mn!==n){this.En=!1,this.Mn=n;var i=this.Tn,r=this._uvs,e=this.In,u=this.kt,s=this.pn,h=Math.min(.5*u,.5*s,this.On),o=1/n,a=h,c=u-h,f=u,l=h,v=s-h,b=s,d=this.Dn,g=!(d&ki.TOP_LEFT),m=!(d&ki.TOP_RIGHT),w=!(d&ki.BOTTOM_LEFT),p=!(d&ki.BOTTOM_RIGHT),O=-1,D=-1,E=0,M=-1,S=Pi.N,T=S<<2,j=S<<1,N=6*S,I=this.getTables(),C=I[0],A=I[1],R=I[2],k=I[3];g?this.fillVertices(i,r,O,D,S,a,l,h,o,C):this.fillVertices(i,r,O,D,S,0,0,0,0,C),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,m?this.fillVertices(i,r,O,D,S,c,l,h,o,A):this.fillVertices(i,r,O,D,S,f,0,0,0,A),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,p?this.fillVertices(i,r,O,D,S,c,v,h,o,R):this.fillVertices(i,r,O,D,S,f,b,0,0,R),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,w?this.fillVertices(i,r,O,D,S,a,v,h,o,k):this.fillVertices(i,r,O,D,S,0,b,0,0,k),this.fillIndicesEnd(e,E,M,S),O+=T,D+=T,E+=j,M+=N,E=2;for(var L=1,y=4*S-1;L<y;L+=1,E+=2)e[++M]=0,e[++M]=E,e[++M]=E+2;this.Sn.update(),this.jn.update(),this.Nn.update()}},n}(Pi),Ui=function(n){function i(i){var r=n.call(this,new Fi,new t.MeshMaterial(i))||this;return i.on("update",(function(){st.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Gi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Cn;return null==i&&((i=new Ui(n.getBackgroundTexture())).parent=t,this.Cn=i),i},t.prototype.hide=function(){var t=this.Cn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.background,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=this.get(t,r);c.tint=o,c.alpha=a,c.width=n,c.height=i,c.cornerRadius=u,c.cornerMask=s,c.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Cn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Cn)||void 0===t||t.updateTransform()},t}(),Hi=function(t){function n(){var n=t.call(this,new Float32Array(32*Pi.N),new Float32Array(32*Pi.N),new Uint16Array(72*Pi.N))||this;return n.An=0,n.Rn=Ci.NONE,n}return _(n,t),Object.defineProperty(n.prototype,"borderWidth",{get:function(){return this.An},set:function(t){this.An!==t&&(this.An=t,this.En=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"borderMask",{get:function(){return this.Rn},set:function(t){this.Rn!==t&&(this.Rn=t,this.En=!0)},enumerable:!1,configurable:!0}),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=.5*a,l=h-f,v=h+f,b=c.cos,d=c.sin,g=b[0],m=d[0],w=b[e-1],p=d[e-1],O=u+(g+w)*l,D=s+(m+p)*l,E=0;E<e;++E){var M=b[E],S=d[E],T=o,j=o,N=M*g+S*m;if(1e-4<N){var I=1/N-1;T=Math.min(T,I*l),j=Math.min(j,I*v)}var C=M*w+S*p;if(1e-4<C){var A=1/C-1;T=Math.min(T,A*l),j=Math.min(j,A*v)}var R=l+T,k=v+j;0<l?(t[++i]=u+M*l,t[++i]=s+S*l,t[++i]=u+M*R,t[++i]=s+S*R):(t[++i]=O,t[++i]=D,t[++i]=O,t[++i]=D),t[++i]=u+M*v,t[++i]=s+S*v,t[++i]=u+M*k,t[++i]=s+S*k,n[++r]=.5*(1+M),n[++r]=.5*(1+S),n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+M),n[++r]=.5*(1+S)}},n.prototype.fillIndices=function(t,n,i,r,e,u){for(var s=0,h=r-1;s<h;++s)t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2;e?u?(t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=1,t[++i]=1,t[++i]=n+1,t[++i]=2,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=2,t[++i]=2,t[++i]=n+1,t[++i]=3,n+=2):(t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2):(t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=2)},n.prototype.update=function(t){var n=t.resolution;if(this.En||this.Mn!==n){this.En=!1,this.Mn=n;var i=this.Tn,r=this._uvs,e=this.In,u=this.kt,s=this.pn,h=this.An,o=Math.min(.5*u,.5*s,this.On),a=1/n,c=o,f=u-o,l=u,v=o,b=s-o,d=s,g=this.Rn,m=!(g&Ci.TOP),w=!(g&Ci.BOTTOM),p=!(g&Ci.LEFT),O=!(g&Ci.RIGHT),D=this.Dn,E=!(D&ki.TOP_LEFT),M=!(D&ki.TOP_RIGHT),S=!(D&ki.BOTTOM_LEFT),T=!(D&ki.BOTTOM_RIGHT),j=-1,N=-1,I=0,C=-1,A=Pi.N,R=A<<2,k=A<<3,L=18*A,y=this.getTables(),x=y[0],B=y[1],_=y[2],P=y[3];E?p||m?this.fillVertices(i,r,j,N,A,c,v,o,a,h,x):this.fillVertices(i,r,j,N,A,c,v,o,0,0,x):p||m?this.fillVertices(i,r,j,N,A,0,0,0,0,h,x):this.fillVertices(i,r,j,N,A,0,0,0,0,0,x),this.fillIndices(e,I,C,A,m,!1),j+=k,N+=k,I+=R,C+=L,M?m||O?this.fillVertices(i,r,j,N,A,f,v,o,a,h,B):this.fillVertices(i,r,j,N,A,f,v,o,0,0,B):m||O?this.fillVertices(i,r,j,N,A,l,0,0,0,h,B):this.fillVertices(i,r,j,N,A,l,0,0,0,0,B),this.fillIndices(e,I,C,A,O,!1),j+=k,N+=k,I+=R,C+=L,T?O||w?this.fillVertices(i,r,j,N,A,f,b,o,a,h,_):this.fillVertices(i,r,j,N,A,f,b,o,0,0,_):O||w?this.fillVertices(i,r,j,N,A,l,d,0,0,h,_):this.fillVertices(i,r,j,N,A,l,d,0,0,0,_),this.fillIndices(e,I,C,A,w,!1),j+=k,N+=k,I+=R,C+=L,S?w||p?this.fillVertices(i,r,j,N,A,c,b,o,a,h,P):this.fillVertices(i,r,j,N,A,c,b,o,0,0,P):w||p?this.fillVertices(i,r,j,N,A,0,d,0,0,h,P):this.fillVertices(i,r,j,N,A,0,d,0,0,0,P),this.fillIndices(e,I,C,A,p,!0),j+=k,N+=k,I+=R,C+=L,this.Sn.update(),this.jn.update(),this.Nn.update()}},n}(Pi),zi=function(n){function i(i){var r=n.call(this,new Hi,new t.MeshMaterial(i))||this;return i.on("update",(function(){st.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderWidth",{get:function(){return this.geometry.borderWidth},set:function(t){this.geometry.borderWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderMask",{get:function(){return this.geometry.borderMask},set:function(t){this.geometry.borderMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Vi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Cn;return null==i&&((i=new zi(n.getBorderTexture())).parent=t,this.Cn=i),i},t.prototype.hide=function(){var t=this.Cn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.border,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Cn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Cn)||void 0===t||t.updateTransform()},t}(),Wi=function(){function t(){}return t.prototype.get=function(t,n){var i=this.Cn;return null==i&&((i=new zi(n.getBorderTexture())).parent=t,this.Cn=i),i},t.prototype.hide=function(){var t=this.Cn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.outline,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=h.getOffset(e)+(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.Cn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.Cn)||void 0===t||t.updateTransform()},t}(),Xi=function(){function t(t){var n=new Gi;this.kn=n,t.snippet.add(n,!0);var i=new Vi;this.Ln=i,t.snippet.add(i,!0);var r=new Wi;this.yn=r,t.snippet.add(r,!1),t.reflowable.add(this)}return t.prototype.onReflow=function(t,n,i){var r=t.theme,e=t.state,u=t.corner,s=u.getRadius(),h=u.getMask();this.kn.onReflow(t,n,i,r,e,s,h),this.Ln.onReflow(t,n,i,r,e,s,h),this.yn.onReflow(t,n,i,r,e,s,h)},t}(),Ki={NONE:0,BEFORE:1,AFTER:2,BOTH:3},Yi={OPEN:0,CLOSE:1,PARENSESIS:2,ADD_OR_PLUS:3,SUB_OR_MINUS:4,PLUS:5,MINUS:6,ADD:7,SUB:8,MUL:9,DIV:10,MIN:11,MAX:12,COMMA:13,PARENT:14,SELF:15,PADDING:16,CURRENT:17,NUMBER:18},Ji=function(){function t(t){var n=this.toToken(t),i=0;do{i=this.toParensesis(n,i)}while(i<n.length);if(this.toUnary(n),this.toArithmetic(n,Yi.MUL,Yi.DIV),this.toArithmetic(n,Yi.ADD,Yi.SUB),1===n.length){var r=n[0];if(!pt(r))return void(this.xn=r)}throw new Error("Failed to parse '".concat(t,"'"))}return t.prototype.toParensesis=function(t,n){for(var i=t.length,r=n;r<i;++r)if(t[r]===Yi.OPEN){var e=r,u=Yi.PARENSESIS;if(0<r){var s=t[r-1];s!==Yi.MIN&&s!==Yi.MAX||(e-=1,u=s)}for(var h=r+1;h<i;++h){var o=t[h];if(o===Yi.CLOSE)return t[e]=[u,this.toComma(t,r+1,h)],t.splice(e+1,h-e),e+1;o===Yi.OPEN&&(h=this.toParensesis(t,h)-1,i=t.length)}throw new Error("Malformed parensesis")}return i},t.prototype.toCommaOf=function(t,n,i){var r=i-n;if(r<=0)return[Yi.NUMBER,0];if(r<=1)return t[n];for(var e=[],u=n;u<i;++u)e.push(t[u]);return[Yi.PARENSESIS,e]},t.prototype.toComma=function(t,n,i){for(var r=null,e=n,u=n;u<i;++u)t[u]===Yi.COMMA&&((r=r||[]).push(this.toCommaOf(t,e,u)),e=u+1);if(e<i){if(null==r){var s=[];for(u=e;u<i;++u)s.push(t[u]);return s}r.push(this.toCommaOf(t,e,i))}return r||[]},t.prototype.toUnaryNode=function(t){pt(t)||t[0]!==Yi.PARENSESIS&&t[0]!==Yi.MIN&&t[0]!==Yi.MAX||this.toUnary(t[1])},t.prototype.toUnary=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r===Yi.ADD_OR_PLUS||r===Yi.SUB_OR_MINUS)if(n<=0||pt(t[n-1])){if(!(n+1<i)||pt(t[n+1]))throw new Error("Malformed unary operator");var e=t.splice(n+1,1)[0],u=r===Yi.ADD_OR_PLUS?Yi.PLUS:Yi.MINUS;t[n]=[u,e],i=t.length,this.toUnaryNode(e)}else u=r===Yi.ADD_OR_PLUS?Yi.ADD:Yi.SUB,t[n]=u;else this.toUnaryNode(r),i=t.length}},t.prototype.toArithmeticNode=function(t,n,i){pt(t)||(t[0]===Yi.PARENSESIS||t[0]===Yi.MIN||t[0]===Yi.MAX?this.toArithmetic(t[1],n,i):t[0]===Yi.PLUS||t[0]===Yi.MINUS?this.toArithmeticNode(t[1],n,i):t[0]!==Yi.ADD&&t[0]!==Yi.SUB&&t[0]!==Yi.MUL&&t[0]!==Yi.DIV||(this.toArithmeticNode(t[1],n,i),this.toArithmeticNode(t[2],n,i)))},t.prototype.toArithmetic=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(u===n||u===i){if(0<r&&r+1<e){var s=t[r-1],h=t[r+1];if(!pt(s)&&!pt(h)){t.splice(r,2),t[r-1]=[u,s,h],r-=1,e=t.length,this.toArithmeticNode(s,n,i),this.toArithmeticNode(h,n,i);continue}}throw new Error("Malformed operands for the operator ".concat(u))}this.toArithmeticNode(u,n,i),e=t.length}},t.prototype.toToken=function(n){for(var i=[];;){var r=t.TOKEN_REGEX.exec(n);if(null==r)break;var e=r[0],u=this.toTokenOperator(e);if(null!=u)i.push(u);else{var s=parseFloat(e);if(s!=s)throw new Error("Unexpected token '".concat(e,"' at ").concat(r.index," in '").concat(n,"'"));var h=this.toTokenLiteral(e);null!=h?i.push([h,.01*s]):i.push([Yi.NUMBER,s])}}return i},t.prototype.toTokenOperator=function(t){switch(t){case"+":return Yi.ADD_OR_PLUS;case"-":return Yi.SUB_OR_MINUS;case"*":return Yi.MUL;case"/":return Yi.DIV;case"(":return Yi.OPEN;case")":return Yi.CLOSE;case",":return Yi.COMMA;case"min":return Yi.MIN;case"max":return Yi.MAX}return null},t.prototype.toTokenLiteral=function(t){var n=t.length;if(0<n)switch(t[n-1]){case"%":return Yi.PARENT;case"s":return Yi.SELF;case"p":return Yi.PADDING;case"c":return Yi.CURRENT}return null},t.prototype.evaluate=function(t,n,i,r,e){switch(t[0]){case Yi.PARENSESIS:var u=t[1];return this.evaluate(u[u.length-1],n,i,r,e);case Yi.PLUS:return+this.evaluate(t[1],n,i,r,e);case Yi.MINUS:return-this.evaluate(t[1],n,i,r,e);case Yi.ADD:return this.evaluate(t[1],n,i,r,e)+this.evaluate(t[2],n,i,r,e);case Yi.SUB:return this.evaluate(t[1],n,i,r,e)-this.evaluate(t[2],n,i,r,e);case Yi.MUL:return this.evaluate(t[1],n,i,r,e)*this.evaluate(t[2],n,i,r,e);case Yi.DIV:return this.evaluate(t[1],n,i,r,e)/this.evaluate(t[2],n,i,r,e);case Yi.MIN:if(0<t[1].length){for(var s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.min(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Yi.MAX:if(0<t[1].length){for(s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.max(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case Yi.PARENT:return t[1]*n;case Yi.SELF:return t[1]*i;case Yi.PADDING:return t[1]*r;case Yi.CURRENT:return t[1]*e;case Yi.NUMBER:return t[1]}return 0},t.prototype.calculate=function(t,n,i,r){return this.evaluate(this.xn,t,n,i,r)},t.TOKEN_REGEX=/(?:\+|-|\*|\/|\(|\)|min|max|,|(?:\d+(?:\.\d*)?[%psc]?))/g,t}(),Zi=function(t,n){return.5*(t-n)},qi=function(t,n,i){return i},Qi=function(t){return t},$i=function(t,n,i){return t-i},tr=function(){function t(){}return t.position=function(t){if(null==t||pt(t))return null;if(Ot(t)){switch(t){case"center":case"CENTER":return Zi;case"padding":case"PADDING":return qi}var n=new Ji(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(wt(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t.size=function(t){if(null==t||pt(t))return null;if(Ot(t)){switch(t){case"100%":case"maximized":case"MAXIMIZED":return Qi;case"padding":case"PADDING":return $i}var n=new Ji(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(wt(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t}(),nr=function(){function t(){}return t.isActivateKey=function(t){return"Space"===t.key||"Enter"===t.key||32===t.which||13===t.which},t.isArrowUpKey=function(t){return"ArrowUp"===t.key||38===t.which},t.isArrowDownKey=function(t){return"ArrowDown"===t.key||40===t.which},t.isArrowLeftKey=function(t){return"ArrowLeft"===t.key||37===t.which},t.isArrowRightKey=function(t){return"ArrowRight"===t.key||39===t.which},t.isCancelKey=function(t){return"Esc"===t.key||27===t.which},t.isFocusKey=function(t){return"Tab"===t.key||9===t.which},t.isUndoKey=function(t){return t.ctrlKey&&("z"===t.key||90===t.which)},t.isRedoKey=function(t){return t.ctrlKey&&("y"===t.key||89===t.which)},t.isSaveKey=function(t){return t.ctrlKey&&!t.shiftKey&&("s"===t.key||83===t.which)},t.isSaveAsKey=function(t){return t.ctrlKey&&t.shiftKey&&("S"===t.key||83===t.which)},t.isDeleteKey=function(t){return"Delete"===t.key||46===t.which},t.isSelectAllKey=function(t){return t.ctrlKey&&!t.shiftKey&&("a"===t.key||65===t.which)},t.isOkKey=function(t){return"Enter"===t.key||13===t.which},t.getFocusDirection=function(t){return!0!==t.shiftKey},t.toShortcut=function(t){if(Ot(t)){var n,i=t,r=i.indexOf("->"),e=void 0;0<=r?(e=i.substring(0,r).trim().toLowerCase(),n=i.substring(r+2).trim()):e=i.trim().toLowerCase();for(var u=!1,s=!1,h=!1,o="a",a=e.length,c=0,f=1;f<a;++f)if("+"===e.charAt(f)){var l=e.substring(c,f);switch(l){case"alt":u=!0;break;case"ctrl":s=!0;break;case"shift":h=!0;break;default:o=l}c=f+=1}return c!==f&&(o=e.substring(c,f)),function(t){var n=t.key;if(n.length<=1){t.shift&&(t.key=n.toUpperCase());var i=n.charCodeAt(0);t.which=97<=i&&i<=122?i-32:i}else switch(n){case"enter":t.key="Enter",t.which=13;break;case"space":t.key=" ",t.which=32;break;case"escape":t.key="Escape",t.which=27;break;case"f1":t.key="F1",t.which=112;break;case"f2":t.key="F2",t.which=113;break;case"f3":t.key="F3",t.which=114;break;case"f4":t.key="F4",t.which=115;break;case"f5":t.key="F5",t.which=116;break;case"f6":t.key="F6",t.which=117;break;case"f7":t.key="F7",t.which=118;break;case"f8":t.key="F8",t.which=119;break;case"f9":t.key="F9",t.which=120;break;case"f10":t.key="F10",t.which=121;break;case"f11":t.key="F11",t.which=122;break;case"f12":t.key="F12",t.which=123;break;case"capslock":t.key="CapsLock",t.shift?t.which=20:t.which=240;break;case"arrowup":t.key="ArrowUp",t.which=38;break;case"arrowdown":t.key="ArrowDown",t.which=40;break;case"arrowleft":t.key="ArrowLeft",t.which=37;break;case"arrowright":t.key="ArrowRight",t.which=39;break;case"insert":t.key="Insert",t.which=45;break;case"delete":t.key="Delete",t.which=46;break;case"pageup":t.key="PageUp",t.which=33;break;case"pagedown":t.key="PageDown",t.which=34;break;case"backspace":t.key="Backspace",t.which=8;break;case"colon":t.key=":",t.which=186;break;case"semicolon":t.key=";",t.which=187;break;case"pause":t.key="Pause",t.which=19;break;case"scrolllock":t.key="ScrollLock",t.which=145;break;case"tab":t.key="Tab",t.which=9;break;case"plus":t.key="+",t.which=187;break;case"minus":t.key="-",t.which=189}return t}({alt:u,ctrl:s,shift:h,key:o,which:0,event:n})}return t},t.toString=function(t){var n=[];return t.ctrl&&n.push("Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),n.push(t.key.toUpperCase()),n.join("+")},t.on=function(t,n,i){var r=this.toShortcut(n);document.body.addEventListener("keydown",(function(n){n.altKey!==r.alt||n.ctrlKey!==r.ctrl||n.shiftKey!==r.shift||n.key!==r.key&&n.which!==r.which||(t.state.isActionable&&(null!=r.event?t.emit(r.event):null!=i&&i(n)),n.preventDefault())}))},t.moveFocusVertically=function(n,i,r){if(i.state.isActionable){var e=t.isArrowUpKey(n),u=t.isArrowDownKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocusHorizontally=function(n,i,r){if(i.state.isActionable){var e=t.isArrowLeftKey(n),u=t.isArrowRightKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocus=function(t,n,i){var r,e=null!==(r=null==i?void 0:i.picked)&&void 0!==r?r:st.getLayer(n);if(e){var u=e.getFocusController(),s=u.get();if(null!=s){var h=u.find(s,!1,s.state.isFocusRoot||t,t,n);if(null!=h)return u.focus(h),!0}}return!1},t}(),ir=function(){function t(){}return Object.defineProperty(t,"touchable",{get:function(){return"ontouchstart"in document},enumerable:!1,configurable:!0}),Object.defineProperty(t,"tap",{get:function(){return"pointertap"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"down",{get:function(){return"pointerdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"enter",{get:function(){return"pointerenter"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"leave",{get:function(){return"pointerleave"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"move",{get:function(){return"pointermove"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"out",{get:function(){return"pointerout"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"over",{get:function(){return"pointerover"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"up",{get:function(){return"pointerup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"upoutside",{get:function(){return"pointerupoutside"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cancel",{get:function(){return"pointercancel"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"righttap",{get:function(){return"rightclick"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightdown",{get:function(){return"rightdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightup",{get:function(){return"rightup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rightupoutside",{get:function(){return"rightupoutside"},enumerable:!1,configurable:!0}),t.toGlobal=function(t,n,i){if("touches"in t){var r=t.changedTouches,e=r[r.length-1];null!=e?n.mapPositionToPoint(i,e.clientX,e.clientY):n.mapPositionToPoint(i,0,0)}else n.mapPositionToPoint(i,t.clientX,t.clientY);return i},t.onDblClick=function(t,n){var i=this;if(t.addEventListener("dblclick",(function(t){return n(t,!1)})),this.touchable){var r=0,e=0,u=0,s=0;t.addEventListener("touchstart",(function(t){if(0===r||2===r){var n=t.touches,i=n.length;if(i<=0)r=0;else{var s=n.item(i-1);null!=s?(r+=1,e=s.clientX,u=s.clientY):r=0}}else r=0})),t.addEventListener("touchend",(function(t){if(1===r||3===r){var h=t.changedTouches,o=h.length;if(o<=0)r=0;else{var a=h[o-1];if(null!=a){var c=e-a.clientX,f=u-a.clientY;i.CLICK_DISTANCE_THRESHOLD<=Math.abs(c)+Math.abs(f)?r=0:1===r?(s=t.timeStamp,r=2):t.timeStamp-s<i.DBLCLICK_INTERVAL_THRESHOLD?(r=0,n(t,!0)):(s=t.timeStamp,r=2)}else r=0}}else r=0})),t.addEventListener("touchcancel",(function(){r=0}))}},t.contains=function(t,n){for(var i=n;null!=i&&i!==t;)i=i.parent;return i===t},t.CLICK_DISTANCE_THRESHOLD=10,t.DBLCLICK_INTERVAL_THRESHOLD=333,t.LONG_CLICK_THRESHOLD=750,t}(),rr=function(){function t(){this.Bn=!1}return Object.defineProperty(t.prototype,"isOff",{get:function(){return!this.Bn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOn",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),t.prototype.toCoordinate=function(t){return this.Bn?"auto":t},t.prototype.from=function(t){return"auto"===t||"AUTO"===t?(this.Bn=!0,!0):(this.Bn=!1,!1)},t}(),er=function(){this.width=new rr,this.height=new rr},ur=function(){function t(t){this.p=t,this._n=[],this.Pn=[],this.Fn=!0}return Object.defineProperty(t.prototype,"renderable",{get:function(){return this.Fn},set:function(t){this.Fn=t},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){(n?this._n:this.Pn).push(t),"parent"in t&&(t.parent=this.p)},t.prototype.addAt=function(t,n,i){var r=n?this._n:this.Pn;0===i?r.unshift(t):0<i&&i<r.length?r.splice(i,0,t):r.push(t),"parent"in t&&(t.parent=this.p)},t.prototype.remove=function(t,n){var i=n?this._n:this.Pn,r=i.indexOf(t);0<=r&&(i.splice(r,1),"parent"in t&&(t.parent=null))},t.prototype.render=function(t,n){if(this.Fn)for(var i=n?this._n:this.Pn,r=0,e=i.length;r<e;++r){var u=i[r];u.updateTransform(),u.render(t)}},t}(),sr=function(){function t(){this.Un=[]}return t.prototype.add=function(t){this.Un.push(t)},t.prototype.remove=function(t){var n=this.Un,i=n.indexOf(t);0<=i&&n.splice(i,1)},t.prototype.onReflow=function(t,n,i){for(var r=this.Un,e=0,u=r.length;e<u;++e)r[e].onReflow(t,n,i)},t}(),hr=function(n){function i(t){var r,e,u,s,h,o,a,c,f,l=this,v=(l=n.call(this)||this).transform;l._=new _i(v.position,(function(t,n,i,r){l.onMove(t,n,i,r)})),l.Gn=new _i(v.scale,(function(t,n,i,r){l.onScale(t,n,i,r)})),l.Hn=new _i(v.skew,(function(t,n,i,r){l.onSkew(t,n,i,r)})),l.zn=t;var b=l.Vn={};l.Wn=new er,l.En=!0,l.Xn=!1,l.Kn=!1,l.Yn=null,l.name=null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"";var d=function(t){var n=null==t?void 0:t.theme;if(n)return Ot(n)?Z.getInstance().get(n):n}(t)||l.getThemeDefault();l.cn=d,l.Jn=new ur(l),l.Zn=new sr,l.qn=Ai(null!==(e=null==t?void 0:t.clear)&&void 0!==e?e:d.getClearType(),Ki),l.Qn=new Bi(d,t,(function(){l.toParentResized(),l.toHierarchyDirty(),st.update(l)}));var g=function(){l.toDirty(),st.update(l)};l.kn=new Ii(d,t,g),l.Ln=new Ri(d,t,g),l.yn=new xi(d,t,g),l.hn=new Li(d,t,g);var m=v.position,w=null!==(u=null==t?void 0:t.x)&&void 0!==u?u:d.getX();pt(w)?m.x=w:(m.x=0,b.x=tr.position(w));var p=null!==(s=null==t?void 0:t.y)&&void 0!==s?s:d.getY();pt(p)?m.y=p:(m.y=0,b.y=tr.position(p));var O=null!==(h=null==t?void 0:t.width)&&void 0!==h?h:d.getWidth();l.Wn.width.from(O)?l.kt=100:pt(O)?l.kt=O:(l.kt=100,b.width=tr.size(O));var D=null!==(o=null==t?void 0:t.height)&&void 0!==o?o:d.getHeight();if(l.Wn.height.from(D)?l.pn=100:pt(D)?l.pn=D:(l.pn=100,b.height=tr.size(D)),null!=t){var E=t.visible;null!=E&&(l.visible=E)}if(null!=t){var M=t.renderable;null!=M&&(l.renderable=M)}l.Rt=new Et((function(t,n){l.onStateChange(t,n)}));var S,T=Ai(null!==(a=null==t?void 0:t.interactive)&&void 0!==a?a:d.getInteractive(),yi);if(l.interactive=!!(T&yi.SELF),l.interactiveChildren=!!(T&yi.CHILDREN),null!=t){var j=t.on;if(null!=j)for(var N in j){var I=j[N];I&&l.on(N,I)}}if(l.$n=null!==(c=null==t?void 0:t.title)&&void 0!==c?c:d.getTitle(),l.nn=null!==(f=null==t?void 0:t.weight)&&void 0!==f?f:d.getWeight(),l.initReflowable(),l.ti=function(){st.update(l)},null!=t&&(S=t.shadow),void 0===S&&(S=d.getShadow()),S)if(Ot(S))switch(S){case"WEAK":l.shadow=d.newShadowWeak();break;case"DEFAULT":l.shadow=d.newShadow()}else l.shadow=S;l.on(ir.over,(function(t){l.onOver(t)})),l.on(ir.out,(function(t){l.onOut(t)})),l.on(ir.down,(function(t){l.onDown(t)})),l.on(ir.up,(function(t){l.onUp(t)})),l.on("added",(function(){l.toParentResized(),(l.isDirty()||l.hasDirty())&&l.toParentHasDirty(),l.Kn&&l.toParentHierarchyDirty();var t=l.parent;t instanceof i&&(l.state.parent=t.state),st.update(l)})),l.on("removed",(function(){l.blur(!0),l.state.parent=null,st.update(l)}));var C,A=function(t){if(t){var n=t.shortcut,i=t.shortcuts;if(null!=i||null!=n){var r=[];if(null!=n&&r.push(nr.toShortcut(n)),null!=i)for(var e=0,u=i.length;e<u;++e)r.push(nr.toShortcut(i[e]));return r}}}(t);if(l.ni=A,null!=A)for(var R=function(t){l.onShortcut(t)},k=0,L=A.length;k<L;++k)nr.on(l,A[k],R);if(l.init(t),d.newState(l.Rt),null!=t){var y=t.state;if(null!=y){var x=l.Rt;if(Ot(y))x.add(y);else if(mt(y))x.addAll(y);else{var B=y.values;null!=B&&(Ot(B)?x.add(B):x.addAll(B));var _=y.blinkers;if(null!=_){var P=x.blinker;for(k=0,L=_.length;k<L;++k){var F=_[k];P.add(F.state,F.interval)}}var U=y.tickers;if(null!=U){var G=x.ticker;for(k=0,L=U.length;k<L;++k){var H=U[k];G.add(H.state,H.interval)}}}}}if(null!=t){var z=t.parent;null!=z&&z.addChild(l)}if(null!=t){var V=t.children;if(null!=V)for(k=0,L=V.length;k<L;++k){var W=V[k];null!=W&&l.addChild(W)}}return null!=t&&(C=t.cursor,l.ii=C),l.cursor=l.toCursor(C,l.Rt),l.emit("init",l),l}return _(i,n),i.prototype.toCursor=function(t,n){if(t)if(wt(t)){var i=t(n);if(void 0!==i)return i}else if(void 0!==t)return t;return this.theme.getCursor(n)},Object.defineProperty(i.prototype,"snippet",{get:function(){return this.Jn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"reflowable",{get:function(){return this.Zn},enumerable:!1,configurable:!0}),i.prototype.initReflowable=function(){new Xi(this)},i.prototype.onChildrenChange=function(){this.toHierarchyDirty(),n.prototype.onChildrenChange.call(this)},i.prototype.onShortcut=function(t){this.emit("shortcut",t,this)},i.prototype.init=function(t){},Object.defineProperty(i.prototype,"weight",{get:function(){return this.nn},enumerable:!1,configurable:!0}),i.prototype.onMove=function(t,n,r,e){for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof i&&o.onParentMove(t,n,r,e)}st.update(this),this.emit("move",t,n,r,e,this)},i.prototype.resize=function(t,n){var i=this.kt,r=this.pn,e=null!=t?t:i,u=null!=n?n:r,s=i!==e,h=r!==u;s&&(this.kt=e),h&&(this.pn=u);var o,a=s||h;if(a&&this.onResize(e,u,i,r),s&&null!=(o=this.Vn).x){var c=this._,f=this.getParentOfSize();f&&(this._.x=o.x(f.width,e,f.padding.getLeft(),c.x))}if(h&&null!=(o=this.Vn).y){c=this._;var l=this.getParentOfSize();l&&(this._.y=o.y(l.height,u,l.padding.getTop(),c.y))}return a},i.prototype.getClearType=function(){return this.qn},i.prototype.onResize=function(t,n,r,e){this.toDirty(),this.toHierarchyDirty();for(var u=this.Qn,s=this.children,h=0,o=s.length;h<o;++h){var a=s[h];a instanceof i&&a.onParentResize(t,n,u)}st.update(this),this.emit("resize",t,n,r,e,this)},i.prototype.onScale=function(t,n,i,r){st.update(this),this.emit("scale",t,n,i,r,this)},i.prototype.onSkew=function(t,n,i,r){st.update(this),this.emit("skew",t,n,i,r,this)},Object.defineProperty(i.prototype,"type",{get:function(){return this.getType()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"x",{get:function(){return this._.x},set:function(t){this.setX(t)},enumerable:!1,configurable:!0}),i.prototype.getX=function(){var t=this.Vn;return null!=t.x?t.x:this._.x},i.prototype.setX=function(t){var n=this.Vn;if(pt(t)){var i=this._;i.x!==t?(n.x=void 0,i.x=t):void 0!==n.x&&(n.x=void 0,this.toParentResized())}else{var r=tr.position(t);n.x!==r&&(n.x=r,this.toParentResized())}},Object.defineProperty(i.prototype,"y",{get:function(){return this._.y},set:function(t){this.setY(t)},enumerable:!1,configurable:!0}),i.prototype.getY=function(){var t=this.Vn;return null!=t.y?t.y:this._.y},i.prototype.setY=function(t){var n=this.Vn;if(pt(t)){var i=this._;i.y!==t?(n.y=void 0,i.y=t):void 0!==n.y&&(n.y=void 0,this.toParentResized())}else{var r=tr.position(t);n.y!==r&&(n.y=r,this.toParentResized())}},Object.defineProperty(i.prototype,"width",{get:function(){return this.kt},set:function(t){this.setWidth(t)},enumerable:!1,configurable:!0}),i.prototype.getWidth=function(){return this.Wn.width.toCoordinate(this.Vn.width||this.kt)},i.prototype.setWidth=function(t){var n=this.Wn.width,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),st.update(this)),!r){var e=this.Vn;if(pt(t)){var u=this.kt;if(u!==t){e.width=void 0,this.kt=t;var s=this.pn;if(this.onResize(t,s,u,s),null!=e.x){var h=this._,o=this.getParentOfSize();o&&(h.x=e.x(o.width,t,o.padding.getLeft(),h.x))}}else void 0!==e.width&&(e.width=void 0,this.toParentResized())}else{var a=tr.size(t);e.width!==a&&(e.width=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"height",{get:function(){return this.pn},set:function(t){this.setHeight(t)},enumerable:!1,configurable:!0}),i.prototype.getHeight=function(){return this.Wn.height.toCoordinate(this.Vn.height||this.pn)},i.prototype.setHeight=function(t){var n=this.Wn.height,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toHierarchyDirty(),st.update(this)),!r){var e=this.Vn;if(pt(t)){var u=this.pn;if(u!==t){e.height=void 0,this.pn=t;var s=this.kt;if(this.onResize(s,t,s,u),null!=e.y){var h=this._,o=this.getParentOfSize();o&&(h.y=e.y(o.height,t,o.padding.getTop(),h.y))}}else void 0!==e.height&&(e.height=void 0,this.toParentResized())}else{var a=tr.size(t);e.height!==a&&(e.height=a,this.toParentResized())}}},Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Gn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"skew",{get:function(){return this.Hn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Qn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"corner",{get:function(){return this.hn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"background",{get:function(){return this.kn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"border",{get:function(){return this.Ln},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outline",{get:function(){return this.yn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"unsafe",{get:function(){return this.transform},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this.$n},set:function(t){this.$n!==t&&(this.$n=t,this.state.isHovered&&this.applyTitle())},enumerable:!1,configurable:!0}),i.prototype.applyTitle=function(){var t=st.getLayer(this);t&&(t.view.title=this.$n)},i.prototype.show=function(){return this.visible||(this.visible=!0,this.toParentHierarchyDirty(),st.update(this)),this},i.prototype.isShown=function(){return this.visible},i.prototype.hide=function(){return this.visible&&(this.visible=!1,this.toParentHierarchyDirty(),this.blur(!0),st.update(this)),this},i.prototype.isHidden=function(){return!this.visible},i.prototype.toDirty=function(){return!this.En&&(this.En=!0,this.toParentHasDirty(),!0)},i.prototype.toHasDirty=function(){return!this.Xn&&(this.Xn=!0,this.toParentHasDirty(),!0)},i.prototype.toParentHasDirty=function(){var t=this.parent;t instanceof i&&t.toHasDirty()},i.prototype.toHierarchyDirty=function(){return!this.Kn&&(this.Kn=!0,this.onHierarchyDirty(),this.toParentHierarchyDirty(),!0)},i.prototype.toParentHierarchyDirty=function(){var t=this.parent;t instanceof i&&t.toHierarchyDirty()},i.prototype.isHierarchyDirty=function(){return this.Kn},i.prototype.onHierarchyDirty=function(){},i.prototype.isDirty=function(){return this.En},i.prototype.hasDirty=function(){return this.Xn},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=st.getLayer(this);n&&n.getFocusController().set(this,t)}return this},i.prototype.focus=function(){return this.setFocused(!0)},i.prototype.blur=function(t){if(t){var n=st.getLayer(this);if(n){var r=n.getFocusController().get();if(r instanceof i)for(var e=r;e;){if(e===this){r.setFocused(!1);break}e=e.parent}}}else this.setFocused(!1);return this},i.prototype.onStateChange=function(t,n){var r=this;this.toDirty(),st.update(this),this.emit("statechange",t,n,this);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}t.isFocused?(n.isFocused||this.onFocus(),t.inDisabled&&!n.inDisabled&&setTimeout((function(){r.blur()}),0)):n.isFocused&&this.onBlur(),this.cursor=this.toCursor(this.ii,t)},i.prototype.onChildFocus=function(t){var n=this.parent;n instanceof i&&n.onChildFocus(t)},i.prototype.onFocus=function(){var t=this.parent;t instanceof i&&t.onChildFocus(this)},i.prototype.onChildBlur=function(t){var n=this.parent;n instanceof i&&n.onChildBlur(t)},i.prototype.onBlur=function(){var t=this.parent;t instanceof i&&t.onChildBlur(this)},Object.defineProperty(i.prototype,"state",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"options",{get:function(){return this.zn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"theme",{get:function(){return this.cn},set:function(t){this.cn!==t&&(this.cn=t,this.Qn.setTheme(t),this.kn.setTheme(t),this.Ln.setTheme(t),this.yn.setTheme(t),this.hn.setTheme(t),this.toDirty(),st.update(this))},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){var t=this.En;t&&(this.onReflow(),this.En=!1);var n=this.Xn,r=this.Kn;if(n||r){this.Xn=!1,this.Kn=!1;for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.reflow()}}(t||n||r)&&this.onRefit()},i.prototype.onRefit=function(){var t=this.Wn,n=t.width.isOn,i=t.height.isOn;if(n&&i){for(var r=0,e=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&(this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width)),this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height)));var h=this.padding;this.resize(r+h.getRight(),e+h.getBottom())}else if(n){for(r=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width));this.resize(r+this.padding.getRight(),void 0)}else if(i){var o;for(e=0,u=0,s=(o=this.children).length;u<s;++u){var a;(a=o[u]).visible&&this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height))}this.resize(void 0,e+this.padding.getBottom())}},i.prototype.isRefitable=function(t){return t instanceof i},i.prototype.hasRefitableHeight=function(t){return this.isRefitable(t)&&!(t instanceof i&&wt(t.getHeight()))},i.prototype.hasRefitableWidth=function(t){return this.isRefitable(t)&&!(t instanceof i&&wt(t.getWidth()))},i.prototype.onReflow=function(){this.Zn.onReflow(this,this.kt,this.pn)},Object.defineProperty(i.prototype,"shadow",{get:function(){return this.Yn},set:function(t){var n=this.Yn;if(n!==t){var i=this.Zn,r=this.Jn,e=this.ti;null!=n&&(n.off("update",e),i.remove(n),r.remove(n,!0)),this.Yn=t,null!=t&&(t.on("update",e),i.add(t),r.addAt(t,!0,0)),st.update(this)}},enumerable:!1,configurable:!0}),i.prototype.toParentResized=function(){var t=this.getParentOfSize();t&&this.onParentResize(t.width,t.height,t.padding)},i.prototype.getParentOfSize=function(){var t=this.parent;return t instanceof i?t:st.getLayer(this)},i.prototype.onParentResize=function(t,n,i){var r=this.Vn,e=this.transform.position,u=e.x,s=e.y,h=this.kt,o=this.pn,a=i.getLeft()+i.getRight(),c=i.getTop()+i.getBottom(),f=null!=r.width?r.width(t,h,a,h):h,l=null!=r.height?r.height(n,o,c,o):o;this.resize(f,l);var v=null!=r.x?r.x(t,this.kt,i.getLeft(),u):u,b=null!=r.y?r.y(n,this.pn,i.getTop(),s):s;this.position.set(v,b)},i.prototype.onParentMove=function(t,n,i,r){},i.prototype.onWheel=function(t,n,i){return this.emit("wheel",t,n,i,this),!1},i.prototype.onKeyDown=function(t){return this.emit("keydown",t,this),!1},i.prototype.onKeyUp=function(t){return this.emit("keyup",t,this),!1},i.prototype.isEventTarget=function(t){var n=t.target;if(n===this)return!0;if(null!=n&&!(n instanceof i&&n.interactive)){for(var r=n.parent;null!=r&&!(r instanceof i&&r.interactive);)r=r.parent;return r===this}return!1},i.prototype.onDown=function(t){this.isEventTarget(t)&&this.onDownThis(t),this.emit("down",t,this)},i.prototype.onDownThis=function(n){if("touches"in n.data.originalEvent){var i=this.ri||new t.Point;this.ri=i,i.copyFrom(n.data.global)}else this.focusOnClosest()},i.prototype.onUp=function(t){this.isEventTarget(t)&&this.onUpThis(t),this.emit("up",t,this)},i.prototype.onUpThis=function(t){if("touches"in t.data.originalEvent){var n=this.ri;if(n){var i=t.data.global,r=Math.abs(i.x-n.x),e=Math.abs(i.y-n.y),u=ir.CLICK_DISTANCE_THRESHOLD;r<u&&e<u&&this.focusOnClosest()}}},i.prototype.focusOnClosest=function(){var t=st.getLayer(this);if(t){var n=t.getFocusController();n.focus(n.findParent(this))}},i.prototype.onOver=function(t){this.state.isHovered=!0,t.target===this&&this.applyTitle(),this.emit("over",t,this)},i.prototype.onOut=function(t){this.state.isHovered=!1,this.emit("out",t,this)},i.prototype.onDblClick=function(t,n){return this.emit("dblclick",t,n,this),!1},i.prototype.render=function(t){if(this.visible&&0<this.worldAlpha&&this.renderable){var i=this.Jn;i.render(t,!0),n.prototype.render.call(this,t),i.render(t,!1)}},i.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},i.prototype.getType=function(){return"DBase"},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,r=this._bounds,e=i.WORK_CONTAINS_POINT;e.set(0,0),t.apply(e,e),r.addPoint(e),e.set(this.kt,this.pn),t.apply(e,e),r.addPoint(e),n.prototype._calculateBounds.call(this)},i.prototype.containsPoint=function(t){return this.containsGlobalPoint(t)||this.containsLocalPoint(this.worldTransform.applyInverse(t,i.WORK_CONTAINS_POINT))},i.prototype.containsGlobalPoint=function(t){return!1},i.prototype.containsLocalPoint=function(t){var n=t.x,i=t.y,r=this.kt,e=this.pn;return 0<=n&&n<=r&&0<=i&&i<=e},i.prototype.getClippingRect=function(t,n){n.x=0,n.y=0,n.width=this.kt,n.height=this.pn},i.prototype.destroy=function(){var t=this.Vn;t.x=null,t.y=null,t.width=null,t.height=null;var i=this.Yn;i&&(this.Yn=null,i.destroy());for(var r=this.children,e=r.length-1;0<=e;--e)r[e].destroy();r.length=0,n.prototype.destroy.call(this)},i.WORK_CONTAINS_POINT=new t.Point,i}(t.Container),or=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){var r=t.corner,e=Math.max(0,r.getRadius()-.5),u=r.getMask(),s=u&ki.TOP_LEFT?0:e,h=u&ki.TOP_RIGHT?0:e,o=u&ki.BOTTOM_LEFT?0:e,a=u&ki.BOTTOM_RIGHT?0:e;this.clear(),this.beginFill(16777215,1),this.lineStyle(0,0,0,0,!1),s<=0&&h<=0&&o<=0&&a<=0?this.drawRect(0,0,n,i):(this.moveTo(0+s,0),0<h?this.arcTo(0+n,0,0+n,0+i,h):this.lineTo(0+n,0),0<a?this.arcTo(0+n,0+i,0,0+i,a):this.lineTo(0+n,0+i),0<o?this.arcTo(0,0+i,0,0,o):this.lineTo(0,0+i),0<s?this.arcTo(0,0,0+n,0,s):this.lineTo(0,0)),this.endFill()},n}(t.Graphics),ar={NONE:0,CTRL:1,SHIFT:2,ALT:4,AND:8,OR:16,NOT_NONE:23},cr=function(){function t(){}return t.from=function(t){var n="data"in t?t.data.originalEvent:t;return(n.ctrlKey?ar.CTRL:ar.NONE)|(n.altKey?ar.ALT:ar.NONE)|(n.shiftKey?ar.SHIFT:ar.NONE)},t.match=function(n,i){return i&ar.OR?!!(t.from(n)&i):t.from(n)===i},t}(),fr={OFF:0,ON:1,TOUCH:2},lr=function(){function n(){this.pointers=new Map,this.center=new t.Point,this.scale=0,this.time=0}return n.prototype.start=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.isUpdatable=function(t){var n=t.data.originalEvent;return!("pointerId"in n)||this.pointers.has(n.pointerId)},n.prototype.update=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.end=function(t){var n=!0,i=t.data.originalEvent;if("touches"in i)n=i.touches.length<=0;else if("pointerId"in i){var r=this.pointers;r.delete(i.pointerId),n=r.size<=0}return this.doUpdate(t),n},n.prototype.bind=function(t){var n=this.interactionManager;if(n){var i=this.onMove;i&&n.on(ir.move,i);var r=this.onEnd;r&&(n.on(ir.up,r),n.on(ir.upoutside,r),n.on(ir.cancel,r))}},n.prototype.unbind=function(){var t=this.interactionManager;if(t){var n=this.onMove;n&&t.off(ir.move,n);var i=this.onEnd;i&&(t.off(ir.up,i),t.off(ir.upoutside,i),t.off(ir.cancel,i))}},n.prototype.doUpdate=function(t){var n=this.interactionManager,i=this.center,r=t.data.originalEvent;if(this.scale=0,this.time=r.timeStamp,"touches"in r){var e=r.touches,u=e.length;if(0<u){for(var s=0,h=0,o=0,a=e.length;o<a;++o)s+=(f=e[o]).clientX,h+=f.clientY;if(s/=u,h/=u,n?n.mapPositionToPoint(i,s,h):i.set(s,h),1<u){var c=0;for(o=1,a=e.length;o<a;++o){var f,l=(f=e[o]).clientX-s,v=f.clientY-h;c=Math.max(c,l*l+v*v)}this.scale=Math.sqrt(c)}}}else if("pointerId"in r){var b=this.pointers,d=b.size;if(0<d){var g=0,m=0;if(b.forEach((function(t){g+=t.clientX,m+=t.clientY})),g/=d,m/=d,n?n.mapPositionToPoint(i,g,m):i.set(g,m),1<d){var w=0;b.forEach((function(t){var n=t.clientX-g,i=t.clientY-m;w=Math.max(w,n*n+i*i)})),this.scale=Math.sqrt(w)}}}else i.copyFrom(t.data.global)},n}(),vr=function(){function t(){}return t.LINEAR=function(t){return t},t.ELASTIC=function(t){return t*(3*(1-t)*(1-t)+t*(3*(1-t)+t))},t.QUAD_IN_OUT=function(t){return t<.5?2*t*t:(4-2*t)*t-1},t}(),br=function(t){function n(n){var i,r,e,u=this;(u=t.call(this)||this).R=null,u.ei=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,u.si=0,u.hi=null!==(r=null==n?void 0:n.duration)&&void 0!==r?r:200,u.oi=1/Math.max(1,u.hi),u.ai=!1,u.ci=null==n?void 0:n.onTime,u.fi=function(){u.onTimeBase()},u.li=null==n?void 0:n.onStart,u.vi=null==n?void 0:n.onEnd,u.bi=null!==(e=null==n?void 0:n.timing)&&void 0!==e?e:vr.ELASTIC;var s=null==n?void 0:n.on;if(s)for(var h in s){var o=s[h];o&&u.on(h,o)}return u}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.ei},set:function(t){this.ei=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return this.hi},set:function(t){this.hi=t,this.oi=1/Math.max(1,t)},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.si=Date.now(),this.ai=t,this.R=window.setTimeout(this.fi,0),this.onStart(t);var n=this.hi,i=this.toTime(t?n:0);this.onTime(i,t,0)},n.prototype.onStart=function(t){var n=this.li;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ci;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.vi;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return null!=this.R},n.prototype.isReverse=function(){return this.ai},n.prototype.onTimeBase=function(){if(null!=this.R){this.R=null;var t=Date.now()-this.si,n=this.hi,i=this.ai;if(t<n){this.R=window.setTimeout(this.fi,0);var r=this.toTime(i?n-t:t);this.onTime(r,i,t)}else r=this.toTime(i?0:n),this.onTime(r,i,t),this.onEnd(i)}},n.prototype.toTime=function(t){return this.bi(t*this.oi,this)},n.prototype.stop=function(){var t=this.R;null!=t&&(this.R=null,window.clearTimeout(t))},n.prototype.end=function(){var t=this.R;if(null!=t){this.R=null,window.clearTimeout(t);var n=this.ai,i=Date.now()-this.si,r=this.hi,e=this.toTime(n?0:r);this.onTime(e,n,i),this.onEnd(n)}},n}(t.utils.EventEmitter),dr=function(){function t(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r}return t.prototype.set=function(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r},t}(),gr=function(){function t(t,n,i){var r,e=this;this.di=[],this.gi=[],this.wi=0,this.pi=-1,this.Oi=0,this.Di=0,this.Ei=0,this.Mi=0,this.Si=0,this._t=0,this.Ti=new br({onTime:function(t){e.onEase(t)},onEnd:function(){e.onEaseEnd()},timing:vr.LINEAR,duration:333*(null!==(r=null==i?void 0:i.duration)&&void 0!==r?r:1)}),this.ji=t,this.vi=n}return t.prototype.onStart=function(){for(var n=this.di,i=n.length,r=t.HISTORY_CAPACITY;i<r;++i)n.push(new dr(0,0,1,0));this.wi=0,this.pi=-1,this.Ti.stop()},t.prototype.onMove=function(n,i,r,e){var u=t.HISTORY_CAPACITY,s=this.pi,h=(s+1)%u;this.pi=h;var o=this.wi;(h<s||0<=s&&s<o)&&(this.wi=(o+1)%u),this.di[h].set(n,i,r,e)},t.prototype.updateHistoriesSorted=function(t){var n=this.di,i=this.gi,r=this.wi,e=this.pi,u=n.length;if(e<0)return i.length=0,t;if(e<r){var s=t;i.length=0;for(var h=e;0<=h;--h){var o=n[h];if(!(s+o.dt<160))return s;s+=o.dt,i.push(o)}for(h=u-1;r<=h;--h){var a=n[h];if(!(s+a.dt<160))return s;s+=a.dt,i.push(a)}return s}for(s=t,i.length=0,h=e;r<=h;--h){var c=n[h];if(!(s+c.dt<160))return s;s+=c.dt,i.push(c)}return s},t.prototype.onEnd=function(t){this.updateHistoriesSorted(t);var n=this.gi,i=n.length;if(i<=0)return this.onEaseEnd();for(var r=0,e=0,u=0,s=0,h=0;h<i;++h){var o=n[h];r+=o.dx,e+=o.dy,u+=o.ds,s+=o.dt}if(s<=0)return this.onEaseEnd();var a=1/i;r*=a,e*=a,u*=a,s*=a,this.Oi=r,this.Di=e,this.Ei=u,this.Mi=s;var c=this.Ti,f=c.duration;this._t=-t/f,this.Si=f/s,c.start()},t.prototype.onEase=function(t){var n=this._t;this._t=t;var i=(1-.5*(t+n))*(t-n)*this.Si;this.ji(this.Oi*i,this.Di*i,1+(this.Ei-1)*i,t)},t.prototype.onEaseEnd=function(){this.vi()},t.prototype.stop=function(){this.Ti.stop()},t.HISTORY_CAPACITY=5,t}(),mr=function(){function t(t){var n,i,r,e=t.on;e&&(this.li=e.start,this.ji=e.move,this.vi=e.end),this.Ni=null!==(n=null==t?void 0:t.modifier)&&void 0!==n?n:ar.NONE;var u=t.checker,s=cr.match;this.Ii=null!==(i=null==u?void 0:u.start)&&void 0!==i?i:s,this.Ci=null!==(r=null==u?void 0:u.move)&&void 0!==r?r:s,this.Ai=t.easing,this.Ri=!!t.touch,this.ki=[],this.Li=new Map;var h=t.bind;null!=h&&this.bind(h)}return t.prototype.newData=function(t){var n=this.Li,i=n.get(t);if(null!=i)return i;var r=this.ki.pop();if(null!=r)return n.set(t,r),r;var e=new lr;return e.easing=this.newEasing(e),e.onMove=this.newOnMove(e),e.onEnd=this.newOnEnd(e),n.set(t,e),e},t.prototype.newEasing=function(t){var n=this,i=this.Ai;if(null==i||!1!==i)return new gr((function(i,r,e,u){n.onEasingMove(i,r,e,u,t)}),(function(){n.onEasingEnd(t)}),this.toEasingOptions(i))},t.prototype.toEasingOptions=function(t){return null==t||!0===t?void 0:t},t.prototype.deleteData=function(t){var n=t.target;n&&this.Li.delete(n)&&(t.target=void 0,t.pointers.clear(),this.ki.push(t))},t.prototype.bind=function(t){var n=this;return t.on(ir.down,(function(i){n.onDown(t,i)})),this},t.prototype.isTouch=function(t){var n=t.data.originalEvent;return"touches"in n||"pointerId"in n&&"mouse"!==n.pointerType},t.prototype.onDown=function(t,n){var i;if((!this.Ri||this.isTouch(n))&&this.Ii(n,this.Ni,t)){var r=st.getLayer(t);if(null!=r)if(n.stopPropagation(),t.state.isGesturing)null===(i=this.Li.get(t))||void 0===i||i.start(n);else{var e=this.li;null!=e&&e(t);var u=this.newData(t);u.target=t,t.state.isGesturing=!0;var s=r.renderer.plugins.interaction;u.interactionManager=s,u.start(n);var h=u.easing;h&&h.onStart(),u.bind(n)}}},t.prototype.newOnMove=function(t){var n=this;return function(i){n.onMove(i,t)}},t.prototype.newOnEnd=function(t){var n=this;return function(i){n.onEnd(i,t)}},t.prototype.onMove=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.isUpdatable(t)&&this.Ci(t,this.Ni,i)){var r=n.center,e=r.x,u=r.y,s=n.scale,h=n.time;n.update(t);var o=r.x,a=r.y,c=n.scale,f=o-e,l=a-u,v=n.time-h,b=1e-5,d=b<s&&b<c?c/s:1,g=n.easing;g&&g.onMove(f,l,d,v);var m=this.ji;null!=m&&(0===f&&0===l&&1===d||m(i,f,l,o,a,d))}},t.prototype.onEnd=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.end(t)){i.state.isGesturing=!1;var r=n.interactionManager;if(n.interactionManager=void 0,r){var e=n.onMove;e&&r.off(ir.move,e);var u=n.onEnd;u&&(r.off(ir.up,u),r.off(ir.cancel,u))}var s=this.vi;null!=s&&s(i);var h=n.easing;h?h.onEnd(t.data.originalEvent.timeStamp-n.time):this.deleteData(n)}},t.prototype.onEasingMove=function(t,n,i,r,e){if(null!=e.target){var u=this.ji;if(null!=u&&(0!==t||0!==n||1!==i)){var s=e.center,h=s.x+t,o=s.y+n;s.set(h,o),u(e.target,t,n,h,o,i)}}},t.prototype.onEasingEnd=function(t){this.deleteData(t)},t.prototype.stop=function(t){var n,i=this.Li.get(t);null!=i&&(null===(n=i.easing)||void 0===n||n.stop(),this.deleteData(i))},t}(),wr=function(){function t(t,n,i,r,e,u){var s,h,o=this;this.p=t,this.yi=i,this.xi=r;var a=Ai(null!==(s=null==u?void 0:u.mode)&&void 0!==s?s:e.getGestureMode(),fr),c=Ai(null!==(h=null==u?void 0:u.modifier)&&void 0!==h?h:e.getGestureModifier(),ar);a!==fr.ON&&a!==fr.TOUCH||(this.Bi=new mr({touch:a===fr.TOUCH,modifier:c,checker:u&&u.checker,easing:{duration:null==u?void 0:u.duration},on:{start:function(){o.yi.stop()},move:function(i,r,e,u,s,h){o.onGestureMove(n(t),r,e,u,s,h)}}}))}return t.prototype.onGestureMove=function(t,n,i,r,e,u){if(t){var s=this.yi,h=t.scale,o=h.x,a=h.y,c=s.toNormalizedScale(o*u),f=s.toNormalizedScale(a*u),l=c/o,v=f/a,b=u<1?Math.max(l,v):Math.min(l,v);c=b*o,f=b*a;var d=r-n,g=e-i,m=t.position,w=(m.x-d)*b+r,p=(m.y-g)*b+e;this.xi(t,w,p,c,f)}},t.prototype.stop=function(){var t;null===(t=this.Bi)||void 0===t||t.stop(this.p)},t.prototype.onDown=function(t){var n;null===(n=this.Bi)||void 0===n||n.onDown(this.p,t)},t}(),pr=function(){function t(t,n,i,r,e){var u=this;this.p=t,this._i=n,this.xi=r,this.Pi=1,this.Fi=1,this.Ui=0,this.Gi=0,this.Hi=1,this.zi=1,this.Vi=0,this.Wi=0,this.Ti=new br({onTime:function(t){u.onTime(t)},duration:e}),this.yi=i,this.hi=e}return t.prototype.onTime=function(t){var n=1-t,i=t,r=this.Hi*n+this.Pi*i,e=this.zi*n+this.Fi*i,u=this.Vi*n+this.Ui*i,s=this.Wi*n+this.Gi*i,h=this._i(this.p);null!=h&&this.xi(h,u,s,r,e)},t.prototype.start=function(t,n,i,r,e,u,s){if(!1!==s&&this.yi.stop(),null==u&&(u=this.hi),u<=0)this.xi(t,n,i,r,e);else{var h=t.position,o=t.scale;this.Vi=h.x,this.Wi=h.y,this.Hi=o.x,this.zi=o.y,this.Ui=n,this.Gi=i,this.Pi=r,this.Fi=e,this.Ti.duration=u,this.Ti.start()}},t.prototype.stop=function(){this.Ti.stop()},t}(),Or=function(){function n(i,r,e){var u,s,h,o,a,c,f,l,v,b,d,g,m,w,p,O,D;this.p=i,this._i=r,this.xi=e&&e.constraint||n.CONSTRAINT,this.Xi=new t.Rectangle;var E=this.toTheme(e)||this.getThemeDefault(),M=null==e?void 0:e.zoom;this.Ki=new t.Point,this.Yi=null!==(u=null==M?void 0:M.min)&&void 0!==u?u:E.getZoomMin(),this.Ji=null!==(s=null==M?void 0:M.max)&&void 0!==s?s:E.getZoomMax(),this.Zi=null!==(h=null==M?void 0:M.keepRatio)&&void 0!==h?h:E.getZoomKeepRatio();var S=null==M?void 0:M.wheel;this.qi=null!==(o=null==S?void 0:S.enable)&&void 0!==o?o:E.isWheelZoomEnabled(),this.Qi=null!==(a=null==S?void 0:S.speed)&&void 0!==a?a:E.getWheelZoomSpeed(),this.$i=Ai(null!==(c=null==S?void 0:S.modifier)&&void 0!==c?c:E.getWheelZoomModifier(),ar),this.tr=null!==(f=null==S?void 0:S.checker)&&void 0!==f?f:cr.match;var T=null==M?void 0:M.dblclick;this.nr=null!==(l=null==T?void 0:T.enable)&&void 0!==l?l:E.isDblClickZoomEnabled(),this.ir=null!==(v=null==T?void 0:T.amount)&&void 0!==v?v:E.getDblClickZoomSpeed(),this.rr=Ai(null!==(b=null==T?void 0:T.modifier)&&void 0!==b?b:E.getDblClickZoomModifier(),ar),this.er=null!==(d=null==T?void 0:T.checker)&&void 0!==d?d:cr.match,this.ur=null!==(g=null==T?void 0:T.duration)&&void 0!==g?g:E.getDblClickZoomDuration();var j=null===(m=null==e?void 0:e.translation)||void 0===m?void 0:m.wheel;this.sr=null!==(w=null==j?void 0:j.enable)&&void 0!==w?w:E.isWheelTranslationEnabled(),this.hr=null!==(p=null==j?void 0:j.speed)&&void 0!==p?p:E.getWheelTranslationSpeed(),this.ar=Ai(null!==(O=null==j?void 0:j.modifier)&&void 0!==O?O:E.getWheelTranslationModifier(),ar),this.cr=null!==(D=null==j?void 0:j.checker)&&void 0!==D?D:cr.match,this.lr=new wr(i,r,this,this.xi,E,null==e?void 0:e.gesture),this.I=new pr(i,r,this,this.xi,this.ur)}return Object.defineProperty(n.prototype,"gesture",{get:function(){return this.lr},enumerable:!1,configurable:!0}),n.prototype.stop=function(){this.lr.stop(),this.I.stop()},n.prototype.reset=function(t,n){var i=this.p,r=this._i(i);if(r){var e=r.getLocalBounds(this.Xi),u=.5*(i.width-e.width)-e.x,s=.5*(i.height-e.height)-e.y;this.I.start(r,u,s,1,1,t,n)}},n.prototype.fit=function(t,n){var i=this.p,r=this._i(i);if(r){var e=i.padding,u=i.width,s=i.height,h=r.getLocalBounds(this.Xi),o=h.x,a=h.y,c=h.width,f=h.height,l=(u-e.getLeft()-e.getRight())/c,v=(s-e.getTop()-e.getBottom())/f;if(this.Zi){var b=this.toNormalizedScale(Math.min(l,v));l=b,v=b}else l=this.toNormalizedScale(l),v=this.toNormalizedScale(v);var d=.5*(u-c*l)-o*l,g=.5*(s-f*v)-a*v;this.I.start(r,d,g,l,v,t,n)}},n.prototype.zoomIn=function(t,n){var i=this._i(this.p);if(i){var r=this.ir,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomOut=function(t,n){var i=this._i(this.p);if(i){var r=1/this.ir,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomAt=function(t,n,i,r,e,u){var s=this._i(this.p);if(s){var h=s.scale.x,o=s.scale.y,a=this.toNormalizedScale(i),c=this.toNormalizedScale(r),f=a/h,l=c/o,v=(s.position.x-t)*f+t,b=(s.position.y-n)*l+n;this.I.start(s,v,b,a,c,e,u)}},n.prototype.zoomAtGlobal=function(t,n,i,r,e,u){var s=this.Ki;s.set(t,n),this.toLocal(s,s),this.zoomAt(s.x,s.y,i,r,e,u)},n.prototype.zoom=function(t,n,i,r){var e=this.p;this.zoomAt(.5*e.width,.5*e.height,t,n,i,r)},Object.defineProperty(n.prototype,"scale",{get:function(){var n=this._i(this.p);return n?n.scale:new t.Point(1,1)},set:function(t){var n=this._i(this.p);if(n){var i=this.toNormalizedScale(t.x),r=this.toNormalizedScale(t.y),e=n.position;this.xi(n,e.x,e.y,i,r)}},enumerable:!1,configurable:!0}),n.prototype.moveTo=function(t,n,i,r){var e=this._i(this.p);if(e){var u=e.scale;this.I.start(e,t,n,u.x,u.y,i,r)}},Object.defineProperty(n.prototype,"position",{get:function(){var n=this._i(this.p);return n?n.position:new t.Point(0,0)},set:function(t){var n=this._i(this.p);if(n){var i=n.scale;this.xi(n,t.x,t.y,i.x,i.y)}},enumerable:!1,configurable:!0}),n.prototype.transform=function(t,n,i,r,e,u){var s=this._i(this.p);s&&this.I.start(s,t,n,i,r,e,u)},n.prototype.toLocal=function(t,n,i){return this.p.toLocal(t,void 0,n,i)},n.prototype.toGlobal=function(t,n,i){return this.p.toGlobal(t,n,i)},n.prototype.toNormalizedScale=function(t){return Math.min(this.Ji,Math.max(this.Yi,t))},n.prototype.onWheel=function(t,n,i){var r;if(this.qi&&this.tr(t,this.$i,this.p)&&0!==n.deltaY&&(r=this._i(this.p))){var e=n.lowest*this.Qi,u=1+n.deltaY*e,s=r.scale;return this.zoomAtGlobal(i.x,i.y,s.x*u,s.y*u,0),!0}if(this.sr&&this.cr(t,this.ar,this.p)&&(r=this._i(this.p))){this.stop(),e=n.lowest*this.hr;var h=r.position,o=h.x-n.deltaX*e,a=h.y+n.deltaY*e;return s=r.scale,this.xi(r,o,a,s.x,s.y),!0}return!1},n.prototype.onDown=function(t){this.lr.onDown(t)},n.prototype.onDblClick=function(t,n){if(this.nr&&this.er(t,this.rr,this.p)){var i=this._i(this.p);if(i){var r=this.Ki;ir.toGlobal(t,n,r);var e=this.ir,u=i.scale;return this.zoomAtGlobal(r.x,r.y,u.x*e,u.y*e,this.ur),!0}}return!1},n.prototype.toTheme=function(t){if(t&&t.theme){var n=t.theme;return Ot(n)?Z.getInstance().get(n):n}return null},n.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},n.prototype.getType=function(){return"DView"},n.CONSTRAINT=function(t,n,i,r,e){t.scale.set(r,e),t.position.set(n,i)},n}(),Dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n),this.vr=null;var e=this.theme;this.br=new Or(this,(function(){return r.vr}),null==n?void 0:n.view);var u=null==n?void 0:n.canvas;u&&(this.canvas=u),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(this.mask=this.getOverflowMask())},n.prototype.getType=function(){return"DCanvasContainer"},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateContentSize(n,i,r,e)},Object.defineProperty(n.prototype,"canvas",{get:function(){return this.vr},set:function(t){var n=this.vr;null!=n&&(this.vr=null,this.removeChild(n),this.emit("unset",n,this),n.destroy()),this.vr=t,null!=t?(this.addChild(t),this.br.reset(0),this.emit("set",t,this)):st.update(this)},enumerable:!1,configurable:!0}),n.prototype.getOverflowMask=function(){return null==this.dr&&(this.dr=new or(this),this.Zn.add(this.dr),this.toDirty()),this.dr},n.prototype.updateContentSize=function(t,n,i,r){var e=this.vr;if(null!=e){var u=e.x+.5*(t-i),s=e.y+.5*(n-r);e.position.set(u,s)}},Object.defineProperty(n.prototype,"view",{get:function(){return this.br},enumerable:!1,configurable:!0}),n.prototype.onWheel=function(n,i,r){var e=this.br.onWheel(n,i,r),u=t.prototype.onWheel.call(this,n,i,r);return e||u},n.prototype.onDblClick=function(n,i,r){if(!0!==r){var e=this.br.onDblClick(n,i),u=t.prototype.onDblClick.call(this,n,i);return e||u}return t.prototype.onDblClick.call(this,n,i)},n.prototype.onDown=function(n,i){!0!==i&&this.br.onDown(n),t.prototype.onDown.call(this,n)},n.prototype.destroy=function(){var n=this.dr;null!=n&&(this.dr=null,n.destroy()),this.mask=null,t.prototype.destroy.call(this)},n}(hr),Er={DIAGRAM:0,PAGE:1,EXTENSION:1e3},Mr=function(){function t(t){this.gr=this.newSources(t)}return t.prototype.map=function(n,i,r){var e=this.gr;if(null==e)return!1;var u=n.id,s=u.toLowerCase(),h=s.length;if(h!==u.length)return!1;var o=e[0],a=o.length;if(0!==a&&0!==s.indexOf(o))return!1;var c=t.SPANS;c[0]=0,c[1]=a;for(var f=e.length,l=1;l<f;++l){var v=l<<1,b=e[l],d=b.length;if(0===d)c[v]=h,c[v+1]=h;else{var g=s.indexOf(b,c[v-1]);if(g<0)return!1;c[v]=g,c[v+1]=g+d}}if(null!=i){for(var m=i.length,w="",p=(l=0,f);l<p;++l){var O=l<m?i[l]:e[l],D=c[1+(v=l<<1)],E=c[v+2];w+=O+u.substring(D,l+1<p?E:h)}n.id=w}return 0<r.length&&(n.initial=r),!0},t.prototype.newSources=function(n){if(null==n)return null;var i=n.trim();return i.length<=0?null:i.toLowerCase().split(t.WILDCARD)},t.split=function(t){if(null==t)return null;var n=t.trim();return n.length<=0?null:n.split(this.WILDCARD)},t.WILDCARD="*",t.SPANS=[],t}(),Sr=function(){function t(t,n,i,r,e){this.resources=t.resources,this.data=t.data||t.tags||t.resources,this.pieces=n,this.pieceData=i,this.mode=r,this.depth=e,this.mr=new Map,this.wr=new Map,this.pr=new Map,this.Xt=new Map,this.Or=new Map,this.Dr=new Map,this.Er=new Map,this.Mr=new Map,this.Sr=new Map,this.Tr=new Map,this.jr=new Map,this.Nr=new Map,this.Ir=new Map,this.Cr=new Map,this.Ar=new Map,this.Rr=new Map}return t.prototype.getAction=function(t){return this.mr.get(t)},t.prototype.setAction=function(t,n){this.mr.set(t,n)},t.prototype.getFill=function(t){return this.wr.get(t)},t.prototype.setFill=function(t,n){this.wr.set(t,n)},t.prototype.getStroke=function(t){return this.pr.get(t)},t.prototype.setStroke=function(t,n){this.pr.set(t,n)},t.prototype.getData=function(t){return this.Xt.get(t)},t.prototype.setData=function(t,n){this.Xt.set(t,n)},t.prototype.getDataValue=function(t){return this.Or.get(t)},t.prototype.setDataValue=function(t,n){this.Or.set(t,n)},t.prototype.getDataMapping=function(t){return this.Dr.get(t)},t.prototype.setDataMapping=function(t,n){this.Dr.set(t,n)},t.prototype.getDataMapper=function(t){var n=this.Er,i=n.get(t);return void 0===i&&(i=new Mr(t),n.set(t,i)),i},t.prototype.getDataDestination=function(t){var n=this.Mr,i=n.get(t);return void 0===i&&(i=Mr.split(t),n.set(t,i)),i},t.prototype.getDataSystem=function(t){return this.Sr.get(t)},t.prototype.setDataSystem=function(t,n){this.Sr.set(t,n)},t.prototype.getRange=function(t){return this.Tr.get(t)},t.prototype.setRange=function(t,n){this.Tr.set(t,n)},t.prototype.getAlign=function(t){return this.jr.get(t)},t.prototype.setAlign=function(t,n){this.jr.set(t,n)},t.prototype.getMargin=function(t){return this.Nr.get(t)},t.prototype.setMargin=function(t,n){this.Nr.set(t,n)},t.prototype.getText=function(t){return this.Ir.get(t)},t.prototype.setText=function(t,n){this.Ir.set(t,n)},t.prototype.getTextOutline=function(t){return this.Cr.get(t)},t.prototype.setTextOutline=function(t,n){this.Cr.set(t,n)},t.prototype.getCapability=function(t){return this.Ar.get(t)},t.prototype.setCapability=function(t,n){this.Ar.set(t,n)},t.prototype.getExtension=function(t){return this.Rr.get(t)},t.prototype.setExtension=function(t,n){this.Rr.set(t,n)},t}(),Tr={VIEWER:0,EDITOR_DATA_MAPPED:1,EDITOR:2},jr=function(){function t(){}return t.get=function(t){var n=this.mappings[t];return null!=n?n:Ct.PRIMITIVE},t.contains=function(t,n){if(null!=t){var i=this.get(t.type),r=t.getCapability();return null!=r&&(i&=~r.removed,i|=r.added,i&=~r.locked),(i&n)===n}return!1},t.set=function(t,n){this.mappings[t]=n},t.mappings={},t}(),Nr=function(){this.localTransform=new t.Matrix,this.internalTransform=new t.Matrix,this.internalTransformParentInverse=new t.Matrix,this.rotation=0,this.size=new t.Point},Ir=function(t){return Math.abs(t)<.001?t<0?-.001:.001:t},Cr=function(){function t(){}return t.prepare=function(t){var n=t.editor||new Nr;t.editor=n,t.updateTransform();var i=t.parent;i instanceof Rt?i.transform.internalTransform.copyTo(n.internalTransformParentInverse).invert():n.internalTransformParentInverse.identity(),t.transform.internalTransform.copyTo(n.internalTransform),n.rotation=t.transform.rotation,n.size.copyFrom(t.size),t.disallowOnTransformChange()},t.finalize=function(t){t.allowOnTransformChange(!0)},t.apply=function(t,n,i){var r=t.editor;if(null!=r){var e=r.localTransform;r.internalTransformParentInverse.copyTo(e).append(n).append(r.internalTransform),this.applyLocal(t,e,i,r.size)}},t.applyLocal=function(t,n,i,r){t.disallowUploadedUpdate();var e=n.a,u=n.b,s=n.c,h=n.d,o=n.tx,a=n.ty,c=t.transform,f=!!(i&Ct.POSITION),l=!!(i&Ct.ROTATION),v=!!(i&Ct.SKEW),b=!!(i&Ct.WIDTH),d=!!(i&Ct.HEIGHT);if(l||v){var g=Math.atan2(-s,h),m=Math.atan2(+u,e);if(l&&(c.rotation=.5*(g+m)),v){var w=.5*(m-g);c.skew.set(w,w)}}if(f){var p=c.pivot,O=p.x,D=p.y;c.position.set(o+(e*O+s*D),a+(u*O+h*D))}if(null!=r&&(b||d)){var E=Ir(r.x*Math.sqrt(e*e+u*u)),M=Ir(r.y*Math.sqrt(s*s+h*h)),S=t.size;b&&d?S.set(E,M):b?S.x=E:S.y=M}t.allowUploadedUpdate()},t}(),Ar=function(){function n(n,i,r){this.shape=n,this.base=new t.Point(i,r);var e=n.size;this.shapeBase=new t.Point(e.x,e.y),this.transform=new t.Matrix,n.updateTransform(),n.transform.localTransform.copyTo(this.transform),this.capable=jr.contains(n,Ct.POSITION)&&jr.contains(n,Ct.WIDTH)&&jr.contains(n,Ct.HEIGHT)&&jr.contains(n,Ct.ROTATION)&&jr.contains(n,Ct.SKEW)}return n.prototype.isCompatible=function(t){return this.shape===t},n.prototype.reset=function(t,n,i){this.base.set(n,i);var r=t.size;this.shapeBase.copyFrom(r),t.updateTransform(),t.transform.localTransform.copyTo(this.transform)},n.prototype.update=function(t,i,r,e,u){if(this.capable){var s=i/this.base.x,h=r/this.base.y,o=this.shapeBase,a=n.WORK_TRANSFORM;a.identity().append(this.transform).translate(-e,-u).scale(s,h).translate(+e,+u),t.disallowOnTransformChange(),Cr.applyLocal(t,a,Ct.ALL,o),t.allowOnTransformChange(!1)}},n.WORK_TRANSFORM=new t.Matrix,n}(),Rr=function(){function n(n,i,r,e){this.kr=new t.Rectangle,this.Lr=new t.Rectangle,this.p=n,this.yr=[],this.j=new t.Point(i,r),this.Br=e}return n.prototype.init=function(){return this},Object.defineProperty(n.prototype,"x",{get:function(){return this.j.x},set:function(t){var n=this.j;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.j.y},set:function(t){var n=this.j;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.j,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.j;return new n(this.p,t.x,t.y,this.Br)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.j,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.j.copyTo(t)},n.prototype.equals=function(t){return this.j.equals(t)},n.prototype.fit=function(){return this.Br&&this.doFit(),this},n.prototype.doFit=function(){var t=this.p;t.disallowOnTransformChange();var n=this.calcRect(this.Lr),i=this.j;i.set(n.width,n.height),t.updateTransform();var r=t.transform,e=n.x+.5*n.width,u=n.y+.5*n.height,s=r.position,h=r.localTransform,o=h.a,a=h.b,c=h.c,f=h.d,l=r.pivot;s.set(s.x+(o*e+c*u)-(o*l.x+c*l.y),s.y+(a*e+f*u)-(a*l.x+f*l.y)),l.set(e,u),this.reset(t.children,this.yr,i),t.allowOnTransformChange(!0)},n.prototype.reset=function(t,n,i){for(var r=0,e=Math.min(n.length,t.length);r<e;++r){var u=t[r],s=n[r];if(!s.isCompatible(u)){n.length=r;break}s.reset(u,i.x,i.y)}t.length<n.length&&(n.length=t.length)},n.prototype.calcRect=function(t){var n=this.p.children;if(n.length<=0)t.x=0,t.y=0,t.width=0,t.height=0;else{var i=this.kr;n[0].getBoundsLocal(!1,t);for(var r=1,e=n.length;r<e;++r)n[r].getBoundsLocal(!1,i),t.enlarge(i)}return t},n.prototype.onChange=function(t,n){var i=this.p,r=this.j,e=i.transform.pivot;this._r(i.children,this.yr,r.x,r.y,e.x,e.y,t,n),i.onSizeChange()},n.prototype._r=function(t,n,i,r,e,u,s,h){for(var o=0,a=Math.min(n.length,t.length);o<a;++o){var c=t[o];if(!(f=n[o]).isCompatible(c)){n.length=o;break}f.update(c,i,r,e,u)}for(o=n.length,a=t.length;o<a;++o){var f;c=t[o],(f=this.newLayout(c,s,h)).update(c,i,r,e,u),n.push(f)}n.length!==t.length&&(n.length=t.length)},n.prototype.newLayout=function(t,n,i){return t.layout||new Ar(t,n,i)},n}(),kr=function(){function n(n,i,r,e,u){this.p=n,this._x=i,this._y=r,this.Pr=new t.Point(e,u)}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"base",{get:function(){return this.Pr},enumerable:!1,configurable:!0}),n.prototype.init=function(){return this.Pr.copyFrom(this),this.onChange(),this},n.prototype.clone=function(){var t=this.Pr;return new n(this.p,this._x,this._y,t.x,t.y)},n.prototype.set=function(t,n){var i=!1;return null!=t&&this._x!==t&&(this._x=t,i=!0),null!=n&&this._y!==n&&(this._y=n,i=!0),i&&this.onChange(),this},n.prototype.copyFrom=function(t){return t instanceof n&&this.Pr.copyFrom(t.base),this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.onChange()),this},n.prototype.copyTo=function(t){return t instanceof n&&this.Pr.copyTo(t.base),t.set(this._x,this._y),t},n.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},n.prototype.fit=function(){return this},n.prototype.onChange=function(){var t=this.Pr;this.p.transform.scale.set(this._x/t.x,this._y/t.y)},n}(),Lr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),yr=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return qt.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return s.NONE},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i,r,e,u,s){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!1,color:16777215,alpha:1,width:1,align:0,side:qt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),xr=function(t){function n(n,i,r){var e=t.call(this,r)||this;e.Fr=n,e.Ur=i;var u=e.newData();return e.data=u,e.tag=u,e.size=e.newGroupSize(n,i),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e}return _(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Fr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"depth",{get:function(){return this.Ur},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t,n){var i=q.SIZE_X,r=q.SIZE_Y;return t!==Tr.VIEWER?new Rr(this,i,r,this.isGroupSizeFittable()):new kr(this,i,r,i,r)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newData=function(){return new Vt},n.prototype.newGroupFill=function(){return new Lr},n.prototype.newGroupStroke=function(){return new yr},n.prototype.newGroupText=function(){return new Yt(this,q.TEXT_VALUE,q.TEXT_COLOR,q.TEXT_ALPHA,q.TEXT_FAMILY,q.TEXT_SIZE)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof kr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){return ut.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Rt),Br=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED);var s=t.call(this,i,e,u)||this;return s.Gr=n,s.Ur=e,s}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=q.SIZE_X,r=q.SIZE_Y;return t!==Tr.VIEWER&&n<=0?new Rr(this,i,r,this.isGroupSizeFittable()):new kr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Gr,this.Fr,this.Ur,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=n.addPiece(this.Gr),i},n.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid)},n.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid)},n}(xr),_r=function(){function t(t){this.Hr=t}return t.prototype.find=function(t){return this.getUuidToShape().get(t)},t.prototype.getUuidToShape=function(){var t=this.zr;return null==t&&(t=this.newUuidToShape(),this.zr=t),t},t.prototype.newUuidToShape=function(){var t=new Map;return this.fillUuidToShape(this.Hr,t),t},t.prototype.fillUuidToShape=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];if(n.set(e.uuid,e),!(e instanceof Br)){var u=e.children;0<u.length&&this.fillUuidToShape(u,n)}}},t}(),Pr=function(t,i){var e=n[t[0]]||n[r.NULL];if(null!=e){var u=e(t,i);if(null!=u)return u}throw new Error("Missing shape deserializers")},Fr=function(t,n){for(var i=[],r=0,e=t.length;r<e;++r)i.push(Pr(t[r],n));return 0<i.length?Promise.all(i).then((function(i){return Ur(t,i,new _r(i),n),i})):null},Ur=function(t,n,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u],o=n[u],a=i[h[0]];a&&a(h,o,r,e),Ur(h[20],o.children,r,e)}},Gr=function(t,n,i,r){this.name=t,this.width=n,this.height=i,this.layer=r},Hr=function(){function t(){this.V=new Map}return t.prototype.add=function(t,n,i,r,e,u){return this.V.set(t,{type:n,x:i,y:r,normal:this.toNormal(i,r,e,u)}),!0},t.prototype.toNormal=function(t,n,i,r){if(null!=i&&null!=r)return{x:i,y:r};var e=t*t+n*n;if(1e-5<e){var u=1/Math.sqrt(e);return{x:t*u,y:n*u}}return{x:0,y:0}},t.prototype.remove=function(t){var n=this.V,i=n.get(t);return null!=i?(n.delete(t),i):null},t.prototype.size=function(){return this.V.size},t.prototype.get=function(t,n){return this.V.get(n)||null},t.prototype.each=function(t,n){return this.V.forEach(n),this},t.prototype.contains=function(t){return this.V.has(t)},t.prototype.clear=function(){var t=this.V;return 0<t.size&&(t.clear(),!0)},t}(),zr={TAIL:1,HEAD:2,ALL:3},Vr=function(){function t(){}return t.set=function(t,n){var i=this.Vr;null==i&&(i=new Map,this.Vr=i),i.set(t,n)},t.get=function(t){var n;return(null===(n=this.Vr)||void 0===n?void 0:n.get(t))||this.getDefault()},t.getDefault=function(){var t=this.Wr;return null==t&&(t=this.newDefault(),this.Wr=t),t},t.newDefault=function(){var t=new Hr,n=1/Math.sqrt(2);return t.add("TOP",zr.ALL,0,-.5,0,-1),t.add("LEFT",zr.ALL,-.5,0,-1,0),t.add("RIGHT",zr.ALL,.5,0,1,0),t.add("BOTTOM",zr.ALL,0,.5,0,1),t.add("CENTER",zr.ALL,0,0,0,0),t.add("TOP_LEFT",zr.ALL,-.5,-.5,-n,-n),t.add("TOP_RIGHT",zr.ALL,.5,-.5,n,-n),t.add("BOTTOM_LEFT",zr.ALL,-.5,.5,-n,n),t.add("BOTTOM_RIGHT",zr.ALL,.5,.5,n,n),t},t}(),Wr=function(){function t(t){this.p=t,this.Xr=null,this.Kr=null}return Object.defineProperty(t.prototype,"shape",{get:function(){return this.Xr},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this.Kr},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.set(t.shape,t.edge)},t.prototype.set=function(t,n){var i=!1;return void 0!==t&&this.Xr!==t&&(this.Xr=t,i=!0),void 0!==n&&this.Kr!==n&&(this.Kr=n,i=!0),i&&this.p.onAcceptorChange(),this},t}(),Xr=function(){function n(n,i){var r=this;this.p=n,this.ut=i,this.Yr=new Wr(this),this.it=new t.ObservablePoint((function(){r.onLocalChange()}),void 0),this.Jr=0,this.Zr=0,this.qr=new t.ObservablePoint((function(){r.onNormalChange()}),void 0),this.Qr=0,this.$r=0,this.te=0,this.ne=0,this.ie=!1,this.re=!1,this.ee=!1,this.ue=!1}return n.prototype.lock=function(){this.ne+=1,1===this.ne&&(this.ie=!1,this.re=!1,this.ee=!1,this.ue=!1)},n.prototype.unlock=function(){if(this.ne-=1,0===this.ne){var t=!1;this.re&&(this.Jr+=1,this.Zr=this.Jr,t=!0),this.ee&&(this.Qr+=1,this.$r=this.Qr,t=!0),this.ue&&(t=!0),this.ie&&(this.re||(this.Jr+=1),this.ee||(this.Qr+=1),this.doFit()&&(t=!1)),t&&this.ut()}},Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"acceptor",{get:function(){return this.Yr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"local",{get:function(){return this.it},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localId",{get:function(){return this.Zr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normal",{get:function(){return this.qr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"normalId",{get:function(){return this.$r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},set:function(t){this.te!==t&&(this.te=t,this.onOtherChange())},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u,s){this.lock(),this.Yr.set(t,n);var h=this.it;null!=r&&null!=e?h.set(r,e):null!=r?h.x=r:null!=e&&(h.y=e);var o=this.qr;return null!=u&&null!=s?o.set(u,s):null!=u?o.x=u:null!=s&&(o.y=s),null!=i&&(this.margin=i),this.unlock(),this},n.prototype.copy=function(t){return this.lock(),this.Yr.copy(t.acceptor),this.it.copyFrom(t.local),this.qr.copyFrom(t.normal),this.margin=t.margin,this.unlock(),this},n.prototype.serialize=function(t){var n=this.Yr,i=n.shape,r=i?i.uuid:null,e=n.edge,u=null!=e?t.addResource(e):-1,s=this.it,h=this.qr;return t.addResource("[".concat(r,",").concat(u,",").concat(s.x,",").concat(s.y,",").concat(this.te,",").concat(h.x,",").concat(h.y,"]"))},n.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e));var u=null,s=e[0];null!=s&&(u=n.find(s)||null),this.lock();var h=this.Yr;h.shape=u;var o=e[1];h.edge=0<=o&&o<r.length?r[o]:null,this.it.set(e[2],e[3]);var a=e[5],c=e[6],f=this.qr;null!=a&&null!=c?f.set(a,c):f.set(1,0),this.margin=e[4]||0,this.unlock(),u&&u.connector.add(this)}},n.prototype.fit=function(t){return t&&(this.Jr+=1,this.Qr+=1),this.doFit(),this},n.prototype.doFit=function(){var t=this.Jr,n=this.Zr!==t,i=this.Qr,r=this.$r!==i;if(n||r){this.Zr=t,this.$r=i;var e=this.Yr,u=e.shape,s=e.edge;if(null!=u&&null!=s){var h=Vr.get(u.type).get(u,s);if(h){var o=this.toAcceptorTransform(u),a=o.a,c=o.b,f=o.c,l=o.d,v=o.tx,b=o.ty;if(this.lock(),n){var d=u.size,g=u.transform.pivot,m=g.x+d.x*h.x,w=g.y+d.y*h.y;this.it.set(a*m+f*w+v,c*m+l*w+b)}if(r){var p=h.normal,O=p.x,D=p.y,E=a*O+f*D,M=c*O+l*D,S=E*E+M*M,T=this.qr;if(1e-6<S){var j=1/Math.sqrt(S);T.set(E*j,M*j)}else T.set(O,D)}var N=this.re||this.ee;return this.unlock(),N}}}return!1},n.prototype.toAcceptorTransform=function(i){var r;i.updateTransform();var e=this.p,u=e.parent;return u?(e.updateTransform(),(null!==(r=n.WORK_MATRIX)&&void 0!==r?r:n.WORK_MATRIX=new t.Matrix).copyFrom(u.transform.worldTransform).invert().append(i.transform.worldTransform)):i.transform.worldTransform},n.prototype.onAcceptorChange=function(){if(0<this.ne)return this.re=!1,this.ee=!1,void(this.ie=!0);this.fit(!0)},n.prototype.onLocalChange=function(){0<this.ne?this.re=!0:(this.Jr+=1,this.Zr=this.Jr,this.ut())},n.prototype.onNormalChange=function(){0<this.ne?this.ee=!0:(this.Qr+=1,this.$r=this.Qr,this.ut())},n.prototype.onOtherChange=function(){0<this.ne?this.ue=!0:this.ut()},n.prototype.attach=function(){var t=this.Yr.shape;return t&&t.connector.add(this),this},n.prototype.detach=function(){var t=this.Yr.shape;return t&&t.connector.remove(this),this},n}(),Kr=function(){function t(t,n){var i=this;this.p=t,this.ne=0,this.Kt=!1,this.ut=n;var r=function(){i.onChange()};this.se=new Xr(t,r),this.he=new Xr(t,r)}return t.prototype.lock=function(){return this.ne+=1,1===this.ne&&(this.Kt=!1),this},t.prototype.unlock=function(){return this.ne-=1,0===this.ne&&this.Kt&&this.ut(),this},t.prototype.onChange=function(){0<this.ne?this.Kt=!0:this.ut()},Object.defineProperty(t.prototype,"tail",{get:function(){return this.se},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.he},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.lock(),this.se.copy(t.tail),this.he.copy(t.head),this.unlock(),this},t.prototype.fit=function(t){return this.lock(),this.se.fit(t),this.he.fit(t),this.unlock(),this},t.prototype.serialize=function(t){var n=this.se.serialize(t),i=this.he.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.lock(),this.se.deserialize(e[0],n,i),this.he.deserialize(e[1],n,i),this.unlock()}},t.prototype.attach=function(){this.lock();var t=this.se,n=this.he;return t.attach(),n.attach(),t.fit(!0),n.fit(!0),this.unlock(),this},t.prototype.detach=function(){return this.lock(),this.se.detach(),this.he.detach(),this.unlock(),this},t}(),Yr=function(t,n){for(var i=0,r=t.length-1;i<=r;){var e=i+(r-i>>1),u=t[e];if(n<u)r=e-1;else{if(!(u<n))return e;i=e+1}}return-1},Jr=function(t,n){if(2<=t.length){for(var i=t[0],r=t[1],e=i,u=r,s=2,h=t.length;s<h;s+=2){var o=t[s],a=t[s+1];i=Math.min(i,o),r=Math.min(r,a),e=Math.max(e,o),u=Math.max(u,a)}n[0]=i,n[1]=r,n[2]=e,n[3]=u}else n[0]=0,n[1]=0,n[2]=0,n[3]=0;return n},Zr=function(){function n(n){var i=this;this.p=n,this.ne=0,this.oe=!1,this.ae=!1,this.ce=!1,this.xt=Q.NONE,this.j=new t.ObservablePoint((function(){i.onSizeChange()}),void 0,.15*q.SIZE_X,.15*q.SIZE_Y),this.C=this.newFill(),this.fe=0}return n.prototype.newFill=function(){return new $(this,!0,q.FILL_COLOR,1)},n.prototype.lock=function(){return this.ne+=1,1===this.ne&&(this.oe=!1,this.ae=!1,this.ce=!1),this},n.prototype.unlock=function(){return this.ne-=1,0===this.ne&&(this.oe?this.onTypeChange():this.ae?this.onSizeChange():this.ce&&this.onFillChange(),this.oe=!1,this.ae=!1,this.ce=!1),this},Object.defineProperty(n.prototype,"type",{get:function(){return this.xt},set:function(t){this.xt!==t&&(this.xt=t,this.onTypeChange())},enumerable:!1,configurable:!0}),n.prototype.onTypeChange=function(){0<this.ne?this.oe=!0:this.p.onTypeChange()},Object.defineProperty(n.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),n.prototype.onSizeChange=function(){0<this.ne?this.ae=!0:this.p.onSizeChange()},Object.defineProperty(n.prototype,"transform",{get:function(){return this.updateTransform()},enumerable:!1,configurable:!0}),n.prototype.updateTransform=function(){var n=this.I;null==n&&(n=new t.Matrix,this.I=n);var i=this.p.parent,r=i.id;if(this.fe!==r){this.fe=r;var e=i.formatted;2<=e.length?this.toTransform(e.values,n):n.identity()}return n},n.prototype.toTransformMatrix=function(t,n,i,r,e){var u=t-i,s=n-r,h=u*u+s*s;if(1e-5<h){var o=1/Math.sqrt(h),a=u*o,c=s*o;e.set(c,-a,-a,-c,t,n)}else e.set(1,0,0,1,t,n);return e},Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),n.prototype.onFillChange=function(){0<this.ne?this.ce=!0:this.p.onFillChange()},n.prototype.updateUploaded=function(){this.onFillChange()},n.prototype.copy=function(t){var n=t.size;return this.set(t.type,n.x,n.y),this},n.prototype.set=function(t,n,i){return this.lock(),null!=t&&(this.type=t),this.size.set(n,i),this.unlock(),this},n.prototype.serialize=function(t){var n=this.j,i=this.C.serialize(t);return t.addResource("[".concat(this.xt,",").concat(n.x,",").concat(n.y,",").concat(i,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.type=r[0],this.j.set(r[1],r[2]),this.C.deserialize(r[3],n),this.unlock()}},n}(),qr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){var i=t.length;return 4<=i?this.toTransformMatrix(t[i-2],t[i-1],t[i-4],t[i-3],n):(n.identity(),n)},n}(Zr),Qr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){return 4<=t.length?this.toTransformMatrix(t[0],t[1],t[2],t[3],n):(n.identity(),n)},n}(Zr),$r=function(){function t(t){this.p=t,this.ne=0,this.oe=!1,this.ae=!1,this.ce=!1,this.he=new qr(this),this.se=new Qr(this)}return t.prototype.lock=function(){return this.ne+=1,1===this.ne&&(this.oe=!1,this.ae=!1,this.ce=!1),this},t.prototype.unlock=function(){return this.ne-=1,0===this.ne&&(this.oe?this.onTypeChange():this.ae?this.onSizeChange():this.ce&&this.onFillChange(),this.oe=!1,this.ae=!1,this.ce=!1),this},Object.defineProperty(t.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.he},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.se},enumerable:!1,configurable:!0}),t.prototype.onTypeChange=function(){0<this.ne?this.oe=!0:this.p.onMarkerTypeChange()},t.prototype.onSizeChange=function(){0<this.ne?this.ae=!0:this.p.onMarkerSizeChange()},t.prototype.onFillChange=function(){0<this.ne?this.ce=!0:this.p.onMarkerFillChange()},t.prototype.copy=function(t){return this.lock(),this.he.copy(t.head),this.se.copy(t.tail),this.unlock(),this},t.prototype.serialize=function(t){var n=this.he.serialize(t),i=this.se.serialize(t);return t.addResource("[".concat(n,",").concat(i,"]"))},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.he.deserialize(r[0],n),this.se.deserialize(r[1],n),this.unlock()}},t}(),te=2*Math.PI,ne=.5*Math.PI,ie=function(t,n,i,r){return t*i+n*r},re=function(t,n){return Math.sqrt(ie(t,n,t,n))},ee=function(t,n,i,r){return t*r-n*i},ue=function(t,n,i,r,e,u,s,h,o,a){var c=a.center;c[0]=t,c[1]=n;var f=a.axis1;f[0]=i,f[1]=r;var l=a.axis2;l[0]=e,l[1]=u;var v=a.angle;return v[0]=s,v[1]=h,v[2]=o,a},se=function(t,n){var i=t.center,r=t.axis1,e=t.axis2,u=t.angle;return ue(i[0],i[1],r[0],r[1],e[0],e[1],u[0],u[1],u[2],n)},he=function(t,n){for(var i=t.length,r=0;r<i;++r)n[r]=t[r];return n.length!==i&&(n.length=i),n},oe=function(){function t(){}return t.set=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){for(var d=Math.max(Math.abs(n-i),Math.abs(s-h)),g=f?Math.max(1,Math.round(c*(d/ne))):c,m=l?g+1:g,w=0;w<m;++w){var p=w/g,O=1-p,D=p,E=O*n+D*i,M=Math.cos(E),S=Math.sin(E),T=t[0]+M*r[0]+S*e[0],j=t[1]+M*r[1]+S*e[1],N=O*s+D*h,I=Math.cos(N),C=Math.sin(N),A=u[0]+I*o[0]+C*a[0],R=u[1]+I*o[1]+C*a[1],k=ne*p,L=Math.cos(k),y=Math.sin(k),x=L*L,B=y*y,_=x*T+B*A,P=x*j+B*R;v[++b]=_,v[++b]=P}return b},t.interpolate=function(t,n,i,r,e,u,s,h){var o=h.values,a=h.segments;if(t<=2)return he(n,o),he(i,a),h;var c=this.WORK_P0||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},f=this.WORK_P1||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},l=this.WORK_P2||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]};this.WORK_P0=c,this.WORK_P1=f,this.WORK_P2=l;var v=-1,b=-1;if(e){r(0,t,n,c),se(c,f);for(var d=1;d<t;++d){if(r(d,t,n,l),0<=Yr(i,d)){var g=d-1<<1;o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1}else v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v);var m=f;f=l,l=m}0<=Yr(i,0)?(g=t-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a.unshift(0),b+=1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v)}else{r(1,t,n,c),0<=Yr(i,1)?(o[++v]=n[0],o[++v]=n[1],a[++b]=1):v=this.set(c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v),se(c,f),d=2;for(var w=t-1;d<w;++d)r(d,t,n,l),0<=Yr(i,d)?(g=d-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v),m=f,f=l,l=m;0<=Yr(i,t-1)?(g=t-2<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,u,s,!0,o,v)}return v+=1,o.length!==v&&(o.length=v),b+=1,a.length!==b&&(a.length=b),h},t.toCircle=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=a-h,b=c-o,d=f-a,g=l-c,m=h+.5*v,w=o+.5*b,p=a+.5*d,O=c+.5*g,D=-b,E=+v,M=-g,S=+d,T=ee(D,E,M,S);if(Math.abs(T)<.001){if(0<=ie(v,b,d,g)||n<=2){var j=.01,N=Math.sin(j),I=re(v,b),C=re(d,g);return ue(a,c,0,0,d/N,g/N,-j*I/C,0,j,r)}T=.001}var A=(S*(p-m)+M*(w-O))/T,R=m+A*D,k=w+A*E,L=a-R,y=c-k,x=-y,B=+L,_=f-R,P=l-k,F=Math.atan2(ie(x,B,_,P),ie(L,y,_,P)),U=h-R,G=o-k,H=Math.atan2(ie(x,B,U,G),ie(L,y,U,G));return 0<H*F&&(Math.abs(H)<Math.abs(F)&&(0<F?F-=te:F+=te),Math.abs(F)<Math.abs(H)&&(0<H?H-=te:H+=te)),ue(R,k,L,y,x,B,H,0,F,r)},t.toEllipse=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=h-a,b=o-c,d=f-a,g=l-c;if(n<=2){var m=.01,w=Math.sin(m);return ue(a,c,0,0,d/w,g/w,-m,0,m,r)}for(var p=re(v,b),O=re(d,g),D=ie(v,b,d,g)/(p*O),E=Math.acos(D),M=.5*E,S=.25*E,T=0,j=0,N=0,I=0,C=Math.max(p,O),A=Math.min(p,O),R=0;R<16;++R){var k=.5*M,L=E-k;T=C*Math.sin(k),j=C*Math.cos(k),N=A*Math.sin(L),1<(1-(I=A*Math.cos(L))/j)*(1-I/j)+N*N/(T*T)?M+=S:M-=S,S*=.5}var y=Math.asin(Math.min(N/T,1));if(p<O){var x=d/O,B=g/O,_=void 0,P=void 0;return 0<ee(v,b,d,g)?(_=+B,P=-x):(_=-B,P=+x),ue(z=a-(G=(F=-j*j/O)*x+(U=-j*T/O)*_),V=c-(H=F*B+U*P),G,H,f-z,l-V,-y,0,ne,r)}var F,U,G,H,z,V,W=v/p,X=b/p;return _=void 0,P=void 0,ee(v,b,d,g)<0?(_=+X,P=-W):(_=-X,P=+W),ue(z=a-(G=(F=-j*j/p)*W+(U=-j*T/p)*_),V=c-(H=F*X+U*P),G,H,-(h-z),-(o-V),-ne,0,y,r)},t.toHybrid=function(n,i,r,e){var u=t.toCircle(n,i,r,e),s=u.angle[0],h=u.angle[2],o=Math.min(s,h),a=Math.max(s,h);return o<-ne||ne<a?t.toEllipse(n,i,r,e):u},t}(),ae=function(t,n,i,r,e){return oe.interpolate(t,n,i,oe.toHybrid,!!(r&z.CLOSED),q.CURVE_SEGMENT_COUNT,!0,e),e.length=e.values.length>>1,e.style=r,e},ce=function(){function t(){}return t.set=function(t,n){null==this.data&&(this.data=this.newData()),this.data.set(t,n)},t.get=function(t){return null==this.data&&(this.data=this.newData()),this.data.get(t)},t.each=function(t){null==this.data&&(this.data=this.newData()),this.data.forEach((function(n,i){t(i,n)}))},t.find=function(t){return this.get((t&z.FORMATTER_MASK)>>z.FORMATTER_SHIFT)},t.newData=function(){var t=new Map;return t.set(z.FORMATTER_CURVE,{label:"Curve",formatter:ae}),t},t}(),fe=function(){function n(n){this.p=n,this.le=0,this.k=[],this.L=[];var i=n.size,r=i.x,e=i.y;this.ve=new t.Point(r,e),this.be=new t.Point(r,e),this.R=0,this.B=z.NONE,this.de=-1}return Object.defineProperty(n.prototype,"length",{get:function(){return this.k.length>>1},enumerable:!1,configurable:!0}),n.prototype.toFitted=function(){this.ge=void 0;var t=this.p.size;this.be.copyFrom(t),this.ve.copyFrom(t)},n.prototype.fit=function(){var t=this.be,n=this.p.size,i=n.x,r=n.y,e=1e-5;if(e<Math.abs(i-t.x)||e<Math.abs(r-t.y)){t.set(i,r);var u=this.ve,s=e<Math.abs(u.x),h=e<Math.abs(u.y);if(s||h){var o=s?i/u.x:1,a=h?r/u.y:1,c=this.k,f=this.ge;if(null==f){f=[],this.ge=f;for(var l=0,v=c.length;l<v;l+=2){var b=c[l],d=c[l+1];c[l]=b*o,c[l+1]=d*a,f.push(b,d)}}else for(l=0,v=c.length;l<v;l+=2)c[l]=f[l]*o,c[l+1]=f[l+1]*a;if(this.R===this.de){var g=this.me;if(null!=g){var m=g.values,w=this.we;if(null==w)for(w=[],this.we=w,l=0,v=m.length;l<v;l+=2)b=m[l],d=m[l+1],m[l]=b*o,m[l+1]=d*a,w.push(b,d);else for(l=0,v=m.length;l<v;l+=2)m[l]=w[l]*o,m[l+1]=w[l+1]*a;var p=g.boundary,O=this.pe;if(null==O)for(O=[0,0,0,0],this.pe=O,l=0,v=p.length;l<v;l+=2)b=p[l],d=p[l+1],p[l]=b*o,p[l+1]=d*a,O[l]=b,O[l+1]=d;else for(l=0,v=p.length;l<v;l+=2)p[l]=O[l]*o,p[l+1]=O[l+1]*a;this.de+=1}}this.R+=1}}},Object.defineProperty(n.prototype,"id",{get:function(){return this.fit(),this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.fit(),this.k},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.L},set:function(t){this.set(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this.B},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=this.newMarker(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){return this.A},n.prototype.newMarker=function(){return new $r(this)},n.prototype.onMarkerTypeChange=function(){var t=this.p;t.uploaded=void 0,t.toDirty()},n.prototype.onMarkerSizeChange=function(){this.p.updateUploaded()},n.prototype.onMarkerFillChange=function(){this.p.updateUploaded()},Object.defineProperty(n.prototype,"formatter",{get:function(){return this.Oe||null},set:function(t){this.Oe!==t&&(this.de=-1,this.Oe=t,this.toDirty(!0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){var t,n;this.fit();var i=this.R,r=this.me;if(this.de!==i){this.de=i;var e=this.B,u=null!==(t=this.Oe)&&void 0!==t?t:null===(n=ce.find(e))||void 0===n?void 0:n.formatter;if(null!=u){null==r&&(r={length:0,values:[],segments:[],boundary:[0,0,0,0],style:z.NONE});var s=this.ge,h=this.L;if(null!=s){u(s.length>>1,s,h,e,r),Jr(r.values,r.boundary);var o=r.values,a=o.splice(0);this.we=a;var c=r.boundary,f=[c[0],c[1],c[2],c[3]];this.pe=f,this.toScaled(o,a,c,f)}else{var l=this.k;u(l.length>>1,l,h,e,r),Jr(r.values,r.boundary),this.we=void 0,this.pe=void 0}}else r=void 0,this.we=void 0,this.pe=void 0;this.me=r}return r||this},enumerable:!1,configurable:!0}),n.prototype.toScaled=function(t,n,i,r){var e=this.be,u=this.ve,s=1e-5,h=s<Math.abs(u.x),o=s<Math.abs(u.y);if(h||o){for(var a=h?e.x/u.x:1,c=o?e.y/u.y:1,f=0,l=n.length;f<l;f+=2)t[f]=n[f]*a,t[f+1]=n[f+1]*c;for(f=0,l=r.length;f<l;f+=2)i[f]=r[f]*a,i[f+1]=r[f+1]*c}},n.prototype.copy=function(t){this.set(t.values,t.segments,t.style);var n=t.getMarker();return n&&this.marker.copy(n),this},n.prototype.set=function(t,n,i){var r=!1,e=!1,u=this.B,s=u&z.FORMATTER_MASK,h=this.Oe;if(null!=t){var o=this.k,a=this.le,c=t.length,f=Math.min(c,a);if(this.toFitted(),o!==t){for(var l=0;l<f;++l)o[l]=t[l];for(l=f;l<c;++l)o.push(t[l]);a!==c?(o.length=c,this.le=c,r=!0):null!=h||s?r=!0:e=!0}else a!==c?(this.le=c,r=!0):null!=h||s?r=!0:e=!0}if(null!=n){var v=this.L;if(v!==n){var b=n.length;for(f=Math.min(v.length,b),l=0;l<f;++l)v[l]=n[l];for(l=f;l<b;++l)v.push(n[l]);v.length!==b&&(v.length=b)}null!=h||s?r=!0:e=!0}return null!=i&&u!==i&&(s!==(i&z.FORMATTER_MASK)||(null!=h||s)&&(u&z.CLOSED)!=(i&z.CLOSED)?r=!0:e=!0,this.B=i),(e||r)&&this.toDirty(r),this},n.prototype.toDirty=function(t){if(t){this.R+=1;var n=this.p,i=n.uploaded;i?i.isCompatible(n)?n.updateUploaded():(n.uploaded=void 0,n.toDirty()):n.updateUploaded()}else this.R+=1,this.p.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){var n=JSON.stringify(this.k),i=JSON.stringify(this.L),r=this.B,e=-1,u=this.A;return u&&(e=u.serialize(t)),t.addResource("[".concat(n,",").concat(i,",").concat(r,",").concat(e,"]"))},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.set(r[0],r[1],r[2]);var e=r[3];null!=e&&0<=e&&this.marker.deserialize(e,n)}},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o){var a=this.formatted,c=a.length;if(2<=c){var f=a.values,l=a.segments,v=a.style,b=0,d=c;if(s){var g=n.WORK_RANGE;s(t,i,u,f,g),b=g[0],d=g[1]}for(var m=b,w=Math.min(d,c-1);m<w;++m){var p;if(Yr(l,m+1)<0&&h(t,i,f[0+(p=m<<1)],f[p+1],f[p+2],f[p+3],m,u,o))return!0}if(2<c&&c<=d&&v&z.CLOSED&&Yr(l,0)<0&&h(t,i,f[0+(p=(m=c-1)<<1)],f[p+1],f[0],f[1],m,u,o))return!0}return!1},n.WORK_RANGE=[0,0],n}(),le=function(){function t(t,n){this.p=t,this.R=0,this.k=[],this.ne=0,this.Kt=!1,this.ut=n}return t.prototype.lock=function(){this.ne+=1,1===this.ne&&(this.Kt=!1)},t.prototype.unlock=function(){this.ne-=1,0===this.ne&&(this.Kt&&this.onChange(),this.Kt=!1)},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){return this.k},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t){if(null!=t){if(this.R+=1,this.k!==t){for(var n=t.length,i=this.k,r=0;r<n;++r)i[r]=t[r];i.length=n}this.onChange()}return this},t.prototype.copy=function(t){return this.set(t.values)},t.prototype.serialize=function(t){return t.addResource(JSON.stringify(this.k))},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.set(e)}},t.prototype.onChange=function(){0<this.ne?this.Kt=!0:this.ut()},t}(),ve=function(t){function n(n){void 0===n&&(n=r.CONNECTOR_LINE);var i=t.call(this,n)||this;i.De=0,i.Ee=0,i.Me=0,i.Se=0,i.Te=0,i.je=0,i.Ne=0,i.ne=0,i.Kt=!1;var e=.5*q.SIZE_X,u=.5*q.SIZE_Y;i.jt=new fe(i).set([-e,-u,+e,+u]);var s=function(){i.onChange()};return i.Kr=new Kr(i,s),i.Ie=new le(i,s),i}return _(n,t),n.prototype.lock=function(){this.ne+=1,1===this.ne&&(this.Kt=!1)},n.prototype.unlock=function(){this.ne-=1,0===this.ne&&(this.Kt&&this.onChange(),this.Kt=!1)},Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edge",{get:function(){return this.Kr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"body",{get:function(){return this.Ie},enumerable:!1,configurable:!0}),n.prototype.onAttach=function(){t.prototype.onAttach.call(this),this.Kr.attach()},n.prototype.onDetach=function(){this.Kr.detach(),t.prototype.onDetach.call(this)},n.prototype.onChange=function(){var t;if(0<this.ne)this.Kt=!0;else{var i=this.Kr,r=i.tail,e=r.localId,u=r.normalId,s=r.margin,h=i.head,o=h.localId,a=h.normalId,c=h.margin,f=this.Ie,l=f.id;if(this.De!==e||this.Ee!==u||this.Me!==s||this.Se!==o||this.Te!==a||this.je!==c||this.Ne!==l){this.De=e,this.Ee=u,this.Me=s,this.Se=o,this.Te=a,this.je=c,this.Ne;var v=this.transform,b=v.position,d=b.x,g=b.y,m=this.jt,w=m.values;this.fillPoints(r,s,h,c,f,d,g,w);var p=null!==(t=n.WORK_BOUNDARY)&&void 0!==t?t:n.WORK_BOUNDARY=[0,0,0,0];Jr(w,p);for(var O=.5*(p[2]+p[0]),D=.5*(p[3]+p[1]),E=p[2]-p[0],M=p[3]-p[1],S=0,T=w.length;S<T;S+=2)w[S+0]-=O,w[S+1]-=D;this.disallowUploadedUpdate(),b.set(d+O,g+D),v.scale.set(1,1),v.rotation=0,v.skew.set(0,0),this.size.set(E,M),m.toFitted(),m.set(w),this.allowUploadedUpdate()}}},n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=1e-6,a=t.local,c=a.x-u,f=a.y-s,l=i.local,v=l.x-u,b=l.y-s,d=e.values,g=d.length;if(h[0]=c,h[1]=f,0<g)for(var m=.5*(v+c),w=.5*(b+f),p=v-c,O=b-f,D=Math.atan2(O,p),E=Math.cos(D),M=Math.sin(D),S=Math.sqrt(p*p+O*O),T=0;T<g;T+=2){var j=d[T+0],N=d[T+1];h[T+2]=m+(E*j-M*N)*S,h[T+3]=w+(E*N+M*j)*S}if(h[2+g]=v,h[3+g]=b,0!==n&&o<(p=h[2]-c)*p+(O=h[3]-f)*O){var I=n/Math.sqrt(p*p+O*O);h[0]=c+p*I,h[1]=f+O*I}0!==r&&o<(p=h[0+g]-v)*p+(O=h[1+g]-b)*O&&(I=r/Math.sqrt(p*p+O*O),h[2+g]=v+p*I,h[3+g]=b+O*I),h.length=g+4},n.prototype.copy=function(i,r){return void 0===r&&(r=at.ALL),t.prototype.copy.call(this,i,r),i instanceof n&&(this.Kr.copy(i.edge),this.Ie.copy(i.body)),this},n.prototype.clone=function(){return new(0,this.constructor)(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.Kr.serialize(n),e=this.Ie.serialize(n),u=this.jt.serialize(n);return i[15]=n.addResource("[".concat(r,",").concat(u,",").concat(e,"]")),i},n}(rn),be=function(){function t(){}return t.isConnector=function(t){return t instanceof ve},t.newMapping=function(n,i,r){var e;null==r&&(r=null!==(e=t.Ce)&&void 0!==e?e:t.Ce=new Map).clear();for(var u=0,s=n.length;u<s;++u){var h=n[u],o=i[u];r.set(h,o),this.newMapping(h.children,o.children,r)}return r},t.moveAll=function(t,n,i,r,e){for(var u=0,s=i.length;u<s;++u){var h=i[u],o=r[u];if(this.isConnector(h)&&this.isConnector(o)){var a=h.edge,c=o.edge,f=a.head,l=f.acceptor.shape;if(l){null==e&&(e=this.newMapping(t,n));var v=e.get(l);if(v){var b=c.head;b.detach(),b.set(v),b.attach(),v.connector.remove(f)}}var d=a.tail,g=d.acceptor.shape;if(g){null==e&&(e=this.newMapping(t,n));var m=e.get(g);if(m){var w=c.tail;w.detach(),w.set(m),w.attach(),m.connector.remove(d)}}}e=this.moveAll(t,n,h.children,o.children,e)}return e},t.move=function(t,n){var i=t.children,r=n.children;this.moveAll(i,r,i,r)},t}(),de=function(){function n(n,i,r,e,u){this.id=n,this.ref=0;var s=u.resolution;this.frame=new t.Rectangle(0,0,i*s,r*s),this.texture=new t.Texture(u,new t.Rectangle(0,0,1,1)),this.width=i,this.height=r,this.strokeWidth=e}return n.prototype.applyFrame=function(){var t=1/this.texture.baseTexture.resolution;this.texture.frame.x=this.frame.x*t,this.texture.frame.y=this.frame.y*t,this.texture.frame.width=this.width,this.texture.frame.height=this.height,this.texture.updateUvs(),this.texture.emit("update",this)},n.prototype.destroy=function(){this.texture.destroy()},n}(),ge=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){},n}(de),me=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.save(),t.fillStyle="#ffffff",t.fillRect(n.x-1,n.y-1,n.width+2,n.height+2),t.restore()},n}(de),we=function(){function n(n){var i=this.vr=document.createElement("canvas");i.width=i.height=256;var r=this.Ae=t.BaseTexture.from(i,{mipmap:t.MIPMAP_MODES.OFF,resolution:n});this.Re={},this.ke=[],this.Le={empty:new ge("empty",10,10,0,r),white:new me("white",10,10,0,r)},this.En=!0}return n.prototype.updateFrames=function(t,n){for(var i=4,r=4,e=0,u=0,s=n.length;u<s;++u){var h=n[u];t<i+h.frame.width+4&&(i=4,r+=e+4,e=0),h.frame.x=0|i,h.frame.y=0|r,i+=h.frame.width+4,e=Math.max(e,h.frame.height)}for(var o=r+e+4,a=256;a<o;)a<<=1;return Math.min(4096,a)},n.prototype.renderFrames=function(t,n,i){var r=this.vr;r.width=t,r.height=n;var e=r.getContext("2d");if(null!=e)for(var u=0,s=i.length;u<s;++u)i[u].render(e)},n.prototype.applyFrames=function(t){for(var n=0,i=t.length;n<i;++n)t[n].applyFrame()},n.prototype.calcCanvasWidth=function(t){for(var n=128,i=t.length-1;0<=i;--i)for(var r=t[i],e=Math.max(r.frame.width,r.frame.height);n<e;)n<<=1;return Math.min(4096,n<<1)},n.prototype.cleanup=function(t){t.sort(n.ITEM_COMPARATOR);for(var i=t.length-1;0<=i;--i)if(0<t[i].ref)return void(t.length=i+1);t.length=0},n.prototype.begin=function(){for(var t=this.ke,n=0,i=t.length;n<i;++n)t[n].ref=0;this.En=!1},n.prototype.end=function(){for(var t=this.Re,n=this.ke,i=0,r=n.length;i<r;++i){var e=n[i];e.ref<=0&&(e.id in this.Le||e.destroy(),delete t[e.id],this.En=!0)}},n.prototype.repack=function(t){if(!0===t||this.En){this.En=!1;var n=this.ke;this.cleanup(n);var i=this.calcCanvasWidth(n),r=this.updateFrames(i,n);this.renderFrames(i,r,n),this.Ae.setRealSize(i,r),this.applyFrames(n)}},n.prototype.get=function(t){var n=this.Re[t];if(null!=n)return n.ref+=1,n;var i=this.Le[t];return null!=i?(this.set(t,i),i):null},n.prototype.set=function(t,n){var i=this.Re[t];return n.ref+=1,this.Re[t]=n,this.ke.push(n),this.En=!0,i},n.prototype.toDirty=function(){this.En=!0},n.prototype.getDefaultTexture=function(){return this.get("white").texture},n.prototype.getBaseTexture=function(){return this.Ae},n.prototype.release=function(t){var n=this.Re,i=n[t];null!=i&&(i.ref-=1,i.ref<=0&&(i.id in this.Le||i.destroy(),delete n[t],this.En=!0))},n.ITEM_COMPARATOR=function(t,n){return t.ref<=0?n.ref<=0?0:1:n.ref<=0||t.frame.height<n.frame.height?-1:n.frame.height<t.frame.height?1:t.frame.width-n.frame.width},n}(),pe=function(t){function n(n,i){var r=t.call(this,n.id,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.canvas=n.canvas,r}return _(n,t),n.prototype.render=function(t){var n=this.canvas;if(null!=n){var i=this.frame;t.drawImage(n,i.x,i.y,i.width,i.height)}},n}(de),Oe="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",De=function(t,n){this.x=t,this.y=n},Ee=function(t,n,i,r,e){this.ref=1,this.life=10,this.character=t,this.x=0,this.y=0,this.width=i,this.height=r,this.advance=n,this.origin=new De(0,0),this.type=e},Me={RESERVED:1,NON_BREAKING:2,SPACE:4,SPACE_R:5,SPACE_NB:6,SPACE_RNB:7,LETTER:8,LETTER_R:9,LETTER_NB:10,LETTER_RNB:11},Se=function(){function t(){var t=this;this.ye=null,this.xe=null,this.Be=null,this._e=NaN,this.Pe=NaN,this.Fe=NaN,this.Ue=NaN,this.Ge=null,this.He=null;var n=this.vr=document.createElement("canvas");n.width=64,n.height=64,this.ze=function(t){t.preventDefault()},this.Ve=function(){t.restore()},this.We=function(){t.destroy()},n.addEventListener("webglcontextlost",this.ze,!1),n.addEventListener("webglcontextrestored",this.Ve,!1),window.addEventListener("unload",this.We,!1)}return t.prototype.init=function(){var t=this.vr;if(null!=t&&(null==this.ye||this.ye.isContextLost())){var n={alpha:!0,antialias:!1,depth:!1,stencil:!1,premultipliedAlpha:!1},i=t.getContext("webgl",n)||t.getContext("experimental-webgl",n);this.ye=i,null!=i&&(i.clearColor(1,1,1,0),this.makeVertexBuffer(),this.makeUvBuffer(),this.makeShaders(),this.xe=null)}return this},t.prototype.restore=function(){this.init()},t.prototype.getCanvas=function(){return this.vr},t.prototype.getShader=function(t,n,i){var r=i?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);return null==r||(t.shaderSource(r,n),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))?r:(console&&console.error("Failed to compile the shader: ".concat(t.getShaderInfoLog(r))),null)},t.prototype.makeShaders=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.getShader(t,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying mediump vec2 vTextureCoord;\nvoid main(void) {\n\tgl_Position = vec4(aVertexPosition, 0.0, 1.0);\n\tvTextureCoord = aTextureCoord;\n}\n",!1);if(null!=n){var i=this.getShader(t,"\nprecision mediump float;\n\nvarying mediump vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec2 uSize;\n\nfloat calcDistance( float x, float y, float dx, float dy ) {\n\tfloat xd = x + dx;\n\tfloat yd = y + dy;\n\tfloat u = xd / uSize.x;\n\tfloat v = yd / uSize.y;\n\tfloat ul = (xd - 1.0) / uSize.x;\n\tfloat vt = (yd - 1.0) / uSize.y;\n\n\tfloat m = texture2D(uSampler, vec2(u , v )).a;\n\tfloat l = texture2D(uSampler, vec2(ul, v )).a;\n\tfloat t = texture2D(uSampler, vec2(u , vt)).a;\n\tfloat ddx = -(0.5 - m) / (l - m);\n\tfloat ddy = -(0.5 - m) / (t - m);\n\tbool bl = min(l,m) < 0.5 && 0.5 <= max(l,m);\n\tbool bt = min(t,m) < 0.5 && 0.5 <= max(t,m);\n\treturn (\n\t\tbl ?\n\t\t(bt ?\n\t\t\tlength(vec2(dx + ddx * 0.5, dy + ddy * 0.5)) :\n\t\t\tlength(vec2(dx + ddx, dy))\n\t\t) :\n\t\t(bt ?\n\t\t\tlength(vec2(dx, dy + ddy)) :\n\t\t\t100.0\n\t\t)\n\t);\n}\n\nfloat calcDistancesY( float x, float y, float dx ) {\n\tfloat d = 100.0;\n\tfor( float dy=-6.0; dy<6.5; dy++ ) {\n\t\td = min( d, calcDistance( x, y, dx, dy ) );\n\t}\n\treturn d;\n}\n\nfloat calcDistances( float x, float y ) {\n\tfloat d = 100.0;\n\tfor( float dx=-6.0; dx<6.5; dx++ ) {\n\t\td = min( d, calcDistancesY( x, y, dx ) );\n\t}\n\treturn d;\n}\n\nvoid main(void) {\n\tfloat t = texture2D(uSampler, vTextureCoord).a;\n\tfloat x = vTextureCoord.x * uSize.x;\n\tfloat y = vTextureCoord.y * uSize.y;\n\tfloat d = min( 6.0, calcDistances( x, y ) ) / 12.0;\n\td = clamp( mix( 0.5 - d, 0.5 + d, step( 0.5, t ) ), 0.0, 1.0 );\n\tgl_FragColor = vec4(1.0, 1.0, 1.0, d);\n}\n",!0);if(null!=i){var r=this.Be=t.createProgram();if(null!=r)return t.attachShader(r,n),t.attachShader(r,i),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)?(t.deleteShader(n),t.deleteShader(i),t.useProgram(r),this._e=t.getAttribLocation(r,"aVertexPosition"),this.Pe=t.getAttribLocation(r,"aTextureCoord"),this.Fe=t.getUniformLocation(r,"uSampler"),this.Ue=t.getUniformLocation(r,"uSize"),t.useProgram(null),r):(console&&console.error("Failed to link the program: ".concat(t.getError())),t.deleteShader(n),t.deleteShader(i),null);t.deleteShader(n),t.deleteShader(i)}else t.deleteShader(n)}}return null},t.prototype.destroyShaders=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.Be;null!=n&&(this.Be=null,t.useProgram(null),t.deleteProgram(n))}},t.prototype.updateTexture=function(t){var n=this.ye,i=this.vr;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=t.width,e=t.height;i.width===r&&i.height===e||(i.width=r,i.height=e,n.viewport(0,0,r,e));var u=this.xe;return null==u?(u=this.xe=n.createTexture(),n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.bindTexture(n.TEXTURE_2D,null)):(n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.bindTexture(n.TEXTURE_2D,null)),u}return null},t.prototype.destroyTexture=function(){var t=this.ye,n=this.xe;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.xe=null,t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n))},t.prototype.makeVertexBuffer=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.Ge=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,1,1,1,-1,-1,1,-1]),t.STATIC_DRAW),n}return null},t.prototype.destroyVertexBuffer=function(){var t=this.ye,n=this.Ge;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.Ge=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.makeUvBuffer=function(){var t=this.ye;if(null!=t&&!0!==t.isContextLost()){var n=this.He=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),t.STATIC_DRAW),n}return null},t.prototype.destroyUvBuffer=function(){var t=this.ye,n=this.He;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.He=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.render=function(){var t=this.ye,n=this.vr,i=this.Be,r=this.Ge,e=this.He,u=this.xe;if(null!=t&&!0!==t.isContextLost()&&null!=n&&null!=i&&null!=r&&null!=e&&null!=u){t.clear(t.COLOR_BUFFER_BIT),t.useProgram(i),t.bindBuffer(t.ARRAY_BUFFER,r);var s=this._e;t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,e);var h=this.Pe;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,u),t.uniform1i(this.Fe,0),t.uniform2f(this.Ue,n.width,n.height),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.bindTexture(t.TEXTURE_2D,null),t.bindBuffer(t.ARRAY_BUFFER,null),t.useProgram(null)}},t.prototype.read=function(t){var n=this.ye,i=this.vr;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=i.width,e=i.height;t.width=r,t.height=e;var u=t.getContext("2d");null!=u&&u.drawImage(i,0,0)}},t.prototype.destroy=function(){this.destroyVertexBuffer(),this.destroyUvBuffer(),this.destroyShaders();var t=this.vr;null!=t&&(this.vr=null,t.removeEventListener("webglcontextlost",this.ze,!1),t.removeEventListener("webglcontextrestored",this.Ve,!1),window.removeEventListener("unload",this.We,!1));var n=this.ye;if(null!=n){this.ye=null;var i=n.getExtension("WEBGL_lose_context");null!=i&&i.loseContext()}},t.getInstance=function(){return null==t.Xe&&(t.Xe=new t),t.Xe},t.Xe=null,t}(),Te=function(){function t(n){this.R="font-atlas:".concat(n),this.Ke=Se.getInstance().init(),this.vr=document.createElement("canvas"),this.Ye={family:t.toFontFamily(n),size:32,italic:!1},this.Je={},this.Ze=0,this.kt=1,this.pn=1,this.En=!0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.Ye},set:function(t){this.Ye.family=t.family,this.Ye.size=t.size,this.Ye.italic=t.italic},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.kt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this.vr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generator",{get:function(){return this.Ke},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"characters",{get:function(){return this.Je},enumerable:!1,configurable:!0}),t.prototype.begin=function(){this.Ze=0;var t=this.Je;for(var n in t)t[n].ref=0},t.prototype.end=function(){var t=this.Je;for(var n in t){var i=t[n];i.ref<=0&&(i.life-=1,i.life<=0&&(delete t[n],this.En=!0))}},t.prototype.addAscii=function(){this.addChar(" "," ",Me.SPACE_R),this.addChar("\t"," ",Me.SPACE_R),this.addChar("...","...",Me.LETTER_RNB);for(var t=0,n=Oe.length;t<n;++t){var i=Oe[t];this.addChar(i,i,Me.LETTER_RNB)}},t.prototype.addChar=function(t,n,i){var r=this.Je;if(!this.isIgnored(n)){var e=r[t];null!=e?(e.ref<=0&&(this.Ze+=1),e.ref+=1):(r[t]=new Ee(n,0,1,1,i),this.Ze+=1,this.En=!0)}},t.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},t.prototype.add=function(t,n){void 0===n&&(n=Me.LETTER);for(var i=b.from(t);i.hasNext();){var r=i.next();this.addChar(r,r,n)}},t.prototype.get=function(t){return this.Je[t]},t.prototype.update=function(){if(this.En){var n=this.vr,i=this.Ke;if(null!=n&&null!=i){var r=n.getContext("2d");if(null!=r){this.En=!1;var e=this.Ye,u=this.Je,s=e.size+14,h=t.toPowerOf2(Math.ceil(Math.sqrt(this.Ze))*s);this.kt=h;var o=(e.italic?"italic ":"")+e.size+"px "+e.family;r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=0,r.fillStyle="#FFFFFF";var a=s>>1,c=0,f=0;for(var l in u){var v=u[l],b=r.measureText(v.character).width,d=Math.ceil(7+b+7),g=s;h<=c+d&&(c=0,f+=s),v.x=c,v.y=f,v.width=d,v.height=g,v.advance=b,v.origin.x=c+7,v.origin.y=f+a,c+=d}var m=this.pn=f+s;for(var l in n.width=h,n.height=m,r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=4,r.fillStyle="#FFFFFF",r.clearRect(0,0,h,m),u)v=u[l],r.fillText(v.character,v.origin.x,v.origin.y);return i.updateTexture(n),i.render(),i.read(n),!0}}}return!1},Object.defineProperty(t.prototype,"length",{get:function(){return this.Ze},enumerable:!1,configurable:!0}),t.prototype.toJson=function(){return{width:this.kt,height:this.pn,font:this.Ye,characters:this.Je}},t.prototype.toString=function(){return JSON.stringify(this.toJson())},t.prototype.destroy=function(){null!=this.Ke&&(this.Ke=null),null!=this.vr&&(this.vr=null);var t=this.Je;for(var n in t)delete t[n]},t.toFontFamily=function(n){return"auto"===n?t.getAutoFontFamily():n},t.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},t.getAutoFontFamily=function(){return null==t.FONT_FAMILY_AUTO&&(t.FONT_FAMILY_AUTO=Z.getInstance().get("DBase").getFontFamilly()),t.FONT_FAMILY_AUTO},t.FONT_FAMILY_AUTO=null,t}(),je=function(){function t(){this.qe={}}return t.prototype.begin=function(){var t=this.qe;for(var n in t)t[n].begin()},t.prototype.end=function(){var t=this.qe;for(var n in t){var i=t[n];0<i.length&&i.addAscii(),i.end(),i.length<=0&&(i.destroy(),delete t[n])}},t.prototype.add=function(t,n){var i=this.qe[t];if(null!=i)i.add(n);else{var r=new Te(t);r.add(n),this.qe[t]=r}},t.prototype.get=function(t){var n=this.qe[t];return null!=n?n:null},t.prototype.update=function(t){var n=this.qe,i=t.getBaseTexture();for(var r in n){var e=n[r];if(e.update()){var u=e.id,s=t.get(u);if(null!=s){var h=e.width,o=e.height,a=i.resolution;s.frame.width=h,s.frame.height=o,s.width=h/a,s.height=o/a,t.toDirty()}else t.set(u,new pe(e,i))}}},t.prototype.destroy=function(){var t=this.qe;for(var n in t)t[n].destroy();this.qe={}},t}(),Ne=function(t){function n(n,i){var r=t.call(this,n.src,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.image=n,r}return _(n,t),n.prototype.render=function(t){var n=this.frame,i=n.x,r=n.y,e=n.width,u=n.height,s=this.image;t.drawImage(s,i,r,e,u),t.drawImage(s,0,0,1,u,i-1,r-1,1,u+2),t.drawImage(s,0,0,e,1,i,r-1,e,1),t.drawImage(s,e-1,0,1,u,i+e,r-1,1,u+2),t.drawImage(s,0,u-1,e,1,i,r+u,e,1)},n}(de),Ie=function(t,n){this.texture=t,this.indexOffset=n},Ce=function(){function t(){this.index=0,this.baseTexture=null,this.units=[]}return t.prototype.begin=function(){this.index=0,this.baseTexture=null},t.prototype.push=function(t,n){if(this.index<this.units.length){var i=this.units[this.index];i.texture=t,i.indexOffset=n}else this.units.push(new Ie(t,n));this.index+=1},t.prototype.end=function(){this.units.length!==this.index&&(this.units.length=this.index)},t.prototype.destroy=function(){this.units.length=0},t}(),Ae=function(){function n(t,n){var i=3*t,r=i;this.vertices=new Float32Array(2*r),this.Qe=r,this.o=0,this.Sn=null,this.clippings=new Float32Array(3*r),this.$e=null,this.steps=new Float32Array(6*r),this.tu=null,this.colorFills=new Float32Array(4*r),this.nu=null,this.colorStrokes=new Float32Array(4*r),this.iu=null,this.uvs=new Float32Array(2*r),this.jn=null;var e=r<=65535;this.indices=e?new Uint16Array(i):new Uint32Array(i),this.ru=t,this.l=0,this.indexCountRequested=0,this.Nn=null,this.eu=n,this.uu=new Ce,this.su=null}return n.prototype.updateVertices=function(){var t=this.Sn;t&&t.update()},n.prototype.updateClippings=function(){var t=this.$e;t&&t.update()},n.prototype.updateSteps=function(){var t=this.tu;t&&t.update()},n.prototype.updateColorFills=function(){var t=this.nu;t&&t.update()},n.prototype.updateColorStrokes=function(){var t=this.iu;t&&t.update()},n.prototype.updateUvs=function(){var t=this.jn;t&&t.update()},n.prototype.updateIndices=function(){var t=this.Nn;t&&t.update()},n.prototype.getGeometry=function(){var n=this.su;return null==n&&(this.Sn=new t.Buffer(this.vertices,!1,!1),this.$e=new t.Buffer(this.clippings,!1,!1),this.tu=new t.Buffer(this.steps,!1,!1),this.nu=new t.Buffer(this.colorFills,!1,!1),this.iu=new t.Buffer(this.colorStrokes,!1,!1),this.jn=new t.Buffer(this.uvs,!1,!1),this.Nn=new t.Buffer(this.indices,!1,!0),this.su=n=(new t.Geometry).addIndex(this.Nn).addAttribute("aPosition",this.Sn,2).addAttribute("aClipping",this.$e,3).addAttribute("aStep",this.tu,2).addAttribute("aAntialias",this.tu,4).addAttribute("aColorFill",this.nu,4).addAttribute("aColorStroke",this.iu,4).addAttribute("aUv",this.jn,2)),n},n.prototype.upload=function(){this.eu.geometry.bind(this.getGeometry())},n.prototype.render=function(n){var i=this.eu;i.geometry.bind(this.getGeometry());var r=this.uu.units,e=r.length;if(0<e){for(var u=t.DRAW_MODES.TRIANGLES,s=null,h=r[0],o=0,a=3*h.indexOffset,c=0,f=t.Texture.WHITE,l=0,v=e-1;l<v;++l)s=h,o=a,c=(a=3*(h=r[l+1]).indexOffset)-o,f=s.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,o));c=3*this.l-a,f=h.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,a))}},n.prototype.isCompatible=function(t,n,i,r){return n.getBuffer()===this&&n.getVertexOffset()===i&&n.getIndexOffset()===r&&n.isCompatible(t)},n.prototype.update=function(t,n,i){var u=this.uu;u.begin();for(var s=0,h=0,o=t.get();null!=o&&null!=(a=o.uploaded)&&this.isCompatible(o,a,s,h);o=t.next())if(a.update(o),a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i)return t.next(),u.end(),this.o=s,this.l=h,0<u.units.length;for(;null!=o;o=t.next()){var a,c=e[o.type]||e[r.GROUP];if(null==c)break;if(null==(a=c(this,o,s,h,n)))break;if(a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i){t.next();break}}return u.end(),this.o=s,this.l=h,0<u.units.length},n.prototype.check=function(t,n,i,r){return this.indexCountRequested=r,t+i<=this.Qe&&n+r<=this.ru},n.prototype.destroy=function(){var t=this.su;t&&t.destroy(),this.uu.destroy()},n}(),Re=[],ke=function(){this.index=0,this.shapes=Re,this.current=null},Le=function(){function t(){this.hu=-1,this.ou=new ke,this.Xt=[this.ou],this.au=null}return t.prototype.reset=function(t,n){this.hu=0;var i=this.Xt[0];return i.index=-1,i.shapes=n,i.current=null,this.ou=i,null!=t?(this.au=t,t):this.next()},t.prototype.get=function(){return this.au},t.prototype.next=function(){for(;;){var t=this.ou,n=t.index+=1,i=t.shapes,r=n<i.length?t.current=i[n]:t.current=null;if(null==r)return e=this.hu-=1,u=this.Xt,0<=e?(h=u[e],this.ou=h,this.au=h.current):this.au=null;var e,u,s=r.children;if(!(0<s.length))return this.au=r,r;if((e=this.hu+=1)<(u=this.Xt).length)(h=u[e]).index=-1,h.shapes=s,h.current=null,this.ou=h;else{var h=new ke;u.push(h),h.index=-1,h.shapes=s,h.current=null,this.ou=h}}},t}(),ye=function(n){function i(r){var e=n.call(this,r)||this;return i.SHADER=i.SHADER||t.Shader.from("\nattribute vec2 aPosition;\nattribute vec3 aClipping;\nattribute vec2 aStep;\nattribute vec4 aAntialias;\nattribute vec4 aColorFill;\nattribute vec4 aColorStroke;\nattribute vec2 aUv;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mediump float shapeScale;\nuniform mediump float pixelScale;\nuniform mediump float antialiasWeight;\n\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nvec2 toInverse( in vec2 v ) {\n\treturn vec2( -v.y, v.x );\n}\n\nvec2 toTransformedPosition( in vec2 v ) {\n\treturn (projectionMatrix * translationMatrix * vec3(v, 1.0)).xy;\n}\n\nvec4 toAntialias01( in vec4 antialias ) {\n\t// Taylor series of 1 / ( 1 - a ) = 1 + a + a^2 + ....\n\treturn 1.0 + min( vec4( 1.0 ), antialias * pixelScale );\n}\n\nvec4 toAntialias2( in vec4 antialias, in float strokeWidth ) {\n\tfloat x = min( 0.4, 0.4 / 12.0 * antialias.x * pixelScale * antialiasWeight );\n\tfloat w = clamp( strokeWidth / antialias.y, 0.0, 1.0 ) * 0.4;\n\tfloat p = w * antialias.z + antialias.w;\n\tfloat y = 0.5 - p;\n\tfloat z = 0.5 - p - w;\n\treturn vec4( y, z, y - max( 0.01, y - x ), z - max( 0.01, z - x ) );\n}\n\nvec2 toPosition3456( in float type, in vec2 p, in vec2 pprev, in vec2 pnext, in float strokeWidth, out float shift ) {\n\tvec2 d0 = p - pprev;\n\tvec2 d1 = pnext - p;\n\tfloat l0 = dot( d0, d0 );\n\tfloat l1 = dot( d1, d1 );\n\tvec2 nd0 = normalize( toInverse( d0 ) );\n\tvec2 nd1 = normalize( toInverse( d1 ) );\n\tvec2 nd2 = 0.00001 < l1 ? nd1 : vec2(0.0, 0.0);\n\tvec2 n0 = 0.00001 < l0 ? nd0 : nd2;\n\tvec2 n1 = 0.00001 < l1 ? nd1 : n0;\n\tvec2 n0i = toInverse( n0 );\n\tvec2 n1i = toInverse( n1 );\n\tfloat direction = sign( 4.5 - type );\n\n\t// Offset\n\tfloat cross = dot( n0i, n1 );\n\tfloat crossInverse = ( 0.00001 < abs( cross ) ? 1.0 / cross : 0.0 );\n\tfloat b = dot(n1 - n0, n0) * crossInverse;\n\tfloat offsetSize = direction * strokeWidth * 0.5;\n\tvec2 offset = n1 + n1i * b;\n\n\t// Miter\n\tvec2 pmiter = p + offsetSize * offset;\n\tfloat miterAngle0 = dot( n0i, pmiter - pprev );\n\tfloat miterAngle1 = dot( n1i, pmiter - pnext );\n\tfloat miterLength = dot( offset, offset );\n\tfloat miterSide = direction * cross;\n\n\t// Bevel\n\tvec2 n = ( type == 4.0 || type == 6.0 ? n1 : n0 );\n\tvec2 pbevel = p + offsetSize * n;\n\n\t//\n\tvec2 presult = (\n\t\t0.0 <= miterSide ?\n\t\t( miterAngle0 < 0.0 && 0.0 <= miterAngle1 ? pmiter : pbevel ) :\n\t\t( miterLength < 6.0 ? pmiter : pbevel )\n\t);\n\tvec2 ni = ( type == 4.0 || type == 6.0 ? n1i : n0i );\n\tshift = dot( ni, p - presult );\n\treturn toTransformedPosition( presult );\n}\n\nvec2 toStep3456( in float type ) {\n\treturn ( type < 4.5 ? vec2( 1.0, 0.0 ) : vec2( 0.0, 1.0 ) );\n}\n\nvec4 toAntialias3456( in float strokeWidth ) {\n\tfloat a = antialiasWeight / max( 0.0001, strokeWidth );\n\treturn toAntialias01( vec4( a, a, a, a ) );\n}\n\nfloat toDotAndDashScale( in float scale, in float strokeWidthScale ) {\n\treturn (\n\t\tscale == 4.0 || scale == 5.0 || scale == 6.0 || scale == 7.0 ?\n\t\tstrokeWidthScale : 1.0\n\t);\n}\n\nvec4 toColorStroke3456( in float shift, in float scale ) {\n\tfloat x = aColorFill.x + shift;\n\tfloat y = scale * aColorFill.y;\n\tfloat z = scale * aColorFill.z;\n\tfloat w = aColorFill.w;\n\treturn vec4( x, y, z, w );\n}\n\nfloat toStrokeWidthScale( in float scale ) {\n\treturn (\n\t\tscale == 3.0 || scale == 7.0 ?\n\t\tshapeScale : (\n\t\t\tscale == 1.0 || scale == 5.0 ?\n\t\t\tmin( 1.0, shapeScale ) : (\n\t\t\t\tscale == 2.0 || scale == 6.0 ?\n\t\t\t\tmax( 1.0, shapeScale ) : 1.0\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec2 toStep01(in vec2 size, in vec2 weight, in vec2 strokeWidth) {\n\treturn weight / max(vec2(0.00001), vec2(1.0) - strokeWidth / size);\n}\n\nvec4 toAntialias01b(in vec2 size, in vec2 strokeWidth) {\n\treturn antialiasWeight / max(vec4(0.00001), vec4(size - strokeWidth, size));\n}\n\nvoid main(void) {\n\tvec2 p012 = toTransformedPosition( aPosition );\n\n\tfloat type = aClipping.z;\n\tfloat strokeWidthScale = toStrokeWidthScale( aStep.y );\n\tfloat strokeWidth = strokeWidthScale * aStep.x;\n\n\t// type === 0 or 1\n\tvec2 size01 = aAntialias.xy;\n\tvec2 weight01 = abs(aAntialias.zw - sign(aAntialias.zw));\n\tvec2 strokeWidth01 = step(vec2(0.0), aAntialias.zw) * strokeWidth;\n\tvec2 step01 = toStep01( size01, weight01, strokeWidth01 );\n\tvec4 a01 = toAntialias01( toAntialias01b( size01, strokeWidth01 ) );\n\n\t// type === 2\n\tvec4 a2 = toAntialias2( aAntialias, strokeWidth );\n\n\t// type === 3, 4, 5 or 6\n\tfloat shift3456 = 0.0;\n\tvec2 p3456 = toPosition3456( type, aPosition, aAntialias.xy, aAntialias.zw, strokeWidth, shift3456 );\n\tvec2 step3456 = toStep3456( type );\n\tvec4 a3456 = toAntialias3456( strokeWidth );\n\tvec4 colorStroke3456 = toColorStroke3456( shift3456, toDotAndDashScale( aStep.y, strokeWidthScale ) );\n\n\t//\n\tgl_Position = vec4( ( 2.5 < type ? p3456 : p012 ), 0.0, 1.0 );\n\tvAntialias = ( 1.5 < type ? ( 2.5 < type ? a3456 : a2 ) : a01 );\n\tvClipping = aClipping;\n\tvStep = ( 2.5 < type ? step3456 : step01 );\n\tvColorFill = ( 2.5 < type ? aColorStroke : aColorFill );\n\tvColorStroke = ( 2.5 < type ? colorStroke3456 : aColorStroke );\n\tvUv = aUv;\n}","\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float pixelScale;\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tfloat type = vClipping.z;\n\tvec2 v0 = vStep;\n\tvec2 v1 = vClipping.xy;\n\tvec2 v2 = v0 * vAntialias.xy;\n\tvec2 v3 = v1 * vAntialias.zw;\n\tvec2 d01 = ( v0.x < v0.y ? vec2( v0.y, v2.y ) : vec2( v0.x, v2.x ) );\n\tvec2 d02 = ( v1.x < v1.y ? vec2( v1.y, v3.y ) : vec2( v1.x, v3.x ) );\n\tvec4 d0 = vec4( d01.x, d02.x, d01.y, d02.y );\n\tvec4 d1 = vec4( dot( v0, v0 ), dot( v1, v1 ), dot( v2, v2 ), dot( v3, v3 ) );\n\tvec4 d = ( type == 1.0 ? d1 : d0 );\n\tvec2 s = smoothstep( 1.0 - (d.zw - d.xy), vec2( 1.0 ), d.xy );\n\tvec4 color01 = texture * (vColorStroke * (s.x - s.y) + vColorFill * (1.0 - s.x));\n\n\tfloat l = vColorStroke.x;\n\tfloat lp0 = vColorStroke.y;\n\tfloat lp1 = vColorStroke.z;\n\tfloat lt = vColorStroke.w;\n\tfloat ld = 0.5 * pixelScale;\n\tfloat lm = mod( l, lp0 + lp1 );\n\tfloat ls0 = ( 0.0 < lp1 ? smoothstep( 0.0, ld, lm ) - smoothstep( lp0, lp0 + ld, lm ) : 1.0 );\n\tfloat ls1 = ( 0.0 <= lt ? smoothstep( 0.0, ld, l ) - smoothstep( lt - ld, lt, l ) : 1.0 );\n\tvec4 color3456 = color01 * ls0 * ls1;\n\n\tvec2 a0 = vAntialias.xy;\n\tvec2 a1 = vAntialias.zw;\n\tvec2 a2 = vec2( texture.a );\n\tvec2 a = smoothstep( a0 - a1, a0 + a1, a2 );\n\tvec4 color2 = a.x * vColorFill + ( a.y - a.x ) * vColorStroke;\n\tgl_FragColor = ( type == 2.0 ? color2 : (2.5 < type ? color3456 : color01) );\n}"),e.cu=i.SHADER,e.fu=new Le,e.lu=e.getBufferSizeMax(r),e}return _(i,n),i.prototype.getBufferSizeMax=function(t){var n=t.context,i=n.extensions;return 1<n.webGLVersion||i.uint32ElementIndex?1431655765:21845},i.prototype.updateAtlas=function(t,n,i,r,e){var u=t.imageSrc;if(null!=u){var s=n.get(u);if(null!=s)t.texture=s.texture;else{var h=t.image;if(null!=h){var o=new Ne(h,e);t.texture=o.texture,n.set(o.id,o)}else t.texture=r}}else t.texture=r;var a=t.text,c=a.value;0<c.length&&i.add(a.family,c)},i.prototype.updateAtlases=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];this.updateAtlas(h,n,i,r,e);for(var o=h.children,a=0,c=o.length;a<c;++a){var f=o[a];this.updateAtlas(f,n,i,r,e),this.updateAtlases(f.children,n,i,r,e)}}},i.prototype.updateFontAtlas=function(t,n,i,r){var e=t.text,u=i.get(e.family);if(null!=u){var s=n.get(u.id);null!=s?(e.atlas=u,e.texture=s.texture):(e.atlas=void 0,e.texture=r)}else e.atlas=void 0,e.texture=r},i.prototype.updateFontAtlases=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];this.updateFontAtlas(s,n,i,r);for(var h=s.children,o=0,a=h.length;o<a;++o){var c=h[o];this.updateFontAtlas(c,n,i,r),this.updateFontAtlases(c.children,n,i,r)}}},i.prototype.vu=function(n,i,r,e){var u=this.renderer,s=this.cu;if(null!=s&&(null!=i||0<r.length)){var h=u.resolution,o=n.getBuffers(),a=n.getAntialiasWeight(h);if(e){var c=n.getAtlas(h),f=n.getFontAtlases();c.begin(),f.begin();var l=c.getDefaultTexture(),v=c.getBaseTexture();this.updateAtlases(r,c,f,l,v),f.end(),f.update(c),this.updateFontAtlases(r,c,f,l),c.end(),c.repack(),this.updateBuffers(i,r,o,u,a)}s.uniforms.shapeScale=n.toShapeScale(),s.uniforms.pixelScale=n.toPixelScale(h),s.uniforms.antialiasWeight=a,s.uniforms.translationMatrix=n.worldTransform.toArray(!0),u.shader.bind(s,!1),u.state.setBlendMode(t.utils.correctBlendMode(t.BLEND_MODES.NORMAL,!0));var b=o.length;if(1<b)for(var d=0;d<b;++d)o[d].upload();for(d=0;d<b;++d)o[d].render(s)}},i.prototype.updateBuffers=function(t,n,i,r,e){var u=this.fu;u.reset(t,n);for(var s=0,h=0,o=5e3,a=this.lu;null!=u.get();){var c=null,f=!1;if(0<h?(c=new Ae(h,r),i.splice(s,0,c),f=!0):s<i.length?(c=i[s],f=!1):(c=new Ae(o,r),i.push(c),f=!1),c.update(u,e,f))h=0,s+=1;else{if(!((h=c.indexCountRequested)<=a))break;h=Math.ceil(h/o)*o,h=Math.min(h,a)}}if(s<i.length){for(var l=s,v=i.length;l<v;++l)i[l].destroy();i.length=s}},i.SHADER=null,i}(t.ObjectRenderer),xe=function(n){function i(){var i=n.call(this)||this;return i.bu=null,i.children=[],i.Xr=null,i.du=0,i.gu=-1,i.mu=null,i.wu=new je,i.pu=1,i.Ou=NaN,i.Du=1,i.Eu=NaN,i.Mu=new t.Point,i.Su=[],i}return _(i,n),i.prototype.calculateBounds=function(){this._bounds.clear()},i.prototype.onChildTransformChange=function(){},i.prototype.toDirty=function(){return this.du+=1},i.prototype.isDirty=function(){return this.gu<this.du},i.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var n=this.du,i=this.gu;this.gu=n;var r=i<n,e=this.bu;null==e&&(e=this.bu=new ye(t)),t.batch.setObjectRenderer(e);var u=this.mask,s=this.Xr,h=this.children;u?(t.mask.push(this,u),e.vu(this,s,h,r),t.mask.pop(this)):e.vu(this,s,h,r)}},i.prototype.containsPoint=function(t){return!1},i.prototype.getFontAtlases=function(){return this.wu},i.prototype.getAtlas=function(t){var n=this.mu;return null==n&&(n=new we(t),this.mu=n),n},i.prototype.getBuffers=function(){return this.Su},i.prototype.toShapeScale=function(){this.updateTransform();var t=this.transform,n=t._worldID;if(n!==this.Eu){this.Eu=n;var i=t.worldTransform,r=i.a,e=i.b;this.Du=1/Math.sqrt(r*r+e*e)}return this.Du},i.prototype.getShapeScale=function(){return this.Du},i.prototype.toPixelScale=function(t){var n=this.toShapeScale(),i=this.Eu;return this.Ou!==i&&(this.Ou=i,this.pu=1/t*n),this.pu},i.prototype.getPixelScale=function(){return this.pu},i.prototype.getAntialiasWeight=function(t){return 1.25/t},i.prototype.hitTest=function(t,n){for(var i=this.Mu,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible){u.toLocal(t,void 0,i);var s=u.contains(i.x,i.y);if(null!=s&&(null==n||n(s)))return s}}return null},i.prototype.hitTestBBox=function(t,n){for(var i=this.Mu,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible&&(u.toLocal(t,void 0,i),u.containsBBox(i.x,i.y)&&(null==n||n(u))))return u}return null},i.prototype.destroy=function(){var t=this.Su;if(null!=t)for(var i=0,r=t.length;i<r;++i)t[i].destroy();this.Su.length=0;var e=this.children;for(i=e.length-1;0<=i;--i)e[i].destroy();e.length=0,n.prototype.destroy.call(this)},i}(t.DisplayObject),Be=function(t){function n(n,i,e,u){void 0===u&&(u=r.EMBEDDED_LAYER);var s=t.call(this,i,e,u)||this;return s.Gr=n,s}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),n.prototype.newGroupFill=function(){return new $(this,!1,16777215,1)},n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.newGroupSize=function(t,n){var i=q.SIZE_X,r=q.SIZE_Y;return new kr(this,i,r,i,r)},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}t.onChildTransformChange(),t.toDirty();var u=this.size;if(u instanceof kr){var s=u.base;t.size.set(s.x,s.y).init().set(u.x,u.y)}else t.size.init();return t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Gr,this.Fr,this.Ur,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n}(xr),_e=function(){function t(){}return t.toLayers=function(t,n){var i=[],r=this.toLayer(t);if(r){var e=r.parent;if(e)for(var u=e.children,s=u.length,h=0,o=n.length;h<o;++h){var a=n[h];0<=a&&a<s&&i.push(u[a])}}return i},t.toLayer=function(t){for(var n=t.parent;null!=n;){if(n instanceof xe)return n;if(n instanceof Be)return n;n=n.parent}return null},t.show=function(t){return!t.visible&&(t.visible=!0,!0)},t.showAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible||(e.visible=!0,n=!0)}return n},t.hide=function(t){return!!t.visible&&(t.visible=!1,!0)},t.hideAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible&&(e.visible=!1,n=!0)}return n},t.bringToFront=function(t){var n=t.parent;return!!n&&this.doBringToFront(t,n.children,0)},t.bringAllToFront=function(t){var n=t.length;if(0<n){var i=t[0].parent;if(i){for(var r=!1,e=i.children,u=0;u<n;++u){var s=t[n-1-u];this.doBringToFront(s,e,u)&&(r=!0)}return r}}return!1},t.doBringToFront=function(t,n,i){for(var r=n.length-1-i,e=r;0<=e;--e){var u=n[e];if(u===t){if(e!==r){for(var s=e+1;s<=r;++s)n[s-1]=n[s];return n[r]=u,!0}return!1}}return!1},t}(),Pe={NONE:0,DRAG:1,PINCH:2,ALL:3},Fe=t.interaction.InteractionEvent,Ue=function(n){function i(t){var i=n.call(this,t,cn.NONE)||this;return i.Tu=new Map,i.ju=t.operationType,i.Nu=t.scaleMin,i.Iu=t.scaleMax,i}return _(i,n),i.prototype.initialize=function(t,i){if(n.prototype.initialize.call(this,t,i),null==this.Tu.get(t)){var r=_e.toLayer(t);null!=r&&this.Tu.set(t,r)}},i.prototype.onDown=function(t,i,r){if(n.prototype.onDown.call(this,t,i,r),r instanceof Fe){var e=this.Tu.get(t),u=r.data.originalEvent.timeStamp;e&&this.condition(t,u,ln)&&this.getGestureUtil().onDown(e,r)}},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new mr({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.ju,c=!1,f=1;if(a&Pe.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Iu,Math.max(this.Nu,v*u));f=b/v,l.set(b,b),c=!0}if(a&Pe.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&st.update(t)}},i.prototype.toSize=function(t,n){return"size"in t?n.copyFrom(t.size):n.set(t.width,t.height),n},i}(dn),Ge=t.interaction.InteractionEvent,He=function(n){function i(t){var i=n.call(this,t,cn.NONE)||this;return i.ju=t.operationType,i.Nu=t.scaleMin,i.Iu=t.scaleMax,i}return _(i,n),i.prototype.onDown=function(t,i,r){n.prototype.onDown.call(this,t,i,r),r instanceof Ge&&this.condition(t,r.data.originalEvent.timeStamp,ln)&&this.getGestureUtil().onDown(t,r)},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new mr({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.ju,c=!1,f=1;if(a&Pe.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Iu,Math.max(this.Nu,v*u));f=b/v,l.set(b,b),c=!0}if(a&Pe.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&st.update(t)}},i}(dn),ze={SHAPE:0,LAYER:1},Ve={INPUT_TEXT:0,INPUT_INTEGER:1,INPUT_REAL:2,EMIT_EVENT:3,WRITE_BOTH:4,WRITE_LOCAL:5,WRITE_REMOTE:6,HTML_ELEMENT:7,HTML_ELEMENT_WITHOUT_POINTER_EVENTS:8,SHOW_HIDE_LAYER:9,GESTURE_LAYER:10,GESTURE:11,EXECUTE:12},We=function(t){function n(n,i,r,e,u){void 0===n&&(n=""),void 0===e&&(e=.05),void 0===u&&(u=20);var s=t.call(this,jn.GESTURE,n,i)||this;return s.operationType=r,s.scaleMin=e,s.scaleMax=u,s}return _(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case ze.SHAPE:return new He(this);case ze.LAYER:return new Ue(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.operationType,",").concat(this.scaleMin,",").concat(this.scaleMax,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),this.toSubType(t),t[3],t[4],t[5])},n.toSubType=function(t){if(t[0]!==jn.MISC)return t[2];switch(t[2]){case Ve.GESTURE:return ze.SHAPE;case Ve.GESTURE_LAYER:return ze.LAYER}},n}(Tn),Xe={INVISIBLE:"INVISIBLE",INTERACTIVE:"INTERACTIVE",DRAGGABLE:"DRAGGABLE",PINCHABLE:"PINCHABLE"},Ke=function(t,n,i,r,e){var u,s,h,o=function(t,n){if(Ot(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""}(t[0],n),a=e?e(o,n):new Be(o,n.mode,n.depth),c=t[1];null==c||2&c||(a.visible=!1,a.state.add(Xe.INVISIBLE));var f=-.5*i+(t[2]||0),l=-.5*r+(t[3]||0);a.transform.position.set(f,l);var v=null!==(u=t[4])&&void 0!==u?u:i,b=null!==(s=t[5])&&void 0!==s?s:r;a.size.set(v,b),a.size.init();var d=t[6];if(null!=d&&a.fill.deserialize(d,n),n.mode===Tr.VIEWER){var g=null!==(h=t[7])&&void 0!==h?h:1,m=1&g,w=2&g,p=4&g;if(w||p){var O=(w?Pe.DRAG:Pe.NONE)|(p?Pe.PINCH:Pe.NONE);a.action.add(new We("",ze.LAYER,O))}(m||w||p)&&(a.interactive=!0)}return a},Ye=function(){function t(t,n){this.children=[],this.kt=t,this.pn=n}return t.prototype.hasConnectors=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(r instanceof ve)return!0;var e=r.children;if(0<e.length&&this.hasConnectors(e))return!0}return!1},t.prototype.newHasConnectors=function(){for(var t=new Map,n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];t.set(e,this.hasConnectors(e.children))}return t},t.prototype.copyTo=function(t){for(var n,i=null!==(n=this.Cu)&&void 0!==n?n:this.Cu=this.newHasConnectors(),r=this.children,e=t.children,u=0,s=r.length;u<s;++u){var h=r[u],o=h.clone();o.parent=t,e.push(o),i.get(h)&&be.move(h,o)}t.onChildTransformChange(),t.toDirty(),t.onAttach()},t.prototype.deserialize=function(t,n){var i=t.length;if(0<i)for(var r=this.kt,e=this.pn,u=0;u<i;++u)this.children.push(Ke(t[u],n,r,e))},t}(),Je=function(){function t(){}return t.toSimple=function(t){return{version:t.version,id:t.id,name:t.name,thumbnail:t.thumbnail,data:JSON.stringify({width:t.width,height:t.height,background:t.background,tile:t.tile,resources:t.resources,data:t.data||t.tags,pieces:t.pieces,layers:t.layers,items:t.items,snap:t.snap})}},t.toSerialized=function(t){if(!("items"in t)){var n=JSON.parse(t.data),i={version:t.version,id:t.id,name:t.name,width:n.width,height:n.height,background:n.background,tile:n.tile,resources:n.resources,data:n.data||n.tags,pieces:n.pieces,layers:n.layers,items:n.items,snap:n.snap,thumbnail:t.thumbnail};if(null==i.data){var r=t.tags;null!=r&&(i.data=JSON.parse(r))}if(null==i.pieces){var e=t.pieces;null!=e&&(i.pieces=JSON.parse(e))}return i}return t},t.newLayer=function(t,n,i){n.deserialize(t.layers,i);var r=t.items,e=Fr(r,i);return null!=e?e.then((function(t){for(var i=n.children,e=0,u=t.length;e<u;++e){var s=r[e],h=t[e];null!=(o=i[s[16]])&&(h.parent=o,h.uploaded=void 0,o.children.push(h))}for(e=0,u=i.length;e<u;++e){var o;(o=i[e]).onChildTransformChange(),o.toDirty();for(var a=o.children,c=0,f=a.length;c<f;++c)a[c].onAttach()}return t})):Promise.resolve([])},t.toPieceData=function(t,n,i){var r=new Map,e=new Map,u=function(){return r};return this.Au(t,n,r,e,i,0).then(u,u)},t.Au=function(t,n,i,r,e,u){var s=this,h=[];if(n&&0<n.length&&t)for(var o=function(o,a){var c=n[o],f=r.get(c);if(null!=f)h.push(f);else{var l=t.piece.getByName(c).then((function(n){return s.Ru(t,c,n,e,u+1,i,r)}),(function(){return null}));r.set(c,l),h.push(l)}},a=0,c=n.length;a<c;++a)o(a);return Promise.all(h)},t.Ru=function(t,n,i,r,e,u,s){var h=this,o=this.toSerialized(i),a=o.width,c=o.height,f=new Ye(a,c);u.set(n,new Gr(n,a,c,f));var l=o.pieces;return this.Au(t,l,u,s,r,e).then((function(){return h.newLayer(o,f,new Sr(o,l,u,r,e))}))},t}(),Ze={},qe=function(){function t(){}return t.isContainer=function(t){return t instanceof Dr},t.isEmbedded=function(t){return t instanceof Br},t.toContainer=function(t){for(var n=t;null!=n;){if(this.isContainer(n))return n;n=n.parent}return null},t.open=function(t,n,i,r){var e=Ze[n];if(null!=e)e(i,r,t);else switch(n){case Er.DIAGRAM:var u=this.toContainer(t);if(u){var s=u.controller;s&&s.getByName(i).then((function(t){u.set(Je.toSerialized(t))}))}break;case Er.PAGE:r?window.open(i):window.location.href=i}},t.writeLocal=function(t,n,i,r,e){var u;void 0===e&&(e=Pt.FOUND);for(var s=t;null!=s;){if(this.isContainer(s))return(s.data.private.set(n,i,r,e)||s.data.protected.set(n,i,r,e)||!!s.data.set(n,i,r,e))&&(st.update(s),!0);if(this.isEmbedded(s)&&(null===(u=s.data.getPrivate())||void 0===u?void 0:u.set(n,i,r,e)))return st.update(s),!0;s=s.parent}return!1},t.writeRemote=function(t,n,i){var r=this.toContainer(t);return!!r&&r.data.remote.set(n,i)},t.emit=function(n,i,r,e){var u=t.toContainer(n);void 0===e?(n.emit(i,n),u&&u.shape.emit(i,n)):(n.emit(i,r,e,n),u&&u.shape.emit(i,r,e,n))},t}(),Qe=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.name=vn.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.name(t,i,ln);null!=r&&qe.emit(t,r)}},n}(dn),$e=function(t){function n(n,i){var r=t.call(this,jn.EMIT_EVENT,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new Qe(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("[".concat(this.type,",").concat(n,",").concat(i,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),Nn.toResource(2,t,i.resources))},n}(Sn),tu=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofStringOrNull(n.target),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.target(t,i,ln);null!=r&&qe.emit(t,r)}},n}(dn),nu={NO_POINTER_EVENTS:"NO_POINTER_EVENTS"},iu=function(){function n(t){var n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg");i.setAttribute("style","position: absolute;"),i.setAttribute("width","0px"),i.setAttribute("height","0px");var r=document.createElementNS(n,"defs"),e=document.createElementNS(n,"clipPath"),u="clipper_ex_".concat(Math.random().toString(32).substring(2));e.setAttribute("id",u),e.setAttribute("clipPathUnits","objectBoundingBox");var s=document.createElementNS(n,"path");this.ku=s,this.Lu="",s.setAttribute("clip-rule","evenodd"),e.appendChild(s),r.appendChild(e),i.appendChild(r),this.R=u,t.appendChild(i)}return Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.update=function(t,n,i){var r=this.toD(t,n,i);this.Lu!=r&&(this.ku.setAttribute("d",r),this.Lu=r)},n.prototype.toD=function(i,r,e){var u,s;if(null==i)return"";var h=i.width,o=i.height,a=1e-4;if(h<a||o<a)return"";if(e.size<=0)return"M0,0 h1 v1 h-1z";var c=null!==(u=n.WORK_MATRIX)&&void 0!==u?u:n.WORK_MATRIX=new t.Matrix;null!=r?(c.copyFrom(r),c.invert()):c.identity(),c.translate(-i.x,-i.y),c.scale(1/h,1/o);for(var f=-1,l=2,v=-1,b=2,d="",g=c.a,m=c.b,w=c.c,p=c.d,O=c.tx,D=c.ty,E=null!==(s=n.WORK_RECTS)&&void 0!==s?s:n.WORK_RECTS=[],M=this.toRects(e,E),S=0;S<M;S+=4){var T=E[S+0],j=E[S+1],N=E[S+2],I=E[S+3],C=g*T+w*j+O,A=m*T+p*j+D,R=g*N+w*j+O,k=m*N+p*j+D,L=g*N+w*I+O,y=m*N+p*I+D,x=g*T+w*I+O,B=m*T+p*I+D;f=Math.min(f,C,R,L,x),l=Math.max(l,C,R,L,x),v=Math.min(v,A,k,y,B),b=Math.max(b,A,k,y,B);var _=C.toFixed(5),P=A.toFixed(5),F=R.toFixed(5),U=k.toFixed(5),G=L.toFixed(5),H=y.toFixed(5),z=x.toFixed(5),V=B.toFixed(5);d+=" M".concat(_,",").concat(P," L").concat(F,",").concat(U," L").concat(G,",").concat(H," L").concat(z,",").concat(V,"Z")}return"M".concat(f,",").concat(v," L").concat(l,",").concat(v," L").concat(l,",").concat(b," L").concat(f,",").concat(b,"Z")+d},n.prototype.toRects=function(t,n){for(var i=t.data,r=t.size<<2,e=0;e<r;e+=4){var u=i[e+0],s=i[e+1],h=i[e+2],o=i[e+3];u<h?(n[e+0]=u,n[e+2]=h):(n[e+0]=h,n[e+2]=u),s<o?(n[e+1]=s,n[e+3]=o):(n[e+1]=o,n[e+3]=s)}for(e=4;e<r;e+=4){u=n[e+0],s=n[e+1],h=n[e+2],o=n[e+3];for(var a=0;a<e;a+=4){var c=n[a+0],f=n[a+1],l=n[a+2],v=n[a+3],b=0,d=0;if(u<=c)if(h<=l){if(h<=c)continue;b=2,d=1}else d=3;else if(h<=l)b=3;else{if(l<=u)continue;b=1,d=2}var g,m,w=0,p=0;if(s<=f)if(o<=v){if(o<=f)continue;w=2,p=1}else p=3;else if(o<=v)w=3;else{if(v<=s)continue;w=1,p=2}if(4==(g=0===b||0===w?0:1===b||2===b?3===w?2:1:3===w?4:2)){e+4<r&&(n[e+0]=n[r+0],n[e+1]=n[r+1],n[e+2]=n[r+2],n[e+3]=n[r+3]),e-=4,r-=4;break}if(4!=(m=0===d||0===p?0:1===d||2===d?3===p?2:1:3===p?4:2))if(0===g)if(0===m){for(O=r-4;a<O;O-=4)n[O+4]=n[O+0],n[O+5]=n[O+1],n[O+6]=n[O+2],n[O+7]=n[O+3];0===d?(n[a+3]=s,n[a+4]=c,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=h,n[a+5]=f,n[a+6]=l,n[a+7]=v),e+=4,r+=4,a+=4}else 2===m&&(1===d?n[a+0]=h:2===d?n[a+2]=u:1===p?n[a+1]=o:2===p&&(n[a+3]=s));else if(1===g){for(O=r-4;a<O;O-=4)n[O+4]=n[O+0],n[O+5]=n[O+1],n[O+6]=n[O+2],n[O+7]=n[O+3];1===d?1===p?(n[a+0]=h,n[a+4]=c,n[a+5]=o,n[a+6]=h,n[a+7]=v):(n[a+0]=h,n[a+4]=c,n[a+5]=f,n[a+6]=h,n[a+7]=s):1===p?(n[a+2]=u,n[a+4]=u,n[a+5]=o,n[a+6]=l,n[a+7]=v):(n[a+2]=u,n[a+4]=u,n[a+5]=f,n[a+6]=l,n[a+7]=s),e+=4,r+=4,a+=4}else 2===g&&(1===b?(n[e+0]=l,u=l):2===b?(n[e+2]=c,h=c):1===w?(n[e+1]=v,s=v):2===w&&(n[e+3]=f,o=f));else{for(var O=a+4;O<r;O+=4)n[O-4]=n[O+0],n[O-3]=n[O+1],n[O-2]=n[O+2],n[O-1]=n[O+3];e-=4,r-=4,a-=4}}}return r},n}(),ru=function(){function t(){this.Xt=[],this.j=0,this.hu=0,this.En=!0}return Object.defineProperty(t.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),t.prototype.isDirty=function(){return this.En},t.prototype.toClean=function(){this.En=!1},t.prototype.begin=function(){return this.hu=0,this},t.prototype.end=function(){var t=this.hu;this.j=t;var n=this.Xt,i=t<<2;return n.length!==i&&(n.length=i,this.En=!0),this},t.prototype.add=function(t,n,i,r){var e=this.hu<<2;this.hu+=1;var u=this.Xt;return e<u.length?u[e+0]===t&&u[e+1]===n&&u[e+2]===i&&u[e+3]===r||(u[e+0]=t,u[e+1]=n,u[e+2]=i,u[e+3]=r,this.En=!0):(u.push(t,n,i,r),this.En=!0),this},t}(),eu={CLICKED:0,DOUBLE_CLICKED:1,FOCUSED:2,ALWAYS:3},uu=function(){function n(t,n,i,r){var e=this;this.ei=t,this.yu=n;var u=this.toData(i,r);this.Xt=u,this.xu=!1,this.Bu=function(t){e.onElementFocus(t)},this._u=function(t){e.onBeforeFocus(t)},this.Pu=function(t){e.onAfterFocus(t)},this.Fu=!1,this.Uu=!1,this.Gu=function(){e.doSelect()},this.Hu=this.Xt.when===eu.ALWAYS,this.zu=function(){e.updateElement(e.Vu)}}return n.prototype.toData=function(t,n){var i,r;return{element:this.toElementData(t,null==n?void 0:n.element),clipper:this.toClipperData(t,null==n?void 0:n.clipper),before:this.toBeforeData(t,null==n?void 0:n.before),after:this.toAfterData(t,null==n?void 0:n.after),when:Ai(null!==(i=null==n?void 0:n.when)&&void 0!==i?i:t.getWhen(),eu),select:null!==(r=null==n?void 0:n.select)&&void 0!==r?r:t.getSelect()}},n.prototype.toElementData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getElementCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newElementStyler(t)}},n.prototype.newElementStyler=function(t){return function(n,i,r,e,u,s,h){return t.setElementStyle(n,i,r,e,u,s,h)}},n.prototype.toClipperData=function(t,n){var i,r,e;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getClipperCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newClipperStyler(t),extended:null!==(e=null==n?void 0:n.extended)&&void 0!==e?e:t.isClipperExEnabled()}},n.prototype.newClipperStyler=function(t){return function(n,i,r,e,u,s,h){return t.setClipperStyle(n,i,r,e,u,s,h)}},n.prototype.toBeforeData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getBeforeCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newBeforeStyler(t)}},n.prototype.newBeforeStyler=function(t){return function(n){t.setBeforeStyle(n)}},n.prototype.toAfterData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getAfterCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newAfterStyler(t)}},n.prototype.newAfterStyler=function(t){return function(n){t.setAfterStyle(n)}},Object.defineProperty(n.prototype,"element",{get:function(){var t;return null!==(t=this.Wu)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"when",{get:function(){return this.Xt.when},enumerable:!1,configurable:!0}),n.prototype.onDowning=function(t){switch(this.Uu=this.Fu,this.when){case eu.CLICKED:this.start();break;case eu.FOCUSED:this.ei.state.isFocused&&this.start()}},n.prototype.onDown=function(t){!this.Uu&&this.Fu&&("data"in t?t.data.originalEvent.preventDefault():t.preventDefault())},n.prototype.onDblClick=function(t,n){switch(this.when){case eu.DOUBLE_CLICKED:this.start()}},n.prototype.onFocus=function(){var t;switch(this.when){case eu.FOCUSED:this.start();break;default:null===(t=this.Wu)||void 0===t||t.focus()}},n.prototype.onBlur=function(){var t;switch(this.when){case eu.CLICKED:case eu.DOUBLE_CLICKED:case eu.FOCUSED:this.onEndByBlur(),this.cancel();break;default:null===(t=this.Wu)||void 0===t||t.blur()}},n.prototype.isStartable=function(){switch(this.when){case eu.CLICKED:case eu.DOUBLE_CLICKED:case eu.FOCUSED:return this.ei.state.isActionable;default:return!0}},n.prototype.start=function(){!this.Fu&&this.isStartable()&&(this.Fu=!0,this.ei.worldVisible?this.doStart():this.Hu=!0,st.update(this.ei))},n.prototype.isShown=function(){return this.xu},n.prototype.onRender=function(t){(this.Hu||!this.xu&&this.when===eu.ALWAYS)&&(this.Hu=!1,this.doStart(t)),this.Fu&&(this.Fu=!1)},n.prototype.getElementRect=function(n){var i=this.wn||new t.Point(0,0);this.wn=i;var r=this.Xu||new t.Rectangle;return this.Xu=r,this.yu.getElementRect(n,i,r)},n.prototype.getElementMatrix=function(){return this.yu.getElementMatrix()},n.prototype.getClipperRect=function(n){var i=this.wn||new t.Point(0,0);this.wn=i;var r=this.Ku||new t.Rectangle;return this.Ku=r,this.yu.getClipperRect(n,i,r)},n.prototype.fillClipperExRects=function(t,n){var i=this.yu;return i.getClipperExRects&&i.getClipperExRects(n),n.isDirty()},n.prototype.doStart=function(t){var n,i;if(!this.xu){this.xu=!0;var r=this.Vu;null!=r&&(this.Vu=void 0,r.off("postrender",this.zu));var e=this.ei;null==t&&(t=null===(n=st.getLayer(e))||void 0===n?void 0:n.renderer),t&&(this.Vu=t,t.on("postrender",this.zu)),this.onStart();var u=this.getClipper();if(u){var s=this.getBefore(u),h=this.getElement(u),o=this.getAfter(u),a=this.getClipperEx(u);if(h){var c=null!==(i=null==t?void 0:t.resolution)&&void 0!==i?i:st.getResolution(e),f=this.getElementRect(c),l=this.getElementMatrix(),v=this.toClipperRectAdjusted(f,l,this.getClipperRect(c)),b=e.state,d=this.yu.getPadding(),g=this.Xt;if(g.clipper.styler(u,b,d,f,l,v,a),g.element.styler(h,b,d,f,l,v,a),s&&g.before.styler(s),o&&g.after.styler(o),this.onElementAttached(h,s,o),a){var m=this.getClipperExRects();m&&this.fillClipperExRects(c,m)&&(a.update(f,l,m),m.toClean())}u.style.display="",b.isFocused&&this.toElementFocused(h),u.scrollTop=0,u.scrollLeft=0,this.Xt.select&&setTimeout(this.Gu,0)}}}},n.prototype.toElementFocused=function(t){t.focus({preventScroll:!0})},n.prototype.onStart=function(){this.yu.onStart()},n.prototype.doSelect=function(){var t=this.Wu;t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select()},n.prototype.cancel=function(){var t;if(this.xu){this.xu=!1;var n=this.Vu;null!=n&&(this.Vu=void 0,n.off("postrender",this.zu)),this.onCancel();var i=this.ei,r=st.getLayer(i);if(r){var e=r.view;switch(this.when){case eu.CLICKED:case eu.DOUBLE_CLICKED:case eu.FOCUSED:document.activeElement===this.Wu&&e.focus()}var u=i.state,s=r.renderer.plugins.interaction;this.yu.containsPoint(s.mouse.global)&&!u.isHovered&&(u.isHovered=!0,e.style.cursor=null!==(t=i.cursor)&&void 0!==t?t:""),r.update()}var h=this.Wu;null!=h&&this.onElementDetached(h,this.Yu,this.Ju);var o=this.Zu;null!=o&&(o.style.display="none")}},n.prototype.onCancel=function(){this.yu.onCancel()},n.prototype.onElementAttached=function(t,n,i){null==n||n.addEventListener("focus",this._u),null==i||i.addEventListener("focus",this.Pu),t.addEventListener("focus",this.Bu,!0)},n.prototype.onElementDetached=function(t,n,i){null==n||n.removeEventListener("focus",this._u),null==i||i.removeEventListener("focus",this.Pu),t.removeEventListener("focus",this.Bu,!0)},n.prototype.getClipper=function(){var t=this.Zu;if(null==t){var n=st.getLayer(this.ei);t=n?this.Xt.clipper.creator(n.getElementContainer()):null,this.Zu=t}return t},n.prototype.getClipperEx=function(t){var n=this.qu;return void 0===n&&(n=null!=this.getClipperExRects()?new iu(t):null,this.qu=n),n},n.prototype.getClipperExRects=function(){var t=this.Qu;return void 0===t&&(t=this.Xt.clipper.extended?new ru:null,this.Qu=t),t},n.prototype.getElement=function(t){var n=this.Wu;return null==n&&(n=this.Xt.element.creator(t),this.Wu=n),n},n.prototype.getBefore=function(t){var n=this.Yu;return null==n&&(n=this.Xt.before.creator(t),this.Yu=n),n},n.prototype.getAfter=function(t){var n=this.Ju;return null==n&&(n=this.Xt.after.creator(t),this.Ju=n),n},n.prototype.onBeforeFocus=function(t){var n=this.ei,i=st.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!1);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onAfterFocus=function(t){var n=this.ei,i=st.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!0);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onElementFocus=function(t){if(this.when===eu.ALWAYS){var n=this.ei;n.state.isFocused||n.focus()}},n.prototype.onEndByBlur=function(){this.onEnd()},n.prototype.onEnd=function(){this.yu.onEnd()},n.prototype.end=function(){this.onEnd(),this.cancel()},n.prototype.select=function(){return this.xu&&this.Xt.select&&this.doSelect(),this},n.prototype.toClipperRectAdjusted=function(t,n,i){if(i&&t&&null==n){var r=t.x,e=t.y,u=r+t.width,s=e+t.height,h=i.x,o=i.y,a=h+i.width,c=o+i.height,f=Math.min(Math.max(h,r),a),l=Math.min(Math.max(h,u),a),v=Math.min(Math.max(o,e),c),b=Math.min(Math.max(o,s),c);i.x=f,i.y=v,i.width=l-f,i.height=b-v}return i},n.prototype.updateElement=function(t){if(this.xu){var n=this.ei;if(n.worldVisible){var i=this.Wu,r=this.Zu,e=this.qu;if(i&&r){var u=t.resolution,s=this.getElementRect(u),h=this.getElementMatrix(),o=this.toClipperRectAdjusted(s,h,this.getClipperRect(u)),a=n.state,c=this.yu.getPadding(),f=this.Xt;if(f.clipper.styler(r,a,c,s,h,o,e),f.element.styler(i,a,c,s,h,o,e),e){var l=this.getClipperExRects();l&&this.fillClipperExRects(u,l)&&(e.update(s,h,l),l.toClean())}}}else switch(this.when){case eu.ALWAYS:(r=this.Zu)&&(r.style.display="none");break;default:this.cancel()}}},n.getClipperRect=function(t,n,i,r,e){for(var u=!0,s=0,h=0,o=0,a=0,c=t;c instanceof hr;){c.getClippingRect(n,e),r.set(e.x,e.y),c.toGlobal(r,r,!1);var f=(r.x*i|0)/i,l=(r.y*i|0)/i;r.set(e.x+e.width,e.y+e.height),c.toGlobal(r,r,!0);var v=r.x,b=r.y,d=Math.min(f,v),g=Math.min(l,b),m=Math.max(f,v),w=Math.max(l,b);u?(u=!1,s=d,h=g,o=m,a=w):(s=Math.min(Math.max(s,d),m),h=Math.min(Math.max(h,g),w),o=Math.min(Math.max(o,d),m),a=Math.min(Math.max(a,g),w)),c=c.parent}return u?null:(e.x=s,e.y=h,e.width=o-s,e.height=a-h,e)},n}(),su=function(){function t(t){var n=t.transform,i=n.position;this.x=i.x,this.y=i.y;var r=t.size;this.sizeX=r.x,this.sizeY=r.y,this.rotation=n.rotation,this.actions=[],this.fill=t.fill.toObject(),this.stroke=t.stroke.toObject(),this.text=t.text.toObject(),this.cursor=t.cursor,this.reset=cn.NONE,this.written=cn.NONE,this.effect=NaN,this.isStateChanged=!1,this.interactive=!1}return t.prototype.initialize=function(t){t.disallowUploadedUpdate();for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].initialize(t,this);t.allowUploadedUpdate()},t.prototype.isActionable=function(){return 0<this.actions.length},t.prototype.onResize=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onResize(t,this)},t.prototype.onClick=function(t,n){var i=t.state;i.isActionable&&(i.isClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onClick(t,this,n)},t.prototype.onDblClick=function(t,n,i){var r=t.state;r.isActionable&&(r.isDblClicked=!0);for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onDblClick(t,this,n,i);return!1},t.prototype.onOver=function(t,n){var i=t.state;if(!i.isHovered){i.isHovered=!0;for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onOver(t,this,n)}},t.prototype.onOut=function(t,n){if(t.state.isHovered){t.state.isHovered=!1;for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onOut(t,this,n)}},t.prototype.onDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onDowning(t,this,n);var u=t.state;if(!u.isDown)if(u.isPressed)for(u.addAll(Mt.DOWN,ct.PRESSED),(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onDown(t,this,n),s.onPressed(t,this,n)}else{var h,o;for(u.isDown=!1,(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onDown(t,this,n)}},t.prototype.onUp=function(t,n){var i=t.state;if(!i.isUp)if(i.isPressed){i.set(Mt.UP,ct.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUp(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUp(t,this,n)}},t.prototype.onUpOutside=function(t,n){var i=t.state;if(i.isPressed){i.set(Mt.UP_OUTSIDE,ct.PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onUpOutside(t,this,n),u.onUnpressed(t,this,n)}}else{var s;for(i.isUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onUpOutside(t,this,n)}},t.prototype.onMove=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onMove(t,this,n)},t.prototype.onKeyDown=function(t,n){nr.isActivateKey(n)&&this.onDown(t,n);for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onKeyDown(t,this,n);return!1},t.prototype.onKeyUp=function(t,n){if(nr.isActivateKey(n)){var i=t.state;if(i.isPressed){var r=i.isUp;this.onUp(t,n),!r&&i.isUp&&this.onClick(t,n)}}for(var e=this.actions,u=0,s=e.length;u<s;++u)e[u].onKeyUp(t,this,n);return!1},t.prototype.onStateChange=function(t,n,i){this.isStateChanged=!0,st.update(t),n.isFocused?i.isFocused||this.onFocus(t):i.isFocused&&this.onBlur(t)},t.prototype.onFocus=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onFocus(t,this)},t.prototype.onBlur=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onBlur(t,this)},t.prototype.onRightClick=function(t,n){var i=t.state;i.isActionable&&(i.isRightClicked=!0);for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRightClick(t,this,n)},t.prototype.onRightDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onRightDowning(t,this,n);var u=t.state;if(!u.isRightDown)if(u.isRightPressed)for(u.addAll(Mt.RIGHT_DOWN,Mt.RIGHT_PRESSED),(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r){var s=i[r];s.onRightDown(t,this,n),s.onRightPressed(t,this,n)}else{var h,o;for(u.isRightDown=!1,(h=st.getLayer(t))&&(o=h.getFocusController()).focus(o.findParent(t)),r=0,e=i.length;r<e;++r)i[r].onRightDown(t,this,n)}},t.prototype.onRightUp=function(t,n){var i=t.state;if(!i.isRightUp)if(i.isRightPressed){i.set(Mt.RIGHT_UP,Mt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUp(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUp=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUp(t,this,n)}},t.prototype.onRightUpOutside=function(t,n){var i=t.state;if(i.isRightPressed){i.set(Mt.RIGHT_UP_OUTSIDE,Mt.RIGHT_PRESSED);for(var r=0,e=(s=this.actions).length;r<e;++r){var u=s[r];u.onRightUpOutside(t,this,n),u.onRightUnpressed(t,this,n)}}else{var s;for(i.isRightUpOutside=!0,r=0,e=(s=this.actions).length;r<e;++r)s[r].onRightUpOutside(t,this,n)}},t.prototype.update=function(n,i){var r=n.data,e=this.effect<=i;if(r.isChanged||this.isStateChanged||e){this.isStateChanged=!1,r.isChanged=!1,e&&(this.effect=NaN),n.disallowUploadedUpdate(),this.onUpdate(n,i),n.allowUploadedUpdate();var u=this.isStateChanged;n.state.removeAll(t.TRANSIENT_STATES),this.isStateChanged=u}},t.prototype.onRender=function(t,n,i){for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRender(t,this,n,i);this.update(t,n)},t.prototype.onUpdate=function(t,n){var i=this.actions;if(0<i.length){this.written=cn.NONE;for(var r=0,e=i.length;r<e;++r)i[r].execute(t,this,n);this.doReset(t)}},t.prototype.doReset=function(t){var n=~this.written&this.reset;if(n!==cn.NONE){if(n&cn.POSITION_X&&(t.transform.position.x=this.x),n&cn.POSITION_Y&&(t.transform.position.y=this.y),n&cn.VISIBILITY&&(t.visible=!0),n&cn.COLOR_FILL){var i=this.fill;t.fill.set(void 0,i.color,i.alpha)}if(n&cn.COLOR_STROKE){var r=this.stroke;t.stroke.set(void 0,r.color,r.alpha)}if(n&cn.COLOR_TEXT){var e=this.text;t.text.set(void 0,e.color,e.alpha)}if(n&cn.COLOR_TEXT_OUTLINE){var u=this.text.outline;t.text.outline.set(void 0,u.color,u.alpha)}n&cn.HEIGHT&&(t.size.y=this.sizeY),n&cn.WIDTH&&(t.size.x=this.sizeX),n&cn.ROTATION&&(t.transform.rotation=this.rotation),n&cn.TEXT&&(t.text.value=this.text.value),n&cn.CURSOR&&(t.cursor=this.cursor)}},t.TRANSIENT_STATES=[Mt.CLICKED,Mt.DBL_CLICKED,Mt.DOWN,Mt.UP,Mt.UP_OUTSIDE,Mt.RIGHT_CLICKED,Mt.RIGHT_DOWN,Mt.RIGHT_UP,Mt.RIGHT_UP_OUTSIDE,Mt.ACTIVATED,Mt.DEACTIVATED],t}(),hu=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Qt(this,n,i,r,e,u,s)},n}(Jt),ou=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_PIVOTED),t.call(this,n)||this}return _(n,t),n.prototype.toHitTestData=function(n,i){var r=t.prototype.toHitTestData.call(this,n,i);return r.x-=r.width,r.y-=r.height,r},n}(hu),au=function(t){function n(n){var i=t.call(this)||this;i.name=n,i.interactive=!1,i.reference=0;var r=i.newShape();return r.parent=i,i.Xr=r,i.interactives=[],i}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.Xr.size.x},set:function(t){this.Xr.size.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.Xr.size.y},set:function(t){this.Xr.size.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"background",{get:function(){return this.Xr.fill},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Xr.state},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){var t=new ou;return t.fill.set(!1,16777215,1),t.stroke.set(!1),t.state.add(Xe.INTERACTIVE),t},n.prototype.initialize=function(t){var n=this.interactives,i=this.Xr,r=i.state.is(Xe.INTERACTIVE),e=i.state.is(Xe.DRAGGABLE),u=i.state.is(Xe.PINCHABLE);if(e||u){var s=new su(i);i.runtime=s;var h=(e?Pe.DRAG:Pe.NONE)|(u?Pe.PINCH:Pe.NONE);s.actions.push(new We("",ze.LAYER,h).toRuntime()),t.push(i),s.initialize(i)}(r||e||u)&&(i.interactive=!0,n.push(i)),this.doInitialize(this.children,n)},n.prototype.doInitialize=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i],u=e.runtime;if(u)if(e.interactive||u.interactive)n.push(e);else{var s=e.cursor;null!=s&&0<s.length&&n.push(e)}var h=e.children;0<h.length&&this.doInitialize(h,n)}},n.prototype.update=function(t){this.doUpdate(this.children,t)},n.prototype.doUpdate=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];e.update(n);var u=e.children;0<u.length&&this.doUpdate(u,n)}},n.prototype.hitTestInteractives=function(t){for(var n=this.Mu,i=this.interactives,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible&&(e.toLocal(t,void 0,n),null!=e.contains(n.x,n.y)))return e}return null},n.prototype.addUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},n.prototype.updateUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},n.prototype.destroy=function(){if(!this._destroyed){for(var n=this.children,i=n.length-1;0<=i;--i)n[i].destroy();n.length=0,t.prototype.destroy.call(this)}},n.prototype.serialize=function(t,n,i){for(var r=this.children,e=0,u=r.length;e<u;++e){var s=r[e].serialize(n);s[16]=t,i.push(s)}var h=this.Xr,o=n.addResource(this.name||""),a=(this.visible?1:0)|(h.state.is(Xe.INVISIBLE)?0:2),c=this.position,f=h.size,l=h.fill.serialize(n),v=h.state.is(Xe.INTERACTIVE)?1:0,b=h.state.is(Xe.DRAGGABLE)?2:0,d=h.state.is(Xe.PINCHABLE)?4:0;return[o,a,c.x,c.y,f.x,f.y,l,v|b|d]},n.deserialize=function(t,i,r,e){var u,s,h,o=new n(this.deserializeName(t[0],i)),a=o.Xr,c=t[1];if(null!=c){var f=i.mode!==Tr.VIEWER;!f||1&c||(o.visible=!1),2&c||(a.state.add(Xe.INVISIBLE),f||(o.visible=!1))}var l=t[2],v=t[3];o.position.set(l,v);var b=null!==(u=t[4])&&void 0!==u?u:r,d=null!==(s=t[5])&&void 0!==s?s:e;a.size.set(b,d);var g=t[6];null!=g&&a.fill.deserialize(g,i);var m=null!==(h=t[7])&&void 0!==h?h:1;return a.state.set(Xe.INTERACTIVE,!!(1&m)),a.state.set(Xe.DRAGGABLE,!!(2&m)),a.state.set(Xe.PINCHABLE,!!(4&m)),o},n.deserializeName=function(t,n){if(Ot(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""},n}(xe),cu=!1,fu=function(){return cu},lu=function(n){function i(t){var i=n.call(this)||this;return i.condition=vn.ofString(t.condition),i.utils=new Map,i}return _(i,n),i.prototype.getUtil=function(t,n){var i=this.utils,r=i.get(t);return null==r&&(r=this.newUtil(t,n),i.set(t,r)),r},i.prototype.newUtil=function(t,n){return new uu(t,this.newOperation(t,n),Z.getInstance().get("DHtmlElement"),this.newUtilOptions(t,n))},i.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},i.prototype.newUtilOptions=function(t,n){return{element:{creator:this.newElementCreator(t,n)},when:this.toWhen(t,n),clipper:{extended:fu()}}},i.prototype.toWhen=function(t,n){var i=this.condition(t,Date.now(),ln);if(null!=i&&i in eu)return eu[i]},i.prototype.containsPoint=function(n,r,e){var u;if(n.visible){var s=null!==(u=i.WORK)&&void 0!==u?u:i.WORK=new t.Point;return n.toLocal(e,void 0,s),null!=n.contains(s.x,s.y)}return!1},i.prototype.getPadding=function(t,n){return null},i.prototype.getElementRect=function(t,n,i,r,e){var u=t.transform.pivot,s=t.size,h=s.x,o=s.y;return e.x=-.5*h+u.x,e.y=-.5*o+u.y,e.width=h,e.height=o,e},i.prototype.getElementMatrix=function(t,n){return t.updateTransform(),t.transform.worldTransform},i.prototype.getClipperToRect=function(t,n,i,r,e){var u=qe.toContainer(t);return uu.getClipperRect(u,t,i,r,e)},i.prototype.getClipperExRects=function(t,n){n.begin();var i=t.root.parent;if(i instanceof au){var r=i.parent;if(null!=r){var e=r.children,u=e.indexOf(i);if(0<=u)for(var s=u+1,h=e.length;s<h;++s){var o=e[s];if(o.visible){var a=o.width,c=o.height,f=o.transform.worldTransform,l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty;n.add(g,m,l*a+b*c+g,v*a+d*c+m)}}}}n.end()},i.prototype.onRender=function(t,n,i,r){this.getUtil(t,n).onRender(r)},i.prototype.onFocus=function(t,n){this.getUtil(t,n).onFocus()},i.prototype.onBlur=function(t,n){this.getUtil(t,n).onBlur()},i.prototype.onDowning=function(t,n,i){this.getUtil(t,n).onDowning(i)},i.prototype.onDown=function(t,n,i){this.getUtil(t,n).onDown(i)},i.prototype.onDblClick=function(t,n,i,r){this.getUtil(t,n).onDblClick(i,r)},i}(bn),vu=function(t){function n(n){var i=t.call(this,n)||this;return i.elementCreator=vn.ofElementOrNull(n.value),i.noPointerEvent=n.subtype===Ve.HTML_ELEMENT_WITHOUT_POINTER_EVENTS,i}return _(n,t),n.prototype.newUtil=function(n,i){return this.noPointerEvent&&n.state.add(nu.NO_POINTER_EVENTS),t.prototype.newUtil.call(this,n,i)},n.prototype.newElementCreator=function(t,n){var i=this.elementCreator;if(i)return function(n){return i(t,Date.now(),ln,n)}},n}(lu),bu=function(t){function n(n,i,r,e){var u,s,h,o,a,c,f=this;(f=t.call(this,n,i,r,e)||this).yu=i,f.$u=function(t){f.onInputKeyDown(t)},f.ts=function(){f.onInputChange()},f.ns=function(t){f.onInputInput(t)},f.rs=null!==(u=null==e?void 0:e.description)&&void 0!==u?u:"";var l=null==e?void 0:e.editing;return f.es=null!==(o=null!==(s=null==l?void 0:l.formatter)&&void 0!==s?s:null===(h=null==e?void 0:e.text)||void 0===h?void 0:h.formatter)&&void 0!==o?o:r.getEditingFormatter(),f.us=null!==(a=null==l?void 0:l.unformatter)&&void 0!==a?a:r.getEditingUnformatter(),f.ss=null!==(c=null==l?void 0:l.validator)&&void 0!==c?c:r.getEditingValidator(),f}return _(n,t),n.prototype.onEnd=function(){t.prototype.onEnd.call(this),this.onInputChange()},n.prototype.onElementAttached=function(n,i,r){n.value=this.fromValue(this.yu.getValue()),n.addEventListener("change",this.ts),n.addEventListener("input",this.ns),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){t.prototype.onElementDetached.call(this,n,i,r),n.removeEventListener("change",this.ts),n.removeEventListener("input",this.ns)},n.prototype.onInputKeyDown=function(t){nr.isOkKey(t)?(this.end(),this.yu.onEnter()):nr.isCancelKey(t)&&this.cancel()},n.prototype.toElementFocused=function(n){t.prototype.toElementFocused.call(this,n),n.scrollTop=0,n.scrollLeft=0},n.prototype.onInputChange=function(){if(this.isShown()){var t=this.element;if(null!=t){var n=this.yu,i=this.toValue(t.value),r=n.getValue();r!==i&&n.onValueChange(i,r)}}},n.prototype.toValue=function(t){return this.us(t,this)},n.prototype.fromValue=function(t){return void 0!==t?this.es(t,this):""},n.prototype.onInputInput=function(t){var n=t.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&this.yu.onValueInput(this.toValue(n.value))},n.prototype.validate=function(){var t=this.yu.getValue();if(void 0!==t){var n=this.ss(t,this);if(this.hs!==n){this.hs=n;var i=this.ei.state;i.isInvalid=null!=n,i.isHovered&&this.yu.applyTitle()}return n}return null},n.prototype.applyTitle=function(){var t=this.hs;if(Ot(t)){var n=st.getLayer(this.ei);return n&&(n.view.title=t),!0}return!1},n}(uu),du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.$u),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.$u),t.prototype.onElementDetached.call(this,n,i,r)},n}(bu),gu=function(t){function n(n,i,r,e){var u,s,h,o=this;return(o=t.call(this,n,i,r,e)||this).os=null!==(u=null==e?void 0:e.step)&&void 0!==u?u:r.getStep(),o.cs=null!==(s=null==e?void 0:e.min)&&void 0!==s?s:r.getMin(),o.fs=null!==(h=null==e?void 0:e.max)&&void 0!==h?h:r.getMax(),o}return _(n,t),Object.defineProperty(n.prototype,"step",{get:function(){return this.os},set:function(t){this.os!==t&&(this.os=t,this.onStepChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.cs},set:function(t){this.cs!==t&&(this.cs=t,this.onMinChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.fs},set:function(t){this.fs!==t&&(this.fs=t,this.onMaxChange())},enumerable:!1,configurable:!0}),n.prototype.toValue=function(n){var i=t.prototype.toValue.call(this,n);if(i==i){var r=this.cs;if(null!=r&&i<r)return r;var e=this.fs;return null!=e&&e<i?e:i}return 0},n.prototype.fromValue=function(t){return void 0!==t?this.es(t,this):"0"},n.prototype.onStepChange=function(){if(this.isShown()){var t=this.element;t&&this.updateStep(t)}},n.prototype.onMinChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMin(t)}},n.prototype.onMaxChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMax(t)}},n.prototype.updateStep=function(t){var n=this.step;t.step=null!=n?"".concat(n):"any"},n.prototype.updateMin=function(t){var n=this.min;null!=n?t.min="".concat(n):t.removeAttribute("min")},n.prototype.updateMax=function(t){var n=this.max;null!=n?t.max="".concat(n):t.removeAttribute("max")},n.prototype.onElementAttached=function(n,i,r){n.type="number",t.prototype.onElementAttached.call(this,n,i,r),this.updateStep(n),this.updateMin(n),this.updateMax(n)},n}(du),mu={EMIT_EVENT:0,WRITE_BOTH:1,WRITE_LOCAL:2,WRITE_REMOTE:3},wu=function(){function t(){}return t.execute=function(t,n,i,r,e){switch(n){case mu.EMIT_EVENT:t.emit(i,t,r),qe.emit(t,i,r,e);break;case mu.WRITE_LOCAL:qe.writeLocal(t,i,r,e);break;case mu.WRITE_REMOTE:qe.writeRemote(t,i,r);break;case mu.WRITE_BOTH:qe.writeLocal(t,i,r,e),qe.writeRemote(t,i,r)}},t}(),pu=function(t){function n(n){var i=t.call(this,n)||this;return i.target=vn.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i}return _(n,t),n.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getClipperExRects:function(n){i.getClipperExRects(t,n)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){t.text.enable=!1},onCancel:function(){t.text.enable=!0},onEnd:function(){},getValue:function(){return i.getUtil(t,n).toValue(t.text.value)},onValueInput:function(t){},onValueChange:function(r,e){i.onValueChange(t,n,r,e)},onEnter:function(){},applyTitle:function(){}}},n.prototype.newElementCreator=function(t,n){},n.prototype.getPadding=function(t,n){return t.text.padding},n.prototype.onValueChange=function(t,n,i,r){t.text.value=this.getUtil(t,n).fromValue(i);var e=Date.now(),u=this.target(t,e,ln);null!=u&&wu.execute(t,this.onInputAction,u,i,e)},n}(lu),Ou=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(pu),Du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Ou),Eu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new gu(t,this.newOperation(t,n),Z.getInstance().get("DInputInteger"),this.newUtilOptions(t,n))},n}(Du),Mu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new gu(t,this.newOperation(t,n),Z.getInstance().get("DInputReal"),this.newUtilOptions(t,n))},n}(Du),Su=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.type="text",t.prototype.onElementAttached.call(this,n,i,r)},n}(du),Tu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new Su(t,this.newOperation(t,n),Z.getInstance().get("DInputText"),this.newUtilOptions(t,n))},n}(Ou),ju=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofStringOrNull(n.target),i.value=vn.ofUnknown(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.target(t,i,ln);null!=r&&this.write(t,r,this.value(t,i,ln),i)}},n}(dn),Nu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){qe.writeLocal(t,n,i,r),qe.writeRemote(t,n,i)},n}(ju),Iu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){qe.writeLocal(t,n,i,r)},n}(ju),Cu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){qe.writeRemote(t,n,i)},n}(ju),Au=function(t){function n(n,i,r,e,u){var s=t.call(this,jn.MISC,i,n)||this;return s.target=r,s.onInputAction=e,s.value=u,s}return _(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case Ve.INPUT_TEXT:return new Tu(this);case Ve.INPUT_INTEGER:return new Eu(this);case Ve.INPUT_REAL:return new Mu(this);case Ve.EMIT_EVENT:return new tu(this);case Ve.WRITE_BOTH:return new Nu(this);case Ve.WRITE_LOCAL:return new Iu(this);case Ve.WRITE_REMOTE:return new Cu(this);case Ve.HTML_ELEMENT:case Ve.HTML_ELEMENT_WITHOUT_POINTER_EVENTS:return new vu(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.value);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,"]"))},n.deserialize=function(t,i){var r=i.resources,e=Nn.toResource(1,t,r),u=Nn.toResource(3,t,r),s=Nn.toResource(5,t,r);return new n(t[2],e,u,t[4],s)},n}(Tn),Ru=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofUnknown(n.target),i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,ln)&&this.target(t,i,ln)},n}(dn),ku=function(t){function n(n,i){var r=t.call(this,jn.MISC,n,Ve.EXECUTE)||this;return r.target=i,r}return _(n,t),n.prototype.toRuntime=function(){return new Ru(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=i.resources;return new n(Nn.toResource(1,t,r),Nn.toResource(3,t,r))},n}(Tn),Lu=function(t){function n(n,i){var r=t.call(this,n,cn.NONE)||this;return r.subtype=i,r.target=vn.ofStringOrNull(n.target),r.inNewWindow=n.inNewWindow,r}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.target(t,i,ln);null!=r&&qe.open(t,this.subtype,r,this.inNewWindow)}},n}(dn),yu={DIAGRAM_LEGACY:0,PAGE_LEGACY:1,PAGE_INPLACE_LEGACY:2,DIALOG_TEXT:3,DIALOG_INTEGER:4,DIALOG_REAL:5,DIALOG_BOOLEAN:6,DIALOG_DATE:7,DIALOG_TIME:8,DIALOG_DATETIME:9,DIAGRAM:10,PAGE:11,DIALOG:12,EXTENSION:Er.EXTENSION},xu=function(t){function n(n,i,r,e){var u=t.call(this,jn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){switch(this.subtype){case yu.DIAGRAM:return new Lu(this,Er.DIAGRAM);case yu.PAGE:return new Lu(this,Er.PAGE)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(3,t,i.resources);return new n(this.toSubType(t),r,e,this.inNewWindow(t))},n.toSubType=function(t){if(6!==t.length)return t[2];switch(t[2]){case yu.DIAGRAM_LEGACY:return yu.DIAGRAM;case yu.PAGE_LEGACY:case yu.PAGE_INPLACE_LEGACY:return yu.PAGE}},n.inNewWindow=function(t){if(6!==t.length)return!!t[4];switch(t[2]){case yu.DIAGRAM_LEGACY:return!1;case yu.PAGE_LEGACY:return!0;case yu.PAGE_INPLACE_LEGACY:return!1}},n}(Tn),Bu={TOP:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,LEFT:4,LEFT_TOP:5,LEFT_MIDDLE:6,LEFT_BOTTOM:7,RIGHT:8,RIGHT_TOP:9,RIGHT_MIDDLE:10,RIGHT_BOTTOM:11,BOTTOM:12,BOTTOM_LEFT:13,BOTTOM_CENTER:14,BOTTOM_RIGHT:15,OVER:16},_u=function(){function t(){}return t.attach=function(t,n,i,r,e,u,s){var h=t.width,o=t.height,a=0;switch(s){case Bu.LEFT:case Bu.LEFT_TOP:case Bu.LEFT_MIDDLE:case Bu.LEFT_BOTTOM:(a=n.left-h-i)<i&&e-i<(a=n.right+i)+h&&(a=i);break;case Bu.RIGHT:case Bu.RIGHT_TOP:case Bu.RIGHT_MIDDLE:case Bu.RIGHT_BOTTOM:e-i<(a=n.right+i)+h&&(a=n.left-h-i)<i&&(a=e-h-i);break;case Bu.TOP:case Bu.TOP_LEFT:case Bu.BOTTOM:case Bu.BOTTOM_LEFT:a=this.adjust(n.left,h,i,e);break;case Bu.TOP_RIGHT:case Bu.BOTTOM_RIGHT:a=this.adjust(n.right-h,h,i,e);break;case Bu.TOP_CENTER:case Bu.BOTTOM_CENTER:case Bu.OVER:a=this.adjust(.5*(n.left+n.right-h),h,i,e)}var c=0;switch(s){case Bu.LEFT:case Bu.LEFT_TOP:case Bu.RIGHT:case Bu.RIGHT_TOP:c=this.adjust(n.top,o,r,u);break;case Bu.LEFT_MIDDLE:case Bu.RIGHT_MIDDLE:case Bu.OVER:c=this.adjust(.5*(n.top+n.bottom-o),o,r,u);break;case Bu.LEFT_BOTTOM:case Bu.RIGHT_BOTTOM:c=this.adjust(n.bottom,o,r,u);break;case Bu.TOP:case Bu.TOP_LEFT:case Bu.TOP_RIGHT:case Bu.TOP_CENTER:(c=n.top-o-r)<r&&u<(c=n.bottom+r)+o&&(c=r);break;case Bu.BOTTOM:case Bu.BOTTOM_LEFT:case Bu.BOTTOM_RIGHT:case Bu.BOTTOM_CENTER:u-r<(c=n.bottom+r)+o&&(c=n.top-o-r)<r&&(c=u-o-r)}t.position.set(a,c)},t.adjust=function(t,n,i,r){return t<i?r-i<t+n?.5*(r-n):i:r-i<t+n?r<n?.5*(r-n):r-n-i:t},t}(),Pu={NONE:0,ESC:1,CLICK_OUTSIDE:2},Fu={DIRTY:0,CLEAN:1},Uu=function(){function n(t,n){var i;this.p=t,this.zn=n,n.enable&&(this.ls=this.newUtil()),this.Fr=Ai(null!==(i=n.mode)&&void 0!==i?i:Fu.DIRTY,Fu),this.vs=!0,this.En=!1}return Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Fr},set:function(t){this.Fr=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"constraint",{get:function(){var t,n,i=this.xi;return null==i&&(i=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.constraint)&&void 0!==n?n:this.newConstraint(),this.xi=i),i},set:function(t){this.xi=t},enumerable:!1,configurable:!0}),n.prototype.newConstraint=function(){var t=this;return function(n,i,r,e){t.toConstrained(n,i,r,e)}},n.prototype.isDirty=function(){return this.En},n.prototype.isClean=function(){return!this.En},n.prototype.toClean=function(){this.En&&(this.En=!1)},n.prototype.newUtil=function(){var n=this,i=new t.Point,r=this.p,e=r.position;return new mr({bind:r,checker:{start:function(t){if(t.target!==r)return!1;i.copyFrom(t.data.global),r.toLocal(i,void 0,i,!0);var n=i.x,e=i.y;return!(n<0||e<0||r.width<n||r.height<e)}},on:{start:function(){i.copyFrom(e)},move:function(t,u,s){i.set(i.x+u,i.y+s),n.En||(n.En=!0,r.setX(e.x),r.setY(e.y));var h=r.layer;null!=h&&n.constraint(r,h,i.x,i.y)}}})},n.prototype.toConstrained=function(i,r,e,u){var s,h=i.position;if(r){var o=i.getBounds(!1,null!==(s=n.WORK_BOUNDS)&&void 0!==s?s:n.WORK_BOUNDS=new t.Rectangle),a=o.x+e-h.x,c=o.y+u-h.y,f=Math.min(Math.max(0,a),r.width-o.width),l=Math.min(Math.max(0,c),r.height-o.height);h.set(e+f-a,u+l-c)}else h.set(e,u)},n}(),Gu={MODAL:0,MODELESS:1,MENU:2},Hu={MODAL:"MODAL",MODELESS:"MODELESS",MENU:"MENU"},zu=function(){function n(){}return n.apply=function(t,n){var i=this;t.on(ir.down,(function(r){if(r.target===t){var e=i.point;e.copyFrom(r.data.global),t.toLocal(e,void 0,e,!0);var u=e.x,s=e.y;(u<0||s<0||t.width<u||t.height<s)&&setTimeout((function(){n(r)}),0)}}))},n.point=new t.Point,n}(),Vu=function(){function t(t){this.bs=null,this.gs=null==(null==t?void 0:t.parent)?st.last():null}return Object.defineProperty(t.prototype,"picked",{get:function(){return this.bs},enumerable:!1,configurable:!0}),t.prototype.pick=function(t){var n=this.bs;if(null==n){if(!(n=st.getLayerOverlay(t))){var i=this.gs;n=i?i.getLayerOverlay():st.last().getLayerOverlay()}this.bs=n}return n},t}(),Wu=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i,r,e=this;n.prototype.init.call(this,t),this.ws=function(){e.onPrerender()},this.bs=null;var u=this.theme,s=Ai(null!==(i=null==t?void 0:t.mode)&&void 0!==i?i:u.getMode(),Gu);this.Fr=s,this.ps=null!==(r=null==t?void 0:t.sticky)&&void 0!==r?r:u.isSticky(s);var h=this.toCloseOn(s,u,t);switch(this.Os=h,this.Lt=this.toAlign(s,u,t),this.Ds=new Vu,this.lr=new Uu(this,this.toGestureOptions(s,u,t)),this.visible=!1,s){case Gu.MODAL:this.state.addAll(ct.FOCUS_ROOT,Hu.MODAL);break;case Gu.MODELESS:this.state.add(Hu.MODELESS);break;case Gu.MENU:this.state.addAll(ct.FOCUS_ROOT,Hu.MENU)}h&Pu.CLICK_OUTSIDE&&zu.apply(this,(function(){e.onCloseOn()}))},i.prototype.toCloseOn=function(t,n,i){var r=null==i?void 0:i.closeOn;if(null==r)return n.closeOn(t);if(mt(r)){for(var e=Pu.NONE,u=0,s=r.length;u<s;++u)e|=Pu[r[u]];return e}return Ot(r)?Pu[r]:r},i.prototype.toAlign=function(t,n,i){var r=null==i?void 0:i.align;return null===r?null:void 0===r?n.getAlign(t):Ai(r,Bu)},Object.defineProperty(i.prototype,"mode",{get:function(){return this.Fr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"align",{get:function(){return this.Lt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"algin",{set:function(t){this.Lt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gesture",{get:function(){return this.lr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"layer",{get:function(){return this.bs},enumerable:!1,configurable:!0}),i.prototype.toGestureOptions=function(t,n,i){var r=null==i?void 0:i.gesture;return!0===r?{enable:!0,mode:n.getGestureMode(t)}:!1===r?{enable:!1,mode:n.getGestureMode(t)}:null!=r?(void 0===r.enable&&(r.enable=n.isGestureEnabled(t)),void 0===r.mode&&(r.mode=n.getGestureMode(t)),r):{enable:n.isGestureEnabled(t),mode:n.getGestureMode(t)}},i.prototype.onParentResize=function(t,i,r){if(this.isOpened()){var e=this.bs;if(null!=e){var u=this.lr;if(u.isDirty()){var s=this.position;u.constraint(this,e,s.x,s.y)}}}n.prototype.onParentResize.call(this,t,i,r)},i.prototype.getAnimation=function(){var t,n,i=this,r=this.Ti;return void 0===r&&((r=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.animation)&&void 0!==n?n:this.theme.newAnimation(this.Fr))&&(r.target=this,r.on("end",(function(t){i.onAnimationEnd(t)}))),this.Ti=r),r},i.prototype.onAnimationEnd=function(t){if(t)if(this.Fr===Gu.MODELESS)this.hide();else{var n=this.parent;n&&n.removeChild(this)}else{var i=st.getLayer(this);if(i){var r=i.getFocusController();this.Es=r.get(),r.focus(this.findFirstFocusable(r)||this)}}},i.prototype.findFirstFocusable=function(t){return t.find(this,!1,!0,!0)},i.prototype.open=function(t){var n=this,i=this.Ms;if(null==i){i=new Promise((function(t,i){n.Ss=t,n.Ts=i})),this.Ms=i,this.js=t;var r=null;switch(this.Fr){case Gu.MODAL:case Gu.MENU:(r=this.Ds.pick(this)).stage.addChild(this);break;case Gu.MODELESS:r=st.getLayer(this),this.show()}this.bs=r;var e=this.lr;if(e.mode===Fu.CLEAN&&e.toClean(),null!=r)if(e.isClean()){var u=r.renderer,s=this.ws;this.ps?u.on("prerender",s):u.once("prerender",s)}else{var h=this.position;e.constraint(this,r,h.x,h.y)}this.onOpen()}return i},i.prototype.onPrerender=function(){var n,r=this.bs;if(null!=r){var e=this.Lt,u=this.js;if(null!=e&&null!=u){var s=this.Fr,h=u.getBounds(!1,null!==(n=i.WORK_BOUNDS)&&void 0!==n?n:i.WORK_BOUNDS=new t.Rectangle),o=this.theme;_u.attach(this,h,o.getOffsetX(s),o.getOffsetY(s),r.width,r.height,e)}else this.position.set(.5*(r.width-this.width),.5*(r.height-this.height))}},i.prototype.onOpen=function(){this.emit("open",this);var t=this.getAnimation();t?t.start():this.Fr===Gu.MENU&&(this.visible=!0,this.onAnimationEnd(!1))},i.prototype.isOpened=function(){return null!=this.Ms},i.prototype.close=function(){this.doReject()},i.prototype.doResolve=function(t){var n=this.Ss;n&&(this.Ms=void 0,this.Ss=void 0,this.Ts=void 0,this.onClose(),n(t))},i.prototype.doReject=function(t){var n=this.Ts;n&&(this.Ms=void 0,this.Ss=void 0,this.Ts=void 0,this.onClose(),n(t))},i.prototype.onClose=function(){var t=this.bs,n=this.Es;if(null!=n)if(this.Es=null,t){var i=st.getLayer(n);null!=i&&t!==i&&i.view.focus(),t.getFocusController().focus(n)}else this.blur(!0);else this.blur(!0);t&&(t.renderer.off("prerender",this.ws),this.bs=null),this.js=null;var r=this.getAnimation();r?r.start(!0):(this.visible=!1,this.onAnimationEnd(!0)),this.emit("close",this)},i.prototype.onKeyDown=function(t){return this.Os&Pu.ESC&&nr.isCancelKey(t)&&this.onCloseOn(),n.prototype.onKeyDown.call(this,t)},i.prototype.onCloseOn=function(){this.close()},i.prototype.containsGlobalPoint=function(t){switch(this.Fr){case Gu.MODAL:case Gu.MENU:return!0;case Gu.MODELESS:return n.prototype.containsGlobalPoint.call(this,t)}},i.prototype.getType=function(){return"DDialog"},i}(hr),Xu={VERTICAL:0,HORIZONTAL:1},Ku=function(t){function n(n){var i=t.call(this,n)||this;return i.visible=!1,i}return _(n,t),n.prototype.getType=function(){return"DLayoutSpace"},n}(hr),Yu=function(t){return t instanceof hr&&(t.visible||t instanceof Ku)},Ju=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n);var i=this.theme;this.te=function(t,n){var i,r,e=null==n?void 0:n.margin;if(null!=e){if(pt(e))return{horizontal:e,vertical:e};var u=t.getMargin();return{horizontal:null!==(i=e.horizontal)&&void 0!==i?i:u,vertical:null!==(r=e.vertical)&&void 0!==r?r:u}}return{horizontal:u=t.getMargin(),vertical:u}}(i,n),this.rn=function(t,n){var i=null==n?void 0:n.direction;return null!=i?Ot(i)?Xu[i]:i:t.getDirection()}(i,n),this.Ns=function(t,n){var i=null==n?void 0:n.corner;if(null!=i&&!pt(i)){var r=i.adjust;if(null!=r)return r}return t.getCornerAdjust()}(i,n),this.Is=function(t,n){if(n){var i=n.row;if(null!=i)return i;var r=n.column;if(null!=r)return r}return t.getMultiplicity()}(i,n),this.ai=function(t,n){var i;return null!==(i=null==n?void 0:n.reverse)&&void 0!==i?i:t.getReverse()}(i,n)},Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"multiplicity",{get:function(){return this.Is},enumerable:!1,configurable:!0}),n.prototype.getWeightTotal=function(){for(var t=this.children,n=0,i=this.Is,r=this.ai,e=0,u=t.length;e<u;){for(var s=-1,h=0;h<i&&e+h<u;++h){var o=t[r?u-1-(e+h):e+h];if(Yu(o)){var a=o.getClearType();if(0!==h&&a&Ki.BEFORE)break;if(s=Math.max(s,o.weight),a&&Ki.AFTER){h+=1;break}}else e+=1,h-=1}e+=h,0<=s&&(n+=s)}return n},n.prototype.getSpaceLeft=function(t,n){var i=this.children,r=this.Is,e=this.ai;if(this.rn===Xu.VERTICAL){for(var u=t,s=0,h=0,o=i.length;h<o;){for(var a=0,c=-1,f=0;f<r&&h+f<o;++f){var l=i[e?o-1-(h+f):h+f];if(Yu(l)){var v=l.getClearType();if(0!==f&&v&Ki.BEFORE)break;if(a=(c=Math.max(c,l.weight))<0?Math.max(a,l.height+s):s,v&Ki.AFTER){f+=1;break}}else h+=1,f-=1}h+=f,u-=a,s=n}return Math.max(0,u)}for(u=t,s=0,h=0,o=i.length;h<o;){var b=0;for(c=-1,f=0;f<r&&h+f<o;++f)if(l=i[e?o-1-(h+f):h+f],Yu(l)){if(v=l.getClearType(),0!==f&&v&Ki.BEFORE)break;if(b=(c=Math.max(c,l.weight))<0?Math.max(b,l.width+s):s,v&Ki.AFTER){f+=1;break}}else h+=1,f-=1;h+=f,u-=b,s=n}return Math.max(0,u)},n.prototype.calcSpaceLeft=function(t,n,i,r){return t?0:this.getSpaceLeft(n-i,r)},n.prototype.onRefit=function(){var i=this.children,r=this.Qn,e=r.getTop(),u=r.getBottom(),s=r.getLeft(),h=r.getRight(),o=this.te,a=o.vertical,c=o.horizontal,f=this.getWeightTotal(),l=this.Is,v=this.ai,b=this.Wn,d=null;if(this.Ns){var g=4+(i.length<<1);(null==n.CORNER_ADJUST_WORK||n.CORNER_ADJUST_WORK.length<g)&&(n.CORNER_ADJUST_WORK=new Float32Array(g)),(d=n.CORNER_ADJUST_WORK)[0]=-2,d[1]=-2,d[g-2]=-3,d[g-1]=-3}if(this.rn===Xu.VERTICAL){var m=0,w=e-a;if(0<f){for(var p=1/f,O=this.calcSpaceLeft(b.height.isOn,this.height,e+u,a),D=0,E=i.length;D<E;){for(var M=s-c,S=0,T=0;T<l&&D+T<E;++T){var j=i[v?E-1-(D+T):D+T];if(Yu(j)){var N=j.getClearType();if(0!==T&&N&Ki.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.height=O*(U*p)),M+=c+j.width,S=Math.max(S,j.height),N&Ki.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1}w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],Yu(j)){var I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2;if(!((N=j.getClearType())&Ki.BEFORE)){var R=this.findRowIndexPrevious(H,C,d);this.hasClearTypeAfter(i,R)||(A=d[R])}var k=-2;if(!(N&Ki.AFTER)){var L=this.findRowIndexNext(H,C,d);this.hasClearTypeBefore(i,L)||(k=d[L])}var y=this.countColumn(H,C,d);j.corner.mask=this.toCornerMaskColumn(A,I,k,y)}}else{for(D=0,E=i.length;D<E;){for(M=s-c,S=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Yu(j)){if(N=j.getClearType(),0!==T&&N&Ki.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.height=0),M+=c+j.width,S=Math.max(S,j.height),N&Ki.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1;w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)j=i[v?E-1-D:D],Yu(j)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],A=-2,(N=j.getClearType())&Ki.BEFORE||(R=this.findRowIndexPrevious(H,C,d),this.hasClearTypeAfter(i,R)||(A=d[R])),k=-2,N&Ki.AFTER||(L=this.findRowIndexNext(H,C,d),this.hasClearTypeBefore(i,L)||(k=d[L])),y=this.countColumn(H,C,d),j.corner.mask=this.toCornerMaskColumn(A,I,k,y))}}else{var x=0;if(M=s-c,0<f){for(p=1/f,O=this.calcSpaceLeft(b.width.isOn,this.width,s+h,c),D=0,E=i.length;D<E;){w=e-a;var B=0;for(T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Yu(j)){if(N=j.getClearType(),0!==T&&N&Ki.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.width=O*(U*p)),B=Math.max(B,j.width),w+=a+j.height,N&Ki.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1;M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],Yu(j)){I=d[0+(H=2+(D<<1))],C=d[H+1];var _=-2;(N=j.getClearType())&Ki.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1]));var P=-2;N&Ki.AFTER||(L=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,L)||(P=d[L+1]));var F=this.countRow(H,I,d);j.corner.mask=this.toCornerMaskRow(_,C,P,F)}}else{for(D=0,E=i.length;D<E;){for(w=e-a,B=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],Yu(j)){var U;if(N=j.getClearType(),0!==T&&N&Ki.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.width=0),B=Math.max(B,j.width),w+=a+j.height,N&Ki.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else{var G;null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1}M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D){var H;j=i[v?E-1-D:D],Yu(j)&&(I=d[0+(H=2+(D<<1))],C=d[H+1],_=-2,(N=j.getClearType())&Ki.BEFORE||(R=this.findColumnIndexPrevious(H,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1])),P=-2,N&Ki.AFTER||(L=this.findColumnIndexNext(H,I,d),this.hasClearTypeBefore(i,L)||(P=d[L+1])),F=this.countRow(H,I,d),j.corner.mask=this.toCornerMaskRow(_,C,P,F))}}}t.prototype.onRefit.call(this)},n.prototype.hasClearTypeBefore=function(t,n){return this.hasClearType(t,n,Ki.BEFORE)},n.prototype.hasClearTypeAfter=function(t,n){return this.hasClearType(t,n,Ki.AFTER)},n.prototype.hasClearType=function(t,n,i){if(2<=n){var r=n-2>>1;if(0<=r&&r<t.length){var e=t[r];if(e instanceof hr)return!!(e.getClearType()&i)}}return!1},n.prototype.findColumnIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r]!==n)return r;return 0},n.prototype.findColumnIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s]!==u)return s-2;return r}}return i.length-2},n.prototype.countRow=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r]!==n)return i[r-2+1]+1;return 0},n.prototype.findRowIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r+1]!==n)return r;return 0},n.prototype.findRowIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r+1];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s+1]!==u)return s-2;return r}}return i.length-2},n.prototype.countColumn=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r+1]!==n)return i[r-2+0]+1;return 0},n.prototype.toCornerMaskColumn=function(t,n,i,r){var e=ki.NONE;return t+1<n&&0===n&&(e|=ki.TOP_LEFT),i+1<n&&0===n&&(e|=ki.BOTTOM_LEFT),t<n&&n+1===r&&(e|=ki.TOP_RIGHT),i<n&&n+1===r&&(e|=ki.BOTTOM_RIGHT),ki.ALL&~e},n.prototype.toCornerMaskRow=function(t,n,i,r){var e=ki.NONE;return t+1<n&&0===n&&(e|=ki.TOP_LEFT),i+1<n&&0===n&&(e|=ki.TOP_RIGHT),t<n&&n+1===r&&(e|=ki.BOTTOM_LEFT),i<n&&n+1===r&&(e|=ki.BOTTOM_RIGHT),ki.ALL&~e},n.prototype.addSpace=function(t){return this.addChild(new Ku(t))},n.prototype.getType=function(){return"DLayout"},n.CORNER_ADJUST_WORK=null,n}(hr),Zu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutVertical"},n}(Ju),qu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredContent"},n}(Zu),Qu={CLICKED:0,DOUBLE_CLICKED:1},$u=function(){function t(t){this.cn=t}return t.prototype.getImageAlignHorizontal=function(){return this.cn.getSecondaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.cn.getSecondaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.cn.getSecondaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.cn.getSecondaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.cn.getSecondaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.cn.getSecondaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.cn.getSecondaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.cn.getSecondaryImageSource(t)},t}(),ts=function(){function t(t){this.cn=t}return t.prototype.getImageAlignHorizontal=function(){return this.cn.getTertiaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.cn.getTertiaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.cn.getTertiaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.cn.getTertiaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.cn.getTertiaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.cn.getTertiaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.cn.getTertiaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.cn.getTertiaryImageSource(t)},t}(),ns={LEFT:0,CENTER:1,RIGHT:2},is={TOP:0,MIDDLE:1,BOTTOM:2},rs={TEXT:0,PADDING:1,BORDER:2},es=function(){function n(n,i,r,e){var u=this;this.p=n,this.cn=i,this.Cs=r,this.Tt=null,this.Lt=function(t,n){var i,r,e,u=null==n?void 0:n.align;return{with:Ai(null!==(i=null==u?void 0:u.with)&&void 0!==i?i:t.getImageAlignWith(),rs),vertical:Ai(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getImageAlignVertical(),is),horizontal:Ai(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getImageAlignHorizontal(),ns)}}(i,e),this.te=function(t,n){var i,r,e=null==n?void 0:n.margin;return{vertical:null!==(i=null==e?void 0:e.vertical)&&void 0!==i?i:t.getImageMarginVertial(),horizontal:null!==(r=null==e?void 0:e.horizontal)&&void 0!==r?r:t.getImageMarginHorizontal()}}(i,e),this.As=null==e?void 0:e.tint,this.Rs=new t.Rectangle,this.ks=null==e?void 0:e.source,this.Ls=null,this.ys=function(){u.onUpdate()}}return Object.defineProperty(n.prototype,"image",{get:function(){return this.Tt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"align",{get:function(){return this.Lt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bound",{get:function(){return this.Rs},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"source",{get:function(){return this.ks},set:function(t){this.ks!==t&&(this.ks=t,this.onUpdate())},enumerable:!1,configurable:!0}),n.prototype.computeSource=function(){var t=this.ks;if(void 0!==t){if(!wt(t))return t;var n=t(this.p.state);if(void 0!==n)return n}return this.cn.getImageSource(this.p.state)},n.prototype.onStateChange=function(t,n){this.updateTint()},n.prototype.updateBound=function(){var t=this.Rs,n=this.Tt;if(null!=n){n.updateTransform(),n.getLocalBounds(t);var i=t.left,r=t.top,e=t.right,u=t.bottom,s=n.localTransform,h=s.a,o=s.b,a=s.c,c=s.d,f=h*i+a*r,l=o*i+c*r,v=h*e+a*r,b=o*e+c*r,d=h*e+a*u,g=o*e+c*u,m=h*i+a*u,w=o*i+c*u,p=Math.min(f,v,d,m),O=Math.max(f,v,d,m),D=Math.min(l,b,g,w),E=Math.max(l,b,g,w);t.x=p+s.tx,t.y=D+s.ty,t.width=O-p,t.height=E-D}else t.x=0,t.y=0,t.width=0,t.height=0},n.prototype.isTintAware=function(t){return null!=t&&"tint"in t},n.prototype.toTintColor=function(t,n){var i=this.As;if(i){var r=i.color;if(void 0!==r){if(!wt(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintColor(n)},n.prototype.toTintAlpha=function(t,n){var i=this.As;if(i){var r=i.alpha;if(void 0!==r){if(!wt(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintAlpha(n)},n.prototype.updateTint=function(){var t=this.Tt;if(t&&this.isTintAware(t)){var n=this.cn,i=this.p.state,r=this.toTintColor(n,i);if(null!=r){var e=!1;t.tint!==r&&(t.tint=r,e=!0);var u=this.toTintAlpha(n,i);return t.alpha!==u&&(t.alpha=u,e=!0),e}}return!1},n.prototype.updateSource=function(){var n=this.computeSource(),i=this.Ls;if(n!==i){this.Ls=n;var r,e=this.p,u=this.Tt,s=this.ys;if(n instanceof t.Texture)if(i instanceof t.Texture)i.off("update",s),u instanceof t.Sprite&&(u.texture=n,n.on("update",s));else{null!=u&&e.removeChild(u);var h=new t.Sprite(n);(r=e.getOverflowMask())&&(h.mask=r),n.on("update",s),e.addChild(h),this.Tt=h}else i instanceof t.Texture?(i.off("update",s),null!=u&&(e.removeChild(u),u.destroy())):null!=u&&e.removeChild(u),null!=n&&((r=e.getOverflowMask())&&(n.mask=r),e.addChild(n)),this.Tt=n;return!0}return!1},n.prototype.isRefitable=function(t){return null!=t&&t===this.Tt},n.prototype.destroy=function(){var n=this.Tt;if(n){this.Tt=null;var i=this.Ls;i instanceof t.Texture&&(i.off("update",this.ys,this),n.destroy())}},n.prototype.onUpdate=function(){this.p.toDirty(),st.update(this.p)},n}(),us=function(){function t(){this.xs=[],this.j=0,this.te=0}return t.prototype.clear=function(){this.xs.length=0,this.j=0,this.te=0,this.Bs=void 0},t.prototype.add=function(t,n,i){this.xs.push(t),this.j+=i+n,this.te=i},t.prototype.set=function(t){this.Bs=t},Object.defineProperty(t.prototype,"size",{get:function(){return this.j-(null===this.Bs?this.te:0)},enumerable:!1,configurable:!0}),t}(),ss=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t,n){var i=this.xs,r=n-t;if(void 0!==this.Bs)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.height,h.image.y=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.height,h.image.y=r}},n}(us),hs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.add=function(t,n,i){this.xs.push(t),this.j=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.xs,u=0,s=e.length;u<s;++u){var h=e[u];h.image.x=r-.5*h.bound.width}},n}(us),os=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t){var n=this.xs,i=t;if(void 0!==this.Bs)for(var r=0,e=n.length;r<e;++r)(u=n[r]).image.x=i,i+=u.bound.width+u.margin.horizontal;else for(r=0,e=n.length;r<e;++r){var u;i+=(u=n[r]).margin.horizontal,u.image.x=i,i+=u.bound.width}},n}(us),as=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.add=function(t,n,i){this.xs.push(t),this.j=Math.max(this.size,n)},n.prototype.execute=function(t,n,i){for(var r=t+.5*(i-t-n),e=this.xs,u=0,s=e.length;u<s;++u){var h=e[u];h.image.y=r-.5*h.bound.height}},n}(us),cs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t,n){var i=this.xs,r=n-t;if(void 0!==this.Bs)for(var e=0,u=0,s=i.length;u<s;++u)r-=e+(h=i[u]).bound.width,h.image.x=r,e=h.margin.horizontal;else for(u=0,s=i.length;u<s;++u){var h;r-=(h=i[u]).margin.horizontal+h.bound.width,h.image.x=r}},n}(us),fs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.execute=function(t){var n=this.xs,i=t;if(void 0!==this.Bs)for(var r=0,e=0,u=n.length;e<u;++e)(s=n[e]).image.y=r+i,i+=s.bound.height,r=s.margin.vertical;else for(e=0,u=n.length;e<u;++e){var s;i+=(s=n[e]).margin.vertical,s.image.y=i,i+=s.bound.height}},n}(us),ls=function(){function t(){this.left=new os,this.center=new hs,this.right=new cs,this.top=new fs,this.middle=new as,this.bottom=new ss}return t.prototype.clear=function(){this.left.clear(),this.center.clear(),this.right.clear(),this.top.clear(),this.middle.clear(),this.bottom.clear(),this.text=void 0},t.prototype.add=function(t){if(null!=t.image){var n=t.bound,i=n.width,r=n.height,e=t.margin,u=e.horizontal,s=e.vertical,h=t.align;switch(h.horizontal){case ns.LEFT:this.left.add(t,i,u);break;case ns.CENTER:this.center.add(t,i,u);break;case ns.RIGHT:this.right.add(t,i,u)}switch(h.vertical){case is.TOP:this.top.add(t,r,s);break;case is.MIDDLE:this.middle.add(t,r,s);break;case is.BOTTOM:this.bottom.add(t,r,s)}}},t.prototype.set=function(t){this.left.set(t),this.center.set(t),this.right.set(t),this.top.set(t),this.middle.set(t),this.bottom.set(t),this.text=t},Object.defineProperty(t.prototype,"width",{get:function(){var t=this.text,n=this.left.size,i=this.center.size,r=this.right.size;return void 0!==t?null!==t?Math.max(n+t.width+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var t=this.text,n=this.top.size,i=this.middle.size,r=this.bottom.size;return void 0!==t?null!==t?Math.max(n+t.height+r,i):Math.max(n+r,i):Math.max(n,r,i)},enumerable:!1,configurable:!0}),t.prototype.execute=function(t,n,i,r,e,u,s){var h=this.left,o=this.center,a=this.right,c=this.top,f=this.middle,l=this.bottom,v=this.text;if(void 0!==v){var b=h.size,d=a.size,g=c.size,m=l.size,w=0,p=0,O=0;switch(null!=v&&(p=v.width,O=v.height),e.horizontal){case ns.LEFT:w=t+b;break;case ns.CENTER:w=t+.5*(u-t-i-(b+p+d))+b;break;case ns.RIGHT:w=u-i-d-p}var D=0;switch(e.vertical){case is.TOP:D=n+g;break;case is.MIDDLE:D=n+.5*(s-n-r-(g+O+m))+g;break;case is.BOTTOM:D=s-r-m-O}null!=v&&(v.position.set(w,D),v.setClippingDelta(b+d,g+m)),h.execute(w-b),o.execute(0,0,2*w+p),a.execute(0,w+p+d),c.execute(D-g),f.execute(0,0,2*D+O),l.execute(0,D+O+m)}else h.execute(t),o.execute(t,i,u),a.execute(i,u),c.execute(n),f.execute(n,r,s),l.execute(r,s)},t}(),vs=function(){function t(){this.text=new ls,this.padding=new ls,this.border=new ls}return t.prototype.clear=function(){this.text.clear(),this.padding.clear(),this.border.clear()},t.prototype.add=function(t){if(t.image)switch(t.align.with){case rs.TEXT:this.text.add(t);break;case rs.PADDING:this.padding.add(t);break;case rs.BORDER:this.border.add(t)}},t.prototype.set=function(t){this.text.set(t)},t.prototype.execute=function(t,n,i,r){var e=t.getLeft(),u=t.getTop(),s=t.getRight(),h=t.getBottom();null==i&&(i=e+this.width+s),null==r&&(r=u+this.height+h),this.border.execute(0,0,0,0,n,i,r),this.padding.execute(e,u,s,h,n,i,r),this.text.execute(e,u,s,h,n,i,r)},Object.defineProperty(t.prototype,"width",{get:function(){return Math.max(this.border.width,this.padding.width,this.text.width)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return Math.max(this.border.height,this.padding.height,this.text.height)},enumerable:!1,configurable:!0}),t}(),bs=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){this.clear(),this.beginFill(16777215,1),this.drawRect(0,0,n,i),this.endFill()},n}(t.Graphics),ds=function(){function t(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r}return t.prototype.set=function(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r},t}(),gs=function(){function t(){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.characters=[],this.scale=1,this.scaled=!1,this.clipped=!1,this.x=0,this.y=0}return t.prototype.start=function(t,n){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.scale=1,this.scaled=!1,this.clipped=!1,this.x=0,this.y=.5*(t-n)},t.prototype.isPushable=function(t,n){return!(t<this.x+n.advance&&!(n.type&Me.SPACE))},t.prototype.isPushableAtNewLine=function(t,n,i){return this.y+1.5*n+.5*i<=t},t.prototype.push=function(t,n){var i=this.x;this.x+=t.advance;var r=this.y,e=this.count,u=this.characters;e<u.length?u[e].set(i,r,t,n):u.push(new ds(i,r,t,n)),this.count+=1,this.countPerLine+=1},t.prototype.newLine=function(t){this.width=Math.max(this.width,this.x),this.x=0,this.y+=t,this.countPerLine=0},t.prototype.wordWrap=function(t){var n=this.countPerLine,i=this.characters;if(0<n){for(var r=this.count,e=r-1,u=r-n;u<e;--e){var s=i[e];if(s.wrappable){var h=s.character.advance,o=s.y+t;s.x=0,s.y=o;for(var a=e+1;a<r;++a)(s=i[a]).x=h,s.y=o,h+=s.character.advance;return this.x=h,this.y=o,this.countPerLine=r-e,!0}}var c=i[r-1];return c.x=0,c.y=c.y+t,this.x=c.character.advance,this.y=c.y,this.countPerLine=1,!1}return!1},t.prototype.pop=function(){var t=this.countPerLine,n=this.characters;if(0<t){var i=n[this.count-1];return this.x-=i.character.advance,this.count-=1,this.countPerLine-=1,!0}return!1},t.prototype.fit=function(t,n){var i=this.width,r=this.height;1e-4<i&&t<i?1e-4<r&&n<r?(this.scale=Math.min(t/i,n/r),this.scaled=!0):(this.scale=t/i,this.scaled=!0):1e-4<r&&n<r&&(this.scale=n/r,this.scaled=!0)},t.prototype.end=function(t,n){this.newLine(t),this.y-=.5*(t-n),this.height=this.y},t}(),ms={NONE:0,NORMAL:1,BREAK_ALL:2},ws="\n",ps=function(){function t(){}return t.measure=function(n,i,r){var e=t.RESULT||new gs;if(t.RESULT=e,null!=i){var u=b.from(n),s=i.font.height,h=r.lineHeight,o=r.fitting,a=!o&&r.clipping,c=r.width,f=r.height,l=!o&&r.wordWrap;switch(e.start(h,s),l){case ms.BREAK_ALL:a?this.measure1(u,c,f,s,h,i,e):this.measure2(u,c,h,i,e);break;case ms.NORMAL:var v=this.newLineBreaker(n);v?a?this.measure1a(v,u,c,f,s,h,i,e):this.measure2a(v,u,c,h,i,e):a?this.measure1b(u,c,f,s,h,i,e):this.measure2b(u,c,h,i,e);break;default:a?this.measure3(u,c,h,i,e):this.measure4(u,h,i,e)}e.end(h,s),o&&e.fit(c,f)}else e.start(0,0),e.end(0,0);return e},t.measure1a=function(t,n,i,r,e,u,s,h){for(var o=t.next();n.hasNext();){var a=n.position,c=n.next();if(c===ws)h.newLine(u);else{var f=s.get(c);if(null==f)continue;o=this.advance(a,o,t);var l=this.isWrappable1(a,o);h.isPushable(i,f)?h.push(f,l):h.isPushableAtNewLine(r,u,e)?(h.push(f,l),h.wordWrap(u)):this.measure5(n,i,u,s,h,!0)}}},t.measure1b=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===ws)s.newLine(e);else{var o=u.get(h);if(null==o)continue;var a=this.isWrappable2(s,o);s.isPushable(n,o)?s.push(o,a):s.isPushableAtNewLine(i,e,r)?(s.push(o,a),s.wordWrap(e)):this.measure5(t,n,e,u,s,!0)}}},t.measure1=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===ws)s.newLine(e);else{var o=u.get(h);if(null==o)continue;s.isPushable(n,o)?s.push(o,!0):s.isPushableAtNewLine(i,e,r)?(s.newLine(e),s.push(o,!0)):this.measure5(t,n,e,u,s,!0)}}},t.measure2a=function(t,n,i,r,e,u){for(var s=t.next();n.hasNext();){var h=n.position,o=n.next();if(o===ws)u.newLine(r);else{var a=e.get(o);if(null==a)continue;s=this.advance(h,s,t);var c=this.isWrappable1(h,s);u.isPushable(i,a)?u.push(a,c):(u.push(a,c),u.wordWrap(r))}}},t.measure2b=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===ws)e.newLine(i);else{var s=r.get(u);if(null==s)continue;var h=this.isWrappable2(e,s);e.isPushable(n,s)?e.push(s,h):(e.push(s,h),e.wordWrap(i))}}},t.measure2=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===ws)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)||e.newLine(i),e.push(s,!1)}}},t.measure3=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===ws)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)?e.push(s,!1):this.measure5(t,n,i,r,e,!1)}}},t.measure4=function(t,n,i,r){for(;t.hasNext();){var e=t.next();if(e===ws)r.newLine(n);else{var u=i.get(e);if(null==u)continue;r.push(u,!1)}}},t.measure5=function(t,n,i,r,e,u){e.clipped=!0;var s=r.get("...");if(null!=s){for(;!e.isPushable(n,s)&&e.pop(););e.isPushable(n,s)&&e.push(s,!1)}if(u)t.close();else for(;t.hasNext();)if(t.next()===ws){e.newLine(i);break}},t.isWrappable2=function(t,n){if(t.countPerLine<=0)return!1;var i=t.characters[t.count-1].character.type,r=n.type;return i&Me.SPACE?!(r&Me.SPACE||i&Me.NON_BREAKING):!(r&Me.SPACE||i&Me.NON_BREAKING&&r&Me.NON_BREAKING)},t.advance=function(t,n,i){return n.done||t<=n.value.end?n:n=i.next()},t.isWrappable1=function(t,n){if(n.done)return!1;var i=n.value;return i.start===t||i.end===t},t.newLineBreaker=function(t){return"css-line-break"in window?window["css-line-break"].LineBreaker(t,{lineBreak:"strict",wordBreak:"normal"}):null},t.RESULT=null,t}(),Os=function(t){function n(){var n=t.call(this,new Float32Array(64),new Float32Array(64),new Uint16Array(48))||this;return n.width=0,n.height=0,n.scale=1,n.scaled=!1,n.clipped=!1,n}return _(n,t),n.prototype.update=function(t,n,i){var r=this.getBuffer("aVertexPosition"),e=this.getBuffer("aTextureCoord"),u=this.getIndex(),s=ps.measure(t,n,i),h=Math.ceil(s.count/8)<<3,o=h<<3;r.data.length<o&&(r.data=new Float32Array(o),e.data=new Float32Array(o));var a=6*h;u.data.length<a&&(u.data=new Uint16Array(a));var c=r.data,f=e.data,l=u.data;if(null!=n){for(var v=s.count,b=s.characters,d=s.scale,g=0;g<v;++g){var m=b[g],w=m.x,p=m.y,O=m.character,D=n.width,E=n.height;this.writeCharacter(c,f,l,g,w,p,d,O,D,E)}g=v;for(var M=c.length>>3;g<M;++g)this.writeCharacterEmpty(c,f,l,g);this.width=s.width*d,this.height=s.height*d,this.scale=d,this.scaled=s.scaled,this.clipped=s.clipped}else{for(g=0,M=c.length>>3;g<M;++g)this.writeCharacterEmpty(c,f,l,g);this.width=0,this.height=0,this.scale=1,this.scaled=!1,this.clipped=!1}r.update(),e.update(),u.update()},n.prototype.writeCharacter=function(t,n,i,r,e,u,s,h,o,a){var c=h.x,f=h.y,l=h.width,v=h.height,b=(e+(c-h.origin.x))*s,d=u*s,g=b+l*s,m=d+v*s,w=r<<3;t[w+0]=b,t[w+1]=d,t[w+2]=g,t[w+3]=d,t[w+4]=g,t[w+5]=m,t[w+6]=b,t[w+7]=m;var p=c/o,O=f/a,D=(c+l)/o,E=(f+v)/a;n[w+0]=p,n[w+1]=O,n[w+2]=D,n[w+3]=O,n[w+4]=D,n[w+5]=E,n[w+6]=p,n[w+7]=E;var M=6*r,S=r<<2;i[M+0]=S+0,i[M+1]=S+1,i[M+2]=S+3,i[M+3]=S+1,i[M+4]=S+2,i[M+5]=S+3},n.prototype.writeCharacterEmpty=function(t,n,i,r){var e=r<<3;t[e+0]=0,t[e+1]=0,t[e+2]=0,t[e+3]=0,t[e+4]=0,t[e+5]=0,t[e+6]=0,t[e+7]=0,n[e+0]=0,n[e+1]=0,n[e+2]=0,n[e+3]=0,n[e+4]=0,n[e+5]=0,n[e+6]=0,n[e+7]=0;var u=6*r,s=r<<2;i[u+0]=s+0,i[u+1]=s+1,i[u+2]=s+3,i[u+3]=s+1,i[u+4]=s+2,i[u+5]=s+3},n}(t.MeshGeometry),Ds=function(){function t(t,n){var i,r,e,u,s,h,o,a,c,f,l;this.R=0,this._s=-1;var v=this.getDefaultOptions();t?(this.Lt=null!==(i=t.align)&&void 0!==i?i:v.align,this.Ps=null!==(r=t.fontFamily)&&void 0!==r?r:v.fontFamily,this.Fs=null!==(e=t.fontSize)&&void 0!==e?e:v.fontSize,this.Us=null!==(u=t.fontStyle)&&void 0!==u?u:v.fontStyle,this.Gs=null!==(s=t.fontVariant)&&void 0!==s?s:v.fontVariant,this.Hs=null!==(h=t.fontWeight)&&void 0!==h?h:v.fontWeight,this.C=null!==(o=t.fill)&&void 0!==o?o:v.fill,this.en=null!==(a=t.clipping)&&void 0!==a?a:v.clipping,this.un=null!==(c=t.fitting)&&void 0!==c?c:v.fitting,this.zs=Ai(null!==(f=t.wordWrap)&&void 0!==f?f:v.wordWrap,ms),this.Vs=null!==(l=t.lineHeight)&&void 0!==l?l:v.lineHeight):(this.Lt=v.align,this.Ps=v.fontFamily,this.Fs=v.fontSize,this.Us=v.fontStyle,this.Gs=v.fontVariant,this.Hs=v.fontWeight,this.C=v.fill,this.en=v.clipping,this.un=v.fitting,this.zs=Ai(v.wordWrap,ms),this.Vs=v.lineHeight),this.Ws=this.Fs,this.Xs=this.Vs,this.Ks=!1,this.Ys=this.Fs,this.Js=-1,this.Zs="",this.qs="",this.Qs=0,this.ut=n}return t.prototype.getDefaultOptions=function(){var n=t.DEFAULT_OPTIONS;return null==n&&(n=this.newDefaultOptions(),t.DEFAULT_OPTIONS=n),n},t.prototype.newDefaultOptions=function(){var t=Z.getInstance().get("DBase");return{align:"left",fontFamily:t.getFontFamilly(),fontSize:t.getFontSize(),fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fill:t.getColor(new Dt),clipping:!0,fitting:!1,wordWrap:ms.NONE,lineHeight:t.getLineHeight()}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idApproved",{get:function(){return this._s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontId",{get:function(){return this.update(),this.Zs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdFontSize",{get:function(){return this.update(),this.Ws},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdApproved",{get:function(){return this.qs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this.C},set:function(t){this.C!==t&&(this.C=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){this.R+=1,this.ut()},Object.defineProperty(t.prototype,"fillApproved",{get:function(){return this.Qs},enumerable:!1,configurable:!0}),t.prototype.approve=function(){this.update(),this._s=this.R,this.qs=this.Zs,this.Qs=this.C},Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this.Ps},set:function(t){this.Ps!==t&&(this.Ps=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.Fs},set:function(t){this.Fs!==t&&(this.Fs=t,this.Ws=t,this.Xs=this.Vs,this.Ks=!1,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSizeFitted",{get:function(){return this.Ws},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFontFitted",{get:function(){return this.Ks},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this.Us},set:function(t){this.Us!==t&&(this.Us=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this.Gs},set:function(t){this.Gs!==t&&(this.Gs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this.Hs},set:function(t){this.Hs!==t&&(this.Hs=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.update=function(){if(this.Js!==this.R){this.Js=this.R;var t=this.un?this.Ws:this.Fs;this.Ys=t,this.Zs=this.toFontId(t)}},t.prototype.toFontId=function(t){return"".concat(this.Us," ").concat(this.Gs," ").concat(this.Hs," ").concat(t,"px ").concat(this.Ps)},Object.defineProperty(t.prototype,"clipping",{get:function(){return this.en},set:function(t){this.en!==t&&(this.en=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fitting",{get:function(){return this.un},set:function(t){this.un!==t&&(this.un=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this.zs},set:function(t){this.zs!==t&&(this.zs=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.Vs},set:function(t){this.Vs!==t&&(this.Vs=t,this.Ws=this.Fs,this.Xs=t,this.Ks=!1,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeightFitted",{get:function(){return this.Xs},set:function(t){this.Xs!==t&&(this.Xs=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n){var i=!1;return t<this.Ws&&(this.Ws=t,i=!0),this.Xs!==n&&(this.Xs=n,i=!0),!0!==this.Ks&&(this.Ks=!0,i=!0),i&&this.onChange(),i},t.prototype.unfit=function(){var t=!1;return!1!==this.Ks&&(this.Ks=!1,t=!0),this.Ws!==this.Fs&&(this.Ws=this.Fs,t=!0),this.Xs!==this.Vs&&(this.Xs=this.Vs,t=!0),t&&this.onChange(),t},t}(),Es=function(){function t(){}return t.measure=function(t){var n=this.$s;null==n&&(n=new Map,this.$s=n);var i=n.get(t);if(null!=i)return i;this.setup(t);var r=this.th.getBoundingClientRect().top,e=this.nh.getBoundingClientRect();return i={ascent:r-e.top,descent:e.bottom-r},n.set(t,i),i},t.toSize=function(t){return this.setup(t),parseFloat(window.getComputedStyle(this.nh).fontSize)},t.setup=function(t){var n=this.nh;null==n&&((n=document.createElement("span")).innerText="|ÉqÅ",n.style.border="none",n.style.margin="0px",this.nh=n);var i=this.th;null==i&&((i=document.createElement("div")).style.display="inline-block",i.style.width="0px",i.style.height="0px",i.style.border="none",i.style.margin="0px",i.style.verticalAlign="baseline",this.th=i);var r=this.ih;null==r&&((r=document.createElement("div")).style.position="absolute",r.style.padding="0px",r.style.margin="0px",r.style.visibility="hidden",r.appendChild(n),r.appendChild(i),document.body.appendChild(r),this.ih=r),n.style.font=t},t}(),Ms=function(n){function i(i,r){var e=n.call(this,new Os,new t.MeshMaterial(t.Texture.EMPTY))||this;return e.B=new Ds(r,(function(){e.En=!0,e.rh=!0,e.mu=null,e.eh()})),e.Bs=i,e.uh="",e.En=!0,e.rh=!0,e.mu=null,e.sh=0,e.kt=0,e.pn=0,e.Ni={clipping:!1,fitting:!1,wordWrap:ms.NONE,width:0,height:0,lineHeight:0,delta:{width:0,height:0}},e.eh(),e}return _(i,n),i.prototype.eh=function(){var t=st.getLayer(this);if(t){var n=this.B;if(this.En){this.En=!1;var i=this.Bs,r=this.uh;this.uh=i;var e=n.fontId,u=n.fontIdApproved,s=n.fontIdFontSize,h=n.fill,o=n.fillApproved;n.approve();var a=t.getDynamicFontAtlases();i===r&&e===u&&h===o||(a.add(e,s,h,i),a.remove(u,o,r))}}},Object.defineProperty(i.prototype,"text",{get:function(){return this.Bs},set:function(t){this.Bs!==t&&(this.Bs=t,this.B.unfit()||(this.En=!0,this.rh=!0,this.eh()))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this.update(),Math.abs(this.scale.x)*this.geometry.width},set:function(t){this.update();var n=this.geometry.width;if(1e-4<n){var i=t/n;this.scale.x=0<=this.scale.x?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.update(),Math.abs(this.scale.y)*this.geometry.height},set:function(t){this.update();var n=this.geometry.height;if(1e-4<n){var i=t/n;this.scale.y=0<=this.scale.y?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clipped",{get:function(){return this.geometry.clipped},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"style",{get:function(){return this.B},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this;this.eh();var n=this.B,i=this.mu;if(null==i){var r=st.getLayer(this);r&&null!=(i=r.getDynamicFontAtlases().get(n.fontId,n.fill))&&(this.sh=i.getRevisionUpdate(),this.mu=i,this.texture=i.texture,this.rh=!0)}else{var e=i.getRevisionUpdate();e!==this.sh&&(this.sh=e,this.rh=!0)}var u=this.Ni;if(this.updateClipping(n,u)&&(this.rh=!0),this.rh){this.rh=!1;var s=this.geometry;if(s.update(this.Bs,i,u),u.fitting&&!n.isFontFitted&&s.scaled){var h=s.scale,o=n.fontSize,a=n.toFontId(Math.ceil(o*h*1e3)/1e3),c=Es.toSize(a),f=c/o,l=n.lineHeight*f;n.fit(c,l)&&setTimeout((function(){st.update(t)}),0)}}},i.prototype.updateClipping=function(t,n){var i=!1,r=t.clipping;n.clipping!==r&&(n.clipping=r,i=!0);var e=t.fitting;n.fitting!==e&&(n.fitting=e,i=!0);var u=t.wordWrap;n.wordWrap!==u&&(n.wordWrap=u,i=!0);var s=e?t.lineHeightFitted:t.lineHeight;if(n.lineHeight!==s&&(n.lineHeight=s,i=!0),r||e||u){var h=this.parent;if(h instanceof hr){var o=h.width-h.padding.getLeft()-h.padding.getRight()-n.delta.width;n.width!==o&&(n.width=o,i=!0);var a=h.height-h.padding.getTop()-h.padding.getBottom()-n.delta.height;n.height!==a&&(n.height=a,i=!0)}}return i},i.prototype.setClippingDelta=function(t,n){var i=this.Ni.delta;i.width=t,i.height=n},i.prototype._calculateBounds=function(){this.update(),n.prototype._calculateBounds.call(this)},i.prototype._render=function(t){this.update(),n.prototype._render.call(this,t)},i}(t.Mesh),Ss=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u;t.prototype.init.call(this,n);var s=this.theme;this.hh=null!==(r=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.value)&&void 0!==r?r:s.newTextValue(),this.oh=this.computeTextValue();var h=null==n?void 0:n.text;this.ah=null==h?void 0:h.color,this.fh=null==h?void 0:h.alpha,this.lh=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v,b=null===(r=null==n?void 0:n.text)||void 0===r?void 0:r.style;return null!=b?{fill:null!==(e=b.fill)&&void 0!==e?e:t.getColor(i),fontSize:null!==(u=b.fontSize)&&void 0!==u?u:t.getFontSize(),fontFamily:null!==(s=b.fontFamily)&&void 0!==s?s:t.getFontFamilly(),fontWeight:null!==(h=b.fontWeight)&&void 0!==h?h:t.getFontWeight(),fontStyle:null!==(o=b.fontStyle)&&void 0!==o?o:t.getFontStyle(),fontVariant:null!==(a=b.fontVariant)&&void 0!==a?a:t.getFontVariant(),clipping:null!==(c=b.clipping)&&void 0!==c?c:t.getTextStyleClipping(),fitting:null!==(f=b.fitting)&&void 0!==f?f:t.getTextStyleFitting(),wordWrap:null!==(l=b.wordWrap)&&void 0!==l?l:t.getTextStyleWordWrap(),lineHeight:null!==(v=b.lineHeight)&&void 0!==v?v:t.getLineHeight()}:{fill:t.getColor(i),fontSize:t.getFontSize(),fontFamily:t.getFontFamilly(),fontWeight:t.getFontWeight(),fontStyle:t.getFontStyle(),fontVariant:t.getFontVariant(),clipping:t.getTextStyleClipping(),fitting:t.getTextStyleFitting(),wordWrap:t.getTextStyleWordWrap(),lineHeight:t.getLineHeight()}}(s,n,this.state),this.Cs=function(t,n){var i,r,e,u=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.align;return{vertical:Ai(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getTextAlignVertical(),is),horizontal:Ai(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getTextAlignHorizontal(),ns)}}(s,n),this.bh=null!==(e=null==h?void 0:h.formatter)&&void 0!==e?e:s.getTextFormatter(),this.dh=!0,this.gh=null!==(u=null==n?void 0:n.mask)&&void 0!==u?u:s.isOverflowMaskEnabled(),this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"text",{get:function(){return this.hh},set:function(t){this.hh!==t&&(this.hh=t,this.updateTextValue())},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){},n.prototype.computeTextValue=function(){var t=this.hh;if(void 0!==t){if(!wt(t))return t;var n=t(this.state);if(void 0!==n)return n}return this.theme.getTextValue(this.state)},n.prototype.createOrUpdateText=function(){var t=this.oh;if(void 0!==t){var n=this.bh(t,this),i=this.Bs;if(null==i){if(0<n.length){var r=this.createText(n);r.visible=this.dh,this.Bs=r,this.addChild(r),this.updateTextPosition(r);var e=this.getOverflowMask();e&&(r.mask=e),this.toDirty(),st.update(this)}}else i.text=n,this.toDirty(),st.update(this)}},n.prototype.createText=function(t){return new Ms(t,this.lh)},n.prototype.getOverflowMask=function(){return this.gh?(null==this.dr&&(this.dr=new bs(this),this.Zn.add(this.dr),this.toDirty()),this.dr):null},n.prototype.updateTextPosition=function(t){var n=this.Cs,i=this.Qn,r=this.Wn,e=0,u=i.getLeft(),s=n.horizontal;if(r.width.isOn||s===ns.LEFT)e=u;else{var h=this.width,o=t.width,a=i.getRight();e=s===ns.CENTER?u+.5*(h-u-a-o):h-o-a}var c=0,f=i.getTop(),l=n.vertical;if(r.height.isOn||l===is.TOP)c=f;else{var v=this.height,b=t.height,d=i.getBottom();c=l===is.MIDDLE?f+.5*(v-f-d-b):v-b-d}t.position.set(e,c)},n.prototype.getTextColor=function(t,n){var i=this.ah;if(void 0!==i){if(!wt(i))return i;var r=i(n);if(void 0!==r)return r}return t.getColor(n)},n.prototype.getTextAlpha=function(t,n){var i=this.fh;if(void 0!==i){if(!wt(i))return i;var r=i(n);if(void 0!==r)return r}return t.getAlpha(n)},n.prototype.updateTextColor=function(t){var n=this.theme,i=this.state;t.style.fill=this.getTextColor(n,i),t.alpha=this.getTextAlpha(n,i)},n.prototype.updateTextValue=function(){var t=this.computeTextValue();this.oh!==t&&(this.oh=t,this.onTextChange(),this.createOrUpdateText())},n.prototype.updateText=function(){var t=this.Bs;t&&(this.updateTextValue(),this.updateTextPosition(t),this.updateTextColor(t))},n.prototype.showText=function(){var t=this.Bs;t&&(t.visible=!0),this.dh=!0},n.prototype.hideText=function(){var t=this.Bs;t&&(t.visible=!1),this.dh=!1},n.prototype.onReflow=function(){t.prototype.onReflow.call(this),this.updateText()},n.prototype.isRefitable=function(n){return t.prototype.isRefitable.call(this,n)||null!=n&&n===this.Bs},n.prototype.applyTitle=function(){var n=this.Bs;if(this.$n.length<=0&&n&&"clipped"in n&&n.clipped){var i=st.getLayer(this);i&&(i.view.title=n.text)}else t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DTextBase"},n.prototype.destroy=function(){var n=this.Bs;n&&(this.Bs=null,n.destroy());var i=this.dr;i&&(this.dr=null,i.destroy()),t.prototype.destroy.call(this)},n}(hr),Ts=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){this.mh=this.newImages(this.theme,n),t.prototype.init.call(this,n)},n.prototype.newImages=function(t,n){var i=[];return i.push(this.newImage(t,this.toImageOptions(t,null==n?void 0:n.image))),function(t){return!!t.getSecondaryImageSource}(t)&&i.push(this.newImage(new $u(t))),function(t){return!!t.getTertiaryImageSource}(t)&&i.push(this.newImage(new ts(t))),i},n.prototype.toImageOptions=function(t,n){return n},n.prototype.newImage=function(t,n){return new es(this,t,this.Cs,n)},Object.defineProperty(n.prototype,"image",{get:function(){return this.mh[0].source},set:function(t){var n=this.mh[0];n.source=t,n.updateSource()},enumerable:!1,configurable:!0}),n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i);for(var r=this.mh,e=0,u=r.length;e<u;++e)r[e].onStateChange(n,i)},n.prototype.updateText=function(){this.updateTextValue(),this.updateTextAndImage()},n.prototype.updateTextAndImage=function(){for(var t,i=this.mh,r=null!==(t=n.LAYOUTER)&&void 0!==t?t:n.LAYOUTER=new vs,e=0,u=i.length;e<u;++e){var s=i[e];s.updateSource(),s.updateTint(),s.updateBound(),r.add(s)}var h=this.Bs;null!=h?(this.updateTextColor(h),r.set(h)):r.set(null);var o=this.Wn;r.execute(this.Qn,this.Cs,o.width.isOn?null:this.width,o.height.isOn?null:this.height),r.clear()},n.prototype.isRefitable=function(n){if(t.prototype.isRefitable.call(this,n))return!0;for(var i=this.mh,r=0,e=i.length;r<e;++r)if(i[r].isRefitable(n))return!0;return!1},n.prototype.getType=function(){return"DImageBase"},n.prototype.destroy=function(){for(var n=this.mh,i=0,r=n.length;i<r;++i)n[i].destroy();t.prototype.destroy.call(this)},n}(Ss),js=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e=this;t.prototype.init.call(this,n);var u=this.theme;this.wh=null!==(i=null==n?void 0:n.toggle)&&void 0!==i?i:u.isToggle(),this.ph=Ai(null!==(r=null==n?void 0:n.when)&&void 0!==r?r:u.getWhen(),Qu),this.on(ir.tap,(function(t){e.onClick(t)})),this.initOnPress();var s=null==n?void 0:n.group;s&&s.add(this)},n.prototype.onShortcut=function(n){this.state.isActionable&&this.activate(n),t.prototype.onShortcut.call(this,n)},Object.defineProperty(n.prototype,"isToggle",{get:function(){return!!this.wh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return!!this.Oh},set:function(t){this.Oh=t},enumerable:!1,configurable:!0}),n.prototype.initOnPress=function(){var t=this,n=null,i=function(){t.state.isPressed=!1,null!=n&&(n.off(ir.up,i),n.off(ir.upoutside,i),n.off(ir.cancel,i),n=null)};this.on(ir.down,(function(){if(t.state.isActionable){t.state.isPressed=!0;var r=st.getLayer(t);r&&((n=r.renderer.plugins.interaction).on(ir.up,i),n.on(ir.upoutside,i),n.on(ir.cancel,i))}}))},n.prototype.getType=function(){return"DButton"},n.prototype.onClick=function(t){this.ph===Qu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.ph===Qu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.wh?this.Oh&&this.state.isActive||(this.onToggleStart(t),this.onToggleEnd(t)):this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onInactivate=function(t){this.emit("inactive",this)},n.prototype.toggle=function(){this.state.isActionable&&this.wh&&(this.onToggleStart(),this.onToggleEnd())},n.prototype.onToggleStart=function(t){this.state.isActive=!this.state.isActive},n.prototype.onToggleEnd=function(t){this.state.isActive?this.onActivate(t):this.onInactivate(t)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.wh?this.onToggleStart(t):this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.wh?this.onToggleEnd(t):(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1))},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isPressed?i.isPressed||this.onPress():i.isPressed&&this.onUnpress()},n.prototype.onPress=function(){this.emit("press",this)},n.prototype.onUnpress=function(){this.emit("unpress",this)},n.prototype.destroy=function(){var n,i;null===(i=null===(n=this.zn)||void 0===n?void 0:n.group)||void 0===i||i.remove(this),t.prototype.destroy.call(this)},n}(Ts),Ns=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButton"},n}(js),Is=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonPrimary"},n}(Ns),Cs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutHorizontal"},n}(Ju),As=function(t){function n(n,i){var r=t.call(this,i)||this;r.p=n;var e=r.buttonOk,u=r.buttonCancel;return null==e&&null==u||(r.addChild(r.newButtonSpace()),u&&r.addChild(u),e&&r.addChild(e),r.addChild(r.newButtonSpace())),r}return _(n,t),Object.defineProperty(n.prototype,"buttonCancel",{get:function(){var t=this.Dh;return void 0===t&&(t=this.newButtonCancel(),this.Dh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonCancel=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.cancel;return void 0===r&&(r=this.theme.getButtonCancel()),null!=r?new Is({text:{value:r},on:{active:function(){i.p.cancel()}}}):null},Object.defineProperty(n.prototype,"buttonOk",{get:function(){var t=this.Eh;return void 0===t&&(t=this.newButtonOk(),this.Eh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonOk=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.ok;return void 0===r&&(r=this.theme.getButtonOk()),null!=r?null!=this.buttonCancel?new Ns({text:{value:r},on:{active:function(){i.p.ok()}}}):new Is({text:{value:r},on:{active:function(){i.p.ok()}}}):null},n.prototype.newButtonSpace=function(){return new Ku({weight:1})},n.prototype.getType=function(){return"DDialogLayeredFooter"},n}(Cs),Rs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonAmbient"},n}(Ns),ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderButtonClose"},n}(Rs),Ls=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogLayeredHeaderSeparator"},n}(Ts),ys=function(t){function n(n,i){var r=t.call(this,i)||this;r.p=n;var e=r.separator;e&&r.addChild(e);var u=r.buttonClose;return u&&(r.addChild(u),u.on("active",(function(){r.p.cancel()}))),r}return _(n,t),Object.defineProperty(n.prototype,"buttonClose",{get:function(){var t=this.Mh;return void 0===t&&(t=this.newButtonClose(),this.Mh=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonClose=function(){var t,n;return!1!==(null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.close)?new ks:null},Object.defineProperty(n.prototype,"separator",{get:function(){var t=this.Sh;return void 0===t&&(t=this.newSeparator(),this.Sh=t),t},enumerable:!1,configurable:!0}),n.prototype.newSeparator=function(){var t;return!1!==(null===(t=this.zn)||void 0===t?void 0:t.separator)?new Ls:null},n.prototype.getType=function(){return"DDialogLayeredHeader"},n}(Ts),xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.addChild(this.layout)},Object.defineProperty(n.prototype,"layout",{get:function(){var t=this.Th;return null==t&&(t=this.newLayout(),this.Th=t),t},enumerable:!1,configurable:!0}),n.prototype.newLayout=function(){return new Zu(this.toLayoutOptions(this.theme,this.zn))},n.prototype.toLayoutOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.layout)&&void 0!==i?i:t.getLayout())&&void 0!==r?r:this.newLayoutOptions(t,n);return void 0===e.children&&(e.children=this.newLayoutChildren(t,n)),e},n.prototype.newLayoutOptions=function(t,n){return{width:"padding",height:"auto",margin:0}},n.prototype.newLayoutChildren=function(t,n){return[this.header,this.content,this.footer]},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.jh;return void 0===t&&(t=this.newHeader(),this.jh=t),t},enumerable:!1,configurable:!0}),n.prototype.newHeader=function(){var t=this.toHeaderOptions(this.theme,this.zn);return null!==t?new ys(this,t):null},n.prototype.toHeaderOptions=function(t,n){if(n){var i=n.header;if(void 0!==i)return i}return t.getHeader()},Object.defineProperty(n.prototype,"content",{get:function(){var t=this.Nh;return null==t&&(t=this.newContent(),this.Nh=t),t},enumerable:!1,configurable:!0}),n.prototype.newContent=function(){return new qu(this.toContentOptions(this.theme,this.zn))},n.prototype.toContentOptions=function(t,n){var i,r,e=null!==(r=null!==(i=null==n?void 0:n.content)&&void 0!==i?i:t.getContent())&&void 0!==r?r:{};return void 0===e.children&&(e.children=this.newContentChildren(t,n)),e},n.prototype.newContentChildren=function(t,n){return[]},Object.defineProperty(n.prototype,"footer",{get:function(){var t=this.Ih;return void 0===t&&(t=this.newFooter(),this.Ih=t),t},enumerable:!1,configurable:!0}),n.prototype.newFooter=function(){var t=this.toFooterOptions(this.theme,this.zn);return null!==t?new As(this,t):null},n.prototype.toFooterOptions=function(t,n){if(n){var i=n.footer;if(void 0!==i)return i}return t.getFooter()},n.prototype.findFirstFocusable=function(t){return t.find(this.content,!1,!0,!0)},n.prototype.ok=function(){this.onOk(this.getResolvedValue())},n.prototype.onOk=function(t){this.doResolve(t),this.emit("ok",t,this)},n.prototype.cancel=function(){this.onCancel(this.getRejectReason())},n.prototype.onCancel=function(t){this.doReject(t),this.emit("cancel",t,this)},n.prototype.getRejectReason=function(){},n.prototype.getType=function(){return"DDialogLayered"},n}(Wu),Bs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout),r},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.Ch;return null==t&&(t=this.newInputLayout(),this.Ch=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(){var t=this.toInputMargin(this.theme,this.zn);return new Cs({width:"padding",height:"auto",margin:0,children:[new Ku({width:t}),this.input,new Ku({width:t})]})},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.Ah;if(null==t){var n=this.zn;t=this.newInput(null==n?void 0:n.input),this.Ah=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.input.value},set:function(t){this.input.value=t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.input.value},n.prototype.getType=function(){return"DDialogInput"},n}(xs),_s=function(t){function n(n){var i=t.call(this)||this;i.Rh=[],i.kh=null,i.Lh=function(t){i.active=t};var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i.emit("init",i),i}return _(n,t),n.prototype.add=function(t){if(this.Rh.indexOf(t)<0){this.Rh.push(t),t.isGrouped=!0;var n=this.vs;null!=n&&(t.state.isEnabled=n),t.on("active",this.Lh),t.state.isActive&&(this.active=t)}},Object.defineProperty(n.prototype,"active",{get:function(){return this.kh},set:function(t){if((null==t||t.isToggle)&&this.kh!==t){var n=this.kh;this.kh=null;for(var i=this.Rh,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u.isToggle&&u.state.isActive&&u.toggle()}this.emit("active",t,n,this)}},enumerable:!1,configurable:!0}),n.prototype.remove=function(t){var n=this.Rh,i=n.indexOf(t);0<=i&&(n.splice(i,1),t.isGrouped=!1,t.off("active",this.Lh),this.kh===t&&(this.active=null))},n.prototype.contains=function(t){return 0<=this.Rh.indexOf(t)},n.prototype.clear=function(){for(var t=this.Rh,n=0,i=t.length;n<i;++n)t[n].isGrouped=!1;t.length=0,this.active=null},n.prototype.size=function(){return this.Rh.length},n.prototype.each=function(t){for(var n=this.Rh,i=0,r=n.length;i<r&&!1!==t(n[i]);++i);},n.prototype.disable=function(){for(var t=this.Rh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!0;this.vs=!1},n.prototype.enable=function(){for(var t=this.Rh,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!1;this.vs=!0},n.prototype.destroy=function(){this.clear()},n}(t.utils.EventEmitter),Ps=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOff"},n}(Ns),Fs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOn"},n}(Ns),Us=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.getButtonOff()),i.addChild(i.getButtonOn());var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i.getButtonGroup().on("active",(function(){var t=i.value;i.emit("change",t,!t,i)})),i}return _(n,t),n.prototype.getButtonGroup=function(){var t=this.yh;return null==t&&(t=this.newButtonGroup(),this.yh=t),t},n.prototype.newButtonGroup=function(){return new _s},n.prototype.getButtonOn=function(){var t=this.xh;return null==t&&(t=this.newButtonOn(),this.xh=t),t},n.prototype.newButtonOn=function(){return new Fs({weight:1,group:this.getButtonGroup()})},n.prototype.getButtonOff=function(){var t=this.Bh;return null==t&&(t=this.newButtonOff(),this.Bh=t),t},n.prototype.newButtonOff=function(){return new Ps({weight:1,group:this.getButtonGroup(),state:ct.ACTIVE})},Object.defineProperty(n.prototype,"value",{get:function(){return this.getButtonOn().state.isActive},set:function(t){this.value!==t&&(t?this.getButtonOn().activate():this.getButtonOff().activate())},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputBoolean"},n}(Cs),Gs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){return new Us(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputBoolean"},n}(Bs),Hs=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.target=vn.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i.isOpened=!1,i.step=vn.ofNumberOrNull(n.step),i.min=vn.ofNumberOrNull(n.min),i.max=vn.ofNumberOrNull(n.max),i}return _(n,t),n.prototype.execute=function(t,n,i){var r=this;if(!this.isOpened&&this.condition(t,i,ln)){var e=this.target(t,i,ln);if(null!=e){var u=this.initial(t,i,ln),s=this.step(t,i,ln),h=this.min(t,i,ln),o=this.max(t,i,ln);this.isOpened=!0,setTimeout((function(){r.open(t,e,u,s,h,o).then((function(n){r.isOpened=!1,wu.execute(t,r.onInputAction,e,n,i)}),(function(){r.isOpened=!1}))}),0)}}},n}(dn),zs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofBooleanOrFalse(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Gs({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Hs),Vs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getUtil=function(){var t=this.ls;return null==t&&(t=this.newUtil(),this.ls=t),t},n.prototype.newUtil=function(){return new uu(this,this.newOperation(),this.theme,this.zn)},n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},Object.defineProperty(n.prototype,"element",{get:function(){return this.getUtil().element},enumerable:!1,configurable:!0}),n.prototype.onDownThis=function(n){var i=this.getUtil();i.onDowning(n),t.prototype.onDownThis.call(this,n),i.onDown(n)},n.prototype.onDblClick=function(n,i){return this.getUtil().onDblClick(n,i),t.prototype.onDblClick.call(this,n,i)},n.prototype.onFocus=function(){t.prototype.onFocus.call(this),this.getUtil().onFocus()},n.prototype.onBlur=function(){t.prototype.onBlur.call(this),this.getUtil().onBlur()},n.prototype.start=function(){this.getUtil().start()},n.prototype.render=function(n){this.getUtil().onRender(n),t.prototype.render.call(this,n)},n.prototype.getElementRect=function(t,n,i){return n.set(0,0),this.toGlobal(n,n,!1),i.x=n.x,i.y=n.y,n.set(this.width,this.height),this.toGlobal(n,n,!0),i.width=n.x-i.x,i.height=n.y-i.y,i},n.prototype.getClipperRect=function(t,n,i){return uu.getClipperRect(this.parent,this,t,n,i)},n.prototype.cancel=function(){this.getUtil().cancel()},n.prototype.end=function(){this.getUtil().end()},n.prototype.select=function(){return this.getUtil().select(),this},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.start(),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DHtmlElement"},n}(Ts),Ws=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){t.hideText()},onCancel:function(){t.showText()},onEnd:function(){},getValue:function(){return t.oh},onValueInput:function(n){t.onValueInput(n)},onValueChange:function(n,i){t.text=n,t.onValueChange(n,i)},onEnter:function(){t.onEnter()},applyTitle:function(){t.applyTitle()}}},Object.defineProperty(n.prototype,"value",{get:function(){return this.oh},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){t.prototype.onTextChange.call(this),this.validate()},n.prototype.onValueChange=function(t,n){this.emit("change",t,n,this)},n.prototype.onValueInput=function(t){this.emit("input",t,this)},n.prototype.onEnter=function(){this.emit("enter",this)},n.prototype.validate=function(){return this.getUtil().validate()},n.prototype.applyTitle=function(){this.getUtil().applyTitle()||t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DInput"},n}(Vs),Xs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInput"},n}(Ws),Ks=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new gu(this,this.newOperation(),this.theme,this.zn)},Object.defineProperty(n.prototype,"step",{get:function(){return this.getUtil().step},set:function(t){this.getUtil().step=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.getUtil().min},set:function(t){this.getUtil().min=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.getUtil().max},set:function(t){this.getUtil().max=t},enumerable:!1,configurable:!0}),n}(Xs),Ys=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInteger"},n}(Ks),Js=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new Ys(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputInteger"},n}(Bs),Zs=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Js({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Hs),qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputReal"},n}(Ks),Qs=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new qs(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputReal"},n}(Bs),$s=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new Qs({header:{text:{value:i},button:{close:!1}},input:{step:e,min:u,max:s,text:{value:r}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i);var a=h.input;a.step=e,a.min=u,a.max=s,h.value=r}return h.open(t)},n}(Hs),th=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Su(this,this.newOperation(),this.theme,this.zn)},n.prototype.getType=function(){return"DInputText"},n}(Xs),nh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new th(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputText"},n}(Bs),ih=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofString(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;if(null==h)h=new nh({header:{text:{value:i},button:{close:!1}}}),n.DIALOG=h;else{var o=h.header;o&&(o.text=i)}return h.value=r,h.open(t)},n}(Hs),rh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogFittedContent"},n}(qu),eh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLayoutOptions=function(t,n){return{width:"auto",height:"auto",margin:0}},n.prototype.newContent=function(){return new rh(this.toContentOptions(this.theme,this.zn))},n.prototype.getType=function(){return"DDialogFitted"},n}(xs),uh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonBack"},n}(Rs),sh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonDate"},n}(Rs),hh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonNext"},n}(Rs),oh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DText"},n}(Ss),ah=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabel"},n}(oh),ch=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabelDate"},n}(oh),fh=function(t){function n(n){var i=t.call(this,n)||this;return i.renderable=!1,i}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeSpace"},n}(hr),lh={NONE:0,DATE:1,HOURS:2,MINUTES:4,SECONDS:8,TIME:14,ALL:15},vh=function(){function t(){}return t.from=function(t,n){var i=null==n?void 0:n.mask;if(null==i){if(Ot(t)){var r=Z.getInstance().get(t);if(null!=r)return r.getMask()}else if(null!=t)return t.getMask();return lh.NONE}if(Ot(i))return lh[i];if(pt(i))return i;for(var e=lh.NONE,u=0,s=i.length;u<s;++u)e|=lh[i[u]];return e},t}(),bh=function(){function t(t,n){var i,r;this._h=null!==(i=null==t?void 0:t.date)&&void 0!==i?i:null,this.Ph=null!==(r=null==t?void 0:t.inclusive)&&void 0!==r&&r,this.ut=n}return Object.defineProperty(t.prototype,"date",{get:function(){return this._h},set:function(t){this._h!==t&&(this._h=t,this.ut())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inclusive",{get:function(){return this.Ph},set:function(t){this.Ph!==t&&(this.Ph=t,this.ut())},enumerable:!1,configurable:!0}),t}(),dh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(r.getFullYear()<t.getFullYear())return e.hour.min;if(r.getMonth()<t.getMonth())return e.hour.min;if(r.getDate()<t.getDate())return e.hour.min}var s=r.getHours();return i.inclusive||u&lh.SECONDS&&r.getSeconds()<e.second.max||u&lh.MINUTES&&r.getMinutes()<e.minute.max?s:s+1}return e.hour.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(t.getFullYear()<r.getFullYear())return e.hour.max;if(t.getMonth()<r.getMonth())return e.hour.max;if(t.getDate()<r.getDate())return e.hour.max}var s=r.getHours();return i.inclusive||u&lh.SECONDS&&e.second.min<r.getSeconds()||u&lh.MINUTES&&e.minute.min<r.getMinutes()?s:s-1}return e.hour.max},t}(),gh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(r.getFullYear()<t.getFullYear())return e.minute.min;if(r.getMonth()<t.getMonth())return e.minute.min;if(r.getDate()<t.getDate())return e.minute.min}if(u&lh.HOURS&&r.getHours()<t.getHours())return e.minute.min;var s=r.getMinutes();return i.inclusive||u&lh.SECONDS&&r.getSeconds()<e.second.max?s:s+1}return e.minute.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(t.getFullYear()<r.getFullYear())return e.minute.max;if(t.getMonth()<r.getMonth())return e.minute.max;if(t.getDate()<r.getDate())return e.minute.max}if(u&lh.HOURS&&t.getHours()<r.getHours())return e.minute.max;var s=r.getMinutes();return i.inclusive||u&lh.SECONDS&&e.second.min<r.getSeconds()?s:s-1}return e.minute.max},t}(),mh=function(){function t(t){this.p=t}return t.prototype.min=function(t){var n=this.p,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(r.getFullYear()<t.getFullYear())return e.second.min;if(r.getMonth()<t.getMonth())return e.second.min;if(r.getDate()<t.getDate())return e.second.min}return u&lh.HOURS&&r.getHours()<t.getHours()||u&lh.MINUTES&&r.getMinutes()<t.getMinutes()?e.second.min:r.getSeconds()+(i.inclusive?0:1)}return e.second.min},t.prototype.max=function(t){var n=this.p,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&lh.DATE){if(t.getFullYear()<r.getFullYear())return e.second.max;if(t.getMonth()<r.getMonth())return e.second.max;if(t.getDate()<r.getDate())return e.second.max}return u&lh.HOURS&&t.getHours()<r.getHours()||u&lh.MINUTES&&t.getMinutes()<r.getMinutes()?e.second.max:r.getSeconds()-(i.inclusive?0:1)}return e.second.max},t}(),wh=function(){function t(t,n){this.constant=this.newConstant(),this.lower=new bh(t&&t.lower,n),this.upper=new bh(t&&t.upper,n),this.mask=lh.ALL,this.hours=new dh(this),this.minutes=new gh(this),this.seconds=new mh(this)}return t.prototype.newConstant=function(){return{second:{min:0,max:59},minute:{min:0,max:59},hour:{min:0,max:23}}},t.prototype.adjust=function(t){var n=this.test(t);if(n<0){var i=this.lower,r=i.date;if(r)return t.setTime(r.getTime()),i.inclusive||((e=this.mask)&lh.SECONDS?t.setSeconds(r.getSeconds()+1):e&lh.MINUTES?t.setMinutes(r.getMinutes()+1):e&lh.HOURS?t.setHours(r.getHours()+1):e&lh.DATE&&t.setDate(r.getDate()+1)),!0}else if(0<n){var e,u=this.upper,s=u.date;if(s)return t.setTime(s.getTime()),u.inclusive||((e=this.mask)&lh.SECONDS?t.setSeconds(s.getSeconds()-1):e&lh.MINUTES?t.setMinutes(s.getMinutes()-1):e&lh.HOURS?t.setHours(s.getHours()-1):e&lh.DATE&&t.setDate(s.getDate()-1)),!0}return!1},t.prototype.compare=function(t,n){var i=this.mask;if(i&lh.DATE){var r,e,u,s,h=t.getFullYear(),o=n.getFullYear();if(h!==o)return h<o?-1:1;if((r=t.getMonth())!==(e=n.getMonth()))return r<e?-1:1;if((u=t.getDate())!==(s=n.getDate()))return u<s?-1:1}if(i&lh.HOURS){var a=t.getHours(),c=n.getHours();if(a!==c)return a<c?-1:1}return i&lh.MINUTES&&(r=t.getMinutes())!==(e=n.getMinutes())?r<e?-1:1:i&lh.SECONDS&&(u=t.getSeconds())!==(s=n.getSeconds())?u<s?-1:1:0},t.prototype.test=function(t){var n=this.lower,i=n.date;if(null!=i){var r=this.compare(i,t);return n.inclusive?r<=0?0:-1:r<0?0:-1}var e=this.upper,u=e.date;return null!=u?(r=this.compare(t,u),e.inclusive?r<=0?0:1:r<0?0:1):0},t.prototype.contains=function(t){return 0===this.test(t)},t}(),ph=function(t,n,i){if(t){var r=t.date,e=t.inclusive;return{date:void 0!==r?r:n,inclusive:void 0!==e?e:i}}return{date:n,inclusive:i}},Oh=function(t){function n(n){var i=t.call(this,n)||this;return i.onNewChange(),i}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n);var e=this.theme;this.Fh=new Date;var u=this.Fh.getTime();this.Uh=new Date(u),this.Gh=new wh(function(t,n){return n?{lower:ph(n.lower,t.getLowerBound(),t.isLowerBoundInclusive()),upper:ph(n.upper,t.getUpperBound(),t.isUpperBoundInclusive())}:{lower:{date:t.getLowerBound(),inclusive:t.isLowerBoundInclusive()},upper:{date:t.getUpperBound(),inclusive:t.isUpperBoundInclusive()}}}(e,null==n?void 0:n.bounds),(function(){r.onNewChange()}));var s=null!==(i=null==n?void 0:n.margin)&&void 0!==i?i:e.getMargin();new Zu({parent:this,x:"padding",y:"padding",width:"auto",height:"auto",margin:s,children:this.newChildren(e,n,s)})},Object.defineProperty(n.prototype,"current",{get:function(){return this.Fh},set:function(t){this.Fh.getTime()!==t.getTime()&&(this.Fh=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.Uh},set:function(t){this.Uh.getTime()!==t.getTime()&&(this.Uh=t,this.onNewChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bounds",{get:function(){return this.Gh},enumerable:!1,configurable:!0}),n.prototype.hasHours=function(){return null!=this.Hh},n.prototype.hasMinutes=function(){return null!=this.zh},n.prototype.hasSeconds=function(){return null!=this.Vh},n.prototype.reset=function(){var t=this.Fh.getTime();this.Uh.setTime(t),this.onReset()},n.prototype.onReset=function(){this.onNewChange()},n.prototype.onNewChange=function(){var t=this.Uh,n=this.Gh;n.adjust(this.Uh);var i=this.Hh;if(i){var r=n.hours;i.value=t.getHours(),i.min=r.min(t),i.max=r.max(t)}var e=this.zh;if(e){var u=n.minutes;e.value=t.getMinutes(),e.min=u.min(t),e.max=u.max(t)}var s=this.Vh;if(s){var h=n.seconds;s.value=t.getSeconds(),s.min=h.min(t),s.max=h.max(t)}},n.prototype.newChildren=function(t,n,i){var r=vh.from(t,n);return this.Gh.mask=r,this.Hh=r&lh.HOURS?this.newInputHours(t,n):null,this.zh=r&lh.MINUTES?this.newInputMinutes(t,n):null,this.Vh=r&lh.SECONDS?this.newInputSeconds(t,n):null,[this.newTimeLayout(this.Hh,this.zh,this.Vh,i)]},n.prototype.newTimeLayout=function(t,n,i,r){var e=this.newTimeLayoutChildren(t,n,i);return 0<e.length?new Cs({width:this.getTimeLayoutWidth(),height:this.getTimeLayoutHeight(),margin:r,children:e}):null},n.prototype.getTimeLayoutWidth=function(){return"auto"},n.prototype.getTimeLayoutHeight=function(){return"auto"},n.prototype.newTimeLayoutChildren=function(t,n,i){var r=[];return null!=t&&r.push(t),null!=n&&(0<r.length&&r.push(this.newMinuteSeparator()),r.push(n)),null!=i&&(0<r.length&&r.push(this.newSecondSeparator()),r.push(i)),r},n.prototype.newMinuteSeparator=function(){return new oh({width:"auto",text:{value:this.getMinuteSeparator()}})},n.prototype.getMinuteSeparator=function(){return":"},n.prototype.newSecondSeparator=function(){return new oh({width:"auto",text:{value:this.getSecondSeparator()}})},n.prototype.getSecondSeparator=function(){return":"},n.prototype.adjustInputOptions=function(t,n,i){return null==n.step&&(n.step=1),null==n.min&&(n.min=0),null==n.max&&(n.max=i),n},n.prototype.newInputHours=function(t,n){var i,r=this,e=null!==(i=null==n?void 0:n.hours)&&void 0!==i?i:t.getHoursOptions(),u=this.Gh.constant.hour.max,s=new Ys(this.adjustInputOptions(t,e,u));return s.on("change",(function(t){r.onHoursChange(t)})),s},n.prototype.onHoursChange=function(t){this.Uh.setHours(t),this.onNewChange()},n.prototype.newInputMinutes=function(t,n){var i=this,r=(null==n?void 0:n.minutes)||t.getMinutesOptions(),e=this.Gh.constant.minute.max,u=new Ys(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onMinutesChange(t)})),u},n.prototype.onMinutesChange=function(t){this.Uh.setMinutes(t),this.onNewChange()},n.prototype.newInputSeconds=function(t,n){var i=this,r=(null==n?void 0:n.seconds)||t.getSecondsOptions(),e=this.Gh.constant.second.max,u=new Ys(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onSecondsChange(t)})),u},n.prototype.onSecondsChange=function(t){this.Uh.setSeconds(t)},n.prototype.getType=function(){return"DPickerTime"},n}(hr),Dh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.Wh=new Date(this.Fh.getTime())},n.prototype.newChildren=function(n,i,r){var e,u;this.Xh=this.newDateButtons(n,i),this.Kh=null!==(u=null===(e=null==i?void 0:i.date)||void 0===e?void 0:e.decorator)&&void 0!==u?u:n.getDateDecorator(),this.Yh=this.newLabel(n,i);var s=t.prototype.newChildren.call(this,n,i,r);return s.unshift(new Cs({width:"100%",height:"auto",children:[this.newBackButton(n,i),this.Yh,this.newNextButton(n,i)]}),new Cs({width:"auto",height:"auto",margin:r,children:this.newDateLabels(n,i)}),new Zu({width:"auto",height:"auto",margin:r,column:7,children:this.Xh})),s},Object.defineProperty(n.prototype,"page",{get:function(){return this.Wh},set:function(t){this.Wh.getTime()!==t.getTime()&&(this.Wh=t,this.onPageChange())},enumerable:!1,configurable:!0}),n.prototype.onReset=function(){this.Wh.setTime(this.Fh.getTime()),t.prototype.onReset.call(this)},n.prototype.next=function(){var t=this.Wh;t.setFullYear(t.getFullYear(),t.getMonth()+1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.back=function(){var t=this.Wh;t.setFullYear(t.getFullYear(),t.getMonth()-1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.onNewChange=function(){this.Gh.adjust(this.Wh),t.prototype.onNewChange.call(this),this.onPageChange()},n.prototype.onPageChange=function(){var t=this.Xh,n=this.Gh,i=this.Wh,r=this.Uh,e=new Date(i.getTime());e.setDate(1),e.setHours(0,0,0,0);for(var u=this.theme,s=(e.getDay()-u.getDayStart()+7)%7,h=0;h<s;++h)t[h].show();for(h=s;h<7;++h)t[h].hide();var o=this.Kh;e.setFullYear(e.getFullYear(),e.getMonth()+1,0);var a=e.getDate(),c=r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()?r.getDate():0;for(h=0;h<a;++h)e.setDate(h+1),(f=t[h+7]).state.isActive=c===h+1,f.state.isDisabled=!n.contains(e),f.show(),o(e,f);for(h=a;h<31;++h){var f;(f=t[h+7]).state.isActive=!1,f.hide()}e.setTime(i.getTime()),this.Yh.text=e},n.prototype.adjustInputOptions=function(n,i,r){return null==i.weight&&(i.weight=1),t.prototype.adjustInputOptions.call(this,n,i,r)},n.prototype.getTimeLayoutWidth=function(){return"100%"},n.prototype.toLabelOptions=function(t,n){var i=n&&n.label||{};void 0===i.weight&&(i.weight=1),void 0===i.padding&&(i.padding=0);var r=i.text=i.text||{},e=r.align=r.align||{};return void 0===e.horizontal&&(e.horizontal="CENTER"),void 0===r.formatter&&(r.formatter=t.getLabelFormatter()),i},n.prototype.newLabel=function(t,n){return new ah(this.toLabelOptions(t,n))},n.prototype.newBackButton=function(t,n){var i=this,r=null==n?void 0:n.back;if(void 0===r&&(r=t.getBackButtonOptions()),null!=r){var e=new uh(r);return e.on("active",(function(){i.back()})),e}return null},n.prototype.newNextButton=function(t,n){var i=this,r=null==n?void 0:n.next;if(void 0===r&&(r=t.getNextButtonOptions()),null!=r){var e=new hh(r);return e.on("active",(function(){i.next()})),e}return null},n.prototype.newDateLabels=function(t,n){for(var i=t.getDayLabels(),r=t.getDayStart(),e=[],u=0;u<7;++u){var s=i[(r+u)%7];e.push(this.newDateLabel(t,n,s))}return e},n.prototype.newDateLabel=function(t,n,i){return new ch({text:{value:i}})},n.prototype.newDateButtons=function(t,n){for(var i=[],r=0;r<7;++r)i.push(this.newSpace(t,n));for(r=1;r<=31;++r)i.push(this.newDateButton(t,n,r));return i},n.prototype.newSpace=function(t,n){return new fh},n.prototype.newDateButton=function(t,n,i){var r=this;return new sh({text:{value:String(i)},on:{active:function(){r.onDateButtonClicked(i)}}})},n.prototype.onDateButtonClicked=function(t){var n=this.Uh;if(n.getDate()!==t){var i=this.Wh;n.setFullYear(i.getFullYear()),n.setMonth(i.getMonth()),n.setDate(t),this.onNewChange()}},n.prototype.getType=function(){return"DPickerDatetime"},n}(Oh),Eh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new Dh(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDatetime"},n}(eh),Mh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=n.DIALOG;return null==h&&(h=new Eh,n.DIALOG=h),h.new=h.current=this.toDate(r),h.open(t).then((function(t){return t.toISOString()}))},n.prototype.toDate=function(t){return Ot(t)||pt(t)?new Date(t):t instanceof Date?t:new Date},n}(Hs),Sh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new Oh(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogTime"},n}(eh),Th=function(t){return t!=t},jh=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new Sh,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){if(pt(t))return new Date(t);if(Ot(t)){var n=new Date,i=this.getPattern().exec(t);if(null!=i){var r=this.toHours(i[1]);null!=r&&n.setHours(r);var e=this.toMinutes(i[2]);null!=e&&n.setMinutes(e);var u=this.toSeconds(i[3]);null!=u&&n.setSeconds(u);var s=this.toMilliseconds(i[4]);null!=s&&n.setMilliseconds(s)}return n}return t instanceof Date?t:new Date},n.prototype.toHours=function(t){return this.toNumber(t,0,23)},n.prototype.toMinutes=function(t){return this.toNumber(t,0,59)},n.prototype.toSeconds=function(t){return this.toNumber(t,0,59)},n.prototype.toMilliseconds=function(t){var n=this.toNumber(t,0,999);if(null!=n){var i=t.length;return 1===i?100*n:2===i?10*n:n}return n},n.prototype.toNumber=function(t,n,i){if(null!=t){var r=+t;if(!Th(r))return Math.min(i,Math.max(n,r))}return null},n.prototype.getPattern=function(){var t=n.PATTERN;return null==t&&(t=this.newPattern(),n.PATTERN=t),t},n.prototype.newPattern=function(){return/^\s*(?:(\d+)(?::(\d+)(?::(\d+))?)?)?(?:\.(\d+))?\s*$/},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return Mi.create("%Hm")},n}(Hs),Nh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDate"},n}(Dh),Ih=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new Nh(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDate"},n}(eh),Ch=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=vn.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i,r,e,u,s){var h=this,o=n.DIALOG;return null==o&&(o=new Ih,n.DIALOG=o),o.new=o.current=this.toDate(r),o.open(t).then((function(t){return h.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){return Ot(t)||pt(t)?new Date(t):t instanceof Date?t:new Date},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return Mi.create("%Y-%M-%D")},n}(Hs),Ah={TEXT:0,INTEGER:1,REAL:2,BOOLEAN:3,DATE:4,TIME:5,DATETIME:6,EXTENSION:1e3},Rh=function(t){function n(n,i,r,e,u,s,h,o){var a=t.call(this,jn.OPEN,n,yu.DIALOG)||this;return a.target=i,a.onInputAction=r,a.initial=e,a.step=u,a.min=s,a.max=h,a.dialogType=o,a}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.dialogType===i.dialogType&&this.onInputAction===i.onInputAction&&this.initial===i.initial&&this.step===i.step&&this.min===i.min&&this.max===i.max},n.prototype.toRuntime=function(){switch(this.dialogType){case Ah.TEXT:return new ih(this);case Ah.INTEGER:return new Zs(this);case Ah.REAL:return new $s(this);case Ah.BOOLEAN:return new zs(this);case Ah.DATE:return new Ch(this);case Ah.TIME:return new jh(this);case Ah.DATETIME:return new Mh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.initial),e=t.addResource(this.step),u=t.addResource(this.min),s=t.addResource(this.max);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(this.onInputAction,",").concat(r,",").concat(this.dialogType,",").concat(e,",").concat(u,",").concat(s,"]"))},n.deserialize=function(t,i){var r=i.resources,e=Nn.toResource(1,t,r),u=Nn.toResource(3,t,r),s=Nn.toResource(5,t,r),h=Nn.toResource(7,t,r),o=Nn.toResource(8,t,r),a=Nn.toResource(9,t,r);return new n(e,u,t[4],s,h,o,a,this.toDialogType(t))},n.toDialogType=function(t){if(t[2]===yu.DIALOG)return t[6];switch(t[2]){case yu.DIALOG_TEXT:return Ah.TEXT;case yu.DIALOG_INTEGER:return Ah.INTEGER;case yu.DIALOG_REAL:return Ah.REAL;case yu.DIALOG_BOOLEAN:return Ah.BOOLEAN;case yu.DIALOG_DATE:return Ah.DATE;case yu.DIALOG_TIME:return Ah.TIME;case yu.DIALOG_DATETIME:return Ah.DATETIME}},n}(Tn),kh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.Zh)&&void 0!==n?n:this.Zh=new Map).set(t.type,t),(null!==(i=this.Xt)&&void 0!==i?i:this.Xt=[]).push(t)},t.get=function(t){var n=this.Zh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Xt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Lh=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;i.target=vn.ofStringOrNull(n.target),i.argument=vn.ofUnknown(n.argument);var r=kh.get(n.dialogType);return r&&(i.opener=r.opener),i}return _(n,t),n.prototype.execute=function(t,n,i){var r=this.opener;if(r&&this.condition(t,i,ln)){var e=this.target(t,i,ln);if(null!=e){var u=this.argument(t,i,ln);setTimeout((function(){r(e,u,t)}),0)}}},n}(dn),yh=function(t){function n(n,i,r,e){var u=t.call(this,jn.OPEN,n,yu.DIALOG)||this;return u.target=i,u.argument=r,u.dialogType=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.argument===i.argument&&this.dialogType===i.dialogType},n.prototype.toRuntime=function(){return new Lh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.argument);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",0,-1,").concat(this.dialogType,",").concat(r,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),Nn.toResource(3,t,i.resources),Nn.toResource(7,t,i.resources),t[6])},n}(Tn),xh=function(){function t(){}return t.add=function(t){var n,i;(null!==(n=this.Zh)&&void 0!==n?n:this.Zh=new Map).set(t.type,t),(null!==(i=this.Xt)&&void 0!==i?i:this.Xt=[]).push(t),Ze[t.type]=t.opener},t.get=function(t){var n=this.Zh;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Xt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Bh=function(t){function n(n,i,r,e){var u=t.call(this,jn.OPEN,i,n)||this;return u.target=r,u.inNewWindow=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.inNewWindow===i.inNewWindow},n.prototype.toRuntime=function(){return new Lu(this,this.subtype)},n.prototype.toLabel=function(){var t=this.getTheme().toTypeLabel(this.type),n=xh.get(this.subtype);return"".concat(t,": ").concat(null!=n?n.label:"Unknown")},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=this.inNewWindow?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(3,t,i.resources);return new n(t[2],r,e,!!t[4])},n}(Tn),_h={SHAPE_SHOW:0,SHAPE_HIDE:1,SHAPE:2,LAYER:3},Ph=function(t){function n(n){var i=t.call(this,n,cn.VISIBILITY)||this;return i.visibility=n.subtype===_h.SHAPE_SHOW,i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i,ln)&&(t.visible=this.visibility,n.written|=this.reset)},n}(dn),Fh=function(t){function n(n,i){return t.call(this,jn.SHOW_HIDE,i,n)||this}return _(n,t),n.prototype.toRuntime=function(){return new Ph(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources);return new n(t[2],r)},n}(Tn),Uh=function(t){function n(n){var i=t.call(this,n,cn.NONE)||this;return i.Xt=new Map,i.Tu=n.layers,i.qh=n.bringToFront,i}return _(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i);var r=this.Xt.get(n);null==r&&null!=(r=this.newData(n))&&this.Xt.set(n,r)},n.prototype.execute=function(t,n,i){var r=this.Xt.get(t);if(r){var e=this.condition(t,i,ln);if(r.condition!==e){r.condition=e;var u=r.layers;e?r.bringToFront?(_e.bringAllToFront(u),_e.showAll(u)):_e.showAll(u):_e.hideAll(u)}}},n.prototype.newData=function(t){var n=_e.toLayers(t,this.Tu);if(0<n.length)return{layers:n,bringToFront:this.qh,condition:null}},n}(dn),Gh=function(t){function n(n,i,r){var e=t.call(this,jn.SHOW_HIDE,n,_h.LAYER)||this;return e.layers=i,e.bringToFront=r,e}return _(n,t),n.prototype.toRuntime=function(){return new Uh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=this.serializeLayers(t),r=this.bringToFront?1:0;return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(i,",").concat(r,"]"))},n.prototype.serializeLayers=function(t){for(var n=this.layers,i="[",r="",e=0,u=n.length;e<u;++e)i+=r+n[e],r=",";return i+="]",t.addResource(i)},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources),this.deserializeLayers(t[3],i),!!t[4])},n.deserializeLayers=function(t,n){var i=n.resources,r=i.length;return 0<=t&&t<r?JSON.parse(i[t]):[]},n}(Tn),Hh=function(t){function n(n){return t.call(this,n,cn.VISIBILITY)||this}return _(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i)},n.prototype.execute=function(t,n,i){t.visible=this.condition(t,i,ln),n.written|=this.reset},n}(dn),zh=function(t){function n(n){return t.call(this,jn.SHOW_HIDE,n,_h.SHAPE)||this}return _(n,t),n.prototype.toRuntime=function(){return new Hh(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,"]"))},n.deserialize=function(t,i){return new n(Nn.toResource(1,t,i.resources))},n}(Tn),Vh=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.amount=vn.ofNumber(n.amount),r}return _(n,t),n}(dn),Wh=function(t){function n(n){return t.call(this,n,cn.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln);t.transform.position.x=r,n.written|=this.reset}},n}(Vh),Xh=function(t){function n(n){return t.call(this,n,cn.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln);t.transform.position.y=r,n.written|=this.reset}},n}(Vh),Kh=function(t){function n(n){return t.call(this,n,cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=e.position,s=!!(n.written&cn.POSITION_X),h=!!(n.written&cn.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o-c.c*r,a-c.d*r),n.written|=this.reset}},n}(Vh),Yh=function(t){function n(n){return t.call(this,n,cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=e.position,s=!!(n.written&cn.POSITION_X),h=!!(n.written&cn.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o+c.a*r,a+c.b*r),n.written|=this.reset}},n}(Vh),Jh=function(t){function n(n){return t.call(this,n,cn.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=!!(n.written&cn.POSITION_X),u=t.transform.position,s=e?u.x:n.x;u.x=s+r,n.written|=this.reset}},n}(Vh),Zh=function(t){function n(n){return t.call(this,n,cn.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=!!(n.written&cn.POSITION_Y),u=t.transform.position,s=e?u.y:n.y;u.y=s+r,n.written|=this.reset}},n}(Vh),qh=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r)||this;return u.opetype=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.opetype===i.opetype},n}(Tn),Qh={RELATIVE_X:0,RELATIVE_Y:1,ABSOLUTE_X:2,ABSOLUTE_Y:3,FORWARD_OR_BACKWARD:4,LEFT_OR_RIGHT:5},$h={RESIZE:0,MOVE:1,ROTATE:2},to=function(t){function n(n,i,r){var e=t.call(this,jn.TRANSFORM,i,$h.MOVE,n)||this;return e.amount=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case Qh.ABSOLUTE_X:return new Wh(this);case Qh.ABSOLUTE_Y:return new Xh(this);case Qh.FORWARD_OR_BACKWARD:return new Kh(this);case Qh.LEFT_OR_RIGHT:return new Yh(this);case Qh.RELATIVE_X:return new Jh(this);case Qh.RELATIVE_Y:return new Zh(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(4,t,i.resources);return new n(t[3],r,e)},n}(qh),no={RELATIVE_SIZE:0,RELATIVE_HEIGHT:1,RELATIVE_WIDTH:2,ABSOLUTE_SIZE:3,ABSOLUTE_HEIGHT:4,ABSOLUTE_WIDTH:5},io=function(t){function n(n,i){var r=t.call(this,n,i)||this;switch(n.opetype){case no.RELATIVE_SIZE:r.size=vn.ofNumberOrOne(n.amount);break;case no.ABSOLUTE_SIZE:r.size=vn.ofNumberOrOneHundred(n.amount);break;case no.RELATIVE_HEIGHT:r.size=vn.ofNumberOrOne(n.amount);break;case no.ABSOLUTE_HEIGHT:r.size=vn.ofNumberOrOneHundred(n.amount);break;case no.RELATIVE_WIDTH:r.size=vn.ofNumberOrOne(n.amount);break;case no.ABSOLUTE_WIDTH:r.size=vn.ofNumberOrOneHundred(n.amount);break;default:r.size=vn.ONE}return r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=(-.5+e)*i,h=(-.5+u)*r;t.updateTransform();var o=t.transform,a=o.position,c=o.localTransform,f=!!(n.written&cn.POSITION_X),l=!!(n.written&cn.POSITION_Y),v=f?a.x:n.x,b=l?a.y:n.y;n.written|=cn.POSITION,a.set(v+s*c.a+h*c.c,b+s*c.b+h*c.d)},n}(dn),ro=function(t){function n(n){var i=t.call(this,n,cn.HEIGHT|cn.POSITION)||this;return i.origin=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.HEIGHT?e.y:n.sizeY;e.y=Ir(r),n.written|=cn.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(io),eo=function(t){function n(n){var i=t.call(this,n,cn.HEIGHT|cn.POSITION)||this;return i.origin=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.HEIGHT?e.y:n.sizeY;e.y=Ir(u*r),n.written|=cn.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(io),uo=function(t){function n(n){var i=t.call(this,n,cn.SIZE|cn.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=Ir(this.size(t,i,ln)),e=t.size,u=!!(n.written&cn.WIDTH),s=!!(n.written&cn.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(r,r),n.written|=cn.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(io),so=function(t){function n(n){var i=t.call(this,n,cn.SIZE|cn.POSITION)||this;return i.originX=n.originX,i.originY=n.originY,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=!!(n.written&cn.WIDTH),s=!!(n.written&cn.HEIGHT),h=u?e.x:n.sizeX,o=s?e.y:n.sizeY;e.set(Ir(h*r),Ir(o*r)),n.written|=cn.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(io),ho=function(t){function n(n){var i=t.call(this,n,cn.WIDTH|cn.POSITION)||this;return i.origin=n.originX,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.WIDTH?e.x:n.sizeX;e.x=Ir(r),n.written|=cn.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(io),oo=function(t){function n(n){var i=t.call(this,n,cn.WIDTH|cn.POSITION)||this;return i.origin=n.originX,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.size(t,i,ln),e=t.size,u=n.written&cn.WIDTH?e.x:n.sizeX;e.x=Ir(u*r),n.written|=cn.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(io),ao=function(t){function n(n,i,r,e,u){var s=t.call(this,jn.TRANSFORM,i,$h.RESIZE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case no.ABSOLUTE_HEIGHT:return new ro(this);case no.ABSOLUTE_WIDTH:return new ho(this);case no.ABSOLUTE_SIZE:return new uo(this);case no.RELATIVE_HEIGHT:return new eo(this);case no.RELATIVE_WIDTH:return new oo(this);case no.RELATIVE_SIZE:return new so(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(qh),co=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.originX=n.originX,r.originY=n.originY,r.amount=vn.ofNumber("(".concat(n.amount,") * (Math.PI / 180)")),r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=!!(n.written&cn.WIDTH),h=!!(n.written&cn.HEIGHT),o=(-.5+e)*(s?t.size.x:n.sizeX),a=(-.5+u)*(h?t.size.y:n.sizeY),c=Math.sin(i)-Math.sin(r),f=Math.cos(i)-Math.cos(r),l=t.transform.position,v=!!(n.written&cn.POSITION_X),b=!!(n.written&cn.POSITION_Y),d=v?l.x:n.x,g=b?l.y:n.y;n.written|=cn.POSITION,l.set(d+o*f-a*c,g+o*c+a*f)},n}(dn),fo=function(t){function n(n){return t.call(this,n,cn.ROTATION|cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=n.written&cn.ROTATION?e.rotation:n.rotation;e.rotation=r,n.written|=cn.ROTATION,this.adjustPosition(t,n,u,r,this.originX,this.originY)}},n}(co),lo=function(t){function n(n){return t.call(this,n,cn.ROTATION|cn.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i,ln)){var r=this.amount(t,i,ln),e=t.transform,u=n.written&cn.ROTATION?e.rotation:n.rotation;e.rotation=u+r,n.written|=cn.ROTATION,this.adjustPosition(t,n,u,e.rotation,this.originX,this.originY)}},n}(co),vo={RELATIVE:0,ABSOLUTE:1},bo=function(t){function n(n,i,r,e,u){var s=t.call(this,jn.TRANSFORM,i,$h.ROTATE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case vo.ABSOLUTE:return new fo(this);case vo.RELATIVE:return new lo(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("[".concat(this.type,",").concat(n,",").concat(this.subtype,",").concat(this.opetype,",").concat(this.originX,",").concat(this.originY,",").concat(i,"]"))},n.deserialize=function(t,i){var r=Nn.toResource(1,t,i.resources),e=Nn.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(qh),go=function(t,n){switch(t[0]){case jn.SHOW_HIDE:switch(t[2]){case _h.SHAPE_SHOW:case _h.SHAPE_HIDE:return Fh.deserialize(t,n);case _h.SHAPE:return zh.deserialize(t,n);case _h.LAYER:return Gh.deserialize(t,n)}break;case jn.BLINK:return In.deserialize(t,n);case jn.CHANGE_COLOR:case jn.CHANGE_COLOR_LEGACY:switch(t[3]){case Rn.COLOR_AND_ALPHA:case Rn.COLOR:case Rn.ALPHA:return Bn.deserialize(t,n);case Rn.CODE:return Un.deserialize(t,n);case Rn.BRIGHTNESS:return Pn.deserialize(t,n)}break;case jn.CHANGE_TEXT:return Ni.deserialize(t,n);case jn.CHANGE_CURSOR:return Hn.deserialize(t,n);case jn.EMIT_EVENT:return $e.deserialize(t,n);case jn.OPEN:switch(t[2]){case yu.DIALOG_TEXT:case yu.DIALOG_INTEGER:case yu.DIALOG_REAL:case yu.DIALOG_BOOLEAN:case yu.DIALOG_DATE:case yu.DIALOG_TIME:case yu.DIALOG_DATETIME:case yu.DIALOG:return Ah.EXTENSION<=t[6]?yh.deserialize(t,n):Rh.deserialize(t,n);case yu.DIAGRAM_LEGACY:case yu.PAGE_LEGACY:case yu.PAGE_INPLACE_LEGACY:case yu.DIAGRAM:case yu.PAGE:return xu.deserialize(t,n);default:if(yu.EXTENSION<=t[2])return Bh.deserialize(t,n)}break;case jn.TRANSFORM:switch(t[2]){case $h.MOVE:return to.deserialize(t,n);case $h.RESIZE:return ao.deserialize(t,n);case $h.ROTATE:return bo.deserialize(t,n)}break;case jn.GESTURE:return We.deserialize(t,n);case jn.MISC:switch(t[2]){case Ve.GESTURE:return We.deserialize(t,n);case Ve.SHOW_HIDE_LAYER:return Gh.deserialize(t,n);case Ve.GESTURE_LAYER:return We.deserialize(t,n);case Ve.EXECUTE:return ku.deserialize(t,n);default:return Au.deserialize(t,n)}}return null},mo={},wo=function(t){try{var n=JSON.parse(t);return mt(n)&&2<=n.length?n:null}catch(t){return null}},po=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];Ot(e)&&(i.gradient=function(t){var n=function(t){try{return JSON.parse(t)}catch(t){return null}}(t);if(!(null==n||n.length<7)){for(var i=n[0],r=[],e=1,u=n.length;e<u;e+=3)r.push({color:n[e+0],alpha:n[e+1],position:n[e+2]});return{points:r,direction:i}}}(e))}},Oo={},Do=function(t){var n=Oo[t];if(null!=n)return n instanceof HTMLImageElement?Promise.resolve(n):n;var i=new Promise((function(n,i){var r=document.createElement("img");r.onload=function(){Oo[t]=r,n(r)},r.onabort=r.onerror=function(){i()},r.src=t}));return Oo[t]=i,i},Eo=function(t,n,i){var r=n.resources;i.id=r[t[1]]||"";var e=i.transform;e.position.set(t[2],t[3]),e.rotation=t[6],e.skew.set(t[7],t[7]),e.pivot.set(t[21],t[22]),i.size.set(Ir(t[4]),Ir(t[5])),i.fill.deserialize(t[8],n),i.stroke.deserialize(t[9],n);var u=t[10];i.cursor=0<=u?r[u]:void 0,i.text.deserialize(t[11],n),i.data.deserialize(t[12],n),i.radius=t[13],i.corner=t[14];var s=t[23];i.interactive=!!(1&s);var h=i.state;h.isFocusable=!(2&s),h.isActive=!!(4&s);var o=t[24];i.shortcut=0<=o?r[o]:void 0;var a=t[25];i.title=0<=a?r[a]:void 0;var c=t[26];i.uuid=null!=c?c:0;var f=t[27],l=t[28],v=t[29];(null!=f&&f!==Ct.NONE||null!=l&&l!==Ct.NONE||null!=v&&v!==Ct.NONE)&&i.capability.set(f,l,v);var b=function(t,n,i){if(0<t.length){for(var r=[],e=0,u=t.length;e<u;++e)r.push(Pr(t[e],n));return Promise.all(r).then((function(t){i.children=t;for(var n=0,r=t.length;n<r;++n)t[n].parent=i;return i.onChildTransformChange(),i.toDirty(),i}))}return null}(t[20],n,i);!function(t,n,i){for(var r=i.action,e=n.resources,u=0,s=t.length;u<s;++u){var h=t[u],o=n.getAction(h);if(null!=o)r.add(o);else{var a=e[h];if(null!=a){var c=wo(a);if(null!=c&&0<c.length){var f=c[0],l=jn.EXTENSION<=f?mo[f]:go;if(null!=l){var v=l(c,n);null!=v&&(n.setAction(h,v),r.add(v))}}}}}}(t[17],n,i),po(t[19],n,i);var d=function(t,n,i){var r=n.resources;if(0<=t&&t<r.length){var e=r[t];if(Ot(e))return Do(e).then((function(t){return i.image=t,i}))}return null}(t[18],n,i);return null!=b?null!=d?Promise.all([b,d]).then((function(){return i})):b:null!=d?d:i},Mo=function(t,n,i){i=i||new en;var r=Eo(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=z.NON_SCALING_MASK|z.DOTTED_MASK|z.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},So=function(){e[r.BAR]=hn,n[r.BAR]=Mo},To={},jo=36,No=[0,0,0],Io=new t.Point,Co=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+2,t[++r]=n+1,t[++r]=n+3,t[++r]=n+2,t[++r]=n+4,t[++r]=n+5,t[++r]=n+6,t[++r]=n+5,t[++r]=n+7,t[++r]=n+6,t[++r]=n+8,t[++r]=n+9,t[++r]=n+10,t[++r]=n+9,t[++r]=n+11,t[++r]=n+10,t[++r]=n+12,t[++r]=n+13,t[++r]=n+14,t[++r]=n+13,t[++r]=n+15,t[++r]=n+14,t[++r]=n+16,t[++r]=n+17,t[++r]=n+20,t[++r]=n+17,t[++r]=n+21,t[++r]=n+20,t[++r]=n+17,t[++r]=n+18,t[++r]=n+21,t[++r]=n+18,t[++r]=n+22,t[++r]=n+21,t[++r]=n+19,t[++r]=n+21,t[++r]=n+24,t[++r]=n+21,t[++r]=n+25,t[++r]=n+24,t[++r]=n+21,t[++r]=n+23,t[++r]=n+26,t[++r]=n+23,t[++r]=n+27,t[++r]=n+26,t[++r]=n+24,t[++r]=n+25,t[++r]=n+28,t[++r]=n+25,t[++r]=n+30,t[++r]=n+28,t[++r]=n+26,t[++r]=n+27,t[++r]=n+30,t[++r]=n+27,t[++r]=n+32,t[++r]=n+30,t[++r]=n+29,t[++r]=n+30,t[++r]=n+33,t[++r]=n+30,t[++r]=n+34,t[++r]=n+33,t[++r]=n+30,t[++r]=n+31,t[++r]=n+34,t[++r]=n+31,t[++r]=n+35,t[++r]=n+34},Ao=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.abs(l),d=Math.abs(v),g=o*Math.min(b,d),m=g/b,w=g/d,p=Io;p.set(i-l,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r-v),a.apply(p,p);var M=p.x,S=p.y,T=M-D,j=S-E,N=m*T,I=m*j,C=D+N,A=E+I,R=M+T,k=S+j,L=R-N,y=k-I;p.set(i,r),a.apply(p,p);var x=p.x,B=p.y,_=x-M,P=B-S,F=w*_,U=w*P,G=M+F,H=S+U,z=G-T,V=H-j,W=z+N,X=V+I,K=G+T,Y=H+j,J=K-N,Z=Y-I,q=x-T,Q=B-j,$=x+T,tt=B+j,nt=x+_,it=B+P,rt=nt-F,et=it-U,ut=rt-T,st=et-j,ht=ut+N,ot=st+I,at=rt+T,ct=et+j,ft=at-N,lt=ct-I,vt=nt-T,bt=it-j,dt=vt+N,gt=bt+I,mt=nt+T,wt=it+j,pt=mt-N,Ot=wt-I;c[0]=O(D,E,C,A),c[1]=O(D,E,M,S),c[2]=O(D,E,q,Q);var Dt=2*n-1;t[++Dt]=D,t[++Dt]=E,t[++Dt]=C,t[++Dt]=A,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=L,t[++Dt]=y,t[++Dt]=R,t[++Dt]=k,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=vt,t[++Dt]=bt,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=pt,t[++Dt]=Ot,t[++Dt]=mt,t[++Dt]=wt,t[++Dt]=C,t[++Dt]=A,t[++Dt]=M,t[++Dt]=S,t[++Dt]=L,t[++Dt]=y,t[++Dt]=z,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=G,t[++Dt]=H,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=q,t[++Dt]=Q,t[++Dt]=x,t[++Dt]=B,t[++Dt]=x,t[++Dt]=B,t[++Dt]=$,t[++Dt]=tt,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=rt,t[++Dt]=et,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=nt,t[++Dt]=it,t[++Dt]=pt,t[++Dt]=Ot},Ro=function(t,n,i,r){var e=3*n-1,u=1-r[0]/r[1],s=1-r[0]/r[2];i&ut.TOP_LEFT?(t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1):(t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0),i&ut.TOP_RIGHT?(t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1):(t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0),i&ut.BOTTOM_LEFT?(t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&ut.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0),t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0},ko=function(t,n,i,r,e,u,s){var h,a,c,f,l,v,b,d,g,m,w,p,O=o(e),D=s[0],E=s[1],M=s[2],S=Math.max(0,1-s[0]/s[1]),T=Math.max(0,1-s[0]/s[2]);r&qt.TOP?(h=2,a=1,c=1+T):(h=-2,a=-1,c=-1-T),r&qt.RIGHT?(f=2,l=1,v=1+S):(f=-2,l=-1,v=-1-S),r&qt.BOTTOM?(b=2,d=1,g=1+T):(b=-2,d=-1,g=-1-T),r&qt.LEFT?(m=2,w=1,p=1+S):(m=-2,w=-1,p=-1-S);var j=6*n-1;u&ut.TOP_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c),u&ut.TOP_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c),u&ut.BOTTOM_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b),u&ut.BOTTOM_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=b),t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b},Lo=function(t,n,i,r){var e=i.x0,u=i.x1,s=i.x2,h=i.x3,o=i.y0,a=i.y1,c=i.y2,f=i.y3,l=.5*(e+u),v=.5*(o+a),b=.5*(h+s),d=.5*(f+c),g=.5*r[0]/r[1],m=.5*r[0]/r[2],w=g*(u-e),p=g*(a-o),O=m*(h-e),D=m*(f-o),E=2*n-1;t[++E]=e,t[++E]=o,t[++E]=e+w,t[++E]=o+p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+w+O,t[++E]=o+p+D,t[++E]=u-w,t[++E]=a-p,t[++E]=u,t[++E]=a,t[++E]=u-w+O,t[++E]=a-p+D,t[++E]=u+O,t[++E]=a+D,t[++E]=h-O,t[++E]=f-D,t[++E]=h+w-O,t[++E]=f+p-D,t[++E]=h,t[++E]=f,t[++E]=h+w,t[++E]=f+p,t[++E]=s-w-O,t[++E]=c-p-D,t[++E]=s-O,t[++E]=c-D,t[++E]=s-w,t[++E]=c-p,t[++E]=s,t[++E]=c,t[++E]=e+w,t[++E]=o+p,t[++E]=l,t[++E]=v,t[++E]=u-w,t[++E]=a-p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+O+w,t[++E]=o+D+p,t[++E]=l+O,t[++E]=v+D,t[++E]=u+O-w,t[++E]=a+D-p,t[++E]=u+O,t[++E]=a+D;var M=.5*(e+s),S=.5*(o+c);t[++E]=.5*(e+h),t[++E]=.5*(o+f),t[++E]=M,t[++E]=S,t[++E]=M,t[++E]=S,t[++E]=.5*(u+s),t[++E]=.5*(a+c),t[++E]=h-O,t[++E]=f-D,t[++E]=h-O+w,t[++E]=f-D+p,t[++E]=b-O,t[++E]=d-D,t[++E]=s-O-w,t[++E]=c-D-p,t[++E]=s-O,t[++E]=c-D,t[++E]=h+w,t[++E]=f+p,t[++E]=b,t[++E]=d,t[++E]=s-w,t[++E]=c-p},yo=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Co(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=n.radius,s=r!==this.sizeX||e!==this.sizeY||u!==this.radius,h=X(n),o=this.transformLocalId!==h,a=n.stroke,c=a.align,f=a.enable?a.width:0,l=a.side,v=a.style,b=this.strokeAlign!==c||this.strokeWidth!==f||this.strokeSide!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=K(n),w=Y(m),p=m!==this.texture||w!==this.textureTransformId,O=s||b;if(O||o||g||p){this.sizeX=r,this.sizeY=e,this.radius=u,this.transformLocalId=h,this.strokeAlign=c,this.strokeWidth=f,this.strokeSide=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Ao(t.vertices,D,0,0,r,e,c,f,u,n.transform.internalTransform,No),(O||g||o)&&(t.updateSteps(),ko(t.steps,D,f,l,v,d,No)),(O||g)&&(t.updateClippings(),Ro(t.clippings,D,d,No)),(O||p)&&(t.updateUvs(),Lo(t.uvs,D,J(m),No))}},n}(W),xo=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=jo+h,c=24+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new yo(i,r,a-h,c-o),new sn(i+jo,r+24,h,o)]).init(n):null},Bo=function(t,n,i,r,e){return xo(t,n,i,r)},_o=function(t,n,i,r,e,u){var s=-i+e;if(t<=s)return n<=(h=-r+e)&&u&ut.TOP_LEFT?(a=t-s)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&ut.BOTTOM_LEFT?(a=t-s)*a+(c=n-o)*c<=e*e:-i<=t;var h,o,a,c,f=+i-e;return f<=t?n<=(h=-r+e)&&u&ut.TOP_RIGHT?(a=t-f)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&ut.BOTTOM_RIGHT?(a=t-f)*a+(c=n-o)*c<=e*e:t<=+i:-r<=n&&n<=+r},Po=function(t,n,i,r,e,u,s){var h=t.fill;if(h.enable||0<u){var o=t.radius*Math.min(r,e),a=t.corner;if(_o(n,i,r,e,o,a)){if(h.enable)return!0;var c=u*s,f=Math.max(0,r-c),l=Math.max(0,e-c),v=Math.max(0,o-c);if(!_o(n,i,f,l,v,a)){var b=t.stroke.side;if(b===qt.ALL)return!0;if(n<=-f+v){var d=!!(b&qt.LEFT);return i<=-l+v?!(!(g=!!(b&qt.TOP))||!d)||(g?-f<=i:!!d&&n<=-f):+l-v<=i?!(!(m=!!(b&qt.BOTTOM))||!d)||(m?+f<=i:!!d&&n<=-f):d}if(+f-v<=n){var g,m,w=!!(b&qt.RIGHT);return i<=-l+v?!(!(g=!!(b&qt.TOP))||!w)||(g?-f<=i:!!w&&+f<=n):+l-v<=i?!(!(m=!!(b&qt.BOTTOM))||!w)||(m?+f<=i:!!w&&+f<=n):w}return i<=-l+v?!!(b&qt.TOP):+l-v<=i&&!!(b&qt.BOTTOM)}}}return!1},Fo=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Po(this,n,i,r,e,u,s)},n}(Jt),Uo=function(t){function n(n){void 0===n&&(n=r.BUTTON);var i=t.call(this,n)||this;return i.wh=!1,i.Oh=!1,i}return _(n,t),Object.defineProperty(n.prototype,"isToggle",{get:function(){return this.wh},set:function(t){this.wh=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return this.Oh},set:function(t){this.Oh=t},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.wh?1:0,e=this.Oh?2:0;return i[15]=n.addResource("[".concat(r|e,"]")),i},n}(Fo),Go=function(t,n,i){i=i||new Uo;var r=n.resources,e=t[15];if(0<=e&&e<r.length){var u=n.getExtension(e);null==u&&(u=JSON.parse(r[e]),n.setExtension(e,u)),i.isToggle=!!(1&u[0]),i.isGrouped=!!(2&u[0])}return Eo(t,n,i)},Ho=function(t){function n(n){var i=t.call(this,cn.COLOR_FILL_AND_STROKE|cn.COLOR_TEXT|cn.COLOR_TEXT_OUTLINE|cn.CURSOR)||this,r=n.fill,e=r.color,u=i.toOnHovered(e),s=2*u;i.Qh=e,i.$h=an.toGrayscale(e),i.no=an.darken(e,s),i.io=an.darken(e,u);var h=r.alpha;i.ro=h,i.eo=.5*h;var o=n.stroke,a=o.color,c=i.toOnHovered(a),f=2*c;i.uo=a,i.so=an.toGrayscale(a),i.ho=an.darken(a,f),i.oo=an.darken(a,c);var l=o.alpha;i.ao=l,i.co=.5*l;var v=n.text,b=v.color;i.ah=b,i.fo=an.toGrayscale(b);var d=v.alpha;i.fh=d,i.lo=.5*d;var g=v.outline,m=g.color;i.vo=m,i.bo=an.toGrayscale(m);var w=g.alpha;return i.do=w,i.mo=.5*w,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=an.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.$h:t.isPressed||t.isActive?this.no:t.isFocused||t.isHovered?this.io:this.Qh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.eo:this.ro},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.so:t.isPressed||t.isActive?this.ho:t.isFocused||t.isHovered?this.oo:this.uo},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.co:this.ao},n.prototype.getTextColor=function(t){return t.inDisabled?this.fo:this.ah},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.lo:this.fh},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.bo:this.vo},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.mo:this.do},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(bn),zo=function(t){function n(n){var i=t.call(this,cn.COLOR_FILL_AND_STROKE|cn.COLOR_TEXT|cn.COLOR_TEXT_OUTLINE|cn.CURSOR)||this,r=n.fill,e=r.color;i.wo=e;var u=i.toOnHovered(e),s=2*u;i.po=an.darken(e,s),i.Oo=an.darken(e,u);var h=15197671;i.Qh=h;var o=i.toOnHovered(h),a=2*o;i.no=an.darken(h,a),i.io=an.darken(h,o);var c=r.alpha;i.ro=c,i.eo=.5*c;var f=n.stroke,l=f.color;i.Do=l;var v=i.toOnHovered(l),b=2*v;i.Eo=an.darken(l,b),i.Mo=an.darken(l,v);var d=15197671;i.uo=d;var g=i.toOnHovered(d),m=2*g;i.ho=an.darken(d,m),i.So=an.darken(d,g);var w=f.alpha;i.ao=w,i.co=.5*w;var p=n.text,O=p.color;i.To=O,i.fo=an.toGrayscale(O),i.ah=5197647;var D=p.alpha;i.fh=D,i.lo=.5*D;var E=p.outline,M=E.color;i.vo=M,i.bo=an.toGrayscale(M);var S=E.alpha;return i.do=S,i.mo=.5*S,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=an.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.Qh:t.isActive?t.isPressed?this.po:t.isFocused||t.isHovered?this.Oo:this.wo:t.isPressed?this.no:t.isFocused||t.isHovered?this.io:this.Qh},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.eo:this.ro},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.uo:t.isActive?t.isPressed?this.Eo:t.isFocused||t.isHovered?this.Mo:this.Do:t.isPressed?this.ho:t.isFocused||t.isHovered?this.So:this.uo},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.co:this.ao},n.prototype.getTextColor=function(t){return t.inDisabled?this.fo:t.isActive?this.To:this.ah},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.lo:this.fh},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.bo:this.vo},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.mo:this.do},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}(bn),Vo=function(t){function n(n){var i=t.call(this,n)||this;return n instanceof Uo&&(i.wh=n.isToggle,i.Oh=n.isGrouped),i}return _(n,t),n.prototype.isActionable=function(){return!0},n.prototype.initialize=function(n){this.actions.unshift(this.wh?new zo(this):new Ho(this)),t.prototype.initialize.call(this,n)},n.prototype.onClick=function(n,i){var r=n.state,e=r.isClicked;r.lock(),t.prototype.onClick.call(this,n,i),!e&&r.isClicked&&(this.wh?r.isActive=!r.isActive:r.isActive||(r.isActivated=!0)),r.unlock()},n.prototype.onStateChange=function(n,i,r){t.prototype.onStateChange.call(this,n,i,r),this.wh&&this.Oh&&i.is(Mt.ACTIVATED)&&this.onActivated(n)},n.prototype.onActivated=function(t){var n=t.parent;if(null!=n)for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u instanceof Uo&&u.isToggle&&u.isGrouped&&(u.state.isActive=!1)}},n}(su),Wo=function(){e[r.BUTTON]=Bo,n[r.BUTTON]=Go,To[r.BUTTON]=Vo,jr.set(r.BUTTON,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},Xo=[0,0],Ko=new t.Point,Yo=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1},Jo=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Zo=function(t,n,i,r,e,u,s,h,o,a){var c=Ko,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D+(D-g),S=E+(E-m),T=D-w,j=E-p,N=2*n-1;t[++N]=b,t[++N]=d,t[++N]=g,t[++N]=m,t[++N]=g+w,t[++N]=m+p,t[++N]=T,t[++N]=j,t[++N]=D,t[++N]=E,t[++N]=D+w,t[++N]=E+p,t[++N]=M-w,t[++N]=S-p,t[++N]=M,t[++N]=S,t[++N]=M+w,t[++N]=S+p,a[0]=O(b,d,g,m),a[1]=O(b,d,T,j)},qo=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<9;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},Qo=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a),t[++f]=s,t[++f]=c,t[++f]=.5*(s+u),t[++f]=.5*(c+a),t[++f]=u,t[++f]=a},$o=function(t){function n(n,i){return t.call(this,n,i,9,8)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;Yo(t.clippings,n),Jo(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),Zo(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,Xo),qo(t.steps,t.clippings,this.vertexOffset,c,f,Xo))},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=J(i);Qo(t.uvs,this.vertexOffset,e)}},n}(W),ta=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new $o(i,r),new sn(i+9,r+8,h,o)]).init(n):null},na=function(t){function n(n){return void 0===n&&(n=r.CIRCLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Zt(this,n,i,r,e,u,s)},n}(Jt),ia=function(t,n,i){return Eo(t,n,i||new na)},ra=function(){e[r.CIRCLE]=ta,n[r.CIRCLE]=ia},ea=new t.Point,ua=function(t){return t?t.formatted.length:0},sa=function(t){return 12*Math.ceil(ua(t)/12)},ha=function(t,n){return n?4*t+2:4*t},oa=function(t,n){return ha(t,n)-2},aa=function(t,n,i,r){for(var e=3*n-1,u=3*(n+i)-1,s=0;s<r;++s)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5,t[++e]=1,t[++e]=0,t[++e]=4,t[++e]=0,t[++e]=1,t[++e]=6;for(;e<u;)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5},ca=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s+0,t[++e]=s+2,t[++e]=s+1,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=2},fa=function(t,n,i,r,e,u){for(var s=1/Math.max(1e-5,u),h=e.x0,o=e.x1,a=e.x2,c=e.x3,f=e.y0,l=e.y1,v=e.y2,b=e.y3,d=o-h,g=l-f,m=a-c,w=v-b,p=(i<<1)-1,O=(i+r<<1)-1,D=(i<<2)-8;p<O;){var E=n[D+=8]*s;t[++p]=h+E*d,t[++p]=f+E*g,t[++p]=c+E*m,t[++p]=b+E*w}},la=function(t,n,i,r,e,u,s,h,o,a,c,f){var l=H;null==l&&(H=l=[]);for(var v=f.a,b=f.b,d=f.c,g=f.d,m=f.tx,w=f.ty,p=0;p<u;++p){var O=p<<1,D=h[O],E=h[O+1];l[O]=v*D+d*E+m,l[O+1]=b*D+g*E+w}return ba(t,n,i,r,e,u,s,l,o,a,c)},va=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=1]=b,n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=4]=b},ba=function(t,n,i,r,e,u,s,h,o,a,c){var f=o.length;if(0<f){if(s){for(var l=0,v=0,b=r,d=0,g=o[0],m=1;m<f;++m)2<=(d=o[m])-g&&(v=ga(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=ha(d-g,!1)),g=d;return 2<=(d=o[0]+u)-g?(v=ga(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=ha(d-g,!1)):da(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}for(l=0,v=0,b=r,2<=(d=o[0])&&(v=ga(t,n,i,b,-1,h,0,d,u,a,c,v),l=Math.max(l,v),b+=ha(d,!1)),g=d,m=1;m<f;++m)2<=(d=o[m])-g&&(v=ga(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=ha(d-g,!1)),g=d;return 2<=(d=u)-g?(v=ga(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=ha(d-g,!1)):da(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}return s?ma(t,n,i,r,e,h,0,u,u,a,c):ga(t,n,i,r,e,h,0,u,u,a,c,0)},da=function(t,n,i,r,e,u,s,h,a,c,f,l){if(0<=e)for(var v=o(f),b=(r<<1)-1,d=6*r-1,g=(r<<2)-1,m=(r+e<<1)-1,w=s%a<<1,p=u[w],O=u[w+1];b<m;)t[++b]=p,t[++b]=O,n[++d]=0,n[++d]=v,n[++d]=-1,n[++d]=0,n[++d]=1,n[++d]=0,i[++g]=l,i[++g]=0,i[++g]=0,i[++g]=l;return 0},ga=function(t,n,i,r,e,u,s,a,c,f,l,v){var b=o(l),d=s%c<<1,g=u[d],m=u[d+1],w=(s+1)%c<<1,p=u[w],D=u[w+1],E=g-(p-g),M=m-(D-m),S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=0;va(S,t,T,n,j,i,g,m,f,b,E,M,p,D,v),va(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;for(var I=s+1,C=a-1;I<C;++I){E=g,M=m,g=p,m=D;var A=(I+1)%c<<1;p=u[A],D=u[A+1],N+=O(E,M,g,m),va(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),va(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8}E=g,M=m,p=(g=p)+(g-E),D=(m=D)+(m-M),N+=O(E,M,g,m),va(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),va(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;var R=h(N,f,l,ea),k=R.x,L=R.y,y=(r<<2)-1;for(I=y,C=y+8;I<C;I+=4)i[I+2]=k,i[I+3]=L,i[I+4]=v;for(I=y+8;I<j;I+=4)i[I+2]=k,i[I+3]=L,i[I+4]=N;if(0<=e)for(var x=(r+e<<1)-1;S<x;)t[++S]=g,t[++S]=m,n[++T]=0,n[++T]=b,n[++T]=E,n[++T]=M,n[++T]=p,n[++T]=D,i[++j]=N,i[++j]=k,i[++j]=L,i[++j]=N;return N},ma=function(t,n,i,r,e,u,s,a,c,f,l){for(var v=o(l),b=(a-1)%c<<1,d=0,g=0,m=u[b],w=u[b+1],p=s%c<<1,D=u[p],E=u[p+1],M=0,S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=s;N<a;++N){d=m,g=w,m=D,w=E;var I=(N+1)%c<<1;D=u[I],E=u[I+1],M+=O(d,g,m,w),va(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),va(S+=4,t,T+=12,n,j+=8,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8}d=m,g=w,m=D,w=E;var C=(s+1)%c<<1;D=u[C],E=u[C+1],M+=O(d,g,m,w),va(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8;var A=h(M,f,l,ea),R=A.x,k=A.y;for(N=(r<<2)-1;N<j;N+=4)i[N+2]=R,i[N+3]=k,i[N+4]=-1;if(0<=e)for(var L=(r+e<<1)-1;S<L;)t[++S]=m,t[++S]=w,n[++T]=f,n[++T]=v,n[++T]=d,n[++T]=g,n[++T]=D,n[++T]=E,i[++j]=M,i[++j]=R,i[++j]=k,i[++j]=-1;return M},wa=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.pointId=-1,u.pointCount=0,u.pointsClosed=!1,u.length=1,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),ca(t.indices,this.vertexOffset,this.indexOffset,this.indexCount)},n.prototype.isCompatible=function(t){return ha(sa(t.points),!0)===this.vertexCount},n.prototype.update=function(t,n){this.updateLineClipping(t,n),this.updateLineVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateLineUv(t,n)},n.prototype.updateLineClipping=function(t,n){var i=n.points;if(i){var r=i.formatted.length;this.pointCount!==r&&(this.pointCount=r,this.pointId=-1,t.updateClippings(),aa(t.clippings,this.vertexOffset,this.vertexCount,r))}},n.prototype.updateLineVertexStepAndColorFill=function(t,n){var i=n.points;if(i){var r=i.id,e=i.formatted,u=!!(e.style&z.CLOSED),s=r!==this.pointId||u!==this.pointsClosed,h=n.stroke,o=h.enable?h.width:0,a=h.style,c=this.strokeWidth!==o||this.strokeStyle!==a,f=X(n),l=this.transformLocalId!==f;(s||l||c)&&(this.pointId=r,this.pointsClosed=u,this.strokeWidth=o,this.strokeStyle=a,this.transformLocalId=f,s&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),this.length=la(t.vertices,t.steps,t.colorFills,this.vertexOffset,this.vertexCount,this.pointCount,this.pointsClosed,e.values,e.segments,o,a,n.transform.internalTransform))}},n.prototype.updateLineUv=function(t,n){var i=K(n),r=Y(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),fa(t.uvs,t.colorFills,this.vertexOffset,this.vertexCount,J(i),this.length))},n}(W),pa=[0,0,0],Oa=new t.Point,Da=function(t,n){var i=3*n-1;t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0},Ea=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+2,t[++r]=n+0,t[++r]=n+3,t[++r]=n+4,t[++r]=n+0,t[++r]=n+5,t[++r]=n+6},Ma=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=2*f*l/(f+Math.sqrt(f*f+4*l*l)),b=Oa;b.set(i,r-l),o.apply(b,b);var d=b.x,g=b.y;b.set(i,r),o.apply(b,b);var m=b.x,w=b.y;b.set(i+f,r),o.apply(b,b);var p=m-d,D=w-g,E=b.x+p,M=b.y+D,S=m+(m-b.x)+p,T=w+(w-b.y)+D;b.set(i,r+l-v),o.apply(b,b);var j=b.x,N=b.y,I=m+p,C=w+D;a[0]=O(I,C,j,N),a[1]=O(E,M,I,C),a[2]=O(d,g,m,w);var A=(n<<1)-1;t[++A]=j,t[++A]=N,t[++A]=d,t[++A]=g,t[++A]=E,t[++A]=M,t[++A]=E,t[++A]=M,t[++A]=S,t[++A]=T,t[++A]=S,t[++A]=T,t[++A]=d,t[++A]=g},Sa=function(t,n,i,r,e,u,s){for(var h=o(u),a=s[0],c=6*i-1,f=3*i,l=0;l<r;l+=1,f+=3)t[++c]=e,t[++c]=h,t[++c]=a,t[++c]=a,t[++c]=1+n[f],t[++c]=1+n[f+1]},Ta=function(t,n,i,r){var e=n.x0,u=n.x1,s=n.x2,h=n.x3,o=n.y0,a=n.y1,c=n.y2,f=n.y3,l=.5*(e+u),v=.5*(o+a),b=1-.5*r[0]/r[2],d=l+b*(h-e),g=v+b*(f-o),m=(i<<1)-1;t[++m]=d,t[++m]=g,t[++m]=l,t[++m]=v,t[++m]=s,t[++m]=c,t[++m]=s,t[++m]=c,t[++m]=h,t[++m]=f,t[++m]=h,t[++m]=f,t[++m]=l,t[++m]=v},ja=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.updateColorFill=function(t,n){var i=n.points;if(null!=i){var r=i.getMarker();if(null!=r){var e=this.toMarker(r).fill,u=n.visible&&e.enable,s=e.color,h=u?e.alpha:0;s===this.colorFill&&h===this.alphaFill||(this.colorFill=s,this.alphaFill=h,t.updateColorFills(),V(s,h,this.vertexOffset,this.vertexCount,t.colorFills))}}},n}(W),Na=function(n){function i(t,i){var r=n.call(this,t,i,7,3)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices(),Da(t.clippings,this.vertexOffset),Ea(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=X(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=K(r),O=Y(p),D=p!==this.texture||O!==this.textureTransformId,E=f||w,M=u.id,S=M!==this.pointId;if(E||v||D||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.texture=p,this.textureTransformId=O,this.pointId=M;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),Ma(n.vertices,T,0,0,a,c,d,g,j,pa),(E||v)&&(n.updateSteps(),Sa(n.steps,n.clippings,T,7,g,m,pa)),(E||D)&&(n.updateUvs(),Ta(n.uvs,J(p),T,pa))}}}},i}(ja),Ia=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Na),Ca=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Na),Aa=function(n){function i(t,i){var r=n.call(this,t,i,9,8)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;Yo(t.clippings,n),Jo(t.indices,n,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},i.prototype.updateVertexAndStep=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=X(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=u.id,O=p!==this.pointId;if(f||v||w||O){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.pointId=p;var D=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;D.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),n.updateSteps(),Zo(n.vertices,this.vertexOffset,0,0,a,c,d,g,D,Xo),qo(n.steps,n.clippings,this.vertexOffset,g,m,Xo)}}}},i.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=J(i);Qo(t.uvs,this.vertexOffset,e)}},i}(ja),Ra=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Aa),ka=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Aa),La=function(){function n(t,n){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=0,this.indexCount=0,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=K(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),ya=24,xa=16,Ba=[0,0,0,0],_a=new t.Point,Pa=function(t,n,i){var r=1-i[0],e=1-i[1],u=3*n-1;t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0},Fa=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+4,t[++r]=n+4,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+5,t[++r]=n+2,t[++r]=n+3,t[++r]=n+8,t[++r]=n+6,t[++r]=n+9,t[++r]=n+9,t[++r]=n+6,t[++r]=n+7,t[++r]=n+9,t[++r]=n+7,t[++r]=n+10,t[++r]=n+10,t[++r]=n+7,t[++r]=n+11,t[++r]=n+12,t[++r]=n+16,t[++r]=n+13,t[++r]=n+13,t[++r]=n+16,t[++r]=n+17,t[++r]=n+13,t[++r]=n+17,t[++r]=n+14,t[++r]=n+14,t[++r]=n+17,t[++r]=n+15,t[++r]=n+18,t[++r]=n+20,t[++r]=n+21,t[++r]=n+18,t[++r]=n+21,t[++r]=n+22,t[++r]=n+18,t[++r]=n+22,t[++r]=n+19,t[++r]=n+19,t[++r]=n+22,t[++r]=n+23},Ua=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=_a;v.set(i-f,r-l),o.apply(v,v);var b=v.x,d=v.y;v.set(i+f,r-l),o.apply(v,v);var g=v.x,m=v.y;v.set(i+f,r+l),o.apply(v,v);var w=v.x,p=v.y,D=b+(w-g),E=d+(p-m),M=.5*O(b,d,g,m),S=.5*O(g,m,w,p),T=1,j=1;M<=S?j=M/S:T=S/M,a[0]=T,a[1]=j,a[2]=M,a[3]=S;var N=T*(g-b)*.5,I=T*(m-d)*.5,C=j*(D-b)*.5,A=j*(E-d)*.5,R=(n<<1)-1;t[++R]=b,t[++R]=d,t[++R]=b+N,t[++R]=d+I,t[++R]=g-N,t[++R]=m-I,t[++R]=g,t[++R]=m,t[++R]=b+N+C,t[++R]=d+I+A,t[++R]=g-N+C,t[++R]=m-I+A,t[++R]=D+N-C,t[++R]=E+I-A,t[++R]=w-N-C,t[++R]=p-I-A,t[++R]=D,t[++R]=E,t[++R]=D+N,t[++R]=E+I,t[++R]=w-N,t[++R]=p-I,t[++R]=w,t[++R]=p,t[++R]=b,t[++R]=d,t[++R]=b+C,t[++R]=d+A,t[++R]=D-C,t[++R]=E-A,t[++R]=D,t[++R]=E,t[++R]=b+C+N,t[++R]=d+A+I,t[++R]=D-C+N,t[++R]=E-A+I,t[++R]=g+C-N,t[++R]=m+A-I,t[++R]=w-C-N,t[++R]=p-A-I,t[++R]=g,t[++R]=m,t[++R]=g+C,t[++R]=m+A,t[++R]=w-C,t[++R]=p-A,t[++R]=w,t[++R]=p},Ga=function(t,n,i,r,e,u){var s,h,a,c,f,l,v,b,d=o(e),g=u[0],m=u[1],w=Math.max(0,1-g),p=Math.max(0,1-m),O=u[2],D=u[3];r&qt.TOP?(s=2,h=1+p):(s=-2,h=-1-p),r&qt.RIGHT?(a=2,c=1+w):(a=-2,c=-1-w),r&qt.BOTTOM?(f=2,l=1+p):(f=-2,l=-1-p),r&qt.LEFT?(v=2,b=1+w):(v=-2,b=-1-w);var E=6*(t-1)-1;Ha(n,E+=6,i,d,O,D,v,s),Ha(n,E+=6,i,d,O,D,b,s),Ha(n,E+=6,i,d,O,D,c,s),Ha(n,E+=6,i,d,O,D,a,s),Ha(n,E+=6,i,d,O,D,b,h),Ha(n,E+=6,i,d,O,D,c,h),Ha(n,E+=6,i,d,O,D,b,l),Ha(n,E+=6,i,d,O,D,c,l),Ha(n,E+=6,i,d,O,D,v,f),Ha(n,E+=6,i,d,O,D,b,f),Ha(n,E+=6,i,d,O,D,c,f),Ha(n,E+=6,i,d,O,D,a,f),Ha(n,E+=6,i,d,O,D,v,s),Ha(n,E+=6,i,d,O,D,v,h),Ha(n,E+=6,i,d,O,D,v,l),Ha(n,E+=6,i,d,O,D,v,f),Ha(n,E+=6,i,d,O,D,b,h),Ha(n,E+=6,i,d,O,D,b,l),Ha(n,E+=6,i,d,O,D,c,h),Ha(n,E+=6,i,d,O,D,c,l),Ha(n,E+=6,i,d,O,D,a,s),Ha(n,E+=6,i,d,O,D,a,h),Ha(n,E+=6,i,d,O,D,a,l),Ha(n,E+=6,i,d,O,D,a,f)},Ha=function(t,n,i,r,e,u,s,h){t[++n]=i,t[++n]=r,t[++n]=e,t[++n]=u,t[++n]=s,t[++n]=h},za=function(t,n,i,r){var e=i.x0,u=i.y0,s=i.y1,h=i.x1,o=i.y2,a=i.x2,c=i.y3,f=i.x3,l=r[0],v=r[1],b=l*(h-e)*.5,d=l*(s-u)*.5,g=v*(f-e)*.5,m=v*(c-u)*.5,w=(n<<1)-1;t[++w]=e,t[++w]=u,t[++w]=e+b,t[++w]=u+d,t[++w]=h-b,t[++w]=s-d,t[++w]=h,t[++w]=s,t[++w]=e+b+g,t[++w]=u+d+m,t[++w]=h-b+g,t[++w]=s-d+m,t[++w]=f+b-g,t[++w]=c+d-m,t[++w]=a-b-g,t[++w]=o-d-m,t[++w]=f,t[++w]=c,t[++w]=f+b,t[++w]=c+d,t[++w]=a-b,t[++w]=o-d,t[++w]=a,t[++w]=o,t[++w]=e,t[++w]=u,t[++w]=e+g,t[++w]=u+m,t[++w]=f-g,t[++w]=c-m,t[++w]=f,t[++w]=c,t[++w]=e+g+b,t[++w]=u+m+d,t[++w]=f-g+b,t[++w]=c-m+d,t[++w]=h+g-b,t[++w]=s+m-d,t[++w]=a-g-b,t[++w]=o-m-d,t[++w]=h,t[++w]=s,t[++w]=h+g,t[++w]=s+m,t[++w]=a-g,t[++w]=o-m,t[++w]=a,t[++w]=o},Va=function(n){function i(t,i){var r=n.call(this,t,i,ya,xa)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateIndices(),Fa(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexClippingStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=X(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.side,w=b.style,p=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeSide!==m||this.strokeStyle!==w,O=K(r),D=Y(O),E=O!==this.texture||D!==this.textureTransformId,M=f||p,S=u.id!==this.pointId;if(M||v||E||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeSide=m,this.strokeStyle=w,this.texture=O,this.textureTransformId=D;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),Ua(n.vertices,T,0,0,a,c,d,g,j,Ba),(M||v)&&(n.updateSteps(),Ga(T,n.steps,g,m,w,Ba)),M&&(n.updateClippings(),Pa(n.clippings,T,Ba)),(M||E)&&(n.updateUvs(),za(n.uvs,T,J(O),Ba))}}}},i}(ja),Wa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Va),Xa=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Va),Ka=function(t){switch(t){case Q.NONE:return 0;case Q.CIRCLE:return 9;case Q.TRIANGLE:return 7;case Q.RECTANGLE:return ya}return 0},Ya=function(t){switch(t){case Q.NONE:return 0;case Q.CIRCLE:return 8;case Q.TRIANGLE:return 3;case Q.RECTANGLE:return xa}return 0},Ja=function(t,n,i){switch(t){case Q.NONE:return new La(n,i);case Q.CIRCLE:return new Ra(n,i);case Q.TRIANGLE:return new Ia(n,i);case Q.RECTANGLE:return new Xa(n,i)}return new La(n,i)},Za=function(t,n,i){switch(t){case Q.NONE:return new La(n,i);case Q.CIRCLE:return new ka(n,i);case Q.TRIANGLE:return new Ca(n,i);case Q.RECTANGLE:return new Wa(n,i)}return new La(n,i)},qa=function(t,n,i,r,e){var s=n.points,h=sa(s),o=ha(h,!0),a=oa(h,!0),c=Q.NONE,f=Q.NONE;if(s&&s instanceof fe){var l=s.getMarker();l&&(c=l.tail.type,f=l.head.type)}var v=Ka(c),b=Ya(c),d=i+o,g=r+a,m=Ka(f),w=Ya(f),p=d+v,O=g+b,D=M(n),E=4*D,S=2*D,T=p+m,j=O+w,N=o+m+v+E,I=a+w+b+S;return t.check(i,r,N,I)?new u(t,i,r,N,I,[new wa(i,r,o,a),Za(c,d,g),Ja(f,p,O),new sn(T,j,E,S)]).init(n):null},Qa=function(){function t(t,n,i){this.jo=1e-6,this._x=t,this._y=n,this._z=0,this.k=i,i[0]=t,i[1]=n,this.index=0}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){if(0===this._z||this.jo<Math.abs(this._x-t)){this._x=t;var n=this.index,i=this.k;1===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=1)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){if(0===this._z||this.jo<Math.abs(this._y-t)){this._y=t;var n=this.index,i=this.k;2===this._z?(i[n+0]=this._x,i[n+1]=this._y):(i[n+2]=this._x,i[n+3]=this._y,this.index+=2,this._z=2)}},enumerable:!1,configurable:!0}),t.prototype.toAxis=function(t,n,i,r){var e=Math.abs(i),u=Math.abs(r),s=this.jo;if(e<s&&u<s)return Math.abs(t)<Math.abs(n)?0<=n?2:0:0<=t?1:3;var h=.2;return 0<=i?0<=r?h<e&&h<u?t<n?2:1:h<e?1:2:h<e&&h<u?t<-n?0:1:h<e?1:0:0<=r?h<e&&h<u?-t<n?2:3:h<e?3:2:h<e&&h<u?n<t?0:3:h<e?3:0},t.prototype.toTailAxis=function(t,n,i,r){return this.toAxis(t-this.x,n-this.y,i,r)},t.prototype.tail=function(t,n,i,r,e,u,s){switch(this.toTailAxis(t,n,i,r)){case 0:this.y-s<=n?(this.y-=Math.max(s,u),this.x=t):this.y=n;break;case 1:t<=this.x+s?(this.x+=Math.max(s,e),this.y=n):this.x=t;break;case 2:n<=this.y+s?(this.y+=Math.max(s,e),this.x=t):this.y=n;break;case 3:this.x-s<=t?(this.x-=Math.max(s,e),this.y=n):this.x=t}},t.prototype.middle=function(t,n){var i=t-this._x,r=n-this._y;Math.abs(i)<Math.abs(r)?this.y=n:this.x=t},t.prototype.toHeadAxis=function(t,n,i,r){return this.toAxis(this.x-t,this.y-n,i,r)},t.prototype.head=function(t,n,i,r,e,u,s){switch(this.toHeadAxis(t,n,i,r)){case 0:n-s<=this.y&&(this.y=n-Math.max(s,u)),this.x=t,this.y=n;break;case 1:this.x<=t+s&&(this.x=t+Math.max(s,e)),this.y=n,this.x=t;break;case 2:this.y<=n+s&&(this.y=n+Math.max(s,u)),this.x=t,this.y=n;break;case 3:t-s<=this.x&&(this.x=t-Math.max(s,e)),this.y=n,this.x=t}},t.prototype.margin=function(t,n){var i=this.k,r=this.index;if(0!==t&&2<=r){var e=i[0],u=i[1],s=(o=i[2]-e)*o+(a=i[3]-u)*a;if((c=this.jo)<s){var h=t/Math.sqrt(o*o+a*a);c<Math.abs(h-1)?(i[0]=e+o*h,i[1]=u+a*h):this.index-=2}}if(r=this.index,0!==n&&2<=r){var o,a,c,f=i[r+0],l=i[r+1];s=(o=i[r-2]-f)*o+(a=i[r-1]-l)*a,(c=this.jo)<s&&(h=n/Math.sqrt(o*o+a*a),c<Math.abs(h-1)?(i[r+0]=f+o*h,i[r+1]=l+a*h):this.index-=2)}i.length=this.index+2},t}(),$a=function(t){function n(n){return void 0===n&&(n=r.CONNECTOR_ELBOW),t.call(this,n)||this}return _(n,t),n.prototype.fillPoints=function(t,n,i,r,e,u,s,h){var o=t.local,a=o.x,c=o.y,f=t.normal,l=f.x,v=f.y,b=i.local,d=b.x,g=b.y,m=i.normal,w=m.x,p=m.y,O=e.values,D=O.length,E=a-u,M=c-s,S=d-u,T=g-s,j=.5*(S+E),N=.5*(T+M),I=S-E,C=T-M,A=.5*q.SIZE_X,R=.5*q.SIZE_Y,k=1e-6;if(Math.abs(I)<k&&Math.abs(C)<k)h[0]=E,h[1]=M,h[2]=S,h[3]=T,h.length=4;else{var L=new Qa(E,M,h);if(0<D){var y=Math.atan2(C,I),x=Math.sqrt(I*I+C*C),B=Math.cos(y)*x,_=Math.sin(y)*x,P=O[0],F=O[1],U=j+B*P-_*F,G=N+B*F+_*P;L.tail(U,G,l,v,A,R,n);for(var H=2;H<D;H+=2){var z=O[H+0],V=O[H+1],W=j+B*z-_*V,X=N+B*V+_*z;L.middle(W,X)}L.head(S,T,w,p,A,R,r)}else L.tail(j,N,l,v,A,R,n),L.head(S,T,w,p,A,R,r);L.margin(n,r)}},n}(ve),tc=function(t,n,i){return Eo(t,n,i||new $a)},nc=function(){function t(){}return t.from=function(t,n,i){var r=[],e=t.length;if(4<e){var u=1e-6,s=t[0],h=t[1];0!==n&&u<(c=(o=s-t[2])*o+(a=h-t[3])*a)&&(s+=o*(f=n/Math.sqrt(c)),h+=a*f);var o,a,c,f,l=t[e-2],v=t[e-1];0!==i&&u<(c=(o=l-t[e-4])*o+(a=v-t[e-3])*a)&&(l+=o*(f=i/Math.sqrt(c)),v+=a*f);for(var b=.5*(l+s),d=.5*(v+h),g=l-s,m=v-h,w=Math.atan2(m,g),p=Math.cos(w),O=Math.sin(w),D=g*g+m*m,E=u<D?1/Math.sqrt(D):1,M=2,S=e-2;M<S;M+=2){var T=t[M+0]-b,j=t[M+1]-d;r.push((p*T+O*j)*E,(p*j-O*T)*E)}}return r},t}(),ic=function(t,n,i){return Eo(t,n,i||new ve)},rc=function(t,n,i,r){if(n instanceof ve){var e=r.resources,u=t[15];if(0<=u&&u<e.length){var s=r.getExtension(u);null==s&&(s=JSON.parse(e[u]),r.setExtension(u,s)),n.lock();var h=n.points;h.deserialize(s[1],r);var o=n.edge;o.deserialize(s[0],i,r);var a=n.body,c=s[2];null!=c?a.deserialize(c,i,r):a.set(nc.from(h.values,o.tail.margin,o.head.margin)),n.unlock()}}},ec=function(){e[r.CONNECTOR_ELBOW]=qa,n[r.CONNECTOR_ELBOW]=tc,i[r.CONNECTOR_ELBOW]=rc,jr.set(r.CONNECTOR_ELBOW,Ct.CONNECTOR)},uc=function(){e[r.CONNECTOR_LINE]=qa,n[r.CONNECTOR_LINE]=ic,i[r.CONNECTOR_LINE]=rc,jr.set(r.CONNECTOR_LINE,Ct.CONNECTOR)},sc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Fa(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=K(n),d=Y(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Ua(t.vertices,w,.5*r,.5*e,r,e,a,c,n.transform.internalTransform,Ba),(m||h)&&(t.updateSteps(),Ga(w,t.steps,c,f,l,Ba)),m&&(t.updateClippings(),Pa(t.clippings,w,Ba)),(m||g)&&(t.updateUvs(),za(t.uvs,w,J(b),Ba))}},n}(W),hc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=ya+h,c=xa+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new sc(i,r,a-h,c-o),new sn(i+ya,r+xa,h,o)]).init(n):null},oc=function(t,n,i,r){var e=M(n),s=4*e,h=2*e,o=s,a=h;return t.check(i,r,o,a)?new u(t,i,r,o,a,[new sn(i,r,s,h)]).init(n):null},ac=function(t,n){var i=t.data.getMapping();if(null!=i)for(var r=i.values,e=0,u=r.length;e<u;++e){var s=r[e],h=s[0],o=n.getDataMapper(h);if(null!=o){var a=t.children,c=n.getDataDestination(s[1]),f=s[2];cc(a,o,c,f)}}},cc=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){for(var s=t[e],h=s.data,o=0,a=h.size();o<a;++o){var c=h.get(o);c&&c.scope!==_t.PRIVATE&&n.map(c,i,r)}var f=s.children;0<f.length&&cc(f,n,i,r)}},fc=function(t,n,i){var r=n.pieces,e=t[15];if(r&&0<=e&&e<r.length){var u=n.pieceData;if(u){var s=r[e],h=u.get(s),o=i&&i(s,n);return h?function(t,n,i,r,e,u,s){var h=e.mode,o=e.depth;s=s||new Br(t,h,o);var a=Eo(u,e,s),c=s.size,f=c.x,l=c.y;return s.size.set(n,i),r.copyTo(s),s.size.init(),s.size.set(f,l),h===Tr.EDITOR?0<o&&ac(s,e):ac(s,e),a}(s,h.width,h.height,h.layer,n,t,o):function(t,n,i,r){var e=n.mode,u=n.depth;r=r||new Br(t,e,u);var s=Eo(i,n,r),h=r.size,o=h.x,a=h.y,c=r.children,f=new Be("missing",e,u),l=.5*o,v=.5*o;f.transform.position.set(-l,-v),f.size.set(o,a),f.size.init(),f.parent=r;var b=new hu;return b.stroke.color=16711680,b.transform.position.set(l,v),b.size.copyFrom(r.size),b.attach(f),c.push(f),r.onChildTransformChange(),r.toDirty(),r.onAttach(),r.size.init(),e===Tr.EDITOR?0<u&&ac(r,n):ac(r,n),s}(s,n,t,o)}}return null},lc=function(){e[r.EMBEDDED]=oc,n[r.EMBEDDED]=fc,jr.set(r.EMBEDDED,Ct.EMBEDDED),e[r.EMBEDDED_LAYER]=hc},vc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.p.children;return!(0<t.length)||t[t.length-1].fill.enable},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.color:16777215},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.alpha:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.alpha=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].fill.copy(t)},t.prototype.set=function(t,n,i){for(var r=this.p.children,e=0,u=r.length;e<u;++e)r[e].fill.set(t,n,i)},t.prototype.clone=function(){return new t(this.p)},t.prototype.toObject=function(){var t=this.p.children;return 0<t.length?t[t.length-1].fill.toObject():{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),bc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"length",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.length}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.id}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.values}return[]},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.values=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.segments}return[]},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.segments=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.style}return z.NONE},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.style=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marker",{get:function(){for(var t=this.p.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.marker}return nt.getInstance()},enumerable:!1,configurable:!0}),t.prototype.getMarker=function(){for(var t=this.p.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.getMarker()}},Object.defineProperty(t.prototype,"formatter",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatter}return null},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.formatter=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formatted",{get:function(){var t=this.p.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatted}return this},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&e.copy(t)}return this},t.prototype.set=function(t,n,i){for(var r=this.p.children,e=0,u=r.length;e<u;++e){var s=r[e].points;null!=s&&s.set(t,n,i)}return this},t.prototype.clone=function(n){return new t(n)},t.prototype.toPoints=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.toPoints(t)}return[]},t.prototype.serialize=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.serialize(t)}return-1},t}(),dc=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.p.children;return 0<t.length&&t[t.length-1].stroke.enable},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.color:16777215},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.alpha:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.width:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.align:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.side:1},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.side=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.style:s.NONE},set:function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.style=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.p.children,i=0,r=n.length;i<r;++i)n[i].stroke.copy(t)},t.prototype.set=function(t,n,i,r,e){for(var u=this.p.children,s=0,h=u.length;s<h;++s)u[s].stroke.set(t,n,i,r,e)},t.prototype.clone=function(){return new t(this.p)},t.prototype.toObject=function(){var t=this.p.children;return 0<t.length?t[t.length-1].stroke.toObject():{enable:!1,color:16777215,alpha:1,width:1,align:0,side:qt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),gc=function(t){function n(n,i){void 0===i&&(i=r.GROUP);var e=t.call(this,i)||this;e.Fr=n;var u=new Vt;return e.data=u,e.tag=u,e.size=e.newGroupSize(n),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e.jt=e.newGroupPoints(),e}return _(n,t),Object.defineProperty(n.prototype,"mode",{get:function(){return this.Fr},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t){var n=q.SIZE_X,i=q.SIZE_Y;return t!==Tr.VIEWER?new Rr(this,n,i,this.isGroupSizeFittable()):new kr(this,n,i,n,i)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newGroupFill=function(){return new vc(this)},n.prototype.newGroupStroke=function(){return new dc(this)},n.prototype.newGroupText=function(){return new Yt(this,q.TEXT_VALUE,q.TEXT_COLOR,q.TEXT_ALPHA,q.TEXT_FAMILY,q.TEXT_SIZE)},n.prototype.newGroupPoints=function(){return new bc(this)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof kr?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].corner:ut.ALL},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].corner=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].gradient;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].gradient=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].radius:.5},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].radius=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].image;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].image=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n)if(null!=t[n].points)return this.jt},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.Fr,this.type)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Rt),mc=function(t,n,i){i=i||new gc(n.mode);var r=Eo(t,n,i);return i.size.init(),r},wc=function(){e[r.GROUP]=oc,n[r.GROUP]=mc,jr.set(r.GROUP,Ct.GROUP)},pc=function(){function n(n,i,r){this.p=n,this.j=new t.Point(i,r)}return n.prototype.init=function(){return this},Object.defineProperty(n.prototype,"x",{get:function(){return this.j.x},set:function(t){var n=this.j;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.j.y},set:function(t){var n=this.j;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.j,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.j;return new n(this.p,t.x,t.y)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.j,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.j.copyTo(t)},n.prototype.equals=function(t){return this.j.equals(t)},n.prototype.fit=function(){return this},n.prototype.onChange=function(t,n){this.p.onSizeChange()},n}(),Oc=function(t){function n(n,i){return void 0===i&&(i=r.GROUP_SHADOWED),t.call(this,n,i)||this}return _(n,t),n.prototype.newGroupSize=function(n){return n!==Tr.VIEWER?new pc(this,q.SIZE_X,q.SIZE_Y):t.prototype.newGroupSize.call(this,n)},n}(gc),Dc=function(t,n,i){i=i||new Oc(n.mode);var r=Eo(t,n,i);return i.size.init(),r},Ec=function(){e[r.GROUP_SHADOWED]=oc,n[r.GROUP_SHADOWED]=Dc,jr.set(r.GROUP_SHADOWED,Ct.GROUP)},Mc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Fa(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=K(n),d=Y(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),Ua(t.vertices,w,0,0,r,e,a,c,n.transform.internalTransform,Ba),(m||h)&&(t.updateSteps(),Ga(w,t.steps,c,f,l,Ba)),m&&(t.updateClippings(),Pa(t.clippings,w,Ba)),(m||g)&&(t.updateUvs(),za(t.uvs,w,J(b),Ba))}},n}(W),Sc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=ya+h,c=xa+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Mc(i,r,a-h,c-o),new sn(i+ya,r+xa,h,o)]).init(n):null},Tc=function(t){function n(n,i){void 0===i&&(i=r.IMAGE);var e=t.call(this,i)||this;return null!=n&&(e.image=n,e.size.set(n.width,n.height)),e.fill.alpha=1,e}return _(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(hu),jc=function(t,n,i){return Eo(t,n,i||new Tc)},Nc=function(){e[r.IMAGE]=Sc,n[r.IMAGE]=jc},Ic=[0,0],Cc=new t.Point,Ac=function(t,n){for(var i=3*n-1,r=3*(n+9)-1;i<r;)t[++i]=0,t[++i]=0,t[++i]=2},Rc=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},kc=function(t,n,i,r,e,u,s,h){var a=o(e),c=u/h[0],f=s/h[1],l=.5*(c+f),v=12,b=-1+i,d=6*n-1;t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0},Lc=function(t,n,i,r,e,u,s,h){var o=Cc,a=.5*e,c=.5*u;o.set(i-a,r-c),s.apply(o,o);var f=o.x,l=o.y;o.set(i+a,r-c),s.apply(o,o);var v=o.x,b=o.y;o.set(i+a,r+c),s.apply(o,o);var d=o.x,g=o.y,m=f+(d-v),w=l+(g-b),p=(n<<1)-1;t[++p]=f,t[++p]=l,t[++p]=.5*(f+v),t[++p]=.5*(l+b),t[++p]=v,t[++p]=b,t[++p]=.5*(f+m),t[++p]=.5*(l+w),t[++p]=.5*(f+d),t[++p]=.5*(l+g),t[++p]=.5*(v+d),t[++p]=.5*(b+g),t[++p]=m,t[++p]=w,t[++p]=.5*(m+d),t[++p]=.5*(w+g),t[++p]=d,t[++p]=g,h[0]=.5*O(f,l,v,b),h[1]=.5*O(f,l,m,w)},yc=function(t,n,i){var r=i.x0,e=i.y0,u=i.x1,s=i.y1,h=i.x2,o=i.y2,a=i.x3,c=i.y3,f=(n<<1)-1;t[++f]=r,t[++f]=e,t[++f]=.5*(u+r),t[++f]=.5*(s+e),t[++f]=u,t[++f]=s,t[++f]=.5*(r+a),t[++f]=.5*(e+c),t[++f]=.5*(r+h),t[++f]=.5*(e+o),t[++f]=.5*(u+h),t[++f]=.5*(s+o),t[++f]=a,t[++f]=c,t[++f]=.5*(a+h),t[++f]=.5*(c+o),t[++f]=h,t[++f]=o},xc=function(t){function n(n,i){var r=t.call(this,n,i,9,8)||this;return r.textureWidth=-1,r.textureHeight=-1,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset;t.updateClippings(),t.updateIndices(),Ac(t.clippings,n),Rc(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=K(n),b=v.width*v.resolution,d=v.height*v.resolution,g=this.textureWidth!==b||this.textureHeight!==d;(u||h||l||g)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.textureWidth=b,this.textureHeight=d,t.updateVertices(),Lc(t.vertices,this.vertexOffset,0,0,r,e,n.transform.internalTransform,Ic),t.updateSteps(),kc(t.steps,this.vertexOffset,a,c,f,b,d,Ic))},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),yc(t.uvs,this.vertexOffset,J(i)))},n}(W),Bc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new xc(i,r),new sn(i+9,r+8,h,o)]).init(n):null},_c=function(t){function n(n,i){return void 0===i&&(i=r.IMAGE_SDF),t.call(this,n,i)||this}return _(n,t),n.prototype.clone=function(){return new n(this.image,this.type).copy(this)},n}(Tc),Pc=function(t,n,i){return Eo(t,n,i||new _c)},Fc=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=K(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Uc=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=h,c=o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Fc(i,r,a-h,c-o),new sn(i,r,h,o)]).init(n):null},Gc=function(t){function n(n){return void 0===n&&(n=r.LABEL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Jt),Hc=function(t,n,i){return Eo(t,n,i||new Gc)},zc=function(){e[r.LABEL]=Uc,n[r.LABEL]=Hc},Vc=function(t){function n(n){void 0===n&&(n=r.LINE);var i=t.call(this,n)||this;return i.jt=new fe(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.jt.serialize(n),i},n}(rn),Wc=function(t,n,i){i=i||new Vc;var r=Eo(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=z.NON_SCALING_MASK|z.DOTTED_MASK|z.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},Xc=function(){e[r.LINE]=qa,n[r.LINE]=Wc},Kc=function(t,n,i){for(var r=3*n,e=3*(n+i);r<e;r+=3)t[r+0]=0,t[r+1]=0,t[r+2]=0},Yc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Jc=function(t,n,i){for(var r=6*n,e=6*(n+i);r<e;r+=6)t[r+0]=0,t[r+1]=0,t[r+2]=0,t[r+3]=0,t[r+4]=0,t[r+5]=0},Zc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},qc=function(t){return 12*Math.ceil(t/12)},Qc=function(t,n,i,r,e,u,s,h){if(u)if(i.isStaticColor()){var o=i.getColor(0,s);if(i.isStaticAlpha()){var a=i.getAlpha(0,h);V(o,a,t,n*r,e)}else for(var c=0,f=t;c<r;c+=1,f+=n)a=i.getAlpha(c,h),V(o,a,f,n,e)}else if(i.isStaticAlpha())for(a=i.getAlpha(0,h),c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),V(o,a,f,n,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),a=i.getAlpha(c,h),V(o,a,f,n,e);else if(i.isStaticColor())o=i.getColor(0,s),V(o,0,t,n*r,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),V(o,0,f,n,e)},$c=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e)||this;return s.pointId=-1,s.pointCount=0,s.pointCountReserved=u,s.pointSizeId=-1,s.pointOffsetId=-1,s.pointFillId=-1,s.pointStrokeId=-1,s}return _(n,t),n.prototype.isCompatible=function(t){return qc(ua(t.points))===this.pointCountReserved},n.prototype.updateLineOfAnyColorFill=function(t,n,i,r){var e=i.fill,u=e.id,s=u!==this.pointFillId,h=n.fill,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorFill||c!==this.alphaFill;(s||f)&&(this.colorFill=a,this.alphaFill=c,this.pointFillId=u,t.updateColorFills(),Qc(this.vertexOffset,r,e,this.pointCountReserved,t.colorFills,o,a,c))},n.prototype.updateLineOfAnyColorStroke=function(t,n,i,r){var e=i.stroke,u=e.id,s=u!==this.pointStrokeId,h=n.stroke,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorStroke||c!==this.alphaStroke;(s||f)&&(this.colorStroke=a,this.alphaStroke=c,this.pointStrokeId=u,t.updateColorStrokes(),Qc(this.vertexOffset,r,e,this.pointCountReserved,t.colorStrokes,o,a,c))},n}(W),tf=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=3*e,h=3*n,o=0;o<i;++o)t[s+0]=t[h+0],t[s+1]=t[h+1],t[s+2]=t[h+2],s+=3,h+=3;e+=i}},nf=function(t,n,i,r,e){for(var u=n,s=i+r,h=1;h<e;++h){for(var o=3*s,a=3*i,c=0;c<r;++c)t[o+0]=t[a+0]+u,t[o+1]=t[a+1]+u,t[o+2]=t[a+2]+u,o+=3,a+=3;u+=n,s+=r}},rf=function(t,n,i,r){for(var e=6*n,u=6*(n+i),s=1;s<r;++s)for(var h=e,o=0;o<i;++o)t[u+0]=t[h+0],t[u+1]=t[h+1],t[u+2]=t[h+2],t[u+3]=t[h+3],t[u+4]=t[h+4],t[u+5]=t[h+5],u+=6,h+=6},ef=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=e<<1,h=n<<1,o=0;o<i;++o)t[s]=t[h],t[s+1]=t[h+1],s+=2,h+=2;e+=i}},uf=function(t,n,i,r,e,u,s){var h=n.a,o=n.b,a=n.c,c=n.d,f=e-1,l=i+f*r;if(s.isStaticX()&&s.isStaticY())for(var v=s.getX(0),b=s.getY(0);0<=f;--f){for(var d=h*(D=u[O=f<<1]+v)+a*(E=u[O+1]+b),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}else for(;0<=f;--f){var O,D,E;for(d=h*(D=u[O=f<<1]+s.getX(f))+a*(E=u[O+1]+s.getY(f)),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}},sf=function(t){return pt(t)||null==t},hf=function(t,n,i){return pt(n)?n:wt(n)?n(t):n?n[t%n.length]:i},of=function(){function t(t){this.p=t,this.R=0,this.S=null,this.T=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.T!==n&&(i=!0,this.T=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getColor=function(t,n){return hf(t,this.S,n)},t.prototype.getAlpha=function(t,n){return hf(t,this.T,n)},t.prototype.isStaticColor=function(){return sf(this.S)},t.prototype.isStaticAlpha=function(){return sf(this.T)},t.prototype.toDirty=function(){this.R+=1},t}(),af=function(){function t(t,n,i){this.p=t,this.R=0,this._x=null,this._y=null,this.No=n,this.Io=i,this.Co=null,this.Ao=0,this.Ro=-1,this.ko=0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"limit",{get:function(){return this.Co},set:function(t){this.Co=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this._x!==t&&(i=!0,this._x=t),void 0!==n&&this._y!==n&&(i=!0,this._y=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getX=function(t){return hf(t,this._x,this.No)},t.prototype.getY=function(t){return hf(t,this._y,this.Io)},t.prototype.getLimit=function(){var t=this.Co;return null!=t?t:(this.updateLimitComputed(),this.Ao)},t.prototype.updateLimitComputed=function(){var t=this.R,n=this.p.length;this.Ro===t&&this.ko===n||(this.Ro=t,this.ko=n,this.Ao=Math.max(this.calcLimit(this._x,n,this.No),this.calcLimit(this._y,n,this.Io)))},t.prototype.calcLimit=function(t,n,i){if(pt(t))return Math.abs(t);if(wt(t)){if(0<n){for(var r=Math.abs(t(0)),e=1;e<n;++e)r=Math.max(r,Math.abs(t(e)));return r}return 0}if(null!=t){var u=t.length;if(0<u){for(r=t[0],e=1;e<u;++e)r=Math.max(r,Math.abs(t[e]));return r}return 0}return Math.abs(i)},t.prototype.isStaticX=function(){return sf(this._x)},t.prototype.isStaticY=function(){return sf(this._y)},t.prototype.toDirty=function(){this.R+=1},t}(),cf=function(){function t(t){this.p=t,this.R=0,this.S=null,this.T=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.S!==t&&(i=!0,this.S=t),void 0!==n&&this.T!==n&&(i=!0,this.T=n),i&&(this.R+=1,this.p.updateUploaded())},t.prototype.getColor=function(t,n){return hf(t,this.S,n)},t.prototype.getAlpha=function(t,n){return hf(t,this.T,n)},t.prototype.isStaticColor=function(){return sf(this.S)},t.prototype.isStaticAlpha=function(){return sf(this.T)},t.prototype.toDirty=function(){this.R+=1},t}(),ff=function(){function n(t){this.p=t,this.k=[],this.Lo=0,this.L=[],this.j=new af(this,q.SIZE_X,q.SIZE_Y),this.vn=new af(this,0,0),this.C=new of(t),this.yo=new cf(t),this.R=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this.k.length>>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.k},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return z.NONE},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.A;return null==t&&(t=nt.getInstance(),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"size",{get:function(){return this.j},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"offset",{get:function(){return this.vn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){return this.C},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"stroke",{get:function(){return this.yo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return this.set(t.values,t.segments,t.style)},n.prototype.set=function(t,n,i){var r=!1,e=!1;if(null!=t){var u=this.k,s=this.Lo,h=t.length;if(u!==t){for(var o=Math.min(s,h),a=0;a<o;++a)u[a]=t[a];for(a=o;a<h;++a)u.push(t[a]);s!==h?(u.length=h,this.Lo=h,r=!0):e=!0}else s!==h?(this.Lo=h,r=!0):e=!0}if(r){this.R+=1;var c=this.p,f=c.uploaded;f?f.isCompatible(c)?c.updateUploaded():(c.uploaded=void 0,c.toDirty()):c.updateUploaded()}else e&&(this.R+=1,this.p.updateUploaded());return this},n.prototype.updateUploaded=function(){this.p.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[]")},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o,a){var c=this.formatted,f=c.length,l=c.values,v=this.j,b=this.vn,d=0,g=f;if(h){var m=.5*v.getLimit(),w=b.getLimit(),p=n.WORK_RANGE;h(t,i,m,m,w,w,s,l,p),d=p[0],g=p[1]}for(var O=d,D=Math.min(g,f);O<D;++O){var E=O<<1,M=l[E],S=l[E+1];if(o(t,i,.5*v.getX(O),.5*v.getY(O),b.getX(O),b.getY(O),M,S,r,e,u,O,s,a))return!0}return!1},n.WORK_RANGE=[0,0],n}(),lf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(Yo(n,r),tf(n,r,9,u),Jo(i,r,e),nf(i,9,e,8,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof ff&&(this.updateVertexAndStep(t,n,i),this.updateLineOfAnyColorFill(t,n,i,9),this.updateLineOfAnyColorStroke(t,n,i,9),this.updateUv(t,n))},n.prototype.updateVertexAndStep=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=X(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p;if(s||a||v||d||O){this.pointId=r;var D=i.formatted;this.pointCount=D.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeStyle=p,t.updateVertices(),t.updateSteps();var E=this.pointCount,M=D.values,S=this.vertexOffset,T=t.vertices,j=t.steps,N=t.clippings,I=n.transform.internalTransform;if(0<E&&h.isStaticX()&&h.isStaticY()){var C=h.getX(0),A=h.getY(0);Zo(T,S,0,0,C,A,m,w,I,Xo),uf(T,I,S,9,E,M,e),qo(j,N,S,w,p,Xo),rf(j,S,9,E)}else for(var R=0;R<E;++R){var k=R<<1,L=M[k]+e.getX(R),y=M[k+1]+e.getY(R),x=(C=h.getX(R),A=h.getY(R),S+9*R);Zo(T,x,L,y,C,A,m,w,I,Xo),qo(j,N,x,w,p,Xo)}var B=S+9*E,_=9*(this.pointCountReserved-E);Yc(T,B,_),Jc(j,B,_)}},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=t.uvs,u=this.vertexOffset,s=J(i),h=this.pointCountReserved;0<h&&(Qo(e,u,s),ef(e,u,9,h))}},n}($c),vf=function(t,n,i,r,e,s,h,o){var a=M(n),c=4*a,f=2*a,l=n.points,v=qc(ua(l)),b=v*r,d=v*s,g=b+c,m=d+f;return t.check(i,e,g,m)?new u(t,i,e,g,m,[new o(i,e,b,d,v),new sn(i+b,e+d,c,f)]).init(n):null},bf=function(t,n,i,r,e){return vf(t,n,i,9,r,8,0,lf)},df=function(t){function n(n){void 0===n&&(n=r.LINE_OF_CIRCLES);var i=t.call(this,n)||this;return i.jt=new ff(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.jt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.jt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.jt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.jt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(na),gf=function(t,n,i){return Eo(t,n,i||new df)},mf=function(){e[r.LINE_OF_CIRCLES]=bf,n[r.LINE_OF_CIRCLES]=gf},wf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(Co(n,i,r),nf(n,jo,r,24,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof ff&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,jo),this.updateLineOfAnyColorStroke(t,n,i,jo))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=n.radius,b=f!==this.sizeX||l!==this.sizeY||v!==this.radius,d=X(n),g=this.transformLocalId!==d,m=n.stroke,w=m.align,p=m.enable?m.width:0,O=m.side,D=m.style,E=this.strokeAlign!==w||this.strokeWidth!==p||this.strokeSide!==O||this.strokeStyle!==D,M=n.corner,S=M!==this.corner,T=K(n),j=Y(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||b||E;if(I||g||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=v,this.transformLocalId=d,this.strokeAlign=w,this.strokeWidth=p,this.strokeSide=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||g)&&t.updateSteps(),(I||S)&&t.updateClippings(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,k=this.vertexOffset,L=t.vertices,y=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=J(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var F=h.getX(0),U=h.getY(0);Ao(L,k,0,0,F,U,w,p,v,_,No),uf(L,_,k,jo,A,R,e),(I||g)&&(ko(x,k,p,O,D,M,No),rf(x,k,jo,A)),(I||S)&&(Ro(y,k,M,No),tf(y,k,jo,A)),(I||N)&&(Lo(B,k,P,No),ef(B,k,jo,A))}else for(var G=0;G<A;++G){var H=G<<1,z=R[H]+e.getX(G),V=R[H+1]+e.getY(G),W=(F=h.getX(G),U=h.getY(G),k+G*jo);Ao(L,W,z,V,F,U,w,p,v,_,No),(I||g)&&ko(x,W,p,O,D,M,No),(I||S)&&Ro(y,W,M,No),(I||N)&&Lo(B,W,P,No)}var Z=this.pointCountReserved,q=k+A*jo,Q=jo*(Z-A);Yc(L,q,Q),Jc(x,q,Q),Kc(y,q,Q),Zc(B,q,Q)}},n}($c),pf=function(t,n,i,r,e){return vf(t,n,i,jo,r,24,0,wf)},Of=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.jt=new ff(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.jt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.jt.calcHitPointAbs(t,n,h,e,u,s,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.jt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.jt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(Fo),Df=function(t,n,i){return Eo(t,n,i||new Of)},Ef=function(){e[r.LINE_OF_RECTANGLE_ROUNDEDS]=pf,n[r.LINE_OF_RECTANGLE_ROUNDEDS]=Df,jr.set(r.LINE_OF_RECTANGLE_ROUNDEDS,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},Mf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(Fa(n,i,r),nf(n,ya,r,xa,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof ff&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,ya),this.updateLineOfAnyColorStroke(t,n,i,ya))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=X(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.side,O=g.style,D=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeSide!==p||this.strokeStyle!==O,E=K(n),M=Y(E),S=E!==this.texture||M!==this.textureTransformId,T=s||a||v||D;if(T||d||S){this.pointId=r;var j=i.formatted;this.pointCount=j.length,this.pointOffsetId=u,this.pointSizeId=o,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeSide=p,this.strokeStyle=O,this.texture=E,this.textureTransformId=M,t.updateVertices(),(T||d)&&t.updateSteps(),T&&t.updateClippings(),(T||S)&&t.updateUvs();var N=this.pointCount,I=j.values,C=this.vertexOffset,A=t.vertices,R=t.clippings,k=t.steps,L=t.uvs,y=n.transform.internalTransform,x=J(E);if(0<N&&h.isStaticX()&&h.isStaticY()){var B=h.getX(0),_=h.getY(0);Ua(A,C,0,0,B,_,m,w,y,Ba),uf(A,y,C,ya,N,I,e),(T||d)&&(Ga(C,k,w,p,O,Ba),rf(k,C,ya,N)),T&&(Pa(R,C,Ba),tf(R,C,ya,N)),(T||S)&&(za(L,C,x,Ba),ef(L,C,ya,N))}else for(var P=0;P<N;++P){var F=P<<1,U=I[F]+e.getX(P),G=I[F+1]+e.getY(P),H=(B=h.getX(P),_=h.getY(P),C+P*ya);Ua(A,H,U,G,B,_,m,w,y,Ba),(T||d)&&Ga(H,k,w,p,O,Ba),T&&Pa(R,H,Ba),(T||S)&&za(L,H,x,Ba)}var z=this.pointCountReserved,V=C+N*ya,W=ya*(z-N);Yc(A,V,W),Jc(k,V,W),Kc(R,V,W),Zc(L,V,W)}},n}($c),Sf=function(t,n,i,r,e){return vf(t,n,i,ya,r,xa,0,Mf)},Tf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_RECTANGLES);var i=t.call(this,n)||this;return i.jt=new ff(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.jt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.jt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.jt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.jt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(hu),jf=function(t,n,i){return Eo(t,n,i||new Tf)},Nf=function(){e[r.LINE_OF_RECTANGLES]=Sf,n[r.LINE_OF_RECTANGLES]=jf,jr.set(r.LINE_OF_RECTANGLES,Ct.PRIMITIVE|Ct.STROKE_SIDE)},If=22,Cf=[0,0,0,0,0],Af=new t.Point,Rf=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+6,t[++r]=n+7,t[++r]=n+8,t[++r]=n+9,t[++r]=n+11,t[++r]=n+9,t[++r]=n+10,t[++r]=n+11,t[++r]=n+12,t[++r]=n+13,t[++r]=n+16,t[++r]=n+13,t[++r]=n+14,t[++r]=n+16,t[++r]=n+14,t[++r]=n+15,t[++r]=n+16,t[++r]=n+12,t[++r]=n+16,t[++r]=n+19,t[++r]=n+16,t[++r]=n+17,t[++r]=n+19,t[++r]=n+17,t[++r]=n+18,t[++r]=n+19,t[++r]=n+12,t[++r]=n+19,t[++r]=n+13,t[++r]=n+19,t[++r]=n+20,t[++r]=n+13,t[++r]=n+20,t[++r]=n+21,t[++r]=n+13},kf=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.sqrt(l*l+4*v*v),d=2*l*v/(l+b),g=d*o/(2*v),m=.5*(b-d)*o/b,w=g*b/(2*l),p=Af;p.set(i,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r),a.apply(p,p);var M=p.x,S=p.y;p.set(i+l,r),a.apply(p,p);var T=M-D,j=S-E,N=p.x+T,I=p.y+j,C=M+(M-p.x)+T,A=S+(S-p.y)+j,R=N-D,k=I-E,L=D+m*R,y=E+m*k,x=N-g*R,B=I-g*k,_=w*(C-N),P=w*(A-I),F=N+_,U=I+P,G=C-_,H=A-P,z=D-C,V=E-A,W=C+g*z,X=A+g*V,K=D-m*z,Y=E-m*V;p.set(i,r+v-d),a.apply(p,p);var J=p.x,Z=p.y,q=D+o*(J-D),Q=E+o*(Z-E),$=N+o*(J-N),tt=I+o*(Z-I),nt=C+o*(J-C),it=A+o*(Z-A),rt=M+T,et=S+j;c[0]=O(rt,et,J,Z),c[1]=w,c[2]=g,c[3]=m,c[4]=1-.5*d/v;var ut=2*n-1;t[++ut]=q,t[++ut]=Q,t[++ut]=K,t[++ut]=Y,t[++ut]=D,t[++ut]=E,t[++ut]=L,t[++ut]=y,t[++ut]=$,t[++ut]=tt,t[++ut]=x,t[++ut]=B,t[++ut]=N,t[++ut]=I,t[++ut]=F,t[++ut]=U,t[++ut]=nt,t[++ut]=it,t[++ut]=G,t[++ut]=H,t[++ut]=C,t[++ut]=A,t[++ut]=W,t[++ut]=X,t[++ut]=J,t[++ut]=Z,t[++ut]=q,t[++ut]=Q,t[++ut]=L,t[++ut]=y,t[++ut]=x,t[++ut]=B,t[++ut]=$,t[++ut]=tt,t[++ut]=F,t[++ut]=U,t[++ut]=G,t[++ut]=H,t[++ut]=nt,t[++ut]=it,t[++ut]=W,t[++ut]=X,t[++ut]=K,t[++ut]=Y},Lf=function(t,n,i,r){var e=3*n-1,u=1-r;i&ut.TOP?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&ut.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&ut.BOTTOM_LEFT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0},yf=function(t,n,i,r,e,u,s){for(var h=o(e),a=s[0],c=u*a,f=3*i,l=6*i-1,v=0;v<If;v+=1,f+=3)t[++l]=r,t[++l]=h,.5<n[f+2]?(t[++l]=c,t[++l]=c,t[++l]=1+n[f],t[++l]=1+n[f+1]):(t[++l]=a,t[++l]=a,t[++l]=1+n[f],t[++l]=1+n[f+1])},xf=function(t,n,i,r,e){var u=i.x0,s=i.x1,h=i.x2,o=i.x3,a=i.y0,c=i.y1,f=i.y2,l=i.y3,v=.5*(u+s),b=.5*(a+c),d=e[4],g=v+d*(o-u),m=b+d*(l-a),w=e[1],p=e[2],O=e[3],D=v+O*(o-v),E=b+O*(l-b),M=v+r*(g-v),S=b+r*(m-b),T=v+O*(h-v),j=b+O*(f-b),N=h+p*(v-h),I=f+p*(b-f),C=h+r*(g-h),A=f+r*(m-f),R=h+w*(o-h),k=f+w*(l-f),L=o+w*(h-o),y=l+w*(f-l),x=o+r*(g-o),B=l+r*(m-l),_=o+p*(v-o),P=l+p*(b-l),F=2*n-1;t[++F]=M,t[++F]=S,t[++F]=D,t[++F]=E,t[++F]=v,t[++F]=b,t[++F]=T,t[++F]=j,t[++F]=C,t[++F]=A,t[++F]=N,t[++F]=I,t[++F]=h,t[++F]=f,t[++F]=R,t[++F]=k,t[++F]=x,t[++F]=B,t[++F]=L,t[++F]=y,t[++F]=o,t[++F]=l,t[++F]=_,t[++F]=P,t[++F]=g,t[++F]=m,t[++F]=M,t[++F]=S,t[++F]=T,t[++F]=j,t[++F]=N,t[++F]=I,t[++F]=C,t[++F]=A,t[++F]=R,t[++F]=k,t[++F]=L,t[++F]=y,t[++F]=x,t[++F]=B,t[++F]=_,t[++F]=P,t[++F]=D,t[++F]=E},Bf=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=this.vertexOffset,i=this.indexOffset,r=this.pointCountReserved;0<r&&(Rf(t.indices,n,i),nf(t.indices,If,i,15,r))},n.prototype.update=function(t,n){var i=n.points;i instanceof ff&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,If),this.updateLineOfAnyColorStroke(t,n,i,If))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=n.radius,d=b!==this.radius,g=X(n),m=this.transformLocalId!==g,w=n.stroke,p=w.align,O=w.enable?w.width:0,D=w.style,E=this.strokeAlign!==p||this.strokeWidth!==O||this.strokeStyle!==D,M=n.corner,S=this.corner!==M,T=K(n),j=Y(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||v||d||E;if(I||m||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=b,this.transformLocalId=g,this.strokeAlign=p,this.strokeWidth=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||S)&&t.updateClippings(),(I||m||S)&&t.updateSteps(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,k=this.vertexOffset,L=t.vertices,y=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=J(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var F=h.getX(0),U=h.getY(0);kf(L,k,0,0,F,U,p,O,b,_,Cf),uf(L,_,k,If,A,R,e),(I||S)&&(Lf(y,k,M,b),tf(y,k,If,A)),(I||m||S)&&(yf(x,y,k,O,D,b,Cf),rf(x,k,If,A)),(I||N)&&(xf(B,k,P,b,Cf),ef(B,k,If,A))}else for(var G=0;G<A;++G){var H=G<<1,z=R[H]+e.getX(G),V=R[H+1]+e.getY(G),W=(F=h.getX(G),U=h.getY(G),k+G*If);kf(L,W,z,V,F,U,p,O,b,_,Cf),(I||S)&&Lf(y,W,M,b),(I||m||S)&&yf(x,y,W,O,D,b,Cf),(I||N)&&xf(B,W,P,b,Cf)}var Z=this.pointCountReserved,q=k+A*If,Q=If*(Z-A);Yc(L,q,Q),Jc(x,q,Q),Kc(y,q,Q),Zc(B,q,Q)}},n}($c),_f=function(t,n,i,r,e){return vf(t,n,i,If,r,15,0,Bf)},Pf=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=u+f*(h-u)-r,w=s+f*(o-s)-e,p=Math.sqrt(m*m+w*w),O=1e-5;if(O<p){var D=1/p,E=m*D,M=w*D,S=(u+l*(a-u)-r)*D,T=(s+l*(c-s)-e)*D,j=E*T-S*M;if(O<Math.abs(j)){var N=1/j,I=n-r,C=i-e;if(function(t,n,i,r,e,u,s){if(t.fill.enable){if(n*n+i*i<=r*r)return!0}else if(0<u){var h=n*n+i*i;if(h<=r*r){var o=Math.max(0,r*(1-u*s/e));if(o*o<=h)return!0}}return!1}(t,(+T*I-S*C)*N,(-M*I+E*C)*N,p,v*b,d,g))return!0}}return!1},Ff=function(t,n,i,r,e,u,s){var h=2*e/r;if($t(n,i,h,-e,+e)){var o=Math.sqrt(r*r+4*e*e),a=2*r*e/(r+o),c=t.radius,f=e-a,l=-e,v=+r,b=+e,d=-v,g=+b,m=0+0*c,w=l+c*(f-l),p=v+c*(0-v),O=b+c*(f-b),D=+O,E=-p,M=-h*n+w-i<=0,S=+h*n+w-i<=0,T=i<=O,j=t.corner;if(!M&&!S&&j&ut.TOP){var N=.5*(o-a)*c/o;if(Pf(t,n,i,m,w,0,l,d,g,v,b,N,N,a,c,u,s))return!0}else if(!M&&!T&&j&ut.BOTTOM_LEFT){if(Pf(t,n,i,E,D,d,g,v,b,0,l,(I=a*c/(2*e))*o/(2*r),I,a,c,u,s))return!0}else if(!S&&!T&&j&ut.BOTTOM_RIGHT){var I;if(Pf(t,n,i,p,O,v,b,0,l,d,g,I=a*c/(2*e),I*o/(2*r),a,c,u,s))return!0}else{if(t.fill.enable)return!0;if(0<u){var C=u*s,A=e-a,R=A+(-e-A)*Math.max(0,a-C)/a;if(!$t(n,i,h,R,e-C))return!0}}}return!1},Uf=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Ff(this,n,i,r,e,u,s)},n}(Jt),Gf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLE_ROUNDEDS);var i=t.call(this,n)||this;return i.jt=new ff(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.jt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.jt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.jt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.jt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(Uf),Hf=function(t,n,i){return Eo(t,n,i||new Gf)},zf=function(){e[r.LINE_OF_TRIANGLE_ROUNDEDS]=_f,n[r.LINE_OF_TRIANGLE_ROUNDEDS]=Hf,jr.set(r.LINE_OF_TRIANGLE_ROUNDEDS,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},Vf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(Da(n,r),tf(n,r,7,u),Ea(i,r,e),nf(i,7,e,3,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof ff&&(this.updateVertexStepAndUvs(t,n,i),this.updateLineOfAnyColorFill(t,n,i,7),this.updateLineOfAnyColorStroke(t,n,i,7))},n.prototype.updateVertexStepAndUvs=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=X(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p,D=K(n),E=Y(D),M=D!==this.texture||E!==this.textureTransformId,S=s||a||v||O;if(S||d||M){this.pointId=r;var T=i.formatted;this.pointCount=T.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeAlign=m,this.strokeWidth=w,this.strokeStyle=p,t.updateVertices(),(S||d)&&t.updateSteps(),(S||M)&&t.updateUvs();var j=this.pointCount,N=T.values,I=this.vertexOffset,C=t.vertices,A=t.steps,R=t.clippings,k=t.uvs,L=J(D),y=n.transform.internalTransform;if(0<j&&h.isStaticX()&&h.isStaticY()){var x=h.getX(0),B=h.getY(0);Ma(C,I,0,0,x,B,m,w,y,pa),uf(C,y,I,7,j,N,e),(S||d)&&(Sa(A,R,I,7,w,p,pa),rf(A,I,7,j)),(S||M)&&(Ta(k,L,I,pa),ef(k,I,7,j))}else for(var _=0;_<j;++_){var P=_<<1,F=N[P]+e.getX(_),U=N[P+1]+e.getY(_),G=(x=h.getX(_),B=h.getY(_),I+7*_);Ma(C,G,F,U,x,B,m,w,y,pa),(S||d)&&Sa(A,R,G,7,w,p,pa),(S||M)&&Ta(k,L,G,pa)}var H=I+7*j,z=7*(this.pointCountReserved-j);Yc(C,H,z),Jc(A,H,z),Zc(k,H,z)}},n}($c),Wf=function(t,n,i,r,e){return vf(t,n,i,7,r,3,0,Vf)},Xf=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&tn(this,n,i,r,e,u,s)},n}(Jt),Kf=function(t){function n(n){void 0===n&&(n=r.LINE_OF_TRIANGLES);var i=t.call(this,n)||this;return i.jt=new ff(i),i.xo=function(t,n,r,e,u,s,h,o,a,c,f){return i.containsPointAbs(t,n,r,e,u,s,h,o,a,c,f)},i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=nn(e,u,this.jt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.jt.calcHitPointAbs(t,n,e,u,s,h,null,this.xo,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||nn)(s.strokeWidth,s.strokeScale,this.jt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.jt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.xo,u)},n}(Xf),Yf=function(t,n,i){return Eo(t,n,i||new Kf)},Jf=function(){e[r.LINE_OF_TRIANGLES]=Wf,n[r.LINE_OF_TRIANGLES]=Yf},Zf=function(t,n,i,r){return new u(t,i,r,0,0,[new La(i,r)]).init(n)},qf=function(t){function n(n){return void 0===n&&(n=r.NULL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n}(Jt),Qf=function(t,n,i){return Eo(t,n,i||new qf)},$f=function(){e[r.NULL]=Zf,n[r.NULL]=Qf},tl=function(t,n,i){return Eo(t,n,i||new hu)},nl=function(){e[r.RECTANGLE]=Sc,n[r.RECTANGLE]=tl,jr.set(r.RECTANGLE,Ct.PRIMITIVE|Ct.STROKE_SIDE)},il=function(t,n,i){return Eo(t,n,i||new ou)},rl=function(t,n,i){return Eo(t,n,i||new Fo)},el=function(){e[r.RECTANGLE_ROUNDED]=xo,n[r.RECTANGLE_ROUNDED]=rl,jr.set(r.RECTANGLE_ROUNDED,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},ul=[0,0],sl=new t.Point,hl=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1},ol=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4},al=function(t,n,i,r,e,u,s,h,o,a){var c=sl,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D-w,S=E-p,T=2*n-1;t[++T]=b,t[++T]=d,t[++T]=g,t[++T]=m,t[++T]=g+w,t[++T]=m+p,t[++T]=M,t[++T]=S,t[++T]=D,t[++T]=E,t[++T]=D+w,t[++T]=E+p,a[0]=O(b,d,g,m),a[1]=O(b,d,M,S)},cl=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<6;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},fl=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a)},ll=function(t){function n(n,i){return t.call(this,n,i,6,4)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;hl(t.clippings,n),ol(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),al(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,ul),cl(t.steps,t.clippings,this.vertexOffset,c,f,ul))},n.prototype.updateUv=function(t,n){var i=K(n),r=Y(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=J(i);fl(t.uvs,this.vertexOffset,e)}},n}(W),vl=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=6+h,c=4+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new ll(i,r),new sn(i+6,r+4,h,o)]).init(n):null},bl=function(t,n,i,r,e,u,s){return i<=0&&Zt(t,n,i,r,e,u,s)},dl=function(t){function n(n){void 0===n&&(n=r.SEMICIRCLE);var i=t.call(this,n)||this;return i.stroke.side=qt.ALL&~qt.BOTTOM,i}return _(n,t),n.prototype.clone=function(){return new n(this.type).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&bl(this,n,i,r,e,u,s)},n}(Jt),gl=function(t,n,i){return Eo(t,n,i||new dl)},ml=function(){e[r.SEMICIRCLE]=vl,n[r.SEMICIRCLE]=gl},wl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices(),Da(t.clippings,this.vertexOffset),Ea(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=X(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=K(n),b=Y(v),d=v!==this.texture||b!==this.textureTransformId,g=u||l;if(g||h||d){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.texture=v,this.textureTransformId=b;var m=this.vertexOffset;t.updateVertices(),Ma(t.vertices,m,0,0,r,e,a,c,n.transform.internalTransform,pa),(g||h)&&(t.updateSteps(),Sa(t.steps,t.clippings,m,7,c,f,pa)),(g||d)&&(t.updateUvs(),Ta(t.uvs,J(v),m,pa))}},n}(W),pl=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=7+h,c=3+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new wl(i,r,a-h,c-o),new sn(i+7,r+3,h,o)]).init(n):null},Ol=function(t,n,i){return Eo(t,n,i||new Xf)},Dl=function(){e[r.TRIANGLE]=pl,n[r.TRIANGLE]=Ol},El=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Rf(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.radius,h=s!==this.radius,o=X(n),a=this.transformLocalId!==o,c=n.stroke,f=c.align,l=c.enable?c.width:0,v=c.style,b=this.strokeAlign!==f||this.strokeWidth!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=K(n),w=Y(m),p=m!==this.texture||w!==this.textureTransformId,O=u||h||b;if(O||a||g||p){this.sizeX=r,this.sizeY=e,this.radius=s,this.transformLocalId=o,this.strokeAlign=f,this.strokeWidth=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),kf(t.vertices,D,0,0,r,e,f,l,s,n.transform.internalTransform,Cf),(h||g)&&(t.updateClippings(),Lf(t.clippings,D,d,s)),(O||a||g)&&(t.updateSteps(),yf(t.steps,t.clippings,D,l,v,n.radius,Cf)),(O||p)&&(t.updateUvs(),xf(t.uvs,D,J(m),s,Cf))}},n}(W),Ml=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=If+h,c=15+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new El(i,r,a-h,c-o),new sn(i+If,r+15,h,o)]).init(n):null},Sl=function(t,n,i){return Eo(t,n,i||new Uf)},Tl=function(){e[r.TRIANGLE_ROUNDED]=Ml,n[r.TRIANGLE_ROUNDED]=Sl,jr.set(r.TRIANGLE_ROUNDED,Ct.PRIMITIVE|Ct.STROKE_SIDE|Ct.BORDER_RADIUS)},jl=function(){So(),Wo(),ra(),ec(),uc(),lc(),Ec(),wc(),Nc(),e[r.IMAGE_SDF]=Bc,n[r.IMAGE_SDF]=Pc,zc(),Xc(),$f(),e[r.RECTANGLE_PIVOTED]=hc,n[r.RECTANGLE_PIVOTED]=il,jr.set(r.RECTANGLE_PIVOTED,Ct.PRIMITIVE|Ct.STROKE_SIDE),el(),nl(),ml(),Tl(),Dl(),mf(),Ef(),Nf(),zf(),Jf()},Nl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DImage"},n}(Ts),Il=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).Ut=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:null,r}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.on(ir.tap,(function(t){i.onClick(t)}))},n.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){this.onSelect(t)},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),n.prototype.hasSelection=function(t){return t&&t.selection&&t.selection.add},n.prototype.getSelection=function(){for(var t=this.parent;t;){if(this.hasSelection(t))return t.selection;t=t.parent}return null},n.prototype.onSelect=function(t){this.emit("select",this.Ut,this);var n=this.getSelection();n&&n.add(this)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DMenuItemBase"},n}(Nl),Cl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getContext=function(){for(var t=this.parent;t;){if(t.getContext)return t.getContext();t=t.parent}return null},n.prototype.getCloseable=function(){for(var t=this.parent;t;){if(t.getCloseable)return t.getCloseable();t=t.parent}return null},n.prototype.getType=function(){return"DMenuItem"},n}(Il),Al=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.initOnOver(n),this.initShortcuts(n)},n.prototype.initOnOver=function(t){var n=this;this.on(ir.over,(function(){var t=n.getContext();null!=t&&n.parent instanceof hr&&t.trim(n.getCloseable())}))},n.prototype.initShortcuts=function(t){var n=this.ni;if(null!=n&&0<n.length){var i=n[0],r=nr.toString(i);this.Bo=this.createText(r),this.snippet.add(this.Bo,!0)}else this.Bo=null;this._o=this.theme.getShortcutTextMargin()},n.prototype.updateShortcutText=function(){var t=this.Bo,n=this._o;if(null!=t&&null!=n){var i,r=this.Wn;i=r.width.isOn?n:this.width-t.width-n;var e,u=this.Qn,s=u.getTop();e=r.height.isOn?s:s+.5*(this.height-s-u.getBottom()-t.height),t.position.set(i,e)}},n.prototype.updateTextColor=function(n){t.prototype.updateTextColor.call(this,n);var i=this.Bo;if(null!=i){var r=this.theme,e=this.state;i.style.fill=r.getShortcutColor(e),i.alpha=r.getShortcutAlpha(e)}},n.prototype.updateText=function(){t.prototype.updateText.call(this),this.updateShortcutText()},n.prototype.getType=function(){return"DMenuItemText"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n);var i=this.getCloseable();null!=i&&i.emit("select",this.value,this,i)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(Cl),Rl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),(null==n?void 0:n.check)&&(this.state.isActive=!0)},n.prototype.getType=function(){return"DMenuItemCheck"},n.prototype.onSelect=function(n){this.state.isActive=!this.state.isActive,t.prototype.onSelect.call(this,n)},n}(Al),kl=function(t){return"check"in t},Ll={OPEN_LINK:0,OPEN_LINK_IN_NEW_WINDOW:1,COPY_LINK_ADDRESS:2},yl=function(){function n(){}return n.addItemCreator=function(t){this.CREATORS.push(t)},n.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},n.setMenuCreator=function(t){this.MENU_CREATOR=t},n.newItemOf=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e](i,r);if(null!=s)return s}return n?n(i,r):null},n.newItem=function(t,n){return this.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)},n.newItemsOf=function(n,i,r,e){for(var u=0,s=r.length;u<s;++u){var h=r[u];if(h instanceof t.DisplayObject)i.addChild(h);else if(null!=h){var o=n.newItem(h,e);if(null==o)throw new Error("No matching menu item creator found: ".concat(JSON.stringify(h)));i.addChild(o)}}},n.newItems=function(t,n,i){this.newItemsOf(this,t,n,i)},n.newMenu=function(t){if(null!=this.MENU_CREATOR)return this.MENU_CREATOR(t);throw new Error("Missing DMenu creator.")},n.CREATORS=[],n.CREATOR_DEFAULT=null,n}(),xl=function(){function n(t,n){this.p=t,this.zn=n,this.vs=!0}return Object.defineProperty(n.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs=t},enumerable:!1,configurable:!0}),n.prototype.open=function(t){this.get().open(t)},n.prototype.get=function(){var t=this,n=this.Po;return null==n&&(n=this.toMenu(this.zn),this.Po=n,n.on("select",(function(n,i,r){t.onSelect(n,i,r)}))),n},n.prototype.toMenu=function(n){return n instanceof t.DisplayObject?n:this.newMenu(n)},n.prototype.newMenu=function(t){return yl.newMenu(t)},n.prototype.onSelect=function(t,n,i){var r=this.p;switch(t){case Ll.OPEN_LINK:r.open(!1);break;case Ll.OPEN_LINK_IN_NEW_WINDOW:r.open(!0);break;case Ll.COPY_LINK_ADDRESS:r.copy()}},n}(),Bl={AUTO:0,THIS_WINDOW:1,NEW_WINDOW:2},_l=function(t){var n=document.getSelection();if(n){var i=document.createRange();i.selectNodeContents(t),n.removeAllRanges(),n.addRange(i)}return n},Pl=function(t){return t.clipboardData||window.clipboardData},Fl=function(t){function n(){var n=t.call(this)||this,i=document.body;return i.addEventListener("copy",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("copy",Pl(t)))})),i.addEventListener("cut",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("cut",Pl(t)))})),i.addEventListener("paste",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("paste",Pl(t)))})),n}return _(n,t),n.copy=function(t){var n=navigator.clipboard;n&&n.writeText?n.writeText(t):function(t,n){if("undefined"==typeof ClipboardEvent){var i=t.clipboardData;if(void 0!==i&&void 0!==i.setData)return i.setData("Text",n),!0}return!1}(window,t)||function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important"),n.textContent="Dummy",document.body.appendChild(n);var i=_l(n),r=!1;if(i){var e=function(i){if(i.target===n){var e=Pl(i);e.setData("text/plain",t),r=e.getData("text/plain")===t,i.preventDefault()}};document.addEventListener("copy",e);try{document.execCommand("copy")}finally{document.removeEventListener("copy",e)}i.removeAllRanges()}return document.body.removeChild(n),r}(t)||navigator.userAgent.indexOf("Edge")<0&&function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important");var i=document.createElement("span");i.innerText=t,(n.attachShadow?n.attachShadow({mode:"open"}):n).appendChild(i),document.body.appendChild(n);var r=_l(n);r&&(document.execCommand("copy"),r.removeAllRanges()),document.body.removeChild(n)}(t)},n}(t.utils.EventEmitter),Ul=t.interaction.InteractionEvent,Gl=function(){function t(t){this.zn=t,this.Fo=null==t?void 0:t.url,this.ei=this.toNormalizedTarget(null==t?void 0:t.target),this.Uo=null==t?void 0:t.checker,this.vs=!0}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.Fo},set:function(t){this.Fo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this.ei},set:function(t){this.ei=this.toNormalizedTarget(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checker",{get:function(){return this.Uo},set:function(t){this.Uo=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"menu",{get:function(){var t=this.Po;return null==t&&(t=this.newMenu(),this.Po=t),t},enumerable:!1,configurable:!0}),t.prototype.newMenu=function(){var n=this.zn;if(n){var i=n.menu;if(i)return new xl(this,i)}var r=t.MENU;return null==r&&(r=new xl(this,Z.getInstance().get("DLink").getMenuOptions()),t.MENU=r),r},t.prototype.toStringifiedUrl=function(t,n){var i=wt(t)?t():t;null!=i&&(Ot(i)?n(i):i.then((function(t){null!=t&&n(t)})))},t.prototype.toNormalizedUrl=function(n){var i=t.ANCHOR_ELEMENT||document.createElement("a");return t.ANCHOR_ELEMENT=i,i.href=n,i.href},t.prototype.toNormalizedTarget=function(t){return Ai(null!=t?t:Bl.AUTO,Bl)},t.prototype.copy=function(){var t=this;this.toStringifiedUrl(this.Fo,(function(n){Fl.copy(t.toNormalizedUrl(n))}))},t.prototype.open=function(t){var n=this;this.toStringifiedUrl(this.Fo,(function(i){var r=!0===t||!1===t?t:n.inNewWindow(t);n.check(i,r,(function(){n.exec(i,r)}))}))},t.prototype.check=function(t,n,i){var r=this.Uo;if(r){var e=r();!0===e?i():!1===e||e.then((function(t){t&&i()}))}else i()},t.prototype.exec=function(t,n){if(n){var i=document.createElement("a");i.href=t,i.target="_blank",i.style.display="none",i.rel="noopener noreferrer",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),100)}else window.location.href=t},t.prototype.inNewWindow=function(t){switch(this.ei){case Bl.NEW_WINDOW:return!0;case Bl.THIS_WINDOW:return!1;case Bl.AUTO:if(null!=t){var n=t instanceof Ul?t.data.originalEvent:t;return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey||"button"in n&&0!==n.button}return!1}},t.prototype.onClick=function(t,n){if(this.ei===Bl.AUTO){var i=n.data.originalEvent;if("pointerType"in i&&"mouse"!==i.pointerType||"touches"in i){var r=this.menu;if(r.enable)return this.vs&&t.state.isActionable&&r.open(t),!0}}return!this.vs},t}(),Hl=function(){function t(){}return t.toStateOptions=function(t,n){if(n&&(t===Bl.NEW_WINDOW||"NEW_WINDOW"===t)){var i=n.state;if(null==i)n.state=ct.NEW_WINDOW;else if(Ot(i))i!==ct.NEW_WINDOW&&(n.state=[i,ct.NEW_WINDOW]);else if(mt(i))i.indexOf(ct.NEW_WINDOW)<0&&i.push(ct.NEW_WINDOW);else{var r=i.values;null==r?i.values=ct.NEW_WINDOW:Ot(r)?r!==ct.NEW_WINDOW&&(i.values=[r,ct.NEW_WINDOW]):r.indexOf(ct.NEW_WINDOW)<0&&r.push(ct.NEW_WINDOW)}}return n},t}(),zl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toLinkOptions=function(t){if(t)return{url:this.toUrl(t.url),target:t.target,checker:this.toChecker(t.checker),menu:t.menu}},n.prototype.toUrl=function(t){var n=this;return Ot(t)||null==t?t:function(){return t(n)}},n.prototype.toChecker=function(t){var n=this;if(null!=t)return function(){return t(n)}},n.prototype.init=function(n){t.prototype.init.call(this,Hl.toStateOptions(null==n?void 0:n.target,n))},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return null==t&&(t=new Gl(this.toLinkOptions(this.zn)),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},n.prototype.getType=function(){return"DMenuItemLink"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.activate(n)},n}(Al),Vl=function(t){return"url"in t},Wl=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t),this.initHover(t)},i.prototype.initHover=function(t){var n=this;this.on(ir.over,(function(){n.state.isActionable&&n.open()}))},i.prototype.toMenu=function(n){var i=null==n?void 0:n.menu;return i instanceof t.DisplayObject?i:this.newMenu(i)},i.prototype.newMenu=function(t){return yl.newMenu(t)},Object.defineProperty(i.prototype,"menu",{get:function(){var t=this,n=this.Po;return null==n&&((n=this.toMenu(this.zn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Po=n),n},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DMenuItemMenu"},i.prototype.open=function(){var t=this.menu;t.isHidden()&&this.onOpen(t)},i.prototype.onOpen=function(t){var n=this.getContext();null!=n&&t.open(this,this.getCloseable(),n)},i.prototype.close=function(){this.menu.close()},i.prototype.toggle=function(){var t=this.menu;t.isHidden()?this.onOpen(t):t.close()},i.prototype.onSelect=function(t){this.open(),n.prototype.onSelect.call(this,t)},i.prototype.onMenuSelect=function(t,n,i){var r=this.getCloseable();null!=r&&r.emit("select",t,n,r)},i.prototype.onKeyDown=function(t){return nr.isArrowRightKey(t)&&this.onKeyDownArrowRight(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyDownArrowRight=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},i}(Cl),Xl=function(t){return"menu"in t},Kl=function(n,i){var r=n.menu;return r instanceof t.DisplayObject||(null==r.sticky&&(r.sticky=i),null==r.align&&(r.align=Bu.RIGHT)),n},Yl=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){var r=t.state,e=t.border,u=e.getWidth(r),s=e.getColor(r);if(null!=s){var h=e.getAlpha(r),o=e.getAlign(r),a=t.padding,c=.5*i;this.clear(),this.lineStyle(u,s,h,o),this.moveTo(a.getLeft(),c),this.lineTo(n-a.getRight(),c),this.visible=!0}else this.clear(),this.visible=!1},n}(t.Graphics),Jl=function(t){return"separator"in t},Zl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){new Yl(this)},n.prototype.getType=function(){return"DMenuItemSeparator"},n}(Il),ql=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemSpace"},n}(Ku),Ql=function(t){return"space"in t},$l=function(){yl.addItemCreator((function(t){return kl(t)?new Rl(t):null})),yl.addItemCreator((function(t){return Vl(t)?new zl(t):null})),yl.addItemCreator((function(t,n){return Xl(t)?new Wl(Kl(t,n)):null})),yl.addItemCreator((function(t){return Jl(t)?new Zl(t):null})),yl.addItemCreator((function(t){return Ql(t)?new ql(t):null})),yl.setItemCreatorDefault((function(t){return new Al(t)}))},tv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableBody"},n}(Zu),nv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuItemExpandableHeader"},n}(Il),iv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return yl.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||yl.newItem(t,n)},t.newItems=function(t,n,i){yl.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),rv=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i,r=this;n.prototype.init.call(this,t);var e=this.theme,u=this.toHeader(e,t);this.jh=u,u.on("select",(function(){r.toggle()})),this.addChild(u);var s=this.toBody(e,t);this.Ie=s;var h=null!==(i=null==t?void 0:t.sticky)&&void 0!==i&&i;this.newItems(s,h,e,t),this.addChild(s),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.newItems=function(t,n,i,r){var e=null==r?void 0:r.items;null!=e&&iv.newItems(t,e,n)},i.prototype.toHeader=function(n,i){return i?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new nv(n)},i.prototype.toBody=function(n,i){var r=null==i?void 0:i.body;return r?r instanceof t.DisplayObject?r:this.newBody(n,r):this.newBody(n)},i.prototype.newBody=function(t,n){return new tv(n)},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.Ie;t instanceof hr?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.Ie;t instanceof hr?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.onKeyDown=function(t){if(nr.isArrowRightKey(t))this.state.isActionable&&!this.state.isActive&&(i=this.jh)instanceof hr&&i.state.isFocused&&(this.state.isActive=!0);else if(nr.isArrowLeftKey(t)){var i;if(this.state.isActionable&&this.state.isActive)return(i=this.jh)instanceof hr?i.focus():this.focus(),this.state.isActive=!1,n.prototype.onKeyDown.call(this,t),!0}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuItemExpandable"},i}(Zu),ev=function(t){return"header"in t},uv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemCheck"},n}(Rl),sv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemLink"},n}(zl),hv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSeparator"},n}(Zl),ov=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSpace"},n}(ql),av=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemText"},n}(Al),cv=function(){yl.addItemCreator((function(t){return ev(t)?new rv(t):null})),iv.addItemCreator((function(t){return kl(t)?new uv(t):null})),iv.addItemCreator((function(t){return Vl(t)?new sv(t):null})),iv.addItemCreator((function(t){return Jl(t)?new hv(t):null})),iv.addItemCreator((function(t){return Ql(t)?new ov(t):null})),iv.setItemCreatorDefault((function(t){return new av(t)}))},fv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemCheck"},n}(Rl),lv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemLink"},n}(zl),vv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initHover=function(t){},n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=t.prototype.getSelection.call(this);e&&e.add(i)},n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemMenu"},n}(Wl),bv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(Zl),dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSpace"},n}(ql),gv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemText"},n}(Al),mv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return yl.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||yl.newItem(t,n)},t.newItems=function(t,n,i){yl.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),wv=function(){mv.setItemCreatorDefault((function(t){return new gv(t)})),mv.addItemCreator((function(t){return Ql(t)?new dv(t):null})),mv.addItemCreator((function(t){return Jl(t)?new bv(t):null})),mv.addItemCreator((function(t,n){return Xl(t)?new vv(Kl(t,n)):null})),mv.addItemCreator((function(t){return Vl(t)?new lv(t):null})),mv.addItemCreator((function(t){return kl(t)?new fv(t):null}))},pv=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return yl.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||mv.newItem(t,n)},t.newItems=function(t,n,i){yl.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),Ov=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItems=function(t,n,i,r){null!=r&&null!=r.items&&pv.newItems(t,r.items,n)},n.prototype.getType=function(){return"DMenuSidedItemExpandable"},n}(rv),Dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemCheck"},n}(uv),Ev=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemLink"},n}(zl),Mv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemMenu"},n}(Wl),Sv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getType=function(){return"DMenuSidedItemExpandableItemMenu"},n}(Mv),Tv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(hv),jv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemSpace"},n}(ov),Nv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemText"},n}(av),Iv=function(){mv.addItemCreator((function(t){return ev(t)?new Ov(t):null})),pv.addItemCreator((function(t){return kl(t)?new Dv(t):null})),pv.addItemCreator((function(t){return Vl(t)?new Ev(t):null})),pv.addItemCreator((function(t,n){return Xl(t)?new Sv(Kl(t,n)):null})),pv.addItemCreator((function(t){return Jl(t)?new Tv(t):null})),pv.addItemCreator((function(t){return Ql(t)?new jv(t):null})),pv.setItemCreatorDefault((function(t){return new Nv(t)}))},Cv=function(){$l(),cv(),wv(),Iv()},Av=function(){Cv(),jl()},Rv=function(){function t(){}return t.add=function(t,n){var i=this.Ho;null==i&&(i=new Map,this.Ho=i);var r=i.get(t);null==r?(r=[n],i.set(t,r)):r.push(n)},t.get=function(t){var n=this.Ho;if(null!=n)return n.get(t)},t}(),kv=function(t){function n(n,i){return t.call(this,Ve.EMIT_EVENT,n,i,mu.EMIT_EVENT,"")||this}return _(n,t),n}(Au),Lv=function(t){function n(n,i,r){return t.call(this,n,i,"",mu.EMIT_EVENT,r)||this}return _(n,t),n}(Au),yv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e,"")||this}return _(n,t),n}(Au),xv=function(t){function n(n,i,r,e){return t.call(this,n,i,r,mu.EMIT_EVENT,e)||this}return _(n,t),n}(Au),Bv=function(t,n){return n?Do(t).then((function(t){var n=Se.getInstance().init();n.updateTexture(t),n.render();var i=document.createElement("canvas");return n.read(i),Bv(i.toDataURL(),!1)})):Do(t).then((function(t){return new _c(t)}))},_v=function(){function t(){}return t.from=function(t,n,i){var r=this,e=Je.toSerialized(t),u=e.pieces;return Je.toPieceData(n,u,i).then((function(t){return r.zo(e,i,u,t)}))},t.zo=function(t,n,i,r){var e=this,u=t.width,s=t.height,h=new Ye(u,s),o=new Sr(t,i,r,n,1);return Je.newLayer(t,h,o).then((function(){return e.create(t.name,u,s,h,n,0)}))},t.create=function(t,n,i,r,e,u){var s=new Br(t,e,u);return s.size.set(n,i),r.copyTo(s),s.size.init(),s},t}(),Pv=function(t){return"data:image/svg+xml;base64,".concat(btoa(t))},Fv=function(t){return Math.round(100*t)/100},Uv=function(){function t(){}return t.add=function(t){var n,i,r;(null!==(n=this.Zh)&&void 0!==n?n:this.Zh=new Map).set(t.type,t),(null!==(i=this.Re)&&void 0!==i?i:this.Re=new Map).set(t.id,t),(null!==(r=this.Xt)&&void 0!==r?r:this.Xt=[]).push(t)},t.get=function(t){var n=this.Zh;if(null!=n)return n.get(t)},t.getById=function(t){var n=this.Re;if(null!=n)return n.get(t)},t.each=function(t){var n=this.Xt;if(null!=n)for(var i=0,r=n.length;i<r;++i)t(n[i])},t}(),Gv=function(){function t(){}return t.toIndices=function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(t[i].index);return n},t.toDepth=function(t){for(var n=0,i=t.parent;i instanceof Rt;)n+=1,i=i.parent;return n},t.toSharedParent=function(t,n){if(this.toDepth(t)<this.toDepth(n)){for(var i=t.parent;i instanceof Rt;){if(this.isParent(n,i))return i;i=i.parent}return i}for(var r=n.parent;r instanceof Rt;){if(this.isParent(t,r))return r;r=r.parent}return r},t.toOfParent=function(t,n){for(var i=t.parent;i!==n&&i instanceof Rt;)t=i,i=i.parent;return t},t.isParent=function(t,n){for(var i=t.parent;i instanceof Rt;){if(i===n)return!0;i=i.parent}return!1},t.toSelected=function(t){for(var n=t;n instanceof Rt;){if(n.selected)return n;n=n.parent}return null},t.findChildById=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.id===i)return h;if(!0===r){var o=t.findChildById(h,i,r);if(null!=o)return o}}return null},t.findChildByType=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.type===i)return h;if(!0===r){var o=t.findChildByType(h,i,r);if(null!=o)return o}}return null},t.findChild=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(i(h))return h;if(!0===r){var o=t.findChild(h,i,r);if(null!=o)return o}}return null},t.findChildrenByType=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];o.type===i&&e.push(o),!0===r&&t.findChildrenByType(o,i,r,e)}return e},t.findChildren=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];i(o)&&e.push(o),!0===r&&t.findChildren(o,i,r,e)}return e},t.COMPARATOR_INDEX=function(t,n){return t.index-n.index},t}(),Hv=function(){function t(){}return t.delete=function(t,n,i){for(var r=t.children,e=r.length,u=0;u<e;++u)(o=r[u]).selected?o.index=e+u:o.index=u;if(r.sort(Gv.COMPARATOR_INDEX),!0===i){for(u=e-1;0<=u;--u){if(!(o=r[u]).selected){var s=r.length-(u+1);if(0<s){var h=r.splice(u+1,s);return null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h}return null!=n&&(n.length=0),null}o.index-=e,o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(h=r.splice(0,r.length),null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h):(null!=n&&(n.length=0),null)}for(u=e-1;0<=u;--u){var o;if(!(o=r[u]).selected)return r.length=u+1,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),null;o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(r.length=0,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty()):null!=n&&(n.length=0),null},t}(),zv=function(){function t(){}return t.from=function(t){if(Ot(t))return z[t];if(pt(t))return t;if(null!=t){for(var n=z.NONE,i=0,r=t.length;i<r;++i)n|=z[t[i]];return n}return z.NONE},t}(),Vv=function(){function t(){this.resources=[],this.resourceToIndex=new Map,this.data=[],this.dataToIndex=new Map,this.pieces=[],this.pieceToIndex=new Map,this.uuids=new Set,this.uuidNext=0}return t.prototype.addResource=function(t){return this.Vo(t,this.resources,this.resourceToIndex)},t.prototype.addData=function(t){return this.Vo(t,this.data,this.dataToIndex)},t.prototype.addPiece=function(t){return this.Vo(t,this.pieces,this.pieceToIndex)},t.prototype.addUuid=function(t){if(0!==t){var n=this.uuids;return n.has(t)?0:(n.add(t),t)}return 0},t.prototype.updateUuid=function(t){var n=this.uuids;if(0!==t)return t;var i=this.newUuid();return n.add(i),i},t.prototype.newUuid=function(){for(var t=this.uuids,n=this.uuidNext;;)if(0!==(n+=1)&&!t.has(n))return this.uuidNext=n,n},t.prototype.Vo=function(t,n,i){var r=i.get(t);if(null!=r)return r;var e=n.length;return n.push(t),i.set(t,e),e},t}(),Wv=function(t){function n(n,i){var r,e,u,s=this;return(s=t.call(this)||this).Wo=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapGridVisible(),s.Xo=s.Wo,s.Ko=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapGridEnabled(),s.vs=s.Ko,s.Yo=null!==(u=null==i?void 0:i.size)&&void 0!==u?u:n.getSnapGridSize(),s.j=s.Yo,s}return _(n,t),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Xo},set:function(t){this.Xo!==t&&(this.Xo=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs!==t&&(this.vs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.emit("change",t,this))},enumerable:!1,configurable:!0}),n.prototype.snap=function(t,n){if(this.vs){var i=this.j;n.set(t,Math.round(t/i)*i)}},n.prototype.reset=function(){this.Xo=this.Wo,this.vs=this.Ko,this.j=this.Yo,this.emit("change",this)},n.prototype.serialize=function(){return[this.vs?1:0,this.Xo?1:0,this.j]},n.prototype.deserialize=function(t){this.enable=!!t[0],2 in t?(this.visible=!!t[1],this.size=t[2]):(this.visible=!1,this.size=t[1])},n}(t.utils.EventEmitter),Xv=function(){function t(){this.distance=NaN,this.result=0,this.threshold=10}return t.prototype.reset=function(t,n){this.distance=NaN,this.result=t,this.threshold=1e-4<n?10/n:10},t.prototype.set=function(t,n){var i=Math.abs(n-t);if(i<=this.threshold){var r=this.distance;(r!=r||i<r)&&(this.distance=i,this.result=n)}},t}(),Kv={HORIZONTAL:0,VERTICAL:1},Yv=function(){function t(t,n){this.type=t,this.position=n}return t.prototype.serialize=function(){return[this.type,this.position]},t}(),Jv=function(t){function n(n,i){var r,e,u=this;return(u=t.call(this)||this).values=[],u.Wo=null!==(r=null==i?void 0:i.visible)&&void 0!==r?r:n.isSnapTargetVisible(),u.Xo=u.Wo,u.Ko=null!==(e=null==i?void 0:i.enable)&&void 0!==e?e:n.isSnapTargetEnabled(),u.vs=u.Ko,u}return _(n,t),Object.defineProperty(n.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs!==t&&(this.vs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this.Xo},set:function(t){this.Xo!==t&&(this.Xo=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.values.length},enumerable:!1,configurable:!0}),n.prototype.add=function(t,n){null!=n?this.values.splice(n,0,t):this.values.push(t),this.emit("change",this)},n.prototype.remove=function(t){var n=this.values;0<=t&&t<n.length&&(n.splice(t,1),this.emit("change",this))},n.prototype.replace=function(t,n){var i=this.values;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.emit("change",this),r}return null},n.prototype.swap=function(t,n){if(t!==n){var i=this.values,r=i[t];i[t]=i[n],i[n]=r,this.emit("change",this)}},n.prototype.snap=function(t,n,i,r){if(this.vs)for(var e=this.values,u=0,s=e.length;u<s;++u){var h=e[u];h.type===Kv.VERTICAL?i.set(t,h.position):r.set(n,h.position)}},n.prototype.reset=function(){this.vs=this.Ko,this.Xo=this.Wo,this.values.length=0,this.emit("change",this)},n.prototype.serialize=function(){for(var t=[],n=this.values,i=0,r=n.length;i<r;++i)t.push(n[i].serialize());return[this.vs?1:0,this.Xo?1:0,t]},n.prototype.deserialize=function(t){this.vs=!!t[0],this.Xo=!!t[1];var n=t[2],i=this.values;i.length=0;for(var r=0,e=n.length;r<e;++r){var u=n[r];i.push(new Yv(u[0],u[1]))}this.emit("change",this)},n}(t.utils.EventEmitter),Zv=1e-5,qv={NONE:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,MIDDLE_LEFT:4,MIDDLE_RIGHT:5,BOTTOM_LEFT:6,BOTTOM_CENTER:7,BOTTOM_RIGHT:8,ROTATION:9},Qv=function(n){function i(i,r,e){var u,s=this;return(s=n.call(this)||this).jt=[new t.Point,new t.Point,new t.Point,new t.Point,new t.Point],s.Jo=[new t.Point,new t.Point],s.Zo=[1,1],s.qo=new t.Point,s.Qo=new Xv,s.$o=new Xv,s.ta={distance:0,scale:new t.Point},s.na=new t.Point,s.ia=new t.Rectangle,s.ra=new t.Point,s.grid=new Wv(r,null==e?void 0:e.grid),s.target=new Jv(r,null==e?void 0:e.target),s.p=i,s.Ko=null!==(u=null==e?void 0:e.enable)&&void 0!==u?u:r.isSnapEnabled(),s.vs=s.Ko,s}return _(i,n),Object.defineProperty(i.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs!==t&&(this.vs=t,this.emit("change",this))},enumerable:!1,configurable:!0}),i.prototype.prepare=function(t){t.updateTransform();var n=t.transform.localTransform,i=t.width,r=t.height,e=this.jt;e[0].set(0,0),e[1].set(i,0),e[2].set(i,r),e[3].set(0,r),e[4].set(.5*i,.5*r),n.apply(e[0],e[0]),n.apply(e[1],e[1]),n.apply(e[2],e[2]),n.apply(e[3],e[3]),n.apply(e[4],e[4])},i.prototype.prepareForTranslate=function(t){this.vs&&this.prepare(t)},i.prototype.snap=function(t,n){var i=t.x,r=t.y,e=this.p.canvas,u=this.Qo,s=this.$o;if(null!=e){var h=Math.max(e.scale.x,e.scale.y);u.reset(i,h),s.reset(r,h),u.set(i,0),u.set(i,e.width),s.set(r,0),s.set(r,e.height)}else u.reset(i,1),s.reset(r,1);return this.target.snap(i,r,u,s),this.grid.snap(i,u),this.grid.snap(r,s),n.x=Th(u.distance)?NaN:u.result,n.y=Th(s.distance)?NaN:s.result,n},i.prototype.toSnapped=function(t,n){var i=t.x,r=t.y;if(this.vs){this.snap(t,n);var e=n.x,u=n.y;n.set(Th(e)?i:e,Th(u)?r:u)}else n.set(i,r);return n},i.prototype.toTranslationSnapped=function(t,n){var i=t.x,r=t.y,e=NaN,u=NaN;if(this.vs)for(var s=this.na,h=this.jt,o=0,a=h.length;o<a;++o){var c=h[o];if(s.set(c.x+i,c.y+r),this.snap(s,s),!Th(s.x)){var f=s.x-c.x;(Th(e)||Math.abs(f-i)<Math.abs(e-i))&&(e=f)}if(!Th(s.y)){var l=s.y-c.y;(Th(u)||Math.abs(l-r)<Math.abs(u-r))&&(u=l)}}return n.x=Th(e)?i:e,n.y=Th(u)?r:u,n},i.prototype.prepareForRotate=function(t){},i.prototype.getGridSizeRotation=function(){return 5},i.prototype.toRadian=function(t){return t/180*Math.PI},i.prototype.toDegree=function(t){return t/Math.PI*180},i.prototype.toRotationSnapped=function(t,n){if(this.vs){var i=this.getGridSizeRotation(),r=t+n,e=Math.round(this.toDegree(r)),u=e%90;return Math.abs(u)<=i?this.toRadian(e-u)-t:90-i<=u?this.toRadian(e+(90-u))-t:u<=-90+i?this.toRadian(e-(90+u))-t:n}return n},i.prototype.calcNormalizedVector=function(t,n,i){var r=n.x-t.x,e=n.y-t.y,u=Math.sqrt(r*r+e*e);if(Zv<u){var s=1/u;i.x=r*s,i.y=e*s}else i.x=1,i.y=0;return u},i.prototype.prepareForScale=function(t,n){if(this.vs){this.prepare(t);var i=this.jt,r=this.Jo,e=this.Zo;switch(n){case qv.TOP_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]),e[1]=this.calcNormalizedVector(i[3],i[0],r[1]);break;case qv.TOP_CENTER:e[0]=this.calcNormalizedVector(i[3],i[0],r[0]);break;case qv.TOP_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]),e[1]=this.calcNormalizedVector(i[2],i[1],r[1]);break;case qv.MIDDLE_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]);break;case qv.NONE:break;case qv.MIDDLE_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]);break;case qv.BOTTOM_LEFT:e[0]=this.calcNormalizedVector(i[2],i[3],r[0]),e[1]=this.calcNormalizedVector(i[0],i[3],r[1]);break;case qv.BOTTOM_CENTER:e[0]=this.calcNormalizedVector(i[0],i[3],r[0]);break;case qv.BOTTOM_RIGHT:e[0]=this.calcNormalizedVector(i[3],i[2],r[0]),e[1]=this.calcNormalizedVector(i[1],i[2],r[1])}}},i.prototype.setScaleSnappedResult=function(t,n,i,r,e){if(Zv<n&&(Th(e.distance)||t<e.distance)){e.distance=t;var u=1+i/n;r?e.scale.x=u:e.scale.y=u}},i.prototype.calcScaleSnapped1D=function(t,n,i,r,e,u){var s=this.qo;t.apply(n,s);var h=s.x,o=s.y;this.snap(s,s);var a=s.x,c=s.y;if(!Th(a)){var f=Math.abs(i.x);if(Zv<f){var l=(a-h)/i.x,v=Math.abs(l),b=(a-n.x)/i.x;this.setScaleSnappedResult(v,r,b,e,u)}}if(!Th(c)){var d=Math.abs(i.y);if(Zv<d){var g=(c-o)/i.y,m=(v=Math.abs(g),(c-n.y)/i.y);this.setScaleSnappedResult(v,r,m,e,u)}}},i.prototype.calcScaleSnappedX=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!0,e)},i.prototype.calcScaleSnappedY=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!1,e)},i.prototype.calcScaleSnapped2D=function(t,n,i,r,e){var u=this.qo;t.apply(n,u);var s=u.x,h=u.y;this.snap(u,u);var o=u.x,a=u.y;if(Th(o)){if(Th(a))return;o=s}else Th(a)&&(a=h);var c=i[0].x*i[1].y-i[1].x*i[0].y;if(Zv<Math.abs(c)){var f=o-s,l=a-h,v=Math.abs(f*f+l*l);if(Th(e.distance)||v<e.distance){e.distance=v;var b=o-n.x,d=a-n.y,g=(+i[1].y*b-i[1].x*d)/c,m=(-i[0].y*b+i[0].x*d)/c;e.scale.set(1+g/r[0],1+m/r[1])}}},i.prototype.calcScaleSnappedXY=function(t,n,i,r,e,u,s){this.calcScaleSnapped2D(t,n,e,u,s),this.calcScaleSnappedX(t,r,e[0],u[0],s),this.calcScaleSnappedY(t,i,e[1],u[1],s)},i.prototype.toScaleSnapped=function(t,n,i,r){if(this.vs){var e=this.jt,u=this.Jo,s=this.Zo,h=this.ta;switch(h.distance=NaN,h.scale.set(r.x,r.y),n){case qv.TOP_LEFT:this.calcScaleSnappedXY(t,e[0],e[1],e[3],u,s,h);break;case qv.TOP_CENTER:this.calcScaleSnappedY(t,e[0],u[0],s[0],h),this.calcScaleSnappedY(t,e[1],u[0],s[0],h);break;case qv.TOP_RIGHT:this.calcScaleSnappedXY(t,e[1],e[0],e[2],u,s,h);break;case qv.MIDDLE_LEFT:this.calcScaleSnappedX(t,e[0],u[0],s[0],h),this.calcScaleSnappedX(t,e[3],u[0],s[0],h);break;case qv.NONE:break;case qv.MIDDLE_RIGHT:this.calcScaleSnappedX(t,e[1],u[0],s[0],h),this.calcScaleSnappedX(t,e[2],u[0],s[0],h);break;case qv.BOTTOM_LEFT:this.calcScaleSnappedXY(t,e[3],e[2],e[0],u,s,h);break;case qv.BOTTOM_CENTER:this.calcScaleSnappedY(t,e[2],u[0],s[0],h),this.calcScaleSnappedY(t,e[3],u[0],s[0],h);break;case qv.BOTTOM_RIGHT:this.calcScaleSnappedXY(t,e[2],e[3],e[1],u,s,h)}if(!Th(h.distance)){if(r.copyFrom(h.scale),i)switch(n){case qv.TOP_LEFT:case qv.TOP_RIGHT:case qv.BOTTOM_LEFT:case qv.BOTTOM_RIGHT:r.x=r.y=Math.max(r.x,r.y);break;case qv.TOP_CENTER:case qv.BOTTOM_CENTER:r.x=r.y;break;case qv.MIDDLE_LEFT:case qv.MIDDLE_RIGHT:r.y=r.x}return!0}}return!1},i.prototype.reset=function(){this.enable=this.Ko,this.target.reset(),this.grid.reset()},i.prototype.serialize=function(){return[this.vs?1:0,this.target.serialize(),this.grid.serialize()]},i.prototype.deserialize=function(t){this.enable=!!t[0],this.target.deserialize(t[1]),this.grid.deserialize(t[2])},i}(t.utils.EventEmitter),$v=function(t){function n(n,i,r){var e=t.call(this,n,i.width,i.height,0,r)||this;return e.Bs=i,e}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.drawImage(this.Bs.canvas,n.x,n.y,n.width,n.height)},n}(de),tb=function(n,i,r,e){this.id=n,this.size=i,this.color=t.utils.hex2string(r),this.height=i+2*e;var u=Es.measure(n);this.ascent=u.ascent,this.descent=u.descent},nb=function(){function n(n,i,r,e){this.R=n,this.vr=document.createElement("canvas"),this.ea=null;var u=this.toPadding(i);this.Qn=u,this.Ye=new tb(n,i,r,u),this.Je={},this.Ze=0,this.ua=0,this.kt=1,this.pn=1,this.sa=0,this.ha=0,this.xe=t.Texture.from(this.vr,{mipmap:t.MIPMAP_MODES.OFF,resolution:e,scaleMode:t.SCALE_MODES.NEAREST});var s=this.Je;this.Vo(" "," ",s,Me.SPACE_R),this.Vo("\t"," ",s,Me.SPACE_R),this.Vo("...","...",s,Me.LETTER_RNB);for(var h=0,o=Oe.length;h<o;++h){var a=Oe[h];this.Vo(a,a,s,Me.LETTER_RNB)}}return n.prototype.toPadding=function(t){return Math.max(3,Math.ceil(.2*t))},Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"font",{get:function(){return this.Ye},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this.kt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvas",{get:function(){return this.vr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"characters",{get:function(){return this.Je},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){return this.xe},enumerable:!1,configurable:!0}),n.prototype.Vo=function(t,n,i,r){if(!this.isIgnored(n)){var e=i[t];if(null!=e)e.type&Me.RESERVED||(0===e.ref&&(this.ua-=1),e.ref+=1);else{var u=this.getAdvance(n),s=this.Qn,h=Math.ceil(s+u+s),o=this.font.height;i[t]=new Ee(n,u,h,o,r),this.Ze+=1,this.sa+=1}}},n.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},n.prototype.oa=function(t,n){var i=n[t];null!=i&&!(i.type&Me.RESERVED)&&0<i.ref&&(i.ref-=1,0===i.ref&&(this.ua+=1))},n.prototype.aa=function(){if(this.Ze>>1<=this.ua){var t=this.Je;for(var n in t)t[n].ref<=0&&delete t[n];this.Ze-=this.ua,this.sa+=1,this.ua=0}},n.prototype.add=function(t,n){void 0===n&&(n=Me.LETTER);for(var i=this.Je,r=b.from(t);r.hasNext();){var e=r.next();this.Vo(e,e,i,n)}},n.prototype.remove=function(t){for(var n=this.Je,i=b.from(t);i.hasNext();)this.oa(i.next(),n)},n.prototype.get=function(t){return this.Je[t]},n.prototype.getAdvance=function(t){var n=this.getContext();return null!=n?n.measureText(t).width:0},n.prototype.getContext=function(){var t=this.ea;if(null==t){var n=this.vr;if(null==n)return null;if(null==(t=this.ea=n.getContext("2d",{alpha:!0})))return null}var i=this.Ye;return t.font!==i.id&&(t.font=i.id,i.id=t.font,t.textAlign="left",t.textBaseline="alphabetic",t.lineWidth=0,t.lineCap="round",t.lineJoin="miter",t.miterLimit=0,t.fillStyle=i.color,t.strokeStyle="#0000ff"),t},n.prototype.update=function(){if(this.aa(),this.ha<this.sa){this.ha=this.sa;var t=this.vr;if(null!=t){var n=this.Ye,i=n.height,r=this.Je,e=this.kt=this.toPowerOf2(Math.ceil(Math.sqrt(this.Ze))*i),u=this.Qn,s=Math.round(.5*(i-(n.ascent+n.descent))+n.ascent),h=0,o=0;for(var a in r)e<=h+(g=r[a]).width&&(h=0,o+=i),g.x=h,g.y=o,g.origin.x=h+u,g.origin.y=o+s,h+=g.width;var c=this.pn=o+i,f=this.xe.baseTexture,l=f.resolution,v=Math.ceil(e*l),b=Math.ceil(c*l);t.width=v,t.height=b;var d=this.getContext();if(null!=d){for(var a in d.save(),d.scale(l,l),d.clearRect(0,0,e,c),r){var g=r[a];d.fillText(a,g.origin.x,g.origin.y)}d.restore()}return f.setRealSize(v,b),!0}}return!1},n.prototype.getRevision=function(){return this.sa},n.prototype.getRevisionUpdate=function(){return this.ha},Object.defineProperty(n.prototype,"length",{get:function(){return this.Ze},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){null!=this.vr&&(this.vr=null);var t=this.Je;for(var n in t)delete t[n]},n.prototype.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},n}(),ib=function(t){t.update()},rb=function(t){t.forEach(ib)},eb=function(t){t.update()},ub=function(t){t.forEach(eb)},sb=function(){function t(t){var n=this;this.qe=new Map,this.Mn=t.renderer.resolution,t.renderer.on("prerender",(function(){n.update()}))}return t.prototype.add=function(t,n,i,r){var e=this.qe,u=e.get(t);null==u&&(u=new Map,e.set(t,u));var s=u.get(i);null==s&&(s=new nb(t,n,i,this.Mn),u.set(i,s)),s.add(r)},t.prototype.remove=function(t,n,i){var r=this.qe.get(t);if(null!=r){var e=r.get(n);null!=e&&e.remove(i)}},t.prototype.get=function(t,n){var i=this.qe.get(t);if(null==i)return null;var r=i.get(n);return null==r?null:r},t.prototype.update=function(){this.qe.forEach(rb)},t.prototype.destroy=function(){var t=this.qe;t.forEach(ub),t.clear()},t}(),hb=function(t){if("object"==typeof t&&"[object Object]"===Object.prototype.toString.call(t)){var n=Object.getPrototypeOf(t);return null==n||n===Object.prototype}return!1},ob=function(){function t(t,n,i){var r=this;this.instance=null,this.newInstance=t,this.options=n,null!=i&&(i.state.isActive&&setTimeout((function(){r.get()}),0),i.on("active",(function(){r.get()})))}return t.prototype.get=function(){var t=this.instance;return null==t&&(t=new this.newInstance(this.options),this.instance=t),t},t}(),ab=function(t,n,i,r){for(var e=0,u=Math.floor(t.length/i)-1;e<=u;){var s=e+(u-e>>1),h=t[s*i+r];if(n<h)u=s-1;else{if(!(h<n))return s;e=s+1}}return Math.max(e,u)},cb=function(t){return mt(t)?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n[i]=t[i];return n}(t):hb(t)?function(t){var n={};for(var i in t)Object.hasOwnProperty.call(t,i)&&(n[i]=cb(t[i]));return n}(t):t},fb=function(t){if(null!=t){if(Ot(t))return t;if(pt(t))return String(t);if("name"in t)return t.name;if("label"in t)return t.label;if("id"in t)return t.id}return""},lb=function(t,n){if(null!=t){var i=cb(t);if(null!=n)for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var e=n[r];if(hb(e))if(Object.prototype.hasOwnProperty.call(i,r)){var u=i[r];hb(u)&&lb(u,e)}else i[r]=cb(e);else Object.prototype.hasOwnProperty.call(i,r)||(i[r]=e)}return i}return null!=n?cb(n):{}},vb=function(){function n(t,n,i){this.kt=t,this.ca=n,this.te=i,this.fa={},this.la="",this.va=0,this.ba=0,this.pn=0}return Object.defineProperty(n.prototype,"width",{get:function(){return this.kt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ratio",{get:function(){return this.ca},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.te},enumerable:!1,configurable:!0}),n.prototype.add=function(n,i,r,e){var u=this.fa;if(!(n in u)){var s=this.te,h=this.va,o=this.ba;this.kt<=h+i?(h=0,o=this.ba+this.pn+s,this.pn=r,this.ba=o):this.pn=Math.max(this.pn,r),this.va=h+i+s,u[n]=new t.Rectangle(h,o,i,r);var a=this.ca;return this.la+='<g transform="translate('.concat(h*a,",").concat(o*a,')">').concat(e,"</g>"),!0}return!1},n.prototype.has=function(t){return t in this.fa},Object.defineProperty(n.prototype,"mappings",{get:function(){return this.build()},enumerable:!1,configurable:!0}),n.prototype.build=function(n){var i,r,e,u=this.da;if(null==u||(null==n?void 0:n.force)){var s=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1,h=this.kt,o=Math.pow(2,Math.ceil(Math.log(this.ba+this.pn)/Math.LN2)),a=h*s,c=o*s,f=this.ca,l='width="'.concat(a,'"'),v='height="'.concat(c,'"'),b='viewBox="0 0 '.concat(h*f," ").concat(o*f,'"'),d=Pv("<svg ".concat(l," ").concat(v," ").concat(b," ").concat('xmlns="http://www.w3.org/2000/svg"',">").concat(this.la,"</svg>")),g=null!==(e=null==n?void 0:n.scaling)&&void 0!==e?e:t.SCALE_MODES.NEAREST,m=t.BaseTexture.from(d,{resolution:s,scaleMode:g}),w=this.fa;for(var p in u=this.da={},w)u[p]=new t.Texture(m,w[p])}return u},n}(),bb=function(){function n(){}return n.toTexture=function(n,i,r,e){var u=n.transform.scale,s=t.RenderTexture.create({width:n.width*u.x,height:n.height*u.y,scaleMode:t.SCALE_MODES.LINEAR,resolution:i}),h=new t.Matrix(void 0,void 0,void 0,void 0,-n.position.x,-n.position.y),o=st.getLayer(n);return o&&o.renderer.render(n,s,r,h,e),s},n.toPixels=function(t,n){var i=t.resolution,r=t.frame,e=Math.floor(r.width*i),u=Math.floor(r.height*i),s=new Uint8Array(4*e*u);n.renderTexture.bind(t);var h=n.gl;return h.readPixels(r.x*i,r.y*i,e,u,h.RGBA,h.UNSIGNED_BYTE,s),{width:e,height:u,array:s}},n.toCanvas=function(n,i,r){var e=n.width,u=n.height,s=n.array,h=new t.utils.CanvasRenderTarget(e,u,1),o=h.context.getImageData(0,0,e,u);if(r?o.data.set(s):t.Extract.arrayPostDivide(s,o.data),h.context.putImageData(o,0,0),null!=i&&1!==i){h.context.scale(i,i),h.context.drawImage(h.canvas,0,0);var a=Math.floor(e*i),c=Math.floor(u*i),f=h.context.getImageData(0,0,a,c);h.resize(a,c),h.context.putImageData(f,0,0)}return h},n.toBase64=function(t,n,i){return t.toDataURL(n,i)},n}(),db=function(){function t(){}return t.downloadUrl=function(t,n){var i=document.createElement("a");"download"in i?(i.href=n,i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),66)):window.open(n)||(location.href=n)},t.download=function(t,n,i){var r=new Blob(!1!==i?["\ufeff",n]:[n],{type:"text/plain"}),e=window.navigator;"msSaveBlob"in e?e.msSaveBlob(r,t):this.downloadUrl(t,URL.createObjectURL(r))},t}(),gb=function(){function t(){}return t.texture=function(t){var n,i=t.target,r=function(t){var n,i=t.target,r=t.resolution;if(null!=r){if(pt(r))return r;var e=i.transform.scale,u=Math.max(i.width*e.x,i.height*e.y);return Math.min(1,r.size/u)}return null!==(n=window.devicePixelRatio)&&void 0!==n?n:1}(t),e=null===(n=t.transform)||void 0===n?void 0:n.update;return bb.toTexture(i,r,t.clear,e)},t.pixels=function(t){var n=function(t){var n=t.renderer;if(n)return n;var i=t.application;if(i)return i.getLayerBase().renderer;var r=t.layer||st.getLayer(t.target);if(r)return r.renderer;throw new Error("No renderer / application / layer found.")}(t),i=this.texture(t);try{return bb.toPixels(i,n)}finally{i&&i.destroy()}},t.canvas=function(t){var n,i,r=this.pixels(t),e=null===(i=null===(n=t.alpha)||void 0===n?void 0:n.premultiplied)||void 0===i?void 0:i.ignore,u=function(t,n){var i=n.scale;if(null!=i){if(pt(i))return i;var r=i.size;return Math.min(1,r/t.width,r/t.height)}}(r,t);return bb.toCanvas(r,u,e)},t.base64=function(t){var n=this.canvas(t);try{return bb.toBase64(n.canvas,t.format,t.quality)}finally{n&&n.destroy()}},t.file=function(t){db.downloadUrl(t.filename,this.base64(t))},t}(),mb={TEXT:0,DATA_URL:1,BINARY_STRING:2,ARRAY_BUTTER:3,FILE:4},wb=function(){function t(t,n){this.Ah=null,this.ga=t,this.ma=n}return t.prototype.open=function(){var t=this.getOrCreateInput();null!=t?t.click():this.onCancel()},t.prototype.getOrCreateInput=function(){var t=this;if("FileReader"in window&&null==this.Ah){var n=document.createElement("input");this.Ah=n,n.setAttribute("type","file"),n.setAttribute("style","display:none"),n.addEventListener("change",(function(i){t.onInputChange(n),n.value="",i.stopImmediatePropagation(),i.preventDefault()})),document.body.appendChild(n)}return this.Ah},t.prototype.onInputChange=function(t){var n=this,i=t.files;if(null!=i&&0<i.length){var r=i[0];if(this.ga===mb.FILE)this.onOpen(r,r);else{var e=new FileReader;switch(e.onload=function(t){if(null!=t.target){var i=t.target;n.onOpen(i.result,r)}},e.onabort=function(t){n.onAboart(t)},this.ga){case mb.TEXT:e.readAsText(r);break;case mb.DATA_URL:e.readAsDataURL(r);break;case mb.BINARY_STRING:e.readAsBinaryString(r);break;case mb.ARRAY_BUTTER:e.readAsArrayBuffer(r);break;default:e.readAsText(r)}}}else this.onCancel()},t.prototype.onOpen=function(t,n){var i=this.ma;i.emit("open",t,n,i)},t.prototype.onAboart=function(t){var n=this.ma;n.emit("abort",t,n)},t.prototype.onCancel=function(){var t=this.ma;t.emit("cancel",t)},t}(),pb=function(){function t(){}return t.fromRgb=function(t){var n=(16711680&t)>>16,i=(65280&t)>>8,r=255&t|0,e=Math.max(n,i,r),u=e-Math.min(n,i,r),s=0;return 0<u&&(n===e?s=60*(i-r)/u:i===e?s=60*(r-n)/u+120:r===e&&(s=60*(n-i)/u+240),s<0&&(s+=360)),[s,u/e*255,e]},t.toRgb=function(t,n,i){var r=i-n/255*i,e=i-r,u=0,s=0,h=0;return t<=60?(u=i,s=t/60*e+r,h=r):t<=120?(u=(120-t)/60*e+r,s=i,h=r):t<=180?(u=r,s=i,h=(t-120)/60*e+r):t<=240?(u=r,s=(240-t)/60*e+r,h=i):t<=300?(u=(t-240)/60*e+r,s=r,h=i):(u=i,s=r,h=(360-t)/60*e+r),(u=Math.max(0,Math.min(255,u)))<<16|(s=Math.max(0,Math.min(255,s)))<<8|Math.max(0,Math.min(255,h))},t}(),Ob=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.$u),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.$u),t.prototype.onElementDetached.call(this,n,i,r)},n.prototype.onInputKeyDown=function(t){nr.isOkKey(t)&&this.yu.onEnter()},n}(bu),Db=function(){function t(){}return t.create=function(t){var n=this.Jt;return t in n?"".concat(t," ").concat(++n[t]):(n[t]=1,"".concat(t," 1"))},t.Jt={},t}(),Eb=function(){function t(){}return t.toCode=function(t,n){var i=t>>8&255,r=255&t;return"rgba(".concat(t>>16&255,",").concat(i,",").concat(r,",").concat(n,")")},t}(),Mb=function(){function t(t,n,i){var r=this;this.wa=new Set,this.Rt=t,this.pa=n,this.Z=i,this.Oa=null,this.Da=function(){r.update()}}return t.prototype.start=function(){return null==this.Oa&&(this.Oa=window.setTimeout(this.Da,this.pa)),this},t.prototype.stop=function(){var t=this.Oa;return null!=t&&(this.Oa=null,clearTimeout(t)),this},t.prototype.add=function(t){return this.wa.add(t),t.state.set(this.Rt,this.isOn(Date.now())),this},t.prototype.remove=function(t){return!!this.wa.delete(t)&&(t.state.remove(this.Rt),!0)},t.prototype.contains=function(t){return this.wa.has(t)},t.prototype.clear=function(){return this.wa.clear(),this},t.prototype.isOn=function(t){return Math.floor(t/this.Z)%2==0},t.prototype.update=function(){var t=Date.now(),n=this.isOn(t),i=this.Rt;this.wa.forEach((function(t){t.state.set(i,n)}));var r=this.Z;return this.Oa=window.setTimeout(this.Da,r-t%r),this},t}(),Sb=function(){function t(t){var n;this.hi=null!==(n=null==t?void 0:t.duration)&&void 0!==n?n:300,this.au=null,this.Ea=0,this.Ma=null}return t.prototype.show=function(t,n){var i=this,r=this.Ma;null!=r&&clearTimeout(r);var e=this.au;if(t!==e){var u=this.hi,s=this.Ea,h=Date.now(),o=s+u-h;!0===n||o<=0?this.update(h,t):this.Ma=window.setTimeout((function(){i.update(Date.now(),t)}),o)}},t.prototype.update=function(t,n){var i=this.au;i!==n&&(this.Ea=t,null!=i&&i.hide(),this.au=n,null!=n&&n.show())},t.prototype.hide=function(){this.show(null)},t}(),Tb=function(){function t(){this.Sa=null,this.Ta=0,this.Vs=null,this.ja=null}return t.prototype.getNames=function(){var t=this.Na;return null==t&&(t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DOMMouseScroll","MozMousePixelScroll"],this.Na=t),t},t.prototype.on=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.addEventListener(u,n,i)}},t.prototype.off=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.removeEventListener(u,n,i)}},t.prototype.getLineHeight=function(){if(null==this.Vs){var t=Z.getInstance().get("DBase");this.Vs=t.getLineHeight()}return this.Vs},t.prototype.getPageHeight=function(){return null==this.ja&&(this.ja=12*this.getLineHeight()),this.ja},t.prototype.normalize=function(t){var n=0,i=0;if("detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(n=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(n=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(n=t.deltaX),0===i&&0===n)return null;var r=Math.max(Math.abs(i),Math.abs(n)),e=Date.now();this.Ta+200<=e&&(this.Sa=null),this.Ta=e;var u="mousewheel"===t.type&&r%120==0;(!this.Sa||r<this.Sa)&&(this.Sa=r,u&&(this.Sa/=40)),u&&(r/=40,n/=40,i/=40);var s=this.Sa;r=Math.floor(r/s),n=Math[1<=n?"floor":"ceil"](n/s),i=Math[1<=i?"floor":"ceil"](i/s);var h=t.deltaMode||0;if(0!==h){var o=1===h?this.getLineHeight():this.getPageHeight();r*=o,n*=o,i*=o}return{mode:h,delta:r,deltaX:n,deltaY:i,lowest:s}},t.getInstance=function(){return null==this.INSTANCE&&(this.INSTANCE=new t),this.INSTANCE},t}(),jb=function(t){function n(n){var i,r=this;return(r=t.call(this)||this).ei=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,r.ai=!1,r.Fu=!1,r.ci=null==n?void 0:n.onTime,r.li=null==n?void 0:n.onStart,r.vi=null==n?void 0:n.onEnd,r}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.ei},set:function(t){this.ei=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.Fu=!0,this.ai=t,this.onStart(t),this.Fu&&(this.onTime(t?1:0,t,0),this.Fu&&(this.onTime(t?0:1,t,0),this.Fu||this.onEnd(t)))},n.prototype.onStart=function(t){var n=this.li;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.ci;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.vi;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return this.Fu},n.prototype.isReverse=function(){return this.ai},n.prototype.stop=function(){this.Fu=!1},n.prototype.end=function(){if(this.Fu){this.Fu=!1;var t=this.ai,n=t?0:1;this.onTime(n,t,0),this.onEnd(t)}},n}(t.utils.EventEmitter),Nb=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Ia=0,e.Ca=0,e.Aa=0,e.Ra=0,e.ka=null,e.bs=null;var u=null==n?void 0:n.shift;return e.La=null!==(i=null==u?void 0:u.x)&&void 0!==i?i:0,e.ya=null!==(r=null==u?void 0:u.y)&&void 0!==r?r:15,e.ws=function(){e.onPrerender()},e.xa=function(){e.onPostrender()},e}return _(n,t),n.prototype.stop=function(){this.Ra=0,this.removeEventListeners(),t.prototype.stop.call(this)},n.prototype.addEventListeners=function(t){var n=st.getLayer(t);if(n){this.bs=n;var i=n.renderer;i.on("prerender",this.ws),i.on("postrender",this.xa)}},n.prototype.removeEventListeners=function(){var t=this.bs;if(t){this.bs=null;var n=t.renderer;n.off("prerender",this.ws),n.off("postrender",this.xa)}},n.prototype.onStart=function(n){var i=this.ka=this.ei;null!=i&&(this.Ra=0,this.removeEventListeners(),this.addEventListeners(i),n||(i.visible=!0),t.prototype.onStart.call(this,n))},n.prototype.onTime=function(n,i,r){if(null!=this.ka){var e=this.bs;e?(this.Ra=n,t.prototype.onTime.call(this,n,i,r),e.update()):(this.Ra=n,t.prototype.onTime.call(this,n,i,r))}},n.prototype.onEnd=function(n){var i=this.ka;null!=i&&(this.removeEventListeners(),n&&(i.visible=!1),t.prototype.onEnd.call(this,n))},n.prototype.onPrerender=function(){var t=this.ka;if(null!=t){var n=this.Ra,i=t.unsafe.position;this.Ia=i.x,this.Ca=i.y,i.set(i.x-this.La*(1-n),i.y-this.ya*(1-n)),this.Aa=t.alpha,t.alpha=n}},n.prototype.onPostrender=function(){var t=this.ka;null!=t&&(t.unsafe.position.set(this.Ia,this.Ca),t.alpha=this.Aa)},n}(br),Ib=function(){function t(t){var n,i,r,e;pt(t)?(this.top=t,this.right=t,this.bottom=t,this.left=t):null!=t?(this.top=null!==(n=t.top)&&void 0!==n?n:6,this.right=null!==(i=t.right)&&void 0!==i?i:6,this.bottom=null!==(r=t.bottom)&&void 0!==r?r:6,this.left=null!==(e=t.left)&&void 0!==e?e:6):(this.top=6,this.right=6,this.bottom=6,this.left=6)}return t.prototype.getTheme=function(){throw new Error("Not supported")},t.prototype.setTheme=function(t){throw new Error("Not supported")},t.prototype.getTop=function(){return this.left},t.prototype.getRight=function(){return this.right},t.prototype.getBottom=function(){return this.bottom},t.prototype.getLeft=function(){return this.left},t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r)},t}(),Cb=function(){function t(t){var n,i=t.root;this.Ba=i,this.Ds=t.overlay,this.Qn=new Ib(null==t?void 0:t.padding);var r=100,e=100;if(t)if(null!=t.width)r=t.width,e=null!=t.height?t.height:i.getBoundingClientRect().height;else if(null!=t.height)r=i.getBoundingClientRect().width,e=t.height;else{var u;r=(u=i.getBoundingClientRect()).width,e=u.height}else r=(u=i.getBoundingClientRect()).width,e=u.height;var s=null==t?void 0:t.background,h=0,o=!0;if(null!=s){var a=s.color;null!=a&&(h=a,o=!1)}var c=t.resolution,f=null!==(n=null==t?void 0:t.antialias)&&void 0!==n&&n;this.Pa={width:r,height:e,autoStart:!1,backgroundColor:h,transparent:o,resolution:c,antialias:f}}return t.prototype.getRootElement=function(){return this.Ba},t.prototype.setRootElement=function(t,n){if(this.Ba!==t&&(this.Ba=t,!1!==n)){var i=t.getBoundingClientRect(),r=this.Pa;r.width=i.width,r.height=i.height}return this},t.prototype.getWidth=function(){return this.Pa.width},t.prototype.setWidth=function(t){return this.Pa.width=t,this},t.prototype.getHeight=function(){return this.Pa.height},t.prototype.setHeight=function(t){return this.Pa.height=t,this},t.prototype.getPadding=function(){return this.Qn},t.prototype.setPadding=function(t,n,i,r){var e=this.Qn;return e.left=t,e.top=n,e.right=i,e.bottom=r,this},t.prototype.getBackgroundColor=function(){return this.Pa.backgroundColor},t.prototype.setBackgroundColor=function(t){return this.Pa.backgroundColor=t,this},t.prototype.getAntialias=function(){return this.Pa.antialias},t.prototype.setAntialias=function(t){return this.Pa.antialias=t,this},t.prototype.isOverlay=function(){return this.Ds},t.prototype.getPixiApplicationOptions=function(){return this.Pa},t}(),Ab=function(){function t(){}return t.prototype.isStorable=function(){return!0},t.prototype.isClear=function(){return!1},t.prototype.isClean=function(){return!1},t.prototype.execute=function(){return!0},t.prototype.merge=function(t){return!1},t.prototype.isMerged=function(){return!1},t.prototype.redo=function(){return!0},t.prototype.undo=function(){return!0},t.prototype.destroy=function(){},t}(),Rb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(Ab),kb=function(t){function n(){var n=t.call(this)||this;return n._=0,n.Fa=[],n}return _(n,t),n.prototype.last=function(){var t=this.Fa,n=t.length;return 0<n?t[n-1]:null},n.prototype.push=function(t){this.merge(t),this.execute(t)},n.prototype.merge=function(t){var n=this.Fa,i=t.isClear(),r=t.isStorable();if(i||r){var e=i?n.length:this._;0<e&&(this.remove(e),this._=0,this.emit("change",this)),this.cleanup()}var u=n.length;0<u&&t.merge(n[u-1])},n.prototype.execute=function(t){return this.emit("executing",t,this),t.execute()?this.onSuccess(t):this.onFail(t)},n.prototype.onSuccess=function(t){t.isStorable()&&(t.isMerged()||this.Fa.push(t),t.isClean()||this.emit("dirty",this)),this.emit("change",this),this.emit("executed",t,this)},n.prototype.onFail=function(t){t.destroy(),this.emit("change",this)},n.prototype.cleanup=function(){var t=this.Fa,n=t.length-100;if(0<n)for(var i=0;i<n;++i)t[i].destroy(),t.shift()},n.prototype.remove=function(t){var n=this.Fa;if(0<t){var i=Math.max(0,n.length-t);if(0<(t=n.length-i)){for(var r=i,e=n.length;r<e;++r)n[r].destroy();return n.splice(i,n.length-i),!0}}return!1},n.prototype.size=function(){return this.Fa.length},n.prototype.clear=function(){this.push(new Rb)},n.prototype.redo=function(){this.isRedoable()&&this.doRedo()},n.prototype.doRedo=function(){var t=this.Fa;if(0<this._){var n=t[t.length-this._];this._-=1,this.emit("change",this),this.emit("redoing",n,this),!0===n.redo()?this.onRedoSuccess(n):this.onRedoFail(n)}},n.prototype.onRedoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("redoed",t,this)},n.prototype.onRedoFail=function(t){this.emit("change",this)},n.prototype.isRedoable=function(){return 0<this._},n.prototype.undo=function(){this.isUndoable()&&this.doUndo()},n.prototype.doUndo=function(){var t=this.Fa;if(this._<t.length){var n=t[t.length-1-this._];this._+=1,this.emit("change",this),this.emit("undoing",n,this),!0===n.undo()?this.onUndoSuccess(n):this.onUndoFail(n)}},n.prototype.onUndoSuccess=function(t){t.isClean()||this.emit("dirty",this),this.emit("change",this),this.emit("undoed",t,this)},n.prototype.onUndoFail=function(t){this.emit("change",this)},n.prototype.isUndoable=function(){return this._<this.Fa.length},n}(t.utils.EventEmitter),Lb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t,n,i){var r=this;t.addEventListener("keydown",(function(t){r.emit("keydown",t);var e=i.get();if(null!=e)for(var u=e;null!=u;){if(r.hasOnKeyDown(u)&&u.onKeyDown(t))return;u=u.parent}if(nr.isFocusKey(t)){var s=nr.getFocusDirection(t),h=null!=e?i.find(e,!1,e.state.isFocusRoot||s,s):i.find(n,!1,!0,s);null!=h&&(i.focus(h),t.preventDefault(),t.stopImmediatePropagation())}})),t.addEventListener("keyup",(function(t){r.emit("keyup",t);var n=i.get();if(null!=n)for(var e=n;null!=e;){if(r.hasOnKeyUp(e)&&e.onKeyUp(t))return;e=e.parent}}))},n.prototype.hasOnKeyDown=function(t){return"onKeyDown"in t},n.prototype.hasOnKeyUp=function(t){return"onKeyUp"in t},n}(t.utils.EventEmitter),yb=function(){function t(){}return t.getKeyboardController=function(){return null==this.KEYBOARD&&(this.KEYBOARD=new Lb),this.KEYBOARD},t.setKeyboardController=function(t){var n=this.KEYBOARD;return this.KEYBOARD=t,n},t.getCommandController=function(){return null==this.COMMAND&&(this.COMMAND=new kb),this.COMMAND},t.setCommandController=function(t){var n=this.COMMAND;return this.COMMAND=t,n},t.getDocumentController=function(){if(null==this.DOCUMENT)throw new Error("Not supported");return this.DOCUMENT},t.setDocumentController=function(t){var n=this.DOCUMENT;return this.DOCUMENT=t,n},t}(),xb=function(n){function i(t,i){var r=n.call(this,i.getPixiApplicationOptions())||this;return r.Ua=null,r.Ga=null,r.zn=i,r.st=!1,r.Xo=!0,r.Ha=i.isOverlay(),r.Qn=i.getPadding(),r.za=i.getRootElement(),r.Va=5,r.Wa=r.newElementContainer(),r.application=t,r.Xa=function(){null!=r.Ua&&r.render()},r.initStage(),r.initView(),r.initRootElement(),r.initFocusHandling(),r.initResizeHandling(),r.initWheelHandling(),r.initDoubleClickHandling(),r}return _(i,n),i.prototype.newElementContainer=function(){var t=document.createElement("div");return t.setAttribute("style","position: absolute; top: 0; left: 0; width: 0; height: 0;margin: 0; padding: 0; outline: none;"),t},i.prototype.initStage=function(){var t=this.stage;t.layer=this,t.application=this.application,t.interactive=!0},i.prototype.initView=function(){var t=this.view.style;t.position="absolute",t.top="0",t.left="0",t.width="100%",t.height="100%",t.display="block",t.outline="none",t.webkitTapHighlightColor="rgba(255,255,255,0)",t.webkitUserSelect="none",t.setProperty("-khtml-user-select","none"),t.setProperty("-moz-user-select","none"),t.setProperty("-ms-user-select","none"),t.userSelect="none"},i.prototype.initRootElement=function(){var t=this,n=this.view,i=this.Ha,r=this.za,e=this.Wa,u=i?2:0,s=r.children;if(u<s.length){var h=s[u];r.insertBefore(n,h),r.insertBefore(e,h)}else r.appendChild(n),r.appendChild(e);if(i){var o=this.stage,a=o.onChildrenChange;o.onChildrenChange=function(){t.onStageDirty(),a.call(o)}}var c=r.style;r!==document.body&&"static"===window.getComputedStyle(r).position&&(c.position="relative"),c.margin="0",c.padding="0",c.overflow="hidden"},i.prototype.initFocusHandling=function(){var t=this.view,n=this.stage,i=this.getFocusController();t.setAttribute("tabindex","0"),yb.getKeyboardController().init(t,n,i),this.renderer.plugins.interaction.on(ir.down,(function(t){null!=t.target&&t.target!==n||i.clear()}))},i.prototype.initResizeHandling=function(){var t=this,n=function(){t.onResize()};window.addEventListener("resize",n),window.addEventListener("orientationchange",n)},i.prototype.onResize=function(){var t=this.za.getBoundingClientRect(),n=t.width,i=t.height;this.renderer.resize(n,i);for(var r=this.Qn,e=this.stage.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof hr&&h.onParentResize(n,i,r)}this.update()},i.prototype.initWheelHandling=function(){var n=new t.Point,i=Tb.getInstance(),r=this.renderer.plugins.interaction;i.on(this.view,(function(t){var e=t;ir.toGlobal(e,r,n);var u,s=r.hitTest(n),h=i.normalize(t);if(null!=h)for(;null!=s;){if(null!=(u=s)&&null!=u.onWheel&&s.onWheel(e,h,n)){e.preventDefault();break}s=s.parent}}))},i.prototype.initDoubleClickHandling=function(){var t=this.getFocusController(),n=this.renderer.plugins.interaction;ir.onDblClick(this.view,(function(i){var r,e=t.get();if(null!=e)for(var u=e;null!=u&&(null==(r=u)||null==r.onDblClick||!u.onDblClick(i,n));)u=u.parent}))},i.prototype.lock=function(){this.st=!0},i.prototype.unlock=function(){this.st=!1},i.prototype.update=function(){this.st||null!=this.Ua||(this.Ua=requestAnimationFrame(this.Xa))},i.prototype.onStageDirty=function(){this.Ha&&(0<this.stage.children.length?this.Xo||(this.Xo=!0,this.view.style.display="block"):this.Xo&&(this.Xo=!1,this.view.style.display="none"))},i.prototype.render=function(){this.reflow(),this.Ua=null,n.prototype.render.call(this)},Object.defineProperty(i.prototype,"width",{get:function(){return this.screen.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.screen.height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Qn},enumerable:!1,configurable:!0}),i.prototype.reflow=function(){for(var t=this.stage.children,n=0,i=this.Va;n<i;++n){for(var r=!1,e=0,u=t.length;e<u;++e){var s=t[e];s instanceof hr&&(s.reflow(),r=r||s.isDirty()||s.hasDirty()||s.isHierarchyDirty())}if(!r)break}},i.prototype.getFocusController=function(){return this.application.getFocusController()},i.prototype.getRootElement=function(){return this.za},i.prototype.getElementContainer=function(){return this.Wa},i.prototype.getDynamicFontAtlases=function(){return null==this.Ga&&(this.Ga=new sb(this)),this.Ga},i}(t.Application),Bb=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.Es=null,n}return _(n,t),n.prototype.focus=function(t){var n=this.Es;return n!==t?(null!=n&&(n.state.isFocused=!1),this.Es=t,this.isFocusable(t)&&(t.state.isFocused=!0),this.emit("change",t,n,this),n):null},n.prototype.blur=function(t){return null!=t&&this.Es===t?(this.Es=null,t.state.isFocused=!1,this.emit("change",null,t,this),t):null},n.prototype.clear=function(){return this.focus(null)},n.prototype.set=function(t,n){return n?this.focus(t):this.blur(t)},n.prototype.get=function(){return this.Es},n.prototype.findParent=function(t){for(var n=t;null!=n;){if(this.isFocusable(n))return n;n=n.parent}return null},n.prototype.find=function(t,n,i,r,e){if(r){if(null!=(o=this.findNext(t,n,i)))return o;if(this.isFocusRoot(t,e))return null;var u=t.parent;if(null!=u&&0<=(c=(a=u.children).indexOf(t))){var s=a.length;if(this.isFocusReverse(u)){for(var h=c-1;0<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=s-1;c<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}else{for(h=c+1;h<s;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}}}else{var o;if(null!=(o=this.findPrevious(t,n,i)))return o;var a,c,f=t.parent;if(null!=f&&0<=(c=(a=f.children).indexOf(t)))if(s=a.length,this.isFocusReverse(f)){for(h=c+1;h<s;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}else{for(h=c-1;0<=h;--h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=s-1;c<=h;--h){var l;if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}}}return null},n.prototype.findNext=function(t,n,i){if(n&&this.isFocusable(t))return t;if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=e-1;0<=u;--u)if(null!=(s=this.findNext(r[u],!0,!0)))return s}else for(u=0;u<e;++u){var s;if(null!=(s=this.findNext(r[u],!0,!0)))return s}}return null},n.prototype.findPrevious=function(t,n,i){if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=0;u<e;++u)if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}else for(u=e-1;0<=u;--u){var s;if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}}return n&&this.isFocusable(t)?t:null},n.prototype.isFocusable=function(t){return null!=t&&"state"in t&&t.state.inEnabled&&t.state.isFocusable&&t.visible},n.prototype.isFocusableContainer=function(t){return null!=t&&"children"in t},n.prototype.isFocusRoot=function(t,n){return t===n||null!=t&&"state"in t&&t.state.isFocusRoot&&t.visible},n.prototype.isFocusReverse=function(t){return null!=t&&"state"in t&&t.state.isFocusReverse},n}(t.utils.EventEmitter),_b=function(){function n(n){var i,r;st.add(this);var e=this.toRootElement(n);this.Ba=e,this.initFocusHandling(e);var u=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1;this.Mn=u,delete t.Renderer.__plugins.accessibility,this.zn=n;var s=this.newLayerBase(n);this.Pr=s,this.Ka=!!(null==n?void 0:n.overlay),this.Ka||(this.Ds=s)}return Object.defineProperty(n.prototype,"stage",{get:function(){return this.Pr.stage},enumerable:!1,configurable:!0}),n.prototype.getRootElement=function(){return this.Ba},n.prototype.getResolution=function(){return this.Mn},n.prototype.toRootElement=function(t){var n=null==t?void 0:t.root;if(null!=n){if(!Ot(n))return n;var i=document.querySelector(n);if(i)return i}return document.body},n.prototype.toLayerBaseOptions=function(t){var n=this.Ba,i=this.Mn;return new Cb(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:t.background,resolution:i,antialias:t.antialias,overlay:!1}:{root:n,resolution:i,overlay:!1})},n.prototype.getFocusController=function(){return null==this.Ya&&(this.Ya=new Bb),this.Ya},n.prototype.initFocusHandling=function(t){var n=this,i=!1,r=function(){i||n.getFocusController().clear()};t.addEventListener("focus",(function(){i=!0}),!0),t.addEventListener("blur",(function(){i=!1,setTimeout(r,0)}),!0)},n.prototype.newLayerBase=function(t){return new xb(this,this.toLayerBaseOptions(t))},n.prototype.getLayerBase=function(){return this.Pr},n.prototype.toLayerOverlayOptions=function(t){var n=this.Ba,i=this.Mn;return new Cb(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:{color:null},resolution:i,antialias:t.antialias,overlay:!0}:{root:n,resolution:i,overlay:!0})},n.prototype.newLayerOverlay=function(t){return new xb(this,this.toLayerOverlayOptions(t))},n.prototype.getLayerOverlay=function(){return this.Ka?(null==this.Ds&&(this.Ds=this.newLayerOverlay(this.zn)),this.Ds):this.Pr},n.prototype.update=function(){if(!this.Ka)return this.Pr.update();this.Pr.update();var t=this.Ds;t&&t.update()},n.prototype.render=function(){if(!this.Ka)return this.Pr.render();this.Pr.render();var t=this.Ds;t&&t.render()},n}(),Pb=function(){function t(t){this.ei=t,this.dn=0,this.gn=0,this.mn=0,this.bn=0,t instanceof Bi&&(this.fn=t.getCallback())}return t.prototype.getTheme=function(){return this.ei.getTheme()},t.prototype.setTheme=function(t){this.ei.setTheme(t)},t.prototype.getLeft=function(){return this.ei.getLeft()+this.bn},t.prototype.adjLeft=function(t){if(this.bn!==t){this.bn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"left",{get:function(){return this.ei.left},set:function(t){this.ei.left=t},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){return this.ei.getTop()+this.dn},t.prototype.adjTop=function(t){if(this.dn!==t){this.dn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"top",{get:function(){return this.ei.top},set:function(t){this.ei.top=t},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){return this.ei.getRight()+this.gn},t.prototype.adjRight=function(t){if(this.gn!==t){this.gn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"right",{get:function(){return this.ei.right},set:function(t){this.ei.right=t},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){return this.ei.getBottom()+this.mn},t.prototype.adjBottom=function(t){if(this.mn!==t){this.mn=t;var n=this.fn;n&&n()}},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.ei.bottom},set:function(t){this.ei.bottom=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){var e=this.ei;null==n?e.set(t):null==i?e.set(t,n):null==r?e.set(t,n,i):e.set(t,n,i,r)},t}(),Fb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DBoard"},n}(hr),Ub=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheck"},n}(js),Gb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheckRight"},n}(Ub),Hb=function(){function t(t,n,i,r,e){this.S=t,this.T=n,this._=i,this.fn=e,this.Ja=r}return t.prototype.set=function(t,n,i,r){this.S===t&&this.T===n&&this._===i&&this.Ja===r||(this.S=t,this.T=n,this._=i,this.Ja=r,this.fn(this))},Object.defineProperty(t.prototype,"color",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.fn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.fn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._},set:function(t){this._!==t&&(this._=t,this.fn(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this.Ja},set:function(t){this.Ja!==t&&(this.Ja=t,this.fn(this))},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){return{color:this.S,alpha:this.T,position:this._}},t}(),zb=function(t,n){return t.position-n.position},Vb=function(n){function i(){var t=n.call(this)||this,i=function(n){t.onChange(n)};t.Za=i;var r=new Hb(16777215,1,0,!1,i),e=new Hb(8421504,1,1,!0,i);return t.jt=[r,e],t.rn=-90,t.Ja=e,t.qa=[0,0,0],t}return _(i,n),i.prototype.onChange=function(t){var n=t.selected&&this.Ja!==t;if(n){var i=this.Ja;null!=i&&(i.Ja=!1),this.Ja=t}this.jt.sort(zb),n&&this.emit("selectionchange",this.Ja,this),this.emit("change",this)},Object.defineProperty(i.prototype,"points",{get:function(){return this.jt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"direction",{get:function(){return this.rn},set:function(t){this.rn!==t&&(this.rn=t,this.emit("directionchange",t,this),this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selected",{get:function(){return this.Ja},enumerable:!1,configurable:!0}),i.prototype.size=function(){return this.jt.length},i.prototype.get=function(t){var n=this.jt;return 0<=t&&t<n.length?n[t]:null},i.prototype.addAt=function(n){for(var i=this.jt,r=null,e=0,u=i.length;e<u;++e){var s=i[e];if(n<=s.position){if(null==r)return this.add(s.color,s.alpha,n,!0);var h=s.position-r.position;if(.001<h){var o=t.utils.hex2rgb(s.color,this.qa),a=o[0],c=o[1],f=o[2],l=t.utils.hex2rgb(r.color,this.qa),v=l[0],b=l[1],d=l[2],g=(n-r.position)/h,m=a*g+v*(1-g),w=c*g+b*(1-g),p=f*g+d*(1-g),O=this.qa;O[0]=m,O[1]=w,O[2]=p;var D=t.utils.rgb2hex(O),E=s.alpha*g+r.alpha*(1-g);return this.add(D,E,n,!0)}}r=s}return null!=r?this.add(r.color,r.alpha,n,!0):this.add(16777215,1,n,!0)},i.prototype.add=function(t,n,i,r){var e=this.Za,u=new Hb(t,n,i,r,e);return this.jt.push(u),e(u),u},i.prototype.remove=function(t){var n=this.jt;if(2<n.length)for(var i=0,r=n.length;i<r;++i)if(n[i]===t){n.splice(i,1);var e=this.Ja===t;return e&&(this.Ja=i+1<r?n[i]:n[i-1]),e&&this.emit("selectionchange",this.Ja,this),this.emit("change",this),!0}return!1},i.prototype.reset=function(){var t=this.rn;this.rn=-90;var n=this.jt,i=this.Ja,r=i?n.indexOf(i):-1;n.length=0;var e=this.Za;if(n.push(new Hb(16777215,0,0,!1,e)),n.push(new Hb(16777215,0,1,!1,e)),0<=r&&r<n.length)(u=n[r]).Ja=!0,this.Ja=u;else if(0<n.length){var u;(u=n[n.length-1]).Ja=!0,this.Ja=u}else this.Ja=null;return i!==this.Ja&&this.emit("selectionchange",this.Ja,this),t!==this.rn&&this.emit("directionchange",this.rn,this),this.emit("change",this),this},i.prototype.toObject=function(){for(var t=[],n=this.jt,i=0,r=n.length;i<r;++i)t.push(n[i].toObject());return{points:t,direction:this.rn}},i.prototype.fromObject=function(t){var n=this.rn;this.rn=t.direction;var i=this.jt,r=this.Ja,e=r?i.indexOf(r):-1;i.length=0;for(var u=this.Za,s=0,h=t.points.length;s<h;++s){var o=t.points[s],a=new Hb(o.color,o.alpha,o.position,!1,u);i.push(a)}return i.sort(zb),0<=e&&e<i.length?((a=i[e]).Ja=!0,this.Ja=a):0<i.length?((a=i[i.length-1]).Ja=!0,this.Ja=a):this.Ja=null,r!==this.Ja&&this.emit("selectionchange",this.Ja,this),n!==this.rn&&this.emit("directionchange",this.rn,this),this.emit("change",this),this},i}(t.utils.EventEmitter),Wb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputLabel"},n}(oh),Xb=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.Yh=new Wb(null==n?void 0:n.label)),i.addChild(i.Ah=i.createInput(null==n?void 0:n.input));var r=null==n?void 0:n.space;return null!=r&&i.addChild(new Ku(r)),i}return _(n,t),Object.defineProperty(n.prototype,"input",{get:function(){return this.Ah},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"label",{get:function(){return this.Yh},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputAndLabel"},n}(Cs),Kb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new qs(t)},n}(Xb),Yb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new th(t)},n}(Xb),Jb=function(){function t(t,n,i){this.Qa=t,this.$a=n,this.tc=i}return Object.defineProperty(t.prototype,"color",{get:function(){return this.Qa.color},set:function(t){if(this.Qa.color!==t){var n=this.$a;null!=n&&n(t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.Qa.alpha},set:function(t){if(this.Qa.alpha!==t){var n=this.tc;null!=n&&n(t)}},enumerable:!1,configurable:!0}),t}(),Zb=function(t){function n(n,i){var r=t.call(this)||this;return r.nc=n,r.Ht=i,r}return _(n,t),n.prototype.get=function(t){var n=this.nc;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.nc;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]={color:n.color,alpha:n.alpha},this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.nc,i=0,r=n.length;i<r;++i){var e=n[i];if(e.color===t.color&&e.alpha===t.alpha)return!0}return!1},n.prototype.add=function(t){var n=this.nc;return n.push({color:t.color,alpha:t.alpha}),this.Ht<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.nc.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.nc.length},n}(t.utils.EventEmitter),qb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),Object.defineProperty(i.prototype,"current",{get:function(){return this.ic},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"new",{get:function(){return this.rc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.ec},enumerable:!1,configurable:!0}),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r),this.Pr=16711680,this.uc={color:16777215,alpha:1},this.rc=new Jb(this.uc,(function(t){e.setColorNew(t)}),(function(t){e.setAlphaNew(t)})),this.au={color:16777215,alpha:1},this.ic=new Jb(this.au,(function(t){e.setColorCurrent(t)}),(function(t){e.setAlphaCurrent(t)}));var u=this.theme,s=this.Qn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.sc=new t.Point;var f=u.getMainWidth(),l=u.getMainHeight(),v=new t.Sprite(t.Texture.WHITE);this.hc=v,v.x=c,v.y=h,v.width=f,v.height=l,v.interactive=!0,this.addChild(v);var b=new t.Sprite(u.getMainTexture());this.oc=b,b.x=c,b.y=h,b.tint=this.Pr,b.interactive=!1,this.addChild(b),this.ac=function(t){e.onMainMove(t)},this.cc=function(t){e.onMainUp(t)},v.on(ir.down,(function(t){e.onMainDown(t)}));var d=new t.Sprite(u.getBaseTexture());this.fc=d,d.x=c,d.y=v.y+v.height+u.getBaseMargin(),d.interactive=!0,this.addChild(d),this.lc=function(t){e.onBaseMove(t)},this.vc=function(t){e.onBaseUp(t)},d.on(ir.down,(function(t){e.onBaseDown(t)}));var g=new t.Sprite(u.getAlphaCheckerboardTexture());this.bc=g,g.x=s.getLeft(),g.y=d.y+u.getBaseHeight()+u.getBaseMargin(),g.interactive=!1,this.addChild(g);var m=new t.Sprite(u.getAlphaTexture());m.tint=this.uc.color,m.interactive=!0,g.addChild(m),this.dc=function(t){e.onAlphaMove(t)},this.gc=function(t){e.onAlphaUp(t)},m.on(ir.down,(function(t){e.onAlphaDown(t)}));var w=new t.Sprite(u.getMainPointerTexture());this.mc=w,w.x=c,w.y=h,w.anchor.x=.5,w.anchor.y=.5,w.tint=u.getMainPointerColor(),w.alpha=u.getMainPointerAlpha(),w.interactive=!1,this.addChild(w);var p=new t.Sprite(u.getAlphaPointerTexture());this.wc=p,p.x=f,p.y=.5*g.height,p.tint=u.getAlphaPointerColor(),p.alpha=u.getAlphaPointerAlpha(),p.anchor.set(.5,.5),p.interactive=!1,g.addChild(p);var O=new t.Sprite(u.getBasePointerTexture());this.Oc=O,O.x=0,O.y=.5*d.height,O.tint=u.getBasePointerColor(),O.alpha=u.getBasePointerAlpha(),O.anchor.set(.5,.5),O.interactive=!1,d.addChild(O),this.Dc=[];var D=this.Dc,E=u.getRecentColorCount(),M=u.getRecentColorWidth(),S=u.getRecentColorHeight(),T=.5*M,j=.5*S,N=u.getRecentColorMargin(),I=g.y+u.getAlphaHeight()+u.getRecentMargin(),C=u.getRecentCheckerboardTexture();null==i.RECENT_COLORS&&(i.RECENT_COLORS=new Zb(u.getRecents().slice(0),E));var A=this.ec=i.RECENT_COLORS;A.on("change",(function(){e.onRecentChange()}));for(var R=function(n){var i=n.currentTarget;if(i instanceof t.Container){var r=i.children[0];r instanceof t.Sprite&&(e.setColorNew(r.tint),e.setAlphaNew(r.alpha))}},k=0;k<E;++k){var L=c+k*(M+N),y=new t.Sprite(C);y.x=L+T,y.y=I+j,y.anchor.x=.5,y.anchor.y=.5,y.buttonMode=!0,y.interactive=!0,y.on(ir.tap,R),this.addChild(y);var x=new t.Sprite(t.Texture.WHITE),B=A.get(k);null!=B?(x.tint=B.color,x.alpha=B.alpha):(x.tint=16777215,x.alpha=0),x.width=M,x.height=S,x.anchor.x=.5,x.anchor.y=.5,x.interactive=!1,y.addChild(x),D.push(x)}var _=u.getInputMargin(),P=u.getInputLabelWidth(),F=I+S+_,U=.5*(f-_),G=new Yb({parent:this,x:c,y:F,width:U,label:{width:P,text:{value:"#"},interactive:yi.NONE},input:{weight:1,text:{value:"FFFFFF"},on:{input:function(t){var n=an.fromCode(t);null!=n&&e.setColorNew(n)}}}});this.Ec=G;var H=G.height,z=new Kb({parent:this,x:c,y:F+H+_,width:U,label:{width:P,text:{value:"A"},interactive:yi.NONE},input:{weight:1,text:{value:1},min:0,max:1,on:{input:function(t){e.setAlphaNew(t)}}}});this.Mc=z;var V=.5*(U-P-_),W=H+_+H,X=c+.5*(f-_)+_,K=F+.5*(H+_+z.height-W),Y=new t.Sprite(u.getSampleCheckerboardTexture());this.Sc=Y,Y.x=X,Y.y=K,Y.width=V,Y.height=W,Y.interactive=!1,this.addChild(Y);var J=this.au,Z=new t.Sprite(t.Texture.WHITE);this.Tc=Z,Z.x=X,Z.y=K,Z.tint=J.color,Z.alpha=J.alpha,Z.width=V,Z.height=W,Z.interactive=!0,Z.buttonMode=!0,Z.on(ir.tap,(function(){e.setColorNew(J.color),e.setAlphaNew(J.alpha)})),this.addChild(Z);var q=new t.Sprite(u.getSampleCheckerboardTexture());this.jc=q,q.x=X+V,q.y=K,q.width=V,q.height=W,q.interactive=!1,this.addChild(q);var Q=new t.Sprite(t.Texture.WHITE);this.Nc=Q,Q.x=X+V,Q.y=K,Q.tint=this.uc.color,Q.alpha=this.uc.alpha,Q.width=V,Q.height=W,Q.interactive=!1,this.addChild(Q),null!=r&&null!=r.width||(this.width=c+f+o),null!=r&&null!=r.height||(this.height=F+G.height+_+z.height+a)},i.prototype.onMainDown=function(t){this.onMainPick(t.data.global);var n=st.getLayer(this);if(n){var i=n.stage;i.on(ir.move,this.ac),i.on(ir.up,this.cc)}},i.prototype.onMainMove=function(t){this.onMainPick(t.data.global)},i.prototype.onMainUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.ac),i.off(ir.up,this.cc)}},i.prototype.toMainHex=function(t,n,i,r){return Math.max(0,Math.min(255,255*n+i*(t>>r&255)))<<r},i.prototype.toMainColor=function(t,n,i,r,e){var u=.5*r,s=Math.max(0,Math.min(1,((n-u)*(1-i/e)+u)/r)),h=Math.max(0,Math.min(1,i/e)),o=Math.abs(.5*h-s),a=1-o-h;return this.toMainHex(t,a,o,16)|this.toMainHex(t,a,o,8)|this.toMainHex(t,a,o,0)},i.prototype.onMainPick=function(t){var n=this.sc,i=this.Qn,r=i.getLeft(),e=i.getTop(),u=this.theme,s=u.getMainWidth(),h=u.getMainHeight();this.toLocal(t,void 0,n);var o=Math.max(0,Math.min(s,n.x-r)),a=Math.max(0,Math.min(h,n.y-e));this.mc.position.set(r+o,e+a),this.onColorNew(this.toMainColor(this.Pr,o,a,s,h))},i.prototype.setColorCurrent=function(t){this.Tc.tint=this.au.color=t},i.prototype.setAlphaCurrent=function(t){this.Tc.alpha=this.au.alpha=t},i.prototype.setColorNew=function(t){var n=this.theme,i=n.getMainWidth(),r=n.getMainHeight(),e=this.Qn,u=pb.fromRgb(t);this.oc.tint=this.Pr=pb.toRgb(u[0],255,255),this.Oc.x=Math.max(0,Math.min(1,u[0]/360))*i;var s=Math.max(0,Math.min(1,u[1]/255)),h=Math.max(0,Math.min(1,1-u[2]/255)),o=this.mc;o.tint=h<.45?n.getMainPointerColor():16777215,o.position.set(e.getLeft()+s*i,e.getTop()+h*r),this.onColorNew(t)},i.prototype.onColorNew=function(t){var n=st.getLayer(this);n&&n.lock(),this.Nc.tint=this.uc.color=t,this.Ec.input.value=an.toCode(t),this.emit("newcolorchange",t,this),n&&(n.unlock(),n.update())},i.prototype.onBaseDown=function(t){this.onBasePick(t.data.global);var n=st.getLayer(this);if(n){var i=n.stage;i.on(ir.move,this.lc),i.on(ir.up,this.vc)}},i.prototype.onBaseMove=function(t){this.onBasePick(t.data.global)},i.prototype.onBaseUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.lc),i.off(ir.up,this.vc)}},i.prototype.toBaseHex=function(t,n){return Math.max(0,Math.min(255,6*t*255))<<n},i.prototype.toBaseColor=function(t){return t<=.167?16711680+this.toBaseHex(t,8):t<=.333?(t=.333-t,65280+this.toBaseHex(t,16)):t<=.5?(t-=.333,65280+this.toBaseHex(t,0)):t<.667?(t=.667-t,255+this.toBaseHex(t,8)):t<.883?(t-=.667,255+this.toBaseHex(t,16)):(t=.883-t,16711680+this.toBaseHex(t,0))},i.prototype.onBasePick=function(t){var n=this.sc,i=this.Qn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.Oc.x=e,this.onColorBase(this.toBaseColor(e/r))},i.prototype.setColorBase=function(t){var n=this.theme.getMainWidth();this.Oc.x=Math.max(0,Math.min(1,t/360))*n,this.onColorBase(pb.toRgb(t,255,255))},i.prototype.onColorBase=function(t){this.oc.tint=this.Pr=t;var n=this.mc,i=this.theme,r=i.getMainWidth(),e=i.getMainHeight(),u=this.Qn;this.onColorNew(this.toMainColor(this.Pr,n.x-u.getLeft(),n.y-u.getTop(),r,e))},i.prototype.onAlphaDown=function(t){this.onAlphaPick(t.data.global);var n=st.getLayer(this);if(n){var i=n.stage;i.on(ir.move,this.dc),i.on(ir.up,this.gc)}},i.prototype.onAlphaMove=function(t){this.onAlphaPick(t.data.global)},i.prototype.onAlphaUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.dc),i.off(ir.up,this.gc)}},i.prototype.onAlphaPick=function(t){var n=this.sc,i=this.Qn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.wc.x=e,this.onAlphaNew(e/r)},i.prototype.setAlphaNew=function(t){var n=this.theme.getMainWidth();this.wc.x=Math.max(0,Math.min(1,t))*n,this.onAlphaNew(t)},i.prototype.onAlphaNew=function(t){var n=st.getLayer(this);n&&n.lock(),this.Nc.alpha=this.uc.alpha=t,this.Mc.input.value=Number(t.toFixed(2)),this.emit("newalphachange",t,this),n&&(n.unlock(),n.update())},i.prototype.onRecentChange=function(){for(var t=this.Dc,n=this.ec,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(i);null!=u?(e.tint=u.color,e.alpha=u.alpha):(e.tint=16777215,e.alpha=0)}},i.prototype.getType=function(){return"DPickerColor"},i.RECENT_COLORS=null,i}(hr),Qb=function(t,n){if(t.direction!==n.direction)return!1;var i=t.points,r=n.points;if(i.length!==r.length)return!1;for(var e=0,u=i.length;e<u;++e){var s=i[e],h=r[e];if(s.color!==h.color||s.alpha!==h.alpha||s.position!==h.position)return!1}return!0},$b=function(t){function n(n,i){var r=t.call(this)||this;return r.nc=n,r.Ht=i,r}return _(n,t),n.prototype.getCapacity=function(){return this.Ht},n.prototype.get=function(t){var n=this.nc;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.nc;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]=n,this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.nc,i=0,r=n.length;i<r;++i)if(Qb(n[i],t))return!0;return!1},n.prototype.add=function(t){var n=this.nc;return n.push(t),this.Ht<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.nc.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.nc.length},n}(t.utils.EventEmitter),td=function(n){function i(i,r,e,u,s,h,o,a){var c=n.call(this,o,a)||this;return c.interactive=!0,c.interactiveChildren=!1,c.cursor="pointer",c.Ic=i,c.Tn=r,c._uvs=e,c.Cc=u,c.In=s,c.Ac=-1,c.qa=[0,0,0],c.Rc=new t.Point,c.kc=h,a.uniforms.uSampler.on("update",(function(){c.update(),st.update(c)})),c.update(),c}return _(i,n),i.prototype.getRectangle=function(t){var n=this.kc;return 0<=t&&t<n.length?n[t].rect:null},i.prototype.setRectangle=function(t,n,i,r,e){var u=this.kc;if(0<=t&&t<u.length){var s=u[t].rect;s.x=n,s.y=i,s.width=r,s.height=e}},i.prototype.getData=function(t){var n=this.kc;return 0<=t&&t<n.length?n[t].data:null},i.prototype.setData=function(t,n){var i=this.kc;0<=t&&t<i.length&&(i[t].data=n)},i.prototype.getLastHitIndex=function(){return this.Ac},i.prototype.setColors=function(t,n,i,r){n[t+0]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=r,n[t+4]=i[0],n[t+5]=i[1],n[t+6]=i[2],n[t+7]=r},i.prototype.setColorsHex=function(n,i,r,e){var u=t.utils.hex2rgb(r,this.qa);this.setColors(n,i,u,e)},i.prototype.setColorsWhite=function(t,n){var i=this.qa;i[0]=1,i[1]=1,i[2]=1,this.setColors(t,n,i,0)},i.prototype.setColorsPoint=function(t,n,i,r){var e=n.points[i];null!=e?this.setColorsHex(t,r,e.color,e.alpha):this.setColorsWhite(t,r)},i.prototype.setVertices=function(t,n,i,r){var e=r.y+r.height*i;n[t+0]=r.x,n[t+1]=e,n[t+2]=r.x+r.width,n[t+3]=e},i.prototype.setUvs=function(t,n,i,r){var e=r.x0+(r.x3-r.x0)*i,u=r.y0+(r.y3-r.y0)*i,s=r.x1+(r.x2-r.x1)*i,h=r.y1+(r.y2-r.y1)*i;n[t+0]=e,n[t+1]=u,n[t+2]=s,n[t+3]=h},i.prototype.newIndices=function(t,n,i,r){for(var e=0;e<i;++e)r[t+0]=n+0,r[t+1]=n+1,r[t+2]=n+2,r[t+3]=n+2,r[t+4]=n+1,r[t+5]=n+3,t+=6,n+=2;return r},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,n=this.kc[0].rect,i=this._bounds,r=this.Rc;r.set(n.x,n.y),t.apply(r,r),i.addPoint(r),r.set(n.x+n.width,n.y+n.height),t.apply(r,r),i.addPoint(r)},i.prototype.update=function(){var t=this.Tn,n=this._uvs,i=this.Cc,r=this.In,e=this.shader.uniforms.uSampler;null==e._uvs&&e.updateUvs();for(var u=e._uvs,s=0,h=0,o=0,a=0,c=this.kc,f=0,l=c.length;f<l;++f){var v=c[f].data,b=c[f].rect;if(null==v)this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsWhite(o,i),this.setVertices(s+4,t,1,b),this.setUvs(s,n,1,u),this.setColorsWhite(o+8,i),this.newIndices(a,h,1,r),s+=8,o+=16,h+=4,a+=6;else{this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsPoint(o,v,0,i),s+=4,o+=8;for(var d=v.points.length,g=0,m=Math.min(d,this.Ic);g<m;++g){var w=v.points[g];this.setVertices(s,t,w.position,b),this.setUvs(s,n,w.position,u),this.setColorsHex(o,i,w.color,w.alpha),s+=4,o+=8}this.setVertices(s,t,1,b),this.setUvs(s,n,1,u),this.setColorsPoint(o,v,d-1,i),s+=4,o+=8,this.newIndices(a,h,d+1,r),a+=6*(d+1),h+=2*(d+2)}}this.size=a;var p=this.geometry;p.getBuffer("aPosition").update(),p.getBuffer("aUv").update(),p.getBuffer("aColor").update(),p.getIndex().update()},i.prototype.containsPoint=function(t){for(var n=this.toLocal(t,void 0,this.Rc),i=this.kc,r=0,e=i.length;r<e;++r)if(i[r].rect.contains(n.x,n.y))return this.Ac=r,!0;return!1},i.from=function(n,r,e,u){void 0===u&&(u=t.Texture.WHITE);for(var s=new Float32Array(n*(r+2)*2*2),h=new Float32Array(n*(r+2)*2*2),o=new Float32Array(n*(r+2)*2*4),a=new Uint16Array(n*(r+1)*6),c=[],f=0;f<n;++f)c.push({data:null,rect:new t.Rectangle});return new i(r,s,h,o,a,c,(new t.Geometry).addIndex(new t.Buffer(a,!1,!0)).addAttribute("aPosition",new t.Buffer(s,!1,!1),2).addAttribute("aUv",new t.Buffer(h,!1,!1),2).addAttribute("aColor",new t.Buffer(o,!1,!1),4),t.Shader.from("\nattribute vec2 aPosition;\nattribute vec2 aUv;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\n\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nvoid main(void) {\n\tvec3 position = vec3(aPosition.x, aPosition.y, 1.0);\n\tgl_Position = vec4((projectionMatrix * translationMatrix * position).xy, 0.0, 1.0);\n\tvUv = aUv;\n\tvColor = aColor;\n}\n","\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform vec2 uCheckerColors;\n\nvoid main(void) {\n\tvec4 texture = texture2D(uSampler, vUv);\n\tfloat cy = step( 1.0, mod( gl_FragCoord.y / 10.0, 2.0 ) );\n\tfloat cx = step( 1.0, mod( gl_FragCoord.x / 10.0 + cy, 2.0 ) );\n\tfloat c = mix( uCheckerColors.x, uCheckerColors.y, cx );\n\tgl_FragColor = texture * vec4( mix( vec3( c ), vColor.xyz, vColor.a ), 1.0 );\n}",{uSampler:u,uCheckerColors:e}))},i}(t.Mesh),nd=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r);var u=this.theme,s=this.Qn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.Mu=new t.Point;var f=u.getGradientPointsWidth(),l=u.getGradientPointsMargin(),v=new qb({x:c+f+l,y:h});this.Jh=v,v.on("newcolorchange",(function(t){e.onAnchorColorChange(t)})),v.on("newalphachange",(function(t){e.onAnchorAlphaChange(t)})),this.addChild(v);var b=this.br=td.from(17,10,u.getGradientCheckerColors());b.setRectangle(0,c,h,f,v.height),this.addChild(b),b.on(ir.down,(function(t){0===b.getLastHitIndex()&&e.onViewDown(t)})),this.Lc=function(t){e.onAnchorDown(t)},this.yc=function(t){e.onAnchorMove(t)},this.xc=function(t){e.onAnchorUp(t)},this.Bc=[];var d=u.getGradientRecentColumn(),g=u.getGradientRecentWidth(),m=u.getGradientRecentMargin(),w=g+m,p=v.theme.getInputLabelWidth(),O=g*d+m*(d-1),D=u.getGradientDirectionMargin(),E=u.getGradientDirectionTexture(),M=v.x+v.width+D,S=new qs({parent:this,x:M+p+5,y:h,width:O-2*(p+5),step:1,image:{source:E,align:{with:rs.BORDER},margin:{horizontal:-E.width-5}},on:{change:function(t){e.Ut.rn=t}}}),T=M,j=S.y+S.height+D;null==i.RECENT_COLOR_GRADIENT&&(i.RECENT_COLOR_GRADIENT=new $b(u.getGradientRecents(),u.getGradientRecentCount())),this.ec=i.RECENT_COLOR_GRADIENT;for(var N=this.ec,I=0,C=N.getCapacity();I<C;++I){var A=T+I%d*w,R=j+(I/d|0)*w;b.setRectangle(1+I,A,R,g,g)}N.on("change",(function(){e.onRecentUpdate()})),b.on(ir.tap,(function(t){var n=b.getLastHitIndex();1<=n&&e.onRecentClick(b.getData(n))}));var k=new Vb;this.Ut=k,k.on("change",(function(){e.updateAnchors(),b.update()})),k.on("selectionchange",(function(t){e.onAnchorSelect(t)})),k.on("directionchange",(function(t){S.value=t})),b.setData(0,k),b.update(),S.value=k.direction,this.updateAnchors();var L=k.selected;null!=L&&this.onAnchorSelect(L),null!=r&&null!=r.width||(this.width=c+f+l+v.width+D+(d-1)*m+d*g+o),null!=r&&null!=r.height||(this.height=h+v.height+a)},Object.defineProperty(i.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.ec},enumerable:!1,configurable:!0}),i.prototype.onRecentClick=function(t){var n=this.Ut;null!=t?n.fromObject(t):n.reset()},i.prototype.onRecentUpdate=function(){for(var t=this.ec,n=this.br,i=0,r=t.size();i<r;++i)n.setData(1+i,t.get(i));n.update(),st.update(this)},i.prototype.toAnchorPosition=function(t){var n=this.toLocal(t.data.global,void 0,this.Mu);return Math.max(0,Math.min(1,(n.y-this.padding.getTop())/this.Jh.height))},i.prototype.onViewDown=function(t){this.Ut.addAt(this.toAnchorPosition(t)),this.onAnchorDragStart()},i.prototype.onAnchorDown=function(n){var i=n.target;if(i instanceof t.Sprite){var r=this.Ut,e=this.Bc.indexOf(i);0<=e&&e<r.points.length&&(r.points[e].selected=!0,this.onAnchorDragStart())}},i.prototype.onAnchorSelect=function(t){var n=this.Jh;n.current.color=t.color,n.current.alpha=t.alpha,n.new.color=t.color,n.new.alpha=t.alpha},i.prototype.onAnchorColorChange=function(t){var n=this.Ut;if(null!=n){var i=n.selected;null!=i&&(i.color=t)}},i.prototype.onAnchorAlphaChange=function(t){var n=this.Ut;if(null!=n){var i=n.selected;null!=i&&(i.alpha=t)}},i.prototype.onAnchorDragStart=function(){var t=st.getLayer(this);if(t){var n=t.stage;n.on(ir.move,this.yc),n.on(ir.up,this.xc)}},i.prototype.onAnchorMove=function(t){var n=this.Ut;if(null!=n){var i=n.selected;null!=i&&(i.position=this.toAnchorPosition(t))}},i.prototype.onAnchorUp=function(t){var n=st.getLayer(this);if(n){var i=n.stage;i.off(ir.move,this.yc),i.off(ir.up,this.xc)}},i.prototype.updateAnchors=function(){for(var n=this.theme,i=n.getGradientAnchorTexture(),r=n.getGradientAnchorOutlinedTexture(),e=n.getGradientPointsWidth(),u=this.Ut,s=u.points.length,h=this.Bc,o=h.length,a=o;a<s;++a){var c=new t.Sprite(i);c.anchor.set(.5,.5),c.cursor="pointer",c.interactive=!0,c.on(ir.down,this.Lc),h.push(c),this.addChild(c)}for(a=o-1;s<=a;--a){var f=h[a];f.off(ir.down,this.Lc),f.destroy()}h.length=s;var l=this.padding.getTop(),v=this.padding.getLeft()+e,b=this.Jh.height;for(a=0;a<s;++a){var d=u.points[a],g=h[a];g.tint=d.color,g.position.set(v,l+b*d.position),g.texture=d.selected?r:i}st.update(this)},i.prototype.onKeyDown=function(t){if(nr.isDeleteKey(t)){var i=this.Ut;if(null!=i){var r=i.selected;if(null!=r)return i.remove(r),n.prototype.onKeyDown.call(this,t),!0}}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DPickerColorGradient"},i.RECENT_COLOR_GRADIENT=null,i}(hr),id=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.value,e=i.recent;e.contains(r)||e.add(r.toObject())},Object.defineProperty(n.prototype,"value",{get:function(){return this.picker.value},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new nd(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.value},n.prototype.onKeyDown=function(n){return this.picker.onKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DDialogColorGradient"},n}(eh),rd=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r;if(n.prototype.init.call(this,i),void 0===(null===(r=null==i?void 0:i.image)||void 0===r?void 0:r.source)){var e=this.theme,u=e.getViewBaseTexture();if(u instanceof t.Texture){var s=e.getCheckerColors(),h=td.from(1,10,s,u);this.br=h,h.setRectangle(0,0,0,u.width,u.height),h.setData(0,this.oh),h.update(),this.image=h}}},i.prototype.onActivate=function(t){var i=this;n.prototype.onActivate.call(this,t);var r=this.oh,e=this.dialog;null!=r&&e.value.fromObject(r),e.open(this).then((function(t){i.onValueChange(t,i.toClone(r))}))},i.prototype.toClone=function(t){var n=new Vb;return null!=t&&n.fromObject(t),n},i.prototype.onValueChange=function(t,n){var i=this.oh;null!=i&&i.fromObject(t);var r=this.br;null!=r&&r.update(),this.onTextChange(),this.createOrUpdateText(),st.update(this),this.emit("change",t,n,this)},Object.defineProperty(i.prototype,"dialog",{get:function(){var t,n=this._c;if(null==n){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?n=this.newDialog(r):(null==i.DIALOG&&(i.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),n=i.DIALOG),this._c=n}return n},enumerable:!1,configurable:!0}),i.prototype.newDialog=function(t){return new id(t)},Object.defineProperty(i.prototype,"value",{get:function(){return this.oh},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DButtonColorGradient"},i}(Ns),ed=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.picker),r},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.recent;r.contains(i.new)||r.add(i.new)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.Jh;return null==n&&(n=new qb(null===(t=this.zn)||void 0===t?void 0:t.picker),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogColor"},n}(eh),ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.dialog,e=this.oh;if(null!=e){var u=r.current;u.color=e.color,u.alpha=e.alpha;var s=r.new;s.color=e.color,s.alpha=e.alpha}r.open(this).then((function(){i.onValueChange(i.toClone(r.new),i.toClone(r.current))}))},n.prototype.toClone=function(t){return{color:t.color,alpha:t.alpha}},n.prototype.onValueChange=function(t,n){var i=this.oh;null!=i&&(i.color=t.color,i.alpha=t.alpha),this.onColorChange(),this.emit("change",t,n,this)},n.prototype.toImageTintOptions=function(t){var n=this,i=function(){return n.oh.color};return t?{color:t.color||i,alpha:t.alpha}:{color:i}},n.prototype.toImageOptions=function(t,n){return n?{source:n.source,tint:this.toImageTintOptions(n.tint),align:n.align,margin:n.margin}:{tint:this.toImageTintOptions()}},n.prototype.onColorChange=function(){this.mh[0].updateTint()&&st.update(this),this.updateTextForcibly()},n.prototype.updateTextForcibly=function(){this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new ed(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t=this.Ut;return null==t&&(t=this.newValue(),this.Ut=t),t},enumerable:!1,configurable:!0}),n.prototype.newValue=function(){var t=this,n=this.oh;return new Jb(n,(function(i){n.color=i,t.onColorChange()}),(function(i){n.alpha=i,t.updateTextForcibly()}))},n.prototype.getType=function(){return"DButtonColor"},n}(Ns),sd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonDanger"},n}(Ns),hd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.oh)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Ih(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:new Date},set:function(t){var n=this.oh;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDate"},n}(Ns),od=function(){function t(){}return t.format=function(t){var n=on(String(t.getFullYear()),4,"0"),i=on(String(t.getMonth()+1),2,"0"),r=on(String(t.getDate()),2,"0");return"".concat(n,"/").concat(i,"/").concat(r)},t}(),ad=function(){function t(){}return t.format=function(t,n){var i="";return n&lh.HOURS&&(i+=on(String(t.getHours()),2,"0")),n&lh.MINUTES&&(0<i.length&&(i+=":"),i+=on(String(t.getMinutes()),2,"0")),n&lh.SECONDS&&(0<i.length&&(i+=":"),i+=on(String(t.getSeconds()),2,"0")),i},t.toMask=function(t){return vh.from("DPickerTime",t)},t}(),cd=function(){function t(){}return t.format=function(t,n){var i=ad.format(t,n);return 0<i.length?"".concat(od.format(t)," ").concat(i):"".concat(od.format(t))},t.toMask=function(t){return vh.from("DPickerDatetime",t)},t}(),fd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.oh)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.Pc;return null==i&&(i=cd.toMask(null===(n=null===(t=this.zn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Pc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Eh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:new Date},set:function(t){var n=this.oh;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDatetime"},n}(Ns),ld=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getChecker=function(){var t,n,i=this.Uo;return void 0===i&&(i=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.checker)&&void 0!==n?n:null,this.Uo=i),i},n.prototype.getOpener=function(){var t=this.js;return null==t&&(t=this.newOpener(),this.js=t),t},n.prototype.newOpener=function(){var t,n;return new wb(Ai(null!==(n=null===(t=this.zn)||void 0===t?void 0:t.as)&&void 0!==n?n:mb.TEXT,mb),this)},n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n),this.check((function(){i.open()}))},n.prototype.check=function(t){var n=this.getChecker();if(null!=n){var i=n();!0===i?t():!1===i||i.then((function(){t()}))}else t()},n.prototype.open=function(){this.getOpener().open()},n.prototype.getType=function(){return"DButtonFile"},n}(Ns),vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return null==t&&(t=new Gl(this.zn),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n.prototype.getType=function(){return"DButtonLink"},n}(js),bd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadio"},n}(js),dd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadioRight"},n}(bd),gd=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=yb.getCommandController();return r.isDisabled=!e.isRedoable(),e.on("change",(function(){r.isDisabled=!e.isRedoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),yb.getCommandController().redo()},n}(Ns),md=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonSecondary"},n}(Ns),wd={NONE:0,SINGLE:1,MULTIPLE:2},pd=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Xt=n,r.on(ir.tap,(function(t){r.onClick(t)})),r}return _(n,t),Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return void 0===t&&(t=this.newLink(),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t=this.Xt.accessor.link;return t?new Gl(this.toLinkOptions(t)):null},n.prototype.onClick=function(t){var n;!0!==(null===(n=this.link)||void 0===n?void 0:n.onClick(this,t))&&this.state.isActionable&&this.activate(t)},n.prototype.activate=function(t){var n=this.Ut;void 0!==n&&this.onSelect(t,n)},n.prototype.toLinkOptions=function(t){return{url:this.toLinkUrl(t.toUrl),target:t.target,checker:this.toLinkChecker(t.checker)}},n.prototype.toLinkUrl=function(t){var n=this;return function(){var i=n.Ut;if(void 0!==i)return t(i)}},n.prototype.toLinkChecker=function(t){var n=this;if(t)return function(){var i=n.Ut;return null!=i&&t(i)}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),n.prototype.onSelect=function(t,n){var i;this.emit("select",n,this);var r=this.Xt,e=r.selection;if(e.type!==wd.MULTIPLE)e.clearAndAdd(n);else{var u=t&&"data"in t?t.data.originalEvent:t;if(null==u?void 0:u.ctrlKey)e.toggle(n);else if(null==u?void 0:u.shiftKey){var s=r.mapped,h=e.last;if(n===h)e.clearAndAdd(n);else{var o=!1,a=!1,c=[];s.each((function(t){if(o){if(a){if(c.unshift(t),t===n)return!1}else if(c.push(t),t===h)return!1}else t===n?(o=!0,a=!1,c.push(t)):t===h&&(o=!0,a=!0,c.push(t))})),e.clearAndAddAll(c)}}else e.clearAndAdd(n)}null===(i=this.Go)||void 0===i||i.open(t)},n.prototype.set=function(t,n,i){var r=this.Xt,e=i||this.Ut!==t;if(e){this.Ut=t,this.hu=n;var u=r.accessor;this.text=u.toLabel(t),this.title=u.toTitle(t)||"",this.image=u.toImage(t)}var s=this.state;s.lock(),s.set(ct.ACTIVE,r.selection.contains(t)),s.remove(ct.DISABLED),s.unlock(),e&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Ut){this.Ut=void 0,this.hu=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ct.DISABLED),t.remove(ct.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.getType=function(){return"DListItem"},n}(Ts),Od=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogSelectListItem"},n}(pd),Dd=function(){function t(t,n,i,r){this.Fc=0,this.Uc=!1,this.Gc=!1,this.Hc=-1,this.zc=-1,this.Is=1,this.Vc=0,this.Wc=0,this.Xc=[],this.Xt=t,this.Nh=n,this.Kc=i,this.Yc=this.toNewItem(r),this.Jc=this.toInitItem(r)}return t.prototype.toNewItem=function(t){return(null==t?void 0:t.newItem)||this.newItem},t.prototype.toInitItem=function(t){return t?t.initItem||(!1!==t.stripe?this.initItem:this.initItemNoStriping):this.initItem},t.prototype.initItem=function(t,n,i){return t.state.isAlternated=n%2==1,t},t.prototype.initItemNoStriping=function(t,n,i){return t},Object.defineProperty(t.prototype,"multiplicity",{get:function(){return this.Is},enumerable:!1,configurable:!0}),t.prototype.lock=function(){this.Fc+=1,1===this.Fc&&(this.Uc=!1,this.Gc=!1)},t.prototype.unlock=function(t){this.Fc-=1,0===this.Fc&&(t&&this.Uc&&this.update(this.Gc),this.Uc=!1,this.Gc=!1)},t.prototype.update=function(t){var n=this;if(0<this.Fc)return this.Uc=!0,void(t&&(this.Gc=!0));var i=this.Nh,r=i.parent;if(null!=r){var e=this.Kc,u=e.children,s=r.height,h=this.Xt,o=this.toMapped(h),a=o.size(),c=this.Vc,f=this.Wc,l=f-c,v=this.Yc,b=this.Jc,d=this.Hc,g=this.zc;if(this.Hc<0){var m=void 0;0<u.length?m=u[0]:(m=b(v(h),c,h),e.addChild(m),f+=1,l+=1),d=Math.max(1,m.height),pt(m.getWidth())&&(g=Math.max(1,m.width)),this.Hc=d,this.zc=g}var w=i.padding,p=w.getTop(),O=w.getBottom(),D=w.getLeft(),E=w.getRight(),M=Math.max(0,i.width-D-E),S=0<g?Math.max(1,Math.floor(M/g)):1;this.Is=S;var T=i!==e?e.transform.position.y:p,j=Math.ceil(a/S)*d,N=Math.max(s,p+j+O),I=Math.max(s-N,i.position.y),C=Math.floor((0-(I+T))*S/d),A=Math.floor((s-(I+T))*S/d),R=C-S;R%2!=0&&(R-=1);var k=A+S+S;k%2!=0&&(k+=1);var L=k-R;if(L<l&&l-2<=L&&(k=R+(L=l)),l<L){for(var y=l;y<L;++y){var x=c+y;m=b(v(h),x,h),e.addChild(m)}f=c+(l=L)}else if(L<l){for(y=l-1;L<=y;--y)e.removeChild(u[y]);f=c+(l=L)}this.Vc=R,this.Wc=k;var B=R-c,_=Math.abs(B),P=u.length;if(0<_&&_<P){var F=this.Xc;if(0<B){for(y=0;y<_;++y)m=u[y],this.reset(m),F.push(m);for(y=_;y<P;++y)u[y-_]=u[y];for(y=0;y<_;++y)u[P-_+y]=F[y]}else{for(y=0;y<_;++y)m=u[P-_+y],this.reset(m),F.push(m);for(y=P-_-1;0<=y;--y)u[y+_]=u[y];for(y=0;y<_;++y)u[y]=F[y]}F.length=0}var U=0,G=0;for(i===e&&(U=D,G=p),o.each((function(i,r){var e=u[r-R],s=r%S,h=Math.floor(r/S);e.position.set(U+s*g,G+h*d),n.set(e,i,r,t)}),R,R+P),y=0;R+y<0&&y<P;++y){m=u[y];var H=(V=R+y)%S,z=Math.floor(V/S);m.position.set(U+H*g,G+z*d),this.unset(m)}for(y=P-1;a<=R+y&&0<=y;--y){var V;m=u[y],H=(V=R+y)%S,z=Math.floor(V/S),m.position.set(U+H*g,G+z*d),this.unset(m)}this.lock(),i.position.y=I,i.height=N,i!==e&&(e.height=j),this.unlock(!1)}},t.prototype.set=function(t,n,i,r){t.set(n,i,r)},t.prototype.unset=function(t){t.unset()},t.prototype.reset=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof hr){var u=e.state;u.lock(),u.isPressed=!1,u.isHovered=!1,u.unlock()}}return t.state.isHovered=!1,t},t.prototype.moveFocus=function(t,n,i,r){if(!i&&!r)return!1;var e=i&&nr.isArrowUpKey(t),u=i&&nr.isArrowDownKey(t),s=r&&nr.isArrowLeftKey(t),h=r&&nr.isArrowRightKey(t);if(!(e||u||s||h))return!1;if(!n.state.isActionable)return!1;var o=st.getLayer(n);if(null==o)return!1;var a=o.getFocusController(),c=a.get();if(null==c)return!1;var f=this.Kc;if(c.parent!==f)return!1;var l=c,v=l.index;if(null==v)return!1;var b=this.Is,d=this.Xt,g=this.toMapped(d).size(),m=v;if((s||h)&&(s?0<=m-1&&(m-=1):m+1<g&&(m+=1)),(e||u)&&(e?0<=m-b&&(m-=b):m+b<g&&(m+=b)),m===v)return!1;var w=f.children,p=w.indexOf(l);if(p<0)return!1;var O=p+(m-v);if(O<0||w.length<=O)return!1;var D=w[O];return a.focus(D),!0},t}(),Ed=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new pd(t)},n}(Dd),Md=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItem=function(t){return new Od(t)},n}(Ed),Sd=function(){function t(t){this.p=t}return t.prototype.size=function(){var t=this.p;return t.before.length+t.items.length+t.after.length},t.prototype.each=function(t,n,i){var r=this.p,e=this.Zc(t,r.before,0,n,i);if(!(e<0)){var u=this.Zc(t,r.items,e,n,i);u<0||this.Zc(t,r.after,u,n,i)}},t.prototype.Zc=function(t,n,i,r,e){for(var u=i+n.length,s=null!=r?Math.max(i,r):i,h=null!=e?Math.min(u,e):u,o=s;o<h;++o)if(!1===t(n[o-i],o))return-1;return h},t}(),Td=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n,e.qc=i,e.Qc=new Set;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return wd.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.get(0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.Qc;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.Qc;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.Qc;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.Qc;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.Qc;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.Qc;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.Qc,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.Qc=i,this.onChange()),n},n.prototype.contains=function(t){return this.Qc.has(t)},n.prototype.size=function(){return this.Qc.size},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=!1;this.Qc.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.Qc.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toItemIdMap=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];i.set(n(u),u)}},n.prototype.toItemSet=function(t,n){for(var i=0,r=t.length;i<r;++i)n.add(t[i])},n.prototype.onItemChange=function(t,n,i){var r=this.Qc,e=new Set,u=this.qc.toId;if(u){var s=new Map;this.toItemIdMap(t,u,s),this.toItemIdMap(n,u,s),this.toItemIdMap(i,u,s),r.forEach((function(t){var n=u(t),i=s.get(n);null!=i&&e.add(i)})),this.Qc=e,this.onChange()}else{var h=new Set;this.toItemSet(t,h),this.toItemSet(n,h),this.toItemSet(i,h),r.forEach((function(t){h.has(t)&&e.add(t)})),r.size!==e.size&&(this.Qc=e,this.onChange())}},n.prototype.newItems=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];n.has(u)&&i.add(u)}return i},n}(t.utils.EventEmitter),jd=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return wd.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onItemChange=function(t,n,i){},n}(t.utils.EventEmitter),Nd=function(t){function n(n,i,r){var e=t.call(this)||this;e.p=n,e.qc=i,e.$c=null;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return wd.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.$c},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.$c:null},n.prototype.add=function(t){return this.$c!==t&&(this.$c=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.$c===t&&(this.$c=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.$c===t?this.$c=null:this.$c=t,this.onChange(),!0},n.prototype.clear=function(){null!=this.$c&&(this.$c=null,this.onChange())},n.prototype.clearAndAdd=function(t){return this.$c!==t&&(this.$c=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){var n=t.length;if(0<n){var i=t[n-1];if(this.$c!==i)return this.$c=i,this.onChange(),!0}else if(null!=this.$c)return this.$c=null,this.onChange(),!0;return!1},n.prototype.contains=function(t){return this.$c===t},n.prototype.size=function(){return null!=this.$c?1:0},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=this.$c;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.$c;return null!=t?[t]:[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.findById=function(t,n,i){for(var r=0,e=i.length;r<e;++r){var u=i[r];if(t===n(u))return u}return null},n.prototype.find=function(t,n){for(var i=0,r=n.length;i<r;++i){var e=n[i];if(t===e)return e}return null},n.prototype.onItemChange=function(t,n,i){var r=this.$c;if(null!=r){var e=null,u=this.qc.toId;if(u){var s=u(r);e=this.findById(s,u,t)||this.findById(s,u,n)||this.findById(s,u,i)}else e=this.find(r,t)||this.find(r,n)||this.find(r,i);r!==e&&(this.$c=e,this.onChange())}},n}(t.utils.EventEmitter),Id=function(t){return t.image},Cd=function(t){return t.title},Ad=function(t){return t.url},Rd=function(){function t(t){this.toLabel=(null==t?void 0:t.toLabel)||fb,this.toTitle=(null==t?void 0:t.toTitle)||Cd,this.toImage=(null==t?void 0:t.toImage)||Id,this.toId=null==t?void 0:t.toId,this.link=this.toLink(t)}return t.prototype.toLink=function(t){if(t){var n=t.link;if(n){var i=n.toUrl,r=n.target,e=n.checker;if(void 0!==i||void 0!==r||void 0!==e)return{toUrl:i||Ad,target:r,checker:e}}}},t}(),kd=function(){function t(t,n){this.p=t,n?(this.Yu=n.before||[],this.Qc=n.items||[],this.Ju=n.after||[]):(this.Yu=[],this.Qc=[],this.Ju=[]);var i=new Rd(n);this.qc=i,this.tf=this.toSelection(i,n),this.nf=new Sd(this)}return t.prototype.toSelection=function(t,n){var i=null==n?void 0:n.selection;switch(null==i?void 0:i.type){case wd.NONE:case"NONE":return new jd(this,t,i);case wd.MULTIPLE:case"MULTIPLE":return new Td(this,t,i);default:return new Nd(this,t,i)}},Object.defineProperty(t.prototype,"before",{get:function(){return this.Yu},set:function(t){this.Yu=t,this.tf.onItemChange(t,this.Qc,this.Ju),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this.Qc},set:function(t){this.Qc=t,this.tf.onItemChange(this.Yu,t,this.Ju),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.Ju},set:function(t){this.Ju=t,this.tf.onItemChange(this.Yu,this.Qc,t),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.qc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),t.prototype.update=function(t){this.p.update(t)},t.prototype.size=function(){return this.Qc.length},t.prototype.clear=function(){var t=this.Qc;return 0<t.length&&(t.length=0,this.onChange(),!0)},t.prototype.clearAndAdd=function(t){var n=this.Qc;return 1===n.length?n[0]!==t&&(n[0]=t,this.onChange(),!0):(n.length=0,n.push(t),this.onChange(),!0)},t.prototype.clearAndAddAll=function(t){var n=!1,i=this.Qc;if(0<i.length&&(i.length=0,n=!0),0<t.length){for(var r=0,e=t.length;r<e;++r)i.push(t[r]);n=!0}return!!n&&(this.onChange(),!0)},t.prototype.add=function(t,n){var i=this.Qc;return null==n?(i.push(t),this.onChange(),!0):0<=n&&n<i.length&&(i.splice(n,0,t),this.onChange(),!0)},t.prototype.addAll=function(t,n){if(0<t.length){var i=this.Qc,r=i.length;if(null==n){for(var e=0,u=t.length;e<u;++e)i.push(t[e]);return this.onChange(),!0}if(0<=n&&n<r){for(e=0,u=t.length;e<u;++e)i.splice(n+e,0,t[e]);return this.onChange(),!0}}return!1},t.prototype.get=function(t){var n=this.Qc;return 0<=t&&t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.Qc;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.onChange(),r}return null},t.prototype.remove=function(t){var n=this.Qc;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.onChange(),i}return null},t.prototype.each=function(t,n,i){for(var r=this.Qc,e=r.length,u=null!=n?Math.max(0,n):0,s=null!=i?Math.min(e,i):e,h=u;h<s&&!1!==t(r[h],h);++h);},t.prototype.onChange=function(){this.update()},t}(),Ld=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DContent"},n}(hr),yd=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).if=0,e.rf=1,e.visible=!1,e.ef=-1,e.uf=!1,e.sf=null,e.hf=null!==(r=null===(i=null==n?void 0:n.fadeOut)||void 0===i?void 0:i.delay)&&void 0!==r?r:e.theme.getFadeOutDelay(),e.af=!0,e.cf=function(){e.onFadeOutTimeout()};var u=e.newThumb(null==n?void 0:n.thumb);return u.on("statechange",(function(t,n){e.onThumbStateChange(t,n)})),e.ff=u,e.addChild(u),e}return _(n,t),Object.defineProperty(n.prototype,"thumb",{get:function(){return this.ff},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"start",{get:function(){return this.if},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"end",{get:function(){return this.rf},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r){i<1?(t=0,n=1):(t=Math.max(0,Math.min(1,t/i)),n=Math.max(t,Math.min(1,n/i))),this.if===t&&this.rf===n||(this.if=t,this.rf=n,this.onChange(r))},n.prototype.onChange=function(t){this.updateThumb(this.width,this.height),t&&(this.af=!0),this.uf||(this.uf=!0,st.update(this))},n.prototype.touch=function(t){this.onChange(t)},n.prototype.isRegionVisible=function(){return 0<this.if||this.rf<1},n.prototype.render=function(n){if(this.uf)if(this.uf=!1,!this.af&&this.isRegionVisible()){var i=this.hf;0<=i&&(this.ef=Date.now(),null==this.sf&&(this.sf=window.setTimeout(this.cf,i))),this.visible||(this.visible=!0)}else this.hf<0&&this.visible&&(this.visible=!1);this.af&&(this.af=!1),t.prototype.render.call(this,n)},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateThumb(n,i)},n.prototype.onFadeOutTimeout=function(){this.sf=null;var t=this.hf,n=this.cf,i=this.state;if(i.isGesturing||i.onHovered||i.isHovered||i.isPressed)this.sf=window.setTimeout(n,t);else{var r=this.ff.state;if(r.isGesturing||r.isHovered||r.isPressed)this.sf=window.setTimeout(n,t);else{var e=t-(Date.now()-this.ef);0<e?this.sf=window.setTimeout(n,e):this.visible&&(this.visible=!1,st.update(this))}}},n.prototype.onThumbStateChange=function(t,n){t.isGesturing||t.isHovered||t.isPressed||(n.isGesturing||n.isHovered||n.isPressed)&&(this.ef=Date.now())},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isGesturing||n.isHovered||n.isPressed||(i.isGesturing||i.isHovered||i.isPressed)&&(this.ef=Date.now())},n.prototype.getType=function(){return"DScrollBar"},n}(hr),xd=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r=this;n.prototype.init.call(this,i);var e=new t.Point;this.Bi=new mr({bind:this,on:{start:function(){e.copyFrom(r.position)},move:function(t,n,i){e.set(e.x+n,e.y+i),r.onGestureMove(e.x,e.y)}}})},i.prototype.getMinimumLength=function(){return this.theme.getThumbMinimumLength()},i.prototype.getType=function(){return"DScrollBarThumb"},i}(hr),Bd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(0,o*(i-h),n,h),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),_d=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",t,this)},n.prototype.initReflowable=function(){new Bd(this)},n}(xd),Pd=function(t){function n(n){var i=t.call(this,n)||this;return i.ff.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.width;if(0<n){var i=this.rf-this.if,r=Math.min(1-i,Math.max(0,t/n));this.if!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.width;if(0<i){var r=this.rf-this.if,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.x/i-.5*r));this.if!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new _d(t)},n.prototype.updateThumb=function(t,n){var i=this.ff,r=Math.min(.5*t,i.getMinimumLength()),e=t-r,u=e*this.if,s=e*this.rf+r-u;i.position.set(u,0),i.resize(s,n)},n}(yd),Fd=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(o*(n-h),0,h,i),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",n,this)},n.prototype.initReflowable=function(){new Fd(this)},n}(xd),Gd=function(t){function n(n){var i=t.call(this,n)||this;return i.ff.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.height;if(0<n){var i=this.rf-this.if,r=Math.min(1-i,Math.max(0,t/n));this.if!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.height;if(0<i){var r=this.rf-this.if,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.y/i-.5*r));this.if!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Ud(t)},n.prototype.updateThumb=function(t,n){var i=this.ff,r=Math.min(.5*n,i.getMinimumLength()),e=n-r,u=e*this.if,s=e*this.rf+r-u;i.position.set(0,u),i.resize(t,s),i.updateTransform()},n}(yd),Hd=function(){function t(t,n,i){this.p=t,this.lf=i,this.st=0,this.vf=!1,this.vertical=new Gd(null==n?void 0:n.vertical),this.horizontal=new Pd(null==n?void 0:n.horizontal)}return t.prototype.lock=function(){this.st+=1,1===this.st&&(this.vf=!1,this.bf=void 0)},t.prototype.unlock=function(t){this.st-=1,0===this.st&&(t&&this.vf&&this.update(this.bf),this.vf=!1,this.bf=void 0)},t.prototype.update=function(t){if(0<this.st)return this.vf=!0,void(null!=t&&(this.bf||(this.bf=t)));var n=this.p,i=n.width,r=n.height,e=n.content,u=-e.x,s=-e.y,h=this.vertical,o=h.width,a=this.getOffsetVerticalStart(o),c=this.getOffsetVerticalEnd(o);h.set(s,s+r,e.height,t),h.position.set(i-o,a),h.height=r-a-c;var f=this.horizontal,l=f.height,v=this.getOffsetHorizontalStart(l),b=this.getOffsetHorizontalEnd(l);f.set(u,u+i,e.width,t),f.position.set(v,r-l),f.width=i-v-b,this.lf(h.isRegionVisible()||f.isRegionVisible())},t.prototype.touch=function(t){this.vertical.touch(t),this.horizontal.touch(t)},t.prototype.getOffsetHorizontalStart=function(t){return.5*t},t.prototype.getOffsetHorizontalEnd=function(t){return.5*t},t.prototype.getOffsetVerticalStart=function(t){return.5*t},t.prototype.getOffsetVerticalEnd=function(t){return.5*t},t}(),zd=function(n){function i(t){var i,r=this,e=(r=n.call(this,t)||this).theme;(null!==(i=null==t?void 0:t.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(r.mask=r.getOverflowMask()),r.addChild(r.content);var u=r.scrollbar;return r.addChild(u.vertical),r.addChild(u.horizontal),u.update(),r.initGesture(e,t),r}return _(i,n),i.prototype.initGesture=function(n,i){var r,e,u=this,s=Ai(null!==(e=null===(r=null==i?void 0:i.gesture)||void 0===r?void 0:r.mode)&&void 0!==e?e:n.getGestureMode(),fr);if(s===fr.ON||s===fr.TOUCH){var h=new t.Point,o=this.content;this.Bi=new mr({bind:this,touch:s===fr.TOUCH,on:{start:function(){h.copyFrom(o.position)},move:function(t,n,i){h.set(h.x+n,h.y+i),o.position.set(u.toContentX(o,h.x),u.toContentY(o,h.y))}}})}},Object.defineProperty(i.prototype,"scrollbar",{get:function(){var t,n=this.df;return null==n&&(n=this.newScrollBar(null===(t=this.zn)||void 0===t?void 0:t.scrollbar),this.initScrollBar(n),this.df=n),n},enumerable:!1,configurable:!0}),i.prototype.newScrollBar=function(t){var n=this;return new Hd(this,t,(function(t){n.onScrollBarUpdate(t)}))},i.prototype.onScrollBarUpdate=function(t){var n=this.dr;if(null!=n){var i=this.content;t?i.mask!==n&&(i.mask=n,st.update(this)):i.mask&&(i.mask=null,st.update(this))}},i.prototype.initScrollBar=function(t){var n=this;t.vertical.on("regionmove",(function(t){n.onScrollBarMoveY(t)})),t.horizontal.on("regionmove",(function(t){n.onScrollBarMoveX(t)}))},i.prototype.onScrollBarMoveX=function(t){var n=this.Bi;null!=n&&n.stop(this);var i=this.content;i.x=-i.width*t},i.prototype.onScrollBarMoveY=function(t){var n=this.Bi;null!=n&&n.stop(this);var i=this.content;i.y=-i.height*t},i.prototype.onOver=function(t){n.prototype.onOver.call(this,t),this.scrollbar.touch()},i.prototype.getType=function(){return"DPane"},Object.defineProperty(i.prototype,"content",{get:function(){var t=this.Nh;return null==t&&(t=this.toContent(this.zn),this.initContent(t),this.Nh=t),t},enumerable:!1,configurable:!0}),i.prototype.toContent=function(t){var n=null==t?void 0:t.content;return n?n instanceof hr?n:this.newContent(n):this.newContent()},i.prototype.newContent=function(t){return new Ld(t)},i.prototype.initContent=function(t){var n=this;t.on("move",(function(){n.onContentChange()})),t.on("resize",(function(){n.onContentChange()}))},i.prototype.getOverflowMask=function(){var t=this.dr;return null==t&&(t=new or(this),this.dr=t,this.reflowable.add(t),this.toDirty()),t},i.prototype.onWheel=function(t,n,i){var r=this.content,e=this.getWheelContentX(r,n.deltaX*n.lowest),u=this.getWheelContentY(r,n.deltaY*n.lowest);if(r.x!==e||r.y!==u){var s=this.Bi;return null!=s&&s.stop(this),r.position.set(e,u),!0}return!1},i.prototype.getWheelContentX=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentX(t,t.x-n*i)}return t.x},i.prototype.getWheelContentY=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentY(t,t.y+n*i)}return t.y},i.prototype.toContentX=function(t,n){return Math.min(0,Math.max(this.width-t.width,n))},i.prototype.toContentY=function(t,n){return Math.min(0,Math.max(this.height-t.height,n))},i.prototype.isRefitable=function(t){return n.prototype.isRefitable.call(this,t)&&!(t instanceof yd)},i.prototype.onResize=function(t,i,r,e){var u=this.scrollbar;u.lock(),n.prototype.onResize.call(this,t,i,r,e),u.update(),u.unlock(!0)},i.prototype.onContentChange=function(){this.scrollbar.update()},i.prototype.getFocusedChildClippingRect=function(t,n,i,r,e,u,s,h){return h.x=0,h.y=0,h.width=u,h.height=s,h},i.prototype.onChildFocus=function(r){var e=i.WORK_POINT||new t.Point;i.WORK_POINT=e;var u=this.content,s=u.x,h=u.y,o=u.width,a=u.height;e.set(0,0),r.toGlobal(e,e,!1),u.toLocal(e,void 0,e,!1);var c=s+Math.min(o,Math.max(0,e.x)),f=h+Math.min(a,Math.max(0,e.y));e.set(r.width,r.height),r.toGlobal(e,e,!0),u.toLocal(e,void 0,e,!0);var l=s+Math.min(o,Math.max(0,e.x)),v=h+Math.min(a,Math.max(0,e.y)),b=this.width,d=this.height,g=i.WORK_RECTANGLE||new t.Rectangle;i.WORK_RECTANGLE=g,this.getFocusedChildClippingRect(r,s,h,o,a,b,d,g);var m=g.x,w=g.y,p=m,O=w,D=m+g.width,E=w+g.height,M=null;c<p?l<=D&&(M=s+Math.min(p-c,D-l),M=Math.max(b-o,Math.min(0,M))):D<l&&(M=s-Math.min(c-p,l-D),M=Math.max(b-o,Math.min(0,M)));var S=null;f<O?v<=E&&(S=h+Math.min(O-f,E-v),S=Math.max(d-a,Math.min(0,S))):E<v&&(S=h-Math.min(f-O,v-E),S=Math.max(d-a,Math.min(0,S)));var T=u.position;null!=M?null!=S?T.set(M,S):T.x=M:null!=S&&(T.y=S),n.prototype.onChildFocus.call(this,r)},i.prototype.destroy=function(){var t=this.dr;null!=t&&(this.dr=null,t.destroy()),this.mask=null,n.prototype.destroy.call(this)},i}(hr),Vd=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.gf;return null==t&&(t=this.newUpdater(this.data,this.content,this.zn),this.gf=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new Ed(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Xt;return null==t&&(t=this.toData(this.zn),this.Xt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.items),i=null==t?void 0:t.selection;return null==n?i?new kd(this,{selection:i}):new kd(this):mt(n)?new kd(this,i?{items:n,selection:i}:{items:n}):"each"in n?n:i?(void 0===n.selection&&(n.selection=i),new kd(this,n)):new kd(this,n)},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!0),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DList"},n}(zd),Wd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUpdater=function(t,n,i){return new Md(t,n,n,null==i?void 0:i.updater)},n.prototype.getType=function(){return"DDialogSelectList"},n}(Vd),Xd=function(t){function n(n){var i=t.call(this)||this;return i.mf=n||function(t){return Promise.resolve([])},i.R=0,i.wf=0,i}return _(n,t),n.prototype.create=function(t){var n=this,i=++this.R;this.mf(t[0]).then((function(t){n.R===i&&(n.wf=i,n.emit("success",n,t),n.emit("change",n))}),(function(){n.R===i&&(n.wf=i,n.emit("fail",n),n.emit("change",n))})),this.emit("change",this)},n.prototype.isDone=function(){return this.R===this.wf},n}(t.utils.EventEmitter),Kd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputSearch"},n}(th),Yd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNote"},n}(Ts),Jd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmall"},n}(Yd),Zd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallError"},n}(Jd),qd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallNoItemsFound"},n}(Jd),Qd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallSearching"},n}(Jd),$d=function(t){function n(n,i){var r=t.call(this)||this;return r.ei=n,r.Ut=i.value,r.pf=i.filter,n.on("change",(function(){r.emit("change",r)})),n.on("success",(function(t,n){r.emit("success",r,r.toDismissable(n))})),n.on("fail",(function(){r.emit("fail",r)})),r}return _(n,t),n.prototype.toDismissValue=function(t){if(null!=t){var n=this.Ut;if(void 0!==n){var i=this.pf;if(null==i||i(n,t[0]))return n}}},n.prototype.toDismissable=function(t){var n=this.toDismissValue(this.Of);if(void 0===n)return t;for(var i=[],r=0,e=t.length;r<e;++r)i.push(t[r]);return i.push(n),i},n.prototype.create=function(t){this.Of=t,this.ei.create(t)},n.prototype.isDone=function(){return this.ei.isDone()},n}(t.utils.EventEmitter),tg=function(t){function n(n){var i=t.call(this,n)||this;i.Ut=null;var r=new Sb,e=i.search;return e.on("success",(function(t,n){0<n.length?r.hide():r.show(i.noteNoItemsFound),i.onSearched(n)})),e.on("fail",(function(){r.show(i.noteError),i.onSearched([])})),e.on("change",(function(){if(!e.isDone()){var t=i.noteSearching;t&&r.show(t)}})),i}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.inputLayout,this.list),r},Object.defineProperty(n.prototype,"inputLayout",{get:function(){var t=this.Ch;return null==t&&(t=this.newInputLayout(this.input,this.theme,this.zn),this.Ch=t),t},enumerable:!1,configurable:!0}),n.prototype.newInputLayout=function(t,n,i){return new Cs(this.toInputLayoutOptions(t,n,i))},n.prototype.toInputLayoutOptions=function(t,n,i){var r=this.toInputMargin(n,i);return{width:"padding",height:"auto",children:[new Ku({width:r}),t,new Ku({width:r})]}},Object.defineProperty(n.prototype,"input",{get:function(){var t=this.Ah;return null==t&&(t=this.newInput(),this.Ah=t),t},enumerable:!1,configurable:!0}),n.prototype.newInput=function(){var t=this,n=new Kd(this.toInputOptions(this.theme,this.zn));return n.on("input",(function(n){t.search.create([n])})),n},n.prototype.toInputOptions=function(t,n){var i=(null==n?void 0:n.input)||{};return void 0===i.width&&void 0===i.weight&&(i.weight=1),i},n.prototype.toInputMargin=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin)&&void 0!==r?r:t.getInputMargin()},Object.defineProperty(n.prototype,"list",{get:function(){var t=this.Un;return null==t&&(t=this.newList(),this.Un=t),t},enumerable:!1,configurable:!0}),n.prototype.newList=function(){var t=this,n=new Wd(this.toListOptions(this.theme,this.zn));return n.selection.on("change",(function(n){t.onListSelectionChange(n)})),n},n.prototype.onListSelectionChange=function(t){var n=t.first;if(null!=n){var i=this.zn;if(i){var r=i.dismiss;r&&n===r.value&&(n=null)}this.Ut=n,this.onOk(n)}},n.prototype.toListOptions=function(t,n){var i=(null==n?void 0:n.list)||{};return void 0===i.width&&(i.width="padding"),i},Object.defineProperty(n.prototype,"noteError",{get:function(){var t=this.Df;return null==t&&(t=this.newNoteError(),this.Df=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteError=function(){var t,n,i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.error;return null!==i?new Zd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteNoItemsFound",{get:function(){var t=this.Ef;return null==t&&(t=this.newNoteNoItemsFound(),this.Ef=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteNoItemsFound=function(){var t,n,i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.noItemsFound;return null!==i?new qd(this.toNoteOptions(this.list,i)):null},Object.defineProperty(n.prototype,"noteSearching",{get:function(){var t=this.Mf;return null==t&&(t=this.newNoteSearching(),this.Mf=t),t},enumerable:!1,configurable:!0}),n.prototype.newNoteSearching=function(){var t,n,i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.note)||void 0===n?void 0:n.searching;return null!=i?new Qd(this.toNoteOptions(this.list,i)):null},n.prototype.toNoteOptions=function(t,n){return null!=n?(null==n.parent&&(n.parent=t),null==n.visible&&(n.visible=!1),n):{parent:t,visible:!1}},Object.defineProperty(n.prototype,"search",{get:function(){var t=this.mf;return null==t&&(t=this.newSearch(),this.mf=t),t},enumerable:!1,configurable:!0}),n.prototype.newSearch=function(){var t=this.zn;if(t){var n=t.controller;if(n){var i=t.dismiss,r=n.search;return"create"in r?null!=i?new $d(r,i):r:null!=i?new $d(new Xd(r),i):new Xd(r)}}return new Xd},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),n.prototype.onSearched=function(t){this.list.data.items=t},n.prototype.getResolvedValue=function(){return this.Ut},n.prototype.getType=function(){return"DDialogSelect"},n.prototype.onOpen=function(){t.prototype.onOpen.call(this),this.list.selection.clear(),this.search.create([this.input.value])},n.prototype.onOk=function(n){this.emit("select",n,this),t.prototype.onOk.call(this,n)},n.prototype.destroy=function(){var n=this.Ah;n&&n.destroy();var i=this.Df;i&&i.destroy();var r=this.Ef;r&&(null==r||r.destroy());var e=this.Mf;e&&(null==e||e.destroy());var u=this.Un;u&&u.destroy(),t.prototype.destroy.call(this)},n}(xs),ng=function(t){return t.value},ig=function(){},rg=function(t){function n(n){var i,r,e=this;return(e=t.call(this,function(t){var n,i,r;if(t){var e,u=null===(n=t.text)||void 0===n?void 0:n.formatter;if(void 0!==u){if(!(e=t.dialog)||!("open"in e)){var s=(e=e||{}).item=e.item||{};void 0===(o=s.text=s.text||{}).formatter&&(o.formatter=u)}}else if(!(e=t.dialog)||!("open"in e)){var h=null===(r=null===(i=null==e?void 0:e.item)||void 0===i?void 0:i.text)||void 0===r?void 0:r.formatter;if(void 0!==h){var o=t.text||{};t.text=o,void 0===o.formatter&&(o.formatter=h)}}}return t}(n))||this).Sf=null!==(i=null==n?void 0:n.getter)&&void 0!==i?i:ng,e.Tf=null!==(r=null==n?void 0:n.setter)&&void 0!==r?r:ig,e}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.dialog,u=null!==(i=this.oh)&&void 0!==i?i:null;this.Tf(e,u),e.open(this).then((function(){var t=r.Sf(e);t!==u&&(r.text=t,r.emit("change",t,u,r))}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this._c;if(null==n){var i=null===(t=this.zn)||void 0===t?void 0:t.dialog;n=i&&"open"in i?i:new tg(i),this._c=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonSelect"},n}(Ns),eg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.oh)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.open(this).then((function(){e.onValueChange(s.new,s.current)}))},n.prototype.onValueChange=function(t,n){this.text=new Date(t.getTime()),this.emit("change",t,n,this)},n.prototype.getDatetimeMask=function(){var t,n,i=this.Pc;return null==i&&(i=ad.toMask(null===(n=null===(t=this.zn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Pc=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this._c;if(null==i){var r=null===(t=this.zn)||void 0===t?void 0:t.dialog;r?i=this.newDialog(r):(null==n.DIALOG&&(n.DIALOG=this.newDialog({mode:"MENU",sticky:!0})),i=n.DIALOG),this._c=i}return i},enumerable:!1,configurable:!0}),n.prototype.newDialog=function(t){return new Sh(t)},Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.oh)&&void 0!==t?t:new Date},set:function(t){var n=this.oh;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonTime"},n}(Ns),ug=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=yb.getCommandController();return r.isDisabled=!e.isUndoable(),e.on("change",(function(){r.isDisabled=!e.isUndoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),yb.getCommandController().undo()},n}(Ns),sg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DCanvas"},n}(hr),hg={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3},og=function(){function t(t){this.jf=t,this.hu=0}return Object.defineProperty(t.prototype,"shape",{get:function(){var t=this.Xr;return null==t&&(t=this.newShape(),this.Xr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShape=function(){var t,n=this.jf,i=n.bar,r=new en;return r.points.position=this.newShapePosition(),r.points.style=null!==(t=i.style)&&void 0!==t?t:z.NONE,r.stroke.copy(i.stroke),r.text.copy(n.label),r},t.prototype.newShapePosition=function(){switch(this.jf.position){case hg.LEFT:case hg.RIGHT:return it.TOP;default:return it.LEFT}},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.shape.attach(t.container)},t.prototype.unbind=function(){var t=this.Xr;null!=t&&t.detach(),this.hu=0,this.Kc=void 0},t.prototype.update=function(){var t=this.Kc,n=this.hu,i=this.Xr;if(null!=i&&null!=t){var r=t.plotArea,e=r.width,u=r.height,s=this.jf.padding*n;i.disallowUploadedUpdate();var h=i.transform.position,o=i.size;switch(this.jf.position){case hg.TOP:h.set(.5*e,0-s),o.set(e,0);break;case hg.BOTTOM:h.set(.5*e,u+s),o.set(e,0);break;case hg.LEFT:h.set(0-s,.5*u),o.set(0,u);break;case hg.RIGHT:h.set(e+s,.5*u),o.set(0,u)}return i.allowUploadedUpdate(),!0}return!1},t.prototype.destroy=function(){var t=this.Xr;null!=t&&t.destroy(),this.hu=0,this.Kc=void 0},t}(),ag=function(){function t(t){this.Nf=t,this.hu=0,this.Un=[]}return t.prototype.add=function(t){this.Un.push(t);var n=this.Kc,i=this.hu;return null!=n&&t.bind(n,i,this.Nf),this},t.prototype.get=function(t){var n=this.Un;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Un.indexOf(t)},t.prototype.clear=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Un.length},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n;for(var i=this.Nf,r=this.Un,e=0,u=r.length;e<u;++e)r[e].bind(t,n,i)},t.prototype.unbind=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].unbind();this.hu=0,this.Kc=void 0},t.prototype.update=function(){for(var t=!1,n=this.Un,i=0,r=n.length;i<r;++i)n[i].update()&&(t=!0);return t},t.prototype.destroy=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].destroy();this.hu=0,this.Kc=void 0},t}(),cg={INSIDE:0,OUTSIDE:1},fg=function(){function t(t,n){var i,r;this.coordinate=null!==(i=null==n?void 0:n.coordinate)&&void 0!==i?i:0,this.position=this.toPosition(t,n),this.tick=this.toTick(t,n),this.label=this.toLabel(t,n),this.padding=null!==(r=null==n?void 0:n.padding)&&void 0!==r?r:t.getPadding(),this.bar=this.toBar(t,n),this.guide=this.toGuide(t,n)}return t.prototype.toPosition=function(t,n){var i=null==n?void 0:n.position;return Ot(i)?hg[i]:null!=i?i:t.getPosition()},t.prototype.toGuide=function(t,n){var i,r;return{list:null!==(r=null===(i=null==n?void 0:n.guide)||void 0===i?void 0:i.list)&&void 0!==r?r:[]}},t.prototype.toBar=function(t,n){var i;return{style:null!==(i=null==n?void 0:n.style)&&void 0!==i?i:t.getStyle(),stroke:this.toBarStroke(t,null==n?void 0:n.stroke)}},t.prototype.toTick=function(t,n){var i,r=null==n?void 0:n.tick;return{enable:null!==(i=null==r?void 0:r.enable)&&void 0!==i?i:t.getTickEnable(),major:this.toTickMajor(t,r),minor:this.toTickMinor(t,r)}},t.prototype.toTickMajor=function(t,n){var i,r,e,u,s,h,o,a,c=null==n?void 0:n.major,f=null!==(r=null!==(i=null==c?void 0:c.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMajorTickPosition(),l=null==n?void 0:n.style,v=zv.from(null!==(u=null!==(e=null==c?void 0:c.style)&&void 0!==e?e:l)&&void 0!==u?u:t.getMajorTickStyle()),b=null==n?void 0:n.stroke,d=this.toTickMajorStroke(t,null==c?void 0:c.stroke,b),g=null!==(s=null==c?void 0:c.count)&&void 0!==s?s:t.getMajorTickCount();return{count:g,capacity:null!==(h=null==c?void 0:c.capacity)&&void 0!==h?h:t.getMajorTickCapacity(g),step:null!==(o=null==c?void 0:c.step)&&void 0!==o?o:t.getMajorTickStep(),size:null!==(a=null==c?void 0:c.size)&&void 0!==a?a:t.getMajorTickSize(),position:this.toTickPosition(f),style:v,stroke:d,text:this.toTickMajorText(t,null==c?void 0:c.text),formatter:this.toTickMajorFormatter(t,c),gridline:this.toTickMajorGridline(t,null==c?void 0:c.gridline,l,b)}},t.prototype.toTickMajorGridline=function(t,n,i,r){var e,u,s,h=zv.from(null!==(u=null!==(e=null==n?void 0:n.style)&&void 0!==e?e:i)&&void 0!==u?u:t.getMajorTickGridlineStyle());return{enable:null!==(s=null==n?void 0:n.enable)&&void 0!==s?s:t.getMajorTickGridlineEnable(),style:h,stroke:this.toTickMajorGridlineStroke(t,null==n?void 0:n.stroke,r)}},t.prototype.toTickPosition=function(t){var n=this.position;if(t===cg.OUTSIDE||"OUTSIDE"===t)switch(n){case hg.TOP:return it.BOTTOM;case hg.BOTTOM:return it.TOP;case hg.LEFT:return it.RIGHT;case hg.RIGHT:return it.LEFT;default:return it.TOP}else switch(n){case hg.TOP:return it.TOP;case hg.BOTTOM:return it.BOTTOM;case hg.LEFT:return it.LEFT;case hg.RIGHT:return it.RIGHT;default:return it.TOP}},t.prototype.toTickMinor=function(t,n){var i,r,e,u,s,h,o,a=null==n?void 0:n.minor,c=null!==(r=null!==(i=null==a?void 0:a.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMinorTickPosition(),f=zv.from(null!==(u=null!==(e=null==a?void 0:a.style)&&void 0!==e?e:null==n?void 0:n.style)&&void 0!==u?u:t.getMinorTickStyle());return{count:null!==(s=null==a?void 0:a.count)&&void 0!==s?s:t.getMinorTickCount(),step:null!==(h=null==a?void 0:a.step)&&void 0!==h?h:t.getMinorTickStep(),size:null!==(o=null==a?void 0:a.size)&&void 0!==o?o:t.getMinorTickSize(),position:this.toTickPosition(c),style:f,stroke:this.toTickMinorStroke(t,null==a?void 0:a.stroke,null==n?void 0:n.stroke),text:this.toTickMinorText(t,null==a?void 0:a.text),formatter:this.toTickMinorFormatter(t,a)}},t.prototype.toBarStroke=function(t,n){return this.toStroke(n,void 0,t.getStrokeEnable(),t.getStrokeColor(),t.getStrokeAlpha(),t.getStrokeWidth(),t.getStrokeAlign(),t.getStrokeSide(),t.getStrokeStyle())},t.prototype.toTickMajorStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickStrokeEnable(),t.getMajorTickStrokeColor(),t.getMajorTickStrokeAlpha(),t.getMajorTickStrokeWidth(),t.getMajorTickStrokeAlign(),t.getMajorTickStrokeSide(),t.getMajorTickStrokeStyle())},t.prototype.toTickMajorGridlineStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickGridlineStrokeEnable(),t.getMajorTickGridlineStrokeColor(),t.getMajorTickGridlineStrokeAlpha(),t.getMajorTickGridlineStrokeWidth(),t.getMajorTickGridlineStrokeAlign(),t.getMajorTickGridlineStrokeSide(),t.getMajorTickGridlineStrokeStyle())},t.prototype.toTickMinorStroke=function(t,n,i){return this.toStroke(n,i,t.getMinorTickStrokeEnable(),t.getMinorTickStrokeColor(),t.getMinorTickStrokeAlpha(),t.getMinorTickStrokeWidth(),t.getMinorTickStrokeAlign(),t.getMinorTickStrokeSide(),t.getMinorTickStrokeStyle())},t.prototype.toStroke=function(t,n,i,r,e,u,s,h,o){var a,c,f,l,v,b,d,g,m,w,p,O,D,E,M,S,T,j,N,I,C,A,R,k,L,y,x,B;return t?n?{enable:null!==(c=null!==(a=t.enable)&&void 0!==a?a:n.enable)&&void 0!==c?c:i,color:null!==(l=null!==(f=t.color)&&void 0!==f?f:n.color)&&void 0!==l?l:r,alpha:null!==(b=null!==(v=t.alpha)&&void 0!==v?v:n.alpha)&&void 0!==b?b:e,width:null!==(g=null!==(d=t.width)&&void 0!==d?d:n.width)&&void 0!==g?g:u,align:null!==(w=null!==(m=t.align)&&void 0!==m?m:n.align)&&void 0!==w?w:s,side:null!==(O=null!==(p=t.side)&&void 0!==p?p:n.side)&&void 0!==O?O:h,style:this.toStrokeStyle(null!==(E=null!==(D=t.style)&&void 0!==D?D:n.style)&&void 0!==E?E:o)}:{enable:null!==(M=t.enable)&&void 0!==M?M:i,color:null!==(S=t.color)&&void 0!==S?S:r,alpha:null!==(T=t.alpha)&&void 0!==T?T:e,width:null!==(j=t.width)&&void 0!==j?j:u,align:null!==(N=t.align)&&void 0!==N?N:s,side:null!==(I=t.side)&&void 0!==I?I:h,style:this.toStrokeStyle(null!==(C=t.style)&&void 0!==C?C:o)}:n?{enable:null!==(A=n.enable)&&void 0!==A?A:i,color:null!==(R=n.color)&&void 0!==R?R:r,alpha:null!==(k=n.alpha)&&void 0!==k?k:e,width:null!==(L=n.width)&&void 0!==L?L:u,align:null!==(y=n.align)&&void 0!==y?y:s,side:null!==(x=n.side)&&void 0!==x?x:h,style:this.toStrokeStyle(null!==(B=n.style)&&void 0!==B?B:o)}:{enable:i,color:r,alpha:e,width:u,align:s,side:h,style:o}},t.prototype.toStrokeStyle=function(t){if(Ot(t))return s[t];if(mt(t)){for(var n=s.NONE,i=0,r=t.length;i<r;++i)n|=s[t[i]];return n}return t},t.prototype.toTickMajorFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null===r)return;if(null!=r)return Mi.create(r);var e=i.formatter;if(e)return{format:e}}var u=t.getMajorTickTextFormat();if(null!=u)return Mi.create(u)},t.prototype.toTickMajorText=function(t,n){return{format:(n=n||{}).format,color:this.toTickMajorTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:Ai(n.weight,d),align:this.toTickMajorTextAlign(t,n.align),offset:this.toTickMajorTextOffset(t,n.offset),style:Ai(n.style,g),outline:this.toTickMajorTextOutline(t,n.outline),spacing:this.toTickMajorTextSpacing(t,n.spacing),direction:this.toTickMajorTextDirection(t,n.direction),padding:this.toTickMajorTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toTickMajorTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toTickMajorTextAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextAlignVertical(e)}},t.prototype.toTickMajorTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMajorTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMajorTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextPaddingVertical()}},t.prototype.toTickMajorTextDirection=function(t,n){return Ai(null!=n?n:t.getMajorTickTextDirection(),p)},t.prototype.toTickMajorTextColor=function(t,n){return null!=n?n:t.getMajorTickTextColor()},t.prototype.toTickMinorFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null===r)return;if(null!=r)return Mi.create(r);var e=i.formatter;if(e)return{format:e}}var u=t.getMinorTickTextFormat();if(null!=u)return Mi.create(u)},t.prototype.toTickMinorText=function(t,n){return{format:(n=n||{}).format,color:this.toTickMinorTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:Ai(n.weight,d),align:this.toTickMinorTextAlign(t,n.align),offset:this.toTickMinorTextOffset(t,n.offset),style:Ai(n.style,g),outline:this.toTickMinorTextOutline(t,n.outline),spacing:this.toTickMinorTextSpacing(t,n.spacing),direction:this.toTickMinorTextDirection(t,n.direction),padding:this.toTickMinorTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toTickMinorTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toTickMinorTextAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMinorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMinorTickTextAlignVertical(e)}},t.prototype.toTickMinorTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMinorTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toTickMinorTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMinorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMinorTickTextPaddingVertical()}},t.prototype.toTickMinorTextDirection=function(t,n){return Ai(null!=n?n:t.getMinorTickTextDirection(),p)},t.prototype.toTickMinorTextColor=function(t,n){return null!=n?n:t.getMinorTickTextColor()},t.prototype.toLabel=function(t,n){var i=null==n?void 0:n.label;if(i)return{value:i.value,color:this.toLabelColor(t,i.color),alpha:i.alpha,family:i.family,size:i.size,weight:Ai(i.weight,d),align:this.toLabelAlign(t,i.align),offset:this.toLabelOffset(t,i.offset),style:Ai(i.style,g),outline:this.toLabelOutline(t,i.outline),spacing:this.toLabelSpacing(t,i.spacing),direction:this.toLabelDirection(t,i.direction),padding:this.toLabelPadding(t,i.padding),clipping:i.clipping}},t.prototype.toLabelOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toLabelAlign=function(t,n){var i,r,e=this.position;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelAlignVertical(e)}},t.prototype.toLabelOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelPaddingVertical()}},t.prototype.toLabelDirection=function(t,n){return Ai(null!=n?n:t.getLabelDirection(),p)},t.prototype.toLabelColor=function(t,n){return null!=n?n:t.getLabelColor()},t}(),lg=function(){function t(t){this.jf=t,this.hu=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Hr;return null==t&&(t=this.newShapes(),this.Hr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.jf.tick,r=i.major,e=r.gridline;if(i.enable&&e.enable)for(var u=r.capacity,s=null!==(t=e.style)&&void 0!==t?t:z.NONE,h=this.newShapePosition(),o=0;o<u;++o){var a=new en;a.points.position=h,a.points.style=s,a.stroke.copy(e.stroke),n.push(a)}return n},t.prototype.newShapePosition=function(){switch(this.jf.position){case hg.LEFT:case hg.RIGHT:return it.LEFT;default:return it.TOP}},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.hu=0,this.Kc=void 0},t.prototype.destroy=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.hu=0,this.Kc=void 0},t}(),vg=function(){function t(t){this.jf=t,this.hu=0,this.If=new lg(t)}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Hr;return null==t&&(t=this.newShapes(),this.Hr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.jf.tick;if(i.enable)for(var r=i.major,e=r.capacity,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:z.NONE,o=0;o<e;++o){var a=new en;a.points.position=s,a.points.size=u,a.points.style=h,a.stroke.copy(r.stroke),a.text.copy(r.text),a.size.set(0,0),n.push(a)}return n},Object.defineProperty(t.prototype,"gridline",{get:function(){return this.If},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.If.bind(t,n);for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.If.unbind(),this.hu=0,this.Kc=void 0},t.prototype.destroy=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.If.destroy(),this.hu=0,this.Kc=void 0},t}(),bg=function(){function t(t){this.jf=t,this.hu=0}return Object.defineProperty(t.prototype,"shapes",{get:function(){var t=this.Hr;return null==t&&(t=this.newShapes(),this.Hr=t),t},enumerable:!1,configurable:!0}),t.prototype.newShapes=function(){var t,n=[],i=this.jf.tick;if(i.enable)for(var r=i.minor,e=r.count,u=r.size,s=r.position,h=null!==(t=r.style)&&void 0!==t?t:z.NONE,o=0,a=(i.major.capacity+1)*e;o<a;++o){var c=new en;c.points.position=s,c.points.size=u,c.points.style=h,c.stroke.copy(r.stroke),c.text.copy(r.text),c.size.set(0,0),n.push(c)}return n},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n;for(var i=this.shapes,r=t.container,e=0,u=i.length;e<u;++e)i[e].attach(r)},t.prototype.unbind=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].detach();this.hu=0,this.Kc=void 0},t.prototype.destroy=function(){var t=this.Hr;if(null!=t)for(var n=0,i=t.length;n<i;++n)t[n].destroy();this.hu=0,this.Kc=void 0},t}(),dg=function(){function t(t,n){this.from=t,this.to=n}return t.prototype.set=function(t,n){return null!=t&&(this.from=t),null!=n&&(this.to=n),this},t.prototype.add=function(t,n){return Th(t)||(this.from=Th(this.from)?t:Math.min(this.from,t)),Th(n)||(this.to=Th(this.to)?n:Math.max(this.to,n)),this},t.prototype.clear=function(){return this.from=NaN,this.to=NaN,this},t}(),gg=function(){function t(t,n){this.jf=t,this.hu=0,this.Cf=this.newMajor(t,n),this.Af=this.newMinor(t,n),this.Rf=[],this.kf=[],this.Mu=new dg(0,0)}return Object.defineProperty(t.prototype,"major",{get:function(){return this.Cf},enumerable:!1,configurable:!0}),t.prototype.newMajor=function(t,n){return new vg(t)},Object.defineProperty(t.prototype,"minor",{get:function(){return this.Af},enumerable:!1,configurable:!0}),t.prototype.newMinor=function(t,n){return new bg(t)},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.Cf.bind(t,n),this.Af.bind(t,n)},t.prototype.unbind=function(){this.Af.unbind(),this.Cf.unbind(),this.hu=0,this.Kc=void 0},t.prototype.update=function(){var t=this.Kc,n=this.Cf.shapes,i=this.Af.shapes;if(null!=t&&n&&i){var r=t.plotArea,e=r.container.transform.localTransform,u=this.Cf.gridline.shapes,s=this.jf,h=s.padding*this.hu,o=this.Mu,a=void 0;switch(s.position){case hg.TOP:if(a=r.coordinate.x.get(s.coordinate)){var c=(d=this.getDomain(r,a,o)).from,f=d.to,l=(g=this.getDomainVisible(r,a,o)).from,v=g.to,b=r.height;return this.updateX(c,f,l,v,a,n,i,u,0-h,e,b)}break;case hg.BOTTOM:var d,g;if(a=r.coordinate.x.get(s.coordinate))return c=(d=this.getDomain(r,a,o)).from,f=d.to,l=(g=this.getDomainVisible(r,a,o)).from,v=g.to,b=r.height,this.updateX(c,f,l,v,a,n,i,u,b+h,e,b);break;case hg.LEFT:if(a=r.coordinate.y.get(s.coordinate)){var m=(E=this.getRange(r,a,o)).from,w=E.to,p=(M=this.getRangeVisible(r,a,o)).from,O=M.to,D=r.width;return this.updateY(m,w,p,O,a,n,i,u,0-h,e,D)}break;case hg.RIGHT:var E,M;if(a=r.coordinate.y.get(s.coordinate))return m=(E=this.getRange(r,a,o)).from,w=E.to,p=(M=this.getRangeVisible(r,a,o)).from,O=M.to,D=r.width,this.updateY(m,w,p,O,a,n,i,u,D+h,e,D)}}return!1},t.prototype.getDomain=function(t,n,i){var r=t.getBoundsInContainer(),e=n.transform;return i.set(n.unmap(e.unmap(r.x)),n.unmap(e.unmap(r.x+r.width)))},t.prototype.getDomainVisible=function(t,n,i){return i},t.prototype.getRange=function(t,n,i){var r=t.getBoundsInContainer(),e=n.transform;return i.set(n.unmap(e.unmap(r.y)),n.unmap(e.unmap(r.y+r.height)))},t.prototype.getRangeVisible=function(t,n,i){return i},t.prototype.updateX=function(t,n,i,r,e,u,s,h,o,a,c){var f=this.jf.tick,l=f.major,v=l.count,b=l.capacity,d=l.step,g=l.formatter,m=f.minor,w=m.count,p=(b+1)*w,O=m.step,D=m.formatter,E=this.Rf,M=this.kf;this.newTicks(e,t,n,i,r,v,b,d,w,p,O,E,M);for(var S=a.a,T=a.tx,j=0;j<b;++j){var N=u[j],I=3*j,C=E[I+0];if(isNaN(C))this.hideMajor(N),j<h.length&&this.hideMajorGridline(h[j]);else{var A=S*E[I+1]+T,R=E[I+2];this.showMajor(N,A,o,null==g?void 0:g.format(C,R)),j<h.length&&this.showMajorGridline(h[j],C,A,.5*c,0,c)}}for(j=0;j<p;++j){var k=s[j],L=3*j,y=M[L+0];if(isNaN(y))this.hideMinor(k);else{var x=S*M[L+1]+T,B=M[L+2];this.showMinor(k,x,o,null==D?void 0:D.format(y,B))}}return!0},t.prototype.updateY=function(t,n,i,r,e,u,s,h,o,a,c){var f=this.jf.tick,l=f.major,v=l.count,b=l.capacity,d=l.step,g=l.formatter,m=f.minor,w=m.count,p=(b+1)*w,O=m.step,D=m.formatter,E=this.Rf,M=this.kf;this.newTicks(e,t,n,i,r,v,b,d,w,p,O,E,M);for(var S=a.d,T=a.ty,j=0;j<b;++j){var N=u[j],I=3*j,C=E[I+0];if(isNaN(C))this.hideMajor(N),j<h.length&&this.hideMajorGridline(h[j]);else{var A=S*E[I+1]+T,R=E[I+2];this.showMajor(N,o,A,null==g?void 0:g.format(C,R)),j<h.length&&this.showMajorGridline(h[j],C,.5*c,A,c,0)}}for(j=0;j<p;++j){var k=s[j],L=3*j,y=M[L+0];if(isNaN(y))this.hideMinor(k);else{var x=S*M[L+1]+T,B=M[L+2];this.showMinor(k,o,x,null==D?void 0:D.format(y,B))}}return!0},t.prototype.showMajor=function(t,n,i,r){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(n,i),t.text.value=null!=r?r:"",t.allowUploadedUpdate()},t.prototype.showMajorGridline=function(t,n,i,r,e,u){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(i,r),t.size.set(e,u),t.allowUploadedUpdate()},t.prototype.hideMajor=function(t){t.visible=!1},t.prototype.hideMajorGridline=function(t){t.visible=!1},t.prototype.showMinor=function(t,n,i,r){t.disallowUploadedUpdate(),t.visible=!0,t.transform.position.set(n,i),t.text.value=null!=r?r:"",t.allowUploadedUpdate()},t.prototype.hideMinor=function(t){t.visible=!1},t.prototype.newTicks=function(t,n,i,r,e,u,s,h,o,a,c,f,l){t.ticks(n,i,r,e,u,s,h,o,a,c,f,l)},t.prototype.destroy=function(){this.Cf.destroy(),this.Af.destroy(),this.hu=0,this.Kc=void 0},t}(),mg=function(){function t(t){var n=this.toTheme(t);this.cn=n;var i=this.newParser(n,t);this.jf=i,this.hu=0,this.Lf=this.newBar(i,n,t),this.yf=this.newTick(i,n,t),this.xf=this.newGuide(i,n,t)}return t.prototype.newParser=function(t,n){return new fg(t,n)},Object.defineProperty(t.prototype,"position",{get:function(){return this.jf.position},set:function(t){this.jf.position=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"coordinate",{get:function(){return this.jf.coordinate},set:function(t){this.jf.coordinate=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this.jf.padding},set:function(t){this.jf.padding=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bar",{get:function(){return this.Lf},enumerable:!1,configurable:!0}),t.prototype.newBar=function(t,n,i){return new og(t)},Object.defineProperty(t.prototype,"tick",{get:function(){return this.yf},enumerable:!1,configurable:!0}),t.prototype.newTick=function(t,n,i){return new gg(t)},Object.defineProperty(t.prototype,"guide",{get:function(){return this.xf},enumerable:!1,configurable:!0}),t.prototype.newGuide=function(t,n,i){for(var r=new ag(this),e=t.guide.list,u=0,s=e.length;u<s;++u)r.add(e[u]);return r},t.prototype.bind=function(t,n){this.Kc=t,this.hu=n,this.Lf.bind(t,n),this.yf.bind(t,n),this.xf.bind(t,n)},t.prototype.unbind=function(){this.xf.unbind(),this.yf.unbind(),this.Lf.unbind(),this.hu=0,this.Kc=void 0},t.prototype.update=function(){var t=this.Lf.update(),n=this.yf.update(),i=this.xf.update();if(t||n||i){var r=this.Kc;r&&st.update(r.plotArea)}},t.prototype.onRender=function(){this.Lf.update(),this.yf.update(),this.xf.update()},t.prototype.destroy=function(){this.Lf.destroy(),this.yf.destroy(),this.xf.destroy(),this.Kc=void 0},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartAxisBase"},t}(),wg=function(){function t(t,n){this.Bf=t,this.Kc=new xe,this.Un=new Map}return Object.defineProperty(t.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Bf},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var n=this.Un,i=n.get(t.position);null==i&&(i=[],n.set(t.position,i)),i.push(t),t.bind(this,i.length-1)},t.prototype.get=function(t,n){var i=this.Un.get(Ai(t,hg));return i&&0<=n&&n<i.length?i[n]:null},t.prototype.indexOf=function(t){var n=this.Un.get(t.position);return n?n.indexOf(t):-1},t.prototype.clear=function(t){var n=this.Un.get(Ai(t,hg));if(n){for(var i=0,r=n.length;i<r;++i)n[i].destroy();n.length=0}return this},t.prototype.size=function(t){var n=this.Un.get(Ai(t,hg));return n?n.length:0},t.prototype.update=function(){this.Un.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].update()}))},t.prototype.onRender=function(){this.Un.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].onRender()}))},t.prototype.destroy=function(){this.Un.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].destroy();t.length=0}))},t}(),pg=function(){function t(t){this.zn=t}return Object.defineProperty(t.prototype,"bar",{get:function(){var t=this.Lf;return void 0===t&&(t=this.newBar(),this.Lf=t),t},enumerable:!1,configurable:!0}),t.prototype.newBar=function(){var t,n,i=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.bar)&&void 0!==n?n:{};if(!1!==i.enable){var r=new en;return r.stroke.copy(this.toStrokeOptions(i.stroke,s.DASHED)),r.text.copy(this.toTextOptions(i.text)),r}return null},t.prototype.toStrokeOptions=function(t,n){var i;return{enable:(t=t||{}).enable,color:t.color,alpha:t.alpha,width:t.width,align:t.align,side:Ai(t.side,qt),style:Ai(null!==(i=t.style)&&void 0!==i?i:n,s)}},t.prototype.toTextOptions=function(t){return{value:(t=t||{}).value,color:t.color,alpha:t.alpha,family:t.family,size:t.size,weight:Ai(t.weight,d),align:this.toTextAlignOptions(t.align),offset:t.offset,style:Ai(t.style,g),outline:t.outline,spacing:t.spacing,direction:Ai(t.direction,p),padding:t.padding,clipping:t.clipping,fitting:t.fitting}},t.prototype.toTextAlignOptions=function(t){return{horizontal:Ai(null==(t=t||{})?void 0:t.horizontal,m),vertical:Ai(null==t?void 0:t.vertical,w)}},t.prototype.toBarPosition=function(t){switch(t.position){case hg.LEFT:case hg.RIGHT:return it.LEFT;default:return it.TOP}},Object.defineProperty(t.prototype,"label",{get:function(){var t=this.Yh;return void 0===t&&(t=this.newLabel(),this.Yh=t),t},enumerable:!1,configurable:!0}),t.prototype.newLabel=function(){var t,n,i,r,e=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.label)&&void 0!==n?n:{};if(!0===e.enable){var u=new Fo;return u.stroke.copy(this.toStrokeOptions(e.stroke)),u.fill.copy(e.fill),u.text.copy(this.toTextOptions(e.text)),u.size.set(null!==(i=e.width)&&void 0!==i?i:50,null!==(r=e.height)&&void 0!==r?r:30),u}return null},Object.defineProperty(t.prototype,"labelMargin",{get:function(){var t=this._f;return null==t&&(t=this.newLabelMargin(),this._f=t),t},enumerable:!1,configurable:!0}),t.prototype.newLabelMargin=function(){var t=this.zn;if(null!=t){var n=t.label;if(null!=n){var i=n.margin;if(null!=i)return i}}return 10},Object.defineProperty(t.prototype,"tick",{get:function(){var t=this.yf;return void 0===t&&(t=this.newTick(),this.yf=t),t},enumerable:!1,configurable:!0}),t.prototype.newTick=function(){var t,n,i,r=null!==(n=null===(t=this.zn)||void 0===t?void 0:t.tick)&&void 0!==n?n:{};if(!0===r.enable){var e=new en;e.stroke.copy(this.toStrokeOptions(r.stroke)),e.text.copy(this.toTextOptions(r.text));var u=null!==(i=r.size)&&void 0!==i?i:5;return e.size.set(u,u),e}return null},Object.defineProperty(t.prototype,"tickMargin",{get:function(){var t=this.Pf;return null==t&&(t=this.newTickMargin(),this.Pf=t),t},enumerable:!1,configurable:!0}),t.prototype.newTickMargin=function(){var t=this.zn;if(null!=t){var n=t.tick;if(null!=n){var i=n.margin;if(null!=i)return i}}return 0},t.prototype.toTickPosition=function(t){switch(t.position){case hg.LEFT:case hg.RIGHT:return it.LEFT;default:return it.TOP}},t.prototype.bind=function(t,n,i){var r=this.bar;null!=r&&(r.points.position=this.toBarPosition(i),r.attach(t.container));var e=this.label;null!=e&&e.attach(t.container);var u=this.tick;null!=u&&(u.points.position=this.toTickPosition(i),u.attach(t.container))},t.prototype.unbind=function(){var t=this.Lf;null!=t&&t.detach();var n=this.Yh;null!=n&&n.detach();var i=this.yf;null!=i&&i.detach()},t.prototype.update=function(t,n,i,r,e,u,s){var h=this.Lf;if(null!=h){switch(h.disallowUploadedUpdate(),t){case hg.TOP:case hg.BOTTOM:h.transform.position.set(n,i),h.size.set(0,u),h.visible=r;break;case hg.LEFT:case hg.RIGHT:h.transform.position.set(n,i),h.size.set(e,0),h.visible=r}h.allowUploadedUpdate()}var o=this.Yh;if(null!=o){var a=this.labelMargin,c=s+.5*(v=o.size).x+a,f=s+.5*v.y+a;switch(o.disallowUploadedUpdate(),t){case hg.TOP:o.transform.position.set(n,-f),o.visible=r;break;case hg.BOTTOM:o.transform.position.set(n,u+f),o.visible=r;break;case hg.LEFT:o.transform.position.set(-c,i),o.visible=r;break;case hg.RIGHT:o.transform.position.set(e+c,i),o.visible=r}o.allowUploadedUpdate()}var l=this.yf;if(null!=l){var v;switch(a=this.tickMargin,c=s+.5*(v=l.size).x+a,f=s+.5*v.y+a,l.disallowUploadedUpdate(),t){case hg.TOP:l.transform.position.set(n,-f),l.visible=r;break;case hg.BOTTOM:l.transform.position.set(n,u+f),l.visible=r;break;case hg.LEFT:l.transform.position.set(-c,i),l.visible=r;break;case hg.RIGHT:l.transform.position.set(e+c,i),l.visible=r}l.allowUploadedUpdate()}return!0},t.prototype.destroy=function(){var t=this.Lf;null!=t&&t.destroy();var n=this.Yh;null!=n&&n.destroy();var i=this.yf;null!=i&&i.destroy()},t}(),Og=function(){function n(n){var i;this.zn=n,this.hu=0,this._=null!==(i=null==n?void 0:n.position)&&void 0!==i?i:0,this.Mu=new t.Point,this.Ff=!0}return Object.defineProperty(n.prototype,"shape",{get:function(){var t=this.Xr;return null==t&&(t=this.newShape(),this.Xr=t),t},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){return new pg(this.zn)},Object.defineProperty(n.prototype,"position",{get:function(){return this._},set:function(t){this._=t},enumerable:!1,configurable:!0}),n.prototype.show=function(){return this.Ff=!0,this},n.prototype.isShown=function(){return this.Ff},n.prototype.hide=function(){return this.Ff=!1,this},n.prototype.isHidden=function(){return!this.Ff},n.prototype.bind=function(t,n,i){this.Kc=t,this.hu=n,this.Nf=i,this.shape.bind(t,n,i)},n.prototype.unbind=function(){var t=this.Xr;null!=t&&t.unbind(),this.Nf=void 0,this.hu=0,this.Kc=void 0},n.prototype.update=function(){var t=this.Kc,n=this.hu,i=this.Xr,r=this.Nf;if(null!=i&&null!=t&&null!=r){var e=t.plotArea,u=e.container.transform.localTransform,s=e.width,h=e.height,o=r.padding*n;switch(r.position){case hg.TOP:case hg.BOTTOM:var a=e.coordinate.x.get(r.coordinate);if(a){(l=this.Mu).set(a.transform.map(a.map(this._)),0),u.apply(l,l);var c=l.x;i.update(r.position,c,.5*h,this.Ff&&0<=c&&c<=s,s,h,o)}else i.update(r.position,0,.5*h,!1,s,h,o);break;case hg.LEFT:case hg.RIGHT:var f=e.coordinate.y.get(r.coordinate);if(f){var l;(l=this.Mu).set(0,f.transform.map(f.map(this._))),u.apply(l,l);var v=l.y;i.update(r.position,.5*s,v,this.Ff&&0<=v&&v<=h,s,h,o)}else i.update(r.position,.5*s,0,!1,s,h,o)}return!0}return!1},n.prototype.destroy=function(){var t=this.Xr;null!=t&&t.destroy(),this.hu=0,this.Kc=void 0},n}(),Dg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisX"},n}(mg),Eg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisXDatetime"},n}(Dg),Mg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisY"},n}(mg),Sg=[1095651,16667680,15778578,1858929],Tg=[Sg[0],an.brighten(Sg[0],.4),Sg[1],an.brighten(Sg[1],.4),Sg[2],an.brighten(Sg[2],.4),Sg[3],an.brighten(Sg[3],.4)],jg=function(t){return Tg[t%Tg.length]},Ng={X:0,Y:1},Ig=function(){function t(t){this.cn=this.toTheme(t),this.R=0,this.Uf=null==t?void 0:t.translation,this.Gf=0,this.Hf=null==t?void 0:t.scaling,this.Gn=1,this.zf=0,this.Vf=1}return Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translate",{get:function(){return this.Gf},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this.Gn},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.set(0,n===Ng.X?1:-1)},t.prototype.unbind=function(){},t.prototype.set=function(t,n){var i=!1;null!=t&&!1!==this.Uf&&this.Gf!==t&&(i=!0,this.Gf=t),null!=n&&!1!==this.Hf&&this.Gn!==n&&(i=!0,this.Gn=n),i&&(this.R+=1,this.Vf=this.cn.isZero(this.Gn)?0:1/this.Gn,this.zf=-this.Gf*this.Vf)},t.prototype.blend=function(t,n){var i=1-t,r=n.newTranslate*t+n.oldTranslate*i,e=n.newScale*t+n.oldScale*i;this.set(r,e)},t.prototype.map=function(t){return this.Gf+this.Gn*t},t.prototype.mapAll=function(t,n,i,r,e){for(var u=this.Gf,s=this.Gn,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.unmap=function(t){return this.zf+this.Vf*t},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=this.zf,s=this.Vf,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTransform"},t}(),Cg=function(){function t(){this.oldTranslate=0,this.oldScale=1,this.newTranslate=0,this.newScale=1}return t.prototype.set=function(t,n){null!=t&&(this.newTranslate=t),null!=n&&(this.newScale=n)},t}(),Ag=function(){function t(t){this.R=0,this.rn=Ng.X,this.cn=this.toTheme(t),this.I=this.newTransform(null==t?void 0:t.transform),this.yf=this.newTick(null==t?void 0:t.tick),this.Mu=this.newRegion(),this.Wf=this.newMark(),this.Bt=null==t?void 0:t.from,this.Pt=null==t?void 0:t.to}return t.prototype.newTransform=function(t){return new Ig(t)},t.prototype.newRegion=function(){return new dg(NaN,NaN)},t.prototype.newMark=function(){return new Cg},Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},set:function(t){this.Bt=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},set:function(t){this.Pt=t},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.Kc=t,this.rn=n,this.I.bind(t,n)},t.prototype.unbind=function(){this.Kc=void 0,this.I.unbind()},t.prototype.fit=function(t,n){this.doFit(t,n,this.I)},t.prototype.mark=function(t,n){var i=this.Wf,r=this.I;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.I.blend(t,this.Wf)},t.prototype.doFit=function(t,n,i){var r=this.Kc;if(r){var e=r.container.plotArea,u=this.Mu;switch(this.rn){case Ng.X:this.getPixelDomain(e,u),this.Xf(u.from,u.to,this.toFitDomain(t,n,e,u),i);break;case Ng.Y:this.getPixelRange(e,u),this.Xf(u.from,u.to,this.toFitRange(t,n,e,u),i)}}},t.prototype.getPixelDomain=function(t,n){var i=t.padding;return n.set(i.getLeft(),t.width-i.getRight())},t.prototype.getPixelRange=function(t,n){var i=t.padding;return n.set(t.height-i.getBottom(),i.getTop())},t.prototype.toFitDomain=function(t,n,i,r){return null==t&&(t=this.Bt),null==n&&(n=this.Pt),null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null==t&&(t=this.Bt),null==n&&(n=this.Pt),null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.Xf=function(t,n,i,r){var e=i.from,u=i.to;if(!Th(e)&&!Th(u)){var s,h=this.map(e),o=this.map(u)-h,a=t-h*(s=this.cn.isZero(o)?n<t?-1:1:(n-t)/o);r.set(a,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.I},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return t},t.prototype.mapAll=function(t,n,i,r,e){},t.prototype.unmap=function(t){return t},t.prototype.unmapAll=function(t,n,i,r,e){},t.prototype.ticks=function(t,n,i,r,e,u,s,h,o,a,c,f){this.yf.calculate(t,n,i,r,e,u,s,h,o,a,c,f,this)},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinate"},t}(),Rg=function(){function t(t,n){this.Kc=t,this.rn=n,this.Un=[]}return Object.defineProperty(t.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.Un;return null==n?i.push(t):0<=n&&n<i.length?i.splice(n,0,t):i.push(t),t.bind(this,this.rn),this},t.prototype.get=function(t){var n=this.Un;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Un.indexOf(t)},t.prototype.remove=function(t){var n=this.Un;if(pt(t)){if(0<=(r=t)&&r<n.length){var i=n.splice(r,1)[0];return i.unbind(),i}}else{var r,e=t;if(0<=(r=n.indexOf(e)))return n.splice(r,1),e.unbind(),e}return null},t.prototype.clear=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].unbind();return t.length=0,this},t.prototype.destroy=function(){return this.clear()},t.prototype.size=function(){return this.Un.length},t.prototype.fit=function(t,n){for(var i=this.Un,r=0,e=i.length;r<e;++r)i[r].fit(t,n);return this},t.prototype.mark=function(t,n){for(var i=this.Un,r=0,e=i.length;r<e;++r)i[r].mark(t,n);return this},t.prototype.blend=function(t){for(var n=this.Un,i=0,r=n.length;i<r;++i)n[i].blend(t);return this},t}(),kg=function(){function t(t,n){this.Bf=t;var i=new Rg(this,Ng.X);this._x=i;var r=new Rg(this,Ng.Y);if(this._y=r,n){var e=n.x;if(e)if(mt(e))for(var u=0,s=e.length;u<s;++u)i.add(e[u]);else i.add(e);var h=n.y;if(h)if(mt(h))for(u=0,s=h.length;u<s;++u)r.add(h[u]);else r.add(h)}}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Bf},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n,i,r){return this._x.fit(t,n),this._y.fit(i,r),this},t.prototype.mark=function(t,n,i,r){return this._x.mark(t,n),this._y.mark(i,r),this},t.prototype.blend=function(t){return this._x.blend(t),this._y.blend(t),this},t}(),Lg=function(){function t(t){this.cn=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.cn.toStep(t,n,i):-1:pt(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:pt(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c,f,l){if(!(e<=0)){var v=l.transform,b=Math.min(t,n),d=Math.max(t,n),g=Math.min(i,r),m=Math.max(i,r),w=l.map(g),p=l.map(m),O=Math.min(w,p),D=Math.max(w,p),E=l.map(b),M=l.map(d),S=Math.min(E,M),T=Math.max(E,M),j=Math.max(O,S),N=Math.min(D,T),I=0,C=0,A=this.toMajorStep(E,M,e,s);if(A<=0)j<=E&&E<=N&&(c[0]=b,c[1]=v.map(E),c[2]=0,I+=1);else for(var R=Math.floor(E/A)-1,k=Math.ceil(M/A)+1,L=this.toMinorStep(A,h,a),y=R;y<=k;++y){var x=y*A;I<u&&j<=x&&x<=N&&(c[0+(P=3*I)]=l.unmap(x),c[P+1]=v.map(x),c[P+2]=A,I+=1);for(var B=0;B<h;B+=1)if(C<o){var _=x+(B+1)*L;j<=_&&_<=N&&(f[0+(F=3*C)]=l.unmap(_),f[F+1]=v.map(_),f[F+2]=L,C+=1)}}for(y=I;y<u;++y){var P;c[0+(P=3*y)]=NaN,c[P+1]=NaN,c[P+2]=NaN}for(y=C;y<o;++y){var F;f[0+(F=3*y)]=NaN,f[F+1]=NaN,f[F+2]=NaN}}},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),yg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newTick=function(t){return new Lg(t)},n}(Ag),xg=function(){function t(t){this.cn=this.toTheme(t)}return t.prototype.toMajorStep=function(t,n,i,r){return null==r?0<i?this.cn.toStep(t,n,i):-1:pt(r)?r:r(t,n,i)},t.prototype.toMinorStep=function(t,n,i){return null==i?0<=t?this.calcStepMinor(t,n):-1:pt(i)?i:i(t,n)},t.prototype.calcStepMinor=function(t,n){return t/(n+1)},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h,o,a,c,f,l){if(!(e<=0)){var v=l.transform,b=Math.min(t,n),d=Math.max(t,n),g=Math.min(i,r),m=Math.max(i,r),w=l.map(g),p=l.map(m),O=Math.min(w,p),D=Math.max(w,p),E=l.map(b),M=l.map(d),S=Math.min(E,M),T=Math.max(E,M),j=Math.max(O,S),N=Math.min(D,T),I=0,C=0,A=this.toMajorStep(E,M,e,s);if(A<=0)j<=E&&E<=N&&(c[0]=b,c[1]=v.map(E),c[2]=0,I+=1);else for(var R=Math.floor(E/A)-1,k=Math.ceil(M/A)+1,L=this.toMinorStep(A,h,a),y=R;y<=k;++y){var x=y*A;I<u&&j<=x&&x<=N&&(c[0+(P=3*I)]=l.unmap(x),c[P+1]=v.map(x),c[P+2]=l.unmap(x-1),I+=1);for(var B=0;B<h;B+=1)if(C<o){var _=x+(B+1)*L;j<=_&&_<=N&&(f[0+(F=3*C)]=l.unmap(_),f[F+1]=v.map(_),f[F+2]=l.unmap(_-1),C+=1)}}for(y=I;y<u;++y){var P;c[0+(P=3*y)]=NaN,c[P+1]=NaN,c[P+2]=NaN}for(y=C;y<o;++y){var F;f[0+(F=3*y)]=NaN,f[F+1]=NaN,f[F+2]=NaN}}},t.prototype.toTheme=function(t){var n;return null!==(n=null==t?void 0:t.theme)&&void 0!==n?n:this.getThemeDefault()},t.prototype.getThemeDefault=function(){return Z.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateTick"},t}(),Bg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newTick=function(t){return new xg(t)},n.prototype.map=function(t){return Math.log(Math.max(0,t))/Math.LN10},n.prototype.mapAll=function(t,n,i,r,e){for(var u=1/Math.LN10,s=n+e;s<i;s+=r){var h=t[s];t[s]=Math.log(Math.max(0,h))*u}},n.prototype.unmap=function(t){return Math.pow(10,t)},n.prototype.unmapAll=function(t,n,i,r,e){for(var u=n+e;u<i;u+=r)t[u]=Math.pow(10,t[u])},n}(Ag),_g=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegendItem"},n}(hr),Pg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegend"},n}(hr),Fg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartOverview"},n}(hr),Ug=function(n){function i(i){var r=n.call(this)||this,e=r.transform;return r._=new _i(e.position,i),r.Gn=new _i(e.scale,i),r.Xi=new t.Rectangle,r}return _(i,n),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Gn},enumerable:!1,configurable:!0}),i.prototype.getBounds=function(t,i){return this._lastBoundsID=-1,n.prototype.getBounds.call(this,t,i)},i.prototype.calculateBounds=function(){var t=this._bounds,n=this.Mu,i=this.Xi,r=this.transform.worldTransform,e=0,u=0,s=0,h=0,o=this.children;if(0<o.length)for(var a=!0,c=0,f=o.length;c<f;++c){var l=o[c];l.visible&&(l.getBoundsInternal(!1,i),a?(a=!1,e=i.x,s=i.y,u=i.x+i.width,h=i.y+i.height):(e=Math.min(e,i.x),s=Math.min(s,i.y),u=Math.max(u,i.x+i.width),h=Math.max(h,i.y+i.height)))}t.clear(),n.set(e,s),r.apply(n,n),t.addPoint(n),n.set(u,h),r.apply(n,n),t.addPoint(n)},i}(xe),Gg=function(){function t(){this.shape=null,this.x=0,this.y=0,this.p0x=0,this.p0y=0,this.p1x=0,this.p1y=0,this.index=0,this.t=0,this.distance=0}return t.prototype.copyFrom=function(t){return this.shape=t.shape,this.x=t.x,this.y=t.y,this.p0x=t.p0x,this.p0y=t.p0y,this.p1x=t.p1x,this.p1y=t.p1y,this.index=t.index,this.t=t.t,this.distance=t.distance,this},t}(),Hg=function(){function t(t,n,i){this.enable=t,this.color=n,this.alpha=i}return t.from=function(n,i,r){var e,u,s;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i))},t}(),zg=function(){function t(){}return t.from=function(t,n){return mt(t)?function(n){return t[n%t.length]}:wt(t)?t:null!=t?function(){return t}:mt(n)?function(t){return n[t%n.length]}:wt(n)?n:function(){return n}},t}(),Vg=function(t){this.enable=zg.from(null==t?void 0:t.enable,!0),this.color=zg.from(null==t?void 0:t.color,jg),this.alpha=zg.from(null==t?void 0:t.alpha,q.FILL_ALPHA)},Wg=function(){function t(t,n){this.outer=t,this.inner=n}return t.from=function(n,i,r){var e,u;return new t(null!==(e=null==r?void 0:r.outer)&&void 0!==e?e:n.outer(i),null!==(u=null==r?void 0:r.inner)&&void 0!==u?u:n.inner(i))},t}(),Xg=function(t){this.outer=zg.from(null==t?void 0:t.outer,.2),this.inner=zg.from(null==t?void 0:t.inner,.1)},Kg=function(){function t(t,n){this.x=t,this.y=n}return t.from=function(n,i,r,e,u){var s,h;return new t(null!==(s=null==r?void 0:r.x)&&void 0!==s?s:null!=n.x?n.x(i):e,null!==(h=null==r?void 0:r.y)&&void 0!==h?h:null!=n.y?n.y(i):u)},t}(),Yg=function(t){t&&(null!=t.x&&(this.x=zg.from(t.x,0)),null!=t.y&&(this.y=zg.from(t.y,0)))},Jg=function(){function t(t,n,i,r,e,u,s){this.enable=t,this.color=n,this.alpha=i,this.width=r,this.align=e,this.side=u,this.style=s}return t.from=function(n,i,r){var e,u,s,h,o,a,c;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i),null!==(h=null==r?void 0:r.width)&&void 0!==h?h:n.width(i),null!==(o=null==r?void 0:r.align)&&void 0!==o?o:n.align(i),null!==(a=null==r?void 0:r.side)&&void 0!==a?a:n.side(i),null!==(c=null==r?void 0:r.style)&&void 0!==c?c:n.style(i))},t}(),Zg=function(t){this.enable=zg.from(null==t?void 0:t.enable,!0),this.color=zg.from(null==t?void 0:t.color,jg),this.alpha=zg.from(null==t?void 0:t.alpha,q.STROKE_ALPHA),this.width=zg.from(null==t?void 0:t.width,q.STROKE_WIDTH),this.align=zg.from(null==t?void 0:t.width,q.STROKE_ALIGN),this.side=zg.from(null==t?void 0:t.side,qt.ALL),this.style=zg.from(null==t?void 0:t.style,s.NON_SCALING)},qg=function(){function t(t,n){var i;this.Bf=t,this.Kf=new dg(NaN,NaN),this.Yf=new dg(NaN,NaN),this.tf=null!==(i=null==n?void 0:n.selection)&&void 0!==i?i:null,this.C=new Vg(null==n?void 0:n.fill),this.yo=new Zg(null==n?void 0:n.stroke),this.j=new Yg(null==n?void 0:n.size),this.vn=new Yg(null==n?void 0:n.offset),this.Qn=new Xg(null==n?void 0:n.padding),this.Un=[]}return t.prototype.newFill=function(t,n){return Hg.from(this.C,t,n)},t.prototype.newStroke=function(t,n){return Jg.from(this.yo,t,n)},t.prototype.newSize=function(t,n,i,r){return Kg.from(this.j,t,n,i,r)},t.prototype.newOffset=function(t,n,i,r){return Kg.from(this.vn,t,n,i,r)},t.prototype.newPadding=function(t,n){return Wg.from(this.Qn,t,n)},Object.defineProperty(t.prototype,"plotArea",{get:function(){return this.Bf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),t.prototype.update=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].update();var r=this.tf;r&&r.update()},t.prototype.onRender=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].onRender();var r=this.tf;r&&r.onRender()},t.prototype.add=function(t){var n=this.Un;t.bind(this,n.length),n.push(t)},t.prototype.get=function(t){var n=this.Un;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Un.indexOf(t)},t.prototype.clear=function(){for(var t=this.Un,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Un.length},t.prototype.destroy=function(){this.clear();var t=this.tf;t&&t.unbind()},t.prototype.getDomain=function(t,n){n.clear();for(var i=this.Un,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.x===t){var s=u.domain;n.add(s.from,s.to)}}return n},t.prototype.getRange=function(t,n){n.clear();for(var i=this.Un,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.y===t){var s=u.range;n.add(s.from,s.to)}}return n},Object.defineProperty(t.prototype,"domain",{get:function(){var t=this.Kf;t.clear();for(var n=this.Un,i=0,r=n.length;i<r;++i){var e=n[i].domain;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.Yf;t.clear();for(var n=this.Un,i=0,r=n.length;i<r;++i){var e=n[i].range;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(t,n){for(var i=this.Un,r=i.length-1;0<=r;--r){var e=i[r];if(e.hitTest(t,n))return e}return null},t.prototype.calcHitPoint=function(n,i,r){var e=r,u=t.WORK_CALCHITPOINT,s=this.Un,h=null;u.distance=1/0;for(var o=s.length-1;0<=o;--o){var a=s[o];if(a.calcHitPoint(n,i,e)&&e.distance<u.distance){h=a;var c=e;e=u,u=c}}return h&&u!==r&&r.copyFrom(u),h},t.WORK_CALCHITPOINT=new Gg,t}(),Qg=function(n){function i(t,i){var r=n.call(this,i)||this;return r.Jf=t,r.Zf=0,r.qf=1e3,r.Qf=null,r.$f=function(){r.onBlend()},r}return _(i,n),i.prototype.init=function(i){var r,e=this;n.prototype.init.call(this,i),this.tl=!0,this.nl=new t.Rectangle,this.Rc=new t.Point;var u=new Ug((function(){e.il=!0,e.tl=!0,st.update(e)}));this.Kc=u,this.addChild(u),this.il=!0,this.br=new Or(this,(function(){return u}),null==i?void 0:i.view),this.rl=new kg(this,null==i?void 0:i.coordinate);var s=new qg(this,null==i?void 0:i.series);this.el=s;var h=new wg(this,null==i?void 0:i.axis);this.Nf=h,this.addChild(h.container);var o=s.selection;if(o&&o.bind(s),(null!==(r=null==i?void 0:i.mask)&&void 0!==r?r:this.theme.isOverflowMaskEnabled())&&(u.mask=this.getOverflowMask()),null!=i){var a=i.series;if(null!=a&&(l=a.list)){var c=l.length;if(0<c){for(var f=0;f<c;++f)s.add(l[f]);s.update()}}var l,v=i.axis;if(null!=v&&(l=v.list)){f=0;for(var b=l.length;f<b;++f)h.add(l[f])}}},i.prototype.onResize=function(t,i,r,e){this.il=!0,this.tl=!0,n.prototype.onResize.call(this,t,i,r,e)},i.prototype.getOverflowMask=function(){return null==this.dr&&(this.dr=new or(this),this.reflowable.add(this.dr),this.toDirty()),this.dr},Object.defineProperty(i.prototype,"chart",{get:function(){return this.Jf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"series",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"axis",{get:function(){return this.Nf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"view",{get:function(){return this.br},enumerable:!1,configurable:!0}),i.prototype.onWheel=function(t,i,r){var e=this.br.onWheel(t,i,r),u=n.prototype.onWheel.call(this,t,i,r);return e||u},i.prototype.onDblClick=function(t,i){var r=this.br.onDblClick(t,i),e=n.prototype.onDblClick.call(this,t,i);return r||e},i.prototype.onDown=function(t){this.br.onDown(t),n.prototype.onDown.call(this,t)},i.prototype.render=function(t){this.il&&(this.il=!1,this.rl.fit(),this.Nf.onRender(),this.el.onRender()),n.prototype.render.call(this,t)},i.prototype.destroy=function(){this.Kc.destroy(),this.el.destroy(),this.Nf.destroy()},i.prototype.getType=function(){return"DChartPlotArea"},i.prototype.getBoundsInContainer=function(){var t=this.nl;if(this.tl){this.tl=!1;var n=this.container;n.updateTransform();var i=n.transform.localTransform,r=this.Rc;r.set(0,0),i.applyInverse(r,r),t.x=r.x,t.y=r.y,r.set(this.width,this.height),i.applyInverse(r,r),t.width=r.x-t.x,t.height=r.y-t.y}return t},i.prototype.fit=function(t,n,i,r,e){var u=this.rl,s=this.Nf,h=this.el;if(null!=t&&t<=0)u.fit(n,i,r,e),s.update(),h.update();else{this.qf=null!=t?t:200,this.Zf=Date.now(),u.mark(n,i,r,e);var o=this.Qf;null!=o&&window.clearTimeout(o),this.Qf=window.setTimeout(this.$f,0)}return this},i.prototype.onBlend=function(){var t=(Date.now()-this.Zf)/this.qf;t<1?this.Qf=window.setTimeout(this.$f,0):(this.Qf=null,t=1),this.rl.blend(vr.ELASTIC(t)),this.Nf.update(),this.el.update()},i}(hr),$g=function(){function t(t,n,i){this.Bt=t,this.Pt=n,this.ut=i}return Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;return null!=t&&this.Bt!==t&&(Th(this.Bt)&&Th(t)||(this.Bt=t,i=!0)),null!=n&&this.Pt!==n&&(Th(this.Pt)&&Th(n)||(this.Pt=n,i=!0)),i&&this.ut(),this},t.prototype.add=function(t,n){var i,r;return Th(t)||(i=Th(this.from)?t:Math.min(this.from,t)),Th(n)||(r=Th(this.to)?n:Math.max(this.to,n)),this.set(i,r)},t.prototype.clear=function(){return this.set(NaN,NaN)},t}(),tm=function(){function t(t,n){this._x=t,this._y=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),t.prototype.bind=function(t){this._x.bind(t),this._y.bind(t)},t.prototype.unbind=function(){this._x.unbind(),this._y.unbind()},t.prototype.set=function(t,n,i,r){this._x.set(t,n,i,r),this._y.set(t,n,i,r)},t.prototype.unset=function(){this._x.unset(),this._y.unset()},t.prototype.update=function(t,n,i){var r=this._x.update(t,n,i),e=this._y.update(t,n,i);return r||e},t}(),nm=function(){function t(t){var n,i,r,e=this.toTheme(t);this.cn=e;var u=(new Dt).add(null!==(n=null==t?void 0:t.state)&&void 0!==n?n:ct.HOVERED);if(this.Rt=u,this.vs=null!==(i=null==t?void 0:t.enable)&&void 0!==i?i:e.isEnabled(u),null!=t){var s=t.shape;null!=s&&(wt(s)?this.ul=s:this.Xr=s)}this.B=null!==(r=null==t?void 0:t.style)&&void 0!==r?r:this.setStyle}return t.prototype.bind=function(t){if(this.vs){var n=this.Xr;if(null==n){var i=this.Rt,r=this.ul;n=null!=r?r(i):this.newShape(i,this.cn)}this.Xr=n,n.attach(t.plotArea.axis.container),n.visible=!1}},t.prototype.unbind=function(){var t=this.Xr;t&&t.detach()},t.prototype.newShape=function(t,n){return n.newShape(t)},t.prototype.set=function(t,n,i,r){this.update(t,n,i);var e=this.Xr;e&&this.B(e,r)},t.prototype.setStyle=function(t,n){},t.prototype.unset=function(){var t=this.Xr;t&&(t.visible=!1)},t.prototype.toTheme=function(t){var n=null==t?void 0:t.theme;return Ot(n)?this.getTheme(n):null!=n?n:this.getTheme(this.getType())},t.prototype.getTheme=function(t){return Z.getInstance().get(t)},t}(),im=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Xr;if(r){var e=i.x,u=t.plotArea.height;return r.transform.position.set(e,.5*u),r.size.set(0,u),r.visible=this.isVisible(t,n,i),!0}return!1},n.prototype.isVisible=function(t,n,i){var r=i.x;return 0<=r&&r<=t.plotArea.width},n.prototype.getType=function(){return"DChartSelectionGridlineX"},n}(nm),rm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Xr;if(r){var e=i.y,u=t.plotArea.width;return r.transform.position.set(.5*u,e),r.size.set(u,0),r.visible=this.isVisible(t,n,i),!0}return!1},n.prototype.isVisible=function(t,n,i){var r=i.y;return 0<=r&&r<=t.plotArea.height},n.prototype.getType=function(){return"DChartSelectionGridlineY"},n}(nm),em=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n,i){var r=this.Xr;return!!r&&(r.transform.position.copyFrom(i),r.visible=this.isVisible(t,n,i),!0)},n.prototype.isVisible=function(t,n,i){var r=i.x,e=i.y,u=t.plotArea;return 0<=r&&r<=u.width&&0<=e&&e<=u.height},n.prototype.getType=function(){return"DChartSelectionMarker"},n}(nm),um={PREVIOUS:0,NEXT:1,CLOSER:2,INTERSECTION:3},sm=function(n){function i(i){var r,e,u,s,h,o=this;(o=n.call(this)||this).Kc=null,o.el=null,o.vs=null===(r=i.enable)||void 0===r||r,o.If=new tm(new im(null===(e=i.gridline)||void 0===e?void 0:e.x),new rm(null===(u=i.gridline)||void 0===u?void 0:u.y)),o.A=new em(i.marker),o.Rt=null!==(s=i.state)&&void 0!==s?s:ct.HOVERED,o.sl=null,o.hl=null,o._=new t.Point,o.wn=null!==(h=i.point)&&void 0!==h?h:um.CLOSER,o.Mu=new t.Point;var a=i.on;if(a)for(var c in a){var f=a[c];f&&o.on(c,f)}return o}return _(i,n),i.prototype.bind=function(t){this.vs&&(this.Kc=t,this.If.bind(t),this.A.bind(t))},i.prototype.unbind=function(){this.A.unbind(),this.If.unbind(),this.Kc=null,this.sl=null,this.hl=null},Object.defineProperty(i.prototype,"series",{get:function(){return this.el},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"position",{get:function(){return this._},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gridline",{get:function(){return this.If},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"marker",{get:function(){return this.A},enumerable:!1,configurable:!0}),i.prototype.set=function(t,n){var i=this.Kc,r=this.sl=t.coordinate.x,e=this.hl=t.coordinate.y;if(i&&r&&e){var u=i.plotArea.container.localTransform,s=this._,h=this.Mu;if(n instanceof Gg){var o=n.x,a=n.y;switch(this.wn){case um.PREVIOUS:o=n.p0x,a=n.p0y;break;case um.NEXT:o=n.p1x,a=n.p1y;break;case um.CLOSER:Math.abs(n.p0x-n.x)<Math.abs(n.p1x-n.x)?(o=n.p0x,a=n.p0y):(o=n.p1x,a=n.p1y)}h.set(o,a),u.apply(h,h),s.set(r.unmap(r.transform.unmap(o)),e.unmap(e.transform.unmap(a)))}else s.copyFrom(n.position),h.set(r.transform.map(r.map(s.x)),e.transform.map(e.map(s.y))),u.apply(h,h);this.If.set(i,s,h,t),this.A.set(i,s,h,t),st.update(i.plotArea)}var c=this.el;if(c!==t){var f=this.Rt;c&&c.state.remove(f),this.el=t,t.state.add(f)}this.emit("change",this)},i.prototype.unset=function(){var t=this.el;t&&(this.el=null,this.sl=null,this.hl=null,t.state.remove(this.Rt),this.If.unset(),this.A.unset(),this.emit("change",this))},i.prototype.update=function(){var t=this.Kc,n=this.sl,i=this.hl;if(t&&n&&i){var r=this._,e=this.Mu;e.set(n.transform.map(n.map(r.x)),i.transform.map(i.map(r.y))),t.plotArea.container.localTransform.apply(e,e);var u=this.If.update(t,r,e),s=this.A.update(t,r,e);return u||s}return!1},i}(t.utils.EventEmitter),hm=function(t){function n(n){var i,r=this;(r=t.call(this)||this).Kc=null;var e=Ai(null!==(i=null==n?void 0:n.point)&&void 0!==i?i:um.CLOSER,um);r.Ja=r.newSelected(e,null==n?void 0:n.selected),r.ol=r.newHovered(e,null==n?void 0:n.hovered);var u=null==n?void 0:n.on;if(null!=u)for(var s in u){var h=u[s];h&&r.on(s,h)}return r.al=function(t){r.onMove(t)},r.cl=function(t){r.onClick(t)},r}return _(n,t),n.prototype.newSelected=function(t,n){return new sm(this.toSelectedOptions(t,n))},n.prototype.newHovered=function(t,n){return new sm(this.toHoveredOptions(t,n))},n.prototype.toSelectedOptions=function(t,n){return this.toSubOptions(t,n,ct.ACTIVE)},n.prototype.toHoveredOptions=function(t,n){return this.toSubOptions(t,n,ct.HOVERED)},n.prototype.toSubOptions=function(t,n,i){var r,e,u,s,h,o,a;null==(n=n||{}).point&&(n.point=t),null==n.state&&(n.state=i);var c=null!==(r=n.gridline)&&void 0!==r?r:n.gridline={},f=null!==(e=c.x)&&void 0!==e?e:c.x={};null==f.state&&(f.state=i);var l=null!==(u=c.y)&&void 0!==u?u:c.y={};null==l.state&&(l.state=i);var v=null!==(s=n.marker)&&void 0!==s?s:n.marker={};null==v.state&&(v.state=i);var b=null!==(h=n.label)&&void 0!==h?h:n.label={},d=null!==(o=b.x)&&void 0!==o?o:b.x={};null==d.state&&(d.state=i);var g=null!==(a=b.y)&&void 0!==a?a:b.y={};return null==g.state&&(g.state=i),n},n.prototype.onClick=function(t){var i=this.Kc;if(i&&t.target===i.plotArea){var r=n.WORK_SELECT,e=t.data.global,u=i.calcHitPoint(e.x,e.y,r),s=this.Ja;u?s.set(u,r):s.unset()}},n.prototype.onMove=function(t){var i=this.Kc;if(i){var r=this.ol;if(t.target===i.plotArea){var e=n.WORK_SELECT,u=t.data.global,s=i.calcHitPoint(u.x,u.y,e);s?r.set(s,e):r.unset()}else r.unset()}},n.prototype.bind=function(t){this.Kc=t,this.Ja.bind(t),this.ol.bind(t);var n=t.plotArea;n.on(ir.move,this.al),n.on(ir.tap,this.cl)},n.prototype.unbind=function(){var t=this.Kc;this.Kc=null,t&&t.plotArea.off(ir.move,this.al),this.Ja.unbind(),this.ol.unbind()},Object.defineProperty(n.prototype,"selected",{get:function(){return this.Ja},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hovered",{get:function(){return this.ol},enumerable:!1,configurable:!0}),n.prototype.update=function(){var t=this.Ja.update(),n=this.ol.update();if(t||n){var i=this.Kc;null!=i&&st.update(i.plotArea)}},n.prototype.onRender=function(){this.Ja.update(),this.ol.update()},n.WORK_SELECT=new Gg,n}(t.utils.EventEmitter),om=function(){function t(t,n){var i,r;this.p=t,this.fl=null!==(i=null==n?void 0:n.x)&&void 0!==i?i:0,this.ll=null!==(r=null==n?void 0:n.y)&&void 0!==r?r:0,this.vl=NaN,this.bl=NaN,this.dl=NaN,this.ml=NaN}return Object.defineProperty(t.prototype,"x",{get:function(){var t=this.p.container;return t?t.plotArea.coordinate.x.get(this.fl):null},set:function(t){var n=this.toIndexX(t);this.fl!==n&&(this.fl=n,this.vl=NaN,this.dl=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexX=function(t){if(pt(t))return t;if(null!=t){var n=this.p.container;if(n)return n.plotArea.coordinate.x.indexOf(t)}return-1},Object.defineProperty(t.prototype,"y",{get:function(){var t=this.p.container;return t?t.plotArea.coordinate.y.get(this.ll):null},set:function(t){var n=this.toIndexY(t);this.ll!==n&&(this.ll=n,this.bl=NaN,this.ml=NaN)},enumerable:!1,configurable:!0}),t.prototype.toIndexY=function(t){if(pt(t))return t;if(null!=t){var n=this.p.container;if(n)return n.plotArea.coordinate.y.indexOf(t)}return-1},t.prototype.isDirty=function(t,n){var i=t.id,r=n.id,e=i!==this.vl,u=r!==this.bl;return this.vl=i,this.bl=r,e||u},t.prototype.isTransformDirty=function(t,n){var i=t.transform.id,r=n.transform.id,e=i!==this.dl,u=r!==this.ml;return this.dl=i,this.ml=r,e||u},t.prototype.reset=function(){this.vl=NaN,this.bl=NaN},t.prototype.destroy=function(){this.reset()},t}(),am=function(t){function n(n){var i=t.call(this)||this;i.rl=new om(i,null==n?void 0:n.coordinate),i.hu=0,i.Kf=new dg(NaN,NaN),i.Yf=new dg(NaN,NaN),i.wl=NaN,i.Ff=!0,i.Rt=new Et((function(t,n){i.onStateChange(t,n)}));var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i}return _(n,t),n.prototype.bind=function(t,n){this.Kc=t,this.rl.reset(),this.hu=n;var i=t.plotArea.chart;return i&&(this.Rt.parent=i.state),this},n.prototype.unbind=function(){return this.Kc=void 0,this},Object.defineProperty(n.prototype,"domain",{get:function(){return this.updateRegion(),this.Kf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"range",{get:function(){return this.updateRegion(),this.Yf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"container",{get:function(){return this.Kc||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinate",{get:function(){return this.rl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Rt},enumerable:!1,configurable:!0}),n.prototype.show=function(){return!0!==this.Ff&&(this.Ff=!0,this.onShow()),this},n.prototype.onShow=function(){var t=this.shape;null!=t&&(t.visible=!0)},n.prototype.isShown=function(){return this.Ff},n.prototype.hide=function(){return!1!==this.Ff&&(this.Ff=!1,this.onHide()),this},n.prototype.onHide=function(){var t=this.shape;null!=t&&(t.visible=!1)},n.prototype.isHidden=function(){return!this.Ff},n.prototype.destroy=function(){return this.Kc=void 0,this.rl.destroy(),this},n.prototype.hitTest=function(t,n){return!1},n.prototype.calcHitPoint=function(t,n,i){return!1},n.prototype.onStateChange=function(t,n){var i;this.toDirty();var r=null===(i=this.Kc)||void 0===i?void 0:i.plotArea.chart;st.update(r),this.emit("statechange",t,n,this)},n}(t.utils.EventEmitter),cm=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).pl=null,r.zn=t,r.jt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.Ol=0,r.Dl=NaN,r}return _(i,n),i.prototype.getSizeDefault=function(){return 10},i.prototype.getOffsetDefault=function(){return 0},i.prototype.bind=function(t,i){var r=this.pl;if(!r){(r=this.pl=this.newLineOfAny()).visible=this.Ff;var e=this.zn;this.initLine(r,e,t,i)}return r.attach(t.plotArea.container,i),this.Dl=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.initLine=function(t,n,i,r){var e=i.newFill(r,null==n?void 0:n.fill);this.C=e,t.fill.copy(e);var u=i.newStroke(r,null==n?void 0:n.stroke);this.yo=u,t.stroke.copy(u);var s=this.getSizeDefault(),h=i.newSize(r,null==n?void 0:n.size,s,s);this.j=h,t.points.size.set(h.x,h.y);var o=this.getOffsetDefault(),a=i.newOffset(r,n&&n.offset,o,o);this.vn=a,t.points.offset.set(a.x,a.y)},i.prototype.unbind=function(){var t=this.pl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.pl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.jt},set:function(t){this.jt=t,this.Ol+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.Ol+=1,this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.pl;if(n){var i=this.rl,r=i.x,e=i.y;if(r&&e){var u=this.Ol,s=u!==this.Dl,h=i.isDirty(r,e),o=i.isTransformDirty(r,e);if(s||h||o)return this.Dl=u,this.doUpdateLine(n,r,e),t&&st.update(n),!0}}return!1},i.prototype.doUpdateLine=function(t,n,r){for(var e=t.points.values,u=e.length,s=0,h=this.jt,o=NaN,a=NaN,c=NaN,f=NaN,l=0,v=h.length;l<v;l+=2){var b=h[l],d=h[l+1];null!=b&&null!=d&&(s<u?(e[s]=b,e[s+1]=d):e.push(b,d),s+=2,o!=o?(o=b,a=b,c=d,f=d):(o=Math.min(o,b),a=Math.max(a,b),c=Math.min(c,d),f=Math.max(f,d)))}e.length!==s&&(e.length=s),n.mapAll(e,0,s,2,0),r.mapAll(e,0,s,2,1),n.transform.mapAll(e,0,s,2,0),r.transform.mapAll(e,0,s,2,1),o!=o&&(o=0,a=0,c=0,f=0);var g=i.WORK_REGION||{xmin:0,xmax:0,ymin:0,ymax:0};i.WORK_REGION=g,this.adjustLineRegion(o,a,c,f,g),o=n.transform.map(n.map(g.xmin)),a=n.transform.map(n.map(g.xmax)),c=r.transform.map(r.map(g.ymin)),f=r.transform.map(r.map(g.ymax));var m=Math.abs(a-o),w=Math.abs(f-c),p=.5*(o+a),O=.5*(c+f);for(l=0,v=e.length;l<v;l+=2)e[l+0]-=p,e[l+1]-=O;t.disallowUploadedUpdate(),this.applyLine(t,n,r,m,w,p,O,e),t.allowUploadedUpdate()},i.prototype.adjustLineRegion=function(t,n,i,r,e){return e.xmin=t,e.xmax=n,e.ymin=i,e.ymax=r,e},i.prototype.applyLine=function(t,n,i,r,e,u,s,h){t.points.set(h),t.size.set(r,e),t.transform.position.set(u,s)},i.prototype.updateRegion=function(){var t=this.Ol;if(this.wl!==t){this.wl=t;var n=this.jt,i=this.Kf,r=this.Yf;i.clear(),r.clear(),this.calcRegion(n,i,r)}},i.prototype.calcRegion=function(t,n,i){for(var r=0,e=t.length;r<e;r+=2){var u=t[r];null!=u&&n.add(u,u);var s=t[r+1];null!=s&&i.add(s,s)}},i.prototype.destroy=function(){var t=this.pl;return t&&(this.pl=null,t.detach(),t.destroy()),this.jt.length=0,this.Ol=0,this.Dl=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.pl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.pl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,null,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.calcHitPointTestRange=function(t,n,i,r,e,u,s,h,o){for(var a=ab(h,t+i+e,2,0),c=0,f=a-1,l=f<<1;0<=f;f-=1,l-=2)if(h[l]<=t-i){c=f;break}return o[0]=c,o[1]=c!==a?a:Math.min(h.length<<1,a+1),o},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v){var b=v.shape;if(b.containsPointAbs(t,n,i,r,e,u,s,h,o,a,c)){var d=b.transform,g=d.position,m=d.scale;v.x=v.p0x=v.p1x=g.x+m.x*s,v.y=v.p0y=v.p1y=g.y+m.y*h,v.t=l,v.index=f;var w=t-(s+e),p=n-(h+u);return v.distance=Math.sqrt(w*w+p*p),!0}return!1},i.WORK=new t.Point,i}(am),fm=function(t){function n(n){var i=t.call(this,n)||this;return i.El=-1,i.Ml=-1,i.Sl=-1,i.Tl=-1,i.jl=!1!==(n&&n.size&&n.size.auto),i}return _(n,t),n.prototype.bind=function(n,i){return this.El=-1,this.Ml=-1,this.Sl=-1,this.Tl=-1,t.prototype.bind.call(this,n,i),this},n.prototype.initLine=function(n,i,r,e){t.prototype.initLine.call(this,n,i,r,e),this.Qn=r.newPadding(e,i&&i.padding)},n.prototype.newLineOfAny=function(){return new Tf},n.prototype.getSizeDefault=function(){return 1},n.prototype.adjustLineRegion=function(n,i,r,e,u){return t.prototype.adjustLineRegion.call(this,n,i,Math.min(0,r),Math.max(0,e),u)},n.prototype.updateBarCountAndIndex=function(){if(this.Ml<0||this.El<0){var t=0,i=0,r=this.Kc;if(r)for(var e=0,u=r.size();e<u;++e){var s=r.get(e);s===this&&(t=i),s instanceof n&&(i+=1)}return i=Math.max(1,i),this.El=i,this.Ml=t,!0}return!1},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=n.points,c=a.offset,f=a.size,l=this.j,v=this.vn,b=this.Qn;if(l&&v&&b){var d=i.id,g=i.transform.id;if(this.updateBarCountAndIndex()||this.Sl!==d||this.Tl!==g){var m=this.El,w=this.Ml;this.Sl=d,this.Tl=g;var p=i.transform.map(i.map(0)),O=i.transform.map(i.map(l.x)),D=Math.abs(p-O)*(1-b.outer);if(m<=1)c.x=v.x,f.x=D;else{var E=D*(1-b.inner),M=E/m,S=M*(w+.5)+w*((D-E)/(m-1));c.x=v.x+S-.5*D,f.x=M}}}var T=f.y;mt(T)||(T=[]);var j=T.length,N=c.y;mt(N)||(N=[]);for(var I=N.length,C=0,A=r.transform.map(r.map(0))-h,R=0,k=o.length;R<k;R+=2,C+=1){var L=o[R+1]-A,y=Math.abs(L);C<j?T[C]=y:T.push(y);var x=-.5*L;C<I?N[C]=x:N.push(x)}T.length!==C&&(T.length=C),N.length!==C&&(N.length=C),c.y=N,f.y=T,t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n.prototype.calcSizeX=function(t){var n=this.jt;if(2<n.length)for(var i=n.length,r=n[i-2],e=i-4;0<=e;e-=2){var u=n[e];if(null!=r&&null!=u)return Math.abs(r-u);r=u}return t},n.prototype.calcRegion=function(n,i,r){t.prototype.calcRegion.call(this,n,i,r);var e=this.j;if(e){var u=e.x;this.jl&&(u=this.calcSizeX(u),e.x=u);var s=.5*u;i.set(i.from-s,i.to+s)}r.add(0,0)},n}(cm),lm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new df},n}(cm),vm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Of},n}(cm),bm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Tf},n}(cm),dm=function(t){function n(n){var i=t.call(this,n)||this;return i.Nl=0,i}return _(n,t),n.prototype.newLineOfAny=function(){return new Kf},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=this.j,c=this.vn;a&&c&&this.Nl!==a.y&&(this.Nl=a.y,n.points.offset.y=c.y-.2*a.y),t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n}(cm),gm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Gf},n}(dm),mm=function(n){function i(t){var i,r=this;return(r=n.call(this,t)||this).pl=null,r.zn=t,r.jt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.Ol=0,r.Dl=NaN,r.Il=0,r.Cl=0,r}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.pl;if(!e){var u=t.newStroke(i,null===(r=this.zn)||void 0===r?void 0:r.stroke);this.yo=u,(e=new Vc).stroke.copy(u),e.visible=this.Ff,this.pl=e}return e.attach(t.plotArea.container,i),this.Dl=NaN,n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.pl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.pl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.jt},set:function(t){this.jt=t,this.Ol+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.Ol+=1,this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.pl;if(n){var i=this.rl,r=i.x,e=i.y;if(r&&e){var u=this.Ol,s=u!==this.Dl,h=i.isDirty(r,e),o=i.isTransformDirty(r,e);if(s||h||o)return this.Dl=u,this.doUpdateLine(n,r,e,s||h),t&&st.update(n),!0}}return!1},i.prototype.doUpdateLine=function(t,n,i,r){if(t.disallowUploadedUpdate(),r){for(var e=t.points.values,u=t.points.segments,s=e.length,h=u.length,o=0,a=0,c=this.jt,f=NaN,l=NaN,v=NaN,b=NaN,d=0,g=c.length;d<g;d+=2){var m=c[d],w=c[d+1];if(null!=m&&null!=w)o<s?(e[o]=m,e[o+1]=w):e.push(m,w),o+=2,f!=f?(f=m,l=m,v=w,b=w):(f=Math.min(f,m),l=Math.max(l,m),v=Math.min(v,w),b=Math.max(b,w));else{var p=(d>>1)-a;a<h?u[a]=p:u.push(p),a+=1}}e.length!==o&&(e.length=o),u.length!==a&&(u.length=a),n.mapAll(e,0,o,2,0),i.mapAll(e,0,o,2,1),f!=f&&(f=0,l=0,v=0,b=0),f=n.map(f),l=n.map(l),v=i.map(v),b=i.map(b);var O=Math.abs(l-f),D=Math.abs(b-v),E=.5*(f+l),M=.5*(v+b);for(d=0,g=e.length;d<g;d+=2)e[d+0]-=E,e[d+1]-=M;t.size.set(O,D),t.points.set(e,u),this.Il=E,this.Cl=M}t.transform.position.set(n.transform.map(this.Il),i.transform.map(this.Cl)),t.transform.scale.set(n.transform.scale,i.transform.scale),t.allowUploadedUpdate()},i.prototype.updateRegion=function(){var t=this.Ol;if(this.wl!==t){this.wl=t;var n=this.jt,i=this.Kf,r=this.Yf;if(i.clear(),r.clear(),null!=n)for(var e=0,u=n.length;e<u;e+=2){var s=n[e];null!=s&&i.add(s,s);var h=n[e+1];null!=h&&r.add(h,h)}}},i.prototype.destroy=function(){var t=this.pl;return t&&(this.pl=null,t.detach(),t.destroy()),this.jt.length=0,this.Ol=0,this.Dl=NaN,n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.pl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.pl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointTestRange=function(t,n,i,r,e){var u=ab(r,t,2,0);return e[0]=Math.max(0,u-1),e[1]=u,e},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=g+p*f,o.y=m+O*l,o.p0x=g+p*i,o.p0y=m+O*r,o.p1x=g+p*e,o.p1y=m+O*u,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(am),wm=function(){function t(t,n,i,r){this.R=0,this.Al=NaN,this._a=t,this._b=n,this._x0=i,this._y0=r}return Object.defineProperty(t.prototype,"a",{get:function(){return this._a},set:function(t){this._a!==t&&(this.R+=1,this._a=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},set:function(t){this._b!==t&&(this.R+=1,this._b=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x0",{get:function(){return this._x0},set:function(t){this._x0!==t&&(this.R+=1,this._x0=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y0",{get:function(){return this._y0},set:function(t){this._y0!==t&&(this.R+=1,this._y0=t)},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.R+=1},t.prototype.isDirty=function(){return this.R!==this.Al},t.prototype.toClean=function(){this.Al=this.R},t.from=function(n){var i,r,e,u;return new t(null!==(i=null==n?void 0:n.a)&&void 0!==i?i:1,null!==(r=null==n?void 0:n.b)&&void 0!==r?r:1,null!==(e=null==n?void 0:n.x0)&&void 0!==e?e:0,null!==(u=null==n?void 0:n.y0)&&void 0!==u?u:0)},t}(),pm=function(n){function i(t){var i=n.call(this,t)||this;return i.pl=null,i.zn=t,i.Rl=wm.from(t),i}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.pl;if(!e){var u=t.newStroke(i,null===(r=this.zn)||void 0===r?void 0:r.stroke);this.yo=u,(e=new Vc).stroke.copy(u),e.visible=this.Ff,this.pl=e}return e.attach(t.plotArea.container,i),n.prototype.bind.call(this,t,i),this},i.prototype.unbind=function(){var t=this.pl;return t&&t.detach(),n.prototype.unbind.call(this),this},Object.defineProperty(i.prototype,"shape",{get:function(){return this.pl},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parameters",{get:function(){return this.Rl},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){return this.Rl.toDirty(),this},i.prototype.update=function(){return this.doUpdate(!0),this},i.prototype.onRender=function(){return this.doUpdate(!1),this},i.prototype.doUpdate=function(t){var n=this.pl,i=this.Kc;if(n&&i){var r=this.rl,e=r.x,u=r.y;if(e&&u)return this.doUpdateLine(n,i,e,u),t&&st.update(n),!0}return!1},i.prototype.doUpdateLine=function(t,n,i,r){var e=t.points.values,u=t.points.segments,s=this.Rl,h=s.a,o=s.b,a=s.x0,c=s.y0,f=Math.abs(h),l=Math.abs(o),v=NaN,b=NaN,d=NaN,g=NaN,m=1e-5,w=n.plotArea.getBoundsInContainer();if(l<=f){var p=i.unmap(i.transform.unmap(w.x)),O=i.unmap(i.transform.unmap(w.x+w.width));v=Math.min(p,O),d=Math.max(p,O);var D=r.unmap(r.transform.unmap(w.y)),E=r.unmap(r.transform.unmap(w.y+w.height));if(b=Math.min(D,E),g=Math.max(D,E),m<l){var M=(N=o/h)*(D-c)+a,S=N*(E-c)+a,T=Math.min(M,S),j=Math.max(M,S);b=(I=1/N)*((v=Math.max(v,T))-a)+o*c,g=I*((d=Math.min(d,j))-a)+o*c}else v=a,d=a}else if(D=r.unmap(r.transform.unmap(w.y)),E=r.unmap(r.transform.unmap(w.y+w.height)),b=Math.min(D,E),g=Math.max(D,E),p=i.unmap(i.transform.unmap(w.x)),O=i.unmap(i.transform.unmap(w.x+w.width)),v=Math.min(p,O),d=Math.max(p,O),m<f){var N,I,C=(N=h/o)*(p-a)+c,A=N*(O-a)+c,R=Math.min(C,A),k=Math.max(C,A);v=(I=1/N)*((b=Math.max(b,R))-c)+h*a,d=I*((g=Math.min(g,k))-c)+h*a}else b=c,g=c;v=i.transform.map(i.map(v)),b=r.transform.map(r.map(b));var L=.5*(v+(d=i.transform.map(i.map(d)))),y=.5*(b+(g=r.transform.map(r.map(g)))),x=Math.abs(d-v),B=Math.abs(g-b);v-=L,b-=y,d-=L,g-=y,4!==e.length?(e.length=0,e.push(v,b,d,g)):(e[0]=v,e[1]=b,e[2]=d,e[3]=g),0<u.length&&(u.length=0),t.disallowUploadedUpdate(),t.points.set(e,u),t.size.set(x,B),t.points.toFitted(),t.transform.position.set(L,y),t.allowUploadedUpdate()},i.prototype.updateRegion=function(){},i.prototype.destroy=function(){var t=this.pl;return t&&(this.pl=null,t.detach(),t.destroy()),n.prototype.destroy.call(this),this},i.prototype.hitTest=function(t,n){var r=this.pl;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.pl;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,null,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=o.p0x=o.p1x=g+p*f,o.y=o.p0y=o.p1y=m+O*l,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(am),Om=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n);var r=this.plotArea;this.addChild(r),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:this.theme.isOverflowMaskEnabled())&&(r.axis.container.mask=this.getOverflowMask())},n.prototype.getOverflowMask=function(){return null==this.dr&&(this.dr=new or(this),this.reflowable.add(this.dr),this.toDirty()),this.dr},Object.defineProperty(n.prototype,"plotArea",{get:function(){var t=this.Bf;return null==t&&(t=this.newPlotArea(),this.Bf=t),t},enumerable:!1,configurable:!0}),n.prototype.newPlotArea=function(){var t;return new Qg(this,null===(t=this.zn)||void 0===t?void 0:t.plotArea)},n.prototype.getType=function(){return"DChart"},n.prototype.destroy=function(){var n;this._destroyed||(null===(n=this.Bf)||void 0===n||n.destroy(),t.prototype.destroy.call(this))},n}(hr),Dm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.isClear=function(){return!0},n}(Ab),Em=function(t){function n(n){var i=t.call(this)||this;return i.Gr=n,i}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.Gr},enumerable:!1,configurable:!0}),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return yb.getDocumentController().saveAs(this.Gr),!0},n}(Ab),Mm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.isStorable=function(){return!1},n.prototype.execute=function(){return yb.getDocumentController().save(),!0},n}(Ab),Sm=function(t){function n(n,i){var r=t.call(this)||this;r.p=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),n.prototype.createAsUrl=function(t){return null==t||pt(t)?this.create({size:t,extractor:function(t){return gb.base64({target:t})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(t){return gb.base64({target:t})}})},n.prototype.createAsFile=function(t,n){Ot(t)?this.create({extractor:function(n){gb.file({target:n,filename:t})}}):null===t||pt(t)?this.create({size:t,extractor:function(t){gb.file({target:t,filename:n})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(n){gb.file({target:n,filename:t.filename})}})},n.prototype.toScale=function(t,n){return null==t?1:t/st.getResolution(n)/Math.max(n.width,n.height)},n.prototype.toCleanupSnap=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.snap},n.prototype.toCleanupBackground=function(t){if(null==t)return!1;var n=t.cleanup;return null!=n&&!1!==n&&(!0===n||!0===n.background)},n.prototype.toCleanupReflow=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.reflow},n.prototype.create=function(t){var n=this.p,i=n.canvas;if(i){var r=n.view,e=r.position,u=r.scale,s=e.x,h=e.y,o=u.x,a=u.y,c=this.toScale(t.size,i);r.transform(0,0,c,c,0);var f=void 0;if(this.toCleanupSnap(t)&&"snap"in i){var l=i.snap;null!=l&&((f=l.container).renderable?f.renderable=!1:f=void 0)}var v=void 0;if(this.toCleanupBackground(t)&&((v=i.snippet).renderable?v.renderable=!1:v=void 0),this.toCleanupReflow(t)){var b=st.getLayer(i);b&&b.reflow()}this.emit("taking",i,this);var d=t.extractor(i);return this.emit("took",i,null,this),v&&(v.renderable=!0),null!=f&&(f.renderable=!0),r.transform(s,h,o,a,0),d}},n}(t.utils.EventEmitter),Tm=function(t){function n(n){var i,r=this;return(r=t.call(this,n)||this).kl=null,r.Ll=null==n?void 0:n.tile,r.yl=null==n?void 0:n.controller,r.xl=null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:r.theme.isAmbient(),r.Bl=new Sm(r,null==n?void 0:n.snapshot),r.Fr=r.toMode(n),r}return _(n,t),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.Bl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"controller",{get:function(){return this.yl||null},enumerable:!1,configurable:!0}),n.prototype.set=function(t){var n=this,i=this.kl;if(i!==t){if(i&&(this.kl=null,this.canvas&&(this.canvas=null),this.onUnset()),this.kl=t,t){var r=this.newCanvas(t),e=t.pieces,u=this.Fr,s=Je.toPieceData(this.yl,e,u).then((function(i){return n.newLayer(t,r,u,e,i)}));return this.onSet(t,r),this.canvas=r,s}return Promise.resolve(null)}return Promise.resolve(this.canvas)},n.prototype.onSet=function(t,n){},n.prototype.newLayer=function(t,n,i,r,e){var u=this,s=new Sr(t,r,e,i,0),h=Je.newLayer(t,n.layer,s).then((function(t){return u.initLayer(n,t)}));if(this.xl){var o=this.toCanvasBaseBackgroundOptions(t,this.theme,!1);this.background.color=o.color,this.background.alpha=o.alpha}return h},n.prototype.initLayer=function(t,n,i){return t.layer.init(),t.initialize(n,i),st.update(this),this.emit("ready",this),t},n.prototype.toCanvasBaseOptions=function(t){var n,i=this.theme,r=this.xl;return{name:t.name,width:t.width,height:t.height,background:this.toCanvasBaseBackgroundOptions(t,i,r),border:r?{color:null}:void 0,outline:r?{color:null}:void 0,shadow:r?null:i.getCanvasShadow(),tile:{factory:this.Ll,mapping:null===(n=t.tile)||void 0===n?void 0:n.mapping},ambient:r}},n.prototype.toCanvasBaseBackgroundOptions=function(t,n,i){var r,e;if(i)return{color:null};var u=t.background;return{color:null!==(r=null==u?void 0:u.color)&&void 0!==r?r:n.getCanvasBackgroundColor(),alpha:null!==(e=null==u?void 0:u.alpha)&&void 0!==e?e:n.getCanvasBackgroundAlpha()}},n.prototype.onUnset=function(){},n.prototype.get=function(){return this.kl},Object.defineProperty(n.prototype,"layer",{get:function(){var t=this.canvas;return t?t.layer.active:null},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DDiagramBase"},n}(Dr),jm=function(){function t(t,n){this.ei=t,this.Pr=n}return t.prototype.getTheme=function(){return this.ei.getTheme()},t.prototype.setTheme=function(t){this.ei.setTheme(t)},t.prototype.getBaseColor=function(){return this.Pr},t.prototype.setBaseColor=function(t){this.Pr=t},t.prototype.getColor=function(t){var n=this.ei,i=this.Pr,r=n.getColor(t);return null!=i?null!=r?an.blend(i,r,n.getAlpha(t)):i:r},Object.defineProperty(t.prototype,"color",{get:function(){return this.ei.color},set:function(t){this.ei.color=t},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){return null!=this.Pr?1:this.ei.getAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.ei.alpha},set:function(t){this.ei.alpha=t},enumerable:!1,configurable:!0}),t}(),Nm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),Object.defineProperty(n.prototype,"lon",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lat",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!0}),n.prototype.toObject=function(){return{lon:this.x,lat:this.y}},n}(t.ObservablePoint),Im=function(){function t(t,n,i,r,e,u){if(this._l=t,!0===n||!1===n)this.O=n,this.Bt=new Nm(t,null,i,r),this.Pt=new Nm(t,null,e,u);else if(null!=n){this.O=n.enable;var s=n.from,h=n.to;this.Bt=new Nm(t,null,s.lon,s.lat),this.Pt=new Nm(t,null,h.lon,h.lat)}else this.O=!1,this.Bt=new Nm(t,null,-180,85.05112877980659),this.Pt=new Nm(t,null,180,-85.05112877980659)}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this._l())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.Bt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.Pt},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{enable:this.O,from:this.Bt.toObject(),to:this.Pt.toObject()}},t}(),Cm=function(){function t(t,n){var i=this;this.vr=t,this.Pl=null==n?void 0:n.factory,this.Jt=new Im((function(){i.onMappingChange()}),null==n?void 0:n.mapping)}return t.prototype.init=function(){this.onMappingChange()},t.prototype.onMappingChange=function(){var t=this.Pl;if(t){var n,i=this.Jt;i.enable?(n=this.Fl)?n.mapping=i:this.Fl=t(this.vr).fit():(n=this.Fl)&&(this.Fl=void 0,n.destroy())}},Object.defineProperty(t.prototype,"pyramid",{get:function(){return this.Fl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"factory",{get:function(){return this.Pl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapping",{get:function(){return this.Jt},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{mapping:this.Jt.serialize()}},t.prototype.destroy=function(){var t=this.Fl;null!=t&&(this.Fl=void 0,t.destroy())},t}(),Am=function(t){function n(n,i){var r=t.call(this)||this;return r.kh=null,r.kt=n,r.pn=i,r.interactive=!1,r.interactiveChildren=!1,r}return _(n,t),n.prototype.init=function(){if(null==this.kh){var t=this.children,n=t.length;0<n&&(this.kh=t[n-1])}},Object.defineProperty(n.prototype,"active",{get:function(){return this.kh},set:function(t){this.kh!==t&&(null==t||0<=this.children.indexOf(t))&&(this.kh=t,this.onLayerChange())},enumerable:!1,configurable:!0}),n.prototype.create=function(t,n){var i=new au(t);return this.attach(i,n),i},n.prototype.attach=function(t,n){this.addChild(t),!0===n&&(this.kh=t),this.onLayerChange(),st.update(this)},n.prototype.attachAt=function(t,n,i){this.addChildAt(t,n),!0===i&&(this.kh=t),this.onLayerChange(),st.update(this)},n.prototype.detach=function(t,n){var i=this.children,r=i.indexOf(t);0<=r&&(this.kh=n,i.splice(r,1),t.parent=void 0,this.onLayerChange(),st.update(this))},n.prototype.delete=function(t,n){var i=this.children,r=i.indexOf(t);return 0<=r&&(i.splice(r,1),t.parent=void 0,this.kh===t&&(!0===n?r<i.length?this.kh=i[r]:0<i.length?this.kh=i[r-1]:this.kh=null:this.kh=null),this.onLayerChange(),st.update(this)),r},n.prototype.get=function(t){var n=this.children[t];return null!=n?n:null},n.prototype.clear=function(){var t=this.children;if(0<t.length){for(var n=t.length-1;0<=n;--n){var i=t[n];i.parent=null,i.destroy()}t.length=0,this.onLayerChange(),st.update(this)}},n.prototype.destroy=function(){this._destroyed||(this.clear(),t.prototype.destroy.call(this))},n.prototype.size=function(){return this.children.length},n.prototype.onLayerChange=function(){this.emit("change",this)},n.prototype.serialize=function(t,n){for(var i=[],r=this.children,e=0,u=r.length;e<u;++e)r[e].addUuid(t);for(e=0,u=r.length;e<u;++e)r[e].updateUuid(t);for(e=0,u=r.length;e<u;++e)i.push(r[e].serialize(e,t,n));return i},n.prototype.deserialize=function(t,n){var i=t.length;if(0<i){for(var r=this.kt,e=this.pn,u=0;u<i;++u)this.addChild(au.deserialize(t[u],n,r,e));this.onLayerChange(),st.update(this)}},n}(t.Container),Rm=function(t){function n(n){var i=t.call(this,n)||this,r=i.theme;i.isAmbient(r,n)||(i.kn=new jm(i.kn,i.toBackgroundBase(r,n)));var e=new Am(i.width,i.height);i.bs=e,i.addChild(e);var u=new Cm(i,null==n?void 0:n.tile);return i.Ul=u,u.init(),i}return _(n,t),n.prototype.isAmbient=function(t,n){var i;return null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:t.isAmbient()},n.prototype.toBackgroundBase=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.background)||void 0===i?void 0:i.base)&&void 0!==r?r:t.getBackgroundBase()},Object.defineProperty(n.prototype,"tile",{get:function(){return this.Ul},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"layer",{get:function(){return this.bs},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t,n){},n.prototype.destroy=function(){this._destroyed||(this.onDestroy(),t.prototype.destroy.call(this))},n.prototype.onDestroy=function(){this.Ul.destroy(),this.bs.destroy()},n.prototype.hitTest=function(t,n){for(var i=this.bs.children,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible){var u=e.hitTest(t,n);if(null!=u)return u}}return null},n.prototype.getType=function(){return"DDiagramCanvasBase"},n}(sg),km=function(){function t(t){this.vr=t}return t.prototype.each=function(t,n){for(var i=this.vr.layer.children,r=0,e=i.length;r<e&&!1!==this.Zc(i[r].children,t,n);++r);return this},t.prototype.Zc=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(!1===n(u))return!1;if(i||jr.contains(u,Ct.CHILDREN)){var s=u.children;if(0<s.length&&!1===this.Zc(s,n,i))return!1}}},t}(),Lm=function(){function t(){}return Object.defineProperty(t.prototype,"private",{get:function(){var t=this.Zt;return null==t&&(t=this.newPrivate(),this.Zt=t),t},enumerable:!1,configurable:!0}),t.prototype.newPrivate=function(){return new Ht},Object.defineProperty(t.prototype,"protected",{get:function(){var t=this.Gl;return null==t&&(t=this.newProtected(),this.Gl=t),t},enumerable:!1,configurable:!0}),t.prototype.newProtected=function(){return new Ht},Object.defineProperty(t.prototype,"extended",{get:function(){var t=this.Hl;return null==t&&(t=this.newExtended(),this.Hl=t),t},enumerable:!1,configurable:!0}),t.prototype.newExtended=function(){return new Ht},Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Xt;if(null==t)return[];var n=[];return t.forEach((function(t,i){n.push(i)})),n},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Xt;if(null==n)return null;var i=null;return n.forEach((function(n,r){null==i&&!1===t(r)&&(i=r)})),i},t.prototype.add=function(t,n){var i,r=null!==(i=this.Xt)&&void 0!==i?i:this.Xt=new Map,e=r.get(t);null==e?r.set(t,[n]):e.push(n)},t.prototype.set=function(t,n,i,r,e,u){var s=this.Xt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.time=i),void 0!==r&&(c.state=r),void 0!==n&&(c.value=n)}return!0},t.prototype.get=function(t){var n=this.Xt;if(null==n)return null;var i=n.get(t);return null==i?null:i},t.prototype.clear=function(t){var n=this.Xt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].clear();return!0},t.prototype.toDirty=function(t){var n=this.Xt;if(null==n)return!1;var i=n.get(t);if(null==i)return!1;var r=i.length;if(r<=0)return!1;for(var e=0;e<r;++e)i[e].toDirty();return!0},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Xt;if(null==s)return!1;var h=s.get(t);if(null==h)return!1;var o=h.length;if(o<=0)return!1;for(var a=0;a<o;++a){var c=h[a];c.range.set(e,u),void 0!==i&&(c.times=i),void 0!==r&&(c.states=r),void 0!==n&&(c.values=n)}return!0},t.prototype.setValue=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].value=n;return!0},t.prototype.setValues=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].values=n;return!0},t.prototype.setTime=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].time=n;return!0},t.prototype.setTimes=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].times=n;return!0},t.prototype.setState=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].state=n;return!0},t.prototype.setStates=function(t,n){var i=this.Xt;if(null==i)return!1;var r=i.get(t);if(null==r)return!1;var e=r.length;if(e<=0)return!1;for(var u=0;u<e;++u)r[u].states=n;return!0},t.prototype.setRange=function(t,n,i){var r=this.Xt;if(null==r)return!1;var e=r.get(t);if(null==e)return!1;var u=e.length;if(u<=0)return!1;for(var s=0;s<u;++s){var h=e[s].range;void 0!==n&&(null!==n?(h.type|=Lt.FROM,h.from=n):h.type&=~Lt.FROM),void 0!==i&&(null!==i?(h.type|=Lt.TO,h.to=i):h.type&=~Lt.TO)}return!0},t}(),ym=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(km),xm=function(){function t(t,n,i){var r=this;this.p=t;var e=i.controller;this.yl=e;var u=function(){r.onChange()};e.grid.on("change",u),e.target.on("change",u);var s=new xe;s.visible=!1,this.Kc=s,t.addChildAt(s,t.children.length-1),this.zl=this.toGrid(n,i.grid),this.ei=this.toTarget(n,i.target)}return t.prototype.toGrid=function(t,n){var i;return{major:this.toGridMajor(t,null==n?void 0:n.major),minor:this.toGridMinor(t,null==n?void 0:n.minor),size:null!==(i=null==n?void 0:n.size)&&void 0!==i?i:t.getSnapGridSize()}},t.prototype.toGridMajor=function(t,n){var i,r,e,u,s;return{interval:null!==(i=null==n?void 0:n.interval)&&void 0!==i?i:t.getSnapGridMajorInterval(),color:null!==(r=null==n?void 0:n.color)&&void 0!==r?r:t.getSnapGridMajorColor(),alpha:null!==(e=null==n?void 0:n.alpha)&&void 0!==e?e:t.getSnapGridMajorAlpha(),width:null!==(u=null==n?void 0:n.width)&&void 0!==u?u:t.getSnapGridMajorWidth(),style:null!==(s=null==n?void 0:n.style)&&void 0!==s?s:t.getSnapGridMajorStyle()}},t.prototype.toGridMinor=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapGridMinorColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapGridMinorAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapGridMinorWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapGridMinorStyle()}},t.prototype.toTarget=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapTargetColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapTargetAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapTargetWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapTargetStyle()}},t.prototype.onChange=function(){var t=this.p;t.toDirty(),st.update(t)},Object.defineProperty(t.prototype,"container",{get:function(){return this.Kc},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return this.yl.serialize()},t.prototype.onReflow=function(){var t=this.p,n=this.Kc,i=this.yl,r=i.grid.visible,e=i.target.visible;if(r||e){var u=t.width,s=t.height,h=.5*u,o=.5*s,a=it.TOP,c=it.LEFT,f=n.children,l=0;if(r){for(var v=this.zl,b=v.major,d=v.minor,g=b.interval,m=v.size(i.grid.size,u,s),w=m,p=1;w<u;w+=m,p+=1,l+=1){var O=p%g==0?b:d;this.update(n,f,l,w,o,a,u,s,O)}for(var D=m,E=1;D<s;D+=m,E+=1,l+=1)O=E%g==0?b:d,this.update(n,f,l,h,D,c,u,s,O)}if(e)for(var M=i.target.values,S=this.ei,T=0,j=M.length;T<j;T+=1,l+=1){var N=M[T],I=N.position;N.type===Kv.VERTICAL?this.update(n,f,l,I,o,a,u,s,S):this.update(n,f,l,h,I,c,u,s,S)}for(T=l,j=f.length;T<j;++T)f[T].visible=!1;n.visible=!0}else n.visible=!1},t.prototype.update=function(t,n,i,r,e,u,s,h,o){var a=null;i<n.length?((a=n[i]).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate()):((a=new en).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate(),a.attach(t))},t}(),Bm=function(t){function n(n){var i=t.call(this,n)||this;return i.Vl=i.toSnap(i.theme,n.snap),i}return _(n,t),n.prototype.toSnap=function(t,n){return n?new xm(this,t,n):null},Object.defineProperty(n.prototype,"snap",{get:function(){return this.Vl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shape",{get:function(){var t=this.Xr;return null==t&&(t=this.newShape(),this.Xr=t),t},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){return new ym(this)},n.prototype.serialize=function(t,n){var i,r=new Vv,e=[],u=this.kn,s=u.color,h=u.alpha;return{version:1,id:t,name:this.name,width:this.width,height:this.height,background:{color:pt(s)?s:16777215,alpha:pt(h)?h:0},tile:this.Ul.serialize(),resources:r.resources,data:r.data,pieces:r.pieces,layers:this.bs.serialize(r,e),items:e,snap:null===(i=this.Vl)||void 0===i?void 0:i.serialize(),thumbnail:null==n?void 0:n.serialize()}},n.prototype.onReflow=function(){var n;t.prototype.onReflow.call(this),null===(n=this.Vl)||void 0===n||n.onReflow()},n.prototype.getType=function(){return"DDiagramCanvasEditor"},n}(Rm),_m=function(t){function n(n){var i=t.call(this,n)||this;return i.Xt=new Map,i}return _(n,t),n.prototype.add=function(t,n){var i=this.Xt,r=i.get(t);null==r?i.set(t,[n]):r.push(n)},n.prototype.get=function(t){var n=this.Xt.get(t);return n&&0<n.length?n[0]:null},n.prototype.getAll=function(t){return this.Xt.get(t)||[]},n}(km),Pm=function(){function t(t,n){var i=this;this.p=t,this.k=[],this.Z=n,this.q=function(){i.onTime()}}return t.prototype.add=function(t){this.k.push(t)},t.prototype.start=function(){null==this.$&&this.onTime()},t.prototype.getInterval=function(){var t=Date.now(),n=this.Z;return Math.max(0,n-t%n)},t.prototype.onTime=function(){var t=this.k;if(0<t.length){for(var n=Date.now()/this.Z,i=0,r=t.length;i<r;++i)t[i].value=n;st.update(this.p)}this.$=window.setTimeout(this.q,this.getInterval())},t.prototype.stop=function(){var t=this.$;null!=t&&(clearTimeout(t),this.$=void 0)},t}(),Fm=function(){function t(t){this.p=t,this.Xt=new Map}return t.prototype.add=function(t){var n=this.Xt,i=this.toNormalized(t),r=n.get(i);if(null!=r)return r;var e=new Pm(this.p,i);return n.set(i,e),e},t.prototype.toNormalized=function(t){return pt(t)?Math.max(1,Math.round(t)):1e3},t.prototype.start=function(){this.Xt.forEach((function(t){t.start()}))},t.prototype.stop=function(){this.Xt.forEach((function(t){t.stop()}))},t}(),Um="[]",Gm=function(){return 0},Hm=function(){return[]},zm=function(){return""},Vm=function(){return{}},Wm=function(){return!1},Xm=function(n){function i(t){var i=n.call(this,t)||this;return i.Xt=new Lm,i.Xr=new _m(i),i.et=new Fm(i),i.Wl=[],i.Xl=new Set,i.Da=function(){st.update(i)},i}return _(i,n),Object.defineProperty(i.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"shape",{get:function(){return this.Xr},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"ticker",{get:function(){return this.et},enumerable:!1,configurable:!0}),i.prototype.initialize=function(t,n){var i=this,r=this.Wl,e=this.Xt;this.Kl(t,null,null,n,new Map,new Map,new Map,this.et,this.Xr,e,r);for(var u=this.bs.children,s=u.length,h=0;h<s;++h)u[h].initialize(r);ln.isInitializing=!0;var o=Date.now();for(h=0;h<s;++h)u[h].update(o);ln.isInitializing=!1,e.extended.each((function(t){var n=Uv.getById(t);if(n){var r=n.start;r&&r(i)}})),this.et.start()},i.prototype.Kl=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=function(f,v){var b=t[f],d=b.id;0<d.length&&o.add(d,b),l.initData(b,n,i,r,e,u,h,a);var g=new(To[b.type]||su)(b);b.runtime=g,l.initActions(b,g,s),g.initialize(b);var m=b.shortcut;null!=m&&nr.on(b,m,(function(t){g.onClick(b,t)})),g.isActionable()&&c.push(b);var w=b.children;if(0<w.length){var p=n,O=i;b instanceof Br&&(null==p&&(p=b),O=b),l.Kl(w,p,O,r,e,u,s,h,o,a,c)}},l=this,v=0,b=t.length;v<b;++v)f(v)},i.prototype.initData=function(t,n,i,r,e,u,s,h){for(var o=t.data,a=0,c=o.size();a<c;++a){var f=o.get(a);if(null!=f)switch(f.type){case Bt.BOOLEAN:case Bt.BOOLEAN_ARRAY:case Bt.NUMBER:case Bt.NUMBER_ARRAY:case Bt.STRING:case Bt.STRING_ARRAY:case Bt.OBJECT:case Bt.OBJECT_ARRAY:this.initDataValue(f,t,n,i,r,e,u,h);break;case Bt.TICKER:this.initDataTicker(f,u,s);break;default:this.initDataExtension(f,h)}}},i.prototype.initDataValue=function(t,n,i,r,e,u,s,h){if(t.scope===_t.PRIVATE)0<(o=t.id).length&&(r?r.data.private.add(o,t):h.private.add(o,t));else if(t.scope===_t.PROTECTED)0<(o=t.id).length&&h.protected.add(o,t);else{var o;e&&e(t,i||n),0<(o=t.id).length&&h.add(o,t)}var a=t.format,c=t.initial,f=u.get(t.type);null==f&&(f=new Map,u.set(t.type,f));var l=f.get(a);if(null!=l)t.formatter=l;else if(0<a.length){var v=this.calcFormatter(t,a,c);f.set(a,v),t.formatter=v}var b=s.get(t.type);null==b&&(b=new Map,s.set(t.type,b));var d=b.get(c);if(null!=d)t.value=d();else{var g=this.calcInitial(t,c);b.set(c,g),t.value=g()}},i.prototype.initDataTicker=function(t,n,i){var r=t.initial,e=n.get(t.type);null==e&&(e=new Map,n.set(t.type,e));var u=e.get(r);if(void 0!==u)t.value=0,i.add(u()).add(t);else{var s=this.calcInitial(t,r);e.set(r,s),t.value=0,i.add(s()).add(t)}},i.prototype.initDataExtension=function(t,n){var i=Uv.get(t.type);i&&(n.extended.add(i.id,t),t.value=i.initial)},i.prototype.initActions=function(t,n,i){var r=t.action.values,e=n.actions,u=Rv.get(t.type);if(null!=u)for(var s=0,h=u.length;s<h;++s){var o=u[s];e.push(o),n.reset|=o.reset}for(s=0,h=r.length;s<h;++s){var a=r[s],c=i.get(a);null==c?null!=(c=a.toRuntime())&&(i.set(a,c),e.push(c),n.reset|=c.reset):(e.push(c),n.reset|=c.reset)}},i.prototype.calcFormatter=function(t,n,i){var r=this.toInitial(t);try{return Function("value","try {"+"return (".concat(n,");")+"} catch( e1 ) {try {"+"return (".concat(0<i.length?i:r,");")+"} catch( e2 ) {"+"return ".concat(r,";")+"}}")}catch(n){return this.toInitializer(t)}},i.prototype.calcInitial=function(t,n){if(n.length<=0)return this.toInitializer(t);try{return Function("try {"+"return (".concat(n,");")+"} catch( e ) {"+"return ".concat(this.toInitial(t),";")+"}")}catch(n){return this.toInitializer(t)}},i.prototype.toInitial=function(t){switch(t.type){case Bt.BOOLEAN:return"false";case Bt.BOOLEAN_ARRAY:return Um;case Bt.NUMBER:return"0";case Bt.NUMBER_ARRAY:return Um;case Bt.STRING:return'""';case Bt.STRING_ARRAY:return Um;case Bt.OBJECT:return"{}";case Bt.OBJECT_ARRAY:return Um;case Bt.TICKER:default:return"0"}},i.prototype.toInitializer=function(t){switch(t.type){case Bt.BOOLEAN:return Wm;case Bt.BOOLEAN_ARRAY:return Hm;case Bt.NUMBER:return Gm;case Bt.NUMBER_ARRAY:return Hm;case Bt.STRING:return zm;case Bt.STRING_ARRAY:return Hm;case Bt.OBJECT:return Vm;case Bt.OBJECT_ARRAY:return Hm;case Bt.TICKER:default:return Gm}},i.prototype.onDestroy=function(){var t=this;this.Xt.extended.each((function(n){var i=Uv.getById(n);if(i){var r=i.stop;r&&r(t)}})),this.et.stop(),n.prototype.onDestroy.call(this)},i.prototype.hitTestInteractives=function(t){for(var n=this.bs.children,i=n.length-1;0<=i;--i){var r=n[i];if(r.visible){var e=r.hitTestInteractives(t);if(null!=e)return e}}return null},i.prototype.onShapeMove=function(t){var n=this.hitTestInteractives(t.data.global);this.cursor=this.ii=this.toShapeCursor(n);var i=st.getLayer(this);if(i){var r=this.toShapeTitle(n),e=i.view;e.title!==r&&(e.title=r)}var u=this.Yl;if(this.Yl=n,n===u){if(null!=n){var s=n.runtime;s&&s.onMove(n,t)}}else this.onShapeOut(t,u,n),this.onShapeOver(t,n);return null!=n},i.prototype.toShapeCursor=function(t){if(null!=t)for(var n=t;;){var i=n.cursor;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof Rt))break;n=r}return"auto"},i.prototype.toShapeTitle=function(t){if(null!=t)for(var n=t;;){var i=n.title;if(null!=i&&0<i.length)return i;var r=n.parent;if(!(r instanceof Rt))break;n=r}return""},i.prototype.onShapeOut=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Rt;){var r=n.runtime;r&&r.onOut(n,t),n=n.parent}},i.prototype.onShapeOver=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Rt;){var r=n.runtime;r&&r.onOver(n,t),n=n.parent}},i.prototype.onShapeDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Jl=n,n){this.Xl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onDown(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeUp=function(t){var n=this.Xl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onUp(r,t);var u=r.parent;if(!(u instanceof Rt))break;r=u}}return this.onShapeCancel(t),null!=i},i.prototype.onShapeCancel=function(t){var n=this.Xl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onUpOutside(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}})),n.clear(),!0)},i.prototype.onShapeClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Jl===n){for(var i=n;;){var r=i.runtime;r&&r.onClick(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeDblClick=function(n,r){var e,u=null!==(e=i.WORK_DBLCLICK)&&void 0!==e?e:i.WORK_DBLCLICK=new t.Point;ir.toGlobal(n,r,u);var s=this.hitTestInteractives(u);if(s){for(var h=s;;){var o=h.runtime;o&&o.onDblClick(h,n,r);var a=h.parent;if(!(a instanceof Rt))break;h=a}return!0}return!1},i.prototype.onShapeRightClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Jl===n){for(var i=n;;){var r=i.runtime;r&&r.onRightClick(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeRightDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Jl=n,n){this.Xl.add(n);for(var i=n;;){var r=i.runtime;r&&r.onRightDown(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}return!0}return!1},i.prototype.onShapeRightUp=function(t){var n=this.Xl,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onRightUp(r,t);var u=r.parent;if(!(u instanceof Rt))break;r=u}}return this.onShapeRightCancel(t),null!=i},i.prototype.onShapeRightCancel=function(t){var n=this.Xl;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onRightUpOutside(i,t);var e=i.parent;if(!(e instanceof Rt))break;i=e}})),n.clear(),!0)},i.prototype.update=function(){var t=this.Wl;if(0<t.length){for(var n=-1,i=Date.now(),r=0,e=t.length;r<e;++r){var u=t[r];u.update(i);var s=u.runtime;if(s){var h=s.effect;i<h&&(n=n<0?h:Math.min(n,h))}}0<=n&&window.setTimeout(this.Da,n-Date.now())}},i.prototype.onRender=function(t){var n=this.Wl;if(0<n.length){for(var i=-1,r=Date.now(),e=0,u=n.length;e<u;++e){var s=n[e];s.onRender(r,t);var h=s.runtime;if(h){var o=h.effect;r<o&&(i=i<0?o:Math.min(i,o))}}0<=i&&window.setTimeout(this.Da,i-Date.now())}},i.prototype.getType=function(){return"DDiagramCanvas"},i}(Rm),Km=function(){function t(t){this.Zl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return null!=t?t.data.private.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.private.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.private.toDirty(t)},t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.private.each(t):null},t}(),Ym=function(){function t(t){this.Zl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return null!=t?t.data.protected.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.protected.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.protected.toDirty(t)},t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.protected.each(t):null},t}(),Jm=function(){function t(t){this.yl=t&&t.controller}return t.prototype.set=function(t,n){var i=this.yl;return!!i&&(i.write(t,n),!0)},t}(),Zm=function(){function t(t){this.Zl=t}return Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return null!=t?t.data.extended.ids:[]},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.extended.set(t,n,i,r,e,u)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.extended.toDirty(t)},t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.extended.each(t):null},t}(),qm=function(){function t(t,n){this.Zl=t,this.ql=n&&n.mapper||null,this.Ql=new Jm(n&&n.remote),this.Zt=new Km(t),this.Gl=new Ym(t),this.Hl=new Zm(t)}return t.prototype.update=function(){},Object.defineProperty(t.prototype,"mapper",{get:function(){return this.ql},set:function(t){this.ql=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remote",{get:function(){return this.Ql},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"private",{get:function(){return this.Zt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protected",{get:function(){return this.Gl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extended",{get:function(){return this.Hl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ids",{get:function(){var t=this.Zl.canvas;return t?t.data.ids:[]},enumerable:!1,configurable:!0}),t.prototype.each=function(t){var n=this.Zl.canvas;return null!=n?n.data.each(t):null},t.prototype.set=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.set(t,n,i,r,e,u)},t.prototype.get=function(t){var n=this.Zl.canvas;return null!=n?n.data.get(t):null},t.prototype.clear=function(t){var n=this.Zl.canvas;return null!=n&&n.data.clear(t)},t.prototype.toDirty=function(t){var n=this.Zl.canvas;return null!=n&&n.data.toDirty(t)},t.prototype.setAll=function(t,n,i,r,e,u){var s=this.Zl.canvas;return null!=s&&s.data.setAll(t,n,i,r,e,u)},t.prototype.setValue=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setValue(t,n)},t.prototype.setValues=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setValues(t,n)},t.prototype.setTime=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setTime(t,n)},t.prototype.setTimes=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setTimes(t,n)},t.prototype.setState=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setState(t,n)},t.prototype.setStates=function(t,n){var i=this.Zl.canvas;return null!=i&&i.data.setStates(t,n)},t.prototype.setRange=function(t,n,i){var r=this.Zl.canvas;return null!=r&&r.data.setRange(t,n,i)},t}(),Qm=function(){function t(t,n,i){this.Bl=t,this.vs=this.toIsEnabled(n,i),this.zn=this.toCreateAsUrlOptions(n,i)}return t.prototype.toIsEnabled=function(t,n){var i;return null!==(i=null==n?void 0:n.enable)&&void 0!==i?i:t.isThumbnailEnabled()},t.prototype.toSize=function(t,n){return void 0!==n?n:t.getThumbnailSize()},t.prototype.toCleanup=function(t,n){var i,r;return null==n||!0===n?{snap:!0,background:!0}:!1===n?{snap:!1,background:!1}:{snap:null===(i=n.snap)||void 0===i||i,background:null===(r=n.background)||void 0===r||r}},t.prototype.toCreateAsUrlOptions=function(t,n){return{size:this.toSize(t,null==n?void 0:n.size),cleanup:this.toCleanup(t,null==n?void 0:n.cleanup)}},Object.defineProperty(t.prototype,"enable",{get:function(){return this.vs},set:function(t){this.vs=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.zn.size},set:function(t){this.zn.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cleanup",{get:function(){return this.zn.cleanup},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){if(this.vs)return this.Bl.createAsUrl(this.zn)},t}(),$m=function(t){function n(n){var i=t.call(this,n)||this;i.Kt=!1,i.Kt=!1,yb.getCommandController().on("dirty",(function(){!0!==i.Kt&&(i.Kt=!0,i.emit("change",i))}));var r=i.theme;return i.$l=new Qv(i,r,null==n?void 0:n.snapper),i.tv=new Qm(i.Bl,r,null==n?void 0:n.thumbnail),i}return _(n,t),Object.defineProperty(n.prototype,"thumbnail",{get:function(){return this.tv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"snapper",{get:function(){return this.$l},enumerable:!1,configurable:!0}),n.prototype.toMode=function(t){return(null==t?void 0:t.mapping)?Tr.EDITOR_DATA_MAPPED:Tr.EDITOR},n.prototype.newCanvas=function(t){return new Bm(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){var n=this.toCanvasBaseOptions(t),i=this.$l,r=n.snap;return null==r?n.snap={controller:i}:null==r.controller&&(r.controller=i),n},n.prototype.serialize=function(){var t=this.canvas,n=this.kl;if(null!=t&&null!=n){this.emit("serializing",t,this);try{var i=t.serialize(n.id,this.tv);return this.emit("serialized",t,null,this),i}catch(n){return this.emit("serialized",t,"exception",this),null}}return null},n.prototype.save=function(){var t=this,n=this.serialize();if(null!=n){var i=this.yl;if(i){var r=Je.toSimple(n);return this.emit("saving",r,this),i.save(r).then((function(i){t.Kt=!1,n.id=i,t.kl=n,t.emit("change",t),t.emit("saved",null,t)}),(function(n){t.emit("saved",n,t)}))}return this.emit("saved","no-controller",this),Promise.reject()}return this.emit("saved",null,this),Promise.resolve()},n.prototype.saveAs=function(t){var n=this,i=this.serialize();if(null!=i){var r=this.yl;if(r){i.id=void 0,i.name=t;var e=Je.toSimple(i);return this.emit("saving",e,this),r.save(e).then((function(r){n.Kt=!1,i.id=r,n.kl=i;var e=n.canvas;null!=e&&(e.name=t),n.emit("change",n),n.emit("saved",null,n)}),(function(t){n.emit("saved",t,n)}))}return this.emit("saved","no-controller",this),Promise.reject("no-controller")}return this.emit("saved",null,this),Promise.resolve()},n.prototype.delete=function(){var t=this,n=this.kl;if(n&&null!=n.id){var i=this.yl;return i?(this.emit("deleting",this),i.delete(n.id).then((function(){var n=t.set(null);return t.emit("deleted",null,t),n}),(function(n){return t.emit("deleted",n,t),Promise.reject(n)}))):(this.emit("deleted","no-controller",this),Promise.reject("no-controller"))}return this.set(null),this.emit("deleted",null,this),Promise.resolve(null)},n.prototype.create=function(t,n,i){return this.set({version:1,id:void 0,name:t,width:n,height:i,resources:[],data:[],layers:[["Default layer"]],items:[],snap:void 0})},n.prototype.onSet=function(n,i){t.prototype.onSet.call(this,n,i);var r=n.snap,e=this.$l;null!=r?e.deserialize(r):e.reset(),this.xl&&(e.target.visible=!1,e.grid.visible=!1),this.Kt=!1,this.emit("change",this)},n.prototype.onUnset=function(){t.prototype.onUnset.call(this),this.Kt=!1,this.emit("change",this)},n.prototype.open=function(t){var n=this,i=this.yl;return i?(this.emit("opening",this),i.get(t).then((function(t){var i=n.set(Je.toSerialized(t));return n.emit("opened",null,n),i}),(function(t){return n.emit("opened",t,n),Promise.reject(t)}))):(this.emit("opened","no-controller",this),Promise.reject("no-controller"))},n.prototype.close=function(){return this.set(null)},n.prototype.isChanged=function(){return this.Kt||this.isNew()},n.prototype.isNew=function(){var t=this.kl;return null!=t&&null==t.id},n.prototype.getName=function(){var t=this.kl;return null!=t?t.name:null},n.prototype.getType=function(){return"DDiagramEditor"},n}(Tm),tw=function(t){function n(n){var i=t.call(this)||this;return i.Zl=n,i.Da=function(){st.update(n)},i}return _(n,t),n.prototype.update=function(){var t=this.Zl.canvas;t&&t.update()},n.prototype.onRender=function(t){var n=this.Zl.canvas;n&&n.onRender(t)},n.prototype.get=function(t){var n=this.Zl.canvas;return n?n.shape.get(t):null},n.prototype.getAll=function(t){var n=this.Zl.canvas;return n?n.shape.getAll(t):[]},n.prototype.each=function(t,n){void 0===n&&(n=!1);var i=this.Zl.canvas;if(null!=i){var r=i.layer.children;if(n){for(e=r.length-1;0<=e;--e)for(h=(s=r[e].children).length-1;0<=h;--h)if(!1===t(a=s[h]))return a}else for(var e=0,u=r.length;e<u;++e)for(var s,h=0,o=(s=r[e].children).length;h<o;++h){var a;if(!1===t(a=s[h]))return a}}return null},n}(t.utils.EventEmitter),nw=function(t){function n(n){var i=t.call(this,n)||this;i.on(ir.move,(function(t){i.onShapeMove(t)})),i.on(ir.up,(function(t){i.onShapeUp(t)})),i.on(ir.upoutside,(function(t){i.onShapeCancel(t)})),i.on(ir.cancel,(function(t){i.onShapeCancel(t)})),i.on(ir.tap,(function(t){i.onShapeClick(t)})),i.on(ir.righttap,(function(t){i.onShapeRightClick(t)})),i.on(ir.rightdown,(function(t){i.onShapeRightDown(t)})),i.on(ir.rightup,(function(t){i.onShapeRightUp(t)})),i.on(ir.rightupoutside,(function(t){i.onShapeRightCancel(t)}));var r=new qm(i,n&&(n.data||n.tag));return i.data=r,i.tag=r,i.shape=new tw(i),i}return _(n,t),n.prototype.initLayer=function(n,i,r){return t.prototype.initLayer.call(this,n,i,r||this.data.mapper)},n.prototype.toMode=function(t){return Tr.VIEWER},n.prototype.newCanvas=function(t){return new Xm(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){return this.toCanvasBaseOptions(t)},n.prototype.onDown=function(n){var i=this.canvas;i?t.prototype.onDown.call(this,n,i.onShapeDown(n)):t.prototype.onDown.call(this,n)},n.prototype.onShapeMove=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeMove(t)}},n.prototype.onShapeUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeUp(t)}},n.prototype.onShapeCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeCancel(t)}},n.prototype.onShapeClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeClick(t)}},n.prototype.onShapeRightClick=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightClick(t)}},n.prototype.onShapeRightDown=function(t){var n=this.canvas;n&&n.onShapeRightDown(t)},n.prototype.onShapeRightUp=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightUp(t)}},n.prototype.onShapeRightCancel=function(t){var n=this.canvas;if(n){var i=t.target;i!==this&&i!==n||n.onShapeRightCancel(t)}},n.prototype.onDblClick=function(n,i){var r=this.canvas;return r?t.prototype.onDblClick.call(this,n,i,r.onShapeDblClick(n,i)):t.prototype.onDblClick.call(this,n,i)},n.prototype.render=function(n){this.shape.onRender(n),t.prototype.render.call(this,n)},n.prototype.getType=function(){return"DDiagram"},n}(Tm),iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmMessage"},n}(Nl),rw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newContentChildren=function(n,i){var r=t.prototype.newContentChildren.call(this,n,i);return r.push(this.message),r},n.prototype.toMessage=function(t,n){var i=null==n?void 0:n.message;return null!=i?Ot(i)||wt(i)?this.newMessage(this.toMessageOptions(i)):i instanceof hr?i:this.newMessage(this.toMessageOptionsMerged(i,t.getMessage())):this.newMessage(this.toMessageOptions(t.getMessage()))},n.prototype.toMessageOptionsMerged=function(t,n){var i=t.text;return null==i&&(i={},t.text=i),void 0===i.value&&(i.value=n),t},n.prototype.toMessageOptions=function(t){return{text:{value:t}}},n.prototype.newMessage=function(t){return new iw(t)},Object.defineProperty(n.prototype,"message",{get:function(){var t=this.nv;return null==t&&(t=this.toMessage(this.theme,this.zn),this.nv=t),t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){},n.prototype.getType=function(){return"DDialogConfirm"},n}(xs),ew=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDelete"},n}(rw),uw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDiscard"},n}(rw),sw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogMessage"},n}(rw),hw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogProcessingMessage"},n}(iw),ow=function(t){function n(n){var i,r=this;(r=t.call(this,n)||this).iv=!0,r.si=0;var e=null==n?void 0:n.delay;r.rv=null!==(i=null==e?void 0:e.done)&&void 0!==i?i:r.theme.getDoneDelay();var u=null==e?void 0:e.close;return r.ev=void 0!==u?u:r.theme.getCloseDelay(),r.uv=r.message.text,r}return _(n,t),n.prototype.newMessage=function(t){return new hw(t)},n.prototype.onOpen=function(){this.iv=!1,this.si=Date.now();var n=this.$;null!=n&&clearTimeout(n);var i=this.sv;null!=i&&clearTimeout(i);var r=this.message;r.text=this.uv,r.state.removeAll(ct.SUCCEEDED,ct.FAILED);var e=this.Ih;null!=e&&e.hide(),t.prototype.onOpen.call(this)},n.prototype.onDone=function(t){var n=this;null!=t?this.sv=window.setTimeout((function(){n.close()}),t):this.close()},n.prototype.onResolved=function(t){null!=t&&(this.message.text=t),this.message.state.set(ct.SUCCEEDED,ct.FAILED);var n=this.ev;if(null!=n)this.onDone(n);else{var i=this.Ih;null!=i?i.show():this.close()}},n.prototype.onRejected=function(t){null!=t&&(this.message.text=t),this.message.state.set(ct.FAILED,ct.SUCCEEDED);var n=this.Ih;null!=n?n.show():this.onDone(this.ev)},n.prototype.resolve=function(t){var n=this;if(!this.iv){this.iv=!0;var i=Date.now()-this.si,r=this.rv-i;0<r?this.$=window.setTimeout((function(){n.$=void 0,n.onResolved(t)}),r):this.onResolved(t)}},n.prototype.reject=function(t){var n=this;if(!this.iv){this.iv=!0;var i=Date.now()-this.si,r=this.rv-i;0<r?this.$=window.setTimeout((function(){n.$=void 0,n.onRejected(t)}),r):this.onRejected(t)}},n.prototype.onCloseOn=function(){this.iv&&t.prototype.onCloseOn.call(this)},n.prototype.getType=function(){return"DDialogProcessing"},n}(rw),aw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(){var n=yb.getDocumentController().getName();null!=n&&(this.input.value=n),t.prototype.onOpen.call(this)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=yb.getCommandController();Ot(n)?i.push(new Em(n)):n.then((function(t){i.push(new Em(t))}))},n.prototype.getType=function(){return"DDialogSaveAs"},n}(nh),cw=function(){function t(t){this.hv=t,this.ov=[]}return t.prototype.indexOf=function(t){return this.ov.indexOf(t)},t.prototype.close=function(t){for(var n=this.ov,i=Math.max(0,t),r=n.length-1;i<=r;--r)n[r].close()},t.prototype.add=function(t){this.ov.push(t)},t.prototype.trim=function(t){this.close(this.indexOf(t)+1)},t.prototype.remove=function(t){var n=this.indexOf(t);0<=n&&(this.close(n+1),this.ov.splice(n,1))},t}(),fw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u=this;t.prototype.init.call(this,n),this.ws=function(){u.onPrerender()},this.Lt=Ai(null!==(i=null==n?void 0:n.align)&&void 0!==i?i:Bu.BOTTOM,Bu),this.av=null!==(r=null==n?void 0:n.fit)&&void 0!==r&&r,this.ps=null!==(e=null==n?void 0:n.sticky)&&void 0!==e&&e,this.cv=!1,this.hv=null,this.ea=null,this.visible=!1,zu.apply(this,(function(){u.close()})),this.on("select",(function(){u.close()}));var s=null==n?void 0:n.items;s&&yl.newItems(this,s,this.ps),this.Ds=new Vu(n)},n.prototype.findItem=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof Cl&&e.value===t)return e}return null},n.prototype.getType=function(){return"DMenu"},n.prototype.getContext=function(){return this.ea},n.prototype.getCloseable=function(){return this},n.prototype.open=function(n,i,r){if(this.isHidden()){var e=this.Ds.pick(this);this.hv=n;for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof hr&&o.state.removeAll(ct.FOCUSED,ct.HOVERED)}var a=e.renderer,c=this.ws;if(this.ps?a.on("prerender",c):a.once("prerender",c),this.av){var f=n.getBounds();null!=f&&(this.width=f.width)}this.cv=null!=r,r=r||new cw(n),null!=i&&r.trim(i),r.add(this),this.ea=r,e.stage.addChild(this),this.Es=e.getFocusController().get(),this.focus(),t.prototype.show.call(this),this.emit("open",this)}return this},n.prototype.onPrerender=function(){var t=this.hv;if(t){var n=t.getBounds();if(n){this.av&&(this.width=n.width);var i=this.Ds.picked;if(i){var r=this.theme;_u.attach(this,n,r.getOffsetX(),r.getOffsetY(),i.width,i.height,this.Lt)}}}},n.prototype.close=function(){if(this.isShown()){var n=this.ea;n&&n.remove(this);var i=this.Ds.picked;i&&i.renderer.off("prerender",this.ws),this.hv=null;var r=this.Es;if(null!=r)if(this.Es=null,i){var e=st.getLayer(r);null!=e&&i!==e&&e.view.focus(),i.getFocusController().focus(r)}else this.blur(!0);else this.blur(!0);t.prototype.hide.call(this);var u=this.parent;u&&u.removeChild(this),this.emit("close",this)}return this},n.prototype.onKeyDown=function(n){return nr.moveFocusVertically(n,this,this.Ds),this.state.isActionable&&(nr.isArrowLeftKey(n)||nr.isCancelKey(n))&&this.close(),t.prototype.onKeyDown.call(this,n)},n.prototype.containsGlobalPoint=function(t){return!this.cv},n}(Zu);yl.setMenuCreator((function(t){return new fw(t)}));var lw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this)},n.prototype.onMenuClose=function(t){if(t){var n=this.fv;n&&t.off("select",n);var i=this.lv;i&&t.off("close",i)}},n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof fw?i:new fw(this.toMenuOptions(t,i))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!0),n):{fit:!0}},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this.Po;return null==t&&(t=this.toMenu(this.theme,this.zn),this.Po=t),t},set:function(t){var n=this.Po;n!=t&&(this.Po=t,this.onMenuReplaced(t,n))},enumerable:!1,configurable:!0}),n.prototype.onMenuReplaced=function(t,n){null!=n&&this.onMenuClose(n)},n.prototype.getType=function(){return"DDropdownBase"},n.prototype.onKeyDown=function(n){return nr.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.activate(t),0))},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){var t=this,n=this.menu;if(n.isHidden()){var i=this.fv;null==i&&(i=function(n,i,r){t.onMenuSelect(n,i,r)},this.fv=i);var r=this.lv;null==r&&(r=function(){t.onMenuClose(t.Po)}),n.on("select",i),n.on("close",r),n.open(this),this.emit("open",n,this)}},n.prototype.close=function(){this.menu.close()},n}(js),vw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDropdown"},n}(lw),bw=function(t){function n(n){var i=t.call(this,n)||this;return i.on(ir.down,(function(t){i.state.isActionable&&i.onSelect(t)})),i}return _(n,t),n.prototype.onSelect=function(t){this.emit("select",this)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},n.prototype.getType=function(){return"DExpandableHeader"},n}(Nl),dw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i=this;n.prototype.init.call(this,t);var r=this.theme,e=this.toHeader(r,t);this.jh=e,e.on("select",(function(){i.toggle()})),this.addChild(e);var u=this.toBody(r,t);this.Ie=u,this.addChild(u),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.toHeader=function(n,i){return i&&i.header?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new bw(n)},i.prototype.toBody=function(t,n){return n.body},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.Ie;t instanceof hr?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.Ie;t instanceof hr?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.getType=function(){return"DExpandable"},i}(Zu),gw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new Ys(t)},n}(Xb),mw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Ob(this,this.newOperation(),this.theme,this.zn)},n.prototype.getType=function(){return"DInputTextArea"},n}(Ws),ww=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DListItemAmbient"},n}(pd),pw=function(){function t(t){void 0===t&&(t=256),this.vv=t}return t.prototype.getTileSize=function(){return this.vv},t.prototype.lonLatToMeters=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x*r/180,i.y=Math.log(Math.tan((90+n.y)*Math.PI/360))*r/Math.PI,i},t.prototype.metersToLonLat=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x/r*180,i.y=360*Math.atan(Math.exp(n.y*Math.PI/r))/Math.PI-90,i},t.prototype.pixelsToMeters=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=n.x*u-s,e.y=s-n.y*u,e},t.prototype.metersToPixels=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=(n.x+s)/u,e.y=(s-n.y)/u,e},t.prototype.pixelsToTile=function(t,n,i){return i.x=Math.ceil(t.x/n)-1,i.y=Math.ceil(t.y/n)-1,i},t.prototype.metersToTile=function(n,i,r){var e=t.CIRCUMFERENCE_HALF,u=1<<i;return r.x=Math.ceil(.5*(n.x/e+1)*u)-1,r.y=Math.ceil(.5*(1-n.y/e)*u)-1,r},t.prototype.lonLatToTile=function(t,n,i){return this.metersToTile(this.lonLatToMeters(t,i),n,i)},t.prototype.lonLatToPixels=function(t,n,i,r){return this.metersToPixels(this.lonLatToMeters(t,r),n,i,r)},t.prototype.pixelsToLonLat=function(t,n,i,r){return this.metersToLonLat(this.pixelsToMeters(t,n,i,r),r)},t.prototype.tileToPixels=function(t,n,i){return i.x=t.x*n,i.y=t.y*n,i},t.prototype.tileToMeters=function(n,i,r){var e=this.toResolutionMeter(i),u=t.CIRCUMFERENCE_HALF;return r.x=n.x*e+u,r.y=u-n.y*e,r},t.prototype.toResolutionMeter=function(n){return 2*t.CIRCUMFERENCE_HALF/(1<<n)},t.prototype.toResolution=function(n,i){return 2*t.CIRCUMFERENCE_HALF/(i<<n)},t.prototype.toTileCount=function(t){return 1<<t},t.prototype.toTileCode=function(t,n,i){return(n<<t)+i},t.CIRCUMFERENCE_HALF=6378137*Math.PI,t}(),Ow=function(){function t(){}return Object.defineProperty(t,"DEFAULT",{get:function(){return null==this.Wr&&(this.Wr=new pw),this.Wr},enumerable:!1,configurable:!0}),t}(),Dw=function(){function n(n,i,r,e,u,s){this.tx=i,this.ty=r;var h=new t.Sprite(t.Texture.EMPTY);h.parent=n,h.position.set(e,u),h.scale.set(s,s),this.bv=h}return n.prototype.load=function(n,i){var r=t.Texture.from(n,{resolution:1});this.bv.texture=r,r.valid?i():r.on("update",i)},n.prototype.transform=function(t,n,i){var r=this.bv;r.position.set(t,n),r.scale.set(i,i)},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.bv.texture.valid},enumerable:!1,configurable:!0}),n.prototype.render=function(t){var n=this.bv;n.updateTransform(),n.render(t)},n.prototype.destroy=function(){var n=this.bv,i=n.texture,r=i.baseTexture.resource,e=null;r instanceof t.resources.BaseImageResource&&r.source instanceof HTMLImageElement&&(e=r.source),i.destroy(!0),n.destroy(),e&&(e.src="")},n}(),Ew=function(){function n(t,n,i,r,e,u){var s=this;this.p=t,this.uu=n,this.dv=u,this.gv=!1,this.mv=!0,this.wv=function(){s.onLoaded()},this.pv=i,this._lon0=NaN,this._lat0=NaN,this._lon1=NaN,this._lat1=NaN,this.Ov=new Map,this.Dv=function(t){s.renderTile(t)},this.Ev=NaN,this.Mv=NaN,this.Sv=NaN,this.Tv=NaN,this.jv=function(t,n,i){s.deleteTile(t,n,i)},this.Nv=function(t){s.destroyTile(t)},this.Iv=function(t){t.loaded||(s.Cv=!1)},this.Av=e.toTileCount(i),this.Rv=1/this.Av,this.kv=r.scale*this.Rv,this.vv=e.getTileSize()*r.scale,this.Jt=r,this.rl=e,this.Cv=!0}return n.prototype.newTile=function(t,n,i,r,e){return new Dw(this.p,t,n,i,r,e)},n.prototype.renderTile=function(t){t.render(this.eu)},Object.defineProperty(n.prototype,"tz",{get:function(){return this.pv},enumerable:!1,configurable:!0}),n.prototype.render=function(t){this.eu=t,this.Ov.forEach(this.Dv)},n.prototype.move=function(t,i,r,e){var u=this._lon0,s=this._lat0,h=this._lon1,o=this._lat1;if(u!==t||s!==i||h!==r||o!==e){this._lon0=t,this._lat0=i,this._lon1=r,this._lat1=e;var a=this.pv,c=this.rl,f=n.WORK;f.set(t,i),c.lonLatToTile(f,a,f);var l=f.x,v=f.y;f.set(r,e),c.lonLatToTile(f,a,f);var b=f.x,d=f.y,g=this.Av,m=Math.max(0,l),w=Math.min(g-1,b),p=Math.max(0,v),O=Math.min(g-1,d),D=m-this.Ev,E=w-this.Mv,M=p-this.Sv,S=O-this.Tv,T=D!=D||D<0||1<D,j=E!=E||0<E||E<-1,N=M!=M||M<0||1<M,I=S!=S||0<S||S<-1;if(T||j||N||I){T?this.Ev=m:m=this.Ev,j?this.Mv=w:w=this.Mv,N?this.Sv=p:p=this.Sv,I?this.Tv=O:O=this.Tv,this.Ov.forEach(this.jv);var C=m+w>>1,A=p+O>>1,R=Math.max(C-m,w-C),k=Math.max(A-p,O-A),L=Math.max(R,k);this.toOffset(f);var y=f.x,x=f.y;this.gv=!1,this.mv=!1,this.loadTile(a,C,A,y,x,f);for(var B=1;B<=L;++B){var _=C-B;m<=_&&this.loadTilesY(a,_,A,B,p,O,y,x,f);var P=C+B;P<=w&&this.loadTilesY(a,P,A,B,p,O,y,x,f);var F=A-B;p<=F&&this.loadTilesX(a,C,B-1,m,w,F,y,x,f);var U=A+B;U<=O&&this.loadTilesX(a,C,B-1,m,w,U,y,x,f)}this.mv=!0,this.gv&&this.onLoaded()}}},n.prototype.loadTilesX=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,u,s,h,o);for(var a=1;a<=i;++a){var c=n-a;r<=c&&this.loadTile(t,c,u,s,h,o);var f=n+a;f<=e&&this.loadTile(t,f,u,s,h,o)}},n.prototype.loadTilesY=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,i,s,h,o);for(var a=1;a<=r;++a){var c=i-a;e<=c&&this.loadTile(t,n,c,s,h,o);var f=i+a;f<=u&&this.loadTile(t,n,f,s,h,o)}},n.prototype.loadTile=function(t,n,i,r,e,u){var s=this.rl.toTileCode(t,n,i),h=this.Ov,o=h.get(s);null==o&&(this.toTilePosition(n,i,r,e,u),o=this.newTile(n,i,u.x,u.y,this.kv),h.set(s,o),o.load(this.uu(t,n,i),this.wv),this.Cv=!1)},n.prototype.toTilePosition=function(t,n,i,r,e){var u=this.vv,s=this.Rv;return e.set(t,n),this.rl.tileToPixels(e,u,e),e.set(e.x*s+i,e.y*s+r),e},n.prototype.toOffset=function(t){var n=this.p,i=this.Jt,r=this.vv;return t.set(-i.x*r+.5*n.width,-i.y*r+.5*n.height),t},n.prototype.deleteTile=function(t,n,i){var r=t.tx,e=t.ty;(r<this.Ev||this.Mv<r||e<this.Sv||this.Tv<e)&&(i.delete(n),t.destroy())},n.prototype.destroy=function(){var t=this.Ov;t.forEach(this.Nv),t.clear()},n.prototype.destroyTile=function(t){t.destroy()},n.prototype.updateLoadingState=function(){this.Cv=!0,this.Ov.forEach(this.Iv)},n.prototype.onLoaded=function(){this.mv?this.dv():this.gv=!0},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.Cv||this.updateLoadingState(),this.Cv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mapping",{get:function(){return this.Jt},set:function(t){var i=this,r=this.rl,e=t.scale*this.Rv,u=r.getTileSize()*t.scale;this.kv=e,this.vv=u,this.Jt=t;var s=n.WORK;this.toOffset(s);var h=s.x,o=s.y;this.Ov.forEach((function(t){i.toTilePosition(t.tx,t.ty,h,o,s),t.transform(s.x,s.y,e)}))},enumerable:!1,configurable:!0}),n.WORK=new t.Point,n}(),Mw=function(n){function i(t){var i=n.call(this)||this,r=t.canvas;i.vr=r,i.uu=t.builder;var e=t.mapping;i.Jt=e;var u=t.coordinate;i.rl=u,i.Lv=i.toMapping(r,e,u),i._z=NaN,i.pv=NaN,i.yv=t.plane.min,i.xv=t.plane.max,i.Bv=[],i.wv=function(){i.onLoaded()},i._v=function(){i.Pv=void 0,i.fit()},i.Fv=t.plane.throttle;var s=function(){i.fitThrottled()};return i.Uv=s,r.on("scale",s),r.on("move",s),r.snippet.add(i,!0),i}return _(i,n),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.rl},enumerable:!1,configurable:!0}),i.prototype.fitThrottled=function(){null==this.Pv&&(this.Pv=window.setTimeout(this._v,this.Fv))},i.prototype.toMapping=function(t,n,r){var e=i.WORK_LONLAT,u=r.getTileSize();e.set(n.from.lon,n.from.lat),r.lonLatToPixels(e,0,u,e);var s=e.x,h=e.y;e.set(n.to.lon,n.to.lat),r.lonLatToPixels(e,0,u,e);var o=e.x,a=e.y,c=Math.abs(o-s),f=Math.abs(a-h),l=1e-7,v=1;return l<c?v=l<f?Math.max(t.width/c,t.height/f):t.width/c:l<f&&(v=t.height/f),{scale:v,x:.5*(o+s)/u,y:.5*(a+h)/u}},Object.defineProperty(i.prototype,"mapping",{get:function(){return this.Jt},set:function(t){var n=this.Lv,i=this.toMapping(this.vr,t,this.rl),r=1e-7;if(r<Math.abs(n.scale-i.scale)||r<Math.abs(n.x-i.x)||r<Math.abs(n.y-i.y)){this.Lv=i;for(var e=this.Bv,u=0,s=e.length;u<s;++u){var h=e[u];h&&(h.mapping=i)}st.update(this.vr),this.Uv()}},enumerable:!1,configurable:!0}),i.prototype.newPlane=function(t){return new Ew(this.vr,this.uu,t,this.Lv,this.rl,this.wv)},i.prototype.render=function(t){for(var n=this.pv,i=this.Bv,r=0;r<n;++r)null!=(e=i[r])&&e.render(t);for(r=i.length-1;n<r;--r){var e;null!=(e=i[r])&&e.render(t)}var u=i[n];null!=u&&u.render(t)},i.prototype.toTileZ=function(t){return Math.min(this.xv,Math.max(this.yv,Math.floor(t)))},i.prototype.updateTransform=function(){},i.prototype.toZ=function(t){return Math.log(this.Lv.scale*t)/Math.log(2)},i.prototype.move=function(t,n,i,r,e){var u=this.Bv,s=this.toZ(t);if(this._z!==s){this._z=s;var h=this.toTileZ(s);if(this.pv!==h){this.pv=h;var o=u[h];null==o&&(o=this.newPlane(h),u[h]=o)}}var a=u[this.pv];return null!=a&&a.move(n,i,r,e),this},i.prototype.fit=function(){var t=this.vr;if(null!=t){var n=t.parent;if(null!=n){var r=t.scale,e=r.x,u=r.y,s=t.x,h=t.y,o=this.rl,a=this.Lv,c=o.getTileSize()*a.scale,f=a.x*c-(s/e+.5*t.width),l=f+n.width/e,v=a.y*c-(h/u+.5*t.height),b=v+n.height/u,d=i.WORK_LONLAT;d.set(f,v),o.pixelsToLonLat(d,0,c,d);var g=d.x,m=d.y;d.set(l,b),o.pixelsToLonLat(d,0,c,d);var w=d.x,p=d.y;this.move(e,g,m,w,p)}}return this},i.prototype.destroyPlanesBefore=function(t,n){for(var i=0;i<t;++i){var r=n[i];r&&(r.destroy(),n[i]=void 0)}},i.prototype.destroyPlanesAfter=function(t,n){for(var i=t+1,r=n.length;i<r;++i){var e=n[i];e&&(e.destroy(),n[i]=void 0)}},i.prototype.cleanup=function(){var t=this.pv,n=this.Bv,i=n[t];if(i&&i.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(t,n);for(var r=t+1,e=n.length;r<e;++r)if((u=n[r])&&u.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(r,n);for(r=t-1;0<=r;--r){var u;if((u=n[r])&&u.loaded)return void this.destroyPlanesBefore(r,n)}},i.prototype.onLoaded=function(){this.cleanup(),st.update(this.vr)},i.prototype.destroy=function(){for(var t=this.Bv,n=0,i=t.length;n<i;++n){var r=t[n];r&&(r.destroy(),t[n]=void 0)}var e=this.vr,u=this.Uv;return e.off("scale",u),e.off("move",u),e.snippet.remove(this,!0),this},i.WORK_LONLAT=new t.Point,i}(t.utils.EventEmitter),Sw=function(t,n,i){return"https://j.tile.openstreetmap.jp/".concat(t,"/").concat(n,"/").concat(i,".png")},Tw=function(){function t(){}return t.toPlaneOptions=function(t){var n,i,r,e=t.plane;return{min:null!==(n=null==e?void 0:e.min)&&void 0!==n?n:this.MIN,max:null!==(i=null==e?void 0:e.max)&&void 0!==i?i:this.MAX,throttle:null!==(r=null==e?void 0:e.throttle)&&void 0!==r?r:this.THROTTLE}},t.from=function(t){return new Mw({canvas:t.canvas,builder:t.builder||Sw,mapping:t.canvas.tile.mapping,coordinate:t.coordinate||Ow.DEFAULT,plane:this.toPlaneOptions(t)})},t.MIN=0,t.MAX=18,t.THROTTLE=333,t}(),jw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof fw?i:new fw(this.toMenuOptions(t,i))},n.prototype.newMenu=function(t,n){return new fw(this.toMenuOptions(t,n))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!1),n):{fit:!1}},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){this.menu.open(this)},n.prototype.close=function(){this.menu.close()},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this,n=this.Po;return null==n&&((n=this.toMenu(this.theme,this.zn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Po=n),n},enumerable:!1,configurable:!0}),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this);var r=this.parent;r&&r.emit("select",t,n,r)},n.prototype.onKeyDown=function(n){return nr.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onActivate(t),0))},n.prototype.getType=function(){return"DMenuBarItem"},n}(Ns),Nw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t);var i=null==t?void 0:t.items;if(i)for(var r=0,e=i.length;r<e;++r){var u=this.toItem(i[r]);u&&this.addChild(u)}},i.prototype.toItem=function(n){return null==n?null:n instanceof t.DisplayObject?n:"space"in n?new Ku(n):new jw(n)},i.prototype.onKeyDown=function(t){return nr.moveFocusHorizontally(t,this),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuBar"},i}(Cs),Iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DMenuSidedContent"},n}(Cs),Cw={NONE:0,SINGLE:1,SINGLE_ONCE:2},Aw=function(){return!0},Rw=function(n){function i(t,i){var r,e,u,s=this;(s=n.call(this)||this).Nh=t,s.$c=null,s.En=!0,s.xt=Ai(null!==(e=null!==(r=null==i?void 0:i.mode)&&void 0!==r?r:null==i?void 0:i.type)&&void 0!==e?e:Cw.SINGLE_ONCE,Cw),s.pf=null!==(u=null==i?void 0:i.filter)&&void 0!==u?u:s.getFilterDefault();var h=null==i?void 0:i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return _(i,n),i.prototype.first=function(){return this.$c},i.prototype.toDirty=function(){this.En=!0},i.prototype.update=function(){this.En&&(this.En=!1,this.eh(this.Nh))},i.prototype.hasMenu=function(t){return t&&t.menu instanceof fw},i.prototype.eh=function(n){for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u instanceof Il&&u.state.isActive&&this.Gv(u,!1),u instanceof t.Container&&this.eh(u),this.hasMenu(u)&&this.eh(u.menu)}},i.prototype.add=function(t){this.update(),this.Gv(t,!0)},i.prototype.set=function(t){this.update(),this.Gv(t,!0)},i.prototype.get=function(t){return this.update(),this.$c},i.prototype.getIndex=function(t){return null},i.prototype.size=function(){return this.$c?1:0},i.prototype.isEmpty=function(){return null==this.$c},i.prototype.remove=function(t){this.update(),this.$c===t&&this.Gv(null,!0)},i.prototype.clear=function(){this.update(),this.Gv(null,!0)},i.prototype.getFilterDefault=function(){return Aw},i.prototype.Gv=function(t,n){var i=this.$c,r=this.xt;r!==Cw.NONE&&this.pf(t)&&i!==t&&(this.setState(i,r,!1),this.$c=t,this.setState(t,r,!0),n&&this.emit("change",this))},i.prototype.setState=function(t,n,i){t&&(n===Cw.SINGLE?t.state.isActive=i:i?t.state.addAll(ct.ACTIVE,ct.READ_ONLY):t.state.removeAll(ct.ACTIVE,ct.READ_ONLY))},i}(t.utils.EventEmitter),kw=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=new cw(r);r.ea=e,e.add(r);var u=null==n?void 0:n.items;if(null!=u){var s=null!==(i=null==n?void 0:n.sticky)&&void 0!==i&&i;r.newItems(u,s)}var h=null==n?void 0:n.selection;return r.tf=h instanceof Rw?h:r.newSelection(h),r}return _(n,t),n.prototype.newSelection=function(t){return new Rw(this.content,t)},n.prototype.onHierarchyDirty=function(){var n=this.tf;null!=n&&n.toDirty(),t.prototype.onHierarchyDirty.call(this)},n.prototype.newItems=function(t,n){mv.newItems(this.content,t,n)},n.prototype.newContent=function(t){return new Iw(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),n.prototype.getContext=function(){return this.ea},n.prototype.getCloseable=function(){return this},n.prototype.open=function(){},n.prototype.close=function(){},n.prototype.onKeyDown=function(n){return nr.moveFocusVertically(n,this),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DMenuSided"},n}(zd),Lw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteError"},n}(Yd),yw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteNoItemsFound"},n}(Yd),xw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSearching"},n}(Yd),Bw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(hr),_w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonLast"},n}(Rs),Pw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonNext"},n}(Rs),Fw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonPage"},n}(Rs),Uw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonPrevious"},n}(Rs),Gw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationButtonTop"},n}(Rs),Hw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationDots"},n}(Ts),zw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationPage"},n}(Ts),Vw=function(t){function n(n){var i,r,e,u,s=this;s=t.call(this,n)||this,null!=n?(s.j=null!==(r=null!==(i=n.size)&&void 0!==i?i:n.total)&&void 0!==r?r:10,s.Ut=null!==(u=null!==(e=n.value)&&void 0!==e?e:n.selected)&&void 0!==u?u:0):(s.j=10,s.Ut=0);var h=s.buttonTop,o=s.buttonPrevious;null!=h&&s.addChild(h),null!=o&&s.addChild(o),null==h&&null==o||s.addChild(s.newSpace());var a=s.buttonPages0,c=a.length;s.addChild(a[c-1]),s.addChild(s.dots0);for(var f=c-2;0<=f;--f)s.addChild(a[f]);s.addChild(s.page);for(var l=s.buttonPages1,v=l.length,b=(f=0,v-1);f<b;++f)s.addChild(l[f]);s.addChild(s.dots1),s.addChild(l[v-1]);var d=s.buttonNext,g=s.buttonLast;return null==d&&null==g||s.addChild(s.newSpace()),null!=d&&s.addChild(d),null!=g&&s.addChild(g),s.update(),s}return _(n,t),n.prototype.newSpace=function(){var t,n,i;return new Ku({width:null!==(i=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.space)&&void 0!==i?i:this.theme.getButtonSpace()})},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){0<=t&&t<this.j&&this.Ut!==t&&(this.Ut=t,this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selected",{get:function(){return this.value},set:function(t){this.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.j},set:function(t){0<=t&&this.j!==t&&(this.j=t,this.Ut=0===t?-1:Math.max(0,Math.min(this.j-1,this.Ut)),this.update())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"total",{get:function(){return this.size},set:function(t){this.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots0",{get:function(){var t=this._dots0;return null==t&&(t=this.newDots(),this._dots0=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dots1",{get:function(){var t=this._dots1;return null==t&&(t=this.newDots(),this._dots1=t),t},enumerable:!1,configurable:!0}),n.prototype.newDots=function(){return new Hw},Object.defineProperty(n.prototype,"buttonLast",{get:function(){var t=this.Hv;return void 0===t&&(t=this.newButtonLast(),this.Hv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonLast=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.last;if(null!==r&&!1!==r&&void 0!==r){var e=new _w(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonLastActive()})),e}return null},n.prototype.onButtonLastActive=function(){this.moveTo(this.j-1)},n.prototype.moveTo=function(t){if(0<=t&&t<this.j&&this.Ut!==t){var n=this.Ut;this.Ut=t,this.emit("change",t,n,this),this.update()}},Object.defineProperty(n.prototype,"buttonNext",{get:function(){var t=this.zv;return void 0===t&&(t=this.newButtonNext(),this.zv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonNext=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.next;if(null!==r&&!1!==r){var e=new Pw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonNextActive()})),e}return null},n.prototype.onButtonNextActive=function(){this.moveTo(this.Ut+1)},Object.defineProperty(n.prototype,"buttonPrevious",{get:function(){var t=this.Vv;return void 0===t&&(t=this.newButtonPrevious(),this.Vv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPrevious=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.previous;if(null!==r&&!1!==r){var e=new Uw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonPreviousActive()})),e}return null},n.prototype.onButtonPreviousActive=function(){this.moveTo(this.Ut-1)},Object.defineProperty(n.prototype,"buttonTop",{get:function(){var t=this.Wv;return void 0===t&&(t=this.newButtonTop(),this.Wv=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonTop=function(){var t,n,i=this,r=null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.top;if(null!==r&&!1!==r&&void 0!==r){var e=new Gw(!0!==r?r:void 0);return e.on("active",(function(){i.onButtonTopActive()})),e}return null},n.prototype.onButtonTopActive=function(){this.moveTo(0)},n.prototype.newButtonPage=function(){var t,n,i=this,r=new Fw(null===(n=null===(t=this.zn)||void 0===t?void 0:t.button)||void 0===n?void 0:n.page);return r.on("active",(function(){i.onButtonPageActive(r)})),r},Object.defineProperty(n.prototype,"buttonPages0",{get:function(){var t=this._buttonPages0;return null==t&&(t=this.newButtonPages0(),this._buttonPages0=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages0=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"buttonPages1",{get:function(){var t=this._buttonPages1;return null==t&&(t=this.newButtonPages1(),this._buttonPages1=t),t},enumerable:!1,configurable:!0}),n.prototype.newButtonPages1=function(){return[this.newButtonPage(),this.newButtonPage(),this.newButtonPage(),this.newButtonPage()]},Object.defineProperty(n.prototype,"page",{get:function(){var t=this.Xv;return null==t&&(t=this.newPage(),this.Xv=t),t},enumerable:!1,configurable:!0}),n.prototype.newPage=function(){var t;return new zw(null===(t=this.zn)||void 0===t?void 0:t.page)},n.prototype.onButtonPageActive=function(t){var n=t.text;pt(n)&&(this.moveTo(n-1),t.state.isFocused&&(t.state.isHovered=!1,this.page.focus()))},n.prototype.update=function(){var t=this.j,n=this.Ut;if(t<=0){null!=(o=this.buttonTop)&&(o.state.isEnabled=!1),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=!1),this.hideDots(this.dots0);for(var i=0,r=(l=this.buttonPages0).length;i<r;++i)this.hidePage(l[i]);for(this.hidePage(this.page),i=0,r=(v=this.buttonPages1).length;i<r;++i)this.hidePage(v[i]);this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=!1),(f=this.buttonLast)&&(f.state.isEnabled=!1)}else{var e=n-2,u=n+2;if(e<0)u-=e,e=0;else if(t<=u){var s=u-t+1;u-=s,e-=s}var h=!1;0<e&&(h=!0,e=Math.min(e+1,n));var o,a,c,f,l,v,b=!1;for(u<t-1&&(b=!0,u=Math.max(u-1,n)),null!=(o=this.buttonTop)&&(o.state.isEnabled=0<n),null!=(a=this.buttonPrevious)&&(a.state.isEnabled=0<n),h?this.showDots(this.dots0,1,e-1):this.hideDots(this.dots0),i=0,r=(l=this.buttonPages0).length;i<r;++i){var d=n-i-1,g=l[i];e<=d&&d<=u&&0<=d?this.showPage(g,d):h&&i===r-1?this.showPage(g,0):this.hidePage(g)}for(this.showPage(this.page,n),i=0,r=(v=this.buttonPages1).length;i<r;++i)d=n+i+1,g=v[i],e<=d&&d<=u&&d<t?this.showPage(g,d):b&&i===r-1?this.showPage(g,t-1):this.hidePage(g);b?this.showDots(this.dots1,u+1,t-2):this.hideDots(this.dots1),null!=(c=this.buttonNext)&&(c.state.isEnabled=n<t-1),null!=(f=this.buttonLast)&&(f.state.isEnabled=n<t-1)}},n.prototype.showPage=function(t,n){t.text=n+1,t.show()},n.prototype.hidePage=function(t){t.hide()},n.prototype.showDots=function(t,n,i){t.show()},n.prototype.hideDots=function(t){t.hide()},n.prototype.getType=function(){return"DPagination"},n}(Cs),Ww=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(hr),Xw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(hr),Kw=function(t){function n(n){var i=t.call(this,n)||this;i.k=[];var r=null==n?void 0:n.values;return r&&(i.values=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){if(t.prototype.onMenuSelect.call(this,n,i,r),i instanceof Rl){var e=this.k,u=[],s=[];i.state.isActive?this.updateMenuItems(r,e,n,void 0,u,s):this.updateMenuItems(r,e,void 0,n,u,s),this.k=u,this.text=s,this.onValueChange(u,e,s)}},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.k,e=[],u=[];this.updateMenuItems(n,r,void 0,void 0,e,u),this.k=e,this.text=u},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.open=function(){this.updateMenuItems(this.menu,this.k),t.prototype.open.call(this)},Object.defineProperty(n.prototype,"values",{get:function(){return this.k},set:function(t){var n=this.k;if(!this.isSameValues(t,n)){var i=[],r=[];this.updateMenuItems(this.menu,t,void 0,void 0,i,r),this.k=i,this.text=r}},enumerable:!1,configurable:!0}),n.prototype.isSameValues=function(t,n){if(t.length===n.length)for(var i=0,r=t.length;i<r;++i)if(n.indexOf(t[i])<0)return!1;return!1},n.prototype.updateMenuItems=function(t,n,i,r,e,u){for(var s=t.children,h=0,o=s.length;h<o;++h){var a=s[h];if(a instanceof Wl)this.updateMenuItems(a.menu,n,i,r,e,u);else if(a instanceof Rl){var c=a.value;void 0!==r&&r===c?a.state.isActive=!1:void 0!==i&&a.value===i||0<=n.indexOf(a.value)?(e&&e.push(a.value),u&&u.push(a),a.state.isActive=!0):a.state.isActive=!1}}},n.prototype.getType=function(){return"DSelectMultiple"},n}(lw),Yw=function(t){function n(n){var i=t.call(this,n)||this;i.Ut=null;var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=this.Ut;e!==n&&(this.Ut=n,this.text=i,this.onValueChange(n,e,i))},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.Ut;if(null!=r){var e=this.findMenuItem(n,r);null!=e?(this.Ut=r,this.text=e):(this.Ut=null,this.text=null)}else this.Ut=null,this.text=null},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.findMenuItem=function(t,n){for(var i=t.children,r=0,e=i.length;r<e;++r){var u=i[r];if(u instanceof Wl){var s=this.findMenuItem(u.menu,n);if(null!=s)return s}else if(u instanceof Cl&&u.value===n)return u}return null},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){if(this.Ut!==t){var n=this.findMenuItem(this.menu,t);null!=n?(this.Ut=t,this.text=n):(this.Ut=null,this.text=null)}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSelect"},n}(lw),Jw=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,i,r)||this;return s.Kv=e,s.Yv=u,s.La=.5*i,s.ya=.5*r,s.interactive=!1,s.interactiveChildren=!1,n.on("update",(function(){s.onTextureUpdate()})),s}return _(n,t),n.prototype.onTextureUpdate=function(){this.emit("update",this)},n.prototype.onReflow=function(t,n,i){var r=this.La,e=this.ya;this.x=-r+this.Kv,this.y=-e+this.Yv,this.width=r+n+r,this.height=e+i+e},n.prototype.render=function(n){var i=this.parent;if(i){var r=i.alpha;this.alpha=r*r*r}t.prototype.render.call(this,n)},n}(t.NineSlicePlane),Zw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n),this.Ut=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderLabel"},n}(Ss),qw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderThumb"},n}(Ns),Qw=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).Ut=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0,e.Jv=e.toRounder(n),e.Zv=null!==(r=null==n?void 0:n.delta)&&void 0!==r?r:1,e}return _(n,t),n.prototype.toRounder=function(t){var n,i=null==t?void 0:t.rounder;if(i)return i;var r=null!==(n=null==t?void 0:t.precision)&&void 0!==n?n:this.theme.getPrecision(),e=Math.pow(10,r);return function(t){return Math.round(t*e)/e}},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},set:function(t){this.Ut=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rounder",{get:function(){return this.Jv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"delta",{get:function(){return this.Zv},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderValue"},n}(Ss),$w=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.qv=0,this.Qv=this.newTrack(n),this.addChild(this.Qv),this.$v=this.newTrackSelected(n),this.$v.state.isActive=!0,this.addChild(this.$v),this.ff=this.newThumb(n),this.addChild(this.ff),this.cs=this.newLabelMin(n),this.addChild(this.cs),this.fs=this.newLabelMax(n),this.addChild(this.fs),this.Ut=this.newValue(n),this.addChild(this.Ut),this.Qv.on(ir.down,(function(t){i.Ut.visible=i.state.inEnabled,i.onTrackDown(t.data.global)})),this.$v.on(ir.down,(function(t){i.Ut.visible=i.state.inEnabled,i.onTrackSelectedDown(t.data.global)})),this.tb=function(t){i.onTrackUpBound(t),i.Ut.visible=!1},this.nb=function(t){i.onTrackSelectedUpBound(t),i.Ut.visible=!1},this.ff.on(ir.down,(function(t){i.Ut.visible=!0,i.onThumbDown(t)})),this.ib=function(t){i.onThumbMove(t)},this.rb=function(t){i.onThumbUp(t),i.Ut.visible=!1},this.onValuesChange()},n.prototype.newThumb=function(t){return new qw(null==t?void 0:t.thumb)},n.prototype.newValue=function(t){return new Qw(this.toValueOptions(null==t?void 0:t.value))},n.prototype.toValueOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value=t.value),null==t.visible&&(t.visible=!1),t},n.prototype.newLabelMin=function(t){return new Zw(this.toLabelMinOptions(null==t?void 0:t.min))},n.prototype.toLabelMinOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.newLabelMax=function(t){return new Zw(this.toLabelMaxOptions(null==t?void 0:t.max))},n.prototype.toLabelMaxOptions=function(t){null==(t=t||{}).value&&(t.value=1);var n=t.text||{};return t.text=n,null==n.value&&(n.value="".concat(t.value)),t},n.prototype.getValueMargin=function(){return 14},n.prototype.onTrackDown=function(t){if(!this.state.inDisabled){var n=st.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.eb=i;var r=this.tb;i.on(ir.up,r),i.on(ir.upoutside,r),i.on(ir.cancel,r)}this.onPick(t)}},n.prototype.onTrackSelectedDown=function(t){if(!this.state.inDisabled){var n=st.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.eb=i;var r=this.nb;i.on(ir.up,r),i.on(ir.upoutside,r),i.on(ir.cancel,r)}this.onPick(t)}},n.prototype.onTrackUpBound=function(t){var n=this.eb;if(n){this.eb=void 0;var i=this.tb;n.off(ir.up,i),n.off(ir.upoutside,i),n.off(ir.cancel,i)}},n.prototype.onTrackSelectedUpBound=function(t){var n=this.eb;if(n){this.eb=void 0;var i=this.nb;n.off(ir.up,i),n.off(ir.upoutside,i),n.off(ir.cancel,i)}},n.prototype.onThumbMove=function(t){this.state.inDisabled||this.onPick(t.data.global)},n.prototype.onThumbDown=function(t){var n=st.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.eb=i;var r=this.ib;i.on(ir.move,r);var e=this.rb;i.on(ir.up,e),i.on(ir.upoutside,e),i.on(ir.cancel,e)}},n.prototype.onThumbUp=function(t){var n=this.eb;if(n){this.eb=void 0;var i=this.ib;n.off(ir.move,i);var r=this.rb;n.off(ir.up,r),n.off(ir.upoutside,r),n.off(ir.cancel,r)}},n.prototype.updateValue=function(){var t=this.cs.value,n=this.fs.value,i=this.Ut,r=i.rounder(t+this.qv*(n-t)),e=i.value;r!==e&&(i.value=r,i.text=i.value,this.emit("change",r,e,this))},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.onValuesChange()},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut.value},set:function(t){t=Math.max(this.cs.value,Math.min(this.fs.value,t)),this.Ut.value!==t&&(this.Ut.value=t,this.onValuesChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.cs.value},set:function(t){var n=this.cs;if(t=Math.min(this.fs.value,t),n.value!==t){var i=this.Ut;n.text=n.value=t,i.value=Math.max(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.fs.value},set:function(t){var n=this.fs;if(t=Math.max(this.cs.value,t),n.value!==t){var i=this.Ut;n.text=n.value=t,i.value=Math.min(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSlider"},n}(hr),tp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrack"},n}(Ns),np=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackHorizontal"},n}(tp),ip=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new np(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new np(null==t?void 0:t.track)},i.prototype.toValueOptions=function(t){var i=this;return null==(t=n.prototype.toValueOptions.call(this,t)).y&&(t.y=function(t,n){return.5*t-n-i.getValueMargin()}),t},i.prototype.toLabelMinOptions=function(t){return null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return.5*-n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.toLabelMaxOptions=function(t){return null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return t-.5*n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=Math.max(0,Math.min(this.Qv.width,i.x));this.qv=r/this.Qv.width,this.moveThumbPosition(r)},i.prototype.onValuesChange=function(){var t=this.cs.value,n=this.fs.value,i=this.Ut.value;this.qv=(i-t)/(n-t);var r=this.qv*this.Qv.width;this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.ff;n.x=t-.5*n.width,this.$v.width=t;var i=this.Ut;i.x=t-.5*i.width,this.updateValue()},i.prototype.onKeyDown=function(t){return nr.isArrowRightKey(t)?this.value+=this.Ut.delta:nr.isArrowLeftKey(t)&&(this.value-=this.Ut.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderHorizontal"},i}($w),rp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackVertical"},n}(tp),ep=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new rp(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new rp(null==t?void 0:t.track)},i.prototype.toLabelMinOptions=function(t){null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return t-.5*n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=ns.RIGHT),t},i.prototype.toLabelMaxOptions=function(t){null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return.5*-n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=ns.RIGHT),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=this.height,e=Math.max(0,Math.min(r,i.y));this.qv=(r-e)/r,this.moveThumbPosition(e)},i.prototype.onValuesChange=function(){var t=this.cs.value,n=this.fs.value,i=this.Ut.value;this.qv=(i-t)/(n-t);var r=this.height*(1-this.qv);this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.ff;n.y=t-.5*n.height;var i=this.$v;i.y=t,i.height=this.height-t;var r=this.Ut;r.y=t-r.height-this.getValueMargin(),this.updateValue()},i.prototype.onKeyDown=function(t){return nr.isArrowUpKey(t)?this.value+=this.Ut.delta:nr.isArrowDownKey(t)&&(this.value-=this.Ut.delta),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DSliderVertical"},i}($w),up=function(){function t(){}return t.set=function(t,n,i,r,e){var u,s=this.toRenderable(n,i,r);t.renderable=s;var h=t.state;h.lock(),h.isDisabled=!s,!1!==e&&(h.isReadOnly=this.toReadOnly(n,i,r));var o=null===(u=r.state)||void 0===u?void 0:u.modifier;o&&o(n,i,t.state),h.unlock()},t.toReadOnly=function(t,n,i){var r=i.editing.enable;return!0!==r&&(!1===r||!r(t,n))},t.toRenderable=function(t,n,i){var r=i.renderable;return!0===r||!1!==r&&r(t,n)},t}(),sp=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).ub=-1,s.sb=n,s.hb=i,s.ut=r,s.ob=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.hb.selecting,u=e.dialog;if(u){var s=null!==(i=this.oh)&&void 0!==i?i:null;e.setter(u,s),u.open(this).then((function(){var t=e.getter(u);r.ob?t!==s&&(r.text=t,r.onValueChange(t,s)):r.onValueChange(t,null)}))}},n.prototype.onValueChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb;this.hb.setter(i,e,t),this.emit("change",t,n,this),this.ut(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.oh;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectDialog"},n}(Ns),hp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionDialog"},n}(sp),op=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){var e=this.ab;if(void 0!==e){var u=this.ub,s=this.sb;this.hb.setter(e,s,n),t.prototype.onMenuSelect.call(this,n,i,r),this.ut(n,null,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellActionMenu"},n}(vw),ap=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,e)||this).ub=-1,s.sb=n,s.hb=i,s.ut=r,s.ob=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.hb.selecting.promise;r&&r().then((function(t){var n;if(i.ob){var r=null!==(n=i.oh)&&void 0!==n?n:null;t!==r&&(i.text=t,i.onValueChange(t,r))}else i.onValueChange(t,null)}))},n.prototype.onValueChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb;this.hb.setter(i,e,t),this.emit("change",t,n,this),this.ut(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.oh;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectPromise"},n}(Ns),cp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionPromise"},n}(ap),fp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellText"},n}(Ts),lp=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,e)||this).ph=Ai(null!==(u=null==e?void 0:e.when)&&void 0!==u?u:Qu.CLICKED,Qu),s.on(ir.tap,(function(t){s.onClick(t)})),s}return _(n,t),n.prototype.onClick=function(t){this.ph===Qu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.ph===Qu.DOUBLE_CLICKED&&this.state.isActionable&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this);var n=this.ab;if(void 0!==n){var i=this.ub,r=this.sb;this.emit("change",null,null,this),this.ut(null,null,n,i,r,this)}},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTableBodyCellButton"},n}(fp),vp={INDEX:0,TEXT:1,INTEGER:2,REAL:3,CHECK:4,CHECK_SINGLE:5,COLOR:6,BUTTON:7,SELECT:8,DATE:9,DATETIME:10,TIME:11,ACTION:12,LINK:13,TREE:14},bp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.onValueChange(!0,!1)},n.prototype.onInactivate=function(n){t.prototype.onInactivate.call(this,n),this.onValueChange(!1,!0)},n.prototype.onValueChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb,u=this.hb;u.setter(i,e,t),this.emit("change",t,n,this);var s=this.ut;s(t,n,i,r,e,this),t&&u.type===vp.CHECK_SINGLE&&this.onChangeSingle(r,e,u,s)}},n.prototype.onChangeSingle=function(t,n,i,r){var e=this,u=this.parent;if(u){var s=u.parent;if(s){var h=!1,o=i.getter,a=i.setter;s.data.each((function(i,u){return t===u||!o(i,n)||(a(i,n,!1),h=!0,r(!1,!0,i,u,n,e),!1)})),h&&s.update(!0)}}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.state.isActive=!!t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellCheck"},n}(Ub),dp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r;var s=this.value;if(pt(t))s.color=t,s.alpha=1;else if(Ot(t)){var h=Number(t);s.color=h==h?h:16777215,s.alpha=1}else if(null!=t){var o=t.color,a=t.alpha;s.color=pt(o)?o:16777215,s.alpha=pt(a)?a:1}else s.color=16777215,s.alpha=1;up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellColor"},n}(ud),gp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.ab=n,this.ub=r,t instanceof Date)u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(pt(t)){var s=this.oh;void 0===s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellDate"},n}(hd),mp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.ab=n,this.ub=r,t instanceof Date)u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(pt(t)){var s=this.oh;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellDatetime"},n}(fd),wp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=r,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellIndex"},n}(Ts),pp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=Number(t),up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellInputInteger"},n}(Ys),Op=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=Number(t),up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellInputReal"},n}(qs),Dp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=String(t),up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellInputText"},n}(th),Ep=function(t){function n(n){var i=t.call(this,n)||this;return i.Qn=new Pb(i.Qn),i}return _(n,t),Object.defineProperty(n.prototype,"padding",{get:function(){return this.Qn},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellInputTreeInput"},n}(th),Mp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellInputTreeMarker"},n}(js),Sp={START:"START",END:"END",FROZEN:"FROZEN",FROZEN_END:"FROZEN_END",SORTABLE:"SORTABLE",SORTED_ASCENDING:"SORTED_ASCENDING",SORTED_DESCENDING:"SORTED_DESCENDING",HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED",CHECKABLE:"CHECKABLE",SELECTABLE:"SELECTABLE"},Tp=function(t){function n(n,i,r,e){var u=t.call(this,function(t){if(null!=t)return{weight:t.weight,width:t.width}}(e))||this;u.ub=-1,u.sb=n,u.hb=i,u.ut=r;var s=u.newInput(e);u.Ah=s,u.addChild(s);var h=u.newMarker(e);return u.A=h,u.addChild(h),u}return _(n,t),n.prototype.newInput=function(t){return new Ep(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){var n=this;return{weight:1,text:null==t?void 0:t.text,editing:null==t?void 0:t.editing,when:null==t?void 0:t.when,cursor:null==t?void 0:t.cursor,on:{change:function(t,i){n.onInputChange(t,i)}}}},n.prototype.onInputChange=function(t,n){var i=this.ab;if(void 0!==i){var r=this.ub,e=this.sb;this.hb.setter(i,e,t),this.emit("change",t,n,this),this.ut(t,n,i,r,e,this)}},n.prototype.newMarker=function(t){var n=this;return new Mp({visible:!1,on:{active:function(){n.onMarkerActive()}}})},n.prototype.onMarkerActive=function(){this.A.state.is(Sp.HAS_CHILDREN)&&this.toggle()},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.ab;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.Ah.padding.getLeft()},n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r;var s=this.Ah;s.visible=!0,s.text=String(t);var h=this.A;if(pt(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=h.state;f.lock(),f.set(Sp.HAS_CHILDREN,a),f.set(ct.DISABLED,!a),f.set(Sp.OPENED,o),f.unlock();var l=this.theme.getLevelPadding(c);h.width=l,a?h.show():h.hide(),s.padding.adjLeft(l)}else h.state.removeAll(Sp.OPENED,Sp.HAS_CHILDREN),h.hide(),s.padding.adjLeft(0);up.set(this.Ah,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1,this.Ah.visible=!1,this.A.hide()},n.prototype.getType=function(){return"DTableBodyCellInputTree"},n}(hr),jp=function(t,n){if(n)return{url:Np(t,n.url),target:n.target,checker:Ip(t,n.checker),menu:n.menu}},Np=function(t,n){return Ot(n)||null==n?n:function(){var i=t.row;return void 0!==i?n(i,t.rowIndex,t.columnIndex,t):null}},Ip=function(t,n){if(null!=n)return function(){var i=t.row;return void 0!==i&&n(i,t.rowIndex,t.columnIndex,t)}},Cp=function(t){function n(n,i,r,e){var u;return t.call(this,n,i,r,Hl.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this}return _(n,t),n.prototype.onClick=function(n){this.link.onClick(this,n)||t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t,n=this.Go;return null==n&&(n=new Gl(jp(this,null===(t=this.zn)||void 0===t?void 0:t.link)),this.Go=n),n},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellLink"},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n}(lp),Ap=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.ab;if(void 0!==e){var u=this.ub,s=this.sb;this.hb.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.ut(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.value=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMenu"},n}(Yw),Rp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.ab;if(void 0!==e){var u=this.ub,s=this.sb;this.hb.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.ut(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.values=t,up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMultiple"},n}(Kw),kp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ub=-1,u.sb=n,u.hb=i,u.ut=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.ab;if(void 0!==r){var e=this.ub,u=this.sb;this.hb.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.ut(n,i,r,e,u,this)}else t.prototype.onValueChange.call(this,n,i)},Object.defineProperty(n.prototype,"row",{get:function(){return this.ab},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ub},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.ab=n,this.ub=r,t instanceof Date)u?(this.hh=t,this.oh=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(pt(t)){var s=this.oh;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}up.set(this,n,e,this.hb)},n.prototype.unset=function(){this.ab=void 0,this.ub=-1},n.prototype.getType=function(){return"DTableBodyCellTime"},n}(eg),Lp=function(t){function n(n,i,r,e){var u,s=this;return(s=t.call(this,n,i,r,Hl.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this).Qn=new Pb(s.Qn),s}return _(n,t),n.prototype.onClick=function(n){var i;!0!==(null===(i=this.link)||void 0===i?void 0:i.onClick(this,n))&&t.prototype.onClick.call(this,n)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.Go;return void 0===t&&(t=this.newLink(),this.Go=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t,n=null===(t=this.zn)||void 0===t?void 0:t.link;return n?new Gl(jp(this,n)):null},n.prototype.onActivate=function(n){var i;t.prototype.onActivate.call(this,n),this.state.is(Sp.HAS_CHILDREN)?this.toggle():null===(i=this.link)||void 0===i||i.open(n)},n.prototype.toggle=function(){var t=this.ab;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&(r.isExpanded(t)?r.collapse(t)&&(this.emit("collapse",this),r.emit("collapse",t,this)):r.expand(t)&&(this.emit("expand",this),r.emit("expand",t,this)))}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.padding.getLeft()&&(this.toggle(),!0)},n.prototype.set=function(t,n,i,r,e,u){this.ab=n,this.ub=r,this.text=t,up.set(this,n,e,this.hb,!1);var s=this.link,h=this.Qn;if(pt(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=this.state;f.lock(),f.set(Sp.HAS_CHILDREN,a),f.set(Sp.OPENED,o),f.unlock(),h.adjLeft(this.theme.getLevelPadding(c)),s&&(s.menu.enable=!a)}else this.state.removeAll(Sp.OPENED,Sp.HAS_CHILDREN),h.adjLeft(0),s&&(s.menu.enable=!1)},n.prototype.getType=function(){return"DTableBodyCellTree"},n}(lp),yp={NONE:0,SINGLE:1,MULTIPLE:2},xp=function(t){function n(n){var i,r,e=this;return(e=t.call(this,n)||this).ai=!0,e.cb=null!==(i=n.frozen)&&void 0!==i?i:0,e.fb=null!==(r=n.columns)&&void 0!==r?r:[],e}return _(n,t),n.prototype.initCells=function(t,n,i){for(var r=this.toIndexEnd(n),e=n.length-1;0<=e;--e){var u=this.newCell(e,n[e],n,t),s=u.state;s.lock(!1),0===e&&s.add(Sp.START),e===r&&s.add(Sp.END),e<i&&s.add(Sp.FROZEN),e===i-1&&s.add(Sp.FROZEN_END),s.unlock(),this.addChild(u)}},n.prototype.toIndexEnd=function(t){for(var n=t.length,i=0;i<n;++i)if(void 0!==t[i].weight)return n-1;return n},n.prototype.onRefit=function(){t.prototype.onRefit.call(this),this.resetFrozenCellPosition()},n.prototype.updateFrozenCellPosition=function(t){for(var n=this.fb,i=this.children,r=i.length,e=this.cb,u=0;u<e;++u){var s=n[u];i[r-1-u].position.x=-t+s.offset}},n.prototype.resetFrozenCellPosition=function(){for(var t=this.fb,n=this.children,i=n.length,r=this.cb,e=this.getContentPositionX(),u=0;u<r;++u){var s=t[u],h=n[i-1-u];s.offset=h.position.x,h.position.x=-e+s.offset}},n.prototype.getClippingRect=function(n,i){t.prototype.getClippingRect.call(this,n,i);var r=this.cb;if(0<r){var e=n;if(e&&e.parent===this){var u=this.children,s=u.indexOf(e);if(0<=s&&r<=u.length-1-s){var h=u[s+1],o=h.position.x+h.width;i.x+=o,i.width-=o}}}},n.prototype.getType=function(){return"DTableRow"},n}(Cs),Bp=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.hu=-1,u.lb=function(t,i,r,e,s){u.emit("change",t,i,r,e,s,u),n(t,i,r,e,s,u)},u.vb=r,u.state.isAlternated=!i,u.initCells(e,u.fb,u.cb),u}return _(n,t),n.prototype.newCell=function(t,n,i,r){var e=this.lb,u=this.vb,s=u.get(t);if(null==s&&(s=this.toCellOptions(t,n,r),u.set(t,s)),!1!==n.editing.enable)return this.newCellEditable(t,n,e,s);var h=this.newCellUnediable(t,n,e,s);return n.type!==vp.TREE&&(h.state.isReadOnly=!0),h},n.prototype.newCellEditable=function(t,n,i,r){switch(n.type){case vp.INDEX:return new wp(t,n,i,r);case vp.TEXT:return new Dp(t,n,i,r);case vp.TREE:return new Tp(t,n,i,r);case vp.INTEGER:return new pp(t,n,i,r);case vp.REAL:return new Op(t,n,i,r);case vp.CHECK:case vp.CHECK_SINGLE:return new bp(t,n,i,r);case vp.COLOR:return new dp(t,n,i,r);case vp.BUTTON:return new lp(t,n,i,r);case vp.LINK:return new Cp(t,n,i,r);case vp.SELECT:return this.newCellSelect(t,n,i,r);case vp.ACTION:return this.newCellAction(t,n,i,r);case vp.DATE:return new gp(t,n,i,r);case vp.DATETIME:return new mp(t,n,i,r);case vp.TIME:return new kp(t,n,i,r);default:return new fp(t,n,i,r)}},n.prototype.newCellUnediable=function(t,n,i,r){switch(n.type){case vp.INDEX:return new wp(t,n,i,r);case vp.TEXT:return new fp(t,n,i,r);case vp.TREE:return new Lp(t,n,i,r);case vp.INTEGER:case vp.REAL:return new fp(t,n,i,r);case vp.CHECK:case vp.CHECK_SINGLE:return new bp(t,n,i,r);case vp.COLOR:return new dp(t,n,i,r);case vp.BUTTON:return new lp(t,n,i,r);case vp.LINK:return new Cp(t,n,i,r);case vp.SELECT:return this.newCellSelect(t,n,i,r);case vp.ACTION:return this.newCellAction(t,n,i,r);case vp.DATE:return new gp(t,n,i,r);case vp.DATETIME:return new mp(t,n,i,r);case vp.TIME:return new kp(t,n,i,r);default:return new fp(t,n,i,r)}},n.prototype.newCellSelect=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new Ap(t,n,i,r):null!=e.multiple?new Rp(t,n,i,r):null!=e.dialog?new sp(t,n,i,r):null!=e.promise?new ap(t,n,i,r):new fp(t,n,i,r)},n.prototype.newCellAction=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new op(t,n,i,r):null!=e.dialog?new hp(t,n,i,r):null!=e.promise?new cp(t,n,i,r):new fp(t,n,i,r)},n.prototype.toCellOptions=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v,b,d,g,m=lb(n.body,i.cell);m.weight=n.weight,m.width=n.width,null!==(r=m.state)&&void 0!==r||(m.state=n.state.initial);var w=n.formatter;null!=w&&(null!==(u=(O=null!==(e=m.text)&&void 0!==e?e:m.text={}).formatter)&&void 0!==u||(O.formatter=w));var p=n.align;if(null!=p){var O,D=null!==(h=(O=null!==(s=m.text)&&void 0!==s?s:m.text={}).align)&&void 0!==h?h:O.align={};null!==(o=D.horizontal)&&void 0!==o||(D.horizontal=p)}var E=n.editing;if(!1!==E.enable){var M=null!==(a=(g=m).editing)&&void 0!==a?a:g.editing={};null!==(c=M.formatter)&&void 0!==c||(M.formatter=E.formatter),null!==(f=M.unformatter)&&void 0!==f||(M.unformatter=E.unformatter),null!==(l=M.validator)&&void 0!==l||(M.validator=E.validator)}var S=n.link;void 0!==S&&(m.link=S);var T=n.selecting,j=null!==(v=T.menu)&&void 0!==v?v:T.multiple;return void 0!==j&&(m.menu=j),(null!==(d=null===(b=null==i?void 0:i.selection)||void 0===b?void 0:b.type)&&void 0!==d?d:yp.NONE)!==yp.NONE&&(m.when="DOUBLE_CLICKED",m.cursor=function(t){if(t.in(Sp.SELECTABLE))return"pointer"}),m},n.prototype.getType=function(){return"DTableBodyRow"},Object.defineProperty(n.prototype,"value",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),n.prototype.isCell=function(t){return null!=t&&"set"in t},n.prototype.set=function(t,n,i,r){if(r||this.Ut!==t||this.hu!==i){this.Ut=t,this.hu=i;for(var e=this.children,u=e.length,s=this.fb,h=s.length,o=0;o<u;++o){var a=e[o],c=h-1-o,f=s[c];this.isCell(a)&&a.set(f.getter(t,c),t,n,i,c,r)}this.onSet(t,i)}},n.prototype.onSet=function(t,n){this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.Ut){this.Ut=void 0,this.hu=-1;for(var t=this.children,n=t.length,i=0;i<n;++i){var r=t[i];this.isCell(r)&&r.unset()}this.onUnset()}},n.prototype.onUnset=function(){this.emit("unset",this)},n.prototype.getContentPositionX=function(){var t=this.parent;if(t){var n=t.parent;if(n)return n.position.x}return 0},n}(xp),_p=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.Al=-1,i.bb=!1,i.gb=-1,i.p=n,i.pf=null,i.mb=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.bb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.bb&&(this.bb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.bb},n.prototype.newFiltered=function(){var t=this.pf;if(null!=t){var n,i=[],r=this.p,e=r.sorter,u=r.rows;if(wt(t))if(n=e.indices)for(var s=0,h=n.length;s<h;++s)t(u[o=n[s]],o)&&i.push(s);else for(s=0,h=u.length;s<h;++s)t(u[s],s)&&i.push(s);else if(n=e.indices)for(s=0,h=n.length;s<h;++s){var o=n[s];t.test(u[o],o)&&i.push(s)}else for(s=0,h=u.length;s<h;++s)t.test(u[s],s)&&i.push(s);return i}return null},n.prototype.get=function(){return this.pf},n.prototype.set=function(t){this.pf!==t&&(this.pf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R===this.Al&&this.p.sorter.id===this.gb||(this.Al=this.R,this.gb=this.p.sorter.id,this.bb?(this.mb=this.newFiltered(),this.emit("change",this)):null!=this.mb&&(this.mb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.mb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Pp=function(){function t(t){this.p=t}return Object.defineProperty(t.prototype,"rows",{get:function(){var t=[];return this.each((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),t.prototype.map=function(t){var n=this.p,i=n.sorter.map(t);return null!=i?n.filter.map(i):null},t.prototype.unmap=function(t){var n=this.p;return n.sorter.unmap(n.filter.unmap(t))},t.prototype.size=function(){var t=this.p,n=t.filter.indices;return null!=n?n.length:t.size()},t.prototype.get=function(t){return this.p.get(this.unmap(t))},t.prototype.each=function(t,n,i){var r=this.p,e=r.rows,u=r.supplimentals,s=r.filter.indices,h=r.sorter.indices;if(n=null!=n?Math.max(0,n):0,s){var o=s.length;if(i=null!=i?Math.min(o,i):o,h)for(var a=n;a<i&&!1!==t(e[c=h[s[a]]],u?u[c]:null,a,c);++a);else for(a=n;a<i&&!1!==t(e[c=s[a]],u?u[c]:null,a,c);++a);}else if(o=e.length,i=null!=i?Math.min(o,i):o,h)for(a=n;a<i;++a){var c;if(!1===t(e[c=h[a]],u?u[c]:null,a,c))break}else for(a=n;a<i&&!1!==t(e[a],u?u[a]:null,a,a);++a);},t}(),Fp=function(t,n){return t[0]-n[0]},Up=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).p=n,e.xt=Ai(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:yp.NONE,yp),e.In=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.xt},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.In;n.has(t)?n.delete(t):n.add(t),this.onChange()},n.prototype.add=function(t){var n=this.In,i=n.size;n.add(t),i!==n.size&&this.onChange()},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.In;if(0<t.size){var n=NaN;return t.forEach((function(t){n!=n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.In;if(0<t.size){var n=0;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.In,u=e.size;if(t<i)for(var s=i+(r?1:0),h=t+(n?0:1);h<s;++h)e.add(h);else for(s=t+(n?1:0),h=i+(r?0:1);h<s;++h)e.add(h);u!==e.size&&this.onChange()},n.prototype.addAll=function(t){for(var n=this.In,i=n.size,r=0,e=t.length;r<e;++r)n.add(t[r]);i!==n.size&&this.onChange()},n.prototype.contains=function(t){return this.In.has(t)},n.prototype.remove=function(t){this.In.delete(t)&&this.onChange()},n.prototype.clear=function(){var t=this.In;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.In;n.has(t)&&1===n.size||(n.clear(),n.add(t),this.onChange())},n.prototype.clearAndAddAll=function(t){var n=this.In;if(0<n.size||0<t.length){n.clear();for(var i=0,r=t.length;i<r;++i)n.add(t[i]);this.onChange()}},n.prototype.shift=function(t,n){var i=[],r=this.In;if(r.forEach((function(n){t<=n&&i.push(n)})),0<i.length){for(var e=0,u=i.length;e<u;++e)r.delete(i[e]);for(e=0,u=i.length;e<u;++e)r.add(i[e]+n);this.onChange()}},n.prototype.size=function(){return this.In.size},n.prototype.isEmpty=function(){return 0===this.In.size},n.prototype.each=function(t){var n=!1;this.In.forEach((function(i){n||!1===t(i)&&(n=!0)}))},Object.defineProperty(n.prototype,"indices",{get:function(){var t=[];return this.In.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[],n=this.p;return this.In.forEach((function(i){t.push(n.get(i))})),t},enumerable:!1,configurable:!0}),n.prototype.toArray=function(){var t=[],n=this.p;return this.In.forEach((function(i){t.push([i,n.get(i)])})),t},n.prototype.toSortedArray=function(){return this.toArray().sort(Fp)},n.prototype.toObject=function(){var t={},n=this.p;return this.In.forEach((function(i){t[i]=n.get(i)})),t},n.prototype.toMap=function(){var t=new Map,n=this.p;return this.In.forEach((function(i){t.set(i,n.get(i))})),t},n}(t.utils.EventEmitter),Gp={ASCENDING:0,DESCENDING:1},Hp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.Al=-1,i.bb=!1,i.p=n,i.wb=null,i.pb=null,i.zt=Gp.ASCENDING,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return this.zt},set:function(t){this.zt=t},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.bb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.bb&&(this.bb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.bb},n.prototype.newSorted=function(){var t=this.wb;if(null!=t){for(var n=[],i=this.p.rows,r=0,e=i.length;r<e;++r)n.push(r);return n.sort(this.toComparator(i,t)),n}return null},n.prototype.toComparator=function(t,n){var i=this.zt;return wt(n)?i===Gp.ASCENDING?function(i,r){return n(t[i],t[r],i,r)}:function(i,r){return n(t[r],t[i],r,i)}:i===Gp.ASCENDING?function(i,r){return n.compare(t[i],t[r],i,r)}:function(i,r){return n.compare(t[r],t[i],r,i)}},n.prototype.get=function(){return this.wb},n.prototype.set=function(t){this.wb!==t&&(this.wb=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.Al&&(this.Al=this.R,this.bb?(this.pb=this.newSorted(),this.emit("change",this)):null!=this.pb&&(this.pb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.pb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),zp=function(n){function i(t){var i=n.call(this)||this;if(i.p=null,i.Ob=i.toRows(null==t?void 0:t.rows),i.nf=new Pp(i),i.tf=i.toSelection(null==t?void 0:t.selection),i.pf=new _p(i),i.Db=new Hp(i),t){var r=t.filter;r&&i.pf.set(r);var e=t.comparator;e&&i.Db.set(e);var u=t.on;if(u)for(var s in u){var h=u[s];h&&i.on(s,h)}}return i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:wt(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new Up(this,t)},i.prototype.bind=function(t){this.p=t},i.prototype.toRows=function(t){var n=[];if(null!=t)for(var i=0,r=t.length;i<r;++i)n.push(t[i]);return n},Object.defineProperty(i.prototype,"rows",{get:function(){return this.Ob},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this.p;t&&t.update()},i.prototype.lock=function(){var t=this.p;t&&t.lock()},i.prototype.unlock=function(){var t=this.p;t&&(t.unlock(!1),t.update())},i.prototype.size=function(){return this.Ob.length},i.prototype.clear=function(){var t=this.Ob;0<t.length&&(t.length=0,this.lock(),this.tf.clear(),this.Db.toDirty(),this.pf.toDirty(),this.unlock())},i.prototype.clearAndAdd=function(t){var n=this.Ob;n.length=0,n.push(t),this.lock(),this.tf.clear(),this.Db.toDirty(),this.pf.toDirty(),this.unlock()},i.prototype.clearAndAddAll=function(t){var n=this.Ob;n.length=0;for(var i=0,r=t.length;i<r;++i)n.push(t[i]);this.lock(),this.tf.clear(),this.Db.toDirty(),this.pf.toDirty(),this.unlock()},i.prototype.add=function(t,n){var i=this.Ob,r=this.tf,e=this.Db,u=this.pf;null==n?(i.push(t),this.lock(),e.toDirty(),u.toDirty(),this.unlock()):0<=n&&n<i.length&&(i.splice(n,0,t),this.lock(),r.shift(n,1),e.toDirty(),u.toDirty(),this.unlock())},i.prototype.addAll=function(t,n){var i=this.Ob,r=i.length,e=this.tf,u=this.Db,s=this.pf;if(null==n){for(var h=0,o=a=t.length;h<o;++h)i.push(t[h]);this.lock(),u.toDirty(),s.toDirty(),this.unlock()}else if(0<=n&&n<r){var a=t.length;for(h=0;h<a;++h)i.splice(n+h,0,t[h]);this.lock(),e.shift(n,a),u.toDirty(),s.toDirty(),this.unlock()}},i.prototype.get=function(t){var n=this.Ob;return 0<=t&&t<n.length?n[t]:null},i.prototype.set=function(t,n){var i=this.Ob;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.lock(),this.Db.toDirty(),this.pf.toDirty(),this.unlock(),r}return null},i.prototype.remove=function(t){var n=this.Ob;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.lock(),this.tf.remove(t),this.Db.toDirty(),this.pf.toDirty(),this.unlock(),i}return null},i.prototype.each=function(t,n,i){var r=this.Ob;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.pf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.Db},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),Vp=function(n){function i(t){var i,r=this;(r=n.call(this,t)||this).transform.position.y=null!==(i=t.offset)&&void 0!==i?i:0;var e=r.toData(t.data);r.Xt=e,e.bind(r);var u=r.theme,s=function(t,n,i){var r=n.columns||[],e=n.row;return null!=e?(null==e.height&&(e.height=t.getRowHeight()),void 0===e.columns&&(e.columns=r),null==e.frozen&&(e.frozen=n.frozen),void 0===e.selection?e.selection={type:i}:void 0===e.selection.type&&(e.selection.type=i)):e={columns:r,height:t.getRowHeight(),frozen:n.frozen,selection:{type:i}},e}(u,t,e.selection.type);return r.Eb=s,r.Mb=null!=s.height?s.height:u.getRowHeight(),r.fb=s.columns||[],r.Sb=0,r.Tb=0,r.jb=0,r.Nb=!1,r.Ib=!1,r.Cb=[],r.Ab=function(t,n,i,r,u){e.emit("change",t,n,i,r,u,e)},r.vb=new Map,r.Xt.emit("init",r.Xt),r}return _(i,n),i.prototype.toData=function(t){return this.isData(t)?t:new zp(t)},i.prototype.isData=function(t){return null!=t&&"mapped"in t},i.prototype.onResize=function(t,i,r,e){n.prototype.onResize.call(this,t,i,r,e),this.update()},Object.defineProperty(i.prototype,"selection",{get:function(){return this.Xt.selection},enumerable:!1,configurable:!0}),i.prototype.lock=function(){this.jb+=1,1===this.jb&&(this.Nb=!1,this.Ib=!1)},i.prototype.unlock=function(t){this.jb-=1,0===this.jb&&(t&&this.Nb&&this.update(this.Ib),this.Nb=!1,this.Ib=!1)},i.prototype.update=function(t){if(0<this.jb)return this.Nb=!0,void(t&&(this.Ib=!0));var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=this.children,e=i.height,u=this.Mb,s=this.Xt,h=s.mapped.size(),o=this.Sb,a=this.Tb,c=a-o,f=this.transform.position.y,l=f+h*u,v=Math.max(e,l),b=Math.max(e-v,n.position.y),d=-b/u,g=(e-(b+f))/u,m=Math.floor(d);m-=m%2==0?2:1;var w=Math.floor(g),p=(w+=(w-m)%2==1?3:2)-m;if(p<c&&c-2<=p&&(w=m+(p=c)),c<p){for(var O=c;O<p;++O){var D=o+O,E=this.newRow(D%2==0);this.addChild(E)}a=o+(c=p)}else if(p<c){for(O=c-1;p<=O;--O)this.removeChild(r[O]);a=o+(c=p)}this.Sb=m,this.Tb=w;var M=m-o,S=Math.abs(M),T=r.length;if(0<S&&S<T){var j=this.Cb;if(0<M){for(O=0;O<S;++O)j.push(this.resetRow(r[O]));for(O=S;O<T;++O)r[O-S]=r[O];for(O=0;O<S;++O)r[T-S+O]=j[O]}else{for(O=0;O<S;++O)j.push(this.resetRow(r[T-S+O]));for(O=T-S-1;0<=O;--O)r[O+S]=r[O];for(O=0;O<S;++O)r[O]=j[O]}j.length=0}var N=s.selection,I=N.type!==yp.NONE;for(s.mapped.each((function(n,i,e,s){var h=r[e-m];h.position.y=e*u;var o=h.state;o.lock(),o.set(Sp.SELECTABLE,I),o.set(ct.ACTIVE,N.contains(s)),o.remove(ct.DISABLED),o.unlock(),h.set(n,i,s,t)}),m,m+T),O=0;m+O<0&&O<T;++O)(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ct.DISABLED),A.removeAll(Sp.SELECTABLE,ct.ACTIVE),A.unlock(),C.unset();for(O=T-1;h<=m+O&&0<=O;--O){var C,A;(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ct.DISABLED),A.removeAll(Sp.SELECTABLE,ct.ACTIVE),A.unlock(),C.unset()}this.lock(),n.position.y=b,n.height=v,this.height=l,this.unlock(!1),this.emit("update",d,g,this)}}},i.prototype.resetRow=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];e instanceof hr&&(e.state.isPressed=!1)}return t},i.prototype.newRow=function(t){return new Bp(this.Ab,t,this.vb,this.Eb)},i.prototype.onParentMove=function(t,i,r,e){n.prototype.onParentMove.call(this,t,i,r,e),this.updateFrozenCellPosition(t)},i.prototype.updateFrozenCellPosition=function(t){var n=this.Eb.frozen;if(null!=n&&0<n)for(var i=this.children,r=0,e=i.length;r<e;++r)i[r].updateFrozenCellPosition(t)},i.prototype.getClippingRect=function(t,i){n.prototype.getClippingRect.call(this,t,i);var r=this.parent;if(r){var e=-r.transform.position.y;i.y+=e,i.height-=e}},i.prototype.scrollTo=function(t){var n=this.parent;if(null==n)return!1;var i=n.parent;if(null==i)return!1;var r=-1;return pt(t)?0<=t&&t<this.data.mapped.size()&&(r=t):this.data.mapped.each((function(n,i,e){return n!==t||(r=e,!1)})),!(r<0||(n.position.y=Math.max(Math.min(0,i.height-n.height),-r*this.Mb),st.update(this),0))},i.prototype.toRowIndexMapped=function(t){return 0<=this.parent.position.y+t.y?Math.floor(t.y/this.Mb):-1},i.prototype.toRow=function(t){var n=t-this.Sb,i=this.children;return 0<=n&&n<i.length?i[n]:null},i.prototype.toCell=function(t,n){for(var i=t.children,r=i.length,e=this.fb.length,u=0,s=Math.min(r,e);u<s;++u){var h=i[r-u-1],o=n.x-h.position.x;if(0<=o&&o<=h.width)return h}return null},i.prototype.onRowClick=function(t){if(this.state.isActionable){var n=i.WORK_ON_CLICK;n.copyFrom(t.data.global),this.toLocal(n,void 0,n,!1);var r=this.toRowIndexMapped(n);if(0<=r&&r<this.Xt.mapped.size()){var e=this.toRow(r);if(e){var u=this.toCell(e,n);if(u&&u.onRowSelect&&u.onRowSelect(t,n))return}this.onRowSelect(t,r)}}},i.prototype.onRowSelect=function(t,n){var i=this.Xt,r=i.selection,e=r.type===yp.SINGLE,u=!e,s=i.mapped.unmap(n),h=t.data.originalEvent,o=h.ctrlKey,a=h.shiftKey;if(e||r.isEmpty()||!u||!o&&!a)r.clearAndAdd(s);else if(o)r.toggle(s);else if(a){var c=r.last;if(null!=c){var f=i.sorter,l=i.filter,v=f.map(s),b=f.map(c);if(null!=v&&null!=b){var d=b+1,g=v+1;if(v<b&&(d=v,g=b),d<g){var m=[],w=l.indices,p=f.indices;if(w)if(p)for(var O=0,D=w.length;O<D;++O)d<=(E=w[O])&&E<g&&m.push(p[E]);else for(O=0,D=w.length;O<D;++O){var E;d<=(E=w[O])&&E<g&&m.push(E)}else if(p)for(O=d;O<g;++O)m.push(p[O]);else for(O=d;O<g;++O)m.push(O);r.addAll(m)}}}}},i.prototype.onDblClick=function(t,i){return n.prototype.onDblClick.call(this,t,i)},i.prototype.getType=function(){return"DTableBody"},Object.defineProperty(i.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),i.WORK_ON_CLICK=new t.Point,i}(hr),Wp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableCategoryCell"},n}(Nl),Xp=function(t){function n(n){var i,r=this;r=t.call(this,n)||this;var e=null!==(i=n.offset)&&void 0!==i?i:0;return r.vn=e,r.transform.position.y=e,r.initCells(n,r.fb,r.cb),r}return _(n,t),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.vn,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new Wp(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=i.cell;if(r){r.weight=n.weight,r.width=n.width;var e=r.text||{};return r.text=e,e.value=e.value||n.label,r}return{weight:n.weight,width:n.width,text:{value:n.label}}},n.prototype.getType=function(){return"DTableCategory"},n}(xp),Kp=function(t){function n(n){var i=t.call(this)||this;return i.R=0,i.Al=-1,i.bb=!1,i.p=n,i.pf=null,i.mb=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.R},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.bb=!0,this.R+=1,this.p.update()},n.prototype.unapply=function(){this.bb&&(this.bb=!1,this.R+=1,this.p.update())},n.prototype.isApplied=function(){return this.bb},n.prototype.isFiltered=function(t,n,i){return wt(i)?i(t,n):i.test(t,n)},n.prototype.hasFiltered=function(t,n,i){for(var r=this.p.accessor,e=r.toChildren,u=r.hasChildren,s=0,h=n.length;s<h;++s){var o=n[s];if(this.isFiltered(o,-1,i))return!0;var a=e(o);if(u(o,a)&&this.hasFiltered(t,a,i))return!0}return!1},n.prototype.addAllToFiltered=function(t,n,i,r){for(var e=this.p.accessor,u=e.toChildren,s=e.hasChildren,h=0,o=n.length;h<o;++h){var a=n[h];i.push(r[0]),r[0]+=1;var c=u(a);s(a,c)&&t.isOpened(a)&&this.addAllToFiltered(t,c,i,r)}},n.prototype.newFilteredSub=function(t,n,i,r,e){for(var u=!1,s=this.p.accessor,h=s.toChildren,o=s.hasChildren,a=0,c=n.length;a<c;++a){var f=n[a],l=e[0];e[0]+=1;var v=this.isFiltered(f,l,i),b=h(f);if(o(f,b))if(t.isOpened(f))if(v)r.push(l),u=!0,this.addAllToFiltered(t,b,r,e);else{var d=r.length;this.newFilteredSub(t,b,i,r,e)&&(r.splice(d,0,l),u=!0)}else(v||this.hasFiltered(t,b,i))&&(r.push(l),u=!0);else v&&(r.push(l),u=!0)}return u},n.prototype.newFiltered=function(){var t=this.pf;if(null!=t){var n=[],i=this.p,r=i.nodes;return r&&this.newFilteredSub(i,r,t,n,[0]),n}return null},n.prototype.get=function(){return this.pf},n.prototype.set=function(t){this.pf!==t&&(this.pf=t)},n.prototype.toDirty=function(){this.R+=1},n.prototype.update=function(){this.R!==this.Al&&(this.Al=this.R,this.bb?(this.mb=this.newFiltered(),this.emit("change",this)):null!=this.mb&&(this.mb=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.mb},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Yp=function(t){return t.parent},Jp=function(t){return t.children},Zp=function(t,n){return null!=n&&0<n.length},qp=function(t){null!=t?(this.toParent=t.toParent||Yp,this.toChildren=t.toChildren||Jp,this.hasChildren=t.hasChildren||Zp):(this.toParent=Yp,this.toChildren=Jp,this.hasChildren=Zp)},Qp=function(t,n){return t[0]-n[0]},$p=function(t){function n(n,i){var r,e=this;(e=t.call(this)||this).p=n,e.xt=Ai(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:yp.NONE,yp),e.Ob=new Set;var u=null==i?void 0:i.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"parent",{get:function(){return this.p},enumerable:!1,configurable:!0}),n.prototype.onNodeChange=function(t){if(null!=t){var n=this.p.accessor,i=n.toChildren,r=n.hasChildren,e=this.Ob,u=this.newRows(t,i,r,e,new Set);e.size!==u.size&&(this.Ob=u,this.onChange())}else{var s=this.Ob;0<s.size&&(s.clear(),this.onChange())}},n.prototype.newRows=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];r.has(h)&&e.add(h);var o=n(h);i(h,o)&&this.newRows(o,n,i,r,e)}return e},Object.defineProperty(n.prototype,"indices",{get:function(){var t=this.Ob,n=[];return this.p.each((function(i,r){t.has(i)&&n.push(r)})),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[];return this.Ob.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.xt},enumerable:!1,configurable:!0}),n.prototype.getFirst=function(){var t=this.Ob;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},n.prototype.getLast=function(){var t=this.Ob;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},n.prototype.toIndex=function(t){var n=null;return this.p.each((function(i,r){return t!==i||(n=r,!1)})),n},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.getFirst();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.getLast();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)?i.delete(n):i.add(n),this.onChange()}},n.prototype.add=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)||(i.add(n),this.onChange())}},n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.Ob,u=e.size,s=this.p;t<i?s.each((function(t){e.add(t)}),t+(n?0:1),i+(r?1:0)):s.each((function(t){e.add(t)}),i+(r?0:1),t+(n?1:0)),u!==e.size&&this.onChange()},n.prototype.addAll=function(t){if(0<t.length){for(var n=this.Ob,i=this.p,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.contains=function(t){var n=this.p.get(t);return!!n&&this.Ob.has(n)},n.prototype.remove=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)&&(i.delete(n),this.onChange())}},n.prototype.clear=function(){var t=this.Ob;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.p.get(t);if(n){var i=this.Ob;i.has(n)?1<i.size&&(i.clear(),i.add(n),this.onChange()):(i.clear(),i.add(n),this.onChange())}},n.prototype.clearAndAddAll=function(t){var n=this.Ob;if(0<n.size||0<t.length){n.clear();for(var i=this.p,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.shift=function(t,n){},n.prototype.size=function(){return this.Ob.size},n.prototype.isEmpty=function(){return this.Ob.size<=0},n.prototype.each=function(t){var n=this.Ob;this.p.each((function(i,r){return!n.has(i)||!1!==t(r)}))},n.prototype.toArray=function(){var t=this.Ob,n=[];return this.p.each((function(i,r){t.has(i)&&n.push([r,i])})),n},n.prototype.toSortedArray=function(){return this.toArray().sort(Qp)},n.prototype.toObject=function(){var t=this.Ob,n={};return this.p.each((function(i,r){t.has(i)&&(n[r]=i)})),n},n.prototype.toMap=function(){var t=this.Ob,n=new Map;return this.p.each((function(i,r){t.has(i)&&n.set(r,i)})),n},n}(t.utils.EventEmitter),tO=function(t){function n(){return t.call(this)||this}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return Gp.ASCENDING},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.apply=function(){},n.prototype.unapply=function(){},n.prototype.isApplied=function(){return!1},n.prototype.get=function(){return null},n.prototype.set=function(t){},n.prototype.toDirty=function(){},n.prototype.update=function(){},Object.defineProperty(n.prototype,"indices",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.map=function(t){return t},n.prototype.unmap=function(t){return t},n}(t.utils.EventEmitter),nO=function(n){function i(t){var i=n.call(this)||this;if(i.p=null,i.qc=i.toAccessor(t),i.nf=new Pp(i),i.Ob=[],i.Rb=!1,i.kb=[],i.Lb=new WeakMap,i.ai=!!(null==t?void 0:t.reverse),i.tf=i.toSelection(null==t?void 0:t.selection),i.pf=new Kp(i),i.Db=new tO,t){var r=t.filter;r&&i.pf.set(r);var e=t.on;if(e)for(var u in e){var s=e[u];s&&i.on(u,s)}}return i.nodes=null==t?void 0:t.nodes,i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:wt(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new $p(this,t)},i.prototype.toAccessor=function(t){return new qp(t)},i.prototype.bind=function(t){this.p=t},Object.defineProperty(i.prototype,"nodes",{get:function(){return this.yb},set:function(t){this.yb=t,this.Rb=!0,this.tf.onNodeChange(t),this.pf.toDirty(),this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rows",{get:function(){return this.Rb&&(this.Rb=!1,this.updateRows(this.yb)),this.Ob},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supplimentals",{get:function(){return this.kb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"accessor",{get:function(){return this.qc},enumerable:!1,configurable:!0}),i.prototype.updateRows=function(t){var n=this.Ob,i=this.kb,r=this.Lb;if(null!=t){var e=this.qc,u=this.newRows(t,0,0,n,i,r,this.ai,e.toChildren,e.hasChildren);u!==n.length&&(n.length=u,i.length=u)}else n.length=0,i.length=0},i.prototype.toSupplimental=function(t,n,i){return t<<2|(n?2:0)|(i?1:0)},i.prototype.newRows=function(t,n,i,r,e,u,s,h,o){for(var a=t.length,c=s?-1:1,f=s?a-1:0;0<=f&&f<a;f+=c){var l=t[f],v=h(l),b=u.has(l),d=this.toSupplimental(i,o(l,v),b);n<r.length?(r[n]=l,e[n]=d):(r.push(l),e.push(d)),n+=1,b&&v&&(n=this.newRows(v,n,i+1,r,e,u,s,h,o))}return n},i.prototype.update=function(t){var n=this.p;n&&n.update(t)},i.prototype.size=function(){return this.rows.length},i.prototype.get=function(t){var n=this.rows;return 0<=t&&t<n.length?n[t]:null},i.prototype.expand=function(t){var n=this.Lb;return!n.has(t)&&(n.set(t,1),this.Rb=!0,this.pf.toDirty(),this.update(!0),!0)},i.prototype.collapse=function(t){var n=this.Lb;return!!n.has(t)&&(n.delete(t),this.Rb=!0,this.pf.toDirty(),this.update(!0),!0)},i.prototype.isCollapsed=function(t){return!this.Lb.has(t)},i.prototype.isExpanded=function(t){return this.Lb.has(t)},i.prototype.toggle=function(t){return this.isExpanded(t)?this.collapse(t):this.expand(t)},i.prototype.open=function(t){return this.expand(t)},i.prototype.close=function(t){return this.collapse(t)},i.prototype.isOpened=function(t){return this.isExpanded(t)},i.prototype.each=function(t,n,i){var r=this.rows;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this.pf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.Db},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),iO=function(){function t(t,n){var i,r,e;this.p=t,this.vs=null!==(i=null==n?void 0:n.enable)&&void 0!==i&&i,this.xb=null===(r=null==n?void 0:n.filterable)||void 0===r||r,this.Bb=null===(e=null==n?void 0:n.emittable)||void 0===e||e}return Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this.vs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFilterable",{get:function(){return this.xb},set:function(t){this.xb=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmittable",{get:function(){return this.Bb},set:function(t){this.Bb=t},enumerable:!1,configurable:!0}),t.prototype.newIteratee=function(t,n){var i=this.p,r=i.column,e=i.columnIndex;if(null!=r&&null!=e){var u=r.getter,s=r.setter;if(this.Bb){var h=t.data;return function(t,i){return u(t,e)!==n&&(s(t,e,n),h.emit("change",n,!n,t,i,e,h),!0)}}return function(t){return u(t,e)!==n&&(s(t,e,n),!0)}}return null},t.prototype.execute=function(t){var n,i=null===(n=this.p.header)||void 0===n?void 0:n.table;if(i){var r=this.newIteratee(i,t);if(r){var e=!1;this.xb?i.data.mapped.each((function(t,n,i,u){r(t,u)&&(e=!0)})):i.data.each((function(t,n){r(t,n)&&(e=!0)})),e&&i.body.update(!0)}}},t}(),rO=t.interaction.InteractionEvent,eO=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){null!=t?(this.jh=t.header,this.hb=t.column,this.sb=t.columnIndex,this.Pb=new iO(this,t.check)):this.Pb=new iO(this),n.prototype.init.call(this,t),this.initOnClick(t)},Object.defineProperty(i.prototype,"column",{get:function(){return this.hb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"columnIndex",{get:function(){return this.sb},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"header",{get:function(){return this.jh},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"check",{get:function(){return this.Pb},enumerable:!1,configurable:!0}),i.prototype.initOnClick=function(t){var n=this,i=this.hb;if(i){var r=i.sorting.enable,e=this.Pb.isEnabled;if(e||r){this.on(ir.tap,(function(t){n.onClick(t)}));var u=this.state;u.lock(),u.set(Sp.SORTABLE,r),u.set(Sp.CHECKABLE,e),u.unlock()}}},Object.defineProperty(i.prototype,"sorter",{get:function(){var t=this,n=this.Db;if(null==n){var i=this.jh;if(!i)return null;var r=i.table;if(!r)return null;n=r.data.sorter,this.Db=n,this.Fb=this.Fb||function(){t.onSorterChange()},n.on("change",this.Fb)}return n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comparator",{get:function(){var t=this.hb;return t&&t.sorting.comparator||null},enumerable:!1,configurable:!0}),i.prototype.onSorterChange=function(){var t=this.comparator;if(t){var n=this.Db;if(n){var i=Sp.SORTED_ASCENDING,r=Sp.SORTED_DESCENDING;n.isApplied()&&n.get()===t?n.order===Gp.ASCENDING?this.state.set(i,r):this.state.set(r,i):this.state.removeAll(i,r)}}},i.prototype.toClickPosition=function(n){var i=this.Ub||new t.Point;return this.Ub=i,n.data.getLocalPosition(this,i).x},i.prototype.isCheckClicked=function(t){if(t instanceof rO&&this.Pb.isEnabled){if(!this.isSortable)return!0;var n=this.mh[1];if(n&&null!=n.image){var i=this.toClickPosition(t),r=n.bound,e=n.margin.horizontal;return r.left-e<=i&&i<=r.right+e}}return!1},i.prototype.onClick=function(t){this.state.isActionable&&this.activate(t)},i.prototype.activate=function(t){this.onActivate(t)},i.prototype.onActivate=function(t){this.isCheckClicked(t)?(this.onToggleStart(),this.onToggleEnd()):(this.doSort(t),this.emit("active",this))},i.prototype.doSort=function(t){if(this.isSortable){var n=this.comparator;if(n){var i=this.sorter;i&&(i.get()===n?i.order===Gp.ASCENDING?(i.order=Gp.DESCENDING,i.apply()):(i.set(null),i.apply()):(i.set(n),i.order=Gp.ASCENDING,i.apply()))}}},Object.defineProperty(i.prototype,"isSortable",{get:function(){var t=this.hb;return!!t&&t.sorting.enable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isToggle",{get:function(){return this.Pb.isEnabled},enumerable:!1,configurable:!0}),i.prototype.toggle=function(){this.state.isActionable&&this.isToggle&&(this.onToggleStart(),this.onToggleEnd())},i.prototype.onToggleStart=function(){this.state.isActive=!this.state.isActive},i.prototype.onToggleEnd=function(){this.state.isActive?(this.Pb.execute(!0),this.emit("active",this)):(this.Pb.execute(!1),this.emit("inactive",this))},i.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.isToggle?this.onToggleStart():this.state.isPressed=!0)},i.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.isToggle?this.onToggleEnd():(this.state.isPressed&&this.activate(t),this.state.isPressed=!1))},i.prototype.onKeyDown=function(t){return nr.isActivateKey(t)&&this.onActivateKeyDown(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyUp=function(t){return nr.isActivateKey(t)&&this.onActivateKeyUp(t),n.prototype.onKeyUp.call(this,t)},i.prototype.getType=function(){return"DTableHeaderCell"},i.prototype.destroy=function(){var t=this.Db,i=this.Fb;t&&i&&t.off("change",i),this.Db=void 0,this.Fb=void 0,n.prototype.destroy.call(this)},i}(Nl),uO=function(t){function n(n){var i,r,e=this;(e=t.call(this,n)||this).Gb=null!==(i=n.table)&&void 0!==i?i:null;var u=null!==(r=n.offset)&&void 0!==r?r:0;return e.vn=u,e.transform.position.y=u,e.initCells(n,e.fb,e.cb),e}return _(n,t),Object.defineProperty(n.prototype,"table",{get:function(){return this.Gb},enumerable:!1,configurable:!0}),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.vn,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new eO(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=n.header||i.cell;return null!=r?(void 0===r.weight&&(r.weight=n.weight),void 0===r.width&&(r.width=n.width),void 0===r.text?r.text={value:n.label}:void 0===r.text.value&&(r.text.value=n.label),void 0===r.header&&(r.header=this),void 0===r.column&&(r.column=n),void 0===r.columnIndex&&(r.columnIndex=t),r):{weight:n.weight,width:n.width,text:{value:n.label},header:this,column:n,columnIndex:t}},n.prototype.getType=function(){return"DTableHeader"},n}(xp),sO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getOffsetVerticalStart=function(t){return.5*t+this.p.body.position.y},n}(Hd),hO=function(t,n){return t[n]},oO=function(t,n,i){t[n]=i},aO=function(){return""},cO=function(){},fO=function(t){if(null!=t){var n=t.length;if(n<=1){var i=t[0];return function(t){return Object.prototype.hasOwnProperty.call(t,i)}}return function(i){for(var r=0;r<n;++r){var e=t[r];if(!(e in i))return!1;i=i[e]}return!0}}return function(t,n){return n<t.length}},lO=function(t,n){return Ot(t)?fO(n):null!=t&&t},vO=function(t,n){var i,r=t.editing,e=t.editable;return r?{enable:lO(null!==(i=r.enable)&&void 0!==i?i:e,n),formatter:r.formatter,unformatter:r.unformatter,validator:r.validator}:{enable:lO(e,n)}},bO=function(t,n){return function(i,r){var e=t(i,n),u=t(r,n);return e<u?-1:u<e?1:0}},dO=function(t,n,i){var r=i.sorting,e=i.sortable;return r?r.enable||e?{enable:!0,comparator:r.comparator||bO(t,n)}:{enable:!1}:e?{enable:!0,comparator:bO(t,n)}:{enable:!1}},gO=function(t){return null==t?void 0:t instanceof fw?t:new fw(t)},mO=function(t){return null==t?void 0:"open"in t?t:new tg(t)},wO=function(t){return t.value},pO=function(){},OO=function(t){return t?{getter:t.getter||wO,setter:t.setter||pO,menu:gO(t.menu),multiple:gO(t.multiple),dialog:mO(t.dialog),promise:t.promise}:{getter:wO,setter:pO}},DO=function(t){var n=t.state;return null!=n?Ot(n)||mt(n)?{initial:n,modifier:void 0}:{initial:void 0,modifier:n}:{initial:void 0,modifier:void 0}},EO=function(t,n){var i=t.renderable;return Ot(i)?fO(n):null==i||i},MO=function(t,n){var i,r=n.weight,e=n.width;null!=r?null!=e&&(e=void 0):null==e&&(r=1);var u=Ai(null!==(i=n.type)&&void 0!==i?i:vp.TEXT,vp),s=function(t,n){var i=t.align;if(null!=i)return Ot(i)?ns[i]:i;switch(n){case vp.TEXT:return ns.LEFT;case vp.REAL:case vp.INTEGER:return ns.RIGHT;case vp.BUTTON:case vp.INDEX:case vp.SELECT:case vp.ACTION:case vp.LINK:case vp.CHECK:case vp.CHECK_SINGLE:case vp.COLOR:return ns.CENTER;default:return ns.LEFT}}(n,u),h=n.label||"",o=function(t){return null!=t.path?t.path.split("."):null}(n),a=function(t,n,i){var r=t.getter;if(r)return r;switch(n){case vp.ACTION:case vp.LINK:return aO;default:return null==i?hO:function(t,n){if(t.length<=1){var i=t[0];return void 0===n?function(t){return t[i]}:function(t){return Object.prototype.hasOwnProperty.call(t,i)?t[i]:n}}return void 0===n?function(n){for(var i=0,r=t.length-1;i<r;++i)n=n[t[i]];return n[t[t.length-1]]}:function(i){for(var r=0,e=t.length-1;r<e;++r)i=i[t[r]];var u=t[t.length-1];return Object.prototype.hasOwnProperty.call(i,u)?i[u]:n}}(i,t.default)}}(n,u,o);return{weight:r,width:e,type:u,label:h,getter:a,setter:function(t,n,i){var r=t.setter;if(r)return r;switch(n){case vp.BUTTON:case vp.ACTION:case vp.LINK:return cO;default:return null==i?oO:function(t){if(t.length<=1){var n=t[0];return function(t,i,r){t[n]=r}}return function(n,i,r){for(var e=0,u=t.length-1;e<u;++e)n=n[t[e]]||{};n[t[t.length-1]]=r}}(i)}}(n,u,o),formatter:n.formatter,renderable:EO(n,o),align:s,state:DO(n),editing:vO(n,o),sorting:dO(a,t,n),header:n.header,body:n.body,selecting:OO(n.selecting),category:n.category,frozen:n.frozen,offset:0,link:n.link}},SO=function(t){function n(n){var i=t.call(this,n)||this,r=i.content;r.setWidth(i.toContentWidth(n));var e=i.body;r.addChild(e),e.data.selection.type!==yp.NONE&&i.on(ir.tap,(function(t){e.onRowClick(t)}));var u=i.header;u&&r.addChild(u);for(var s=i.categories,h=s.length-1;0<=h;--h)r.addChild(s[h]);return e.update(),i}return _(n,t),Object.defineProperty(n.prototype,"columns",{get:function(){var t=this.fb;if(null==t){var n=this.zn;t=n?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(MO(i,t[i]));return n}(n.columns):[],this.fb=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"frozen",{get:function(){var t=this.cb;return null==t&&(t=function(t){for(var n=t.length-1;0<=n;--n)if(!0===t[n].frozen)return n+1;return 0}(this.columns),this.cb=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"categories",{get:function(){var t=this.Hb;return null==t&&(t=this.newCategories(this.zn,this.columns,this.frozen),this.Hb=t),t},enumerable:!1,configurable:!0}),n.prototype.initContent=function(n){t.prototype.initContent.call(this,n),n.state.isFocusReverse=!0},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.body.update()},n.prototype.onResize=function(n,i,r,e){var u=this.scrollbar;u.lock();var s=this.body;s.lock(),t.prototype.onResize.call(this,n,i,r,e),s.update(),s.unlock(!0),u.unlock(!0)},n.prototype.getCategoryCount=function(t){for(var n=0,i=0,r=t.length;i<r;++i){var e=t[i].category;if(null!=e){var u=Ot(e)?1:e.length;n=Math.max(n,u)}}return n},n.prototype.toCategoryLabel=function(t,n){if(n)if(Ot(n)){if(0===t)return n}else if(t<n.length)return n[t]},n.prototype.isSameCategory=function(t,n,i){if(null!=n){if(null!=i){if(Ot(n))return Ot(i)?0<t||n===i:0<t?i.length<=t:1===i.length&&n===i[0];if(Ot(i))return 0<t?n.length<=t:1===n.length&&n[0]===i;if(n.length<=t&&i.length<=t)return!0;if(i.length===n.length){for(var r=t,e=n.length;r<e;++r)if(n[r]!==i[r])return!1;return!0}return!1}return Ot(n)?0<t:n.length<=t}return null==i||(Ot(i)?0<t:i.length<=t)},n.prototype.toCategoryColumns=function(t,n,i){for(var r=[],e=null,u=null,s=0,h=n.length;s<h;++s){var o=n[s];s!==i&&u&&e&&this.isSameCategory(t,e.category,o.category)?null!=u.weight&&null!=o.weight?u.weight+=o.weight:null!=u.width&&null!=o.width?u.width+=o.width:(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u)):(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u))}return r},n.prototype.toCategoryOptions=function(t,n,i,r,e){return n?(void 0===n.columns&&(n.columns=this.toCategoryColumns(t,i,r)),null==n.frozen&&(n.frozen=r),null==n.offset&&(n.offset=e),n):{columns:this.toCategoryColumns(t,i,r),frozen:r,offset:e}},n.prototype.newCategories=function(t,n,i){for(var r=[],e=0,u=this.getCategoryCount(n)-1;0<=u;--u){var s=new Xp(this.toCategoryOptions(u,null==t?void 0:t.category,n,i,e));r.push(s),e+=s.height}return r},n.prototype.onDblClick=function(n,i){var r=this.body.onDblClick(n,i);return t.prototype.onDblClick.call(this,n,i)||r},n.prototype.newScrollBar=function(t){var n=this;return new sO(this,t,(function(t){n.onScrollBarUpdate(t)}))},n.prototype.toContentWidth=function(t){var n=0,i=null==t?void 0:t.columns;if(i)for(var r=0,e=i.length;r<e;++r){var u=i[r].width;null!=u&&(n+=u)}return 0<n?function(t){return Math.max(t,n)}:"100%"},n.prototype.getHeaderOffset=function(){var t=this.zb;return null==t&&(t=this.newHeaderOffset(),this.zb=t),t},n.prototype.newHeaderOffset=function(){for(var t=0,n=this.categories,i=0,r=n.length;i<r;++i)t+=n[i].height;return t},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.jh;return void 0===t&&(t=this.newHeader(this.zn,this.columns,this.frozen,this.getHeaderOffset()),this.jh=t),t},enumerable:!1,configurable:!0}),n.prototype.hasHeader=function(t){if(t)for(var n=t.columns,i=0,r=n.length;i<r;++i)if(null!=n[i].label)return!0;return!1},n.prototype.newHeader=function(t,n,i,r){return this.hasHeader(t)?new uO(this.toHeaderOptions(null==t?void 0:t.header,n,i,r)):null},n.prototype.toHeaderOptions=function(t,n,i,r){return t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.table&&(t.table=this),t):{columns:n,frozen:i,offset:r,table:this}},n.prototype.getBodyOffset=function(){var t=this.Vb;return null==t&&(t=this.newBodyOffset(),this.Vb=t),t},n.prototype.newBodyOffset=function(){var t,n;return this.getHeaderOffset()+(null!==(n=null===(t=this.header)||void 0===t?void 0:t.height)&&void 0!==n?n:0)},Object.defineProperty(n.prototype,"body",{get:function(){var t=this.Ie;return null==t&&(t=this.newBody(this.zn,this.columns,this.frozen,this.getBodyOffset()),this.Ie=t),t},enumerable:!1,configurable:!0}),n.prototype.newBody=function(t,n,i,r){return new Vp(this.toBodyOptions(null==t?void 0:t.body,n,i,r,null==t?void 0:t.data))},n.prototype.toBodyOptions=function(t,n,i,r,e){return null!=t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.data&&void 0!==e&&(mt(e)?t.data={rows:e}:t.data=e),void 0===t.height&&void 0===t.weight&&(t.weight=1),t):mt(e)?{columns:n,frozen:i,offset:r,data:{rows:e},weight:1}:{columns:n,frozen:i,offset:r,data:e,weight:1}},Object.defineProperty(n.prototype,"data",{get:function(){return this.body.data},enumerable:!1,configurable:!0}),n.prototype.getFocusedChildClippingRect=function(n,i,r,e,u,s,h,o){t.prototype.getFocusedChildClippingRect.call(this,n,i,r,e,u,s,h,o);var a=this.toCell(n);if(a){var c=i+this.toFrozenCellX(a)-o.x;if(0<c&&(o.x+=c,o.width-=c),a.parent.parent===this.body){var f=this.getBodyOffset();o.y+=f,o.height-=f}}return o},n.prototype.toFrozenCellX=function(t){var n=this.frozen;if(0<n){var i=t.parent.children,r=i.indexOf(t);if(0<=r){var e=i.length;if(n<=e-1-r){var u=i[e-n];return u.position.x+u.width}}}return 0},n.prototype.onKeyDown=function(n){nr.moveFocusHorizontally(n,this);var i=nr.isArrowUpKey(n),r=nr.isArrowDownKey(n);return(i||r)&&this.onKeyDownArrowUpOrDown(n,r),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowUpOrDown=function(t,n){var i=st.getLayer(this);if(null==i)return!1;var r=i.getFocusController(),e=r.get();if(null==e)return!1;var u=this.toCell(e);if(null==u)return!1;var s=u.parent;if(null==s)return!1;var h=r.find(s,!1,!1,n,this);if(null==h)return!1;var o=this.toCell(h);if(null==o)return!1;var a=o.parent;if(null==a)return!1;var c=s.children.indexOf(u);if(c<0)return!1;var f=a.children[c];if(null==f||f===u||!("state"in f))return!1;var l=r.find(f,!0,!0,n,this);return null!=l&&(r.focus(l),!0)},n.prototype.toCell=function(t){for(var n=t;null!=n;){var i=n.parent;if(i instanceof xp)return n instanceof hr?n:null;n=i}return null},n.prototype.getType=function(){return"DTable"},n}(zd),TO=function(t){var n=t.text;if(Ot(n))return n;var i=t.label;if(Ot(i))return i;var r=t.name;return Ot(r)?r:void 0},jO=function(t){var n=t.title;if(Ot(n))return n},NO=function(t){return t.image},IO=function(t){return t.children},CO=function(t){return t.children=[]},AO=function(t){var n,i,r,e,u;this.toLabel=null!==(n=null==t?void 0:t.toLabel)&&void 0!==n?n:TO,this.toTitle=null!==(i=null==t?void 0:t.toTitle)&&void 0!==i?i:jO,this.toImage=null!==(r=null==t?void 0:t.toImage)&&void 0!==r?r:NO,this.toChildren=null!==(e=null==t?void 0:t.toChildren)&&void 0!==e?e:IO,this.newChildren=null!==(u=null==t?void 0:t.newChildren)&&void 0!==u?u:CO},RO={NONE:0,SINGLE:1,MULTIPLE:2},kO=function(){function t(t,n){this.p=t,this.yb=[],this.Wb=[],this.ai=n,this.En=!1}return Object.defineProperty(t.prototype,"nodes",{get:function(){return this.update(),this.yb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"levels",{get:function(){return this.update(),this.Wb},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.En=!0},t.prototype.size=function(){return this.update(),this.yb.length},t.prototype.each=function(t,n,i){this.update();for(var r=this.yb,e=null!=n?Math.max(0,n):0,u=null!=i?Math.min(r.length,i):r.length,s=e;s<u&&!1!==t(r[s],s);++s);},t.prototype.update=function(){if(this.En){this.En=!1;var t=this.p,n=t.nodes,i=t.accessor.toChildren,r=this.yb,e=this.Wb,u=this.newNodes(t,n,0,0,r,e,this.ai,i);r.length!==u&&(r.length=u,e.length=u)}},t.prototype.newNodes=function(t,n,i,r,e,u,s,h){for(var o=n.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=n[c];i<e.length?(e[i]=f,u[i]=r):(e.push(f),u.push(r)),i+=1;var l=h(f);l&&t.isExpanded(f)&&(i=this.newNodes(t,l,i,r+1,e,u,s,h))}return i},t}(),LO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n,r.yb=new Set;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return RO.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){var t=this.yb;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.yb;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.yb;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.yb;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.yb;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.yb;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.yb;return 0<t.size&&(t.clear(),this.onChange(),!0)},n.prototype.clearAndAdd=function(t){var n=this.yb;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.yb,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.yb=i,this.onChange()),n},n.prototype.contains=function(t){return this.yb.has(t)},n.prototype.size=function(){return this.yb.size},n.prototype.isEmpty=function(){return this.yb.size<=0},n.prototype.each=function(t){var n=!1;this.yb.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.yb.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.yb;if(0<n.size){var i=this.newNodes(t,n,new Set);n.size!==i.size&&(this.yb=i,this.onChange())}},n.prototype.newNodes=function(t,n,i){for(var r=this.p.accessor.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];n.has(s)&&i.add(s);var h=r(s);h&&this.newNodes(h,n,i)}return i},n}(t.utils.EventEmitter),yO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n,r.xn=null;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return RO.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.xn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.xn},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.xn:null},n.prototype.add=function(t){return this.xn!==t&&(this.xn=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.xn===t&&(this.xn=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.xn===t?this.xn=null:this.xn=t,this.onChange(),!0},n.prototype.clear=function(){return null!=this.xn&&(this.xn=null,this.onChange(),!0)},n.prototype.clearAndAdd=function(t){return this.xn!==t&&(this.xn=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){if(0<t.length){var n=t[t.length-1];return this.clearAndAdd(n)}return this.clear()},n.prototype.contains=function(t){return this.xn===t},n.prototype.size=function(){return null!=this.xn?1:0},n.prototype.isEmpty=function(){return null==this.xn},n.prototype.each=function(t){var n=this.xn;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.xn;return null!=t?[t]:[]},n.prototype.onChange=function(){this.p.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.xn;if(null!=n){var i=this.newNode(t,n);n!==i&&(this.xn=i,this.onChange())}},n.prototype.newNode=function(t,n){for(var i=this.p.accessor.toChildren,r=0,e=t.length;r<e;++r){var u=t[r];if(n===u)return u;var s=i(u);if(s){var h=this.newNode(s,n);if(null!=h)return h}}return null},n}(t.utils.EventEmitter),xO=function(t){function n(n,i){var r=t.call(this)||this;r.p=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return RO.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){return!1},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onNodeChange=function(t){},n}(t.utils.EventEmitter),BO=function(){function t(t,n){this.p=t,this.Xb=new WeakMap,this.tf=this.toSelection(n),this.qc=new AO(n);var i=new kO(this,!!(null==n?void 0:n.reverse));this.nf=i;var r=null==n?void 0:n.nodes;null!=r?(this.yb=r,i.toDirty()):this.yb=[]}return t.prototype.toSelection=function(t){var n=null==t?void 0:t.selection;switch(null==n?void 0:n.type){case RO.NONE:case"NONE":return new xO(this,n);case RO.MULTIPLE:case"MULTIPLE":return new LO(this,n);default:return new yO(this,n)}},Object.defineProperty(t.prototype,"nodes",{get:function(){return this.yb},set:function(t){this.yb=t,this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.nf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.qc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.tf},enumerable:!1,configurable:!0}),t.prototype.update=function(t){t&&(this.nf.toDirty(),this.tf.onNodeChange(this.yb)),this.p.update(t)},t.prototype.toggle=function(t){var n=this.Xb;return n.has(t)?n.delete(t):n.set(t,1),this.nf.toDirty(),this.update(),!0},t.prototype.expand=function(t){var n=this.Xb;return!n.has(t)&&(n.set(t,1),this.nf.toDirty(),this.update(),!0)},t.prototype.collapse=function(t){var n=this.Xb;return!!n.has(t)&&(n.delete(t),this.nf.toDirty(),this.update(),!0)},t.prototype.expandAll=function(){var t=!1,n=this.Xb;return this.each((function(i){n.has(i)||(n.set(i,1),t=!0)})),!!t&&(this.nf.toDirty(),this.update(),!0)},t.prototype.collapseAll=function(){var t=!1,n=this.Xb;return this.each((function(i){n.has(i)&&(n.delete(i),t=!0)})),!!t&&(this.nf.toDirty(),this.update(),!0)},t.prototype.isCollapsed=function(t){return!this.isExpanded(t)},t.prototype.isExpanded=function(t){return this.Xb.has(t)},t.prototype.clear=function(){var t=this.yb;return 0<t.length&&(t.length=0,this.nf.toDirty(),this.tf.clear(),this.update(),!0)},t.prototype.remove=function(t){var n=!1;return this.each((function(i,r,e){return i!==t||(e.splice(r,1),n=!0,!1)})),!!n&&(this.nf.toDirty(),this.tf.remove(t),this.update(),!0)},t.prototype.add=function(t,n){var i=!1;if(n){var r=this.qc,e=r.toChildren(n);if(e)e.push(t),i=!0;else{var u=r.newChildren(n);u&&(u.push(t),i=!0)}}else{var s=this.yb;s?s.push(t):this.yb=[t],i=!0}return i&&(this.nf.toDirty(),this.update()),!0},t.prototype.addBefore=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e,0,t),i=!0,!1)})),i&&(this.nf.toDirty(),this.update()),i},t.prototype.addAfter=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e+1,0,t),i=!0,!1)})),i&&(this.nf.toDirty(),this.update()),i},t.prototype.each=function(t){var n=this.yb;n&&this.Zc(n,null,t)},t.prototype.Zc=function(t,n,i){for(var r=this.qc.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];if(!1===i(s,e,t,n))return;var h=r(s);h&&this.Zc(h,s,i)}},t}(),_O={HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED"},PO=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Qn=new Pb(r.Qn),r.Xt=n,r}return _(n,t),Object.defineProperty(n.prototype,"node",{get:function(){return this.xn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.xn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.hu},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){return this.Xt},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.xn;void 0!==t&&this.Xt.toggle(t)},n.prototype.set=function(t,n,i){var r,e=this.Xt,u=i||this.xn!==t;if(u){this.xn=t,this.hu=n;var s=e.accessor;this.text=s.toLabel(t),this.title=null!==(r=s.toTitle(t))&&void 0!==r?r:"",this.image=s.toImage(t)}var h=e.mapped.levels[n];this.Qn.adjLeft(this.theme.getLevelPadding(h));var o=e.accessor.toChildren(t),a=!!(o&&0<o.length),c=this.state;c.lock(),c.set(ct.ACTIVE,e.selection.contains(t)),c.remove(ct.DISABLED),c.set(_O.HAS_CHILDREN,a),c.set(_O.OPENED,e.isExpanded(t)),c.unlock(),u&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.xn){this.xn=void 0,this.hu=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ct.DISABLED),t.remove(ct.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onSelect=function(t,n){var i=this.Xt,r=i.selection;if(r.type!==RO.MULTIPLE)r.clearAndAdd(n);else{var e=t&&"data"in t?t.data.originalEvent:t;if(null==e?void 0:e.ctrlKey)r.toggle(n);else if(null==e?void 0:e.shiftKey){var u=i.mapped,s=r.last;if(n===s)r.clearAndAdd(n);else{var h=!1,o=!1,a=[];u.each((function(t){if(h){if(o){if(a.unshift(t),t===n)return!1}else if(a.push(t),t===s)return!1}else t===n?(h=!0,o=!1,a.push(t)):t===s&&(h=!0,o=!0,a.push(t))})),r.clearAndAddAll(a)}}else r.clearAndAdd(n)}},n.prototype.onKeyDown=function(n){var i;return nr.isActivateKey(n)&&this.onKeyDownActivate(n),nr.isArrowRightKey(n)&&void 0!==(i=this.xn)&&this.state.is(_O.HAS_CHILDREN)&&this.Xt.expand(i),nr.isArrowLeftKey(n)&&void 0!==(i=this.xn)&&this.state.is(_O.HAS_CHILDREN)&&this.Xt.collapse(i),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){if(this.state.isActionable&&this.state.isFocused){var n=this.xn;return void 0!==n&&this.onSelect(t,n),!0}return!1},n.prototype.getType=function(){return"DTreeItemText"},n}(Ts),FO=function(t){function n(n,i){var r,e=this;return(e=t.call(this,n,i)||this).ph=Ai(null!==(r=null==i?void 0:i.when)&&void 0!==r?r:Qu.CLICKED,Qu),e.on(ir.tap,(function(t){e.onClick(t)})),e}return _(n,t),n.prototype.onClick=function(t){this.ph===Qu.CLICKED&&this.state.isActionable&&this.activate(t)},n.prototype.onDblClick=function(n,i){return this.ph===Qu.DOUBLE_CLICKED&&this.activate(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.activate=function(t){this.onActivate(t)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.activate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return nr.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return nr.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTreeItemButton"},n}(PO),UO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(i){t.prototype.onActivate.call(this,i);var r=this.xn;void 0!==r&&(this.state.is(_O.HAS_CHILDREN)?i&&"data"in i&&(this.toLocal(i.data.global,void 0,n.WORK_CONTAINS_POINT).x<=this.padding.getLeft()?this.toggle():this.onSelect(i,r)):this.onSelect(i,r))},n.prototype.getType=function(){return"DTreeItemNonEditable"},n}(FO),GO=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new UO(t)},n}(Dd),HO=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.gf;return null==t&&(t=this.newUpdater(this.data,this.content,this.zn),this.gf=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new GO(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.Xt;return null==t&&(t=this.toData(this.zn),this.Xt=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.nodes||t.value)||[];return mt(n)?new BO(this,{nodes:n}):"add"in n?n:new BO(this,n)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nodes",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),n.prototype.toggle=function(t){return this.data.toggle(t)},n.prototype.expand=function(t){return this.data.expand(t)},n.prototype.collapse=function(t){return this.data.collapse(t)},n.prototype.expandAll=function(){return this.data.expandAll()},n.prototype.collapseAll=function(){return this.data.collapseAll()},n.prototype.isCollapsed=function(t){return this.data.isCollapsed(t)},n.prototype.isExpanded=function(t){return this.data.isExpanded(t)},n.prototype.clear=function(){return this.data.clear()},n.prototype.remove=function(t){return this.data.remove(t)},n.prototype.add=function(t,n){return this.data.add(t,n)},n.prototype.addBefore=function(t,n){return this.data.addBefore(t,n)},n.prototype.addAfter=function(t,n){return this.data.addAfter(t,n)},n.prototype.each=function(t){return this.data.each(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!1),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DTree"},n}(zd),zO={__proto__:null,loadAll:Av,loadMenuItemAll:Cv,loadMenuItemExpandable:cv,loadMenuItem:$l,loadMenuSidedItemExpandable:Iv,loadMenuSidedItem:wv,deserializeActionValue:go,EShapeActionBases:fn,EShapeActionEnvironment:ln,EShapeActionExpressions:vn,EShapeActionOpenDialogExtensions:kh,EShapeActionOpenExtensions:xh,EShapeActionOpenOpeners:Ze,EShapeActionRuntimeBase:bn,EShapeActionRuntimeBlinkBrighten:mn,EShapeActionRuntimeBlinkColorFill:wn,EShapeActionRuntimeBlinkColorStroke:pn,EShapeActionRuntimeBlinkDarken:On,EShapeActionRuntimeBlinkOpacity:Dn,EShapeActionRuntimeBlinkVisibility:En,EShapeActionRuntimeBlink:gn,EShapeActionRuntimeChangeColorBrightness:_n,EShapeActionRuntimeChangeColorCode:Fn,EShapeActionRuntimeChangeColor:kn,EShapeActionRuntimeChangeCursor:Gn,EShapeActionRuntimeChangeTextNumber:Si,EShapeActionRuntimeChangeTextText:Ti,EShapeActionRuntimeConditional:dn,EShapeActionRuntimeEmitEvent:Qe,EShapeActionRuntimeGestureLayer:Ue,EShapeActionRuntimeGestureShape:He,EShapeActionRuntimeMiscEmitEvent:tu,EShapeActionRuntimeMiscExecute:Ru,EShapeActionRuntimeMiscHtmlElement:vu,EShapeActionRuntimeMiscInputInput:Ou,EShapeActionRuntimeMiscInputInteger:Eu,EShapeActionRuntimeMiscInputNumber:Du,EShapeActionRuntimeMiscInputReal:Mu,EShapeActionRuntimeMiscInputText:Tu,EShapeActionRuntimeMiscInput:pu,EShapeActionRuntimeMiscWriteBoth:Nu,EShapeActionRuntimeMiscWriteLocal:Iu,EShapeActionRuntimeMiscWriteRemote:Cu,EShapeActionRuntimeMiscWrite:ju,EShapeActionRuntimeOpenDialogBoolean:zs,EShapeActionRuntimeOpenDialogDate:Ch,EShapeActionRuntimeOpenDialogDatetime:Mh,EShapeActionRuntimeOpenDialogExtension:Lh,EShapeActionRuntimeOpenDialogInteger:Zs,EShapeActionRuntimeOpenDialogReal:$s,EShapeActionRuntimeOpenDialogText:ih,EShapeActionRuntimeOpenDialogTime:jh,EShapeActionRuntimeOpenDialog:Hs,EShapeActionRuntimeOpen:Lu,EShapeActionRuntimeShowHideLayer:Uh,EShapeActionRuntimeShowHideShape:Hh,EShapeActionRuntimeShowHide:Ph,EShapeActionRuntimeTransformMoveAbsoluteX:Wh,EShapeActionRuntimeTransformMoveAbsoluteY:Xh,EShapeActionRuntimeTransformMoveForwardOrBackward:Kh,EShapeActionRuntimeTransformMoveLeftOrRight:Yh,EShapeActionRuntimeTransformMoveRelativeX:Jh,EShapeActionRuntimeTransformMoveRelativeY:Zh,EShapeActionRuntimeTransformMove:Vh,EShapeActionRuntimeTransformResizeHeightAbsolute:ro,EShapeActionRuntimeTransformResizeHeightRelative:eo,EShapeActionRuntimeTransformResizeSizeAbsolute:uo,EShapeActionRuntimeTransformResizeSizeRelative:so,EShapeActionRuntimeTransformResizeWidthAbsolute:ho,EShapeActionRuntimeTransformResizeWidthRelative:oo,EShapeActionRuntimeTransformResize:io,EShapeActionRuntimeTransformRotateAbsolute:fo,EShapeActionRuntimeTransformRotateRelative:lo,EShapeActionRuntimeTransformRotate:co,EShapeActionRuntimes:Rv,EShapeActionValueBase:Sn,EShapeActionValueBlinkType:Mn,EShapeActionValueBlink:In,EShapeActionValueChangeColorBrightness:Pn,EShapeActionValueChangeColorCode:Un,EShapeActionValueChangeColorTarget:Rn,EShapeActionValueChangeColorTypeLegacy:yn,EShapeActionValueChangeColorType:Ln,EShapeActionValueChangeColorTypes:xn,EShapeActionValueChangeColor:Bn,EShapeActionValueChangeCursor:Hn,EShapeActionValueChangeTextType:ji,EShapeActionValueChangeText:Ni,EShapeActionValueDeserializers:mo,EShapeActionValueEmitEvent:$e,EShapeActionValueGestureOperationType:Pe,EShapeActionValueGestureType:ze,EShapeActionValueGesture:We,EShapeActionValueMiscEmitEvent:kv,EShapeActionValueMiscExecute:ku,EShapeActionValueMiscHtmlElement:Lv,EShapeActionValueMiscInput:yv,EShapeActionValueMiscType:Ve,EShapeActionValueMiscWrite:xv,EShapeActionValueMisc:Au,EShapeActionValueOnInputAction:mu,EShapeActionValueOnInputActions:wu,EShapeActionValueOpenDialogExtension:yh,EShapeActionValueOpenDialogType:Ah,EShapeActionValueOpenDialog:Rh,EShapeActionValueOpenExtension:Bh,EShapeActionValueOpenType:yu,EShapeActionValueOpen:xu,EShapeActionValueOpetyped:qh,EShapeActionValueShowHideLayer:Gh,EShapeActionValueShowHideShape:zh,EShapeActionValueShowHideType:_h,EShapeActionValueShowHide:Fh,EShapeActionValueSubtyped:Tn,EShapeActionValueTransformMoveType:Qh,EShapeActionValueTransformMove:to,EShapeActionValueTransformResizeType:no,EShapeActionValueTransformResize:ao,EShapeActionValueTransformRotateType:vo,EShapeActionValueTransformRotate:bo,EShapeActionValueTransformType:$h,EShapeActionValueType:jn,EShapeActionValues:Nn,EShapeAction:ht,EShapeActions:qe,loadShapeAll:jl,loadShapeBar:So,loadShapeButton:Wo,loadShapeCircle:ra,loadShapeClipperEx:function(){cu=!0},isShapeClipperExLoaded:fu,loadShapeConnectorElbow:ec,loadShapeConnectorLine:uc,loadShapeEmbedded:lc,loadShapeGroupShadowed:Ec,loadShapeGroup:wc,loadShapeImage:Nc,loadShapeLabel:zc,loadShapeLineOfCircles:mf,loadShapeLineOfRectangleRoundeds:Ef,loadShapeLineOfRectangles:Nf,loadShapeLineOfTriangleRoundeds:zf,loadShapeLineOfTriangles:Jf,loadShapeLine:Xc,loadShapeNull:$f,loadShapeRectangleRounded:el,loadShapeRectangle:nl,loadShapeSemicircle:ml,loadShapeTriangleRounded:Tl,loadShapeTriangle:Dl,BAR_VERTEX_COUNT:4,BAR_INDEX_COUNT:2,buildBarClipping:c,buildBarIndex:f,buildBarVertexStepAndColorFill:l,buildBarUv:v,CIRCLE_VERTEX_COUNT:9,CIRCLE_INDEX_COUNT:8,CIRCLE_WORLD_SIZE:Xo,buildCircleClipping:Yo,buildCircleIndex:Jo,buildCircleVertex:Zo,buildCircleStep:qo,buildCircleUv:Qo,buildColor:V,IMAGE_SDF_VERTEX_COUNT:9,IMAGE_SDF_INDEX_COUNT:8,IMAGE_SDF_WORLD_SIZE:Ic,buildImageSdfClipping:Ac,buildImageSdfIndex:Rc,buildImageSdfStep:kc,buildImageSdfVertex:Lc,buildImageSdfUv:yc,toLineOfAnyPointCount:qc,buildLineOfAnyColor:Qc,toPointsCount:ua,toLinePointCount:sa,toLineVertexCount:ha,toLineIndexCount:oa,buildLineClipping:aa,buildLineIndex:ca,buildLineUv:fa,buildLineVertexStepAndColorFill:la,buildNullClipping:Kc,buildNullIndex:function(t,n,i,r){for(var e=3*i,u=3*(i+r);e<u;e+=3)t[e+0]=n,t[e+1]=n,t[e+2]=n},buildNullVertex:Yc,buildNullStep:Jc,buildNullUv:Zc,RECTANGLE_ROUNDED_VERTEX_COUNT:jo,RECTANGLE_ROUNDED_INDEX_COUNT:24,RECTANGLE_ROUNDED_WORLD_SIZE:No,buildRectangleRoundedIndex:Co,buildRectangleRoundedVertex:Ao,buildRectangleRoundedClipping:Ro,buildRectangleRoundedStep:ko,buildRectangleRoundedUv:Lo,RECTANGLE_VERTEX_COUNT:ya,RECTANGLE_INDEX_COUNT:xa,RECTANGLE_WORLD_SIZE:Ba,buildRectangleClipping:Pa,buildRectangleIndex:Fa,buildRectangleVertex:Ua,buildRectangleStep:Ga,buildRectangleUv:za,SEMICIRCLE_VERTEX_COUNT:6,SEMICIRCLE_INDEX_COUNT:4,SEMICIRCLE_WORLD_SIZE:ul,buildSemicircleClipping:hl,buildSemicircleIndex:ol,buildSemicircleVertex:al,buildSemicircleStep:cl,buildSemicircleUv:fl,TEXT_VERTEX_COUNT:4,TEXT_INDEX_COUNT:2,TEXT_FMIN:D,toTextBufferCount:M,buildTextClipping:S,buildTextIndex:T,buildTextStep:j,buildTextVertex:I,TRIANGLE_ROUNDED_VERTEX_COUNT:If,TRIANGLE_ROUNDED_INDEX_COUNT:15,TRIANGLE_ROUNDED_WORLD_SIZE:Cf,buildTriangleRoundedIndex:Rf,buildTriangleRoundedVertex:kf,buildTriangleRoundedClipping:Lf,buildTriangleRoundedStep:yf,buildTriangleRoundedUv:xf,TRIANGLE_VERTEX_COUNT:7,TRIANGLE_INDEX_COUNT:3,TRIANGLE_WORLD_SIZE:pa,buildTriangleClipping:Da,buildTriangleIndex:Ea,buildTriangleVertex:Ma,buildTriangleStep:Sa,buildTriangleUv:Ta,BuilderBar:un,BuilderBase:W,BuilderCircle:$o,BuilderImageSdf:xc,BuilderLabel:Fc,BuilderLineOfAny:$c,BuilderLineOfCircles:lf,BuilderLineOfRectangleRoundeds:wf,BuilderLineOfRectangles:Mf,BuilderLineOfTriangleRoundeds:Bf,BuilderLineOfTriangles:Vf,BuilderLine:wa,BuilderMarkerCircleHead:Ra,BuilderMarkerCircleTail:ka,BuilderMarkerCircle:Aa,BuilderMarkerRectangleHead:Xa,BuilderMarkerRectangleTail:Wa,BuilderMarkerRectangle:Va,BuilderMarkerTriangleHead:Ia,BuilderMarkerTriangleTail:Ca,BuilderMarkerTriangle:Na,BuilderNull:La,BuilderRectanglePivoted:sc,BuilderRectangleRounded:yo,BuilderRectangle:Mc,BuilderSemicircle:ll,BuilderText:sn,BuilderTriangleRounded:El,BuilderTriangle:wl,toTransformLocalId:X,toTexture:K,toTextureTransformId:Y,toTextureUvs:J,copyClipping:tf,copyIndex:nf,copyStep:rf,copyUvs:ef,copyVertex:uf,createBarUploaded:hn,createButtonUploaded:Bo,createCircleUploaded:ta,createRectanglePivotedUploaded:hc,createGroupUploaded:oc,createImageSdfUploaded:Bc,createImageSdf:Bv,createImage:function(t){return Do(t).then((function(t){return new Tc(t)}))},createLabelUploaded:Uc,createLineOfAnyUploaded:vf,createLineOfCirclesUploaded:bf,createLineOfRectangleRoundedsUploaded:pf,createLineOfRectanglesUploaded:Sf,createLineOfTriangleRoundedsUploaded:_f,createLineOfTrianglesUploaded:Wf,createLineUploaded:qa,createLine:function(t,n,i,r){for(var e=Jr(t,[0,0,0,0]),u=.5*(e[2]+e[0]),s=.5*(e[3]+e[1]),h=e[2]-e[0],o=e[3]-e[1],a=[],c=0,f=t.length;c<f;c+=2)a.push(t[c]-u,t[c+1]-s);var l=new Vc;return l.stroke.set(!0,void 0,void 0,i),l.transform.position.set(u,s),l.size.set(h,o),l.points.set(a,n,r),l},createNullUploaded:Zf,createRectangleRoundedUploaded:xo,createRectangleUploaded:Sc,createSemicircleUploaded:vl,createTriangleRoundedUploaded:Ml,createTriangleUploaded:pl,deserializeAll:Fr,deserializeBar:Mo,deserializeBase:Eo,deserializeButton:Go,deserializeCircle:ia,deserializeConnectorElbow:tc,deserializeConnectorLine:ic,onDeserializedConnectorLine:rc,deserializeEmbedded:fc,deserializeEmbeddedLayer:Ke,deserializeGradient:po,deserializeGroupShadowed:Dc,deserializeGroup:mc,deserializeImageSdf:Pc,deserializeImage:jc,deserializeLabel:Hc,deserializeLineOfCircles:gf,deserializeLineOfRectangleRoundeds:Df,deserializeLineOfRectangles:jf,deserializeLineOfTriangleRoundeds:Hf,deserializeLineOfTriangles:Yf,deserializeLine:Wc,deserializeNull:Qf,deserializeRectanglePivoted:il,deserializeRectangleRounded:rl,deserializeRectangle:tl,deserializeSemicircle:gl,deserializeTriangleRounded:Sl,deserializeTriangle:Ol,deserialize:Pr,EShapeBarPoints:rt,EShapeBarPosition:it,EShapeBar:en,EShapeBaseHitTestData:jt,EShapeBase:Rt,EShapeButtonRuntimeActionToggle:zo,EShapeButtonRuntimeAction:Ho,EShapeButtonRuntime:Vo,EShapeButton:Uo,EShapeCircle:na,EShapeConnectorElbowPointsFiller:Qa,EShapeConnectorElbow:$a,EShapeConnectorLine:ve,EShapeEmbeddedDatum:Gr,EShapeEmbeddedLayerContainer:Ye,EShapeEmbeddedLayer:Be,EShapeEmbedded:Br,EShapeEmbeddeds:_v,EShapeFillImpl:$,EShapeGroupFillEditor:vc,EShapeGroupFillViewer:Lr,EShapeGroupPoints:bc,EShapeGroupShadowed:Oc,EShapeGroupSizeEditor:Rr,EShapeGroupSizeLayout:Ar,EShapeGroupSizeShadowed:pc,EShapeGroupSizeViewer:kr,EShapeGroupStrokeEditor:dc,EShapeGroupStrokeViewer:yr,EShapeGroupViewer:xr,EShapeGroup:gc,EShapeImageSdf:_c,EShapeImage:Tc,EShapeLabel:Gc,EShapeLineBaseHitPart:et,EShapeLineBase:rn,EShapeLineOfAnyPointsFillImpl:of,EShapeLineOfAnyPointsImpl:ff,EShapeLineOfAnyPointsPointImpl:af,EShapeLineOfAnyPointsStrokeImpl:cf,EShapeLineOfCircles:df,EShapeLineOfRectangleRoundeds:Of,EShapeLineOfRectangles:Tf,EShapeLineOfTriangleRoundeds:Gf,EShapeLineOfTriangles:Kf,EShapeLinePoints:fe,EShapeLine:Vc,EShapeNull:qf,EShapePrimitive:Jt,EShapeRectanglePivoted:ou,EShapeRectangleRounded:Fo,EShapeRectangle:hu,EShapeSemicircle:dl,EShapeStrokeImpl:kt,EShapeTextAlignImpl:Wt,EShapeTextImpl:Yt,EShapeTextOffsetImpl:Xt,EShapeTextOutlineImpl:Kt,EShapeTriangleRounded:Uf,EShapeTriangle:Xf,hitTestBBox:Nt,hitTestCircle:Zt,hitTestSemicircle:bl,hitTestRectangleRounded:Po,hitTestRectangle:Qt,hitTestTriangleRounded:Ff,hitTestTriangleFilled:$t,hitTestTriangle:tn,isStatic:sf,toComputed:hf,toDash:h,toGradientImageUrl:function(t){for(var n=t.direction,i=t.points,r="",e=0,u=i.length;e<u;++e){var s=i[e],h=an.toCode(s.color),o=s.alpha,a=100*s.position;r+='<stop offset="'.concat(a,'%" stop-color="#').concat(h,'" stop-opacity="').concat(o,'" />')}var c=n*Math.PI/180,f=.5*Math.cos(c),l=-.5*Math.sin(c);return Pv('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><defs>'+'<linearGradient id="o2glkm3aeu2oio" x1="'.concat(.5-f,'" x2="').concat(.5+f,'" y1="').concat(.5-l,'" y2="').concat(.5+l,'">')+r+'</linearGradient></defs><rect x="0" y="0" width="32" height="32" stroke="none" fill="url(#o2glkm3aeu2oio)" /></svg>')},toGradientSerialized:It,toImageElement:Do,toLength:O,toResized:function(t,n,i,r,e){var u=jr.contains(t,Ct.POSITION),s=jr.contains(t,Ct.WIDTH),h=jr.contains(t,Ct.HEIGHT);t.disallowUploadedUpdate();var o=t.transform.position;if(r){var a=Math.abs(i.x-n.x),c=Math.abs(i.y-n.y);if(e){var f=Math.max(a,c),l=Ir(f+f),v=Fv(n.x),b=Fv(n.y),d=t.size;s&&h?d.set(l,l):s?d.x=l:h&&(d.y=l),u&&o.set(v,b)}else{var g=Ir(a+a),m=Ir(c+c);v=Fv(n.x),b=Fv(n.y),d=t.size,s&&h?d.set(g,m):s?d.x=g:h&&(d.y=m),u&&o.set(v,b)}}else if(e){a=i.x-n.x,c=i.y-n.y,f=Math.max(Math.abs(a),Math.abs(c));var w=n.x+(a<0?-f:+f),p=n.y+(c<0?-f:+f),O=.5*f;l=Ir(f),v=Fv(Math.min(n.x,w)+O),b=Fv(Math.min(n.y,p)+O),d=t.size,s&&h?d.set(l,l):s?d.x=l:h&&(d.y=l),u&&o.set(v,b)}else{var D=Math.min(n.x,i.x),E=Math.min(n.y,i.y),M=.5*(a=Math.max(n.x,i.x)-D),S=.5*(c=Math.max(n.y,i.y)-E);g=Ir(a),m=Ir(c),v=Fv(D+M),b=Fv(E+S),d=t.size,s&&h?d.set(g,m):s?d.x=g:h&&(d.y=m),u&&o.set(v,b)}t.allowUploadedUpdate()},toScaleInvariant:o,toSizeNormalized:Ir,toSizeRounded:Fv,toThresholdDefault:nn,EShapeAcceptorImpl:Hr,EShapeAcceptorType:zr,EShapeAcceptors:Vr,EShapeBufferUnitBuilder:Ce,EShapeBufferUnit:Ie,EShapeBuffer:Ae,EShapeCapabilities:jr,EShapeCapabilityContainerImpl:At,EShapeCapability:Ct,EShapeConnectorBodies:nc,EShapeConnectorBodyImpl:le,EShapeConnectorContainerImpl:ot,EShapeConnectorEdgeAcceptorImpl:Wr,EShapeConnectorEdgeContainerImpl:Kr,EShapeConnectorEdgeImpl:Xr,EShapeConnectors:be,EShapeContainer:xe,EShapeCopyPart:at,EShapeCorner:ut,EShapeDataImpl:Vt,EShapeDataMapperImpl:Mr,EShapeDataMappingImpl:Gt,EShapeDataScopedImpl:Ht,EShapeDataSystemImpl:zt,EShapeDataValueExtensions:Uv,EShapeDataValueImpl:Ut,EShapeDataValueOrder:xt,EShapeDataValueRangeImpl:yt,EShapeDataValueRangeType:Lt,EShapeDataValueScope:_t,EShapeDataValueState:Pt,EShapeDataValueType:Bt,EShapeDefaults:q,EShapeDeleter:Hv,EShapeDeserializers:n,EShapeOnDeserializeds:i,EShapeEditor:Nr,EShapeLayerState:Xe,toPointsBoundary:Jr,eShapePointsFormatterCurve:ae,EShapePointsFormatters:ce,EShapePointsMarkerBase:Zr,EShapePointsMarkerContainerImplNoop:nt,EShapePointsMarkerContainerImpl:$r,EShapePointsMarkerHead:qr,EShapePointsMarkerNoop:tt,EShapePointsMarkerTail:Qr,EShapePointsMarkerType:Q,EShapePointsStyle:z,EShapePointsStyles:zv,EShapeRendererIteratorDatum:ke,EShapeRendererIterator:Le,EShapeRenderer:ye,EShapeResourceManagerDeserializationMode:Tr,EShapeResourceManagerDeserialization:Sr,EShapeResourceManagerSerialization:Vv,EShapeRuntimeImpl:su,EShapeRuntimeReset:cn,EShapeRuntimes:To,EShapeSearch:Gv,EShapeStateSetImplObservable:St,EShapeState:Mt,EShapeStrokeSide:qt,EShapeStrokeStyle:s,EShapeTextAlignHorizontal:m,EShapeTextAlignVertical:w,EShapeTextDirection:p,EShapeTextWeight:d,EShapeTextStyle:g,EShapeTransformImpl:Tt,EShapeTransforms:Cr,EShapeType:r,EShapeUploadedImpl:u,EShapeUploadeds:e,EShapeUuidMappingImpl:_r,ESnapperGrid:Wv,ESnapperResultScale:function(){this.distance=NaN,this.scale=new t.Point},ESnapperResult:Xv,ESnapperTargetValueType:Kv,ESnapperTargetValue:Yv,ESnapperTarget:Jv,ESnapperModifierAnchor:qv,ESnapper:Qv,DThemes:Z,FormatNodeA:zn,FormatNodea:Vn,FormatNodeD:Wn,FormatNoded:Xn,FormatNodee:Yn,FormatNodef:Jn,FormatNodefsi:Zn,FormatNodeg:qn,FormatNodeH:Qn,FormatNodeh:$n,FormatNodeM:ti,FormatNodem:ni,FormatNodemi:ii,FormatNodeP:ri,FormatNodep:ei,FormatNodePadding:ui,FormatNodeParenthesis:si,FormatNodePlus:hi,FormatNodePrecision:Kn,FormatNoderd:mi,FormatNodeRP:oi,FormatNoderp:ai,FormatNodesdt:ci,FormatNodeSpace:fi,FormatNodessi:li,FormatNodeString:vi,FormatNodeY:bi,FormatNodey:di,FormatNodez:gi,FormatNodes:wi,DynamicAtlasItemEmpty:ge,DynamicAtlasItemFontAtlas:pe,DynamicAtlasItemImage:Ne,DynamicAtlasItemText:$v,DynamicAtlasItemWhite:me,DynamicAtlasItem:de,DynamicAtlas:we,DynamicFontAtlasCharacterOrigin:De,DynamicFontAtlasCharacterType:Me,DynamicFontAtlasCharacter:Ee,DynamicFontAtlasFont:tb,DynamicFontAtlas:nb,DynamicFontAtlases:sb,DynamicSDFFontAtlas:Te,DynamicSDFFontAtlases:je,DynamicSDFFontGenerator:Se,isArray:mt,isFunction:wt,isNaN:Th,isNumber:pt,isObject:hb,isString:Ot,Lazy:ob,NumberFormatterImpl:Ei,NumberFormatters:Mi,toCeilingIndex:ab,toCloned:cb,toEnum:Ai,toIndexOf:Yr,toLabel:fb,toMerged:lb,toPadded:on,toString:function(t){return null!=t?String(t):""},toSvgTexture:function(n,i){return t.Texture.from(Pv(n),{resolution:i})},toSvgUrl:Pv,UtilAlpha:Cn,UtilSvgAtlasBuilder:vb,UtilAttachAlign:Bu,UtilAttach:_u,UtilCharacterIterator:b,UtilClickOutside:zu,UtilClipboard:Fl,UtilGestureData:lr,UtilGestureEasingHistory:dr,UtilGestureEasing:gr,UtilGestureMode:fr,UtilGestureModifier:ar,UtilGestureModifiers:cr,UtilGesture:mr,UtilExtract:gb,UtilExtractor:bb,UtilFileDownloader:db,UtilFileAs:mb,UtilFileOpener:wb,UtilFont:Es,UtilHsv:pb,UtilHtmlElementClipperExImpl:iu,UtilHtmlElementClipperExRectsImpl:ru,UtilHtmlElementWhen:eu,UtilHtmlElement:uu,UtilInputInput:du,UtilInputNumber:gu,UtilInputTextArea:Ob,UtilInputText:Su,UtilInput:bu,UtilKeyboardEvent:nr,UtilName:Db,UtilOverlay:Vu,UtilPointerEvent:ir,UtilRgb:an,UtilRgba:Eb,UtilStateBlinker:Mb,UtilTransition:Sb,UtilWheelEvent:Tb,DAlignHorizontal:ns,DAlignVertical:is,DAlignWith:rs,DAnimationBase:br,DAnimationEmpty:jb,DAnimationFadeIn:Nb,DAnimationTimings:vr,DApplicationLayerOptions:Cb,DApplicationLayer:xb,DApplicationPadding:Ib,DApplication:_b,DApplications:st,DBaseAutoSet:er,DBaseAuto:rr,DBaseBackgroundMeshGeometry:Fi,DBaseBackgroundMesh:Ui,DBaseBackgroundSnippet:Gi,DBaseBackground:Ii,DBaseBorderMeshGeometry:Hi,DBaseBorderMesh:zi,DBaseBorderSnippet:Vi,DBaseBorder:Ri,DBaseCorner:Li,DBaseInteractive:yi,DBaseMeshGeometry:Pi,DBaseOutlineSnippet:Wi,DBaseOutline:xi,DBaseOverflowMaskSimple:bs,DBaseOverflowMask:or,DBasePaddingAdjustable:Pb,DBasePadding:Bi,DBasePoint:_i,DBaseReflowableContainer:sr,DBaseReflowableImpl:Xi,DBaseSnippetContainer:ur,DBaseStateSetBlinkerDatumImpl:lt,DBaseStateSetBlinkerImpl:bt,DBaseStateSetImplObservable:Et,DBaseStateSetImpl:Dt,DBaseStateSetSubDatumImp:ft,DBaseStateSetSubImpl:vt,DBaseStateSetTickerDatumImpl:dt,DBaseStateSetTickerImpl:gt,DBaseState:ct,DBase:hr,DBoard:Fb,DBorderMask:Ci,DButtonAmbient:Rs,DButtonBaseWhen:Qu,DButtonBase:js,DButtonCheckRight:Gb,DButtonCheck:Ub,DButtonColorGradient:rd,DButtonColor:ud,DButtonDanger:sd,DButtonDate:hd,DButtonDatetime:fd,DButtonFileAs:mb,DButtonFile:ld,DButtonGroup:_s,DButtonLink:vd,DButtonPrimary:Is,DButtonRadioRight:dd,DButtonRadio:bd,DButtonRedo:gd,DButtonSecondary:md,DButtonSelect:rg,DButtonTime:eg,DButtonUndo:ug,DButton:Ns,DCanvasContainer:Dr,DCanvas:sg,DChartAxisBaseBar:og,DChartAxisBaseGuideContainer:ag,DChartAxisBaseOptionParser:fg,DChartAxisBaseTickContainer:gg,DChartAxisBaseTickMajorGridline:lg,DChartAxisBaseTickMajor:vg,DChartAxisBaseTickMinor:bg,DChartAxisBase:mg,DChartAxisContainerImpl:wg,DChartAxisGuideSimpleShapeImpl:pg,DChartAxisGuideSimple:Og,DChartAxisPosition:hg,DChartAxisTickPosition:cg,DChartAxisXDatetime:Eg,DChartAxisX:Dg,DChartAxisY:Mg,DChartColorSet1:function(t){return Sg[t%Sg.length]},DChartColorSet2:jg,DChartCoordinateBase:Ag,DChartCoordinateContainerImpl:kg,DChartCoordinateContainerSubImpl:Rg,DChartCoordinateDirection:Ng,DChartCoordinateLinearTick:Lg,DChartCoordinateLinear:yg,DChartCoordinateLogTick:xg,DChartCoordinateLog:Bg,DChartCoordinateTransformImpl:Ig,DChartCoordinateTransformMarkImpl:Cg,DChartLegendItem:_g,DChartLegend:Pg,DChartOverview:Fg,DChartPlotAreaContainer:Ug,DChartPlotAreaImpl:Qg,DChartRegionImplObservable:$g,DChartRegionImpl:dg,DChartSelectionContainerImpl:tm,DChartSelectionGridlineX:im,DChartSelectionGridlineY:rm,DChartSelectionMarker:em,DChartSelectionShapeBase:nm,DChartSelectionSimple:hm,DChartSelectionSubImpl:sm,DChartSelectionPoint:um,DChartSeriesBar:fm,DChartSeriesBaseCoordinateContainer:om,DChartSeriesBase:am,DChartSeriesContainerImpl:qg,DChartSeriesFillComputedImpl:Hg,DChartSeriesFillImpl:Vg,DChartSeriesLineOfAny:cm,DChartSeriesLineOfCircles:lm,DChartSeriesLineOfRectangleRoundeds:vm,DChartSeriesLineOfRectangles:bm,DChartSeriesLineOfTriangleRoundeds:gm,DChartSeriesLineOfTriangles:dm,DChartSeriesLine:mm,DChartSeriesExpressionParametersImpl:wm,DChartSeriesLinear:pm,DChartSeriesPaddingComputedImpl:Wg,DChartSeriesPaddingImpl:Xg,DChartSeriesPointComputedImpl:Kg,DChartSeriesPointImpl:Yg,DChartSeriesScalars:zg,DChartSeriesStrokeComputedImpl:Jg,DChartSeriesStrokeImpl:Zg,DChartSeriesHitResult:Gg,DChart:Om,DColorGradientObservable:Vb,DColorGradientPointObservable:Hb,DCommandBase:Ab,DCommandClear:Rb,DCommandCreate:Dm,DCommandSaveAs:Em,DCommandSave:Mm,DContent:Ld,DControllerCommandImpl:kb,DControllerFocusImpl:Bb,DControllerKeyboardImpl:Lb,DControllers:yb,DCornerMask:ki,DDiagramBaseControllerOpenType:Er,DDiagramBase:Tm,DDiagramCanvasBase:Rm,DDiagramCanvasBaseShapeImpl:km,DDiagramCanvasDataImpl:Lm,DDiagramCanvasEditorBackground:jm,DDiagramCanvasEditorShapeImpl:ym,DDiagramCanvasEditorSnap:xm,DDiagramCanvasEditor:Bm,DDiagramCanvasTileMappingImpl:Im,DDiagramCanvasTileMappingPointImpl:Nm,DDiagramCanvasShapeImpl:_m,DDiagramCanvasTickerImpl:Fm,DDiagramCanvasTile:Cm,DDiagramCanvas:Xm,DDiagramDataImpl:qm,DDiagramDataPrivateImpl:Km,DDiagramDataRemoteImpl:Jm,DDiagramEditorThumbnail:Qm,DDiagramEditor:$m,DDiagramLayerContainer:Am,DDiagramLayer:au,DDiagramLayers:_e,DDiagramSerializedVersion:1,DDiagramShape:tw,DDiagramSnapshot:Sm,DDiagramTicker:Pm,DDiagram:nw,DDiagrams:Je,DDialogAlign:Bu,DDialogCloseOn:Pu,DDialogColorGradient:id,DDialogColor:ed,DDialogConfirmDelete:ew,DDialogConfirmDiscard:uw,DDialogConfirmMessage:iw,DDialogConfirm:rw,DDialogDate:Ih,DDialogDatetime:Eh,DDialogFittedContent:rh,DDialogFitted:eh,DDialogGestureImpl:Uu,DDialogGestureMode:Fu,DDialogInputBoolean:Gs,DDialogInputInteger:Js,DDialogInputReal:Qs,DDialogInputText:nh,DDialogInput:Bs,DDialogLayeredContent:qu,DDialogLayeredFooter:As,DDialogLayeredHeaderButtonClose:ks,DDialogLayeredHeaderSeparator:Ls,DDialogLayeredHeader:ys,DDialogLayered:xs,DDialogMessage:sw,DDialogMode:Gu,DDialogProcessingMessage:hw,DDialogProcessing:ow,DDialogSaveAs:aw,DDialogSelectListItemUpdater:Md,DDialogSelectListItem:Od,DDialogSelectList:Wd,DDialogSelectSearhDismissableImpl:$d,DDialogSelectSearhImpl:Xd,DDialogSelect:tg,DDialogState:Hu,DDialogTime:Sh,DDialog:Wu,DDropdownBase:lw,DDropdown:vw,DDynamicTextGeometry:Os,DDynamicTextMeasureResultCharacter:ds,DDynamicTextMeasureResult:gs,DDynamicTextMeasure:ps,DDynamicTextStyleWordWrap:ms,DDynamicTextStyle:Ds,DDynamicText:Ms,DExpandableHeader:bw,DExpandable:dw,DHtmlElementState:nu,DHtmlElement:Vs,DImageBaseThemeWrapperSecondary:$u,DImageBaseThemeWrapperTertiary:ts,DImageBase:Ts,DImagePieceLayouterPartBottom:ss,DImagePieceLayouterPartCenter:hs,DImagePieceLayouterPartContainer:ls,DImagePieceLayouterPartLeft:os,DImagePieceLayouterPartMiddle:as,DImagePieceLayouterPartRight:cs,DImagePieceLayouterPartTop:fs,DImagePieceLayouterPart:us,DImagePieceLayouter:vs,DImagePiece:es,DImage:Nl,DInputAndLabel:Xb,DInputBooleanButtonOff:Ps,DInputBooleanButtonOn:Fs,DInputBoolean:Us,DInputInput:Xs,DInputIntegerAndLabel:gw,DInputInteger:Ys,DInputLabel:Wb,DInputNumber:Ks,DInputRealAndLabel:Kb,DInputReal:qs,DInputSearch:Kd,DInputTextAndLabel:Yb,DInputTextArea:mw,DInputText:th,DInput:Ws,DItemUpdater:Dd,DLayoutClearType:Ki,DLayoutDirection:Xu,DLayoutHorizontal:Cs,DLayoutSpace:Ku,DLayoutVertical:Zu,DLayout:Ju,DLinkMenuItemId:Ll,DLinkMenu:xl,DLinkTarget:Bl,DLink:Gl,DLinks:Hl,DListDataImpl:kd,DListDataMappedImpl:Sd,DListDataSelectionMultiple:Td,DListDataSelectionNone:jd,DListDataSelectionSingle:Nd,DListDataSelectionType:wd,DListItemAccessorImpl:Rd,DListItemAmbient:ww,DListItemUpdater:Ed,DListItem:pd,DList:Vd,DMapCoordinateEPSG3857:pw,DMapCoordinates:Ow,DMapTilePlane:Ew,DMapTilePyramidImpl:Mw,DMapTileUrlBuilderKokudo:function(t,n,i){return 5<=t?"https://cyberjapandata.gsi.go.jp/xyz/pale/".concat(t,"/").concat(n,"/").concat(i,".png"):2<=t?"https://cyberjapandata.gsi.go.jp/xyz/std/".concat(t,"/").concat(n,"/").concat(i,".png"):"https://cyberjapandata.gsi.go.jp/xyz/earthhillshade/".concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsm:function(t,n,i){return"https://".concat("abc"[(n+i)%3],".tile.openstreetmap.org/").concat(t,"/").concat(n,"/").concat(i,".png")},DMapTileUrlBuilderOsmfj:Sw,DMapTilePyramids:Tw,DMapTile:Dw,DMenuAlign:Bu,DMenuBarItem:jw,DMenuBar:Nw,DMenuContext:cw,DMenuItemBase:Il,DMenuItemCheckIsCompatible:kl,DMenuItemCheck:Rl,DMenuItemExpandableBody:tv,DMenuItemExpandableHeader:nv,DMenuItemExpandableIsCompatible:ev,DMenuItemExpandableItemCheck:uv,DMenuItemExpandableItemLink:sv,DMenuItemExpandableItemMenu:Mv,DMenuItemExpandableItemSeparator:hv,DMenuItemExpandableItemSpace:ov,DMenuItemExpandableItemText:av,DMenuItemExpandable:rv,DMenuItemExpandables:iv,DMenuItemLinkIsCompatible:Vl,DMenuItemLink:zl,DMenuItemMenuIsCompatible:Xl,DMenuItemMenuToSubMenuOptions:Kl,DMenuItemMenu:Wl,DMenuItemSeparatorReflowable:Yl,DMenuItemSeparatorIsCompatible:Jl,DMenuItemSeparator:Zl,DMenuItemSpaceIsCompatible:Ql,DMenuItemSpace:ql,DMenuItemText:Al,DMenuItem:Cl,DMenuSidedContent:Iw,DMenuSidedItemCheck:fv,DMenuSidedItemExpandableItemCheck:Dv,DMenuSidedItemExpandableItemLink:Ev,DMenuSidedItemExpandableItemMenu:Sv,DMenuSidedItemExpandableItemSeparator:Tv,DMenuSidedItemExpandableItemSpace:jv,DMenuSidedItemExpandableItemText:Nv,DMenuSidedItemExpandable:Ov,DMenuSidedItemExpandables:pv,DMenuSidedItemLink:lv,DMenuSidedItemMenu:vv,DMenuSidedItemSeparator:bv,DMenuSidedItemSpace:dv,DMenuSidedItemText:gv,DMenuSidedSelectionType:Cw,DMenuSidedSelection:Rw,DMenuSided:kw,DMenuSideds:mv,DMenu:fw,DMenus:yl,DNoteError:Lw,DNoteNoItemsFound:yw,DNoteSearching:xw,DNoteSmallError:Zd,DNoteSmallNoItemsFound:qd,DNoteSmallSearching:Qd,DNoteSmall:Jd,DNote:Yd,DNotification:Bw,DPaginationButtonLast:_w,DPaginationButtonNext:Pw,DPaginationButtonPage:Fw,DPaginationButtonPrevious:Uw,DPaginationButtonTop:Gw,DPaginationDots:Hw,DPaginationPage:zw,DPagination:Vw,DPaneScrollBar:Hd,DPane:zd,DPickerColorAndAlpha:Jb,DPickerColorGradientRecent:$b,DPickerColorGradientView:td,DPickerColorGradient:nd,DPickerColorRecent:Zb,DPickerColor:qb,DPickerDate:Nh,DPickerDates:od,DPickerDatetimeButtonBack:uh,DPickerDatetimeButtonDate:sh,DPickerDatetimeButtonNext:hh,DPickerDatetimeLabelDate:ch,DPickerDatetimeLabel:ah,DPickerDatetimeMask:lh,DPickerDatetimeMasks:vh,DPickerDatetimeRange:Ww,DPickerDatetimeSpace:fh,DPickerDatetime:Dh,DPickerDatetimes:cd,DPickerTimeBoundHours:dh,DPickerTimeBoundMinutes:gh,DPickerTimeBoundSeconds:mh,DPickerTimeBound:bh,DPickerTimeBounds:wh,DPickerTimeRange:Xw,DPickerTime:Oh,DPickerTimes:ad,DScalarExpressionNodeType:Yi,DScalarExpression:Ji,DScalarFunctions:tr,DScrollBarHorizontal:Pd,DScrollBarThumbHorizontal:_d,DScrollBarThumbReflowableHorizontal:Bd,DScrollBarThumbReflowableVertical:Fd,DScrollBarThumbVertical:Ud,DScrollBarThumb:xd,DScrollBarVertical:Gd,DScrollBar:yd,DSelectMultiple:Kw,DSelect:Yw,DShadowImpl:Jw,DSliderHorizontal:ip,DSliderLabel:Zw,DSliderThumb:qw,DSliderTrackHorizontal:np,DSliderTrackVertical:rp,DSliderTrack:tp,DSliderValue:Qw,DSliderVertical:ep,DSlider:$w,DTableBodyCellActionDialog:hp,DTableBodyCellActionMenu:op,DTableBodyCellActionPromise:cp,DTableBodyCellButton:lp,DTableBodyCellCheck:bp,DTableBodyCellColor:dp,DTableBodyCellDate:gp,DTableBodyCellDatetime:mp,DTableBodyCellIndex:wp,DTableBodyCellInputInteger:pp,DTableBodyCellInputReal:Op,DTableBodyCellInputText:Dp,DTableBodyCellInputTreeInput:Ep,DTableBodyCellInputTreeMarker:Mp,DTableBodyCellInputTree:Tp,toLinkOptions:jp,toUrl:Np,toChecker:Ip,DTableBodyCellLink:Cp,DTableBodyCellSelectDialog:sp,DTableBodyCellSelectMenu:Ap,DTableBodyCellSelectMultiple:Rp,DTableBodyCellSelectPromise:ap,DTableBodyCellText:fp,DTableBodyCellTime:kp,DTableBodyCellTree:Lp,DTableBodyCells:up,DTableBodyRow:Bp,DTableBody:Vp,DTableCategoryCell:Wp,DTableCategory:Xp,DTableColumnType:vp,DTableDataListFilter:_p,DTableDataListMapped:Pp,DTableDataListSelection:Up,DTableDataListSorter:Hp,DTableDataList:zp,DTableDataSelectionType:yp,DTableDataOrder:Gp,DTableDataTreeFilter:Kp,DTableDataTreeItemAccessor:qp,DTableDataTreeSelectionImpl:$p,DTableDataTreeSorter:tO,DTableDataTree:nO,DTableHeaderCellCheck:iO,DTableHeaderCell:eO,DTableHeader:uO,DTableRow:xp,DTableScrollBar:sO,DTableState:Sp,DTable:SO,DTextBase:Ss,DText:oh,DTreeDataImpl:BO,DTreeDataMappedImpl:kO,DTreeDataSelectionMultiple:LO,DTreeDataSelectionNone:xO,DTreeDataSelectionSingle:yO,DTreeDataSelectionType:RO,DTreeItemButton:FO,DTreeItemNonEditable:UO,DTreeItemState:_O,DTreeItemText:PO,DTreeItemUpdater:GO,DTreeNodeAccessorImpl:AO,DTree:HO,DViewGestureImpl:wr,DViewImpl:Or,DViewTransformImpl:pr};Av();var VO=window;VO.wcardinal=VO.wcardinal||{},VO.wcardinal.ui=zO}(PIXI);
10
10
  //# sourceMappingURL=wcardinal-ui.min.js.map