Files
CreaBook/client/dist/assets/index-C5xBjB0t.js
2026-04-05 03:08:53 +02:00

223 lines
568 KiB
JavaScript

var B2=t=>{throw TypeError(t)};var h0=(t,e,n)=>e.has(t)||B2("Cannot "+n);var A=(t,e,n)=>(h0(t,e,"read from private field"),n?n.call(t):e.get(t)),ce=(t,e,n)=>e.has(t)?B2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),te=(t,e,n,r)=>(h0(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Se=(t,e,n)=>(h0(t,e,"access private method"),n);var dc=(t,e,n,r)=>({set _(i){te(t,e,i,n)},get _(){return A(t,e,r)}});function _7(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var G2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Md(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var I4={exports:{}},Ld={},j4={exports:{}},Ee={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var nu=Symbol.for("react.element"),x7=Symbol.for("react.portal"),w7=Symbol.for("react.fragment"),C7=Symbol.for("react.strict_mode"),k7=Symbol.for("react.profiler"),E7=Symbol.for("react.provider"),P7=Symbol.for("react.context"),N7=Symbol.for("react.forward_ref"),R7=Symbol.for("react.suspense"),T7=Symbol.for("react.memo"),O7=Symbol.for("react.lazy"),H2=Symbol.iterator;function F7(t){return t===null||typeof t!="object"?null:(t=H2&&t[H2]||t["@@iterator"],typeof t=="function"?t:null)}var U4={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z4=Object.assign,B4={};function va(t,e,n){this.props=t,this.context=e,this.refs=B4,this.updater=n||U4}va.prototype.isReactComponent={};va.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};va.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function G4(){}G4.prototype=va.prototype;function R1(t,e,n){this.props=t,this.context=e,this.refs=B4,this.updater=n||U4}var T1=R1.prototype=new G4;T1.constructor=R1;z4(T1,va.prototype);T1.isPureReactComponent=!0;var V2=Array.isArray,H4=Object.prototype.hasOwnProperty,O1={current:null},V4={key:!0,ref:!0,__self:!0,__source:!0};function W4(t,e,n){var r,i={},o=null,l=null;if(e!=null)for(r in e.ref!==void 0&&(l=e.ref),e.key!==void 0&&(o=""+e.key),e)H4.call(e,r)&&!V4.hasOwnProperty(r)&&(i[r]=e[r]);var u=arguments.length-2;if(u===1)i.children=n;else if(1<u){for(var d=Array(u),f=0;f<u;f++)d[f]=arguments[f+2];i.children=d}if(t&&t.defaultProps)for(r in u=t.defaultProps,u)i[r]===void 0&&(i[r]=u[r]);return{$$typeof:nu,type:t,key:o,ref:l,props:i,_owner:O1.current}}function A7(t,e){return{$$typeof:nu,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function F1(t){return typeof t=="object"&&t!==null&&t.$$typeof===nu}function M7(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var W2=/\/+/g;function f0(t,e){return typeof t=="object"&&t!==null&&t.key!=null?M7(""+t.key):e.toString(36)}function Dc(t,e,n,r,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var l=!1;if(t===null)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case nu:case x7:l=!0}}if(l)return l=t,i=i(l),t=r===""?"."+f0(l,0):r,V2(i)?(n="",t!=null&&(n=t.replace(W2,"$&/")+"/"),Dc(i,e,n,"",function(f){return f})):i!=null&&(F1(i)&&(i=A7(i,n+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(W2,"$&/")+"/")+t)),e.push(i)),1;if(l=0,r=r===""?".":r+":",V2(t))for(var u=0;u<t.length;u++){o=t[u];var d=r+f0(o,u);l+=Dc(o,e,n,d,i)}else if(d=F7(t),typeof d=="function")for(t=d.call(t),u=0;!(o=t.next()).done;)o=o.value,d=r+f0(o,u++),l+=Dc(o,e,n,d,i);else if(o==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return l}function hc(t,e,n){if(t==null)return t;var r=[],i=0;return Dc(t,r,"","",function(o){return e.call(n,o,i++)}),r}function L7(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var on={current:null},Ic={transition:null},b7={ReactCurrentDispatcher:on,ReactCurrentBatchConfig:Ic,ReactCurrentOwner:O1};function K4(){throw Error("act(...) is not supported in production builds of React.")}Ee.Children={map:hc,forEach:function(t,e,n){hc(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return hc(t,function(){e++}),e},toArray:function(t){return hc(t,function(e){return e})||[]},only:function(t){if(!F1(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ee.Component=va;Ee.Fragment=w7;Ee.Profiler=k7;Ee.PureComponent=R1;Ee.StrictMode=C7;Ee.Suspense=R7;Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=b7;Ee.act=K4;Ee.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=z4({},t.props),i=t.key,o=t.ref,l=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,l=O1.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var u=t.type.defaultProps;for(d in e)H4.call(e,d)&&!V4.hasOwnProperty(d)&&(r[d]=e[d]===void 0&&u!==void 0?u[d]:e[d])}var d=arguments.length-2;if(d===1)r.children=n;else if(1<d){u=Array(d);for(var f=0;f<d;f++)u[f]=arguments[f+2];r.children=u}return{$$typeof:nu,type:t.type,key:i,ref:o,props:r,_owner:l}};Ee.createContext=function(t){return t={$$typeof:P7,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:E7,_context:t},t.Consumer=t};Ee.createElement=W4;Ee.createFactory=function(t){var e=W4.bind(null,t);return e.type=t,e};Ee.createRef=function(){return{current:null}};Ee.forwardRef=function(t){return{$$typeof:N7,render:t}};Ee.isValidElement=F1;Ee.lazy=function(t){return{$$typeof:O7,_payload:{_status:-1,_result:t},_init:L7}};Ee.memo=function(t,e){return{$$typeof:T7,type:t,compare:e===void 0?null:e}};Ee.startTransition=function(t){var e=Ic.transition;Ic.transition={};try{t()}finally{Ic.transition=e}};Ee.unstable_act=K4;Ee.useCallback=function(t,e){return on.current.useCallback(t,e)};Ee.useContext=function(t){return on.current.useContext(t)};Ee.useDebugValue=function(){};Ee.useDeferredValue=function(t){return on.current.useDeferredValue(t)};Ee.useEffect=function(t,e){return on.current.useEffect(t,e)};Ee.useId=function(){return on.current.useId()};Ee.useImperativeHandle=function(t,e,n){return on.current.useImperativeHandle(t,e,n)};Ee.useInsertionEffect=function(t,e){return on.current.useInsertionEffect(t,e)};Ee.useLayoutEffect=function(t,e){return on.current.useLayoutEffect(t,e)};Ee.useMemo=function(t,e){return on.current.useMemo(t,e)};Ee.useReducer=function(t,e,n){return on.current.useReducer(t,e,n)};Ee.useRef=function(t){return on.current.useRef(t)};Ee.useState=function(t){return on.current.useState(t)};Ee.useSyncExternalStore=function(t,e,n){return on.current.useSyncExternalStore(t,e,n)};Ee.useTransition=function(){return on.current.useTransition()};Ee.version="18.3.1";j4.exports=Ee;var W=j4.exports;const Mt=Md(W),D7=_7({__proto__:null,default:Mt},[W]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var I7=W,j7=Symbol.for("react.element"),U7=Symbol.for("react.fragment"),z7=Object.prototype.hasOwnProperty,B7=I7.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,G7={key:!0,ref:!0,__self:!0,__source:!0};function Q4(t,e,n){var r,i={},o=null,l=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(l=e.ref);for(r in e)z7.call(e,r)&&!G7.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:j7,type:t,key:o,ref:l,props:i,_owner:B7.current}}Ld.Fragment=U7;Ld.jsx=Q4;Ld.jsxs=Q4;I4.exports=Ld;var N=I4.exports,rp={},q4={exports:{}},On={},Y4={exports:{}},X4={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(t){function e(V,ee){var $=V.length;V.push(ee);e:for(;0<$;){var J=$-1>>>1,le=V[J];if(0<i(le,ee))V[J]=ee,V[$]=le,$=J;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var ee=V[0],$=V.pop();if($!==ee){V[0]=$;e:for(var J=0,le=V.length,Ne=le>>>1;J<Ne;){var at=2*(J+1)-1,mt=V[at],We=at+1,D=V[We];if(0>i(mt,$))We<le&&0>i(D,mt)?(V[J]=D,V[We]=$,J=We):(V[J]=mt,V[at]=$,J=at);else if(We<le&&0>i(D,$))V[J]=D,V[We]=$,J=We;else break e}}return ee}function i(V,ee){var $=V.sortIndex-ee.sortIndex;return $!==0?$:V.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var d=[],f=[],g=1,v=null,S=3,w=!1,y=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(V){for(var ee=n(f);ee!==null;){if(ee.callback===null)r(f);else if(ee.startTime<=V)r(f),ee.sortIndex=ee.expirationTime,e(d,ee);else break;ee=n(f)}}function x(V){if(E=!1,m(V),!y)if(n(d)!==null)y=!0,he(T);else{var ee=n(f);ee!==null&&ke(x,ee.startTime-V)}}function T(V,ee){y=!1,E&&(E=!1,P(O),O=-1),w=!0;var $=S;try{for(m(ee),v=n(d);v!==null&&(!(v.expirationTime>ee)||V&&!G());){var J=v.callback;if(typeof J=="function"){v.callback=null,S=v.priorityLevel;var le=J(v.expirationTime<=ee);ee=t.unstable_now(),typeof le=="function"?v.callback=le:v===n(d)&&r(d),m(ee)}else r(d);v=n(d)}if(v!==null)var Ne=!0;else{var at=n(f);at!==null&&ke(x,at.startTime-ee),Ne=!1}return Ne}finally{v=null,S=$,w=!1}}var F=!1,L=null,O=-1,j=5,M=-1;function G(){return!(t.unstable_now()-M<j)}function K(){if(L!==null){var V=t.unstable_now();M=V;var ee=!0;try{ee=L(!0,V)}finally{ee?X():(F=!1,L=null)}}else F=!1}var X;if(typeof k=="function")X=function(){k(K)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,Z=ie.port2;ie.port1.onmessage=K,X=function(){Z.postMessage(null)}}else X=function(){C(K,0)};function he(V){L=V,F||(F=!0,X())}function ke(V,ee){O=C(function(){V(t.unstable_now())},ee)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_continueExecution=function(){y||w||(y=!0,he(T))},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_getFirstCallbackNode=function(){return n(d)},t.unstable_next=function(V){switch(S){case 1:case 2:case 3:var ee=3;break;default:ee=S}var $=S;S=ee;try{return V()}finally{S=$}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,ee){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var $=S;S=V;try{return ee()}finally{S=$}},t.unstable_scheduleCallback=function(V,ee,$){var J=t.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?J+$:J):$=J,V){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=$+le,V={id:g++,callback:ee,priorityLevel:V,startTime:$,expirationTime:le,sortIndex:-1},$>J?(V.sortIndex=$,e(f,V),n(d)===null&&V===n(f)&&(E?(P(O),O=-1):E=!0,ke(x,$-J))):(V.sortIndex=le,e(d,V),y||w||(y=!0,he(T))),V},t.unstable_shouldYield=G,t.unstable_wrapCallback=function(V){var ee=S;return function(){var $=S;S=ee;try{return V.apply(this,arguments)}finally{S=$}}}})(X4);Y4.exports=X4;var yl=Y4.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var H7=W,Tn=yl;function q(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var $4=new Set,Nl={};function Js(t,e){oa(t,e),oa(t+"Capture",e)}function oa(t,e){for(Nl[t]=e,t=0;t<e.length;t++)$4.add(e[t])}var ri=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ip=Object.prototype.hasOwnProperty,V7=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,K2={},Q2={};function W7(t){return ip.call(Q2,t)?!0:ip.call(K2,t)?!1:V7.test(t)?Q2[t]=!0:(K2[t]=!0,!1)}function K7(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Q7(t,e,n,r){if(e===null||typeof e>"u"||K7(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function an(t,e,n,r,i,o,l){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=l}var Bt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Bt[t]=new an(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Bt[e]=new an(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Bt[t]=new an(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Bt[t]=new an(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Bt[t]=new an(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Bt[t]=new an(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Bt[t]=new an(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Bt[t]=new an(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Bt[t]=new an(t,5,!1,t.toLowerCase(),null,!1,!1)});var A1=/[\-:]([a-z])/g;function M1(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(A1,M1);Bt[e]=new an(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(A1,M1);Bt[e]=new an(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(A1,M1);Bt[e]=new an(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Bt[t]=new an(t,1,!1,t.toLowerCase(),null,!1,!1)});Bt.xlinkHref=new an("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Bt[t]=new an(t,1,!1,t.toLowerCase(),null,!0,!0)});function L1(t,e,n,r){var i=Bt.hasOwnProperty(e)?Bt[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Q7(e,n,i,r)&&(n=null),r||i===null?W7(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var ai=H7.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,fc=Symbol.for("react.element"),Oo=Symbol.for("react.portal"),Fo=Symbol.for("react.fragment"),b1=Symbol.for("react.strict_mode"),sp=Symbol.for("react.profiler"),J4=Symbol.for("react.provider"),Z4=Symbol.for("react.context"),D1=Symbol.for("react.forward_ref"),op=Symbol.for("react.suspense"),ap=Symbol.for("react.suspense_list"),I1=Symbol.for("react.memo"),Ri=Symbol.for("react.lazy"),e3=Symbol.for("react.offscreen"),q2=Symbol.iterator;function Ja(t){return t===null||typeof t!="object"?null:(t=q2&&t[q2]||t["@@iterator"],typeof t=="function"?t:null)}var st=Object.assign,p0;function cl(t){if(p0===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);p0=e&&e[1]||""}return`
`+p0+t}var g0=!1;function m0(t,e){if(!t||g0)return"";g0=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(f){var r=f}Reflect.construct(t,[],e)}else{try{e.call()}catch(f){r=f}t.call(e.prototype)}else{try{throw Error()}catch(f){r=f}t()}}catch(f){if(f&&r&&typeof f.stack=="string"){for(var i=f.stack.split(`
`),o=r.stack.split(`
`),l=i.length-1,u=o.length-1;1<=l&&0<=u&&i[l]!==o[u];)u--;for(;1<=l&&0<=u;l--,u--)if(i[l]!==o[u]){if(l!==1||u!==1)do if(l--,u--,0>u||i[l]!==o[u]){var d=`
`+i[l].replace(" at new "," at ");return t.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",t.displayName)),d}while(1<=l&&0<=u);break}}}finally{g0=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?cl(t):""}function q7(t){switch(t.tag){case 5:return cl(t.type);case 16:return cl("Lazy");case 13:return cl("Suspense");case 19:return cl("SuspenseList");case 0:case 2:case 15:return t=m0(t.type,!1),t;case 11:return t=m0(t.type.render,!1),t;case 1:return t=m0(t.type,!0),t;default:return""}}function lp(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Fo:return"Fragment";case Oo:return"Portal";case sp:return"Profiler";case b1:return"StrictMode";case op:return"Suspense";case ap:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Z4:return(t.displayName||"Context")+".Consumer";case J4:return(t._context.displayName||"Context")+".Provider";case D1:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case I1:return e=t.displayName||null,e!==null?e:lp(t.type)||"Memo";case Ri:e=t._payload,t=t._init;try{return lp(t(e))}catch{}}return null}function Y7(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return lp(e);case 8:return e===b1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Zi(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function t3(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function X7(t){var e=t3(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function pc(t){t._valueTracker||(t._valueTracker=X7(t))}function n3(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=t3(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function ed(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function up(t,e){var n=e.checked;return st({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Y2(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Zi(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function r3(t,e){e=e.checked,e!=null&&L1(t,"checked",e,!1)}function cp(t,e){r3(t,e);var n=Zi(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?dp(t,e.type,n):e.hasOwnProperty("defaultValue")&&dp(t,e.type,Zi(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function X2(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function dp(t,e,n){(e!=="number"||ed(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var dl=Array.isArray;function Go(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Zi(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function hp(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(q(91));return st({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function $2(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(q(92));if(dl(n)){if(1<n.length)throw Error(q(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Zi(n)}}function i3(t,e){var n=Zi(e.value),r=Zi(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function J2(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function s3(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fp(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?s3(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var gc,o3=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(gc=gc||document.createElement("div"),gc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=gc.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Rl(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var vl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$7=["Webkit","ms","Moz","O"];Object.keys(vl).forEach(function(t){$7.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),vl[e]=vl[t]})});function a3(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||vl.hasOwnProperty(t)&&vl[t]?(""+e).trim():e+"px"}function l3(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=a3(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var J7=st({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pp(t,e){if(e){if(J7[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(q(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(q(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(q(61))}if(e.style!=null&&typeof e.style!="object")throw Error(q(62))}}function gp(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mp=null;function j1(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var yp=null,Ho=null,Vo=null;function Z2(t){if(t=su(t)){if(typeof yp!="function")throw Error(q(280));var e=t.stateNode;e&&(e=Ud(e),yp(t.stateNode,t.type,e))}}function u3(t){Ho?Vo?Vo.push(t):Vo=[t]:Ho=t}function c3(){if(Ho){var t=Ho,e=Vo;if(Vo=Ho=null,Z2(t),e)for(t=0;t<e.length;t++)Z2(e[t])}}function d3(t,e){return t(e)}function h3(){}var y0=!1;function f3(t,e,n){if(y0)return t(e,n);y0=!0;try{return d3(t,e,n)}finally{y0=!1,(Ho!==null||Vo!==null)&&(h3(),c3())}}function Tl(t,e){var n=t.stateNode;if(n===null)return null;var r=Ud(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(q(231,e,typeof n));return n}var vp=!1;if(ri)try{var Za={};Object.defineProperty(Za,"passive",{get:function(){vp=!0}}),window.addEventListener("test",Za,Za),window.removeEventListener("test",Za,Za)}catch{vp=!1}function Z7(t,e,n,r,i,o,l,u,d){var f=Array.prototype.slice.call(arguments,3);try{e.apply(n,f)}catch(g){this.onError(g)}}var Sl=!1,td=null,nd=!1,Sp=null,eS={onError:function(t){Sl=!0,td=t}};function tS(t,e,n,r,i,o,l,u,d){Sl=!1,td=null,Z7.apply(eS,arguments)}function nS(t,e,n,r,i,o,l,u,d){if(tS.apply(this,arguments),Sl){if(Sl){var f=td;Sl=!1,td=null}else throw Error(q(198));nd||(nd=!0,Sp=f)}}function Zs(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function p3(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function ey(t){if(Zs(t)!==t)throw Error(q(188))}function rS(t){var e=t.alternate;if(!e){if(e=Zs(t),e===null)throw Error(q(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return ey(i),t;if(o===r)return ey(i),e;o=o.sibling}throw Error(q(188))}if(n.return!==r.return)n=i,r=o;else{for(var l=!1,u=i.child;u;){if(u===n){l=!0,n=i,r=o;break}if(u===r){l=!0,r=i,n=o;break}u=u.sibling}if(!l){for(u=o.child;u;){if(u===n){l=!0,n=o,r=i;break}if(u===r){l=!0,r=o,n=i;break}u=u.sibling}if(!l)throw Error(q(189))}}if(n.alternate!==r)throw Error(q(190))}if(n.tag!==3)throw Error(q(188));return n.stateNode.current===n?t:e}function g3(t){return t=rS(t),t!==null?m3(t):null}function m3(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=m3(t);if(e!==null)return e;t=t.sibling}return null}var y3=Tn.unstable_scheduleCallback,ty=Tn.unstable_cancelCallback,iS=Tn.unstable_shouldYield,sS=Tn.unstable_requestPaint,ft=Tn.unstable_now,oS=Tn.unstable_getCurrentPriorityLevel,U1=Tn.unstable_ImmediatePriority,v3=Tn.unstable_UserBlockingPriority,rd=Tn.unstable_NormalPriority,aS=Tn.unstable_LowPriority,S3=Tn.unstable_IdlePriority,bd=null,Mr=null;function lS(t){if(Mr&&typeof Mr.onCommitFiberRoot=="function")try{Mr.onCommitFiberRoot(bd,t,void 0,(t.current.flags&128)===128)}catch{}}var dr=Math.clz32?Math.clz32:dS,uS=Math.log,cS=Math.LN2;function dS(t){return t>>>=0,t===0?32:31-(uS(t)/cS|0)|0}var mc=64,yc=4194304;function hl(t){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: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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function id(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,l=n&268435455;if(l!==0){var u=l&~i;u!==0?r=hl(u):(o&=l,o!==0&&(r=hl(o)))}else l=n&~i,l!==0?r=hl(l):o!==0&&(r=hl(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-dr(e),i=1<<n,r|=t[n],e&=~i;return r}function hS(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fS(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var l=31-dr(o),u=1<<l,d=i[l];d===-1?(!(u&n)||u&r)&&(i[l]=hS(u,e)):d<=e&&(t.expiredLanes|=u),o&=~u}}function _p(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function _3(){var t=mc;return mc<<=1,!(mc&4194240)&&(mc=64),t}function v0(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function ru(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-dr(e),t[e]=n}function pS(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-dr(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}function z1(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-dr(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Ie=0;function x3(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var w3,B1,C3,k3,E3,xp=!1,vc=[],Vi=null,Wi=null,Ki=null,Ol=new Map,Fl=new Map,Oi=[],gS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ny(t,e){switch(t){case"focusin":case"focusout":Vi=null;break;case"dragenter":case"dragleave":Wi=null;break;case"mouseover":case"mouseout":Ki=null;break;case"pointerover":case"pointerout":Ol.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fl.delete(e.pointerId)}}function el(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},e!==null&&(e=su(e),e!==null&&B1(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function mS(t,e,n,r,i){switch(e){case"focusin":return Vi=el(Vi,t,e,n,r,i),!0;case"dragenter":return Wi=el(Wi,t,e,n,r,i),!0;case"mouseover":return Ki=el(Ki,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return Ol.set(o,el(Ol.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Fl.set(o,el(Fl.get(o)||null,t,e,n,r,i)),!0}return!1}function P3(t){var e=Ps(t.target);if(e!==null){var n=Zs(e);if(n!==null){if(e=n.tag,e===13){if(e=p3(n),e!==null){t.blockedOn=e,E3(t.priority,function(){C3(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function jc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=wp(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);mp=r,n.target.dispatchEvent(r),mp=null}else return e=su(n),e!==null&&B1(e),t.blockedOn=n,!1;e.shift()}return!0}function ry(t,e,n){jc(t)&&n.delete(e)}function yS(){xp=!1,Vi!==null&&jc(Vi)&&(Vi=null),Wi!==null&&jc(Wi)&&(Wi=null),Ki!==null&&jc(Ki)&&(Ki=null),Ol.forEach(ry),Fl.forEach(ry)}function tl(t,e){t.blockedOn===e&&(t.blockedOn=null,xp||(xp=!0,Tn.unstable_scheduleCallback(Tn.unstable_NormalPriority,yS)))}function Al(t){function e(i){return tl(i,t)}if(0<vc.length){tl(vc[0],t);for(var n=1;n<vc.length;n++){var r=vc[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Vi!==null&&tl(Vi,t),Wi!==null&&tl(Wi,t),Ki!==null&&tl(Ki,t),Ol.forEach(e),Fl.forEach(e),n=0;n<Oi.length;n++)r=Oi[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Oi.length&&(n=Oi[0],n.blockedOn===null);)P3(n),n.blockedOn===null&&Oi.shift()}var Wo=ai.ReactCurrentBatchConfig,sd=!0;function vS(t,e,n,r){var i=Ie,o=Wo.transition;Wo.transition=null;try{Ie=1,G1(t,e,n,r)}finally{Ie=i,Wo.transition=o}}function SS(t,e,n,r){var i=Ie,o=Wo.transition;Wo.transition=null;try{Ie=4,G1(t,e,n,r)}finally{Ie=i,Wo.transition=o}}function G1(t,e,n,r){if(sd){var i=wp(t,e,n,r);if(i===null)R0(t,e,r,od,n),ny(t,r);else if(mS(i,t,e,n,r))r.stopPropagation();else if(ny(t,r),e&4&&-1<gS.indexOf(t)){for(;i!==null;){var o=su(i);if(o!==null&&w3(o),o=wp(t,e,n,r),o===null&&R0(t,e,r,od,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else R0(t,e,r,null,n)}}var od=null;function wp(t,e,n,r){if(od=null,t=j1(r),t=Ps(t),t!==null)if(e=Zs(t),e===null)t=null;else if(n=e.tag,n===13){if(t=p3(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return od=t,null}function N3(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(oS()){case U1:return 1;case v3:return 4;case rd:case aS:return 16;case S3:return 536870912;default:return 16}default:return 16}}var Bi=null,H1=null,Uc=null;function R3(){if(Uc)return Uc;var t,e=H1,n=e.length,r,i="value"in Bi?Bi.value:Bi.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var l=n-t;for(r=1;r<=l&&e[n-r]===i[o-r];r++);return Uc=i.slice(t,1<r?1-r:void 0)}function zc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Sc(){return!0}function iy(){return!1}function Fn(t){function e(n,r,i,o,l){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=l,this.currentTarget=null;for(var u in t)t.hasOwnProperty(u)&&(n=t[u],this[u]=n?n(o):o[u]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Sc:iy,this.isPropagationStopped=iy,this}return st(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Sc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Sc)},persist:function(){},isPersistent:Sc}),e}var Sa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},V1=Fn(Sa),iu=st({},Sa,{view:0,detail:0}),_S=Fn(iu),S0,_0,nl,Dd=st({},iu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:W1,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==nl&&(nl&&t.type==="mousemove"?(S0=t.screenX-nl.screenX,_0=t.screenY-nl.screenY):_0=S0=0,nl=t),S0)},movementY:function(t){return"movementY"in t?t.movementY:_0}}),sy=Fn(Dd),xS=st({},Dd,{dataTransfer:0}),wS=Fn(xS),CS=st({},iu,{relatedTarget:0}),x0=Fn(CS),kS=st({},Sa,{animationName:0,elapsedTime:0,pseudoElement:0}),ES=Fn(kS),PS=st({},Sa,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),NS=Fn(PS),RS=st({},Sa,{data:0}),oy=Fn(RS),TS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},OS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},FS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AS(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=FS[t])?!!e[t]:!1}function W1(){return AS}var MS=st({},iu,{key:function(t){if(t.key){var e=TS[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=zc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?OS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:W1,charCode:function(t){return t.type==="keypress"?zc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?zc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),LS=Fn(MS),bS=st({},Dd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ay=Fn(bS),DS=st({},iu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:W1}),IS=Fn(DS),jS=st({},Sa,{propertyName:0,elapsedTime:0,pseudoElement:0}),US=Fn(jS),zS=st({},Dd,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),BS=Fn(zS),GS=[9,13,27,32],K1=ri&&"CompositionEvent"in window,_l=null;ri&&"documentMode"in document&&(_l=document.documentMode);var HS=ri&&"TextEvent"in window&&!_l,T3=ri&&(!K1||_l&&8<_l&&11>=_l),ly=" ",uy=!1;function O3(t,e){switch(t){case"keyup":return GS.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function F3(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ao=!1;function VS(t,e){switch(t){case"compositionend":return F3(e);case"keypress":return e.which!==32?null:(uy=!0,ly);case"textInput":return t=e.data,t===ly&&uy?null:t;default:return null}}function WS(t,e){if(Ao)return t==="compositionend"||!K1&&O3(t,e)?(t=R3(),Uc=H1=Bi=null,Ao=!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.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return T3&&e.locale!=="ko"?null:e.data;default:return null}}var KS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cy(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!KS[t.type]:e==="textarea"}function A3(t,e,n,r){u3(r),e=ad(e,"onChange"),0<e.length&&(n=new V1("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var xl=null,Ml=null;function QS(t){H3(t,0)}function Id(t){var e=bo(t);if(n3(e))return t}function qS(t,e){if(t==="change")return e}var M3=!1;if(ri){var w0;if(ri){var C0="oninput"in document;if(!C0){var dy=document.createElement("div");dy.setAttribute("oninput","return;"),C0=typeof dy.oninput=="function"}w0=C0}else w0=!1;M3=w0&&(!document.documentMode||9<document.documentMode)}function hy(){xl&&(xl.detachEvent("onpropertychange",L3),Ml=xl=null)}function L3(t){if(t.propertyName==="value"&&Id(Ml)){var e=[];A3(e,Ml,t,j1(t)),f3(QS,e)}}function YS(t,e,n){t==="focusin"?(hy(),xl=e,Ml=n,xl.attachEvent("onpropertychange",L3)):t==="focusout"&&hy()}function XS(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Id(Ml)}function $S(t,e){if(t==="click")return Id(e)}function JS(t,e){if(t==="input"||t==="change")return Id(e)}function ZS(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var pr=typeof Object.is=="function"?Object.is:ZS;function Ll(t,e){if(pr(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ip.call(e,i)||!pr(t[i],e[i]))return!1}return!0}function fy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function py(t,e){var n=fy(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fy(n)}}function b3(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?b3(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function D3(){for(var t=window,e=ed();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=ed(t.document)}return e}function Q1(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")}function e_(t){var e=D3(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&b3(n.ownerDocument.documentElement,n)){if(r!==null&&Q1(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=py(n,o);var l=py(n,r);i&&l&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==l.node||t.focusOffset!==l.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(l.node,l.offset)):(e.setEnd(l.node,l.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var t_=ri&&"documentMode"in document&&11>=document.documentMode,Mo=null,Cp=null,wl=null,kp=!1;function gy(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kp||Mo==null||Mo!==ed(r)||(r=Mo,"selectionStart"in r&&Q1(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wl&&Ll(wl,r)||(wl=r,r=ad(Cp,"onSelect"),0<r.length&&(e=new V1("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Mo)))}function _c(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Lo={animationend:_c("Animation","AnimationEnd"),animationiteration:_c("Animation","AnimationIteration"),animationstart:_c("Animation","AnimationStart"),transitionend:_c("Transition","TransitionEnd")},k0={},I3={};ri&&(I3=document.createElement("div").style,"AnimationEvent"in window||(delete Lo.animationend.animation,delete Lo.animationiteration.animation,delete Lo.animationstart.animation),"TransitionEvent"in window||delete Lo.transitionend.transition);function jd(t){if(k0[t])return k0[t];if(!Lo[t])return t;var e=Lo[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in I3)return k0[t]=e[n];return t}var j3=jd("animationend"),U3=jd("animationiteration"),z3=jd("animationstart"),B3=jd("transitionend"),G3=new Map,my="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ns(t,e){G3.set(t,e),Js(e,[t])}for(var E0=0;E0<my.length;E0++){var P0=my[E0],n_=P0.toLowerCase(),r_=P0[0].toUpperCase()+P0.slice(1);ns(n_,"on"+r_)}ns(j3,"onAnimationEnd");ns(U3,"onAnimationIteration");ns(z3,"onAnimationStart");ns("dblclick","onDoubleClick");ns("focusin","onFocus");ns("focusout","onBlur");ns(B3,"onTransitionEnd");oa("onMouseEnter",["mouseout","mouseover"]);oa("onMouseLeave",["mouseout","mouseover"]);oa("onPointerEnter",["pointerout","pointerover"]);oa("onPointerLeave",["pointerout","pointerover"]);Js("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Js("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Js("onBeforeInput",["compositionend","keypress","textInput","paste"]);Js("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Js("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Js("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),i_=new Set("cancel close invalid load scroll toggle".split(" ").concat(fl));function yy(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,nS(r,e,void 0,t),t.currentTarget=null}function H3(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var l=r.length-1;0<=l;l--){var u=r[l],d=u.instance,f=u.currentTarget;if(u=u.listener,d!==o&&i.isPropagationStopped())break e;yy(i,u,f),o=d}else for(l=0;l<r.length;l++){if(u=r[l],d=u.instance,f=u.currentTarget,u=u.listener,d!==o&&i.isPropagationStopped())break e;yy(i,u,f),o=d}}}if(nd)throw t=Sp,nd=!1,Sp=null,t}function Ye(t,e){var n=e[Tp];n===void 0&&(n=e[Tp]=new Set);var r=t+"__bubble";n.has(r)||(V3(e,t,2,!1),n.add(r))}function N0(t,e,n){var r=0;e&&(r|=4),V3(n,t,r,e)}var xc="_reactListening"+Math.random().toString(36).slice(2);function bl(t){if(!t[xc]){t[xc]=!0,$4.forEach(function(n){n!=="selectionchange"&&(i_.has(n)||N0(n,!1,t),N0(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[xc]||(e[xc]=!0,N0("selectionchange",!1,e))}}function V3(t,e,n,r){switch(N3(e)){case 1:var i=vS;break;case 4:i=SS;break;default:i=G1}n=i.bind(null,e,n,t),i=void 0,!vp||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function R0(t,e,n,r,i){var o=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var u=r.stateNode.containerInfo;if(u===i||u.nodeType===8&&u.parentNode===i)break;if(l===4)for(l=r.return;l!==null;){var d=l.tag;if((d===3||d===4)&&(d=l.stateNode.containerInfo,d===i||d.nodeType===8&&d.parentNode===i))return;l=l.return}for(;u!==null;){if(l=Ps(u),l===null)return;if(d=l.tag,d===5||d===6){r=o=l;continue e}u=u.parentNode}}r=r.return}f3(function(){var f=o,g=j1(n),v=[];e:{var S=G3.get(t);if(S!==void 0){var w=V1,y=t;switch(t){case"keypress":if(zc(n)===0)break e;case"keydown":case"keyup":w=LS;break;case"focusin":y="focus",w=x0;break;case"focusout":y="blur",w=x0;break;case"beforeblur":case"afterblur":w=x0;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":w=sy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":w=wS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":w=IS;break;case j3:case U3:case z3:w=ES;break;case B3:w=US;break;case"scroll":w=_S;break;case"wheel":w=BS;break;case"copy":case"cut":case"paste":w=NS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":w=ay}var E=(e&4)!==0,C=!E&&t==="scroll",P=E?S!==null?S+"Capture":null:S;E=[];for(var k=f,m;k!==null;){m=k;var x=m.stateNode;if(m.tag===5&&x!==null&&(m=x,P!==null&&(x=Tl(k,P),x!=null&&E.push(Dl(k,x,m)))),C)break;k=k.return}0<E.length&&(S=new w(S,y,null,n,g),v.push({event:S,listeners:E}))}}if(!(e&7)){e:{if(S=t==="mouseover"||t==="pointerover",w=t==="mouseout"||t==="pointerout",S&&n!==mp&&(y=n.relatedTarget||n.fromElement)&&(Ps(y)||y[ii]))break e;if((w||S)&&(S=g.window===g?g:(S=g.ownerDocument)?S.defaultView||S.parentWindow:window,w?(y=n.relatedTarget||n.toElement,w=f,y=y?Ps(y):null,y!==null&&(C=Zs(y),y!==C||y.tag!==5&&y.tag!==6)&&(y=null)):(w=null,y=f),w!==y)){if(E=sy,x="onMouseLeave",P="onMouseEnter",k="mouse",(t==="pointerout"||t==="pointerover")&&(E=ay,x="onPointerLeave",P="onPointerEnter",k="pointer"),C=w==null?S:bo(w),m=y==null?S:bo(y),S=new E(x,k+"leave",w,n,g),S.target=C,S.relatedTarget=m,x=null,Ps(g)===f&&(E=new E(P,k+"enter",y,n,g),E.target=m,E.relatedTarget=C,x=E),C=x,w&&y)t:{for(E=w,P=y,k=0,m=E;m;m=Eo(m))k++;for(m=0,x=P;x;x=Eo(x))m++;for(;0<k-m;)E=Eo(E),k--;for(;0<m-k;)P=Eo(P),m--;for(;k--;){if(E===P||P!==null&&E===P.alternate)break t;E=Eo(E),P=Eo(P)}E=null}else E=null;w!==null&&vy(v,S,w,E,!1),y!==null&&C!==null&&vy(v,C,y,E,!0)}}e:{if(S=f?bo(f):window,w=S.nodeName&&S.nodeName.toLowerCase(),w==="select"||w==="input"&&S.type==="file")var T=qS;else if(cy(S))if(M3)T=JS;else{T=XS;var F=YS}else(w=S.nodeName)&&w.toLowerCase()==="input"&&(S.type==="checkbox"||S.type==="radio")&&(T=$S);if(T&&(T=T(t,f))){A3(v,T,n,g);break e}F&&F(t,S,f),t==="focusout"&&(F=S._wrapperState)&&F.controlled&&S.type==="number"&&dp(S,"number",S.value)}switch(F=f?bo(f):window,t){case"focusin":(cy(F)||F.contentEditable==="true")&&(Mo=F,Cp=f,wl=null);break;case"focusout":wl=Cp=Mo=null;break;case"mousedown":kp=!0;break;case"contextmenu":case"mouseup":case"dragend":kp=!1,gy(v,n,g);break;case"selectionchange":if(t_)break;case"keydown":case"keyup":gy(v,n,g)}var L;if(K1)e:{switch(t){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else Ao?O3(t,n)&&(O="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(O="onCompositionStart");O&&(T3&&n.locale!=="ko"&&(Ao||O!=="onCompositionStart"?O==="onCompositionEnd"&&Ao&&(L=R3()):(Bi=g,H1="value"in Bi?Bi.value:Bi.textContent,Ao=!0)),F=ad(f,O),0<F.length&&(O=new oy(O,t,null,n,g),v.push({event:O,listeners:F}),L?O.data=L:(L=F3(n),L!==null&&(O.data=L)))),(L=HS?VS(t,n):WS(t,n))&&(f=ad(f,"onBeforeInput"),0<f.length&&(g=new oy("onBeforeInput","beforeinput",null,n,g),v.push({event:g,listeners:f}),g.data=L))}H3(v,e)})}function Dl(t,e,n){return{instance:t,listener:e,currentTarget:n}}function ad(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Tl(t,n),o!=null&&r.unshift(Dl(t,o,i)),o=Tl(t,e),o!=null&&r.push(Dl(t,o,i))),t=t.return}return r}function Eo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function vy(t,e,n,r,i){for(var o=e._reactName,l=[];n!==null&&n!==r;){var u=n,d=u.alternate,f=u.stateNode;if(d!==null&&d===r)break;u.tag===5&&f!==null&&(u=f,i?(d=Tl(n,o),d!=null&&l.unshift(Dl(n,d,u))):i||(d=Tl(n,o),d!=null&&l.push(Dl(n,d,u)))),n=n.return}l.length!==0&&t.push({event:e,listeners:l})}var s_=/\r\n?/g,o_=/\u0000|\uFFFD/g;function Sy(t){return(typeof t=="string"?t:""+t).replace(s_,`
`).replace(o_,"")}function wc(t,e,n){if(e=Sy(e),Sy(t)!==e&&n)throw Error(q(425))}function ld(){}var Ep=null,Pp=null;function Np(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Rp=typeof setTimeout=="function"?setTimeout:void 0,a_=typeof clearTimeout=="function"?clearTimeout:void 0,_y=typeof Promise=="function"?Promise:void 0,l_=typeof queueMicrotask=="function"?queueMicrotask:typeof _y<"u"?function(t){return _y.resolve(null).then(t).catch(u_)}:Rp;function u_(t){setTimeout(function(){throw t})}function T0(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Al(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Al(e)}function Qi(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function xy(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var _a=Math.random().toString(36).slice(2),Fr="__reactFiber$"+_a,Il="__reactProps$"+_a,ii="__reactContainer$"+_a,Tp="__reactEvents$"+_a,c_="__reactListeners$"+_a,d_="__reactHandles$"+_a;function Ps(t){var e=t[Fr];if(e)return e;for(var n=t.parentNode;n;){if(e=n[ii]||n[Fr]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=xy(t);t!==null;){if(n=t[Fr])return n;t=xy(t)}return e}t=n,n=t.parentNode}return null}function su(t){return t=t[Fr]||t[ii],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function bo(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(q(33))}function Ud(t){return t[Il]||null}var Op=[],Do=-1;function rs(t){return{current:t}}function Xe(t){0>Do||(t.current=Op[Do],Op[Do]=null,Do--)}function Ve(t,e){Do++,Op[Do]=t.current,t.current=e}var es={},Jt=rs(es),vn=rs(!1),Vs=es;function aa(t,e){var n=t.type.contextTypes;if(!n)return es;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Sn(t){return t=t.childContextTypes,t!=null}function ud(){Xe(vn),Xe(Jt)}function wy(t,e,n){if(Jt.current!==es)throw Error(q(168));Ve(Jt,e),Ve(vn,n)}function W3(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(q(108,Y7(t)||"Unknown",i));return st({},n,r)}function cd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||es,Vs=Jt.current,Ve(Jt,t),Ve(vn,vn.current),!0}function Cy(t,e,n){var r=t.stateNode;if(!r)throw Error(q(169));n?(t=W3(t,e,Vs),r.__reactInternalMemoizedMergedChildContext=t,Xe(vn),Xe(Jt),Ve(Jt,t)):Xe(vn),Ve(vn,n)}var Qr=null,zd=!1,O0=!1;function K3(t){Qr===null?Qr=[t]:Qr.push(t)}function h_(t){zd=!0,K3(t)}function is(){if(!O0&&Qr!==null){O0=!0;var t=0,e=Ie;try{var n=Qr;for(Ie=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Qr=null,zd=!1}catch(i){throw Qr!==null&&(Qr=Qr.slice(t+1)),y3(U1,is),i}finally{Ie=e,O0=!1}}return null}var Io=[],jo=0,dd=null,hd=0,Wn=[],Kn=0,Ws=null,Jr=1,Zr="";function Cs(t,e){Io[jo++]=hd,Io[jo++]=dd,dd=t,hd=e}function Q3(t,e,n){Wn[Kn++]=Jr,Wn[Kn++]=Zr,Wn[Kn++]=Ws,Ws=t;var r=Jr;t=Zr;var i=32-dr(r)-1;r&=~(1<<i),n+=1;var o=32-dr(e)+i;if(30<o){var l=i-i%5;o=(r&(1<<l)-1).toString(32),r>>=l,i-=l,Jr=1<<32-dr(e)+i|n<<i|r,Zr=o+t}else Jr=1<<o|n<<i|r,Zr=t}function q1(t){t.return!==null&&(Cs(t,1),Q3(t,1,0))}function Y1(t){for(;t===dd;)dd=Io[--jo],Io[jo]=null,hd=Io[--jo],Io[jo]=null;for(;t===Ws;)Ws=Wn[--Kn],Wn[Kn]=null,Zr=Wn[--Kn],Wn[Kn]=null,Jr=Wn[--Kn],Wn[Kn]=null}var Rn=null,Nn=null,Ze=!1,cr=null;function q3(t,e){var n=Qn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function ky(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Rn=t,Nn=Qi(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Rn=t,Nn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ws!==null?{id:Jr,overflow:Zr}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Qn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Rn=t,Nn=null,!0):!1;default:return!1}}function Fp(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Ap(t){if(Ze){var e=Nn;if(e){var n=e;if(!ky(t,e)){if(Fp(t))throw Error(q(418));e=Qi(n.nextSibling);var r=Rn;e&&ky(t,e)?q3(r,n):(t.flags=t.flags&-4097|2,Ze=!1,Rn=t)}}else{if(Fp(t))throw Error(q(418));t.flags=t.flags&-4097|2,Ze=!1,Rn=t}}}function Ey(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Rn=t}function Cc(t){if(t!==Rn)return!1;if(!Ze)return Ey(t),Ze=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Np(t.type,t.memoizedProps)),e&&(e=Nn)){if(Fp(t))throw Y3(),Error(q(418));for(;e;)q3(t,e),e=Qi(e.nextSibling)}if(Ey(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(q(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Nn=Qi(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Nn=null}}else Nn=Rn?Qi(t.stateNode.nextSibling):null;return!0}function Y3(){for(var t=Nn;t;)t=Qi(t.nextSibling)}function la(){Nn=Rn=null,Ze=!1}function X1(t){cr===null?cr=[t]:cr.push(t)}var f_=ai.ReactCurrentBatchConfig;function rl(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(q(309));var r=n.stateNode}if(!r)throw Error(q(147,t));var i=r,o=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(l){var u=i.refs;l===null?delete u[o]:u[o]=l},e._stringRef=o,e)}if(typeof t!="string")throw Error(q(284));if(!n._owner)throw Error(q(290,t))}return t}function kc(t,e){throw t=Object.prototype.toString.call(e),Error(q(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Py(t){var e=t._init;return e(t._payload)}function X3(t){function e(P,k){if(t){var m=P.deletions;m===null?(P.deletions=[k],P.flags|=16):m.push(k)}}function n(P,k){if(!t)return null;for(;k!==null;)e(P,k),k=k.sibling;return null}function r(P,k){for(P=new Map;k!==null;)k.key!==null?P.set(k.key,k):P.set(k.index,k),k=k.sibling;return P}function i(P,k){return P=$i(P,k),P.index=0,P.sibling=null,P}function o(P,k,m){return P.index=m,t?(m=P.alternate,m!==null?(m=m.index,m<k?(P.flags|=2,k):m):(P.flags|=2,k)):(P.flags|=1048576,k)}function l(P){return t&&P.alternate===null&&(P.flags|=2),P}function u(P,k,m,x){return k===null||k.tag!==6?(k=I0(m,P.mode,x),k.return=P,k):(k=i(k,m),k.return=P,k)}function d(P,k,m,x){var T=m.type;return T===Fo?g(P,k,m.props.children,x,m.key):k!==null&&(k.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Ri&&Py(T)===k.type)?(x=i(k,m.props),x.ref=rl(P,k,m),x.return=P,x):(x=Qc(m.type,m.key,m.props,null,P.mode,x),x.ref=rl(P,k,m),x.return=P,x)}function f(P,k,m,x){return k===null||k.tag!==4||k.stateNode.containerInfo!==m.containerInfo||k.stateNode.implementation!==m.implementation?(k=j0(m,P.mode,x),k.return=P,k):(k=i(k,m.children||[]),k.return=P,k)}function g(P,k,m,x,T){return k===null||k.tag!==7?(k=Bs(m,P.mode,x,T),k.return=P,k):(k=i(k,m),k.return=P,k)}function v(P,k,m){if(typeof k=="string"&&k!==""||typeof k=="number")return k=I0(""+k,P.mode,m),k.return=P,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case fc:return m=Qc(k.type,k.key,k.props,null,P.mode,m),m.ref=rl(P,null,k),m.return=P,m;case Oo:return k=j0(k,P.mode,m),k.return=P,k;case Ri:var x=k._init;return v(P,x(k._payload),m)}if(dl(k)||Ja(k))return k=Bs(k,P.mode,m,null),k.return=P,k;kc(P,k)}return null}function S(P,k,m,x){var T=k!==null?k.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return T!==null?null:u(P,k,""+m,x);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case fc:return m.key===T?d(P,k,m,x):null;case Oo:return m.key===T?f(P,k,m,x):null;case Ri:return T=m._init,S(P,k,T(m._payload),x)}if(dl(m)||Ja(m))return T!==null?null:g(P,k,m,x,null);kc(P,m)}return null}function w(P,k,m,x,T){if(typeof x=="string"&&x!==""||typeof x=="number")return P=P.get(m)||null,u(k,P,""+x,T);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case fc:return P=P.get(x.key===null?m:x.key)||null,d(k,P,x,T);case Oo:return P=P.get(x.key===null?m:x.key)||null,f(k,P,x,T);case Ri:var F=x._init;return w(P,k,m,F(x._payload),T)}if(dl(x)||Ja(x))return P=P.get(m)||null,g(k,P,x,T,null);kc(k,x)}return null}function y(P,k,m,x){for(var T=null,F=null,L=k,O=k=0,j=null;L!==null&&O<m.length;O++){L.index>O?(j=L,L=null):j=L.sibling;var M=S(P,L,m[O],x);if(M===null){L===null&&(L=j);break}t&&L&&M.alternate===null&&e(P,L),k=o(M,k,O),F===null?T=M:F.sibling=M,F=M,L=j}if(O===m.length)return n(P,L),Ze&&Cs(P,O),T;if(L===null){for(;O<m.length;O++)L=v(P,m[O],x),L!==null&&(k=o(L,k,O),F===null?T=L:F.sibling=L,F=L);return Ze&&Cs(P,O),T}for(L=r(P,L);O<m.length;O++)j=w(L,P,O,m[O],x),j!==null&&(t&&j.alternate!==null&&L.delete(j.key===null?O:j.key),k=o(j,k,O),F===null?T=j:F.sibling=j,F=j);return t&&L.forEach(function(G){return e(P,G)}),Ze&&Cs(P,O),T}function E(P,k,m,x){var T=Ja(m);if(typeof T!="function")throw Error(q(150));if(m=T.call(m),m==null)throw Error(q(151));for(var F=T=null,L=k,O=k=0,j=null,M=m.next();L!==null&&!M.done;O++,M=m.next()){L.index>O?(j=L,L=null):j=L.sibling;var G=S(P,L,M.value,x);if(G===null){L===null&&(L=j);break}t&&L&&G.alternate===null&&e(P,L),k=o(G,k,O),F===null?T=G:F.sibling=G,F=G,L=j}if(M.done)return n(P,L),Ze&&Cs(P,O),T;if(L===null){for(;!M.done;O++,M=m.next())M=v(P,M.value,x),M!==null&&(k=o(M,k,O),F===null?T=M:F.sibling=M,F=M);return Ze&&Cs(P,O),T}for(L=r(P,L);!M.done;O++,M=m.next())M=w(L,P,O,M.value,x),M!==null&&(t&&M.alternate!==null&&L.delete(M.key===null?O:M.key),k=o(M,k,O),F===null?T=M:F.sibling=M,F=M);return t&&L.forEach(function(K){return e(P,K)}),Ze&&Cs(P,O),T}function C(P,k,m,x){if(typeof m=="object"&&m!==null&&m.type===Fo&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case fc:e:{for(var T=m.key,F=k;F!==null;){if(F.key===T){if(T=m.type,T===Fo){if(F.tag===7){n(P,F.sibling),k=i(F,m.props.children),k.return=P,P=k;break e}}else if(F.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Ri&&Py(T)===F.type){n(P,F.sibling),k=i(F,m.props),k.ref=rl(P,F,m),k.return=P,P=k;break e}n(P,F);break}else e(P,F);F=F.sibling}m.type===Fo?(k=Bs(m.props.children,P.mode,x,m.key),k.return=P,P=k):(x=Qc(m.type,m.key,m.props,null,P.mode,x),x.ref=rl(P,k,m),x.return=P,P=x)}return l(P);case Oo:e:{for(F=m.key;k!==null;){if(k.key===F)if(k.tag===4&&k.stateNode.containerInfo===m.containerInfo&&k.stateNode.implementation===m.implementation){n(P,k.sibling),k=i(k,m.children||[]),k.return=P,P=k;break e}else{n(P,k);break}else e(P,k);k=k.sibling}k=j0(m,P.mode,x),k.return=P,P=k}return l(P);case Ri:return F=m._init,C(P,k,F(m._payload),x)}if(dl(m))return y(P,k,m,x);if(Ja(m))return E(P,k,m,x);kc(P,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,k!==null&&k.tag===6?(n(P,k.sibling),k=i(k,m),k.return=P,P=k):(n(P,k),k=I0(m,P.mode,x),k.return=P,P=k),l(P)):n(P,k)}return C}var ua=X3(!0),$3=X3(!1),fd=rs(null),pd=null,Uo=null,$1=null;function J1(){$1=Uo=pd=null}function Z1(t){var e=fd.current;Xe(fd),t._currentValue=e}function Mp(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ko(t,e){pd=t,$1=Uo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(yn=!0),t.firstContext=null)}function Yn(t){var e=t._currentValue;if($1!==t)if(t={context:t,memoizedValue:e,next:null},Uo===null){if(pd===null)throw Error(q(308));Uo=t,pd.dependencies={lanes:0,firstContext:t}}else Uo=Uo.next=t;return e}var Ns=null;function eg(t){Ns===null?Ns=[t]:Ns.push(t)}function J3(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,eg(e)):(n.next=i.next,i.next=n),e.interleaved=n,si(t,r)}function si(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Ti=!1;function tg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Z3(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ei(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function qi(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Oe&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,si(t,n)}return i=r.interleaved,i===null?(e.next=e,eg(r)):(e.next=i.next,i.next=e),r.interleaved=e,si(t,n)}function Bc(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,z1(t,n)}}function Ny(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function gd(t,e,n,r){var i=t.updateQueue;Ti=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,u=i.shared.pending;if(u!==null){i.shared.pending=null;var d=u,f=d.next;d.next=null,l===null?o=f:l.next=f,l=d;var g=t.alternate;g!==null&&(g=g.updateQueue,u=g.lastBaseUpdate,u!==l&&(u===null?g.firstBaseUpdate=f:u.next=f,g.lastBaseUpdate=d))}if(o!==null){var v=i.baseState;l=0,g=f=d=null,u=o;do{var S=u.lane,w=u.eventTime;if((r&S)===S){g!==null&&(g=g.next={eventTime:w,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var y=t,E=u;switch(S=e,w=n,E.tag){case 1:if(y=E.payload,typeof y=="function"){v=y.call(w,v,S);break e}v=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=E.payload,S=typeof y=="function"?y.call(w,v,S):y,S==null)break e;v=st({},v,S);break e;case 2:Ti=!0}}u.callback!==null&&u.lane!==0&&(t.flags|=64,S=i.effects,S===null?i.effects=[u]:S.push(u))}else w={eventTime:w,lane:S,tag:u.tag,payload:u.payload,callback:u.callback,next:null},g===null?(f=g=w,d=v):g=g.next=w,l|=S;if(u=u.next,u===null){if(u=i.shared.pending,u===null)break;S=u,u=S.next,S.next=null,i.lastBaseUpdate=S,i.shared.pending=null}}while(!0);if(g===null&&(d=v),i.baseState=d,i.firstBaseUpdate=f,i.lastBaseUpdate=g,e=i.shared.interleaved,e!==null){i=e;do l|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Qs|=l,t.lanes=l,t.memoizedState=v}}function Ry(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(q(191,i));i.call(r)}}}var ou={},Lr=rs(ou),jl=rs(ou),Ul=rs(ou);function Rs(t){if(t===ou)throw Error(q(174));return t}function ng(t,e){switch(Ve(Ul,e),Ve(jl,t),Ve(Lr,ou),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:fp(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=fp(e,t)}Xe(Lr),Ve(Lr,e)}function ca(){Xe(Lr),Xe(jl),Xe(Ul)}function e5(t){Rs(Ul.current);var e=Rs(Lr.current),n=fp(e,t.type);e!==n&&(Ve(jl,t),Ve(Lr,n))}function rg(t){jl.current===t&&(Xe(Lr),Xe(jl))}var rt=rs(0);function md(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var F0=[];function ig(){for(var t=0;t<F0.length;t++)F0[t]._workInProgressVersionPrimary=null;F0.length=0}var Gc=ai.ReactCurrentDispatcher,A0=ai.ReactCurrentBatchConfig,Ks=0,it=null,Ct=null,Lt=null,yd=!1,Cl=!1,zl=0,p_=0;function Qt(){throw Error(q(321))}function sg(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!pr(t[n],e[n]))return!1;return!0}function og(t,e,n,r,i,o){if(Ks=o,it=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Gc.current=t===null||t.memoizedState===null?v_:S_,t=n(r,i),Cl){o=0;do{if(Cl=!1,zl=0,25<=o)throw Error(q(301));o+=1,Lt=Ct=null,e.updateQueue=null,Gc.current=__,t=n(r,i)}while(Cl)}if(Gc.current=vd,e=Ct!==null&&Ct.next!==null,Ks=0,Lt=Ct=it=null,yd=!1,e)throw Error(q(300));return t}function ag(){var t=zl!==0;return zl=0,t}function Nr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?it.memoizedState=Lt=t:Lt=Lt.next=t,Lt}function Xn(){if(Ct===null){var t=it.alternate;t=t!==null?t.memoizedState:null}else t=Ct.next;var e=Lt===null?it.memoizedState:Lt.next;if(e!==null)Lt=e,Ct=t;else{if(t===null)throw Error(q(310));Ct=t,t={memoizedState:Ct.memoizedState,baseState:Ct.baseState,baseQueue:Ct.baseQueue,queue:Ct.queue,next:null},Lt===null?it.memoizedState=Lt=t:Lt=Lt.next=t}return Lt}function Bl(t,e){return typeof e=="function"?e(t):e}function M0(t){var e=Xn(),n=e.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=t;var r=Ct,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var l=i.next;i.next=o.next,o.next=l}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var u=l=null,d=null,f=o;do{var g=f.lane;if((Ks&g)===g)d!==null&&(d=d.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),r=f.hasEagerState?f.eagerState:t(r,f.action);else{var v={lane:g,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};d===null?(u=d=v,l=r):d=d.next=v,it.lanes|=g,Qs|=g}f=f.next}while(f!==null&&f!==o);d===null?l=r:d.next=u,pr(r,e.memoizedState)||(yn=!0),e.memoizedState=r,e.baseState=l,e.baseQueue=d,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do o=i.lane,it.lanes|=o,Qs|=o,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function L0(t){var e=Xn(),n=e.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var l=i=i.next;do o=t(o,l.action),l=l.next;while(l!==i);pr(o,e.memoizedState)||(yn=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function t5(){}function n5(t,e){var n=it,r=Xn(),i=e(),o=!pr(r.memoizedState,i);if(o&&(r.memoizedState=i,yn=!0),r=r.queue,lg(s5.bind(null,n,r,t),[t]),r.getSnapshot!==e||o||Lt!==null&&Lt.memoizedState.tag&1){if(n.flags|=2048,Gl(9,i5.bind(null,n,r,i,e),void 0,null),bt===null)throw Error(q(349));Ks&30||r5(n,e,i)}return i}function r5(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=it.updateQueue,e===null?(e={lastEffect:null,stores:null},it.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function i5(t,e,n,r){e.value=n,e.getSnapshot=r,o5(e)&&a5(t)}function s5(t,e,n){return n(function(){o5(e)&&a5(t)})}function o5(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!pr(t,n)}catch{return!0}}function a5(t){var e=si(t,1);e!==null&&hr(e,t,1,-1)}function Ty(t){var e=Nr();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bl,lastRenderedState:t},e.queue=t,t=t.dispatch=y_.bind(null,it,t),[e.memoizedState,t]}function Gl(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=it.updateQueue,e===null?(e={lastEffect:null,stores:null},it.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function l5(){return Xn().memoizedState}function Hc(t,e,n,r){var i=Nr();it.flags|=t,i.memoizedState=Gl(1|e,n,void 0,r===void 0?null:r)}function Bd(t,e,n,r){var i=Xn();r=r===void 0?null:r;var o=void 0;if(Ct!==null){var l=Ct.memoizedState;if(o=l.destroy,r!==null&&sg(r,l.deps)){i.memoizedState=Gl(e,n,o,r);return}}it.flags|=t,i.memoizedState=Gl(1|e,n,o,r)}function Oy(t,e){return Hc(8390656,8,t,e)}function lg(t,e){return Bd(2048,8,t,e)}function u5(t,e){return Bd(4,2,t,e)}function c5(t,e){return Bd(4,4,t,e)}function d5(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function h5(t,e,n){return n=n!=null?n.concat([t]):null,Bd(4,4,d5.bind(null,e,t),n)}function ug(){}function f5(t,e){var n=Xn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&sg(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function p5(t,e){var n=Xn();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&sg(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function g5(t,e,n){return Ks&21?(pr(n,e)||(n=_3(),it.lanes|=n,Qs|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,yn=!0),t.memoizedState=n)}function g_(t,e){var n=Ie;Ie=n!==0&&4>n?n:4,t(!0);var r=A0.transition;A0.transition={};try{t(!1),e()}finally{Ie=n,A0.transition=r}}function m5(){return Xn().memoizedState}function m_(t,e,n){var r=Xi(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},y5(t))v5(e,n);else if(n=J3(t,e,n,r),n!==null){var i=sn();hr(n,t,r,i),S5(n,e,r)}}function y_(t,e,n){var r=Xi(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(y5(t))v5(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var l=e.lastRenderedState,u=o(l,n);if(i.hasEagerState=!0,i.eagerState=u,pr(u,l)){var d=e.interleaved;d===null?(i.next=i,eg(e)):(i.next=d.next,d.next=i),e.interleaved=i;return}}catch{}finally{}n=J3(t,e,i,r),n!==null&&(i=sn(),hr(n,t,r,i),S5(n,e,r))}}function y5(t){var e=t.alternate;return t===it||e!==null&&e===it}function v5(t,e){Cl=yd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function S5(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,z1(t,n)}}var vd={readContext:Yn,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useInsertionEffect:Qt,useLayoutEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useMutableSource:Qt,useSyncExternalStore:Qt,useId:Qt,unstable_isNewReconciler:!1},v_={readContext:Yn,useCallback:function(t,e){return Nr().memoizedState=[t,e===void 0?null:e],t},useContext:Yn,useEffect:Oy,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Hc(4194308,4,d5.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Hc(4194308,4,t,e)},useInsertionEffect:function(t,e){return Hc(4,2,t,e)},useMemo:function(t,e){var n=Nr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Nr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=m_.bind(null,it,t),[r.memoizedState,t]},useRef:function(t){var e=Nr();return t={current:t},e.memoizedState=t},useState:Ty,useDebugValue:ug,useDeferredValue:function(t){return Nr().memoizedState=t},useTransition:function(){var t=Ty(!1),e=t[0];return t=g_.bind(null,t[1]),Nr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=it,i=Nr();if(Ze){if(n===void 0)throw Error(q(407));n=n()}else{if(n=e(),bt===null)throw Error(q(349));Ks&30||r5(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Oy(s5.bind(null,r,o,t),[t]),r.flags|=2048,Gl(9,i5.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Nr(),e=bt.identifierPrefix;if(Ze){var n=Zr,r=Jr;n=(r&~(1<<32-dr(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=zl++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=p_++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},S_={readContext:Yn,useCallback:f5,useContext:Yn,useEffect:lg,useImperativeHandle:h5,useInsertionEffect:u5,useLayoutEffect:c5,useMemo:p5,useReducer:M0,useRef:l5,useState:function(){return M0(Bl)},useDebugValue:ug,useDeferredValue:function(t){var e=Xn();return g5(e,Ct.memoizedState,t)},useTransition:function(){var t=M0(Bl)[0],e=Xn().memoizedState;return[t,e]},useMutableSource:t5,useSyncExternalStore:n5,useId:m5,unstable_isNewReconciler:!1},__={readContext:Yn,useCallback:f5,useContext:Yn,useEffect:lg,useImperativeHandle:h5,useInsertionEffect:u5,useLayoutEffect:c5,useMemo:p5,useReducer:L0,useRef:l5,useState:function(){return L0(Bl)},useDebugValue:ug,useDeferredValue:function(t){var e=Xn();return Ct===null?e.memoizedState=t:g5(e,Ct.memoizedState,t)},useTransition:function(){var t=L0(Bl)[0],e=Xn().memoizedState;return[t,e]},useMutableSource:t5,useSyncExternalStore:n5,useId:m5,unstable_isNewReconciler:!1};function ar(t,e){if(t&&t.defaultProps){e=st({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Lp(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:st({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Gd={isMounted:function(t){return(t=t._reactInternals)?Zs(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=sn(),i=Xi(t),o=ei(r,i);o.payload=e,n!=null&&(o.callback=n),e=qi(t,o,i),e!==null&&(hr(e,t,i,r),Bc(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=sn(),i=Xi(t),o=ei(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=qi(t,o,i),e!==null&&(hr(e,t,i,r),Bc(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=sn(),r=Xi(t),i=ei(n,r);i.tag=2,e!=null&&(i.callback=e),e=qi(t,i,r),e!==null&&(hr(e,t,r,n),Bc(e,t,r))}};function Fy(t,e,n,r,i,o,l){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,l):e.prototype&&e.prototype.isPureReactComponent?!Ll(n,r)||!Ll(i,o):!0}function _5(t,e,n){var r=!1,i=es,o=e.contextType;return typeof o=="object"&&o!==null?o=Yn(o):(i=Sn(e)?Vs:Jt.current,r=e.contextTypes,o=(r=r!=null)?aa(t,i):es),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Gd,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function Ay(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Gd.enqueueReplaceState(e,e.state,null)}function bp(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},tg(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=Yn(o):(o=Sn(e)?Vs:Jt.current,i.context=aa(t,o)),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(Lp(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Gd.enqueueReplaceState(i,i.state,null),gd(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function da(t,e){try{var n="",r=e;do n+=q7(r),r=r.return;while(r);var i=n}catch(o){i=`
Error generating stack: `+o.message+`
`+o.stack}return{value:t,source:e,stack:i,digest:null}}function b0(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Dp(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var x_=typeof WeakMap=="function"?WeakMap:Map;function x5(t,e,n){n=ei(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){_d||(_d=!0,Kp=r),Dp(t,e)},n}function w5(t,e,n){n=ei(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Dp(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Dp(t,e),typeof r!="function"&&(Yi===null?Yi=new Set([this]):Yi.add(this));var l=e.stack;this.componentDidCatch(e.value,{componentStack:l!==null?l:""})}),n}function My(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new x_;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=b_.bind(null,t,e,n),e.then(t,t))}function Ly(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function by(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=ei(-1,1),e.tag=2,qi(n,e,1))),n.lanes|=1),t)}var w_=ai.ReactCurrentOwner,yn=!1;function nn(t,e,n,r){e.child=t===null?$3(e,null,n,r):ua(e,t.child,n,r)}function Dy(t,e,n,r,i){n=n.render;var o=e.ref;return Ko(e,i),r=og(t,e,n,r,o,i),n=ag(),t!==null&&!yn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,oi(t,e,i)):(Ze&&n&&q1(e),e.flags|=1,nn(t,e,r,i),e.child)}function Iy(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!yg(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,C5(t,e,o,r,i)):(t=Qc(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!(t.lanes&i)){var l=o.memoizedProps;if(n=n.compare,n=n!==null?n:Ll,n(l,r)&&t.ref===e.ref)return oi(t,e,i)}return e.flags|=1,t=$i(o,r),t.ref=e.ref,t.return=e,e.child=t}function C5(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(Ll(o,r)&&t.ref===e.ref)if(yn=!1,e.pendingProps=r=o,(t.lanes&i)!==0)t.flags&131072&&(yn=!0);else return e.lanes=t.lanes,oi(t,e,i)}return Ip(t,e,n,r,i)}function k5(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ve(Bo,En),En|=n;else{if(!(n&1073741824))return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Ve(Bo,En),En|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Ve(Bo,En),En|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,Ve(Bo,En),En|=r;return nn(t,e,i,n),e.child}function E5(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Ip(t,e,n,r,i){var o=Sn(n)?Vs:Jt.current;return o=aa(e,o),Ko(e,i),n=og(t,e,n,r,o,i),r=ag(),t!==null&&!yn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,oi(t,e,i)):(Ze&&r&&q1(e),e.flags|=1,nn(t,e,n,i),e.child)}function jy(t,e,n,r,i){if(Sn(n)){var o=!0;cd(e)}else o=!1;if(Ko(e,i),e.stateNode===null)Vc(t,e),_5(e,n,r),bp(e,n,r,i),r=!0;else if(t===null){var l=e.stateNode,u=e.memoizedProps;l.props=u;var d=l.context,f=n.contextType;typeof f=="object"&&f!==null?f=Yn(f):(f=Sn(n)?Vs:Jt.current,f=aa(e,f));var g=n.getDerivedStateFromProps,v=typeof g=="function"||typeof l.getSnapshotBeforeUpdate=="function";v||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(u!==r||d!==f)&&Ay(e,l,r,f),Ti=!1;var S=e.memoizedState;l.state=S,gd(e,r,l,i),d=e.memoizedState,u!==r||S!==d||vn.current||Ti?(typeof g=="function"&&(Lp(e,n,g,r),d=e.memoizedState),(u=Ti||Fy(e,n,u,r,S,d,f))?(v||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(e.flags|=4194308)):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=d),l.props=r,l.state=d,l.context=f,r=u):(typeof l.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{l=e.stateNode,Z3(t,e),u=e.memoizedProps,f=e.type===e.elementType?u:ar(e.type,u),l.props=f,v=e.pendingProps,S=l.context,d=n.contextType,typeof d=="object"&&d!==null?d=Yn(d):(d=Sn(n)?Vs:Jt.current,d=aa(e,d));var w=n.getDerivedStateFromProps;(g=typeof w=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(u!==v||S!==d)&&Ay(e,l,r,d),Ti=!1,S=e.memoizedState,l.state=S,gd(e,r,l,i);var y=e.memoizedState;u!==v||S!==y||vn.current||Ti?(typeof w=="function"&&(Lp(e,n,w,r),y=e.memoizedState),(f=Ti||Fy(e,n,f,r,S,y,d)||!1)?(g||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,y,d),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,y,d)),typeof l.componentDidUpdate=="function"&&(e.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof l.componentDidUpdate!="function"||u===t.memoizedProps&&S===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||u===t.memoizedProps&&S===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=y),l.props=r,l.state=y,l.context=d,r=f):(typeof l.componentDidUpdate!="function"||u===t.memoizedProps&&S===t.memoizedState||(e.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||u===t.memoizedProps&&S===t.memoizedState||(e.flags|=1024),r=!1)}return jp(t,e,n,r,o,i)}function jp(t,e,n,r,i,o){E5(t,e);var l=(e.flags&128)!==0;if(!r&&!l)return i&&Cy(e,n,!1),oi(t,e,o);r=e.stateNode,w_.current=e;var u=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&l?(e.child=ua(e,t.child,null,o),e.child=ua(e,null,u,o)):nn(t,e,u,o),e.memoizedState=r.state,i&&Cy(e,n,!0),e.child}function P5(t){var e=t.stateNode;e.pendingContext?wy(t,e.pendingContext,e.pendingContext!==e.context):e.context&&wy(t,e.context,!1),ng(t,e.containerInfo)}function Uy(t,e,n,r,i){return la(),X1(i),e.flags|=256,nn(t,e,n,r),e.child}var Up={dehydrated:null,treeContext:null,retryLane:0};function zp(t){return{baseLanes:t,cachePool:null,transitions:null}}function N5(t,e,n){var r=e.pendingProps,i=rt.current,o=!1,l=(e.flags&128)!==0,u;if((u=l)||(u=t!==null&&t.memoizedState===null?!1:(i&2)!==0),u?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),Ve(rt,i&1),t===null)return Ap(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(l=r.children,t=r.fallback,o?(r=e.mode,o=e.child,l={mode:"hidden",children:l},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=l):o=Wd(l,r,0,null),t=Bs(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=zp(n),e.memoizedState=Up,t):cg(e,l));if(i=t.memoizedState,i!==null&&(u=i.dehydrated,u!==null))return C_(t,e,l,r,u,i,n);if(o){o=r.fallback,l=e.mode,i=t.child,u=i.sibling;var d={mode:"hidden",children:r.children};return!(l&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=d,e.deletions=null):(r=$i(i,d),r.subtreeFlags=i.subtreeFlags&14680064),u!==null?o=$i(u,o):(o=Bs(o,l,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,l=t.child.memoizedState,l=l===null?zp(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=t.childLanes&~n,e.memoizedState=Up,r}return o=t.child,t=o.sibling,r=$i(o,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function cg(t,e){return e=Wd({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ec(t,e,n,r){return r!==null&&X1(r),ua(e,t.child,null,n),t=cg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function C_(t,e,n,r,i,o,l){if(n)return e.flags&256?(e.flags&=-257,r=b0(Error(q(422))),Ec(t,e,l,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=Wd({mode:"visible",children:r.children},i,0,null),o=Bs(o,i,l,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,e.mode&1&&ua(e,t.child,null,l),e.child.memoizedState=zp(l),e.memoizedState=Up,o);if(!(e.mode&1))return Ec(t,e,l,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var u=r.dgst;return r=u,o=Error(q(419)),r=b0(o,r,void 0),Ec(t,e,l,r)}if(u=(l&t.childLanes)!==0,yn||u){if(r=bt,r!==null){switch(l&-l){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|l)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,si(t,i),hr(r,t,i,-1))}return mg(),r=b0(Error(q(421))),Ec(t,e,l,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=D_.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Nn=Qi(i.nextSibling),Rn=e,Ze=!0,cr=null,t!==null&&(Wn[Kn++]=Jr,Wn[Kn++]=Zr,Wn[Kn++]=Ws,Jr=t.id,Zr=t.overflow,Ws=e),e=cg(e,r.children),e.flags|=4096,e)}function zy(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Mp(t.return,e,n)}function D0(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function R5(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(nn(t,e,r.children,n),r=rt.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&zy(t,n,e);else if(t.tag===19)zy(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(Ve(rt,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&md(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),D0(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&md(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}D0(e,!0,n,null,o);break;case"together":D0(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Vc(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function oi(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Qs|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(q(153));if(e.child!==null){for(t=e.child,n=$i(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=$i(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function k_(t,e,n){switch(e.tag){case 3:P5(e),la();break;case 5:e5(e);break;case 1:Sn(e.type)&&cd(e);break;case 4:ng(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;Ve(fd,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(Ve(rt,rt.current&1),e.flags|=128,null):n&e.child.childLanes?N5(t,e,n):(Ve(rt,rt.current&1),t=oi(t,e,n),t!==null?t.sibling:null);Ve(rt,rt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return R5(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ve(rt,rt.current),r)break;return null;case 22:case 23:return e.lanes=0,k5(t,e,n)}return oi(t,e,n)}var T5,Bp,O5,F5;T5=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Bp=function(){};O5=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Rs(Lr.current);var o=null;switch(n){case"input":i=up(t,i),r=up(t,r),o=[];break;case"select":i=st({},i,{value:void 0}),r=st({},r,{value:void 0}),o=[];break;case"textarea":i=hp(t,i),r=hp(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=ld)}pp(n,r);var l;n=null;for(f in i)if(!r.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var u=i[f];for(l in u)u.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Nl.hasOwnProperty(f)?o||(o=[]):(o=o||[]).push(f,null));for(f in r){var d=r[f];if(u=i!=null?i[f]:void 0,r.hasOwnProperty(f)&&d!==u&&(d!=null||u!=null))if(f==="style")if(u){for(l in u)!u.hasOwnProperty(l)||d&&d.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in d)d.hasOwnProperty(l)&&u[l]!==d[l]&&(n||(n={}),n[l]=d[l])}else n||(o||(o=[]),o.push(f,n)),n=d;else f==="dangerouslySetInnerHTML"?(d=d?d.__html:void 0,u=u?u.__html:void 0,d!=null&&u!==d&&(o=o||[]).push(f,d)):f==="children"?typeof d!="string"&&typeof d!="number"||(o=o||[]).push(f,""+d):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Nl.hasOwnProperty(f)?(d!=null&&f==="onScroll"&&Ye("scroll",t),o||u===d||(o=[])):(o=o||[]).push(f,d))}n&&(o=o||[]).push("style",n);var f=o;(e.updateQueue=f)&&(e.flags|=4)}};F5=function(t,e,n,r){n!==r&&(e.flags|=4)};function il(t,e){if(!Ze)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function qt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function E_(t,e,n){var r=e.pendingProps;switch(Y1(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(e),null;case 1:return Sn(e.type)&&ud(),qt(e),null;case 3:return r=e.stateNode,ca(),Xe(vn),Xe(Jt),ig(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Cc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,cr!==null&&(Yp(cr),cr=null))),Bp(t,e),qt(e),null;case 5:rg(e);var i=Rs(Ul.current);if(n=e.type,t!==null&&e.stateNode!=null)O5(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(q(166));return qt(e),null}if(t=Rs(Lr.current),Cc(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[Fr]=e,r[Il]=o,t=(e.mode&1)!==0,n){case"dialog":Ye("cancel",r),Ye("close",r);break;case"iframe":case"object":case"embed":Ye("load",r);break;case"video":case"audio":for(i=0;i<fl.length;i++)Ye(fl[i],r);break;case"source":Ye("error",r);break;case"img":case"image":case"link":Ye("error",r),Ye("load",r);break;case"details":Ye("toggle",r);break;case"input":Y2(r,o),Ye("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Ye("invalid",r);break;case"textarea":$2(r,o),Ye("invalid",r)}pp(n,o),i=null;for(var l in o)if(o.hasOwnProperty(l)){var u=o[l];l==="children"?typeof u=="string"?r.textContent!==u&&(o.suppressHydrationWarning!==!0&&wc(r.textContent,u,t),i=["children",u]):typeof u=="number"&&r.textContent!==""+u&&(o.suppressHydrationWarning!==!0&&wc(r.textContent,u,t),i=["children",""+u]):Nl.hasOwnProperty(l)&&u!=null&&l==="onScroll"&&Ye("scroll",r)}switch(n){case"input":pc(r),X2(r,o,!0);break;case"textarea":pc(r),J2(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ld)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=s3(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=l.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=l.createElement(n,{is:r.is}):(t=l.createElement(n),n==="select"&&(l=t,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):t=l.createElementNS(t,n),t[Fr]=e,t[Il]=r,T5(t,e,!1,!1),e.stateNode=t;e:{switch(l=gp(n,r),n){case"dialog":Ye("cancel",t),Ye("close",t),i=r;break;case"iframe":case"object":case"embed":Ye("load",t),i=r;break;case"video":case"audio":for(i=0;i<fl.length;i++)Ye(fl[i],t);i=r;break;case"source":Ye("error",t),i=r;break;case"img":case"image":case"link":Ye("error",t),Ye("load",t),i=r;break;case"details":Ye("toggle",t),i=r;break;case"input":Y2(t,r),i=up(t,r),Ye("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=st({},r,{value:void 0}),Ye("invalid",t);break;case"textarea":$2(t,r),i=hp(t,r),Ye("invalid",t);break;default:i=r}pp(n,i),u=i;for(o in u)if(u.hasOwnProperty(o)){var d=u[o];o==="style"?l3(t,d):o==="dangerouslySetInnerHTML"?(d=d?d.__html:void 0,d!=null&&o3(t,d)):o==="children"?typeof d=="string"?(n!=="textarea"||d!=="")&&Rl(t,d):typeof d=="number"&&Rl(t,""+d):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Nl.hasOwnProperty(o)?d!=null&&o==="onScroll"&&Ye("scroll",t):d!=null&&L1(t,o,d,l))}switch(n){case"input":pc(t),X2(t,r,!1);break;case"textarea":pc(t),J2(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Zi(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?Go(t,!!r.multiple,o,!1):r.defaultValue!=null&&Go(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=ld)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return qt(e),null;case 6:if(t&&e.stateNode!=null)F5(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(q(166));if(n=Rs(Ul.current),Rs(Lr.current),Cc(e)){if(r=e.stateNode,n=e.memoizedProps,r[Fr]=e,(o=r.nodeValue!==n)&&(t=Rn,t!==null))switch(t.tag){case 3:wc(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&wc(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Fr]=e,e.stateNode=r}return qt(e),null;case 13:if(Xe(rt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Ze&&Nn!==null&&e.mode&1&&!(e.flags&128))Y3(),la(),e.flags|=98560,o=!1;else if(o=Cc(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(q(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(q(317));o[Fr]=e}else la(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;qt(e),o=!1}else cr!==null&&(Yp(cr),cr=null),o=!0;if(!o)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||rt.current&1?Et===0&&(Et=3):mg())),e.updateQueue!==null&&(e.flags|=4),qt(e),null);case 4:return ca(),Bp(t,e),t===null&&bl(e.stateNode.containerInfo),qt(e),null;case 10:return Z1(e.type._context),qt(e),null;case 17:return Sn(e.type)&&ud(),qt(e),null;case 19:if(Xe(rt),o=e.memoizedState,o===null)return qt(e),null;if(r=(e.flags&128)!==0,l=o.rendering,l===null)if(r)il(o,!1);else{if(Et!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(l=md(t),l!==null){for(e.flags|=128,il(o,!1),r=l.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,l=o.alternate,l===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,t=l.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Ve(rt,rt.current&1|2),e.child}t=t.sibling}o.tail!==null&&ft()>ha&&(e.flags|=128,r=!0,il(o,!1),e.lanes=4194304)}else{if(!r)if(t=md(l),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),il(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Ze)return qt(e),null}else 2*ft()-o.renderingStartTime>ha&&n!==1073741824&&(e.flags|=128,r=!0,il(o,!1),e.lanes=4194304);o.isBackwards?(l.sibling=e.child,e.child=l):(n=o.last,n!==null?n.sibling=l:e.child=l,o.last=l)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=ft(),e.sibling=null,n=rt.current,Ve(rt,r?n&1|2:n&1),e):(qt(e),null);case 22:case 23:return gg(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?En&1073741824&&(qt(e),e.subtreeFlags&6&&(e.flags|=8192)):qt(e),null;case 24:return null;case 25:return null}throw Error(q(156,e.tag))}function P_(t,e){switch(Y1(e),e.tag){case 1:return Sn(e.type)&&ud(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ca(),Xe(vn),Xe(Jt),ig(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return rg(e),null;case 13:if(Xe(rt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(q(340));la()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Xe(rt),null;case 4:return ca(),null;case 10:return Z1(e.type._context),null;case 22:case 23:return gg(),null;case 24:return null;default:return null}}var Pc=!1,Xt=!1,N_=typeof WeakSet=="function"?WeakSet:Set,oe=null;function zo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ut(t,e,r)}else n.current=null}function Gp(t,e,n){try{n()}catch(r){ut(t,e,r)}}var By=!1;function R_(t,e){if(Ep=sd,t=D3(),Q1(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,u=-1,d=-1,f=0,g=0,v=t,S=null;t:for(;;){for(var w;v!==n||i!==0&&v.nodeType!==3||(u=l+i),v!==o||r!==0&&v.nodeType!==3||(d=l+r),v.nodeType===3&&(l+=v.nodeValue.length),(w=v.firstChild)!==null;)S=v,v=w;for(;;){if(v===t)break t;if(S===n&&++f===i&&(u=l),S===o&&++g===r&&(d=l),(w=v.nextSibling)!==null)break;v=S,S=v.parentNode}v=w}n=u===-1||d===-1?null:{start:u,end:d}}else n=null}n=n||{start:0,end:0}}else n=null;for(Pp={focusedElem:t,selectionRange:n},sd=!1,oe=e;oe!==null;)if(e=oe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,oe=t;else for(;oe!==null;){e=oe;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var E=y.memoizedProps,C=y.memoizedState,P=e.stateNode,k=P.getSnapshotBeforeUpdate(e.elementType===e.type?E:ar(e.type,E),C);P.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var m=e.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(x){ut(e,e.return,x)}if(t=e.sibling,t!==null){t.return=e.return,oe=t;break}oe=e.return}return y=By,By=!1,y}function kl(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&Gp(e,n,o)}i=i.next}while(i!==r)}}function Hd(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Hp(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function A5(t){var e=t.alternate;e!==null&&(t.alternate=null,A5(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Fr],delete e[Il],delete e[Tp],delete e[c_],delete e[d_])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function M5(t){return t.tag===5||t.tag===3||t.tag===4}function Gy(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||M5(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.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Vp(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ld));else if(r!==4&&(t=t.child,t!==null))for(Vp(t,e,n),t=t.sibling;t!==null;)Vp(t,e,n),t=t.sibling}function Wp(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Wp(t,e,n),t=t.sibling;t!==null;)Wp(t,e,n),t=t.sibling}var Ut=null,ur=!1;function ki(t,e,n){for(n=n.child;n!==null;)L5(t,e,n),n=n.sibling}function L5(t,e,n){if(Mr&&typeof Mr.onCommitFiberUnmount=="function")try{Mr.onCommitFiberUnmount(bd,n)}catch{}switch(n.tag){case 5:Xt||zo(n,e);case 6:var r=Ut,i=ur;Ut=null,ki(t,e,n),Ut=r,ur=i,Ut!==null&&(ur?(t=Ut,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ut.removeChild(n.stateNode));break;case 18:Ut!==null&&(ur?(t=Ut,n=n.stateNode,t.nodeType===8?T0(t.parentNode,n):t.nodeType===1&&T0(t,n),Al(t)):T0(Ut,n.stateNode));break;case 4:r=Ut,i=ur,Ut=n.stateNode.containerInfo,ur=!0,ki(t,e,n),Ut=r,ur=i;break;case 0:case 11:case 14:case 15:if(!Xt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&Gp(n,e,l),i=i.next}while(i!==r)}ki(t,e,n);break;case 1:if(!Xt&&(zo(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){ut(n,e,u)}ki(t,e,n);break;case 21:ki(t,e,n);break;case 22:n.mode&1?(Xt=(r=Xt)||n.memoizedState!==null,ki(t,e,n),Xt=r):ki(t,e,n);break;default:ki(t,e,n)}}function Hy(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new N_),e.forEach(function(r){var i=I_.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function sr(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,l=e,u=l;e:for(;u!==null;){switch(u.tag){case 5:Ut=u.stateNode,ur=!1;break e;case 3:Ut=u.stateNode.containerInfo,ur=!0;break e;case 4:Ut=u.stateNode.containerInfo,ur=!0;break e}u=u.return}if(Ut===null)throw Error(q(160));L5(o,l,i),Ut=null,ur=!1;var d=i.alternate;d!==null&&(d.return=null),i.return=null}catch(f){ut(i,e,f)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)b5(e,t),e=e.sibling}function b5(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(sr(e,t),Pr(t),r&4){try{kl(3,t,t.return),Hd(3,t)}catch(E){ut(t,t.return,E)}try{kl(5,t,t.return)}catch(E){ut(t,t.return,E)}}break;case 1:sr(e,t),Pr(t),r&512&&n!==null&&zo(n,n.return);break;case 5:if(sr(e,t),Pr(t),r&512&&n!==null&&zo(n,n.return),t.flags&32){var i=t.stateNode;try{Rl(i,"")}catch(E){ut(t,t.return,E)}}if(r&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,l=n!==null?n.memoizedProps:o,u=t.type,d=t.updateQueue;if(t.updateQueue=null,d!==null)try{u==="input"&&o.type==="radio"&&o.name!=null&&r3(i,o),gp(u,l);var f=gp(u,o);for(l=0;l<d.length;l+=2){var g=d[l],v=d[l+1];g==="style"?l3(i,v):g==="dangerouslySetInnerHTML"?o3(i,v):g==="children"?Rl(i,v):L1(i,g,v,f)}switch(u){case"input":cp(i,o);break;case"textarea":i3(i,o);break;case"select":var S=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var w=o.value;w!=null?Go(i,!!o.multiple,w,!1):S!==!!o.multiple&&(o.defaultValue!=null?Go(i,!!o.multiple,o.defaultValue,!0):Go(i,!!o.multiple,o.multiple?[]:"",!1))}i[Il]=o}catch(E){ut(t,t.return,E)}}break;case 6:if(sr(e,t),Pr(t),r&4){if(t.stateNode===null)throw Error(q(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(E){ut(t,t.return,E)}}break;case 3:if(sr(e,t),Pr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Al(e.containerInfo)}catch(E){ut(t,t.return,E)}break;case 4:sr(e,t),Pr(t);break;case 13:sr(e,t),Pr(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(fg=ft())),r&4&&Hy(t);break;case 22:if(g=n!==null&&n.memoizedState!==null,t.mode&1?(Xt=(f=Xt)||g,sr(e,t),Xt=f):sr(e,t),Pr(t),r&8192){if(f=t.memoizedState!==null,(t.stateNode.isHidden=f)&&!g&&t.mode&1)for(oe=t,g=t.child;g!==null;){for(v=oe=g;oe!==null;){switch(S=oe,w=S.child,S.tag){case 0:case 11:case 14:case 15:kl(4,S,S.return);break;case 1:zo(S,S.return);var y=S.stateNode;if(typeof y.componentWillUnmount=="function"){r=S,n=S.return;try{e=r,y.props=e.memoizedProps,y.state=e.memoizedState,y.componentWillUnmount()}catch(E){ut(r,n,E)}}break;case 5:zo(S,S.return);break;case 22:if(S.memoizedState!==null){Wy(v);continue}}w!==null?(w.return=S,oe=w):Wy(v)}g=g.sibling}e:for(g=null,v=t;;){if(v.tag===5){if(g===null){g=v;try{i=v.stateNode,f?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(u=v.stateNode,d=v.memoizedProps.style,l=d!=null&&d.hasOwnProperty("display")?d.display:null,u.style.display=a3("display",l))}catch(E){ut(t,t.return,E)}}}else if(v.tag===6){if(g===null)try{v.stateNode.nodeValue=f?"":v.memoizedProps}catch(E){ut(t,t.return,E)}}else if((v.tag!==22&&v.tag!==23||v.memoizedState===null||v===t)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===t)break e;for(;v.sibling===null;){if(v.return===null||v.return===t)break e;g===v&&(g=null),v=v.return}g===v&&(g=null),v.sibling.return=v.return,v=v.sibling}}break;case 19:sr(e,t),Pr(t),r&4&&Hy(t);break;case 21:break;default:sr(e,t),Pr(t)}}function Pr(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(M5(n)){var r=n;break e}n=n.return}throw Error(q(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Rl(i,""),r.flags&=-33);var o=Gy(t);Wp(t,o,i);break;case 3:case 4:var l=r.stateNode.containerInfo,u=Gy(t);Vp(t,u,l);break;default:throw Error(q(161))}}catch(d){ut(t,t.return,d)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function T_(t,e,n){oe=t,D5(t)}function D5(t,e,n){for(var r=(t.mode&1)!==0;oe!==null;){var i=oe,o=i.child;if(i.tag===22&&r){var l=i.memoizedState!==null||Pc;if(!l){var u=i.alternate,d=u!==null&&u.memoizedState!==null||Xt;u=Pc;var f=Xt;if(Pc=l,(Xt=d)&&!f)for(oe=i;oe!==null;)l=oe,d=l.child,l.tag===22&&l.memoizedState!==null?Ky(i):d!==null?(d.return=l,oe=d):Ky(i);for(;o!==null;)oe=o,D5(o),o=o.sibling;oe=i,Pc=u,Xt=f}Vy(t)}else i.subtreeFlags&8772&&o!==null?(o.return=i,oe=o):Vy(t)}}function Vy(t){for(;oe!==null;){var e=oe;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Xt||Hd(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Xt)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:ar(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&Ry(e,o,r);break;case 3:var l=e.updateQueue;if(l!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Ry(e,l,n)}break;case 5:var u=e.stateNode;if(n===null&&e.flags&4){n=u;var d=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":d.autoFocus&&n.focus();break;case"img":d.src&&(n.src=d.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var f=e.alternate;if(f!==null){var g=f.memoizedState;if(g!==null){var v=g.dehydrated;v!==null&&Al(v)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(q(163))}Xt||e.flags&512&&Hp(e)}catch(S){ut(e,e.return,S)}}if(e===t){oe=null;break}if(n=e.sibling,n!==null){n.return=e.return,oe=n;break}oe=e.return}}function Wy(t){for(;oe!==null;){var e=oe;if(e===t){oe=null;break}var n=e.sibling;if(n!==null){n.return=e.return,oe=n;break}oe=e.return}}function Ky(t){for(;oe!==null;){var e=oe;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Hd(4,e)}catch(d){ut(e,n,d)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(d){ut(e,i,d)}}var o=e.return;try{Hp(e)}catch(d){ut(e,o,d)}break;case 5:var l=e.return;try{Hp(e)}catch(d){ut(e,l,d)}}}catch(d){ut(e,e.return,d)}if(e===t){oe=null;break}var u=e.sibling;if(u!==null){u.return=e.return,oe=u;break}oe=e.return}}var O_=Math.ceil,Sd=ai.ReactCurrentDispatcher,dg=ai.ReactCurrentOwner,qn=ai.ReactCurrentBatchConfig,Oe=0,bt=null,vt=null,zt=0,En=0,Bo=rs(0),Et=0,Hl=null,Qs=0,Vd=0,hg=0,El=null,mn=null,fg=0,ha=1/0,Kr=null,_d=!1,Kp=null,Yi=null,Nc=!1,Gi=null,xd=0,Pl=0,Qp=null,Wc=-1,Kc=0;function sn(){return Oe&6?ft():Wc!==-1?Wc:Wc=ft()}function Xi(t){return t.mode&1?Oe&2&&zt!==0?zt&-zt:f_.transition!==null?(Kc===0&&(Kc=_3()),Kc):(t=Ie,t!==0||(t=window.event,t=t===void 0?16:N3(t.type)),t):1}function hr(t,e,n,r){if(50<Pl)throw Pl=0,Qp=null,Error(q(185));ru(t,n,r),(!(Oe&2)||t!==bt)&&(t===bt&&(!(Oe&2)&&(Vd|=n),Et===4&&Fi(t,zt)),_n(t,r),n===1&&Oe===0&&!(e.mode&1)&&(ha=ft()+500,zd&&is()))}function _n(t,e){var n=t.callbackNode;fS(t,e);var r=id(t,t===bt?zt:0);if(r===0)n!==null&&ty(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&ty(n),e===1)t.tag===0?h_(Qy.bind(null,t)):K3(Qy.bind(null,t)),l_(function(){!(Oe&6)&&is()}),n=null;else{switch(x3(r)){case 1:n=U1;break;case 4:n=v3;break;case 16:n=rd;break;case 536870912:n=S3;break;default:n=rd}n=V5(n,I5.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function I5(t,e){if(Wc=-1,Kc=0,Oe&6)throw Error(q(327));var n=t.callbackNode;if(Qo()&&t.callbackNode!==n)return null;var r=id(t,t===bt?zt:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=wd(t,r);else{e=r;var i=Oe;Oe|=2;var o=U5();(bt!==t||zt!==e)&&(Kr=null,ha=ft()+500,zs(t,e));do try{M_();break}catch(u){j5(t,u)}while(!0);J1(),Sd.current=o,Oe=i,vt!==null?e=0:(bt=null,zt=0,e=Et)}if(e!==0){if(e===2&&(i=_p(t),i!==0&&(r=i,e=qp(t,i))),e===1)throw n=Hl,zs(t,0),Fi(t,r),_n(t,ft()),n;if(e===6)Fi(t,r);else{if(i=t.current.alternate,!(r&30)&&!F_(i)&&(e=wd(t,r),e===2&&(o=_p(t),o!==0&&(r=o,e=qp(t,o))),e===1))throw n=Hl,zs(t,0),Fi(t,r),_n(t,ft()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(q(345));case 2:ks(t,mn,Kr);break;case 3:if(Fi(t,r),(r&130023424)===r&&(e=fg+500-ft(),10<e)){if(id(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){sn(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Rp(ks.bind(null,t,mn,Kr),e);break}ks(t,mn,Kr);break;case 4:if(Fi(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var l=31-dr(r);o=1<<l,l=e[l],l>i&&(i=l),r&=~o}if(r=i,r=ft()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*O_(r/1960))-r,10<r){t.timeoutHandle=Rp(ks.bind(null,t,mn,Kr),r);break}ks(t,mn,Kr);break;case 5:ks(t,mn,Kr);break;default:throw Error(q(329))}}}return _n(t,ft()),t.callbackNode===n?I5.bind(null,t):null}function qp(t,e){var n=El;return t.current.memoizedState.isDehydrated&&(zs(t,e).flags|=256),t=wd(t,e),t!==2&&(e=mn,mn=n,e!==null&&Yp(e)),t}function Yp(t){mn===null?mn=t:mn.push.apply(mn,t)}function F_(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!pr(o(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Fi(t,e){for(e&=~hg,e&=~Vd,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-dr(e),r=1<<n;t[n]=-1,e&=~r}}function Qy(t){if(Oe&6)throw Error(q(327));Qo();var e=id(t,0);if(!(e&1))return _n(t,ft()),null;var n=wd(t,e);if(t.tag!==0&&n===2){var r=_p(t);r!==0&&(e=r,n=qp(t,r))}if(n===1)throw n=Hl,zs(t,0),Fi(t,e),_n(t,ft()),n;if(n===6)throw Error(q(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ks(t,mn,Kr),_n(t,ft()),null}function pg(t,e){var n=Oe;Oe|=1;try{return t(e)}finally{Oe=n,Oe===0&&(ha=ft()+500,zd&&is())}}function qs(t){Gi!==null&&Gi.tag===0&&!(Oe&6)&&Qo();var e=Oe;Oe|=1;var n=qn.transition,r=Ie;try{if(qn.transition=null,Ie=1,t)return t()}finally{Ie=r,qn.transition=n,Oe=e,!(Oe&6)&&is()}}function gg(){En=Bo.current,Xe(Bo)}function zs(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,a_(n)),vt!==null)for(n=vt.return;n!==null;){var r=n;switch(Y1(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ud();break;case 3:ca(),Xe(vn),Xe(Jt),ig();break;case 5:rg(r);break;case 4:ca();break;case 13:Xe(rt);break;case 19:Xe(rt);break;case 10:Z1(r.type._context);break;case 22:case 23:gg()}n=n.return}if(bt=t,vt=t=$i(t.current,null),zt=En=e,Et=0,Hl=null,hg=Vd=Qs=0,mn=El=null,Ns!==null){for(e=0;e<Ns.length;e++)if(n=Ns[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var l=o.next;o.next=i,r.next=l}n.pending=r}Ns=null}return t}function j5(t,e){do{var n=vt;try{if(J1(),Gc.current=vd,yd){for(var r=it.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}yd=!1}if(Ks=0,Lt=Ct=it=null,Cl=!1,zl=0,dg.current=null,n===null||n.return===null){Et=1,Hl=e,vt=null;break}e:{var o=t,l=n.return,u=n,d=e;if(e=zt,u.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){var f=d,g=u,v=g.tag;if(!(g.mode&1)&&(v===0||v===11||v===15)){var S=g.alternate;S?(g.updateQueue=S.updateQueue,g.memoizedState=S.memoizedState,g.lanes=S.lanes):(g.updateQueue=null,g.memoizedState=null)}var w=Ly(l);if(w!==null){w.flags&=-257,by(w,l,u,o,e),w.mode&1&&My(o,f,e),e=w,d=f;var y=e.updateQueue;if(y===null){var E=new Set;E.add(d),e.updateQueue=E}else y.add(d);break e}else{if(!(e&1)){My(o,f,e),mg();break e}d=Error(q(426))}}else if(Ze&&u.mode&1){var C=Ly(l);if(C!==null){!(C.flags&65536)&&(C.flags|=256),by(C,l,u,o,e),X1(da(d,u));break e}}o=d=da(d,u),Et!==4&&(Et=2),El===null?El=[o]:El.push(o),o=l;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var P=x5(o,d,e);Ny(o,P);break e;case 1:u=d;var k=o.type,m=o.stateNode;if(!(o.flags&128)&&(typeof k.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Yi===null||!Yi.has(m)))){o.flags|=65536,e&=-e,o.lanes|=e;var x=w5(o,u,e);Ny(o,x);break e}}o=o.return}while(o!==null)}B5(n)}catch(T){e=T,vt===n&&n!==null&&(vt=n=n.return);continue}break}while(!0)}function U5(){var t=Sd.current;return Sd.current=vd,t===null?vd:t}function mg(){(Et===0||Et===3||Et===2)&&(Et=4),bt===null||!(Qs&268435455)&&!(Vd&268435455)||Fi(bt,zt)}function wd(t,e){var n=Oe;Oe|=2;var r=U5();(bt!==t||zt!==e)&&(Kr=null,zs(t,e));do try{A_();break}catch(i){j5(t,i)}while(!0);if(J1(),Oe=n,Sd.current=r,vt!==null)throw Error(q(261));return bt=null,zt=0,Et}function A_(){for(;vt!==null;)z5(vt)}function M_(){for(;vt!==null&&!iS();)z5(vt)}function z5(t){var e=H5(t.alternate,t,En);t.memoizedProps=t.pendingProps,e===null?B5(t):vt=e,dg.current=null}function B5(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=P_(n,e),n!==null){n.flags&=32767,vt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Et=6,vt=null;return}}else if(n=E_(n,e,En),n!==null){vt=n;return}if(e=e.sibling,e!==null){vt=e;return}vt=e=t}while(e!==null);Et===0&&(Et=5)}function ks(t,e,n){var r=Ie,i=qn.transition;try{qn.transition=null,Ie=1,L_(t,e,n,r)}finally{qn.transition=i,Ie=r}return null}function L_(t,e,n,r){do Qo();while(Gi!==null);if(Oe&6)throw Error(q(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(q(177));t.callbackNode=null,t.callbackPriority=0;var o=n.lanes|n.childLanes;if(pS(t,o),t===bt&&(vt=bt=null,zt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Nc||(Nc=!0,V5(rd,function(){return Qo(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=qn.transition,qn.transition=null;var l=Ie;Ie=1;var u=Oe;Oe|=4,dg.current=null,R_(t,n),b5(n,t),e_(Pp),sd=!!Ep,Pp=Ep=null,t.current=n,T_(n),sS(),Oe=u,Ie=l,qn.transition=o}else t.current=n;if(Nc&&(Nc=!1,Gi=t,xd=i),o=t.pendingLanes,o===0&&(Yi=null),lS(n.stateNode),_n(t,ft()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(_d)throw _d=!1,t=Kp,Kp=null,t;return xd&1&&t.tag!==0&&Qo(),o=t.pendingLanes,o&1?t===Qp?Pl++:(Pl=0,Qp=t):Pl=0,is(),null}function Qo(){if(Gi!==null){var t=x3(xd),e=qn.transition,n=Ie;try{if(qn.transition=null,Ie=16>t?16:t,Gi===null)var r=!1;else{if(t=Gi,Gi=null,xd=0,Oe&6)throw Error(q(331));var i=Oe;for(Oe|=4,oe=t.current;oe!==null;){var o=oe,l=o.child;if(oe.flags&16){var u=o.deletions;if(u!==null){for(var d=0;d<u.length;d++){var f=u[d];for(oe=f;oe!==null;){var g=oe;switch(g.tag){case 0:case 11:case 15:kl(8,g,o)}var v=g.child;if(v!==null)v.return=g,oe=v;else for(;oe!==null;){g=oe;var S=g.sibling,w=g.return;if(A5(g),g===f){oe=null;break}if(S!==null){S.return=w,oe=S;break}oe=w}}}var y=o.alternate;if(y!==null){var E=y.child;if(E!==null){y.child=null;do{var C=E.sibling;E.sibling=null,E=C}while(E!==null)}}oe=o}}if(o.subtreeFlags&2064&&l!==null)l.return=o,oe=l;else e:for(;oe!==null;){if(o=oe,o.flags&2048)switch(o.tag){case 0:case 11:case 15:kl(9,o,o.return)}var P=o.sibling;if(P!==null){P.return=o.return,oe=P;break e}oe=o.return}}var k=t.current;for(oe=k;oe!==null;){l=oe;var m=l.child;if(l.subtreeFlags&2064&&m!==null)m.return=l,oe=m;else e:for(l=k;oe!==null;){if(u=oe,u.flags&2048)try{switch(u.tag){case 0:case 11:case 15:Hd(9,u)}}catch(T){ut(u,u.return,T)}if(u===l){oe=null;break e}var x=u.sibling;if(x!==null){x.return=u.return,oe=x;break e}oe=u.return}}if(Oe=i,is(),Mr&&typeof Mr.onPostCommitFiberRoot=="function")try{Mr.onPostCommitFiberRoot(bd,t)}catch{}r=!0}return r}finally{Ie=n,qn.transition=e}}return!1}function qy(t,e,n){e=da(n,e),e=x5(t,e,1),t=qi(t,e,1),e=sn(),t!==null&&(ru(t,1,e),_n(t,e))}function ut(t,e,n){if(t.tag===3)qy(t,t,n);else for(;e!==null;){if(e.tag===3){qy(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Yi===null||!Yi.has(r))){t=da(n,t),t=w5(e,t,1),e=qi(e,t,1),t=sn(),e!==null&&(ru(e,1,t),_n(e,t));break}}e=e.return}}function b_(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=sn(),t.pingedLanes|=t.suspendedLanes&n,bt===t&&(zt&n)===n&&(Et===4||Et===3&&(zt&130023424)===zt&&500>ft()-fg?zs(t,0):hg|=n),_n(t,e)}function G5(t,e){e===0&&(t.mode&1?(e=yc,yc<<=1,!(yc&130023424)&&(yc=4194304)):e=1);var n=sn();t=si(t,e),t!==null&&(ru(t,e,n),_n(t,n))}function D_(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),G5(t,n)}function I_(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(q(314))}r!==null&&r.delete(e),G5(t,n)}var H5;H5=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||vn.current)yn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return yn=!1,k_(t,e,n);yn=!!(t.flags&131072)}else yn=!1,Ze&&e.flags&1048576&&Q3(e,hd,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Vc(t,e),t=e.pendingProps;var i=aa(e,Jt.current);Ko(e,n),i=og(null,e,r,t,i,n);var o=ag();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Sn(r)?(o=!0,cd(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,tg(e),i.updater=Gd,e.stateNode=i,i._reactInternals=e,bp(e,r,t,n),e=jp(null,e,r,!0,o,n)):(e.tag=0,Ze&&o&&q1(e),nn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Vc(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=U_(r),t=ar(r,t),i){case 0:e=Ip(null,e,r,t,n);break e;case 1:e=jy(null,e,r,t,n);break e;case 11:e=Dy(null,e,r,t,n);break e;case 14:e=Iy(null,e,r,ar(r.type,t),n);break e}throw Error(q(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ar(r,i),Ip(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ar(r,i),jy(t,e,r,i,n);case 3:e:{if(P5(e),t===null)throw Error(q(387));r=e.pendingProps,o=e.memoizedState,i=o.element,Z3(t,e),gd(e,r,null,n);var l=e.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=da(Error(q(423)),e),e=Uy(t,e,r,n,i);break e}else if(r!==i){i=da(Error(q(424)),e),e=Uy(t,e,r,n,i);break e}else for(Nn=Qi(e.stateNode.containerInfo.firstChild),Rn=e,Ze=!0,cr=null,n=$3(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(la(),r===i){e=oi(t,e,n);break e}nn(t,e,r,n)}e=e.child}return e;case 5:return e5(e),t===null&&Ap(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,l=i.children,Np(r,i)?l=null:o!==null&&Np(r,o)&&(e.flags|=32),E5(t,e),nn(t,e,l,n),e.child;case 6:return t===null&&Ap(e),null;case 13:return N5(t,e,n);case 4:return ng(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=ua(e,null,r,n):nn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ar(r,i),Dy(t,e,r,i,n);case 7:return nn(t,e,e.pendingProps,n),e.child;case 8:return nn(t,e,e.pendingProps.children,n),e.child;case 12:return nn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,l=i.value,Ve(fd,r._currentValue),r._currentValue=l,o!==null)if(pr(o.value,l)){if(o.children===i.children&&!vn.current){e=oi(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var u=o.dependencies;if(u!==null){l=o.child;for(var d=u.firstContext;d!==null;){if(d.context===r){if(o.tag===1){d=ei(-1,n&-n),d.tag=2;var f=o.updateQueue;if(f!==null){f=f.shared;var g=f.pending;g===null?d.next=d:(d.next=g.next,g.next=d),f.pending=d}}o.lanes|=n,d=o.alternate,d!==null&&(d.lanes|=n),Mp(o.return,n,e),u.lanes|=n;break}d=d.next}}else if(o.tag===10)l=o.type===e.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(q(341));l.lanes|=n,u=l.alternate,u!==null&&(u.lanes|=n),Mp(l,n,e),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===e){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}nn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Ko(e,n),i=Yn(i),r=r(i),e.flags|=1,nn(t,e,r,n),e.child;case 14:return r=e.type,i=ar(r,e.pendingProps),i=ar(r.type,i),Iy(t,e,r,i,n);case 15:return C5(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ar(r,i),Vc(t,e),e.tag=1,Sn(r)?(t=!0,cd(e)):t=!1,Ko(e,n),_5(e,r,i),bp(e,r,i,n),jp(null,e,r,!0,t,n);case 19:return R5(t,e,n);case 22:return k5(t,e,n)}throw Error(q(156,e.tag))};function V5(t,e){return y3(t,e)}function j_(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(t,e,n,r){return new j_(t,e,n,r)}function yg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function U_(t){if(typeof t=="function")return yg(t)?1:0;if(t!=null){if(t=t.$$typeof,t===D1)return 11;if(t===I1)return 14}return 2}function $i(t,e){var n=t.alternate;return n===null?(n=Qn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Qc(t,e,n,r,i,o){var l=2;if(r=t,typeof t=="function")yg(t)&&(l=1);else if(typeof t=="string")l=5;else e:switch(t){case Fo:return Bs(n.children,i,o,e);case b1:l=8,i|=8;break;case sp:return t=Qn(12,n,e,i|2),t.elementType=sp,t.lanes=o,t;case op:return t=Qn(13,n,e,i),t.elementType=op,t.lanes=o,t;case ap:return t=Qn(19,n,e,i),t.elementType=ap,t.lanes=o,t;case e3:return Wd(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case J4:l=10;break e;case Z4:l=9;break e;case D1:l=11;break e;case I1:l=14;break e;case Ri:l=16,r=null;break e}throw Error(q(130,t==null?t:typeof t,""))}return e=Qn(l,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Bs(t,e,n,r){return t=Qn(7,t,r,e),t.lanes=n,t}function Wd(t,e,n,r){return t=Qn(22,t,r,e),t.elementType=e3,t.lanes=n,t.stateNode={isHidden:!1},t}function I0(t,e,n){return t=Qn(6,t,null,e),t.lanes=n,t}function j0(t,e,n){return e=Qn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function z_(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=v0(0),this.expirationTimes=v0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=v0(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function vg(t,e,n,r,i,o,l,u,d){return t=new z_(t,e,n,u,d),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Qn(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},tg(o),t}function B_(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Oo,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function W5(t){if(!t)return es;t=t._reactInternals;e:{if(Zs(t)!==t||t.tag!==1)throw Error(q(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Sn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(q(171))}if(t.tag===1){var n=t.type;if(Sn(n))return W3(t,n,e)}return e}function K5(t,e,n,r,i,o,l,u,d){return t=vg(n,r,!0,t,i,o,l,u,d),t.context=W5(null),n=t.current,r=sn(),i=Xi(n),o=ei(r,i),o.callback=e??null,qi(n,o,i),t.current.lanes=i,ru(t,i,r),_n(t,r),t}function Kd(t,e,n,r){var i=e.current,o=sn(),l=Xi(i);return n=W5(n),e.context===null?e.context=n:e.pendingContext=n,e=ei(o,l),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=qi(i,e,l),t!==null&&(hr(t,i,l,o),Bc(t,i,l)),l}function Cd(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Yy(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Sg(t,e){Yy(t,e),(t=t.alternate)&&Yy(t,e)}function G_(){return null}var Q5=typeof reportError=="function"?reportError:function(t){console.error(t)};function _g(t){this._internalRoot=t}Qd.prototype.render=_g.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(q(409));Kd(t,e,null,null)};Qd.prototype.unmount=_g.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;qs(function(){Kd(null,t,null,null)}),e[ii]=null}};function Qd(t){this._internalRoot=t}Qd.prototype.unstable_scheduleHydration=function(t){if(t){var e=k3();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Oi.length&&e!==0&&e<Oi[n].priority;n++);Oi.splice(n,0,t),n===0&&P3(t)}};function xg(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function qd(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Xy(){}function H_(t,e,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var f=Cd(l);o.call(f)}}var l=K5(e,r,t,0,null,!1,!1,"",Xy);return t._reactRootContainer=l,t[ii]=l.current,bl(t.nodeType===8?t.parentNode:t),qs(),l}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var u=r;r=function(){var f=Cd(d);u.call(f)}}var d=vg(t,0,!1,null,null,!1,!1,"",Xy);return t._reactRootContainer=d,t[ii]=d.current,bl(t.nodeType===8?t.parentNode:t),qs(function(){Kd(e,d,n,r)}),d}function Yd(t,e,n,r,i){var o=n._reactRootContainer;if(o){var l=o;if(typeof i=="function"){var u=i;i=function(){var d=Cd(l);u.call(d)}}Kd(e,l,t,i)}else l=H_(n,e,t,i,r);return Cd(l)}w3=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=hl(e.pendingLanes);n!==0&&(z1(e,n|1),_n(e,ft()),!(Oe&6)&&(ha=ft()+500,is()))}break;case 13:qs(function(){var r=si(t,1);if(r!==null){var i=sn();hr(r,t,1,i)}}),Sg(t,1)}};B1=function(t){if(t.tag===13){var e=si(t,134217728);if(e!==null){var n=sn();hr(e,t,134217728,n)}Sg(t,134217728)}};C3=function(t){if(t.tag===13){var e=Xi(t),n=si(t,e);if(n!==null){var r=sn();hr(n,t,e,r)}Sg(t,e)}};k3=function(){return Ie};E3=function(t,e){var n=Ie;try{return Ie=t,e()}finally{Ie=n}};yp=function(t,e,n){switch(e){case"input":if(cp(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=Ud(r);if(!i)throw Error(q(90));n3(r),cp(r,i)}}}break;case"textarea":i3(t,n);break;case"select":e=n.value,e!=null&&Go(t,!!n.multiple,e,!1)}};d3=pg;h3=qs;var V_={usingClientEntryPoint:!1,Events:[su,bo,Ud,u3,c3,pg]},sl={findFiberByHostInstance:Ps,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},W_={bundleType:sl.bundleType,version:sl.version,rendererPackageName:sl.rendererPackageName,rendererConfig:sl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ai.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=g3(t),t===null?null:t.stateNode},findFiberByHostInstance:sl.findFiberByHostInstance||G_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rc.isDisabled&&Rc.supportsFiber)try{bd=Rc.inject(W_),Mr=Rc}catch{}}On.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V_;On.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xg(e))throw Error(q(200));return B_(t,e,null,n)};On.createRoot=function(t,e){if(!xg(t))throw Error(q(299));var n=!1,r="",i=Q5;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=vg(t,1,!1,null,null,n,!1,r,i),t[ii]=e.current,bl(t.nodeType===8?t.parentNode:t),new _g(e)};On.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(q(188)):(t=Object.keys(t).join(","),Error(q(268,t)));return t=g3(e),t=t===null?null:t.stateNode,t};On.flushSync=function(t){return qs(t)};On.hydrate=function(t,e,n){if(!qd(e))throw Error(q(200));return Yd(null,t,e,!0,n)};On.hydrateRoot=function(t,e,n){if(!xg(t))throw Error(q(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",l=Q5;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),e=K5(e,null,t,1,n??null,i,!1,o,l),t[ii]=e.current,bl(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new Qd(e)};On.render=function(t,e,n){if(!qd(e))throw Error(q(200));return Yd(null,t,e,!1,n)};On.unmountComponentAtNode=function(t){if(!qd(t))throw Error(q(40));return t._reactRootContainer?(qs(function(){Yd(null,null,t,!1,function(){t._reactRootContainer=null,t[ii]=null})}),!0):!1};On.unstable_batchedUpdates=pg;On.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!qd(n))throw Error(q(200));if(t==null||t._reactInternals===void 0)throw Error(q(38));return Yd(t,e,n,!1,r)};On.version="18.3.1-next-f1338f8080-20240426";function q5(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(q5)}catch(t){console.error(t)}}q5(),q4.exports=On;var K_=q4.exports,$y=K_;rp.createRoot=$y.createRoot,rp.hydrateRoot=$y.hydrateRoot;/**
* @remix-run/router v1.23.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Vl(){return Vl=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Vl.apply(this,arguments)}var Hi;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Hi||(Hi={}));const Jy="popstate";function Q_(t){t===void 0&&(t={});function e(r,i){let{pathname:o,search:l,hash:u}=r.location;return Xp("",{pathname:o,search:l,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Y5(i)}return Y_(e,n,null,t)}function St(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function wg(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function q_(){return Math.random().toString(36).substr(2,8)}function Zy(t,e){return{usr:t.state,key:t.key,idx:e}}function Xp(t,e,n,r){return n===void 0&&(n=null),Vl({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?xa(e):e,{state:n,key:e&&e.key||r||q_()})}function Y5(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function xa(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function Y_(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,u=Hi.Pop,d=null,f=g();f==null&&(f=0,l.replaceState(Vl({},l.state,{idx:f}),""));function g(){return(l.state||{idx:null}).idx}function v(){u=Hi.Pop;let C=g(),P=C==null?null:C-f;f=C,d&&d({action:u,location:E.location,delta:P})}function S(C,P){u=Hi.Push;let k=Xp(E.location,C,P);f=g()+1;let m=Zy(k,f),x=E.createHref(k);try{l.pushState(m,"",x)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;i.location.assign(x)}o&&d&&d({action:u,location:E.location,delta:1})}function w(C,P){u=Hi.Replace;let k=Xp(E.location,C,P);f=g();let m=Zy(k,f),x=E.createHref(k);l.replaceState(m,"",x),o&&d&&d({action:u,location:E.location,delta:0})}function y(C){let P=i.location.origin!=="null"?i.location.origin:i.location.href,k=typeof C=="string"?C:Y5(C);return k=k.replace(/ $/,"%20"),St(P,"No window.location.(origin|href) available to create URL for href: "+k),new URL(k,P)}let E={get action(){return u},get location(){return t(i,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(Jy,v),d=C,()=>{i.removeEventListener(Jy,v),d=null}},createHref(C){return e(i,C)},createURL:y,encodeLocation(C){let P=y(C);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:S,replace:w,go(C){return l.go(C)}};return E}var ev;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(ev||(ev={}));function X_(t,e,n){return n===void 0&&(n="/"),$_(t,e,n)}function $_(t,e,n,r){let i=typeof e=="string"?xa(e):e,o=J5(i.pathname||"/",n);if(o==null)return null;let l=X5(t);J_(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let f=cx(o);u=ax(l[d],f)}return u}function X5(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(o,l,u)=>{let d={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};d.relativePath.startsWith("/")&&(St(d.relativePath.startsWith(r),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(r.length));let f=Gs([r,d.relativePath]),g=n.concat(d);o.children&&o.children.length>0&&(St(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),X5(o.children,e,g,f)),!(o.path==null&&!o.index)&&e.push({path:f,score:sx(f,o.index),routesMeta:g})};return t.forEach((o,l)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))i(o,l);else for(let d of $5(o.path))i(o,l,d)}),e}function $5(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=$5(r.join("/")),u=[];return u.push(...l.map(d=>d===""?o:[o,d].join("/"))),i&&u.push(...l),u.map(d=>t.startsWith("/")&&d===""?"/":d)}function J_(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:ox(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Z_=/^:[\w-]+$/,ex=3,tx=2,nx=1,rx=10,ix=-2,tv=t=>t==="*";function sx(t,e){let n=t.split("/"),r=n.length;return n.some(tv)&&(r+=ix),e&&(r+=tx),n.filter(i=>!tv(i)).reduce((i,o)=>i+(Z_.test(o)?ex:o===""?nx:rx),r)}function ox(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function ax(t,e,n){let{routesMeta:r}=t,i={},o="/",l=[];for(let u=0;u<r.length;++u){let d=r[u],f=u===r.length-1,g=o==="/"?e:e.slice(o.length)||"/",v=lx({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},g),S=d.route;if(!v)return null;Object.assign(i,v.params),l.push({params:i,pathname:Gs([o,v.pathname]),pathnameBase:gx(Gs([o,v.pathnameBase])),route:S}),v.pathnameBase!=="/"&&(o=Gs([o,v.pathnameBase]))}return l}function lx(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=ux(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let o=i[0],l=o.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:r.reduce((f,g,v)=>{let{paramName:S,isOptional:w}=g;if(S==="*"){let E=u[v]||"";l=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const y=u[v];return w&&!y?f[S]=void 0:f[S]=(y||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:t}}function ux(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),wg(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(r.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function cx(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return wg(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function J5(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}const dx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hx=t=>dx.test(t);function fx(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?xa(t):t,o;if(n)if(hx(n))o=n;else{if(n.includes("//")){let l=n;n=n.replace(/\/\/+/g,"/"),wg(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?o=nv(n.substring(1),"/"):o=nv(n,e)}else o=e;return{pathname:o,search:mx(r),hash:yx(i)}}function nv(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function U0(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function px(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Z5(t,e){let n=px(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function e6(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=xa(t):(i=Vl({},t),St(!i.pathname||!i.pathname.includes("?"),U0("?","pathname","search",i)),St(!i.pathname||!i.pathname.includes("#"),U0("#","pathname","hash",i)),St(!i.search||!i.search.includes("#"),U0("#","search","hash",i)));let o=t===""||i.pathname==="",l=o?"/":i.pathname,u;if(l==null)u=n;else{let v=e.length-1;if(!r&&l.startsWith("..")){let S=l.split("/");for(;S[0]==="..";)S.shift(),v-=1;i.pathname=S.join("/")}u=v>=0?e[v]:"/"}let d=fx(i,u),f=l&&l!=="/"&&l.endsWith("/"),g=(o||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||g)&&(d.pathname+="/"),d}const Gs=t=>t.join("/").replace(/\/\/+/g,"/"),gx=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),mx=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,yx=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function vx(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const t6=["post","put","patch","delete"];new Set(t6);const Sx=["get",...t6];new Set(Sx);/**
* React Router v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Wl(){return Wl=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Wl.apply(this,arguments)}const Cg=W.createContext(null),_x=W.createContext(null),au=W.createContext(null),Xd=W.createContext(null),eo=W.createContext({outlet:null,matches:[],isDataRoute:!1}),n6=W.createContext(null);function lu(){return W.useContext(Xd)!=null}function kg(){return lu()||St(!1),W.useContext(Xd).location}function r6(t){W.useContext(au).static||W.useLayoutEffect(t)}function xx(){let{isDataRoute:t}=W.useContext(eo);return t?Lx():wx()}function wx(){lu()||St(!1);let t=W.useContext(Cg),{basename:e,future:n,navigator:r}=W.useContext(au),{matches:i}=W.useContext(eo),{pathname:o}=kg(),l=JSON.stringify(Z5(i,n.v7_relativeSplatPath)),u=W.useRef(!1);return r6(()=>{u.current=!0}),W.useCallback(function(f,g){if(g===void 0&&(g={}),!u.current)return;if(typeof f=="number"){r.go(f);return}let v=e6(f,JSON.parse(l),o,g.relative==="path");t==null&&e!=="/"&&(v.pathname=v.pathname==="/"?e:Gs([e,v.pathname])),(g.replace?r.replace:r.push)(v,g.state,g)},[e,r,l,o,t])}function Cx(t,e){return kx(t,e)}function kx(t,e,n,r){lu()||St(!1);let{navigator:i}=W.useContext(au),{matches:o}=W.useContext(eo),l=o[o.length-1],u=l?l.params:{};l&&l.pathname;let d=l?l.pathnameBase:"/";l&&l.route;let f=kg(),g;if(e){var v;let C=typeof e=="string"?xa(e):e;d==="/"||(v=C.pathname)!=null&&v.startsWith(d)||St(!1),g=C}else g=f;let S=g.pathname||"/",w=S;if(d!=="/"){let C=d.replace(/^\//,"").split("/");w="/"+S.replace(/^\//,"").split("/").slice(C.length).join("/")}let y=X_(t,{pathname:w}),E=Tx(y&&y.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:Gs([d,i.encodeLocation?i.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?d:Gs([d,i.encodeLocation?i.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),o,n,r);return e&&E?W.createElement(Xd.Provider,{value:{location:Wl({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:Hi.Pop}},E):E}function Ex(){let t=Mx(),e=vx(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return W.createElement(W.Fragment,null,W.createElement("h2",null,"Unexpected Application Error!"),W.createElement("h3",{style:{fontStyle:"italic"}},e),n?W.createElement("pre",{style:i},n):null,null)}const Px=W.createElement(Ex,null);class Nx extends W.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?W.createElement(eo.Provider,{value:this.props.routeContext},W.createElement(n6.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Rx(t){let{routeContext:e,match:n,children:r}=t,i=W.useContext(Cg);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),W.createElement(eo.Provider,{value:e},r)}function Tx(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if(!n)return null;if(n.errors)t=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let l=t,u=(i=n)==null?void 0:i.errors;if(u!=null){let g=l.findIndex(v=>v.route.id&&(u==null?void 0:u[v.route.id])!==void 0);g>=0||St(!1),l=l.slice(0,Math.min(l.length,g+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let g=0;g<l.length;g++){let v=l[g];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(f=g),v.route.id){let{loaderData:S,errors:w}=n,y=v.route.loader&&S[v.route.id]===void 0&&(!w||w[v.route.id]===void 0);if(v.route.lazy||y){d=!0,f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}return l.reduceRight((g,v,S)=>{let w,y=!1,E=null,C=null;n&&(w=u&&v.route.id?u[v.route.id]:void 0,E=v.route.errorElement||Px,d&&(f<0&&S===0?(bx("route-fallback"),y=!0,C=null):f===S&&(y=!0,C=v.route.hydrateFallbackElement||null)));let P=e.concat(l.slice(0,S+1)),k=()=>{let m;return w?m=E:y?m=C:v.route.Component?m=W.createElement(v.route.Component,null):v.route.element?m=v.route.element:m=g,W.createElement(Rx,{match:v,routeContext:{outlet:g,matches:P,isDataRoute:n!=null},children:m})};return n&&(v.route.ErrorBoundary||v.route.errorElement||S===0)?W.createElement(Nx,{location:n.location,revalidation:n.revalidation,component:E,error:w,children:k(),routeContext:{outlet:null,matches:P,isDataRoute:!0}}):k()},null)}var i6=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(i6||{}),s6=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(s6||{});function Ox(t){let e=W.useContext(Cg);return e||St(!1),e}function Fx(t){let e=W.useContext(_x);return e||St(!1),e}function Ax(t){let e=W.useContext(eo);return e||St(!1),e}function o6(t){let e=Ax(),n=e.matches[e.matches.length-1];return n.route.id||St(!1),n.route.id}function Mx(){var t;let e=W.useContext(n6),n=Fx(),r=o6();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function Lx(){let{router:t}=Ox(i6.UseNavigateStable),e=o6(s6.UseNavigateStable),n=W.useRef(!1);return r6(()=>{n.current=!0}),W.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,Wl({fromRouteId:e},o)))},[t,e])}const rv={};function bx(t,e,n){rv[t]||(rv[t]=!0)}function Dx(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Ix(t){let{to:e,replace:n,state:r,relative:i}=t;lu()||St(!1);let{future:o,static:l}=W.useContext(au),{matches:u}=W.useContext(eo),{pathname:d}=kg(),f=xx(),g=e6(e,Z5(u,o.v7_relativeSplatPath),d,i==="path"),v=JSON.stringify(g);return W.useEffect(()=>f(JSON.parse(v),{replace:n,state:r,relative:i}),[f,v,i,n,r]),null}function pl(t){St(!1)}function jx(t){let{basename:e="/",children:n=null,location:r,navigationType:i=Hi.Pop,navigator:o,static:l=!1,future:u}=t;lu()&&St(!1);let d=e.replace(/^\/*/,"/"),f=W.useMemo(()=>({basename:d,navigator:o,static:l,future:Wl({v7_relativeSplatPath:!1},u)}),[d,u,o,l]);typeof r=="string"&&(r=xa(r));let{pathname:g="/",search:v="",hash:S="",state:w=null,key:y="default"}=r,E=W.useMemo(()=>{let C=J5(g,d);return C==null?null:{location:{pathname:C,search:v,hash:S,state:w,key:y},navigationType:i}},[d,g,v,S,w,y,i]);return E==null?null:W.createElement(au.Provider,{value:f},W.createElement(Xd.Provider,{children:n,value:E}))}function Ux(t){let{children:e,location:n}=t;return Cx($p(e),n)}new Promise(()=>{});function $p(t,e){e===void 0&&(e=[]);let n=[];return W.Children.forEach(t,(r,i)=>{if(!W.isValidElement(r))return;let o=[...e,i];if(r.type===W.Fragment){n.push.apply(n,$p(r.props.children,o));return}r.type!==pl&&St(!1),!r.props.index||!r.props.children||St(!1);let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=$p(r.props.children,o)),n.push(l)}),n}/**
* React Router DOM v6.30.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/const zx="6";try{window.__reactRouterVersion=zx}catch{}const Bx="startTransition",iv=D7[Bx];function Gx(t){let{basename:e,children:n,future:r,window:i}=t,o=W.useRef();o.current==null&&(o.current=Q_({window:i,v5Compat:!0}));let l=o.current,[u,d]=W.useState({action:l.action,location:l.location}),{v7_startTransition:f}=r||{},g=W.useCallback(v=>{f&&iv?iv(()=>d(v)):d(v)},[d,f]);return W.useLayoutEffect(()=>l.listen(g),[l,g]),W.useEffect(()=>Dx(r),[r]),W.createElement(jx,{basename:e,children:n,location:u.location,navigationType:u.action,navigator:l,future:r})}var sv;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(sv||(sv={}));var ov;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(ov||(ov={}));var wa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fs,Ai,qo,P4,Hx=(P4=class extends wa{constructor(){super();ce(this,Fs);ce(this,Ai);ce(this,qo);te(this,qo,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){A(this,Ai)||this.setEventListener(A(this,qo))}onUnsubscribe(){var e;this.hasListeners()||((e=A(this,Ai))==null||e.call(this),te(this,Ai,void 0))}setEventListener(e){var n;te(this,qo,e),(n=A(this,Ai))==null||n.call(this),te(this,Ai,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){A(this,Fs)!==e&&(te(this,Fs,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof A(this,Fs)=="boolean"?A(this,Fs):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Fs=new WeakMap,Ai=new WeakMap,qo=new WeakMap,P4),Eg=new Hx,Vx={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Mi,N1,N4,Wx=(N4=class{constructor(){ce(this,Mi,Vx);ce(this,N1,!1)}setTimeoutProvider(t){te(this,Mi,t)}setTimeout(t,e){return A(this,Mi).setTimeout(t,e)}clearTimeout(t){A(this,Mi).clearTimeout(t)}setInterval(t,e){return A(this,Mi).setInterval(t,e)}clearInterval(t){A(this,Mi).clearInterval(t)}},Mi=new WeakMap,N1=new WeakMap,N4),Ts=new Wx;function Kx(t){setTimeout(t,0)}var Qx=typeof window>"u"||"Deno"in globalThis;function rn(){}function qx(t,e){return typeof t=="function"?t(e):t}function Jp(t){return typeof t=="number"&&t>=0&&t!==1/0}function a6(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Ji(t,e){return typeof t=="function"?t(e):t}function Hn(t,e){return typeof t=="function"?t(e):t}function av(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:l,stale:u}=t;if(l){if(r){if(e.queryHash!==Pg(l,e.options))return!1}else if(!Kl(e.queryKey,l))return!1}if(n!=="all"){const d=e.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||o&&!o(e))}function lv(t,e){const{exact:n,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Ys(e.options.mutationKey)!==Ys(o))return!1}else if(!Kl(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function Pg(t,e){return((e==null?void 0:e.queryKeyHashFn)||Ys)(t)}function Ys(t){return JSON.stringify(t,(e,n)=>Zp(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Kl(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Kl(t[n],e[n])):!1}var Yx=Object.prototype.hasOwnProperty;function l6(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=uv(t)&&uv(e);if(!r&&!(Zp(t)&&Zp(e)))return e;const o=(r?t:Object.keys(t)).length,l=r?e:Object.keys(e),u=l.length,d=r?new Array(u):{};let f=0;for(let g=0;g<u;g++){const v=r?g:l[g],S=t[v],w=e[v];if(S===w){d[v]=S,(r?g<o:Yx.call(t,v))&&f++;continue}if(S===null||w===null||typeof S!="object"||typeof w!="object"){d[v]=w;continue}const y=l6(S,w,n+1);d[v]=y,y===S&&f++}return o===u&&f===o?t:d}function kd(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function uv(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Zp(t){if(!cv(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!cv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function cv(t){return Object.prototype.toString.call(t)==="[object Object]"}function Xx(t){return new Promise(e=>{Ts.setTimeout(e,t)})}function e1(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?l6(t,e):e}function $x(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Jx(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var Ng=Symbol();function u6(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Ng?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Rg(t,e){return typeof t=="function"?t(...e):!!t}function Zx(t,e,n){let r=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var Ql=(()=>{let t=()=>Qx;return{isServer(){return t()},setIsServer(e){t=e}}})();function t1(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}var ew=Kx;function tw(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=ew;const o=u=>{e?t.push(u):i(()=>{n(u)})},l=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(d=>{n(d)})})})};return{batch:u=>{let d;e++;try{d=u()}finally{e--,e||l()}return d},batchCalls:u=>(...d)=>{o(()=>{u(...d)})},schedule:o,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var kt=tw(),Yo,Li,Xo,R4,nw=(R4=class extends wa{constructor(){super();ce(this,Yo,!0);ce(this,Li);ce(this,Xo);te(this,Xo,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){A(this,Li)||this.setEventListener(A(this,Xo))}onUnsubscribe(){var e;this.hasListeners()||((e=A(this,Li))==null||e.call(this),te(this,Li,void 0))}setEventListener(e){var n;te(this,Xo,e),(n=A(this,Li))==null||n.call(this),te(this,Li,e(this.setOnline.bind(this)))}setOnline(e){A(this,Yo)!==e&&(te(this,Yo,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return A(this,Yo)}},Yo=new WeakMap,Li=new WeakMap,Xo=new WeakMap,R4),Ed=new nw;function rw(t){return Math.min(1e3*2**t,3e4)}function c6(t){return(t??"online")==="online"?Ed.isOnline():!0}var n1=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function d6(t){let e=!1,n=0,r;const i=t1(),o=()=>i.status!=="pending",l=E=>{var C;if(!o()){const P=new n1(E);S(P),(C=t.onCancel)==null||C.call(t,P)}},u=()=>{e=!0},d=()=>{e=!1},f=()=>Eg.isFocused()&&(t.networkMode==="always"||Ed.isOnline())&&t.canRun(),g=()=>c6(t.networkMode)&&t.canRun(),v=E=>{o()||(r==null||r(),i.resolve(E))},S=E=>{o()||(r==null||r(),i.reject(E))},w=()=>new Promise(E=>{var C;r=P=>{(o()||f())&&E(P)},(C=t.onPause)==null||C.call(t)}).then(()=>{var E;r=void 0,o()||(E=t.onContinue)==null||E.call(t)}),y=()=>{if(o())return;let E;const C=n===0?t.initialPromise:void 0;try{E=C??t.fn()}catch(P){E=Promise.reject(P)}Promise.resolve(E).then(v).catch(P=>{var F;if(o())return;const k=t.retry??(Ql.isServer()?0:3),m=t.retryDelay??rw,x=typeof m=="function"?m(n,P):m,T=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,P);if(e||!T){S(P);return}n++,(F=t.onFail)==null||F.call(t,n,P),Xx(x).then(()=>f()?void 0:w()).then(()=>{e?S(P):y()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:u,continueRetry:d,canStart:g,start:()=>(g()?y():w().then(y),i)}}var As,T4,h6=(T4=class{constructor(){ce(this,As)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jp(this.gcTime)&&te(this,As,Ts.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Ql.isServer()?1/0:5*60*1e3))}clearGcTimeout(){A(this,As)&&(Ts.clearTimeout(A(this,As)),te(this,As,void 0))}},As=new WeakMap,T4),Ms,$o,Gn,Ls,At,$l,bs,Pn,f6,Vr,O4,iw=(O4=class extends h6{constructor(e){super();ce(this,Pn);ce(this,Ms);ce(this,$o);ce(this,Gn);ce(this,Ls);ce(this,At);ce(this,$l);ce(this,bs);te(this,bs,!1),te(this,$l,e.defaultOptions),this.setOptions(e.options),this.observers=[],te(this,Ls,e.client),te(this,Gn,A(this,Ls).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,te(this,Ms,hv(this.options)),this.state=e.state??A(this,Ms),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=A(this,At))==null?void 0:e.promise}setOptions(e){if(this.options={...A(this,$l),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=hv(this.options);n.data!==void 0&&(this.setState(dv(n.data,n.dataUpdatedAt)),te(this,Ms,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,Gn).remove(this)}setData(e,n){const r=e1(this.state.data,e,this.options);return Se(this,Pn,Vr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Se(this,Pn,Vr).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=A(this,At))==null?void 0:r.promise;return(i=A(this,At))==null||i.cancel(e),n?n.then(rn).catch(rn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return A(this,Ms)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Hn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ng||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ji(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!a6(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=A(this,At))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=A(this,At))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),A(this,Gn).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(A(this,At)&&(A(this,bs)||Se(this,Pn,f6).call(this)?A(this,At).cancel({revert:!0}):A(this,At).cancelRetry()),this.scheduleGc()),A(this,Gn).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Se(this,Pn,Vr).call(this,{type:"invalidate"})}async fetch(e,n){var d,f,g,v,S,w,y,E,C,P,k,m;if(this.state.fetchStatus!=="idle"&&((d=A(this,At))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(A(this,At))return A(this,At).continueRetry(),A(this,At).promise}if(e&&this.setOptions(e),!this.options.queryFn){const x=this.observers.find(T=>T.options.queryFn);x&&this.setOptions(x.options)}const r=new AbortController,i=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(te(this,bs,!0),r.signal)})},o=()=>{const x=u6(this.options,n),F=(()=>{const L={client:A(this,Ls),queryKey:this.queryKey,meta:this.meta};return i(L),L})();return te(this,bs,!1),this.options.persister?this.options.persister(x,F,this):x(F)},u=(()=>{const x={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:A(this,Ls),state:this.state,fetchFn:o};return i(x),x})();(f=this.options.behavior)==null||f.onFetch(u,this),te(this,$o,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=u.fetchOptions)==null?void 0:g.meta))&&Se(this,Pn,Vr).call(this,{type:"fetch",meta:(v=u.fetchOptions)==null?void 0:v.meta}),te(this,At,d6({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:x=>{x instanceof n1&&x.revert&&this.setState({...A(this,$o),fetchStatus:"idle"}),r.abort()},onFail:(x,T)=>{Se(this,Pn,Vr).call(this,{type:"failed",failureCount:x,error:T})},onPause:()=>{Se(this,Pn,Vr).call(this,{type:"pause"})},onContinue:()=>{Se(this,Pn,Vr).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const x=await A(this,At).start();if(x===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(x),(w=(S=A(this,Gn).config).onSuccess)==null||w.call(S,x,this),(E=(y=A(this,Gn).config).onSettled)==null||E.call(y,x,this.state.error,this),x}catch(x){if(x instanceof n1){if(x.silent)return A(this,At).promise;if(x.revert){if(this.state.data===void 0)throw x;return this.state.data}}throw Se(this,Pn,Vr).call(this,{type:"error",error:x}),(P=(C=A(this,Gn).config).onError)==null||P.call(C,x,this),(m=(k=A(this,Gn).config).onSettled)==null||m.call(k,this.state.data,x,this),x}finally{this.scheduleGc()}}},Ms=new WeakMap,$o=new WeakMap,Gn=new WeakMap,Ls=new WeakMap,At=new WeakMap,$l=new WeakMap,bs=new WeakMap,Pn=new WeakSet,f6=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Vr=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...p6(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...dv(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return te(this,$o,e.manual?i:void 0),i;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),kt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),A(this,Gn).notify({query:this,type:"updated",action:e})})},O4);function p6(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:c6(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function dv(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function hv(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var pn,Re,Jl,tn,Ds,Jo,qr,bi,Zl,Zo,ea,Is,js,Di,ta,be,gl,r1,i1,s1,o1,a1,l1,u1,g6,F4,sw=(F4=class extends wa{constructor(e,n){super();ce(this,be);ce(this,pn);ce(this,Re);ce(this,Jl);ce(this,tn);ce(this,Ds);ce(this,Jo);ce(this,qr);ce(this,bi);ce(this,Zl);ce(this,Zo);ce(this,ea);ce(this,Is);ce(this,js);ce(this,Di);ce(this,ta,new Set);this.options=n,te(this,pn,e),te(this,bi,null),te(this,qr,t1()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(A(this,Re).addObserver(this),fv(A(this,Re),this.options)?Se(this,be,gl).call(this):this.updateResult(),Se(this,be,o1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c1(A(this,Re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c1(A(this,Re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Se(this,be,a1).call(this),Se(this,be,l1).call(this),A(this,Re).removeObserver(this)}setOptions(e){const n=this.options,r=A(this,Re);if(this.options=A(this,pn).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Hn(this.options.enabled,A(this,Re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Se(this,be,u1).call(this),A(this,Re).setOptions(this.options),n._defaulted&&!kd(this.options,n)&&A(this,pn).getQueryCache().notify({type:"observerOptionsUpdated",query:A(this,Re),observer:this});const i=this.hasListeners();i&&pv(A(this,Re),r,this.options,n)&&Se(this,be,gl).call(this),this.updateResult(),i&&(A(this,Re)!==r||Hn(this.options.enabled,A(this,Re))!==Hn(n.enabled,A(this,Re))||Ji(this.options.staleTime,A(this,Re))!==Ji(n.staleTime,A(this,Re)))&&Se(this,be,r1).call(this);const o=Se(this,be,i1).call(this);i&&(A(this,Re)!==r||Hn(this.options.enabled,A(this,Re))!==Hn(n.enabled,A(this,Re))||o!==A(this,Di))&&Se(this,be,s1).call(this,o)}getOptimisticResult(e){const n=A(this,pn).getQueryCache().build(A(this,pn),e),r=this.createResult(n,e);return aw(this,r)&&(te(this,tn,r),te(this,Jo,this.options),te(this,Ds,A(this,Re).state)),r}getCurrentResult(){return A(this,tn)}trackResult(e,n){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&A(this,qr).status==="pending"&&A(this,qr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){A(this,ta).add(e)}getCurrentQuery(){return A(this,Re)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=A(this,pn).defaultQueryOptions(e),r=A(this,pn).getQueryCache().build(A(this,pn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Se(this,be,gl).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),A(this,tn)))}createResult(e,n){var j;const r=A(this,Re),i=this.options,o=A(this,tn),l=A(this,Ds),u=A(this,Jo),f=e!==r?e.state:A(this,Jl),{state:g}=e;let v={...g},S=!1,w;if(n._optimisticResults){const M=this.hasListeners(),G=!M&&fv(e,n),K=M&&pv(e,r,n,i);(G||K)&&(v={...v,...p6(g.data,e.options)}),n._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:y,errorUpdatedAt:E,status:C}=v;w=v.data;let P=!1;if(n.placeholderData!==void 0&&w===void 0&&C==="pending"){let M;o!=null&&o.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(M=o.data,P=!0):M=typeof n.placeholderData=="function"?n.placeholderData((j=A(this,ea))==null?void 0:j.state.data,A(this,ea)):n.placeholderData,M!==void 0&&(C="success",w=e1(o==null?void 0:o.data,M,n),S=!0)}if(n.select&&w!==void 0&&!P)if(o&&w===(l==null?void 0:l.data)&&n.select===A(this,Zl))w=A(this,Zo);else try{te(this,Zl,n.select),w=n.select(w),w=e1(o==null?void 0:o.data,w,n),te(this,Zo,w),te(this,bi,null)}catch(M){te(this,bi,M)}A(this,bi)&&(y=A(this,bi),w=A(this,Zo),E=Date.now(),C="error");const k=v.fetchStatus==="fetching",m=C==="pending",x=C==="error",T=m&&k,F=w!==void 0,O={status:C,fetchStatus:v.fetchStatus,isPending:m,isSuccess:C==="success",isError:x,isInitialLoading:T,isLoading:T,data:w,dataUpdatedAt:v.dataUpdatedAt,error:y,errorUpdatedAt:E,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:v.dataUpdateCount>f.dataUpdateCount||v.errorUpdateCount>f.errorUpdateCount,isFetching:k,isRefetching:k&&!m,isLoadingError:x&&!F,isPaused:v.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:x&&F,isStale:Tg(e,n),refetch:this.refetch,promise:A(this,qr),isEnabled:Hn(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const M=O.data!==void 0,G=O.status==="error"&&!M,K=Z=>{G?Z.reject(O.error):M&&Z.resolve(O.data)},X=()=>{const Z=te(this,qr,O.promise=t1());K(Z)},ie=A(this,qr);switch(ie.status){case"pending":e.queryHash===r.queryHash&&K(ie);break;case"fulfilled":(G||O.data!==ie.value)&&X();break;case"rejected":(!G||O.error!==ie.reason)&&X();break}}return O}updateResult(){const e=A(this,tn),n=this.createResult(A(this,Re),this.options);if(te(this,Ds,A(this,Re).state),te(this,Jo,this.options),A(this,Ds).data!==void 0&&te(this,ea,A(this,Re)),kd(n,e))return;te(this,tn,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!A(this,ta).size)return!0;const l=new Set(o??A(this,ta));return this.options.throwOnError&&l.add("error"),Object.keys(A(this,tn)).some(u=>{const d=u;return A(this,tn)[d]!==e[d]&&l.has(d)})};Se(this,be,g6).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Se(this,be,o1).call(this)}},pn=new WeakMap,Re=new WeakMap,Jl=new WeakMap,tn=new WeakMap,Ds=new WeakMap,Jo=new WeakMap,qr=new WeakMap,bi=new WeakMap,Zl=new WeakMap,Zo=new WeakMap,ea=new WeakMap,Is=new WeakMap,js=new WeakMap,Di=new WeakMap,ta=new WeakMap,be=new WeakSet,gl=function(e){Se(this,be,u1).call(this);let n=A(this,Re).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(rn)),n},r1=function(){Se(this,be,a1).call(this);const e=Ji(this.options.staleTime,A(this,Re));if(Ql.isServer()||A(this,tn).isStale||!Jp(e))return;const r=a6(A(this,tn).dataUpdatedAt,e)+1;te(this,Is,Ts.setTimeout(()=>{A(this,tn).isStale||this.updateResult()},r))},i1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(A(this,Re)):this.options.refetchInterval)??!1},s1=function(e){Se(this,be,l1).call(this),te(this,Di,e),!(Ql.isServer()||Hn(this.options.enabled,A(this,Re))===!1||!Jp(A(this,Di))||A(this,Di)===0)&&te(this,js,Ts.setInterval(()=>{(this.options.refetchIntervalInBackground||Eg.isFocused())&&Se(this,be,gl).call(this)},A(this,Di)))},o1=function(){Se(this,be,r1).call(this),Se(this,be,s1).call(this,Se(this,be,i1).call(this))},a1=function(){A(this,Is)&&(Ts.clearTimeout(A(this,Is)),te(this,Is,void 0))},l1=function(){A(this,js)&&(Ts.clearInterval(A(this,js)),te(this,js,void 0))},u1=function(){const e=A(this,pn).getQueryCache().build(A(this,pn),this.options);if(e===A(this,Re))return;const n=A(this,Re);te(this,Re,e),te(this,Jl,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},g6=function(e){kt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(A(this,tn))}),A(this,pn).getQueryCache().notify({query:A(this,Re),type:"observerResultsUpdated"})})},F4);function ow(t,e){return Hn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function fv(t,e){return ow(t,e)||t.state.data!==void 0&&c1(t,e,e.refetchOnMount)}function c1(t,e,n){if(Hn(e.enabled,t)!==!1&&Ji(e.staleTime,t)!=="static"){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&Tg(t,e)}return!1}function pv(t,e,n,r){return(t!==e||Hn(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Tg(t,n)}function Tg(t,e){return Hn(e.enabled,t)!==!1&&t.isStaleByTime(Ji(e.staleTime,t))}function aw(t,e){return!kd(t.getCurrentResult(),e)}function gv(t){return{onFetch:(e,n)=>{var g,v,S,w,y;const r=e.options,i=(S=(v=(g=e.fetchOptions)==null?void 0:g.meta)==null?void 0:v.fetchMore)==null?void 0:S.direction,o=((w=e.state.data)==null?void 0:w.pages)||[],l=((y=e.state.data)==null?void 0:y.pageParams)||[];let u={pages:[],pageParams:[]},d=0;const f=async()=>{let E=!1;const C=m=>{Zx(m,()=>e.signal,()=>E=!0)},P=u6(e.options,e.fetchOptions),k=async(m,x,T)=>{if(E)return Promise.reject();if(x==null&&m.pages.length)return Promise.resolve(m);const L=(()=>{const G={client:e.client,queryKey:e.queryKey,pageParam:x,direction:T?"backward":"forward",meta:e.options.meta};return C(G),G})(),O=await P(L),{maxPages:j}=e.options,M=T?Jx:$x;return{pages:M(m.pages,O,j),pageParams:M(m.pageParams,x,j)}};if(i&&o.length){const m=i==="backward",x=m?lw:mv,T={pages:o,pageParams:l},F=x(r,T);u=await k(T,F,m)}else{const m=t??o.length;do{const x=d===0?l[0]??r.initialPageParam:mv(r,u);if(d>0&&x==null)break;u=await k(u,x),d++}while(d<m)}return u};e.options.persister?e.fetchFn=()=>{var E,C;return(C=(E=e.options).persister)==null?void 0:C.call(E,f,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=f}}}function mv(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function lw(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var eu,Rr,Yt,Us,Tr,Pi,A4,uw=(A4=class extends h6{constructor(e){super();ce(this,Tr);ce(this,eu);ce(this,Rr);ce(this,Yt);ce(this,Us);te(this,eu,e.client),this.mutationId=e.mutationId,te(this,Yt,e.mutationCache),te(this,Rr,[]),this.state=e.state||m6(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){A(this,Rr).includes(e)||(A(this,Rr).push(e),this.clearGcTimeout(),A(this,Yt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){te(this,Rr,A(this,Rr).filter(n=>n!==e)),this.scheduleGc(),A(this,Yt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){A(this,Rr).length||(this.state.status==="pending"?this.scheduleGc():A(this,Yt).remove(this))}continue(){var e;return((e=A(this,Us))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var l,u,d,f,g,v,S,w,y,E,C,P,k,m,x,T,F,L;const n=()=>{Se(this,Tr,Pi).call(this,{type:"continue"})},r={client:A(this,eu),meta:this.options.meta,mutationKey:this.options.mutationKey};te(this,Us,d6({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(O,j)=>{Se(this,Tr,Pi).call(this,{type:"failed",failureCount:O,error:j})},onPause:()=>{Se(this,Tr,Pi).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,Yt).canRun(this)}));const i=this.state.status==="pending",o=!A(this,Us).canStart();try{if(i)n();else{Se(this,Tr,Pi).call(this,{type:"pending",variables:e,isPaused:o}),A(this,Yt).config.onMutate&&await A(this,Yt).config.onMutate(e,this,r);const j=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,e,r));j!==this.state.context&&Se(this,Tr,Pi).call(this,{type:"pending",context:j,variables:e,isPaused:o})}const O=await A(this,Us).start();return await((f=(d=A(this,Yt).config).onSuccess)==null?void 0:f.call(d,O,e,this.state.context,this,r)),await((v=(g=this.options).onSuccess)==null?void 0:v.call(g,O,e,this.state.context,r)),await((w=(S=A(this,Yt).config).onSettled)==null?void 0:w.call(S,O,null,this.state.variables,this.state.context,this,r)),await((E=(y=this.options).onSettled)==null?void 0:E.call(y,O,null,e,this.state.context,r)),Se(this,Tr,Pi).call(this,{type:"success",data:O}),O}catch(O){try{await((P=(C=A(this,Yt).config).onError)==null?void 0:P.call(C,O,e,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((m=(k=this.options).onError)==null?void 0:m.call(k,O,e,this.state.context,r))}catch(j){Promise.reject(j)}try{await((T=(x=A(this,Yt).config).onSettled)==null?void 0:T.call(x,void 0,O,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((L=(F=this.options).onSettled)==null?void 0:L.call(F,void 0,O,e,this.state.context,r))}catch(j){Promise.reject(j)}throw Se(this,Tr,Pi).call(this,{type:"error",error:O}),O}finally{A(this,Yt).runNext(this)}}},eu=new WeakMap,Rr=new WeakMap,Yt=new WeakMap,Us=new WeakMap,Tr=new WeakSet,Pi=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),kt.batch(()=>{A(this,Rr).forEach(r=>{r.onMutationUpdate(e)}),A(this,Yt).notify({mutation:this,type:"updated",action:e})})},A4);function m6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yr,lr,tu,M4,cw=(M4=class extends wa{constructor(e={}){super();ce(this,Yr);ce(this,lr);ce(this,tu);this.config=e,te(this,Yr,new Set),te(this,lr,new Map),te(this,tu,0)}build(e,n,r){const i=new uw({client:e,mutationCache:this,mutationId:++dc(this,tu)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){A(this,Yr).add(e);const n=Tc(e);if(typeof n=="string"){const r=A(this,lr).get(n);r?r.push(e):A(this,lr).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(A(this,Yr).delete(e)){const n=Tc(e);if(typeof n=="string"){const r=A(this,lr).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&A(this,lr).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Tc(e);if(typeof n=="string"){const r=A(this,lr).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=Tc(e);if(typeof n=="string"){const i=(r=A(this,lr).get(n))==null?void 0:r.find(o=>o!==e&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{A(this,Yr).forEach(e=>{this.notify({type:"removed",mutation:e})}),A(this,Yr).clear(),A(this,lr).clear()})}getAll(){return Array.from(A(this,Yr))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>lv(n,r))}findAll(e={}){return this.getAll().filter(n=>lv(e,n))}notify(e){kt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return kt.batch(()=>Promise.all(e.map(n=>n.continue().catch(rn))))}},Yr=new WeakMap,lr=new WeakMap,tu=new WeakMap,M4);function Tc(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Xr,Ii,gn,$r,ni,qc,d1,L4,dw=(L4=class extends wa{constructor(n,r){super();ce(this,ni);ce(this,Xr);ce(this,Ii);ce(this,gn);ce(this,$r);te(this,Xr,n),this.setOptions(r),this.bindMethods(),Se(this,ni,qc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=A(this,Xr).defaultMutationOptions(n),kd(this.options,r)||A(this,Xr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:A(this,gn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ys(r.mutationKey)!==Ys(this.options.mutationKey)?this.reset():((i=A(this,gn))==null?void 0:i.state.status)==="pending"&&A(this,gn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=A(this,gn))==null||n.removeObserver(this)}onMutationUpdate(n){Se(this,ni,qc).call(this),Se(this,ni,d1).call(this,n)}getCurrentResult(){return A(this,Ii)}reset(){var n;(n=A(this,gn))==null||n.removeObserver(this),te(this,gn,void 0),Se(this,ni,qc).call(this),Se(this,ni,d1).call(this)}mutate(n,r){var i;return te(this,$r,r),(i=A(this,gn))==null||i.removeObserver(this),te(this,gn,A(this,Xr).getMutationCache().build(A(this,Xr),this.options)),A(this,gn).addObserver(this),A(this,gn).execute(n)}},Xr=new WeakMap,Ii=new WeakMap,gn=new WeakMap,$r=new WeakMap,ni=new WeakSet,qc=function(){var r;const n=((r=A(this,gn))==null?void 0:r.state)??m6();te(this,Ii,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},d1=function(n){kt.batch(()=>{var r,i,o,l,u,d,f,g;if(A(this,$r)&&this.hasListeners()){const v=A(this,Ii).variables,S=A(this,Ii).context,w={client:A(this,Xr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=A(this,$r)).onSuccess)==null||i.call(r,n.data,v,S,w)}catch(y){Promise.reject(y)}try{(l=(o=A(this,$r)).onSettled)==null||l.call(o,n.data,null,v,S,w)}catch(y){Promise.reject(y)}}else if((n==null?void 0:n.type)==="error"){try{(d=(u=A(this,$r)).onError)==null||d.call(u,n.error,v,S,w)}catch(y){Promise.reject(y)}try{(g=(f=A(this,$r)).onSettled)==null||g.call(f,void 0,n.error,v,S,w)}catch(y){Promise.reject(y)}}}this.listeners.forEach(v=>{v(A(this,Ii))})})},L4),Or,b4,hw=(b4=class extends wa{constructor(e={}){super();ce(this,Or);this.config=e,te(this,Or,new Map)}build(e,n,r){const i=n.queryKey,o=n.queryHash??Pg(i,n);let l=this.get(o);return l||(l=new iw({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){A(this,Or).has(e.queryHash)||(A(this,Or).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=A(this,Or).get(e.queryHash);n&&(e.destroy(),n===e&&A(this,Or).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){kt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return A(this,Or).get(e)}getAll(){return[...A(this,Or).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>av(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>av(e,r)):n}notify(e){kt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Or=new WeakMap,b4),lt,ji,Ui,na,ra,zi,ia,sa,D4,fw=(D4=class{constructor(t={}){ce(this,lt);ce(this,ji);ce(this,Ui);ce(this,na);ce(this,ra);ce(this,zi);ce(this,ia);ce(this,sa);te(this,lt,t.queryCache||new hw),te(this,ji,t.mutationCache||new cw),te(this,Ui,t.defaultOptions||{}),te(this,na,new Map),te(this,ra,new Map),te(this,zi,0)}mount(){dc(this,zi)._++,A(this,zi)===1&&(te(this,ia,Eg.subscribe(async t=>{t&&(await this.resumePausedMutations(),A(this,lt).onFocus())})),te(this,sa,Ed.subscribe(async t=>{t&&(await this.resumePausedMutations(),A(this,lt).onOnline())})))}unmount(){var t,e;dc(this,zi)._--,A(this,zi)===0&&((t=A(this,ia))==null||t.call(this),te(this,ia,void 0),(e=A(this,sa))==null||e.call(this),te(this,sa,void 0))}isFetching(t){return A(this,lt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return A(this,ji).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=A(this,lt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=A(this,lt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Ji(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return A(this,lt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=A(this,lt).get(r.queryHash),o=i==null?void 0:i.state.data,l=qx(e,o);if(l!==void 0)return A(this,lt).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(t,e,n){return kt.batch(()=>A(this,lt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=A(this,lt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=A(this,lt);kt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=A(this,lt);return kt.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=kt.batch(()=>A(this,lt).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(rn).catch(rn)}invalidateQueries(t,e={}){return kt.batch(()=>(A(this,lt).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=kt.batch(()=>A(this,lt).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(rn)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(rn)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=A(this,lt).build(this,e);return n.isStaleByTime(Ji(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(rn).catch(rn)}fetchInfiniteQuery(t){return t.behavior=gv(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(rn).catch(rn)}ensureInfiniteQueryData(t){return t.behavior=gv(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ed.isOnline()?A(this,ji).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,lt)}getMutationCache(){return A(this,ji)}getDefaultOptions(){return A(this,Ui)}setDefaultOptions(t){te(this,Ui,t)}setQueryDefaults(t,e){A(this,na).set(Ys(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...A(this,na).values()],n={};return e.forEach(r=>{Kl(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){A(this,ra).set(Ys(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...A(this,ra).values()],n={};return e.forEach(r=>{Kl(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...A(this,Ui).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Pg(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Ng&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...A(this,Ui).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){A(this,lt).clear(),A(this,ji).clear()}},lt=new WeakMap,ji=new WeakMap,Ui=new WeakMap,na=new WeakMap,ra=new WeakMap,zi=new WeakMap,ia=new WeakMap,sa=new WeakMap,D4),y6=W.createContext(void 0),Og=t=>{const e=W.useContext(y6);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},pw=({client:t,children:e})=>(W.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),N.jsx(y6.Provider,{value:t,children:e})),v6=W.createContext(!1),gw=()=>W.useContext(v6);v6.Provider;function mw(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var yw=W.createContext(mw()),vw=()=>W.useContext(yw),Sw=(t,e,n)=>{const r=n!=null&&n.state.error&&typeof t.throwOnError=="function"?Rg(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||r)&&(e.isReset()||(t.retryOnMount=!1))},_w=t=>{W.useEffect(()=>{t.clearReset()},[t])},xw=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(i&&t.data===void 0||Rg(n,[t.error,r])),ww=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Cw=(t,e)=>t.isLoading&&t.isFetching&&!e,kw=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,yv=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Ew(t,e,n){var S,w,y,E;const r=gw(),i=vw(),o=Og(),l=o.defaultQueryOptions(t);(w=(S=o.getDefaultOptions().queries)==null?void 0:S._experimental_beforeQuery)==null||w.call(S,l);const u=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",ww(l),Sw(l,i,u),_w(i);const d=!o.getQueryCache().get(l.queryHash),[f]=W.useState(()=>new e(o,l)),g=f.getOptimisticResult(l),v=!r&&t.subscribed!==!1;if(W.useSyncExternalStore(W.useCallback(C=>{const P=v?f.subscribe(kt.batchCalls(C)):rn;return f.updateResult(),P},[f,v]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),W.useEffect(()=>{f.setOptions(l)},[l,f]),kw(l,g))throw yv(l,f,i);if(xw({result:g,errorResetBoundary:i,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw g.error;if((E=(y=o.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||E.call(y,l,g),l.experimental_prefetchInRender&&!Ql.isServer()&&Cw(g,r)){const C=d?yv(l,f,i):u==null?void 0:u.promise;C==null||C.catch(rn).finally(()=>{f.updateResult()})}return l.notifyOnChangeProps?g:f.trackResult(g)}function S6(t,e){return Ew(t,sw)}function Pw(t,e){const n=Og(),[r]=W.useState(()=>new dw(n,t));W.useEffect(()=>{r.setOptions(t)},[r,t]);const i=W.useSyncExternalStore(W.useCallback(l=>r.subscribe(kt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=W.useCallback((l,u)=>{r.mutate(l,u).catch(rn)},[r]);if(i.error&&Rg(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Nw={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.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Rw=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Dt=(t,e)=>{const n=W.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:o=2,absoluteStrokeWidth:l,className:u="",children:d,...f},g)=>W.createElement("svg",{ref:g,...Nw,width:i,height:i,stroke:r,strokeWidth:l?Number(o)*24/Number(i):o,className:["lucide",`lucide-${Rw(t)}`,u].join(" "),...f},[...e.map(([v,S])=>W.createElement(v,S)),...Array.isArray(d)?d:[d]]));return n.displayName=`${t}`,n};/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Pd=Dt("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Tw=Dt("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ow=Dt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fw=Dt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Aw=Dt("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _6=Dt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Mw=Dt("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Lw=Dt("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fg=Dt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bw=Dt("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Dw=Dt("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Iw=Dt("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jw=Dt("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const x6=Dt("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Uw=Dt("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h1=Dt("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const w6=Dt("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
* @license lucide-react v0.303.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xs=Dt("Wand2",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72Z",key:"1bcowg"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);function zw({covers:t,onSelect:e,onDelete:n}){return t.length===0?N.jsxs("div",{className:"card text-center py-12",children:[N.jsx(Fg,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),N.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"No covers yet"}),N.jsx("p",{className:"text-gray-500 mt-2",children:"Upload a cover image or generate one with AI to get started"})]}):N.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:t.map(r=>N.jsxs("div",{className:"card p-0 overflow-hidden group hover:shadow-lg transition-shadow",children:[N.jsxs("div",{className:"aspect-[2/3] relative bg-gray-100",children:[N.jsx("img",{src:r.url,alt:r.filename,className:"w-full h-full object-cover"}),N.jsxs("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[N.jsx("button",{onClick:()=>e(r.url),className:"p-2 bg-white rounded-lg hover:bg-gray-100 transition-colors",title:"Edit",children:N.jsx(Mw,{className:"w-5 h-5 text-gray-700"})}),N.jsx("button",{onClick:()=>{const i=document.createElement("a");i.href=r.url,i.download=r.filename,i.click()},className:"p-2 bg-white rounded-lg hover:bg-gray-100 transition-colors",title:"Download",children:N.jsx(_6,{className:"w-5 h-5 text-gray-700"})}),N.jsx("button",{onClick:()=>n(r.id),className:"p-2 bg-red-500 rounded-lg hover:bg-red-600 transition-colors",title:"Delete",children:N.jsx(Uw,{className:"w-5 h-5 text-white"})})]})]}),N.jsxs("div",{className:"p-3",children:[N.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:r.filename}),N.jsx("p",{className:"text-xs text-gray-500 mt-1",children:new Date(r.createdAt).toLocaleDateString()})]})]},r.id))})}var C6={exports:{}},$d={},Nd={},xe={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._registerNode=t.Konva=t.glob=void 0;const e=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}t.glob=typeof G2<"u"?G2:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},t.Konva={_global:t.glob,version:"9.3.22",isBrowser:n(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return t.Konva.angleDeg?i*e:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_fixTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return t.Konva.DD.isDragging},isTransforming(){var i;return(i=t.Konva.Transformer)===null||i===void 0?void 0:i.isTransforming()},isDragReady(){return!!t.Konva.DD.node},releaseCanvasOnDestroy:!0,document:t.glob.document,_injectGlobal(i){t.glob.Konva=i}};const r=i=>{t.Konva[i.prototype.getClassName()]=i};t._registerNode=r,t.Konva._injectGlobal(t.Konva)})(xe);var ot={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.Transform=void 0;const e=xe;class n{constructor(x=[1,0,0,1,0,0]){this.dirty=!1,this.m=x&&x.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 n(this.m)}copyInto(x){x.m[0]=this.m[0],x.m[1]=this.m[1],x.m[2]=this.m[2],x.m[3]=this.m[3],x.m[4]=this.m[4],x.m[5]=this.m[5]}point(x){const T=this.m;return{x:T[0]*x.x+T[2]*x.y+T[4],y:T[1]*x.x+T[3]*x.y+T[5]}}translate(x,T){return this.m[4]+=this.m[0]*x+this.m[2]*T,this.m[5]+=this.m[1]*x+this.m[3]*T,this}scale(x,T){return this.m[0]*=x,this.m[1]*=x,this.m[2]*=T,this.m[3]*=T,this}rotate(x){const T=Math.cos(x),F=Math.sin(x),L=this.m[0]*T+this.m[2]*F,O=this.m[1]*T+this.m[3]*F,j=this.m[0]*-F+this.m[2]*T,M=this.m[1]*-F+this.m[3]*T;return this.m[0]=L,this.m[1]=O,this.m[2]=j,this.m[3]=M,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(x,T){const F=this.m[0]+this.m[2]*T,L=this.m[1]+this.m[3]*T,O=this.m[2]+this.m[0]*x,j=this.m[3]+this.m[1]*x;return this.m[0]=F,this.m[1]=L,this.m[2]=O,this.m[3]=j,this}multiply(x){const T=this.m[0]*x.m[0]+this.m[2]*x.m[1],F=this.m[1]*x.m[0]+this.m[3]*x.m[1],L=this.m[0]*x.m[2]+this.m[2]*x.m[3],O=this.m[1]*x.m[2]+this.m[3]*x.m[3],j=this.m[0]*x.m[4]+this.m[2]*x.m[5]+this.m[4],M=this.m[1]*x.m[4]+this.m[3]*x.m[5]+this.m[5];return this.m[0]=T,this.m[1]=F,this.m[2]=L,this.m[3]=O,this.m[4]=j,this.m[5]=M,this}invert(){const x=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),T=this.m[3]*x,F=-this.m[1]*x,L=-this.m[2]*x,O=this.m[0]*x,j=x*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),M=x*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=T,this.m[1]=F,this.m[2]=L,this.m[3]=O,this.m[4]=j,this.m[5]=M,this}getMatrix(){return this.m}decompose(){const x=this.m[0],T=this.m[1],F=this.m[2],L=this.m[3],O=this.m[4],j=this.m[5],M=x*L-T*F,G={x:O,y:j,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(x!=0||T!=0){const K=Math.sqrt(x*x+T*T);G.rotation=T>0?Math.acos(x/K):-Math.acos(x/K),G.scaleX=K,G.scaleY=M/K,G.skewX=(x*F+T*L)/M,G.skewY=0}else if(F!=0||L!=0){const K=Math.sqrt(F*F+L*L);G.rotation=Math.PI/2-(L>0?Math.acos(-F/K):-Math.acos(F/K)),G.scaleX=M/K,G.scaleY=K,G.skewX=0,G.skewY=(x*F+T*L)/M}return G.rotation=t.Util._getRotation(G.rotation),G}}t.Transform=n;const r="[object Array]",i="[object Number]",o="[object String]",l="[object Boolean]",u=Math.PI/180,d=180/Math.PI,f="#",g="",v="0",S="Konva warning: ",w="Konva error: ",y="rgb(",E={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]},C=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let P=[];const k=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(m){setTimeout(m,60)};t.Util={_isElement(m){return!!(m&&m.nodeType==1)},_isFunction(m){return!!(m&&m.constructor&&m.call&&m.apply)},_isPlainObject(m){return!!m&&m.constructor===Object},_isArray(m){return Object.prototype.toString.call(m)===r},_isNumber(m){return Object.prototype.toString.call(m)===i&&!isNaN(m)&&isFinite(m)},_isString(m){return Object.prototype.toString.call(m)===o},_isBoolean(m){return Object.prototype.toString.call(m)===l},isObject(m){return m instanceof Object},isValidSelector(m){if(typeof m!="string")return!1;const x=m[0];return x==="#"||x==="."||x===x.toUpperCase()},_sign(m){return m===0||m>0?1:-1},requestAnimFrame(m){P.push(m),P.length===1&&k(function(){const x=P;P=[],x.forEach(function(T){T()})})},createCanvasElement(){const m=document.createElement("canvas");try{m.style=m.style||{}}catch{}return m},createImageElement(){return document.createElement("img")},_isInDocument(m){for(;m=m.parentNode;)if(m==document)return!0;return!1},_urlToImage(m,x){const T=t.Util.createImageElement();T.onload=function(){x(T)},T.src=m},_rgbToHex(m,x,T){return((1<<24)+(m<<16)+(x<<8)+T).toString(16).slice(1)},_hexToRgb(m){m=m.replace(f,g);const x=parseInt(m,16);return{r:x>>16&255,g:x>>8&255,b:x&255}},getRandomColor(){let m=(Math.random()*16777215<<0).toString(16);for(;m.length<6;)m=v+m;return f+m},getRGB(m){let x;return m in E?(x=E[m],{r:x[0],g:x[1],b:x[2]}):m[0]===f?this._hexToRgb(m.substring(1)):m.substr(0,4)===y?(x=C.exec(m.replace(/ /g,"")),{r:parseInt(x[1],10),g:parseInt(x[2],10),b:parseInt(x[3],10)}):{r:0,g:0,b:0}},colorToRGBA(m){return m=m||"black",t.Util._namedColorToRBA(m)||t.Util._hex3ColorToRGBA(m)||t.Util._hex4ColorToRGBA(m)||t.Util._hex6ColorToRGBA(m)||t.Util._hex8ColorToRGBA(m)||t.Util._rgbColorToRGBA(m)||t.Util._rgbaColorToRGBA(m)||t.Util._hslColorToRGBA(m)},_namedColorToRBA(m){const x=E[m.toLowerCase()];return x?{r:x[0],g:x[1],b:x[2],a:1}:null},_rgbColorToRGBA(m){if(m.indexOf("rgb(")===0){m=m.match(/rgb\(([^)]+)\)/)[1];const x=m.split(/ *, */).map(Number);return{r:x[0],g:x[1],b:x[2],a:1}}},_rgbaColorToRGBA(m){if(m.indexOf("rgba(")===0){m=m.match(/rgba\(([^)]+)\)/)[1];const x=m.split(/ *, */).map((T,F)=>T.slice(-1)==="%"?F===3?parseInt(T)/100:parseInt(T)/100*255:Number(T));return{r:x[0],g:x[1],b:x[2],a:x[3]}}},_hex8ColorToRGBA(m){if(m[0]==="#"&&m.length===9)return{r:parseInt(m.slice(1,3),16),g:parseInt(m.slice(3,5),16),b:parseInt(m.slice(5,7),16),a:parseInt(m.slice(7,9),16)/255}},_hex6ColorToRGBA(m){if(m[0]==="#"&&m.length===7)return{r:parseInt(m.slice(1,3),16),g:parseInt(m.slice(3,5),16),b:parseInt(m.slice(5,7),16),a:1}},_hex4ColorToRGBA(m){if(m[0]==="#"&&m.length===5)return{r:parseInt(m[1]+m[1],16),g:parseInt(m[2]+m[2],16),b:parseInt(m[3]+m[3],16),a:parseInt(m[4]+m[4],16)/255}},_hex3ColorToRGBA(m){if(m[0]==="#"&&m.length===4)return{r:parseInt(m[1]+m[1],16),g:parseInt(m[2]+m[2],16),b:parseInt(m[3]+m[3],16),a:1}},_hslColorToRGBA(m){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(m)){const[x,...T]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(m),F=Number(T[0])/360,L=Number(T[1])/100,O=Number(T[2])/100;let j,M,G;if(L===0)return G=O*255,{r:Math.round(G),g:Math.round(G),b:Math.round(G),a:1};O<.5?j=O*(1+L):j=O+L-O*L;const K=2*O-j,X=[0,0,0];for(let ie=0;ie<3;ie++)M=F+1/3*-(ie-1),M<0&&M++,M>1&&M--,6*M<1?G=K+(j-K)*6*M:2*M<1?G=j:3*M<2?G=K+(j-K)*(2/3-M)*6:G=K,X[ie]=G*255;return{r:Math.round(X[0]),g:Math.round(X[1]),b:Math.round(X[2]),a:1}}},haveIntersection(m,x){return!(x.x>m.x+m.width||x.x+x.width<m.x||x.y>m.y+m.height||x.y+x.height<m.y)},cloneObject(m){const x={};for(const T in m)this._isPlainObject(m[T])?x[T]=this.cloneObject(m[T]):this._isArray(m[T])?x[T]=this.cloneArray(m[T]):x[T]=m[T];return x},cloneArray(m){return m.slice(0)},degToRad(m){return m*u},radToDeg(m){return m*d},_degToRad(m){return t.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),t.Util.degToRad(m)},_radToDeg(m){return t.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),t.Util.radToDeg(m)},_getRotation(m){return e.Konva.angleDeg?t.Util.radToDeg(m):m},_capitalize(m){return m.charAt(0).toUpperCase()+m.slice(1)},throw(m){throw new Error(w+m)},error(m){console.error(w+m)},warn(m){e.Konva.showWarnings&&console.warn(S+m)},each(m,x){for(const T in m)x(T,m[T])},_inRange(m,x,T){return x<=m&&m<T},_getProjectionToSegment(m,x,T,F,L,O){let j,M,G;const K=(m-T)*(m-T)+(x-F)*(x-F);if(K==0)j=m,M=x,G=(L-T)*(L-T)+(O-F)*(O-F);else{const X=((L-m)*(T-m)+(O-x)*(F-x))/K;X<0?(j=m,M=x,G=(m-L)*(m-L)+(x-O)*(x-O)):X>1?(j=T,M=F,G=(T-L)*(T-L)+(F-O)*(F-O)):(j=m+X*(T-m),M=x+X*(F-x),G=(j-L)*(j-L)+(M-O)*(M-O))}return[j,M,G]},_getProjectionToLine(m,x,T){const F=t.Util.cloneObject(m);let L=Number.MAX_VALUE;return x.forEach(function(O,j){if(!T&&j===x.length-1)return;const M=x[(j+1)%x.length],G=t.Util._getProjectionToSegment(O.x,O.y,M.x,M.y,m.x,m.y),K=G[0],X=G[1],ie=G[2];ie<L&&(F.x=K,F.y=X,L=ie)}),F},_prepareArrayForTween(m,x,T){const F=[],L=[];if(m.length>x.length){const j=x;x=m,m=j}for(let j=0;j<m.length;j+=2)F.push({x:m[j],y:m[j+1]});for(let j=0;j<x.length;j+=2)L.push({x:x[j],y:x[j+1]});const O=[];return L.forEach(function(j){const M=t.Util._getProjectionToLine(j,F,T);O.push(M.x),O.push(M.y)}),O},_prepareToStringify(m){let x;m.visitedByCircularReferenceRemoval=!0;for(const T in m)if(m.hasOwnProperty(T)&&m[T]&&typeof m[T]=="object"){if(x=Object.getOwnPropertyDescriptor(m,T),m[T].visitedByCircularReferenceRemoval||t.Util._isElement(m[T]))if(x.configurable)delete m[T];else return null;else if(t.Util._prepareToStringify(m[T])===null)if(x.configurable)delete m[T];else return null}return delete m.visitedByCircularReferenceRemoval,m},_assign(m,x){for(const T in x)m[T]=x[T];return m},_getFirstPointerId(m){return m.touches?m.changedTouches[0].identifier:m.pointerId||999},releaseCanvas(...m){e.Konva.releaseCanvasOnDestroy&&m.forEach(x=>{x.width=0,x.height=0})},drawRoundedRectPath(m,x,T,F){let L=0,O=0,j=0,M=0;typeof F=="number"?L=O=j=M=Math.min(F,x/2,T/2):(L=Math.min(F[0]||0,x/2,T/2),O=Math.min(F[1]||0,x/2,T/2),M=Math.min(F[2]||0,x/2,T/2),j=Math.min(F[3]||0,x/2,T/2)),m.moveTo(L,0),m.lineTo(x-O,0),m.arc(x-O,O,O,Math.PI*3/2,0,!1),m.lineTo(x,T-M),m.arc(x-M,T-M,M,0,Math.PI/2,!1),m.lineTo(j,T),m.arc(j,T-j,j,Math.PI/2,Math.PI,!1),m.lineTo(0,L),m.arc(L,L,L,Math.PI,Math.PI*3/2,!1)}}})(ot);var et={},fr={},ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.HitContext=ti.SceneContext=ti.Context=void 0;const k6=ot,Bw=xe;function Gw(t){const e=[],n=t.length,r=k6.Util;for(let i=0;i<n;i++){let o=t[i];r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),e.push(o)}return e}const vv=",",Hw="(",Vw=")",Ww="([",Kw="])",Qw=";",qw="()",Yw="=",Sv=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],Xw=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"],$w=100;class Jd{constructor(e){this.canvas=e,Bw.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let r=this.traceArr,i=r.length,o="",l,u,d,f;for(l=0;l<i;l++)u=r[l],d=u.method,d?(f=u.args,o+=d,e?o+=qw:k6.Util._isArray(f[0])?o+=Ww+f.join(vv)+Kw:(n&&(f=f.map(g=>typeof g=="number"?Math.floor(g):g)),o+=Hw+f.join(vv)+Vw)):(o+=u.property,e||(o+=Yw+u.val)),o+=Qw;return o}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,r;n.push(e),r=n.length,r>=$w&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(e,n){this._context[e]=n}arc(e,n,r,i,o,l){this._context.arc(e,n,r,i,o,l)}arcTo(e,n,r,i,o){this._context.arcTo(e,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,r,i,o,l){this._context.bezierCurveTo(e,n,r,i,o,l)}clearRect(e,n,r,i){this._context.clearRect(e,n,r,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const r=arguments;if(r.length===2)return this._context.createImageData(e,n);if(r.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,r,i){return this._context.createLinearGradient(e,n,r,i)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,r,i,o,l){return this._context.createRadialGradient(e,n,r,i,o,l)}drawImage(e,n,r,i,o,l,u,d,f){const g=arguments,v=this._context;g.length===3?v.drawImage(e,n,r):g.length===5?v.drawImage(e,n,r,i,o):g.length===9&&v.drawImage(e,n,r,i,o,l,u,d,f)}ellipse(e,n,r,i,o,l,u,d){this._context.ellipse(e,n,r,i,o,l,u,d)}isPointInPath(e,n,r,i){return r?this._context.isPointInPath(r,e,n,i):this._context.isPointInPath(e,n,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,r,i){this._context.fillRect(e,n,r,i)}strokeRect(e,n,r,i){this._context.strokeRect(e,n,r,i)}fillText(e,n,r,i){i?this._context.fillText(e,n,r,i):this._context.fillText(e,n,r)}measureText(e){return this._context.measureText(e)}getImageData(e,n,r,i){return this._context.getImageData(e,n,r,i)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,r,i){this._context.rect(e,n,r,i)}roundRect(e,n,r,i,o){this._context.roundRect(e,n,r,i,o)}putImageData(e,n,r){this._context.putImageData(e,n,r)}quadraticCurveTo(e,n,r,i){this._context.quadraticCurveTo(e,n,r,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,r,i,o,l){this._context.setTransform(e,n,r,i,o,l)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,r,i){this._context.strokeText(e,n,r,i)}transform(e,n,r,i,o,l){this._context.transform(e,n,r,i,o,l)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=Sv.length,r=this.setAttr,i,o;const l=function(u){let d=e[u],f;e[u]=function(){return o=Gw(Array.prototype.slice.call(arguments,0)),f=d.apply(e,arguments),e._trace({method:u,args:o}),f}};for(i=0;i<n;i++)l(Sv[i]);e.setAttr=function(){r.apply(e,arguments);const u=arguments[0];let d=arguments[1];(u==="shadowOffsetX"||u==="shadowOffsetY"||u==="shadowBlur")&&(d=d/this.canvas.getPixelRatio()),e._trace({property:u,val:d})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}ti.Context=Jd;Xw.forEach(function(t){Object.defineProperty(Jd.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class Jw extends Jd{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),r=e.getFillPriority();if(n&&r==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(e);return}const o=e.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(e);return}const l=e.getFillRadialGradientColorStops();if(l&&r==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):i?this._fillPattern(e):o?this._fillLinearGradient(e):l&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),r=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(let l=0;l<i.length;l+=2)o.addColorStop(i[l],i[l+1]);this.setAttr("strokeStyle",o)}}_stroke(e){const n=e.dash(),r=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!r){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),r||this.restore()}}_applyShadow(e){var n,r,i;const o=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",l=(r=e.getShadowBlur())!==null&&r!==void 0?r:5,u=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},d=e.getAbsoluteScale(),f=this.canvas.getPixelRatio(),g=d.x*f,v=d.y*f;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",l*Math.min(Math.abs(g),Math.abs(v))),this.setAttr("shadowOffsetX",u.x*g),this.setAttr("shadowOffsetY",u.y*v)}}ti.SceneContext=Jw;class Zw extends Jd{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e);const r=e.hitStrokeWidth(),i=r==="auto"?e.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}ti.HitContext=Zw;Object.defineProperty(fr,"__esModule",{value:!0});fr.HitCanvas=fr.SceneCanvas=fr.Canvas=void 0;const Rd=ot,E6=ti,P6=xe;let Oc;function eC(){if(Oc)return Oc;const t=Rd.Util.createCanvasElement(),e=t.getContext("2d");return Oc=function(){const n=P6.Konva._global.devicePixelRatio||1,r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/r}(),Rd.Util.releaseCanvas(t),Oc}class Ag{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const r=(e||{}).pixelRatio||P6.Konva.pixelRatio||eC();this.pixelRatio=r,this._canvas=Rd.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(i){return Rd.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}fr.Canvas=Ag;class tC extends Ag{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new E6.SceneContext(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}fr.SceneCanvas=tC;class nC extends Ag{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new E6.HitContext(this),this.setSize(e.width,e.height)}}fr.HitCanvas=nC;var Zd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DD=void 0;const e=xe,n=ot;t.DD={get isDragging(){let r=!1;return t.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){let r;return t.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];t.DD._dragElements.forEach((o,l)=>{const{node:u}=o,d=u.getStage();d.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const f=d._changedPointerPositions.find(g=>g.id===o.pointerId);if(f){if(o.dragStatus!=="dragging"){const g=u.dragDistance();if(Math.max(Math.abs(f.x-o.startPointerPos.x),Math.abs(f.y-o.startPointerPos.y))<g||(u.startDrag({evt:r}),!u.isDragging()))return}u._setDragPosition(r,o),i.push(u)}}),i.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const i=[];t.DD._dragElements.forEach(o=>{const{node:l}=o,u=l.getStage();if(r&&u.setPointersPositions(r),!u._changedPointerPositions.find(g=>g.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(t.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,o.dragStatus="stopped");const f=o.node.getLayer()||o.node instanceof e.Konva.Stage&&o.node;f&&i.indexOf(f)===-1&&i.push(f)}),i.forEach(o=>{o.draw()})},_endDragAfter(r){t.DD._dragElements.forEach((i,o)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:r},!0),i.dragStatus!=="dragging"&&t.DD._dragElements.delete(o)})}},e.Konva.isBrowser&&(window.addEventListener("mouseup",t.DD._endDragBefore,!0),window.addEventListener("touchend",t.DD._endDragBefore,!0),window.addEventListener("touchcancel",t.DD._endDragBefore,!0),window.addEventListener("mousemove",t.DD._drag),window.addEventListener("touchmove",t.DD._drag),window.addEventListener("mouseup",t.DD._endDragAfter,!1),window.addEventListener("touchend",t.DD._endDragAfter,!1),window.addEventListener("touchcancel",t.DD._endDragAfter,!1))})(Zd);var Ce={},pe={};Object.defineProperty(pe,"__esModule",{value:!0});pe.RGBComponent=rC;pe.alphaComponent=iC;pe.getNumberValidator=sC;pe.getNumberOrArrayOfNumbersValidator=oC;pe.getNumberOrAutoValidator=aC;pe.getStringValidator=lC;pe.getStringOrGradientValidator=uC;pe.getFunctionValidator=cC;pe.getNumberArrayValidator=dC;pe.getBooleanValidator=hC;pe.getComponentValidator=fC;const li=xe,ct=ot;function ui(t){return ct.Util._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||ct.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}function rC(t){return t>255?255:t<0?0:Math.round(t)}function iC(t){return t>1?1:t<1e-4?1e-4:t}function sC(){if(li.Konva.isUnminified)return function(t,e){return ct.Util._isNumber(t)||ct.Util.warn(ui(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function oC(t){if(li.Konva.isUnminified)return function(e,n){let r=ct.Util._isNumber(e),i=ct.Util._isArray(e)&&e.length==t;return!r&&!i&&ct.Util.warn(ui(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function aC(){if(li.Konva.isUnminified)return function(t,e){return ct.Util._isNumber(t)||t==="auto"||ct.Util.warn(ui(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function lC(){if(li.Konva.isUnminified)return function(t,e){return ct.Util._isString(t)||ct.Util.warn(ui(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function uC(){if(li.Konva.isUnminified)return function(t,e){const n=ct.Util._isString(t),r=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||r||ct.Util.warn(ui(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function cC(){if(li.Konva.isUnminified)return function(t,e){return ct.Util._isFunction(t)||ct.Util.warn(ui(t)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),t}}function dC(){if(li.Konva.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(ct.Util._isArray(t)?t.forEach(function(r){ct.Util._isNumber(r)||ct.Util.warn('"'+e+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):ct.Util.warn(ui(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function hC(){if(li.Konva.isUnminified)return function(t,e){return t===!0||t===!1||ct.Util.warn(ui(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function fC(t){if(li.Konva.isUnminified)return function(e,n){return e==null||ct.Util.isObject(e)||ct.Util.warn(ui(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Factory=void 0;const e=ot,n=pe,r="get",i="set";t.Factory={addGetterSetter(o,l,u,d,f){t.Factory.addGetter(o,l,u),t.Factory.addSetter(o,l,d,f),t.Factory.addOverloadedGetterSetter(o,l)},addGetter(o,l,u){const d=r+e.Util._capitalize(l);o.prototype[d]=o.prototype[d]||function(){const f=this.attrs[l];return f===void 0?u:f}},addSetter(o,l,u,d){const f=i+e.Util._capitalize(l);o.prototype[f]||t.Factory.overWriteSetter(o,l,u,d)},overWriteSetter(o,l,u,d){const f=i+e.Util._capitalize(l);o.prototype[f]=function(g){return u&&g!==void 0&&g!==null&&(g=u.call(this,g,l)),this._setAttr(l,g),d&&d.call(this),this}},addComponentsGetterSetter(o,l,u,d,f){const g=u.length,v=e.Util._capitalize,S=r+v(l),w=i+v(l);o.prototype[S]=function(){const E={};for(let C=0;C<g;C++){const P=u[C];E[P]=this.getAttr(l+v(P))}return E};const y=(0,n.getComponentValidator)(u);o.prototype[w]=function(E){const C=this.attrs[l];d&&(E=d.call(this,E,l)),y&&y.call(this,E,l);for(const P in E)E.hasOwnProperty(P)&&this._setAttr(l+v(P),E[P]);return E||u.forEach(P=>{this._setAttr(l+v(P),void 0)}),this._fireChangeEvent(l,C,E),f&&f.call(this),this},t.Factory.addOverloadedGetterSetter(o,l)},addOverloadedGetterSetter(o,l){const u=e.Util._capitalize(l),d=i+u,f=r+u;o.prototype[l]=function(){return arguments.length?(this[d](arguments[0]),this):this[f]()}},addDeprecatedGetterSetter(o,l,u,d){e.Util.error("Adding deprecated "+l);const f=r+e.Util._capitalize(l),g=l+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[f]=function(){e.Util.error(g);const v=this.attrs[l];return v===void 0?u:v},t.Factory.addSetter(o,l,d,function(){e.Util.error(g)}),t.Factory.addOverloadedGetterSetter(o,l)},backCompat(o,l){e.Util.each(l,function(u,d){const f=o.prototype[d],g=r+e.Util._capitalize(u),v=i+e.Util._capitalize(u);function S(){f.apply(this,arguments),e.Util.error('"'+u+'" method is deprecated and will be removed soon. Use ""'+d+'" instead.')}o.prototype[u]=S,o.prototype[g]=S,o.prototype[v]=S})},afterSetFilter(){this._filterUpToDate=!1}}})(Ce);Object.defineProperty(et,"__esModule",{value:!0});et.Node=void 0;const Po=fr,zn=Zd,uu=Ce,Ei=xe,Pe=ot,gt=pe,Yc="absoluteOpacity",Fc="allEventListeners",Wr="absoluteTransform",_v="absoluteScale",ws="canvas",pC="Change",gC="children",mC="konva",f1="listening",yC="mouseenter",vC="mouseleave",SC="pointerenter",_C="pointerleave",xC="touchenter",wC="touchleave",xv="set",wv="Shape",Xc=" ",Cv="stage",Ni="transform",CC="Stage",p1="visible",kC=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Xc);let EC=1;class ge{constructor(e){this._id=EC++,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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===Ni||e===Wr)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let r=this._cache.get(e);return(r===void 0||(e===Ni||e===Wr)&&r.dirty===!0)&&(r=n.call(this),this._cache.set(e,r)),r}_calculate(e,n,r){if(!this._attachedDepsListeners.get(e)){const i=n.map(o=>o+"Change.konva").join(Xc);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,r)}_getCanvasCache(){return this._cache.get(ws)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===Wr&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(ws)){const{scene:e,filter:n,hit:r,buffer:i}=this._cache.get(ws);Pe.Util.releaseCanvas(e,n,r,i),this._cache.delete(ws)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||r.width),o=Math.ceil(n.height||r.height),l=n.pixelRatio,u=n.x===void 0?Math.floor(r.x):n.x,d=n.y===void 0?Math.floor(r.y):n.y,f=n.offset||0,g=n.drawBorder||!1,v=n.hitCanvasPixelRatio||1;if(!i||!o){Pe.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const S=Math.abs(Math.round(r.x)-u)>.5?1:0,w=Math.abs(Math.round(r.y)-d)>.5?1:0;i+=f*2+S,o+=f*2+w,u-=f,d-=f;const y=new Po.SceneCanvas({pixelRatio:l,width:i,height:o}),E=new Po.SceneCanvas({pixelRatio:l,width:0,height:0,willReadFrequently:!0}),C=new Po.HitCanvas({pixelRatio:v,width:i,height:o}),P=y.getContext(),k=C.getContext(),m=new Po.SceneCanvas({width:y.width/y.pixelRatio+Math.abs(u),height:y.height/y.pixelRatio+Math.abs(d),pixelRatio:y.pixelRatio}),x=m.getContext();return C.isCache=!0,y.isCache=!0,this._cache.delete(ws),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(y.getContext()._context.imageSmoothingEnabled=!1,E.getContext()._context.imageSmoothingEnabled=!1),P.save(),k.save(),x.save(),P.translate(-u,-d),k.translate(-u,-d),x.translate(-u,-d),m.x=u,m.y=d,this._isUnderCache=!0,this._clearSelfAndDescendantCache(Yc),this._clearSelfAndDescendantCache(_v),this.drawScene(y,this,m),this.drawHit(C,this),this._isUnderCache=!1,P.restore(),k.restore(),g&&(P.save(),P.beginPath(),P.rect(0,0,i,o),P.closePath(),P.setAttr("strokeStyle","red"),P.setAttr("lineWidth",5),P.stroke(),P.restore()),this._cache.set(ws,{scene:y,filter:E,hit:C,buffer:m,x:u,y:d}),this._requestDraw(),this}isCached(){return this._cache.has(ws)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const r=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,o=1/0,l=-1/0,u=-1/0;const d=this.getAbsoluteTransform(n);return r.forEach(function(f){const g=d.point(f);i===void 0&&(i=l=g.x,o=u=g.y),i=Math.min(i,g.x),o=Math.min(o,g.y),l=Math.max(l,g.x),u=Math.max(u,g.y)}),{x:i,y:o,width:l-i,height:u-o}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const r=this._getCachedSceneCanvas(),i=r.pixelRatio;e.drawImage(r._canvas,0,0,r.width/i,r.height/i),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),r=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),l,u,d,f;if(e){if(!this._filterUpToDate){const g=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(l=e.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/g,r.getHeight()/g),u=o.getImageData(0,0,i.getWidth(),i.getHeight()),d=0;d<l;d++){if(f=e[d],typeof f!="function"){Pe.Util.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,u),o.putImageData(u,0,0)}}catch(v){Pe.Util.error("Unable to apply filter. "+v.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return r}on(e,n){if(this._cache&&this._cache.delete(Fc),arguments.length===3)return this._delegate.apply(this,arguments);const r=e.split(Xc);for(let i=0;i<r.length;i++){const l=r[i].split("."),u=l[0],d=l[1]||"";this.eventListeners[u]||(this.eventListeners[u]=[]),this.eventListeners[u].push({name:d,handler:n})}return this}off(e,n){let r=(e||"").split(Xc),i=r.length,o,l,u,d,f,g;if(this._cache&&this._cache.delete(Fc),!e)for(l in this.eventListeners)this._off(l);for(o=0;o<i;o++)if(u=r[o],d=u.split("."),f=d[0],g=d[1],f)this.eventListeners[f]&&this._off(f,g,n);else for(l in this.eventListeners)this._off(l,g,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(r){n.call(this,r.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,r){const i=this;this.on(e,function(o){const l=o.target.findAncestors(n,!0,i);for(let u=0;u<l.length;u++)o=Pe.Util.cloneObject(o),o.currentTarget=l[u],r.call(l[u],o)})}remove(){return this.isDragging()&&this.stopDrag(),zn.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Wr),this._clearSelfAndDescendantCache(Yc),this._clearSelfAndDescendantCache(_v),this._clearSelfAndDescendantCache(Cv),this._clearSelfAndDescendantCache(p1),this._clearSelfAndDescendantCache(f1)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+Pe.Util._capitalize(e);return Pe.Util._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,r;if(!e)return this;for(n in e)n!==gC&&(r=xv+Pe.Util._capitalize(n),Pe.Util._isFunction(this[r])?this[r](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(f1,this._isListening)}_isListening(e){if(!this.listening())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isListening(e):!0}isVisible(){return this._getCache(p1,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const r=this.getParent();return r&&r!==e&&this!==e?r._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const r=this.getLayer();let i=!1;zn.DD._dragElements.forEach(l=>{l.dragStatus==="dragging"&&(l.node.nodeType==="Stage"||l.node.getLayer()===r)&&(i=!0)});const o=!n&&!Ei.Konva.hitOnDragEnabled&&(i||Ei.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,r=0,i,o,l,u;function d(g){for(i=[],o=g.length,l=0;l<o;l++)u=g[l],r++,u.nodeType!==wv&&(i=i.concat(u.getChildren().slice())),u._id===n._id&&(l=o);i.length>0&&i[0].getDepth()<=e&&d(i)}const f=this.getStage();return n.nodeType!==CC&&f&&d(f.getChildren()),r}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(Ni),this._clearSelfAndDescendantCache(Wr)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(e){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),o=new Pe.Transform,l=this.offset();return o.m=i.slice(),o.translate(l.x,l.y),o.getTranslation()}setAbsolutePosition(e){const{x:n,y:r,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(Ni);const o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(e.x,e.y),e={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(Ni),this._clearSelfAndDescendantCache(Wr),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={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,e}move(e){let n=e.x,r=e.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(e,n){let r=[],i=this.getParent(),o,l;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,l=0;l<o;l++)e(r[l])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return Pe.Util.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return Pe.Util.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return Pe.Util.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return Pe.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return Pe.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&Pe.Util.warn("Unexpected value "+e+" 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 n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Yc,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,r,i,o,l;const u={attrs:{},className:this.getClassName()};for(n in e)r=e[n],l=Pe.Util.isObject(r)&&!Pe.Util._isPlainObject(r)&&!Pe.Util._isArray(r),!l&&(i=typeof this[n]=="function"&&this[n],delete e[n],o=i?i.call(this):null,e[n]=r,o!==r&&(u.attrs[n]=r));return Pe.Util._prepareToStringify(u)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,r){const i=[];n&&this._isMatch(e)&&i.push(this);let o=this.parent;for(;o;){if(o===r)return i;o._isMatch(e)&&i.push(o),o=o.parent}return i}isAncestorOf(e){return!1}findAncestor(e,n,r){return this.findAncestors(e,n,r)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i<r;i++)if(o=n[i],Pe.Util.isValidSelector(o)||(Pe.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),Pe.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),Pe.Util.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(Cv,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},r){return n.target=n.target||this,r?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(Wr,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new Pe.Transform,this._eachAncestorReverse(function(r){const i=r.transformsEnabled();i==="all"?n.multiply(r.getTransform()):i==="position"&&n.translate(r.x()-r.offsetX(),r.y()-r.offsetY())},e),n;{n=this._cache.get(Wr)||new Pe.Transform,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,l=this.attrs.offsetX||0,u=this.attrs.offsetY||0;n.translate(i-l,o-u)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(Ni,this._getTransform)}_getTransform(){var e,n;const r=this._cache.get(Ni)||new Pe.Transform;r.reset();const i=this.x(),o=this.y(),l=Ei.Konva.getAngle(this.rotation()),u=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,d=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,f=this.attrs.skewX||0,g=this.attrs.skewY||0,v=this.attrs.offsetX||0,S=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),l!==0&&r.rotate(l),(f!==0||g!==0)&&r.skew(f,g),(u!==1||d!==1)&&r.scale(u,d),(v!==0||S!==0)&&r.translate(-1*v,-1*S),r.dirty=!1,r}clone(e){let n=Pe.Util.cloneObject(this.attrs),r,i,o,l,u;for(r in e)n[r]=e[r];const d=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],o=i.length,l=0;l<o;l++)u=i[l],u.name.indexOf(mC)<0&&(d.eventListeners[r]||(d.eventListeners[r]=[]),d.eventListeners[r].push(u));return d}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),r=this.getStage(),i=e.x!==void 0?e.x:Math.floor(n.x),o=e.y!==void 0?e.y:Math.floor(n.y),l=e.pixelRatio||1,u=new Po.SceneCanvas({width:e.width||Math.ceil(n.width)||(r?r.width():0),height:e.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:l}),d=u.getContext(),f=new Po.SceneCanvas({width:u.width/u.pixelRatio+Math.abs(i),height:u.height/u.pixelRatio+Math.abs(o),pixelRatio:u.pixelRatio});return e.imageSmoothingEnabled===!1&&(d._context.imageSmoothingEnabled=!1),d.save(),(i||o)&&d.translate(-1*i,-1*o),this.drawScene(u,void 0,f),d.restore(),u}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,r=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(n,r);return e.callback&&e.callback(i),i}toImage(e){return new Promise((n,r)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,Pe.Util._urlToImage(this.toDataURL(e),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(e){return new Promise((n,r)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,this.toCanvas(e).toBlob(o=>{n(o),i==null||i(o)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(i){r(i)}})}setSize(e){return this.width(e.width),this.height(e.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():Ei.Konva.dragDistance}_off(e,n,r){let i=this.eventListeners[e],o,l,u;for(o=0;o<i.length;o++)if(l=i[o].name,u=i[o].handler,(l!=="konva"||n==="konva")&&(!n||l===n)&&(!r||r===u)){if(i.splice(o,1),i.length===0){delete this.eventListeners[e];break}o--}}_fireChangeEvent(e,n,r){this._fire(e+pC,{oldVal:n,newVal:r})}addName(e){if(!this.hasName(e)){const n=this.name(),r=n?n+" "+e:e;this.name(r)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),r=n.indexOf(e);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(e,n){const r=this[xv+Pe.Util._capitalize(e)];return Pe.Util._isFunction(r)?r.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(Ei.Konva.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){const r=this.attrs[e];r===n&&!Pe.Util.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,r,n),this._requestDraw())}_setComponentAttr(e,n,r){let i;r!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=r,this._fireChangeEvent(e,i,r))}_fireAndBubble(e,n,r){n&&this.nodeType===wv&&(n.target=this);const i=[yC,vC,SC,_C,xC,wC];if(!(i.indexOf(e)!==-1&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r))){this._fire(e,n);const l=i.indexOf(e)!==-1&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!l&&(r&&r.parent?this._fireAndBubble.call(this.parent,e,n,r):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,r,i;const o=(n=this._cache.get(Fc))!==null&&n!==void 0?n:{};let l=o==null?void 0:o[e];if(l===void 0){l=[];let u=Object.getPrototypeOf(this);for(;u;){const d=(i=(r=u.eventListeners)===null||r===void 0?void 0:r[e])!==null&&i!==void 0?i:[];l.push(...d),u=Object.getPrototypeOf(u)}o[e]=l,this._cache.set(Fc,o)}return l}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const r=this._getProtoListeners(e);if(r)for(let o=0;o<r.length;o++)r[o].handler.call(this,n);const i=this.eventListeners[e];if(i)for(let o=0;o<i.length;o++)i[o].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition();if(!r)return;const o=r._getPointerById(n)||r._changedPointerPositions[0]||i;zn.DD._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(e,n=!0){zn.DD._dragElements.has(this._id)||this._createDragElement(e);const r=zn.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},n)}_setDragPosition(e,n){const r=this.getStage()._getPointerById(n.pointerId);if(!r)return;let i={x:r.x-n.offset.x,y:r.y-n.offset.y};const o=this.dragBoundFunc();if(o!==void 0){const l=o.call(this,i,e);l?i=l:Pe.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const n=zn.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),zn.DD._endDragBefore(e),zn.DD._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=zn.DD._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||Ei.Konva.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;zn.DD._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=zn.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&zn.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return Pe.Util.haveIntersection(r,this.getClientRect())}static create(e,n){return Pe.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let r=ge.prototype.getClassName.call(e),i=e.children,o,l,u;n&&(e.attrs.container=n),Ei.Konva[r]||(Pe.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const d=Ei.Konva[r];if(o=new d(e.attrs),i)for(l=i.length,u=0;u<l;u++)o.add(ge._createNode(i[u]));return o}}et.Node=ge;ge.prototype.nodeType="Node";ge.prototype._attrsAffectingSize=[];ge.prototype.eventListeners={};ge.prototype.on.call(ge.prototype,kC,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(Ni),this._clearSelfAndDescendantCache(Wr)});ge.prototype.on.call(ge.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(p1)});ge.prototype.on.call(ge.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(f1)});ge.prototype.on.call(ge.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(Yc)});const Be=uu.Factory.addGetterSetter;Be(ge,"zIndex");Be(ge,"absolutePosition");Be(ge,"position");Be(ge,"x",0,(0,gt.getNumberValidator)());Be(ge,"y",0,(0,gt.getNumberValidator)());Be(ge,"globalCompositeOperation","source-over",(0,gt.getStringValidator)());Be(ge,"opacity",1,(0,gt.getNumberValidator)());Be(ge,"name","",(0,gt.getStringValidator)());Be(ge,"id","",(0,gt.getStringValidator)());Be(ge,"rotation",0,(0,gt.getNumberValidator)());uu.Factory.addComponentsGetterSetter(ge,"scale",["x","y"]);Be(ge,"scaleX",1,(0,gt.getNumberValidator)());Be(ge,"scaleY",1,(0,gt.getNumberValidator)());uu.Factory.addComponentsGetterSetter(ge,"skew",["x","y"]);Be(ge,"skewX",0,(0,gt.getNumberValidator)());Be(ge,"skewY",0,(0,gt.getNumberValidator)());uu.Factory.addComponentsGetterSetter(ge,"offset",["x","y"]);Be(ge,"offsetX",0,(0,gt.getNumberValidator)());Be(ge,"offsetY",0,(0,gt.getNumberValidator)());Be(ge,"dragDistance",void 0,(0,gt.getNumberValidator)());Be(ge,"width",0,(0,gt.getNumberValidator)());Be(ge,"height",0,(0,gt.getNumberValidator)());Be(ge,"listening",!0,(0,gt.getBooleanValidator)());Be(ge,"preventDefault",!0,(0,gt.getBooleanValidator)());Be(ge,"filters",void 0,function(t){return this._filterUpToDate=!1,t});Be(ge,"visible",!0,(0,gt.getBooleanValidator)());Be(ge,"transformsEnabled","all",(0,gt.getStringValidator)());Be(ge,"size");Be(ge,"dragBoundFunc");Be(ge,"draggable",!1,(0,gt.getBooleanValidator)());uu.Factory.backCompat(ge,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var to={};Object.defineProperty(to,"__esModule",{value:!0});to.Container=void 0;const Ca=Ce,z0=et,eh=pe;class no extends z0.Node{constructor(){super(...arguments),this.children=[]}getChildren(e){const n=this.children||[];return e?n.filter(e):n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let r=0;r<e.length;r++)this.add(e[r]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const r=[];return this._descendants(i=>{const o=i._isMatch(e);return o&&r.push(i),!!(o&&n)}),r}_descendants(e){let n=!1;const r=this.getChildren();for(const i of r){if(n=e(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(e),n))return!0}return!1}toObject(){const e=z0.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=z0.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(e)&&n.push(r)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(e,n,r){const i=this.getLayer(),o=e||i&&i.getCanvas(),l=o&&o.getContext(),u=this._getCanvasCache(),d=u&&u.scene,f=o&&o.isCache;if(!this.isVisible()&&!f)return this;if(d){l.save();const g=this.getAbsoluteTransform(n).getMatrix();l.transform(g[0],g[1],g[2],g[3],g[4],g[5]),this._drawCachedSceneCanvas(l),l.restore()}else this._drawChildren("drawScene",o,n,r);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const r=this.getLayer(),i=e||r&&r.hitCanvas,o=i&&i.getContext(),l=this._getCanvasCache();if(l&&l.hit){o.save();const d=this.getAbsoluteTransform(n).getMatrix();o.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(e,n,r,i){var o;const l=n&&n.getContext(),u=this.clipWidth(),d=this.clipHeight(),f=this.clipFunc(),g=typeof u=="number"&&typeof d=="number"||f,v=r===this;if(g){l.save();const w=this.getAbsoluteTransform(r);let y=w.getMatrix();l.transform(y[0],y[1],y[2],y[3],y[4],y[5]),l.beginPath();let E;if(f)E=f.call(this,l,this);else{const C=this.clipX(),P=this.clipY();l.rect(C||0,P||0,u,d)}l.clip.apply(l,E),y=w.copy().invert().getMatrix(),l.transform(y[0],y[1],y[2],y[3],y[4],y[5])}const S=!v&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";S&&(l.save(),l._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(w){w[e](n,r,i)}),S&&l.restore(),g&&l.restore()}getClientRect(e={}){var n;const r=e.skipTransform,i=e.relativeTo;let o,l,u,d,f={x:1/0,y:1/0,width:0,height:0};const g=this;(n=this.children)===null||n===void 0||n.forEach(function(w){if(!w.visible())return;const y=w.getClientRect({relativeTo:g,skipShadow:e.skipShadow,skipStroke:e.skipStroke});y.width===0&&y.height===0||(o===void 0?(o=y.x,l=y.y,u=y.x+y.width,d=y.y+y.height):(o=Math.min(o,y.x),l=Math.min(l,y.y),u=Math.max(u,y.x+y.width),d=Math.max(d,y.y+y.height)))});const v=this.find("Shape");let S=!1;for(let w=0;w<v.length;w++)if(v[w]._isVisible(this)){S=!0;break}return S&&o!==void 0?f={x:o,y:l,width:u-o,height:d-l}:f={x:0,y:0,width:0,height:0},r?f:this._transformedRect(f,i)}}to.Container=no;Ca.Factory.addComponentsGetterSetter(no,"clip",["x","y","width","height"]);Ca.Factory.addGetterSetter(no,"clipX",void 0,(0,eh.getNumberValidator)());Ca.Factory.addGetterSetter(no,"clipY",void 0,(0,eh.getNumberValidator)());Ca.Factory.addGetterSetter(no,"clipWidth",void 0,(0,eh.getNumberValidator)());Ca.Factory.addGetterSetter(no,"clipHeight",void 0,(0,eh.getNumberValidator)());Ca.Factory.addGetterSetter(no,"clipFunc");var N6={},ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.getCapturedShape=NC;ss.createEvent=Mg;ss.hasPointerCapture=RC;ss.setPointerCapture=TC;ss.releaseCapture=T6;const PC=xe,ql=new Map,R6=PC.Konva._global.PointerEvent!==void 0;function NC(t){return ql.get(t)}function Mg(t){return{evt:t,pointerId:t.pointerId}}function RC(t,e){return ql.get(t)===e}function TC(t,e){T6(t),e.getStage()&&(ql.set(t,e),R6&&e._fire("gotpointercapture",Mg(new PointerEvent("gotpointercapture"))))}function T6(t,e){const n=ql.get(t);if(!n)return;const r=n.getStage();r&&r.content,ql.delete(t),R6&&n._fire("lostpointercapture",Mg(new PointerEvent("lostpointercapture")))}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=t.stages=void 0;const e=ot,n=Ce,r=to,i=xe,o=fr,l=Zd,u=xe,d=ss,f="Stage",g="string",v="px",S="mouseout",w="mouseleave",y="mouseover",E="mouseenter",C="mousemove",P="mousedown",k="mouseup",m="pointermove",x="pointerdown",T="pointerup",F="pointercancel",L="lostpointercapture",O="pointerout",j="pointerleave",M="pointerover",G="pointerenter",K="contextmenu",X="touchstart",ie="touchend",Z="touchmove",he="touchcancel",ke="wheel",V=5,ee=[[E,"_pointerenter"],[P,"_pointerdown"],[C,"_pointermove"],[k,"_pointerup"],[w,"_pointerleave"],[X,"_pointerdown"],[Z,"_pointermove"],[ie,"_pointerup"],[he,"_pointercancel"],[y,"_pointerover"],[ke,"_wheel"],[K,"_contextmenu"],[x,"_pointerdown"],[m,"_pointermove"],[T,"_pointerup"],[F,"_pointercancel"],[j,"_pointerleave"],[L,"_lostpointercapture"]],$={mouse:{[O]:S,[j]:w,[M]:y,[G]:E,[m]:C,[x]:P,[T]:k,[F]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[O]:"touchout",[j]:"touchleave",[M]:"touchover",[G]:"touchenter",[m]:Z,[x]:X,[T]:ie,[F]:he,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[O]:O,[j]:j,[M]:M,[G]:G,[m]:m,[x]:x,[T]:T,[F]:F,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},J=We=>We.indexOf("pointer")>=0?"pointer":We.indexOf("touch")>=0?"touch":"mouse",le=We=>{const D=J(We);if(D==="pointer")return i.Konva.pointerEventsEnabled&&$.pointer;if(D==="touch")return $.touch;if(D==="mouse")return $.mouse};function Ne(We={}){return(We.clipFunc||We.clipWidth||We.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),We}const at="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";t.stages=[];class mt extends r.Container{constructor(D){super(Ne(D)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),t.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{Ne(this.attrs)}),this._checkVisibility()}_validateAdd(D){const Q=D.getType()==="Layer",ue=D.getType()==="FastLayer";Q||ue||e.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const D=this.visible()?"":"none";this.content.style.display=D}setContainer(D){if(typeof D===g){let Q;if(D.charAt(0)==="."){const ue=D.slice(1);D=document.getElementsByClassName(ue)[0]}else D.charAt(0)!=="#"?Q=D:Q=D.slice(1),D=document.getElementById(Q);if(!D)throw"Can not find container in document with id "+Q}return this._setAttr("container",D),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),D.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const D=this.children,Q=D.length;for(let ue=0;ue<Q;ue++)D[ue].clear();return this}clone(D){return D||(D={}),D.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,D)}destroy(){super.destroy();const D=this.content;D&&e.Util._isInDocument(D)&&this.container().removeChild(D);const Q=t.stages.indexOf(this);return Q>-1&&t.stages.splice(Q,1),e.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const D=this._pointerPositions[0]||this._changedPointerPositions[0];return D?{x:D.x,y:D.y}:(e.Util.warn(at),null)}_getPointerById(D){return this._pointerPositions.find(Q=>Q.id===D)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(D){D=D||{},D.x=D.x||0,D.y=D.y||0,D.width=D.width||this.width(),D.height=D.height||this.height();const Q=new o.SceneCanvas({width:D.width,height:D.height,pixelRatio:D.pixelRatio||1}),ue=Q.getContext()._context,De=this.children;return(D.x||D.y)&&ue.translate(-1*D.x,-1*D.y),De.forEach(function(ve){if(!ve.isVisible())return;const Ge=ve._toKonvaCanvas(D);ue.drawImage(Ge._canvas,D.x,D.y,Ge.getWidth()/Ge.getPixelRatio(),Ge.getHeight()/Ge.getPixelRatio())}),Q}getIntersection(D){if(!D)return null;const Q=this.children,ue=Q.length,De=ue-1;for(let ve=De;ve>=0;ve--){const Ge=Q[ve].getIntersection(D);if(Ge)return Ge}return null}_resizeDOM(){const D=this.width(),Q=this.height();this.content&&(this.content.style.width=D+v,this.content.style.height=Q+v),this.bufferCanvas.setSize(D,Q),this.bufferHitCanvas.setSize(D,Q),this.children.forEach(ue=>{ue.setSize({width:D,height:Q}),ue.draw()})}add(D,...Q){if(arguments.length>1){for(let De=0;De<arguments.length;De++)this.add(arguments[De]);return this}super.add(D);const ue=this.children.length;return ue>V&&e.Util.warn("The stage has "+ue+" 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."),D.setSize({width:this.width(),height:this.height()}),D.draw(),i.Konva.isBrowser&&this.content.appendChild(D.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(D){return d.hasPointerCapture(D,this)}setPointerCapture(D){d.setPointerCapture(D,this)}releaseCapture(D){d.releaseCapture(D,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&ee.forEach(([D,Q])=>{this.content.addEventListener(D,ue=>{this[Q](ue)},{passive:!1})})}_pointerenter(D){this.setPointersPositions(D);const Q=le(D.type);Q&&this._fire(Q.pointerenter,{evt:D,target:this,currentTarget:this})}_pointerover(D){this.setPointersPositions(D);const Q=le(D.type);Q&&this._fire(Q.pointerover,{evt:D,target:this,currentTarget:this})}_getTargetShape(D){let Q=this[D+"targetShape"];return Q&&!Q.getStage()&&(Q=null),Q}_pointerleave(D){const Q=le(D.type),ue=J(D.type);if(!Q)return;this.setPointersPositions(D);const De=this._getTargetShape(ue),ve=!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled;De&&ve?(De._fireAndBubble(Q.pointerout,{evt:D}),De._fireAndBubble(Q.pointerleave,{evt:D}),this._fire(Q.pointerleave,{evt:D,target:this,currentTarget:this}),this[ue+"targetShape"]=null):ve&&(this._fire(Q.pointerleave,{evt:D,target:this,currentTarget:this}),this._fire(Q.pointerout,{evt:D,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(D){const Q=le(D.type),ue=J(D.type);if(!Q)return;this.setPointersPositions(D);let De=!1;this._changedPointerPositions.forEach(ve=>{const Ge=this.getIntersection(ve);if(l.DD.justDragged=!1,i.Konva["_"+ue+"ListenClick"]=!0,!Ge||!Ge.isListening()){this[ue+"ClickStartShape"]=void 0;return}i.Konva.capturePointerEventsEnabled&&Ge.setPointerCapture(ve.id),this[ue+"ClickStartShape"]=Ge,Ge._fireAndBubble(Q.pointerdown,{evt:D,pointerId:ve.id}),De=!0;const Ke=D.type.indexOf("touch")>=0;Ge.preventDefault()&&D.cancelable&&Ke&&D.preventDefault()}),De||this._fire(Q.pointerdown,{evt:D,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(D){const Q=le(D.type),ue=J(D.type);if(!Q||(i.Konva.isDragging()&&l.DD.node.preventDefault()&&D.cancelable&&D.preventDefault(),this.setPointersPositions(D),!(!(i.Konva.isDragging()||i.Konva.isTransforming())||i.Konva.hitOnDragEnabled)))return;const ve={};let Ge=!1;const Ke=this._getTargetShape(ue);this._changedPointerPositions.forEach(yr=>{const Ue=d.getCapturedShape(yr.id)||this.getIntersection(yr),hi=yr.id,Jn={evt:D,pointerId:hi},fi=Ke!==Ue;if(fi&&Ke&&(Ke._fireAndBubble(Q.pointerout,{...Jn},Ue),Ke._fireAndBubble(Q.pointerleave,{...Jn},Ue)),Ue){if(ve[Ue._id])return;ve[Ue._id]=!0}Ue&&Ue.isListening()?(Ge=!0,fi&&(Ue._fireAndBubble(Q.pointerover,{...Jn},Ke),Ue._fireAndBubble(Q.pointerenter,{...Jn},Ke),this[ue+"targetShape"]=Ue),Ue._fireAndBubble(Q.pointermove,{...Jn})):Ke&&(this._fire(Q.pointerover,{evt:D,target:this,currentTarget:this,pointerId:hi}),this[ue+"targetShape"]=null)}),Ge||this._fire(Q.pointermove,{evt:D,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(D){const Q=le(D.type),ue=J(D.type);if(!Q)return;this.setPointersPositions(D);const De=this[ue+"ClickStartShape"],ve=this[ue+"ClickEndShape"],Ge={};let Ke=!1;this._changedPointerPositions.forEach(yr=>{const Ue=d.getCapturedShape(yr.id)||this.getIntersection(yr);if(Ue){if(Ue.releaseCapture(yr.id),Ge[Ue._id])return;Ge[Ue._id]=!0}const hi=yr.id,Jn={evt:D,pointerId:hi};let fi=!1;i.Konva["_"+ue+"InDblClickWindow"]?(fi=!0,clearTimeout(this[ue+"DblTimeout"])):l.DD.justDragged||(i.Konva["_"+ue+"InDblClickWindow"]=!0,clearTimeout(this[ue+"DblTimeout"])),this[ue+"DblTimeout"]=setTimeout(function(){i.Konva["_"+ue+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),Ue&&Ue.isListening()?(Ke=!0,this[ue+"ClickEndShape"]=Ue,Ue._fireAndBubble(Q.pointerup,{...Jn}),i.Konva["_"+ue+"ListenClick"]&&De&&De===Ue&&(Ue._fireAndBubble(Q.pointerclick,{...Jn}),fi&&ve&&ve===Ue&&Ue._fireAndBubble(Q.pointerdblclick,{...Jn}))):(this[ue+"ClickEndShape"]=null,i.Konva["_"+ue+"ListenClick"]&&this._fire(Q.pointerclick,{evt:D,target:this,currentTarget:this,pointerId:hi}),fi&&this._fire(Q.pointerdblclick,{evt:D,target:this,currentTarget:this,pointerId:hi}))}),Ke||this._fire(Q.pointerup,{evt:D,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+ue+"ListenClick"]=!1,D.cancelable&&ue!=="touch"&&ue!=="pointer"&&D.preventDefault()}_contextmenu(D){this.setPointersPositions(D);const Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble(K,{evt:D}):this._fire(K,{evt:D,target:this,currentTarget:this})}_wheel(D){this.setPointersPositions(D);const Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble(ke,{evt:D}):this._fire(ke,{evt:D,target:this,currentTarget:this})}_pointercancel(D){this.setPointersPositions(D);const Q=d.getCapturedShape(D.pointerId)||this.getIntersection(this.getPointerPosition());Q&&Q._fireAndBubble(T,d.createEvent(D)),d.releaseCapture(D.pointerId)}_lostpointercapture(D){d.releaseCapture(D.pointerId)}setPointersPositions(D){const Q=this._getContentPosition();let ue=null,De=null;D=D||window.event,D.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(D.touches,ve=>{this._pointerPositions.push({id:ve.identifier,x:(ve.clientX-Q.left)/Q.scaleX,y:(ve.clientY-Q.top)/Q.scaleY})}),Array.prototype.forEach.call(D.changedTouches||D.touches,ve=>{this._changedPointerPositions.push({id:ve.identifier,x:(ve.clientX-Q.left)/Q.scaleX,y:(ve.clientY-Q.top)/Q.scaleY})})):(ue=(D.clientX-Q.left)/Q.scaleX,De=(D.clientY-Q.top)/Q.scaleY,this.pointerPos={x:ue,y:De},this._pointerPositions=[{x:ue,y:De,id:e.Util._getFirstPointerId(D)}],this._changedPointerPositions=[{x:ue,y:De,id:e.Util._getFirstPointerId(D)}])}_setPointerPosition(D){e.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(D)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const D=this.content.getBoundingClientRect();return{top:D.top,left:D.left,scaleX:D.width/this.content.clientWidth||1,scaleY:D.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!i.Konva.isBrowser)return;const D=this.container();if(!D)throw"Stage has no container. A container is required.";D.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"),D.appendChild(this.content),this._resizeDOM()}cache(){return e.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(D){D.batchDraw()}),this}}t.Stage=mt,mt.prototype.nodeType=f,(0,u._registerNode)(mt),n.Factory.addGetterSetter(mt,"container"),i.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{t.stages.forEach(We=>{We.batchDraw()})})})(N6);var cu={},Pt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.shapes=void 0;const e=xe,n=ot,r=Ce,i=et,o=pe,l=xe,u=ss,d="hasShadow",f="shadowRGBA",g="patternImage",v="linearGradient",S="radialGradient";let w;function y(){return w||(w=n.Util.createCanvasElement().getContext("2d"),w)}t.shapes={};function E(j){const M=this.attrs.fillRule;M?j.fill(M):j.fill()}function C(j){j.stroke()}function P(j){const M=this.attrs.fillRule;M?j.fill(M):j.fill()}function k(j){j.stroke()}function m(){this._clearCache(d)}function x(){this._clearCache(f)}function T(){this._clearCache(g)}function F(){this._clearCache(v)}function L(){this._clearCache(S)}class O extends i.Node{constructor(M){super(M);let G;for(;G=n.Util.getRandomColor(),!(G&&!(G in t.shapes)););this.colorKey=G,t.shapes[G]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(d,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(g,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const G=y().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(G&&G.setTransform){const K=new n.Transform;K.translate(this.fillPatternX(),this.fillPatternY()),K.rotate(e.Konva.getAngle(this.fillPatternRotation())),K.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),K.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const X=K.getMatrix(),ie=typeof DOMMatrix>"u"?{a:X[0],b:X[1],c:X[2],d:X[3],e:X[4],f:X[5]}:new DOMMatrix(X);G.setTransform(ie)}return G}}_getLinearGradient(){return this._getCache(v,this.__getLinearGradient)}__getLinearGradient(){const M=this.fillLinearGradientColorStops();if(M){const G=y(),K=this.fillLinearGradientStartPoint(),X=this.fillLinearGradientEndPoint(),ie=G.createLinearGradient(K.x,K.y,X.x,X.y);for(let Z=0;Z<M.length;Z+=2)ie.addColorStop(M[Z],M[Z+1]);return ie}}_getRadialGradient(){return this._getCache(S,this.__getRadialGradient)}__getRadialGradient(){const M=this.fillRadialGradientColorStops();if(M){const G=y(),K=this.fillRadialGradientStartPoint(),X=this.fillRadialGradientEndPoint(),ie=G.createRadialGradient(K.x,K.y,this.fillRadialGradientStartRadius(),X.x,X.y,this.fillRadialGradientEndRadius());for(let Z=0;Z<M.length;Z+=2)ie.addColorStop(M[Z],M[Z+1]);return ie}}getShadowRGBA(){return this._getCache(f,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const M=n.Util.colorToRGBA(this.shadowColor());if(M)return"rgba("+M.r+","+M.g+","+M.b+","+M.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const M=this.hitStrokeWidth();return M==="auto"?this.hasStroke():this.strokeEnabled()&&!!M}intersects(M){const G=this.getStage();if(!G)return!1;const K=G.bufferHitCanvas;return K.getContext().clear(),this.drawHit(K,void 0,!0),K.context.getImageData(Math.round(M.x),Math.round(M.y),1,1).data[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(M){var G;if(!((G=this.attrs.perfectDrawEnabled)!==null&&G!==void 0?G:!0))return!1;const X=M||this.hasFill(),ie=this.hasStroke(),Z=this.getAbsoluteOpacity()!==1;if(X&&ie&&Z)return!0;const he=this.hasShadow(),ke=this.shadowForStrokeEnabled();return!!(X&&ie&&he&&ke)}setStrokeHitEnabled(M){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),M?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const M=this.size();return{x:this._centroid?-M.width/2:0,y:this._centroid?-M.height/2:0,width:M.width,height:M.height}}getClientRect(M={}){let G=!1,K=this.getParent();for(;K;){if(K.isCached()){G=!0;break}K=K.getParent()}const X=M.skipTransform,ie=M.relativeTo||G&&this.getStage()||void 0,Z=this.getSelfRect(),ke=!M.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,V=Z.width+ke,ee=Z.height+ke,$=!M.skipShadow&&this.hasShadow(),J=$?this.shadowOffsetX():0,le=$?this.shadowOffsetY():0,Ne=V+Math.abs(J),at=ee+Math.abs(le),mt=$&&this.shadowBlur()||0,We=Ne+mt*2,D=at+mt*2,Q={width:We,height:D,x:-(ke/2+mt)+Math.min(J,0)+Z.x,y:-(ke/2+mt)+Math.min(le,0)+Z.y};return X?Q:this._transformedRect(Q,ie)}drawScene(M,G,K){const X=this.getLayer(),ie=M||X.getCanvas(),Z=ie.getContext(),he=this._getCanvasCache(),ke=this.getSceneFunc(),V=this.hasShadow();let ee;const $=G===this;if(!this.isVisible()&&!$)return this;if(he){Z.save();const J=this.getAbsoluteTransform(G).getMatrix();return Z.transform(J[0],J[1],J[2],J[3],J[4],J[5]),this._drawCachedSceneCanvas(Z),Z.restore(),this}if(!ke)return this;if(Z.save(),this._useBufferCanvas()){ee=this.getStage();const J=K||ee.bufferCanvas,le=J.getContext();le.clear(),le.save(),le._applyLineJoin(this);const Ne=this.getAbsoluteTransform(G).getMatrix();le.transform(Ne[0],Ne[1],Ne[2],Ne[3],Ne[4],Ne[5]),ke.call(this,le,this),le.restore();const at=J.pixelRatio;V&&Z._applyShadow(this),Z._applyOpacity(this),Z._applyGlobalCompositeOperation(this),Z.drawImage(J._canvas,J.x||0,J.y||0,J.width/at,J.height/at)}else{if(Z._applyLineJoin(this),!$){const J=this.getAbsoluteTransform(G).getMatrix();Z.transform(J[0],J[1],J[2],J[3],J[4],J[5]),Z._applyOpacity(this),Z._applyGlobalCompositeOperation(this)}V&&Z._applyShadow(this),ke.call(this,Z,this)}return Z.restore(),this}drawHit(M,G,K=!1){if(!this.shouldDrawHit(G,K))return this;const X=this.getLayer(),ie=M||X.hitCanvas,Z=ie&&ie.getContext(),he=this.hitFunc()||this.sceneFunc(),ke=this._getCanvasCache(),V=ke&&ke.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),V){Z.save();const $=this.getAbsoluteTransform(G).getMatrix();return Z.transform($[0],$[1],$[2],$[3],$[4],$[5]),this._drawCachedHitCanvas(Z),Z.restore(),this}if(!he)return this;if(Z.save(),Z._applyLineJoin(this),!(this===G)){const $=this.getAbsoluteTransform(G).getMatrix();Z.transform($[0],$[1],$[2],$[3],$[4],$[5])}return he.call(this,Z,this),Z.restore(),this}drawHitFromCache(M=0){const G=this._getCanvasCache(),K=this._getCachedSceneCanvas(),X=G.hit,ie=X.getContext(),Z=X.getWidth(),he=X.getHeight();ie.clear(),ie.drawImage(K._canvas,0,0,Z,he);try{const ke=ie.getImageData(0,0,Z,he),V=ke.data,ee=V.length,$=n.Util._hexToRgb(this.colorKey);for(let J=0;J<ee;J+=4)V[J+3]>M?(V[J]=$.r,V[J+1]=$.g,V[J+2]=$.b,V[J+3]=255):V[J+3]=0;ie.putImageData(ke,0,0)}catch(ke){n.Util.error("Unable to draw hit graph from cached scene canvas. "+ke.message)}return this}hasPointerCapture(M){return u.hasPointerCapture(M,this)}setPointerCapture(M){u.setPointerCapture(M,this)}releaseCapture(M){u.releaseCapture(M,this)}}t.Shape=O,O.prototype._fillFunc=E,O.prototype._strokeFunc=C,O.prototype._fillFuncHit=P,O.prototype._strokeFuncHit=k,O.prototype._centroid=!1,O.prototype.nodeType="Shape",(0,l._registerNode)(O),O.prototype.eventListeners={},O.prototype.on.call(O.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",m),O.prototype.on.call(O.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",x),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",T),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",F),O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",L),r.Factory.addGetterSetter(O,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(O,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(O,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(O,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(O,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(O,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(O,"lineJoin"),r.Factory.addGetterSetter(O,"lineCap"),r.Factory.addGetterSetter(O,"sceneFunc"),r.Factory.addGetterSetter(O,"hitFunc"),r.Factory.addGetterSetter(O,"dash"),r.Factory.addGetterSetter(O,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(O,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(O,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(O,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(O,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(O,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(O,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillPatternImage"),r.Factory.addGetterSetter(O,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(O,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(O,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(O,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(O,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(O,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(O,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(O,"fillEnabled",!0),r.Factory.addGetterSetter(O,"strokeEnabled",!0),r.Factory.addGetterSetter(O,"shadowEnabled",!0),r.Factory.addGetterSetter(O,"dashEnabled",!0),r.Factory.addGetterSetter(O,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(O,"fillPriority","color"),r.Factory.addComponentsGetterSetter(O,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(O,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(O,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(O,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(O,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(O,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(O,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(O,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(O,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(O,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(O,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(O,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(O,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(O,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(O,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(O,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(O,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(O,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(O,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(O,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(O,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(O,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(O,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(O,"fillPatternRotation",0),r.Factory.addGetterSetter(O,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(O,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Pt);Object.defineProperty(cu,"__esModule",{value:!0});cu.Layer=void 0;const Hr=ot,B0=to,No=et,Lg=Ce,kv=fr,OC=pe,FC=Pt,AC=xe,MC="#",LC="beforeDraw",bC="draw",O6=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],DC=O6.length;let ka=class extends B0.Container{constructor(e){super(e),this.canvas=new kv.SceneCanvas,this.hitCanvas=new kv.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){No.Node.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!No.Node.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(No.Node.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(No.Node.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return No.Node.prototype.remove.call(this),e&&e.parentNode&&Hr.Util._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&Hr.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e=e||{},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),No.Node.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){Hr.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){Hr.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,Hr.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,r=!1;for(;;){for(let i=0;i<DC;i++){const o=O6[i],l=this._getIntersection({x:e.x+o.x*n,y:e.y+o.y*n}),u=l.shape;if(u)return u;if(r=!!l.antialiased,!l.antialiased)break}if(r)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,i=r[3];if(i===255){const o=Hr.Util._rgbToHex(r[0],r[1],r[2]),l=FC.shapes[MC+o];return l?{shape:l}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,n,r){const i=this.getLayer(),o=e||i&&i.getCanvas();return this._fire(LC,{node:this}),this.clearBeforeDraw()&&o.getContext().clear(),B0.Container.prototype.drawScene.call(this,o,n,r),this._fire(bC,{node:this}),this}drawHit(e,n){const r=this.getLayer(),i=e||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),B0.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){Hr.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return Hr.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return Hr.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};cu.Layer=ka;ka.prototype.nodeType="Layer";(0,AC._registerNode)(ka);Lg.Factory.addGetterSetter(ka,"imageSmoothingEnabled",!0);Lg.Factory.addGetterSetter(ka,"clearBeforeDraw",!0);Lg.Factory.addGetterSetter(ka,"hitGraphEnabled",!0,(0,OC.getBooleanValidator)());var th={};Object.defineProperty(th,"__esModule",{value:!0});th.FastLayer=void 0;const IC=ot,jC=cu,UC=xe;class bg extends jC.Layer{constructor(e){super(e),this.listening(!1),IC.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}th.FastLayer=bg;bg.prototype.nodeType="FastLayer";(0,UC._registerNode)(bg);var Ea={};Object.defineProperty(Ea,"__esModule",{value:!0});Ea.Group=void 0;const zC=ot,BC=to,GC=xe;class Dg extends BC.Container{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&zC.Util.throw("You may only add groups and shapes to groups.")}}Ea.Group=Dg;Dg.prototype.nodeType="Group";(0,GC._registerNode)(Dg);var Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});Pa.Animation=void 0;const G0=xe,Ev=ot,H0=function(){return G0.glob.performance&&G0.glob.performance.now?function(){return G0.glob.performance.now()}:function(){return new Date().getTime()}}();class Ar{constructor(e,n){this.id=Ar.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:H0(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,r=n.length;for(let i=0;i<r;i++)if(n[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=Ar.animations,r=n.length;for(let i=0;i<r;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=H0(),Ar._addAnimation(this),this}stop(){return Ar._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,r=this.animations,i=r.length;for(let o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const e={},n=this.animations;for(let r=0;r<n.length;r++){const i=n[r],o=i.layers,l=i.func;i._updateFrameObject(H0());const u=o.length;let d;if(l?d=l.call(i,i.frame)!==!1:d=!0,!!d)for(let f=0;f<u;f++){const g=o[f];g._id!==void 0&&(e[g._id]=g)}}for(const r in e)e.hasOwnProperty(r)&&e[r].batchDraw()}static _animationLoop(){const e=Ar;e.animations.length?(e._runFrames(),Ev.Util.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,Ev.Util.requestAnimFrame(this._animationLoop))}}Pa.Animation=Ar;Ar.animations=[];Ar.animIdCounter=0;Ar.animRunning=!1;var F6={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Easings=t.Tween=void 0;const e=ot,n=Pa,r=et,i=xe,o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},l=1,u=2,d=3,f=["fill","stroke","shadowColor"];let g=0;class v{constructor(y,E,C,P,k,m,x){this.prop=y,this.propFunc=E,this.begin=P,this._pos=P,this.duration=m,this._change=0,this.prevPos=0,this.yoyo=x,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=C,this._change=k-this.begin,this.pause()}fire(y){const E=this[y];E&&E()}setTime(y){y>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():y<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=y,this.update())}getTime(){return this._time}setPosition(y){this.prevPos=this._pos,this.propFunc(y),this._pos=y}getPosition(y){return y===void 0&&(y=this._time),this.func(y,this.begin,this._change,this.duration)}play(){this.state=u,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=d,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(y){this.pause(),this._time=y,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const y=this.getTimer()-this._startTime;this.state===u?this.setTime(y):this.state===d&&this.setTime(this.duration-y)}pause(){this.state=l,this.fire("onPause")}getTimer(){return new Date().getTime()}}class S{constructor(y){const E=this,C=y.node,P=C._id,k=y.easing||t.Easings.Linear,m=!!y.yoyo;let x,T;typeof y.duration>"u"?x=.3:y.duration===0?x=.001:x=y.duration,this.node=C,this._id=g++;const F=C.getLayer()||(C instanceof i.Konva.Stage?C.getLayers():null);F||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){E.tween.onEnterFrame()},F),this.tween=new v(T,function(L){E._tweenFunc(L)},k,0,1,x*1e3,m),this._addListeners(),S.attrs[P]||(S.attrs[P]={}),S.attrs[P][this._id]||(S.attrs[P][this._id]={}),S.tweens[P]||(S.tweens[P]={});for(T in y)o[T]===void 0&&this._addAttr(T,y[T]);this.reset(),this.onFinish=y.onFinish,this.onReset=y.onReset,this.onUpdate=y.onUpdate}_addAttr(y,E){const C=this.node,P=C._id;let k,m,x,T,F;const L=S.tweens[P][y];L&&delete S.attrs[P][L][y];let O=C.getAttr(y);if(e.Util._isArray(E))if(k=[],m=Math.max(E.length,O.length),y==="points"&&E.length!==O.length&&(E.length>O.length?(T=O,O=e.Util._prepareArrayForTween(O,E,C.closed())):(x=E,E=e.Util._prepareArrayForTween(E,O,C.closed()))),y.indexOf("fill")===0)for(let j=0;j<m;j++)if(j%2===0)k.push(E[j]-O[j]);else{const M=e.Util.colorToRGBA(O[j]);F=e.Util.colorToRGBA(E[j]),O[j]=M,k.push({r:F.r-M.r,g:F.g-M.g,b:F.b-M.b,a:F.a-M.a})}else for(let j=0;j<m;j++)k.push(E[j]-O[j]);else f.indexOf(y)!==-1?(O=e.Util.colorToRGBA(O),F=e.Util.colorToRGBA(E),k={r:F.r-O.r,g:F.g-O.g,b:F.b-O.b,a:F.a-O.a}):k=E-O;S.attrs[P][this._id][y]={start:O,diff:k,end:E,trueEnd:x,trueStart:T},S.tweens[P][y]=this._id}_tweenFunc(y){const E=this.node,C=S.attrs[E._id][this._id];let P,k,m,x,T,F,L,O;for(P in C){if(k=C[P],m=k.start,x=k.diff,O=k.end,e.Util._isArray(m))if(T=[],L=Math.max(m.length,O.length),P.indexOf("fill")===0)for(F=0;F<L;F++)F%2===0?T.push((m[F]||0)+x[F]*y):T.push("rgba("+Math.round(m[F].r+x[F].r*y)+","+Math.round(m[F].g+x[F].g*y)+","+Math.round(m[F].b+x[F].b*y)+","+(m[F].a+x[F].a*y)+")");else for(F=0;F<L;F++)T.push((m[F]||0)+x[F]*y);else f.indexOf(P)!==-1?T="rgba("+Math.round(m.r+x.r*y)+","+Math.round(m.g+x.g*y)+","+Math.round(m.b+x.b*y)+","+(m.a+x.a*y)+")":T=m+x*y;E.setAttr(P,T)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const y=this.node,E=S.attrs[y._id][this._id];E.points&&E.points.trueEnd&&y.setAttr("points",E.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const y=this.node,E=S.attrs[y._id][this._id];E.points&&E.points.trueStart&&y.points(E.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(y){return this.tween.seek(y*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const y=this.node._id,E=this._id,C=S.tweens[y];this.pause(),this.anim&&this.anim.stop();for(const P in C)delete S.tweens[y][P];delete S.attrs[y][E],S.tweens[y]&&(Object.keys(S.tweens[y]).length===0&&delete S.tweens[y],Object.keys(S.attrs[y]).length===0&&delete S.attrs[y])}}t.Tween=S,S.attrs={},S.tweens={},r.Node.prototype.to=function(w){const y=w.onFinish;w.node=this,w.onFinish=function(){this.destroy(),y&&y()},new S(w).play()},t.Easings={BackEaseIn(w,y,E,C){return E*(w/=C)*w*((1.70158+1)*w-1.70158)+y},BackEaseOut(w,y,E,C){return E*((w=w/C-1)*w*((1.70158+1)*w+1.70158)+1)+y},BackEaseInOut(w,y,E,C){let P=1.70158;return(w/=C/2)<1?E/2*(w*w*(((P*=1.525)+1)*w-P))+y:E/2*((w-=2)*w*(((P*=1.525)+1)*w+P)+2)+y},ElasticEaseIn(w,y,E,C,P,k){let m=0;return w===0?y:(w/=C)===1?y+E:(k||(k=C*.3),!P||P<Math.abs(E)?(P=E,m=k/4):m=k/(2*Math.PI)*Math.asin(E/P),-(P*Math.pow(2,10*(w-=1))*Math.sin((w*C-m)*(2*Math.PI)/k))+y)},ElasticEaseOut(w,y,E,C,P,k){let m=0;return w===0?y:(w/=C)===1?y+E:(k||(k=C*.3),!P||P<Math.abs(E)?(P=E,m=k/4):m=k/(2*Math.PI)*Math.asin(E/P),P*Math.pow(2,-10*w)*Math.sin((w*C-m)*(2*Math.PI)/k)+E+y)},ElasticEaseInOut(w,y,E,C,P,k){let m=0;return w===0?y:(w/=C/2)===2?y+E:(k||(k=C*(.3*1.5)),!P||P<Math.abs(E)?(P=E,m=k/4):m=k/(2*Math.PI)*Math.asin(E/P),w<1?-.5*(P*Math.pow(2,10*(w-=1))*Math.sin((w*C-m)*(2*Math.PI)/k))+y:P*Math.pow(2,-10*(w-=1))*Math.sin((w*C-m)*(2*Math.PI)/k)*.5+E+y)},BounceEaseOut(w,y,E,C){return(w/=C)<1/2.75?E*(7.5625*w*w)+y:w<2/2.75?E*(7.5625*(w-=1.5/2.75)*w+.75)+y:w<2.5/2.75?E*(7.5625*(w-=2.25/2.75)*w+.9375)+y:E*(7.5625*(w-=2.625/2.75)*w+.984375)+y},BounceEaseIn(w,y,E,C){return E-t.Easings.BounceEaseOut(C-w,0,E,C)+y},BounceEaseInOut(w,y,E,C){return w<C/2?t.Easings.BounceEaseIn(w*2,0,E,C)*.5+y:t.Easings.BounceEaseOut(w*2-C,0,E,C)*.5+E*.5+y},EaseIn(w,y,E,C){return E*(w/=C)*w+y},EaseOut(w,y,E,C){return-E*(w/=C)*(w-2)+y},EaseInOut(w,y,E,C){return(w/=C/2)<1?E/2*w*w+y:-E/2*(--w*(w-2)-1)+y},StrongEaseIn(w,y,E,C){return E*(w/=C)*w*w*w*w+y},StrongEaseOut(w,y,E,C){return E*((w=w/C-1)*w*w*w*w+1)+y},StrongEaseInOut(w,y,E,C){return(w/=C/2)<1?E/2*w*w*w*w*w+y:E/2*((w-=2)*w*w*w*w+2)+y},Linear(w,y,E,C){return E*w/C+y}}})(F6);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Konva=void 0;const e=xe,n=ot,r=et,i=to,o=N6,l=cu,u=th,d=Ea,f=Zd,g=Pt,v=Pa,S=F6,w=ti,y=fr;t.Konva=n.Util._assign(e.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:o.Stage,stages:o.stages,Layer:l.Layer,FastLayer:u.FastLayer,Group:d.Group,DD:f.DD,Shape:g.Shape,shapes:g.shapes,Animation:v.Animation,Tween:S.Tween,Easings:S.Easings,Context:w.Context,Canvas:y.Canvas}),t.default=t.Konva})(Nd);var nh={};Object.defineProperty(nh,"__esModule",{value:!0});nh.Arc=void 0;const rh=Ce,HC=Pt,Pv=xe,ih=pe,VC=xe;class ci extends HC.Shape{_sceneFunc(e){const n=Pv.Konva.getAngle(this.angle()),r=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,r),e.arc(0,0,this.innerRadius(),n,0,!r),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=Pv.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),l=1,u=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),d=Math.sin(Math.min(i,Math.PI/2)),f=o*(o>0?e:n),g=l*n,v=u*(u>0?e:n),S=d*(d>0?n:e);return{x:f,y:r?-1*S:v,width:g-f,height:S-v}}}nh.Arc=ci;ci.prototype._centroid=!0;ci.prototype.className="Arc";ci.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];(0,VC._registerNode)(ci);rh.Factory.addGetterSetter(ci,"innerRadius",0,(0,ih.getNumberValidator)());rh.Factory.addGetterSetter(ci,"outerRadius",0,(0,ih.getNumberValidator)());rh.Factory.addGetterSetter(ci,"angle",0,(0,ih.getNumberValidator)());rh.Factory.addGetterSetter(ci,"clockwise",!1,(0,ih.getBooleanValidator)());var sh={},du={};Object.defineProperty(du,"__esModule",{value:!0});du.Line=void 0;const oh=Ce,WC=xe,KC=Pt,A6=pe;function g1(t,e,n,r,i,o,l){const u=Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),d=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),f=l*u/(u+d),g=l*d/(u+d),v=n-f*(i-t),S=r-f*(o-e),w=n+g*(i-t),y=r+g*(o-e);return[v,S,w,y]}function Nv(t,e){const n=t.length,r=[];for(let i=2;i<n-2;i+=2){const o=g1(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(o[0])||(r.push(o[0]),r.push(o[1]),r.push(t[i]),r.push(t[i+1]),r.push(o[2]),r.push(o[3]))}return r}class os extends KC.Shape{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const n=this.points(),r=n.length,i=this.tension(),o=this.closed(),l=this.bezier();if(!r)return;let u=0;if(e.beginPath(),e.moveTo(n[0],n[1]),i!==0&&r>4){const d=this.getTensionPoints(),f=d.length;for(u=o?0:4,o||e.quadraticCurveTo(d[0],d[1],d[2],d[3]);u<f-2;)e.bezierCurveTo(d[u++],d[u++],d[u++],d[u++],d[u++],d[u++]);o||e.quadraticCurveTo(d[f-2],d[f-1],n[r-2],n[r-1])}else if(l)for(u=2;u<r;)e.bezierCurveTo(n[u++],n[u++],n[u++],n[u++],n[u++],n[u++]);else for(u=2;u<r;u+=2)e.lineTo(n[u],n[u+1]);o?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():Nv(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,r=this.tension(),i=g1(e[n-2],e[n-1],e[0],e[1],e[2],e[3],r),o=g1(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],r),l=Nv(e,r);return[i[2],i[3]].concat(l).concat([o[0],o[1],e[n-2],e[n-1],o[2],o[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],r=e[0],i=e[1],o=e[1],l,u;for(let d=0;d<e.length/2;d++)l=e[d*2],u=e[d*2+1],n=Math.min(n,l),r=Math.max(r,l),i=Math.min(i,u),o=Math.max(o,u);return{x:n,y:i,width:r-n,height:o-i}}}du.Line=os;os.prototype.className="Line";os.prototype._attrsAffectingSize=["points","bezier","tension"];(0,WC._registerNode)(os);oh.Factory.addGetterSetter(os,"closed",!1);oh.Factory.addGetterSetter(os,"bezier",!1);oh.Factory.addGetterSetter(os,"tension",0,(0,A6.getNumberValidator)());oh.Factory.addGetterSetter(os,"points",[],(0,A6.getNumberArrayValidator)());var Na={},M6={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.t2length=t.getQuadraticArcLength=t.getCubicArcLength=t.binomialCoefficients=t.cValues=t.tValues=void 0,t.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],t.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],t.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const e=(l,u,d)=>{let f,g;const S=d/2;f=0;for(let w=0;w<20;w++)g=S*t.tValues[20][w]+S,f+=t.cValues[20][w]*r(l,u,g);return S*f};t.getCubicArcLength=e;const n=(l,u,d)=>{d===void 0&&(d=1);const f=l[0]-2*l[1]+l[2],g=u[0]-2*u[1]+u[2],v=2*l[1]-2*l[0],S=2*u[1]-2*u[0],w=4*(f*f+g*g),y=4*(f*v+g*S),E=v*v+S*S;if(w===0)return d*Math.sqrt(Math.pow(l[2]-l[0],2)+Math.pow(u[2]-u[0],2));const C=y/(2*w),P=E/w,k=d+C,m=P-C*C,x=k*k+m>0?Math.sqrt(k*k+m):0,T=C*C+m>0?Math.sqrt(C*C+m):0,F=C+Math.sqrt(C*C+m)!==0?m*Math.log(Math.abs((k+x)/(C+T))):0;return Math.sqrt(w)/2*(k*x-C*T+F)};t.getQuadraticArcLength=n;function r(l,u,d){const f=i(1,d,l),g=i(1,d,u),v=f*f+g*g;return Math.sqrt(v)}const i=(l,u,d)=>{const f=d.length-1;let g,v;if(f===0)return 0;if(l===0){v=0;for(let S=0;S<=f;S++)v+=t.binomialCoefficients[f][S]*Math.pow(1-u,f-S)*Math.pow(u,S)*d[S];return v}else{g=new Array(f);for(let S=0;S<f;S++)g[S]=f*(d[S+1]-d[S]);return i(l-1,u,g)}},o=(l,u,d)=>{let f=1,g=l/u,v=(l-d(g))/u,S=0;for(;f>.001;){const w=d(g+v),y=Math.abs(l-w)/u;if(y<f)f=y,g+=v;else{const E=d(g-v),C=Math.abs(l-E)/u;C<f?(f=C,g-=v):v/=2}if(S++,S>500)break}return g};t.t2length=o})(M6);Object.defineProperty(Na,"__esModule",{value:!0});Na.Path=void 0;const QC=Ce,qC=xe,YC=Pt,Ro=M6;class wt extends YC.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=wt.parsePathData(this.data()),this.pathLength=wt.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let r=!1;for(let i=0;i<n.length;i++){const o=n[i].command,l=n[i].points;switch(o){case"L":e.lineTo(l[0],l[1]);break;case"M":e.moveTo(l[0],l[1]);break;case"C":e.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5]);break;case"Q":e.quadraticCurveTo(l[0],l[1],l[2],l[3]);break;case"A":const u=l[0],d=l[1],f=l[2],g=l[3],v=l[4],S=l[5],w=l[6],y=l[7],E=f>g?f:g,C=f>g?1:f/g,P=f>g?g/f:1;e.translate(u,d),e.rotate(w),e.scale(C,P),e.arc(0,0,E,v,v+S,1-y),e.scale(1/C,1/P),e.rotate(-w),e.translate(-u,-d);break;case"z":r=!0,e.closePath();break}}!r&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(d){if(d.command==="A"){const f=d.points[4],g=d.points[5],v=d.points[4]+g;let S=Math.PI/180;if(Math.abs(f-v)<S&&(S=Math.abs(f-v)),g<0)for(let w=f-S;w>v;w-=S){const y=wt.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],w,0);e.push(y.x,y.y)}else for(let w=f+S;w<v;w+=S){const y=wt.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],w,0);e.push(y.x,y.y)}}else if(d.command==="C")for(let f=0;f<=1;f+=.01){const g=wt.getPointOnCubicBezier(f,d.start.x,d.start.y,d.points[0],d.points[1],d.points[2],d.points[3],d.points[4],d.points[5]);e.push(g.x,g.y)}else e=e.concat(d.points)});let n=e[0],r=e[0],i=e[1],o=e[1],l,u;for(let d=0;d<e.length/2;d++)l=e[d*2],u=e[d*2+1],isNaN(l)||(n=Math.min(n,l),r=Math.max(r,l)),isNaN(u)||(i=Math.min(i,u),o=Math.max(o,u));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(e){return wt.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,r,i){return Math.sqrt((r-e)*(r-e)+(i-n)*(i-n))}static getPathLength(e){let n=0;for(let r=0;r<e.length;++r)n+=e[r].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let r,i=0,o=n.length;if(!o)return null;for(;i<o&&e>n[i].pathLength;)e-=n[i].pathLength,++i;if(i===o)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(e<.01)return n[i].command==="M"?(r=n[i].points.slice(0,2),{x:r[0],y:r[1]}):{x:n[i].start.x,y:n[i].start.y};const l=n[i],u=l.points;switch(l.command){case"L":return wt.getPointOnLine(e,l.start.x,l.start.y,u[0],u[1]);case"C":return wt.getPointOnCubicBezier((0,Ro.t2length)(e,wt.getPathLength(n),E=>(0,Ro.getCubicArcLength)([l.start.x,u[0],u[2],u[4]],[l.start.y,u[1],u[3],u[5]],E)),l.start.x,l.start.y,u[0],u[1],u[2],u[3],u[4],u[5]);case"Q":return wt.getPointOnQuadraticBezier((0,Ro.t2length)(e,wt.getPathLength(n),E=>(0,Ro.getQuadraticArcLength)([l.start.x,u[0],u[2]],[l.start.y,u[1],u[3]],E)),l.start.x,l.start.y,u[0],u[1],u[2],u[3]);case"A":const d=u[0],f=u[1],g=u[2],v=u[3],S=u[5],w=u[6];let y=u[4];return y+=S*e/l.pathLength,wt.getPointOnEllipticalArc(d,f,g,v,y,w)}return null}static getPointOnLine(e,n,r,i,o,l,u){l=l??n,u=u??r;const d=this.getLineLength(n,r,i,o);if(d<1e-10)return{x:n,y:r};if(i===n)return{x:l,y:u+(o>r?e:-e)};const f=(o-r)/(i-n),g=Math.sqrt(e*e/(1+f*f))*(i<n?-1:1),v=f*g;if(Math.abs(u-r-f*(l-n))<1e-10)return{x:l+g,y:u+v};const S=((l-n)*(i-n)+(u-r)*(o-r))/(d*d),w=n+S*(i-n),y=r+S*(o-r),E=this.getLineLength(l,u,w,y),C=Math.sqrt(e*e-E*E),P=Math.sqrt(C*C/(1+f*f))*(i<n?-1:1),k=f*P;return{x:w+P,y:y+k}}static getPointOnCubicBezier(e,n,r,i,o,l,u,d,f){function g(C){return C*C*C}function v(C){return 3*C*C*(1-C)}function S(C){return 3*C*(1-C)*(1-C)}function w(C){return(1-C)*(1-C)*(1-C)}const y=d*g(e)+l*v(e)+i*S(e)+n*w(e),E=f*g(e)+u*v(e)+o*S(e)+r*w(e);return{x:y,y:E}}static getPointOnQuadraticBezier(e,n,r,i,o,l,u){function d(w){return w*w}function f(w){return 2*w*(1-w)}function g(w){return(1-w)*(1-w)}const v=l*d(e)+i*f(e)+n*g(e),S=u*d(e)+o*f(e)+r*g(e);return{x:v,y:S}}static getPointOnEllipticalArc(e,n,r,i,o,l){const u=Math.cos(l),d=Math.sin(l),f={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:e+(f.x*u-f.y*d),y:n+(f.x*d+f.y*u)}}static parsePathData(e){if(!e)return[];let n=e;const r=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(let v=0;v<r.length;v++)n=n.replace(new RegExp(r[v],"g"),"|"+r[v]);const i=n.split("|"),o=[],l=[];let u=0,d=0;const f=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let g;for(let v=1;v<i.length;v++){let S=i[v],w=S.charAt(0);for(S=S.slice(1),l.length=0;g=f.exec(S);)l.push(g[0]);const y=[];for(let E=0,C=l.length;E<C;E++){if(l[E]==="00"){y.push(0,0);continue}const P=parseFloat(l[E]);isNaN(P)?y.push(0):y.push(P)}for(;y.length>0&&!isNaN(y[0]);){let E="",C=[];const P=u,k=d;let m,x,T,F,L,O,j,M,G,K;switch(w){case"l":u+=y.shift(),d+=y.shift(),E="L",C.push(u,d);break;case"L":u=y.shift(),d=y.shift(),C.push(u,d);break;case"m":const X=y.shift(),ie=y.shift();if(u+=X,d+=ie,E="M",o.length>2&&o[o.length-1].command==="z"){for(let Z=o.length-2;Z>=0;Z--)if(o[Z].command==="M"){u=o[Z].points[0]+X,d=o[Z].points[1]+ie;break}}C.push(u,d),w="l";break;case"M":u=y.shift(),d=y.shift(),E="M",C.push(u,d),w="L";break;case"h":u+=y.shift(),E="L",C.push(u,d);break;case"H":u=y.shift(),E="L",C.push(u,d);break;case"v":d+=y.shift(),E="L",C.push(u,d);break;case"V":d=y.shift(),E="L",C.push(u,d);break;case"C":C.push(y.shift(),y.shift(),y.shift(),y.shift()),u=y.shift(),d=y.shift(),C.push(u,d);break;case"c":C.push(u+y.shift(),d+y.shift(),u+y.shift(),d+y.shift()),u+=y.shift(),d+=y.shift(),E="C",C.push(u,d);break;case"S":x=u,T=d,m=o[o.length-1],m.command==="C"&&(x=u+(u-m.points[2]),T=d+(d-m.points[3])),C.push(x,T,y.shift(),y.shift()),u=y.shift(),d=y.shift(),E="C",C.push(u,d);break;case"s":x=u,T=d,m=o[o.length-1],m.command==="C"&&(x=u+(u-m.points[2]),T=d+(d-m.points[3])),C.push(x,T,u+y.shift(),d+y.shift()),u+=y.shift(),d+=y.shift(),E="C",C.push(u,d);break;case"Q":C.push(y.shift(),y.shift()),u=y.shift(),d=y.shift(),C.push(u,d);break;case"q":C.push(u+y.shift(),d+y.shift()),u+=y.shift(),d+=y.shift(),E="Q",C.push(u,d);break;case"T":x=u,T=d,m=o[o.length-1],m.command==="Q"&&(x=u+(u-m.points[0]),T=d+(d-m.points[1])),u=y.shift(),d=y.shift(),E="Q",C.push(x,T,u,d);break;case"t":x=u,T=d,m=o[o.length-1],m.command==="Q"&&(x=u+(u-m.points[0]),T=d+(d-m.points[1])),u+=y.shift(),d+=y.shift(),E="Q",C.push(x,T,u,d);break;case"A":F=y.shift(),L=y.shift(),O=y.shift(),j=y.shift(),M=y.shift(),G=u,K=d,u=y.shift(),d=y.shift(),E="A",C=this.convertEndpointToCenterParameterization(G,K,u,d,j,M,F,L,O);break;case"a":F=y.shift(),L=y.shift(),O=y.shift(),j=y.shift(),M=y.shift(),G=u,K=d,u+=y.shift(),d+=y.shift(),E="A",C=this.convertEndpointToCenterParameterization(G,K,u,d,j,M,F,L,O);break}o.push({command:E||w,points:C,start:{x:P,y:k},pathLength:this.calcLength(P,k,E||w,C)})}(w==="z"||w==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(e,n,r,i){let o,l,u,d;const f=wt;switch(r){case"L":return f.getLineLength(e,n,i[0],i[1]);case"C":return(0,Ro.getCubicArcLength)([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,Ro.getQuadraticArcLength)([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;const g=i[4],v=i[5],S=i[4]+v;let w=Math.PI/180;if(Math.abs(g-S)<w&&(w=Math.abs(g-S)),l=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],g,0),v<0)for(d=g-w;d>S;d-=w)u=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],d,0),o+=f.getLineLength(l.x,l.y,u.x,u.y),l=u;else for(d=g+w;d<S;d+=w)u=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],d,0),o+=f.getLineLength(l.x,l.y,u.x,u.y),l=u;return u=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],S,0),o+=f.getLineLength(l.x,l.y,u.x,u.y),o}return 0}static convertEndpointToCenterParameterization(e,n,r,i,o,l,u,d,f){const g=f*(Math.PI/180),v=Math.cos(g)*(e-r)/2+Math.sin(g)*(n-i)/2,S=-1*Math.sin(g)*(e-r)/2+Math.cos(g)*(n-i)/2,w=v*v/(u*u)+S*S/(d*d);w>1&&(u*=Math.sqrt(w),d*=Math.sqrt(w));let y=Math.sqrt((u*u*(d*d)-u*u*(S*S)-d*d*(v*v))/(u*u*(S*S)+d*d*(v*v)));o===l&&(y*=-1),isNaN(y)&&(y=0);const E=y*u*S/d,C=y*-d*v/u,P=(e+r)/2+Math.cos(g)*E-Math.sin(g)*C,k=(n+i)/2+Math.sin(g)*E+Math.cos(g)*C,m=function(M){return Math.sqrt(M[0]*M[0]+M[1]*M[1])},x=function(M,G){return(M[0]*G[0]+M[1]*G[1])/(m(M)*m(G))},T=function(M,G){return(M[0]*G[1]<M[1]*G[0]?-1:1)*Math.acos(x(M,G))},F=T([1,0],[(v-E)/u,(S-C)/d]),L=[(v-E)/u,(S-C)/d],O=[(-1*v-E)/u,(-1*S-C)/d];let j=T(L,O);return x(L,O)<=-1&&(j=Math.PI),x(L,O)>=1&&(j=0),l===0&&j>0&&(j=j-2*Math.PI),l===1&&j<0&&(j=j+2*Math.PI),[P,k,u,d,F,j,g,l]}}Na.Path=wt;wt.prototype.className="Path";wt.prototype._attrsAffectingSize=["data"];(0,qC._registerNode)(wt);QC.Factory.addGetterSetter(wt,"data");Object.defineProperty(sh,"__esModule",{value:!0});sh.Arrow=void 0;const ah=Ce,XC=du,L6=pe,$C=xe,Rv=Na;class ro extends XC.Line{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,r=this.points();let i=r;const o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());const l=this.pointerLength(),u=r.length;let d,f;if(o){const S=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[u-2],r[u-1]],w=Rv.Path.calcLength(i[i.length-4],i[i.length-3],"C",S),y=Rv.Path.getPointOnQuadraticBezier(Math.min(1,1-l/w),S[0],S[1],S[2],S[3],S[4],S[5]);d=r[u-2]-y.x,f=r[u-1]-y.y}else d=r[u-2]-r[u-4],f=r[u-1]-r[u-3];const g=(Math.atan2(f,d)+n)%n,v=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[u-2],r[u-1]),e.rotate(g),e.moveTo(0,0),e.lineTo(-l,v/2),e.lineTo(-l,-v/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),o?(d=(i[0]+i[2])/2-r[0],f=(i[1]+i[3])/2-r[1]):(d=r[2]-r[0],f=r[3]-r[1]),e.rotate((Math.atan2(-f,-d)+n)%n),e.moveTo(0,0),e.lineTo(-l,v/2),e.lineTo(-l,-v/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x,y:e.y-n,width:e.width,height:e.height+n*2}}}sh.Arrow=ro;ro.prototype.className="Arrow";(0,$C._registerNode)(ro);ah.Factory.addGetterSetter(ro,"pointerLength",10,(0,L6.getNumberValidator)());ah.Factory.addGetterSetter(ro,"pointerWidth",10,(0,L6.getNumberValidator)());ah.Factory.addGetterSetter(ro,"pointerAtBeginning",!1);ah.Factory.addGetterSetter(ro,"pointerAtEnding",!0);var lh={};Object.defineProperty(lh,"__esModule",{value:!0});lh.Circle=void 0;const JC=Ce,ZC=Pt,ek=pe,tk=xe;class Ra extends ZC.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}lh.Circle=Ra;Ra.prototype._centroid=!0;Ra.prototype.className="Circle";Ra.prototype._attrsAffectingSize=["radius"];(0,tk._registerNode)(Ra);JC.Factory.addGetterSetter(Ra,"radius",0,(0,ek.getNumberValidator)());var uh={};Object.defineProperty(uh,"__esModule",{value:!0});uh.Ellipse=void 0;const Ig=Ce,nk=Pt,b6=pe,rk=xe;class as extends nk.Shape{_sceneFunc(e){const n=this.radiusX(),r=this.radiusY();e.beginPath(),e.save(),n!==r&&e.scale(1,r/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}uh.Ellipse=as;as.prototype.className="Ellipse";as.prototype._centroid=!0;as.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,rk._registerNode)(as);Ig.Factory.addComponentsGetterSetter(as,"radius",["x","y"]);Ig.Factory.addGetterSetter(as,"radiusX",0,(0,b6.getNumberValidator)());Ig.Factory.addGetterSetter(as,"radiusY",0,(0,b6.getNumberValidator)());var ch={};Object.defineProperty(ch,"__esModule",{value:!0});ch.Image=void 0;const V0=ot,io=Ce,ik=Pt,sk=xe,hu=pe;class $n extends ik.Shape{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",n=>{this._removeImageLoad(n.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let l;if(o){const u=this.attrs.cropWidth,d=this.attrs.cropHeight;u&&d?l=[o,this.cropX(),this.cropY(),u,d,0,0,n,r]:l=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?V0.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),o&&(i&&e.clip(),e.drawImage.apply(e,l))}_hitFunc(e){const n=this.width(),r=this.height(),i=this.cornerRadius();e.beginPath(),i?V0.Util.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n;return(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var e,n;return(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(e,n,r=null){const i=V0.Util.createImageElement();i.onload=function(){const o=new $n({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=e}}ch.Image=$n;$n.prototype.className="Image";(0,sk._registerNode)($n);io.Factory.addGetterSetter($n,"cornerRadius",0,(0,hu.getNumberOrArrayOfNumbersValidator)(4));io.Factory.addGetterSetter($n,"image");io.Factory.addComponentsGetterSetter($n,"crop",["x","y","width","height"]);io.Factory.addGetterSetter($n,"cropX",0,(0,hu.getNumberValidator)());io.Factory.addGetterSetter($n,"cropY",0,(0,hu.getNumberValidator)());io.Factory.addGetterSetter($n,"cropWidth",0,(0,hu.getNumberValidator)());io.Factory.addGetterSetter($n,"cropHeight",0,(0,hu.getNumberValidator)());var fa={};Object.defineProperty(fa,"__esModule",{value:!0});fa.Tag=fa.Label=void 0;const dh=Ce,ok=Pt,ak=Ea,jg=pe,D6=xe,I6=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],lk="Change.konva",uk="none",m1="up",y1="right",v1="down",S1="left",ck=I6.length;class Ug extends ak.Group{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,r;const i=function(){n._sync()};for(r=0;r<ck;r++)e.on(I6[r]+lk,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),r,i,o,l,u,d,f;if(e&&n){switch(r=e.width(),i=e.height(),o=n.pointerDirection(),l=n.pointerWidth(),f=n.pointerHeight(),u=0,d=0,o){case m1:u=r/2,d=-1*f;break;case y1:u=r+l,d=i/2;break;case v1:u=r/2,d=i+f;break;case S1:u=-1*l,d=i/2;break}n.setAttrs({x:-1*u,y:-1*d,width:r,height:i}),e.setAttrs({x:-1*u,y:-1*d})}}}fa.Label=Ug;Ug.prototype.className="Label";(0,D6._registerNode)(Ug);class so extends ok.Shape{_sceneFunc(e){const n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),l=this.pointerHeight(),u=this.cornerRadius();let d=0,f=0,g=0,v=0;typeof u=="number"?d=f=g=v=Math.min(u,n/2,r/2):(d=Math.min(u[0]||0,n/2,r/2),f=Math.min(u[1]||0,n/2,r/2),v=Math.min(u[2]||0,n/2,r/2),g=Math.min(u[3]||0,n/2,r/2)),e.beginPath(),e.moveTo(d,0),i===m1&&(e.lineTo((n-o)/2,0),e.lineTo(n/2,-1*l),e.lineTo((n+o)/2,0)),e.lineTo(n-f,0),e.arc(n-f,f,f,Math.PI*3/2,0,!1),i===y1&&(e.lineTo(n,(r-l)/2),e.lineTo(n+o,r/2),e.lineTo(n,(r+l)/2)),e.lineTo(n,r-v),e.arc(n-v,r-v,v,0,Math.PI/2,!1),i===v1&&(e.lineTo((n+o)/2,r),e.lineTo(n/2,r+l),e.lineTo((n-o)/2,r)),e.lineTo(g,r),e.arc(g,r-g,g,Math.PI/2,Math.PI,!1),i===S1&&(e.lineTo(0,(r+l)/2),e.lineTo(-1*o,r/2),e.lineTo(0,(r-l)/2)),e.lineTo(0,d),e.arc(d,d,d,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),l=this.width(),u=this.height();return o===m1?(n-=i,u+=i):o===v1?u+=i:o===S1?(e-=r*1.5,l+=r):o===y1&&(l+=r*1.5),{x:e,y:n,width:l,height:u}}}fa.Tag=so;so.prototype.className="Tag";(0,D6._registerNode)(so);dh.Factory.addGetterSetter(so,"pointerDirection",uk);dh.Factory.addGetterSetter(so,"pointerWidth",0,(0,jg.getNumberValidator)());dh.Factory.addGetterSetter(so,"pointerHeight",0,(0,jg.getNumberValidator)());dh.Factory.addGetterSetter(so,"cornerRadius",0,(0,jg.getNumberOrArrayOfNumbersValidator)(4));var fu={};Object.defineProperty(fu,"__esModule",{value:!0});fu.Rect=void 0;const dk=Ce,hk=Pt,fk=xe,pk=ot,gk=pe;let hh=class extends hk.Shape{_sceneFunc(e){const n=this.cornerRadius(),r=this.width(),i=this.height();e.beginPath(),n?pk.Util.drawRoundedRectPath(e,r,i,n):e.rect(0,0,r,i),e.closePath(),e.fillStrokeShape(this)}};fu.Rect=hh;hh.prototype.className="Rect";(0,fk._registerNode)(hh);dk.Factory.addGetterSetter(hh,"cornerRadius",0,(0,gk.getNumberOrArrayOfNumbersValidator)(4));var fh={};Object.defineProperty(fh,"__esModule",{value:!0});fh.RegularPolygon=void 0;const j6=Ce,mk=Pt,U6=pe,yk=xe;class oo extends mk.Shape{_sceneFunc(e){const n=this._getPoints();e.beginPath(),e.moveTo(n[0].x,n[0].y);for(let r=1;r<n.length;r++)e.lineTo(n[r].x,n[r].y);e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,r=[];for(let i=0;i<e;i++)r.push({x:n*Math.sin(i*2*Math.PI/e),y:-1*n*Math.cos(i*2*Math.PI/e)});return r}getSelfRect(){const e=this._getPoints();let n=e[0].x,r=e[0].y,i=e[0].x,o=e[0].y;return e.forEach(l=>{n=Math.min(n,l.x),r=Math.max(r,l.x),i=Math.min(i,l.y),o=Math.max(o,l.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}fh.RegularPolygon=oo;oo.prototype.className="RegularPolygon";oo.prototype._centroid=!0;oo.prototype._attrsAffectingSize=["radius"];(0,yk._registerNode)(oo);j6.Factory.addGetterSetter(oo,"radius",0,(0,U6.getNumberValidator)());j6.Factory.addGetterSetter(oo,"sides",0,(0,U6.getNumberValidator)());var ph={};Object.defineProperty(ph,"__esModule",{value:!0});ph.Ring=void 0;const z6=Ce,vk=Pt,B6=pe,Sk=xe,Tv=Math.PI*2;class ao extends vk.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,Tv,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),Tv,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}ph.Ring=ao;ao.prototype.className="Ring";ao.prototype._centroid=!0;ao.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Sk._registerNode)(ao);z6.Factory.addGetterSetter(ao,"innerRadius",0,(0,B6.getNumberValidator)());z6.Factory.addGetterSetter(ao,"outerRadius",0,(0,B6.getNumberValidator)());var gh={};Object.defineProperty(gh,"__esModule",{value:!0});gh.Sprite=void 0;const lo=Ce,_k=Pt,xk=Pa,G6=pe,wk=xe;class br extends _k.Shape{constructor(e){super(e),this._updated=!0,this.anim=new xk.Animation(()=>{const n=this._updated;return this._updated=!1,n}),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(e){const n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],l=this.frameOffsets(),u=o[i+0],d=o[i+1],f=o[i+2],g=o[i+3],v=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,f,g),e.closePath(),e.fillStrokeShape(this)),v)if(l){const S=l[n],w=r*2;e.drawImage(v,u,d,f,g,S[w+0],S[w+1],f,g)}else e.drawImage(v,u,d,f,g,0,0,f,g)}_hitFunc(e){const n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],l=this.frameOffsets(),u=o[i+2],d=o[i+3];if(e.beginPath(),l){const f=l[n],g=r*2;e.rect(f[g+0],f[g+1],u,d)}else e.rect(0,0,u,d);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;e<o-1?this.frameIndex(e+1):this.frameIndex(0)}}gh.Sprite=br;br.prototype.className="Sprite";(0,wk._registerNode)(br);lo.Factory.addGetterSetter(br,"animation");lo.Factory.addGetterSetter(br,"animations");lo.Factory.addGetterSetter(br,"frameOffsets");lo.Factory.addGetterSetter(br,"image");lo.Factory.addGetterSetter(br,"frameIndex",0,(0,G6.getNumberValidator)());lo.Factory.addGetterSetter(br,"frameRate",17,(0,G6.getNumberValidator)());lo.Factory.backCompat(br,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var mh={};Object.defineProperty(mh,"__esModule",{value:!0});mh.Star=void 0;const zg=Ce,Ck=Pt,Bg=pe,kk=xe;class ls extends Ck.Shape{_sceneFunc(e){const n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-r);for(let o=1;o<i*2;o++){const l=o%2===0?r:n,u=l*Math.sin(o*Math.PI/i),d=-1*l*Math.cos(o*Math.PI/i);e.lineTo(u,d)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}mh.Star=ls;ls.prototype.className="Star";ls.prototype._centroid=!0;ls.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,kk._registerNode)(ls);zg.Factory.addGetterSetter(ls,"numPoints",5,(0,Bg.getNumberValidator)());zg.Factory.addGetterSetter(ls,"innerRadius",0,(0,Bg.getNumberValidator)());zg.Factory.addGetterSetter(ls,"outerRadius",0,(0,Bg.getNumberValidator)());var Ta={};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.Text=void 0;Ta.stringToArray=Es;const _1=ot,Zt=Ce,Ek=Pt,W0=xe,us=pe,Pk=xe;function Es(t){return[...t].reduce((e,n,r,i)=>{if(new RegExp("\\p{Emoji}","u").test(n)){const o=i[r+1];o&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(o)?(e.push(n+o),i[r+1]=""):e.push(n)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[r+1]||""))?e.push(n+i[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?e[e.length-1]+=n:n&&e.push(n);return e},[])}const To="auto",Nk="center",H6="inherit",ol="justify",Rk="Change.konva",Tk="2d",Ov="-",V6="left",Ok="text",Fk="Text",Ak="top",Mk="bottom",Fv="middle",W6="normal",Lk="px ",Ac=" ",bk="right",Av="rtl",Dk="word",Ik="char",Mv="none",K0="…",K6=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],jk=K6.length;function Uk(t){return t.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,r=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!r&&(e=`"${e}"`),e}).join(", ")}let Mc;function Q0(){return Mc||(Mc=_1.Util.createCanvasElement().getContext(Tk),Mc)}function zk(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Bk(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Gk(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let dt=class extends Ek.Shape{constructor(e){super(Gk(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<jk;n++)this.on(K6[n]+Rk,this._setTextData);this._setTextData()}_sceneFunc(e){const n=this.textArr,r=n.length;if(!this.text())return;let i=this.padding(),o=this.fontSize(),l=this.lineHeight()*o,u=this.verticalAlign(),d=this.direction(),f=0,g=this.align(),v=this.getWidth(),S=this.letterSpacing(),w=this.fill(),y=this.textDecoration(),E=y.indexOf("underline")!==-1,C=y.indexOf("line-through")!==-1,P;d=d===H6?e.direction:d;let k=l/2,m=Fv;if(W0.Konva._fixTextRendering){const x=this.measureSize("M");m="alphabetic",k=(x.fontBoundingBoxAscent-x.fontBoundingBoxDescent)/2+l/2}for(d===Av&&e.setAttr("direction",d),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",m),e.setAttr("textAlign",V6),u===Fv?f=(this.getHeight()-r*l-i*2)/2:u===Mk&&(f=this.getHeight()-r*l-i*2),e.translate(i,f+i),P=0;P<r;P++){let x=0,T=0;const F=n[P],L=F.text,O=F.width,j=F.lastInParagraph;if(e.save(),g===bk?x+=v-O-i*2:g===Nk&&(x+=(v-O-i*2)/2),E){e.save(),e.beginPath();const M=W0.Konva._fixTextRendering?Math.round(o/4):Math.round(o/2),G=x,K=k+T+M;e.moveTo(G,K);const X=g===ol&&!j?v-i*2:O;e.lineTo(G+Math.round(X),K),e.lineWidth=o/15;const ie=this._getLinearGradient();e.strokeStyle=ie||w,e.stroke(),e.restore()}if(C){e.save(),e.beginPath();const M=W0.Konva._fixTextRendering?-Math.round(o/4):0;e.moveTo(x,k+T+M);const G=g===ol&&!j?v-i*2:O;e.lineTo(x+Math.round(G),k+T+M),e.lineWidth=o/15;const K=this._getLinearGradient();e.strokeStyle=K||w,e.stroke(),e.restore()}if(d!==Av&&(S!==0||g===ol)){const M=L.split(" ").length-1,G=Es(L);for(let K=0;K<G.length;K++){const X=G[K];X===" "&&!j&&g===ol&&(x+=(v-i*2-O)/M),this._partialTextX=x,this._partialTextY=k+T,this._partialText=X,e.fillStrokeShape(this),x+=this.measureSize(X).width+S}}else S!==0&&e.setAttr("letterSpacing",`${S}px`),this._partialTextX=x,this._partialTextY=k+T,this._partialText=L,e.fillStrokeShape(this);e.restore(),r>1&&(k+=l)}}_hitFunc(e){const n=this.getWidth(),r=this.getHeight();e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=_1.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(Ok,n),this}getWidth(){return this.attrs.width===To||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===To||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return _1.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n,r,i,o,l,u,d,f,g,v,S;let w=Q0(),y=this.fontSize(),E;w.save(),w.font=this._getContextFont(),E=w.measureText(e),w.restore();const C=y/100;return{actualBoundingBoxAscent:(n=E.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*C,actualBoundingBoxDescent:(r=E.actualBoundingBoxDescent)!==null&&r!==void 0?r:0,actualBoundingBoxLeft:(i=E.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*C,actualBoundingBoxRight:(o=E.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*C,alphabeticBaseline:(l=E.alphabeticBaseline)!==null&&l!==void 0?l:0,emHeightAscent:(u=E.emHeightAscent)!==null&&u!==void 0?u:100*C,emHeightDescent:(d=E.emHeightDescent)!==null&&d!==void 0?d:-20*C,fontBoundingBoxAscent:(f=E.fontBoundingBoxAscent)!==null&&f!==void 0?f:91*C,fontBoundingBoxDescent:(g=E.fontBoundingBoxDescent)!==null&&g!==void 0?g:21*C,hangingBaseline:(v=E.hangingBaseline)!==null&&v!==void 0?v:72.80000305175781*C,ideographicBaseline:(S=E.ideographicBaseline)!==null&&S!==void 0?S:-21*C,width:E.width,height:y}}_getContextFont(){return this.fontStyle()+Ac+this.fontVariant()+Ac+(this.fontSize()+Lk)+Uk(this.fontFamily())}_addTextLine(e){this.align()===ol&&(e=e.trim());const r=this._getTextWidth(e);return this.textArr.push({text:e,width:r,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),r=e.length;return Q0().measureText(e).width+n*r}_setTextData(){let e=this.text().split(`
`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,l=this.attrs.height,u=o!==To&&o!==void 0,d=l!==To&&l!==void 0,f=this.padding(),g=o-f*2,v=l-f*2,S=0,w=this.wrap(),y=w!==Mv,E=w!==Ik&&y,C=this.ellipsis();this.textArr=[],Q0().font=this._getContextFont();const P=C?this._getTextWidth(K0):0;for(let k=0,m=e.length;k<m;++k){let x=e[k],T=this._getTextWidth(x);if(u&&T>g)for(;x.length>0;){let F=0,L=Es(x).length,O="",j=0;for(;F<L;){const M=F+L>>>1,G=Es(x),K=G.slice(0,M+1).join(""),X=this._getTextWidth(K);(C&&d&&S+i>v?X+P:X)<=g?(F=M+1,O=K,j=X):L=M}if(O){if(E){const K=Es(x),X=Es(O),ie=K[X.length],Z=ie===Ac||ie===Ov;let he;if(Z&&j<=g)he=X.length;else{const ke=X.lastIndexOf(Ac),V=X.lastIndexOf(Ov);he=Math.max(ke,V)+1}he>0&&(F=he,O=K.slice(0,F).join(""),j=this._getTextWidth(O))}if(O=O.trimRight(),this._addTextLine(O),r=Math.max(r,j),S+=i,this._shouldHandleEllipsis(S)){this._tryToAddEllipsisToLastLine();break}if(x=Es(x).slice(F).join("").trimLeft(),x.length>0&&(T=this._getTextWidth(x),T<=g)){this._addTextLine(x),S+=i,r=Math.max(r,T);break}}else break}else this._addTextLine(x),S+=i,r=Math.max(r,T),this._shouldHandleEllipsis(S)&&k<m-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),d&&S+i>v)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(e){const n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==To&&i!==void 0,l=this.padding(),u=i-l*2;return!(this.wrap()!==Mv)||o&&e+r>u}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==To&&e!==void 0,r=this.padding(),i=e-r*2,o=this.ellipsis(),l=this.textArr[this.textArr.length-1];!l||!o||(n&&(this._getTextWidth(l.text+K0)<i||(l.text=l.text.slice(0,l.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(l.text+K0))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return e&&n?!0:super._useBufferCanvas()}};Ta.Text=dt;dt.prototype._fillFunc=zk;dt.prototype._strokeFunc=Bk;dt.prototype.className=Fk;dt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,Pk._registerNode)(dt);Zt.Factory.overWriteSetter(dt,"width",(0,us.getNumberOrAutoValidator)());Zt.Factory.overWriteSetter(dt,"height",(0,us.getNumberOrAutoValidator)());Zt.Factory.addGetterSetter(dt,"direction",H6);Zt.Factory.addGetterSetter(dt,"fontFamily","Arial");Zt.Factory.addGetterSetter(dt,"fontSize",12,(0,us.getNumberValidator)());Zt.Factory.addGetterSetter(dt,"fontStyle",W6);Zt.Factory.addGetterSetter(dt,"fontVariant",W6);Zt.Factory.addGetterSetter(dt,"padding",0,(0,us.getNumberValidator)());Zt.Factory.addGetterSetter(dt,"align",V6);Zt.Factory.addGetterSetter(dt,"verticalAlign",Ak);Zt.Factory.addGetterSetter(dt,"lineHeight",1,(0,us.getNumberValidator)());Zt.Factory.addGetterSetter(dt,"wrap",Dk);Zt.Factory.addGetterSetter(dt,"ellipsis",!1,(0,us.getBooleanValidator)());Zt.Factory.addGetterSetter(dt,"letterSpacing",0,(0,us.getNumberValidator)());Zt.Factory.addGetterSetter(dt,"text","",(0,us.getStringValidator)());Zt.Factory.addGetterSetter(dt,"textDecoration","");var yh={};Object.defineProperty(yh,"__esModule",{value:!0});yh.TextPath=void 0;const q0=ot,gr=Ce,Hk=Pt,al=Na,Y0=Ta,Q6=pe,Vk=xe,Wk="",q6="normal";function Y6(t){t.fillText(this.partialText,0,0)}function X6(t){t.strokeText(this.partialText,0,0)}class Nt extends Hk.Shape{constructor(e){super(e),this.dummyCanvas=q0.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return al.Path.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e-1>n?null:al.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=al.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const n=this.textDecoration(),r=this.fill(),i=this.fontSize(),o=this.glyphInfo;n==="underline"&&e.beginPath();for(let l=0;l<o.length;l++){e.save();const u=o[l].p0;e.translate(u.x,u.y),e.rotate(o[l].rotation),this.partialText=o[l].text,e.fillStrokeShape(this),n==="underline"&&(l===0&&e.moveTo(0,i/2+1),e.lineTo(i,i/2+1)),e.restore()}n==="underline"&&(e.strokeStyle=r,e.lineWidth=i/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();const n=this.glyphInfo;if(n.length>=1){const r=n[0].p0;e.moveTo(r.x,r.y)}for(let r=0;r<n.length;r++){const i=n[r].p1;e.lineTo(i.x,i.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return q0.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return Y0.Text.prototype.setText.call(this,e)}_getContextFont(){return Y0.Text.prototype._getContextFont.call(this)}_getTextSize(e){const r=this.dummyCanvas.getContext("2d");r.save(),r.font=this._getContextFont();const i=r.measureText(e);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:e,height:n}=this._getTextSize(this.attrs.text);if(this.textWidth=e,this.textHeight=n,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),i=this.align(),o=this.kerningFunc(),l=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let u=0;i==="center"&&(u=Math.max(0,this.pathLength/2-l/2)),i==="right"&&(u=Math.max(0,this.pathLength-l));const d=(0,Y0.stringToArray)(this.text());let f=u;for(let g=0;g<d.length;g++){const v=this._getPointAtLength(f);if(!v)return;let S=this._getTextSize(d[g]).width+r;if(d[g]===" "&&i==="justify"){const k=this.text().split(" ").length-1;S+=(this.pathLength-l)/k}const w=this._getPointAtLength(f+S);if(!w)return;const y=al.Path.getLineLength(v.x,v.y,w.x,w.y);let E=0;if(o)try{E=o(d[g-1],d[g])*this.fontSize()}catch{E=0}v.x+=E,w.x+=E,this.textWidth+=E;const C=al.Path.getPointOnLine(E+y/2,v.x,v.y,w.x,w.y),P=Math.atan2(w.y-v.y,w.x-v.x);this.glyphInfo.push({transposeX:C.x,transposeY:C.y,text:d[g],rotation:P,p0:v,p1:w}),f+=S}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(f){e.push(f.p0.x),e.push(f.p0.y),e.push(f.p1.x),e.push(f.p1.y)});let n=e[0]||0,r=e[0]||0,i=e[1]||0,o=e[1]||0,l,u;for(let f=0;f<e.length/2;f++)l=e[f*2],u=e[f*2+1],n=Math.min(n,l),r=Math.max(r,l),i=Math.min(i,u),o=Math.max(o,u);const d=this.fontSize();return{x:n-d/2,y:i-d/2,width:r-n+d,height:o-i+d}}destroy(){return q0.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}yh.TextPath=Nt;Nt.prototype._fillFunc=Y6;Nt.prototype._strokeFunc=X6;Nt.prototype._fillFuncHit=Y6;Nt.prototype._strokeFuncHit=X6;Nt.prototype.className="TextPath";Nt.prototype._attrsAffectingSize=["text","fontSize","data"];(0,Vk._registerNode)(Nt);gr.Factory.addGetterSetter(Nt,"data");gr.Factory.addGetterSetter(Nt,"fontFamily","Arial");gr.Factory.addGetterSetter(Nt,"fontSize",12,(0,Q6.getNumberValidator)());gr.Factory.addGetterSetter(Nt,"fontStyle",q6);gr.Factory.addGetterSetter(Nt,"align","left");gr.Factory.addGetterSetter(Nt,"letterSpacing",0,(0,Q6.getNumberValidator)());gr.Factory.addGetterSetter(Nt,"textBaseline","middle");gr.Factory.addGetterSetter(Nt,"fontVariant",q6);gr.Factory.addGetterSetter(Nt,"text",Wk);gr.Factory.addGetterSetter(Nt,"textDecoration","");gr.Factory.addGetterSetter(Nt,"kerningFunc",void 0);var vh={};Object.defineProperty(vh,"__esModule",{value:!0});vh.Transformer=void 0;const je=ot,Le=Ce,Lv=et,Kk=Pt,Qk=fu,bv=Ea,or=xe,cs=pe,qk=xe,$6="tr-konva",Yk=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${$6}`).join(" "),Dv="nodesRect",Xk=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],$k={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},Jk="ontouchstart"in or.Konva._global;function Zk(t,e,n){if(t==="rotater")return n;e+=je.Util.degToRad($k[t]||0);const r=(je.Util.radToDeg(e)%360+360)%360;return je.Util._inRange(r,315+22.5,360)||je.Util._inRange(r,0,22.5)?"ns-resize":je.Util._inRange(r,45-22.5,45+22.5)?"nesw-resize":je.Util._inRange(r,90-22.5,90+22.5)?"ew-resize":je.Util._inRange(r,135-22.5,135+22.5)?"nwse-resize":je.Util._inRange(r,180-22.5,180+22.5)?"ns-resize":je.Util._inRange(r,225-22.5,225+22.5)?"nesw-resize":je.Util._inRange(r,270-22.5,270+22.5)?"ew-resize":je.Util._inRange(r,315-22.5,315+22.5)?"nwse-resize":(je.Util.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}const Td=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function eE(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function J6(t,e,n){const r=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),i=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:r,y:i}}function tE(t,e){const n=eE(t);return J6(t,e,n)}function nE(t,e,n){let r=e;for(let i=0;i<t.length;i++){const o=or.Konva.getAngle(t[i]),l=Math.abs(o-e)%(Math.PI*2);Math.min(l,Math.PI*2-l)<n&&(r=o)}return r}let x1=0,Te=class extends bv.Group{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(Yk,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return je.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return $6+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(i=>i.isAncestorOf(this)?(je.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(i._attrsAffectingSize.length){const l=i._attrsAffectingSize.map(u=>u+"Change."+this._getEventNamespace()).join(" ");i.on(l,o)}i.on(Xk.map(l=>l+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let n;e.on(`dragstart.${this._getEventNamespace()}`,r=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(r,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=e.getAbsolutePosition(),o=i.x-n.x,l=i.y-n.y;this.nodes().forEach(u=>{if(u===e||u.isDragging())return;const d=u.getAbsolutePosition();u.setAbsolutePosition({x:d.x+o,y:d.y+l}),u.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(Dv),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Dv,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),r){const i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(r),l=e.getAbsolutePosition(r),u=i.x*o.x-e.offsetX()*o.x,d=i.y*o.y-e.offsetY()*o.y,f=(or.Konva.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),g={x:l.x+u*Math.cos(f)+d*Math.sin(-f),y:l.y+d*Math.cos(f)+u*Math.sin(f),width:i.width*o.x,height:i.height*o.y,rotation:f};return J6(g,-or.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const n=[];this.nodes().map(f=>{const g=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),v=[{x:g.x,y:g.y},{x:g.x+g.width,y:g.y},{x:g.x+g.width,y:g.y+g.height},{x:g.x,y:g.y+g.height}],S=f.getAbsoluteTransform();v.forEach(function(w){const y=S.point(w);n.push(y)})});const r=new je.Transform;r.rotate(-or.Konva.getAngle(this.rotation()));let i=1/0,o=1/0,l=-1/0,u=-1/0;n.forEach(function(f){const g=r.point(f);i===void 0&&(i=l=g.x,o=u=g.y),i=Math.min(i,g.x),o=Math.min(o,g.y),l=Math.max(l,g.x),u=Math.max(u,g.y)}),r.invert();const d=r.point({x:i,y:o});return{x:d.x,y:d.y,width:l-i,height:u-o,rotation:or.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),Td.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){const n=new Qk.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Jk?10:"auto"}),r=this;n.on("mousedown touchstart",function(i){r._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{const i=or.Konva.getAngle(this.rotation()),o=this.rotateAnchorCursor(),l=Zk(e,i,o);n.getStage().content&&(n.getStage().content.style.cursor=l),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const e=new Kk.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(n,r){const i=r.getParent(),o=i.padding();n.beginPath(),n.rect(-o,-o,r.width()+o*2,r.height()+o*2),n.moveTo(r.width()/2,-o),i.rotateEnabled()&&i.rotateLineVisible()&&n.lineTo(r.width()/2,-i.rotateAnchorOffset()*je.Util._sign(r.height())-o),n.fillStrokeShape(r)},hitFunc:(n,r)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();n.beginPath(),n.rect(-i,-i,r.width()+i*2,r.height()+i*2),n.fillStrokeShape(r)}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),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 l=e.target.getAbsolutePosition(),u=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:u.x-l.x,y:u.y-l.y},x1++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(d=>{d._fire("transformstart",{evt:e.evt,target:d})})}_handleMouseMove(e){let n,r,i;const o=this.findOne("."+this._movingAnchorName),l=o.getStage();l.setPointersPositions(e);const u=l.getPointerPosition();let d={x:u.x-this._anchorDragOffset.x,y:u.y-this._anchorDragOffset.y};const f=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(d=this.anchorDragBoundFunc()(f,d,e)),o.setAbsolutePosition(d);const g=o.getAbsolutePosition();if(f.x===g.x&&f.y===g.y)return;if(this._movingAnchorName==="rotater"){const k=this._getNodeRect();n=o.x()-k.width/2,r=-o.y()+k.height/2;let m=Math.atan2(-r,n)+Math.PI/2;k.height<0&&(m-=Math.PI);const T=or.Konva.getAngle(this.rotation())+m,F=or.Konva.getAngle(this.rotationSnapTolerance()),O=nE(this.rotationSnaps(),T,F)-k.rotation,j=tE(k,O);this._fitNodesInto(j,e);return}const v=this.shiftBehavior();let S;v==="inverted"?S=this.keepRatio()&&!e.shiftKey:v==="none"?S=this.keepRatio():S=this.keepRatio()||e.shiftKey;let w=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(S){const k=w?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(k.x-o.x(),2)+Math.pow(k.y-o.y(),2));const m=this.findOne(".top-left").x()>k.x?-1:1,x=this.findOne(".top-left").y()>k.y?-1:1;n=i*this.cos*m,r=i*this.sin*x,this.findOne(".top-left").x(k.x-n),this.findOne(".top-left").y(k.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(S){const k=w?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-k.x,2)+Math.pow(k.y-o.y(),2));const m=this.findOne(".top-right").x()<k.x?-1:1,x=this.findOne(".top-right").y()>k.y?-1:1;n=i*this.cos*m,r=i*this.sin*x,this.findOne(".top-right").x(k.x+n),this.findOne(".top-right").y(k.y-r)}var y=o.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(S){const k=w?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(k.x-o.x(),2)+Math.pow(o.y()-k.y,2));const m=k.x<o.x()?-1:1,x=o.y()<k.y?-1:1;n=i*this.cos*m,r=i*this.sin*x,o.x(k.x-n),o.y(k.y+r)}y=o.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(S){const k=w?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(o.x()-k.x,2)+Math.pow(o.y()-k.y,2));const m=this.findOne(".bottom-right").x()<k.x?-1:1,x=this.findOne(".bottom-right").y()<k.y?-1:1;n=i*this.cos*m,r=i*this.sin*x,this.findOne(".bottom-right").x(k.x+n),this.findOne(".bottom-right").y(k.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(w=this.centeredScaling()||e.altKey,w){const k=this.findOne(".top-left"),m=this.findOne(".bottom-right"),x=k.x(),T=k.y(),F=this.getWidth()-m.x(),L=this.getHeight()-m.y();m.move({x:-x,y:-T}),k.move({x:F,y:L})}const E=this.findOne(".top-left").getAbsolutePosition();n=E.x,r=E.y;const C=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),P=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:C,height:P,rotation:or.Konva.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var n;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const r=this.getNode();x1--,this._fire("transformend",{evt:e,target:r}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),r&&this._nodes.forEach(i=>{var o;i._fire("transformend",{evt:e,target:i}),(o=i.getLayer())===null||o===void 0||o.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){const r=this._getNodeRect(),i=1;if(je.Util._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(je.Util._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const o=new je.Transform;if(o.rotate(or.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const S=o.point({x:-this.padding()*2,y:0});e.x+=S.x,e.y+=S.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const S=o.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const S=o.point({x:0,y:-this.padding()*2});e.x+=S.x,e.y+=S.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const S=o.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=S.x,this._anchorDragOffset.y-=S.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const S=this.boundBoxFunc()(r,e);S?e=S:je.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const l=1e7,u=new je.Transform;u.translate(r.x,r.y),u.rotate(r.rotation),u.scale(r.width/l,r.height/l);const d=new je.Transform,f=e.width/l,g=e.height/l;this.flipEnabled()===!1?(d.translate(e.x,e.y),d.rotate(e.rotation),d.translate(e.width<0?e.width:0,e.height<0?e.height:0),d.scale(Math.abs(f),Math.abs(g))):(d.translate(e.x,e.y),d.rotate(e.rotation),d.scale(f,g));const v=d.multiply(u.invert());this._nodes.forEach(S=>{var w;const y=S.getParent().getAbsoluteTransform(),E=S.getTransform().copy();E.translate(S.offsetX(),S.offsetY());const C=new je.Transform;C.multiply(y.copy().invert()).multiply(v).multiply(y).multiply(E);const P=C.decompose();S.setAttrs(P),(w=S.getLayer())===null||w===void 0||w.batchDraw()}),this.rotation(je.Util._getRotation(e.rotation)),this._nodes.forEach(S=>{this._fire("transform",{evt:n,target:S}),S._fire("transform",{evt:n,target:S})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e;const n=this._getNodeRect();this.rotation(je.Util._getRotation(n.rotation));const r=n.width,i=n.height,o=this.enabledAnchors(),l=this.resizeEnabled(),u=this.padding(),d=this.anchorSize(),f=this.find("._anchor");f.forEach(v=>{v.setAttrs({width:d,height:d,offsetX:d/2,offsetY:d/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:d/2+u,offsetY:d/2+u,visible:l&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:d/2+u,visible:l&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:d/2-u,offsetY:d/2+u,visible:l&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:d/2+u,visible:l&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:d/2-u,visible:l&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:d/2+u,offsetY:d/2-u,visible:l&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:d/2-u,visible:l&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:d/2-u,offsetY:d/2-u,visible:l&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*je.Util._sign(i)-u,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const g=this.anchorStyleFunc();g&&f.forEach(v=>{g(v)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),bv.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Lv.Node.prototype.toObject.call(this)}clone(e){return Lv.Node.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};vh.Transformer=Te;Te.isTransforming=()=>x1>0;function rE(t){return t instanceof Array||je.Util.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){Td.indexOf(e)===-1&&je.Util.warn("Unknown anchor name: "+e+". Available names are: "+Td.join(", "))}),t||[]}Te.prototype.className="Transformer";(0,qk._registerNode)(Te);Le.Factory.addGetterSetter(Te,"enabledAnchors",Td,rE);Le.Factory.addGetterSetter(Te,"flipEnabled",!0,(0,cs.getBooleanValidator)());Le.Factory.addGetterSetter(Te,"resizeEnabled",!0);Le.Factory.addGetterSetter(Te,"anchorSize",10,(0,cs.getNumberValidator)());Le.Factory.addGetterSetter(Te,"rotateEnabled",!0);Le.Factory.addGetterSetter(Te,"rotateLineVisible",!0);Le.Factory.addGetterSetter(Te,"rotationSnaps",[]);Le.Factory.addGetterSetter(Te,"rotateAnchorOffset",50,(0,cs.getNumberValidator)());Le.Factory.addGetterSetter(Te,"rotateAnchorCursor","crosshair");Le.Factory.addGetterSetter(Te,"rotationSnapTolerance",5,(0,cs.getNumberValidator)());Le.Factory.addGetterSetter(Te,"borderEnabled",!0);Le.Factory.addGetterSetter(Te,"anchorStroke","rgb(0, 161, 255)");Le.Factory.addGetterSetter(Te,"anchorStrokeWidth",1,(0,cs.getNumberValidator)());Le.Factory.addGetterSetter(Te,"anchorFill","white");Le.Factory.addGetterSetter(Te,"anchorCornerRadius",0,(0,cs.getNumberValidator)());Le.Factory.addGetterSetter(Te,"borderStroke","rgb(0, 161, 255)");Le.Factory.addGetterSetter(Te,"borderStrokeWidth",1,(0,cs.getNumberValidator)());Le.Factory.addGetterSetter(Te,"borderDash");Le.Factory.addGetterSetter(Te,"keepRatio",!0);Le.Factory.addGetterSetter(Te,"shiftBehavior","default");Le.Factory.addGetterSetter(Te,"centeredScaling",!1);Le.Factory.addGetterSetter(Te,"ignoreStroke",!1);Le.Factory.addGetterSetter(Te,"padding",0,(0,cs.getNumberValidator)());Le.Factory.addGetterSetter(Te,"nodes");Le.Factory.addGetterSetter(Te,"node");Le.Factory.addGetterSetter(Te,"boundBoxFunc");Le.Factory.addGetterSetter(Te,"anchorDragBoundFunc");Le.Factory.addGetterSetter(Te,"anchorStyleFunc");Le.Factory.addGetterSetter(Te,"shouldOverdrawWholeArea",!1);Le.Factory.addGetterSetter(Te,"useSingleNodeRotation",!0);Le.Factory.backCompat(Te,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Sh={};Object.defineProperty(Sh,"__esModule",{value:!0});Sh.Wedge=void 0;const _h=Ce,iE=Pt,sE=xe,Z6=pe,oE=xe;class di extends iE.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,sE.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Sh.Wedge=di;di.prototype.className="Wedge";di.prototype._centroid=!0;di.prototype._attrsAffectingSize=["radius"];(0,oE._registerNode)(di);_h.Factory.addGetterSetter(di,"radius",0,(0,Z6.getNumberValidator)());_h.Factory.addGetterSetter(di,"angle",0,(0,Z6.getNumberValidator)());_h.Factory.addGetterSetter(di,"clockwise",!1);_h.Factory.backCompat(di,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var xh={};Object.defineProperty(xh,"__esModule",{value:!0});xh.Blur=void 0;const Iv=Ce,aE=et,lE=pe;function jv(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const uE=[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],cE=[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 dE(t,e){const n=t.data,r=t.width,i=t.height;let o,l,u,d,f,g,v,S,w,y,E,C,P,k,m,x,T,F,L,O;const j=e+e+1,M=r-1,G=i-1,K=e+1,X=K*(K+1)/2,ie=new jv,Z=uE[e],he=cE[e];let ke=null,V=ie,ee=null,$=null;for(let J=1;J<j;J++)V=V.next=new jv,J===K&&(ke=V);V.next=ie,u=l=0;for(let J=0;J<i;J++){C=P=k=m=d=f=g=v=0,S=K*(x=n[l]),w=K*(T=n[l+1]),y=K*(F=n[l+2]),E=K*(L=n[l+3]),d+=X*x,f+=X*T,g+=X*F,v+=X*L,V=ie;for(let le=0;le<K;le++)V.r=x,V.g=T,V.b=F,V.a=L,V=V.next;for(let le=1;le<K;le++)o=l+((M<le?M:le)<<2),d+=(V.r=x=n[o])*(O=K-le),f+=(V.g=T=n[o+1])*O,g+=(V.b=F=n[o+2])*O,v+=(V.a=L=n[o+3])*O,C+=x,P+=T,k+=F,m+=L,V=V.next;ee=ie,$=ke;for(let le=0;le<r;le++)n[l+3]=L=v*Z>>he,L!==0?(L=255/L,n[l]=(d*Z>>he)*L,n[l+1]=(f*Z>>he)*L,n[l+2]=(g*Z>>he)*L):n[l]=n[l+1]=n[l+2]=0,d-=S,f-=w,g-=y,v-=E,S-=ee.r,w-=ee.g,y-=ee.b,E-=ee.a,o=u+((o=le+e+1)<M?o:M)<<2,C+=ee.r=n[o],P+=ee.g=n[o+1],k+=ee.b=n[o+2],m+=ee.a=n[o+3],d+=C,f+=P,g+=k,v+=m,ee=ee.next,S+=x=$.r,w+=T=$.g,y+=F=$.b,E+=L=$.a,C-=x,P-=T,k-=F,m-=L,$=$.next,l+=4;u+=r}for(let J=0;J<r;J++){P=k=m=C=f=g=v=d=0,l=J<<2,S=K*(x=n[l]),w=K*(T=n[l+1]),y=K*(F=n[l+2]),E=K*(L=n[l+3]),d+=X*x,f+=X*T,g+=X*F,v+=X*L,V=ie;for(let Ne=0;Ne<K;Ne++)V.r=x,V.g=T,V.b=F,V.a=L,V=V.next;let le=r;for(let Ne=1;Ne<=e;Ne++)l=le+J<<2,d+=(V.r=x=n[l])*(O=K-Ne),f+=(V.g=T=n[l+1])*O,g+=(V.b=F=n[l+2])*O,v+=(V.a=L=n[l+3])*O,C+=x,P+=T,k+=F,m+=L,V=V.next,Ne<G&&(le+=r);l=J,ee=ie,$=ke;for(let Ne=0;Ne<i;Ne++)o=l<<2,n[o+3]=L=v*Z>>he,L>0?(L=255/L,n[o]=(d*Z>>he)*L,n[o+1]=(f*Z>>he)*L,n[o+2]=(g*Z>>he)*L):n[o]=n[o+1]=n[o+2]=0,d-=S,f-=w,g-=y,v-=E,S-=ee.r,w-=ee.g,y-=ee.b,E-=ee.a,o=J+((o=Ne+K)<G?o:G)*r<<2,d+=C+=ee.r=n[o],f+=P+=ee.g=n[o+1],g+=k+=ee.b=n[o+2],v+=m+=ee.a=n[o+3],ee=ee.next,S+=x=$.r,w+=T=$.g,y+=F=$.b,E+=L=$.a,C-=x,P-=T,k-=F,m-=L,$=$.next,l+=r}}const hE=function(e){const n=Math.round(this.blurRadius());n>0&&dE(e,n)};xh.Blur=hE;Iv.Factory.addGetterSetter(aE.Node,"blurRadius",0,(0,lE.getNumberValidator)(),Iv.Factory.afterSetFilter);var wh={};Object.defineProperty(wh,"__esModule",{value:!0});wh.Brighten=void 0;const Uv=Ce,fE=et,pE=pe,gE=function(t){const e=this.brightness()*255,n=t.data,r=n.length;for(let i=0;i<r;i+=4)n[i]+=e,n[i+1]+=e,n[i+2]+=e};wh.Brighten=gE;Uv.Factory.addGetterSetter(fE.Node,"brightness",0,(0,pE.getNumberValidator)(),Uv.Factory.afterSetFilter);var Ch={};Object.defineProperty(Ch,"__esModule",{value:!0});Ch.Contrast=void 0;const zv=Ce,mE=et,yE=pe,vE=function(t){const e=Math.pow((this.contrast()+100)/100,2),n=t.data,r=n.length;let i=150,o=150,l=150;for(let u=0;u<r;u+=4)i=n[u],o=n[u+1],l=n[u+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,o/=255,o-=.5,o*=e,o+=.5,o*=255,l/=255,l-=.5,l*=e,l+=.5,l*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,l=l<0?0:l>255?255:l,n[u]=i,n[u+1]=o,n[u+2]=l};Ch.Contrast=vE;zv.Factory.addGetterSetter(mE.Node,"contrast",0,(0,yE.getNumberValidator)(),zv.Factory.afterSetFilter);var kh={};Object.defineProperty(kh,"__esModule",{value:!0});kh.Emboss=void 0;const ts=Ce,Eh=et,SE=ot,e8=pe,_E=function(t){const e=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=t.data,l=t.width,u=t.height,d=l*4;let f=0,g=0,v=u;switch(r){case"top-left":f=-1,g=-1;break;case"top":f=-1,g=0;break;case"top-right":f=-1,g=1;break;case"right":f=0,g=1;break;case"bottom-right":f=1,g=1;break;case"bottom":f=1,g=0;break;case"bottom-left":f=1,g=-1;break;case"left":f=0,g=-1;break;default:SE.Util.error("Unknown emboss direction: "+r)}do{const S=(v-1)*d;let w=f;v+w<1&&(w=0),v+w>u&&(w=0);const y=(v-1+w)*l*4;let E=l;do{const C=S+(E-1)*4;let P=g;E+P<1&&(P=0),E+P>l&&(P=0);const k=y+(E-1+P)*4,m=o[C]-o[k],x=o[C+1]-o[k+1],T=o[C+2]-o[k+2];let F=m;const L=F>0?F:-F,O=x>0?x:-x,j=T>0?T:-T;if(O>L&&(F=x),j>L&&(F=T),F*=e,i){const M=o[C]+F,G=o[C+1]+F,K=o[C+2]+F;o[C]=M>255?255:M<0?0:M,o[C+1]=G>255?255:G<0?0:G,o[C+2]=K>255?255:K<0?0:K}else{let M=n-F;M<0?M=0:M>255&&(M=255),o[C]=o[C+1]=o[C+2]=M}}while(--E)}while(--v)};kh.Emboss=_E;ts.Factory.addGetterSetter(Eh.Node,"embossStrength",.5,(0,e8.getNumberValidator)(),ts.Factory.afterSetFilter);ts.Factory.addGetterSetter(Eh.Node,"embossWhiteLevel",.5,(0,e8.getNumberValidator)(),ts.Factory.afterSetFilter);ts.Factory.addGetterSetter(Eh.Node,"embossDirection","top-left",void 0,ts.Factory.afterSetFilter);ts.Factory.addGetterSetter(Eh.Node,"embossBlend",!1,void 0,ts.Factory.afterSetFilter);var Ph={};Object.defineProperty(Ph,"__esModule",{value:!0});Ph.Enhance=void 0;const Bv=Ce,xE=et,wE=pe;function X0(t,e,n,r,i){const o=n-e,l=i-r;if(o===0)return r+l/2;if(l===0)return r;let u=(t-e)/o;return u=l*u+r,u}const CE=function(t){const e=t.data,n=e.length;let r=e[0],i=r,o,l=e[1],u=l,d,f=e[2],g=f,v;const S=this.enhance();if(S===0)return;for(let m=0;m<n;m+=4)o=e[m+0],o<r?r=o:o>i&&(i=o),d=e[m+1],d<l?l=d:d>u&&(u=d),v=e[m+2],v<f?f=v:v>g&&(g=v);i===r&&(i=255,r=0),u===l&&(u=255,l=0),g===f&&(g=255,f=0);let w,y,E,C,P,k;if(S>0)w=i+S*(255-i),y=r-S*(r-0),E=u+S*(255-u),C=l-S*(l-0),P=g+S*(255-g),k=f-S*(f-0);else{const m=(i+r)*.5;w=i+S*(i-m),y=r+S*(r-m);const x=(u+l)*.5;E=u+S*(u-x),C=l+S*(l-x);const T=(g+f)*.5;P=g+S*(g-T),k=f+S*(f-T)}for(let m=0;m<n;m+=4)e[m+0]=X0(e[m+0],r,i,y,w),e[m+1]=X0(e[m+1],l,u,C,E),e[m+2]=X0(e[m+2],f,g,k,P)};Ph.Enhance=CE;Bv.Factory.addGetterSetter(xE.Node,"enhance",0,(0,wE.getNumberValidator)(),Bv.Factory.afterSetFilter);var Nh={};Object.defineProperty(Nh,"__esModule",{value:!0});Nh.Grayscale=void 0;const kE=function(t){const e=t.data,n=e.length;for(let r=0;r<n;r+=4){const i=.34*e[r]+.5*e[r+1]+.16*e[r+2];e[r]=i,e[r+1]=i,e[r+2]=i}};Nh.Grayscale=kE;var Rh={};Object.defineProperty(Rh,"__esModule",{value:!0});Rh.HSL=void 0;const pa=Ce,Gg=et,Hg=pe;pa.Factory.addGetterSetter(Gg.Node,"hue",0,(0,Hg.getNumberValidator)(),pa.Factory.afterSetFilter);pa.Factory.addGetterSetter(Gg.Node,"saturation",0,(0,Hg.getNumberValidator)(),pa.Factory.afterSetFilter);pa.Factory.addGetterSetter(Gg.Node,"luminance",0,(0,Hg.getNumberValidator)(),pa.Factory.afterSetFilter);const EE=function(t){const e=t.data,n=e.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,l=this.luminance()*127,u=r*i*Math.cos(o*Math.PI/180),d=r*i*Math.sin(o*Math.PI/180),f=.299*r+.701*u+.167*d,g=.587*r-.587*u+.33*d,v=.114*r-.114*u-.497*d,S=.299*r-.299*u-.328*d,w=.587*r+.413*u+.035*d,y=.114*r-.114*u+.293*d,E=.299*r-.3*u+1.25*d,C=.587*r-.586*u-1.05*d,P=.114*r+.886*u-.2*d;let k,m,x,T;for(let F=0;F<n;F+=4)k=e[F+0],m=e[F+1],x=e[F+2],T=e[F+3],e[F+0]=f*k+g*m+v*x+l,e[F+1]=S*k+w*m+y*x+l,e[F+2]=E*k+C*m+P*x+l,e[F+3]=T};Rh.HSL=EE;var Th={};Object.defineProperty(Th,"__esModule",{value:!0});Th.HSV=void 0;const ga=Ce,Vg=et,Wg=pe,PE=function(t){const e=t.data,n=e.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,l=r*i*Math.cos(o*Math.PI/180),u=r*i*Math.sin(o*Math.PI/180),d=.299*r+.701*l+.167*u,f=.587*r-.587*l+.33*u,g=.114*r-.114*l-.497*u,v=.299*r-.299*l-.328*u,S=.587*r+.413*l+.035*u,w=.114*r-.114*l+.293*u,y=.299*r-.3*l+1.25*u,E=.587*r-.586*l-1.05*u,C=.114*r+.886*l-.2*u;for(let P=0;P<n;P+=4){const k=e[P+0],m=e[P+1],x=e[P+2],T=e[P+3];e[P+0]=d*k+f*m+g*x,e[P+1]=v*k+S*m+w*x,e[P+2]=y*k+E*m+C*x,e[P+3]=T}};Th.HSV=PE;ga.Factory.addGetterSetter(Vg.Node,"hue",0,(0,Wg.getNumberValidator)(),ga.Factory.afterSetFilter);ga.Factory.addGetterSetter(Vg.Node,"saturation",0,(0,Wg.getNumberValidator)(),ga.Factory.afterSetFilter);ga.Factory.addGetterSetter(Vg.Node,"value",0,(0,Wg.getNumberValidator)(),ga.Factory.afterSetFilter);var Oh={};Object.defineProperty(Oh,"__esModule",{value:!0});Oh.Invert=void 0;const NE=function(t){const e=t.data,n=e.length;for(let r=0;r<n;r+=4)e[r]=255-e[r],e[r+1]=255-e[r+1],e[r+2]=255-e[r+2]};Oh.Invert=NE;var Fh={};Object.defineProperty(Fh,"__esModule",{value:!0});Fh.Kaleidoscope=void 0;const Od=Ce,t8=et,Gv=ot,n8=pe,RE=function(t,e,n){const r=t.data,i=e.data,o=t.width,l=t.height,u=n.polarCenterX||o/2,d=n.polarCenterY||l/2;let f=Math.sqrt(u*u+d*d),g=o-u,v=l-d;const S=Math.sqrt(g*g+v*v);f=S>f?S:f;const w=l,y=o,E=360/y*Math.PI/180;for(let C=0;C<y;C+=1){const P=Math.sin(C*E),k=Math.cos(C*E);for(let m=0;m<w;m+=1){g=Math.floor(u+f*m/w*k),v=Math.floor(d+f*m/w*P);let x=(v*o+g)*4;const T=r[x+0],F=r[x+1],L=r[x+2],O=r[x+3];x=(C+m*o)*4,i[x+0]=T,i[x+1]=F,i[x+2]=L,i[x+3]=O}}},TE=function(t,e,n){const r=t.data,i=e.data,o=t.width,l=t.height,u=n.polarCenterX||o/2,d=n.polarCenterY||l/2;let f=Math.sqrt(u*u+d*d),g=o-u,v=l-d;const S=Math.sqrt(g*g+v*v);f=S>f?S:f;const w=l,y=o,E=0;let C,P;for(g=0;g<o;g+=1)for(v=0;v<l;v+=1){const k=g-u,m=v-d,x=Math.sqrt(k*k+m*m)*w/f;let T=(Math.atan2(m,k)*180/Math.PI+360+E)%360;T=T*y/360,C=Math.floor(T),P=Math.floor(x);let F=(P*o+C)*4;const L=r[F+0],O=r[F+1],j=r[F+2],M=r[F+3];F=(v*o+g)*4,i[F+0]=L,i[F+1]=O,i[F+2]=j,i[F+3]=M}},OE=function(t){const e=t.width,n=t.height;let r,i,o,l,u,d,f,g,v,S,w=Math.round(this.kaleidoscopePower());const y=Math.round(this.kaleidoscopeAngle()),E=Math.floor(e*(y%360)/360);if(w<1)return;const C=Gv.Util.createCanvasElement();C.width=e,C.height=n;const P=C.getContext("2d").getImageData(0,0,e,n);Gv.Util.releaseCanvas(C),RE(t,P,{polarCenterX:e/2,polarCenterY:n/2});let k=e/Math.pow(2,w);for(;k<=8;)k=k*2,w-=1;k=Math.ceil(k);let m=k,x=0,T=m,F=1;for(E+k>e&&(x=m,T=0,F=-1),i=0;i<n;i+=1)for(r=x;r!==T;r+=F)o=Math.round(r+E)%e,v=(e*i+o)*4,u=P.data[v+0],d=P.data[v+1],f=P.data[v+2],g=P.data[v+3],S=(e*i+r)*4,P.data[S+0]=u,P.data[S+1]=d,P.data[S+2]=f,P.data[S+3]=g;for(i=0;i<n;i+=1)for(m=Math.floor(k),l=0;l<w;l+=1){for(r=0;r<m+1;r+=1)v=(e*i+r)*4,u=P.data[v+0],d=P.data[v+1],f=P.data[v+2],g=P.data[v+3],S=(e*i+m*2-r-1)*4,P.data[S+0]=u,P.data[S+1]=d,P.data[S+2]=f,P.data[S+3]=g;m*=2}TE(P,t,{})};Fh.Kaleidoscope=OE;Od.Factory.addGetterSetter(t8.Node,"kaleidoscopePower",2,(0,n8.getNumberValidator)(),Od.Factory.afterSetFilter);Od.Factory.addGetterSetter(t8.Node,"kaleidoscopeAngle",0,(0,n8.getNumberValidator)(),Od.Factory.afterSetFilter);var Ah={};Object.defineProperty(Ah,"__esModule",{value:!0});Ah.Mask=void 0;const Hv=Ce,FE=et,AE=pe;function Lc(t,e,n){let r=(n*t.width+e)*4;const i=[];return i.push(t.data[r++],t.data[r++],t.data[r++],t.data[r++]),i}function ll(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function ME(t){const e=[0,0,0];for(let n=0;n<t.length;n++)e[0]+=t[n][0],e[1]+=t[n][1],e[2]+=t[n][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function LE(t,e){const n=Lc(t,0,0),r=Lc(t,t.width-1,0),i=Lc(t,0,t.height-1),o=Lc(t,t.width-1,t.height-1),l=e||10;if(ll(n,r)<l&&ll(r,o)<l&&ll(o,i)<l&&ll(i,n)<l){const u=ME([r,n,o,i]),d=[];for(let f=0;f<t.width*t.height;f++){const g=ll(u,[t.data[f*4],t.data[f*4+1],t.data[f*4+2]]);d[f]=g<l?0:255}return d}}function bE(t,e){for(let n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function DE(t,e,n){const r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),l=[];for(let u=0;u<n;u++)for(let d=0;d<e;d++){const f=u*e+d;let g=0;for(let v=0;v<i;v++)for(let S=0;S<i;S++){const w=u+v-o,y=d+S-o;if(w>=0&&w<n&&y>=0&&y<e){const E=w*e+y,C=r[v*i+S];g+=t[E]*C}}l[f]=g===255*8?255:0}return l}function IE(t,e,n){const r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),l=[];for(let u=0;u<n;u++)for(let d=0;d<e;d++){const f=u*e+d;let g=0;for(let v=0;v<i;v++)for(let S=0;S<i;S++){const w=u+v-o,y=d+S-o;if(w>=0&&w<n&&y>=0&&y<e){const E=w*e+y,C=r[v*i+S];g+=t[E]*C}}l[f]=g>=255*4?255:0}return l}function jE(t,e,n){const r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),l=[];for(let u=0;u<n;u++)for(let d=0;d<e;d++){const f=u*e+d;let g=0;for(let v=0;v<i;v++)for(let S=0;S<i;S++){const w=u+v-o,y=d+S-o;if(w>=0&&w<n&&y>=0&&y<e){const E=w*e+y,C=r[v*i+S];g+=t[E]*C}}l[f]=g}return l}const UE=function(t){const e=this.threshold();let n=LE(t,e);return n&&(n=DE(n,t.width,t.height),n=IE(n,t.width,t.height),n=jE(n,t.width,t.height),bE(t,n)),t};Ah.Mask=UE;Hv.Factory.addGetterSetter(FE.Node,"threshold",0,(0,AE.getNumberValidator)(),Hv.Factory.afterSetFilter);var Mh={};Object.defineProperty(Mh,"__esModule",{value:!0});Mh.Noise=void 0;const Vv=Ce,zE=et,BE=pe,GE=function(t){const e=this.noise()*255,n=t.data,r=n.length,i=e/2;for(let o=0;o<r;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};Mh.Noise=GE;Vv.Factory.addGetterSetter(zE.Node,"noise",.2,(0,BE.getNumberValidator)(),Vv.Factory.afterSetFilter);var Lh={};Object.defineProperty(Lh,"__esModule",{value:!0});Lh.Pixelate=void 0;const Wv=Ce,HE=ot,VE=et,WE=pe,KE=function(t){let e=Math.ceil(this.pixelSize()),n=t.width,r=t.height,i=Math.ceil(n/e),o=Math.ceil(r/e),l=t.data;if(e<=0){HE.Util.error("pixelSize value can not be <= 0");return}for(let u=0;u<i;u+=1)for(let d=0;d<o;d+=1){let f=0,g=0,v=0,S=0;const w=u*e,y=w+e,E=d*e,C=E+e;let P=0;for(let k=w;k<y;k+=1)if(!(k>=n))for(let m=E;m<C;m+=1){if(m>=r)continue;const x=(n*m+k)*4;f+=l[x+0],g+=l[x+1],v+=l[x+2],S+=l[x+3],P+=1}f=f/P,g=g/P,v=v/P,S=S/P;for(let k=w;k<y;k+=1)if(!(k>=n))for(let m=E;m<C;m+=1){if(m>=r)continue;const x=(n*m+k)*4;l[x+0]=f,l[x+1]=g,l[x+2]=v,l[x+3]=S}}};Lh.Pixelate=KE;Wv.Factory.addGetterSetter(VE.Node,"pixelSize",8,(0,WE.getNumberValidator)(),Wv.Factory.afterSetFilter);var bh={};Object.defineProperty(bh,"__esModule",{value:!0});bh.Posterize=void 0;const Kv=Ce,QE=et,qE=pe,YE=function(t){const e=Math.round(this.levels()*254)+1,n=t.data,r=n.length,i=255/e;for(let o=0;o<r;o+=1)n[o]=Math.floor(n[o]/i)*i};bh.Posterize=YE;Kv.Factory.addGetterSetter(QE.Node,"levels",.5,(0,qE.getNumberValidator)(),Kv.Factory.afterSetFilter);var Dh={};Object.defineProperty(Dh,"__esModule",{value:!0});Dh.RGB=void 0;const Fd=Ce,Kg=et,XE=pe,$E=function(t){const e=t.data,n=e.length,r=this.red(),i=this.green(),o=this.blue();for(let l=0;l<n;l+=4){const u=(.34*e[l]+.5*e[l+1]+.16*e[l+2])/255;e[l]=u*r,e[l+1]=u*i,e[l+2]=u*o,e[l+3]=e[l+3]}};Dh.RGB=$E;Fd.Factory.addGetterSetter(Kg.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Fd.Factory.addGetterSetter(Kg.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Fd.Factory.addGetterSetter(Kg.Node,"blue",0,XE.RGBComponent,Fd.Factory.afterSetFilter);var Ih={};Object.defineProperty(Ih,"__esModule",{value:!0});Ih.RGBA=void 0;const Yl=Ce,jh=et,JE=pe,ZE=function(t){const e=t.data,n=e.length,r=this.red(),i=this.green(),o=this.blue(),l=this.alpha();for(let u=0;u<n;u+=4){const d=1-l;e[u]=r*l+e[u]*d,e[u+1]=i*l+e[u+1]*d,e[u+2]=o*l+e[u+2]*d}};Ih.RGBA=ZE;Yl.Factory.addGetterSetter(jh.Node,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Yl.Factory.addGetterSetter(jh.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});Yl.Factory.addGetterSetter(jh.Node,"blue",0,JE.RGBComponent,Yl.Factory.afterSetFilter);Yl.Factory.addGetterSetter(jh.Node,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});var Uh={};Object.defineProperty(Uh,"__esModule",{value:!0});Uh.Sepia=void 0;const eP=function(t){const e=t.data,n=e.length;for(let r=0;r<n;r+=4){const i=e[r+0],o=e[r+1],l=e[r+2];e[r+0]=Math.min(255,i*.393+o*.769+l*.189),e[r+1]=Math.min(255,i*.349+o*.686+l*.168),e[r+2]=Math.min(255,i*.272+o*.534+l*.131)}};Uh.Sepia=eP;var zh={};Object.defineProperty(zh,"__esModule",{value:!0});zh.Solarize=void 0;const tP=function(t){const e=t.data,n=t.width,r=t.height,i=n*4;let o=r;do{const l=(o-1)*i;let u=n;do{const d=l+(u-1)*4;let f=e[d],g=e[d+1],v=e[d+2];f>127&&(f=255-f),g>127&&(g=255-g),v>127&&(v=255-v),e[d]=f,e[d+1]=g,e[d+2]=v}while(--u)}while(--o)};zh.Solarize=tP;var Bh={};Object.defineProperty(Bh,"__esModule",{value:!0});Bh.Threshold=void 0;const Qv=Ce,nP=et,rP=pe,iP=function(t){const e=this.threshold()*255,n=t.data,r=n.length;for(let i=0;i<r;i+=1)n[i]=n[i]<e?0:255};Bh.Threshold=iP;Qv.Factory.addGetterSetter(nP.Node,"threshold",.5,(0,rP.getNumberValidator)(),Qv.Factory.afterSetFilter);Object.defineProperty($d,"__esModule",{value:!0});$d.Konva=void 0;const qv=Nd,sP=nh,oP=sh,aP=lh,lP=uh,uP=ch,Yv=fa,cP=du,dP=Na,hP=fu,fP=fh,pP=ph,gP=gh,mP=mh,yP=Ta,vP=yh,SP=vh,_P=Sh,xP=xh,wP=wh,CP=Ch,kP=kh,EP=Ph,PP=Nh,NP=Rh,RP=Th,TP=Oh,OP=Fh,FP=Ah,AP=Mh,MP=Lh,LP=bh,bP=Dh,DP=Ih,IP=Uh,jP=zh,UP=Bh;$d.Konva=qv.Konva.Util._assign(qv.Konva,{Arc:sP.Arc,Arrow:oP.Arrow,Circle:aP.Circle,Ellipse:lP.Ellipse,Image:uP.Image,Label:Yv.Label,Tag:Yv.Tag,Line:cP.Line,Path:dP.Path,Rect:hP.Rect,RegularPolygon:fP.RegularPolygon,Ring:pP.Ring,Sprite:gP.Sprite,Star:mP.Star,Text:yP.Text,TextPath:vP.TextPath,Transformer:SP.Transformer,Wedge:_P.Wedge,Filters:{Blur:xP.Blur,Brighten:wP.Brighten,Contrast:CP.Contrast,Emboss:kP.Emboss,Enhance:EP.Enhance,Grayscale:PP.Grayscale,HSL:NP.HSL,HSV:RP.HSV,Invert:TP.Invert,Kaleidoscope:OP.Kaleidoscope,Mask:FP.Mask,Noise:AP.Noise,Pixelate:MP.Pixelate,Posterize:LP.Posterize,RGB:bP.RGB,RGBA:DP.RGBA,Sepia:IP.Sepia,Solarize:jP.Solarize,Threshold:UP.Threshold}});var zP=C6.exports;Object.defineProperty(zP,"__esModule",{value:!0});const BP=$d;C6.exports=BP.Konva;var w1={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;var n=Nd;Object.defineProperty(e,"Konva",{enumerable:!0,get:function(){return n.Konva}});const r=Nd;t.exports=r.Konva})(w1,w1.exports);var GP=w1.exports;const Xl=Md(GP);var r8={exports:{}};/**
* @license React
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var HP=function(e){var n={},r=W,i=yl,o=Object.assign;function l(s){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+s,c=1;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,d=Symbol.for("react.element"),f=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),T=Symbol.iterator;function F(s){return s===null||typeof s!="object"?null:(s=T&&s[T]||s["@@iterator"],typeof s=="function"?s:null)}function L(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case g:return"Fragment";case f:return"Portal";case S:return"Profiler";case v:return"StrictMode";case C:return"Suspense";case P:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case y:return(s.displayName||"Context")+".Consumer";case w:return(s._context.displayName||"Context")+".Provider";case E:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case k:return a=s.displayName||null,a!==null?a:L(s.type)||"Memo";case m:a=s._payload,s=s._init;try{return L(s(a))}catch{}}return null}function O(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return L(a);case 8:return a===v?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function j(s){var a=s,c=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,a.flags&4098&&(c=a.return),s=a.return;while(s)}return a.tag===3?c:null}function M(s){if(j(s)!==s)throw Error(l(188))}function G(s){var a=s.alternate;if(!a){if(a=j(s),a===null)throw Error(l(188));return a!==s?null:s}for(var c=s,h=a;;){var p=c.return;if(p===null)break;var _=p.alternate;if(_===null){if(h=p.return,h!==null){c=h;continue}break}if(p.child===_.child){for(_=p.child;_;){if(_===c)return M(p),s;if(_===h)return M(p),a;_=_.sibling}throw Error(l(188))}if(c.return!==h.return)c=p,h=_;else{for(var R=!1,b=p.child;b;){if(b===c){R=!0,c=p,h=_;break}if(b===h){R=!0,h=p,c=_;break}b=b.sibling}if(!R){for(b=_.child;b;){if(b===c){R=!0,c=_,h=p;break}if(b===h){R=!0,h=_,c=p;break}b=b.sibling}if(!R)throw Error(l(189))}}if(c.alternate!==h)throw Error(l(190))}if(c.tag!==3)throw Error(l(188));return c.stateNode.current===c?s:a}function K(s){return s=G(s),s!==null?X(s):null}function X(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var a=X(s);if(a!==null)return a;s=s.sibling}return null}function ie(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){if(s.tag!==4){var a=ie(s);if(a!==null)return a}s=s.sibling}return null}var Z=Array.isArray,he=e.getPublicInstance,ke=e.getRootHostContext,V=e.getChildHostContext,ee=e.prepareForCommit,$=e.resetAfterCommit,J=e.createInstance,le=e.appendInitialChild,Ne=e.finalizeInitialChildren,at=e.prepareUpdate,mt=e.shouldSetTextContent,We=e.createTextInstance,D=e.scheduleTimeout,Q=e.cancelTimeout,ue=e.noTimeout,De=e.isPrimaryRenderer,ve=e.supportsMutation,Ge=e.supportsPersistence,Ke=e.supportsHydration,yr=e.getInstanceFromNode,Ue=e.preparePortalMount,hi=e.getCurrentEventPriority,Jn=e.detachDeletedInstance,fi=e.supportsMicrotasks,z8=e.scheduleMicrotask,Fa=e.supportsTestSelectors,B8=e.findFiberRoot,G8=e.getBoundingRect,H8=e.getTextContent,Aa=e.isHiddenSubtree,V8=e.matchAccessibilityRole,W8=e.setFocusIfFocusable,K8=e.setupIntersectionObserver,Q8=e.appendChild,q8=e.appendChildToContainer,Y8=e.commitTextUpdate,X8=e.commitMount,$8=e.commitUpdate,J8=e.insertBefore,Z8=e.insertInContainerBefore,e9=e.removeChild,t9=e.removeChildFromContainer,em=e.resetTextContent,n9=e.hideInstance,r9=e.hideTextInstance,i9=e.unhideInstance,s9=e.unhideTextInstance,o9=e.clearContainer,a9=e.cloneInstance,tm=e.createContainerChildSet,nm=e.appendChildToContainerChildSet,l9=e.finalizeContainerChildren,$h=e.replaceContainerChildren,rm=e.cloneHiddenInstance,im=e.cloneHiddenTextInstance,u9=e.canHydrateInstance,c9=e.canHydrateTextInstance,d9=e.canHydrateSuspenseInstance,sm=e.isSuspenseInstancePending,Jh=e.isSuspenseInstanceFallback,h9=e.getSuspenseInstanceFallbackErrorDetails,f9=e.registerSuspenseInstanceRetry,Su=e.getNextHydratableSibling,p9=e.getFirstHydratableChild,g9=e.getFirstHydratableChildWithinContainer,m9=e.getFirstHydratableChildWithinSuspenseInstance,y9=e.hydrateInstance,v9=e.hydrateTextInstance,S9=e.hydrateSuspenseInstance,_9=e.getNextHydratableInstanceAfterSuspenseInstance,x9=e.commitHydratedContainer,w9=e.commitHydratedSuspenseInstance,C9=e.clearSuspenseBoundary,k9=e.clearSuspenseBoundaryFromContainer,E9=e.shouldDeleteUnhydratedTailInstances,P9=e.didNotMatchHydratedContainerTextInstance,N9=e.didNotMatchHydratedTextInstance,Zh;function Ma(s){if(Zh===void 0)try{throw Error()}catch(c){var a=c.stack.trim().match(/\n( *(at )?)/);Zh=a&&a[1]||""}return`
`+Zh+s}var ef=!1;function tf(s,a){if(!s||ef)return"";ef=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(Y){var h=Y}Reflect.construct(s,[],a)}else{try{a.call()}catch(Y){h=Y}s.call(a.prototype)}else{try{throw Error()}catch(Y){h=Y}s()}}catch(Y){if(Y&&h&&typeof Y.stack=="string"){for(var p=Y.stack.split(`
`),_=h.stack.split(`
`),R=p.length-1,b=_.length-1;1<=R&&0<=b&&p[R]!==_[b];)b--;for(;1<=R&&0<=b;R--,b--)if(p[R]!==_[b]){if(R!==1||b!==1)do if(R--,b--,0>b||p[R]!==_[b]){var B=`
`+p[R].replace(" at new "," at ");return s.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",s.displayName)),B}while(1<=R&&0<=b);break}}}finally{ef=!1,Error.prepareStackTrace=c}return(s=s?s.displayName||s.name:"")?Ma(s):""}var R9=Object.prototype.hasOwnProperty,nf=[],co=-1;function pi(s){return{current:s}}function Qe(s){0>co||(s.current=nf[co],nf[co]=null,co--)}function He(s,a){co++,nf[co]=s.current,s.current=a}var gi={},Gt=pi(gi),ln=pi(!1),hs=gi;function ho(s,a){var c=s.type.contextTypes;if(!c)return gi;var h=s.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===a)return h.__reactInternalMemoizedMaskedChildContext;var p={},_;for(_ in c)p[_]=a[_];return h&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=a,s.__reactInternalMemoizedMaskedChildContext=p),p}function un(s){return s=s.childContextTypes,s!=null}function _u(){Qe(ln),Qe(Gt)}function om(s,a,c){if(Gt.current!==gi)throw Error(l(168));He(Gt,a),He(ln,c)}function am(s,a,c){var h=s.stateNode;if(a=a.childContextTypes,typeof h.getChildContext!="function")return c;h=h.getChildContext();for(var p in h)if(!(p in a))throw Error(l(108,O(s)||"Unknown",p));return o({},c,h)}function xu(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||gi,hs=Gt.current,He(Gt,s),He(ln,ln.current),!0}function lm(s,a,c){var h=s.stateNode;if(!h)throw Error(l(169));c?(s=am(s,a,hs),h.__reactInternalMemoizedMergedChildContext=s,Qe(ln),Qe(Gt),He(Gt,s)):Qe(ln),He(ln,c)}var Zn=Math.clz32?Math.clz32:F9,T9=Math.log,O9=Math.LN2;function F9(s){return s>>>=0,s===0?32:31-(T9(s)/O9|0)|0}var wu=64,Cu=4194304;function La(s){switch(s&-s){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: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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function ku(s,a){var c=s.pendingLanes;if(c===0)return 0;var h=0,p=s.suspendedLanes,_=s.pingedLanes,R=c&268435455;if(R!==0){var b=R&~p;b!==0?h=La(b):(_&=R,_!==0&&(h=La(_)))}else R=c&~p,R!==0?h=La(R):_!==0&&(h=La(_));if(h===0)return 0;if(a!==0&&a!==h&&!(a&p)&&(p=h&-h,_=a&-a,p>=_||p===16&&(_&4194240)!==0))return a;if(h&4&&(h|=c&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=h;0<a;)c=31-Zn(a),p=1<<c,h|=s[c],a&=~p;return h}function A9(s,a){switch(s){case 1:case 2:case 4:return a+250;case 8:case 16:case 32:case 64: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 a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function M9(s,a){for(var c=s.suspendedLanes,h=s.pingedLanes,p=s.expirationTimes,_=s.pendingLanes;0<_;){var R=31-Zn(_),b=1<<R,B=p[R];B===-1?(!(b&c)||b&h)&&(p[R]=A9(b,a)):B<=a&&(s.expiredLanes|=b),_&=~b}}function rf(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function um(){var s=wu;return wu<<=1,!(wu&4194240)&&(wu=64),s}function sf(s){for(var a=[],c=0;31>c;c++)a.push(s);return a}function ba(s,a,c){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-Zn(a),s[a]=c}function L9(s,a){var c=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var h=s.eventTimes;for(s=s.expirationTimes;0<c;){var p=31-Zn(c),_=1<<p;a[p]=0,h[p]=-1,s[p]=-1,c&=~_}}function of(s,a){var c=s.entangledLanes|=a;for(s=s.entanglements;c;){var h=31-Zn(c),p=1<<h;p&a|s[h]&a&&(s[h]|=a),c&=~p}}var Fe=0;function cm(s){return s&=-s,1<s?4<s?s&268435455?16:536870912:4:1}var af=i.unstable_scheduleCallback,dm=i.unstable_cancelCallback,b9=i.unstable_shouldYield,D9=i.unstable_requestPaint,Rt=i.unstable_now,lf=i.unstable_ImmediatePriority,I9=i.unstable_UserBlockingPriority,uf=i.unstable_NormalPriority,j9=i.unstable_IdlePriority,Eu=null,vr=null;function U9(s){if(vr&&typeof vr.onCommitFiberRoot=="function")try{vr.onCommitFiberRoot(Eu,s,void 0,(s.current.flags&128)===128)}catch{}}function z9(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var er=typeof Object.is=="function"?Object.is:z9,Dr=null,Pu=!1,cf=!1;function hm(s){Dr===null?Dr=[s]:Dr.push(s)}function B9(s){Pu=!0,hm(s)}function Sr(){if(!cf&&Dr!==null){cf=!0;var s=0,a=Fe;try{var c=Dr;for(Fe=1;s<c.length;s++){var h=c[s];do h=h(!0);while(h!==null)}Dr=null,Pu=!1}catch(p){throw Dr!==null&&(Dr=Dr.slice(s+1)),af(lf,Sr),p}finally{Fe=a,cf=!1}}return null}var fo=[],po=0,Nu=null,Ru=0,An=[],Mn=0,fs=null,Ir=1,jr="";function ps(s,a){fo[po++]=Ru,fo[po++]=Nu,Nu=s,Ru=a}function fm(s,a,c){An[Mn++]=Ir,An[Mn++]=jr,An[Mn++]=fs,fs=s;var h=Ir;s=jr;var p=32-Zn(h)-1;h&=~(1<<p),c+=1;var _=32-Zn(a)+p;if(30<_){var R=p-p%5;_=(h&(1<<R)-1).toString(32),h>>=R,p-=R,Ir=1<<32-Zn(a)+p|c<<p|h,jr=_+s}else Ir=1<<_|c<<p|h,jr=s}function df(s){s.return!==null&&(ps(s,1),fm(s,1,0))}function hf(s){for(;s===Nu;)Nu=fo[--po],fo[po]=null,Ru=fo[--po],fo[po]=null;for(;s===fs;)fs=An[--Mn],An[Mn]=null,jr=An[--Mn],An[Mn]=null,Ir=An[--Mn],An[Mn]=null}var Cn=null,Ln=null,$e=!1,Da=!1,tr=null;function pm(s,a){var c=Un(5,null,null,0);c.elementType="DELETED",c.stateNode=a,c.return=s,a=s.deletions,a===null?(s.deletions=[c],s.flags|=16):a.push(c)}function gm(s,a){switch(s.tag){case 5:return a=u9(a,s.type,s.pendingProps),a!==null?(s.stateNode=a,Cn=s,Ln=p9(a),!0):!1;case 6:return a=c9(a,s.pendingProps),a!==null?(s.stateNode=a,Cn=s,Ln=null,!0):!1;case 13:if(a=d9(a),a!==null){var c=fs!==null?{id:Ir,overflow:jr}:null;return s.memoizedState={dehydrated:a,treeContext:c,retryLane:1073741824},c=Un(18,null,null,0),c.stateNode=a,c.return=s,s.child=c,Cn=s,Ln=null,!0}return!1;default:return!1}}function ff(s){return(s.mode&1)!==0&&(s.flags&128)===0}function pf(s){if($e){var a=Ln;if(a){var c=a;if(!gm(s,a)){if(ff(s))throw Error(l(418));a=Su(c);var h=Cn;a&&gm(s,a)?pm(h,c):(s.flags=s.flags&-4097|2,$e=!1,Cn=s)}}else{if(ff(s))throw Error(l(418));s.flags=s.flags&-4097|2,$e=!1,Cn=s}}}function mm(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Cn=s}function Tu(s){if(!Ke||s!==Cn)return!1;if(!$e)return mm(s),$e=!0,!1;if(s.tag!==3&&(s.tag!==5||E9(s.type)&&!mt(s.type,s.memoizedProps))){var a=Ln;if(a){if(ff(s))throw ym(),Error(l(418));for(;a;)pm(s,a),a=Su(a)}}if(mm(s),s.tag===13){if(!Ke)throw Error(l(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(l(317));Ln=_9(s)}else Ln=Cn?Su(s.stateNode):null;return!0}function ym(){for(var s=Ln;s;)s=Su(s)}function go(){Ke&&(Ln=Cn=null,Da=$e=!1)}function gf(s){tr===null?tr=[s]:tr.push(s)}var G9=u.ReactCurrentBatchConfig;function Ou(s,a){if(er(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var c=Object.keys(s),h=Object.keys(a);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var p=c[h];if(!R9.call(a,p)||!er(s[p],a[p]))return!1}return!0}function H9(s){switch(s.tag){case 5:return Ma(s.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return s=tf(s.type,!1),s;case 11:return s=tf(s.type.render,!1),s;case 1:return s=tf(s.type,!0),s;default:return""}}function Ia(s,a,c){if(s=c.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(c._owner){if(c=c._owner,c){if(c.tag!==1)throw Error(l(309));var h=c.stateNode}if(!h)throw Error(l(147,s));var p=h,_=""+s;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===_?a.ref:(a=function(R){var b=p.refs;R===null?delete b[_]:b[_]=R},a._stringRef=_,a)}if(typeof s!="string")throw Error(l(284));if(!c._owner)throw Error(l(290,s))}return s}function Fu(s,a){throw s=Object.prototype.toString.call(a),Error(l(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s))}function vm(s){var a=s._init;return a(s._payload)}function Sm(s){function a(U,I){if(s){var H=U.deletions;H===null?(U.deletions=[I],U.flags|=16):H.push(I)}}function c(U,I){if(!s)return null;for(;I!==null;)a(U,I),I=I.sibling;return null}function h(U,I){for(U=new Map;I!==null;)I.key!==null?U.set(I.key,I):U.set(I.index,I),I=I.sibling;return U}function p(U,I){return U=wi(U,I),U.index=0,U.sibling=null,U}function _(U,I,H){return U.index=H,s?(H=U.alternate,H!==null?(H=H.index,H<I?(U.flags|=2,I):H):(U.flags|=2,I)):(U.flags|=1048576,I)}function R(U){return s&&U.alternate===null&&(U.flags|=2),U}function b(U,I,H,re){return I===null||I.tag!==6?(I=c0(H,U.mode,re),I.return=U,I):(I=p(I,H),I.return=U,I)}function B(U,I,H,re){var de=H.type;return de===g?ae(U,I,H.props.children,re,H.key):I!==null&&(I.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===m&&vm(de)===I.type)?(re=p(I,H.props),re.ref=Ia(U,I,H),re.return=U,re):(re=lc(H.type,H.key,H.props,null,U.mode,re),re.ref=Ia(U,I,H),re.return=U,re)}function Y(U,I,H,re){return I===null||I.tag!==4||I.stateNode.containerInfo!==H.containerInfo||I.stateNode.implementation!==H.implementation?(I=d0(H,U.mode,re),I.return=U,I):(I=p(I,H.children||[]),I.return=U,I)}function ae(U,I,H,re,de){return I===null||I.tag!==7?(I=xs(H,U.mode,re,de),I.return=U,I):(I=p(I,H),I.return=U,I)}function me(U,I,H){if(typeof I=="string"&&I!==""||typeof I=="number")return I=c0(""+I,U.mode,H),I.return=U,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case d:return H=lc(I.type,I.key,I.props,null,U.mode,H),H.ref=Ia(U,null,I),H.return=U,H;case f:return I=d0(I,U.mode,H),I.return=U,I;case m:var re=I._init;return me(U,re(I._payload),H)}if(Z(I)||F(I))return I=xs(I,U.mode,H,null),I.return=U,I;Fu(U,I)}return null}function ne(U,I,H,re){var de=I!==null?I.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return de!==null?null:b(U,I,""+H,re);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case d:return H.key===de?B(U,I,H,re):null;case f:return H.key===de?Y(U,I,H,re):null;case m:return de=H._init,ne(U,I,de(H._payload),re)}if(Z(H)||F(H))return de!==null?null:ae(U,I,H,re,null);Fu(U,H)}return null}function qe(U,I,H,re,de){if(typeof re=="string"&&re!==""||typeof re=="number")return U=U.get(H)||null,b(I,U,""+re,de);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case d:return U=U.get(re.key===null?H:re.key)||null,B(I,U,re,de);case f:return U=U.get(re.key===null?H:re.key)||null,Y(I,U,re,de);case m:var _e=re._init;return qe(U,I,H,_e(re._payload),de)}if(Z(re)||F(re))return U=U.get(H)||null,ae(I,U,re,de,null);Fu(I,re)}return null}function ze(U,I,H,re){for(var de=null,_e=null,ye=I,Ae=I=0,Ft=null;ye!==null&&Ae<H.length;Ae++){ye.index>Ae?(Ft=ye,ye=null):Ft=ye.sibling;var Me=ne(U,ye,H[Ae],re);if(Me===null){ye===null&&(ye=Ft);break}s&&ye&&Me.alternate===null&&a(U,ye),I=_(Me,I,Ae),_e===null?de=Me:_e.sibling=Me,_e=Me,ye=Ft}if(Ae===H.length)return c(U,ye),$e&&ps(U,Ae),de;if(ye===null){for(;Ae<H.length;Ae++)ye=me(U,H[Ae],re),ye!==null&&(I=_(ye,I,Ae),_e===null?de=ye:_e.sibling=ye,_e=ye);return $e&&ps(U,Ae),de}for(ye=h(U,ye);Ae<H.length;Ae++)Ft=qe(ye,U,Ae,H[Ae],re),Ft!==null&&(s&&Ft.alternate!==null&&ye.delete(Ft.key===null?Ae:Ft.key),I=_(Ft,I,Ae),_e===null?de=Ft:_e.sibling=Ft,_e=Ft);return s&&ye.forEach(function(Ci){return a(U,Ci)}),$e&&ps(U,Ae),de}function fn(U,I,H,re){var de=F(H);if(typeof de!="function")throw Error(l(150));if(H=de.call(H),H==null)throw Error(l(151));for(var _e=de=null,ye=I,Ae=I=0,Ft=null,Me=H.next();ye!==null&&!Me.done;Ae++,Me=H.next()){ye.index>Ae?(Ft=ye,ye=null):Ft=ye.sibling;var Ci=ne(U,ye,Me.value,re);if(Ci===null){ye===null&&(ye=Ft);break}s&&ye&&Ci.alternate===null&&a(U,ye),I=_(Ci,I,Ae),_e===null?de=Ci:_e.sibling=Ci,_e=Ci,ye=Ft}if(Me.done)return c(U,ye),$e&&ps(U,Ae),de;if(ye===null){for(;!Me.done;Ae++,Me=H.next())Me=me(U,Me.value,re),Me!==null&&(I=_(Me,I,Ae),_e===null?de=Me:_e.sibling=Me,_e=Me);return $e&&ps(U,Ae),de}for(ye=h(U,ye);!Me.done;Ae++,Me=H.next())Me=qe(ye,U,Ae,Me.value,re),Me!==null&&(s&&Me.alternate!==null&&ye.delete(Me.key===null?Ae:Me.key),I=_(Me,I,Ae),_e===null?de=Me:_e.sibling=Me,_e=Me);return s&&ye.forEach(function(S7){return a(U,S7)}),$e&&ps(U,Ae),de}function Gr(U,I,H,re){if(typeof H=="object"&&H!==null&&H.type===g&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case d:e:{for(var de=H.key,_e=I;_e!==null;){if(_e.key===de){if(de=H.type,de===g){if(_e.tag===7){c(U,_e.sibling),I=p(_e,H.props.children),I.return=U,U=I;break e}}else if(_e.elementType===de||typeof de=="object"&&de!==null&&de.$$typeof===m&&vm(de)===_e.type){c(U,_e.sibling),I=p(_e,H.props),I.ref=Ia(U,_e,H),I.return=U,U=I;break e}c(U,_e);break}else a(U,_e);_e=_e.sibling}H.type===g?(I=xs(H.props.children,U.mode,re,H.key),I.return=U,U=I):(re=lc(H.type,H.key,H.props,null,U.mode,re),re.ref=Ia(U,I,H),re.return=U,U=re)}return R(U);case f:e:{for(_e=H.key;I!==null;){if(I.key===_e)if(I.tag===4&&I.stateNode.containerInfo===H.containerInfo&&I.stateNode.implementation===H.implementation){c(U,I.sibling),I=p(I,H.children||[]),I.return=U,U=I;break e}else{c(U,I);break}else a(U,I);I=I.sibling}I=d0(H,U.mode,re),I.return=U,U=I}return R(U);case m:return _e=H._init,Gr(U,I,_e(H._payload),re)}if(Z(H))return ze(U,I,H,re);if(F(H))return fn(U,I,H,re);Fu(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,I!==null&&I.tag===6?(c(U,I.sibling),I=p(I,H),I.return=U,U=I):(c(U,I),I=c0(H,U.mode,re),I.return=U,U=I),R(U)):c(U,I)}return Gr}var mo=Sm(!0),_m=Sm(!1),Au=pi(null),Mu=null,yo=null,mf=null;function yf(){mf=yo=Mu=null}function xm(s,a,c){De?(He(Au,a._currentValue),a._currentValue=c):(He(Au,a._currentValue2),a._currentValue2=c)}function vf(s){var a=Au.current;Qe(Au),De?s._currentValue=a:s._currentValue2=a}function Sf(s,a,c){for(;s!==null;){var h=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,h!==null&&(h.childLanes|=a)):h!==null&&(h.childLanes&a)!==a&&(h.childLanes|=a),s===c)break;s=s.return}}function vo(s,a){Mu=s,mf=yo=null,s=s.dependencies,s!==null&&s.firstContext!==null&&(s.lanes&a&&(cn=!0),s.firstContext=null)}function bn(s){var a=De?s._currentValue:s._currentValue2;if(mf!==s)if(s={context:s,memoizedValue:a,next:null},yo===null){if(Mu===null)throw Error(l(308));yo=s,Mu.dependencies={lanes:0,firstContext:s}}else yo=yo.next=s;return a}var gs=null;function _f(s){gs===null?gs=[s]:gs.push(s)}function wm(s,a,c,h){var p=a.interleaved;return p===null?(c.next=c,_f(a)):(c.next=p.next,p.next=c),a.interleaved=c,_r(s,h)}function _r(s,a){s.lanes|=a;var c=s.alternate;for(c!==null&&(c.lanes|=a),c=s,s=s.return;s!==null;)s.childLanes|=a,c=s.alternate,c!==null&&(c.childLanes|=a),c=s,s=s.return;return c.tag===3?c.stateNode:null}var mi=!1;function xf(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Cm(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function Ur(s,a){return{eventTime:s,lane:a,tag:0,payload:null,callback:null,next:null}}function yi(s,a,c){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,we&2){var p=h.pending;return p===null?a.next=a:(a.next=p.next,p.next=a),h.pending=a,_r(s,c)}return p=h.interleaved,p===null?(a.next=a,_f(h)):(a.next=p.next,p.next=a),h.interleaved=a,_r(s,c)}function Lu(s,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194240)!==0)){var h=a.lanes;h&=s.pendingLanes,c|=h,a.lanes=c,of(s,c)}}function km(s,a){var c=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var p=null,_=null;if(c=c.firstBaseUpdate,c!==null){do{var R={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};_===null?p=_=R:_=_.next=R,c=c.next}while(c!==null);_===null?p=_=a:_=_.next=a}else p=_=a;c={baseState:h.baseState,firstBaseUpdate:p,lastBaseUpdate:_,shared:h.shared,effects:h.effects},s.updateQueue=c;return}s=c.lastBaseUpdate,s===null?c.firstBaseUpdate=a:s.next=a,c.lastBaseUpdate=a}function bu(s,a,c,h){var p=s.updateQueue;mi=!1;var _=p.firstBaseUpdate,R=p.lastBaseUpdate,b=p.shared.pending;if(b!==null){p.shared.pending=null;var B=b,Y=B.next;B.next=null,R===null?_=Y:R.next=Y,R=B;var ae=s.alternate;ae!==null&&(ae=ae.updateQueue,b=ae.lastBaseUpdate,b!==R&&(b===null?ae.firstBaseUpdate=Y:b.next=Y,ae.lastBaseUpdate=B))}if(_!==null){var me=p.baseState;R=0,ae=Y=B=null,b=_;do{var ne=b.lane,qe=b.eventTime;if((h&ne)===ne){ae!==null&&(ae=ae.next={eventTime:qe,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});e:{var ze=s,fn=b;switch(ne=a,qe=c,fn.tag){case 1:if(ze=fn.payload,typeof ze=="function"){me=ze.call(qe,me,ne);break e}me=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=fn.payload,ne=typeof ze=="function"?ze.call(qe,me,ne):ze,ne==null)break e;me=o({},me,ne);break e;case 2:mi=!0}}b.callback!==null&&b.lane!==0&&(s.flags|=64,ne=p.effects,ne===null?p.effects=[b]:ne.push(b))}else qe={eventTime:qe,lane:ne,tag:b.tag,payload:b.payload,callback:b.callback,next:null},ae===null?(Y=ae=qe,B=me):ae=ae.next=qe,R|=ne;if(b=b.next,b===null){if(b=p.shared.pending,b===null)break;ne=b,b=ne.next,ne.next=null,p.lastBaseUpdate=ne,p.shared.pending=null}}while(!0);if(ae===null&&(B=me),p.baseState=B,p.firstBaseUpdate=Y,p.lastBaseUpdate=ae,a=p.shared.interleaved,a!==null){p=a;do R|=p.lane,p=p.next;while(p!==a)}else _===null&&(p.shared.lanes=0);ys|=R,s.lanes=R,s.memoizedState=me}}function Em(s,a,c){if(s=a.effects,a.effects=null,s!==null)for(a=0;a<s.length;a++){var h=s[a],p=h.callback;if(p!==null){if(h.callback=null,h=c,typeof p!="function")throw Error(l(191,p));p.call(h)}}}var ja={},Dn=pi(ja),Ua=pi(ja),So=pi(ja);function xr(s){if(s===ja)throw Error(l(174));return s}function wf(s,a){He(So,a),He(Ua,s),He(Dn,ja),s=ke(a),Qe(Dn),He(Dn,s)}function _o(){Qe(Dn),Qe(Ua),Qe(So)}function Pm(s){var a=xr(So.current),c=xr(Dn.current);a=V(c,s.type,a),c!==a&&(He(Ua,s),He(Dn,a))}function Cf(s){Ua.current===s&&(Qe(Dn),Qe(Ua))}var tt=pi(0);function Du(s){for(var a=s;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||sm(c)||Jh(c)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if(a.flags&128)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var kf=[];function Ef(){for(var s=0;s<kf.length;s++){var a=kf[s];De?a._workInProgressVersionPrimary=null:a._workInProgressVersionSecondary=null}kf.length=0}var Iu=u.ReactCurrentDispatcher,Pf=u.ReactCurrentBatchConfig,ms=0,nt=null,_t=null,Tt=null,ju=!1,za=!1,Ba=0,V9=0;function Ht(){throw Error(l(321))}function Nf(s,a){if(a===null)return!1;for(var c=0;c<a.length&&c<s.length;c++)if(!er(s[c],a[c]))return!1;return!0}function Rf(s,a,c,h,p,_){if(ms=_,nt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Iu.current=s===null||s.memoizedState===null?q9:Y9,s=c(h,p),za){_=0;do{if(za=!1,Ba=0,25<=_)throw Error(l(301));_+=1,Tt=_t=null,a.updateQueue=null,Iu.current=X9,s=c(h,p)}while(za)}if(Iu.current=Bu,a=_t!==null&&_t.next!==null,ms=0,Tt=_t=nt=null,ju=!1,a)throw Error(l(300));return s}function Tf(){var s=Ba!==0;return Ba=0,s}function wr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?nt.memoizedState=Tt=s:Tt=Tt.next=s,Tt}function In(){if(_t===null){var s=nt.alternate;s=s!==null?s.memoizedState:null}else s=_t.next;var a=Tt===null?nt.memoizedState:Tt.next;if(a!==null)Tt=a,_t=s;else{if(s===null)throw Error(l(310));_t=s,s={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},Tt===null?nt.memoizedState=Tt=s:Tt=Tt.next=s}return Tt}function Ga(s,a){return typeof a=="function"?a(s):a}function Of(s){var a=In(),c=a.queue;if(c===null)throw Error(l(311));c.lastRenderedReducer=s;var h=_t,p=h.baseQueue,_=c.pending;if(_!==null){if(p!==null){var R=p.next;p.next=_.next,_.next=R}h.baseQueue=p=_,c.pending=null}if(p!==null){_=p.next,h=h.baseState;var b=R=null,B=null,Y=_;do{var ae=Y.lane;if((ms&ae)===ae)B!==null&&(B=B.next={lane:0,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),h=Y.hasEagerState?Y.eagerState:s(h,Y.action);else{var me={lane:ae,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null};B===null?(b=B=me,R=h):B=B.next=me,nt.lanes|=ae,ys|=ae}Y=Y.next}while(Y!==null&&Y!==_);B===null?R=h:B.next=b,er(h,a.memoizedState)||(cn=!0),a.memoizedState=h,a.baseState=R,a.baseQueue=B,c.lastRenderedState=h}if(s=c.interleaved,s!==null){p=s;do _=p.lane,nt.lanes|=_,ys|=_,p=p.next;while(p!==s)}else p===null&&(c.lanes=0);return[a.memoizedState,c.dispatch]}function Ff(s){var a=In(),c=a.queue;if(c===null)throw Error(l(311));c.lastRenderedReducer=s;var h=c.dispatch,p=c.pending,_=a.memoizedState;if(p!==null){c.pending=null;var R=p=p.next;do _=s(_,R.action),R=R.next;while(R!==p);er(_,a.memoizedState)||(cn=!0),a.memoizedState=_,a.baseQueue===null&&(a.baseState=_),c.lastRenderedState=_}return[_,h]}function Nm(){}function Rm(s,a){var c=nt,h=In(),p=a(),_=!er(h.memoizedState,p);if(_&&(h.memoizedState=p,cn=!0),h=h.queue,Af(Fm.bind(null,c,h,s),[s]),h.getSnapshot!==a||_||Tt!==null&&Tt.memoizedState.tag&1){if(c.flags|=2048,Ha(9,Om.bind(null,c,h,p,a),void 0,null),Ot===null)throw Error(l(349));ms&30||Tm(c,a,p)}return p}function Tm(s,a,c){s.flags|=16384,s={getSnapshot:a,value:c},a=nt.updateQueue,a===null?(a={lastEffect:null,stores:null},nt.updateQueue=a,a.stores=[s]):(c=a.stores,c===null?a.stores=[s]:c.push(s))}function Om(s,a,c,h){a.value=c,a.getSnapshot=h,Am(a)&&Mm(s)}function Fm(s,a,c){return c(function(){Am(a)&&Mm(s)})}function Am(s){var a=s.getSnapshot;s=s.value;try{var c=a();return!er(s,c)}catch{return!0}}function Mm(s){var a=_r(s,1);a!==null&&jn(a,s,1,-1)}function Lm(s){var a=wr();return typeof s=="function"&&(s=s()),a.memoizedState=a.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ga,lastRenderedState:s},a.queue=s,s=s.dispatch=Q9.bind(null,nt,s),[a.memoizedState,s]}function Ha(s,a,c,h){return s={tag:s,create:a,destroy:c,deps:h,next:null},a=nt.updateQueue,a===null?(a={lastEffect:null,stores:null},nt.updateQueue=a,a.lastEffect=s.next=s):(c=a.lastEffect,c===null?a.lastEffect=s.next=s:(h=c.next,c.next=s,s.next=h,a.lastEffect=s)),s}function bm(){return In().memoizedState}function Uu(s,a,c,h){var p=wr();nt.flags|=s,p.memoizedState=Ha(1|a,c,void 0,h===void 0?null:h)}function zu(s,a,c,h){var p=In();h=h===void 0?null:h;var _=void 0;if(_t!==null){var R=_t.memoizedState;if(_=R.destroy,h!==null&&Nf(h,R.deps)){p.memoizedState=Ha(a,c,_,h);return}}nt.flags|=s,p.memoizedState=Ha(1|a,c,_,h)}function Dm(s,a){return Uu(8390656,8,s,a)}function Af(s,a){return zu(2048,8,s,a)}function Im(s,a){return zu(4,2,s,a)}function jm(s,a){return zu(4,4,s,a)}function Um(s,a){if(typeof a=="function")return s=s(),a(s),function(){a(null)};if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function zm(s,a,c){return c=c!=null?c.concat([s]):null,zu(4,4,Um.bind(null,a,s),c)}function Mf(){}function Bm(s,a){var c=In();a=a===void 0?null:a;var h=c.memoizedState;return h!==null&&a!==null&&Nf(a,h[1])?h[0]:(c.memoizedState=[s,a],s)}function Gm(s,a){var c=In();a=a===void 0?null:a;var h=c.memoizedState;return h!==null&&a!==null&&Nf(a,h[1])?h[0]:(s=s(),c.memoizedState=[s,a],s)}function Hm(s,a,c){return ms&21?(er(c,a)||(c=um(),nt.lanes|=c,ys|=c,s.baseState=!0),a):(s.baseState&&(s.baseState=!1,cn=!0),s.memoizedState=c)}function W9(s,a){var c=Fe;Fe=c!==0&&4>c?c:4,s(!0);var h=Pf.transition;Pf.transition={};try{s(!1),a()}finally{Fe=c,Pf.transition=h}}function Vm(){return In().memoizedState}function K9(s,a,c){var h=_i(s);if(c={lane:h,action:c,hasEagerState:!1,eagerState:null,next:null},Wm(s))Km(a,c);else if(c=wm(s,a,c,h),c!==null){var p=Kt();jn(c,s,h,p),Qm(c,a,h)}}function Q9(s,a,c){var h=_i(s),p={lane:h,action:c,hasEagerState:!1,eagerState:null,next:null};if(Wm(s))Km(a,p);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=a.lastRenderedReducer,_!==null))try{var R=a.lastRenderedState,b=_(R,c);if(p.hasEagerState=!0,p.eagerState=b,er(b,R)){var B=a.interleaved;B===null?(p.next=p,_f(a)):(p.next=B.next,B.next=p),a.interleaved=p;return}}catch{}finally{}c=wm(s,a,p,h),c!==null&&(p=Kt(),jn(c,s,h,p),Qm(c,a,h))}}function Wm(s){var a=s.alternate;return s===nt||a!==null&&a===nt}function Km(s,a){za=ju=!0;var c=s.pending;c===null?a.next=a:(a.next=c.next,c.next=a),s.pending=a}function Qm(s,a,c){if(c&4194240){var h=a.lanes;h&=s.pendingLanes,c|=h,a.lanes=c,of(s,c)}}var Bu={readContext:bn,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},q9={readContext:bn,useCallback:function(s,a){return wr().memoizedState=[s,a===void 0?null:a],s},useContext:bn,useEffect:Dm,useImperativeHandle:function(s,a,c){return c=c!=null?c.concat([s]):null,Uu(4194308,4,Um.bind(null,a,s),c)},useLayoutEffect:function(s,a){return Uu(4194308,4,s,a)},useInsertionEffect:function(s,a){return Uu(4,2,s,a)},useMemo:function(s,a){var c=wr();return a=a===void 0?null:a,s=s(),c.memoizedState=[s,a],s},useReducer:function(s,a,c){var h=wr();return a=c!==void 0?c(a):a,h.memoizedState=h.baseState=a,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:a},h.queue=s,s=s.dispatch=K9.bind(null,nt,s),[h.memoizedState,s]},useRef:function(s){var a=wr();return s={current:s},a.memoizedState=s},useState:Lm,useDebugValue:Mf,useDeferredValue:function(s){return wr().memoizedState=s},useTransition:function(){var s=Lm(!1),a=s[0];return s=W9.bind(null,s[1]),wr().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,c){var h=nt,p=wr();if($e){if(c===void 0)throw Error(l(407));c=c()}else{if(c=a(),Ot===null)throw Error(l(349));ms&30||Tm(h,a,c)}p.memoizedState=c;var _={value:c,getSnapshot:a};return p.queue=_,Dm(Fm.bind(null,h,_,s),[s]),h.flags|=2048,Ha(9,Om.bind(null,h,_,c,a),void 0,null),c},useId:function(){var s=wr(),a=Ot.identifierPrefix;if($e){var c=jr,h=Ir;c=(h&~(1<<32-Zn(h)-1)).toString(32)+c,a=":"+a+"R"+c,c=Ba++,0<c&&(a+="H"+c.toString(32)),a+=":"}else c=V9++,a=":"+a+"r"+c.toString(32)+":";return s.memoizedState=a},unstable_isNewReconciler:!1},Y9={readContext:bn,useCallback:Bm,useContext:bn,useEffect:Af,useImperativeHandle:zm,useInsertionEffect:Im,useLayoutEffect:jm,useMemo:Gm,useReducer:Of,useRef:bm,useState:function(){return Of(Ga)},useDebugValue:Mf,useDeferredValue:function(s){var a=In();return Hm(a,_t.memoizedState,s)},useTransition:function(){var s=Of(Ga)[0],a=In().memoizedState;return[s,a]},useMutableSource:Nm,useSyncExternalStore:Rm,useId:Vm,unstable_isNewReconciler:!1},X9={readContext:bn,useCallback:Bm,useContext:bn,useEffect:Af,useImperativeHandle:zm,useInsertionEffect:Im,useLayoutEffect:jm,useMemo:Gm,useReducer:Ff,useRef:bm,useState:function(){return Ff(Ga)},useDebugValue:Mf,useDeferredValue:function(s){var a=In();return _t===null?a.memoizedState=s:Hm(a,_t.memoizedState,s)},useTransition:function(){var s=Ff(Ga)[0],a=In().memoizedState;return[s,a]},useMutableSource:Nm,useSyncExternalStore:Rm,useId:Vm,unstable_isNewReconciler:!1};function nr(s,a){if(s&&s.defaultProps){a=o({},a),s=s.defaultProps;for(var c in s)a[c]===void 0&&(a[c]=s[c]);return a}return a}function Lf(s,a,c,h){a=s.memoizedState,c=c(h,a),c=c==null?a:o({},a,c),s.memoizedState=c,s.lanes===0&&(s.updateQueue.baseState=c)}var Gu={isMounted:function(s){return(s=s._reactInternals)?j(s)===s:!1},enqueueSetState:function(s,a,c){s=s._reactInternals;var h=Kt(),p=_i(s),_=Ur(h,p);_.payload=a,c!=null&&(_.callback=c),a=yi(s,_,p),a!==null&&(jn(a,s,p,h),Lu(a,s,p))},enqueueReplaceState:function(s,a,c){s=s._reactInternals;var h=Kt(),p=_i(s),_=Ur(h,p);_.tag=1,_.payload=a,c!=null&&(_.callback=c),a=yi(s,_,p),a!==null&&(jn(a,s,p,h),Lu(a,s,p))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var c=Kt(),h=_i(s),p=Ur(c,h);p.tag=2,a!=null&&(p.callback=a),a=yi(s,p,h),a!==null&&(jn(a,s,h,c),Lu(a,s,h))}};function qm(s,a,c,h,p,_,R){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,_,R):a.prototype&&a.prototype.isPureReactComponent?!Ou(c,h)||!Ou(p,_):!0}function Ym(s,a,c){var h=!1,p=gi,_=a.contextType;return typeof _=="object"&&_!==null?_=bn(_):(p=un(a)?hs:Gt.current,h=a.contextTypes,_=(h=h!=null)?ho(s,p):gi),a=new a(c,_),s.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Gu,s.stateNode=a,a._reactInternals=s,h&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=p,s.__reactInternalMemoizedMaskedChildContext=_),a}function Xm(s,a,c,h){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,h),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,h),a.state!==s&&Gu.enqueueReplaceState(a,a.state,null)}function bf(s,a,c,h){var p=s.stateNode;p.props=c,p.state=s.memoizedState,p.refs={},xf(s);var _=a.contextType;typeof _=="object"&&_!==null?p.context=bn(_):(_=un(a)?hs:Gt.current,p.context=ho(s,_)),p.state=s.memoizedState,_=a.getDerivedStateFromProps,typeof _=="function"&&(Lf(s,a,_,c),p.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(a=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),a!==p.state&&Gu.enqueueReplaceState(p,p.state,null),bu(s,c,p,h),p.state=s.memoizedState),typeof p.componentDidMount=="function"&&(s.flags|=4194308)}function xo(s,a){try{var c="",h=a;do c+=H9(h),h=h.return;while(h);var p=c}catch(_){p=`
Error generating stack: `+_.message+`
`+_.stack}return{value:s,source:a,stack:p,digest:null}}function Df(s,a,c){return{value:s,source:null,stack:c??null,digest:a??null}}function If(s,a){try{console.error(a.value)}catch(c){setTimeout(function(){throw c})}}var $9=typeof WeakMap=="function"?WeakMap:Map;function $m(s,a,c){c=Ur(-1,c),c.tag=3,c.payload={element:null};var h=a.value;return c.callback=function(){nc||(nc=!0,r0=h),If(s,a)},c}function Jm(s,a,c){c=Ur(-1,c),c.tag=3;var h=s.type.getDerivedStateFromError;if(typeof h=="function"){var p=a.value;c.payload=function(){return h(p)},c.callback=function(){If(s,a)}}var _=s.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(c.callback=function(){If(s,a),typeof h!="function"&&(vi===null?vi=new Set([this]):vi.add(this));var R=a.stack;this.componentDidCatch(a.value,{componentStack:R!==null?R:""})}),c}function Zm(s,a,c){var h=s.pingCache;if(h===null){h=s.pingCache=new $9;var p=new Set;h.set(a,p)}else p=h.get(a),p===void 0&&(p=new Set,h.set(a,p));p.has(c)||(p.add(c),s=d7.bind(null,s,a,c),a.then(s,s))}function e2(s){do{var a;if((a=s.tag===13)&&(a=s.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return s;s=s.return}while(s!==null);return null}function t2(s,a,c,h,p){return s.mode&1?(s.flags|=65536,s.lanes=p,s):(s===a?s.flags|=65536:(s.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(a=Ur(-1,1),a.tag=2,yi(c,a,1))),c.lanes|=1),s)}var J9=u.ReactCurrentOwner,cn=!1;function en(s,a,c,h){a.child=s===null?_m(a,null,c,h):mo(a,s.child,c,h)}function n2(s,a,c,h,p){c=c.render;var _=a.ref;return vo(a,p),h=Rf(s,a,c,h,_,p),c=Tf(),s!==null&&!cn?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~p,zr(s,a,p)):($e&&c&&df(a),a.flags|=1,en(s,a,h,p),a.child)}function r2(s,a,c,h,p){if(s===null){var _=c.type;return typeof _=="function"&&!u0(_)&&_.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(a.tag=15,a.type=_,i2(s,a,_,h,p)):(s=lc(c.type,null,h,a,a.mode,p),s.ref=a.ref,s.return=a,a.child=s)}if(_=s.child,!(s.lanes&p)){var R=_.memoizedProps;if(c=c.compare,c=c!==null?c:Ou,c(R,h)&&s.ref===a.ref)return zr(s,a,p)}return a.flags|=1,s=wi(_,h),s.ref=a.ref,s.return=a,a.child=s}function i2(s,a,c,h,p){if(s!==null){var _=s.memoizedProps;if(Ou(_,h)&&s.ref===a.ref)if(cn=!1,a.pendingProps=h=_,(s.lanes&p)!==0)s.flags&131072&&(cn=!0);else return a.lanes=s.lanes,zr(s,a,p)}return jf(s,a,c,h,p)}function s2(s,a,c){var h=a.pendingProps,p=h.children,_=s!==null?s.memoizedState:null;if(h.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},He(Co,kn),kn|=c;else{if(!(c&1073741824))return s=_!==null?_.baseLanes|c:c,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:s,cachePool:null,transitions:null},a.updateQueue=null,He(Co,kn),kn|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=_!==null?_.baseLanes:c,He(Co,kn),kn|=h}else _!==null?(h=_.baseLanes|c,a.memoizedState=null):h=c,He(Co,kn),kn|=h;return en(s,a,p,c),a.child}function o2(s,a){var c=a.ref;(s===null&&c!==null||s!==null&&s.ref!==c)&&(a.flags|=512,a.flags|=2097152)}function jf(s,a,c,h,p){var _=un(c)?hs:Gt.current;return _=ho(a,_),vo(a,p),c=Rf(s,a,c,h,_,p),h=Tf(),s!==null&&!cn?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~p,zr(s,a,p)):($e&&h&&df(a),a.flags|=1,en(s,a,c,p),a.child)}function a2(s,a,c,h,p){if(un(c)){var _=!0;xu(a)}else _=!1;if(vo(a,p),a.stateNode===null)Vu(s,a),Ym(a,c,h),bf(a,c,h,p),h=!0;else if(s===null){var R=a.stateNode,b=a.memoizedProps;R.props=b;var B=R.context,Y=c.contextType;typeof Y=="object"&&Y!==null?Y=bn(Y):(Y=un(c)?hs:Gt.current,Y=ho(a,Y));var ae=c.getDerivedStateFromProps,me=typeof ae=="function"||typeof R.getSnapshotBeforeUpdate=="function";me||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(b!==h||B!==Y)&&Xm(a,R,h,Y),mi=!1;var ne=a.memoizedState;R.state=ne,bu(a,h,R,p),B=a.memoizedState,b!==h||ne!==B||ln.current||mi?(typeof ae=="function"&&(Lf(a,c,ae,h),B=a.memoizedState),(b=mi||qm(a,c,b,h,ne,B,Y))?(me||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(a.flags|=4194308)):(typeof R.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=h,a.memoizedState=B),R.props=h,R.state=B,R.context=Y,h=b):(typeof R.componentDidMount=="function"&&(a.flags|=4194308),h=!1)}else{R=a.stateNode,Cm(s,a),b=a.memoizedProps,Y=a.type===a.elementType?b:nr(a.type,b),R.props=Y,me=a.pendingProps,ne=R.context,B=c.contextType,typeof B=="object"&&B!==null?B=bn(B):(B=un(c)?hs:Gt.current,B=ho(a,B));var qe=c.getDerivedStateFromProps;(ae=typeof qe=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(b!==me||ne!==B)&&Xm(a,R,h,B),mi=!1,ne=a.memoizedState,R.state=ne,bu(a,h,R,p);var ze=a.memoizedState;b!==me||ne!==ze||ln.current||mi?(typeof qe=="function"&&(Lf(a,c,qe,h),ze=a.memoizedState),(Y=mi||qm(a,c,Y,h,ne,ze,B)||!1)?(ae||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(h,ze,B),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(h,ze,B)),typeof R.componentDidUpdate=="function"&&(a.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof R.componentDidUpdate!="function"||b===s.memoizedProps&&ne===s.memoizedState||(a.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||b===s.memoizedProps&&ne===s.memoizedState||(a.flags|=1024),a.memoizedProps=h,a.memoizedState=ze),R.props=h,R.state=ze,R.context=B,h=Y):(typeof R.componentDidUpdate!="function"||b===s.memoizedProps&&ne===s.memoizedState||(a.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||b===s.memoizedProps&&ne===s.memoizedState||(a.flags|=1024),h=!1)}return Uf(s,a,c,h,_,p)}function Uf(s,a,c,h,p,_){o2(s,a);var R=(a.flags&128)!==0;if(!h&&!R)return p&&lm(a,c,!1),zr(s,a,_);h=a.stateNode,J9.current=a;var b=R&&typeof c.getDerivedStateFromError!="function"?null:h.render();return a.flags|=1,s!==null&&R?(a.child=mo(a,s.child,null,_),a.child=mo(a,null,b,_)):en(s,a,b,_),a.memoizedState=h.state,p&&lm(a,c,!0),a.child}function l2(s){var a=s.stateNode;a.pendingContext?om(s,a.pendingContext,a.pendingContext!==a.context):a.context&&om(s,a.context,!1),wf(s,a.containerInfo)}function u2(s,a,c,h,p){return go(),gf(p),a.flags|=256,en(s,a,c,h),a.child}var zf={dehydrated:null,treeContext:null,retryLane:0};function Bf(s){return{baseLanes:s,cachePool:null,transitions:null}}function c2(s,a,c){var h=a.pendingProps,p=tt.current,_=!1,R=(a.flags&128)!==0,b;if((b=R)||(b=s!==null&&s.memoizedState===null?!1:(p&2)!==0),b?(_=!0,a.flags&=-129):(s===null||s.memoizedState!==null)&&(p|=1),He(tt,p&1),s===null)return pf(a),s=a.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?(a.mode&1?Jh(s)?a.lanes=8:a.lanes=1073741824:a.lanes=1,null):(R=h.children,s=h.fallback,_?(h=a.mode,_=a.child,R={mode:"hidden",children:R},!(h&1)&&_!==null?(_.childLanes=0,_.pendingProps=R):_=uc(R,h,0,null),s=xs(s,h,c,null),_.return=a,s.return=a,_.sibling=s,a.child=_,a.child.memoizedState=Bf(c),a.memoizedState=zf,s):Gf(a,R));if(p=s.memoizedState,p!==null&&(b=p.dehydrated,b!==null))return Z9(s,a,R,h,b,p,c);if(_){_=h.fallback,R=a.mode,p=s.child,b=p.sibling;var B={mode:"hidden",children:h.children};return!(R&1)&&a.child!==p?(h=a.child,h.childLanes=0,h.pendingProps=B,a.deletions=null):(h=wi(p,B),h.subtreeFlags=p.subtreeFlags&14680064),b!==null?_=wi(b,_):(_=xs(_,R,c,null),_.flags|=2),_.return=a,h.return=a,h.sibling=_,a.child=h,h=_,_=a.child,R=s.child.memoizedState,R=R===null?Bf(c):{baseLanes:R.baseLanes|c,cachePool:null,transitions:R.transitions},_.memoizedState=R,_.childLanes=s.childLanes&~c,a.memoizedState=zf,h}return _=s.child,s=_.sibling,h=wi(_,{mode:"visible",children:h.children}),!(a.mode&1)&&(h.lanes=c),h.return=a,h.sibling=null,s!==null&&(c=a.deletions,c===null?(a.deletions=[s],a.flags|=16):c.push(s)),a.child=h,a.memoizedState=null,h}function Gf(s,a){return a=uc({mode:"visible",children:a},s.mode,0,null),a.return=s,s.child=a}function Hu(s,a,c,h){return h!==null&&gf(h),mo(a,s.child,null,c),s=Gf(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function Z9(s,a,c,h,p,_,R){if(c)return a.flags&256?(a.flags&=-257,h=Df(Error(l(422))),Hu(s,a,R,h)):a.memoizedState!==null?(a.child=s.child,a.flags|=128,null):(_=h.fallback,p=a.mode,h=uc({mode:"visible",children:h.children},p,0,null),_=xs(_,p,R,null),_.flags|=2,h.return=a,_.return=a,h.sibling=_,a.child=h,a.mode&1&&mo(a,s.child,null,R),a.child.memoizedState=Bf(R),a.memoizedState=zf,_);if(!(a.mode&1))return Hu(s,a,R,null);if(Jh(p))return h=h9(p).digest,_=Error(l(419)),h=Df(_,h,void 0),Hu(s,a,R,h);if(c=(R&s.childLanes)!==0,cn||c){if(h=Ot,h!==null){switch(R&-R){case 4:p=2;break;case 16:p=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:p=32;break;case 536870912:p=268435456;break;default:p=0}p=p&(h.suspendedLanes|R)?0:p,p!==0&&p!==_.retryLane&&(_.retryLane=p,_r(s,p),jn(h,s,p,-1))}return l0(),h=Df(Error(l(421))),Hu(s,a,R,h)}return sm(p)?(a.flags|=128,a.child=s.child,a=h7.bind(null,s),f9(p,a),null):(s=_.treeContext,Ke&&(Ln=m9(p),Cn=a,$e=!0,tr=null,Da=!1,s!==null&&(An[Mn++]=Ir,An[Mn++]=jr,An[Mn++]=fs,Ir=s.id,jr=s.overflow,fs=a)),a=Gf(a,h.children),a.flags|=4096,a)}function d2(s,a,c){s.lanes|=a;var h=s.alternate;h!==null&&(h.lanes|=a),Sf(s.return,a,c)}function Hf(s,a,c,h,p){var _=s.memoizedState;_===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:p}:(_.isBackwards=a,_.rendering=null,_.renderingStartTime=0,_.last=h,_.tail=c,_.tailMode=p)}function h2(s,a,c){var h=a.pendingProps,p=h.revealOrder,_=h.tail;if(en(s,a,h.children,c),h=tt.current,h&2)h=h&1|2,a.flags|=128;else{if(s!==null&&s.flags&128)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&d2(s,c,a);else if(s.tag===19)d2(s,c,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}h&=1}if(He(tt,h),!(a.mode&1))a.memoizedState=null;else switch(p){case"forwards":for(c=a.child,p=null;c!==null;)s=c.alternate,s!==null&&Du(s)===null&&(p=c),c=c.sibling;c=p,c===null?(p=a.child,a.child=null):(p=c.sibling,c.sibling=null),Hf(a,!1,p,c,_);break;case"backwards":for(c=null,p=a.child,a.child=null;p!==null;){if(s=p.alternate,s!==null&&Du(s)===null){a.child=p;break}s=p.sibling,p.sibling=c,c=p,p=s}Hf(a,!0,c,null,_);break;case"together":Hf(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Vu(s,a){!(a.mode&1)&&s!==null&&(s.alternate=null,a.alternate=null,a.flags|=2)}function zr(s,a,c){if(s!==null&&(a.dependencies=s.dependencies),ys|=a.lanes,!(c&a.childLanes))return null;if(s!==null&&a.child!==s.child)throw Error(l(153));if(a.child!==null){for(s=a.child,c=wi(s,s.pendingProps),a.child=c,c.return=a;s.sibling!==null;)s=s.sibling,c=c.sibling=wi(s,s.pendingProps),c.return=a;c.sibling=null}return a.child}function e7(s,a,c){switch(a.tag){case 3:l2(a),go();break;case 5:Pm(a);break;case 1:un(a.type)&&xu(a);break;case 4:wf(a,a.stateNode.containerInfo);break;case 10:xm(a,a.type._context,a.memoizedProps.value);break;case 13:var h=a.memoizedState;if(h!==null)return h.dehydrated!==null?(He(tt,tt.current&1),a.flags|=128,null):c&a.child.childLanes?c2(s,a,c):(He(tt,tt.current&1),s=zr(s,a,c),s!==null?s.sibling:null);He(tt,tt.current&1);break;case 19:if(h=(c&a.childLanes)!==0,s.flags&128){if(h)return h2(s,a,c);a.flags|=128}var p=a.memoizedState;if(p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),He(tt,tt.current),h)break;return null;case 22:case 23:return a.lanes=0,s2(s,a,c)}return zr(s,a,c)}function Cr(s){s.flags|=4}function f2(s,a){if(s!==null&&s.child===a.child)return!0;if(a.flags&16)return!1;for(s=a.child;s!==null;){if(s.flags&12854||s.subtreeFlags&12854)return!1;s=s.sibling}return!0}var Va,Wa,Wu,Ku;if(ve)Va=function(s,a){for(var c=a.child;c!==null;){if(c.tag===5||c.tag===6)le(s,c.stateNode);else if(c.tag!==4&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},Wa=function(){},Wu=function(s,a,c,h,p){if(s=s.memoizedProps,s!==h){var _=a.stateNode,R=xr(Dn.current);c=at(_,c,s,h,p,R),(a.updateQueue=c)&&Cr(a)}},Ku=function(s,a,c,h){c!==h&&Cr(a)};else if(Ge){Va=function(s,a,c,h){for(var p=a.child;p!==null;){if(p.tag===5){var _=p.stateNode;c&&h&&(_=rm(_,p.type,p.memoizedProps,p)),le(s,_)}else if(p.tag===6)_=p.stateNode,c&&h&&(_=im(_,p.memoizedProps,p)),le(s,_);else if(p.tag!==4){if(p.tag===22&&p.memoizedState!==null)_=p.child,_!==null&&(_.return=p),Va(s,p,!0,!0);else if(p.child!==null){p.child.return=p,p=p.child;continue}}if(p===a)break;for(;p.sibling===null;){if(p.return===null||p.return===a)return;p=p.return}p.sibling.return=p.return,p=p.sibling}};var p2=function(s,a,c,h){for(var p=a.child;p!==null;){if(p.tag===5){var _=p.stateNode;c&&h&&(_=rm(_,p.type,p.memoizedProps,p)),nm(s,_)}else if(p.tag===6)_=p.stateNode,c&&h&&(_=im(_,p.memoizedProps,p)),nm(s,_);else if(p.tag!==4){if(p.tag===22&&p.memoizedState!==null)_=p.child,_!==null&&(_.return=p),p2(s,p,!0,!0);else if(p.child!==null){p.child.return=p,p=p.child;continue}}if(p===a)break;for(;p.sibling===null;){if(p.return===null||p.return===a)return;p=p.return}p.sibling.return=p.return,p=p.sibling}};Wa=function(s,a){var c=a.stateNode;if(!f2(s,a)){s=c.containerInfo;var h=tm(s);p2(h,a,!1,!1),c.pendingChildren=h,Cr(a),l9(s,h)}},Wu=function(s,a,c,h,p){var _=s.stateNode,R=s.memoizedProps;if((s=f2(s,a))&&R===h)a.stateNode=_;else{var b=a.stateNode,B=xr(Dn.current),Y=null;R!==h&&(Y=at(b,c,R,h,p,B)),s&&Y===null?a.stateNode=_:(_=a9(_,Y,c,R,h,a,s,b),Ne(_,c,h,p,B)&&Cr(a),a.stateNode=_,s?Cr(a):Va(_,a,!1,!1))}},Ku=function(s,a,c,h){c!==h?(s=xr(So.current),c=xr(Dn.current),a.stateNode=We(h,s,c,a),Cr(a)):a.stateNode=s.stateNode}}else Wa=function(){},Wu=function(){},Ku=function(){};function Ka(s,a){if(!$e)switch(s.tailMode){case"hidden":a=s.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?s.tail=null:c.sibling=null;break;case"collapsed":c=s.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function Vt(s){var a=s.alternate!==null&&s.alternate.child===s.child,c=0,h=0;if(a)for(var p=s.child;p!==null;)c|=p.lanes|p.childLanes,h|=p.subtreeFlags&14680064,h|=p.flags&14680064,p.return=s,p=p.sibling;else for(p=s.child;p!==null;)c|=p.lanes|p.childLanes,h|=p.subtreeFlags,h|=p.flags,p.return=s,p=p.sibling;return s.subtreeFlags|=h,s.childLanes=c,a}function t7(s,a,c){var h=a.pendingProps;switch(hf(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(a),null;case 1:return un(a.type)&&_u(),Vt(a),null;case 3:return c=a.stateNode,_o(),Qe(ln),Qe(Gt),Ef(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(s===null||s.child===null)&&(Tu(a)?Cr(a):s===null||s.memoizedState.isDehydrated&&!(a.flags&256)||(a.flags|=1024,tr!==null&&(o0(tr),tr=null))),Wa(s,a),Vt(a),null;case 5:Cf(a),c=xr(So.current);var p=a.type;if(s!==null&&a.stateNode!=null)Wu(s,a,p,h,c),s.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!h){if(a.stateNode===null)throw Error(l(166));return Vt(a),null}if(s=xr(Dn.current),Tu(a)){if(!Ke)throw Error(l(175));s=y9(a.stateNode,a.type,a.memoizedProps,c,s,a,!Da),a.updateQueue=s,s!==null&&Cr(a)}else{var _=J(p,h,c,s,a);Va(_,a,!1,!1),a.stateNode=_,Ne(_,p,h,c,s)&&Cr(a)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return Vt(a),null;case 6:if(s&&a.stateNode!=null)Ku(s,a,s.memoizedProps,h);else{if(typeof h!="string"&&a.stateNode===null)throw Error(l(166));if(s=xr(So.current),c=xr(Dn.current),Tu(a)){if(!Ke)throw Error(l(176));if(s=a.stateNode,c=a.memoizedProps,(h=v9(s,c,a,!Da))&&(p=Cn,p!==null))switch(p.tag){case 3:P9(p.stateNode.containerInfo,s,c,(p.mode&1)!==0);break;case 5:N9(p.type,p.memoizedProps,p.stateNode,s,c,(p.mode&1)!==0)}h&&Cr(a)}else a.stateNode=We(h,s,c,a)}return Vt(a),null;case 13:if(Qe(tt),h=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if($e&&Ln!==null&&a.mode&1&&!(a.flags&128))ym(),go(),a.flags|=98560,p=!1;else if(p=Tu(a),h!==null&&h.dehydrated!==null){if(s===null){if(!p)throw Error(l(318));if(!Ke)throw Error(l(344));if(p=a.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(l(317));S9(p,a)}else go(),!(a.flags&128)&&(a.memoizedState=null),a.flags|=4;Vt(a),p=!1}else tr!==null&&(o0(tr),tr=null),p=!0;if(!p)return a.flags&65536?a:null}return a.flags&128?(a.lanes=c,a):(c=h!==null,c!==(s!==null&&s.memoizedState!==null)&&c&&(a.child.flags|=8192,a.mode&1&&(s===null||tt.current&1?xt===0&&(xt=3):l0())),a.updateQueue!==null&&(a.flags|=4),Vt(a),null);case 4:return _o(),Wa(s,a),s===null&&Ue(a.stateNode.containerInfo),Vt(a),null;case 10:return vf(a.type._context),Vt(a),null;case 17:return un(a.type)&&_u(),Vt(a),null;case 19:if(Qe(tt),p=a.memoizedState,p===null)return Vt(a),null;if(h=(a.flags&128)!==0,_=p.rendering,_===null)if(h)Ka(p,!1);else{if(xt!==0||s!==null&&s.flags&128)for(s=a.child;s!==null;){if(_=Du(s),_!==null){for(a.flags|=128,Ka(p,!1),s=_.updateQueue,s!==null&&(a.updateQueue=s,a.flags|=4),a.subtreeFlags=0,s=c,c=a.child;c!==null;)h=c,p=s,h.flags&=14680066,_=h.alternate,_===null?(h.childLanes=0,h.lanes=p,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=_.childLanes,h.lanes=_.lanes,h.child=_.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=_.memoizedProps,h.memoizedState=_.memoizedState,h.updateQueue=_.updateQueue,h.type=_.type,p=_.dependencies,h.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext}),c=c.sibling;return He(tt,tt.current&1|2),a.child}s=s.sibling}p.tail!==null&&Rt()>n0&&(a.flags|=128,h=!0,Ka(p,!1),a.lanes=4194304)}else{if(!h)if(s=Du(_),s!==null){if(a.flags|=128,h=!0,s=s.updateQueue,s!==null&&(a.updateQueue=s,a.flags|=4),Ka(p,!0),p.tail===null&&p.tailMode==="hidden"&&!_.alternate&&!$e)return Vt(a),null}else 2*Rt()-p.renderingStartTime>n0&&c!==1073741824&&(a.flags|=128,h=!0,Ka(p,!1),a.lanes=4194304);p.isBackwards?(_.sibling=a.child,a.child=_):(s=p.last,s!==null?s.sibling=_:a.child=_,p.last=_)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=Rt(),a.sibling=null,s=tt.current,He(tt,h?s&1|2:s&1),a):(Vt(a),null);case 22:case 23:return a0(),c=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==c&&(a.flags|=8192),c&&a.mode&1?kn&1073741824&&(Vt(a),ve&&a.subtreeFlags&6&&(a.flags|=8192)):Vt(a),null;case 24:return null;case 25:return null}throw Error(l(156,a.tag))}function n7(s,a){switch(hf(a),a.tag){case 1:return un(a.type)&&_u(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return _o(),Qe(ln),Qe(Gt),Ef(),s=a.flags,s&65536&&!(s&128)?(a.flags=s&-65537|128,a):null;case 5:return Cf(a),null;case 13:if(Qe(tt),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(l(340));go()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return Qe(tt),null;case 4:return _o(),null;case 10:return vf(a.type._context),null;case 22:case 23:return a0(),null;case 24:return null;default:return null}}var Qu=!1,Wt=!1,r7=typeof WeakSet=="function"?WeakSet:Set,se=null;function wo(s,a){var c=s.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(h){Je(s,a,h)}else c.current=null}function Vf(s,a,c){try{c()}catch(h){Je(s,a,h)}}var g2=!1;function i7(s,a){for(ee(s.containerInfo),se=a;se!==null;)if(s=se,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,se=a;else for(;se!==null;){s=se;try{var c=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(c!==null){var h=c.memoizedProps,p=c.memoizedState,_=s.stateNode,R=_.getSnapshotBeforeUpdate(s.elementType===s.type?h:nr(s.type,h),p);_.__reactInternalSnapshotBeforeUpdate=R}break;case 3:ve&&o9(s.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(b){Je(s,s.return,b)}if(a=s.sibling,a!==null){a.return=s.return,se=a;break}se=s.return}return c=g2,g2=!1,c}function Qa(s,a,c){var h=a.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var p=h=h.next;do{if((p.tag&s)===s){var _=p.destroy;p.destroy=void 0,_!==void 0&&Vf(a,c,_)}p=p.next}while(p!==h)}}function qu(s,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var c=a=a.next;do{if((c.tag&s)===s){var h=c.create;c.destroy=h()}c=c.next}while(c!==a)}}function Wf(s){var a=s.ref;if(a!==null){var c=s.stateNode;switch(s.tag){case 5:s=he(c);break;default:s=c}typeof a=="function"?a(s):a.current=s}}function m2(s){var a=s.alternate;a!==null&&(s.alternate=null,m2(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&Jn(a)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function y2(s){return s.tag===5||s.tag===3||s.tag===4}function v2(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||y2(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Kf(s,a,c){var h=s.tag;if(h===5||h===6)s=s.stateNode,a?Z8(c,s,a):q8(c,s);else if(h!==4&&(s=s.child,s!==null))for(Kf(s,a,c),s=s.sibling;s!==null;)Kf(s,a,c),s=s.sibling}function Qf(s,a,c){var h=s.tag;if(h===5||h===6)s=s.stateNode,a?J8(c,s,a):Q8(c,s);else if(h!==4&&(s=s.child,s!==null))for(Qf(s,a,c),s=s.sibling;s!==null;)Qf(s,a,c),s=s.sibling}var It=null,rr=!1;function kr(s,a,c){for(c=c.child;c!==null;)qf(s,a,c),c=c.sibling}function qf(s,a,c){if(vr&&typeof vr.onCommitFiberUnmount=="function")try{vr.onCommitFiberUnmount(Eu,c)}catch{}switch(c.tag){case 5:Wt||wo(c,a);case 6:if(ve){var h=It,p=rr;It=null,kr(s,a,c),It=h,rr=p,It!==null&&(rr?t9(It,c.stateNode):e9(It,c.stateNode))}else kr(s,a,c);break;case 18:ve&&It!==null&&(rr?k9(It,c.stateNode):C9(It,c.stateNode));break;case 4:ve?(h=It,p=rr,It=c.stateNode.containerInfo,rr=!0,kr(s,a,c),It=h,rr=p):(Ge&&(h=c.stateNode.containerInfo,p=tm(h),$h(h,p)),kr(s,a,c));break;case 0:case 11:case 14:case 15:if(!Wt&&(h=c.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){p=h=h.next;do{var _=p,R=_.destroy;_=_.tag,R!==void 0&&(_&2||_&4)&&Vf(c,a,R),p=p.next}while(p!==h)}kr(s,a,c);break;case 1:if(!Wt&&(wo(c,a),h=c.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=c.memoizedProps,h.state=c.memoizedState,h.componentWillUnmount()}catch(b){Je(c,a,b)}kr(s,a,c);break;case 21:kr(s,a,c);break;case 22:c.mode&1?(Wt=(h=Wt)||c.memoizedState!==null,kr(s,a,c),Wt=h):kr(s,a,c);break;default:kr(s,a,c)}}function S2(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var c=s.stateNode;c===null&&(c=s.stateNode=new r7),a.forEach(function(h){var p=f7.bind(null,s,h);c.has(h)||(c.add(h),h.then(p,p))})}}function ir(s,a){var c=a.deletions;if(c!==null)for(var h=0;h<c.length;h++){var p=c[h];try{var _=s,R=a;if(ve){var b=R;e:for(;b!==null;){switch(b.tag){case 5:It=b.stateNode,rr=!1;break e;case 3:It=b.stateNode.containerInfo,rr=!0;break e;case 4:It=b.stateNode.containerInfo,rr=!0;break e}b=b.return}if(It===null)throw Error(l(160));qf(_,R,p),It=null,rr=!1}else qf(_,R,p);var B=p.alternate;B!==null&&(B.return=null),p.return=null}catch(Y){Je(p,a,Y)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)_2(a,s),a=a.sibling}function _2(s,a){var c=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(ir(a,s),Er(s),h&4){try{Qa(3,s,s.return),qu(3,s)}catch(ne){Je(s,s.return,ne)}try{Qa(5,s,s.return)}catch(ne){Je(s,s.return,ne)}}break;case 1:ir(a,s),Er(s),h&512&&c!==null&&wo(c,c.return);break;case 5:if(ir(a,s),Er(s),h&512&&c!==null&&wo(c,c.return),ve){if(s.flags&32){var p=s.stateNode;try{em(p)}catch(ne){Je(s,s.return,ne)}}if(h&4&&(p=s.stateNode,p!=null)){var _=s.memoizedProps;if(c=c!==null?c.memoizedProps:_,h=s.type,a=s.updateQueue,s.updateQueue=null,a!==null)try{$8(p,a,h,c,_,s)}catch(ne){Je(s,s.return,ne)}}}break;case 6:if(ir(a,s),Er(s),h&4&&ve){if(s.stateNode===null)throw Error(l(162));p=s.stateNode,_=s.memoizedProps,c=c!==null?c.memoizedProps:_;try{Y8(p,c,_)}catch(ne){Je(s,s.return,ne)}}break;case 3:if(ir(a,s),Er(s),h&4){if(ve&&Ke&&c!==null&&c.memoizedState.isDehydrated)try{x9(a.containerInfo)}catch(ne){Je(s,s.return,ne)}if(Ge){p=a.containerInfo,_=a.pendingChildren;try{$h(p,_)}catch(ne){Je(s,s.return,ne)}}}break;case 4:if(ir(a,s),Er(s),h&4&&Ge){_=s.stateNode,p=_.containerInfo,_=_.pendingChildren;try{$h(p,_)}catch(ne){Je(s,s.return,ne)}}break;case 13:ir(a,s),Er(s),p=s.child,p.flags&8192&&(_=p.memoizedState!==null,p.stateNode.isHidden=_,!_||p.alternate!==null&&p.alternate.memoizedState!==null||(t0=Rt())),h&4&&S2(s);break;case 22:var R=c!==null&&c.memoizedState!==null;if(s.mode&1?(Wt=(c=Wt)||R,ir(a,s),Wt=c):ir(a,s),Er(s),h&8192){if(c=s.memoizedState!==null,(s.stateNode.isHidden=c)&&!R&&s.mode&1)for(se=s,h=s.child;h!==null;){for(a=se=h;se!==null;){R=se;var b=R.child;switch(R.tag){case 0:case 11:case 14:case 15:Qa(4,R,R.return);break;case 1:wo(R,R.return);var B=R.stateNode;if(typeof B.componentWillUnmount=="function"){var Y=R,ae=R.return;try{var me=Y;B.props=me.memoizedProps,B.state=me.memoizedState,B.componentWillUnmount()}catch(ne){Je(Y,ae,ne)}}break;case 5:wo(R,R.return);break;case 22:if(R.memoizedState!==null){C2(a);continue}}b!==null?(b.return=R,se=b):C2(a)}h=h.sibling}if(ve){e:if(h=null,ve)for(a=s;;){if(a.tag===5){if(h===null){h=a;try{p=a.stateNode,c?n9(p):i9(a.stateNode,a.memoizedProps)}catch(ne){Je(s,s.return,ne)}}}else if(a.tag===6){if(h===null)try{_=a.stateNode,c?r9(_):s9(_,a.memoizedProps)}catch(ne){Je(s,s.return,ne)}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===s)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;h===a&&(h=null),a=a.return}h===a&&(h=null),a.sibling.return=a.return,a=a.sibling}}}break;case 19:ir(a,s),Er(s),h&4&&S2(s);break;case 21:break;default:ir(a,s),Er(s)}}function Er(s){var a=s.flags;if(a&2){try{if(ve){e:{for(var c=s.return;c!==null;){if(y2(c)){var h=c;break e}c=c.return}throw Error(l(160))}switch(h.tag){case 5:var p=h.stateNode;h.flags&32&&(em(p),h.flags&=-33);var _=v2(s);Qf(s,_,p);break;case 3:case 4:var R=h.stateNode.containerInfo,b=v2(s);Kf(s,b,R);break;default:throw Error(l(161))}}}catch(B){Je(s,s.return,B)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function s7(s,a,c){se=s,x2(s)}function x2(s,a,c){for(var h=(s.mode&1)!==0;se!==null;){var p=se,_=p.child;if(p.tag===22&&h){var R=p.memoizedState!==null||Qu;if(!R){var b=p.alternate,B=b!==null&&b.memoizedState!==null||Wt;b=Qu;var Y=Wt;if(Qu=R,(Wt=B)&&!Y)for(se=p;se!==null;)R=se,B=R.child,R.tag===22&&R.memoizedState!==null?k2(p):B!==null?(B.return=R,se=B):k2(p);for(;_!==null;)se=_,x2(_),_=_.sibling;se=p,Qu=b,Wt=Y}w2(s)}else p.subtreeFlags&8772&&_!==null?(_.return=p,se=_):w2(s)}}function w2(s){for(;se!==null;){var a=se;if(a.flags&8772){var c=a.alternate;try{if(a.flags&8772)switch(a.tag){case 0:case 11:case 15:Wt||qu(5,a);break;case 1:var h=a.stateNode;if(a.flags&4&&!Wt)if(c===null)h.componentDidMount();else{var p=a.elementType===a.type?c.memoizedProps:nr(a.type,c.memoizedProps);h.componentDidUpdate(p,c.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var _=a.updateQueue;_!==null&&Em(a,_,h);break;case 3:var R=a.updateQueue;if(R!==null){if(c=null,a.child!==null)switch(a.child.tag){case 5:c=he(a.child.stateNode);break;case 1:c=a.child.stateNode}Em(a,R,c)}break;case 5:var b=a.stateNode;c===null&&a.flags&4&&X8(b,a.type,a.memoizedProps,a);break;case 6:break;case 4:break;case 12:break;case 13:if(Ke&&a.memoizedState===null){var B=a.alternate;if(B!==null){var Y=B.memoizedState;if(Y!==null){var ae=Y.dehydrated;ae!==null&&w9(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}Wt||a.flags&512&&Wf(a)}catch(me){Je(a,a.return,me)}}if(a===s){se=null;break}if(c=a.sibling,c!==null){c.return=a.return,se=c;break}se=a.return}}function C2(s){for(;se!==null;){var a=se;if(a===s){se=null;break}var c=a.sibling;if(c!==null){c.return=a.return,se=c;break}se=a.return}}function k2(s){for(;se!==null;){var a=se;try{switch(a.tag){case 0:case 11:case 15:var c=a.return;try{qu(4,a)}catch(B){Je(a,c,B)}break;case 1:var h=a.stateNode;if(typeof h.componentDidMount=="function"){var p=a.return;try{h.componentDidMount()}catch(B){Je(a,p,B)}}var _=a.return;try{Wf(a)}catch(B){Je(a,_,B)}break;case 5:var R=a.return;try{Wf(a)}catch(B){Je(a,R,B)}}}catch(B){Je(a,a.return,B)}if(a===s){se=null;break}var b=a.sibling;if(b!==null){b.return=a.return,se=b;break}se=a.return}}var Yu=0,Xu=1,$u=2,Ju=3,Zu=4;if(typeof Symbol=="function"&&Symbol.for){var qa=Symbol.for;Yu=qa("selector.component"),Xu=qa("selector.has_pseudo_class"),$u=qa("selector.role"),Ju=qa("selector.test_id"),Zu=qa("selector.text")}function Yf(s){var a=yr(s);if(a!=null){if(typeof a.memoizedProps["data-testname"]!="string")throw Error(l(364));return a}if(s=B8(s),s===null)throw Error(l(362));return s.stateNode.current}function Xf(s,a){switch(a.$$typeof){case Yu:if(s.type===a.value)return!0;break;case Xu:e:{a=a.value,s=[s,0];for(var c=0;c<s.length;){var h=s[c++],p=s[c++],_=a[p];if(h.tag!==5||!Aa(h)){for(;_!=null&&Xf(h,_);)p++,_=a[p];if(p===a.length){a=!0;break e}else for(h=h.child;h!==null;)s.push(h,p),h=h.sibling}}a=!1}return a;case $u:if(s.tag===5&&V8(s.stateNode,a.value))return!0;break;case Zu:if((s.tag===5||s.tag===6)&&(s=H8(s),s!==null&&0<=s.indexOf(a.value)))return!0;break;case Ju:if(s.tag===5&&(s=s.memoizedProps["data-testname"],typeof s=="string"&&s.toLowerCase()===a.value.toLowerCase()))return!0;break;default:throw Error(l(365))}return!1}function $f(s){switch(s.$$typeof){case Yu:return"<"+(L(s.value)||"Unknown")+">";case Xu:return":has("+($f(s)||"")+")";case $u:return'[role="'+s.value+'"]';case Zu:return'"'+s.value+'"';case Ju:return'[data-testname="'+s.value+'"]';default:throw Error(l(365))}}function E2(s,a){var c=[];s=[s,0];for(var h=0;h<s.length;){var p=s[h++],_=s[h++],R=a[_];if(p.tag!==5||!Aa(p)){for(;R!=null&&Xf(p,R);)_++,R=a[_];if(_===a.length)c.push(p);else for(p=p.child;p!==null;)s.push(p,_),p=p.sibling}}return c}function Jf(s,a){if(!Fa)throw Error(l(363));s=Yf(s),s=E2(s,a),a=[],s=Array.from(s);for(var c=0;c<s.length;){var h=s[c++];if(h.tag===5)Aa(h)||a.push(h.stateNode);else for(h=h.child;h!==null;)s.push(h),h=h.sibling}return a}var o7=Math.ceil,ec=u.ReactCurrentDispatcher,Zf=u.ReactCurrentOwner,ht=u.ReactCurrentBatchConfig,we=0,Ot=null,yt=null,jt=0,kn=0,Co=pi(0),xt=0,Ya=null,ys=0,tc=0,e0=0,Xa=null,dn=null,t0=0,n0=1/0,Br=null;function ko(){n0=Rt()+500}var nc=!1,r0=null,vi=null,rc=!1,Si=null,ic=0,$a=0,i0=null,sc=-1,oc=0;function Kt(){return we&6?Rt():sc!==-1?sc:sc=Rt()}function _i(s){return s.mode&1?we&2&&jt!==0?jt&-jt:G9.transition!==null?(oc===0&&(oc=um()),oc):(s=Fe,s!==0?s:hi()):1}function jn(s,a,c,h){if(50<$a)throw $a=0,i0=null,Error(l(185));ba(s,c,h),(!(we&2)||s!==Ot)&&(s===Ot&&(!(we&2)&&(tc|=c),xt===4&&xi(s,jt)),hn(s,h),c===1&&we===0&&!(a.mode&1)&&(ko(),Pu&&Sr()))}function hn(s,a){var c=s.callbackNode;M9(s,a);var h=ku(s,s===Ot?jt:0);if(h===0)c!==null&&dm(c),s.callbackNode=null,s.callbackPriority=0;else if(a=h&-h,s.callbackPriority!==a){if(c!=null&&dm(c),a===1)s.tag===0?B9(N2.bind(null,s)):hm(N2.bind(null,s)),fi?z8(function(){!(we&6)&&Sr()}):af(lf,Sr),c=null;else{switch(cm(h)){case 1:c=lf;break;case 4:c=I9;break;case 16:c=uf;break;case 536870912:c=j9;break;default:c=uf}c=D2(c,P2.bind(null,s))}s.callbackPriority=a,s.callbackNode=c}}function P2(s,a){if(sc=-1,oc=0,we&6)throw Error(l(327));var c=s.callbackNode;if(_s()&&s.callbackNode!==c)return null;var h=ku(s,s===Ot?jt:0);if(h===0)return null;if(h&30||h&s.expiredLanes||a)a=ac(s,h);else{a=h;var p=we;we|=2;var _=O2();(Ot!==s||jt!==a)&&(Br=null,ko(),vs(s,a));do try{u7();break}catch(b){T2(s,b)}while(!0);yf(),ec.current=_,we=p,yt!==null?a=0:(Ot=null,jt=0,a=xt)}if(a!==0){if(a===2&&(p=rf(s),p!==0&&(h=p,a=s0(s,p))),a===1)throw c=Ya,vs(s,0),xi(s,h),hn(s,Rt()),c;if(a===6)xi(s,h);else{if(p=s.current.alternate,!(h&30)&&!a7(p)&&(a=ac(s,h),a===2&&(_=rf(s),_!==0&&(h=_,a=s0(s,_))),a===1))throw c=Ya,vs(s,0),xi(s,h),hn(s,Rt()),c;switch(s.finishedWork=p,s.finishedLanes=h,a){case 0:case 1:throw Error(l(345));case 2:Ss(s,dn,Br);break;case 3:if(xi(s,h),(h&130023424)===h&&(a=t0+500-Rt(),10<a)){if(ku(s,0)!==0)break;if(p=s.suspendedLanes,(p&h)!==h){Kt(),s.pingedLanes|=s.suspendedLanes&p;break}s.timeoutHandle=D(Ss.bind(null,s,dn,Br),a);break}Ss(s,dn,Br);break;case 4:if(xi(s,h),(h&4194240)===h)break;for(a=s.eventTimes,p=-1;0<h;){var R=31-Zn(h);_=1<<R,R=a[R],R>p&&(p=R),h&=~_}if(h=p,h=Rt()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*o7(h/1960))-h,10<h){s.timeoutHandle=D(Ss.bind(null,s,dn,Br),h);break}Ss(s,dn,Br);break;case 5:Ss(s,dn,Br);break;default:throw Error(l(329))}}}return hn(s,Rt()),s.callbackNode===c?P2.bind(null,s):null}function s0(s,a){var c=Xa;return s.current.memoizedState.isDehydrated&&(vs(s,a).flags|=256),s=ac(s,a),s!==2&&(a=dn,dn=c,a!==null&&o0(a)),s}function o0(s){dn===null?dn=s:dn.push.apply(dn,s)}function a7(s){for(var a=s;;){if(a.flags&16384){var c=a.updateQueue;if(c!==null&&(c=c.stores,c!==null))for(var h=0;h<c.length;h++){var p=c[h],_=p.getSnapshot;p=p.value;try{if(!er(_(),p))return!1}catch{return!1}}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function xi(s,a){for(a&=~e0,a&=~tc,s.suspendedLanes|=a,s.pingedLanes&=~a,s=s.expirationTimes;0<a;){var c=31-Zn(a),h=1<<c;s[c]=-1,a&=~h}}function N2(s){if(we&6)throw Error(l(327));_s();var a=ku(s,0);if(!(a&1))return hn(s,Rt()),null;var c=ac(s,a);if(s.tag!==0&&c===2){var h=rf(s);h!==0&&(a=h,c=s0(s,h))}if(c===1)throw c=Ya,vs(s,0),xi(s,a),hn(s,Rt()),c;if(c===6)throw Error(l(345));return s.finishedWork=s.current.alternate,s.finishedLanes=a,Ss(s,dn,Br),hn(s,Rt()),null}function R2(s){Si!==null&&Si.tag===0&&!(we&6)&&_s();var a=we;we|=1;var c=ht.transition,h=Fe;try{if(ht.transition=null,Fe=1,s)return s()}finally{Fe=h,ht.transition=c,we=a,!(we&6)&&Sr()}}function a0(){kn=Co.current,Qe(Co)}function vs(s,a){s.finishedWork=null,s.finishedLanes=0;var c=s.timeoutHandle;if(c!==ue&&(s.timeoutHandle=ue,Q(c)),yt!==null)for(c=yt.return;c!==null;){var h=c;switch(hf(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&_u();break;case 3:_o(),Qe(ln),Qe(Gt),Ef();break;case 5:Cf(h);break;case 4:_o();break;case 13:Qe(tt);break;case 19:Qe(tt);break;case 10:vf(h.type._context);break;case 22:case 23:a0()}c=c.return}if(Ot=s,yt=s=wi(s.current,null),jt=kn=a,xt=0,Ya=null,e0=tc=ys=0,dn=Xa=null,gs!==null){for(a=0;a<gs.length;a++)if(c=gs[a],h=c.interleaved,h!==null){c.interleaved=null;var p=h.next,_=c.pending;if(_!==null){var R=_.next;_.next=p,h.next=R}c.pending=h}gs=null}return s}function T2(s,a){do{var c=yt;try{if(yf(),Iu.current=Bu,ju){for(var h=nt.memoizedState;h!==null;){var p=h.queue;p!==null&&(p.pending=null),h=h.next}ju=!1}if(ms=0,Tt=_t=nt=null,za=!1,Ba=0,Zf.current=null,c===null||c.return===null){xt=1,Ya=a,yt=null;break}e:{var _=s,R=c.return,b=c,B=a;if(a=jt,b.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var Y=B,ae=b,me=ae.tag;if(!(ae.mode&1)&&(me===0||me===11||me===15)){var ne=ae.alternate;ne?(ae.updateQueue=ne.updateQueue,ae.memoizedState=ne.memoizedState,ae.lanes=ne.lanes):(ae.updateQueue=null,ae.memoizedState=null)}var qe=e2(R);if(qe!==null){qe.flags&=-257,t2(qe,R,b,_,a),qe.mode&1&&Zm(_,Y,a),a=qe,B=Y;var ze=a.updateQueue;if(ze===null){var fn=new Set;fn.add(B),a.updateQueue=fn}else ze.add(B);break e}else{if(!(a&1)){Zm(_,Y,a),l0();break e}B=Error(l(426))}}else if($e&&b.mode&1){var Gr=e2(R);if(Gr!==null){!(Gr.flags&65536)&&(Gr.flags|=256),t2(Gr,R,b,_,a),gf(xo(B,b));break e}}_=B=xo(B,b),xt!==4&&(xt=2),Xa===null?Xa=[_]:Xa.push(_),_=R;do{switch(_.tag){case 3:_.flags|=65536,a&=-a,_.lanes|=a;var U=$m(_,B,a);km(_,U);break e;case 1:b=B;var I=_.type,H=_.stateNode;if(!(_.flags&128)&&(typeof I.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(vi===null||!vi.has(H)))){_.flags|=65536,a&=-a,_.lanes|=a;var re=Jm(_,b,a);km(_,re);break e}}_=_.return}while(_!==null)}A2(c)}catch(de){a=de,yt===c&&c!==null&&(yt=c=c.return);continue}break}while(!0)}function O2(){var s=ec.current;return ec.current=Bu,s===null?Bu:s}function l0(){(xt===0||xt===3||xt===2)&&(xt=4),Ot===null||!(ys&268435455)&&!(tc&268435455)||xi(Ot,jt)}function ac(s,a){var c=we;we|=2;var h=O2();(Ot!==s||jt!==a)&&(Br=null,vs(s,a));do try{l7();break}catch(p){T2(s,p)}while(!0);if(yf(),we=c,ec.current=h,yt!==null)throw Error(l(261));return Ot=null,jt=0,xt}function l7(){for(;yt!==null;)F2(yt)}function u7(){for(;yt!==null&&!b9();)F2(yt)}function F2(s){var a=b2(s.alternate,s,kn);s.memoizedProps=s.pendingProps,a===null?A2(s):yt=a,Zf.current=null}function A2(s){var a=s;do{var c=a.alternate;if(s=a.return,a.flags&32768){if(c=n7(c,a),c!==null){c.flags&=32767,yt=c;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{xt=6,yt=null;return}}else if(c=t7(c,a,kn),c!==null){yt=c;return}if(a=a.sibling,a!==null){yt=a;return}yt=a=s}while(a!==null);xt===0&&(xt=5)}function Ss(s,a,c){var h=Fe,p=ht.transition;try{ht.transition=null,Fe=1,c7(s,a,c,h)}finally{ht.transition=p,Fe=h}return null}function c7(s,a,c,h){do _s();while(Si!==null);if(we&6)throw Error(l(327));c=s.finishedWork;var p=s.finishedLanes;if(c===null)return null;if(s.finishedWork=null,s.finishedLanes=0,c===s.current)throw Error(l(177));s.callbackNode=null,s.callbackPriority=0;var _=c.lanes|c.childLanes;if(L9(s,_),s===Ot&&(yt=Ot=null,jt=0),!(c.subtreeFlags&2064)&&!(c.flags&2064)||rc||(rc=!0,D2(uf,function(){return _s(),null})),_=(c.flags&15990)!==0,c.subtreeFlags&15990||_){_=ht.transition,ht.transition=null;var R=Fe;Fe=1;var b=we;we|=4,Zf.current=null,i7(s,c),_2(c,s),$(s.containerInfo),s.current=c,s7(c),D9(),we=b,Fe=R,ht.transition=_}else s.current=c;if(rc&&(rc=!1,Si=s,ic=p),_=s.pendingLanes,_===0&&(vi=null),U9(c.stateNode),hn(s,Rt()),a!==null)for(h=s.onRecoverableError,c=0;c<a.length;c++)p=a[c],h(p.value,{componentStack:p.stack,digest:p.digest});if(nc)throw nc=!1,s=r0,r0=null,s;return ic&1&&s.tag!==0&&_s(),_=s.pendingLanes,_&1?s===i0?$a++:($a=0,i0=s):$a=0,Sr(),null}function _s(){if(Si!==null){var s=cm(ic),a=ht.transition,c=Fe;try{if(ht.transition=null,Fe=16>s?16:s,Si===null)var h=!1;else{if(s=Si,Si=null,ic=0,we&6)throw Error(l(331));var p=we;for(we|=4,se=s.current;se!==null;){var _=se,R=_.child;if(se.flags&16){var b=_.deletions;if(b!==null){for(var B=0;B<b.length;B++){var Y=b[B];for(se=Y;se!==null;){var ae=se;switch(ae.tag){case 0:case 11:case 15:Qa(8,ae,_)}var me=ae.child;if(me!==null)me.return=ae,se=me;else for(;se!==null;){ae=se;var ne=ae.sibling,qe=ae.return;if(m2(ae),ae===Y){se=null;break}if(ne!==null){ne.return=qe,se=ne;break}se=qe}}}var ze=_.alternate;if(ze!==null){var fn=ze.child;if(fn!==null){ze.child=null;do{var Gr=fn.sibling;fn.sibling=null,fn=Gr}while(fn!==null)}}se=_}}if(_.subtreeFlags&2064&&R!==null)R.return=_,se=R;else e:for(;se!==null;){if(_=se,_.flags&2048)switch(_.tag){case 0:case 11:case 15:Qa(9,_,_.return)}var U=_.sibling;if(U!==null){U.return=_.return,se=U;break e}se=_.return}}var I=s.current;for(se=I;se!==null;){R=se;var H=R.child;if(R.subtreeFlags&2064&&H!==null)H.return=R,se=H;else e:for(R=I;se!==null;){if(b=se,b.flags&2048)try{switch(b.tag){case 0:case 11:case 15:qu(9,b)}}catch(de){Je(b,b.return,de)}if(b===R){se=null;break e}var re=b.sibling;if(re!==null){re.return=b.return,se=re;break e}se=b.return}}if(we=p,Sr(),vr&&typeof vr.onPostCommitFiberRoot=="function")try{vr.onPostCommitFiberRoot(Eu,s)}catch{}h=!0}return h}finally{Fe=c,ht.transition=a}}return!1}function M2(s,a,c){a=xo(c,a),a=$m(s,a,1),s=yi(s,a,1),a=Kt(),s!==null&&(ba(s,1,a),hn(s,a))}function Je(s,a,c){if(s.tag===3)M2(s,s,c);else for(;a!==null;){if(a.tag===3){M2(a,s,c);break}else if(a.tag===1){var h=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(vi===null||!vi.has(h))){s=xo(c,s),s=Jm(a,s,1),a=yi(a,s,1),s=Kt(),a!==null&&(ba(a,1,s),hn(a,s));break}}a=a.return}}function d7(s,a,c){var h=s.pingCache;h!==null&&h.delete(a),a=Kt(),s.pingedLanes|=s.suspendedLanes&c,Ot===s&&(jt&c)===c&&(xt===4||xt===3&&(jt&130023424)===jt&&500>Rt()-t0?vs(s,0):e0|=c),hn(s,a)}function L2(s,a){a===0&&(s.mode&1?(a=Cu,Cu<<=1,!(Cu&130023424)&&(Cu=4194304)):a=1);var c=Kt();s=_r(s,a),s!==null&&(ba(s,a,c),hn(s,c))}function h7(s){var a=s.memoizedState,c=0;a!==null&&(c=a.retryLane),L2(s,c)}function f7(s,a){var c=0;switch(s.tag){case 13:var h=s.stateNode,p=s.memoizedState;p!==null&&(c=p.retryLane);break;case 19:h=s.stateNode;break;default:throw Error(l(314))}h!==null&&h.delete(a),L2(s,c)}var b2;b2=function(s,a,c){if(s!==null)if(s.memoizedProps!==a.pendingProps||ln.current)cn=!0;else{if(!(s.lanes&c)&&!(a.flags&128))return cn=!1,e7(s,a,c);cn=!!(s.flags&131072)}else cn=!1,$e&&a.flags&1048576&&fm(a,Ru,a.index);switch(a.lanes=0,a.tag){case 2:var h=a.type;Vu(s,a),s=a.pendingProps;var p=ho(a,Gt.current);vo(a,c),p=Rf(null,a,h,s,p,c);var _=Tf();return a.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,un(h)?(_=!0,xu(a)):_=!1,a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,xf(a),p.updater=Gu,a.stateNode=p,p._reactInternals=a,bf(a,h,s,c),a=Uf(null,a,h,!0,_,c)):(a.tag=0,$e&&_&&df(a),en(null,a,p,c),a=a.child),a;case 16:h=a.elementType;e:{switch(Vu(s,a),s=a.pendingProps,p=h._init,h=p(h._payload),a.type=h,p=a.tag=g7(h),s=nr(h,s),p){case 0:a=jf(null,a,h,s,c);break e;case 1:a=a2(null,a,h,s,c);break e;case 11:a=n2(null,a,h,s,c);break e;case 14:a=r2(null,a,h,nr(h.type,s),c);break e}throw Error(l(306,h,""))}return a;case 0:return h=a.type,p=a.pendingProps,p=a.elementType===h?p:nr(h,p),jf(s,a,h,p,c);case 1:return h=a.type,p=a.pendingProps,p=a.elementType===h?p:nr(h,p),a2(s,a,h,p,c);case 3:e:{if(l2(a),s===null)throw Error(l(387));h=a.pendingProps,_=a.memoizedState,p=_.element,Cm(s,a),bu(a,h,null,c);var R=a.memoizedState;if(h=R.element,Ke&&_.isDehydrated)if(_={element:h,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},a.updateQueue.baseState=_,a.memoizedState=_,a.flags&256){p=xo(Error(l(423)),a),a=u2(s,a,h,c,p);break e}else if(h!==p){p=xo(Error(l(424)),a),a=u2(s,a,h,c,p);break e}else for(Ke&&(Ln=g9(a.stateNode.containerInfo),Cn=a,$e=!0,tr=null,Da=!1),c=_m(a,null,h,c),a.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(go(),h===p){a=zr(s,a,c);break e}en(s,a,h,c)}a=a.child}return a;case 5:return Pm(a),s===null&&pf(a),h=a.type,p=a.pendingProps,_=s!==null?s.memoizedProps:null,R=p.children,mt(h,p)?R=null:_!==null&&mt(h,_)&&(a.flags|=32),o2(s,a),en(s,a,R,c),a.child;case 6:return s===null&&pf(a),null;case 13:return c2(s,a,c);case 4:return wf(a,a.stateNode.containerInfo),h=a.pendingProps,s===null?a.child=mo(a,null,h,c):en(s,a,h,c),a.child;case 11:return h=a.type,p=a.pendingProps,p=a.elementType===h?p:nr(h,p),n2(s,a,h,p,c);case 7:return en(s,a,a.pendingProps,c),a.child;case 8:return en(s,a,a.pendingProps.children,c),a.child;case 12:return en(s,a,a.pendingProps.children,c),a.child;case 10:e:{if(h=a.type._context,p=a.pendingProps,_=a.memoizedProps,R=p.value,xm(a,h,R),_!==null)if(er(_.value,R)){if(_.children===p.children&&!ln.current){a=zr(s,a,c);break e}}else for(_=a.child,_!==null&&(_.return=a);_!==null;){var b=_.dependencies;if(b!==null){R=_.child;for(var B=b.firstContext;B!==null;){if(B.context===h){if(_.tag===1){B=Ur(-1,c&-c),B.tag=2;var Y=_.updateQueue;if(Y!==null){Y=Y.shared;var ae=Y.pending;ae===null?B.next=B:(B.next=ae.next,ae.next=B),Y.pending=B}}_.lanes|=c,B=_.alternate,B!==null&&(B.lanes|=c),Sf(_.return,c,a),b.lanes|=c;break}B=B.next}}else if(_.tag===10)R=_.type===a.type?null:_.child;else if(_.tag===18){if(R=_.return,R===null)throw Error(l(341));R.lanes|=c,b=R.alternate,b!==null&&(b.lanes|=c),Sf(R,c,a),R=_.sibling}else R=_.child;if(R!==null)R.return=_;else for(R=_;R!==null;){if(R===a){R=null;break}if(_=R.sibling,_!==null){_.return=R.return,R=_;break}R=R.return}_=R}en(s,a,p.children,c),a=a.child}return a;case 9:return p=a.type,h=a.pendingProps.children,vo(a,c),p=bn(p),h=h(p),a.flags|=1,en(s,a,h,c),a.child;case 14:return h=a.type,p=nr(h,a.pendingProps),p=nr(h.type,p),r2(s,a,h,p,c);case 15:return i2(s,a,a.type,a.pendingProps,c);case 17:return h=a.type,p=a.pendingProps,p=a.elementType===h?p:nr(h,p),Vu(s,a),a.tag=1,un(h)?(s=!0,xu(a)):s=!1,vo(a,c),Ym(a,h,p),bf(a,h,p,c),Uf(null,a,h,!0,s,c);case 19:return h2(s,a,c);case 22:return s2(s,a,c)}throw Error(l(156,a.tag))};function D2(s,a){return af(s,a)}function p7(s,a,c,h){this.tag=s,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Un(s,a,c,h){return new p7(s,a,c,h)}function u0(s){return s=s.prototype,!(!s||!s.isReactComponent)}function g7(s){if(typeof s=="function")return u0(s)?1:0;if(s!=null){if(s=s.$$typeof,s===E)return 11;if(s===k)return 14}return 2}function wi(s,a){var c=s.alternate;return c===null?(c=Un(s.tag,a,s.key,s.mode),c.elementType=s.elementType,c.type=s.type,c.stateNode=s.stateNode,c.alternate=s,s.alternate=c):(c.pendingProps=a,c.type=s.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=s.flags&14680064,c.childLanes=s.childLanes,c.lanes=s.lanes,c.child=s.child,c.memoizedProps=s.memoizedProps,c.memoizedState=s.memoizedState,c.updateQueue=s.updateQueue,a=s.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=s.sibling,c.index=s.index,c.ref=s.ref,c}function lc(s,a,c,h,p,_){var R=2;if(h=s,typeof s=="function")u0(s)&&(R=1);else if(typeof s=="string")R=5;else e:switch(s){case g:return xs(c.children,p,_,a);case v:R=8,p|=8;break;case S:return s=Un(12,c,a,p|2),s.elementType=S,s.lanes=_,s;case C:return s=Un(13,c,a,p),s.elementType=C,s.lanes=_,s;case P:return s=Un(19,c,a,p),s.elementType=P,s.lanes=_,s;case x:return uc(c,p,_,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case w:R=10;break e;case y:R=9;break e;case E:R=11;break e;case k:R=14;break e;case m:R=16,h=null;break e}throw Error(l(130,s==null?s:typeof s,""))}return a=Un(R,c,a,p),a.elementType=s,a.type=h,a.lanes=_,a}function xs(s,a,c,h){return s=Un(7,s,h,a),s.lanes=c,s}function uc(s,a,c,h){return s=Un(22,s,h,a),s.elementType=x,s.lanes=c,s.stateNode={isHidden:!1},s}function c0(s,a,c){return s=Un(6,s,null,a),s.lanes=c,s}function d0(s,a,c){return a=Un(4,s.children!==null?s.children:[],s.key,a),a.lanes=c,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}function m7(s,a,c,h,p){this.tag=a,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ue,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sf(0),this.expirationTimes=sf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sf(0),this.identifierPrefix=h,this.onRecoverableError=p,Ke&&(this.mutableSourceEagerHydrationData=null)}function I2(s,a,c,h,p,_,R,b,B){return s=new m7(s,a,c,b,B),a===1?(a=1,_===!0&&(a|=8)):a=0,_=Un(3,null,null,a),s.current=_,_.stateNode=s,_.memoizedState={element:h,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},xf(_),s}function j2(s){if(!s)return gi;s=s._reactInternals;e:{if(j(s)!==s||s.tag!==1)throw Error(l(170));var a=s;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(un(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(l(171))}if(s.tag===1){var c=s.type;if(un(c))return am(s,c,a)}return a}function U2(s){var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(l(188)):(s=Object.keys(s).join(","),Error(l(268,s)));return s=K(a),s===null?null:s.stateNode}function z2(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var c=s.retryLane;s.retryLane=c!==0&&c<a?c:a}}function cc(s,a){z2(s,a),(s=s.alternate)&&z2(s,a)}function y7(s){return s=K(s),s===null?null:s.stateNode}function v7(){return null}return n.attemptContinuousHydration=function(s){if(s.tag===13){var a=_r(s,134217728);if(a!==null){var c=Kt();jn(a,s,134217728,c)}cc(s,134217728)}},n.attemptDiscreteHydration=function(s){if(s.tag===13){var a=_r(s,1);if(a!==null){var c=Kt();jn(a,s,1,c)}cc(s,1)}},n.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var a=_i(s),c=_r(s,a);if(c!==null){var h=Kt();jn(c,s,a,h)}cc(s,a)}},n.attemptSynchronousHydration=function(s){switch(s.tag){case 3:var a=s.stateNode;if(a.current.memoizedState.isDehydrated){var c=La(a.pendingLanes);c!==0&&(of(a,c|1),hn(a,Rt()),!(we&6)&&(ko(),Sr()))}break;case 13:R2(function(){var h=_r(s,1);if(h!==null){var p=Kt();jn(h,s,1,p)}}),cc(s,1)}},n.batchedUpdates=function(s,a){var c=we;we|=1;try{return s(a)}finally{we=c,we===0&&(ko(),Pu&&Sr())}},n.createComponentSelector=function(s){return{$$typeof:Yu,value:s}},n.createContainer=function(s,a,c,h,p,_,R){return I2(s,a,!1,null,c,h,p,_,R)},n.createHasPseudoClassSelector=function(s){return{$$typeof:Xu,value:s}},n.createHydrationContainer=function(s,a,c,h,p,_,R,b,B){return s=I2(c,h,!0,s,p,_,R,b,B),s.context=j2(null),c=s.current,h=Kt(),p=_i(c),_=Ur(h,p),_.callback=a??null,yi(c,_,p),s.current.lanes=p,ba(s,p,h),hn(s,h),s},n.createPortal=function(s,a,c){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:h==null?null:""+h,children:s,containerInfo:a,implementation:c}},n.createRoleSelector=function(s){return{$$typeof:$u,value:s}},n.createTestNameSelector=function(s){return{$$typeof:Ju,value:s}},n.createTextSelector=function(s){return{$$typeof:Zu,value:s}},n.deferredUpdates=function(s){var a=Fe,c=ht.transition;try{return ht.transition=null,Fe=16,s()}finally{Fe=a,ht.transition=c}},n.discreteUpdates=function(s,a,c,h,p){var _=Fe,R=ht.transition;try{return ht.transition=null,Fe=1,s(a,c,h,p)}finally{Fe=_,ht.transition=R,we===0&&ko()}},n.findAllNodes=Jf,n.findBoundingRects=function(s,a){if(!Fa)throw Error(l(363));a=Jf(s,a),s=[];for(var c=0;c<a.length;c++)s.push(G8(a[c]));for(a=s.length-1;0<a;a--){c=s[a];for(var h=c.x,p=h+c.width,_=c.y,R=_+c.height,b=a-1;0<=b;b--)if(a!==b){var B=s[b],Y=B.x,ae=Y+B.width,me=B.y,ne=me+B.height;if(h>=Y&&_>=me&&p<=ae&&R<=ne){s.splice(a,1);break}else if(h!==Y||c.width!==B.width||ne<_||me>R){if(!(_!==me||c.height!==B.height||ae<h||Y>p)){Y>h&&(B.width+=Y-h,B.x=h),ae<p&&(B.width=p-Y),s.splice(a,1);break}}else{me>_&&(B.height+=me-_,B.y=_),ne<R&&(B.height=R-me),s.splice(a,1);break}}}return s},n.findHostInstance=U2,n.findHostInstanceWithNoPortals=function(s){return s=G(s),s=s!==null?ie(s):null,s===null?null:s.stateNode},n.findHostInstanceWithWarning=function(s){return U2(s)},n.flushControlled=function(s){var a=we;we|=1;var c=ht.transition,h=Fe;try{ht.transition=null,Fe=1,s()}finally{Fe=h,ht.transition=c,we=a,we===0&&(ko(),Sr())}},n.flushPassiveEffects=_s,n.flushSync=R2,n.focusWithin=function(s,a){if(!Fa)throw Error(l(363));for(s=Yf(s),a=E2(s,a),a=Array.from(a),s=0;s<a.length;){var c=a[s++];if(!Aa(c)){if(c.tag===5&&W8(c.stateNode))return!0;for(c=c.child;c!==null;)a.push(c),c=c.sibling}}return!1},n.getCurrentUpdatePriority=function(){return Fe},n.getFindAllNodesFailureDescription=function(s,a){if(!Fa)throw Error(l(363));var c=0,h=[];s=[Yf(s),0];for(var p=0;p<s.length;){var _=s[p++],R=s[p++],b=a[R];if((_.tag!==5||!Aa(_))&&(Xf(_,b)&&(h.push($f(b)),R++,R>c&&(c=R)),R<a.length))for(_=_.child;_!==null;)s.push(_,R),_=_.sibling}if(c<a.length){for(s=[];c<a.length;c++)s.push($f(a[c]));return`findAllNodes was able to match part of the selector:
`+(h.join(" > ")+`
No matching component was found for:
`)+s.join(" > ")}return null},n.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return he(s.child.stateNode);default:return s.child.stateNode}},n.injectIntoDevTools=function(s){if(s={bundleType:s.bundleType,version:s.version,rendererPackageName:s.rendererPackageName,rendererConfig:s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:y7,findFiberByHostInstance:s.findFiberByHostInstance||v7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")s=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)s=!0;else{try{Eu=a.inject(s),vr=a}catch{}s=!!a.checkDCE}}return s},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(s,a,c,h){if(!Fa)throw Error(l(363));s=Jf(s,a);var p=K8(s,c,h).disconnect;return{disconnect:function(){p()}}},n.registerMutableSourceForHydration=function(s,a){var c=a._getVersion;c=c(a._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[a,c]:s.mutableSourceEagerHydrationData.push(a,c)},n.runWithPriority=function(s,a){var c=Fe;try{return Fe=s,a()}finally{Fe=c}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(s,a,c,h){var p=a.current,_=Kt(),R=_i(p);return c=j2(c),a.context===null?a.context=c:a.pendingContext=c,a=Ur(_,R),a.payload={element:s},h=h===void 0?null:h,h!==null&&(a.callback=h),s=yi(p,a,R),s!==null&&(jn(s,p,R,_),Lu(s,p,R)),R},n};r8.exports=HP;var VP=r8.exports;const WP=Md(VP);var i8={exports:{}},uo={};/**
* @license React
* react-reconciler-constants.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/uo.ConcurrentRoot=1;uo.ContinuousEventPriority=4;uo.DefaultEventPriority=16;uo.DiscreteEventPriority=1;uo.IdleEventPriority=536870912;uo.LegacyRoot=0;i8.exports=uo;var s8=i8.exports;const Xv={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let $v=!1,Jv=!1;const Qg=".react-konva-event",KP=`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
`,QP=`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
`,qP={};function Gh(t,e,n=qP){if(!$v&&"zIndex"in e&&(console.warn(QP),$v=!0),!Jv&&e.draggable){var r=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;r&&!i&&(console.warn(KP),Jv=!0)}for(var o in n)if(!Xv[o]){var l=o.slice(0,2)==="on",u=n[o]!==e[o];if(l&&u){var d=o.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),t.off(d,n[o])}var f=!e.hasOwnProperty(o);f&&t.setAttr(o,void 0)}var g=e._useStrictMode,v={},S=!1;const w={};for(var o in e)if(!Xv[o]){var l=o.slice(0,2)==="on",y=n[o]!==e[o];if(l&&y){var d=o.substr(2).toLowerCase();d.substr(0,7)==="content"&&(d="content"+d.substr(7,1).toUpperCase()+d.substr(8)),e[o]&&(w[d]=e[o])}!l&&(e[o]!==n[o]||g&&e[o]!==t.getAttr(o))&&(S=!0,v[o]=e[o])}S&&(t.setAttrs(v),ds(t));for(var d in w)t.on(d+Qg,w[d])}function ds(t){if(!xe.Konva.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}const o8={},YP={};Xl.Node.prototype._applyProps=Gh;function XP(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),ds(t)}function $P(t,e,n){let r=Xl[t];r||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" 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`),r=Xl.Group);const i={},o={};for(var l in e){var u=l.slice(0,2)==="on";u?o[l]=e[l]:i[l]=e[l]}const d=new r(i);return Gh(d,o),d}function JP(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function ZP(t,e,n){return!1}function eN(t){return t}function tN(){return null}function nN(){return null}function rN(t,e,n,r){return YP}function iN(){}function sN(t){}function oN(t,e){return!1}function aN(){return o8}function lN(){return o8}const uN=setTimeout,cN=clearTimeout,dN=-1;function hN(t,e){return!1}const fN=!1,pN=!0,gN=!0;function mN(t,e){e.parent===t?e.moveToTop():t.add(e),ds(t)}function yN(t,e){e.parent===t?e.moveToTop():t.add(e),ds(t)}function a8(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),ds(t)}function vN(t,e,n){a8(t,e,n)}function SN(t,e){e.destroy(),e.off(Qg),ds(t)}function _N(t,e){e.destroy(),e.off(Qg),ds(t)}function xN(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function wN(t,e,n){}function CN(t,e,n,r,i){Gh(t,i,r)}function kN(t){t.hide(),ds(t)}function EN(t){}function PN(t,e){(e.visible==null||e.visible)&&t.show()}function NN(t,e){}function RN(t){}function TN(){}const ON=()=>s8.DefaultEventPriority,FN=Object.freeze(Object.defineProperty({__proto__:null,appendChild:mN,appendChildToContainer:yN,appendInitialChild:XP,cancelTimeout:cN,clearContainer:RN,commitMount:wN,commitTextUpdate:xN,commitUpdate:CN,createInstance:$P,createTextInstance:JP,detachDeletedInstance:TN,finalizeInitialChildren:ZP,getChildHostContext:lN,getCurrentEventPriority:ON,getPublicInstance:eN,getRootHostContext:aN,hideInstance:kN,hideTextInstance:EN,idlePriority:yl.unstable_IdlePriority,insertBefore:a8,insertInContainerBefore:vN,isPrimaryRenderer:fN,noTimeout:dN,now:yl.unstable_now,prepareForCommit:tN,preparePortalMount:nN,prepareUpdate:rN,removeChild:SN,removeChildFromContainer:_N,resetAfterCommit:iN,resetTextContent:sN,run:yl.unstable_runWithPriority,scheduleTimeout:uN,shouldDeprioritizeSubtree:oN,shouldSetTextContent:hN,supportsMutation:gN,unhideInstance:PN,unhideTextInstance:NN,warnsIfNotActing:pN},Symbol.toStringTag,{value:"Module"}));var AN=Object.defineProperty,MN=Object.defineProperties,LN=Object.getOwnPropertyDescriptors,Zv=Object.getOwnPropertySymbols,bN=Object.prototype.hasOwnProperty,DN=Object.prototype.propertyIsEnumerable,e4=(t,e,n)=>e in t?AN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,t4=(t,e)=>{for(var n in e||(e={}))bN.call(e,n)&&e4(t,n,e[n]);if(Zv)for(var n of Zv(e))DN.call(e,n)&&e4(t,n,e[n]);return t},IN=(t,e)=>MN(t,LN(e)),n4,r4;typeof window<"u"&&((n4=window.document)!=null&&n4.createElement||((r4=window.navigator)==null?void 0:r4.product)==="ReactNative")?W.useLayoutEffect:W.useEffect;function l8(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=t.child;for(;r;){const i=l8(r,e,n);if(i)return i;r=r.sibling}}function u8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const i4=console.error;console.error=function(){const t=[...arguments].join("");if(t!=null&&t.startsWith("Warning:")&&t.includes("useContext")){console.error=i4;return}return i4.apply(this,arguments)};const qg=u8(W.createContext(null));class c8 extends W.Component{render(){return W.createElement(qg.Provider,{value:this._reactInternals},this.props.children)}}function jN(){const t=W.useContext(qg);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=W.useId();return W.useMemo(()=>{for(const r of[t,t==null?void 0:t.alternate]){if(!r)continue;const i=l8(r,!1,o=>{let l=o.memoizedState;for(;l;){if(l.memoizedState===e)return!0;l=l.next}});if(i)return i}},[t,e])}function UN(){const t=jN(),[e]=W.useState(()=>new Map);e.clear();let n=t;for(;n;){if(n.type&&typeof n.type=="object"){const i=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;i&&i!==qg&&!e.has(i)&&e.set(i,W.useContext(u8(i)))}n=n.return}return e}function zN(){const t=UN();return W.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>W.createElement(e,null,W.createElement(n.Provider,IN(t4({},r),{value:t.get(n)}))),e=>W.createElement(c8,t4({},e))),[t])}function BN(t){const e=Mt.useRef({});return Mt.useLayoutEffect(()=>{e.current=t}),Mt.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const GN=t=>{const e=Mt.useRef(null),n=Mt.useRef(null),r=Mt.useRef(null),i=BN(t),o=zN(),l=u=>{const{forwardedRef:d}=t;d&&(typeof d=="function"?d(u):d.current=u)};return Mt.useLayoutEffect(()=>(n.current=new Xl.Stage({width:t.width,height:t.height,container:e.current}),l(n.current),r.current=ml.createContainer(n.current,s8.LegacyRoot,!1,null),ml.updateContainer(Mt.createElement(o,{},t.children),r.current),()=>{Xl.isBrowser&&(l(null),ml.updateContainer(null,r.current,null),n.current.destroy())}),[]),Mt.useLayoutEffect(()=>{l(n.current),Gh(n.current,t,i),ml.updateContainer(Mt.createElement(o,{},t.children),r.current,null)}),Mt.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},HN="Layer",s4="Rect",VN="Text",WN="Transformer",ml=WP(FN);ml.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Mt.version,rendererPackageName:"react-konva"});const KN=Mt.forwardRef((t,e)=>Mt.createElement(c8,{},Mt.createElement(GN,{...t,forwardedRef:e}))),QN={},o4=t=>{let e;const n=new Set,r=(g,v)=>{const S=typeof g=="function"?g(e):g;if(!Object.is(S,e)){const w=e;e=v??(typeof S!="object"||S===null)?S:Object.assign({},e,S),n.forEach(y=>y(e,w))}},i=()=>e,d={setState:r,getState:i,getInitialState:()=>f,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(QN?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=e=t(r,i,d);return d},qN=t=>t?o4(t):o4;var d8={exports:{}},h8={},f8={exports:{}},p8={};/**
* @license React
* use-sync-external-store-shim.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 ma=W;function YN(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var XN=typeof Object.is=="function"?Object.is:YN,$N=ma.useState,JN=ma.useEffect,ZN=ma.useLayoutEffect,eR=ma.useDebugValue;function tR(t,e){var n=e(),r=$N({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return ZN(function(){i.value=n,i.getSnapshot=e,$0(i)&&o({inst:i})},[t,n,e]),JN(function(){return $0(i)&&o({inst:i}),t(function(){$0(i)&&o({inst:i})})},[t]),eR(n),n}function $0(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!XN(t,n)}catch{return!0}}function nR(t,e){return e()}var rR=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?nR:tR;p8.useSyncExternalStore=ma.useSyncExternalStore!==void 0?ma.useSyncExternalStore:rR;f8.exports=p8;var iR=f8.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.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 Hh=W,sR=iR;function oR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var aR=typeof Object.is=="function"?Object.is:oR,lR=sR.useSyncExternalStore,uR=Hh.useRef,cR=Hh.useEffect,dR=Hh.useMemo,hR=Hh.useDebugValue;h8.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=uR(null);if(o.current===null){var l={hasValue:!1,value:null};o.current=l}else l=o.current;o=dR(function(){function d(w){if(!f){if(f=!0,g=w,w=r(w),i!==void 0&&l.hasValue){var y=l.value;if(i(y,w))return v=y}return v=w}if(y=v,aR(g,w))return y;var E=r(w);return i!==void 0&&i(y,E)?(g=w,y):(g=w,v=E)}var f=!1,g,v,S=n===void 0?null:n;return[function(){return d(e())},S===null?void 0:function(){return d(S())}]},[e,n,r,i]);var u=lR(t,o[0],o[1]);return cR(function(){l.hasValue=!0,l.value=u},[u]),hR(u),u};d8.exports=h8;var fR=d8.exports;const pR=Md(fR),g8={},{useDebugValue:gR}=Mt,{useSyncExternalStoreWithSelector:mR}=pR;let a4=!1;const yR=t=>t;function vR(t,e=yR,n){(g8?"production":void 0)!=="production"&&n&&!a4&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),a4=!0);const r=mR(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return gR(r),r}const l4=t=>{(g8?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?qN(t):t,n=(r,i)=>vR(e,r,i);return Object.assign(n,e),n},m8=t=>t?l4(t):l4,y8=m8(t=>({covers:[],activeCover:null,selectedLayer:null,addCover:e=>t(n=>({covers:[e,...n.covers],activeCover:e})),updateCover:(e,n)=>t(r=>{var i;return{covers:r.covers.map(o=>o.id===e?{...o,...n,updatedAt:new Date}:o),activeCover:((i=r.activeCover)==null?void 0:i.id)===e?{...r.activeCover,...n,updatedAt:new Date}:r.activeCover}}),deleteCover:e=>t(n=>{var r;return{covers:n.covers.filter(i=>i.id!==e),activeCover:((r=n.activeCover)==null?void 0:r.id)===e?null:n.activeCover}}),setActiveCover:e=>t({activeCover:e,selectedLayer:null}),setSelectedLayer:e=>t({selectedLayer:e}),addLayer:e=>t(n=>{if(!n.activeCover)return n;const r={...n.activeCover,layers:[...n.activeCover.layers,e],updatedAt:new Date};return{activeCover:r,covers:n.covers.map(i=>i.id===n.activeCover.id?r:i)}}),updateLayer:(e,n)=>t(r=>{if(!r.activeCover)return r;const i={...r.activeCover,layers:r.activeCover.layers.map(o=>o.id===e?{...o,...n}:o),updatedAt:new Date};return{activeCover:i,covers:r.covers.map(o=>o.id===r.activeCover.id?i:o)}}),deleteLayer:e=>t(n=>{if(!n.activeCover)return n;const r={...n.activeCover,layers:n.activeCover.layers.filter(i=>i.id!==e),updatedAt:new Date};return{activeCover:r,covers:n.covers.map(i=>i.id===n.activeCover.id?r:i),selectedLayer:n.selectedLayer===e?null:n.selectedLayer}})}));function SR(){const{activeCover:t,addLayer:e,deleteLayer:n,selectedLayer:r,setSelectedLayer:i}=y8(),o=W.useRef(null),[l,u]=W.useState(.5),[d,f]=W.useState("title"),[g,v]=W.useState("");if(!t)return N.jsx("div",{className:"card text-center py-12",children:N.jsx("p",{className:"text-gray-500",children:"Select a cover from the gallery to edit"})});const S=()=>{if(!g.trim())return;const C={id:`text-${Date.now()}`,type:"text",x:t.width/2,y:t.height/2,content:g,fontSize:d==="title"?72:36,fontFamily:d==="title"?"Georgia":"Arial",fill:d==="title"?"#ffffff":"#f0f0f0",rotation:0,opacity:1};e(C),v("")},w=()=>{const C=o.current;if(C){const P=C.toDataURL({pixelRatio:2}),k=document.createElement("a");k.download=`${t.title.replace(/\s+/g,"-")}-cover.png`,k.href=P,k.click()}},y=800,E=t.height/t.width*y;return N.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[N.jsxs("div",{className:"lg:col-span-3 card p-4 bg-gray-100",children:[N.jsxs("div",{className:"flex items-center justify-between mb-4",children:[N.jsxs("h3",{className:"font-semibold text-gray-900",children:["Editing: ",t.title]}),N.jsx("div",{className:"flex items-center gap-2",children:N.jsxs("button",{onClick:w,className:"btn-primary flex items-center gap-2",children:[N.jsx(_6,{className:"w-4 h-4"}),"Export"]})})]}),N.jsx("div",{className:"bg-white rounded-lg shadow-sm overflow-hidden flex items-center justify-center p-4",children:N.jsx(KN,{ref:o,width:y,height:E,scaleX:l,scaleY:l,children:N.jsxs(HN,{children:[N.jsx(s4,{x:0,y:0,width:t.width,height:t.height,fill:t.backgroundColor}),t.backgroundImage&&N.jsx(s4,{x:0,y:0,width:t.width,height:t.height,opacity:.3}),t.layers.map(C=>N.jsx(VN,{id:C.id,x:C.x,y:C.y,text:C.content,fontSize:C.fontSize,fontFamily:C.fontFamily,fill:C.fill,rotation:C.rotation,opacity:C.opacity,draggable:!0,onClick:()=>i(C.id),onTap:()=>i(C.id)},C.id)),r&&N.jsx(WN,{nodes:t.layers.filter(C=>C.id===r).map(C=>document.getElementById(C.id))})]})})}),N.jsxs("div",{className:"mt-4 flex items-center justify-center gap-4",children:[N.jsx("button",{onClick:()=>u(Math.max(.2,l-.1)),className:"btn-secondary px-3",children:"-"}),N.jsxs("span",{className:"text-sm text-gray-600",children:[Math.round(l*100),"%"]}),N.jsx("button",{onClick:()=>u(Math.min(1,l+.1)),className:"btn-secondary px-3",children:"+"})]})]}),N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"card",children:[N.jsxs("h4",{className:"font-medium text-gray-900 mb-4 flex items-center gap-2",children:[N.jsx(h1,{className:"w-4 h-4"}),"Add Text"]}),N.jsxs("div",{className:"space-y-3",children:[N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Text Type"}),N.jsxs("div",{className:"flex gap-2",children:[N.jsx("button",{onClick:()=>f("title"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition-colors ${d==="title"?"bg-primary-100 text-primary-700":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:"Title"}),N.jsx("button",{onClick:()=>f("author"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition-colors ${d==="author"?"bg-primary-100 text-primary-700":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:"Author"})]})]}),N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Text Content"}),N.jsx("input",{type:"text",value:g,onChange:C=>v(C.target.value),placeholder:d==="title"?"Book Title":"Author Name",className:"input",onKeyPress:C=>C.key==="Enter"&&S()})]}),N.jsx("button",{onClick:S,disabled:!g.trim(),className:"btn-primary w-full",children:"Add Text Layer"})]})]}),N.jsxs("div",{className:"card",children:[N.jsx("h4",{className:"font-medium text-gray-900 mb-4",children:"Layers"}),t.layers.length===0?N.jsx("p",{className:"text-sm text-gray-500",children:"No layers yet"}):N.jsx("div",{className:"space-y-2",children:t.layers.map((C,P)=>{var k;return N.jsxs("div",{className:`flex items-center justify-between p-2 rounded-lg border cursor-pointer transition-colors ${r===C.id?"border-primary-500 bg-primary-50":"border-gray-200 hover:bg-gray-50"}`,onClick:()=>i(C.id),children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(h1,{className:"w-4 h-4 text-gray-400"}),N.jsx("span",{className:"text-sm truncate max-w-[150px]",children:((k=C.content)==null?void 0:k.substring(0,20))||`Layer ${P+1}`})]}),N.jsx("button",{onClick:m=>{m.stopPropagation(),n(C.id)},className:"p-1 hover:bg-red-100 rounded",children:N.jsx("svg",{className:"w-4 h-4 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:N.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},C.id)})})]}),N.jsxs("div",{className:"card",children:[N.jsx("h4",{className:"font-medium text-gray-900 mb-4",children:"Cover Info"}),N.jsxs("div",{className:"space-y-2 text-sm",children:[N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-gray-500",children:"Dimensions"}),N.jsxs("span",{className:"text-gray-900",children:[t.width," x ",t.height]})]}),N.jsxs("div",{className:"flex justify-between",children:[N.jsx("span",{className:"text-gray-500",children:"Layers"}),N.jsx("span",{className:"text-gray-900",children:t.layers.length})]})]})]})]})]})}function v8(t,e){return function(){return t.apply(e,arguments)}}const{toString:_R}=Object.prototype,{getPrototypeOf:Yg}=Object,{iterator:Vh,toStringTag:S8}=Symbol,Wh=(t=>e=>{const n=_R.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),mr=t=>(t=t.toLowerCase(),e=>Wh(e)===t),Kh=t=>e=>typeof e===t,{isArray:Oa}=Array,ya=Kh("undefined");function pu(t){return t!==null&&!ya(t)&&t.constructor!==null&&!ya(t.constructor)&&xn(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const _8=mr("ArrayBuffer");function xR(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&_8(t.buffer),e}const wR=Kh("string"),xn=Kh("function"),x8=Kh("number"),gu=t=>t!==null&&typeof t=="object",CR=t=>t===!0||t===!1,$c=t=>{if(Wh(t)!=="object")return!1;const e=Yg(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(S8 in t)&&!(Vh in t)},kR=t=>{if(!gu(t)||pu(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},ER=mr("Date"),PR=mr("File"),NR=t=>!!(t&&typeof t.uri<"u"),RR=t=>t&&typeof t.getParts<"u",TR=mr("Blob"),OR=mr("FileList"),FR=t=>gu(t)&&xn(t.pipe);function AR(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const u4=AR(),c4=typeof u4.FormData<"u"?u4.FormData:void 0,MR=t=>{let e;return t&&(c4&&t instanceof c4||xn(t.append)&&((e=Wh(t))==="formdata"||e==="object"&&xn(t.toString)&&t.toString()==="[object FormData]"))},LR=mr("URLSearchParams"),[bR,DR,IR,jR]=["ReadableStream","Request","Response","Headers"].map(mr),UR=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mu(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,i;if(typeof t!="object"&&(t=[t]),Oa(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{if(pu(t))return;const o=n?Object.getOwnPropertyNames(t):Object.keys(t),l=o.length;let u;for(r=0;r<l;r++)u=o[r],e.call(null,t[u],u,t)}}function w8(t,e){if(pu(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,i;for(;r-- >0;)if(i=n[r],e===i.toLowerCase())return i;return null}const Os=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,C8=t=>!ya(t)&&t!==Os;function C1(){const{caseless:t,skipUndefined:e}=C8(this)&&this||{},n={},r=(i,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const l=t&&w8(n,o)||o;$c(n[l])&&$c(i)?n[l]=C1(n[l],i):$c(i)?n[l]=C1({},i):Oa(i)?n[l]=i.slice():(!e||!ya(i))&&(n[l]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&mu(arguments[i],r);return n}const zR=(t,e,n,{allOwnKeys:r}={})=>(mu(e,(i,o)=>{n&&xn(i)?Object.defineProperty(t,o,{value:v8(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),BR=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),GR=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},HR=(t,e,n,r)=>{let i,o,l;const u={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)l=i[o],(!r||r(l,t,e))&&!u[l]&&(e[l]=t[l],u[l]=!0);t=n!==!1&&Yg(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},VR=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},WR=t=>{if(!t)return null;if(Oa(t))return t;let e=t.length;if(!x8(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},KR=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Yg(Uint8Array)),QR=(t,e)=>{const r=(t&&t[Vh]).call(t);let i;for(;(i=r.next())&&!i.done;){const o=i.value;e.call(t,o[0],o[1])}},qR=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},YR=mr("HTMLFormElement"),XR=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),d4=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),$R=mr("RegExp"),k8=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};mu(n,(i,o)=>{let l;(l=e(i,o,t))!==!1&&(r[o]=l||i)}),Object.defineProperties(t,r)},JR=t=>{k8(t,(e,n)=>{if(xn(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(xn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},ZR=(t,e)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Oa(t)?r(t):r(String(t).split(e)),n},eT=()=>{},tT=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function nT(t){return!!(t&&xn(t.append)&&t[S8]==="FormData"&&t[Vh])}const rT=t=>{const e=new Array(10),n=(r,i)=>{if(gu(r)){if(e.indexOf(r)>=0)return;if(pu(r))return r;if(!("toJSON"in r)){e[i]=r;const o=Oa(r)?[]:{};return mu(r,(l,u)=>{const d=n(l,i+1);!ya(d)&&(o[u]=d)}),e[i]=void 0,o}}return r};return n(t,0)},iT=mr("AsyncFunction"),sT=t=>t&&(gu(t)||xn(t))&&xn(t.then)&&xn(t.catch),E8=((t,e)=>t?setImmediate:e?((n,r)=>(Os.addEventListener("message",({source:i,data:o})=>{i===Os&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Os.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",xn(Os.postMessage)),oT=typeof queueMicrotask<"u"?queueMicrotask.bind(Os):typeof process<"u"&&process.nextTick||E8,aT=t=>t!=null&&xn(t[Vh]),z={isArray:Oa,isArrayBuffer:_8,isBuffer:pu,isFormData:MR,isArrayBufferView:xR,isString:wR,isNumber:x8,isBoolean:CR,isObject:gu,isPlainObject:$c,isEmptyObject:kR,isReadableStream:bR,isRequest:DR,isResponse:IR,isHeaders:jR,isUndefined:ya,isDate:ER,isFile:PR,isReactNativeBlob:NR,isReactNative:RR,isBlob:TR,isRegExp:$R,isFunction:xn,isStream:FR,isURLSearchParams:LR,isTypedArray:KR,isFileList:OR,forEach:mu,merge:C1,extend:zR,trim:UR,stripBOM:BR,inherits:GR,toFlatObject:HR,kindOf:Wh,kindOfTest:mr,endsWith:VR,toArray:WR,forEachEntry:QR,matchAll:qR,isHTMLForm:YR,hasOwnProperty:d4,hasOwnProp:d4,reduceDescriptors:k8,freezeMethods:JR,toObjectSet:ZR,toCamelCase:XR,noop:eT,toFiniteNumber:tT,findKey:w8,global:Os,isContextDefined:C8,isSpecCompliantForm:nT,toJSONObject:rT,isAsyncFn:iT,isThenable:sT,setImmediate:E8,asap:oT,isIterable:aT};let fe=class P8 extends Error{static from(e,n,r,i,o,l){const u=new P8(e.message,n||e.code,r,i,o);return u.cause=e,u.name=e.name,e.status!=null&&u.status==null&&(u.status=e.status),l&&Object.assign(u,l),u}constructor(e,n,r,i,o){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),i&&(this.request=i),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.status}}};fe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";fe.ERR_BAD_OPTION="ERR_BAD_OPTION";fe.ECONNABORTED="ECONNABORTED";fe.ETIMEDOUT="ETIMEDOUT";fe.ERR_NETWORK="ERR_NETWORK";fe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";fe.ERR_DEPRECATED="ERR_DEPRECATED";fe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";fe.ERR_BAD_REQUEST="ERR_BAD_REQUEST";fe.ERR_CANCELED="ERR_CANCELED";fe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";fe.ERR_INVALID_URL="ERR_INVALID_URL";const lT=null;function k1(t){return z.isPlainObject(t)||z.isArray(t)}function N8(t){return z.endsWith(t,"[]")?t.slice(0,-2):t}function J0(t,e,n){return t?t.concat(e).map(function(i,o){return i=N8(i),!n&&o?"["+i+"]":i}).join(n?".":""):e}function uT(t){return z.isArray(t)&&!t.some(k1)}const cT=z.toFlatObject(z,{},null,function(e){return/^is[A-Z]/.test(e)});function Qh(t,e,n){if(!z.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,C){return!z.isUndefined(C[E])});const r=n.metaTokens,i=n.visitor||g,o=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&z.isSpecCompliantForm(e);if(!z.isFunction(i))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(z.isDate(y))return y.toISOString();if(z.isBoolean(y))return y.toString();if(!d&&z.isBlob(y))throw new fe("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(y)||z.isTypedArray(y)?d&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function g(y,E,C){let P=y;if(z.isReactNative(e)&&z.isReactNativeBlob(y))return e.append(J0(C,E,o),f(y)),!1;if(y&&!C&&typeof y=="object"){if(z.endsWith(E,"{}"))E=r?E:E.slice(0,-2),y=JSON.stringify(y);else if(z.isArray(y)&&uT(y)||(z.isFileList(y)||z.endsWith(E,"[]"))&&(P=z.toArray(y)))return E=N8(E),P.forEach(function(m,x){!(z.isUndefined(m)||m===null)&&e.append(l===!0?J0([E],x,o):l===null?E:E+"[]",f(m))}),!1}return k1(y)?!0:(e.append(J0(C,E,o),f(y)),!1)}const v=[],S=Object.assign(cT,{defaultVisitor:g,convertValue:f,isVisitable:k1});function w(y,E){if(!z.isUndefined(y)){if(v.indexOf(y)!==-1)throw Error("Circular reference detected in "+E.join("."));v.push(y),z.forEach(y,function(P,k){(!(z.isUndefined(P)||P===null)&&i.call(e,P,z.isString(k)?k.trim():k,E,S))===!0&&w(P,E?E.concat(k):[k])}),v.pop()}}if(!z.isObject(t))throw new TypeError("data must be an object");return w(t),e}function h4(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Xg(t,e){this._pairs=[],t&&Qh(t,this,e)}const R8=Xg.prototype;R8.append=function(e,n){this._pairs.push([e,n])};R8.toString=function(e){const n=e?function(r){return e.call(this,r,h4)}:h4;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function dT(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function T8(t,e,n){if(!e)return t;const r=n&&n.encode||dT,i=z.isFunction(n)?{serialize:n}:n,o=i&&i.serialize;let l;if(o?l=o(e,i):l=z.isURLSearchParams(e)?e.toString():new Xg(e,i).toString(r),l){const u=t.indexOf("#");u!==-1&&(t=t.slice(0,u)),t+=(t.indexOf("?")===-1?"?":"&")+l}return t}class f4{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){z.forEach(this.handlers,function(r){r!==null&&e(r)})}}const $g={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},hT=typeof URLSearchParams<"u"?URLSearchParams:Xg,fT=typeof FormData<"u"?FormData:null,pT=typeof Blob<"u"?Blob:null,gT={isBrowser:!0,classes:{URLSearchParams:hT,FormData:fT,Blob:pT},protocols:["http","https","file","blob","url","data"]},Jg=typeof window<"u"&&typeof document<"u",E1=typeof navigator=="object"&&navigator||void 0,mT=Jg&&(!E1||["ReactNative","NativeScript","NS"].indexOf(E1.product)<0),yT=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vT=Jg&&window.location.href||"http://localhost",ST=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Jg,hasStandardBrowserEnv:mT,hasStandardBrowserWebWorkerEnv:yT,navigator:E1,origin:vT},Symbol.toStringTag,{value:"Module"})),$t={...ST,...gT};function _T(t,e){return Qh(t,new $t.classes.URLSearchParams,{visitor:function(n,r,i,o){return $t.isNode&&z.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function xT(t){return z.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function wT(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],e[o]=t[o];return e}function O8(t){function e(n,r,i,o){let l=n[o++];if(l==="__proto__")return!0;const u=Number.isFinite(+l),d=o>=n.length;return l=!l&&z.isArray(i)?i.length:l,d?(z.hasOwnProp(i,l)?i[l]=[i[l],r]:i[l]=r,!u):((!i[l]||!z.isObject(i[l]))&&(i[l]=[]),e(n,r,i[l],o)&&z.isArray(i[l])&&(i[l]=wT(i[l])),!u)}if(z.isFormData(t)&&z.isFunction(t.entries)){const n={};return z.forEachEntry(t,(r,i)=>{e(xT(r),i,n,0)}),n}return null}function CT(t,e,n){if(z.isString(t))try{return(e||JSON.parse)(t),z.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const yu={transitional:$g,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=z.isObject(e);if(o&&z.isHTMLForm(e)&&(e=new FormData(e)),z.isFormData(e))return i?JSON.stringify(O8(e)):e;if(z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)||z.isReadableStream(e))return e;if(z.isArrayBufferView(e))return e.buffer;if(z.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return _T(e,this.formSerializer).toString();if((u=z.isFileList(e))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Qh(u?{"files[]":e}:e,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),CT(e)):e}],transformResponse:[function(e){const n=this.transitional||yu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(z.isResponse(e)||z.isReadableStream(e))return e;if(e&&z.isString(e)&&(r&&!this.responseType||i)){const l=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?fe.from(u,fe.ERR_BAD_RESPONSE,this,null,this.response):u}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$t.classes.FormData,Blob:$t.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],t=>{yu.headers[t]={}});const kT=z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ET=t=>{const e={};let n,r,i;return t&&t.split(`
`).forEach(function(l){i=l.indexOf(":"),n=l.substring(0,i).trim().toLowerCase(),r=l.substring(i+1).trim(),!(!n||e[n]&&kT[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},p4=Symbol("internals");function ul(t){return t&&String(t).trim().toLowerCase()}function Jc(t){return t===!1||t==null?t:z.isArray(t)?t.map(Jc):String(t).replace(/[\r\n]+$/,"")}function PT(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const NT=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Z0(t,e,n,r,i){if(z.isFunction(r))return r.call(this,e,n);if(i&&(e=n),!!z.isString(e)){if(z.isString(r))return e.indexOf(r)!==-1;if(z.isRegExp(r))return r.test(e)}}function RT(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function TT(t,e){const n=z.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(i,o,l){return this[r].call(this,e,i,o,l)},configurable:!0})})}let wn=class{constructor(e){e&&this.set(e)}set(e,n,r){const i=this;function o(u,d,f){const g=ul(d);if(!g)throw new Error("header name must be a non-empty string");const v=z.findKey(i,g);(!v||i[v]===void 0||f===!0||f===void 0&&i[v]!==!1)&&(i[v||d]=Jc(u))}const l=(u,d)=>z.forEach(u,(f,g)=>o(f,g,d));if(z.isPlainObject(e)||e instanceof this.constructor)l(e,n);else if(z.isString(e)&&(e=e.trim())&&!NT(e))l(ET(e),n);else if(z.isObject(e)&&z.isIterable(e)){let u={},d,f;for(const g of e){if(!z.isArray(g))throw TypeError("Object iterator must return a key-value pair");u[f=g[0]]=(d=u[f])?z.isArray(d)?[...d,g[1]]:[d,g[1]]:g[1]}l(u,n)}else e!=null&&o(n,e,r);return this}get(e,n){if(e=ul(e),e){const r=z.findKey(this,e);if(r){const i=this[r];if(!n)return i;if(n===!0)return PT(i);if(z.isFunction(n))return n.call(this,i,r);if(z.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=ul(e),e){const r=z.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||Z0(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let i=!1;function o(l){if(l=ul(l),l){const u=z.findKey(r,l);u&&(!n||Z0(r,r[u],u,n))&&(delete r[u],i=!0)}}return z.isArray(e)?e.forEach(o):o(e),i}clear(e){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!e||Z0(this,this[o],o,e,!0))&&(delete this[o],i=!0)}return i}normalize(e){const n=this,r={};return z.forEach(this,(i,o)=>{const l=z.findKey(r,o);if(l){n[l]=Jc(i),delete n[o];return}const u=e?RT(o):String(o).trim();u!==o&&delete n[o],n[u]=Jc(i),r[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return z.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=e&&z.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[p4]=this[p4]={accessors:{}}).accessors,i=this.prototype;function o(l){const u=ul(l);r[u]||(TT(i,l),r[u]=!0)}return z.isArray(e)?e.forEach(o):o(e),this}};wn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);z.reduceDescriptors(wn.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});z.freezeMethods(wn);function ep(t,e){const n=this||yu,r=e||n,i=wn.from(r.headers);let o=r.data;return z.forEach(t,function(u){o=u.call(n,o,i.normalize(),e?e.status:void 0)}),i.normalize(),o}function F8(t){return!!(t&&t.__CANCEL__)}let vu=class extends fe{constructor(e,n,r){super(e??"canceled",fe.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function A8(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new fe("Request failed with status code "+n.status,[fe.ERR_BAD_REQUEST,fe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function OT(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function FT(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,o=0,l;return e=e!==void 0?e:1e3,function(d){const f=Date.now(),g=r[o];l||(l=f),n[i]=d,r[i]=f;let v=o,S=0;for(;v!==i;)S+=n[v++],v=v%t;if(i=(i+1)%t,i===o&&(o=(o+1)%t),f-l<e)return;const w=g&&f-g;return w?Math.round(S*1e3/w):void 0}}function AT(t,e){let n=0,r=1e3/e,i,o;const l=(f,g=Date.now())=>{n=g,i=null,o&&(clearTimeout(o),o=null),t(...f)};return[(...f)=>{const g=Date.now(),v=g-n;v>=r?l(f,g):(i=f,o||(o=setTimeout(()=>{o=null,l(i)},r-v)))},()=>i&&l(i)]}const Ad=(t,e,n=3)=>{let r=0;const i=FT(50,250);return AT(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,d=l-r,f=i(d),g=l<=u;r=l;const v={loaded:l,total:u,progress:u?l/u:void 0,bytes:d,rate:f||void 0,estimated:f&&u&&g?(u-l)/f:void 0,event:o,lengthComputable:u!=null,[e?"download":"upload"]:!0};t(v)},n)},g4=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},m4=t=>(...e)=>z.asap(()=>t(...e)),MT=$t.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,$t.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL($t.origin),$t.navigator&&/(msie|trident)/i.test($t.navigator.userAgent)):()=>!0,LT=$t.hasStandardBrowserEnv?{write(t,e,n,r,i,o,l){if(typeof document>"u")return;const u=[`${t}=${encodeURIComponent(e)}`];z.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),z.isString(r)&&u.push(`path=${r}`),z.isString(i)&&u.push(`domain=${i}`),o===!0&&u.push("secure"),z.isString(l)&&u.push(`SameSite=${l}`),document.cookie=u.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function bT(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function DT(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function M8(t,e,n){let r=!bT(e);return t&&(r||n==!1)?DT(t,e):e}const y4=t=>t instanceof wn?{...t}:t;function $s(t,e){e=e||{};const n={};function r(f,g,v,S){return z.isPlainObject(f)&&z.isPlainObject(g)?z.merge.call({caseless:S},f,g):z.isPlainObject(g)?z.merge({},g):z.isArray(g)?g.slice():g}function i(f,g,v,S){if(z.isUndefined(g)){if(!z.isUndefined(f))return r(void 0,f,v,S)}else return r(f,g,v,S)}function o(f,g){if(!z.isUndefined(g))return r(void 0,g)}function l(f,g){if(z.isUndefined(g)){if(!z.isUndefined(f))return r(void 0,f)}else return r(void 0,g)}function u(f,g,v){if(v in e)return r(f,g);if(v in t)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(f,g,v)=>i(y4(f),y4(g),v,!0)};return z.forEach(Object.keys({...t,...e}),function(g){if(g==="__proto__"||g==="constructor"||g==="prototype")return;const v=z.hasOwnProp(d,g)?d[g]:i,S=v(t[g],e[g],g);z.isUndefined(S)&&v!==u||(n[g]=S)}),n}const L8=t=>{const e=$s({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:l,auth:u}=e;if(e.headers=l=wn.from(l),e.url=T8(M8(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),z.isFormData(n)){if($t.hasStandardBrowserEnv||$t.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(z.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([g,v])=>{f.includes(g.toLowerCase())&&l.set(g,v)})}}if($t.hasStandardBrowserEnv&&(r&&z.isFunction(r)&&(r=r(e)),r||r!==!1&&MT(e.url))){const d=i&&o&&LT.read(o);d&&l.set(i,d)}return e},IT=typeof XMLHttpRequest<"u",jT=IT&&function(t){return new Promise(function(n,r){const i=L8(t);let o=i.data;const l=wn.from(i.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:f}=i,g,v,S,w,y;function E(){w&&w(),y&&y(),i.cancelToken&&i.cancelToken.unsubscribe(g),i.signal&&i.signal.removeEventListener("abort",g)}let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function P(){if(!C)return;const m=wn.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),T={data:!u||u==="text"||u==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:m,config:t,request:C};A8(function(L){n(L),E()},function(L){r(L),E()},T),C=null}"onloadend"in C?C.onloadend=P:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(P)},C.onabort=function(){C&&(r(new fe("Request aborted",fe.ECONNABORTED,t,C)),C=null)},C.onerror=function(x){const T=x&&x.message?x.message:"Network Error",F=new fe(T,fe.ERR_NETWORK,t,C);F.event=x||null,r(F),C=null},C.ontimeout=function(){let x=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const T=i.transitional||$g;i.timeoutErrorMessage&&(x=i.timeoutErrorMessage),r(new fe(x,T.clarifyTimeoutError?fe.ETIMEDOUT:fe.ECONNABORTED,t,C)),C=null},o===void 0&&l.setContentType(null),"setRequestHeader"in C&&z.forEach(l.toJSON(),function(x,T){C.setRequestHeader(T,x)}),z.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),u&&u!=="json"&&(C.responseType=i.responseType),f&&([S,y]=Ad(f,!0),C.addEventListener("progress",S)),d&&C.upload&&([v,w]=Ad(d),C.upload.addEventListener("progress",v),C.upload.addEventListener("loadend",w)),(i.cancelToken||i.signal)&&(g=m=>{C&&(r(!m||m.type?new vu(null,t,C):m),C.abort(),C=null)},i.cancelToken&&i.cancelToken.subscribe(g),i.signal&&(i.signal.aborted?g():i.signal.addEventListener("abort",g)));const k=OT(i.url);if(k&&$t.protocols.indexOf(k)===-1){r(new fe("Unsupported protocol "+k+":",fe.ERR_BAD_REQUEST,t));return}C.send(o||null)})},UT=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,i;const o=function(f){if(!i){i=!0,u();const g=f instanceof Error?f:this.reason;r.abort(g instanceof fe?g:new vu(g instanceof Error?g.message:g))}};let l=e&&setTimeout(()=>{l=null,o(new fe(`timeout of ${e}ms exceeded`,fe.ETIMEDOUT))},e);const u=()=>{t&&(l&&clearTimeout(l),l=null,t.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),t=null)};t.forEach(f=>f.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>z.asap(u),d}},zT=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,i;for(;r<n;)i=r+e,yield t.slice(r,i),r=i},BT=async function*(t,e){for await(const n of GT(t))yield*zT(n,e)},GT=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},v4=(t,e,n,r)=>{const i=BT(t,e);let o=0,l,u=d=>{l||(l=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:g}=await i.next();if(f){u(),d.close();return}let v=g.byteLength;if(n){let S=o+=v;n(S)}d.enqueue(new Uint8Array(g))}catch(f){throw u(f),f}},cancel(d){return u(d),i.return()}},{highWaterMark:2})},S4=64*1024,{isFunction:bc}=z,HT=(({Request:t,Response:e})=>({Request:t,Response:e}))(z.global),{ReadableStream:_4,TextEncoder:x4}=z.global,w4=(t,...e)=>{try{return!!t(...e)}catch{return!1}},VT=t=>{t=z.merge.call({skipUndefined:!0},HT,t);const{fetch:e,Request:n,Response:r}=t,i=e?bc(e):typeof fetch=="function",o=bc(n),l=bc(r);if(!i)return!1;const u=i&&bc(_4),d=i&&(typeof x4=="function"?(y=>E=>y.encode(E))(new x4):async y=>new Uint8Array(await new n(y).arrayBuffer())),f=o&&u&&w4(()=>{let y=!1;const E=new _4,C=new n($t.origin,{body:E,method:"POST",get duplex(){return y=!0,"half"}}).headers.has("Content-Type");return E.cancel(),y&&!C}),g=l&&u&&w4(()=>z.isReadableStream(new r("").body)),v={stream:g&&(y=>y.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!v[y]&&(v[y]=(E,C)=>{let P=E&&E[y];if(P)return P.call(E);throw new fe(`Response type '${y}' is not supported`,fe.ERR_NOT_SUPPORT,C)})});const S=async y=>{if(y==null)return 0;if(z.isBlob(y))return y.size;if(z.isSpecCompliantForm(y))return(await new n($t.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(z.isArrayBufferView(y)||z.isArrayBuffer(y))return y.byteLength;if(z.isURLSearchParams(y)&&(y=y+""),z.isString(y))return(await d(y)).byteLength},w=async(y,E)=>{const C=z.toFiniteNumber(y.getContentLength());return C??S(E)};return async y=>{let{url:E,method:C,data:P,signal:k,cancelToken:m,timeout:x,onDownloadProgress:T,onUploadProgress:F,responseType:L,headers:O,withCredentials:j="same-origin",fetchOptions:M}=L8(y),G=e||fetch;L=L?(L+"").toLowerCase():"text";let K=UT([k,m&&m.toAbortSignal()],x),X=null;const ie=K&&K.unsubscribe&&(()=>{K.unsubscribe()});let Z;try{if(F&&f&&C!=="get"&&C!=="head"&&(Z=await w(O,P))!==0){let J=new n(E,{method:"POST",body:P,duplex:"half"}),le;if(z.isFormData(P)&&(le=J.headers.get("content-type"))&&O.setContentType(le),J.body){const[Ne,at]=g4(Z,Ad(m4(F)));P=v4(J.body,S4,Ne,at)}}z.isString(j)||(j=j?"include":"omit");const he=o&&"credentials"in n.prototype,ke={...M,signal:K,method:C.toUpperCase(),headers:O.normalize().toJSON(),body:P,duplex:"half",credentials:he?j:void 0};X=o&&new n(E,ke);let V=await(o?G(X,M):G(E,ke));const ee=g&&(L==="stream"||L==="response");if(g&&(T||ee&&ie)){const J={};["status","statusText","headers"].forEach(mt=>{J[mt]=V[mt]});const le=z.toFiniteNumber(V.headers.get("content-length")),[Ne,at]=T&&g4(le,Ad(m4(T),!0))||[];V=new r(v4(V.body,S4,Ne,()=>{at&&at(),ie&&ie()}),J)}L=L||"text";let $=await v[z.findKey(v,L)||"text"](V,y);return!ee&&ie&&ie(),await new Promise((J,le)=>{A8(J,le,{data:$,headers:wn.from(V.headers),status:V.status,statusText:V.statusText,config:y,request:X})})}catch(he){throw ie&&ie(),he&&he.name==="TypeError"&&/Load failed|fetch/i.test(he.message)?Object.assign(new fe("Network Error",fe.ERR_NETWORK,y,X,he&&he.response),{cause:he.cause||he}):fe.from(he,he&&he.code,y,X,he&&he.response)}}},WT=new Map,b8=t=>{let e=t&&t.env||{};const{fetch:n,Request:r,Response:i}=e,o=[r,i,n];let l=o.length,u=l,d,f,g=WT;for(;u--;)d=o[u],f=g.get(d),f===void 0&&g.set(d,f=u?new Map:VT(e)),g=f;return f};b8();const Zg={http:lT,xhr:jT,fetch:{get:b8}};z.forEach(Zg,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const C4=t=>`- ${t}`,KT=t=>z.isFunction(t)||t===null||t===!1;function QT(t,e){t=z.isArray(t)?t:[t];const{length:n}=t;let r,i;const o={};for(let l=0;l<n;l++){r=t[l];let u;if(i=r,!KT(r)&&(i=Zg[(u=String(r)).toLowerCase()],i===void 0))throw new fe(`Unknown adapter '${u}'`);if(i&&(z.isFunction(i)||(i=i.get(e))))break;o[u||"#"+l]=i}if(!i){const l=Object.entries(o).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let u=n?l.length>1?`since :
`+l.map(C4).join(`
`):" "+C4(l[0]):"as no adapter specified";throw new fe("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return i}const D8={getAdapter:QT,adapters:Zg};function tp(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new vu(null,t)}function k4(t){return tp(t),t.headers=wn.from(t.headers),t.data=ep.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),D8.getAdapter(t.adapter||yu.adapter,t)(t).then(function(r){return tp(t),r.data=ep.call(t,t.transformResponse,r),r.headers=wn.from(r.headers),r},function(r){return F8(r)||(tp(t),r&&r.response&&(r.response.data=ep.call(t,t.transformResponse,r.response),r.response.headers=wn.from(r.response.headers))),Promise.reject(r)})}const I8="1.14.0",qh={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{qh[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const E4={};qh.transitional=function(e,n,r){function i(o,l){return"[Axios v"+I8+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,u)=>{if(e===!1)throw new fe(i(l," has been removed"+(n?" in "+n:"")),fe.ERR_DEPRECATED);return n&&!E4[l]&&(E4[l]=!0,console.warn(i(l," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,l,u):!0}};qh.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function qT(t,e,n){if(typeof t!="object")throw new fe("options must be an object",fe.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],l=e[o];if(l){const u=t[o],d=u===void 0||l(u,o,t);if(d!==!0)throw new fe("option "+o+" must be "+d,fe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new fe("Unknown option "+o,fe.ERR_BAD_OPTION)}}const Zc={assertOptions:qT,validators:qh},Bn=Zc.validators;let Hs=class{constructor(e){this.defaults=e||{},this.interceptors={request:new f4,response:new f4}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=$s(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&Zc.assertOptions(r,{silentJSONParsing:Bn.transitional(Bn.boolean),forcedJSONParsing:Bn.transitional(Bn.boolean),clarifyTimeoutError:Bn.transitional(Bn.boolean),legacyInterceptorReqResOrdering:Bn.transitional(Bn.boolean)},!1),i!=null&&(z.isFunction(i)?n.paramsSerializer={serialize:i}:Zc.assertOptions(i,{encode:Bn.function,serialize:Bn.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Zc.assertOptions(n,{baseUrl:Bn.spelling("baseURL"),withXsrfToken:Bn.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&z.merge(o.common,o[n.method]);o&&z.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),n.headers=wn.concat(l,o);const u=[];let d=!0;this.interceptors.request.forEach(function(E){if(typeof E.runWhen=="function"&&E.runWhen(n)===!1)return;d=d&&E.synchronous;const C=n.transitional||$g;C&&C.legacyInterceptorReqResOrdering?u.unshift(E.fulfilled,E.rejected):u.push(E.fulfilled,E.rejected)});const f=[];this.interceptors.response.forEach(function(E){f.push(E.fulfilled,E.rejected)});let g,v=0,S;if(!d){const y=[k4.bind(this),void 0];for(y.unshift(...u),y.push(...f),S=y.length,g=Promise.resolve(n);v<S;)g=g.then(y[v++],y[v++]);return g}S=u.length;let w=n;for(;v<S;){const y=u[v++],E=u[v++];try{w=y(w)}catch(C){E.call(this,C);break}}try{g=k4.call(this,w)}catch(y){return Promise.reject(y)}for(v=0,S=f.length;v<S;)g=g.then(f[v++],f[v++]);return g}getUri(e){e=$s(this.defaults,e);const n=M8(e.baseURL,e.url,e.allowAbsoluteUrls);return T8(n,e.params,e.paramsSerializer)}};z.forEach(["delete","get","head","options"],function(e){Hs.prototype[e]=function(n,r){return this.request($s(r||{},{method:e,url:n,data:(r||{}).data}))}});z.forEach(["post","put","patch"],function(e){function n(r){return function(o,l,u){return this.request($s(u||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:l}))}}Hs.prototype[e]=n(),Hs.prototype[e+"Form"]=n(!0)});let YT=class j8{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const l=new Promise(u=>{r.subscribe(u),o=u}).then(i);return l.cancel=function(){r.unsubscribe(o)},l},e(function(o,l,u){r.reason||(r.reason=new vu(o,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new j8(function(i){e=i}),cancel:e}}};function XT(t){return function(n){return t.apply(null,n)}}function $T(t){return z.isObject(t)&&t.isAxiosError===!0}const P1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(P1).forEach(([t,e])=>{P1[e]=t});function U8(t){const e=new Hs(t),n=v8(Hs.prototype.request,e);return z.extend(n,Hs.prototype,e,{allOwnKeys:!0}),z.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return U8($s(t,i))},n}const pt=U8(yu);pt.Axios=Hs;pt.CanceledError=vu;pt.CancelToken=YT;pt.isCancel=F8;pt.VERSION=I8;pt.toFormData=Qh;pt.AxiosError=fe;pt.Cancel=pt.CanceledError;pt.all=function(e){return Promise.all(e)};pt.spread=XT;pt.isAxiosError=$T;pt.mergeConfig=$s;pt.AxiosHeaders=wn;pt.formToJSON=t=>O8(z.isHTMLForm(t)?new FormData(t):t);pt.getAdapter=D8.getAdapter;pt.HttpStatusCode=P1;pt.default=pt;const{Axios:yO,AxiosError:vO,CanceledError:SO,isCancel:_O,CancelToken:xO,VERSION:wO,all:CO,Cancel:kO,isAxiosError:EO,spread:PO,toFormData:NO,AxiosHeaders:RO,HttpStatusCode:TO,formToJSON:OO,getAdapter:FO,mergeConfig:AO}=pt,Vn=pt.create({baseURL:"/api",headers:{"Content-Type":"application/json"}}),np={getAll:()=>Vn.get("/covers"),upload:t=>{const e=new FormData;return e.append("image",t),Vn.post("/covers/upload",e,{headers:{"Content-Type":"multipart/form-data"}})},delete:t=>Vn.delete(`/covers/${t}`),process:(t,e)=>{const n=new FormData;return n.append("image",t),e&&Object.entries(e).forEach(([r,i])=>{n.append(r,i)}),Vn.post("/covers/process",n,{headers:{"Content-Type":"multipart/form-data"}})},generate:(t,e)=>Vn.post("/covers/generate",{prompt:t,genre:e})},Yh={getGenres:()=>Vn.get("/books/genres"),getGenre:t=>Vn.get(`/books/genres/${t}`),generateOutline:(t,e,n)=>Vn.post("/books/outline",{genre:t,idea:e,title:n}),generateChapter:(t,e,n,r)=>Vn.post("/books/chapter",{genre:t,chapterTitle:e,chapterSummary:n,previousContent:r}),expand:(t,e)=>Vn.post("/books/expand",{text:t,instruction:e}),generateCharacters:(t,e)=>Vn.post("/books/characters",{genre:t,storyIdea:e}),generatePlot:(t,e,n)=>Vn.post("/books/plot",{genre:t,currentPlot:e,issue:n})};function JT(){const[t,e]=W.useState("gallery"),{activeCover:n,setActiveCover:r}=y8(),i=Og(),{data:o}=S6({queryKey:["covers"],queryFn:async()=>(await np.getAll()).data.covers}),l=Pw({mutationFn:async f=>(await np.generate(f)).data,onSuccess:()=>{i.invalidateQueries({queryKey:["covers"]}),e("gallery")}}),u=f=>{l.mutate(f)},d=f=>{const g={id:`cover-${Date.now()}`,title:"New Book",author:"Author Name",backgroundImage:f,backgroundColor:"#ffffff",width:1600,height:2400,layers:[],createdAt:new Date,updatedAt:new Date};r(g),e("editor")};return N.jsxs("div",{className:"space-y-6",children:[N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsxs("div",{children:[N.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Cover Designer"}),N.jsx("p",{className:"text-gray-500 mt-1",children:"Design stunning book covers with AI or manual editing"})]}),N.jsxs("div",{className:"flex bg-white rounded-lg p-1 border border-gray-200",children:[N.jsxs("button",{onClick:()=>e("gallery"),className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="gallery"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[N.jsx(Fg,{className:"w-4 h-4"}),"Gallery"]}),N.jsxs("button",{onClick:()=>e("editor"),className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="editor"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[N.jsx(h1,{className:"w-4 h-4"}),"Editor"]}),N.jsxs("button",{onClick:()=>e("ai"),className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="ai"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[N.jsx(Xs,{className:"w-4 h-4"}),"AI Generate"]})]})]}),t==="gallery"&&N.jsx(zw,{covers:o||[],onSelect:d,onDelete:f=>{np.delete(f).then(()=>{i.invalidateQueries({queryKey:["covers"]})})}}),t==="editor"&&n&&N.jsx(SR,{}),t==="ai"&&N.jsx(ZT,{onGenerate:u,isGenerating:l.isPending})]})}function ZT({onGenerate:t,isGenerating:e}){const[n,r]=W.useState(""),[i,o]=W.useState("modern"),l=[{id:"modern",name:"Modern",icon:"✨"},{id:"minimal",name:"Minimalist",icon:"🎯"},{id:"vintage",name:"Vintage",icon:"📜"},{id:"bold",name:"Bold",icon:"🔥"},{id:"elegant",name:"Elegant",icon:"💎"},{id:"playful",name:"Playful",icon:"🎨"}],u=[{genre:"Mystery",prompt:"A mysterious book cover with dark shadows, silhouette of a detective, foggy street scene, noir atmosphere"},{genre:"Romance",prompt:"A romantic book cover with soft pastel colors, couple silhouette at sunset, dreamy and emotional"},{genre:"Fantasy",prompt:"An epic fantasy book cover with magical elements, dragon, castle in the background, mystical glowing effects"},{genre:"Sci-Fi",prompt:"A futuristic sci-fi book cover with spaceships, neon lights, cyberpunk city, high-tech atmosphere"},{genre:"Self-Help",prompt:"A clean self-help book cover with inspiring imagery, mountain peak or sunrise, professional and motivating"}],d=g=>{r(g)},f=()=>{if(n.trim()){const g=`${n}, ${i} style, professional book cover design, high quality, detailed`;t(g)}};return N.jsx("div",{className:"card space-y-6",children:N.jsxs("div",{children:[N.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"AI Cover Generator"}),N.jsxs("div",{className:"mb-6",children:[N.jsx("label",{className:"label",children:"Select Style"}),N.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2 mt-2",children:l.map(g=>N.jsxs("button",{onClick:()=>o(g.id),className:`p-3 rounded-lg border text-center transition-colors ${i===g.id?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-200 hover:border-gray-300"}`,children:[N.jsx("span",{className:"text-xl",children:g.icon}),N.jsx("p",{className:"text-xs mt-1",children:g.name})]},g.id))})]}),N.jsxs("div",{className:"mb-6",children:[N.jsx("label",{className:"label",children:"Describe Your Cover"}),N.jsx("textarea",{value:n,onChange:g=>r(g.target.value),placeholder:"Describe the book cover you want to generate... e.g., 'A mysterious forest with glowing eyes in the darkness'",className:"input min-h-[120px] resize-y"})]}),N.jsxs("div",{className:"mb-6",children:[N.jsx("label",{className:"label",children:"Quick Presets by Genre"}),N.jsx("div",{className:"grid gap-2 mt-2",children:u.map(g=>N.jsxs("button",{onClick:()=>d(g.prompt),className:"text-left px-4 py-2 rounded-lg border border-gray-200 hover:border-primary-300 hover:bg-primary-50 transition-colors",children:[N.jsx("span",{className:"font-medium",children:g.genre}),N.jsx("p",{className:"text-sm text-gray-500 truncate",children:g.prompt})]},g.genre))})]}),N.jsxs("button",{onClick:f,disabled:!n.trim()||e,className:"btn-primary w-full py-3 flex items-center justify-center gap-2",children:[N.jsx(Xs,{className:"w-5 h-5"}),e?"Generating...":"Generate Cover"]})]})})}function eO({genres:t,onSelect:e}){const[n,r]=W.useState(""),[i,o]=W.useState(""),[l,u]=W.useState(""),d=f=>{f.preventDefault(),n&&l.trim()&&e(n,l.trim(),i.trim())};return N.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[N.jsx("div",{className:"lg:col-span-2",children:N.jsxs("div",{className:"card",children:[N.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[N.jsx(Pd,{className:"w-5 h-5"}),"Select Your Genre"]}),N.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:t.map(f=>N.jsxs("button",{onClick:()=>r(f.id),className:`p-4 rounded-xl border-2 text-left transition-all ${n===f.id?"border-primary-500 bg-primary-50 shadow-md":"border-gray-200 hover:border-gray-300 hover:bg-gray-50"}`,children:[N.jsx("span",{className:"text-2xl mb-2 block",children:f.icon}),N.jsx("h4",{className:"font-medium text-gray-900",children:f.name}),N.jsx("p",{className:"text-xs text-gray-500 mt-1 line-clamp-2",children:f.description})]},f.id))})]})}),N.jsx("div",{children:N.jsxs("div",{className:"card sticky top-6",children:[N.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[N.jsx(x6,{className:"w-5 h-5"}),"Book Details"]}),N.jsxs("form",{onSubmit:d,className:"space-y-4",children:[N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Book Title (optional)"}),N.jsx("input",{type:"text",value:i,onChange:f=>o(f.target.value),placeholder:"My Amazing Book",className:"input"})]}),N.jsxs("div",{children:[N.jsxs("label",{className:"label",children:["Core Idea ",N.jsx("span",{className:"text-red-500",children:"*"})]}),N.jsx("textarea",{value:l,onChange:f=>u(f.target.value),placeholder:"Describe your book idea... What's the story about? Who are the main characters? What conflict drives the narrative?",className:"input min-h-[150px] resize-y",required:!0})]}),N.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3",children:N.jsxs("p",{className:"text-xs text-amber-700",children:[N.jsx("strong",{children:"Tip:"})," The more details you provide, the better the AI can generate your outline and content."]})}),N.jsx("button",{type:"submit",disabled:!n||!l.trim(),className:"btn-primary w-full py-3",children:"Generate Outline"})]})]})})]})}const Xh=m8(t=>({books:[],activeBook:null,isGenerating:!1,generationProgress:0,addBook:e=>t(n=>({books:[e,...n.books],activeBook:e})),updateBook:(e,n)=>t(r=>{var i;return{books:r.books.map(o=>o.id===e?{...o,...n,updatedAt:new Date}:o),activeBook:((i=r.activeBook)==null?void 0:i.id)===e?{...r.activeBook,...n,updatedAt:new Date}:r.activeBook}}),deleteBook:e=>t(n=>{var r;return{books:n.books.filter(i=>i.id!==e),activeBook:((r=n.activeBook)==null?void 0:r.id)===e?null:n.activeBook}}),setActiveBook:e=>t({activeBook:e}),setOutline:e=>t(n=>{if(!n.activeBook)return n;const r={...n.activeBook,outline:e,updatedAt:new Date};return{activeBook:r,books:n.books.map(i=>i.id===n.activeBook.id?r:i)}}),addCharacter:e=>t(n=>{if(!n.activeBook)return n;const r={...n.activeBook,characters:[...n.activeBook.characters,e],updatedAt:new Date};return{activeBook:r,books:n.books.map(i=>i.id===n.activeBook.id?r:i)}}),updateChapterContent:(e,n)=>t(r=>{if(!r.activeBook||!r.activeBook.outline)return r;const i={...r.activeBook.outline,chapters:r.activeBook.outline.chapters.map(l=>l.number===e?{...l,content:n,isGenerated:!0}:l)},o={...r.activeBook,outline:i,updatedAt:new Date};return{activeBook:o,books:r.books.map(l=>l.id===r.activeBook.id?o:l)}}),setCurrentChapter:e=>t(n=>n.activeBook?{activeBook:{...n.activeBook,currentChapter:e}}:n),setCoverForBook:e=>t(n=>{if(!n.activeBook)return n;const r={...n.activeBook,coverId:e,updatedAt:new Date};return{activeBook:r,books:n.books.map(i=>i.id===n.activeBook.id?r:i)}}),setIsGenerating:e=>t({isGenerating:e}),setGenerationProgress:e=>t({generationProgress:e})}));function tO({book:t,onComplete:e}){var f;const{activeBook:n}=Xh(),[r,i]=W.useState(!1),[o,l]=W.useState(""),u=n==null?void 0:n.outline,d=async()=>{var g,v;i(!0),l("");try{const w=(await Yh.generateOutline(t.genre,t.idea,t.title)).data.outline;e(w)}catch(S){l(((v=(g=S.response)==null?void 0:g.data)==null?void 0:v.error)||"Failed to generate outline")}finally{i(!1)}};return N.jsxs("div",{className:"space-y-6",children:[N.jsx("div",{className:"card bg-gradient-to-r from-primary-50 to-accent-50",children:N.jsxs("div",{className:"flex items-start justify-between",children:[N.jsxs("div",{children:[N.jsx("h3",{className:"font-semibold text-gray-900",children:t.title||"Untitled Book"}),N.jsxs("p",{className:"text-sm text-gray-600 mt-1 capitalize",children:["Genre: ",t.genre]}),N.jsx("p",{className:"text-sm text-gray-500 mt-2 line-clamp-2",children:t.idea})]}),!u&&N.jsx("button",{onClick:d,disabled:r,className:"btn-primary flex items-center gap-2",children:r?N.jsxs(N.Fragment,{children:[N.jsx(bw,{className:"w-4 h-4 animate-spin"}),"Generating..."]}):N.jsxs(N.Fragment,{children:[N.jsx(Xs,{className:"w-4 h-4"}),"Generate Outline"]})})]})}),o&&N.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:N.jsx("p",{className:"text-red-700",children:o})}),u&&N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[N.jsx(Tw,{className:"w-5 h-5 text-green-500"}),N.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:["Generated Outline: ",u.title||t.title]})]}),u.logline&&N.jsxs("div",{className:"mb-6 pb-6 border-b border-gray-200",children:[N.jsx("h4",{className:"text-sm font-medium text-gray-500 mb-2",children:"Logline"}),N.jsx("p",{className:"text-gray-900 italic",children:u.logline})]}),N.jsxs("div",{children:[N.jsx("h4",{className:"text-sm font-medium text-gray-500 mb-4",children:"Chapter Outline"}),N.jsx("div",{className:"space-y-3",children:(f=u.chapters)==null?void 0:f.map((g,v)=>N.jsx("div",{className:"border border-gray-200 rounded-lg p-4 hover:border-primary-300 transition-colors",children:N.jsxs("div",{className:"flex items-start gap-3",children:[N.jsx("span",{className:"flex-shrink-0 w-8 h-8 bg-primary-100 text-primary-700 rounded-full flex items-center justify-center text-sm font-medium",children:g.number||v+1}),N.jsxs("div",{className:"flex-1",children:[N.jsx("h5",{className:"font-medium text-gray-900",children:g.title||`Chapter ${g.number||v+1}`}),N.jsx("p",{className:"text-sm text-gray-600 mt-1",children:g.summary||"No summary available"})]})]})},v))})]}),N.jsx("div",{className:"mt-6 flex items-center justify-end gap-3",children:N.jsx("p",{className:"text-sm text-gray-500",children:"Ready to start writing! Navigate to the Write tab to begin."})})]}),!u&&!r&&N.jsxs("div",{className:"card text-center py-12",children:[N.jsx(Xs,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),N.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Ready to Generate"}),N.jsx("p",{className:"text-gray-500 mt-2 max-w-md mx-auto",children:'Click "Generate Outline" to create a detailed chapter outline based on your genre and book idea. The AI will create a structure following genre-specific patterns.'})]})]})}function nO(){const{activeBook:t,updateChapterContent:e,setCurrentChapter:n}=Xh(),[r,i]=W.useState(!1),[o,l]=W.useState(!1);if(!t||!t.outline)return N.jsx("div",{className:"card text-center py-12",children:N.jsx("p",{className:"text-gray-500",children:"Generate an outline first to start writing your book."})});const u=t.outline.chapters.find(S=>S.number===t.currentChapter),d=()=>{t.currentChapter>1&&n(t.currentChapter-1)},f=()=>{const S=t.outline.chapters.length;t.currentChapter<S&&n(t.currentChapter+1)},g=async()=>{var S;if(!(!u||!t)){i(!0);try{const w=(S=t.outline)==null?void 0:S.chapters.find(E=>E.number===t.currentChapter-1),y=await Yh.generateChapter(t.genre,u.title,u.summary,w==null?void 0:w.content);e(t.currentChapter,y.data.content)}catch(w){console.error("Failed to generate chapter:",w)}finally{i(!1)}}},v=async()=>{alert("Expand feature coming soon!")};return N.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{className:"card",children:[N.jsx("h3",{className:"font-semibold text-gray-900 mb-4",children:"Chapters"}),N.jsx("div",{className:"space-y-2",children:t.outline.chapters.map(S=>N.jsx("button",{onClick:()=>n(S.number),className:`w-full text-left p-3 rounded-lg transition-colors ${S.number===t.currentChapter?"bg-primary-100 text-primary-700":"hover:bg-gray-50"}`,children:N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("span",{className:"flex-shrink-0 w-6 h-6 bg-white rounded-full flex items-center justify-center text-xs font-medium border",children:S.number}),N.jsxs("div",{className:"flex-1 min-w-0",children:[N.jsx("p",{className:"text-sm font-medium truncate",children:S.title}),S.content&&N.jsx("span",{className:"text-xs text-green-600",children:"✓ Written"})]})]})},S.number))})]}),N.jsxs("div",{className:"card",children:[N.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Chapter Summary"}),N.jsx("p",{className:"text-sm text-gray-600",children:u==null?void 0:u.summary})]})]}),N.jsx("div",{className:"lg:col-span-3",children:N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"flex items-center justify-between mb-6 pb-4 border-b border-gray-200",children:[N.jsxs("div",{className:"flex items-center gap-4",children:[N.jsx("button",{onClick:d,disabled:t.currentChapter<=1,className:"p-2 rounded-lg hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed",children:N.jsx(Ow,{className:"w-5 h-5"})}),N.jsxs("div",{children:[N.jsx("h2",{className:"text-xl font-bold text-gray-900",children:u==null?void 0:u.title}),N.jsxs("p",{className:"text-sm text-gray-500",children:["Chapter ",t.currentChapter," of ",t.outline.chapters.length]})]}),N.jsx("button",{onClick:f,disabled:t.currentChapter>=t.outline.chapters.length,className:"p-2 rounded-lg hover:bg-gray-100 disabled:opacity-50 disabled:cursor-not-allowed",children:N.jsx(Fw,{className:"w-5 h-5"})})]}),N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsxs("button",{onClick:()=>l(!o),className:"btn-secondary flex items-center gap-2",children:[N.jsx(x6,{className:"w-4 h-4"}),"AI Assist"]}),N.jsxs("button",{onClick:g,disabled:r||!u,className:"btn-primary flex items-center gap-2",children:[N.jsx(Xs,{className:"w-4 h-4"}),r?"Generating...":"Generate Chapter"]})]})]}),o&&N.jsxs("div",{className:"mb-6 bg-gradient-to-r from-accent-50 to-primary-50 rounded-lg p-4 border border-accent-200",children:[N.jsx("h4",{className:"font-medium text-gray-900 mb-3",children:"AI Writing Assistant"}),N.jsxs("div",{className:"flex flex-wrap gap-2",children:[N.jsx("button",{onClick:v,className:"text-sm px-3 py-1.5 bg-white rounded-lg border border-gray-200 hover:border-accent-300 transition-colors",children:"✨ Expand this section"}),N.jsx("button",{className:"text-sm px-3 py-1.5 bg-white rounded-lg border border-gray-200 hover:border-accent-300 transition-colors",children:"📝 Improve prose"}),N.jsx("button",{className:"text-sm px-3 py-1.5 bg-white rounded-lg border border-gray-200 hover:border-accent-300 transition-colors",children:"💡 Add description"}),N.jsx("button",{className:"text-sm px-3 py-1.5 bg-white rounded-lg border border-gray-200 hover:border-accent-300 transition-colors",children:"🔄 Rewrite paragraph"})]})]}),N.jsx("div",{className:"min-h-[500px]",children:u!=null&&u.content?N.jsx("textarea",{value:u.content,onChange:S=>e(t.currentChapter,S.target.value),className:"w-full h-[600px] p-6 font-serif text-lg leading-relaxed border-0 focus:ring-0 resize-y outline-none",placeholder:"Start writing or use AI to generate this chapter..."}):N.jsx("div",{className:"h-[500px] flex items-center justify-center text-gray-400",children:N.jsxs("div",{className:"text-center",children:[N.jsx(Xs,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),N.jsx("p",{children:'Click "Generate Chapter" to create content with AI'}),N.jsx("p",{className:"text-sm mt-1",children:"Or start writing manually"})]})})}),N.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-200 flex items-center justify-between text-sm text-gray-500",children:[N.jsxs("span",{children:[u!=null&&u.content?u.content.split(/\s+/).length:0," ","words"]}),N.jsxs("span",{children:["Last updated:"," ",new Date(t.updatedAt).toLocaleDateString()]})]})]})})]})}function rO(){const[t,e]=W.useState("genre"),{activeBook:n,setActiveBook:r,setOutline:i}=Xh(),{data:o}=S6({queryKey:["genres"],queryFn:async()=>(await Yh.getGenres()).data.genres}),l=(d,f,g)=>{const v={id:`book-${Date.now()}`,title:g,genre:d,idea:f,outline:null,characters:[],currentChapter:1,createdAt:new Date,updatedAt:new Date};r(v),e("outline")},u=d=>{n&&d&&(i(d),e("editor"))};return N.jsxs("div",{className:"space-y-6",children:[N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsxs("div",{children:[N.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Book Generator"}),N.jsx("p",{className:"text-gray-500 mt-1",children:"Generate book ideas and write with AI assistance"})]}),N.jsxs("div",{className:"flex bg-white rounded-lg p-1 border border-gray-200",children:[N.jsxs("button",{onClick:()=>e("genre"),className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="genre"||!n?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,disabled:!n&&t!=="genre",children:[N.jsx(Pd,{className:"w-4 h-4"}),N.jsx("span",{className:"hidden sm:inline",children:"Genre"})]}),N.jsxs("button",{onClick:()=>e("outline"),disabled:!n,className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="outline"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100 disabled:opacity-50"}`,children:[N.jsx(Lw,{className:"w-4 h-4"}),N.jsx("span",{className:"hidden sm:inline",children:"Outline"})]}),N.jsxs("button",{onClick:()=>e("editor"),disabled:!n,className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="editor"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[N.jsx(Dw,{className:"w-4 h-4"}),N.jsx("span",{className:"hidden sm:inline",children:"Write"})]}),N.jsxs("button",{onClick:()=>e("characters"),disabled:!n,className:`flex items-center gap-2 px-4 py-2 rounded-md transition-colors ${t==="characters"?"bg-primary-100 text-primary-700":"text-gray-600 hover:bg-gray-100"}`,children:[N.jsx(w6,{className:"w-4 h-4"}),N.jsx("span",{className:"hidden sm:inline",children:"Characters"})]})]})]}),t==="genre"&&N.jsx(eO,{genres:o||[],onSelect:l}),t==="outline"&&n&&N.jsx(tO,{book:n,onComplete:u}),t==="editor"&&n&&N.jsx(nO,{}),t==="characters"&&n&&N.jsx(iO,{})]})}function iO(){const{activeBook:t,addCharacter:e}=Xh(),[n,r]=W.useState(!1),i=async()=>{if(t){r(!0);try{const l=(await Yh.generateCharacters(t.genre,t.idea)).data.characters;Array.isArray(l)&&l.forEach(u=>{e({name:u.name||"Unknown",role:u.role||"Supporting",traits:u.traits||[],motivation:u.motivation||"",backstory:u.backstory||""})})}catch(o){console.error("Failed to generate characters:",o)}finally{r(!1)}}};return t?N.jsxs("div",{className:"card",children:[N.jsxs("div",{className:"flex items-center justify-between mb-6",children:[N.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Character Development"}),N.jsxs("button",{onClick:i,disabled:n,className:"btn-primary flex items-center gap-2",children:[N.jsx(Xs,{className:"w-4 h-4"}),n?"Generating...":"Generate Characters"]})]}),t.characters.length===0?N.jsxs("div",{className:"text-center py-8",children:[N.jsx(w6,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),N.jsx("p",{className:"text-gray-500",children:'No characters yet. Click "Generate Characters" to create AI-suggested characters.'})]}):N.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.characters.map((o,l)=>{var u;return N.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:border-primary-300 transition-colors",children:[N.jsxs("div",{className:"flex items-start justify-between mb-2",children:[N.jsx("h4",{className:"font-semibold text-gray-900",children:o.name}),N.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${o.role==="protagonist"?"bg-green-100 text-green-700":o.role==="antagonist"?"bg-red-100 text-red-700":"bg-gray-100 text-gray-600"}`,children:o.role})]}),N.jsxs("div",{className:"space-y-2 text-sm",children:[N.jsxs("div",{children:[N.jsx("span",{className:"text-gray-500",children:"Traits:"}),N.jsx("p",{className:"text-gray-700",children:((u=o.traits)==null?void 0:u.join(", "))||"N/A"})]}),N.jsxs("div",{children:[N.jsx("span",{className:"text-gray-500",children:"Motivation:"}),N.jsx("p",{className:"text-gray-700",children:o.motivation||"N/A"})]})]})]},l)})})]}):null}function sO(){const[t]=W.useState("gpt-4o-mini"),[e]=W.useState("stable-diffusion-v1-6"),n=()=>{alert("Cloud AI models are configured automatically!")};return N.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[N.jsxs("div",{children:[N.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Settings"}),N.jsx("p",{className:"text-gray-500 mt-1",children:"Cloud AI configuration and application preferences"})]}),N.jsxs("div",{className:"card",children:[N.jsxs("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center gap-2",children:[N.jsx(Aw,{className:"w-5 h-5"}),"Cloud AI Settings"]}),N.jsxs("div",{className:"space-y-4",children:[N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Text Generation Model"}),N.jsx("select",{value:t,disabled:!0,className:"input bg-gray-100",children:N.jsx("option",{value:"gpt-4o-mini",children:"OpenAI GPT-4o Mini (via OpenRouter)"})}),N.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Used for book outlines, chapters, and text generation (free tier)"})]}),N.jsxs("div",{children:[N.jsx("label",{className:"label",children:"Image Generation Model"}),N.jsx("select",{value:e,disabled:!0,className:"input bg-gray-100",children:N.jsx("option",{value:"stable-diffusion-v1-6",children:"Stability AI Stable Diffusion v1.6"})}),N.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Used for AI book cover generation (free credits available)"})]})]})]}),N.jsxs("div",{className:"card bg-blue-50 border-blue-200",children:[N.jsx("h3",{className:"font-medium text-blue-900 mb-2",children:"API Key Setup"}),N.jsx("p",{className:"text-sm text-blue-700 mb-3",children:"Configure your API key in the server/.env file:"}),N.jsx("code",{className:"block bg-white rounded p-3 text-sm font-mono text-blue-800",children:"OPENROUTER_API_KEY=your_openrouter_api_key_here"}),N.jsxs("p",{className:"text-sm text-blue-700 mt-2",children:["Get a free API key from: ",N.jsx("a",{href:"https://openrouter.ai/keys",className:"underline",target:"_blank",rel:"noopener noreferrer",children:"OpenRouter"})]})]}),N.jsx("div",{className:"flex justify-end",children:N.jsxs("button",{onClick:n,className:"btn-primary flex items-center gap-2",children:[N.jsx(Iw,{className:"w-4 h-4"}),"Save Settings"]})})]})}function oO(){return N.jsxs("div",{className:"min-h-screen bg-gray-50",children:[N.jsx("header",{className:"bg-white border-b border-gray-200 sticky top-0 z-50",children:N.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:N.jsxs("div",{className:"flex items-center justify-between h-16",children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-primary-500 to-accent-500 rounded-lg flex items-center justify-center",children:N.jsx(Pd,{className:"w-5 h-5 text-white"})}),N.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"CreaBook"})]}),N.jsxs("nav",{className:"flex items-center gap-1",children:[N.jsxs("a",{href:"/covers",className:"flex items-center gap-2 px-4 py-2 rounded-lg text-gray-600 hover:bg-gray-100 transition-colors",children:[N.jsx(Fg,{className:"w-5 h-5"}),N.jsx("span",{className:"hidden sm:inline",children:"Cover Designer"})]}),N.jsxs("a",{href:"/books",className:"flex items-center gap-2 px-4 py-2 rounded-lg text-gray-600 hover:bg-gray-100 transition-colors",children:[N.jsx(Pd,{className:"w-5 h-5"}),N.jsx("span",{className:"hidden sm:inline",children:"Book Generator"})]}),N.jsxs("a",{href:"/settings",className:"flex items-center gap-2 px-4 py-2 rounded-lg text-gray-600 hover:bg-gray-100 transition-colors",children:[N.jsx(jw,{className:"w-5 h-5"}),N.jsx("span",{className:"hidden sm:inline",children:"Settings"})]})]})]})})}),N.jsx("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:N.jsxs(Ux,{children:[N.jsx(pl,{path:"/",element:N.jsx(Ix,{to:"/covers",replace:!0})}),N.jsx(pl,{path:"/covers",element:N.jsx(JT,{})}),N.jsx(pl,{path:"/books",element:N.jsx(rO,{})}),N.jsx(pl,{path:"/settings",element:N.jsx(sO,{})})]})})]})}const aO=new fw({defaultOptions:{queries:{staleTime:5*60*1e3,retry:1}}});rp.createRoot(document.getElementById("root")).render(N.jsx(Mt.StrictMode,{children:N.jsx(pw,{client:aO,children:N.jsx(Gx,{children:N.jsx(oO,{})})})}));