diff --git a/package.json b/package.json index 1614471..5070343 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,8 @@ "version": "0.0.1", "private": true, "scripts": { - "deploy": "wrangler pages deploy dist --project-name cffyin --branch main --commit-dirty=true", + "deploy": "wrangler pages deploy dist --project-name cffyin --commit-dirty=true", + "deploy:prod": "wrangler pages deploy dist --project-name cffyin --branch main --commit-dirty=true", "preview": "wrangler pages deploy dist --project-name cffyin --branch master --commit-dirty=true", "dev": "wrangler pages dev dist", "start": "wrangler pages dev dist", diff --git a/src/.DS_Store b/src/.DS_Store deleted file mode 100755 index 3d8319d..0000000 Binary files a/src/.DS_Store and /dev/null differ diff --git a/src/snapmark-app/assets/index-cSUFPhev.js b/src/snapmark-app/assets/index-cSUFPhev.js deleted file mode 100644 index 86d6bf5..0000000 --- a/src/snapmark-app/assets/index-cSUFPhev.js +++ /dev/null @@ -1,167 +0,0 @@ -(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))f(r);new MutationObserver(r=>{for(const m of r)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&f(p)}).observe(document,{childList:!0,subtree:!0});function u(r){const m={};return r.integrity&&(m.integrity=r.integrity),r.referrerPolicy&&(m.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?m.credentials="include":r.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function f(r){if(r.ep)return;r.ep=!0;const m=u(r);fetch(r.href,m)}})();function ud(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var Jd={exports:{}},Uo={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var m2;function Cm(){if(m2)return Uo;m2=1;var d=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function u(f,r,m){var p=null;if(m!==void 0&&(p=""+m),r.key!==void 0&&(p=""+r.key),"key"in r){m={};for(var y in r)y!=="key"&&(m[y]=r[y])}else m=r;return r=m.ref,{$$typeof:d,type:f,key:p,ref:r!==void 0?r:null,props:m}}return Uo.Fragment=l,Uo.jsx=u,Uo.jsxs=u,Uo}var g2;function Am(){return g2||(g2=1,Jd.exports=Cm()),Jd.exports}var gt=Am(),Wd={exports:{}},Zt={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var p2;function zm(){if(p2)return Zt;p2=1;var d=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),p=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),E=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),A=Symbol.iterator;function O(R){return R===null||typeof R!="object"?null:(R=A&&R[A]||R["@@iterator"],typeof R=="function"?R:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,Z={};function K(R,tt,dt){this.props=R,this.context=tt,this.refs=Z,this.updater=dt||M}K.prototype.isReactComponent={},K.prototype.setState=function(R,tt){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,tt,"setState")},K.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function J(){}J.prototype=K.prototype;function L(R,tt,dt){this.props=R,this.context=tt,this.refs=Z,this.updater=dt||M}var B=L.prototype=new J;B.constructor=L,V(B,K.prototype),B.isPureReactComponent=!0;var et=Array.isArray;function I(){}var F={H:null,A:null,T:null,S:null},ut=Object.prototype.hasOwnProperty;function it(R,tt,dt){var Tt=dt.ref;return{$$typeof:d,type:R,key:tt,ref:Tt!==void 0?Tt:null,props:dt}}function Et(R,tt){return it(R.type,tt,R.props)}function Nt(R){return typeof R=="object"&&R!==null&&R.$$typeof===d}function bt(R){var tt={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(dt){return tt[dt]})}var Yt=/\/+/g;function Ot(R,tt){return typeof R=="object"&&R!==null&&R.key!=null?bt(""+R.key):tt.toString(36)}function St(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(I,I):(R.status="pending",R.then(function(tt){R.status==="pending"&&(R.status="fulfilled",R.value=tt)},function(tt){R.status==="pending"&&(R.status="rejected",R.reason=tt)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function U(R,tt,dt,Tt,jt){var Xt=typeof R;(Xt==="undefined"||Xt==="boolean")&&(R=null);var fe=!1;if(R===null)fe=!0;else switch(Xt){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(R.$$typeof){case d:case l:fe=!0;break;case x:return fe=R._init,U(fe(R._payload),tt,dt,Tt,jt)}}if(fe)return jt=jt(R),fe=Tt===""?"."+Ot(R,0):Tt,et(jt)?(dt="",fe!=null&&(dt=fe.replace(Yt,"$&/")+"/"),U(jt,tt,dt,"",function(Eu){return Eu})):jt!=null&&(Nt(jt)&&(jt=Et(jt,dt+(jt.key==null||R&&R.key===jt.key?"":(""+jt.key).replace(Yt,"$&/")+"/")+fe)),tt.push(jt)),1;fe=0;var oa=Tt===""?".":Tt+":";if(et(R))for(var me=0;me>>1,Mt=U[xt];if(0>>1;xtr(dt,ft))Ttr(jt,dt)?(U[xt]=jt,U[Tt]=ft,xt=Tt):(U[xt]=dt,U[tt]=ft,xt=tt);else if(Ttr(jt,ft))U[xt]=jt,U[Tt]=ft,xt=Tt;else break t}}return ct}function r(U,ct){var ft=U.sortIndex-ct.sortIndex;return ft!==0?ft:U.id-ct.id}if(d.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;d.unstable_now=function(){return m.now()}}else{var p=Date,y=p.now();d.unstable_now=function(){return p.now()-y}}var _=[],E=[],x=1,C=null,A=3,O=!1,M=!1,V=!1,Z=!1,K=typeof setTimeout=="function"?setTimeout:null,J=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function B(U){for(var ct=u(E);ct!==null;){if(ct.callback===null)f(E);else if(ct.startTime<=U)f(E),ct.sortIndex=ct.expirationTime,l(_,ct);else break;ct=u(E)}}function et(U){if(V=!1,B(U),!M)if(u(_)!==null)M=!0,I||(I=!0,bt());else{var ct=u(E);ct!==null&&St(et,ct.startTime-U)}}var I=!1,F=-1,ut=5,it=-1;function Et(){return Z?!0:!(d.unstable_now()-itU&&Et());){var xt=C.callback;if(typeof xt=="function"){C.callback=null,A=C.priorityLevel;var Mt=xt(C.expirationTime<=U);if(U=d.unstable_now(),typeof Mt=="function"){C.callback=Mt,B(U),ct=!0;break e}C===u(_)&&f(_),B(U)}else f(_);C=u(_)}if(C!==null)ct=!0;else{var R=u(E);R!==null&&St(et,R.startTime-U),ct=!1}}break t}finally{C=null,A=ft,O=!1}ct=void 0}}finally{ct?bt():I=!1}}}var bt;if(typeof L=="function")bt=function(){L(Nt)};else if(typeof MessageChannel<"u"){var Yt=new MessageChannel,Ot=Yt.port2;Yt.port1.onmessage=Nt,bt=function(){Ot.postMessage(null)}}else bt=function(){K(Nt,0)};function St(U,ct){F=K(function(){U(d.unstable_now())},ct)}d.unstable_IdlePriority=5,d.unstable_ImmediatePriority=1,d.unstable_LowPriority=4,d.unstable_NormalPriority=3,d.unstable_Profiling=null,d.unstable_UserBlockingPriority=2,d.unstable_cancelCallback=function(U){U.callback=null},d.unstable_forceFrameRate=function(U){0>U||125xt?(U.sortIndex=ft,l(E,U),u(_)===null&&U===u(E)&&(V?(J(F),F=-1):V=!0,St(et,ft-xt))):(U.sortIndex=Mt,l(_,U),M||O||(M=!0,I||(I=!0,bt()))),U},d.unstable_shouldYield=Et,d.unstable_wrapCallback=function(U){var ct=A;return function(){var ft=A;A=ct;try{return U.apply(this,arguments)}finally{A=ft}}}})(Pd)),Pd}var S2;function x1(){return S2||(S2=1,kd.exports=Mm()),kd.exports}var Id={exports:{}},al={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var _2;function Nm(){if(_2)return al;_2=1;var d=$o();function l(_){var E="https://react.dev/errors/"+_;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d)}catch(l){console.error(l)}}return d(),Id.exports=Nm(),Id.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var E2;function Rm(){if(E2)return Bo;E2=1;var d=x1(),l=$o(),u=Om();function f(t){var e="https://react.dev/errors/"+t;if(1Mt||(t.current=xt[Mt],xt[Mt]=null,Mt--)}function dt(t,e){Mt++,xt[Mt]=t.current,t.current=e}var Tt=R(null),jt=R(null),Xt=R(null),fe=R(null);function oa(t,e){switch(dt(Xt,e),dt(jt,t),dt(Tt,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?Y1(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=Y1(e),t=q1(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}tt(Tt),dt(Tt,t)}function me(){tt(Tt),tt(jt),tt(Xt)}function Eu(t){t.memoizedState!==null&&dt(fe,t);var e=Tt.current,i=q1(e,t.type);e!==i&&(dt(jt,t),dt(Tt,i))}function Ds(t){jt.current===t&&(tt(Tt),tt(jt)),fe.current===t&&(tt(fe),Ro._currentValue=ft)}var wn,Jn;function Sn(t){if(wn===void 0)try{throw Error()}catch(i){var e=i.stack.trim().match(/\n( *(at )?)/);wn=e&&e[1]||"",Jn=-1)":-1h||D[s]!==Q[h]){var at=` -`+D[s].replace(" at new "," at ");return t.displayName&&at.includes("")&&(at=at.replace("",t.displayName)),at}while(1<=s&&0<=h);break}}}finally{Di=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Sn(i):""}function _n(t,e){switch(t.tag){case 26:case 27:case 5:return Sn(t.type);case 16:return Sn("Lazy");case 13:return t.child!==e&&e!==null?Sn("Suspense Fallback"):Sn("Suspense");case 19:return Sn("SuspenseList");case 0:case 15:return Vl(t.type,!1);case 11:return Vl(t.type.render,!1);case 1:return Vl(t.type,!0);case 31:return Sn("Activity");default:return""}}function Rc(t){try{var e="",i=null;do e+=_n(t,i),i=t,t=t.return;while(t);return e}catch(s){return` -Error generating stack: `+s.message+` -`+s.stack}}var Gs=Object.prototype.hasOwnProperty,Wn=d.unstable_scheduleCallback,xu=d.unstable_cancelCallback,Gi=d.unstable_shouldYield,_a=d.unstable_requestPaint,za=d.unstable_now,eh=d.unstable_getCurrentPriorityLevel,Dc=d.unstable_ImmediatePriority,Tu=d.unstable_UserBlockingPriority,Hi=d.unstable_NormalPriority,Zl=d.unstable_LowPriority,Ui=d.unstable_IdlePriority,ah=d.log,lh=d.unstable_setDisableYieldValue,Cu=null,wa=null;function bn(t){if(typeof ah=="function"&&lh(t),wa&&typeof wa.setStrictMode=="function")try{wa.setStrictMode(Cu,t)}catch{}}var ll=Math.clz32?Math.clz32:nh,nr=Math.log,hd=Math.LN2;function nh(t){return t>>>=0,t===0?32:31-(nr(t)/hd|0)|0}var Gc=256,Au=262144,Bi=4194304;function Fn(t){var e=t&42;if(e!==0)return e;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Yi(t,e,i){var s=t.pendingLanes;if(s===0)return 0;var h=0,g=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var z=s&134217727;return z!==0?(s=z&~g,s!==0?h=Fn(s):(b&=z,b!==0?h=Fn(b):i||(i=z&~t,i!==0&&(h=Fn(i))))):(z=s&~g,z!==0?h=Fn(z):b!==0?h=Fn(b):i||(i=s&~t,i!==0&&(h=Fn(i)))),h===0?0:e!==0&&e!==h&&(e&g)===0&&(g=h&-h,i=e&-e,g>=i||g===32&&(i&4194048)!==0)?e:h}function zu(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function ih(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 kn(){var t=Bi;return Bi<<=1,(Bi&62914560)===0&&(Bi=4194304),t}function Hc(t){for(var e=[],i=0;31>i;i++)e.push(t);return e}function Mu(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Uc(t,e,i,s,h,g){var b=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var z=t.entanglements,D=t.expirationTimes,Q=t.hiddenUpdates;for(i=b&~i;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Lc=/[\n"\\]/g;function Oa(t){return t.replace(Lc,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Hu(t,e,i,s,h,g,b,z){t.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.type=b:t.removeAttribute("type"),e!=null?b==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+pl(e)):t.value!==""+pl(e)&&(t.value=""+pl(e)):b!=="submit"&&b!=="reset"||t.removeAttribute("value"),e!=null?Ul(t,b,pl(e)):i!=null?Ul(t,b,pl(i)):s!=null&&t.removeAttribute("value"),h==null&&g!=null&&(t.defaultChecked=!!g),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?t.name=""+pl(z):t.removeAttribute("name")}function Xc(t,e,i,s,h,g,b,z){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(t.type=g),e!=null||i!=null){if(!(g!=="submit"&&g!=="reset"||e!=null)){qs(t);return}i=i!=null?""+pl(i):"",e=e!=null?""+pl(e):i,z||e===t.value||(t.value=e),t.defaultValue=e}s=s??h,s=typeof s!="function"&&typeof s!="symbol"&&!!s,t.checked=z?t.checked:!!s,t.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.name=b),qs(t)}function Ul(t,e,i){e==="number"&&Me(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function Cn(t,e,i,s){if(t=t.options,e){e={};for(var h=0;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dr=!1;if(Jl)try{var Bu={};Object.defineProperty(Bu,"passive",{get:function(){dr=!0}}),window.addEventListener("test",Bu,Bu),window.removeEventListener("test",Bu,Bu)}catch{dr=!1}var ul=null,Wc=null,Vi=null;function Ls(){if(Vi)return Vi;var t,e=Wc,i=e.length,s,h="value"in ul?ul.value:ul.textContent,g=h.length;for(t=0;t=Xu),xh=" ",Ks=!1;function af(t,e){switch(t){case"keyup":return Eh.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _r(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var wi=!1;function Th(t,e){switch(t){case"compositionend":return _r(e);case"keypress":return e.which!==32?null:(Ks=!0,xh);case"textInput":return t=e.data,t===xh&&Ks?null:t;default:return null}}function br(t,e){if(wi)return t==="compositionend"||!Ki&&af(t,e)?(t=Ls(),Vi=Wc=ul=null,wi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:i,offset:e-t};t=s}t:{for(;i;){if(i.nextSibling){i=i.nextSibling;break t}i=i.parentNode}i=void 0}i=Ws(i)}}function be(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?be(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Nh(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=Me(t.document);e instanceof t.HTMLIFrameElement;){try{var i=typeof e.contentWindow.location.href=="string"}catch{i=!1}if(i)t=e.contentWindow;else break;e=Me(t.document)}return e}function Nr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var Oh=Jl&&"documentMode"in document&&11>=document.documentMode,Fl=null,kl=null,Ku=null,nf=!1;function wu(t,e,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;nf||Fl==null||Fl!==Me(s)||(s=Fl,"selectionStart"in s&&Nr(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ku&&Vu(Ku,s)||(Ku=s,s=N0(kl,"onSelect"),0>=b,h-=b,Ye=1<<32-ll(e)+h|i<Ft?(ue=At,At=null):ue=At.sibling;var he=W(Y,At,X[Ft],lt);if(he===null){At===null&&(At=ue);break}t&&At&&he.alternate===null&&e(Y,At),H=g(he,H,Ft),oe===null?Dt=he:oe.sibling=he,oe=he,At=ue}if(Ft===X.length)return i(Y,At),ee&&Il(Y,Ft),Dt;if(At===null){for(;FtFt?(ue=At,At=null):ue=At.sibling;var xs=W(Y,At,he.value,lt);if(xs===null){At===null&&(At=ue);break}t&&At&&xs.alternate===null&&e(Y,At),H=g(xs,H,Ft),oe===null?Dt=xs:oe.sibling=xs,oe=xs,At=ue}if(he.done)return i(Y,At),ee&&Il(Y,Ft),Dt;if(At===null){for(;!he.done;Ft++,he=X.next())he=nt(Y,he.value,lt),he!==null&&(H=g(he,H,Ft),oe===null?Dt=he:oe.sibling=he,oe=he);return ee&&Il(Y,Ft),Dt}for(At=s(At);!he.done;Ft++,he=X.next())he=$(At,Y,Ft,he.value,lt),he!==null&&(t&&he.alternate!==null&&At.delete(he.key===null?Ft:he.key),H=g(he,H,Ft),oe===null?Dt=he:oe.sibling=he,oe=he);return t&&At.forEach(function(Tm){return e(Y,Tm)}),ee&&Il(Y,Ft),Dt}function Ce(Y,H,X,lt){if(typeof X=="object"&&X!==null&&X.type===V&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case O:t:{for(var Dt=X.key;H!==null;){if(H.key===Dt){if(Dt=X.type,Dt===V){if(H.tag===7){i(Y,H.sibling),lt=h(H,X.props.children),lt.return=Y,Y=lt;break t}}else if(H.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===ut&&Pi(Dt)===H.type){i(Y,H.sibling),lt=h(H,X.props),xl(lt,X),lt.return=Y,Y=lt;break t}i(Y,H);break}else e(Y,H);H=H.sibling}X.type===V?(lt=si(X.props.children,Y.mode,lt,X.key),lt.return=Y,Y=lt):(lt=Pl(X.type,X.key,X.props,null,Y.mode,lt),xl(lt,X),lt.return=Y,Y=lt)}return b(Y);case M:t:{for(Dt=X.key;H!==null;){if(H.key===Dt)if(H.tag===4&&H.stateNode.containerInfo===X.containerInfo&&H.stateNode.implementation===X.implementation){i(Y,H.sibling),lt=h(H,X.children||[]),lt.return=Y,Y=lt;break t}else{i(Y,H);break}else e(Y,H);H=H.sibling}lt=rf(X,Y.mode,lt),lt.return=Y,Y=lt}return b(Y);case ut:return X=Pi(X),Ce(Y,H,X,lt)}if(St(X))return Ct(Y,H,X,lt);if(bt(X)){if(Dt=bt(X),typeof Dt!="function")throw Error(f(150));return X=Dt.call(X),Ut(Y,H,X,lt)}if(typeof X.then=="function")return Ce(Y,H,nc(X),lt);if(X.$$typeof===L)return Ce(Y,H,ts(Y,X),lt);es(Y,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,H!==null&&H.tag===6?(i(Y,H.sibling),lt=h(H,X),lt.return=Y,Y=lt):(i(Y,H),lt=ff(X,Y.mode,lt),lt.return=Y,Y=lt),b(Y)):i(Y,H)}return function(Y,H,X,lt){try{eu=0;var Dt=Ce(Y,H,X,lt);return tu=null,Dt}catch(At){if(At===ki||At===wt)throw At;var oe=Be(29,At,null,Y.mode);return oe.lanes=lt,oe.return=Y,oe}finally{}}}var Gn=_f(!0),bf=_f(!1),qa=!1;function ic(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jr(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Hn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function mi(t,e,i){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(zt&2)!==0){var h=s.pending;return h===null?e.next=e:(e.next=h.next,h.next=e),s.pending=e,e=bl(t),ii(t,null,i),e}return da(t,s,e,i),bl(t)}function gi(t,e,i){if(e=e.updateQueue,e!==null&&(e=e.shared,(i&4194048)!==0)){var s=e.lanes;s&=t.pendingLanes,i|=s,e.lanes=i,Hs(t,i)}}function Rt(t,e){var i=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var h=null,g=null;if(i=i.firstBaseUpdate,i!==null){do{var b={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};g===null?h=g=b:g=g.next=b,i=i.next}while(i!==null);g===null?h=g=e:g=g.next=e}else h=g=e;i={baseState:s.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:s.shared,callbacks:s.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=e:t.next=e,i.lastBaseUpdate=e}var Lr=!1;function uc(){if(Lr){var t=El;if(t!==null)throw t}}function as(t,e,i,s){Lr=!1;var h=t.updateQueue;qa=!1;var g=h.firstBaseUpdate,b=h.lastBaseUpdate,z=h.shared.pending;if(z!==null){h.shared.pending=null;var D=z,Q=D.next;D.next=null,b===null?g=Q:b.next=Q,b=D;var at=t.alternate;at!==null&&(at=at.updateQueue,z=at.lastBaseUpdate,z!==b&&(z===null?at.firstBaseUpdate=Q:z.next=Q,at.lastBaseUpdate=D))}if(g!==null){var nt=h.baseState;b=0,at=Q=D=null,z=g;do{var W=z.lane&-536870913,$=W!==z.lane;if($?(Kt&W)===W:(s&W)===W){W!==0&&W===Dn&&(Lr=!0),at!==null&&(at=at.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});t:{var Ct=t,Ut=z;W=e;var Ce=i;switch(Ut.tag){case 1:if(Ct=Ut.payload,typeof Ct=="function"){nt=Ct.call(Ce,nt,W);break t}nt=Ct;break t;case 3:Ct.flags=Ct.flags&-65537|128;case 0:if(Ct=Ut.payload,W=typeof Ct=="function"?Ct.call(Ce,nt,W):Ct,W==null)break t;nt=C({},nt,W);break t;case 2:qa=!0}}W=z.callback,W!==null&&(t.flags|=64,$&&(t.flags|=8192),$=h.callbacks,$===null?h.callbacks=[W]:$.push(W))}else $={lane:W,tag:z.tag,payload:z.payload,callback:z.callback,next:null},at===null?(Q=at=$,D=nt):at=at.next=$,b|=W;if(z=z.next,z===null){if(z=h.shared.pending,z===null)break;$=z,z=$.next,$.next=null,h.lastBaseUpdate=$,h.shared.pending=null}}while(!0);at===null&&(D=nt),h.baseState=D,h.firstBaseUpdate=Q,h.lastBaseUpdate=at,g===null&&(h.shared.lanes=0),dn|=b,t.lanes=b,t.memoizedState=nt}}function ls(t,e){if(typeof t!="function")throw Error(f(191,t));t.call(e)}function jh(t,e){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;tg?g:8;var b=U.T,z={};U.T=z,fo(t,!1,e,i);try{var D=h(),Q=U.S;if(Q!==null&&Q(z,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var at=Yr(D,s);rc(t,e,at,gl(t))}else rc(t,e,s,gl(t))}catch(nt){rc(t,e,{then:function(){},status:"rejected",reason:nt},gl())}finally{ct.p=g,b!==null&&z.types!==null&&(b.types=z.types),U.T=b}}function _d(){}function so(t,e,i,s){if(t.tag!==5)throw Error(f(476));var h=h0(t).queue;o0(t,h,e,ft,i===null?_d:function(){return d0(t),i(s)})}function h0(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:ft,baseState:ft,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:ft},next:null};var i={};return e.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bn,lastRenderedState:i},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function d0(t){var e=h0(t);e.next===null&&(e=t.alternate.memoizedState),rc(t,e.next.queue,{},gl())}function co(){return Bt(Ro)}function m0(){return Fe().memoizedState}function g0(){return Fe().memoizedState}function bd(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var i=gl();t=Hn(i);var s=mi(e,t,i);s!==null&&(Wt(s,e,i),gi(s,e,i)),e={cache:Hr()},t.payload=e;return}e=e.return}}function Ed(t,e,i){var s=gl();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Of(t)?v0(e,i):(i=sf(t,e,i,s),i!==null&&(Wt(i,t,s),y0(i,e,s)))}function p0(t,e,i){var s=gl();rc(t,e,i,s)}function rc(t,e,i,s){var h={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Of(t))v0(e,h);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=e.lastRenderedReducer,g!==null))try{var b=e.lastRenderedState,z=g(b,i);if(h.hasEagerState=!0,h.eagerState=z,Ba(z,b))return da(t,e,h,0),qt===null&&$s(),!1}catch{}finally{}if(i=sf(t,e,h,s),i!==null)return Wt(i,t,s),y0(i,e,s),!0}return!1}function fo(t,e,i,s){if(s={lane:2,revertLane:k(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Of(t)){if(e)throw Error(f(479))}else e=sf(t,i,s,2),e!==null&&Wt(e,t,2)}function Of(t){var e=t.alternate;return t===Qt||e!==null&&e===Qt}function v0(t,e){is=Tl=!0;var i=t.pending;i===null?e.next=e:(e.next=i.next,i.next=e),t.pending=e}function y0(t,e,i){if((i&4194048)!==0){var s=e.lanes;s&=t.pendingLanes,i|=s,e.lanes=i,Hs(t,i)}}var ss={readContext:Bt,use:pi,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useLayoutEffect:qe,useInsertionEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useSyncExternalStore:qe,useId:qe,useHostTransitionStatus:qe,useFormState:qe,useActionState:qe,useOptimistic:qe,useMemoCache:qe,useCacheRefresh:qe};ss.useEffectEvent=qe;var S0={readContext:Bt,use:pi,useCallback:function(t,e){return ua().memoizedState=[t,e===void 0?null:e],t},useContext:Bt,useEffect:e0,useImperativeHandle:function(t,e,i){i=i!=null?i.concat([t]):null,Mf(4194308,4,u0.bind(null,e,t),i)},useLayoutEffect:function(t,e){return Mf(4194308,4,t,e)},useInsertionEffect:function(t,e){Mf(4,2,t,e)},useMemo:function(t,e){var i=ua();e=e===void 0?null:e;var s=t();if(au){bn(!0);try{t()}finally{bn(!1)}}return i.memoizedState=[s,e],s},useReducer:function(t,e,i){var s=ua();if(i!==void 0){var h=i(e);if(au){bn(!0);try{i(e)}finally{bn(!1)}}}else h=e;return s.memoizedState=s.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},s.queue=t,t=t.dispatch=Ed.bind(null,Qt,t),[s.memoizedState,t]},useRef:function(t){var e=ua();return t={current:t},e.memoizedState=t},useState:function(t){t=Pr(t);var e=t.queue,i=p0.bind(null,Qt,e);return e.dispatch=i,[t.memoizedState,i]},useDebugValue:io,useDeferredValue:function(t,e){var i=ua();return uo(i,t,e)},useTransition:function(){var t=Pr(!1);return t=o0.bind(null,Qt,t.queue,!0,!1),ua().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,i){var s=Qt,h=ua();if(ee){if(i===void 0)throw Error(f(407));i=i()}else{if(i=e(),qt===null)throw Error(f(349));(Kt&127)!==0||Zh(s,e,i)}h.memoizedState=i;var g={value:i,getSnapshot:e};return h.queue=g,e0(wh.bind(null,s,g,t),[t]),s.flags|=2048,vi(9,{destroy:void 0},Kh.bind(null,s,g,i,e),null),i},useId:function(){var t=ua(),e=qt.identifierPrefix;if(ee){var i=Bl,s=Ye;i=(s&~(1<<32-ll(s)-1)).toString(32)+i,e="_"+e+"R_"+i,i=xf++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?g.multiple=!0:s.size&&(g.size=s.size);break;default:g=typeof s.is=="string"?b.createElement(h,{is:s.is}):b.createElement(h)}}g[ta]=e,g[Ma]=s;t:for(b=e.child;b!==null;){if(b.tag===5||b.tag===6)g.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===e)break t;for(;b.sibling===null;){if(b.return===null||b.return===e)break t;b=b.return}b.sibling.return=b.return,b=b.sibling}e.stateNode=g;t:switch(Ka(g,h,s),h){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break t;case"img":s=!0;break t;default:s=!1}s&&cn(e)}}return _e(e),mc(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,i),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==s&&cn(e);else{if(typeof s!="string"&&e.stateNode===null)throw Error(f(166));if(t=Xt.current,Iu(e)){if(t=e.stateNode,i=e.memoizedProps,s=null,h=Ze,h!==null)switch(h.tag){case 27:case 5:s=h.memoizedProps}t[ta]=e,t=!!(t.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||U1(t.nodeValue,i)),t||tn(e,!0)}else t=O0(t).createTextNode(s),t[ta]=e,e.stateNode=t}return _e(e),null;case 31:if(i=e.memoizedState,t===null||t.memoizedState!==null){if(s=Iu(e),i!==null){if(t===null){if(!s)throw Error(f(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(f(557));t[ta]=e}else ri(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;_e(e),t=!1}else i=df(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return e.flags&256?(We(e),e):(We(e),null);if((e.flags&128)!==0)throw Error(f(558))}return _e(e),null;case 13:if(s=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Iu(e),s!==null&&s.dehydrated!==null){if(t===null){if(!h)throw Error(f(318));if(h=e.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(f(317));h[ta]=e}else ri(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;_e(e),h=!1}else h=df(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return e.flags&256?(We(e),e):(We(e),null)}return We(e),(e.flags&128)!==0?(e.lanes=i,e):(i=s!==null,t=t!==null&&t.memoizedState!==null,i&&(s=e.child,h=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(h=s.alternate.memoizedState.cachePool.pool),g=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(g=s.memoizedState.cachePool.pool),g!==h&&(s.flags|=2048)),i!==t&&i&&(e.child.flags|=8192),Yn(e,e.updateQueue),_e(e),null);case 4:return me(),t===null&&zd(e.stateNode.containerInfo),_e(e),null;case 10:return ln(e.type),_e(e),null;case 19:if(tt(ae),s=e.memoizedState,s===null)return _e(e),null;if(h=(e.flags&128)!==0,g=s.rendering,g===null)if(h)fn(s,!1);else{if(je!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(g=rl(t),g!==null){for(e.flags|=128,fn(s,!1),t=g.updateQueue,e.updateQueue=t,Yn(e,t),e.subtreeFlags=0,t=i,i=e.child;i!==null;)Ju(i,t),i=i.sibling;return dt(ae,ae.current&1|2),ee&&Il(e,s.treeForkCount),e.child}t=t.sibling}s.tail!==null&&za()>Pe&&(e.flags|=128,h=!0,fn(s,!1),e.lanes=4194304)}else{if(!h)if(t=rl(g),t!==null){if(e.flags|=128,h=!0,t=t.updateQueue,e.updateQueue=t,Yn(e,t),fn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!g.alternate&&!ee)return _e(e),null}else 2*za()-s.renderingStartTime>Pe&&i!==536870912&&(e.flags|=128,h=!0,fn(s,!1),e.lanes=4194304);s.isBackwards?(g.sibling=e.child,e.child=g):(t=s.last,t!==null?t.sibling=g:e.child=g,s.last=g)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=za(),t.sibling=null,i=ae.current,dt(ae,h?i&1|2:i&1),ee&&Il(e,s.treeForkCount),t):(_e(e),null);case 22:case 23:return We(e),sc(),s=e.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(e.flags|=8192):s&&(e.flags|=8192),s?(i&536870912)!==0&&(e.flags&128)===0&&(_e(e),e.subtreeFlags&6&&(e.flags|=8192)):_e(e),i=e.updateQueue,i!==null&&Yn(e,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),s=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),s!==i&&(e.flags|=2048),t!==null&&tt(di),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),ln(aa),_e(e),null;case 25:return null;case 30:return null}throw Error(f(156,e.tag))}function Al(t,e){switch(of(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ln(aa),me(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return Ds(e),null;case 31:if(e.memoizedState!==null){if(We(e),e.alternate===null)throw Error(f(340));ri()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(We(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(f(340));ri()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return tt(ae),null;case 4:return me(),null;case 10:return ln(e.type),null;case 22:case 23:return We(e),sc(),t!==null&&tt(di),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return ln(aa),null;case 25:return null;default:return null}}function ol(t,e){switch(of(e),e.tag){case 3:ln(aa),me();break;case 26:case 27:case 5:Ds(e);break;case 4:me();break;case 31:e.memoizedState!==null&&We(e);break;case 13:We(e);break;case 19:tt(ae);break;case 10:ln(e.type);break;case 22:case 23:We(e),sc(),t!==null&&tt(di);break;case 24:ln(aa)}}function zl(t,e){try{var i=e.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var h=s.next;i=h;do{if((i.tag&t)===t){s=void 0;var g=i.create,b=i.inst;s=g(),b.destroy=s}i=i.next}while(i!==h)}}catch(z){se(e,e.return,z)}}function Ea(t,e,i){try{var s=e.updateQueue,h=s!==null?s.lastEffect:null;if(h!==null){var g=h.next;s=g;do{if((s.tag&t)===t){var b=s.inst,z=b.destroy;if(z!==void 0){b.destroy=void 0,h=e;var D=i,Q=z;try{Q()}catch(at){se(h,D,at)}}}s=s.next}while(s!==g)}}catch(at){se(e,e.return,at)}}function Yl(t){var e=t.updateQueue;if(e!==null){var i=t.stateNode;try{jh(e,i)}catch(s){se(t,t.return,s)}}}function ga(t,e,i){i.props=yi(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(s){se(t,e,s)}}function qn(t,e){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var s=t.stateNode;break;case 30:s=t.stateNode;break;default:s=t.stateNode}typeof i=="function"?t.refCleanup=i(s):i.current=s}}catch(h){se(t,e,h)}}function xa(t,e){var i=t.ref,s=t.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(h){se(t,e,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(h){se(t,e,h)}else i.current=null}function pc(t){var e=t.type,i=t.memoizedProps,s=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break t;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(h){se(t,t.return,h)}}function ca(t,e,i){try{var s=t.stateNode;W3(s,t.type,i,e),s[Ma]=e}catch(h){se(t,t.return,h)}}function Re(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ys(t.type)||t.tag===4}function $t(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||Re(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ys(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function rn(t,e,i){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,e):(e=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,e.appendChild(t),i=i._reactRootContainer,i!=null||e.onclick!==null||(e.onclick=An));else if(s!==4&&(s===27&&ys(t.type)&&(i=t.stateNode,e=null),t=t.child,t!==null))for(rn(t,e,i),t=t.sibling;t!==null;)rn(t,e,i),t=t.sibling}function La(t,e,i){var s=t.tag;if(s===5||s===6)t=t.stateNode,e?i.insertBefore(t,e):i.appendChild(t);else if(s!==4&&(s===27&&ys(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(La(t,e,i),t=t.sibling;t!==null;)La(t,e,i),t=t.sibling}function Qf(t){var e=t.stateNode,i=t.memoizedProps;try{for(var s=t.type,h=e.attributes;h.length;)e.removeAttributeNode(h[0]);Ka(e,s,i),e[ta]=t,e[Ma]=i}catch(g){se(t,t.return,g)}}var Ml=!1,xe=!1,ql=!1,z0=typeof WeakSet=="function"?WeakSet:Set,pa=null;function Td(t,e){if(t=t.containerInfo,Od=Y0,t=Nh(t),Nr(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else t:{i=(i=t.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var h=s.anchorOffset,g=s.focusNode;s=s.focusOffset;try{i.nodeType,g.nodeType}catch{i=null;break t}var b=0,z=-1,D=-1,Q=0,at=0,nt=t,W=null;e:for(;;){for(var $;nt!==i||h!==0&&nt.nodeType!==3||(z=b+h),nt!==g||s!==0&&nt.nodeType!==3||(D=b+s),nt.nodeType===3&&(b+=nt.nodeValue.length),($=nt.firstChild)!==null;)W=nt,nt=$;for(;;){if(nt===t)break e;if(W===i&&++Q===h&&(z=b),W===g&&++at===s&&(D=b),($=nt.nextSibling)!==null)break;nt=W,W=nt.parentNode}nt=$}i=z===-1||D===-1?null:{start:z,end:D}}else i=null}i=i||{start:0,end:0}}else i=null;for(Rd={focusedElem:t,selectionRange:i},Y0=!1,pa=e;pa!==null;)if(e=pa,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,pa=t;else for(;pa!==null;){switch(e=pa,g=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(i=0;i title"))),Ka(g,s,i),g[ta]=t,ea(g),s=g;break t;case"link":var b=I1("link","href",h).get(s+(i.href||""));if(b){for(var z=0;zCe&&(b=Ce,Ce=Ut,Ut=b);var Y=Zu(z,Ut),H=Zu(z,Ce);if(Y&&H&&($.rangeCount!==1||$.anchorNode!==Y.node||$.anchorOffset!==Y.offset||$.focusNode!==H.node||$.focusOffset!==H.offset)){var X=nt.createRange();X.setStart(Y.node,Y.offset),$.removeAllRanges(),Ut>Ce?($.addRange(X),$.extend(H.node,H.offset)):(X.setEnd(H.node,H.offset),$.addRange(X))}}}}for(nt=[],$=z;$=$.parentNode;)$.nodeType===1&&nt.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;zi?32:i,U.T=null,i=ds,ds=null;var g=ml,b=Gl;if(pe=0,os=ml=null,Gl=0,(zt&6)!==0)throw Error(f(331));var z=zt;if(zt|=4,tl(g.current),xo(g,g.current,b,i),zt=z,_t(0,!1),wa&&typeof wa.onPostCommitFiberRoot=="function")try{wa.onPostCommitFiberRoot(Cu,g)}catch{}return!0}finally{ct.p=h,U.T=s,gn(t,e)}}function Ao(t,e,i){e=sl(i,e),e=po(t.stateNode,e,2),t=mi(t,e,2),t!==null&&(Mu(t,2),rt(t))}function se(t,e,i){if(t.tag===3)Ao(t,t,i);else for(;e!==null;){if(e.tag===3){Ao(e,t,i);break}else if(e.tag===1){var s=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ie===null||!Ie.has(s))){t=sl(i,t),i=vo(2),s=mi(e,i,2),s!==null&&(E0(i,s,e,t),Mu(s,2),rt(s));break}}e=e.return}}function xc(t,e,i){var s=t.pingCache;if(s===null){s=t.pingCache=new Vt;var h=new Set;s.set(e,h)}else h=s.get(e),h===void 0&&(h=new Set,s.set(e,h));h.has(i)||(To=!0,h.add(i),t=a.bind(null,t,e,i),e.then(t,t))}function a(t,e,i){var s=t.pingCache;s!==null&&s.delete(e),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,qt===t&&(Kt&i)===i&&(je===4||je===3&&(Kt&62914560)===Kt&&300>za()-rs?(zt&2)===0&&Ai(t,0):yc|=i,Ae===Kt&&(Ae=0)),rt(t)}function n(t,e){e===0&&(e=kn()),t=Ya(t,e),t!==null&&(Mu(t,e),rt(t))}function c(t){var e=t.memoizedState,i=0;e!==null&&(i=e.retryLane),n(t,i)}function o(t,e){var i=0;switch(t.tag){case 31:case 13:var s=t.stateNode,h=t.memoizedState;h!==null&&(i=h.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(f(314))}s!==null&&s.delete(e),n(t,i)}function v(t,e){return Wn(t,e)}var S=null,T=null,G=!1,P=!1,st=!1,mt=0;function rt(t){t!==T&&t.next===null&&(T===null?S=T=t:T=T.next=t),P=!0,G||(G=!0,q())}function _t(t,e){if(!st&&P){st=!0;do for(var i=!1,s=S;s!==null;){if(t!==0){var h=s.pendingLanes;if(h===0)var g=0;else{var b=s.suspendedLanes,z=s.pingedLanes;g=(1<<31-ll(42|t)+1)-1,g&=h&~(b&~z),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(i=!0,w(s,g))}else g=Kt,g=Yi(s,s===qt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(g&3)===0||zu(s,g)||(i=!0,w(s,g));s=s.next}while(i);st=!1}}function Lt(){va()}function va(){P=G=!1;var t=0;mt!==0&&k3()&&(t=mt);for(var e=za(),i=null,s=S;s!==null;){var h=s.next,g=vs(s,e);g===0?(s.next=null,i===null?S=h:i.next=h,h===null&&(T=i)):(i=s,(t!==0||(g&3)!==0)&&(P=!0)),s=h}pe!==0&&pe!==5||_t(t),mt!==0&&(mt=0)}function vs(t,e){for(var i=t.suspendedLanes,s=t.pingedLanes,h=t.expirationTimes,g=t.pendingLanes&-62914561;0z)break;var at=D.transferSize,nt=D.initiatorType;at&&B1(nt)&&(D=D.responseEnd,b+=at*(D"u"?null:document;function W1(t,e,i){var s=Wf;if(s&&typeof e=="string"&&e){var h=Oa(e);h='link[rel="'+t+'"][href="'+h+'"]',typeof i=="string"&&(h+='[crossorigin="'+i+'"]'),J1.has(h)||(J1.add(h),t={rel:t,crossOrigin:i,href:e},s.querySelector(h)===null&&(e=s.createElement("link"),Ka(e,"link",t),ea(e),s.head.appendChild(e)))}}function im(t){pu.D(t),W1("dns-prefetch",t,null)}function um(t,e){pu.C(t,e),W1("preconnect",t,e)}function sm(t,e,i){pu.L(t,e,i);var s=Wf;if(s&&t&&e){var h='link[rel="preload"][as="'+Oa(e)+'"]';e==="image"&&i&&i.imageSrcSet?(h+='[imagesrcset="'+Oa(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(h+='[imagesizes="'+Oa(i.imageSizes)+'"]')):h+='[href="'+Oa(t)+'"]';var g=h;switch(e){case"style":g=Ff(t);break;case"script":g=kf(t)}vn.has(g)||(t=C({rel:"preload",href:e==="image"&&i&&i.imageSrcSet?void 0:t,as:e},i),vn.set(g,t),s.querySelector(h)!==null||e==="style"&&s.querySelector(No(g))||e==="script"&&s.querySelector(Oo(g))||(e=s.createElement("link"),Ka(e,"link",t),ea(e),s.head.appendChild(e)))}}function cm(t,e){pu.m(t,e);var i=Wf;if(i&&t){var s=e&&typeof e.as=="string"?e.as:"script",h='link[rel="modulepreload"][as="'+Oa(s)+'"][href="'+Oa(t)+'"]',g=h;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=kf(t)}if(!vn.has(g)&&(t=C({rel:"modulepreload",href:t},e),vn.set(g,t),i.querySelector(h)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Oo(g)))return}s=i.createElement("link"),Ka(s,"link",t),ea(s),i.head.appendChild(s)}}}function fm(t,e,i){pu.S(t,e,i);var s=Wf;if(s&&t){var h=ti(s).hoistableStyles,g=Ff(t);e=e||"default";var b=h.get(g);if(!b){var z={loading:0,preload:null};if(b=s.querySelector(No(g)))z.loading=5;else{t=C({rel:"stylesheet",href:t,"data-precedence":e},i),(i=vn.get(g))&&qd(t,i);var D=b=s.createElement("link");ea(D),Ka(D,"link",t),D._p=new Promise(function(Q,at){D.onload=Q,D.onerror=at}),D.addEventListener("load",function(){z.loading|=1}),D.addEventListener("error",function(){z.loading|=2}),z.loading|=4,D0(b,e,s)}b={type:"stylesheet",instance:b,count:1,state:z},h.set(g,b)}}}function rm(t,e){pu.X(t,e);var i=Wf;if(i&&t){var s=ti(i).hoistableScripts,h=kf(t),g=s.get(h);g||(g=i.querySelector(Oo(h)),g||(t=C({src:t,async:!0},e),(e=vn.get(h))&&jd(t,e),g=i.createElement("script"),ea(g),Ka(g,"link",t),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},s.set(h,g))}}function om(t,e){pu.M(t,e);var i=Wf;if(i&&t){var s=ti(i).hoistableScripts,h=kf(t),g=s.get(h);g||(g=i.querySelector(Oo(h)),g||(t=C({src:t,async:!0,type:"module"},e),(e=vn.get(h))&&jd(t,e),g=i.createElement("script"),ea(g),Ka(g,"link",t),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},s.set(h,g))}}function F1(t,e,i,s){var h=(h=Xt.current)?R0(h):null;if(!h)throw Error(f(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(e=Ff(i.href),i=ti(h).hoistableStyles,s=i.get(e),s||(s={type:"style",instance:null,count:0,state:null},i.set(e,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=Ff(i.href);var g=ti(h).hoistableStyles,b=g.get(t);if(b||(h=h.ownerDocument||h,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(t,b),(g=h.querySelector(No(t)))&&!g._p&&(b.instance=g,b.state.loading=5),vn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},vn.set(t,i),g||hm(h,t,i,b.state))),e&&s===null)throw Error(f(528,""));return b}if(e&&s!==null)throw Error(f(529,""));return null;case"script":return e=i.async,i=i.src,typeof i=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=kf(i),i=ti(h).hoistableScripts,s=i.get(e),s||(s={type:"script",instance:null,count:0,state:null},i.set(e,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(f(444,t))}}function Ff(t){return'href="'+Oa(t)+'"'}function No(t){return'link[rel="stylesheet"]['+t+"]"}function k1(t){return C({},t,{"data-precedence":t.precedence,precedence:null})}function hm(t,e,i,s){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?s.loading=1:(e=t.createElement("link"),s.preload=e,e.addEventListener("load",function(){return s.loading|=1}),e.addEventListener("error",function(){return s.loading|=2}),Ka(e,"link",i),ea(e),t.head.appendChild(e))}function kf(t){return'[src="'+Oa(t)+'"]'}function Oo(t){return"script[async]"+t}function P1(t,e,i){if(e.count++,e.instance===null)switch(e.type){case"style":var s=t.querySelector('style[data-href~="'+Oa(i.href)+'"]');if(s)return e.instance=s,ea(s),s;var h=C({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(t.ownerDocument||t).createElement("style"),ea(s),Ka(s,"style",h),D0(s,i.precedence,t),e.instance=s;case"stylesheet":h=Ff(i.href);var g=t.querySelector(No(h));if(g)return e.state.loading|=4,e.instance=g,ea(g),g;s=k1(i),(h=vn.get(h))&&qd(s,h),g=(t.ownerDocument||t).createElement("link"),ea(g);var b=g;return b._p=new Promise(function(z,D){b.onload=z,b.onerror=D}),Ka(g,"link",s),e.state.loading|=4,D0(g,i.precedence,t),e.instance=g;case"script":return g=kf(i.src),(h=t.querySelector(Oo(g)))?(e.instance=h,ea(h),h):(s=i,(h=vn.get(g))&&(s=C({},i),jd(s,h)),t=t.ownerDocument||t,h=t.createElement("script"),ea(h),Ka(h,"link",s),t.head.appendChild(h),e.instance=h);case"void":return null;default:throw Error(f(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(s=e.instance,e.state.loading|=4,D0(s,i.precedence,t));return e.instance}function D0(t,e,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=s.length?s[s.length-1]:null,g=h,b=0;b title"):null)}function dm(t,e,i){if(i===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;switch(e.rel){case"stylesheet":return t=e.disabled,typeof e.precedence=="string"&&t==null;default:return!0}case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function t2(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function mm(t,e,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var h=Ff(s.href),g=e.querySelector(No(h));if(g){e=g._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=H0.bind(t),e.then(t,t)),i.state.loading|=4,i.instance=g,ea(g);return}g=e.ownerDocument||e,s=k1(s),(h=vn.get(h))&&qd(s,h),g=g.createElement("link"),ea(g);var b=g;b._p=new Promise(function(z,D){b.onload=z,b.onerror=D}),Ka(g,"link",s),i.instance=g}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,e),(e=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=H0.bind(t),e.addEventListener("load",i),e.addEventListener("error",i))}}var Ld=0;function gm(t,e){return t.stylesheets&&t.count===0&&B0(t,t.stylesheets),0Ld?50:800)+e);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(s),clearTimeout(h)}}:null}function H0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)B0(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var U0=null;function B0(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,U0=new Map,e.forEach(pm,t),U0=null,H0.call(t))}function pm(t,e){if(!(e.state.loading&4)){var i=U0.get(t);if(i)var s=i.get(null);else{i=new Map,U0.set(t,i);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d)}catch(l){console.error(l)}}return d(),Fd.exports=Rm(),Fd.exports}var Gm=Dm();const Hm=ud(Gm);/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Um=d=>d.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Bm=d=>d.replace(/^([A-Z])|[\s-_]+(\w)/g,(l,u,f)=>f?f.toUpperCase():u.toLowerCase()),T2=d=>{const l=Bm(d);return l.charAt(0).toUpperCase()+l.slice(1)},i3=(...d)=>d.filter((l,u,f)=>!!l&&l.trim()!==""&&f.indexOf(l)===u).join(" ").trim(),Ym=d=>{for(const l in d)if(l.startsWith("aria-")||l==="role"||l==="title")return!0};/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var qm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jm=de.forwardRef(({color:d="currentColor",size:l=24,strokeWidth:u=2,absoluteStrokeWidth:f,className:r="",children:m,iconNode:p,...y},_)=>de.createElement("svg",{ref:_,...qm,width:l,height:l,stroke:d,strokeWidth:f?Number(u)*24/Number(l):u,className:i3("lucide",r),...!m&&!Ym(y)&&{"aria-hidden":"true"},...y},[...p.map(([E,x])=>de.createElement(E,x)),...Array.isArray(m)?m:[m]]));/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Oi=(d,l)=>{const u=de.forwardRef(({className:f,...r},m)=>de.createElement(jm,{ref:m,iconNode:l,className:i3(`lucide-${Um(T2(d))}`,`lucide-${d}`,f),...r}));return u.displayName=T2(d),u};/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Lm=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Xm=Oi("copy",Lm);/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qm=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Vm=Oi("download",Qm);/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zm=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Km=Oi("house",Zm);/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wm=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],Jm=Oi("image-plus",wm);/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wm=[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]],Fm=Oi("mouse-pointer-2",Wm);/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const km=[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]],Pm=Oi("move-right",km);/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Im=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],$m=Oi("square",Im);/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const t4=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],e4=Oi("trash-2",t4);/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a4=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],l4=Oi("type",a4);/** - * @license lucide-react v0.556.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const n4=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],C2=Oi("upload",n4),i4=({currentTool:d,setTool:l,onExport:u,onCopy:f,onClear:r,hasImage:m,onDeleteSelected:p,hasSelection:y})=>{const _=[{id:"select",icon:Fm,label:"Select"},{id:"rect",icon:$m,label:"Box"},{id:"arrow",icon:Pm,label:"Arrow"},{id:"text",icon:l4,label:"Text"}];return gt.jsxs("div",{className:"bg-amber-100 border-r-4 border-amber-900 w-20 flex flex-col items-center py-6 gap-4 z-20 shrink-0",children:[gt.jsx("div",{className:"flex flex-col gap-3 w-full px-2",children:_.map(E=>gt.jsx("button",{onClick:()=>l(E.id),className:`p-3 rounded-none border-2 transition-all duration-200 flex flex-col items-center justify-center group relative shadow-[4px_4px_0px_0px_rgba(69,26,3,0.3)] hover:translate-x-[1px] hover:translate-y-[1px] hover:shadow-[3px_3px_0px_0px_rgba(69,26,3,0.3)] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none ${d===E.id?"bg-cyan-400 border-black text-black":"bg-white border-amber-900 text-amber-900 hover:bg-amber-50"}`,title:E.label,children:gt.jsx(E.icon,{size:24,strokeWidth:2.5})},E.id))}),gt.jsx("div",{className:"h-1 w-12 bg-amber-900/20 my-2 rounded-full"}),gt.jsxs("div",{className:"flex flex-col gap-3 w-full px-2",children:[gt.jsx("button",{onClick:p,disabled:!y,className:`p-3 border-2 rounded-none transition-all duration-200 flex flex-col items-center justify-center group relative shadow-[4px_4px_0px_0px_rgba(190,24,93,0.3)] hover:translate-x-[1px] hover:translate-y-[1px] hover:shadow-[3px_3px_0px_0px_rgba(190,24,93,0.3)] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none ${y?"bg-pink-400 border-black text-black hover:bg-pink-300":"bg-gray-100 border-gray-400 text-gray-400 cursor-not-allowed shadow-none"}`,title:"Delete Selected",children:gt.jsx(e4,{size:24,strokeWidth:2.5})}),gt.jsx("button",{onClick:r,disabled:!m,className:"p-3 border-2 rounded-none bg-white border-amber-900 text-amber-900 hover:bg-red-50 hover:text-red-700 hover:border-red-700 transition-all duration-200 flex flex-col items-center justify-center group relative shadow-[4px_4px_0px_0px_rgba(69,26,3,0.3)] hover:shadow-[3px_3px_0px_0px_rgba(69,26,3,0.3)] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none",title:"Clear All",children:gt.jsx(Jm,{size:24,strokeWidth:2.5})}),gt.jsxs("div",{className:"mt-auto flex flex-col gap-3 w-full",children:[gt.jsx("button",{onClick:f,disabled:!m,className:"p-3 border-2 rounded-none bg-violet-400 border-black text-black hover:bg-violet-300 transition-all duration-200 flex flex-col items-center justify-center group relative shadow-[4px_4px_0px_0px_rgba(69,26,3,0.3)] hover:translate-x-[1px] hover:translate-y-[1px] hover:shadow-[3px_3px_0px_0px_rgba(69,26,3,0.3)] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none",title:"Copy to Clipboard",children:gt.jsx(Xm,{size:24,strokeWidth:2.5})}),gt.jsx("button",{onClick:u,disabled:!m,className:"p-3 border-2 rounded-none bg-lime-400 border-black text-black hover:bg-lime-300 transition-all duration-200 flex flex-col items-center justify-center group relative shadow-[4px_4px_0px_0px_rgba(69,26,3,0.3)] hover:translate-x-[1px] hover:translate-y-[1px] hover:shadow-[3px_3px_0px_0px_rgba(69,26,3,0.3)] active:translate-x-[4px] active:translate-y-[4px] active:shadow-none disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none",title:"Export PNG",children:gt.jsx(Vm,{size:24,strokeWidth:2.5})})]})]})]})},u4=["#be185d","#0891b2","#65a30d","#d97706","#451a03","#ffffff","#FFFF00"],s4=[2,4,6,8],c4=[16,24,32,48,64],f4=({selectedShape:d,updateShape:l})=>d?gt.jsxs("div",{className:"w-72 bg-amber-100 border-l-4 border-amber-900 p-6 flex flex-col gap-8 overflow-y-auto shrink-0 font-comic",children:[gt.jsx("div",{className:"border-b-2 border-amber-900/20 pb-4",children:gt.jsxs("h2",{className:"font-impact text-2xl text-amber-900 uppercase tracking-wide",children:["Edit ",d.type]})}),gt.jsxs("div",{children:[gt.jsxs("h3",{className:"text-sm font-bold text-amber-900 uppercase tracking-wider mb-3 flex items-center gap-2",children:["Color ",gt.jsx("span",{className:"text-xs bg-amber-200 px-1 border border-amber-900 rounded-sm text-amber-900 font-normal normal-case",children:"Pick one"})]}),gt.jsx("div",{className:"grid grid-cols-6 gap-3",children:u4.map(u=>gt.jsx("button",{onClick:()=>l(d.id,{stroke:u,fill:d.type==="text"?u:void 0}),className:`w-8 h-8 rounded-full border-2 focus:outline-none transition-transform hover:scale-110 ${d.stroke===u?"ring-2 ring-offset-2 ring-amber-900 border-black scale-110":"border-amber-900/30 hover:border-amber-900"}`,style:{backgroundColor:u},title:u},u))})]}),(d.type==="rect"||d.type==="arrow")&>.jsxs("div",{children:[gt.jsx("h3",{className:"text-sm font-bold text-amber-900 uppercase tracking-wider mb-3",children:"Thickness"}),gt.jsx("div",{className:"flex gap-2 bg-amber-50 p-2 border-2 border-amber-900 shadow-[2px_2px_0px_0px_rgba(69,26,3,0.1)]",children:s4.map(u=>gt.jsx("button",{onClick:()=>l(d.id,{strokeWidth:u}),className:`flex-1 py-1 text-sm font-bold border-2 transition-all ${d.strokeWidth===u?"bg-amber-900 text-white border-black shadow-sm":"bg-white text-amber-900 border-transparent hover:border-amber-200"}`,children:u},u))})]}),d.type==="text"&>.jsxs(gt.Fragment,{children:[gt.jsxs("div",{children:[gt.jsx("h3",{className:"text-sm font-bold text-amber-900 uppercase tracking-wider mb-3",children:"Size"}),gt.jsx("select",{value:d.fontSize,onChange:u=>l(d.id,{fontSize:Number(u.target.value)}),className:"w-full bg-white border-2 border-amber-900 text-amber-900 font-bold p-2 shadow-[4px_4px_0px_0px_rgba(69,26,3,0.1)] focus:outline-none focus:shadow-[2px_2px_0px_0px_rgba(69,26,3,0.1)] focus:translate-x-[2px] focus:translate-y-[2px]",children:c4.map(u=>gt.jsxs("option",{value:u,children:[u,"px"]},u))})]}),gt.jsxs("div",{children:[gt.jsx("h3",{className:"text-sm font-bold text-amber-900 uppercase tracking-wider mb-3",children:"Text"}),gt.jsx("textarea",{rows:4,value:d.text,onChange:u=>l(d.id,{text:u.target.value}),className:"w-full bg-white border-2 border-amber-900 text-amber-900 p-2 font-comic shadow-[4px_4px_0px_0px_rgba(69,26,3,0.1)] focus:outline-none focus:shadow-[2px_2px_0px_0px_rgba(69,26,3,0.1)] focus:translate-x-[2px] focus:translate-y-[2px]"})]})]}),d.type==="rect"&>.jsxs("div",{children:[gt.jsx("h3",{className:"text-sm font-bold text-amber-900 uppercase tracking-wider mb-3",children:"Fill"}),gt.jsxs("div",{className:"flex flex-col gap-2",children:[gt.jsxs("button",{onClick:()=>l(d.id,{fill:"transparent"}),className:`px-3 py-2 text-sm font-bold border-2 text-left flex items-center gap-2 ${d.fill==="transparent"?"bg-white border-amber-900 text-amber-900 shadow-[2px_2px_0px_0px_rgba(69,26,3,0.2)]":"border-transparent text-amber-800/70 hover:bg-amber-200/50"}`,children:[gt.jsx("div",{className:"w-4 h-4 border border-amber-900 bg-white"}),"Empty (Transparent)"]}),gt.jsxs("button",{onClick:()=>l(d.id,{fill:d.stroke+"40"}),className:`px-3 py-2 text-sm font-bold border-2 text-left flex items-center gap-2 ${d.fill!=="transparent"?"bg-white border-amber-900 text-amber-900 shadow-[2px_2px_0px_0px_rgba(69,26,3,0.2)]":"border-transparent text-amber-800/70 hover:bg-amber-200/50"}`,children:[gt.jsx("div",{className:"w-4 h-4 border border-amber-900 bg-current opacity-40"}),"Filled (Transparent)"]})]})]})]}):gt.jsxs("div",{className:"w-72 bg-amber-100 border-l-4 border-amber-900 p-6 flex flex-col items-center justify-center text-center text-amber-800/60 font-comic shrink-0",children:[gt.jsx("span",{className:"text-4xl mb-4 opacity-50",children:"👆"}),gt.jsx("p",{className:"font-bold text-lg",children:"Select something!"}),gt.jsx("p",{className:"text-sm",children:"Click an item to tweak it."})]}),r4=Math.PI/180;function o4(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Cc=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},yt={_global:Cc,version:"10.0.12",isBrowser:o4(),isUnminified:/param/.test((function(d){}).toString()),dblClickWindow:400,getAngle(d){return yt.angleDeg?d*r4:d},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,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return yt.DD.isDragging},isTransforming(){var d,l;return(l=(d=yt.Transformer)===null||d===void 0?void 0:d.isTransforming())!==null&&l!==void 0?l:!1},isDragReady(){return!!yt.DD.node},releaseCanvasOnDestroy:!0,document:Cc.document,_injectGlobal(d){typeof Cc.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),Cc.Konva=d}},$e=d=>{yt[d.prototype.getClassName()]=d};yt._injectGlobal(yt);const h4=`Konva.js unsupported environment. - -Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined. - -To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module. - -bash: npm install canvas -js: import "konva/canvas-backend"; - -or - -bash: npm install skia-canvas -js: import "konva/skia-backend"; -`,A2=()=>{if(typeof document>"u")throw new Error(h4)};class Xl{constructor(l=[1,0,0,1,0,0]){this.dirty=!1,this.m=l&&l.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 Xl(this.m)}copyInto(l){l.m[0]=this.m[0],l.m[1]=this.m[1],l.m[2]=this.m[2],l.m[3]=this.m[3],l.m[4]=this.m[4],l.m[5]=this.m[5]}point(l){const u=this.m;return{x:u[0]*l.x+u[2]*l.y+u[4],y:u[1]*l.x+u[3]*l.y+u[5]}}translate(l,u){return this.m[4]+=this.m[0]*l+this.m[2]*u,this.m[5]+=this.m[1]*l+this.m[3]*u,this}scale(l,u){return this.m[0]*=l,this.m[1]*=l,this.m[2]*=u,this.m[3]*=u,this}rotate(l){const u=Math.cos(l),f=Math.sin(l),r=this.m[0]*u+this.m[2]*f,m=this.m[1]*u+this.m[3]*f,p=this.m[0]*-f+this.m[2]*u,y=this.m[1]*-f+this.m[3]*u;return this.m[0]=r,this.m[1]=m,this.m[2]=p,this.m[3]=y,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(l,u){const f=this.m[0]+this.m[2]*u,r=this.m[1]+this.m[3]*u,m=this.m[2]+this.m[0]*l,p=this.m[3]+this.m[1]*l;return this.m[0]=f,this.m[1]=r,this.m[2]=m,this.m[3]=p,this}multiply(l){const u=this.m[0]*l.m[0]+this.m[2]*l.m[1],f=this.m[1]*l.m[0]+this.m[3]*l.m[1],r=this.m[0]*l.m[2]+this.m[2]*l.m[3],m=this.m[1]*l.m[2]+this.m[3]*l.m[3],p=this.m[0]*l.m[4]+this.m[2]*l.m[5]+this.m[4],y=this.m[1]*l.m[4]+this.m[3]*l.m[5]+this.m[5];return this.m[0]=u,this.m[1]=f,this.m[2]=r,this.m[3]=m,this.m[4]=p,this.m[5]=y,this}invert(){const l=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),u=this.m[3]*l,f=-this.m[1]*l,r=-this.m[2]*l,m=this.m[0]*l,p=l*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),y=l*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=u,this.m[1]=f,this.m[2]=r,this.m[3]=m,this.m[4]=p,this.m[5]=y,this}getMatrix(){return this.m}decompose(){const l=this.m[0],u=this.m[1],f=this.m[2],r=this.m[3],m=this.m[4],p=this.m[5],y=l*r-u*f,_={x:m,y:p,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(l!=0||u!=0){const E=Math.sqrt(l*l+u*u);_.rotation=u>0?Math.acos(l/E):-Math.acos(l/E),_.scaleX=E,_.scaleY=y/E,_.skewX=(l*f+u*r)/y,_.skewY=0}else if(f!=0||r!=0){const E=Math.sqrt(f*f+r*r);_.rotation=Math.PI/2-(r>0?Math.acos(-f/E):-Math.acos(f/E)),_.scaleX=y/E,_.scaleY=E,_.skewX=0,_.skewY=(l*f+u*r)/y}return _.rotation=j._getRotation(_.rotation),_}}const d4="[object Array]",m4="[object Number]",g4="[object String]",p4="[object Boolean]",v4=Math.PI/180,y4=180/Math.PI,Yo="#",S4="",_4="0",b4="Konva warning: ",z2="Konva error: ",E4="rgb(",$d={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]},x4=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let Z0=[],qo=null;const T4=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(d){setTimeout(d,60)},j={_isElement(d){return!!(d&&d.nodeType==1)},_isFunction(d){return!!(d&&d.constructor&&d.call&&d.apply)},_isPlainObject(d){return!!d&&d.constructor===Object},_isArray(d){return Object.prototype.toString.call(d)===d4},_isNumber(d){return Object.prototype.toString.call(d)===m4&&!isNaN(d)&&isFinite(d)},_isString(d){return Object.prototype.toString.call(d)===g4},_isBoolean(d){return Object.prototype.toString.call(d)===p4},isObject(d){return d instanceof Object},isValidSelector(d){if(typeof d!="string")return!1;const l=d[0];return l==="#"||l==="."||l===l.toUpperCase()},_sign(d){return d===0||d>0?1:-1},requestAnimFrame(d){Z0.push(d),Z0.length===1&&T4(function(){const l=Z0;Z0=[],l.forEach(function(u){u()})})},createCanvasElement(){A2();const d=document.createElement("canvas");try{d.style=d.style||{}}catch{}return d},createImageElement(){return A2(),document.createElement("img")},_isInDocument(d){for(;d=d.parentNode;)if(d==document)return!0;return!1},_urlToImage(d,l){const u=j.createImageElement();u.onload=function(){l(u)},u.src=d},_rgbToHex(d,l,u){return((1<<24)+(d<<16)+(l<<8)+u).toString(16).slice(1)},_hexToRgb(d){d=d.replace(Yo,S4);const l=parseInt(d,16);return{r:l>>16&255,g:l>>8&255,b:l&255}},getRandomColor(){let d=(Math.random()*16777215<<0).toString(16);for(;d.length<6;)d=_4+d;return Yo+d},isCanvasFarblingActive(){if(qo!==null)return qo;if(typeof document>"u")return qo=!1,!1;const d=this.createCanvasElement();d.width=10,d.height=10;const l=d.getContext("2d",{willReadFrequently:!0});l.clearRect(0,0,10,10),l.fillStyle="#282828",l.fillRect(0,0,10,10);const u=l.getImageData(0,0,10,10).data;let f=!1;for(let r=0;r<100;r++)if(u[r*4]!==40||u[r*4+1]!==40||u[r*4+2]!==40||u[r*4+3]!==255){f=!0;break}return qo=f,this.releaseCanvas(d),qo},getHitColor(){const d=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(d):d},getHitColorKey(d,l,u){return this.isCanvasFarblingActive()&&(d=Math.round(d/5)*5,l=Math.round(l/5)*5,u=Math.round(u/5)*5),Yo+this._rgbToHex(d,l,u)},getSnappedHexColor(d){const l=this._hexToRgb(d);return Yo+this._rgbToHex(Math.round(l.r/5)*5,Math.round(l.g/5)*5,Math.round(l.b/5)*5)},getRGB(d){let l;return d in $d?(l=$d[d],{r:l[0],g:l[1],b:l[2]}):d[0]===Yo?this._hexToRgb(d.substring(1)):d.substr(0,4)===E4?(l=x4.exec(d.replace(/ /g,"")),{r:parseInt(l[1],10),g:parseInt(l[2],10),b:parseInt(l[3],10)}):{r:0,g:0,b:0}},colorToRGBA(d){return d=d||"black",j._namedColorToRBA(d)||j._hex3ColorToRGBA(d)||j._hex4ColorToRGBA(d)||j._hex6ColorToRGBA(d)||j._hex8ColorToRGBA(d)||j._rgbColorToRGBA(d)||j._rgbaColorToRGBA(d)||j._hslColorToRGBA(d)},_namedColorToRBA(d){const l=$d[d.toLowerCase()];return l?{r:l[0],g:l[1],b:l[2],a:1}:null},_rgbColorToRGBA(d){if(d.indexOf("rgb(")===0){d=d.match(/rgb\(([^)]+)\)/)[1];const l=d.split(/ *, */).map(Number);return{r:l[0],g:l[1],b:l[2],a:1}}},_rgbaColorToRGBA(d){if(d.indexOf("rgba(")===0){d=d.match(/rgba\(([^)]+)\)/)[1];const l=d.split(/ *, */).map((u,f)=>u.slice(-1)==="%"?f===3?parseInt(u)/100:parseInt(u)/100*255:Number(u));return{r:l[0],g:l[1],b:l[2],a:l[3]}}},_hex8ColorToRGBA(d){if(d[0]==="#"&&d.length===9)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:parseInt(d.slice(7,9),16)/255}},_hex6ColorToRGBA(d){if(d[0]==="#"&&d.length===7)return{r:parseInt(d.slice(1,3),16),g:parseInt(d.slice(3,5),16),b:parseInt(d.slice(5,7),16),a:1}},_hex4ColorToRGBA(d){if(d[0]==="#"&&d.length===5)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:parseInt(d[4]+d[4],16)/255}},_hex3ColorToRGBA(d){if(d[0]==="#"&&d.length===4)return{r:parseInt(d[1]+d[1],16),g:parseInt(d[2]+d[2],16),b:parseInt(d[3]+d[3],16),a:1}},_hslColorToRGBA(d){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(d)){const[l,...u]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(d),f=Number(u[0])/360,r=Number(u[1])/100,m=Number(u[2])/100;let p,y,_;if(r===0)return _=m*255,{r:Math.round(_),g:Math.round(_),b:Math.round(_),a:1};m<.5?p=m*(1+r):p=m+r-m*r;const E=2*m-p,x=[0,0,0];for(let C=0;C<3;C++)y=f+1/3*-(C-1),y<0&&y++,y>1&&y--,6*y<1?_=E+(p-E)*6*y:2*y<1?_=p:3*y<2?_=E+(p-E)*(2/3-y)*6:_=E,x[C]=_*255;return{r:Math.round(x[0]),g:Math.round(x[1]),b:Math.round(x[2]),a:1}}},haveIntersection(d,l){return!(l.x>d.x+d.width||l.x+l.widthd.y+d.height||l.y+l.height1?(p=u,y=f,_=(u-r)*(u-r)+(f-m)*(f-m)):(p=d+x*(u-d),y=l+x*(f-l),_=(p-r)*(p-r)+(y-m)*(y-m))}return[p,y,_]},_getProjectionToLine(d,l,u){const f=j.cloneObject(d);let r=Number.MAX_VALUE;return l.forEach(function(m,p){if(!u&&p===l.length-1)return;const y=l[(p+1)%l.length],_=j._getProjectionToSegment(m.x,m.y,y.x,y.y,d.x,d.y),E=_[0],x=_[1],C=_[2];Cl.length){const p=l;l=d,d=p}for(let p=0;p{l.width=0,l.height=0})},drawRoundedRectPath(d,l,u,f){let r=l<0?l:0,m=u<0?u:0;l=Math.abs(l),u=Math.abs(u);let p=0,y=0,_=0,E=0;typeof f=="number"?p=y=_=E=Math.min(f,l/2,u/2):(p=Math.min(f[0]||0,l/2,u/2),y=Math.min(f[1]||0,l/2,u/2),E=Math.min(f[2]||0,l/2,u/2),_=Math.min(f[3]||0,l/2,u/2)),d.moveTo(r+p,m),d.lineTo(r+l-y,m),d.arc(r+l-y,m+y,y,Math.PI*3/2,0,!1),d.lineTo(r+l,m+u-E),d.arc(r+l-E,m+u-E,E,0,Math.PI/2,!1),d.lineTo(r+_,m+u),d.arc(r+_,m+u-_,_,Math.PI/2,Math.PI,!1),d.lineTo(r,m+p),d.arc(r+p,m+p,p,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(d,l,u,f,r){f=Math.abs(f);for(let m=0;mtypeof x=="number"?Math.floor(x):x)),m+=A4+E.join(M2)+z4)):(m+=y.property,l||(m+=D4+y.val)),m+=O4;return m}clearTrace(){this.traceArr=[]}_trace(l){let u=this.traceArr,f;u.push(l),f=u.length,f>=H4&&u.shift()}reset(){const l=this.getCanvas().getPixelRatio();this.setTransform(1*l,0,0,1*l,0,0)}getCanvas(){return this.canvas}clear(l){const u=this.getCanvas();l?this.clearRect(l.x||0,l.y||0,l.width||0,l.height||0):this.clearRect(0,0,u.getWidth()/u.pixelRatio,u.getHeight()/u.pixelRatio)}_applyLineCap(l){const u=l.attrs.lineCap;u&&this.setAttr("lineCap",u)}_applyOpacity(l){const u=l.getAbsoluteOpacity();u!==1&&this.setAttr("globalAlpha",u)}_applyLineJoin(l){const u=l.attrs.lineJoin;u&&this.setAttr("lineJoin",u)}_applyMiterLimit(l){const u=l.attrs.miterLimit;u!=null&&this.setAttr("miterLimit",u)}setAttr(l,u){this._context[l]=u}arc(l,u,f,r,m,p){this._context.arc(l,u,f,r,m,p)}arcTo(l,u,f,r,m){this._context.arcTo(l,u,f,r,m)}beginPath(){this._context.beginPath()}bezierCurveTo(l,u,f,r,m,p){this._context.bezierCurveTo(l,u,f,r,m,p)}clearRect(l,u,f,r){this._context.clearRect(l,u,f,r)}clip(...l){this._context.clip.apply(this._context,l)}closePath(){this._context.closePath()}createImageData(l,u){const f=arguments;if(f.length===2)return this._context.createImageData(l,u);if(f.length===1)return this._context.createImageData(l)}createLinearGradient(l,u,f,r){return this._context.createLinearGradient(l,u,f,r)}createPattern(l,u){return this._context.createPattern(l,u)}createRadialGradient(l,u,f,r,m,p){return this._context.createRadialGradient(l,u,f,r,m,p)}drawImage(l,u,f,r,m,p,y,_,E){const x=arguments,C=this._context;x.length===3?C.drawImage(l,u,f):x.length===5?C.drawImage(l,u,f,r,m):x.length===9&&C.drawImage(l,u,f,r,m,p,y,_,E)}ellipse(l,u,f,r,m,p,y,_){this._context.ellipse(l,u,f,r,m,p,y,_)}isPointInPath(l,u,f,r){return f?this._context.isPointInPath(f,l,u,r):this._context.isPointInPath(l,u,r)}fill(...l){this._context.fill.apply(this._context,l)}fillRect(l,u,f,r){this._context.fillRect(l,u,f,r)}strokeRect(l,u,f,r){this._context.strokeRect(l,u,f,r)}fillText(l,u,f,r){r?this._context.fillText(l,u,f,r):this._context.fillText(l,u,f)}measureText(l){return this._context.measureText(l)}getImageData(l,u,f,r){return this._context.getImageData(l,u,f,r)}lineTo(l,u){this._context.lineTo(l,u)}moveTo(l,u){this._context.moveTo(l,u)}rect(l,u,f,r){this._context.rect(l,u,f,r)}roundRect(l,u,f,r,m){this._context.roundRect(l,u,f,r,m)}putImageData(l,u,f){this._context.putImageData(l,u,f)}quadraticCurveTo(l,u,f,r){this._context.quadraticCurveTo(l,u,f,r)}restore(){this._context.restore()}rotate(l){this._context.rotate(l)}save(){this._context.save()}scale(l,u){this._context.scale(l,u)}setLineDash(l){this._context.setLineDash?this._context.setLineDash(l):"mozDash"in this._context?this._context.mozDash=l:"webkitLineDash"in this._context&&(this._context.webkitLineDash=l)}getLineDash(){return this._context.getLineDash()}setTransform(l,u,f,r,m,p){this._context.setTransform(l,u,f,r,m,p)}stroke(l){l?this._context.stroke(l):this._context.stroke()}strokeText(l,u,f,r){this._context.strokeText(l,u,f,r)}transform(l,u,f,r,m,p){this._context.transform(l,u,f,r,m,p)}translate(l,u){this._context.translate(l,u)}_enableTrace(){let l=this,u=N2.length,f=this.setAttr,r,m;const p=function(y){let _=l[y],E;l[y]=function(){return m=C4(Array.prototype.slice.call(arguments,0)),E=_.apply(l,arguments),l._trace({method:y,args:m}),E}};for(r=0;r{l.dragStatus==="dragging"&&(d=!0)}),d},justDragged:!1,get node(){let d;return ye._dragElements.forEach(l=>{d=l.node}),d},_dragElements:new Map,_drag(d){const l=[];ye._dragElements.forEach((u,f)=>{const{node:r}=u,m=r.getStage();m.setPointersPositions(d),u.pointerId===void 0&&(u.pointerId=j._getFirstPointerId(d));const p=m._changedPointerPositions.find(y=>y.id===u.pointerId);if(p){if(u.dragStatus!=="dragging"){const y=r.dragDistance();if(Math.max(Math.abs(p.x-u.startPointerPos.x),Math.abs(p.y-u.startPointerPos.y)){u.fire("dragmove",{type:"dragmove",target:u,evt:d},!0)})},_endDragBefore(d){const l=[];ye._dragElements.forEach(u=>{const{node:f}=u,r=f.getStage();if(d&&r.setPointersPositions(d),!r._changedPointerPositions.find(y=>y.id===u.pointerId))return;(u.dragStatus==="dragging"||u.dragStatus==="stopped")&&(ye.justDragged=!0,yt._mouseListenClick=!1,yt._touchListenClick=!1,yt._pointerListenClick=!1,u.dragStatus="stopped");const p=u.node.getLayer()||u.node instanceof yt.Stage&&u.node;p&&l.indexOf(p)===-1&&l.push(p)}),l.forEach(u=>{u.draw()})},_endDragAfter(d){ye._dragElements.forEach((l,u)=>{l.dragStatus==="stopped"&&l.node.fire("dragend",{type:"dragend",target:l.node,evt:d},!0),l.dragStatus!=="dragging"&&ye._dragElements.delete(u)})}};yt.isBrowser&&(window.addEventListener("mouseup",ye._endDragBefore,!0),window.addEventListener("touchend",ye._endDragBefore,!0),window.addEventListener("touchcancel",ye._endDragBefore,!0),window.addEventListener("mousemove",ye._drag),window.addEventListener("touchmove",ye._drag),window.addEventListener("mouseup",ye._endDragAfter,!1),window.addEventListener("touchend",ye._endDragAfter,!1),window.addEventListener("touchcancel",ye._endDragAfter,!1));function zs(d){return j._isString(d)?'"'+d+'"':Object.prototype.toString.call(d)==="[object Number]"||j._isBoolean(d)?d:Object.prototype.toString.call(d)}function u3(d){return d>255?255:d<0?0:Math.round(d)}function vt(){if(yt.isUnminified)return function(d,l){return j._isNumber(d)||j.warn(zs(d)+' is a not valid value for "'+l+'" attribute. The value should be a number.'),d}}function cd(d){if(yt.isUnminified)return function(l,u){let f=j._isNumber(l),r=j._isArray(l)&&l.length==d;return!f&&!r&&j.warn(zs(l)+' is a not valid value for "'+u+'" attribute. The value should be a number or Array('+d+")"),l}}function A1(){if(yt.isUnminified)return function(d,l){return j._isNumber(d)||d==="auto"||j.warn(zs(d)+' is a not valid value for "'+l+'" attribute. The value should be a number or "auto".'),d}}function Ac(){if(yt.isUnminified)return function(d,l){return j._isString(d)||j.warn(zs(d)+' is a not valid value for "'+l+'" attribute. The value should be a string.'),d}}function s3(){if(yt.isUnminified)return function(d,l){const u=j._isString(d),f=Object.prototype.toString.call(d)==="[object CanvasGradient]"||d&&d.addColorStop;return u||f||j.warn(zs(d)+' is a not valid value for "'+l+'" attribute. The value should be a string or a native gradient.'),d}}function q4(){if(yt.isUnminified)return function(d,l){const u=Int8Array?Object.getPrototypeOf(Int8Array):null;return u&&d instanceof u||(j._isArray(d)?d.forEach(function(f){j._isNumber(f)||j.warn('"'+l+'" attribute has non numeric element '+f+". Make sure that all elements are numbers.")}):j.warn(zs(d)+' is a not valid value for "'+l+'" attribute. The value should be a array of numbers.')),d}}function Zn(){if(yt.isUnminified)return function(d,l){return d===!0||d===!1||j.warn(zs(d)+' is a not valid value for "'+l+'" attribute. The value should be a boolean.'),d}}function j4(d){if(yt.isUnminified)return function(l,u){return l==null||j.isObject(l)||j.warn(zs(l)+' is a not valid value for "'+u+'" attribute. The value should be an object with properties '+d),l}}const jo="get",Lo="set",N={addGetterSetter(d,l,u,f,r){N.addGetter(d,l,u),N.addSetter(d,l,f,r),N.addOverloadedGetterSetter(d,l)},addGetter(d,l,u){const f=jo+j._capitalize(l);d.prototype[f]=d.prototype[f]||function(){const r=this.attrs[l];return r===void 0?u:r}},addSetter(d,l,u,f){const r=Lo+j._capitalize(l);d.prototype[r]||N.overWriteSetter(d,l,u,f)},overWriteSetter(d,l,u,f){const r=Lo+j._capitalize(l);d.prototype[r]=function(m){return u&&m!==void 0&&m!==null&&(m=u.call(this,m,l)),this._setAttr(l,m),f&&f.call(this),this}},addComponentsGetterSetter(d,l,u,f,r){const m=u.length,p=j._capitalize,y=jo+p(l),_=Lo+p(l);d.prototype[y]=function(){const x={};for(let C=0;C{this._setAttr(l+p(A),void 0)}),this._fireChangeEvent(l,C,x),r&&r.call(this),this},N.addOverloadedGetterSetter(d,l)},addOverloadedGetterSetter(d,l){const u=j._capitalize(l),f=Lo+u,r=jo+u;d.prototype[l]=function(){return arguments.length?(this[f](arguments[0]),this):this[r]()}},addDeprecatedGetterSetter(d,l,u,f){j.error("Adding deprecated "+l);const r=jo+j._capitalize(l),m=l+" property is deprecated and will be removed soon. Look at Konva change log for more information.";d.prototype[r]=function(){j.error(m);const p=this.attrs[l];return p===void 0?u:p},N.addSetter(d,l,f,function(){j.error(m)}),N.addOverloadedGetterSetter(d,l)},backCompat(d,l){j.each(l,function(u,f){const r=d.prototype[f],m=jo+j._capitalize(u),p=Lo+j._capitalize(u);function y(){r.apply(this,arguments),j.error('"'+u+'" method is deprecated and will be removed soon. Use ""'+f+'" instead.')}d.prototype[u]=y,d.prototype[m]=y,d.prototype[p]=y})},afterSetFilter(){this._filterUpToDate=!1}};function L4(d){const l=/(\w+)\(([^)]+)\)/g;let u;for(;(u=l.exec(d))!==null;){const[,f,r]=u;switch(f){case"blur":{const m=parseFloat(r.replace("px",""));return function(p){this.blurRadius(m*.5);const y=yt.Filters;y&&y.Blur&&y.Blur.call(this,p)}}case"brightness":{const m=r.includes("%")?parseFloat(r)/100:parseFloat(r);return function(p){this.brightness(m);const y=yt.Filters;y&&y.Brightness&&y.Brightness.call(this,p)}}case"contrast":{const m=parseFloat(r);return function(p){const y=100*(Math.sqrt(m)-1);this.contrast(y);const _=yt.Filters;_&&_.Contrast&&_.Contrast.call(this,p)}}case"grayscale":return function(m){const p=yt.Filters;p&&p.Grayscale&&p.Grayscale.call(this,m)};case"sepia":return function(m){const p=yt.Filters;p&&p.Sepia&&p.Sepia.call(this,m)};case"invert":return function(m){const p=yt.Filters;p&&p.Invert&&p.Invert.call(this,m)};default:j.warn(`CSS filter "${f}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const ad="absoluteOpacity",J0="allEventListeners",yu="absoluteTransform",R2="absoluteScale",Tc="canvas",X4="Change",Q4="children",V4="konva",h1="listening",Z4="mouseenter",K4="mouseleave",w4="pointerenter",J4="pointerleave",W4="touchenter",F4="touchleave",D2="set",G2="Shape",ld=" ",H2="stage",Ts="transform",k4="Stage",d1="visible",P4=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(ld);let I4=1;class pt{constructor(l){this._id=I4++,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(l),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(l){(l===Ts||l===yu)&&this._cache.get(l)?this._cache.get(l).dirty=!0:l?this._cache.delete(l):this._cache.clear()}_getCache(l,u){let f=this._cache.get(l);return(f===void 0||(l===Ts||l===yu)&&f.dirty===!0)&&(f=u.call(this),this._cache.set(l,f)),f}_calculate(l,u,f){if(!this._attachedDepsListeners.get(l)){const r=u.map(m=>m+"Change.konva").join(ld);this.on(r,()=>{this._clearCache(l)}),this._attachedDepsListeners.set(l,!0)}return this._getCache(l,f)}_getCanvasCache(){return this._cache.get(Tc)}_clearSelfAndDescendantCache(l){this._clearCache(l),l===yu&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Tc)){const{scene:l,filter:u,hit:f,buffer:r}=this._cache.get(Tc);j.releaseCanvas(l,u,f,r),this._cache.delete(Tc)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(l){const u=l||{};let f={};(u.x===void 0||u.y===void 0||u.width===void 0||u.height===void 0)&&(f=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let r=Math.ceil(u.width||f.width),m=Math.ceil(u.height||f.height),p=u.pixelRatio,y=u.x===void 0?Math.floor(f.x):u.x,_=u.y===void 0?Math.floor(f.y):u.y,E=u.offset||0,x=u.drawBorder||!1,C=u.hitCanvasPixelRatio||1;if(!r||!m){j.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const A=Math.abs(Math.round(f.x)-y)>.5?1:0,O=Math.abs(Math.round(f.y)-_)>.5?1:0;r+=E*2+A,m+=E*2+O,y-=E,_-=E;const M=new As({pixelRatio:p,width:r,height:m}),V=new As({pixelRatio:p,width:0,height:0,willReadFrequently:!0}),Z=new C1({pixelRatio:C,width:r,height:m}),K=M.getContext(),J=Z.getContext(),L=new As({width:M.width/M.pixelRatio+Math.abs(y),height:M.height/M.pixelRatio+Math.abs(_),pixelRatio:M.pixelRatio}),B=L.getContext();return Z.isCache=!0,M.isCache=!0,this._cache.delete(Tc),this._filterUpToDate=!1,u.imageSmoothingEnabled===!1&&(M.getContext()._context.imageSmoothingEnabled=!1,V.getContext()._context.imageSmoothingEnabled=!1),K.save(),J.save(),B.save(),K.translate(-y,-_),J.translate(-y,-_),B.translate(-y,-_),L.x=y,L.y=_,this._isUnderCache=!0,this._clearSelfAndDescendantCache(ad),this._clearSelfAndDescendantCache(R2),this.drawScene(M,this,L),this.drawHit(Z,this),this._isUnderCache=!1,K.restore(),J.restore(),x&&(K.save(),K.beginPath(),K.rect(0,0,r,m),K.closePath(),K.setAttr("strokeStyle","red"),K.setAttr("lineWidth",5),K.stroke(),K.restore()),this._cache.set(Tc,{scene:M,filter:V,hit:Z,buffer:L,x:y,y:_}),this._requestDraw(),this}isCached(){return this._cache.has(Tc)}getClientRect(l){throw new Error('abstract "getClientRect" method call')}_transformedRect(l,u){const f=[{x:l.x,y:l.y},{x:l.x+l.width,y:l.y},{x:l.x+l.width,y:l.y+l.height},{x:l.x,y:l.y+l.height}];let r=1/0,m=1/0,p=-1/0,y=-1/0;const _=this.getAbsoluteTransform(u);return f.forEach(function(E){const x=_.point(E);r===void 0&&(r=p=x.x,m=y=x.y),r=Math.min(r,x.x),m=Math.min(m,x.y),p=Math.max(p,x.x),y=Math.max(y,x.y)}),{x:r,y:m,width:p-r,height:y-m}}_drawCachedSceneCanvas(l){l.save(),l._applyOpacity(this),l._applyGlobalCompositeOperation(this);const u=this._getCanvasCache();l.translate(u.x,u.y);const f=this._getCachedSceneCanvas(),r=f.pixelRatio;l.drawImage(f._canvas,0,0,f.width/r,f.height/r),l.restore()}_drawCachedHitCanvas(l){const u=this._getCanvasCache(),f=u.hit;l.save(),l.translate(u.x,u.y),l.drawImage(f._canvas,0,0,f.width/f.pixelRatio,f.height/f.pixelRatio),l.restore()}_getCachedSceneCanvas(){let l=this.filters(),u=this._getCanvasCache(),f=u.scene,r=u.filter,m=r.getContext(),p,y,_,E;if(!l||l.length===0)return f;if(this._filterUpToDate)return r;let x=!0;for(let A=0;A{let u,f;if(!l)return this;for(u in l)u!==Q4&&(f=D2+j._capitalize(u),j._isFunction(this[f])?this[f](l[u]):this._setAttr(u,l[u]))}),this}isListening(){return this._getCache(h1,this._isListening)}_isListening(l){if(!this.listening())return!1;const f=this.getParent();return f&&f!==l&&this!==l?f._isListening(l):!0}isVisible(){return this._getCache(d1,this._isVisible)}_isVisible(l){if(!this.visible())return!1;const f=this.getParent();return f&&f!==l&&this!==l?f._isVisible(l):!0}shouldDrawHit(l,u=!1){if(l)return this._isVisible(l)&&this._isListening(l);const f=this.getLayer();let r=!1;ye._dragElements.forEach(p=>{p.dragStatus==="dragging"&&(p.node.nodeType==="Stage"||p.node.getLayer()===f)&&(r=!0)});const m=!u&&!yt.hitOnDragEnabled&&(r||yt.isTransforming());return this.isListening()&&this.isVisible()&&!m}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let l=this.getDepth(),u=this,f=0,r,m,p,y;function _(x){for(r=[],m=x.length,p=0;p0&&r[0].getDepth()<=l&&_(r)}const E=this.getStage();return u.nodeType!==k4&&E&&_(E.getChildren()),f}getDepth(){let l=0,u=this.parent;for(;u;)l++,u=u.parent;return l}_batchTransformChanges(l){this._batchingTransformChange=!0,l(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Ts),this._clearSelfAndDescendantCache(yu)),this._needClearTransformCache=!1}setPosition(l){return this._batchTransformChanges(()=>{this.x(l.x),this.y(l.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const l=this.getStage();if(!l)return null;const u=l.getPointerPosition();if(!u)return null;const f=this.getAbsoluteTransform().copy();return f.invert(),f.point(u)}getAbsolutePosition(l){let u=!1,f=this.parent;for(;f;){if(f.isCached()){u=!0;break}f=f.parent}u&&!l&&(l=!0);const r=this.getAbsoluteTransform(l).getMatrix(),m=new Xl,p=this.offset();return m.m=r.slice(),m.translate(p.x,p.y),m.getTranslation()}setAbsolutePosition(l){const{x:u,y:f,...r}=this._clearTransform();this.attrs.x=u,this.attrs.y=f,this._clearCache(Ts);const m=this._getAbsoluteTransform().copy();return m.invert(),m.translate(l.x,l.y),l={x:this.attrs.x+m.getTranslation().x,y:this.attrs.y+m.getTranslation().y},this._setTransform(r),this.setPosition({x:l.x,y:l.y}),this._clearCache(Ts),this._clearSelfAndDescendantCache(yu),this}_setTransform(l){let u;for(u in l)this.attrs[u]=l[u]}_clearTransform(){const l={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,l}move(l){let u=l.x,f=l.y,r=this.x(),m=this.y();return u!==void 0&&(r+=u),f!==void 0&&(m+=f),this.setPosition({x:r,y:m}),this}_eachAncestorReverse(l,u){let f=[],r=this.getParent(),m,p;if(!(u&&u._id===this._id)){for(f.unshift(this);r&&(!u||r._id!==u._id);)f.unshift(r),r=r.parent;for(m=f.length,p=0;p0?(this.parent.children.splice(l,1),this.parent.children.splice(l-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return j.warn("Node has no parent. moveToBottom function is ignored."),!1;const l=this.index;return l>0?(this.parent.children.splice(l,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(l){if(!this.parent)return j.warn("Node has no parent. zIndex parameter is ignored."),this;(l<0||l>=this.parent.children.length)&&j.warn("Unexpected value "+l+" 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 u=this.index;return this.parent.children.splice(u,1),this.parent.children.splice(l,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(ad,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let l=this.opacity();const u=this.getParent();return u&&!u._isUnderCache&&(l*=u.getAbsoluteOpacity()),l}moveTo(l){return this.getParent()!==l&&(this._remove(),l.add(this)),this}toObject(){let l=this.getAttrs(),u,f,r,m,p;const y={attrs:{},className:this.getClassName()};for(u in l)f=l[u],p=j.isObject(f)&&!j._isPlainObject(f)&&!j._isArray(f),!p&&(r=typeof this[u]=="function"&&this[u],delete l[u],m=r?r.call(this):null,l[u]=f,m!==f&&(y.attrs[u]=f));return j._prepareToStringify(y)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(l,u,f){const r=[];u&&this._isMatch(l)&&r.push(this);let m=this.parent;for(;m;){if(m===f)return r;m._isMatch(l)&&r.push(m),m=m.parent}return r}isAncestorOf(l){return!1}findAncestor(l,u,f){return this.findAncestors(l,u,f)[0]}_isMatch(l){if(!l)return!1;if(typeof l=="function")return l(this);let u=l.replace(/ /g,"").split(","),f=u.length,r,m;for(r=0;r{try{const r=l==null?void 0:l.callback;r&&delete l.callback,j._urlToImage(this.toDataURL(l),function(m){u(m),r==null||r(m)})}catch(r){f(r)}})}toBlob(l){return new Promise((u,f)=>{try{const r=l==null?void 0:l.callback;r&&delete l.callback,this.toCanvas(l).toBlob(m=>{u(m),r==null||r(m)},l==null?void 0:l.mimeType,l==null?void 0:l.quality)}catch(r){f(r)}})}setSize(l){return this.width(l.width),this.height(l.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():yt.dragDistance}_off(l,u,f){let r=this.eventListeners[l],m,p,y;for(m=0;m=0)||this.isDragging())return;let r=!1;ye._dragElements.forEach(m=>{this.isAncestorOf(m.node)&&(r=!0)}),r||this._createDragElement(l)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const u=ye._dragElements.get(this._id),f=u&&u.dragStatus==="dragging",r=u&&u.dragStatus==="ready";f?this.stopDrag():r&&ye._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(l={x:0,y:0}){const u=this.getStage();if(!u)return!1;const f={x:-l.x,y:-l.y,width:u.width()+2*l.x,height:u.height()+2*l.y};return j.haveIntersection(f,this.getClientRect())}static create(l,u){return j._isString(l)&&(l=JSON.parse(l)),this._createNode(l,u)}static _createNode(l,u){let f=pt.prototype.getClassName.call(l),r=l.children,m,p,y;u&&(l.attrs.container=u),yt[f]||(j.warn('Can not find a node with class name "'+f+'". Fallback to "Shape".'),f="Shape");const _=yt[f];if(m=new _(l.attrs),r)for(p=r.length,y=0;y0}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 f=0;f0?u[0]:void 0}_generalFind(l,u){const f=[];return this._descendants(r=>{const m=r._isMatch(l);return m&&f.push(r),!!(m&&u)}),f}_descendants(l){let u=!1;const f=this.getChildren();for(const r of f){if(u=l(r),u)return!0;if(r.hasChildren()&&(u=r._descendants(l),u))return!0}return!1}toObject(){const l=pt.prototype.toObject.call(this);return l.children=[],this.getChildren().forEach(u=>{l.children.push(u.toObject())}),l}isAncestorOf(l){let u=l.getParent();for(;u;){if(u._id===this._id)return!0;u=u.getParent()}return!1}clone(l){const u=pt.prototype.clone.call(this,l);return this.getChildren().forEach(function(f){u.add(f.clone())}),u}getAllIntersections(l){const u=[];return this.find("Shape").forEach(f=>{f.isVisible()&&f.intersects(l)&&u.push(f)}),u}_clearSelfAndDescendantCache(l){var u;super._clearSelfAndDescendantCache(l),!this.isCached()&&((u=this.children)===null||u===void 0||u.forEach(function(f){f._clearSelfAndDescendantCache(l)}))}_setChildrenIndices(){var l;(l=this.children)===null||l===void 0||l.forEach(function(u,f){u.index=f}),this._requestDraw()}drawScene(l,u,f){const r=this.getLayer(),m=l||r&&r.getCanvas(),p=m&&m.getContext(),y=this._getCanvasCache(),_=y&&y.scene,E=m&&m.isCache;if(!this.isVisible()&&!E)return this;if(_){p.save();const x=this.getAbsoluteTransform(u).getMatrix();p.transform(x[0],x[1],x[2],x[3],x[4],x[5]),this._drawCachedSceneCanvas(p),p.restore()}else this._drawChildren("drawScene",m,u,f);return this}drawHit(l,u){if(!this.shouldDrawHit(u))return this;const f=this.getLayer(),r=l||f&&f.hitCanvas,m=r&&r.getContext(),p=this._getCanvasCache();if(p&&p.hit){m.save();const _=this.getAbsoluteTransform(u).getMatrix();m.transform(_[0],_[1],_[2],_[3],_[4],_[5]),this._drawCachedHitCanvas(m),m.restore()}else this._drawChildren("drawHit",r,u);return this}_drawChildren(l,u,f,r){var m;const p=u&&u.getContext(),y=this.clipWidth(),_=this.clipHeight(),E=this.clipFunc(),x=typeof y=="number"&&typeof _=="number"||E,C=f===this;if(x){p.save();const O=this.getAbsoluteTransform(f);let M=O.getMatrix();p.transform(M[0],M[1],M[2],M[3],M[4],M[5]),p.beginPath();let V;if(E)V=E.call(this,p,this);else{const Z=this.clipX(),K=this.clipY();p.rect(Z||0,K||0,y,_)}p.clip.apply(p,V),M=O.copy().invert().getMatrix(),p.transform(M[0],M[1],M[2],M[3],M[4],M[5])}const A=!C&&this.globalCompositeOperation()!=="source-over"&&l==="drawScene";A&&(p.save(),p._applyGlobalCompositeOperation(this)),(m=this.children)===null||m===void 0||m.forEach(function(O){O[l](u,f,r)}),A&&p.restore(),x&&p.restore()}getClientRect(l={}){var u;const f=l.skipTransform,r=l.relativeTo;let m,p,y,_,E={x:1/0,y:1/0,width:0,height:0};const x=this;(u=this.children)===null||u===void 0||u.forEach(function(O){if(!O.visible())return;const M=O.getClientRect({relativeTo:x,skipShadow:l.skipShadow,skipStroke:l.skipStroke});M.width===0&&M.height===0||(m===void 0?(m=M.x,p=M.y,y=M.x+M.width,_=M.y+M.height):(m=Math.min(m,M.x),p=Math.min(p,M.y),y=Math.max(y,M.x+M.width),_=Math.max(_,M.y+M.height)))});const C=this.find("Shape");let A=!1;for(let O=0;Od.indexOf("pointer")>=0?"pointer":d.indexOf("touch")>=0?"touch":"mouse",If=d=>{const l=Jo(d);if(l==="pointer")return yt.pointerEventsEnabled&&e1.pointer;if(l==="touch")return e1.touch;if(l==="mouse")return e1.mouse};function B2(d={}){return(d.clipFunc||d.clipWidth||d.clipHeight)&&j.warn("Stage does not support clipping. Please use clip for Layers or Groups."),d}const i5="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);",Fo=[];let fd=class extends Ql{constructor(l){super(B2(l)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Fo.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{B2(this.attrs)}),this._checkVisibility()}_validateAdd(l){const u=l.getType()==="Layer",f=l.getType()==="FastLayer";u||f||j.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const l=this.visible()?"":"none";this.content.style.display=l}setContainer(l){if(typeof l===t5){let u;if(l.charAt(0)==="."){const f=l.slice(1);l=document.getElementsByClassName(f)[0]}else l.charAt(0)!=="#"?u=l:u=l.slice(1),l=document.getElementById(u);if(!l)throw"Can not find container in document with id "+u}return this._setAttr("container",l),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),l.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const l=this.children,u=l.length;for(let f=0;f-1&&Fo.splice(u,1),j.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const l=this._pointerPositions[0]||this._changedPointerPositions[0];return l?{x:l.x,y:l.y}:(j.warn(i5),null)}_getPointerById(l){return this._pointerPositions.find(u=>u.id===l)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(l){l={...l},l.x=l.x||0,l.y=l.y||0,l.width=l.width||this.width(),l.height=l.height||this.height();const u=new As({width:l.width,height:l.height,pixelRatio:l.pixelRatio||1}),f=u.getContext()._context,r=this.children;return(l.x||l.y)&&f.translate(-1*l.x,-1*l.y),r.forEach(function(m){if(!m.isVisible())return;const p=m._toKonvaCanvas(l);f.drawImage(p._canvas,l.x,l.y,p.getWidth()/p.getPixelRatio(),p.getHeight()/p.getPixelRatio())}),u}getIntersection(l){if(!l)return null;const u=this.children,f=u.length,r=f-1;for(let m=r;m>=0;m--){const p=u[m].getIntersection(l);if(p)return p}return null}_resizeDOM(){const l=this.width(),u=this.height();this.content&&(this.content.style.width=l+U2,this.content.style.height=u+U2),this.bufferCanvas.setSize(l,u),this.bufferHitCanvas.setSize(l,u),this.children.forEach(f=>{f.setSize({width:l,height:u}),f.draw()})}add(l,...u){if(arguments.length>1){for(let r=0;rl5&&j.warn("The stage has "+f+" 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."),l.setSize({width:this.width(),height:this.height()}),l.draw(),yt.isBrowser&&this.content.appendChild(l.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(l){return f3(l,this)}setPointerCapture(l){r3(l,this)}releaseCapture(l){Wo(l)}getLayers(){return this.children}_bindContentEvents(){yt.isBrowser&&n5.forEach(([l,u])=>{this.content.addEventListener(l,f=>{this[u](f)},{passive:!1})})}_pointerenter(l){this.setPointersPositions(l);const u=If(l.type);u&&this._fire(u.pointerenter,{evt:l,target:this,currentTarget:this})}_pointerover(l){this.setPointersPositions(l);const u=If(l.type);u&&this._fire(u.pointerover,{evt:l,target:this,currentTarget:this})}_getTargetShape(l){let u=this[l+"targetShape"];return u&&!u.getStage()&&(u=null),u}_pointerleave(l){const u=If(l.type),f=Jo(l.type);if(!u)return;this.setPointersPositions(l);const r=this._getTargetShape(f),m=!(yt.isDragging()||yt.isTransforming())||yt.hitOnDragEnabled;r&&m?(r._fireAndBubble(u.pointerout,{evt:l}),r._fireAndBubble(u.pointerleave,{evt:l}),this._fire(u.pointerleave,{evt:l,target:this,currentTarget:this}),this[f+"targetShape"]=null):m&&(this._fire(u.pointerleave,{evt:l,target:this,currentTarget:this}),this._fire(u.pointerout,{evt:l,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(l){const u=If(l.type),f=Jo(l.type);if(!u)return;this.setPointersPositions(l);let r=!1;this._changedPointerPositions.forEach(m=>{const p=this.getIntersection(m);if(ye.justDragged=!1,yt["_"+f+"ListenClick"]=!0,!p||!p.isListening()){this[f+"ClickStartShape"]=void 0;return}yt.capturePointerEventsEnabled&&p.setPointerCapture(m.id),this[f+"ClickStartShape"]=p,p._fireAndBubble(u.pointerdown,{evt:l,pointerId:m.id}),r=!0;const y=l.type.indexOf("touch")>=0;p.preventDefault()&&l.cancelable&&y&&l.preventDefault()}),r||this._fire(u.pointerdown,{evt:l,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(l){const u=If(l.type),f=Jo(l.type);if(!u)return;const r=l.type.indexOf("touch")>=0||l.pointerType==="touch";if(yt.isDragging()&&ye.node.preventDefault()&&l.cancelable&&r&&l.preventDefault(),this.setPointersPositions(l),!(!(yt.isDragging()||yt.isTransforming())||yt.hitOnDragEnabled))return;const p={};let y=!1;const _=this._getTargetShape(f);this._changedPointerPositions.forEach(E=>{const x=t1(E.id)||this.getIntersection(E),C=E.id,A={evt:l,pointerId:C},O=_!==x;if(O&&_&&(_._fireAndBubble(u.pointerout,{...A},x),_._fireAndBubble(u.pointerleave,{...A},x)),x){if(p[x._id])return;p[x._id]=!0}x&&x.isListening()?(y=!0,O&&(x._fireAndBubble(u.pointerover,{...A},_),x._fireAndBubble(u.pointerenter,{...A},_),this[f+"targetShape"]=x),x._fireAndBubble(u.pointermove,{...A})):_&&(this._fire(u.pointerover,{evt:l,target:this,currentTarget:this,pointerId:C}),this[f+"targetShape"]=null)}),y||this._fire(u.pointermove,{evt:l,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(l){const u=If(l.type),f=Jo(l.type);if(!u)return;this.setPointersPositions(l);const r=this[f+"ClickStartShape"],m=this[f+"ClickEndShape"],p={};let y=!1;this._changedPointerPositions.forEach(_=>{const E=t1(_.id)||this.getIntersection(_);if(E){if(E.releaseCapture(_.id),p[E._id])return;p[E._id]=!0}const x=_.id,C={evt:l,pointerId:x};let A=!1;yt["_"+f+"InDblClickWindow"]?(A=!0,clearTimeout(this[f+"DblTimeout"])):ye.justDragged||(yt["_"+f+"InDblClickWindow"]=!0,clearTimeout(this[f+"DblTimeout"])),this[f+"DblTimeout"]=setTimeout(function(){yt["_"+f+"InDblClickWindow"]=!1},yt.dblClickWindow),E&&E.isListening()?(y=!0,this[f+"ClickEndShape"]=E,E._fireAndBubble(u.pointerup,{...C}),yt["_"+f+"ListenClick"]&&r&&r===E&&(E._fireAndBubble(u.pointerclick,{...C}),A&&m&&m===E&&E._fireAndBubble(u.pointerdblclick,{...C}))):(this[f+"ClickEndShape"]=null,y||(this._fire(u.pointerup,{evt:l,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),y=!0),yt["_"+f+"ListenClick"]&&this._fire(u.pointerclick,{evt:l,target:this,currentTarget:this,pointerId:x}),A&&this._fire(u.pointerdblclick,{evt:l,target:this,currentTarget:this,pointerId:x}))}),y||this._fire(u.pointerup,{evt:l,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),yt["_"+f+"ListenClick"]=!1,l.cancelable&&f!=="touch"&&f!=="pointer"&&l.preventDefault()}_contextmenu(l){this.setPointersPositions(l);const u=this.getIntersection(this.getPointerPosition());u&&u.isListening()?u._fireAndBubble(m1,{evt:l}):this._fire(m1,{evt:l,target:this,currentTarget:this})}_wheel(l){this.setPointersPositions(l);const u=this.getIntersection(this.getPointerPosition());u&&u.isListening()?u._fireAndBubble(g1,{evt:l}):this._fire(g1,{evt:l,target:this,currentTarget:this})}_pointercancel(l){this.setPointersPositions(l);const u=t1(l.pointerId)||this.getIntersection(this.getPointerPosition());u&&u._fireAndBubble(tr,z1(l)),Wo(l.pointerId)}_lostpointercapture(l){Wo(l.pointerId)}setPointersPositions(l){const u=this._getContentPosition();let f=null,r=null;l=l||window.event,l.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(l.touches,m=>{this._pointerPositions.push({id:m.identifier,x:(m.clientX-u.left)/u.scaleX,y:(m.clientY-u.top)/u.scaleY})}),Array.prototype.forEach.call(l.changedTouches||l.touches,m=>{this._changedPointerPositions.push({id:m.identifier,x:(m.clientX-u.left)/u.scaleX,y:(m.clientY-u.top)/u.scaleY})})):(f=(l.clientX-u.left)/u.scaleX,r=(l.clientY-u.top)/u.scaleY,this.pointerPos={x:f,y:r},this._pointerPositions=[{x:f,y:r,id:j._getFirstPointerId(l)}],this._changedPointerPositions=[{x:f,y:r,id:j._getFirstPointerId(l)}])}_setPointerPosition(l){j.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(l)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const l=this.content.getBoundingClientRect();return{top:l.top,left:l.left,scaleX:l.width/this.content.clientWidth||1,scaleY:l.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new As({width:this.width(),height:this.height()}),this.bufferHitCanvas=new C1({pixelRatio:1,width:this.width(),height:this.height()}),!yt.isBrowser)return;const l=this.container();if(!l)throw"Stage has no container. A container is required.";l.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"),l.appendChild(this.content),this._resizeDOM()}cache(){return j.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(l){l.batchDraw()}),this}};fd.prototype.nodeType=$4;$e(fd);N.addGetterSetter(fd,"container");yt.isBrowser&&document.addEventListener("visibilitychange",()=>{Fo.forEach(d=>{d.batchDraw()})});const b3="hasShadow",E3="shadowRGBA",x3="patternImage",T3="linearGradient",C3="radialGradient";let P0;function a1(){return P0||(P0=j.createCanvasElement().getContext("2d"),P0)}const ko={};function u5(d){const l=this.attrs.fillRule;l?d.fill(l):d.fill()}function s5(d){d.stroke()}function c5(d){const l=this.attrs.fillRule;l?d.fill(l):d.fill()}function f5(d){d.stroke()}function r5(){this._clearCache(b3)}function o5(){this._clearCache(E3)}function h5(){this._clearCache(x3)}function d5(){this._clearCache(T3)}function m5(){this._clearCache(C3)}class ot extends pt{constructor(l){super(l);let u,f=0;for(;u=j.getHitColor(),!(u&&!(u in ko));)if(f++,f>=1e4){j.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),u=j.getRandomColor();break}this.colorKey=u,ko[u]=this}getContext(){return j.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return j.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(b3,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(x3,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const u=a1().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(u&&u.setTransform){const f=new Xl;f.translate(this.fillPatternX(),this.fillPatternY()),f.rotate(yt.getAngle(this.fillPatternRotation())),f.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),f.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const r=f.getMatrix(),m=typeof DOMMatrix>"u"?{a:r[0],b:r[1],c:r[2],d:r[3],e:r[4],f:r[5]}:new DOMMatrix(r);u.setTransform(m)}return u}}_getLinearGradient(){return this._getCache(T3,this.__getLinearGradient)}__getLinearGradient(){const l=this.fillLinearGradientColorStops();if(l){const u=a1(),f=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),m=u.createLinearGradient(f.x,f.y,r.x,r.y);for(let p=0;pthis.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 l=this.hitStrokeWidth();return l==="auto"?this.hasStroke():this.strokeEnabled()&&!!l}intersects(l){const u=this.getStage();if(!u)return!1;const f=u.bufferHitCanvas;return f.getContext().clear(),this.drawHit(f,void 0,!0),f.context.getImageData(Math.round(l.x),Math.round(l.y),1,1).data[3]>0}destroy(){return pt.prototype.destroy.call(this),delete ko[this.colorKey],delete this.colorKey,this}_useBufferCanvas(l){var u;if(!((u=this.attrs.perfectDrawEnabled)!==null&&u!==void 0?u:!0))return!1;const r=l||this.hasFill(),m=this.hasStroke(),p=this.getAbsoluteOpacity()!==1;if(r&&m&&p)return!0;const y=this.hasShadow(),_=this.shadowForStrokeEnabled();return!!(r&&m&&y&&_)}setStrokeHitEnabled(l){j.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),l?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const l=this.size();return{x:this._centroid?-l.width/2:0,y:this._centroid?-l.height/2:0,width:l.width,height:l.height}}getClientRect(l={}){let u=!1,f=this.getParent();for(;f;){if(f.isCached()){u=!0;break}f=f.getParent()}const r=l.skipTransform,m=l.relativeTo||u&&this.getStage()||void 0,p=this.getSelfRect(),_=!l.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,E=p.width+_,x=p.height+_,C=!l.skipShadow&&this.hasShadow(),A=C?this.shadowOffsetX():0,O=C?this.shadowOffsetY():0,M=E+Math.abs(A),V=x+Math.abs(O),Z=C&&this.shadowBlur()||0,K=M+Z*2,J=V+Z*2,L={width:K,height:J,x:-(_/2+Z)+Math.min(A,0)+p.x,y:-(_/2+Z)+Math.min(O,0)+p.y};return r?L:this._transformedRect(L,m)}drawScene(l,u,f){const r=this.getLayer(),m=l||r.getCanvas(),p=m.getContext(),y=this._getCanvasCache(),_=this.getSceneFunc(),E=this.hasShadow();let x;const C=u===this;if(!this.isVisible()&&!C)return this;if(y){p.save();const A=this.getAbsoluteTransform(u).getMatrix();return p.transform(A[0],A[1],A[2],A[3],A[4],A[5]),this._drawCachedSceneCanvas(p),p.restore(),this}if(!_)return this;if(p.save(),this._useBufferCanvas()){x=this.getStage();const A=f||x.bufferCanvas,O=A.getContext();O.clear(),O.save(),O._applyLineJoin(this),O._applyMiterLimit(this);const M=this.getAbsoluteTransform(u).getMatrix();O.transform(M[0],M[1],M[2],M[3],M[4],M[5]),_.call(this,O,this),O.restore();const V=A.pixelRatio;E&&p._applyShadow(this),C||(p._applyOpacity(this),p._applyGlobalCompositeOperation(this)),p.drawImage(A._canvas,A.x||0,A.y||0,A.width/V,A.height/V)}else{if(p._applyLineJoin(this),p._applyMiterLimit(this),!C){const A=this.getAbsoluteTransform(u).getMatrix();p.transform(A[0],A[1],A[2],A[3],A[4],A[5]),p._applyOpacity(this),p._applyGlobalCompositeOperation(this)}E&&p._applyShadow(this),_.call(this,p,this)}return p.restore(),this}drawHit(l,u,f=!1){if(!this.shouldDrawHit(u,f))return this;const r=this.getLayer(),m=l||r.hitCanvas,p=m&&m.getContext(),y=this.hitFunc()||this.sceneFunc(),_=this._getCanvasCache(),E=_&&_.hit;if(this.colorKey||j.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()"),E){p.save();const C=this.getAbsoluteTransform(u).getMatrix();return p.transform(C[0],C[1],C[2],C[3],C[4],C[5]),this._drawCachedHitCanvas(p),p.restore(),this}if(!y)return this;if(p.save(),p._applyLineJoin(this),p._applyMiterLimit(this),!(this===u)){const C=this.getAbsoluteTransform(u).getMatrix();p.transform(C[0],C[1],C[2],C[3],C[4],C[5])}return y.call(this,p,this),p.restore(),this}drawHitFromCache(l=0){const u=this._getCanvasCache(),f=this._getCachedSceneCanvas(),r=u.hit,m=r.getContext(),p=r.getWidth(),y=r.getHeight();m.clear(),m.drawImage(f._canvas,0,0,p,y);try{const _=m.getImageData(0,0,p,y),E=_.data,x=E.length,C=j._hexToRgb(this.colorKey);for(let A=0;Al?(E[A]=C.r,E[A+1]=C.g,E[A+2]=C.b,E[A+3]=255):E[A+3]=0;m.putImageData(_,0,0)}catch(_){j.error("Unable to draw hit graph from cached scene canvas. "+_.message)}return this}hasPointerCapture(l){return f3(l,this)}setPointerCapture(l){r3(l,this)}releaseCapture(l){Wo(l)}}ot.prototype._fillFunc=u5;ot.prototype._strokeFunc=s5;ot.prototype._fillFuncHit=c5;ot.prototype._strokeFuncHit=f5;ot.prototype._centroid=!1;ot.prototype.nodeType="Shape";$e(ot);ot.prototype.eventListeners={};ot.prototype.on.call(ot.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",r5);ot.prototype.on.call(ot.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",o5);ot.prototype.on.call(ot.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",h5);ot.prototype.on.call(ot.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",d5);ot.prototype.on.call(ot.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",m5);N.addGetterSetter(ot,"stroke",void 0,s3());N.addGetterSetter(ot,"strokeWidth",2,vt());N.addGetterSetter(ot,"fillAfterStrokeEnabled",!1);N.addGetterSetter(ot,"hitStrokeWidth","auto",A1());N.addGetterSetter(ot,"strokeHitEnabled",!0,Zn());N.addGetterSetter(ot,"perfectDrawEnabled",!0,Zn());N.addGetterSetter(ot,"shadowForStrokeEnabled",!0,Zn());N.addGetterSetter(ot,"lineJoin");N.addGetterSetter(ot,"lineCap");N.addGetterSetter(ot,"miterLimit");N.addGetterSetter(ot,"sceneFunc");N.addGetterSetter(ot,"hitFunc");N.addGetterSetter(ot,"dash");N.addGetterSetter(ot,"dashOffset",0,vt());N.addGetterSetter(ot,"shadowColor",void 0,Ac());N.addGetterSetter(ot,"shadowBlur",0,vt());N.addGetterSetter(ot,"shadowOpacity",1,vt());N.addComponentsGetterSetter(ot,"shadowOffset",["x","y"]);N.addGetterSetter(ot,"shadowOffsetX",0,vt());N.addGetterSetter(ot,"shadowOffsetY",0,vt());N.addGetterSetter(ot,"fillPatternImage");N.addGetterSetter(ot,"fill",void 0,s3());N.addGetterSetter(ot,"fillPatternX",0,vt());N.addGetterSetter(ot,"fillPatternY",0,vt());N.addGetterSetter(ot,"fillLinearGradientColorStops");N.addGetterSetter(ot,"strokeLinearGradientColorStops");N.addGetterSetter(ot,"fillRadialGradientStartRadius",0);N.addGetterSetter(ot,"fillRadialGradientEndRadius",0);N.addGetterSetter(ot,"fillRadialGradientColorStops");N.addGetterSetter(ot,"fillPatternRepeat","repeat");N.addGetterSetter(ot,"fillEnabled",!0);N.addGetterSetter(ot,"strokeEnabled",!0);N.addGetterSetter(ot,"shadowEnabled",!0);N.addGetterSetter(ot,"dashEnabled",!0);N.addGetterSetter(ot,"strokeScaleEnabled",!0);N.addGetterSetter(ot,"fillPriority","color");N.addComponentsGetterSetter(ot,"fillPatternOffset",["x","y"]);N.addGetterSetter(ot,"fillPatternOffsetX",0,vt());N.addGetterSetter(ot,"fillPatternOffsetY",0,vt());N.addComponentsGetterSetter(ot,"fillPatternScale",["x","y"]);N.addGetterSetter(ot,"fillPatternScaleX",1,vt());N.addGetterSetter(ot,"fillPatternScaleY",1,vt());N.addComponentsGetterSetter(ot,"fillLinearGradientStartPoint",["x","y"]);N.addComponentsGetterSetter(ot,"strokeLinearGradientStartPoint",["x","y"]);N.addGetterSetter(ot,"fillLinearGradientStartPointX",0);N.addGetterSetter(ot,"strokeLinearGradientStartPointX",0);N.addGetterSetter(ot,"fillLinearGradientStartPointY",0);N.addGetterSetter(ot,"strokeLinearGradientStartPointY",0);N.addComponentsGetterSetter(ot,"fillLinearGradientEndPoint",["x","y"]);N.addComponentsGetterSetter(ot,"strokeLinearGradientEndPoint",["x","y"]);N.addGetterSetter(ot,"fillLinearGradientEndPointX",0);N.addGetterSetter(ot,"strokeLinearGradientEndPointX",0);N.addGetterSetter(ot,"fillLinearGradientEndPointY",0);N.addGetterSetter(ot,"strokeLinearGradientEndPointY",0);N.addComponentsGetterSetter(ot,"fillRadialGradientStartPoint",["x","y"]);N.addGetterSetter(ot,"fillRadialGradientStartPointX",0);N.addGetterSetter(ot,"fillRadialGradientStartPointY",0);N.addComponentsGetterSetter(ot,"fillRadialGradientEndPoint",["x","y"]);N.addGetterSetter(ot,"fillRadialGradientEndPointX",0);N.addGetterSetter(ot,"fillRadialGradientEndPointY",0);N.addGetterSetter(ot,"fillPatternRotation",0);N.addGetterSetter(ot,"fillRule",void 0,Ac());N.backCompat(ot,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const g5="beforeDraw",p5="draw",A3=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],v5=A3.length;let zc=class extends Ql{constructor(l){super(l),this.canvas=new As,this.hitCanvas=new C1({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(l){return this.getContext().clear(l),this.getHitCanvas().getContext().clear(l),this}setZIndex(l){super.setZIndex(l);const u=this.getStage();return u&&u.content&&(u.content.removeChild(this.getNativeCanvasElement()),l{this.draw(),this._waitingForDraw=!1})),this}getIntersection(l){if(!this.isListening()||!this.isVisible())return null;let u=1,f=!1;for(;;){for(let r=0;r0)return{antialiased:!0};return{}}drawScene(l,u,f){const r=this.getLayer(),m=l||r&&r.getCanvas();return this._fire(g5,{node:this}),this.clearBeforeDraw()&&m.getContext().clear(),Ql.prototype.drawScene.call(this,m,u,f),this._fire(p5,{node:this}),this}drawHit(l,u){const f=this.getLayer(),r=l||f&&f.hitCanvas;return f&&f.clearBeforeDraw()&&f.getHitCanvas().getContext().clear(),Ql.prototype.drawHit.call(this,r,u),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(l){j.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(l)}getHitGraphEnabled(l){return j.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const l=this.parent;!!this.hitCanvas._canvas.parentNode?l.content.removeChild(this.hitCanvas._canvas):l.content.appendChild(this.hitCanvas._canvas)}destroy(){return j.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};zc.prototype.nodeType="Layer";$e(zc);N.addGetterSetter(zc,"imageSmoothingEnabled",!0);N.addGetterSetter(zc,"clearBeforeDraw",!0);N.addGetterSetter(zc,"hitGraphEnabled",!0,Zn());class M1 extends zc{constructor(l){super(l),this.listening(!1),j.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}M1.prototype.nodeType="FastLayer";$e(M1);class er extends Ql{_validateAdd(l){const u=l.getType();u!=="Group"&&u!=="Shape"&&j.throw("You may only add groups and shapes to groups.")}}er.prototype.nodeType="Group";$e(er);const l1=(function(){return Cc.performance&&Cc.performance.now?function(){return Cc.performance.now()}:function(){return new Date().getTime()}})();class yn{constructor(l,u){this.id=yn.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:l1(),frameRate:0},this.func=l,this.setLayers(u)}setLayers(l){let u=[];return l&&(u=Array.isArray(l)?l:[l]),this.layers=u,this}getLayers(){return this.layers}addLayer(l){const u=this.layers,f=u.length;for(let r=0;rthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():l<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=l,this.update())}getTime(){return this._time}setPosition(l){this.prevPos=this._pos,this.propFunc(l),this._pos=l}getPosition(l){return l===void 0&&(l=this._time),this.func(l,this.begin,this._change,this.duration)}play(){this.state=Y2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=q2,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(l){this.pause(),this._time=l,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 l=this.getTimer()-this._startTime;this.state===Y2?this.setTime(l):this.state===q2&&this.setTime(this.duration-l)}pause(){this.state=S5,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Ge{constructor(l){const u=this,f=l.node,r=f._id,m=l.easing||Po.Linear,p=!!l.yoyo;let y,_;typeof l.duration>"u"?y=.3:l.duration===0?y=.001:y=l.duration,this.node=f,this._id=_5++;const E=f.getLayer()||(f instanceof yt.Stage?f.getLayers():null);E||j.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new yn(function(){u.tween.onEnterFrame()},E),this.tween=new b5(_,function(x){u._tweenFunc(x)},m,0,1,y*1e3,p),this._addListeners(),Ge.attrs[r]||(Ge.attrs[r]={}),Ge.attrs[r][this._id]||(Ge.attrs[r][this._id]={}),Ge.tweens[r]||(Ge.tweens[r]={});for(_ in l)y5[_]===void 0&&this._addAttr(_,l[_]);this.reset(),this.onFinish=l.onFinish,this.onReset=l.onReset,this.onUpdate=l.onUpdate}_addAttr(l,u){const f=this.node,r=f._id;let m,p,y,_,E;const x=Ge.tweens[r][l];x&&delete Ge.attrs[r][x][l];let C=f.getAttr(l);if(j._isArray(u))if(m=[],p=Math.max(u.length,C.length),l==="points"&&u.length!==C.length&&(u.length>C.length?(_=C,C=j._prepareArrayForTween(C,u,f.closed())):(y=u,u=j._prepareArrayForTween(u,C,f.closed()))),l.indexOf("fill")===0)for(let A=0;A{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const l=this.node,u=Ge.attrs[l._id][this._id];u.points&&u.points.trueEnd&&l.setAttr("points",u.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const l=this.node,u=Ge.attrs[l._id][this._id];u.points&&u.points.trueStart&&l.points(u.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(l){return this.tween.seek(l*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const l=this.node._id,u=this._id,f=Ge.tweens[l];this.pause(),this.anim&&this.anim.stop();for(const r in f)delete Ge.tweens[l][r];delete Ge.attrs[l][u],Ge.tweens[l]&&(Object.keys(Ge.tweens[l]).length===0&&delete Ge.tweens[l],Object.keys(Ge.attrs[l]).length===0&&delete Ge.attrs[l])}}Ge.attrs={};Ge.tweens={};pt.prototype.to=function(d){const l=d.onFinish;d.node=this,d.onFinish=function(){this.destroy(),l&&l()},new Ge(d).play()};const Po={BackEaseIn(d,l,u,f){return u*(d/=f)*d*((1.70158+1)*d-1.70158)+l},BackEaseOut(d,l,u,f){return u*((d=d/f-1)*d*((1.70158+1)*d+1.70158)+1)+l},BackEaseInOut(d,l,u,f){let r=1.70158;return(d/=f/2)<1?u/2*(d*d*(((r*=1.525)+1)*d-r))+l:u/2*((d-=2)*d*(((r*=1.525)+1)*d+r)+2)+l},ElasticEaseIn(d,l,u,f,r,m){let p=0;return d===0?l:(d/=f)===1?l+u:(m||(m=f*.3),!r||r0?l:u),x=p*u,C=y*(y>0?l:u),A=_*(_>0?u:l);return{x:E,y:f?-1*A:C,width:x-E,height:A-C}}}Su.prototype._centroid=!0;Su.prototype.className="Arc";Su.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];$e(Su);N.addGetterSetter(Su,"innerRadius",0,vt());N.addGetterSetter(Su,"outerRadius",0,vt());N.addGetterSetter(Su,"angle",0,vt());N.addGetterSetter(Su,"clockwise",!1,Zn());function p1(d,l,u,f,r,m,p){const y=Math.sqrt(Math.pow(u-d,2)+Math.pow(f-l,2)),_=Math.sqrt(Math.pow(r-u,2)+Math.pow(m-f,2)),E=p*y/(y+_),x=p*_/(y+_),C=u-E*(r-d),A=f-E*(m-l),O=u+x*(r-d),M=f+x*(m-l);return[C,A,O,M]}function L2(d,l){const u=d.length,f=[];for(let r=2;r4){const _=this.getTensionPoints(),E=_.length;for(y=m?0:4,m||l.quadraticCurveTo(_[0],_[1],_[2],_[3]);y{let f,r;const p=u/2;f=0;for(let y=0;y<20;y++)r=p*E5[20][y]+p,f+=x5[20][y]*C5(d,l,r);return p*f},Q2=(d,l,u)=>{u===void 0&&(u=1);const f=d[0]-2*d[1]+d[2],r=l[0]-2*l[1]+l[2],m=2*d[1]-2*d[0],p=2*l[1]-2*l[0],y=4*(f*f+r*r),_=4*(f*m+r*p),E=m*m+p*p;if(y===0)return u*Math.sqrt(Math.pow(d[2]-d[0],2)+Math.pow(l[2]-l[0],2));const x=_/(2*y),C=E/y,A=u+x,O=C-x*x,M=A*A+O>0?Math.sqrt(A*A+O):0,V=x*x+O>0?Math.sqrt(x*x+O):0,Z=x+Math.sqrt(x*x+O)!==0?O*Math.log(Math.abs((A+M)/(x+V))):0;return Math.sqrt(y)/2*(A*M-x*V+Z)};function C5(d,l,u){const f=v1(1,u,d),r=v1(1,u,l),m=f*f+r*r;return Math.sqrt(m)}const v1=(d,l,u)=>{const f=u.length-1;let r,m;if(f===0)return 0;if(d===0){m=0;for(let p=0;p<=f;p++)m+=T5[f][p]*Math.pow(1-l,f-p)*Math.pow(l,p)*u[p];return m}else{r=new Array(f);for(let p=0;p{let f=1,r=d/l,m=(d-u(r))/l,p=0;for(;f>.001;){const y=u(r+m),_=Math.abs(d-y)/l;if(_500)break}return r};class He extends ot{constructor(l){super(l),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=He.parsePathData(this.data()),this.pathLength=He.getPathLength(this.dataArray)}_sceneFunc(l){const u=this.dataArray;l.beginPath();let f=!1;for(let r=0;rx?E:x,Z=E>x?1:E/x,K=E>x?x/E:1;l.translate(y,_),l.rotate(O),l.scale(Z,K),l.arc(0,0,V,C,C+A,1-M),l.scale(1/Z,1/K),l.rotate(-O),l.translate(-y,-_);break;case"z":f=!0,l.closePath();break}}!f&&!this.hasFill()?l.strokeShape(this):l.fillStrokeShape(this)}getSelfRect(){let l=[];this.dataArray.forEach(function(_){if(_.command==="A"){const E=_.points[4],x=_.points[5],C=_.points[4]+x;let A=Math.PI/180;if(Math.abs(E-C)C;O-=A){const M=He.getPointOnEllipticalArc(_.points[0],_.points[1],_.points[2],_.points[3],O,0);l.push(M.x,M.y)}else for(let O=E+A;Ou[r].pathLength;)l-=u[r].pathLength,++r;if(r===m)return f=u[r-1].points.slice(-2),{x:f[0],y:f[1]};if(l<.01)return u[r].command==="M"?(f=u[r].points.slice(0,2),{x:f[0],y:f[1]}):{x:u[r].start.x,y:u[r].start.y};const p=u[r],y=p.points;switch(p.command){case"L":return He.getPointOnLine(l,p.start.x,p.start.y,y[0],y[1]);case"C":return He.getPointOnCubicBezier(V2(l,He.getPathLength(u),V=>X2([p.start.x,y[0],y[2],y[4]],[p.start.y,y[1],y[3],y[5]],V)),p.start.x,p.start.y,y[0],y[1],y[2],y[3],y[4],y[5]);case"Q":return He.getPointOnQuadraticBezier(V2(l,He.getPathLength(u),V=>Q2([p.start.x,y[0],y[2]],[p.start.y,y[1],y[3]],V)),p.start.x,p.start.y,y[0],y[1],y[2],y[3]);case"A":const _=y[0],E=y[1],x=y[2],C=y[3],A=y[5],O=y[6];let M=y[4];return M+=A*l/p.pathLength,He.getPointOnEllipticalArc(_,E,x,C,M,O)}return null}static getPointOnLine(l,u,f,r,m,p,y){p=p??u,y=y??f;const _=this.getLineLength(u,f,r,m);if(_<1e-10)return{x:u,y:f};if(r===u)return{x:p,y:y+(m>f?l:-l)};const E=(m-f)/(r-u),x=Math.sqrt(l*l/(1+E*E))*(r=0&&(V+=2,V>=7&&(V-=7));continue}if(V>=0){if(V===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(J)){M.push(parseInt(J[0],10)),M.push(parseInt(J[1],10)),M.push(parseFloat(J.slice(2))),V+=3,V>=7&&(V-=7);continue}if(J==="11"||J==="10"||J==="01"){M.push(parseInt(J[0],10)),M.push(parseInt(J[1],10)),V+=2,V>=7&&(V-=7);continue}if(J==="0"||J==="1"){M.push(parseInt(J,10)),V+=1,V>=7&&(V-=7);continue}}else if(V===4){if(/^[01]\d+(?:\.\d+)?$/.test(J)){M.push(parseInt(J[0],10)),M.push(parseFloat(J.slice(1))),V+=2,V>=7&&(V-=7);continue}if(J==="0"||J==="1"){M.push(parseInt(J,10)),V+=1,V>=7&&(V-=7);continue}}const L=parseFloat(J);isNaN(L)?M.push(0):M.push(L),V+=1,V>=7&&(V-=7)}else{const L=parseFloat(J);isNaN(L)?M.push(0):M.push(L)}}for(;M.length>0&&!isNaN(M[0]);){let Z="",K=[];const J=y,L=_;let B,et,I,F,ut,it,Et,Nt,bt,Yt;switch(O){case"l":y+=M.shift(),_+=M.shift(),Z="L",K.push(y,_);break;case"L":y=M.shift(),_=M.shift(),K.push(y,_);break;case"m":const Ot=M.shift(),St=M.shift();if(y+=Ot,_+=St,Z="M",m.length>2&&m[m.length-1].command==="z"){for(let U=m.length-2;U>=0;U--)if(m[U].command==="M"){y=m[U].points[0]+Ot,_=m[U].points[1]+St;break}}K.push(y,_),O="l";break;case"M":y=M.shift(),_=M.shift(),Z="M",K.push(y,_),O="L";break;case"h":y+=M.shift(),Z="L",K.push(y,_);break;case"H":y=M.shift(),Z="L",K.push(y,_);break;case"v":_+=M.shift(),Z="L",K.push(y,_);break;case"V":_=M.shift(),Z="L",K.push(y,_);break;case"C":K.push(M.shift(),M.shift(),M.shift(),M.shift()),y=M.shift(),_=M.shift(),K.push(y,_);break;case"c":K.push(y+M.shift(),_+M.shift(),y+M.shift(),_+M.shift()),y+=M.shift(),_+=M.shift(),Z="C",K.push(y,_);break;case"S":et=y,I=_,B=m[m.length-1],B.command==="C"&&(et=y+(y-B.points[2]),I=_+(_-B.points[3])),K.push(et,I,M.shift(),M.shift()),y=M.shift(),_=M.shift(),Z="C",K.push(y,_);break;case"s":et=y,I=_,B=m[m.length-1],B.command==="C"&&(et=y+(y-B.points[2]),I=_+(_-B.points[3])),K.push(et,I,y+M.shift(),_+M.shift()),y+=M.shift(),_+=M.shift(),Z="C",K.push(y,_);break;case"Q":K.push(M.shift(),M.shift()),y=M.shift(),_=M.shift(),K.push(y,_);break;case"q":K.push(y+M.shift(),_+M.shift()),y+=M.shift(),_+=M.shift(),Z="Q",K.push(y,_);break;case"T":et=y,I=_,B=m[m.length-1],B.command==="Q"&&(et=y+(y-B.points[0]),I=_+(_-B.points[1])),y=M.shift(),_=M.shift(),Z="Q",K.push(et,I,y,_);break;case"t":et=y,I=_,B=m[m.length-1],B.command==="Q"&&(et=y+(y-B.points[0]),I=_+(_-B.points[1])),y+=M.shift(),_+=M.shift(),Z="Q",K.push(et,I,y,_);break;case"A":F=M.shift(),ut=M.shift(),it=M.shift(),Et=M.shift(),Nt=M.shift(),bt=y,Yt=_,y=M.shift(),_=M.shift(),Z="A",K=this.convertEndpointToCenterParameterization(bt,Yt,y,_,Et,Nt,F,ut,it);break;case"a":F=M.shift(),ut=M.shift(),it=M.shift(),Et=M.shift(),Nt=M.shift(),bt=y,Yt=_,y+=M.shift(),_+=M.shift(),Z="A",K=this.convertEndpointToCenterParameterization(bt,Yt,y,_,Et,Nt,F,ut,it);break}m.push({command:Z||O,points:K,start:{x:J,y:L},pathLength:this.calcLength(J,L,Z||O,K)})}(O==="z"||O==="Z")&&m.push({command:"z",points:[],start:void 0,pathLength:0})}return m}static calcLength(l,u,f,r){let m,p,y,_;const E=He;switch(f){case"L":return E.getLineLength(l,u,r[0],r[1]);case"C":return X2([l,r[0],r[2],r[4]],[u,r[1],r[3],r[5]],1);case"Q":return Q2([l,r[0],r[2]],[u,r[1],r[3]],1);case"A":m=0;const x=r[4],C=r[5],A=r[4]+C;let O=Math.PI/180;if(Math.abs(x-A)A;_-=O)y=E.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],_,0),m+=E.getLineLength(p.x,p.y,y.x,y.y),p=y;else for(_=x+O;_1&&(y*=Math.sqrt(O),_*=Math.sqrt(O));let M=Math.sqrt((y*y*(_*_)-y*y*(A*A)-_*_*(C*C))/(y*y*(A*A)+_*_*(C*C)));m===p&&(M*=-1),isNaN(M)&&(M=0);const V=M*y*A/_,Z=M*-_*C/y,K=(l+f)/2+Math.cos(x)*V-Math.sin(x)*Z,J=(u+r)/2+Math.sin(x)*V+Math.cos(x)*Z,L=function(Et){return Math.sqrt(Et[0]*Et[0]+Et[1]*Et[1])},B=function(Et,Nt){return(Et[0]*Nt[0]+Et[1]*Nt[1])/(L(Et)*L(Nt))},et=function(Et,Nt){return(Et[0]*Nt[1]=1&&(it=0),p===0&&it>0&&(it=it-2*Math.PI),p===1&&it<0&&(it=it+2*Math.PI),[K,J,y,_,I,it,x,p]}}He.prototype.className="Path";He.prototype._attrsAffectingSize=["data"];$e(He);N.addGetterSetter(He,"data");let Mc=class extends _u{_sceneFunc(l){super._sceneFunc(l);const u=Math.PI*2,f=this.points();let r=f;const m=this.tension()!==0&&f.length>4;m&&(r=this.getTensionPoints());const p=this.pointerLength(),y=f.length;let _,E;if(m){const A=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],f[y-2],f[y-1]],O=He.calcLength(r[r.length-4],r[r.length-3],"C",A),M=He.getPointOnQuadraticBezier(Math.min(1,1-p/O),A[0],A[1],A[2],A[3],A[4],A[5]);_=f[y-2]-M.x,E=f[y-1]-M.y}else _=f[y-2]-f[y-4],E=f[y-1]-f[y-3];const x=(Math.atan2(E,_)+u)%u,C=this.pointerWidth();this.pointerAtEnding()&&(l.save(),l.beginPath(),l.translate(f[y-2],f[y-1]),l.rotate(x),l.moveTo(0,0),l.lineTo(-p,C/2),l.lineTo(-p,-C/2),l.closePath(),l.restore(),this.__fillStroke(l)),this.pointerAtBeginning()&&(l.save(),l.beginPath(),l.translate(f[0],f[1]),m?(_=(r[0]+r[2])/2-f[0],E=(r[1]+r[3])/2-f[1]):(_=f[2]-f[0],E=f[3]-f[1]),l.rotate((Math.atan2(-E,-_)+u)%u),l.moveTo(0,0),l.lineTo(-p,C/2),l.lineTo(-p,-C/2),l.closePath(),l.restore(),this.__fillStroke(l))}__fillStroke(l){const u=this.dashEnabled();u&&(this.attrs.dashEnabled=!1,l.setLineDash([])),l.fillStrokeShape(this),u&&(this.attrs.dashEnabled=!0)}getSelfRect(){const l=super.getSelfRect(),u=this.pointerWidth()/2;return{x:l.x,y:l.y-u,width:l.width,height:l.height+u*2}}};Mc.prototype.className="Arrow";$e(Mc);N.addGetterSetter(Mc,"pointerLength",10,vt());N.addGetterSetter(Mc,"pointerWidth",10,vt());N.addGetterSetter(Mc,"pointerAtBeginning",!1);N.addGetterSetter(Mc,"pointerAtEnding",!0);class lr extends ot{_sceneFunc(l){l.beginPath(),l.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(l){this.radius()!==l/2&&this.radius(l/2)}setHeight(l){this.radius()!==l/2&&this.radius(l/2)}}lr.prototype._centroid=!0;lr.prototype.className="Circle";lr.prototype._attrsAffectingSize=["radius"];$e(lr);N.addGetterSetter(lr,"radius",0,vt());class Ms extends ot{_sceneFunc(l){const u=this.radiusX(),f=this.radiusY();l.beginPath(),l.save(),u!==f&&l.scale(1,f/u),l.arc(0,0,u,0,Math.PI*2,!1),l.restore(),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(l){this.radiusX(l/2)}setHeight(l){this.radiusY(l/2)}}Ms.prototype.className="Ellipse";Ms.prototype._centroid=!0;Ms.prototype._attrsAffectingSize=["radiusX","radiusY"];$e(Ms);N.addComponentsGetterSetter(Ms,"radius",["x","y"]);N.addGetterSetter(Ms,"radiusX",0,vt());N.addGetterSetter(Ms,"radiusY",0,vt());let Kn=class z3 extends ot{constructor(l){super(l),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",u=>{this._removeImageLoad(u.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const l=this.image();l&&l.complete||l&&l.readyState===4||l&&l.addEventListener&&l.addEventListener("load",this._loadListener)}_removeImageLoad(l){l&&l.removeEventListener&&l.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const l=!!this.cornerRadius(),u=this.hasShadow();return l&&u?!0:super._useBufferCanvas(!0)}_sceneFunc(l){const u=this.getWidth(),f=this.getHeight(),r=this.cornerRadius(),m=this.attrs.image;let p;if(m){const y=this.attrs.cropWidth,_=this.attrs.cropHeight;y&&_?p=[m,this.cropX(),this.cropY(),y,_,0,0,u,f]:p=[m,0,0,u,f]}(this.hasFill()||this.hasStroke()||r)&&(l.beginPath(),r?j.drawRoundedRectPath(l,u,f,r):l.rect(0,0,u,f),l.closePath(),l.fillStrokeShape(this)),m&&(r&&l.clip(),l.drawImage.apply(l,p))}_hitFunc(l){const u=this.width(),f=this.height(),r=this.cornerRadius();l.beginPath(),r?j.drawRoundedRectPath(l,u,f,r):l.rect(0,0,u,f),l.closePath(),l.fillStrokeShape(this)}getWidth(){var l,u,f;return(f=(l=this.attrs.width)!==null&&l!==void 0?l:(u=this.image())===null||u===void 0?void 0:u.width)!==null&&f!==void 0?f:0}getHeight(){var l,u,f;return(f=(l=this.attrs.height)!==null&&l!==void 0?l:(u=this.image())===null||u===void 0?void 0:u.height)!==null&&f!==void 0?f:0}static fromURL(l,u,f=null){const r=j.createImageElement();r.onload=function(){const m=new z3({image:r});u(m)},r.onerror=f,r.crossOrigin="Anonymous",r.src=l}};Kn.prototype.className="Image";Kn.prototype._attrsAffectingSize=["image"];$e(Kn);N.addGetterSetter(Kn,"cornerRadius",0,cd(4));N.addGetterSetter(Kn,"image");N.addComponentsGetterSetter(Kn,"crop",["x","y","width","height"]);N.addGetterSetter(Kn,"cropX",0,vt());N.addGetterSetter(Kn,"cropY",0,vt());N.addGetterSetter(Kn,"cropWidth",0,vt());N.addGetterSetter(Kn,"cropHeight",0,vt());const M3=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],A5="Change.konva",z5="none",y1="up",S1="right",_1="down",b1="left",M5=M3.length;class N1 extends er{constructor(l){super(l),this.on("add.konva",function(u){this._addListeners(u.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(l){let u=this,f;const r=function(){u._sync()};for(f=0;f{u=Math.min(u,p.x),f=Math.max(f,p.x),r=Math.min(r,p.y),m=Math.max(m,p.y)}),{x:u,y:r,width:f-u,height:m-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(l){this.radius(l/2)}setHeight(l){this.radius(l/2)}}Ns.prototype.className="RegularPolygon";Ns.prototype._centroid=!0;Ns.prototype._attrsAffectingSize=["radius"];$e(Ns);N.addGetterSetter(Ns,"radius",0,vt());N.addGetterSetter(Ns,"sides",0,vt());N.addGetterSetter(Ns,"cornerRadius",0,cd(4));const Z2=Math.PI*2;class Oc extends ot{_sceneFunc(l){l.beginPath(),l.arc(0,0,this.innerRadius(),0,Z2,!1),l.moveTo(this.outerRadius(),0),l.arc(0,0,this.outerRadius(),Z2,0,!0),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(l){this.outerRadius(l/2)}setHeight(l){this.outerRadius(l/2)}}Oc.prototype.className="Ring";Oc.prototype._centroid=!0;Oc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];$e(Oc);N.addGetterSetter(Oc,"innerRadius",0,vt());N.addGetterSetter(Oc,"outerRadius",0,vt());class Ri extends ot{constructor(l){super(l),this._updated=!0,this.anim=new yn(()=>{const u=this._updated;return this._updated=!1,u}),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(l){const u=this.animation(),f=this.frameIndex(),r=f*4,m=this.animations()[u],p=this.frameOffsets(),y=m[r+0],_=m[r+1],E=m[r+2],x=m[r+3],C=this.image();if((this.hasFill()||this.hasStroke())&&(l.beginPath(),l.rect(0,0,E,x),l.closePath(),l.fillStrokeShape(this)),C)if(p){const A=p[u],O=f*2;l.drawImage(C,y,_,E,x,A[O+0],A[O+1],E,x)}else l.drawImage(C,y,_,E,x,0,0,E,x)}_hitFunc(l){const u=this.animation(),f=this.frameIndex(),r=f*4,m=this.animations()[u],p=this.frameOffsets(),y=m[r+2],_=m[r+3];if(l.beginPath(),p){const E=p[u],x=f*2;l.rect(E[x+0],E[x+1],y,_)}else l.rect(0,0,y,_);l.closePath(),l.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const l=this;this.interval=setInterval(function(){l._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const l=this.getLayer();this.anim.setLayers(l),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const l=this.frameIndex(),u=this.animation(),f=this.animations(),r=f[u],m=r.length/4;l{if(new RegExp("\\p{Emoji}","u").test(u)){const m=r[f+1];m&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(m)?(l.push(u+m),r[f+1]=""):l.push(u)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(u+(r[f+1]||""))?l.push(u+r[f+1]):f>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(u)?l[l.length-1]+=u:u&&l.push(u);return l},[])}const $f="auto",N5="center",N3="inherit",Xo="justify",O5="Change.konva",R5="2d",K2="-",O3="left",D5="text",G5="Text",H5="top",U5="bottom",w2="middle",R3="normal",B5="px ",I0=" ",Y5="right",J2="rtl",q5="word",j5="char",W2="none",n1="…",D3=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],L5=D3.length;function X5(d){return d.split(",").map(l=>{l=l.trim();const u=l.indexOf(" ")>=0,f=l.indexOf('"')>=0||l.indexOf("'")>=0;return u&&!f&&(l=`"${l}"`),l}).join(", ")}let $0;function i1(){return $0||($0=j.createCanvasElement().getContext(R5),$0)}function Q5(d){d.fillText(this._partialText,this._partialTextX,this._partialTextY)}function V5(d){d.setAttr("miterLimit",2),d.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Z5(d){return d=d||{},!d.fillLinearGradientColorStops&&!d.fillRadialGradientColorStops&&!d.fillPatternImage&&(d.fill=d.fill||"black"),d}let Ve=class extends ot{constructor(l){super(Z5(l)),this._partialTextX=0,this._partialTextY=0;for(let u=0;uR+Cs(tt.text).length,0),Mt=U+xt;V({char:ct,index:Mt,x:F,y:et+ut,lineIndex:B,column:U,isLastInLine:bt,width:this.measureSize(ct).width,context:l})}l.fillStrokeShape(this),V&&l.restore(),F+=this.measureSize(ct).width+M}}else M!==0&&l.setAttr("letterSpacing",`${M}px`),this._partialTextX=F,this._partialTextY=et+ut,this._partialText=Et,l.fillStrokeShape(this);if(L){l.save(),l.beginPath();const Ot=yt.legacyTextRendering?0:-Math.round(y/4),St=Yt;l.moveTo(St,et+ut+Ot);const U=A===Xo&&!bt?O-p*2:Nt;l.lineTo(St+Math.round(U),et+ut+Ot),l.lineWidth=y/15;const ct=this._getLinearGradient();l.strokeStyle=ct||Z,l.stroke(),l.restore()}l.restore(),m>1&&(et+=_)}}_hitFunc(l){const u=this.getWidth(),f=this.getHeight();l.beginPath(),l.rect(0,0,u,f),l.closePath(),l.fillStrokeShape(this)}setText(l){const u=j._isString(l)?l:l==null?"":l+"";return this._setAttr(D5,u),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 j.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(l){var u,f,r,m,p,y,_,E,x,C,A;let O=i1(),M=this.fontSize(),V;O.save(),O.font=this._getContextFont(),V=O.measureText(l),O.restore();const Z=M/100;return{actualBoundingBoxAscent:(u=V.actualBoundingBoxAscent)!==null&&u!==void 0?u:71.58203125*Z,actualBoundingBoxDescent:(f=V.actualBoundingBoxDescent)!==null&&f!==void 0?f:0,actualBoundingBoxLeft:(r=V.actualBoundingBoxLeft)!==null&&r!==void 0?r:-7.421875*Z,actualBoundingBoxRight:(m=V.actualBoundingBoxRight)!==null&&m!==void 0?m:75.732421875*Z,alphabeticBaseline:(p=V.alphabeticBaseline)!==null&&p!==void 0?p:0,emHeightAscent:(y=V.emHeightAscent)!==null&&y!==void 0?y:100*Z,emHeightDescent:(_=V.emHeightDescent)!==null&&_!==void 0?_:-20*Z,fontBoundingBoxAscent:(E=V.fontBoundingBoxAscent)!==null&&E!==void 0?E:91*Z,fontBoundingBoxDescent:(x=V.fontBoundingBoxDescent)!==null&&x!==void 0?x:21*Z,hangingBaseline:(C=V.hangingBaseline)!==null&&C!==void 0?C:72.80000305175781*Z,ideographicBaseline:(A=V.ideographicBaseline)!==null&&A!==void 0?A:-21*Z,width:V.width,height:M}}_getContextFont(){return this.fontStyle()+I0+this.fontVariant()+I0+(this.fontSize()+B5)+X5(this.fontFamily())}_addTextLine(l){this.align()===Xo&&(l=l.trim());const f=this._getTextWidth(l);return this.textArr.push({text:l,width:f,lastInParagraph:!1})}_getTextWidth(l){const u=this.letterSpacing(),f=l.length;return i1().measureText(l).width+u*f}_setTextData(){let l=this.text().split(` -`),u=+this.fontSize(),f=0,r=this.lineHeight()*u,m=this.attrs.width,p=this.attrs.height,y=m!==$f&&m!==void 0,_=p!==$f&&p!==void 0,E=this.padding(),x=m-E*2,C=p-E*2,A=0,O=this.wrap(),M=O!==W2,V=O!==j5&&M,Z=this.ellipsis();this.textArr=[],i1().font=this._getContextFont();const K=Z?this._getTextWidth(n1):0;for(let J=0,L=l.length;Jx)for(;B.length>0;){let I=0,F=Cs(B).length,ut="",it=0;for(;I>>1,Nt=Cs(B),bt=Nt.slice(0,Et+1).join(""),Yt=this._getTextWidth(bt);(Z&&_&&A+r>C?Yt+K:Yt)<=x?(I=Et+1,ut=bt,it=Yt):F=Et}if(ut){if(V){const bt=Cs(B),Yt=Cs(ut),Ot=bt[Yt.length],St=Ot===I0||Ot===K2;let U;if(St&&it<=x)U=Yt.length;else{const ct=Yt.lastIndexOf(I0),ft=Yt.lastIndexOf(K2);U=Math.max(ct,ft)+1}U>0&&(I=U,ut=bt.slice(0,I).join(""),it=this._getTextWidth(ut))}if(ut=ut.trimRight(),this._addTextLine(ut),f=Math.max(f,it),A+=r,this._shouldHandleEllipsis(A)){this._tryToAddEllipsisToLastLine();break}if(B=Cs(B).slice(I).join("").trimLeft(),B.length>0&&(et=this._getTextWidth(B),et<=x)){this._addTextLine(B),A+=r,f=Math.max(f,et);break}}else break}else this._addTextLine(B),A+=r,f=Math.max(f,et),this._shouldHandleEllipsis(A)&&JC)break}this.textHeight=u,this.textWidth=f}_shouldHandleEllipsis(l){const u=+this.fontSize(),f=this.lineHeight()*u,r=this.attrs.height,m=r!==$f&&r!==void 0,p=this.padding(),y=r-p*2;return!(this.wrap()!==W2)||m&&l+f>y}_tryToAddEllipsisToLastLine(){const l=this.attrs.width,u=l!==$f&&l!==void 0,f=this.padding(),r=l-f*2,m=this.ellipsis(),p=this.textArr[this.textArr.length-1];!p||!m||(u&&(this._getTextWidth(p.text+n1)u?null:He.getPointAtLengthOfDataArray(l,this.dataArray)}_readDataAttribute(){this.dataArray=He.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(l){l.setAttr("font",this._getContextFont()),l.setAttr("textBaseline",this.textBaseline()),l.setAttr("textAlign","left"),l.save();const u=this.textDecoration(),f=this.fill(),r=this.fontSize(),m=this.glyphInfo,p=u.indexOf("underline")!==-1,y=u.indexOf("line-through")!==-1;p&&l.beginPath();for(let _=0;_=1){const f=u[0].p0;l.moveTo(f.x,f.y)}for(let f=0;fd+`.${B3}`).join(" "),F2="nodesRect",J5=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],W5={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},F5="ontouchstart"in yt._global;function k5(d,l,u){if(d==="rotater")return u;l+=j.degToRad(W5[d]||0);const f=(j.radToDeg(l)%360+360)%360;return j._inRange(f,315+22.5,360)||j._inRange(f,0,22.5)?"ns-resize":j._inRange(f,45-22.5,45+22.5)?"nesw-resize":j._inRange(f,90-22.5,90+22.5)?"ew-resize":j._inRange(f,135-22.5,135+22.5)?"nwse-resize":j._inRange(f,180-22.5,180+22.5)?"ns-resize":j._inRange(f,225-22.5,225+22.5)?"nesw-resize":j._inRange(f,270-22.5,270+22.5)?"ew-resize":j._inRange(f,315-22.5,315+22.5)?"nwse-resize":(j.error("Transformer has unknown angle for cursor detection: "+f),"pointer")}const nd=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function P5(d){return{x:d.x+d.width/2*Math.cos(d.rotation)+d.height/2*Math.sin(-d.rotation),y:d.y+d.height/2*Math.cos(d.rotation)+d.width/2*Math.sin(d.rotation)}}function Y3(d,l,u){const f=u.x+(d.x-u.x)*Math.cos(l)-(d.y-u.y)*Math.sin(l),r=u.y+(d.x-u.x)*Math.sin(l)+(d.y-u.y)*Math.cos(l);return{...d,rotation:d.rotation+l,x:f,y:r}}function I5(d,l){const u=P5(d);return Y3(d,l,u)}function $5(d,l,u){let f=l;for(let r=0;rr.isAncestorOf(this)?(j.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=l=u,l.length===1&&this.useSingleNodeRotation()?this.rotation(l[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(r=>{const m=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(r._attrsAffectingSize.length){const p=r._attrsAffectingSize.map(y=>y+"Change."+this._getEventNamespace()).join(" ");r.on(p,m)}r.on(J5.map(p=>p+`.${this._getEventNamespace()}`).join(" "),m),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,m),this._proxyDrag(r)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(l){let u;l.on(`dragstart.${this._getEventNamespace()}`,f=>{u=l.getAbsolutePosition(),!this.isDragging()&&l!==this.findOne(".back")&&this.startDrag(f,!1)}),l.on(`dragmove.${this._getEventNamespace()}`,f=>{if(!u)return;const r=l.getAbsolutePosition(),m=r.x-u.x,p=r.y-u.y;this.nodes().forEach(y=>{if(y===l||y.isDragging())return;const _=y.getAbsolutePosition();y.setAbsolutePosition({x:_.x+m,y:_.y+p}),y.startDrag(f)}),u=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(l=>{l.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(F2),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(F2,this.__getNodeRect)}__getNodeShape(l,u=this.rotation(),f){const r=l.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),m=l.getAbsoluteScale(f),p=l.getAbsolutePosition(f),y=r.x*m.x-l.offsetX()*m.x,_=r.y*m.y-l.offsetY()*m.y,E=(yt.getAngle(l.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),x={x:p.x+y*Math.cos(E)+_*Math.sin(-E),y:p.y+_*Math.cos(E)+y*Math.sin(E),width:r.width*m.x,height:r.height*m.y,rotation:E};return Y3(x,-yt.getAngle(u),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const u=[];this.nodes().map(E=>{const x=E.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),C=[{x:x.x,y:x.y},{x:x.x+x.width,y:x.y},{x:x.x+x.width,y:x.y+x.height},{x:x.x,y:x.y+x.height}],A=E.getAbsoluteTransform();C.forEach(function(O){const M=A.point(O);u.push(M)})});const f=new Xl;f.rotate(-yt.getAngle(this.rotation()));let r=1/0,m=1/0,p=-1/0,y=-1/0;u.forEach(function(E){const x=f.point(E);r===void 0&&(r=p=x.x,m=y=x.y),r=Math.min(r,x.x),m=Math.min(m,x.y),p=Math.max(p,x.x),y=Math.max(y,x.y)}),f.invert();const _=f.point({x:r,y:m});return{x:_.x,y:_.y,width:p-r,height:y-m,rotation:yt.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(),nd.forEach(l=>{this._createAnchor(l)}),this._createAnchor("rotater")}_createAnchor(l){const u=new th({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:l+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:F5?10:"auto"}),f=this;u.on("mousedown touchstart",function(r){f._handleMouseDown(r)}),u.on("dragstart",r=>{u.stopDrag(),r.cancelBubble=!0}),u.on("dragend",r=>{r.cancelBubble=!0}),u.on("mouseenter",()=>{const r=yt.getAngle(this.rotation()),m=this.rotateAnchorCursor(),p=k5(l,r,m);u.getStage().content&&(u.getStage().content.style.cursor=p),this._cursorChange=!0}),u.on("mouseout",()=>{u.getStage().content&&(u.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(u)}_createBack(){const l=new ot({name:"back",width:0,height:0,sceneFunc(u,f){const r=f.getParent(),m=r.padding();u.beginPath(),u.rect(-m,-m,f.width()+m*2,f.height()+m*2),u.moveTo(f.width()/2,-m),r.rotateEnabled()&&r.rotateLineVisible()&&u.lineTo(f.width()/2,-r.rotateAnchorOffset()*j._sign(f.height())-m),u.fillStrokeShape(f)},hitFunc:(u,f)=>{if(!this.shouldOverdrawWholeArea())return;const r=this.padding();u.beginPath(),u.rect(-r,-r,f.width()+r*2,f.height()+r*2),u.fillStrokeShape(f)}});this.add(l),this._proxyDrag(l),l.on("dragstart",u=>{u.cancelBubble=!0}),l.on("dragmove",u=>{u.cancelBubble=!0}),l.on("dragend",u=>{u.cancelBubble=!0}),this.on("dragmove",u=>{this.update()})}_handleMouseDown(l){if(this._transforming)return;this._movingAnchorName=l.target.name().split(" ")[0];const u=this._getNodeRect(),f=u.width,r=u.height,m=Math.sqrt(Math.pow(f,2)+Math.pow(r,2));this.sin=Math.abs(r/m),this.cos=Math.abs(f/m),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 p=l.target.getAbsolutePosition(),y=l.target.getStage().getPointerPosition();this._anchorDragOffset={x:y.x-p.x,y:y.y-p.y},E1++,this._fire("transformstart",{evt:l.evt,target:this.getNode()}),this._nodes.forEach(_=>{_._fire("transformstart",{evt:l.evt,target:_})})}_handleMouseMove(l){let u,f,r;const m=this.findOne("."+this._movingAnchorName),p=m.getStage();p.setPointersPositions(l);const y=p.getPointerPosition();let _={x:y.x-this._anchorDragOffset.x,y:y.y-this._anchorDragOffset.y};const E=m.getAbsolutePosition();this.anchorDragBoundFunc()&&(_=this.anchorDragBoundFunc()(E,_,l)),m.setAbsolutePosition(_);const x=m.getAbsolutePosition();if(E.x===x.x&&E.y===x.y)return;if(this._movingAnchorName==="rotater"){const J=this._getNodeRect();u=m.x()-J.width/2,f=-m.y()+J.height/2;let L=Math.atan2(-f,u)+Math.PI/2;J.height<0&&(L-=Math.PI);const et=yt.getAngle(this.rotation())+L,I=yt.getAngle(this.rotationSnapTolerance()),ut=$5(this.rotationSnaps(),et,I)-J.rotation,it=I5(J,ut);this._fitNodesInto(it,l);return}const C=this.shiftBehavior();let A;C==="inverted"?A=this.keepRatio()&&!l.shiftKey:C==="none"?A=this.keepRatio():A=this.keepRatio()||l.shiftKey;let O=this.centeredScaling()||l.altKey;if(this._movingAnchorName==="top-left"){if(A){const J=O?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(J.x-m.x(),2)+Math.pow(J.y-m.y(),2));const L=this.findOne(".top-left").x()>J.x?-1:1,B=this.findOne(".top-left").y()>J.y?-1:1;u=r*this.cos*L,f=r*this.sin*B,this.findOne(".top-left").x(J.x-u),this.findOne(".top-left").y(J.y-f)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(m.y());else if(this._movingAnchorName==="top-right"){if(A){const J=O?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(m.x()-J.x,2)+Math.pow(J.y-m.y(),2));const L=this.findOne(".top-right").x()J.y?-1:1;u=r*this.cos*L,f=r*this.sin*B,this.findOne(".top-right").x(J.x+u),this.findOne(".top-right").y(J.y-f)}var M=m.position();this.findOne(".top-left").y(M.y),this.findOne(".bottom-right").x(M.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(m.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(m.x());else if(this._movingAnchorName==="bottom-left"){if(A){const J=O?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(J.x-m.x(),2)+Math.pow(m.y()-J.y,2));const L=J.x{var m;r._fire("transformend",{evt:l,target:r}),(m=r.getLayer())===null||m===void 0||m.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(l,u){const f=this._getNodeRect(),r=1;if(j._inRange(l.width,-this.padding()*2-r,r)){this.update();return}if(j._inRange(l.height,-this.padding()*2-r,r)){this.update();return}const m=new Xl;if(m.rotate(yt.getAngle(this.rotation())),this._movingAnchorName&&l.width<0&&this._movingAnchorName.indexOf("left")>=0){const A=m.point({x:-this.padding()*2,y:0});l.x+=A.x,l.y+=A.y,l.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=A.x,this._anchorDragOffset.y-=A.y}else if(this._movingAnchorName&&l.width<0&&this._movingAnchorName.indexOf("right")>=0){const A=m.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=A.x,this._anchorDragOffset.y-=A.y,l.width+=this.padding()*2}if(this._movingAnchorName&&l.height<0&&this._movingAnchorName.indexOf("top")>=0){const A=m.point({x:0,y:-this.padding()*2});l.x+=A.x,l.y+=A.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=A.x,this._anchorDragOffset.y-=A.y,l.height+=this.padding()*2}else if(this._movingAnchorName&&l.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const A=m.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=A.x,this._anchorDragOffset.y-=A.y,l.height+=this.padding()*2}if(this.boundBoxFunc()){const A=this.boundBoxFunc()(f,l);A?l=A:j.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const p=1e7,y=new Xl;y.translate(f.x,f.y),y.rotate(f.rotation),y.scale(f.width/p,f.height/p);const _=new Xl,E=l.width/p,x=l.height/p;this.flipEnabled()===!1?(_.translate(l.x,l.y),_.rotate(l.rotation),_.translate(l.width<0?l.width:0,l.height<0?l.height:0),_.scale(Math.abs(E),Math.abs(x))):(_.translate(l.x,l.y),_.rotate(l.rotation),_.scale(E,x));const C=_.multiply(y.invert());this._nodes.forEach(A=>{var O;if(!A.getStage())return;const M=A.getParent().getAbsoluteTransform(),V=A.getTransform().copy();V.translate(A.offsetX(),A.offsetY());const Z=new Xl;Z.multiply(M.copy().invert()).multiply(C).multiply(M).multiply(V);const K=Z.decompose();A.setAttrs(K),(O=A.getLayer())===null||O===void 0||O.batchDraw()}),this.rotation(j._getRotation(l.rotation)),this._nodes.forEach(A=>{this._fire("transform",{evt:u,target:A}),A._fire("transform",{evt:u,target:A})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(l,u){this.findOne(l).setAttrs(u)}update(){var l;const u=this._getNodeRect();this.rotation(j._getRotation(u.rotation));const f=u.width,r=u.height,m=this.enabledAnchors(),p=this.resizeEnabled(),y=this.padding(),_=this.anchorSize(),E=this.find("._anchor");E.forEach(C=>{C.setAttrs({width:_,height:_,offsetX:_/2,offsetY:_/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:_/2+y,offsetY:_/2+y,visible:p&&m.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:f/2,y:0,offsetY:_/2+y,visible:p&&m.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:f,y:0,offsetX:_/2-y,offsetY:_/2+y,visible:p&&m.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:_/2+y,visible:p&&m.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:f,y:r/2,offsetX:_/2-y,visible:p&&m.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:_/2+y,offsetY:_/2-y,visible:p&&m.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:f/2,y:r,offsetY:_/2-y,visible:p&&m.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:f,y:r,offsetX:_/2-y,offsetY:_/2-y,visible:p&&m.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:f/2,y:-this.rotateAnchorOffset()*j._sign(r)-y,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:f,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(C=>C.draggable()),x:0,y:0});const x=this.anchorStyleFunc();x&&E.forEach(C=>{x(C)}),(l=this.getLayer())===null||l===void 0||l.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const l=this.findOne("."+this._movingAnchorName);l&&l.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),er.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return pt.prototype.toObject.call(this)}clone(l){return pt.prototype.clone.call(this,l)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};ce.isTransforming=()=>E1>0;function tg(d){return d instanceof Array||j.warn("enabledAnchors value should be an array"),d instanceof Array&&d.forEach(function(l){nd.indexOf(l)===-1&&j.warn("Unknown anchor name: "+l+". Available names are: "+nd.join(", "))}),d||[]}ce.prototype.className="Transformer";$e(ce);N.addGetterSetter(ce,"enabledAnchors",nd,tg);N.addGetterSetter(ce,"flipEnabled",!0,Zn());N.addGetterSetter(ce,"resizeEnabled",!0);N.addGetterSetter(ce,"anchorSize",10,vt());N.addGetterSetter(ce,"rotateEnabled",!0);N.addGetterSetter(ce,"rotateLineVisible",!0);N.addGetterSetter(ce,"rotationSnaps",[]);N.addGetterSetter(ce,"rotateAnchorOffset",50,vt());N.addGetterSetter(ce,"rotateAnchorCursor","crosshair");N.addGetterSetter(ce,"rotationSnapTolerance",5,vt());N.addGetterSetter(ce,"borderEnabled",!0);N.addGetterSetter(ce,"anchorStroke","rgb(0, 161, 255)");N.addGetterSetter(ce,"anchorStrokeWidth",1,vt());N.addGetterSetter(ce,"anchorFill","white");N.addGetterSetter(ce,"anchorCornerRadius",0,vt());N.addGetterSetter(ce,"borderStroke","rgb(0, 161, 255)");N.addGetterSetter(ce,"borderStrokeWidth",1,vt());N.addGetterSetter(ce,"borderDash");N.addGetterSetter(ce,"keepRatio",!0);N.addGetterSetter(ce,"shiftBehavior","default");N.addGetterSetter(ce,"centeredScaling",!1);N.addGetterSetter(ce,"ignoreStroke",!1);N.addGetterSetter(ce,"padding",0,vt());N.addGetterSetter(ce,"nodes");N.addGetterSetter(ce,"node");N.addGetterSetter(ce,"boundBoxFunc");N.addGetterSetter(ce,"anchorDragBoundFunc");N.addGetterSetter(ce,"anchorStyleFunc");N.addGetterSetter(ce,"shouldOverdrawWholeArea",!1);N.addGetterSetter(ce,"useSingleNodeRotation",!0);N.backCompat(ce,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class bu extends ot{_sceneFunc(l){l.beginPath(),l.arc(0,0,this.radius(),0,yt.getAngle(this.angle()),this.clockwise()),l.lineTo(0,0),l.closePath(),l.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(l){this.radius(l/2)}setHeight(l){this.radius(l/2)}}bu.prototype.className="Wedge";bu.prototype._centroid=!0;bu.prototype._attrsAffectingSize=["radius"];$e(bu);N.addGetterSetter(bu,"radius",0,vt());N.addGetterSetter(bu,"angle",0,vt());N.addGetterSetter(bu,"clockwise",!1);N.backCompat(bu,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function k2(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const eg=[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],ag=[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 lg(d,l){const u=d.data,f=d.width,r=d.height;let m,p,y,_,E,x,C,A,O,M,V,Z,K,J,L,B,et,I,F,ut;const it=l+l+1,Et=f-1,Nt=r-1,bt=l+1,Yt=bt*(bt+1)/2,Ot=new k2,St=eg[l],U=ag[l];let ct=null,ft=Ot,xt=null,Mt=null;for(let R=1;R>U,F!==0?(F=255/F,u[p]=(_*St>>U)*F,u[p+1]=(E*St>>U)*F,u[p+2]=(x*St>>U)*F):u[p]=u[p+1]=u[p+2]=0,_-=A,E-=O,x-=M,C-=V,A-=xt.r,O-=xt.g,M-=xt.b,V-=xt.a,m=y+((m=tt+l+1)>U,F>0?(F=255/F,u[m]=(_*St>>U)*F,u[m+1]=(E*St>>U)*F,u[m+2]=(x*St>>U)*F):u[m]=u[m+1]=u[m+2]=0,_-=A,E-=O,x-=M,C-=V,A-=xt.r,O-=xt.g,M-=xt.b,V-=xt.a,m=R+((m=dt+bt)0&&lg(l,u)};N.addGetterSetter(pt,"blurRadius",0,vt(),N.afterSetFilter);const ig=function(d){const l=this.brightness()*255,u=d.data,f=u.length;for(let r=0;r255?255:r,m=m<0?0:m>255?255:m,p=p<0?0:p>255?255:p,u[y]=r,u[y+1]=m,u[y+2]=p};N.addGetterSetter(pt,"contrast",0,vt(),N.afterSetFilter);const cg=function(d){var l,u,f,r,m,p,y,_,E;const x=d.data,C=d.width,A=d.height,O=Math.min(1,Math.max(0,(u=(l=this.embossStrength)===null||l===void 0?void 0:l.call(this))!==null&&u!==void 0?u:.5)),M=Math.min(1,Math.max(0,(r=(f=this.embossWhiteLevel)===null||f===void 0?void 0:f.call(this))!==null&&r!==void 0?r:.5)),Z=(y={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(p=(m=this.embossDirection)===null||m===void 0?void 0:m.call(this))!==null&&p!==void 0?p:"top-left"])!==null&&y!==void 0?y:315,K=!!((E=(_=this.embossBlend)===null||_===void 0?void 0:_.call(this))!==null&&E!==void 0&&E),J=O*10,L=M*255,B=Z*Math.PI/180,et=Math.cos(B),I=Math.sin(B),F=128/1020*J,ut=new Uint8ClampedArray(x),it=new Float32Array(C*A);for(let Ot=0,St=0;StOt<0?0:Ot>255?255:Ot;for(let Ot=1;Otr&&(r=m),_=l[L+1],_y&&(y=_),C=l[L+2],Cx&&(x=C);r===f&&(r=255,f=0),y===p&&(y=255,p=0),x===E&&(x=255,E=0);let O,M,V,Z,K,J;if(A>0)O=r+A*(255-r),M=f-A*(f-0),V=y+A*(255-y),Z=p-A*(p-0),K=x+A*(255-x),J=E-A*(E-0);else{const L=(r+f)*.5;O=r+A*(r-L),M=f+A*(f-L);const B=(y+p)*.5;V=y+A*(y-B),Z=p+A*(p-B);const et=(x+E)*.5;K=x+A*(x-et),J=E+A*(E-et)}for(let L=0;LE?A:E;const O=p,M=m,V=360/M*Math.PI/180;for(let Z=0;ZE?A:E;const O=p,M=m,V=0;let Z,K;for(x=0;xl&&(B=L,et=0,I=-1),r=0;r=0&&O=0&&M=0&&O=0&&M=1020?255:0}return p}function Eg(d,l,u){const f=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],r=Math.round(Math.sqrt(f.length)),m=Math.floor(r/2),p=[];for(let y=0;y=0&&O=0&&M=u))for(let L=V;L=f)continue;const B=(u*L+J)*4;E+=p[B+0],x+=p[B+1],C+=p[B+2],A+=p[B+3],K+=1}E=E/K,x=x/K,C=C/K,A=A/K;for(let J=O;J=u))for(let L=V;L=f)continue;const B=(u*L+J)*4;p[B+0]=E,p[B+1]=x,p[B+2]=C,p[B+3]=A}}};N.addGetterSetter(pt,"pixelSize",8,vt(),N.afterSetFilter);const Ag=function(d){const l=Math.round(this.levels()*254)+1,u=d.data,f=u.length,r=255/l;for(let m=0;m255?255:d<0?0:Math.round(d)});N.addGetterSetter(pt,"green",0,function(d){return this._filterUpToDate=!1,d>255?255:d<0?0:Math.round(d)});N.addGetterSetter(pt,"blue",0,u3,N.afterSetFilter);const Mg=function(d){const l=d.data,u=l.length,f=this.red(),r=this.green(),m=this.blue(),p=this.alpha();for(let y=0;y255?255:d<0?0:Math.round(d)});N.addGetterSetter(pt,"green",0,function(d){return this._filterUpToDate=!1,d>255?255:d<0?0:Math.round(d)});N.addGetterSetter(pt,"blue",0,u3,N.afterSetFilter);N.addGetterSetter(pt,"alpha",1,function(d){return this._filterUpToDate=!1,d>1?1:d<0?0:d});const Ng=function(d){const l=d.data,u=l.length;for(let f=0;f=128&&(u[f]=255-r,u[f+1]=255-m,u[f+2]=255-p)}return d},Rg=function(d){const l=this.threshold()*255,u=d.data,f=u.length;for(let r=0;ruu||(a.current=Hf[uu],Hf[uu]=null,uu--)}function M(a,n){uu++,Hf[uu]=a.current,a.current=n}function V(a){return a>>>=0,a===0?32:31-(Uf(a)/x0|0)|0}function Z(a){var n=a&42;if(n!==0)return n;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 K(a,n,c){var o=a.pendingLanes;if(o===0)return 0;var v=0,S=a.suspendedLanes,T=a.pingedLanes;a=a.warmLanes;var G=o&134217727;return G!==0?(o=G&~S,o!==0?v=Z(o):(T&=G,T!==0?v=Z(T):c||(c=G&~a,c!==0&&(v=Z(c))))):(G=o&~S,G!==0?v=Z(G):T!==0?v=Z(T):c||(c=o&~a,c!==0&&(v=Z(c)))),v===0?0:n!==0&&n!==v&&(n&S)===0&&(S=v&-v,c=n&-n,S>=c||S===32&&(c&4194048)!==0)?n:v}function J(a,n){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&n)===0}function L(a,n){switch(a){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 B(){var a=cs;return cs<<=1,(cs&62914560)===0&&(cs=4194304),a}function et(a){for(var n=[],c=0;31>c;c++)n.push(a);return n}function I(a,n){a.pendingLanes|=n,n!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function F(a,n,c,o,v,S){var T=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var G=a.entanglements,P=a.expirationTimes,st=a.hiddenUpdates;for(c=T&~c;0)":-1v||P[o]!==st[v]){var mt=` -`+P[o].replace(" at new "," at ");return a.displayName&&mt.includes("")&&(mt=mt.replace("",a.displayName)),mt}while(1<=o&&0<=v);break}}}finally{mc=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?St(c):""}function ct(a,n){switch(a.tag){case 26:case 27:case 5:return St(a.type);case 16:return St("Lazy");case 13:return a.child!==n&&n!==null?St("Suspense Fallback"):St("Suspense");case 19:return St("SuspenseList");case 0:case 15:return U(a.type,!1);case 11:return U(a.type.render,!1);case 1:return U(a.type,!0);case 31:return St("Activity");default:return""}}function ft(a){try{var n="",c=null;do n+=ct(a,c),c=a,a=a.return;while(a);return n}catch(o){return` -Error generating stack: `+o.message+` -`+o.stack}}function xt(a,n){if(typeof a=="object"&&a!==null){var c=bo.get(a);return c!==void 0?c:(n={value:a,source:n,stack:ft(n)},bo.set(a,n),n)}return{value:a,source:n,stack:ft(n)}}function Mt(a,n){Yn[fn++]=gc,Yn[fn++]=_e,_e=a,gc=n}function R(a,n,c){Al[ol++]=Ea,Al[ol++]=Yl,Al[ol++]=zl,zl=a;var o=Ea;a=Yl;var v=32-Ia(o)-1;o&=~(1<>=T,v-=T,Ea=1<<32-Ia(n)+v|c<ie?(ya=Ht,Ht=null):ya=Ht.sibling;var re=_t(w,Ht,k[ie],ht);if(re===null){Ht===null&&(Ht=ya);break}a&&Ht&&re.alternate===null&&n(w,Ht),q=S(re,q,ie),Qe===null?Gt=re:Qe.sibling=re,Qe=re,Ht=ya}if(ie===k.length)return c(w,Ht),$t&&Mt(w,ie),Gt;if(Ht===null){for(;ieie?(ya=Ht,Ht=null):ya=Ht.sibling;var Hl=_t(w,Ht,re.value,ht);if(Hl===null){Ht===null&&(Ht=ya);break}a&&Ht&&Hl.alternate===null&&n(w,Ht),q=S(Hl,q,ie),Qe===null?Gt=Hl:Qe.sibling=Hl,Qe=Hl,Ht=ya}if(re.done)return c(w,Ht),$t&&Mt(w,ie),Gt;if(Ht===null){for(;!re.done;ie++,re=k.next())re=rt(w,re.value,ht),re!==null&&(q=S(re,q,ie),Qe===null?Gt=re:Qe.sibling=re,Qe=re);return $t&&Mt(w,ie),Gt}for(Ht=o(Ht);!re.done;ie++,re=k.next())re=Lt(Ht,w,ie,re.value,ht),re!==null&&(a&&re.alternate!==null&&Ht.delete(re.key===null?ie:re.key),q=S(re,q,ie),Qe===null?Gt=re:Qe.sibling=re,Qe=re);return a&&Ht.forEach(function(Cd){return n(w,Cd)}),$t&&Mt(w,ie),Gt}function Ni(w,q,k,ht){if(typeof k=="object"&&k!==null&&k.type===$i&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case un:t:{for(var Gt=k.key;q!==null;){if(q.key===Gt){if(Gt=k.type,Gt===$i){if(q.tag===7){c(w,q.sibling),ht=v(q,k.props.children),ht.return=w,w=ht;break t}}else if(q.elementType===Gt||typeof Gt=="object"&&Gt!==null&&Gt.$$typeof===qa&&kn(Gt)===q.type){c(w,q.sibling),ht=v(q,k.props),Nu(ht,k),ht.return=w,w=ht;break t}c(w,q);break}else n(w,q);q=q.sibling}k.type===$i?(ht=El(k.props.children,w.mode,ht,k.key),ht.return=w,w=ht):(ht=Dn(k.type,k.key,k.props,null,w.mode,ht),Nu(ht,k),ht.return=w,w=ht)}return T(w);case Ii:t:{for(Gt=k.key;q!==null;){if(q.key===Gt)if(q.tag===4&&q.stateNode.containerInfo===k.containerInfo&&q.stateNode.implementation===k.implementation){c(w,q.sibling),ht=v(q,k.children||[]),ht.return=w,w=ht;break t}else{c(w,q);break}else n(w,q);q=q.sibling}ht=Yr(k,w.mode,ht),ht.return=w,w=ht}return T(w);case qa:return k=kn(k),Ni(w,q,k,ht)}if(gi(k))return va(w,q,k,ht);if(x(k)){if(Gt=x(k),typeof Gt!="function")throw Error(r(150));return k=Gt.call(k),vs(w,q,k,ht)}if(typeof k.then=="function")return Ni(w,q,Uc(k),ht);if(k.$$typeof===xl)return Ni(w,q,za(w,k),ht);Hs(w,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,q!==null&&q.tag===6?(c(w,q.sibling),ht=v(q,k),ht.return=w,w=ht):(c(w,q),ht=Ur(k,w.mode,ht),ht.return=w,w=ht),T(w)):c(w,q)}return function(w,q,k,ht){try{fu=0;var Gt=Ni(w,q,k,ht);return bi=null,Gt}catch(Ht){if(Ht===ra||Ht===Rl)throw Ht;var Qe=u(29,Ht,null,w.mode);return Qe.lanes=ht,Qe.return=w,Qe}finally{}}}function Ou(){for(var a=hn,n=ru=hn=0;nS?S:8);var T=Rt.T,G={};Rt.T=G,Pc(a,!1,n,c);try{var P=v(),st=Rt.S;if(st!==null&&st(G,P),P!==null&&typeof P=="object"&&typeof P.then=="function"){var mt=Gc(P,o);Zs(a,n,mt,Ne(a))}else Zs(a,n,o,Ne(a))}catch(rt){Zs(a,n,{then:function(){},status:"rejected",reason:rt},Ne())}finally{It(S),T!==null&&G.types!==null&&(T.types=G.types),Rt.T=T}}function oh(a){var n=a.memoizedState;if(n!==null)return n;n={memoizedState:lu,baseState:lu,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ul,lastRenderedState:lu},next:null};var c={};return n.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ul,lastRenderedState:c},next:null},a.memoizedState=n,a=a.alternate,a!==null&&(a.memoizedState=n),n}function gr(){return _a(nu)}function kc(){return Me().memoizedState}function hh(){return Me().memoizedState}function dd(a){for(var n=a.return;n!==null;){switch(n.tag){case 24:case 3:var c=Ne();a=Kl(c);var o=$n(n,a,c);o!==null&&(Ye(o,n,c),Us(o,n,c)),n={cache:Dc()},a.payload=n;return}n=n.return}}function md(a,n,c){var o=Ne();c={lane:o,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Ic(a)?mh(n,c):(c=Bc(a,n,c,o),c!==null&&(Ye(c,a,o),gh(c,n,o)))}function dh(a,n,c){var o=Ne();Zs(a,n,c,o)}function Zs(a,n,c,o){var v={lane:o,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Ic(a))mh(n,v);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=n.lastRenderedReducer,S!==null))try{var T=n.lastRenderedState,G=S(T,c);if(v.hasEagerState=!0,v.eagerState=G,ke(G,T))return Ru(a,n,v,0),Wt===null&&Ou(),!1}catch{}finally{}if(c=Bc(a,n,v,o),c!==null)return Ye(c,a,o),gh(c,n,o),!0}return!1}function Pc(a,n,c,o){if(o={lane:2,revertLane:nr(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ic(a)){if(n)throw Error(r(479))}else n=Bc(a,c,o,2),n!==null&&Ye(n,a,2)}function Ic(a){var n=a.alternate;return a===Vt||n!==null&&n===Vt}function mh(a,n){Kt=Jt=!0;var c=a.pending;c===null?n.next=n:(n.next=c.next,c.next=n),a.pending=n}function gh(a,n,c){if((c&4194048)!==0){var o=n.lanes;o&=a.pendingLanes,c|=o,n.lanes=c,it(a,c)}}function pr(a,n,c,o){n=a.memoizedState,c=c(o,n),c=c==null?n:Sf({},n,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}function $c(a,n,c,o,v,S,T){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(o,S,T):n.prototype&&n.prototype.isPureReactComponent?!Yi(c,o)||!Yi(v,S):!0}function ph(a,n,c,o){a=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(c,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(c,o),n.state!==a&&yc.enqueueReplaceState(n,n.state,null)}function Zi(a,n){var c=n;if("ref"in n){c={};for(var o in n)o!=="ref"&&(c[o]=n[o])}if(a=a.defaultProps){c===n&&(c=Sf({},c));for(var v in a)c[v]===void 0&&(c[v]=a[v])}return c}function tf(a,n){try{var c=a.onUncaughtError;c(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function vr(a,n,c){try{var o=a.onCaughtError;o(c.value,{componentStack:c.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function yr(a,n,c){return c=Kl(c),c.tag=3,c.payload={element:null},c.callback=function(){tf(a,n)},c}function vh(a){return a=Kl(a),a.tag=3,a}function yh(a,n,c,o){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var S=o.value;a.payload=function(){return v(S)},a.callback=function(){vr(n,c,o)}}var T=c.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(a.callback=function(){vr(n,c,o),typeof v!="function"&&(Qn===null?Qn=new Set([this]):Qn.add(this));var G=o.stack;this.componentDidCatch(o.value,{componentStack:G!==null?G:""})})}function gd(a,n,c,o,v){if(c.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=c.alternate,n!==null&&Wn(n,c,v,!0),c=tl.current,c!==null){switch(c.tag){case 31:case 13:return Qa===null?Pu():c.alternate===null&&Xe===0&&(Xe=3),c.flags&=-257,c.flags|=65536,c.lanes=v,o===on?c.flags|=16384:(n=c.updateQueue,n===null?c.updateQueue=new Set([o]):n.add(o),ts(a,o,v)),!1;case 22:return c.flags|=65536,o===on?c.flags|=16384:(n=c.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},c.updateQueue=n):(c=n.retryQueue,c===null?n.retryQueue=new Set([o]):c.add(o)),ts(a,o,v)),!1}throw Error(r(435,c.tag))}return ts(a,o,v),Pu(),!1}if($t)return n=tl.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=v,o!==Qf&&(a=Error(r(422),{cause:o}),Di(xt(a,c)))):(o!==Qf&&(n=Error(r(423),{cause:o}),Di(xt(n,c))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,o=xt(o,c),v=yr(a.stateNode,o,v),Yc(a,v),Xe!==4&&(Xe=2)),!1;var S=Error(r(520),{cause:o});if(S=xt(S,c),_c===null?_c=[S]:_c.push(S),Xe!==4&&(Xe=2),n===null)return!0;o=xt(o,c),c=n;do{switch(c.tag){case 3:return c.flags|=65536,a=v&-v,c.lanes|=a,a=yr(c.stateNode,o,a),Yc(c,a),!1;case 1:if(n=c.type,S=c.stateNode,(c.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Qn===null||!Qn.has(S))))return c.flags|=65536,v&=-v,c.lanes|=v,v=vh(v),yh(v,a,c,o),Yc(c,v),!1}c=c.return}while(c!==null);return!1}function ba(a,n,c,o){n.child=a===null?xo(n,null,c,o):Ta(n,a.child,c,o)}function Sh(a,n,c,o,v){c=c.render;var S=n.ref;if("ref"in o){var T={};for(var G in o)G!=="ref"&&(T[G]=o[G])}else T=o;return Gi(n),o=Gu(a,n,c,T,S,v),G=jc(),a!==null&&!Ae?(sr(a,n,v),Wl(a,n,v)):($t&&G&&tt(n),n.flags|=1,ba(a,n,o,v),n.child)}function _h(a,n,c,o,v){if(a===null){var S=c.type;return typeof S=="function"&&!Fi(S)&&S.defaultProps===void 0&&c.compare===null?(n.tag=15,n.type=S,bh(a,n,S,o,v)):(a=Dn(c.type,null,o,n,n.mode,v),a.ref=n.ref,a.return=n,n.child=a)}if(S=a.child,!ws(a,v)){var T=S.memoizedProps;if(c=c.compare,c=c!==null?c:Yi,c(T,o)&&a.ref===n.ref)return Wl(a,n,v)}return n.flags|=1,a=fl(S,o),a.ref=n.ref,a.return=n,n.child=a}function bh(a,n,c,o,v){if(a!==null){var S=a.memoizedProps;if(Yi(S,o)&&a.ref===n.ref)if(Ae=!1,n.pendingProps=o=S,ws(a,v))(a.flags&131072)!==0&&(Ae=!0);else return n.lanes=a.lanes,Wl(a,n,v)}return af(a,n,c,o,v)}function Eh(a,n,c,o){var v=o.children,S=a!==null?a.memoizedState:null;if(a===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(S=S!==null?S.baseLanes|c:c,a!==null){for(o=n.child=a.child,v=0;o!==null;)v=v|o.lanes|o.childLanes,o=o.sibling;o=v&~S}else o=0,n.child=null;return Xu(a,n,S,c,o)}if((c&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},a!==null&&Bi(n,S!==null?S.cachePool:null),S!==null?Du(n,S):ti(),ei(n);else return o=n.lanes=536870912,Xu(a,n,S!==null?S.baseLanes|c:c,c,o)}else S!==null?(Bi(n,S.cachePool),Du(n,S),nl(),n.memoizedState=null):(a!==null&&Bi(n,null),ti(),nl());return ba(a,n,v,c),n.child}function Ki(a,n){return a!==null&&a.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Xu(a,n,c,o,v){var S=Au();return S=S===null?null:{parent:We?De._currentValue:De._currentValue2,pool:S},n.memoizedState={baseLanes:c,cachePool:S},a!==null&&Bi(n,null),ti(),ei(n),a!==null&&Wn(a,n,o,!0),n.childLanes=v,null}function ef(a,n){return n=ni({mode:n.mode,children:n.children},a.mode),n.ref=a.ref,a.child=n,n.return=a,n}function Sr(a,n,c){return Ta(n,a.child,null,c),a=ef(n,n.pendingProps),a.flags|=2,il(n),n.memoizedState=null,a}function xh(a,n,c){var o=n.pendingProps,v=(n.flags&128)!==0;if(n.flags&=-129,a===null){if($t){if(o.mode==="hidden")return a=ef(n,o),n.lanes=536870912,Ki(null,a);if(qc(n),(a=Re)?(a=uo(a,La),a!==null&&(n.memoizedState={dehydrated:a,treeContext:zl!==null?{id:Ea,overflow:Yl}:null,retryLane:536870912,hydrationErrors:null},c=Br(a),c.return=n,n.child=c,ca=n,Re=null)):a=null,a===null)throw me(n);return n.lanes=536870912,null}return ef(n,o)}var S=a.memoizedState;if(S!==null){var T=S.dehydrated;if(qc(n),v)if(n.flags&256)n.flags&=-257,n=Sr(a,n,c);else if(n.memoizedState!==null)n.child=a.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ae||Wn(a,n,c,!1),v=(c&a.childLanes)!==0,Ae||v){if(o=Wt,o!==null&&(T=Et(o,c),T!==0&&T!==S.retryLane))throw S.retryLane=T,Pn(a,T),Ye(o,a,T),Va;Pu(),n=Sr(a,n,c)}else a=S.treeContext,Oe&&(Re=u0(T),ca=n,$t=!0,rn=null,La=!1,a!==null&&Tt(n,a)),n=ef(n,o),n.flags|=4096;return n}return a=fl(a.child,{mode:o.mode,children:o.children}),a.ref=n.ref,n.child=a,a.return=n,a}function Ks(a,n){var c=n.ref;if(c===null)a!==null&&a.ref!==null&&(n.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(a===null||a.ref!==c)&&(n.flags|=4194816)}}function af(a,n,c,o,v){return Gi(n),c=Gu(a,n,c,o,void 0,v),o=jc(),a!==null&&!Ae?(sr(a,n,v),Wl(a,n,v)):($t&&o&&tt(n),n.flags|=1,ba(a,n,c,v),n.child)}function _r(a,n,c,o,v,S){return Gi(n),n.updateQueue=null,c=wl(n,o,c,v),Ys(a),o=jc(),a!==null&&!Ae?(sr(a,n,S),Wl(a,n,S)):($t&&o&&tt(n),n.flags|=1,ba(a,n,c,S),n.child)}function wi(a,n,c,o,v){if(Gi(n),n.stateNode===null){var S=sn,T=c.contextType;typeof T=="object"&&T!==null&&(S=_a(T)),S=new c(o,S),n.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=yc,n.stateNode=S,S._reactInternals=n,S=n.stateNode,S.props=o,S.state=n.memoizedState,S.refs={},Ma(n),T=c.contextType,S.context=typeof T=="object"&&T!==null?_a(T):sn,S.state=n.memoizedState,T=c.getDerivedStateFromProps,typeof T=="function"&&(pr(n,c,T,o),S.state=n.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(T=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),T!==S.state&&yc.enqueueReplaceState(S,S.state,null),qi(n,o,S,v),xn(),S.state=n.memoizedState),typeof S.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(a===null){S=n.stateNode;var G=n.memoizedProps,P=Zi(c,G);S.props=P;var st=S.context,mt=c.contextType;T=sn,typeof mt=="object"&&mt!==null&&(T=_a(mt));var rt=c.getDerivedStateFromProps;mt=typeof rt=="function"||typeof S.getSnapshotBeforeUpdate=="function",G=n.pendingProps!==G,mt||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(G||st!==T)&&ph(n,S,o,T),hl=!1;var _t=n.memoizedState;S.state=_t,qi(n,o,S,v),xn(),st=n.memoizedState,G||_t!==st||hl?(typeof rt=="function"&&(pr(n,c,rt,o),st=n.memoizedState),(P=hl||$c(n,c,P,o,_t,st,T))?(mt||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(n.flags|=4194308)):(typeof S.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=st),S.props=o,S.state=st,S.context=T,o=P):(typeof S.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{S=n.stateNode,In(a,n),T=n.memoizedProps,mt=Zi(c,T),S.props=mt,rt=n.pendingProps,_t=S.context,st=c.contextType,P=sn,typeof st=="object"&&st!==null&&(P=_a(st)),G=c.getDerivedStateFromProps,(st=typeof G=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(T!==rt||_t!==P)&&ph(n,S,o,P),hl=!1,_t=n.memoizedState,S.state=_t,qi(n,o,S,v),xn();var Lt=n.memoizedState;T!==rt||_t!==Lt||hl||a!==null&&a.dependencies!==null&&xu(a.dependencies)?(typeof G=="function"&&(pr(n,c,G,o),Lt=n.memoizedState),(mt=hl||$c(n,c,mt,o,_t,Lt,P)||a!==null&&a.dependencies!==null&&xu(a.dependencies))?(st||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(o,Lt,P),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(o,Lt,P)),typeof S.componentDidUpdate=="function"&&(n.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof S.componentDidUpdate!="function"||T===a.memoizedProps&&_t===a.memoizedState||(n.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||T===a.memoizedProps&&_t===a.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=Lt),S.props=o,S.state=Lt,S.context=P,o=mt):(typeof S.componentDidUpdate!="function"||T===a.memoizedProps&&_t===a.memoizedState||(n.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||T===a.memoizedProps&&_t===a.memoizedState||(n.flags|=1024),o=!1)}return S=o,Ks(a,n),o=(n.flags&128)!==0,S||o?(S=n.stateNode,c=o&&typeof c.getDerivedStateFromError!="function"?null:S.render(),n.flags|=1,a!==null&&o?(n.child=Ta(n,a.child,null,v),n.child=Ta(n,null,c,v)):ba(a,n,c,v),n.memoizedState=S.state,a=n.child):a=Wl(a,n,v),a}function Th(a,n,c,o){return Jn(),n.flags|=256,ba(a,n,c,o),n.child}function br(a){return{baseLanes:a,cachePool:Fn()}}function Er(a,n,c){return a=a!==null?a.childLanes&~c:0,n&&(a|=Za),a}function xr(a,n,c){var o=n.pendingProps,v=!1,S=(n.flags&128)!==0,T;if((T=S)||(T=a!==null&&a.memoizedState===null?!1:(Ke.current&2)!==0),T&&(v=!0,n.flags&=-129),T=(n.flags&32)!==0,n.flags&=-33,a===null){if($t){if(v?Tn(n):nl(),(a=Re)?(a=r0(a,La),a!==null&&(n.memoizedState={dehydrated:a,treeContext:zl!==null?{id:Ea,overflow:Yl}:null,retryLane:536870912,hydrationErrors:null},c=Br(a),c.return=n,n.child=c,ca=n,Re=null)):a=null,a===null)throw me(n);return zf(a)?n.lanes=32:n.lanes=536870912,null}var G=o.children;return o=o.fallback,v?(nl(),v=n.mode,G=ni({mode:"hidden",children:G},v),o=El(o,v,c,null),G.return=n,o.return=n,G.sibling=o,n.child=G,o=n.child,o.memoizedState=br(c),o.childLanes=Er(a,T,c),n.memoizedState=hu,Ki(null,o)):(Tn(n),lf(n,G))}var P=a.memoizedState;if(P!==null&&(G=P.dehydrated,G!==null)){if(S)n.flags&256?(Tn(n),n.flags&=-257,n=Ji(a,n,c)):n.memoizedState!==null?(nl(),n.child=a.child,n.flags|=128,n=null):(nl(),G=o.fallback,v=n.mode,o=ni({mode:"visible",children:o.children},v),G=El(G,v,c,null),G.flags|=2,o.return=n,G.return=n,o.sibling=G,n.child=o,Ta(n,a.child,null,c),o=n.child,o.memoizedState=br(c),o.childLanes=Er(a,T,c),n.memoizedState=hu,n=Ki(null,o));else if(Tn(n),zf(G))T=Mf(G).digest,o=Error(r(419)),o.stack="",o.digest=T,Di({value:o,source:null,stack:null}),n=Ji(a,n,c);else if(Ae||Wn(a,n,c,!1),T=(c&a.childLanes)!==0,Ae||T){if(T=Wt,T!==null&&(o=Et(T,c),o!==0&&o!==P.retryLane))throw P.retryLane=o,Pn(a,o),Ye(T,a,o),Va;vi(G)||Pu(),n=Ji(a,n,c)}else vi(G)?(n.flags|=192,n.child=a.child,n=null):(a=P.treeContext,Oe&&(Re=s0(G),ca=n,$t=!0,rn=null,La=!1,a!==null&&Tt(n,a)),n=lf(n,o.children),n.flags|=4096);return n}return v?(nl(),G=o.fallback,v=n.mode,P=a.child,S=P.sibling,o=fl(P,{mode:"hidden",children:o.children}),o.subtreeFlags=P.subtreeFlags&65011712,S!==null?G=fl(S,G):(G=El(G,v,c,null),G.flags|=2),G.return=n,o.return=n,o.sibling=G,n.child=o,Ki(null,o),o=n.child,G=a.child.memoizedState,G===null?G=br(c):(v=G.cachePool,v!==null?(P=We?De._currentValue:De._currentValue2,v=v.parent!==P?{parent:P,pool:P}:v):v=Fn(),G={baseLanes:G.baseLanes|c,cachePool:v}),o.memoizedState=G,o.childLanes=Er(a,T,c),n.memoizedState=hu,Ki(a.child,o)):(Tn(n),c=a.child,a=c.sibling,c=fl(c,{mode:"visible",children:o.children}),c.return=n,c.sibling=null,a!==null&&(T=n.deletions,T===null?(n.deletions=[a],n.flags|=16):T.push(a)),n.child=c,n.memoizedState=null,c)}function lf(a,n){return n=ni({mode:"visible",children:n},a.mode),n.return=a,a.child=n}function ni(a,n){return a=u(22,a,null,n),a.lanes=0,a}function Ji(a,n,c){return Ta(n,a.child,null,c),a=lf(n,n.pendingProps.children),a.flags|=2,n.memoizedState=null,a}function Ch(a,n,c){a.lanes|=n;var o=a.alternate;o!==null&&(o.lanes|=n),Rc(a.return,n,c)}function Qu(a,n,c,o,v,S){var T=a.memoizedState;T===null?a.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:c,tailMode:v,treeForkCount:S}:(T.isBackwards=n,T.rendering=null,T.renderingStartTime=0,T.last=o,T.tail=c,T.tailMode=v,T.treeForkCount=S)}function Tr(a,n,c){var o=n.pendingProps,v=o.revealOrder,S=o.tail;o=o.children;var T=Ke.current,G=(T&2)!==0;if(G?(T=T&1|2,n.flags|=128):T&=1,M(Ke,T),ba(a,n,o,c),o=$t?gc:0,!G&&a!==null&&(a.flags&128)!==0)t:for(a=n.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Ch(a,c,n);else if(a.tag===19)Ch(a,c,n);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break t;for(;a.sibling===null;){if(a.return===null||a.return===n)break t;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(v){case"forwards":for(c=n.child,v=null;c!==null;)a=c.alternate,a!==null&&Bs(a)===null&&(v=c),c=c.sibling;c=v,c===null?(v=n.child,n.child=null):(v=c.sibling,c.sibling=null),Qu(n,!1,v,c,S,o);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=n.child,n.child=null;v!==null;){if(a=v.alternate,a!==null&&Bs(a)===null){n.child=v;break}a=v.sibling,v.sibling=c,c=v,v=a}Qu(n,!0,c,null,S,o);break;case"together":Qu(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function Wl(a,n,c){if(a!==null&&(n.dependencies=a.dependencies),Xn|=n.lanes,(c&n.childLanes)===0)if(a!==null){if(Wn(a,n,c,!1),(c&n.childLanes)===0)return null}else return null;if(a!==null&&n.child!==a.child)throw Error(r(153));if(n.child!==null){for(a=n.child,c=fl(a,a.pendingProps),n.child=c,c.return=n;a.sibling!==null;)a=a.sibling,c=c.sibling=fl(a,a.pendingProps),c.return=n;c.sibling=null}return n.child}function ws(a,n){return(a.lanes&n)!==0?!0:(a=a.dependencies,!!(a!==null&&xu(a)))}function Cr(a,n,c){switch(n.tag){case 3:jt(n,n.stateNode.containerInfo),Vl(n,De,a.memoizedState.cache),Jn();break;case 27:case 5:fe(n);break;case 4:jt(n,n.stateNode.containerInfo);break;case 10:Vl(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,qc(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Tn(n),n.flags|=128,null):(c&n.child.childLanes)!==0?xr(a,n,c):(Tn(n),a=Wl(a,n,c),a!==null?a.sibling:null);Tn(n);break;case 19:var v=(a.flags&128)!==0;if(o=(c&n.childLanes)!==0,o||(Wn(a,n,c,!1),o=(c&n.childLanes)!==0),v){if(o)return Tr(a,n,c);n.flags|=128}if(v=n.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),M(Ke,Ke.current),o)break;return null;case 22:return n.lanes=0,Eh(a,n,c,n.pendingProps);case 24:Vl(n,De,a.memoizedState.cache)}return Wl(a,n,c)}function Ar(a,n,c){if(a!==null)if(a.memoizedProps!==n.pendingProps)Ae=!0;else{if(!ws(a,c)&&(n.flags&128)===0)return Ae=!1,Cr(a,n,c);Ae=(a.flags&131072)!==0}else Ae=!1,$t&&(n.flags&1048576)!==0&&R(n,gc,n.index);switch(n.lanes=0,n.tag){case 16:t:{var o=n.pendingProps;if(a=kn(n.elementType),n.type=a,typeof a=="function")Fi(a)?(o=Zi(a,o),n.tag=1,n=wi(null,n,a,o,c)):(n.tag=0,n=af(null,n,a,o,c));else{if(a!=null){var v=a.$$typeof;if(v===es){n.tag=11,n=Sh(null,n,a,o,c);break t}else if(v===bf){n.tag=14,n=_h(null,n,a,o,c);break t}}throw n=C(a)||a,Error(r(306,n,""))}}return n;case 0:return af(a,n,n.type,n.pendingProps,c);case 1:return o=n.type,v=Zi(o,n.pendingProps),wi(a,n,o,v,c);case 3:t:{if(jt(n,n.stateNode.containerInfo),a===null)throw Error(r(387));var S=n.pendingProps;v=n.memoizedState,o=v.element,In(a,n),qi(n,S,null,c);var T=n.memoizedState;if(S=T.cache,Vl(n,De,S),S!==v.cache&&Gs(n,[De],c,!0),xn(),S=T.element,Oe&&v.isDehydrated)if(v={element:S,isDehydrated:!1,cache:T.cache},n.updateQueue.baseState=v,n.memoizedState=v,n.flags&256){n=Th(a,n,S,c);break t}else if(S!==o){o=xt(Error(r(424)),n),Di(o),n=Th(a,n,S,c);break t}else for(Oe&&(Re=i0(n.stateNode.containerInfo),ca=n,$t=!0,rn=null,La=!0),c=xo(n,null,S,c),n.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Jn(),S===o){n=Wl(a,n,c);break t}ba(a,n,S,c)}n=n.child}return n;case 26:if(Cl)return Ks(a,n),a===null?(c=oo(n.type,null,n.pendingProps,null))?n.memoizedState=c:$t||(n.stateNode=Df(n.type,n.pendingProps,xa.current,n)):n.memoizedState=oo(n.type,a.memoizedProps,n.pendingProps,a.memoizedState),null;case 27:if(sa)return fe(n),a===null&&sa&&$t&&(o=n.stateNode=Gf(n.type,n.pendingProps,xa.current,ga.current,!1),ca=n,La=!0,Re=io(n.type,o,Re)),ba(a,n,n.pendingProps.children,c),Ks(a,n),a===null&&(n.flags|=4194304),n.child;case 5:return a===null&&$t&&(S0(n.type,n.pendingProps,ga.current),(v=o=Re)&&(o=c0(o,n.type,n.pendingProps,La),o!==null?(n.stateNode=o,ca=n,Re=n0(o),La=!1,v=!0):v=!1),v||me(n)),fe(n),v=n.type,S=n.pendingProps,T=a!==null?a.memoizedProps:null,o=S.children,ja(v,S)?o=null:T!==null&&ja(v,T)&&(n.flags|=32),n.memoizedState!==null&&(v=Gu(a,n,pl,null,null,c),We?nu._currentValue=v:nu._currentValue2=v),Ks(a,n),ba(a,n,o,c),n.child;case 6:return a===null&&$t&&(ro(n.pendingProps,ga.current),(a=c=Re)&&(c=f0(c,n.pendingProps,La),c!==null?(n.stateNode=c,ca=n,Re=null,a=!0):a=!1),a||me(n)),null;case 13:return xr(a,n,c);case 4:return jt(n,n.stateNode.containerInfo),o=n.pendingProps,a===null?n.child=Ta(n,null,o,c):ba(a,n,o,c),n.child;case 11:return Sh(a,n,n.type,n.pendingProps,c);case 7:return ba(a,n,n.pendingProps,c),n.child;case 8:return ba(a,n,n.pendingProps.children,c),n.child;case 12:return ba(a,n,n.pendingProps.children,c),n.child;case 10:return o=n.pendingProps,Vl(n,n.type,o.value),ba(a,n,o.children,c),n.child;case 9:return v=n.type._context,o=n.pendingProps.children,Gi(n),v=_a(v),o=o(v),n.flags|=1,ba(a,n,o,c),n.child;case 14:return _h(a,n,n.type,n.pendingProps,c);case 15:return bh(a,n,n.type,n.pendingProps,c);case 19:return Tr(a,n,c);case 31:return xh(a,n,c);case 22:return Eh(a,n,c,n.pendingProps);case 24:return Gi(n),o=_a(De),a===null?(v=Au(),v===null&&(v=Wt,S=Dc(),v.pooledCache=S,S.refCount++,S!==null&&(v.pooledCacheLanes|=c),v=S),n.memoizedState={parent:o,cache:v},Ma(n),Vl(n,De,v)):((a.lanes&c)!==0&&(In(a,n),qi(n,null,null,c),xn()),v=a.memoizedState,S=n.memoizedState,v.parent!==o?(v={parent:o,cache:o},n.memoizedState=v,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=v),Vl(n,De,o)):(o=S.cache,Vl(n,De,o),o!==v.cache&&Gs(n,[De],c,!0))),ba(a,n,n.pendingProps.children,c),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function vl(a){a.flags|=4}function Js(a){rl&&(a.flags|=8)}function Ah(a,n){if(a!==null&&a.child===n.child)return!1;if((n.flags&16)!==0)return!0;for(a=n.child;a!==null;){if((a.flags&8218)!==0||(a.subtreeFlags&8218)!==0)return!0;a=a.sibling}return!1}function zr(a,n,c,o){if(ae)for(c=n.child;c!==null;){if(c.tag===5||c.tag===6)sc(a,c.stateNode);else if(!(c.tag===4||sa&&c.tag===27)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===n)break;for(;c.sibling===null;){if(c.return===null||c.return===n)return;c=c.return}c.sibling.return=c.return,c=c.sibling}else if(rl)for(var v=n.child;v!==null;){if(v.tag===5){var S=v.stateNode;c&&o&&(S=t0(S,v.type,v.memoizedProps)),sc(a,S)}else if(v.tag===6)S=v.stateNode,c&&o&&(S=lo(S,v.memoizedProps)),sc(a,S);else if(v.tag!==4){if(v.tag===22&&v.memoizedState!==null)S=v.child,S!==null&&(S.return=v),zr(a,v,!0,!0);else if(v.child!==null){v.child.return=v,v=v.child;continue}}if(v===n)break;for(;v.sibling===null;){if(v.return===null||v.return===n)return;v=v.return}v.sibling.return=v.return,v=v.sibling}}function zh(a,n,c,o){var v=!1;if(rl)for(var S=n.child;S!==null;){if(S.tag===5){var T=S.stateNode;c&&o&&(T=t0(T,S.type,S.memoizedProps)),eo(a,T)}else if(S.tag===6)T=S.stateNode,c&&o&&(T=lo(T,S.memoizedProps)),eo(a,T);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)v=S.child,v!==null&&(v.return=S),zh(a,S,!0,!0),v=!0;else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===n)break;for(;S.sibling===null;){if(S.return===null||S.return===n)return v;S=S.return}S.sibling.return=S.return,S=S.sibling}return v}function Mh(a,n){if(rl&&Ah(a,n)){a=n.stateNode;var c=a.containerInfo,o=to();zh(o,n,!1,!1),a.pendingChildren=o,vl(n),$h(c,o)}}function Mr(a,n,c,o){if(ae)a.memoizedProps!==o&&vl(n);else if(rl){var v=a.stateNode,S=a.memoizedProps;if((a=Ah(a,n))||S!==o){var T=ga.current;S=Ih(v,c,S,o,!a,null),S===v?n.stateNode=v:(Js(n),ka(S,c,o,T)&&vl(n),n.stateNode=S,a&&zr(S,n,!1,!1))}else n.stateNode=v}}function Ba(a,n,c,o,v){if((a.mode&32)!==0&&(c===null?cc(n,o):us(n,c,o))){if(a.flags|=16777216,(v&335544128)===v||Vr(n,o))if(qe(a.stateNode,n,o))a.flags|=8192;else if(ee())a.flags|=8192;else throw Xa=on,Zf}else a.flags&=-16777217}function Vu(a,n){if(po(n)){if(a.flags|=16777216,!vo(n))if(ee())a.flags|=8192;else throw Xa=on,Zf}else a.flags&=-16777217}function Ws(a,n){n!==null&&(a.flags|=4),a.flags&16384&&(n=a.tag!==22?B():536870912,a.lanes|=n,gs|=n)}function Zu(a,n){if(!$t)switch(a.tailMode){case"hidden":n=a.tail;for(var c=null;n!==null;)n.alternate!==null&&(c=n),n=n.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var o=null;c!==null;)c.alternate!==null&&(o=c),c=c.sibling;o===null?n||a.tail===null?a.tail=null:a.tail.sibling=null:o.sibling=null}}function be(a){var n=a.alternate!==null&&a.alternate.child===a.child,c=0,o=0;if(n)for(var v=a.child;v!==null;)c|=v.lanes|v.childLanes,o|=v.subtreeFlags&65011712,o|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)c|=v.lanes|v.childLanes,o|=v.subtreeFlags,o|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=o,a.childLanes=c,n}function Nh(a,n,c){var o=n.pendingProps;switch(dt(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return be(n),null;case 1:return be(n),null;case 3:return c=n.stateNode,o=null,a!==null&&(o=a.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),_n(De),Xt(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(wn(n)?vl(n):a===null||a.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Sn())),Mh(a,n),be(n),null;case 26:if(Cl){var v=n.type,S=n.memoizedState;return a===null?(vl(n),S!==null?(be(n),Vu(n,S)):(be(n),Ba(n,v,null,o,c))):S?S!==a.memoizedState?(vl(n),be(n),Vu(n,S)):(be(n),n.flags&=-16777217):(S=a.memoizedProps,ae?S!==o&&vl(n):Mr(a,n,v,o),be(n),Ba(n,v,S,o,c)),null}case 27:if(sa){if(oa(n),c=xa.current,v=n.type,a!==null&&n.stateNode!=null)ae?a.memoizedProps!==o&&vl(n):Mr(a,n,v,o);else{if(!o){if(n.stateNode===null)throw Error(r(166));return be(n),null}a=ga.current,wn(n)?Eu(n,a):(a=Gf(v,o,c,a,!0),n.stateNode=a,vl(n))}return be(n),null}case 5:if(oa(n),v=n.type,a!==null&&n.stateNode!=null)Mr(a,n,v,o);else{if(!o){if(n.stateNode===null)throw Error(r(166));return be(n),null}if(S=ga.current,wn(n))Eu(n,S),p0(n.stateNode,v,o,S)&&(n.flags|=64);else{var T=Xr(v,o,xa.current,S,n);Js(n),zr(T,n,!1,!1),n.stateNode=T,ka(T,v,o,S)&&vl(n)}}return be(n),Ba(n,n.type,a===null?null:a.memoizedProps,n.pendingProps,c),null;case 6:if(a&&n.stateNode!=null)c=a.memoizedProps,ae?c!==o&&vl(n):rl&&(c!==o?(a=xa.current,c=ga.current,Js(n),n.stateNode=Un(o,a,c,n)):n.stateNode=a.stateNode);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(a=xa.current,c=ga.current,wn(n)){if(!Oe)throw Error(r(176));if(a=n.stateNode,c=n.memoizedProps,o=null,v=ca,v!==null)switch(v.tag){case 27:case 5:o=v.memoizedProps}_d(a,c,n,o)||me(n,!0)}else Js(n),n.stateNode=Un(o,a,c,n)}return be(n),null;case 31:if(c=n.memoizedState,a===null||a.memoizedState!==null){if(o=wn(n),c!==null){if(a===null){if(!o)throw Error(r(318));if(!Oe)throw Error(r(556));if(a=n.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));so(a,n)}else Jn(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;be(n),a=!1}else c=Sn(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=c),a=!0;if(!a)return n.flags&256?(il(n),n):(il(n),null);if((n.flags&128)!==0)throw Error(r(558))}return be(n),null;case 13:if(o=n.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=wn(n),o!==null&&o.dehydrated!==null){if(a===null){if(!v)throw Error(r(318));if(!Oe)throw Error(r(344));if(v=n.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));h0(v,n)}else Jn(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;be(n),v=!1}else v=Sn(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return n.flags&256?(il(n),n):(il(n),null)}return il(n),(n.flags&128)!==0?(n.lanes=c,n):(c=o!==null,a=a!==null&&a.memoizedState!==null,c&&(o=n.child,v=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(v=o.alternate.memoizedState.cachePool.pool),S=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(S=o.memoizedState.cachePool.pool),S!==v&&(o.flags|=2048)),c!==a&&c&&(n.child.flags|=8192),Ws(n,n.updateQueue),be(n),null);case 4:return Xt(),Mh(a,n),a===null&&Se(n.stateNode.containerInfo),be(n),null;case 10:return _n(n.type),be(n),null;case 19:if(O(Ke),o=n.memoizedState,o===null)return be(n),null;if(v=(n.flags&128)!==0,S=o.rendering,S===null)if(v)Zu(o,!1);else{if(Xe!==0||a!==null&&(a.flags&128)!==0)for(a=n.child;a!==null;){if(S=Bs(a),S!==null){for(n.flags|=128,Zu(o,!1),a=S.updateQueue,n.updateQueue=a,Ws(n,a),n.subtreeFlags=0,a=c,c=n.child;c!==null;)pf(c,a),c=c.sibling;return M(Ke,Ke.current&1|2),$t&&Mt(n,o.treeForkCount),n.child}a=a.sibling}o.tail!==null&&Da()>Mi&&(n.flags|=128,v=!0,Zu(o,!1),n.lanes=4194304)}else{if(!v)if(a=Bs(S),a!==null){if(n.flags|=128,v=!0,a=a.updateQueue,n.updateQueue=a,Ws(n,a),Zu(o,!0),o.tail===null&&o.tailMode==="hidden"&&!S.alternate&&!$t)return be(n),null}else 2*Da()-o.renderingStartTime>Mi&&c!==536870912&&(n.flags|=128,v=!0,Zu(o,!1),n.lanes=4194304);o.isBackwards?(S.sibling=n.child,n.child=S):(a=o.last,a!==null?a.sibling=S:n.child=S,o.last=S)}return o.tail!==null?(a=o.tail,o.rendering=a,o.tail=a.sibling,o.renderingStartTime=Da(),a.sibling=null,c=Ke.current,M(Ke,v?c&1|2:c&1),$t&&Mt(n,o.treeForkCount),a):(be(n),null);case 22:case 23:return il(n),ea(),o=n.memoizedState!==null,a!==null?a.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(c&536870912)!==0&&(n.flags&128)===0&&(be(n),n.subtreeFlags&6&&(n.flags|=8192)):be(n),c=n.updateQueue,c!==null&&Ws(n,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==c&&(n.flags|=2048),a!==null&&O(_i),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),_n(De),be(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function Nr(a,n){switch(dt(n),n.tag){case 1:return a=n.flags,a&65536?(n.flags=a&-65537|128,n):null;case 3:return _n(De),Xt(),a=n.flags,(a&65536)!==0&&(a&128)===0?(n.flags=a&-65537|128,n):null;case 26:case 27:case 5:return oa(n),null;case 31:if(n.memoizedState!==null){if(il(n),n.alternate===null)throw Error(r(340));Jn()}return a=n.flags,a&65536?(n.flags=a&-65537|128,n):null;case 13:if(il(n),a=n.memoizedState,a!==null&&a.dehydrated!==null){if(n.alternate===null)throw Error(r(340));Jn()}return a=n.flags,a&65536?(n.flags=a&-65537|128,n):null;case 19:return O(Ke),null;case 4:return Xt(),null;case 10:return _n(n.type),null;case 22:case 23:return il(n),ea(),a!==null&&O(_i),a=n.flags,a&65536?(n.flags=a&-65537|128,n):null;case 24:return _n(De),null;case 25:return null;default:return null}}function Oh(a,n){switch(dt(n),n.tag){case 3:_n(De),Xt();break;case 26:case 27:case 5:oa(n);break;case 4:Xt();break;case 31:n.memoizedState!==null&&il(n);break;case 13:il(n);break;case 19:O(Ke);break;case 10:_n(n.type);break;case 22:case 23:il(n),ea(),a!==null&&O(_i);break;case 24:_n(De)}}function Fl(a,n){try{var c=n.updateQueue,o=c!==null?c.lastEffect:null;if(o!==null){var v=o.next;c=v;do{if((c.tag&a)===a){o=void 0;var S=c.create,T=c.inst;o=S(),T.destroy=o}c=c.next}while(c!==v)}}catch(G){Bt(n,n.return,G)}}function kl(a,n,c){try{var o=n.updateQueue,v=o!==null?o.lastEffect:null;if(v!==null){var S=v.next;o=S;do{if((o.tag&a)===a){var T=o.inst,G=T.destroy;if(G!==void 0){T.destroy=void 0,v=n;var P=c,st=G;try{st()}catch(mt){Bt(v,P,mt)}}}o=o.next}while(o!==S)}}catch(mt){Bt(n,n.return,mt)}}function Ku(a){var n=a.updateQueue;if(n!==null){var c=a.stateNode;try{Li(n,c)}catch(o){Bt(a,a.return,o)}}}function nf(a,n,c){c.props=Zi(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(o){Bt(a,n,o)}}function wu(a,n){try{var c=a.ref;if(c!==null){switch(a.tag){case 26:case 27:case 5:var o=ls(a.stateNode);break;case 30:o=a.stateNode;break;default:o=a.stateNode}typeof c=="function"?a.refCleanup=c(o):c.current=o}}catch(v){Bt(a,n,v)}}function Ra(a,n){var c=a.ref,o=a.refCleanup;if(c!==null)if(typeof o=="function")try{o()}catch(v){Bt(a,n,v)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){Bt(a,n,v)}else c.current=null}function Wi(a){var n=a.type,c=a.memoizedProps,o=a.stateNode;try{Zh(o,n,c,a)}catch(v){Bt(a,a.return,v)}}function Fs(a,n,c){try{Kh(a.stateNode,a.type,c,n,a)}catch(o){Bt(a,a.return,o)}}function Or(a){return a.tag===5||a.tag===3||(Cl?a.tag===26:!1)||(sa?a.tag===27&&iu(a.type):!1)||a.tag===4}function zn(a){t:for(;;){for(;a.sibling===null;){if(a.return===null||Or(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(sa&&a.tag===27&&iu(a.type)||a.flags&2||a.child===null||a.tag===4)continue t;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function uf(a,n,c){var o=a.tag;if(o===5||o===6)a=a.stateNode,n?Jh(c,a,n):kr(c,a);else if(o!==4&&(sa&&o===27&&iu(a.type)&&(c=a.stateNode,n=null),a=a.child,a!==null))for(uf(a,n,c),a=a.sibling;a!==null;)uf(a,n,c),a=a.sibling}function ks(a,n,c){var o=a.tag;if(o===5||o===6)a=a.stateNode,n?wh(c,a,n):Fr(c,a);else if(o!==4&&(sa&&o===27&&iu(a.type)&&(c=a.stateNode),a=a.child,a!==null))for(ks(a,n,c),a=a.sibling;a!==null;)ks(a,n,c),a=a.sibling}function Rr(a,n,c){a=a.containerInfo;try{ao(a,c)}catch(o){Bt(n,n.return,o)}}function Rh(a){var n=a.stateNode,c=a.memoizedProps;try{la(a.type,c,n,a)}catch(o){Bt(a,a.return,o)}}function pd(a,n){for(Ef(a.containerInfo),Pe=n;Pe!==null;)if(a=Pe,n=a.child,(a.subtreeFlags&1028)!==0&&n!==null)n.return=a,Pe=n;else for(;Pe!==null;){a=Pe;var c=a.alternate;switch(n=a.flags,a.tag){case 0:if((n&4)!==0&&(n=a.updateQueue,n=n!==null?n.events:null,n!==null))for(var o=0;o";case hs:return":has("+(Fu(a)||"")+")";case ds:return'[role="'+a.value+'"]';case Ti:return'"'+a.value+'"';case Sc:return'[data-testname="'+a.value+'"]';default:throw Error(r(365))}}function ku(a,n){var c=[];a=[a,0];for(var o=0;oc?32:c;c=Rt.T;var v=Tl();try{It(o),Rt.T=null,o=Jf,Jf=null;var S=Vn,T=gn;if(ia=0,gu=Vn=null,gn=0,(kt&6)!==0)throw Error(r(331));var G=kt;if(kt|=4,rf(S.current),cf(S,S.current,T,o),kt=G,Ui(0,!1),$a&&typeof $a.onPostCommitFiberRoot=="function")try{$a.onPostCommitFiberRoot(cu,S)}catch{}return!0}finally{It(v),Rt.T=c,gf(a,n)}}function hi(a,n,c){n=xt(c,n),n=yr(a.stateNode,n,2),a=$n(a,n,2),a!==null&&(I(a,2),Zl(a))}function Bt(a,n,c){if(a.tag===3)hi(a,a,c);else for(;n!==null;){if(n.tag===3){hi(n,a,c);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Qn===null||!Qn.has(o))){a=xt(c,a),c=vh(2),o=$n(n,c,2),o!==null&&(yh(c,o,n,a),I(o,2),Zl(o));break}}n=n.return}}function ts(a,n,c){var o=a.pingCache;if(o===null){o=a.pingCache=new gl;var v=new Set;o.set(n,v)}else v=o.get(n),v===void 0&&(v=new Set,o.set(n,v));v.has(c)||(Ai=!0,v.add(c),a=Bh.bind(null,a,n,c),n.then(a,a))}function Bh(a,n,c){var o=a.pingCache;o!==null&&o.delete(n),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,Wt===a&&(te&c)===c&&(Xe===4||Xe===3&&(te&62914560)===te&&300>Da()-bc?(kt&2)===0&&Ze(a,0):ms|=c,gs===te&&(gs=0)),Zl(a)}function Yh(a,n){n===0&&(n=B()),a=Pn(a,n),a!==null&&(I(a,n),Zl(a))}function vd(a){var n=a.memoizedState,c=0;n!==null&&(c=n.retryLane),Yh(a,c)}function yd(a,n){var c=0;switch(a.tag){case 31:case 13:var o=a.stateNode,v=a.memoizedState;v!==null&&(c=v.retryLane);break;case 19:o=a.stateNode;break;case 22:o=a.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),Yh(a,c)}function aa(a,n){return hc(a,n)}function Hr(a,n,c,o){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fi(a){return a=a.prototype,!(!a||!a.isReactComponent)}function fl(a,n){var c=a.alternate;return c===null?(c=u(a.tag,n,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=n,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&65011712,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,n=a.dependencies,c.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function pf(a,n){a.flags&=65011714;var c=a.alternate;return c===null?(a.childLanes=0,a.lanes=n,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,n=c.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),a}function Dn(a,n,c,o,v,S){var T=0;if(o=a,typeof a=="function")Fi(a)&&(T=1);else if(typeof a=="string")T=Cl&&sa?Rf(a,c,ga.current)?26:yo(a)?27:5:Cl?Rf(a,c,ga.current)?26:5:sa&&yo(a)?27:5;else t:switch(a){case ic:return a=u(31,c,n,v),a.elementType=ic,a.lanes=S,a;case $i:return El(c.children,v,S,n);case tu:T=8,v|=24;break;case eu:return a=u(12,c,n,v|2),a.elementType=eu,a.lanes=S,a;case _f:return a=u(13,c,n,v),a.elementType=_f,a.lanes=S,a;case Gn:return a=u(19,c,n,v),a.elementType=Gn,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case xl:T=10;break t;case nc:T=9;break t;case es:T=11;break t;case bf:T=14;break t;case qa:T=16,o=null;break t}T=29,c=Error(r(130,a===null?"null":typeof a,"")),o=null}return n=u(T,c,n,v),n.elementType=a,n.type=o,n.lanes=S,n}function El(a,n,c,o){return a=u(7,a,o,n),a.lanes=c,a}function Ur(a,n,c){return a=u(6,a,null,n),a.lanes=c,a}function Br(a){var n=u(18,null,null,0);return n.stateNode=a,n}function Yr(a,n,c){return n=u(4,a.children!==null?a.children:[],a.key,n),n.lanes=c,n.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},n}function qh(a,n,c,o,v,S,T,G,P){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Pa,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=et(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=et(0),this.hiddenUpdates=et(null),this.identifierPrefix=o,this.onUncaughtError=v,this.onCaughtError=S,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=P,this.incompleteTransitions=new Map}function di(a,n,c,o,v,S,T,G,P,st,mt,rt){return a=new qh(a,n,c,T,P,st,mt,rt,G),n=1,S===!0&&(n|=24),S=u(3,null,null,n),a.current=S,S.stateNode=a,n=Dc(),n.refCount++,a.pooledCache=n,n.refCount++,S.memoizedState={element:o,isDehydrated:c,cache:n},Ma(S),a}function vf(a){return a?(a=sn,a):sn}function ac(a){var n=a._reactInternals;if(n===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=y(n),a=a!==null?_(a):null,a===null?null:ls(a.stateNode)}function qr(a,n,c,o,v,S){v=vf(v),o.context===null?o.context=v:o.pendingContext=v,o=Kl(n),o.payload={element:c},S=S===void 0?null:S,S!==null&&(o.callback=S),c=$n(a,o,n),c!==null&&(Ye(c,a,n),Us(c,a,n))}function ki(a,n){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c=st&&S>=rt&&v<=mt&&T<=_t){a.splice(n,1);break}else if(o!==st||c.width!==P.width||_tT){if(!(S!==rt||c.height!==P.height||mtv)){st>o&&(P.width+=st-o,P.x=o),mtS&&(P.height+=rt-S,P.y=S),_tc&&(c=G)),G ")+` - -No matching component was found for: - `)+a.join(" > ")}return null},wt.getPublicRootInstance=function(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 27:case 5:return ls(a.child.stateNode);default:return a.child.stateNode}},wt.injectIntoDevTools=function(){var a={bundleType:0,version:Lr,rendererPackageName:uc,currentDispatcherRef:Rt,reconcilerVersion:"19.2.0"};if(as!==null&&(a.rendererConfig=as),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")a=!1;else{var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n.isDisabled||!n.supportsFiber)a=!0;else{try{cu=n.inject(a),$a=n}catch{}a=!!n.checkDCE}}return a},wt.isAlreadyRendering=function(){return(kt&6)!==0},wt.observeVisibleRects=function(a,n,c,o){if(!ua)throw Error(r(363));a=Wa(a,n);var v=Af(a,c,o).disconnect;return{disconnect:function(){v()}}},wt.shouldError=function(){return null},wt.shouldSuspend=function(){return!1},wt.startHostTransition=function(a,n,c,o){if(a.tag!==5)throw Error(r(476));var v=oh(a).queue;rh(a,v,n,lu,c===null?f:function(){var S=oh(a);return S.next===null&&(S=a.alternate.memoizedState),Zs(a,S.next.queue,{},Ne()),c(o)})},wt.updateContainer=function(a,n,c,o){var v=n.current,S=Ne();return qr(v,S,a,n,c,o),S},wt.updateContainerSync=function(a,n,c,o){return qr(n.current,2,a,n,c,o),2},wt},d.exports.default=d.exports,Object.defineProperty(d.exports,"__esModule",{value:!0})})(c1)),c1.exports}var I2;function Gg(){return I2||(I2=1,s1.exports=Dg()),s1.exports}var Hg=Gg();const Ug=ud(Hg);var f1={exports:{}},vu={};/** - * @license React - * react-reconciler-constants.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var $2;function Bg(){return $2||($2=1,vu.ConcurrentRoot=1,vu.ContinuousEventPriority=8,vu.DefaultEventPriority=32,vu.DiscreteEventPriority=2,vu.IdleEventPriority=268435456,vu.LegacyRoot=0,vu.NoEventPriority=0),vu}var t3;function Yg(){return t3||(t3=1,f1.exports=Bg()),f1.exports}var rd=Yg();const e3={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let a3=!1,l3=!1;const id=".react-konva-event",qg=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. -Position of a node will be changed during drag&drop, so you should update state of the react app as well. -Consider to add onDragMove or onDragEnd events. -For more info see: https://github.com/konvajs/react-konva/issues/256 -`,jg=`ReactKonva: You are using "zIndex" attribute for a Konva node. -react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. -For more info see: https://github.com/konvajs/react-konva/issues/194 -`,Lg={};function od(d,l,u=Lg){if(!a3&&"zIndex"in l&&(console.warn(jg),a3=!0),!l3&&l.draggable){var f=l.x!==void 0||l.y!==void 0,r=l.onDragEnd||l.onDragMove;f&&!r&&(console.warn(qg),l3=!0)}for(var m in u)if(!e3[m]){var p=m.slice(0,2)==="on",y=u[m]!==l[m];if(p&&y){var _=m.substr(2).toLowerCase();_.substr(0,7)==="content"&&(_="content"+_.substr(7,1).toUpperCase()+_.substr(8)),d.off(_,u[m])}var E=!l.hasOwnProperty(m);E&&d.setAttr(m,void 0)}var x=l._useStrictMode,C={},A=!1;const O={};for(var m in l)if(!e3[m]){var p=m.slice(0,2)==="on",M=u[m]!==l[m];if(p&&M){var _=m.substr(2).toLowerCase();_.substr(0,7)==="content"&&(_="content"+_.substr(7,1).toUpperCase()+_.substr(8)),l[m]&&(O[_]=l[m])}!p&&(l[m]!==u[m]||x&&l[m]!==d.getAttr(m))&&(A=!0,C[m]=l[m])}A&&(d.setAttrs(C),Rs(d));for(var _ in O)d.off(_+id),d.on(_+id,O[_])}function Rs(d){if(!yt.autoDrawEnabled){var l=d.getLayer()||d.getStage();l&&l.batchDraw()}}var r1=x1();const q3={},Xg={};ar.Node.prototype._applyProps=od;let j3=rd.DefaultEventPriority;function Qg(d,l){if(typeof l=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${l}`);return}d.add(l),Rs(d)}function Vg(d,l,u){let f=ar[d];f||(console.error(`Konva has no node with the type ${d}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${d}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),f=ar.Group);const r={},m={};for(var p in l)if(p!=="ref"){var y=p.slice(0,2)==="on";y?m[p]=l[p]:r[p]=l[p]}const _=new f(r);return od(_,m),_}function Zg(d,l,u){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${d}"`)}function Kg(d,l,u){return!1}function wg(d){return d}function Jg(){return null}function Wg(){return null}function Fg(d,l,u,f){return Xg}function kg(){}function Pg(d){}function Ig(d,l){return!1}function $g(){return q3}function t6(){return q3}const e6=setTimeout,a6=clearTimeout,l6=!0,n6=d=>{d()},i6=-1;function u6(d,l){return!1}const s6=!1,c6=!1,f6=!0,r6=!1,o6=!1;function h6(d,l){l.parent===d?l.moveToTop():d.add(l),Rs(d)}function d6(d,l){l.parent===d?l.moveToTop():d.add(l),Rs(d)}function L3(d,l,u){l._remove(),d.add(l),l.setZIndex(u.getZIndex()),Rs(d)}function m6(d,l,u){L3(d,l,u)}function g6(d,l){l.destroy(),l.off(id),Rs(d)}function p6(d,l){l.destroy(),l.off(id),Rs(d)}function v6(d,l,u){console.error(`Text components are not yet supported in ReactKonva. You text is: "${u}"`)}function y6(d,l,u){}function S6(d,l,u,f){od(d,f,u)}function _6(d){d.hide(),Rs(d)}function b6(d){}function E6(d,l){(l.visible==null||l.visible)&&d.show()}function x6(d,l){}function T6(d){}function C6(){}function A6(){return null}function z6(){}function M6(){}function N6(){return rd.DefaultEventPriority}function O6(){}function R6(){return null}function D6(d){j3=d}function G6(){return j3}function H6(){return rd.DiscreteEventPriority}function U6(){return!1}function B6(){}function Y6(){return null}function q6(){return-1.1}function j6(){}function L6(){return!1}function X6(){return!0}function Q6(){}function V6(){}function Z6(){return null}const K6=null,w6=Sa.createContext(null);function J6(){}const W6=Object.freeze(Object.defineProperty({__proto__:null,HostTransitionContext:w6,NotPendingTransition:K6,afterActiveInstanceBlur:M6,appendChild:h6,appendChildToContainer:d6,appendInitialChild:Qg,beforeActiveInstanceBlur:z6,cancelTimeout:a6,clearContainer:T6,commitMount:y6,commitTextUpdate:v6,commitUpdate:S6,createInstance:Vg,createTextInstance:Zg,detachDeletedInstance:C6,finalizeInitialChildren:Kg,getChildHostContext:t6,getCurrentEventPriority:N6,getCurrentUpdatePriority:G6,getInstanceFromNode:A6,getInstanceFromScope:R6,getPublicInstance:wg,getRootHostContext:$g,hideInstance:_6,hideTextInstance:b6,idlePriority:r1.unstable_IdlePriority,insertBefore:L3,insertInContainerBefore:m6,isPrimaryRenderer:s6,maySuspendCommit:L6,noTimeout:i6,now:r1.unstable_now,preloadInstance:X6,prepareForCommit:Jg,preparePortalMount:Wg,prepareScopeUpdate:O6,prepareUpdate:Fg,removeChild:g6,removeChildFromContainer:p6,requestPostPaintCallback:j6,resetAfterCommit:kg,resetFormInstance:J6,resetTextContent:Pg,resolveEventTimeStamp:q6,resolveEventType:Y6,resolveUpdatePriority:H6,run:r1.unstable_runWithPriority,scheduleMicrotask:n6,scheduleTimeout:e6,setCurrentUpdatePriority:D6,shouldAttemptEagerTransition:U6,shouldDeprioritizeSubtree:Ig,shouldSetTextContent:u6,startSuspendingCommit:Q6,supportsHydration:o6,supportsMicrotasks:l6,supportsMutation:f6,supportsPersistence:r6,suspendInstance:V6,trackSchedulerEvent:B6,unhideInstance:E6,unhideTextInstance:x6,waitForCommitToBeReady:Z6,warnsIfNotActing:c6},Symbol.toStringTag,{value:"Module"}));function X3(d,l,u){if(!d)return;if(u(d)===!0)return d;let f=d.child;for(;f;){const r=X3(f,l,u);if(r)return r;f=f.sibling}}function Q3(d){try{return Object.defineProperties(d,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return d}}const O1=Q3(de.createContext(null));class V3 extends de.Component{render(){return de.createElement(O1.Provider,{value:this._reactInternals},this.props.children)}}function F6(){const d=de.useContext(O1);if(d===null)throw new Error("its-fine: useFiber must be called within a !");const l=de.useId();return de.useMemo(()=>{for(const u of[d,d==null?void 0:d.alternate]){if(!u)continue;const f=X3(u,!1,r=>{let m=r.memoizedState;for(;m;){if(m.memoizedState===l)return!0;m=m.next}});if(f)return f}},[d,l])}const k6=Symbol.for("react.context"),P6=d=>d!==null&&typeof d=="object"&&"$$typeof"in d&&d.$$typeof===k6;function I6(){const d=F6(),[l]=de.useState(()=>new Map);l.clear();let u=d;for(;u;){const f=u.type;P6(f)&&f!==O1&&!l.has(f)&&l.set(f,de.use(Q3(f))),u=u.return}return l}function $6(){const d=I6();return de.useMemo(()=>Array.from(d.keys()).reduce((l,u)=>f=>de.createElement(l,null,de.createElement(u.Provider,{...f,value:d.get(u)})),l=>de.createElement(V3,{...l})),[d])}if(Sa.version.indexOf("19")===-1)throw new Error("react-konva version 19 is only compatible with React 19. Make sure to have the last version of react-konva and react or downgrade react-konva to version 18.");function t8(d){const l=Sa.useRef({});return Sa.useLayoutEffect(()=>{l.current=d}),Sa.useLayoutEffect(()=>()=>{l.current={}},[]),l.current}const e8=()=>{const d=Sa.useRef(0);return Sa.useMemo(()=>{d.current++},[]),d.current>1},a8=d=>{const l=Sa.useRef(null),u=Sa.useRef(null),f=Sa.useRef(null),r=t8(d),m=$6(),p=Sa.useRef(null),y=x=>{const{forwardedRef:C}=d;C&&(typeof C=="function"?C(x):C.current=x)},_=e8(),E=()=>{var x;y(null),ed.updateContainer(null,f.current,null),(x=u.current)==null||x.destroy(),u.current=null};return Sa.useLayoutEffect(()=>(p.current&&(clearTimeout(p.current),p.current=null),u.current?y(u.current):(u.current=new ar.Stage({width:d.width,height:d.height,container:l.current}),y(u.current),f.current=ed.createContainer(u.current,rd.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null),ed.updateContainer(Sa.createElement(m,{},d.children),f.current,null,()=>{})),()=>{_?p.current=setTimeout(E,0):E()}),[]),Sa.useLayoutEffect(()=>{y(u.current),od(u.current,d,r),ed.updateContainer(Sa.createElement(m,{},d.children),f.current,null)}),Sa.createElement("div",{ref:l,id:d.id,accessKey:d.accessKey,className:d.className,role:d.role,style:d.style,tabIndex:d.tabIndex,title:d.title})},l8="Layer",n8="Rect",i8="Image",u8="Text",s8="Arrow",c8="Transformer",ed=Ug(W6),f8=Sa.forwardRef((d,l)=>Sa.createElement(V3,{},Sa.createElement(a8,{...d,forwardedRef:l})));var o1,n3;function r8(){if(n3)return o1;n3=1;var d=$o();return o1=function(u,f,r){const m=d.useRef("loading"),p=d.useRef(),[y,_]=d.useState(0),E=d.useRef(),x=d.useRef(),C=d.useRef();return(E.current!==u||x.current!==f||C.current!==r)&&(m.current="loading",p.current=void 0,E.current=u,x.current=f,C.current=r),d.useLayoutEffect(function(){if(!u)return;var A=document.createElement("img");function O(){A.decode().catch(()=>{}).finally(()=>{m.current="loaded",p.current=A,_(Math.random())})}function M(){m.current="failed",p.current=void 0,_(Math.random())}return A.addEventListener("load",O),A.addEventListener("error",M),f&&(A.crossOrigin=f),r&&(A.referrerPolicy=r),A.src=u,function(){A.removeEventListener("load",O),A.removeEventListener("error",M)}},[u,f,r]),[p.current,m.current]},o1}var o8=r8();const h8=ud(o8),d8=({src:d,onLoaded:l})=>{const[u]=h8(d);return de.useEffect(()=>{u&&l(u.width,u.height)},[u,l]),gt.jsx(i8,{image:u})},m8=({imageSrc:d,shapes:l,setShapes:u,selectedId:f,setSelectedId:r,tool:m,setTool:p,stageRef:y,onImageDimensionsChange:_,canvasWidth:E,canvasHeight:x})=>{const C=de.useRef(!1),A=de.useRef(null);de.useEffect(()=>{var L;if(f&&A.current&&y.current){const B=y.current.findOne("#"+f);B&&(A.current.nodes([B]),(L=A.current.getLayer())==null||L.batchDraw())}},[f,l]);const O=L=>{const B=L.target,et=B.getStage();if(!et)return;B.hide();const I=B.absolutePosition(),F=et.container().getBoundingClientRect(),ut={x:F.left+I.x,y:F.top+I.y},it=document.createElement("textarea");document.body.appendChild(it),it.value=B.text(),it.style.position="absolute",it.style.top=`${ut.y+window.scrollY}px`,it.style.left=`${ut.x+window.scrollX}px`,it.style.width=`${B.width()-B.padding()*2}px`,it.style.height=`${B.height()-B.padding()*2+5}px`,it.style.fontSize=`${B.fontSize()}px`,it.style.border="none",it.style.padding="0px",it.style.margin="0px",it.style.overflow="hidden",it.style.background="none",it.style.outline="none",it.style.resize="none",it.style.lineHeight=B.lineHeight().toString(),it.style.fontFamily=B.fontFamily(),it.style.fontWeight=B.fontStyle(),it.style.transformOrigin="left top",it.style.textAlign=B.align(),it.style.color=B.fill(),it.style.zIndex="1000";const Et=B.rotation();let Nt="";Et&&(Nt+=`rotateZ(${Et}deg)`),it.style.transform=Nt,it.style.height="auto",it.style.height=it.scrollHeight+3+"px",it.focus();const bt=()=>{it.parentNode&&it.parentNode.removeChild(it),B.show()},Yt=()=>{const St=it.value,U=B.id();u(ct=>ct.map(ft=>ft.id===U?{...ft,text:St}:ft)),bt()},Ot=St=>{St.key==="Enter"&&!St.shiftKey&&(St.preventDefault(),it.blur()),St.key==="Escape"&&bt()};it.addEventListener("blur",Yt),it.addEventListener("keydown",Ot)},M=L=>{var ut;if(m==="select"){L.target===L.target.getStage()&&(r(null),(ut=A.current)==null||ut.nodes([]));return}C.current=!0;const B=L.target.getStage(),et=B==null?void 0:B.getRelativePointerPosition();if(!et)return;const I={id:Math.random().toString(36).substr(2,9),x:et.x,y:et.y,stroke:"#be185d",strokeWidth:4};let F;if(m==="rect")F={...I,type:"rect",width:0,height:0,fill:"transparent",cornerRadius:15};else if(m==="arrow")F={...I,type:"arrow",points:[0,0,0,0]};else if(m==="text"){F={...I,type:"text",text:"Double Click to Edit",fontSize:32,fill:"#be185d"},C.current=!1,u([...l,F]),r(F.id),p("select");return}else return;u([...l,F]),r(F.id)},V=L=>{if(!C.current||m==="select"||m==="text")return;const B=L.target.getStage(),et=B==null?void 0:B.getRelativePointerPosition();if(!et)return;const I=l[l.length-1];if(I.id!==f)return;const F=l.slice(0,l.length-1);if(I.type==="rect")F.push({...I,width:et.x-I.x,height:et.y-I.y});else if(I.type==="arrow"){const ut=et.x-I.x,it=et.y-I.y;F.push({...I,points:[0,0,ut,it]})}u(F)},Z=()=>{C.current&&(C.current=!1,p("select"))},K=(L,B)=>{const et=l.findIndex(F=>F.id===B);if(et===-1)return;const I=[...l];I[et]={...I[et],x:L.target.x(),y:L.target.y()},u(I)},J=L=>{const B=L.target,et=B.id(),I=l.findIndex(Nt=>Nt.id===et);if(I===-1)return;const F=B.scaleX(),ut=B.scaleY();B.scaleX(1),B.scaleY(1);const it=[...l],Et=it[I];Et.type==="rect"?it[I]={...Et,x:B.x(),y:B.y(),rotation:B.rotation(),width:Math.max(5,B.width()*F),height:Math.max(5,B.height()*ut)}:Et.type==="text"?it[I]={...Et,x:B.x(),y:B.y(),rotation:B.rotation(),fontSize:Et.fontSize*F}:Et.type==="arrow"&&(it[I]={...Et,x:B.x(),y:B.y(),rotation:B.rotation()},B.scaleX(F),B.scaleY(ut)),u(it)};return gt.jsx(f8,{ref:y,width:E||window.innerWidth,height:x||window.innerHeight,onMouseDown:M,onMouseMove:V,onMouseUp:Z,className:"bg-white",style:{cursor:m==="select"?"default":"crosshair"},children:gt.jsxs(l8,{children:[d&>.jsx(d8,{src:d,onLoaded:_}),l.map(L=>{const B={key:L.id,id:L.id,x:L.x,y:L.y,rotation:L.rotation||0,draggable:m==="select",onClick:()=>{m==="select"&&r(L.id)},onTap:()=>{m==="select"&&r(L.id)},onDragEnd:et=>K(et,L.id),onTransformEnd:J};return L.type==="rect"?gt.jsx(n8,{...B,width:L.width,height:L.height,stroke:L.stroke,strokeWidth:L.strokeWidth,fill:L.fill,cornerRadius:L.cornerRadius}):L.type==="arrow"?gt.jsx(s8,{...B,points:L.points,stroke:L.stroke,strokeWidth:L.strokeWidth,fill:L.stroke,pointerLength:10,pointerWidth:10}):L.type==="text"?gt.jsx(u8,{...B,text:L.text,fontSize:L.fontSize,fill:L.stroke,stroke:"#FFFF00",strokeWidth:2,strokeJoin:"round",fontFamily:"Comic Sans MS, Comic Sans, cursive",fontStyle:"bold",onDblClick:O,onDblTap:O}):null}),f&>.jsx(c8,{ref:A,boundBoxFunc:(L,B)=>B.width<5||B.height<5?L:B,rotateEnabled:!0,borderStroke:"#d97706",anchorStroke:"#451a03",anchorFill:"#fcd34d",anchorSize:10,anchorCornerRadius:2})]})})},g8=()=>{const[d,l]=de.useState(null),[u,f]=de.useState({width:0,height:0}),[r,m]=de.useState([]),[p,y]=de.useState(null),[_,E]=de.useState("select"),x=de.useRef(null),C=de.useRef(null);de.useEffect(()=>{const et=I=>{var ut;const F=(ut=I.clipboardData)==null?void 0:ut.items;if(F){for(const it of F)if(it.type.indexOf("image")!==-1){const Et=it.getAsFile();if(Et){const Nt=URL.createObjectURL(Et);l(Nt),m([])}}}};return window.addEventListener("paste",et),()=>window.removeEventListener("paste",et)},[]),de.useEffect(()=>{const et=I=>{var F;if((I.key==="Delete"||I.key==="Backspace")&&p){const ut=(F=document.activeElement)==null?void 0:F.tagName.toLowerCase();if(ut==="input"||ut==="textarea")return;m(it=>it.filter(Et=>Et.id!==p)),y(null)}};return window.addEventListener("keydown",et),()=>window.removeEventListener("keydown",et)},[p]);const A=()=>{if(x.current){const et=p;y(null),requestAnimationFrame(()=>{if(!x.current)return;const I=x.current.toDataURL({pixelRatio:2}),F=document.createElement("a");F.download=`snapmark-export-${Date.now()}.png`,F.href=I,document.body.appendChild(F),F.click(),document.body.removeChild(F),y(et)})}},O=()=>{if(x.current){const et=p;y(null),setTimeout(()=>{x.current&&x.current.toBlob({pixelRatio:2,callback:I=>{I&&navigator.clipboard.write([new ClipboardItem({"image/png":I})]).then(()=>{}).catch(F=>{console.error("Failed to copy to clipboard",F),alert("Failed to copy image to clipboard")}),y(et)}})},50)}},M=(et,I)=>{m(F=>F.map(ut=>ut.id===et?{...ut,...I}:ut))},V=de.useCallback((et,I)=>{f(F=>F.width===et&&F.height===I?F:{width:et,height:I})},[]),Z=()=>{window.confirm("Clear all annotations and image?")&&(l(null),m([]),f({width:0,height:0}))},K=()=>{p&&(m(et=>et.filter(I=>I.id!==p)),y(null))},J=et=>{et.target===et.currentTarget&&y(null)},L=et=>{var F;const I=(F=et.target.files)==null?void 0:F[0];if(I){const ut=URL.createObjectURL(I);l(ut),m([])}},B=r.find(et=>et.id===p)||null;return gt.jsxs("div",{className:"flex h-screen w-screen bg-amber-50 text-amber-900 overflow-hidden font-comic",children:[gt.jsx(i4,{currentTool:_,setTool:E,onExport:A,onCopy:O,onClear:Z,hasImage:!!d,onDeleteSelected:K,hasSelection:!!p}),gt.jsxs("main",{className:"flex-1 relative overflow-hidden flex flex-col",children:[gt.jsxs("div",{className:"h-20 bg-white/70 backdrop-blur-sm border-b-4 border-amber-900 flex items-center px-6 justify-between shrink-0 z-10",children:[gt.jsxs("div",{className:"flex items-center gap-4",children:[gt.jsx("a",{href:"../index.html",className:"p-2 hover:bg-amber-200 rounded-full transition-colors flex items-center justify-center border-2 border-transparent hover:border-amber-900",title:"Back to Home",children:gt.jsx(Km,{size:24,className:"text-amber-900",strokeWidth:2.5})}),gt.jsxs("h1",{className:"flex items-center gap-3",children:[gt.jsx("div",{className:"bg-amber-900 text-amber-50 p-2 transform -rotate-3 border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,0.2)]",children:gt.jsx("span",{className:"font-impact text-2xl tracking-wide",children:"SM"})}),gt.jsxs("div",{className:"flex flex-col",children:[gt.jsx("span",{className:"font-impact text-3xl text-amber-900 leading-none",children:"SNAPMARK"}),gt.jsx("span",{className:"text-xs font-bold text-amber-700 tracking-wider",children:"Highlight • Annotate • Export"})]})]})]}),gt.jsx("div",{className:"text-lg font-bold text-amber-800/50 hidden md:block",children:d?"✨ Make it pop! ✨":"Waiting for image..."}),gt.jsxs("div",{children:[gt.jsxs("button",{onClick:()=>{var et;return(et=C.current)==null?void 0:et.click()},className:"font-impact text-lg bg-cyan-400 border-2 border-black text-black px-6 py-2 transition-all hover:-translate-y-1 hover:shadow-[4px_4px_0px_0px_black] active:translate-y-0 active:shadow-none flex items-center gap-2",children:[gt.jsx(C2,{size:20,strokeWidth:2.5})," OPEN IMAGE"]}),gt.jsx("input",{ref:C,type:"file",accept:"image/*",className:"hidden",onChange:L})]})]}),gt.jsxs("div",{className:"flex-1 overflow-auto flex items-center justify-center p-8 relative",onClick:J,children:[gt.jsx("div",{className:"absolute top-10 left-10 text-6xl opacity-20 animate-bounce pointer-events-none select-none",children:"☕"}),gt.jsx("div",{className:"absolute bottom-20 right-20 text-4xl opacity-20 animate-pulse pointer-events-none select-none",children:"✨"}),d?gt.jsx("div",{className:"border-4 border-amber-900 bg-white shadow-[8px_8px_0px_0px_rgba(69,26,3,0.2)]",style:{width:u.width,height:u.height,minWidth:u.width||300,minHeight:u.height||200},children:gt.jsx(m8,{imageSrc:d,shapes:r,setShapes:m,selectedId:p,setSelectedId:y,tool:_,setTool:E,stageRef:x,onImageDimensionsChange:V,canvasWidth:u.width,canvasHeight:u.height})}):gt.jsxs("div",{onClick:et=>{var I;et.stopPropagation(),(I=C.current)==null||I.click()},className:"group flex flex-col items-center justify-center bg-white border-4 border-dashed border-amber-900/40 rounded-3xl w-[500px] h-[350px] p-8 transition-all hover:border-amber-900 hover:bg-amber-100/50 hover:scale-105 cursor-pointer relative overflow-hidden",children:[gt.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(#78350f_1px,transparent_1px)] [background-size:16px_16px] opacity-5"}),gt.jsx("div",{className:"bg-amber-100 p-6 rounded-full mb-6 border-4 border-amber-200 group-hover:border-amber-400 group-hover:bg-amber-200 transition-colors",children:gt.jsx(C2,{size:64,className:"text-amber-700",strokeWidth:2.5})}),gt.jsx("h2",{className:"font-impact text-4xl text-amber-900 mb-2",children:"PASTE IMAGE"}),gt.jsx("p",{className:"text-xl font-bold text-amber-700/70 group-hover:text-amber-800",children:"Ctrl+V / Cmd+V"}),gt.jsx("p",{className:"mt-6 text-sm font-bold bg-amber-900 text-amber-50 px-3 py-1 rounded-full opacity-0 group-hover:opacity-100 transition-opacity transform translate-y-2 group-hover:translate-y-0",children:"or click to browse"})]})]})]}),gt.jsx(f4,{selectedShape:B,updateShape:M})]})},Z3=document.getElementById("root");if(!Z3)throw new Error("Could not find root element to mount to");const p8=Hm.createRoot(Z3);p8.render(gt.jsx(Sa.StrictMode,{children:gt.jsx(g8,{})})); diff --git a/src/snapmark-app/index.html b/src/snapmark-app/index.html deleted file mode 100644 index ba15b59..0000000 --- a/src/snapmark-app/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - SnapMark | cffy.in - - - - - - - - -
- -
- - \ No newline at end of file