@leafer/core 1.9.2 → 1.9.3
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.
- package/lib/core.cjs +3 -5
- package/lib/core.esm.js +3 -5
- package/lib/core.esm.min.js +1 -1
- package/lib/core.esm.min.js.map +1 -1
- package/lib/core.min.cjs +1 -1
- package/lib/core.min.cjs.map +1 -1
- package/package.json +17 -17
- package/src/index.ts +1 -1
- package/types/index.d.ts +1 -1
package/lib/core.cjs
CHANGED
|
@@ -1193,10 +1193,8 @@ const BoundsHelper = {
|
|
|
1193
1193
|
t.y += y;
|
|
1194
1194
|
},
|
|
1195
1195
|
scroll(t, data) {
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
t.y += data.scrollY;
|
|
1199
|
-
}
|
|
1196
|
+
t.x += data.scrollX;
|
|
1197
|
+
t.y += data.scrollY;
|
|
1200
1198
|
},
|
|
1201
1199
|
getByMove(t, x, y) {
|
|
1202
1200
|
t = Object.assign({}, t);
|
|
@@ -6743,7 +6741,7 @@ class LeafLevelList {
|
|
|
6743
6741
|
}
|
|
6744
6742
|
}
|
|
6745
6743
|
|
|
6746
|
-
const version = "1.9.
|
|
6744
|
+
const version = "1.9.3";
|
|
6747
6745
|
|
|
6748
6746
|
exports.AlignHelper = AlignHelper;
|
|
6749
6747
|
|
package/lib/core.esm.js
CHANGED
|
@@ -1191,10 +1191,8 @@ const BoundsHelper = {
|
|
|
1191
1191
|
t.y += y;
|
|
1192
1192
|
},
|
|
1193
1193
|
scroll(t, data) {
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
t.y += data.scrollY;
|
|
1197
|
-
}
|
|
1194
|
+
t.x += data.scrollX;
|
|
1195
|
+
t.y += data.scrollY;
|
|
1198
1196
|
},
|
|
1199
1197
|
getByMove(t, x, y) {
|
|
1200
1198
|
t = Object.assign({}, t);
|
|
@@ -6741,6 +6739,6 @@ class LeafLevelList {
|
|
|
6741
6739
|
}
|
|
6742
6740
|
}
|
|
6743
6741
|
|
|
6744
|
-
const version = "1.9.
|
|
6742
|
+
const version = "1.9.3";
|
|
6745
6743
|
|
|
6746
6744
|
export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Branch, BranchHelper, BranchRender, CanvasManager, ChildEvent, Creator, DataHelper, Debug, Direction4, Direction9, EllipseHelper, Event, EventCreator, Eventer, FileHelper, ImageEvent, ImageManager, IncrementId, LayoutEvent, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, LeaferCanvasBase, LeaferEvent, LeaferImage, MathHelper, Matrix, MatrixHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Platform, Plugin, Point, PointHelper, PropertyEvent, RectHelper, RenderEvent, ResizeEvent, Resource, Run, StringNumberMap, TaskItem, TaskProcessor, TwoPointBoundsHelper, UICreator, WaitHelper, WatchEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds, tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useModule, version, visibleType };
|
package/lib/core.esm.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const t={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",getRealURL(e){const{prefix:s,suffix:r}=t.image;return!r||e.startsWith("data:")||e.startsWith("blob:")||(e+=(e.includes("?")?"&":"?")+r),s&&"/"===e[0]&&(e=s+e),e}}},e={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=s;return e[t]?e[t]++:(e[t]=1,0)}},s=e;var r;!function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(r||(r={}));const i={};function n(t){return void 0===t}function o(t){return null==t}function a(t){return"string"==typeof t}const{isFinite:h}=Number;function l(t){return"number"==typeof t}const d=/^-?\d+(?:\.\d+)?$/;function c(t){return"string"==typeof t&&d.test(t)?+t:t}const{isArray:u}=Array;function _(t){return t&&"object"==typeof t}function p(t){return _(t)&&!u(t)}function f(t){return"{}"===JSON.stringify(t)}const g={default:(t,e)=>(y(e,t),y(t,e),t),assign(t,e,s){let r;Object.keys(e).forEach(i=>{var n,o;if(r=e[i],(null==r?void 0:r.constructor)===Object&&(null===(n=t[i])||void 0===n?void 0:n.constructor)===Object)return y(t[i],e[i],s&&s[i]);s&&i in s?(null===(o=s[i])||void 0===o?void 0:o.constructor)===Object&&y(t[i]={},e[i],s[i]):t[i]=e[i]})},copyAttrs:(t,e,s)=>(s.forEach(s=>{n(e[s])||(t[s]=e[s])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,r=t.length;s<r;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:y}=g;class m{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}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(!n(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let s;for(let r in this)"_"!==r[0]&&(s=e?e[r]:void 0,t[r]=n(s)?this[r]:s);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!n(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!n(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const s={};if(t)if(u(t))for(let e of t)s[e]=this.__getInput(e);else for(let e in t)s[e]=this.__getInput(e);else{let t,e,{__input:r}=this;s.tag=this.__leaf.tag;for(let i in this)if("_"!==i[0]&&(t=this["_"+i],!n(t))){if("path"===i&&!this.__pathInputed)continue;e=r?r[i]:void 0,s[i]=n(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:r,d:i,e:n,f:o}=this.__leaf.__localMatrix;s.matrix={a:t,b:e,c:r,d:i,e:n,f:o}}return s}__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{round:x,pow:w,PI:b}=Math,B={within:(t,e,s)=>(_(e)&&(s=e.max,e=e.min),!n(e)&&t<e&&(t=e),!n(s)&&t>s&&(t=s),t),fourNumber(t,e){let s;if(u(t))switch(t.length){case 4:s=n(e)?t:[...t];break;case 2:s=[t[0],t[1],t[0],t[1]];break;case 3:s=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(s||(s=[t,t,t,t]),e)for(let t=0;t<4;t++)s[t]>e&&(s[t]=e);return s},formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),B.float(t)),getGapRotation(t,e,s=0){let r=t+s;if(e>1){const t=Math.abs(r%e);(t<1||t>e-1)&&(r=Math.round(r/e)*e)}return r-s},float(t,e){const s=n(e)?1e12:w(10,e);return-0===(t=x(t*s)/s)?0:t},getScaleData(t,e,s,r){if(r||(r={}),e){const t=(l(e)?e:e.width||0)/s.width,i=(l(e)?e:e.height||0)/s.height;r.scaleX=t||i||1,r.scaleY=i||t||1}else t&&B.assignScale(r,t);return r},assignScale(t,e){l(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},randInt:v,randColor:t=>`rgba(${v(255)},${v(255)},${v(255)},${t||1})`};function v(t){return Math.round(Math.random()*t)}const k=b/180,C=2*b,O=b/2;function P(){return{x:0,y:0}}function T(){return{x:0,y:0,width:0,height:0}}function S(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:R,cos:L,acos:E,sqrt:I}=Math,{float:M}=B,A={};function W(){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 N={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:W(),tempMatrix:{},set(t,e=1,s=0,r=0,i=1,n=0,o=0){t.a=e,t.b=s,t.c=r,t.d=i,t.e=n,t.f=o},get:S,getWorld:W,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,r){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,r&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},scaleOfOuter(t,e,s,r){Y.toInnerPoint(t,e,A),Y.scaleOfInner(t,A,s,r)},scaleOfInner(t,e,s,r=s){Y.translateInner(t,e.x,e.y),Y.scale(t,s,r),Y.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:r,c:i,d:n}=t,o=L(e*=k),a=R(e);t.a=s*o-r*a,t.b=s*a+r*o,t.c=i*o-n*a,t.d=i*a+n*o},rotateOfOuter(t,e,s){Y.toInnerPoint(t,e,A),Y.rotateOfInner(t,A,s)},rotateOfInner(t,e,s){Y.translateInner(t,e.x,e.y),Y.rotate(t,s),Y.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:r,b:i,c:n,d:o}=t;s&&(s*=k,t.a=r+n*s,t.b=i+o*s),e&&(e*=k,t.c=n+r*e,t.d=o+i*e)},skewOfOuter(t,e,s,r){Y.toInnerPoint(t,e,A),Y.skewOfInner(t,A,s,r)},skewOfInner(t,e,s,r=0){Y.translateInner(t,e.x,e.y),Y.skew(t,s,r),Y.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:r,c:i,d:n,e:o,f:a}=t;t.a=e.a*s+e.b*i,t.b=e.a*r+e.b*n,t.c=e.c*s+e.d*i,t.d=e.c*r+e.d*n,t.e=e.e*s+e.f*i+o,t.f=e.e*r+e.f*n+a},multiplyParent(t,e,s,r,i){const{e:o,f:a}=t;if(s||(s=t),n(r)&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:r,b:n,c:o,d:a}=t;s.a=r*e.a+n*e.c,s.b=r*e.b+n*e.d,s.c=o*e.a+a*e.c,s.d=o*e.b+a*e.d,i&&(s.scaleX=e.scaleX*i.scaleX,s.scaleY=e.scaleY*i.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,i&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=o*e.a+a*e.c+e.e,s.f=o*e.b+a*e.d+e.f},divide(t,e){Y.multiply(t,Y.tempInvert(e))},divideParent(t,e){Y.multiplyParent(t,Y.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=Y;return Y.copy(e,t),Y.invert(e),e},invert(t){const{a:e,b:s,c:r,d:i,e:n,f:o}=t;if(s||r){const a=1/(e*i-s*r);t.a=i*a,t.b=-s*a,t.c=-r*a,t.d=e*a,t.e=-(n*i-o*r)*a,t.f=-(o*e-n*s)*a}else if(1===e&&1===i)t.e=-n,t.f=-o;else{const s=1/(e*i);t.a=i*s,t.d=e*s,t.e=-n*i*s,t.f=-o*e*s}},toOuterPoint(t,e,s,r){const{x:i,y:n}=e;s||(s=e),s.x=i*t.a+n*t.c,s.y=i*t.b+n*t.d,r||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,r){const{a:i,b:n,c:o,d:a}=t,h=1/(i*a-n*o),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*o)*h,s.y=(d*i-l*n)*h,!r){const{e:e,f:r}=t;s.x-=(e*a-r*o)*h,s.y-=(r*i-e*n)*h}},setLayout(t,e,s,r,i){const{x:o,y:a,scaleX:h,scaleY:l}=e;if(n(i)&&(i=e.rotation||e.skewX||e.skewY),i){const{rotation:s,skewX:r,skewY:i}=e,n=s*k,o=L(n),a=R(n);if(r||i){const e=r*k,s=i*k;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,(s=s||r)&&Y.translateInner(t,-s.x,-s.y,!r)},getLayout(t,e,s,r){const{a:i,b:n,c:o,d:a,e:h,f:l}=t;let d,c,u,_,p,f=h,g=l;if(n||o){const t=i*a-n*o;if(o&&!r){d=I(i*i+n*n),c=t/d;const e=i/d;u=n>0?E(e):-E(e)}else{c=I(o*o+a*a),d=t/c;const e=o/c;u=O-(a>0?E(-e):-E(e))}const e=M(L(u)),s=R(u);d=M(d),c=M(c),_=e?M((o/c+s)/e/k,9):0,p=e?M((n/d-s)/e/k,9):0,u=M(u/k)}else d=i,c=a,u=_=p=0;return(e=s||e)&&(f+=e.x*i+e.y*o,g+=e.x*n+e.y*a,s||(f-=e.x,g-=e.y)),{x:f,y:g,scaleX:d,scaleY:c,rotation:u,skewX:_,skewY:p}},withScale(t,e,s=e){const r=t;if(!e||!s){const{a:r,b:i,c:n,d:o}=t;i||n?s=(r*o-i*n)/(e=I(r*r+i*i)):(e=r,s=o)}return r.scaleX=e,r.scaleY=s,r},reset(t){Y.set(t)}},Y=N,{toInnerPoint:X,toOuterPoint:D}=N,{sin:z,cos:F,abs:j,sqrt:U,atan2:H,min:G,round:V}=Math,q={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,s){t.radiusX=e,t.radiusY=n(s)?e:s},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?V(t.x-.5)+.5:V(t.x),t.y=e?V(t.y-.5)+.5:V(t.y)},move(t,e,s){_(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,r=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(r-1)},rotate(t,e,s){s||(s=Q.defaultPoint);const r=F(e*=k),i=z(e),n=t.x-s.x,o=t.y-s.y;t.x=s.x+n*r-o*i,t.y=s.y+n*i+o*r},tempToInnerOf(t,e){const{tempPoint:s}=Q;return Z(s,t),X(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=Q;return Z(s,t),D(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=Q;return Z(s,t),Q.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),X(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){X(e,t,s)},toOuterOf(t,e,s){D(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)=>J(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,r){const i=j(s-t),n=j(r-e);return U(i*i+n*n)},getMinDistanceFrom:(t,e,s,r,i,n)=>G(J(t,e,s,r),J(s,r,i,n)),getAngle:(t,e)=>$(t,e)/k,getRotation:(t,e,s,r)=>(r||(r=e),Q.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,r.x,r.y)/k),getRadianFrom(t,e,s,r,i,o,a,h){n(a)&&(a=s,h=r);const l=t-s,d=e-r,c=i-a,u=o-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e)=>H(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,r){const i=$(t,e);return(e=r?e:{}).x=t.x+F(i)*s,e.y=t.y+z(i)*s,e},toNumberPoints(t){let e=t;return _(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},reset(t){Q.reset(t)}},Q=q,{getDistanceFrom:J,copy:Z,getAtan2:$}=Q;class K{constructor(t,e){this.set(t,e)}set(t,e){return _(t)?q.copy(this,t):q.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new K(this)}move(t,e){return q.move(this,t,e),this}scale(t,e){return q.scale(this,t,e),this}scaleOf(t,e,s){return q.scaleOf(this,t,e,s),this}rotate(t,e){return q.rotate(this,t,e),this}rotateOf(t,e){return q.rotate(this,e,t),this}getRotation(t,e,s){return q.getRotation(this,t,e,s)}toInnerOf(t,e){return q.toInnerOf(this,t,e),this}toOuterOf(t,e){return q.toOuterOf(this,t,e),this}getCenter(t){return new K(q.getCenter(this,t))}getDistance(t){return q.getDistance(this,t)}getDistancePoint(t,e,s){return new K(q.getDistancePoint(this,t,e,s))}getAngle(t){return q.getAngle(this,t)}getAtan2(t){return q.getAtan2(this,t)}reset(){return q.reset(this),this}}const tt=new K;class et{constructor(t,e,s,r,i,n){this.set(t,e,s,r,i,n)}set(t,e,s,r,i,n){return _(t)?N.copy(this,t):N.set(this,t,e,s,r,i,n),this}setWith(t){return N.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:s,d:r,e:i,f:n}=this;return{a:t,b:e,c:s,d:r,e:i,f:n}}clone(){return new et(this)}translate(t,e){return N.translate(this,t,e),this}translateInner(t,e){return N.translateInner(this,t,e),this}scale(t,e){return N.scale(this,t,e),this}scaleWith(t,e){return N.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}scaleOfOuter(t,e,s){return N.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return N.scaleOfInner(this,t,e,s),this}rotate(t){return N.rotate(this,t),this}rotateOfOuter(t,e){return N.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return N.rotateOfInner(this,t,e),this}skew(t,e){return N.skew(this,t,e),this}skewOfOuter(t,e,s){return N.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return N.skewOfInner(this,t,e,s),this}multiply(t){return N.multiply(this,t),this}multiplyParent(t){return N.multiplyParent(this,t),this}divide(t){return N.divide(this,t),this}divideParent(t){return N.divideParent(this,t),this}invert(){return N.invert(this),this}invertWith(){return N.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){N.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){N.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return N.setLayout(this,t,e,s),this}getLayout(t,e,s){return N.getLayout(this,t,e,s)}withScale(t,e){return N.withScale(this,t,e)}reset(){N.reset(this)}}const st=new et,rt={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,r,i){it(t,e,s),it(t,e+r,s+i)},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:it}=rt;var nt,ot;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(nt||(nt={})),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"}(ot||(ot={}));const at=[{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}];at.forEach(t=>t.type="percent");const ht={directionData:at,tempPoint:{},get:lt,toPoint(t,e,s,r,i,n){const o=lt(t);s.x=o.x,s.y=o.y,"percent"===o.type&&(s.x*=e.width,s.y*=e.height,i&&(n||(s.x-=i.x,s.y-=i.y),o.x&&(s.x-=1===o.x?i.width:.5===o.x?o.x*i.width:0),o.y&&(s.y-=1===o.y?i.height:.5===o.y?o.y*i.height:0))),r||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s)=>(s||(s={}),ht.toPoint(t,e,s,!0),s)};function lt(t){return a(t)?at[ot[t]]:t}const{toPoint:dt}=ht,ct={toPoint(t,e,s,r,i,n){dt(t,s,r,i,e,n)}},{tempPointBounds:ut,setPoint:_t,addPoint:pt,toBounds:ft}=rt,{toOuterPoint:gt}=N,{float:yt,fourNumber:mt}=B,{floor:xt,ceil:wt}=Math;let bt,Bt,vt,kt;const Ct={},Ot={},Pt={},Tt={tempBounds:Pt,set(t,e=0,s=0,r=0,i=0){t.x=e,t.y=s,t.width=r,t.height=i},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,r,i){const{x:n,y:o,width:a,height:h}=e;if(u(s)){const e=mt(s);r?St.set(t,n+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):St.set(t,n-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else r&&(s=-s),St.set(t,n-s,o-s,a+2*s,h+2*s);i&&("width"===i?(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){(e.scrollY||e.scrollX)&&(t.x+=e.scrollX,t.y+=e.scrollY)},getByMove:(t,e,s)=>(t=Object.assign({},t),St.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Lt(e,t):e=t,s?(e.offsetX=-(St.maxX(s)-t.x),e.offsetY=-(St.maxY(s)-t.y)):(e.offsetX=t.x+t.width,e.offsetY=t.y+t.height),St.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,r){r||q.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,r=s){q.scaleOf(t,e,s,r),t.width*=s,t.height*=r},tempToOuterOf:(t,e)=>(St.copy(Pt,t),St.toOuterOf(Pt,e),Pt),getOuterOf:(t,e)=>(t=Object.assign({},t),St.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:r,d:i}=e;r>0?(s.width=t.width*r,s.x=e.e+t.x*r):(s.width=t.width*-r,s.x=e.e+t.x*r-s.width),i>0?(s.height=t.height*i,s.y=e.f+t.y*i):(s.height=t.height*-i,s.y=e.f+t.y*i-s.height)}else Ct.x=t.x,Ct.y=t.y,gt(e,Ct,Ot),_t(ut,Ot.x,Ot.y),Ct.x=t.x+t.width,gt(e,Ct,Ot),pt(ut,Ot.x,Ot.y),Ct.y=t.y+t.height,gt(e,Ct,Ot),pt(ut,Ot.x,Ot.y),Ct.x=t.x,gt(e,Ct,Ot),pt(ut,Ot.x,Ot.y),ft(ut,s)},toInnerOf(t,e,s){s||(s=t),St.move(s,-e.e,-e.f),St.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const r=Math.min(s,St.getFitScale(t,e));return new et(r,0,0,r,-e.x*r,-e.y*r)},getFitScale(t,e,s){const r=t.width/e.width,i=t.height/e.height;return s?Math.max(r,i):Math.min(r,i)},put(t,e,s="center",r=1,i=!0,n){n||(n=e),a(r)&&(r=St.getFitScale(t,e,"cover"===r)),Pt.width=i?e.width*=r:e.width*r,Pt.height=i?e.height*=r:e.height*r,ct.toPoint(s,Pt,t,n,!0,!0)},getSpread(t,e,s){const r={};return St.copyAndSpread(r,t,e,!1,s),r},spread(t,e,s){St.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){St.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=xt(t.x),t.y=xt(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=yt(t.x,e),t.y=yt(t.y,e),t.width=yt(t.width,e),t.height=yt(t.height,e)},add(t,e,s){bt=t.x+t.width,Bt=t.y+t.height,vt=e.x,kt=e.y,s||(vt+=e.width,kt+=e.height),bt=bt>vt?bt:vt,Bt=Bt>kt?Bt:kt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=bt-t.x,t.height=Bt-t.y},addList(t,e){St.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){St.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){St.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,r=!1){let i,n=!0;for(let o=0,a=e.length;o<a;o++)i=s?s(e[o],o):e[o],i&&(i.width||i.height)&&(n?(n=!1,r||Lt(t,i)):Rt(t,i));n&&St.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?_t(ut,t.x,t.y):pt(ut,t.x,t.y)),ft(ut,t)},setPoint(t,e){St.set(t,e.x,e.y)},addPoint(t,e){Rt(t,e,!0)},getPoints(t){const{x:e,y:s,width:r,height:i}=t;return[{x:e,y:s},{x:e+r,y:s},{x:e+r,y:s+i},{x:e,y:s+i}]},hitRadiusPoint:(t,e,s)=>(s&&(e=q.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=q.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=St.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=St.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=St.tempToOuterOf(e,s)),!St.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:r,y:i,width:n,height:o}=e;return bt=r+n,Bt=i+o,vt=t.x+t.width,kt=t.y+t.height,r=r>t.x?r:t.x,i=i>t.y?i:t.y,bt=bt<vt?bt:vt,Bt=Bt<kt?Bt:kt,n=bt-r,o=Bt-i,{x:r,y:i,width:n,height:o}},intersect(t,e,s){St.copy(t,St.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){St.set(t)}},St=Tt,{add:Rt,copy:Lt}=St;class Et{get minX(){return Tt.minX(this)}get minY(){return Tt.minY(this)}get maxX(){return Tt.maxX(this)}get maxY(){return Tt.maxY(this)}constructor(t,e,s,r){this.set(t,e,s,r)}set(t,e,s,r){return _(t)?Tt.copy(this,t):Tt.set(this,t,e,s,r),this}get(){const{x:t,y:e,width:s,height:r}=this;return{x:t,y:e,width:s,height:r}}clone(){return new Et(this)}move(t,e){return Tt.move(this,t,e),this}scale(t,e,s){return Tt.scale(this,t,e,s),this}scaleOf(t,e,s){return Tt.scaleOf(this,t,e,s),this}toOuterOf(t,e){return Tt.toOuterOf(this,t,e),this}toInnerOf(t,e){return Tt.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Tt.getFitMatrix(this,t,e)}put(t,e,s){Tt.put(this,t,e,s)}spread(t,e){return Tt.spread(this,t,e),this}shrink(t,e){return Tt.shrink(this,t,e),this}ceil(){return Tt.ceil(this),this}unsign(){return Tt.unsign(this),this}float(t){return Tt.float(this,t),this}add(t){return Tt.add(this,t),this}addList(t){return Tt.setList(this,t,!0),this}setList(t){return Tt.setList(this,t),this}addListWithFn(t,e){return Tt.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Tt.setListWithFn(this,t,e),this}setPoint(t){return Tt.setPoint(this,t),this}setPoints(t){return Tt.setPoints(this,t),this}addPoint(t){return Tt.addPoint(this,t),this}getPoints(){return Tt.getPoints(this)}hitPoint(t,e){return Tt.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Tt.hitRadiusPoint(this,t,e)}hit(t,e){return Tt.hit(this,t,e)}includes(t,e){return Tt.includes(this,t,e)}intersect(t,e){return Tt.intersect(this,t,e),this}getIntersect(t,e){return new Et(Tt.getIntersectData(this,t,e))}isSame(t){return Tt.isSame(this,t)}isEmpty(){return Tt.isEmpty(this)}reset(){Tt.reset(this)}}const It=new Et;class Mt{constructor(t,e,s,r,i,n){_(t)?this.copy(t):this.set(t,e,s,r,i,n)}set(t=0,e=0,s=0,r=0,i=0,n=0){this.top=t,this.right=e,this.bottom=s,this.left=r,this.width=i,this.height=n}copy(t){const{top:e,right:s,bottom:r,left:i,width:n,height:o}=t;this.set(e,s,r,i,n,o)}getBoundsFrom(t){const{top:e,right:s,bottom:r,left:i,width:n,height:o}=this;return new Et(i,e,n||t.width-i-s,o||t.height-e-r)}}const At={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:Wt}=B;class Nt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new Nt(t)}static set filter(t){this.filterList=Yt(t)}static set exclude(t){this.excludeList=Yt(t)}static drawRepaint(t,e){const s=Wt();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const r="hit"===Nt.showBounds,i=t.__nowWorld,n=Wt();r&&(e.setWorld(i),t.__drawHitPath(e),e.fillStyle=n.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(n,2),r?e.stroke():e.strokeWorld(i,n)}log(...t){if(Xt.enable){if(Xt.filterList.length&&Xt.filterList.every(t=>t!==this.name))return;if(Xt.excludeList.length&&Xt.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){Xt.enable&&this.warn(...t)}warn(...t){Xt.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 Yt(t){return t?a(t)&&(t=[t]):t=[],t}Nt.filterList=[],Nt.excludeList=[],Nt.showWarn=!0;const Xt=Nt,Dt=Nt.get("RunTime"),zt={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,s){const r=e.create(e.RUNTIME);return Ft.currentId=Ft.idMap[r]=s?performance.now():Date.now(),Ft.currentName=Ft.nameMap[r]=t,Ft.nameToIdMap[t]=r,r},end(t,e){const s=Ft.idMap[t],r=Ft.nameMap[t],i=e?(performance.now()-s)/1e3:Date.now()-s;Ft.idMap[t]=Ft.nameMap[t]=Ft.nameToIdMap[r]=void 0,Dt.log(r,i,"ms")},endOfName(t,e){const s=Ft.nameToIdMap[t];n(s)||Ft.end(s,e)}},Ft=zt,jt=[],Ut={list:{},add(t,...e){this.list[t]=!0,jt.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(()=>jt.forEach(t=>Ut.has(t,!0)));const Ht={editor:t=>Ut.need("editor")},Gt=Nt.get("UICreator"),Vt={list:{},register(t){const{__tag:e}=t.prototype;qt[e]&&Gt.repeat(e),qt[e]=t},get(t,e,s,r,i,o){qt[t]||Gt.error("not register "+t);const a=new qt[t](e);return n(s)||(a.x=s,r&&(a.y=r),i&&(a.width=i),o&&(a.height=o)),a}},{list:qt}=Vt,Qt=Nt.get("EventCreator"),Jt={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],a(e)&&(Zt[e]&&Qt.repeat(e),Zt[e]=t)})},changeName(t,e){const s=Zt[t];if(s){const r=Object.keys(s).find(e=>s[e]===t);r&&(s[r]=e,Zt[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new Zt[t](...e)},{nameList:Zt}=Jt;class $t{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:s}=this;for(let r=0,i=s.length;r<i;r++)if(e=s[r],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const r=Ht.canvas(t);return this.add(r),r}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,r=this.list.length;s<r;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 Kt(t,e,s,r){var i,n=arguments.length,o=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(o=(n<3?i(o):n>3?i(e,s,o):i(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o}function te(t,e,s,r){return new(s||(s=Promise))(function(i,n){function o(t){try{h(r.next(t))}catch(t){n(t)}}function a(t){try{h(r.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}h((r=r.apply(t,e||[])).next())})}function ee(t){return(e,s)=>{t||(t=s);const r={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===s&&(r.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,s,r)}}"function"==typeof SuppressedError&&SuppressedError;const se=[];function re(){return(t,e)=>{se.push(e)}}const ie=[];class ne{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||ie)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;se.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,r,i,n){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,r,i,n){_(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,r,i,n)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,r){}strokeRect(t,e,s,r){}clearRect(t,e,s,r){}drawImage(t,e,s,r,i,n,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/r*a;r+=e,e=0,n+=t,a-=t}if(s<0){const t=-s/i*h;i+=s,s=0,o+=t,h-=t}this.context.drawImage(t,e,s,r,i,n,o,a,h);break;case 5:this.context.drawImage(t,e,s,r,i);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,r,i,n){}quadraticCurveTo(t,e,s,r){}closePath(){}arc(t,e,s,r,i,n){}arcTo(t,e,s,r,i){}ellipse(t,e,s,r,i,n,o,a){}rect(t,e,s,r){}roundRect(t,e,s,r,i){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,r){}createPattern(t,e){}createRadialGradient(t,e,s,r,i,n){}fillText(t,e,s,r){}measureText(t){}strokeText(t,e,s,r){}destroy(){this.context=null}}Kt([ee("imageSmoothingEnabled")],ne.prototype,"smooth",void 0),Kt([ee("imageSmoothingQuality")],ne.prototype,"smoothLevel",void 0),Kt([ee("globalAlpha")],ne.prototype,"opacity",void 0),Kt([ee()],ne.prototype,"fillStyle",void 0),Kt([ee()],ne.prototype,"strokeStyle",void 0),Kt([ee("lineWidth")],ne.prototype,"strokeWidth",void 0),Kt([ee("lineCap")],ne.prototype,"strokeCap",void 0),Kt([ee("lineJoin")],ne.prototype,"strokeJoin",void 0),Kt([ee("lineDashOffset")],ne.prototype,"dashOffset",void 0),Kt([ee()],ne.prototype,"miterLimit",void 0),Kt([ee()],ne.prototype,"shadowBlur",void 0),Kt([ee()],ne.prototype,"shadowColor",void 0),Kt([ee()],ne.prototype,"shadowOffsetX",void 0),Kt([ee()],ne.prototype,"shadowOffsetY",void 0),Kt([ee()],ne.prototype,"filter",void 0),Kt([ee()],ne.prototype,"font",void 0),Kt([ee()],ne.prototype,"fontKerning",void 0),Kt([ee()],ne.prototype,"fontStretch",void 0),Kt([ee()],ne.prototype,"fontVariantCaps",void 0),Kt([ee()],ne.prototype,"textAlign",void 0),Kt([ee()],ne.prototype,"textBaseline",void 0),Kt([ee()],ne.prototype,"textRendering",void 0),Kt([ee()],ne.prototype,"wordSpacing",void 0),Kt([ee()],ne.prototype,"letterSpacing",void 0),Kt([ee()],ne.prototype,"direction",void 0),Kt([re()],ne.prototype,"setTransform",null),Kt([re()],ne.prototype,"resetTransform",null),Kt([re()],ne.prototype,"getTransform",null),Kt([re()],ne.prototype,"save",null),Kt([re()],ne.prototype,"restore",null),Kt([re()],ne.prototype,"translate",null),Kt([re()],ne.prototype,"scale",null),Kt([re()],ne.prototype,"rotate",null),Kt([re()],ne.prototype,"fill",null),Kt([re()],ne.prototype,"stroke",null),Kt([re()],ne.prototype,"clip",null),Kt([re()],ne.prototype,"fillRect",null),Kt([re()],ne.prototype,"strokeRect",null),Kt([re()],ne.prototype,"clearRect",null),Kt([re()],ne.prototype,"beginPath",null),Kt([re()],ne.prototype,"moveTo",null),Kt([re()],ne.prototype,"lineTo",null),Kt([re()],ne.prototype,"bezierCurveTo",null),Kt([re()],ne.prototype,"quadraticCurveTo",null),Kt([re()],ne.prototype,"closePath",null),Kt([re()],ne.prototype,"arc",null),Kt([re()],ne.prototype,"arcTo",null),Kt([re()],ne.prototype,"ellipse",null),Kt([re()],ne.prototype,"rect",null),Kt([re()],ne.prototype,"roundRect",null),Kt([re()],ne.prototype,"createConicGradient",null),Kt([re()],ne.prototype,"createLinearGradient",null),Kt([re()],ne.prototype,"createPattern",null),Kt([re()],ne.prototype,"createRadialGradient",null),Kt([re()],ne.prototype,"fillText",null),Kt([re()],ne.prototype,"measureText",null),Kt([re()],ne.prototype,"strokeText",null);const{copy:oe,multiplyParent:ae}=N,{round:he}=Math,le=new Et,de=new Et,ce={width:1,height:1,pixelRatio:1},ue=["width","height","pixelRatio"];class _e extends ne{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(s,r){super(),this.size={},this.worldTransform={},s||(s=ce),this.manager=r,this.innerId=e.create(e.CNAVAS);const{width:i,height:n,pixelRatio:o}=s;this.autoLayout=!i||!n,this.size.pixelRatio=o||t.devicePixelRatio,this.config=s,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 r=this.size;g.copyAttrs(r,t,ue),ue.forEach(t=>r[t]||(r[t]=1)),this.bounds=new Et(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,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s,pixelSnap:r}=this,i=this.worldTransform;e&&ae(t,e,i),i.a=t.a*s,i.b=t.b*s,i.c=t.c*s,i.d=t.d*s,i.e=t.e*s,i.f=t.f*s,r&&(t.half&&t.half*s%2?(i.e=he(i.e-.5)+.5,i.f=he(i.f-.5)+.5):(i.e=he(i.e),i.f=he(i.f))),this.setTransform(i.a,i.b,i.c,i.d,i.e,i.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,r){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,r)}setStrokeOptions(t,e){let{strokeCap:s,strokeJoin:r,dashPattern:i,dashOffset:o,miterLimit:a}=t;e&&(e.strokeCap&&(s=e.strokeCap),e.strokeJoin&&(r=e.strokeJoin),n(e.dashPattern)||(i=e.dashPattern),n(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=s,this.strokeJoin=r,this.dashPattern=i,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,r){const{pixelRatio:i}=this;this.shadowOffsetX=t*i,this.shadowOffsetY=e*i,this.shadowBlur=s*i,this.shadowColor=r||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,r,i=!0){r&&(this.blendMode=r),e?(this.setTempPixelBounds(e,i),s?(this.setTempPixelBounds2(s,i),s=de):s=le,this.drawImage(t.view,le.x,le.y,le.width,le.height,s.x,s.y,s.width,s.height)):this.drawImage(t.view,0,0),r&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,r,i=!0){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Tt.tempToOuterOf(s,e),r,i),this.restore()):(r&&(this.blendMode=r),this.setTempPixelBounds(e,i),this.drawImage(t.view,le.x,le.y,le.width,le.height,s.x,s.y,s.width,s.height),r&&(this.blendMode="source-over"))}copyWorldByReset(t,e,s,r,i,n=!0){this.resetTransform(),this.copyWorld(t,e,s,r,n),i||this.useWorldTransform()}useGrayscaleAlpha(t){let e,s;this.setTempPixelBounds(t,!0,!0);const{context:r}=this,i=r.getImageData(le.x,le.y,le.width,le.height),{data:n}=i;for(let t=0,r=n.length;t<r;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));r.putImageData(i,le.x,le.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,r){s&&(this.blendMode=s),this.fillStyle=e,this.setTempPixelBounds(t,r),this.fillRect(le.x,le.y,le.width,le.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s,r){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempPixelBounds(t,r),this.strokeRect(le.x,le.y,le.width,le.height),s&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(le.x,le.y,le.width,le.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(le.x,le.y,le.width,le.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,s){this.copyToPixelBounds(le,t,e,s)}setTempPixelBounds2(t,e,s){this.copyToPixelBounds(de,t,e,s)}copyToPixelBounds(t,e,s,r){t.set(e),r&&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:r}=this,i=this.manager?this.manager.get(s):Ht.canvas(Object.assign({},s));return i.save(),t&&(oe(i.worldTransform,this.worldTransform),i.useWorldTransform()),e&&(i.smooth=this.smooth),i.pixelSnap!==r&&(i.pixelSnap=r),i}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 pe={creator:{},parse(t,e){},convertToCanvasData(t,e){}},fe={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},ge=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},fe),ye={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},me={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},xe=Object.assign(Object.assign({},me),fe),we=ge,be={};for(let t in we)be[we[t]]=t;const Be={};for(let t in we)Be[we[t]]=ye[t];const ve={drawRoundRect(t,e,s,r,i,n){const o=B.fourNumber(n,Math.min(r/2,i/2)),a=e+r,h=s+i;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:ke,cos:Ce,atan2:Oe,ceil:Pe,abs:Te,PI:Se,sqrt:Re,pow:Le}=Math,{setPoint:Ee,addPoint:Ie}=rt,{set:Me,toNumberPoints:Ae}=q,{M:We,L:Ne,C:Ye,Q:Xe,Z:De}=ge,ze={},Fe={points(t,e,s,r){let i=Ae(e);if(t.push(We,i[0],i[1]),s&&i.length>5){let e,n,o,a,h,l,d,c,u,_,p,f,g,y=i.length;const m=!0===s?.5:s;r&&(i=[i[y-2],i[y-1],...i,i[0],i[1],i[2],i[3]],y=i.length);for(let s=2;s<y-2;s+=2)e=i[s-2],n=i[s-1],o=i[s],a=i[s+1],h=i[s+2],l=i[s+3],p=Re(Le(o-e,2)+Le(a-n,2)),f=Re(Le(h-o,2)+Le(l-a,2)),(p||f)&&(g=p+f,p=m*p/g,f=m*f/g,h-=e,l-=n,d=o-p*h,c=a-p*l,2===s?r||t.push(Xe,d,c,o,a):t.push(Ye,u,_,d,c,o,a),u=o+f*h,_=a+f*l);r||t.push(Xe,u,_,i[y-2],i[y-1])}else for(let e=2,s=i.length;e<s;e+=2)t.push(Ne,i[e],i[e+1]);r&&t.push(De)},rect(t,e,s,r,i){pe.creator.path=t,pe.creator.moveTo(e,s).lineTo(e+r,s).lineTo(e+r,s+i).lineTo(e,s+i).lineTo(e,s)},roundRect(t,e,s,r,i,n){pe.creator.path=[],ve.drawRoundRect(pe.creator,e,s,r,i,n),t.push(...pe.convertToCanvasData(pe.creator.path,!0))},arcTo(t,e,s,r,i,n,o,a,h,l,d){const c=r-e,u=i-s,_=n-r,p=o-i;let f=Oe(u,c),g=Oe(p,_),y=g-f;if(y<0&&(y+=C),y===Se||Te(c+u)<1e-12||Te(_+p)<1e-12)return t&&t.push(Ne,r,i),h&&(Ee(h,e,s),Ie(h,r,i)),d&&Me(d,e,s),void(l&&Me(l,r,i));const m=c*p-_*u<0,x=m?-1:1,w=a/Ce(y/2),b=r+w*Ce(f+y/2+O*x),B=i+w*ke(f+y/2+O*x);return f-=O*x,g-=O*x,He(t,b,B,a,a,0,f/k,g/k,m,h,l,d)},arc:(t,e,s,r,i,n,o,a,h,l)=>He(t,e,s,r,r,0,i,n,o,a,h,l),ellipse(t,e,s,r,i,n,o,a,h,l,d,c){const u=n*k,_=ke(u),p=Ce(u);let f=o*k,g=a*k;f>Se&&(f-=C),g<0&&(g+=C);let y=g-f;y<0?y+=C:y>C&&(y-=C),h&&(y-=C);const m=Pe(Te(y/O)),x=y/m,w=ke(x/4),b=8/3*w*w/ke(x/2);g=f+x;let B,v,P,T,S,R,L,E,I=Ce(f),M=ke(f),A=P=p*r*I-_*i*M,W=T=_*r*I+p*i*M,N=e+P,Y=s+T;t&&t.push(t.length?Ne:We,N,Y),l&&Ee(l,N,Y),c&&Me(c,N,Y);for(let n=0;n<m;n++)B=Ce(g),v=ke(g),P=p*r*B-_*i*v,T=_*r*B+p*i*v,S=e+A-b*(p*r*M+_*i*I),R=s+W-b*(_*r*M-p*i*I),L=e+P+b*(p*r*v+_*i*B),E=s+T+b*(_*r*v-p*i*B),t&&t.push(Ye,S,R,L,E,e+P,s+T),l&&Ue(e+A,s+W,S,R,L,E,e+P,s+T,l,!0),A=P,W=T,I=B,M=v,f=g,g+=x;d&&Me(d,e+P,s+T)},quadraticCurveTo(t,e,s,r,i,n,o){t.push(Ye,(e+2*r)/3,(s+2*i)/3,(n+2*r)/3,(o+2*i)/3,n,o)},toTwoPointBoundsByQuadraticCurve(t,e,s,r,i,n,o,a){Ue(t,e,(t+2*s)/3,(e+2*r)/3,(i+2*s)/3,(n+2*r)/3,i,n,o,a)},toTwoPointBounds(t,e,s,r,i,n,o,a,h,l){const d=[];let c,u,_,p,f,g,y,m,x=t,w=s,b=i,B=o;for(let t=0;t<2;++t)if(1==t&&(x=e,w=r,b=n,B=a),c=-3*x+9*w-9*b+3*B,u=6*x-12*w+6*b,_=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||(f=(-u+m)/(2*c),0<f&&f<1&&d.push(f),g=(-u-m)/(2*c),0<g&&g<1&&d.push(g));l?Ie(h,t,e):Ee(h,t,e),Ie(h,o,a);for(let l=0,c=d.length;l<c;l++)je(d[l],t,e,s,r,i,n,o,a,ze),Ie(h,ze.x,ze.y)},getPointAndSet(t,e,s,r,i,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*r+_*n+p*a,l.y=c*s+u*i+_*o+p*h},getPoint(t,e,s,r,i,n,o,a,h){const l={};return je(t,e,s,r,i,n,o,a,h,l),l},getDerivative(t,e,s,r,i){const n=1-t;return 3*n*n*(s-e)+6*n*t*(r-s)+3*t*t*(i-r)}},{getPointAndSet:je,toTwoPointBounds:Ue,ellipse:He}=Fe,{sin:Ge,cos:Ve,sqrt:qe,atan2:Qe}=Math,{ellipse:Je}=Fe,Ze={ellipticalArc(e,s,r,i,n,o,a,h,l,d,c){const u=(l-s)/2,_=(d-r)/2,p=o*k,f=Ge(p),g=Ve(p),y=-g*u-f*_,m=-g*_+f*u,x=i*i,w=n*n,b=m*m,B=y*y,v=x*w-x*b-w*B;let O=0;if(v<0){const t=qe(1-v/(x*w));i*=t,n*=t}else O=(a===h?-1:1)*qe(v/(x*b+w*B));const P=O*i*m/n,T=-O*n*y/i,S=Qe((m-T)/n,(y-P)/i),R=Qe((-m-T)/n,(-y-P)/i);let L=R-S;0===h&&L>0?L-=C:1===h&&L<0&&(L+=C);const E=s+u+g*P-f*T,I=r+_+f*P+g*T,M=L<0?1:0;c||t.ellipseToCurve?Je(e,E,I,i,n,o,S/k,R/k,M):i!==n||o?e.push(ge.G,E,I,i,n,o,S/k,R/k,M):e.push(ge.O,E,I,i,S/k,R/k,M)}},{M:$e,m:Ke,L:ts,l:es,H:ss,h:rs,V:is,v:ns,C:os,c:as,S:hs,s:ls,Q:ds,q:cs,T:us,t:_s,A:ps,a:fs,Z:gs,z:ys,N:ms,D:xs,X:ws,G:bs,F:Bs,O:vs,P:ks,U:Cs}=ge,{rect:Os,roundRect:Ps,arcTo:Ts,arc:Ss,ellipse:Rs,quadraticCurveTo:Ls}=Fe,{ellipticalArc:Es}=Ze,Is=Nt.get("PathConvert"),Ms={},As={current:{dot:0},stringify(t,e){let s,r,i,n=0,o=t.length,a="";for(;n<o;){r=t[n],s=Be[r],a+=r===i?" ":be[r];for(let r=1;r<s;r++)a+=B.float(t[n+r],e),r===s-1||(a+=" ");i=r,n+=s}return a},parse(t,e){let s,r,i,n="";const o=[],a=e?xe:me;for(let e=0,h=t.length;e<h;e++)r=t[e],At[r]?("."===r&&(Ws.dot&&(Ns(o,n),n=""),Ws.dot++),"0"===n&&"."!==r&&(Ns(o,n),n=""),n+=r):ge[r]?(n&&(Ns(o,n),n=""),Ws.name=ge[r],Ws.length=ye[r],Ws.index=0,Ns(o,Ws.name),!s&&a[r]&&(s=!0)):"-"===r||"+"===r?"e"===i||"E"===i?n+=r:(n&&Ns(o,n),n=r):n&&(Ns(o,n),n=""),i=r;return n&&Ns(o,n),s?As.toCanvasData(o,e):o},toCanvasData(t,e){let s,r,i,n,o,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(i=t[c],i){case Ke:t[c+1]+=a,t[c+2]+=h;case $e:a=t[c+1],h=t[c+2],_.push($e,a,h),c+=3;break;case rs:t[c+1]+=a;case ss:a=t[c+1],_.push(ts,a,h),c+=2;break;case ns:t[c+1]+=h;case is:h=t[c+1],_.push(ts,a,h),c+=2;break;case es:t[c+1]+=a,t[c+2]+=h;case ts:a=t[c+1],h=t[c+2],_.push(ts,a,h),c+=3;break;case ls:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,i=hs;case hs:o=n===os||n===hs,l=o?2*a-s:t[c+1],d=o?2*h-r:t[c+2],s=t[c+1],r=t[c+2],a=t[c+3],h=t[c+4],_.push(os,l,d,s,r,a,h),c+=5;break;case as:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,t[c+5]+=a,t[c+6]+=h,i=os;case os:s=t[c+3],r=t[c+4],a=t[c+5],h=t[c+6],_.push(os,t[c+1],t[c+2],s,r,a,h),c+=7;break;case _s:t[c+1]+=a,t[c+2]+=h,i=us;case us:o=n===ds||n===us,s=o?2*a-s:t[c+1],r=o?2*h-r:t[c+2],e?Ls(_,a,h,s,r,t[c+1],t[c+2]):_.push(ds,s,r,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case cs:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,i=ds;case ds:s=t[c+1],r=t[c+2],e?Ls(_,a,h,s,r,t[c+3],t[c+4]):_.push(ds,s,r,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case fs:t[c+6]+=a,t[c+7]+=h;case ps:Es(_,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 ys:case gs:_.push(gs),c++;break;case ms:a=t[c+1],h=t[c+2],e?Os(_,a,h,t[c+3],t[c+4]):Ys(_,t,c,5),c+=5;break;case xs:a=t[c+1],h=t[c+2],e?Ps(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):Ys(_,t,c,9),c+=9;break;case ws:a=t[c+1],h=t[c+2],e?Ps(_,a,h,t[c+3],t[c+4],t[c+5]):Ys(_,t,c,6),c+=6;break;case bs:Rs(e?_:Ys(_,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,Ms),a=Ms.x,h=Ms.y,c+=9;break;case Bs:e?Rs(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):Ys(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case vs:Ss(e?_:Ys(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,Ms),a=Ms.x,h=Ms.y,c+=7;break;case ks:e?Ss(_,t[c+1],t[c+2],t[c+3],0,360,!1):Ys(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case Cs:Ts(e?_:Ys(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,Ms),a=Ms.x,h=Ms.y,c+=6;break;default:return Is.error(`command: ${i} [index:${c}]`,t),_}n=i}return _},objectToCanvasData(t){const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push($e,t.x,t.y);break;case"L":e.push(ts,t.x,t.y);break;case"C":e.push(os,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(ds,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(gs)}}),e},copyData(t,e,s,r){for(let i=s,n=s+r;i<n;i++)t.push(e[i])},pushData(t,e){Ws.index===Ws.length&&(Ws.index=1,t.push(Ws.name)),t.push(Number(e)),Ws.index++,Ws.dot=0}},{current:Ws,pushData:Ns,copyData:Ys}=As,{M:Xs,L:Ds,C:zs,Q:Fs,Z:js,N:Us,D:Hs,X:Gs,G:Vs,F:qs,O:Qs,P:Js,U:Zs}=ge,{getMinDistanceFrom:$s,getRadianFrom:Ks}=q,{tan:tr,min:er,abs:sr}=Math,rr={},ir={beginPath(t){t.length=0},moveTo(t,e,s){t.push(Xs,e,s)},lineTo(t,e,s){t.push(Ds,e,s)},bezierCurveTo(t,e,s,r,i,n,o){t.push(zs,e,s,r,i,n,o)},quadraticCurveTo(t,e,s,r,i){t.push(Fs,e,s,r,i)},closePath(t){t.push(js)},rect(t,e,s,r,i){t.push(Us,e,s,r,i)},roundRect(t,e,s,r,i,n){if(l(n))t.push(Gs,e,s,r,i,n);else{const o=B.fourNumber(n);o?t.push(Hs,e,s,r,i,...o):t.push(Us,e,s,r,i)}},ellipse(t,e,s,r,i,n,a,h,l){o(n)?t.push(qs,e,s,r,i):(o(a)&&(a=0),o(h)&&(h=360),t.push(Vs,e,s,r,i,n,a,h,l?1:0))},arc(t,e,s,r,i,n,a){o(i)?t.push(Js,e,s,r):(o(n)&&(n=360),t.push(Qs,e,s,r,i,n,a?1:0))},arcTo(t,e,s,r,i,o,a,h){if(!n(a)){const t=$s(a,h,e,s,r,i);o=er(o,er(t/2,t/2*sr(tr(Ks(a,h,e,s,r,i)/2))))}t.push(Zs,e,s,r,i,o)},drawEllipse(t,e,s,r,i,n,a,h,l){Fe.ellipse(null,e,s,r,i,o(n)?0:n,o(a)?0:a,o(h)?360:h,l,null,null,rr),t.push(Xs,rr.x,rr.y),nr(t,e,s,r,i,n,a,h,l)},drawArc(t,e,s,r,i,n,a){Fe.arc(null,e,s,r,o(i)?0:i,o(n)?360:n,a,null,null,rr),t.push(Xs,rr.x,rr.y),or(t,e,s,r,i,n,a)},drawPoints(t,e,s,r){Fe.points(t,e,s,r)}},{ellipse:nr,arc:or}=ir,{moveTo:ar,lineTo:hr,quadraticCurveTo:lr,bezierCurveTo:dr,closePath:cr,beginPath:ur,rect:_r,roundRect:pr,ellipse:fr,arc:gr,arcTo:yr,drawEllipse:mr,drawArc:xr,drawPoints:wr}=ir;class br{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?a(t)?pe.parse(t):t:[],this}beginPath(){return ur(this.__path),this.paint(),this}moveTo(t,e){return ar(this.__path,t,e),this.paint(),this}lineTo(t,e){return hr(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,r,i,n){return dr(this.__path,t,e,s,r,i,n),this.paint(),this}quadraticCurveTo(t,e,s,r){return lr(this.__path,t,e,s,r),this.paint(),this}closePath(){return cr(this.__path),this.paint(),this}rect(t,e,s,r){return _r(this.__path,t,e,s,r),this.paint(),this}roundRect(t,e,s,r,i){return pr(this.__path,t,e,s,r,i),this.paint(),this}ellipse(t,e,s,r,i,n,o,a){return fr(this.__path,t,e,s,r,i,n,o,a),this.paint(),this}arc(t,e,s,r,i,n){return gr(this.__path,t,e,s,r,i,n),this.paint(),this}arcTo(t,e,s,r,i){return yr(this.__path,t,e,s,r,i),this.paint(),this}drawEllipse(t,e,s,r,i,n,o,a){return mr(this.__path,t,e,s,r,i,n,o,a),this.paint(),this}drawArc(t,e,s,r,i,n){return xr(this.__path,t,e,s,r,i,n),this.paint(),this}drawPoints(t,e,s){return wr(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:Br,L:vr,C:kr,Q:Cr,Z:Or,N:Pr,D:Tr,X:Sr,G:Rr,F:Lr,O:Er,P:Ir,U:Mr}=ge,Ar=Nt.get("PathDrawer"),Wr={drawPathByData(t,e){if(!e)return;let s,r=0,i=e.length;for(;r<i;)switch(s=e[r],s){case Br:t.moveTo(e[r+1],e[r+2]),r+=3;break;case vr:t.lineTo(e[r+1],e[r+2]),r+=3;break;case kr:t.bezierCurveTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5],e[r+6]),r+=7;break;case Cr:t.quadraticCurveTo(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case Or:t.closePath(),r+=1;break;case Pr:t.rect(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case Tr:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],[e[r+5],e[r+6],e[r+7],e[r+8]]),r+=9;break;case Sr:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;case Rr:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]*k,e[r+6]*k,e[r+7]*k,e[r+8]),r+=9;break;case Lr:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],0,0,C,!1),r+=5;break;case Er:t.arc(e[r+1],e[r+2],e[r+3],e[r+4]*k,e[r+5]*k,e[r+6]),r+=7;break;case Ir:t.arc(e[r+1],e[r+2],e[r+3],0,C,!1),r+=4;break;case Mr:t.arcTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;default:return void Ar.error(`command: ${s} [index:${r}]`,e)}}},{M:Nr,L:Yr,C:Xr,Q:Dr,Z:zr,N:Fr,D:jr,X:Ur,G:Hr,F:Gr,O:Vr,P:qr,U:Qr}=ge,{toTwoPointBounds:Jr,toTwoPointBoundsByQuadraticCurve:Zr,arcTo:$r,arc:Kr,ellipse:ti}=Fe,{addPointBounds:ei,copy:si,addPoint:ri,setPoint:ii,addBounds:ni,toBounds:oi}=rt,ai=Nt.get("PathBounds");let hi,li,di;const ci={},ui={},_i={},pi={toBounds(t,e){pi.toTwoPointBounds(t,ui),oi(ui,e)},toTwoPointBounds(t,e){if(!t||!t.length)return ii(e,0,0);let s,r,i,n,o,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(o=t[a],0===a&&(o===zr||o===Xr||o===Dr?ii(e,h,l):ii(e,t[a+1],t[a+2])),o){case Nr:case Yr:h=t[a+1],l=t[a+2],ri(e,h,l),a+=3;break;case Xr:i=t[a+5],n=t[a+6],Jr(h,l,t[a+1],t[a+2],t[a+3],t[a+4],i,n,ci),ei(e,ci),h=i,l=n,a+=7;break;case Dr:s=t[a+1],r=t[a+2],i=t[a+3],n=t[a+4],Zr(h,l,s,r,i,n,ci),ei(e,ci),h=i,l=n,a+=5;break;case zr:a+=1;break;case Fr:h=t[a+1],l=t[a+2],ni(e,h,l,t[a+3],t[a+4]),a+=5;break;case jr:case Ur:h=t[a+1],l=t[a+2],ni(e,h,l,t[a+3],t[a+4]),a+=o===jr?9:6;break;case Hr:ti(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],ci,_i),0===a?si(e,ci):ei(e,ci),h=_i.x,l=_i.y,a+=9;break;case Gr:h=t[a+1],l=t[a+2],li=t[a+3],di=t[a+4],ni(e,h-li,l-di,2*li,2*di),h+=li,a+=5;break;case Vr:Kr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],ci,_i),0===a?si(e,ci):ei(e,ci),h=_i.x,l=_i.y,a+=7;break;case qr:h=t[a+1],l=t[a+2],hi=t[a+3],ni(e,h-hi,l-hi,2*hi,2*hi),h+=hi,a+=4;break;case Qr:$r(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],ci,_i),0===a?si(e,ci):ei(e,ci),h=_i.x,l=_i.y,a+=6;break;default:return void ai.error(`command: ${o} [index:${a}]`,t)}}},{M:fi,L:gi,Z:yi}=ge,{getCenterX:mi,getCenterY:xi}=q,{arcTo:wi}=ir,bi={smooth(t,e,s){let r,i,n,o=0,a=0,h=0,l=0,d=0,c=0,u=0,_=0,p=0;const f=t.length,g=[];for(;o<f;){switch(r=t[o],r){case fi:l=_=t[o+1],d=p=t[o+2],o+=3,t[o]===gi?(c=t[o+1],u=t[o+2],g.push(fi,mi(l,c),xi(d,u))):g.push(fi,l,d);break;case gi:switch(a=t[o+1],h=t[o+2],o+=3,t[o]){case gi:wi(g,a,h,t[o+1],t[o+2],e,_,p);break;case yi:wi(g,a,h,l,d,e,_,p);break;default:g.push(gi,a,h)}_=a,p=h;break;case yi:i!==yi&&(wi(g,l,d,c,u,e,_,p),g.push(yi)),o+=1;break;default:n=Be[r];for(let e=0;e<n;e++)g.push(t[o+e]);o+=n}i=r}return r!==yi&&(g[1]=l,g[2]=d),g}};pe.creator=new br,pe.parse=As.parse,pe.convertToCanvasData=As.toCanvasData;const Bi=new br,{drawRoundRect:vi}=ve;function ki(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,r,i){vi(this,t,e,s,r,i)})}(t)}const Ci={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=Oi.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{}}}},Oi=Ci;Oi.alphaPixelTypes.forEach(t=>Oi.upperCaseTypeMap[t]=t.toUpperCase());const Pi=Nt.get("TaskProcessor");class Ti{constructor(t){this.parallel=!0,this.time=1,this.id=e.create(e.TASK),this.task=t}run(){return te(this,void 0,void 0,function*(){try{this.task&&!this.isComplete&&this.parent.running&&(yield this.task())}catch(t){Pi.error(t)}})}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}}class Si{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 r=0;r<t;r++)r<=this.finishedIndex?(s+=this.list[r].time,r===this.finishedIndex&&(e=s)):e+=this.list[r].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&&g.assign(this.config,t),this.empty()}add(t,e){let s,r,i,o;const a=new Ti(t);return a.parent=this,l(e)?o=e:e&&(r=e.parallel,s=e.start,i=e.time,o=e.delay),i&&(a.time=i),!1===r&&(a.parallel=!1),n(o)?this.push(a,s):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(a,s))},o)),this.isComplete=!1,a}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++,this.nextTask()}).catch(t=>{this.onError(t)}):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;this.parallelList=[],this.parallelSuccessNumber=0;let e=this.index+this.config.parallel;e>this.list.length&&(e=this.list.length);for(let s=this.index;s<e&&(t=this.list[s],t.parallel);s++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const s=e.length,r=this.finishedIndex+s;if(e.length){if(!this.running)return;r<this.total&&(t=this.list[r],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 Ri=Nt.get("Resource"),Li={tasker:new Si,map:{},get isComplete(){return Ei.tasker.isComplete},set(t,e){Ei.map[t]&&Ri.repeat(t),Ei.map[t]=e},get:t=>Ei.map[t],remove(t){const e=Ei.map[t];e&&(e.destroy&&e.destroy(),delete Ei.map[t])},loadImage(t,e){return new Promise((s,r)=>{const i=this.setImage(t,t,e);i.load(()=>s(i),t=>r(t))})},setImage(t,e,s){let r;return a(e)?r={url:e}:e.url||(r={url:t,view:e}),r&&(s&&(r.format=s),e=Ht.image(r)),Ei.set(t,e),e},destroy(){Ei.map={}}},Ei=Li,Ii={maxRecycled:10,recycledList:[],patternTasker:new Si,get(t){let e=Li.get(t.url);return e||Li.set(t.url,e=Ht.image(t)),e.use++,e},recycle(t){t.use--,setTimeout(()=>{t.use||Mi.recycledList.push(t)})},clearRecycled(){const t=Mi.recycledList;t.length>Mi.maxRecycled&&(t.forEach(t=>!t.use&&t.url&&Li.remove(t.url)),t.length=0)},hasAlphaPixel:t=>Ci.alphaPixelTypes.some(e=>Mi.isFormat(e,t)),isFormat(t,e){if(e.format===t)return!0;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+Ci.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+Ci.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){Mi.recycledList=[]}},Mi=Ii,{IMAGE:Ai,create:Wi}=e,{floor:Ni,max:Yi}=Math;class Xi{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=Wi(Ai),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}Ii.isFormat("svg",t)&&(this.isSVG=!0),Ii.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(e,s){if(!this.loading){this.loading=!0;let{loadImage:e,loadImageWithProgress:s}=t.origin,r=this.config.showProgress&&s&&this.onProgress.bind(this);r&&(e=s),Li.tasker.add(()=>te(this,void 0,void 0,function*(){return yield e(this.url,r).then(t=>this.setView(t)).catch(t=>{this.error=t,this.onComplete(!1)})}))}return this.waitComplete.push(e,s),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)}onProgress(t){this.progress=t}onComplete(t){let e;this.waitComplete.forEach((s,r)=>{e=r%2,s&&(t?e||s(this):e&&s(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(e,s,r,i,n,o){if(e||(e=this.width),s||(s=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=t.origin.createCanvas(Yi(Ni(e+(n||0)),1),Yi(Ni(s+(o||0)),1)),h=a.getContext("2d");return r&&(h.globalAlpha=r),h.drawImage(this.view,0,0,e,s),this.cache=this.use>1?{data:a,params:arguments}:null,a}getPattern(e,s,r,i){const n=t.canvas.createPattern(e,s);try{r&&n.setTransform&&(n.setTransform(r),r=void 0)}catch(t){}return i&&g.stintSet(i,"transform",r),n}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}}function Di(t,e,s,r){r||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function zi(t,e){return Object.getOwnPropertyDescriptor(t,e)}function Fi(t,e){const s="_"+t;return{get(){const t=this[s];return n(t)?e:t},set(t){this[s]=t}}}function ji(t,e){return(s,r)=>Hi(s,r,t,e&&e(r))}function Ui(t){return t}function Hi(t,e,s,r){const i={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};Di(t,e,Object.assign(i,r||{})),wn(t,e,s)}function Gi(t){return ji(t)}function Vi(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function qi(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function Qi(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),tn(this))}}))}function Ji(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function Zi(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function $i(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s,e)&&tn(this)}}))}function Ki(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(tn(this),this.__.__removeNaturalSize())}}))}function tn(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function en(t){return ji(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),tn(this)}}))}const sn=$i;function rn(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s)&&(nn(this),e&&(this.__.__useStroke=!0))}}))}function nn(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&tn(t)}const on=rn;function an(t){return ji(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function hn(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function ln(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&cn(this)}}))}function dn(t){return ji(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>un(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");un(this,t,e,s),this.mask&&cn(this)}}))}function cn(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function un(t,e,s,r){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==r&&0!==s||tn(t))}function _n(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange(),this.waitParent(()=>{this.parent.__layout.childrenSortChange()}))}}))}function pn(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function fn(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function gn(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===Nt.showBounds&&(this.__layout.surfaceChanged||this.__layout.surfaceChange()),this.leafer&&this.leafer.updateCursor())}}))}function yn(t){return ji(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function mn(t){return(e,s)=>{Di(e,"__DataProcessor",{get:()=>t})}}function xn(t){return(e,s)=>{Di(e,"__LayoutProcessor",{get:()=>t})}}function wn(t,e,s){const r=t.__DataProcessor.prototype,i="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=Fi(e,s);if(n(s))a.get=function(){return this[i]};else if("function"==typeof s)a.get=function(){let t=this[i];return void 0===t?s(this.__leaf):t};else if(_(s)){const t=f(s);a.get=function(){let e=this[i];return void 0===e?this[i]=t?{}:g.clone(s):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[i];if(void 0===t){const t=this,e=t.__naturalWidth,r=t.__leaf;return!s||r.pathInputed?r.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&r.children.length?r.boxBounds.width:s}return t}:"height"===e&&(a.get=function(){const t=this[i];if(void 0===t){const t=this,e=t.__naturalHeight,r=t.__leaf;return!s||r.pathInputed?r.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&r.children.length?r.boxBounds.height:s}return t});let l,d=r;for(;!l&&d;)l=zi(d,e),d=d.__proto__;l&&l.set&&(a.set=l.set),r[o]&&(a.set=r[o],delete r[o]),Di(r,e,a)}const bn=new Nt("rewrite"),Bn=[],vn=["destroy","constructor"];function kn(t){return(e,s)=>{Bn.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function Cn(){return t=>{On()}}function On(t){Bn.length&&(Bn.forEach(e=>{t&&bn.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),Bn.length=0)}function Pn(t,e){return s=>{var r;(t.prototype?(r=t.prototype,Object.getOwnPropertyNames(r)):Object.keys(t)).forEach(r=>{if(!(vn.includes(r)||e&&e.includes(r)))if(t.prototype){zi(t.prototype,r).writable&&(s.prototype[r]=t.prototype[r])}else s.prototype[r]=t[r]})}}function Tn(){return t=>{Vt.register(t)}}function Sn(){return t=>{Jt.register(t)}}setTimeout(()=>On(!0));const{copy:Rn,toInnerPoint:Ln,toOuterPoint:En,scaleOfOuter:In,rotateOfOuter:Mn,skewOfOuter:An,multiplyParent:Wn,divideParent:Nn,getLayout:Yn}=N,Xn={},{round:Dn}=Math,zn={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),Un(t,e,s),t.isBranch){const{children:r}=t;for(let t=0,i=r.length;t<i;t++)jn(r[t],e,s)}},updateMatrix(t,e,s){const r=t.__layout;e?s&&(r.waitAutoLayout=!0,t.__hasAutoLayout&&(r.matrixChanged=!1)):r.waitAutoLayout&&(r.waitAutoLayout=!1),r.matrixChanged&&t.__updateLocalMatrix(),r.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++)Hn(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&Hn(t),t.__updateChange()},updateAllChange(t){if(Vn(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Gn(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(e,s,r,i,n,o){i||(i=e.__nowWorld),e.__worldFlipped||t.fullImageShadow?s.copyWorldByReset(r,i,e.__nowWorld,n,o):s.copyWorldToInner(r,i,e.__layout.renderBounds,n)},moveWorld(t,e,s=0,r,i){const n=_(e)?Object.assign({},e):{x:e,y:s};r?En(t.localTransform,n,n,!0):t.parent&&Ln(t.parent.scrollWorldTransform,n,n,!0),Fn.moveLocal(t,n.x,n.y,i)},moveLocal(t,e,s=0,r){_(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=Dn(e),s=Dn(s)),r?t.animate({x:e,y:s},r):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,r,i,n){Fn.zoomOfLocal(t,qn(t,e),s,r,i,n)},zoomOfLocal(t,e,s,r=s,i,n){const o=t.__localMatrix;if(l(r)||(r&&(n=r),r=s),Rn(Xn,o),In(Xn,e,s,r),Fn.hasHighPosition(t))Fn.setTransform(t,Xn,i,n);else{const e=t.x+Xn.e-o.e,a=t.y+Xn.f-o.f;n&&!i?t.animate({x:e,y:a,scaleX:t.scaleX*s,scaleY:t.scaleY*r},n):(t.x=e,t.y=a,t.scaleResize(s,r,!0!==i))}},rotateOfWorld(t,e,s,r){Fn.rotateOfLocal(t,qn(t,e),s,r)},rotateOfLocal(t,e,s,r){const i=t.__localMatrix;Rn(Xn,i),Mn(Xn,e,s),Fn.hasHighPosition(t)?Fn.setTransform(t,Xn,!1,r):t.set({x:t.x+Xn.e-i.e,y:t.y+Xn.f-i.f,rotation:B.formatRotation(t.rotation+s)},r)},skewOfWorld(t,e,s,r,i,n){Fn.skewOfLocal(t,qn(t,e),s,r,i,n)},skewOfLocal(t,e,s,r=0,i,n){Rn(Xn,t.__localMatrix),An(Xn,e,s,r),Fn.setTransform(t,Xn,i,n)},transformWorld(t,e,s,r){Rn(Xn,t.worldTransform),Wn(Xn,e),t.parent&&Nn(Xn,t.parent.scrollWorldTransform),Fn.setTransform(t,Xn,s,r)},transform(t,e,s,r){Rn(Xn,t.localTransform),Wn(Xn,e),Fn.setTransform(t,Xn,s,r)},setTransform(t,e,s,r){const i=t.__,n=i.origin&&Fn.getInnerOrigin(t,i.origin),o=Yn(e,n,i.around&&Fn.getInnerOrigin(t,i.around));if(Fn.hasOffset(t)&&(o.x-=i.offsetX,o.y-=i.offsetY),s){const e=o.scaleX/t.scaleX,s=o.scaleY/t.scaleY;if(delete o.scaleX,delete o.scaleY,n){Tt.scale(t.boxBounds,Math.abs(e),Math.abs(s));const r=Fn.getInnerOrigin(t,i.origin);q.move(o,n.x-r.x,n.y-r.y)}t.set(o),t.scaleResize(e,s,!1)}else t.set(o,r)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},r="x"===e?1:-1;return In(s,Fn.getLocalOrigin(t,"center"),-1*r,1*r),s},getLocalOrigin:(t,e)=>q.tempToOuterOf(Fn.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return ht.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(Rn(Xn,t.worldTransform),Nn(Xn,e.scrollWorldTransform),s?Xn:Object.assign({},Xn)),drop(t,e,s,r){t.setTransform(Fn.getRelativeWorld(t,e,!0),r),e.add(t,s)},hasHighPosition:t=>t.origin||t.around||Fn.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(e,s,r=.3){if(s.x||s.y)if(Math.abs(s.x)<1&&Math.abs(s.y)<1)e.move(s);else{const i=s.x*r,n=s.y*r;s.x-=i,s.y-=n,e.move(i,n),t.requestRender(()=>Fn.animateMove(e,s,r))}}},Fn=zn,{updateAllMatrix:jn,updateMatrix:Un,updateAllWorldOpacity:Hn,updateAllChange:Gn,updateChange:Vn}=Fn;function qn(t,e){return t.parent?q.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const Qn={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)=>Zn(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>Zn(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds:(t,e)=>Zn(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 Jn;function Zn(t,e){return e||(Jn=0),t.__.mask&&(Jn=1),Jn<0?null:(Jn&&(Jn=-1),!0)}const{updateBounds:$n}=zn,Kn={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 r=0,i=s.length;r<i;r++)(t=s[r]).isBranch&&(t.__tempNumber=1,e.add(t),to(t,e))}},pushAllParent(t,e){const{keys:s}=e;if(s)for(;t.parent&&n(s[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:r}=t;for(let t=0,s=r.length;t<s;t++)r[t].isBranch&&e.push(r[t]);for(let t=s,r=e.length;t<r;t++)eo(e[t],e)},updateBounds(t,e){const s=[t];eo(t,s),so(s,e)},updateBoundsByBranchStack(t,e){let s,r;for(let i=t.length-1;i>-1;i--){s=t[i],r=s.children;for(let t=0,e=r.length;t<e;t++)$n(r[t]);e&&e===s||$n(s)}}},{pushAllChildBranch:to,pushAllBranchStack:eo,updateBoundsByBranchStack:so}=Kn,ro={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:io,updateBounds:no}=zn,{toOuterOf:oo,getPoints:ao,copy:ho}=Tt,lo="_localContentBounds",co="_worldContentBounds",uo="_worldBoxBounds",_o="_worldStrokeBounds";class po{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 oo(this.contentBounds,this.leaf.__localMatrix,this[lo]||(this[lo]={})),this[lo]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return oo(this.contentBounds,this.leaf.__world,this[co]||(this[co]={})),this[co]}get worldBoxBounds(){return oo(this.boxBounds,this.leaf.__world,this[uo]||(this[uo]={})),this[uo]}get worldStrokeBounds(){return oo(this.strokeBounds,this.leaf.__world,this[_o]||(this[_o]={})),this[_o]}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:e}=this,{leafer:s}=e;if(e.isApp)return no(e);if(s)s.ready?s.watcher.changed&&s.layouter.layout():s.start();else{let s=e;for(;s.parent&&!s.parent.leafer;)s=s.parent;const r=s;if(r.__fullLayouting)return;r.__fullLayouting=!0,t.layout(r),delete r.__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 N.defaultMatrix;case"page":t=e.zoomLayer;default:return io(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 Et(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:r}=this;let i,n,o,a=this.getInnerBounds(t);switch(e){case"world":i=r.getWorldPoint(a),n=r.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=r.__;o={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},i=r.getLocalPointByInner(a);break;case"inner":i=a,n=N.defaultMatrix;break;case"page":e=r.zoomLayer;default:i=r.getWorldPoint(a,e),n=io(r,e,!0)}if(o||(o=N.getLayout(n)),ho(o,a),q.copy(o,i),s){const{scaleX:t,scaleY:e}=o,s=Math.abs(t),r=Math.abs(e);1===s&&1===r||(o.scaleX/=s,o.scaleY/=r,o.width*=s,o.height*=r)}return o}getLayoutPoints(t,e="world"){const{leaf:s}=this,r=ao(this.getInnerBounds(t));let i;switch(e){case"world":i=null;break;case"local":i=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:i=e}return n(i)||r.forEach(t=>s.innerToWorld(t,null,!1,i)),r}shrinkContent(){const{x:t,y:e,width:s,height:r}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:r}}spreadStroke(){const{x:t,y:e,width:s,height:r}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:r},this._localStrokeBounds={x:t,y:e,width:s,height:r},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:r}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:r},this._localRenderBounds={x:t,y:e,width:s,height:r}}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.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.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 fo{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&t.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&t.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&t.event.stop(this.origin)}}class go extends fo{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}go.ADD="child.add",go.REMOVE="child.remove",go.CREATED="created",go.MOUNTED="mounted",go.UNMOUNTED="unmounted",go.DESTROY="destroy";const yo="property.scroll";class mo extends fo{constructor(t,e,s,r,i){super(t,e),this.attrName=s,this.oldValue=r,this.newValue=i}}mo.CHANGE="property.change",mo.LEAFER_CHANGE="property.leafer_change",mo.SCROLL=yo;const xo={scrollX:yo,scrollY:yo};class wo extends fo{constructor(t,e){super(t),Object.assign(this,e)}}wo.LOAD="image.load",wo.LOADED="image.loaded",wo.ERROR="image.error";class bo extends fo{static checkHas(t,e,s){"on"===s?e===Co?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Bo)||t.hasEvent(vo)||t.hasEvent(ko),t.__hasWorldEvent=t.hasEvent(Co))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Bo,t),"inner"===e&&t.emit(vo,t)),t.emit(ko,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Co,this)}}bo.RESIZE="bounds.resize",bo.INNER="bounds.inner",bo.LOCAL="bounds.local",bo.WORLD="bounds.world";const{RESIZE:Bo,INNER:vo,LOCAL:ko,WORLD:Co}=bo,Oo={};[Bo,vo,ko,Co].forEach(t=>Oo[t]=1);class Po extends fo{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){_(t)?(super(Po.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!n(this.resizingKeys[t.innerId])}}Po.RESIZE="resize";class To extends fo{constructor(t,e){super(t),this.data=e}}To.REQUEST="watch.request",To.DATA="watch.data";class So extends fo{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}So.REQUEST="layout.request",So.START="layout.start",So.BEFORE="layout.before",So.LAYOUT="layout",So.AFTER="layout.after",So.AGAIN="layout.again",So.END="layout.end";class Ro extends fo{constructor(t,e,s,r){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=r)}}Ro.REQUEST="render.request",Ro.CHILD_START="render.child_start",Ro.CHILD_END="render.child_end",Ro.START="render.start",Ro.BEFORE="render.before",Ro.RENDER="render",Ro.AFTER="render.after",Ro.AGAIN="render.again",Ro.END="render.end",Ro.NEXT="render.next";class Lo extends fo{}Lo.START="leafer.start",Lo.BEFORE_READY="leafer.before_ready",Lo.READY="leafer.ready",Lo.AFTER_READY="leafer.after_ready",Lo.VIEW_READY="leafer.view_ready",Lo.VIEW_COMPLETED="leafer.view_completed",Lo.STOP="leafer.stop",Lo.RESTART="leafer.restart",Lo.END="leafer.end",Lo.TRANSFORM="leafer.transform",Lo.MOVE="leafer.move",Lo.SCALE="leafer.scale",Lo.ROTATE="leafer.rotate",Lo.SKEW="leafer.skew";const{MOVE:Eo,SCALE:Io,ROTATE:Mo,SKEW:Ao}=Lo,Wo={x:Eo,y:Eo,scaleX:Io,scaleY:Io,rotation:Mo,skewX:Ao,skewY:Ao},No={};class Yo{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(u(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)u(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let r,i,n;s&&("once"===s?i=!0:"boolean"==typeof s?r=s:(r=s.capture,i=s.once));const o=Xo(this,r,!0),h=a(t)?t.split(" "):t,l=i?{listener:e,once:i}:{listener:e};h.forEach(t=>{t&&(n=o[t],n?-1===n.findIndex(t=>t.listener===e)&&n.push(l):o[t]=[l],Oo[t]&&bo.checkHas(this,t,"on"))})}off(t,e,s){if(t){const r=a(t)?t.split(" "):t;if(e){let t,i,n;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const o=Xo(this,t);r.forEach(t=>{t&&(i=o[t],i&&(n=i.findIndex(t=>t.listener===e),n>-1&&i.splice(n,1),i.length||delete o[t],Oo[t]&&bo.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;r.forEach(s=>{t&&delete t[s],e&&delete e[s]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,s,r){return e?this.on(t,s?e=e.bind(s):e,r):u(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:r}}off_(t){if(!t)return;const e=u(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):u(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,s,r){if(!e)return u(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));_(s)?e=e.bind(s):r=s,this.on(t,e,{once:!0,capture:r})}emit(t,e,s){!e&&Jt.has(t)&&(e=Jt.get(t,{type:t,target:this,current:this}));const r=Xo(this,s)[t];if(r){let i;for(let n=0,o=r.length;n<o&&!((i=r[n])&&(i.listener(e),i.once&&(this.off(t,i.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:s,__captureMap:r}=this,i=s&&s[t],o=r&&r[t];return!!(n(e)?i||o:e?o:i)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function Xo(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:No)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:No)}}const{on:Do,on_:zo,off:Fo,off_:jo,once:Uo,emit:Ho,emitEvent:Go,hasEvent:Vo,destroy:qo}=Yo.prototype,Qo={on:Do,on_:zo,off:Fo,off_:jo,once:Uo,emit:Ho,emitEvent:Go,hasEvent:Vo,destroyEventer:qo},Jo=Nt.get("setAttr"),Zo={__setAttr(t,e,s){if(this.leaferIsCreated){const r=this.__.__getInput(t);if(!s||h(e)||n(e)||(Jo.warn(this.innerName,t,e),e=void 0),_(e)||r!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new mo(mo.LEAFER_CHANGE,this,t,r,e));const s=Wo[t];s&&(this.emitEvent(new Lo(s,this)),this.emitEvent(new Lo(Lo.TRANSFORM,this)))}this.emitPropertyEvent(mo.CHANGE,t,r,e);const s=xo[t];return s&&this.emitPropertyEvent(s,t,r,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,s,r){const i=new mo(t,this,e,s,r);this.isLeafer||this.hasEvent(t)&&this.emitEvent(i),this.leafer.emitEvent(i)},__realSetAttr(t,e){const s=this.__;s[t]=e,this.__proxyData&&this.setProxyAttr(t,e),s.normalStyle&&(this.lockNormalStyle||n(s.normalStyle[t])||(s.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:$o,multiplyParent:Ko,translateInner:ta,defaultWorld:ea}=N,{toPoint:sa,tempPoint:ra}=ht,ia={__updateWorldMatrix(){const{parent:t,__layout:e,__world:s,__scrollWorld:r,__:i}=this;Ko(this.__local||e,t?t.__scrollWorld||t.__world:ea,s,!!e.affectScaleOrRotation,i),r&&ta(Object.assign(r,s),i.scrollX,i.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)&&($o(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)&&(sa(s.around||s.origin,t.boxBounds,ra),ta(e,-ra.x,-ra.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:na,updateAllMatrix:oa}=zn,{updateBounds:aa}=Kn,{toOuterOf:ha,copyAndSpread:la,copy:da}=Tt,{toBounds:ca}=pi,ua={__updateWorldBounds(){const t=this.__layout;ha(t.renderBounds,this.__world,this.__world),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&bo.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&bo.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(),ha(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){ha(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){ha(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const s=this.__layout.boxBounds,r=this.__;r.__pathInputed?ca(r.path,s):(s.x=0,s.y=0,s.width=r.width,s.height=r.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),oa(this),aa(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(oa(this),aa(this,this))):na(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;la(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout;e.renderSpread>0?la(e.renderBounds,e.boxBounds,e.renderSpread):da(e.renderBounds,e.strokeBounds)}},_a={__render(t,e){if(e.shape)return this.__renderShape(t,e);if(this.__worldOpacity){const s=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 r=t.getSameCanvas(!0,!0);this.__draw(r,e,t),zn.copyCanvasByWorld(this,t,r,this.__nowWorld,s.__blendMode,!0),r.recycle(this.__nowWorld)}else this.__draw(t,e);Nt.showBounds&&Nt.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:pa}=Qn,fa={__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.dim?e.dimOpacity=!0===s.dim?.2:s.dim:s.dimskip&&e.dimOpacity&&(e.dimOpacity=0),s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const r=t.getSameCanvas(!1,!0);this.__renderBranch(r,e);const i=this.__nowWorld;t.opacity=e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(r,i,i,s.__blendMode,!0),r.recycle(i)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let r=0,i=s.length;r<i;r++)pa(s[r],e)||s[r].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let r=0,i=s.length;r<i;r++)pa(s[r],e)||s[r].__clip(t,e)}}},ga={},{LEAF:ya,create:ma}=e,{toInnerPoint:xa,toOuterPoint:wa,multiplyParent:ba}=N,{toOuterOf:Ba}=Tt,{copy:va,move:ka}=q,{moveLocal:Ca,zoomOfLocal:Oa,rotateOfLocal:Pa,skewOfLocal:Ta,moveWorld:Sa,zoomOfWorld:Ra,rotateOfWorld:La,skewOfWorld:Ea,transform:Ia,transformWorld:Ma,setTransform:Aa,getFlipTransform:Wa,getLocalOrigin:Na,getRelativeWorld:Ya,drop:Xa}=zn;let Da=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 m}get __LayoutProcessor(){return po}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=ma(ya),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(go.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(go.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(go.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(go.MOUNTED)):this.__emitLifeEvent(go.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,r=e.length;s<r;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){n(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=n(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 ba(s,t.matrix,e,void 0,s),Ba(this.__layout.renderBounds,e,e),e.half!==s.half&&(e.half=s.half),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:r}=Ii.patternLocked?this.__world:this.__nowWorld;return t&&(s<0&&(s=-s),r<0&&(r=-r)),(!0===e||"zoom-in"===e&&s>1&&r>1)&&(s=r=1),ga.scaleX=s,ga.scaleY=r,ga}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 r=e?Ya(this,e):this.worldTransform,i=s?t:{};return Ba(t,r,i),i}worldToLocal(t,e,s,r){this.parent?this.parent.worldToInner(t,e,s,r):e&&va(e,t)}localToWorld(t,e,s,r){this.parent?this.parent.innerToWorld(t,e,s,r):e&&va(e,t)}worldToInner(t,e,s,r){r&&(r.innerToWorld(t,e,s),t=e||t),xa(this.worldTransform,t,e,s)}innerToWorld(t,e,s,r){wa(this.worldTransform,t,e,s),r&&r.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,r){return this.getBoxPointByInner(this.getInnerPoint(t,e,s,r),null,null,!0)}getBoxPointByInner(t,e,s,r){const i=r?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return ka(i,-n,-o),i}getInnerPoint(t,e,s,r){const i=r?t:{};return this.worldToInner(t,i,s,e),i}getInnerPointByBox(t,e,s,r){const i=r?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return ka(i,n,o),i}getInnerPointByLocal(t,e,s,r){return this.getInnerPoint(t,this.parent,s,r)}getLocalPoint(t,e,s,r){const i=r?t:{};return this.worldToLocal(t,i,s,e),i}getLocalPointByInner(t,e,s,r){return this.getWorldPoint(t,this.parent,s,r)}getPagePoint(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,r)}getWorldPoint(t,e,s,r){const i=r?t:{};return this.innerToWorld(t,i,s,e),i}getWorldPointByBox(t,e,s,r){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,r),e,s,!0)}getWorldPointByLocal(t,e,s,r){const i=r?t:{};return this.localToWorld(t,i,s,e),i}getWorldPointByPage(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,r)}setTransform(t,e,s){Aa(this,t,e,s)}transform(t,e,s){Ia(this,t,e,s)}move(t,e,s){Ca(this,t,e,s)}moveInner(t,e,s){Sa(this,t,e,!0,s)}scaleOf(t,e,s,r,i){Oa(this,Na(this,t),e,s,r,i)}rotateOf(t,e,s){Pa(this,Na(this,t),e,s)}skewOf(t,e,s,r,i){Ta(this,Na(this,t),e,s,r,i)}transformWorld(t,e,s){Ma(this,t,e,s)}moveWorld(t,e,s){Sa(this,t,e,!1,s)}scaleOfWorld(t,e,s,r,i){Ra(this,t,e,s,r,i)}rotateOfWorld(t,e){La(this,t,e)}skewOfWorld(t,e,s,r,i){Ea(this,t,e,s,r,i)}flip(t,e){Ia(this,Wa(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 Ut.need("path")}getMotionPoint(t){return Ut.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){Xa(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,r){}off_(t){}once(t,e,s,r){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,s){s?this.addAttr(t,e,s):wn(this.prototype,t,e)}static addAttr(t,e,s,r){s||(s=$i),s(e,r)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new go(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(go.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};Da=Kt([Pn(Zo),Pn(ia),Pn(ua),Pn(Qo),Pn(_a)],Da);const{setListWithFn:za}=Tt,{sort:Fa}=Kn,{localBoxBounds:ja,localStrokeBounds:Ua,localRenderBounds:Ha,maskLocalBoxBounds:Ga,maskLocalStrokeBounds:Va,maskLocalRenderBounds:qa}=Qn,Qa=new Nt("Branch");let Ja=class extends Da{__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){za(e||this.__layout.boxBounds,this.children,this.__hasMask?Ga:ja)}__updateStrokeBounds(t){za(t||this.__layout.strokeBounds,this.children,this.__hasMask?Va:Ua)}__updateRenderBounds(t){za(t||this.__layout.renderBounds,this.children,this.__hasMask?qa:Ha)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,r=e.length;s<r;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(Fa),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return Qa.warn("add self or destroyed");const s=n(e);if(!t.__){if(u(t))return t.forEach(t=>{this.add(t,e),s||e++});t=Vt.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,s?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(go.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(go.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)):n(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(go.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(go.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new go(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}};Ja=Kt([Pn(fa)],Ja);class Za{get length(){return this.list.length}constructor(t){this.reset(),t&&(u(t)?this.addList(t):this.add(t))}has(t){return t&&!n(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return n(e)?-1:e}add(t){const{list:e,keys:s}=this;n(s[t.innerId])&&(e.push(t),s[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:s}=this;if(n(s[t.innerId])){const{list:r}=this;for(let t=e,i=r.length;t<i;t++)s[r[t].innerId]++;0===e?r.unshift(t):(e>r.length&&(e=r.length),r.splice(e,0,t)),s[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let s;for(let r=0,i=e.length;r<i;r++)n(s)?e[r].innerId===t.innerId&&(s=r,delete this.keys[t.innerId]):this.keys[e[r].innerId]=r-1;n(s)||e.splice(s,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 Za;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,r=t.length;s<r;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class $a{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(u(t)?this.addList(t):this.add(t))}has(t){return!n(this.keys[t.innerId])}without(t){return n(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,r=e.length;s<r;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const Ka="1.9.2";export{ct as AlignHelper,r as Answer,ht as AroundHelper,Mt as AutoBounds,Fe as BezierHelper,Et as Bounds,bo as BoundsEvent,Tt as BoundsHelper,Ja as Branch,Kn as BranchHelper,fa as BranchRender,$t as CanvasManager,go as ChildEvent,Ht as Creator,g as DataHelper,Nt as Debug,nt as Direction4,ot as Direction9,Ze as EllipseHelper,fo as Event,Jt as EventCreator,Yo as Eventer,Ci as FileHelper,wo as ImageEvent,Ii as ImageManager,e as IncrementId,So as LayoutEvent,Da as Leaf,ua as LeafBounds,Qn as LeafBoundsHelper,m as LeafData,Zo as LeafDataProxy,Qo as LeafEventer,zn as LeafHelper,po as LeafLayout,$a as LeafLevelList,Za as LeafList,ia as LeafMatrix,_a as LeafRender,_e as LeaferCanvasBase,Lo as LeaferEvent,Xi as LeaferImage,B as MathHelper,et as Matrix,N as MatrixHelper,me as NeedConvertToCanvasCommandMap,k as OneRadian,C as PI2,O as PI_2,pi as PathBounds,ir as PathCommandDataHelper,ge as PathCommandMap,As as PathConvert,bi as PathCorner,br as PathCreator,Wr as PathDrawer,pe as PathHelper,Be as PathNumberCommandLengthMap,be as PathNumberCommandMap,t as Platform,Ut as Plugin,K as Point,q as PointHelper,mo as PropertyEvent,ve as RectHelper,Ro as RenderEvent,Po as ResizeEvent,Li as Resource,zt as Run,At as StringNumberMap,Ti as TaskItem,Si as TaskProcessor,rt as TwoPointBoundsHelper,Vt as UICreator,ro as WaitHelper,To as WatchEvent,an as affectRenderBoundsType,rn as affectStrokeBoundsType,Ui as attr,Qi as autoLayoutType,$i as boundsType,ki as canvasPatch,ue as canvasSizeAttrs,Fi as createDescriptor,yn as cursorType,mn as dataProcessor,Gi as dataType,ji as decorateLeafAttr,wn as defineDataProcessor,Di as defineKey,Hi as defineLeafAttr,tn as doBoundsType,nn as doStrokeType,i as emptyData,fn as eraserType,xo as extraPropertyEventMap,T as getBoundsData,zi as getDescriptor,S as getMatrixData,P as getPointData,gn as hitType,u as isArray,p as isData,f as isEmptyData,h as isFinite,o as isNull,l as isNumber,_ as isObject,a as isString,n as isUndefined,xn as layoutProcessor,Wo as leaferTransformAttrMap,pn as maskType,Ki as naturalBoundsType,ln as opacityType,en as pathInputType,sn as pathType,Bi as pen,Vi as positionType,Tn as registerUI,Sn as registerUIEvent,kn as rewrite,Cn as rewriteAble,Zi as rotationType,Ji as scaleType,qi as scrollType,_n as sortType,on as strokeType,hn as surfaceType,It as tempBounds,st as tempMatrix,tt as tempPoint,c as tryToNumber,Pn as useModule,Ka as version,dn as visibleType};
|
|
1
|
+
const t={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",getRealURL(e){const{prefix:s,suffix:r}=t.image;return!r||e.startsWith("data:")||e.startsWith("blob:")||(e+=(e.includes("?")?"&":"?")+r),s&&"/"===e[0]&&(e=s+e),e}}},e={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=s;return e[t]?e[t]++:(e[t]=1,0)}},s=e;var r;!function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(r||(r={}));const i={};function n(t){return void 0===t}function o(t){return null==t}function a(t){return"string"==typeof t}const{isFinite:h}=Number;function l(t){return"number"==typeof t}const d=/^-?\d+(?:\.\d+)?$/;function u(t){return"string"==typeof t&&d.test(t)?+t:t}const{isArray:c}=Array;function _(t){return t&&"object"==typeof t}function p(t){return _(t)&&!c(t)}function f(t){return"{}"===JSON.stringify(t)}const g={default:(t,e)=>(y(e,t),y(t,e),t),assign(t,e,s){let r;Object.keys(e).forEach(i=>{var n,o;if(r=e[i],(null==r?void 0:r.constructor)===Object&&(null===(n=t[i])||void 0===n?void 0:n.constructor)===Object)return y(t[i],e[i],s&&s[i]);s&&i in s?(null===(o=s[i])||void 0===o?void 0:o.constructor)===Object&&y(t[i]={},e[i],s[i]):t[i]=e[i]})},copyAttrs:(t,e,s)=>(s.forEach(s=>{n(e[s])||(t[s]=e[s])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,r=t.length;s<r;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:y}=g;class m{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}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(!n(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let s;for(let r in this)"_"!==r[0]&&(s=e?e[r]:void 0,t[r]=n(s)?this[r]:s);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!n(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!n(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const s={};if(t)if(c(t))for(let e of t)s[e]=this.__getInput(e);else for(let e in t)s[e]=this.__getInput(e);else{let t,e,{__input:r}=this;s.tag=this.__leaf.tag;for(let i in this)if("_"!==i[0]&&(t=this["_"+i],!n(t))){if("path"===i&&!this.__pathInputed)continue;e=r?r[i]:void 0,s[i]=n(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:r,d:i,e:n,f:o}=this.__leaf.__localMatrix;s.matrix={a:t,b:e,c:r,d:i,e:n,f:o}}return s}__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{round:x,pow:w,PI:b}=Math,B={within:(t,e,s)=>(_(e)&&(s=e.max,e=e.min),!n(e)&&t<e&&(t=e),!n(s)&&t>s&&(t=s),t),fourNumber(t,e){let s;if(c(t))switch(t.length){case 4:s=n(e)?t:[...t];break;case 2:s=[t[0],t[1],t[0],t[1]];break;case 3:s=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(s||(s=[t,t,t,t]),e)for(let t=0;t<4;t++)s[t]>e&&(s[t]=e);return s},formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),B.float(t)),getGapRotation(t,e,s=0){let r=t+s;if(e>1){const t=Math.abs(r%e);(t<1||t>e-1)&&(r=Math.round(r/e)*e)}return r-s},float(t,e){const s=n(e)?1e12:w(10,e);return-0===(t=x(t*s)/s)?0:t},getScaleData(t,e,s,r){if(r||(r={}),e){const t=(l(e)?e:e.width||0)/s.width,i=(l(e)?e:e.height||0)/s.height;r.scaleX=t||i||1,r.scaleY=i||t||1}else t&&B.assignScale(r,t);return r},assignScale(t,e){l(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},randInt:v,randColor:t=>`rgba(${v(255)},${v(255)},${v(255)},${t||1})`};function v(t){return Math.round(Math.random()*t)}const k=b/180,C=2*b,O=b/2;function P(){return{x:0,y:0}}function T(){return{x:0,y:0,width:0,height:0}}function S(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:R,cos:L,acos:E,sqrt:I}=Math,{float:M}=B,A={};function W(){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 N={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:W(),tempMatrix:{},set(t,e=1,s=0,r=0,i=1,n=0,o=0){t.a=e,t.b=s,t.c=r,t.d=i,t.e=n,t.f=o},get:S,getWorld:W,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,r){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,r&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},scaleOfOuter(t,e,s,r){Y.toInnerPoint(t,e,A),Y.scaleOfInner(t,A,s,r)},scaleOfInner(t,e,s,r=s){Y.translateInner(t,e.x,e.y),Y.scale(t,s,r),Y.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:r,c:i,d:n}=t,o=L(e*=k),a=R(e);t.a=s*o-r*a,t.b=s*a+r*o,t.c=i*o-n*a,t.d=i*a+n*o},rotateOfOuter(t,e,s){Y.toInnerPoint(t,e,A),Y.rotateOfInner(t,A,s)},rotateOfInner(t,e,s){Y.translateInner(t,e.x,e.y),Y.rotate(t,s),Y.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:r,b:i,c:n,d:o}=t;s&&(s*=k,t.a=r+n*s,t.b=i+o*s),e&&(e*=k,t.c=n+r*e,t.d=o+i*e)},skewOfOuter(t,e,s,r){Y.toInnerPoint(t,e,A),Y.skewOfInner(t,A,s,r)},skewOfInner(t,e,s,r=0){Y.translateInner(t,e.x,e.y),Y.skew(t,s,r),Y.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:r,c:i,d:n,e:o,f:a}=t;t.a=e.a*s+e.b*i,t.b=e.a*r+e.b*n,t.c=e.c*s+e.d*i,t.d=e.c*r+e.d*n,t.e=e.e*s+e.f*i+o,t.f=e.e*r+e.f*n+a},multiplyParent(t,e,s,r,i){const{e:o,f:a}=t;if(s||(s=t),n(r)&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:r,b:n,c:o,d:a}=t;s.a=r*e.a+n*e.c,s.b=r*e.b+n*e.d,s.c=o*e.a+a*e.c,s.d=o*e.b+a*e.d,i&&(s.scaleX=e.scaleX*i.scaleX,s.scaleY=e.scaleY*i.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,i&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=o*e.a+a*e.c+e.e,s.f=o*e.b+a*e.d+e.f},divide(t,e){Y.multiply(t,Y.tempInvert(e))},divideParent(t,e){Y.multiplyParent(t,Y.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=Y;return Y.copy(e,t),Y.invert(e),e},invert(t){const{a:e,b:s,c:r,d:i,e:n,f:o}=t;if(s||r){const a=1/(e*i-s*r);t.a=i*a,t.b=-s*a,t.c=-r*a,t.d=e*a,t.e=-(n*i-o*r)*a,t.f=-(o*e-n*s)*a}else if(1===e&&1===i)t.e=-n,t.f=-o;else{const s=1/(e*i);t.a=i*s,t.d=e*s,t.e=-n*i*s,t.f=-o*e*s}},toOuterPoint(t,e,s,r){const{x:i,y:n}=e;s||(s=e),s.x=i*t.a+n*t.c,s.y=i*t.b+n*t.d,r||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,r){const{a:i,b:n,c:o,d:a}=t,h=1/(i*a-n*o),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*o)*h,s.y=(d*i-l*n)*h,!r){const{e:e,f:r}=t;s.x-=(e*a-r*o)*h,s.y-=(r*i-e*n)*h}},setLayout(t,e,s,r,i){const{x:o,y:a,scaleX:h,scaleY:l}=e;if(n(i)&&(i=e.rotation||e.skewX||e.skewY),i){const{rotation:s,skewX:r,skewY:i}=e,n=s*k,o=L(n),a=R(n);if(r||i){const e=r*k,s=i*k;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,(s=s||r)&&Y.translateInner(t,-s.x,-s.y,!r)},getLayout(t,e,s,r){const{a:i,b:n,c:o,d:a,e:h,f:l}=t;let d,u,c,_,p,f=h,g=l;if(n||o){const t=i*a-n*o;if(o&&!r){d=I(i*i+n*n),u=t/d;const e=i/d;c=n>0?E(e):-E(e)}else{u=I(o*o+a*a),d=t/u;const e=o/u;c=O-(a>0?E(-e):-E(e))}const e=M(L(c)),s=R(c);d=M(d),u=M(u),_=e?M((o/u+s)/e/k,9):0,p=e?M((n/d-s)/e/k,9):0,c=M(c/k)}else d=i,u=a,c=_=p=0;return(e=s||e)&&(f+=e.x*i+e.y*o,g+=e.x*n+e.y*a,s||(f-=e.x,g-=e.y)),{x:f,y:g,scaleX:d,scaleY:u,rotation:c,skewX:_,skewY:p}},withScale(t,e,s=e){const r=t;if(!e||!s){const{a:r,b:i,c:n,d:o}=t;i||n?s=(r*o-i*n)/(e=I(r*r+i*i)):(e=r,s=o)}return r.scaleX=e,r.scaleY=s,r},reset(t){Y.set(t)}},Y=N,{toInnerPoint:X,toOuterPoint:D}=N,{sin:z,cos:F,abs:j,sqrt:U,atan2:H,min:G,round:V}=Math,q={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,s){t.radiusX=e,t.radiusY=n(s)?e:s},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?V(t.x-.5)+.5:V(t.x),t.y=e?V(t.y-.5)+.5:V(t.y)},move(t,e,s){_(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,r=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(r-1)},rotate(t,e,s){s||(s=Q.defaultPoint);const r=F(e*=k),i=z(e),n=t.x-s.x,o=t.y-s.y;t.x=s.x+n*r-o*i,t.y=s.y+n*i+o*r},tempToInnerOf(t,e){const{tempPoint:s}=Q;return Z(s,t),X(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=Q;return Z(s,t),D(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=Q;return Z(s,t),Q.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),X(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){X(e,t,s)},toOuterOf(t,e,s){D(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)=>J(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,r){const i=j(s-t),n=j(r-e);return U(i*i+n*n)},getMinDistanceFrom:(t,e,s,r,i,n)=>G(J(t,e,s,r),J(s,r,i,n)),getAngle:(t,e)=>$(t,e)/k,getRotation:(t,e,s,r)=>(r||(r=e),Q.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,r.x,r.y)/k),getRadianFrom(t,e,s,r,i,o,a,h){n(a)&&(a=s,h=r);const l=t-s,d=e-r,u=i-a,c=o-h;return Math.atan2(l*c-d*u,l*u+d*c)},getAtan2:(t,e)=>H(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,r){const i=$(t,e);return(e=r?e:{}).x=t.x+F(i)*s,e.y=t.y+z(i)*s,e},toNumberPoints(t){let e=t;return _(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},reset(t){Q.reset(t)}},Q=q,{getDistanceFrom:J,copy:Z,getAtan2:$}=Q;class K{constructor(t,e){this.set(t,e)}set(t,e){return _(t)?q.copy(this,t):q.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new K(this)}move(t,e){return q.move(this,t,e),this}scale(t,e){return q.scale(this,t,e),this}scaleOf(t,e,s){return q.scaleOf(this,t,e,s),this}rotate(t,e){return q.rotate(this,t,e),this}rotateOf(t,e){return q.rotate(this,e,t),this}getRotation(t,e,s){return q.getRotation(this,t,e,s)}toInnerOf(t,e){return q.toInnerOf(this,t,e),this}toOuterOf(t,e){return q.toOuterOf(this,t,e),this}getCenter(t){return new K(q.getCenter(this,t))}getDistance(t){return q.getDistance(this,t)}getDistancePoint(t,e,s){return new K(q.getDistancePoint(this,t,e,s))}getAngle(t){return q.getAngle(this,t)}getAtan2(t){return q.getAtan2(this,t)}reset(){return q.reset(this),this}}const tt=new K;class et{constructor(t,e,s,r,i,n){this.set(t,e,s,r,i,n)}set(t,e,s,r,i,n){return _(t)?N.copy(this,t):N.set(this,t,e,s,r,i,n),this}setWith(t){return N.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:s,d:r,e:i,f:n}=this;return{a:t,b:e,c:s,d:r,e:i,f:n}}clone(){return new et(this)}translate(t,e){return N.translate(this,t,e),this}translateInner(t,e){return N.translateInner(this,t,e),this}scale(t,e){return N.scale(this,t,e),this}scaleWith(t,e){return N.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}scaleOfOuter(t,e,s){return N.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return N.scaleOfInner(this,t,e,s),this}rotate(t){return N.rotate(this,t),this}rotateOfOuter(t,e){return N.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return N.rotateOfInner(this,t,e),this}skew(t,e){return N.skew(this,t,e),this}skewOfOuter(t,e,s){return N.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return N.skewOfInner(this,t,e,s),this}multiply(t){return N.multiply(this,t),this}multiplyParent(t){return N.multiplyParent(this,t),this}divide(t){return N.divide(this,t),this}divideParent(t){return N.divideParent(this,t),this}invert(){return N.invert(this),this}invertWith(){return N.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){N.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){N.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return N.setLayout(this,t,e,s),this}getLayout(t,e,s){return N.getLayout(this,t,e,s)}withScale(t,e){return N.withScale(this,t,e)}reset(){N.reset(this)}}const st=new et,rt={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,r,i){it(t,e,s),it(t,e+r,s+i)},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:it}=rt;var nt,ot;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(nt||(nt={})),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"}(ot||(ot={}));const at=[{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}];at.forEach(t=>t.type="percent");const ht={directionData:at,tempPoint:{},get:lt,toPoint(t,e,s,r,i,n){const o=lt(t);s.x=o.x,s.y=o.y,"percent"===o.type&&(s.x*=e.width,s.y*=e.height,i&&(n||(s.x-=i.x,s.y-=i.y),o.x&&(s.x-=1===o.x?i.width:.5===o.x?o.x*i.width:0),o.y&&(s.y-=1===o.y?i.height:.5===o.y?o.y*i.height:0))),r||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s)=>(s||(s={}),ht.toPoint(t,e,s,!0),s)};function lt(t){return a(t)?at[ot[t]]:t}const{toPoint:dt}=ht,ut={toPoint(t,e,s,r,i,n){dt(t,s,r,i,e,n)}},{tempPointBounds:ct,setPoint:_t,addPoint:pt,toBounds:ft}=rt,{toOuterPoint:gt}=N,{float:yt,fourNumber:mt}=B,{floor:xt,ceil:wt}=Math;let bt,Bt,vt,kt;const Ct={},Ot={},Pt={},Tt={tempBounds:Pt,set(t,e=0,s=0,r=0,i=0){t.x=e,t.y=s,t.width=r,t.height=i},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,r,i){const{x:n,y:o,width:a,height:h}=e;if(c(s)){const e=mt(s);r?St.set(t,n+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):St.set(t,n-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else r&&(s=-s),St.set(t,n-s,o-s,a+2*s,h+2*s);i&&("width"===i?(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),St.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Lt(e,t):e=t,s?(e.offsetX=-(St.maxX(s)-t.x),e.offsetY=-(St.maxY(s)-t.y)):(e.offsetX=t.x+t.width,e.offsetY=t.y+t.height),St.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,r){r||q.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,r=s){q.scaleOf(t,e,s,r),t.width*=s,t.height*=r},tempToOuterOf:(t,e)=>(St.copy(Pt,t),St.toOuterOf(Pt,e),Pt),getOuterOf:(t,e)=>(t=Object.assign({},t),St.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:r,d:i}=e;r>0?(s.width=t.width*r,s.x=e.e+t.x*r):(s.width=t.width*-r,s.x=e.e+t.x*r-s.width),i>0?(s.height=t.height*i,s.y=e.f+t.y*i):(s.height=t.height*-i,s.y=e.f+t.y*i-s.height)}else Ct.x=t.x,Ct.y=t.y,gt(e,Ct,Ot),_t(ct,Ot.x,Ot.y),Ct.x=t.x+t.width,gt(e,Ct,Ot),pt(ct,Ot.x,Ot.y),Ct.y=t.y+t.height,gt(e,Ct,Ot),pt(ct,Ot.x,Ot.y),Ct.x=t.x,gt(e,Ct,Ot),pt(ct,Ot.x,Ot.y),ft(ct,s)},toInnerOf(t,e,s){s||(s=t),St.move(s,-e.e,-e.f),St.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const r=Math.min(s,St.getFitScale(t,e));return new et(r,0,0,r,-e.x*r,-e.y*r)},getFitScale(t,e,s){const r=t.width/e.width,i=t.height/e.height;return s?Math.max(r,i):Math.min(r,i)},put(t,e,s="center",r=1,i=!0,n){n||(n=e),a(r)&&(r=St.getFitScale(t,e,"cover"===r)),Pt.width=i?e.width*=r:e.width*r,Pt.height=i?e.height*=r:e.height*r,ut.toPoint(s,Pt,t,n,!0,!0)},getSpread(t,e,s){const r={};return St.copyAndSpread(r,t,e,!1,s),r},spread(t,e,s){St.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){St.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=xt(t.x),t.y=xt(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=yt(t.x,e),t.y=yt(t.y,e),t.width=yt(t.width,e),t.height=yt(t.height,e)},add(t,e,s){bt=t.x+t.width,Bt=t.y+t.height,vt=e.x,kt=e.y,s||(vt+=e.width,kt+=e.height),bt=bt>vt?bt:vt,Bt=Bt>kt?Bt:kt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=bt-t.x,t.height=Bt-t.y},addList(t,e){St.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){St.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){St.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,r=!1){let i,n=!0;for(let o=0,a=e.length;o<a;o++)i=s?s(e[o],o):e[o],i&&(i.width||i.height)&&(n?(n=!1,r||Lt(t,i)):Rt(t,i));n&&St.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?_t(ct,t.x,t.y):pt(ct,t.x,t.y)),ft(ct,t)},setPoint(t,e){St.set(t,e.x,e.y)},addPoint(t,e){Rt(t,e,!0)},getPoints(t){const{x:e,y:s,width:r,height:i}=t;return[{x:e,y:s},{x:e+r,y:s},{x:e+r,y:s+i},{x:e,y:s+i}]},hitRadiusPoint:(t,e,s)=>(s&&(e=q.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=q.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=St.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=St.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=St.tempToOuterOf(e,s)),!St.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:r,y:i,width:n,height:o}=e;return bt=r+n,Bt=i+o,vt=t.x+t.width,kt=t.y+t.height,r=r>t.x?r:t.x,i=i>t.y?i:t.y,bt=bt<vt?bt:vt,Bt=Bt<kt?Bt:kt,n=bt-r,o=Bt-i,{x:r,y:i,width:n,height:o}},intersect(t,e,s){St.copy(t,St.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){St.set(t)}},St=Tt,{add:Rt,copy:Lt}=St;class Et{get minX(){return Tt.minX(this)}get minY(){return Tt.minY(this)}get maxX(){return Tt.maxX(this)}get maxY(){return Tt.maxY(this)}constructor(t,e,s,r){this.set(t,e,s,r)}set(t,e,s,r){return _(t)?Tt.copy(this,t):Tt.set(this,t,e,s,r),this}get(){const{x:t,y:e,width:s,height:r}=this;return{x:t,y:e,width:s,height:r}}clone(){return new Et(this)}move(t,e){return Tt.move(this,t,e),this}scale(t,e,s){return Tt.scale(this,t,e,s),this}scaleOf(t,e,s){return Tt.scaleOf(this,t,e,s),this}toOuterOf(t,e){return Tt.toOuterOf(this,t,e),this}toInnerOf(t,e){return Tt.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Tt.getFitMatrix(this,t,e)}put(t,e,s){Tt.put(this,t,e,s)}spread(t,e){return Tt.spread(this,t,e),this}shrink(t,e){return Tt.shrink(this,t,e),this}ceil(){return Tt.ceil(this),this}unsign(){return Tt.unsign(this),this}float(t){return Tt.float(this,t),this}add(t){return Tt.add(this,t),this}addList(t){return Tt.setList(this,t,!0),this}setList(t){return Tt.setList(this,t),this}addListWithFn(t,e){return Tt.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Tt.setListWithFn(this,t,e),this}setPoint(t){return Tt.setPoint(this,t),this}setPoints(t){return Tt.setPoints(this,t),this}addPoint(t){return Tt.addPoint(this,t),this}getPoints(){return Tt.getPoints(this)}hitPoint(t,e){return Tt.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Tt.hitRadiusPoint(this,t,e)}hit(t,e){return Tt.hit(this,t,e)}includes(t,e){return Tt.includes(this,t,e)}intersect(t,e){return Tt.intersect(this,t,e),this}getIntersect(t,e){return new Et(Tt.getIntersectData(this,t,e))}isSame(t){return Tt.isSame(this,t)}isEmpty(){return Tt.isEmpty(this)}reset(){Tt.reset(this)}}const It=new Et;class Mt{constructor(t,e,s,r,i,n){_(t)?this.copy(t):this.set(t,e,s,r,i,n)}set(t=0,e=0,s=0,r=0,i=0,n=0){this.top=t,this.right=e,this.bottom=s,this.left=r,this.width=i,this.height=n}copy(t){const{top:e,right:s,bottom:r,left:i,width:n,height:o}=t;this.set(e,s,r,i,n,o)}getBoundsFrom(t){const{top:e,right:s,bottom:r,left:i,width:n,height:o}=this;return new Et(i,e,n||t.width-i-s,o||t.height-e-r)}}const At={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:Wt}=B;class Nt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new Nt(t)}static set filter(t){this.filterList=Yt(t)}static set exclude(t){this.excludeList=Yt(t)}static drawRepaint(t,e){const s=Wt();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const r="hit"===Nt.showBounds,i=t.__nowWorld,n=Wt();r&&(e.setWorld(i),t.__drawHitPath(e),e.fillStyle=n.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(n,2),r?e.stroke():e.strokeWorld(i,n)}log(...t){if(Xt.enable){if(Xt.filterList.length&&Xt.filterList.every(t=>t!==this.name))return;if(Xt.excludeList.length&&Xt.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){Xt.enable&&this.warn(...t)}warn(...t){Xt.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 Yt(t){return t?a(t)&&(t=[t]):t=[],t}Nt.filterList=[],Nt.excludeList=[],Nt.showWarn=!0;const Xt=Nt,Dt=Nt.get("RunTime"),zt={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,s){const r=e.create(e.RUNTIME);return Ft.currentId=Ft.idMap[r]=s?performance.now():Date.now(),Ft.currentName=Ft.nameMap[r]=t,Ft.nameToIdMap[t]=r,r},end(t,e){const s=Ft.idMap[t],r=Ft.nameMap[t],i=e?(performance.now()-s)/1e3:Date.now()-s;Ft.idMap[t]=Ft.nameMap[t]=Ft.nameToIdMap[r]=void 0,Dt.log(r,i,"ms")},endOfName(t,e){const s=Ft.nameToIdMap[t];n(s)||Ft.end(s,e)}},Ft=zt,jt=[],Ut={list:{},add(t,...e){this.list[t]=!0,jt.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(()=>jt.forEach(t=>Ut.has(t,!0)));const Ht={editor:t=>Ut.need("editor")},Gt=Nt.get("UICreator"),Vt={list:{},register(t){const{__tag:e}=t.prototype;qt[e]&&Gt.repeat(e),qt[e]=t},get(t,e,s,r,i,o){qt[t]||Gt.error("not register "+t);const a=new qt[t](e);return n(s)||(a.x=s,r&&(a.y=r),i&&(a.width=i),o&&(a.height=o)),a}},{list:qt}=Vt,Qt=Nt.get("EventCreator"),Jt={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],a(e)&&(Zt[e]&&Qt.repeat(e),Zt[e]=t)})},changeName(t,e){const s=Zt[t];if(s){const r=Object.keys(s).find(e=>s[e]===t);r&&(s[r]=e,Zt[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new Zt[t](...e)},{nameList:Zt}=Jt;class $t{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:s}=this;for(let r=0,i=s.length;r<i;r++)if(e=s[r],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const r=Ht.canvas(t);return this.add(r),r}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,r=this.list.length;s<r;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 Kt(t,e,s,r){var i,n=arguments.length,o=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(o=(n<3?i(o):n>3?i(e,s,o):i(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o}function te(t,e,s,r){return new(s||(s=Promise))(function(i,n){function o(t){try{h(r.next(t))}catch(t){n(t)}}function a(t){try{h(r.throw(t))}catch(t){n(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(o,a)}h((r=r.apply(t,e||[])).next())})}function ee(t){return(e,s)=>{t||(t=s);const r={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===s&&(r.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,s,r)}}"function"==typeof SuppressedError&&SuppressedError;const se=[];function re(){return(t,e)=>{se.push(e)}}const ie=[];class ne{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||ie)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;se.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,r,i,n){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,r,i,n){_(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,r,i,n)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,r){}strokeRect(t,e,s,r){}clearRect(t,e,s,r){}drawImage(t,e,s,r,i,n,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/r*a;r+=e,e=0,n+=t,a-=t}if(s<0){const t=-s/i*h;i+=s,s=0,o+=t,h-=t}this.context.drawImage(t,e,s,r,i,n,o,a,h);break;case 5:this.context.drawImage(t,e,s,r,i);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,r,i,n){}quadraticCurveTo(t,e,s,r){}closePath(){}arc(t,e,s,r,i,n){}arcTo(t,e,s,r,i){}ellipse(t,e,s,r,i,n,o,a){}rect(t,e,s,r){}roundRect(t,e,s,r,i){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,r){}createPattern(t,e){}createRadialGradient(t,e,s,r,i,n){}fillText(t,e,s,r){}measureText(t){}strokeText(t,e,s,r){}destroy(){this.context=null}}Kt([ee("imageSmoothingEnabled")],ne.prototype,"smooth",void 0),Kt([ee("imageSmoothingQuality")],ne.prototype,"smoothLevel",void 0),Kt([ee("globalAlpha")],ne.prototype,"opacity",void 0),Kt([ee()],ne.prototype,"fillStyle",void 0),Kt([ee()],ne.prototype,"strokeStyle",void 0),Kt([ee("lineWidth")],ne.prototype,"strokeWidth",void 0),Kt([ee("lineCap")],ne.prototype,"strokeCap",void 0),Kt([ee("lineJoin")],ne.prototype,"strokeJoin",void 0),Kt([ee("lineDashOffset")],ne.prototype,"dashOffset",void 0),Kt([ee()],ne.prototype,"miterLimit",void 0),Kt([ee()],ne.prototype,"shadowBlur",void 0),Kt([ee()],ne.prototype,"shadowColor",void 0),Kt([ee()],ne.prototype,"shadowOffsetX",void 0),Kt([ee()],ne.prototype,"shadowOffsetY",void 0),Kt([ee()],ne.prototype,"filter",void 0),Kt([ee()],ne.prototype,"font",void 0),Kt([ee()],ne.prototype,"fontKerning",void 0),Kt([ee()],ne.prototype,"fontStretch",void 0),Kt([ee()],ne.prototype,"fontVariantCaps",void 0),Kt([ee()],ne.prototype,"textAlign",void 0),Kt([ee()],ne.prototype,"textBaseline",void 0),Kt([ee()],ne.prototype,"textRendering",void 0),Kt([ee()],ne.prototype,"wordSpacing",void 0),Kt([ee()],ne.prototype,"letterSpacing",void 0),Kt([ee()],ne.prototype,"direction",void 0),Kt([re()],ne.prototype,"setTransform",null),Kt([re()],ne.prototype,"resetTransform",null),Kt([re()],ne.prototype,"getTransform",null),Kt([re()],ne.prototype,"save",null),Kt([re()],ne.prototype,"restore",null),Kt([re()],ne.prototype,"translate",null),Kt([re()],ne.prototype,"scale",null),Kt([re()],ne.prototype,"rotate",null),Kt([re()],ne.prototype,"fill",null),Kt([re()],ne.prototype,"stroke",null),Kt([re()],ne.prototype,"clip",null),Kt([re()],ne.prototype,"fillRect",null),Kt([re()],ne.prototype,"strokeRect",null),Kt([re()],ne.prototype,"clearRect",null),Kt([re()],ne.prototype,"beginPath",null),Kt([re()],ne.prototype,"moveTo",null),Kt([re()],ne.prototype,"lineTo",null),Kt([re()],ne.prototype,"bezierCurveTo",null),Kt([re()],ne.prototype,"quadraticCurveTo",null),Kt([re()],ne.prototype,"closePath",null),Kt([re()],ne.prototype,"arc",null),Kt([re()],ne.prototype,"arcTo",null),Kt([re()],ne.prototype,"ellipse",null),Kt([re()],ne.prototype,"rect",null),Kt([re()],ne.prototype,"roundRect",null),Kt([re()],ne.prototype,"createConicGradient",null),Kt([re()],ne.prototype,"createLinearGradient",null),Kt([re()],ne.prototype,"createPattern",null),Kt([re()],ne.prototype,"createRadialGradient",null),Kt([re()],ne.prototype,"fillText",null),Kt([re()],ne.prototype,"measureText",null),Kt([re()],ne.prototype,"strokeText",null);const{copy:oe,multiplyParent:ae}=N,{round:he}=Math,le=new Et,de=new Et,ue={width:1,height:1,pixelRatio:1},ce=["width","height","pixelRatio"];class _e extends ne{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(s,r){super(),this.size={},this.worldTransform={},s||(s=ue),this.manager=r,this.innerId=e.create(e.CNAVAS);const{width:i,height:n,pixelRatio:o}=s;this.autoLayout=!i||!n,this.size.pixelRatio=o||t.devicePixelRatio,this.config=s,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 r=this.size;g.copyAttrs(r,t,ce),ce.forEach(t=>r[t]||(r[t]=1)),this.bounds=new Et(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,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s,pixelSnap:r}=this,i=this.worldTransform;e&&ae(t,e,i),i.a=t.a*s,i.b=t.b*s,i.c=t.c*s,i.d=t.d*s,i.e=t.e*s,i.f=t.f*s,r&&(t.half&&t.half*s%2?(i.e=he(i.e-.5)+.5,i.f=he(i.f-.5)+.5):(i.e=he(i.e),i.f=he(i.f))),this.setTransform(i.a,i.b,i.c,i.d,i.e,i.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,r){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,r)}setStrokeOptions(t,e){let{strokeCap:s,strokeJoin:r,dashPattern:i,dashOffset:o,miterLimit:a}=t;e&&(e.strokeCap&&(s=e.strokeCap),e.strokeJoin&&(r=e.strokeJoin),n(e.dashPattern)||(i=e.dashPattern),n(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=s,this.strokeJoin=r,this.dashPattern=i,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,r){const{pixelRatio:i}=this;this.shadowOffsetX=t*i,this.shadowOffsetY=e*i,this.shadowBlur=s*i,this.shadowColor=r||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,r,i=!0){r&&(this.blendMode=r),e?(this.setTempPixelBounds(e,i),s?(this.setTempPixelBounds2(s,i),s=de):s=le,this.drawImage(t.view,le.x,le.y,le.width,le.height,s.x,s.y,s.width,s.height)):this.drawImage(t.view,0,0),r&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,r,i=!0){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Tt.tempToOuterOf(s,e),r,i),this.restore()):(r&&(this.blendMode=r),this.setTempPixelBounds(e,i),this.drawImage(t.view,le.x,le.y,le.width,le.height,s.x,s.y,s.width,s.height),r&&(this.blendMode="source-over"))}copyWorldByReset(t,e,s,r,i,n=!0){this.resetTransform(),this.copyWorld(t,e,s,r,n),i||this.useWorldTransform()}useGrayscaleAlpha(t){let e,s;this.setTempPixelBounds(t,!0,!0);const{context:r}=this,i=r.getImageData(le.x,le.y,le.width,le.height),{data:n}=i;for(let t=0,r=n.length;t<r;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));r.putImageData(i,le.x,le.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,r){s&&(this.blendMode=s),this.fillStyle=e,this.setTempPixelBounds(t,r),this.fillRect(le.x,le.y,le.width,le.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s,r){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempPixelBounds(t,r),this.strokeRect(le.x,le.y,le.width,le.height),s&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(le.x,le.y,le.width,le.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(le.x,le.y,le.width,le.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,s){this.copyToPixelBounds(le,t,e,s)}setTempPixelBounds2(t,e,s){this.copyToPixelBounds(de,t,e,s)}copyToPixelBounds(t,e,s,r){t.set(e),r&&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:r}=this,i=this.manager?this.manager.get(s):Ht.canvas(Object.assign({},s));return i.save(),t&&(oe(i.worldTransform,this.worldTransform),i.useWorldTransform()),e&&(i.smooth=this.smooth),i.pixelSnap!==r&&(i.pixelSnap=r),i}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 pe={creator:{},parse(t,e){},convertToCanvasData(t,e){}},fe={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},ge=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},fe),ye={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},me={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},xe=Object.assign(Object.assign({},me),fe),we=ge,be={};for(let t in we)be[we[t]]=t;const Be={};for(let t in we)Be[we[t]]=ye[t];const ve={drawRoundRect(t,e,s,r,i,n){const o=B.fourNumber(n,Math.min(r/2,i/2)),a=e+r,h=s+i;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:ke,cos:Ce,atan2:Oe,ceil:Pe,abs:Te,PI:Se,sqrt:Re,pow:Le}=Math,{setPoint:Ee,addPoint:Ie}=rt,{set:Me,toNumberPoints:Ae}=q,{M:We,L:Ne,C:Ye,Q:Xe,Z:De}=ge,ze={},Fe={points(t,e,s,r){let i=Ae(e);if(t.push(We,i[0],i[1]),s&&i.length>5){let e,n,o,a,h,l,d,u,c,_,p,f,g,y=i.length;const m=!0===s?.5:s;r&&(i=[i[y-2],i[y-1],...i,i[0],i[1],i[2],i[3]],y=i.length);for(let s=2;s<y-2;s+=2)e=i[s-2],n=i[s-1],o=i[s],a=i[s+1],h=i[s+2],l=i[s+3],p=Re(Le(o-e,2)+Le(a-n,2)),f=Re(Le(h-o,2)+Le(l-a,2)),(p||f)&&(g=p+f,p=m*p/g,f=m*f/g,h-=e,l-=n,d=o-p*h,u=a-p*l,2===s?r||t.push(Xe,d,u,o,a):t.push(Ye,c,_,d,u,o,a),c=o+f*h,_=a+f*l);r||t.push(Xe,c,_,i[y-2],i[y-1])}else for(let e=2,s=i.length;e<s;e+=2)t.push(Ne,i[e],i[e+1]);r&&t.push(De)},rect(t,e,s,r,i){pe.creator.path=t,pe.creator.moveTo(e,s).lineTo(e+r,s).lineTo(e+r,s+i).lineTo(e,s+i).lineTo(e,s)},roundRect(t,e,s,r,i,n){pe.creator.path=[],ve.drawRoundRect(pe.creator,e,s,r,i,n),t.push(...pe.convertToCanvasData(pe.creator.path,!0))},arcTo(t,e,s,r,i,n,o,a,h,l,d){const u=r-e,c=i-s,_=n-r,p=o-i;let f=Oe(c,u),g=Oe(p,_),y=g-f;if(y<0&&(y+=C),y===Se||Te(u+c)<1e-12||Te(_+p)<1e-12)return t&&t.push(Ne,r,i),h&&(Ee(h,e,s),Ie(h,r,i)),d&&Me(d,e,s),void(l&&Me(l,r,i));const m=u*p-_*c<0,x=m?-1:1,w=a/Ce(y/2),b=r+w*Ce(f+y/2+O*x),B=i+w*ke(f+y/2+O*x);return f-=O*x,g-=O*x,He(t,b,B,a,a,0,f/k,g/k,m,h,l,d)},arc:(t,e,s,r,i,n,o,a,h,l)=>He(t,e,s,r,r,0,i,n,o,a,h,l),ellipse(t,e,s,r,i,n,o,a,h,l,d,u){const c=n*k,_=ke(c),p=Ce(c);let f=o*k,g=a*k;f>Se&&(f-=C),g<0&&(g+=C);let y=g-f;y<0?y+=C:y>C&&(y-=C),h&&(y-=C);const m=Pe(Te(y/O)),x=y/m,w=ke(x/4),b=8/3*w*w/ke(x/2);g=f+x;let B,v,P,T,S,R,L,E,I=Ce(f),M=ke(f),A=P=p*r*I-_*i*M,W=T=_*r*I+p*i*M,N=e+P,Y=s+T;t&&t.push(t.length?Ne:We,N,Y),l&&Ee(l,N,Y),u&&Me(u,N,Y);for(let n=0;n<m;n++)B=Ce(g),v=ke(g),P=p*r*B-_*i*v,T=_*r*B+p*i*v,S=e+A-b*(p*r*M+_*i*I),R=s+W-b*(_*r*M-p*i*I),L=e+P+b*(p*r*v+_*i*B),E=s+T+b*(_*r*v-p*i*B),t&&t.push(Ye,S,R,L,E,e+P,s+T),l&&Ue(e+A,s+W,S,R,L,E,e+P,s+T,l,!0),A=P,W=T,I=B,M=v,f=g,g+=x;d&&Me(d,e+P,s+T)},quadraticCurveTo(t,e,s,r,i,n,o){t.push(Ye,(e+2*r)/3,(s+2*i)/3,(n+2*r)/3,(o+2*i)/3,n,o)},toTwoPointBoundsByQuadraticCurve(t,e,s,r,i,n,o,a){Ue(t,e,(t+2*s)/3,(e+2*r)/3,(i+2*s)/3,(n+2*r)/3,i,n,o,a)},toTwoPointBounds(t,e,s,r,i,n,o,a,h,l){const d=[];let u,c,_,p,f,g,y,m,x=t,w=s,b=i,B=o;for(let t=0;t<2;++t)if(1==t&&(x=e,w=r,b=n,B=a),u=-3*x+9*w-9*b+3*B,c=6*x-12*w+6*b,_=3*w-3*x,Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;p=-_/c,0<p&&p<1&&d.push(p)}else y=c*c-4*_*u,m=Math.sqrt(y),y<0||(f=(-c+m)/(2*u),0<f&&f<1&&d.push(f),g=(-c-m)/(2*u),0<g&&g<1&&d.push(g));l?Ie(h,t,e):Ee(h,t,e),Ie(h,o,a);for(let l=0,u=d.length;l<u;l++)je(d[l],t,e,s,r,i,n,o,a,ze),Ie(h,ze.x,ze.y)},getPointAndSet(t,e,s,r,i,n,o,a,h,l){const d=1-t,u=d*d*d,c=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=u*e+c*r+_*n+p*a,l.y=u*s+c*i+_*o+p*h},getPoint(t,e,s,r,i,n,o,a,h){const l={};return je(t,e,s,r,i,n,o,a,h,l),l},getDerivative(t,e,s,r,i){const n=1-t;return 3*n*n*(s-e)+6*n*t*(r-s)+3*t*t*(i-r)}},{getPointAndSet:je,toTwoPointBounds:Ue,ellipse:He}=Fe,{sin:Ge,cos:Ve,sqrt:qe,atan2:Qe}=Math,{ellipse:Je}=Fe,Ze={ellipticalArc(e,s,r,i,n,o,a,h,l,d,u){const c=(l-s)/2,_=(d-r)/2,p=o*k,f=Ge(p),g=Ve(p),y=-g*c-f*_,m=-g*_+f*c,x=i*i,w=n*n,b=m*m,B=y*y,v=x*w-x*b-w*B;let O=0;if(v<0){const t=qe(1-v/(x*w));i*=t,n*=t}else O=(a===h?-1:1)*qe(v/(x*b+w*B));const P=O*i*m/n,T=-O*n*y/i,S=Qe((m-T)/n,(y-P)/i),R=Qe((-m-T)/n,(-y-P)/i);let L=R-S;0===h&&L>0?L-=C:1===h&&L<0&&(L+=C);const E=s+c+g*P-f*T,I=r+_+f*P+g*T,M=L<0?1:0;u||t.ellipseToCurve?Je(e,E,I,i,n,o,S/k,R/k,M):i!==n||o?e.push(ge.G,E,I,i,n,o,S/k,R/k,M):e.push(ge.O,E,I,i,S/k,R/k,M)}},{M:$e,m:Ke,L:ts,l:es,H:ss,h:rs,V:is,v:ns,C:os,c:as,S:hs,s:ls,Q:ds,q:us,T:cs,t:_s,A:ps,a:fs,Z:gs,z:ys,N:ms,D:xs,X:ws,G:bs,F:Bs,O:vs,P:ks,U:Cs}=ge,{rect:Os,roundRect:Ps,arcTo:Ts,arc:Ss,ellipse:Rs,quadraticCurveTo:Ls}=Fe,{ellipticalArc:Es}=Ze,Is=Nt.get("PathConvert"),Ms={},As={current:{dot:0},stringify(t,e){let s,r,i,n=0,o=t.length,a="";for(;n<o;){r=t[n],s=Be[r],a+=r===i?" ":be[r];for(let r=1;r<s;r++)a+=B.float(t[n+r],e),r===s-1||(a+=" ");i=r,n+=s}return a},parse(t,e){let s,r,i,n="";const o=[],a=e?xe:me;for(let e=0,h=t.length;e<h;e++)r=t[e],At[r]?("."===r&&(Ws.dot&&(Ns(o,n),n=""),Ws.dot++),"0"===n&&"."!==r&&(Ns(o,n),n=""),n+=r):ge[r]?(n&&(Ns(o,n),n=""),Ws.name=ge[r],Ws.length=ye[r],Ws.index=0,Ns(o,Ws.name),!s&&a[r]&&(s=!0)):"-"===r||"+"===r?"e"===i||"E"===i?n+=r:(n&&Ns(o,n),n=r):n&&(Ns(o,n),n=""),i=r;return n&&Ns(o,n),s?As.toCanvasData(o,e):o},toCanvasData(t,e){let s,r,i,n,o,a=0,h=0,l=0,d=0,u=0,c=t.length;const _=[];for(;u<c;){switch(i=t[u],i){case Ke:t[u+1]+=a,t[u+2]+=h;case $e:a=t[u+1],h=t[u+2],_.push($e,a,h),u+=3;break;case rs:t[u+1]+=a;case ss:a=t[u+1],_.push(ts,a,h),u+=2;break;case ns:t[u+1]+=h;case is:h=t[u+1],_.push(ts,a,h),u+=2;break;case es:t[u+1]+=a,t[u+2]+=h;case ts:a=t[u+1],h=t[u+2],_.push(ts,a,h),u+=3;break;case ls:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=hs;case hs:o=n===os||n===hs,l=o?2*a-s:t[u+1],d=o?2*h-r:t[u+2],s=t[u+1],r=t[u+2],a=t[u+3],h=t[u+4],_.push(os,l,d,s,r,a,h),u+=5;break;case as:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,t[u+5]+=a,t[u+6]+=h,i=os;case os:s=t[u+3],r=t[u+4],a=t[u+5],h=t[u+6],_.push(os,t[u+1],t[u+2],s,r,a,h),u+=7;break;case _s:t[u+1]+=a,t[u+2]+=h,i=cs;case cs:o=n===ds||n===cs,s=o?2*a-s:t[u+1],r=o?2*h-r:t[u+2],e?Ls(_,a,h,s,r,t[u+1],t[u+2]):_.push(ds,s,r,t[u+1],t[u+2]),a=t[u+1],h=t[u+2],u+=3;break;case us:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=ds;case ds:s=t[u+1],r=t[u+2],e?Ls(_,a,h,s,r,t[u+3],t[u+4]):_.push(ds,s,r,t[u+3],t[u+4]),a=t[u+3],h=t[u+4],u+=5;break;case fs:t[u+6]+=a,t[u+7]+=h;case ps:Es(_,a,h,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],e),a=t[u+6],h=t[u+7],u+=8;break;case ys:case gs:_.push(gs),u++;break;case ms:a=t[u+1],h=t[u+2],e?Os(_,a,h,t[u+3],t[u+4]):Ys(_,t,u,5),u+=5;break;case xs:a=t[u+1],h=t[u+2],e?Ps(_,a,h,t[u+3],t[u+4],[t[u+5],t[u+6],t[u+7],t[u+8]]):Ys(_,t,u,9),u+=9;break;case ws:a=t[u+1],h=t[u+2],e?Ps(_,a,h,t[u+3],t[u+4],t[u+5]):Ys(_,t,u,6),u+=6;break;case bs:Rs(e?_:Ys(_,t,u,9),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],t[u+8],null,Ms),a=Ms.x,h=Ms.y,u+=9;break;case Bs:e?Rs(_,t[u+1],t[u+2],t[u+3],t[u+4],0,0,360,!1):Ys(_,t,u,5),a=t[u+1]+t[u+3],h=t[u+2],u+=5;break;case vs:Ss(e?_:Ys(_,t,u,7),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],null,Ms),a=Ms.x,h=Ms.y,u+=7;break;case ks:e?Ss(_,t[u+1],t[u+2],t[u+3],0,360,!1):Ys(_,t,u,4),a=t[u+1]+t[u+3],h=t[u+2],u+=4;break;case Cs:Ts(e?_:Ys(_,t,u,6),a,h,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],null,Ms),a=Ms.x,h=Ms.y,u+=6;break;default:return Is.error(`command: ${i} [index:${u}]`,t),_}n=i}return _},objectToCanvasData(t){const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push($e,t.x,t.y);break;case"L":e.push(ts,t.x,t.y);break;case"C":e.push(os,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(ds,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(gs)}}),e},copyData(t,e,s,r){for(let i=s,n=s+r;i<n;i++)t.push(e[i])},pushData(t,e){Ws.index===Ws.length&&(Ws.index=1,t.push(Ws.name)),t.push(Number(e)),Ws.index++,Ws.dot=0}},{current:Ws,pushData:Ns,copyData:Ys}=As,{M:Xs,L:Ds,C:zs,Q:Fs,Z:js,N:Us,D:Hs,X:Gs,G:Vs,F:qs,O:Qs,P:Js,U:Zs}=ge,{getMinDistanceFrom:$s,getRadianFrom:Ks}=q,{tan:tr,min:er,abs:sr}=Math,rr={},ir={beginPath(t){t.length=0},moveTo(t,e,s){t.push(Xs,e,s)},lineTo(t,e,s){t.push(Ds,e,s)},bezierCurveTo(t,e,s,r,i,n,o){t.push(zs,e,s,r,i,n,o)},quadraticCurveTo(t,e,s,r,i){t.push(Fs,e,s,r,i)},closePath(t){t.push(js)},rect(t,e,s,r,i){t.push(Us,e,s,r,i)},roundRect(t,e,s,r,i,n){if(l(n))t.push(Gs,e,s,r,i,n);else{const o=B.fourNumber(n);o?t.push(Hs,e,s,r,i,...o):t.push(Us,e,s,r,i)}},ellipse(t,e,s,r,i,n,a,h,l){o(n)?t.push(qs,e,s,r,i):(o(a)&&(a=0),o(h)&&(h=360),t.push(Vs,e,s,r,i,n,a,h,l?1:0))},arc(t,e,s,r,i,n,a){o(i)?t.push(Js,e,s,r):(o(n)&&(n=360),t.push(Qs,e,s,r,i,n,a?1:0))},arcTo(t,e,s,r,i,o,a,h){if(!n(a)){const t=$s(a,h,e,s,r,i);o=er(o,er(t/2,t/2*sr(tr(Ks(a,h,e,s,r,i)/2))))}t.push(Zs,e,s,r,i,o)},drawEllipse(t,e,s,r,i,n,a,h,l){Fe.ellipse(null,e,s,r,i,o(n)?0:n,o(a)?0:a,o(h)?360:h,l,null,null,rr),t.push(Xs,rr.x,rr.y),nr(t,e,s,r,i,n,a,h,l)},drawArc(t,e,s,r,i,n,a){Fe.arc(null,e,s,r,o(i)?0:i,o(n)?360:n,a,null,null,rr),t.push(Xs,rr.x,rr.y),or(t,e,s,r,i,n,a)},drawPoints(t,e,s,r){Fe.points(t,e,s,r)}},{ellipse:nr,arc:or}=ir,{moveTo:ar,lineTo:hr,quadraticCurveTo:lr,bezierCurveTo:dr,closePath:ur,beginPath:cr,rect:_r,roundRect:pr,ellipse:fr,arc:gr,arcTo:yr,drawEllipse:mr,drawArc:xr,drawPoints:wr}=ir;class br{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?a(t)?pe.parse(t):t:[],this}beginPath(){return cr(this.__path),this.paint(),this}moveTo(t,e){return ar(this.__path,t,e),this.paint(),this}lineTo(t,e){return hr(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,r,i,n){return dr(this.__path,t,e,s,r,i,n),this.paint(),this}quadraticCurveTo(t,e,s,r){return lr(this.__path,t,e,s,r),this.paint(),this}closePath(){return ur(this.__path),this.paint(),this}rect(t,e,s,r){return _r(this.__path,t,e,s,r),this.paint(),this}roundRect(t,e,s,r,i){return pr(this.__path,t,e,s,r,i),this.paint(),this}ellipse(t,e,s,r,i,n,o,a){return fr(this.__path,t,e,s,r,i,n,o,a),this.paint(),this}arc(t,e,s,r,i,n){return gr(this.__path,t,e,s,r,i,n),this.paint(),this}arcTo(t,e,s,r,i){return yr(this.__path,t,e,s,r,i),this.paint(),this}drawEllipse(t,e,s,r,i,n,o,a){return mr(this.__path,t,e,s,r,i,n,o,a),this.paint(),this}drawArc(t,e,s,r,i,n){return xr(this.__path,t,e,s,r,i,n),this.paint(),this}drawPoints(t,e,s){return wr(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:Br,L:vr,C:kr,Q:Cr,Z:Or,N:Pr,D:Tr,X:Sr,G:Rr,F:Lr,O:Er,P:Ir,U:Mr}=ge,Ar=Nt.get("PathDrawer"),Wr={drawPathByData(t,e){if(!e)return;let s,r=0,i=e.length;for(;r<i;)switch(s=e[r],s){case Br:t.moveTo(e[r+1],e[r+2]),r+=3;break;case vr:t.lineTo(e[r+1],e[r+2]),r+=3;break;case kr:t.bezierCurveTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5],e[r+6]),r+=7;break;case Cr:t.quadraticCurveTo(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case Or:t.closePath(),r+=1;break;case Pr:t.rect(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case Tr:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],[e[r+5],e[r+6],e[r+7],e[r+8]]),r+=9;break;case Sr:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;case Rr:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]*k,e[r+6]*k,e[r+7]*k,e[r+8]),r+=9;break;case Lr:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],0,0,C,!1),r+=5;break;case Er:t.arc(e[r+1],e[r+2],e[r+3],e[r+4]*k,e[r+5]*k,e[r+6]),r+=7;break;case Ir:t.arc(e[r+1],e[r+2],e[r+3],0,C,!1),r+=4;break;case Mr:t.arcTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;default:return void Ar.error(`command: ${s} [index:${r}]`,e)}}},{M:Nr,L:Yr,C:Xr,Q:Dr,Z:zr,N:Fr,D:jr,X:Ur,G:Hr,F:Gr,O:Vr,P:qr,U:Qr}=ge,{toTwoPointBounds:Jr,toTwoPointBoundsByQuadraticCurve:Zr,arcTo:$r,arc:Kr,ellipse:ti}=Fe,{addPointBounds:ei,copy:si,addPoint:ri,setPoint:ii,addBounds:ni,toBounds:oi}=rt,ai=Nt.get("PathBounds");let hi,li,di;const ui={},ci={},_i={},pi={toBounds(t,e){pi.toTwoPointBounds(t,ci),oi(ci,e)},toTwoPointBounds(t,e){if(!t||!t.length)return ii(e,0,0);let s,r,i,n,o,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(o=t[a],0===a&&(o===zr||o===Xr||o===Dr?ii(e,h,l):ii(e,t[a+1],t[a+2])),o){case Nr:case Yr:h=t[a+1],l=t[a+2],ri(e,h,l),a+=3;break;case Xr:i=t[a+5],n=t[a+6],Jr(h,l,t[a+1],t[a+2],t[a+3],t[a+4],i,n,ui),ei(e,ui),h=i,l=n,a+=7;break;case Dr:s=t[a+1],r=t[a+2],i=t[a+3],n=t[a+4],Zr(h,l,s,r,i,n,ui),ei(e,ui),h=i,l=n,a+=5;break;case zr:a+=1;break;case Fr:h=t[a+1],l=t[a+2],ni(e,h,l,t[a+3],t[a+4]),a+=5;break;case jr:case Ur:h=t[a+1],l=t[a+2],ni(e,h,l,t[a+3],t[a+4]),a+=o===jr?9:6;break;case Hr:ti(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],ui,_i),0===a?si(e,ui):ei(e,ui),h=_i.x,l=_i.y,a+=9;break;case Gr:h=t[a+1],l=t[a+2],li=t[a+3],di=t[a+4],ni(e,h-li,l-di,2*li,2*di),h+=li,a+=5;break;case Vr:Kr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],ui,_i),0===a?si(e,ui):ei(e,ui),h=_i.x,l=_i.y,a+=7;break;case qr:h=t[a+1],l=t[a+2],hi=t[a+3],ni(e,h-hi,l-hi,2*hi,2*hi),h+=hi,a+=4;break;case Qr:$r(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],ui,_i),0===a?si(e,ui):ei(e,ui),h=_i.x,l=_i.y,a+=6;break;default:return void ai.error(`command: ${o} [index:${a}]`,t)}}},{M:fi,L:gi,Z:yi}=ge,{getCenterX:mi,getCenterY:xi}=q,{arcTo:wi}=ir,bi={smooth(t,e,s){let r,i,n,o=0,a=0,h=0,l=0,d=0,u=0,c=0,_=0,p=0;const f=t.length,g=[];for(;o<f;){switch(r=t[o],r){case fi:l=_=t[o+1],d=p=t[o+2],o+=3,t[o]===gi?(u=t[o+1],c=t[o+2],g.push(fi,mi(l,u),xi(d,c))):g.push(fi,l,d);break;case gi:switch(a=t[o+1],h=t[o+2],o+=3,t[o]){case gi:wi(g,a,h,t[o+1],t[o+2],e,_,p);break;case yi:wi(g,a,h,l,d,e,_,p);break;default:g.push(gi,a,h)}_=a,p=h;break;case yi:i!==yi&&(wi(g,l,d,u,c,e,_,p),g.push(yi)),o+=1;break;default:n=Be[r];for(let e=0;e<n;e++)g.push(t[o+e]);o+=n}i=r}return r!==yi&&(g[1]=l,g[2]=d),g}};pe.creator=new br,pe.parse=As.parse,pe.convertToCanvasData=As.toCanvasData;const Bi=new br,{drawRoundRect:vi}=ve;function ki(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,r,i){vi(this,t,e,s,r,i)})}(t)}const Ci={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=Oi.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{}}}},Oi=Ci;Oi.alphaPixelTypes.forEach(t=>Oi.upperCaseTypeMap[t]=t.toUpperCase());const Pi=Nt.get("TaskProcessor");class Ti{constructor(t){this.parallel=!0,this.time=1,this.id=e.create(e.TASK),this.task=t}run(){return te(this,void 0,void 0,function*(){try{this.task&&!this.isComplete&&this.parent.running&&(yield this.task())}catch(t){Pi.error(t)}})}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}}class Si{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 r=0;r<t;r++)r<=this.finishedIndex?(s+=this.list[r].time,r===this.finishedIndex&&(e=s)):e+=this.list[r].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&&g.assign(this.config,t),this.empty()}add(t,e){let s,r,i,o;const a=new Ti(t);return a.parent=this,l(e)?o=e:e&&(r=e.parallel,s=e.start,i=e.time,o=e.delay),i&&(a.time=i),!1===r&&(a.parallel=!1),n(o)?this.push(a,s):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(a,s))},o)),this.isComplete=!1,a}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++,this.nextTask()}).catch(t=>{this.onError(t)}):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;this.parallelList=[],this.parallelSuccessNumber=0;let e=this.index+this.config.parallel;e>this.list.length&&(e=this.list.length);for(let s=this.index;s<e&&(t=this.list[s],t.parallel);s++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const s=e.length,r=this.finishedIndex+s;if(e.length){if(!this.running)return;r<this.total&&(t=this.list[r],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 Ri=Nt.get("Resource"),Li={tasker:new Si,map:{},get isComplete(){return Ei.tasker.isComplete},set(t,e){Ei.map[t]&&Ri.repeat(t),Ei.map[t]=e},get:t=>Ei.map[t],remove(t){const e=Ei.map[t];e&&(e.destroy&&e.destroy(),delete Ei.map[t])},loadImage(t,e){return new Promise((s,r)=>{const i=this.setImage(t,t,e);i.load(()=>s(i),t=>r(t))})},setImage(t,e,s){let r;return a(e)?r={url:e}:e.url||(r={url:t,view:e}),r&&(s&&(r.format=s),e=Ht.image(r)),Ei.set(t,e),e},destroy(){Ei.map={}}},Ei=Li,Ii={maxRecycled:10,recycledList:[],patternTasker:new Si,get(t){let e=Li.get(t.url);return e||Li.set(t.url,e=Ht.image(t)),e.use++,e},recycle(t){t.use--,setTimeout(()=>{t.use||Mi.recycledList.push(t)})},clearRecycled(){const t=Mi.recycledList;t.length>Mi.maxRecycled&&(t.forEach(t=>!t.use&&t.url&&Li.remove(t.url)),t.length=0)},hasAlphaPixel:t=>Ci.alphaPixelTypes.some(e=>Mi.isFormat(e,t)),isFormat(t,e){if(e.format===t)return!0;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+Ci.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+Ci.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){Mi.recycledList=[]}},Mi=Ii,{IMAGE:Ai,create:Wi}=e,{floor:Ni,max:Yi}=Math;class Xi{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=Wi(Ai),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}Ii.isFormat("svg",t)&&(this.isSVG=!0),Ii.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(e,s){if(!this.loading){this.loading=!0;let{loadImage:e,loadImageWithProgress:s}=t.origin,r=this.config.showProgress&&s&&this.onProgress.bind(this);r&&(e=s),Li.tasker.add(()=>te(this,void 0,void 0,function*(){return yield e(this.url,r).then(t=>this.setView(t)).catch(t=>{this.error=t,this.onComplete(!1)})}))}return this.waitComplete.push(e,s),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)}onProgress(t){this.progress=t}onComplete(t){let e;this.waitComplete.forEach((s,r)=>{e=r%2,s&&(t?e||s(this):e&&s(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(e,s,r,i,n,o){if(e||(e=this.width),s||(s=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=t.origin.createCanvas(Yi(Ni(e+(n||0)),1),Yi(Ni(s+(o||0)),1)),h=a.getContext("2d");return r&&(h.globalAlpha=r),h.drawImage(this.view,0,0,e,s),this.cache=this.use>1?{data:a,params:arguments}:null,a}getPattern(e,s,r,i){const n=t.canvas.createPattern(e,s);try{r&&n.setTransform&&(n.setTransform(r),r=void 0)}catch(t){}return i&&g.stintSet(i,"transform",r),n}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}}function Di(t,e,s,r){r||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function zi(t,e){return Object.getOwnPropertyDescriptor(t,e)}function Fi(t,e){const s="_"+t;return{get(){const t=this[s];return n(t)?e:t},set(t){this[s]=t}}}function ji(t,e){return(s,r)=>Hi(s,r,t,e&&e(r))}function Ui(t){return t}function Hi(t,e,s,r){const i={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};Di(t,e,Object.assign(i,r||{})),wn(t,e,s)}function Gi(t){return ji(t)}function Vi(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function qi(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function Qi(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),tn(this))}}))}function Ji(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function Zi(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function $i(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s,e)&&tn(this)}}))}function Ki(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(tn(this),this.__.__removeNaturalSize())}}))}function tn(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function en(t){return ji(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),tn(this)}}))}const sn=$i;function rn(t,e){return ji(t,t=>({set(s){this.__setAttr(t,s)&&(nn(this),e&&(this.__.__useStroke=!0))}}))}function nn(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&tn(t)}const on=rn;function an(t){return ji(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function hn(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function ln(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&un(this)}}))}function dn(t){return ji(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>cn(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");cn(this,t,e,s),this.mask&&un(this)}}))}function un(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function cn(t,e,s,r){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==r&&0!==s||tn(t))}function _n(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange(),this.waitParent(()=>{this.parent.__layout.childrenSortChange()}))}}))}function pn(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function fn(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function gn(t){return ji(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===Nt.showBounds&&(this.__layout.surfaceChanged||this.__layout.surfaceChange()),this.leafer&&this.leafer.updateCursor())}}))}function yn(t){return ji(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function mn(t){return(e,s)=>{Di(e,"__DataProcessor",{get:()=>t})}}function xn(t){return(e,s)=>{Di(e,"__LayoutProcessor",{get:()=>t})}}function wn(t,e,s){const r=t.__DataProcessor.prototype,i="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=Fi(e,s);if(n(s))a.get=function(){return this[i]};else if("function"==typeof s)a.get=function(){let t=this[i];return void 0===t?s(this.__leaf):t};else if(_(s)){const t=f(s);a.get=function(){let e=this[i];return void 0===e?this[i]=t?{}:g.clone(s):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[i];if(void 0===t){const t=this,e=t.__naturalWidth,r=t.__leaf;return!s||r.pathInputed?r.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&r.children.length?r.boxBounds.width:s}return t}:"height"===e&&(a.get=function(){const t=this[i];if(void 0===t){const t=this,e=t.__naturalHeight,r=t.__leaf;return!s||r.pathInputed?r.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&r.children.length?r.boxBounds.height:s}return t});let l,d=r;for(;!l&&d;)l=zi(d,e),d=d.__proto__;l&&l.set&&(a.set=l.set),r[o]&&(a.set=r[o],delete r[o]),Di(r,e,a)}const bn=new Nt("rewrite"),Bn=[],vn=["destroy","constructor"];function kn(t){return(e,s)=>{Bn.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function Cn(){return t=>{On()}}function On(t){Bn.length&&(Bn.forEach(e=>{t&&bn.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),Bn.length=0)}function Pn(t,e){return s=>{var r;(t.prototype?(r=t.prototype,Object.getOwnPropertyNames(r)):Object.keys(t)).forEach(r=>{if(!(vn.includes(r)||e&&e.includes(r)))if(t.prototype){zi(t.prototype,r).writable&&(s.prototype[r]=t.prototype[r])}else s.prototype[r]=t[r]})}}function Tn(){return t=>{Vt.register(t)}}function Sn(){return t=>{Jt.register(t)}}setTimeout(()=>On(!0));const{copy:Rn,toInnerPoint:Ln,toOuterPoint:En,scaleOfOuter:In,rotateOfOuter:Mn,skewOfOuter:An,multiplyParent:Wn,divideParent:Nn,getLayout:Yn}=N,Xn={},{round:Dn}=Math,zn={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),Un(t,e,s),t.isBranch){const{children:r}=t;for(let t=0,i=r.length;t<i;t++)jn(r[t],e,s)}},updateMatrix(t,e,s){const r=t.__layout;e?s&&(r.waitAutoLayout=!0,t.__hasAutoLayout&&(r.matrixChanged=!1)):r.waitAutoLayout&&(r.waitAutoLayout=!1),r.matrixChanged&&t.__updateLocalMatrix(),r.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++)Hn(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&Hn(t),t.__updateChange()},updateAllChange(t){if(Vn(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Gn(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(e,s,r,i,n,o){i||(i=e.__nowWorld),e.__worldFlipped||t.fullImageShadow?s.copyWorldByReset(r,i,e.__nowWorld,n,o):s.copyWorldToInner(r,i,e.__layout.renderBounds,n)},moveWorld(t,e,s=0,r,i){const n=_(e)?Object.assign({},e):{x:e,y:s};r?En(t.localTransform,n,n,!0):t.parent&&Ln(t.parent.scrollWorldTransform,n,n,!0),Fn.moveLocal(t,n.x,n.y,i)},moveLocal(t,e,s=0,r){_(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=Dn(e),s=Dn(s)),r?t.animate({x:e,y:s},r):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,r,i,n){Fn.zoomOfLocal(t,qn(t,e),s,r,i,n)},zoomOfLocal(t,e,s,r=s,i,n){const o=t.__localMatrix;if(l(r)||(r&&(n=r),r=s),Rn(Xn,o),In(Xn,e,s,r),Fn.hasHighPosition(t))Fn.setTransform(t,Xn,i,n);else{const e=t.x+Xn.e-o.e,a=t.y+Xn.f-o.f;n&&!i?t.animate({x:e,y:a,scaleX:t.scaleX*s,scaleY:t.scaleY*r},n):(t.x=e,t.y=a,t.scaleResize(s,r,!0!==i))}},rotateOfWorld(t,e,s,r){Fn.rotateOfLocal(t,qn(t,e),s,r)},rotateOfLocal(t,e,s,r){const i=t.__localMatrix;Rn(Xn,i),Mn(Xn,e,s),Fn.hasHighPosition(t)?Fn.setTransform(t,Xn,!1,r):t.set({x:t.x+Xn.e-i.e,y:t.y+Xn.f-i.f,rotation:B.formatRotation(t.rotation+s)},r)},skewOfWorld(t,e,s,r,i,n){Fn.skewOfLocal(t,qn(t,e),s,r,i,n)},skewOfLocal(t,e,s,r=0,i,n){Rn(Xn,t.__localMatrix),An(Xn,e,s,r),Fn.setTransform(t,Xn,i,n)},transformWorld(t,e,s,r){Rn(Xn,t.worldTransform),Wn(Xn,e),t.parent&&Nn(Xn,t.parent.scrollWorldTransform),Fn.setTransform(t,Xn,s,r)},transform(t,e,s,r){Rn(Xn,t.localTransform),Wn(Xn,e),Fn.setTransform(t,Xn,s,r)},setTransform(t,e,s,r){const i=t.__,n=i.origin&&Fn.getInnerOrigin(t,i.origin),o=Yn(e,n,i.around&&Fn.getInnerOrigin(t,i.around));if(Fn.hasOffset(t)&&(o.x-=i.offsetX,o.y-=i.offsetY),s){const e=o.scaleX/t.scaleX,s=o.scaleY/t.scaleY;if(delete o.scaleX,delete o.scaleY,n){Tt.scale(t.boxBounds,Math.abs(e),Math.abs(s));const r=Fn.getInnerOrigin(t,i.origin);q.move(o,n.x-r.x,n.y-r.y)}t.set(o),t.scaleResize(e,s,!1)}else t.set(o,r)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},r="x"===e?1:-1;return In(s,Fn.getLocalOrigin(t,"center"),-1*r,1*r),s},getLocalOrigin:(t,e)=>q.tempToOuterOf(Fn.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return ht.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(Rn(Xn,t.worldTransform),Nn(Xn,e.scrollWorldTransform),s?Xn:Object.assign({},Xn)),drop(t,e,s,r){t.setTransform(Fn.getRelativeWorld(t,e,!0),r),e.add(t,s)},hasHighPosition:t=>t.origin||t.around||Fn.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(e,s,r=.3){if(s.x||s.y)if(Math.abs(s.x)<1&&Math.abs(s.y)<1)e.move(s);else{const i=s.x*r,n=s.y*r;s.x-=i,s.y-=n,e.move(i,n),t.requestRender(()=>Fn.animateMove(e,s,r))}}},Fn=zn,{updateAllMatrix:jn,updateMatrix:Un,updateAllWorldOpacity:Hn,updateAllChange:Gn,updateChange:Vn}=Fn;function qn(t,e){return t.parent?q.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const Qn={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)=>Zn(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>Zn(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds:(t,e)=>Zn(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 Jn;function Zn(t,e){return e||(Jn=0),t.__.mask&&(Jn=1),Jn<0?null:(Jn&&(Jn=-1),!0)}const{updateBounds:$n}=zn,Kn={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 r=0,i=s.length;r<i;r++)(t=s[r]).isBranch&&(t.__tempNumber=1,e.add(t),to(t,e))}},pushAllParent(t,e){const{keys:s}=e;if(s)for(;t.parent&&n(s[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:r}=t;for(let t=0,s=r.length;t<s;t++)r[t].isBranch&&e.push(r[t]);for(let t=s,r=e.length;t<r;t++)eo(e[t],e)},updateBounds(t,e){const s=[t];eo(t,s),so(s,e)},updateBoundsByBranchStack(t,e){let s,r;for(let i=t.length-1;i>-1;i--){s=t[i],r=s.children;for(let t=0,e=r.length;t<e;t++)$n(r[t]);e&&e===s||$n(s)}}},{pushAllChildBranch:to,pushAllBranchStack:eo,updateBoundsByBranchStack:so}=Kn,ro={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:io,updateBounds:no}=zn,{toOuterOf:oo,getPoints:ao,copy:ho}=Tt,lo="_localContentBounds",uo="_worldContentBounds",co="_worldBoxBounds",_o="_worldStrokeBounds";class po{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 oo(this.contentBounds,this.leaf.__localMatrix,this[lo]||(this[lo]={})),this[lo]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return oo(this.contentBounds,this.leaf.__world,this[uo]||(this[uo]={})),this[uo]}get worldBoxBounds(){return oo(this.boxBounds,this.leaf.__world,this[co]||(this[co]={})),this[co]}get worldStrokeBounds(){return oo(this.strokeBounds,this.leaf.__world,this[_o]||(this[_o]={})),this[_o]}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:e}=this,{leafer:s}=e;if(e.isApp)return no(e);if(s)s.ready?s.watcher.changed&&s.layouter.layout():s.start();else{let s=e;for(;s.parent&&!s.parent.leafer;)s=s.parent;const r=s;if(r.__fullLayouting)return;r.__fullLayouting=!0,t.layout(r),delete r.__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 N.defaultMatrix;case"page":t=e.zoomLayer;default:return io(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 Et(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:r}=this;let i,n,o,a=this.getInnerBounds(t);switch(e){case"world":i=r.getWorldPoint(a),n=r.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=r.__;o={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},i=r.getLocalPointByInner(a);break;case"inner":i=a,n=N.defaultMatrix;break;case"page":e=r.zoomLayer;default:i=r.getWorldPoint(a,e),n=io(r,e,!0)}if(o||(o=N.getLayout(n)),ho(o,a),q.copy(o,i),s){const{scaleX:t,scaleY:e}=o,s=Math.abs(t),r=Math.abs(e);1===s&&1===r||(o.scaleX/=s,o.scaleY/=r,o.width*=s,o.height*=r)}return o}getLayoutPoints(t,e="world"){const{leaf:s}=this,r=ao(this.getInnerBounds(t));let i;switch(e){case"world":i=null;break;case"local":i=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:i=e}return n(i)||r.forEach(t=>s.innerToWorld(t,null,!1,i)),r}shrinkContent(){const{x:t,y:e,width:s,height:r}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:r}}spreadStroke(){const{x:t,y:e,width:s,height:r}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:r},this._localStrokeBounds={x:t,y:e,width:s,height:r},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:r}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:r},this._localRenderBounds={x:t,y:e,width:s,height:r}}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.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.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 fo{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&t.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&t.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&t.event.stop(this.origin)}}class go extends fo{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}go.ADD="child.add",go.REMOVE="child.remove",go.CREATED="created",go.MOUNTED="mounted",go.UNMOUNTED="unmounted",go.DESTROY="destroy";const yo="property.scroll";class mo extends fo{constructor(t,e,s,r,i){super(t,e),this.attrName=s,this.oldValue=r,this.newValue=i}}mo.CHANGE="property.change",mo.LEAFER_CHANGE="property.leafer_change",mo.SCROLL=yo;const xo={scrollX:yo,scrollY:yo};class wo extends fo{constructor(t,e){super(t),Object.assign(this,e)}}wo.LOAD="image.load",wo.LOADED="image.loaded",wo.ERROR="image.error";class bo extends fo{static checkHas(t,e,s){"on"===s?e===Co?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Bo)||t.hasEvent(vo)||t.hasEvent(ko),t.__hasWorldEvent=t.hasEvent(Co))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Bo,t),"inner"===e&&t.emit(vo,t)),t.emit(ko,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Co,this)}}bo.RESIZE="bounds.resize",bo.INNER="bounds.inner",bo.LOCAL="bounds.local",bo.WORLD="bounds.world";const{RESIZE:Bo,INNER:vo,LOCAL:ko,WORLD:Co}=bo,Oo={};[Bo,vo,ko,Co].forEach(t=>Oo[t]=1);class Po extends fo{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){_(t)?(super(Po.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!n(this.resizingKeys[t.innerId])}}Po.RESIZE="resize";class To extends fo{constructor(t,e){super(t),this.data=e}}To.REQUEST="watch.request",To.DATA="watch.data";class So extends fo{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}So.REQUEST="layout.request",So.START="layout.start",So.BEFORE="layout.before",So.LAYOUT="layout",So.AFTER="layout.after",So.AGAIN="layout.again",So.END="layout.end";class Ro extends fo{constructor(t,e,s,r){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=r)}}Ro.REQUEST="render.request",Ro.CHILD_START="render.child_start",Ro.CHILD_END="render.child_end",Ro.START="render.start",Ro.BEFORE="render.before",Ro.RENDER="render",Ro.AFTER="render.after",Ro.AGAIN="render.again",Ro.END="render.end",Ro.NEXT="render.next";class Lo extends fo{}Lo.START="leafer.start",Lo.BEFORE_READY="leafer.before_ready",Lo.READY="leafer.ready",Lo.AFTER_READY="leafer.after_ready",Lo.VIEW_READY="leafer.view_ready",Lo.VIEW_COMPLETED="leafer.view_completed",Lo.STOP="leafer.stop",Lo.RESTART="leafer.restart",Lo.END="leafer.end",Lo.TRANSFORM="leafer.transform",Lo.MOVE="leafer.move",Lo.SCALE="leafer.scale",Lo.ROTATE="leafer.rotate",Lo.SKEW="leafer.skew";const{MOVE:Eo,SCALE:Io,ROTATE:Mo,SKEW:Ao}=Lo,Wo={x:Eo,y:Eo,scaleX:Io,scaleY:Io,rotation:Mo,skewX:Ao,skewY:Ao},No={};class Yo{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(c(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)c(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let r,i,n;s&&("once"===s?i=!0:"boolean"==typeof s?r=s:(r=s.capture,i=s.once));const o=Xo(this,r,!0),h=a(t)?t.split(" "):t,l=i?{listener:e,once:i}:{listener:e};h.forEach(t=>{t&&(n=o[t],n?-1===n.findIndex(t=>t.listener===e)&&n.push(l):o[t]=[l],Oo[t]&&bo.checkHas(this,t,"on"))})}off(t,e,s){if(t){const r=a(t)?t.split(" "):t;if(e){let t,i,n;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const o=Xo(this,t);r.forEach(t=>{t&&(i=o[t],i&&(n=i.findIndex(t=>t.listener===e),n>-1&&i.splice(n,1),i.length||delete o[t],Oo[t]&&bo.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;r.forEach(s=>{t&&delete t[s],e&&delete e[s]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,s,r){return e?this.on(t,s?e=e.bind(s):e,r):c(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:r}}off_(t){if(!t)return;const e=c(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):c(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,s,r){if(!e)return c(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));_(s)?e=e.bind(s):r=s,this.on(t,e,{once:!0,capture:r})}emit(t,e,s){!e&&Jt.has(t)&&(e=Jt.get(t,{type:t,target:this,current:this}));const r=Xo(this,s)[t];if(r){let i;for(let n=0,o=r.length;n<o&&!((i=r[n])&&(i.listener(e),i.once&&(this.off(t,i.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:s,__captureMap:r}=this,i=s&&s[t],o=r&&r[t];return!!(n(e)?i||o:e?o:i)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function Xo(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:No)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:No)}}const{on:Do,on_:zo,off:Fo,off_:jo,once:Uo,emit:Ho,emitEvent:Go,hasEvent:Vo,destroy:qo}=Yo.prototype,Qo={on:Do,on_:zo,off:Fo,off_:jo,once:Uo,emit:Ho,emitEvent:Go,hasEvent:Vo,destroyEventer:qo},Jo=Nt.get("setAttr"),Zo={__setAttr(t,e,s){if(this.leaferIsCreated){const r=this.__.__getInput(t);if(!s||h(e)||n(e)||(Jo.warn(this.innerName,t,e),e=void 0),_(e)||r!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new mo(mo.LEAFER_CHANGE,this,t,r,e));const s=Wo[t];s&&(this.emitEvent(new Lo(s,this)),this.emitEvent(new Lo(Lo.TRANSFORM,this)))}this.emitPropertyEvent(mo.CHANGE,t,r,e);const s=xo[t];return s&&this.emitPropertyEvent(s,t,r,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,s,r){const i=new mo(t,this,e,s,r);this.isLeafer||this.hasEvent(t)&&this.emitEvent(i),this.leafer.emitEvent(i)},__realSetAttr(t,e){const s=this.__;s[t]=e,this.__proxyData&&this.setProxyAttr(t,e),s.normalStyle&&(this.lockNormalStyle||n(s.normalStyle[t])||(s.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:$o,multiplyParent:Ko,translateInner:ta,defaultWorld:ea}=N,{toPoint:sa,tempPoint:ra}=ht,ia={__updateWorldMatrix(){const{parent:t,__layout:e,__world:s,__scrollWorld:r,__:i}=this;Ko(this.__local||e,t?t.__scrollWorld||t.__world:ea,s,!!e.affectScaleOrRotation,i),r&&ta(Object.assign(r,s),i.scrollX,i.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)&&($o(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)&&(sa(s.around||s.origin,t.boxBounds,ra),ta(e,-ra.x,-ra.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:na,updateAllMatrix:oa}=zn,{updateBounds:aa}=Kn,{toOuterOf:ha,copyAndSpread:la,copy:da}=Tt,{toBounds:ua}=pi,ca={__updateWorldBounds(){const t=this.__layout;ha(t.renderBounds,this.__world,this.__world),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&bo.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&bo.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(),ha(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){ha(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){ha(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const s=this.__layout.boxBounds,r=this.__;r.__pathInputed?ua(r.path,s):(s.x=0,s.y=0,s.width=r.width,s.height=r.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),oa(this),aa(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(oa(this),aa(this,this))):na(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;la(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout;e.renderSpread>0?la(e.renderBounds,e.boxBounds,e.renderSpread):da(e.renderBounds,e.strokeBounds)}},_a={__render(t,e){if(e.shape)return this.__renderShape(t,e);if(this.__worldOpacity){const s=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 r=t.getSameCanvas(!0,!0);this.__draw(r,e,t),zn.copyCanvasByWorld(this,t,r,this.__nowWorld,s.__blendMode,!0),r.recycle(this.__nowWorld)}else this.__draw(t,e);Nt.showBounds&&Nt.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:pa}=Qn,fa={__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.dim?e.dimOpacity=!0===s.dim?.2:s.dim:s.dimskip&&e.dimOpacity&&(e.dimOpacity=0),s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const r=t.getSameCanvas(!1,!0);this.__renderBranch(r,e);const i=this.__nowWorld;t.opacity=e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(r,i,i,s.__blendMode,!0),r.recycle(i)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let r=0,i=s.length;r<i;r++)pa(s[r],e)||s[r].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let r=0,i=s.length;r<i;r++)pa(s[r],e)||s[r].__clip(t,e)}}},ga={},{LEAF:ya,create:ma}=e,{toInnerPoint:xa,toOuterPoint:wa,multiplyParent:ba}=N,{toOuterOf:Ba}=Tt,{copy:va,move:ka}=q,{moveLocal:Ca,zoomOfLocal:Oa,rotateOfLocal:Pa,skewOfLocal:Ta,moveWorld:Sa,zoomOfWorld:Ra,rotateOfWorld:La,skewOfWorld:Ea,transform:Ia,transformWorld:Ma,setTransform:Aa,getFlipTransform:Wa,getLocalOrigin:Na,getRelativeWorld:Ya,drop:Xa}=zn;let Da=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 m}get __LayoutProcessor(){return po}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=ma(ya),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(go.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(go.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(go.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(go.MOUNTED)):this.__emitLifeEvent(go.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,r=e.length;s<r;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){n(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=n(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 ba(s,t.matrix,e,void 0,s),Ba(this.__layout.renderBounds,e,e),e.half!==s.half&&(e.half=s.half),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:r}=Ii.patternLocked?this.__world:this.__nowWorld;return t&&(s<0&&(s=-s),r<0&&(r=-r)),(!0===e||"zoom-in"===e&&s>1&&r>1)&&(s=r=1),ga.scaleX=s,ga.scaleY=r,ga}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 r=e?Ya(this,e):this.worldTransform,i=s?t:{};return Ba(t,r,i),i}worldToLocal(t,e,s,r){this.parent?this.parent.worldToInner(t,e,s,r):e&&va(e,t)}localToWorld(t,e,s,r){this.parent?this.parent.innerToWorld(t,e,s,r):e&&va(e,t)}worldToInner(t,e,s,r){r&&(r.innerToWorld(t,e,s),t=e||t),xa(this.worldTransform,t,e,s)}innerToWorld(t,e,s,r){wa(this.worldTransform,t,e,s),r&&r.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,r){return this.getBoxPointByInner(this.getInnerPoint(t,e,s,r),null,null,!0)}getBoxPointByInner(t,e,s,r){const i=r?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return ka(i,-n,-o),i}getInnerPoint(t,e,s,r){const i=r?t:{};return this.worldToInner(t,i,s,e),i}getInnerPointByBox(t,e,s,r){const i=r?t:Object.assign({},t),{x:n,y:o}=this.boxBounds;return ka(i,n,o),i}getInnerPointByLocal(t,e,s,r){return this.getInnerPoint(t,this.parent,s,r)}getLocalPoint(t,e,s,r){const i=r?t:{};return this.worldToLocal(t,i,s,e),i}getLocalPointByInner(t,e,s,r){return this.getWorldPoint(t,this.parent,s,r)}getPagePoint(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,r)}getWorldPoint(t,e,s,r){const i=r?t:{};return this.innerToWorld(t,i,s,e),i}getWorldPointByBox(t,e,s,r){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,r),e,s,!0)}getWorldPointByLocal(t,e,s,r){const i=r?t:{};return this.localToWorld(t,i,s,e),i}getWorldPointByPage(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,r)}setTransform(t,e,s){Aa(this,t,e,s)}transform(t,e,s){Ia(this,t,e,s)}move(t,e,s){Ca(this,t,e,s)}moveInner(t,e,s){Sa(this,t,e,!0,s)}scaleOf(t,e,s,r,i){Oa(this,Na(this,t),e,s,r,i)}rotateOf(t,e,s){Pa(this,Na(this,t),e,s)}skewOf(t,e,s,r,i){Ta(this,Na(this,t),e,s,r,i)}transformWorld(t,e,s){Ma(this,t,e,s)}moveWorld(t,e,s){Sa(this,t,e,!1,s)}scaleOfWorld(t,e,s,r,i){Ra(this,t,e,s,r,i)}rotateOfWorld(t,e){La(this,t,e)}skewOfWorld(t,e,s,r,i){Ea(this,t,e,s,r,i)}flip(t,e){Ia(this,Wa(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 Ut.need("path")}getMotionPoint(t){return Ut.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){Xa(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,r){}off_(t){}once(t,e,s,r){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,s){s?this.addAttr(t,e,s):wn(this.prototype,t,e)}static addAttr(t,e,s,r){s||(s=$i),s(e,r)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new go(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(go.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};Da=Kt([Pn(Zo),Pn(ia),Pn(ca),Pn(Qo),Pn(_a)],Da);const{setListWithFn:za}=Tt,{sort:Fa}=Kn,{localBoxBounds:ja,localStrokeBounds:Ua,localRenderBounds:Ha,maskLocalBoxBounds:Ga,maskLocalStrokeBounds:Va,maskLocalRenderBounds:qa}=Qn,Qa=new Nt("Branch");let Ja=class extends Da{__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){za(e||this.__layout.boxBounds,this.children,this.__hasMask?Ga:ja)}__updateStrokeBounds(t){za(t||this.__layout.strokeBounds,this.children,this.__hasMask?Va:Ua)}__updateRenderBounds(t){za(t||this.__layout.renderBounds,this.children,this.__hasMask?qa:Ha)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,r=e.length;s<r;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(Fa),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return Qa.warn("add self or destroyed");const s=n(e);if(!t.__){if(c(t))return t.forEach(t=>{this.add(t,e),s||e++});t=Vt.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,s?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(go.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(go.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)):n(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(go.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(go.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new go(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}};Ja=Kt([Pn(fa)],Ja);class Za{get length(){return this.list.length}constructor(t){this.reset(),t&&(c(t)?this.addList(t):this.add(t))}has(t){return t&&!n(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return n(e)?-1:e}add(t){const{list:e,keys:s}=this;n(s[t.innerId])&&(e.push(t),s[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:s}=this;if(n(s[t.innerId])){const{list:r}=this;for(let t=e,i=r.length;t<i;t++)s[r[t].innerId]++;0===e?r.unshift(t):(e>r.length&&(e=r.length),r.splice(e,0,t)),s[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let s;for(let r=0,i=e.length;r<i;r++)n(s)?e[r].innerId===t.innerId&&(s=r,delete this.keys[t.innerId]):this.keys[e[r].innerId]=r-1;n(s)||e.splice(s,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 Za;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,r=t.length;s<r;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class $a{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(c(t)?this.addList(t):this.add(t))}has(t){return!n(this.keys[t.innerId])}without(t){return n(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,r=e.length;s<r;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const Ka="1.9.3";export{ut as AlignHelper,r as Answer,ht as AroundHelper,Mt as AutoBounds,Fe as BezierHelper,Et as Bounds,bo as BoundsEvent,Tt as BoundsHelper,Ja as Branch,Kn as BranchHelper,fa as BranchRender,$t as CanvasManager,go as ChildEvent,Ht as Creator,g as DataHelper,Nt as Debug,nt as Direction4,ot as Direction9,Ze as EllipseHelper,fo as Event,Jt as EventCreator,Yo as Eventer,Ci as FileHelper,wo as ImageEvent,Ii as ImageManager,e as IncrementId,So as LayoutEvent,Da as Leaf,ca as LeafBounds,Qn as LeafBoundsHelper,m as LeafData,Zo as LeafDataProxy,Qo as LeafEventer,zn as LeafHelper,po as LeafLayout,$a as LeafLevelList,Za as LeafList,ia as LeafMatrix,_a as LeafRender,_e as LeaferCanvasBase,Lo as LeaferEvent,Xi as LeaferImage,B as MathHelper,et as Matrix,N as MatrixHelper,me as NeedConvertToCanvasCommandMap,k as OneRadian,C as PI2,O as PI_2,pi as PathBounds,ir as PathCommandDataHelper,ge as PathCommandMap,As as PathConvert,bi as PathCorner,br as PathCreator,Wr as PathDrawer,pe as PathHelper,Be as PathNumberCommandLengthMap,be as PathNumberCommandMap,t as Platform,Ut as Plugin,K as Point,q as PointHelper,mo as PropertyEvent,ve as RectHelper,Ro as RenderEvent,Po as ResizeEvent,Li as Resource,zt as Run,At as StringNumberMap,Ti as TaskItem,Si as TaskProcessor,rt as TwoPointBoundsHelper,Vt as UICreator,ro as WaitHelper,To as WatchEvent,an as affectRenderBoundsType,rn as affectStrokeBoundsType,Ui as attr,Qi as autoLayoutType,$i as boundsType,ki as canvasPatch,ce as canvasSizeAttrs,Fi as createDescriptor,yn as cursorType,mn as dataProcessor,Gi as dataType,ji as decorateLeafAttr,wn as defineDataProcessor,Di as defineKey,Hi as defineLeafAttr,tn as doBoundsType,nn as doStrokeType,i as emptyData,fn as eraserType,xo as extraPropertyEventMap,T as getBoundsData,zi as getDescriptor,S as getMatrixData,P as getPointData,gn as hitType,c as isArray,p as isData,f as isEmptyData,h as isFinite,o as isNull,l as isNumber,_ as isObject,a as isString,n as isUndefined,xn as layoutProcessor,Wo as leaferTransformAttrMap,pn as maskType,Ki as naturalBoundsType,ln as opacityType,en as pathInputType,sn as pathType,Bi as pen,Vi as positionType,Tn as registerUI,Sn as registerUIEvent,kn as rewrite,Cn as rewriteAble,Zi as rotationType,Ji as scaleType,qi as scrollType,_n as sortType,on as strokeType,hn as surfaceType,It as tempBounds,st as tempMatrix,tt as tempPoint,u as tryToNumber,Pn as useModule,Ka as version,dn as visibleType};
|
|
2
2
|
//# sourceMappingURL=core.esm.min.js.map
|