@leafer-ui/draw 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/draw.cjs +1 -1
- package/lib/draw.esm.js +1 -1
- package/lib/draw.esm.min.js +1 -1
- package/lib/draw.esm.min.js.map +1 -1
- package/lib/draw.min.cjs +1 -1
- package/lib/draw.min.cjs.map +1 -1
- package/package.json +6 -6
package/lib/draw.cjs
CHANGED
|
@@ -1754,7 +1754,7 @@ exports.Text = class Text extends exports.UI {
|
|
|
1754
1754
|
data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
|
|
1755
1755
|
data.__padding = padding ? core.MathHelper.fourNumber(padding) : undefined;
|
|
1756
1756
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * .7) / 2;
|
|
1757
|
-
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize}px ${fontFamily}`;
|
|
1757
|
+
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize || 12}px ${fontFamily || "caption"}`;
|
|
1758
1758
|
data.__clipText = textOverflow !== "show" && !data.__autoSize;
|
|
1759
1759
|
data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === "") ? data.placeholder : data.text, this.__);
|
|
1760
1760
|
}
|
package/lib/draw.esm.js
CHANGED
|
@@ -1754,7 +1754,7 @@ let Text = class Text extends UI {
|
|
|
1754
1754
|
data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
|
|
1755
1755
|
data.__padding = padding ? MathHelper.fourNumber(padding) : undefined;
|
|
1756
1756
|
data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * .7) / 2;
|
|
1757
|
-
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize}px ${fontFamily}`;
|
|
1757
|
+
data.__font = `${italic ? "italic " : ""}${textCase === "small-caps" ? "small-caps " : ""}${fontWeight !== "normal" ? fontWeight + " " : ""}${fontSize || 12}px ${fontFamily || "caption"}`;
|
|
1758
1758
|
data.__clipText = textOverflow !== "show" && !data.__autoSize;
|
|
1759
1759
|
data.__textDrawData = TextConvert.getDrawData((data.__isPlacehold = data.placeholder && data.text === "") ? data.placeholder : data.text, this.__);
|
|
1760
1760
|
}
|
package/lib/draw.esm.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defineKey as t,decorateLeafAttr as e,attr as i,createDescriptor as s,Plugin as o,isObject as r,PathConvert as a,DataHelper as n,Debug as _,LeafData as h,isString as d,isUndefined as l,isArray as p,canvasSizeAttrs as u,UICreator as c,dataProcessor as y,dataType as g,surfaceType as v,opacityType as f,visibleType as w,sortType as x,maskType as S,eraserType as m,positionType as R,boundsType as k,scaleType as B,rotationType as b,autoLayoutType as A,naturalBoundsType as C,affectRenderBoundsType as P,pathInputType as F,pathType as W,hitType as E,strokeType as I,cursorType as T,rewrite as D,Leaf as z,useModule as L,rewriteAble as M,MathHelper as O,pen as N,PathCorner as Y,PathDrawer as V,isNumber as H,registerUI as U,Branch as X,LeafList as j,Resource as J,getBoundsData as q,Creator as G,CanvasManager as $,WaitHelper as K,LeaferEvent as Q,Bounds as Z,ResizeEvent as tt,AutoBounds as et,Run as it,LayoutEvent as st,RenderEvent as ot,WatchEvent as rt,ImageManager as at,BoundsHelper as nt,PathCommandDataHelper as _t,Platform as ht,PointHelper as dt,PathBounds as lt,affectStrokeBoundsType as pt,getPointData as ut,LeaferImage as ct,ImageEvent as yt,Matrix as gt,PathCreator as vt}from"@leafer/core";export*from"@leafer/core";function ft(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}function wt(t){return e(t,t=>i({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function xt(t){return e(t,t=>i({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function St(){return(e,i)=>{const s="_"+i;t(e,i,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}function mt(e){return(i,o)=>{t(i,o,s(o,e))}}"function"==typeof SuppressedError&&SuppressedError;const Rt={},kt={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},Bt={number:(t,e)=>r(t)?"percent"===t.type?t.value*e:t.value:t},bt={},At={},Ct={},Pt={},Ft={},Wt={apply(){o.need("filter")}},Et={},It={setStyleName:()=>o.need("state"),set:()=>o.need("state")},Tt={list:{},register(t,e){Tt.list[t]=e},get:t=>Tt.list[t]},{parse:Dt,objectToCanvasData:zt}=a,{stintSet:Lt}=n,{hasTransparent:Mt}=kt,Ot={},Nt=_.get("UIData");class Yt extends h{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,Nt.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Nt.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),d(t)||!t?(Lt(this,"__isTransparentFill",Mt(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):r(t)&&this.__setPaint("fill",t)}setStroke(t){d(t)||!t?(Lt(this,"__isTransparentStroke",Mt(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):r(t)&&this.__setPaint("stroke",t)}setPath(t){const e=d(t);e||t&&r(t[0])?(this.__setInput("path",t),this._path=e?Dt(t):zt(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Vt(this,"shadow",t)}setInnerShadow(t){Vt(this,"innerShadow",t)}setFilter(t){Vt(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&At.compute("fill",this.__leaf),e&&At.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),l(t.strokeWidthFixed)||(i=t.strokeWidthFixed)),i){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const i=this.__leaf.__layout;i.boxChanged||i.boxChange(),p(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=Ot)):(this.__isStrokes=!0,this._stroke||(this._stroke=Ot))}__removePaint(t,e){e&&this.__removeInput(t),Ct.recycleImage(t,this),"fill"===t?(Lt(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(Lt(this,"__isAlphaPixelStroke",void 0),Lt(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function Vt(t,e,i){t.__setInput(e,i),p(i)?(i.some(t=>!1===t.visible)&&(i=i.filter(t=>!1!==t.visible)),i.length||(i=void 0)):i=i&&!1!==i.visible?[i]:void 0,t["_"+e]=i}class Ht extends Yt{}class Ut extends Ht{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"hide"===t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class Xt extends Ht{__getInputData(t,e){const i=super.__getInputData(t,e);return u.forEach(t=>delete i[t]),i}}class jt extends Ut{}class Jt extends Yt{}class qt extends Yt{get __boxStroke(){return!this.__pathInputed}}class Gt extends Yt{get __boxStroke(){return!this.__pathInputed}}class $t extends Yt{}class Kt extends Yt{}class Qt extends Yt{get __pathInputed(){return 2}}class Zt extends Ht{}const te={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class ee extends Yt{get __useNaturalRatio(){return!1}setFontWeight(t){d(t)?(this.__setInput("fontWeight",t),t=te[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,i=e.__box;if(t){const{boxStyle:s}=this;if(i)for(let t in s)i[t]=void 0;else i=e.__box=c.get("Rect",0);const o=e.__layout,r=i.__layout;s||(i.parent=e,i.__world=e.__world,r.boxBounds=o.boxBounds),i.set(t),r.strokeChanged&&o.strokeChange(),r.renderChanged&&o.renderChange(),i.__updateChange()}else i&&(e.__box=i.parent=null,i.destroy());this._boxStyle=t}}class ie extends qt{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:"image",mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return delete t.fill,t}__getInputData(t,e){const i=super.__getInputData(t,e);return delete i.fill,i}}class se extends qt{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const i=super.__getInputData(t,e);return i.url=this.__leaf.canvas.toDataURL("image/png"),i}}const oe={__updateStrokeSpread(){let t=0,e=0;const i=this.__,{strokeAlign:s,__maxStrokeWidth:o}=i,r=this.__box;if((i.stroke||"all"===i.hitStroke)&&o&&"inside"!==s&&(e=t="center"===s?o/2:o,!i.__boxStroke)){const e=i.__isLinePath?0:10*t,s="none"===i.strokeCap?0:o;t+=Math.max(e,s)}return i.__useArrow&&(t+=5*o),r&&(t=Math.max(r.__layout.strokeSpread=r.__updateStrokeSpread(),t),e=r.__layout.strokeBoxSpread),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:s,backgroundBlur:o,filter:r,renderSpread:a}=this.__;e&&e.forEach(e=>t=Math.max(t,Math.max(Math.abs(e.y),Math.abs(e.x))+(e.spread>0?e.spread:0)+1.5*e.blur)),s&&(t=Math.max(t,s)),r&&(t+=Wt.getSpread(r)),a&&(t+=a);let n=t=Math.ceil(t);return i&&i.forEach(t=>n=Math.max(n,Math.max(Math.abs(t.y),Math.abs(t.x))+(t.spread<0?-t.spread:0)+1.5*t.blur)),o&&(n=Math.max(n,o)),this.__layout.renderShapeSpread=n,t+=this.__layout.strokeSpread||0,this.__box?Math.max(this.__box.__updateRenderSpread(),t):t}},{stintSet:re}=n,ae={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);re(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),re(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:i,stroke:s}=t,o=t.innerShadow||t.blur||t.backgroundBlur||t.filter;re(t,"__isFastShadow",e&&!o&&e.length<2&&!e[0].spread&&i&&!t.__isTransparentFill&&!(p(i)&&i.length>1)&&(this.useFastShadow||!s||s&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!o)}t.__checkSingle(),re(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){ne(this,t,e)},__draw(t,e,i){const s=this.__;if(s.__complex){s.__needComputePaint&&s.__computePaint();const{fill:o,stroke:r,__drawAfterFill:a,__fillAfterStroke:n,__isFastShadow:_}=s;if(this.__drawRenderPath(t),s.__useEffect&&!_){const _=At.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:h,innerShadow:d,filter:l}=s;h&&Ft.shadow(this,t,_),n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t)),o&&(s.__isFills?At.fills(o,this,t):At.fill(o,this,t)),a&&this.__drawAfterFill(t,e),d&&Ft.innerShadow(this,t,_),r&&!n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t)),l&&Wt.apply(l,this,this.__nowWorld,t,i,_),_.worldCanvas&&_.worldCanvas.recycle(),_.canvas.recycle()}else{if(n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t)),_){const e=s.shadow[0],{scaleX:i,scaleY:o}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*o,e.blur*i,kt.string(e.color))}o&&(s.__isFills?At.fills(o,this,t):At.fill(o,this,t)),_&&t.restore(),a&&this.__drawAfterFill(t,e),r&&!n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t))}}else s.__pathInputed?ne(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const i=this.__,{fill:s,stroke:o}=i;s&&!e.ignoreFill&&(i.__isAlphaPixelFill?At.fills(s,this,t):At.fill("#000000",this,t)),i.__isCanvas&&this.__drawAfterFill(t,e),o&&!e.ignoreStroke&&(i.__isAlphaPixelStroke?At.strokes(o,this,t):At.stroke("#000000",this,t))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function ne(t,e,i){const{fill:s,stroke:o,__drawAfterFill:r,__fillAfterStroke:a}=t.__;t.__drawRenderPath(e),a&&At.stroke(o,t,e),s&&At.fill(s,t,e),r&&t.__drawAfterFill(e,i),o&&!a&&At.stroke(o,t,e)}const _e={__drawFast(t,e){let{x:i,y:s,width:o,height:r}=this.__layout.boxBounds;const{fill:a,stroke:n,__drawAfterFill:_}=this.__;if(a&&(t.fillStyle=a,t.fillRect(i,s,o,r)),_&&this.__drawAfterFill(t,e),n){const{strokeAlign:a,__strokeWidth:_}=this.__;if(!_)return;t.setStroke(n,_,this.__);const h=_/2;switch(a){case"center":t.strokeRect(0,0,o,r);break;case"inside":o-=_,r-=_,o<0||r<0?(t.save(),this.__clip(t,e),t.strokeRect(i+h,s+h,o,r),t.restore()):t.strokeRect(i+h,s+h,o,r);break;case"outside":t.strokeRect(i-h,s-h,o+_,r+_)}}}};var he;let de=he=class extends z{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){O.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return N.set(this.path=t||[]),t||this.__drawPathByBox(N),N}constructor(t){super(t)}reset(t){}set(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))}get(t){return d(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return o.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return o.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let i=e?this.__.__pathForRender:this.__.path;return i||(N.set(i=[]),this.__drawPathByBox(N)),t?a.toCanvasData(i,!0):i}getPathString(t,e,i){return a.stringify(this.getPath(t,e),i)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||Et.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?Y.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&bt.addArrows(this,!t.cornerRadius)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?V.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:i,width:s,height:o}=this.__layout.boxBounds;if(this.__.cornerRadius){const{cornerRadius:r}=this.__;t.roundRect(e,i,s,o,H(r)?[r]:r)}else t.rect(e,i,s,o)}drawImagePlaceholder(t,e){At.fill(this.__.placeholderColor,this,t)}animate(t,e,i,s){return o.need("animate")}killAnimate(t,e){}export(t,e){return o.need("export")}syncExport(t,e){return o.need("export")}clone(t){const e=n.clone(this.toJSON());return t&&Object.assign(e,t),he.one(e)}static one(t,e,i,s,o){return c.get(t.tag||this.prototype.__tag,t,e,i,s,o)}static registerUI(){U()(this)}static registerData(t){y(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};ft([y(Yt)],de.prototype,"__",void 0),ft([St()],de.prototype,"zoomLayer",void 0),ft([g("")],de.prototype,"id",void 0),ft([g("")],de.prototype,"name",void 0),ft([g("")],de.prototype,"className",void 0),ft([v("pass-through")],de.prototype,"blendMode",void 0),ft([f(1)],de.prototype,"opacity",void 0),ft([w(!0)],de.prototype,"visible",void 0),ft([v(!1)],de.prototype,"locked",void 0),ft([v(!1)],de.prototype,"dim",void 0),ft([v(!1)],de.prototype,"dimskip",void 0),ft([x(0)],de.prototype,"zIndex",void 0),ft([S(!1)],de.prototype,"mask",void 0),ft([m(!1)],de.prototype,"eraser",void 0),ft([R(0,!0)],de.prototype,"x",void 0),ft([R(0,!0)],de.prototype,"y",void 0),ft([k(100,!0)],de.prototype,"width",void 0),ft([k(100,!0)],de.prototype,"height",void 0),ft([B(1,!0)],de.prototype,"scaleX",void 0),ft([B(1,!0)],de.prototype,"scaleY",void 0),ft([b(0,!0)],de.prototype,"rotation",void 0),ft([b(0,!0)],de.prototype,"skewX",void 0),ft([b(0,!0)],de.prototype,"skewY",void 0),ft([R(0,!0)],de.prototype,"offsetX",void 0),ft([R(0,!0)],de.prototype,"offsetY",void 0),ft([R(0,!0)],de.prototype,"scrollX",void 0),ft([R(0,!0)],de.prototype,"scrollY",void 0),ft([A()],de.prototype,"origin",void 0),ft([A()],de.prototype,"around",void 0),ft([g(!1)],de.prototype,"lazy",void 0),ft([C(1)],de.prototype,"pixelRatio",void 0),ft([P(0)],de.prototype,"renderSpread",void 0),ft([F()],de.prototype,"path",void 0),ft([W()],de.prototype,"windingRule",void 0),ft([W(!0)],de.prototype,"closed",void 0),ft([k(0)],de.prototype,"padding",void 0),ft([k(!1)],de.prototype,"lockRatio",void 0),ft([k()],de.prototype,"widthRange",void 0),ft([k()],de.prototype,"heightRange",void 0),ft([g(!1)],de.prototype,"draggable",void 0),ft([g()],de.prototype,"dragBounds",void 0),ft([g(!1)],de.prototype,"editable",void 0),ft([E(!0)],de.prototype,"hittable",void 0),ft([E("path")],de.prototype,"hitFill",void 0),ft([I("path")],de.prototype,"hitStroke",void 0),ft([E(!1)],de.prototype,"hitBox",void 0),ft([E(!0)],de.prototype,"hitChildren",void 0),ft([E(!0)],de.prototype,"hitSelf",void 0),ft([E()],de.prototype,"hitRadius",void 0),ft([T("")],de.prototype,"cursor",void 0),ft([v()],de.prototype,"fill",void 0),ft([I(void 0,!0)],de.prototype,"stroke",void 0),ft([I("inside")],de.prototype,"strokeAlign",void 0),ft([I(1,!0)],de.prototype,"strokeWidth",void 0),ft([I(!1)],de.prototype,"strokeWidthFixed",void 0),ft([I("none")],de.prototype,"strokeCap",void 0),ft([I("miter")],de.prototype,"strokeJoin",void 0),ft([I()],de.prototype,"dashPattern",void 0),ft([I(0)],de.prototype,"dashOffset",void 0),ft([I(10)],de.prototype,"miterLimit",void 0),ft([W(0)],de.prototype,"cornerRadius",void 0),ft([W()],de.prototype,"cornerSmoothing",void 0),ft([wt()],de.prototype,"shadow",void 0),ft([wt()],de.prototype,"innerShadow",void 0),ft([wt()],de.prototype,"blur",void 0),ft([wt()],de.prototype,"backgroundBlur",void 0),ft([wt()],de.prototype,"grayscale",void 0),ft([wt()],de.prototype,"filter",void 0),ft([v()],de.prototype,"placeholderColor",void 0),ft([g(100)],de.prototype,"placeholderDelay",void 0),ft([g({})],de.prototype,"data",void 0),ft([D(z.prototype.reset)],de.prototype,"reset",null),de=he=ft([L(oe),L(ae),M()],de);let le=class extends de{get __tag(){return"Group"}get isBranch(){return!0}constructor(t){super(t)}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:i}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),i.forEach(t=>this.add(t)),t.children=i}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);return this.childlessJSON||(e.children=this.children.map(e=>e.toJSON(t))),e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};var pe;ft([y(Ht)],le.prototype,"__",void 0),ft([k(0)],le.prototype,"width",void 0),ft([k(0)],le.prototype,"height",void 0),le=ft([L(X),U()],le);const ue=_.get("Leafer");let ce=pe=class extends le{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&J.isComplete}get layoutLocked(){return!this.layouter.running}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||q()}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),pe.list.add(this)}init(t,e){if(this.canvas)return;let i;const{config:s}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),i=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,n.assign(s,t));const o=this.canvas=G.canvas(s);this.__controllers.push(this.renderer=G.renderer(this,o,s),this.watcher=G.watcher(this,s),this.layouter=G.layouter(this,s)),this.isApp&&this.__setApp(),this.__checkAutoLayout(s,e),this.view=o.view,e||(this.selector=G.selector(this),this.interaction=G.interaction(this,o,this.selector,s),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=G.hitCanvasManager()),this.canvasManager=new $,i=s.start),this.hittable=s.hittable,this.fill=s.fill,this.canvasManager.add(o),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),K.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(Q.RESTART):this.emitLeafer(Q.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(Q.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=n.copyAttrs({},t,u);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:i}=this;i&&(i.addBlock(t?new Z(t):this.canvas.bounds),this.viewReady&&(e?i.render():i.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const i=n.copyAttrs({},this.canvas,u);e.resize(t),this.updateLazyBounds(),this.__onResize(new tt(t,i))}__onResize(t){this.emitEvent(t),n.copyAttrs(this.__,t,u),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(t,e){e||(t.width&&t.height||(this.autoLayout=new et(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(u.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t&&(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren()))),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&u.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const i=n.copyAttrs({},this.canvas,u);i[t]=this.config[t]=e,e&&this.canvas.stopAutoLayout(),this.__doResize(i)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(Q.BEFORE_READY),this.emitLeafer(Q.READY),this.emitLeafer(Q.AFTER_READY),K.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(Q.VIEW_READY),K.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:i}=this.config;if(t){let{width:s,height:o,pixelRatio:r}=this;const a="box"===t?this.worldBoxBounds:this.__world;e||(s=Math.max(1,a.x+a.width)),i||(o=Math.max(1,a.y+a.height)),this.__doResize({width:s,height:o,pixelRatio:r})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){K.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(Q.VIEW_COMPLETED),K.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,i){e&&(t=t.bind(e));const s=this.__nextRenderWait;if(i){for(let e=0;e<s.length;e++)if(s[e]===t){s.splice(e,1);break}}else s.push(t);this.requestRender()}zoom(t,e,i,s){return o.need("view")}getValidMove(t,e){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:i}=this.clientBounds;return{x:e+t.x,y:i+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new Q(t,this))}__listenEvents(){const t=it.start("FirstCreate "+this.innerName);this.once([[Q.START,()=>it.end(t)],[st.START,this.updateLazyBounds,this],[ot.START,this.__onCreated,this],[ot.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[rt.DATA,this.__onWatchData,this],[st.END,this.__onLayoutEnd,this],[ot.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){pe.list.remove(this);try{this.stop(),this.emitLeafer(Q.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager.destroy()),this.canvas.destroy(),this.config.view=this.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{at.clearRecycled()},100)}catch(t){ue.error(t)}}};t?e():setTimeout(e)}};ce.list=new j,ft([y(Xt)],ce.prototype,"__",void 0),ft([k()],ce.prototype,"pixelRatio",void 0),ce=pe=ft([U()],ce);let ye=class extends de{get __tag(){return"Rect"}constructor(t){super(t)}};ft([y(qt)],ye.prototype,"__",void 0),ye=ft([L(_e),M(),U()],ye);const{copy:ge,add:ve,includes:fe}=nt,we=ye.prototype,xe=le.prototype,Se={};let me=class extends le{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.pathInputed){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t;if(this.children.length){const e=this.__,{renderBounds:i,boxBounds:s}=this.__layout;super.__updateRenderBounds(),ge(Se,i),this.__updateRectRenderBounds(),(e.scrollY||e.scrollX)&&(Se.x+=e.scrollX,Se.y+=e.scrollY),t=!fe(s,Se),t&&"hide"!==e.overflow&&ve(i,Se)}else this.__updateRectRenderBounds();n.stintSet(this,"isOverflow",t),this.__updateScrollBar()}__updateRectRenderBounds(){}__updateScrollBar(){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.scrollBar&&this.scrollBar.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};ft([y(Ut)],me.prototype,"__",void 0),ft([k(100)],me.prototype,"width",void 0),ft([k(100)],me.prototype,"height",void 0),ft([g(!1)],me.prototype,"resizeChildren",void 0),ft([P("show")],me.prototype,"overflow",void 0),ft([D(we.__updateStrokeSpread)],me.prototype,"__updateStrokeSpread",null),ft([D(we.__updateRenderSpread)],me.prototype,"__updateRectRenderSpread",null),ft([D(we.__updateBoxBounds)],me.prototype,"__updateRectBoxBounds",null),ft([D(we.__updateStrokeBounds)],me.prototype,"__updateStrokeBounds",null),ft([D(we.__updateRenderBounds)],me.prototype,"__updateRectRenderBounds",null),ft([D(we.__updateChange)],me.prototype,"__updateRectChange",null),ft([D(we.__render)],me.prototype,"__renderRect",null),ft([D(xe.__render)],me.prototype,"__renderGroup",null),me=ft([M(),U()],me);let Re=class extends me{get __tag(){return"Frame"}get isFrame(){return!0}constructor(t){super(t)}};ft([y(jt)],Re.prototype,"__",void 0),ft([v("#FFFFFF")],Re.prototype,"fill",void 0),ft([P("hide")],Re.prototype,"overflow",void 0),Re=ft([U()],Re);const{moveTo:ke,closePath:Be,ellipse:be}=_t;let Ae=class extends de{get __tag(){return"Ellipse"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,innerRadius:i,startAngle:s,endAngle:o}=this.__,r=t/2,a=e/2,n=this.__.path=[];i?(s||o?(i<1&&be(n,r,a,r*i,a*i,0,s,o,!1),be(n,r,a,r,a,0,o,s,!0),i<1&&Be(n)):(i<1&&(be(n,r,a,r*i,a*i),ke(n,t,a)),be(n,r,a,r,a,0,360,0,!0)),ht.ellipseToCurve&&(this.__.path=this.getPath(!0))):s||o?(ke(n,r,a),be(n,r,a,r,a,0,s,o,!1),Be(n)):be(n,r,a,r,a)}};ft([y(Gt)],Ae.prototype,"__",void 0),ft([W(0)],Ae.prototype,"innerRadius",void 0),ft([W(0)],Ae.prototype,"startAngle",void 0),ft([W(0)],Ae.prototype,"endAngle",void 0),Ae=ft([U()],Ae);const{moveTo:Ce,lineTo:Pe,drawPoints:Fe}=_t,{rotate:We,getAngle:Ee,getDistance:Ie,defaultPoint:Te}=dt,{toBounds:De}=lt;let ze=class extends de{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i=ut();return t&&(i.x=t),e&&We(i,e),i}set toPoint(t){this.width=Ie(Te,t),this.rotation=Ee(Te,t),this.height&&(this.height=0)}constructor(t){super(t)}__updatePath(){const t=this.__,e=t.path=[];t.points?Fe(e,t.points,!1,t.closed):(Ce(e,0,0),Pe(e,this.width,0))}__updateRenderPath(){const t=this.__;!this.pathInputed&&t.points&&t.curve?(Fe(t.__pathForRender=[],t.points,t.curve,t.closed),t.__useArrow&&bt.addArrows(this,!1)):super.__updateRenderPath()}__updateBoxBounds(){this.points?De(this.__.__pathForRender,this.__layout.boxBounds):super.__updateBoxBounds()}};ft([y(Jt)],ze.prototype,"__",void 0),ft([pt("center")],ze.prototype,"strokeAlign",void 0),ft([k(0)],ze.prototype,"height",void 0),ft([W()],ze.prototype,"points",void 0),ft([W(0)],ze.prototype,"curve",void 0),ft([W(!1)],ze.prototype,"closed",void 0),ze=ft([U()],ze);const{sin:Le,cos:Me,PI:Oe}=Math,{moveTo:Ne,lineTo:Ye,closePath:Ve,drawPoints:He}=_t,Ue=ze.prototype;let Xe=class extends de{get __tag(){return"Polygon"}constructor(t){super(t)}__updatePath(){const t=this.__.path=[];if(this.__.points)He(t,this.__.points,!1,!0);else{const{width:e,height:i,sides:s}=this.__,o=e/2,r=i/2;Ne(t,o,0);for(let e=1;e<s;e++)Ye(t,o+o*Le(2*e*Oe/s),r-r*Me(2*e*Oe/s));Ve(t)}}__updateRenderPath(){}__updateBoxBounds(){}};ft([y($t)],Xe.prototype,"__",void 0),ft([W(3)],Xe.prototype,"sides",void 0),ft([W()],Xe.prototype,"points",void 0),ft([W(0)],Xe.prototype,"curve",void 0),ft([D(Ue.__updateRenderPath)],Xe.prototype,"__updateRenderPath",null),ft([D(Ue.__updateBoxBounds)],Xe.prototype,"__updateBoxBounds",null),Xe=ft([M(),U()],Xe);const{sin:je,cos:Je,PI:qe}=Math,{moveTo:Ge,lineTo:$e,closePath:Ke}=_t;let Qe=class extends de{get __tag(){return"Star"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,corners:i,innerRadius:s}=this.__,o=t/2,r=e/2,a=this.__.path=[];Ge(a,o,0);for(let t=1;t<2*i;t++)$e(a,o+(t%2==0?o:o*s)*je(t*qe/i),r-(t%2==0?r:r*s)*Je(t*qe/i));Ke(a)}};ft([y(Kt)],Qe.prototype,"__",void 0),ft([W(5)],Qe.prototype,"corners",void 0),ft([W(.382)],Qe.prototype,"innerRadius",void 0),Qe=ft([U()],Qe);let Ze=class extends ye{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return p(t)&&t[0].image}constructor(t){super(t)}};ft([y(ie)],Ze.prototype,"__",void 0),ft([k("")],Ze.prototype,"url",void 0),Ze=ft([U()],Ze);const ti=Ze;let ei=class extends ye{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=G.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new ct({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new yt(yt.LOADED,{image:t}))})}draw(t,e,i,s){const o=new gt(t.worldTransform).invert(),r=new gt;e&&r.translate(e.x,e.y),i&&(H(i)?r.scale(i):r.scale(i.x,i.y)),s&&r.rotate(s),o.multiplyParent(r),t.__render(this.canvas,{matrix:o.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:i,height:s}=this.__,{view:o}=this.canvas;t.drawImage(o,0,0,o.width,o.height,0,0,i,s)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:i}=this.__;t.resize(this.__,i),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};ft([y(se)],ei.prototype,"__",void 0),ft([xt(100)],ei.prototype,"width",void 0),ft([xt(100)],ei.prototype,"height",void 0),ft([xt(1)],ei.prototype,"pixelRatio",void 0),ft([xt(!0)],ei.prototype,"smooth",void 0),ft([g(!1)],ei.prototype,"safeResize",void 0),ft([xt()],ei.prototype,"contextSettings",void 0),ei=ft([U()],ei);const{copyAndSpread:ii,includes:si,spread:oi,setList:ri}=nt;let ai=class extends de{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}constructor(t){super(t)}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:i,fontFamily:s,fontSize:o,fontWeight:r,italic:a,textCase:n,textOverflow:_,padding:h}=t;t.__lineHeight=Bt.number(e,o),t.__letterSpacing=Bt.number(i,o),t.__padding=h?O.fourNumber(h):void 0,t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*o)/2,t.__font=`${a?"italic ":""}${"small-caps"===n?"small-caps ":""}${"normal"!==r?r+" ":""}${o}px ${s}`,t.__clipText="show"!==_&&!t.__autoSize,t.__textDrawData=Rt.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:i,italic:s,padding:o,__autoWidth:r,__autoHeight:a}=t;this.__updateTextDrawData();const{bounds:_}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=_,t.__lineHeight<i&&oi(_,i/2),r||a){if(h.x=r?_.x:0,h.y=a?_.y:0,h.width=r?_.width:t.width,h.height=a?_.height:t.height,o){const[e,i,s,o]=t.__padding;r&&(h.x-=o,h.width+=i+o),a&&(h.y-=e,h.height+=s+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();s&&(h.width+=.16*i),n.stintSet(this,"isOverflow",!si(h,_)),this.isOverflow?(ri(t.__textBoxBounds={},[h,_]),e.renderChanged=!0):t.__textBoxBounds=h}__onUpdateSize(){this.__box&&this.__box.__onUpdateSize(),super.__onUpdateSize()}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;ii(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,i){const s=this.__box;s&&(s.__nowWorld=this.__nowWorld,s.__draw(t,e,i)),this.textEditing&&!e.exporting||super.__draw(t,e,i)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};ft([y(ee)],ai.prototype,"__",void 0),ft([k(0)],ai.prototype,"width",void 0),ft([k(0)],ai.prototype,"height",void 0),ft([v()],ai.prototype,"boxStyle",void 0),ft([g(!1)],ai.prototype,"resizeFontSize",void 0),ft([v("#000000")],ai.prototype,"fill",void 0),ft([pt("outside")],ai.prototype,"strokeAlign",void 0),ft([E("all")],ai.prototype,"hitFill",void 0),ft([k("")],ai.prototype,"text",void 0),ft([k("")],ai.prototype,"placeholder",void 0),ft([k("caption")],ai.prototype,"fontFamily",void 0),ft([k(12)],ai.prototype,"fontSize",void 0),ft([k("normal")],ai.prototype,"fontWeight",void 0),ft([k(!1)],ai.prototype,"italic",void 0),ft([k("none")],ai.prototype,"textCase",void 0),ft([k("none")],ai.prototype,"textDecoration",void 0),ft([k(0)],ai.prototype,"letterSpacing",void 0),ft([k({type:"percent",value:1.5})],ai.prototype,"lineHeight",void 0),ft([k(0)],ai.prototype,"paraIndent",void 0),ft([k(0)],ai.prototype,"paraSpacing",void 0),ft([k("x")],ai.prototype,"writingMode",void 0),ft([k("left")],ai.prototype,"textAlign",void 0),ft([k("top")],ai.prototype,"verticalAlign",void 0),ft([k(!0)],ai.prototype,"autoSizeAlign",void 0),ft([k("normal")],ai.prototype,"textWrap",void 0),ft([k("show")],ai.prototype,"textOverflow",void 0),ft([v(!1)],ai.prototype,"textEditing",void 0),ai=ft([U()],ai);let ni=class extends de{get __tag(){return"Path"}constructor(t){super(t)}};ft([y(Qt)],ni.prototype,"__",void 0),ft([pt("center")],ni.prototype,"strokeAlign",void 0),ni=ft([U()],ni);let _i=class extends le{get __tag(){return"Pen"}constructor(t){super(t)}setStyle(t){const e=this.pathElement=new ni(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,i,s,o,r){return this}quadraticCurveTo(t,e,i,s){return this}closePath(){return this}rect(t,e,i,s){return this}roundRect(t,e,i,s,o){return this}ellipse(t,e,i,s,o,r,a,n){return this}arc(t,e,i,s,o,r){return this}arcTo(t,e,i,s,o){return this}drawEllipse(t,e,i,s,o,r,a,n){return this}drawArc(t,e,i,s,o,r){return this}drawPoints(t,e,i){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}};ft([y(Zt)],_i.prototype,"__",void 0),ft([(e,i)=>{t(e,i,{get(){return this.__path}})}],_i.prototype,"path",void 0),_i=ft([L(vt,["set","path","paint"]),U()],_i);export{me as Box,Ut as BoxData,ei as Canvas,se as CanvasData,kt as ColorConvert,Ft as Effect,Ae as Ellipse,Gt as EllipseData,Et as Export,Wt as Filter,Re as Frame,jt as FrameData,le as Group,Ht as GroupData,Ze as Image,ie as ImageData,ce as Leafer,Xt as LeaferData,ze as Line,Jt as LineData,ti as MyImage,At as Paint,Pt as PaintGradient,Ct as PaintImage,ni as Path,bt as PathArrow,Qt as PathData,_i as Pen,Zt as PenData,Xe as Polygon,$t as PolygonData,ye as Rect,qt as RectData,_e as RectRender,Qe as Star,Kt as StarData,It as State,ai as Text,Rt as TextConvert,ee as TextData,Tt as Transition,de as UI,oe as UIBounds,Yt as UIData,ae as UIRender,Bt as UnitConvert,mt as createAttr,wt as effectType,xt as resizeType,St as zoomLayerType};
|
|
1
|
+
import{defineKey as t,decorateLeafAttr as e,attr as i,createDescriptor as s,Plugin as o,isObject as r,PathConvert as a,DataHelper as n,Debug as _,LeafData as h,isString as d,isUndefined as p,isArray as l,canvasSizeAttrs as u,UICreator as c,dataProcessor as y,dataType as g,surfaceType as v,opacityType as f,visibleType as w,sortType as x,maskType as S,eraserType as m,positionType as R,boundsType as k,scaleType as B,rotationType as b,autoLayoutType as A,naturalBoundsType as C,affectRenderBoundsType as P,pathInputType as F,pathType as W,hitType as E,strokeType as I,cursorType as T,rewrite as D,Leaf as z,useModule as L,rewriteAble as M,MathHelper as O,pen as N,PathCorner as Y,PathDrawer as V,isNumber as H,registerUI as U,Branch as X,LeafList as j,Resource as J,getBoundsData as q,Creator as G,CanvasManager as $,WaitHelper as K,LeaferEvent as Q,Bounds as Z,ResizeEvent as tt,AutoBounds as et,Run as it,LayoutEvent as st,RenderEvent as ot,WatchEvent as rt,ImageManager as at,BoundsHelper as nt,PathCommandDataHelper as _t,Platform as ht,PointHelper as dt,PathBounds as pt,affectStrokeBoundsType as lt,getPointData as ut,LeaferImage as ct,ImageEvent as yt,Matrix as gt,PathCreator as vt}from"@leafer/core";export*from"@leafer/core";function ft(t,e,i,s){var o,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var n=t.length-1;n>=0;n--)(o=t[n])&&(a=(r<3?o(a):r>3?o(e,i,a):o(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}function wt(t){return e(t,t=>i({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function xt(t){return e(t,t=>i({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function St(){return(e,i)=>{const s="_"+i;t(e,i,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}function mt(e){return(i,o)=>{t(i,o,s(o,e))}}"function"==typeof SuppressedError&&SuppressedError;const Rt={},kt={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},Bt={number:(t,e)=>r(t)?"percent"===t.type?t.value*e:t.value:t},bt={},At={},Ct={},Pt={},Ft={},Wt={apply(){o.need("filter")}},Et={},It={setStyleName:()=>o.need("state"),set:()=>o.need("state")},Tt={list:{},register(t,e){Tt.list[t]=e},get:t=>Tt.list[t]},{parse:Dt,objectToCanvasData:zt}=a,{stintSet:Lt}=n,{hasTransparent:Mt}=kt,Ot={},Nt=_.get("UIData");class Yt extends h{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,Nt.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Nt.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),d(t)||!t?(Lt(this,"__isTransparentFill",Mt(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):r(t)&&this.__setPaint("fill",t)}setStroke(t){d(t)||!t?(Lt(this,"__isTransparentStroke",Mt(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):r(t)&&this.__setPaint("stroke",t)}setPath(t){const e=d(t);e||t&&r(t[0])?(this.__setInput("path",t),this._path=e?Dt(t):zt(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Vt(this,"shadow",t)}setInnerShadow(t){Vt(this,"innerShadow",t)}setFilter(t){Vt(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&At.compute("fill",this.__leaf),e&&At.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),p(t.strokeWidthFixed)||(i=t.strokeWidthFixed)),i){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const i=this.__leaf.__layout;i.boxChanged||i.boxChange(),l(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=Ot)):(this.__isStrokes=!0,this._stroke||(this._stroke=Ot))}__removePaint(t,e){e&&this.__removeInput(t),Ct.recycleImage(t,this),"fill"===t?(Lt(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(Lt(this,"__isAlphaPixelStroke",void 0),Lt(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function Vt(t,e,i){t.__setInput(e,i),l(i)?(i.some(t=>!1===t.visible)&&(i=i.filter(t=>!1!==t.visible)),i.length||(i=void 0)):i=i&&!1!==i.visible?[i]:void 0,t["_"+e]=i}class Ht extends Yt{}class Ut extends Ht{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"hide"===t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class Xt extends Ht{__getInputData(t,e){const i=super.__getInputData(t,e);return u.forEach(t=>delete i[t]),i}}class jt extends Ut{}class Jt extends Yt{}class qt extends Yt{get __boxStroke(){return!this.__pathInputed}}class Gt extends Yt{get __boxStroke(){return!this.__pathInputed}}class $t extends Yt{}class Kt extends Yt{}class Qt extends Yt{get __pathInputed(){return 2}}class Zt extends Ht{}const te={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class ee extends Yt{get __useNaturalRatio(){return!1}setFontWeight(t){d(t)?(this.__setInput("fontWeight",t),t=te[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,i=e.__box;if(t){const{boxStyle:s}=this;if(i)for(let t in s)i[t]=void 0;else i=e.__box=c.get("Rect",0);const o=e.__layout,r=i.__layout;s||(i.parent=e,i.__world=e.__world,r.boxBounds=o.boxBounds),i.set(t),r.strokeChanged&&o.strokeChange(),r.renderChanged&&o.renderChange(),i.__updateChange()}else i&&(e.__box=i.parent=null,i.destroy());this._boxStyle=t}}class ie extends qt{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:"image",mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return delete t.fill,t}__getInputData(t,e){const i=super.__getInputData(t,e);return delete i.fill,i}}class se extends qt{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const i=super.__getInputData(t,e);return i.url=this.__leaf.canvas.toDataURL("image/png"),i}}const oe={__updateStrokeSpread(){let t=0,e=0;const i=this.__,{strokeAlign:s,__maxStrokeWidth:o}=i,r=this.__box;if((i.stroke||"all"===i.hitStroke)&&o&&"inside"!==s&&(e=t="center"===s?o/2:o,!i.__boxStroke)){const e=i.__isLinePath?0:10*t,s="none"===i.strokeCap?0:o;t+=Math.max(e,s)}return i.__useArrow&&(t+=5*o),r&&(t=Math.max(r.__layout.strokeSpread=r.__updateStrokeSpread(),t),e=r.__layout.strokeBoxSpread),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:i,blur:s,backgroundBlur:o,filter:r,renderSpread:a}=this.__;e&&e.forEach(e=>t=Math.max(t,Math.max(Math.abs(e.y),Math.abs(e.x))+(e.spread>0?e.spread:0)+1.5*e.blur)),s&&(t=Math.max(t,s)),r&&(t+=Wt.getSpread(r)),a&&(t+=a);let n=t=Math.ceil(t);return i&&i.forEach(t=>n=Math.max(n,Math.max(Math.abs(t.y),Math.abs(t.x))+(t.spread<0?-t.spread:0)+1.5*t.blur)),o&&(n=Math.max(n,o)),this.__layout.renderShapeSpread=n,t+=this.__layout.strokeSpread||0,this.__box?Math.max(this.__box.__updateRenderSpread(),t):t}},{stintSet:re}=n,ae={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);re(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),re(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:i,stroke:s}=t,o=t.innerShadow||t.blur||t.backgroundBlur||t.filter;re(t,"__isFastShadow",e&&!o&&e.length<2&&!e[0].spread&&i&&!t.__isTransparentFill&&!(l(i)&&i.length>1)&&(this.useFastShadow||!s||s&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!o)}t.__checkSingle(),re(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){ne(this,t,e)},__draw(t,e,i){const s=this.__;if(s.__complex){s.__needComputePaint&&s.__computePaint();const{fill:o,stroke:r,__drawAfterFill:a,__fillAfterStroke:n,__isFastShadow:_}=s;if(this.__drawRenderPath(t),s.__useEffect&&!_){const _=At.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:h,innerShadow:d,filter:p}=s;h&&Ft.shadow(this,t,_),n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t)),o&&(s.__isFills?At.fills(o,this,t):At.fill(o,this,t)),a&&this.__drawAfterFill(t,e),d&&Ft.innerShadow(this,t,_),r&&!n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t)),p&&Wt.apply(p,this,this.__nowWorld,t,i,_),_.worldCanvas&&_.worldCanvas.recycle(),_.canvas.recycle()}else{if(n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t)),_){const e=s.shadow[0],{scaleX:i,scaleY:o}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*i,e.y*o,e.blur*i,kt.string(e.color))}o&&(s.__isFills?At.fills(o,this,t):At.fill(o,this,t)),_&&t.restore(),a&&this.__drawAfterFill(t,e),r&&!n&&(s.__isStrokes?At.strokes(r,this,t):At.stroke(r,this,t))}}else s.__pathInputed?ne(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const i=this.__,{fill:s,stroke:o}=i;s&&!e.ignoreFill&&(i.__isAlphaPixelFill?At.fills(s,this,t):At.fill("#000000",this,t)),i.__isCanvas&&this.__drawAfterFill(t,e),o&&!e.ignoreStroke&&(i.__isAlphaPixelStroke?At.strokes(o,this,t):At.stroke("#000000",this,t))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function ne(t,e,i){const{fill:s,stroke:o,__drawAfterFill:r,__fillAfterStroke:a}=t.__;t.__drawRenderPath(e),a&&At.stroke(o,t,e),s&&At.fill(s,t,e),r&&t.__drawAfterFill(e,i),o&&!a&&At.stroke(o,t,e)}const _e={__drawFast(t,e){let{x:i,y:s,width:o,height:r}=this.__layout.boxBounds;const{fill:a,stroke:n,__drawAfterFill:_}=this.__;if(a&&(t.fillStyle=a,t.fillRect(i,s,o,r)),_&&this.__drawAfterFill(t,e),n){const{strokeAlign:a,__strokeWidth:_}=this.__;if(!_)return;t.setStroke(n,_,this.__);const h=_/2;switch(a){case"center":t.strokeRect(0,0,o,r);break;case"inside":o-=_,r-=_,o<0||r<0?(t.save(),this.__clip(t,e),t.strokeRect(i+h,s+h,o,r),t.restore()):t.strokeRect(i+h,s+h,o,r);break;case"outside":t.strokeRect(i-h,s-h,o+_,r+_)}}}};var he;let de=he=class extends z{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){O.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return N.set(this.path=t||[]),t||this.__drawPathByBox(N),N}constructor(t){super(t)}reset(t){}set(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))}get(t){return d(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return o.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return o.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let i=e?this.__.__pathForRender:this.__.path;return i||(N.set(i=[]),this.__drawPathByBox(N)),t?a.toCanvasData(i,!0):i}getPathString(t,e,i){return a.stringify(this.getPath(t,e),i)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||Et.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?Y.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&bt.addArrows(this,!t.cornerRadius)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?V.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:i,width:s,height:o}=this.__layout.boxBounds;if(this.__.cornerRadius){const{cornerRadius:r}=this.__;t.roundRect(e,i,s,o,H(r)?[r]:r)}else t.rect(e,i,s,o)}drawImagePlaceholder(t,e){At.fill(this.__.placeholderColor,this,t)}animate(t,e,i,s){return o.need("animate")}killAnimate(t,e){}export(t,e){return o.need("export")}syncExport(t,e){return o.need("export")}clone(t){const e=n.clone(this.toJSON());return t&&Object.assign(e,t),he.one(e)}static one(t,e,i,s,o){return c.get(t.tag||this.prototype.__tag,t,e,i,s,o)}static registerUI(){U()(this)}static registerData(t){y(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};ft([y(Yt)],de.prototype,"__",void 0),ft([St()],de.prototype,"zoomLayer",void 0),ft([g("")],de.prototype,"id",void 0),ft([g("")],de.prototype,"name",void 0),ft([g("")],de.prototype,"className",void 0),ft([v("pass-through")],de.prototype,"blendMode",void 0),ft([f(1)],de.prototype,"opacity",void 0),ft([w(!0)],de.prototype,"visible",void 0),ft([v(!1)],de.prototype,"locked",void 0),ft([v(!1)],de.prototype,"dim",void 0),ft([v(!1)],de.prototype,"dimskip",void 0),ft([x(0)],de.prototype,"zIndex",void 0),ft([S(!1)],de.prototype,"mask",void 0),ft([m(!1)],de.prototype,"eraser",void 0),ft([R(0,!0)],de.prototype,"x",void 0),ft([R(0,!0)],de.prototype,"y",void 0),ft([k(100,!0)],de.prototype,"width",void 0),ft([k(100,!0)],de.prototype,"height",void 0),ft([B(1,!0)],de.prototype,"scaleX",void 0),ft([B(1,!0)],de.prototype,"scaleY",void 0),ft([b(0,!0)],de.prototype,"rotation",void 0),ft([b(0,!0)],de.prototype,"skewX",void 0),ft([b(0,!0)],de.prototype,"skewY",void 0),ft([R(0,!0)],de.prototype,"offsetX",void 0),ft([R(0,!0)],de.prototype,"offsetY",void 0),ft([R(0,!0)],de.prototype,"scrollX",void 0),ft([R(0,!0)],de.prototype,"scrollY",void 0),ft([A()],de.prototype,"origin",void 0),ft([A()],de.prototype,"around",void 0),ft([g(!1)],de.prototype,"lazy",void 0),ft([C(1)],de.prototype,"pixelRatio",void 0),ft([P(0)],de.prototype,"renderSpread",void 0),ft([F()],de.prototype,"path",void 0),ft([W()],de.prototype,"windingRule",void 0),ft([W(!0)],de.prototype,"closed",void 0),ft([k(0)],de.prototype,"padding",void 0),ft([k(!1)],de.prototype,"lockRatio",void 0),ft([k()],de.prototype,"widthRange",void 0),ft([k()],de.prototype,"heightRange",void 0),ft([g(!1)],de.prototype,"draggable",void 0),ft([g()],de.prototype,"dragBounds",void 0),ft([g(!1)],de.prototype,"editable",void 0),ft([E(!0)],de.prototype,"hittable",void 0),ft([E("path")],de.prototype,"hitFill",void 0),ft([I("path")],de.prototype,"hitStroke",void 0),ft([E(!1)],de.prototype,"hitBox",void 0),ft([E(!0)],de.prototype,"hitChildren",void 0),ft([E(!0)],de.prototype,"hitSelf",void 0),ft([E()],de.prototype,"hitRadius",void 0),ft([T("")],de.prototype,"cursor",void 0),ft([v()],de.prototype,"fill",void 0),ft([I(void 0,!0)],de.prototype,"stroke",void 0),ft([I("inside")],de.prototype,"strokeAlign",void 0),ft([I(1,!0)],de.prototype,"strokeWidth",void 0),ft([I(!1)],de.prototype,"strokeWidthFixed",void 0),ft([I("none")],de.prototype,"strokeCap",void 0),ft([I("miter")],de.prototype,"strokeJoin",void 0),ft([I()],de.prototype,"dashPattern",void 0),ft([I(0)],de.prototype,"dashOffset",void 0),ft([I(10)],de.prototype,"miterLimit",void 0),ft([W(0)],de.prototype,"cornerRadius",void 0),ft([W()],de.prototype,"cornerSmoothing",void 0),ft([wt()],de.prototype,"shadow",void 0),ft([wt()],de.prototype,"innerShadow",void 0),ft([wt()],de.prototype,"blur",void 0),ft([wt()],de.prototype,"backgroundBlur",void 0),ft([wt()],de.prototype,"grayscale",void 0),ft([wt()],de.prototype,"filter",void 0),ft([v()],de.prototype,"placeholderColor",void 0),ft([g(100)],de.prototype,"placeholderDelay",void 0),ft([g({})],de.prototype,"data",void 0),ft([D(z.prototype.reset)],de.prototype,"reset",null),de=he=ft([L(oe),L(ae),M()],de);let pe=class extends de{get __tag(){return"Group"}get isBranch(){return!0}constructor(t){super(t)}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:i}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),i.forEach(t=>this.add(t)),t.children=i}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);return this.childlessJSON||(e.children=this.children.map(e=>e.toJSON(t))),e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};var le;ft([y(Ht)],pe.prototype,"__",void 0),ft([k(0)],pe.prototype,"width",void 0),ft([k(0)],pe.prototype,"height",void 0),pe=ft([L(X),U()],pe);const ue=_.get("Leafer");let ce=le=class extends pe{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&J.isComplete}get layoutLocked(){return!this.layouter.running}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||q()}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),le.list.add(this)}init(t,e){if(this.canvas)return;let i;const{config:s}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),i=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,n.assign(s,t));const o=this.canvas=G.canvas(s);this.__controllers.push(this.renderer=G.renderer(this,o,s),this.watcher=G.watcher(this,s),this.layouter=G.layouter(this,s)),this.isApp&&this.__setApp(),this.__checkAutoLayout(s,e),this.view=o.view,e||(this.selector=G.selector(this),this.interaction=G.interaction(this,o,this.selector,s),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=G.hitCanvasManager()),this.canvasManager=new $,i=s.start),this.hittable=s.hittable,this.fill=s.fill,this.canvasManager.add(o),this.__listenEvents(),i&&(this.__startTimer=setTimeout(this.start.bind(this))),K.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(Q.RESTART):this.emitLeafer(Q.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(Q.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=n.copyAttrs({},t,u);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:i}=this;i&&(i.addBlock(t?new Z(t):this.canvas.bounds),this.viewReady&&(e?i.render():i.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const i=n.copyAttrs({},this.canvas,u);e.resize(t),this.updateLazyBounds(),this.__onResize(new tt(t,i))}__onResize(t){this.emitEvent(t),n.copyAttrs(this.__,t,u),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(t,e){e||(t.width&&t.height||(this.autoLayout=new et(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(u.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t&&(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren()))),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&u.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const i=n.copyAttrs({},this.canvas,u);i[t]=this.config[t]=e,e&&this.canvas.stopAutoLayout(),this.__doResize(i)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(Q.BEFORE_READY),this.emitLeafer(Q.READY),this.emitLeafer(Q.AFTER_READY),K.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(Q.VIEW_READY),K.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:i}=this.config;if(t){let{width:s,height:o,pixelRatio:r}=this;const a="box"===t?this.worldBoxBounds:this.__world;e||(s=Math.max(1,a.x+a.width)),i||(o=Math.max(1,a.y+a.height)),this.__doResize({width:s,height:o,pixelRatio:r})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){K.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(Q.VIEW_COMPLETED),K.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,i){e&&(t=t.bind(e));const s=this.__nextRenderWait;if(i){for(let e=0;e<s.length;e++)if(s[e]===t){s.splice(e,1);break}}else s.push(t);this.requestRender()}zoom(t,e,i,s){return o.need("view")}getValidMove(t,e){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:i}=this.clientBounds;return{x:e+t.x,y:i+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new Q(t,this))}__listenEvents(){const t=it.start("FirstCreate "+this.innerName);this.once([[Q.START,()=>it.end(t)],[st.START,this.updateLazyBounds,this],[ot.START,this.__onCreated,this],[ot.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[rt.DATA,this.__onWatchData,this],[st.END,this.__onLayoutEnd,this],[ot.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){le.list.remove(this);try{this.stop(),this.emitLeafer(Q.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager.destroy()),this.canvas.destroy(),this.config.view=this.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{at.clearRecycled()},100)}catch(t){ue.error(t)}}};t?e():setTimeout(e)}};ce.list=new j,ft([y(Xt)],ce.prototype,"__",void 0),ft([k()],ce.prototype,"pixelRatio",void 0),ce=le=ft([U()],ce);let ye=class extends de{get __tag(){return"Rect"}constructor(t){super(t)}};ft([y(qt)],ye.prototype,"__",void 0),ye=ft([L(_e),M(),U()],ye);const{copy:ge,add:ve,includes:fe}=nt,we=ye.prototype,xe=pe.prototype,Se={};let me=class extends pe{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.pathInputed){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t;if(this.children.length){const e=this.__,{renderBounds:i,boxBounds:s}=this.__layout;super.__updateRenderBounds(),ge(Se,i),this.__updateRectRenderBounds(),(e.scrollY||e.scrollX)&&(Se.x+=e.scrollX,Se.y+=e.scrollY),t=!fe(s,Se),t&&"hide"!==e.overflow&&ve(i,Se)}else this.__updateRectRenderBounds();n.stintSet(this,"isOverflow",t),this.__updateScrollBar()}__updateRectRenderBounds(){}__updateScrollBar(){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.scrollBar&&this.scrollBar.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};ft([y(Ut)],me.prototype,"__",void 0),ft([k(100)],me.prototype,"width",void 0),ft([k(100)],me.prototype,"height",void 0),ft([g(!1)],me.prototype,"resizeChildren",void 0),ft([P("show")],me.prototype,"overflow",void 0),ft([D(we.__updateStrokeSpread)],me.prototype,"__updateStrokeSpread",null),ft([D(we.__updateRenderSpread)],me.prototype,"__updateRectRenderSpread",null),ft([D(we.__updateBoxBounds)],me.prototype,"__updateRectBoxBounds",null),ft([D(we.__updateStrokeBounds)],me.prototype,"__updateStrokeBounds",null),ft([D(we.__updateRenderBounds)],me.prototype,"__updateRectRenderBounds",null),ft([D(we.__updateChange)],me.prototype,"__updateRectChange",null),ft([D(we.__render)],me.prototype,"__renderRect",null),ft([D(xe.__render)],me.prototype,"__renderGroup",null),me=ft([M(),U()],me);let Re=class extends me{get __tag(){return"Frame"}get isFrame(){return!0}constructor(t){super(t)}};ft([y(jt)],Re.prototype,"__",void 0),ft([v("#FFFFFF")],Re.prototype,"fill",void 0),ft([P("hide")],Re.prototype,"overflow",void 0),Re=ft([U()],Re);const{moveTo:ke,closePath:Be,ellipse:be}=_t;let Ae=class extends de{get __tag(){return"Ellipse"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,innerRadius:i,startAngle:s,endAngle:o}=this.__,r=t/2,a=e/2,n=this.__.path=[];i?(s||o?(i<1&&be(n,r,a,r*i,a*i,0,s,o,!1),be(n,r,a,r,a,0,o,s,!0),i<1&&Be(n)):(i<1&&(be(n,r,a,r*i,a*i),ke(n,t,a)),be(n,r,a,r,a,0,360,0,!0)),ht.ellipseToCurve&&(this.__.path=this.getPath(!0))):s||o?(ke(n,r,a),be(n,r,a,r,a,0,s,o,!1),Be(n)):be(n,r,a,r,a)}};ft([y(Gt)],Ae.prototype,"__",void 0),ft([W(0)],Ae.prototype,"innerRadius",void 0),ft([W(0)],Ae.prototype,"startAngle",void 0),ft([W(0)],Ae.prototype,"endAngle",void 0),Ae=ft([U()],Ae);const{moveTo:Ce,lineTo:Pe,drawPoints:Fe}=_t,{rotate:We,getAngle:Ee,getDistance:Ie,defaultPoint:Te}=dt,{toBounds:De}=pt;let ze=class extends de{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,i=ut();return t&&(i.x=t),e&&We(i,e),i}set toPoint(t){this.width=Ie(Te,t),this.rotation=Ee(Te,t),this.height&&(this.height=0)}constructor(t){super(t)}__updatePath(){const t=this.__,e=t.path=[];t.points?Fe(e,t.points,!1,t.closed):(Ce(e,0,0),Pe(e,this.width,0))}__updateRenderPath(){const t=this.__;!this.pathInputed&&t.points&&t.curve?(Fe(t.__pathForRender=[],t.points,t.curve,t.closed),t.__useArrow&&bt.addArrows(this,!1)):super.__updateRenderPath()}__updateBoxBounds(){this.points?De(this.__.__pathForRender,this.__layout.boxBounds):super.__updateBoxBounds()}};ft([y(Jt)],ze.prototype,"__",void 0),ft([lt("center")],ze.prototype,"strokeAlign",void 0),ft([k(0)],ze.prototype,"height",void 0),ft([W()],ze.prototype,"points",void 0),ft([W(0)],ze.prototype,"curve",void 0),ft([W(!1)],ze.prototype,"closed",void 0),ze=ft([U()],ze);const{sin:Le,cos:Me,PI:Oe}=Math,{moveTo:Ne,lineTo:Ye,closePath:Ve,drawPoints:He}=_t,Ue=ze.prototype;let Xe=class extends de{get __tag(){return"Polygon"}constructor(t){super(t)}__updatePath(){const t=this.__.path=[];if(this.__.points)He(t,this.__.points,!1,!0);else{const{width:e,height:i,sides:s}=this.__,o=e/2,r=i/2;Ne(t,o,0);for(let e=1;e<s;e++)Ye(t,o+o*Le(2*e*Oe/s),r-r*Me(2*e*Oe/s));Ve(t)}}__updateRenderPath(){}__updateBoxBounds(){}};ft([y($t)],Xe.prototype,"__",void 0),ft([W(3)],Xe.prototype,"sides",void 0),ft([W()],Xe.prototype,"points",void 0),ft([W(0)],Xe.prototype,"curve",void 0),ft([D(Ue.__updateRenderPath)],Xe.prototype,"__updateRenderPath",null),ft([D(Ue.__updateBoxBounds)],Xe.prototype,"__updateBoxBounds",null),Xe=ft([M(),U()],Xe);const{sin:je,cos:Je,PI:qe}=Math,{moveTo:Ge,lineTo:$e,closePath:Ke}=_t;let Qe=class extends de{get __tag(){return"Star"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,corners:i,innerRadius:s}=this.__,o=t/2,r=e/2,a=this.__.path=[];Ge(a,o,0);for(let t=1;t<2*i;t++)$e(a,o+(t%2==0?o:o*s)*je(t*qe/i),r-(t%2==0?r:r*s)*Je(t*qe/i));Ke(a)}};ft([y(Kt)],Qe.prototype,"__",void 0),ft([W(5)],Qe.prototype,"corners",void 0),ft([W(.382)],Qe.prototype,"innerRadius",void 0),Qe=ft([U()],Qe);let Ze=class extends ye{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return l(t)&&t[0].image}constructor(t){super(t)}};ft([y(ie)],Ze.prototype,"__",void 0),ft([k("")],Ze.prototype,"url",void 0),Ze=ft([U()],Ze);const ti=Ze;let ei=class extends ye{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=G.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new ct({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new yt(yt.LOADED,{image:t}))})}draw(t,e,i,s){const o=new gt(t.worldTransform).invert(),r=new gt;e&&r.translate(e.x,e.y),i&&(H(i)?r.scale(i):r.scale(i.x,i.y)),s&&r.rotate(s),o.multiplyParent(r),t.__render(this.canvas,{matrix:o.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:i,height:s}=this.__,{view:o}=this.canvas;t.drawImage(o,0,0,o.width,o.height,0,0,i,s)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:i}=this.__;t.resize(this.__,i),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};ft([y(se)],ei.prototype,"__",void 0),ft([xt(100)],ei.prototype,"width",void 0),ft([xt(100)],ei.prototype,"height",void 0),ft([xt(1)],ei.prototype,"pixelRatio",void 0),ft([xt(!0)],ei.prototype,"smooth",void 0),ft([g(!1)],ei.prototype,"safeResize",void 0),ft([xt()],ei.prototype,"contextSettings",void 0),ei=ft([U()],ei);const{copyAndSpread:ii,includes:si,spread:oi,setList:ri}=nt;let ai=class extends de{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}constructor(t){super(t)}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:i,fontFamily:s,fontSize:o,fontWeight:r,italic:a,textCase:n,textOverflow:_,padding:h}=t;t.__lineHeight=Bt.number(e,o),t.__letterSpacing=Bt.number(i,o),t.__padding=h?O.fourNumber(h):void 0,t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*o)/2,t.__font=`${a?"italic ":""}${"small-caps"===n?"small-caps ":""}${"normal"!==r?r+" ":""}${o||12}px ${s||"caption"}`,t.__clipText="show"!==_&&!t.__autoSize,t.__textDrawData=Rt.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:i,italic:s,padding:o,__autoWidth:r,__autoHeight:a}=t;this.__updateTextDrawData();const{bounds:_}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=_,t.__lineHeight<i&&oi(_,i/2),r||a){if(h.x=r?_.x:0,h.y=a?_.y:0,h.width=r?_.width:t.width,h.height=a?_.height:t.height,o){const[e,i,s,o]=t.__padding;r&&(h.x-=o,h.width+=i+o),a&&(h.y-=e,h.height+=s+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();s&&(h.width+=.16*i),n.stintSet(this,"isOverflow",!si(h,_)),this.isOverflow?(ri(t.__textBoxBounds={},[h,_]),e.renderChanged=!0):t.__textBoxBounds=h}__onUpdateSize(){this.__box&&this.__box.__onUpdateSize(),super.__onUpdateSize()}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;ii(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,i){const s=this.__box;s&&(s.__nowWorld=this.__nowWorld,s.__draw(t,e,i)),this.textEditing&&!e.exporting||super.__draw(t,e,i)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};ft([y(ee)],ai.prototype,"__",void 0),ft([k(0)],ai.prototype,"width",void 0),ft([k(0)],ai.prototype,"height",void 0),ft([v()],ai.prototype,"boxStyle",void 0),ft([g(!1)],ai.prototype,"resizeFontSize",void 0),ft([v("#000000")],ai.prototype,"fill",void 0),ft([lt("outside")],ai.prototype,"strokeAlign",void 0),ft([E("all")],ai.prototype,"hitFill",void 0),ft([k("")],ai.prototype,"text",void 0),ft([k("")],ai.prototype,"placeholder",void 0),ft([k("caption")],ai.prototype,"fontFamily",void 0),ft([k(12)],ai.prototype,"fontSize",void 0),ft([k("normal")],ai.prototype,"fontWeight",void 0),ft([k(!1)],ai.prototype,"italic",void 0),ft([k("none")],ai.prototype,"textCase",void 0),ft([k("none")],ai.prototype,"textDecoration",void 0),ft([k(0)],ai.prototype,"letterSpacing",void 0),ft([k({type:"percent",value:1.5})],ai.prototype,"lineHeight",void 0),ft([k(0)],ai.prototype,"paraIndent",void 0),ft([k(0)],ai.prototype,"paraSpacing",void 0),ft([k("x")],ai.prototype,"writingMode",void 0),ft([k("left")],ai.prototype,"textAlign",void 0),ft([k("top")],ai.prototype,"verticalAlign",void 0),ft([k(!0)],ai.prototype,"autoSizeAlign",void 0),ft([k("normal")],ai.prototype,"textWrap",void 0),ft([k("show")],ai.prototype,"textOverflow",void 0),ft([v(!1)],ai.prototype,"textEditing",void 0),ai=ft([U()],ai);let ni=class extends de{get __tag(){return"Path"}constructor(t){super(t)}};ft([y(Qt)],ni.prototype,"__",void 0),ft([lt("center")],ni.prototype,"strokeAlign",void 0),ni=ft([U()],ni);let _i=class extends pe{get __tag(){return"Pen"}constructor(t){super(t)}setStyle(t){const e=this.pathElement=new ni(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,i,s,o,r){return this}quadraticCurveTo(t,e,i,s){return this}closePath(){return this}rect(t,e,i,s){return this}roundRect(t,e,i,s,o){return this}ellipse(t,e,i,s,o,r,a,n){return this}arc(t,e,i,s,o,r){return this}arcTo(t,e,i,s,o){return this}drawEllipse(t,e,i,s,o,r,a,n){return this}drawArc(t,e,i,s,o,r){return this}drawPoints(t,e,i){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}};ft([y(Zt)],_i.prototype,"__",void 0),ft([(e,i)=>{t(e,i,{get(){return this.__path}})}],_i.prototype,"path",void 0),_i=ft([L(vt,["set","path","paint"]),U()],_i);export{me as Box,Ut as BoxData,ei as Canvas,se as CanvasData,kt as ColorConvert,Ft as Effect,Ae as Ellipse,Gt as EllipseData,Et as Export,Wt as Filter,Re as Frame,jt as FrameData,pe as Group,Ht as GroupData,Ze as Image,ie as ImageData,ce as Leafer,Xt as LeaferData,ze as Line,Jt as LineData,ti as MyImage,At as Paint,Pt as PaintGradient,Ct as PaintImage,ni as Path,bt as PathArrow,Qt as PathData,_i as Pen,Zt as PenData,Xe as Polygon,$t as PolygonData,ye as Rect,qt as RectData,_e as RectRender,Qe as Star,Kt as StarData,It as State,ai as Text,Rt as TextConvert,ee as TextData,Tt as Transition,de as UI,oe as UIBounds,Yt as UIData,ae as UIRender,Bt as UnitConvert,mt as createAttr,wt as effectType,xt as resizeType,St as zoomLayerType};
|
|
2
2
|
//# sourceMappingURL=draw.esm.min.js.map
|