@leafer-ui/miniapp 1.0.0-rc.27 → 1.0.0-rc.28
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/dist/miniapp.esm.js +19 -7
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.module.js +53 -22
- package/dist/miniapp.module.min.js +1 -1
- package/package.json +10 -10
package/dist/miniapp.esm.js
CHANGED
|
@@ -140,12 +140,12 @@ function useCanvas(_canvasType, app) {
|
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
142
|
},
|
|
143
|
-
loadImage(
|
|
143
|
+
loadImage(src) {
|
|
144
144
|
return new Promise((resolve, reject) => {
|
|
145
145
|
const img = Platform.canvas.view.createImage();
|
|
146
146
|
img.onload = () => { resolve(img); };
|
|
147
147
|
img.onerror = (error) => { reject(error); };
|
|
148
|
-
img.src =
|
|
148
|
+
img.src = Platform.image.getRealURL(src);
|
|
149
149
|
});
|
|
150
150
|
},
|
|
151
151
|
noRepeat: 'repeat-x'
|
|
@@ -1803,7 +1803,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
1803
1803
|
width *= data.scaleX;
|
|
1804
1804
|
height *= data.scaleY;
|
|
1805
1805
|
}
|
|
1806
|
-
allowPaint = width * height > Platform.image.maxCacheSize;
|
|
1806
|
+
allowPaint = (width * height > Platform.image.maxCacheSize) || Export.running;
|
|
1807
1807
|
}
|
|
1808
1808
|
else {
|
|
1809
1809
|
allowPaint = false;
|
|
@@ -2315,7 +2315,8 @@ function createRows(drawData, content, style) {
|
|
|
2315
2315
|
if (breakAll) {
|
|
2316
2316
|
if (wordWidth)
|
|
2317
2317
|
addWord();
|
|
2318
|
-
|
|
2318
|
+
if (rowWidth)
|
|
2319
|
+
addRow();
|
|
2319
2320
|
}
|
|
2320
2321
|
else {
|
|
2321
2322
|
if (!afterBreak)
|
|
@@ -2323,10 +2324,12 @@ function createRows(drawData, content, style) {
|
|
|
2323
2324
|
if (langBreak || afterBreak || charType === Break || charType === Before || charType === Single || (wordWidth + charWidth > realWidth)) {
|
|
2324
2325
|
if (wordWidth)
|
|
2325
2326
|
addWord();
|
|
2326
|
-
|
|
2327
|
+
if (rowWidth)
|
|
2328
|
+
addRow();
|
|
2327
2329
|
}
|
|
2328
2330
|
else {
|
|
2329
|
-
|
|
2331
|
+
if (rowWidth)
|
|
2332
|
+
addRow();
|
|
2330
2333
|
}
|
|
2331
2334
|
}
|
|
2332
2335
|
}
|
|
@@ -2712,6 +2715,7 @@ const ExportModule = {
|
|
|
2712
2715
|
}
|
|
2713
2716
|
const { leafer } = leaf;
|
|
2714
2717
|
if (leafer) {
|
|
2718
|
+
checkLazy(leaf);
|
|
2715
2719
|
leafer.waitViewCompleted(() => __awaiter(this, void 0, void 0, function* () {
|
|
2716
2720
|
options = FileHelper.getExportOptions(options);
|
|
2717
2721
|
let renderBounds, trimBounds, scaleX = 1, scaleY = 1;
|
|
@@ -2719,6 +2723,8 @@ const ExportModule = {
|
|
|
2719
2723
|
const { slice, trim, onCanvas } = options;
|
|
2720
2724
|
let scale = options.scale || 1;
|
|
2721
2725
|
let pixelRatio = options.pixelRatio || 1;
|
|
2726
|
+
const smooth = options.smooth === undefined ? leafer.config.smooth : options.smooth;
|
|
2727
|
+
const contextSettings = options.contextSettings || leafer.config.contextSettings;
|
|
2722
2728
|
if (leaf.isApp) {
|
|
2723
2729
|
scale *= pixelRatio;
|
|
2724
2730
|
pixelRatio = leaf.app.pixelRatio;
|
|
@@ -2757,7 +2763,7 @@ const ExportModule = {
|
|
|
2757
2763
|
renderBounds = leaf.getBounds('render', relative);
|
|
2758
2764
|
}
|
|
2759
2765
|
const { x, y, width, height } = new Bounds(renderBounds).scale(scale);
|
|
2760
|
-
let canvas = Creator.canvas({ width: Math.round(width), height: Math.round(height), pixelRatio });
|
|
2766
|
+
let canvas = Creator.canvas({ width: Math.round(width), height: Math.round(height), pixelRatio, smooth, contextSettings });
|
|
2761
2767
|
const renderOptions = { matrix: matrix.scale(1 / scale).invert().translate(-x, -y).withScale(1 / scaleX * scale, 1 / scaleY * scale) };
|
|
2762
2768
|
if (slice) {
|
|
2763
2769
|
leaf = leafer;
|
|
@@ -2803,6 +2809,12 @@ function addTask(task) {
|
|
|
2803
2809
|
tasker.add(() => __awaiter(this, void 0, void 0, function* () { return yield task(resolve); }), { parallel: false });
|
|
2804
2810
|
});
|
|
2805
2811
|
}
|
|
2812
|
+
function checkLazy(leaf) {
|
|
2813
|
+
if (leaf.__.__needComputePaint)
|
|
2814
|
+
leaf.__.__computePaint();
|
|
2815
|
+
if (leaf.isBranch)
|
|
2816
|
+
leaf.children.forEach(child => checkLazy(child));
|
|
2817
|
+
}
|
|
2806
2818
|
|
|
2807
2819
|
const canvas = LeaferCanvasBase.prototype;
|
|
2808
2820
|
const debug = Debug.get('@leafer-ui/export');
|
package/dist/miniapp.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LeaferCanvasBase as t,Platform as e,canvasPatch as i,DataHelper as s,canvasSizeAttrs as n,ResizeEvent as o,Creator as a,LeaferImage as r,FileHelper as h,LeafList as d,RenderEvent as l,ChildEvent as c,WatchEvent as u,PropertyEvent as f,LeafHelper as g,BranchHelper as p,Bounds as _,LeafBoundsHelper as w,Debug as y,LeafLevelList as m,LayoutEvent as v,Run as x,ImageManager as b,AnimateEvent as B,BoundsHelper as R,Answer as k,MatrixHelper as S,AlignHelper as L,ImageEvent as E,AroundHelper as T,PointHelper as M,Direction4 as A,TwoPointBoundsHelper as C,TaskProcessor as W,Matrix as O}from"@leafer/core";export*from"@leafer/core";export{LeaferImage}from"@leafer/core";import{InteractionHelper as P,InteractionBase as I,HitCanvasManager as D,Platform as F}from"@leafer-ui/core";export*from"@leafer-ui/core";import{PaintImage as z,ColorConvert as N,PaintGradient as V,Export as U,Group as Y,TextConvert as G,Paint as j,Effect as H}from"@leafer-ui/draw";class X extends t{get allowBackgroundColor(){return!1}init(){let{view:t}=this.config;t?("string"==typeof t?("#"!==t[0]&&(t="#"+t),this.viewSelect=e.miniapp.select(t)):t.fields?this.viewSelect=t:this.initView(t),this.viewSelect&&e.miniapp.getSizeView(this.viewSelect).then((t=>{this.initView(t)}))):this.initView()}initView(t){t?this.view=t.view||t:(t={},this.__createView()),this.__createContext();const{width:e,height:s,pixelRatio:n}=this.config,o={width:e||t.width,height:s||t.height,pixelRatio:n};this.resize(o),this.context.roundRect&&(this.roundRect=function(t,e,i,s,n){this.context.roundRect(t,e,i,s,"number"==typeof n?[n]:n)}),i(this.context.__proto__)}__createView(){this.view=e.origin.createCanvas(1,1)}updateViewSize(){const{width:t,height:e,pixelRatio:i}=this;this.view.width=Math.ceil(t*i),this.view.height=Math.ceil(e*i)}updateClientBounds(t){this.viewSelect&&e.miniapp.getBounds(this.viewSelect).then((e=>{this.clientBounds=e,t&&t()}))}startAutoLayout(t,i){this.resizeListener=i,this.checkSize=this.checkSize.bind(this),e.miniapp.onWindowResize(this.checkSize)}checkSize(){this.viewSelect&&setTimeout((()=>{this.updateClientBounds((()=>{const{width:t,height:e}=this.clientBounds,{pixelRatio:i}=this,a={width:t,height:e,pixelRatio:i};if(!this.isSameSize(a)){const t={};s.copyAttrs(t,this,n),this.resize(a),void 0!==this.width&&this.resizeListener(new o(a,t))}}))}),500)}stopAutoLayout(){this.autoLayout=!1,this.resizeListener=null,e.miniapp.offWindowResize(this.checkSize)}}const{mineType:q,fileType:Q}=h;function J(t,i){e.origin||(e.origin={createCanvas:(t,e,s)=>i.createOffscreenCanvas({type:"2d",width:t,height:e}),canvasToDataURL:(t,e,i)=>t.toDataURL(q(e),i),canvasToBolb:(t,e,i)=>t.toBuffer(e,{quality:i}),canvasSaveAs:(t,i,s)=>{let n=t.toDataURL(q(Q(i)),s);return n=n.substring(n.indexOf("64,")+3),e.origin.download(n,i)},download:(t,s)=>new Promise(((n,o)=>{let a;s.includes("/")||(s=`${i.env.USER_DATA_PATH}/`+s,a=!0);const r=i.getFileSystemManager();r.writeFile({filePath:s,data:t,encoding:"base64",success(){a?e.miniapp.saveToAlbum(s).then((()=>{r.unlink({filePath:s}),n()})):n()},fail(t){o(t)}})})),loadImage:t=>new Promise(((i,s)=>{const n=e.canvas.view.createImage();n.onload=()=>{i(n)},n.onerror=t=>{s(t)},n.src=t})),noRepeat:"repeat-x"},e.miniapp={select:t=>i.createSelectorQuery().select(t),getBounds:t=>new Promise((e=>{t.boundingClientRect().exec((t=>{const i=t[1];e({x:i.top,y:i.left,width:i.width,height:i.height})}))})),getSizeView:t=>new Promise((e=>{t.fields({node:!0,size:!0}).exec((t=>{const i=t[0];e({view:i.node,width:i.width,height:i.height})}))})),saveToAlbum:t=>new Promise((e=>{i.getSetting({success:s=>{s.authSetting["scope.writePhotosAlbum"]?i.saveImageToPhotosAlbum({filePath:t,success(){e(!0)}}):i.authorize({scope:"scope.writePhotosAlbum",success:()=>{i.saveImageToPhotosAlbum({filePath:t,success(){e(!0)}})},fail:()=>{}})}})})),onWindowResize(t){i.onWindowResize(t)},offWindowResize(t){i.offWindowResize(t)}},e.event={stopDefault(t){},stopNow(t){},stop(t){}},e.canvas=a.canvas(),e.conicGradientSupport=!!e.canvas.context.createConicGradient)}Object.assign(a,{canvas:(t,e)=>new X(t,e),image:t=>new r(t)}),e.name="miniapp",e.requestRender=function(t){e.canvas.view.requestAnimationFrame(t)},e.devicePixelRatio=wx.getSystemInfoSync().pixelRatio;class K{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove){const t=new d;return this.__updatedList.list.forEach((e=>{e.leafer&&t.add(e)})),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new d,this.target=t,e&&(this.config=s.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(l.REQUEST)}__onAttrChange(t){this.__updatedList.add(t.target),this.update()}__onChildEvent(t){t.type===c.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent)),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new u(u.DATA,{updatedList:this.updatedList})),this.__updatedList=new d,this.totalTimes++,this.changed=!1,this.hasVisible=!1,this.hasRemove=!1,this.hasAdd=!1}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(f.CHANGE,this.__onAttrChange,this),t.on_([c.ADD,c.REMOVE],this.__onChildEvent,this),t.on_(u.REQUEST,this.__onRquestData,this)]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=null,this.__updatedList=null)}}const{updateAllMatrix:Z,updateBounds:$,updateAllWorldOpacity:tt}=g,{pushAllChildBranch:et,pushAllParent:it}=p;const{worldBounds:st}=w,nt={x:0,y:0,width:1e5,height:1e5};class ot{constructor(t){this.updatedBounds=new _,this.beforeBounds=new _,this.afterBounds=new _,t instanceof Array&&(t=new d(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,st)}setAfter(){const{list:t}=this.updatedList;t.some((t=>t.noBounds))?this.afterBounds.set(nt):this.afterBounds.setListWithFn(t,st),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:at,updateAllChange:rt}=g,ht=y.get("Layouter");class dt{constructor(t,e){this.totalTimes=0,this.config={},this.__levelList=new m,this.target=t,e&&(this.config=s.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(!this.running)return;const{target:t}=this;this.times=0;try{t.emit(v.START),this.layoutOnce(),t.emitEvent(new v(v.END,this.layoutedBlocks,this.times))}catch(t){ht.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?ht.warn("layouting"):this.times>3?ht.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(u.REQUEST),this.totalTimes>1?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=x.start("PartLayout"),{target:i,__updatedList:s}=this,{BEFORE:n,LAYOUT:o,AFTER:a}=v,r=this.getBlocks(s);r.forEach((t=>t.setBefore())),i.emitEvent(new v(n,r,this.times)),this.extraBlock=null,s.sort(),function(t,e){let i;t.list.forEach((t=>{i=t.__layout,e.without(t)&&!i.proxyZoom&&(i.matrixChanged?(Z(t,!0),e.add(t),t.isBranch&&et(t,e),it(t,e)):i.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),it(t,e)))}))}(s,this.__levelList),function(t){let e,i,s;t.sort(!0),t.levels.forEach((n=>{e=t.levelMap[n];for(let t=0,n=e.length;t<n;t++){if(i=e[t],i.isBranch&&i.__tempNumber){s=i.children;for(let t=0,e=s.length;t<e;t++)s[t].isBranch||$(s[t])}$(i)}}))}(this.__levelList),function(t){t.list.forEach((t=>{t.__layout.opacityChanged&&tt(t),t.__updateChange()}))}(s),this.extraBlock&&r.push(this.extraBlock),r.forEach((t=>t.setAfter())),i.emitEvent(new v(o,r,this.times)),i.emitEvent(new v(a,r,this.times)),this.addBlocks(r),this.__levelList.reset(),this.__updatedList=null,x.end(e)}fullLayout(){const t=x.start("FullLayout"),{target:e}=this,{BEFORE:i,LAYOUT:s,AFTER:n}=v,o=this.getBlocks(new d(e));e.emitEvent(new v(i,o,this.times)),dt.fullLayout(e),o.forEach((t=>{t.setAfter()})),e.emitEvent(new v(s,o,this.times)),e.emitEvent(new v(n,o,this.times)),this.addBlocks(o),x.end(t)}static fullLayout(t){at(t,!0),t.isBranch?p.updateBounds(t):g.updateBounds(t),rt(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:i}=this.extraBlock||(this.extraBlock=new ot([]));e.length?i.add(t.__world):i.set(t.__world),e.add(t)}}createBlock(t){return new ot(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(v.REQUEST,this.layout,this),t.on_(v.AGAIN,this.layoutAgain,this),t.on_(u.DATA,this.__onReceiveWatchData,this)]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const lt=y.get("Renderer");class ct{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,i){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,maxFPS:60},this.target=t,this.canvas=e,i&&(this.config=s.default(i,this.config)),this.__listenEvents(),this.__requestRender()}start(){this.running=!0}stop(){this.running=!1}update(){this.changed=!0}requestLayout(){this.target.emit(v.REQUEST)}render(t){if(!this.running||!this.canvas.view)return void(this.changed=!0);const{target:e}=this;this.times=0,this.totalBounds=new _,lt.log(e.innerName,"---\x3e");try{this.emitRender(l.START),this.renderOnce(t),this.emitRender(l.END,this.totalBounds),b.clearRecycled()}catch(t){this.rendering=!1,lt.error(t)}lt.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return lt.warn("rendering");if(this.times>3)return lt.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new _,this.renderOptions={},t)this.emitRender(l.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(l.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(l.RENDER,this.renderBounds,this.renderOptions),this.emitRender(l.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;if(!e)return lt.warn("PartRender: need update attr");this.mergeBlocks(),e.forEach((e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(t){const e=x.start("PartRender"),{canvas:i}=this,s=t.getIntersect(i.bounds),n=t.includes(this.target.__world),o=new _(s);i.save(),n&&!y.showRepaint?i.clear():(s.spread(10+1/this.canvas.pixelRatio).ceil(),i.clearWorld(s,!0),i.clipWorld(s,!0)),this.__render(s,n,o),i.restore(),x.end(e)}fullRender(){const t=x.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds,!0),e.restore(),x.end(t)}__render(t,e,i){const s=t.includes(this.target.__world)?{includes:e}:{bounds:t,includes:e};this.needFill&&this.canvas.fillWorld(t,this.config.fill),y.showRepaint&&this.canvas.strokeWorld(t,"red"),this.target.__render(this.canvas,s),this.renderBounds=i||t,this.renderOptions=s,this.totalBounds.isEmpty()?this.totalBounds=this.renderBounds:this.totalBounds.add(this.renderBounds),y.showHitView&&this.renderHitView(s),y.showBoundsView&&this.renderBoundsView(s),this.canvas.updateRender()}renderHitView(t){}renderBoundsView(t){}addBlock(t){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new _;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=Date.now();e.requestRender((()=>{this.FPS=Math.min(60,Math.ceil(1e3/(Date.now()-t))),this.running&&(this.target.emit(B.FRAME),this.changed&&this.canvas.view&&this.render(),this.target.emit(l.NEXT)),this.target&&this.__requestRender()}))}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:i}=t.old;if(!new _(0,0,e,i).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new _(0,0,1,1)),this.changed=!0}}__onLayoutEnd(t){t.data&&t.data.map((t=>{let e;t.updatedList&&t.updatedList.list.some((t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||lt.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e))),this.addBlock(e?this.canvas.bounds:t.updatedBounds)}))}emitRender(t,e,i){this.target.emitEvent(new l(t,this.times,e,i))}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(l.REQUEST,this.update,this),t.on_(v.END,this.__onLayoutEnd,this),t.on_(l.AGAIN,this.renderAgain,this),t.on_(o.RESIZE,this.__onResize,this)]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.canvas=this.config=null)}}const{hitRadiusPoint:ut}=R;class ft{constructor(t,e){this.target=t,this.selector=e}getByPoint(t,e,i){e||(e=0),i||(i={});const s=i.through||!1,n=i.ignoreHittable||!1,o=i.target||this.target;this.exclude=i.exclude||null,this.point={x:t.x,y:t.y,radiusX:e,radiusY:e},this.findList=new d(i.findList),i.findList||this.hitBranch(o);const{list:a}=this.findList,r=this.getBestMatchLeaf(a,i.bottomList,n),h=n?this.getPath(r):this.getHitablePath(r);return this.clear(),s?{path:h,target:r,throughPath:a.length?this.getThroughPath(a):h}:{path:h,target:r}}getBestMatchLeaf(t,e,i){if(t.length){let e;this.findList=new d;const{x:s,y:n}=this.point,o={x:s,y:n,radiusX:0,radiusY:0};for(let s=0,n=t.length;s<n;s++)if(e=t[s],(i||g.worldHittable(e))&&(this.hitChild(e,o),this.findList.length))return this.findList.list[0]}if(e)for(let t=0,i=e.length;t<i;t++)if(this.hitChild(e[t].target,this.point,e[t].proxy),this.findList.length)return this.findList.list[0];return t[0]}getPath(t){const e=new d;for(;t;)e.add(t),t=t.parent;return e.add(this.target),e}getHitablePath(t){const e=this.getPath(t&&t.hittable?t:null);let i,s=new d;for(let t=e.list.length-1;t>-1&&(i=e.list[t],i.__.hittable)&&(s.addAt(i,0),i.__.hitChildren);t--);return s}getThroughPath(t){const e=new d,i=[];for(let e=t.length-1;e>-1;e--)i.push(this.getPath(t[e]));let s,n,o;for(let t=0,a=i.length;t<a;t++){s=i[t],n=i[t+1];for(let t=0,i=s.length;t<i&&(o=s.list[t],!n||!n.has(o));t++)e.add(o)}return e}hitBranch(t){this.eachFind(t.children,t.__onlyHitMask)}eachFind(t,e){let i,s;const{point:n}=this;for(let o=t.length-1;o>-1;o--)i=t[o],!i.__.visible||e&&!i.__.mask||(s=!!i.__.hitRadius||ut(i.__world,n),i.isBranch?(s||i.__ignoreHitWorld)&&(this.eachFind(i.children,i.__onlyHitMask),i.isBranchLeaf&&!this.findList.length&&this.hitChild(i,n)):s&&this.hitChild(i,n))}hitChild(t,e,i){if((!this.exclude||!this.exclude.has(t))&&t.__hitWorld(e)){const{parent:s}=t;if(s&&s.__hasMask&&!t.__.mask&&!s.children.some((t=>t.__.mask&&t.__hitWorld(e))))return;this.findList.add(i||t)}}clear(){this.point=null,this.findList=null,this.exclude=null}destroy(){this.clear()}}const{Yes:gt,NoAndSkip:pt,YesAndSkip:_t}=k,wt={},yt={},mt={};class vt{constructor(t,e){this.config={},this.innerIdMap={},this.idMap={},this.methods={id:(t,e)=>t.id===e?(this.idMap[e]=t,1):0,innerId:(t,e)=>t.innerId===e?(this.innerIdMap[e]=t,1):0,className:(t,e)=>t.className===e?1:0,tag:(t,e)=>t.__tag===e?1:0,tags:(t,e)=>e[t.__tag]?1:0},this.target=t,e&&(this.config=s.default(e,this.config)),this.picker=new ft(t,this),this.__listenEvents()}getBy(t,e,i,n){switch(typeof t){case"number":const o=this.getByInnerId(t,e);return i?o:o?[o]:[];case"string":switch(t[0]){case"#":wt.id=t.substring(1),t=wt;break;case".":yt.className=t.substring(1),t=yt;break;default:mt.tag=t,t=mt}case"object":if(void 0!==t.id){const s=this.getById(t.id,e);return i?s:s?[s]:[]}if(t.tag){const{tag:n}=t,o=n instanceof Array;return this.getByMethod(o?this.methods.tags:this.methods.tag,e,i,o?s.toMap(n):n)}return this.getByMethod(this.methods.className,e,i,t.className);case"function":return this.getByMethod(t,e,i,n)}}getByPoint(t,i,s){return"node"===e.name&&this.target.emit(v.CHECK_UPDATE),this.picker.getByPoint(t,i,s)}getByInnerId(t,e){const i=this.innerIdMap[t];return i||(this.eachFind(this.toChildren(e),this.methods.innerId,null,t),this.findLeaf)}getById(t,e){const i=this.idMap[t];return i&&g.hasParent(i,e||this.target)?i:(this.eachFind(this.toChildren(e),this.methods.id,null,t),this.findLeaf)}getByClassName(t,e){return this.getByMethod(this.methods.className,e,!1,t)}getByTag(t,e){return this.getByMethod(this.methods.tag,e,!1,t)}getByMethod(t,e,i,s){const n=i?null:[];return this.eachFind(this.toChildren(e),t,n,s),n||this.findLeaf}eachFind(t,e,i,s){let n,o;for(let a=0,r=t.length;a<r;a++){if(n=t[a],o=e(n,s),o===gt||o===_t){if(!i)return void(this.findLeaf=n);i.push(n)}n.isBranch&&o<pt&&this.eachFind(n.children,e,i,s)}}toChildren(t){return this.findLeaf=null,[t||this.target]}__onRemoveChild(t){const{id:e,innerId:i}=t.child;this.idMap[e]&&delete this.idMap[e],this.innerIdMap[i]&&delete this.innerIdMap[i]}__checkIdChange(t){if("id"===t.attrName){const e=t.oldValue;this.idMap[e]&&delete this.idMap[e]}}__listenEvents(){this.__eventIds=[this.target.on_(c.REMOVE,this.__onRemoveChild,this),this.target.on_(f.CHANGE,this.__checkIdChange,this)]}__removeListenEvents(){this.target.off_(this.__eventIds),this.__eventIds.length=0}destroy(){this.__eventIds.length&&(this.__removeListenEvents(),this.picker.destroy(),this.findLeaf=null,this.innerIdMap={},this.idMap={})}}Object.assign(a,{watcher:(t,e)=>new K(t,e),layouter:(t,e)=>new dt(t,e),renderer:(t,e,i)=>new ct(t,e,i),selector:(t,e)=>new vt(t,e)}),e.layout=dt.fullLayout;const xt={convertTouch(t,e){const i=xt.getTouch(t),s=P.getBase(t);return Object.assign(Object.assign({},s),{x:e.x,y:e.y,width:1,height:1,pointerType:"touch",pressure:i.force||1})},getTouch:t=>t.touches[0]||t.changedTouches[0]};class bt extends I{__listenEvents(){super.__listenEvents(),this.config.eventer&&(this.config.eventer.receiveEvent=this.receive.bind(this))}receive(t){switch(t.type){case"touchstart":this.onTouchStart(t);break;case"touchmove":this.onTouchMove(t);break;case"touchend":this.onTouchEnd(t);break;case"touchcancel":this.onTouchCancel()}}getLocal(t,e){return void 0!==t.x?{x:t.x,y:t.y}:super.getLocal(t,e)}getTouches(t){return t}onTouchStart(t){this.multiTouchStart(t);const e=xt.getTouch(t);this.pointerDown(xt.convertTouch(t,this.getLocal(e,!0)))}onTouchMove(t){if(this.multiTouchMove(t),this.useMultiTouch)return;const e=xt.getTouch(t);this.pointerMove(xt.convertTouch(t,this.getLocal(e)))}onTouchEnd(t){this.multiTouchEnd();const e=xt.getTouch(t);this.pointerUp(xt.convertTouch(t,this.getLocal(e)))}onTouchCancel(){this.pointerCancel()}multiTouchStart(t){this.useMultiTouch=t.touches.length>=2,this.touches=this.useMultiTouch?this.getTouches(t.touches):void 0,this.useMultiTouch&&this.pointerCancel()}multiTouchMove(t){if(this.useMultiTouch&&t.touches.length>1){const e=this.getTouches(t.touches),i=this.getKeepTouchList(this.touches,e);i.length>1&&(this.multiTouch(P.getBase(t),i),this.touches=e)}}multiTouchEnd(){this.touches=null,this.useMultiTouch=!1,this.transformEnd()}getKeepTouchList(t,e){let i;const s=[];return t.forEach((t=>{i=e.find((e=>e.identifier===t.identifier)),i&&s.push({from:this.getLocal(t),to:this.getLocal(i)})})),s}getLocalTouchs(t){return t.map((t=>this.getLocal(t)))}destroy(){super.destroy(),this.touches=null}}function Bt(t,e){let i;const{rows:s,decorationY:n,decorationHeight:o}=t.__.__textDrawData;for(let t=0,a=s.length;t<a;t++)i=s[t],i.text?e.fillText(i.text,i.x,i.y):i.data&&i.data.forEach((t=>{e.fillText(t.char,t.x,i.y)})),n&&e.fillRect(i.x,i.y+n,i.width,o)}function Rt(t,e,i){const{strokeAlign:s}=e.__,n="string"!=typeof t;switch(s){case"center":i.setStroke(n?void 0:t,e.__.strokeWidth,e.__),n?Lt(t,!0,e,i):St(e,i);break;case"inside":kt("inside",t,n,e,i);break;case"outside":kt("outside",t,n,e,i)}}function kt(t,e,i,s,n){const{__strokeWidth:o,__font:a}=s.__,r=n.getSameCanvas(!0,!0);r.setStroke(i?void 0:e,2*o,s.__),r.font=a,i?Lt(e,!0,s,r):St(s,r),r.blendMode="outside"===t?"destination-out":"destination-in",Bt(s,r),r.blendMode="normal",s.__worldFlipped?n.copyWorldByReset(r,s.__nowWorld):n.copyWorldToInner(r,s.__nowWorld,s.__layout.renderBounds),r.recycle(s.__nowWorld)}function St(t,e){let i;const{rows:s,decorationY:n,decorationHeight:o}=t.__.__textDrawData;for(let t=0,a=s.length;t<a;t++)i=s[t],i.text?e.strokeText(i.text,i.x,i.y):i.data&&i.data.forEach((t=>{e.strokeText(t.char,t.x,i.y)})),n&&e.strokeRect(i.x,i.y+n,i.width,o)}function Lt(t,e,i,s){let n;for(let o=0,a=t.length;o<a;o++)n=t[o],n.image&&z.checkImage(i,s,n,!1)||n.style&&(s.strokeStyle=n.style,n.blendMode?(s.saveBlendMode(n.blendMode),e?St(i,s):s.stroke(),s.restoreBlendMode()):e?St(i,s):s.stroke())}const{getSpread:Et,getOuterOf:Tt,getByMove:Mt,getIntersectData:At}=R;let Ct;function Wt(t,e,i){if("object"!=typeof e||!1===e.visible||0===e.opacity)return;const{boxBounds:s}=i.__layout;switch(e.type){case"solid":let{type:n,blendMode:o,color:a,opacity:r}=e;return{type:n,blendMode:o,style:N.string(a,r)};case"image":return z.image(i,t,e,s,!Ct||!Ct[e.url]);case"linear":return V.linearGradient(e,s);case"radial":return V.radialGradient(e,s);case"angular":return V.conicGradient(e,s);default:return void 0!==e.r?{type:"solid",style:N.string(e)}:void 0}}const Ot={compute:function(t,e){const i=e.__,s=[];let n,o=i.__input[t];o instanceof Array||(o=[o]),Ct=z.recycleImage(t,i);for(let i,n=0,a=o.length;n<a;n++)i=Wt(t,o[n],e),i&&s.push(i);i["_"+t]=s.length?s:void 0,s.length&&s[0].image&&(n=s[0].image.hasOpacityPixel),"fill"===t?i.__pixelFill=n:i.__pixelStroke=n},fill:function(t,e,i){i.fillStyle=t,e.__.__font?Bt(e,i):e.__.windingRule?i.fill(e.__.windingRule):i.fill()},fills:function(t,e,i){let s;const{windingRule:n,__font:o}=e.__;for(let a=0,r=t.length;a<r;a++)s=t[a],s.image&&z.checkImage(e,i,s,!o)||s.style&&(i.fillStyle=s.style,s.transform?(i.save(),i.transform(s.transform),s.blendMode&&(i.blendMode=s.blendMode),o?Bt(e,i):n?i.fill(n):i.fill(),i.restore()):s.blendMode?(i.saveBlendMode(s.blendMode),o?Bt(e,i):n?i.fill(n):i.fill(),i.restoreBlendMode()):o?Bt(e,i):n?i.fill(n):i.fill())},fillText:Bt,stroke:function(t,e,i){const s=e.__,{__strokeWidth:n,strokeAlign:o,__font:a}=s;if(n)if(a)Rt(t,e,i);else switch(o){case"center":i.setStroke(t,n,s),i.stroke();break;case"inside":i.save(),i.setStroke(t,2*n,s),s.windingRule?i.clip(s.windingRule):i.clip(),i.stroke(),i.restore();break;case"outside":const o=i.getSameCanvas(!0,!0);o.setStroke(t,2*n,s),e.__drawRenderPath(o),o.stroke(),s.windingRule?o.clip(s.windingRule):o.clip(),o.clearWorld(e.__layout.renderBounds),e.__worldFlipped?i.copyWorldByReset(o,e.__nowWorld):i.copyWorldToInner(o,e.__nowWorld,e.__layout.renderBounds),o.recycle(e.__nowWorld)}},strokes:function(t,e,i){const s=e.__,{__strokeWidth:n,strokeAlign:o,__font:a}=s;if(n)if(a)Rt(t,e,i);else switch(o){case"center":i.setStroke(void 0,n,s),Lt(t,!1,e,i);break;case"inside":i.save(),i.setStroke(void 0,2*n,s),s.windingRule?i.clip(s.windingRule):i.clip(),Lt(t,!1,e,i),i.restore();break;case"outside":const{renderBounds:o}=e.__layout,a=i.getSameCanvas(!0,!0);e.__drawRenderPath(a),a.setStroke(void 0,2*n,s),Lt(t,!1,e,a),s.windingRule?a.clip(s.windingRule):a.clip(),a.clearWorld(o),e.__worldFlipped?i.copyWorldByReset(a,e.__nowWorld):i.copyWorldToInner(a,e.__nowWorld,o),a.recycle(e.__nowWorld)}},strokeText:Rt,drawTextStroke:St,shape:function(t,e,i){const s=e.getSameCanvas(),n=t.__nowWorld;let o,a,r,h,{scaleX:d,scaleY:l}=n;if(d<0&&(d=-d),l<0&&(l=-l),e.bounds.includes(n))h=s,o=r=n;else{const{renderShapeSpread:s}=t.__layout,c=At(s?Et(e.bounds,d===l?s*d:[s*l,s*d]):e.bounds,n);a=e.bounds.getFitMatrix(c);let{a:u,d:f}=a;if(a.a<1&&(h=e.getSameCanvas(),t.__renderShape(h,i),d*=u,l*=f),r=Tt(n,a),o=Mt(r,-a.e,-a.f),i.matrix){const{matrix:t}=i;a.multiply(t),u*=t.scaleX,f*=t.scaleY}i=Object.assign(Object.assign({},i),{matrix:a.withScale(u,f)})}return t.__renderShape(s,i),{canvas:s,matrix:a,bounds:o,worldCanvas:h,shapeBounds:r,scaleX:d,scaleY:l}}};let Pt={};const{get:It,rotateOfOuter:Dt,translate:Ft,scaleOfOuter:zt,scale:Nt,rotate:Vt}=S;function Ut(t,e,i,s,n,o,a){const r=It();Ft(r,e.x+i,e.y+s),Nt(r,n,o),a&&Dt(r,{x:e.x+e.width/2,y:e.y+e.height/2},a),t.transform=r}function Yt(t,e,i,s,n,o,a){const r=It();Ft(r,e.x+i,e.y+s),n&&Nt(r,n,o),a&&Vt(r,a),t.transform=r}function Gt(t,e,i,s,n,o,a,r,h,d){const l=It();if(h)if("center"===d)Dt(l,{x:i/2,y:s/2},h);else switch(Vt(l,h),h){case 90:Ft(l,s,0);break;case 180:Ft(l,i,s);break;case 270:Ft(l,0,i)}Pt.x=e.x+n,Pt.y=e.y+o,Ft(l,Pt.x,Pt.y),a&&zt(l,Pt,a,r),t.transform=l}const{get:jt,translate:Ht}=S,Xt=new _,qt={};function Qt(t,e,i,s){const{blendMode:n}=i;n&&(t.blendMode=n),t.data=Jt(i,s,e)}function Jt(t,e,i){let{width:s,height:n}=i;t.padding&&(e=Xt.set(e).shrink(t.padding));const{opacity:o,mode:a,align:r,offset:h,scale:d,size:l,rotation:c,repeat:u}=t,f=e.width===s&&e.height===n,g={mode:a},p="center"!==r&&(c||0)%180==90,_=p?n:s,w=p?s:n;let y,m,v=0,x=0;if(a&&"cover"!==a&&"fit"!==a)l?(y=("number"==typeof l?l:l.width)/s,m=("number"==typeof l?l:l.height)/n):d&&(y="number"==typeof d?d:d.x,m="number"==typeof d?d:d.y);else if(!f||c){const t=e.width/_,i=e.height/w;y=m="fit"===a?Math.min(t,i):Math.max(t,i),v+=(e.width-s*y)/2,x+=(e.height-n*m)/2}if(r){const t={x:v,y:x,width:_,height:w};y&&(t.width*=y,t.height*=m),L.toPoint(r,t,e,qt,!0),v+=qt.x,x+=qt.y}switch(h&&(v+=h.x,x+=h.y),a){case"strench":f||(s=e.width,n=e.height);break;case"normal":case"clip":(v||x||y||c)&&Yt(g,e,v,x,y,m,c);break;case"repeat":(!f||y||c)&&Gt(g,e,s,n,v,x,y,m,c,r),u||(g.repeat="repeat");break;default:y&&Ut(g,e,v,x,y,m,c)}return g.transform||(e.x||e.y)&&(g.transform=jt(),Ht(g.transform,e.x,e.y)),y&&"strench"!==a&&(g.scaleX=y,g.scaleY=m),g.width=s,g.height=n,o&&(g.opacity=o),u&&(g.repeat="string"==typeof u?"x"===u?"repeat-x":"repeat-y":"repeat"),g}let Kt,Zt=new _;const{isSame:$t}=R;function te(t,e,i,s,n,o){if("fill"===e&&!t.__.__naturalWidth){const e=t.__;if(e.__naturalWidth=s.width/e.pixelRatio,e.__naturalHeight=s.height/e.pixelRatio,e.__autoSide)return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",e.width),t.setProxyAttr("height",e.height)),!1}return n.data||Qt(n,s,i,o),!0}function ee(t,e){ne(t,E.LOAD,e)}function ie(t,e){ne(t,E.LOADED,e)}function se(t,e,i){e.error=i,t.forceUpdate("surface"),ne(t,E.ERROR,e)}function ne(t,e,i){t.hasEvent(e)&&t.emitEvent(new E(e,i))}function oe(t,e){const{leafer:i}=t;i&&i.viewReady&&(i.renderer.ignore=e)}const{get:ae,scale:re,copy:he}=S,{ceil:de,abs:le}=Math;function ce(t,i,s){let{scaleX:n,scaleY:o}=b.patternLocked?t.__world:t.__nowWorld;const a=n+"-"+o;if(i.patternId===a||t.destroyed)return!1;{n=le(n),o=le(o);const{image:t,data:r}=i;let h,d,{width:l,height:c,scaleX:u,scaleY:f,opacity:g,transform:p,repeat:_}=r;u&&(d=ae(),he(d,p),re(d,1/u,1/f),n*=u,o*=f),n*=s,o*=s,l*=n,c*=o;const w=l*c;if(!_&&w>e.image.maxCacheSize)return!1;let y=e.image.maxPatternSize;if(!t.isSVG){const e=t.width*t.height;y>e&&(y=e)}w>y&&(h=Math.sqrt(w/y)),h&&(n/=h,o/=h,l/=h,c/=h),u&&(n/=u,o/=f),(p||1!==n||1!==o)&&(d||(d=ae(),p&&he(d,p)),re(d,1/n,1/o));const m=t.getCanvas(de(l)||1,de(c)||1,g),v=t.getPattern(m,_||e.origin.noRepeat||"no-repeat",d,i);return i.style=v,i.patternId=a,!0}}function ue(t,e,i,s){return new(i||(i=Promise))((function(n,o){function a(t){try{h(s.next(t))}catch(t){o(t)}}function r(t){try{h(s.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,r)}h((s=s.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const{abs:fe}=Math;const ge={image:function(t,e,i,s,n){let o,a;const r=b.get(i);return Kt&&i===Kt.paint&&$t(s,Kt.boxBounds)?o=Kt.leafPaint:(o={type:i.type,image:r},Kt=r.use>1?{leafPaint:o,paint:i,boxBounds:Zt.set(s)}:null),(n||r.loading)&&(a={image:r,attrName:e,attrValue:i}),r.ready?(te(t,e,i,r,o,s),n&&(ee(t,a),ie(t,a))):r.error?n&&se(t,a,r.error):(oe(t,!0),n&&ee(t,a),o.loadId=r.load((()=>{oe(t,!1),t.destroyed||(te(t,e,i,r,o,s)&&(r.hasOpacityPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),ie(t,a)),o.loadId=null}),(e=>{oe(t,!1),se(t,a,e),o.loadId=null}))),o},checkImage:function(t,i,s,n){const{scaleX:o,scaleY:a}=b.patternLocked?t.__world:t.__nowWorld;if(s.data&&s.patternId!==o+"-"+a){const{data:r}=s;if(n)if(r.repeat)n=!1;else{let{width:t,height:s}=r;t*=fe(o)*i.pixelRatio,s*=fe(a)*i.pixelRatio,r.scaleX&&(t*=r.scaleX,s*=r.scaleY),n=t*s>e.image.maxCacheSize}return n?(i.save(),i.clip(),s.blendMode&&(i.blendMode=s.blendMode),r.opacity&&(i.opacity*=r.opacity),r.transform&&i.transform(r.transform),i.drawImage(s.image.view,0,0,r.width,r.height),i.restore(),!0):(!s.style||U.running?ce(t,s,i.pixelRatio):s.patternTask||(s.patternTask=b.patternTasker.add((()=>ue(this,void 0,void 0,(function*(){s.patternTask=null,i.bounds.hit(t.__nowWorld)&&ce(t,s,i.pixelRatio),t.forceUpdate("surface")}))),300)),!1)}return!1},createPattern:ce,recycleImage:function(t,e){const i=e["_"+t];if(i instanceof Array){let s,n,o,a;for(let r=0,h=i.length;r<h;r++)s=i[r].image,a=s&&s.url,a&&(n||(n={}),n[a]=!0,b.recycle(s),s.loading&&(o||(o=e.__input&&e.__input[t]||[],o instanceof Array||(o=[o])),s.unload(i[r].loadId,!o.some((t=>t.url===a)))));return n}return null},createData:Qt,getPatternData:Jt,fillOrFitMode:Ut,clipMode:Yt,repeatMode:Gt},{toPoint:pe}=T,_e={},we={};function ye(t,e,i){let s;for(let n=0,o=e.length;n<o;n++)s=e[n],"string"==typeof s?t.addColorStop(n/(o-1),N.string(s,i)):t.addColorStop(s.offset,N.string(s.color,i))}const{getAngle:me,getDistance:ve}=M,{get:xe,rotateOfOuter:be,scaleOfOuter:Be}=S,{toPoint:Re}=T,ke={},Se={};function Le(t,e,i,s,n){let o;const{width:a,height:r}=t;if(a!==r||s){const t=me(e,i);o=xe(),n?(Be(o,e,a/r*(s||1),1),be(o,e,t+90)):(Be(o,e,1,a/r*(s||1)),be(o,e,t))}return o}const{getDistance:Ee}=M,{toPoint:Te}=T,Me={},Ae={};const Ce={linearGradient:function(t,i){let{from:s,to:n,type:o,blendMode:a,opacity:r}=t;pe(s||"top",i,_e),pe(n||"bottom",i,we);const h=e.canvas.createLinearGradient(_e.x,_e.y,we.x,we.y);ye(h,t.stops,r);const d={type:o,style:h};return a&&(d.blendMode=a),d},radialGradient:function(t,i){let{from:s,to:n,type:o,opacity:a,blendMode:r,stretch:h}=t;Re(s||"center",i,ke),Re(n||"bottom",i,Se);const d=e.canvas.createRadialGradient(ke.x,ke.y,0,ke.x,ke.y,ve(ke,Se));ye(d,t.stops,a);const l={type:o,style:d},c=Le(i,ke,Se,h,!0);return c&&(l.transform=c),r&&(l.blendMode=r),l},conicGradient:function(t,i){let{from:s,to:n,type:o,opacity:a,blendMode:r,stretch:h}=t;Te(s||"center",i,Me),Te(n||"bottom",i,Ae);const d=e.conicGradientSupport?e.canvas.createConicGradient(0,Me.x,Me.y):e.canvas.createRadialGradient(Me.x,Me.y,0,Me.x,Me.y,Ee(Me,Ae));ye(d,t.stops,a);const l={type:o,style:d},c=Le(i,Me,Ae,h||1,e.conicGradientRotate90);return c&&(l.transform=c),r&&(l.blendMode=r),l},getTransform:Le},{copy:We,toOffsetOutBounds:Oe}=R,Pe={},Ie={};function De(t,i,s,n){const{bounds:o,shapeBounds:a}=n;if(e.fullImageShadow){if(We(Pe,t.bounds),Pe.x+=i.x-a.x,Pe.y+=i.y-a.y,s){const{matrix:t}=n;Pe.x-=(o.x+(t?t.e:0)+o.width/2)*(s-1),Pe.y-=(o.y+(t?t.f:0)+o.height/2)*(s-1),Pe.width*=s,Pe.height*=s}t.copyWorld(n.canvas,t.bounds,Pe)}else s&&(We(Pe,i),Pe.x-=i.width/2*(s-1),Pe.y-=i.height/2*(s-1),Pe.width*=s,Pe.height*=s),t.copyWorld(n.canvas,a,s?Pe:i)}const{toOffsetOutBounds:Fe}=R,ze={};const Ne={shadow:function(t,e,i){let s,n;const{__nowWorld:o,__layout:a}=t,{shadow:r}=t.__,{worldCanvas:h,bounds:d,shapeBounds:l,scaleX:c,scaleY:u}=i,f=e.getSameCanvas(),g=r.length-1;Oe(d,Ie),r.forEach(((r,p)=>{f.setWorldShadow(Ie.offsetX+r.x*c,Ie.offsetY+r.y*u,r.blur*c,r.color),n=r.spread?1+2*r.spread/(a.boxBounds.width+2*(a.strokeBoxSpread||0)):0,De(f,Ie,n,i),s=d,r.box&&(f.restore(),f.save(),h&&(f.copyWorld(f,d,o,"copy"),s=o),h?f.copyWorld(h,o,o,"destination-out"):f.copyWorld(i.canvas,l,d,"destination-out")),t.__worldFlipped?e.copyWorldByReset(f,s,o,r.blendMode):e.copyWorldToInner(f,s,a.renderBounds,r.blendMode),g&&p<g&&f.clearWorld(s,!0)})),f.recycle(s)},innerShadow:function(t,e,i){let s,n;const{__nowWorld:o,__layout:a}=t,{innerShadow:r}=t.__,{worldCanvas:h,bounds:d,shapeBounds:l,scaleX:c,scaleY:u}=i,f=e.getSameCanvas(),g=r.length-1;Fe(d,ze),r.forEach(((r,p)=>{f.save(),f.setWorldShadow(ze.offsetX+r.x*c,ze.offsetY+r.y*u,r.blur*c),n=r.spread?1-2*r.spread/(a.boxBounds.width+2*(a.strokeBoxSpread||0)):0,De(f,ze,n,i),f.restore(),h?(f.copyWorld(f,d,o,"copy"),f.copyWorld(h,o,o,"source-out"),s=o):(f.copyWorld(i.canvas,l,d,"source-out"),s=d),f.fillWorld(s,r.color,"source-in"),t.__worldFlipped?e.copyWorldByReset(f,s,o,r.blendMode):e.copyWorldToInner(f,s,a.renderBounds,r.blendMode),g&&p<g&&f.clearWorld(s,!0)})),f.recycle(s)},blur:function(t,e,i){const{blur:s}=t.__;i.setWorldBlur(s*t.__nowWorld.a),i.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),i.filter="none"},backgroundBlur:function(t,e,i){}},{excludeRenderBounds:Ve}=w;function Ue(t,e,i,s,n,o){switch(e){case"alpha":!function(t,e,i,s){const n=t.__nowWorld;i.resetTransform(),i.opacity=1,i.useMask(s,n),s.recycle(n),Ge(t,e,i,1)}(t,i,s,n);break;case"opacity-path":Ge(t,i,s,o);break;case"path":i.restore()}}function Ye(t){return t.getSameCanvas(!1,!0)}function Ge(t,e,i,s){const n=t.__nowWorld;e.resetTransform(),e.opacity=s,e.copyWorld(i,n),i.recycle(n)}Y.prototype.__renderMask=function(t,e){let i,s,n,o,a;const{children:r}=this;for(let h=0,d=r.length;h<d;h++)i=r[h],i.__.mask&&(a&&(Ue(this,a,t,n,s,o),s=n=null),"path"===i.__.mask?(i.opacity<1?(a="opacity-path",o=i.opacity,n||(n=Ye(t))):(a="path",t.save()),i.__clip(n||t,e)):(a="alpha",s||(s=Ye(t)),n||(n=Ye(t)),i.__render(s,e)),"clipping"!==i.__.mask)||Ve(i,e)||i.__render(n||t,e);Ue(this,a,t,n,s,o)};const je=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",He=je+"_#~&*+\\=|≮≯≈≠=…",Xe=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map((([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`)).join("|"));function qe(t){const e={};return t.split("").forEach((t=>e[t]=!0)),e}const Qe=qe("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),Je=qe("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),Ke=qe(je),Ze=qe(He),$e=qe("- —/~|┆·");var ti;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(ti||(ti={}));const{Letter:ei,Single:ii,Before:si,After:ni,Symbol:oi,Break:ai}=ti;function ri(t){return Qe[t]?ei:$e[t]?ai:Je[t]?si:Ke[t]?ni:Ze[t]?oi:Xe.test(t)?ii:ei}const hi={trimRight(t){const{words:e}=t;let i,s=0,n=e.length;for(let o=n-1;o>-1&&(i=e[o].data[0]," "===i.char);o--)s++,t.width-=i.width;s&&e.splice(n-s,s)}};function di(t,e,i){switch(e){case"title":return i?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:li}=hi,{Letter:ci,Single:ui,Before:fi,After:gi,Symbol:pi,Break:_i}=ti;let wi,yi,mi,vi,xi,bi,Bi,Ri,ki,Si,Li,Ei,Ti,Mi,Ai,Ci,Wi=[];function Oi(t,e){ki&&!Ri&&(Ri=ki),wi.data.push({char:t,width:e}),mi+=e}function Pi(){vi+=mi,wi.width=mi,yi.words.push(wi),wi={data:[]},mi=0}function Ii(){Mi&&(Ai.paraNumber++,yi.paraStart=!0,Mi=!1),ki&&(yi.startCharSize=Ri,yi.endCharSize=ki,Ri=0),yi.width=vi,Ci.width&&li(yi),Wi.push(yi),yi={words:[]},vi=0}const Di=0,Fi=1,zi=2;const{top:Ni,right:Vi,bottom:Ui,left:Yi}=A;function Gi(t,e,i){const{bounds:s,rows:n}=t;s[e]+=i;for(let t=0;t<n.length;t++)n[t][e]+=i}const ji={getDrawData:function(t,i){"string"!=typeof t&&(t=String(t));let s=0,n=0,o=i.__getInput("width")||0,a=i.__getInput("height")||0;const{textDecoration:r,__font:h,__padding:d}=i;d&&(o&&(s=d[Yi],o-=d[Vi]+d[Yi]),a&&(n=d[Ni],a-=d[Ni]+d[Ui]));const l={bounds:{x:s,y:n,width:o,height:a},rows:[],paraNumber:0,font:e.canvas.font=h};return function(t,i,s){Ai=t,Wi=t.rows,Ci=t.bounds;const{__letterSpacing:n,paraIndent:o,textCase:a}=s,{canvas:r}=e,{width:h,height:d}=Ci;if(h||d||n||"none"!==a){const t="none"!==s.textWrap,e="break"===s.textWrap;Mi=!0,Li=null,Ri=Bi=ki=mi=vi=0,wi={data:[]},yi={words:[]};for(let s=0,d=i.length;s<d;s++)bi=i[s],"\n"===bi?(mi&&Pi(),yi.paraEnd=!0,Ii(),Mi=!0):(Si=ri(bi),Si===ci&&"none"!==a&&(bi=di(bi,a,!mi)),Bi=r.measureText(bi).width,n&&(n<0&&(ki=Bi),Bi+=n),Ei=Si===ui&&(Li===ui||Li===ci)||Li===ui&&Si!==gi,Ti=!(Si!==fi&&Si!==ui||Li!==pi&&Li!==gi),xi=Mi&&o?h-o:h,t&&h&&vi+mi+Bi>xi&&(e?(mi&&Pi(),Ii()):(Ti||(Ti=Si===ci&&Li==gi),Ei||Ti||Si===_i||Si===fi||Si===ui||mi+Bi>xi?(mi&&Pi(),Ii()):Ii()))," "===bi&&!0!==Mi&&vi+mi===0||(Si===_i?(" "===bi&&mi&&Pi(),Oi(bi,Bi),Pi()):Ei||Ti?(mi&&Pi(),Oi(bi,Bi)):Oi(bi,Bi)),Li=Si);mi&&Pi(),vi&&Ii(),Wi.length>0&&(Wi[Wi.length-1].paraEnd=!0)}else i.split("\n").forEach((t=>{Ai.paraNumber++,Wi.push({x:o||0,text:t,width:r.measureText(t).width,paraStart:!0})}))}(l,t,i),d&&function(t,e,i,s,n){if(!s)switch(i.textAlign){case"left":Gi(e,"x",t[Yi]);break;case"right":Gi(e,"x",-t[Vi])}if(!n)switch(i.verticalAlign){case"top":Gi(e,"y",t[Ni]);break;case"bottom":Gi(e,"y",-t[Ui])}}(d,l,i,o,a),function(t,e){const{rows:i,bounds:s}=t,{__lineHeight:n,__baseLine:o,__letterSpacing:a,__clipText:r,textAlign:h,verticalAlign:d,paraSpacing:l}=e;let c,u,f,{x:g,y:p,width:_,height:w}=s,y=n*i.length+(l?l*(t.paraNumber-1):0),m=o;if(r&&y>w)y=Math.max(w,n),t.overflow=i.length;else switch(d){case"middle":p+=(w-y)/2;break;case"bottom":p+=w-y}m+=p;for(let o=0,d=i.length;o<d;o++){if(c=i[o],c.x=g,c.width<_||c.width>_&&!r)switch(h){case"center":c.x+=(_-c.width)/2;break;case"right":c.x+=_-c.width}c.paraStart&&l&&o>0&&(m+=l),c.y=m,m+=n,t.overflow>o&&m>y&&(c.isOverflow=!0,t.overflow=o+1),u=c.x,f=c.width,a<0&&(c.width<0?(f=-c.width+e.fontSize+a,u-=f,f+=e.fontSize):f-=a),u<s.x&&(s.x=u),f>s.width&&(s.width=f),r&&_&&_<f&&(c.isOverflow=!0,t.overflow||(t.overflow=i.length))}s.y=p,s.height=y}(l,i),function(t,e,i,s){const{rows:n}=t,{textAlign:o,paraIndent:a,letterSpacing:r}=e;let h,d,l,c,u;n.forEach((t=>{t.words&&(l=a&&t.paraStart?a:0,d=i&&"justify"===o&&t.words.length>1?(i-t.width-l)/(t.words.length-1):0,c=r||t.isOverflow?Di:d>.01?Fi:zi,t.isOverflow&&!r&&(t.textMode=!0),c===zi?(t.x+=l,function(t){t.text="",t.words.forEach((e=>{e.data.forEach((e=>{t.text+=e.char}))}))}(t)):(t.x+=l,h=t.x,t.data=[],t.words.forEach((e=>{c===Fi?(u={char:"",x:h},h=function(t,e,i){return t.forEach((t=>{i.char+=t.char,e+=t.width})),e}(e.data,h,u),(t.isOverflow||" "!==u.char)&&t.data.push(u)):h=function(t,e,i,s){return t.forEach((t=>{(s||" "!==t.char)&&(t.x=e,i.push(t)),e+=t.width})),e}(e.data,h,t.data,t.isOverflow),!t.paraEnd&&d&&(h+=d,t.width+=d)}))),t.words=null)}))}(l,i,o),l.overflow&&function(t,i){const{rows:s,overflow:n}=t;let{textOverflow:o}=i;if(s.splice(n),o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const r=o?e.canvas.measureText(o).width:0,h=i.x+i.width-r;("none"===i.textWrap?s:[s[n-1]]).forEach((e=>{if(e.isOverflow&&e.data){let i=e.data.length-1;for(let s=i;s>-1&&(t=e.data[s],a=t.x+t.width,!(s===i&&a<h));s--){if(a<h&&" "!==t.char){e.data.splice(s+1),e.width-=t.width;break}e.width-=t.width}e.width+=r,e.data.push({char:o,x:a}),e.textMode&&function(t){t.text="",t.data.forEach((e=>{t.text+=e.char})),t.data=null}(e)}}))}}(l,i),"none"!==r&&function(t,e){const{fontSize:i}=e;switch(t.decorationHeight=i/11,e.textDecoration){case"under":t.decorationY=.15*i;break;case"delete":t.decorationY=.35*-i}}(l,i),l}};const Hi={string:function(t,e){if("string"==typeof t)return t;let i=void 0===t.a?1:t.a;e&&(i*=e);const s=t.r+","+t.g+","+t.b;return 1===i?"rgb("+s+")":"rgba("+s+","+i+")"}},{setPoint:Xi,addPoint:qi,toBounds:Qi}=C;const Ji={export(t,i,s){return this.running=!0,function(t){Ki||(Ki=new W);return new Promise((e=>{Ki.add((()=>ue(this,void 0,void 0,(function*(){return yield t(e)}))),{parallel:!1})}))}((n=>new Promise((o=>{const r=t=>{n(t),o(),this.running=!1},{toURL:d}=e,{download:l}=e.origin,c=h.fileType(i);if("json"===i)return r({data:t.toJSON()});if("json"===c)return l(d(JSON.stringify(t.toJSON()),"text"),i),r({data:!0});if("svg"===i)return r({data:t.toSVG()});if("svg"===c)return l(d(t.toSVG(),"svg"),i),r({data:!0});const{leafer:u}=t;u?u.waitViewCompleted((()=>ue(this,void 0,void 0,(function*(){s=h.getExportOptions(s);let e,n,o=1,d=1;const{worldTransform:l,isLeafer:c,isFrame:f}=t,{slice:g,trim:p,onCanvas:w}=s;let y=s.scale||1,m=s.pixelRatio||1;t.isApp&&(y*=m,m=t.app.pixelRatio);const v=s.screenshot||t.isApp,x=c&&v&&void 0===s.fill?t.fill:s.fill,b=h.isOpaqueImage(i)||x,B=new O;if(v)e=!0===v?c?u.canvas.bounds:t.worldRenderBounds:v;else{let i=s.relative||(c?"inner":"local");switch(o=l.scaleX,d=l.scaleY,i){case"inner":B.set(l);break;case"local":B.set(l).divide(t.localTransform),o/=t.scaleX,d/=t.scaleY;break;case"world":o=1,d=1;break;case"page":i=t.leafer;default:B.set(l).divide(t.getTransform(i));const e=i.worldTransform;o/=o/e.scaleX,d/=d/e.scaleY}e=t.getBounds("render",i)}const{x:R,y:k,width:S,height:L}=new _(e).scale(y);let E=a.canvas({width:Math.round(S),height:Math.round(L),pixelRatio:m});const T={matrix:B.scale(1/y).invert().translate(-R,-k).withScale(1/o*y,1/d*y)};if(g&&(t=u,T.bounds=E.bounds),E.save(),f&&void 0!==x){const e=t.get("fill");t.fill="",t.__render(E,T),t.fill=e}else t.__render(E,T);if(E.restore(),p){n=function(t){const{width:e,height:i}=t.view,{data:s}=t.context.getImageData(0,0,e,i);let n,o,a,r=0;for(let t=0;t<s.length;t+=4)0!==s[t+3]&&(n=r%e,o=(r-n)/e,a?qi(a,n,o):Xi(a={},n,o)),r++;const h=new _;return Qi(a,h),h.scale(1/t.pixelRatio).ceil()}(E);const t=E,{width:e,height:i}=n,s={x:0,y:0,width:e,height:i,pixelRatio:m};E=a.canvas(s),E.copyWorld(t,n,s)}b&&E.fillWorld(E.bounds,x||"#FFFFFF","destination-over"),w&&w(E);const M="canvas"===i?E:yield E.export(i,s);r({data:M,width:E.pixelWidth,height:E.pixelHeight,renderBounds:e,trimBounds:n})})))):r({data:!1})}))))}};let Ki;const Zi=t.prototype,$i=y.get("@leafer-ui/export");Zi.export=function(t,e){const{quality:i,blob:s}=h.getExportOptions(e);return t.includes(".")?this.saveAs(t,i):s?this.toBlob(t,i):this.toDataURL(t,i)},Zi.toBlob=function(t,i){return new Promise((s=>{e.origin.canvasToBolb(this.view,t,i).then((t=>{s(t)})).catch((t=>{$i.error(t),s(null)}))}))},Zi.toDataURL=function(t,i){return e.origin.canvasToDataURL(this.view,t,i)},Zi.saveAs=function(t,i){return new Promise((s=>{e.origin.canvasSaveAs(this.view,t,i).then((()=>{s(!0)})).catch((t=>{$i.error(t),s(!1)}))}))},Object.assign(G,ji),Object.assign(N,Hi),Object.assign(j,Ot),Object.assign(z,ge),Object.assign(V,Ce),Object.assign(H,Ne),Object.assign(U,Ji),Object.assign(a,{interaction:(t,e,i,s)=>new bt(t,e,i,s),hitCanvas:(t,e)=>new X(t,e),hitCanvasManager:()=>new D});try{J(0,wx)}catch(t){}X.prototype.__createContext=function(){if(this.viewSelect){const t=F.origin.createCanvas(1,1),e=this.view.getContext("2d");this.testView=this.view,this.testContext=e,this.view=t}this.context=this.view.getContext("2d"),this.__bindContext()},X.prototype.updateRender=function(){if(this.testView){let t=this.context.createPattern(this.view,F.origin.noRepeat);this.testContext.clearRect(0,0,this.view.width,this.view.height),this.testContext.fillStyle=t,this.testContext.fillRect(0,0,this.view.width,this.view.height),this.testContext.fillStyle=t=null}},X.prototype.updateViewSize=function(){const{width:t,height:e,pixelRatio:i,view:s,testView:n}=this;s.width=t*i,s.height=e*i,n&&(n.width=s.width,n.height=s.height)};export{bt as Interaction,dt as Layouter,X as LeaferCanvas,ct as Renderer,vt as Selector,K as Watcher,J as useCanvas};
|
|
1
|
+
import{LeaferCanvasBase as t,Platform as e,canvasPatch as i,DataHelper as s,canvasSizeAttrs as n,ResizeEvent as o,Creator as a,LeaferImage as r,FileHelper as h,LeafList as d,RenderEvent as l,ChildEvent as c,WatchEvent as u,PropertyEvent as f,LeafHelper as g,BranchHelper as p,Bounds as _,LeafBoundsHelper as w,Debug as m,LeafLevelList as y,LayoutEvent as v,Run as x,ImageManager as b,AnimateEvent as B,BoundsHelper as R,Answer as k,MatrixHelper as S,AlignHelper as L,ImageEvent as E,AroundHelper as T,PointHelper as M,Direction4 as A,TwoPointBoundsHelper as C,TaskProcessor as W,Matrix as O}from"@leafer/core";export*from"@leafer/core";export{LeaferImage}from"@leafer/core";import{InteractionHelper as P,InteractionBase as I,HitCanvasManager as D,Platform as F}from"@leafer-ui/core";export*from"@leafer-ui/core";import{PaintImage as z,ColorConvert as N,PaintGradient as V,Export as U,Group as Y,TextConvert as G,Paint as j,Effect as H}from"@leafer-ui/draw";class X extends t{get allowBackgroundColor(){return!1}init(){let{view:t}=this.config;t?("string"==typeof t?("#"!==t[0]&&(t="#"+t),this.viewSelect=e.miniapp.select(t)):t.fields?this.viewSelect=t:this.initView(t),this.viewSelect&&e.miniapp.getSizeView(this.viewSelect).then((t=>{this.initView(t)}))):this.initView()}initView(t){t?this.view=t.view||t:(t={},this.__createView()),this.__createContext();const{width:e,height:s,pixelRatio:n}=this.config,o={width:e||t.width,height:s||t.height,pixelRatio:n};this.resize(o),this.context.roundRect&&(this.roundRect=function(t,e,i,s,n){this.context.roundRect(t,e,i,s,"number"==typeof n?[n]:n)}),i(this.context.__proto__)}__createView(){this.view=e.origin.createCanvas(1,1)}updateViewSize(){const{width:t,height:e,pixelRatio:i}=this;this.view.width=Math.ceil(t*i),this.view.height=Math.ceil(e*i)}updateClientBounds(t){this.viewSelect&&e.miniapp.getBounds(this.viewSelect).then((e=>{this.clientBounds=e,t&&t()}))}startAutoLayout(t,i){this.resizeListener=i,this.checkSize=this.checkSize.bind(this),e.miniapp.onWindowResize(this.checkSize)}checkSize(){this.viewSelect&&setTimeout((()=>{this.updateClientBounds((()=>{const{width:t,height:e}=this.clientBounds,{pixelRatio:i}=this,a={width:t,height:e,pixelRatio:i};if(!this.isSameSize(a)){const t={};s.copyAttrs(t,this,n),this.resize(a),void 0!==this.width&&this.resizeListener(new o(a,t))}}))}),500)}stopAutoLayout(){this.autoLayout=!1,this.resizeListener=null,e.miniapp.offWindowResize(this.checkSize)}}const{mineType:q,fileType:Q}=h;function J(t,i){e.origin||(e.origin={createCanvas:(t,e,s)=>i.createOffscreenCanvas({type:"2d",width:t,height:e}),canvasToDataURL:(t,e,i)=>t.toDataURL(q(e),i),canvasToBolb:(t,e,i)=>t.toBuffer(e,{quality:i}),canvasSaveAs:(t,i,s)=>{let n=t.toDataURL(q(Q(i)),s);return n=n.substring(n.indexOf("64,")+3),e.origin.download(n,i)},download:(t,s)=>new Promise(((n,o)=>{let a;s.includes("/")||(s=`${i.env.USER_DATA_PATH}/`+s,a=!0);const r=i.getFileSystemManager();r.writeFile({filePath:s,data:t,encoding:"base64",success(){a?e.miniapp.saveToAlbum(s).then((()=>{r.unlink({filePath:s}),n()})):n()},fail(t){o(t)}})})),loadImage:t=>new Promise(((i,s)=>{const n=e.canvas.view.createImage();n.onload=()=>{i(n)},n.onerror=t=>{s(t)},n.src=e.image.getRealURL(t)})),noRepeat:"repeat-x"},e.miniapp={select:t=>i.createSelectorQuery().select(t),getBounds:t=>new Promise((e=>{t.boundingClientRect().exec((t=>{const i=t[1];e({x:i.top,y:i.left,width:i.width,height:i.height})}))})),getSizeView:t=>new Promise((e=>{t.fields({node:!0,size:!0}).exec((t=>{const i=t[0];e({view:i.node,width:i.width,height:i.height})}))})),saveToAlbum:t=>new Promise((e=>{i.getSetting({success:s=>{s.authSetting["scope.writePhotosAlbum"]?i.saveImageToPhotosAlbum({filePath:t,success(){e(!0)}}):i.authorize({scope:"scope.writePhotosAlbum",success:()=>{i.saveImageToPhotosAlbum({filePath:t,success(){e(!0)}})},fail:()=>{}})}})})),onWindowResize(t){i.onWindowResize(t)},offWindowResize(t){i.offWindowResize(t)}},e.event={stopDefault(t){},stopNow(t){},stop(t){}},e.canvas=a.canvas(),e.conicGradientSupport=!!e.canvas.context.createConicGradient)}Object.assign(a,{canvas:(t,e)=>new X(t,e),image:t=>new r(t)}),e.name="miniapp",e.requestRender=function(t){e.canvas.view.requestAnimationFrame(t)},e.devicePixelRatio=wx.getSystemInfoSync().pixelRatio;class K{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove){const t=new d;return this.__updatedList.list.forEach((e=>{e.leafer&&t.add(e)})),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new d,this.target=t,e&&(this.config=s.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(l.REQUEST)}__onAttrChange(t){this.__updatedList.add(t.target),this.update()}__onChildEvent(t){t.type===c.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent)),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,i=e.length;t<i;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new u(u.DATA,{updatedList:this.updatedList})),this.__updatedList=new d,this.totalTimes++,this.changed=!1,this.hasVisible=!1,this.hasRemove=!1,this.hasAdd=!1}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(f.CHANGE,this.__onAttrChange,this),t.on_([c.ADD,c.REMOVE],this.__onChildEvent,this),t.on_(u.REQUEST,this.__onRquestData,this)]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=null,this.__updatedList=null)}}const{updateAllMatrix:Z,updateBounds:$,updateAllWorldOpacity:tt}=g,{pushAllChildBranch:et,pushAllParent:it}=p;const{worldBounds:st}=w,nt={x:0,y:0,width:1e5,height:1e5};class ot{constructor(t){this.updatedBounds=new _,this.beforeBounds=new _,this.afterBounds=new _,t instanceof Array&&(t=new d(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,st)}setAfter(){const{list:t}=this.updatedList;t.some((t=>t.noBounds))?this.afterBounds.set(nt):this.afterBounds.setListWithFn(t,st),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:at,updateAllChange:rt}=g,ht=m.get("Layouter");class dt{constructor(t,e){this.totalTimes=0,this.config={},this.__levelList=new y,this.target=t,e&&(this.config=s.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(!this.running)return;const{target:t}=this;this.times=0;try{t.emit(v.START),this.layoutOnce(),t.emitEvent(new v(v.END,this.layoutedBlocks,this.times))}catch(t){ht.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?ht.warn("layouting"):this.times>3?ht.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(u.REQUEST),this.totalTimes>1?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=x.start("PartLayout"),{target:i,__updatedList:s}=this,{BEFORE:n,LAYOUT:o,AFTER:a}=v,r=this.getBlocks(s);r.forEach((t=>t.setBefore())),i.emitEvent(new v(n,r,this.times)),this.extraBlock=null,s.sort(),function(t,e){let i;t.list.forEach((t=>{i=t.__layout,e.without(t)&&!i.proxyZoom&&(i.matrixChanged?(Z(t,!0),e.add(t),t.isBranch&&et(t,e),it(t,e)):i.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),it(t,e)))}))}(s,this.__levelList),function(t){let e,i,s;t.sort(!0),t.levels.forEach((n=>{e=t.levelMap[n];for(let t=0,n=e.length;t<n;t++){if(i=e[t],i.isBranch&&i.__tempNumber){s=i.children;for(let t=0,e=s.length;t<e;t++)s[t].isBranch||$(s[t])}$(i)}}))}(this.__levelList),function(t){t.list.forEach((t=>{t.__layout.opacityChanged&&tt(t),t.__updateChange()}))}(s),this.extraBlock&&r.push(this.extraBlock),r.forEach((t=>t.setAfter())),i.emitEvent(new v(o,r,this.times)),i.emitEvent(new v(a,r,this.times)),this.addBlocks(r),this.__levelList.reset(),this.__updatedList=null,x.end(e)}fullLayout(){const t=x.start("FullLayout"),{target:e}=this,{BEFORE:i,LAYOUT:s,AFTER:n}=v,o=this.getBlocks(new d(e));e.emitEvent(new v(i,o,this.times)),dt.fullLayout(e),o.forEach((t=>{t.setAfter()})),e.emitEvent(new v(s,o,this.times)),e.emitEvent(new v(n,o,this.times)),this.addBlocks(o),x.end(t)}static fullLayout(t){at(t,!0),t.isBranch?p.updateBounds(t):g.updateBounds(t),rt(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:i}=this.extraBlock||(this.extraBlock=new ot([]));e.length?i.add(t.__world):i.set(t.__world),e.add(t)}}createBlock(t){return new ot(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(v.REQUEST,this.layout,this),t.on_(v.AGAIN,this.layoutAgain,this),t.on_(u.DATA,this.__onReceiveWatchData,this)]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const lt=m.get("Renderer");class ct{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,i){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,maxFPS:60},this.target=t,this.canvas=e,i&&(this.config=s.default(i,this.config)),this.__listenEvents(),this.__requestRender()}start(){this.running=!0}stop(){this.running=!1}update(){this.changed=!0}requestLayout(){this.target.emit(v.REQUEST)}render(t){if(!this.running||!this.canvas.view)return void(this.changed=!0);const{target:e}=this;this.times=0,this.totalBounds=new _,lt.log(e.innerName,"---\x3e");try{this.emitRender(l.START),this.renderOnce(t),this.emitRender(l.END,this.totalBounds),b.clearRecycled()}catch(t){this.rendering=!1,lt.error(t)}lt.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return lt.warn("rendering");if(this.times>3)return lt.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new _,this.renderOptions={},t)this.emitRender(l.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(l.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(l.RENDER,this.renderBounds,this.renderOptions),this.emitRender(l.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;if(!e)return lt.warn("PartRender: need update attr");this.mergeBlocks(),e.forEach((e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(t){const e=x.start("PartRender"),{canvas:i}=this,s=t.getIntersect(i.bounds),n=t.includes(this.target.__world),o=new _(s);i.save(),n&&!m.showRepaint?i.clear():(s.spread(10+1/this.canvas.pixelRatio).ceil(),i.clearWorld(s,!0),i.clipWorld(s,!0)),this.__render(s,n,o),i.restore(),x.end(e)}fullRender(){const t=x.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds,!0),e.restore(),x.end(t)}__render(t,e,i){const s=t.includes(this.target.__world)?{includes:e}:{bounds:t,includes:e};this.needFill&&this.canvas.fillWorld(t,this.config.fill),m.showRepaint&&this.canvas.strokeWorld(t,"red"),this.target.__render(this.canvas,s),this.renderBounds=i||t,this.renderOptions=s,this.totalBounds.isEmpty()?this.totalBounds=this.renderBounds:this.totalBounds.add(this.renderBounds),m.showHitView&&this.renderHitView(s),m.showBoundsView&&this.renderBoundsView(s),this.canvas.updateRender()}renderHitView(t){}renderBoundsView(t){}addBlock(t){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new _;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=Date.now();e.requestRender((()=>{this.FPS=Math.min(60,Math.ceil(1e3/(Date.now()-t))),this.running&&(this.target.emit(B.FRAME),this.changed&&this.canvas.view&&this.render(),this.target.emit(l.NEXT)),this.target&&this.__requestRender()}))}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:i}=t.old;if(!new _(0,0,e,i).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new _(0,0,1,1)),this.changed=!0}}__onLayoutEnd(t){t.data&&t.data.map((t=>{let e;t.updatedList&&t.updatedList.list.some((t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||lt.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e))),this.addBlock(e?this.canvas.bounds:t.updatedBounds)}))}emitRender(t,e,i){this.target.emitEvent(new l(t,this.times,e,i))}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(l.REQUEST,this.update,this),t.on_(v.END,this.__onLayoutEnd,this),t.on_(l.AGAIN,this.renderAgain,this),t.on_(o.RESIZE,this.__onResize,this)]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.canvas=this.config=null)}}const{hitRadiusPoint:ut}=R;class ft{constructor(t,e){this.target=t,this.selector=e}getByPoint(t,e,i){e||(e=0),i||(i={});const s=i.through||!1,n=i.ignoreHittable||!1,o=i.target||this.target;this.exclude=i.exclude||null,this.point={x:t.x,y:t.y,radiusX:e,radiusY:e},this.findList=new d(i.findList),i.findList||this.hitBranch(o);const{list:a}=this.findList,r=this.getBestMatchLeaf(a,i.bottomList,n),h=n?this.getPath(r):this.getHitablePath(r);return this.clear(),s?{path:h,target:r,throughPath:a.length?this.getThroughPath(a):h}:{path:h,target:r}}getBestMatchLeaf(t,e,i){if(t.length){let e;this.findList=new d;const{x:s,y:n}=this.point,o={x:s,y:n,radiusX:0,radiusY:0};for(let s=0,n=t.length;s<n;s++)if(e=t[s],(i||g.worldHittable(e))&&(this.hitChild(e,o),this.findList.length))return this.findList.list[0]}if(e)for(let t=0,i=e.length;t<i;t++)if(this.hitChild(e[t].target,this.point,e[t].proxy),this.findList.length)return this.findList.list[0];return t[0]}getPath(t){const e=new d;for(;t;)e.add(t),t=t.parent;return e.add(this.target),e}getHitablePath(t){const e=this.getPath(t&&t.hittable?t:null);let i,s=new d;for(let t=e.list.length-1;t>-1&&(i=e.list[t],i.__.hittable)&&(s.addAt(i,0),i.__.hitChildren);t--);return s}getThroughPath(t){const e=new d,i=[];for(let e=t.length-1;e>-1;e--)i.push(this.getPath(t[e]));let s,n,o;for(let t=0,a=i.length;t<a;t++){s=i[t],n=i[t+1];for(let t=0,i=s.length;t<i&&(o=s.list[t],!n||!n.has(o));t++)e.add(o)}return e}hitBranch(t){this.eachFind(t.children,t.__onlyHitMask)}eachFind(t,e){let i,s;const{point:n}=this;for(let o=t.length-1;o>-1;o--)i=t[o],!i.__.visible||e&&!i.__.mask||(s=!!i.__.hitRadius||ut(i.__world,n),i.isBranch?(s||i.__ignoreHitWorld)&&(this.eachFind(i.children,i.__onlyHitMask),i.isBranchLeaf&&!this.findList.length&&this.hitChild(i,n)):s&&this.hitChild(i,n))}hitChild(t,e,i){if((!this.exclude||!this.exclude.has(t))&&t.__hitWorld(e)){const{parent:s}=t;if(s&&s.__hasMask&&!t.__.mask&&!s.children.some((t=>t.__.mask&&t.__hitWorld(e))))return;this.findList.add(i||t)}}clear(){this.point=null,this.findList=null,this.exclude=null}destroy(){this.clear()}}const{Yes:gt,NoAndSkip:pt,YesAndSkip:_t}=k,wt={},mt={},yt={};class vt{constructor(t,e){this.config={},this.innerIdMap={},this.idMap={},this.methods={id:(t,e)=>t.id===e?(this.idMap[e]=t,1):0,innerId:(t,e)=>t.innerId===e?(this.innerIdMap[e]=t,1):0,className:(t,e)=>t.className===e?1:0,tag:(t,e)=>t.__tag===e?1:0,tags:(t,e)=>e[t.__tag]?1:0},this.target=t,e&&(this.config=s.default(e,this.config)),this.picker=new ft(t,this),this.__listenEvents()}getBy(t,e,i,n){switch(typeof t){case"number":const o=this.getByInnerId(t,e);return i?o:o?[o]:[];case"string":switch(t[0]){case"#":wt.id=t.substring(1),t=wt;break;case".":mt.className=t.substring(1),t=mt;break;default:yt.tag=t,t=yt}case"object":if(void 0!==t.id){const s=this.getById(t.id,e);return i?s:s?[s]:[]}if(t.tag){const{tag:n}=t,o=n instanceof Array;return this.getByMethod(o?this.methods.tags:this.methods.tag,e,i,o?s.toMap(n):n)}return this.getByMethod(this.methods.className,e,i,t.className);case"function":return this.getByMethod(t,e,i,n)}}getByPoint(t,i,s){return"node"===e.name&&this.target.emit(v.CHECK_UPDATE),this.picker.getByPoint(t,i,s)}getByInnerId(t,e){const i=this.innerIdMap[t];return i||(this.eachFind(this.toChildren(e),this.methods.innerId,null,t),this.findLeaf)}getById(t,e){const i=this.idMap[t];return i&&g.hasParent(i,e||this.target)?i:(this.eachFind(this.toChildren(e),this.methods.id,null,t),this.findLeaf)}getByClassName(t,e){return this.getByMethod(this.methods.className,e,!1,t)}getByTag(t,e){return this.getByMethod(this.methods.tag,e,!1,t)}getByMethod(t,e,i,s){const n=i?null:[];return this.eachFind(this.toChildren(e),t,n,s),n||this.findLeaf}eachFind(t,e,i,s){let n,o;for(let a=0,r=t.length;a<r;a++){if(n=t[a],o=e(n,s),o===gt||o===_t){if(!i)return void(this.findLeaf=n);i.push(n)}n.isBranch&&o<pt&&this.eachFind(n.children,e,i,s)}}toChildren(t){return this.findLeaf=null,[t||this.target]}__onRemoveChild(t){const{id:e,innerId:i}=t.child;this.idMap[e]&&delete this.idMap[e],this.innerIdMap[i]&&delete this.innerIdMap[i]}__checkIdChange(t){if("id"===t.attrName){const e=t.oldValue;this.idMap[e]&&delete this.idMap[e]}}__listenEvents(){this.__eventIds=[this.target.on_(c.REMOVE,this.__onRemoveChild,this),this.target.on_(f.CHANGE,this.__checkIdChange,this)]}__removeListenEvents(){this.target.off_(this.__eventIds),this.__eventIds.length=0}destroy(){this.__eventIds.length&&(this.__removeListenEvents(),this.picker.destroy(),this.findLeaf=null,this.innerIdMap={},this.idMap={})}}Object.assign(a,{watcher:(t,e)=>new K(t,e),layouter:(t,e)=>new dt(t,e),renderer:(t,e,i)=>new ct(t,e,i),selector:(t,e)=>new vt(t,e)}),e.layout=dt.fullLayout;const xt={convertTouch(t,e){const i=xt.getTouch(t),s=P.getBase(t);return Object.assign(Object.assign({},s),{x:e.x,y:e.y,width:1,height:1,pointerType:"touch",pressure:i.force||1})},getTouch:t=>t.touches[0]||t.changedTouches[0]};class bt extends I{__listenEvents(){super.__listenEvents(),this.config.eventer&&(this.config.eventer.receiveEvent=this.receive.bind(this))}receive(t){switch(t.type){case"touchstart":this.onTouchStart(t);break;case"touchmove":this.onTouchMove(t);break;case"touchend":this.onTouchEnd(t);break;case"touchcancel":this.onTouchCancel()}}getLocal(t,e){return void 0!==t.x?{x:t.x,y:t.y}:super.getLocal(t,e)}getTouches(t){return t}onTouchStart(t){this.multiTouchStart(t);const e=xt.getTouch(t);this.pointerDown(xt.convertTouch(t,this.getLocal(e,!0)))}onTouchMove(t){if(this.multiTouchMove(t),this.useMultiTouch)return;const e=xt.getTouch(t);this.pointerMove(xt.convertTouch(t,this.getLocal(e)))}onTouchEnd(t){this.multiTouchEnd();const e=xt.getTouch(t);this.pointerUp(xt.convertTouch(t,this.getLocal(e)))}onTouchCancel(){this.pointerCancel()}multiTouchStart(t){this.useMultiTouch=t.touches.length>=2,this.touches=this.useMultiTouch?this.getTouches(t.touches):void 0,this.useMultiTouch&&this.pointerCancel()}multiTouchMove(t){if(this.useMultiTouch&&t.touches.length>1){const e=this.getTouches(t.touches),i=this.getKeepTouchList(this.touches,e);i.length>1&&(this.multiTouch(P.getBase(t),i),this.touches=e)}}multiTouchEnd(){this.touches=null,this.useMultiTouch=!1,this.transformEnd()}getKeepTouchList(t,e){let i;const s=[];return t.forEach((t=>{i=e.find((e=>e.identifier===t.identifier)),i&&s.push({from:this.getLocal(t),to:this.getLocal(i)})})),s}getLocalTouchs(t){return t.map((t=>this.getLocal(t)))}destroy(){super.destroy(),this.touches=null}}function Bt(t,e){let i;const{rows:s,decorationY:n,decorationHeight:o}=t.__.__textDrawData;for(let t=0,a=s.length;t<a;t++)i=s[t],i.text?e.fillText(i.text,i.x,i.y):i.data&&i.data.forEach((t=>{e.fillText(t.char,t.x,i.y)})),n&&e.fillRect(i.x,i.y+n,i.width,o)}function Rt(t,e,i){const{strokeAlign:s}=e.__,n="string"!=typeof t;switch(s){case"center":i.setStroke(n?void 0:t,e.__.strokeWidth,e.__),n?Lt(t,!0,e,i):St(e,i);break;case"inside":kt("inside",t,n,e,i);break;case"outside":kt("outside",t,n,e,i)}}function kt(t,e,i,s,n){const{__strokeWidth:o,__font:a}=s.__,r=n.getSameCanvas(!0,!0);r.setStroke(i?void 0:e,2*o,s.__),r.font=a,i?Lt(e,!0,s,r):St(s,r),r.blendMode="outside"===t?"destination-out":"destination-in",Bt(s,r),r.blendMode="normal",s.__worldFlipped?n.copyWorldByReset(r,s.__nowWorld):n.copyWorldToInner(r,s.__nowWorld,s.__layout.renderBounds),r.recycle(s.__nowWorld)}function St(t,e){let i;const{rows:s,decorationY:n,decorationHeight:o}=t.__.__textDrawData;for(let t=0,a=s.length;t<a;t++)i=s[t],i.text?e.strokeText(i.text,i.x,i.y):i.data&&i.data.forEach((t=>{e.strokeText(t.char,t.x,i.y)})),n&&e.strokeRect(i.x,i.y+n,i.width,o)}function Lt(t,e,i,s){let n;for(let o=0,a=t.length;o<a;o++)n=t[o],n.image&&z.checkImage(i,s,n,!1)||n.style&&(s.strokeStyle=n.style,n.blendMode?(s.saveBlendMode(n.blendMode),e?St(i,s):s.stroke(),s.restoreBlendMode()):e?St(i,s):s.stroke())}const{getSpread:Et,getOuterOf:Tt,getByMove:Mt,getIntersectData:At}=R;let Ct;function Wt(t,e,i){if("object"!=typeof e||!1===e.visible||0===e.opacity)return;const{boxBounds:s}=i.__layout;switch(e.type){case"solid":let{type:n,blendMode:o,color:a,opacity:r}=e;return{type:n,blendMode:o,style:N.string(a,r)};case"image":return z.image(i,t,e,s,!Ct||!Ct[e.url]);case"linear":return V.linearGradient(e,s);case"radial":return V.radialGradient(e,s);case"angular":return V.conicGradient(e,s);default:return void 0!==e.r?{type:"solid",style:N.string(e)}:void 0}}const Ot={compute:function(t,e){const i=e.__,s=[];let n,o=i.__input[t];o instanceof Array||(o=[o]),Ct=z.recycleImage(t,i);for(let i,n=0,a=o.length;n<a;n++)i=Wt(t,o[n],e),i&&s.push(i);i["_"+t]=s.length?s:void 0,s.length&&s[0].image&&(n=s[0].image.hasOpacityPixel),"fill"===t?i.__pixelFill=n:i.__pixelStroke=n},fill:function(t,e,i){i.fillStyle=t,e.__.__font?Bt(e,i):e.__.windingRule?i.fill(e.__.windingRule):i.fill()},fills:function(t,e,i){let s;const{windingRule:n,__font:o}=e.__;for(let a=0,r=t.length;a<r;a++)s=t[a],s.image&&z.checkImage(e,i,s,!o)||s.style&&(i.fillStyle=s.style,s.transform?(i.save(),i.transform(s.transform),s.blendMode&&(i.blendMode=s.blendMode),o?Bt(e,i):n?i.fill(n):i.fill(),i.restore()):s.blendMode?(i.saveBlendMode(s.blendMode),o?Bt(e,i):n?i.fill(n):i.fill(),i.restoreBlendMode()):o?Bt(e,i):n?i.fill(n):i.fill())},fillText:Bt,stroke:function(t,e,i){const s=e.__,{__strokeWidth:n,strokeAlign:o,__font:a}=s;if(n)if(a)Rt(t,e,i);else switch(o){case"center":i.setStroke(t,n,s),i.stroke();break;case"inside":i.save(),i.setStroke(t,2*n,s),s.windingRule?i.clip(s.windingRule):i.clip(),i.stroke(),i.restore();break;case"outside":const o=i.getSameCanvas(!0,!0);o.setStroke(t,2*n,s),e.__drawRenderPath(o),o.stroke(),s.windingRule?o.clip(s.windingRule):o.clip(),o.clearWorld(e.__layout.renderBounds),e.__worldFlipped?i.copyWorldByReset(o,e.__nowWorld):i.copyWorldToInner(o,e.__nowWorld,e.__layout.renderBounds),o.recycle(e.__nowWorld)}},strokes:function(t,e,i){const s=e.__,{__strokeWidth:n,strokeAlign:o,__font:a}=s;if(n)if(a)Rt(t,e,i);else switch(o){case"center":i.setStroke(void 0,n,s),Lt(t,!1,e,i);break;case"inside":i.save(),i.setStroke(void 0,2*n,s),s.windingRule?i.clip(s.windingRule):i.clip(),Lt(t,!1,e,i),i.restore();break;case"outside":const{renderBounds:o}=e.__layout,a=i.getSameCanvas(!0,!0);e.__drawRenderPath(a),a.setStroke(void 0,2*n,s),Lt(t,!1,e,a),s.windingRule?a.clip(s.windingRule):a.clip(),a.clearWorld(o),e.__worldFlipped?i.copyWorldByReset(a,e.__nowWorld):i.copyWorldToInner(a,e.__nowWorld,o),a.recycle(e.__nowWorld)}},strokeText:Rt,drawTextStroke:St,shape:function(t,e,i){const s=e.getSameCanvas(),n=t.__nowWorld;let o,a,r,h,{scaleX:d,scaleY:l}=n;if(d<0&&(d=-d),l<0&&(l=-l),e.bounds.includes(n))h=s,o=r=n;else{const{renderShapeSpread:s}=t.__layout,c=At(s?Et(e.bounds,d===l?s*d:[s*l,s*d]):e.bounds,n);a=e.bounds.getFitMatrix(c);let{a:u,d:f}=a;if(a.a<1&&(h=e.getSameCanvas(),t.__renderShape(h,i),d*=u,l*=f),r=Tt(n,a),o=Mt(r,-a.e,-a.f),i.matrix){const{matrix:t}=i;a.multiply(t),u*=t.scaleX,f*=t.scaleY}i=Object.assign(Object.assign({},i),{matrix:a.withScale(u,f)})}return t.__renderShape(s,i),{canvas:s,matrix:a,bounds:o,worldCanvas:h,shapeBounds:r,scaleX:d,scaleY:l}}};let Pt={};const{get:It,rotateOfOuter:Dt,translate:Ft,scaleOfOuter:zt,scale:Nt,rotate:Vt}=S;function Ut(t,e,i,s,n,o,a){const r=It();Ft(r,e.x+i,e.y+s),Nt(r,n,o),a&&Dt(r,{x:e.x+e.width/2,y:e.y+e.height/2},a),t.transform=r}function Yt(t,e,i,s,n,o,a){const r=It();Ft(r,e.x+i,e.y+s),n&&Nt(r,n,o),a&&Vt(r,a),t.transform=r}function Gt(t,e,i,s,n,o,a,r,h,d){const l=It();if(h)if("center"===d)Dt(l,{x:i/2,y:s/2},h);else switch(Vt(l,h),h){case 90:Ft(l,s,0);break;case 180:Ft(l,i,s);break;case 270:Ft(l,0,i)}Pt.x=e.x+n,Pt.y=e.y+o,Ft(l,Pt.x,Pt.y),a&&zt(l,Pt,a,r),t.transform=l}const{get:jt,translate:Ht}=S,Xt=new _,qt={};function Qt(t,e,i,s){const{blendMode:n}=i;n&&(t.blendMode=n),t.data=Jt(i,s,e)}function Jt(t,e,i){let{width:s,height:n}=i;t.padding&&(e=Xt.set(e).shrink(t.padding));const{opacity:o,mode:a,align:r,offset:h,scale:d,size:l,rotation:c,repeat:u}=t,f=e.width===s&&e.height===n,g={mode:a},p="center"!==r&&(c||0)%180==90,_=p?n:s,w=p?s:n;let m,y,v=0,x=0;if(a&&"cover"!==a&&"fit"!==a)l?(m=("number"==typeof l?l:l.width)/s,y=("number"==typeof l?l:l.height)/n):d&&(m="number"==typeof d?d:d.x,y="number"==typeof d?d:d.y);else if(!f||c){const t=e.width/_,i=e.height/w;m=y="fit"===a?Math.min(t,i):Math.max(t,i),v+=(e.width-s*m)/2,x+=(e.height-n*y)/2}if(r){const t={x:v,y:x,width:_,height:w};m&&(t.width*=m,t.height*=y),L.toPoint(r,t,e,qt,!0),v+=qt.x,x+=qt.y}switch(h&&(v+=h.x,x+=h.y),a){case"strench":f||(s=e.width,n=e.height);break;case"normal":case"clip":(v||x||m||c)&&Yt(g,e,v,x,m,y,c);break;case"repeat":(!f||m||c)&&Gt(g,e,s,n,v,x,m,y,c,r),u||(g.repeat="repeat");break;default:m&&Ut(g,e,v,x,m,y,c)}return g.transform||(e.x||e.y)&&(g.transform=jt(),Ht(g.transform,e.x,e.y)),m&&"strench"!==a&&(g.scaleX=m,g.scaleY=y),g.width=s,g.height=n,o&&(g.opacity=o),u&&(g.repeat="string"==typeof u?"x"===u?"repeat-x":"repeat-y":"repeat"),g}let Kt,Zt=new _;const{isSame:$t}=R;function te(t,e,i,s,n,o){if("fill"===e&&!t.__.__naturalWidth){const e=t.__;if(e.__naturalWidth=s.width/e.pixelRatio,e.__naturalHeight=s.height/e.pixelRatio,e.__autoSide)return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",e.width),t.setProxyAttr("height",e.height)),!1}return n.data||Qt(n,s,i,o),!0}function ee(t,e){ne(t,E.LOAD,e)}function ie(t,e){ne(t,E.LOADED,e)}function se(t,e,i){e.error=i,t.forceUpdate("surface"),ne(t,E.ERROR,e)}function ne(t,e,i){t.hasEvent(e)&&t.emitEvent(new E(e,i))}function oe(t,e){const{leafer:i}=t;i&&i.viewReady&&(i.renderer.ignore=e)}const{get:ae,scale:re,copy:he}=S,{ceil:de,abs:le}=Math;function ce(t,i,s){let{scaleX:n,scaleY:o}=b.patternLocked?t.__world:t.__nowWorld;const a=n+"-"+o;if(i.patternId===a||t.destroyed)return!1;{n=le(n),o=le(o);const{image:t,data:r}=i;let h,d,{width:l,height:c,scaleX:u,scaleY:f,opacity:g,transform:p,repeat:_}=r;u&&(d=ae(),he(d,p),re(d,1/u,1/f),n*=u,o*=f),n*=s,o*=s,l*=n,c*=o;const w=l*c;if(!_&&w>e.image.maxCacheSize)return!1;let m=e.image.maxPatternSize;if(!t.isSVG){const e=t.width*t.height;m>e&&(m=e)}w>m&&(h=Math.sqrt(w/m)),h&&(n/=h,o/=h,l/=h,c/=h),u&&(n/=u,o/=f),(p||1!==n||1!==o)&&(d||(d=ae(),p&&he(d,p)),re(d,1/n,1/o));const y=t.getCanvas(de(l)||1,de(c)||1,g),v=t.getPattern(y,_||e.origin.noRepeat||"no-repeat",d,i);return i.style=v,i.patternId=a,!0}}function ue(t,e,i,s){return new(i||(i=Promise))((function(n,o){function a(t){try{h(s.next(t))}catch(t){o(t)}}function r(t){try{h(s.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,r)}h((s=s.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const{abs:fe}=Math;const ge={image:function(t,e,i,s,n){let o,a;const r=b.get(i);return Kt&&i===Kt.paint&&$t(s,Kt.boxBounds)?o=Kt.leafPaint:(o={type:i.type,image:r},Kt=r.use>1?{leafPaint:o,paint:i,boxBounds:Zt.set(s)}:null),(n||r.loading)&&(a={image:r,attrName:e,attrValue:i}),r.ready?(te(t,e,i,r,o,s),n&&(ee(t,a),ie(t,a))):r.error?n&&se(t,a,r.error):(oe(t,!0),n&&ee(t,a),o.loadId=r.load((()=>{oe(t,!1),t.destroyed||(te(t,e,i,r,o,s)&&(r.hasOpacityPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),ie(t,a)),o.loadId=null}),(e=>{oe(t,!1),se(t,a,e),o.loadId=null}))),o},checkImage:function(t,i,s,n){const{scaleX:o,scaleY:a}=b.patternLocked?t.__world:t.__nowWorld;if(s.data&&s.patternId!==o+"-"+a){const{data:r}=s;if(n)if(r.repeat)n=!1;else{let{width:t,height:s}=r;t*=fe(o)*i.pixelRatio,s*=fe(a)*i.pixelRatio,r.scaleX&&(t*=r.scaleX,s*=r.scaleY),n=t*s>e.image.maxCacheSize||U.running}return n?(i.save(),i.clip(),s.blendMode&&(i.blendMode=s.blendMode),r.opacity&&(i.opacity*=r.opacity),r.transform&&i.transform(r.transform),i.drawImage(s.image.view,0,0,r.width,r.height),i.restore(),!0):(!s.style||U.running?ce(t,s,i.pixelRatio):s.patternTask||(s.patternTask=b.patternTasker.add((()=>ue(this,void 0,void 0,(function*(){s.patternTask=null,i.bounds.hit(t.__nowWorld)&&ce(t,s,i.pixelRatio),t.forceUpdate("surface")}))),300)),!1)}return!1},createPattern:ce,recycleImage:function(t,e){const i=e["_"+t];if(i instanceof Array){let s,n,o,a;for(let r=0,h=i.length;r<h;r++)s=i[r].image,a=s&&s.url,a&&(n||(n={}),n[a]=!0,b.recycle(s),s.loading&&(o||(o=e.__input&&e.__input[t]||[],o instanceof Array||(o=[o])),s.unload(i[r].loadId,!o.some((t=>t.url===a)))));return n}return null},createData:Qt,getPatternData:Jt,fillOrFitMode:Ut,clipMode:Yt,repeatMode:Gt},{toPoint:pe}=T,_e={},we={};function me(t,e,i){let s;for(let n=0,o=e.length;n<o;n++)s=e[n],"string"==typeof s?t.addColorStop(n/(o-1),N.string(s,i)):t.addColorStop(s.offset,N.string(s.color,i))}const{getAngle:ye,getDistance:ve}=M,{get:xe,rotateOfOuter:be,scaleOfOuter:Be}=S,{toPoint:Re}=T,ke={},Se={};function Le(t,e,i,s,n){let o;const{width:a,height:r}=t;if(a!==r||s){const t=ye(e,i);o=xe(),n?(Be(o,e,a/r*(s||1),1),be(o,e,t+90)):(Be(o,e,1,a/r*(s||1)),be(o,e,t))}return o}const{getDistance:Ee}=M,{toPoint:Te}=T,Me={},Ae={};const Ce={linearGradient:function(t,i){let{from:s,to:n,type:o,blendMode:a,opacity:r}=t;pe(s||"top",i,_e),pe(n||"bottom",i,we);const h=e.canvas.createLinearGradient(_e.x,_e.y,we.x,we.y);me(h,t.stops,r);const d={type:o,style:h};return a&&(d.blendMode=a),d},radialGradient:function(t,i){let{from:s,to:n,type:o,opacity:a,blendMode:r,stretch:h}=t;Re(s||"center",i,ke),Re(n||"bottom",i,Se);const d=e.canvas.createRadialGradient(ke.x,ke.y,0,ke.x,ke.y,ve(ke,Se));me(d,t.stops,a);const l={type:o,style:d},c=Le(i,ke,Se,h,!0);return c&&(l.transform=c),r&&(l.blendMode=r),l},conicGradient:function(t,i){let{from:s,to:n,type:o,opacity:a,blendMode:r,stretch:h}=t;Te(s||"center",i,Me),Te(n||"bottom",i,Ae);const d=e.conicGradientSupport?e.canvas.createConicGradient(0,Me.x,Me.y):e.canvas.createRadialGradient(Me.x,Me.y,0,Me.x,Me.y,Ee(Me,Ae));me(d,t.stops,a);const l={type:o,style:d},c=Le(i,Me,Ae,h||1,e.conicGradientRotate90);return c&&(l.transform=c),r&&(l.blendMode=r),l},getTransform:Le},{copy:We,toOffsetOutBounds:Oe}=R,Pe={},Ie={};function De(t,i,s,n){const{bounds:o,shapeBounds:a}=n;if(e.fullImageShadow){if(We(Pe,t.bounds),Pe.x+=i.x-a.x,Pe.y+=i.y-a.y,s){const{matrix:t}=n;Pe.x-=(o.x+(t?t.e:0)+o.width/2)*(s-1),Pe.y-=(o.y+(t?t.f:0)+o.height/2)*(s-1),Pe.width*=s,Pe.height*=s}t.copyWorld(n.canvas,t.bounds,Pe)}else s&&(We(Pe,i),Pe.x-=i.width/2*(s-1),Pe.y-=i.height/2*(s-1),Pe.width*=s,Pe.height*=s),t.copyWorld(n.canvas,a,s?Pe:i)}const{toOffsetOutBounds:Fe}=R,ze={};const Ne={shadow:function(t,e,i){let s,n;const{__nowWorld:o,__layout:a}=t,{shadow:r}=t.__,{worldCanvas:h,bounds:d,shapeBounds:l,scaleX:c,scaleY:u}=i,f=e.getSameCanvas(),g=r.length-1;Oe(d,Ie),r.forEach(((r,p)=>{f.setWorldShadow(Ie.offsetX+r.x*c,Ie.offsetY+r.y*u,r.blur*c,r.color),n=r.spread?1+2*r.spread/(a.boxBounds.width+2*(a.strokeBoxSpread||0)):0,De(f,Ie,n,i),s=d,r.box&&(f.restore(),f.save(),h&&(f.copyWorld(f,d,o,"copy"),s=o),h?f.copyWorld(h,o,o,"destination-out"):f.copyWorld(i.canvas,l,d,"destination-out")),t.__worldFlipped?e.copyWorldByReset(f,s,o,r.blendMode):e.copyWorldToInner(f,s,a.renderBounds,r.blendMode),g&&p<g&&f.clearWorld(s,!0)})),f.recycle(s)},innerShadow:function(t,e,i){let s,n;const{__nowWorld:o,__layout:a}=t,{innerShadow:r}=t.__,{worldCanvas:h,bounds:d,shapeBounds:l,scaleX:c,scaleY:u}=i,f=e.getSameCanvas(),g=r.length-1;Fe(d,ze),r.forEach(((r,p)=>{f.save(),f.setWorldShadow(ze.offsetX+r.x*c,ze.offsetY+r.y*u,r.blur*c),n=r.spread?1-2*r.spread/(a.boxBounds.width+2*(a.strokeBoxSpread||0)):0,De(f,ze,n,i),f.restore(),h?(f.copyWorld(f,d,o,"copy"),f.copyWorld(h,o,o,"source-out"),s=o):(f.copyWorld(i.canvas,l,d,"source-out"),s=d),f.fillWorld(s,r.color,"source-in"),t.__worldFlipped?e.copyWorldByReset(f,s,o,r.blendMode):e.copyWorldToInner(f,s,a.renderBounds,r.blendMode),g&&p<g&&f.clearWorld(s,!0)})),f.recycle(s)},blur:function(t,e,i){const{blur:s}=t.__;i.setWorldBlur(s*t.__nowWorld.a),i.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),i.filter="none"},backgroundBlur:function(t,e,i){}},{excludeRenderBounds:Ve}=w;function Ue(t,e,i,s,n,o){switch(e){case"alpha":!function(t,e,i,s){const n=t.__nowWorld;i.resetTransform(),i.opacity=1,i.useMask(s,n),s.recycle(n),Ge(t,e,i,1)}(t,i,s,n);break;case"opacity-path":Ge(t,i,s,o);break;case"path":i.restore()}}function Ye(t){return t.getSameCanvas(!1,!0)}function Ge(t,e,i,s){const n=t.__nowWorld;e.resetTransform(),e.opacity=s,e.copyWorld(i,n),i.recycle(n)}Y.prototype.__renderMask=function(t,e){let i,s,n,o,a;const{children:r}=this;for(let h=0,d=r.length;h<d;h++)i=r[h],i.__.mask&&(a&&(Ue(this,a,t,n,s,o),s=n=null),"path"===i.__.mask?(i.opacity<1?(a="opacity-path",o=i.opacity,n||(n=Ye(t))):(a="path",t.save()),i.__clip(n||t,e)):(a="alpha",s||(s=Ye(t)),n||(n=Ye(t)),i.__render(s,e)),"clipping"!==i.__.mask)||Ve(i,e)||i.__render(n||t,e);Ue(this,a,t,n,s,o)};const je=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",He=je+"_#~&*+\\=|≮≯≈≠=…",Xe=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map((([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`)).join("|"));function qe(t){const e={};return t.split("").forEach((t=>e[t]=!0)),e}const Qe=qe("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),Je=qe("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),Ke=qe(je),Ze=qe(He),$e=qe("- —/~|┆·");var ti;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(ti||(ti={}));const{Letter:ei,Single:ii,Before:si,After:ni,Symbol:oi,Break:ai}=ti;function ri(t){return Qe[t]?ei:$e[t]?ai:Je[t]?si:Ke[t]?ni:Ze[t]?oi:Xe.test(t)?ii:ei}const hi={trimRight(t){const{words:e}=t;let i,s=0,n=e.length;for(let o=n-1;o>-1&&(i=e[o].data[0]," "===i.char);o--)s++,t.width-=i.width;s&&e.splice(n-s,s)}};function di(t,e,i){switch(e){case"title":return i?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:li}=hi,{Letter:ci,Single:ui,Before:fi,After:gi,Symbol:pi,Break:_i}=ti;let wi,mi,yi,vi,xi,bi,Bi,Ri,ki,Si,Li,Ei,Ti,Mi,Ai,Ci,Wi=[];function Oi(t,e){ki&&!Ri&&(Ri=ki),wi.data.push({char:t,width:e}),yi+=e}function Pi(){vi+=yi,wi.width=yi,mi.words.push(wi),wi={data:[]},yi=0}function Ii(){Mi&&(Ai.paraNumber++,mi.paraStart=!0,Mi=!1),ki&&(mi.startCharSize=Ri,mi.endCharSize=ki,Ri=0),mi.width=vi,Ci.width&&li(mi),Wi.push(mi),mi={words:[]},vi=0}const Di=0,Fi=1,zi=2;const{top:Ni,right:Vi,bottom:Ui,left:Yi}=A;function Gi(t,e,i){const{bounds:s,rows:n}=t;s[e]+=i;for(let t=0;t<n.length;t++)n[t][e]+=i}const ji={getDrawData:function(t,i){"string"!=typeof t&&(t=String(t));let s=0,n=0,o=i.__getInput("width")||0,a=i.__getInput("height")||0;const{textDecoration:r,__font:h,__padding:d}=i;d&&(o&&(s=d[Yi],o-=d[Vi]+d[Yi]),a&&(n=d[Ni],a-=d[Ni]+d[Ui]));const l={bounds:{x:s,y:n,width:o,height:a},rows:[],paraNumber:0,font:e.canvas.font=h};return function(t,i,s){Ai=t,Wi=t.rows,Ci=t.bounds;const{__letterSpacing:n,paraIndent:o,textCase:a}=s,{canvas:r}=e,{width:h,height:d}=Ci;if(h||d||n||"none"!==a){const t="none"!==s.textWrap,e="break"===s.textWrap;Mi=!0,Li=null,Ri=Bi=ki=yi=vi=0,wi={data:[]},mi={words:[]};for(let s=0,d=i.length;s<d;s++)bi=i[s],"\n"===bi?(yi&&Pi(),mi.paraEnd=!0,Ii(),Mi=!0):(Si=ri(bi),Si===ci&&"none"!==a&&(bi=di(bi,a,!yi)),Bi=r.measureText(bi).width,n&&(n<0&&(ki=Bi),Bi+=n),Ei=Si===ui&&(Li===ui||Li===ci)||Li===ui&&Si!==gi,Ti=!(Si!==fi&&Si!==ui||Li!==pi&&Li!==gi),xi=Mi&&o?h-o:h,t&&h&&vi+yi+Bi>xi&&(e?(yi&&Pi(),vi&&Ii()):(Ti||(Ti=Si===ci&&Li==gi),Ei||Ti||Si===_i||Si===fi||Si===ui||yi+Bi>xi?(yi&&Pi(),vi&&Ii()):vi&&Ii()))," "===bi&&!0!==Mi&&vi+yi===0||(Si===_i?(" "===bi&&yi&&Pi(),Oi(bi,Bi),Pi()):Ei||Ti?(yi&&Pi(),Oi(bi,Bi)):Oi(bi,Bi)),Li=Si);yi&&Pi(),vi&&Ii(),Wi.length>0&&(Wi[Wi.length-1].paraEnd=!0)}else i.split("\n").forEach((t=>{Ai.paraNumber++,Wi.push({x:o||0,text:t,width:r.measureText(t).width,paraStart:!0})}))}(l,t,i),d&&function(t,e,i,s,n){if(!s)switch(i.textAlign){case"left":Gi(e,"x",t[Yi]);break;case"right":Gi(e,"x",-t[Vi])}if(!n)switch(i.verticalAlign){case"top":Gi(e,"y",t[Ni]);break;case"bottom":Gi(e,"y",-t[Ui])}}(d,l,i,o,a),function(t,e){const{rows:i,bounds:s}=t,{__lineHeight:n,__baseLine:o,__letterSpacing:a,__clipText:r,textAlign:h,verticalAlign:d,paraSpacing:l}=e;let c,u,f,{x:g,y:p,width:_,height:w}=s,m=n*i.length+(l?l*(t.paraNumber-1):0),y=o;if(r&&m>w)m=Math.max(w,n),t.overflow=i.length;else switch(d){case"middle":p+=(w-m)/2;break;case"bottom":p+=w-m}y+=p;for(let o=0,d=i.length;o<d;o++){if(c=i[o],c.x=g,c.width<_||c.width>_&&!r)switch(h){case"center":c.x+=(_-c.width)/2;break;case"right":c.x+=_-c.width}c.paraStart&&l&&o>0&&(y+=l),c.y=y,y+=n,t.overflow>o&&y>m&&(c.isOverflow=!0,t.overflow=o+1),u=c.x,f=c.width,a<0&&(c.width<0?(f=-c.width+e.fontSize+a,u-=f,f+=e.fontSize):f-=a),u<s.x&&(s.x=u),f>s.width&&(s.width=f),r&&_&&_<f&&(c.isOverflow=!0,t.overflow||(t.overflow=i.length))}s.y=p,s.height=m}(l,i),function(t,e,i,s){const{rows:n}=t,{textAlign:o,paraIndent:a,letterSpacing:r}=e;let h,d,l,c,u;n.forEach((t=>{t.words&&(l=a&&t.paraStart?a:0,d=i&&"justify"===o&&t.words.length>1?(i-t.width-l)/(t.words.length-1):0,c=r||t.isOverflow?Di:d>.01?Fi:zi,t.isOverflow&&!r&&(t.textMode=!0),c===zi?(t.x+=l,function(t){t.text="",t.words.forEach((e=>{e.data.forEach((e=>{t.text+=e.char}))}))}(t)):(t.x+=l,h=t.x,t.data=[],t.words.forEach((e=>{c===Fi?(u={char:"",x:h},h=function(t,e,i){return t.forEach((t=>{i.char+=t.char,e+=t.width})),e}(e.data,h,u),(t.isOverflow||" "!==u.char)&&t.data.push(u)):h=function(t,e,i,s){return t.forEach((t=>{(s||" "!==t.char)&&(t.x=e,i.push(t)),e+=t.width})),e}(e.data,h,t.data,t.isOverflow),!t.paraEnd&&d&&(h+=d,t.width+=d)}))),t.words=null)}))}(l,i,o),l.overflow&&function(t,i){const{rows:s,overflow:n}=t;let{textOverflow:o}=i;if(s.splice(n),o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const r=o?e.canvas.measureText(o).width:0,h=i.x+i.width-r;("none"===i.textWrap?s:[s[n-1]]).forEach((e=>{if(e.isOverflow&&e.data){let i=e.data.length-1;for(let s=i;s>-1&&(t=e.data[s],a=t.x+t.width,!(s===i&&a<h));s--){if(a<h&&" "!==t.char){e.data.splice(s+1),e.width-=t.width;break}e.width-=t.width}e.width+=r,e.data.push({char:o,x:a}),e.textMode&&function(t){t.text="",t.data.forEach((e=>{t.text+=e.char})),t.data=null}(e)}}))}}(l,i),"none"!==r&&function(t,e){const{fontSize:i}=e;switch(t.decorationHeight=i/11,e.textDecoration){case"under":t.decorationY=.15*i;break;case"delete":t.decorationY=.35*-i}}(l,i),l}};const Hi={string:function(t,e){if("string"==typeof t)return t;let i=void 0===t.a?1:t.a;e&&(i*=e);const s=t.r+","+t.g+","+t.b;return 1===i?"rgb("+s+")":"rgba("+s+","+i+")"}},{setPoint:Xi,addPoint:qi,toBounds:Qi}=C;const Ji={export(t,i,s){return this.running=!0,function(t){Ki||(Ki=new W);return new Promise((e=>{Ki.add((()=>ue(this,void 0,void 0,(function*(){return yield t(e)}))),{parallel:!1})}))}((n=>new Promise((o=>{const r=t=>{n(t),o(),this.running=!1},{toURL:d}=e,{download:l}=e.origin,c=h.fileType(i);if("json"===i)return r({data:t.toJSON()});if("json"===c)return l(d(JSON.stringify(t.toJSON()),"text"),i),r({data:!0});if("svg"===i)return r({data:t.toSVG()});if("svg"===c)return l(d(t.toSVG(),"svg"),i),r({data:!0});const{leafer:u}=t;u?(Zi(t),u.waitViewCompleted((()=>ue(this,void 0,void 0,(function*(){s=h.getExportOptions(s);let e,n,o=1,d=1;const{worldTransform:l,isLeafer:c,isFrame:f}=t,{slice:g,trim:p,onCanvas:w}=s;let m=s.scale||1,y=s.pixelRatio||1;const v=void 0===s.smooth?u.config.smooth:s.smooth,x=s.contextSettings||u.config.contextSettings;t.isApp&&(m*=y,y=t.app.pixelRatio);const b=s.screenshot||t.isApp,B=c&&b&&void 0===s.fill?t.fill:s.fill,R=h.isOpaqueImage(i)||B,k=new O;if(b)e=!0===b?c?u.canvas.bounds:t.worldRenderBounds:b;else{let i=s.relative||(c?"inner":"local");switch(o=l.scaleX,d=l.scaleY,i){case"inner":k.set(l);break;case"local":k.set(l).divide(t.localTransform),o/=t.scaleX,d/=t.scaleY;break;case"world":o=1,d=1;break;case"page":i=t.leafer;default:k.set(l).divide(t.getTransform(i));const e=i.worldTransform;o/=o/e.scaleX,d/=d/e.scaleY}e=t.getBounds("render",i)}const{x:S,y:L,width:E,height:T}=new _(e).scale(m);let M=a.canvas({width:Math.round(E),height:Math.round(T),pixelRatio:y,smooth:v,contextSettings:x});const A={matrix:k.scale(1/m).invert().translate(-S,-L).withScale(1/o*m,1/d*m)};if(g&&(t=u,A.bounds=M.bounds),M.save(),f&&void 0!==B){const e=t.get("fill");t.fill="",t.__render(M,A),t.fill=e}else t.__render(M,A);if(M.restore(),p){n=function(t){const{width:e,height:i}=t.view,{data:s}=t.context.getImageData(0,0,e,i);let n,o,a,r=0;for(let t=0;t<s.length;t+=4)0!==s[t+3]&&(n=r%e,o=(r-n)/e,a?qi(a,n,o):Xi(a={},n,o)),r++;const h=new _;return Qi(a,h),h.scale(1/t.pixelRatio).ceil()}(M);const t=M,{width:e,height:i}=n,s={x:0,y:0,width:e,height:i,pixelRatio:y};M=a.canvas(s),M.copyWorld(t,n,s)}R&&M.fillWorld(M.bounds,B||"#FFFFFF","destination-over"),w&&w(M);const C="canvas"===i?M:yield M.export(i,s);r({data:C,width:M.pixelWidth,height:M.pixelHeight,renderBounds:e,trimBounds:n})}))))):r({data:!1})}))))}};let Ki;function Zi(t){t.__.__needComputePaint&&t.__.__computePaint(),t.isBranch&&t.children.forEach((t=>Zi(t)))}const $i=t.prototype,ts=m.get("@leafer-ui/export");$i.export=function(t,e){const{quality:i,blob:s}=h.getExportOptions(e);return t.includes(".")?this.saveAs(t,i):s?this.toBlob(t,i):this.toDataURL(t,i)},$i.toBlob=function(t,i){return new Promise((s=>{e.origin.canvasToBolb(this.view,t,i).then((t=>{s(t)})).catch((t=>{ts.error(t),s(null)}))}))},$i.toDataURL=function(t,i){return e.origin.canvasToDataURL(this.view,t,i)},$i.saveAs=function(t,i){return new Promise((s=>{e.origin.canvasSaveAs(this.view,t,i).then((()=>{s(!0)})).catch((t=>{ts.error(t),s(!1)}))}))},Object.assign(G,ji),Object.assign(N,Hi),Object.assign(j,Ot),Object.assign(z,ge),Object.assign(V,Ce),Object.assign(H,Ne),Object.assign(U,Ji),Object.assign(a,{interaction:(t,e,i,s)=>new bt(t,e,i,s),hitCanvas:(t,e)=>new X(t,e),hitCanvasManager:()=>new D});try{J(0,wx)}catch(t){}X.prototype.__createContext=function(){if(this.viewSelect){const t=F.origin.createCanvas(1,1),e=this.view.getContext("2d");this.testView=this.view,this.testContext=e,this.view=t}this.context=this.view.getContext("2d"),this.__bindContext()},X.prototype.updateRender=function(){if(this.testView){let t=this.context.createPattern(this.view,F.origin.noRepeat);this.testContext.clearRect(0,0,this.view.width,this.view.height),this.testContext.fillStyle=t,this.testContext.fillRect(0,0,this.view.width,this.view.height),this.testContext.fillStyle=t=null}},X.prototype.updateViewSize=function(){const{width:t,height:e,pixelRatio:i,view:s,testView:n}=this;s.width=t*i,s.height=e*i,n&&(n.width=s.width,n.height=s.height)};export{bt as Interaction,dt as Layouter,X as LeaferCanvas,ct as Renderer,vt as Selector,K as Watcher,J as useCanvas};
|
package/dist/miniapp.module.js
CHANGED
|
@@ -11,8 +11,15 @@ const Platform = {
|
|
|
11
11
|
hitCanvasSize: 100,
|
|
12
12
|
maxCacheSize: 2560 * 1600,
|
|
13
13
|
maxPatternSize: 4096 * 2160,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
crossOrigin: 'anonymous',
|
|
15
|
+
getRealURL(url) {
|
|
16
|
+
const { prefix, suffix } = Platform.image;
|
|
17
|
+
if (suffix && !url.startsWith('data:') && !url.startsWith('blob:'))
|
|
18
|
+
url += (url.includes("?") ? "&" : "?") + suffix;
|
|
19
|
+
if (prefix && url[0] === '/')
|
|
20
|
+
url = prefix + url;
|
|
21
|
+
return url;
|
|
22
|
+
}
|
|
16
23
|
}
|
|
17
24
|
};
|
|
18
25
|
|
|
@@ -5126,6 +5133,7 @@ let Leaf = class Leaf {
|
|
|
5126
5133
|
get __worldFlipped() { return this.__world.scaleX < 0 || this.__world.scaleY < 0; }
|
|
5127
5134
|
get __onlyHitMask() { return this.__hasMask && !this.__.hitChildren; }
|
|
5128
5135
|
get __ignoreHitWorld() { return (this.__hasMask || this.__hasEraser) && this.__.hitChildren; }
|
|
5136
|
+
get __inLazyBounds() { const { leafer } = this; return leafer && leafer.created && leafer.lazyBounds.hit(this.__world); }
|
|
5129
5137
|
get pathInputed() { return this.__.__pathInputed; }
|
|
5130
5138
|
constructor(data) {
|
|
5131
5139
|
this.innerId = create(LEAF);
|
|
@@ -5210,6 +5218,9 @@ let Leaf = class Leaf {
|
|
|
5210
5218
|
findOne(_condition, _options) { return undefined; }
|
|
5211
5219
|
findId(_id) { return undefined; }
|
|
5212
5220
|
focus(_value) { }
|
|
5221
|
+
updateLayout() {
|
|
5222
|
+
this.__layout.update();
|
|
5223
|
+
}
|
|
5213
5224
|
forceUpdate(attrName) {
|
|
5214
5225
|
if (attrName === undefined)
|
|
5215
5226
|
attrName = 'width';
|
|
@@ -5219,8 +5230,8 @@ let Leaf = class Leaf {
|
|
|
5219
5230
|
this.__[attrName] = value === undefined ? null : undefined;
|
|
5220
5231
|
this[attrName] = value;
|
|
5221
5232
|
}
|
|
5222
|
-
|
|
5223
|
-
this.
|
|
5233
|
+
forceRender(_bounds) {
|
|
5234
|
+
this.forceUpdate('surface');
|
|
5224
5235
|
}
|
|
5225
5236
|
__updateWorldMatrix() { }
|
|
5226
5237
|
__updateLocalMatrix() { }
|
|
@@ -5890,12 +5901,12 @@ function useCanvas(_canvasType, app) {
|
|
|
5890
5901
|
});
|
|
5891
5902
|
});
|
|
5892
5903
|
},
|
|
5893
|
-
loadImage(
|
|
5904
|
+
loadImage(src) {
|
|
5894
5905
|
return new Promise((resolve, reject) => {
|
|
5895
5906
|
const img = Platform.canvas.view.createImage();
|
|
5896
5907
|
img.onload = () => { resolve(img); };
|
|
5897
5908
|
img.onerror = (error) => { reject(error); };
|
|
5898
|
-
img.src =
|
|
5909
|
+
img.src = Platform.image.getRealURL(src);
|
|
5899
5910
|
});
|
|
5900
5911
|
},
|
|
5901
5912
|
noRepeat: 'repeat-x'
|
|
@@ -7330,7 +7341,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7330
7341
|
__onUpdateSize() {
|
|
7331
7342
|
if (this.__.__input) {
|
|
7332
7343
|
const data = this.__;
|
|
7333
|
-
(data.lazy && this.
|
|
7344
|
+
(data.lazy && !this.__inLazyBounds && !Export.running) ? data.__needComputePaint = true : data.__computePaint();
|
|
7334
7345
|
}
|
|
7335
7346
|
}
|
|
7336
7347
|
__updateRenderPath() {
|
|
@@ -7888,6 +7899,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
7888
7899
|
if (!this.parent)
|
|
7889
7900
|
this.canvas.hittable = newValue;
|
|
7890
7901
|
}
|
|
7902
|
+
else if (attrName === 'zIndex') {
|
|
7903
|
+
this.canvas.zIndex = newValue;
|
|
7904
|
+
setTimeout(() => this.parent && this.parent.__updateSortChildren());
|
|
7905
|
+
}
|
|
7891
7906
|
}
|
|
7892
7907
|
return super.__setAttr(attrName, newValue);
|
|
7893
7908
|
}
|
|
@@ -8506,7 +8521,7 @@ let Canvas = class Canvas extends Rect {
|
|
|
8506
8521
|
__drawAfterFill(canvas, _options) {
|
|
8507
8522
|
const origin = this.canvas.view;
|
|
8508
8523
|
const { width, height } = this;
|
|
8509
|
-
if (this.__.cornerRadius) {
|
|
8524
|
+
if (this.__.cornerRadius || this.pathInputed) {
|
|
8510
8525
|
canvas.save();
|
|
8511
8526
|
canvas.clip();
|
|
8512
8527
|
canvas.drawImage(this.canvas.view, 0, 0, origin.width, origin.height, 0, 0, width, height);
|
|
@@ -8848,15 +8863,17 @@ let App = class App extends Leafer {
|
|
|
8848
8863
|
this.add(leafer);
|
|
8849
8864
|
return leafer;
|
|
8850
8865
|
}
|
|
8851
|
-
add(leafer) {
|
|
8866
|
+
add(leafer, index) {
|
|
8852
8867
|
if (!leafer.view) {
|
|
8853
8868
|
if (this.realCanvas && !this.canvas.bounds) {
|
|
8854
|
-
setTimeout(() => this.add(leafer), 10);
|
|
8869
|
+
setTimeout(() => this.add(leafer, index), 10);
|
|
8855
8870
|
return;
|
|
8856
8871
|
}
|
|
8857
8872
|
leafer.init(this.__getChildConfig(leafer.userConfig), this);
|
|
8858
8873
|
}
|
|
8859
|
-
super.add(leafer);
|
|
8874
|
+
super.add(leafer, index);
|
|
8875
|
+
if (index !== undefined)
|
|
8876
|
+
leafer.canvas.childIndex = index;
|
|
8860
8877
|
this.__listenChildEvents(leafer);
|
|
8861
8878
|
}
|
|
8862
8879
|
__onPropertyChange() {
|
|
@@ -9203,13 +9220,15 @@ const LeaferTypeCreator = {
|
|
|
9203
9220
|
};
|
|
9204
9221
|
const { list, register } = LeaferTypeCreator;
|
|
9205
9222
|
register('draw', () => { });
|
|
9223
|
+
register('custom', () => { });
|
|
9206
9224
|
register('design', addInteractionWindow);
|
|
9207
9225
|
register('document', document);
|
|
9208
9226
|
|
|
9209
|
-
Leafer.prototype
|
|
9227
|
+
const leafer = Leafer.prototype;
|
|
9228
|
+
leafer.initType = function (type) {
|
|
9210
9229
|
LeaferTypeCreator.run(type, this);
|
|
9211
9230
|
};
|
|
9212
|
-
|
|
9231
|
+
leafer.getValidMove = function (moveX, moveY) {
|
|
9213
9232
|
const { scroll, disabled } = this.app.config.move;
|
|
9214
9233
|
if (scroll) {
|
|
9215
9234
|
if (Math.abs(moveX) > Math.abs(moveY))
|
|
@@ -9239,7 +9258,7 @@ Leafer.prototype.getValidMove = function (moveX, moveY) {
|
|
|
9239
9258
|
}
|
|
9240
9259
|
return { x: disabled ? 0 : moveX, y: disabled ? 0 : moveY };
|
|
9241
9260
|
};
|
|
9242
|
-
|
|
9261
|
+
leafer.getValidScale = function (changeScale) {
|
|
9243
9262
|
const { scaleX } = this.zoomLayer.__, { min, max, disabled } = this.app.config.zoom, absScale = Math.abs(scaleX * changeScale);
|
|
9244
9263
|
if (absScale < min)
|
|
9245
9264
|
changeScale = min / scaleX;
|
|
@@ -9695,7 +9714,7 @@ const config = {
|
|
|
9695
9714
|
swipeDistance: 20,
|
|
9696
9715
|
preventDefaultMenu: true
|
|
9697
9716
|
},
|
|
9698
|
-
cursor:
|
|
9717
|
+
cursor: true,
|
|
9699
9718
|
keyEvent: true
|
|
9700
9719
|
};
|
|
9701
9720
|
|
|
@@ -10008,7 +10027,7 @@ class InteractionBase {
|
|
|
10008
10027
|
this.hoverData = data;
|
|
10009
10028
|
}
|
|
10010
10029
|
updateCursor(data) {
|
|
10011
|
-
if (this.config.cursor
|
|
10030
|
+
if (!this.config.cursor || !this.config.pointer.hover)
|
|
10012
10031
|
return;
|
|
10013
10032
|
if (!data) {
|
|
10014
10033
|
this.updateHoverData();
|
|
@@ -11015,7 +11034,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
11015
11034
|
width *= data.scaleX;
|
|
11016
11035
|
height *= data.scaleY;
|
|
11017
11036
|
}
|
|
11018
|
-
allowPaint = width * height > Platform.image.maxCacheSize;
|
|
11037
|
+
allowPaint = (width * height > Platform.image.maxCacheSize) || Export.running;
|
|
11019
11038
|
}
|
|
11020
11039
|
else {
|
|
11021
11040
|
allowPaint = false;
|
|
@@ -11527,7 +11546,8 @@ function createRows(drawData, content, style) {
|
|
|
11527
11546
|
if (breakAll) {
|
|
11528
11547
|
if (wordWidth)
|
|
11529
11548
|
addWord();
|
|
11530
|
-
|
|
11549
|
+
if (rowWidth)
|
|
11550
|
+
addRow();
|
|
11531
11551
|
}
|
|
11532
11552
|
else {
|
|
11533
11553
|
if (!afterBreak)
|
|
@@ -11535,10 +11555,12 @@ function createRows(drawData, content, style) {
|
|
|
11535
11555
|
if (langBreak || afterBreak || charType === Break || charType === Before || charType === Single || (wordWidth + charWidth > realWidth)) {
|
|
11536
11556
|
if (wordWidth)
|
|
11537
11557
|
addWord();
|
|
11538
|
-
|
|
11558
|
+
if (rowWidth)
|
|
11559
|
+
addRow();
|
|
11539
11560
|
}
|
|
11540
11561
|
else {
|
|
11541
|
-
|
|
11562
|
+
if (rowWidth)
|
|
11563
|
+
addRow();
|
|
11542
11564
|
}
|
|
11543
11565
|
}
|
|
11544
11566
|
}
|
|
@@ -11924,6 +11946,7 @@ const ExportModule = {
|
|
|
11924
11946
|
}
|
|
11925
11947
|
const { leafer } = leaf;
|
|
11926
11948
|
if (leafer) {
|
|
11949
|
+
checkLazy(leaf);
|
|
11927
11950
|
leafer.waitViewCompleted(() => __awaiter(this, void 0, void 0, function* () {
|
|
11928
11951
|
options = FileHelper.getExportOptions(options);
|
|
11929
11952
|
let renderBounds, trimBounds, scaleX = 1, scaleY = 1;
|
|
@@ -11931,6 +11954,8 @@ const ExportModule = {
|
|
|
11931
11954
|
const { slice, trim, onCanvas } = options;
|
|
11932
11955
|
let scale = options.scale || 1;
|
|
11933
11956
|
let pixelRatio = options.pixelRatio || 1;
|
|
11957
|
+
const smooth = options.smooth === undefined ? leafer.config.smooth : options.smooth;
|
|
11958
|
+
const contextSettings = options.contextSettings || leafer.config.contextSettings;
|
|
11934
11959
|
if (leaf.isApp) {
|
|
11935
11960
|
scale *= pixelRatio;
|
|
11936
11961
|
pixelRatio = leaf.app.pixelRatio;
|
|
@@ -11969,7 +11994,7 @@ const ExportModule = {
|
|
|
11969
11994
|
renderBounds = leaf.getBounds('render', relative);
|
|
11970
11995
|
}
|
|
11971
11996
|
const { x, y, width, height } = new Bounds(renderBounds).scale(scale);
|
|
11972
|
-
let canvas = Creator.canvas({ width: Math.round(width), height: Math.round(height), pixelRatio });
|
|
11997
|
+
let canvas = Creator.canvas({ width: Math.round(width), height: Math.round(height), pixelRatio, smooth, contextSettings });
|
|
11973
11998
|
const renderOptions = { matrix: matrix.scale(1 / scale).invert().translate(-x, -y).withScale(1 / scaleX * scale, 1 / scaleY * scale) };
|
|
11974
11999
|
if (slice) {
|
|
11975
12000
|
leaf = leafer;
|
|
@@ -12015,6 +12040,12 @@ function addTask(task) {
|
|
|
12015
12040
|
tasker.add(() => __awaiter(this, void 0, void 0, function* () { return yield task(resolve); }), { parallel: false });
|
|
12016
12041
|
});
|
|
12017
12042
|
}
|
|
12043
|
+
function checkLazy(leaf) {
|
|
12044
|
+
if (leaf.__.__needComputePaint)
|
|
12045
|
+
leaf.__.__computePaint();
|
|
12046
|
+
if (leaf.isBranch)
|
|
12047
|
+
leaf.children.forEach(child => checkLazy(child));
|
|
12048
|
+
}
|
|
12018
12049
|
|
|
12019
12050
|
const canvas = LeaferCanvasBase.prototype;
|
|
12020
12051
|
const debug = Debug.get('@leafer-ui/export');
|
|
@@ -12102,4 +12133,4 @@ LeaferCanvas.prototype.updateViewSize = function () {
|
|
|
12102
12133
|
}
|
|
12103
12134
|
};
|
|
12104
12135
|
|
|
12105
|
-
export { AlignHelper, AnimateEvent, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Export, FileHelper, Frame, FrameData, Group, GroupData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, inviteCode, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|
|
12136
|
+
export { AlignHelper, AnimateEvent, Answer, App, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, DropEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Export, FileHelper, Frame, FrameData, Group, GroupData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, PenData, Platform, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, RotateEvent, Run, Selector, Star, StarData, State, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, addInteractionWindow, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, inviteCode, layoutProcessor, maskType, naturalBoundsType, opacityType, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, sortType, stateType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
|