useblocks 1.1.102 → 1.1.103
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/iframe/.vite/manifest.json +4 -4
- package/iframe/{iframe-eblock.1c4e77a0.html → iframe-eblock.b65837b7.html} +2 -2
- package/iframe/{iframe.1c4e77a0.html → iframe.b65837b7.html} +2 -2
- package/iframe/js/{discussHandlers.Xh4-JUcT.js → discussHandlers.B36tbVEC.js} +44 -44
- package/iframe/js/{iframe-eblock.body.1c4e77a0.js → iframe-eblock.body.b65837b7.js} +1 -1
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/{iframe.body.1c4e77a0.js → iframe.body.b65837b7.js} +3 -3
- package/iframe/js/iframe.js +2 -2
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/{b7aa9fec.js → 20098caa.js} +1 -1
- package/static/core/{1b68c0f0.js → 29993987.js} +1 -1
- package/static/core/{6a671446.js → 2a85f6f1.js} +1 -1
- package/static/core/{edf450a1.js → 348ec5fd.js} +1 -1
- package/static/core/{26cc947d.js → 3501b0a6.js} +1 -1
- package/static/core/{11b821ed.js → 36448ec6.js} +1 -1
- package/static/core/{5e7c221f.js → 41dd8b28.js} +13 -13
- package/static/core/{44d2c046.js → 47bde21f.js} +1 -1
- package/static/core/{f1ee2bef.js → 50c87f51.js} +1 -1
- package/static/core/{a98b6879.js → 5c36eb62.js} +1 -1
- package/static/core/{f323e60e.js → 5d7aff4e.js} +1 -1
- package/static/core/{5d849eef.js → 63f26591.js} +1 -1
- package/static/core/{3ec42945.js → 68650ff2.js} +1 -1
- package/static/core/{cc180859.js → 69cf8e2c.js} +1 -1
- package/static/core/{ca4dad9b.js → 6b904901.js} +2 -2
- package/static/core/{3fb172c7.js → 8288f720.js} +1 -1
- package/static/core/{91e07171.js → a013bc08.js} +1 -1
- package/static/core/{a2e57e5f.js → aa3448fe.js} +1 -1
- package/static/core/{448f03f8.js → b7d1fefc.js} +1 -1
- package/static/core/{53103851.js → c9a4d1ef.js} +2 -2
- package/static/core/{ae22b7f6.js → d74756b9.js} +1 -1
- package/static/core/{b653f9c5.js → defdbce4.js} +1 -1
- package/static/core/{64be048b.js → ed8a3337.js} +1 -1
- package/static/core/{847338a8.js → f8819751.js} +1 -1
- package/static/core/{d7666ad0.js → fd8197a8.js} +1 -1
- package/static/umd-runtime/{runtime.2paN090q.js → runtime.D3aKaKTc.js} +1 -1
- package/useblocks-core.b65837b7.js +859 -0
- package/useblocks-esm.js +6 -6
- package/{useblocks-po.1c4e77a0.js → useblocks-po.b65837b7.js} +1 -1
- package/useblocks.d.ts +31 -6
- package/useblocks.js +6 -6
- package/vendor/useblocks-ui-kit/package.json +1 -1
- package/useblocks-core.1c4e77a0.js +0 -859
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){try{if(typeof document<"u"){var e='.blocks-app .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}.blocks-app [data-tippy-root]{max-width:calc(100vw - 10px)}.blocks-app .tippy-box{color:#fff;white-space:normal;background-color:#333;border-radius:4px;outline:0;font-size:14px;line-height:1.4;transition-property:transform,visibility,opacity;position:relative}.blocks-app .tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.blocks-app .tippy-box[data-placement^=top]>.tippy-arrow:before{border-width:8px 8px 0;border-top-color:initial;transform-origin:top;bottom:-7px;left:0}.blocks-app .tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.blocks-app .tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-width:0 8px 8px;border-bottom-color:initial;transform-origin:bottom;top:-7px;left:0}.blocks-app .tippy-box[data-placement^=left]>.tippy-arrow{right:0}.blocks-app .tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;transform-origin:0;right:-7px}.blocks-app .tippy-box[data-placement^=right]>.tippy-arrow{left:0}.blocks-app .tippy-box[data-placement^=right]>.tippy-arrow:before{border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:100%;left:-7px}.blocks-app .tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.blocks-app .tippy-arrow{color:#333;width:16px;height:16px}.blocks-app .tippy-arrow:before{content:"";border-style:solid;border-color:#0000;position:absolute}.blocks-app .tippy-content{z-index:1;padding:5px 9px;position:relative}.blocks-app .tippy-box[data-animation=scale][data-placement^=top]{transform-origin:bottom}.blocks-app .tippy-box[data-animation=scale][data-placement^=bottom]{transform-origin:top}.blocks-app .tippy-box[data-animation=scale][data-placement^=left]{transform-origin:100%}.blocks-app .tippy-box[data-animation=scale][data-placement^=right]{transform-origin:0}.blocks-app .tippy-box[data-animation=scale][data-state=hidden]{opacity:0;transform:scale(.5)}',t=window.__useblocks_styles__||(window.__useblocks_styles__={sheets:{},order:[]}),i=e;if(!t.sheets[i]){var a=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(a=new CSSStyleSheet,a.replaceSync(e))}catch{a=null}if(a){if(!t.host||!t.host.isConnected||!t.host.sheet){var o=document.createElement("style");o.setAttribute("data-useblocks","true"),document.head.appendChild(o),t.host=o}for(var n=t.host.sheet,r=0;r<a.cssRules.length;r++)try{n.insertRule(a.cssRules[r].cssText,n.cssRules.length)}catch{}(t.texts||(t.texts=[])).push(e),(t.listeners||[]).forEach(function(p){try{p(e)}catch{}})}else{var o=document.createElement("style");o.setAttribute("data-useblocks","true"),o.appendChild(document.createTextNode(e)),document.head.appendChild(o)}t.sheets[i]=!0,t.order.push(i)}}}catch(p){console.error("vite-plugin-css-injected-by-js",p)}})();
|
|
2
|
-
__useblocks__.define("static/core/
|
|
2
|
+
__useblocks__.define("static/core/fd8197a8.js",["require","exports","module","static/core/2ff39ddf.js","static/core/c81e0921.js","static/core/d74756b9.js","react","react/jsx-runtime","__delivery__/libs","react-dom","react-dom/client"],function(na,Cc,nH){const De=na("./2ff39ddf.js"),ne=na("./c81e0921.js"),I=na("./d74756b9.js");let u=na("react"),tr=De.__toESM(u,1);u=De.__toESM(u);let xn=na("react/jsx-runtime"),To=na("__delivery__/libs"),Po=na("react-dom"),Qd=na("react-dom/client");Qd=De.__toESM(Qd),ne.init__polyfill_node_global(),ne.init__polyfill_node_process();function m7(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ef(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function tf(t,e){if(t){if(typeof t=="string")return ef(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ef(t,e):void 0}}function v7(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ne._setPrototypeOf(t,e)}function Sc(t){return Sc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Sc(t)}function g7(t,e){if(e&&(ne._typeof(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return m7(t)}function y7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,I.toPropertyKey(r.key),r)}}function b7(t,e,n){return e&&Pp(t.prototype,e),n&&Pp(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ap(t){if(Array.isArray(t))return t}function C7(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,o,l,s,c=[],f=!0,p=!1;try{if(l=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;f=!1}else for(;!(f=(r=l.call(n)).done)&&(c.push(r.value),c.length!==e);f=!0);}catch(m){p=!0,o=m}finally{try{if(!f&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw o}}return c}}function Mp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Te(t,e){return Ap(t)||C7(t,e)||tf(t,e)||Mp()}function de(t,e){if(t==null)return{};var n,r,o=ne._objectWithoutPropertiesLoose(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(r=0;r<l.length;r++)n=l[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var dt=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t._registerNode=t.Konva=t.glob=void 0;var e=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}t.glob=typeof ne._polyfill_node_global_default<"u"?ne._polyfill_node_global_default:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},t.Konva={_global:t.glob,version:"9.3.18",isBrowser:n(),isUnminified:/param/.test(function(o){}.toString()),dblClickWindow:400,getAngle(o){return t.Konva.angleDeg?o*e:o},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return t.Konva.DD.isDragging},isTransforming(){var o;return(o=t.Konva.Transformer)===null||o===void 0?void 0:o.isTransforming()},isDragReady(){return!!t.Konva.DD.node},releaseCanvasOnDestroy:!0,document:t.glob.document,_injectGlobal(o){t.glob.Konva=o}};var r=o=>{t.Konva[o.prototype.getClassName()]=o};t._registerNode=r,t.Konva._injectGlobal(t.Konva)})),Wt=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.Transform=void 0;var e=dt(),n=class f7{constructor(O=[1,0,0,1,0,0]){this.dirty=!1,this.m=O&&O.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new f7(this.m)}copyInto(O){O.m[0]=this.m[0],O.m[1]=this.m[1],O.m[2]=this.m[2],O.m[3]=this.m[3],O.m[4]=this.m[4],O.m[5]=this.m[5]}point(O){const T=this.m;return{x:T[0]*O.x+T[2]*O.y+T[4],y:T[1]*O.x+T[3]*O.y+T[5]}}translate(O,T){return this.m[4]+=this.m[0]*O+this.m[2]*T,this.m[5]+=this.m[1]*O+this.m[3]*T,this}scale(O,T){return this.m[0]*=O,this.m[1]*=O,this.m[2]*=T,this.m[3]*=T,this}rotate(O){const T=Math.cos(O),R=Math.sin(O),L=this.m[0]*T+this.m[2]*R,j=this.m[1]*T+this.m[3]*R,M=this.m[0]*-R+this.m[2]*T,z=this.m[1]*-R+this.m[3]*T;return this.m[0]=L,this.m[1]=j,this.m[2]=M,this.m[3]=z,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(O,T){const R=this.m[0]+this.m[2]*T,L=this.m[1]+this.m[3]*T,j=this.m[2]+this.m[0]*O,M=this.m[3]+this.m[1]*O;return this.m[0]=R,this.m[1]=L,this.m[2]=j,this.m[3]=M,this}multiply(O){const T=this.m[0]*O.m[0]+this.m[2]*O.m[1],R=this.m[1]*O.m[0]+this.m[3]*O.m[1],L=this.m[0]*O.m[2]+this.m[2]*O.m[3],j=this.m[1]*O.m[2]+this.m[3]*O.m[3],M=this.m[0]*O.m[4]+this.m[2]*O.m[5]+this.m[4],z=this.m[1]*O.m[4]+this.m[3]*O.m[5]+this.m[5];return this.m[0]=T,this.m[1]=R,this.m[2]=L,this.m[3]=j,this.m[4]=M,this.m[5]=z,this}invert(){const O=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),T=this.m[3]*O,R=-this.m[1]*O,L=-this.m[2]*O,j=this.m[0]*O,M=O*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),z=O*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=T,this.m[1]=R,this.m[2]=L,this.m[3]=j,this.m[4]=M,this.m[5]=z,this}getMatrix(){return this.m}decompose(){const O=this.m[0],T=this.m[1],R=this.m[2],L=this.m[3],j=this.m[4],M=this.m[5],z=O*L-T*R,k={x:j,y:M,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(O!=0||T!=0){const F=Math.sqrt(O*O+T*T);k.rotation=T>0?Math.acos(O/F):-Math.acos(O/F),k.scaleX=F,k.scaleY=z/F,k.skewX=(O*R+T*L)/z,k.skewY=0}else if(R!=0||L!=0){const F=Math.sqrt(R*R+L*L);k.rotation=Math.PI/2-(L>0?Math.acos(-R/F):-Math.acos(R/F)),k.scaleX=z/F,k.scaleY=F,k.skewX=0,k.skewY=(O*R+T*L)/z}return k.rotation=t.Util._getRotation(k.rotation),k}};t.Transform=n;var r="[object Array]",o="[object Number]",l="[object String]",s="[object Boolean]",c=Math.PI/180,f=180/Math.PI,p="#",m="",_="0",S="Konva warning: ",y="Konva error: ",b="rgb(",g={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},x=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,P=[],C=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(v){setTimeout(v,60)};t.Util={_isElement(v){return!!(v&&v.nodeType==1)},_isFunction(v){return!!(v&&v.constructor&&v.call&&v.apply)},_isPlainObject(v){return!!v&&v.constructor===Object},_isArray(v){return Object.prototype.toString.call(v)===r},_isNumber(v){return Object.prototype.toString.call(v)===o&&!isNaN(v)&&isFinite(v)},_isString(v){return Object.prototype.toString.call(v)===l},_isBoolean(v){return Object.prototype.toString.call(v)===s},isObject(v){return v instanceof Object},isValidSelector(v){if(typeof v!="string")return!1;const O=v[0];return O==="#"||O==="."||O===O.toUpperCase()},_sign(v){return v===0||v>0?1:-1},requestAnimFrame(v){P.push(v),P.length===1&&C(function(){const O=P;P=[],O.forEach(function(T){T()})})},createCanvasElement(){const v=document.createElement("canvas");try{v.style=v.style||{}}catch{}return v},createImageElement(){return document.createElement("img")},_isInDocument(v){for(;v=v.parentNode;)if(v==document)return!0;return!1},_urlToImage(v,O){const T=t.Util.createImageElement();T.onload=function(){O(T)},T.src=v},_rgbToHex(v,O,T){return((1<<24)+(v<<16)+(O<<8)+T).toString(16).slice(1)},_hexToRgb(v){v=v.replace(p,m);const O=parseInt(v,16);return{r:O>>16&255,g:O>>8&255,b:O&255}},getRandomColor(){let v=(Math.random()*16777215<<0).toString(16);for(;v.length<6;)v=_+v;return p+v},getRGB(v){let O;return v in g?(O=g[v],{r:O[0],g:O[1],b:O[2]}):v[0]===p?this._hexToRgb(v.substring(1)):v.substr(0,4)===b?(O=x.exec(v.replace(/ /g,"")),{r:parseInt(O[1],10),g:parseInt(O[2],10),b:parseInt(O[3],10)}):{r:0,g:0,b:0}},colorToRGBA(v){return v=v||"black",t.Util._namedColorToRBA(v)||t.Util._hex3ColorToRGBA(v)||t.Util._hex4ColorToRGBA(v)||t.Util._hex6ColorToRGBA(v)||t.Util._hex8ColorToRGBA(v)||t.Util._rgbColorToRGBA(v)||t.Util._rgbaColorToRGBA(v)||t.Util._hslColorToRGBA(v)},_namedColorToRBA(v){const O=g[v.toLowerCase()];return O?{r:O[0],g:O[1],b:O[2],a:1}:null},_rgbColorToRGBA(v){if(v.indexOf("rgb(")===0){v=v.match(/rgb\(([^)]+)\)/)[1];const O=v.split(/ *, */).map(Number);return{r:O[0],g:O[1],b:O[2],a:1}}},_rgbaColorToRGBA(v){if(v.indexOf("rgba(")===0){v=v.match(/rgba\(([^)]+)\)/)[1];const O=v.split(/ *, */).map((T,R)=>T.slice(-1)==="%"?R===3?parseInt(T)/100:parseInt(T)/100*255:Number(T));return{r:O[0],g:O[1],b:O[2],a:O[3]}}},_hex8ColorToRGBA(v){if(v[0]==="#"&&v.length===9)return{r:parseInt(v.slice(1,3),16),g:parseInt(v.slice(3,5),16),b:parseInt(v.slice(5,7),16),a:parseInt(v.slice(7,9),16)/255}},_hex6ColorToRGBA(v){if(v[0]==="#"&&v.length===7)return{r:parseInt(v.slice(1,3),16),g:parseInt(v.slice(3,5),16),b:parseInt(v.slice(5,7),16),a:1}},_hex4ColorToRGBA(v){if(v[0]==="#"&&v.length===5)return{r:parseInt(v[1]+v[1],16),g:parseInt(v[2]+v[2],16),b:parseInt(v[3]+v[3],16),a:parseInt(v[4]+v[4],16)/255}},_hex3ColorToRGBA(v){if(v[0]==="#"&&v.length===4)return{r:parseInt(v[1]+v[1],16),g:parseInt(v[2]+v[2],16),b:parseInt(v[3]+v[3],16),a:1}},_hslColorToRGBA(v){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(v)){const[O,...T]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(v),R=Number(T[0])/360,L=Number(T[1])/100,j=Number(T[2])/100;let M,z,k;if(L===0)return k=j*255,{r:Math.round(k),g:Math.round(k),b:Math.round(k),a:1};j<.5?M=j*(1+L):M=j+L-j*L;const F=2*j-M,G=[0,0,0];for(let w=0;w<3;w++)z=R+1/3*-(w-1),z<0&&z++,z>1&&z--,6*z<1?k=F+(M-F)*6*z:2*z<1?k=M:3*z<2?k=F+(M-F)*(2/3-z)*6:k=F,G[w]=k*255;return{r:Math.round(G[0]),g:Math.round(G[1]),b:Math.round(G[2]),a:1}}},haveIntersection(v,O){return!(O.x>v.x+v.width||O.x+O.width<v.x||O.y>v.y+v.height||O.y+O.height<v.y)},cloneObject(v){const O={};for(const T in v)this._isPlainObject(v[T])?O[T]=this.cloneObject(v[T]):this._isArray(v[T])?O[T]=this.cloneArray(v[T]):O[T]=v[T];return O},cloneArray(v){return v.slice(0)},degToRad(v){return v*c},radToDeg(v){return v*f},_degToRad(v){return t.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),t.Util.degToRad(v)},_radToDeg(v){return t.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),t.Util.radToDeg(v)},_getRotation(v){return e.Konva.angleDeg?t.Util.radToDeg(v):v},_capitalize(v){return v.charAt(0).toUpperCase()+v.slice(1)},throw(v){throw new Error(y+v)},error(v){},warn(v){e.Konva.showWarnings},each(v,O){for(const T in v)O(T,v[T])},_inRange(v,O,T){return O<=v&&v<T},_getProjectionToSegment(v,O,T,R,L,j){let M,z,k;const F=(v-T)*(v-T)+(O-R)*(O-R);if(F==0)M=v,z=O,k=(L-T)*(L-T)+(j-R)*(j-R);else{const G=((L-v)*(T-v)+(j-O)*(R-O))/F;G<0?(M=v,z=O,k=(v-L)*(v-L)+(O-j)*(O-j)):G>1?(M=T,z=R,k=(T-L)*(T-L)+(R-j)*(R-j)):(M=v+G*(T-v),z=O+G*(R-O),k=(M-L)*(M-L)+(z-j)*(z-j))}return[M,z,k]},_getProjectionToLine(v,O,T){const R=t.Util.cloneObject(v);let L=Number.MAX_VALUE;return O.forEach(function(j,M){if(!T&&M===O.length-1)return;const z=O[(M+1)%O.length],k=t.Util._getProjectionToSegment(j.x,j.y,z.x,z.y,v.x,v.y),F=k[0],G=k[1],w=k[2];w<L&&(R.x=F,R.y=G,L=w)}),R},_prepareArrayForTween(v,O,T){const R=[],L=[];if(v.length>O.length){const M=O;O=v,v=M}for(let M=0;M<v.length;M+=2)R.push({x:v[M],y:v[M+1]});for(let M=0;M<O.length;M+=2)L.push({x:O[M],y:O[M+1]});const j=[];return L.forEach(function(M){const z=t.Util._getProjectionToLine(M,R,T);j.push(z.x),j.push(z.y)}),j},_prepareToStringify(v){let O;v.visitedByCircularReferenceRemoval=!0;for(const T in v)if(v.hasOwnProperty(T)&&v[T]&&typeof v[T]=="object"){if(O=Object.getOwnPropertyDescriptor(v,T),v[T].visitedByCircularReferenceRemoval||t.Util._isElement(v[T]))if(O.configurable)delete v[T];else return null;else if(t.Util._prepareToStringify(v[T])===null)if(O.configurable)delete v[T];else return null}return delete v.visitedByCircularReferenceRemoval,v},_assign(v,O){for(const T in O)v[T]=O[T];return v},_getFirstPointerId(v){return v.touches?v.changedTouches[0].identifier:v.pointerId||999},releaseCanvas(...v){e.Konva.releaseCanvasOnDestroy&&v.forEach(O=>{O.width=0,O.height=0})},drawRoundedRectPath(v,O,T,R){let L=0,j=0,M=0,z=0;typeof R=="number"?L=j=M=z=Math.min(R,O/2,T/2):(L=Math.min(R[0]||0,O/2,T/2),j=Math.min(R[1]||0,O/2,T/2),z=Math.min(R[2]||0,O/2,T/2),M=Math.min(R[3]||0,O/2,T/2)),v.moveTo(L,0),v.lineTo(O-j,0),v.arc(O-j,j,j,Math.PI*3/2,0,!1),v.lineTo(O,T-z),v.arc(O-z,T-z,z,0,Math.PI/2,!1),v.lineTo(M,T),v.arc(M,T-M,M,Math.PI/2,Math.PI,!1),v.lineTo(0,L),v.arc(L,L,L,Math.PI,Math.PI*3/2,!1)}}})),pt=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RGBComponent=o,t.alphaComponent=l,t.getNumberValidator=s,t.getNumberOrArrayOfNumbersValidator=c,t.getNumberOrAutoValidator=f,t.getStringValidator=p,t.getStringOrGradientValidator=m,t.getFunctionValidator=_,t.getNumberArrayValidator=S,t.getBooleanValidator=y,t.getComponentValidator=b;var e=dt(),n=Wt();function r(g){return n.Util._isString(g)?'"'+g+'"':Object.prototype.toString.call(g)==="[object Number]"||n.Util._isBoolean(g)?g:Object.prototype.toString.call(g)}function o(g){return g>255?255:g<0?0:Math.round(g)}function l(g){return g>1?1:g<1e-4?1e-4:g}function s(){if(e.Konva.isUnminified)return function(g,x){return n.Util._isNumber(g)||n.Util.warn(r(g)+' is a not valid value for "'+x+'" attribute. The value should be a number.'),g}}function c(g){if(e.Konva.isUnminified)return function(x,P){let C=n.Util._isNumber(x),v=n.Util._isArray(x)&&x.length==g;return!C&&!v&&n.Util.warn(r(x)+' is a not valid value for "'+P+'" attribute. The value should be a number or Array<number>('+g+")"),x}}function f(){if(e.Konva.isUnminified)return function(g,x){return n.Util._isNumber(g)||g==="auto"||n.Util.warn(r(g)+' is a not valid value for "'+x+'" attribute. The value should be a number or "auto".'),g}}function p(){if(e.Konva.isUnminified)return function(g,x){return n.Util._isString(g)||n.Util.warn(r(g)+' is a not valid value for "'+x+'" attribute. The value should be a string.'),g}}function m(){if(e.Konva.isUnminified)return function(g,x){const P=n.Util._isString(g),C=Object.prototype.toString.call(g)==="[object CanvasGradient]"||g&&g.addColorStop;return P||C||n.Util.warn(r(g)+' is a not valid value for "'+x+'" attribute. The value should be a string or a native gradient.'),g}}function _(){if(e.Konva.isUnminified)return function(g,x){return n.Util._isFunction(g)||n.Util.warn(r(g)+' is a not valid value for "'+x+'" attribute. The value should be a function.'),g}}function S(){if(e.Konva.isUnminified)return function(g,x){const P=Int8Array?Object.getPrototypeOf(Int8Array):null;return P&&g instanceof P||(n.Util._isArray(g)?g.forEach(function(C){n.Util._isNumber(C)||n.Util.warn('"'+x+'" attribute has non numeric element '+C+". Make sure that all elements are numbers.")}):n.Util.warn(r(g)+' is a not valid value for "'+x+'" attribute. The value should be a array of numbers.')),g}}function y(){if(e.Konva.isUnminified)return function(g,x){return g===!0||g===!1||n.Util.warn(r(g)+' is a not valid value for "'+x+'" attribute. The value should be a boolean.'),g}}function b(g){if(e.Konva.isUnminified)return function(x,P){return x==null||n.Util.isObject(x)||n.Util.warn(r(x)+' is a not valid value for "'+P+'" attribute. The value should be an object with properties '+g),x}}})),ft=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Factory=void 0;var e=Wt(),n=pt(),r="get",o="set";t.Factory={addGetterSetter(l,s,c,f,p){t.Factory.addGetter(l,s,c),t.Factory.addSetter(l,s,f,p),t.Factory.addOverloadedGetterSetter(l,s)},addGetter(l,s,c){var f=r+e.Util._capitalize(s);l.prototype[f]=l.prototype[f]||function(){const p=this.attrs[s];return p===void 0?c:p}},addSetter(l,s,c,f){var p=o+e.Util._capitalize(s);l.prototype[p]||t.Factory.overWriteSetter(l,s,c,f)},overWriteSetter(l,s,c,f){var p=o+e.Util._capitalize(s);l.prototype[p]=function(m){return c&&m!==void 0&&m!==null&&(m=c.call(this,m,s)),this._setAttr(s,m),f&&f.call(this),this}},addComponentsGetterSetter(l,s,c,f,p){const m=c.length,_=e.Util._capitalize,S=r+_(s),y=o+_(s);l.prototype[S]=function(){const g={};for(let x=0;x<m;x++){const P=c[x];g[P]=this.getAttr(s+_(P))}return g};const b=(0,n.getComponentValidator)(c);l.prototype[y]=function(g){const x=this.attrs[s];f&&(g=f.call(this,g,s)),b&&b.call(this,g,s);for(const P in g)g.hasOwnProperty(P)&&this._setAttr(s+_(P),g[P]);return g||c.forEach(P=>{this._setAttr(s+_(P),void 0)}),this._fireChangeEvent(s,x,g),p&&p.call(this),this},t.Factory.addOverloadedGetterSetter(l,s)},addOverloadedGetterSetter(l,s){var c=e.Util._capitalize(s),f=o+c,p=r+c;l.prototype[s]=function(){return arguments.length?(this[f](arguments[0]),this):this[p]()}},addDeprecatedGetterSetter(l,s,c,f){e.Util.error("Adding deprecated "+s);const p=r+e.Util._capitalize(s),m=s+" property is deprecated and will be removed soon. Look at Konva change log for more information.";l.prototype[p]=function(){e.Util.error(m);const _=this.attrs[s];return _===void 0?c:_},t.Factory.addSetter(l,s,f,function(){e.Util.error(m)}),t.Factory.addOverloadedGetterSetter(l,s)},backCompat(l,s){e.Util.each(s,function(c,f){const p=l.prototype[f],m=r+e.Util._capitalize(c),_=o+e.Util._capitalize(c);function S(){p.apply(this,arguments),e.Util.error('"'+c+'" method is deprecated and will be removed soon. Use ""'+f+'" instead.')}l.prototype[c]=S,l.prototype[m]=S,l.prototype[_]=S})},afterSetFilter(){this._filterUpToDate=!1}}})),Ip=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HitContext=t.SceneContext=t.Context=void 0;var e=Wt(),n=dt();function r(C){const v=[],O=C.length,T=e.Util;for(let R=0;R<O;R++){let L=C[R];T._isNumber(L)?L=Math.round(L*1e3)/1e3:T._isString(L)||(L=L+""),v.push(L)}return v}var o=",",l="(",s=")",c="([",f="])",p=";",m="()",_="=",S=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],y=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],b=100,g=class{constructor(C){this.canvas=C,n.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(C){C.fillEnabled()&&this._fill(C)}_fill(C){}strokeShape(C){C.hasStroke()&&this._stroke(C)}_stroke(C){}fillStrokeShape(C){C.attrs.fillAfterStrokeEnabled?(this.strokeShape(C),this.fillShape(C)):(this.fillShape(C),this.strokeShape(C))}getTrace(C,v){let O=this.traceArr,T=O.length,R="",L,j,M,z;for(L=0;L<T;L++)j=O[L],M=j.method,M?(z=j.args,R+=M,C?R+=m:e.Util._isArray(z[0])?R+=c+z.join(o)+f:(v&&(z=z.map(k=>typeof k=="number"?Math.floor(k):k)),R+=l+z.join(o)+s)):(R+=j.property,C||(R+=_+j.val)),R+=p;return R}clearTrace(){this.traceArr=[]}_trace(C){let v=this.traceArr,O;v.push(C),O=v.length,O>=b&&v.shift()}reset(){const C=this.getCanvas().getPixelRatio();this.setTransform(1*C,0,0,1*C,0,0)}getCanvas(){return this.canvas}clear(C){const v=this.getCanvas();C?this.clearRect(C.x||0,C.y||0,C.width||0,C.height||0):this.clearRect(0,0,v.getWidth()/v.pixelRatio,v.getHeight()/v.pixelRatio)}_applyLineCap(C){const v=C.attrs.lineCap;v&&this.setAttr("lineCap",v)}_applyOpacity(C){const v=C.getAbsoluteOpacity();v!==1&&this.setAttr("globalAlpha",v)}_applyLineJoin(C){const v=C.attrs.lineJoin;v&&this.setAttr("lineJoin",v)}setAttr(C,v){this._context[C]=v}arc(C,v,O,T,R,L){this._context.arc(C,v,O,T,R,L)}arcTo(C,v,O,T,R){this._context.arcTo(C,v,O,T,R)}beginPath(){this._context.beginPath()}bezierCurveTo(C,v,O,T,R,L){this._context.bezierCurveTo(C,v,O,T,R,L)}clearRect(C,v,O,T){this._context.clearRect(C,v,O,T)}clip(...C){this._context.clip.apply(this._context,C)}closePath(){this._context.closePath()}createImageData(C,v){const O=arguments;if(O.length===2)return this._context.createImageData(C,v);if(O.length===1)return this._context.createImageData(C)}createLinearGradient(C,v,O,T){return this._context.createLinearGradient(C,v,O,T)}createPattern(C,v){return this._context.createPattern(C,v)}createRadialGradient(C,v,O,T,R,L){return this._context.createRadialGradient(C,v,O,T,R,L)}drawImage(C,v,O,T,R,L,j,M,z){const k=arguments,F=this._context;k.length===3?F.drawImage(C,v,O):k.length===5?F.drawImage(C,v,O,T,R):k.length===9&&F.drawImage(C,v,O,T,R,L,j,M,z)}ellipse(C,v,O,T,R,L,j,M){this._context.ellipse(C,v,O,T,R,L,j,M)}isPointInPath(C,v,O,T){return O?this._context.isPointInPath(O,C,v,T):this._context.isPointInPath(C,v,T)}fill(...C){this._context.fill.apply(this._context,C)}fillRect(C,v,O,T){this._context.fillRect(C,v,O,T)}strokeRect(C,v,O,T){this._context.strokeRect(C,v,O,T)}fillText(C,v,O,T){T?this._context.fillText(C,v,O,T):this._context.fillText(C,v,O)}measureText(C){return this._context.measureText(C)}getImageData(C,v,O,T){return this._context.getImageData(C,v,O,T)}lineTo(C,v){this._context.lineTo(C,v)}moveTo(C,v){this._context.moveTo(C,v)}rect(C,v,O,T){this._context.rect(C,v,O,T)}roundRect(C,v,O,T,R){this._context.roundRect(C,v,O,T,R)}putImageData(C,v,O){this._context.putImageData(C,v,O)}quadraticCurveTo(C,v,O,T){this._context.quadraticCurveTo(C,v,O,T)}restore(){this._context.restore()}rotate(C){this._context.rotate(C)}save(){this._context.save()}scale(C,v){this._context.scale(C,v)}setLineDash(C){this._context.setLineDash?this._context.setLineDash(C):"mozDash"in this._context?this._context.mozDash=C:"webkitLineDash"in this._context&&(this._context.webkitLineDash=C)}getLineDash(){return this._context.getLineDash()}setTransform(C,v,O,T,R,L){this._context.setTransform(C,v,O,T,R,L)}stroke(C){C?this._context.stroke(C):this._context.stroke()}strokeText(C,v,O,T){this._context.strokeText(C,v,O,T)}transform(C,v,O,T,R,L){this._context.transform(C,v,O,T,R,L)}translate(C,v){this._context.translate(C,v)}_enableTrace(){let C=this,v=S.length,O=this.setAttr,T,R;const L=function(j){let M=C[j],z;C[j]=function(){return R=r(Array.prototype.slice.call(arguments,0)),z=M.apply(C,arguments),C._trace({method:j,args:R}),z}};for(T=0;T<v;T++)L(S[T]);C.setAttr=function(){O.apply(C,arguments);const j=arguments[0];let M=arguments[1];(j==="shadowOffsetX"||j==="shadowOffsetY"||j==="shadowBlur")&&(M=M/this.canvas.getPixelRatio()),C._trace({property:j,val:M})}}_applyGlobalCompositeOperation(C){const v=C.attrs.globalCompositeOperation;!v||v==="source-over"||this.setAttr("globalCompositeOperation",v)}};t.Context=g,y.forEach(function(C){Object.defineProperty(g.prototype,C,{get(){return this._context[C]},set(v){this._context[C]=v}})});var x=class extends g{constructor(C,{willReadFrequently:v=!1}={}){super(C),this._context=C._canvas.getContext("2d",{willReadFrequently:v})}_fillColor(C){const v=C.fill();this.setAttr("fillStyle",v),C._fillFunc(this)}_fillPattern(C){this.setAttr("fillStyle",C._getFillPattern()),C._fillFunc(this)}_fillLinearGradient(C){const v=C._getLinearGradient();v&&(this.setAttr("fillStyle",v),C._fillFunc(this))}_fillRadialGradient(C){const v=C._getRadialGradient();v&&(this.setAttr("fillStyle",v),C._fillFunc(this))}_fill(C){const v=C.fill(),O=C.getFillPriority();if(v&&O==="color"){this._fillColor(C);return}const T=C.getFillPatternImage();if(T&&O==="pattern"){this._fillPattern(C);return}const R=C.getFillLinearGradientColorStops();if(R&&O==="linear-gradient"){this._fillLinearGradient(C);return}const L=C.getFillRadialGradientColorStops();if(L&&O==="radial-gradient"){this._fillRadialGradient(C);return}v?this._fillColor(C):T?this._fillPattern(C):R?this._fillLinearGradient(C):L&&this._fillRadialGradient(C)}_strokeLinearGradient(C){const v=C.getStrokeLinearGradientStartPoint(),O=C.getStrokeLinearGradientEndPoint(),T=C.getStrokeLinearGradientColorStops(),R=this.createLinearGradient(v.x,v.y,O.x,O.y);if(T){for(let L=0;L<T.length;L+=2)R.addColorStop(T[L],T[L+1]);this.setAttr("strokeStyle",R)}}_stroke(C){const v=C.dash(),O=C.getStrokeScaleEnabled();if(C.hasStroke()){if(!O){this.save();const T=this.getCanvas().getPixelRatio();this.setTransform(T,0,0,T,0,0)}this._applyLineCap(C),v&&C.dashEnabled()&&(this.setLineDash(v),this.setAttr("lineDashOffset",C.dashOffset())),this.setAttr("lineWidth",C.strokeWidth()),C.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),C.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(C):this.setAttr("strokeStyle",C.stroke()),C._strokeFunc(this),O||this.restore()}}_applyShadow(C){var v,O,T;const R=(v=C.getShadowRGBA())!==null&&v!==void 0?v:"black",L=(O=C.getShadowBlur())!==null&&O!==void 0?O:5,j=(T=C.getShadowOffset())!==null&&T!==void 0?T:{x:0,y:0},M=C.getAbsoluteScale(),z=this.canvas.getPixelRatio(),k=M.x*z,F=M.y*z;this.setAttr("shadowColor",R),this.setAttr("shadowBlur",L*Math.min(Math.abs(k),Math.abs(F))),this.setAttr("shadowOffsetX",j.x*k),this.setAttr("shadowOffsetY",j.y*F)}};t.SceneContext=x;var P=class extends g{constructor(C){super(C),this._context=C._canvas.getContext("2d",{willReadFrequently:!0})}_fill(C){this.save(),this.setAttr("fillStyle",C.colorKey),C._fillFuncHit(this),this.restore()}strokeShape(C){C.hasHitStroke()&&this._stroke(C)}_stroke(C){if(C.hasHitStroke()){const v=C.getStrokeScaleEnabled();if(!v){this.save();const R=this.getCanvas().getPixelRatio();this.setTransform(R,0,0,R,0,0)}this._applyLineCap(C);const O=C.hitStrokeWidth(),T=O==="auto"?C.strokeWidth():O;this.setAttr("lineWidth",T),this.setAttr("strokeStyle",C.colorKey),C._strokeFuncHit(this),v||this.restore()}}};t.HitContext=P})),_c=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HitCanvas=t.SceneCanvas=t.Canvas=void 0;var e=Wt(),n=Ip(),r=dt(),o=ft(),l=pt(),s;function c(){if(s)return s;const _=e.Util.createCanvasElement(),S=_.getContext("2d");return s=(function(){return(r.Konva._global.devicePixelRatio||1)/(S.webkitBackingStorePixelRatio||S.mozBackingStorePixelRatio||S.msBackingStorePixelRatio||S.oBackingStorePixelRatio||S.backingStorePixelRatio||1)})(),e.Util.releaseCanvas(_),s}var f=class{constructor(_){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const S=(_||{}).pixelRatio||r.Konva.pixelRatio||c();this.pixelRatio=S,this._canvas=e.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(_){const S=this.pixelRatio;this.pixelRatio=_,this.setSize(this.getWidth()/S,this.getHeight()/S)}setWidth(_){this.width=this._canvas.width=_*this.pixelRatio,this._canvas.style.width=_+"px";const S=this.pixelRatio;this.getContext()._context.scale(S,S)}setHeight(_){this.height=this._canvas.height=_*this.pixelRatio,this._canvas.style.height=_+"px";const S=this.pixelRatio;this.getContext()._context.scale(S,S)}getWidth(){return this.width}getHeight(){return this.height}setSize(_,S){this.setWidth(_||0),this.setHeight(S||0)}toDataURL(_,S){try{return this._canvas.toDataURL(_,S)}catch{try{return this._canvas.toDataURL()}catch(b){return e.Util.error("Unable to get data URL. "+b.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}};t.Canvas=f,o.Factory.addGetterSetter(f,"pixelRatio",void 0,(0,l.getNumberValidator)());var p=class extends f{constructor(_={width:0,height:0,willReadFrequently:!1}){super(_),this.context=new n.SceneContext(this,{willReadFrequently:_.willReadFrequently}),this.setSize(_.width,_.height)}};t.SceneCanvas=p;var m=class extends f{constructor(_={width:0,height:0}){super(_),this.hitCanvas=!0,this.context=new n.HitContext(this),this.setSize(_.width,_.height)}};t.HitCanvas=m})),nf=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DD=void 0;var e=dt(),n=Wt();t.DD={get isDragging(){let r=!1;return t.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){let r;return t.DD._dragElements.forEach(o=>{r=o.node}),r},_dragElements:new Map,_drag(r){const o=[];t.DD._dragElements.forEach((l,s)=>{const{node:c}=l,f=c.getStage();f.setPointersPositions(r),l.pointerId===void 0&&(l.pointerId=n.Util._getFirstPointerId(r));const p=f._changedPointerPositions.find(m=>m.id===l.pointerId);if(p){if(l.dragStatus!=="dragging"){const m=c.dragDistance();if(Math.max(Math.abs(p.x-l.startPointerPos.x),Math.abs(p.y-l.startPointerPos.y))<m||(c.startDrag({evt:r}),!c.isDragging()))return}c._setDragPosition(r,l),o.push(c)}}),o.forEach(l=>{l.fire("dragmove",{type:"dragmove",target:l,evt:r},!0)})},_endDragBefore(r){const o=[];t.DD._dragElements.forEach(l=>{const{node:s}=l,c=s.getStage();if(r&&c.setPointersPositions(r),!c._changedPointerPositions.find(p=>p.id===l.pointerId))return;(l.dragStatus==="dragging"||l.dragStatus==="stopped")&&(t.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,l.dragStatus="stopped");const f=l.node.getLayer()||l.node instanceof e.Konva.Stage&&l.node;f&&o.indexOf(f)===-1&&o.push(f)}),o.forEach(l=>{l.draw()})},_endDragAfter(r){t.DD._dragElements.forEach((o,l)=>{o.dragStatus==="stopped"&&o.node.fire("dragend",{type:"dragend",target:o.node,evt:r},!0),o.dragStatus!=="dragging"&&t.DD._dragElements.delete(l)})}},e.Konva.isBrowser&&(window.addEventListener("mouseup",t.DD._endDragBefore,!0),window.addEventListener("touchend",t.DD._endDragBefore,!0),window.addEventListener("touchcancel",t.DD._endDragBefore,!0),window.addEventListener("mousemove",t.DD._drag),window.addEventListener("touchmove",t.DD._drag),window.addEventListener("mouseup",t.DD._endDragAfter,!1),window.addEventListener("touchend",t.DD._endDragAfter,!1),window.addEventListener("touchcancel",t.DD._endDragAfter,!1))})),an=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Node=void 0;var e=Wt(),n=ft(),r=_c(),o=dt(),l=nf(),s=pt(),c="absoluteOpacity",f="allEventListeners",p="absoluteTransform",m="absoluteScale",_="canvas",S="Change",y="children",b="konva",g="listening",x="mouseenter",P="mouseleave",C="set",v="Shape",O=" ",T="stage",R="transform",L="Stage",j="visible",M=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(O),z=1,k=class Tp{constructor(w){this._id=z++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(w),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(w){(w===R||w===p)&&this._cache.get(w)?this._cache.get(w).dirty=!0:w?this._cache.delete(w):this._cache.clear()}_getCache(w,D){let N=this._cache.get(w);return(N===void 0||(w===R||w===p)&&N.dirty===!0)&&(N=D.call(this),this._cache.set(w,N)),N}_calculate(w,D,N){if(!this._attachedDepsListeners.get(w)){const H=D.map(V=>V+"Change.konva").join(O);this.on(H,()=>{this._clearCache(w)}),this._attachedDepsListeners.set(w,!0)}return this._getCache(w,N)}_getCanvasCache(){return this._cache.get(_)}_clearSelfAndDescendantCache(w){this._clearCache(w),w===p&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(_)){const{scene:w,filter:D,hit:N}=this._cache.get(_);e.Util.releaseCanvas(w,D,N),this._cache.delete(_)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(w){const D=w||{};let N={};(D.x===void 0||D.y===void 0||D.width===void 0||D.height===void 0)&&(N=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let H=Math.ceil(D.width||N.width),V=Math.ceil(D.height||N.height),W=D.pixelRatio,U=D.x===void 0?Math.floor(N.x):D.x,Q=D.y===void 0?Math.floor(N.y):D.y,ae=D.offset||0,Z=D.drawBorder||!1,ie=D.hitCanvasPixelRatio||1;if(!H||!V){e.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const te=Math.abs(Math.round(N.x)-U)>.5?1:0,X=Math.abs(Math.round(N.y)-Q)>.5?1:0;H+=ae*2+te,V+=ae*2+X,U-=ae,Q-=ae;const K=new r.SceneCanvas({pixelRatio:W,width:H,height:V}),le=new r.SceneCanvas({pixelRatio:W,width:0,height:0,willReadFrequently:!0}),fe=new r.HitCanvas({pixelRatio:ie,width:H,height:V}),ue=K.getContext(),he=fe.getContext();return fe.isCache=!0,K.isCache=!0,this._cache.delete(_),this._filterUpToDate=!1,D.imageSmoothingEnabled===!1&&(K.getContext()._context.imageSmoothingEnabled=!1,le.getContext()._context.imageSmoothingEnabled=!1),ue.save(),he.save(),ue.translate(-U,-Q),he.translate(-U,-Q),this._isUnderCache=!0,this._clearSelfAndDescendantCache(c),this._clearSelfAndDescendantCache(m),this.drawScene(K,this),this.drawHit(fe,this),this._isUnderCache=!1,ue.restore(),he.restore(),Z&&(ue.save(),ue.beginPath(),ue.rect(0,0,H,V),ue.closePath(),ue.setAttr("strokeStyle","red"),ue.setAttr("lineWidth",5),ue.stroke(),ue.restore()),this._cache.set(_,{scene:K,filter:le,hit:fe,x:U,y:Q}),this._requestDraw(),this}isCached(){return this._cache.has(_)}getClientRect(w){throw new Error('abstract "getClientRect" method call')}_transformedRect(w,D){const N=[{x:w.x,y:w.y},{x:w.x+w.width,y:w.y},{x:w.x+w.width,y:w.y+w.height},{x:w.x,y:w.y+w.height}];let H=1/0,V=1/0,W=-1/0,U=-1/0;const Q=this.getAbsoluteTransform(D);return N.forEach(function(ae){const Z=Q.point(ae);H===void 0&&(H=W=Z.x,V=U=Z.y),H=Math.min(H,Z.x),V=Math.min(V,Z.y),W=Math.max(W,Z.x),U=Math.max(U,Z.y)}),{x:H,y:V,width:W-H,height:U-V}}_drawCachedSceneCanvas(w){w.save(),w._applyOpacity(this),w._applyGlobalCompositeOperation(this);const D=this._getCanvasCache();w.translate(D.x,D.y);const N=this._getCachedSceneCanvas(),H=N.pixelRatio;w.drawImage(N._canvas,0,0,N.width/H,N.height/H),w.restore()}_drawCachedHitCanvas(w){const D=this._getCanvasCache(),N=D.hit;w.save(),w.translate(D.x,D.y),w.drawImage(N._canvas,0,0,N.width/N.pixelRatio,N.height/N.pixelRatio),w.restore()}_getCachedSceneCanvas(){let w=this.filters(),D=this._getCanvasCache(),N=D.scene,H=D.filter,V=H.getContext(),W,U,Q,ae;if(w){if(!this._filterUpToDate){const Z=N.pixelRatio;H.setSize(N.width/N.pixelRatio,N.height/N.pixelRatio);try{for(W=w.length,V.clear(),V.drawImage(N._canvas,0,0,N.getWidth()/Z,N.getHeight()/Z),U=V.getImageData(0,0,H.getWidth(),H.getHeight()),Q=0;Q<W;Q++){if(ae=w[Q],typeof ae!="function"){e.Util.error("Filter should be type of function, but got "+typeof ae+" instead. Please check correct filters");continue}ae.call(this,U),V.putImageData(U,0,0)}}catch(ie){e.Util.error("Unable to apply filter. "+ie.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return H}return N}on(w,D){if(this._cache&&this._cache.delete(f),arguments.length===3)return this._delegate.apply(this,arguments);let N=w.split(O),H=N.length,V,W,U,Q,ae;for(V=0;V<H;V++)W=N[V],U=W.split("."),Q=U[0],ae=U[1]||"",this.eventListeners[Q]||(this.eventListeners[Q]=[]),this.eventListeners[Q].push({name:ae,handler:D});return this}off(w,D){let N=(w||"").split(O),H=N.length,V,W,U,Q,ae,Z;if(this._cache&&this._cache.delete(f),!w)for(W in this.eventListeners)this._off(W);for(V=0;V<H;V++)if(U=N[V],Q=U.split("."),ae=Q[0],Z=Q[1],ae)this.eventListeners[ae]&&this._off(ae,Z,D);else for(W in this.eventListeners)this._off(W,Z,D);return this}dispatchEvent(w){const D={target:this,type:w.type,evt:w};return this.fire(w.type,D),this}addEventListener(w,D){return this.on(w,function(N){D.call(this,N.evt)}),this}removeEventListener(w){return this.off(w),this}_delegate(w,D,N){const H=this;this.on(w,function(V){const W=V.target.findAncestors(D,!0,H);for(let U=0;U<W.length;U++)V=e.Util.cloneObject(V),V.currentTarget=W[U],N.call(W[U],V)})}remove(){return this.isDragging()&&this.stopDrag(),l.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(p),this._clearSelfAndDescendantCache(c),this._clearSelfAndDescendantCache(m),this._clearSelfAndDescendantCache(T),this._clearSelfAndDescendantCache(j),this._clearSelfAndDescendantCache(g)}_remove(){this._clearCaches();const w=this.getParent();w&&w.children&&(w.children.splice(this.index,1),w._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(w){const D="get"+e.Util._capitalize(w);return e.Util._isFunction(this[D])?this[D]():this.attrs[w]}getAncestors(){let w=this.getParent(),D=[];for(;w;)D.push(w),w=w.getParent();return D}getAttrs(){return this.attrs||{}}setAttrs(w){return this._batchTransformChanges(()=>{let D,N;if(!w)return this;for(D in w)D!==y&&(N=C+e.Util._capitalize(D),e.Util._isFunction(this[N])?this[N](w[D]):this._setAttr(D,w[D]))}),this}isListening(){return this._getCache(g,this._isListening)}_isListening(w){if(!this.listening())return!1;const D=this.getParent();return D&&D!==w&&this!==w?D._isListening(w):!0}isVisible(){return this._getCache(j,this._isVisible)}_isVisible(w){if(!this.visible())return!1;const D=this.getParent();return D&&D!==w&&this!==w?D._isVisible(w):!0}shouldDrawHit(w,D=!1){if(w)return this._isVisible(w)&&this._isListening(w);const N=this.getLayer();let H=!1;l.DD._dragElements.forEach(W=>{W.dragStatus==="dragging"&&(W.node.nodeType==="Stage"||W.node.getLayer()===N)&&(H=!0)});const V=!D&&!o.Konva.hitOnDragEnabled&&(H||o.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!V}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let w=this.getDepth(),D=this,N=0,H,V,W,U;function Q(Z){for(H=[],V=Z.length,W=0;W<V;W++)U=Z[W],N++,U.nodeType!==v&&(H=H.concat(U.getChildren().slice())),U._id===D._id&&(W=V);H.length>0&&H[0].getDepth()<=w&&Q(H)}const ae=this.getStage();return D.nodeType!==L&&ae&&Q(ae.getChildren()),N}getDepth(){let w=0,D=this.parent;for(;D;)w++,D=D.parent;return w}_batchTransformChanges(w){this._batchingTransformChange=!0,w(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(R),this._clearSelfAndDescendantCache(p)),this._needClearTransformCache=!1}setPosition(w){return this._batchTransformChanges(()=>{this.x(w.x),this.y(w.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const w=this.getStage();if(!w)return null;const D=w.getPointerPosition();if(!D)return null;const N=this.getAbsoluteTransform().copy();return N.invert(),N.point(D)}getAbsolutePosition(w){let D=!1,N=this.parent;for(;N;){if(N.isCached()){D=!0;break}N=N.parent}D&&!w&&(w=!0);const H=this.getAbsoluteTransform(w).getMatrix(),V=new e.Transform,W=this.offset();return V.m=H.slice(),V.translate(W.x,W.y),V.getTranslation()}setAbsolutePosition(w){const{x:D,y:N,...H}=this._clearTransform();this.attrs.x=D,this.attrs.y=N,this._clearCache(R);const V=this._getAbsoluteTransform().copy();return V.invert(),V.translate(w.x,w.y),w={x:this.attrs.x+V.getTranslation().x,y:this.attrs.y+V.getTranslation().y},this._setTransform(H),this.setPosition({x:w.x,y:w.y}),this._clearCache(R),this._clearSelfAndDescendantCache(p),this}_setTransform(w){let D;for(D in w)this.attrs[D]=w[D]}_clearTransform(){const w={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,w}move(w){let D=w.x,N=w.y,H=this.x(),V=this.y();return D!==void 0&&(H+=D),N!==void 0&&(V+=N),this.setPosition({x:H,y:V}),this}_eachAncestorReverse(w,D){let N=[],H=this.getParent(),V,W;if(!(D&&D._id===this._id)){for(N.unshift(this);H&&(!D||H._id!==D._id);)N.unshift(H),H=H.parent;for(V=N.length,W=0;W<V;W++)w(N[W])}}rotate(w){return this.rotation(this.rotation()+w),this}moveToTop(){if(!this.parent)return e.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const w=this.index;return w<this.parent.getChildren().length-1?(this.parent.children.splice(w,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return e.Util.warn("Node has no parent. moveUp function is ignored."),!1;const w=this.index;return w<this.parent.getChildren().length-1?(this.parent.children.splice(w,1),this.parent.children.splice(w+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return e.Util.warn("Node has no parent. moveDown function is ignored."),!1;const w=this.index;return w>0?(this.parent.children.splice(w,1),this.parent.children.splice(w-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return e.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const w=this.index;return w>0?(this.parent.children.splice(w,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(w){if(!this.parent)return e.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(w<0||w>=this.parent.children.length)&&e.Util.warn("Unexpected value "+w+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const D=this.index;return this.parent.children.splice(D,1),this.parent.children.splice(w,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(c,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let w=this.opacity();const D=this.getParent();return D&&!D._isUnderCache&&(w*=D.getAbsoluteOpacity()),w}moveTo(w){return this.getParent()!==w&&(this._remove(),w.add(this)),this}toObject(){let w=this.getAttrs(),D,N,H,V,W;const U={attrs:{},className:this.getClassName()};for(D in w)N=w[D],W=e.Util.isObject(N)&&!e.Util._isPlainObject(N)&&!e.Util._isArray(N),!W&&(H=typeof this[D]=="function"&&this[D],delete w[D],V=H?H.call(this):null,w[D]=N,V!==N&&(U.attrs[D]=N));return e.Util._prepareToStringify(U)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(w,D,N){const H=[];D&&this._isMatch(w)&&H.push(this);let V=this.parent;for(;V;){if(V===N)return H;V._isMatch(w)&&H.push(V),V=V.parent}return H}isAncestorOf(w){return!1}findAncestor(w,D,N){return this.findAncestors(w,D,N)[0]}_isMatch(w){if(!w)return!1;if(typeof w=="function")return w(this);let D=w.replace(/ /g,"").split(","),N=D.length,H,V;for(H=0;H<N;H++)if(V=D[H],e.Util.isValidSelector(V)||(e.Util.warn('Selector "'+V+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),e.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),e.Util.warn("Konva is awesome, right?")),V.charAt(0)==="#"){if(this.id()===V.slice(1))return!0}else if(V.charAt(0)==="."){if(this.hasName(V.slice(1)))return!0}else if(this.className===V||this.nodeType===V)return!0;return!1}getLayer(){const w=this.getParent();return w?w.getLayer():null}getStage(){return this._getCache(T,this._getStage)}_getStage(){const w=this.getParent();return w?w.getStage():null}fire(w,D={},N){return D.target=D.target||this,N?this._fireAndBubble(w,D):this._fire(w,D),this}getAbsoluteTransform(w){return w?this._getAbsoluteTransform(w):this._getCache(p,this._getAbsoluteTransform)}_getAbsoluteTransform(w){let D;if(w)return D=new e.Transform,this._eachAncestorReverse(function(N){const H=N.transformsEnabled();H==="all"?D.multiply(N.getTransform()):H==="position"&&D.translate(N.x()-N.offsetX(),N.y()-N.offsetY())},w),D;{D=this._cache.get(p)||new e.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(D):D.reset();const N=this.transformsEnabled();if(N==="all")D.multiply(this.getTransform());else if(N==="position"){const H=this.attrs.x||0,V=this.attrs.y||0,W=this.attrs.offsetX||0,U=this.attrs.offsetY||0;D.translate(H-W,V-U)}return D.dirty=!1,D}}getAbsoluteScale(w){let D=this;for(;D;)D._isUnderCache&&(w=D),D=D.getParent();const N=this.getAbsoluteTransform(w).decompose();return{x:N.scaleX,y:N.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(R,this._getTransform)}_getTransform(){var w,D;const N=this._cache.get(R)||new e.Transform;N.reset();const H=this.x(),V=this.y(),W=o.Konva.getAngle(this.rotation()),U=(w=this.attrs.scaleX)!==null&&w!==void 0?w:1,Q=(D=this.attrs.scaleY)!==null&&D!==void 0?D:1,ae=this.attrs.skewX||0,Z=this.attrs.skewY||0,ie=this.attrs.offsetX||0,te=this.attrs.offsetY||0;return(H!==0||V!==0)&&N.translate(H,V),W!==0&&N.rotate(W),(ae!==0||Z!==0)&&N.skew(ae,Z),(U!==1||Q!==1)&&N.scale(U,Q),(ie!==0||te!==0)&&N.translate(-1*ie,-1*te),N.dirty=!1,N}clone(w){let D=e.Util.cloneObject(this.attrs),N,H,V,W,U;for(N in w)D[N]=w[N];const Q=new this.constructor(D);for(N in this.eventListeners)for(H=this.eventListeners[N],V=H.length,W=0;W<V;W++)U=H[W],U.name.indexOf(b)<0&&(Q.eventListeners[N]||(Q.eventListeners[N]=[]),Q.eventListeners[N].push(U));return Q}_toKonvaCanvas(w){w=w||{};const D=this.getClientRect(),N=this.getStage(),H=w.x!==void 0?w.x:Math.floor(D.x),V=w.y!==void 0?w.y:Math.floor(D.y),W=w.pixelRatio||1,U=new r.SceneCanvas({width:w.width||Math.ceil(D.width)||(N?N.width():0),height:w.height||Math.ceil(D.height)||(N?N.height():0),pixelRatio:W}),Q=U.getContext(),ae=new r.SceneCanvas({width:U.width/U.pixelRatio+Math.abs(H),height:U.height/U.pixelRatio+Math.abs(V),pixelRatio:U.pixelRatio});return w.imageSmoothingEnabled===!1&&(Q._context.imageSmoothingEnabled=!1),Q.save(),(H||V)&&Q.translate(-1*H,-1*V),this.drawScene(U,void 0,ae),Q.restore(),U}toCanvas(w){return this._toKonvaCanvas(w)._canvas}toDataURL(w){w=w||{};const D=w.mimeType||null,N=w.quality||null,H=this._toKonvaCanvas(w).toDataURL(D,N);return w.callback&&w.callback(H),H}toImage(w){return new Promise((D,N)=>{try{const H=w?.callback;H&&delete w.callback,e.Util._urlToImage(this.toDataURL(w),function(V){D(V),H?.(V)})}catch(H){N(H)}})}toBlob(w){return new Promise((D,N)=>{try{const H=w?.callback;H&&delete w.callback,this.toCanvas(w).toBlob(V=>{D(V),H?.(V)},w?.mimeType,w?.quality)}catch(H){N(H)}})}setSize(w){return this.width(w.width),this.height(w.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():o.Konva.dragDistance}_off(w,D,N){let H=this.eventListeners[w],V,W,U;for(V=0;V<H.length;V++)if(W=H[V].name,U=H[V].handler,(W!=="konva"||D==="konva")&&(!D||W===D)&&(!N||N===U)){if(H.splice(V,1),H.length===0){delete this.eventListeners[w];break}V--}}_fireChangeEvent(w,D,N){this._fire(w+S,{oldVal:D,newVal:N})}addName(w){if(!this.hasName(w)){const D=this.name(),N=D?D+" "+w:w;this.name(N)}return this}hasName(w){if(!w)return!1;const D=this.name();return D?(D||"").split(/\s/g).indexOf(w)!==-1:!1}removeName(w){const D=(this.name()||"").split(/\s/g),N=D.indexOf(w);return N!==-1&&(D.splice(N,1),this.name(D.join(" "))),this}setAttr(w,D){const N=this[C+e.Util._capitalize(w)];return e.Util._isFunction(N)?N.call(this,D):this._setAttr(w,D),this}_requestDraw(){if(o.Konva.autoDrawEnabled){const w=this.getLayer()||this.getStage();w?.batchDraw()}}_setAttr(w,D){const N=this.attrs[w];N===D&&!e.Util.isObject(D)||(D==null?delete this.attrs[w]:this.attrs[w]=D,this._shouldFireChangeEvents&&this._fireChangeEvent(w,N,D),this._requestDraw())}_setComponentAttr(w,D,N){let H;N!==void 0&&(H=this.attrs[w],H||(this.attrs[w]=this.getAttr(w)),this.attrs[w][D]=N,this._fireChangeEvent(w,H,N))}_fireAndBubble(w,D,N){if(D&&this.nodeType===v&&(D.target=this),!((w===x||w===P)&&(N&&(this===N||this.isAncestorOf&&this.isAncestorOf(N))||this.nodeType==="Stage"&&!N))){this._fire(w,D);const H=(w===x||w===P)&&N&&N.isAncestorOf&&N.isAncestorOf(this)&&!N.isAncestorOf(this.parent);(D&&!D.cancelBubble||!D)&&this.parent&&this.parent.isListening()&&!H&&(N&&N.parent?this._fireAndBubble.call(this.parent,w,D,N):this._fireAndBubble.call(this.parent,w,D))}}_getProtoListeners(w){var D,N,H;const V=(D=this._cache.get(f))!==null&&D!==void 0?D:{};let W=V?.[w];if(W===void 0){W=[];let U=Object.getPrototypeOf(this);for(;U;){const Q=(H=(N=U.eventListeners)===null||N===void 0?void 0:N[w])!==null&&H!==void 0?H:[];W.push(...Q),U=Object.getPrototypeOf(U)}V[w]=W,this._cache.set(f,V)}return W}_fire(w,D){D=D||{},D.currentTarget=this,D.type=w;const N=this._getProtoListeners(w);if(N)for(var H=0;H<N.length;H++)N[H].handler.call(this,D);const V=this.eventListeners[w];if(V)for(var H=0;H<V.length;H++)V[H].handler.call(this,D)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(w){const D=w?w.pointerId:void 0,N=this.getStage(),H=this.getAbsolutePosition();if(!N)return;const V=N._getPointerById(D)||N._changedPointerPositions[0]||H;l.DD._dragElements.set(this._id,{node:this,startPointerPos:V,offset:{x:V.x-H.x,y:V.y-H.y},dragStatus:"ready",pointerId:D})}startDrag(w,D=!0){l.DD._dragElements.has(this._id)||this._createDragElement(w);const N=l.DD._dragElements.get(this._id);N.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:w&&w.evt},D)}_setDragPosition(w,D){const N=this.getStage()._getPointerById(D.pointerId);if(!N)return;let H={x:N.x-D.offset.x,y:N.y-D.offset.y};const V=this.dragBoundFunc();if(V!==void 0){const W=V.call(this,H,w);W?H=W:e.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==H.x||this._lastPos.y!==H.y)&&(this.setAbsolutePosition(H),this._requestDraw()),this._lastPos=H}stopDrag(w){const D=l.DD._dragElements.get(this._id);D&&(D.dragStatus="stopped"),l.DD._endDragBefore(w),l.DD._endDragAfter(w)}setDraggable(w){this._setAttr("draggable",w),this._dragChange()}isDragging(){const w=l.DD._dragElements.get(this._id);return w?w.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(w){if(!(w.evt.button===void 0||o.Konva.dragButtons.indexOf(w.evt.button)>=0)||this.isDragging())return;let D=!1;l.DD._dragElements.forEach(N=>{this.isAncestorOf(N.node)&&(D=!0)}),D||this._createDragElement(w)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const w=l.DD._dragElements.get(this._id),D=w&&w.dragStatus==="dragging",N=w&&w.dragStatus==="ready";D?this.stopDrag():N&&l.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(w={x:0,y:0}){const D=this.getStage();if(!D)return!1;const N={x:-w.x,y:-w.y,width:D.width()+2*w.x,height:D.height()+2*w.y};return e.Util.haveIntersection(N,this.getClientRect())}static create(w,D){return e.Util._isString(w)&&(w=JSON.parse(w)),this._createNode(w,D)}static _createNode(w,D){let N=Tp.prototype.getClassName.call(w),H=w.children,V,W,U;D&&(w.attrs.container=D),o.Konva[N]||(e.Util.warn('Can not find a node with class name "'+N+'". Fallback to "Shape".'),N="Shape");const Q=o.Konva[N];if(V=new Q(w.attrs),H)for(W=H.length,U=0;U<W;U++)V.add(Tp._createNode(H[U]));return V}};t.Node=k,k.prototype.nodeType="Node",k.prototype._attrsAffectingSize=[],k.prototype.eventListeners={},k.prototype.on.call(k.prototype,M,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(R),this._clearSelfAndDescendantCache(p)}),k.prototype.on.call(k.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(j)}),k.prototype.on.call(k.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(g)}),k.prototype.on.call(k.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(c)});var F=n.Factory.addGetterSetter;F(k,"zIndex"),F(k,"absolutePosition"),F(k,"position"),F(k,"x",0,(0,s.getNumberValidator)()),F(k,"y",0,(0,s.getNumberValidator)()),F(k,"globalCompositeOperation","source-over",(0,s.getStringValidator)()),F(k,"opacity",1,(0,s.getNumberValidator)()),F(k,"name","",(0,s.getStringValidator)()),F(k,"id","",(0,s.getStringValidator)()),F(k,"rotation",0,(0,s.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"scale",["x","y"]),F(k,"scaleX",1,(0,s.getNumberValidator)()),F(k,"scaleY",1,(0,s.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"skew",["x","y"]),F(k,"skewX",0,(0,s.getNumberValidator)()),F(k,"skewY",0,(0,s.getNumberValidator)()),n.Factory.addComponentsGetterSetter(k,"offset",["x","y"]),F(k,"offsetX",0,(0,s.getNumberValidator)()),F(k,"offsetY",0,(0,s.getNumberValidator)()),F(k,"dragDistance",void 0,(0,s.getNumberValidator)()),F(k,"width",0,(0,s.getNumberValidator)()),F(k,"height",0,(0,s.getNumberValidator)()),F(k,"listening",!0,(0,s.getBooleanValidator)()),F(k,"preventDefault",!0,(0,s.getBooleanValidator)()),F(k,"filters",void 0,function(G){return this._filterUpToDate=!1,G}),F(k,"visible",!0,(0,s.getBooleanValidator)()),F(k,"transformsEnabled","all",(0,s.getStringValidator)()),F(k,"size"),F(k,"dragBoundFunc"),F(k,"draggable",!1,(0,s.getBooleanValidator)()),n.Factory.backCompat(k,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"})})),Ec=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Container=void 0;var e=ft(),n=an(),r=pt(),o=class extends n.Node{constructor(){super(...arguments),this.children=[]}getChildren(l){if(!l)return this.children||[];const s=this.children||[],c=[];return s.forEach(function(f){l(f)&&c.push(f)}),c}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(l=>{l.parent=null,l.index=0,l.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(l=>{l.parent=null,l.index=0,l.destroy()}),this.children=[],this._requestDraw(),this}add(...l){if(l.length===0)return this;if(l.length>1){for(let c=0;c<l.length;c++)this.add(l[c]);return this}const s=l[0];return s.getParent()?(s.moveTo(this),this):(this._validateAdd(s),s.index=this.getChildren().length,s.parent=this,s._clearCaches(),this.getChildren().push(s),this._fire("add",{child:s}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(l){return this._generalFind(l,!1)}findOne(l){const s=this._generalFind(l,!0);return s.length>0?s[0]:void 0}_generalFind(l,s){const c=[];return this._descendants(f=>{const p=f._isMatch(l);return p&&c.push(f),!!(p&&s)}),c}_descendants(l){let s=!1;const c=this.getChildren();for(const f of c){if(s=l(f),s)return!0;if(f.hasChildren()&&(s=f._descendants(l),s))return!0}return!1}toObject(){const l=n.Node.prototype.toObject.call(this);return l.children=[],this.getChildren().forEach(s=>{l.children.push(s.toObject())}),l}isAncestorOf(l){let s=l.getParent();for(;s;){if(s._id===this._id)return!0;s=s.getParent()}return!1}clone(l){const s=n.Node.prototype.clone.call(this,l);return this.getChildren().forEach(function(c){s.add(c.clone())}),s}getAllIntersections(l){const s=[];return this.find("Shape").forEach(c=>{c.isVisible()&&c.intersects(l)&&s.push(c)}),s}_clearSelfAndDescendantCache(l){var s;super._clearSelfAndDescendantCache(l),!this.isCached()&&((s=this.children)===null||s===void 0||s.forEach(function(c){c._clearSelfAndDescendantCache(l)}))}_setChildrenIndices(){var l;(l=this.children)===null||l===void 0||l.forEach(function(s,c){s.index=c}),this._requestDraw()}drawScene(l,s,c){const f=this.getLayer(),p=l||f&&f.getCanvas(),m=p&&p.getContext(),_=this._getCanvasCache(),S=_&&_.scene,y=p&&p.isCache;if(!this.isVisible()&&!y)return this;if(S){m.save();const b=this.getAbsoluteTransform(s).getMatrix();m.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(m),m.restore()}else this._drawChildren("drawScene",p,s,c);return this}drawHit(l,s){if(!this.shouldDrawHit(s))return this;const c=this.getLayer(),f=l||c&&c.hitCanvas,p=f&&f.getContext(),m=this._getCanvasCache();if(m&&m.hit){p.save();const _=this.getAbsoluteTransform(s).getMatrix();p.transform(_[0],_[1],_[2],_[3],_[4],_[5]),this._drawCachedHitCanvas(p),p.restore()}else this._drawChildren("drawHit",f,s);return this}_drawChildren(l,s,c,f){var p;const m=s&&s.getContext(),_=this.clipWidth(),S=this.clipHeight(),y=this.clipFunc(),b=typeof _=="number"&&typeof S=="number"||y,g=c===this;if(b){m.save();const P=this.getAbsoluteTransform(c);let C=P.getMatrix();m.transform(C[0],C[1],C[2],C[3],C[4],C[5]),m.beginPath();let v;if(y)v=y.call(this,m,this);else{const O=this.clipX(),T=this.clipY();m.rect(O||0,T||0,_,S)}m.clip.apply(m,v),C=P.copy().invert().getMatrix(),m.transform(C[0],C[1],C[2],C[3],C[4],C[5])}const x=!g&&this.globalCompositeOperation()!=="source-over"&&l==="drawScene";x&&(m.save(),m._applyGlobalCompositeOperation(this)),(p=this.children)===null||p===void 0||p.forEach(function(P){P[l](s,c,f)}),x&&m.restore(),b&&m.restore()}getClientRect(l={}){var s;const c=l.skipTransform,f=l.relativeTo;let p,m,_,S,y={x:1/0,y:1/0,width:0,height:0};const b=this;(s=this.children)===null||s===void 0||s.forEach(function(P){if(!P.visible())return;const C=P.getClientRect({relativeTo:b,skipShadow:l.skipShadow,skipStroke:l.skipStroke});C.width===0&&C.height===0||(p===void 0?(p=C.x,m=C.y,_=C.x+C.width,S=C.y+C.height):(p=Math.min(p,C.x),m=Math.min(m,C.y),_=Math.max(_,C.x+C.width),S=Math.max(S,C.y+C.height)))});const g=this.find("Shape");let x=!1;for(let P=0;P<g.length;P++)if(g[P]._isVisible(this)){x=!0;break}return x&&p!==void 0?y={x:p,y:m,width:_-p,height:S-m}:y={x:0,y:0,width:0,height:0},c?y:this._transformedRect(y,f)}};t.Container=o,e.Factory.addComponentsGetterSetter(o,"clip",["x","y","width","height"]),e.Factory.addGetterSetter(o,"clipX",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"clipY",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"clipWidth",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"clipHeight",void 0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(o,"clipFunc")})),Np=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getCapturedShape=o,t.createEvent=l,t.hasPointerCapture=s,t.setPointerCapture=c,t.releaseCapture=f;var e=dt(),n=new Map,r=e.Konva._global.PointerEvent!==void 0;function o(p){return n.get(p)}function l(p){return{evt:p,pointerId:p.pointerId}}function s(p,m){return n.get(p)===m}function c(p,m){f(p),m.getStage()&&(n.set(p,m),r&&m._fire("gotpointercapture",l(new PointerEvent("gotpointercapture"))))}function f(p,m){const _=n.get(p);if(!_)return;const S=_.getStage();S&&S.content,n.delete(p),r&&_._fire("lostpointercapture",l(new PointerEvent("lostpointercapture")))}})),S7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=t.stages=void 0;var e=Wt(),n=ft(),r=Ec(),o=dt(),l=_c(),s=nf(),c=dt(),f=Np(),p="Stage",m="string",_="px",S="mouseout",y="mouseleave",b="mouseover",g="mouseenter",x="mousemove",P="mousedown",C="mouseup",v="pointermove",O="pointerdown",T="pointerup",R="pointercancel",L="lostpointercapture",j="pointerout",M="pointerleave",z="pointerover",k="pointerenter",F="contextmenu",G="touchstart",w="touchend",D="touchmove",N="touchcancel",H="wheel",V=5,W=[[g,"_pointerenter"],[P,"_pointerdown"],[x,"_pointermove"],[C,"_pointerup"],[y,"_pointerleave"],[G,"_pointerdown"],[D,"_pointermove"],[w,"_pointerup"],[N,"_pointercancel"],[b,"_pointerover"],[H,"_wheel"],[F,"_contextmenu"],[O,"_pointerdown"],[v,"_pointermove"],[T,"_pointerup"],[R,"_pointercancel"],[L,"_lostpointercapture"]],U={mouse:{[j]:S,[M]:y,[z]:b,[k]:g,[v]:x,[O]:P,[T]:C,[R]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[j]:"touchout",[M]:"touchleave",[z]:"touchover",[k]:"touchenter",[v]:D,[O]:G,[T]:w,[R]:N,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[j]:j,[M]:M,[z]:z,[k]:k,[v]:v,[O]:O,[T]:T,[R]:R,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Q=X=>X.indexOf("pointer")>=0?"pointer":X.indexOf("touch")>=0?"touch":"mouse",ae=X=>{const K=Q(X);if(K==="pointer")return o.Konva.pointerEventsEnabled&&U.pointer;if(K==="touch")return U.touch;if(K==="mouse")return U.mouse};function Z(X={}){return(X.clipFunc||X.clipWidth||X.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),X}var ie="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";t.stages=[];var te=class extends r.Container{constructor(X){super(Z(X)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),t.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{Z(this.attrs)}),this._checkVisibility()}_validateAdd(X){const K=X.getType()==="Layer",le=X.getType()==="FastLayer";K||le||e.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const X=this.visible()?"":"none";this.content.style.display=X}setContainer(X){if(typeof X===m){if(X.charAt(0)==="."){const le=X.slice(1);X=document.getElementsByClassName(le)[0]}else{var K;X.charAt(0)!=="#"?K=X:K=X.slice(1),X=document.getElementById(K)}if(!X)throw"Can not find container in document with id "+K}return this._setAttr("container",X),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),X.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const X=this.children,K=X.length;for(let le=0;le<K;le++)X[le].clear();return this}clone(X){return X||(X={}),X.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,X)}destroy(){super.destroy();const X=this.content;X&&e.Util._isInDocument(X)&&this.container().removeChild(X);const K=t.stages.indexOf(this);return K>-1&&t.stages.splice(K,1),e.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const X=this._pointerPositions[0]||this._changedPointerPositions[0];return X?{x:X.x,y:X.y}:(e.Util.warn(ie),null)}_getPointerById(X){return this._pointerPositions.find(K=>K.id===X)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(X){X=X||{},X.x=X.x||0,X.y=X.y||0,X.width=X.width||this.width(),X.height=X.height||this.height();const K=new l.SceneCanvas({width:X.width,height:X.height,pixelRatio:X.pixelRatio||1}),le=K.getContext()._context,fe=this.children;return(X.x||X.y)&&le.translate(-1*X.x,-1*X.y),fe.forEach(function(ue){if(!ue.isVisible())return;const he=ue._toKonvaCanvas(X);le.drawImage(he._canvas,X.x,X.y,he.getWidth()/he.getPixelRatio(),he.getHeight()/he.getPixelRatio())}),K}getIntersection(X){if(!X)return null;const K=this.children,le=K.length-1;for(let fe=le;fe>=0;fe--){const ue=K[fe].getIntersection(X);if(ue)return ue}return null}_resizeDOM(){const X=this.width(),K=this.height();this.content&&(this.content.style.width=X+_,this.content.style.height=K+_),this.bufferCanvas.setSize(X,K),this.bufferHitCanvas.setSize(X,K),this.children.forEach(le=>{le.setSize({width:X,height:K}),le.draw()})}add(X,...K){if(arguments.length>1){for(let fe=0;fe<arguments.length;fe++)this.add(arguments[fe]);return this}super.add(X);const le=this.children.length;return le>V&&e.Util.warn("The stage has "+le+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),X.setSize({width:this.width(),height:this.height()}),X.draw(),o.Konva.isBrowser&&this.content.appendChild(X.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(X){return f.hasPointerCapture(X,this)}setPointerCapture(X){f.setPointerCapture(X,this)}releaseCapture(X){f.releaseCapture(X,this)}getLayers(){return this.children}_bindContentEvents(){o.Konva.isBrowser&&W.forEach(([X,K])=>{this.content.addEventListener(X,le=>{this[K](le)},{passive:!1})})}_pointerenter(X){this.setPointersPositions(X);const K=ae(X.type);K&&this._fire(K.pointerenter,{evt:X,target:this,currentTarget:this})}_pointerover(X){this.setPointersPositions(X);const K=ae(X.type);K&&this._fire(K.pointerover,{evt:X,target:this,currentTarget:this})}_getTargetShape(X){let K=this[X+"targetShape"];return K&&!K.getStage()&&(K=null),K}_pointerleave(X){const K=ae(X.type),le=Q(X.type);if(!K)return;this.setPointersPositions(X);const fe=this._getTargetShape(le),ue=!(o.Konva.isDragging()||o.Konva.isTransforming())||o.Konva.hitOnDragEnabled;fe&&ue?(fe._fireAndBubble(K.pointerout,{evt:X}),fe._fireAndBubble(K.pointerleave,{evt:X}),this._fire(K.pointerleave,{evt:X,target:this,currentTarget:this}),this[le+"targetShape"]=null):ue&&(this._fire(K.pointerleave,{evt:X,target:this,currentTarget:this}),this._fire(K.pointerout,{evt:X,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(X){const K=ae(X.type),le=Q(X.type);if(!K)return;this.setPointersPositions(X);let fe=!1;this._changedPointerPositions.forEach(ue=>{const he=this.getIntersection(ue);if(s.DD.justDragged=!1,o.Konva["_"+le+"ListenClick"]=!0,!he||!he.isListening()){this[le+"ClickStartShape"]=void 0;return}o.Konva.capturePointerEventsEnabled&&he.setPointerCapture(ue.id),this[le+"ClickStartShape"]=he,he._fireAndBubble(K.pointerdown,{evt:X,pointerId:ue.id}),fe=!0;const Ee=X.type.indexOf("touch")>=0;he.preventDefault()&&X.cancelable&&Ee&&X.preventDefault()}),fe||this._fire(K.pointerdown,{evt:X,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(X){const K=ae(X.type),le=Q(X.type);if(!K||(o.Konva.isDragging()&&s.DD.node.preventDefault()&&X.cancelable&&X.preventDefault(),this.setPointersPositions(X),!(!(o.Konva.isDragging()||o.Konva.isTransforming())||o.Konva.hitOnDragEnabled)))return;const fe={};let ue=!1;const he=this._getTargetShape(le);this._changedPointerPositions.forEach(Ee=>{const Se=f.getCapturedShape(Ee.id)||this.getIntersection(Ee),Ie=Ee.id,Xe={evt:X,pointerId:Ie},Ge=he!==Se;if(Ge&&he&&(he._fireAndBubble(K.pointerout,{...Xe},Se),he._fireAndBubble(K.pointerleave,{...Xe},Se)),Se){if(fe[Se._id])return;fe[Se._id]=!0}Se&&Se.isListening()?(ue=!0,Ge&&(Se._fireAndBubble(K.pointerover,{...Xe},he),Se._fireAndBubble(K.pointerenter,{...Xe},he),this[le+"targetShape"]=Se),Se._fireAndBubble(K.pointermove,{...Xe})):he&&(this._fire(K.pointerover,{evt:X,target:this,currentTarget:this,pointerId:Ie}),this[le+"targetShape"]=null)}),ue||this._fire(K.pointermove,{evt:X,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(X){const K=ae(X.type),le=Q(X.type);if(!K)return;this.setPointersPositions(X);const fe=this[le+"ClickStartShape"],ue=this[le+"ClickEndShape"],he={};let Ee=!1;this._changedPointerPositions.forEach(Se=>{const Ie=f.getCapturedShape(Se.id)||this.getIntersection(Se);if(Ie){if(Ie.releaseCapture(Se.id),he[Ie._id])return;he[Ie._id]=!0}const Xe=Se.id,Ge={evt:X,pointerId:Xe};let Le=!1;o.Konva["_"+le+"InDblClickWindow"]?(Le=!0,clearTimeout(this[le+"DblTimeout"])):s.DD.justDragged||(o.Konva["_"+le+"InDblClickWindow"]=!0,clearTimeout(this[le+"DblTimeout"])),this[le+"DblTimeout"]=setTimeout(function(){o.Konva["_"+le+"InDblClickWindow"]=!1},o.Konva.dblClickWindow),Ie&&Ie.isListening()?(Ee=!0,this[le+"ClickEndShape"]=Ie,Ie._fireAndBubble(K.pointerup,{...Ge}),o.Konva["_"+le+"ListenClick"]&&fe&&fe===Ie&&(Ie._fireAndBubble(K.pointerclick,{...Ge}),Le&&ue&&ue===Ie&&Ie._fireAndBubble(K.pointerdblclick,{...Ge}))):(this[le+"ClickEndShape"]=null,o.Konva["_"+le+"ListenClick"]&&this._fire(K.pointerclick,{evt:X,target:this,currentTarget:this,pointerId:Xe}),Le&&this._fire(K.pointerdblclick,{evt:X,target:this,currentTarget:this,pointerId:Xe}))}),Ee||this._fire(K.pointerup,{evt:X,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),o.Konva["_"+le+"ListenClick"]=!1,X.cancelable&&le!=="touch"&&le!=="pointer"&&X.preventDefault()}_contextmenu(X){this.setPointersPositions(X);const K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(F,{evt:X}):this._fire(F,{evt:X,target:this,currentTarget:this})}_wheel(X){this.setPointersPositions(X);const K=this.getIntersection(this.getPointerPosition());K&&K.isListening()?K._fireAndBubble(H,{evt:X}):this._fire(H,{evt:X,target:this,currentTarget:this})}_pointercancel(X){this.setPointersPositions(X);const K=f.getCapturedShape(X.pointerId)||this.getIntersection(this.getPointerPosition());K&&K._fireAndBubble(T,f.createEvent(X)),f.releaseCapture(X.pointerId)}_lostpointercapture(X){f.releaseCapture(X.pointerId)}setPointersPositions(X){const K=this._getContentPosition();let le=null,fe=null;X=X||window.event,X.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(X.touches,ue=>{this._pointerPositions.push({id:ue.identifier,x:(ue.clientX-K.left)/K.scaleX,y:(ue.clientY-K.top)/K.scaleY})}),Array.prototype.forEach.call(X.changedTouches||X.touches,ue=>{this._changedPointerPositions.push({id:ue.identifier,x:(ue.clientX-K.left)/K.scaleX,y:(ue.clientY-K.top)/K.scaleY})})):(le=(X.clientX-K.left)/K.scaleX,fe=(X.clientY-K.top)/K.scaleY,this.pointerPos={x:le,y:fe},this._pointerPositions=[{x:le,y:fe,id:e.Util._getFirstPointerId(X)}],this._changedPointerPositions=[{x:le,y:fe,id:e.Util._getFirstPointerId(X)}])}_setPointerPosition(X){e.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(X)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const X=this.content.getBoundingClientRect();return{top:X.top,left:X.left,scaleX:X.width/this.content.clientWidth||1,scaleY:X.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new l.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new l.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!o.Konva.isBrowser)return;const X=this.container();if(!X)throw"Stage has no container. A container is required.";X.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),X.appendChild(this.content),this._resizeDOM()}cache(){return e.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(X){X.batchDraw()}),this}};t.Stage=te,te.prototype.nodeType=p,(0,c._registerNode)(te),n.Factory.addGetterSetter(te,"container"),o.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{t.stages.forEach(X=>{X.batchDraw()})})})),yn=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.shapes=void 0;var e=dt(),n=Wt(),r=ft(),o=an(),l=pt(),s=dt(),c=Np(),f="hasShadow",p="shadowRGBA",m="patternImage",_="linearGradient",S="radialGradient",y;function b(){return y||(y=n.Util.createCanvasElement().getContext("2d"),y)}t.shapes={};function g(M){const z=this.attrs.fillRule;z?M.fill(z):M.fill()}function x(M){M.stroke()}function P(M){const z=this.attrs.fillRule;z?M.fill(z):M.fill()}function C(M){M.stroke()}function v(){this._clearCache(f)}function O(){this._clearCache(p)}function T(){this._clearCache(m)}function R(){this._clearCache(_)}function L(){this._clearCache(S)}var j=class extends o.Node{constructor(M){super(M);let z;for(;z=n.Util.getRandomColor(),!(z&&!(z in t.shapes)););this.colorKey=z,t.shapes[z]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(f,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(m,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const M=b().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(M&&M.setTransform){const z=new n.Transform;z.translate(this.fillPatternX(),this.fillPatternY()),z.rotate(e.Konva.getAngle(this.fillPatternRotation())),z.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),z.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const k=z.getMatrix(),F=typeof DOMMatrix>"u"?{a:k[0],b:k[1],c:k[2],d:k[3],e:k[4],f:k[5]}:new DOMMatrix(k);M.setTransform(F)}return M}}_getLinearGradient(){return this._getCache(_,this.__getLinearGradient)}__getLinearGradient(){const M=this.fillLinearGradientColorStops();if(M){const z=b(),k=this.fillLinearGradientStartPoint(),F=this.fillLinearGradientEndPoint(),G=z.createLinearGradient(k.x,k.y,F.x,F.y);for(let w=0;w<M.length;w+=2)G.addColorStop(M[w],M[w+1]);return G}}_getRadialGradient(){return this._getCache(S,this.__getRadialGradient)}__getRadialGradient(){const M=this.fillRadialGradientColorStops();if(M){const z=b(),k=this.fillRadialGradientStartPoint(),F=this.fillRadialGradientEndPoint(),G=z.createRadialGradient(k.x,k.y,this.fillRadialGradientStartRadius(),F.x,F.y,this.fillRadialGradientEndRadius());for(let w=0;w<M.length;w+=2)G.addColorStop(M[w],M[w+1]);return G}}getShadowRGBA(){return this._getCache(p,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const M=n.Util.colorToRGBA(this.shadowColor());if(M)return"rgba("+M.r+","+M.g+","+M.b+","+M.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const M=this.hitStrokeWidth();return M==="auto"?this.hasStroke():this.strokeEnabled()&&!!M}intersects(M){const z=this.getStage();if(!z)return!1;const k=z.bufferHitCanvas;return k.getContext().clear(),this.drawHit(k,void 0,!0),k.context.getImageData(Math.round(M.x),Math.round(M.y),1,1).data[3]>0}destroy(){return o.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(M){var z;if(!(!((z=this.attrs.perfectDrawEnabled)!==null&&z!==void 0)||z))return!1;const k=M||this.hasFill(),F=this.hasStroke(),G=this.getAbsoluteOpacity()!==1;if(k&&F&&G)return!0;const w=this.hasShadow(),D=this.shadowForStrokeEnabled();return!!(k&&F&&w&&D)}setStrokeHitEnabled(M){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),M?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const M=this.size();return{x:this._centroid?-M.width/2:0,y:this._centroid?-M.height/2:0,width:M.width,height:M.height}}getClientRect(M={}){let z=!1,k=this.getParent();for(;k;){if(k.isCached()){z=!0;break}k=k.getParent()}const F=M.skipTransform,G=M.relativeTo||z&&this.getStage()||void 0,w=this.getSelfRect(),D=!M.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,N=w.width+D,H=w.height+D,V=!M.skipShadow&&this.hasShadow(),W=V?this.shadowOffsetX():0,U=V?this.shadowOffsetY():0,Q=N+Math.abs(W),ae=H+Math.abs(U),Z=V&&this.shadowBlur()||0,ie={width:Q+Z*2,height:ae+Z*2,x:-(D/2+Z)+Math.min(W,0)+w.x,y:-(D/2+Z)+Math.min(U,0)+w.y};return F?ie:this._transformedRect(ie,G)}drawScene(M,z,k){const F=this.getLayer();let G=M||F.getCanvas(),w=G.getContext(),D=this._getCanvasCache(),N=this.getSceneFunc(),H=this.hasShadow(),V,W;const U=G.isCache,Q=z===this;if(!this.isVisible()&&!Q)return this;if(D){w.save();const Z=this.getAbsoluteTransform(z).getMatrix();return w.transform(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]),this._drawCachedSceneCanvas(w),w.restore(),this}if(!N)return this;if(w.save(),this._useBufferCanvas()&&!U){V=this.getStage();const Z=k||V.bufferCanvas;W=Z.getContext(),W.clear(),W.save(),W._applyLineJoin(this);var ae=this.getAbsoluteTransform(z).getMatrix();W.transform(ae[0],ae[1],ae[2],ae[3],ae[4],ae[5]),N.call(this,W,this),W.restore();const ie=Z.pixelRatio;H&&w._applyShadow(this),w._applyOpacity(this),w._applyGlobalCompositeOperation(this),w.drawImage(Z._canvas,0,0,Z.width/ie,Z.height/ie)}else{if(w._applyLineJoin(this),!Q){var ae=this.getAbsoluteTransform(z).getMatrix();w.transform(ae[0],ae[1],ae[2],ae[3],ae[4],ae[5]),w._applyOpacity(this),w._applyGlobalCompositeOperation(this)}H&&w._applyShadow(this),N.call(this,w,this)}return w.restore(),this}drawHit(M,z,k=!1){if(!this.shouldDrawHit(z,k))return this;const F=this.getLayer(),G=M||F.hitCanvas,w=G&&G.getContext(),D=this.hitFunc()||this.sceneFunc(),N=this._getCanvasCache(),H=N&&N.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),H){w.save();const V=this.getAbsoluteTransform(z).getMatrix();return w.transform(V[0],V[1],V[2],V[3],V[4],V[5]),this._drawCachedHitCanvas(w),w.restore(),this}if(!D)return this;if(w.save(),w._applyLineJoin(this),this!==z){const V=this.getAbsoluteTransform(z).getMatrix();w.transform(V[0],V[1],V[2],V[3],V[4],V[5])}return D.call(this,w,this),w.restore(),this}drawHitFromCache(M=0){const z=this._getCanvasCache(),k=this._getCachedSceneCanvas(),F=z.hit,G=F.getContext(),w=F.getWidth(),D=F.getHeight();G.clear(),G.drawImage(k._canvas,0,0,w,D);try{const N=G.getImageData(0,0,w,D),H=N.data,V=H.length,W=n.Util._hexToRgb(this.colorKey);for(let U=0;U<V;U+=4)H[U+3]>M?(H[U]=W.r,H[U+1]=W.g,H[U+2]=W.b,H[U+3]=255):H[U+3]=0;G.putImageData(N,0,0)}catch(N){n.Util.error("Unable to draw hit graph from cached scene canvas. "+N.message)}return this}hasPointerCapture(M){return c.hasPointerCapture(M,this)}setPointerCapture(M){c.setPointerCapture(M,this)}releaseCapture(M){c.releaseCapture(M,this)}};t.Shape=j,j.prototype._fillFunc=g,j.prototype._strokeFunc=x,j.prototype._fillFuncHit=P,j.prototype._strokeFuncHit=C,j.prototype._centroid=!1,j.prototype.nodeType="Shape",(0,s._registerNode)(j),j.prototype.eventListeners={},j.prototype.on.call(j.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v),j.prototype.on.call(j.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",O),j.prototype.on.call(j.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",T),j.prototype.on.call(j.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",R),j.prototype.on.call(j.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",L),r.Factory.addGetterSetter(j,"stroke",void 0,(0,l.getStringOrGradientValidator)()),r.Factory.addGetterSetter(j,"strokeWidth",2,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(j,"hitStrokeWidth","auto",(0,l.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(j,"strokeHitEnabled",!0,(0,l.getBooleanValidator)()),r.Factory.addGetterSetter(j,"perfectDrawEnabled",!0,(0,l.getBooleanValidator)()),r.Factory.addGetterSetter(j,"shadowForStrokeEnabled",!0,(0,l.getBooleanValidator)()),r.Factory.addGetterSetter(j,"lineJoin"),r.Factory.addGetterSetter(j,"lineCap"),r.Factory.addGetterSetter(j,"sceneFunc"),r.Factory.addGetterSetter(j,"hitFunc"),r.Factory.addGetterSetter(j,"dash"),r.Factory.addGetterSetter(j,"dashOffset",0,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"shadowColor",void 0,(0,l.getStringValidator)()),r.Factory.addGetterSetter(j,"shadowBlur",0,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"shadowOpacity",1,(0,l.getNumberValidator)()),r.Factory.addComponentsGetterSetter(j,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(j,"shadowOffsetX",0,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"shadowOffsetY",0,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"fillPatternImage"),r.Factory.addGetterSetter(j,"fill",void 0,(0,l.getStringOrGradientValidator)()),r.Factory.addGetterSetter(j,"fillPatternX",0,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"fillPatternY",0,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(j,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(j,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(j,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(j,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(j,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(j,"fillEnabled",!0),r.Factory.addGetterSetter(j,"strokeEnabled",!0),r.Factory.addGetterSetter(j,"shadowEnabled",!0),r.Factory.addGetterSetter(j,"dashEnabled",!0),r.Factory.addGetterSetter(j,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(j,"fillPriority","color"),r.Factory.addComponentsGetterSetter(j,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(j,"fillPatternOffsetX",0,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"fillPatternOffsetY",0,(0,l.getNumberValidator)()),r.Factory.addComponentsGetterSetter(j,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(j,"fillPatternScaleX",1,(0,l.getNumberValidator)()),r.Factory.addGetterSetter(j,"fillPatternScaleY",1,(0,l.getNumberValidator)()),r.Factory.addComponentsGetterSetter(j,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(j,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(j,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(j,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(j,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(j,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(j,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(j,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(j,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(j,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(j,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(j,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(j,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(j,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(j,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(j,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(j,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(j,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(j,"fillPatternRotation",0),r.Factory.addGetterSetter(j,"fillRule",void 0,(0,l.getStringValidator)()),r.Factory.backCompat(j,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})),Lp=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Layer=void 0;var e=Wt(),n=Ec(),r=an(),o=ft(),l=_c(),s=pt(),c=yn(),f=dt(),p="#",m="beforeDraw",_="draw",S=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],y=S.length,b=class extends n.Container{constructor(g){super(g),this.canvas=new l.SceneCanvas,this.hitCanvas=new l.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(g){return this.getContext().clear(g),this.getHitCanvas().getContext().clear(g),this}setZIndex(g){super.setZIndex(g);const x=this.getStage();return x&&x.content&&(x.content.removeChild(this.getNativeCanvasElement()),g<x.children.length-1?x.content.insertBefore(this.getNativeCanvasElement(),x.children[g+1].getCanvas()._canvas):x.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){r.Node.prototype.moveToTop.call(this);const g=this.getStage();return g&&g.content&&(g.content.removeChild(this.getNativeCanvasElement()),g.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!r.Node.prototype.moveUp.call(this))return!1;const g=this.getStage();return!g||!g.content?!1:(g.content.removeChild(this.getNativeCanvasElement()),this.index<g.children.length-1?g.content.insertBefore(this.getNativeCanvasElement(),g.children[this.index+1].getCanvas()._canvas):g.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(r.Node.prototype.moveDown.call(this)){const g=this.getStage();if(g){const x=g.children;g.content&&(g.content.removeChild(this.getNativeCanvasElement()),g.content.insertBefore(this.getNativeCanvasElement(),x[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(r.Node.prototype.moveToBottom.call(this)){const g=this.getStage();if(g){const x=g.children;g.content&&(g.content.removeChild(this.getNativeCanvasElement()),g.content.insertBefore(this.getNativeCanvasElement(),x[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const g=this.getNativeCanvasElement();return r.Node.prototype.remove.call(this),g&&g.parentNode&&e.Util._isInDocument(g)&&g.parentNode.removeChild(g),this}getStage(){return this.parent}setSize({width:g,height:x}){return this.canvas.setSize(g,x),this.hitCanvas.setSize(g,x),this._setSmoothEnabled(),this}_validateAdd(g){const x=g.getType();x!=="Group"&&x!=="Shape"&&e.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(g){return g=g||{},g.width=g.width||this.getWidth(),g.height=g.height||this.getHeight(),g.x=g.x!==void 0?g.x:this.x(),g.y=g.y!==void 0?g.y:this.y(),r.Node.prototype._toKonvaCanvas.call(this,g)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){e.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){e.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,e.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(g){if(!this.isListening()||!this.isVisible())return null;let x=1,P=!1;for(;;){for(let C=0;C<y;C++){const v=S[C],O=this._getIntersection({x:g.x+v.x*x,y:g.y+v.y*x}),T=O.shape;if(T)return T;if(P=!!O.antialiased,!O.antialiased)break}if(P)x+=1;else return null}}_getIntersection(g){const x=this.hitCanvas.pixelRatio,P=this.hitCanvas.context.getImageData(Math.round(g.x*x),Math.round(g.y*x),1,1).data,C=P[3];if(C===255){const v=e.Util._rgbToHex(P[0],P[1],P[2]),O=c.shapes[p+v];return O?{shape:O}:{antialiased:!0}}else if(C>0)return{antialiased:!0};return{}}drawScene(g,x){const P=this.getLayer(),C=g||P&&P.getCanvas();return this._fire(m,{node:this}),this.clearBeforeDraw()&&C.getContext().clear(),n.Container.prototype.drawScene.call(this,C,x),this._fire(_,{node:this}),this}drawHit(g,x){const P=this.getLayer(),C=g||P&&P.hitCanvas;return P&&P.clearBeforeDraw()&&P.getHitCanvas().getContext().clear(),n.Container.prototype.drawHit.call(this,C,x),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(g){e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(g)}getHitGraphEnabled(g){return e.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const g=this.parent;this.hitCanvas._canvas.parentNode?g.content.removeChild(this.hitCanvas._canvas):g.content.appendChild(this.hitCanvas._canvas)}destroy(){return e.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};t.Layer=b,b.prototype.nodeType="Layer",(0,f._registerNode)(b),o.Factory.addGetterSetter(b,"imageSmoothingEnabled",!0),o.Factory.addGetterSetter(b,"clearBeforeDraw",!0),o.Factory.addGetterSetter(b,"hitGraphEnabled",!0,(0,s.getBooleanValidator)())})),_7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FastLayer=void 0;var e=Wt(),n=Lp(),r=dt(),o=class extends n.Layer{constructor(l){super(l),this.listening(!1),e.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};t.FastLayer=o,o.prototype.nodeType="FastLayer",(0,r._registerNode)(o)})),rf=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Group=void 0;var e=Wt(),n=Ec(),r=dt(),o=class extends n.Container{_validateAdd(l){const s=l.getType();s!=="Group"&&s!=="Shape"&&e.Util.throw("You may only add groups and shapes to groups.")}};t.Group=o,o.prototype.nodeType="Group",(0,r._registerNode)(o)})),af=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Animation=void 0;var e=dt(),n=Wt(),r=(function(){return e.glob.performance&&e.glob.performance.now?function(){return e.glob.performance.now()}:function(){return new Date().getTime()}})(),o=class ql{constructor(s,c){this.id=ql.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:r(),frameRate:0},this.func=s,this.setLayers(c)}setLayers(s){let c=[];return s&&(c=Array.isArray(s)?s:[s]),this.layers=c,this}getLayers(){return this.layers}addLayer(s){const c=this.layers,f=c.length;for(let p=0;p<f;p++)if(c[p]._id===s._id)return!1;return this.layers.push(s),!0}isRunning(){const s=ql.animations,c=s.length;for(let f=0;f<c;f++)if(s[f].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=r(),ql._addAnimation(this),this}stop(){return ql._removeAnimation(this),this}_updateFrameObject(s){this.frame.timeDiff=s-this.frame.lastTime,this.frame.lastTime=s,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(s){this.animations.push(s),this._handleAnimation()}static _removeAnimation(s){const c=s.id,f=this.animations,p=f.length;for(let m=0;m<p;m++)if(f[m].id===c){this.animations.splice(m,1);break}}static _runFrames(){const s={},c=this.animations;for(let f=0;f<c.length;f++){const p=c[f],m=p.layers,_=p.func;p._updateFrameObject(r());const S=m.length;let y;if(_?y=_.call(p,p.frame)!==!1:y=!0,!!y)for(let b=0;b<S;b++){const g=m[b];g._id!==void 0&&(s[g._id]=g)}}for(const f in s)s.hasOwnProperty(f)&&s[f].batchDraw()}static _animationLoop(){const s=ql;s.animations.length?(s._runFrames(),n.Util.requestAnimFrame(s._animationLoop)):s.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,n.Util.requestAnimFrame(this._animationLoop))}};t.Animation=o,o.animations=[],o.animIdCounter=0,o.animRunning=!1})),E7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Easings=t.Tween=void 0;var e=Wt(),n=af(),r=an(),o=dt(),l={node:1,duration:1,easing:1,onFinish:1,yoyo:1},s=1,c=2,f=3,p=["fill","stroke","shadowColor"],m=0,_=class{constructor(y,b,g,x,P,C,v){this.prop=y,this.propFunc=b,this.begin=x,this._pos=x,this.duration=C,this._change=0,this.prevPos=0,this.yoyo=v,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=g,this._change=P-this.begin,this.pause()}fire(y){const b=this[y];b&&b()}setTime(y){y>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():y<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=y,this.update())}getTime(){return this._time}setPosition(y){this.prevPos=this._pos,this.propFunc(y),this._pos=y}getPosition(y){return y===void 0&&(y=this._time),this.func(y,this.begin,this._change,this.duration)}play(){this.state=c,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=f,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(y){this.pause(),this._time=y,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const y=this.getTimer()-this._startTime;this.state===c?this.setTime(y):this.state===f&&this.setTime(this.duration-y)}pause(){this.state=s,this.fire("onPause")}getTimer(){return new Date().getTime()}},S=class Hn{constructor(b){const g=this,x=b.node,P=x._id,C=b.easing||t.Easings.Linear,v=!!b.yoyo;let O,T;typeof b.duration>"u"?O=.3:b.duration===0?O=.001:O=b.duration,this.node=x,this._id=m++;const R=x.getLayer()||(x instanceof o.Konva.Stage?x.getLayers():null);R||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){g.tween.onEnterFrame()},R),this.tween=new _(T,function(L){g._tweenFunc(L)},C,0,1,O*1e3,v),this._addListeners(),Hn.attrs[P]||(Hn.attrs[P]={}),Hn.attrs[P][this._id]||(Hn.attrs[P][this._id]={}),Hn.tweens[P]||(Hn.tweens[P]={});for(T in b)l[T]===void 0&&this._addAttr(T,b[T]);this.reset(),this.onFinish=b.onFinish,this.onReset=b.onReset,this.onUpdate=b.onUpdate}_addAttr(b,g){const x=this.node,P=x._id;let C,v,O,T,R;const L=Hn.tweens[P][b];L&&delete Hn.attrs[P][L][b];let j=x.getAttr(b);if(e.Util._isArray(g))if(C=[],v=Math.max(g.length,j.length),b==="points"&&g.length!==j.length&&(g.length>j.length?(T=j,j=e.Util._prepareArrayForTween(j,g,x.closed())):(O=g,g=e.Util._prepareArrayForTween(g,j,x.closed()))),b.indexOf("fill")===0)for(let M=0;M<v;M++)if(M%2===0)C.push(g[M]-j[M]);else{const z=e.Util.colorToRGBA(j[M]);R=e.Util.colorToRGBA(g[M]),j[M]=z,C.push({r:R.r-z.r,g:R.g-z.g,b:R.b-z.b,a:R.a-z.a})}else for(let M=0;M<v;M++)C.push(g[M]-j[M]);else p.indexOf(b)!==-1?(j=e.Util.colorToRGBA(j),R=e.Util.colorToRGBA(g),C={r:R.r-j.r,g:R.g-j.g,b:R.b-j.b,a:R.a-j.a}):C=g-j;Hn.attrs[P][this._id][b]={start:j,diff:C,end:g,trueEnd:O,trueStart:T},Hn.tweens[P][b]=this._id}_tweenFunc(b){const g=this.node,x=Hn.attrs[g._id][this._id];let P,C,v,O,T,R,L,j;for(P in x){if(C=x[P],v=C.start,O=C.diff,j=C.end,e.Util._isArray(v))if(T=[],L=Math.max(v.length,j.length),P.indexOf("fill")===0)for(R=0;R<L;R++)R%2===0?T.push((v[R]||0)+O[R]*b):T.push("rgba("+Math.round(v[R].r+O[R].r*b)+","+Math.round(v[R].g+O[R].g*b)+","+Math.round(v[R].b+O[R].b*b)+","+(v[R].a+O[R].a*b)+")");else for(R=0;R<L;R++)T.push((v[R]||0)+O[R]*b);else p.indexOf(P)!==-1?T="rgba("+Math.round(v.r+O.r*b)+","+Math.round(v.g+O.g*b)+","+Math.round(v.b+O.b*b)+","+(v.a+O.a*b)+")":T=v+O*b;g.setAttr(P,T)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const b=this.node,g=Hn.attrs[b._id][this._id];g.points&&g.points.trueEnd&&b.setAttr("points",g.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const b=this.node,g=Hn.attrs[b._id][this._id];g.points&&g.points.trueStart&&b.points(g.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(b){return this.tween.seek(b*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const b=this.node._id,g=this._id,x=Hn.tweens[b];this.pause();for(const P in x)delete Hn.tweens[b][P];delete Hn.attrs[b][g]}};t.Tween=S,S.attrs={},S.tweens={},r.Node.prototype.to=function(y){const b=y.onFinish;y.node=this,y.onFinish=function(){this.destroy(),b&&b()},new S(y).play()},t.Easings={BackEaseIn(y,b,g,x){return g*(y/=x)*y*(2.70158*y-1.70158)+b},BackEaseOut(y,b,g,x){return g*((y=y/x-1)*y*(2.70158*y+1.70158)+1)+b},BackEaseInOut(y,b,g,x){let P=1.70158;return(y/=x/2)<1?g/2*(y*y*(((P*=1.525)+1)*y-P))+b:g/2*((y-=2)*y*(((P*=1.525)+1)*y+P)+2)+b},ElasticEaseIn(y,b,g,x,P,C){let v=0;return y===0?b:(y/=x)===1?b+g:(C||(C=x*.3),!P||P<Math.abs(g)?(P=g,v=C/4):v=C/(2*Math.PI)*Math.asin(g/P),-(P*Math.pow(2,10*(y-=1))*Math.sin((y*x-v)*(2*Math.PI)/C))+b)},ElasticEaseOut(y,b,g,x,P,C){let v=0;return y===0?b:(y/=x)===1?b+g:(C||(C=x*.3),!P||P<Math.abs(g)?(P=g,v=C/4):v=C/(2*Math.PI)*Math.asin(g/P),P*Math.pow(2,-10*y)*Math.sin((y*x-v)*(2*Math.PI)/C)+g+b)},ElasticEaseInOut(y,b,g,x,P,C){let v=0;return y===0?b:(y/=x/2)===2?b+g:(C||(C=x*(.3*1.5)),!P||P<Math.abs(g)?(P=g,v=C/4):v=C/(2*Math.PI)*Math.asin(g/P),y<1?-.5*(P*Math.pow(2,10*(y-=1))*Math.sin((y*x-v)*(2*Math.PI)/C))+b:P*Math.pow(2,-10*(y-=1))*Math.sin((y*x-v)*(2*Math.PI)/C)*.5+g+b)},BounceEaseOut(y,b,g,x){return(y/=x)<1/2.75?g*(7.5625*y*y)+b:y<2/2.75?g*(7.5625*(y-=1.5/2.75)*y+.75)+b:y<2.5/2.75?g*(7.5625*(y-=2.25/2.75)*y+.9375)+b:g*(7.5625*(y-=2.625/2.75)*y+.984375)+b},BounceEaseIn(y,b,g,x){return g-t.Easings.BounceEaseOut(x-y,0,g,x)+b},BounceEaseInOut(y,b,g,x){return y<x/2?t.Easings.BounceEaseIn(y*2,0,g,x)*.5+b:t.Easings.BounceEaseOut(y*2-x,0,g,x)*.5+g*.5+b},EaseIn(y,b,g,x){return g*(y/=x)*y+b},EaseOut(y,b,g,x){return-g*(y/=x)*(y-2)+b},EaseInOut(y,b,g,x){return(y/=x/2)<1?g/2*y*y+b:-g/2*(--y*(y-2)-1)+b},StrongEaseIn(y,b,g,x){return g*(y/=x)*y*y*y*y+b},StrongEaseOut(y,b,g,x){return g*((y=y/x-1)*y*y*y*y+1)+b},StrongEaseInOut(y,b,g,x){return(y/=x/2)<1?g/2*y*y*y*y*y+b:g/2*((y-=2)*y*y*y*y+2)+b},Linear(y,b,g,x){return g*y/x+b}}})),of=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var e=dt(),n=Wt(),r=an(),o=Ec(),l=S7(),s=Lp(),c=_7(),f=rf(),p=nf(),m=yn(),_=af(),S=E7(),y=Ip(),b=_c();t.Konva=n.Util._assign(e.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:o.Container,Stage:l.Stage,stages:l.stages,Layer:s.Layer,FastLayer:c.FastLayer,Group:f.Group,DD:p.DD,Shape:m.Shape,shapes:m.shapes,Animation:_.Animation,Tween:S.Tween,Easings:S.Easings,Context:y.Context,Canvas:b.Canvas}),t.default=t.Konva})),x7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Arc=void 0;var e=ft(),n=yn(),r=dt(),o=pt(),l=dt(),s=class extends n.Shape{_sceneFunc(c){const f=r.Konva.getAngle(this.angle()),p=this.clockwise();c.beginPath(),c.arc(0,0,this.outerRadius(),0,f,p),c.arc(0,0,this.innerRadius(),f,0,!p),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(c){this.outerRadius(c/2)}setHeight(c){this.outerRadius(c/2)}getSelfRect(){const c=this.innerRadius(),f=this.outerRadius(),p=this.clockwise(),m=r.Konva.getAngle(p?360-this.angle():this.angle()),_=Math.cos(Math.min(m,Math.PI)),S=1,y=Math.sin(Math.min(Math.max(Math.PI,m),3*Math.PI/2)),b=Math.sin(Math.min(m,Math.PI/2)),g=_*(_>0?c:f),x=S*f,P=y*(y>0?c:f),C=b*(b>0?f:c);return{x:g,y:p?-1*C:P,width:x-g,height:C-P}}};t.Arc=s,s.prototype._centroid=!0,s.prototype.className="Arc",s.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,l._registerNode)(s),e.Factory.addGetterSetter(s,"innerRadius",0,(0,o.getNumberValidator)()),e.Factory.addGetterSetter(s,"outerRadius",0,(0,o.getNumberValidator)()),e.Factory.addGetterSetter(s,"angle",0,(0,o.getNumberValidator)()),e.Factory.addGetterSetter(s,"clockwise",!1,(0,o.getBooleanValidator)())})),Rp=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Line=void 0;var e=ft(),n=dt(),r=yn(),o=pt();function l(f,p,m,_,S,y,b){const g=Math.sqrt(Math.pow(m-f,2)+Math.pow(_-p,2)),x=Math.sqrt(Math.pow(S-m,2)+Math.pow(y-_,2)),P=b*g/(g+x),C=b*x/(g+x);return[m-P*(S-f),_-P*(y-p),m+C*(S-f),_+C*(y-p)]}function s(f,p){const m=f.length,_=[];for(let S=2;S<m-2;S+=2){const y=l(f[S-2],f[S-1],f[S],f[S+1],f[S+2],f[S+3],p);isNaN(y[0])||(_.push(y[0]),_.push(y[1]),_.push(f[S]),_.push(f[S+1]),_.push(y[2]),_.push(y[3]))}return _}var c=class extends r.Shape{constructor(f){super(f),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(f){let p=this.points(),m=p.length,_=this.tension(),S=this.closed(),y=this.bezier(),b,g,x;if(m){if(f.beginPath(),f.moveTo(p[0],p[1]),_!==0&&m>4){for(b=this.getTensionPoints(),g=b.length,x=S?0:4,S||f.quadraticCurveTo(b[0],b[1],b[2],b[3]);x<g-2;)f.bezierCurveTo(b[x++],b[x++],b[x++],b[x++],b[x++],b[x++]);S||f.quadraticCurveTo(b[g-2],b[g-1],p[m-2],p[m-1])}else if(y)for(x=2;x<m;)f.bezierCurveTo(p[x++],p[x++],p[x++],p[x++],p[x++],p[x++]);else for(x=2;x<m;x+=2)f.lineTo(p[x],p[x+1]);S?(f.closePath(),f.fillStrokeShape(this)):f.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():s(this.points(),this.tension())}_getTensionPointsClosed(){const f=this.points(),p=f.length,m=this.tension(),_=l(f[p-2],f[p-1],f[0],f[1],f[2],f[3],m),S=l(f[p-4],f[p-3],f[p-2],f[p-1],f[0],f[1],m),y=s(f,m);return[_[2],_[3]].concat(y).concat([S[0],S[1],f[p-2],f[p-1],S[2],S[3],_[0],_[1],f[0],f[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let f=this.points();if(f.length<4)return{x:f[0]||0,y:f[1]||0,width:0,height:0};this.tension()!==0?f=[f[0],f[1],...this._getTensionPoints(),f[f.length-2],f[f.length-1]]:f=this.points();let p=f[0],m=f[0],_=f[1],S=f[1],y,b;for(let g=0;g<f.length/2;g++)y=f[g*2],b=f[g*2+1],p=Math.min(p,y),m=Math.max(m,y),_=Math.min(_,b),S=Math.max(S,b);return{x:p,y:_,width:m-p,height:S-_}}};t.Line=c,c.prototype.className="Line",c.prototype._attrsAffectingSize=["points","bezier","tension"],(0,n._registerNode)(c),e.Factory.addGetterSetter(c,"closed",!1),e.Factory.addGetterSetter(c,"bezier",!1),e.Factory.addGetterSetter(c,"tension",0,(0,o.getNumberValidator)()),e.Factory.addGetterSetter(c,"points",[],(0,o.getNumberArrayValidator)())})),O7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.t2length=t.getQuadraticArcLength=t.getCubicArcLength=t.binomialCoefficients=t.cValues=t.tValues=void 0,t.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],t.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],t.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];var e=(s,c,f)=>{let p,m;const S=f/2;p=0;for(let y=0;y<20;y++)m=S*t.tValues[20][y]+S,p+=t.cValues[20][y]*r(s,c,m);return S*p};t.getCubicArcLength=e;var n=(s,c,f)=>{f===void 0&&(f=1);const p=s[0]-2*s[1]+s[2],m=c[0]-2*c[1]+c[2],_=2*s[1]-2*s[0],S=2*c[1]-2*c[0],y=4*(p*p+m*m),b=4*(p*_+m*S),g=_*_+S*S;if(y===0)return f*Math.sqrt(Math.pow(s[2]-s[0],2)+Math.pow(c[2]-c[0],2));const x=b/(2*y),P=g/y,C=f+x,v=P-x*x,O=C*C+v>0?Math.sqrt(C*C+v):0,T=x*x+v>0?Math.sqrt(x*x+v):0,R=x+Math.sqrt(x*x+v)!==0?v*Math.log(Math.abs((C+O)/(x+T))):0;return Math.sqrt(y)/2*(C*O-x*T+R)};t.getQuadraticArcLength=n;function r(s,c,f){const p=o(1,f,s),m=o(1,f,c),_=p*p+m*m;return Math.sqrt(_)}var o=(s,c,f)=>{const p=f.length-1;let m,_;if(p===0)return 0;if(s===0){_=0;for(let S=0;S<=p;S++)_+=t.binomialCoefficients[p][S]*Math.pow(1-c,p-S)*Math.pow(c,S)*f[S];return _}else{m=new Array(p);for(let S=0;S<p;S++)m[S]=p*(f[S+1]-f[S]);return o(s-1,c,m)}},l=(s,c,f)=>{let p=1,m=s/c,_=(s-f(m))/c,S=0;for(;p>.001;){const y=f(m+_),b=Math.abs(s-y)/c;if(b<p)p=b,m+=_;else{const g=f(m-_),x=Math.abs(s-g)/c;x<p?(p=x,m-=_):_/=2}if(S++,S>500)break}return m};t.t2length=l})),lf=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Path=void 0;var e=ft(),n=yn(),r=dt(),o=O7(),l=class cr extends n.Shape{constructor(c){super(c),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=cr.parsePathData(this.data()),this.pathLength=cr.getPathLength(this.dataArray)}_sceneFunc(c){const f=this.dataArray;c.beginPath();let p=!1;for(let T=0;T<f.length;T++){const R=f[T].command,L=f[T].points;switch(R){case"L":c.lineTo(L[0],L[1]);break;case"M":c.moveTo(L[0],L[1]);break;case"C":c.bezierCurveTo(L[0],L[1],L[2],L[3],L[4],L[5]);break;case"Q":c.quadraticCurveTo(L[0],L[1],L[2],L[3]);break;case"A":var m=L[0],_=L[1],S=L[2],y=L[3],b=L[4],g=L[5],x=L[6],P=L[7],C=S>y?S:y,v=S>y?1:S/y,O=S>y?y/S:1;c.translate(m,_),c.rotate(x),c.scale(v,O),c.arc(0,0,C,b,b+g,1-P),c.scale(1/v,1/O),c.rotate(-x),c.translate(-m,-_);break;case"z":p=!0,c.closePath()}}!p&&!this.hasFill()?c.strokeShape(this):c.fillStrokeShape(this)}getSelfRect(){let c=[];this.dataArray.forEach(function(b){if(b.command==="A"){const g=b.points[4],x=b.points[5],P=b.points[4]+x;let C=Math.PI/180;if(Math.abs(g-P)<C&&(C=Math.abs(g-P)),x<0)for(let v=g-C;v>P;v-=C){const O=cr.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],v,0);c.push(O.x,O.y)}else for(let v=g+C;v<P;v+=C){const O=cr.getPointOnEllipticalArc(b.points[0],b.points[1],b.points[2],b.points[3],v,0);c.push(O.x,O.y)}}else if(b.command==="C")for(let g=0;g<=1;g+=.01){const x=cr.getPointOnCubicBezier(g,b.start.x,b.start.y,b.points[0],b.points[1],b.points[2],b.points[3],b.points[4],b.points[5]);c.push(x.x,x.y)}else c=c.concat(b.points)});let f=c[0],p=c[0],m=c[1],_=c[1],S,y;for(let b=0;b<c.length/2;b++)S=c[b*2],y=c[b*2+1],isNaN(S)||(f=Math.min(f,S),p=Math.max(p,S)),isNaN(y)||(m=Math.min(m,y),_=Math.max(_,y));return{x:f,y:m,width:p-f,height:_-m}}getLength(){return this.pathLength}getPointAtLength(c){return cr.getPointAtLengthOfDataArray(c,this.dataArray)}static getLineLength(c,f,p,m){return Math.sqrt((p-c)*(p-c)+(m-f)*(m-f))}static getPathLength(c){let f=0;for(let p=0;p<c.length;++p)f+=c[p].pathLength;return f}static getPointAtLengthOfDataArray(c,f){let p,m=0,_=f.length;if(!_)return null;for(;m<_&&c>f[m].pathLength;)c-=f[m].pathLength,++m;if(m===_)return p=f[m-1].points.slice(-2),{x:p[0],y:p[1]};if(c<.01)return p=f[m].points.slice(0,2),{x:p[0],y:p[1]};const S=f[m],y=S.points;switch(S.command){case"L":return cr.getPointOnLine(c,S.start.x,S.start.y,y[0],y[1]);case"C":return cr.getPointOnCubicBezier((0,o.t2length)(c,cr.getPathLength(f),T=>(0,o.getCubicArcLength)([S.start.x,y[0],y[2],y[4]],[S.start.y,y[1],y[3],y[5]],T)),S.start.x,S.start.y,y[0],y[1],y[2],y[3],y[4],y[5]);case"Q":return cr.getPointOnQuadraticBezier((0,o.t2length)(c,cr.getPathLength(f),T=>(0,o.getQuadraticArcLength)([S.start.x,y[0],y[2]],[S.start.y,y[1],y[3]],T)),S.start.x,S.start.y,y[0],y[1],y[2],y[3]);case"A":var b=y[0],g=y[1],x=y[2],P=y[3],C=y[4],v=y[5],O=y[6];return C+=v*c/S.pathLength,cr.getPointOnEllipticalArc(b,g,x,P,C,O)}return null}static getPointOnLine(c,f,p,m,_,S,y){S=S??f,y=y??p;const b=this.getLineLength(f,p,m,_);if(b<1e-10)return{x:f,y:p};if(m===f)return{x:S,y:y+(_>p?c:-c)};const g=(_-p)/(m-f),x=Math.sqrt(c*c/(1+g*g))*(m<f?-1:1),P=g*x;if(Math.abs(y-p-g*(S-f))<1e-10)return{x:S+x,y:y+P};const C=((S-f)*(m-f)+(y-p)*(_-p))/(b*b),v=f+C*(m-f),O=p+C*(_-p),T=this.getLineLength(S,y,v,O),R=Math.sqrt(c*c-T*T),L=Math.sqrt(R*R/(1+g*g))*(m<f?-1:1),j=g*L;return{x:v+L,y:O+j}}static getPointOnCubicBezier(c,f,p,m,_,S,y,b,g){function x(O){return O*O*O}function P(O){return 3*O*O*(1-O)}function C(O){return 3*O*(1-O)*(1-O)}function v(O){return(1-O)*(1-O)*(1-O)}return{x:b*x(c)+S*P(c)+m*C(c)+f*v(c),y:g*x(c)+y*P(c)+_*C(c)+p*v(c)}}static getPointOnQuadraticBezier(c,f,p,m,_,S,y){function b(P){return P*P}function g(P){return 2*P*(1-P)}function x(P){return(1-P)*(1-P)}return{x:S*b(c)+m*g(c)+f*x(c),y:y*b(c)+_*g(c)+p*x(c)}}static getPointOnEllipticalArc(c,f,p,m,_,S){const y=Math.cos(S),b=Math.sin(S),g={x:p*Math.cos(_),y:m*Math.sin(_)};return{x:c+(g.x*y-g.y*b),y:f+(g.x*b+g.y*y)}}static parsePathData(c){if(!c)return[];let f=c;const p=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];f=f.replace(new RegExp(" ","g"),",");for(var m=0;m<p.length;m++)f=f.replace(new RegExp(p[m],"g"),"|"+p[m]);const _=f.split("|"),S=[],y=[];let b=0,g=0;const x=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let P;for(m=1;m<_.length;m++){let w=_[m],D=w.charAt(0);for(w=w.slice(1),y.length=0;P=x.exec(w);)y.push(P[0]);const N=[];for(let H=0,V=y.length;H<V;H++){if(y[H]==="00"){N.push(0,0);continue}const W=parseFloat(y[H]);isNaN(W)?N.push(0):N.push(W)}for(;N.length>0&&!isNaN(N[0]);){let H="",V=[];const W=b,U=g;var C,v,O,T,R,L,j,M,z,k;switch(D){case"l":b+=N.shift(),g+=N.shift(),H="L",V.push(b,g);break;case"L":b=N.shift(),g=N.shift(),V.push(b,g);break;case"m":var F=N.shift(),G=N.shift();if(b+=F,g+=G,H="M",S.length>2&&S[S.length-1].command==="z"){for(let Q=S.length-2;Q>=0;Q--)if(S[Q].command==="M"){b=S[Q].points[0]+F,g=S[Q].points[1]+G;break}}V.push(b,g),D="l";break;case"M":b=N.shift(),g=N.shift(),H="M",V.push(b,g),D="L";break;case"h":b+=N.shift(),H="L",V.push(b,g);break;case"H":b=N.shift(),H="L",V.push(b,g);break;case"v":g+=N.shift(),H="L",V.push(b,g);break;case"V":g=N.shift(),H="L",V.push(b,g);break;case"C":V.push(N.shift(),N.shift(),N.shift(),N.shift()),b=N.shift(),g=N.shift(),V.push(b,g);break;case"c":V.push(b+N.shift(),g+N.shift(),b+N.shift(),g+N.shift()),b+=N.shift(),g+=N.shift(),H="C",V.push(b,g);break;case"S":v=b,O=g,C=S[S.length-1],C.command==="C"&&(v=b+(b-C.points[2]),O=g+(g-C.points[3])),V.push(v,O,N.shift(),N.shift()),b=N.shift(),g=N.shift(),H="C",V.push(b,g);break;case"s":v=b,O=g,C=S[S.length-1],C.command==="C"&&(v=b+(b-C.points[2]),O=g+(g-C.points[3])),V.push(v,O,b+N.shift(),g+N.shift()),b+=N.shift(),g+=N.shift(),H="C",V.push(b,g);break;case"Q":V.push(N.shift(),N.shift()),b=N.shift(),g=N.shift(),V.push(b,g);break;case"q":V.push(b+N.shift(),g+N.shift()),b+=N.shift(),g+=N.shift(),H="Q",V.push(b,g);break;case"T":v=b,O=g,C=S[S.length-1],C.command==="Q"&&(v=b+(b-C.points[0]),O=g+(g-C.points[1])),b=N.shift(),g=N.shift(),H="Q",V.push(v,O,b,g);break;case"t":v=b,O=g,C=S[S.length-1],C.command==="Q"&&(v=b+(b-C.points[0]),O=g+(g-C.points[1])),b+=N.shift(),g+=N.shift(),H="Q",V.push(v,O,b,g);break;case"A":T=N.shift(),R=N.shift(),L=N.shift(),j=N.shift(),M=N.shift(),z=b,k=g,b=N.shift(),g=N.shift(),H="A",V=this.convertEndpointToCenterParameterization(z,k,b,g,j,M,T,R,L);break;case"a":T=N.shift(),R=N.shift(),L=N.shift(),j=N.shift(),M=N.shift(),z=b,k=g,b+=N.shift(),g+=N.shift(),H="A",V=this.convertEndpointToCenterParameterization(z,k,b,g,j,M,T,R,L)}S.push({command:H||D,points:V,start:{x:W,y:U},pathLength:this.calcLength(W,U,H||D,V)})}(D==="z"||D==="Z")&&S.push({command:"z",points:[],start:void 0,pathLength:0})}return S}static calcLength(c,f,p,m){let _,S,y,b;const g=cr;switch(p){case"L":return g.getLineLength(c,f,m[0],m[1]);case"C":return(0,o.getCubicArcLength)([c,m[0],m[2],m[4]],[f,m[1],m[3],m[5]],1);case"Q":return(0,o.getQuadraticArcLength)([c,m[0],m[2]],[f,m[1],m[3]],1);case"A":_=0;var x=m[4],P=m[5],C=m[4]+P,v=Math.PI/180;if(Math.abs(x-C)<v&&(v=Math.abs(x-C)),S=g.getPointOnEllipticalArc(m[0],m[1],m[2],m[3],x,0),P<0)for(b=x-v;b>C;b-=v)y=g.getPointOnEllipticalArc(m[0],m[1],m[2],m[3],b,0),_+=g.getLineLength(S.x,S.y,y.x,y.y),S=y;else for(b=x+v;b<C;b+=v)y=g.getPointOnEllipticalArc(m[0],m[1],m[2],m[3],b,0),_+=g.getLineLength(S.x,S.y,y.x,y.y),S=y;return y=g.getPointOnEllipticalArc(m[0],m[1],m[2],m[3],C,0),_+=g.getLineLength(S.x,S.y,y.x,y.y),_}return 0}static convertEndpointToCenterParameterization(c,f,p,m,_,S,y,b,g){const x=g*(Math.PI/180),P=Math.cos(x)*(c-p)/2+Math.sin(x)*(f-m)/2,C=-1*Math.sin(x)*(c-p)/2+Math.cos(x)*(f-m)/2,v=P*P/(y*y)+C*C/(b*b);v>1&&(y*=Math.sqrt(v),b*=Math.sqrt(v));let O=Math.sqrt((y*y*(b*b)-y*y*(C*C)-b*b*(P*P))/(y*y*(C*C)+b*b*(P*P)));_===S&&(O*=-1),isNaN(O)&&(O=0);const T=O*y*C/b,R=O*-b*P/y,L=(c+p)/2+Math.cos(x)*T-Math.sin(x)*R,j=(f+m)/2+Math.sin(x)*T+Math.cos(x)*R,M=function(N){return Math.sqrt(N[0]*N[0]+N[1]*N[1])},z=function(N,H){return(N[0]*H[0]+N[1]*H[1])/(M(N)*M(H))},k=function(N,H){return(N[0]*H[1]<N[1]*H[0]?-1:1)*Math.acos(z(N,H))},F=k([1,0],[(P-T)/y,(C-R)/b]),G=[(P-T)/y,(C-R)/b],w=[(-1*P-T)/y,(-1*C-R)/b];let D=k(G,w);return z(G,w)<=-1&&(D=Math.PI),z(G,w)>=1&&(D=0),S===0&&D>0&&(D=D-2*Math.PI),S===1&&D<0&&(D=D+2*Math.PI),[L,j,y,b,F,D,x,S]}};t.Path=l,l.prototype.className="Path",l.prototype._attrsAffectingSize=["data"],(0,r._registerNode)(l),e.Factory.addGetterSetter(l,"data")})),w7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Arrow=void 0;var e=ft(),n=Rp(),r=pt(),o=dt(),l=lf(),s=class extends n.Line{_sceneFunc(c){super._sceneFunc(c);const f=Math.PI*2,p=this.points();let m=p;const _=this.tension()!==0&&p.length>4;_&&(m=this.getTensionPoints());const S=this.pointerLength(),y=p.length;let b,g;if(_){const C=[m[m.length-4],m[m.length-3],m[m.length-2],m[m.length-1],p[y-2],p[y-1]],v=l.Path.calcLength(m[m.length-4],m[m.length-3],"C",C),O=l.Path.getPointOnQuadraticBezier(Math.min(1,1-S/v),C[0],C[1],C[2],C[3],C[4],C[5]);b=p[y-2]-O.x,g=p[y-1]-O.y}else b=p[y-2]-p[y-4],g=p[y-1]-p[y-3];const x=(Math.atan2(g,b)+f)%f,P=this.pointerWidth();this.pointerAtEnding()&&(c.save(),c.beginPath(),c.translate(p[y-2],p[y-1]),c.rotate(x),c.moveTo(0,0),c.lineTo(-S,P/2),c.lineTo(-S,-P/2),c.closePath(),c.restore(),this.__fillStroke(c)),this.pointerAtBeginning()&&(c.save(),c.beginPath(),c.translate(p[0],p[1]),_?(b=(m[0]+m[2])/2-p[0],g=(m[1]+m[3])/2-p[1]):(b=p[2]-p[0],g=p[3]-p[1]),c.rotate((Math.atan2(-g,-b)+f)%f),c.moveTo(0,0),c.lineTo(-S,P/2),c.lineTo(-S,-P/2),c.closePath(),c.restore(),this.__fillStroke(c))}__fillStroke(c){const f=this.dashEnabled();f&&(this.attrs.dashEnabled=!1,c.setLineDash([])),c.fillStrokeShape(this),f&&(this.attrs.dashEnabled=!0)}getSelfRect(){const c=super.getSelfRect(),f=this.pointerWidth()/2;return{x:c.x,y:c.y-f,width:c.width,height:c.height+f*2}}};t.Arrow=s,s.prototype.className="Arrow",(0,o._registerNode)(s),e.Factory.addGetterSetter(s,"pointerLength",10,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(s,"pointerWidth",10,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(s,"pointerAtBeginning",!1),e.Factory.addGetterSetter(s,"pointerAtEnding",!0)})),T7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Circle=void 0;var e=ft(),n=yn(),r=pt(),o=dt(),l=class extends n.Shape{_sceneFunc(s){s.beginPath(),s.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius()!==s/2&&this.radius(s/2)}setHeight(s){this.radius()!==s/2&&this.radius(s/2)}};t.Circle=l,l.prototype._centroid=!0,l.prototype.className="Circle",l.prototype._attrsAffectingSize=["radius"],(0,o._registerNode)(l),e.Factory.addGetterSetter(l,"radius",0,(0,r.getNumberValidator)())})),P7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ellipse=void 0;var e=ft(),n=yn(),r=pt(),o=dt(),l=class extends n.Shape{_sceneFunc(s){const c=this.radiusX(),f=this.radiusY();s.beginPath(),s.save(),c!==f&&s.scale(1,f/c),s.arc(0,0,c,0,Math.PI*2,!1),s.restore(),s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(s){this.radiusX(s/2)}setHeight(s){this.radiusY(s/2)}};t.Ellipse=l,l.prototype.className="Ellipse",l.prototype._centroid=!0,l.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,o._registerNode)(l),e.Factory.addComponentsGetterSetter(l,"radius",["x","y"]),e.Factory.addGetterSetter(l,"radiusX",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(l,"radiusY",0,(0,r.getNumberValidator)())})),A7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Image=void 0;var e=Wt(),n=ft(),r=yn(),o=dt(),l=pt(),s=class h7 extends r.Shape{constructor(f){super(f),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const f=this.image();f&&f.complete||f&&f.readyState===4||f&&f.addEventListener&&f.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){const f=!!this.cornerRadius(),p=this.hasShadow();return f&&p?!0:super._useBufferCanvas(!0)}_sceneFunc(f){const p=this.getWidth(),m=this.getHeight(),_=this.cornerRadius(),S=this.attrs.image;let y;if(S){const b=this.attrs.cropWidth,g=this.attrs.cropHeight;b&&g?y=[S,this.cropX(),this.cropY(),b,g,0,0,p,m]:y=[S,0,0,p,m]}(this.hasFill()||this.hasStroke()||_)&&(f.beginPath(),_?e.Util.drawRoundedRectPath(f,p,m,_):f.rect(0,0,p,m),f.closePath(),f.fillStrokeShape(this)),S&&(_&&f.clip(),f.drawImage.apply(f,y))}_hitFunc(f){const p=this.width(),m=this.height(),_=this.cornerRadius();f.beginPath(),_?e.Util.drawRoundedRectPath(f,p,m,_):f.rect(0,0,p,m),f.closePath(),f.fillStrokeShape(this)}getWidth(){var f,p;return(f=this.attrs.width)!==null&&f!==void 0?f:(p=this.image())===null||p===void 0?void 0:p.width}getHeight(){var f,p;return(f=this.attrs.height)!==null&&f!==void 0?f:(p=this.image())===null||p===void 0?void 0:p.height}static fromURL(f,p,m=null){const _=e.Util.createImageElement();_.onload=function(){p(new h7({image:_}))},_.onerror=m,_.crossOrigin="Anonymous",_.src=f}};t.Image=s,s.prototype.className="Image",(0,o._registerNode)(s),n.Factory.addGetterSetter(s,"cornerRadius",0,(0,l.getNumberOrArrayOfNumbersValidator)(4)),n.Factory.addGetterSetter(s,"image"),n.Factory.addComponentsGetterSetter(s,"crop",["x","y","width","height"]),n.Factory.addGetterSetter(s,"cropX",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(s,"cropY",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(s,"cropWidth",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(s,"cropHeight",0,(0,l.getNumberValidator)())})),M7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Tag=t.Label=void 0;var e=ft(),n=yn(),r=rf(),o=pt(),l=dt(),s=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],c="Change.konva",f="none",p="up",m="right",_="down",S="left",y=s.length,b=class extends r.Group{constructor(x){super(x),this.on("add.konva",function(P){this._addListeners(P.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(x){let P=this,C;const v=function(){P._sync()};for(C=0;C<y;C++)x.on(s[C]+c,v)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let x=this.getText(),P=this.getTag(),C,v,O,T,R,L,j;if(x&&P){switch(C=x.width(),v=x.height(),O=P.pointerDirection(),T=P.pointerWidth(),j=P.pointerHeight(),R=0,L=0,O){case p:R=C/2,L=-1*j;break;case m:R=C+T,L=v/2;break;case _:R=C/2,L=v+j;break;case S:R=-1*T,L=v/2}P.setAttrs({x:-1*R,y:-1*L,width:C,height:v}),x.setAttrs({x:-1*R,y:-1*L})}}};t.Label=b,b.prototype.className="Label",(0,l._registerNode)(b);var g=class extends n.Shape{_sceneFunc(x){const P=this.width(),C=this.height(),v=this.pointerDirection(),O=this.pointerWidth(),T=this.pointerHeight(),R=this.cornerRadius();let L=0,j=0,M=0,z=0;typeof R=="number"?L=j=M=z=Math.min(R,P/2,C/2):(L=Math.min(R[0]||0,P/2,C/2),j=Math.min(R[1]||0,P/2,C/2),z=Math.min(R[2]||0,P/2,C/2),M=Math.min(R[3]||0,P/2,C/2)),x.beginPath(),x.moveTo(L,0),v===p&&(x.lineTo((P-O)/2,0),x.lineTo(P/2,-1*T),x.lineTo((P+O)/2,0)),x.lineTo(P-j,0),x.arc(P-j,j,j,Math.PI*3/2,0,!1),v===m&&(x.lineTo(P,(C-T)/2),x.lineTo(P+O,C/2),x.lineTo(P,(C+T)/2)),x.lineTo(P,C-z),x.arc(P-z,C-z,z,0,Math.PI/2,!1),v===_&&(x.lineTo((P+O)/2,C),x.lineTo(P/2,C+T),x.lineTo((P-O)/2,C)),x.lineTo(M,C),x.arc(M,C-M,M,Math.PI/2,Math.PI,!1),v===S&&(x.lineTo(0,(C+T)/2),x.lineTo(-1*O,C/2),x.lineTo(0,(C-T)/2)),x.lineTo(0,L),x.arc(L,L,L,Math.PI,Math.PI*3/2,!1),x.closePath(),x.fillStrokeShape(this)}getSelfRect(){let x=0,P=0,C=this.pointerWidth(),v=this.pointerHeight(),O=this.pointerDirection(),T=this.width(),R=this.height();return O===p?(P-=v,R+=v):O===_?R+=v:O===S?(x-=C*1.5,T+=C):O===m&&(T+=C*1.5),{x,y:P,width:T,height:R}}};t.Tag=g,g.prototype.className="Tag",(0,l._registerNode)(g),e.Factory.addGetterSetter(g,"pointerDirection",f),e.Factory.addGetterSetter(g,"pointerWidth",0,(0,o.getNumberValidator)()),e.Factory.addGetterSetter(g,"pointerHeight",0,(0,o.getNumberValidator)()),e.Factory.addGetterSetter(g,"cornerRadius",0,(0,o.getNumberOrArrayOfNumbersValidator)(4))})),jp=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Rect=void 0;var e=ft(),n=yn(),r=dt(),o=Wt(),l=pt(),s=class extends n.Shape{_sceneFunc(c){const f=this.cornerRadius(),p=this.width(),m=this.height();c.beginPath(),f?o.Util.drawRoundedRectPath(c,p,m,f):c.rect(0,0,p,m),c.closePath(),c.fillStrokeShape(this)}};t.Rect=s,s.prototype.className="Rect",(0,r._registerNode)(s),e.Factory.addGetterSetter(s,"cornerRadius",0,(0,l.getNumberOrArrayOfNumbersValidator)(4))})),I7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RegularPolygon=void 0;var e=ft(),n=yn(),r=pt(),o=dt(),l=class extends n.Shape{_sceneFunc(s){const c=this._getPoints();s.beginPath(),s.moveTo(c[0].x,c[0].y);for(let f=1;f<c.length;f++)s.lineTo(c[f].x,c[f].y);s.closePath(),s.fillStrokeShape(this)}_getPoints(){const s=this.attrs.sides,c=this.attrs.radius||0,f=[];for(let p=0;p<s;p++)f.push({x:c*Math.sin(p*2*Math.PI/s),y:-1*c*Math.cos(p*2*Math.PI/s)});return f}getSelfRect(){const s=this._getPoints();let c=s[0].x,f=s[0].y,p=s[0].x,m=s[0].y;return s.forEach(_=>{c=Math.min(c,_.x),f=Math.max(f,_.x),p=Math.min(p,_.y),m=Math.max(m,_.y)}),{x:c,y:p,width:f-c,height:m-p}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(s){this.radius(s/2)}setHeight(s){this.radius(s/2)}};t.RegularPolygon=l,l.prototype.className="RegularPolygon",l.prototype._centroid=!0,l.prototype._attrsAffectingSize=["radius"],(0,o._registerNode)(l),e.Factory.addGetterSetter(l,"radius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(l,"sides",0,(0,r.getNumberValidator)())})),N7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Ring=void 0;var e=ft(),n=yn(),r=pt(),o=dt(),l=Math.PI*2,s=class extends n.Shape{_sceneFunc(c){c.beginPath(),c.arc(0,0,this.innerRadius(),0,l,!1),c.moveTo(this.outerRadius(),0),c.arc(0,0,this.outerRadius(),l,0,!0),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(c){this.outerRadius(c/2)}setHeight(c){this.outerRadius(c/2)}};t.Ring=s,s.prototype.className="Ring",s.prototype._centroid=!0,s.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,o._registerNode)(s),e.Factory.addGetterSetter(s,"innerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(s,"outerRadius",0,(0,r.getNumberValidator)())})),L7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Sprite=void 0;var e=ft(),n=yn(),r=af(),o=pt(),l=dt(),s=class extends n.Shape{constructor(c){super(c),this._updated=!0,this.anim=new r.Animation(()=>{const f=this._updated;return this._updated=!1,f}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(c){const f=this.animation(),p=this.frameIndex(),m=p*4,_=this.animations()[f],S=this.frameOffsets(),y=_[m+0],b=_[m+1],g=_[m+2],x=_[m+3],P=this.image();if((this.hasFill()||this.hasStroke())&&(c.beginPath(),c.rect(0,0,g,x),c.closePath(),c.fillStrokeShape(this)),P)if(S){const C=S[f],v=p*2;c.drawImage(P,y,b,g,x,C[v+0],C[v+1],g,x)}else c.drawImage(P,y,b,g,x,0,0,g,x)}_hitFunc(c){const f=this.animation(),p=this.frameIndex(),m=p*4,_=this.animations()[f],S=this.frameOffsets(),y=_[m+2],b=_[m+3];if(c.beginPath(),S){const g=S[f],x=p*2;c.rect(g[x+0],g[x+1],y,b)}else c.rect(0,0,y,b);c.closePath(),c.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const c=this;this.interval=setInterval(function(){c._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const c=this.getLayer();this.anim.setLayers(c),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const c=this.frameIndex(),f=this.animation();c<this.animations()[f].length/4-1?this.frameIndex(c+1):this.frameIndex(0)}};t.Sprite=s,s.prototype.className="Sprite",(0,l._registerNode)(s),e.Factory.addGetterSetter(s,"animation"),e.Factory.addGetterSetter(s,"animations"),e.Factory.addGetterSetter(s,"frameOffsets"),e.Factory.addGetterSetter(s,"image"),e.Factory.addGetterSetter(s,"frameIndex",0,(0,o.getNumberValidator)()),e.Factory.addGetterSetter(s,"frameRate",17,(0,o.getNumberValidator)()),e.Factory.backCompat(s,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"})})),R7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Star=void 0;var e=ft(),n=yn(),r=pt(),o=dt(),l=class extends n.Shape{_sceneFunc(s){const c=this.innerRadius(),f=this.outerRadius(),p=this.numPoints();s.beginPath(),s.moveTo(0,0-f);for(let m=1;m<p*2;m++){const _=m%2===0?f:c,S=_*Math.sin(m*Math.PI/p),y=-1*_*Math.cos(m*Math.PI/p);s.lineTo(S,y)}s.closePath(),s.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(s){this.outerRadius(s/2)}setHeight(s){this.outerRadius(s/2)}};t.Star=l,l.prototype.className="Star",l.prototype._centroid=!0,l.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,o._registerNode)(l),e.Factory.addGetterSetter(l,"numPoints",5,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(l,"innerRadius",0,(0,r.getNumberValidator)()),e.Factory.addGetterSetter(l,"outerRadius",0,(0,r.getNumberValidator)())})),Dp=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Text=void 0,t.stringToArray=c;var e=Wt(),n=ft(),r=yn(),o=dt(),l=pt(),s=dt();function c(Z){return[...Z].reduce((ie,te,X,K)=>{if(new RegExp("\\p{Emoji}","u").test(te)){const le=K[X+1];le&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(le)?(ie.push(te+le),K[X+1]=""):ie.push(te)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(te+(K[X+1]||""))?ie.push(te+K[X+1]):X>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(te)?ie[ie.length-1]+=te:te&&ie.push(te);return ie},[])}var f="auto",p="center",m="inherit",_="justify",S="Change.konva",y="2d",b="-",g="left",x="text",P="Text",C="top",v="bottom",O="middle",T="normal",R="px ",L=" ",j="right",M="rtl",z="word",k="char",F="none",G="…",w=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],D=w.length;function N(Z){return Z.split(",").map(ie=>{ie=ie.trim();const te=ie.indexOf(" ")>=0,X=ie.indexOf('"')>=0||ie.indexOf("'")>=0;return te&&!X&&(ie=`"${ie}"`),ie}).join(", ")}var H;function V(){return H||(H=e.Util.createCanvasElement().getContext(y),H)}function W(Z){Z.fillText(this._partialText,this._partialTextX,this._partialTextY)}function U(Z){Z.setAttr("miterLimit",2),Z.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Q(Z){return Z=Z||{},!Z.fillLinearGradientColorStops&&!Z.fillRadialGradientColorStops&&!Z.fillPatternImage&&(Z.fill=Z.fill||"black"),Z}var ae=class extends r.Shape{constructor(Z){super(Q(Z)),this._partialTextX=0,this._partialTextY=0;for(let ie=0;ie<D;ie++)this.on(w[ie]+S,this._setTextData);this._setTextData()}_sceneFunc(Z){const ie=this.textArr,te=ie.length;if(!this.text())return;let X=this.padding(),K=this.fontSize(),le=this.lineHeight()*K,fe=this.verticalAlign(),ue=this.direction(),he=0,Ee=this.align(),Se=this.getWidth(),Ie=this.letterSpacing(),Xe=this.fill(),Ge=this.textDecoration(),Le=Ge.indexOf("underline")!==-1,je=Ge.indexOf("line-through")!==-1,Ne;ue=ue===m?Z.direction:ue;let ze=le/2,He=O;if(o.Konva._fixTextRendering){const Gt=this.measureSize("M");He="alphabetic",ze=(Gt.fontBoundingBoxAscent-Gt.fontBoundingBoxDescent)/2+le/2}var $e=0,Ae=0;for(ue===M&&Z.setAttr("direction",ue),Z.setAttr("font",this._getContextFont()),Z.setAttr("textBaseline",He),Z.setAttr("textAlign",g),fe===O?he=(this.getHeight()-te*le-X*2)/2:fe===v&&(he=this.getHeight()-te*le-X*2),Z.translate(X,he+X),Ne=0;Ne<te;Ne++){var $e=0,Ae=0,Be=ie[Ne],Ke=Be.text,We=Be.width,et=Be.lastInParagraph,ut,Ot;if(Z.save(),Ee===j?$e+=Se-We-X*2:Ee===p&&($e+=(Se-We-X*2)/2),Le){Z.save(),Z.beginPath();const qe=o.Konva._fixTextRendering?Math.round(K/4):Math.round(K/2),ee=$e,ye=ze+Ae+qe;Z.moveTo(ee,ye),ut=Ke.split(" ").length-1,Ot=Ee===_&&!et?Se-X*2:We,Z.lineTo(ee+Math.round(Ot),ye),Z.lineWidth=K/15,Z.strokeStyle=this._getLinearGradient()||Xe,Z.stroke(),Z.restore()}if(je){Z.save(),Z.beginPath();const qe=o.Konva._fixTextRendering?-Math.round(K/4):0;Z.moveTo($e,ze+Ae+qe),ut=Ke.split(" ").length-1,Ot=Ee===_&&!et?Se-X*2:We,Z.lineTo($e+Math.round(Ot),ze+Ae+qe),Z.lineWidth=K/15,Z.strokeStyle=this._getLinearGradient()||Xe,Z.stroke(),Z.restore()}if(ue!==M&&(Ie!==0||Ee===_)){ut=Ke.split(" ").length-1;const qe=c(Ke);for(let ee=0;ee<qe.length;ee++){const ye=qe[ee];ye===" "&&!et&&Ee===_&&($e+=(Se-X*2-We)/ut),this._partialTextX=$e,this._partialTextY=ze+Ae,this._partialText=ye,Z.fillStrokeShape(this),$e+=this.measureSize(ye).width+Ie}}else Ie!==0&&Z.setAttr("letterSpacing",`${Ie}px`),this._partialTextX=$e,this._partialTextY=ze+Ae,this._partialText=Ke,Z.fillStrokeShape(this);Z.restore(),te>1&&(ze+=le)}}_hitFunc(Z){const ie=this.getWidth(),te=this.getHeight();Z.beginPath(),Z.rect(0,0,ie,te),Z.closePath(),Z.fillStrokeShape(this)}setText(Z){const ie=e.Util._isString(Z)?Z:Z==null?"":Z+"";return this._setAttr(x,ie),this}getWidth(){return this.attrs.width===f||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===f||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(Z){var ie,te,X,K,le,fe,ue,he,Ee,Se,Ie;let Xe=V(),Ge=this.fontSize(),Le;Xe.save(),Xe.font=this._getContextFont(),Le=Xe.measureText(Z),Xe.restore();const je=Ge/100;return{actualBoundingBoxAscent:(ie=Le.actualBoundingBoxAscent)!==null&&ie!==void 0?ie:71.58203125*je,actualBoundingBoxDescent:(te=Le.actualBoundingBoxDescent)!==null&&te!==void 0?te:0,actualBoundingBoxLeft:(X=Le.actualBoundingBoxLeft)!==null&&X!==void 0?X:-7.421875*je,actualBoundingBoxRight:(K=Le.actualBoundingBoxRight)!==null&&K!==void 0?K:75.732421875*je,alphabeticBaseline:(le=Le.alphabeticBaseline)!==null&&le!==void 0?le:0,emHeightAscent:(fe=Le.emHeightAscent)!==null&&fe!==void 0?fe:100*je,emHeightDescent:(ue=Le.emHeightDescent)!==null&&ue!==void 0?ue:-20*je,fontBoundingBoxAscent:(he=Le.fontBoundingBoxAscent)!==null&&he!==void 0?he:91*je,fontBoundingBoxDescent:(Ee=Le.fontBoundingBoxDescent)!==null&&Ee!==void 0?Ee:21*je,hangingBaseline:(Se=Le.hangingBaseline)!==null&&Se!==void 0?Se:72.80000305175781*je,ideographicBaseline:(Ie=Le.ideographicBaseline)!==null&&Ie!==void 0?Ie:-21*je,width:Le.width,height:Ge}}_getContextFont(){return this.fontStyle()+L+this.fontVariant()+L+(this.fontSize()+R)+N(this.fontFamily())}_addTextLine(Z){this.align()===_&&(Z=Z.trim());const ie=this._getTextWidth(Z);return this.textArr.push({text:Z,width:ie,lastInParagraph:!1})}_getTextWidth(Z){const ie=this.letterSpacing(),te=Z.length;return V().measureText(Z).width+ie*te}_setTextData(){let Z=this.text().split(`
|
|
4
4
|
`),ie=+this.fontSize(),te=0,X=this.lineHeight()*ie,K=this.attrs.width,le=this.attrs.height,fe=K!==f&&K!==void 0,ue=le!==f&&le!==void 0,he=this.padding(),Ee=K-he*2,Se=le-he*2,Ie=0,Xe=this.wrap(),Ge=Xe!==k&&Xe!==F,Le=this.ellipsis();this.textArr=[],V().font=this._getContextFont();const je=Le?this._getTextWidth(G):0;for(let Ne=0,ze=Z.length;Ne<ze;++Ne){let He=Z[Ne],$e=this._getTextWidth(He);if(fe&&$e>Ee)for(;He.length>0;){let Ae=0,Be=c(He).length,Ke="",We=0;for(;Ae<Be;){const et=Ae+Be>>>1,ut=c(He).slice(0,et+1).join(""),Ot=this._getTextWidth(ut)+je;Ot<=Ee?(Ae=et+1,Ke=ut,We=Ot):Be=et}if(Ke){if(Ge){const et=c(He),ut=c(Ke),Ot=et[ut.length],Gt=Ot===L||Ot===b;let Kt;if(Gt&&We<=Ee)Kt=ut.length;else{const qe=ut.lastIndexOf(L),ee=ut.lastIndexOf(b);Kt=Math.max(qe,ee)+1}Kt>0&&(Ae=Kt,Ke=et.slice(0,Ae).join(""),We=this._getTextWidth(Ke))}if(Ke=Ke.trimRight(),this._addTextLine(Ke),te=Math.max(te,We),Ie+=X,this._shouldHandleEllipsis(Ie)){this._tryToAddEllipsisToLastLine();break}if(He=c(He).slice(Ae).join("").trimLeft(),He.length>0&&($e=this._getTextWidth(He),$e<=Ee)){this._addTextLine(He),Ie+=X,te=Math.max(te,$e);break}}else break}else this._addTextLine(He),Ie+=X,te=Math.max(te,$e),this._shouldHandleEllipsis(Ie)&&Ne<ze-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),ue&&Ie+X>Se)break}this.textHeight=ie,this.textWidth=te}_shouldHandleEllipsis(Z){const ie=+this.fontSize(),te=this.lineHeight()*ie,X=this.attrs.height,K=X!==f&&X!==void 0,le=X-this.padding()*2;return this.wrap()===F||K&&Z+te>le}_tryToAddEllipsisToLastLine(){const Z=this.attrs.width,ie=Z!==f&&Z!==void 0,te=Z-this.padding()*2,X=this.ellipsis(),K=this.textArr[this.textArr.length-1];!K||!X||(ie&&(this._getTextWidth(K.text+G)<te||(K.text=K.text.slice(0,K.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(K.text+G))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const Z=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,ie=this.hasShadow();return Z&&ie?!0:super._useBufferCanvas()}};t.Text=ae,ae.prototype._fillFunc=W,ae.prototype._strokeFunc=U,ae.prototype.className=P,ae.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],(0,s._registerNode)(ae),n.Factory.overWriteSetter(ae,"width",(0,l.getNumberOrAutoValidator)()),n.Factory.overWriteSetter(ae,"height",(0,l.getNumberOrAutoValidator)()),n.Factory.addGetterSetter(ae,"direction",m),n.Factory.addGetterSetter(ae,"fontFamily","Arial"),n.Factory.addGetterSetter(ae,"fontSize",12,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(ae,"fontStyle",T),n.Factory.addGetterSetter(ae,"fontVariant",T),n.Factory.addGetterSetter(ae,"padding",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(ae,"align",g),n.Factory.addGetterSetter(ae,"verticalAlign",C),n.Factory.addGetterSetter(ae,"lineHeight",1,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(ae,"wrap",z),n.Factory.addGetterSetter(ae,"ellipsis",!1,(0,l.getBooleanValidator)()),n.Factory.addGetterSetter(ae,"letterSpacing",0,(0,l.getNumberValidator)()),n.Factory.addGetterSetter(ae,"text","",(0,l.getStringValidator)()),n.Factory.addGetterSetter(ae,"textDecoration","")})),j7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextPath=void 0;var e=Wt(),n=ft(),r=yn(),o=lf(),l=Dp(),s=pt(),c=dt(),f="",p="normal";function m(y){y.fillText(this.partialText,0,0)}function _(y){y.strokeText(this.partialText,0,0)}var S=class extends r.Shape{constructor(y){super(y),this.dummyCanvas=e.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return o.Path.getPathLength(this.dataArray)}_getPointAtLength(y){if(!this.attrs.data)return null;const b=this.pathLength;return y-1>b?null:o.Path.getPointAtLengthOfDataArray(y,this.dataArray)}_readDataAttribute(){this.dataArray=o.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(y){y.setAttr("font",this._getContextFont()),y.setAttr("textBaseline",this.textBaseline()),y.setAttr("textAlign","left"),y.save();const b=this.textDecoration(),g=this.fill(),x=this.fontSize(),P=this.glyphInfo;b==="underline"&&y.beginPath();for(let C=0;C<P.length;C++){y.save();const v=P[C].p0;y.translate(v.x,v.y),y.rotate(P[C].rotation),this.partialText=P[C].text,y.fillStrokeShape(this),b==="underline"&&(C===0&&y.moveTo(0,x/2+1),y.lineTo(x,x/2+1)),y.restore()}b==="underline"&&(y.strokeStyle=g,y.lineWidth=x/20,y.stroke()),y.restore()}_hitFunc(y){y.beginPath();const b=this.glyphInfo;if(b.length>=1){const g=b[0].p0;y.moveTo(g.x,g.y)}for(let g=0;g<b.length;g++){const x=b[g].p1;y.lineTo(x.x,x.y)}y.setAttr("lineWidth",this.fontSize()),y.setAttr("strokeStyle",this.colorKey),y.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return e.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(y){return l.Text.prototype.setText.call(this,y)}_getContextFont(){return l.Text.prototype._getContextFont.call(this)}_getTextSize(y){const b=this.dummyCanvas.getContext("2d");b.save(),b.font=this._getContextFont();const g=b.measureText(y);return b.restore(),{width:g.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:y,height:b}=this._getTextSize(this.attrs.text);if(this.textWidth=y,this.textHeight=b,this.glyphInfo=[],!this.attrs.data)return null;const g=this.letterSpacing(),x=this.align(),P=this.kerningFunc(),C=Math.max(this.textWidth+((this.attrs.text||"").length-1)*g,0);let v=0;x==="center"&&(v=Math.max(0,this.pathLength/2-C/2)),x==="right"&&(v=Math.max(0,this.pathLength-C));const O=(0,l.stringToArray)(this.text());let T=v;for(let R=0;R<O.length;R++){const L=this._getPointAtLength(T);if(!L)return;let j=this._getTextSize(O[R]).width+g;if(O[R]===" "&&x==="justify"){const w=this.text().split(" ").length-1;j+=(this.pathLength-C)/w}const M=this._getPointAtLength(T+j);if(!M)return;const z=o.Path.getLineLength(L.x,L.y,M.x,M.y);let k=0;if(P)try{k=P(O[R-1],O[R])*this.fontSize()}catch{k=0}L.x+=k,M.x+=k,this.textWidth+=k;const F=o.Path.getPointOnLine(k+z/2,L.x,L.y,M.x,M.y),G=Math.atan2(M.y-L.y,M.x-L.x);this.glyphInfo.push({transposeX:F.x,transposeY:F.y,text:O[R],rotation:G,p0:L,p1:M}),T+=j}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const y=[];this.glyphInfo.forEach(function(T){y.push(T.p0.x),y.push(T.p0.y),y.push(T.p1.x),y.push(T.p1.y)});let b=y[0]||0,g=y[0]||0,x=y[1]||0,P=y[1]||0,C,v;for(let T=0;T<y.length/2;T++)C=y[T*2],v=y[T*2+1],b=Math.min(b,C),g=Math.max(g,C),x=Math.min(x,v),P=Math.max(P,v);const O=this.fontSize();return{x:b-O/2,y:x-O/2,width:g-b+O,height:P-x+O}}destroy(){return e.Util.releaseCanvas(this.dummyCanvas),super.destroy()}};t.TextPath=S,S.prototype._fillFunc=m,S.prototype._strokeFunc=_,S.prototype._fillFuncHit=m,S.prototype._strokeFuncHit=_,S.prototype.className="TextPath",S.prototype._attrsAffectingSize=["text","fontSize","data"],(0,c._registerNode)(S),n.Factory.addGetterSetter(S,"data"),n.Factory.addGetterSetter(S,"fontFamily","Arial"),n.Factory.addGetterSetter(S,"fontSize",12,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(S,"fontStyle",p),n.Factory.addGetterSetter(S,"align","left"),n.Factory.addGetterSetter(S,"letterSpacing",0,(0,s.getNumberValidator)()),n.Factory.addGetterSetter(S,"textBaseline","middle"),n.Factory.addGetterSetter(S,"fontVariant",p),n.Factory.addGetterSetter(S,"text",f),n.Factory.addGetterSetter(S,"textDecoration",""),n.Factory.addGetterSetter(S,"kerningFunc",void 0)})),D7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Transformer=void 0;var e=Wt(),n=ft(),r=an(),o=yn(),l=jp(),s=rf(),c=dt(),f=pt(),p=dt(),m="tr-konva",_=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(M=>M+`.${m}`).join(" "),S="nodesRect",y=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],b={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},g="ontouchstart"in c.Konva._global;function x(M,z,k){if(M==="rotater")return k;z+=e.Util.degToRad(b[M]||0);const F=(e.Util.radToDeg(z)%360+360)%360;return e.Util._inRange(F,337.5,360)||e.Util._inRange(F,0,22.5)?"ns-resize":e.Util._inRange(F,22.5,67.5)?"nesw-resize":e.Util._inRange(F,67.5,112.5)?"ew-resize":e.Util._inRange(F,112.5,157.5)?"nwse-resize":e.Util._inRange(F,157.5,202.5)?"ns-resize":e.Util._inRange(F,202.5,247.5)?"nesw-resize":e.Util._inRange(F,247.5,292.5)?"ew-resize":e.Util._inRange(F,292.5,337.5)?"nwse-resize":(e.Util.error("Transformer has unknown angle for cursor detection: "+F),"pointer")}var P=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function C(M){return{x:M.x+M.width/2*Math.cos(M.rotation)+M.height/2*Math.sin(-M.rotation),y:M.y+M.height/2*Math.cos(M.rotation)+M.width/2*Math.sin(M.rotation)}}function v(M,z,k){const F=k.x+(M.x-k.x)*Math.cos(z)-(M.y-k.y)*Math.sin(z),G=k.y+(M.x-k.x)*Math.sin(z)+(M.y-k.y)*Math.cos(z);return{...M,rotation:M.rotation+z,x:F,y:G}}function O(M,z){return v(M,z,C(M))}function T(M,z,k){let F=z;for(let G=0;G<M.length;G++){const w=c.Konva.getAngle(M[G]),D=Math.abs(w-z)%(Math.PI*2);Math.min(D,Math.PI*2-D)<k&&(F=w)}return F}var R=0,L=class extends s.Group{constructor(M){super(M),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(_,this.update),this.getNode()&&this.update()}attachTo(M){return this.setNode(M),this}setNode(M){return e.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([M])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return m+this._id}setNodes(M=[]){this._nodes&&this._nodes.length&&this.detach();const z=M.filter(k=>k.isAncestorOf(this)?(e.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=M=z,M.length===1&&this.useSingleNodeRotation()?this.rotation(M[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(k=>{const F=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},G=k._attrsAffectingSize.map(w=>w+"Change."+this._getEventNamespace()).join(" ");k.on(G,F),k.on(y.map(w=>w+`.${this._getEventNamespace()}`).join(" "),F),k.on(`absoluteTransformChange.${this._getEventNamespace()}`,F),this._proxyDrag(k)}),this._resetTransformCache(),this.findOne(".top-left")&&this.update(),this}_proxyDrag(M){let z;M.on(`dragstart.${this._getEventNamespace()}`,k=>{z=M.getAbsolutePosition(),!this.isDragging()&&M!==this.findOne(".back")&&this.startDrag(k,!1)}),M.on(`dragmove.${this._getEventNamespace()}`,k=>{if(!z)return;const F=M.getAbsolutePosition(),G=F.x-z.x,w=F.y-z.y;this.nodes().forEach(D=>{if(D===M||D.isDragging())return;const N=D.getAbsolutePosition();D.setAbsolutePosition({x:N.x+G,y:N.y+w}),D.startDrag(k)}),z=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(M=>{M.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(S),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(S,this.__getNodeRect)}__getNodeShape(M,z=this.rotation(),k){const F=M.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),G=M.getAbsoluteScale(k),w=M.getAbsolutePosition(k),D=F.x*G.x-M.offsetX()*G.x,N=F.y*G.y-M.offsetY()*G.y,H=(c.Konva.getAngle(M.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2);return v({x:w.x+D*Math.cos(H)+N*Math.sin(-H),y:w.y+N*Math.cos(H)+D*Math.sin(H),width:F.width*G.x,height:F.height*G.y,rotation:H},-c.Konva.getAngle(z),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const M=[];this.nodes().map(N=>{const H=N.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),V=[{x:H.x,y:H.y},{x:H.x+H.width,y:H.y},{x:H.x+H.width,y:H.y+H.height},{x:H.x,y:H.y+H.height}],W=N.getAbsoluteTransform();V.forEach(function(U){const Q=W.point(U);M.push(Q)})});const z=new e.Transform;z.rotate(-c.Konva.getAngle(this.rotation()));let k=1/0,F=1/0,G=-1/0,w=-1/0;M.forEach(function(N){const H=z.point(N);k===void 0&&(k=G=H.x,F=w=H.y),k=Math.min(k,H.x),F=Math.min(F,H.y),G=Math.max(G,H.x),w=Math.max(w,H.y)}),z.invert();const D=z.point({x:k,y:F});return{x:D.x,y:D.y,width:G-k,height:w-F,rotation:c.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),P.forEach(M=>{this._createAnchor(M)}),this._createAnchor("rotater")}_createAnchor(M){const z=new l.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:M+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:g?10:"auto"}),k=this;z.on("mousedown touchstart",function(F){k._handleMouseDown(F)}),z.on("dragstart",F=>{z.stopDrag(),F.cancelBubble=!0}),z.on("dragend",F=>{F.cancelBubble=!0}),z.on("mouseenter",()=>{const F=x(M,c.Konva.getAngle(this.rotation()),this.rotateAnchorCursor());z.getStage().content&&(z.getStage().content.style.cursor=F),this._cursorChange=!0}),z.on("mouseout",()=>{z.getStage().content&&(z.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(z)}_createBack(){const M=new o.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(z,k){const F=k.getParent(),G=F.padding();z.beginPath(),z.rect(-G,-G,k.width()+G*2,k.height()+G*2),z.moveTo(k.width()/2,-G),F.rotateEnabled()&&F.rotateLineVisible()&&z.lineTo(k.width()/2,-F.rotateAnchorOffset()*e.Util._sign(k.height())-G),z.fillStrokeShape(k)},hitFunc:(z,k)=>{if(!this.shouldOverdrawWholeArea())return;const F=this.padding();z.beginPath(),z.rect(-F,-F,k.width()+F*2,k.height()+F*2),z.fillStrokeShape(k)}});this.add(M),this._proxyDrag(M),M.on("dragstart",z=>{z.cancelBubble=!0}),M.on("dragmove",z=>{z.cancelBubble=!0}),M.on("dragend",z=>{z.cancelBubble=!0}),this.on("dragmove",z=>{this.update()})}_handleMouseDown(M){if(this._transforming)return;this._movingAnchorName=M.target.name().split(" ")[0];const z=this._getNodeRect(),k=z.width,F=z.height,G=Math.sqrt(Math.pow(k,2)+Math.pow(F,2));this.sin=Math.abs(F/G),this.cos=Math.abs(k/G),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const w=M.target.getAbsolutePosition(),D=M.target.getStage().getPointerPosition();this._anchorDragOffset={x:D.x-w.x,y:D.y-w.y},R++,this._fire("transformstart",{evt:M.evt,target:this.getNode()}),this._nodes.forEach(N=>{N._fire("transformstart",{evt:M.evt,target:N})})}_handleMouseMove(M){let z,k,F;const G=this.findOne("."+this._movingAnchorName),w=G.getStage();w.setPointersPositions(M);const D=w.getPointerPosition();let N={x:D.x-this._anchorDragOffset.x,y:D.y-this._anchorDragOffset.y};const H=G.getAbsolutePosition();this.anchorDragBoundFunc()&&(N=this.anchorDragBoundFunc()(H,N,M)),G.setAbsolutePosition(N);const V=G.getAbsolutePosition();if(H.x===V.x&&H.y===V.y)return;if(this._movingAnchorName==="rotater"){const fe=this._getNodeRect();z=G.x()-fe.width/2,k=-G.y()+fe.height/2;let ue=Math.atan2(-k,z)+Math.PI/2;fe.height<0&&(ue-=Math.PI);const he=c.Konva.getAngle(this.rotation())+ue,Ee=c.Konva.getAngle(this.rotationSnapTolerance()),Se=O(fe,T(this.rotationSnaps(),he,Ee)-fe.rotation);this._fitNodesInto(Se,M);return}const W=this.shiftBehavior();let U;W==="inverted"?U=this.keepRatio()&&!M.shiftKey:W==="none"?U=this.keepRatio():U=this.keepRatio()||M.shiftKey;var te=this.centeredScaling()||M.altKey;if(this._movingAnchorName==="top-left"){if(U){var Q=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};F=Math.sqrt(Math.pow(Q.x-G.x(),2)+Math.pow(Q.y-G.y(),2));var ae=this.findOne(".top-left").x()>Q.x?-1:1,Z=this.findOne(".top-left").y()>Q.y?-1:1;z=F*this.cos*ae,k=F*this.sin*Z,this.findOne(".top-left").x(Q.x-z),this.findOne(".top-left").y(Q.y-k)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(G.y());else if(this._movingAnchorName==="top-right"){if(U){var Q=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};F=Math.sqrt(Math.pow(G.x()-Q.x,2)+Math.pow(Q.y-G.y(),2));var ae=this.findOne(".top-right").x()<Q.x?-1:1,Z=this.findOne(".top-right").y()>Q.y?-1:1;z=F*this.cos*ae,k=F*this.sin*Z,this.findOne(".top-right").x(Q.x+z),this.findOne(".top-right").y(Q.y-k)}var ie=G.position();this.findOne(".top-left").y(ie.y),this.findOne(".bottom-right").x(ie.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(G.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(G.x());else if(this._movingAnchorName==="bottom-left"){if(U){var Q=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};F=Math.sqrt(Math.pow(Q.x-G.x(),2)+Math.pow(G.y()-Q.y,2));var ae=Q.x<G.x()?-1:1,Z=G.y()<Q.y?-1:1;z=F*this.cos*ae,k=F*this.sin*Z,G.x(Q.x-z),G.y(Q.y+k)}ie=G.position(),this.findOne(".top-left").x(ie.x),this.findOne(".bottom-right").y(ie.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(G.y());else if(this._movingAnchorName==="bottom-right"&&U){var Q=te?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};F=Math.sqrt(Math.pow(G.x()-Q.x,2)+Math.pow(G.y()-Q.y,2));var ae=this.findOne(".bottom-right").x()<Q.x?-1:1,Z=this.findOne(".bottom-right").y()<Q.y?-1:1;z=F*this.cos*ae,k=F*this.sin*Z,this.findOne(".bottom-right").x(Q.x+z),this.findOne(".bottom-right").y(Q.y+k)}var te=this.centeredScaling()||M.altKey;if(te){const fe=this.findOne(".top-left"),ue=this.findOne(".bottom-right"),he=fe.x(),Ee=fe.y(),Se=this.getWidth()-ue.x(),Ie=this.getHeight()-ue.y();ue.move({x:-he,y:-Ee}),fe.move({x:Se,y:Ie})}const X=this.findOne(".top-left").getAbsolutePosition();z=X.x,k=X.y;const K=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),le=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:z,y:k,width:K,height:le,rotation:c.Konva.getAngle(this.rotation())},M)}_handleMouseUp(M){this._removeEvents(M)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(M){var z;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const k=this.getNode();R--,this._fire("transformend",{evt:M,target:k}),(z=this.getLayer())===null||z===void 0||z.batchDraw(),k&&this._nodes.forEach(F=>{var G;F._fire("transformend",{evt:M,target:F}),(G=F.getLayer())===null||G===void 0||G.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(M,z){const k=this._getNodeRect(),F=1;if(e.Util._inRange(M.width,-this.padding()*2-F,F)){this.update();return}if(e.Util._inRange(M.height,-this.padding()*2-F,F)){this.update();return}const G=new e.Transform;if(G.rotate(c.Konva.getAngle(this.rotation())),this._movingAnchorName&&M.width<0&&this._movingAnchorName.indexOf("left")>=0){const U=G.point({x:-this.padding()*2,y:0});M.x+=U.x,M.y+=U.y,M.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=U.x,this._anchorDragOffset.y-=U.y}else if(this._movingAnchorName&&M.width<0&&this._movingAnchorName.indexOf("right")>=0){const U=G.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=U.x,this._anchorDragOffset.y-=U.y,M.width+=this.padding()*2}if(this._movingAnchorName&&M.height<0&&this._movingAnchorName.indexOf("top")>=0){const U=G.point({x:0,y:-this.padding()*2});M.x+=U.x,M.y+=U.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=U.x,this._anchorDragOffset.y-=U.y,M.height+=this.padding()*2}else if(this._movingAnchorName&&M.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const U=G.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=U.x,this._anchorDragOffset.y-=U.y,M.height+=this.padding()*2}if(this.boundBoxFunc()){const U=this.boundBoxFunc()(k,M);U?M=U:e.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const w=1e7,D=new e.Transform;D.translate(k.x,k.y),D.rotate(k.rotation),D.scale(k.width/w,k.height/w);const N=new e.Transform,H=M.width/w,V=M.height/w;this.flipEnabled()===!1?(N.translate(M.x,M.y),N.rotate(M.rotation),N.translate(M.width<0?M.width:0,M.height<0?M.height:0),N.scale(Math.abs(H),Math.abs(V))):(N.translate(M.x,M.y),N.rotate(M.rotation),N.scale(H,V));const W=N.multiply(D.invert());this._nodes.forEach(U=>{var Q;const ae=U.getParent().getAbsoluteTransform(),Z=U.getTransform().copy();Z.translate(U.offsetX(),U.offsetY());const ie=new e.Transform;ie.multiply(ae.copy().invert()).multiply(W).multiply(ae).multiply(Z);const te=ie.decompose();U.setAttrs(te),(Q=U.getLayer())===null||Q===void 0||Q.batchDraw()}),this.rotation(e.Util._getRotation(M.rotation)),this._nodes.forEach(U=>{this._fire("transform",{evt:z,target:U}),U._fire("transform",{evt:z,target:U})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(M,z){this.findOne(M).setAttrs(z)}update(){var M;const z=this._getNodeRect();this.rotation(e.Util._getRotation(z.rotation));const k=z.width,F=z.height,G=this.enabledAnchors(),w=this.resizeEnabled(),D=this.padding(),N=this.anchorSize(),H=this.find("._anchor");H.forEach(W=>{W.setAttrs({width:N,height:N,offsetX:N/2,offsetY:N/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:N/2+D,offsetY:N/2+D,visible:w&&G.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:k/2,y:0,offsetY:N/2+D,visible:w&&G.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:k,y:0,offsetX:N/2-D,offsetY:N/2+D,visible:w&&G.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:F/2,offsetX:N/2+D,visible:w&&G.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:k,y:F/2,offsetX:N/2-D,visible:w&&G.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:F,offsetX:N/2+D,offsetY:N/2-D,visible:w&&G.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:k/2,y:F,offsetY:N/2-D,visible:w&&G.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:k,y:F,offsetX:N/2-D,offsetY:N/2-D,visible:w&&G.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:k/2,y:-this.rotateAnchorOffset()*e.Util._sign(F)-D,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:k,height:F,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const V=this.anchorStyleFunc();V&&H.forEach(W=>{V(W)}),(M=this.getLayer())===null||M===void 0||M.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const M=this.findOne("."+this._movingAnchorName);M&&M.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),s.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return r.Node.prototype.toObject.call(this)}clone(M){return r.Node.prototype.clone.call(this,M)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};t.Transformer=L,L.isTransforming=()=>R>0;function j(M){return M instanceof Array||e.Util.warn("enabledAnchors value should be an array"),M instanceof Array&&M.forEach(function(z){P.indexOf(z)===-1&&e.Util.warn("Unknown anchor name: "+z+". Available names are: "+P.join(", "))}),M||[]}L.prototype.className="Transformer",(0,p._registerNode)(L),n.Factory.addGetterSetter(L,"enabledAnchors",P,j),n.Factory.addGetterSetter(L,"flipEnabled",!0,(0,f.getBooleanValidator)()),n.Factory.addGetterSetter(L,"resizeEnabled",!0),n.Factory.addGetterSetter(L,"anchorSize",10,(0,f.getNumberValidator)()),n.Factory.addGetterSetter(L,"rotateEnabled",!0),n.Factory.addGetterSetter(L,"rotateLineVisible",!0),n.Factory.addGetterSetter(L,"rotationSnaps",[]),n.Factory.addGetterSetter(L,"rotateAnchorOffset",50,(0,f.getNumberValidator)()),n.Factory.addGetterSetter(L,"rotateAnchorCursor","crosshair"),n.Factory.addGetterSetter(L,"rotationSnapTolerance",5,(0,f.getNumberValidator)()),n.Factory.addGetterSetter(L,"borderEnabled",!0),n.Factory.addGetterSetter(L,"anchorStroke","rgb(0, 161, 255)"),n.Factory.addGetterSetter(L,"anchorStrokeWidth",1,(0,f.getNumberValidator)()),n.Factory.addGetterSetter(L,"anchorFill","white"),n.Factory.addGetterSetter(L,"anchorCornerRadius",0,(0,f.getNumberValidator)()),n.Factory.addGetterSetter(L,"borderStroke","rgb(0, 161, 255)"),n.Factory.addGetterSetter(L,"borderStrokeWidth",1,(0,f.getNumberValidator)()),n.Factory.addGetterSetter(L,"borderDash"),n.Factory.addGetterSetter(L,"keepRatio",!0),n.Factory.addGetterSetter(L,"shiftBehavior","default"),n.Factory.addGetterSetter(L,"centeredScaling",!1),n.Factory.addGetterSetter(L,"ignoreStroke",!1),n.Factory.addGetterSetter(L,"padding",0,(0,f.getNumberValidator)()),n.Factory.addGetterSetter(L,"nodes"),n.Factory.addGetterSetter(L,"node"),n.Factory.addGetterSetter(L,"boundBoxFunc"),n.Factory.addGetterSetter(L,"anchorDragBoundFunc"),n.Factory.addGetterSetter(L,"anchorStyleFunc"),n.Factory.addGetterSetter(L,"shouldOverdrawWholeArea",!1),n.Factory.addGetterSetter(L,"useSingleNodeRotation",!0),n.Factory.backCompat(L,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"})})),z7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Wedge=void 0;var e=ft(),n=yn(),r=dt(),o=pt(),l=dt(),s=class extends n.Shape{_sceneFunc(c){c.beginPath(),c.arc(0,0,this.radius(),0,r.Konva.getAngle(this.angle()),this.clockwise()),c.lineTo(0,0),c.closePath(),c.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(c){this.radius(c/2)}setHeight(c){this.radius(c/2)}};t.Wedge=s,s.prototype.className="Wedge",s.prototype._centroid=!0,s.prototype._attrsAffectingSize=["radius"],(0,l._registerNode)(s),e.Factory.addGetterSetter(s,"radius",0,(0,o.getNumberValidator)()),e.Factory.addGetterSetter(s,"angle",0,(0,o.getNumberValidator)()),e.Factory.addGetterSetter(s,"clockwise",!1),e.Factory.backCompat(s,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"})})),B7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Blur=void 0;var e=ft(),n=an(),r=pt();function o(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var l=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],s=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function c(p,m){const _=p.data,S=p.width,y=p.height;let b,g,x,P,C,v,O,T,R,L,j,M,z,k,F,G,w,D,N,H,V,W,U,Q;const ae=m+m+1,Z=S-1,ie=y-1,te=m+1,X=te*(te+1)/2,K=new o,le=l[m],fe=s[m];let ue=null,he=K,Ee=null,Se=null;for(x=1;x<ae;x++)he=he.next=new o,x===te&&(ue=he);for(he.next=K,O=v=0,g=0;g<y;g++){for(G=w=D=N=T=R=L=j=0,M=te*(H=_[v]),z=te*(V=_[v+1]),k=te*(W=_[v+2]),F=te*(U=_[v+3]),T+=X*H,R+=X*V,L+=X*W,j+=X*U,he=K,x=0;x<te;x++)he.r=H,he.g=V,he.b=W,he.a=U,he=he.next;for(x=1;x<te;x++)P=v+((Z<x?Z:x)<<2),T+=(he.r=H=_[P])*(Q=te-x),R+=(he.g=V=_[P+1])*Q,L+=(he.b=W=_[P+2])*Q,j+=(he.a=U=_[P+3])*Q,G+=H,w+=V,D+=W,N+=U,he=he.next;for(Ee=K,Se=ue,b=0;b<S;b++)_[v+3]=U=j*le>>fe,U!==0?(U=255/U,_[v]=(T*le>>fe)*U,_[v+1]=(R*le>>fe)*U,_[v+2]=(L*le>>fe)*U):_[v]=_[v+1]=_[v+2]=0,T-=M,R-=z,L-=k,j-=F,M-=Ee.r,z-=Ee.g,k-=Ee.b,F-=Ee.a,P=O+((P=b+m+1)<Z?P:Z)<<2,G+=Ee.r=_[P],w+=Ee.g=_[P+1],D+=Ee.b=_[P+2],N+=Ee.a=_[P+3],T+=G,R+=w,L+=D,j+=N,Ee=Ee.next,M+=H=Se.r,z+=V=Se.g,k+=W=Se.b,F+=U=Se.a,G-=H,w-=V,D-=W,N-=U,Se=Se.next,v+=4;O+=S}for(b=0;b<S;b++){for(w=D=N=G=R=L=j=T=0,v=b<<2,M=te*(H=_[v]),z=te*(V=_[v+1]),k=te*(W=_[v+2]),F=te*(U=_[v+3]),T+=X*H,R+=X*V,L+=X*W,j+=X*U,he=K,x=0;x<te;x++)he.r=H,he.g=V,he.b=W,he.a=U,he=he.next;for(C=S,x=1;x<=m;x++)v=C+b<<2,T+=(he.r=H=_[v])*(Q=te-x),R+=(he.g=V=_[v+1])*Q,L+=(he.b=W=_[v+2])*Q,j+=(he.a=U=_[v+3])*Q,G+=H,w+=V,D+=W,N+=U,he=he.next,x<ie&&(C+=S);for(v=b,Ee=K,Se=ue,g=0;g<y;g++)P=v<<2,_[P+3]=U=j*le>>fe,U>0?(U=255/U,_[P]=(T*le>>fe)*U,_[P+1]=(R*le>>fe)*U,_[P+2]=(L*le>>fe)*U):_[P]=_[P+1]=_[P+2]=0,T-=M,R-=z,L-=k,j-=F,M-=Ee.r,z-=Ee.g,k-=Ee.b,F-=Ee.a,P=b+((P=g+te)<ie?P:ie)*S<<2,T+=G+=Ee.r=_[P],R+=w+=Ee.g=_[P+1],L+=D+=Ee.b=_[P+2],j+=N+=Ee.a=_[P+3],Ee=Ee.next,M+=H=Se.r,z+=V=Se.g,k+=W=Se.b,F+=U=Se.a,G-=H,w-=V,D-=W,N-=U,Se=Se.next,v+=S}}var f=function(m){const _=Math.round(this.blurRadius());_>0&&c(m,_)};t.Blur=f,e.Factory.addGetterSetter(n.Node,"blurRadius",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter)})),k7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Brighten=void 0;var e=ft(),n=an(),r=pt(),o=function(l){const s=this.brightness()*255,c=l.data,f=c.length;for(let p=0;p<f;p+=4)c[p]+=s,c[p+1]+=s,c[p+2]+=s};t.Brighten=o,e.Factory.addGetterSetter(n.Node,"brightness",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter)})),H7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Contrast=void 0;var e=ft(),n=an(),r=pt(),o=function(l){const s=Math.pow((this.contrast()+100)/100,2),c=l.data,f=c.length;let p=150,m=150,_=150;for(let S=0;S<f;S+=4)p=c[S],m=c[S+1],_=c[S+2],p/=255,p-=.5,p*=s,p+=.5,p*=255,m/=255,m-=.5,m*=s,m+=.5,m*=255,_/=255,_-=.5,_*=s,_+=.5,_*=255,p=p<0?0:p>255?255:p,m=m<0?0:m>255?255:m,_=_<0?0:_>255?255:_,c[S]=p,c[S+1]=m,c[S+2]=_};t.Contrast=o,e.Factory.addGetterSetter(n.Node,"contrast",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter)})),F7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Emboss=void 0;var e=ft(),n=an(),r=Wt(),o=pt(),l=function(s){const c=this.embossStrength()*10,f=this.embossWhiteLevel()*255,p=this.embossDirection(),m=this.embossBlend(),_=s.data,S=s.width,y=s.height,b=S*4;let g=0,x=0,P=y;switch(p){case"top-left":g=-1,x=-1;break;case"top":g=-1,x=0;break;case"top-right":g=-1,x=1;break;case"right":g=0,x=1;break;case"bottom-right":g=1,x=1;break;case"bottom":g=1,x=0;break;case"bottom-left":g=1,x=-1;break;case"left":g=0,x=-1;break;default:r.Util.error("Unknown emboss direction: "+p)}do{const C=(P-1)*b;let v=g;P+v<1&&(v=0),P+v>y&&(v=0);const O=(P-1+v)*S*4;let T=S;do{const R=C+(T-1)*4;let L=x;T+L<1&&(L=0),T+L>S&&(L=0);const j=O+(T-1+L)*4,M=_[R]-_[j],z=_[R+1]-_[j+1],k=_[R+2]-_[j+2];let F=M;const G=F>0?F:-F,w=z>0?z:-z,D=k>0?k:-k;if(w>G&&(F=z),D>G&&(F=k),F*=c,m){const N=_[R]+F,H=_[R+1]+F,V=_[R+2]+F;_[R]=N>255?255:N<0?0:N,_[R+1]=H>255?255:H<0?0:H,_[R+2]=V>255?255:V<0?0:V}else{let N=f-F;N<0?N=0:N>255&&(N=255),_[R]=_[R+1]=_[R+2]=N}}while(--T)}while(--P)};t.Emboss=l,e.Factory.addGetterSetter(n.Node,"embossStrength",.5,(0,o.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossWhiteLevel",.5,(0,o.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossDirection","top-left",void 0,e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"embossBlend",!1,void 0,e.Factory.afterSetFilter)})),V7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Enhance=void 0;var e=ft(),n=an(),r=pt();function o(s,c,f,p,m){const _=f-c,S=m-p;if(_===0)return p+S/2;if(S===0)return p;let y=(s-c)/_;return y=S*y+p,y}var l=function(s){const c=s.data,f=c.length;let p=c[0],m=p,_,S=c[1],y=S,b,g=c[2],x=g,P;const C=this.enhance();if(C===0)return;for(let F=0;F<f;F+=4)_=c[F+0],_<p?p=_:_>m&&(m=_),b=c[F+1],b<S?S=b:b>y&&(y=b),P=c[F+2],P<g?g=P:P>x&&(x=P);m===p&&(m=255,p=0),y===S&&(y=255,S=0),x===g&&(x=255,g=0);let v,O,T,R,L,j,M,z,k;C>0?(O=m+C*(255-m),T=p-C*(p-0),L=y+C*(255-y),j=S-C*(S-0),z=x+C*(255-x),k=g-C*(g-0)):(v=(m+p)*.5,O=m+C*(m-v),T=p+C*(p-v),R=(y+S)*.5,L=y+C*(y-R),j=S+C*(S-R),M=(x+g)*.5,z=x+C*(x-M),k=g+C*(g-M));for(let F=0;F<f;F+=4)c[F+0]=o(c[F+0],p,m,T,O),c[F+1]=o(c[F+1],S,y,j,L),c[F+2]=o(c[F+2],g,x,k,z)};t.Enhance=l,e.Factory.addGetterSetter(n.Node,"enhance",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter)})),G7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Grayscale=void 0;var e=function(n){const r=n.data,o=r.length;for(let l=0;l<o;l+=4){const s=.34*r[l]+.5*r[l+1]+.16*r[l+2];r[l]=s,r[l+1]=s,r[l+2]=s}};t.Grayscale=e})),U7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HSL=void 0;var e=ft(),n=an(),r=pt();e.Factory.addGetterSetter(n.Node,"hue",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"saturation",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"luminance",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter);var o=function(l){const s=l.data,c=s.length,f=1,p=Math.pow(2,this.saturation()),m=Math.abs(this.hue()+360)%360,_=this.luminance()*127,S=f*p*Math.cos(m*Math.PI/180),y=f*p*Math.sin(m*Math.PI/180),b=.299*f+.701*S+.167*y,g=.587*f-.587*S+.33*y,x=.114*f-.114*S-.497*y,P=.299*f-.299*S-.328*y,C=.587*f+.413*S+.035*y,v=.114*f-.114*S+.293*y,O=.299*f-.3*S+1.25*y,T=.587*f-.586*S-1.05*y,R=.114*f+.886*S-.2*y;let L,j,M,z;for(let k=0;k<c;k+=4)L=s[k+0],j=s[k+1],M=s[k+2],z=s[k+3],s[k+0]=b*L+g*j+x*M+_,s[k+1]=P*L+C*j+v*M+_,s[k+2]=O*L+T*j+R*M+_,s[k+3]=z};t.HSL=o})),$7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.HSV=void 0;var e=ft(),n=an(),r=pt(),o=function(l){const s=l.data,c=s.length,f=Math.pow(2,this.value()),p=Math.pow(2,this.saturation()),m=Math.abs(this.hue()+360)%360,_=f*p*Math.cos(m*Math.PI/180),S=f*p*Math.sin(m*Math.PI/180),y=.299*f+.701*_+.167*S,b=.587*f-.587*_+.33*S,g=.114*f-.114*_-.497*S,x=.299*f-.299*_-.328*S,P=.587*f+.413*_+.035*S,C=.114*f-.114*_+.293*S,v=.299*f-.3*_+1.25*S,O=.587*f-.586*_-1.05*S,T=.114*f+.886*_-.2*S;let R,L,j,M;for(let z=0;z<c;z+=4)R=s[z+0],L=s[z+1],j=s[z+2],M=s[z+3],s[z+0]=y*R+b*L+g*j,s[z+1]=x*R+P*L+C*j,s[z+2]=v*R+O*L+T*j,s[z+3]=M};t.HSV=o,e.Factory.addGetterSetter(n.Node,"hue",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"saturation",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"value",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter)})),X7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Invert=void 0;var e=function(n){const r=n.data,o=r.length;for(let l=0;l<o;l+=4)r[l]=255-r[l],r[l+1]=255-r[l+1],r[l+2]=255-r[l+2]};t.Invert=e})),Z7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Kaleidoscope=void 0;var e=ft(),n=an(),r=Wt(),o=pt(),l=function(f,p,m){const _=f.data,S=p.data,y=f.width,b=f.height,g=m.polarCenterX||y/2,x=m.polarCenterY||b/2;let P=Math.sqrt(g*g+x*x),C=y-g,v=b-x;const O=Math.sqrt(C*C+v*v);P=O>P?O:P;const T=b,R=y,L=360/R*Math.PI/180;for(let j=0;j<R;j+=1){const M=Math.sin(j*L),z=Math.cos(j*L);for(let k=0;k<T;k+=1){C=Math.floor(g+P*k/T*z),v=Math.floor(x+P*k/T*M);let F=(v*y+C)*4;const G=_[F+0],w=_[F+1],D=_[F+2],N=_[F+3];F=(j+k*y)*4,S[F+0]=G,S[F+1]=w,S[F+2]=D,S[F+3]=N}}},s=function(f,p,m){const _=f.data,S=p.data,y=f.width,b=f.height,g=m.polarCenterX||y/2,x=m.polarCenterY||b/2;let P=Math.sqrt(g*g+x*x),C=y-g,v=b-x;const O=Math.sqrt(C*C+v*v);P=O>P?O:P;const T=b,R=y,L=m.polarRotation||0;let j,M;for(C=0;C<y;C+=1)for(v=0;v<b;v+=1){const z=C-g,k=v-x,F=Math.sqrt(z*z+k*k)*T/P;let G=(Math.atan2(k,z)*180/Math.PI+360+L)%360;G=G*R/360,j=Math.floor(G),M=Math.floor(F);let w=(M*y+j)*4;const D=_[w+0],N=_[w+1],H=_[w+2],V=_[w+3];w=(v*y+C)*4,S[w+0]=D,S[w+1]=N,S[w+2]=H,S[w+3]=V}},c=function(f){const p=f.width,m=f.height;let _,S,y,b,g,x,P,C,v,O,T=Math.round(this.kaleidoscopePower());const R=Math.round(this.kaleidoscopeAngle()),L=Math.floor(p*(R%360)/360);if(T<1)return;const j=r.Util.createCanvasElement();j.width=p,j.height=m;const M=j.getContext("2d").getImageData(0,0,p,m);r.Util.releaseCanvas(j),l(f,M,{polarCenterX:p/2,polarCenterY:m/2});let z=p/Math.pow(2,T);for(;z<=8;)z=z*2,T-=1;z=Math.ceil(z);let k=z,F=0,G=k,w=1;for(L+z>p&&(F=k,G=0,w=-1),S=0;S<m;S+=1)for(_=F;_!==G;_+=w)y=Math.round(_+L)%p,v=(p*S+y)*4,g=M.data[v+0],x=M.data[v+1],P=M.data[v+2],C=M.data[v+3],O=(p*S+_)*4,M.data[O+0]=g,M.data[O+1]=x,M.data[O+2]=P,M.data[O+3]=C;for(S=0;S<m;S+=1)for(k=Math.floor(z),b=0;b<T;b+=1){for(_=0;_<k+1;_+=1)v=(p*S+_)*4,g=M.data[v+0],x=M.data[v+1],P=M.data[v+2],C=M.data[v+3],O=(p*S+k*2-_-1)*4,M.data[O+0]=g,M.data[O+1]=x,M.data[O+2]=P,M.data[O+3]=C;k*=2}s(M,f,{polarRotation:0})};t.Kaleidoscope=c,e.Factory.addGetterSetter(n.Node,"kaleidoscopePower",2,(0,o.getNumberValidator)(),e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"kaleidoscopeAngle",0,(0,o.getNumberValidator)(),e.Factory.afterSetFilter)})),W7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Mask=void 0;var e=ft(),n=an(),r=pt();function o(y,b,g){let x=(g*y.width+b)*4;const P=[];return P.push(y.data[x++],y.data[x++],y.data[x++],y.data[x++]),P}function l(y,b){return Math.sqrt(Math.pow(y[0]-b[0],2)+Math.pow(y[1]-b[1],2)+Math.pow(y[2]-b[2],2))}function s(y){const b=[0,0,0];for(let g=0;g<y.length;g++)b[0]+=y[g][0],b[1]+=y[g][1],b[2]+=y[g][2];return b[0]/=y.length,b[1]/=y.length,b[2]/=y.length,b}function c(y,b){const g=o(y,0,0),x=o(y,y.width-1,0),P=o(y,0,y.height-1),C=o(y,y.width-1,y.height-1),v=b||10;if(l(g,x)<v&&l(x,C)<v&&l(C,P)<v&&l(P,g)<v){const O=s([x,g,C,P]),T=[];for(let R=0;R<y.width*y.height;R++){const L=l(O,[y.data[R*4],y.data[R*4+1],y.data[R*4+2]]);T[R]=L<v?0:255}return T}}function f(y,b){for(let g=0;g<y.width*y.height;g++)y.data[4*g+3]=b[g]}function p(y,b,g){const x=[1,1,1,1,0,1,1,1,1],P=Math.round(Math.sqrt(x.length)),C=Math.floor(P/2),v=[];for(let O=0;O<g;O++)for(let T=0;T<b;T++){const R=O*b+T;let L=0;for(let j=0;j<P;j++)for(let M=0;M<P;M++){const z=O+j-C,k=T+M-C;if(z>=0&&z<g&&k>=0&&k<b){const F=z*b+k,G=x[j*P+M];L+=y[F]*G}}v[R]=L===2040?255:0}return v}function m(y,b,g){const x=[1,1,1,1,1,1,1,1,1],P=Math.round(Math.sqrt(x.length)),C=Math.floor(P/2),v=[];for(let O=0;O<g;O++)for(let T=0;T<b;T++){const R=O*b+T;let L=0;for(let j=0;j<P;j++)for(let M=0;M<P;M++){const z=O+j-C,k=T+M-C;if(z>=0&&z<g&&k>=0&&k<b){const F=z*b+k,G=x[j*P+M];L+=y[F]*G}}v[R]=L>=1020?255:0}return v}function _(y,b,g){const x=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],P=Math.round(Math.sqrt(x.length)),C=Math.floor(P/2),v=[];for(let O=0;O<g;O++)for(let T=0;T<b;T++){const R=O*b+T;let L=0;for(let j=0;j<P;j++)for(let M=0;M<P;M++){const z=O+j-C,k=T+M-C;if(z>=0&&z<g&&k>=0&&k<b){const F=z*b+k,G=x[j*P+M];L+=y[F]*G}}v[R]=L}return v}var S=function(y){let b=c(y,this.threshold());return b&&(b=p(b,y.width,y.height),b=m(b,y.width,y.height),b=_(b,y.width,y.height),f(y,b)),y};t.Mask=S,e.Factory.addGetterSetter(n.Node,"threshold",0,(0,r.getNumberValidator)(),e.Factory.afterSetFilter)})),Y7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Noise=void 0;var e=ft(),n=an(),r=pt(),o=function(l){const s=this.noise()*255,c=l.data,f=c.length,p=s/2;for(let m=0;m<f;m+=4)c[m+0]+=p-2*p*Math.random(),c[m+1]+=p-2*p*Math.random(),c[m+2]+=p-2*p*Math.random()};t.Noise=o,e.Factory.addGetterSetter(n.Node,"noise",.2,(0,r.getNumberValidator)(),e.Factory.afterSetFilter)})),K7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Pixelate=void 0;var e=ft(),n=Wt(),r=an(),o=pt(),l=function(s){let c=Math.ceil(this.pixelSize()),f=s.width,p=s.height,m,_,S,y,b,g,x,P=Math.ceil(f/c),C=Math.ceil(p/c),v,O,T,R,L,j,M,z=s.data;if(c<=0){n.Util.error("pixelSize value can not be <= 0");return}for(L=0;L<P;L+=1)for(j=0;j<C;j+=1){for(y=0,b=0,g=0,x=0,v=L*c,O=v+c,T=j*c,R=T+c,M=0,m=v;m<O;m+=1)if(!(m>=f))for(_=T;_<R;_+=1)_>=p||(S=(f*_+m)*4,y+=z[S+0],b+=z[S+1],g+=z[S+2],x+=z[S+3],M+=1);for(y=y/M,b=b/M,g=g/M,x=x/M,m=v;m<O;m+=1)if(!(m>=f))for(_=T;_<R;_+=1)_>=p||(S=(f*_+m)*4,z[S+0]=y,z[S+1]=b,z[S+2]=g,z[S+3]=x)}};t.Pixelate=l,e.Factory.addGetterSetter(r.Node,"pixelSize",8,(0,o.getNumberValidator)(),e.Factory.afterSetFilter)})),q7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Posterize=void 0;var e=ft(),n=an(),r=pt(),o=function(l){const s=Math.round(this.levels()*254)+1,c=l.data,f=c.length,p=255/s;for(let m=0;m<f;m+=1)c[m]=Math.floor(c[m]/p)*p};t.Posterize=o,e.Factory.addGetterSetter(n.Node,"levels",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter)})),J7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RGB=void 0;var e=ft(),n=an(),r=pt(),o=function(l){const s=l.data,c=s.length,f=this.red(),p=this.green(),m=this.blue();for(let _=0;_<c;_+=4){const S=(.34*s[_]+.5*s[_+1]+.16*s[_+2])/255;s[_]=S*f,s[_+1]=S*p,s[_+2]=S*m,s[_+3]=s[_+3]}};t.RGB=o,e.Factory.addGetterSetter(n.Node,"red",0,function(l){return this._filterUpToDate=!1,l>255?255:l<0?0:Math.round(l)}),e.Factory.addGetterSetter(n.Node,"green",0,function(l){return this._filterUpToDate=!1,l>255?255:l<0?0:Math.round(l)}),e.Factory.addGetterSetter(n.Node,"blue",0,r.RGBComponent,e.Factory.afterSetFilter)})),Q7=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RGBA=void 0;var e=ft(),n=an(),r=pt(),o=function(l){const s=l.data,c=s.length,f=this.red(),p=this.green(),m=this.blue(),_=this.alpha();for(let S=0;S<c;S+=4){const y=1-_;s[S]=f*_+s[S]*y,s[S+1]=p*_+s[S+1]*y,s[S+2]=m*_+s[S+2]*y}};t.RGBA=o,e.Factory.addGetterSetter(n.Node,"red",0,function(l){return this._filterUpToDate=!1,l>255?255:l<0?0:Math.round(l)}),e.Factory.addGetterSetter(n.Node,"green",0,function(l){return this._filterUpToDate=!1,l>255?255:l<0?0:Math.round(l)}),e.Factory.addGetterSetter(n.Node,"blue",0,r.RGBComponent,e.Factory.afterSetFilter),e.Factory.addGetterSetter(n.Node,"alpha",1,function(l){return this._filterUpToDate=!1,l>1?1:l<0?0:l})})),e8=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Sepia=void 0;var e=function(n){const r=n.data,o=r.length;for(let l=0;l<o;l+=4){const s=r[l+0],c=r[l+1],f=r[l+2];r[l+0]=Math.min(255,s*.393+c*.769+f*.189),r[l+1]=Math.min(255,s*.349+c*.686+f*.168),r[l+2]=Math.min(255,s*.272+c*.534+f*.131)}};t.Sepia=e})),t8=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Solarize=void 0;var e=function(n){const r=n.data,o=n.width,l=n.height,s=o*4;let c=l;do{const f=(c-1)*s;let p=o;do{const m=f+(p-1)*4;let _=r[m],S=r[m+1],y=r[m+2];_>127&&(_=255-_),S>127&&(S=255-S),y>127&&(y=255-y),r[m]=_,r[m+1]=S,r[m+2]=y}while(--p)}while(--c)};t.Solarize=e})),n8=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Threshold=void 0;var e=ft(),n=an(),r=pt(),o=function(l){const s=this.threshold()*255,c=l.data,f=c.length;for(let p=0;p<f;p+=1)c[p]=c[p]<s?0:255};t.Threshold=o,e.Factory.addGetterSetter(n.Node,"threshold",.5,(0,r.getNumberValidator)(),e.Factory.afterSetFilter)})),r8=De.__commonJSMin((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var e=of(),n=x7(),r=w7(),o=T7(),l=P7(),s=A7(),c=M7(),f=Rp(),p=lf(),m=jp(),_=I7(),S=N7(),y=L7(),b=R7(),g=Dp(),x=j7(),P=D7(),C=z7(),v=B7(),O=k7(),T=H7(),R=F7(),L=V7(),j=G7(),M=U7(),z=$7(),k=X7(),F=Z7(),G=W7(),w=Y7(),D=K7(),N=q7(),H=J7(),V=Q7(),W=e8(),U=t8(),Q=n8();t.Konva=e.Konva.Util._assign(e.Konva,{Arc:n.Arc,Arrow:r.Arrow,Circle:o.Circle,Ellipse:l.Ellipse,Image:s.Image,Label:c.Label,Tag:c.Tag,Line:f.Line,Path:p.Path,Rect:m.Rect,RegularPolygon:_.RegularPolygon,Ring:S.Ring,Sprite:y.Sprite,Star:b.Star,Text:g.Text,TextPath:x.TextPath,Transformer:P.Transformer,Wedge:C.Wedge,Filters:{Blur:v.Blur,Brighten:O.Brighten,Contrast:T.Contrast,Emboss:R.Emboss,Enhance:L.Enhance,Grayscale:j.Grayscale,HSL:M.HSL,HSV:z.HSV,Invert:k.Invert,Kaleidoscope:F.Kaleidoscope,Mask:G.Mask,Noise:w.Noise,Pixelate:D.Pixelate,Posterize:N.Posterize,RGB:H.RGB,RGBA:V.RGBA,Sepia:W.Sepia,Solarize:U.Solarize,Threshold:Q.Threshold}})})),a8=De.__commonJSMin(((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0});var n=r8();e.exports=n.Konva})),i8=De.__commonJSMin(((t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;var n=of();Object.defineProperty(t,"Konva",{enumerable:!0,get:function(){return n.Konva}});var r=of();e.exports=r.Konva})),o8=De.__commonJSMin((t=>{function e(N,H){var V=N.length;N.push(H);e:for(;0<V;){var W=V-1>>>1,U=N[W];if(0<o(U,H))N[W]=H,N[V]=U,V=W;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var H=N[0],V=N.pop();if(V!==H){N[0]=V;e:for(var W=0,U=N.length,Q=U>>>1;W<Q;){var ae=2*(W+1)-1,Z=N[ae],ie=ae+1,te=N[ie];if(0>o(Z,V))ie<U&&0>o(te,Z)?(N[W]=te,N[ie]=V,W=ie):(N[W]=Z,N[ae]=V,W=ae);else if(ie<U&&0>o(te,V))N[W]=te,N[ie]=V,W=ie;else break e}}return H}function o(N,H){var V=N.sortIndex-H.sortIndex;return V!==0?V:N.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var s=Date,c=s.now();t.unstable_now=function(){return s.now()-c}}var f=[],p=[],m=1,_=null,S=3,y=!1,b=!1,g=!1,x=!1,P=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function O(N){for(var H=n(p);H!==null;){if(H.callback===null)r(p);else if(H.startTime<=N)r(p),H.sortIndex=H.expirationTime,e(f,H);else break;H=n(p)}}function T(N){if(g=!1,O(N),!b)if(n(f)!==null)b=!0,R||(R=!0,F());else{var H=n(p);H!==null&&D(T,H.startTime-N)}}var R=!1,L=-1,j=5,M=-1;function z(){return x?!0:!(t.unstable_now()-M<j)}function k(){if(x=!1,R){var N=t.unstable_now();M=N;var H=!0;try{e:{b=!1,g&&(g=!1,C(L),L=-1),y=!0;var V=S;try{t:{for(O(N),_=n(f);_!==null&&!(_.expirationTime>N&&z());){var W=_.callback;if(typeof W=="function"){_.callback=null,S=_.priorityLevel;var U=W(_.expirationTime<=N);if(N=t.unstable_now(),typeof U=="function"){_.callback=U,O(N),H=!0;break t}_===n(f)&&r(f),O(N)}else r(f);_=n(f)}if(_!==null)H=!0;else{var Q=n(p);Q!==null&&D(T,Q.startTime-N),H=!1}}break e}finally{_=null,S=V,y=!1}H=void 0}}finally{H?F():R=!1}}}var F;if(typeof v=="function")F=function(){v(k)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,w=G.port2;G.port1.onmessage=k,F=function(){w.postMessage(null)}}else F=function(){P(k,0)};function D(N,H){L=P(function(){N(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(N){N.callback=null},t.unstable_forceFrameRate=function(N){0>N||125<N||(j=0<N?Math.floor(1e3/N):5)},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_next=function(N){switch(S){case 1:case 2:case 3:var H=3;break;default:H=S}var V=S;S=H;try{return N()}finally{S=V}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function(N,H){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var V=S;S=N;try{return H()}finally{S=V}},t.unstable_scheduleCallback=function(N,H,V){var W=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?W+V:W):V=W,N){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=V+U,N={id:m++,callback:H,priorityLevel:N,startTime:V,expirationTime:U,sortIndex:-1},V>W?(N.sortIndex=V,e(p,N),n(f)===null&&N===n(p)&&(g?(C(L),L=-1):g=!0,D(T,V-W))):(N.sortIndex=U,e(f,N),b||y||(b=!0,R||(R=!0,F()))),N},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(N){var H=S;return function(){var V=S;S=H;try{return N.apply(this,arguments)}finally{S=V}}}})),zp=De.__commonJSMin(((t,e)=>{e.exports=o8()})),l8=De.__commonJSMin(((t,e)=>{e.exports=function(n){function r(a,i,d,h){return new lB(a,i,d,h)}function o(){}function l(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)i+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){var i=a,d=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(d=i.return),a=i.return;while(a)}return i.tag===3?d:null}function c(a){if(s(a)!==a)throw Error(l(188))}function f(a){var i=a.alternate;if(!i){if(i=s(a),i===null)throw Error(l(188));return i!==a?null:a}for(var d=a,h=i;;){var E=d.return;if(E===null)break;var A=E.alternate;if(A===null){if(h=E.return,h!==null){d=h;continue}break}if(E.child===A.child){for(A=E.child;A;){if(A===d)return c(E),a;if(A===h)return c(E),i;A=A.sibling}throw Error(l(188))}if(d.return!==h.return)d=E,h=A;else{for(var $=!1,re=E.child;re;){if(re===d){$=!0,d=E,h=A;break}if(re===h){$=!0,h=E,d=A;break}re=re.sibling}if(!$){for(re=A.child;re;){if(re===d){$=!0,d=A,h=E;break}if(re===h){$=!0,h=A,d=E;break}re=re.sibling}if(!$)throw Error(l(189))}}if(d.alternate!==h)throw Error(l(190))}if(d.tag!==3)throw Error(l(188));return d.stateNode.current===d?a:i}function p(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=p(a),i!==null)return i;a=a.sibling}return null}function m(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(a.tag!==4&&(i=m(a),i!==null))return i;a=a.sibling}return null}function _(a){return a===null||typeof a!="object"?null:(a=I6&&a[I6]||a["@@iterator"],typeof a=="function"?a:null)}function S(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===fB?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case Il:return"Fragment";case Zh:return"Profiler";case A6:return"StrictMode";case Yh:return"Suspense";case Kh:return"SuspenseList";case Jh:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case Ml:return"Portal";case Oi:return a.displayName||"Context";case M6:return(a._context.displayName||"Context")+".Consumer";case Wh:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case qh:return i=a.displayName||null,i!==null?i:S(a.type)||"Memo";case wi:i=a._payload,a=a._init;try{return S(a(i))}catch{}}return null}function y(a){return{current:a}}function b(a){0>Rl||(a.current=ap[Rl],ap[Rl]=null,Rl--)}function g(a,i){Rl++,ap[Rl]=a.current,a.current=i}function x(a){return a>>>=0,a===0?32:31-(Hk(a)/Fk|0)|0}function P(a){var i=a&42;if(i!==0)return i;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function C(a,i,d){var h=a.pendingLanes;if(h===0)return 0;var E=0,A=a.suspendedLanes,$=a.pingedLanes;a=a.warmLanes;var re=h&134217727;return re!==0?(h=re&~A,h!==0?E=P(h):($&=re,$!==0?E=P($):d||(d=re&~a,d!==0&&(E=P(d))))):(re=h&~A,re!==0?E=P(re):$!==0?E=P($):d||(d=h&~a,d!==0&&(E=P(d)))),E===0?0:i!==0&&i!==E&&(i&A)===0&&(A=E&-E,d=i&-i,A>=d||A===32&&(d&4194048)!==0)?i:E}function v(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function O(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function T(){var a=Rd;return Rd<<=1,(Rd&62914560)===0&&(Rd=4194304),a}function R(a){for(var i=[],d=0;31>d;d++)i.push(a);return i}function L(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function j(a,i,d,h,E,A){var $=a.pendingLanes;a.pendingLanes=d,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=d,a.entangledLanes&=d,a.errorRecoveryDisabledLanes&=d,a.shellSuspendCounter=0;var re=a.entanglements,ge=a.expirationTimes,xe=a.hiddenUpdates;for(d=$&~d;0<d;){var ke=31-xr(d),Me=1<<ke;re[ke]=0,ge[ke]=-1;var Ve=xe[ke];if(Ve!==null)for(xe[ke]=null,ke=0;ke<Ve.length;ke++){var lt=Ve[ke];lt!==null&&(lt.lane&=-536870913)}d&=~Me}h!==0&&M(a,h,0),A!==0&&E===0&&a.tag!==0&&(a.suspendedLanes|=A&~($&~i))}function M(a,i,d){a.pendingLanes|=i,a.suspendedLanes&=~i;var h=31-xr(i);a.entangledLanes|=i,a.entanglements[h]=a.entanglements[h]|1073741824|d&261930}function z(a,i){var d=a.entangledLanes|=i;for(a=a.entanglements;d;){var h=31-xr(d),E=1<<h;E&i|a[h]&i&&(a[h]|=i),d&=~E}}function k(a,i){var d=i&-i;return d=(d&42)!==0?1:F(d),(d&(a.suspendedLanes|i))!==0?0:d}function F(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function G(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function w(a){if(typeof Xk=="function"&&Zk(a),Or&&typeof Or.setStrictMode=="function")try{Or.setStrictMode(sc,a)}catch{}}function D(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}function N(a){if(lp===void 0)try{throw Error()}catch(d){var i=d.stack.trim().match(/\n( *(at )?)/);lp=i&&i[1]||"",r7=-1<d.stack.indexOf(`
|
|
5
5
|
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define(`static/umd-runtime/runtime.js`,[`require`,`exports`,`module`,`static/umd-runtime/DXuqyllu.js`,`static/umd-runtime/G2k8ELiO.js`,`static/umd-runtime/Dqoi-pC_.js`],function(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:`Module`});let r=e("./DXuqyllu.js"),i=e("./G2k8ELiO.js"),a=e("./Dqoi-pC_.js");var o=r.r(i.w(),1),s=typeof o.default==`function`?(...e)=>(0,o.default)(...e):{...o.default};for(let e of Object.keys(o.default||{}))e!=="default"&&(s[e]=o.default[e]);var c=r.n({Activity:()=>ee,Children:()=>te,Component:()=>ne,Fragment:()=>re,Profiler:()=>ie,PureComponent:()=>ae,StrictMode:()=>oe,Suspense:()=>se,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>ce,__COMPILER_RUNTIME:()=>le,cache:()=>ue,cacheSignal:()=>de,cloneElement:()=>d,createContext:()=>f,createElement:()=>p,createRef:()=>m,default:()=>u,forwardRef:()=>h,isValidElement:()=>g,lazy:()=>_,memo:()=>v,startTransition:()=>y,unstable_useCacheRefresh:()=>b,use:()=>x,useActionState:()=>S,useCallback:()=>C,useContext:()=>w,useDebugValue:()=>T,useDeferredValue:()=>E,useEffect:()=>D,useEffectEvent:()=>O,useId:()=>k,useImperativeHandle:()=>A,useInsertionEffect:()=>j,useLayoutEffect:()=>M,useMemo:()=>N,useOptimistic:()=>P,useReducer:()=>F,useRef:()=>I,useState:()=>L,useSyncExternalStore:()=>R,useTransition:()=>z,version:()=>B}),l=r.r(a.Q(),1),u=l.default&&l.default.default?l.default.default:l.default,{Activity:ee,Children:te,Component:ne,Fragment:re,Profiler:ie,PureComponent:ae,StrictMode:oe,Suspense:se,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:ce,__COMPILER_RUNTIME:le,cache:ue,cacheSignal:de,cloneElement:d,createContext:f,createElement:p,createRef:m,forwardRef:h,isValidElement:g,lazy:_,memo:v,startTransition:y,unstable_useCacheRefresh:b,use:x,useActionState:S,useCallback:C,useContext:w,useDebugValue:T,useDeferredValue:E,useEffect:D,useEffectEvent:O,useId:k,useImperativeHandle:A,useInsertionEffect:j,useLayoutEffect:M,useMemo:N,useOptimistic:P,useReducer:F,useRef:I,useState:L,useSyncExternalStore:R,useTransition:z,version:B}=l.default;try{var V=Symbol.for(`editor-runtime.react.copies`),H=globalThis[V];H||(H=[],globalThis[V]=H);for(var U=!1,W=0;W<H.length;W++){var G=H[W];G&&G.react===l.default&&G.package===`useblocks`&&G.version===`1.1.
|
|
1
|
+
__useblocks__.define(`static/umd-runtime/runtime.js`,[`require`,`exports`,`module`,`static/umd-runtime/DXuqyllu.js`,`static/umd-runtime/G2k8ELiO.js`,`static/umd-runtime/Dqoi-pC_.js`],function(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:`Module`});let r=e("./DXuqyllu.js"),i=e("./G2k8ELiO.js"),a=e("./Dqoi-pC_.js");var o=r.r(i.w(),1),s=typeof o.default==`function`?(...e)=>(0,o.default)(...e):{...o.default};for(let e of Object.keys(o.default||{}))e!=="default"&&(s[e]=o.default[e]);var c=r.n({Activity:()=>ee,Children:()=>te,Component:()=>ne,Fragment:()=>re,Profiler:()=>ie,PureComponent:()=>ae,StrictMode:()=>oe,Suspense:()=>se,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>ce,__COMPILER_RUNTIME:()=>le,cache:()=>ue,cacheSignal:()=>de,cloneElement:()=>d,createContext:()=>f,createElement:()=>p,createRef:()=>m,default:()=>u,forwardRef:()=>h,isValidElement:()=>g,lazy:()=>_,memo:()=>v,startTransition:()=>y,unstable_useCacheRefresh:()=>b,use:()=>x,useActionState:()=>S,useCallback:()=>C,useContext:()=>w,useDebugValue:()=>T,useDeferredValue:()=>E,useEffect:()=>D,useEffectEvent:()=>O,useId:()=>k,useImperativeHandle:()=>A,useInsertionEffect:()=>j,useLayoutEffect:()=>M,useMemo:()=>N,useOptimistic:()=>P,useReducer:()=>F,useRef:()=>I,useState:()=>L,useSyncExternalStore:()=>R,useTransition:()=>z,version:()=>B}),l=r.r(a.Q(),1),u=l.default&&l.default.default?l.default.default:l.default,{Activity:ee,Children:te,Component:ne,Fragment:re,Profiler:ie,PureComponent:ae,StrictMode:oe,Suspense:se,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:ce,__COMPILER_RUNTIME:le,cache:ue,cacheSignal:de,cloneElement:d,createContext:f,createElement:p,createRef:m,forwardRef:h,isValidElement:g,lazy:_,memo:v,startTransition:y,unstable_useCacheRefresh:b,use:x,useActionState:S,useCallback:C,useContext:w,useDebugValue:T,useDeferredValue:E,useEffect:D,useEffectEvent:O,useId:k,useImperativeHandle:A,useInsertionEffect:j,useLayoutEffect:M,useMemo:N,useOptimistic:P,useReducer:F,useRef:I,useState:L,useSyncExternalStore:R,useTransition:z,version:B}=l.default;try{var V=Symbol.for(`editor-runtime.react.copies`),H=globalThis[V];H||(H=[],globalThis[V]=H);for(var U=!1,W=0;W<H.length;W++){var G=H[W];G&&G.react===l.default&&G.package===`useblocks`&&G.version===`1.1.103`&&(U=!0)}U||H.push({package:`useblocks`,version:`1.1.103`,react:l.default})}catch{}var fe=r.n({__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:()=>me,createPortal:()=>he,default:()=>pe,flushSync:()=>ge,preconnect:()=>_e,prefetchDNS:()=>ve,preinit:()=>ye,preinitModule:()=>be,preload:()=>xe,preloadModule:()=>Se,requestFormReset:()=>Ce,unstable_batchedUpdates:()=>we,useFormState:()=>Te,useFormStatus:()=>Ee,version:()=>De}),K=r.r(a.Z(),1),pe=K.default&&K.default.default?K.default.default:K.default,{__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:me,createPortal:he,flushSync:ge,preconnect:_e,prefetchDNS:ve,preinit:ye,preinitModule:be,preload:xe,preloadModule:Se,requestFormReset:Ce,unstable_batchedUpdates:we,useFormState:Te,useFormStatus:Ee,version:De}=K.default,Oe=r.n({createRoot:()=>Ae,default:()=>ke,hydrateRoot:()=>je,version:()=>Me}),q=r.r(a.X(),1),ke=q.default&&q.default.default?q.default.default:q.default,{createRoot:Ae,hydrateRoot:je,version:Me}=q.default,Ne=r.n({Fragment:()=>J,jsx:()=>Y,jsxs:()=>X}),{Fragment:J,jsx:Y,jsxs:X}=r.r(a.Y(),1),Pe=r.n({Fragment:()=>J,jsx:()=>Y,jsxDEV:()=>Y,jsxs:()=>X}),Fe=r.n({default:()=>a.t});let Z=/url\([^)]+\)|var\([^)]+\)|(\d*\.?\d+)px/g;function Ie(e,t){let n=10**(t+1),r=Math.floor(e*n);return Math.round(r/10)*10/n}let Le=(e={})=>{let{rootValue:t=16,precision:n=5,mediaQuery:r=!1}=e,a=(e,r)=>{if(!r)return e;let i=parseFloat(r);return i<=1?e:`${Ie(i/t,n)}rem`};return{visit:e=>{let t={...e};return Object.entries(e).forEach(([e,n])=>{if(typeof n==`string`&&n.includes(`px`)){let r=n.replace(Z,a);t[e]=r}!i.f[e]&&typeof n==`number`&&n!==0&&(t[e]=`${n}px`.replace(Z,a));let o=e.trim();if(o.startsWith(`@`)&&o.includes(`px`)&&r){let n=e.replace(Z,a);t[n]=t[e],delete t[e]}}),t}}};var Re=r.n({Keyframes:()=>i.i,NaNLinter:()=>i.l,StyleContext:()=>i.b,StyleProvider:()=>i.x,Theme:()=>i.v,_experimental:()=>i.n,autoPrefixTransformer:()=>i.C,createCache:()=>i.S,createTheme:()=>i._,extractStyle:()=>i.a,genCalc:()=>i.y,getComputedToken:()=>i.p,legacyLogicalPropertiesTransformer:()=>i.r,legacyNotSelectorLinter:()=>i.d,logicalPropertiesLinter:()=>i.u,parentSelectorLinter:()=>i.c,px2remTransformer:()=>Le,token2CSSVar:()=>i.h,unit:()=>i.g,useCSSVarRegister:()=>i.o,useCacheToken:()=>i.m,useStyleRegister:()=>i.s}),Q=r.n({Ls:()=>Ge,default:()=>ze,en:()=>We,extend:()=>Be,isDayjs:()=>He,locale:()=>Ve,p:()=>Ke,unix:()=>Ue}),$=r.r(i.t(),1),ze=$.default&&$.default.default?$.default.default:$.default,{extend:Be,locale:Ve,isDayjs:He,unix:Ue,en:We,Ls:Ge,p:Ke}=$.default;let qe=(function(){var t,n=function(){return t||=Promise.resolve().then(()=>e("./B7h7P1Np.js"))};return{then:function(e,t){return n().then(e,t)},catch:function(e){return n().catch(e)},finally:function(e){return n().finally(e)}}})(),Je=(function(){var t,n=function(){return t||=Promise.resolve().then(()=>e("./BauvM4c_.js"))};return{then:function(e,t){return n().then(e,t)},catch:function(e){return n().catch(e)},finally:function(e){return n().finally(e)}}})();Object.defineProperty(t,"AntDesignCssinjs",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(t,"AntDesignIconBase",{enumerable:!0,get:function(){return Fe}}),t.AntDesignIcons=Je,t.Antd=qe,t.Classnames=s,Object.defineProperty(t,"Dayjs",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(t,"React",{enumerable:!0,get:function(){return c}}),Object.defineProperty(t,"ReactDom",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(t,"ReactDomClient",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(t,"ReactJsxDevRuntime",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(t,"ReactJsxRuntime",{enumerable:!0,get:function(){return Ne}})});
|