@leafer-draw/miniapp 1.10.0 → 1.10.1

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,2 +1,2 @@
1
- var t;!function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(t||(t={}));const e={};function s(t){return void 0===t}function i(t){return null==t}function r(t){return"string"==typeof t}const{isFinite:n}=Number;function o(t){return"number"==typeof t}const a=/^-?\d+(?:\.\d+)?$/;function h(t){return"string"==typeof t&&a.test(t)?+t:t}const{isArray:l}=Array;function d(t){return t&&"object"==typeof t}function c(t){return d(t)&&!l(t)}function u(t){return"{}"===JSON.stringify(t)}const _={default:(t,e)=>(p(e,t),p(t,e),t),assign(t,e,s){let i;Object.keys(e).forEach(r=>{var n,o;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(n=t[r])||void 0===n?void 0:n.constructor)===Object)return p(t[r],e[r],s&&s[r]);s&&r in s?(null===(o=s[r])||void 0===o?void 0:o.constructor)===Object&&p(t[r]={},e[r],s[r]):t[r]=e[r]})},copyAttrs:(t,e,i)=>(i.forEach(i=>{s(e[i])||(t[i]=e[i])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,i=t.length;s<i;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:p}=_;class g{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __usePathBox(){return this.__pathInputed}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(!s(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let i;for(let r in this)"_"!==r[0]&&(i=e?e[r]:void 0,t[r]=s(i)?this[r]:i);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!s(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!s(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const i={};if(t)if(l(t))for(let e of t)i[e]=this.__getInput(e);else for(let e in t)i[e]=this.__getInput(e);else{let t,e,{__input:r}=this;i.tag=this.__leaf.tag;for(let n in this)if("_"!==n[0]&&(t=this["_"+n],!s(t))){if("path"===n&&!this.__pathInputed)continue;e=r?r[n]:void 0,i[n]=s(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:s,d:r,e:n,f:o}=this.__leaf.__localMatrix;i.matrix={a:t,b:e,c:s,d:r,e:n,f:o}}return i}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null}}const{floor:f,max:y}=Math,m={toURL(t,e){let s=encodeURIComponent(t);return"text"===e?s="data:text/plain;charset=utf-8,"+s:"svg"===e&&(s="data:image/svg+xml,"+s),s},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",isLarge:(t,e,s,i)=>t.width*t.height*(e?e*s:1)>(i||x.maxCacheSize),isSuperLarge:(t,e,s)=>x.isLarge(t,e,s,x.maxPatternSize),getRealURL(t){const{prefix:e,suffix:s}=m.image;return!s||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+s),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,s,i,r,n,o,a,h){const l=m.origin.createCanvas(y(f(e+(i||0)),1),y(f(s+(r||0)),1)),d=l.getContext("2d");if(a&&(d.globalAlpha=a),d.imageSmoothingEnabled=!1!==o,n){const i=e/n.width,r=s/n.height;d.setTransform(i,0,0,r,-n.x*i,-n.y*r),d.drawImage(t,0,0,t.width,t.height)}else d.drawImage(t,0,0,e,s);return l},setPatternTransform(t,e,s){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}s&&_.stintSet(s,"transform",e)}}},{image:x}=m,w={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=v;return e[t]?e[t]++:(e[t]=1,0)}},v=w;let b,k,S;const{max:B}=Math,R=[0,0,0,0],C={zero:[...R],tempFour:R,set:(t,e,s,i,r)=>(void 0===s&&(s=i=r=e),t[0]=e,t[1]=s,t[2]=i,t[3]=r,t),setTemp:(t,e,s,i)=>T(R,t,e,s,i),toTempAB(t,e,s){S=s?o(t)?e:t:[],o(t)?(b=O(t),k=e):o(e)?(b=t,k=O(e)):(b=t,k=e),4!==b.length&&(b=P(b)),4!==k.length&&(k=P(k))},get(t,e){let i;if(!o(t))switch(t.length){case 4:i=s(e)?t:[...t];break;case 2:i=[t[0],t[1],t[0],t[1]];break;case 3:i=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(i||(i=[t,t,t,t]),!s(e))for(let t=0;t<4;t++)i[t]>e&&(i[t]=e);return i},max:(t,e,s)=>o(t)&&o(e)?B(t,e):(E(t,e,s),T(S,B(b[0],k[0]),B(b[1],k[1]),B(b[2],k[2]),B(b[3],k[3]))),add:(t,e,s)=>o(t)&&o(e)?t+e:(E(t,e,s),T(S,b[0]+k[0],b[1]+k[1],b[2]+k[2],b[3]+k[3])),swapAndScale(t,e,s,i){if(o(t))return e===s?t*e:[t*s,t*e];const r=i?t:[],[n,a,h,l]=4===t.length?t:P(t);return T(r,h*s,l*e,n*s,a*e)}},{set:T,get:P,setTemp:O,toTempAB:E}=C,{round:L,pow:A,max:I,floor:W,PI:M}=Math,D={within:(t,e,i)=>(d(e)&&(i=e.max,e=e.min),!s(e)&&t<e&&(t=e),!s(i)&&t>i&&(t=i),t),fourNumber:C.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),D.float(t)),getGapRotation(t,e,s=0){let i=t+s;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-s},float(t,e){const i=s(e)?1e12:A(10,e);return-0===(t=L(t*i)/i)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,s,i){if(i||(i={}),e){const t=(o(e)?e:e.width||0)/s.width,r=(o(e)?e:e.height||0)/s.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&D.assignScale(i,t);return i},assignScale(t,e){o(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>I(W(t),e)/t,randInt:F,randColor:t=>`rgba(${F(255)},${F(255)},${F(255)},${t||1})`};function F(t){return Math.round(Math.random()*t)}const z=M/180,N=2*M,Y=M/2;function X(){return{x:0,y:0}}function U(){return{x:0,y:0,width:0,height:0}}function j(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:V,cos:H,acos:G,sqrt:q}=Math,{float:Q}=D,J={};function $(){return Object.assign(Object.assign(Object.assign({},{a:1,b:0,c:0,d:1,e:0,f:0}),{x:0,y:0,width:0,height:0}),{scaleX:1,scaleY:1,rotation:0,skewX:0,skewY:0})}const Z={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:$(),tempMatrix:{},set(t,e=1,s=0,i=0,r=1,n=0,o=0){t.a=e,t.b=s,t.c=i,t.d=r,t.e=n,t.f=o},get:j,getWorld:$,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,s){t.e+=e,t.f+=s},translateInner(t,e,s,i){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,i&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},pixelScale(t,e,s){s||(s=t),s.a=t.a*e,s.b=t.b*e,s.c=t.c*e,s.d=t.d*e,s.e=t.e*e,s.f=t.f*e},scaleOfOuter(t,e,s,i){K.toInnerPoint(t,e,J),K.scaleOfInner(t,J,s,i)},scaleOfInner(t,e,s,i=s){K.translateInner(t,e.x,e.y),K.scale(t,s,i),K.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:i,c:r,d:n}=t,o=H(e*=z),a=V(e);t.a=s*o-i*a,t.b=s*a+i*o,t.c=r*o-n*a,t.d=r*a+n*o},rotateOfOuter(t,e,s){K.toInnerPoint(t,e,J),K.rotateOfInner(t,J,s)},rotateOfInner(t,e,s){K.translateInner(t,e.x,e.y),K.rotate(t,s),K.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:i,b:r,c:n,d:o}=t;s&&(s*=z,t.a=i+n*s,t.b=r+o*s),e&&(e*=z,t.c=n+i*e,t.d=o+r*e)},skewOfOuter(t,e,s,i){K.toInnerPoint(t,e,J),K.skewOfInner(t,J,s,i)},skewOfInner(t,e,s,i=0){K.translateInner(t,e.x,e.y),K.skew(t,s,i),K.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:i,c:r,d:n,e:o,f:a}=t;t.a=e.a*s+e.b*r,t.b=e.a*i+e.b*n,t.c=e.c*s+e.d*r,t.d=e.c*i+e.d*n,t.e=e.e*s+e.f*r+o,t.f=e.e*i+e.f*n+a},multiplyParent(t,e,i,r,n){const{e:o,f:a}=t;if(i||(i=t),s(r)&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:s,b:r,c:o,d:a}=t;i.a=s*e.a+r*e.c,i.b=s*e.b+r*e.d,i.c=o*e.a+a*e.c,i.d=o*e.b+a*e.d,n&&(i.scaleX=e.scaleX*n.scaleX,i.scaleY=e.scaleY*n.scaleY)}else i.a=e.a,i.b=e.b,i.c=e.c,i.d=e.d,n&&(i.scaleX=e.scaleX,i.scaleY=e.scaleY);i.e=o*e.a+a*e.c+e.e,i.f=o*e.b+a*e.d+e.f},divide(t,e){K.multiply(t,K.tempInvert(e))},divideParent(t,e){K.multiplyParent(t,K.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=K;return K.copy(e,t),K.invert(e),e},invert(t){const{a:e,b:s,c:i,d:r,e:n,f:o}=t;if(s||i){const a=1/(e*r-s*i);t.a=r*a,t.b=-s*a,t.c=-i*a,t.d=e*a,t.e=-(n*r-o*i)*a,t.f=-(o*e-n*s)*a}else if(1===e&&1===r)t.e=-n,t.f=-o;else{const s=1/(e*r);t.a=r*s,t.d=e*s,t.e=-n*r*s,t.f=-o*e*s}},toOuterPoint(t,e,s,i){const{x:r,y:n}=e;s||(s=e),s.x=r*t.a+n*t.c,s.y=r*t.b+n*t.d,i||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,i){const{a:r,b:n,c:o,d:a}=t,h=1/(r*a-n*o),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*o)*h,s.y=(d*r-l*n)*h,!i){const{e:e,f:i}=t;s.x-=(e*a-i*o)*h,s.y-=(i*r-e*n)*h}},setLayout(t,e,i,r,n){const{x:o,y:a,scaleX:h,scaleY:l}=e;if(s(n)&&(n=e.rotation||e.skewX||e.skewY),n){const{rotation:s,skewX:i,skewY:r}=e,n=s*z,o=H(n),a=V(n);if(i||r){const e=i*z,s=r*z;t.a=(o+s*-a)*h,t.b=(a+s*o)*h,t.c=(e*o-a)*l,t.d=(o+e*a)*l}else t.a=o*h,t.b=a*h,t.c=-a*l,t.d=o*l}else t.a=h,t.b=0,t.c=0,t.d=l;t.e=o,t.f=a,(i=i||r)&&K.translateInner(t,-i.x,-i.y,!r)},getLayout(t,e,s,i){const{a:r,b:n,c:o,d:a,e:h,f:l}=t;let d,c,u,_,p,g=h,f=l;if(n||o){const t=r*a-n*o;if(o&&!i){d=q(r*r+n*n),c=t/d;const e=r/d;u=n>0?G(e):-G(e)}else{c=q(o*o+a*a),d=t/c;const e=o/c;u=Y-(a>0?G(-e):-G(e))}const e=Q(H(u)),s=V(u);d=Q(d),c=Q(c),_=e?Q((o/c+s)/e/z,9):0,p=e?Q((n/d-s)/e/z,9):0,u=Q(u/z)}else d=r,c=a,u=_=p=0;return(e=s||e)&&(g+=e.x*r+e.y*o,f+=e.x*n+e.y*a,s||(g-=e.x,f-=e.y)),{x:g,y:f,scaleX:d,scaleY:c,rotation:u,skewX:_,skewY:p}},withScale(t,e,s=e){const i=t;if(!e||!s){const{a:i,b:r,c:n,d:o}=t;r||n?s=(i*o-r*n)/(e=q(i*i+r*r)):(e=i,s=o)}return i.scaleX=e,i.scaleY=s,i},reset(t){K.set(t)}},K=Z,{toInnerPoint:tt,toOuterPoint:et}=Z,{sin:st,cos:it,abs:rt,sqrt:nt,atan2:ot,min:at,round:ht}=Math,lt={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,i){t.radiusX=e,t.radiusY=s(i)?e:i},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,s){t.x=e,t.y=s},round(t,e){t.x=e?ht(t.x-.5)+.5:ht(t.x),t.y=e?ht(t.y-.5)+.5:ht(t.y)},move(t,e,s){d(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=s)},scale(t,e,s=e){t.x&&(t.x*=e),t.y&&(t.y*=s)},scaleOf(t,e,s,i=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(i-1)},rotate(t,e,s){s||(s=dt.defaultPoint);const i=it(e*=z),r=st(e),n=t.x-s.x,o=t.y-s.y;t.x=s.x+n*i-o*r,t.y=s.y+n*r+o*i},tempToInnerOf(t,e){const{tempPoint:s}=dt;return ut(s,t),tt(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=dt;return ut(s,t),et(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=dt;return ut(s,t),dt.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),tt(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){tt(e,t,s)},toOuterOf(t,e,s){et(e,t,s)},getCenter:(t,e)=>({x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}),getCenterX:(t,e)=>t+(e-t)/2,getCenterY:(t,e)=>t+(e-t)/2,getDistance:(t,e)=>ct(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,i){const r=rt(s-t),n=rt(i-e);return nt(r*r+n*n)},getMinDistanceFrom:(t,e,s,i,r,n)=>at(ct(t,e,s,i),ct(s,i,r,n)),getAngle:(t,e)=>_t(t,e)/z,getRotation:(t,e,s,i)=>(i||(i=e),dt.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,i.x,i.y)/z),getRadianFrom(t,e,i,r,n,o,a,h){s(a)&&(a=i,h=r);const l=t-i,d=e-r,c=n-a,u=o-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e)=>ot(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,i){const r=_t(t,e);return(e=i?e:{}).x=t.x+it(r)*s,e.y=t.y+st(r)*s,e},toNumberPoints(t){let e=t;return d(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},reset(t){dt.reset(t)}},dt=lt,{getDistanceFrom:ct,copy:ut,getAtan2:_t}=dt;class pt{constructor(t,e){this.set(t,e)}set(t,e){return d(t)?lt.copy(this,t):lt.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new pt(this)}move(t,e){return lt.move(this,t,e),this}scale(t,e){return lt.scale(this,t,e),this}scaleOf(t,e,s){return lt.scaleOf(this,t,e,s),this}rotate(t,e){return lt.rotate(this,t,e),this}rotateOf(t,e){return lt.rotate(this,e,t),this}getRotation(t,e,s){return lt.getRotation(this,t,e,s)}toInnerOf(t,e){return lt.toInnerOf(this,t,e),this}toOuterOf(t,e){return lt.toOuterOf(this,t,e),this}getCenter(t){return new pt(lt.getCenter(this,t))}getDistance(t){return lt.getDistance(this,t)}getDistancePoint(t,e,s){return new pt(lt.getDistancePoint(this,t,e,s))}getAngle(t){return lt.getAngle(this,t)}getAtan2(t){return lt.getAtan2(this,t)}reset(){return lt.reset(this),this}}const gt=new pt;class ft{constructor(t,e,s,i,r,n){this.set(t,e,s,i,r,n)}set(t,e,s,i,r,n){return d(t)?Z.copy(this,t):Z.set(this,t,e,s,i,r,n),this}setWith(t){return Z.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:s,d:i,e:r,f:n}=this;return{a:t,b:e,c:s,d:i,e:r,f:n}}clone(){return new ft(this)}translate(t,e){return Z.translate(this,t,e),this}translateInner(t,e){return Z.translateInner(this,t,e),this}scale(t,e){return Z.scale(this,t,e),this}scaleWith(t,e){return Z.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return Z.pixelScale(this,t),this}scaleOfOuter(t,e,s){return Z.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return Z.scaleOfInner(this,t,e,s),this}rotate(t){return Z.rotate(this,t),this}rotateOfOuter(t,e){return Z.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return Z.rotateOfInner(this,t,e),this}skew(t,e){return Z.skew(this,t,e),this}skewOfOuter(t,e,s){return Z.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return Z.skewOfInner(this,t,e,s),this}multiply(t){return Z.multiply(this,t),this}multiplyParent(t){return Z.multiplyParent(this,t),this}divide(t){return Z.divide(this,t),this}divideParent(t){return Z.divideParent(this,t),this}invert(){return Z.invert(this),this}invertWith(){return Z.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){Z.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){Z.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return Z.setLayout(this,t,e,s),this}getLayout(t,e,s){return Z.getLayout(this,t,e,s)}withScale(t,e){return Z.withScale(this,t,e)}reset(){Z.reset(this)}}const yt=new ft,mt={tempPointBounds:{},setPoint(t,e,s){t.minX=t.maxX=e,t.minY=t.maxY=s},addPoint(t,e,s){t.minX=e<t.minX?e:t.minX,t.minY=s<t.minY?s:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=s>t.maxY?s:t.maxY},addBounds(t,e,s,i,r){xt(t,e,s),xt(t,e+i,s+r)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}},{addPoint:xt}=mt;var wt,vt;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(wt||(wt={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center",t[t["top-left"]=0]="top-left",t[t["top-right"]=2]="top-right",t[t["bottom-right"]=4]="bottom-right",t[t["bottom-left"]=6]="bottom-left"}(vt||(vt={}));const bt=[{x:0,y:0},{x:.5,y:0},{x:1,y:0},{x:1,y:.5},{x:1,y:1},{x:.5,y:1},{x:0,y:1},{x:0,y:.5},{x:.5,y:.5}];bt.forEach(t=>t.type="percent");const kt={directionData:bt,tempPoint:{},get:St,toPoint(t,e,s,i,r,n){const o=St(t);s.x=o.x,s.y=o.y,"percent"===o.type&&(s.x*=e.width,s.y*=e.height,r&&(n||(s.x-=r.x,s.y-=r.y),o.x&&(s.x-=1===o.x?r.width:.5===o.x?o.x*r.width:0),o.y&&(s.y-=1===o.y?r.height:.5===o.y?o.y*r.height:0))),i||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s)=>(s||(s={}),kt.toPoint(t,e,s,!0),s)};function St(t){return r(t)?bt[vt[t]]:t}const{toPoint:Bt}=kt,Rt={toPoint(t,e,s,i,r,n){Bt(t,s,i,r,e,n)}},{tempPointBounds:Ct,setPoint:Tt,addPoint:Pt,toBounds:Ot}=mt,{toOuterPoint:Et}=Z,{float:Lt,fourNumber:At}=D,{floor:It,ceil:Wt}=Math;let Mt,Dt,Ft,zt;const Nt={},Yt={},Xt={},Ut={tempBounds:Xt,set(t,e=0,s=0,i=0,r=0){t.x=e,t.y=s,t.width=i,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,i,r){const{x:n,y:o,width:a,height:h}=e;if(l(s)){const e=At(s);i?jt.set(t,n+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):jt.set(t,n-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else i&&(s=-s),jt.set(t,n-s,o-s,a+2*s,h+2*s);r&&("width"===r?(t.y=o,t.height=h):(t.x=n,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,s){t.x+=e,t.y+=s},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,s)=>(t=Object.assign({},t),jt.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Ht(e,t):e=t,s||(s=t),e.offsetX=jt.maxX(s),e.offsetY=jt.maxY(s),jt.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,i){i||lt.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,i=s){lt.scaleOf(t,e,s,i),t.width*=s,t.height*=i},tempToOuterOf:(t,e)=>(jt.copy(Xt,t),jt.toOuterOf(Xt,e),Xt),getOuterOf:(t,e)=>(t=Object.assign({},t),jt.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:i,d:r,e:n,f:o}=e;i>0?(s.width=t.width*i,s.x=n+t.x*i):(s.width=t.width*-i,s.x=n+t.x*i-s.width),r>0?(s.height=t.height*r,s.y=o+t.y*r):(s.height=t.height*-r,s.y=o+t.y*r-s.height)}else Nt.x=t.x,Nt.y=t.y,Et(e,Nt,Yt),Tt(Ct,Yt.x,Yt.y),Nt.x=t.x+t.width,Et(e,Nt,Yt),Pt(Ct,Yt.x,Yt.y),Nt.y=t.y+t.height,Et(e,Nt,Yt),Pt(Ct,Yt.x,Yt.y),Nt.x=t.x,Et(e,Nt,Yt),Pt(Ct,Yt.x,Yt.y),Ot(Ct,s)},toInnerOf(t,e,s){s||(s=t),jt.move(s,-e.e,-e.f),jt.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const i=Math.min(s,jt.getFitScale(t,e));return new ft(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,s){const i=t.width/e.width,r=t.height/e.height;return s?Math.max(i,r):Math.min(i,r)},put(t,e,s="center",i=1,n=!0,o){o||(o=e),r(i)&&(i=jt.getFitScale(t,e,"cover"===i)),Xt.width=n?e.width*=i:e.width*i,Xt.height=n?e.height*=i:e.height*i,Rt.toPoint(s,Xt,t,o,!0,!0)},getSpread(t,e,s){const i={};return jt.copyAndSpread(i,t,e,!1,s),i},spread(t,e,s){jt.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){jt.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=It(t.x),t.y=It(t.y),t.width=e>t.x?Wt(t.width+e-t.x):Wt(t.width),t.height=s>t.y?Wt(t.height+s-t.y):Wt(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=Lt(t.x,e),t.y=Lt(t.y,e),t.width=Lt(t.width,e),t.height=Lt(t.height,e)},add(t,e,s){Mt=t.x+t.width,Dt=t.y+t.height,Ft=e.x,zt=e.y,s||(Ft+=e.width,zt+=e.height),Mt=Mt>Ft?Mt:Ft,Dt=Dt>zt?Dt:zt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=Mt-t.x,t.height=Dt-t.y},addList(t,e){jt.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){jt.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){jt.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,i=!1){let r,n=!0;for(let o=0,a=e.length;o<a;o++)r=s?s(e[o],o):e[o],r&&(r.width||r.height)&&(n?(n=!1,i||Ht(t,r)):Vt(t,r));n&&jt.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Tt(Ct,t.x,t.y):Pt(Ct,t.x,t.y)),Ot(Ct,t)},setPoint(t,e){jt.set(t,e.x,e.y)},addPoint(t,e){Vt(t,e,!0)},getPoints(t){const{x:e,y:s,width:i,height:r}=t;return[{x:e,y:s},{x:e+i,y:s},{x:e+i,y:s+r},{x:e,y:s+r}]},hitRadiusPoint:(t,e,s)=>(s&&(e=lt.tempToInnerRadiusPointOf(e,s)),e.x>=t.x-e.radiusX&&e.x<=t.x+t.width+e.radiusX&&e.y>=t.y-e.radiusY&&e.y<=t.y+t.height+e.radiusY),hitPoint:(t,e,s)=>(s&&(e=lt.tempToInnerOf(e,s)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,s)=>(s&&(e=jt.tempToOuterOf(e,s)),!(t.y+t.height<e.y||e.y+e.height<t.y||t.x+t.width<e.x||e.x+e.width<t.x)),includes:(t,e,s)=>(s&&(e=jt.tempToOuterOf(e,s)),t.x<=e.x&&t.y<=e.y&&t.x+t.width>=e.x+e.width&&t.y+t.height>=e.y+e.height),getIntersectData(t,e,s){if(s&&(e=jt.tempToOuterOf(e,s)),!jt.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:n,height:o}=e;return Mt=i+n,Dt=r+o,Ft=t.x+t.width,zt=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,Mt=Mt<Ft?Mt:Ft,Dt=Dt<zt?Dt:zt,n=Mt-i,o=Dt-r,{x:i,y:r,width:n,height:o}},intersect(t,e,s){jt.copy(t,jt.getIntersectData(t,e,s))},isSame:(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEmpty:t=>0===t.x&&0===t.y&&0===t.width&&0===t.height,reset(t){jt.set(t)}},jt=Ut,{add:Vt,copy:Ht}=jt;class Gt{get minX(){return Ut.minX(this)}get minY(){return Ut.minY(this)}get maxX(){return Ut.maxX(this)}get maxY(){return Ut.maxY(this)}constructor(t,e,s,i){this.set(t,e,s,i)}set(t,e,s,i){return d(t)?Ut.copy(this,t):Ut.set(this,t,e,s,i),this}get(){const{x:t,y:e,width:s,height:i}=this;return{x:t,y:e,width:s,height:i}}clone(){return new Gt(this)}move(t,e){return Ut.move(this,t,e),this}scale(t,e,s){return Ut.scale(this,t,e,s),this}scaleOf(t,e,s){return Ut.scaleOf(this,t,e,s),this}toOuterOf(t,e){return Ut.toOuterOf(this,t,e),this}toInnerOf(t,e){return Ut.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Ut.getFitMatrix(this,t,e)}put(t,e,s){Ut.put(this,t,e,s)}spread(t,e){return Ut.spread(this,t,e),this}shrink(t,e){return Ut.shrink(this,t,e),this}ceil(){return Ut.ceil(this),this}unsign(){return Ut.unsign(this),this}float(t){return Ut.float(this,t),this}add(t){return Ut.add(this,t),this}addList(t){return Ut.setList(this,t,!0),this}setList(t){return Ut.setList(this,t),this}addListWithFn(t,e){return Ut.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Ut.setListWithFn(this,t,e),this}setPoint(t){return Ut.setPoint(this,t),this}setPoints(t){return Ut.setPoints(this,t),this}addPoint(t){return Ut.addPoint(this,t),this}getPoints(){return Ut.getPoints(this)}hitPoint(t,e){return Ut.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Ut.hitRadiusPoint(this,t,e)}hit(t,e){return Ut.hit(this,t,e)}includes(t,e){return Ut.includes(this,t,e)}intersect(t,e){return Ut.intersect(this,t,e),this}getIntersect(t,e){return new Gt(Ut.getIntersectData(this,t,e))}isSame(t){return Ut.isSame(this,t)}isEmpty(){return Ut.isEmpty(this)}reset(){Ut.reset(this)}}const qt=new Gt;class Qt{constructor(t,e,s,i,r,n){d(t)?this.copy(t):this.set(t,e,s,i,r,n)}set(t=0,e=0,s=0,i=0,r=0,n=0){this.top=t,this.right=e,this.bottom=s,this.left=i,this.width=r,this.height=n}copy(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=t;this.set(e,s,i,r,n,o)}getBoundsFrom(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=this;return new Gt(r,e,n||t.width-r-s,o||t.height-e-i)}}const Jt={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{randColor:$t}=D;class Zt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new Zt(t)}static set filter(t){this.filterList=Kt(t)}static set exclude(t){this.excludeList=Kt(t)}static drawRepaint(t,e){const s=$t();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const i="hit"===Zt.showBounds,r=t.__nowWorld,n=$t();i&&(e.setWorld(r),t.__drawHitPath(e),e.fillStyle=n.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(n,2),i?e.stroke():e.strokeWorld(r,n)}log(...t){if(te.enable){if(te.filterList.length&&te.filterList.every(t=>t!==this.name))return;if(te.excludeList.length&&te.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){te.enable&&this.warn(...t)}warn(...t){te.showWarn&&console.warn(this.name,...t)}repeat(t,...e){this.repeatMap[t]||(this.warn("repeat:"+t,...e),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(e){console.error(this.name,...t,e)}}}function Kt(t){return t?r(t)&&(t=[t]):t=[],t}Zt.filterList=[],Zt.excludeList=[],Zt.showWarn=!0;const te=Zt,ee=Zt.get("RunTime"),se={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const s=w.create(w.RUNTIME);return ie.currentId=ie.idMap[s]=e?performance.now():Date.now(),ie.currentName=ie.nameMap[s]=t,ie.nameToIdMap[t]=s,s},end(t,e){const s=ie.idMap[t],i=ie.nameMap[t],r=e?(performance.now()-s)/1e3:Date.now()-s;ie.idMap[t]=ie.nameMap[t]=ie.nameToIdMap[i]=void 0,ee.log(i,r,"ms")},endOfName(t,e){const i=ie.nameToIdMap[t];s(i)||ie.end(i,e)}},ie=se,re=[],ne={list:{},add(t,...e){this.list[t]=!0,re.push(...e)},has(t,e){const s=this.list[t];return!s&&e&&this.need(t),s},need(t){console.error("please install and import plugin: "+(t.includes("-x")?"":"@leafer-in/")+t)}};setTimeout(()=>re.forEach(t=>ne.has(t,!0)));const oe={editor:t=>ne.need("editor")},ae=Zt.get("UICreator"),he={list:{},register(t){const{__tag:e}=t.prototype;le[e]&&ae.repeat(e),le[e]=t},get(t,e,i,r,n,o){le[t]||ae.error("not register "+t);const a=new le[t](e);return s(i)||(a.x=i,r&&(a.y=r),n&&(a.width=n),o&&(a.height=o)),a}},{list:le}=he,de=Zt.get("EventCreator"),ce={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],r(e)&&(ue[e]&&de.repeat(e),ue[e]=t)})},changeName(t,e){const s=ue[t];if(s){const i=Object.keys(s).find(e=>s[e]===t);i&&(s[i]=e,ue[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new ue[t](...e)},{nameList:ue}=ce;class _e{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:s}=this;for(let i=0,r=s.length;i<r;i++)if(e=s[i],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const i=oe.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,i=this.list.length;s<i;s++)t=this.list[s],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}}function pe(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o}function ge(t,e,s,i){return new(s||(s=Promise))(function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}h((i=i.apply(t,e||[])).next())})}function fe(t){return(e,s)=>{t||(t=s);const i={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===s&&(i.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,s,i)}}"function"==typeof SuppressedError&&SuppressedError;const ye=[];function me(){return(t,e)=>{ye.push(e)}}const xe=[];let we=class{set blendMode(t){"normal"===t&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||xe)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;ye.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,i,r,n){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,i,r,n){d(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,i,r,n)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,i){}strokeRect(t,e,s,i){}clearRect(t,e,s,i){}drawImage(t,e,s,i,r,n,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,n+=t,a-=t}if(s<0){const t=-s/r*h;r+=s,s=0,o+=t,h-=t}this.context.drawImage(t,e,s,i,r,n,o,a,h);break;case 5:this.context.drawImage(t,e,s,i,r);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,i,r,n){}quadraticCurveTo(t,e,s,i){}closePath(){}arc(t,e,s,i,r,n){}arcTo(t,e,s,i,r){}ellipse(t,e,s,i,r,n,o,a){}rect(t,e,s,i){}roundRect(t,e,s,i,r){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,i){}createPattern(t,e){}createRadialGradient(t,e,s,i,r,n){}fillText(t,e,s,i){}measureText(t){}strokeText(t,e,s,i){}destroy(){this.context=null}};pe([fe("imageSmoothingEnabled")],we.prototype,"smooth",void 0),pe([fe("imageSmoothingQuality")],we.prototype,"smoothLevel",void 0),pe([fe("globalAlpha")],we.prototype,"opacity",void 0),pe([fe()],we.prototype,"fillStyle",void 0),pe([fe()],we.prototype,"strokeStyle",void 0),pe([fe("lineWidth")],we.prototype,"strokeWidth",void 0),pe([fe("lineCap")],we.prototype,"strokeCap",void 0),pe([fe("lineJoin")],we.prototype,"strokeJoin",void 0),pe([fe("lineDashOffset")],we.prototype,"dashOffset",void 0),pe([fe()],we.prototype,"miterLimit",void 0),pe([fe()],we.prototype,"shadowBlur",void 0),pe([fe()],we.prototype,"shadowColor",void 0),pe([fe()],we.prototype,"shadowOffsetX",void 0),pe([fe()],we.prototype,"shadowOffsetY",void 0),pe([fe()],we.prototype,"filter",void 0),pe([fe()],we.prototype,"font",void 0),pe([fe()],we.prototype,"fontKerning",void 0),pe([fe()],we.prototype,"fontStretch",void 0),pe([fe()],we.prototype,"fontVariantCaps",void 0),pe([fe()],we.prototype,"textAlign",void 0),pe([fe()],we.prototype,"textBaseline",void 0),pe([fe()],we.prototype,"textRendering",void 0),pe([fe()],we.prototype,"wordSpacing",void 0),pe([fe()],we.prototype,"letterSpacing",void 0),pe([fe()],we.prototype,"direction",void 0),pe([me()],we.prototype,"setTransform",null),pe([me()],we.prototype,"resetTransform",null),pe([me()],we.prototype,"getTransform",null),pe([me()],we.prototype,"save",null),pe([me()],we.prototype,"restore",null),pe([me()],we.prototype,"translate",null),pe([me()],we.prototype,"scale",null),pe([me()],we.prototype,"rotate",null),pe([me()],we.prototype,"fill",null),pe([me()],we.prototype,"stroke",null),pe([me()],we.prototype,"clip",null),pe([me()],we.prototype,"fillRect",null),pe([me()],we.prototype,"strokeRect",null),pe([me()],we.prototype,"clearRect",null),pe([me()],we.prototype,"beginPath",null),pe([me()],we.prototype,"moveTo",null),pe([me()],we.prototype,"lineTo",null),pe([me()],we.prototype,"bezierCurveTo",null),pe([me()],we.prototype,"quadraticCurveTo",null),pe([me()],we.prototype,"closePath",null),pe([me()],we.prototype,"arc",null),pe([me()],we.prototype,"arcTo",null),pe([me()],we.prototype,"ellipse",null),pe([me()],we.prototype,"rect",null),pe([me()],we.prototype,"roundRect",null),pe([me()],we.prototype,"createConicGradient",null),pe([me()],we.prototype,"createLinearGradient",null),pe([me()],we.prototype,"createPattern",null),pe([me()],we.prototype,"createRadialGradient",null),pe([me()],we.prototype,"fillText",null),pe([me()],we.prototype,"measureText",null),pe([me()],we.prototype,"strokeText",null);const{copy:ve,multiplyParent:be,pixelScale:ke}=Z,{round:Se}=Math,Be=new Gt,Re=new Gt,Ce={width:1,height:1,pixelRatio:1},Te=["width","height","pixelRatio"];class Pe extends we{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,e){super(),this.size={},this.worldTransform={},t||(t=Ce),this.manager=e,this.innerId=w.create(w.CNAVAS);const{width:s,height:i,pixelRatio:r}=t;this.autoLayout=!s||!i,this.size.pixelRatio=r||m.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&e&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;_.copyAttrs(i,t,Te),Te.forEach(t=>i[t]||(i[t]=1)),this.bounds=new Gt(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&s&&(this.clearWorld(s.bounds),this.copyWorld(s),s.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s,pixelSnap:i}=this,r=this.worldTransform;e&&be(t,e,r),ke(t,s,r),i&&!t.ignorePixelSnap&&(t.half&&t.half*s%2?(r.e=Se(r.e-.5)+.5,r.f=Se(r.f-.5)+.5):(r.e=Se(r.e),r.f=Se(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,s,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,e){let{strokeCap:i,strokeJoin:r,dashPattern:n,dashOffset:o,miterLimit:a}=t;e&&(e.strokeCap&&(i=e.strokeCap),e.strokeJoin&&(r=e.strokeJoin),s(e.dashPattern)||(n=e.dashPattern),s(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=i,this.strokeJoin=r,this.dashPattern=n,this.dashOffset=o,this.miterLimit=a}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,s=1){return!0}setWorldShadow(t,e,s,i){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=s*r,this.shadowColor=i||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,i,r=!0){i&&(this.blendMode=i),e?(this.setTempPixelBounds(e,r),s?(this.setTempPixelBounds2(s,r),s=Re):s=Be,this.drawImage(t.view,Be.x,Be.y,Be.width,Be.height,s.x,s.y,s.width,s.height)):this.drawImage(t.view,0,0),i&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,i,r=!0){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Ut.tempToOuterOf(s,e),i,r),this.restore()):(i&&(this.blendMode=i),this.setTempPixelBounds(e,r),this.drawImage(t.view,Be.x,Be.y,Be.width,Be.height,s.x,s.y,s.width,s.height),i&&(this.blendMode="source-over"))}copyWorldByReset(t,e,s,i,r,n=!0){this.resetTransform(),this.copyWorld(t,e,s,i,n),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,s;this.setTempPixelBounds(t,!0,!0);const{context:i}=this,r=i.getImageData(Be.x,Be.y,Be.width,Be.height),{data:n}=r;for(let t=0,i=n.length;t<i;t+=4)s=.299*n[t]+.587*n[t+1]+.114*n[t+2],(e=n[t+3])&&(n[t+3]=255===e?s:e*(s/255));i.putImageData(r,Be.x,Be.y)}useMask(t,e,s){this.copyWorld(t,e,s,"destination-in")}useEraser(t,e,s){this.copyWorld(t,e,s,"destination-out")}fillWorld(t,e,s,i){s&&(this.blendMode=s),this.fillStyle=e,this.setTempPixelBounds(t,i),this.fillRect(Be.x,Be.y,Be.width,Be.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s,i){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempPixelBounds(t,i),this.strokeRect(Be.x,Be.y,Be.width,Be.height),s&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Be.x,Be.y,Be.width,Be.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Be.x,Be.y,Be.width,Be.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,s){this.copyToPixelBounds(Be,t,e,s)}setTempPixelBounds2(t,e,s){this.copyToPixelBounds(Re,t,e,s)}copyToPixelBounds(t,e,s,i){t.set(e),i&&t.intersect(this.bounds),t.scale(this.pixelRatio),s&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:s,pixelSnap:i}=this,r=this.manager?this.manager.get(s):oe.canvas(Object.assign({},s));return r.save(),t&&(ve(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==i&&(r.pixelSnap=i),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}}const Oe={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Ee={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Le=Object.assign({M:1,m:10,L:2,l:20,H:3,h:30,V:4,v:40,C:5,c:50,S:6,s:60,Q:7,q:70,T:8,t:80,A:9,a:90,Z:11,z:11,R:12},Ee),Ae={M:3,m:3,L:3,l:3,H:2,h:2,V:2,v:2,C:7,c:7,S:5,s:5,Q:5,q:5,T:3,t:3,A:8,a:8,Z:1,z:1,N:5,D:9,X:6,G:9,F:5,O:7,P:4,U:6},Ie={m:10,l:20,H:3,h:30,V:4,v:40,c:50,S:6,s:60,q:70,T:8,t:80,A:9,a:90},We=Object.assign(Object.assign({},Ie),Ee),Me=Le,De={};for(let t in Me)De[Me[t]]=t;const Fe={};for(let t in Me)Fe[Me[t]]=Ae[t];const ze={drawRoundRect(t,e,s,i,r,n){const o=D.fourNumber(n,Math.min(i/2,r/2)),a=e+i,h=s+r;o[0]?t.moveTo(e+o[0],s):t.moveTo(e,s),o[1]?t.arcTo(a,s,a,h,o[1]):t.lineTo(a,s),o[2]?t.arcTo(a,h,e,h,o[2]):t.lineTo(a,h),o[3]?t.arcTo(e,h,e,s,o[3]):t.lineTo(e,h),o[0]?t.arcTo(e,s,a,s,o[0]):t.lineTo(e,s)}},{sin:Ne,cos:Ye,hypot:Xe,atan2:Ue,ceil:je,abs:Ve,PI:He,sqrt:Ge,pow:qe}=Math,{setPoint:Qe,addPoint:Je}=mt,{set:$e,toNumberPoints:Ze}=lt,{M:Ke,L:ts,C:es,Q:ss,Z:is}=Le,rs={},ns={points(t,e,s,i){let r=Ze(e);if(t.push(Ke,r[0],r[1]),s&&r.length>5){let e,n,o,a,h,l,d,c,u,_,p,g,f,y=r.length;const m=!0===s?.5:s;i&&(r=[r[y-2],r[y-1],...r,r[0],r[1],r[2],r[3]],y=r.length);for(let s=2;s<y-2;s+=2)e=r[s-2],n=r[s-1],o=r[s],a=r[s+1],h=r[s+2],l=r[s+3],p=Ge(qe(o-e,2)+qe(a-n,2)),g=Ge(qe(h-o,2)+qe(l-a,2)),(p||g)&&(f=p+g,p=m*p/f,g=m*g/f,h-=e,l-=n,d=o-p*h,c=a-p*l,2===s?i||t.push(ss,d,c,o,a):t.push(es,u,_,d,c,o,a),u=o+g*h,_=a+g*l);i||t.push(ss,u,_,r[y-2],r[y-1])}else for(let e=2,s=r.length;e<s;e+=2)t.push(ts,r[e],r[e+1]);i&&t.push(is)},rect(t,e,s,i,r){Oe.creator.path=t,Oe.creator.moveTo(e,s).lineTo(e+i,s).lineTo(e+i,s+r).lineTo(e,s+r).lineTo(e,s)},roundRect(t,e,s,i,r,n){Oe.creator.path=[],ze.drawRoundRect(Oe.creator,e,s,i,r,n),t.push(...Oe.convertToCanvasData(Oe.creator.path,!0))},arcTo(t,e,s,i,r,n,o,a,h,l,d){const c=i-e,u=r-s,_=n-i,p=o-r;let g=Ue(u,c),f=Ue(p,_);const y=Xe(c,u),m=Xe(_,p);let x=f-g;if(x<0&&(x+=N),y<1e-12||m<1e-12||x<1e-12||Ve(x-He)<1e-12)return t&&t.push(ts,i,r),h&&(Qe(h,e,s),Je(h,i,r)),d&&$e(d,e,s),void(l&&$e(l,i,r));const w=c*p-_*u<0,v=w?-1:1,b=a/Ye(x/2),k=i+b*Ye(g+x/2+Y*v),S=r+b*Ne(g+x/2+Y*v);return g-=Y*v,f-=Y*v,hs(t,k,S,a,a,0,g/z,f/z,w,h,l,d)},arc:(t,e,s,i,r,n,o,a,h,l)=>hs(t,e,s,i,i,0,r,n,o,a,h,l),ellipse(t,e,s,i,r,n,o,a,h,l,d,c){const u=n*z,_=Ne(u),p=Ye(u);let g=o*z,f=a*z;g>He&&(g-=N),f<0&&(f+=N);let y=f-g;y<0?y+=N:y>N&&(y-=N),h&&(y-=N);const m=je(Ve(y/Y)),x=y/m,w=Ne(x/4),v=8/3*w*w/Ne(x/2);f=g+x;let b,k,S,B,R,C,T,P,O=Ye(g),E=Ne(g),L=S=p*i*O-_*r*E,A=B=_*i*O+p*r*E,I=e+S,W=s+B;t&&t.push(t.length?ts:Ke,I,W),l&&Qe(l,I,W),c&&$e(c,I,W);for(let n=0;n<m;n++)b=Ye(f),k=Ne(f),S=p*i*b-_*r*k,B=_*i*b+p*r*k,R=e+L-v*(p*i*E+_*r*O),C=s+A-v*(_*i*E-p*r*O),T=e+S+v*(p*i*k+_*r*b),P=s+B+v*(_*i*k-p*r*b),t&&t.push(es,R,C,T,P,e+S,s+B),l&&as(e+L,s+A,R,C,T,P,e+S,s+B,l,!0),L=S,A=B,O=b,E=k,g=f,f+=x;d&&$e(d,e+S,s+B)},quadraticCurveTo(t,e,s,i,r,n,o){t.push(es,(e+2*i)/3,(s+2*r)/3,(n+2*i)/3,(o+2*r)/3,n,o)},toTwoPointBoundsByQuadraticCurve(t,e,s,i,r,n,o,a){as(t,e,(t+2*s)/3,(e+2*i)/3,(r+2*s)/3,(n+2*i)/3,r,n,o,a)},toTwoPointBounds(t,e,s,i,r,n,o,a,h,l){const d=[];let c,u,_,p,g,f,y,m,x=t,w=s,v=r,b=o;for(let t=0;t<2;++t)if(1==t&&(x=e,w=i,v=n,b=a),c=-3*x+9*w-9*v+3*b,u=6*x-12*w+6*v,_=3*w-3*x,Math.abs(c)<1e-12){if(Math.abs(u)<1e-12)continue;p=-_/u,0<p&&p<1&&d.push(p)}else y=u*u-4*_*c,m=Math.sqrt(y),y<0||(g=(-u+m)/(2*c),0<g&&g<1&&d.push(g),f=(-u-m)/(2*c),0<f&&f<1&&d.push(f));l?Je(h,t,e):Qe(h,t,e),Je(h,o,a);for(let l=0,c=d.length;l<c;l++)os(d[l],t,e,s,i,r,n,o,a,rs),Je(h,rs.x,rs.y)},getPointAndSet(t,e,s,i,r,n,o,a,h,l){const d=1-t,c=d*d*d,u=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=c*e+u*i+_*n+p*a,l.y=c*s+u*r+_*o+p*h},getPoint(t,e,s,i,r,n,o,a,h){const l={};return os(t,e,s,i,r,n,o,a,h,l),l},getDerivative(t,e,s,i,r){const n=1-t;return 3*n*n*(s-e)+6*n*t*(i-s)+3*t*t*(r-i)}},{getPointAndSet:os,toTwoPointBounds:as,ellipse:hs}=ns,{sin:ls,cos:ds,sqrt:cs,atan2:us}=Math,{ellipse:_s}=ns,ps={ellipticalArc(t,e,s,i,r,n,o,a,h,l,d){const c=(h-e)/2,u=(l-s)/2,_=n*z,p=ls(_),g=ds(_),f=-g*c-p*u,y=-g*u+p*c,x=i*i,w=r*r,v=y*y,b=f*f,k=x*w-x*v-w*b;let S=0;if(k<0){const t=cs(1-k/(x*w));i*=t,r*=t}else S=(o===a?-1:1)*cs(k/(x*v+w*b));const B=S*i*y/r,R=-S*r*f/i,C=us((y-R)/r,(f-B)/i),T=us((-y-R)/r,(-f-B)/i);let P=T-C;0===a&&P>0?P-=N:1===a&&P<0&&(P+=N);const O=e+c+g*B-p*R,E=s+u+p*B+g*R,L=P<0?1:0;d||m.ellipseToCurve?_s(t,O,E,i,r,n,C/z,T/z,L):i!==r||n?t.push(Le.G,O,E,i,r,n,C/z,T/z,L):t.push(Le.O,O,E,i,C/z,T/z,L)}},{M:gs,m:fs,L:ys,l:ms,H:xs,h:ws,V:vs,v:bs,C:ks,c:Ss,S:Bs,s:Rs,Q:Cs,q:Ts,T:Ps,t:Os,A:Es,a:Ls,Z:As,z:Is,N:Ws,D:Ms,X:Ds,G:Fs,F:zs,O:Ns,P:Ys,U:Xs}=Le,{rect:Us,roundRect:js,arcTo:Vs,arc:Hs,ellipse:Gs,quadraticCurveTo:qs}=ns,{ellipticalArc:Qs}=ps,Js=Zt.get("PathConvert"),$s={},Zs={current:{dot:0},stringify(t,e){let s,i,r,n=0,o=t.length,a="";for(;n<o;){i=t[n],s=Fe[i],a+=i===r?" ":De[i];for(let i=1;i<s;i++)a+=D.float(t[n+i],e),i===s-1||(a+=" ");r=i,n+=s}return a},parse(t,e){let s,i,r,n="";const o=[],a=e?We:Ie;for(let e=0,h=t.length;e<h;e++)i=t[e],Jt[i]?("."===i&&(Ks.dot&&(ti(o,n),n=""),Ks.dot++),"0"===n&&"."!==i&&(ti(o,n),n=""),n+=i):Le[i]?(n&&(ti(o,n),n=""),Ks.name=Le[i],Ks.length=Ae[i],Ks.index=0,ti(o,Ks.name),!s&&a[i]&&(s=!0)):"-"===i||"+"===i?"e"===r||"E"===r?n+=i:(n&&ti(o,n),n=i):n&&(ti(o,n),n=""),r=i;return n&&ti(o,n),s?Zs.toCanvasData(o,e):o},toCanvasData(t,e){let s,i,r,n,o,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(r=t[c],r){case fs:t[c+1]+=a,t[c+2]+=h;case gs:a=t[c+1],h=t[c+2],_.push(gs,a,h),c+=3;break;case ws:t[c+1]+=a;case xs:a=t[c+1],_.push(ys,a,h),c+=2;break;case bs:t[c+1]+=h;case vs:h=t[c+1],_.push(ys,a,h),c+=2;break;case ms:t[c+1]+=a,t[c+2]+=h;case ys:a=t[c+1],h=t[c+2],_.push(ys,a,h),c+=3;break;case Rs:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Bs;case Bs:o=n===ks||n===Bs,l=o?2*a-s:t[c+1],d=o?2*h-i:t[c+2],s=t[c+1],i=t[c+2],a=t[c+3],h=t[c+4],_.push(ks,l,d,s,i,a,h),c+=5;break;case Ss:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,t[c+5]+=a,t[c+6]+=h,r=ks;case ks:s=t[c+3],i=t[c+4],a=t[c+5],h=t[c+6],_.push(ks,t[c+1],t[c+2],s,i,a,h),c+=7;break;case Os:t[c+1]+=a,t[c+2]+=h,r=Ps;case Ps:o=n===Cs||n===Ps,s=o?2*a-s:t[c+1],i=o?2*h-i:t[c+2],e?qs(_,a,h,s,i,t[c+1],t[c+2]):_.push(Cs,s,i,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case Ts:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Cs;case Cs:s=t[c+1],i=t[c+2],e?qs(_,a,h,s,i,t[c+3],t[c+4]):_.push(Cs,s,i,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case Ls:t[c+6]+=a,t[c+7]+=h;case Es:Qs(_,a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],e),a=t[c+6],h=t[c+7],c+=8;break;case Is:case As:_.push(As),c++;break;case Ws:a=t[c+1],h=t[c+2],e?Us(_,a,h,t[c+3],t[c+4]):ei(_,t,c,5),c+=5;break;case Ms:a=t[c+1],h=t[c+2],e?js(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):ei(_,t,c,9),c+=9;break;case Ds:a=t[c+1],h=t[c+2],e?js(_,a,h,t[c+3],t[c+4],t[c+5]):ei(_,t,c,6),c+=6;break;case Fs:Gs(e?_:ei(_,t,c,9),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],t[c+8],null,$s),a=$s.x,h=$s.y,c+=9;break;case zs:e?Gs(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):ei(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case Ns:Hs(e?_:ei(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,$s),a=$s.x,h=$s.y,c+=7;break;case Ys:e?Hs(_,t[c+1],t[c+2],t[c+3],0,360,!1):ei(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case Xs:Vs(e?_:ei(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,$s),a=$s.x,h=$s.y,c+=6;break;default:return Js.error(`command: ${r} [index:${c}]`,t),_}n=r}return _},objectToCanvasData(t){const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(gs,t.x,t.y);break;case"L":e.push(ys,t.x,t.y);break;case"C":e.push(ks,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Cs,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(As)}}),e},copyData(t,e,s,i){for(let r=s,n=s+i;r<n;r++)t.push(e[r])},pushData(t,e){Ks.index===Ks.length&&(Ks.index=1,t.push(Ks.name)),t.push(Number(e)),Ks.index++,Ks.dot=0}},{current:Ks,pushData:ti,copyData:ei}=Zs,{M:si,L:ii,C:ri,Q:ni,Z:oi,N:ai,D:hi,X:li,G:di,F:ci,O:ui,P:_i,U:pi}=Le,{getMinDistanceFrom:gi,getRadianFrom:fi}=lt,{tan:yi,min:mi,abs:xi}=Math,wi={},vi={beginPath(t){t.length=0},moveTo(t,e,s){t.push(si,e,s)},lineTo(t,e,s){t.push(ii,e,s)},bezierCurveTo(t,e,s,i,r,n,o){t.push(ri,e,s,i,r,n,o)},quadraticCurveTo(t,e,s,i,r){t.push(ni,e,s,i,r)},closePath(t){t.push(oi)},rect(t,e,s,i,r){t.push(ai,e,s,i,r)},roundRect(t,e,s,i,r,n){if(o(n))t.push(li,e,s,i,r,n);else{const o=D.fourNumber(n);o?t.push(hi,e,s,i,r,...o):t.push(ai,e,s,i,r)}},ellipse(t,e,s,r,n,o,a,h,l){i(o)?t.push(ci,e,s,r,n):(i(a)&&(a=0),i(h)&&(h=360),t.push(di,e,s,r,n,o,a,h,l?1:0))},arc(t,e,s,r,n,o,a){i(n)?t.push(_i,e,s,r):(i(o)&&(o=360),t.push(ui,e,s,r,n,o,a?1:0))},arcTo(t,e,i,r,n,o,a,h){if(!s(a)){const t=gi(a,h,e,i,r,n);o=mi(o,mi(t/2,t/2*xi(yi(fi(a,h,e,i,r,n)/2))))}t.push(pi,e,i,r,n,o)},drawEllipse(t,e,s,r,n,o,a,h,l){ns.ellipse(null,e,s,r,n,i(o)?0:o,i(a)?0:a,i(h)?360:h,l,null,null,wi),t.push(si,wi.x,wi.y),bi(t,e,s,r,n,o,a,h,l)},drawArc(t,e,s,r,n,o,a){ns.arc(null,e,s,r,i(n)?0:n,i(o)?360:o,a,null,null,wi),t.push(si,wi.x,wi.y),ki(t,e,s,r,n,o,a)},drawPoints(t,e,s,i){ns.points(t,e,s,i)}},{ellipse:bi,arc:ki}=vi,{moveTo:Si,lineTo:Bi,quadraticCurveTo:Ri,bezierCurveTo:Ci,closePath:Ti,beginPath:Pi,rect:Oi,roundRect:Ei,ellipse:Li,arc:Ai,arcTo:Ii,drawEllipse:Wi,drawArc:Mi,drawPoints:Di}=vi;class Fi{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?r(t)?Oe.parse(t):t:[],this}beginPath(){return Pi(this.__path),this.paint(),this}moveTo(t,e){return Si(this.__path,t,e),this.paint(),this}lineTo(t,e){return Bi(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,i,r,n){return Ci(this.__path,t,e,s,i,r,n),this.paint(),this}quadraticCurveTo(t,e,s,i){return Ri(this.__path,t,e,s,i),this.paint(),this}closePath(){return Ti(this.__path),this.paint(),this}rect(t,e,s,i){return Oi(this.__path,t,e,s,i),this.paint(),this}roundRect(t,e,s,i,r){return Ei(this.__path,t,e,s,i,r),this.paint(),this}ellipse(t,e,s,i,r,n,o,a){return Li(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}arc(t,e,s,i,r,n){return Ai(this.__path,t,e,s,i,r,n),this.paint(),this}arcTo(t,e,s,i,r){return Ii(this.__path,t,e,s,i,r),this.paint(),this}drawEllipse(t,e,s,i,r,n,o,a){return Wi(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}drawArc(t,e,s,i,r,n){return Mi(this.__path,t,e,s,i,r,n),this.paint(),this}drawPoints(t,e,s){return Di(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:zi,L:Ni,C:Yi,Q:Xi,Z:Ui,N:ji,D:Vi,X:Hi,G:Gi,F:qi,O:Qi,P:Ji,U:$i}=Le,Zi=Zt.get("PathDrawer"),Ki={drawPathByData(t,e){if(!e)return;let s,i=0,r=e.length;for(;i<r;)switch(s=e[i],s){case zi:t.moveTo(e[i+1],e[i+2]),i+=3;break;case Ni:t.lineTo(e[i+1],e[i+2]),i+=3;break;case Yi:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case Xi:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Ui:t.closePath(),i+=1;break;case ji:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Vi:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],[e[i+5],e[i+6],e[i+7],e[i+8]]),i+=9;break;case Hi:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case Gi:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*z,e[i+6]*z,e[i+7]*z,e[i+8]),i+=9;break;case qi:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,N,!1),i+=5;break;case Qi:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*z,e[i+5]*z,e[i+6]),i+=7;break;case Ji:t.arc(e[i+1],e[i+2],e[i+3],0,N,!1),i+=4;break;case $i:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void Zi.error(`command: ${s} [index:${i}]`,e)}}},{M:tr,L:er,C:sr,Q:ir,Z:rr,N:nr,D:or,X:ar,G:hr,F:lr,O:dr,P:cr,U:ur}=Le,{toTwoPointBounds:_r,toTwoPointBoundsByQuadraticCurve:pr,arcTo:gr,arc:fr,ellipse:yr}=ns,{addPointBounds:mr,copy:xr,addPoint:wr,setPoint:vr,addBounds:br,toBounds:kr}=mt,Sr=Zt.get("PathBounds");let Br,Rr,Cr;const Tr={},Pr={},Or={},Er={toBounds(t,e){Er.toTwoPointBounds(t,Pr),kr(Pr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return vr(e,0,0);let s,i,r,n,o,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(o=t[a],0===a&&(o===rr||o===sr||o===ir?vr(e,h,l):vr(e,t[a+1],t[a+2])),o){case tr:case er:h=t[a+1],l=t[a+2],wr(e,h,l),a+=3;break;case sr:r=t[a+5],n=t[a+6],_r(h,l,t[a+1],t[a+2],t[a+3],t[a+4],r,n,Tr),mr(e,Tr),h=r,l=n,a+=7;break;case ir:s=t[a+1],i=t[a+2],r=t[a+3],n=t[a+4],pr(h,l,s,i,r,n,Tr),mr(e,Tr),h=r,l=n,a+=5;break;case rr:a+=1;break;case nr:h=t[a+1],l=t[a+2],br(e,h,l,t[a+3],t[a+4]),a+=5;break;case or:case ar:h=t[a+1],l=t[a+2],br(e,h,l,t[a+3],t[a+4]),a+=o===or?9:6;break;case hr:yr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],Tr,Or),0===a?xr(e,Tr):mr(e,Tr),h=Or.x,l=Or.y,a+=9;break;case lr:h=t[a+1],l=t[a+2],Rr=t[a+3],Cr=t[a+4],br(e,h-Rr,l-Cr,2*Rr,2*Cr),h+=Rr,a+=5;break;case dr:fr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Tr,Or),0===a?xr(e,Tr):mr(e,Tr),h=Or.x,l=Or.y,a+=7;break;case cr:h=t[a+1],l=t[a+2],Br=t[a+3],br(e,h-Br,l-Br,2*Br,2*Br),h+=Br,a+=4;break;case ur:gr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Tr,Or),0===a?xr(e,Tr):mr(e,Tr),h=Or.x,l=Or.y,a+=6;break;default:return void Sr.error(`command: ${o} [index:${a}]`,t)}}},{M:Lr,L:Ar,Z:Ir}=Le,{getCenterX:Wr,getCenterY:Mr}=lt,{arcTo:Dr}=vi,Fr={smooth(t,e,s){let i,r,n,o=0,a=0,h=0,l=0,d=0,c=0,u=0,_=0,p=0;const g=t.length,f=[];for(;o<g;){switch(i=t[o],i){case Lr:l=_=t[o+1],d=p=t[o+2],o+=3,t[o]===Ar?(c=t[o+1],u=t[o+2],f.push(Lr,Wr(l,c),Mr(d,u))):f.push(Lr,l,d);break;case Ar:switch(a=t[o+1],h=t[o+2],o+=3,t[o]){case Ar:Dr(f,a,h,t[o+1],t[o+2],e,_,p);break;case Ir:Dr(f,a,h,l,d,e,_,p);break;default:f.push(Ar,a,h)}_=a,p=h;break;case Ir:r!==Ir&&(Dr(f,l,d,c,u,e,_,p),f.push(Ir)),o+=1;break;default:n=Fe[i];for(let e=0;e<n;e++)f.push(t[o+e]);o+=n}r=i}return i!==Ir&&(f[1]=l,f[2]=d),f}};function zr(t){return new Fi(t)}const Nr=zr();Oe.creator=zr(),Oe.parse=Zs.parse,Oe.convertToCanvasData=Zs.toCanvasData;const{drawRoundRect:Yr}=ze;function Xr(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,i,r){Yr(this,t,e,s,i,r)})}(t)}const Ur={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mineType:t=>!t||t.startsWith("image")?t:("jpg"===t&&(t="jpeg"),"image/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=jr.fileType(t);return["jpg","jpeg"].some(t=>t===e)},getExportOptions(t){switch(typeof t){case"object":return t;case"number":return{quality:t};case"boolean":return{blob:t};default:return{}}}},jr=Ur;jr.alphaPixelTypes.forEach(t=>jr.upperCaseTypeMap[t]=t.toUpperCase());const Vr=Zt.get("TaskProcessor");class Hr{constructor(t){this.parallel=!0,this.time=1,this.id=w.create(w.TASK),this.task=t}run(){return ge(this,void 0,void 0,function*(){try{if(this.isComplete)return;if(this.canUse&&!this.canUse())return this.cancel();this.task&&this.parent.running&&(yield this.task())}catch(t){Vr.error(t)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}}class Gr{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(e=s)):e+=this.list[i].time;return this.isComplete?1:s/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&_.assign(this.config,t),this.empty()}add(t,e,i){let r,n,a,h;const l=new Hr(t);return l.parent=this,o(e)?h=e:e&&(n=e.parallel,r=e.start,a=e.time,h=e.delay,i||(i=e.canUse)),a&&(l.time=a),!1===n&&(l.parallel=!1),i&&(l.canUse=i),s(h)?this.push(l,r):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(l,r))},h)),this.isComplete=!1,l}push(t,e){this.list.push(t),!1===e||this.timer||(this.timer=setTimeout(()=>this.start()))}empty(){this.index=0,this.parallelSuccessNumber=0,this.list=[],this.parallelList=[],this.delayNumber=0}start(){this.running||(this.running=!0,this.isComplete=!1,this.run())}pause(){clearTimeout(this.timer),this.timer=null,this.running=!1}resume(){this.start()}skip(){this.index++,this.resume()}stop(){this.isComplete=!0,this.list.forEach(t=>{t.isComplete||t.cancel()}),this.pause(),this.empty()}run(){this.running&&(this.setParallelList(),this.parallelList.length>1?this.runParallelTasks():this.remain?this.runTask():this.onComplete())}runTask(){const t=this.list[this.index];t?t.run().then(()=>{this.onTask(t),this.index++,t.isCancel?this.runTask():this.nextTask()}).catch(t=>{this.onError(t)}):this.timer=setTimeout(()=>this.nextTask())}runParallelTasks(){this.parallelList.forEach(t=>this.runParallelTask(t))}runParallelTask(t){t.run().then(()=>{this.onTask(t),this.fillParallelTask()}).catch(t=>{this.onParallelError(t)})}nextTask(){this.total===this.finishedIndex?this.onComplete():this.timer=setTimeout(()=>this.run())}setParallelList(){let t;const{config:e,list:s,index:i}=this;this.parallelList=[],this.parallelSuccessNumber=0;let r=i+e.parallel;if(r>s.length&&(r=s.length),e.parallel>1)for(let e=i;e<r&&(t=s[e],t.parallel);e++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const s=e.length,i=this.finishedIndex+s;if(e.length){if(!this.running)return;i<this.total&&(t=this.list[i],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach(t=>{t.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}}const qr=Zt.get("Resource"),Qr={tasker:new Gr,map:{},get isComplete(){return Jr.tasker.isComplete},set(t,e){Jr.map[t]&&qr.repeat(t),Jr.map[t]=e},get:t=>Jr.map[t],remove(t){const e=Jr.map[t];e&&(e.destroy&&e.destroy(),delete Jr.map[t])},loadImage(t,e){return new Promise((s,i)=>{const r=this.setImage(t,t,e);r.load(()=>s(r),t=>i(t))})},setImage(t,e,s){let i;return r(e)?i={url:e}:e.url||(i={url:t,view:e}),i&&(s&&(i.format=s),e=oe.image(i)),Jr.set(t,e),e},destroy(){Jr.map={}}},Jr=Qr,$r={maxRecycled:10,recycledList:[],patternTasker:new Gr,get(t){let e=Qr.get(t.url);return e||Qr.set(t.url,e=oe.image(t)),e.use++,e},recycle(t){t.use--,setTimeout(()=>{t.use||Zr.recycledList.push(t)})},clearRecycled(){const t=Zr.recycledList;t.length>Zr.maxRecycled&&(t.forEach(t=>!t.use&&t.url&&Qr.remove(t.url)),t.length=0)},hasAlphaPixel:t=>Ur.alphaPixelTypes.some(e=>Zr.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+Ur.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+Ur.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){Zr.recycledList=[]}},Zr=$r,{IMAGE:Kr,create:tn}=w;class en{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=tn(Kr),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}$r.isFormat("svg",t)&&(this.isSVG=!0),$r.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e){if(!this.loading){this.loading=!0;const{crossOrigin:t}=this.config;Qr.tasker.add(()=>ge(this,void 0,void 0,function*(){return yield m.origin.loadImage(this.url,s(t)?m.image.crossOrigin:t,this).then(t=>this.setView(t)).catch(t=>{this.error=t,this.onComplete(!1)})}))}return this.waitComplete.push(t,e),this.waitComplete.length-2}unload(t,e){const s=this.waitComplete;if(e){const e=s[t+1];e&&e({type:"stop"})}s[t]=s[t+1]=void 0}setView(t){this.ready=!0,this.width=t.naturalWidth||t.width,this.height=t.naturalHeight||t.height,this.view=t,this.onComplete(!0)}onComplete(t){let e;this.waitComplete.forEach((s,i)=>{e=i%2,s&&(t?e||s(this):e&&s(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,s,i,r,n,o){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let s in t)if(t[s]!==arguments[s]){e=null;break}if(e)return e}const a=m.image.resize(this.view,t,e,r,n,void 0,o,s,i);return this.cache=this.use>1?{data:a,params:arguments}:null,a}getPattern(t,e,s,i){const r=m.canvas.createPattern(t,e);return m.image.setPatternTransform(r,s,i),r}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}}function sn(t,e,s,i){i||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function rn(t,e){return Object.getOwnPropertyDescriptor(t,e)}function nn(t,e){const s="_"+t;return{get(){const t=this[s];return null==t?e:t},set(t){this[s]=t}}}function on(t,e){return(s,i)=>hn(s,i,t,e&&e(i))}function an(t){return t}function hn(t,e,s,i){const r={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};sn(t,e,Object.assign(r,i||{})),Dn(t,e,s)}function ln(t){return on(t)}function dn(t,e){return on(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function cn(t,e){return on(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function un(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),yn(this))}}))}function _n(t,e){return on(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function pn(t,e){return on(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function gn(t,e){return on(t,t=>({set(s){this.__setAttr(t,s,e)&&yn(this)}}))}function fn(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(yn(this),this.__.__removeNaturalSize())}}))}function yn(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function mn(t){return on(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),yn(this)}}))}const xn=gn;function wn(t,e){return on(t,t=>({set(s){this.__setAttr(t,s)&&(vn(this),e&&(this.__.__useStroke=!0))}}))}function vn(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&yn(t)}const bn=wn;function kn(t){return on(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Sn(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function Bn(t){return on(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;_.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip),this.__layout.surfaceChange()}}}))}function Rn(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&Tn(this)}}))}function Cn(t){return on(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>Pn(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");Pn(this,t,e,s),this.mask&&Tn(this)}}))}function Tn(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function Pn(t,e,s,i){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==s||yn(t))}function On(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChange(),this.waitParent(()=>{this.parent.__layout.childrenSortChange()}))}}))}function En(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function Ln(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function An(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===Zt.showBounds&&this.__layout.surfaceChange(),this.leafer&&this.leafer.updateCursor())}}))}function In(t){return on(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function Wn(t){return(e,s)=>{sn(e,"__DataProcessor",{get:()=>t})}}function Mn(t){return(e,s)=>{sn(e,"__LayoutProcessor",{get:()=>t})}}function Dn(t,e,i){const r=t.__DataProcessor.prototype,n="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=nn(e,i);if(s(i))a.get=function(){return this[n]};else if("function"==typeof i)a.get=function(){const t=this[n];return null==t?i(this.__leaf):t};else if(d(i)){const t=u(i);a.get=function(){const e=this[n];return null==e?this[n]=t?{}:_.clone(i):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalWidth,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&s.children.length?s.boxBounds.width:i}return t}:"height"===e&&(a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalHeight,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&s.children.length?s.boxBounds.height:i}return t});let l,c=r;for(;!l&&c;)l=rn(c,e),c=c.__proto__;l&&l.set&&(a.set=l.set),r[o]&&(a.set=r[o],delete r[o]),sn(r,e,a)}const Fn=new Zt("rewrite"),zn=[],Nn=["destroy","constructor"];function Yn(t){return(e,s)=>{zn.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function Xn(){return t=>{Un()}}function Un(t){zn.length&&(zn.forEach(e=>{t&&Fn.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),zn.length=0)}function jn(t,e){return s=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach(i=>{if(!(Nn.includes(i)||e&&e.includes(i)))if(t.prototype){rn(t.prototype,i).writable&&(s.prototype[i]=t.prototype[i])}else s.prototype[i]=t[i]})}}function Vn(){return t=>{he.register(t)}}function Hn(){return t=>{ce.register(t)}}setTimeout(()=>Un(!0));const{copy:Gn,toInnerPoint:qn,toOuterPoint:Qn,scaleOfOuter:Jn,rotateOfOuter:$n,skewOfOuter:Zn,multiplyParent:Kn,divideParent:to,getLayout:eo}=Z,so={},{round:io}=Math,ro={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),ao(t,e,s),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)oo(i[t],e,s)}},updateMatrix(t,e,s){const i=t.__layout;e?s&&(i.waitAutoLayout=!0,t.__hasAutoLayout&&(i.matrixChanged=!1)):i.waitAutoLayout&&(i.waitAutoLayout=!1),i.matrixChanged&&t.__updateLocalMatrix(),i.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)ho(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&ho(t),t.__updateChange()},updateAllChange(t){if(co(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)lo(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},draggable:t=>(t.draggable||t.editable)&&t.hitSelf&&!t.locked,copyCanvasByWorld(t,e,s,i,r,n){i||(i=t.__nowWorld),t.__worldFlipped||m.fullImageShadow?e.copyWorldByReset(s,i,t.__nowWorld,r,n):e.copyWorldToInner(s,i,t.__layout.renderBounds,r)},moveWorld(t,e,s=0,i,r){const n=d(e)?Object.assign({},e):{x:e,y:s};i?Qn(t.localTransform,n,n,!0):t.parent&&qn(t.parent.scrollWorldTransform,n,n,!0),no.moveLocal(t,n.x,n.y,r)},moveLocal(t,e,s=0,i){d(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=io(e),s=io(s)),i?t.animate({x:e,y:s},i):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,i,r,n){no.zoomOfLocal(t,uo(t,e),s,i,r,n)},zoomOfLocal(t,e,s,i=s,r,n){const a=t.__localMatrix;if(o(i)||(i&&(n=i),i=s),Gn(so,a),Jn(so,e,s,i),no.hasHighPosition(t))no.setTransform(t,so,r,n);else{const e=t.x+so.e-a.e,o=t.y+so.f-a.f;n&&!r?t.animate({x:e,y:o,scaleX:t.scaleX*s,scaleY:t.scaleY*i},n):(t.x=e,t.y=o,t.scaleResize(s,i,!0!==r))}},rotateOfWorld(t,e,s,i){no.rotateOfLocal(t,uo(t,e),s,i)},rotateOfLocal(t,e,s,i){const r=t.__localMatrix;Gn(so,r),$n(so,e,s),no.hasHighPosition(t)?no.setTransform(t,so,!1,i):t.set({x:t.x+so.e-r.e,y:t.y+so.f-r.f,rotation:D.formatRotation(t.rotation+s)},i)},skewOfWorld(t,e,s,i,r,n){no.skewOfLocal(t,uo(t,e),s,i,r,n)},skewOfLocal(t,e,s,i=0,r,n){Gn(so,t.__localMatrix),Zn(so,e,s,i),no.setTransform(t,so,r,n)},transformWorld(t,e,s,i){Gn(so,t.worldTransform),Kn(so,e),t.parent&&to(so,t.parent.scrollWorldTransform),no.setTransform(t,so,s,i)},transform(t,e,s,i){Gn(so,t.localTransform),Kn(so,e),no.setTransform(t,so,s,i)},setTransform(t,e,s,i){const r=t.__,n=r.origin&&no.getInnerOrigin(t,r.origin),o=eo(e,n,r.around&&no.getInnerOrigin(t,r.around));if(no.hasOffset(t)&&(o.x-=r.offsetX,o.y-=r.offsetY),s){const e=o.scaleX/t.scaleX,s=o.scaleY/t.scaleY;if(delete o.scaleX,delete o.scaleY,n){Ut.scale(t.boxBounds,Math.abs(e),Math.abs(s));const i=no.getInnerOrigin(t,r.origin);lt.move(o,n.x-i.x,n.y-i.y)}t.set(o),t.scaleResize(e,s,!1)}else t.set(o,i)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return Jn(s,no.getLocalOrigin(t,"center"),-1*i,1*i),s},getLocalOrigin:(t,e)=>lt.tempToOuterOf(no.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return kt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(Gn(so,t.worldTransform),to(so,e.scrollWorldTransform),s?so:Object.assign({},so)),drop(t,e,s,i){t.setTransform(no.getRelativeWorld(t,e,!0),i),e.add(t,s)},hasHighPosition:t=>t.origin||t.around||no.hasOffset(t),hasOffset:t=>t.offsetX||t.offsetY,hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},animateMove(t,e,s=.3){if(e.x||e.y)if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const i=e.x*s,r=e.y*s;e.x-=i,e.y-=r,t.move(i,r),m.requestRender(()=>no.animateMove(t,e,s))}}},no=ro,{updateAllMatrix:oo,updateMatrix:ao,updateAllWorldOpacity:ho,updateAllChange:lo,updateChange:co}=no;function uo(t,e){return t.updateLayout(),t.parent?lt.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const _o={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localRenderBounds,maskLocalBoxBounds:(t,e)=>go(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>go(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds:(t,e)=>go(t,e)&&t.__layout.localRenderBounds,excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};let po;function go(t,e){return e||(po=0),t.__.mask&&(po=1),po<0?null:(po&&(po=-1),!0)}const{updateBounds:fo}=ro,yo={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:s}=t;for(let i=0,r=s.length;i<r;i++)(t=s[i]).isBranch&&(t.__tempNumber=1,e.add(t),mo(t,e))}},pushAllParent(t,e){const{keys:i}=e;if(i)for(;t.parent&&s(i[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let s=e.length;const{children:i}=t;for(let t=0,s=i.length;t<s;t++)i[t].isBranch&&e.push(i[t]);for(let t=s,i=e.length;t<i;t++)xo(e[t],e)},updateBounds(t,e){const s=[t];xo(t,s),wo(s,e)},updateBoundsByBranchStack(t,e){let s,i;for(let r=t.length-1;r>-1;r--){s=t[r],i=s.children;for(let t=0,e=i.length;t<e;t++)fo(i[t]);e&&e===s||fo(s)}}},{pushAllChildBranch:mo,pushAllBranchStack:xo,updateBoundsByBranchStack:wo}=yo,vo={run(t){if(t&&t.length){const e=t.length;for(let s=0;s<e;s++)t[s]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:bo,updateBounds:ko}=ro,{toOuterOf:So,getPoints:Bo,copy:Ro}=Ut,Co="_localContentBounds",To="_worldContentBounds",Po="_worldBoxBounds",Oo="_worldStrokeBounds";class Eo{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return So(this.contentBounds,this.leaf.__localMatrix,this[Co]||(this[Co]={})),this[Co]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return So(this.contentBounds,this.leaf.__world,this[To]||(this[To]={})),this[To]}get worldBoxBounds(){return So(this.boxBounds,this.leaf.__world,this[Po]||(this[Po]={})),this[Po]}get worldStrokeBounds(){return So(this.strokeBounds,this.leaf.__world,this[Oo]||(this[Oo]={})),this[Oo]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:e}=t;if(t.isApp)return ko(t);if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=t;for(;e.parent&&!e.parent.leafer;)e=e.parent;const s=e;if(s.__fullLayouting)return;s.__fullLayouting=!0,m.layout(s),delete s.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return Z.defaultMatrix;case"page":t=e.zoomLayer;default:return bo(e,t)}}getBounds(t,e="world"){switch(this.update(),e){case"world":return this.getWorldBounds(t);case"local":return this.getLocalBounds(t);case"inner":return this.getInnerBounds(t);case"page":e=this.leaf.zoomLayer;default:return new Gt(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",s){const{leaf:i}=this;let r,n,o,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),n=i.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=i.__;o={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},r=i.getLocalPointByInner(a);break;case"inner":r=a,n=Z.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),n=bo(i,e,!0)}if(o||(o=Z.getLayout(n)),Ro(o,a),lt.copy(o,r),s){const{scaleX:t,scaleY:e}=o,s=Math.abs(t),i=Math.abs(e);1===s&&1===i||(o.scaleX/=s,o.scaleY/=i,o.width*=s,o.height*=i)}return o}getLayoutPoints(t,e="world"){const{leaf:i}=this,r=Bo(this.getInnerBounds(t));let n;switch(e){case"world":n=null;break;case"local":n=i.parent;break;case"inner":break;case"page":e=i.zoomLayer;default:n=e}return s(n)||r.forEach(t=>i.innerToWorld(t,null,!1,n)),r}shrinkContent(){const{x:t,y:e,width:s,height:i}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:i}}spreadStroke(){const{x:t,y:e,width:s,height:i}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:i},this._localStrokeBounds={x:t,y:e,width:s,height:i},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:i}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:i},this._localRenderBounds={x:t,y:e,width:s,height:i}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0,this.surfaceChanged||this.surfaceChange()}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class Lo{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&m.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&m.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&m.event.stop(this.origin)}}class Ao extends Lo{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}Ao.ADD="child.add",Ao.REMOVE="child.remove",Ao.CREATED="created",Ao.MOUNTED="mounted",Ao.UNMOUNTED="unmounted",Ao.DESTROY="destroy";const Io="property.scroll";class Wo extends Lo{constructor(t,e,s,i,r){super(t,e),this.attrName=s,this.oldValue=i,this.newValue=r}}Wo.CHANGE="property.change",Wo.LEAFER_CHANGE="property.leafer_change",Wo.SCROLL=Io;const Mo={scrollX:Io,scrollY:Io};class Do extends Lo{constructor(t,e){super(t),Object.assign(this,e)}}Do.LOAD="image.load",Do.LOADED="image.loaded",Do.ERROR="image.error";class Fo extends Lo{static checkHas(t,e,s){"on"===s?e===Xo?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(zo)||t.hasEvent(No)||t.hasEvent(Yo),t.__hasWorldEvent=t.hasEvent(Xo))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(zo,t),"inner"===e&&t.emit(No,t)),t.emit(Yo,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Xo,this)}}Fo.RESIZE="bounds.resize",Fo.INNER="bounds.inner",Fo.LOCAL="bounds.local",Fo.WORLD="bounds.world";const{RESIZE:zo,INNER:No,LOCAL:Yo,WORLD:Xo}=Fo,Uo={};[zo,No,Yo,Xo].forEach(t=>Uo[t]=1);class jo extends Lo{get bigger(){if(!this.old)return!0;const{width:t,height:e}=this.old;return this.width>=t&&this.height>=e}get smaller(){return!this.bigger}get samePixelRatio(){return!this.old||this.pixelRatio===this.old.pixelRatio}constructor(t,e){d(t)?(super(jo.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!s(this.resizingKeys[t.innerId])}}jo.RESIZE="resize";class Vo extends Lo{constructor(t,e){super(t),this.data=e}}Vo.REQUEST="watch.request",Vo.DATA="watch.data";class Ho extends Lo{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}Ho.REQUEST="layout.request",Ho.START="layout.start",Ho.BEFORE="layout.before",Ho.LAYOUT="layout",Ho.AFTER="layout.after",Ho.AGAIN="layout.again",Ho.END="layout.end";class Go extends Lo{constructor(t,e,s,i){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=i)}}Go.REQUEST="render.request",Go.CHILD_START="render.child_start",Go.CHILD_END="render.child_end",Go.START="render.start",Go.BEFORE="render.before",Go.RENDER="render",Go.AFTER="render.after",Go.AGAIN="render.again",Go.END="render.end",Go.NEXT="render.next";class qo extends Lo{}qo.START="leafer.start",qo.BEFORE_READY="leafer.before_ready",qo.READY="leafer.ready",qo.AFTER_READY="leafer.after_ready",qo.VIEW_READY="leafer.view_ready",qo.VIEW_COMPLETED="leafer.view_completed",qo.STOP="leafer.stop",qo.RESTART="leafer.restart",qo.END="leafer.end",qo.UPDATE_MODE="leafer.update_mode",qo.TRANSFORM="leafer.transform",qo.MOVE="leafer.move",qo.SCALE="leafer.scale",qo.ROTATE="leafer.rotate",qo.SKEW="leafer.skew";const{MOVE:Qo,SCALE:Jo,ROTATE:$o,SKEW:Zo}=qo,Ko={x:Qo,y:Qo,scaleX:Jo,scaleY:Jo,rotation:$o,skewX:Zo,skewY:Zo},ta={};class ea{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(l(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)l(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let i,n,o;s&&("once"===s?n=!0:"boolean"==typeof s?i=s:(i=s.capture,n=s.once));const a=sa(this,i,!0),h=r(t)?t.split(" "):t,d=n?{listener:e,once:n}:{listener:e};h.forEach(t=>{t&&(o=a[t],o?-1===o.findIndex(t=>t.listener===e)&&o.push(d):a[t]=[d],Uo[t]&&Fo.checkHas(this,t,"on"))})}off(t,e,s){if(t){const i=r(t)?t.split(" "):t;if(e){let t,r,n;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const o=sa(this,t);i.forEach(t=>{t&&(r=o[t],r&&(n=r.findIndex(t=>t.listener===e),n>-1&&r.splice(n,1),r.length||delete o[t],Uo[t]&&Fo.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;i.forEach(s=>{t&&delete t[s],e&&delete e[s]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,s,i){return e?this.on(t,s?e=e.bind(s):e,i):l(t)&&t.forEach(t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3])),{type:t,current:this,listener:e,options:i}}off_(t){if(!t)return;const e=l(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):l(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,s,i){if(!e)return l(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));d(s)?e=e.bind(s):i=s,this.on(t,e,{once:!0,capture:i})}emit(t,e,s){!e&&ce.has(t)&&(e=ce.get(t,{type:t,target:this,current:this}));const i=sa(this,s)[t];if(i){let r;for(let n=0,o=i.length;n<o&&!((r=i[n])&&(r.listener(e),r.once&&(this.off(t,r.listener,s),n--,o--),e&&e.isStopNow));n++);}this.syncEventer&&this.syncEventer.emitEvent(e,s)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:i,__captureMap:r}=this,n=i&&i[t],o=r&&r[t];return!!(s(e)?n||o:e?o:n)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function sa(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:ta)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:ta)}}const{on:ia,on_:ra,off:na,off_:oa,once:aa,emit:ha,emitEvent:la,hasEvent:da,destroy:ca}=ea.prototype,ua={on:ia,on_:ra,off:na,off_:oa,once:aa,emit:ha,emitEvent:la,hasEvent:da,destroyEventer:ca},_a=Zt.get("setAttr"),pa={__setAttr(t,e,i){if(this.leaferIsCreated){const r=this.__.__getInput(t);if(!i||n(e)||s(e)||(_a.warn(this.innerName,t,e),e=void 0),d(e)||r!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new Wo(Wo.LEAFER_CHANGE,this,t,r,e));const s=Ko[t];s&&(this.emitEvent(new qo(s,this)),this.emitEvent(new qo(qo.TRANSFORM,this)))}this.emitPropertyEvent(Wo.CHANGE,t,r,e);const s=Mo[t];return s&&this.emitPropertyEvent(s,t,r,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,s,i){const r=new Wo(t,this,e,s,i);this.isLeafer||this.hasEvent(t)&&this.emitEvent(r),this.leafer.emitEvent(r)},__realSetAttr(t,e){const i=this.__;i[t]=e,this.__proxyData&&this.setProxyAttr(t,e),i.normalStyle&&(this.lockNormalStyle||s(i.normalStyle[t])||(i.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:ga,multiplyParent:fa,translateInner:ya,defaultWorld:ma}=Z,{toPoint:xa,tempPoint:wa}=kt,va={__updateWorldMatrix(){const{parent:t,__layout:e,__world:s,__scrollWorld:i,__:r}=this;fa(this.__local||e,t?t.__scrollWorld||t.__world:ma,s,!!e.affectScaleOrRotation,r),i&&ya(Object.assign(i,s),r.scrollX,r.scrollY)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(ga(e,s,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=s.x+s.offsetX,e.f=s.y+s.offsetY,(s.around||s.origin)&&(xa(s.around||s.origin,t.boxBounds,wa),ya(e,-wa.x,-wa.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:ba,updateAllMatrix:ka}=ro,{updateBounds:Sa}=yo,{toOuterOf:Ba,copyAndSpread:Ra,copy:Ca}=Ut,{toBounds:Ta}=Er,Pa={__updateWorldBounds(){const{__layout:t,__world:e}=this;Ba(t.renderBounds,e,e),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&Fo.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&Fo.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel(),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),Ba(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Ba(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Ba(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const s=this.__layout.boxBounds,i=this.__;i.__usePathBox?Ta(i.path,s):(s.x=0,s.y=0,s.width=i.width,s.height=i.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),ka(this),Sa(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(ka(this),Sa(this,this))):ba(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;Ra(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:s}=e;o(s)&&s<=0?Ca(e.renderBounds,e.strokeBounds):Ra(e.renderBounds,e.boxBounds,s)}},Oa={__render(t,e){if(e.shape)return this.__renderShape(t,e);if(this.__worldOpacity){const s=this.__;if(s.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.dimOpacity&&!s.dimskip?s.opacity*e.dimOpacity:s.opacity,this.__.__single){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!0,!0);this.__draw(i,e,t),ro.copyCanvasByWorld(this,t,i,this.__nowWorld,s.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);Zt.showBounds&&Zt.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Ea}=_o,La={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__nowWorld=this.__getNowWorld(e),this.__worldOpacity){const s=this.__;if(s.__useDim)if(s.dim)e.dimOpacity=!0===s.dim?.2:s.dim;else{if(s.bright&&!e.topRendering)return e.topList.add(this);s.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!1,!0);this.__renderBranch(i,e);const r=this.__nowWorld;t.opacity=e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(i,r,r,s.__blendMode,!0),i.recycle(r)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Ea(s[i],e)||s[i].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Ea(s[i],e)||s[i].__clip(t,e)}}},Aa={},{LEAF:Ia,create:Wa}=w,{stintSet:Ma}=_,{toInnerPoint:Da,toOuterPoint:Fa,multiplyParent:za}=Z,{toOuterOf:Na}=Ut,{copy:Ya,move:Xa}=lt,{moveLocal:Ua,zoomOfLocal:ja,rotateOfLocal:Va,skewOfLocal:Ha,moveWorld:Ga,zoomOfWorld:qa,rotateOfWorld:Qa,skewOfWorld:Ja,transform:$a,transformWorld:Za,setTransform:Ka,getFlipTransform:th,getLocalOrigin:eh,getRelativeWorld:sh,drop:ih}=ro;let rh=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return g}get __LayoutProcessor(){return Eo}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get scrollWorldTransform(){return this.updateLayout(),this.__scrollWorld||this.__world}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.updateLayout(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=Wa(Ia),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(Ao.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(Ao.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(Ao.MOUNTED,t,"once")}nextRender(t,e,s){this.leafer?this.leafer.nextRender(t,e,s):this.waitLeafer(()=>this.leafer.nextRender(t,e,s))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(Ao.MOUNTED)):this.__emitLifeEvent(Ao.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,i=e.length;s<i;s++)e[s].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){s(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=s(e)?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(t,e){}__updateContentBounds(){}__updateStrokeBounds(t){}__updateRenderBounds(t){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:s}=this.__layout;t.clearRect(s.x,s.y,s.width,s.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity)}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,s=this.__world;return za(s,t.matrix,e,void 0,s),Na(this.__layout.renderBounds,e,e),Ma(e,"half",s.half),Ma(e,"ignorePixelSnap",s.ignorePixelSnap),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e){let{scaleX:s,scaleY:i}=$r.patternLocked?this.__world:this.__nowWorld;return t&&(s<0&&(s=-s),i<0&&(i=-i)),(!0===e||"zoom-in"===e&&s>1&&i>1)&&(s=i=1),Aa.scaleX=s,Aa.scaleY=i,Aa}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,s){return this.__layout.getLayoutBounds(t,e,s)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,s){const i=e?sh(this,e):this.worldTransform,r=s?t:{};return Na(t,i,r),r}worldToLocal(t,e,s,i){this.parent?this.parent.worldToInner(t,e,s,i):e&&Ya(e,t)}localToWorld(t,e,s,i){this.parent?this.parent.innerToWorld(t,e,s,i):e&&Ya(e,t)}worldToInner(t,e,s,i){i&&(i.innerToWorld(t,e,s),t=e||t),Da(this.scrollWorldTransform,t,e,s)}innerToWorld(t,e,s,i){Fa(this.scrollWorldTransform,t,e,s),i&&i.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,i){return this.getBoxPointByInner(this.getInnerPoint(t,e,s,i),null,null,!0)}getBoxPointByInner(t,e,s,i){const r=i?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return Xa(r,-n,-o),r}getInnerPoint(t,e,s,i){const r=i?t:{};return this.worldToInner(t,r,s,e),r}getInnerPointByBox(t,e,s,i){const r=i?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return Xa(r,n,o),r}getInnerPointByLocal(t,e,s,i){return this.getInnerPoint(t,this.parent,s,i)}getLocalPoint(t,e,s,i){const r=i?t:{};return this.worldToLocal(t,r,s,e),r}getLocalPointByInner(t,e,s,i){return this.getWorldPoint(t,this.parent,s,i)}getPagePoint(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,i)}getWorldPoint(t,e,s,i){const r=i?t:{};return this.innerToWorld(t,r,s,e),r}getWorldPointByBox(t,e,s,i){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,i),e,s,!0)}getWorldPointByLocal(t,e,s,i){const r=i?t:{};return this.localToWorld(t,r,s,e),r}getWorldPointByPage(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,i)}setTransform(t,e,s){Ka(this,t,e,s)}transform(t,e,s){$a(this,t,e,s)}move(t,e,s){Ua(this,t,e,s)}moveInner(t,e,s){Ga(this,t,e,!0,s)}scaleOf(t,e,s,i,r){ja(this,eh(this,t),e,s,i,r)}rotateOf(t,e,s){Va(this,eh(this,t),e,s)}skewOf(t,e,s,i,r){Ha(this,eh(this,t),e,s,i,r)}transformWorld(t,e,s){Za(this,t,e,s)}moveWorld(t,e,s){Ga(this,t,e,!1,s)}scaleOfWorld(t,e,s,i,r){qa(this,t,e,s,i,r)}rotateOfWorld(t,e){Qa(this,t,e)}skewOfWorld(t,e,s,i,r){Ja(this,t,e,s,i,r)}flip(t,e){$a(this,th(this,t),!1,e)}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}hit(t,e){return!0}__hitWorld(t){return!0}__hit(t){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e,s){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}getMotionPathData(){return ne.need("path")}getMotionPoint(t){return ne.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){ih(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,i){}off_(t){}once(t,e,s,i){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,s){s?this.addAttr(t,e,s):Dn(this.prototype,t,e)}static addAttr(t,e,s,i){s||(s=gn),s(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new Ao(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(Ao.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};rh=pe([jn(pa),jn(va),jn(Pa),jn(ua),jn(Oa)],rh);const{setListWithFn:nh}=Ut,{sort:oh}=yo,{localBoxBounds:ah,localStrokeBounds:hh,localRenderBounds:lh,maskLocalBoxBounds:dh,maskLocalStrokeBounds:ch,maskLocalRenderBounds:uh}=_o,_h=new Zt("Branch");let ph=class extends rh{__updateStrokeSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.renderSpread)return 1;return 0}__updateBoxBounds(t,e){nh(e||this.__layout.boxBounds,this.children,this.__hasMask?dh:ah)}__updateStrokeBounds(t){nh(t||this.__layout.strokeBounds,this.children,this.__hasMask?ch:hh)}__updateRenderBounds(t){nh(t||this.__layout.renderBounds,this.children,this.__hasMask?uh:lh)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,i=e.length;s<i;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(oh),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return _h.warn("add self or destroyed");const i=s(e);if(!t.__){if(l(t))return t.forEach(t=>{this.add(t,e),i||e++});t=he.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,i?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const r=t.__layout;r.boxChanged||r.boxChange(),r.matrixChanged||r.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(Ao.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Ao.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",()=>this.__remove(t,e)):this.__remove(t,e):this.find(t).forEach(t=>this.remove(t,e)):s(t)&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach(e=>{this.__realRemoveChild(e),t&&e.destroy()}))}clear(){this.removeAll(!0)}__remove(t,e){const s=this.children.indexOf(t);s>-1&&(this.children.splice(s,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(Ao.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Ao.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new Ao(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}};ph=pe([jn(La)],ph);class gh{get length(){return this.list.length}constructor(t){this.reset(),t&&(l(t)?this.addList(t):this.add(t))}has(t){return t&&!s(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return s(e)?-1:e}add(t){const{list:e,keys:i}=this;s(i[t.innerId])&&(e.push(t),i[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:i}=this;if(s(i[t.innerId])){const{list:s}=this;for(let t=e,r=s.length;t<r;t++)i[s[t].innerId]++;0===e?s.unshift(t):(e>s.length&&(e=s.length),s.splice(e,0,t)),i[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let i;for(let r=0,n=e.length;r<n;r++)s(i)?e[r].innerId===t.innerId&&(i=r,delete this.keys[t.innerId]):this.keys[e[r].innerId]=r-1;s(i)||e.splice(i,1)}sort(t){const{list:e}=this;t?e.sort((t,e)=>e.__level-t.__level):e.sort((t,e)=>t.__level-e.__level)}forEach(t){this.list.forEach(t)}clone(){const t=new gh;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};const{list:t,keys:e}=this;for(let s=0,i=t.length;s<i;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class fh{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(l(t)?this.addList(t):this.add(t))}has(t){return!s(this.keys[t.innerId])}without(t){return s(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:s}=this;e[t.innerId]||(e[t.innerId]=1,s[t.__level]?s[t.__level].push(t):(s[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(s=>{e=this.levelMap[s];for(let s=0,i=e.length;s<i;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const yh="1.10.0";class mh extends Pe{get allowBackgroundColor(){return!1}init(){const{config:t}=this;let e=t.view||t.canvas;e?(r(e)?("#"!==e[0]&&(e="#"+e),this.viewSelect=m.miniapp.select(e)):e.fields?this.viewSelect=e:this.initView(e),this.viewSelect&&m.miniapp.getSizeView(this.viewSelect).then(t=>{this.initView(t)})):this.initView()}initView(t){t?this.view=t.view||t:(t={},this.__createView()),this.view.getContext?this.__createContext():this.unrealCanvas();const{width:e,height:s,pixelRatio:i}=this.config,r={width:e||t.width,height:s||t.height,pixelRatio:i};this.resize(r),this.context&&(this.viewSelect&&(m.renderCanvas=this),this.context.roundRect&&(this.roundRect=function(t,e,s,i,r){this.context.roundRect(t,e,s,i,o(r)?[r]:r)}),Xr(this.context.__proto__))}__createView(){this.view=m.origin.createCanvas(1,1)}updateViewSize(){if(this.unreal)return;const{width:t,height:e,pixelRatio:s}=this;this.view.width=Math.ceil(t*s),this.view.height=Math.ceil(e*s)}updateClientBounds(t){this.viewSelect&&m.miniapp.getBounds(this.viewSelect).then(e=>{this.clientBounds=e,t&&t()})}startAutoLayout(t,e){this.resizeListener||(this.resizeListener=e,t&&(this.checkSize=this.checkSize.bind(this),m.miniapp.onWindowResize(this.checkSize)))}checkSize(){this.viewSelect&&setTimeout(()=>{this.updateClientBounds(()=>{const{width:t,height:e}=this.clientBounds,{pixelRatio:s}=this,i={width:t,height:e,pixelRatio:s};this.isSameSize(i)||this.emitResize(i)})},500)}stopAutoLayout(){this.autoLayout=!1,this.resizeListener=null,m.miniapp.offWindowResize(this.checkSize)}unrealCanvas(){this.unreal=!0}emitResize(t){const e={};_.copyAttrs(e,this,Te),this.resize(t),s(this.width)||this.resizeListener(new jo(t,e))}}const{mineType:xh,fileType:wh}=Ur;function vh(t,e){m.origin={createCanvas:(t,s,i)=>{const r={type:"2d",width:t,height:s};return e.createOffscreenCanvas?e.createOffscreenCanvas(r):e.createOffScreenCanvas(r)},canvasToDataURL:(t,e,s)=>t.toDataURL(xh(e),s),canvasToBolb:(t,e,s)=>t.toBuffer(e,{quality:s}),canvasSaveAs:(t,e,s)=>{let i=t.toDataURL(xh(wh(e)),s);return i=i.substring(i.indexOf("64,")+3),m.origin.download(i,e)},download:(t,s)=>new Promise((i,r)=>{let n;s.includes("/")||(s=`${e.env.USER_DATA_PATH}/`+s,n=!0);const o=e.getFileSystemManager();o.writeFile({filePath:s,data:t,encoding:"base64",success(){n?m.miniapp.saveToAlbum(s).then(()=>{o.unlink({filePath:s}),i()}):i()},fail(t){r(t)}})}),loadImage:t=>new Promise((e,s)=>{const i=m.canvas.view.createImage();i.onload=()=>{e(i)},i.onerror=t=>{s(t)},i.src=m.image.getRealURL(t)}),noRepeat:"repeat-x"},m.miniapp={select:t=>e.createSelectorQuery().select(t),getBounds:t=>new Promise(e=>{t.boundingClientRect().exec(t=>{const s=t[1];e({x:s.top,y:s.left,width:s.width,height:s.height})})}),getSizeView:t=>new Promise(e=>{t.fields({node:!0,size:!0}).exec(t=>{const s=t[0];e({view:s.node,width:s.width,height:s.height})})}),saveToAlbum:t=>new Promise(s=>{e.getSetting({success:i=>{i.authSetting["scope.writePhotosAlbum"]?e.saveImageToPhotosAlbum({filePath:t,success(){s(!0)}}):e.authorize({scope:"scope.writePhotosAlbum",success:()=>{e.saveImageToPhotosAlbum({filePath:t,success(){s(!0)}})},fail:()=>{}})}})}),onWindowResize(t){e.onWindowResize(t)},offWindowResize(t){e.offWindowResize(t)}},m.event={stopDefault(t){},stopNow(t){},stop(t){}},m.canvas=oe.canvas(),m.conicGradientSupport=!!m.canvas.context.createConicGradient}Object.assign(oe,{canvas:(t,e)=>new mh(t,e),image:t=>new en(t)}),m.name="miniapp",m.requestRender=function(t){const{view:e}=m.renderCanvas||m.canvas;e.requestAnimationFrame?e.requestAnimationFrame(t):setTimeout(t,16)},sn(m,"devicePixelRatio",{get:()=>Math.max(1,wx.getWindowInfo?wx.getWindowInfo().pixelRatio:wx.getSystemInfoSync().pixelRatio)});class bh{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove){const t=new gh;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new gh,this.target=t,e&&(this.config=_.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(Go.REQUEST)}__onAttrChange(t){this.__updatedList.add(t.target),this.update()}__onChildEvent(t){t.type===Ao.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent)),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new Vo(Vo.DATA,{updatedList:this.updatedList})),this.__updatedList=new gh,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[Wo.CHANGE,this.__onAttrChange,this],[[Ao.ADD,Ao.REMOVE],this.__onChildEvent,this],[Vo.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:kh,updateBounds:Sh,updateChange:Bh}=ro,{pushAllChildBranch:Rh,pushAllParent:Ch}=yo;const{worldBounds:Th}=_o;class Ph{constructor(t){this.updatedBounds=new Gt,this.beforeBounds=new Gt,this.afterBounds=new Gt,l(t)&&(t=new gh(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,Th)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,Th),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:Oh,updateAllChange:Eh}=ro,Lh=Zt.get("Layouter");class Ah{constructor(t,e){this.totalTimes=0,this.config={},this.__levelList=new fh,this.target=t,e&&(this.config=_.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(Ho.START),this.layoutOnce(),t.emitEvent(new Ho(Ho.END,this.layoutedBlocks,this.times))}catch(t){Lh.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?Lh.warn("layouting"):this.times>3?Lh.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(Vo.REQUEST),this.totalTimes>1?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=se.start("PartLayout"),{target:s,__updatedList:i}=this,{BEFORE:r,LAYOUT:n,AFTER:o}=Ho,a=this.getBlocks(i);a.forEach(t=>t.setBefore()),s.emitEvent(new Ho(r,a,this.times)),this.extraBlock=null,i.sort(),function(t,e){let s;t.list.forEach(t=>{s=t.__layout,e.without(t)&&!s.proxyZoom&&(s.matrixChanged?(kh(t,!0),e.add(t),t.isBranch&&Rh(t,e),Ch(t,e)):s.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),Ch(t,e)))})}(i,this.__levelList),function(t){let e,s,i;t.sort(!0),t.levels.forEach(r=>{e=t.levelMap[r];for(let t=0,r=e.length;t<r;t++){if(s=e[t],s.isBranch&&s.__tempNumber){i=s.children;for(let t=0,e=i.length;t<e;t++)i[t].isBranch||Sh(i[t])}Sh(s)}})}(this.__levelList),function(t){t.list.forEach(Bh)}(i),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),s.emitEvent(new Ho(n,a,this.times)),s.emitEvent(new Ho(o,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,se.end(e)}fullLayout(){const t=se.start("FullLayout"),{target:e}=this,{BEFORE:s,LAYOUT:i,AFTER:r}=Ho,n=this.getBlocks(new gh(e));e.emitEvent(new Ho(s,n,this.times)),Ah.fullLayout(e),n.forEach(t=>{t.setAfter()}),e.emitEvent(new Ho(i,n,this.times)),e.emitEvent(new Ho(r,n,this.times)),this.addBlocks(n),se.end(t)}static fullLayout(t){Oh(t,!0),t.isBranch?yo.updateBounds(t):ro.updateBounds(t),Eh(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:s}=this.extraBlock||(this.extraBlock=new Ph([]));e.length?s.add(t.__world):s.set(t.__world),e.add(t)}}createBlock(t){return new Ph(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[Ho.REQUEST,this.layout,this],[Ho.AGAIN,this.layoutAgain,this],[Vo.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const Ih=Zt.get("Renderer");class Wh{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,s){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,maxFPS:120},this.frames=[],this.target=t,this.canvas=e,s&&(this.config=_.default(s,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.__requestRender()}requestLayout(){this.target.emit(Ho.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(Go.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(Go.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(Go.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Gt,Ih.log(e.innerName,"---\x3e");try{this.emitRender(Go.START),this.renderOnce(t),this.emitRender(Go.END,this.totalBounds),$r.clearRecycled()}catch(t){this.rendering=!1,Ih.error(t)}Ih.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return Ih.warn("rendering");if(this.times>3)return Ih.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Gt,this.renderOptions={},t)this.emitRender(Go.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(Go.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(Go.RENDER,this.renderBounds,this.renderOptions),this.emitRender(Go.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach(e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(t){const e=se.start("PartRender"),{canvas:s}=this,i=t.getIntersect(s.bounds),r=new Gt(i);s.save(),i.spread(Wh.clipSpread).ceil(),s.clearWorld(i),s.clipWorld(i),this.__render(i,r),s.restore(),se.end(e)}fullRender(){const t=se.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),se.end(t)}__render(t,e){const{canvas:s}=this,i=t.includes(this.target.__world),r=i?{includes:i}:{bounds:t,includes:i};this.needFill&&s.fillWorld(t,this.config.fill),Zt.showRepaint&&Zt.drawRepaint(s,t),m.render(this.target,s,r),this.renderBounds=e=e||t,this.renderOptions=r,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),s.updateRender(e)}addBlock(t){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Gt;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);this.requestTime=this.frameTime||Date.now();const e=()=>{const t=1e3/((this.frameTime=Date.now())-this.requestTime),{maxFPS:s}=this.config;if(s&&t>s)return m.requestRender(e);const{frames:i}=this;i.length>30&&i.shift(),i.push(t),this.FPS=Math.round(i.reduce((t,e)=>t+e,0)/i.length),this.requestTime=0,this.checkRender()};m.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:s}=t.old;if(!new Gt(0,0,e,s).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Gt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;t.updatedList&&t.updatedList.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||Ih.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds)})}emitRender(t,e,s){this.target.emitEvent(new Go(t,this.times,e,s))}__listenEvents(){this.__eventIds=[this.target.on_([[Go.REQUEST,this.update,this],[Ho.END,this.__onLayoutEnd,this],[Go.AGAIN,this.renderAgain,this],[jo.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}}function Mh(t){return on(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Dh(t){return on(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function Fh(){return(t,e)=>{const s="_"+e;sn(t,e,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}function zh(t){return(e,s)=>{sn(e,s,nn(s,t))}}Wh.clipSpread=10,Object.assign(oe,{watcher:(t,e)=>new bh(t,e),layouter:(t,e)=>new Ah(t,e),renderer:(t,e,s)=>new Wh(t,e,s),selector:(t,e)=>{},interaction:(t,e,s,i)=>{}}),m.layout=Ah.fullLayout,m.render=function(t,e,s){const i=Object.assign(Object.assign({},s),{topRendering:!0});s.topList=new gh,t.__render(e,s),s.topList.length&&s.topList.forEach(t=>t.__render(e,i))};const Nh={},Yh={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},Xh={number:(t,e)=>d(t)?"percent"===t.type?t.value*e:t.value:t},Uh={},jh={},Vh={},Hh={},Gh={},qh={apply(){ne.need("filter")}},Qh={},Jh={setStyleName:()=>ne.need("state"),set:()=>ne.need("state")},$h={list:{},register(t,e){$h.list[t]=e},get:t=>$h.list[t]},{parse:Zh,objectToCanvasData:Kh}=Zs,{stintSet:tl}=_,{hasTransparent:el}=Yh,sl={},il=Zt.get("UIData");class rl extends g{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,il.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,il.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),r(t)||!t?(tl(this,"__isTransparentFill",el(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):d(t)&&this.__setPaint("fill",t)}setStroke(t){r(t)||!t?(tl(this,"__isTransparentStroke",el(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):d(t)&&this.__setPaint("stroke",t)}setPath(t){const e=r(t);e||t&&d(t[0])?(this.__setInput("path",t),this._path=e?Zh(t):Kh(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){nl(this,"shadow",t)}setInnerShadow(t){nl(this,"innerShadow",t)}setFilter(t){nl(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&jh.compute("fill",this.__leaf),e&&jh.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),s(t.strokeWidthFixed)||(i=t.strokeWidthFixed)),i){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const s=this.__leaf.__layout;s.boxChanged||s.boxChange(),l(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=sl)):(this.__isStrokes=!0,this._stroke||(this._stroke=sl))}__removePaint(t,e){e&&this.__removeInput(t),Vh.recycleImage(t,this),"fill"===t?(tl(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(tl(this,"__isAlphaPixelStroke",void 0),tl(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function nl(t,e,s){t.__setInput(e,s),l(s)?(s.some(t=>!1===t.visible)&&(s=s.filter(t=>!1!==t.visible)),s.length||(s=void 0)):s=s&&!1!==s.visible?[s]:void 0,t["_"+e]=s}class ol extends rl{}class al extends ol{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class hl extends ol{__getInputData(t,e){const s=super.__getInputData(t,e);return Te.forEach(t=>delete s[t]),s}}class ll extends al{}class dl extends rl{get __usePathBox(){return this.points||this.__pathInputed}}class cl extends rl{get __boxStroke(){return!this.__pathInputed}}class ul extends rl{get __boxStroke(){return!this.__pathInputed}}class _l extends dl{}class pl extends rl{}class gl extends rl{get __pathInputed(){return 2}}class fl extends ol{}const yl={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class ml extends rl{get __useNaturalRatio(){return!1}setFontWeight(t){r(t)?(this.__setInput("fontWeight",t),t=yl[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,s=e.__box;if(t){const{boxStyle:i}=this;if(s)for(let t in i)s[t]=void 0;else s=e.__box=he.get("Rect",0);const r=e.__layout,n=s.__layout;i||(s.parent=e,s.__world=e.__world,n.boxBounds=r.boxBounds),s.set(t),n.strokeChanged&&r.strokeChange()}else s&&(e.__box=s.parent=null,s.destroy());this._boxStyle=t}}class xl extends cl{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:"image",mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return t.url&&delete t.fill,t}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url&&delete s.fill,s}}class wl extends cl{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url=this.__leaf.canvas.toDataURL("image/png"),s}}const{max:vl,add:bl}=C,kl={__updateStrokeSpread(){let t=0,e=0;const s=this.__,{strokeAlign:i,__maxStrokeWidth:r}=s,n=this.__box;if((s.stroke||"all"===s.hitStroke)&&r&&"inside"!==i&&(e=t="center"===i?r/2:r,!s.__boxStroke)){const e=s.__isLinePath?0:10*t,i="none"===s.strokeCap?0:r;t+=Math.max(e,i)}return s.__useArrow&&(t+=5*r),n&&(t=vl(t,n.__layout.strokeSpread=n.__updateStrokeSpread()),e=Math.max(e,n.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:i,backgroundBlur:r,filter:n,renderSpread:o}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=Gh.getShadowRenderSpread(this,e)),i&&(t=vl(t,i)),n&&(t=bl(t,qh.getSpread(n))),o&&(t=bl(t,o)),a&&(t=bl(t,a));let l=t;return s&&(l=vl(l,Gh.getInnerShadowSpread(this,s))),r&&(l=vl(l,r)),this.__layout.renderShapeSpread=l,h?vl(h.__updateRenderSpread(),t):t}},{stintSet:Sl}=_,Bl={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Sl(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Sl(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:s,stroke:i}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;Sl(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!Gh.isTransformShadow(e[0])&&s&&!t.__isTransparentFill&&!(l(s)&&s.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),Sl(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){Rl(this,t,e)},__draw(t,e,s){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:n,__drawAfterFill:o,__fillAfterStroke:a,__isFastShadow:h}=i;if(this.__drawRenderPath(t),i.__useEffect&&!h){const h=jh.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=i;l&&Gh.shadow(this,t,h),a&&(i.__isStrokes?jh.strokes(n,this,t,e):jh.stroke(n,this,t,e)),r&&(i.__isFills?jh.fills(r,this,t,e):jh.fill(r,this,t,e)),o&&this.__drawAfterFill(t,e),d&&Gh.innerShadow(this,t,h),n&&!a&&(i.__isStrokes?jh.strokes(n,this,t,e):jh.stroke(n,this,t,e)),c&&qh.apply(c,this,this.__nowWorld,t,s,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(i.__isStrokes?jh.strokes(n,this,t,e):jh.stroke(n,this,t,e)),h){const e=i.shadow[0],{scaleX:s,scaleY:r}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*s,e.y*r,e.blur*s,Yh.string(e.color))}r&&(i.__isFills?jh.fills(r,this,t,e):jh.fill(r,this,t,e)),h&&t.restore(),o&&this.__drawAfterFill(t,e),n&&!a&&(i.__isStrokes?jh.strokes(n,this,t,e):jh.stroke(n,this,t,e))}}else i.__pathInputed?Rl(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const s=this.__,{fill:i,stroke:r}=s;i&&!e.ignoreFill&&(s.__isAlphaPixelFill?jh.fills(i,this,t,e):jh.fill("#000000",this,t,e)),s.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(s.__isAlphaPixelStroke?jh.strokes(r,this,t,e):jh.stroke("#000000",this,t,e))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function Rl(t,e,s){const{fill:i,stroke:r,__drawAfterFill:n,__fillAfterStroke:o}=t.__;t.__drawRenderPath(e),o&&jh.stroke(r,t,e,s),i&&jh.fill(i,t,e,s),n&&t.__drawAfterFill(e,s),r&&!o&&jh.stroke(r,t,e,s)}const Cl={__drawFast(t,e){let{x:s,y:i,width:r,height:n}=this.__layout.boxBounds;const{fill:o,stroke:a,__drawAfterFill:h}=this.__;if(o&&(t.fillStyle=o,t.fillRect(s,i,r,n)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:o,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(o){case"center":t.strokeRect(0,0,r,n);break;case"inside":r-=h,n-=h,r<0||n<0?(t.save(),this.__clip(t,e),t.strokeRect(s+l,i+l,r,n),t.restore()):t.strokeRect(s+l,i+l,r,n);break;case"outside":t.strokeRect(s-l,i-l,r+h,n+h)}}}};var Tl;let Pl=Tl=class extends rh{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){D.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return Nr.set(this.path=t||[]),t||this.__drawPathByBox(Nr),Nr}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return r(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return ne.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return ne.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let s=e?this.__.__pathForRender:this.__.path;return s||(Nr.set(s=[]),this.__drawPathByBox(Nr)),t?Zs.toCanvasData(s,!0):s}getPathString(t,e,s){return Zs.stringify(this.getPath(t,e),s)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||Qh.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?Fr.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&Uh.addArrows(this)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?Ki.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:s,width:i,height:r}=this.__layout.boxBounds;if(this.__.cornerRadius){const{cornerRadius:n}=this.__;t.roundRect(e,s,i,r,o(n)?[n]:n)}else t.rect(e,s,i,r)}drawImagePlaceholder(t,e,s){jh.fill(this.__.placeholderColor,this,e,s)}animate(t,e,s,i){return this.set(t),ne.need("animate")}killAnimate(t,e){}export(t,e){return ne.need("export")}syncExport(t,e){return ne.need("export")}clone(t){const e=_.clone(this.toJSON());return t&&Object.assign(e,t),Tl.one(e)}static one(t,e,s,i,r){return he.get(t.tag||this.prototype.__tag,t,e,s,i,r)}static registerUI(){Vn()(this)}static registerData(t){Wn(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};pe([Wn(rl)],Pl.prototype,"__",void 0),pe([Fh()],Pl.prototype,"zoomLayer",void 0),pe([ln("")],Pl.prototype,"id",void 0),pe([ln("")],Pl.prototype,"name",void 0),pe([ln("")],Pl.prototype,"className",void 0),pe([Sn("pass-through")],Pl.prototype,"blendMode",void 0),pe([Rn(1)],Pl.prototype,"opacity",void 0),pe([Cn(!0)],Pl.prototype,"visible",void 0),pe([Sn(!1)],Pl.prototype,"locked",void 0),pe([Bn(!1)],Pl.prototype,"dim",void 0),pe([Bn(!1)],Pl.prototype,"dimskip",void 0),pe([On(0)],Pl.prototype,"zIndex",void 0),pe([En(!1)],Pl.prototype,"mask",void 0),pe([Ln(!1)],Pl.prototype,"eraser",void 0),pe([dn(0,!0)],Pl.prototype,"x",void 0),pe([dn(0,!0)],Pl.prototype,"y",void 0),pe([gn(100,!0)],Pl.prototype,"width",void 0),pe([gn(100,!0)],Pl.prototype,"height",void 0),pe([_n(1,!0)],Pl.prototype,"scaleX",void 0),pe([_n(1,!0)],Pl.prototype,"scaleY",void 0),pe([pn(0,!0)],Pl.prototype,"rotation",void 0),pe([pn(0,!0)],Pl.prototype,"skewX",void 0),pe([pn(0,!0)],Pl.prototype,"skewY",void 0),pe([dn(0,!0)],Pl.prototype,"offsetX",void 0),pe([dn(0,!0)],Pl.prototype,"offsetY",void 0),pe([cn(0,!0)],Pl.prototype,"scrollX",void 0),pe([cn(0,!0)],Pl.prototype,"scrollY",void 0),pe([un()],Pl.prototype,"origin",void 0),pe([un()],Pl.prototype,"around",void 0),pe([ln(!1)],Pl.prototype,"lazy",void 0),pe([fn(1)],Pl.prototype,"pixelRatio",void 0),pe([kn(0)],Pl.prototype,"renderSpread",void 0),pe([mn()],Pl.prototype,"path",void 0),pe([xn()],Pl.prototype,"windingRule",void 0),pe([xn(!0)],Pl.prototype,"closed",void 0),pe([gn(0)],Pl.prototype,"padding",void 0),pe([gn(!1)],Pl.prototype,"lockRatio",void 0),pe([gn()],Pl.prototype,"widthRange",void 0),pe([gn()],Pl.prototype,"heightRange",void 0),pe([ln(!1)],Pl.prototype,"draggable",void 0),pe([ln()],Pl.prototype,"dragBounds",void 0),pe([ln("auto")],Pl.prototype,"dragBoundsType",void 0),pe([ln(!1)],Pl.prototype,"editable",void 0),pe([An(!0)],Pl.prototype,"hittable",void 0),pe([An("path")],Pl.prototype,"hitFill",void 0),pe([bn("path")],Pl.prototype,"hitStroke",void 0),pe([An(!1)],Pl.prototype,"hitBox",void 0),pe([An(!0)],Pl.prototype,"hitChildren",void 0),pe([An(!0)],Pl.prototype,"hitSelf",void 0),pe([An()],Pl.prototype,"hitRadius",void 0),pe([In("")],Pl.prototype,"cursor",void 0),pe([Sn()],Pl.prototype,"fill",void 0),pe([bn(void 0,!0)],Pl.prototype,"stroke",void 0),pe([bn("inside")],Pl.prototype,"strokeAlign",void 0),pe([bn(1,!0)],Pl.prototype,"strokeWidth",void 0),pe([bn(!1)],Pl.prototype,"strokeWidthFixed",void 0),pe([bn("none")],Pl.prototype,"strokeCap",void 0),pe([bn("miter")],Pl.prototype,"strokeJoin",void 0),pe([bn()],Pl.prototype,"dashPattern",void 0),pe([bn(0)],Pl.prototype,"dashOffset",void 0),pe([bn(10)],Pl.prototype,"miterLimit",void 0),pe([xn(0)],Pl.prototype,"cornerRadius",void 0),pe([xn()],Pl.prototype,"cornerSmoothing",void 0),pe([Mh()],Pl.prototype,"shadow",void 0),pe([Mh()],Pl.prototype,"innerShadow",void 0),pe([Mh()],Pl.prototype,"blur",void 0),pe([Mh()],Pl.prototype,"backgroundBlur",void 0),pe([Mh()],Pl.prototype,"grayscale",void 0),pe([Mh()],Pl.prototype,"filter",void 0),pe([Sn()],Pl.prototype,"placeholderColor",void 0),pe([ln(100)],Pl.prototype,"placeholderDelay",void 0),pe([ln({})],Pl.prototype,"data",void 0),pe([Yn(rh.prototype.reset)],Pl.prototype,"reset",null),Pl=Tl=pe([jn(kl),jn(Bl),Xn()],Pl);let Ol=class extends Pl{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:s}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),s.forEach(t=>this.add(t)),t.children=s}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);return this.childlessJSON||(e.children=this.children.map(e=>e.toJSON(t))),e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};var El;pe([Wn(ol)],Ol.prototype,"__",void 0),pe([gn(0)],Ol.prototype,"width",void 0),pe([gn(0)],Ol.prototype,"height",void 0),Ol=pe([jn(ph),Vn()],Ol);const Ll=Zt.get("Leafer");let Al=El=class extends Ol{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&Qr.isComplete}get layoutLocked(){return!this.layouter.running}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),El.list.add(this)}init(t,e){if(this.canvas)return;let s;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),s=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,_.assign(i,t));const r=this.canvas=oe.canvas(i);this.__controllers.push(this.renderer=oe.renderer(this,r,i),this.watcher=oe.watcher(this,i),this.layouter=oe.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),this.view=r.view,e||(this.selector=oe.selector(this),this.interaction=oe.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=oe.hitCanvasManager()),this.canvasManager=new _e,s=i.start),this.hittable=i.hittable,this.fill=i.fill,this.canvasManager.add(r),this.__listenEvents(),s&&(this.__startTimer=setTimeout(this.start.bind(this))),vo.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(qo.RESTART):this.emitLeafer(qo.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(qo.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=_.copyAttrs({},t,Te);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:s}=this;s&&(s.addBlock(t?new Gt(t):this.canvas.bounds),this.viewReady&&(e?s.render():s.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const s=_.copyAttrs({},this.canvas,Te);e.resize(t),this.updateLazyBounds(),this.__onResize(new jo(t,s))}__onResize(t){this.emitEvent(t),_.copyAttrs(this.__,t,Te),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new Qt(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Te.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t?(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):"mode"===t&&this.emit(qo.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Te.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:s,canvas:i}=this,r=_.copyAttrs({},i,Te);r[t]=s[t]=e,s.width&&s.height?i.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(r)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(qo.BEFORE_READY),this.emitLeafer(qo.READY),this.emitLeafer(qo.AFTER_READY),vo.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(qo.VIEW_READY),vo.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:s}=this.config;if(t){let{width:i,height:r,pixelRatio:n}=this;const o="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,o.x+o.width)),s||(r=Math.max(1,o.y+o.height)),this.__doResize({width:i,height:r,pixelRatio:n})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){vo.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(qo.VIEW_COMPLETED),vo.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,s){e&&(t=t.bind(e));const i=this.__nextRenderWait;if(s){for(let e=0;e<i.length;e++)if(i[e]===t){i.splice(e,1);break}}else i.push(t);this.requestRender()}zoom(t,e,s,i){return ne.need("view")}getValidMove(t,e,s){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:s}=this.clientBounds;return{x:e+t.x,y:s+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new qo(t,this))}__listenEvents(){const t=se.start("FirstCreate "+this.innerName);this.once([[qo.START,()=>se.end(t)],[Ho.START,this.updateLazyBounds,this],[Go.START,this.__onCreated,this],[Go.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[Vo.DATA,this.__onWatchData,this],[Ho.END,this.__onLayoutEnd,this],[Go.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){El.list.remove(this);try{this.stop(),this.emitLeafer(qo.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{$r.clearRecycled()},100)}catch(t){Ll.error(t)}}};t?e():setTimeout(e)}};Al.list=new gh,pe([Wn(hl)],Al.prototype,"__",void 0),pe([gn()],Al.prototype,"pixelRatio",void 0),pe([ln("normal")],Al.prototype,"mode",void 0),Al=El=pe([Vn()],Al);let Il=class extends Pl{get __tag(){return"Rect"}};pe([Wn(cl)],Il.prototype,"__",void 0),Il=pe([jn(Cl),Xn(),Vn()],Il);const{add:Wl,includes:Ml,scroll:Dl}=Ut,Fl=Il.prototype,zl=Ol.prototype;let Nl=class extends Ol{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.pathInputed){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const s=this.__,i=this.__layout,{renderBounds:r,boxBounds:n}=i,{overflow:o}=s,a=i.childrenRenderBounds||(i.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=o.includes("scroll"))&&(Wl(a,n),Dl(a,s)),this.__updateRectRenderBounds(),t=!Ml(n,a),t&&"show"===o&&Wl(r,a)}else this.__updateRectRenderBounds();_.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};pe([Wn(al)],Nl.prototype,"__",void 0),pe([gn(100)],Nl.prototype,"width",void 0),pe([gn(100)],Nl.prototype,"height",void 0),pe([ln(!1)],Nl.prototype,"resizeChildren",void 0),pe([kn("show")],Nl.prototype,"overflow",void 0),pe([Yn(Fl.__updateStrokeSpread)],Nl.prototype,"__updateStrokeSpread",null),pe([Yn(Fl.__updateRenderSpread)],Nl.prototype,"__updateRectRenderSpread",null),pe([Yn(Fl.__updateBoxBounds)],Nl.prototype,"__updateRectBoxBounds",null),pe([Yn(Fl.__updateStrokeBounds)],Nl.prototype,"__updateStrokeBounds",null),pe([Yn(Fl.__updateRenderBounds)],Nl.prototype,"__updateRectRenderBounds",null),pe([Yn(Fl.__updateChange)],Nl.prototype,"__updateRectChange",null),pe([Yn(Fl.__render)],Nl.prototype,"__renderRect",null),pe([Yn(zl.__render)],Nl.prototype,"__renderGroup",null),Nl=pe([Xn(),Vn()],Nl);let Yl=class extends Nl{get __tag(){return"Frame"}get isFrame(){return!0}};pe([Wn(ll)],Yl.prototype,"__",void 0),pe([Sn("#FFFFFF")],Yl.prototype,"fill",void 0),pe([kn("hide")],Yl.prototype,"overflow",void 0),Yl=pe([Vn()],Yl);const{moveTo:Xl,closePath:Ul,ellipse:jl}=vi;let Vl=class extends Pl{get __tag(){return"Ellipse"}__updatePath(){const{width:t,height:e,innerRadius:s,startAngle:i,endAngle:r}=this.__,n=t/2,o=e/2,a=this.__.path=[];s?(i||r?(s<1&&jl(a,n,o,n*s,o*s,0,i,r,!1),jl(a,n,o,n,o,0,r,i,!0),s<1&&Ul(a)):(s<1&&(jl(a,n,o,n*s,o*s),Xl(a,t,o)),jl(a,n,o,n,o,0,360,0,!0)),m.ellipseToCurve&&(this.__.path=this.getPath(!0))):i||r?(Xl(a,n,o),jl(a,n,o,n,o,0,i,r,!1),Ul(a)):jl(a,n,o,n,o)}};pe([Wn(ul)],Vl.prototype,"__",void 0),pe([xn(0)],Vl.prototype,"innerRadius",void 0),pe([xn(0)],Vl.prototype,"startAngle",void 0),pe([xn(0)],Vl.prototype,"endAngle",void 0),Vl=pe([Vn()],Vl);const{sin:Hl,cos:Gl,PI:ql}=Math,{moveTo:Ql,lineTo:Jl,closePath:$l,drawPoints:Zl}=vi;let Kl=class extends Pl{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)Zl(e,t.points,t.curve,!0);else{const{width:s,height:i,sides:r}=t,n=s/2,o=i/2;Ql(e,n,0);for(let t=1;t<r;t++)Jl(e,n+n*Hl(2*t*ql/r),o-o*Gl(2*t*ql/r));$l(e)}}};pe([Wn(_l)],Kl.prototype,"__",void 0),pe([xn(3)],Kl.prototype,"sides",void 0),pe([xn()],Kl.prototype,"points",void 0),pe([xn(0)],Kl.prototype,"curve",void 0),Kl=pe([Xn(),Vn()],Kl);const{sin:td,cos:ed,PI:sd}=Math,{moveTo:id,lineTo:rd,closePath:nd}=vi;let od=class extends Pl{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:s,innerRadius:i}=this.__,r=t/2,n=e/2,o=this.__.path=[];id(o,r,0);for(let t=1;t<2*s;t++)rd(o,r+(t%2==0?r:r*i)*td(t*sd/s),n-(t%2==0?n:n*i)*ed(t*sd/s));nd(o)}};pe([Wn(pl)],od.prototype,"__",void 0),pe([xn(5)],od.prototype,"corners",void 0),pe([xn(.382)],od.prototype,"innerRadius",void 0),od=pe([Vn()],od);const{moveTo:ad,lineTo:hd,drawPoints:ld}=vi,{rotate:dd,getAngle:cd,getDistance:ud,defaultPoint:_d}=lt;let pd=class extends Pl{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,s={x:0,y:0};return t&&(s.x=t),e&&dd(s,e),s}set toPoint(t){this.width=ud(_d,t),this.rotation=cd(_d,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?ld(e,t.points,t.curve,t.closed):(ad(e,0,0),hd(e,this.width,0))}};pe([Wn(dl)],pd.prototype,"__",void 0),pe([wn("center")],pd.prototype,"strokeAlign",void 0),pe([gn(0)],pd.prototype,"height",void 0),pe([xn()],pd.prototype,"points",void 0),pe([xn(0)],pd.prototype,"curve",void 0),pe([xn(!1)],pd.prototype,"closed",void 0),pd=pe([Vn()],pd);let gd=class extends Il{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return l(t)&&t[0].image}};pe([Wn(xl)],gd.prototype,"__",void 0),pe([gn("")],gd.prototype,"url",void 0),gd=pe([Vn()],gd);const fd=gd;let yd=class extends Il{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=oe.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new en({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new Do(Do.LOADED,{image:t}))})}draw(t,e,s,i){const r=new ft(t.worldTransform).invert(),n=new ft;e&&n.translate(e.x,e.y),s&&(o(s)?n.scale(s):n.scale(s.x,s.y)),i&&n.rotate(i),r.multiplyParent(n),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:s,height:i}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,s,i)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:s}=this.__;t.resize(this.__,s),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};pe([Wn(wl)],yd.prototype,"__",void 0),pe([Dh(100)],yd.prototype,"width",void 0),pe([Dh(100)],yd.prototype,"height",void 0),pe([Dh(1)],yd.prototype,"pixelRatio",void 0),pe([Dh(!0)],yd.prototype,"smooth",void 0),pe([ln(!1)],yd.prototype,"safeResize",void 0),pe([Dh()],yd.prototype,"contextSettings",void 0),yd=pe([Vn()],yd);const{copyAndSpread:md,includes:xd,spread:wd,setList:vd}=Ut,{stintSet:bd}=_;let kd=class extends Pl{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:s,fontFamily:i,fontSize:r,fontWeight:n,italic:o,textCase:a,textOverflow:h,padding:l,width:d,height:c}=t;t.__lineHeight=Xh.number(e,r),t.__letterSpacing=Xh.number(s,r),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${o?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==n?n+" ":""}${r||12}px ${i||"caption"}`,bd(t,"__padding",l&&D.fourNumber(l)),bd(t,"__clipText","show"!==h&&!t.__autoSize),bd(t,"__isCharMode",d||c||t.__letterSpacing||"none"!==a),t.__textDrawData=Nh.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:s,italic:i,padding:r,__autoWidth:n,__autoHeight:o}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<s&&wd(a,s/2),n||o){if(h.x=n?a.x:0,h.y=o?a.y:0,h.width=n?a.width:t.width,h.height=o?a.height:t.height,r){const[e,s,i,r]=t.__padding;n&&(h.x-=r,h.width+=s+r),o&&(h.y-=e,h.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(h.width+=.16*s),_.stintSet(this,"isOverflow",!xd(h,a)),this.isOverflow?(vd(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;md(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__updateChange(){super.__updateChange();const t=this.__box;t&&(t.__onUpdateSize(),t.__updateChange())}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,s){const i=this.__box;i&&(i.__nowWorld=this.__nowWorld,i.__draw(t,e,s)),this.textEditing&&!e.exporting||super.__draw(t,e,s)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};pe([Wn(ml)],kd.prototype,"__",void 0),pe([gn(0)],kd.prototype,"width",void 0),pe([gn(0)],kd.prototype,"height",void 0),pe([Sn()],kd.prototype,"boxStyle",void 0),pe([ln(!1)],kd.prototype,"resizeFontSize",void 0),pe([Sn("#000000")],kd.prototype,"fill",void 0),pe([wn("outside")],kd.prototype,"strokeAlign",void 0),pe([An("all")],kd.prototype,"hitFill",void 0),pe([gn("")],kd.prototype,"text",void 0),pe([gn("")],kd.prototype,"placeholder",void 0),pe([gn("caption")],kd.prototype,"fontFamily",void 0),pe([gn(12)],kd.prototype,"fontSize",void 0),pe([gn("normal")],kd.prototype,"fontWeight",void 0),pe([gn(!1)],kd.prototype,"italic",void 0),pe([gn("none")],kd.prototype,"textCase",void 0),pe([gn("none")],kd.prototype,"textDecoration",void 0),pe([gn(0)],kd.prototype,"letterSpacing",void 0),pe([gn({type:"percent",value:1.5})],kd.prototype,"lineHeight",void 0),pe([gn(0)],kd.prototype,"paraIndent",void 0),pe([gn(0)],kd.prototype,"paraSpacing",void 0),pe([gn("x")],kd.prototype,"writingMode",void 0),pe([gn("left")],kd.prototype,"textAlign",void 0),pe([gn("top")],kd.prototype,"verticalAlign",void 0),pe([gn(!0)],kd.prototype,"autoSizeAlign",void 0),pe([gn("normal")],kd.prototype,"textWrap",void 0),pe([gn("show")],kd.prototype,"textOverflow",void 0),pe([Sn(!1)],kd.prototype,"textEditing",void 0),kd=pe([Vn()],kd);let Sd=class extends Pl{get __tag(){return"Path"}};pe([Wn(gl)],Sd.prototype,"__",void 0),pe([wn("center")],Sd.prototype,"strokeAlign",void 0),Sd=pe([Vn()],Sd);let Bd=class extends Ol{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new Sd(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,s,i,r,n){return this}quadraticCurveTo(t,e,s,i){return this}closePath(){return this}rect(t,e,s,i){return this}roundRect(t,e,s,i,r){return this}ellipse(t,e,s,i,r,n,o,a){return this}arc(t,e,s,i,r,n){return this}arcTo(t,e,s,i,r){return this}drawEllipse(t,e,s,i,r,n,o,a){return this}drawArc(t,e,s,i,r,n){return this}drawPoints(t,e,s){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}};function Rd(t,e,s){t.__.__font?jh.fillText(t,e,s):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function Cd(t,e,s,i,r){const n=s.__;d(t)?jh.drawStrokesStyle(t,e,!1,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),i.stroke()),n.__useArrow&&jh.strokeArrow(t,s,i,r)}function Td(t,e,s,i,r){const n=s.__;d(t)?jh.drawStrokesStyle(t,e,!0,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),jh.drawTextStroke(s,i,r))}function Pd(t,e,s,i,r){const n=i.getSameCanvas(!0,!0);n.font=s.__.__font,Td(t,2,s,n,r),n.blendMode="outside"===e?"destination-out":"destination-in",jh.fillText(s,n,r),n.blendMode="normal",ro.copyCanvasByWorld(s,i,n),n.recycle(s.__nowWorld)}pe([Wn(fl)],Bd.prototype,"__",void 0),pe([(t,e)=>{sn(t,e,{get(){return this.__path}})}],Bd.prototype,"path",void 0),Bd=pe([jn(Fi,["set","path","paint"]),Vn()],Bd);const{getSpread:Od,copyAndSpread:Ed,toOuterOf:Ld,getOuterOf:Ad,getByMove:Id,move:Wd,getIntersectData:Md}=Ut,Dd={};let Fd;const{stintSet:zd}=_,{hasTransparent:Nd}=Yh;function Yd(t,e,i){if(!d(e)||!1===e.visible||0===e.opacity)return;let n;const{boxBounds:o}=i.__layout;switch(e.type){case"image":n=Vh.image(i,t,e,o,!Fd||!Fd[e.url]);break;case"linear":n=Hh.linearGradient(e,o);break;case"radial":n=Hh.radialGradient(e,o);break;case"angular":n=Hh.conicGradient(e,o);break;case"solid":const{type:r,color:a,opacity:h}=e;n={type:r,style:Yh.string(a,h)};break;default:s(e.r)||(n={type:"solid",style:Yh.string(e)})}if(n){if(r(n.style)&&Nd(n.style)&&(n.isTransparent=!0),e.style){if(0===e.style.strokeWidth)return;n.strokeStyle=e.style}e.editing&&(n.editing=e.editing),e.blendMode&&(n.blendMode=e.blendMode)}return n}const Xd={compute:function(t,e){const s=e.__,i=[];let r,n,o,a=s.__input[t];l(a)||(a=[a]),Fd=Vh.recycleImage(t,s);for(let s,r=0,n=a.length;r<n;r++)(s=Yd(t,a[r],e))&&(i.push(s),s.strokeStyle&&(o||(o=1),s.strokeStyle.strokeWidth&&(o=Math.max(o,s.strokeStyle.strokeWidth))));s["_"+t]=i.length?i:void 0,i.length&&i.every(t=>t.isTransparent)&&(i.some(t=>t.image)&&(r=!0),n=!0),"fill"===t?(zd(s,"__isAlphaPixelFill",r),zd(s,"__isTransparentFill",n)):(zd(s,"__isAlphaPixelStroke",r),zd(s,"__isTransparentStroke",n),zd(s,"__hasMultiStrokeStyle",o))},fill:function(t,e,s,i){s.fillStyle=t,Rd(e,s,i)},fills:function(t,e,s,i){let r;for(let n=0,o=t.length;n<o;n++){if(r=t[n],r.image){if(Vh.checkImage(r,!e.__.__font,e,s,i))continue;if(!r.style){!n&&r.image.isPlacehold&&e.drawImagePlaceholder(r.image,s,i);continue}}if(s.fillStyle=r.style,r.transform||r.scaleFixed){if(s.save(),r.transform&&s.transform(r.transform),r.scaleFixed){const{scaleX:t,scaleY:i}=e.getRenderScaleData(!0);(!0===r.scaleFixed||"zoom-in"===r.scaleFixed&&t>1&&i>1)&&s.scale(1/t,1/i)}r.blendMode&&(s.blendMode=r.blendMode),Rd(e,s,i),s.restore()}else r.blendMode?(s.saveBlendMode(r.blendMode),Rd(e,s,i),s.restoreBlendMode()):Rd(e,s,i)}},fillPathOrText:Rd,fillText:function(t,e,s){const i=t.__,{rows:r,decorationY:n}=i.__textDrawData;let o;i.__isPlacehold&&i.placeholderColor&&(e.fillStyle=i.placeholderColor);for(let t=0,s=r.length;t<s;t++)o=r[t],o.text?e.fillText(o.text,o.x,o.y):o.data&&o.data.forEach(t=>{e.fillText(t.char,t.x,o.y)});if(n){const{decorationColor:t,decorationHeight:s}=i.__textDrawData;t&&(e.fillStyle=t),r.forEach(t=>n.forEach(i=>e.fillRect(t.x,t.y+i,t.width,s)))}},stroke:function(t,e,s,i){const r=e.__;if(r.__strokeWidth)if(r.__font)jh.strokeText(t,e,s,i);else switch(r.strokeAlign){case"center":Cd(t,1,e,s,i);break;case"inside":!function(t,e,s,i){s.save(),s.clipUI(e),Cd(t,2,e,s,i),s.restore()}(t,e,s,i);break;case"outside":!function(t,e,s,i){const r=e.__;if(r.__fillAfterStroke)Cd(t,2,e,s,i);else{const{renderBounds:n}=e.__layout,o=s.getSameCanvas(!0,!0);e.__drawRenderPath(o),Cd(t,2,e,o,i),o.clipUI(r),o.clearWorld(n),ro.copyCanvasByWorld(e,s,o),o.recycle(e.__nowWorld)}}(t,e,s,i)}},strokes:function(t,e,s,i){jh.stroke(t,e,s,i)},strokeText:function(t,e,s,i){switch(e.__.strokeAlign){case"center":Td(t,1,e,s,i);break;case"inside":Pd(t,"inside",e,s,i);break;case"outside":e.__.__fillAfterStroke?Td(t,2,e,s,i):Pd(t,"outside",e,s,i)}},drawTextStroke:function(t,e,s){let i,r=t.__.__textDrawData;const{rows:n,decorationY:o}=r;for(let t=0,s=n.length;t<s;t++)i=n[t],i.text?e.strokeText(i.text,i.x,i.y):i.data&&i.data.forEach(t=>{e.strokeText(t.char,t.x,i.y)});if(o){const{decorationHeight:t}=r;n.forEach(s=>o.forEach(i=>e.strokeRect(s.x,s.y+i,s.width,t)))}},drawStrokesStyle:function(t,e,s,i,r,n){let o;const a=i.__,{__hasMultiStrokeStyle:h}=a;h||r.setStroke(void 0,a.__strokeWidth*e,a);for(let l=0,d=t.length;l<d;l++)if(o=t[l],(!o.image||!Vh.checkImage(o,!1,i,r,n))&&o.style){if(h){const{strokeStyle:t}=o;t?r.setStroke(o.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(o.style,a.__strokeWidth*e,a)}else r.strokeStyle=o.style;o.blendMode?(r.saveBlendMode(o.blendMode),s?jh.drawTextStroke(i,r,n):r.stroke(),r.restoreBlendMode()):s?jh.drawTextStroke(i,r,n):r.stroke()}},shape:function(t,e,s){const i=e.getSameCanvas(),r=e.bounds,n=t.__nowWorld,o=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,d,c,u,_;Ld(o.strokeSpread?(Ed(Dd,o.boxBounds,o.strokeSpread),Dd):o.boxBounds,n,a);let{scaleX:p,scaleY:g}=t.getRenderScaleData(!0);if(r.includes(a))_=i,h=u=a,l=n;else{let i;if(m.fullImageShadow)i=a;else{const t=o.renderShapeSpread?Od(r,C.swapAndScale(o.renderShapeSpread,p,g)):r;i=Md(t,a)}c=r.getFitMatrix(i);let{a:f,d:y}=c;c.a<1&&(_=e.getSameCanvas(),t.__renderShape(_,s),p*=f,g*=y),u=Ad(a,c),h=Id(u,-c.e,-c.f),l=Ad(n,c),Wd(l,-c.e,-c.f);const x=s.matrix;x?(d=new ft(c),d.multiply(x),f*=x.scaleX,y*=x.scaleY):d=c,d.withScale(f,y),s=Object.assign(Object.assign({},s),{matrix:d})}return t.__renderShape(i,s),{canvas:i,matrix:d,fitMatrix:c,bounds:h,renderBounds:l,worldCanvas:_,shapeBounds:u,scaleX:p,scaleY:g}}};let Ud,jd=new Gt;const{isSame:Vd}=Ut;function Hd(t,e,s,i,r,n){if("fill"===e&&!t.__.__naturalWidth){const e=t.__;if(e.__naturalWidth=i.width/e.pixelRatio,e.__naturalHeight=i.height/e.pixelRatio,e.__autoSide)return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",e.width),t.setProxyAttr("height",e.height)),!1}return r.data||Vh.createData(r,i,s,n),!0}function Gd(t,e){Jd(t,Do.LOAD,e)}function qd(t,e){Jd(t,Do.LOADED,e)}function Qd(t,e,s){e.error=s,t.forceUpdate("surface"),Jd(t,Do.ERROR,e)}function Jd(t,e,s){t.hasEvent(e)&&t.emitEvent(new Do(e,s))}function $d(t,e){const{leafer:s}=t;s&&s.viewReady&&(s.renderer.ignore=e)}const{get:Zd,translate:Kd}=Z,tc=new Gt,ec={},sc={};function ic(t,e,s,i){const n=r(t)||i?(i?s-i*e:s%e)/((i||Math.floor(s/e))-1):t;return"auto"===t&&n<0?0:n}let rc={},nc={a:1,b:0,c:0,d:1,e:0,f:0};const{get:oc,set:ac,rotateOfOuter:hc,translate:lc,scaleOfOuter:dc,multiplyParent:cc,scale:uc,rotate:_c,skew:pc}=Z;function gc(t,e,s,i,r,n,o,a){o&&_c(t,o),a&&pc(t,a.x,a.y),r&&uc(t,r,n),lc(t,e.x+s,e.y+i)}const{get:fc,scale:yc,copy:mc}=Z,{getFloorScale:xc}=D,{abs:wc}=Math;const vc={image:function(t,e,s,i,r){let n,o;const a=$r.get(s);return Ud&&s===Ud.paint&&Vd(i,Ud.boxBounds)?n=Ud.leafPaint:(n={type:s.type,image:a},a.hasAlphaPixel&&(n.isTransparent=!0),Ud=a.use>1?{leafPaint:n,paint:s,boxBounds:jd.set(i)}:null),(r||a.loading)&&(o={image:a,attrName:e,attrValue:s}),a.ready?(Hd(t,e,s,a,n,i),r&&(Gd(t,o),qd(t,o))):a.error?r&&Qd(t,o,a.error):(r&&($d(t,!0),Gd(t,o)),n.loadId=a.load(()=>{$d(t,!1),t.destroyed||(Hd(t,e,s,a,n,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),qd(t,o)),n.loadId=void 0},e=>{$d(t,!1),Qd(t,o,e),n.loadId=void 0}),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),n},checkImage:function(t,e,s,i,r){const{scaleX:n,scaleY:o}=Vh.getImageRenderScaleData(t,s,i,r),{image:a,data:h}=t,{exporting:l}=r;return!(!h||t.patternId===n+"-"+o&&!l)&&(e&&(h.repeat?e=!1:t.changeful||"miniapp"===m.name&&jo.isResizing(s)||l||(e=m.image.isLarge(a,n,o))),e?(s.__.__isFastShadow&&(i.fillStyle=t.style||"#000",i.fill()),Vh.drawImage(t,n,o,s,i,r),!0):(!t.style||t.sync||l?Vh.createPattern(t,s,i,r):Vh.createPatternTask(t,s,i,r),!1))},drawImage:function(t,e,s,i,r,n){const{data:o,image:a,blendMode:h}=t,{opacity:l,transform:d}=o,c=a.getFull(o.filters),u=i.__;let _,{width:p,height:g}=a;d&&!d.onlyScale||(_=u.path||u.cornerRadius)||l||h?(r.save(),_&&r.clipUI(i),h&&(r.blendMode=h),l&&(r.opacity*=l),d&&r.transform(d),r.drawImage(c,0,0,p,g),r.restore()):(o.scaleX&&(p*=o.scaleX,g*=o.scaleY),r.drawImage(c,0,0,p,g))},getImageRenderScaleData:function(t,e,s,i){const r=e.getRenderScaleData(!0,t.scaleFixed),{data:n}=t;if(s){const{pixelRatio:t}=s;r.scaleX*=t,r.scaleY*=t}return n&&n.scaleX&&(r.scaleX*=Math.abs(n.scaleX),r.scaleY*=Math.abs(n.scaleY)),r},recycleImage:function(t,e){const s=e["_"+t];if(l(s)){let i,r,n,o,a;for(let h=0,d=s.length;h<d;h++)i=s[h],r=i.image,a=r&&r.url,a&&(n||(n={}),n[a]=!0,$r.recycle(r),r.loading&&(o||(o=e.__input&&e.__input[t]||[],l(o)||(o=[o])),r.unload(s[h].loadId,!o.some(t=>t.url===a))));return n}return null},createPatternTask:function(t,e,s,i){t.patternTask||(t.patternTask=$r.patternTasker.add(()=>ge(this,void 0,void 0,function*(){t.patternTask=null,s.bounds.hit(e.__nowWorld)&&Vh.createPattern(t,e,s,i),e.forceUpdate("surface")}),300))},createPattern:function(t,e,s,i){let{scaleX:r,scaleY:n}=Vh.getImageRenderScaleData(t,e,s,i),o=r+"-"+n;if(t.patternId!==o&&!e.destroyed&&(!m.image.isLarge(t.image,r,n)||t.data.repeat)){const{image:s,data:i}=t,{transform:a,gap:h}=i,l=Vh.getPatternFixScale(t,r,n);let d,c,u,{width:_,height:p}=s;l&&(r*=l,n*=l),_*=r,p*=n,h&&(c=h.x*r/wc(i.scaleX||1),u=h.y*n/wc(i.scaleY||1)),(a||1!==r||1!==n)&&(r*=xc(_+(c||0)),n*=xc(p+(u||0)),d=fc(),a&&mc(d,a),yc(d,1/r,1/n));const g=s.getCanvas(_,p,i.opacity,i.filters,c,u,e.leafer&&e.leafer.config.smooth),f=s.getPattern(g,i.repeat||m.origin.noRepeat||"no-repeat",d,t);t.style=f,t.patternId=o}},getPatternFixScale:function(t,e,s){const{image:i}=t;let r,n=m.image.maxPatternSize,o=i.width*i.height;return i.isSVG?e>1&&(r=Math.ceil(e)/e):n>o&&(n=o),(o*=e*s)>n&&(r=Math.sqrt(n/o)),r},createData:function(t,e,s,i){const{changeful:r,sync:n,scaleFixed:o}=s;r&&(t.changeful=r),n&&(t.sync=n),o&&(t.scaleFixed=o),t.data=Vh.getPatternData(s,i,e)},getPatternData:function(t,e,s){t.padding&&(e=tc.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:i,height:n}=s,{opacity:o,mode:a,align:h,offset:l,scale:c,size:u,rotation:_,skew:p,clipSize:g,repeat:f,gap:y,filters:m}=t,x=e.width===i&&e.height===n,w={mode:a},v="center"!==h&&(_||0)%180==90;let b,k;switch(Ut.set(sc,0,0,v?n:i,v?i:n),a&&"cover"!==a&&"fit"!==a?((c||u)&&(D.getScaleData(c,u,s,ec),b=ec.scaleX,k=ec.scaleY),(h||y||f)&&(b&&Ut.scale(sc,b,k,!0),h&&Rt.toPoint(h,sc,e,sc,!0,!0))):x&&!_||(b=k=Ut.getFitScale(e,sc,"fit"!==a),Ut.put(e,s,h,b,!1,sc),Ut.scale(sc,b,k,!0)),l&&lt.move(sc,l),a){case"stretch":x?b&&(b=k=void 0):(b=e.width/i,k=e.height/n,Vh.stretchMode(w,e,b,k));break;case"normal":case"clip":if(sc.x||sc.y||b||g||_||p){let t,s;g&&(t=e.width/g.width,s=e.height/g.height),Vh.clipMode(w,e,sc.x,sc.y,b,k,_,p,t,s),t&&(b=b?b*t:t,k=k?k*s:s)}break;case"repeat":(!x||b||_||p)&&Vh.repeatMode(w,e,i,n,sc.x,sc.y,b,k,_,p,h,t.freeTransform),f||(w.repeat="repeat");const s=d(f);(y||s)&&(w.gap=function(t,e,s,i,r){let n,o;d(t)?(n=t.x,o=t.y):n=o=t;return{x:ic(n,s,r.width,e&&e.x),y:ic(o,i,r.height,e&&e.y)}}(y,s&&f,sc.width,sc.height,e));break;default:b&&Vh.fillOrFitMode(w,e,sc.x,sc.y,b,k,_)}return w.transform||(e.x||e.y)&&Kd(w.transform=Zd(),e.x,e.y),b&&(w.scaleX=b,w.scaleY=k),o&&o<1&&(w.opacity=o),m&&(w.filters=m),f&&(w.repeat=r(f)?"x"===f?"repeat-x":"repeat-y":"repeat"),w},stretchMode:function(t,e,s,i){const r=oc(),{x:n,y:o}=e;n||o?lc(r,n,o):r.onlyScale=!0,uc(r,s,i),t.transform=r},fillOrFitMode:function(t,e,s,i,r,n,o){const a=oc();lc(a,e.x+s,e.y+i),uc(a,r,n),o&&hc(a,{x:e.x+e.width/2,y:e.y+e.height/2},o),t.transform=a},clipMode:function(t,e,s,i,r,n,o,a,h,l){const d=oc();gc(d,e,s,i,r,n,o,a),h&&(o||a?(ac(nc),dc(nc,e,h,l),cc(d,nc)):dc(d,e,h,l)),t.transform=d},repeatMode:function(t,e,s,i,r,n,o,a,h,l,d,c){const u=oc();if(c)gc(u,e,r,n,o,a,h,l);else{if(h)if("center"===d)hc(u,{x:s/2,y:i/2},h);else switch(_c(u,h),h){case 90:lc(u,i,0);break;case 180:lc(u,s,i);break;case 270:lc(u,0,s)}rc.x=e.x+r,rc.y=e.y+n,lc(u,rc.x,rc.y),o&&dc(u,rc,o,a)}t.transform=u}},{toPoint:bc}=kt,{hasTransparent:kc}=Yh,Sc={},Bc={};function Rc(t,e,s,i){if(s){let n,o,a,h;for(let t=0,l=s.length;t<l;t++)n=s[t],r(n)?(a=t/(l-1),o=Yh.string(n,i)):(a=n.offset,o=Yh.string(n.color,i)),e.addColorStop(a,o),!h&&kc(o)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:Cc,getDistance:Tc}=lt,{get:Pc,rotateOfOuter:Oc,scaleOfOuter:Ec}=Z,{toPoint:Lc}=kt,Ac={},Ic={};function Wc(t,e,s,i,r){let n;const{width:o,height:a}=t;if(o!==a||i){const t=Cc(e,s);n=Pc(),r?(Ec(n,e,o/a*(i||1),1),Oc(n,e,t+90)):(Ec(n,e,1,o/a*(i||1)),Oc(n,e,t))}return n}const{getDistance:Mc}=lt,{toPoint:Dc}=kt,Fc={},zc={};const Nc={linearGradient:function(t,e){let{from:s,to:i,type:r,opacity:n}=t;bc(s||"top",e,Sc),bc(i||"bottom",e,Bc);const o=m.canvas.createLinearGradient(Sc.x,Sc.y,Bc.x,Bc.y),a={type:r,style:o};return Rc(a,o,t.stops,n),a},radialGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,stretch:o}=t;Lc(s||"center",e,Ac),Lc(i||"bottom",e,Ic);const a=m.canvas.createRadialGradient(Ac.x,Ac.y,0,Ac.x,Ac.y,Tc(Ac,Ic)),h={type:r,style:a};Rc(h,a,t.stops,n);const l=Wc(e,Ac,Ic,o,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,stretch:o}=t;Dc(s||"center",e,Fc),Dc(i||"bottom",e,zc);const a=m.conicGradientSupport?m.canvas.createConicGradient(0,Fc.x,Fc.y):m.canvas.createRadialGradient(Fc.x,Fc.y,0,Fc.x,Fc.y,Mc(Fc,zc)),h={type:r,style:a};Rc(h,a,t.stops,n);const l=Wc(e,Fc,zc,o||1,m.conicGradientRotate90);return l&&(h.transform=l),h},getTransform:Wc},{copy:Yc,move:Xc,toOffsetOutBounds:Uc}=Ut,{max:jc,abs:Vc}=Math,Hc={},Gc=new ft,qc={};function Qc(t,e){let s,i,r,n,o=0,a=0,h=0,l=0;return e.forEach(t=>{s=t.x||0,i=t.y||0,n=1.5*(t.blur||0),r=Vc(t.spread||0),o=jc(o,r+n-i),a=jc(a,r+n+s),h=jc(h,r+n+i),l=jc(l,r+n-s)}),o===a&&a===h&&h===l?o:[o,a,h,l]}function Jc(t,e,s){const{shapeBounds:i}=s;let r,n;m.fullImageShadow?(Yc(Hc,t.bounds),Xc(Hc,e.x-i.x,e.y-i.y),r=t.bounds,n=Hc):(r=i,n=e),t.copyWorld(s.canvas,r,n)}const{toOffsetOutBounds:$c}=Ut,Zc={};const Kc=Qc;const tu={shadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{shadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;Uc(h,qc,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.setWorldShadow(qc.offsetX+(o.x||0)*c*f,qc.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f,Yh.string(o.color)),r=Gh.getShadowTransform(t,_,s,o,qc,f),r&&_.setTransform(r),Jc(_,qc,s),r&&_.resetTransform(),i=l,o.box&&(_.restore(),_.save(),a&&(_.copyWorld(_,l,n,"copy"),i=n),a?_.copyWorld(a,n,n,"destination-out"):_.copyWorld(s.canvas,d,h,"destination-out")),ro.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<p&&_.clearWorld(i)}),_.recycle(i)},innerShadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{innerShadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;$c(h,Zc,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.save(),_.setWorldShadow(Zc.offsetX+(o.x||0)*c*f,Zc.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f),r=Gh.getShadowTransform(t,_,s,o,Zc,f,!0),r&&_.setTransform(r),Jc(_,Zc,s),_.restore(),a?(_.copyWorld(_,l,n,"copy"),_.copyWorld(a,n,n,"source-out"),i=n):(_.copyWorld(s.canvas,d,h,"source-out"),i=l),_.fillWorld(i,Yh.string(o.color),"source-in"),ro.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<p&&_.clearWorld(i)}),_.recycle(i)},blur:function(t,e,s){const{blur:i}=t.__;s.setWorldBlur(i*t.__nowWorld.a),s.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),s.filter="none"},backgroundBlur:function(t,e,s){},getShadowRenderSpread:Qc,getShadowTransform:function(t,e,s,i,r,n,o){if(i.spread){const s=2*i.spread*n*(o?-1:1),{width:a,height:h}=t.__layout.strokeBounds;return Gc.set().scaleOfOuter({x:(r.x+r.width/2)*e.pixelRatio,y:(r.y+r.height/2)*e.pixelRatio},1+s/a,1+s/h),Gc}},isTransformShadow(t){},getInnerShadowSpread:Kc},{excludeRenderBounds:eu}=_o;let su;function iu(t,e,s,i,r,n,o,a){switch(e){case"grayscale":su||(su=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,s,i,r,n){const o=t.__nowWorld;s.resetTransform(),s.opacity=1,s.useMask(i,o),n&&i.recycle(o);nu(t,e,s,1,r,n)}(t,s,i,r,o,a);break;case"opacity-path":nu(t,s,i,n,o,a);break;case"path":a&&s.restore()}}function ru(t){return t.getSameCanvas(!1,!0)}function nu(t,e,s,i,r,n){const o=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(s,o,void 0,r),n?s.recycle(o):s.clearWorld(o)}Ol.prototype.__renderMask=function(t,e){let s,i,r,n,o,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(s=h[l],a=s.__.mask,a){o&&(iu(this,o,t,r,i,n,void 0,!0),i=r=null),"clipping"!==a&&"clipping-path"!==a||eu(s,e)||s.__render(t,e),n=s.__.opacity,su=!1,"path"===a||"clipping-path"===a?(n<1?(o="opacity-path",r||(r=ru(t))):(o="path",t.save()),s.__clip(r||t,e)):(o="grayscale"===a?"grayscale":"alpha",i||(i=ru(t)),r||(r=ru(t)),s.__render(i,e));continue}const d=1===n&&s.__.__blendMode;d&&iu(this,o,t,r,i,n,void 0,!1),eu(s,e)||s.__render(r||t,e),d&&iu(this,o,t,r,i,n,d,!1)}iu(this,o,t,r,i,n,void 0,!0)};const ou=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",au=ou+"_#~&*+\\=|≮≯≈≠=…",hu=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map(([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`).join("|"));function lu(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const du=lu("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),cu=lu("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),uu=lu(ou),_u=lu(au),pu=lu("- —/~|┆·");var gu;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(gu||(gu={}));const{Letter:fu,Single:yu,Before:mu,After:xu,Symbol:wu,Break:vu}=gu;function bu(t){return du[t]?fu:pu[t]?vu:cu[t]?mu:uu[t]?xu:_u[t]?wu:hu.test(t)?yu:fu}const ku={trimRight(t){const{words:e}=t;let s,i=0,r=e.length;for(let n=r-1;n>-1&&(s=e[n].data[0]," "===s.char);n--)i++,t.width-=s.width;i&&e.splice(r-i,i)}};function Su(t,e,s){switch(e){case"title":return s?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:Bu}=ku,{Letter:Ru,Single:Cu,Before:Tu,After:Pu,Symbol:Ou,Break:Eu}=gu;let Lu,Au,Iu,Wu,Mu,Du,Fu,zu,Nu,Yu,Xu,Uu,ju,Vu,Hu,Gu,qu,Qu=[];function Ju(t,e){Nu&&!zu&&(zu=Nu),Lu.data.push({char:t,width:e}),Iu+=e}function $u(){Wu+=Iu,Lu.width=Iu,Au.words.push(Lu),Lu={data:[]},Iu=0}function Zu(){Vu&&(Hu.paraNumber++,Au.paraStart=!0,Vu=!1),Nu&&(Au.startCharSize=zu,Au.endCharSize=Nu,zu=0),Au.width=Wu,Gu.width?Bu(Au):qu&&Ku(),Qu.push(Au),Au={words:[]},Wu=0}function Ku(){Wu>(Hu.maxWidth||0)&&(Hu.maxWidth=Wu)}const{top:t_,right:e_,bottom:s_,left:i_}=wt;function r_(t,e,s){const{bounds:i,rows:r}=t;i[e]+=s;for(let t=0;t<r.length;t++)r[t][e]+=s}const n_={getDrawData:function(t,e){r(t)||(t=String(t));let s=0,i=0,n=e.__getInput("width")||0,o=e.__getInput("height")||0;const{__padding:a}=e;a&&(n?(s=a[i_],n-=a[e_]+a[i_],!n&&(n=.01)):e.autoSizeAlign||(s=a[i_]),o?(i=a[t_],o-=a[t_]+a[s_],!o&&(o=.01)):e.autoSizeAlign||(i=a[t_]));const h={bounds:{x:s,y:i,width:n,height:o},rows:[],paraNumber:0,font:m.canvas.font=e.__font};return function(t,e,s){Hu=t,Qu=t.rows,Gu=t.bounds,qu=!Gu.width&&!s.autoSizeAlign;const{__letterSpacing:i,paraIndent:r,textCase:n}=s,{canvas:o}=m,{width:a}=Gu;if(s.__isCharMode){const t="none"!==s.textWrap,h="break"===s.textWrap;Vu=!0,Xu=null,zu=Fu=Nu=Iu=Wu=0,Lu={data:[]},Au={words:[]},i&&(e=[...e]);for(let s=0,l=e.length;s<l;s++)Du=e[s],"\n"===Du?(Iu&&$u(),Au.paraEnd=!0,Zu(),Vu=!0):(Yu=bu(Du),Yu===Ru&&"none"!==n&&(Du=Su(Du,n,!Iu)),Fu=o.measureText(Du).width,i&&(i<0&&(Nu=Fu),Fu+=i),Uu=Yu===Cu&&(Xu===Cu||Xu===Ru)||Xu===Cu&&Yu!==Pu,ju=!(Yu!==Tu&&Yu!==Cu||Xu!==Ou&&Xu!==Pu),Mu=Vu&&r?a-r:a,t&&a&&Wu+Iu+Fu>Mu&&(h?(Iu&&$u(),Wu&&Zu()):(ju||(ju=Yu===Ru&&Xu==Pu),Uu||ju||Yu===Eu||Yu===Tu||Yu===Cu||Iu+Fu>Mu?(Iu&&$u(),Wu&&Zu()):Wu&&Zu()))," "===Du&&!0!==Vu&&Wu+Iu===0||(Yu===Eu?(" "===Du&&Iu&&$u(),Ju(Du,Fu),$u()):Uu||ju?(Iu&&$u(),Ju(Du,Fu)):Ju(Du,Fu)),Xu=Yu);Iu&&$u(),Wu&&Zu(),Qu.length>0&&(Qu[Qu.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{Hu.paraNumber++,Wu=o.measureText(t).width,Qu.push({x:r||0,text:t,width:Wu,paraStart:!0}),qu&&Ku()})}(h,t,e),a&&function(t,e,s,i,r){if(!i&&s.autoSizeAlign)switch(s.textAlign){case"left":r_(e,"x",t[i_]);break;case"right":r_(e,"x",-t[e_])}if(!r&&s.autoSizeAlign)switch(s.verticalAlign){case"top":r_(e,"y",t[t_]);break;case"bottom":r_(e,"y",-t[s_])}}(a,h,e,n,o),function(t,e){const{rows:s,bounds:i}=t,r=s.length,{__lineHeight:n,__baseLine:o,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:g,height:f}=i,y=n*r+(c?c*(t.paraNumber-1):0),m=o;if(h&&y>f)y=Math.max(f,n),r>1&&(t.overflow=r);else if(f||u)switch(d){case"middle":p+=(f-y)/2;break;case"bottom":p+=f-y}m+=p;let x,w,v,b=g||u?g:t.maxWidth;for(let o=0,d=r;o<d;o++){if(x=s[o],x.x=_,x.width<g||x.width>g&&!h)switch(l){case"center":x.x+=(b-x.width)/2;break;case"right":x.x+=b-x.width}x.paraStart&&c&&o>0&&(m+=c),x.y=m,m+=n,t.overflow>o&&m>y&&(x.isOverflow=!0,t.overflow=o+1),w=x.x,v=x.width,a<0&&(x.width<0?(v=-x.width+e.fontSize+a,w-=v,v+=e.fontSize):v-=a),w<i.x&&(i.x=w),v>i.width&&(i.width=v),h&&g&&g<v&&(x.isOverflow=!0,t.overflow||(t.overflow=s.length))}i.y=p,i.height=y}(h,e),e.__isCharMode&&function(t,e,s){const{rows:i}=t,{textAlign:r,paraIndent:n,letterSpacing:o}=e,a=s&&r.includes("both"),h=a||s&&r.includes("justify"),l=h&&r.includes("letter");let d,c,u,_,p,g,f,y,m,x;i.forEach(t=>{t.words&&(p=n&&t.paraStart?n:0,y=t.words.length,h&&(x=!t.paraEnd||a,c=s-t.width-p,l?_=c/(t.words.reduce((t,e)=>t+e.data.length,0)-1):u=y>1?c/(y-1):0),g=o||t.isOverflow||l?0:u?1:2,t.isOverflow&&!o&&(t.textMode=!0),2===g?(t.x+=p,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=p,d=t.x,t.data=[],t.words.forEach((e,s)=>{1===g?(f={char:"",x:d},d=function(t,e,s){return t.forEach(t=>{s.char+=t.char,e+=t.width}),e}(e.data,d,f),(t.isOverflow||" "!==f.char)&&t.data.push(f)):d=function(t,e,s,i,r){return t.forEach(t=>{(i||" "!==t.char)&&(t.x=e,s.push(t)),e+=t.width,r&&(e+=r)}),e}(e.data,d,t.data,t.isOverflow,x&&_),x&&(m=s===y-1,u?m||(d+=u,t.width+=u):_&&(t.width+=_*(e.data.length-(m?1:0))))})),t.words=null)})}(h,e,n),h.overflow&&function(t,e,s,i){if(!i)return;const{rows:r,overflow:n}=t;let{textOverflow:o}=e;if(r.splice(n),o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const h=o?m.canvas.measureText(o).width:0,l=s+i-h;("none"===e.textWrap?r:[r[n-1]]).forEach(e=>{if(e.isOverflow&&e.data){let s=e.data.length-1;for(let i=s;i>-1&&(t=e.data[i],a=t.x+t.width,!(i===s&&a<l));i--){if(a<l&&" "!==t.char||!i){e.data.splice(i+1),e.width-=t.width;break}e.width-=t.width}e.width+=h,e.data.push({char:o,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(h,e,s,n),"none"!==e.textDecoration&&function(t,e){let s,i=0;const{fontSize:r,textDecoration:n}=e;switch(t.decorationHeight=r/11,d(n)?(s=n.type,n.color&&(t.decorationColor=Yh.string(n.color)),n.offset&&(i=Math.min(.3*r,Math.max(n.offset,.15*-r)))):s=n,s){case"under":t.decorationY=[.15*r+i];break;case"delete":t.decorationY=[.35*-r];break;case"under-delete":t.decorationY=[.15*r+i,.35*-r]}}(h,e),h}};const o_={string:function(t,e){if(!t)return"#000";const i=o(e)&&e<1;if(r(t)){if(!i||!Yh.object)return t;t=Yh.object(t)}let n=s(t.a)?1:t.a;i&&(n*=e);const a=t.r+","+t.g+","+t.b;return 1===n?"rgb("+a+")":"rgba("+a+","+n+")"}};Object.assign(Nh,n_),Object.assign(Yh,o_),Object.assign(jh,Xd),Object.assign(Vh,vc),Object.assign(Hh,Nc),Object.assign(Gh,tu);try{wx&&vh(0,wx)}catch(t){}export{Rt as AlignHelper,t as Answer,kt as AroundHelper,Qt as AutoBounds,ns as BezierHelper,Gt as Bounds,Fo as BoundsEvent,Ut as BoundsHelper,Nl as Box,al as BoxData,ph as Branch,yo as BranchHelper,La as BranchRender,yd as Canvas,wl as CanvasData,_e as CanvasManager,Ao as ChildEvent,Yh as ColorConvert,oe as Creator,_ as DataHelper,Zt as Debug,wt as Direction4,vt as Direction9,Gh as Effect,Vl as Ellipse,ul as EllipseData,ps as EllipseHelper,Lo as Event,ce as EventCreator,ea as Eventer,Qh as Export,Ur as FileHelper,qh as Filter,C as FourNumberHelper,Yl as Frame,ll as FrameData,Ol as Group,ol as GroupData,gd as Image,xl as ImageData,Do as ImageEvent,$r as ImageManager,w as IncrementId,Ho as LayoutEvent,Ah as Layouter,rh as Leaf,Pa as LeafBounds,_o as LeafBoundsHelper,g as LeafData,pa as LeafDataProxy,ua as LeafEventer,ro as LeafHelper,Eo as LeafLayout,fh as LeafLevelList,gh as LeafList,va as LeafMatrix,Oa as LeafRender,Al as Leafer,mh as LeaferCanvas,Pe as LeaferCanvasBase,hl as LeaferData,qo as LeaferEvent,en as LeaferImage,pd as Line,dl as LineData,D as MathHelper,ft as Matrix,Z as MatrixHelper,fd as MyImage,Ie as NeedConvertToCanvasCommandMap,z as OneRadian,N as PI2,Y as PI_2,jh as Paint,Hh as PaintGradient,Vh as PaintImage,Sd as Path,Uh as PathArrow,Er as PathBounds,vi as PathCommandDataHelper,Le as PathCommandMap,Zs as PathConvert,Fr as PathCorner,Fi as PathCreator,gl as PathData,Ki as PathDrawer,Oe as PathHelper,Fe as PathNumberCommandLengthMap,De as PathNumberCommandMap,Bd as Pen,fl as PenData,m as Platform,ne as Plugin,pt as Point,lt as PointHelper,Kl as Polygon,_l as PolygonData,Wo as PropertyEvent,Il as Rect,cl as RectData,ze as RectHelper,Cl as RectRender,Go as RenderEvent,Wh as Renderer,jo as ResizeEvent,Qr as Resource,se as Run,od as Star,pl as StarData,Jh as State,Jt as StringNumberMap,Hr as TaskItem,Gr as TaskProcessor,kd as Text,Nh as TextConvert,ml as TextData,$h as Transition,mt as TwoPointBoundsHelper,Pl as UI,kl as UIBounds,he as UICreator,rl as UIData,Bl as UIRender,Xh as UnitConvert,vo as WaitHelper,Vo as WatchEvent,bh as Watcher,kn as affectRenderBoundsType,wn as affectStrokeBoundsType,an as attr,un as autoLayoutType,gn as boundsType,Xr as canvasPatch,Te as canvasSizeAttrs,zh as createAttr,nn as createDescriptor,In as cursorType,Wn as dataProcessor,ln as dataType,on as decorateLeafAttr,Dn as defineDataProcessor,sn as defineKey,hn as defineLeafAttr,Bn as dimType,yn as doBoundsType,vn as doStrokeType,Mh as effectType,e as emptyData,Ln as eraserType,Mo as extraPropertyEventMap,U as getBoundsData,rn as getDescriptor,j as getMatrixData,X as getPointData,An as hitType,l as isArray,c as isData,u as isEmptyData,n as isFinite,i as isNull,o as isNumber,d as isObject,r as isString,s as isUndefined,Mn as layoutProcessor,Ko as leaferTransformAttrMap,En as maskType,fn as naturalBoundsType,Rn as opacityType,zr as path,mn as pathInputType,xn as pathType,Nr as pen,dn as positionType,Vn as registerUI,Hn as registerUIEvent,Dh as resizeType,Yn as rewrite,Xn as rewriteAble,pn as rotationType,_n as scaleType,cn as scrollType,On as sortType,bn as strokeType,Sn as surfaceType,qt as tempBounds,yt as tempMatrix,gt as tempPoint,h as tryToNumber,vh as useCanvas,jn as useModule,yh as version,Cn as visibleType,Fh as zoomLayerType};
1
+ var t;!function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(t||(t={}));const e={};function s(t){return void 0===t}function i(t){return null==t}function r(t){return"string"==typeof t}const{isFinite:n}=Number;function o(t){return"number"==typeof t}const a=/^-?\d+(?:\.\d+)?$/;function h(t){return"string"==typeof t&&a.test(t)?+t:t}const{isArray:l}=Array;function d(t){return t&&"object"==typeof t}function c(t){return d(t)&&!l(t)}function u(t){return"{}"===JSON.stringify(t)}const _={default:(t,e)=>(p(e,t),p(t,e),t),assign(t,e,s){let i;Object.keys(e).forEach(r=>{var n,o;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(n=t[r])||void 0===n?void 0:n.constructor)===Object)return p(t[r],e[r],s&&s[r]);s&&r in s?(null===(o=s[r])||void 0===o?void 0:o.constructor)===Object&&p(t[r]={},e[r],s[r]):t[r]=e[r]})},copyAttrs:(t,e,i)=>(i.forEach(i=>{s(e[i])||(t[i]=e[i])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,i=t.length;s<i;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:p}=_;class g{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __usePathBox(){return this.__pathInputed}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(!s(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let i;for(let r in this)"_"!==r[0]&&(i=e?e[r]:void 0,t[r]=s(i)?this[r]:i);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!s(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!s(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const i={};if(t)if(l(t))for(let e of t)i[e]=this.__getInput(e);else for(let e in t)i[e]=this.__getInput(e);else{let t,e,{__input:r}=this;i.tag=this.__leaf.tag;for(let n in this)if("_"!==n[0]&&(t=this["_"+n],!s(t))){if("path"===n&&!this.__pathInputed)continue;e=r?r[n]:void 0,i[n]=s(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:s,d:r,e:n,f:o}=this.__leaf.__localMatrix;i.matrix={a:t,b:e,c:s,d:r,e:n,f:o}}return i}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null}}const{floor:f,max:y}=Math,m={toURL(t,e){let s=encodeURIComponent(t);return"text"===e?s="data:text/plain;charset=utf-8,"+s:"svg"===e&&(s="data:image/svg+xml,"+s),s},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",isLarge:(t,e,s,i)=>t.width*t.height*(e?e*s:1)>(i||x.maxCacheSize),isSuperLarge:(t,e,s)=>x.isLarge(t,e,s,x.maxPatternSize),getRealURL(t){const{prefix:e,suffix:s}=m.image;return!s||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+s),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,s,i,r,n,o,a,h){const l=m.origin.createCanvas(y(f(e+(i||0)),1),y(f(s+(r||0)),1)),d=l.getContext("2d");if(a&&(d.globalAlpha=a),d.imageSmoothingEnabled=!1!==o,n){const i=e/n.width,r=s/n.height;d.setTransform(i,0,0,r,-n.x*i,-n.y*r),d.drawImage(t,0,0,t.width,t.height)}else d.drawImage(t,0,0,e,s);return l},setPatternTransform(t,e,s){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}s&&_.stintSet(s,"transform",e)}}},{image:x}=m,w={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=v;return e[t]?e[t]++:(e[t]=1,0)}},v=w;let b,k,S;const{max:B}=Math,R=[0,0,0,0],C={zero:[...R],tempFour:R,set:(t,e,s,i,r)=>(void 0===s&&(s=i=r=e),t[0]=e,t[1]=s,t[2]=i,t[3]=r,t),setTemp:(t,e,s,i)=>T(R,t,e,s,i),toTempAB(t,e,s){S=s?o(t)?e:t:[],o(t)?(b=O(t),k=e):o(e)?(b=t,k=O(e)):(b=t,k=e),4!==b.length&&(b=P(b)),4!==k.length&&(k=P(k))},get(t,e){let i;if(!o(t))switch(t.length){case 4:i=s(e)?t:[...t];break;case 2:i=[t[0],t[1],t[0],t[1]];break;case 3:i=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(i||(i=[t,t,t,t]),!s(e))for(let t=0;t<4;t++)i[t]>e&&(i[t]=e);return i},max:(t,e,s)=>o(t)&&o(e)?B(t,e):(E(t,e,s),T(S,B(b[0],k[0]),B(b[1],k[1]),B(b[2],k[2]),B(b[3],k[3]))),add:(t,e,s)=>o(t)&&o(e)?t+e:(E(t,e,s),T(S,b[0]+k[0],b[1]+k[1],b[2]+k[2],b[3]+k[3])),swapAndScale(t,e,s,i){if(o(t))return e===s?t*e:[t*s,t*e];const r=i?t:[],[n,a,h,l]=4===t.length?t:P(t);return T(r,h*s,l*e,n*s,a*e)}},{set:T,get:P,setTemp:O,toTempAB:E}=C,{round:L,pow:A,max:I,floor:W,PI:M}=Math,D={within:(t,e,i)=>(d(e)&&(i=e.max,e=e.min),!s(e)&&t<e&&(t=e),!s(i)&&t>i&&(t=i),t),fourNumber:C.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),D.float(t)),getGapRotation(t,e,s=0){let i=t+s;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-s},float(t,e){const i=s(e)?1e12:A(10,e);return-0===(t=L(t*i)/i)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,s,i){if(i||(i={}),e){const t=(o(e)?e:e.width||0)/s.width,r=(o(e)?e:e.height||0)/s.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&D.assignScale(i,t);return i},assignScale(t,e){o(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>I(W(t),e)/t,randInt:F,randColor:t=>`rgba(${F(255)},${F(255)},${F(255)},${t||1})`};function F(t){return Math.round(Math.random()*t)}const z=M/180,N=2*M,Y=M/2;function X(){return{x:0,y:0}}function U(){return{x:0,y:0,width:0,height:0}}function j(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:V,cos:H,acos:G,sqrt:q}=Math,{float:Q}=D,J={};function $(){return Object.assign(Object.assign(Object.assign({},{a:1,b:0,c:0,d:1,e:0,f:0}),{x:0,y:0,width:0,height:0}),{scaleX:1,scaleY:1,rotation:0,skewX:0,skewY:0})}const Z={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:$(),tempMatrix:{},set(t,e=1,s=0,i=0,r=1,n=0,o=0){t.a=e,t.b=s,t.c=i,t.d=r,t.e=n,t.f=o},get:j,getWorld:$,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,s){t.e+=e,t.f+=s},translateInner(t,e,s,i){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,i&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},pixelScale(t,e,s){s||(s=t),s.a=t.a*e,s.b=t.b*e,s.c=t.c*e,s.d=t.d*e,s.e=t.e*e,s.f=t.f*e},scaleOfOuter(t,e,s,i){K.toInnerPoint(t,e,J),K.scaleOfInner(t,J,s,i)},scaleOfInner(t,e,s,i=s){K.translateInner(t,e.x,e.y),K.scale(t,s,i),K.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:i,c:r,d:n}=t,o=H(e*=z),a=V(e);t.a=s*o-i*a,t.b=s*a+i*o,t.c=r*o-n*a,t.d=r*a+n*o},rotateOfOuter(t,e,s){K.toInnerPoint(t,e,J),K.rotateOfInner(t,J,s)},rotateOfInner(t,e,s){K.translateInner(t,e.x,e.y),K.rotate(t,s),K.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:i,b:r,c:n,d:o}=t;s&&(s*=z,t.a=i+n*s,t.b=r+o*s),e&&(e*=z,t.c=n+i*e,t.d=o+r*e)},skewOfOuter(t,e,s,i){K.toInnerPoint(t,e,J),K.skewOfInner(t,J,s,i)},skewOfInner(t,e,s,i=0){K.translateInner(t,e.x,e.y),K.skew(t,s,i),K.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:i,c:r,d:n,e:o,f:a}=t;t.a=e.a*s+e.b*r,t.b=e.a*i+e.b*n,t.c=e.c*s+e.d*r,t.d=e.c*i+e.d*n,t.e=e.e*s+e.f*r+o,t.f=e.e*i+e.f*n+a},multiplyParent(t,e,i,r,n){const{e:o,f:a}=t;if(i||(i=t),s(r)&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:s,b:r,c:o,d:a}=t;i.a=s*e.a+r*e.c,i.b=s*e.b+r*e.d,i.c=o*e.a+a*e.c,i.d=o*e.b+a*e.d,n&&(i.scaleX=e.scaleX*n.scaleX,i.scaleY=e.scaleY*n.scaleY)}else i.a=e.a,i.b=e.b,i.c=e.c,i.d=e.d,n&&(i.scaleX=e.scaleX,i.scaleY=e.scaleY);i.e=o*e.a+a*e.c+e.e,i.f=o*e.b+a*e.d+e.f},divide(t,e){K.multiply(t,K.tempInvert(e))},divideParent(t,e){K.multiplyParent(t,K.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=K;return K.copy(e,t),K.invert(e),e},invert(t){const{a:e,b:s,c:i,d:r,e:n,f:o}=t;if(s||i){const a=1/(e*r-s*i);t.a=r*a,t.b=-s*a,t.c=-i*a,t.d=e*a,t.e=-(n*r-o*i)*a,t.f=-(o*e-n*s)*a}else if(1===e&&1===r)t.e=-n,t.f=-o;else{const s=1/(e*r);t.a=r*s,t.d=e*s,t.e=-n*r*s,t.f=-o*e*s}},toOuterPoint(t,e,s,i){const{x:r,y:n}=e;s||(s=e),s.x=r*t.a+n*t.c,s.y=r*t.b+n*t.d,i||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,i){const{a:r,b:n,c:o,d:a}=t,h=1/(r*a-n*o),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*o)*h,s.y=(d*r-l*n)*h,!i){const{e:e,f:i}=t;s.x-=(e*a-i*o)*h,s.y-=(i*r-e*n)*h}},setLayout(t,e,i,r,n){const{x:o,y:a,scaleX:h,scaleY:l}=e;if(s(n)&&(n=e.rotation||e.skewX||e.skewY),n){const{rotation:s,skewX:i,skewY:r}=e,n=s*z,o=H(n),a=V(n);if(i||r){const e=i*z,s=r*z;t.a=(o+s*-a)*h,t.b=(a+s*o)*h,t.c=(e*o-a)*l,t.d=(o+e*a)*l}else t.a=o*h,t.b=a*h,t.c=-a*l,t.d=o*l}else t.a=h,t.b=0,t.c=0,t.d=l;t.e=o,t.f=a,(i=i||r)&&K.translateInner(t,-i.x,-i.y,!r)},getLayout(t,e,s,i){const{a:r,b:n,c:o,d:a,e:h,f:l}=t;let d,c,u,_,p,g=h,f=l;if(n||o){const t=r*a-n*o;if(o&&!i){d=q(r*r+n*n),c=t/d;const e=r/d;u=n>0?G(e):-G(e)}else{c=q(o*o+a*a),d=t/c;const e=o/c;u=Y-(a>0?G(-e):-G(e))}const e=Q(H(u)),s=V(u);d=Q(d),c=Q(c),_=e?Q((o/c+s)/e/z,9):0,p=e?Q((n/d-s)/e/z,9):0,u=Q(u/z)}else d=r,c=a,u=_=p=0;return(e=s||e)&&(g+=e.x*r+e.y*o,f+=e.x*n+e.y*a,s||(g-=e.x,f-=e.y)),{x:g,y:f,scaleX:d,scaleY:c,rotation:u,skewX:_,skewY:p}},withScale(t,e,s=e){const i=t;if(!e||!s){const{a:i,b:r,c:n,d:o}=t;r||n?s=(i*o-r*n)/(e=q(i*i+r*r)):(e=i,s=o)}return i.scaleX=e,i.scaleY=s,i},reset(t){K.set(t)}},K=Z,{toInnerPoint:tt,toOuterPoint:et}=Z,{sin:st,cos:it,abs:rt,sqrt:nt,atan2:ot,min:at,round:ht}=Math,lt={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,i){t.radiusX=e,t.radiusY=s(i)?e:i},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,s){t.x=e,t.y=s},round(t,e){t.x=e?ht(t.x-.5)+.5:ht(t.x),t.y=e?ht(t.y-.5)+.5:ht(t.y)},move(t,e,s){d(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=s)},scale(t,e,s=e){t.x&&(t.x*=e),t.y&&(t.y*=s)},scaleOf(t,e,s,i=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(i-1)},rotate(t,e,s){s||(s=dt.defaultPoint);const i=it(e*=z),r=st(e),n=t.x-s.x,o=t.y-s.y;t.x=s.x+n*i-o*r,t.y=s.y+n*r+o*i},tempToInnerOf(t,e){const{tempPoint:s}=dt;return ut(s,t),tt(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=dt;return ut(s,t),et(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=dt;return ut(s,t),dt.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),tt(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){tt(e,t,s)},toOuterOf(t,e,s){et(e,t,s)},getCenter:(t,e)=>({x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}),getCenterX:(t,e)=>t+(e-t)/2,getCenterY:(t,e)=>t+(e-t)/2,getDistance:(t,e)=>ct(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,i){const r=rt(s-t),n=rt(i-e);return nt(r*r+n*n)},getMinDistanceFrom:(t,e,s,i,r,n)=>at(ct(t,e,s,i),ct(s,i,r,n)),getAngle:(t,e)=>_t(t,e)/z,getRotation:(t,e,s,i)=>(i||(i=e),dt.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,i.x,i.y)/z),getRadianFrom(t,e,i,r,n,o,a,h){s(a)&&(a=i,h=r);const l=t-i,d=e-r,c=n-a,u=o-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e)=>ot(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,i){const r=_t(t,e);return(e=i?e:{}).x=t.x+it(r)*s,e.y=t.y+st(r)*s,e},toNumberPoints(t){let e=t;return d(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},reset(t){dt.reset(t)}},dt=lt,{getDistanceFrom:ct,copy:ut,getAtan2:_t}=dt;class pt{constructor(t,e){this.set(t,e)}set(t,e){return d(t)?lt.copy(this,t):lt.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new pt(this)}move(t,e){return lt.move(this,t,e),this}scale(t,e){return lt.scale(this,t,e),this}scaleOf(t,e,s){return lt.scaleOf(this,t,e,s),this}rotate(t,e){return lt.rotate(this,t,e),this}rotateOf(t,e){return lt.rotate(this,e,t),this}getRotation(t,e,s){return lt.getRotation(this,t,e,s)}toInnerOf(t,e){return lt.toInnerOf(this,t,e),this}toOuterOf(t,e){return lt.toOuterOf(this,t,e),this}getCenter(t){return new pt(lt.getCenter(this,t))}getDistance(t){return lt.getDistance(this,t)}getDistancePoint(t,e,s){return new pt(lt.getDistancePoint(this,t,e,s))}getAngle(t){return lt.getAngle(this,t)}getAtan2(t){return lt.getAtan2(this,t)}reset(){return lt.reset(this),this}}const gt=new pt;class ft{constructor(t,e,s,i,r,n){this.set(t,e,s,i,r,n)}set(t,e,s,i,r,n){return d(t)?Z.copy(this,t):Z.set(this,t,e,s,i,r,n),this}setWith(t){return Z.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:s,d:i,e:r,f:n}=this;return{a:t,b:e,c:s,d:i,e:r,f:n}}clone(){return new ft(this)}translate(t,e){return Z.translate(this,t,e),this}translateInner(t,e){return Z.translateInner(this,t,e),this}scale(t,e){return Z.scale(this,t,e),this}scaleWith(t,e){return Z.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return Z.pixelScale(this,t),this}scaleOfOuter(t,e,s){return Z.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return Z.scaleOfInner(this,t,e,s),this}rotate(t){return Z.rotate(this,t),this}rotateOfOuter(t,e){return Z.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return Z.rotateOfInner(this,t,e),this}skew(t,e){return Z.skew(this,t,e),this}skewOfOuter(t,e,s){return Z.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return Z.skewOfInner(this,t,e,s),this}multiply(t){return Z.multiply(this,t),this}multiplyParent(t){return Z.multiplyParent(this,t),this}divide(t){return Z.divide(this,t),this}divideParent(t){return Z.divideParent(this,t),this}invert(){return Z.invert(this),this}invertWith(){return Z.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){Z.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){Z.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return Z.setLayout(this,t,e,s),this}getLayout(t,e,s){return Z.getLayout(this,t,e,s)}withScale(t,e){return Z.withScale(this,t,e)}reset(){Z.reset(this)}}const yt=new ft,mt={tempPointBounds:{},setPoint(t,e,s){t.minX=t.maxX=e,t.minY=t.maxY=s},addPoint(t,e,s){t.minX=e<t.minX?e:t.minX,t.minY=s<t.minY?s:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=s>t.maxY?s:t.maxY},addBounds(t,e,s,i,r){xt(t,e,s),xt(t,e+i,s+r)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}},{addPoint:xt}=mt;var wt,vt;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(wt||(wt={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center",t[t["top-left"]=0]="top-left",t[t["top-right"]=2]="top-right",t[t["bottom-right"]=4]="bottom-right",t[t["bottom-left"]=6]="bottom-left"}(vt||(vt={}));const bt=[{x:0,y:0},{x:.5,y:0},{x:1,y:0},{x:1,y:.5},{x:1,y:1},{x:.5,y:1},{x:0,y:1},{x:0,y:.5},{x:.5,y:.5}];bt.forEach(t=>t.type="percent");const kt={directionData:bt,tempPoint:{},get:St,toPoint(t,e,s,i,r,n){const o=St(t);s.x=o.x,s.y=o.y,"percent"===o.type&&(s.x*=e.width,s.y*=e.height,r&&(n||(s.x-=r.x,s.y-=r.y),o.x&&(s.x-=1===o.x?r.width:.5===o.x?o.x*r.width:0),o.y&&(s.y-=1===o.y?r.height:.5===o.y?o.y*r.height:0))),i||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s)=>(s||(s={}),kt.toPoint(t,e,s,!0),s)};function St(t){return r(t)?bt[vt[t]]:t}const{toPoint:Bt}=kt,Rt={toPoint(t,e,s,i,r,n){Bt(t,s,i,r,e,n)}},{tempPointBounds:Ct,setPoint:Tt,addPoint:Pt,toBounds:Ot}=mt,{toOuterPoint:Et}=Z,{float:Lt,fourNumber:At}=D,{floor:It,ceil:Wt}=Math;let Mt,Dt,Ft,zt;const Nt={},Yt={},Xt={},Ut={tempBounds:Xt,set(t,e=0,s=0,i=0,r=0){t.x=e,t.y=s,t.width=i,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,i,r){const{x:n,y:o,width:a,height:h}=e;if(l(s)){const e=At(s);i?jt.set(t,n+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):jt.set(t,n-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else i&&(s=-s),jt.set(t,n-s,o-s,a+2*s,h+2*s);r&&("width"===r?(t.y=o,t.height=h):(t.x=n,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,s){t.x+=e,t.y+=s},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,s)=>(t=Object.assign({},t),jt.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Ht(e,t):e=t,s||(s=t),e.offsetX=jt.maxX(s),e.offsetY=jt.maxY(s),jt.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,i){i||lt.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,i=s){lt.scaleOf(t,e,s,i),t.width*=s,t.height*=i},tempToOuterOf:(t,e)=>(jt.copy(Xt,t),jt.toOuterOf(Xt,e),Xt),getOuterOf:(t,e)=>(t=Object.assign({},t),jt.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:i,d:r,e:n,f:o}=e;i>0?(s.width=t.width*i,s.x=n+t.x*i):(s.width=t.width*-i,s.x=n+t.x*i-s.width),r>0?(s.height=t.height*r,s.y=o+t.y*r):(s.height=t.height*-r,s.y=o+t.y*r-s.height)}else Nt.x=t.x,Nt.y=t.y,Et(e,Nt,Yt),Tt(Ct,Yt.x,Yt.y),Nt.x=t.x+t.width,Et(e,Nt,Yt),Pt(Ct,Yt.x,Yt.y),Nt.y=t.y+t.height,Et(e,Nt,Yt),Pt(Ct,Yt.x,Yt.y),Nt.x=t.x,Et(e,Nt,Yt),Pt(Ct,Yt.x,Yt.y),Ot(Ct,s)},toInnerOf(t,e,s){s||(s=t),jt.move(s,-e.e,-e.f),jt.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const i=Math.min(s,jt.getFitScale(t,e));return new ft(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,s){const i=t.width/e.width,r=t.height/e.height;return s?Math.max(i,r):Math.min(i,r)},put(t,e,s="center",i=1,n=!0,o){o||(o=e),r(i)&&(i=jt.getFitScale(t,e,"cover"===i)),Xt.width=n?e.width*=i:e.width*i,Xt.height=n?e.height*=i:e.height*i,Rt.toPoint(s,Xt,t,o,!0,!0)},getSpread(t,e,s){const i={};return jt.copyAndSpread(i,t,e,!1,s),i},spread(t,e,s){jt.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){jt.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=It(t.x),t.y=It(t.y),t.width=e>t.x?Wt(t.width+e-t.x):Wt(t.width),t.height=s>t.y?Wt(t.height+s-t.y):Wt(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=Lt(t.x,e),t.y=Lt(t.y,e),t.width=Lt(t.width,e),t.height=Lt(t.height,e)},add(t,e,s){Mt=t.x+t.width,Dt=t.y+t.height,Ft=e.x,zt=e.y,s||(Ft+=e.width,zt+=e.height),Mt=Mt>Ft?Mt:Ft,Dt=Dt>zt?Dt:zt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=Mt-t.x,t.height=Dt-t.y},addList(t,e){jt.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){jt.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){jt.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,i=!1){let r,n=!0;for(let o=0,a=e.length;o<a;o++)r=s?s(e[o],o):e[o],r&&(r.width||r.height)&&(n?(n=!1,i||Ht(t,r)):Vt(t,r));n&&jt.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Tt(Ct,t.x,t.y):Pt(Ct,t.x,t.y)),Ot(Ct,t)},setPoint(t,e){jt.set(t,e.x,e.y)},addPoint(t,e){Vt(t,e,!0)},getPoints(t){const{x:e,y:s,width:i,height:r}=t;return[{x:e,y:s},{x:e+i,y:s},{x:e+i,y:s+r},{x:e,y:s+r}]},hitRadiusPoint:(t,e,s)=>(s&&(e=lt.tempToInnerRadiusPointOf(e,s)),e.x>=t.x-e.radiusX&&e.x<=t.x+t.width+e.radiusX&&e.y>=t.y-e.radiusY&&e.y<=t.y+t.height+e.radiusY),hitPoint:(t,e,s)=>(s&&(e=lt.tempToInnerOf(e,s)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,s)=>(s&&(e=jt.tempToOuterOf(e,s)),!(t.y+t.height<e.y||e.y+e.height<t.y||t.x+t.width<e.x||e.x+e.width<t.x)),includes:(t,e,s)=>(s&&(e=jt.tempToOuterOf(e,s)),t.x<=e.x&&t.y<=e.y&&t.x+t.width>=e.x+e.width&&t.y+t.height>=e.y+e.height),getIntersectData(t,e,s){if(s&&(e=jt.tempToOuterOf(e,s)),!jt.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:n,height:o}=e;return Mt=i+n,Dt=r+o,Ft=t.x+t.width,zt=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,Mt=Mt<Ft?Mt:Ft,Dt=Dt<zt?Dt:zt,n=Mt-i,o=Dt-r,{x:i,y:r,width:n,height:o}},intersect(t,e,s){jt.copy(t,jt.getIntersectData(t,e,s))},isSame:(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEmpty:t=>0===t.x&&0===t.y&&0===t.width&&0===t.height,reset(t){jt.set(t)}},jt=Ut,{add:Vt,copy:Ht}=jt;class Gt{get minX(){return Ut.minX(this)}get minY(){return Ut.minY(this)}get maxX(){return Ut.maxX(this)}get maxY(){return Ut.maxY(this)}constructor(t,e,s,i){this.set(t,e,s,i)}set(t,e,s,i){return d(t)?Ut.copy(this,t):Ut.set(this,t,e,s,i),this}get(){const{x:t,y:e,width:s,height:i}=this;return{x:t,y:e,width:s,height:i}}clone(){return new Gt(this)}move(t,e){return Ut.move(this,t,e),this}scale(t,e,s){return Ut.scale(this,t,e,s),this}scaleOf(t,e,s){return Ut.scaleOf(this,t,e,s),this}toOuterOf(t,e){return Ut.toOuterOf(this,t,e),this}toInnerOf(t,e){return Ut.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Ut.getFitMatrix(this,t,e)}put(t,e,s){Ut.put(this,t,e,s)}spread(t,e){return Ut.spread(this,t,e),this}shrink(t,e){return Ut.shrink(this,t,e),this}ceil(){return Ut.ceil(this),this}unsign(){return Ut.unsign(this),this}float(t){return Ut.float(this,t),this}add(t){return Ut.add(this,t),this}addList(t){return Ut.setList(this,t,!0),this}setList(t){return Ut.setList(this,t),this}addListWithFn(t,e){return Ut.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Ut.setListWithFn(this,t,e),this}setPoint(t){return Ut.setPoint(this,t),this}setPoints(t){return Ut.setPoints(this,t),this}addPoint(t){return Ut.addPoint(this,t),this}getPoints(){return Ut.getPoints(this)}hitPoint(t,e){return Ut.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Ut.hitRadiusPoint(this,t,e)}hit(t,e){return Ut.hit(this,t,e)}includes(t,e){return Ut.includes(this,t,e)}intersect(t,e){return Ut.intersect(this,t,e),this}getIntersect(t,e){return new Gt(Ut.getIntersectData(this,t,e))}isSame(t){return Ut.isSame(this,t)}isEmpty(){return Ut.isEmpty(this)}reset(){Ut.reset(this)}}const qt=new Gt;class Qt{constructor(t,e,s,i,r,n){d(t)?this.copy(t):this.set(t,e,s,i,r,n)}set(t=0,e=0,s=0,i=0,r=0,n=0){this.top=t,this.right=e,this.bottom=s,this.left=i,this.width=r,this.height=n}copy(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=t;this.set(e,s,i,r,n,o)}getBoundsFrom(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=this;return new Gt(r,e,n||t.width-r-s,o||t.height-e-i)}}const Jt={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{randColor:$t}=D;class Zt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new Zt(t)}static set filter(t){this.filterList=Kt(t)}static set exclude(t){this.excludeList=Kt(t)}static drawRepaint(t,e){const s=$t();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const i="hit"===Zt.showBounds,r=t.__nowWorld,n=$t();i&&(e.setWorld(r),t.__drawHitPath(e),e.fillStyle=n.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(n,2),i?e.stroke():e.strokeWorld(r,n)}log(...t){if(te.enable){if(te.filterList.length&&te.filterList.every(t=>t!==this.name))return;if(te.excludeList.length&&te.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){te.enable&&this.warn(...t)}warn(...t){te.showWarn&&console.warn(this.name,...t)}repeat(t,...e){this.repeatMap[t]||(this.warn("repeat:"+t,...e),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(e){console.error(this.name,...t,e)}}}function Kt(t){return t?r(t)&&(t=[t]):t=[],t}Zt.filterList=[],Zt.excludeList=[],Zt.showWarn=!0;const te=Zt,ee=Zt.get("RunTime"),se={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const s=w.create(w.RUNTIME);return ie.currentId=ie.idMap[s]=e?performance.now():Date.now(),ie.currentName=ie.nameMap[s]=t,ie.nameToIdMap[t]=s,s},end(t,e){const s=ie.idMap[t],i=ie.nameMap[t],r=e?(performance.now()-s)/1e3:Date.now()-s;ie.idMap[t]=ie.nameMap[t]=ie.nameToIdMap[i]=void 0,ee.log(i,r,"ms")},endOfName(t,e){const i=ie.nameToIdMap[t];s(i)||ie.end(i,e)}},ie=se,re=[],ne={list:{},add(t,...e){this.list[t]=!0,re.push(...e)},has(t,e){const s=this.list[t];return!s&&e&&this.need(t),s},need(t){console.error("please install and import plugin: "+(t.includes("-x")?"":"@leafer-in/")+t)}};setTimeout(()=>re.forEach(t=>ne.has(t,!0)));const oe={editor:t=>ne.need("editor")},ae=Zt.get("UICreator"),he={list:{},register(t){const{__tag:e}=t.prototype;le[e]&&ae.repeat(e),le[e]=t},get(t,e,i,r,n,o){le[t]||ae.error("not register "+t);const a=new le[t](e);return s(i)||(a.x=i,r&&(a.y=r),n&&(a.width=n),o&&(a.height=o)),a}},{list:le}=he,de=Zt.get("EventCreator"),ce={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],r(e)&&(ue[e]&&de.repeat(e),ue[e]=t)})},changeName(t,e){const s=ue[t];if(s){const i=Object.keys(s).find(e=>s[e]===t);i&&(s[i]=e,ue[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new ue[t](...e)},{nameList:ue}=ce;class _e{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:s}=this;for(let i=0,r=s.length;i<r;i++)if(e=s[i],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const i=oe.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,i=this.list.length;s<i;s++)t=this.list[s],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}}function pe(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o}function ge(t,e,s,i){return new(s||(s=Promise))(function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}h((i=i.apply(t,e||[])).next())})}function fe(t){return(e,s)=>{t||(t=s);const i={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===s&&(i.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,s,i)}}"function"==typeof SuppressedError&&SuppressedError;const ye=[];function me(){return(t,e)=>{ye.push(e)}}const xe=[];let we=class{set blendMode(t){"normal"===t&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||xe)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;ye.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,i,r,n){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,i,r,n){d(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,i,r,n)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,i){}strokeRect(t,e,s,i){}clearRect(t,e,s,i){}drawImage(t,e,s,i,r,n,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,n+=t,a-=t}if(s<0){const t=-s/r*h;r+=s,s=0,o+=t,h-=t}this.context.drawImage(t,e,s,i,r,n,o,a,h);break;case 5:this.context.drawImage(t,e,s,i,r);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,i,r,n){}quadraticCurveTo(t,e,s,i){}closePath(){}arc(t,e,s,i,r,n){}arcTo(t,e,s,i,r){}ellipse(t,e,s,i,r,n,o,a){}rect(t,e,s,i){}roundRect(t,e,s,i,r){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,i){}createPattern(t,e){}createRadialGradient(t,e,s,i,r,n){}fillText(t,e,s,i){}measureText(t){}strokeText(t,e,s,i){}destroy(){this.context=null}};pe([fe("imageSmoothingEnabled")],we.prototype,"smooth",void 0),pe([fe("imageSmoothingQuality")],we.prototype,"smoothLevel",void 0),pe([fe("globalAlpha")],we.prototype,"opacity",void 0),pe([fe()],we.prototype,"fillStyle",void 0),pe([fe()],we.prototype,"strokeStyle",void 0),pe([fe("lineWidth")],we.prototype,"strokeWidth",void 0),pe([fe("lineCap")],we.prototype,"strokeCap",void 0),pe([fe("lineJoin")],we.prototype,"strokeJoin",void 0),pe([fe("lineDashOffset")],we.prototype,"dashOffset",void 0),pe([fe()],we.prototype,"miterLimit",void 0),pe([fe()],we.prototype,"shadowBlur",void 0),pe([fe()],we.prototype,"shadowColor",void 0),pe([fe()],we.prototype,"shadowOffsetX",void 0),pe([fe()],we.prototype,"shadowOffsetY",void 0),pe([fe()],we.prototype,"filter",void 0),pe([fe()],we.prototype,"font",void 0),pe([fe()],we.prototype,"fontKerning",void 0),pe([fe()],we.prototype,"fontStretch",void 0),pe([fe()],we.prototype,"fontVariantCaps",void 0),pe([fe()],we.prototype,"textAlign",void 0),pe([fe()],we.prototype,"textBaseline",void 0),pe([fe()],we.prototype,"textRendering",void 0),pe([fe()],we.prototype,"wordSpacing",void 0),pe([fe()],we.prototype,"letterSpacing",void 0),pe([fe()],we.prototype,"direction",void 0),pe([me()],we.prototype,"setTransform",null),pe([me()],we.prototype,"resetTransform",null),pe([me()],we.prototype,"getTransform",null),pe([me()],we.prototype,"save",null),pe([me()],we.prototype,"restore",null),pe([me()],we.prototype,"translate",null),pe([me()],we.prototype,"scale",null),pe([me()],we.prototype,"rotate",null),pe([me()],we.prototype,"fill",null),pe([me()],we.prototype,"stroke",null),pe([me()],we.prototype,"clip",null),pe([me()],we.prototype,"fillRect",null),pe([me()],we.prototype,"strokeRect",null),pe([me()],we.prototype,"clearRect",null),pe([me()],we.prototype,"beginPath",null),pe([me()],we.prototype,"moveTo",null),pe([me()],we.prototype,"lineTo",null),pe([me()],we.prototype,"bezierCurveTo",null),pe([me()],we.prototype,"quadraticCurveTo",null),pe([me()],we.prototype,"closePath",null),pe([me()],we.prototype,"arc",null),pe([me()],we.prototype,"arcTo",null),pe([me()],we.prototype,"ellipse",null),pe([me()],we.prototype,"rect",null),pe([me()],we.prototype,"roundRect",null),pe([me()],we.prototype,"createConicGradient",null),pe([me()],we.prototype,"createLinearGradient",null),pe([me()],we.prototype,"createPattern",null),pe([me()],we.prototype,"createRadialGradient",null),pe([me()],we.prototype,"fillText",null),pe([me()],we.prototype,"measureText",null),pe([me()],we.prototype,"strokeText",null);const{copy:ve,multiplyParent:be,pixelScale:ke}=Z,{round:Se}=Math,Be=new Gt,Re=new Gt,Ce={width:1,height:1,pixelRatio:1},Te=["width","height","pixelRatio"];class Pe extends we{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,e){super(),this.size={},this.worldTransform={},t||(t=Ce),this.manager=e,this.innerId=w.create(w.CNAVAS);const{width:s,height:i,pixelRatio:r}=t;this.autoLayout=!s||!i,this.size.pixelRatio=r||m.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&e&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;_.copyAttrs(i,t,Te),Te.forEach(t=>i[t]||(i[t]=1)),this.bounds=new Gt(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&s&&(this.clearWorld(s.bounds),this.copyWorld(s),s.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s,pixelSnap:i}=this,r=this.worldTransform;e&&be(t,e,r),ke(t,s,r),i&&!t.ignorePixelSnap&&(t.half&&t.half*s%2?(r.e=Se(r.e-.5)+.5,r.f=Se(r.f-.5)+.5):(r.e=Se(r.e),r.f=Se(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,s,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,e){let{strokeCap:i,strokeJoin:r,dashPattern:n,dashOffset:o,miterLimit:a}=t;e&&(e.strokeCap&&(i=e.strokeCap),e.strokeJoin&&(r=e.strokeJoin),s(e.dashPattern)||(n=e.dashPattern),s(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=i,this.strokeJoin=r,this.dashPattern=n,this.dashOffset=o,this.miterLimit=a}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,s=1){return!0}setWorldShadow(t,e,s,i){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=s*r,this.shadowColor=i||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,i,r=!0){i&&(this.blendMode=i),e?(this.setTempPixelBounds(e,r),s?(this.setTempPixelBounds2(s,r),s=Re):s=Be,this.drawImage(t.view,Be.x,Be.y,Be.width,Be.height,s.x,s.y,s.width,s.height)):this.drawImage(t.view,0,0),i&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,i,r=!0){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Ut.tempToOuterOf(s,e),i,r),this.restore()):(i&&(this.blendMode=i),this.setTempPixelBounds(e,r),this.drawImage(t.view,Be.x,Be.y,Be.width,Be.height,s.x,s.y,s.width,s.height),i&&(this.blendMode="source-over"))}copyWorldByReset(t,e,s,i,r,n=!0){this.resetTransform(),this.copyWorld(t,e,s,i,n),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,s;this.setTempPixelBounds(t,!0,!0);const{context:i}=this,r=i.getImageData(Be.x,Be.y,Be.width,Be.height),{data:n}=r;for(let t=0,i=n.length;t<i;t+=4)s=.299*n[t]+.587*n[t+1]+.114*n[t+2],(e=n[t+3])&&(n[t+3]=255===e?s:e*(s/255));i.putImageData(r,Be.x,Be.y)}useMask(t,e,s){this.copyWorld(t,e,s,"destination-in")}useEraser(t,e,s){this.copyWorld(t,e,s,"destination-out")}fillWorld(t,e,s,i){s&&(this.blendMode=s),this.fillStyle=e,this.setTempPixelBounds(t,i),this.fillRect(Be.x,Be.y,Be.width,Be.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s,i){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempPixelBounds(t,i),this.strokeRect(Be.x,Be.y,Be.width,Be.height),s&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Be.x,Be.y,Be.width,Be.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Be.x,Be.y,Be.width,Be.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,s){this.copyToPixelBounds(Be,t,e,s)}setTempPixelBounds2(t,e,s){this.copyToPixelBounds(Re,t,e,s)}copyToPixelBounds(t,e,s,i){t.set(e),i&&t.intersect(this.bounds),t.scale(this.pixelRatio),s&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:s,pixelSnap:i}=this,r=this.manager?this.manager.get(s):oe.canvas(Object.assign({},s));return r.save(),t&&(ve(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==i&&(r.pixelSnap=i),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}}const Oe={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Ee={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Le=Object.assign({M:1,m:10,L:2,l:20,H:3,h:30,V:4,v:40,C:5,c:50,S:6,s:60,Q:7,q:70,T:8,t:80,A:9,a:90,Z:11,z:11,R:12},Ee),Ae={M:3,m:3,L:3,l:3,H:2,h:2,V:2,v:2,C:7,c:7,S:5,s:5,Q:5,q:5,T:3,t:3,A:8,a:8,Z:1,z:1,N:5,D:9,X:6,G:9,F:5,O:7,P:4,U:6},Ie={m:10,l:20,H:3,h:30,V:4,v:40,c:50,S:6,s:60,q:70,T:8,t:80,A:9,a:90},We=Object.assign(Object.assign({},Ie),Ee),Me=Le,De={};for(let t in Me)De[Me[t]]=t;const Fe={};for(let t in Me)Fe[Me[t]]=Ae[t];const ze={drawRoundRect(t,e,s,i,r,n){const o=D.fourNumber(n,Math.min(i/2,r/2)),a=e+i,h=s+r;o[0]?t.moveTo(e+o[0],s):t.moveTo(e,s),o[1]?t.arcTo(a,s,a,h,o[1]):t.lineTo(a,s),o[2]?t.arcTo(a,h,e,h,o[2]):t.lineTo(a,h),o[3]?t.arcTo(e,h,e,s,o[3]):t.lineTo(e,h),o[0]?t.arcTo(e,s,a,s,o[0]):t.lineTo(e,s)}},{sin:Ne,cos:Ye,hypot:Xe,atan2:Ue,ceil:je,abs:Ve,PI:He,sqrt:Ge,pow:qe}=Math,{setPoint:Qe,addPoint:Je}=mt,{set:$e,toNumberPoints:Ze}=lt,{M:Ke,L:ts,C:es,Q:ss,Z:is}=Le,rs={},ns={points(t,e,s,i){let r=Ze(e);if(t.push(Ke,r[0],r[1]),s&&r.length>5){let e,n,o,a,h,l,d,c,u,_,p,g,f,y=r.length;const m=!0===s?.5:s;i&&(r=[r[y-2],r[y-1],...r,r[0],r[1],r[2],r[3]],y=r.length);for(let s=2;s<y-2;s+=2)e=r[s-2],n=r[s-1],o=r[s],a=r[s+1],h=r[s+2],l=r[s+3],p=Ge(qe(o-e,2)+qe(a-n,2)),g=Ge(qe(h-o,2)+qe(l-a,2)),(p||g)&&(f=p+g,p=m*p/f,g=m*g/f,h-=e,l-=n,d=o-p*h,c=a-p*l,2===s?i||t.push(ss,d,c,o,a):t.push(es,u,_,d,c,o,a),u=o+g*h,_=a+g*l);i||t.push(ss,u,_,r[y-2],r[y-1])}else for(let e=2,s=r.length;e<s;e+=2)t.push(ts,r[e],r[e+1]);i&&t.push(is)},rect(t,e,s,i,r){Oe.creator.path=t,Oe.creator.moveTo(e,s).lineTo(e+i,s).lineTo(e+i,s+r).lineTo(e,s+r).lineTo(e,s)},roundRect(t,e,s,i,r,n){Oe.creator.path=[],ze.drawRoundRect(Oe.creator,e,s,i,r,n),t.push(...Oe.convertToCanvasData(Oe.creator.path,!0))},arcTo(t,e,s,i,r,n,o,a,h,l,d){const c=i-e,u=r-s,_=n-i,p=o-r;let g=Ue(u,c),f=Ue(p,_);const y=Xe(c,u),m=Xe(_,p);let x=f-g;if(x<0&&(x+=N),y<1e-12||m<1e-12||x<1e-12||Ve(x-He)<1e-12)return t&&t.push(ts,i,r),h&&(Qe(h,e,s),Je(h,i,r)),d&&$e(d,e,s),void(l&&$e(l,i,r));const w=c*p-_*u<0,v=w?-1:1,b=a/Ye(x/2),k=i+b*Ye(g+x/2+Y*v),S=r+b*Ne(g+x/2+Y*v);return g-=Y*v,f-=Y*v,hs(t,k,S,a,a,0,g/z,f/z,w,h,l,d)},arc:(t,e,s,i,r,n,o,a,h,l)=>hs(t,e,s,i,i,0,r,n,o,a,h,l),ellipse(t,e,s,i,r,n,o,a,h,l,d,c){const u=n*z,_=Ne(u),p=Ye(u);let g=o*z,f=a*z;g>He&&(g-=N),f<0&&(f+=N);let y=f-g;y<0?y+=N:y>N&&(y-=N),h&&(y-=N);const m=je(Ve(y/Y)),x=y/m,w=Ne(x/4),v=8/3*w*w/Ne(x/2);f=g+x;let b,k,S,B,R,C,T,P,O=Ye(g),E=Ne(g),L=S=p*i*O-_*r*E,A=B=_*i*O+p*r*E,I=e+S,W=s+B;t&&t.push(t.length?ts:Ke,I,W),l&&Qe(l,I,W),c&&$e(c,I,W);for(let n=0;n<m;n++)b=Ye(f),k=Ne(f),S=p*i*b-_*r*k,B=_*i*b+p*r*k,R=e+L-v*(p*i*E+_*r*O),C=s+A-v*(_*i*E-p*r*O),T=e+S+v*(p*i*k+_*r*b),P=s+B+v*(_*i*k-p*r*b),t&&t.push(es,R,C,T,P,e+S,s+B),l&&as(e+L,s+A,R,C,T,P,e+S,s+B,l,!0),L=S,A=B,O=b,E=k,g=f,f+=x;d&&$e(d,e+S,s+B)},quadraticCurveTo(t,e,s,i,r,n,o){t.push(es,(e+2*i)/3,(s+2*r)/3,(n+2*i)/3,(o+2*r)/3,n,o)},toTwoPointBoundsByQuadraticCurve(t,e,s,i,r,n,o,a){as(t,e,(t+2*s)/3,(e+2*i)/3,(r+2*s)/3,(n+2*i)/3,r,n,o,a)},toTwoPointBounds(t,e,s,i,r,n,o,a,h,l){const d=[];let c,u,_,p,g,f,y,m,x=t,w=s,v=r,b=o;for(let t=0;t<2;++t)if(1==t&&(x=e,w=i,v=n,b=a),c=-3*x+9*w-9*v+3*b,u=6*x-12*w+6*v,_=3*w-3*x,Math.abs(c)<1e-12){if(Math.abs(u)<1e-12)continue;p=-_/u,0<p&&p<1&&d.push(p)}else y=u*u-4*_*c,m=Math.sqrt(y),y<0||(g=(-u+m)/(2*c),0<g&&g<1&&d.push(g),f=(-u-m)/(2*c),0<f&&f<1&&d.push(f));l?Je(h,t,e):Qe(h,t,e),Je(h,o,a);for(let l=0,c=d.length;l<c;l++)os(d[l],t,e,s,i,r,n,o,a,rs),Je(h,rs.x,rs.y)},getPointAndSet(t,e,s,i,r,n,o,a,h,l){const d=1-t,c=d*d*d,u=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=c*e+u*i+_*n+p*a,l.y=c*s+u*r+_*o+p*h},getPoint(t,e,s,i,r,n,o,a,h){const l={};return os(t,e,s,i,r,n,o,a,h,l),l},getDerivative(t,e,s,i,r){const n=1-t;return 3*n*n*(s-e)+6*n*t*(i-s)+3*t*t*(r-i)}},{getPointAndSet:os,toTwoPointBounds:as,ellipse:hs}=ns,{sin:ls,cos:ds,sqrt:cs,atan2:us}=Math,{ellipse:_s}=ns,ps={ellipticalArc(t,e,s,i,r,n,o,a,h,l,d){const c=(h-e)/2,u=(l-s)/2,_=n*z,p=ls(_),g=ds(_),f=-g*c-p*u,y=-g*u+p*c,x=i*i,w=r*r,v=y*y,b=f*f,k=x*w-x*v-w*b;let S=0;if(k<0){const t=cs(1-k/(x*w));i*=t,r*=t}else S=(o===a?-1:1)*cs(k/(x*v+w*b));const B=S*i*y/r,R=-S*r*f/i,C=us((y-R)/r,(f-B)/i),T=us((-y-R)/r,(-f-B)/i);let P=T-C;0===a&&P>0?P-=N:1===a&&P<0&&(P+=N);const O=e+c+g*B-p*R,E=s+u+p*B+g*R,L=P<0?1:0;d||m.ellipseToCurve?_s(t,O,E,i,r,n,C/z,T/z,L):i!==r||n?t.push(Le.G,O,E,i,r,n,C/z,T/z,L):t.push(Le.O,O,E,i,C/z,T/z,L)}},{M:gs,m:fs,L:ys,l:ms,H:xs,h:ws,V:vs,v:bs,C:ks,c:Ss,S:Bs,s:Rs,Q:Cs,q:Ts,T:Ps,t:Os,A:Es,a:Ls,Z:As,z:Is,N:Ws,D:Ms,X:Ds,G:Fs,F:zs,O:Ns,P:Ys,U:Xs}=Le,{rect:Us,roundRect:js,arcTo:Vs,arc:Hs,ellipse:Gs,quadraticCurveTo:qs}=ns,{ellipticalArc:Qs}=ps,Js=Zt.get("PathConvert"),$s={},Zs={current:{dot:0},stringify(t,e){let s,i,r,n=0,o=t.length,a="";for(;n<o;){i=t[n],s=Fe[i],a+=i===r?" ":De[i];for(let i=1;i<s;i++)a+=D.float(t[n+i],e),i===s-1||(a+=" ");r=i,n+=s}return a},parse(t,e){let s,i,r,n="";const o=[],a=e?We:Ie;for(let e=0,h=t.length;e<h;e++)i=t[e],Jt[i]?("."===i&&(Ks.dot&&(ti(o,n),n=""),Ks.dot++),"0"===n&&"."!==i&&(ti(o,n),n=""),n+=i):Le[i]?(n&&(ti(o,n),n=""),Ks.name=Le[i],Ks.length=Ae[i],Ks.index=0,ti(o,Ks.name),!s&&a[i]&&(s=!0)):"-"===i||"+"===i?"e"===r||"E"===r?n+=i:(n&&ti(o,n),n=i):n&&(ti(o,n),n=""),r=i;return n&&ti(o,n),s?Zs.toCanvasData(o,e):o},toCanvasData(t,e){let s,i,r,n,o,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(r=t[c],r){case fs:t[c+1]+=a,t[c+2]+=h;case gs:a=t[c+1],h=t[c+2],_.push(gs,a,h),c+=3;break;case ws:t[c+1]+=a;case xs:a=t[c+1],_.push(ys,a,h),c+=2;break;case bs:t[c+1]+=h;case vs:h=t[c+1],_.push(ys,a,h),c+=2;break;case ms:t[c+1]+=a,t[c+2]+=h;case ys:a=t[c+1],h=t[c+2],_.push(ys,a,h),c+=3;break;case Rs:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Bs;case Bs:o=n===ks||n===Bs,l=o?2*a-s:t[c+1],d=o?2*h-i:t[c+2],s=t[c+1],i=t[c+2],a=t[c+3],h=t[c+4],_.push(ks,l,d,s,i,a,h),c+=5;break;case Ss:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,t[c+5]+=a,t[c+6]+=h,r=ks;case ks:s=t[c+3],i=t[c+4],a=t[c+5],h=t[c+6],_.push(ks,t[c+1],t[c+2],s,i,a,h),c+=7;break;case Os:t[c+1]+=a,t[c+2]+=h,r=Ps;case Ps:o=n===Cs||n===Ps,s=o?2*a-s:t[c+1],i=o?2*h-i:t[c+2],e?qs(_,a,h,s,i,t[c+1],t[c+2]):_.push(Cs,s,i,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case Ts:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Cs;case Cs:s=t[c+1],i=t[c+2],e?qs(_,a,h,s,i,t[c+3],t[c+4]):_.push(Cs,s,i,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case Ls:t[c+6]+=a,t[c+7]+=h;case Es:Qs(_,a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],e),a=t[c+6],h=t[c+7],c+=8;break;case Is:case As:_.push(As),c++;break;case Ws:a=t[c+1],h=t[c+2],e?Us(_,a,h,t[c+3],t[c+4]):ei(_,t,c,5),c+=5;break;case Ms:a=t[c+1],h=t[c+2],e?js(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):ei(_,t,c,9),c+=9;break;case Ds:a=t[c+1],h=t[c+2],e?js(_,a,h,t[c+3],t[c+4],t[c+5]):ei(_,t,c,6),c+=6;break;case Fs:Gs(e?_:ei(_,t,c,9),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],t[c+8],null,$s),a=$s.x,h=$s.y,c+=9;break;case zs:e?Gs(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):ei(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case Ns:Hs(e?_:ei(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,$s),a=$s.x,h=$s.y,c+=7;break;case Ys:e?Hs(_,t[c+1],t[c+2],t[c+3],0,360,!1):ei(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case Xs:Vs(e?_:ei(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,$s),a=$s.x,h=$s.y,c+=6;break;default:return Js.error(`command: ${r} [index:${c}]`,t),_}n=r}return _},objectToCanvasData(t){const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(gs,t.x,t.y);break;case"L":e.push(ys,t.x,t.y);break;case"C":e.push(ks,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Cs,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(As)}}),e},copyData(t,e,s,i){for(let r=s,n=s+i;r<n;r++)t.push(e[r])},pushData(t,e){Ks.index===Ks.length&&(Ks.index=1,t.push(Ks.name)),t.push(Number(e)),Ks.index++,Ks.dot=0}},{current:Ks,pushData:ti,copyData:ei}=Zs,{M:si,L:ii,C:ri,Q:ni,Z:oi,N:ai,D:hi,X:li,G:di,F:ci,O:ui,P:_i,U:pi}=Le,{getMinDistanceFrom:gi,getRadianFrom:fi}=lt,{tan:yi,min:mi,abs:xi}=Math,wi={},vi={beginPath(t){t.length=0},moveTo(t,e,s){t.push(si,e,s)},lineTo(t,e,s){t.push(ii,e,s)},bezierCurveTo(t,e,s,i,r,n,o){t.push(ri,e,s,i,r,n,o)},quadraticCurveTo(t,e,s,i,r){t.push(ni,e,s,i,r)},closePath(t){t.push(oi)},rect(t,e,s,i,r){t.push(ai,e,s,i,r)},roundRect(t,e,s,i,r,n){if(o(n))t.push(li,e,s,i,r,n);else{const o=D.fourNumber(n);o?t.push(hi,e,s,i,r,...o):t.push(ai,e,s,i,r)}},ellipse(t,e,s,r,n,o,a,h,l){i(o)?t.push(ci,e,s,r,n):(i(a)&&(a=0),i(h)&&(h=360),t.push(di,e,s,r,n,o,a,h,l?1:0))},arc(t,e,s,r,n,o,a){i(n)?t.push(_i,e,s,r):(i(o)&&(o=360),t.push(ui,e,s,r,n,o,a?1:0))},arcTo(t,e,i,r,n,o,a,h){if(!s(a)){const t=gi(a,h,e,i,r,n);o=mi(o,mi(t/2,t/2*xi(yi(fi(a,h,e,i,r,n)/2))))}t.push(pi,e,i,r,n,o)},drawEllipse(t,e,s,r,n,o,a,h,l){ns.ellipse(null,e,s,r,n,i(o)?0:o,i(a)?0:a,i(h)?360:h,l,null,null,wi),t.push(si,wi.x,wi.y),bi(t,e,s,r,n,o,a,h,l)},drawArc(t,e,s,r,n,o,a){ns.arc(null,e,s,r,i(n)?0:n,i(o)?360:o,a,null,null,wi),t.push(si,wi.x,wi.y),ki(t,e,s,r,n,o,a)},drawPoints(t,e,s,i){ns.points(t,e,s,i)}},{ellipse:bi,arc:ki}=vi,{moveTo:Si,lineTo:Bi,quadraticCurveTo:Ri,bezierCurveTo:Ci,closePath:Ti,beginPath:Pi,rect:Oi,roundRect:Ei,ellipse:Li,arc:Ai,arcTo:Ii,drawEllipse:Wi,drawArc:Mi,drawPoints:Di}=vi;class Fi{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?r(t)?Oe.parse(t):t:[],this}beginPath(){return Pi(this.__path),this.paint(),this}moveTo(t,e){return Si(this.__path,t,e),this.paint(),this}lineTo(t,e){return Bi(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,i,r,n){return Ci(this.__path,t,e,s,i,r,n),this.paint(),this}quadraticCurveTo(t,e,s,i){return Ri(this.__path,t,e,s,i),this.paint(),this}closePath(){return Ti(this.__path),this.paint(),this}rect(t,e,s,i){return Oi(this.__path,t,e,s,i),this.paint(),this}roundRect(t,e,s,i,r){return Ei(this.__path,t,e,s,i,r),this.paint(),this}ellipse(t,e,s,i,r,n,o,a){return Li(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}arc(t,e,s,i,r,n){return Ai(this.__path,t,e,s,i,r,n),this.paint(),this}arcTo(t,e,s,i,r){return Ii(this.__path,t,e,s,i,r),this.paint(),this}drawEllipse(t,e,s,i,r,n,o,a){return Wi(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}drawArc(t,e,s,i,r,n){return Mi(this.__path,t,e,s,i,r,n),this.paint(),this}drawPoints(t,e,s){return Di(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:zi,L:Ni,C:Yi,Q:Xi,Z:Ui,N:ji,D:Vi,X:Hi,G:Gi,F:qi,O:Qi,P:Ji,U:$i}=Le,Zi=Zt.get("PathDrawer"),Ki={drawPathByData(t,e){if(!e)return;let s,i=0,r=e.length;for(;i<r;)switch(s=e[i],s){case zi:t.moveTo(e[i+1],e[i+2]),i+=3;break;case Ni:t.lineTo(e[i+1],e[i+2]),i+=3;break;case Yi:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case Xi:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Ui:t.closePath(),i+=1;break;case ji:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Vi:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],[e[i+5],e[i+6],e[i+7],e[i+8]]),i+=9;break;case Hi:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case Gi:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*z,e[i+6]*z,e[i+7]*z,e[i+8]),i+=9;break;case qi:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,N,!1),i+=5;break;case Qi:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*z,e[i+5]*z,e[i+6]),i+=7;break;case Ji:t.arc(e[i+1],e[i+2],e[i+3],0,N,!1),i+=4;break;case $i:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void Zi.error(`command: ${s} [index:${i}]`,e)}}},{M:tr,L:er,C:sr,Q:ir,Z:rr,N:nr,D:or,X:ar,G:hr,F:lr,O:dr,P:cr,U:ur}=Le,{toTwoPointBounds:_r,toTwoPointBoundsByQuadraticCurve:pr,arcTo:gr,arc:fr,ellipse:yr}=ns,{addPointBounds:mr,copy:xr,addPoint:wr,setPoint:vr,addBounds:br,toBounds:kr}=mt,Sr=Zt.get("PathBounds");let Br,Rr,Cr;const Tr={},Pr={},Or={},Er={toBounds(t,e){Er.toTwoPointBounds(t,Pr),kr(Pr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return vr(e,0,0);let s,i,r,n,o,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(o=t[a],0===a&&(o===rr||o===sr||o===ir?vr(e,h,l):vr(e,t[a+1],t[a+2])),o){case tr:case er:h=t[a+1],l=t[a+2],wr(e,h,l),a+=3;break;case sr:r=t[a+5],n=t[a+6],_r(h,l,t[a+1],t[a+2],t[a+3],t[a+4],r,n,Tr),mr(e,Tr),h=r,l=n,a+=7;break;case ir:s=t[a+1],i=t[a+2],r=t[a+3],n=t[a+4],pr(h,l,s,i,r,n,Tr),mr(e,Tr),h=r,l=n,a+=5;break;case rr:a+=1;break;case nr:h=t[a+1],l=t[a+2],br(e,h,l,t[a+3],t[a+4]),a+=5;break;case or:case ar:h=t[a+1],l=t[a+2],br(e,h,l,t[a+3],t[a+4]),a+=o===or?9:6;break;case hr:yr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],Tr,Or),0===a?xr(e,Tr):mr(e,Tr),h=Or.x,l=Or.y,a+=9;break;case lr:h=t[a+1],l=t[a+2],Rr=t[a+3],Cr=t[a+4],br(e,h-Rr,l-Cr,2*Rr,2*Cr),h+=Rr,a+=5;break;case dr:fr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Tr,Or),0===a?xr(e,Tr):mr(e,Tr),h=Or.x,l=Or.y,a+=7;break;case cr:h=t[a+1],l=t[a+2],Br=t[a+3],br(e,h-Br,l-Br,2*Br,2*Br),h+=Br,a+=4;break;case ur:gr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Tr,Or),0===a?xr(e,Tr):mr(e,Tr),h=Or.x,l=Or.y,a+=6;break;default:return void Sr.error(`command: ${o} [index:${a}]`,t)}}},{M:Lr,L:Ar,Z:Ir}=Le,{getCenterX:Wr,getCenterY:Mr}=lt,{arcTo:Dr}=vi,Fr={smooth(t,e,s){let i,r,n,o=0,a=0,h=0,l=0,d=0,c=0,u=0,_=0,p=0;const g=t.length,f=[];for(;o<g;){switch(i=t[o],i){case Lr:l=_=t[o+1],d=p=t[o+2],o+=3,t[o]===Ar?(c=t[o+1],u=t[o+2],f.push(Lr,Wr(l,c),Mr(d,u))):f.push(Lr,l,d);break;case Ar:switch(a=t[o+1],h=t[o+2],o+=3,t[o]){case Ar:Dr(f,a,h,t[o+1],t[o+2],e,_,p);break;case Ir:Dr(f,a,h,l,d,e,_,p);break;default:f.push(Ar,a,h)}_=a,p=h;break;case Ir:r!==Ir&&(Dr(f,l,d,c,u,e,_,p),f.push(Ir)),o+=1;break;default:n=Fe[i];for(let e=0;e<n;e++)f.push(t[o+e]);o+=n}r=i}return i!==Ir&&(f[1]=l,f[2]=d),f}};function zr(t){return new Fi(t)}const Nr=zr();Oe.creator=zr(),Oe.parse=Zs.parse,Oe.convertToCanvasData=Zs.toCanvasData;const{drawRoundRect:Yr}=ze;function Xr(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,i,r){Yr(this,t,e,s,i,r)})}(t)}const Ur={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mineType:t=>!t||t.startsWith("image")?t:("jpg"===t&&(t="jpeg"),"image/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=jr.fileType(t);return["jpg","jpeg"].some(t=>t===e)},getExportOptions(t){switch(typeof t){case"object":return t;case"number":return{quality:t};case"boolean":return{blob:t};default:return{}}}},jr=Ur;jr.alphaPixelTypes.forEach(t=>jr.upperCaseTypeMap[t]=t.toUpperCase());const Vr=Zt.get("TaskProcessor");class Hr{constructor(t){this.parallel=!0,this.time=1,this.id=w.create(w.TASK),this.task=t}run(){return ge(this,void 0,void 0,function*(){try{if(this.isComplete)return;if(this.canUse&&!this.canUse())return this.cancel();this.task&&this.parent.running&&(yield this.task())}catch(t){Vr.error(t)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}}class Gr{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(e=s)):e+=this.list[i].time;return this.isComplete?1:s/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&_.assign(this.config,t),this.empty()}add(t,e,i){let r,n,a,h;const l=new Hr(t);return l.parent=this,o(e)?h=e:e&&(n=e.parallel,r=e.start,a=e.time,h=e.delay,i||(i=e.canUse)),a&&(l.time=a),!1===n&&(l.parallel=!1),i&&(l.canUse=i),s(h)?this.push(l,r):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(l,r))},h)),this.isComplete=!1,l}push(t,e){this.list.push(t),!1===e||this.timer||(this.timer=setTimeout(()=>this.start()))}empty(){this.index=0,this.parallelSuccessNumber=0,this.list=[],this.parallelList=[],this.delayNumber=0}start(){this.running||(this.running=!0,this.isComplete=!1,this.run())}pause(){clearTimeout(this.timer),this.timer=null,this.running=!1}resume(){this.start()}skip(){this.index++,this.resume()}stop(){this.isComplete=!0,this.list.forEach(t=>{t.isComplete||t.cancel()}),this.pause(),this.empty()}run(){this.running&&(this.setParallelList(),this.parallelList.length>1?this.runParallelTasks():this.remain?this.runTask():this.onComplete())}runTask(){const t=this.list[this.index];t?t.run().then(()=>{this.onTask(t),this.index++,t.isCancel?this.runTask():this.nextTask()}).catch(t=>{this.onError(t)}):this.timer=setTimeout(()=>this.nextTask())}runParallelTasks(){this.parallelList.forEach(t=>this.runParallelTask(t))}runParallelTask(t){t.run().then(()=>{this.onTask(t),this.fillParallelTask()}).catch(t=>{this.onParallelError(t)})}nextTask(){this.total===this.finishedIndex?this.onComplete():this.timer=setTimeout(()=>this.run())}setParallelList(){let t;const{config:e,list:s,index:i}=this;this.parallelList=[],this.parallelSuccessNumber=0;let r=i+e.parallel;if(r>s.length&&(r=s.length),e.parallel>1)for(let e=i;e<r&&(t=s[e],t.parallel);e++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const s=e.length,i=this.finishedIndex+s;if(e.length){if(!this.running)return;i<this.total&&(t=this.list[i],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach(t=>{t.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}}const qr=Zt.get("Resource"),Qr={tasker:new Gr,map:{},get isComplete(){return Jr.tasker.isComplete},set(t,e){Jr.map[t]&&qr.repeat(t),Jr.map[t]=e},get:t=>Jr.map[t],remove(t){const e=Jr.map[t];e&&(e.destroy&&e.destroy(),delete Jr.map[t])},loadImage(t,e){return new Promise((s,i)=>{const r=this.setImage(t,t,e);r.load(()=>s(r),t=>i(t))})},setImage(t,e,s){let i;return r(e)?i={url:e}:e.url||(i={url:t,view:e}),i&&(s&&(i.format=s),e=oe.image(i)),Jr.set(t,e),e},destroy(){Jr.map={}}},Jr=Qr,$r={maxRecycled:10,recycledList:[],patternTasker:new Gr,get(t){let e=Qr.get(t.url);return e||Qr.set(t.url,e=oe.image(t)),e.use++,e},recycle(t){t.use--,setTimeout(()=>{t.use||Zr.recycledList.push(t)})},clearRecycled(){const t=Zr.recycledList;t.length>Zr.maxRecycled&&(t.forEach(t=>!t.use&&t.url&&Qr.remove(t.url)),t.length=0)},hasAlphaPixel:t=>Ur.alphaPixelTypes.some(e=>Zr.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+Ur.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+Ur.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){Zr.recycledList=[]}},Zr=$r,{IMAGE:Kr,create:tn}=w;class en{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=tn(Kr),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}$r.isFormat("svg",t)&&(this.isSVG=!0),$r.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e){if(!this.loading){this.loading=!0;const{crossOrigin:t}=this.config;Qr.tasker.add(()=>ge(this,void 0,void 0,function*(){return yield m.origin.loadImage(this.url,s(t)?m.image.crossOrigin:t,this).then(t=>this.setView(t)).catch(t=>{this.error=t,this.onComplete(!1)})}))}return this.waitComplete.push(t,e),this.waitComplete.length-2}unload(t,e){const s=this.waitComplete;if(e){const e=s[t+1];e&&e({type:"stop"})}s[t]=s[t+1]=void 0}setView(t){this.ready=!0,this.width=t.naturalWidth||t.width,this.height=t.naturalHeight||t.height,this.view=t,this.onComplete(!0)}onComplete(t){let e;this.waitComplete.forEach((s,i)=>{e=i%2,s&&(t?e||s(this):e&&s(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,s,i,r,n,o){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let s in t)if(t[s]!==arguments[s]){e=null;break}if(e)return e}const a=m.image.resize(this.view,t,e,r,n,void 0,o,s,i);return this.cache=this.use>1?{data:a,params:arguments}:null,a}getPattern(t,e,s,i){const r=m.canvas.createPattern(t,e);return m.image.setPatternTransform(r,s,i),r}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}}function sn(t,e,s,i){i||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function rn(t,e){return Object.getOwnPropertyDescriptor(t,e)}function nn(t,e){const s="_"+t;return{get(){const t=this[s];return null==t?e:t},set(t){this[s]=t}}}function on(t,e){return(s,i)=>hn(s,i,t,e&&e(i))}function an(t){return t}function hn(t,e,s,i){const r={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};sn(t,e,Object.assign(r,i||{})),Dn(t,e,s)}function ln(t){return on(t)}function dn(t,e){return on(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function cn(t,e){return on(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function un(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),yn(this))}}))}function _n(t,e){return on(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function pn(t,e){return on(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function gn(t,e){return on(t,t=>({set(s){this.__setAttr(t,s,e)&&yn(this)}}))}function fn(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(yn(this),this.__.__removeNaturalSize())}}))}function yn(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function mn(t){return on(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),yn(this)}}))}const xn=gn;function wn(t,e){return on(t,t=>({set(s){this.__setAttr(t,s)&&(vn(this),e&&(this.__.__useStroke=!0))}}))}function vn(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&yn(t)}const bn=wn;function kn(t){return on(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Sn(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function Bn(t){return on(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;_.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip),this.__layout.surfaceChange()}}}))}function Rn(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&Tn(this)}}))}function Cn(t){return on(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>Pn(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");Pn(this,t,e,s),this.mask&&Tn(this)}}))}function Tn(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function Pn(t,e,s,i){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==s||yn(t))}function On(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChange(),this.waitParent(()=>{this.parent.__layout.childrenSortChange()}))}}))}function En(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function Ln(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function An(t){return on(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===Zt.showBounds&&this.__layout.surfaceChange(),this.leafer&&this.leafer.updateCursor())}}))}function In(t){return on(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function Wn(t){return(e,s)=>{sn(e,"__DataProcessor",{get:()=>t})}}function Mn(t){return(e,s)=>{sn(e,"__LayoutProcessor",{get:()=>t})}}function Dn(t,e,i){const r=t.__DataProcessor.prototype,n="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=nn(e,i);if(s(i))a.get=function(){return this[n]};else if("function"==typeof i)a.get=function(){const t=this[n];return null==t?i(this.__leaf):t};else if(d(i)){const t=u(i);a.get=function(){const e=this[n];return null==e?this[n]=t?{}:_.clone(i):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalWidth,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&s.children.length?s.boxBounds.width:i}return t}:"height"===e&&(a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalHeight,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&s.children.length?s.boxBounds.height:i}return t});let l,c=r;for(;!l&&c;)l=rn(c,e),c=c.__proto__;l&&l.set&&(a.set=l.set),r[o]&&(a.set=r[o],delete r[o]),sn(r,e,a)}const Fn=new Zt("rewrite"),zn=[],Nn=["destroy","constructor"];function Yn(t){return(e,s)=>{zn.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function Xn(){return t=>{Un()}}function Un(t){zn.length&&(zn.forEach(e=>{t&&Fn.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),zn.length=0)}function jn(t,e){return s=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach(i=>{if(!(Nn.includes(i)||e&&e.includes(i)))if(t.prototype){rn(t.prototype,i).writable&&(s.prototype[i]=t.prototype[i])}else s.prototype[i]=t[i]})}}function Vn(){return t=>{he.register(t)}}function Hn(){return t=>{ce.register(t)}}setTimeout(()=>Un(!0));const{copy:Gn,toInnerPoint:qn,toOuterPoint:Qn,scaleOfOuter:Jn,rotateOfOuter:$n,skewOfOuter:Zn,multiplyParent:Kn,divideParent:to,getLayout:eo}=Z,so={},{round:io}=Math,ro={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),ao(t,e,s),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)oo(i[t],e,s)}},updateMatrix(t,e,s){const i=t.__layout;e?s&&(i.waitAutoLayout=!0,t.__hasAutoLayout&&(i.matrixChanged=!1)):i.waitAutoLayout&&(i.waitAutoLayout=!1),i.matrixChanged&&t.__updateLocalMatrix(),i.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)ho(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&ho(t),t.__updateChange()},updateAllChange(t){if(co(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)lo(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},draggable:t=>(t.draggable||t.editable)&&t.hitSelf&&!t.locked,copyCanvasByWorld(t,e,s,i,r,n){i||(i=t.__nowWorld),t.__worldFlipped||m.fullImageShadow?e.copyWorldByReset(s,i,t.__nowWorld,r,n):e.copyWorldToInner(s,i,t.__layout.renderBounds,r)},moveWorld(t,e,s=0,i,r){const n=d(e)?Object.assign({},e):{x:e,y:s};i?Qn(t.localTransform,n,n,!0):t.parent&&qn(t.parent.scrollWorldTransform,n,n,!0),no.moveLocal(t,n.x,n.y,r)},moveLocal(t,e,s=0,i){d(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=io(e),s=io(s)),i?t.animate({x:e,y:s},i):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,i,r,n){no.zoomOfLocal(t,uo(t,e),s,i,r,n)},zoomOfLocal(t,e,s,i=s,r,n){const a=t.__localMatrix;if(o(i)||(i&&(n=i),i=s),Gn(so,a),Jn(so,e,s,i),no.hasHighPosition(t))no.setTransform(t,so,r,n);else{const e=t.x+so.e-a.e,o=t.y+so.f-a.f;n&&!r?t.animate({x:e,y:o,scaleX:t.scaleX*s,scaleY:t.scaleY*i},n):(t.x=e,t.y=o,t.scaleResize(s,i,!0!==r))}},rotateOfWorld(t,e,s,i){no.rotateOfLocal(t,uo(t,e),s,i)},rotateOfLocal(t,e,s,i){const r=t.__localMatrix;Gn(so,r),$n(so,e,s),no.hasHighPosition(t)?no.setTransform(t,so,!1,i):t.set({x:t.x+so.e-r.e,y:t.y+so.f-r.f,rotation:D.formatRotation(t.rotation+s)},i)},skewOfWorld(t,e,s,i,r,n){no.skewOfLocal(t,uo(t,e),s,i,r,n)},skewOfLocal(t,e,s,i=0,r,n){Gn(so,t.__localMatrix),Zn(so,e,s,i),no.setTransform(t,so,r,n)},transformWorld(t,e,s,i){Gn(so,t.worldTransform),Kn(so,e),t.parent&&to(so,t.parent.scrollWorldTransform),no.setTransform(t,so,s,i)},transform(t,e,s,i){Gn(so,t.localTransform),Kn(so,e),no.setTransform(t,so,s,i)},setTransform(t,e,s,i){const r=t.__,n=r.origin&&no.getInnerOrigin(t,r.origin),o=eo(e,n,r.around&&no.getInnerOrigin(t,r.around));if(no.hasOffset(t)&&(o.x-=r.offsetX,o.y-=r.offsetY),s){const e=o.scaleX/t.scaleX,s=o.scaleY/t.scaleY;if(delete o.scaleX,delete o.scaleY,n){Ut.scale(t.boxBounds,Math.abs(e),Math.abs(s));const i=no.getInnerOrigin(t,r.origin);lt.move(o,n.x-i.x,n.y-i.y)}t.set(o),t.scaleResize(e,s,!1)}else t.set(o,i)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return Jn(s,no.getLocalOrigin(t,"center"),-1*i,1*i),s},getLocalOrigin:(t,e)=>lt.tempToOuterOf(no.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return kt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(Gn(so,t.worldTransform),to(so,e.scrollWorldTransform),s?so:Object.assign({},so)),drop(t,e,s,i){t.setTransform(no.getRelativeWorld(t,e,!0),i),e.add(t,s)},hasHighPosition:t=>t.origin||t.around||no.hasOffset(t),hasOffset:t=>t.offsetX||t.offsetY,hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},animateMove(t,e,s=.3){if(e.x||e.y)if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const i=e.x*s,r=e.y*s;e.x-=i,e.y-=r,t.move(i,r),m.requestRender(()=>no.animateMove(t,e,s))}}},no=ro,{updateAllMatrix:oo,updateMatrix:ao,updateAllWorldOpacity:ho,updateAllChange:lo,updateChange:co}=no;function uo(t,e){return t.updateLayout(),t.parent?lt.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const _o={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localRenderBounds,maskLocalBoxBounds:(t,e)=>go(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>go(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds:(t,e)=>go(t,e)&&t.__layout.localRenderBounds,excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};let po;function go(t,e){return e||(po=0),t.__.mask&&(po=1),po<0?null:(po&&(po=-1),!0)}const{updateBounds:fo}=ro,yo={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:s}=t;for(let i=0,r=s.length;i<r;i++)(t=s[i]).isBranch&&(t.__tempNumber=1,e.add(t),mo(t,e))}},pushAllParent(t,e){const{keys:i}=e;if(i)for(;t.parent&&s(i[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let s=e.length;const{children:i}=t;for(let t=0,s=i.length;t<s;t++)i[t].isBranch&&e.push(i[t]);for(let t=s,i=e.length;t<i;t++)xo(e[t],e)},updateBounds(t,e){const s=[t];xo(t,s),wo(s,e)},updateBoundsByBranchStack(t,e){let s,i;for(let r=t.length-1;r>-1;r--){s=t[r],i=s.children;for(let t=0,e=i.length;t<e;t++)fo(i[t]);e&&e===s||fo(s)}}},{pushAllChildBranch:mo,pushAllBranchStack:xo,updateBoundsByBranchStack:wo}=yo,vo={run(t){if(t&&t.length){const e=t.length;for(let s=0;s<e;s++)t[s]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:bo,updateBounds:ko}=ro,{toOuterOf:So,getPoints:Bo,copy:Ro}=Ut,Co="_localContentBounds",To="_worldContentBounds",Po="_worldBoxBounds",Oo="_worldStrokeBounds";class Eo{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return So(this.contentBounds,this.leaf.__localMatrix,this[Co]||(this[Co]={})),this[Co]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return So(this.contentBounds,this.leaf.__world,this[To]||(this[To]={})),this[To]}get worldBoxBounds(){return So(this.boxBounds,this.leaf.__world,this[Po]||(this[Po]={})),this[Po]}get worldStrokeBounds(){return So(this.strokeBounds,this.leaf.__world,this[Oo]||(this[Oo]={})),this[Oo]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:e}=t;if(t.isApp)return ko(t);if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=t;for(;e.parent&&!e.parent.leafer;)e=e.parent;const s=e;if(s.__fullLayouting)return;s.__fullLayouting=!0,m.layout(s),delete s.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return Z.defaultMatrix;case"page":t=e.zoomLayer;default:return bo(e,t)}}getBounds(t,e="world"){switch(this.update(),e){case"world":return this.getWorldBounds(t);case"local":return this.getLocalBounds(t);case"inner":return this.getInnerBounds(t);case"page":e=this.leaf.zoomLayer;default:return new Gt(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",s){const{leaf:i}=this;let r,n,o,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),n=i.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=i.__;o={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},r=i.getLocalPointByInner(a);break;case"inner":r=a,n=Z.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),n=bo(i,e,!0)}if(o||(o=Z.getLayout(n)),Ro(o,a),lt.copy(o,r),s){const{scaleX:t,scaleY:e}=o,s=Math.abs(t),i=Math.abs(e);1===s&&1===i||(o.scaleX/=s,o.scaleY/=i,o.width*=s,o.height*=i)}return o}getLayoutPoints(t,e="world"){const{leaf:i}=this,r=Bo(this.getInnerBounds(t));let n;switch(e){case"world":n=null;break;case"local":n=i.parent;break;case"inner":break;case"page":e=i.zoomLayer;default:n=e}return s(n)||r.forEach(t=>i.innerToWorld(t,null,!1,n)),r}shrinkContent(){const{x:t,y:e,width:s,height:i}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:i}}spreadStroke(){const{x:t,y:e,width:s,height:i}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:i},this._localStrokeBounds={x:t,y:e,width:s,height:i},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:i}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:i},this._localRenderBounds={x:t,y:e,width:s,height:i}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0,this.surfaceChanged||this.surfaceChange()}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class Lo{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&m.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&m.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&m.event.stop(this.origin)}}class Ao extends Lo{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}Ao.ADD="child.add",Ao.REMOVE="child.remove",Ao.CREATED="created",Ao.MOUNTED="mounted",Ao.UNMOUNTED="unmounted",Ao.DESTROY="destroy";const Io="property.scroll";class Wo extends Lo{constructor(t,e,s,i,r){super(t,e),this.attrName=s,this.oldValue=i,this.newValue=r}}Wo.CHANGE="property.change",Wo.LEAFER_CHANGE="property.leafer_change",Wo.SCROLL=Io;const Mo={scrollX:Io,scrollY:Io};class Do extends Lo{constructor(t,e){super(t),Object.assign(this,e)}}Do.LOAD="image.load",Do.LOADED="image.loaded",Do.ERROR="image.error";class Fo extends Lo{static checkHas(t,e,s){"on"===s?e===Xo?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(zo)||t.hasEvent(No)||t.hasEvent(Yo),t.__hasWorldEvent=t.hasEvent(Xo))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(zo,t),"inner"===e&&t.emit(No,t)),t.emit(Yo,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Xo,this)}}Fo.RESIZE="bounds.resize",Fo.INNER="bounds.inner",Fo.LOCAL="bounds.local",Fo.WORLD="bounds.world";const{RESIZE:zo,INNER:No,LOCAL:Yo,WORLD:Xo}=Fo,Uo={};[zo,No,Yo,Xo].forEach(t=>Uo[t]=1);class jo extends Lo{get bigger(){if(!this.old)return!0;const{width:t,height:e}=this.old;return this.width>=t&&this.height>=e}get smaller(){return!this.bigger}get samePixelRatio(){return!this.old||this.pixelRatio===this.old.pixelRatio}constructor(t,e){d(t)?(super(jo.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!s(this.resizingKeys[t.innerId])}}jo.RESIZE="resize";class Vo extends Lo{constructor(t,e){super(t),this.data=e}}Vo.REQUEST="watch.request",Vo.DATA="watch.data";class Ho extends Lo{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}Ho.REQUEST="layout.request",Ho.START="layout.start",Ho.BEFORE="layout.before",Ho.LAYOUT="layout",Ho.AFTER="layout.after",Ho.AGAIN="layout.again",Ho.END="layout.end";class Go extends Lo{constructor(t,e,s,i){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=i)}}Go.REQUEST="render.request",Go.CHILD_START="render.child_start",Go.CHILD_END="render.child_end",Go.START="render.start",Go.BEFORE="render.before",Go.RENDER="render",Go.AFTER="render.after",Go.AGAIN="render.again",Go.END="render.end",Go.NEXT="render.next";class qo extends Lo{}qo.START="leafer.start",qo.BEFORE_READY="leafer.before_ready",qo.READY="leafer.ready",qo.AFTER_READY="leafer.after_ready",qo.VIEW_READY="leafer.view_ready",qo.VIEW_COMPLETED="leafer.view_completed",qo.STOP="leafer.stop",qo.RESTART="leafer.restart",qo.END="leafer.end",qo.UPDATE_MODE="leafer.update_mode",qo.TRANSFORM="leafer.transform",qo.MOVE="leafer.move",qo.SCALE="leafer.scale",qo.ROTATE="leafer.rotate",qo.SKEW="leafer.skew";const{MOVE:Qo,SCALE:Jo,ROTATE:$o,SKEW:Zo}=qo,Ko={x:Qo,y:Qo,scaleX:Jo,scaleY:Jo,rotation:$o,skewX:Zo,skewY:Zo},ta={};class ea{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(l(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)l(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let i,n,o;s&&("once"===s?n=!0:"boolean"==typeof s?i=s:(i=s.capture,n=s.once));const a=sa(this,i,!0),h=r(t)?t.split(" "):t,d=n?{listener:e,once:n}:{listener:e};h.forEach(t=>{t&&(o=a[t],o?-1===o.findIndex(t=>t.listener===e)&&o.push(d):a[t]=[d],Uo[t]&&Fo.checkHas(this,t,"on"))})}off(t,e,s){if(t){const i=r(t)?t.split(" "):t;if(e){let t,r,n;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const o=sa(this,t);i.forEach(t=>{t&&(r=o[t],r&&(n=r.findIndex(t=>t.listener===e),n>-1&&r.splice(n,1),r.length||delete o[t],Uo[t]&&Fo.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;i.forEach(s=>{t&&delete t[s],e&&delete e[s]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,s,i){return e?this.on(t,s?e=e.bind(s):e,i):l(t)&&t.forEach(t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3])),{type:t,current:this,listener:e,options:i}}off_(t){if(!t)return;const e=l(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):l(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,s,i){if(!e)return l(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));d(s)?e=e.bind(s):i=s,this.on(t,e,{once:!0,capture:i})}emit(t,e,s){!e&&ce.has(t)&&(e=ce.get(t,{type:t,target:this,current:this}));const i=sa(this,s)[t];if(i){let r;for(let n=0,o=i.length;n<o&&!((r=i[n])&&(r.listener(e),r.once&&(this.off(t,r.listener,s),n--,o--),e&&e.isStopNow));n++);}this.syncEventer&&this.syncEventer.emitEvent(e,s)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:i,__captureMap:r}=this,n=i&&i[t],o=r&&r[t];return!!(s(e)?n||o:e?o:n)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function sa(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:ta)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:ta)}}const{on:ia,on_:ra,off:na,off_:oa,once:aa,emit:ha,emitEvent:la,hasEvent:da,destroy:ca}=ea.prototype,ua={on:ia,on_:ra,off:na,off_:oa,once:aa,emit:ha,emitEvent:la,hasEvent:da,destroyEventer:ca},_a=Zt.get("setAttr"),pa={__setAttr(t,e,i){if(this.leaferIsCreated){const r=this.__.__getInput(t);if(!i||n(e)||s(e)||(_a.warn(this.innerName,t,e),e=void 0),d(e)||r!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new Wo(Wo.LEAFER_CHANGE,this,t,r,e));const s=Ko[t];s&&(this.emitEvent(new qo(s,this)),this.emitEvent(new qo(qo.TRANSFORM,this)))}this.emitPropertyEvent(Wo.CHANGE,t,r,e);const s=Mo[t];return s&&this.emitPropertyEvent(s,t,r,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,s,i){const r=new Wo(t,this,e,s,i);this.isLeafer||this.hasEvent(t)&&this.emitEvent(r),this.leafer.emitEvent(r)},__realSetAttr(t,e){const i=this.__;i[t]=e,this.__proxyData&&this.setProxyAttr(t,e),i.normalStyle&&(this.lockNormalStyle||s(i.normalStyle[t])||(i.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:ga,multiplyParent:fa,translateInner:ya,defaultWorld:ma}=Z,{toPoint:xa,tempPoint:wa}=kt,va={__updateWorldMatrix(){const{parent:t,__layout:e,__world:s,__scrollWorld:i,__:r}=this;fa(this.__local||e,t?t.__scrollWorld||t.__world:ma,s,!!e.affectScaleOrRotation,r),i&&ya(Object.assign(i,s),r.scrollX,r.scrollY)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(ga(e,s,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=s.x+s.offsetX,e.f=s.y+s.offsetY,(s.around||s.origin)&&(xa(s.around||s.origin,t.boxBounds,wa),ya(e,-wa.x,-wa.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:ba,updateAllMatrix:ka}=ro,{updateBounds:Sa}=yo,{toOuterOf:Ba,copyAndSpread:Ra,copy:Ca}=Ut,{toBounds:Ta}=Er,Pa={__updateWorldBounds(){const{__layout:t,__world:e}=this;Ba(t.renderBounds,e,e),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&Fo.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&Fo.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel(),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),Ba(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Ba(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Ba(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const s=this.__layout.boxBounds,i=this.__;i.__usePathBox?Ta(i.path,s):(s.x=0,s.y=0,s.width=i.width,s.height=i.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),ka(this),Sa(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(ka(this),Sa(this,this))):ba(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;Ra(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:s}=e;o(s)&&s<=0?Ca(e.renderBounds,e.strokeBounds):Ra(e.renderBounds,e.boxBounds,s)}},Oa={__render(t,e){if(e.shape)return this.__renderShape(t,e);if(this.__worldOpacity){const s=this.__;if(s.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.dimOpacity&&!s.dimskip?s.opacity*e.dimOpacity:s.opacity,this.__.__single){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!0,!0);this.__draw(i,e,t),ro.copyCanvasByWorld(this,t,i,this.__nowWorld,s.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);Zt.showBounds&&Zt.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Ea}=_o,La={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__nowWorld=this.__getNowWorld(e),this.__worldOpacity){const s=this.__;if(s.__useDim)if(s.dim)e.dimOpacity=!0===s.dim?.2:s.dim;else{if(s.bright&&!e.topRendering)return e.topList.add(this);s.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!1,!0);this.__renderBranch(i,e);const r=this.__nowWorld;t.opacity=e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(i,r,r,s.__blendMode,!0),i.recycle(r)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Ea(s[i],e)||s[i].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Ea(s[i],e)||s[i].__clip(t,e)}}},Aa={},{LEAF:Ia,create:Wa}=w,{stintSet:Ma}=_,{toInnerPoint:Da,toOuterPoint:Fa,multiplyParent:za}=Z,{toOuterOf:Na}=Ut,{copy:Ya,move:Xa}=lt,{moveLocal:Ua,zoomOfLocal:ja,rotateOfLocal:Va,skewOfLocal:Ha,moveWorld:Ga,zoomOfWorld:qa,rotateOfWorld:Qa,skewOfWorld:Ja,transform:$a,transformWorld:Za,setTransform:Ka,getFlipTransform:th,getLocalOrigin:eh,getRelativeWorld:sh,drop:ih}=ro;let rh=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return g}get __LayoutProcessor(){return Eo}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get scrollWorldTransform(){return this.updateLayout(),this.__scrollWorld||this.__world}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.updateLayout(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=Wa(Ia),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(Ao.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(Ao.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(Ao.MOUNTED,t,"once")}nextRender(t,e,s){this.leafer?this.leafer.nextRender(t,e,s):this.waitLeafer(()=>this.leafer.nextRender(t,e,s))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(Ao.MOUNTED)):this.__emitLifeEvent(Ao.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,i=e.length;s<i;s++)e[s].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){s(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=s(e)?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(t,e){}__updateContentBounds(){}__updateStrokeBounds(t){}__updateRenderBounds(t){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:s}=this.__layout;t.clearRect(s.x,s.y,s.width,s.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity)}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,s=this.__world;return za(s,t.matrix,e,void 0,s),Na(this.__layout.renderBounds,e,e),Ma(e,"half",s.half),Ma(e,"ignorePixelSnap",s.ignorePixelSnap),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e){let{scaleX:s,scaleY:i}=$r.patternLocked?this.__world:this.__nowWorld;return t&&(s<0&&(s=-s),i<0&&(i=-i)),(!0===e||"zoom-in"===e&&s>1&&i>1)&&(s=i=1),Aa.scaleX=s,Aa.scaleY=i,Aa}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,s){return this.__layout.getLayoutBounds(t,e,s)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,s){const i=e?sh(this,e):this.worldTransform,r=s?t:{};return Na(t,i,r),r}worldToLocal(t,e,s,i){this.parent?this.parent.worldToInner(t,e,s,i):e&&Ya(e,t)}localToWorld(t,e,s,i){this.parent?this.parent.innerToWorld(t,e,s,i):e&&Ya(e,t)}worldToInner(t,e,s,i){i&&(i.innerToWorld(t,e,s),t=e||t),Da(this.scrollWorldTransform,t,e,s)}innerToWorld(t,e,s,i){Fa(this.scrollWorldTransform,t,e,s),i&&i.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,i){return this.getBoxPointByInner(this.getInnerPoint(t,e,s,i),null,null,!0)}getBoxPointByInner(t,e,s,i){const r=i?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return Xa(r,-n,-o),r}getInnerPoint(t,e,s,i){const r=i?t:{};return this.worldToInner(t,r,s,e),r}getInnerPointByBox(t,e,s,i){const r=i?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return Xa(r,n,o),r}getInnerPointByLocal(t,e,s,i){return this.getInnerPoint(t,this.parent,s,i)}getLocalPoint(t,e,s,i){const r=i?t:{};return this.worldToLocal(t,r,s,e),r}getLocalPointByInner(t,e,s,i){return this.getWorldPoint(t,this.parent,s,i)}getPagePoint(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,i)}getWorldPoint(t,e,s,i){const r=i?t:{};return this.innerToWorld(t,r,s,e),r}getWorldPointByBox(t,e,s,i){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,i),e,s,!0)}getWorldPointByLocal(t,e,s,i){const r=i?t:{};return this.localToWorld(t,r,s,e),r}getWorldPointByPage(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,i)}setTransform(t,e,s){Ka(this,t,e,s)}transform(t,e,s){$a(this,t,e,s)}move(t,e,s){Ua(this,t,e,s)}moveInner(t,e,s){Ga(this,t,e,!0,s)}scaleOf(t,e,s,i,r){ja(this,eh(this,t),e,s,i,r)}rotateOf(t,e,s){Va(this,eh(this,t),e,s)}skewOf(t,e,s,i,r){Ha(this,eh(this,t),e,s,i,r)}transformWorld(t,e,s){Za(this,t,e,s)}moveWorld(t,e,s){Ga(this,t,e,!1,s)}scaleOfWorld(t,e,s,i,r){qa(this,t,e,s,i,r)}rotateOfWorld(t,e){Qa(this,t,e)}skewOfWorld(t,e,s,i,r){Ja(this,t,e,s,i,r)}flip(t,e){$a(this,th(this,t),!1,e)}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}hit(t,e){return!0}__hitWorld(t){return!0}__hit(t){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e,s){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}getMotionPathData(){return ne.need("path")}getMotionPoint(t){return ne.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){ih(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,i){}off_(t){}once(t,e,s,i){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,s){s?this.addAttr(t,e,s):Dn(this.prototype,t,e)}static addAttr(t,e,s,i){s||(s=gn),s(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new Ao(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(Ao.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};rh=pe([jn(pa),jn(va),jn(Pa),jn(ua),jn(Oa)],rh);const{setListWithFn:nh}=Ut,{sort:oh}=yo,{localBoxBounds:ah,localStrokeBounds:hh,localRenderBounds:lh,maskLocalBoxBounds:dh,maskLocalStrokeBounds:ch,maskLocalRenderBounds:uh}=_o,_h=new Zt("Branch");let ph=class extends rh{__updateStrokeSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.renderSpread)return 1;return 0}__updateBoxBounds(t,e){nh(e||this.__layout.boxBounds,this.children,this.__hasMask?dh:ah)}__updateStrokeBounds(t){nh(t||this.__layout.strokeBounds,this.children,this.__hasMask?ch:hh)}__updateRenderBounds(t){nh(t||this.__layout.renderBounds,this.children,this.__hasMask?uh:lh)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,i=e.length;s<i;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(oh),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return _h.warn("add self or destroyed");const i=s(e);if(!t.__){if(l(t))return t.forEach(t=>{this.add(t,e),i||e++});t=he.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,i?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const r=t.__layout;r.boxChanged||r.boxChange(),r.matrixChanged||r.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(Ao.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Ao.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",()=>this.__remove(t,e)):this.__remove(t,e):this.find(t).forEach(t=>this.remove(t,e)):s(t)&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach(e=>{this.__realRemoveChild(e),t&&e.destroy()}))}clear(){this.removeAll(!0)}__remove(t,e){const s=this.children.indexOf(t);s>-1&&(this.children.splice(s,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(Ao.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Ao.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new Ao(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}};ph=pe([jn(La)],ph);class gh{get length(){return this.list.length}constructor(t){this.reset(),t&&(l(t)?this.addList(t):this.add(t))}has(t){return t&&!s(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return s(e)?-1:e}add(t){const{list:e,keys:i}=this;s(i[t.innerId])&&(e.push(t),i[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:i}=this;if(s(i[t.innerId])){const{list:s}=this;for(let t=e,r=s.length;t<r;t++)i[s[t].innerId]++;0===e?s.unshift(t):(e>s.length&&(e=s.length),s.splice(e,0,t)),i[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let i;for(let r=0,n=e.length;r<n;r++)s(i)?e[r].innerId===t.innerId&&(i=r,delete this.keys[t.innerId]):this.keys[e[r].innerId]=r-1;s(i)||e.splice(i,1)}sort(t){const{list:e}=this;t?e.sort((t,e)=>e.__level-t.__level):e.sort((t,e)=>t.__level-e.__level)}forEach(t){this.list.forEach(t)}clone(){const t=new gh;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};const{list:t,keys:e}=this;for(let s=0,i=t.length;s<i;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class fh{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(l(t)?this.addList(t):this.add(t))}has(t){return!s(this.keys[t.innerId])}without(t){return s(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:s}=this;e[t.innerId]||(e[t.innerId]=1,s[t.__level]?s[t.__level].push(t):(s[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(s=>{e=this.levelMap[s];for(let s=0,i=e.length;s<i;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const yh="1.10.1";class mh extends Pe{get allowBackgroundColor(){return!1}init(){const{config:t}=this;let e=t.view||t.canvas;e?(r(e)?("#"!==e[0]&&(e="#"+e),this.viewSelect=m.miniapp.select(e)):e.fields?this.viewSelect=e:this.initView(e),this.viewSelect&&m.miniapp.getSizeView(this.viewSelect).then(t=>{this.initView(t)})):this.initView()}initView(t){t?this.view=t.view||t:(t={},this.__createView()),this.view.getContext?this.__createContext():this.unrealCanvas();const{width:e,height:s,pixelRatio:i}=this.config,r={width:e||t.width,height:s||t.height,pixelRatio:i};this.resize(r),this.context&&(this.viewSelect&&(m.renderCanvas=this),this.context.roundRect&&(this.roundRect=function(t,e,s,i,r){this.context.roundRect(t,e,s,i,o(r)?[r]:r)}),Xr(this.context.__proto__))}__createView(){this.view=m.origin.createCanvas(1,1)}updateViewSize(){if(this.unreal)return;const{width:t,height:e,pixelRatio:s}=this;this.view.width=Math.ceil(t*s),this.view.height=Math.ceil(e*s)}updateClientBounds(t){this.viewSelect&&m.miniapp.getBounds(this.viewSelect).then(e=>{this.clientBounds=e,t&&t()})}startAutoLayout(t,e){this.resizeListener||(this.resizeListener=e,t&&(this.checkSize=this.checkSize.bind(this),m.miniapp.onWindowResize(this.checkSize)))}checkSize(){this.viewSelect&&setTimeout(()=>{this.updateClientBounds(()=>{const{width:t,height:e}=this.clientBounds,{pixelRatio:s}=this,i={width:t,height:e,pixelRatio:s};this.isSameSize(i)||this.emitResize(i)})},500)}stopAutoLayout(){this.autoLayout=!1,this.resizeListener=null,m.miniapp.offWindowResize(this.checkSize)}unrealCanvas(){this.unreal=!0}emitResize(t){const e={};_.copyAttrs(e,this,Te),this.resize(t),s(this.width)||this.resizeListener(new jo(t,e))}}const{mineType:xh,fileType:wh}=Ur;function vh(t,e){m.origin={createCanvas:(t,s,i)=>{const r={type:"2d",width:t,height:s};return e.createOffscreenCanvas?e.createOffscreenCanvas(r):e.createOffScreenCanvas(r)},canvasToDataURL:(t,e,s)=>t.toDataURL(xh(e),s),canvasToBolb:(t,e,s)=>t.toBuffer(e,{quality:s}),canvasSaveAs:(t,e,s)=>{let i=t.toDataURL(xh(wh(e)),s);return i=i.substring(i.indexOf("64,")+3),m.origin.download(i,e)},download:(t,s)=>new Promise((i,r)=>{let n;s.includes("/")||(s=`${e.env.USER_DATA_PATH}/`+s,n=!0);const o=e.getFileSystemManager();o.writeFile({filePath:s,data:t,encoding:"base64",success(){n?m.miniapp.saveToAlbum(s).then(()=>{o.unlink({filePath:s}),i()}):i()},fail(t){r(t)}})}),loadImage:t=>new Promise((e,s)=>{const i=m.canvas.view.createImage();i.onload=()=>{e(i)},i.onerror=t=>{s(t)},i.src=m.image.getRealURL(t)}),noRepeat:"repeat-x"},m.miniapp={select:t=>e.createSelectorQuery().select(t),getBounds:t=>new Promise(e=>{t.boundingClientRect().exec(t=>{const s=t[1];e({x:s.top,y:s.left,width:s.width,height:s.height})})}),getSizeView:t=>new Promise(e=>{t.fields({node:!0,size:!0}).exec(t=>{const s=t[0];e({view:s.node,width:s.width,height:s.height})})}),saveToAlbum:t=>new Promise(s=>{e.getSetting({success:i=>{i.authSetting["scope.writePhotosAlbum"]?e.saveImageToPhotosAlbum({filePath:t,success(){s(!0)}}):e.authorize({scope:"scope.writePhotosAlbum",success:()=>{e.saveImageToPhotosAlbum({filePath:t,success(){s(!0)}})},fail:()=>{}})}})}),onWindowResize(t){e.onWindowResize(t)},offWindowResize(t){e.offWindowResize(t)}},m.event={stopDefault(t){},stopNow(t){},stop(t){}},m.canvas=oe.canvas(),m.conicGradientSupport=!!m.canvas.context.createConicGradient}Object.assign(oe,{canvas:(t,e)=>new mh(t,e),image:t=>new en(t)}),m.name="miniapp",m.requestRender=function(t){const{view:e}=m.renderCanvas||m.canvas;e.requestAnimationFrame?e.requestAnimationFrame(t):setTimeout(t,16)},sn(m,"devicePixelRatio",{get:()=>Math.max(1,wx.getWindowInfo?wx.getWindowInfo().pixelRatio:wx.getSystemInfoSync().pixelRatio)});class bh{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove){const t=new gh;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new gh,this.target=t,e&&(this.config=_.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(Go.REQUEST)}__onAttrChange(t){this.__updatedList.add(t.target),this.update()}__onChildEvent(t){t.type===Ao.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent)),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new Vo(Vo.DATA,{updatedList:this.updatedList})),this.__updatedList=new gh,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[Wo.CHANGE,this.__onAttrChange,this],[[Ao.ADD,Ao.REMOVE],this.__onChildEvent,this],[Vo.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:kh,updateBounds:Sh,updateChange:Bh}=ro,{pushAllChildBranch:Rh,pushAllParent:Ch}=yo;const{worldBounds:Th}=_o;class Ph{constructor(t){this.updatedBounds=new Gt,this.beforeBounds=new Gt,this.afterBounds=new Gt,l(t)&&(t=new gh(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,Th)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,Th),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:Oh,updateAllChange:Eh}=ro,Lh=Zt.get("Layouter");class Ah{constructor(t,e){this.totalTimes=0,this.config={},this.__levelList=new fh,this.target=t,e&&(this.config=_.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(Ho.START),this.layoutOnce(),t.emitEvent(new Ho(Ho.END,this.layoutedBlocks,this.times))}catch(t){Lh.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?Lh.warn("layouting"):this.times>3?Lh.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(Vo.REQUEST),this.totalTimes>1?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=se.start("PartLayout"),{target:s,__updatedList:i}=this,{BEFORE:r,LAYOUT:n,AFTER:o}=Ho,a=this.getBlocks(i);a.forEach(t=>t.setBefore()),s.emitEvent(new Ho(r,a,this.times)),this.extraBlock=null,i.sort(),function(t,e){let s;t.list.forEach(t=>{s=t.__layout,e.without(t)&&!s.proxyZoom&&(s.matrixChanged?(kh(t,!0),e.add(t),t.isBranch&&Rh(t,e),Ch(t,e)):s.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),Ch(t,e)))})}(i,this.__levelList),function(t){let e,s,i;t.sort(!0),t.levels.forEach(r=>{e=t.levelMap[r];for(let t=0,r=e.length;t<r;t++){if(s=e[t],s.isBranch&&s.__tempNumber){i=s.children;for(let t=0,e=i.length;t<e;t++)i[t].isBranch||Sh(i[t])}Sh(s)}})}(this.__levelList),function(t){t.list.forEach(Bh)}(i),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),s.emitEvent(new Ho(n,a,this.times)),s.emitEvent(new Ho(o,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,se.end(e)}fullLayout(){const t=se.start("FullLayout"),{target:e}=this,{BEFORE:s,LAYOUT:i,AFTER:r}=Ho,n=this.getBlocks(new gh(e));e.emitEvent(new Ho(s,n,this.times)),Ah.fullLayout(e),n.forEach(t=>{t.setAfter()}),e.emitEvent(new Ho(i,n,this.times)),e.emitEvent(new Ho(r,n,this.times)),this.addBlocks(n),se.end(t)}static fullLayout(t){Oh(t,!0),t.isBranch?yo.updateBounds(t):ro.updateBounds(t),Eh(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:s}=this.extraBlock||(this.extraBlock=new Ph([]));e.length?s.add(t.__world):s.set(t.__world),e.add(t)}}createBlock(t){return new Ph(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[Ho.REQUEST,this.layout,this],[Ho.AGAIN,this.layoutAgain,this],[Vo.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const Ih=Zt.get("Renderer");class Wh{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,s){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,maxFPS:120},this.frames=[],this.target=t,this.canvas=e,s&&(this.config=_.default(s,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.__requestRender()}requestLayout(){this.target.emit(Ho.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(Go.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(Go.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(Go.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Gt,Ih.log(e.innerName,"---\x3e");try{this.emitRender(Go.START),this.renderOnce(t),this.emitRender(Go.END,this.totalBounds),$r.clearRecycled()}catch(t){this.rendering=!1,Ih.error(t)}Ih.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return Ih.warn("rendering");if(this.times>3)return Ih.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Gt,this.renderOptions={},t)this.emitRender(Go.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(Go.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(Go.RENDER,this.renderBounds,this.renderOptions),this.emitRender(Go.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach(e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(t){const e=se.start("PartRender"),{canvas:s}=this,i=t.getIntersect(s.bounds),r=new Gt(i);s.save(),i.spread(Wh.clipSpread).ceil(),s.clearWorld(i),s.clipWorld(i),this.__render(i,r),s.restore(),se.end(e)}fullRender(){const t=se.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),se.end(t)}__render(t,e){const{canvas:s}=this,i=t.includes(this.target.__world),r=i?{includes:i}:{bounds:t,includes:i};this.needFill&&s.fillWorld(t,this.config.fill),Zt.showRepaint&&Zt.drawRepaint(s,t),m.render(this.target,s,r),this.renderBounds=e=e||t,this.renderOptions=r,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),s.updateRender(e)}addBlock(t){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Gt;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);this.requestTime=this.frameTime||Date.now();const e=()=>{const t=1e3/((this.frameTime=Date.now())-this.requestTime),{maxFPS:s}=this.config;if(s&&t>s)return m.requestRender(e);const{frames:i}=this;i.length>30&&i.shift(),i.push(t),this.FPS=Math.round(i.reduce((t,e)=>t+e,0)/i.length),this.requestTime=0,this.checkRender()};m.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:s}=t.old;if(!new Gt(0,0,e,s).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Gt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;t.updatedList&&t.updatedList.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||Ih.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds)})}emitRender(t,e,s){this.target.emitEvent(new Go(t,this.times,e,s))}__listenEvents(){this.__eventIds=[this.target.on_([[Go.REQUEST,this.update,this],[Ho.END,this.__onLayoutEnd,this],[Go.AGAIN,this.renderAgain,this],[jo.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}}function Mh(t){return on(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Dh(t){return on(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function Fh(){return(t,e)=>{const s="_"+e;sn(t,e,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}function zh(t){return(e,s)=>{sn(e,s,nn(s,t))}}Wh.clipSpread=10,Object.assign(oe,{watcher:(t,e)=>new bh(t,e),layouter:(t,e)=>new Ah(t,e),renderer:(t,e,s)=>new Wh(t,e,s),selector:(t,e)=>{},interaction:(t,e,s,i)=>{}}),m.layout=Ah.fullLayout,m.render=function(t,e,s){const i=Object.assign(Object.assign({},s),{topRendering:!0});s.topList=new gh,t.__render(e,s),s.topList.length&&s.topList.forEach(t=>t.__render(e,i))};const Nh={},Yh={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},Xh={number:(t,e)=>d(t)?"percent"===t.type?t.value*e:t.value:t},Uh={},jh={},Vh={},Hh={},Gh={},qh={apply(){ne.need("filter")}},Qh={},Jh={setStyleName:()=>ne.need("state"),set:()=>ne.need("state")},$h={list:{},register(t,e){$h.list[t]=e},get:t=>$h.list[t]},{parse:Zh,objectToCanvasData:Kh}=Zs,{stintSet:tl}=_,{hasTransparent:el}=Yh,sl={},il=Zt.get("UIData");class rl extends g{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,il.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,il.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),r(t)||!t?(tl(this,"__isTransparentFill",el(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):d(t)&&this.__setPaint("fill",t)}setStroke(t){r(t)||!t?(tl(this,"__isTransparentStroke",el(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):d(t)&&this.__setPaint("stroke",t)}setPath(t){const e=r(t);e||t&&d(t[0])?(this.__setInput("path",t),this._path=e?Zh(t):Kh(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){nl(this,"shadow",t)}setInnerShadow(t){nl(this,"innerShadow",t)}setFilter(t){nl(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&jh.compute("fill",this.__leaf),e&&jh.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),s(t.strokeWidthFixed)||(i=t.strokeWidthFixed)),i){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const s=this.__leaf.__layout;s.boxChanged||s.boxChange(),l(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=sl)):(this.__isStrokes=!0,this._stroke||(this._stroke=sl))}__removePaint(t,e){e&&this.__removeInput(t),Vh.recycleImage(t,this),"fill"===t?(tl(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(tl(this,"__isAlphaPixelStroke",void 0),tl(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function nl(t,e,s){t.__setInput(e,s),l(s)?(s.some(t=>!1===t.visible)&&(s=s.filter(t=>!1!==t.visible)),s.length||(s=void 0)):s=s&&!1!==s.visible?[s]:void 0,t["_"+e]=s}class ol extends rl{}class al extends ol{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class hl extends ol{__getInputData(t,e){const s=super.__getInputData(t,e);return Te.forEach(t=>delete s[t]),s}}class ll extends al{}class dl extends rl{get __usePathBox(){return this.points||this.__pathInputed}}class cl extends rl{get __boxStroke(){return!this.__pathInputed}}class ul extends rl{get __boxStroke(){return!this.__pathInputed}}class _l extends dl{}class pl extends rl{}class gl extends rl{get __pathInputed(){return 2}}class fl extends ol{}const yl={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class ml extends rl{get __useNaturalRatio(){return!1}setFontWeight(t){r(t)?(this.__setInput("fontWeight",t),t=yl[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,s=e.__box;if(t){const{boxStyle:i}=this;if(s)for(let t in i)s[t]=void 0;else s=e.__box=he.get("Rect",0);const r=e.__layout,n=s.__layout;i||(s.parent=e,s.__world=e.__world,n.boxBounds=r.boxBounds),s.set(t),n.strokeChanged&&r.strokeChange()}else s&&(e.__box=s.parent=null,s.destroy());this._boxStyle=t}}class xl extends cl{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:"image",mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return t.url&&delete t.fill,t}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url&&delete s.fill,s}}class wl extends cl{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url=this.__leaf.canvas.toDataURL("image/png"),s}}const{max:vl,add:bl}=C,kl={__updateStrokeSpread(){let t=0,e=0;const s=this.__,{strokeAlign:i,__maxStrokeWidth:r}=s,n=this.__box;if((s.stroke||"all"===s.hitStroke)&&r&&"inside"!==i&&(e=t="center"===i?r/2:r,!s.__boxStroke)){const e=s.__isLinePath?0:10*t,i="none"===s.strokeCap?0:r;t+=Math.max(e,i)}return s.__useArrow&&(t+=5*r),n&&(t=vl(t,n.__layout.strokeSpread=n.__updateStrokeSpread()),e=Math.max(e,n.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:i,backgroundBlur:r,filter:n,renderSpread:o}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=Gh.getShadowRenderSpread(this,e)),i&&(t=vl(t,i)),n&&(t=bl(t,qh.getSpread(n))),o&&(t=bl(t,o)),a&&(t=bl(t,a));let l=t;return s&&(l=vl(l,Gh.getInnerShadowSpread(this,s))),r&&(l=vl(l,r)),this.__layout.renderShapeSpread=l,h?vl(h.__updateRenderSpread(),t):t}},{stintSet:Sl}=_,Bl={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Sl(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Sl(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:s,stroke:i}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;Sl(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!Gh.isTransformShadow(e[0])&&s&&!t.__isTransparentFill&&!(l(s)&&s.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),Sl(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){Rl(this,t,e)},__draw(t,e,s){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:n,__drawAfterFill:o,__fillAfterStroke:a,__isFastShadow:h}=i;if(this.__drawRenderPath(t),i.__useEffect&&!h){const h=jh.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=i;l&&Gh.shadow(this,t,h),a&&(i.__isStrokes?jh.strokes(n,this,t,e):jh.stroke(n,this,t,e)),r&&(i.__isFills?jh.fills(r,this,t,e):jh.fill(r,this,t,e)),o&&this.__drawAfterFill(t,e),d&&Gh.innerShadow(this,t,h),n&&!a&&(i.__isStrokes?jh.strokes(n,this,t,e):jh.stroke(n,this,t,e)),c&&qh.apply(c,this,this.__nowWorld,t,s,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(i.__isStrokes?jh.strokes(n,this,t,e):jh.stroke(n,this,t,e)),h){const e=i.shadow[0],{scaleX:s,scaleY:r}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*s,e.y*r,e.blur*s,Yh.string(e.color))}r&&(i.__isFills?jh.fills(r,this,t,e):jh.fill(r,this,t,e)),h&&t.restore(),o&&this.__drawAfterFill(t,e),n&&!a&&(i.__isStrokes?jh.strokes(n,this,t,e):jh.stroke(n,this,t,e))}}else i.__pathInputed?Rl(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const s=this.__,{fill:i,stroke:r}=s;i&&!e.ignoreFill&&(s.__isAlphaPixelFill?jh.fills(i,this,t,e):jh.fill("#000000",this,t,e)),s.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(s.__isAlphaPixelStroke?jh.strokes(r,this,t,e):jh.stroke("#000000",this,t,e))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function Rl(t,e,s){const{fill:i,stroke:r,__drawAfterFill:n,__fillAfterStroke:o}=t.__;t.__drawRenderPath(e),o&&jh.stroke(r,t,e,s),i&&jh.fill(i,t,e,s),n&&t.__drawAfterFill(e,s),r&&!o&&jh.stroke(r,t,e,s)}const Cl={__drawFast(t,e){let{x:s,y:i,width:r,height:n}=this.__layout.boxBounds;const{fill:o,stroke:a,__drawAfterFill:h}=this.__;if(o&&(t.fillStyle=o,t.fillRect(s,i,r,n)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:o,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(o){case"center":t.strokeRect(0,0,r,n);break;case"inside":r-=h,n-=h,r<0||n<0?(t.save(),this.__clip(t,e),t.strokeRect(s+l,i+l,r,n),t.restore()):t.strokeRect(s+l,i+l,r,n);break;case"outside":t.strokeRect(s-l,i-l,r+h,n+h)}}}};var Tl;let Pl=Tl=class extends rh{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){D.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return Nr.set(this.path=t||[]),t||this.__drawPathByBox(Nr),Nr}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return r(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return ne.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return ne.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let s=e?this.__.__pathForRender:this.__.path;return s||(Nr.set(s=[]),this.__drawPathByBox(Nr)),t?Zs.toCanvasData(s,!0):s}getPathString(t,e,s){return Zs.stringify(this.getPath(t,e),s)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||Qh.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?Fr.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&Uh.addArrows(this)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?Ki.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:s,width:i,height:r}=this.__layout.boxBounds;if(this.__.cornerRadius){const{cornerRadius:n}=this.__;t.roundRect(e,s,i,r,o(n)?[n]:n)}else t.rect(e,s,i,r)}drawImagePlaceholder(t,e,s){jh.fill(this.__.placeholderColor,this,e,s)}animate(t,e,s,i){return this.set(t),ne.need("animate")}killAnimate(t,e){}export(t,e){return ne.need("export")}syncExport(t,e){return ne.need("export")}clone(t){const e=_.clone(this.toJSON());return t&&Object.assign(e,t),Tl.one(e)}static one(t,e,s,i,r){return he.get(t.tag||this.prototype.__tag,t,e,s,i,r)}static registerUI(){Vn()(this)}static registerData(t){Wn(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};pe([Wn(rl)],Pl.prototype,"__",void 0),pe([Fh()],Pl.prototype,"zoomLayer",void 0),pe([ln("")],Pl.prototype,"id",void 0),pe([ln("")],Pl.prototype,"name",void 0),pe([ln("")],Pl.prototype,"className",void 0),pe([Sn("pass-through")],Pl.prototype,"blendMode",void 0),pe([Rn(1)],Pl.prototype,"opacity",void 0),pe([Cn(!0)],Pl.prototype,"visible",void 0),pe([Sn(!1)],Pl.prototype,"locked",void 0),pe([Bn(!1)],Pl.prototype,"dim",void 0),pe([Bn(!1)],Pl.prototype,"dimskip",void 0),pe([On(0)],Pl.prototype,"zIndex",void 0),pe([En(!1)],Pl.prototype,"mask",void 0),pe([Ln(!1)],Pl.prototype,"eraser",void 0),pe([dn(0,!0)],Pl.prototype,"x",void 0),pe([dn(0,!0)],Pl.prototype,"y",void 0),pe([gn(100,!0)],Pl.prototype,"width",void 0),pe([gn(100,!0)],Pl.prototype,"height",void 0),pe([_n(1,!0)],Pl.prototype,"scaleX",void 0),pe([_n(1,!0)],Pl.prototype,"scaleY",void 0),pe([pn(0,!0)],Pl.prototype,"rotation",void 0),pe([pn(0,!0)],Pl.prototype,"skewX",void 0),pe([pn(0,!0)],Pl.prototype,"skewY",void 0),pe([dn(0,!0)],Pl.prototype,"offsetX",void 0),pe([dn(0,!0)],Pl.prototype,"offsetY",void 0),pe([cn(0,!0)],Pl.prototype,"scrollX",void 0),pe([cn(0,!0)],Pl.prototype,"scrollY",void 0),pe([un()],Pl.prototype,"origin",void 0),pe([un()],Pl.prototype,"around",void 0),pe([ln(!1)],Pl.prototype,"lazy",void 0),pe([fn(1)],Pl.prototype,"pixelRatio",void 0),pe([kn(0)],Pl.prototype,"renderSpread",void 0),pe([mn()],Pl.prototype,"path",void 0),pe([xn()],Pl.prototype,"windingRule",void 0),pe([xn(!0)],Pl.prototype,"closed",void 0),pe([gn(0)],Pl.prototype,"padding",void 0),pe([gn(!1)],Pl.prototype,"lockRatio",void 0),pe([gn()],Pl.prototype,"widthRange",void 0),pe([gn()],Pl.prototype,"heightRange",void 0),pe([ln(!1)],Pl.prototype,"draggable",void 0),pe([ln()],Pl.prototype,"dragBounds",void 0),pe([ln("auto")],Pl.prototype,"dragBoundsType",void 0),pe([ln(!1)],Pl.prototype,"editable",void 0),pe([An(!0)],Pl.prototype,"hittable",void 0),pe([An("path")],Pl.prototype,"hitFill",void 0),pe([bn("path")],Pl.prototype,"hitStroke",void 0),pe([An(!1)],Pl.prototype,"hitBox",void 0),pe([An(!0)],Pl.prototype,"hitChildren",void 0),pe([An(!0)],Pl.prototype,"hitSelf",void 0),pe([An()],Pl.prototype,"hitRadius",void 0),pe([In("")],Pl.prototype,"cursor",void 0),pe([Sn()],Pl.prototype,"fill",void 0),pe([bn(void 0,!0)],Pl.prototype,"stroke",void 0),pe([bn("inside")],Pl.prototype,"strokeAlign",void 0),pe([bn(1,!0)],Pl.prototype,"strokeWidth",void 0),pe([bn(!1)],Pl.prototype,"strokeWidthFixed",void 0),pe([bn("none")],Pl.prototype,"strokeCap",void 0),pe([bn("miter")],Pl.prototype,"strokeJoin",void 0),pe([bn()],Pl.prototype,"dashPattern",void 0),pe([bn(0)],Pl.prototype,"dashOffset",void 0),pe([bn(10)],Pl.prototype,"miterLimit",void 0),pe([xn(0)],Pl.prototype,"cornerRadius",void 0),pe([xn()],Pl.prototype,"cornerSmoothing",void 0),pe([Mh()],Pl.prototype,"shadow",void 0),pe([Mh()],Pl.prototype,"innerShadow",void 0),pe([Mh()],Pl.prototype,"blur",void 0),pe([Mh()],Pl.prototype,"backgroundBlur",void 0),pe([Mh()],Pl.prototype,"grayscale",void 0),pe([Mh()],Pl.prototype,"filter",void 0),pe([Sn()],Pl.prototype,"placeholderColor",void 0),pe([ln(100)],Pl.prototype,"placeholderDelay",void 0),pe([ln({})],Pl.prototype,"data",void 0),pe([Yn(rh.prototype.reset)],Pl.prototype,"reset",null),Pl=Tl=pe([jn(kl),jn(Bl),Xn()],Pl);let Ol=class extends Pl{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:s}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),s.forEach(t=>this.add(t)),t.children=s}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);return this.childlessJSON||(e.children=this.children.map(e=>e.toJSON(t))),e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};var El;pe([Wn(ol)],Ol.prototype,"__",void 0),pe([gn(0)],Ol.prototype,"width",void 0),pe([gn(0)],Ol.prototype,"height",void 0),Ol=pe([jn(ph),Vn()],Ol);const Ll=Zt.get("Leafer");let Al=El=class extends Ol{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&Qr.isComplete}get layoutLocked(){return!this.layouter.running}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),El.list.add(this)}init(t,e){if(this.canvas)return;let s;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),s=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,_.assign(i,t));const r=this.canvas=oe.canvas(i);this.__controllers.push(this.renderer=oe.renderer(this,r,i),this.watcher=oe.watcher(this,i),this.layouter=oe.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),this.view=r.view,e||(this.selector=oe.selector(this),this.interaction=oe.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=oe.hitCanvasManager()),this.canvasManager=new _e,s=i.start),this.hittable=i.hittable,this.fill=i.fill,this.canvasManager.add(r),this.__listenEvents(),s&&(this.__startTimer=setTimeout(this.start.bind(this))),vo.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(qo.RESTART):this.emitLeafer(qo.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(qo.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=_.copyAttrs({},t,Te);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:s}=this;s&&(s.addBlock(t?new Gt(t):this.canvas.bounds),this.viewReady&&(e?s.render():s.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const s=_.copyAttrs({},this.canvas,Te);e.resize(t),this.updateLazyBounds(),this.__onResize(new jo(t,s))}__onResize(t){this.emitEvent(t),_.copyAttrs(this.__,t,Te),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new Qt(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Te.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t?(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):"mode"===t&&this.emit(qo.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Te.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:s,canvas:i}=this,r=_.copyAttrs({},i,Te);r[t]=s[t]=e,s.width&&s.height?i.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(r)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(qo.BEFORE_READY),this.emitLeafer(qo.READY),this.emitLeafer(qo.AFTER_READY),vo.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(qo.VIEW_READY),vo.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:s}=this.config;if(t){let{width:i,height:r,pixelRatio:n}=this;const o="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,o.x+o.width)),s||(r=Math.max(1,o.y+o.height)),this.__doResize({width:i,height:r,pixelRatio:n})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){vo.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(qo.VIEW_COMPLETED),vo.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,s){e&&(t=t.bind(e));const i=this.__nextRenderWait;if(s){for(let e=0;e<i.length;e++)if(i[e]===t){i.splice(e,1);break}}else i.push(t);this.requestRender()}zoom(t,e,s,i){return ne.need("view")}getValidMove(t,e,s){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:s}=this.clientBounds;return{x:e+t.x,y:s+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new qo(t,this))}__listenEvents(){const t=se.start("FirstCreate "+this.innerName);this.once([[qo.START,()=>se.end(t)],[Ho.START,this.updateLazyBounds,this],[Go.START,this.__onCreated,this],[Go.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[Vo.DATA,this.__onWatchData,this],[Ho.END,this.__onLayoutEnd,this],[Go.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){El.list.remove(this);try{this.stop(),this.emitLeafer(qo.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{$r.clearRecycled()},100)}catch(t){Ll.error(t)}}};t?e():setTimeout(e)}};Al.list=new gh,pe([Wn(hl)],Al.prototype,"__",void 0),pe([gn()],Al.prototype,"pixelRatio",void 0),pe([ln("normal")],Al.prototype,"mode",void 0),Al=El=pe([Vn()],Al);let Il=class extends Pl{get __tag(){return"Rect"}};pe([Wn(cl)],Il.prototype,"__",void 0),Il=pe([jn(Cl),Xn(),Vn()],Il);const{add:Wl,includes:Ml,scroll:Dl}=Ut,Fl=Il.prototype,zl=Ol.prototype;let Nl=class extends Ol{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.pathInputed){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const s=this.__,i=this.__layout,{renderBounds:r,boxBounds:n}=i,{overflow:o}=s,a=i.childrenRenderBounds||(i.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=o.includes("scroll"))&&(Wl(a,n),Dl(a,s)),this.__updateRectRenderBounds(),t=!Ml(n,a),t&&"show"===o&&Wl(r,a)}else this.__updateRectRenderBounds();_.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};pe([Wn(al)],Nl.prototype,"__",void 0),pe([gn(100)],Nl.prototype,"width",void 0),pe([gn(100)],Nl.prototype,"height",void 0),pe([ln(!1)],Nl.prototype,"resizeChildren",void 0),pe([kn("show")],Nl.prototype,"overflow",void 0),pe([Yn(Fl.__updateStrokeSpread)],Nl.prototype,"__updateStrokeSpread",null),pe([Yn(Fl.__updateRenderSpread)],Nl.prototype,"__updateRectRenderSpread",null),pe([Yn(Fl.__updateBoxBounds)],Nl.prototype,"__updateRectBoxBounds",null),pe([Yn(Fl.__updateStrokeBounds)],Nl.prototype,"__updateStrokeBounds",null),pe([Yn(Fl.__updateRenderBounds)],Nl.prototype,"__updateRectRenderBounds",null),pe([Yn(Fl.__updateChange)],Nl.prototype,"__updateRectChange",null),pe([Yn(Fl.__render)],Nl.prototype,"__renderRect",null),pe([Yn(zl.__render)],Nl.prototype,"__renderGroup",null),Nl=pe([Xn(),Vn()],Nl);let Yl=class extends Nl{get __tag(){return"Frame"}get isFrame(){return!0}};pe([Wn(ll)],Yl.prototype,"__",void 0),pe([Sn("#FFFFFF")],Yl.prototype,"fill",void 0),pe([kn("hide")],Yl.prototype,"overflow",void 0),Yl=pe([Vn()],Yl);const{moveTo:Xl,closePath:Ul,ellipse:jl}=vi;let Vl=class extends Pl{get __tag(){return"Ellipse"}__updatePath(){const{width:t,height:e,innerRadius:s,startAngle:i,endAngle:r}=this.__,n=t/2,o=e/2,a=this.__.path=[];s?(i||r?(s<1&&jl(a,n,o,n*s,o*s,0,i,r,!1),jl(a,n,o,n,o,0,r,i,!0),s<1&&Ul(a)):(s<1&&(jl(a,n,o,n*s,o*s),Xl(a,t,o)),jl(a,n,o,n,o,0,360,0,!0)),m.ellipseToCurve&&(this.__.path=this.getPath(!0))):i||r?(Xl(a,n,o),jl(a,n,o,n,o,0,i,r,!1),Ul(a)):jl(a,n,o,n,o)}};pe([Wn(ul)],Vl.prototype,"__",void 0),pe([xn(0)],Vl.prototype,"innerRadius",void 0),pe([xn(0)],Vl.prototype,"startAngle",void 0),pe([xn(0)],Vl.prototype,"endAngle",void 0),Vl=pe([Vn()],Vl);const{sin:Hl,cos:Gl,PI:ql}=Math,{moveTo:Ql,lineTo:Jl,closePath:$l,drawPoints:Zl}=vi;let Kl=class extends Pl{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)Zl(e,t.points,t.curve,!0);else{const{width:s,height:i,sides:r}=t,n=s/2,o=i/2;Ql(e,n,0);for(let t=1;t<r;t++)Jl(e,n+n*Hl(2*t*ql/r),o-o*Gl(2*t*ql/r));$l(e)}}};pe([Wn(_l)],Kl.prototype,"__",void 0),pe([xn(3)],Kl.prototype,"sides",void 0),pe([xn()],Kl.prototype,"points",void 0),pe([xn(0)],Kl.prototype,"curve",void 0),Kl=pe([Xn(),Vn()],Kl);const{sin:td,cos:ed,PI:sd}=Math,{moveTo:id,lineTo:rd,closePath:nd}=vi;let od=class extends Pl{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:s,innerRadius:i}=this.__,r=t/2,n=e/2,o=this.__.path=[];id(o,r,0);for(let t=1;t<2*s;t++)rd(o,r+(t%2==0?r:r*i)*td(t*sd/s),n-(t%2==0?n:n*i)*ed(t*sd/s));nd(o)}};pe([Wn(pl)],od.prototype,"__",void 0),pe([xn(5)],od.prototype,"corners",void 0),pe([xn(.382)],od.prototype,"innerRadius",void 0),od=pe([Vn()],od);const{moveTo:ad,lineTo:hd,drawPoints:ld}=vi,{rotate:dd,getAngle:cd,getDistance:ud,defaultPoint:_d}=lt;let pd=class extends Pl{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,s={x:0,y:0};return t&&(s.x=t),e&&dd(s,e),s}set toPoint(t){this.width=ud(_d,t),this.rotation=cd(_d,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?ld(e,t.points,t.curve,t.closed):(ad(e,0,0),hd(e,this.width,0))}};pe([Wn(dl)],pd.prototype,"__",void 0),pe([wn("center")],pd.prototype,"strokeAlign",void 0),pe([gn(0)],pd.prototype,"height",void 0),pe([xn()],pd.prototype,"points",void 0),pe([xn(0)],pd.prototype,"curve",void 0),pe([xn(!1)],pd.prototype,"closed",void 0),pd=pe([Vn()],pd);let gd=class extends Il{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return l(t)&&t[0].image}};pe([Wn(xl)],gd.prototype,"__",void 0),pe([gn("")],gd.prototype,"url",void 0),gd=pe([Vn()],gd);const fd=gd;let yd=class extends Il{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=oe.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new en({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new Do(Do.LOADED,{image:t}))})}draw(t,e,s,i){const r=new ft(t.worldTransform).invert(),n=new ft;e&&n.translate(e.x,e.y),s&&(o(s)?n.scale(s):n.scale(s.x,s.y)),i&&n.rotate(i),r.multiplyParent(n),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:s,height:i}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,s,i)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:s}=this.__;t.resize(this.__,s),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};pe([Wn(wl)],yd.prototype,"__",void 0),pe([Dh(100)],yd.prototype,"width",void 0),pe([Dh(100)],yd.prototype,"height",void 0),pe([Dh(1)],yd.prototype,"pixelRatio",void 0),pe([Dh(!0)],yd.prototype,"smooth",void 0),pe([ln(!1)],yd.prototype,"safeResize",void 0),pe([Dh()],yd.prototype,"contextSettings",void 0),yd=pe([Vn()],yd);const{copyAndSpread:md,includes:xd,spread:wd,setList:vd}=Ut,{stintSet:bd}=_;let kd=class extends Pl{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:s,fontFamily:i,fontSize:r,fontWeight:n,italic:o,textCase:a,textOverflow:h,padding:l,width:d,height:c}=t;t.__lineHeight=Xh.number(e,r),t.__letterSpacing=Xh.number(s,r),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${o?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==n?n+" ":""}${r||12}px ${i||"caption"}`,bd(t,"__padding",l&&D.fourNumber(l)),bd(t,"__clipText","show"!==h&&!t.__autoSize),bd(t,"__isCharMode",d||c||t.__letterSpacing||"none"!==a),t.__textDrawData=Nh.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:s,italic:i,padding:r,__autoWidth:n,__autoHeight:o}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<s&&wd(a,s/2),n||o){if(h.x=n?a.x:0,h.y=o?a.y:0,h.width=n?a.width:t.width,h.height=o?a.height:t.height,r){const[e,s,i,r]=t.__padding;n&&(h.x-=r,h.width+=s+r),o&&(h.y-=e,h.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(h.width+=.16*s),_.stintSet(this,"isOverflow",!xd(h,a)),this.isOverflow?(vd(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;md(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__updateChange(){super.__updateChange();const t=this.__box;t&&(t.__onUpdateSize(),t.__updateChange())}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,s){const i=this.__box;i&&(i.__nowWorld=this.__nowWorld,i.__draw(t,e,s)),this.textEditing&&!e.exporting||super.__draw(t,e,s)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};pe([Wn(ml)],kd.prototype,"__",void 0),pe([gn(0)],kd.prototype,"width",void 0),pe([gn(0)],kd.prototype,"height",void 0),pe([Sn()],kd.prototype,"boxStyle",void 0),pe([ln(!1)],kd.prototype,"resizeFontSize",void 0),pe([Sn("#000000")],kd.prototype,"fill",void 0),pe([wn("outside")],kd.prototype,"strokeAlign",void 0),pe([An("all")],kd.prototype,"hitFill",void 0),pe([gn("")],kd.prototype,"text",void 0),pe([gn("")],kd.prototype,"placeholder",void 0),pe([gn("caption")],kd.prototype,"fontFamily",void 0),pe([gn(12)],kd.prototype,"fontSize",void 0),pe([gn("normal")],kd.prototype,"fontWeight",void 0),pe([gn(!1)],kd.prototype,"italic",void 0),pe([gn("none")],kd.prototype,"textCase",void 0),pe([gn("none")],kd.prototype,"textDecoration",void 0),pe([gn(0)],kd.prototype,"letterSpacing",void 0),pe([gn({type:"percent",value:1.5})],kd.prototype,"lineHeight",void 0),pe([gn(0)],kd.prototype,"paraIndent",void 0),pe([gn(0)],kd.prototype,"paraSpacing",void 0),pe([gn("x")],kd.prototype,"writingMode",void 0),pe([gn("left")],kd.prototype,"textAlign",void 0),pe([gn("top")],kd.prototype,"verticalAlign",void 0),pe([gn(!0)],kd.prototype,"autoSizeAlign",void 0),pe([gn("normal")],kd.prototype,"textWrap",void 0),pe([gn("show")],kd.prototype,"textOverflow",void 0),pe([Sn(!1)],kd.prototype,"textEditing",void 0),kd=pe([Vn()],kd);let Sd=class extends Pl{get __tag(){return"Path"}};pe([Wn(gl)],Sd.prototype,"__",void 0),pe([wn("center")],Sd.prototype,"strokeAlign",void 0),Sd=pe([Vn()],Sd);let Bd=class extends Ol{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new Sd(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,s,i,r,n){return this}quadraticCurveTo(t,e,s,i){return this}closePath(){return this}rect(t,e,s,i){return this}roundRect(t,e,s,i,r){return this}ellipse(t,e,s,i,r,n,o,a){return this}arc(t,e,s,i,r,n){return this}arcTo(t,e,s,i,r){return this}drawEllipse(t,e,s,i,r,n,o,a){return this}drawArc(t,e,s,i,r,n){return this}drawPoints(t,e,s){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}};function Rd(t,e,s){t.__.__font?jh.fillText(t,e,s):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function Cd(t,e,s,i,r){const n=s.__;d(t)?jh.drawStrokesStyle(t,e,!1,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),i.stroke()),n.__useArrow&&jh.strokeArrow(t,s,i,r)}function Td(t,e,s,i,r){const n=s.__;d(t)?jh.drawStrokesStyle(t,e,!0,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),jh.drawTextStroke(s,i,r))}function Pd(t,e,s,i,r){const n=i.getSameCanvas(!0,!0);n.font=s.__.__font,Td(t,2,s,n,r),n.blendMode="outside"===e?"destination-out":"destination-in",jh.fillText(s,n,r),n.blendMode="normal",ro.copyCanvasByWorld(s,i,n),n.recycle(s.__nowWorld)}pe([Wn(fl)],Bd.prototype,"__",void 0),pe([(t,e)=>{sn(t,e,{get(){return this.__path}})}],Bd.prototype,"path",void 0),Bd=pe([jn(Fi,["set","path","paint"]),Vn()],Bd);const{getSpread:Od,copyAndSpread:Ed,toOuterOf:Ld,getOuterOf:Ad,getByMove:Id,move:Wd,getIntersectData:Md}=Ut,Dd={};let Fd;const{stintSet:zd}=_,{hasTransparent:Nd}=Yh;function Yd(t,e,i){if(!d(e)||!1===e.visible||0===e.opacity)return;let n;const{boxBounds:o}=i.__layout;switch(e.type){case"image":n=Vh.image(i,t,e,o,!Fd||!Fd[e.url]);break;case"linear":n=Hh.linearGradient(e,o);break;case"radial":n=Hh.radialGradient(e,o);break;case"angular":n=Hh.conicGradient(e,o);break;case"solid":const{type:r,color:a,opacity:h}=e;n={type:r,style:Yh.string(a,h)};break;default:s(e.r)||(n={type:"solid",style:Yh.string(e)})}if(n&&(n.originPaint=e,r(n.style)&&Nd(n.style)&&(n.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;n.strokeStyle=e.style}return n}const Xd={compute:function(t,e){const s=e.__,i=[];let r,n,o,a=s.__input[t];l(a)||(a=[a]),Fd=Vh.recycleImage(t,s);for(let s,r=0,n=a.length;r<n;r++)(s=Yd(t,a[r],e))&&(i.push(s),s.strokeStyle&&(o||(o=1),s.strokeStyle.strokeWidth&&(o=Math.max(o,s.strokeStyle.strokeWidth))));s["_"+t]=i.length?i:void 0,i.length?(i.every(t=>t.isTransparent)&&(i.some(t=>t.image)&&(r=!0),n=!0),"fill"===t?(zd(s,"__isAlphaPixelFill",r),zd(s,"__isTransparentFill",n)):(zd(s,"__isAlphaPixelStroke",r),zd(s,"__isTransparentStroke",n),zd(s,"__hasMultiStrokeStyle",o))):s.__removePaint(t,!1)},fill:function(t,e,s,i){s.fillStyle=t,Rd(e,s,i)},fills:function(t,e,s,i){let r,n,o;for(let a=0,h=t.length;a<h;a++){if(r=t[a],n=r.originPaint,r.image){if(o?o++:o=1,Vh.checkImage(r,!e.__.__font,e,s,i))continue;if(!r.style){1===o&&r.image.isPlacehold&&e.drawImagePlaceholder(r,s,i);continue}}if(s.fillStyle=r.style,r.transform||n.scaleFixed){if(s.save(),r.transform&&s.transform(r.transform),n.scaleFixed){const{scaleX:t,scaleY:i}=e.getRenderScaleData(!0);(!0===n.scaleFixed||"zoom-in"===n.scaleFixed&&t>1&&i>1)&&s.scale(1/t,1/i)}n.blendMode&&(s.blendMode=n.blendMode),Rd(e,s,i),s.restore()}else n.blendMode?(s.saveBlendMode(n.blendMode),Rd(e,s,i),s.restoreBlendMode()):Rd(e,s,i)}},fillPathOrText:Rd,fillText:function(t,e,s){const i=t.__,{rows:r,decorationY:n}=i.__textDrawData;let o;i.__isPlacehold&&i.placeholderColor&&(e.fillStyle=i.placeholderColor);for(let t=0,s=r.length;t<s;t++)o=r[t],o.text?e.fillText(o.text,o.x,o.y):o.data&&o.data.forEach(t=>{e.fillText(t.char,t.x,o.y)});if(n){const{decorationColor:t,decorationHeight:s}=i.__textDrawData;t&&(e.fillStyle=t),r.forEach(t=>n.forEach(i=>e.fillRect(t.x,t.y+i,t.width,s)))}},stroke:function(t,e,s,i){const r=e.__;if(r.__strokeWidth)if(r.__font)jh.strokeText(t,e,s,i);else switch(r.strokeAlign){case"center":Cd(t,1,e,s,i);break;case"inside":!function(t,e,s,i){s.save(),s.clipUI(e),Cd(t,2,e,s,i),s.restore()}(t,e,s,i);break;case"outside":!function(t,e,s,i){const r=e.__;if(r.__fillAfterStroke)Cd(t,2,e,s,i);else{const{renderBounds:n}=e.__layout,o=s.getSameCanvas(!0,!0);e.__drawRenderPath(o),Cd(t,2,e,o,i),o.clipUI(r),o.clearWorld(n),ro.copyCanvasByWorld(e,s,o),o.recycle(e.__nowWorld)}}(t,e,s,i)}},strokes:function(t,e,s,i){jh.stroke(t,e,s,i)},strokeText:function(t,e,s,i){switch(e.__.strokeAlign){case"center":Td(t,1,e,s,i);break;case"inside":Pd(t,"inside",e,s,i);break;case"outside":e.__.__fillAfterStroke?Td(t,2,e,s,i):Pd(t,"outside",e,s,i)}},drawTextStroke:function(t,e,s){let i,r=t.__.__textDrawData;const{rows:n,decorationY:o}=r;for(let t=0,s=n.length;t<s;t++)i=n[t],i.text?e.strokeText(i.text,i.x,i.y):i.data&&i.data.forEach(t=>{e.strokeText(t.char,t.x,i.y)});if(o){const{decorationHeight:t}=r;n.forEach(s=>o.forEach(i=>e.strokeRect(s.x,s.y+i,s.width,t)))}},drawStrokesStyle:function(t,e,s,i,r,n){let o;const a=i.__,{__hasMultiStrokeStyle:h}=a;h||r.setStroke(void 0,a.__strokeWidth*e,a);for(let l=0,d=t.length;l<d;l++)if(o=t[l],(!o.image||!Vh.checkImage(o,!1,i,r,n))&&o.style){if(h){const{strokeStyle:t}=o;t?r.setStroke(o.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(o.style,a.__strokeWidth*e,a)}else r.strokeStyle=o.style;o.originPaint.blendMode?(r.saveBlendMode(o.originPaint.blendMode),s?jh.drawTextStroke(i,r,n):r.stroke(),r.restoreBlendMode()):s?jh.drawTextStroke(i,r,n):r.stroke()}},shape:function(t,e,s){const i=e.getSameCanvas(),r=e.bounds,n=t.__nowWorld,o=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,d,c,u,_;Ld(o.strokeSpread?(Ed(Dd,o.boxBounds,o.strokeSpread),Dd):o.boxBounds,n,a);let{scaleX:p,scaleY:g}=t.getRenderScaleData(!0);if(r.includes(a))_=i,h=u=a,l=n;else{let i;if(m.fullImageShadow)i=a;else{const t=o.renderShapeSpread?Od(r,C.swapAndScale(o.renderShapeSpread,p,g)):r;i=Md(t,a)}c=r.getFitMatrix(i);let{a:f,d:y}=c;c.a<1&&(_=e.getSameCanvas(),t.__renderShape(_,s),p*=f,g*=y),u=Ad(a,c),h=Id(u,-c.e,-c.f),l=Ad(n,c),Wd(l,-c.e,-c.f);const x=s.matrix;x?(d=new ft(c),d.multiply(x),f*=x.scaleX,y*=x.scaleY):d=c,d.withScale(f,y),s=Object.assign(Object.assign({},s),{matrix:d})}return t.__renderShape(i,s),{canvas:i,matrix:d,fitMatrix:c,bounds:h,renderBounds:l,worldCanvas:_,shapeBounds:u,scaleX:p,scaleY:g}}};let Ud,jd=new Gt;const{isSame:Vd}=Ut;function Hd(t,e,s,i,r,n){if("fill"===e&&!t.__.__naturalWidth){const e=t.__;if(e.__naturalWidth=i.width/e.pixelRatio,e.__naturalHeight=i.height/e.pixelRatio,e.__autoSide)return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",e.width),t.setProxyAttr("height",e.height)),!1}return r.data||Vh.createData(r,i,s,n),!0}function Gd(t,e){Jd(t,Do.LOAD,e)}function qd(t,e){Jd(t,Do.LOADED,e)}function Qd(t,e,s){e.error=s,t.forceUpdate("surface"),Jd(t,Do.ERROR,e)}function Jd(t,e,s){t.hasEvent(e)&&t.emitEvent(new Do(e,s))}function $d(t,e){const{leafer:s}=t;s&&s.viewReady&&(s.renderer.ignore=e)}const{get:Zd,translate:Kd}=Z,tc=new Gt,ec={},sc={};function ic(t,e,s,i){const n=r(t)||i?(i?s-i*e:s%e)/((i||Math.floor(s/e))-1):t;return"auto"===t&&n<0?0:n}let rc={},nc={a:1,b:0,c:0,d:1,e:0,f:0};const{get:oc,set:ac,rotateOfOuter:hc,translate:lc,scaleOfOuter:dc,multiplyParent:cc,scale:uc,rotate:_c,skew:pc}=Z;function gc(t,e,s,i,r,n,o,a){o&&_c(t,o),a&&pc(t,a.x,a.y),r&&uc(t,r,n),lc(t,e.x+s,e.y+i)}const{get:fc,scale:yc,copy:mc}=Z,{getFloorScale:xc}=D,{abs:wc}=Math;const vc={image:function(t,e,s,i,r){let n,o;const a=$r.get(s);return Ud&&s===Ud.paint&&Vd(i,Ud.boxBounds)?n=Ud.leafPaint:(n={type:s.type,image:a},a.hasAlphaPixel&&(n.isTransparent=!0),Ud=a.use>1?{leafPaint:n,paint:s,boxBounds:jd.set(i)}:null),(r||a.loading)&&(o={image:a,attrName:e,attrValue:s}),a.ready?(Hd(t,e,s,a,n,i),r&&(Gd(t,o),qd(t,o))):a.error?r&&Qd(t,o,a.error):(r&&($d(t,!0),Gd(t,o)),n.loadId=a.load(()=>{$d(t,!1),t.destroyed||(Hd(t,e,s,a,n,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),qd(t,o)),n.loadId=void 0},e=>{$d(t,!1),Qd(t,o,e),n.loadId=void 0}),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),n},checkImage:function(t,e,s,i,r){const{scaleX:n,scaleY:o}=Vh.getImageRenderScaleData(t,s,i,r),{image:a,data:h,originPaint:l}=t,{exporting:d}=r;return!(!h||t.patternId===n+"-"+o&&!d)&&(e&&(h.repeat?e=!1:l.changeful||"miniapp"===m.name&&jo.isResizing(s)||d||(e=m.image.isLarge(a,n,o))),e?(s.__.__isFastShadow&&(i.fillStyle=t.style||"#000",i.fill()),Vh.drawImage(t,n,o,s,i,r),!0):(!t.style||l.sync||d?Vh.createPattern(t,s,i,r):Vh.createPatternTask(t,s,i,r),!1))},drawImage:function(t,e,s,i,r,n){const{data:o,image:a}=t,{blendMode:h}=t.originPaint,{opacity:l,transform:d}=o,c=a.getFull(o.filters),u=i.__;let _,{width:p,height:g}=a;(_=d&&!d.onlyScale||u.path||u.cornerRadius)||l||h?(r.save(),_&&r.clipUI(i),h&&(r.blendMode=h),l&&(r.opacity*=l),d&&r.transform(d),r.drawImage(c,0,0,p,g),r.restore()):(o.scaleX&&(p*=o.scaleX,g*=o.scaleY),r.drawImage(c,0,0,p,g))},getImageRenderScaleData:function(t,e,s,i){const r=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:n}=t;if(s){const{pixelRatio:t}=s;r.scaleX*=t,r.scaleY*=t}return n&&n.scaleX&&(r.scaleX*=Math.abs(n.scaleX),r.scaleY*=Math.abs(n.scaleY)),r},recycleImage:function(t,e){const s=e["_"+t];if(l(s)){let i,r,n,o,a;for(let h=0,d=s.length;h<d;h++)i=s[h],r=i.image,a=r&&r.url,a&&(n||(n={}),n[a]=!0,$r.recycle(r),r.loading&&(o||(o=e.__input&&e.__input[t]||[],l(o)||(o=[o])),r.unload(s[h].loadId,!o.some(t=>t.url===a))));return n}return null},createPatternTask:function(t,e,s,i){t.patternTask||(t.patternTask=$r.patternTasker.add(()=>ge(this,void 0,void 0,function*(){t.patternTask=null,s.bounds.hit(e.__nowWorld)&&Vh.createPattern(t,e,s,i),e.forceUpdate("surface")}),300))},createPattern:function(t,e,s,i){let{scaleX:r,scaleY:n}=Vh.getImageRenderScaleData(t,e,s,i),o=r+"-"+n;if(t.patternId!==o&&!e.destroyed&&(!m.image.isLarge(t.image,r,n)||t.data.repeat)){const{image:s,data:i}=t,{transform:a,gap:h}=i,l=Vh.getPatternFixScale(t,r,n);let d,c,u,{width:_,height:p}=s;l&&(r*=l,n*=l),_*=r,p*=n,h&&(c=h.x*r/wc(i.scaleX||1),u=h.y*n/wc(i.scaleY||1)),(a||1!==r||1!==n)&&(r*=xc(_+(c||0)),n*=xc(p+(u||0)),d=fc(),a&&mc(d,a),yc(d,1/r,1/n));const g=s.getCanvas(_,p,i.opacity,i.filters,c,u,e.leafer&&e.leafer.config.smooth),f=s.getPattern(g,i.repeat||m.origin.noRepeat||"no-repeat",d,t);t.style=f,t.patternId=o}},getPatternFixScale:function(t,e,s){const{image:i}=t;let r,n=m.image.maxPatternSize,o=i.width*i.height;return i.isSVG?e>1&&(r=Math.ceil(e)/e):n>o&&(n=o),(o*=e*s)>n&&(r=Math.sqrt(n/o)),r},createData:function(t,e,s,i){t.data=Vh.getPatternData(s,i,e)},getPatternData:function(t,e,s){t.padding&&(e=tc.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:i,height:n}=s,{opacity:o,mode:a,align:h,offset:l,scale:c,size:u,rotation:_,skew:p,clipSize:g,repeat:f,gap:y,filters:m}=t,x=e.width===i&&e.height===n,w={mode:a},v="center"!==h&&(_||0)%180==90;let b,k;switch(Ut.set(sc,0,0,v?n:i,v?i:n),a&&"cover"!==a&&"fit"!==a?((c||u)&&(D.getScaleData(c,u,s,ec),b=ec.scaleX,k=ec.scaleY),(h||y||f)&&(b&&Ut.scale(sc,b,k,!0),h&&Rt.toPoint(h,sc,e,sc,!0,!0))):x&&!_||(b=k=Ut.getFitScale(e,sc,"fit"!==a),Ut.put(e,s,h,b,!1,sc),Ut.scale(sc,b,k,!0)),l&&lt.move(sc,l),a){case"stretch":x?b&&(b=k=void 0):(b=e.width/i,k=e.height/n,Vh.stretchMode(w,e,b,k));break;case"normal":case"clip":if(sc.x||sc.y||b||g||_||p){let t,s;g&&(t=e.width/g.width,s=e.height/g.height),Vh.clipMode(w,e,sc.x,sc.y,b,k,_,p,t,s),t&&(b=b?b*t:t,k=k?k*s:s)}break;case"repeat":(!x||b||_||p)&&Vh.repeatMode(w,e,i,n,sc.x,sc.y,b,k,_,p,h,t.freeTransform),f||(w.repeat="repeat");const s=d(f);(y||s)&&(w.gap=function(t,e,s,i,r){let n,o;d(t)?(n=t.x,o=t.y):n=o=t;return{x:ic(n,s,r.width,e&&e.x),y:ic(o,i,r.height,e&&e.y)}}(y,s&&f,sc.width,sc.height,e));break;default:b&&Vh.fillOrFitMode(w,e,sc.x,sc.y,b,k,_)}return w.transform||(e.x||e.y)&&Kd(w.transform=Zd(),e.x,e.y),b&&(w.scaleX=b,w.scaleY=k),o&&o<1&&(w.opacity=o),m&&(w.filters=m),f&&(w.repeat=r(f)?"x"===f?"repeat-x":"repeat-y":"repeat"),w},stretchMode:function(t,e,s,i){const r=oc(),{x:n,y:o}=e;n||o?lc(r,n,o):r.onlyScale=!0,uc(r,s,i),t.transform=r},fillOrFitMode:function(t,e,s,i,r,n,o){const a=oc();lc(a,e.x+s,e.y+i),uc(a,r,n),o&&hc(a,{x:e.x+e.width/2,y:e.y+e.height/2},o),t.transform=a},clipMode:function(t,e,s,i,r,n,o,a,h,l){const d=oc();gc(d,e,s,i,r,n,o,a),h&&(o||a?(ac(nc),dc(nc,e,h,l),cc(d,nc)):dc(d,e,h,l)),t.transform=d},repeatMode:function(t,e,s,i,r,n,o,a,h,l,d,c){const u=oc();if(c)gc(u,e,r,n,o,a,h,l);else{if(h)if("center"===d)hc(u,{x:s/2,y:i/2},h);else switch(_c(u,h),h){case 90:lc(u,i,0);break;case 180:lc(u,s,i);break;case 270:lc(u,0,s)}rc.x=e.x+r,rc.y=e.y+n,lc(u,rc.x,rc.y),o&&dc(u,rc,o,a)}t.transform=u}},{toPoint:bc}=kt,{hasTransparent:kc}=Yh,Sc={},Bc={};function Rc(t,e,s,i){if(s){let n,o,a,h;for(let t=0,l=s.length;t<l;t++)n=s[t],r(n)?(a=t/(l-1),o=Yh.string(n,i)):(a=n.offset,o=Yh.string(n.color,i)),e.addColorStop(a,o),!h&&kc(o)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:Cc,getDistance:Tc}=lt,{get:Pc,rotateOfOuter:Oc,scaleOfOuter:Ec}=Z,{toPoint:Lc}=kt,Ac={},Ic={};function Wc(t,e,s,i,r){let n;const{width:o,height:a}=t;if(o!==a||i){const t=Cc(e,s);n=Pc(),r?(Ec(n,e,o/a*(i||1),1),Oc(n,e,t+90)):(Ec(n,e,1,o/a*(i||1)),Oc(n,e,t))}return n}const{getDistance:Mc}=lt,{toPoint:Dc}=kt,Fc={},zc={};const Nc={linearGradient:function(t,e){let{from:s,to:i,type:r,opacity:n}=t;bc(s||"top",e,Sc),bc(i||"bottom",e,Bc);const o=m.canvas.createLinearGradient(Sc.x,Sc.y,Bc.x,Bc.y),a={type:r,style:o};return Rc(a,o,t.stops,n),a},radialGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,stretch:o}=t;Lc(s||"center",e,Ac),Lc(i||"bottom",e,Ic);const a=m.canvas.createRadialGradient(Ac.x,Ac.y,0,Ac.x,Ac.y,Tc(Ac,Ic)),h={type:r,style:a};Rc(h,a,t.stops,n);const l=Wc(e,Ac,Ic,o,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,stretch:o}=t;Dc(s||"center",e,Fc),Dc(i||"bottom",e,zc);const a=m.conicGradientSupport?m.canvas.createConicGradient(0,Fc.x,Fc.y):m.canvas.createRadialGradient(Fc.x,Fc.y,0,Fc.x,Fc.y,Mc(Fc,zc)),h={type:r,style:a};Rc(h,a,t.stops,n);const l=Wc(e,Fc,zc,o||1,m.conicGradientRotate90);return l&&(h.transform=l),h},getTransform:Wc},{copy:Yc,move:Xc,toOffsetOutBounds:Uc}=Ut,{max:jc,abs:Vc}=Math,Hc={},Gc=new ft,qc={};function Qc(t,e){let s,i,r,n,o=0,a=0,h=0,l=0;return e.forEach(t=>{s=t.x||0,i=t.y||0,n=1.5*(t.blur||0),r=Vc(t.spread||0),o=jc(o,r+n-i),a=jc(a,r+n+s),h=jc(h,r+n+i),l=jc(l,r+n-s)}),o===a&&a===h&&h===l?o:[o,a,h,l]}function Jc(t,e,s){const{shapeBounds:i}=s;let r,n;m.fullImageShadow?(Yc(Hc,t.bounds),Xc(Hc,e.x-i.x,e.y-i.y),r=t.bounds,n=Hc):(r=i,n=e),t.copyWorld(s.canvas,r,n)}const{toOffsetOutBounds:$c}=Ut,Zc={};const Kc=Qc;const tu={shadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{shadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;Uc(h,qc,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.setWorldShadow(qc.offsetX+(o.x||0)*c*f,qc.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f,Yh.string(o.color)),r=Gh.getShadowTransform(t,_,s,o,qc,f),r&&_.setTransform(r),Jc(_,qc,s),r&&_.resetTransform(),i=l,o.box&&(_.restore(),_.save(),a&&(_.copyWorld(_,l,n,"copy"),i=n),a?_.copyWorld(a,n,n,"destination-out"):_.copyWorld(s.canvas,d,h,"destination-out")),ro.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<p&&_.clearWorld(i)}),_.recycle(i)},innerShadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{innerShadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;$c(h,Zc,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.save(),_.setWorldShadow(Zc.offsetX+(o.x||0)*c*f,Zc.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f),r=Gh.getShadowTransform(t,_,s,o,Zc,f,!0),r&&_.setTransform(r),Jc(_,Zc,s),_.restore(),a?(_.copyWorld(_,l,n,"copy"),_.copyWorld(a,n,n,"source-out"),i=n):(_.copyWorld(s.canvas,d,h,"source-out"),i=l),_.fillWorld(i,Yh.string(o.color),"source-in"),ro.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<p&&_.clearWorld(i)}),_.recycle(i)},blur:function(t,e,s){const{blur:i}=t.__;s.setWorldBlur(i*t.__nowWorld.a),s.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),s.filter="none"},backgroundBlur:function(t,e,s){},getShadowRenderSpread:Qc,getShadowTransform:function(t,e,s,i,r,n,o){if(i.spread){const s=2*i.spread*n*(o?-1:1),{width:a,height:h}=t.__layout.strokeBounds;return Gc.set().scaleOfOuter({x:(r.x+r.width/2)*e.pixelRatio,y:(r.y+r.height/2)*e.pixelRatio},1+s/a,1+s/h),Gc}},isTransformShadow(t){},getInnerShadowSpread:Kc},{excludeRenderBounds:eu}=_o;let su;function iu(t,e,s,i,r,n,o,a){switch(e){case"grayscale":su||(su=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,s,i,r,n){const o=t.__nowWorld;s.resetTransform(),s.opacity=1,s.useMask(i,o),n&&i.recycle(o);nu(t,e,s,1,r,n)}(t,s,i,r,o,a);break;case"opacity-path":nu(t,s,i,n,o,a);break;case"path":a&&s.restore()}}function ru(t){return t.getSameCanvas(!1,!0)}function nu(t,e,s,i,r,n){const o=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(s,o,void 0,r),n?s.recycle(o):s.clearWorld(o)}Ol.prototype.__renderMask=function(t,e){let s,i,r,n,o,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(s=h[l],a=s.__.mask,a){o&&(iu(this,o,t,r,i,n,void 0,!0),i=r=null),"clipping"!==a&&"clipping-path"!==a||eu(s,e)||s.__render(t,e),n=s.__.opacity,su=!1,"path"===a||"clipping-path"===a?(n<1?(o="opacity-path",r||(r=ru(t))):(o="path",t.save()),s.__clip(r||t,e)):(o="grayscale"===a?"grayscale":"alpha",i||(i=ru(t)),r||(r=ru(t)),s.__render(i,e));continue}const d=1===n&&s.__.__blendMode;d&&iu(this,o,t,r,i,n,void 0,!1),eu(s,e)||s.__render(r||t,e),d&&iu(this,o,t,r,i,n,d,!1)}iu(this,o,t,r,i,n,void 0,!0)};const ou=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",au=ou+"_#~&*+\\=|≮≯≈≠=…",hu=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map(([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`).join("|"));function lu(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const du=lu("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),cu=lu("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),uu=lu(ou),_u=lu(au),pu=lu("- —/~|┆·");var gu;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(gu||(gu={}));const{Letter:fu,Single:yu,Before:mu,After:xu,Symbol:wu,Break:vu}=gu;function bu(t){return du[t]?fu:pu[t]?vu:cu[t]?mu:uu[t]?xu:_u[t]?wu:hu.test(t)?yu:fu}const ku={trimRight(t){const{words:e}=t;let s,i=0,r=e.length;for(let n=r-1;n>-1&&(s=e[n].data[0]," "===s.char);n--)i++,t.width-=s.width;i&&e.splice(r-i,i)}};function Su(t,e,s){switch(e){case"title":return s?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:Bu}=ku,{Letter:Ru,Single:Cu,Before:Tu,After:Pu,Symbol:Ou,Break:Eu}=gu;let Lu,Au,Iu,Wu,Mu,Du,Fu,zu,Nu,Yu,Xu,Uu,ju,Vu,Hu,Gu,qu,Qu=[];function Ju(t,e){Nu&&!zu&&(zu=Nu),Lu.data.push({char:t,width:e}),Iu+=e}function $u(){Wu+=Iu,Lu.width=Iu,Au.words.push(Lu),Lu={data:[]},Iu=0}function Zu(){Vu&&(Hu.paraNumber++,Au.paraStart=!0,Vu=!1),Nu&&(Au.startCharSize=zu,Au.endCharSize=Nu,zu=0),Au.width=Wu,Gu.width?Bu(Au):qu&&Ku(),Qu.push(Au),Au={words:[]},Wu=0}function Ku(){Wu>(Hu.maxWidth||0)&&(Hu.maxWidth=Wu)}const{top:t_,right:e_,bottom:s_,left:i_}=wt;function r_(t,e,s){const{bounds:i,rows:r}=t;i[e]+=s;for(let t=0;t<r.length;t++)r[t][e]+=s}const n_={getDrawData:function(t,e){r(t)||(t=String(t));let s=0,i=0,n=e.__getInput("width")||0,o=e.__getInput("height")||0;const{__padding:a}=e;a&&(n?(s=a[i_],n-=a[e_]+a[i_],!n&&(n=.01)):e.autoSizeAlign||(s=a[i_]),o?(i=a[t_],o-=a[t_]+a[s_],!o&&(o=.01)):e.autoSizeAlign||(i=a[t_]));const h={bounds:{x:s,y:i,width:n,height:o},rows:[],paraNumber:0,font:m.canvas.font=e.__font};return function(t,e,s){Hu=t,Qu=t.rows,Gu=t.bounds,qu=!Gu.width&&!s.autoSizeAlign;const{__letterSpacing:i,paraIndent:r,textCase:n}=s,{canvas:o}=m,{width:a}=Gu;if(s.__isCharMode){const t="none"!==s.textWrap,h="break"===s.textWrap;Vu=!0,Xu=null,zu=Fu=Nu=Iu=Wu=0,Lu={data:[]},Au={words:[]},i&&(e=[...e]);for(let s=0,l=e.length;s<l;s++)Du=e[s],"\n"===Du?(Iu&&$u(),Au.paraEnd=!0,Zu(),Vu=!0):(Yu=bu(Du),Yu===Ru&&"none"!==n&&(Du=Su(Du,n,!Iu)),Fu=o.measureText(Du).width,i&&(i<0&&(Nu=Fu),Fu+=i),Uu=Yu===Cu&&(Xu===Cu||Xu===Ru)||Xu===Cu&&Yu!==Pu,ju=!(Yu!==Tu&&Yu!==Cu||Xu!==Ou&&Xu!==Pu),Mu=Vu&&r?a-r:a,t&&a&&Wu+Iu+Fu>Mu&&(h?(Iu&&$u(),Wu&&Zu()):(ju||(ju=Yu===Ru&&Xu==Pu),Uu||ju||Yu===Eu||Yu===Tu||Yu===Cu||Iu+Fu>Mu?(Iu&&$u(),Wu&&Zu()):Wu&&Zu()))," "===Du&&!0!==Vu&&Wu+Iu===0||(Yu===Eu?(" "===Du&&Iu&&$u(),Ju(Du,Fu),$u()):Uu||ju?(Iu&&$u(),Ju(Du,Fu)):Ju(Du,Fu)),Xu=Yu);Iu&&$u(),Wu&&Zu(),Qu.length>0&&(Qu[Qu.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{Hu.paraNumber++,Wu=o.measureText(t).width,Qu.push({x:r||0,text:t,width:Wu,paraStart:!0}),qu&&Ku()})}(h,t,e),a&&function(t,e,s,i,r){if(!i&&s.autoSizeAlign)switch(s.textAlign){case"left":r_(e,"x",t[i_]);break;case"right":r_(e,"x",-t[e_])}if(!r&&s.autoSizeAlign)switch(s.verticalAlign){case"top":r_(e,"y",t[t_]);break;case"bottom":r_(e,"y",-t[s_])}}(a,h,e,n,o),function(t,e){const{rows:s,bounds:i}=t,r=s.length,{__lineHeight:n,__baseLine:o,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:g,height:f}=i,y=n*r+(c?c*(t.paraNumber-1):0),m=o;if(h&&y>f)y=Math.max(f,n),r>1&&(t.overflow=r);else if(f||u)switch(d){case"middle":p+=(f-y)/2;break;case"bottom":p+=f-y}m+=p;let x,w,v,b=g||u?g:t.maxWidth;for(let o=0,d=r;o<d;o++){if(x=s[o],x.x=_,x.width<g||x.width>g&&!h)switch(l){case"center":x.x+=(b-x.width)/2;break;case"right":x.x+=b-x.width}x.paraStart&&c&&o>0&&(m+=c),x.y=m,m+=n,t.overflow>o&&m>y&&(x.isOverflow=!0,t.overflow=o+1),w=x.x,v=x.width,a<0&&(x.width<0?(v=-x.width+e.fontSize+a,w-=v,v+=e.fontSize):v-=a),w<i.x&&(i.x=w),v>i.width&&(i.width=v),h&&g&&g<v&&(x.isOverflow=!0,t.overflow||(t.overflow=s.length))}i.y=p,i.height=y}(h,e),e.__isCharMode&&function(t,e,s){const{rows:i}=t,{textAlign:r,paraIndent:n,letterSpacing:o}=e,a=s&&r.includes("both"),h=a||s&&r.includes("justify"),l=h&&r.includes("letter");let d,c,u,_,p,g,f,y,m,x;i.forEach(t=>{t.words&&(p=n&&t.paraStart?n:0,y=t.words.length,h&&(x=!t.paraEnd||a,c=s-t.width-p,l?_=c/(t.words.reduce((t,e)=>t+e.data.length,0)-1):u=y>1?c/(y-1):0),g=o||t.isOverflow||l?0:u?1:2,t.isOverflow&&!o&&(t.textMode=!0),2===g?(t.x+=p,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=p,d=t.x,t.data=[],t.words.forEach((e,s)=>{1===g?(f={char:"",x:d},d=function(t,e,s){return t.forEach(t=>{s.char+=t.char,e+=t.width}),e}(e.data,d,f),(t.isOverflow||" "!==f.char)&&t.data.push(f)):d=function(t,e,s,i,r){return t.forEach(t=>{(i||" "!==t.char)&&(t.x=e,s.push(t)),e+=t.width,r&&(e+=r)}),e}(e.data,d,t.data,t.isOverflow,x&&_),x&&(m=s===y-1,u?m||(d+=u,t.width+=u):_&&(t.width+=_*(e.data.length-(m?1:0))))})),t.words=null)})}(h,e,n),h.overflow&&function(t,e,s,i){if(!i)return;const{rows:r,overflow:n}=t;let{textOverflow:o}=e;if(r.splice(n),o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const h=o?m.canvas.measureText(o).width:0,l=s+i-h;("none"===e.textWrap?r:[r[n-1]]).forEach(e=>{if(e.isOverflow&&e.data){let s=e.data.length-1;for(let i=s;i>-1&&(t=e.data[i],a=t.x+t.width,!(i===s&&a<l));i--){if(a<l&&" "!==t.char||!i){e.data.splice(i+1),e.width-=t.width;break}e.width-=t.width}e.width+=h,e.data.push({char:o,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(h,e,s,n),"none"!==e.textDecoration&&function(t,e){let s,i=0;const{fontSize:r,textDecoration:n}=e;switch(t.decorationHeight=r/11,d(n)?(s=n.type,n.color&&(t.decorationColor=Yh.string(n.color)),n.offset&&(i=Math.min(.3*r,Math.max(n.offset,.15*-r)))):s=n,s){case"under":t.decorationY=[.15*r+i];break;case"delete":t.decorationY=[.35*-r];break;case"under-delete":t.decorationY=[.15*r+i,.35*-r]}}(h,e),h}};const o_={string:function(t,e){if(!t)return"#000";const i=o(e)&&e<1;if(r(t)){if(!i||!Yh.object)return t;t=Yh.object(t)}let n=s(t.a)?1:t.a;i&&(n*=e);const a=t.r+","+t.g+","+t.b;return 1===n?"rgb("+a+")":"rgba("+a+","+n+")"}};Object.assign(Nh,n_),Object.assign(Yh,o_),Object.assign(jh,Xd),Object.assign(Vh,vc),Object.assign(Hh,Nc),Object.assign(Gh,tu);try{wx&&vh(0,wx)}catch(t){}export{Rt as AlignHelper,t as Answer,kt as AroundHelper,Qt as AutoBounds,ns as BezierHelper,Gt as Bounds,Fo as BoundsEvent,Ut as BoundsHelper,Nl as Box,al as BoxData,ph as Branch,yo as BranchHelper,La as BranchRender,yd as Canvas,wl as CanvasData,_e as CanvasManager,Ao as ChildEvent,Yh as ColorConvert,oe as Creator,_ as DataHelper,Zt as Debug,wt as Direction4,vt as Direction9,Gh as Effect,Vl as Ellipse,ul as EllipseData,ps as EllipseHelper,Lo as Event,ce as EventCreator,ea as Eventer,Qh as Export,Ur as FileHelper,qh as Filter,C as FourNumberHelper,Yl as Frame,ll as FrameData,Ol as Group,ol as GroupData,gd as Image,xl as ImageData,Do as ImageEvent,$r as ImageManager,w as IncrementId,Ho as LayoutEvent,Ah as Layouter,rh as Leaf,Pa as LeafBounds,_o as LeafBoundsHelper,g as LeafData,pa as LeafDataProxy,ua as LeafEventer,ro as LeafHelper,Eo as LeafLayout,fh as LeafLevelList,gh as LeafList,va as LeafMatrix,Oa as LeafRender,Al as Leafer,mh as LeaferCanvas,Pe as LeaferCanvasBase,hl as LeaferData,qo as LeaferEvent,en as LeaferImage,pd as Line,dl as LineData,D as MathHelper,ft as Matrix,Z as MatrixHelper,fd as MyImage,Ie as NeedConvertToCanvasCommandMap,z as OneRadian,N as PI2,Y as PI_2,jh as Paint,Hh as PaintGradient,Vh as PaintImage,Sd as Path,Uh as PathArrow,Er as PathBounds,vi as PathCommandDataHelper,Le as PathCommandMap,Zs as PathConvert,Fr as PathCorner,Fi as PathCreator,gl as PathData,Ki as PathDrawer,Oe as PathHelper,Fe as PathNumberCommandLengthMap,De as PathNumberCommandMap,Bd as Pen,fl as PenData,m as Platform,ne as Plugin,pt as Point,lt as PointHelper,Kl as Polygon,_l as PolygonData,Wo as PropertyEvent,Il as Rect,cl as RectData,ze as RectHelper,Cl as RectRender,Go as RenderEvent,Wh as Renderer,jo as ResizeEvent,Qr as Resource,se as Run,od as Star,pl as StarData,Jh as State,Jt as StringNumberMap,Hr as TaskItem,Gr as TaskProcessor,kd as Text,Nh as TextConvert,ml as TextData,$h as Transition,mt as TwoPointBoundsHelper,Pl as UI,kl as UIBounds,he as UICreator,rl as UIData,Bl as UIRender,Xh as UnitConvert,vo as WaitHelper,Vo as WatchEvent,bh as Watcher,kn as affectRenderBoundsType,wn as affectStrokeBoundsType,an as attr,un as autoLayoutType,gn as boundsType,Xr as canvasPatch,Te as canvasSizeAttrs,zh as createAttr,nn as createDescriptor,In as cursorType,Wn as dataProcessor,ln as dataType,on as decorateLeafAttr,Dn as defineDataProcessor,sn as defineKey,hn as defineLeafAttr,Bn as dimType,yn as doBoundsType,vn as doStrokeType,Mh as effectType,e as emptyData,Ln as eraserType,Mo as extraPropertyEventMap,U as getBoundsData,rn as getDescriptor,j as getMatrixData,X as getPointData,An as hitType,l as isArray,c as isData,u as isEmptyData,n as isFinite,i as isNull,o as isNumber,d as isObject,r as isString,s as isUndefined,Mn as layoutProcessor,Ko as leaferTransformAttrMap,En as maskType,fn as naturalBoundsType,Rn as opacityType,zr as path,mn as pathInputType,xn as pathType,Nr as pen,dn as positionType,Vn as registerUI,Hn as registerUIEvent,Dh as resizeType,Yn as rewrite,Xn as rewriteAble,pn as rotationType,_n as scaleType,cn as scrollType,On as sortType,bn as strokeType,Sn as surfaceType,qt as tempBounds,yt as tempMatrix,gt as tempPoint,h as tryToNumber,vh as useCanvas,jn as useModule,yh as version,Cn as visibleType,Fh as zoomLayerType};
2
2
  //# sourceMappingURL=miniapp.module.min.js.map