UNPKG

yugioh-card

Version:

<h1 align="center">🎉 游戏王卡片 - Yugioh Card 🎉</h1>

1 lines 442 kB
(function(Ct,U){typeof exports=="object"&&typeof module<"u"?U(exports):typeof define=="function"&&define.amd?define(["exports"],U):(Ct=typeof globalThis<"u"?globalThis:Ct||self,U(Ct.YugiohCard={}))})(this,function(Ct){"use strict";const U={toURL(e,t){let A=encodeURIComponent(e);return t==="text"?A="data:text/plain;charset=utf-8,"+A:t==="svg"&&(A="data:image/svg+xml,"+A),A},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",getRealURL(e){const{prefix:t,suffix:A}=U.image;return!A||e.startsWith("data:")||e.startsWith("blob:")||(e+=(e.includes("?")?"&":"?")+A),t&&e[0]==="/"&&(e=t+e),e}}},$e={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(e){const{types:t}=OB;return t[e]?t[e]++:(t[e]=1,0)}},OB=$e;var Wn;(function(e){e[e.No=0]="No",e[e.Yes=1]="Yes",e[e.NoAndSkip=2]="NoAndSkip",e[e.YesAndSkip=3]="YesAndSkip"})(Wn||(Wn={}));const PB={};function E(e){return e===void 0}function Ot(e){return e==null}function G(e){return typeof e=="string"}const{isFinite:$B}=Number;function nt(e){return typeof e=="number"}const WB=/^-?\d+(?:\.\d+)?$/;function XB(e){return typeof e=="string"&&WB.test(e)?+e:e}const{isArray:V}=Array;function O(e){return e&&typeof e=="object"}function zB(e){return O(e)&&!V(e)}function GB(e){return JSON.stringify(e)==="{}"}const et={default:(e,t)=>(qi(t,e),qi(e,t),e),assign(e,t,A){let s;Object.keys(t).forEach(i=>{var r,n;if(s=t[i],s?.constructor===Object&&((r=e[i])===null||r===void 0?void 0:r.constructor)===Object)return qi(e[i],t[i],A&&A[i]);A&&i in A?((n=A[i])===null||n===void 0?void 0:n.constructor)===Object&&qi(e[i]={},t[i],A[i]):e[i]=t[i]})},copyAttrs:(e,t,A)=>(A.forEach(s=>{E(t[s])||(e[s]=t[s])}),e),clone:e=>JSON.parse(JSON.stringify(e)),toMap(e){const t={};for(let A=0,s=e.length;A<s;A++)t[e[A]]=!0;return t},stintSet(e,t,A){A||(A=void 0),e[t]!==A&&(e[t]=A)}},{assign:qi}=et;let Al=class{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&t.length===6&&t[0]===1}get __blendMode(){if(this.eraser&&this.eraser!=="path")return"destination-out";const{blendMode:t}=this;return t==="pass-through"?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const A=this.__input[t];if(!E(A))return A}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:A}=this;let s;for(let i in this)i[0]!=="_"&&(s=A?A[i]:void 0,t[i]=E(s)?this[i]:s);return t}__setInput(t,A){this.__input||(this.__input={}),this.__input[t]=A}__getInput(t){if(this.__input){const A=this.__input[t];if(!E(A))return A}if(t!=="path"||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!E(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,A){const s={};if(t)if(V(t))for(let i of t)s[i]=this.__getInput(i);else for(let i in t)s[i]=this.__getInput(i);else{let i,r,{__input:n}=this;s.tag=this.__leaf.tag;for(let a in this)if(a[0]!=="_"&&(i=this["_"+a],!E(i))){if(a==="path"&&!this.__pathInputed)continue;r=n?n[a]:void 0,s[a]=E(r)?i:r}}if(A&&A.matrix){const{a:i,b:r,c:n,d:a,e:o,f:h}=this.__leaf.__localMatrix;s.matrix={a:i,b:r,c:n,d:a,e:o,f:h}}return s}__setMiddle(t,A){this.__middle||(this.__middle={}),this.__middle[t]=A}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if(t.blendMode==="pass-through"){const A=this.__leaf;t.opacity<1&&(A.isBranch||t.__hasMultiPaint)||A.__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{round:VB,pow:YB,PI:Xn}=Math,yt={within:(e,t,A)=>(O(t)&&(A=t.max,t=t.min),!E(t)&&e<t&&(e=t),!E(A)&&e>A&&(e=A),e),fourNumber(e,t){let A;if(V(e))switch(e.length){case 4:A=E(t)?e:[...e];break;case 2:A=[e[0],e[1],e[0],e[1]];break;case 3:A=[e[0],e[1],e[2],e[1]];break;case 1:e=e[0];break;default:e=0}if(A||(A=[e,e,e,e]),t)for(let s=0;s<4;s++)A[s]>t&&(A[s]=t);return A},formatRotation:(e,t)=>(e%=360,t?e<0&&(e+=360):(e>180&&(e-=360),e<-180&&(e+=360)),yt.float(e)),getGapRotation(e,t,A=0){let s=e+A;if(t>1){const i=Math.abs(s%t);(i<1||i>t-1)&&(s=Math.round(s/t)*t)}return s-A},float(e,t){const A=E(t)?1e12:YB(10,t);return(e=VB(e*A)/A)===-0?0:e},getScaleData(e,t,A,s){if(s||(s={}),t){const i=(nt(t)?t:t.width||0)/A.width,r=(nt(t)?t:t.height||0)/A.height;s.scaleX=i||r||1,s.scaleY=r||i||1}else e&&yt.assignScale(s,e);return s},assignScale(e,t){nt(t)?e.scaleX=e.scaleY=t:(e.scaleX=t.x,e.scaleY=t.y)},randInt:tr,randColor:e=>`rgba(${tr(255)},${tr(255)},${tr(255)},${e||1})`};function tr(e){return Math.round(Math.random()*e)}const at=Xn/180,we=2*Xn,es=Xn/2;function sl(){return{x:0,y:0}}function il(){return{x:0,y:0,width:0,height:0}}function zn(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:Gn,cos:Vn,acos:er,sqrt:Yn}=Math,{float:As}=yt,ss={};function rl(){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 $={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:rl(),tempMatrix:{},set(e,t=1,A=0,s=0,i=1,r=0,n=0){e.a=t,e.b=A,e.c=s,e.d=i,e.e=r,e.f=n},get:zn,getWorld:rl,copy(e,t){e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f},translate(e,t,A){e.e+=t,e.f+=A},translateInner(e,t,A,s){e.e+=e.a*t+e.c*A,e.f+=e.b*t+e.d*A,s&&(e.e-=t,e.f-=A)},scale(e,t,A=t){e.a*=t,e.b*=t,e.c*=A,e.d*=A},scaleOfOuter(e,t,A,s){Ut.toInnerPoint(e,t,ss),Ut.scaleOfInner(e,ss,A,s)},scaleOfInner(e,t,A,s=A){Ut.translateInner(e,t.x,t.y),Ut.scale(e,A,s),Ut.translateInner(e,-t.x,-t.y)},rotate(e,t){const{a:A,b:s,c:i,d:r}=e,n=Vn(t*=at),a=Gn(t);e.a=A*n-s*a,e.b=A*a+s*n,e.c=i*n-r*a,e.d=i*a+r*n},rotateOfOuter(e,t,A){Ut.toInnerPoint(e,t,ss),Ut.rotateOfInner(e,ss,A)},rotateOfInner(e,t,A){Ut.translateInner(e,t.x,t.y),Ut.rotate(e,A),Ut.translateInner(e,-t.x,-t.y)},skew(e,t,A){const{a:s,b:i,c:r,d:n}=e;A&&(A*=at,e.a=s+r*A,e.b=i+n*A),t&&(t*=at,e.c=r+s*t,e.d=n+i*t)},skewOfOuter(e,t,A,s){Ut.toInnerPoint(e,t,ss),Ut.skewOfInner(e,ss,A,s)},skewOfInner(e,t,A,s=0){Ut.translateInner(e,t.x,t.y),Ut.skew(e,A,s),Ut.translateInner(e,-t.x,-t.y)},multiply(e,t){const{a:A,b:s,c:i,d:r,e:n,f:a}=e;e.a=t.a*A+t.b*i,e.b=t.a*s+t.b*r,e.c=t.c*A+t.d*i,e.d=t.c*s+t.d*r,e.e=t.e*A+t.f*i+n,e.f=t.e*s+t.f*r+a},multiplyParent(e,t,A,s,i,r){let{e:n,f:a}=e;if(r&&(n+=r.scrollX,a+=r.scrollY),A||(A=e),E(s)&&(s=e.a!==1||e.b||e.c||e.d!==1),s){const{a:o,b:h,c:l,d:c}=e;A.a=o*t.a+h*t.c,A.b=o*t.b+h*t.d,A.c=l*t.a+c*t.c,A.d=l*t.b+c*t.d,i&&(A.scaleX=t.scaleX*i.scaleX,A.scaleY=t.scaleY*i.scaleY)}else A.a=t.a,A.b=t.b,A.c=t.c,A.d=t.d,i&&(A.scaleX=t.scaleX,A.scaleY=t.scaleY);A.e=n*t.a+a*t.c+t.e,A.f=n*t.b+a*t.d+t.f},divide(e,t){Ut.multiply(e,Ut.tempInvert(t))},divideParent(e,t){Ut.multiplyParent(e,Ut.tempInvert(t))},tempInvert(e){const{tempMatrix:t}=Ut;return Ut.copy(t,e),Ut.invert(t),t},invert(e){const{a:t,b:A,c:s,d:i,e:r,f:n}=e;if(A||s){const a=1/(t*i-A*s);e.a=i*a,e.b=-A*a,e.c=-s*a,e.d=t*a,e.e=-(r*i-n*s)*a,e.f=-(n*t-r*A)*a}else if(t===1&&i===1)e.e=-r,e.f=-n;else{const a=1/(t*i);e.a=i*a,e.d=t*a,e.e=-r*i*a,e.f=-n*t*a}},toOuterPoint(e,t,A,s){const{x:i,y:r}=t;A||(A=t),A.x=i*e.a+r*e.c,A.y=i*e.b+r*e.d,s||(A.x+=e.e,A.y+=e.f)},toInnerPoint(e,t,A,s){const{a:i,b:r,c:n,d:a}=e,o=1/(i*a-r*n),{x:h,y:l}=t;if(A||(A=t),A.x=(h*a-l*n)*o,A.y=(l*i-h*r)*o,!s){const{e:c,f:d}=e;A.x-=(c*a-d*n)*o,A.y-=(d*i-c*r)*o}},setLayout(e,t,A,s,i){const{x:r,y:n,scaleX:a,scaleY:o}=t;if(E(i)&&(i=t.rotation||t.skewX||t.skewY),i){const{rotation:h,skewX:l,skewY:c}=t,d=h*at,u=Vn(d),g=Gn(d);if(l||c){const B=l*at,f=c*at;e.a=(u+f*-g)*a,e.b=(g+f*u)*a,e.c=(B*u-g)*o,e.d=(u+B*g)*o}else e.a=u*a,e.b=g*a,e.c=-g*o,e.d=u*o}else e.a=a,e.b=0,e.c=0,e.d=o;e.e=r,e.f=n,(A=A||s)&&Ut.translateInner(e,-A.x,-A.y,!s)},getLayout(e,t,A,s){const{a:i,b:r,c:n,d:a,e:o,f:h}=e;let l,c,d,u,g,B=o,f=h;if(r||n){const _=i*a-r*n;if(n&&!s){l=Yn(i*i+r*r),c=_/l;const m=i/l;d=r>0?er(m):-er(m)}else{c=Yn(n*n+a*a),l=_/c;const m=n/c;d=es-(a>0?er(-m):-er(m))}const p=As(Vn(d)),Q=Gn(d);l=As(l),c=As(c),u=p?As((n/c+Q)/p/at,9):0,g=p?As((r/l-Q)/p/at,9):0,d=As(d/at)}else l=i,c=a,d=u=g=0;return(t=A||t)&&(B+=t.x*i+t.y*n,f+=t.x*r+t.y*a,A||(B-=t.x,f-=t.y)),{x:B,y:f,scaleX:l,scaleY:c,rotation:d,skewX:u,skewY:g}},withScale(e,t,A=t){const s=e;if(!t||!A){const{a:i,b:r,c:n,d:a}=e;r||n?A=(i*a-r*n)/(t=Yn(i*i+r*r)):(t=i,A=a)}return s.scaleX=t,s.scaleY=A,s},reset(e){Ut.set(e)}},Ut=$,{toInnerPoint:Nn,toOuterPoint:nl}=$,{sin:al,cos:ol,abs:hl,sqrt:NB,atan2:JB,min:jB,round:Ar}=Math,L={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(e,t=0,A=0){e.x=t,e.y=A},setRadius(e,t,A){e.radiusX=t,e.radiusY=E(A)?t:A},copy(e,t){e.x=t.x,e.y=t.y},copyFrom(e,t,A){e.x=t,e.y=A},round(e,t){e.x=t?Ar(e.x-.5)+.5:Ar(e.x),e.y=t?Ar(e.y-.5)+.5:Ar(e.y)},move(e,t,A){O(t)?(e.x+=t.x,e.y+=t.y):(e.x+=t,e.y+=A)},scale(e,t,A=t){e.x&&(e.x*=t),e.y&&(e.y*=A)},scaleOf(e,t,A,s=A){e.x+=(e.x-t.x)*(A-1),e.y+=(e.y-t.y)*(s-1)},rotate(e,t,A){A||(A=QA.defaultPoint);const s=ol(t*=at),i=al(t),r=e.x-A.x,n=e.y-A.y;e.x=A.x+r*s-n*i,e.y=A.y+r*i+n*s},tempToInnerOf(e,t){const{tempPoint:A}=QA;return jn(A,e),Nn(t,A,A),A},tempToOuterOf(e,t){const{tempPoint:A}=QA;return jn(A,e),nl(t,A,A),A},tempToInnerRadiusPointOf(e,t){const{tempRadiusPoint:A}=QA;return jn(A,e),QA.toInnerRadiusPointOf(e,t,A),A},toInnerRadiusPointOf(e,t,A){A||(A=e),Nn(t,e,A),A.radiusX=Math.abs(e.radiusX/t.scaleX),A.radiusY=Math.abs(e.radiusY/t.scaleY)},toInnerOf(e,t,A){Nn(t,e,A)},toOuterOf(e,t,A){nl(t,e,A)},getCenter:(e,t)=>({x:e.x+(t.x-e.x)/2,y:e.y+(t.y-e.y)/2}),getCenterX:(e,t)=>e+(t-e)/2,getCenterY:(e,t)=>e+(t-e)/2,getDistance:(e,t)=>Jn(e.x,e.y,t.x,t.y),getDistanceFrom(e,t,A,s){const i=hl(A-e),r=hl(s-t);return NB(i*i+r*r)},getMinDistanceFrom:(e,t,A,s,i,r)=>jB(Jn(e,t,A,s),Jn(A,s,i,r)),getAngle:(e,t)=>ll(e,t)/at,getRotation:(e,t,A,s)=>(s||(s=t),QA.getRadianFrom(e.x,e.y,t.x,t.y,A.x,A.y,s.x,s.y)/at),getRadianFrom(e,t,A,s,i,r,n,a){E(n)&&(n=A,a=s);const o=e-A,h=t-s,l=i-n,c=r-a;return Math.atan2(o*c-h*l,o*l+h*c)},getAtan2:(e,t)=>JB(t.y-e.y,t.x-e.x),getDistancePoint(e,t,A,s){const i=ll(e,t);return(t=s?t:{}).x=e.x+ol(i)*A,t.y=e.y+al(i)*A,t},toNumberPoints(e){let t=e;return O(e[0])&&(t=[],e.forEach(A=>t.push(A.x,A.y))),t},reset(e){}},QA=L,{getDistanceFrom:Jn,copy:jn,getAtan2:ll}=QA;let ZB=class $n{constructor(t,A){this.set(t,A)}set(t,A){return O(t)?L.copy(this,t):L.set(this,t,A),this}get(){const{x:t,y:A}=this;return{x:t,y:A}}clone(){return new $n(this)}move(t,A){return L.move(this,t,A),this}scale(t,A){return L.scale(this,t,A),this}scaleOf(t,A,s){return L.scaleOf(this,t,A,s),this}rotate(t,A){return L.rotate(this,t,A),this}rotateOf(t,A){return L.rotate(this,A,t),this}getRotation(t,A,s){return L.getRotation(this,t,A,s)}toInnerOf(t,A){return L.toInnerOf(this,t,A),this}toOuterOf(t,A){return L.toOuterOf(this,t,A),this}getCenter(t){return new $n(L.getCenter(this,t))}getDistance(t){return L.getDistance(this,t)}getDistancePoint(t,A,s){return new $n(L.getDistancePoint(this,t,A,s))}getAngle(t){return L.getAngle(this,t)}getAtan2(t){return L.getAtan2(this,t)}reset(){return this}};new ZB;let Zt=class IB{constructor(t,A,s,i,r,n){this.set(t,A,s,i,r,n)}set(t,A,s,i,r,n){return O(t)?$.copy(this,t):$.set(this,t,A,s,i,r,n),this}setWith(t){return $.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:A,c:s,d:i,e:r,f:n}=this;return{a:t,b:A,c:s,d:i,e:r,f:n}}clone(){return new IB(this)}translate(t,A){return $.translate(this,t,A),this}translateInner(t,A){return $.translateInner(this,t,A),this}scale(t,A){return $.scale(this,t,A),this}scaleWith(t,A){return $.scale(this,t,A),this.scaleX*=t,this.scaleY*=A||t,this}scaleOfOuter(t,A,s){return $.scaleOfOuter(this,t,A,s),this}scaleOfInner(t,A,s){return $.scaleOfInner(this,t,A,s),this}rotate(t){return $.rotate(this,t),this}rotateOfOuter(t,A){return $.rotateOfOuter(this,t,A),this}rotateOfInner(t,A){return $.rotateOfInner(this,t,A),this}skew(t,A){return $.skew(this,t,A),this}skewOfOuter(t,A,s){return $.skewOfOuter(this,t,A,s),this}skewOfInner(t,A,s){return $.skewOfInner(this,t,A,s),this}multiply(t){return $.multiply(this,t),this}multiplyParent(t){return $.multiplyParent(this,t),this}divide(t){return $.divide(this,t),this}divideParent(t){return $.divideParent(this,t),this}invert(){return $.invert(this),this}invertWith(){return $.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,A,s){$.toOuterPoint(this,t,A,s)}toInnerPoint(t,A,s){$.toInnerPoint(this,t,A,s)}setLayout(t,A,s){return $.setLayout(this,t,A,s),this}getLayout(t,A,s){return $.getLayout(this,t,A,s)}withScale(t,A){return $.withScale(this,t,A)}reset(){$.reset(this)}};new Zt;const Vs={tempPointBounds:{},setPoint(e,t,A){e.minX=e.maxX=t,e.minY=e.maxY=A},addPoint(e,t,A){e.minX=t<e.minX?t:e.minX,e.minY=A<e.minY?A:e.minY,e.maxX=t>e.maxX?t:e.maxX,e.maxY=A>e.maxY?A:e.maxY},addBounds(e,t,A,s,i){cl(e,t,A),cl(e,t+s,A+i)},copy(e,t){e.minX=t.minX,e.minY=t.minY,e.maxX=t.maxX,e.maxY=t.maxY},addPointBounds(e,t){e.minX=t.minX<e.minX?t.minX:e.minX,e.minY=t.minY<e.minY?t.minY:e.minY,e.maxX=t.maxX>e.maxX?t.maxX:e.maxX,e.maxY=t.maxY>e.maxY?t.maxY:e.maxY},toBounds(e,t){t.x=e.minX,t.y=e.minY,t.width=e.maxX-e.minX,t.height=e.maxY-e.minY}},{addPoint:cl}=Vs;var Zn,is;(function(e){e[e.top=0]="top",e[e.right=1]="right",e[e.bottom=2]="bottom",e[e.left=3]="left"})(Zn||(Zn={})),function(e){e[e.topLeft=0]="topLeft",e[e.top=1]="top",e[e.topRight=2]="topRight",e[e.right=3]="right",e[e.bottomRight=4]="bottomRight",e[e.bottom=5]="bottom",e[e.bottomLeft=6]="bottomLeft",e[e.left=7]="left",e[e.center=8]="center",e[e["top-left"]=0]="top-left",e[e["top-right"]=2]="top-right",e[e["bottom-right"]=4]="bottom-right",e[e["bottom-left"]=6]="bottom-left"}(is||(is={}));const qn=[{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}];qn.forEach(e=>e.type="percent");const _e={directionData:qn,tempPoint:{},get:dl,toPoint(e,t,A,s,i,r){const n=dl(e);A.x=n.x,A.y=n.y,n.type==="percent"&&(A.x*=t.width,A.y*=t.height,i&&(r||(A.x-=i.x,A.y-=i.y),n.x&&(A.x-=n.x===1?i.width:n.x===.5?n.x*i.width:0),n.y&&(A.y-=n.y===1?i.height:n.y===.5?n.y*i.height:0))),s||(A.x+=t.x,A.y+=t.y)},getPoint:(e,t,A)=>(A||(A={}),_e.toPoint(e,t,A,!0),A)};function dl(e){return G(e)?qn[is[e]]:e}const{toPoint:qB}=_e,ta={toPoint(e,t,A,s,i,r){qB(e,A,s,i,t,r)}},{tempPointBounds:hA,setPoint:ul,addPoint:sr,toBounds:gl}=Vs,{toOuterPoint:ir}=$,{float:rr,fourNumber:tf}=yt,{floor:Bl,ceil:nr}=Math;let ke,Te,FA,CA;const We={},ce={},UA={},v={tempBounds:UA,set(e,t=0,A=0,s=0,i=0){e.x=t,e.y=A,e.width=s,e.height=i},copy(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},copyAndSpread(e,t,A,s,i){const{x:r,y:n,width:a,height:o}=t;if(V(A)){const h=tf(A);s?ot.set(e,r+h[3],n+h[0],a-h[1]-h[3],o-h[2]-h[0]):ot.set(e,r-h[3],n-h[0],a+h[1]+h[3],o+h[2]+h[0])}else s&&(A=-A),ot.set(e,r-A,n-A,a+2*A,o+2*A);i&&(i==="width"?(e.y=n,e.height=o):(e.x=r,e.width=a))},minX:e=>e.width>0?e.x:e.x+e.width,minY:e=>e.height>0?e.y:e.y+e.height,maxX:e=>e.width>0?e.x+e.width:e.x,maxY:e=>e.height>0?e.y+e.height:e.y,move(e,t,A){e.x+=t,e.y+=A},getByMove:(e,t,A)=>(e=Object.assign({},e),ot.move(e,t,A),e),toOffsetOutBounds(e,t,A){t?pl(t,e):t=e,A?(t.offsetX=-(ot.maxX(A)-e.x),t.offsetY=-(ot.maxY(A)-e.y)):(t.offsetX=e.x+e.width,t.offsetY=e.y+e.height),ot.move(t,-t.offsetX,-t.offsetY)},scale(e,t,A=t,s){s||L.scale(e,t,A),e.width*=t,e.height*=A},scaleOf(e,t,A,s=A){L.scaleOf(e,t,A,s),e.width*=A,e.height*=s},tempToOuterOf:(e,t)=>(ot.copy(UA,e),ot.toOuterOf(UA,t),UA),getOuterOf:(e,t)=>(e=Object.assign({},e),ot.toOuterOf(e,t),e),toOuterOf(e,t,A){if(A||(A=e),t.b===0&&t.c===0){const{a:s,d:i}=t;s>0?(A.width=e.width*s,A.x=t.e+e.x*s):(A.width=e.width*-s,A.x=t.e+e.x*s-A.width),i>0?(A.height=e.height*i,A.y=t.f+e.y*i):(A.height=e.height*-i,A.y=t.f+e.y*i-A.height)}else We.x=e.x,We.y=e.y,ir(t,We,ce),ul(hA,ce.x,ce.y),We.x=e.x+e.width,ir(t,We,ce),sr(hA,ce.x,ce.y),We.y=e.y+e.height,ir(t,We,ce),sr(hA,ce.x,ce.y),We.x=e.x,ir(t,We,ce),sr(hA,ce.x,ce.y),gl(hA,A)},toInnerOf(e,t,A){A||(A=e),ot.move(A,-t.e,-t.f),ot.scale(A,1/t.a,1/t.d)},getFitMatrix(e,t,A=1){const s=Math.min(A,ot.getFitScale(e,t));return new Zt(s,0,0,s,-t.x*s,-t.y*s)},getFitScale(e,t,A){const s=e.width/t.width,i=e.height/t.height;return A?Math.max(s,i):Math.min(s,i)},put(e,t,A="center",s=1,i=!0,r){r||(r=t),G(s)&&(s=ot.getFitScale(e,t,s==="cover")),UA.width=i?t.width*=s:t.width*s,UA.height=i?t.height*=s:t.height*s,ta.toPoint(A,UA,e,r,!0,!0)},getSpread(e,t,A){const s={};return ot.copyAndSpread(s,e,t,!1,A),s},spread(e,t,A){ot.copyAndSpread(e,e,t,!1,A)},shrink(e,t,A){ot.copyAndSpread(e,e,t,!0,A)},ceil(e){const{x:t,y:A}=e;e.x=Bl(e.x),e.y=Bl(e.y),e.width=t>e.x?nr(e.width+t-e.x):nr(e.width),e.height=A>e.y?nr(e.height+A-e.y):nr(e.height)},unsign(e){e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height)},float(e,t){e.x=rr(e.x,t),e.y=rr(e.y,t),e.width=rr(e.width,t),e.height=rr(e.height,t)},add(e,t,A){ke=e.x+e.width,Te=e.y+e.height,FA=t.x,CA=t.y,A||(FA+=t.width,CA+=t.height),ke=ke>FA?ke:FA,Te=Te>CA?Te:CA,e.x=e.x<t.x?e.x:t.x,e.y=e.y<t.y?e.y:t.y,e.width=ke-e.x,e.height=Te-e.y},addList(e,t){ot.setListWithFn(e,t,void 0,!0)},setList(e,t,A=!1){ot.setListWithFn(e,t,void 0,A)},addListWithFn(e,t,A){ot.setListWithFn(e,t,A,!0)},setListWithFn(e,t,A,s=!1){let i,r=!0;for(let n=0,a=t.length;n<a;n++)i=A?A(t[n],n):t[n],i&&(i.width||i.height)&&(r?(r=!1,s||pl(e,i)):fl(e,i));r&&ot.reset(e)},setPoints(e,t){t.forEach((A,s)=>s===0?ul(hA,A.x,A.y):sr(hA,A.x,A.y)),gl(hA,e)},setPoint(e,t){ot.set(e,t.x,t.y)},addPoint(e,t){fl(e,t,!0)},getPoints(e){const{x:t,y:A,width:s,height:i}=e;return[{x:t,y:A},{x:t+s,y:A},{x:t+s,y:A+i},{x:t,y:A+i}]},hitRadiusPoint:(e,t,A)=>(A&&(t=L.tempToInnerRadiusPointOf(t,A)),t.x>=e.x-t.radiusX&&t.x<=e.x+e.width+t.radiusX&&t.y>=e.y-t.radiusY&&t.y<=e.y+e.height+t.radiusY),hitPoint:(e,t,A)=>(A&&(t=L.tempToInnerOf(t,A)),t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height),hit:(e,t,A)=>(A&&(t=ot.tempToOuterOf(t,A)),!(e.y+e.height<t.y||t.y+t.height<e.y||e.x+e.width<t.x||t.x+t.width<e.x)),includes:(e,t,A)=>(A&&(t=ot.tempToOuterOf(t,A)),e.x<=t.x&&e.y<=t.y&&e.x+e.width>=t.x+t.width&&e.y+e.height>=t.y+t.height),getIntersectData(e,t,A){if(A&&(t=ot.tempToOuterOf(t,A)),!ot.hit(e,t))return{x:0,y:0,width:0,height:0};let{x:s,y:i,width:r,height:n}=t;return ke=s+r,Te=i+n,FA=e.x+e.width,CA=e.y+e.height,s=s>e.x?s:e.x,i=i>e.y?i:e.y,ke=ke<FA?ke:FA,Te=Te<CA?Te:CA,r=ke-s,n=Te-i,{x:s,y:i,width:r,height:n}},intersect(e,t,A){ot.copy(e,ot.getIntersectData(e,t,A))},isSame:(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,isEmpty:e=>e.x===0&&e.y===0&&e.width===0&&e.height===0,reset(e){ot.set(e)}},ot=v,{add:fl,copy:pl}=ot;let ft=class tl{get minX(){return v.minX(this)}get minY(){return v.minY(this)}get maxX(){return v.maxX(this)}get maxY(){return v.maxY(this)}constructor(t,A,s,i){this.set(t,A,s,i)}set(t,A,s,i){return O(t)?v.copy(this,t):v.set(this,t,A,s,i),this}get(){const{x:t,y:A,width:s,height:i}=this;return{x:t,y:A,width:s,height:i}}clone(){return new tl(this)}move(t,A){return v.move(this,t,A),this}scale(t,A,s){return v.scale(this,t,A,s),this}scaleOf(t,A,s){return v.scaleOf(this,t,A,s),this}toOuterOf(t,A){return v.toOuterOf(this,t,A),this}toInnerOf(t,A){return v.toInnerOf(this,t,A),this}getFitMatrix(t,A){return v.getFitMatrix(this,t,A)}put(t,A,s){v.put(this,t,A,s)}spread(t,A){return v.spread(this,t,A),this}shrink(t,A){return v.shrink(this,t,A),this}ceil(){return v.ceil(this),this}unsign(){return v.unsign(this),this}float(t){return v.float(this,t),this}add(t){return v.add(this,t),this}addList(t){return v.setList(this,t,!0),this}setList(t){return v.setList(this,t),this}addListWithFn(t,A){return v.setListWithFn(this,t,A,!0),this}setListWithFn(t,A){return v.setListWithFn(this,t,A),this}setPoint(t){return v.setPoint(this,t),this}setPoints(t){return v.setPoints(this,t),this}addPoint(t){return v.addPoint(this,t),this}getPoints(){return v.getPoints(this)}hitPoint(t,A){return v.hitPoint(this,t,A)}hitRadiusPoint(t,A){return v.hitRadiusPoint(this,t,A)}hit(t,A){return v.hit(this,t,A)}includes(t,A){return v.includes(this,t,A)}intersect(t,A){return v.intersect(this,t,A),this}getIntersect(t,A){return new tl(v.getIntersectData(this,t,A))}isSame(t){return v.isSame(this,t)}isEmpty(){return v.isEmpty(this)}reset(){v.reset(this)}};const Z=new ft;let ef=class{constructor(t,A,s,i,r,n){O(t)?this.copy(t):this.set(t,A,s,i,r,n)}set(t=0,A=0,s=0,i=0,r=0,n=0){this.top=t,this.right=A,this.bottom=s,this.left=i,this.width=r,this.height=n}copy(t){const{top:A,right:s,bottom:i,left:r,width:n,height:a}=t;this.set(A,s,i,r,n,a)}getBoundsFrom(t){const{top:A,right:s,bottom:i,left:r,width:n,height:a}=this;return new ft(r,A,n||t.width-r-s,a||t.height-A-i)}};const Af={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:wl}=yt;let ct=class el{constructor(t){this.repeatMap={},this.name=t}static get(t){return new el(t)}static set filter(t){this.filterList=_l(t)}static set exclude(t){this.excludeList=_l(t)}static drawRepaint(t,A){const s=wl();t.fillWorld(A,s.replace("1)",".1)")),t.strokeWorld(A,s)}static drawBounds(t,A,s){const i=el.showBounds==="hit",r=t.__nowWorld,n=wl();i&&(A.setWorld(r),t.__drawHitPath(A),A.fillStyle=n.replace("1)",".2)"),A.fill()),A.resetTransform(),A.setStroke(n,2),i?A.stroke():A.strokeWorld(r,n)}log(...t){if(vA.enable){if(vA.filterList.length&&vA.filterList.every(A=>A!==this.name)||vA.excludeList.length&&vA.excludeList.some(A=>A===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){vA.enable&&this.warn(...t)}warn(...t){vA.showWarn&&console.warn(this.name,...t)}repeat(t,...A){this.repeatMap[t]||(this.warn("repeat:"+t,...A),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(A){console.error(this.name,...t,A)}}};function _l(e){return e?G(e)&&(e=[e]):e=[],e}ct.filterList=[],ct.excludeList=[],ct.showWarn=!0;const vA=ct,sf=ct.get("RunTime"),ye={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(e,t){const A=$e.create($e.RUNTIME);return de.currentId=de.idMap[A]=t?performance.now():Date.now(),de.currentName=de.nameMap[A]=e,de.nameToIdMap[e]=A,A},end(e,t){const A=de.idMap[e],s=de.nameMap[e],i=t?(performance.now()-A)/1e3:Date.now()-A;de.idMap[e]=de.nameMap[e]=de.nameToIdMap[s]=void 0,sf.log(s,i,"ms")},endOfName(e,t){const A=de.nameToIdMap[e];E(A)||de.end(A,t)}},de=ye,yl=[],At={list:{},add(e,...t){this.list[e]=!0,yl.push(...t)},has(e,t){const A=this.list[e];return!A&&t&&this.need(e),A},need(e){console.error("please install and import plugin: "+(e.includes("-x")?"":"@leafer-in/")+e)}};setTimeout(()=>yl.forEach(e=>At.has(e,!0)));const ut={editor:e=>At.need("editor")},ml=ct.get("UICreator"),Ys={list:{},register(e){const{__tag:t}=e.prototype;ar[t]&&ml.repeat(t),ar[t]=e},get(e,t,A,s,i,r){ar[e]||ml.error("not register "+e);const n=new ar[e](t);return E(A)||(n.x=A,s&&(n.y=s),i&&(n.width=i),r&&(n.height=r)),n}},{list:ar}=Ys,rf=ct.get("EventCreator"),rs={nameList:{},register(e){let t;Object.keys(e).forEach(A=>{t=e[A],G(t)&&(Ns[t]&&rf.repeat(t),Ns[t]=e)})},changeName(e,t){const A=Ns[e];if(A){const s=Object.keys(A).find(i=>A[i]===e);s&&(A[s]=t,Ns[t]=A)}},has(e){return!!this.nameList[e]},get:(e,...t)=>new Ns[e](...t)},{nameList:Ns}=rs;let Ql=class{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let A;const{list:s}=this;for(let r=0,n=s.length;r<n;r++)if(A=s[r],A.recycled&&A.isSameSize(t))return A.recycled=!1,A.manager||(A.manager=this),A;const i=ut.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const A=[];for(let s=0,i=this.list.length;s<i;s++)t=this.list[s],t.recycled?t.destroy():A.push(t);this.list=A}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}};function H(e,t,A,s){var i,r=arguments.length,n=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,A):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,A,s);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(n=(r<3?i(n):r>3?i(t,A,n):i(t,A))||n);return r>3&&n&&Object.defineProperty(t,A,n),n}function Fl(e,t,A,s){return new(A||(A=Promise))(function(i,r){function n(h){try{o(s.next(h))}catch(l){r(l)}}function a(h){try{o(s.throw(h))}catch(l){r(l)}}function o(h){var l;h.done?i(h.value):(l=h.value,l instanceof A?l:new A(function(c){c(l)})).then(n,a)}o((s=s.apply(e,[])).next())})}function mt(e){return(t,A)=>{e||(e=A);const s={get(){return this.context[e]},set(i){this.context[e]=i}};A==="strokeCap"&&(s.set=function(i){this.context[e]=i==="none"?"butt":i}),Object.defineProperty(t,A,s)}}typeof SuppressedError=="function"&&SuppressedError;const Cl=[];function st(){return(e,t)=>{Cl.push(t)}}const nf=[];let k=class{set blendMode(t){t==="normal"&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||nf)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;Cl.forEach(A=>{t=this.context[A],t&&(this[A]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,A,s,i,r,n){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,A,s,i,r,n){O(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,A,s,i,r,n)}translate(t,A){}scale(t,A){}rotate(t){}fill(t,A){}stroke(t){}clip(t,A){}fillRect(t,A,s,i){}strokeRect(t,A,s,i){}clearRect(t,A,s,i){}drawImage(t,A,s,i,r,n,a,o,h){switch(arguments.length){case 9:if(A<0){const l=-A/i*o;i+=A,A=0,n+=l,o-=l}if(s<0){const l=-s/r*h;r+=s,s=0,a+=l,h-=l}this.context.drawImage(t,A,s,i,r,n,a,o,h);break;case 5:this.context.drawImage(t,A,s,i,r);break;case 3:this.context.drawImage(t,A,s)}}beginPath(){}moveTo(t,A){}lineTo(t,A){}bezierCurveTo(t,A,s,i,r,n){}quadraticCurveTo(t,A,s,i){}closePath(){}arc(t,A,s,i,r,n){}arcTo(t,A,s,i,r){}ellipse(t,A,s,i,r,n,a,o){}rect(t,A,s,i){}roundRect(t,A,s,i,r){}createConicGradient(t,A,s){}createLinearGradient(t,A,s,i){}createPattern(t,A){}createRadialGradient(t,A,s,i,r,n){}fillText(t,A,s,i){}measureText(t){}strokeText(t,A,s,i){}destroy(){this.context=null}};H([mt("imageSmoothingEnabled")],k.prototype,"smooth",void 0),H([mt("imageSmoothingQuality")],k.prototype,"smoothLevel",void 0),H([mt("globalAlpha")],k.prototype,"opacity",void 0),H([mt()],k.prototype,"fillStyle",void 0),H([mt()],k.prototype,"strokeStyle",void 0),H([mt("lineWidth")],k.prototype,"strokeWidth",void 0),H([mt("lineCap")],k.prototype,"strokeCap",void 0),H([mt("lineJoin")],k.prototype,"strokeJoin",void 0),H([mt("lineDashOffset")],k.prototype,"dashOffset",void 0),H([mt()],k.prototype,"miterLimit",void 0),H([mt()],k.prototype,"shadowBlur",void 0),H([mt()],k.prototype,"shadowColor",void 0),H([mt()],k.prototype,"shadowOffsetX",void 0),H([mt()],k.prototype,"shadowOffsetY",void 0),H([mt()],k.prototype,"filter",void 0),H([mt()],k.prototype,"font",void 0),H([mt()],k.prototype,"fontKerning",void 0),H([mt()],k.prototype,"fontStretch",void 0),H([mt()],k.prototype,"fontVariantCaps",void 0),H([mt()],k.prototype,"textAlign",void 0),H([mt()],k.prototype,"textBaseline",void 0),H([mt()],k.prototype,"textRendering",void 0),H([mt()],k.prototype,"wordSpacing",void 0),H([mt()],k.prototype,"letterSpacing",void 0),H([mt()],k.prototype,"direction",void 0),H([st()],k.prototype,"setTransform",null),H([st()],k.prototype,"resetTransform",null),H([st()],k.prototype,"getTransform",null),H([st()],k.prototype,"save",null),H([st()],k.prototype,"restore",null),H([st()],k.prototype,"translate",null),H([st()],k.prototype,"scale",null),H([st()],k.prototype,"rotate",null),H([st()],k.prototype,"fill",null),H([st()],k.prototype,"stroke",null),H([st()],k.prototype,"clip",null),H([st()],k.prototype,"fillRect",null),H([st()],k.prototype,"strokeRect",null),H([st()],k.prototype,"clearRect",null),H([st()],k.prototype,"beginPath",null),H([st()],k.prototype,"moveTo",null),H([st()],k.prototype,"lineTo",null),H([st()],k.prototype,"bezierCurveTo",null),H([st()],k.prototype,"quadraticCurveTo",null),H([st()],k.prototype,"closePath",null),H([st()],k.prototype,"arc",null),H([st()],k.prototype,"arcTo",null),H([st()],k.prototype,"ellipse",null),H([st()],k.prototype,"rect",null),H([st()],k.prototype,"roundRect",null),H([st()],k.prototype,"createConicGradient",null),H([st()],k.prototype,"createLinearGradient",null),H([st()],k.prototype,"createPattern",null),H([st()],k.prototype,"createRadialGradient",null),H([st()],k.prototype,"fillText",null),H([st()],k.prototype,"measureText",null),H([st()],k.prototype,"strokeText",null);const{copy:af,multiplyParent:of}=$,{round:or}=Math,hf={width:1,height:1,pixelRatio:1},me=["width","height","pixelRatio"];let ea=class extends k{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,A){super(),this.size={},this.worldTransform={},t||(t=hf),this.manager=A,this.innerId=$e.create($e.CNAVAS);const{width:s,height:i,pixelRatio:r}=t;this.autoLayout=!s||!i,this.size.pixelRatio=r|U.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:A}=this.config;this.context=A?t.getContext("2d",A):t.getContext("2d"),this.__bindContext()}export(t,A){}toBlob(t,A){}toDataURL(t,A){}saveAs(t,A){}resize(t,A=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&A&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;et.copyAttrs(i,t,me),me.forEach(r=>i[r]||(i[r]=1)),this.bounds=new ft(0,0,this.width,this.height),this.context&&!this.unreal&&(this.updateViewSize(),this.smooth=this.config.smooth),this.updateClientBounds(),this.context&&!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,A){}stopAutoLayout(){}setCursor(t){}setWorld(t,A){const{pixelRatio:s,pixelSnap:i}=this,r=this.worldTransform;A&&of(t,A,r),r.a=t.a*s,r.b=t.b*s,r.c=t.c*s,r.d=t.d*s,r.e=t.e*s,r.f=t.f*s,i&&(t.half&&t.half*s%2?(r.e=or(r.e-.5)+.5,r.f=or(r.f-.5)+.5):(r.e=or(r.e),r.f=or(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const A=this.worldTransform;A&&this.setTransform(A.a,A.b,A.c,A.d,A.e,A.f)}setStroke(t,A,s,i){A&&(this.strokeWidth=A),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,A){let{strokeCap:s,strokeJoin:i,dashPattern:r,dashOffset:n,miterLimit:a}=t;A&&(A.strokeCap&&(s=A.strokeCap),A.strokeJoin&&(i=A.strokeJoin),E(A.dashPattern)||(r=A.dashPattern),E(A.dashOffset)||(n=A.dashOffset),A.miterLimit&&(a=A.miterLimit)),this.strokeCap=s,this.strokeJoin=i,this.dashPattern=r,this.dashOffset=n,this.miterLimit=a}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,A){return!0}hitStroke(t,A){return!0}hitPixel(t,A,s=1){return!0}setWorldShadow(t,A,s,i){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=A*r,this.shadowBlur=s*r,this.shadowColor=i||"black"}setWorldBlur(t){const{pixelRatio:A}=this;this.filter=`blur(${t*A}px)`}copyWorld(t,A,s,i){if(i&&(this.blendMode=i),A){const{pixelRatio:r}=this;s||(s=A),this.drawImage(t.view,A.x*r,A.y*r,A.width*r,A.height*r,s.x*r,s.y*r,s.width*r,s.height*r)}else this.drawImage(t.view,0,0);i&&(this.blendMode="source-over")}copyWorldToInner(t,A,s,i){if(i&&(this.blendMode=i),A.b||A.c)this.save(),this.resetTransform(),this.copyWorld(t,A,v.tempToOuterOf(s,A)),this.restore();else{const{pixelRatio:r}=this;this.drawImage(t.view,A.x*r,A.y*r,A.width*r,A.height*r,s.x,s.y,s.width,s.height)}i&&(this.blendMode="source-over")}copyWorldByReset(t,A,s,i,r){this.resetTransform(),this.copyWorld(t,A,s,i),r||this.useWorldTransform()}useGrayscaleAlpha(t){let A,s;this.setTempBounds(t,!0,!0);const{context:i}=this,r=i.getImageData(Z.x,Z.y,Z.width,Z.height),{data:n}=r;for(let a=0,o=n.length;a<o;a+=4)s=.299*n[a]+.587*n[a+1]+.114*n[a+2],(A=n[a+3])&&(n[a+3]=A===255?s:A*(s/255));i.putImageData(r,Z.x,Z.y)}useMask(t,A,s){this.copyWorld(t,A,s,"destination-in")}useEraser(t,A,s){this.copyWorld(t,A,s,"destination-out")}fillWorld(t,A,s){s&&(this.blendMode=s),this.fillStyle=A,this.setTempBounds(t),this.fillRect(Z.x,Z.y,Z.width,Z.height),s&&(this.blendMode="source-over")}strokeWorld(t,A,s){s&&(this.blendMode=s),this.strokeStyle=A,this.setTempBounds(t),this.strokeRect(Z.x,Z.y,Z.width,Z.height),s&&(this.blendMode="source-over")}clipWorld(t,A){this.beginPath(),this.setTempBounds(t,A),this.rect(Z.x,Z.y,Z.width,Z.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,A){this.setTempBounds(t,A),this.clearRect(Z.x,Z.y,Z.width,Z.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempBounds(t,A,s){Z.set(t),s&&Z.intersect(this.bounds),Z.scale(this.pixelRatio),A&&Z.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,A){const{size:s,pixelSnap:i}=this,r=this.manager?this.manager.get(s):ut.canvas(Object.assign({},s));return r.save(),t&&(af(r.worldTransform,this.worldTransform),r.useWorldTransform()),A&&(r.smooth=this.smooth),r.pixelSnap!==i&&(r.pixelSnap=i),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t,!0):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}};const De={creator:{},parse(e,t){},convertToCanvasData(e,t){}},Ul={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},zt=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},Ul),vl={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},El={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},lf=Object.assign(Object.assign({},El),Ul),hr=zt,Ll={};for(let e in hr)Ll[hr[e]]=e;const Aa={};for(let e in hr)Aa[hr[e]]=vl[e];const xl={drawRoundRect(e,t,A,s,i,r){const n=yt.fourNumber(r,Math.min(s/2,i/2)),a=t+s,o=A+i;n[0]?e.moveTo(t+n[0],A):e.moveTo(t,A),n[1]?e.arcTo(a,A,a,o,n[1]):e.lineTo(a,A),n[2]?e.arcTo(a,o,t,o,n[2]):e.lineTo(a,o),n[3]?e.arcTo(t,o,t,A,n[3]):e.lineTo(t,o),n[0]?e.arcTo(t,A,a,A,n[0]):e.lineTo(t,A)}},{sin:ns,cos:Js,atan2:bl,ceil:cf,abs:sa,PI:Hl,sqrt:Sl,pow:lr}=Math,{setPoint:ia,addPoint:cr}=Vs,{set:dr,toNumberPoints:df}=L,{M:kl,L:ra,C:na,Q:Tl,Z:uf}=zt,aa={},Xe={points(e,t,A,s){let i=df(t);if(e.push(kl,i[0],i[1]),A&&i.length>5){let r,n,a,o,h,l,c,d,u,g,B,f,_,p=i.length;const Q=A===!0?.5:A;s&&(i=[i[p-2],i[p-1],...i,i[0],i[1],i[2],i[3]],p=i.length);for(let m=2;m<p-2;m+=2)r=i[m-2],n=i[m-1],a=i[m],o=i[m+1],h=i[m+2],l=i[m+3],B=Sl(lr(a-r,2)+lr(o-n,2)),f=Sl(lr(h-a,2)+lr(l-o,2)),(B||f)&&(_=B+f,B=Q*B/_,f=Q*f/_,h-=r,l-=n,c=a-B*h,d=o-B*l,m===2?s||e.push(Tl,c,d,a,o):e.push(na,u,g,c,d,a,o),u=a+f*h,g=o+f*l);s||e.push(Tl,u,g,i[p-2],i[p-1])}else for(let r=2,n=i.length;r<n;r+=2)e.push(ra,i[r],i[r+1]);s&&e.push(uf)},rect(e,t,A,s,i){De.creator.path=e,De.creator.moveTo(t,A).lineTo(t+s,A).lineTo(t+s,A+i).lineTo(t,A+i).lineTo(t,A)},roundRect(e,t,A,s,i,r){De.creator.path=[],xl.drawRoundRect(De.creator,t,A,s,i,r),e.push(...De.convertToCanvasData(De.creator.path,!0))},arcTo(e,t,A,s,i,r,n,a,o,h,l){const c=s-t,d=i-A,u=r-s,g=n-i;let B=bl(d,c),f=bl(g,u),_=f-B;if(_<0&&(_+=we),_===Hl||sa(c+d)<1e-12||sa(u+g)<1e-12)return e&&e.push(ra,s,i),o&&(ia(o,t,A),cr(o,s,i)),l&&dr(l,t,A),void(h&&dr(h,s,i));const p=c*g-u*d<0,Q=p?-1:1,m=a/Js(_/2),C=s+m*Js(B+_/2+es*Q),S=i+m*ns(B+_/2+es*Q);return B-=es*Q,f-=es*Q,Il(e,C,S,a,a,0,B/at,f/at,p,o,h,l)},arc:(e,t,A,s,i,r,n,a,o,h)=>Il(e,t,A,s,s,0,i,r,n,a,o,h),ellipse(e,t,A,s,i,r,n,a,o,h,l,c){const d=r*at,u=ns(d),g=Js(d);let B=n*at,f=a*at;B>Hl&&(B-=we),f<0&&(f+=we);let _=f-B;_<0?_+=we:_>we&&(_-=we),o&&(_-=we);const p=cf(sa(_/es)),Q=_/p,m=ns(Q/4),C=8/3*m*m/ns(Q/2);f=B+Q;let S,F,b,I,P,K,R,T,N=Js(B),D=ns(B),tt=b=g*s*N-u*i*D,rt=I=u*s*N+g*i*D,Bt=t+b,j=A+I;e&&e.push(e.length?ra:kl,Bt,j),h&&ia(h,Bt,j),c&&dr(c,Bt,j);for(let Kt=0;Kt<p;Kt++)S=Js(f),F=ns(f),b=g*s*S-u*i*F,I=u*s*S+g*i*F,P=t+tt-C*(g*s*D+u*i*N),K=A+rt-C*(u*s*D-g*i*N),R=t+b+C*(g*s*F+u*i*S),T=A+I+C*(u*s*F-g*i*S),e&&e.push(na,P,K,R,T,t+b,A+I),h&&Kl(t+tt,A+rt,P,K,R,T,t+b,A+I,h,!0),tt=b,rt=I,N=S,D=F,B=f,f+=Q;l&&dr(l,t+b,A+I)},quadraticCurveTo(e,t,A,s,i,r,n){e.push(na,(t+2*s)/3,(A+2*i)/3,(r+2*s)/3,(n+2*i)/3,r,n)},toTwoPointBoundsByQuadraticCurve(e,t,A,s,i,r,n,a){Kl(e,t,(e+2*A)/3,(t+2*s)/3,(i+2*A)/3,(r+2*s)/3,i,r,n,a)},toTwoPointBounds(e,t,A,s,i,r,n,a,o,h){const l=[];let c,d,u,g,B,f,_,p,Q=e,m=A,C=i,S=n;for(let F=0;F<2;++F)if(F==1&&(Q=t,m=s,C=r,S=a),c=-3*Q+9*m-9*C+3*S,d=6*Q-12*m+6*C,u=3*m-3*Q,Math.abs(c)<1e-12){if(Math.abs(d)<1e-12)continue;g=-u/d,0<g&&g<1&&l.push(g)}else _=d*d-4*u*c,p=Math.sqrt(_),_<0||(B=(-d+p)/(2*c),0<B&&B<1&&l.push(B),f=(-d-p)/(2*c),0<f&&f<1&&l.push(f));h?cr(o,e,t):ia(o,e,t),cr(o,n,a);for(let F=0,b=l.length;F<b;F++)Dl(l[F],e,t,A,s,i,r,n,a,aa),cr(o,aa.x,aa.y)},getPointAndSet(e,t,A,s,i,r,n,a,o,h){const l=1-e,c=l*l*l,d=3*l*l*e,u=3*l*e*e,g=e*e*e;h.x=c*t+d*s+u*r+g*a,h.y=c*A+d*i+u*n+g*o},getPoint(e,t,A,s,i,r,n,a,o){const h={};return Dl(e,t,A,s,i,r,n,a,o,h),h},getDerivative(e,t,A,s,i){const r=1-e;return 3*r*r*(A-t)+6*r*e*(s-A)+3*e*e*(i-s)}},{getPointAndSet:Dl,toTwoPointBounds:Kl,ellipse:Il}=Xe,{sin:gf,cos:Bf,sqrt:Rl,atan2:Ml}=Math,{ellipse:ff}=Xe,pf={ellipticalArc(e,t,A,s,i,r,n,a,o,h,l){const c=(o-t)/2,d=(h-A)/2,u=r*at,g=gf(u),B=Bf(u),f=-B*c-g*d,_=-B*d+g*c,p=s*s,Q=i*i,m=_*_,C=f*f,S=p*Q-p*m-Q*C;let F=0;if(S<0){const tt=Rl(1-S/(p*Q));s*=tt,i*=tt}else F=(n===a?-1:1)*Rl(S/(p*m+Q*C));const b=F*s*_/i,I=-F*i*f/s,P=Ml((_-I)/i,(f-b)/s),K=Ml((-_-I)/i,(-f-b)/s);let R=K-P;a===0&&R>0?R-=we:a===1&&R<0&&(R+=we);const T=t+c+B*b-g*I,N=A+d+g*b+B*I,D=R<0?1:0;l||U.ellipseToCurve?ff(e,T,N,s,i,r,P/at,K/at,D):s!==i||r?e.push(zt.G,T,N,s,i,r,P/at,K/at,D):e.push(zt.O,T,N,s,P/at,K/at,D)}},{M:oa,m:wf,L:js,l:_f,H:yf,h:mf,V:Qf,v:Ff,C:as,c:Cf,S:ha,s:Uf,Q:os,q:vf,T:la,t:Ef,A:Lf,a:xf,Z:ca,z:bf,N:Hf,D:Sf,X:kf,G:Tf,F:Df,O:Kf,P:If,U:Rf}=zt,{rect:Mf,roundRect:Ol,arcTo:Of,arc:Pl,ellipse:$l,quadraticCurveTo:Wl}=Xe,{ellipticalArc:Pf}=pf,$f=ct.get("PathConvert"),ze={},EA={current:{dot:0},stringify(e,t){let A,s,i,r=0,n=e.length,a="";for(;r<n;){s=e[r],A=Aa[s],a+=s===i?" ":Ll[s];for(let o=1;o<A;o++)a+=yt.float(e[r+o],t),o===A-1||(a+=" ");i=s,r+=A}return a},parse(e,t){let A,s,i,r="";const n=[],a=t?lf:El;for(let o=0,h=e.length;o<h;o++)s=e[o],Af[s]?(s==="."&&(ue.dot&&(LA(n,r),r=""),ue.dot++),r==="0"&&s!=="."&&(LA(n,r),r=""),r+=s):zt[s]?(r&&(LA(n,r),r=""),ue.name=zt[s],ue.length=vl[s],ue.index=0,LA(n,ue.name),!A&&a[s]&&(A=!0)):s==="-"||s==="+"?i==="e"||i==="E"?r+=s:(r&&LA(n,r),r=s):r&&(LA(n,r),r=""),i=s;return r&&LA(n,r),A?EA.toCanvasData(n,t):n},toCanvasData(e,t){let A,s,i,r,n,a=0,o=0,h=0,l=0,c=0,d=e.length;const u=[];for(;c<d;){switch(i=e[c],i){case wf:e[c+1]+=a,e[c+2]+=o;case oa:a=e[c+1],o=e[c+2],u.push(oa,a,o),c+=3;break;case mf:e[c+1]+=a;case yf:a=e[c+1],u.push(js,a,o),c+=2;break;case Ff:e[c+1]+=o;case Qf:o=e[c+1],u.push(js,a,o),c+=2;break;case _f:e[c+1]+=a,e[c+2]+=o;case js:a=e[c+1],o=e[c+2],u.push(js,a,o),c+=3;break;case Uf:e[c+1]+=a,e[c+2]+=o,e[c+3]+=a,e[c+4]+=o,i=ha;case ha:n=r===as||r===ha,h=n?2*a-A:e[c+1],l=n?2*o-s:e[c+2],A=e[c+1],s=e[c+2],a=e[c+3],o=e[c+4],u.push(as,h,l,A,s,a,o),c+=5;break;case Cf:e[c+1]+=a,e[c+2]+=o,e[c+3]+=a,e[c+4]+=o,e[c+5]+=a,e[c+6]+=o,i=as;case as:A=e[c+3],s=e[c+4],a=e[c+5],o=e[c+6],u.push(as,e[c+1],e[c+2],A,s,a,o),c+=7;break;case Ef:e[c+1]+=a,e[c+2]+=o,i=la;case la:n=r===os||r===la,A=n?2*a-A:e[c+1],s=n?2*o-s:e[c+2],t?Wl(u,a,o,A,s,e[c+1],e[c+2]):u.push(os,A,s,e[c+1],e[c+2]),a=e[c+1],o=e[c+2],c+=3;break;case vf:e[c+1]+=a,e[c+2]+=o,e[c+3]+=a,e[c+4]+=o,i=os;case os:A=e[c+1],s=e[c+2],t?Wl(u,a,o,A,s,e[c+3],e[c+4]):u.push(os,A,s,e[c+3],e[c+4]),a=e[c+3],o=e[c+4],c+=5;break;case xf:e[c+6]+=a,e[c+7]+=o;case Lf:Pf(u,a,o,e[c+1],e[c+2],e[c+3],e[c+4],e[c+5],e[c+6],e[c+7],t),a=e[c+6],o=e[c+7],c+=8;break;case bf:case ca:u.push(ca),c++;break;case Hf:a=e[c+1],o=e[c+2],t?Mf(u,a,o,e[c+3],e[c+4]):lA(u,e,c,5),c+=5;break;case Sf:a=e[c+1],o=e[c+2],t?Ol(u,a,o,e[c+3],e[c+4],[e[c+5],e[c+6],e[c+7],e[c+8]]):lA(u,e,c,9),c+=9;break;case kf:a=e[c+1],o=e[c+2],t?Ol(u,a,o,e[c+3],e[c+4],e[c+5]):lA(u,e,c,6),c+=6;break;case Tf:$l(t?u:lA(u,e,c,9),e[c+1],e[c+2],e[c+3],e[c+4],e[c+5],e[c+6],e[c+7],e[c+8],null,ze),a=ze.x,o=ze.y,c+=9;break;case Df:t?$l(u,e[c+1],e[c+2],e[c+3],e[c+4],0,0,360,!1):lA(u,e,c,5),a=e[c+1]+e[c+3],o=e[c+2],c+=5;break;case Kf:Pl(t?u:lA(u,e,c,7),e[c+1],e[c+2],e[c+3],e[c+4],e[c+5],e[c+6],null,ze),a=ze.x,o=ze.y,c+=7;break;case If:t?Pl(u,e[c+1],e[c+2],e[c+3],0,360,!1):lA(u,e,c,4),a=e[c+1]+e[c+3],o=e[c+2],c+=4;break;case Rf:Of(t?u:lA(u,e,c,6),a,o,e[c+1],e[c+2],e[c+3],e[c+4],e[c+5],null,ze),a=ze.x,o=ze.y,c+=6;break;default:return $f.error(`command: ${i} [index:${c}]`,e),u}r=i}return u},objectToCanvasData(e){const t=[];return e.forEach(A=>{switch(A.name){case"M":t.push(oa,A.x,A.y);break;case"L":t.push(js,A.x,A.y);break;case"C":t.push(as,A.x1,A.y1,A.x2,A.y2,A.x,A.y);break;case"Q":t.push(os,A.x1,A.y1,A.x,A.y);break;case"Z":t.push(ca)}}),t},copyData(e,t,A,s){for(let i=A,r=A+s;i<r;i++)e.push(t[i])},pushData(e,t){ue.index===ue.length&&(ue.index=1,e.push(ue.name)),e.push(Number(t)),ue.index++,ue.dot=0}},{current:ue,pushData:LA,copyData:lA}=EA,{M:da,L:Wf,C:Xf,Q:zf,Z:Gf,N:Xl,D:Vf,X:Yf,G:Nf,F:Jf,O:jf,P:Zf,U:qf}=zt,{getMinDistanceFrom:tp,getRadianFrom:ep}=L,{tan:Ap,min:zl,abs:sp}=Math,hs={},xA={beginPath(e){e.length=0},moveTo(e,t,A){e.push(da,t,A)},lineTo(e,t,A){e.push(Wf,t,A)},bezierCurveTo(e,t,A,s,i,r,n){e.push(Xf,t,A,s,i,r,n)},quadraticCurveTo(e,t,A,s,i){e.push(zf,t,A,s,i)},closePath(e){e.push(Gf)},rect(e,t,A,s,i){e.push(Xl,t,A,s,i)},roundRect(e,t,A,s,i,r){if(nt(r))e.push(Yf,t,A,s,i,r);else{const n=yt.fourNumber(r);n?e.push(Vf,t,A,s,i,...n):e.push(Xl,t,A,s,i)}},ellipse(e,t,A,s,i,r,n,a,o){Ot(r)?e.push(Jf,t,A,s,i):(Ot(n)&&(n=0),Ot(a)&&(a=360),e.push(Nf,t,A,s,i,r,n,a,o?1:0))},arc(e,t,A,s,i,r,n){Ot(i)?e.push(Zf,t,A,s):(Ot(r)&&(r=360),e.push(jf,t,A,s,i,r,n?1:0))},arcTo(e,t,A,s,i,r,n,a){if(!E(n)){const o=tp(n,a,t,A,s,i);r=zl(r,zl(o/2,o/2*sp(Ap(ep(n,a,t,A,s,i)/2))))}e.push(qf,t,A,s,i,r)},drawEllipse(e,t,A,s,i,r,n,a,o){Xe.ellipse(null,t,A,s,i,Ot(r)?0:r,Ot(n)?0:n,Ot(a)?360:a,o,null,null,hs),e.push(da,hs.x,hs.y),ip(e,t,A,s,i,r,n,a,o)},drawArc(e,t,A,s,i,r,n){Xe.arc(null,t,A,s,Ot(i)?0:i,Ot(r)?360:r,n,null,null,hs),e.push(da,hs.x,hs.y),rp(e,t,A,s,i,r,n)},drawPoints(e,t,A,s){Xe.points(e,t,A,s)}},{ellipse:ip,arc:rp}=xA,{moveTo:np,lineTo:ap,quadraticCurveTo:op,bezierCurveTo:hp,closePath:lp,beginPath:cp,rect:dp,roundRect:up,ellipse:gp,arc:Bp,arcTo:fp,drawEllipse:pp,drawArc:wp,drawPoints:_p}=xA;class ua{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?G(t)?De.parse(t):t:[],this}beginPath(){return cp(this.__path),this.paint(),this}moveTo(t,A){return np(this.__path,t,A),this.paint(),this}lineTo(t,A){return ap(this.__path,t,A),this.paint(),this}bezierCurveTo(t,A,s,i,r,n){return hp(this.__path,t,A,s,i,r,n),this.paint(),this}quadraticCurveTo(t,A,s,i){return op(this.__path,t,A,s,i),this.paint(),this}closePath(){return lp(this.__path),this.paint(),this}rect(t,A,s,i){return dp(this.__path,t,A,s,i),this.paint(),this}roundRect(t,A,s,i,r){return up(this.__path,t,A,s,i,r),this.paint(),this}ellipse(t,A,s,i,r,n,a,o){return gp(this.__path,t,A,s,i,r,n,a,o),this.paint(),this}arc(t,A,s,i,r,n){return Bp(this.__path,t,A,s,i,r,n),this.paint(),this}arcTo(t,A,s,i,r){return fp(this.__path,t,A,s,i,r),this.paint(),this}drawEllipse(t,A,s,i,r,n,a,o){return pp(this.__path,t,A,s,i,r,n,a,o),this.paint(),this}drawArc(t,A,s,i,r,n){return wp(this.__path,t,A,s,i,r,n),this.paint(),this}drawPoints(t,A,s){return _p(this.__path,t,A,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:yp,L:mp,C:Qp,Q:Fp,Z:Cp,N:Up,D:vp,X:Ep,G:Lp,F:xp,O:bp,P:Hp,U:Sp}=zt,kp=ct.get("PathDrawer"),Tp={drawPathByData(e,t){if(!t)return;let A,s=0,i=t.length;for(;s<i;)switch(A=t[s],A){case yp:e.moveTo(t[s+1],t[s+2]),s+=3;break;case mp:e.lineTo(t[s+1],t[s+2]),s+=3;break;case Qp:e.bezierCurveTo(t[s+1],t[s+2],t[s+3],t[s+4],t[s+5],t[s+6]),s+=7;break;case Fp:e.quadraticCurveTo(t[s+1],t[s+2],t[s+3],t[s+4]),s+=5;break;case Cp:e.closePath(),s+=1;break;case Up:e.rect(t[s+1],t[s+2],t[s+3],t[s+4]),s+=5;break;case vp:e.roundRect(t[s+1],t[s+2],t[s+3],t[s+4],[t[s+5],t[s+6],t[s+7],t[s+8]]),s+=9;break;case Ep:e.roundRect(t[s+1],t[s+2],t[s+3],t[s+4],t[s+5]),s+=6;break;case Lp:e.ellipse(t[s+1],t[s+2],t[s+3],t[s+4],t[s+5]*at,t[s+6]*at,t[s+7]*at,t[s+8]),s+=9;break;case xp:e.ellipse(t[s+1],t[s+2],t[s+3],t[s+4],0,0,we,!1),s+=5;break;case bp:e.arc(t[s+1],t[s+2],t[s+3],t[s+4]*at,t[s+5]*at,t[s+6]),s+=7;break;case Hp:e.arc(t[s+1],t[s+2],t[s+3],0,we,!1),s+=4;break;case Sp:e.arcTo(t[s+1],t[s+2],t[s+3],t[s+4],t[s+5]),s+=6;break;default:return void kp.error(`command: ${A} [index:${s}]`,t)}}},{M:Dp,L:Kp,C:Gl,Q:Vl,Z:Yl,N:Ip,D:Nl,X:Rp,G:Mp,F:Op,O:Pp,P:$p,U:Wp}=zt,{toTwoPointBounds:Xp,toTwoPointBoundsByQuadraticCurve:zp,arcTo:Gp,arc:Vp,ellipse:Yp}=Xe,{addPointBounds:Zs,copy:ga,addPoint:Np,setPoint:Ba,addBounds:ur,toBounds:Jp}=Vs,jp=ct.get("PathBounds");let ls,gr,fa;const oe={},Jl={},Ge={},pa={toBounds(e,t){pa.toTwoPointBounds(e,Jl),Jp(Jl,t)},toTwoPointBounds(e,t){if(!e||!e.length)return Ba(t,0,0);let A,s,i,r,n,a=0,o=0,h=0;const l=e.length;for(;a<l;)switch(n=e[a],a===0&&(n===Yl||n===Gl||n===Vl?Ba(t,o,h):Ba(t,e[a+1],e[a+2])),n){case Dp:case Kp:o=e[a+1],h=e[a+2],Np(t,o,h),a+=3;break;case Gl:i=e[a+5],r=e[a+6],Xp(o,h,e[a+1],e[a+2],e[a+3],e[a+4],i,r,oe),Zs(t,oe),o=i,h=r,a+=7;break;case Vl:A=e[a+1],s=e[a+2],i=e[a+3],r=e[a+4],zp(o,h,A,s,i,r,oe),Zs(t,oe),o=i,h=r,a+=5;break;case Yl:a+=1;break;case Ip:o=e[a+1],h=e[a+2],ur(t,o,h,e[a+3],e[a+4]),a+=5;break;case Nl:case Rp:o=e[a+1],h=e[a+2],ur(t,o,h,e[a+3],e[a+4]),a+=n===Nl?9:6;break;case Mp:Yp(null,e[a+1],e[a+2],e[a+3],e[a+4],e[a+5],e[a+6],e[a+7],e[a+8],oe,Ge),a===0?ga(t,oe):Zs(t,oe),o=Ge.x,h=Ge.y,a+=9;break;case Op:o=e[a+1],h=e[a+2],gr=e[a+3],fa=e[a+4],ur(t,o-gr,h-fa,2*gr,2*fa),o+=gr,a+=5;break;case Pp:Vp(null,e[a+1],e[a+2],e[a+3],e[a+4],e[a+5],e[a+6],oe,Ge),a===0?ga(t,oe):Zs(t,oe),o=Ge.x,h=Ge.y,a+=7;break;case $p:o=e[a+1],h=e[a+2],ls=e[a+3],ur(t,o-ls,h-ls,2*ls,2*ls),o+=ls,a+=4;break;case Wp:Gp(null,o,h,e[a+1],e[a+2],e[a+3],e[a+4],e[a+5],oe,Ge),a===0?ga(t,oe):Zs(t,oe),o=Ge.x,h=Ge.y,a+=6;break;default:return void jp.error(`command: ${n} [index:${a}]`,e)}}},{M:wa,L:Br,Z:qs}=zt,{getCenterX:Zp,getCenterY:qp}=L,{arcTo:_a}=xA,tw={smooth(e,t,A){let s,i,r,n=0,a=0,o=0,h=0,l=0,c=0,d=0,u=0,g=0;const B=e.length,f=[];for(;n<B;){switch(s=e[n],s){case wa:h=u=e[n+1],l=g=e[n+2],n+=3,e[n]===Br?(c=e[n+1],d=e[n+2],f.push(wa,Zp(h,c),qp(l,d))):f.push(wa,h,l);break;case Br:switch(a=e[n+1],o=e[n+2],n+=3,e[n]){case Br:_a(f,a,o,e[n+1],e[n+2],t,u,g);break;case qs:_a(f,a,o,h,l,t,u,g);break;default:f.push(Br,a,o)}u=a,g=o;break;case qs:i!==qs&&(_a(f,h,l,c,d,t,u,g),f.push(qs)),n+=1;break;default:r=Aa[s];for(let _=0;_<r;_++)f.push(e[n+_]);n+=r}i=s}return s!==qs&&(f[1]=h,f[2]=l),f}};De.creator=new ua,De.parse=EA.parse,De.convertToCanvasData=EA.toCanvasData;const ti=new ua,{drawRoundRect:ew}=xl;function jl(e){(function(t){t&&!t.roundRect&&(t.roundRect=function(A,s,i,r,n){ew(this,A,s,i,r,n)})})(e)}const Ve={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mineType:e=>!e||e.startsWith("image")?e:(e==="jpg"&&(e="jpeg"),"image/"+e),fileType(e){const t=e.split(".");return t[t.length-1]},isOpaqueImage(e){const t=ya.fileType(e);return["jpg","jpeg"].some(A=>A===t)},getExportOptions(e){switch(typeof e){case"object":return e;case"number":return{quality:e};case"boolean":return{blob:e};default:return{}}}},ya=Ve;ya.alphaPixelTypes.forEach(e=>ya.upperCaseTypeMap[e]=e.toUpperCase());const Aw=ct.get("TaskProcessor");let sw=class{constructor(t){this.parallel=!0,this.time=1,this.id=$e.create($e.TASK),this.task=t}run(){return Fl(this,void 0,void 0,function*(){try{this.task&&!this.isComplete&&this.parent.running&&(yield this.task())}catch(t){Aw.error(t)}})}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}},ma=class{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 A=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(A=s)):A+=this.list[i].time;return this.isComplete?1:s/A}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&et.assign(this.config,t),this.empty()}add(t,A){let s,i,r,n;const a=new sw(t);return a.parent=this,nt(A)?n=A:A&&(i=A.parallel,s=A.start,r=A.time,n=A.delay),r&&(a.time=r),i===!1&&(a.parallel=!1),E(n)?this.push(a,s):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(a,s))},n)),this.isComplete=!1,a}push(t,A){this.list.push(t),A===!1||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++,this.nextTask()}).catch(A=>{this.onError(A)}):this.nextTask()}runParallelTasks(){this.parallelList.forEach(t=>this.runParallelTask(t))}runParallelTask(t){t.run().then(()=>{this.onTask(t),this.fillParallelTask()}).catch(A=>{this.onParallelError(A)})}nextTask(){this.total===this.finish