@nextgengmb/product-visualizer-sdk
Version:
SDK to visualize furniture/products in user-uploaded spaces.
30 lines (28 loc) • 511 kB
JavaScript
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Yt=require("react");function _8(g){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(g){for(const s in g)if(s!=="default"){const c=Object.getOwnPropertyDescriptor(g,s);Object.defineProperty(r,s,c.get?c:{enumerable:!0,get:()=>g[s]})}}return r.default=g,Object.freeze(r)}const Sa=_8(Yt);var ey=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jy(g){return g&&g.__esModule&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g}var H1={exports:{}},zf={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ty;function C8(){if(ty)return zf;ty=1;var g=Yt,r=Symbol.for("react.element"),s=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,f=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function p(y,S,_){var D,P={},N=null,O=null;_!==void 0&&(N=""+_),S.key!==void 0&&(N=""+S.key),S.ref!==void 0&&(O=S.ref);for(D in S)c.call(S,D)&&!h.hasOwnProperty(D)&&(P[D]=S[D]);if(y&&y.defaultProps)for(D in S=y.defaultProps,S)P[D]===void 0&&(P[D]=S[D]);return{$$typeof:r,type:y,key:N,ref:O,props:P,_owner:f.current}}return zf.Fragment=s,zf.jsx=p,zf.jsxs=p,zf}var kf={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ny;function E8(){return ny||(ny=1,process.env.NODE_ENV!=="production"&&function(){var g=Yt,r=Symbol.for("react.element"),s=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),p=Symbol.for("react.provider"),y=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),T=Symbol.iterator,L="@@iterator";function F(k){if(k===null||typeof k!="object")return null;var he=T&&k[T]||k[L];return typeof he=="function"?he:null}var V=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(k){{for(var he=arguments.length,be=new Array(he>1?he-1:0),Ge=1;Ge<he;Ge++)be[Ge-1]=arguments[Ge];R("error",k,be)}}function R(k,he,be){{var Ge=V.ReactDebugCurrentFrame,Tt=Ge.getStackAddendum();Tt!==""&&(he+="%s",be=be.concat([Tt]));var Lt=be.map(function(ct){return String(ct)});Lt.unshift("Warning: "+he),Function.prototype.apply.call(console[k],console,Lt)}}var w=!1,U=!1,G=!1,ne=!1,z=!1,W;W=Symbol.for("react.module.reference");function H(k){return!!(typeof k=="string"||typeof k=="function"||k===c||k===h||z||k===f||k===_||k===D||ne||k===O||w||U||G||typeof k=="object"&&k!==null&&(k.$$typeof===N||k.$$typeof===P||k.$$typeof===p||k.$$typeof===y||k.$$typeof===S||k.$$typeof===W||k.getModuleId!==void 0))}function te(k,he,be){var Ge=k.displayName;if(Ge)return Ge;var Tt=he.displayName||he.name||"";return Tt!==""?be+"("+Tt+")":be}function ae(k){return k.displayName||"Context"}function ue(k){if(k==null)return null;if(typeof k.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof k=="function")return k.displayName||k.name||null;if(typeof k=="string")return k;switch(k){case c:return"Fragment";case s:return"Portal";case h:return"Profiler";case f:return"StrictMode";case _:return"Suspense";case D:return"SuspenseList"}if(typeof k=="object")switch(k.$$typeof){case y:var he=k;return ae(he)+".Consumer";case p:var be=k;return ae(be._context)+".Provider";case S:return te(k,k.render,"ForwardRef");case P:var Ge=k.displayName||null;return Ge!==null?Ge:ue(k.type)||"Memo";case N:{var Tt=k,Lt=Tt._payload,ct=Tt._init;try{return ue(ct(Lt))}catch{return null}}}return null}var De=Object.assign,ve=0,we,We,Z,me,oe,ye,Pe;function ot(){}ot.__reactDisabledLog=!0;function Mt(){{if(ve===0){we=console.log,We=console.info,Z=console.warn,me=console.error,oe=console.group,ye=console.groupCollapsed,Pe=console.groupEnd;var k={configurable:!0,enumerable:!0,value:ot,writable:!0};Object.defineProperties(console,{info:k,log:k,warn:k,error:k,group:k,groupCollapsed:k,groupEnd:k})}ve++}}function qt(){{if(ve--,ve===0){var k={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:De({},k,{value:we}),info:De({},k,{value:We}),warn:De({},k,{value:Z}),error:De({},k,{value:me}),group:De({},k,{value:oe}),groupCollapsed:De({},k,{value:ye}),groupEnd:De({},k,{value:Pe})})}ve<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var $e=V.ReactCurrentDispatcher,I;function de(k,he,be){{if(I===void 0)try{throw Error()}catch(Tt){var Ge=Tt.stack.trim().match(/\n( *(at )?)/);I=Ge&&Ge[1]||""}return`
`+I+k}}var Le=!1,ut;{var qe=typeof WeakMap=="function"?WeakMap:Map;ut=new qe}function gt(k,he){if(!k||Le)return"";{var be=ut.get(k);if(be!==void 0)return be}var Ge;Le=!0;var Tt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Lt;Lt=$e.current,$e.current=null,Mt();try{if(he){var ct=function(){throw Error()};if(Object.defineProperty(ct.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ct,[])}catch(qn){Ge=qn}Reflect.construct(k,[],ct)}else{try{ct.call()}catch(qn){Ge=qn}k.call(ct.prototype)}}else{try{throw Error()}catch(qn){Ge=qn}k()}}catch(qn){if(qn&&Ge&&typeof qn.stack=="string"){for(var at=qn.stack.split(`
`),un=Ge.stack.split(`
`),Ft=at.length-1,cn=un.length-1;Ft>=1&&cn>=0&&at[Ft]!==un[cn];)cn--;for(;Ft>=1&&cn>=0;Ft--,cn--)if(at[Ft]!==un[cn]){if(Ft!==1||cn!==1)do if(Ft--,cn--,cn<0||at[Ft]!==un[cn]){var Yn=`
`+at[Ft].replace(" at new "," at ");return k.displayName&&Yn.includes("<anonymous>")&&(Yn=Yn.replace("<anonymous>",k.displayName)),typeof k=="function"&&ut.set(k,Yn),Yn}while(Ft>=1&&cn>=0);break}}}finally{Le=!1,$e.current=Lt,qt(),Error.prepareStackTrace=Tt}var Ni=k?k.displayName||k.name:"",ri=Ni?de(Ni):"";return typeof k=="function"&&ut.set(k,ri),ri}function Rt(k,he,be){return gt(k,!1)}function wn(k){var he=k.prototype;return!!(he&&he.isReactComponent)}function ht(k,he,be){if(k==null)return"";if(typeof k=="function")return gt(k,wn(k));if(typeof k=="string")return de(k);switch(k){case _:return de("Suspense");case D:return de("SuspenseList")}if(typeof k=="object")switch(k.$$typeof){case S:return Rt(k.render);case P:return ht(k.type,he,be);case N:{var Ge=k,Tt=Ge._payload,Lt=Ge._init;try{return ht(Lt(Tt),he,be)}catch{}}}return""}var _n=Object.prototype.hasOwnProperty,sn={},In=V.ReactDebugCurrentFrame;function _a(k){if(k){var he=k._owner,be=ht(k.type,k._source,he?he.type:null);In.setExtraStackFrame(be)}else In.setExtraStackFrame(null)}function Hr(k,he,be,Ge,Tt){{var Lt=Function.call.bind(_n);for(var ct in k)if(Lt(k,ct)){var at=void 0;try{if(typeof k[ct]!="function"){var un=Error((Ge||"React class")+": "+be+" type `"+ct+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof k[ct]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw un.name="Invariant Violation",un}at=k[ct](he,ct,Ge,be,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ft){at=Ft}at&&!(at instanceof Error)&&(_a(Tt),j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ge||"React class",be,ct,typeof at),_a(null)),at instanceof Error&&!(at.message in sn)&&(sn[at.message]=!0,_a(Tt),j("Failed %s type: %s",be,at.message),_a(null))}}}var hn=Array.isArray;function Ca(k){return hn(k)}function Il(k){{var he=typeof Symbol=="function"&&Symbol.toStringTag,be=he&&k[Symbol.toStringTag]||k.constructor.name||"Object";return be}}function za(k){try{return Di(k),!1}catch{return!0}}function Di(k){return""+k}function wi(k){if(za(k))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Il(k)),Di(k)}var ll=V.ReactCurrentOwner,Yl={key:!0,ref:!0,__self:!0,__source:!0},ql,Ce;function Ke(k){if(_n.call(k,"ref")){var he=Object.getOwnPropertyDescriptor(k,"ref").get;if(he&&he.isReactWarning)return!1}return k.ref!==void 0}function ft(k){if(_n.call(k,"key")){var he=Object.getOwnPropertyDescriptor(k,"key").get;if(he&&he.isReactWarning)return!1}return k.key!==void 0}function Be(k,he){typeof k.ref=="string"&&ll.current}function on(k,he){{var be=function(){ql||(ql=!0,j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",he))};be.isReactWarning=!0,Object.defineProperty(k,"key",{get:be,configurable:!0})}}function sr(k,he){{var be=function(){Ce||(Ce=!0,j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",he))};be.isReactWarning=!0,Object.defineProperty(k,"ref",{get:be,configurable:!0})}}var ke=function(k,he,be,Ge,Tt,Lt,ct){var at={$$typeof:r,type:k,key:he,ref:be,props:ct,_owner:Lt};return at._store={},Object.defineProperty(at._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(at,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ge}),Object.defineProperty(at,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Tt}),Object.freeze&&(Object.freeze(at.props),Object.freeze(at)),at};function Ae(k,he,be,Ge,Tt){{var Lt,ct={},at=null,un=null;be!==void 0&&(wi(be),at=""+be),ft(he)&&(wi(he.key),at=""+he.key),Ke(he)&&(un=he.ref,Be(he,Tt));for(Lt in he)_n.call(he,Lt)&&!Yl.hasOwnProperty(Lt)&&(ct[Lt]=he[Lt]);if(k&&k.defaultProps){var Ft=k.defaultProps;for(Lt in Ft)ct[Lt]===void 0&&(ct[Lt]=Ft[Lt])}if(at||un){var cn=typeof k=="function"?k.displayName||k.name||"Unknown":k;at&&on(ct,cn),un&&sr(ct,cn)}return ke(k,at,un,Tt,Ge,ll.current,ct)}}var Qt=V.ReactCurrentOwner,Gt=V.ReactDebugCurrentFrame;function lt(k){if(k){var he=k._owner,be=ht(k.type,k._source,he?he.type:null);Gt.setExtraStackFrame(be)}else Gt.setExtraStackFrame(null)}var ia;ia=!1;function ei(k){return typeof k=="object"&&k!==null&&k.$$typeof===r}function zs(){{if(Qt.current){var k=ue(Qt.current.type);if(k)return`
Check the render method of \``+k+"`."}return""}}function yt(k){return""}var Gr={};function ti(k){{var he=zs();if(!he){var be=typeof k=="string"?k:k.displayName||k.name;be&&(he=`
Check the top-level render call using <`+be+">.")}return he}}function Ea(k,he){{if(!k._store||k._store.validated||k.key!=null)return;k._store.validated=!0;var be=ti(he);if(Gr[be])return;Gr[be]=!0;var Ge="";k&&k._owner&&k._owner!==Qt.current&&(Ge=" It was passed a child from "+ue(k._owner.type)+"."),lt(k),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',be,Ge),lt(null)}}function la(k,he){{if(typeof k!="object")return;if(Ca(k))for(var be=0;be<k.length;be++){var Ge=k[be];ei(Ge)&&Ea(Ge,he)}else if(ei(k))k._store&&(k._store.validated=!0);else if(k){var Tt=F(k);if(typeof Tt=="function"&&Tt!==k.entries)for(var Lt=Tt.call(k),ct;!(ct=Lt.next()).done;)ei(ct.value)&&Ea(ct.value,he)}}}function sa(k){{var he=k.type;if(he==null||typeof he=="string")return;var be;if(typeof he=="function")be=he.propTypes;else if(typeof he=="object"&&(he.$$typeof===S||he.$$typeof===P))be=he.propTypes;else return;if(be){var Ge=ue(he);Hr(be,k.props,"prop",Ge,k)}else if(he.PropTypes!==void 0&&!ia){ia=!0;var Tt=ue(he);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Tt||"Unknown")}typeof he.getDefaultProps=="function"&&!he.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ni(k){{for(var he=Object.keys(k.props),be=0;be<he.length;be++){var Ge=he[be];if(Ge!=="children"&&Ge!=="key"){lt(k),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ge),lt(null);break}}k.ref!==null&&(lt(k),j("Invalid attribute `ref` supplied to `React.Fragment`."),lt(null))}}var Kl={};function No(k,he,be,Ge,Tt,Lt){{var ct=H(k);if(!ct){var at="";(k===void 0||typeof k=="object"&&k!==null&&Object.keys(k).length===0)&&(at+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var un=yt();un?at+=un:at+=zs();var Ft;k===null?Ft="null":Ca(k)?Ft="array":k!==void 0&&k.$$typeof===r?(Ft="<"+(ue(k.type)||"Unknown")+" />",at=" Did you accidentally export a JSX literal instead of a component?"):Ft=typeof k,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ft,at)}var cn=Ae(k,he,be,Tt,Lt);if(cn==null)return cn;if(ct){var Yn=he.children;if(Yn!==void 0)if(Ge)if(Ca(Yn)){for(var Ni=0;Ni<Yn.length;Ni++)la(Yn[Ni],k);Object.freeze&&Object.freeze(Yn)}else j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else la(Yn,k)}if(_n.call(he,"key")){var ri=ue(k),qn=Object.keys(he).filter(function(Wl){return Wl!=="key"}),Mi=qn.length>0?"{key: someKey, "+qn.join(": ..., ")+": ...}":"{key: someKey}";if(!Kl[ri+Mi]){var ai=qn.length>0?"{"+qn.join(": ..., ")+": ...}":"{}";j(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,Mi,ri,ai,ri),Kl[ri+Mi]=!0}}return k===c?ni(cn):sa(cn),cn}}function sl(k,he,be){return No(k,he,be,!0)}function Nn(k,he,be){return No(k,he,be,!1)}var ks=Nn,Mo=sl;kf.Fragment=c,kf.jsx=ks,kf.jsxs=Mo}()),kf}process.env.NODE_ENV==="production"?H1.exports=C8():H1.exports=E8();var aa=H1.exports,Zy={exports:{}},sp={},np={},vt={};(function(g){Object.defineProperty(g,"__esModule",{value:!0}),g._registerNode=g.Konva=g.glob=void 0;const r=Math.PI/180;function s(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}g.glob=typeof ey<"u"?ey:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},g.Konva={_global:g.glob,version:"9.3.22",isBrowser:s(),isUnminified:/param/.test((function(f){}).toString()),dblClickWindow:400,getAngle(f){return g.Konva.angleDeg?f*r:f},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 g.Konva.DD.isDragging},isTransforming(){var f;return(f=g.Konva.Transformer)===null||f===void 0?void 0:f.isTransforming()},isDragReady(){return!!g.Konva.DD.node},releaseCanvasOnDestroy:!0,document:g.glob.document,_injectGlobal(f){g.glob.Konva=f}};const c=f=>{g.Konva[f.prototype.getClassName()]=f};g._registerNode=c,g.Konva._injectGlobal(g.Konva)})(vt);var Sn={};(function(g){Object.defineProperty(g,"__esModule",{value:!0}),g.Util=g.Transform=void 0;const r=vt;class s{constructor(w=[1,0,0,1,0,0]){this.dirty=!1,this.m=w&&w.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 s(this.m)}copyInto(w){w.m[0]=this.m[0],w.m[1]=this.m[1],w.m[2]=this.m[2],w.m[3]=this.m[3],w.m[4]=this.m[4],w.m[5]=this.m[5]}point(w){const U=this.m;return{x:U[0]*w.x+U[2]*w.y+U[4],y:U[1]*w.x+U[3]*w.y+U[5]}}translate(w,U){return this.m[4]+=this.m[0]*w+this.m[2]*U,this.m[5]+=this.m[1]*w+this.m[3]*U,this}scale(w,U){return this.m[0]*=w,this.m[1]*=w,this.m[2]*=U,this.m[3]*=U,this}rotate(w){const U=Math.cos(w),G=Math.sin(w),ne=this.m[0]*U+this.m[2]*G,z=this.m[1]*U+this.m[3]*G,W=this.m[0]*-G+this.m[2]*U,H=this.m[1]*-G+this.m[3]*U;return this.m[0]=ne,this.m[1]=z,this.m[2]=W,this.m[3]=H,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(w,U){const G=this.m[0]+this.m[2]*U,ne=this.m[1]+this.m[3]*U,z=this.m[2]+this.m[0]*w,W=this.m[3]+this.m[1]*w;return this.m[0]=G,this.m[1]=ne,this.m[2]=z,this.m[3]=W,this}multiply(w){const U=this.m[0]*w.m[0]+this.m[2]*w.m[1],G=this.m[1]*w.m[0]+this.m[3]*w.m[1],ne=this.m[0]*w.m[2]+this.m[2]*w.m[3],z=this.m[1]*w.m[2]+this.m[3]*w.m[3],W=this.m[0]*w.m[4]+this.m[2]*w.m[5]+this.m[4],H=this.m[1]*w.m[4]+this.m[3]*w.m[5]+this.m[5];return this.m[0]=U,this.m[1]=G,this.m[2]=ne,this.m[3]=z,this.m[4]=W,this.m[5]=H,this}invert(){const w=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),U=this.m[3]*w,G=-this.m[1]*w,ne=-this.m[2]*w,z=this.m[0]*w,W=w*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),H=w*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=U,this.m[1]=G,this.m[2]=ne,this.m[3]=z,this.m[4]=W,this.m[5]=H,this}getMatrix(){return this.m}decompose(){const w=this.m[0],U=this.m[1],G=this.m[2],ne=this.m[3],z=this.m[4],W=this.m[5],H=w*ne-U*G,te={x:z,y:W,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(w!=0||U!=0){const ae=Math.sqrt(w*w+U*U);te.rotation=U>0?Math.acos(w/ae):-Math.acos(w/ae),te.scaleX=ae,te.scaleY=H/ae,te.skewX=(w*G+U*ne)/H,te.skewY=0}else if(G!=0||ne!=0){const ae=Math.sqrt(G*G+ne*ne);te.rotation=Math.PI/2-(ne>0?Math.acos(-G/ae):-Math.acos(G/ae)),te.scaleX=H/ae,te.scaleY=ae,te.skewX=0,te.skewY=(w*G+U*ne)/H}return te.rotation=g.Util._getRotation(te.rotation),te}}g.Transform=s;const c="[object Array]",f="[object Number]",h="[object String]",p="[object Boolean]",y=Math.PI/180,S=180/Math.PI,_="#",D="",P="0",N="Konva warning: ",O="Konva error: ",T="rgb(",L={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]},F=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let V=[];const j=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(R){setTimeout(R,60)};g.Util={_isElement(R){return!!(R&&R.nodeType==1)},_isFunction(R){return!!(R&&R.constructor&&R.call&&R.apply)},_isPlainObject(R){return!!R&&R.constructor===Object},_isArray(R){return Object.prototype.toString.call(R)===c},_isNumber(R){return Object.prototype.toString.call(R)===f&&!isNaN(R)&&isFinite(R)},_isString(R){return Object.prototype.toString.call(R)===h},_isBoolean(R){return Object.prototype.toString.call(R)===p},isObject(R){return R instanceof Object},isValidSelector(R){if(typeof R!="string")return!1;const w=R[0];return w==="#"||w==="."||w===w.toUpperCase()},_sign(R){return R===0||R>0?1:-1},requestAnimFrame(R){V.push(R),V.length===1&&j(function(){const w=V;V=[],w.forEach(function(U){U()})})},createCanvasElement(){const R=document.createElement("canvas");try{R.style=R.style||{}}catch{}return R},createImageElement(){return document.createElement("img")},_isInDocument(R){for(;R=R.parentNode;)if(R==document)return!0;return!1},_urlToImage(R,w){const U=g.Util.createImageElement();U.onload=function(){w(U)},U.src=R},_rgbToHex(R,w,U){return((1<<24)+(R<<16)+(w<<8)+U).toString(16).slice(1)},_hexToRgb(R){R=R.replace(_,D);const w=parseInt(R,16);return{r:w>>16&255,g:w>>8&255,b:w&255}},getRandomColor(){let R=(Math.random()*16777215<<0).toString(16);for(;R.length<6;)R=P+R;return _+R},getRGB(R){let w;return R in L?(w=L[R],{r:w[0],g:w[1],b:w[2]}):R[0]===_?this._hexToRgb(R.substring(1)):R.substr(0,4)===T?(w=F.exec(R.replace(/ /g,"")),{r:parseInt(w[1],10),g:parseInt(w[2],10),b:parseInt(w[3],10)}):{r:0,g:0,b:0}},colorToRGBA(R){return R=R||"black",g.Util._namedColorToRBA(R)||g.Util._hex3ColorToRGBA(R)||g.Util._hex4ColorToRGBA(R)||g.Util._hex6ColorToRGBA(R)||g.Util._hex8ColorToRGBA(R)||g.Util._rgbColorToRGBA(R)||g.Util._rgbaColorToRGBA(R)||g.Util._hslColorToRGBA(R)},_namedColorToRBA(R){const w=L[R.toLowerCase()];return w?{r:w[0],g:w[1],b:w[2],a:1}:null},_rgbColorToRGBA(R){if(R.indexOf("rgb(")===0){R=R.match(/rgb\(([^)]+)\)/)[1];const w=R.split(/ *, */).map(Number);return{r:w[0],g:w[1],b:w[2],a:1}}},_rgbaColorToRGBA(R){if(R.indexOf("rgba(")===0){R=R.match(/rgba\(([^)]+)\)/)[1];const w=R.split(/ *, */).map((U,G)=>U.slice(-1)==="%"?G===3?parseInt(U)/100:parseInt(U)/100*255:Number(U));return{r:w[0],g:w[1],b:w[2],a:w[3]}}},_hex8ColorToRGBA(R){if(R[0]==="#"&&R.length===9)return{r:parseInt(R.slice(1,3),16),g:parseInt(R.slice(3,5),16),b:parseInt(R.slice(5,7),16),a:parseInt(R.slice(7,9),16)/255}},_hex6ColorToRGBA(R){if(R[0]==="#"&&R.length===7)return{r:parseInt(R.slice(1,3),16),g:parseInt(R.slice(3,5),16),b:parseInt(R.slice(5,7),16),a:1}},_hex4ColorToRGBA(R){if(R[0]==="#"&&R.length===5)return{r:parseInt(R[1]+R[1],16),g:parseInt(R[2]+R[2],16),b:parseInt(R[3]+R[3],16),a:parseInt(R[4]+R[4],16)/255}},_hex3ColorToRGBA(R){if(R[0]==="#"&&R.length===4)return{r:parseInt(R[1]+R[1],16),g:parseInt(R[2]+R[2],16),b:parseInt(R[3]+R[3],16),a:1}},_hslColorToRGBA(R){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(R)){const[w,...U]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(R),G=Number(U[0])/360,ne=Number(U[1])/100,z=Number(U[2])/100;let W,H,te;if(ne===0)return te=z*255,{r:Math.round(te),g:Math.round(te),b:Math.round(te),a:1};z<.5?W=z*(1+ne):W=z+ne-z*ne;const ae=2*z-W,ue=[0,0,0];for(let De=0;De<3;De++)H=G+1/3*-(De-1),H<0&&H++,H>1&&H--,6*H<1?te=ae+(W-ae)*6*H:2*H<1?te=W:3*H<2?te=ae+(W-ae)*(2/3-H)*6:te=ae,ue[De]=te*255;return{r:Math.round(ue[0]),g:Math.round(ue[1]),b:Math.round(ue[2]),a:1}}},haveIntersection(R,w){return!(w.x>R.x+R.width||w.x+w.width<R.x||w.y>R.y+R.height||w.y+w.height<R.y)},cloneObject(R){const w={};for(const U in R)this._isPlainObject(R[U])?w[U]=this.cloneObject(R[U]):this._isArray(R[U])?w[U]=this.cloneArray(R[U]):w[U]=R[U];return w},cloneArray(R){return R.slice(0)},degToRad(R){return R*y},radToDeg(R){return R*S},_degToRad(R){return g.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),g.Util.degToRad(R)},_radToDeg(R){return g.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),g.Util.radToDeg(R)},_getRotation(R){return r.Konva.angleDeg?g.Util.radToDeg(R):R},_capitalize(R){return R.charAt(0).toUpperCase()+R.slice(1)},throw(R){throw new Error(O+R)},error(R){console.error(O+R)},warn(R){r.Konva.showWarnings&&console.warn(N+R)},each(R,w){for(const U in R)w(U,R[U])},_inRange(R,w,U){return w<=R&&R<U},_getProjectionToSegment(R,w,U,G,ne,z){let W,H,te;const ae=(R-U)*(R-U)+(w-G)*(w-G);if(ae==0)W=R,H=w,te=(ne-U)*(ne-U)+(z-G)*(z-G);else{const ue=((ne-R)*(U-R)+(z-w)*(G-w))/ae;ue<0?(W=R,H=w,te=(R-ne)*(R-ne)+(w-z)*(w-z)):ue>1?(W=U,H=G,te=(U-ne)*(U-ne)+(G-z)*(G-z)):(W=R+ue*(U-R),H=w+ue*(G-w),te=(W-ne)*(W-ne)+(H-z)*(H-z))}return[W,H,te]},_getProjectionToLine(R,w,U){const G=g.Util.cloneObject(R);let ne=Number.MAX_VALUE;return w.forEach(function(z,W){if(!U&&W===w.length-1)return;const H=w[(W+1)%w.length],te=g.Util._getProjectionToSegment(z.x,z.y,H.x,H.y,R.x,R.y),ae=te[0],ue=te[1],De=te[2];De<ne&&(G.x=ae,G.y=ue,ne=De)}),G},_prepareArrayForTween(R,w,U){const G=[],ne=[];if(R.length>w.length){const W=w;w=R,R=W}for(let W=0;W<R.length;W+=2)G.push({x:R[W],y:R[W+1]});for(let W=0;W<w.length;W+=2)ne.push({x:w[W],y:w[W+1]});const z=[];return ne.forEach(function(W){const H=g.Util._getProjectionToLine(W,G,U);z.push(H.x),z.push(H.y)}),z},_prepareToStringify(R){let w;R.visitedByCircularReferenceRemoval=!0;for(const U in R)if(R.hasOwnProperty(U)&&R[U]&&typeof R[U]=="object"){if(w=Object.getOwnPropertyDescriptor(R,U),R[U].visitedByCircularReferenceRemoval||g.Util._isElement(R[U]))if(w.configurable)delete R[U];else return null;else if(g.Util._prepareToStringify(R[U])===null)if(w.configurable)delete R[U];else return null}return delete R.visitedByCircularReferenceRemoval,R},_assign(R,w){for(const U in w)R[U]=w[U];return R},_getFirstPointerId(R){return R.touches?R.changedTouches[0].identifier:R.pointerId||999},releaseCanvas(...R){r.Konva.releaseCanvasOnDestroy&&R.forEach(w=>{w.width=0,w.height=0})},drawRoundedRectPath(R,w,U,G){let ne=0,z=0,W=0,H=0;typeof G=="number"?ne=z=W=H=Math.min(G,w/2,U/2):(ne=Math.min(G[0]||0,w/2,U/2),z=Math.min(G[1]||0,w/2,U/2),H=Math.min(G[2]||0,w/2,U/2),W=Math.min(G[3]||0,w/2,U/2)),R.moveTo(ne,0),R.lineTo(w-z,0),R.arc(w-z,z,z,Math.PI*3/2,0,!1),R.lineTo(w,U-H),R.arc(w-H,U-H,H,0,Math.PI/2,!1),R.lineTo(W,U),R.arc(W,U-W,W,Math.PI/2,Math.PI,!1),R.lineTo(0,ne),R.arc(ne,ne,ne,Math.PI,Math.PI*3/2,!1)}}})(Sn);var dn={},Ti={},Hl={};Object.defineProperty(Hl,"__esModule",{value:!0});Hl.HitContext=Hl.SceneContext=Hl.Context=void 0;const $y=Sn,x8=vt;function R8(g){const r=[],s=g.length,c=$y.Util;for(let f=0;f<s;f++){let h=g[f];c._isNumber(h)?h=Math.round(h*1e3)/1e3:c._isString(h)||(h=h+""),r.push(h)}return r}const ry=",",T8="(",b8=")",D8="([",w8="])",N8=";",M8="()",O8="=",ay=["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"],P8=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],A8=100;class op{constructor(r){this.canvas=r,x8.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(r){r.fillEnabled()&&this._fill(r)}_fill(r){}strokeShape(r){r.hasStroke()&&this._stroke(r)}_stroke(r){}fillStrokeShape(r){r.attrs.fillAfterStrokeEnabled?(this.strokeShape(r),this.fillShape(r)):(this.fillShape(r),this.strokeShape(r))}getTrace(r,s){let c=this.traceArr,f=c.length,h="",p,y,S,_;for(p=0;p<f;p++)y=c[p],S=y.method,S?(_=y.args,h+=S,r?h+=M8:$y.Util._isArray(_[0])?h+=D8+_.join(ry)+w8:(s&&(_=_.map(D=>typeof D=="number"?Math.floor(D):D)),h+=T8+_.join(ry)+b8)):(h+=y.property,r||(h+=O8+y.val)),h+=N8;return h}clearTrace(){this.traceArr=[]}_trace(r){let s=this.traceArr,c;s.push(r),c=s.length,c>=A8&&s.shift()}reset(){const r=this.getCanvas().getPixelRatio();this.setTransform(1*r,0,0,1*r,0,0)}getCanvas(){return this.canvas}clear(r){const s=this.getCanvas();r?this.clearRect(r.x||0,r.y||0,r.width||0,r.height||0):this.clearRect(0,0,s.getWidth()/s.pixelRatio,s.getHeight()/s.pixelRatio)}_applyLineCap(r){const s=r.attrs.lineCap;s&&this.setAttr("lineCap",s)}_applyOpacity(r){const s=r.getAbsoluteOpacity();s!==1&&this.setAttr("globalAlpha",s)}_applyLineJoin(r){const s=r.attrs.lineJoin;s&&this.setAttr("lineJoin",s)}setAttr(r,s){this._context[r]=s}arc(r,s,c,f,h,p){this._context.arc(r,s,c,f,h,p)}arcTo(r,s,c,f,h){this._context.arcTo(r,s,c,f,h)}beginPath(){this._context.beginPath()}bezierCurveTo(r,s,c,f,h,p){this._context.bezierCurveTo(r,s,c,f,h,p)}clearRect(r,s,c,f){this._context.clearRect(r,s,c,f)}clip(...r){this._context.clip.apply(this._context,r)}closePath(){this._context.closePath()}createImageData(r,s){const c=arguments;if(c.length===2)return this._context.createImageData(r,s);if(c.length===1)return this._context.createImageData(r)}createLinearGradient(r,s,c,f){return this._context.createLinearGradient(r,s,c,f)}createPattern(r,s){return this._context.createPattern(r,s)}createRadialGradient(r,s,c,f,h,p){return this._context.createRadialGradient(r,s,c,f,h,p)}drawImage(r,s,c,f,h,p,y,S,_){const D=arguments,P=this._context;D.length===3?P.drawImage(r,s,c):D.length===5?P.drawImage(r,s,c,f,h):D.length===9&&P.drawImage(r,s,c,f,h,p,y,S,_)}ellipse(r,s,c,f,h,p,y,S){this._context.ellipse(r,s,c,f,h,p,y,S)}isPointInPath(r,s,c,f){return c?this._context.isPointInPath(c,r,s,f):this._context.isPointInPath(r,s,f)}fill(...r){this._context.fill.apply(this._context,r)}fillRect(r,s,c,f){this._context.fillRect(r,s,c,f)}strokeRect(r,s,c,f){this._context.strokeRect(r,s,c,f)}fillText(r,s,c,f){f?this._context.fillText(r,s,c,f):this._context.fillText(r,s,c)}measureText(r){return this._context.measureText(r)}getImageData(r,s,c,f){return this._context.getImageData(r,s,c,f)}lineTo(r,s){this._context.lineTo(r,s)}moveTo(r,s){this._context.moveTo(r,s)}rect(r,s,c,f){this._context.rect(r,s,c,f)}roundRect(r,s,c,f,h){this._context.roundRect(r,s,c,f,h)}putImageData(r,s,c){this._context.putImageData(r,s,c)}quadraticCurveTo(r,s,c,f){this._context.quadraticCurveTo(r,s,c,f)}restore(){this._context.restore()}rotate(r){this._context.rotate(r)}save(){this._context.save()}scale(r,s){this._context.scale(r,s)}setLineDash(r){this._context.setLineDash?this._context.setLineDash(r):"mozDash"in this._context?this._context.mozDash=r:"webkitLineDash"in this._context&&(this._context.webkitLineDash=r)}getLineDash(){return this._context.getLineDash()}setTransform(r,s,c,f,h,p){this._context.setTransform(r,s,c,f,h,p)}stroke(r){r?this._context.stroke(r):this._context.stroke()}strokeText(r,s,c,f){this._context.strokeText(r,s,c,f)}transform(r,s,c,f,h,p){this._context.transform(r,s,c,f,h,p)}translate(r,s){this._context.translate(r,s)}_enableTrace(){let r=this,s=ay.length,c=this.setAttr,f,h;const p=function(y){let S=r[y],_;r[y]=function(){return h=R8(Array.prototype.slice.call(arguments,0)),_=S.apply(r,arguments),r._trace({method:y,args:h}),_}};for(f=0;f<s;f++)p(ay[f]);r.setAttr=function(){c.apply(r,arguments);const y=arguments[0];let S=arguments[1];(y==="shadowOffsetX"||y==="shadowOffsetY"||y==="shadowBlur")&&(S=S/this.canvas.getPixelRatio()),r._trace({property:y,val:S})}}_applyGlobalCompositeOperation(r){const s=r.attrs.globalCompositeOperation;!s||s==="source-over"||this.setAttr("globalCompositeOperation",s)}}Hl.Context=op;P8.forEach(function(g){Object.defineProperty(op.prototype,g,{get(){return this._context[g]},set(r){this._context[g]=r}})});class L8 extends op{constructor(r,{willReadFrequently:s=!1}={}){super(r),this._context=r._canvas.getContext("2d",{willReadFrequently:s})}_fillColor(r){const s=r.fill();this.setAttr("fillStyle",s),r._fillFunc(this)}_fillPattern(r){this.setAttr("fillStyle",r._getFillPattern()),r._fillFunc(this)}_fillLinearGradient(r){const s=r._getLinearGradient();s&&(this.setAttr("fillStyle",s),r._fillFunc(this))}_fillRadialGradient(r){const s=r._getRadialGradient();s&&(this.setAttr("fillStyle",s),r._fillFunc(this))}_fill(r){const s=r.fill(),c=r.getFillPriority();if(s&&c==="color"){this._fillColor(r);return}const f=r.getFillPatternImage();if(f&&c==="pattern"){this._fillPattern(r);return}const h=r.getFillLinearGradientColorStops();if(h&&c==="linear-gradient"){this._fillLinearGradient(r);return}const p=r.getFillRadialGradientColorStops();if(p&&c==="radial-gradient"){this._fillRadialGradient(r);return}s?this._fillColor(r):f?this._fillPattern(r):h?this._fillLinearGradient(r):p&&this._fillRadialGradient(r)}_strokeLinearGradient(r){const s=r.getStrokeLinearGradientStartPoint(),c=r.getStrokeLinearGradientEndPoint(),f=r.getStrokeLinearGradientColorStops(),h=this.createLinearGradient(s.x,s.y,c.x,c.y);if(f){for(let p=0;p<f.length;p+=2)h.addColorStop(f[p],f[p+1]);this.setAttr("strokeStyle",h)}}_stroke(r){const s=r.dash(),c=r.getStrokeScaleEnabled();if(r.hasStroke()){if(!c){this.save();const h=this.getCanvas().getPixelRatio();this.setTransform(h,0,0,h,0,0)}this._applyLineCap(r),s&&r.dashEnabled()&&(this.setLineDash(s),this.setAttr("lineDashOffset",r.dashOffset())),this.setAttr("lineWidth",r.strokeWidth()),r.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),r.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(r):this.setAttr("strokeStyle",r.stroke()),r._strokeFunc(this),c||this.restore()}}_applyShadow(r){var s,c,f;const h=(s=r.getShadowRGBA())!==null&&s!==void 0?s:"black",p=(c=r.getShadowBlur())!==null&&c!==void 0?c:5,y=(f=r.getShadowOffset())!==null&&f!==void 0?f:{x:0,y:0},S=r.getAbsoluteScale(),_=this.canvas.getPixelRatio(),D=S.x*_,P=S.y*_;this.setAttr("shadowColor",h),this.setAttr("shadowBlur",p*Math.min(Math.abs(D),Math.abs(P))),this.setAttr("shadowOffsetX",y.x*D),this.setAttr("shadowOffsetY",y.y*P)}}Hl.SceneContext=L8;class F8 extends op{constructor(r){super(r),this._context=r._canvas.getContext("2d",{willReadFrequently:!0})}_fill(r){this.save(),this.setAttr("fillStyle",r.colorKey),r._fillFuncHit(this),this.restore()}strokeShape(r){r.hasHitStroke()&&this._stroke(r)}_stroke(r){if(r.hasHitStroke()){const s=r.getStrokeScaleEnabled();if(!s){this.save();const h=this.getCanvas().getPixelRatio();this.setTransform(h,0,0,h,0,0)}this._applyLineCap(r);const c=r.hitStrokeWidth(),f=c==="auto"?r.strokeWidth():c;this.setAttr("lineWidth",f),this.setAttr("strokeStyle",r.colorKey),r._strokeFuncHit(this),s||this.restore()}}}Hl.HitContext=F8;Object.defineProperty(Ti,"__esModule",{value:!0});Ti.HitCanvas=Ti.SceneCanvas=Ti.Canvas=void 0;const rp=Sn,e5=Hl,t5=vt;let Wh;function U8(){if(Wh)return Wh;const g=rp.Util.createCanvasElement(),r=g.getContext("2d");return Wh=function(){const s=t5.Konva._global.devicePixelRatio||1,c=r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return s/c}(),rp.Util.releaseCanvas(g),Wh}class Z1{constructor(r){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const c=(r||{}).pixelRatio||t5.Konva.pixelRatio||U8();this.pixelRatio=c,this._canvas=rp.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(r){const s=this.pixelRatio;this.pixelRatio=r,this.setSize(this.getWidth()/s,this.getHeight()/s)}setWidth(r){this.width=this._canvas.width=r*this.pixelRatio,this._canvas.style.width=r+"px";const s=this.pixelRatio;this.getContext()._context.scale(s,s)}setHeight(r){this.height=this._canvas.height=r*this.pixelRatio,this._canvas.style.height=r+"px";const s=this.pixelRatio;this.getContext()._context.scale(s,s)}getWidth(){return this.width}getHeight(){return this.height}setSize(r,s){this.setWidth(r||0),this.setHeight(s||0)}toDataURL(r,s){try{return this._canvas.toDataURL(r,s)}catch{try{return this._canvas.toDataURL()}catch(f){return rp.Util.error("Unable to get data URL. "+f.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}Ti.Canvas=Z1;class z8 extends Z1{constructor(r={width:0,height:0,willReadFrequently:!1}){super(r),this.context=new e5.SceneContext(this,{willReadFrequently:r.willReadFrequently}),this.setSize(r.width,r.height)}}Ti.SceneCanvas=z8;class k8 extends Z1{constructor(r={width:0,height:0}){super(r),this.hitCanvas=!0,this.context=new e5.HitContext(this),this.setSize(r.width,r.height)}}Ti.HitCanvas=k8;var up={};(function(g){Object.defineProperty(g,"__esModule",{value:!0}),g.DD=void 0;const r=vt,s=Sn;g.DD={get isDragging(){let c=!1;return g.DD._dragElements.forEach(f=>{f.dragStatus==="dragging"&&(c=!0)}),c},justDragged:!1,get node(){let c;return g.DD._dragElements.forEach(f=>{c=f.node}),c},_dragElements:new Map,_drag(c){const f=[];g.DD._dragElements.forEach((h,p)=>{const{node:y}=h,S=y.getStage();S.setPointersPositions(c),h.pointerId===void 0&&(h.pointerId=s.Util._getFirstPointerId(c));const _=S._changedPointerPositions.find(D=>D.id===h.pointerId);if(_){if(h.dragStatus!=="dragging"){const D=y.dragDistance();if(Math.max(Math.abs(_.x-h.startPointerPos.x),Math.abs(_.y-h.startPointerPos.y))<D||(y.startDrag({evt:c}),!y.isDragging()))return}y._setDragPosition(c,h),f.push(y)}}),f.forEach(h=>{h.fire("dragmove",{type:"dragmove",target:h,evt:c},!0)})},_endDragBefore(c){const f=[];g.DD._dragElements.forEach(h=>{const{node:p}=h,y=p.getStage();if(c&&y.setPointersPositions(c),!y._changedPointerPositions.find(D=>D.id===h.pointerId))return;(h.dragStatus==="dragging"||h.dragStatus==="stopped")&&(g.DD.justDragged=!0,r.Konva._mouseListenClick=!1,r.Konva._touchListenClick=!1,r.Konva._pointerListenClick=!1,h.dragStatus="stopped");const _=h.node.getLayer()||h.node instanceof r.Konva.Stage&&h.node;_&&f.indexOf(_)===-1&&f.push(_)}),f.forEach(h=>{h.draw()})},_endDragAfter(c){g.DD._dragElements.forEach((f,h)=>{f.dragStatus==="stopped"&&f.node.fire("dragend",{type:"dragend",target:f.node,evt:c},!0),f.dragStatus!=="dragging"&&g.DD._dragElements.delete(h)})}},r.Konva.isBrowser&&(window.addEventListener("mouseup",g.DD._endDragBefore,!0),window.addEventListener("touchend",g.DD._endDragBefore,!0),window.addEventListener("touchcancel",g.DD._endDragBefore,!0),window.addEventListener("mousemove",g.DD._drag),window.addEventListener("touchmove",g.DD._drag),window.addEventListener("mouseup",g.DD._endDragAfter,!1),window.addEventListener("touchend",g.DD._endDragAfter,!1),window.addEventListener("touchcancel",g.DD._endDragAfter,!1))})(up);var Et={},tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.RGBComponent=H8;tt.alphaComponent=G8;tt.getNumberValidator=B8;tt.getNumberOrArrayOfNumbersValidator=V8;tt.getNumberOrAutoValidator=j8;tt.getStringValidator=I8;tt.getStringOrGradientValidator=Y8;tt.getFunctionValidator=q8;tt.getNumberArrayValidator=K8;tt.getBooleanValidator=W8;tt.getComponentValidator=Q8;const Gl=vt,bn=Sn;function Bl(g){return bn.Util._isString(g)?'"'+g+'"':Object.prototype.toString.call(g)==="[object Number]"||bn.Util._isBoolean(g)?g:Object.prototype.toString.call(g)}function H8(g){return g>255?255:g<0?0:Math.round(g)}function G8(g){return g>1?1:g<1e-4?1e-4:g}function B8(){if(Gl.Konva.isUnminified)return function(g,r){return bn.Util._isNumber(g)||bn.Util.warn(Bl(g)+' is a not valid value for "'+r+'" attribute. The value should be a number.'),g}}function V8(g){if(Gl.Konva.isUnminified)return function(r,s){let c=bn.Util._isNumber(r),f=bn.Util._isArray(r)&&r.length==g;return!c&&!f&&bn.Util.warn(Bl(r)+' is a not valid value for "'+s+'" attribute. The value should be a number or Array<number>('+g+")"),r}}function j8(){if(Gl.Konva.isUnminified)return function(g,r){return bn.Util._isNumber(g)||g==="auto"||bn.Util.warn(Bl(g)+' is a not valid value for "'+r+'" attribute. The value should be a number or "auto".'),g}}function I8(){if(Gl.Konva.isUnminified)return function(g,r){return bn.Util._isString(g)||bn.Util.warn(Bl(g)+' is a not valid value for "'+r+'" attribute. The value should be a string.'),g}}function Y8(){if(Gl.Konva.isUnminified)return function(g,r){const s=bn.Util._isString(g),c=Object.prototype.toString.call(g)==="[object CanvasGradient]"||g&&g.addColorStop;return s||c||bn.Util.warn(Bl(g)+' is a not valid value for "'+r+'" attribute. The value should be a string or a native gradient.'),g}}function q8(){if(Gl.Konva.isUnminified)return function(g,r){return bn.Util._isFunction(g)||bn.Util.warn(Bl(g)+' is a not valid value for "'+r+'" attribute. The value should be a function.'),g}}function K8(){if(Gl.Konva.isUnminified)return function(g,r){const s=Int8Array?Object.getPrototypeOf(Int8Array):null;return s&&g instanceof s||(bn.Util._isArray(g)?g.forEach(function(c){bn.Util._isNumber(c)||bn.Util.warn('"'+r+'" attribute has non numeric element '+c+". Make sure that all elements are numbers.")}):bn.Util.warn(Bl(g)+' is a not valid value for "'+r+'" attribute. The value should be a array of numbers.')),g}}function W8(){if(Gl.Konva.isUnminified)return function(g,r){return g===!0||g===!1||bn.Util.warn(Bl(g)+' is a not valid value for "'+r+'" attribute. The value should be a boolean.'),g}}function Q8(g){if(Gl.Konva.isUnminified)return function(r,s){return r==null||bn.Util.isObject(r)||bn.Util.warn(Bl(r)+' is a not valid value for "'+s+'" attribute. The value should be an object with properties '+g),r}}(function(g){Object.defineProperty(g,"__esModule",{value:!0}),g.Factory=void 0;const r=Sn,s=tt,c="get",f="set";g.Factory={addGetterSetter(h,p,y,S,_){g.Factory.addGetter(h,p,y),g.Factory.addSetter(h,p,S,_),g.Factory.addOverloadedGetterSetter(h,p)},addGetter(h,p,y){const S=c+r.Util._capitalize(p);h.prototype[S]=h.prototype[S]||function(){const _=this.attrs[p];return _===void 0?y:_}},addSetter(h,p,y,S){const _=f+r.Util._capitalize(p);h.prototype[_]||g.Factory.overWriteSetter(h,p,y,S)},overWriteSetter(h,p,y,S){const _=f+r.Util._capitalize(p);h.prototype[_]=function(D){return y&&D!==void 0&&D!==null&&(D=y.call(this,D,p)),this._setAttr(p,D),S&&S.call(this),this}},addComponentsGetterSetter(h,p,y,S,_){const D=y.length,P=r.Util._capitalize,N=c+P(p),O=f+P(p);h.prototype[N]=function(){const L={};for(let F=0;F<D;F++){const V=y[F];L[V]=this.getAttr(p+P(V))}return L};const T=(0,s.getComponentValidator)(y);h.prototype[O]=function(L){const F=this.attrs[p];S&&(L=S.call(this,L,p)),T&&T.call(this,L,p);for(const V in L)L.hasOwnProperty(V)&&this._setAttr(p+P(V),L[V]);return L||y.forEach(V=>{this._setAttr(p+P(V),void 0)}),this._fireChangeEvent(p,F,L),_&&_.call(this),this},g.Factory.addOverloadedGetterSetter(h,p)},addOverloadedGetterSetter(h,p){const y=r.Util._capitalize(p),S=f+y,_=c+y;h.prototype[p]=function(){return arguments.length?(this[S](arguments[0]),this):this[_]()}},addDeprecatedGetterSetter(h,p,y,S){r.Util.error("Adding deprecated "+p);const _=c+r.Util._capitalize(p),D=p+" property is deprecated and will be removed soon. Look at Konva change log for more information.";h.prototype[_]=function(){r.Util.error(D);const P=this.attrs[p];return P===void 0?y:P},g.Factory.addSetter(h,p,S,function(){r.Util.error(D)}),g.Factory.addOverloadedGetterSetter(h,p)},backCompat(h,p){r.Util.each(p,function(y,S){const _=h.prototype[S],D=c+r.Util._capitalize(y),P=f+r.Util._capitalize(y);function N(){_.apply(this,arguments),r.Util.error('"'+y+'" method is deprecated and will be removed soon. Use ""'+S+'" instead.')}h.prototype[y]=N,h.prototype[D]=N,h.prototype[P]=N})},afterSetFilter(){this._filterUpToDate=!1}}})(Et);Object.defineProperty(dn,"__esModule",{value:!0});dn.Node=void 0;const ec=Ti,$a=up,qf=Et,Ts=vt,Nt=Sn,Ln=tt,ep="absoluteOpacity",Qh="allEventListeners",kl="absoluteTransform",iy="absoluteScale",So="canvas",X8="Change",J8="children",Z8="konva",G1="listening",$8="mouseenter",eS="mouseleave",tS="pointerenter",nS="pointerleave",rS="touchenter",aS="touchleave",ly="set",sy="Shape",tp=" ",oy="stage",ws="transform",iS="Stage",B1="visible",lS=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(tp);let sS=1;class rt{constructor(r){this._id=sS++,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(r),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(r){(r===ws||r===kl)&&this._cache.get(r)?this._cache.get(r).dirty=!0:r?this._cache.delete(r):this._cache.clear()}_getCache(r,s){let c=this._cache.get(r);return(c===void 0||(r===ws||r===kl)&&c.dirty===!0)&&(c=s.call(this),this._cache.set(r,c)),c}_calculate(r,s,c){if(!this._attachedDepsListeners.get(r)){const f=s.map(h=>h+"Change.konva").join(tp);this.on(f,()=>{this._clearCache(r)}),this._attachedDepsListeners.set(r,!0)}return this._getCache(r,c)}_getCanvasCache(){return this._cache.get(So)}_clearSelfAndDescendantCache(r){this._clearCache(r),r===kl&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(So)){const{scene:r,filter:s,hit:c,buffer:f}=this._cache.get(So);Nt.Util.releaseCanvas(r,s,c,f),this._cache.delete(So)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(r){const s=r||{};let c={};(s.x===void 0||s.y===void 0||s.width===void 0||s.height===void 0)&&(c=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let f=Math.ceil(s.width||c.width),h=Math.ceil(s.height||c.height),p=s.pixelRatio,y=s.x===void 0?Math.floor(c.x):s.x,S=s.y===void 0?Math.floor(c.y):s.y,_=s.offset||0,D=s.drawBorder||!1,P=s.hitCanvasPixelRatio||1;if(!f||!h){Nt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const N=Math.abs(Math.round(c.x)-y)>.5?1:0,O=Math.abs(Math.round(c.y)-S)>.5?1:0;f+=_*2+N,h+=_*2+O,y-=_,S-=_;const T=new ec.SceneCanvas({pixelRatio:p,width:f,height:h}),L=new ec.SceneCanvas({pixelRatio:p,width:0,height:0,willReadFrequently:!0}),F=new ec.HitCanvas({pixelRatio:P,width:f,height:h}),V=T.getContext(),j=F.getContext(),R=new ec.SceneCanvas({width:T.width/T.pixelRatio+Math.abs(y),height:T.height/T.pixelRatio+Math.abs(S),pixelRatio:T.pixelRatio}),w=R.getContext();return F.isCache=!0,T.isCache=!0,this._cache.delete(So),this._filterUpToDate=!1,s.imageSmoothingEnabled===!1&&(T.getContext()._context.imageSmoothingEnabled=!1,L.getContext()._context.imageSmoothingEnabled=!1),V.save(),j.save(),w.save(),V.translate(-y,-S),j.translate(-y,-S),w.translate(-y,-S),R.x=y,R.y=S,this._isUnderCache=!0,this._clearSelfAndDescendantCache(ep),this._clearSelfAndDescendantCache(iy),this.drawScene(T,this,R),this.drawHit(F,this),this._isUnderCache=!1,V.restore(),j.restore(),D&&(V.save(),V.beginPath(),V.rect(0,0,f,h),V.closePath(),V.setAttr("strokeStyle","red"),V.setAttr("lineWidth",5),V.stroke(),V.restore()),this._cache.set(So,{scene:T,filter:L,hit:F,buffer:R,x:y,y:S}),this._requestDraw(),this}isCached(){return this._cache.has(So)}getClientRect(r){throw new Error('abstract "getClientRect" method call')}_transformedRect(r,s){const c=[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}];let f=1/0,h=1/0,p=-1/0,y=-1/0;const S=this.getAbsoluteTransform(s);return c.forEach(function(_){const D=S.point(_);f===void 0&&(f=p=D.x,h=y=D.y),f=Math.min(f,D.x),h=Math.min(h,D.y),p=Math.max(p,D.x),y=Math.max(y,D.y)}),{x:f,y:h,width:p-f,height:y-h}}_drawCachedSceneCanvas(r){r.save(),r._applyOpacity(this),r._applyGlobalCompositeOperation(this);const s=t