InvokeAI/invokeai/frontend/web/dist/assets/index-c5a5b67c.js
ElrikUnderlake d586a82a53
yarn build
2023-03-10 20:54:59 -06:00

116 lines
667 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function h2(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 a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(t,i,a.get?a:{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 a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function p2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jt={},AL={get exports(){return jt},set exports(t){jt=t}},hh={},be={},IL={get exports(){return be},set exports(t){be=t}},De={};/**
* @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 Ku=Symbol.for("react.element"),LL=Symbol.for("react.portal"),ML=Symbol.for("react.fragment"),DL=Symbol.for("react.strict_mode"),NL=Symbol.for("react.profiler"),BL=Symbol.for("react.provider"),FL=Symbol.for("react.context"),$L=Symbol.for("react.forward_ref"),zL=Symbol.for("react.suspense"),GL=Symbol.for("react.memo"),UL=Symbol.for("react.lazy"),qS=Symbol.iterator;function jL(t){return t===null||typeof t!="object"?null:(t=qS&&t[qS]||t["@@iterator"],typeof t=="function"?t:null)}var g2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m2=Object.assign,v2={};function Us(t,e,n){this.props=t,this.context=e,this.refs=v2,this.updater=n||g2}Us.prototype.isReactComponent={};Us.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")};Us.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function y2(){}y2.prototype=Us.prototype;function my(t,e,n){this.props=t,this.context=e,this.refs=v2,this.updater=n||g2}var vy=my.prototype=new y2;vy.constructor=my;m2(vy,Us.prototype);vy.isPureReactComponent=!0;var KS=Array.isArray,S2=Object.prototype.hasOwnProperty,yy={current:null},_2={key:!0,ref:!0,__self:!0,__source:!0};function w2(t,e,n){var r,i={},a=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(a=""+e.key),e)S2.call(e,r)&&!_2.hasOwnProperty(r)&&(i[r]=e[r]);var u=arguments.length-2;if(u===1)i.children=n;else if(1<u){for(var c=Array(u),f=0;f<u;f++)c[f]=arguments[f+2];i.children=c}if(t&&t.defaultProps)for(r in u=t.defaultProps,u)i[r]===void 0&&(i[r]=u[r]);return{$$typeof:Ku,type:t,key:a,ref:s,props:i,_owner:yy.current}}function HL(t,e){return{$$typeof:Ku,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Sy(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ku}function WL(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var YS=/\/+/g;function Ug(t,e){return typeof t=="object"&&t!==null&&t.key!=null?WL(""+t.key):e.toString(36)}function Xf(t,e,n,r,i){var a=typeof t;(a==="undefined"||a==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Ku:case LL:s=!0}}if(s)return s=t,i=i(s),t=r===""?"."+Ug(s,0):r,KS(i)?(n="",t!=null&&(n=t.replace(YS,"$&/")+"/"),Xf(i,e,n,"",function(f){return f})):i!=null&&(Sy(i)&&(i=HL(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(YS,"$&/")+"/")+t)),e.push(i)),1;if(s=0,r=r===""?".":r+":",KS(t))for(var u=0;u<t.length;u++){a=t[u];var c=r+Ug(a,u);s+=Xf(a,e,n,c,i)}else if(c=jL(t),typeof c=="function")for(t=c.call(t),u=0;!(a=t.next()).done;)a=a.value,c=r+Ug(a,u++),s+=Xf(a,e,n,c,i);else if(a==="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 s}function ff(t,e,n){if(t==null)return t;var r=[],i=0;return Xf(t,r,"","",function(a){return e.call(n,a,i++)}),r}function VL(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 _n={current:null},Qf={transition:null},qL={ReactCurrentDispatcher:_n,ReactCurrentBatchConfig:Qf,ReactCurrentOwner:yy};De.Children={map:ff,forEach:function(t,e,n){ff(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return ff(t,function(){e++}),e},toArray:function(t){return ff(t,function(e){return e})||[]},only:function(t){if(!Sy(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};De.Component=Us;De.Fragment=ML;De.Profiler=NL;De.PureComponent=my;De.StrictMode=DL;De.Suspense=zL;De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qL;De.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=m2({},t.props),i=t.key,a=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(a=e.ref,s=yy.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var u=t.type.defaultProps;for(c in e)S2.call(e,c)&&!_2.hasOwnProperty(c)&&(r[c]=e[c]===void 0&&u!==void 0?u[c]:e[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){u=Array(c);for(var f=0;f<c;f++)u[f]=arguments[f+2];r.children=u}return{$$typeof:Ku,type:t.type,key:i,ref:a,props:r,_owner:s}};De.createContext=function(t){return t={$$typeof:FL,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:BL,_context:t},t.Consumer=t};De.createElement=w2;De.createFactory=function(t){var e=w2.bind(null,t);return e.type=t,e};De.createRef=function(){return{current:null}};De.forwardRef=function(t){return{$$typeof:$L,render:t}};De.isValidElement=Sy;De.lazy=function(t){return{$$typeof:UL,_payload:{_status:-1,_result:t},_init:VL}};De.memo=function(t,e){return{$$typeof:GL,type:t,compare:e===void 0?null:e}};De.startTransition=function(t){var e=Qf.transition;Qf.transition={};try{t()}finally{Qf.transition=e}};De.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};De.useCallback=function(t,e){return _n.current.useCallback(t,e)};De.useContext=function(t){return _n.current.useContext(t)};De.useDebugValue=function(){};De.useDeferredValue=function(t){return _n.current.useDeferredValue(t)};De.useEffect=function(t,e){return _n.current.useEffect(t,e)};De.useId=function(){return _n.current.useId()};De.useImperativeHandle=function(t,e,n){return _n.current.useImperativeHandle(t,e,n)};De.useInsertionEffect=function(t,e){return _n.current.useInsertionEffect(t,e)};De.useLayoutEffect=function(t,e){return _n.current.useLayoutEffect(t,e)};De.useMemo=function(t,e){return _n.current.useMemo(t,e)};De.useReducer=function(t,e,n){return _n.current.useReducer(t,e,n)};De.useRef=function(t){return _n.current.useRef(t)};De.useState=function(t){return _n.current.useState(t)};De.useSyncExternalStore=function(t,e,n){return _n.current.useSyncExternalStore(t,e,n)};De.useTransition=function(){return _n.current.useTransition()};De.version="18.2.0";(function(t){t.exports=De})(IL);const As=p2(be),XS=h2({__proto__:null,default:As},[be]);/**
* @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 KL=be,YL=Symbol.for("react.element"),XL=Symbol.for("react.fragment"),QL=Object.prototype.hasOwnProperty,JL=KL.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ZL={key:!0,ref:!0,__self:!0,__source:!0};function b2(t,e,n){var r,i={},a=null,s=null;n!==void 0&&(a=""+n),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)QL.call(e,r)&&!ZL.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:YL,type:t,key:a,ref:s,props:i,_owner:JL.current}}hh.Fragment=XL;hh.jsx=b2;hh.jsxs=b2;(function(t){t.exports=hh})(AL);var Fm={},_u={},eM={get exports(){return _u},set exports(t){_u=t}},Qn={},$m={},tM={get exports(){return $m},set exports(t){$m=t}},C2={};/**
* @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(H,Y){var Q=H.length;H.push(Y);e:for(;0<Q;){var oe=Q-1>>>1,ve=H[oe];if(0<i(ve,Y))H[oe]=Y,H[Q]=ve,Q=oe;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var Y=H[0],Q=H.pop();if(Q!==Y){H[0]=Q;e:for(var oe=0,ve=H.length,we=ve>>>1;oe<we;){var Ue=2*(oe+1)-1,At=H[Ue],me=Ue+1,qt=H[me];if(0>i(At,Q))me<ve&&0>i(qt,At)?(H[oe]=qt,H[me]=Q,oe=me):(H[oe]=At,H[Ue]=Q,oe=Ue);else if(me<ve&&0>i(qt,Q))H[oe]=qt,H[me]=Q,oe=me;else break e}}return Y}function i(H,Y){var Q=H.sortIndex-Y.sortIndex;return Q!==0?Q:H.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,u=s.now();t.unstable_now=function(){return s.now()-u}}var c=[],f=[],h=1,p=null,g=3,y=!1,v=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(H){for(var Y=n(f);Y!==null;){if(Y.callback===null)r(f);else if(Y.startTime<=H)r(f),Y.sortIndex=Y.expirationTime,e(c,Y);else break;Y=n(f)}}function O(H){if(w=!1,C(H),!v)if(n(c)!==null)v=!0,V(I);else{var Y=n(f);Y!==null&&ie(O,Y.startTime-H)}}function I(H,Y){v=!1,w&&(w=!1,_(U),U=-1),y=!0;var Q=g;try{for(C(Y),p=n(c);p!==null&&(!(p.expirationTime>Y)||H&&!te());){var oe=p.callback;if(typeof oe=="function"){p.callback=null,g=p.priorityLevel;var ve=oe(p.expirationTime<=Y);Y=t.unstable_now(),typeof ve=="function"?p.callback=ve:p===n(c)&&r(c),C(Y)}else r(c);p=n(c)}if(p!==null)var we=!0;else{var Ue=n(f);Ue!==null&&ie(O,Ue.startTime-Y),we=!1}return we}finally{p=null,g=Q,y=!1}}var L=!1,D=null,U=-1,X=5,K=-1;function te(){return!(t.unstable_now()-K<X)}function ce(){if(D!==null){var H=t.unstable_now();K=H;var Y=!0;try{Y=D(!0,H)}finally{Y?j():(L=!1,D=null)}}else L=!1}var j;if(typeof S=="function")j=function(){S(ce)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,$=T.port2;T.port1.onmessage=ce,j=function(){$.postMessage(null)}}else j=function(){x(ce,0)};function V(H){D=H,L||(L=!0,j())}function ie(H,Y){U=x(function(){H(t.unstable_now())},Y)}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(H){H.callback=null},t.unstable_continueExecution=function(){v||y||(v=!0,V(I))},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(H){switch(g){case 1:case 2:case 3:var Y=3;break;default:Y=g}var Q=g;g=Y;try{return H()}finally{g=Q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(H,Y){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var Q=g;g=H;try{return Y()}finally{g=Q}},t.unstable_scheduleCallback=function(H,Y,Q){var oe=t.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?oe+Q:oe):Q=oe,H){case 1:var ve=-1;break;case 2:ve=250;break;case 5:ve=1073741823;break;case 4:ve=1e4;break;default:ve=5e3}return ve=Q+ve,H={id:h++,callback:Y,priorityLevel:H,startTime:Q,expirationTime:ve,sortIndex:-1},Q>oe?(H.sortIndex=Q,e(f,H),n(c)===null&&H===n(f)&&(w?(_(U),U=-1):w=!0,ie(O,Q-oe))):(H.sortIndex=ve,e(c,H),v||y||(v=!0,V(I))),H},t.unstable_shouldYield=te,t.unstable_wrapCallback=function(H){var Y=g;return function(){var Q=g;g=Y;try{return H.apply(this,arguments)}finally{g=Q}}}})(C2);(function(t){t.exports=C2})(tM);/**
* @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 x2=be,Yn=$m;function ae(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 k2=new Set,wu={};function go(t,e){Is(t,e),Is(t+"Capture",e)}function Is(t,e){for(wu[t]=e,t=0;t<e.length;t++)k2.add(e[t])}var $i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zm=Object.prototype.hasOwnProperty,nM=/^[: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]*$/,QS={},JS={};function rM(t){return zm.call(JS,t)?!0:zm.call(QS,t)?!1:nM.test(t)?JS[t]=!0:(QS[t]=!0,!1)}function iM(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 aM(t,e,n,r){if(e===null||typeof e>"u"||iM(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 wn(t,e,n,r,i,a,s){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=a,this.removeEmptyString=s}var nn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){nn[t]=new wn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];nn[e]=new wn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){nn[t]=new wn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){nn[t]=new wn(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){nn[t]=new wn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){nn[t]=new wn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){nn[t]=new wn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){nn[t]=new wn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){nn[t]=new wn(t,5,!1,t.toLowerCase(),null,!1,!1)});var _y=/[\-:]([a-z])/g;function wy(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(_y,wy);nn[e]=new wn(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(_y,wy);nn[e]=new wn(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(_y,wy);nn[e]=new wn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){nn[t]=new wn(t,1,!1,t.toLowerCase(),null,!1,!1)});nn.xlinkHref=new wn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){nn[t]=new wn(t,1,!1,t.toLowerCase(),null,!0,!0)});function by(t,e,n,r){var i=nn.hasOwnProperty(e)?nn[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(aM(e,n,i,r)&&(n=null),r||i===null?rM(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 Hi=x2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,df=Symbol.for("react.element"),ss=Symbol.for("react.portal"),ls=Symbol.for("react.fragment"),Cy=Symbol.for("react.strict_mode"),Gm=Symbol.for("react.profiler"),E2=Symbol.for("react.provider"),P2=Symbol.for("react.context"),xy=Symbol.for("react.forward_ref"),Um=Symbol.for("react.suspense"),jm=Symbol.for("react.suspense_list"),ky=Symbol.for("react.memo"),ca=Symbol.for("react.lazy"),O2=Symbol.for("react.offscreen"),ZS=Symbol.iterator;function Ol(t){return t===null||typeof t!="object"?null:(t=ZS&&t[ZS]||t["@@iterator"],typeof t=="function"?t:null)}var mt=Object.assign,jg;function Kl(t){if(jg===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);jg=e&&e[1]||""}return`
`+jg+t}var Hg=!1;function Wg(t,e){if(!t||Hg)return"";Hg=!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(`
`),a=r.stack.split(`
`),s=i.length-1,u=a.length-1;1<=s&&0<=u&&i[s]!==a[u];)u--;for(;1<=s&&0<=u;s--,u--)if(i[s]!==a[u]){if(s!==1||u!==1)do if(s--,u--,0>u||i[s]!==a[u]){var c=`
`+i[s].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=s&&0<=u);break}}}finally{Hg=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Kl(t):""}function oM(t){switch(t.tag){case 5:return Kl(t.type);case 16:return Kl("Lazy");case 13:return Kl("Suspense");case 19:return Kl("SuspenseList");case 0:case 2:case 15:return t=Wg(t.type,!1),t;case 11:return t=Wg(t.type.render,!1),t;case 1:return t=Wg(t.type,!0),t;default:return""}}function Hm(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 ls:return"Fragment";case ss:return"Portal";case Gm:return"Profiler";case Cy:return"StrictMode";case Um:return"Suspense";case jm:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case P2:return(t.displayName||"Context")+".Consumer";case E2:return(t._context.displayName||"Context")+".Provider";case xy:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ky:return e=t.displayName||null,e!==null?e:Hm(t.type)||"Memo";case ca:e=t._payload,t=t._init;try{return Hm(t(e))}catch{}}return null}function sM(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 Hm(e);case 8:return e===Cy?"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 Oa(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function T2(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function lM(t){var e=T2(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,a=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function hf(t){t._valueTracker||(t._valueTracker=lM(t))}function R2(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=T2(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function kd(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 Wm(t,e){var n=e.checked;return mt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function e_(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Oa(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 A2(t,e){e=e.checked,e!=null&&by(t,"checked",e,!1)}function Vm(t,e){A2(t,e);var n=Oa(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")?qm(t,e.type,n):e.hasOwnProperty("defaultValue")&&qm(t,e.type,Oa(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function t_(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 qm(t,e,n){(e!=="number"||kd(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Yl=Array.isArray;function _s(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=""+Oa(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 Km(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(ae(91));return mt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function n_(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(ae(92));if(Yl(n)){if(1<n.length)throw Error(ae(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Oa(n)}}function I2(t,e){var n=Oa(e.value),r=Oa(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 r_(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function L2(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 Ym(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?L2(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var pf,M2=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(pf=pf||document.createElement("div"),pf.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=pf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function bu(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ou={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},uM=["Webkit","ms","Moz","O"];Object.keys(ou).forEach(function(t){uM.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ou[e]=ou[t]})});function D2(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ou.hasOwnProperty(t)&&ou[t]?(""+e).trim():e+"px"}function N2(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=D2(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var cM=mt({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 Xm(t,e){if(e){if(cM[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ae(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ae(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ae(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ae(62))}}function Qm(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 Jm=null;function Ey(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Zm=null,ws=null,bs=null;function i_(t){if(t=Qu(t)){if(typeof Zm!="function")throw Error(ae(280));var e=t.stateNode;e&&(e=yh(e),Zm(t.stateNode,t.type,e))}}function B2(t){ws?bs?bs.push(t):bs=[t]:ws=t}function F2(){if(ws){var t=ws,e=bs;if(bs=ws=null,i_(t),e)for(t=0;t<e.length;t++)i_(e[t])}}function $2(t,e){return t(e)}function z2(){}var Vg=!1;function G2(t,e,n){if(Vg)return t(e,n);Vg=!0;try{return $2(t,e,n)}finally{Vg=!1,(ws!==null||bs!==null)&&(z2(),F2())}}function Cu(t,e){var n=t.stateNode;if(n===null)return null;var r=yh(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(ae(231,e,typeof n));return n}var ev=!1;if($i)try{var Tl={};Object.defineProperty(Tl,"passive",{get:function(){ev=!0}}),window.addEventListener("test",Tl,Tl),window.removeEventListener("test",Tl,Tl)}catch{ev=!1}function fM(t,e,n,r,i,a,s,u,c){var f=Array.prototype.slice.call(arguments,3);try{e.apply(n,f)}catch(h){this.onError(h)}}var su=!1,Ed=null,Pd=!1,tv=null,dM={onError:function(t){su=!0,Ed=t}};function hM(t,e,n,r,i,a,s,u,c){su=!1,Ed=null,fM.apply(dM,arguments)}function pM(t,e,n,r,i,a,s,u,c){if(hM.apply(this,arguments),su){if(su){var f=Ed;su=!1,Ed=null}else throw Error(ae(198));Pd||(Pd=!0,tv=f)}}function mo(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 U2(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 a_(t){if(mo(t)!==t)throw Error(ae(188))}function gM(t){var e=t.alternate;if(!e){if(e=mo(t),e===null)throw Error(ae(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return a_(i),t;if(a===r)return a_(i),e;a=a.sibling}throw Error(ae(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,u=i.child;u;){if(u===n){s=!0,n=i,r=a;break}if(u===r){s=!0,r=i,n=a;break}u=u.sibling}if(!s){for(u=a.child;u;){if(u===n){s=!0,n=a,r=i;break}if(u===r){s=!0,r=a,n=i;break}u=u.sibling}if(!s)throw Error(ae(189))}}if(n.alternate!==r)throw Error(ae(190))}if(n.tag!==3)throw Error(ae(188));return n.stateNode.current===n?t:e}function j2(t){return t=gM(t),t!==null?H2(t):null}function H2(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=H2(t);if(e!==null)return e;t=t.sibling}return null}var W2=Yn.unstable_scheduleCallback,o_=Yn.unstable_cancelCallback,mM=Yn.unstable_shouldYield,vM=Yn.unstable_requestPaint,Et=Yn.unstable_now,yM=Yn.unstable_getCurrentPriorityLevel,Py=Yn.unstable_ImmediatePriority,V2=Yn.unstable_UserBlockingPriority,Od=Yn.unstable_NormalPriority,SM=Yn.unstable_LowPriority,q2=Yn.unstable_IdlePriority,ph=null,oi=null;function _M(t){if(oi&&typeof oi.onCommitFiberRoot=="function")try{oi.onCommitFiberRoot(ph,t,void 0,(t.current.flags&128)===128)}catch{}}var Fr=Math.clz32?Math.clz32:CM,wM=Math.log,bM=Math.LN2;function CM(t){return t>>>=0,t===0?32:31-(wM(t)/bM|0)|0}var gf=64,mf=4194304;function Xl(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 Td(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,a=t.pingedLanes,s=n&268435455;if(s!==0){var u=s&~i;u!==0?r=Xl(u):(a&=s,a!==0&&(r=Xl(a)))}else s=n&~i,s!==0?r=Xl(s):a!==0&&(r=Xl(a));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,a=e&-e,i>=a||i===16&&(a&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-Fr(e),i=1<<n,r|=t[n],e&=~i;return r}function xM(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 kM(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,a=t.pendingLanes;0<a;){var s=31-Fr(a),u=1<<s,c=i[s];c===-1?(!(u&n)||u&r)&&(i[s]=xM(u,e)):c<=e&&(t.expiredLanes|=u),a&=~u}}function nv(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function K2(){var t=gf;return gf<<=1,!(gf&4194240)&&(gf=64),t}function qg(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Yu(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Fr(e),t[e]=n}function EM(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-Fr(n),a=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~a}}function Oy(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Fr(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Qe=0;function Y2(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var X2,Ty,Q2,J2,Z2,rv=!1,vf=[],ya=null,Sa=null,_a=null,xu=new Map,ku=new Map,da=[],PM="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 s_(t,e){switch(t){case"focusin":case"focusout":ya=null;break;case"dragenter":case"dragleave":Sa=null;break;case"mouseover":case"mouseout":_a=null;break;case"pointerover":case"pointerout":xu.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ku.delete(e.pointerId)}}function Rl(t,e,n,r,i,a){return t===null||t.nativeEvent!==a?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},e!==null&&(e=Qu(e),e!==null&&Ty(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function OM(t,e,n,r,i){switch(e){case"focusin":return ya=Rl(ya,t,e,n,r,i),!0;case"dragenter":return Sa=Rl(Sa,t,e,n,r,i),!0;case"mouseover":return _a=Rl(_a,t,e,n,r,i),!0;case"pointerover":var a=i.pointerId;return xu.set(a,Rl(xu.get(a)||null,t,e,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,ku.set(a,Rl(ku.get(a)||null,t,e,n,r,i)),!0}return!1}function eC(t){var e=to(t.target);if(e!==null){var n=mo(e);if(n!==null){if(e=n.tag,e===13){if(e=U2(n),e!==null){t.blockedOn=e,Z2(t.priority,function(){Q2(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 Jf(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=iv(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Jm=r,n.target.dispatchEvent(r),Jm=null}else return e=Qu(n),e!==null&&Ty(e),t.blockedOn=n,!1;e.shift()}return!0}function l_(t,e,n){Jf(t)&&n.delete(e)}function TM(){rv=!1,ya!==null&&Jf(ya)&&(ya=null),Sa!==null&&Jf(Sa)&&(Sa=null),_a!==null&&Jf(_a)&&(_a=null),xu.forEach(l_),ku.forEach(l_)}function Al(t,e){t.blockedOn===e&&(t.blockedOn=null,rv||(rv=!0,Yn.unstable_scheduleCallback(Yn.unstable_NormalPriority,TM)))}function Eu(t){function e(i){return Al(i,t)}if(0<vf.length){Al(vf[0],t);for(var n=1;n<vf.length;n++){var r=vf[n];r.blockedOn===t&&(r.blockedOn=null)}}for(ya!==null&&Al(ya,t),Sa!==null&&Al(Sa,t),_a!==null&&Al(_a,t),xu.forEach(e),ku.forEach(e),n=0;n<da.length;n++)r=da[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<da.length&&(n=da[0],n.blockedOn===null);)eC(n),n.blockedOn===null&&da.shift()}var Cs=Hi.ReactCurrentBatchConfig,Rd=!0;function RM(t,e,n,r){var i=Qe,a=Cs.transition;Cs.transition=null;try{Qe=1,Ry(t,e,n,r)}finally{Qe=i,Cs.transition=a}}function AM(t,e,n,r){var i=Qe,a=Cs.transition;Cs.transition=null;try{Qe=4,Ry(t,e,n,r)}finally{Qe=i,Cs.transition=a}}function Ry(t,e,n,r){if(Rd){var i=iv(t,e,n,r);if(i===null)rm(t,e,r,Ad,n),s_(t,r);else if(OM(i,t,e,n,r))r.stopPropagation();else if(s_(t,r),e&4&&-1<PM.indexOf(t)){for(;i!==null;){var a=Qu(i);if(a!==null&&X2(a),a=iv(t,e,n,r),a===null&&rm(t,e,r,Ad,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else rm(t,e,r,null,n)}}var Ad=null;function iv(t,e,n,r){if(Ad=null,t=Ey(r),t=to(t),t!==null)if(e=mo(t),e===null)t=null;else if(n=e.tag,n===13){if(t=U2(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 Ad=t,null}function tC(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(yM()){case Py:return 1;case V2:return 4;case Od:case SM:return 16;case q2:return 536870912;default:return 16}default:return 16}}var ga=null,Ay=null,Zf=null;function nC(){if(Zf)return Zf;var t,e=Ay,n=e.length,r,i="value"in ga?ga.value:ga.textContent,a=i.length;for(t=0;t<n&&e[t]===i[t];t++);var s=n-t;for(r=1;r<=s&&e[n-r]===i[a-r];r++);return Zf=i.slice(t,1<r?1-r:void 0)}function ed(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 yf(){return!0}function u_(){return!1}function Jn(t){function e(n,r,i,a,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var u in t)t.hasOwnProperty(u)&&(n=t[u],this[u]=n?n(a):a[u]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?yf:u_,this.isPropagationStopped=u_,this}return mt(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=yf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=yf)},persist:function(){},isPersistent:yf}),e}var js={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Iy=Jn(js),Xu=mt({},js,{view:0,detail:0}),IM=Jn(Xu),Kg,Yg,Il,gh=mt({},Xu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ly,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!==Il&&(Il&&t.type==="mousemove"?(Kg=t.screenX-Il.screenX,Yg=t.screenY-Il.screenY):Yg=Kg=0,Il=t),Kg)},movementY:function(t){return"movementY"in t?t.movementY:Yg}}),c_=Jn(gh),LM=mt({},gh,{dataTransfer:0}),MM=Jn(LM),DM=mt({},Xu,{relatedTarget:0}),Xg=Jn(DM),NM=mt({},js,{animationName:0,elapsedTime:0,pseudoElement:0}),BM=Jn(NM),FM=mt({},js,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),$M=Jn(FM),zM=mt({},js,{data:0}),f_=Jn(zM),GM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},UM={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"},jM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HM(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=jM[t])?!!e[t]:!1}function Ly(){return HM}var WM=mt({},Xu,{key:function(t){if(t.key){var e=GM[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ed(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?UM[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ly,charCode:function(t){return t.type==="keypress"?ed(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ed(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),VM=Jn(WM),qM=mt({},gh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),d_=Jn(qM),KM=mt({},Xu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ly}),YM=Jn(KM),XM=mt({},js,{propertyName:0,elapsedTime:0,pseudoElement:0}),QM=Jn(XM),JM=mt({},gh,{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}),ZM=Jn(JM),eD=[9,13,27,32],My=$i&&"CompositionEvent"in window,lu=null;$i&&"documentMode"in document&&(lu=document.documentMode);var tD=$i&&"TextEvent"in window&&!lu,rC=$i&&(!My||lu&&8<lu&&11>=lu),h_=String.fromCharCode(32),p_=!1;function iC(t,e){switch(t){case"keyup":return eD.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aC(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var us=!1;function nD(t,e){switch(t){case"compositionend":return aC(e);case"keypress":return e.which!==32?null:(p_=!0,h_);case"textInput":return t=e.data,t===h_&&p_?null:t;default:return null}}function rD(t,e){if(us)return t==="compositionend"||!My&&iC(t,e)?(t=nC(),Zf=Ay=ga=null,us=!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 rC&&e.locale!=="ko"?null:e.data;default:return null}}var iD={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 g_(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!iD[t.type]:e==="textarea"}function oC(t,e,n,r){B2(r),e=Id(e,"onChange"),0<e.length&&(n=new Iy("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var uu=null,Pu=null;function aD(t){vC(t,0)}function mh(t){var e=ds(t);if(R2(e))return t}function oD(t,e){if(t==="change")return e}var sC=!1;if($i){var Qg;if($i){var Jg="oninput"in document;if(!Jg){var m_=document.createElement("div");m_.setAttribute("oninput","return;"),Jg=typeof m_.oninput=="function"}Qg=Jg}else Qg=!1;sC=Qg&&(!document.documentMode||9<document.documentMode)}function v_(){uu&&(uu.detachEvent("onpropertychange",lC),Pu=uu=null)}function lC(t){if(t.propertyName==="value"&&mh(Pu)){var e=[];oC(e,Pu,t,Ey(t)),G2(aD,e)}}function sD(t,e,n){t==="focusin"?(v_(),uu=e,Pu=n,uu.attachEvent("onpropertychange",lC)):t==="focusout"&&v_()}function lD(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return mh(Pu)}function uD(t,e){if(t==="click")return mh(e)}function cD(t,e){if(t==="input"||t==="change")return mh(e)}function fD(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Gr=typeof Object.is=="function"?Object.is:fD;function Ou(t,e){if(Gr(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(!zm.call(e,i)||!Gr(t[i],e[i]))return!1}return!0}function y_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function S_(t,e){var n=y_(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=y_(n)}}function uC(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?uC(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function cC(){for(var t=window,e=kd();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=kd(t.document)}return e}function Dy(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 dD(t){var e=cC(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&uC(n.ownerDocument.documentElement,n)){if(r!==null&&Dy(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,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!t.extend&&a>r&&(i=r,r=a,a=i),i=S_(n,a);var s=S_(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),a>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.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 hD=$i&&"documentMode"in document&&11>=document.documentMode,cs=null,av=null,cu=null,ov=!1;function __(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ov||cs==null||cs!==kd(r)||(r=cs,"selectionStart"in r&&Dy(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}),cu&&Ou(cu,r)||(cu=r,r=Id(av,"onSelect"),0<r.length&&(e=new Iy("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=cs)))}function Sf(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var fs={animationend:Sf("Animation","AnimationEnd"),animationiteration:Sf("Animation","AnimationIteration"),animationstart:Sf("Animation","AnimationStart"),transitionend:Sf("Transition","TransitionEnd")},Zg={},fC={};$i&&(fC=document.createElement("div").style,"AnimationEvent"in window||(delete fs.animationend.animation,delete fs.animationiteration.animation,delete fs.animationstart.animation),"TransitionEvent"in window||delete fs.transitionend.transition);function vh(t){if(Zg[t])return Zg[t];if(!fs[t])return t;var e=fs[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in fC)return Zg[t]=e[n];return t}var dC=vh("animationend"),hC=vh("animationiteration"),pC=vh("animationstart"),gC=vh("transitionend"),mC=new Map,w_="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 Ia(t,e){mC.set(t,e),go(e,[t])}for(var em=0;em<w_.length;em++){var tm=w_[em],pD=tm.toLowerCase(),gD=tm[0].toUpperCase()+tm.slice(1);Ia(pD,"on"+gD)}Ia(dC,"onAnimationEnd");Ia(hC,"onAnimationIteration");Ia(pC,"onAnimationStart");Ia("dblclick","onDoubleClick");Ia("focusin","onFocus");Ia("focusout","onBlur");Ia(gC,"onTransitionEnd");Is("onMouseEnter",["mouseout","mouseover"]);Is("onMouseLeave",["mouseout","mouseover"]);Is("onPointerEnter",["pointerout","pointerover"]);Is("onPointerLeave",["pointerout","pointerover"]);go("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));go("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));go("onBeforeInput",["compositionend","keypress","textInput","paste"]);go("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));go("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));go("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ql="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(" "),mD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ql));function b_(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,pM(r,e,void 0,t),t.currentTarget=null}function vC(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 a=void 0;if(e)for(var s=r.length-1;0<=s;s--){var u=r[s],c=u.instance,f=u.currentTarget;if(u=u.listener,c!==a&&i.isPropagationStopped())break e;b_(i,u,f),a=c}else for(s=0;s<r.length;s++){if(u=r[s],c=u.instance,f=u.currentTarget,u=u.listener,c!==a&&i.isPropagationStopped())break e;b_(i,u,f),a=c}}}if(Pd)throw t=tv,Pd=!1,tv=null,t}function ot(t,e){var n=e[fv];n===void 0&&(n=e[fv]=new Set);var r=t+"__bubble";n.has(r)||(yC(e,t,2,!1),n.add(r))}function nm(t,e,n){var r=0;e&&(r|=4),yC(n,t,r,e)}var _f="_reactListening"+Math.random().toString(36).slice(2);function Tu(t){if(!t[_f]){t[_f]=!0,k2.forEach(function(n){n!=="selectionchange"&&(mD.has(n)||nm(n,!1,t),nm(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[_f]||(e[_f]=!0,nm("selectionchange",!1,e))}}function yC(t,e,n,r){switch(tC(e)){case 1:var i=RM;break;case 4:i=AM;break;default:i=Ry}n=i.bind(null,e,n,t),i=void 0,!ev||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 rm(t,e,n,r,i){var a=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var u=r.stateNode.containerInfo;if(u===i||u.nodeType===8&&u.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;s=s.return}for(;u!==null;){if(s=to(u),s===null)return;if(c=s.tag,c===5||c===6){r=a=s;continue e}u=u.parentNode}}r=r.return}G2(function(){var f=a,h=Ey(n),p=[];e:{var g=mC.get(t);if(g!==void 0){var y=Iy,v=t;switch(t){case"keypress":if(ed(n)===0)break e;case"keydown":case"keyup":y=VM;break;case"focusin":v="focus",y=Xg;break;case"focusout":v="blur",y=Xg;break;case"beforeblur":case"afterblur":y=Xg;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":y=c_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=MM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=YM;break;case dC:case hC:case pC:y=BM;break;case gC:y=QM;break;case"scroll":y=IM;break;case"wheel":y=ZM;break;case"copy":case"cut":case"paste":y=$M;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=d_}var w=(e&4)!==0,x=!w&&t==="scroll",_=w?g!==null?g+"Capture":null:g;w=[];for(var S=f,C;S!==null;){C=S;var O=C.stateNode;if(C.tag===5&&O!==null&&(C=O,_!==null&&(O=Cu(S,_),O!=null&&w.push(Ru(S,O,C)))),x)break;S=S.return}0<w.length&&(g=new y(g,v,null,n,h),p.push({event:g,listeners:w}))}}if(!(e&7)){e:{if(g=t==="mouseover"||t==="pointerover",y=t==="mouseout"||t==="pointerout",g&&n!==Jm&&(v=n.relatedTarget||n.fromElement)&&(to(v)||v[zi]))break e;if((y||g)&&(g=h.window===h?h:(g=h.ownerDocument)?g.defaultView||g.parentWindow:window,y?(v=n.relatedTarget||n.toElement,y=f,v=v?to(v):null,v!==null&&(x=mo(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(y=null,v=f),y!==v)){if(w=c_,O="onMouseLeave",_="onMouseEnter",S="mouse",(t==="pointerout"||t==="pointerover")&&(w=d_,O="onPointerLeave",_="onPointerEnter",S="pointer"),x=y==null?g:ds(y),C=v==null?g:ds(v),g=new w(O,S+"leave",y,n,h),g.target=x,g.relatedTarget=C,O=null,to(h)===f&&(w=new w(_,S+"enter",v,n,h),w.target=C,w.relatedTarget=x,O=w),x=O,y&&v)t:{for(w=y,_=v,S=0,C=w;C;C=Qo(C))S++;for(C=0,O=_;O;O=Qo(O))C++;for(;0<S-C;)w=Qo(w),S--;for(;0<C-S;)_=Qo(_),C--;for(;S--;){if(w===_||_!==null&&w===_.alternate)break t;w=Qo(w),_=Qo(_)}w=null}else w=null;y!==null&&C_(p,g,y,w,!1),v!==null&&x!==null&&C_(p,x,v,w,!0)}}e:{if(g=f?ds(f):window,y=g.nodeName&&g.nodeName.toLowerCase(),y==="select"||y==="input"&&g.type==="file")var I=oD;else if(g_(g))if(sC)I=cD;else{I=lD;var L=sD}else(y=g.nodeName)&&y.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(I=uD);if(I&&(I=I(t,f))){oC(p,I,n,h);break e}L&&L(t,g,f),t==="focusout"&&(L=g._wrapperState)&&L.controlled&&g.type==="number"&&qm(g,"number",g.value)}switch(L=f?ds(f):window,t){case"focusin":(g_(L)||L.contentEditable==="true")&&(cs=L,av=f,cu=null);break;case"focusout":cu=av=cs=null;break;case"mousedown":ov=!0;break;case"contextmenu":case"mouseup":case"dragend":ov=!1,__(p,n,h);break;case"selectionchange":if(hD)break;case"keydown":case"keyup":__(p,n,h)}var D;if(My)e:{switch(t){case"compositionstart":var U="onCompositionStart";break e;case"compositionend":U="onCompositionEnd";break e;case"compositionupdate":U="onCompositionUpdate";break e}U=void 0}else us?iC(t,n)&&(U="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(U="onCompositionStart");U&&(rC&&n.locale!=="ko"&&(us||U!=="onCompositionStart"?U==="onCompositionEnd"&&us&&(D=nC()):(ga=h,Ay="value"in ga?ga.value:ga.textContent,us=!0)),L=Id(f,U),0<L.length&&(U=new f_(U,t,null,n,h),p.push({event:U,listeners:L}),D?U.data=D:(D=aC(n),D!==null&&(U.data=D)))),(D=tD?nD(t,n):rD(t,n))&&(f=Id(f,"onBeforeInput"),0<f.length&&(h=new f_("onBeforeInput","beforeinput",null,n,h),p.push({event:h,listeners:f}),h.data=D))}vC(p,e)})}function Ru(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Id(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Cu(t,n),a!=null&&r.unshift(Ru(t,a,i)),a=Cu(t,e),a!=null&&r.push(Ru(t,a,i))),t=t.return}return r}function Qo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function C_(t,e,n,r,i){for(var a=e._reactName,s=[];n!==null&&n!==r;){var u=n,c=u.alternate,f=u.stateNode;if(c!==null&&c===r)break;u.tag===5&&f!==null&&(u=f,i?(c=Cu(n,a),c!=null&&s.unshift(Ru(n,c,u))):i||(c=Cu(n,a),c!=null&&s.push(Ru(n,c,u)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var vD=/\r\n?/g,yD=/\u0000|\uFFFD/g;function x_(t){return(typeof t=="string"?t:""+t).replace(vD,`
`).replace(yD,"")}function wf(t,e,n){if(e=x_(e),x_(t)!==e&&n)throw Error(ae(425))}function Ld(){}var sv=null,lv=null;function uv(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 cv=typeof setTimeout=="function"?setTimeout:void 0,SD=typeof clearTimeout=="function"?clearTimeout:void 0,k_=typeof Promise=="function"?Promise:void 0,_D=typeof queueMicrotask=="function"?queueMicrotask:typeof k_<"u"?function(t){return k_.resolve(null).then(t).catch(wD)}:cv;function wD(t){setTimeout(function(){throw t})}function im(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),Eu(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Eu(e)}function wa(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 E_(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 Hs=Math.random().toString(36).slice(2),ri="__reactFiber$"+Hs,Au="__reactProps$"+Hs,zi="__reactContainer$"+Hs,fv="__reactEvents$"+Hs,bD="__reactListeners$"+Hs,CD="__reactHandles$"+Hs;function to(t){var e=t[ri];if(e)return e;for(var n=t.parentNode;n;){if(e=n[zi]||n[ri]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=E_(t);t!==null;){if(n=t[ri])return n;t=E_(t)}return e}t=n,n=t.parentNode}return null}function Qu(t){return t=t[ri]||t[zi],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ds(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(ae(33))}function yh(t){return t[Au]||null}var dv=[],hs=-1;function La(t){return{current:t}}function lt(t){0>hs||(t.current=dv[hs],dv[hs]=null,hs--)}function at(t,e){hs++,dv[hs]=t.current,t.current=e}var Ta={},fn=La(Ta),Rn=La(!1),so=Ta;function Ls(t,e){var n=t.type.contextTypes;if(!n)return Ta;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=e[a];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function An(t){return t=t.childContextTypes,t!=null}function Md(){lt(Rn),lt(fn)}function P_(t,e,n){if(fn.current!==Ta)throw Error(ae(168));at(fn,e),at(Rn,n)}function SC(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(ae(108,sM(t)||"Unknown",i));return mt({},n,r)}function Dd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ta,so=fn.current,at(fn,t),at(Rn,Rn.current),!0}function O_(t,e,n){var r=t.stateNode;if(!r)throw Error(ae(169));n?(t=SC(t,e,so),r.__reactInternalMemoizedMergedChildContext=t,lt(Rn),lt(fn),at(fn,t)):lt(Rn),at(Rn,n)}var Mi=null,Sh=!1,am=!1;function _C(t){Mi===null?Mi=[t]:Mi.push(t)}function xD(t){Sh=!0,_C(t)}function Ma(){if(!am&&Mi!==null){am=!0;var t=0,e=Qe;try{var n=Mi;for(Qe=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Mi=null,Sh=!1}catch(i){throw Mi!==null&&(Mi=Mi.slice(t+1)),W2(Py,Ma),i}finally{Qe=e,am=!1}}return null}var ps=[],gs=0,Nd=null,Bd=0,ur=[],cr=0,lo=null,Di=1,Ni="";function Qa(t,e){ps[gs++]=Bd,ps[gs++]=Nd,Nd=t,Bd=e}function wC(t,e,n){ur[cr++]=Di,ur[cr++]=Ni,ur[cr++]=lo,lo=t;var r=Di;t=Ni;var i=32-Fr(r)-1;r&=~(1<<i),n+=1;var a=32-Fr(e)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Di=1<<32-Fr(e)+i|n<<i|r,Ni=a+t}else Di=1<<a|n<<i|r,Ni=t}function Ny(t){t.return!==null&&(Qa(t,1),wC(t,1,0))}function By(t){for(;t===Nd;)Nd=ps[--gs],ps[gs]=null,Bd=ps[--gs],ps[gs]=null;for(;t===lo;)lo=ur[--cr],ur[cr]=null,Ni=ur[--cr],ur[cr]=null,Di=ur[--cr],ur[cr]=null}var Vn=null,Wn=null,ft=!1,Nr=null;function bC(t,e){var n=hr(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 T_(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,Vn=t,Wn=wa(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Vn=t,Wn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=lo!==null?{id:Di,overflow:Ni}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=hr(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Vn=t,Wn=null,!0):!1;default:return!1}}function hv(t){return(t.mode&1)!==0&&(t.flags&128)===0}function pv(t){if(ft){var e=Wn;if(e){var n=e;if(!T_(t,e)){if(hv(t))throw Error(ae(418));e=wa(n.nextSibling);var r=Vn;e&&T_(t,e)?bC(r,n):(t.flags=t.flags&-4097|2,ft=!1,Vn=t)}}else{if(hv(t))throw Error(ae(418));t.flags=t.flags&-4097|2,ft=!1,Vn=t}}}function R_(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Vn=t}function bf(t){if(t!==Vn)return!1;if(!ft)return R_(t),ft=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!uv(t.type,t.memoizedProps)),e&&(e=Wn)){if(hv(t))throw CC(),Error(ae(418));for(;e;)bC(t,e),e=wa(e.nextSibling)}if(R_(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(ae(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Wn=wa(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Wn=null}}else Wn=Vn?wa(t.stateNode.nextSibling):null;return!0}function CC(){for(var t=Wn;t;)t=wa(t.nextSibling)}function Ms(){Wn=Vn=null,ft=!1}function Fy(t){Nr===null?Nr=[t]:Nr.push(t)}var kD=Hi.ReactCurrentBatchConfig;function Lr(t,e){if(t&&t.defaultProps){e=mt({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}var Fd=La(null),$d=null,ms=null,$y=null;function zy(){$y=ms=$d=null}function Gy(t){var e=Fd.current;lt(Fd),t._currentValue=e}function gv(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 xs(t,e){$d=t,$y=ms=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Tn=!0),t.firstContext=null)}function mr(t){var e=t._currentValue;if($y!==t)if(t={context:t,memoizedValue:e,next:null},ms===null){if($d===null)throw Error(ae(308));ms=t,$d.dependencies={lanes:0,firstContext:t}}else ms=ms.next=t;return e}var no=null;function Uy(t){no===null?no=[t]:no.push(t)}function xC(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Uy(e)):(n.next=i.next,i.next=n),e.interleaved=n,Gi(t,r)}function Gi(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 fa=!1;function jy(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function kC(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 Bi(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ba(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,$e&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Gi(t,n)}return i=r.interleaved,i===null?(e.next=e,Uy(r)):(e.next=i.next,i.next=e),r.interleaved=e,Gi(t,n)}function td(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,Oy(t,n)}}function A_(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?i=a=e:a=a.next=e}else i=a=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,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 zd(t,e,n,r){var i=t.updateQueue;fa=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,u=i.shared.pending;if(u!==null){i.shared.pending=null;var c=u,f=c.next;c.next=null,s===null?a=f:s.next=f,s=c;var h=t.alternate;h!==null&&(h=h.updateQueue,u=h.lastBaseUpdate,u!==s&&(u===null?h.firstBaseUpdate=f:u.next=f,h.lastBaseUpdate=c))}if(a!==null){var p=i.baseState;s=0,h=f=c=null,u=a;do{var g=u.lane,y=u.eventTime;if((r&g)===g){h!==null&&(h=h.next={eventTime:y,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var v=t,w=u;switch(g=e,y=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){p=v.call(y,p,g);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,g=typeof v=="function"?v.call(y,p,g):v,g==null)break e;p=mt({},p,g);break e;case 2:fa=!0}}u.callback!==null&&u.lane!==0&&(t.flags|=64,g=i.effects,g===null?i.effects=[u]:g.push(u))}else y={eventTime:y,lane:g,tag:u.tag,payload:u.payload,callback:u.callback,next:null},h===null?(f=h=y,c=p):h=h.next=y,s|=g;if(u=u.next,u===null){if(u=i.shared.pending,u===null)break;g=u,u=g.next,g.next=null,i.lastBaseUpdate=g,i.shared.pending=null}}while(1);if(h===null&&(c=p),i.baseState=c,i.firstBaseUpdate=f,i.lastBaseUpdate=h,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else a===null&&(i.shared.lanes=0);co|=s,t.lanes=s,t.memoizedState=p}}function I_(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(ae(191,i));i.call(r)}}}var EC=new x2.Component().refs;function mv(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:mt({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var _h={isMounted:function(t){return(t=t._reactInternals)?mo(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=Sn(),i=xa(t),a=Bi(r,i);a.payload=e,n!=null&&(a.callback=n),e=ba(t,a,i),e!==null&&($r(e,t,i,r),td(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=Sn(),i=xa(t),a=Bi(r,i);a.tag=1,a.payload=e,n!=null&&(a.callback=n),e=ba(t,a,i),e!==null&&($r(e,t,i,r),td(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Sn(),r=xa(t),i=Bi(n,r);i.tag=2,e!=null&&(i.callback=e),e=ba(t,i,r),e!==null&&($r(e,t,r,n),td(e,t,r))}};function L_(t,e,n,r,i,a,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,a,s):e.prototype&&e.prototype.isPureReactComponent?!Ou(n,r)||!Ou(i,a):!0}function PC(t,e,n){var r=!1,i=Ta,a=e.contextType;return typeof a=="object"&&a!==null?a=mr(a):(i=An(e)?so:fn.current,r=e.contextTypes,a=(r=r!=null)?Ls(t,i):Ta),e=new e(n,a),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=_h,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=a),e}function M_(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&&_h.enqueueReplaceState(e,e.state,null)}function vv(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs=EC,jy(t);var a=e.contextType;typeof a=="object"&&a!==null?i.context=mr(a):(a=An(e)?so:fn.current,i.context=Ls(t,a)),i.state=t.memoizedState,a=e.getDerivedStateFromProps,typeof a=="function"&&(mv(t,e,a,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&&_h.enqueueReplaceState(i,i.state,null),zd(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Ll(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(ae(309));var r=n.stateNode}if(!r)throw Error(ae(147,t));var i=r,a=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===a?e.ref:(e=function(s){var u=i.refs;u===EC&&(u=i.refs={}),s===null?delete u[a]:u[a]=s},e._stringRef=a,e)}if(typeof t!="string")throw Error(ae(284));if(!n._owner)throw Error(ae(290,t))}return t}function Cf(t,e){throw t=Object.prototype.toString.call(e),Error(ae(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function D_(t){var e=t._init;return e(t._payload)}function OC(t){function e(_,S){if(t){var C=_.deletions;C===null?(_.deletions=[S],_.flags|=16):C.push(S)}}function n(_,S){if(!t)return null;for(;S!==null;)e(_,S),S=S.sibling;return null}function r(_,S){for(_=new Map;S!==null;)S.key!==null?_.set(S.key,S):_.set(S.index,S),S=S.sibling;return _}function i(_,S){return _=ka(_,S),_.index=0,_.sibling=null,_}function a(_,S,C){return _.index=C,t?(C=_.alternate,C!==null?(C=C.index,C<S?(_.flags|=2,S):C):(_.flags|=2,S)):(_.flags|=1048576,S)}function s(_){return t&&_.alternate===null&&(_.flags|=2),_}function u(_,S,C,O){return S===null||S.tag!==6?(S=dm(C,_.mode,O),S.return=_,S):(S=i(S,C),S.return=_,S)}function c(_,S,C,O){var I=C.type;return I===ls?h(_,S,C.props.children,O,C.key):S!==null&&(S.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===ca&&D_(I)===S.type)?(O=i(S,C.props),O.ref=Ll(_,S,C),O.return=_,O):(O=sd(C.type,C.key,C.props,null,_.mode,O),O.ref=Ll(_,S,C),O.return=_,O)}function f(_,S,C,O){return S===null||S.tag!==4||S.stateNode.containerInfo!==C.containerInfo||S.stateNode.implementation!==C.implementation?(S=hm(C,_.mode,O),S.return=_,S):(S=i(S,C.children||[]),S.return=_,S)}function h(_,S,C,O,I){return S===null||S.tag!==7?(S=oo(C,_.mode,O,I),S.return=_,S):(S=i(S,C),S.return=_,S)}function p(_,S,C){if(typeof S=="string"&&S!==""||typeof S=="number")return S=dm(""+S,_.mode,C),S.return=_,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case df:return C=sd(S.type,S.key,S.props,null,_.mode,C),C.ref=Ll(_,null,S),C.return=_,C;case ss:return S=hm(S,_.mode,C),S.return=_,S;case ca:var O=S._init;return p(_,O(S._payload),C)}if(Yl(S)||Ol(S))return S=oo(S,_.mode,C,null),S.return=_,S;Cf(_,S)}return null}function g(_,S,C,O){var I=S!==null?S.key:null;if(typeof C=="string"&&C!==""||typeof C=="number")return I!==null?null:u(_,S,""+C,O);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case df:return C.key===I?c(_,S,C,O):null;case ss:return C.key===I?f(_,S,C,O):null;case ca:return I=C._init,g(_,S,I(C._payload),O)}if(Yl(C)||Ol(C))return I!==null?null:h(_,S,C,O,null);Cf(_,C)}return null}function y(_,S,C,O,I){if(typeof O=="string"&&O!==""||typeof O=="number")return _=_.get(C)||null,u(S,_,""+O,I);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case df:return _=_.get(O.key===null?C:O.key)||null,c(S,_,O,I);case ss:return _=_.get(O.key===null?C:O.key)||null,f(S,_,O,I);case ca:var L=O._init;return y(_,S,C,L(O._payload),I)}if(Yl(O)||Ol(O))return _=_.get(C)||null,h(S,_,O,I,null);Cf(S,O)}return null}function v(_,S,C,O){for(var I=null,L=null,D=S,U=S=0,X=null;D!==null&&U<C.length;U++){D.index>U?(X=D,D=null):X=D.sibling;var K=g(_,D,C[U],O);if(K===null){D===null&&(D=X);break}t&&D&&K.alternate===null&&e(_,D),S=a(K,S,U),L===null?I=K:L.sibling=K,L=K,D=X}if(U===C.length)return n(_,D),ft&&Qa(_,U),I;if(D===null){for(;U<C.length;U++)D=p(_,C[U],O),D!==null&&(S=a(D,S,U),L===null?I=D:L.sibling=D,L=D);return ft&&Qa(_,U),I}for(D=r(_,D);U<C.length;U++)X=y(D,_,U,C[U],O),X!==null&&(t&&X.alternate!==null&&D.delete(X.key===null?U:X.key),S=a(X,S,U),L===null?I=X:L.sibling=X,L=X);return t&&D.forEach(function(te){return e(_,te)}),ft&&Qa(_,U),I}function w(_,S,C,O){var I=Ol(C);if(typeof I!="function")throw Error(ae(150));if(C=I.call(C),C==null)throw Error(ae(151));for(var L=I=null,D=S,U=S=0,X=null,K=C.next();D!==null&&!K.done;U++,K=C.next()){D.index>U?(X=D,D=null):X=D.sibling;var te=g(_,D,K.value,O);if(te===null){D===null&&(D=X);break}t&&D&&te.alternate===null&&e(_,D),S=a(te,S,U),L===null?I=te:L.sibling=te,L=te,D=X}if(K.done)return n(_,D),ft&&Qa(_,U),I;if(D===null){for(;!K.done;U++,K=C.next())K=p(_,K.value,O),K!==null&&(S=a(K,S,U),L===null?I=K:L.sibling=K,L=K);return ft&&Qa(_,U),I}for(D=r(_,D);!K.done;U++,K=C.next())K=y(D,_,U,K.value,O),K!==null&&(t&&K.alternate!==null&&D.delete(K.key===null?U:K.key),S=a(K,S,U),L===null?I=K:L.sibling=K,L=K);return t&&D.forEach(function(ce){return e(_,ce)}),ft&&Qa(_,U),I}function x(_,S,C,O){if(typeof C=="object"&&C!==null&&C.type===ls&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case df:e:{for(var I=C.key,L=S;L!==null;){if(L.key===I){if(I=C.type,I===ls){if(L.tag===7){n(_,L.sibling),S=i(L,C.props.children),S.return=_,_=S;break e}}else if(L.elementType===I||typeof I=="object"&&I!==null&&I.$$typeof===ca&&D_(I)===L.type){n(_,L.sibling),S=i(L,C.props),S.ref=Ll(_,L,C),S.return=_,_=S;break e}n(_,L);break}else e(_,L);L=L.sibling}C.type===ls?(S=oo(C.props.children,_.mode,O,C.key),S.return=_,_=S):(O=sd(C.type,C.key,C.props,null,_.mode,O),O.ref=Ll(_,S,C),O.return=_,_=O)}return s(_);case ss:e:{for(L=C.key;S!==null;){if(S.key===L)if(S.tag===4&&S.stateNode.containerInfo===C.containerInfo&&S.stateNode.implementation===C.implementation){n(_,S.sibling),S=i(S,C.children||[]),S.return=_,_=S;break e}else{n(_,S);break}else e(_,S);S=S.sibling}S=hm(C,_.mode,O),S.return=_,_=S}return s(_);case ca:return L=C._init,x(_,S,L(C._payload),O)}if(Yl(C))return v(_,S,C,O);if(Ol(C))return w(_,S,C,O);Cf(_,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,S!==null&&S.tag===6?(n(_,S.sibling),S=i(S,C),S.return=_,_=S):(n(_,S),S=dm(C,_.mode,O),S.return=_,_=S),s(_)):n(_,S)}return x}var Ds=OC(!0),TC=OC(!1),Ju={},si=La(Ju),Iu=La(Ju),Lu=La(Ju);function ro(t){if(t===Ju)throw Error(ae(174));return t}function Hy(t,e){switch(at(Lu,e),at(Iu,t),at(si,Ju),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Ym(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Ym(e,t)}lt(si),at(si,e)}function Ns(){lt(si),lt(Iu),lt(Lu)}function RC(t){ro(Lu.current);var e=ro(si.current),n=Ym(e,t.type);e!==n&&(at(Iu,t),at(si,n))}function Wy(t){Iu.current===t&&(lt(si),lt(Iu))}var pt=La(0);function Gd(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 om=[];function Vy(){for(var t=0;t<om.length;t++)om[t]._workInProgressVersionPrimary=null;om.length=0}var nd=Hi.ReactCurrentDispatcher,sm=Hi.ReactCurrentBatchConfig,uo=0,gt=null,Mt=null,Ht=null,Ud=!1,fu=!1,Mu=0,ED=0;function on(){throw Error(ae(321))}function qy(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Gr(t[n],e[n]))return!1;return!0}function Ky(t,e,n,r,i,a){if(uo=a,gt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,nd.current=t===null||t.memoizedState===null?RD:AD,t=n(r,i),fu){a=0;do{if(fu=!1,Mu=0,25<=a)throw Error(ae(301));a+=1,Ht=Mt=null,e.updateQueue=null,nd.current=ID,t=n(r,i)}while(fu)}if(nd.current=jd,e=Mt!==null&&Mt.next!==null,uo=0,Ht=Mt=gt=null,Ud=!1,e)throw Error(ae(300));return t}function Yy(){var t=Mu!==0;return Mu=0,t}function Zr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?gt.memoizedState=Ht=t:Ht=Ht.next=t,Ht}function vr(){if(Mt===null){var t=gt.alternate;t=t!==null?t.memoizedState:null}else t=Mt.next;var e=Ht===null?gt.memoizedState:Ht.next;if(e!==null)Ht=e,Mt=t;else{if(t===null)throw Error(ae(310));Mt=t,t={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},Ht===null?gt.memoizedState=Ht=t:Ht=Ht.next=t}return Ht}function Du(t,e){return typeof e=="function"?e(t):e}function lm(t){var e=vr(),n=e.queue;if(n===null)throw Error(ae(311));n.lastRenderedReducer=t;var r=Mt,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var u=s=null,c=null,f=a;do{var h=f.lane;if((uo&h)===h)c!==null&&(c=c.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 p={lane:h,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};c===null?(u=c=p,s=r):c=c.next=p,gt.lanes|=h,co|=h}f=f.next}while(f!==null&&f!==a);c===null?s=r:c.next=u,Gr(r,e.memoizedState)||(Tn=!0),e.memoizedState=r,e.baseState=s,e.baseQueue=c,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do a=i.lane,gt.lanes|=a,co|=a,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function um(t){var e=vr(),n=e.queue;if(n===null)throw Error(ae(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,a=e.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=t(a,s.action),s=s.next;while(s!==i);Gr(a,e.memoizedState)||(Tn=!0),e.memoizedState=a,e.baseQueue===null&&(e.baseState=a),n.lastRenderedState=a}return[a,r]}function AC(){}function IC(t,e){var n=gt,r=vr(),i=e(),a=!Gr(r.memoizedState,i);if(a&&(r.memoizedState=i,Tn=!0),r=r.queue,Xy(DC.bind(null,n,r,t),[t]),r.getSnapshot!==e||a||Ht!==null&&Ht.memoizedState.tag&1){if(n.flags|=2048,Nu(9,MC.bind(null,n,r,i,e),void 0,null),Wt===null)throw Error(ae(349));uo&30||LC(n,e,i)}return i}function LC(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=gt.updateQueue,e===null?(e={lastEffect:null,stores:null},gt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function MC(t,e,n,r){e.value=n,e.getSnapshot=r,NC(e)&&BC(t)}function DC(t,e,n){return n(function(){NC(e)&&BC(t)})}function NC(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Gr(t,n)}catch{return!0}}function BC(t){var e=Gi(t,1);e!==null&&$r(e,t,1,-1)}function N_(t){var e=Zr();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Du,lastRenderedState:t},e.queue=t,t=t.dispatch=TD.bind(null,gt,t),[e.memoizedState,t]}function Nu(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=gt.updateQueue,e===null?(e={lastEffect:null,stores:null},gt.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 FC(){return vr().memoizedState}function rd(t,e,n,r){var i=Zr();gt.flags|=t,i.memoizedState=Nu(1|e,n,void 0,r===void 0?null:r)}function wh(t,e,n,r){var i=vr();r=r===void 0?null:r;var a=void 0;if(Mt!==null){var s=Mt.memoizedState;if(a=s.destroy,r!==null&&qy(r,s.deps)){i.memoizedState=Nu(e,n,a,r);return}}gt.flags|=t,i.memoizedState=Nu(1|e,n,a,r)}function B_(t,e){return rd(8390656,8,t,e)}function Xy(t,e){return wh(2048,8,t,e)}function $C(t,e){return wh(4,2,t,e)}function zC(t,e){return wh(4,4,t,e)}function GC(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 UC(t,e,n){return n=n!=null?n.concat([t]):null,wh(4,4,GC.bind(null,e,t),n)}function Qy(){}function jC(t,e){var n=vr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&qy(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function HC(t,e){var n=vr();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&qy(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function WC(t,e,n){return uo&21?(Gr(n,e)||(n=K2(),gt.lanes|=n,co|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Tn=!0),t.memoizedState=n)}function PD(t,e){var n=Qe;Qe=n!==0&&4>n?n:4,t(!0);var r=sm.transition;sm.transition={};try{t(!1),e()}finally{Qe=n,sm.transition=r}}function VC(){return vr().memoizedState}function OD(t,e,n){var r=xa(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},qC(t))KC(e,n);else if(n=xC(t,e,n,r),n!==null){var i=Sn();$r(n,t,r,i),YC(n,e,r)}}function TD(t,e,n){var r=xa(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(qC(t))KC(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,u=a(s,n);if(i.hasEagerState=!0,i.eagerState=u,Gr(u,s)){var c=e.interleaved;c===null?(i.next=i,Uy(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}n=xC(t,e,i,r),n!==null&&(i=Sn(),$r(n,t,r,i),YC(n,e,r))}}function qC(t){var e=t.alternate;return t===gt||e!==null&&e===gt}function KC(t,e){fu=Ud=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function YC(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Oy(t,n)}}var jd={readContext:mr,useCallback:on,useContext:on,useEffect:on,useImperativeHandle:on,useInsertionEffect:on,useLayoutEffect:on,useMemo:on,useReducer:on,useRef:on,useState:on,useDebugValue:on,useDeferredValue:on,useTransition:on,useMutableSource:on,useSyncExternalStore:on,useId:on,unstable_isNewReconciler:!1},RD={readContext:mr,useCallback:function(t,e){return Zr().memoizedState=[t,e===void 0?null:e],t},useContext:mr,useEffect:B_,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,rd(4194308,4,GC.bind(null,e,t),n)},useLayoutEffect:function(t,e){return rd(4194308,4,t,e)},useInsertionEffect:function(t,e){return rd(4,2,t,e)},useMemo:function(t,e){var n=Zr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Zr();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=OD.bind(null,gt,t),[r.memoizedState,t]},useRef:function(t){var e=Zr();return t={current:t},e.memoizedState=t},useState:N_,useDebugValue:Qy,useDeferredValue:function(t){return Zr().memoizedState=t},useTransition:function(){var t=N_(!1),e=t[0];return t=PD.bind(null,t[1]),Zr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=gt,i=Zr();if(ft){if(n===void 0)throw Error(ae(407));n=n()}else{if(n=e(),Wt===null)throw Error(ae(349));uo&30||LC(r,e,n)}i.memoizedState=n;var a={value:n,getSnapshot:e};return i.queue=a,B_(DC.bind(null,r,a,t),[t]),r.flags|=2048,Nu(9,MC.bind(null,r,a,n,e),void 0,null),n},useId:function(){var t=Zr(),e=Wt.identifierPrefix;if(ft){var n=Ni,r=Di;n=(r&~(1<<32-Fr(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Mu++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=ED++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},AD={readContext:mr,useCallback:jC,useContext:mr,useEffect:Xy,useImperativeHandle:UC,useInsertionEffect:$C,useLayoutEffect:zC,useMemo:HC,useReducer:lm,useRef:FC,useState:function(){return lm(Du)},useDebugValue:Qy,useDeferredValue:function(t){var e=vr();return WC(e,Mt.memoizedState,t)},useTransition:function(){var t=lm(Du)[0],e=vr().memoizedState;return[t,e]},useMutableSource:AC,useSyncExternalStore:IC,useId:VC,unstable_isNewReconciler:!1},ID={readContext:mr,useCallback:jC,useContext:mr,useEffect:Xy,useImperativeHandle:UC,useInsertionEffect:$C,useLayoutEffect:zC,useMemo:HC,useReducer:um,useRef:FC,useState:function(){return um(Du)},useDebugValue:Qy,useDeferredValue:function(t){var e=vr();return Mt===null?e.memoizedState=t:WC(e,Mt.memoizedState,t)},useTransition:function(){var t=um(Du)[0],e=vr().memoizedState;return[t,e]},useMutableSource:AC,useSyncExternalStore:IC,useId:VC,unstable_isNewReconciler:!1};function Bs(t,e){try{var n="",r=e;do n+=oM(r),r=r.return;while(r);var i=n}catch(a){i=`
Error generating stack: `+a.message+`
`+a.stack}return{value:t,source:e,stack:i,digest:null}}function cm(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function yv(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var LD=typeof WeakMap=="function"?WeakMap:Map;function XC(t,e,n){n=Bi(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Wd||(Wd=!0,Ov=r),yv(t,e)},n}function QC(t,e,n){n=Bi(-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(){yv(t,e)}}var a=t.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){yv(t,e),typeof r!="function"&&(Ca===null?Ca=new Set([this]):Ca.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function F_(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new LD;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=qD.bind(null,t,e,n),e.then(t,t))}function $_(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 z_(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=Bi(-1,1),e.tag=2,ba(n,e,1))),n.lanes|=1),t)}var MD=Hi.ReactCurrentOwner,Tn=!1;function vn(t,e,n,r){e.child=t===null?TC(e,null,n,r):Ds(e,t.child,n,r)}function G_(t,e,n,r,i){n=n.render;var a=e.ref;return xs(e,i),r=Ky(t,e,n,r,a,i),n=Yy(),t!==null&&!Tn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Ui(t,e,i)):(ft&&n&&Ny(e),e.flags|=1,vn(t,e,r,i),e.child)}function U_(t,e,n,r,i){if(t===null){var a=n.type;return typeof a=="function"&&!a0(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=a,JC(t,e,a,r,i)):(t=sd(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!(t.lanes&i)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:Ou,n(s,r)&&t.ref===e.ref)return Ui(t,e,i)}return e.flags|=1,t=ka(a,r),t.ref=e.ref,t.return=e,e.child=t}function JC(t,e,n,r,i){if(t!==null){var a=t.memoizedProps;if(Ou(a,r)&&t.ref===e.ref)if(Tn=!1,e.pendingProps=r=a,(t.lanes&i)!==0)t.flags&131072&&(Tn=!0);else return e.lanes=t.lanes,Ui(t,e,i)}return Sv(t,e,n,r,i)}function ZC(t,e,n){var r=e.pendingProps,i=r.children,a=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},at(ys,jn),jn|=n;else{if(!(n&1073741824))return t=a!==null?a.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,at(ys,jn),jn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,at(ys,jn),jn|=r}else a!==null?(r=a.baseLanes|n,e.memoizedState=null):r=n,at(ys,jn),jn|=r;return vn(t,e,i,n),e.child}function ex(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Sv(t,e,n,r,i){var a=An(n)?so:fn.current;return a=Ls(e,a),xs(e,i),n=Ky(t,e,n,r,a,i),r=Yy(),t!==null&&!Tn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Ui(t,e,i)):(ft&&r&&Ny(e),e.flags|=1,vn(t,e,n,i),e.child)}function j_(t,e,n,r,i){if(An(n)){var a=!0;Dd(e)}else a=!1;if(xs(e,i),e.stateNode===null)id(t,e),PC(e,n,r),vv(e,n,r,i),r=!0;else if(t===null){var s=e.stateNode,u=e.memoizedProps;s.props=u;var c=s.context,f=n.contextType;typeof f=="object"&&f!==null?f=mr(f):(f=An(n)?so:fn.current,f=Ls(e,f));var h=n.getDerivedStateFromProps,p=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function";p||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(u!==r||c!==f)&&M_(e,s,r,f),fa=!1;var g=e.memoizedState;s.state=g,zd(e,r,s,i),c=e.memoizedState,u!==r||g!==c||Rn.current||fa?(typeof h=="function"&&(mv(e,n,h,r),c=e.memoizedState),(u=fa||L_(e,n,u,r,g,c,f))?(p||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),s.props=r,s.state=c,s.context=f,r=u):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,kC(t,e),u=e.memoizedProps,f=e.type===e.elementType?u:Lr(e.type,u),s.props=f,p=e.pendingProps,g=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=mr(c):(c=An(n)?so:fn.current,c=Ls(e,c));var y=n.getDerivedStateFromProps;(h=typeof y=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(u!==p||g!==c)&&M_(e,s,r,c),fa=!1,g=e.memoizedState,s.state=g,zd(e,r,s,i);var v=e.memoizedState;u!==p||g!==v||Rn.current||fa?(typeof y=="function"&&(mv(e,n,y,r),v=e.memoizedState),(f=fa||L_(e,n,f,r,g,v,c)||!1)?(h||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,c)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||u===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||u===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),s.props=r,s.state=v,s.context=c,r=f):(typeof s.componentDidUpdate!="function"||u===t.memoizedProps&&g===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||u===t.memoizedProps&&g===t.memoizedState||(e.flags|=1024),r=!1)}return _v(t,e,n,r,a,i)}function _v(t,e,n,r,i,a){ex(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return i&&O_(e,n,!1),Ui(t,e,a);r=e.stateNode,MD.current=e;var u=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=Ds(e,t.child,null,a),e.child=Ds(e,null,u,a)):vn(t,e,u,a),e.memoizedState=r.state,i&&O_(e,n,!0),e.child}function tx(t){var e=t.stateNode;e.pendingContext?P_(t,e.pendingContext,e.pendingContext!==e.context):e.context&&P_(t,e.context,!1),Hy(t,e.containerInfo)}function H_(t,e,n,r,i){return Ms(),Fy(i),e.flags|=256,vn(t,e,n,r),e.child}var wv={dehydrated:null,treeContext:null,retryLane:0};function bv(t){return{baseLanes:t,cachePool:null,transitions:null}}function nx(t,e,n){var r=e.pendingProps,i=pt.current,a=!1,s=(e.flags&128)!==0,u;if((u=s)||(u=t!==null&&t.memoizedState===null?!1:(i&2)!==0),u?(a=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),at(pt,i&1),t===null)return pv(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):(s=r.children,t=r.fallback,a?(r=e.mode,a=e.child,s={mode:"hidden",children:s},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=xh(s,r,0,null),t=oo(t,r,n,null),a.return=e,t.return=e,a.sibling=t,e.child=a,e.child.memoizedState=bv(n),e.memoizedState=wv,t):Jy(e,s));if(i=t.memoizedState,i!==null&&(u=i.dehydrated,u!==null))return DD(t,e,s,r,u,i,n);if(a){a=r.fallback,s=e.mode,i=t.child,u=i.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=ka(i,c),r.subtreeFlags=i.subtreeFlags&14680064),u!==null?a=ka(u,a):(a=oo(a,s,n,null),a.flags|=2),a.return=e,r.return=e,r.sibling=a,e.child=r,r=a,a=e.child,s=t.child.memoizedState,s=s===null?bv(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=t.childLanes&~n,e.memoizedState=wv,r}return a=t.child,t=a.sibling,r=ka(a,{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 Jy(t,e){return e=xh({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function xf(t,e,n,r){return r!==null&&Fy(r),Ds(e,t.child,null,n),t=Jy(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function DD(t,e,n,r,i,a,s){if(n)return e.flags&256?(e.flags&=-257,r=cm(Error(ae(422))),xf(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(a=r.fallback,i=e.mode,r=xh({mode:"visible",children:r.children},i,0,null),a=oo(a,i,s,null),a.flags|=2,r.return=e,a.return=e,r.sibling=a,e.child=r,e.mode&1&&Ds(e,t.child,null,s),e.child.memoizedState=bv(s),e.memoizedState=wv,a);if(!(e.mode&1))return xf(t,e,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var u=r.dgst;return r=u,a=Error(ae(419)),r=cm(a,r,void 0),xf(t,e,s,r)}if(u=(s&t.childLanes)!==0,Tn||u){if(r=Wt,r!==null){switch(s&-s){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|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,Gi(t,i),$r(r,t,i,-1))}return i0(),r=cm(Error(ae(421))),xf(t,e,s,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=KD.bind(null,t),i._reactRetry=e,null):(t=a.treeContext,Wn=wa(i.nextSibling),Vn=e,ft=!0,Nr=null,t!==null&&(ur[cr++]=Di,ur[cr++]=Ni,ur[cr++]=lo,Di=t.id,Ni=t.overflow,lo=e),e=Jy(e,r.children),e.flags|=4096,e)}function W_(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),gv(t.return,e,n)}function fm(t,e,n,r,i){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function rx(t,e,n){var r=e.pendingProps,i=r.revealOrder,a=r.tail;if(vn(t,e,r.children,n),r=pt.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&&W_(t,n,e);else if(t.tag===19)W_(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(at(pt,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&&Gd(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),fm(e,!1,i,n,a);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Gd(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}fm(e,!0,n,null,a);break;case"together":fm(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function id(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Ui(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),co|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(ae(153));if(e.child!==null){for(t=e.child,n=ka(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ka(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function ND(t,e,n){switch(e.tag){case 3:tx(e),Ms();break;case 5:RC(e);break;case 1:An(e.type)&&Dd(e);break;case 4:Hy(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;at(Fd,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(at(pt,pt.current&1),e.flags|=128,null):n&e.child.childLanes?nx(t,e,n):(at(pt,pt.current&1),t=Ui(t,e,n),t!==null?t.sibling:null);at(pt,pt.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return rx(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),at(pt,pt.current),r)break;return null;case 22:case 23:return e.lanes=0,ZC(t,e,n)}return Ui(t,e,n)}var ix,Cv,ax,ox;ix=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}};Cv=function(){};ax=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,ro(si.current);var a=null;switch(n){case"input":i=Wm(t,i),r=Wm(t,r),a=[];break;case"select":i=mt({},i,{value:void 0}),r=mt({},r,{value:void 0}),a=[];break;case"textarea":i=Km(t,i),r=Km(t,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Ld)}Xm(n,r);var s;n=null;for(f in i)if(!r.hasOwnProperty(f)&&i.hasOwnProperty(f)&&i[f]!=null)if(f==="style"){var u=i[f];for(s in u)u.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(wu.hasOwnProperty(f)?a||(a=[]):(a=a||[]).push(f,null));for(f in r){var c=r[f];if(u=i!=null?i[f]:void 0,r.hasOwnProperty(f)&&c!==u&&(c!=null||u!=null))if(f==="style")if(u){for(s in u)!u.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&u[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(a||(a=[]),a.push(f,n)),n=c;else f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,u=u?u.__html:void 0,c!=null&&u!==c&&(a=a||[]).push(f,c)):f==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(f,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(wu.hasOwnProperty(f)?(c!=null&&f==="onScroll"&&ot("scroll",t),a||u===c||(a=[])):(a=a||[]).push(f,c))}n&&(a=a||[]).push("style",n);var f=a;(e.updateQueue=f)&&(e.flags|=4)}};ox=function(t,e,n,r){n!==r&&(e.flags|=4)};function Ml(t,e){if(!ft)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 sn(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 BD(t,e,n){var r=e.pendingProps;switch(By(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(e),null;case 1:return An(e.type)&&Md(),sn(e),null;case 3:return r=e.stateNode,Ns(),lt(Rn),lt(fn),Vy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(bf(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Nr!==null&&(Av(Nr),Nr=null))),Cv(t,e),sn(e),null;case 5:Wy(e);var i=ro(Lu.current);if(n=e.type,t!==null&&e.stateNode!=null)ax(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(ae(166));return sn(e),null}if(t=ro(si.current),bf(e)){r=e.stateNode,n=e.type;var a=e.memoizedProps;switch(r[ri]=e,r[Au]=a,t=(e.mode&1)!==0,n){case"dialog":ot("cancel",r),ot("close",r);break;case"iframe":case"object":case"embed":ot("load",r);break;case"video":case"audio":for(i=0;i<Ql.length;i++)ot(Ql[i],r);break;case"source":ot("error",r);break;case"img":case"image":case"link":ot("error",r),ot("load",r);break;case"details":ot("toggle",r);break;case"input":e_(r,a),ot("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},ot("invalid",r);break;case"textarea":n_(r,a),ot("invalid",r)}Xm(n,a),i=null;for(var s in a)if(a.hasOwnProperty(s)){var u=a[s];s==="children"?typeof u=="string"?r.textContent!==u&&(a.suppressHydrationWarning!==!0&&wf(r.textContent,u,t),i=["children",u]):typeof u=="number"&&r.textContent!==""+u&&(a.suppressHydrationWarning!==!0&&wf(r.textContent,u,t),i=["children",""+u]):wu.hasOwnProperty(s)&&u!=null&&s==="onScroll"&&ot("scroll",r)}switch(n){case"input":hf(r),t_(r,a,!0);break;case"textarea":hf(r),r_(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=Ld)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=L2(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[ri]=e,t[Au]=r,ix(t,e,!1,!1),e.stateNode=t;e:{switch(s=Qm(n,r),n){case"dialog":ot("cancel",t),ot("close",t),i=r;break;case"iframe":case"object":case"embed":ot("load",t),i=r;break;case"video":case"audio":for(i=0;i<Ql.length;i++)ot(Ql[i],t);i=r;break;case"source":ot("error",t),i=r;break;case"img":case"image":case"link":ot("error",t),ot("load",t),i=r;break;case"details":ot("toggle",t),i=r;break;case"input":e_(t,r),i=Wm(t,r),ot("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=mt({},r,{value:void 0}),ot("invalid",t);break;case"textarea":n_(t,r),i=Km(t,r),ot("invalid",t);break;default:i=r}Xm(n,i),u=i;for(a in u)if(u.hasOwnProperty(a)){var c=u[a];a==="style"?N2(t,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&M2(t,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&bu(t,c):typeof c=="number"&&bu(t,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(wu.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ot("scroll",t):c!=null&&by(t,a,c,s))}switch(n){case"input":hf(t),t_(t,r,!1);break;case"textarea":hf(t),r_(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Oa(r.value));break;case"select":t.multiple=!!r.multiple,a=r.value,a!=null?_s(t,!!r.multiple,a,!1):r.defaultValue!=null&&_s(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 sn(e),null;case 6:if(t&&e.stateNode!=null)ox(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(ae(166));if(n=ro(Lu.current),ro(si.current),bf(e)){if(r=e.stateNode,n=e.memoizedProps,r[ri]=e,(a=r.nodeValue!==n)&&(t=Vn,t!==null))switch(t.tag){case 3:wf(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&wf(r.nodeValue,n,(t.mode&1)!==0)}a&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ri]=e,e.stateNode=r}return sn(e),null;case 13:if(lt(pt),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ft&&Wn!==null&&e.mode&1&&!(e.flags&128))CC(),Ms(),e.flags|=98560,a=!1;else if(a=bf(e),r!==null&&r.dehydrated!==null){if(t===null){if(!a)throw Error(ae(318));if(a=e.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ae(317));a[ri]=e}else Ms(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;sn(e),a=!1}else Nr!==null&&(Av(Nr),Nr=null),a=!0;if(!a)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||pt.current&1?Dt===0&&(Dt=3):i0())),e.updateQueue!==null&&(e.flags|=4),sn(e),null);case 4:return Ns(),Cv(t,e),t===null&&Tu(e.stateNode.containerInfo),sn(e),null;case 10:return Gy(e.type._context),sn(e),null;case 17:return An(e.type)&&Md(),sn(e),null;case 19:if(lt(pt),a=e.memoizedState,a===null)return sn(e),null;if(r=(e.flags&128)!==0,s=a.rendering,s===null)if(r)Ml(a,!1);else{if(Dt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(s=Gd(t),s!==null){for(e.flags|=128,Ml(a,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)a=n,t=r,a.flags&=14680066,s=a.alternate,s===null?(a.childLanes=0,a.lanes=t,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,t=s.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return at(pt,pt.current&1|2),e.child}t=t.sibling}a.tail!==null&&Et()>Fs&&(e.flags|=128,r=!0,Ml(a,!1),e.lanes=4194304)}else{if(!r)if(t=Gd(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Ml(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!ft)return sn(e),null}else 2*Et()-a.renderingStartTime>Fs&&n!==1073741824&&(e.flags|=128,r=!0,Ml(a,!1),e.lanes=4194304);a.isBackwards?(s.sibling=e.child,e.child=s):(n=a.last,n!==null?n.sibling=s:e.child=s,a.last=s)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Et(),e.sibling=null,n=pt.current,at(pt,r?n&1|2:n&1),e):(sn(e),null);case 22:case 23:return r0(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?jn&1073741824&&(sn(e),e.subtreeFlags&6&&(e.flags|=8192)):sn(e),null;case 24:return null;case 25:return null}throw Error(ae(156,e.tag))}function FD(t,e){switch(By(e),e.tag){case 1:return An(e.type)&&Md(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ns(),lt(Rn),lt(fn),Vy(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Wy(e),null;case 13:if(lt(pt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ae(340));Ms()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return lt(pt),null;case 4:return Ns(),null;case 10:return Gy(e.type._context),null;case 22:case 23:return r0(),null;case 24:return null;default:return null}}var kf=!1,cn=!1,$D=typeof WeakSet=="function"?WeakSet:Set,he=null;function vs(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){wt(t,e,r)}else n.current=null}function xv(t,e,n){try{n()}catch(r){wt(t,e,r)}}var V_=!1;function zD(t,e){if(sv=Rd,t=cC(),Dy(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,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,u=-1,c=-1,f=0,h=0,p=t,g=null;t:for(;;){for(var y;p!==n||i!==0&&p.nodeType!==3||(u=s+i),p!==a||r!==0&&p.nodeType!==3||(c=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(y=p.firstChild)!==null;)g=p,p=y;for(;;){if(p===t)break t;if(g===n&&++f===i&&(u=s),g===a&&++h===r&&(c=s),(y=p.nextSibling)!==null)break;p=g,g=p.parentNode}p=y}n=u===-1||c===-1?null:{start:u,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(lv={focusedElem:t,selectionRange:n},Rd=!1,he=e;he!==null;)if(e=he,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,he=t;else for(;he!==null;){e=he;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,x=v.memoizedState,_=e.stateNode,S=_.getSnapshotBeforeUpdate(e.elementType===e.type?w:Lr(e.type,w),x);_.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var C=e.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ae(163))}}catch(O){wt(e,e.return,O)}if(t=e.sibling,t!==null){t.return=e.return,he=t;break}he=e.return}return v=V_,V_=!1,v}function du(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 a=i.destroy;i.destroy=void 0,a!==void 0&&xv(e,n,a)}i=i.next}while(i!==r)}}function bh(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 kv(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 sx(t){var e=t.alternate;e!==null&&(t.alternate=null,sx(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ri],delete e[Au],delete e[fv],delete e[bD],delete e[CD])),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 lx(t){return t.tag===5||t.tag===3||t.tag===4}function q_(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||lx(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 Ev(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(Ev(t,e,n),t=t.sibling;t!==null;)Ev(t,e,n),t=t.sibling}function Pv(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(Pv(t,e,n),t=t.sibling;t!==null;)Pv(t,e,n),t=t.sibling}var Zt=null,Mr=!1;function sa(t,e,n){for(n=n.child;n!==null;)ux(t,e,n),n=n.sibling}function ux(t,e,n){if(oi&&typeof oi.onCommitFiberUnmount=="function")try{oi.onCommitFiberUnmount(ph,n)}catch{}switch(n.tag){case 5:cn||vs(n,e);case 6:var r=Zt,i=Mr;Zt=null,sa(t,e,n),Zt=r,Mr=i,Zt!==null&&(Mr?(t=Zt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Zt.removeChild(n.stateNode));break;case 18:Zt!==null&&(Mr?(t=Zt,n=n.stateNode,t.nodeType===8?im(t.parentNode,n):t.nodeType===1&&im(t,n),Eu(t)):im(Zt,n.stateNode));break;case 4:r=Zt,i=Mr,Zt=n.stateNode.containerInfo,Mr=!0,sa(t,e,n),Zt=r,Mr=i;break;case 0:case 11:case 14:case 15:if(!cn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&xv(n,e,s),i=i.next}while(i!==r)}sa(t,e,n);break;case 1:if(!cn&&(vs(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){wt(n,e,u)}sa(t,e,n);break;case 21:sa(t,e,n);break;case 22:n.mode&1?(cn=(r=cn)||n.memoizedState!==null,sa(t,e,n),cn=r):sa(t,e,n);break;default:sa(t,e,n)}}function K_(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new $D),e.forEach(function(r){var i=YD.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Rr(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=t,s=e,u=s;e:for(;u!==null;){switch(u.tag){case 5:Zt=u.stateNode,Mr=!1;break e;case 3:Zt=u.stateNode.containerInfo,Mr=!0;break e;case 4:Zt=u.stateNode.containerInfo,Mr=!0;break e}u=u.return}if(Zt===null)throw Error(ae(160));ux(a,s,i),Zt=null,Mr=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(f){wt(i,e,f)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)cx(e,t),e=e.sibling}function cx(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Rr(e,t),Xr(t),r&4){try{du(3,t,t.return),bh(3,t)}catch(w){wt(t,t.return,w)}try{du(5,t,t.return)}catch(w){wt(t,t.return,w)}}break;case 1:Rr(e,t),Xr(t),r&512&&n!==null&&vs(n,n.return);break;case 5:if(Rr(e,t),Xr(t),r&512&&n!==null&&vs(n,n.return),t.flags&32){var i=t.stateNode;try{bu(i,"")}catch(w){wt(t,t.return,w)}}if(r&4&&(i=t.stateNode,i!=null)){var a=t.memoizedProps,s=n!==null?n.memoizedProps:a,u=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{u==="input"&&a.type==="radio"&&a.name!=null&&A2(i,a),Qm(u,s);var f=Qm(u,a);for(s=0;s<c.length;s+=2){var h=c[s],p=c[s+1];h==="style"?N2(i,p):h==="dangerouslySetInnerHTML"?M2(i,p):h==="children"?bu(i,p):by(i,h,p,f)}switch(u){case"input":Vm(i,a);break;case"textarea":I2(i,a);break;case"select":var g=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var y=a.value;y!=null?_s(i,!!a.multiple,y,!1):g!==!!a.multiple&&(a.defaultValue!=null?_s(i,!!a.multiple,a.defaultValue,!0):_s(i,!!a.multiple,a.multiple?[]:"",!1))}i[Au]=a}catch(w){wt(t,t.return,w)}}break;case 6:if(Rr(e,t),Xr(t),r&4){if(t.stateNode===null)throw Error(ae(162));i=t.stateNode,a=t.memoizedProps;try{i.nodeValue=a}catch(w){wt(t,t.return,w)}}break;case 3:if(Rr(e,t),Xr(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Eu(e.containerInfo)}catch(w){wt(t,t.return,w)}break;case 4:Rr(e,t),Xr(t);break;case 13:Rr(e,t),Xr(t),i=t.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(t0=Et())),r&4&&K_(t);break;case 22:if(h=n!==null&&n.memoizedState!==null,t.mode&1?(cn=(f=cn)||h,Rr(e,t),cn=f):Rr(e,t),Xr(t),r&8192){if(f=t.memoizedState!==null,(t.stateNode.isHidden=f)&&!h&&t.mode&1)for(he=t,h=t.child;h!==null;){for(p=he=h;he!==null;){switch(g=he,y=g.child,g.tag){case 0:case 11:case 14:case 15:du(4,g,g.return);break;case 1:vs(g,g.return);var v=g.stateNode;if(typeof v.componentWillUnmount=="function"){r=g,n=g.return;try{e=r,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(w){wt(r,n,w)}}break;case 5:vs(g,g.return);break;case 22:if(g.memoizedState!==null){X_(p);continue}}y!==null?(y.return=g,he=y):X_(p)}h=h.sibling}e:for(h=null,p=t;;){if(p.tag===5){if(h===null){h=p;try{i=p.stateNode,f?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(u=p.stateNode,c=p.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,u.style.display=D2("display",s))}catch(w){wt(t,t.return,w)}}}else if(p.tag===6){if(h===null)try{p.stateNode.nodeValue=f?"":p.memoizedProps}catch(w){wt(t,t.return,w)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===t)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;h===p&&(h=null),p=p.return}h===p&&(h=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Rr(e,t),Xr(t),r&4&&K_(t);break;case 21:break;default:Rr(e,t),Xr(t)}}function Xr(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(lx(n)){var r=n;break e}n=n.return}throw Error(ae(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(bu(i,""),r.flags&=-33);var a=q_(t);Pv(t,a,i);break;case 3:case 4:var s=r.stateNode.containerInfo,u=q_(t);Ev(t,u,s);break;default:throw Error(ae(161))}}catch(c){wt(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function GD(t,e,n){he=t,fx(t)}function fx(t,e,n){for(var r=(t.mode&1)!==0;he!==null;){var i=he,a=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||kf;if(!s){var u=i.alternate,c=u!==null&&u.memoizedState!==null||cn;u=kf;var f=cn;if(kf=s,(cn=c)&&!f)for(he=i;he!==null;)s=he,c=s.child,s.tag===22&&s.memoizedState!==null?Q_(i):c!==null?(c.return=s,he=c):Q_(i);for(;a!==null;)he=a,fx(a),a=a.sibling;he=i,kf=u,cn=f}Y_(t)}else i.subtreeFlags&8772&&a!==null?(a.return=i,he=a):Y_(t)}}function Y_(t){for(;he!==null;){var e=he;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:cn||bh(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!cn)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:Lr(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=e.updateQueue;a!==null&&I_(e,a,r);break;case 3:var s=e.updateQueue;if(s!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}I_(e,s,n)}break;case 5:var u=e.stateNode;if(n===null&&e.flags&4){n=u;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.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 h=f.memoizedState;if(h!==null){var p=h.dehydrated;p!==null&&Eu(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ae(163))}cn||e.flags&512&&kv(e)}catch(g){wt(e,e.return,g)}}if(e===t){he=null;break}if(n=e.sibling,n!==null){n.return=e.return,he=n;break}he=e.return}}function X_(t){for(;he!==null;){var e=he;if(e===t){he=null;break}var n=e.sibling;if(n!==null){n.return=e.return,he=n;break}he=e.return}}function Q_(t){for(;he!==null;){var e=he;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{bh(4,e)}catch(c){wt(e,n,c)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(c){wt(e,i,c)}}var a=e.return;try{kv(e)}catch(c){wt(e,a,c)}break;case 5:var s=e.return;try{kv(e)}catch(c){wt(e,s,c)}}}catch(c){wt(e,e.return,c)}if(e===t){he=null;break}var u=e.sibling;if(u!==null){u.return=e.return,he=u;break}he=e.return}}var UD=Math.ceil,Hd=Hi.ReactCurrentDispatcher,Zy=Hi.ReactCurrentOwner,pr=Hi.ReactCurrentBatchConfig,$e=0,Wt=null,Tt=null,tn=0,jn=0,ys=La(0),Dt=0,Bu=null,co=0,Ch=0,e0=0,hu=null,On=null,t0=0,Fs=1/0,Li=null,Wd=!1,Ov=null,Ca=null,Ef=!1,ma=null,Vd=0,pu=0,Tv=null,ad=-1,od=0;function Sn(){return $e&6?Et():ad!==-1?ad:ad=Et()}function xa(t){return t.mode&1?$e&2&&tn!==0?tn&-tn:kD.transition!==null?(od===0&&(od=K2()),od):(t=Qe,t!==0||(t=window.event,t=t===void 0?16:tC(t.type)),t):1}function $r(t,e,n,r){if(50<pu)throw pu=0,Tv=null,Error(ae(185));Yu(t,n,r),(!($e&2)||t!==Wt)&&(t===Wt&&(!($e&2)&&(Ch|=n),Dt===4&&ha(t,tn)),In(t,r),n===1&&$e===0&&!(e.mode&1)&&(Fs=Et()+500,Sh&&Ma()))}function In(t,e){var n=t.callbackNode;kM(t,e);var r=Td(t,t===Wt?tn:0);if(r===0)n!==null&&o_(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&o_(n),e===1)t.tag===0?xD(J_.bind(null,t)):_C(J_.bind(null,t)),_D(function(){!($e&6)&&Ma()}),n=null;else{switch(Y2(r)){case 1:n=Py;break;case 4:n=V2;break;case 16:n=Od;break;case 536870912:n=q2;break;default:n=Od}n=Sx(n,dx.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function dx(t,e){if(ad=-1,od=0,$e&6)throw Error(ae(327));var n=t.callbackNode;if(ks()&&t.callbackNode!==n)return null;var r=Td(t,t===Wt?tn:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=qd(t,r);else{e=r;var i=$e;$e|=2;var a=px();(Wt!==t||tn!==e)&&(Li=null,Fs=Et()+500,ao(t,e));do try{WD();break}catch(u){hx(t,u)}while(1);zy(),Hd.current=a,$e=i,Tt!==null?e=0:(Wt=null,tn=0,e=Dt)}if(e!==0){if(e===2&&(i=nv(t),i!==0&&(r=i,e=Rv(t,i))),e===1)throw n=Bu,ao(t,0),ha(t,r),In(t,Et()),n;if(e===6)ha(t,r);else{if(i=t.current.alternate,!(r&30)&&!jD(i)&&(e=qd(t,r),e===2&&(a=nv(t),a!==0&&(r=a,e=Rv(t,a))),e===1))throw n=Bu,ao(t,0),ha(t,r),In(t,Et()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(ae(345));case 2:Ja(t,On,Li);break;case 3:if(ha(t,r),(r&130023424)===r&&(e=t0+500-Et(),10<e)){if(Td(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){Sn(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=cv(Ja.bind(null,t,On,Li),e);break}Ja(t,On,Li);break;case 4:if(ha(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var s=31-Fr(r);a=1<<s,s=e[s],s>i&&(i=s),r&=~a}if(r=i,r=Et()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*UD(r/1960))-r,10<r){t.timeoutHandle=cv(Ja.bind(null,t,On,Li),r);break}Ja(t,On,Li);break;case 5:Ja(t,On,Li);break;default:throw Error(ae(329))}}}return In(t,Et()),t.callbackNode===n?dx.bind(null,t):null}function Rv(t,e){var n=hu;return t.current.memoizedState.isDehydrated&&(ao(t,e).flags|=256),t=qd(t,e),t!==2&&(e=On,On=n,e!==null&&Av(e)),t}function Av(t){On===null?On=t:On.push.apply(On,t)}function jD(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],a=i.getSnapshot;i=i.value;try{if(!Gr(a(),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 ha(t,e){for(e&=~e0,e&=~Ch,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Fr(e),r=1<<n;t[n]=-1,e&=~r}}function J_(t){if($e&6)throw Error(ae(327));ks();var e=Td(t,0);if(!(e&1))return In(t,Et()),null;var n=qd(t,e);if(t.tag!==0&&n===2){var r=nv(t);r!==0&&(e=r,n=Rv(t,r))}if(n===1)throw n=Bu,ao(t,0),ha(t,e),In(t,Et()),n;if(n===6)throw Error(ae(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Ja(t,On,Li),In(t,Et()),null}function n0(t,e){var n=$e;$e|=1;try{return t(e)}finally{$e=n,$e===0&&(Fs=Et()+500,Sh&&Ma())}}function fo(t){ma!==null&&ma.tag===0&&!($e&6)&&ks();var e=$e;$e|=1;var n=pr.transition,r=Qe;try{if(pr.transition=null,Qe=1,t)return t()}finally{Qe=r,pr.transition=n,$e=e,!($e&6)&&Ma()}}function r0(){jn=ys.current,lt(ys)}function ao(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,SD(n)),Tt!==null)for(n=Tt.return;n!==null;){var r=n;switch(By(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Md();break;case 3:Ns(),lt(Rn),lt(fn),Vy();break;case 5:Wy(r);break;case 4:Ns();break;case 13:lt(pt);break;case 19:lt(pt);break;case 10:Gy(r.type._context);break;case 22:case 23:r0()}n=n.return}if(Wt=t,Tt=t=ka(t.current,null),tn=jn=e,Dt=0,Bu=null,e0=Ch=co=0,On=hu=null,no!==null){for(e=0;e<no.length;e++)if(n=no[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var s=a.next;a.next=i,r.next=s}n.pending=r}no=null}return t}function hx(t,e){do{var n=Tt;try{if(zy(),nd.current=jd,Ud){for(var r=gt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ud=!1}if(uo=0,Ht=Mt=gt=null,fu=!1,Mu=0,Zy.current=null,n===null||n.return===null){Dt=1,Bu=e,Tt=null;break}e:{var a=t,s=n.return,u=n,c=e;if(e=tn,u.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=c,h=u,p=h.tag;if(!(h.mode&1)&&(p===0||p===11||p===15)){var g=h.alternate;g?(h.updateQueue=g.updateQueue,h.memoizedState=g.memoizedState,h.lanes=g.lanes):(h.updateQueue=null,h.memoizedState=null)}var y=$_(s);if(y!==null){y.flags&=-257,z_(y,s,u,a,e),y.mode&1&&F_(a,f,e),e=y,c=f;var v=e.updateQueue;if(v===null){var w=new Set;w.add(c),e.updateQueue=w}else v.add(c);break e}else{if(!(e&1)){F_(a,f,e),i0();break e}c=Error(ae(426))}}else if(ft&&u.mode&1){var x=$_(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),z_(x,s,u,a,e),Fy(Bs(c,u));break e}}a=c=Bs(c,u),Dt!==4&&(Dt=2),hu===null?hu=[a]:hu.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,e&=-e,a.lanes|=e;var _=XC(a,c,e);A_(a,_);break e;case 1:u=c;var S=a.type,C=a.stateNode;if(!(a.flags&128)&&(typeof S.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Ca===null||!Ca.has(C)))){a.flags|=65536,e&=-e,a.lanes|=e;var O=QC(a,u,e);A_(a,O);break e}}a=a.return}while(a!==null)}mx(n)}catch(I){e=I,Tt===n&&n!==null&&(Tt=n=n.return);continue}break}while(1)}function px(){var t=Hd.current;return Hd.current=jd,t===null?jd:t}function i0(){(Dt===0||Dt===3||Dt===2)&&(Dt=4),Wt===null||!(co&268435455)&&!(Ch&268435455)||ha(Wt,tn)}function qd(t,e){var n=$e;$e|=2;var r=px();(Wt!==t||tn!==e)&&(Li=null,ao(t,e));do try{HD();break}catch(i){hx(t,i)}while(1);if(zy(),$e=n,Hd.current=r,Tt!==null)throw Error(ae(261));return Wt=null,tn=0,Dt}function HD(){for(;Tt!==null;)gx(Tt)}function WD(){for(;Tt!==null&&!mM();)gx(Tt)}function gx(t){var e=yx(t.alternate,t,jn);t.memoizedProps=t.pendingProps,e===null?mx(t):Tt=e,Zy.current=null}function mx(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=FD(n,e),n!==null){n.flags&=32767,Tt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Dt=6,Tt=null;return}}else if(n=BD(n,e,jn),n!==null){Tt=n;return}if(e=e.sibling,e!==null){Tt=e;return}Tt=e=t}while(e!==null);Dt===0&&(Dt=5)}function Ja(t,e,n){var r=Qe,i=pr.transition;try{pr.transition=null,Qe=1,VD(t,e,n,r)}finally{pr.transition=i,Qe=r}return null}function VD(t,e,n,r){do ks();while(ma!==null);if($e&6)throw Error(ae(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(ae(177));t.callbackNode=null,t.callbackPriority=0;var a=n.lanes|n.childLanes;if(EM(t,a),t===Wt&&(Tt=Wt=null,tn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ef||(Ef=!0,Sx(Od,function(){return ks(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=pr.transition,pr.transition=null;var s=Qe;Qe=1;var u=$e;$e|=4,Zy.current=null,zD(t,n),cx(n,t),dD(lv),Rd=!!sv,lv=sv=null,t.current=n,GD(n),vM(),$e=u,Qe=s,pr.transition=a}else t.current=n;if(Ef&&(Ef=!1,ma=t,Vd=i),a=t.pendingLanes,a===0&&(Ca=null),_M(n.stateNode),In(t,Et()),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(Wd)throw Wd=!1,t=Ov,Ov=null,t;return Vd&1&&t.tag!==0&&ks(),a=t.pendingLanes,a&1?t===Tv?pu++:(pu=0,Tv=t):pu=0,Ma(),null}function ks(){if(ma!==null){var t=Y2(Vd),e=pr.transition,n=Qe;try{if(pr.transition=null,Qe=16>t?16:t,ma===null)var r=!1;else{if(t=ma,ma=null,Vd=0,$e&6)throw Error(ae(331));var i=$e;for($e|=4,he=t.current;he!==null;){var a=he,s=a.child;if(he.flags&16){var u=a.deletions;if(u!==null){for(var c=0;c<u.length;c++){var f=u[c];for(he=f;he!==null;){var h=he;switch(h.tag){case 0:case 11:case 15:du(8,h,a)}var p=h.child;if(p!==null)p.return=h,he=p;else for(;he!==null;){h=he;var g=h.sibling,y=h.return;if(sx(h),h===f){he=null;break}if(g!==null){g.return=y,he=g;break}he=y}}}var v=a.alternate;if(v!==null){var w=v.child;if(w!==null){v.child=null;do{var x=w.sibling;w.sibling=null,w=x}while(w!==null)}}he=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,he=s;else e:for(;he!==null;){if(a=he,a.flags&2048)switch(a.tag){case 0:case 11:case 15:du(9,a,a.return)}var _=a.sibling;if(_!==null){_.return=a.return,he=_;break e}he=a.return}}var S=t.current;for(he=S;he!==null;){s=he;var C=s.child;if(s.subtreeFlags&2064&&C!==null)C.return=s,he=C;else e:for(s=S;he!==null;){if(u=he,u.flags&2048)try{switch(u.tag){case 0:case 11:case 15:bh(9,u)}}catch(I){wt(u,u.return,I)}if(u===s){he=null;break e}var O=u.sibling;if(O!==null){O.return=u.return,he=O;break e}he=u.return}}if($e=i,Ma(),oi&&typeof oi.onPostCommitFiberRoot=="function")try{oi.onPostCommitFiberRoot(ph,t)}catch{}r=!0}return r}finally{Qe=n,pr.transition=e}}return!1}function Z_(t,e,n){e=Bs(n,e),e=XC(t,e,1),t=ba(t,e,1),e=Sn(),t!==null&&(Yu(t,1,e),In(t,e))}function wt(t,e,n){if(t.tag===3)Z_(t,t,n);else for(;e!==null;){if(e.tag===3){Z_(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ca===null||!Ca.has(r))){t=Bs(n,t),t=QC(e,t,1),e=ba(e,t,1),t=Sn(),e!==null&&(Yu(e,1,t),In(e,t));break}}e=e.return}}function qD(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=Sn(),t.pingedLanes|=t.suspendedLanes&n,Wt===t&&(tn&n)===n&&(Dt===4||Dt===3&&(tn&130023424)===tn&&500>Et()-t0?ao(t,0):e0|=n),In(t,e)}function vx(t,e){e===0&&(t.mode&1?(e=mf,mf<<=1,!(mf&130023424)&&(mf=4194304)):e=1);var n=Sn();t=Gi(t,e),t!==null&&(Yu(t,e,n),In(t,n))}function KD(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),vx(t,n)}function YD(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(ae(314))}r!==null&&r.delete(e),vx(t,n)}var yx;yx=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Rn.current)Tn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Tn=!1,ND(t,e,n);Tn=!!(t.flags&131072)}else Tn=!1,ft&&e.flags&1048576&&wC(e,Bd,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;id(t,e),t=e.pendingProps;var i=Ls(e,fn.current);xs(e,n),i=Ky(null,e,r,t,i,n);var a=Yy();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,An(r)?(a=!0,Dd(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,jy(e),i.updater=_h,e.stateNode=i,i._reactInternals=e,vv(e,r,t,n),e=_v(null,e,r,!0,a,n)):(e.tag=0,ft&&a&&Ny(e),vn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(id(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=QD(r),t=Lr(r,t),i){case 0:e=Sv(null,e,r,t,n);break e;case 1:e=j_(null,e,r,t,n);break e;case 11:e=G_(null,e,r,t,n);break e;case 14:e=U_(null,e,r,Lr(r.type,t),n);break e}throw Error(ae(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Lr(r,i),Sv(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Lr(r,i),j_(t,e,r,i,n);case 3:e:{if(tx(e),t===null)throw Error(ae(387));r=e.pendingProps,a=e.memoizedState,i=a.element,kC(t,e),zd(e,r,null,n);var s=e.memoizedState;if(r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=Bs(Error(ae(423)),e),e=H_(t,e,r,n,i);break e}else if(r!==i){i=Bs(Error(ae(424)),e),e=H_(t,e,r,n,i);break e}else for(Wn=wa(e.stateNode.containerInfo.firstChild),Vn=e,ft=!0,Nr=null,n=TC(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ms(),r===i){e=Ui(t,e,n);break e}vn(t,e,r,n)}e=e.child}return e;case 5:return RC(e),t===null&&pv(e),r=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,s=i.children,uv(r,i)?s=null:a!==null&&uv(r,a)&&(e.flags|=32),ex(t,e),vn(t,e,s,n),e.child;case 6:return t===null&&pv(e),null;case 13:return nx(t,e,n);case 4:return Hy(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Ds(e,null,r,n):vn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Lr(r,i),G_(t,e,r,i,n);case 7:return vn(t,e,e.pendingProps,n),e.child;case 8:return vn(t,e,e.pendingProps.children,n),e.child;case 12:return vn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,a=e.memoizedProps,s=i.value,at(Fd,r._currentValue),r._currentValue=s,a!==null)if(Gr(a.value,s)){if(a.children===i.children&&!Rn.current){e=Ui(t,e,n);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var u=a.dependencies;if(u!==null){s=a.child;for(var c=u.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=Bi(-1,n&-n),c.tag=2;var f=a.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?c.next=c:(c.next=h.next,h.next=c),f.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),gv(a.return,n,e),u.lanes|=n;break}c=c.next}}else if(a.tag===10)s=a.type===e.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(ae(341));s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),gv(s,n,e),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}vn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,xs(e,n),i=mr(i),r=r(i),e.flags|=1,vn(t,e,r,n),e.child;case 14:return r=e.type,i=Lr(r,e.pendingProps),i=Lr(r.type,i),U_(t,e,r,i,n);case 15:return JC(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Lr(r,i),id(t,e),e.tag=1,An(r)?(t=!0,Dd(e)):t=!1,xs(e,n),PC(e,r,i),vv(e,r,i,n),_v(null,e,r,!0,t,n);case 19:return rx(t,e,n);case 22:return ZC(t,e,n)}throw Error(ae(156,e.tag))};function Sx(t,e){return W2(t,e)}function XD(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 hr(t,e,n,r){return new XD(t,e,n,r)}function a0(t){return t=t.prototype,!(!t||!t.isReactComponent)}function QD(t){if(typeof t=="function")return a0(t)?1:0;if(t!=null){if(t=t.$$typeof,t===xy)return 11;if(t===ky)return 14}return 2}function ka(t,e){var n=t.alternate;return n===null?(n=hr(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 sd(t,e,n,r,i,a){var s=2;if(r=t,typeof t=="function")a0(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case ls:return oo(n.children,i,a,e);case Cy:s=8,i|=8;break;case Gm:return t=hr(12,n,e,i|2),t.elementType=Gm,t.lanes=a,t;case Um:return t=hr(13,n,e,i),t.elementType=Um,t.lanes=a,t;case jm:return t=hr(19,n,e,i),t.elementType=jm,t.lanes=a,t;case O2:return xh(n,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E2:s=10;break e;case P2:s=9;break e;case xy:s=11;break e;case ky:s=14;break e;case ca:s=16,r=null;break e}throw Error(ae(130,t==null?t:typeof t,""))}return e=hr(s,n,e,i),e.elementType=t,e.type=r,e.lanes=a,e}function oo(t,e,n,r){return t=hr(7,t,r,e),t.lanes=n,t}function xh(t,e,n,r){return t=hr(22,t,r,e),t.elementType=O2,t.lanes=n,t.stateNode={isHidden:!1},t}function dm(t,e,n){return t=hr(6,t,null,e),t.lanes=n,t}function hm(t,e,n){return e=hr(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function JD(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=qg(0),this.expirationTimes=qg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qg(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function o0(t,e,n,r,i,a,s,u,c){return t=new JD(t,e,n,u,c),e===1?(e=1,a===!0&&(e|=8)):e=0,a=hr(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jy(a),t}function ZD(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ss,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function _x(t){if(!t)return Ta;t=t._reactInternals;e:{if(mo(t)!==t||t.tag!==1)throw Error(ae(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(An(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(ae(171))}if(t.tag===1){var n=t.type;if(An(n))return SC(t,n,e)}return e}function wx(t,e,n,r,i,a,s,u,c){return t=o0(n,r,!0,t,i,a,s,u,c),t.context=_x(null),n=t.current,r=Sn(),i=xa(n),a=Bi(r,i),a.callback=e??null,ba(n,a,i),t.current.lanes=i,Yu(t,i,r),In(t,r),t}function kh(t,e,n,r){var i=e.current,a=Sn(),s=xa(i);return n=_x(n),e.context===null?e.context=n:e.pendingContext=n,e=Bi(a,s),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=ba(i,e,s),t!==null&&($r(t,i,s,a),td(t,i,s)),s}function Kd(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 ew(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function s0(t,e){ew(t,e),(t=t.alternate)&&ew(t,e)}function e3(){return null}var bx=typeof reportError=="function"?reportError:function(t){console.error(t)};function l0(t){this._internalRoot=t}Eh.prototype.render=l0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(ae(409));kh(t,e,null,null)};Eh.prototype.unmount=l0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;fo(function(){kh(null,t,null,null)}),e[zi]=null}};function Eh(t){this._internalRoot=t}Eh.prototype.unstable_scheduleHydration=function(t){if(t){var e=J2();t={blockedOn:null,target:t,priority:e};for(var n=0;n<da.length&&e!==0&&e<da[n].priority;n++);da.splice(n,0,t),n===0&&eC(t)}};function u0(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ph(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function tw(){}function t3(t,e,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var f=Kd(s);a.call(f)}}var s=wx(e,r,t,0,null,!1,!1,"",tw);return t._reactRootContainer=s,t[zi]=s.current,Tu(t.nodeType===8?t.parentNode:t),fo(),s}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var u=r;r=function(){var f=Kd(c);u.call(f)}}var c=o0(t,0,!1,null,null,!1,!1,"",tw);return t._reactRootContainer=c,t[zi]=c.current,Tu(t.nodeType===8?t.parentNode:t),fo(function(){kh(e,c,n,r)}),c}function Oh(t,e,n,r,i){var a=n._reactRootContainer;if(a){var s=a;if(typeof i=="function"){var u=i;i=function(){var c=Kd(s);u.call(c)}}kh(e,s,t,i)}else s=t3(n,e,t,i,r);return Kd(s)}X2=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Xl(e.pendingLanes);n!==0&&(Oy(e,n|1),In(e,Et()),!($e&6)&&(Fs=Et()+500,Ma()))}break;case 13:fo(function(){var r=Gi(t,1);if(r!==null){var i=Sn();$r(r,t,1,i)}}),s0(t,1)}};Ty=function(t){if(t.tag===13){var e=Gi(t,134217728);if(e!==null){var n=Sn();$r(e,t,134217728,n)}s0(t,134217728)}};Q2=function(t){if(t.tag===13){var e=xa(t),n=Gi(t,e);if(n!==null){var r=Sn();$r(n,t,e,r)}s0(t,e)}};J2=function(){return Qe};Z2=function(t,e){var n=Qe;try{return Qe=t,e()}finally{Qe=n}};Zm=function(t,e,n){switch(e){case"input":if(Vm(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=yh(r);if(!i)throw Error(ae(90));R2(r),Vm(r,i)}}}break;case"textarea":I2(t,n);break;case"select":e=n.value,e!=null&&_s(t,!!n.multiple,e,!1)}};$2=n0;z2=fo;var n3={usingClientEntryPoint:!1,Events:[Qu,ds,yh,B2,F2,n0]},Dl={findFiberByHostInstance:to,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},r3={bundleType:Dl.bundleType,version:Dl.version,rendererPackageName:Dl.rendererPackageName,rendererConfig:Dl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Hi.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=j2(t),t===null?null:t.stateNode},findFiberByHostInstance:Dl.findFiberByHostInstance||e3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pf.isDisabled&&Pf.supportsFiber)try{ph=Pf.inject(r3),oi=Pf}catch{}}Qn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=n3;Qn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u0(e))throw Error(ae(200));return ZD(t,e,null,n)};Qn.createRoot=function(t,e){if(!u0(t))throw Error(ae(299));var n=!1,r="",i=bx;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=o0(t,1,!1,null,null,n,!1,r,i),t[zi]=e.current,Tu(t.nodeType===8?t.parentNode:t),new l0(e)};Qn.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(ae(188)):(t=Object.keys(t).join(","),Error(ae(268,t)));return t=j2(e),t=t===null?null:t.stateNode,t};Qn.flushSync=function(t){return fo(t)};Qn.hydrate=function(t,e,n){if(!Ph(e))throw Error(ae(200));return Oh(null,t,e,!0,n)};Qn.hydrateRoot=function(t,e,n){if(!u0(t))throw Error(ae(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",s=bx;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),e=wx(e,null,t,1,n??null,i,!1,a,s),t[zi]=e.current,Tu(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 Eh(e)};Qn.render=function(t,e,n){if(!Ph(e))throw Error(ae(200));return Oh(null,t,e,!1,n)};Qn.unmountComponentAtNode=function(t){if(!Ph(t))throw Error(ae(40));return t._reactRootContainer?(fo(function(){Oh(null,null,t,!1,function(){t._reactRootContainer=null,t[zi]=null})}),!0):!1};Qn.unstable_batchedUpdates=n0;Qn.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Ph(n))throw Error(ae(200));if(t==null||t._reactInternals===void 0)throw Error(ae(38));return Oh(t,e,n,!1,r)};Qn.version="18.2.0-next-9e3b772b8-20220608";(function(t){function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}e(),t.exports=Qn})(eM);const OG=p2(_u);var nw=_u;Fm.createRoot=nw.createRoot,Fm.hydrateRoot=nw.hydrateRoot;const i3="modulepreload",a3=function(t,e){return new URL(t,e).href},rw={},Cx=function(e,n,r){if(!n||n.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(n.map(a=>{if(a=a3(a,r),a in rw)return;rw[a]=!0;const s=a.endsWith(".css"),u=s?'[rel="stylesheet"]':"";if(!!r)for(let h=i.length-1;h>=0;h--){const p=i[h];if(p.href===a&&(!s||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${u}`))return;const f=document.createElement("link");if(f.rel=s?"stylesheet":i3,s||(f.as="script",f.crossOrigin=""),f.href=a,document.head.appendChild(f),s)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e())};var Iv={},o3={get exports(){return Iv},set exports(t){Iv=t}},xx={};/**
* @license React
* use-sync-external-store-shim.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 $s=be;function s3(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var l3=typeof Object.is=="function"?Object.is:s3,u3=$s.useState,c3=$s.useEffect,f3=$s.useLayoutEffect,d3=$s.useDebugValue;function h3(t,e){var n=e(),r=u3({inst:{value:n,getSnapshot:e}}),i=r[0].inst,a=r[1];return f3(function(){i.value=n,i.getSnapshot=e,pm(i)&&a({inst:i})},[t,n,e]),c3(function(){return pm(i)&&a({inst:i}),t(function(){pm(i)&&a({inst:i})})},[t]),d3(n),n}function pm(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!l3(t,n)}catch{return!0}}function p3(t,e){return e()}var g3=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p3:h3;xx.useSyncExternalStore=$s.useSyncExternalStore!==void 0?$s.useSyncExternalStore:g3;(function(t){t.exports=xx})(o3);var Lv={},m3={get exports(){return Lv},set exports(t){Lv=t}},kx={};/**
* @license React
* use-sync-external-store-shim/with-selector.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 Th=be,v3=Iv;function y3(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var S3=typeof Object.is=="function"?Object.is:y3,_3=v3.useSyncExternalStore,w3=Th.useRef,b3=Th.useEffect,C3=Th.useMemo,x3=Th.useDebugValue;kx.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var a=w3(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=C3(function(){function c(y){if(!f){if(f=!0,h=y,y=r(y),i!==void 0&&s.hasValue){var v=s.value;if(i(v,y))return p=v}return p=y}if(v=p,S3(h,y))return v;var w=r(y);return i!==void 0&&i(v,w)?v:(h=y,p=w)}var f=!1,h,p,g=n===void 0?null:n;return[function(){return c(e())},g===null?void 0:function(){return c(g())}]},[e,n,r,i]);var u=_3(t,a[0],a[1]);return b3(function(){s.hasValue=!0,s.value=u},[u]),x3(u),u};(function(t){t.exports=kx})(m3);function k3(t){t()}let Ex=k3;const E3=t=>Ex=t,P3=()=>Ex,Yd=be.createContext(null);function O3(){return be.useContext(Yd)}const T3=()=>{throw new Error("uSES not initialized!")};let Px=T3;const R3=t=>{Px=t},A3=(t,e)=>t===e;function I3(t=Yd){const e=t===Yd?O3:()=>be.useContext(t);return function(r,i=A3){const{store:a,subscription:s,getServerState:u}=e(),c=Px(s.addNestedSub,a.getState,u||a.getState,r,i);return be.useDebugValue(c),c}}const TG=I3();function Xd(){return Xd=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},Xd.apply(this,arguments)}var Mv={},L3={get exports(){return Mv},set exports(t){Mv=t}},Je={};/** @license React v16.13.1
* react-is.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 Vt=typeof Symbol=="function"&&Symbol.for,c0=Vt?Symbol.for("react.element"):60103,f0=Vt?Symbol.for("react.portal"):60106,Rh=Vt?Symbol.for("react.fragment"):60107,Ah=Vt?Symbol.for("react.strict_mode"):60108,Ih=Vt?Symbol.for("react.profiler"):60114,Lh=Vt?Symbol.for("react.provider"):60109,Mh=Vt?Symbol.for("react.context"):60110,d0=Vt?Symbol.for("react.async_mode"):60111,Dh=Vt?Symbol.for("react.concurrent_mode"):60111,Nh=Vt?Symbol.for("react.forward_ref"):60112,Bh=Vt?Symbol.for("react.suspense"):60113,M3=Vt?Symbol.for("react.suspense_list"):60120,Fh=Vt?Symbol.for("react.memo"):60115,$h=Vt?Symbol.for("react.lazy"):60116,D3=Vt?Symbol.for("react.block"):60121,N3=Vt?Symbol.for("react.fundamental"):60117,B3=Vt?Symbol.for("react.responder"):60118,F3=Vt?Symbol.for("react.scope"):60119;function Zn(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case c0:switch(t=t.type,t){case d0:case Dh:case Rh:case Ih:case Ah:case Bh:return t;default:switch(t=t&&t.$$typeof,t){case Mh:case Nh:case $h:case Fh:case Lh:return t;default:return e}}case f0:return e}}}function Ox(t){return Zn(t)===Dh}Je.AsyncMode=d0;Je.ConcurrentMode=Dh;Je.ContextConsumer=Mh;Je.ContextProvider=Lh;Je.Element=c0;Je.ForwardRef=Nh;Je.Fragment=Rh;Je.Lazy=$h;Je.Memo=Fh;Je.Portal=f0;Je.Profiler=Ih;Je.StrictMode=Ah;Je.Suspense=Bh;Je.isAsyncMode=function(t){return Ox(t)||Zn(t)===d0};Je.isConcurrentMode=Ox;Je.isContextConsumer=function(t){return Zn(t)===Mh};Je.isContextProvider=function(t){return Zn(t)===Lh};Je.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===c0};Je.isForwardRef=function(t){return Zn(t)===Nh};Je.isFragment=function(t){return Zn(t)===Rh};Je.isLazy=function(t){return Zn(t)===$h};Je.isMemo=function(t){return Zn(t)===Fh};Je.isPortal=function(t){return Zn(t)===f0};Je.isProfiler=function(t){return Zn(t)===Ih};Je.isStrictMode=function(t){return Zn(t)===Ah};Je.isSuspense=function(t){return Zn(t)===Bh};Je.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Rh||t===Dh||t===Ih||t===Ah||t===Bh||t===M3||typeof t=="object"&&t!==null&&(t.$$typeof===$h||t.$$typeof===Fh||t.$$typeof===Lh||t.$$typeof===Mh||t.$$typeof===Nh||t.$$typeof===N3||t.$$typeof===B3||t.$$typeof===F3||t.$$typeof===D3)};Je.typeOf=Zn;(function(t){t.exports=Je})(L3);var Tx=Mv,$3={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},z3={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Rx={};Rx[Tx.ForwardRef]=$3;Rx[Tx.Memo]=z3;var iw={},G3={get exports(){return iw},set exports(t){iw=t}},Ze={};/**
* @license React
* react-is.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 h0=Symbol.for("react.element"),p0=Symbol.for("react.portal"),zh=Symbol.for("react.fragment"),Gh=Symbol.for("react.strict_mode"),Uh=Symbol.for("react.profiler"),jh=Symbol.for("react.provider"),Hh=Symbol.for("react.context"),U3=Symbol.for("react.server_context"),Wh=Symbol.for("react.forward_ref"),Vh=Symbol.for("react.suspense"),qh=Symbol.for("react.suspense_list"),Kh=Symbol.for("react.memo"),Yh=Symbol.for("react.lazy"),j3=Symbol.for("react.offscreen"),Ax;Ax=Symbol.for("react.module.reference");function yr(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case h0:switch(t=t.type,t){case zh:case Uh:case Gh:case Vh:case qh:return t;default:switch(t=t&&t.$$typeof,t){case U3:case Hh:case Wh:case Yh:case Kh:case jh:return t;default:return e}}case p0:return e}}}Ze.ContextConsumer=Hh;Ze.ContextProvider=jh;Ze.Element=h0;Ze.ForwardRef=Wh;Ze.Fragment=zh;Ze.Lazy=Yh;Ze.Memo=Kh;Ze.Portal=p0;Ze.Profiler=Uh;Ze.StrictMode=Gh;Ze.Suspense=Vh;Ze.SuspenseList=qh;Ze.isAsyncMode=function(){return!1};Ze.isConcurrentMode=function(){return!1};Ze.isContextConsumer=function(t){return yr(t)===Hh};Ze.isContextProvider=function(t){return yr(t)===jh};Ze.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===h0};Ze.isForwardRef=function(t){return yr(t)===Wh};Ze.isFragment=function(t){return yr(t)===zh};Ze.isLazy=function(t){return yr(t)===Yh};Ze.isMemo=function(t){return yr(t)===Kh};Ze.isPortal=function(t){return yr(t)===p0};Ze.isProfiler=function(t){return yr(t)===Uh};Ze.isStrictMode=function(t){return yr(t)===Gh};Ze.isSuspense=function(t){return yr(t)===Vh};Ze.isSuspenseList=function(t){return yr(t)===qh};Ze.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===zh||t===Uh||t===Gh||t===Vh||t===qh||t===j3||typeof t=="object"&&t!==null&&(t.$$typeof===Yh||t.$$typeof===Kh||t.$$typeof===jh||t.$$typeof===Hh||t.$$typeof===Wh||t.$$typeof===Ax||t.getModuleId!==void 0)};Ze.typeOf=yr;(function(t){t.exports=Ze})(G3);function H3(){const t=P3();let e=null,n=null;return{clear(){e=null,n=null},notify(){t(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=e;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,a=n={callback:r,next:null,prev:n};return a.prev?a.prev.next=a:e=a,function(){!i||e===null||(i=!1,a.next?a.next.prev=a.prev:n=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}const aw={notify(){},get:()=>[]};function W3(t,e){let n,r=aw;function i(p){return c(),r.subscribe(p)}function a(){r.notify()}function s(){h.onStateChange&&h.onStateChange()}function u(){return Boolean(n)}function c(){n||(n=e?e.addNestedSub(s):t.subscribe(s),r=H3())}function f(){n&&(n(),n=void 0,r.clear(),r=aw)}const h={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:s,isSubscribed:u,trySubscribe:c,tryUnsubscribe:f,getListeners:()=>r};return h}const V3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",q3=V3?be.useLayoutEffect:be.useEffect;function K3({store:t,context:e,children:n,serverState:r}){const i=be.useMemo(()=>{const u=W3(t);return{store:t,subscription:u,getServerState:r?()=>r:void 0}},[t,r]),a=be.useMemo(()=>t.getState(),[t]);q3(()=>{const{subscription:u}=i;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==t.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[i,a]);const s=e||Yd;return As.createElement(s.Provider,{value:i},n)}R3(Lv.useSyncExternalStoreWithSelector);E3(_u.unstable_batchedUpdates);function ld(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ld=function(n){return typeof n}:ld=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ld(t)}function Y3(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ow(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function X3(t,e,n){return e&&ow(t.prototype,e),n&&ow(t,n),t}function Q3(t,e){return e&&(ld(e)==="object"||typeof e=="function")?e:ud(t)}function Dv(t){return Dv=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Dv(t)}function ud(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function J3(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Nv(t,e)}function Nv(t,e){return Nv=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Nv(t,e)}function cd(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ix=function(t){J3(e,t);function e(){var n,r;Y3(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=Q3(this,(n=Dv(e)).call.apply(n,[this].concat(a))),cd(ud(r),"state",{bootstrapped:!1}),cd(ud(r),"_unsubscribe",void 0),cd(ud(r),"handlePersistorState",function(){var u=r.props.persistor,c=u.getState(),f=c.bootstrapped;f&&(r.props.onBeforeLift?Promise.resolve(r.props.onBeforeLift()).finally(function(){return r.setState({bootstrapped:!0})}):r.setState({bootstrapped:!0}),r._unsubscribe&&r._unsubscribe())}),r}return X3(e,[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return typeof this.props.children=="function"?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}]),e}(be.PureComponent);cd(Ix,"defaultProps",{children:null,loading:null});function Br(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+t+(n.length?" "+n.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Ra(t){return!!t&&!!t[ct]}function ji(t){var e;return!!t&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var i=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===sN}(t)||Array.isArray(t)||!!t[hw]||!!(!((e=t.constructor)===null||e===void 0)&&e[hw])||g0(t)||m0(t))}function ho(t,e,n){n===void 0&&(n=!1),Ws(t)===0?(n?Object.keys:Ps)(t).forEach(function(r){n&&typeof r=="symbol"||e(r,t[r],t)}):t.forEach(function(r,i){return e(i,r,t)})}function Ws(t){var e=t[ct];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:g0(t)?2:m0(t)?3:0}function Es(t,e){return Ws(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Z3(t,e){return Ws(t)===2?t.get(e):t[e]}function Lx(t,e,n){var r=Ws(t);r===2?t.set(e,n):r===3?t.add(n):t[e]=n}function Mx(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function g0(t){return aN&&t instanceof Map}function m0(t){return oN&&t instanceof Set}function Za(t){return t.o||t.t}function v0(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Nx(t);delete e[ct];for(var n=Ps(e),r=0;r<n.length;r++){var i=n[r],a=e[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function y0(t,e){return e===void 0&&(e=!1),S0(t)||Ra(t)||!ji(t)||(Ws(t)>1&&(t.set=t.add=t.clear=t.delete=eN),Object.freeze(t),e&&ho(t,function(n,r){return y0(r,!0)},!0)),t}function eN(){Br(2)}function S0(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function li(t){var e=zv[t];return e||Br(18,t),e}function tN(t,e){zv[t]||(zv[t]=e)}function Bv(){return Fu}function gm(t,e){e&&(li("Patches"),t.u=[],t.s=[],t.v=e)}function Qd(t){Fv(t),t.p.forEach(nN),t.p=null}function Fv(t){t===Fu&&(Fu=t.l)}function sw(t){return Fu={p:[],l:Fu,h:t,m:!0,_:0}}function nN(t){var e=t[ct];e.i===0||e.i===1?e.j():e.O=!0}function mm(t,e){e._=e.p.length;var n=e.p[0],r=t!==void 0&&t!==n;return e.h.g||li("ES5").S(e,t,r),r?(n[ct].P&&(Qd(e),Br(4)),ji(t)&&(t=Jd(e,t),e.l||Zd(e,t)),e.u&&li("Patches").M(n[ct].t,t,e.u,e.s)):t=Jd(e,n,[]),Qd(e),e.u&&e.v(e.u,e.s),t!==Dx?t:void 0}function Jd(t,e,n){if(S0(e))return e;var r=e[ct];if(!r)return ho(e,function(u,c){return lw(t,r,e,u,c,n)},!0),e;if(r.A!==t)return e;if(!r.P)return Zd(t,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=v0(r.k):r.o,a=i,s=!1;r.i===3&&(a=new Set(i),i.clear(),s=!0),ho(a,function(u,c){return lw(t,r,i,u,c,n,s)}),Zd(t,i,!1),n&&t.u&&li("Patches").N(r,n,t.u,t.s)}return r.o}function lw(t,e,n,r,i,a,s){if(Ra(i)){var u=Jd(t,i,a&&e&&e.i!==3&&!Es(e.R,r)?a.concat(r):void 0);if(Lx(n,r,u),!Ra(u))return;t.m=!1}else s&&n.add(i);if(ji(i)&&!S0(i)){if(!t.h.D&&t._<1)return;Jd(t,i),e&&e.A.l||Zd(t,i)}}function Zd(t,e,n){n===void 0&&(n=!1),!t.l&&t.h.D&&t.m&&y0(e,n)}function vm(t,e){var n=t[ct];return(n?Za(n):t)[e]}function uw(t,e){if(e in t)for(var n=Object.getPrototypeOf(t);n;){var r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function pa(t){t.P||(t.P=!0,t.l&&pa(t.l))}function ym(t){t.o||(t.o=v0(t.t))}function $v(t,e,n){var r=g0(e)?li("MapSet").F(e,n):m0(e)?li("MapSet").T(e,n):t.g?function(i,a){var s=Array.isArray(i),u={i:s?1:0,A:a?a.A:Bv(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},c=u,f=$u;s&&(c=[u],f=Jl);var h=Proxy.revocable(c,f),p=h.revoke,g=h.proxy;return u.k=g,u.j=p,g}(e,n):li("ES5").J(e,n);return(n?n.A:Bv()).p.push(r),r}function rN(t){return Ra(t)||Br(22,t),function e(n){if(!ji(n))return n;var r,i=n[ct],a=Ws(n);if(i){if(!i.P&&(i.i<4||!li("ES5").K(i)))return i.t;i.I=!0,r=cw(n,a),i.I=!1}else r=cw(n,a);return ho(r,function(s,u){i&&Z3(i.t,s)===u||Lx(r,s,e(u))}),a===3?new Set(r):r}(t)}function cw(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return v0(t)}function iN(){function t(a,s){var u=i[a];return u?u.enumerable=s:i[a]=u={configurable:!0,enumerable:s,get:function(){var c=this[ct];return $u.get(c,a)},set:function(c){var f=this[ct];$u.set(f,a,c)}},u}function e(a){for(var s=a.length-1;s>=0;s--){var u=a[s][ct];if(!u.P)switch(u.i){case 5:r(u)&&pa(u);break;case 4:n(u)&&pa(u)}}}function n(a){for(var s=a.t,u=a.k,c=Ps(u),f=c.length-1;f>=0;f--){var h=c[f];if(h!==ct){var p=s[h];if(p===void 0&&!Es(s,h))return!0;var g=u[h],y=g&&g[ct];if(y?y.t!==p:!Mx(g,p))return!0}}var v=!!s[ct];return c.length!==Ps(s).length+(v?0:1)}function r(a){var s=a.k;if(s.length!==a.t.length)return!0;var u=Object.getOwnPropertyDescriptor(s,s.length-1);if(u&&!u.get)return!0;for(var c=0;c<s.length;c++)if(!s.hasOwnProperty(c))return!0;return!1}var i={};tN("ES5",{J:function(a,s){var u=Array.isArray(a),c=function(h,p){if(h){for(var g=Array(p.length),y=0;y<p.length;y++)Object.defineProperty(g,""+y,t(y,!0));return g}var v=Nx(p);delete v[ct];for(var w=Ps(v),x=0;x<w.length;x++){var _=w[x];v[_]=t(_,h||!!v[_].enumerable)}return Object.create(Object.getPrototypeOf(p),v)}(u,a),f={i:u?5:4,A:s?s.A:Bv(),P:!1,I:!1,R:{},l:s,t:a,k:c,o:null,O:!1,C:!1};return Object.defineProperty(c,ct,{value:f,writable:!0}),c},S:function(a,s,u){u?Ra(s)&&s[ct].A===a&&e(a.p):(a.u&&function c(f){if(f&&typeof f=="object"){var h=f[ct];if(h){var p=h.t,g=h.k,y=h.R,v=h.i;if(v===4)ho(g,function(C){C!==ct&&(p[C]!==void 0||Es(p,C)?y[C]||c(g[C]):(y[C]=!0,pa(h)))}),ho(p,function(C){g[C]!==void 0||Es(g,C)||(y[C]=!1,pa(h))});else if(v===5){if(r(h)&&(pa(h),y.length=!0),g.length<p.length)for(var w=g.length;w<p.length;w++)y[w]=!1;else for(var x=p.length;x<g.length;x++)y[x]=!0;for(var _=Math.min(g.length,p.length),S=0;S<_;S++)g.hasOwnProperty(S)||(y[S]=!0),y[S]===void 0&&c(g[S])}}}}(a.p[0]),e(a.p))},K:function(a){return a.i===4?n(a):r(a)}})}var fw,Fu,_0=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",aN=typeof Map<"u",oN=typeof Set<"u",dw=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Dx=_0?Symbol.for("immer-nothing"):((fw={})["immer-nothing"]=!0,fw),hw=_0?Symbol.for("immer-draftable"):"__$immer_draftable",ct=_0?Symbol.for("immer-state"):"__$immer_state",sN=""+Object.prototype.constructor,Ps=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Nx=Object.getOwnPropertyDescriptors||function(t){var e={};return Ps(t).forEach(function(n){e[n]=Object.getOwnPropertyDescriptor(t,n)}),e},zv={},$u={get:function(t,e){if(e===ct)return t;var n=Za(t);if(!Es(n,e))return function(i,a,s){var u,c=uw(a,s);return c?"value"in c?c.value:(u=c.get)===null||u===void 0?void 0:u.call(i.k):void 0}(t,n,e);var r=n[e];return t.I||!ji(r)?r:r===vm(t.t,e)?(ym(t),t.o[e]=$v(t.A.h,r,t)):r},has:function(t,e){return e in Za(t)},ownKeys:function(t){return Reflect.ownKeys(Za(t))},set:function(t,e,n){var r=uw(Za(t),e);if(r!=null&&r.set)return r.set.call(t.k,n),!0;if(!t.P){var i=vm(Za(t),e),a=i==null?void 0:i[ct];if(a&&a.t===n)return t.o[e]=n,t.R[e]=!1,!0;if(Mx(n,i)&&(n!==void 0||Es(t.t,e)))return!0;ym(t),pa(t)}return t.o[e]===n&&(n!==void 0||e in t.o)||Number.isNaN(n)&&Number.isNaN(t.o[e])||(t.o[e]=n,t.R[e]=!0),!0},deleteProperty:function(t,e){return vm(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,ym(t),pa(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var n=Za(t),r=Reflect.getOwnPropertyDescriptor(n,e);return r&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:r.enumerable,value:n[e]}},defineProperty:function(){Br(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Br(12)}},Jl={};ho($u,function(t,e){Jl[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Jl.deleteProperty=function(t,e){return Jl.set.call(this,t,e,void 0)},Jl.set=function(t,e,n){return $u.set.call(this,t[0],e,n,t[0])};var lN=function(){function t(n){var r=this;this.g=dw,this.D=!0,this.produce=function(i,a,s){if(typeof i=="function"&&typeof a!="function"){var u=a;a=i;var c=r;return function(w){var x=this;w===void 0&&(w=u);for(var _=arguments.length,S=Array(_>1?_-1:0),C=1;C<_;C++)S[C-1]=arguments[C];return c.produce(w,function(O){var I;return(I=a).call.apply(I,[x,O].concat(S))})}}var f;if(typeof a!="function"&&Br(6),s!==void 0&&typeof s!="function"&&Br(7),ji(i)){var h=sw(r),p=$v(r,i,void 0),g=!0;try{f=a(p),g=!1}finally{g?Qd(h):Fv(h)}return typeof Promise<"u"&&f instanceof Promise?f.then(function(w){return gm(h,s),mm(w,h)},function(w){throw Qd(h),w}):(gm(h,s),mm(f,h))}if(!i||typeof i!="object"){if((f=a(i))===void 0&&(f=i),f===Dx&&(f=void 0),r.D&&y0(f,!0),s){var y=[],v=[];li("Patches").M(i,f,y,v),s(y,v)}return f}Br(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(f){for(var h=arguments.length,p=Array(h>1?h-1:0),g=1;g<h;g++)p[g-1]=arguments[g];return r.produceWithPatches(f,function(y){return i.apply(void 0,[y].concat(p))})};var s,u,c=r.produce(i,a,function(f,h){s=f,u=h});return typeof Promise<"u"&&c instanceof Promise?c.then(function(f){return[f,s,u]}):[c,s,u]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var e=t.prototype;return e.createDraft=function(n){ji(n)||Br(8),Ra(n)&&(n=rN(n));var r=sw(this),i=$v(this,n,void 0);return i[ct].C=!0,Fv(r),i},e.finishDraft=function(n,r){var i=n&&n[ct],a=i.A;return gm(a,r),mm(void 0,a)},e.setAutoFreeze=function(n){this.D=n},e.setUseProxies=function(n){n&&!dw&&Br(20),this.g=n},e.applyPatches=function(n,r){var i;for(i=r.length-1;i>=0;i--){var a=r[i];if(a.path.length===0&&a.op==="replace"){n=a.value;break}}i>-1&&(r=r.slice(i+1));var s=li("Patches").$;return Ra(n)?s(n,r):this.produce(n,function(u){return s(u,r)})},t}(),Xn=new lN,Bx=Xn.produce;Xn.produceWithPatches.bind(Xn);Xn.setAutoFreeze.bind(Xn);Xn.setUseProxies.bind(Xn);Xn.applyPatches.bind(Xn);Xn.createDraft.bind(Xn);Xn.finishDraft.bind(Xn);function gr(t){return gr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gr(t)}function uN(t,e){if(gr(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(gr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fx(t){var e=uN(t,"string");return gr(e)==="symbol"?e:String(e)}function Ur(t,e,n){return e=Fx(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function gw(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?pw(Object(n),!0).forEach(function(r){Ur(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function un(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var mw=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Sm=function(){return Math.random().toString(36).substring(7).split("").join(".")},eh={INIT:"@@redux/INIT"+Sm(),REPLACE:"@@redux/REPLACE"+Sm(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Sm()}};function cN(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function w0(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(un(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(un(1));return n(w0)(t,e)}if(typeof t!="function")throw new Error(un(2));var i=t,a=e,s=[],u=s,c=!1;function f(){u===s&&(u=s.slice())}function h(){if(c)throw new Error(un(3));return a}function p(w){if(typeof w!="function")throw new Error(un(4));if(c)throw new Error(un(5));var x=!0;return f(),u.push(w),function(){if(x){if(c)throw new Error(un(6));x=!1,f();var S=u.indexOf(w);u.splice(S,1),s=null}}}function g(w){if(!cN(w))throw new Error(un(7));if(typeof w.type>"u")throw new Error(un(8));if(c)throw new Error(un(9));try{c=!0,a=i(a,w)}finally{c=!1}for(var x=s=u,_=0;_<x.length;_++){var S=x[_];S()}return w}function y(w){if(typeof w!="function")throw new Error(un(10));i=w,g({type:eh.REPLACE})}function v(){var w,x=p;return w={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(un(11));function C(){S.next&&S.next(h())}C();var O=x(C);return{unsubscribe:O}}},w[mw]=function(){return this},w}return g({type:eh.INIT}),r={dispatch:g,subscribe:p,getState:h,replaceReducer:y},r[mw]=v,r}function fN(t){Object.keys(t).forEach(function(e){var n=t[e],r=n(void 0,{type:eh.INIT});if(typeof r>"u")throw new Error(un(12));if(typeof n(void 0,{type:eh.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(un(13))})}function $x(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++){var i=e[r];typeof t[i]=="function"&&(n[i]=t[i])}var a=Object.keys(n),s;try{fN(n)}catch(u){s=u}return function(c,f){if(c===void 0&&(c={}),s)throw s;for(var h=!1,p={},g=0;g<a.length;g++){var y=a[g],v=n[y],w=c[y],x=v(w,f);if(typeof x>"u")throw f&&f.type,new Error(un(14));p[y]=x,h=h||x!==w}return h=h||a.length!==Object.keys(c).length,h?p:c}}function th(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.length===0?function(r){return r}:e.length===1?e[0]:e.reduce(function(r,i){return function(){return r(i.apply(void 0,arguments))}})}function dN(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){return function(){var i=r.apply(void 0,arguments),a=function(){throw new Error(un(15))},s={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},u=e.map(function(c){return c(s)});return a=th.apply(void 0,u)(i.dispatch),gw(gw({},i),{},{dispatch:a})}}}function zx(t){var e=function(r){var i=r.dispatch,a=r.getState;return function(s){return function(u){return typeof u=="function"?u(i,a,t):s(u)}}};return e}var Gx=zx();Gx.withExtraArgument=zx;const vw=Gx;var hN=globalThis&&globalThis.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),pN=globalThis&&globalThis.__generator||function(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(f){return function(h){return c([f,h])}}function c(f){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,i=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){n.label=f[1];break}if(f[0]===6&&n.label<a[1]){n.label=a[1],a=f;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(f);break}a[2]&&n.ops.pop(),n.trys.pop();continue}f=e.call(t,n)}catch(h){f=[6,h],i=0}finally{r=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},nh=globalThis&&globalThis.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n<r;n++,i++)t[i]=e[n];return t},gN=Object.defineProperty,mN=Object.defineProperties,vN=Object.getOwnPropertyDescriptors,yw=Object.getOwnPropertySymbols,yN=Object.prototype.hasOwnProperty,SN=Object.prototype.propertyIsEnumerable,Sw=function(t,e,n){return e in t?gN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n},Ea=function(t,e){for(var n in e||(e={}))yN.call(e,n)&&Sw(t,n,e[n]);if(yw)for(var r=0,i=yw(e);r<i.length;r++){var n=i[r];SN.call(e,n)&&Sw(t,n,e[n])}return t},_m=function(t,e){return mN(t,vN(e))},_N=function(t,e,n){return new Promise(function(r,i){var a=function(c){try{u(n.next(c))}catch(f){i(f)}},s=function(c){try{u(n.throw(c))}catch(f){i(f)}},u=function(c){return c.done?r(c.value):Promise.resolve(c.value).then(a,s)};u((n=n.apply(t,e)).next())})},wN=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?th:th.apply(null,arguments)};function bN(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var n=e;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return e===n}var CN=function(t){hN(e,t);function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=t.apply(this,n)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.prototype.concat.apply(this,n)},e.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(e.bind.apply(e,nh([void 0],n[0].concat(this)))):new(e.bind.apply(e,nh([void 0],n.concat(this))))},e}(Array);function Gv(t){return ji(t)?Bx(t,function(){}):t}function xN(t){return typeof t=="boolean"}function kN(){return function(e){return EN(e)}}function EN(t){t===void 0&&(t={});var e=t.thunk,n=e===void 0?!0:e;t.immutableCheck,t.serializableCheck;var r=new CN;return n&&(xN(n)?r.push(vw):r.push(vw.withExtraArgument(n.extraArgument))),r}var PN=!0;function ON(t){var e=kN(),n=t||{},r=n.reducer,i=r===void 0?void 0:r,a=n.middleware,s=a===void 0?e():a,u=n.devTools,c=u===void 0?!0:u,f=n.preloadedState,h=f===void 0?void 0:f,p=n.enhancers,g=p===void 0?void 0:p,y;if(typeof i=="function")y=i;else if(bN(i))y=$x(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=s;typeof v=="function"&&(v=v(e));var w=dN.apply(void 0,v),x=th;c&&(x=wN(Ea({trace:!PN},typeof c=="object"&&c)));var _=[w];Array.isArray(g)?_=nh([w],g):typeof g=="function"&&(_=g(_));var S=x.apply(void 0,_);return w0(y,h,S)}function dt(t,e){function n(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(e){var a=e.apply(void 0,r);if(!a)throw new Error("prepareAction did not return an object");return Ea(Ea({type:t,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:t,payload:r[0]}}return n.toString=function(){return""+t},n.type=t,n.match=function(r){return r.type===t},n}function Ux(t){var e={},n=[],r,i={addCase:function(a,s){var u=typeof a=="string"?a:a.type;if(u in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[u]=s,i},addMatcher:function(a,s){return n.push({matcher:a,reducer:s}),i},addDefaultCase:function(a){return r=a,i}};return t(i),[e,n,r]}function TN(t){return typeof t=="function"}function RN(t,e,n,r){n===void 0&&(n=[]);var i=typeof e=="function"?Ux(e):[e,n,r],a=i[0],s=i[1],u=i[2],c;if(TN(t))c=function(){return Gv(t())};else{var f=Gv(t);c=function(){return f}}function h(p,g){p===void 0&&(p=c());var y=nh([a[g.type]],s.filter(function(v){var w=v.matcher;return w(g)}).map(function(v){var w=v.reducer;return w}));return y.filter(function(v){return!!v}).length===0&&(y=[u]),y.reduce(function(v,w){if(w)if(Ra(v)){var x=v,_=w(x,g);return _===void 0?v:_}else{if(ji(v))return Bx(v,function(S){return w(S,g)});var _=w(v,g);if(_===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return _}return v},p)}return h.getInitialState=c,h}function AN(t,e){return t+"/"+e}function vo(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof t.initialState=="function"?t.initialState:Gv(t.initialState),r=t.reducers||{},i=Object.keys(r),a={},s={},u={};i.forEach(function(h){var p=r[h],g=AN(e,h),y,v;"reducer"in p?(y=p.reducer,v=p.prepare):y=p,a[h]=y,s[g]=y,u[h]=v?dt(g,v):dt(g)});function c(){var h=typeof t.extraReducers=="function"?Ux(t.extraReducers):[t.extraReducers],p=h[0],g=p===void 0?{}:p,y=h[1],v=y===void 0?[]:y,w=h[2],x=w===void 0?void 0:w,_=Ea(Ea({},g),s);return RN(n,function(S){for(var C in _)S.addCase(C,_[C]);for(var O=0,I=v;O<I.length;O++){var L=I[O];S.addMatcher(L.matcher,L.reducer)}x&&S.addDefaultCase(x)})}var f;return{name:e,reducer:function(h,p){return f||(f=c()),f(h,p)},actions:u,caseReducers:a,getInitialState:function(){return f||(f=c()),f.getInitialState()}}}var IN="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",LN=function(t){t===void 0&&(t=21);for(var e="",n=t;n--;)e+=IN[Math.random()*64|0];return e},MN=["name","message","stack","code"],wm=function(){function t(e,n){this.payload=e,this.meta=n}return t}(),_w=function(){function t(e,n){this.payload=e,this.meta=n}return t}(),DN=function(t){if(typeof t=="object"&&t!==null){for(var e={},n=0,r=MN;n<r.length;n++){var i=r[n];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}};(function(){function t(e,n,r){var i=dt(e+"/fulfilled",function(f,h,p,g){return{payload:f,meta:_m(Ea({},g||{}),{arg:p,requestId:h,requestStatus:"fulfilled"})}}),a=dt(e+"/pending",function(f,h,p){return{payload:void 0,meta:_m(Ea({},p||{}),{arg:h,requestId:f,requestStatus:"pending"})}}),s=dt(e+"/rejected",function(f,h,p,g,y){return{payload:g,error:(r&&r.serializeError||DN)(f||"Rejected"),meta:_m(Ea({},y||{}),{arg:p,requestId:h,rejectedWithValue:!!g,requestStatus:"rejected",aborted:(f==null?void 0:f.name)==="AbortError",condition:(f==null?void 0:f.name)==="ConditionError"})}}),u=typeof AbortController<"u"?AbortController:function(){function f(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return f.prototype.abort=function(){},f}();function c(f){return function(h,p,g){var y=r!=null&&r.idGenerator?r.idGenerator(f):LN(),v=new u,w;function x(S){w=S,v.abort()}var _=function(){return _N(this,null,function(){var S,C,O,I,L,D,U;return pN(this,function(X){switch(X.label){case 0:return X.trys.push([0,4,,5]),I=(S=r==null?void 0:r.condition)==null?void 0:S.call(r,f,{getState:p,extra:g}),BN(I)?[4,I]:[3,2];case 1:I=X.sent(),X.label=2;case 2:if(I===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return L=new Promise(function(K,te){return v.signal.addEventListener("abort",function(){return te({name:"AbortError",message:w||"Aborted"})})}),h(a(y,f,(C=r==null?void 0:r.getPendingMeta)==null?void 0:C.call(r,{requestId:y,arg:f},{getState:p,extra:g}))),[4,Promise.race([L,Promise.resolve(n(f,{dispatch:h,getState:p,extra:g,requestId:y,signal:v.signal,abort:x,rejectWithValue:function(K,te){return new wm(K,te)},fulfillWithValue:function(K,te){return new _w(K,te)}})).then(function(K){if(K instanceof wm)throw K;return K instanceof _w?i(K.payload,y,f,K.meta):i(K,y,f)})])];case 3:return O=X.sent(),[3,5];case 4:return D=X.sent(),O=D instanceof wm?s(null,y,f,D.payload,D.meta):s(D,y,f),[3,5];case 5:return U=r&&!r.dispatchConditionRejection&&s.match(O)&&O.meta.condition,U||h(O),[2,O]}})})}();return Object.assign(_,{abort:x,requestId:y,arg:f,unwrap:function(){return _.then(NN)}})}}return Object.assign(c,{pending:a,rejected:s,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t})();function NN(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function BN(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var b0="listenerMiddleware";dt(b0+"/add");dt(b0+"/removeAll");dt(b0+"/remove");var ww;typeof queueMicrotask=="function"&&queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis);iN();var C0="persist:",jx="persist/FLUSH",x0="persist/REHYDRATE",Hx="persist/PAUSE",Wx="persist/PERSIST",Vx="persist/PURGE",qx="persist/REGISTER",FN=-1;function fd(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fd=function(n){return typeof n}:fd=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},fd(t)}function bw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function $N(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?bw(n,!0).forEach(function(r){zN(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bw(n).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zN(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function GN(t,e,n,r){r.debug;var i=$N({},n);return t&&fd(t)==="object"&&Object.keys(t).forEach(function(a){a!=="_persist"&&e[a]===n[a]&&(i[a]=t[a])}),i}function UN(t){var e=t.blacklist||null,n=t.whitelist||null,r=t.transforms||[],i=t.throttle||0,a=t.debounce||0,s="".concat(t.keyPrefix!==void 0?t.keyPrefix:C0).concat(t.key),u=t.storage,c;t.serialize===!1?c=function(D){return D}:typeof t.serialize=="function"?c=t.serialize:c=jN;var f=t.writeFailHandler||null,h={},p={},g=[],y=null,v=null;let w=0;function x(L){clearTimeout(w),w=setTimeout(()=>{Object.keys(L).forEach(function(D){C(D)&&h[D]!==L[D]&&g.indexOf(D)===-1&&g.push(D)}),Object.keys(h).forEach(function(D){L[D]===void 0&&C(D)&&g.indexOf(D)===-1&&h[D]!==void 0&&g.push(D)}),y===null&&(y=setInterval(_,i)),h=L},a)}function _(){if(g.length===0){y&&clearInterval(y),y=null;return}var L=g.shift(),D=r.reduce(function(U,X){return X.in(U,L,h)},h[L]);if(D!==void 0)try{p[L]=c(D)}catch(U){console.error("redux-persist/createPersistoid: error serializing state",U)}else delete p[L];g.length===0&&S()}function S(){Object.keys(p).forEach(function(L){h[L]===void 0&&delete p[L]}),v=u.setItem(s,c(p)).catch(O)}function C(L){return!(n&&n.indexOf(L)===-1&&L!=="_persist"||e&&e.indexOf(L)!==-1)}function O(L){f&&f(L)}var I=function(){for(;g.length!==0;)_();return v||Promise.resolve()};return{update:x,flush:I}}function jN(t){return JSON.stringify(t)}function HN(t){var e=t.transforms||[],n="".concat(t.keyPrefix!==void 0?t.keyPrefix:C0).concat(t.key),r=t.storage;t.debug;var i;return t.deserialize===!1?i=function(s){return s}:typeof t.deserialize=="function"?i=t.deserialize:i=WN,r.getItem(n).then(function(a){if(a)try{var s={},u=i(a);return Object.keys(u).forEach(function(c){s[c]=e.reduceRight(function(f,h){return h.out(f,c,u)},i(u[c]))}),s}catch(c){throw c}else return})}function WN(t){return JSON.parse(t)}function VN(t){var e=t.storage,n="".concat(t.keyPrefix!==void 0?t.keyPrefix:C0).concat(t.key);return e.removeItem(n,qN)}function qN(t){}function Cw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ti(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Cw(n,!0).forEach(function(r){KN(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cw(n).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function KN(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function YN(t,e){if(t==null)return{};var n=XN(t,e),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)r=a[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function XN(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,a;for(a=0;a<r.length;a++)i=r[a],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var QN=5e3;function JN(t,e){var n=t.version!==void 0?t.version:FN;t.debug;var r=t.stateReconciler===void 0?GN:t.stateReconciler,i=t.getStoredState||HN,a=t.timeout!==void 0?t.timeout:QN,s=null,u=!1,c=!0,f=function(p){return p._persist.rehydrated&&s&&!c&&s.update(p),p};return function(h,p){var g=h||{},y=g._persist,v=YN(g,["_persist"]),w=v;if(p.type===Wx){var x=!1,_=function(U,X){x||(p.rehydrate(t.key,U,X),x=!0)};if(a&&setTimeout(function(){!x&&_(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(t.key,'"')))},a),c=!1,s||(s=UN(t)),y)return Ti({},e(w,p),{_persist:y});if(typeof p.rehydrate!="function"||typeof p.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return p.register(t.key),i(t).then(function(D){var U=t.migrate||function(X,K){return Promise.resolve(X)};U(D,n).then(function(X){_(X)},function(X){_(void 0,X)})},function(D){_(void 0,D)}),Ti({},e(w,p),{_persist:{version:n,rehydrated:!1}})}else{if(p.type===Vx)return u=!0,p.result(VN(t)),Ti({},e(w,p),{_persist:y});if(p.type===jx)return p.result(s&&s.flush()),Ti({},e(w,p),{_persist:y});if(p.type===Hx)c=!0;else if(p.type===x0){if(u)return Ti({},w,{_persist:Ti({},y,{rehydrated:!0})});if(p.key===t.key){var S=e(w,p),C=p.payload,O=r!==!1&&C!==void 0?r(C,h,S,t):S,I=Ti({},O,{_persist:Ti({},y,{rehydrated:!0})});return f(I)}}}if(!y)return e(h,p);var L=e(w,p);return L===w?h:f(Ti({},L,{_persist:y}))}}function xw(t){return t5(t)||e5(t)||ZN()}function ZN(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function e5(t){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]")return Array.from(t)}function t5(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}function kw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Uv(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?kw(n,!0).forEach(function(r){n5(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kw(n).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function n5(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Kx={registry:[],bootstrapped:!1},r5=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Kx,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case qx:return Uv({},e,{registry:[].concat(xw(e.registry),[n.key])});case x0:var r=e.registry.indexOf(n.key),i=xw(e.registry);return i.splice(r,1),Uv({},e,{registry:i,bootstrapped:i.length===0});default:return e}};function i5(t,e,n){var r=n||!1,i=w0(r5,Kx,e&&e.enhancer?e.enhancer:void 0),a=function(f){i.dispatch({type:qx,key:f})},s=function(f,h,p){var g={type:x0,payload:h,err:p,key:f};t.dispatch(g),i.dispatch(g),r&&u.getState().bootstrapped&&(r(),r=!1)},u=Uv({},i,{purge:function(){var f=[];return t.dispatch({type:Vx,result:function(p){f.push(p)}}),Promise.all(f)},flush:function(){var f=[];return t.dispatch({type:jx,result:function(p){f.push(p)}}),Promise.all(f)},pause:function(){t.dispatch({type:Hx})},persist:function(){t.dispatch({type:Wx,register:a,rehydrate:s})}});return e&&e.manualPersist||u.persist(),u}var k0={},E0={};E0.__esModule=!0;E0.default=s5;function dd(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dd=function(n){return typeof n}:dd=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},dd(t)}function bm(){}var a5={getItem:bm,setItem:bm,removeItem:bm};function o5(t){if((typeof self>"u"?"undefined":dd(self))!=="object"||!(t in self))return!1;try{var e=self[t],n="redux-persist ".concat(t," test");e.setItem(n,"test"),e.getItem(n),e.removeItem(n)}catch{return!1}return!0}function s5(t){var e="".concat(t,"Storage");return o5(e)?self[e]:a5}k0.__esModule=!0;k0.default=c5;var l5=u5(E0);function u5(t){return t&&t.__esModule?t:{default:t}}function c5(t){var e=(0,l5.default)(t);return{getItem:function(r){return new Promise(function(i,a){i(e.getItem(r))})},setItem:function(r,i){return new Promise(function(a,s){a(e.setItem(r,i))})},removeItem:function(r){return new Promise(function(i,a){i(e.removeItem(r))})}}}var Yx=void 0,f5=d5(k0);function d5(t){return t&&t.__esModule?t:{default:t}}var h5=(0,f5.default)("local");Yx=h5;var Xx={},Qx={},po={};Object.defineProperty(po,"__esModule",{value:!0});po.PLACEHOLDER_UNDEFINED=po.PACKAGE_NAME=void 0;po.PACKAGE_NAME="redux-deep-persist";po.PLACEHOLDER_UNDEFINED="@@placeholder/undefined";var P0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigType=void 0,function(e){e[e.WHITELIST=0]="WHITELIST",e[e.BLACKLIST=1]="BLACKLIST"}(t.ConfigType||(t.ConfigType={}))})(P0);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getRootKeysGroup=t.throwError=t.configValidator=t.transformsValidator=t.singleTransformValidator=t.findDuplicatesAndSubsets=t.unique=t.preserveUndefined=t.mergeDeep=t.dissocPath=t.assocPath=t.path=t.difference=t.cloneDeep=t._cloneDeep=t.getCircularPath=t.isEmpty=t.isDate=t.isString=t.isIntegerString=t.isPlainObject=t.isArray=t.isLength=t.isObjectLike=void 0;const e=po,n=P0,r=function(j){return typeof j=="object"&&j!==null};t.isObjectLike=r;const i=function(j){return typeof j=="number"&&j>-1&&j%1==0&&j<=Number.MAX_SAFE_INTEGER};t.isLength=i,t.isArray=Array.isArray||function(j){return(0,t.isLength)(j&&j.length)&&Object.prototype.toString.call(j)==="[object Array]"};const a=function(j){return!!j&&typeof j=="object"&&!(0,t.isArray)(j)};t.isPlainObject=a;const s=function(j){return String(~~j)===j&&Number(j)>=0};t.isIntegerString=s;const u=function(j){return Object.prototype.toString.call(j)==="[object String]"};t.isString=u;const c=function(j){return Object.prototype.toString.call(j)==="[object Date]"};t.isDate=c;const f=function(j){return Object.keys(j).length===0};t.isEmpty=f;const h=Object.prototype.hasOwnProperty,p=function(j,T,$){$||($=new Set([j])),T||(T="");for(const V in j){const ie=T?`${T}.${V}`:V,H=j[V];if((0,t.isObjectLike)(H))return $.has(H)?`${T}.${V}:<Circular>`:($.add(H),(0,t.getCircularPath)(H,ie,$))}return null};t.getCircularPath=p;const g=function(j){if(!(0,t.isObjectLike)(j))return j;if((0,t.isDate)(j))return new Date(+j);const T=(0,t.isArray)(j)?[]:{};for(const $ in j){const V=j[$];T[$]=(0,t._cloneDeep)(V)}return T};t._cloneDeep=g;const y=function(j){const T=(0,t.getCircularPath)(j);if(T)throw new Error(`${e.PACKAGE_NAME}: circular dependency detected under the path '${T}' of object you're trying to persist: ${j}`);return(0,t._cloneDeep)(j)};t.cloneDeep=y;const v=function(j,T){if(j===T)return{};if(!(0,t.isObjectLike)(j)||!(0,t.isObjectLike)(T))return T;const $=(0,t.cloneDeep)(j),V=(0,t.cloneDeep)(T),ie=Object.keys($).reduce((Y,Q)=>(h.call(V,Q)||(Y[Q]=void 0),Y),{});if((0,t.isDate)($)||(0,t.isDate)(V))return $.valueOf()===V.valueOf()?{}:V;const H=Object.keys(V).reduce((Y,Q)=>{if(!h.call($,Q))return Y[Q]=V[Q],Y;const oe=(0,t.difference)($[Q],V[Q]);return(0,t.isObjectLike)(oe)&&(0,t.isEmpty)(oe)&&!(0,t.isDate)(oe)?(0,t.isArray)($)&&!(0,t.isArray)(V)||!(0,t.isArray)($)&&(0,t.isArray)(V)?V:Y:(Y[Q]=oe,Y)},ie);return delete H._persist,H};t.difference=v;const w=function(j,T){return T.reduce(($,V)=>{if($){const ie=parseInt(V,10),H=(0,t.isIntegerString)(V)&&ie<0?$.length+ie:V;return(0,t.isString)($)?$.charAt(H):$[H]}},j)};t.path=w;const x=function(j,T){return[...j].reverse().reduce((ie,H,Y)=>{const Q=(0,t.isIntegerString)(H)?[]:{};return Q[H]=Y===0?T:ie,Q},{})};t.assocPath=x;const _=function(j,T){const $=(0,t.cloneDeep)(j);return T.reduce((V,ie,H)=>(H===T.length-1&&V&&(0,t.isObjectLike)(V)&&delete V[ie],V&&V[ie]),$),$};t.dissocPath=_;const S=function(j,T,...$){if(!$||!$.length)return T;const V=$.shift(),{preservePlaceholder:ie,preserveUndefined:H}=j;if((0,t.isObjectLike)(T)&&(0,t.isObjectLike)(V))for(const Y in V)if((0,t.isObjectLike)(V[Y])&&(0,t.isObjectLike)(T[Y]))T[Y]||(T[Y]={}),S(j,T[Y],V[Y]);else if((0,t.isArray)(T)){let Q=V[Y];const oe=ie?e.PLACEHOLDER_UNDEFINED:void 0;H||(Q=typeof Q<"u"?Q:T[parseInt(Y,10)]),Q=Q!==e.PLACEHOLDER_UNDEFINED?Q:oe,T[parseInt(Y,10)]=Q}else{const Q=V[Y]!==e.PLACEHOLDER_UNDEFINED?V[Y]:void 0;T[Y]=Q}return S(j,T,...$)},C=function(j,T,$){return S({preservePlaceholder:$==null?void 0:$.preservePlaceholder,preserveUndefined:$==null?void 0:$.preserveUndefined},(0,t.cloneDeep)(j),(0,t.cloneDeep)(T))};t.mergeDeep=C;const O=function(j,T=[],$,V,ie){if(!(0,t.isObjectLike)(j))return j;for(const H in j){const Y=j[H],Q=(0,t.isArray)(j),oe=V?V+"."+H:H;Y===null&&($===n.ConfigType.WHITELIST&&T.indexOf(oe)===-1||$===n.ConfigType.BLACKLIST&&T.indexOf(oe)!==-1)&&Q&&(j[parseInt(H,10)]=void 0),Y===void 0&&ie&&$===n.ConfigType.BLACKLIST&&T.indexOf(oe)===-1&&Q&&(j[parseInt(H,10)]=e.PLACEHOLDER_UNDEFINED),O(Y,T,$,oe,ie)}},I=function(j,T,$,V){const ie=(0,t.cloneDeep)(j);return O(ie,T,$,"",V),ie};t.preserveUndefined=I;const L=function(j,T,$){return $.indexOf(j)===T};t.unique=L;const D=function(j){return j.reduce((T,$)=>{const V=j.filter(ve=>ve===$),ie=j.filter(ve=>($+".").indexOf(ve+".")===0),{duplicates:H,subsets:Y}=T,Q=V.length>1&&H.indexOf($)===-1,oe=ie.length>1;return{duplicates:[...H,...Q?V:[]],subsets:[...Y,...oe?ie:[]].filter(t.unique).sort()}},{duplicates:[],subsets:[]})};t.findDuplicatesAndSubsets=D;const U=function(j,T,$){const V=$===n.ConfigType.WHITELIST?"whitelist":"blacklist",ie=`${e.PACKAGE_NAME}: incorrect ${V} configuration.`,H=`Check your create${$===n.ConfigType.WHITELIST?"White":"Black"}list arguments.
`;if(!(0,t.isString)(T)||T.length<1)throw new Error(`${ie} Name (key) of reducer is required. ${H}`);if(!j||!j.length)return;const{duplicates:Y,subsets:Q}=(0,t.findDuplicatesAndSubsets)(j);if(Y.length>1)throw new Error(`${ie} Duplicated paths.
${JSON.stringify(Y)}
${H}`);if(Q.length>1)throw new Error(`${ie} You are trying to persist an entire property and also some of its subset.
${JSON.stringify(Q)}
${H}`)};t.singleTransformValidator=U;const X=function(j){if(!(0,t.isArray)(j))return;const T=(j==null?void 0:j.map($=>$.deepPersistKey).filter($=>$))||[];if(T.length){const $=T.filter((V,ie)=>T.indexOf(V)!==ie);if($.length)throw new Error(`${e.PACKAGE_NAME}: found duplicated keys in transforms creators. You can createWhitelist or createBlacklist for a specific root reducer key only once. Duplicated keys among createWhitelist and createBlacklist transforms are not allowed.
Duplicates: ${JSON.stringify($)}`)}};t.transformsValidator=X;const K=function({whitelist:j,blacklist:T}){if(j&&j.length&&T&&T.length)throw new Error(`${e.PACKAGE_NAME}: you should not define a whitelist and blacklist in parallel. It is allowed to use only one of these lists per config.`);if(j){const{duplicates:$,subsets:V}=(0,t.findDuplicatesAndSubsets)(j);(0,t.throwError)({duplicates:$,subsets:V},"whitelist")}if(T){const{duplicates:$,subsets:V}=(0,t.findDuplicatesAndSubsets)(T);(0,t.throwError)({duplicates:$,subsets:V},"blacklist")}};t.configValidator=K;const te=function({duplicates:j,subsets:T},$){if(j.length)throw new Error(`${e.PACKAGE_NAME}: duplicates of paths found in your ${$}.
${JSON.stringify(j)}`);if(T.length)throw new Error(`${e.PACKAGE_NAME}: subsets of some parent keys found in your ${$}. You must decide if you want to persist an entire path or its specific subset.
${JSON.stringify(T)}`)};t.throwError=te;const ce=function(j){return(0,t.isArray)(j)?j.filter(t.unique).reduce((T,$)=>{const V=$.split("."),ie=V[0],H=V.slice(1).join(".")||void 0,Y=T.filter(oe=>Object.keys(oe)[0]===ie)[0],Q=Y?Object.values(Y)[0]:void 0;return Y||T.push({[ie]:H?[H]:void 0}),Y&&!Q&&H&&(Y[ie]=[H]),Y&&Q&&H&&Q.push(H),T},[]):[]};t.getRootKeysGroup=ce})(Qx);(function(t){var e=yn&&yn.__rest||function(p,g){var y={};for(var v in p)Object.prototype.hasOwnProperty.call(p,v)&&g.indexOf(v)<0&&(y[v]=p[v]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var w=0,v=Object.getOwnPropertySymbols(p);w<v.length;w++)g.indexOf(v[w])<0&&Object.prototype.propertyIsEnumerable.call(p,v[w])&&(y[v[w]]=p[v[w]]);return y};Object.defineProperty(t,"__esModule",{value:!0}),t.getPersistConfig=t.getTransforms=t.createBlacklist=t.createWhitelist=t.autoMergeDeep=void 0;const n=Qx,r=po,i=P0,a=function(p,g,y={}){const v=y.whitelist||null,w=y.blacklist||null;function x(_){return!!(v&&v.indexOf(_)===-1||w&&w.indexOf(_)!==-1)}return{in:(_,S,C)=>!x(S)&&p?p(_,S,C):_,out:(_,S,C)=>!x(S)&&g?g(_,S,C):_,deepPersistKey:v&&v[0]}},s=(p,g,y,{debug:v,whitelist:w,blacklist:x,transforms:_})=>{if(w||x)throw new Error("State reconciler autoMergeDeep uses custom transforms instead of old whitelist or blacklist config properties. Please use createWhitelist or createBlacklist transforms.");(0,n.transformsValidator)(_);const S=(0,n.cloneDeep)(y);let C=p;if(C&&(0,n.isObjectLike)(C)){const O=(0,n.difference)(g,y);(0,n.isEmpty)(O)||(C=(0,n.mergeDeep)(p,O,{preserveUndefined:!0}),v&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: sub state of your state was modified by reducer during rehydration. Values from reducer will be kept: ${JSON.stringify(O)}`)),Object.keys(C).forEach(I=>{if(I!=="_persist"){if((0,n.isObjectLike)(S[I])){S[I]=(0,n.mergeDeep)(S[I],C[I]);return}S[I]=C[I]}})}return v&&C&&(0,n.isObjectLike)(C)&&console.log(`${r.PACKAGE_NAME}/autoMergeDeep: rehydrated keys ${JSON.stringify(C)}`),S};t.autoMergeDeep=s;const u=(p,g)=>((0,n.singleTransformValidator)(g,p,i.ConfigType.WHITELIST),a(y=>{if(!g||!g.length)return y;let v=null,w;return g.forEach(x=>{const _=x.split(".");w=(0,n.path)(y,_),typeof w>"u"&&(0,n.isIntegerString)(_[_.length-1])&&(w=r.PLACEHOLDER_UNDEFINED);const S=(0,n.assocPath)(_,w),C=(0,n.isArray)(S)?[]:{};v=(0,n.mergeDeep)(v||C,S,{preservePlaceholder:!0})}),v||y},y=>(0,n.preserveUndefined)(y,g,i.ConfigType.WHITELIST),{whitelist:[p]}));t.createWhitelist=u;const c=(p,g)=>((0,n.singleTransformValidator)(g,p,i.ConfigType.BLACKLIST),a(y=>{if(!g||!g.length)return;const v=(0,n.preserveUndefined)(y,g,i.ConfigType.BLACKLIST,!0);return g.map(x=>x.split(".")).reduce((x,_)=>(0,n.dissocPath)(x,_),v)},y=>(0,n.preserveUndefined)(y,g,i.ConfigType.BLACKLIST),{whitelist:[p]}));t.createBlacklist=c;const f=function(p,g){return g.map(y=>{const v=Object.keys(y)[0],w=y[v];return p===i.ConfigType.WHITELIST?(0,t.createWhitelist)(v,w):(0,t.createBlacklist)(v,w)})};t.getTransforms=f;const h=p=>{var{key:g,whitelist:y,blacklist:v,storage:w,transforms:x,rootReducer:_}=p,S=e(p,["key","whitelist","blacklist","storage","transforms","rootReducer"]);(0,n.configValidator)({whitelist:y,blacklist:v});const C=(0,n.getRootKeysGroup)(y),O=(0,n.getRootKeysGroup)(v),I=Object.keys(_(void 0,{type:""})),L=C.map(ce=>Object.keys(ce)[0]),D=O.map(ce=>Object.keys(ce)[0]),U=I.filter(ce=>L.indexOf(ce)===-1&&D.indexOf(ce)===-1),X=(0,t.getTransforms)(i.ConfigType.WHITELIST,C),K=(0,t.getTransforms)(i.ConfigType.BLACKLIST,O),te=(0,n.isArray)(y)?U.map(ce=>(0,t.createBlacklist)(ce)):[];return Object.assign(Object.assign({},S),{key:g,storage:w,transforms:[...X,...K,...te,...x||[]],stateReconciler:t.autoMergeDeep})};t.getPersistConfig=h})(Xx);const Of=(t,e)=>Math.floor(t/e)*e,va=(t,e)=>Math.round(t/e)*e;var _t={},p5={get exports(){return _t},set exports(t){_t=t}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/(function(t,e){(function(){var n,r="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",u="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",f=500,h="__lodash_placeholder__",p=1,g=2,y=4,v=1,w=2,x=1,_=2,S=4,C=8,O=16,I=32,L=64,D=128,U=256,X=512,K=30,te="...",ce=800,j=16,T=1,$=2,V=3,ie=1/0,H=9007199254740991,Y=17976931348623157e292,Q=0/0,oe=4294967295,ve=oe-1,we=oe>>>1,Ue=[["ary",D],["bind",x],["bindKey",_],["curry",C],["curryRight",O],["flip",X],["partial",I],["partialRight",L],["rearg",U]],At="[object Arguments]",me="[object Array]",qt="[object AsyncFunction]",Bt="[object Boolean]",bn="[object Date]",wr="[object DOMException]",Ft="[object Error]",xe="[object Function]",Hr="[object GeneratorFunction]",Pt="[object Map]",gi="[object Number]",Xs="[object Null]",Mn="[object Object]",Fa="[object Promise]",Qs="[object Proxy]",er="[object RegExp]",Kt="[object Set]",Dn="[object String]",bt="[object Symbol]",$a="[object Undefined]",Wr="[object WeakMap]",Co="[object WeakSet]",Vr="[object ArrayBuffer]",br="[object DataView]",xo="[object Float32Array]",ko="[object Float64Array]",Eo="[object Int8Array]",Po="[object Int16Array]",Oo="[object Int32Array]",Js="[object Uint8Array]",Zs="[object Uint8ClampedArray]",Cr="[object Uint16Array]",Ki="[object Uint32Array]",sp=/\b__p \+= '';/g,nc=/\b(__p \+=) '' \+/g,lp=/(__e\(.*?\)|\b__t\)) \+\n'';/g,el=/&(?:amp|lt|gt|quot|#39);/g,Yi=/[&<>"']/g,up=RegExp(el.source),mi=RegExp(Yi.source),cp=/<%-([\s\S]+?)%>/g,fp=/<%([\s\S]+?)%>/g,rc=/<%=([\s\S]+?)%>/g,dp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hp=/^\w*$/,xr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tl=/[\\^$.*+?()[\]{}|]/g,pp=RegExp(tl.source),nl=/^\s+/,gp=/\s/,mp=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Xi=/\{\n\/\* \[wrapped with (.+)\] \*/,vp=/,? & /,yp=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Sp=/[()=,{}\[\]\/\s]/,_p=/\\(\\)?/g,wp=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vi=/\w*$/,bp=/^[-+]0x[0-9a-f]+$/i,Cp=/^0b[01]+$/i,xp=/^\[object .+?Constructor\]$/,kp=/^0o[0-7]+$/i,Ep=/^(?:0|[1-9]\d*)$/,Pp=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qi=/($^)/,Op=/['\n\r\u2028\u2029\\]/g,yi="\\ud800-\\udfff",rl="\\u0300-\\u036f",Tp="\\ufe20-\\ufe2f",To="\\u20d0-\\u20ff",il=rl+Tp+To,ic="\\u2700-\\u27bf",ac="a-z\\xdf-\\xf6\\xf8-\\xff",Rp="\\xac\\xb1\\xd7\\xf7",oc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ap="\\u2000-\\u206f",Ip=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",sc="A-Z\\xc0-\\xd6\\xd8-\\xde",lc="\\ufe0e\\ufe0f",uc=Rp+oc+Ap+Ip,al="[']",Lp="["+yi+"]",cc="["+uc+"]",Ro="["+il+"]",fc="\\d+",Ao="["+ic+"]",Io="["+ac+"]",dc="[^"+yi+uc+fc+ic+ac+sc+"]",ol="\\ud83c[\\udffb-\\udfff]",hc="(?:"+Ro+"|"+ol+")",pc="[^"+yi+"]",sl="(?:\\ud83c[\\udde6-\\uddff]){2}",ll="[\\ud800-\\udbff][\\udc00-\\udfff]",Si="["+sc+"]",gc="\\u200d",mc="(?:"+Io+"|"+dc+")",Mp="(?:"+Si+"|"+dc+")",Lo="(?:"+al+"(?:d|ll|m|re|s|t|ve))?",vc="(?:"+al+"(?:D|LL|M|RE|S|T|VE))?",yc=hc+"?",Sc="["+lc+"]?",Mo="(?:"+gc+"(?:"+[pc,sl,ll].join("|")+")"+Sc+yc+")*",ul="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Do=Sc+yc+Mo,Dp="(?:"+[Ao,sl,ll].join("|")+")"+Do,_c="(?:"+[pc+Ro+"?",Ro,sl,ll,Lp].join("|")+")",fl=RegExp(al,"g"),wc=RegExp(Ro,"g"),kr=RegExp(ol+"(?="+ol+")|"+_c+Do,"g"),za=RegExp([Si+"?"+Io+"+"+Lo+"(?="+[cc,Si,"$"].join("|")+")",Mp+"+"+vc+"(?="+[cc,Si+mc,"$"].join("|")+")",Si+"?"+mc+"+"+Lo,Si+"+"+vc,cl,ul,fc,Dp].join("|"),"g"),Np=RegExp("["+gc+yi+il+lc+"]"),bc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Bp=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Cc=-1,nt={};nt[xo]=nt[ko]=nt[Eo]=nt[Po]=nt[Oo]=nt[Js]=nt[Zs]=nt[Cr]=nt[Ki]=!0,nt[At]=nt[me]=nt[Vr]=nt[Bt]=nt[br]=nt[bn]=nt[Ft]=nt[xe]=nt[Pt]=nt[gi]=nt[Mn]=nt[er]=nt[Kt]=nt[Dn]=nt[Wr]=!1;var et={};et[At]=et[me]=et[Vr]=et[br]=et[Bt]=et[bn]=et[xo]=et[ko]=et[Eo]=et[Po]=et[Oo]=et[Pt]=et[gi]=et[Mn]=et[er]=et[Kt]=et[Dn]=et[bt]=et[Js]=et[Zs]=et[Cr]=et[Ki]=!0,et[Ft]=et[xe]=et[Wr]=!1;var xc={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Fp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},P={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},N={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},W=parseFloat,fe=parseInt,Ie=typeof yn=="object"&&yn&&yn.Object===Object&&yn,Ye=typeof self=="object"&&self&&self.Object===Object&&self,Ee=Ie||Ye||Function("return this")(),Te=e&&!e.nodeType&&e,ze=Te&&!0&&t&&!t.nodeType&&t,dn=ze&&ze.exports===Te,Yt=dn&&Ie.process,$t=function(){try{var F=ze&&ze.require&&ze.require("util").types;return F||Yt&&Yt.binding&&Yt.binding("util")}catch{}}(),No=$t&&$t.isArrayBuffer,Bo=$t&&$t.isDate,dl=$t&&$t.isMap,W0=$t&&$t.isRegExp,V0=$t&&$t.isSet,q0=$t&&$t.isTypedArray;function Nn(F,J,q){switch(q.length){case 0:return F.call(J);case 1:return F.call(J,q[0]);case 2:return F.call(J,q[0],q[1]);case 3:return F.call(J,q[0],q[1],q[2])}return F.apply(J,q)}function eP(F,J,q,de){for(var Ce=-1,je=F==null?0:F.length;++Ce<je;){var It=F[Ce];J(de,It,q(It),F)}return de}function tr(F,J){for(var q=-1,de=F==null?0:F.length;++q<de&&J(F[q],q,F)!==!1;);return F}function tP(F,J){for(var q=F==null?0:F.length;q--&&J(F[q],q,F)!==!1;);return F}function K0(F,J){for(var q=-1,de=F==null?0:F.length;++q<de;)if(!J(F[q],q,F))return!1;return!0}function Ji(F,J){for(var q=-1,de=F==null?0:F.length,Ce=0,je=[];++q<de;){var It=F[q];J(It,q,F)&&(je[Ce++]=It)}return je}function kc(F,J){var q=F==null?0:F.length;return!!q&&Fo(F,J,0)>-1}function $p(F,J,q){for(var de=-1,Ce=F==null?0:F.length;++de<Ce;)if(q(J,F[de]))return!0;return!1}function ut(F,J){for(var q=-1,de=F==null?0:F.length,Ce=Array(de);++q<de;)Ce[q]=J(F[q],q,F);return Ce}function Zi(F,J){for(var q=-1,de=J.length,Ce=F.length;++q<de;)F[Ce+q]=J[q];return F}function zp(F,J,q,de){var Ce=-1,je=F==null?0:F.length;for(de&&je&&(q=F[++Ce]);++Ce<je;)q=J(q,F[Ce],Ce,F);return q}function nP(F,J,q,de){var Ce=F==null?0:F.length;for(de&&Ce&&(q=F[--Ce]);Ce--;)q=J(q,F[Ce],Ce,F);return q}function Gp(F,J){for(var q=-1,de=F==null?0:F.length;++q<de;)if(J(F[q],q,F))return!0;return!1}var rP=Up("length");function iP(F){return F.split("")}function aP(F){return F.match(yp)||[]}function Y0(F,J,q){var de;return q(F,function(Ce,je,It){if(J(Ce,je,It))return de=je,!1}),de}function Ec(F,J,q,de){for(var Ce=F.length,je=q+(de?1:-1);de?je--:++je<Ce;)if(J(F[je],je,F))return je;return-1}function Fo(F,J,q){return J===J?vP(F,J,q):Ec(F,X0,q)}function oP(F,J,q,de){for(var Ce=q-1,je=F.length;++Ce<je;)if(de(F[Ce],J))return Ce;return-1}function X0(F){return F!==F}function Q0(F,J){var q=F==null?0:F.length;return q?Hp(F,J)/q:Q}function Up(F){return function(J){return J==null?n:J[F]}}function jp(F){return function(J){return F==null?n:F[J]}}function J0(F,J,q,de,Ce){return Ce(F,function(je,It,rt){q=de?(de=!1,je):J(q,je,It,rt)}),q}function sP(F,J){var q=F.length;for(F.sort(J);q--;)F[q]=F[q].value;return F}function Hp(F,J){for(var q,de=-1,Ce=F.length;++de<Ce;){var je=J(F[de]);je!==n&&(q=q===n?je:q+je)}return q}function Wp(F,J){for(var q=-1,de=Array(F);++q<F;)de[q]=J(q);return de}function lP(F,J){return ut(J,function(q){return[q,F[q]]})}function Z0(F){return F&&F.slice(0,r1(F)+1).replace(nl,"")}function Bn(F){return function(J){return F(J)}}function Vp(F,J){return ut(J,function(q){return F[q]})}function hl(F,J){return F.has(J)}function e1(F,J){for(var q=-1,de=F.length;++q<de&&Fo(J,F[q],0)>-1;);return q}function t1(F,J){for(var q=F.length;q--&&Fo(J,F[q],0)>-1;);return q}function uP(F,J){for(var q=F.length,de=0;q--;)F[q]===J&&++de;return de}var cP=jp(xc),fP=jp(Fp);function dP(F){return"\\"+N[F]}function hP(F,J){return F==null?n:F[J]}function $o(F){return Np.test(F)}function pP(F){return bc.test(F)}function gP(F){for(var J,q=[];!(J=F.next()).done;)q.push(J.value);return q}function qp(F){var J=-1,q=Array(F.size);return F.forEach(function(de,Ce){q[++J]=[Ce,de]}),q}function n1(F,J){return function(q){return F(J(q))}}function ea(F,J){for(var q=-1,de=F.length,Ce=0,je=[];++q<de;){var It=F[q];(It===J||It===h)&&(F[q]=h,je[Ce++]=q)}return je}function Pc(F){var J=-1,q=Array(F.size);return F.forEach(function(de){q[++J]=de}),q}function mP(F){var J=-1,q=Array(F.size);return F.forEach(function(de){q[++J]=[de,de]}),q}function vP(F,J,q){for(var de=q-1,Ce=F.length;++de<Ce;)if(F[de]===J)return de;return-1}function yP(F,J,q){for(var de=q+1;de--;)if(F[de]===J)return de;return de}function zo(F){return $o(F)?_P(F):rP(F)}function Er(F){return $o(F)?wP(F):iP(F)}function r1(F){for(var J=F.length;J--&&gp.test(F.charAt(J)););return J}var SP=jp(P);function _P(F){for(var J=kr.lastIndex=0;kr.test(F);)++J;return J}function wP(F){return F.match(kr)||[]}function bP(F){return F.match(za)||[]}var CP=function F(J){J=J==null?Ee:Go.defaults(Ee.Object(),J,Go.pick(Ee,Bp));var q=J.Array,de=J.Date,Ce=J.Error,je=J.Function,It=J.Math,rt=J.Object,Kp=J.RegExp,xP=J.String,nr=J.TypeError,Oc=q.prototype,kP=je.prototype,Uo=rt.prototype,Tc=J["__core-js_shared__"],Rc=kP.toString,Xe=Uo.hasOwnProperty,EP=0,i1=function(){var o=/[^.]+$/.exec(Tc&&Tc.keys&&Tc.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Ac=Uo.toString,PP=Rc.call(rt),OP=Ee._,TP=Kp("^"+Rc.call(Xe).replace(tl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ic=dn?J.Buffer:n,ta=J.Symbol,Lc=J.Uint8Array,a1=Ic?Ic.allocUnsafe:n,Mc=n1(rt.getPrototypeOf,rt),o1=rt.create,s1=Uo.propertyIsEnumerable,Dc=Oc.splice,l1=ta?ta.isConcatSpreadable:n,pl=ta?ta.iterator:n,Ga=ta?ta.toStringTag:n,Nc=function(){try{var o=Va(rt,"defineProperty");return o({},"",{}),o}catch{}}(),RP=J.clearTimeout!==Ee.clearTimeout&&J.clearTimeout,AP=de&&de.now!==Ee.Date.now&&de.now,IP=J.setTimeout!==Ee.setTimeout&&J.setTimeout,Bc=It.ceil,Fc=It.floor,Yp=rt.getOwnPropertySymbols,LP=Ic?Ic.isBuffer:n,u1=J.isFinite,MP=Oc.join,DP=n1(rt.keys,rt),Lt=It.max,rn=It.min,NP=de.now,BP=J.parseInt,c1=It.random,FP=Oc.reverse,Xp=Va(J,"DataView"),gl=Va(J,"Map"),Qp=Va(J,"Promise"),jo=Va(J,"Set"),ml=Va(J,"WeakMap"),vl=Va(rt,"create"),$c=ml&&new ml,Ho={},$P=qa(Xp),zP=qa(gl),GP=qa(Qp),UP=qa(jo),jP=qa(ml),zc=ta?ta.prototype:n,yl=zc?zc.valueOf:n,f1=zc?zc.toString:n;function k(o){if(St(o)&&!ke(o)&&!(o instanceof Me)){if(o instanceof rr)return o;if(Xe.call(o,"__wrapped__"))return dS(o)}return new rr(o)}var Wo=function(){function o(){}return function(l){if(!ht(l))return{};if(o1)return o1(l);o.prototype=l;var d=new o;return o.prototype=n,d}}();function Gc(){}function rr(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=n}k.templateSettings={escape:cp,evaluate:fp,interpolate:rc,variable:"",imports:{_:k}},k.prototype=Gc.prototype,k.prototype.constructor=k,rr.prototype=Wo(Gc.prototype),rr.prototype.constructor=rr;function Me(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=oe,this.__views__=[]}function HP(){var o=new Me(this.__wrapped__);return o.__actions__=Cn(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Cn(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Cn(this.__views__),o}function WP(){if(this.__filtered__){var o=new Me(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function VP(){var o=this.__wrapped__.value(),l=this.__dir__,d=ke(o),m=l<0,b=d?o.length:0,E=iT(0,b,this.__views__),R=E.start,M=E.end,z=M-R,Z=m?M:R-1,ee=this.__iteratees__,ne=ee.length,ue=0,ge=rn(z,this.__takeCount__);if(!d||!m&&b==z&&ge==z)return D1(o,this.__actions__);var Se=[];e:for(;z--&&ue<ge;){Z+=l;for(var Oe=-1,_e=o[Z];++Oe<ne;){var Le=ee[Oe],Ne=Le.iteratee,zn=Le.type,gn=Ne(_e);if(zn==$)_e=gn;else if(!gn){if(zn==T)continue e;break e}}Se[ue++]=_e}return Se}Me.prototype=Wo(Gc.prototype),Me.prototype.constructor=Me;function Ua(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var m=o[l];this.set(m[0],m[1])}}function qP(){this.__data__=vl?vl(null):{},this.size=0}function KP(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function YP(o){var l=this.__data__;if(vl){var d=l[o];return d===c?n:d}return Xe.call(l,o)?l[o]:n}function XP(o){var l=this.__data__;return vl?l[o]!==n:Xe.call(l,o)}function QP(o,l){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=vl&&l===n?c:l,this}Ua.prototype.clear=qP,Ua.prototype.delete=KP,Ua.prototype.get=YP,Ua.prototype.has=XP,Ua.prototype.set=QP;function _i(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var m=o[l];this.set(m[0],m[1])}}function JP(){this.__data__=[],this.size=0}function ZP(o){var l=this.__data__,d=Uc(l,o);if(d<0)return!1;var m=l.length-1;return d==m?l.pop():Dc.call(l,d,1),--this.size,!0}function eO(o){var l=this.__data__,d=Uc(l,o);return d<0?n:l[d][1]}function tO(o){return Uc(this.__data__,o)>-1}function nO(o,l){var d=this.__data__,m=Uc(d,o);return m<0?(++this.size,d.push([o,l])):d[m][1]=l,this}_i.prototype.clear=JP,_i.prototype.delete=ZP,_i.prototype.get=eO,_i.prototype.has=tO,_i.prototype.set=nO;function wi(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var m=o[l];this.set(m[0],m[1])}}function rO(){this.size=0,this.__data__={hash:new Ua,map:new(gl||_i),string:new Ua}}function iO(o){var l=ef(this,o).delete(o);return this.size-=l?1:0,l}function aO(o){return ef(this,o).get(o)}function oO(o){return ef(this,o).has(o)}function sO(o,l){var d=ef(this,o),m=d.size;return d.set(o,l),this.size+=d.size==m?0:1,this}wi.prototype.clear=rO,wi.prototype.delete=iO,wi.prototype.get=aO,wi.prototype.has=oO,wi.prototype.set=sO;function ja(o){var l=-1,d=o==null?0:o.length;for(this.__data__=new wi;++l<d;)this.add(o[l])}function lO(o){return this.__data__.set(o,c),this}function uO(o){return this.__data__.has(o)}ja.prototype.add=ja.prototype.push=lO,ja.prototype.has=uO;function Pr(o){var l=this.__data__=new _i(o);this.size=l.size}function cO(){this.__data__=new _i,this.size=0}function fO(o){var l=this.__data__,d=l.delete(o);return this.size=l.size,d}function dO(o){return this.__data__.get(o)}function hO(o){return this.__data__.has(o)}function pO(o,l){var d=this.__data__;if(d instanceof _i){var m=d.__data__;if(!gl||m.length<i-1)return m.push([o,l]),this.size=++d.size,this;d=this.__data__=new wi(m)}return d.set(o,l),this.size=d.size,this}Pr.prototype.clear=cO,Pr.prototype.delete=fO,Pr.prototype.get=dO,Pr.prototype.has=hO,Pr.prototype.set=pO;function d1(o,l){var d=ke(o),m=!d&&Ka(o),b=!d&&!m&&oa(o),E=!d&&!m&&!b&&Yo(o),R=d||m||b||E,M=R?Wp(o.length,xP):[],z=M.length;for(var Z in o)(l||Xe.call(o,Z))&&!(R&&(Z=="length"||b&&(Z=="offset"||Z=="parent")||E&&(Z=="buffer"||Z=="byteLength"||Z=="byteOffset")||ki(Z,z)))&&M.push(Z);return M}function h1(o){var l=o.length;return l?o[lg(0,l-1)]:n}function gO(o,l){return tf(Cn(o),Ha(l,0,o.length))}function mO(o){return tf(Cn(o))}function Jp(o,l,d){(d!==n&&!Or(o[l],d)||d===n&&!(l in o))&&bi(o,l,d)}function Sl(o,l,d){var m=o[l];(!(Xe.call(o,l)&&Or(m,d))||d===n&&!(l in o))&&bi(o,l,d)}function Uc(o,l){for(var d=o.length;d--;)if(Or(o[d][0],l))return d;return-1}function vO(o,l,d,m){return na(o,function(b,E,R){l(m,b,d(b),R)}),m}function p1(o,l){return o&&Kr(l,zt(l),o)}function yO(o,l){return o&&Kr(l,kn(l),o)}function bi(o,l,d){l=="__proto__"&&Nc?Nc(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[l]=d}function Zp(o,l){for(var d=-1,m=l.length,b=q(m),E=o==null;++d<m;)b[d]=E?n:Lg(o,l[d]);return b}function Ha(o,l,d){return o===o&&(d!==n&&(o=o<=d?o:d),l!==n&&(o=o>=l?o:l)),o}function ir(o,l,d,m,b,E){var R,M=l&p,z=l&g,Z=l&y;if(d&&(R=b?d(o,m,b,E):d(o)),R!==n)return R;if(!ht(o))return o;var ee=ke(o);if(ee){if(R=oT(o),!M)return Cn(o,R)}else{var ne=an(o),ue=ne==xe||ne==Hr;if(oa(o))return F1(o,M);if(ne==Mn||ne==At||ue&&!b){if(R=z||ue?{}:rS(o),!M)return z?YO(o,yO(R,o)):KO(o,p1(R,o))}else{if(!et[ne])return b?o:{};R=sT(o,ne,M)}}E||(E=new Pr);var ge=E.get(o);if(ge)return ge;E.set(o,R),IS(o)?o.forEach(function(_e){R.add(ir(_e,l,d,_e,o,E))}):RS(o)&&o.forEach(function(_e,Le){R.set(Le,ir(_e,l,d,Le,o,E))});var Se=Z?z?Sg:yg:z?kn:zt,Oe=ee?n:Se(o);return tr(Oe||o,function(_e,Le){Oe&&(Le=_e,_e=o[Le]),Sl(R,Le,ir(_e,l,d,Le,o,E))}),R}function SO(o){var l=zt(o);return function(d){return g1(d,o,l)}}function g1(o,l,d){var m=d.length;if(o==null)return!m;for(o=rt(o);m--;){var b=d[m],E=l[b],R=o[b];if(R===n&&!(b in o)||!E(R))return!1}return!0}function m1(o,l,d){if(typeof o!="function")throw new nr(s);return El(function(){o.apply(n,d)},l)}function _l(o,l,d,m){var b=-1,E=kc,R=!0,M=o.length,z=[],Z=l.length;if(!M)return z;d&&(l=ut(l,Bn(d))),m?(E=$p,R=!1):l.length>=i&&(E=hl,R=!1,l=new ja(l));e:for(;++b<M;){var ee=o[b],ne=d==null?ee:d(ee);if(ee=m||ee!==0?ee:0,R&&ne===ne){for(var ue=Z;ue--;)if(l[ue]===ne)continue e;z.push(ee)}else E(l,ne,m)||z.push(ee)}return z}var na=j1(qr),v1=j1(tg,!0);function _O(o,l){var d=!0;return na(o,function(m,b,E){return d=!!l(m,b,E),d}),d}function jc(o,l,d){for(var m=-1,b=o.length;++m<b;){var E=o[m],R=l(E);if(R!=null&&(M===n?R===R&&!$n(R):d(R,M)))var M=R,z=E}return z}function wO(o,l,d,m){var b=o.length;for(d=Pe(d),d<0&&(d=-d>b?0:b+d),m=m===n||m>b?b:Pe(m),m<0&&(m+=b),m=d>m?0:MS(m);d<m;)o[d++]=l;return o}function y1(o,l){var d=[];return na(o,function(m,b,E){l(m,b,E)&&d.push(m)}),d}function Xt(o,l,d,m,b){var E=-1,R=o.length;for(d||(d=uT),b||(b=[]);++E<R;){var M=o[E];l>0&&d(M)?l>1?Xt(M,l-1,d,m,b):Zi(b,M):m||(b[b.length]=M)}return b}var eg=H1(),S1=H1(!0);function qr(o,l){return o&&eg(o,l,zt)}function tg(o,l){return o&&S1(o,l,zt)}function Hc(o,l){return Ji(l,function(d){return Ei(o[d])})}function Wa(o,l){l=ia(l,o);for(var d=0,m=l.length;o!=null&&d<m;)o=o[Yr(l[d++])];return d&&d==m?o:n}function _1(o,l,d){var m=l(o);return ke(o)?m:Zi(m,d(o))}function hn(o){return o==null?o===n?$a:Xs:Ga&&Ga in rt(o)?rT(o):mT(o)}function ng(o,l){return o>l}function bO(o,l){return o!=null&&Xe.call(o,l)}function CO(o,l){return o!=null&&l in rt(o)}function xO(o,l,d){return o>=rn(l,d)&&o<Lt(l,d)}function rg(o,l,d){for(var m=d?$p:kc,b=o[0].length,E=o.length,R=E,M=q(E),z=1/0,Z=[];R--;){var ee=o[R];R&&l&&(ee=ut(ee,Bn(l))),z=rn(ee.length,z),M[R]=!d&&(l||b>=120&&ee.length>=120)?new ja(R&&ee):n}ee=o[0];var ne=-1,ue=M[0];e:for(;++ne<b&&Z.length<z;){var ge=ee[ne],Se=l?l(ge):ge;if(ge=d||ge!==0?ge:0,!(ue?hl(ue,Se):m(Z,Se,d))){for(R=E;--R;){var Oe=M[R];if(!(Oe?hl(Oe,Se):m(o[R],Se,d)))continue e}ue&&ue.push(Se),Z.push(ge)}}return Z}function kO(o,l,d,m){return qr(o,function(b,E,R){l(m,d(b),E,R)}),m}function wl(o,l,d){l=ia(l,o),o=sS(o,l);var m=o==null?o:o[Yr(or(l))];return m==null?n:Nn(m,o,d)}function w1(o){return St(o)&&hn(o)==At}function EO(o){return St(o)&&hn(o)==Vr}function PO(o){return St(o)&&hn(o)==bn}function bl(o,l,d,m,b){return o===l?!0:o==null||l==null||!St(o)&&!St(l)?o!==o&&l!==l:OO(o,l,d,m,bl,b)}function OO(o,l,d,m,b,E){var R=ke(o),M=ke(l),z=R?me:an(o),Z=M?me:an(l);z=z==At?Mn:z,Z=Z==At?Mn:Z;var ee=z==Mn,ne=Z==Mn,ue=z==Z;if(ue&&oa(o)){if(!oa(l))return!1;R=!0,ee=!1}if(ue&&!ee)return E||(E=new Pr),R||Yo(o)?eS(o,l,d,m,b,E):tT(o,l,z,d,m,b,E);if(!(d&v)){var ge=ee&&Xe.call(o,"__wrapped__"),Se=ne&&Xe.call(l,"__wrapped__");if(ge||Se){var Oe=ge?o.value():o,_e=Se?l.value():l;return E||(E=new Pr),b(Oe,_e,d,m,E)}}return ue?(E||(E=new Pr),nT(o,l,d,m,b,E)):!1}function TO(o){return St(o)&&an(o)==Pt}function ig(o,l,d,m){var b=d.length,E=b,R=!m;if(o==null)return!E;for(o=rt(o);b--;){var M=d[b];if(R&&M[2]?M[1]!==o[M[0]]:!(M[0]in o))return!1}for(;++b<E;){M=d[b];var z=M[0],Z=o[z],ee=M[1];if(R&&M[2]){if(Z===n&&!(z in o))return!1}else{var ne=new Pr;if(m)var ue=m(Z,ee,z,o,l,ne);if(!(ue===n?bl(ee,Z,v|w,m,ne):ue))return!1}}return!0}function b1(o){if(!ht(o)||fT(o))return!1;var l=Ei(o)?TP:xp;return l.test(qa(o))}function RO(o){return St(o)&&hn(o)==er}function AO(o){return St(o)&&an(o)==Kt}function IO(o){return St(o)&&lf(o.length)&&!!nt[hn(o)]}function C1(o){return typeof o=="function"?o:o==null?En:typeof o=="object"?ke(o)?E1(o[0],o[1]):k1(o):WS(o)}function ag(o){if(!kl(o))return DP(o);var l=[];for(var d in rt(o))Xe.call(o,d)&&d!="constructor"&&l.push(d);return l}function LO(o){if(!ht(o))return gT(o);var l=kl(o),d=[];for(var m in o)m=="constructor"&&(l||!Xe.call(o,m))||d.push(m);return d}function og(o,l){return o<l}function x1(o,l){var d=-1,m=xn(o)?q(o.length):[];return na(o,function(b,E,R){m[++d]=l(b,E,R)}),m}function k1(o){var l=wg(o);return l.length==1&&l[0][2]?aS(l[0][0],l[0][1]):function(d){return d===o||ig(d,o,l)}}function E1(o,l){return Cg(o)&&iS(l)?aS(Yr(o),l):function(d){var m=Lg(d,o);return m===n&&m===l?Mg(d,o):bl(l,m,v|w)}}function Wc(o,l,d,m,b){o!==l&&eg(l,function(E,R){if(b||(b=new Pr),ht(E))MO(o,l,R,d,Wc,m,b);else{var M=m?m(kg(o,R),E,R+"",o,l,b):n;M===n&&(M=E),Jp(o,R,M)}},kn)}function MO(o,l,d,m,b,E,R){var M=kg(o,d),z=kg(l,d),Z=R.get(z);if(Z){Jp(o,d,Z);return}var ee=E?E(M,z,d+"",o,l,R):n,ne=ee===n;if(ne){var ue=ke(z),ge=!ue&&oa(z),Se=!ue&&!ge&&Yo(z);ee=z,ue||ge||Se?ke(M)?ee=M:Ct(M)?ee=Cn(M):ge?(ne=!1,ee=F1(z,!0)):Se?(ne=!1,ee=$1(z,!0)):ee=[]:Pl(z)||Ka(z)?(ee=M,Ka(M)?ee=DS(M):(!ht(M)||Ei(M))&&(ee=rS(z))):ne=!1}ne&&(R.set(z,ee),b(ee,z,m,E,R),R.delete(z)),Jp(o,d,ee)}function P1(o,l){var d=o.length;if(d)return l+=l<0?d:0,ki(l,d)?o[l]:n}function O1(o,l,d){l.length?l=ut(l,function(E){return ke(E)?function(R){return Wa(R,E.length===1?E[0]:E)}:E}):l=[En];var m=-1;l=ut(l,Bn(ye()));var b=x1(o,function(E,R,M){var z=ut(l,function(Z){return Z(E)});return{criteria:z,index:++m,value:E}});return sP(b,function(E,R){return qO(E,R,d)})}function DO(o,l){return T1(o,l,function(d,m){return Mg(o,m)})}function T1(o,l,d){for(var m=-1,b=l.length,E={};++m<b;){var R=l[m],M=Wa(o,R);d(M,R)&&Cl(E,ia(R,o),M)}return E}function NO(o){return function(l){return Wa(l,o)}}function sg(o,l,d,m){var b=m?oP:Fo,E=-1,R=l.length,M=o;for(o===l&&(l=Cn(l)),d&&(M=ut(o,Bn(d)));++E<R;)for(var z=0,Z=l[E],ee=d?d(Z):Z;(z=b(M,ee,z,m))>-1;)M!==o&&Dc.call(M,z,1),Dc.call(o,z,1);return o}function R1(o,l){for(var d=o?l.length:0,m=d-1;d--;){var b=l[d];if(d==m||b!==E){var E=b;ki(b)?Dc.call(o,b,1):fg(o,b)}}return o}function lg(o,l){return o+Fc(c1()*(l-o+1))}function BO(o,l,d,m){for(var b=-1,E=Lt(Bc((l-o)/(d||1)),0),R=q(E);E--;)R[m?E:++b]=o,o+=d;return R}function ug(o,l){var d="";if(!o||l<1||l>H)return d;do l%2&&(d+=o),l=Fc(l/2),l&&(o+=o);while(l);return d}function Re(o,l){return Eg(oS(o,l,En),o+"")}function FO(o){return h1(Xo(o))}function $O(o,l){var d=Xo(o);return tf(d,Ha(l,0,d.length))}function Cl(o,l,d,m){if(!ht(o))return o;l=ia(l,o);for(var b=-1,E=l.length,R=E-1,M=o;M!=null&&++b<E;){var z=Yr(l[b]),Z=d;if(z==="__proto__"||z==="constructor"||z==="prototype")return o;if(b!=R){var ee=M[z];Z=m?m(ee,z,M):n,Z===n&&(Z=ht(ee)?ee:ki(l[b+1])?[]:{})}Sl(M,z,Z),M=M[z]}return o}var A1=$c?function(o,l){return $c.set(o,l),o}:En,zO=Nc?function(o,l){return Nc(o,"toString",{configurable:!0,enumerable:!1,value:Ng(l),writable:!0})}:En;function GO(o){return tf(Xo(o))}function ar(o,l,d){var m=-1,b=o.length;l<0&&(l=-l>b?0:b+l),d=d>b?b:d,d<0&&(d+=b),b=l>d?0:d-l>>>0,l>>>=0;for(var E=q(b);++m<b;)E[m]=o[m+l];return E}function UO(o,l){var d;return na(o,function(m,b,E){return d=l(m,b,E),!d}),!!d}function Vc(o,l,d){var m=0,b=o==null?m:o.length;if(typeof l=="number"&&l===l&&b<=we){for(;m<b;){var E=m+b>>>1,R=o[E];R!==null&&!$n(R)&&(d?R<=l:R<l)?m=E+1:b=E}return b}return cg(o,l,En,d)}function cg(o,l,d,m){var b=0,E=o==null?0:o.length;if(E===0)return 0;l=d(l);for(var R=l!==l,M=l===null,z=$n(l),Z=l===n;b<E;){var ee=Fc((b+E)/2),ne=d(o[ee]),ue=ne!==n,ge=ne===null,Se=ne===ne,Oe=$n(ne);if(R)var _e=m||Se;else Z?_e=Se&&(m||ue):M?_e=Se&&ue&&(m||!ge):z?_e=Se&&ue&&!ge&&(m||!Oe):ge||Oe?_e=!1:_e=m?ne<=l:ne<l;_e?b=ee+1:E=ee}return rn(E,ve)}function I1(o,l){for(var d=-1,m=o.length,b=0,E=[];++d<m;){var R=o[d],M=l?l(R):R;if(!d||!Or(M,z)){var z=M;E[b++]=R===0?0:R}}return E}function L1(o){return typeof o=="number"?o:$n(o)?Q:+o}function Fn(o){if(typeof o=="string")return o;if(ke(o))return ut(o,Fn)+"";if($n(o))return f1?f1.call(o):"";var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function ra(o,l,d){var m=-1,b=kc,E=o.length,R=!0,M=[],z=M;if(d)R=!1,b=$p;else if(E>=i){var Z=l?null:ZO(o);if(Z)return Pc(Z);R=!1,b=hl,z=new ja}else z=l?[]:M;e:for(;++m<E;){var ee=o[m],ne=l?l(ee):ee;if(ee=d||ee!==0?ee:0,R&&ne===ne){for(var ue=z.length;ue--;)if(z[ue]===ne)continue e;l&&z.push(ne),M.push(ee)}else b(z,ne,d)||(z!==M&&z.push(ne),M.push(ee))}return M}function fg(o,l){return l=ia(l,o),o=sS(o,l),o==null||delete o[Yr(or(l))]}function M1(o,l,d,m){return Cl(o,l,d(Wa(o,l)),m)}function qc(o,l,d,m){for(var b=o.length,E=m?b:-1;(m?E--:++E<b)&&l(o[E],E,o););return d?ar(o,m?0:E,m?E+1:b):ar(o,m?E+1:0,m?b:E)}function D1(o,l){var d=o;return d instanceof Me&&(d=d.value()),zp(l,function(m,b){return b.func.apply(b.thisArg,Zi([m],b.args))},d)}function dg(o,l,d){var m=o.length;if(m<2)return m?ra(o[0]):[];for(var b=-1,E=q(m);++b<m;)for(var R=o[b],M=-1;++M<m;)M!=b&&(E[b]=_l(E[b]||R,o[M],l,d));return ra(Xt(E,1),l,d)}function N1(o,l,d){for(var m=-1,b=o.length,E=l.length,R={};++m<b;){var M=m<E?l[m]:n;d(R,o[m],M)}return R}function hg(o){return Ct(o)?o:[]}function pg(o){return typeof o=="function"?o:En}function ia(o,l){return ke(o)?o:Cg(o,l)?[o]:fS(Ve(o))}var jO=Re;function aa(o,l,d){var m=o.length;return d=d===n?m:d,!l&&d>=m?o:ar(o,l,d)}var B1=RP||function(o){return Ee.clearTimeout(o)};function F1(o,l){if(l)return o.slice();var d=o.length,m=a1?a1(d):new o.constructor(d);return o.copy(m),m}function gg(o){var l=new o.constructor(o.byteLength);return new Lc(l).set(new Lc(o)),l}function HO(o,l){var d=l?gg(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function WO(o){var l=new o.constructor(o.source,vi.exec(o));return l.lastIndex=o.lastIndex,l}function VO(o){return yl?rt(yl.call(o)):{}}function $1(o,l){var d=l?gg(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function z1(o,l){if(o!==l){var d=o!==n,m=o===null,b=o===o,E=$n(o),R=l!==n,M=l===null,z=l===l,Z=$n(l);if(!M&&!Z&&!E&&o>l||E&&R&&z&&!M&&!Z||m&&R&&z||!d&&z||!b)return 1;if(!m&&!E&&!Z&&o<l||Z&&d&&b&&!m&&!E||M&&d&&b||!R&&b||!z)return-1}return 0}function qO(o,l,d){for(var m=-1,b=o.criteria,E=l.criteria,R=b.length,M=d.length;++m<R;){var z=z1(b[m],E[m]);if(z){if(m>=M)return z;var Z=d[m];return z*(Z=="desc"?-1:1)}}return o.index-l.index}function G1(o,l,d,m){for(var b=-1,E=o.length,R=d.length,M=-1,z=l.length,Z=Lt(E-R,0),ee=q(z+Z),ne=!m;++M<z;)ee[M]=l[M];for(;++b<R;)(ne||b<E)&&(ee[d[b]]=o[b]);for(;Z--;)ee[M++]=o[b++];return ee}function U1(o,l,d,m){for(var b=-1,E=o.length,R=-1,M=d.length,z=-1,Z=l.length,ee=Lt(E-M,0),ne=q(ee+Z),ue=!m;++b<ee;)ne[b]=o[b];for(var ge=b;++z<Z;)ne[ge+z]=l[z];for(;++R<M;)(ue||b<E)&&(ne[ge+d[R]]=o[b++]);return ne}function Cn(o,l){var d=-1,m=o.length;for(l||(l=q(m));++d<m;)l[d]=o[d];return l}function Kr(o,l,d,m){var b=!d;d||(d={});for(var E=-1,R=l.length;++E<R;){var M=l[E],z=m?m(d[M],o[M],M,d,o):n;z===n&&(z=o[M]),b?bi(d,M,z):Sl(d,M,z)}return d}function KO(o,l){return Kr(o,bg(o),l)}function YO(o,l){return Kr(o,tS(o),l)}function Kc(o,l){return function(d,m){var b=ke(d)?eP:vO,E=l?l():{};return b(d,o,ye(m,2),E)}}function Vo(o){return Re(function(l,d){var m=-1,b=d.length,E=b>1?d[b-1]:n,R=b>2?d[2]:n;for(E=o.length>3&&typeof E=="function"?(b--,E):n,R&&pn(d[0],d[1],R)&&(E=b<3?n:E,b=1),l=rt(l);++m<b;){var M=d[m];M&&o(l,M,m,E)}return l})}function j1(o,l){return function(d,m){if(d==null)return d;if(!xn(d))return o(d,m);for(var b=d.length,E=l?b:-1,R=rt(d);(l?E--:++E<b)&&m(R[E],E,R)!==!1;);return d}}function H1(o){return function(l,d,m){for(var b=-1,E=rt(l),R=m(l),M=R.length;M--;){var z=R[o?M:++b];if(d(E[z],z,E)===!1)break}return l}}function XO(o,l,d){var m=l&x,b=xl(o);function E(){var R=this&&this!==Ee&&this instanceof E?b:o;return R.apply(m?d:this,arguments)}return E}function W1(o){return function(l){l=Ve(l);var d=$o(l)?Er(l):n,m=d?d[0]:l.charAt(0),b=d?aa(d,1).join(""):l.slice(1);return m[o]()+b}}function qo(o){return function(l){return zp(jS(US(l).replace(fl,"")),o,"")}}function xl(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var d=Wo(o.prototype),m=o.apply(d,l);return ht(m)?m:d}}function QO(o,l,d){var m=xl(o);function b(){for(var E=arguments.length,R=q(E),M=E,z=Ko(b);M--;)R[M]=arguments[M];var Z=E<3&&R[0]!==z&&R[E-1]!==z?[]:ea(R,z);if(E-=Z.length,E<d)return X1(o,l,Yc,b.placeholder,n,R,Z,n,n,d-E);var ee=this&&this!==Ee&&this instanceof b?m:o;return Nn(ee,this,R)}return b}function V1(o){return function(l,d,m){var b=rt(l);if(!xn(l)){var E=ye(d,3);l=zt(l),d=function(M){return E(b[M],M,b)}}var R=o(l,d,m);return R>-1?b[E?l[R]:R]:n}}function q1(o){return xi(function(l){var d=l.length,m=d,b=rr.prototype.thru;for(o&&l.reverse();m--;){var E=l[m];if(typeof E!="function")throw new nr(s);if(b&&!R&&Zc(E)=="wrapper")var R=new rr([],!0)}for(m=R?m:d;++m<d;){E=l[m];var M=Zc(E),z=M=="wrapper"?_g(E):n;z&&xg(z[0])&&z[1]==(D|C|I|U)&&!z[4].length&&z[9]==1?R=R[Zc(z[0])].apply(R,z[3]):R=E.length==1&&xg(E)?R[M]():R.thru(E)}return function(){var Z=arguments,ee=Z[0];if(R&&Z.length==1&&ke(ee))return R.plant(ee).value();for(var ne=0,ue=d?l[ne].apply(this,Z):ee;++ne<d;)ue=l[ne].call(this,ue);return ue}})}function Yc(o,l,d,m,b,E,R,M,z,Z){var ee=l&D,ne=l&x,ue=l&_,ge=l&(C|O),Se=l&X,Oe=ue?n:xl(o);function _e(){for(var Le=arguments.length,Ne=q(Le),zn=Le;zn--;)Ne[zn]=arguments[zn];if(ge)var gn=Ko(_e),Gn=uP(Ne,gn);if(m&&(Ne=G1(Ne,m,b,ge)),E&&(Ne=U1(Ne,E,R,ge)),Le-=Gn,ge&&Le<Z){var xt=ea(Ne,gn);return X1(o,l,Yc,_e.placeholder,d,Ne,xt,M,z,Z-Le)}var Tr=ne?d:this,Oi=ue?Tr[o]:o;return Le=Ne.length,M?Ne=vT(Ne,M):Se&&Le>1&&Ne.reverse(),ee&&z<Le&&(Ne.length=z),this&&this!==Ee&&this instanceof _e&&(Oi=Oe||xl(Oi)),Oi.apply(Tr,Ne)}return _e}function K1(o,l){return function(d,m){return kO(d,o,l(m),{})}}function Xc(o,l){return function(d,m){var b;if(d===n&&m===n)return l;if(d!==n&&(b=d),m!==n){if(b===n)return m;typeof d=="string"||typeof m=="string"?(d=Fn(d),m=Fn(m)):(d=L1(d),m=L1(m)),b=o(d,m)}return b}}function mg(o){return xi(function(l){return l=ut(l,Bn(ye())),Re(function(d){var m=this;return o(l,function(b){return Nn(b,m,d)})})})}function Qc(o,l){l=l===n?" ":Fn(l);var d=l.length;if(d<2)return d?ug(l,o):l;var m=ug(l,Bc(o/zo(l)));return $o(l)?aa(Er(m),0,o).join(""):m.slice(0,o)}function JO(o,l,d,m){var b=l&x,E=xl(o);function R(){for(var M=-1,z=arguments.length,Z=-1,ee=m.length,ne=q(ee+z),ue=this&&this!==Ee&&this instanceof R?E:o;++Z<ee;)ne[Z]=m[Z];for(;z--;)ne[Z++]=arguments[++M];return Nn(ue,b?d:this,ne)}return R}function Y1(o){return function(l,d,m){return m&&typeof m!="number"&&pn(l,d,m)&&(d=m=n),l=Pi(l),d===n?(d=l,l=0):d=Pi(d),m=m===n?l<d?1:-1:Pi(m),BO(l,d,m,o)}}function Jc(o){return function(l,d){return typeof l=="string"&&typeof d=="string"||(l=sr(l),d=sr(d)),o(l,d)}}function X1(o,l,d,m,b,E,R,M,z,Z){var ee=l&C,ne=ee?R:n,ue=ee?n:R,ge=ee?E:n,Se=ee?n:E;l|=ee?I:L,l&=~(ee?L:I),l&S||(l&=~(x|_));var Oe=[o,l,b,ge,ne,Se,ue,M,z,Z],_e=d.apply(n,Oe);return xg(o)&&lS(_e,Oe),_e.placeholder=m,uS(_e,o,l)}function vg(o){var l=It[o];return function(d,m){if(d=sr(d),m=m==null?0:rn(Pe(m),292),m&&u1(d)){var b=(Ve(d)+"e").split("e"),E=l(b[0]+"e"+(+b[1]+m));return b=(Ve(E)+"e").split("e"),+(b[0]+"e"+(+b[1]-m))}return l(d)}}var ZO=jo&&1/Pc(new jo([,-0]))[1]==ie?function(o){return new jo(o)}:$g;function Q1(o){return function(l){var d=an(l);return d==Pt?qp(l):d==Kt?mP(l):lP(l,o(l))}}function Ci(o,l,d,m,b,E,R,M){var z=l&_;if(!z&&typeof o!="function")throw new nr(s);var Z=m?m.length:0;if(Z||(l&=~(I|L),m=b=n),R=R===n?R:Lt(Pe(R),0),M=M===n?M:Pe(M),Z-=b?b.length:0,l&L){var ee=m,ne=b;m=b=n}var ue=z?n:_g(o),ge=[o,l,d,m,b,ee,ne,E,R,M];if(ue&&pT(ge,ue),o=ge[0],l=ge[1],d=ge[2],m=ge[3],b=ge[4],M=ge[9]=ge[9]===n?z?0:o.length:Lt(ge[9]-Z,0),!M&&l&(C|O)&&(l&=~(C|O)),!l||l==x)var Se=XO(o,l,d);else l==C||l==O?Se=QO(o,l,M):(l==I||l==(x|I))&&!b.length?Se=JO(o,l,d,m):Se=Yc.apply(n,ge);var Oe=ue?A1:lS;return uS(Oe(Se,ge),o,l)}function J1(o,l,d,m){return o===n||Or(o,Uo[d])&&!Xe.call(m,d)?l:o}function Z1(o,l,d,m,b,E){return ht(o)&&ht(l)&&(E.set(l,o),Wc(o,l,n,Z1,E),E.delete(l)),o}function eT(o){return Pl(o)?n:o}function eS(o,l,d,m,b,E){var R=d&v,M=o.length,z=l.length;if(M!=z&&!(R&&z>M))return!1;var Z=E.get(o),ee=E.get(l);if(Z&&ee)return Z==l&&ee==o;var ne=-1,ue=!0,ge=d&w?new ja:n;for(E.set(o,l),E.set(l,o);++ne<M;){var Se=o[ne],Oe=l[ne];if(m)var _e=R?m(Oe,Se,ne,l,o,E):m(Se,Oe,ne,o,l,E);if(_e!==n){if(_e)continue;ue=!1;break}if(ge){if(!Gp(l,function(Le,Ne){if(!hl(ge,Ne)&&(Se===Le||b(Se,Le,d,m,E)))return ge.push(Ne)})){ue=!1;break}}else if(!(Se===Oe||b(Se,Oe,d,m,E))){ue=!1;break}}return E.delete(o),E.delete(l),ue}function tT(o,l,d,m,b,E,R){switch(d){case br:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case Vr:return!(o.byteLength!=l.byteLength||!E(new Lc(o),new Lc(l)));case Bt:case bn:case gi:return Or(+o,+l);case Ft:return o.name==l.name&&o.message==l.message;case er:case Dn:return o==l+"";case Pt:var M=qp;case Kt:var z=m&v;if(M||(M=Pc),o.size!=l.size&&!z)return!1;var Z=R.get(o);if(Z)return Z==l;m|=w,R.set(o,l);var ee=eS(M(o),M(l),m,b,E,R);return R.delete(o),ee;case bt:if(yl)return yl.call(o)==yl.call(l)}return!1}function nT(o,l,d,m,b,E){var R=d&v,M=yg(o),z=M.length,Z=yg(l),ee=Z.length;if(z!=ee&&!R)return!1;for(var ne=z;ne--;){var ue=M[ne];if(!(R?ue in l:Xe.call(l,ue)))return!1}var ge=E.get(o),Se=E.get(l);if(ge&&Se)return ge==l&&Se==o;var Oe=!0;E.set(o,l),E.set(l,o);for(var _e=R;++ne<z;){ue=M[ne];var Le=o[ue],Ne=l[ue];if(m)var zn=R?m(Ne,Le,ue,l,o,E):m(Le,Ne,ue,o,l,E);if(!(zn===n?Le===Ne||b(Le,Ne,d,m,E):zn)){Oe=!1;break}_e||(_e=ue=="constructor")}if(Oe&&!_e){var gn=o.constructor,Gn=l.constructor;gn!=Gn&&"constructor"in o&&"constructor"in l&&!(typeof gn=="function"&&gn instanceof gn&&typeof Gn=="function"&&Gn instanceof Gn)&&(Oe=!1)}return E.delete(o),E.delete(l),Oe}function xi(o){return Eg(oS(o,n,gS),o+"")}function yg(o){return _1(o,zt,bg)}function Sg(o){return _1(o,kn,tS)}var _g=$c?function(o){return $c.get(o)}:$g;function Zc(o){for(var l=o.name+"",d=Ho[l],m=Xe.call(Ho,l)?d.length:0;m--;){var b=d[m],E=b.func;if(E==null||E==o)return b.name}return l}function Ko(o){var l=Xe.call(k,"placeholder")?k:o;return l.placeholder}function ye(){var o=k.iteratee||Bg;return o=o===Bg?C1:o,arguments.length?o(arguments[0],arguments[1]):o}function ef(o,l){var d=o.__data__;return cT(l)?d[typeof l=="string"?"string":"hash"]:d.map}function wg(o){for(var l=zt(o),d=l.length;d--;){var m=l[d],b=o[m];l[d]=[m,b,iS(b)]}return l}function Va(o,l){var d=hP(o,l);return b1(d)?d:n}function rT(o){var l=Xe.call(o,Ga),d=o[Ga];try{o[Ga]=n;var m=!0}catch{}var b=Ac.call(o);return m&&(l?o[Ga]=d:delete o[Ga]),b}var bg=Yp?function(o){return o==null?[]:(o=rt(o),Ji(Yp(o),function(l){return s1.call(o,l)}))}:zg,tS=Yp?function(o){for(var l=[];o;)Zi(l,bg(o)),o=Mc(o);return l}:zg,an=hn;(Xp&&an(new Xp(new ArrayBuffer(1)))!=br||gl&&an(new gl)!=Pt||Qp&&an(Qp.resolve())!=Fa||jo&&an(new jo)!=Kt||ml&&an(new ml)!=Wr)&&(an=function(o){var l=hn(o),d=l==Mn?o.constructor:n,m=d?qa(d):"";if(m)switch(m){case $P:return br;case zP:return Pt;case GP:return Fa;case UP:return Kt;case jP:return Wr}return l});function iT(o,l,d){for(var m=-1,b=d.length;++m<b;){var E=d[m],R=E.size;switch(E.type){case"drop":o+=R;break;case"dropRight":l-=R;break;case"take":l=rn(l,o+R);break;case"takeRight":o=Lt(o,l-R);break}}return{start:o,end:l}}function aT(o){var l=o.match(Xi);return l?l[1].split(vp):[]}function nS(o,l,d){l=ia(l,o);for(var m=-1,b=l.length,E=!1;++m<b;){var R=Yr(l[m]);if(!(E=o!=null&&d(o,R)))break;o=o[R]}return E||++m!=b?E:(b=o==null?0:o.length,!!b&&lf(b)&&ki(R,b)&&(ke(o)||Ka(o)))}function oT(o){var l=o.length,d=new o.constructor(l);return l&&typeof o[0]=="string"&&Xe.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function rS(o){return typeof o.constructor=="function"&&!kl(o)?Wo(Mc(o)):{}}function sT(o,l,d){var m=o.constructor;switch(l){case Vr:return gg(o);case Bt:case bn:return new m(+o);case br:return HO(o,d);case xo:case ko:case Eo:case Po:case Oo:case Js:case Zs:case Cr:case Ki:return $1(o,d);case Pt:return new m;case gi:case Dn:return new m(o);case er:return WO(o);case Kt:return new m;case bt:return VO(o)}}function lT(o,l){var d=l.length;if(!d)return o;var m=d-1;return l[m]=(d>1?"& ":"")+l[m],l=l.join(d>2?", ":" "),o.replace(mp,`{
/* [wrapped with `+l+`] */
`)}function uT(o){return ke(o)||Ka(o)||!!(l1&&o&&o[l1])}function ki(o,l){var d=typeof o;return l=l??H,!!l&&(d=="number"||d!="symbol"&&Ep.test(o))&&o>-1&&o%1==0&&o<l}function pn(o,l,d){if(!ht(d))return!1;var m=typeof l;return(m=="number"?xn(d)&&ki(l,d.length):m=="string"&&l in d)?Or(d[l],o):!1}function Cg(o,l){if(ke(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||$n(o)?!0:hp.test(o)||!dp.test(o)||l!=null&&o in rt(l)}function cT(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function xg(o){var l=Zc(o),d=k[l];if(typeof d!="function"||!(l in Me.prototype))return!1;if(o===d)return!0;var m=_g(d);return!!m&&o===m[0]}function fT(o){return!!i1&&i1 in o}var dT=Tc?Ei:Gg;function kl(o){var l=o&&o.constructor,d=typeof l=="function"&&l.prototype||Uo;return o===d}function iS(o){return o===o&&!ht(o)}function aS(o,l){return function(d){return d==null?!1:d[o]===l&&(l!==n||o in rt(d))}}function hT(o){var l=of(o,function(m){return d.size===f&&d.clear(),m}),d=l.cache;return l}function pT(o,l){var d=o[1],m=l[1],b=d|m,E=b<(x|_|D),R=m==D&&d==C||m==D&&d==U&&o[7].length<=l[8]||m==(D|U)&&l[7].length<=l[8]&&d==C;if(!(E||R))return o;m&x&&(o[2]=l[2],b|=d&x?0:S);var M=l[3];if(M){var z=o[3];o[3]=z?G1(z,M,l[4]):M,o[4]=z?ea(o[3],h):l[4]}return M=l[5],M&&(z=o[5],o[5]=z?U1(z,M,l[6]):M,o[6]=z?ea(o[5],h):l[6]),M=l[7],M&&(o[7]=M),m&D&&(o[8]=o[8]==null?l[8]:rn(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=b,o}function gT(o){var l=[];if(o!=null)for(var d in rt(o))l.push(d);return l}function mT(o){return Ac.call(o)}function oS(o,l,d){return l=Lt(l===n?o.length-1:l,0),function(){for(var m=arguments,b=-1,E=Lt(m.length-l,0),R=q(E);++b<E;)R[b]=m[l+b];b=-1;for(var M=q(l+1);++b<l;)M[b]=m[b];return M[l]=d(R),Nn(o,this,M)}}function sS(o,l){return l.length<2?o:Wa(o,ar(l,0,-1))}function vT(o,l){for(var d=o.length,m=rn(l.length,d),b=Cn(o);m--;){var E=l[m];o[m]=ki(E,d)?b[E]:n}return o}function kg(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var lS=cS(A1),El=IP||function(o,l){return Ee.setTimeout(o,l)},Eg=cS(zO);function uS(o,l,d){var m=l+"";return Eg(o,lT(m,yT(aT(m),d)))}function cS(o){var l=0,d=0;return function(){var m=NP(),b=j-(m-d);if(d=m,b>0){if(++l>=ce)return arguments[0]}else l=0;return o.apply(n,arguments)}}function tf(o,l){var d=-1,m=o.length,b=m-1;for(l=l===n?m:l;++d<l;){var E=lg(d,b),R=o[E];o[E]=o[d],o[d]=R}return o.length=l,o}var fS=hT(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(xr,function(d,m,b,E){l.push(b?E.replace(_p,"$1"):m||d)}),l});function Yr(o){if(typeof o=="string"||$n(o))return o;var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function qa(o){if(o!=null){try{return Rc.call(o)}catch{}try{return o+""}catch{}}return""}function yT(o,l){return tr(Ue,function(d){var m="_."+d[0];l&d[1]&&!kc(o,m)&&o.push(m)}),o.sort()}function dS(o){if(o instanceof Me)return o.clone();var l=new rr(o.__wrapped__,o.__chain__);return l.__actions__=Cn(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function ST(o,l,d){(d?pn(o,l,d):l===n)?l=1:l=Lt(Pe(l),0);var m=o==null?0:o.length;if(!m||l<1)return[];for(var b=0,E=0,R=q(Bc(m/l));b<m;)R[E++]=ar(o,b,b+=l);return R}function _T(o){for(var l=-1,d=o==null?0:o.length,m=0,b=[];++l<d;){var E=o[l];E&&(b[m++]=E)}return b}function wT(){var o=arguments.length;if(!o)return[];for(var l=q(o-1),d=arguments[0],m=o;m--;)l[m-1]=arguments[m];return Zi(ke(d)?Cn(d):[d],Xt(l,1))}var bT=Re(function(o,l){return Ct(o)?_l(o,Xt(l,1,Ct,!0)):[]}),CT=Re(function(o,l){var d=or(l);return Ct(d)&&(d=n),Ct(o)?_l(o,Xt(l,1,Ct,!0),ye(d,2)):[]}),xT=Re(function(o,l){var d=or(l);return Ct(d)&&(d=n),Ct(o)?_l(o,Xt(l,1,Ct,!0),n,d):[]});function kT(o,l,d){var m=o==null?0:o.length;return m?(l=d||l===n?1:Pe(l),ar(o,l<0?0:l,m)):[]}function ET(o,l,d){var m=o==null?0:o.length;return m?(l=d||l===n?1:Pe(l),l=m-l,ar(o,0,l<0?0:l)):[]}function PT(o,l){return o&&o.length?qc(o,ye(l,3),!0,!0):[]}function OT(o,l){return o&&o.length?qc(o,ye(l,3),!0):[]}function TT(o,l,d,m){var b=o==null?0:o.length;return b?(d&&typeof d!="number"&&pn(o,l,d)&&(d=0,m=b),wO(o,l,d,m)):[]}function hS(o,l,d){var m=o==null?0:o.length;if(!m)return-1;var b=d==null?0:Pe(d);return b<0&&(b=Lt(m+b,0)),Ec(o,ye(l,3),b)}function pS(o,l,d){var m=o==null?0:o.length;if(!m)return-1;var b=m-1;return d!==n&&(b=Pe(d),b=d<0?Lt(m+b,0):rn(b,m-1)),Ec(o,ye(l,3),b,!0)}function gS(o){var l=o==null?0:o.length;return l?Xt(o,1):[]}function RT(o){var l=o==null?0:o.length;return l?Xt(o,ie):[]}function AT(o,l){var d=o==null?0:o.length;return d?(l=l===n?1:Pe(l),Xt(o,l)):[]}function IT(o){for(var l=-1,d=o==null?0:o.length,m={};++l<d;){var b=o[l];m[b[0]]=b[1]}return m}function mS(o){return o&&o.length?o[0]:n}function LT(o,l,d){var m=o==null?0:o.length;if(!m)return-1;var b=d==null?0:Pe(d);return b<0&&(b=Lt(m+b,0)),Fo(o,l,b)}function MT(o){var l=o==null?0:o.length;return l?ar(o,0,-1):[]}var DT=Re(function(o){var l=ut(o,hg);return l.length&&l[0]===o[0]?rg(l):[]}),NT=Re(function(o){var l=or(o),d=ut(o,hg);return l===or(d)?l=n:d.pop(),d.length&&d[0]===o[0]?rg(d,ye(l,2)):[]}),BT=Re(function(o){var l=or(o),d=ut(o,hg);return l=typeof l=="function"?l:n,l&&d.pop(),d.length&&d[0]===o[0]?rg(d,n,l):[]});function FT(o,l){return o==null?"":MP.call(o,l)}function or(o){var l=o==null?0:o.length;return l?o[l-1]:n}function $T(o,l,d){var m=o==null?0:o.length;if(!m)return-1;var b=m;return d!==n&&(b=Pe(d),b=b<0?Lt(m+b,0):rn(b,m-1)),l===l?yP(o,l,b):Ec(o,X0,b,!0)}function zT(o,l){return o&&o.length?P1(o,Pe(l)):n}var GT=Re(vS);function vS(o,l){return o&&o.length&&l&&l.length?sg(o,l):o}function UT(o,l,d){return o&&o.length&&l&&l.length?sg(o,l,ye(d,2)):o}function jT(o,l,d){return o&&o.length&&l&&l.length?sg(o,l,n,d):o}var HT=xi(function(o,l){var d=o==null?0:o.length,m=Zp(o,l);return R1(o,ut(l,function(b){return ki(b,d)?+b:b}).sort(z1)),m});function WT(o,l){var d=[];if(!(o&&o.length))return d;var m=-1,b=[],E=o.length;for(l=ye(l,3);++m<E;){var R=o[m];l(R,m,o)&&(d.push(R),b.push(m))}return R1(o,b),d}function Pg(o){return o==null?o:FP.call(o)}function VT(o,l,d){var m=o==null?0:o.length;return m?(d&&typeof d!="number"&&pn(o,l,d)?(l=0,d=m):(l=l==null?0:Pe(l),d=d===n?m:Pe(d)),ar(o,l,d)):[]}function qT(o,l){return Vc(o,l)}function KT(o,l,d){return cg(o,l,ye(d,2))}function YT(o,l){var d=o==null?0:o.length;if(d){var m=Vc(o,l);if(m<d&&Or(o[m],l))return m}return-1}function XT(o,l){return Vc(o,l,!0)}function QT(o,l,d){return cg(o,l,ye(d,2),!0)}function JT(o,l){var d=o==null?0:o.length;if(d){var m=Vc(o,l,!0)-1;if(Or(o[m],l))return m}return-1}function ZT(o){return o&&o.length?I1(o):[]}function eR(o,l){return o&&o.length?I1(o,ye(l,2)):[]}function tR(o){var l=o==null?0:o.length;return l?ar(o,1,l):[]}function nR(o,l,d){return o&&o.length?(l=d||l===n?1:Pe(l),ar(o,0,l<0?0:l)):[]}function rR(o,l,d){var m=o==null?0:o.length;return m?(l=d||l===n?1:Pe(l),l=m-l,ar(o,l<0?0:l,m)):[]}function iR(o,l){return o&&o.length?qc(o,ye(l,3),!1,!0):[]}function aR(o,l){return o&&o.length?qc(o,ye(l,3)):[]}var oR=Re(function(o){return ra(Xt(o,1,Ct,!0))}),sR=Re(function(o){var l=or(o);return Ct(l)&&(l=n),ra(Xt(o,1,Ct,!0),ye(l,2))}),lR=Re(function(o){var l=or(o);return l=typeof l=="function"?l:n,ra(Xt(o,1,Ct,!0),n,l)});function uR(o){return o&&o.length?ra(o):[]}function cR(o,l){return o&&o.length?ra(o,ye(l,2)):[]}function fR(o,l){return l=typeof l=="function"?l:n,o&&o.length?ra(o,n,l):[]}function Og(o){if(!(o&&o.length))return[];var l=0;return o=Ji(o,function(d){if(Ct(d))return l=Lt(d.length,l),!0}),Wp(l,function(d){return ut(o,Up(d))})}function yS(o,l){if(!(o&&o.length))return[];var d=Og(o);return l==null?d:ut(d,function(m){return Nn(l,n,m)})}var dR=Re(function(o,l){return Ct(o)?_l(o,l):[]}),hR=Re(function(o){return dg(Ji(o,Ct))}),pR=Re(function(o){var l=or(o);return Ct(l)&&(l=n),dg(Ji(o,Ct),ye(l,2))}),gR=Re(function(o){var l=or(o);return l=typeof l=="function"?l:n,dg(Ji(o,Ct),n,l)}),mR=Re(Og);function vR(o,l){return N1(o||[],l||[],Sl)}function yR(o,l){return N1(o||[],l||[],Cl)}var SR=Re(function(o){var l=o.length,d=l>1?o[l-1]:n;return d=typeof d=="function"?(o.pop(),d):n,yS(o,d)});function SS(o){var l=k(o);return l.__chain__=!0,l}function _R(o,l){return l(o),o}function nf(o,l){return l(o)}var wR=xi(function(o){var l=o.length,d=l?o[0]:0,m=this.__wrapped__,b=function(E){return Zp(E,o)};return l>1||this.__actions__.length||!(m instanceof Me)||!ki(d)?this.thru(b):(m=m.slice(d,+d+(l?1:0)),m.__actions__.push({func:nf,args:[b],thisArg:n}),new rr(m,this.__chain__).thru(function(E){return l&&!E.length&&E.push(n),E}))});function bR(){return SS(this)}function CR(){return new rr(this.value(),this.__chain__)}function xR(){this.__values__===n&&(this.__values__=LS(this.value()));var o=this.__index__>=this.__values__.length,l=o?n:this.__values__[this.__index__++];return{done:o,value:l}}function kR(){return this}function ER(o){for(var l,d=this;d instanceof Gc;){var m=dS(d);m.__index__=0,m.__values__=n,l?b.__wrapped__=m:l=m;var b=m;d=d.__wrapped__}return b.__wrapped__=o,l}function PR(){var o=this.__wrapped__;if(o instanceof Me){var l=o;return this.__actions__.length&&(l=new Me(this)),l=l.reverse(),l.__actions__.push({func:nf,args:[Pg],thisArg:n}),new rr(l,this.__chain__)}return this.thru(Pg)}function OR(){return D1(this.__wrapped__,this.__actions__)}var TR=Kc(function(o,l,d){Xe.call(o,d)?++o[d]:bi(o,d,1)});function RR(o,l,d){var m=ke(o)?K0:_O;return d&&pn(o,l,d)&&(l=n),m(o,ye(l,3))}function AR(o,l){var d=ke(o)?Ji:y1;return d(o,ye(l,3))}var IR=V1(hS),LR=V1(pS);function MR(o,l){return Xt(rf(o,l),1)}function DR(o,l){return Xt(rf(o,l),ie)}function NR(o,l,d){return d=d===n?1:Pe(d),Xt(rf(o,l),d)}function _S(o,l){var d=ke(o)?tr:na;return d(o,ye(l,3))}function wS(o,l){var d=ke(o)?tP:v1;return d(o,ye(l,3))}var BR=Kc(function(o,l,d){Xe.call(o,d)?o[d].push(l):bi(o,d,[l])});function FR(o,l,d,m){o=xn(o)?o:Xo(o),d=d&&!m?Pe(d):0;var b=o.length;return d<0&&(d=Lt(b+d,0)),uf(o)?d<=b&&o.indexOf(l,d)>-1:!!b&&Fo(o,l,d)>-1}var $R=Re(function(o,l,d){var m=-1,b=typeof l=="function",E=xn(o)?q(o.length):[];return na(o,function(R){E[++m]=b?Nn(l,R,d):wl(R,l,d)}),E}),zR=Kc(function(o,l,d){bi(o,d,l)});function rf(o,l){var d=ke(o)?ut:x1;return d(o,ye(l,3))}function GR(o,l,d,m){return o==null?[]:(ke(l)||(l=l==null?[]:[l]),d=m?n:d,ke(d)||(d=d==null?[]:[d]),O1(o,l,d))}var UR=Kc(function(o,l,d){o[d?0:1].push(l)},function(){return[[],[]]});function jR(o,l,d){var m=ke(o)?zp:J0,b=arguments.length<3;return m(o,ye(l,4),d,b,na)}function HR(o,l,d){var m=ke(o)?nP:J0,b=arguments.length<3;return m(o,ye(l,4),d,b,v1)}function WR(o,l){var d=ke(o)?Ji:y1;return d(o,sf(ye(l,3)))}function VR(o){var l=ke(o)?h1:FO;return l(o)}function qR(o,l,d){(d?pn(o,l,d):l===n)?l=1:l=Pe(l);var m=ke(o)?gO:$O;return m(o,l)}function KR(o){var l=ke(o)?mO:GO;return l(o)}function YR(o){if(o==null)return 0;if(xn(o))return uf(o)?zo(o):o.length;var l=an(o);return l==Pt||l==Kt?o.size:ag(o).length}function XR(o,l,d){var m=ke(o)?Gp:UO;return d&&pn(o,l,d)&&(l=n),m(o,ye(l,3))}var QR=Re(function(o,l){if(o==null)return[];var d=l.length;return d>1&&pn(o,l[0],l[1])?l=[]:d>2&&pn(l[0],l[1],l[2])&&(l=[l[0]]),O1(o,Xt(l,1),[])}),af=AP||function(){return Ee.Date.now()};function JR(o,l){if(typeof l!="function")throw new nr(s);return o=Pe(o),function(){if(--o<1)return l.apply(this,arguments)}}function bS(o,l,d){return l=d?n:l,l=o&&l==null?o.length:l,Ci(o,D,n,n,n,n,l)}function CS(o,l){var d;if(typeof l!="function")throw new nr(s);return o=Pe(o),function(){return--o>0&&(d=l.apply(this,arguments)),o<=1&&(l=n),d}}var Tg=Re(function(o,l,d){var m=x;if(d.length){var b=ea(d,Ko(Tg));m|=I}return Ci(o,m,l,d,b)}),xS=Re(function(o,l,d){var m=x|_;if(d.length){var b=ea(d,Ko(xS));m|=I}return Ci(l,m,o,d,b)});function kS(o,l,d){l=d?n:l;var m=Ci(o,C,n,n,n,n,n,l);return m.placeholder=kS.placeholder,m}function ES(o,l,d){l=d?n:l;var m=Ci(o,O,n,n,n,n,n,l);return m.placeholder=ES.placeholder,m}function PS(o,l,d){var m,b,E,R,M,z,Z=0,ee=!1,ne=!1,ue=!0;if(typeof o!="function")throw new nr(s);l=sr(l)||0,ht(d)&&(ee=!!d.leading,ne="maxWait"in d,E=ne?Lt(sr(d.maxWait)||0,l):E,ue="trailing"in d?!!d.trailing:ue);function ge(xt){var Tr=m,Oi=b;return m=b=n,Z=xt,R=o.apply(Oi,Tr),R}function Se(xt){return Z=xt,M=El(Le,l),ee?ge(xt):R}function Oe(xt){var Tr=xt-z,Oi=xt-Z,VS=l-Tr;return ne?rn(VS,E-Oi):VS}function _e(xt){var Tr=xt-z,Oi=xt-Z;return z===n||Tr>=l||Tr<0||ne&&Oi>=E}function Le(){var xt=af();if(_e(xt))return Ne(xt);M=El(Le,Oe(xt))}function Ne(xt){return M=n,ue&&m?ge(xt):(m=b=n,R)}function zn(){M!==n&&B1(M),Z=0,m=z=b=M=n}function gn(){return M===n?R:Ne(af())}function Gn(){var xt=af(),Tr=_e(xt);if(m=arguments,b=this,z=xt,Tr){if(M===n)return Se(z);if(ne)return B1(M),M=El(Le,l),ge(z)}return M===n&&(M=El(Le,l)),R}return Gn.cancel=zn,Gn.flush=gn,Gn}var ZR=Re(function(o,l){return m1(o,1,l)}),eA=Re(function(o,l,d){return m1(o,sr(l)||0,d)});function tA(o){return Ci(o,X)}function of(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new nr(s);var d=function(){var m=arguments,b=l?l.apply(this,m):m[0],E=d.cache;if(E.has(b))return E.get(b);var R=o.apply(this,m);return d.cache=E.set(b,R)||E,R};return d.cache=new(of.Cache||wi),d}of.Cache=wi;function sf(o){if(typeof o!="function")throw new nr(s);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function nA(o){return CS(2,o)}var rA=jO(function(o,l){l=l.length==1&&ke(l[0])?ut(l[0],Bn(ye())):ut(Xt(l,1),Bn(ye()));var d=l.length;return Re(function(m){for(var b=-1,E=rn(m.length,d);++b<E;)m[b]=l[b].call(this,m[b]);return Nn(o,this,m)})}),Rg=Re(function(o,l){var d=ea(l,Ko(Rg));return Ci(o,I,n,l,d)}),OS=Re(function(o,l){var d=ea(l,Ko(OS));return Ci(o,L,n,l,d)}),iA=xi(function(o,l){return Ci(o,U,n,n,n,l)});function aA(o,l){if(typeof o!="function")throw new nr(s);return l=l===n?l:Pe(l),Re(o,l)}function oA(o,l){if(typeof o!="function")throw new nr(s);return l=l==null?0:Lt(Pe(l),0),Re(function(d){var m=d[l],b=aa(d,0,l);return m&&Zi(b,m),Nn(o,this,b)})}function sA(o,l,d){var m=!0,b=!0;if(typeof o!="function")throw new nr(s);return ht(d)&&(m="leading"in d?!!d.leading:m,b="trailing"in d?!!d.trailing:b),PS(o,l,{leading:m,maxWait:l,trailing:b})}function lA(o){return bS(o,1)}function uA(o,l){return Rg(pg(l),o)}function cA(){if(!arguments.length)return[];var o=arguments[0];return ke(o)?o:[o]}function fA(o){return ir(o,y)}function dA(o,l){return l=typeof l=="function"?l:n,ir(o,y,l)}function hA(o){return ir(o,p|y)}function pA(o,l){return l=typeof l=="function"?l:n,ir(o,p|y,l)}function gA(o,l){return l==null||g1(o,l,zt(l))}function Or(o,l){return o===l||o!==o&&l!==l}var mA=Jc(ng),vA=Jc(function(o,l){return o>=l}),Ka=w1(function(){return arguments}())?w1:function(o){return St(o)&&Xe.call(o,"callee")&&!s1.call(o,"callee")},ke=q.isArray,yA=No?Bn(No):EO;function xn(o){return o!=null&&lf(o.length)&&!Ei(o)}function Ct(o){return St(o)&&xn(o)}function SA(o){return o===!0||o===!1||St(o)&&hn(o)==Bt}var oa=LP||Gg,_A=Bo?Bn(Bo):PO;function wA(o){return St(o)&&o.nodeType===1&&!Pl(o)}function bA(o){if(o==null)return!0;if(xn(o)&&(ke(o)||typeof o=="string"||typeof o.splice=="function"||oa(o)||Yo(o)||Ka(o)))return!o.length;var l=an(o);if(l==Pt||l==Kt)return!o.size;if(kl(o))return!ag(o).length;for(var d in o)if(Xe.call(o,d))return!1;return!0}function CA(o,l){return bl(o,l)}function xA(o,l,d){d=typeof d=="function"?d:n;var m=d?d(o,l):n;return m===n?bl(o,l,n,d):!!m}function Ag(o){if(!St(o))return!1;var l=hn(o);return l==Ft||l==wr||typeof o.message=="string"&&typeof o.name=="string"&&!Pl(o)}function kA(o){return typeof o=="number"&&u1(o)}function Ei(o){if(!ht(o))return!1;var l=hn(o);return l==xe||l==Hr||l==qt||l==Qs}function TS(o){return typeof o=="number"&&o==Pe(o)}function lf(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=H}function ht(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function St(o){return o!=null&&typeof o=="object"}var RS=dl?Bn(dl):TO;function EA(o,l){return o===l||ig(o,l,wg(l))}function PA(o,l,d){return d=typeof d=="function"?d:n,ig(o,l,wg(l),d)}function OA(o){return AS(o)&&o!=+o}function TA(o){if(dT(o))throw new Ce(a);return b1(o)}function RA(o){return o===null}function AA(o){return o==null}function AS(o){return typeof o=="number"||St(o)&&hn(o)==gi}function Pl(o){if(!St(o)||hn(o)!=Mn)return!1;var l=Mc(o);if(l===null)return!0;var d=Xe.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&Rc.call(d)==PP}var Ig=W0?Bn(W0):RO;function IA(o){return TS(o)&&o>=-H&&o<=H}var IS=V0?Bn(V0):AO;function uf(o){return typeof o=="string"||!ke(o)&&St(o)&&hn(o)==Dn}function $n(o){return typeof o=="symbol"||St(o)&&hn(o)==bt}var Yo=q0?Bn(q0):IO;function LA(o){return o===n}function MA(o){return St(o)&&an(o)==Wr}function DA(o){return St(o)&&hn(o)==Co}var NA=Jc(og),BA=Jc(function(o,l){return o<=l});function LS(o){if(!o)return[];if(xn(o))return uf(o)?Er(o):Cn(o);if(pl&&o[pl])return gP(o[pl]());var l=an(o),d=l==Pt?qp:l==Kt?Pc:Xo;return d(o)}function Pi(o){if(!o)return o===0?o:0;if(o=sr(o),o===ie||o===-ie){var l=o<0?-1:1;return l*Y}return o===o?o:0}function Pe(o){var l=Pi(o),d=l%1;return l===l?d?l-d:l:0}function MS(o){return o?Ha(Pe(o),0,oe):0}function sr(o){if(typeof o=="number")return o;if($n(o))return Q;if(ht(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=ht(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=Z0(o);var d=Cp.test(o);return d||kp.test(o)?fe(o.slice(2),d?2:8):bp.test(o)?Q:+o}function DS(o){return Kr(o,kn(o))}function FA(o){return o?Ha(Pe(o),-H,H):o===0?o:0}function Ve(o){return o==null?"":Fn(o)}var $A=Vo(function(o,l){if(kl(l)||xn(l)){Kr(l,zt(l),o);return}for(var d in l)Xe.call(l,d)&&Sl(o,d,l[d])}),NS=Vo(function(o,l){Kr(l,kn(l),o)}),cf=Vo(function(o,l,d,m){Kr(l,kn(l),o,m)}),zA=Vo(function(o,l,d,m){Kr(l,zt(l),o,m)}),GA=xi(Zp);function UA(o,l){var d=Wo(o);return l==null?d:p1(d,l)}var jA=Re(function(o,l){o=rt(o);var d=-1,m=l.length,b=m>2?l[2]:n;for(b&&pn(l[0],l[1],b)&&(m=1);++d<m;)for(var E=l[d],R=kn(E),M=-1,z=R.length;++M<z;){var Z=R[M],ee=o[Z];(ee===n||Or(ee,Uo[Z])&&!Xe.call(o,Z))&&(o[Z]=E[Z])}return o}),HA=Re(function(o){return o.push(n,Z1),Nn(BS,n,o)});function WA(o,l){return Y0(o,ye(l,3),qr)}function VA(o,l){return Y0(o,ye(l,3),tg)}function qA(o,l){return o==null?o:eg(o,ye(l,3),kn)}function KA(o,l){return o==null?o:S1(o,ye(l,3),kn)}function YA(o,l){return o&&qr(o,ye(l,3))}function XA(o,l){return o&&tg(o,ye(l,3))}function QA(o){return o==null?[]:Hc(o,zt(o))}function JA(o){return o==null?[]:Hc(o,kn(o))}function Lg(o,l,d){var m=o==null?n:Wa(o,l);return m===n?d:m}function ZA(o,l){return o!=null&&nS(o,l,bO)}function Mg(o,l){return o!=null&&nS(o,l,CO)}var eI=K1(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Ac.call(l)),o[l]=d},Ng(En)),tI=K1(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Ac.call(l)),Xe.call(o,l)?o[l].push(d):o[l]=[d]},ye),nI=Re(wl);function zt(o){return xn(o)?d1(o):ag(o)}function kn(o){return xn(o)?d1(o,!0):LO(o)}function rI(o,l){var d={};return l=ye(l,3),qr(o,function(m,b,E){bi(d,l(m,b,E),m)}),d}function iI(o,l){var d={};return l=ye(l,3),qr(o,function(m,b,E){bi(d,b,l(m,b,E))}),d}var aI=Vo(function(o,l,d){Wc(o,l,d)}),BS=Vo(function(o,l,d,m){Wc(o,l,d,m)}),oI=xi(function(o,l){var d={};if(o==null)return d;var m=!1;l=ut(l,function(E){return E=ia(E,o),m||(m=E.length>1),E}),Kr(o,Sg(o),d),m&&(d=ir(d,p|g|y,eT));for(var b=l.length;b--;)fg(d,l[b]);return d});function sI(o,l){return FS(o,sf(ye(l)))}var lI=xi(function(o,l){return o==null?{}:DO(o,l)});function FS(o,l){if(o==null)return{};var d=ut(Sg(o),function(m){return[m]});return l=ye(l),T1(o,d,function(m,b){return l(m,b[0])})}function uI(o,l,d){l=ia(l,o);var m=-1,b=l.length;for(b||(b=1,o=n);++m<b;){var E=o==null?n:o[Yr(l[m])];E===n&&(m=b,E=d),o=Ei(E)?E.call(o):E}return o}function cI(o,l,d){return o==null?o:Cl(o,l,d)}function fI(o,l,d,m){return m=typeof m=="function"?m:n,o==null?o:Cl(o,l,d,m)}var $S=Q1(zt),zS=Q1(kn);function dI(o,l,d){var m=ke(o),b=m||oa(o)||Yo(o);if(l=ye(l,4),d==null){var E=o&&o.constructor;b?d=m?new E:[]:ht(o)?d=Ei(E)?Wo(Mc(o)):{}:d={}}return(b?tr:qr)(o,function(R,M,z){return l(d,R,M,z)}),d}function hI(o,l){return o==null?!0:fg(o,l)}function pI(o,l,d){return o==null?o:M1(o,l,pg(d))}function gI(o,l,d,m){return m=typeof m=="function"?m:n,o==null?o:M1(o,l,pg(d),m)}function Xo(o){return o==null?[]:Vp(o,zt(o))}function mI(o){return o==null?[]:Vp(o,kn(o))}function vI(o,l,d){return d===n&&(d=l,l=n),d!==n&&(d=sr(d),d=d===d?d:0),l!==n&&(l=sr(l),l=l===l?l:0),Ha(sr(o),l,d)}function yI(o,l,d){return l=Pi(l),d===n?(d=l,l=0):d=Pi(d),o=sr(o),xO(o,l,d)}function SI(o,l,d){if(d&&typeof d!="boolean"&&pn(o,l,d)&&(l=d=n),d===n&&(typeof l=="boolean"?(d=l,l=n):typeof o=="boolean"&&(d=o,o=n)),o===n&&l===n?(o=0,l=1):(o=Pi(o),l===n?(l=o,o=0):l=Pi(l)),o>l){var m=o;o=l,l=m}if(d||o%1||l%1){var b=c1();return rn(o+b*(l-o+W("1e-"+((b+"").length-1))),l)}return lg(o,l)}var _I=qo(function(o,l,d){return l=l.toLowerCase(),o+(d?GS(l):l)});function GS(o){return Dg(Ve(o).toLowerCase())}function US(o){return o=Ve(o),o&&o.replace(Pp,cP).replace(wc,"")}function wI(o,l,d){o=Ve(o),l=Fn(l);var m=o.length;d=d===n?m:Ha(Pe(d),0,m);var b=d;return d-=l.length,d>=0&&o.slice(d,b)==l}function bI(o){return o=Ve(o),o&&mi.test(o)?o.replace(Yi,fP):o}function CI(o){return o=Ve(o),o&&pp.test(o)?o.replace(tl,"\\$&"):o}var xI=qo(function(o,l,d){return o+(d?"-":"")+l.toLowerCase()}),kI=qo(function(o,l,d){return o+(d?" ":"")+l.toLowerCase()}),EI=W1("toLowerCase");function PI(o,l,d){o=Ve(o),l=Pe(l);var m=l?zo(o):0;if(!l||m>=l)return o;var b=(l-m)/2;return Qc(Fc(b),d)+o+Qc(Bc(b),d)}function OI(o,l,d){o=Ve(o),l=Pe(l);var m=l?zo(o):0;return l&&m<l?o+Qc(l-m,d):o}function TI(o,l,d){o=Ve(o),l=Pe(l);var m=l?zo(o):0;return l&&m<l?Qc(l-m,d)+o:o}function RI(o,l,d){return d||l==null?l=0:l&&(l=+l),BP(Ve(o).replace(nl,""),l||0)}function AI(o,l,d){return(d?pn(o,l,d):l===n)?l=1:l=Pe(l),ug(Ve(o),l)}function II(){var o=arguments,l=Ve(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var LI=qo(function(o,l,d){return o+(d?"_":"")+l.toLowerCase()});function MI(o,l,d){return d&&typeof d!="number"&&pn(o,l,d)&&(l=d=n),d=d===n?oe:d>>>0,d?(o=Ve(o),o&&(typeof l=="string"||l!=null&&!Ig(l))&&(l=Fn(l),!l&&$o(o))?aa(Er(o),0,d):o.split(l,d)):[]}var DI=qo(function(o,l,d){return o+(d?" ":"")+Dg(l)});function NI(o,l,d){return o=Ve(o),d=d==null?0:Ha(Pe(d),0,o.length),l=Fn(l),o.slice(d,d+l.length)==l}function BI(o,l,d){var m=k.templateSettings;d&&pn(o,l,d)&&(l=n),o=Ve(o),l=cf({},l,m,J1);var b=cf({},l.imports,m.imports,J1),E=zt(b),R=Vp(b,E),M,z,Z=0,ee=l.interpolate||Qi,ne="__p += '",ue=Kp((l.escape||Qi).source+"|"+ee.source+"|"+(ee===rc?wp:Qi).source+"|"+(l.evaluate||Qi).source+"|$","g"),ge="//# sourceURL="+(Xe.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Cc+"]")+`
`;o.replace(ue,function(_e,Le,Ne,zn,gn,Gn){return Ne||(Ne=zn),ne+=o.slice(Z,Gn).replace(Op,dP),Le&&(M=!0,ne+=`' +
__e(`+Le+`) +
'`),gn&&(z=!0,ne+=`';
`+gn+`;
__p += '`),Ne&&(ne+=`' +
((__t = (`+Ne+`)) == null ? '' : __t) +
'`),Z=Gn+_e.length,_e}),ne+=`';
`;var Se=Xe.call(l,"variable")&&l.variable;if(!Se)ne=`with (obj) {
`+ne+`
}
`;else if(Sp.test(Se))throw new Ce(u);ne=(z?ne.replace(sp,""):ne).replace(nc,"$1").replace(lp,"$1;"),ne="function("+(Se||"obj")+`) {
`+(Se?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(z?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+ne+`return __p
}`;var Oe=HS(function(){return je(E,ge+"return "+ne).apply(n,R)});if(Oe.source=ne,Ag(Oe))throw Oe;return Oe}function FI(o){return Ve(o).toLowerCase()}function $I(o){return Ve(o).toUpperCase()}function zI(o,l,d){if(o=Ve(o),o&&(d||l===n))return Z0(o);if(!o||!(l=Fn(l)))return o;var m=Er(o),b=Er(l),E=e1(m,b),R=t1(m,b)+1;return aa(m,E,R).join("")}function GI(o,l,d){if(o=Ve(o),o&&(d||l===n))return o.slice(0,r1(o)+1);if(!o||!(l=Fn(l)))return o;var m=Er(o),b=t1(m,Er(l))+1;return aa(m,0,b).join("")}function UI(o,l,d){if(o=Ve(o),o&&(d||l===n))return o.replace(nl,"");if(!o||!(l=Fn(l)))return o;var m=Er(o),b=e1(m,Er(l));return aa(m,b).join("")}function jI(o,l){var d=K,m=te;if(ht(l)){var b="separator"in l?l.separator:b;d="length"in l?Pe(l.length):d,m="omission"in l?Fn(l.omission):m}o=Ve(o);var E=o.length;if($o(o)){var R=Er(o);E=R.length}if(d>=E)return o;var M=d-zo(m);if(M<1)return m;var z=R?aa(R,0,M).join(""):o.slice(0,M);if(b===n)return z+m;if(R&&(M+=z.length-M),Ig(b)){if(o.slice(M).search(b)){var Z,ee=z;for(b.global||(b=Kp(b.source,Ve(vi.exec(b))+"g")),b.lastIndex=0;Z=b.exec(ee);)var ne=Z.index;z=z.slice(0,ne===n?M:ne)}}else if(o.indexOf(Fn(b),M)!=M){var ue=z.lastIndexOf(b);ue>-1&&(z=z.slice(0,ue))}return z+m}function HI(o){return o=Ve(o),o&&up.test(o)?o.replace(el,SP):o}var WI=qo(function(o,l,d){return o+(d?" ":"")+l.toUpperCase()}),Dg=W1("toUpperCase");function jS(o,l,d){return o=Ve(o),l=d?n:l,l===n?pP(o)?bP(o):aP(o):o.match(l)||[]}var HS=Re(function(o,l){try{return Nn(o,n,l)}catch(d){return Ag(d)?d:new Ce(d)}}),VI=xi(function(o,l){return tr(l,function(d){d=Yr(d),bi(o,d,Tg(o[d],o))}),o});function qI(o){var l=o==null?0:o.length,d=ye();return o=l?ut(o,function(m){if(typeof m[1]!="function")throw new nr(s);return[d(m[0]),m[1]]}):[],Re(function(m){for(var b=-1;++b<l;){var E=o[b];if(Nn(E[0],this,m))return Nn(E[1],this,m)}})}function KI(o){return SO(ir(o,p))}function Ng(o){return function(){return o}}function YI(o,l){return o==null||o!==o?l:o}var XI=q1(),QI=q1(!0);function En(o){return o}function Bg(o){return C1(typeof o=="function"?o:ir(o,p))}function JI(o){return k1(ir(o,p))}function ZI(o,l){return E1(o,ir(l,p))}var eL=Re(function(o,l){return function(d){return wl(d,o,l)}}),tL=Re(function(o,l){return function(d){return wl(o,d,l)}});function Fg(o,l,d){var m=zt(l),b=Hc(l,m);d==null&&!(ht(l)&&(b.length||!m.length))&&(d=l,l=o,o=this,b=Hc(l,zt(l)));var E=!(ht(d)&&"chain"in d)||!!d.chain,R=Ei(o);return tr(b,function(M){var z=l[M];o[M]=z,R&&(o.prototype[M]=function(){var Z=this.__chain__;if(E||Z){var ee=o(this.__wrapped__),ne=ee.__actions__=Cn(this.__actions__);return ne.push({func:z,args:arguments,thisArg:o}),ee.__chain__=Z,ee}return z.apply(o,Zi([this.value()],arguments))})}),o}function nL(){return Ee._===this&&(Ee._=OP),this}function $g(){}function rL(o){return o=Pe(o),Re(function(l){return P1(l,o)})}var iL=mg(ut),aL=mg(K0),oL=mg(Gp);function WS(o){return Cg(o)?Up(Yr(o)):NO(o)}function sL(o){return function(l){return o==null?n:Wa(o,l)}}var lL=Y1(),uL=Y1(!0);function zg(){return[]}function Gg(){return!1}function cL(){return{}}function fL(){return""}function dL(){return!0}function hL(o,l){if(o=Pe(o),o<1||o>H)return[];var d=oe,m=rn(o,oe);l=ye(l),o-=oe;for(var b=Wp(m,l);++d<o;)l(d);return b}function pL(o){return ke(o)?ut(o,Yr):$n(o)?[o]:Cn(fS(Ve(o)))}function gL(o){var l=++EP;return Ve(o)+l}var mL=Xc(function(o,l){return o+l},0),vL=vg("ceil"),yL=Xc(function(o,l){return o/l},1),SL=vg("floor");function _L(o){return o&&o.length?jc(o,En,ng):n}function wL(o,l){return o&&o.length?jc(o,ye(l,2),ng):n}function bL(o){return Q0(o,En)}function CL(o,l){return Q0(o,ye(l,2))}function xL(o){return o&&o.length?jc(o,En,og):n}function kL(o,l){return o&&o.length?jc(o,ye(l,2),og):n}var EL=Xc(function(o,l){return o*l},1),PL=vg("round"),OL=Xc(function(o,l){return o-l},0);function TL(o){return o&&o.length?Hp(o,En):0}function RL(o,l){return o&&o.length?Hp(o,ye(l,2)):0}return k.after=JR,k.ary=bS,k.assign=$A,k.assignIn=NS,k.assignInWith=cf,k.assignWith=zA,k.at=GA,k.before=CS,k.bind=Tg,k.bindAll=VI,k.bindKey=xS,k.castArray=cA,k.chain=SS,k.chunk=ST,k.compact=_T,k.concat=wT,k.cond=qI,k.conforms=KI,k.constant=Ng,k.countBy=TR,k.create=UA,k.curry=kS,k.curryRight=ES,k.debounce=PS,k.defaults=jA,k.defaultsDeep=HA,k.defer=ZR,k.delay=eA,k.difference=bT,k.differenceBy=CT,k.differenceWith=xT,k.drop=kT,k.dropRight=ET,k.dropRightWhile=PT,k.dropWhile=OT,k.fill=TT,k.filter=AR,k.flatMap=MR,k.flatMapDeep=DR,k.flatMapDepth=NR,k.flatten=gS,k.flattenDeep=RT,k.flattenDepth=AT,k.flip=tA,k.flow=XI,k.flowRight=QI,k.fromPairs=IT,k.functions=QA,k.functionsIn=JA,k.groupBy=BR,k.initial=MT,k.intersection=DT,k.intersectionBy=NT,k.intersectionWith=BT,k.invert=eI,k.invertBy=tI,k.invokeMap=$R,k.iteratee=Bg,k.keyBy=zR,k.keys=zt,k.keysIn=kn,k.map=rf,k.mapKeys=rI,k.mapValues=iI,k.matches=JI,k.matchesProperty=ZI,k.memoize=of,k.merge=aI,k.mergeWith=BS,k.method=eL,k.methodOf=tL,k.mixin=Fg,k.negate=sf,k.nthArg=rL,k.omit=oI,k.omitBy=sI,k.once=nA,k.orderBy=GR,k.over=iL,k.overArgs=rA,k.overEvery=aL,k.overSome=oL,k.partial=Rg,k.partialRight=OS,k.partition=UR,k.pick=lI,k.pickBy=FS,k.property=WS,k.propertyOf=sL,k.pull=GT,k.pullAll=vS,k.pullAllBy=UT,k.pullAllWith=jT,k.pullAt=HT,k.range=lL,k.rangeRight=uL,k.rearg=iA,k.reject=WR,k.remove=WT,k.rest=aA,k.reverse=Pg,k.sampleSize=qR,k.set=cI,k.setWith=fI,k.shuffle=KR,k.slice=VT,k.sortBy=QR,k.sortedUniq=ZT,k.sortedUniqBy=eR,k.split=MI,k.spread=oA,k.tail=tR,k.take=nR,k.takeRight=rR,k.takeRightWhile=iR,k.takeWhile=aR,k.tap=_R,k.throttle=sA,k.thru=nf,k.toArray=LS,k.toPairs=$S,k.toPairsIn=zS,k.toPath=pL,k.toPlainObject=DS,k.transform=dI,k.unary=lA,k.union=oR,k.unionBy=sR,k.unionWith=lR,k.uniq=uR,k.uniqBy=cR,k.uniqWith=fR,k.unset=hI,k.unzip=Og,k.unzipWith=yS,k.update=pI,k.updateWith=gI,k.values=Xo,k.valuesIn=mI,k.without=dR,k.words=jS,k.wrap=uA,k.xor=hR,k.xorBy=pR,k.xorWith=gR,k.zip=mR,k.zipObject=vR,k.zipObjectDeep=yR,k.zipWith=SR,k.entries=$S,k.entriesIn=zS,k.extend=NS,k.extendWith=cf,Fg(k,k),k.add=mL,k.attempt=HS,k.camelCase=_I,k.capitalize=GS,k.ceil=vL,k.clamp=vI,k.clone=fA,k.cloneDeep=hA,k.cloneDeepWith=pA,k.cloneWith=dA,k.conformsTo=gA,k.deburr=US,k.defaultTo=YI,k.divide=yL,k.endsWith=wI,k.eq=Or,k.escape=bI,k.escapeRegExp=CI,k.every=RR,k.find=IR,k.findIndex=hS,k.findKey=WA,k.findLast=LR,k.findLastIndex=pS,k.findLastKey=VA,k.floor=SL,k.forEach=_S,k.forEachRight=wS,k.forIn=qA,k.forInRight=KA,k.forOwn=YA,k.forOwnRight=XA,k.get=Lg,k.gt=mA,k.gte=vA,k.has=ZA,k.hasIn=Mg,k.head=mS,k.identity=En,k.includes=FR,k.indexOf=LT,k.inRange=yI,k.invoke=nI,k.isArguments=Ka,k.isArray=ke,k.isArrayBuffer=yA,k.isArrayLike=xn,k.isArrayLikeObject=Ct,k.isBoolean=SA,k.isBuffer=oa,k.isDate=_A,k.isElement=wA,k.isEmpty=bA,k.isEqual=CA,k.isEqualWith=xA,k.isError=Ag,k.isFinite=kA,k.isFunction=Ei,k.isInteger=TS,k.isLength=lf,k.isMap=RS,k.isMatch=EA,k.isMatchWith=PA,k.isNaN=OA,k.isNative=TA,k.isNil=AA,k.isNull=RA,k.isNumber=AS,k.isObject=ht,k.isObjectLike=St,k.isPlainObject=Pl,k.isRegExp=Ig,k.isSafeInteger=IA,k.isSet=IS,k.isString=uf,k.isSymbol=$n,k.isTypedArray=Yo,k.isUndefined=LA,k.isWeakMap=MA,k.isWeakSet=DA,k.join=FT,k.kebabCase=xI,k.last=or,k.lastIndexOf=$T,k.lowerCase=kI,k.lowerFirst=EI,k.lt=NA,k.lte=BA,k.max=_L,k.maxBy=wL,k.mean=bL,k.meanBy=CL,k.min=xL,k.minBy=kL,k.stubArray=zg,k.stubFalse=Gg,k.stubObject=cL,k.stubString=fL,k.stubTrue=dL,k.multiply=EL,k.nth=zT,k.noConflict=nL,k.noop=$g,k.now=af,k.pad=PI,k.padEnd=OI,k.padStart=TI,k.parseInt=RI,k.random=SI,k.reduce=jR,k.reduceRight=HR,k.repeat=AI,k.replace=II,k.result=uI,k.round=PL,k.runInContext=F,k.sample=VR,k.size=YR,k.snakeCase=LI,k.some=XR,k.sortedIndex=qT,k.sortedIndexBy=KT,k.sortedIndexOf=YT,k.sortedLastIndex=XT,k.sortedLastIndexBy=QT,k.sortedLastIndexOf=JT,k.startCase=DI,k.startsWith=NI,k.subtract=OL,k.sum=TL,k.sumBy=RL,k.template=BI,k.times=hL,k.toFinite=Pi,k.toInteger=Pe,k.toLength=MS,k.toLower=FI,k.toNumber=sr,k.toSafeInteger=FA,k.toString=Ve,k.toUpper=$I,k.trim=zI,k.trimEnd=GI,k.trimStart=UI,k.truncate=jI,k.unescape=HI,k.uniqueId=gL,k.upperCase=WI,k.upperFirst=Dg,k.each=_S,k.eachRight=wS,k.first=mS,Fg(k,function(){var o={};return qr(k,function(l,d){Xe.call(k.prototype,d)||(o[d]=l)}),o}(),{chain:!1}),k.VERSION=r,tr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){k[o].placeholder=k}),tr(["drop","take"],function(o,l){Me.prototype[o]=function(d){d=d===n?1:Lt(Pe(d),0);var m=this.__filtered__&&!l?new Me(this):this.clone();return m.__filtered__?m.__takeCount__=rn(d,m.__takeCount__):m.__views__.push({size:rn(d,oe),type:o+(m.__dir__<0?"Right":"")}),m},Me.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),tr(["filter","map","takeWhile"],function(o,l){var d=l+1,m=d==T||d==V;Me.prototype[o]=function(b){var E=this.clone();return E.__iteratees__.push({iteratee:ye(b,3),type:d}),E.__filtered__=E.__filtered__||m,E}}),tr(["head","last"],function(o,l){var d="take"+(l?"Right":"");Me.prototype[o]=function(){return this[d](1).value()[0]}}),tr(["initial","tail"],function(o,l){var d="drop"+(l?"":"Right");Me.prototype[o]=function(){return this.__filtered__?new Me(this):this[d](1)}}),Me.prototype.compact=function(){return this.filter(En)},Me.prototype.find=function(o){return this.filter(o).head()},Me.prototype.findLast=function(o){return this.reverse().find(o)},Me.prototype.invokeMap=Re(function(o,l){return typeof o=="function"?new Me(this):this.map(function(d){return wl(d,o,l)})}),Me.prototype.reject=function(o){return this.filter(sf(ye(o)))},Me.prototype.slice=function(o,l){o=Pe(o);var d=this;return d.__filtered__&&(o>0||l<0)?new Me(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),l!==n&&(l=Pe(l),d=l<0?d.dropRight(-l):d.take(l-o)),d)},Me.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Me.prototype.toArray=function(){return this.take(oe)},qr(Me.prototype,function(o,l){var d=/^(?:filter|find|map|reject)|While$/.test(l),m=/^(?:head|last)$/.test(l),b=k[m?"take"+(l=="last"?"Right":""):l],E=m||/^find/.test(l);b&&(k.prototype[l]=function(){var R=this.__wrapped__,M=m?[1]:arguments,z=R instanceof Me,Z=M[0],ee=z||ke(R),ne=function(Le){var Ne=b.apply(k,Zi([Le],M));return m&&ue?Ne[0]:Ne};ee&&d&&typeof Z=="function"&&Z.length!=1&&(z=ee=!1);var ue=this.__chain__,ge=!!this.__actions__.length,Se=E&&!ue,Oe=z&&!ge;if(!E&&ee){R=Oe?R:new Me(this);var _e=o.apply(R,M);return _e.__actions__.push({func:nf,args:[ne],thisArg:n}),new rr(_e,ue)}return Se&&Oe?o.apply(this,M):(_e=this.thru(ne),Se?m?_e.value()[0]:_e.value():_e)})}),tr(["pop","push","shift","sort","splice","unshift"],function(o){var l=Oc[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",m=/^(?:pop|shift)$/.test(o);k.prototype[o]=function(){var b=arguments;if(m&&!this.__chain__){var E=this.value();return l.apply(ke(E)?E:[],b)}return this[d](function(R){return l.apply(ke(R)?R:[],b)})}}),qr(Me.prototype,function(o,l){var d=k[l];if(d){var m=d.name+"";Xe.call(Ho,m)||(Ho[m]=[]),Ho[m].push({name:l,func:d})}}),Ho[Yc(n,_).name]=[{name:"wrapper",func:n}],Me.prototype.clone=HP,Me.prototype.reverse=WP,Me.prototype.value=VP,k.prototype.at=wR,k.prototype.chain=bR,k.prototype.commit=CR,k.prototype.next=xR,k.prototype.plant=ER,k.prototype.reverse=PR,k.prototype.toJSON=k.prototype.valueOf=k.prototype.value=OR,k.prototype.first=k.prototype.head,pl&&(k.prototype[pl]=kR),k},Go=CP();ze?((ze.exports=Go)._=Go,Te._=Go):Ee._=Go}).call(yn)})(p5,_t);const Jo=(t,e,n,r,i,a,s)=>{const u=t/2-(n+i/2)*s,c=e/2-(r+a/2)*s;return{x:u,y:c}},Zo=(t,e,n,r,i=.95)=>{const a=t*i/n,s=e*i/r;return Math.min(1,Math.min(a,s))},RG=.999,AG=.1,IG=20,Nl=.95,LG=30,MG=10,Ew=t=>({x:Math.floor(t.x),y:Math.floor(t.y)}),Ya=t=>{const{width:e,height:n}=t,r={width:e,height:n},i=512*512,a=e/n;let s=e*n,u=448;for(;s<i;)if(u+=64,e===n){r.width=512,r.height=512;break}else a>1?(r.width=u,r.height=va(u/a,64)):a<1&&(r.height=u,r.width=va(u*a,64)),s=r.width*r.height;return r},g5=t=>({width:va(t.width,64),height:va(t.height,64)}),DG=[{key:"Base",value:"base"},{key:"Mask",value:"mask"}],NG=[{key:"Auto",value:"auto"},{key:"Manual",value:"manual"},{key:"None",value:"none"}],Jx=t=>t.kind==="line"&&t.layer==="mask",BG=t=>t.kind==="line"&&t.layer==="base",Pw=t=>t.kind==="image"&&t.layer==="base",FG=t=>t.kind==="fillRect"&&t.layer==="base",$G=t=>t.kind==="eraseRect"&&t.layer==="base",m5=t=>t.kind==="line",Zl={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},v5={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"auto",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,canvasContainerDimensions:{width:0,height:0},colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,doesCanvasNeedScaling:!1,futureLayerStates:[],isCanvasInitialized:!1,isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:Zl,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAutoSave:!1,shouldCropToBoundingBoxOnSave:!1,shouldDarkenOutsideBoundingBox:!1,shouldLockBoundingBox:!1,shouldPreserveMaskedArea:!1,shouldRestrictStrokesToBox:!0,shouldShowBoundingBox:!0,shouldShowBrush:!0,shouldShowBrushPreview:!1,shouldShowCanvasDebugInfo:!1,shouldShowCheckboardTransparency:!1,shouldShowGrid:!0,shouldShowIntermediates:!0,shouldShowStagingImage:!0,shouldShowStagingOutline:!0,shouldSnapToGrid:!0,stageCoordinates:{x:0,y:0},stageDimensions:{width:0,height:0},stageScale:1,tool:"brush"},Zx=vo({name:"canvas",initialState:v5,reducers:{setTool:(t,e)=>{const n=e.payload;t.tool=e.payload,n!=="move"&&(t.isTransformingBoundingBox=!1,t.isMouseOverBoundingBox=!1,t.isMovingBoundingBox=!1,t.isMovingStage=!1)},setLayer:(t,e)=>{t.layer=e.payload},toggleTool:t=>{const e=t.tool;e!=="move"&&(t.tool=e==="brush"?"eraser":"brush")},setMaskColor:(t,e)=>{t.maskColor=e.payload},setBrushColor:(t,e)=>{t.brushColor=e.payload},setBrushSize:(t,e)=>{t.brushSize=e.payload},clearMask:t=>{t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.layerState.objects=t.layerState.objects.filter(e=>!Jx(e)),t.futureLayerStates=[],t.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:t=>{t.shouldPreserveMaskedArea=!t.shouldPreserveMaskedArea},toggleShouldShowMask:t=>{t.isMaskEnabled=!t.isMaskEnabled},setShouldPreserveMaskedArea:(t,e)=>{t.shouldPreserveMaskedArea=e.payload},setIsMaskEnabled:(t,e)=>{t.isMaskEnabled=e.payload,t.layer=e.payload?"mask":"base"},setShouldShowCheckboardTransparency:(t,e)=>{t.shouldShowCheckboardTransparency=e.payload},setShouldShowBrushPreview:(t,e)=>{t.shouldShowBrushPreview=e.payload},setShouldShowBrush:(t,e)=>{t.shouldShowBrush=e.payload},setCursorPosition:(t,e)=>{t.cursorPosition=e.payload},setInitialCanvasImage:(t,e)=>{const n=e.payload,{stageDimensions:r}=t,i={width:Of(_t.clamp(n.width,64,512),64),height:Of(_t.clamp(n.height,64,512),64)},a={x:va(n.width/2-i.width/2,64),y:va(n.height/2-i.height/2,64)};if(t.boundingBoxScaleMethod==="auto"){const c=Ya(i);t.scaledBoundingBoxDimensions=c}t.boundingBoxDimensions=i,t.boundingBoxCoordinates=a,t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.layerState={...Zl,objects:[{kind:"image",layer:"base",x:0,y:0,width:n.width,height:n.height,image:n}]},t.futureLayerStates=[],t.isCanvasInitialized=!1;const s=Zo(r.width,r.height,n.width,n.height,Nl),u=Jo(r.width,r.height,0,0,n.width,n.height,s);t.stageScale=s,t.stageCoordinates=u,t.doesCanvasNeedScaling=!0},setBoundingBoxDimensions:(t,e)=>{const n=g5(e.payload);if(t.boundingBoxDimensions=n,t.boundingBoxScaleMethod==="auto"){const r=Ya(n);t.scaledBoundingBoxDimensions=r}},setBoundingBoxCoordinates:(t,e)=>{t.boundingBoxCoordinates=Ew(e.payload)},setStageCoordinates:(t,e)=>{t.stageCoordinates=e.payload},setBoundingBoxPreviewFill:(t,e)=>{t.boundingBoxPreviewFill=e.payload},setDoesCanvasNeedScaling:(t,e)=>{t.doesCanvasNeedScaling=e.payload},setStageScale:(t,e)=>{t.stageScale=e.payload},setShouldDarkenOutsideBoundingBox:(t,e)=>{t.shouldDarkenOutsideBoundingBox=e.payload},setIsDrawing:(t,e)=>{t.isDrawing=e.payload},clearCanvasHistory:t=>{t.pastLayerStates=[],t.futureLayerStates=[]},setShouldLockBoundingBox:(t,e)=>{t.shouldLockBoundingBox=e.payload},toggleShouldLockBoundingBox:t=>{t.shouldLockBoundingBox=!t.shouldLockBoundingBox},setShouldShowBoundingBox:(t,e)=>{t.shouldShowBoundingBox=e.payload},setIsTransformingBoundingBox:(t,e)=>{t.isTransformingBoundingBox=e.payload},setIsMovingBoundingBox:(t,e)=>{t.isMovingBoundingBox=e.payload},setIsMouseOverBoundingBox:(t,e)=>{t.isMouseOverBoundingBox=e.payload},setIsMoveBoundingBoxKeyHeld:(t,e)=>{t.isMoveBoundingBoxKeyHeld=e.payload},setIsMoveStageKeyHeld:(t,e)=>{t.isMoveStageKeyHeld=e.payload},addImageToStagingArea:(t,e)=>{const{boundingBox:n,image:r}=e.payload;!n||!r||(t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.pastLayerStates.length>t.maxHistory&&t.pastLayerStates.shift(),t.layerState.stagingArea.images.push({kind:"image",layer:"base",...n,image:r}),t.layerState.stagingArea.selectedImageIndex=t.layerState.stagingArea.images.length-1,t.futureLayerStates=[])},discardStagedImages:t=>{t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.pastLayerStates.length>t.maxHistory&&t.pastLayerStates.shift(),t.layerState.stagingArea={...Zl.stagingArea},t.futureLayerStates=[],t.shouldShowStagingOutline=!0,t.shouldShowStagingOutline=!0},addFillRect:t=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:n,brushColor:r}=t;t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.pastLayerStates.length>t.maxHistory&&t.pastLayerStates.shift(),t.layerState.objects.push({kind:"fillRect",layer:"base",...e,...n,color:r}),t.futureLayerStates=[]},addEraseRect:t=>{const{boundingBoxCoordinates:e,boundingBoxDimensions:n}=t;t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.pastLayerStates.length>t.maxHistory&&t.pastLayerStates.shift(),t.layerState.objects.push({kind:"eraseRect",layer:"base",...e,...n}),t.futureLayerStates=[]},addLine:(t,e)=>{const{tool:n,layer:r,brushColor:i,brushSize:a,shouldRestrictStrokesToBox:s}=t;if(n==="move"||n==="colorPicker")return;const u=a/2,c=r==="base"&&n==="brush"?{color:i}:{};t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.pastLayerStates.length>t.maxHistory&&t.pastLayerStates.shift();const f={kind:"line",layer:r,tool:n,strokeWidth:u,points:e.payload,...c};s&&(f.clip={...t.boundingBoxCoordinates,...t.boundingBoxDimensions}),t.layerState.objects.push(f),t.futureLayerStates=[]},addPointToCurrentLine:(t,e)=>{const n=t.layerState.objects.findLast(m5);n&&n.points.push(...e.payload)},undo:t=>{const e=t.pastLayerStates.pop();e&&(t.futureLayerStates.unshift(_t.cloneDeep(t.layerState)),t.futureLayerStates.length>t.maxHistory&&t.futureLayerStates.pop(),t.layerState=e)},redo:t=>{const e=t.futureLayerStates.shift();e&&(t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.pastLayerStates.length>t.maxHistory&&t.pastLayerStates.shift(),t.layerState=e)},setShouldShowGrid:(t,e)=>{t.shouldShowGrid=e.payload},setIsMovingStage:(t,e)=>{t.isMovingStage=e.payload},setShouldSnapToGrid:(t,e)=>{t.shouldSnapToGrid=e.payload},setShouldAutoSave:(t,e)=>{t.shouldAutoSave=e.payload},setShouldShowIntermediates:(t,e)=>{t.shouldShowIntermediates=e.payload},resetCanvas:t=>{t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.layerState=Zl,t.futureLayerStates=[]},setCanvasContainerDimensions:(t,e)=>{t.canvasContainerDimensions=e.payload},resizeAndScaleCanvas:t=>{const{width:e,height:n}=t.canvasContainerDimensions,r=t.layerState.objects.find(Pw),i={width:Math.floor(e),height:Math.floor(n)};if(!r){const h=Zo(i.width,i.height,512,512,Nl),p=Jo(i.width,i.height,0,0,512,512,h),g={width:512,height:512};if(t.stageScale=h,t.stageCoordinates=p,t.stageDimensions=i,t.boundingBoxCoordinates={x:0,y:0},t.boundingBoxDimensions=g,t.boundingBoxScaleMethod==="auto"){const y=Ya(g);t.scaledBoundingBoxDimensions=y}return}const{width:a,height:s}=r,c=Zo(e,n,a,s,.95),f=Jo(i.width,i.height,0,0,a,s,c);t.minimumStageScale=c,t.stageScale=c,t.stageCoordinates=Ew(f),t.stageDimensions=i,t.isCanvasInitialized=!0},resizeCanvas:t=>{const{width:e,height:n}=t.canvasContainerDimensions,r={width:Math.floor(e),height:Math.floor(n)};if(t.stageDimensions=r,!t.layerState.objects.find(Pw)){const i=Zo(r.width,r.height,512,512,Nl),a=Jo(r.width,r.height,0,0,512,512,i),s={width:512,height:512};if(t.stageScale=i,t.stageCoordinates=a,t.boundingBoxCoordinates={x:0,y:0},t.boundingBoxDimensions=s,t.boundingBoxScaleMethod==="auto"){const u=Ya(s);t.scaledBoundingBoxDimensions=u}}},resetCanvasView:(t,e)=>{const{contentRect:n,shouldScaleTo1:r}=e.payload,{stageDimensions:{width:i,height:a}}=t,{x:s,y:u,width:c,height:f}=n;if(c!==0&&f!==0){const h=r?1:Zo(i,a,c,f,Nl),p=Jo(i,a,s,u,c,f,h);t.stageScale=h,t.stageCoordinates=p}else{const h=Zo(i,a,512,512,Nl),p=Jo(i,a,0,0,512,512,h),g={width:512,height:512};if(t.stageScale=h,t.stageCoordinates=p,t.boundingBoxCoordinates={x:0,y:0},t.boundingBoxDimensions=g,t.boundingBoxScaleMethod==="auto"){const y=Ya(g);t.scaledBoundingBoxDimensions=y}}},nextStagingAreaImage:t=>{const e=t.layerState.stagingArea.selectedImageIndex,n=t.layerState.stagingArea.images.length;t.layerState.stagingArea.selectedImageIndex=Math.min(e+1,n-1)},prevStagingAreaImage:t=>{const e=t.layerState.stagingArea.selectedImageIndex;t.layerState.stagingArea.selectedImageIndex=Math.max(e-1,0)},commitStagingAreaImage:t=>{const{images:e,selectedImageIndex:n}=t.layerState.stagingArea;t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.pastLayerStates.length>t.maxHistory&&t.pastLayerStates.shift(),t.layerState.objects.push({...e[n]}),t.layerState.stagingArea={...Zl.stagingArea},t.futureLayerStates=[],t.shouldShowStagingOutline=!0,t.shouldShowStagingImage=!0},fitBoundingBoxToStage:t=>{const{boundingBoxDimensions:e,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=t,a=r.width/i,s=r.height/i;if(n.x<0||n.x+e.width>a||n.y<0||n.y+e.height>s){const u={width:Of(_t.clamp(a,64,512),64),height:Of(_t.clamp(s,64,512),64)},c={x:va(a/2-u.width/2,64),y:va(s/2-u.height/2,64)};if(t.boundingBoxDimensions=u,t.boundingBoxCoordinates=c,t.boundingBoxScaleMethod==="auto"){const f=Ya(u);t.scaledBoundingBoxDimensions=f}}},setBoundingBoxScaleMethod:(t,e)=>{if(t.boundingBoxScaleMethod=e.payload,e.payload==="auto"){const n=Ya(t.boundingBoxDimensions);t.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(t,e)=>{t.scaledBoundingBoxDimensions=e.payload},setShouldShowStagingImage:(t,e)=>{t.shouldShowStagingImage=e.payload},setShouldShowStagingOutline:(t,e)=>{t.shouldShowStagingOutline=e.payload},setShouldShowCanvasDebugInfo:(t,e)=>{t.shouldShowCanvasDebugInfo=e.payload},setShouldRestrictStrokesToBox:(t,e)=>{t.shouldRestrictStrokesToBox=e.payload},setShouldCropToBoundingBoxOnSave:(t,e)=>{t.shouldCropToBoundingBoxOnSave=e.payload},setColorPickerColor:(t,e)=>{t.colorPickerColor=e.payload},commitColorPickerColor:t=>{t.brushColor={...t.colorPickerColor,a:t.brushColor.a},t.tool="brush"},setMergedCanvas:(t,e)=>{t.pastLayerStates.push(_t.cloneDeep(t.layerState)),t.futureLayerStates=[],t.layerState.objects=[e.payload]},resetCanvasInteractionState:t=>{t.cursorPosition=null,t.isDrawing=!1,t.isMouseOverBoundingBox=!1,t.isMoveBoundingBoxKeyHeld=!1,t.isMoveStageKeyHeld=!1,t.isMovingBoundingBox=!1,t.isMovingStage=!1,t.isTransformingBoundingBox=!1},mouseLeftCanvas:t=>{t.cursorPosition=null,t.isDrawing=!1,t.isMouseOverBoundingBox=!1,t.isMovingBoundingBox=!1,t.isTransformingBoundingBox=!1}}}),{addEraseRect:zG,addFillRect:GG,addImageToStagingArea:y5,addLine:UG,addPointToCurrentLine:jG,clearCanvasHistory:HG,clearMask:WG,commitColorPickerColor:VG,commitStagingAreaImage:qG,discardStagedImages:KG,fitBoundingBoxToStage:YG,mouseLeftCanvas:XG,nextStagingAreaImage:QG,prevStagingAreaImage:JG,redo:ZG,resetCanvas:eU,resetCanvasInteractionState:tU,resetCanvasView:nU,resizeAndScaleCanvas:rU,resizeCanvas:iU,setBoundingBoxCoordinates:aU,setBoundingBoxDimensions:oU,setBoundingBoxPreviewFill:sU,setBoundingBoxScaleMethod:lU,setBrushColor:uU,setBrushSize:cU,setCanvasContainerDimensions:fU,setColorPickerColor:dU,setCursorPosition:hU,setDoesCanvasNeedScaling:pU,setInitialCanvasImage:gU,setIsDrawing:mU,setIsMaskEnabled:vU,setIsMouseOverBoundingBox:yU,setIsMoveBoundingBoxKeyHeld:SU,setIsMoveStageKeyHeld:_U,setIsMovingBoundingBox:wU,setIsMovingStage:bU,setIsTransformingBoundingBox:CU,setLayer:xU,setMaskColor:kU,setMergedCanvas:EU,setShouldAutoSave:PU,setShouldCropToBoundingBoxOnSave:OU,setShouldDarkenOutsideBoundingBox:TU,setShouldLockBoundingBox:RU,setShouldPreserveMaskedArea:AU,setShouldShowBoundingBox:IU,setShouldShowBrush:LU,setShouldShowBrushPreview:MU,setShouldShowCanvasDebugInfo:DU,setShouldShowCheckboardTransparency:NU,setShouldShowGrid:BU,setShouldShowIntermediates:FU,setShouldShowStagingImage:$U,setShouldShowStagingOutline:zU,setShouldSnapToGrid:GU,setStageCoordinates:UU,setStageScale:jU,setTool:HU,toggleShouldLockBoundingBox:WU,toggleTool:VU,undo:qU,setScaledBoundingBoxDimensions:KU,setShouldRestrictStrokesToBox:YU}=Zx.actions,S5=Zx.reducer,_5={currentImageUuid:"",shouldPinGallery:!0,shouldShowGallery:!0,galleryImageMinimumWidth:64,galleryImageObjectFit:"cover",shouldHoldGalleryOpen:!1,shouldAutoSwitchToNewImages:!0,currentCategory:"result",categories:{user:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0},result:{images:[],latest_mtime:void 0,earliest_mtime:void 0,areMoreImagesAvailable:!0}},galleryWidth:300,shouldUseSingleGalleryColumn:!1},ek=vo({name:"gallery",initialState:_5,reducers:{setCurrentImage:(t,e)=>{t.currentImage=e.payload,t.currentImageUuid=e.payload.uuid},removeImage:(t,e)=>{const{uuid:n,category:r}=e.payload,i=t.categories[r].images,a=i.filter(s=>s.uuid!==n);if(n===t.currentImageUuid){const s=i.findIndex(c=>c.uuid===n),u=_t.clamp(s,0,a.length-1);t.currentImage=a.length?a[u]:void 0,t.currentImageUuid=a.length?a[u].uuid:""}t.categories[r].images=a},addImage:(t,e)=>{const{image:n,category:r}=e.payload,{uuid:i,url:a,mtime:s}=n,u=t.categories[r];u.images.find(c=>c.url===a&&c.mtime===s)||(u.images.unshift(n),t.shouldAutoSwitchToNewImages&&(t.currentImageUuid=i,t.currentImage=n,t.currentCategory=r),t.intermediateImage=void 0,u.latest_mtime=s)},setIntermediateImage:(t,e)=>{t.intermediateImage=e.payload},clearIntermediateImage:t=>{t.intermediateImage=void 0},selectNextImage:t=>{const{currentImage:e}=t;if(!e)return;const n=t.categories[e.category].images;if(e){const r=n.findIndex(i=>i.uuid===e.uuid);if(r<n.length-1){const i=n[r+1];t.currentImage=i,t.currentImageUuid=i.uuid}}},selectPrevImage:t=>{const{currentImage:e}=t;if(!e)return;const n=t.categories[e.category].images;if(e){const r=n.findIndex(i=>i.uuid===e.uuid);if(r>0){const i=n[r-1];t.currentImage=i,t.currentImageUuid=i.uuid}}},addGalleryImages:(t,e)=>{const{images:n,areMoreImagesAvailable:r,category:i}=e.payload,a=t.categories[i].images;if(n.length>0){const s=n.filter(u=>!a.find(c=>c.url===u.url&&c.mtime===u.mtime));if(t.categories[i].images=a.concat(s).sort((u,c)=>c.mtime-u.mtime),!t.currentImage){const u=n[0];t.currentImage=u,t.currentImageUuid=u.uuid}t.categories[i].latest_mtime=n[0].mtime,t.categories[i].earliest_mtime=n[n.length-1].mtime}r!==void 0&&(t.categories[i].areMoreImagesAvailable=r)},setShouldPinGallery:(t,e)=>{t.shouldPinGallery=e.payload},setShouldShowGallery:(t,e)=>{t.shouldShowGallery=e.payload},setGalleryImageMinimumWidth:(t,e)=>{t.galleryImageMinimumWidth=e.payload},setGalleryImageObjectFit:(t,e)=>{t.galleryImageObjectFit=e.payload},setShouldHoldGalleryOpen:(t,e)=>{t.shouldHoldGalleryOpen=e.payload},setShouldAutoSwitchToNewImages:(t,e)=>{t.shouldAutoSwitchToNewImages=e.payload},setCurrentCategory:(t,e)=>{t.currentCategory=e.payload},setGalleryWidth:(t,e)=>{t.galleryWidth=e.payload},setShouldUseSingleGalleryColumn:(t,e)=>{t.shouldUseSingleGalleryColumn=e.payload}}}),{addImage:Tf,clearIntermediateImage:Cm,removeImage:tk,setCurrentImage:XU,addGalleryImages:w5,setIntermediateImage:b5,selectNextImage:QU,selectPrevImage:JU,setShouldPinGallery:ZU,setShouldShowGallery:ej,setGalleryImageMinimumWidth:tj,setGalleryImageObjectFit:nj,setShouldHoldGalleryOpen:rj,setShouldAutoSwitchToNewImages:ij,setCurrentCategory:aj,setGalleryWidth:oj,setShouldUseSingleGalleryColumn:sj}=ek.actions,C5=ek.reducer,x5={isLightboxOpen:!1},k5=x5,nk=vo({name:"lightbox",initialState:k5,reducers:{setIsLightboxOpen:(t,e)=>{t.isLightboxOpen=e.payload}}}),{setIsLightboxOpen:lj}=nk.actions,E5=nk.reducer,hd=t=>typeof t=="string"?t:t.length===1?t[0].prompt:t.map(e=>`${e.prompt}:${e.weight}`).join(" ");function P5(t){let e=typeof t=="string"?t:hd(t),n="";const r=new RegExp(/\[([^\][]*)]/,"gi"),i=[...e.matchAll(r)].map(a=>a[1]);return i.length&&(n=i.join(" "),i.forEach(a=>{e=e.replace(`[${a}]`,"").replaceAll("[]","").trim()})),[e,n]}const O5=t=>{const r=t.split(",").map(i=>i.split(":")).map(i=>({seed:Number(i[0]),weight:Number(i[1])}));return T5(r)?r:!1},T5=t=>Boolean(typeof t=="string"?O5(t):t.length&&!t.some(e=>{const{seed:n,weight:r}=e,i=!isNaN(parseInt(n.toString(),10)),a=!isNaN(parseInt(r.toString(),10))&&r>=0&&r<=1;return!(i&&a)})),Ow=t=>t.reduce((e,n,r,i)=>{const{seed:a,weight:s}=n;return e+=`${a}:${s}`,r!==i.length-1&&(e+=","),e},""),R5=t=>t.split(",").map(r=>r.split(":")).map(r=>[parseInt(r[0],10),parseFloat(r[1])]),rk={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,maskPath:"",perlin:0,prompt:"",negativePrompt:"",sampler:"k_lms",seamBlur:16,seamless:!1,seamSize:96,seamSteps:30,seamStrength:.7,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,tileSize:32,variationAmount:.1,width:512,shouldUseSymmetry:!1,horizontalSymmetrySteps:0,verticalSymmetrySteps:0},A5=rk,ik=vo({name:"generation",initialState:A5,reducers:{setPrompt:(t,e)=>{const n=e.payload;typeof n=="string"?t.prompt=n:t.prompt=hd(n)},setNegativePrompt:(t,e)=>{const n=e.payload;typeof n=="string"?t.negativePrompt=n:t.negativePrompt=hd(n)},setIterations:(t,e)=>{t.iterations=e.payload},setSteps:(t,e)=>{t.steps=e.payload},clampSymmetrySteps:t=>{t.horizontalSymmetrySteps=_t.clamp(t.horizontalSymmetrySteps,0,t.steps),t.verticalSymmetrySteps=_t.clamp(t.verticalSymmetrySteps,0,t.steps)},setCfgScale:(t,e)=>{t.cfgScale=e.payload},setThreshold:(t,e)=>{t.threshold=e.payload},setPerlin:(t,e)=>{t.perlin=e.payload},setHeight:(t,e)=>{t.height=e.payload},setWidth:(t,e)=>{t.width=e.payload},setSampler:(t,e)=>{t.sampler=e.payload},setSeed:(t,e)=>{t.seed=e.payload,t.shouldRandomizeSeed=!1},setImg2imgStrength:(t,e)=>{t.img2imgStrength=e.payload},setMaskPath:(t,e)=>{t.maskPath=e.payload},setSeamless:(t,e)=>{t.seamless=e.payload},setShouldFitToWidthHeight:(t,e)=>{t.shouldFitToWidthHeight=e.payload},resetSeed:t=>{t.seed=-1},setParameter:(t,e)=>{const{key:n,value:r}=e.payload,i={...t,[n]:r};return n==="seed"&&(i.shouldRandomizeSeed=!1),i},setShouldGenerateVariations:(t,e)=>{t.shouldGenerateVariations=e.payload},setVariationAmount:(t,e)=>{t.variationAmount=e.payload},setSeedWeights:(t,e)=>{t.seedWeights=e.payload,t.shouldGenerateVariations=!0,t.variationAmount=0},setAllTextToImageParameters:(t,e)=>{const{sampler:n,prompt:r,seed:i,variations:a,steps:s,cfg_scale:u,threshold:c,perlin:f,seamless:h,_hires_fix:p,width:g,height:y}=e.payload.image;a&&a.length>0?(t.seedWeights=Ow(a),t.shouldGenerateVariations=!0,t.variationAmount=0):t.shouldGenerateVariations=!1,i&&(t.seed=i,t.shouldRandomizeSeed=!1),r&&(t.prompt=hd(r)),n&&(t.sampler=n),s&&(t.steps=s),u&&(t.cfgScale=u),typeof c>"u"?t.threshold=0:t.threshold=c,typeof f>"u"?t.perlin=0:t.perlin=f,typeof h=="boolean"&&(t.seamless=h),g&&(t.width=g),y&&(t.height=y)},setAllImageToImageParameters:(t,e)=>{const{type:n,strength:r,fit:i,init_image_path:a,mask_image_path:s}=e.payload.image;n==="img2img"&&(a&&(t.initialImage=a),s&&(t.maskPath=s),r&&(t.img2imgStrength=r),typeof i=="boolean"&&(t.shouldFitToWidthHeight=i))},setAllParameters:(t,e)=>{const{type:n,sampler:r,prompt:i,seed:a,variations:s,steps:u,cfg_scale:c,threshold:f,perlin:h,seamless:p,_hires_fix:g,width:y,height:v,strength:w,fit:x,init_image_path:_,mask_image_path:S}=e.payload.image;if(n==="img2img"&&(_&&(t.initialImage=_),S&&(t.maskPath=S),w&&(t.img2imgStrength=w),typeof x=="boolean"&&(t.shouldFitToWidthHeight=x)),s&&s.length>0?(t.seedWeights=Ow(s),t.shouldGenerateVariations=!0,t.variationAmount=0):t.shouldGenerateVariations=!1,a&&(t.seed=a,t.shouldRandomizeSeed=!1),i){const[C,O]=P5(i);C&&(t.prompt=C),O?t.negativePrompt=O:t.negativePrompt=""}r&&(t.sampler=r),u&&(t.steps=u),c&&(t.cfgScale=c),typeof f>"u"?t.threshold=0:t.threshold=f,typeof h>"u"?t.perlin=0:t.perlin=h,typeof p=="boolean"&&(t.seamless=p),y&&(t.width=y),v&&(t.height=v)},resetParametersState:t=>({...t,...rk}),setShouldRandomizeSeed:(t,e)=>{t.shouldRandomizeSeed=e.payload},setInitialImage:(t,e)=>{t.initialImage=e.payload},clearInitialImage:t=>{t.initialImage=void 0},setSeamSize:(t,e)=>{t.seamSize=e.payload},setSeamBlur:(t,e)=>{t.seamBlur=e.payload},setSeamStrength:(t,e)=>{t.seamStrength=e.payload},setSeamSteps:(t,e)=>{t.seamSteps=e.payload},setTileSize:(t,e)=>{t.tileSize=e.payload},setInfillMethod:(t,e)=>{t.infillMethod=e.payload},setShouldUseSymmetry:(t,e)=>{t.shouldUseSymmetry=e.payload},setHorizontalSymmetrySteps:(t,e)=>{t.horizontalSymmetrySteps=e.payload},setVerticalSymmetrySteps:(t,e)=>{t.verticalSymmetrySteps=e.payload}}}),{clampSymmetrySteps:uj,clearInitialImage:I5,resetParametersState:cj,resetSeed:fj,setAllImageToImageParameters:dj,setAllParameters:hj,setAllTextToImageParameters:pj,setCfgScale:gj,setHeight:mj,setImg2imgStrength:vj,setInfillMethod:L5,setInitialImage:M5,setIterations:yj,setMaskPath:D5,setParameter:Sj,setPerlin:_j,setPrompt:wj,setNegativePrompt:bj,setSampler:Cj,setSeamBlur:xj,setSeamless:kj,setSeamSize:Ej,setSeamSteps:Pj,setSeamStrength:Oj,setSeed:Tj,setSeedWeights:Rj,setShouldFitToWidthHeight:Aj,setShouldGenerateVariations:Ij,setShouldRandomizeSeed:Lj,setSteps:Mj,setThreshold:Dj,setTileSize:Nj,setVariationAmount:Bj,setWidth:Fj,setShouldUseSymmetry:$j,setHorizontalSymmetrySteps:zj,setVerticalSymmetrySteps:Gj}=ik.actions,N5=ik.reducer,ak={codeformerFidelity:.75,facetoolStrength:.75,facetoolType:"gfpgan",hiresFix:!1,hiresStrength:.75,shouldLoopback:!1,shouldRunESRGAN:!1,shouldRunFacetool:!1,upscalingLevel:4,upscalingDenoising:.75,upscalingStrength:.75},B5=ak,ok=vo({name:"postprocessing",initialState:B5,reducers:{setFacetoolStrength:(t,e)=>{t.facetoolStrength=e.payload},setCodeformerFidelity:(t,e)=>{t.codeformerFidelity=e.payload},setUpscalingLevel:(t,e)=>{t.upscalingLevel=e.payload},setUpscalingDenoising:(t,e)=>{t.upscalingDenoising=e.payload},setUpscalingStrength:(t,e)=>{t.upscalingStrength=e.payload},setHiresFix:(t,e)=>{t.hiresFix=e.payload},setHiresStrength:(t,e)=>{t.hiresStrength=e.payload},resetPostprocessingState:t=>({...t,...ak}),setShouldRunFacetool:(t,e)=>{t.shouldRunFacetool=e.payload},setFacetoolType:(t,e)=>{t.facetoolType=e.payload},setShouldRunESRGAN:(t,e)=>{t.shouldRunESRGAN=e.payload},setShouldLoopback:(t,e)=>{t.shouldLoopback=e.payload}}}),{resetPostprocessingState:Uj,setCodeformerFidelity:jj,setFacetoolStrength:Hj,setFacetoolType:Wj,setHiresFix:Vj,setHiresStrength:qj,setShouldLoopback:Kj,setShouldRunESRGAN:Yj,setShouldRunFacetool:Xj,setUpscalingLevel:Qj,setUpscalingDenoising:Jj,setUpscalingStrength:Zj}=ok.actions,F5=ok.reducer;function Sr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fx(r.key),r)}}function _r(t,e,n){return e&&Tw(t.prototype,e),n&&Tw(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Pa(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jv(t,e){return jv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},jv(t,e)}function Xh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jv(t,e)}function Zu(t,e){if(e&&(gr(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pa(t)}function fi(t){return fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fi(t)}function sk(t){if(Array.isArray(t))return t}function $5(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Rw(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function lk(t,e){if(t){if(typeof t=="string")return Rw(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rw(t,e)}}function uk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z5(t){return sk(t)||$5(t)||lk(t)||uk()}function Aw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Iw(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Aw(Object(n),!0).forEach(function(r){Ur(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Aw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var G5={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,n){console&&console[e]&&console[e].apply(console,n)}},U5=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Sr(this,t),this.init(e,n)}return _r(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||G5,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,i,a){return a&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(i).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new t(this.logger,Iw(Iw({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new t(this.logger,n)}}]),t}(),ii=new U5,Aa=function(){function t(){Sr(this,t),this.observers={}}return _r(t,[{key:"on",value:function(n,r){var i=this;return n.split(" ").forEach(function(a){i.observers[a]=i.observers[a]||[],i.observers[a].push(r)}),this}},{key:"off",value:function(n,r){if(this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(i){return i!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(c){c.apply(void 0,i)})}if(this.observers["*"]){var u=[].concat(this.observers["*"]);u.forEach(function(c){c.apply(c,[n].concat(i))})}}}]),t}();function Bl(){var t,e,n=new Promise(function(r,i){t=r,e=i});return n.resolve=t,n.reject=e,n}function Lw(t){return t==null?"":""+t}function j5(t,e,n){t.forEach(function(r){e[r]&&(n[r]=e[r])})}function O0(t,e,n){function r(u){return u&&u.indexOf("###")>-1?u.replace(/###/g,"."):u}function i(){return!t||typeof t=="string"}for(var a=typeof e!="string"?[].concat(e):e.split(".");a.length>1;){if(i())return{};var s=r(a.shift());!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={}}return i()?{}:{obj:t,k:r(a.shift())}}function Mw(t,e,n){var r=O0(t,e,Object),i=r.obj,a=r.k;i[a]=n}function H5(t,e,n,r){var i=O0(t,e,Object),a=i.obj,s=i.k;a[s]=a[s]||[],r&&(a[s]=a[s].concat(n)),r||a[s].push(n)}function rh(t,e){var n=O0(t,e),r=n.obj,i=n.k;if(r)return r[i]}function Dw(t,e,n){var r=rh(t,n);return r!==void 0?r:rh(e,n)}function ck(t,e,n){for(var r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?typeof t[r]=="string"||t[r]instanceof String||typeof e[r]=="string"||e[r]instanceof String?n&&(t[r]=e[r]):ck(t[r],e[r],n):t[r]=e[r]);return t}function es(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var W5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function V5(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,function(e){return W5[e]}):t}var Qh=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,q5=[" ",",","?","!",";"];function K5(t,e,n){e=e||"",n=n||"";var r=q5.filter(function(u){return e.indexOf(u)<0&&n.indexOf(u)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(u){return u==="?"?"\\?":u}).join("|"),")")),a=!i.test(t);if(!a){var s=t.indexOf(n);s>0&&!i.test(t.substring(0,s))&&(a=!0)}return a}function Nw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Rf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Nw(Object(n),!0).forEach(function(r){Ur(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Y5(t){var e=X5();return function(){var r=fi(t),i;if(e){var a=fi(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return Zu(this,i)}}function X5(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function fk(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(t){if(t[e])return t[e];for(var r=e.split(n),i=t,a=0;a<r.length;++a){if(!i||typeof i[r[a]]=="string"&&a+1<r.length)return;if(i[r[a]]===void 0){for(var s=2,u=r.slice(a,a+s).join(n),c=i[u];c===void 0&&r.length>a+s;)s++,u=r.slice(a,a+s).join(n),c=i[u];if(c===void 0)return;if(c===null)return null;if(e.endsWith(u)){if(typeof c=="string")return c;if(u&&typeof c[u]=="string")return c[u]}var f=r.slice(a+s).join(n);return f?fk(c,f,n):void 0}i=i[r[a]]}return i}}var Q5=function(t){Xh(n,t);var e=Y5(n);function n(r){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Sr(this,n),i=e.call(this),Qh&&Aa.call(Pa(i)),i.data=r||{},i.options=a,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return _r(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var a=this.options.ns.indexOf(i);a>-1&&this.options.ns.splice(a,1)}},{key:"getResource",value:function(i,a,s){var u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},c=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator,f=u.ignoreJSONStructure!==void 0?u.ignoreJSONStructure:this.options.ignoreJSONStructure,h=[i,a];s&&typeof s!="string"&&(h=h.concat(s)),s&&typeof s=="string"&&(h=h.concat(c?s.split(c):s)),i.indexOf(".")>-1&&(h=i.split("."));var p=rh(this.data,h);return p||!f||typeof s!="string"?p:fk(this.data&&this.data[i]&&this.data[i][a],s,c)}},{key:"addResource",value:function(i,a,s,u){var c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},f=this.options.keySeparator;f===void 0&&(f=".");var h=[i,a];s&&(h=h.concat(f?s.split(f):s)),i.indexOf(".")>-1&&(h=i.split("."),u=a,a=h[1]),this.addNamespaces(a),Mw(this.data,h,u),c.silent||this.emit("added",i,a,s,u)}},{key:"addResources",value:function(i,a,s){var u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var c in s)(typeof s[c]=="string"||Object.prototype.toString.apply(s[c])==="[object Array]")&&this.addResource(i,a,c,s[c],{silent:!0});u.silent||this.emit("added",i,a,s)}},{key:"addResourceBundle",value:function(i,a,s,u,c){var f=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},h=[i,a];i.indexOf(".")>-1&&(h=i.split("."),u=s,s=a,a=h[1]),this.addNamespaces(a);var p=rh(this.data,h)||{};u?ck(p,s,c):p=Rf(Rf({},p),s),Mw(this.data,h,p),f.silent||this.emit("added",i,a,s)}},{key:"removeResourceBundle",value:function(i,a){this.hasResourceBundle(i,a)&&delete this.data[i][a],this.removeNamespaces(a),this.emit("removed",i,a)}},{key:"hasResourceBundle",value:function(i,a){return this.getResource(i,a)!==void 0}},{key:"getResourceBundle",value:function(i,a){return a||(a=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Rf(Rf({},{}),this.getResource(i,a)):this.getResource(i,a)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var a=this.getDataByLanguage(i),s=a&&Object.keys(a)||[];return!!s.find(function(u){return a[u]&&Object.keys(a[u]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Aa),dk={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,n,r,i,a){var s=this;return e.forEach(function(u){s.processors[u]&&(n=s.processors[u].process(n,r,i,a))}),n}};function Bw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function mn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Bw(Object(n),!0).forEach(function(r){Ur(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Bw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function J5(t){var e=Z5();return function(){var r=fi(t),i;if(e){var a=fi(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return Zu(this,i)}}function Z5(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Fw={},$w=function(t){Xh(n,t);var e=J5(n);function n(r){var i,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Sr(this,n),i=e.call(this),Qh&&Aa.call(Pa(i)),j5(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Pa(i)),i.options=a,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=ii.create("translator"),i}return _r(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,a);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,a){var s=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var u=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ns||this.options.defaultNS||[],f=s&&i.indexOf(s)>-1,h=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!K5(i,s,u);if(f&&!h){var p=i.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:i,namespaces:c};var g=i.split(s);(s!==u||s===u&&this.options.ns.indexOf(g[0])>-1)&&(c=g.shift()),i=g.join(u)}return typeof c=="string"&&(c=[c]),{key:i,namespaces:c}}},{key:"translate",value:function(i,a,s){var u=this;if(gr(a)!=="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),a||(a={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var c=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,f=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,h=this.extractFromKey(i[i.length-1],a),p=h.key,g=h.namespaces,y=g[g.length-1],v=a.lng||this.language,w=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v&&v.toLowerCase()==="cimode"){if(w){var x=a.nsSeparator||this.options.nsSeparator;return c?{res:"".concat(y).concat(x).concat(p),usedKey:p,exactUsedKey:p,usedLng:v,usedNS:y}:"".concat(y).concat(x).concat(p)}return c?{res:p,usedKey:p,exactUsedKey:p,usedLng:v,usedNS:y}:p}var _=this.resolve(i,a),S=_&&_.res,C=_&&_.usedKey||p,O=_&&_.exactUsedKey||p,I=Object.prototype.toString.apply(S),L=["[object Number]","[object Function]","[object RegExp]"],D=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,U=!this.i18nFormat||this.i18nFormat.handleAsObject,X=typeof S!="string"&&typeof S!="boolean"&&typeof S!="number";if(U&&S&&X&&L.indexOf(I)<0&&!(typeof D=="string"&&I==="[object Array]")){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var K=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,S,mn(mn({},a),{},{ns:g})):"key '".concat(p," (").concat(this.language,")' returned an object instead of string.");return c?(_.res=K,_):K}if(f){var te=I==="[object Array]",ce=te?[]:{},j=te?O:C;for(var T in S)if(Object.prototype.hasOwnProperty.call(S,T)){var $="".concat(j).concat(f).concat(T);ce[T]=this.translate($,mn(mn({},a),{joinArrays:!1,ns:g})),ce[T]===$&&(ce[T]=S[T])}S=ce}}else if(U&&typeof D=="string"&&I==="[object Array]")S=S.join(D),S&&(S=this.extendTranslation(S,i,a,s));else{var V=!1,ie=!1,H=a.count!==void 0&&typeof a.count!="string",Y=n.hasDefaultValue(a),Q=H?this.pluralResolver.getSuffix(v,a.count,a):"",oe=a["defaultValue".concat(Q)]||a.defaultValue;!this.isValidLookup(S)&&Y&&(V=!0,S=oe),this.isValidLookup(S)||(ie=!0,S=p);var ve=a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,we=ve&&ie?void 0:S,Ue=Y&&oe!==S&&this.options.updateMissing;if(ie||V||Ue){if(this.logger.log(Ue?"updateKey":"missingKey",v,y,p,Ue?oe:S),f){var At=this.resolve(p,mn(mn({},a),{},{keySeparator:!1}));At&&At.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var me=[],qt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&qt&&qt[0])for(var Bt=0;Bt<qt.length;Bt++)me.push(qt[Bt]);else this.options.saveMissingTo==="all"?me=this.languageUtils.toResolveHierarchy(a.lng||this.language):me.push(a.lng||this.language);var bn=function(Ft,xe,Hr){var Pt=Y&&Hr!==S?Hr:we;u.options.missingKeyHandler?u.options.missingKeyHandler(Ft,y,xe,Pt,Ue,a):u.backendConnector&&u.backendConnector.saveMissing&&u.backendConnector.saveMissing(Ft,y,xe,Pt,Ue,a),u.emit("missingKey",Ft,y,xe,S)};this.options.saveMissing&&(this.options.saveMissingPlurals&&H?me.forEach(function(wr){u.pluralResolver.getSuffixes(wr,a).forEach(function(Ft){bn([wr],p+Ft,a["defaultValue".concat(Ft)]||oe)})}):bn(me,p,oe))}S=this.extendTranslation(S,i,a,_,s),ie&&S===p&&this.options.appendNamespaceToMissingKey&&(S="".concat(y,":").concat(p)),(ie||V)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?S=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(y,":").concat(p):p,V?S:void 0):S=this.options.parseMissingKeyHandler(S))}return c?(_.res=S,_):S}},{key:"extendTranslation",value:function(i,a,s,u,c){var f=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,mn(mn({},this.options.interpolation.defaultVariables),s),u.usedLng,u.usedNS,u.usedKey,{resolved:u});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(mn(mn({},s),{interpolation:mn(mn({},this.options.interpolation),s.interpolation)}));var h=typeof i=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),p;if(h){var g=i.match(this.interpolator.nestingRegexp);p=g&&g.length}var y=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(y=mn(mn({},this.options.interpolation.defaultVariables),y)),i=this.interpolator.interpolate(i,y,s.lng||this.language,s),h){var v=i.match(this.interpolator.nestingRegexp),w=v&&v.length;p<w&&(s.nest=!1)}s.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var S=arguments.length,C=new Array(S),O=0;O<S;O++)C[O]=arguments[O];return c&&c[0]===C[0]&&!s.context?(f.logger.warn("It seems you are nesting recursively key: ".concat(C[0]," in key: ").concat(a[0])),null):f.translate.apply(f,C.concat([a]))},s)),s.interpolation&&this.interpolator.reset()}var x=s.postProcess||this.options.postProcess,_=typeof x=="string"?[x]:x;return i!=null&&_&&_.length&&s.applyPostProcessor!==!1&&(i=dk.handle(_,i,a,this.options&&this.options.postProcessPassResolved?mn({i18nResolved:u},s):s,this)),i}},{key:"resolve",value:function(i){var a=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u,c,f,h,p;return typeof i=="string"&&(i=[i]),i.forEach(function(g){if(!a.isValidLookup(u)){var y=a.extractFromKey(g,s),v=y.key;c=v;var w=y.namespaces;a.options.fallbackNS&&(w=w.concat(a.options.fallbackNS));var x=s.count!==void 0&&typeof s.count!="string",_=x&&!s.ordinal&&s.count===0&&a.pluralResolver.shouldUseIntlApi(),S=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",C=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);w.forEach(function(O){a.isValidLookup(u)||(p=O,!Fw["".concat(C[0],"-").concat(O)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(p)&&(Fw["".concat(C[0],"-").concat(O)]=!0,a.logger.warn('key "'.concat(c,'" for languages "').concat(C.join(", "),`" won't get resolved as namespace "`).concat(p,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(function(I){if(!a.isValidLookup(u)){h=I;var L=[v];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(L,v,I,O,s);else{var D;x&&(D=a.pluralResolver.getSuffix(I,s.count,s));var U="".concat(a.options.pluralSeparator,"zero");if(x&&(L.push(v+D),_&&L.push(v+U)),S){var X="".concat(v).concat(a.options.contextSeparator).concat(s.context);L.push(X),x&&(L.push(X+D),_&&L.push(X+U))}}for(var K;K=L.pop();)a.isValidLookup(u)||(f=K,u=a.getResource(I,O,K,s))}}))})}}),{res:u,usedKey:c,exactUsedKey:f,usedLng:h,usedNS:p}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,a,s){var u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,a,s,u):this.resourceStore.getResource(i,a,s,u)}}],[{key:"hasDefaultValue",value:function(i){var a="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&a===s.substring(0,a.length)&&i[s]!==void 0)return!0;return!1}}]),n}(Aa);function xm(t){return t.charAt(0).toUpperCase()+t.slice(1)}var zw=function(){function t(e){Sr(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ii.create("languageUtils")}return _r(t,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(a){return a.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=xm(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=xm(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=xm(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(a){if(!i){var s=r.formatLanguageCode(a);(!r.options.supportedLngs||r.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&n.forEach(function(a){if(!i){var s=r.getLanguagePartFromCode(a);if(r.isSupportedCode(s))return i=s;i=r.options.supportedLngs.find(function(u){if(u.indexOf(s)===0)return u})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,a=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],u=function(f){f&&(i.isSupportedCode(f)?s.push(f):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(f)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(n))):typeof n=="string"&&u(this.formatLanguageCode(n)),a.forEach(function(c){s.indexOf(c)<0&&u(i.formatLanguageCode(c))}),s}}]),t}(),e4=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],t4={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}},n4=["v1","v2","v3"],Gw={zero:0,one:1,two:2,few:3,many:4,other:5};function r4(){var t={};return e4.forEach(function(e){e.lngs.forEach(function(n){t[n]={numbers:e.nr,plurals:t4[e.fc]}})}),t}var i4=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Sr(this,t),this.languageUtils=e,this.options=n,this.logger=ii.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=r4()}return _r(t,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(a){return"".concat(r).concat(a)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=this.getRule(n,i);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort(function(s,u){return Gw[s]-Gw[u]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):a.numbers.map(function(s){return r.getSuffix(n,s,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this.getRule(n,i);return a?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(a.select(r)):this.getSuffixRetroCompatible(a,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,a=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[a];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var u=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):u():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?u():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}},{key:"shouldUseIntlApi",value:function(){return!n4.includes(this.options.compatibilityJSON)}}]),t}();function Uw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ar(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Uw(Object(n),!0).forEach(function(r){Ur(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Uw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var a4=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sr(this,t),this.logger=ii.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(n){return n},this.init(e)}return _r(t,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:V5,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?es(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?es(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?es(r.nestingPrefix):r.nestingPrefixEscaped||es("$t("),this.nestingSuffix=r.nestingSuffix?es(r.nestingSuffix):r.nestingSuffixEscaped||es(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,a){var s=this,u,c,f,h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function p(x){return x.replace(/\$/g,"$$$$")}var g=function(_){if(_.indexOf(s.formatSeparator)<0){var S=Dw(r,h,_);return s.alwaysFormat?s.format(S,void 0,i,Ar(Ar(Ar({},a),r),{},{interpolationkey:_})):S}var C=_.split(s.formatSeparator),O=C.shift().trim(),I=C.join(s.formatSeparator).trim();return s.format(Dw(r,h,O),I,i,Ar(Ar(Ar({},a),r),{},{interpolationkey:O}))};this.resetRegExp();var y=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,v=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,w=[{regex:this.regexpUnescape,safeValue:function(_){return p(_)}},{regex:this.regexp,safeValue:function(_){return s.escapeValue?p(s.escape(_)):p(_)}}];return w.forEach(function(x){for(f=0;u=x.regex.exec(n);){var _=u[1].trim();if(c=g(_),c===void 0)if(typeof y=="function"){var S=y(n,u,a);c=typeof S=="string"?S:""}else if(a&&Object.prototype.hasOwnProperty.call(a,_))c="";else if(v){c=u[0];continue}else s.logger.warn("missed to pass in variable ".concat(_," for interpolating ").concat(n)),c="";else typeof c!="string"&&!s.useRawValueToEscape&&(c=Lw(c));var C=x.safeValue(c);if(n=n.replace(u[0],C),v?(x.regex.lastIndex+=c.length,x.regex.lastIndex-=u[0].length):x.regex.lastIndex=0,f++,f>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,u,c;function f(y,v){var w=this.nestingOptionsSeparator;if(y.indexOf(w)<0)return y;var x=y.split(new RegExp("".concat(w,"[ ]*{"))),_="{".concat(x[1]);y=x[0],_=this.interpolate(_,c);var S=_.match(/'/g),C=_.match(/"/g);(S&&S.length%2===0&&!C||C.length%2!==0)&&(_=_.replace(/'/g,'"'));try{c=JSON.parse(_),v&&(c=Ar(Ar({},v),c))}catch(O){return this.logger.warn("failed parsing options string in nesting for key ".concat(y),O),"".concat(y).concat(w).concat(_)}return delete c.defaultValue,y}for(;s=this.nestingRegexp.exec(n);){var h=[];c=Ar({},a),c=c.replace&&typeof c.replace!="string"?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;var p=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var g=s[1].split(this.formatSeparator).map(function(y){return y.trim()});s[1]=g.shift(),h=g,p=!0}if(u=r(f.call(this,s[1].trim(),c),c),u&&s[0]===n&&typeof u!="string")return u;typeof u!="string"&&(u=Lw(u)),u||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),u=""),p&&(u=h.reduce(function(y,v){return i.format(y,v,a.lng,Ar(Ar({},a),{},{interpolationkey:s[1].trim()}))},u.trim())),n=n.replace(s[0],u),this.regexp.lastIndex=0}return n}}]),t}();function jw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ri(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jw(Object(n),!0).forEach(function(r){Ur(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function o4(t){var e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){var r=t.split("(");e=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(e==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(e==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var a=i.split(";");a.forEach(function(s){if(s){var u=s.split(":"),c=z5(u),f=c[0],h=c.slice(1),p=h.join(":").trim().replace(/^'+|'+$/g,"");n[f.trim()]||(n[f.trim()]=p),p==="false"&&(n[f.trim()]=!1),p==="true"&&(n[f.trim()]=!0),isNaN(p)||(n[f.trim()]=parseInt(p,10))}})}}return{formatName:e,formatOptions:n}}function ts(t){var e={};return function(r,i,a){var s=i+JSON.stringify(a),u=e[s];return u||(u=t(i,a),e[s]=u),u(r)}}var s4=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sr(this,t),this.logger=ii.create("formatter"),this.options=e,this.formats={number:ts(function(n,r){var i=new Intl.NumberFormat(n,Ri({},r));return function(a){return i.format(a)}}),currency:ts(function(n,r){var i=new Intl.NumberFormat(n,Ri(Ri({},r),{},{style:"currency"}));return function(a){return i.format(a)}}),datetime:ts(function(n,r){var i=new Intl.DateTimeFormat(n,Ri({},r));return function(a){return i.format(a)}}),relativetime:ts(function(n,r){var i=new Intl.RelativeTimeFormat(n,Ri({},r));return function(a){return i.format(a,r.range||"day")}}),list:ts(function(n,r){var i=new Intl.ListFormat(n,Ri({},r));return function(a){return i.format(a)}})},this.init(e)}return _r(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"addCached",value:function(n,r){this.formats[n.toLowerCase().trim()]=ts(r)}},{key:"format",value:function(n,r,i){var a=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=r.split(this.formatSeparator),c=u.reduce(function(f,h){var p=o4(h),g=p.formatName,y=p.formatOptions;if(a.formats[g]){var v=f;try{var w=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},x=w.locale||w.lng||s.locale||s.lng||i;v=a.formats[g](f,x,Ri(Ri(Ri({},y),s),w))}catch(_){a.logger.warn(_)}return v}else a.logger.warn("there was no format function for ".concat(g));return f},n);return c}}]),t}();function Hw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ww(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Hw(Object(n),!0).forEach(function(r){Ur(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Hw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function l4(t){var e=u4();return function(){var r=fi(t),i;if(e){var a=fi(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return Zu(this,i)}}function u4(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function c4(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var f4=function(t){Xh(n,t);var e=l4(n);function n(r,i,a){var s,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Sr(this,n),s=e.call(this),Qh&&Aa.call(Pa(s)),s.backend=r,s.store=i,s.services=a,s.languageUtils=a.languageUtils,s.options=u,s.logger=ii.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=u.maxParallelReads||10,s.readingCalls=0,s.maxRetries=u.maxRetries>=0?u.maxRetries:5,s.retryTimeout=u.retryTimeout>=1?u.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(a,u.backend,u),s}return _r(n,[{key:"queueLoad",value:function(i,a,s,u){var c=this,f={},h={},p={},g={};return i.forEach(function(y){var v=!0;a.forEach(function(w){var x="".concat(y,"|").concat(w);!s.reload&&c.store.hasResourceBundle(y,w)?c.state[x]=2:c.state[x]<0||(c.state[x]===1?h[x]===void 0&&(h[x]=!0):(c.state[x]=1,v=!1,h[x]===void 0&&(h[x]=!0),f[x]===void 0&&(f[x]=!0),g[w]===void 0&&(g[w]=!0)))}),v||(p[y]=!0)}),(Object.keys(f).length||Object.keys(h).length)&&this.queue.push({pending:h,pendingCount:Object.keys(h).length,loaded:{},errors:[],callback:u}),{toLoad:Object.keys(f),pending:Object.keys(h),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}},{key:"loaded",value:function(i,a,s){var u=i.split("|"),c=u[0],f=u[1];a&&this.emit("failedLoading",c,f,a),s&&this.store.addResourceBundle(c,f,s),this.state[i]=a?-1:2;var h={};this.queue.forEach(function(p){H5(p.loaded,[c],f),c4(p,i),a&&p.errors.push(a),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(function(g){h[g]||(h[g]={});var y=p.loaded[g];y.length&&y.forEach(function(v){h[g][v]===void 0&&(h[g][v]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",h),this.queue=this.queue.filter(function(p){return!p.done})}},{key:"read",value:function(i,a,s){var u=this,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,h=arguments.length>5?arguments[5]:void 0;if(!i.length)return h(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:a,fcName:s,tried:c,wait:f,callback:h});return}this.readingCalls++;var p=function(w,x){if(u.readingCalls--,u.waitingReads.length>0){var _=u.waitingReads.shift();u.read(_.lng,_.ns,_.fcName,_.tried,_.wait,_.callback)}if(w&&x&&c<u.maxRetries){setTimeout(function(){u.read.call(u,i,a,s,c+1,f*2,h)},f);return}h(w,x)},g=this.backend[s].bind(this.backend);if(g.length===2){try{var y=g(i,a);y&&typeof y.then=="function"?y.then(function(v){return p(null,v)}).catch(p):p(null,y)}catch(v){p(v)}return}return g(i,a,p)}},{key:"prepareLoading",value:function(i,a){var s=this,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof a=="string"&&(a=[a]);var f=this.queueLoad(i,a,u,c);if(!f.toLoad.length)return f.pending.length||c(),null;f.toLoad.forEach(function(h){s.loadOne(h)})}},{key:"load",value:function(i,a,s){this.prepareLoading(i,a,{},s)}},{key:"reload",value:function(i,a,s){this.prepareLoading(i,a,{reload:!0},s)}},{key:"loadOne",value:function(i){var a=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",u=i.split("|"),c=u[0],f=u[1];this.read(c,f,"read",void 0,void 0,function(h,p){h&&a.logger.warn("".concat(s,"loading namespace ").concat(f," for language ").concat(c," failed"),h),!h&&p&&a.logger.log("".concat(s,"loaded namespace ").concat(f," for language ").concat(c),p),a.loaded(i,h,p)})}},{key:"saveMissing",value:function(i,a,s,u,c){var f=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},h=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(a)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){var p=Ww(Ww({},f),{},{isUpdate:c}),g=this.backend.create.bind(this.backend);if(g.length<6)try{var y;g.length===5?y=g(i,a,s,u,p):y=g(i,a,s,u),y&&typeof y.then=="function"?y.then(function(v){return h(null,v)}).catch(h):h(null,y)}catch(v){h(v)}else g(i,a,s,u,h,p)}!i||!i[0]||this.store.addResource(i[0],a,s,u)}}}]),n}(Aa);function Vw(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var n={};if(gr(e[1])==="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),gr(e[2])==="object"||gr(e[3])==="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(e,n,r,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function qw(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function Kw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Qr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Kw(Object(n),!0).forEach(function(r){Ur(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function d4(t){var e=h4();return function(){var r=fi(t),i;if(e){var a=fi(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return Zu(this,i)}}function h4(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Af(){}function p4(t){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(t));e.forEach(function(n){typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}var ih=function(t){Xh(n,t);var e=d4(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(Sr(this,n),r=e.call(this),Qh&&Aa.call(Pa(r)),r.options=qw(i),r.services={},r.logger=ii,r.modules={external:[]},p4(Pa(r)),a&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,a),Zu(r,Pa(r));setTimeout(function(){r.init(i,a)},0)}return r}return _r(n,[{key:"init",value:function(){var i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof a=="function"&&(s=a,a={}),!a.defaultNS&&a.defaultNS!==!1&&a.ns&&(typeof a.ns=="string"?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));var u=Vw();this.options=Qr(Qr(Qr({},u),this.options),qw(a)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Qr(Qr({},u.interpolation),this.options.interpolation)),a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator);function c(_){return _?typeof _=="function"?new _:_:null}if(!this.options.isClone){this.modules.logger?ii.init(c(this.modules.logger),this.options):ii.init(null,this.options);var f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=s4);var h=new zw(this.options);this.store=new Q5(this.options.resources,this.options);var p=this.services;p.logger=ii,p.resourceStore=this.store,p.languageUtils=h,p.pluralResolver=new i4(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===u.interpolation.format)&&(p.formatter=c(f),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new a4(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new f4(c(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(_){for(var S=arguments.length,C=new Array(S>1?S-1:0),O=1;O<S;O++)C[O-1]=arguments[O];i.emit.apply(i,[_].concat(C))}),this.modules.languageDetector&&(p.languageDetector=c(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=c(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new $w(this.services,this.options),this.translator.on("*",function(_){for(var S=arguments.length,C=new Array(S>1?S-1:0),O=1;O<S;O++)C[O-1]=arguments[O];i.emit.apply(i,[_].concat(C))}),this.modules.external.forEach(function(_){_.init&&_.init(i)})}if(this.format=this.options.interpolation.format,s||(s=Af),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var g=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);g.length>0&&g[0]!=="dev"&&(this.options.lng=g[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var y=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];y.forEach(function(_){i[_]=function(){var S;return(S=i.store)[_].apply(S,arguments)}});var v=["addResource","addResources","addResourceBundle","removeResourceBundle"];v.forEach(function(_){i[_]=function(){var S;return(S=i.store)[_].apply(S,arguments),i}});var w=Bl(),x=function(){var S=function(O,I){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),w.resolve(I),s(O,I)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return S(null,i.t.bind(i));i.changeLanguage(i.options.lng,S)};return this.options.resources||!this.options.initImmediate?x():setTimeout(x,0),w}},{key:"loadResources",value:function(i){var a=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Af,u=s,c=typeof i=="string"?i:this.language;if(typeof i=="function"&&(u=i),!this.options.resources||this.options.partialBundledLanguages){if(c&&c.toLowerCase()==="cimode")return u();var f=[],h=function(y){if(y){var v=a.services.languageUtils.toResolveHierarchy(y);v.forEach(function(w){f.indexOf(w)<0&&f.push(w)})}};if(c)h(c);else{var p=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);p.forEach(function(g){return h(g)})}this.options.preload&&this.options.preload.forEach(function(g){return h(g)}),this.services.backendConnector.load(f,this.options.ns,function(g){!g&&!a.resolvedLanguage&&a.language&&a.setResolvedLanguage(a.language),u(g)})}else u(null)}},{key:"reloadResources",value:function(i,a,s){var u=Bl();return i||(i=this.languages),a||(a=this.options.ns),s||(s=Af),this.services.backendConnector.reload(i,a,function(c){u.resolve(),s(c)}),u}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&dk.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var a=0;a<this.languages.length;a++){var s=this.languages[a];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,a){var s=this;this.isLanguageChangingTo=i;var u=Bl();this.emit("languageChanging",i);var c=function(g){s.language=g,s.languages=s.services.languageUtils.toResolveHierarchy(g),s.resolvedLanguage=void 0,s.setResolvedLanguage(g)},f=function(g,y){y?(c(y),s.translator.changeLanguage(y),s.isLanguageChangingTo=void 0,s.emit("languageChanged",y),s.logger.log("languageChanged",y)):s.isLanguageChangingTo=void 0,u.resolve(function(){return s.t.apply(s,arguments)}),a&&a(g,function(){return s.t.apply(s,arguments)})},h=function(g){!i&&!g&&s.services.languageDetector&&(g=[]);var y=typeof g=="string"?g:s.services.languageUtils.getBestMatchFromCodes(g);y&&(s.language||c(y),s.translator.language||s.translator.changeLanguage(y),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(y)),s.loadResources(y,function(v){f(v,y)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?h(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(h):this.services.languageDetector.detect(h):h(i),u}},{key:"getFixedT",value:function(i,a,s){var u=this,c=function f(h,p){var g;if(gr(p)!=="object"){for(var y=arguments.length,v=new Array(y>2?y-2:0),w=2;w<y;w++)v[w-2]=arguments[w];g=u.options.overloadTranslationOptionHandler([h,p].concat(v))}else g=Qr({},p);g.lng=g.lng||f.lng,g.lngs=g.lngs||f.lngs,g.ns=g.ns||f.ns,g.keyPrefix=g.keyPrefix||s||f.keyPrefix;var x=u.options.keySeparator||".",_;return g.keyPrefix&&Array.isArray(h)?_=h.map(function(S){return"".concat(g.keyPrefix).concat(x).concat(S)}):_=g.keyPrefix?"".concat(g.keyPrefix).concat(x).concat(h):h,u.t(_,g)};return typeof i=="string"?c.lng=i:c.lngs=i,c.ns=a,c.keyPrefix=s,c}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var a=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var u=this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,f=this.languages[this.languages.length-1];if(u.toLowerCase()==="cimode")return!0;var h=function(y,v){var w=a.services.backendConnector.state["".concat(y,"|").concat(v)];return w===-1||w===2};if(s.precheck){var p=s.precheck(this,h);if(p!==void 0)return p}return!!(this.hasResourceBundle(u,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||h(u,i)&&(!c||h(f,i)))}},{key:"loadNamespaces",value:function(i,a){var s=this,u=Bl();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(c){s.options.ns.indexOf(c)<0&&s.options.ns.push(c)}),this.loadResources(function(c){u.resolve(),a&&a(c)}),u):(a&&a(),Promise.resolve())}},{key:"loadLanguages",value:function(i,a){var s=Bl();typeof i=="string"&&(i=[i]);var u=this.options.preload||[],c=i.filter(function(f){return u.indexOf(f)<0});return c.length?(this.options.preload=u.concat(c),this.loadResources(function(f){s.resolve(),a&&a(f)}),s):(a&&a(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new zw(Vw());return a.indexOf(s.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Af,u=Qr(Qr(Qr({},this.options),a),{isClone:!0}),c=new n(u);(a.debug!==void 0||a.prefix!==void 0)&&(c.logger=c.logger.clone(a));var f=["store","services","language"];return f.forEach(function(h){c[h]=i[h]}),c.services=Qr({},this.services),c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c.translator=new $w(c.services,c.options),c.translator.on("*",function(h){for(var p=arguments.length,g=new Array(p>1?p-1:0),y=1;y<p;y++)g[y-1]=arguments[y];c.emit.apply(c,[h].concat(g))}),c.init(u,s),c.translator.options=c.options,c.translator.backendConnector.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(Aa);Ur(ih,"createInstance",function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new ih(t,e)});var Ae=ih.createInstance();Ae.createInstance=ih.createInstance;Ae.createInstance;Ae.dir;Ae.init;Ae.loadResources;Ae.reloadResources;Ae.use;Ae.changeLanguage;Ae.getFixedT;Ae.t;Ae.exists;Ae.setDefaultNamespace;Ae.hasLoadedNamespace;Ae.loadNamespaces;Ae.loadLanguages;var hk=[],g4=hk.forEach,m4=hk.slice;function v4(t){return g4.call(m4.call(arguments,1),function(e){if(e)for(var n in e)t[n]===void 0&&(t[n]=e[n])}),t}var Yw=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,y4=function(e,n,r){var i=r||{};i.path=i.path||"/";var a=encodeURIComponent(n),s="".concat(e,"=").concat(a);if(i.maxAge>0){var u=i.maxAge-0;if(Number.isNaN(u))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(u))}if(i.domain){if(!Yw.test(i.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(i.domain)}if(i.path){if(!Yw.test(i.path))throw new TypeError("option path is invalid");s+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(s+="; HttpOnly"),i.secure&&(s+="; Secure"),i.sameSite){var c=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(c){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},Xw={create:function(e,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+r*60*1e3)),i&&(a.domain=i),document.cookie=y4(e,encodeURIComponent(n),a)},read:function(e){for(var n="".concat(e,"="),r=document.cookie.split(";"),i=0;i<r.length;i++){for(var a=r[i];a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(n)===0)return a.substring(n.length,a.length)}return null},remove:function(e){this.create(e,"",-1)}},S4={name:"cookie",lookup:function(e){var n;if(e.lookupCookie&&typeof document<"u"){var r=Xw.read(e.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(e,n){n.lookupCookie&&typeof document<"u"&&Xw.create(n.lookupCookie,e,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},_4={name:"querystring",lookup:function(e){var n;if(typeof window<"u"){var r=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=r.substring(1),a=i.split("&"),s=0;s<a.length;s++){var u=a[s].indexOf("=");if(u>0){var c=a[s].substring(0,u);c===e.lookupQuerystring&&(n=a[s].substring(u+1))}}}return n}},Fl=null,Qw=function(){if(Fl!==null)return Fl;try{Fl=window!=="undefined"&&window.localStorage!==null;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Fl=!1}return Fl},w4={name:"localStorage",lookup:function(e){var n;if(e.lookupLocalStorage&&Qw()){var r=window.localStorage.getItem(e.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(e,n){n.lookupLocalStorage&&Qw()&&window.localStorage.setItem(n.lookupLocalStorage,e)}},$l=null,Jw=function(){if($l!==null)return $l;try{$l=window!=="undefined"&&window.sessionStorage!==null;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{$l=!1}return $l},b4={name:"sessionStorage",lookup:function(e){var n;if(e.lookupSessionStorage&&Jw()){var r=window.sessionStorage.getItem(e.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(e,n){n.lookupSessionStorage&&Jw()&&window.sessionStorage.setItem(n.lookupSessionStorage,e)}},C4={name:"navigator",lookup:function(e){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r<navigator.languages.length;r++)n.push(navigator.languages[r]);navigator.userLanguage&&n.push(navigator.userLanguage),navigator.language&&n.push(navigator.language)}return n.length>0?n:void 0}},x4={name:"htmlTag",lookup:function(e){var n,r=e.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},k4={name:"path",lookup:function(e){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof e.lookupFromPathIndex=="number"){if(typeof r[e.lookupFromPathIndex]!="string")return;n=r[e.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},E4={name:"subdomain",lookup:function(e){var n=typeof e.lookupFromSubdomainIndex=="number"?e.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};function P4(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var pk=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Sr(this,t),this.type="languageDetector",this.detectors={},this.init(e,n)}return _r(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=v4(r,this.options||{},P4()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(S4),this.addDetector(_4),this.addDetector(w4),this.addDetector(b4),this.addDetector(C4),this.addDetector(x4),this.addDetector(k4),this.addDetector(E4)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var i=[];return n.forEach(function(a){if(r.detectors[a]){var s=r.detectors[a].lookup(r.options);s&&typeof s=="string"&&(s=[s]),s&&(i=i.concat(s))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var i=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(a){i.detectors[a]&&i.detectors[a].cacheUserLanguage(n,i.options)}))}}]),t}();pk.type="languageDetector";function Hv(t){return Hv=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hv(t)}var gk=[],O4=gk.forEach,T4=gk.slice;function Wv(t){return O4.call(T4.call(arguments,1),function(e){if(e)for(var n in e)t[n]===void 0&&(t[n]=e[n])}),t}function mk(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Hv(XMLHttpRequest))==="object"}function R4(t){return!!t&&typeof t.then=="function"}function A4(t){return R4(t)?t:Promise.resolve(t)}function I4(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zu={},L4={get exports(){return zu},set exports(t){zu=t}},gu={},M4={get exports(){return gu},set exports(t){gu=t}},Zw;function D4(){return Zw||(Zw=1,function(t,e){var n=typeof self<"u"?self:yn,r=function(){function a(){this.fetch=!1,this.DOMException=n.DOMException}return a.prototype=n,new a}();(function(a){(function(s){var u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function c(T){return T&&DataView.prototype.isPrototypeOf(T)}if(u.arrayBuffer)var f=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(T){return T&&f.indexOf(Object.prototype.toString.call(T))>-1};function p(T){if(typeof T!="string"&&(T=String(T)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(T))throw new TypeError("Invalid character in header field name");return T.toLowerCase()}function g(T){return typeof T!="string"&&(T=String(T)),T}function y(T){var $={next:function(){var V=T.shift();return{done:V===void 0,value:V}}};return u.iterable&&($[Symbol.iterator]=function(){return $}),$}function v(T){this.map={},T instanceof v?T.forEach(function($,V){this.append(V,$)},this):Array.isArray(T)?T.forEach(function($){this.append($[0],$[1])},this):T&&Object.getOwnPropertyNames(T).forEach(function($){this.append($,T[$])},this)}v.prototype.append=function(T,$){T=p(T),$=g($);var V=this.map[T];this.map[T]=V?V+", "+$:$},v.prototype.delete=function(T){delete this.map[p(T)]},v.prototype.get=function(T){return T=p(T),this.has(T)?this.map[T]:null},v.prototype.has=function(T){return this.map.hasOwnProperty(p(T))},v.prototype.set=function(T,$){this.map[p(T)]=g($)},v.prototype.forEach=function(T,$){for(var V in this.map)this.map.hasOwnProperty(V)&&T.call($,this.map[V],V,this)},v.prototype.keys=function(){var T=[];return this.forEach(function($,V){T.push(V)}),y(T)},v.prototype.values=function(){var T=[];return this.forEach(function($){T.push($)}),y(T)},v.prototype.entries=function(){var T=[];return this.forEach(function($,V){T.push([V,$])}),y(T)},u.iterable&&(v.prototype[Symbol.iterator]=v.prototype.entries);function w(T){if(T.bodyUsed)return Promise.reject(new TypeError("Already read"));T.bodyUsed=!0}function x(T){return new Promise(function($,V){T.onload=function(){$(T.result)},T.onerror=function(){V(T.error)}})}function _(T){var $=new FileReader,V=x($);return $.readAsArrayBuffer(T),V}function S(T){var $=new FileReader,V=x($);return $.readAsText(T),V}function C(T){for(var $=new Uint8Array(T),V=new Array($.length),ie=0;ie<$.length;ie++)V[ie]=String.fromCharCode($[ie]);return V.join("")}function O(T){if(T.slice)return T.slice(0);var $=new Uint8Array(T.byteLength);return $.set(new Uint8Array(T)),$.buffer}function I(){return this.bodyUsed=!1,this._initBody=function(T){this._bodyInit=T,T?typeof T=="string"?this._bodyText=T:u.blob&&Blob.prototype.isPrototypeOf(T)?this._bodyBlob=T:u.formData&&FormData.prototype.isPrototypeOf(T)?this._bodyFormData=T:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)?this._bodyText=T.toString():u.arrayBuffer&&u.blob&&c(T)?(this._bodyArrayBuffer=O(T.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(T)||h(T))?this._bodyArrayBuffer=O(T):this._bodyText=T=Object.prototype.toString.call(T):this._bodyText="",this.headers.get("content-type")||(typeof T=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(T)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var T=w(this);if(T)return T;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?w(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(_)}),this.text=function(){var T=w(this);if(T)return T;if(this._bodyBlob)return S(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(C(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(X)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function D(T){var $=T.toUpperCase();return L.indexOf($)>-1?$:T}function U(T,$){$=$||{};var V=$.body;if(T instanceof U){if(T.bodyUsed)throw new TypeError("Already read");this.url=T.url,this.credentials=T.credentials,$.headers||(this.headers=new v(T.headers)),this.method=T.method,this.mode=T.mode,this.signal=T.signal,!V&&T._bodyInit!=null&&(V=T._bodyInit,T.bodyUsed=!0)}else this.url=String(T);if(this.credentials=$.credentials||this.credentials||"same-origin",($.headers||!this.headers)&&(this.headers=new v($.headers)),this.method=D($.method||this.method||"GET"),this.mode=$.mode||this.mode||null,this.signal=$.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&V)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(V)}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function X(T){var $=new FormData;return T.trim().split("&").forEach(function(V){if(V){var ie=V.split("="),H=ie.shift().replace(/\+/g," "),Y=ie.join("=").replace(/\+/g," ");$.append(decodeURIComponent(H),decodeURIComponent(Y))}}),$}function K(T){var $=new v,V=T.replace(/\r?\n[\t ]+/g," ");return V.split(/\r?\n/).forEach(function(ie){var H=ie.split(":"),Y=H.shift().trim();if(Y){var Q=H.join(":").trim();$.append(Y,Q)}}),$}I.call(U.prototype);function te(T,$){$||($={}),this.type="default",this.status=$.status===void 0?200:$.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in $?$.statusText:"OK",this.headers=new v($.headers),this.url=$.url||"",this._initBody(T)}I.call(te.prototype),te.prototype.clone=function(){return new te(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new v(this.headers),url:this.url})},te.error=function(){var T=new te(null,{status:0,statusText:""});return T.type="error",T};var ce=[301,302,303,307,308];te.redirect=function(T,$){if(ce.indexOf($)===-1)throw new RangeError("Invalid status code");return new te(null,{status:$,headers:{location:T}})},s.DOMException=a.DOMException;try{new s.DOMException}catch{s.DOMException=function($,V){this.message=$,this.name=V;var ie=Error($);this.stack=ie.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function j(T,$){return new Promise(function(V,ie){var H=new U(T,$);if(H.signal&&H.signal.aborted)return ie(new s.DOMException("Aborted","AbortError"));var Y=new XMLHttpRequest;function Q(){Y.abort()}Y.onload=function(){var oe={status:Y.status,statusText:Y.statusText,headers:K(Y.getAllResponseHeaders()||"")};oe.url="responseURL"in Y?Y.responseURL:oe.headers.get("X-Request-URL");var ve="response"in Y?Y.response:Y.responseText;V(new te(ve,oe))},Y.onerror=function(){ie(new TypeError("Network request failed"))},Y.ontimeout=function(){ie(new TypeError("Network request failed"))},Y.onabort=function(){ie(new s.DOMException("Aborted","AbortError"))},Y.open(H.method,H.url,!0),H.credentials==="include"?Y.withCredentials=!0:H.credentials==="omit"&&(Y.withCredentials=!1),"responseType"in Y&&u.blob&&(Y.responseType="blob"),H.headers.forEach(function(oe,ve){Y.setRequestHeader(ve,oe)}),H.signal&&(H.signal.addEventListener("abort",Q),Y.onreadystatechange=function(){Y.readyState===4&&H.signal.removeEventListener("abort",Q)}),Y.send(typeof H._bodyInit>"u"?null:H._bodyInit)})}return j.polyfill=!0,a.fetch||(a.fetch=j,a.Headers=v,a.Request=U,a.Response=te),s.Headers=v,s.Request=U,s.Response=te,s.fetch=j,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}(M4,gu)),gu}(function(t,e){var n;if(typeof fetch=="function"&&(typeof yn<"u"&&yn.fetch?n=yn.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof I4<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||D4();r.default&&(r=r.default),e.default=r,t.exports=e.default}})(L4,zu);const vk=zu,eb=h2({__proto__:null,default:vk},[zu]);function ah(t){return ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ah(t)}var Fi;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?Fi=global.fetch:typeof window<"u"&&window.fetch?Fi=window.fetch:Fi=fetch);var Gu;mk()&&(typeof global<"u"&&global.XMLHttpRequest?Gu=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Gu=window.XMLHttpRequest));var oh;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?oh=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(oh=window.ActiveXObject));!Fi&&eb&&!Gu&&!oh&&(Fi=vk||eb);typeof Fi!="function"&&(Fi=void 0);var Vv=function(e,n){if(n&&ah(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},tb=function(e,n,r){Fi(e,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(a){r(null,{status:i.status,data:a})}).catch(r)}).catch(r)},nb=!1,N4=function(e,n,r,i){e.queryStringParams&&(n=Vv(n,e.queryStringParams));var a=Wv({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);r&&(a["Content-Type"]="application/json");var s=typeof e.requestOptions=="function"?e.requestOptions(r):e.requestOptions,u=Wv({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:a},nb?{}:s);try{tb(n,u,i)}catch(c){if(!s||Object.keys(s).length===0||!c.message||c.message.indexOf("not implemented")<0)return i(c);try{Object.keys(s).forEach(function(f){delete u[f]}),tb(n,u,i),nb=!0}catch(f){i(f)}}},B4=function(e,n,r,i){r&&ah(r)==="object"&&(r=Vv("",r).slice(1)),e.queryStringParams&&(n=Vv(n,e.queryStringParams));try{var a;Gu?a=new Gu:a=new oh("MSXML2.XMLHTTP.3.0"),a.open(r?"POST":"GET",n,1),e.crossDomain||a.setRequestHeader("X-Requested-With","XMLHttpRequest"),a.withCredentials=!!e.withCredentials,r&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.overrideMimeType&&a.overrideMimeType("application/json");var s=e.customHeaders;if(s=typeof s=="function"?s():s,s)for(var u in s)a.setRequestHeader(u,s[u]);a.onreadystatechange=function(){a.readyState>3&&i(a.status>=400?a.statusText:null,{status:a.status,data:a.responseText})},a.send(r)}catch(c){console&&console.log(c)}},F4=function(e,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Fi&&n.indexOf("file:")!==0)return N4(e,n,r,i);if(mk()||typeof ActiveXObject=="function")return B4(e,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function Uu(t){return Uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uu(t)}function $4(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rb(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,yk(r.key),r)}}function z4(t,e,n){return e&&rb(t.prototype,e),n&&rb(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function G4(t,e,n){return e=yk(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yk(t){var e=U4(t,"string");return Uu(e)==="symbol"?e:String(e)}function U4(t,e){if(Uu(t)!=="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(Uu(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var j4=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return G4({},r,i||"")},request:F4,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Sk=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};$4(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return z4(t,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Wv(i,this.options||{},j4()),this.allOptions=a,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,a,s){var u=this,c=this.options.loadPath;typeof this.options.loadPath=="function"&&(c=this.options.loadPath(n,i)),c=A4(c),c.then(function(f){if(!f)return s(null,{});var h=u.services.interpolator.interpolate(f,{lng:n.join("+"),ns:i.join("+")});u.loadUrl(h,s,r,a)})}},{key:"loadUrl",value:function(n,r,i,a){var s=this;this.options.request(this.options,n,void 0,function(u,c){if(c&&(c.status>=500&&c.status<600||!c.status))return r("failed loading "+n+"; status code: "+c.status,!0);if(c&&c.status>=400&&c.status<500)return r("failed loading "+n+"; status code: "+c.status,!1);if(!c&&u&&u.message&&u.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+u.message,!0);if(u)return r(u,!1);var f,h;try{typeof c.data=="string"?f=s.options.parse(c.data,i,a):f=c.data}catch{h="failed parsing "+n+" to json"}if(h)return r(h,!1);r(null,f)})}},{key:"create",value:function(n,r,i,a,s){var u=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var c=this.options.parsePayload(r,i,a),f=0,h=[],p=[];n.forEach(function(g){var y=u.options.addPath;typeof u.options.addPath=="function"&&(y=u.options.addPath(g,r));var v=u.services.interpolator.interpolate(y,{lng:g,ns:r});u.options.request(u.options,v,c,function(w,x){f+=1,h.push(w),p.push(x),f===n.length&&typeof s=="function"&&s(h,p)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,a=r.languageUtils,s=r.logger,u=i.language;if(!(u&&u.toLowerCase()==="cimode")){var c=[],f=function(p){var g=a.toResolveHierarchy(p);g.forEach(function(y){c.indexOf(y)<0&&c.push(y)})};f(u),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return f(h)}),c.forEach(function(h){n.allOptions.ns.forEach(function(p){i.read(h,p,"read",null,null,function(g,y){g&&s.warn("loading namespace ".concat(p," for language ").concat(h," failed"),g),!g&&y&&s.log("loaded namespace ".concat(p," for language ").concat(h),y),i.loaded("".concat(h,"|").concat(p),g,y)})})})}}}]),t}();Sk.type="backend";function H4(){if(console&&console.warn){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(t=console).warn.apply(t,n)}}var ib={};function qv(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&ib[e[0]]||(typeof e[0]=="string"&&(ib[e[0]]=new Date),H4.apply(void 0,e))}function ab(t,e,n){t.loadNamespaces(e,function(){if(t.isInitialized)n();else{var r=function i(){setTimeout(function(){t.off("initialized",i)},0),n()};t.on("initialized",r)}})}function W4(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.languages[0],i=e.options?e.options.fallbackLng:!1,a=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var s=function(c,f){var h=e.services.backendConnector.state["".concat(c,"|").concat(f)];return h===-1||h===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!s(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(r,t)&&(!i||s(a,t)))}function V4(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return qv("i18n.languages were undefined or empty",e.languages),!0;var r=e.options.ignoreJSONStructure!==void 0;return r?e.hasLoadedNamespace(t,{precheck:function(a,s){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!s(a.isLanguageChangingTo,t))return!1}}):W4(t,e,n)}var q4=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,K4={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Y4=function(e){return K4[e]},X4=function(e){return e.replace(q4,Y4)};function ob(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function sb(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ob(Object(n),!0).forEach(function(r){Ur(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ob(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Kv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:X4};function Q4(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Kv=sb(sb({},Kv),t)}function J4(){return Kv}var _k;function Z4(t){_k=t}function eB(){return _k}var tB={type:"3rdParty",init:function(e){Q4(e.options.react),Z4(e)}},nB=be.createContext(),rB=function(){function t(){Sr(this,t),this.usedNamespaces={}}return _r(t,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),t}();function iB(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,a,s,u=[],c=!0,f=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(h){f=!0,i=h}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(f)throw i}}return u}}function aB(t,e){return sk(t)||iB(t,e)||lk(t,e)||uk()}function lb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function km(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lb(Object(n),!0).forEach(function(r){Ur(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lb(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var oB=function(e,n){var r=be.useRef();return be.useEffect(function(){r.current=n?r.current:e},[e,n]),r.current};function sB(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.i18n,r=be.useContext(nB)||{},i=r.i18n,a=r.defaultNS,s=n||i||eB();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new rB),!s){qv("You will need to pass in an i18next instance by using initReactI18next");var u=function(X,K){return typeof K=="string"?K:K&&gr(K)==="object"&&typeof K.defaultValue=="string"?K.defaultValue:Array.isArray(X)?X[X.length-1]:X},c=[u,{},!1];return c.t=u,c.i18n={},c.ready=!1,c}s.options.react&&s.options.react.wait!==void 0&&qv("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var f=km(km(km({},J4()),s.options.react),e),h=f.useSuspense,p=f.keyPrefix,g=t||a||s.options&&s.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(g);var y=(s.isInitialized||s.initializedStoreOnce)&&g.every(function(U){return V4(U,s,f)});function v(){return s.getFixedT(null,f.nsMode==="fallback"?g:g[0],p)}var w=be.useState(v),x=aB(w,2),_=x[0],S=x[1],C=g.join(),O=oB(C),I=be.useRef(!0);be.useEffect(function(){var U=f.bindI18n,X=f.bindI18nStore;I.current=!0,!y&&!h&&ab(s,g,function(){I.current&&S(v)}),y&&O&&O!==C&&I.current&&S(v);function K(){I.current&&S(v)}return U&&s&&s.on(U,K),X&&s&&s.store.on(X,K),function(){I.current=!1,U&&s&&U.split(" ").forEach(function(te){return s.off(te,K)}),X&&s&&X.split(" ").forEach(function(te){return s.store.off(te,K)})}},[s,C]);var L=be.useRef(!0);be.useEffect(function(){I.current&&!L.current&&S(v),L.current=!1},[s,p]);var D=[_,s,y];if(D.t=_,D.i18n=s,D.ready=y,y||!y&&!h)return D;throw new Promise(function(U){ab(s,g,function(){U()})})}Ae.use(Sk).use(pk).use(tB).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const lB={isConnected:!1,isProcessing:!1,log:[],shouldShowLogViewer:!1,shouldDisplayInProgressType:"latents",shouldDisplayGuides:!0,isGFPGANAvailable:!0,isESRGANAvailable:!0,socketId:"",shouldConfirmOnDelete:!0,openAccordions:[0],currentStep:0,totalSteps:0,currentIteration:0,totalIterations:0,currentStatus:Ae.isInitialized?Ae.t("common.statusDisconnected"):"Disconnected",currentStatusHasSteps:!1,model:"",model_id:"",model_hash:"",app_id:"",app_version:"",model_list:{},infill_methods:[],hasError:!1,wasErrorSeen:!0,isCancelable:!0,saveIntermediatesInterval:5,enableImageDebugging:!1,toastQueue:[],searchFolder:null,foundModels:null,openModel:null,cancelOptions:{cancelType:"immediate",cancelAfter:null}},wk=vo({name:"system",initialState:lB,reducers:{setShouldDisplayInProgressType:(t,e)=>{t.shouldDisplayInProgressType=e.payload},setIsProcessing:(t,e)=>{t.isProcessing=e.payload},setCurrentStatus:(t,e)=>{t.currentStatus=e.payload},setSystemStatus:(t,e)=>({...t,...e.payload}),errorOccurred:t=>{t.hasError=!0,t.isProcessing=!1,t.isCancelable=!0,t.currentStep=0,t.totalSteps=0,t.currentIteration=0,t.totalIterations=0,t.currentStatusHasSteps=!1,t.currentStatus=Ae.t("common.statusError"),t.wasErrorSeen=!1},errorSeen:t=>{t.hasError=!1,t.wasErrorSeen=!0,t.currentStatus=t.isConnected?Ae.t("common.statusConnected"):Ae.t("common.statusDisconnected")},addLogEntry:(t,e)=>{const{timestamp:n,message:r,level:i}=e.payload,s={timestamp:n,message:r,level:i||"info"};t.log.push(s)},setShouldShowLogViewer:(t,e)=>{t.shouldShowLogViewer=e.payload},setIsConnected:(t,e)=>{t.isConnected=e.payload,t.isProcessing=!1,t.isCancelable=!0,t.currentStep=0,t.totalSteps=0,t.currentIteration=0,t.totalIterations=0,t.currentStatusHasSteps=!1,t.hasError=!1},setSocketId:(t,e)=>{t.socketId=e.payload},setShouldConfirmOnDelete:(t,e)=>{t.shouldConfirmOnDelete=e.payload},setOpenAccordions:(t,e)=>{t.openAccordions=e.payload},setSystemConfig:(t,e)=>({...t,...e.payload}),setShouldDisplayGuides:(t,e)=>{t.shouldDisplayGuides=e.payload},processingCanceled:t=>{t.isProcessing=!1,t.isCancelable=!0,t.currentStep=0,t.totalSteps=0,t.currentIteration=0,t.totalIterations=0,t.currentStatusHasSteps=!1,t.currentStatus=Ae.t("common.statusProcessingCanceled")},generationRequested:t=>{t.isProcessing=!0,t.isCancelable=!0,t.currentStep=0,t.totalSteps=0,t.currentIteration=0,t.totalIterations=0,t.currentStatusHasSteps=!1,t.currentStatus=Ae.t("common.statusPreparing")},setModelList:(t,e)=>{t.model_list=e.payload},setIsCancelable:(t,e)=>{t.isCancelable=e.payload},modelChangeRequested:t=>{t.currentStatus=Ae.t("common.statusLoadingModel"),t.isCancelable=!1,t.isProcessing=!0,t.currentStatusHasSteps=!1},modelConvertRequested:t=>{t.currentStatus=Ae.t("common.statusConvertingModel"),t.isCancelable=!1,t.isProcessing=!0,t.currentStatusHasSteps=!1},modelMergingRequested:t=>{t.currentStatus=Ae.t("common.statusMergingModels"),t.isCancelable=!1,t.isProcessing=!0,t.currentStatusHasSteps=!1},setSaveIntermediatesInterval:(t,e)=>{t.saveIntermediatesInterval=e.payload},setEnableImageDebugging:(t,e)=>{t.enableImageDebugging=e.payload},addToast:(t,e)=>{t.toastQueue.push(e.payload)},clearToastQueue:t=>{t.toastQueue=[]},setProcessingIndeterminateTask:(t,e)=>{t.isProcessing=!0,t.currentStatus=e.payload,t.currentStatusHasSteps=!1},setSearchFolder:(t,e)=>{t.searchFolder=e.payload},setFoundModels:(t,e)=>{t.foundModels=e.payload},setOpenModel:(t,e)=>{t.openModel=e.payload},setCancelType:(t,e)=>{t.cancelOptions.cancelType=e.payload},setCancelAfter:(t,e)=>{t.cancelOptions.cancelAfter=e.payload}}}),{setShouldDisplayInProgressType:eH,setIsProcessing:ei,addLogEntry:Gt,setShouldShowLogViewer:tH,setIsConnected:ub,setSocketId:nH,setShouldConfirmOnDelete:rH,setOpenAccordions:iH,setSystemStatus:uB,setCurrentStatus:ns,setSystemConfig:cB,setShouldDisplayGuides:aH,processingCanceled:fB,errorOccurred:cb,errorSeen:oH,setModelList:rs,setIsCancelable:If,modelChangeRequested:dB,modelConvertRequested:hB,modelMergingRequested:pB,setSaveIntermediatesInterval:sH,setEnableImageDebugging:lH,generationRequested:gB,addToast:zl,clearToastQueue:uH,setProcessingIndeterminateTask:cH,setSearchFolder:mB,setFoundModels:vB,setOpenModel:fH,setCancelType:dH,setCancelAfter:hH}=wk.actions,yB=wk.reducer,bk=["txt2img","img2img","unifiedCanvas","nodes","postprocess","training"],SB={activeTab:0,currentTheme:"dark",parametersPanelScrollPosition:0,shouldHoldParametersPanelOpen:!1,shouldPinParametersPanel:!0,shouldShowParametersPanel:!0,shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,addNewModelUIOption:null},_B=SB,Ck=vo({name:"ui",initialState:_B,reducers:{setActiveTab:(t,e)=>{typeof e.payload=="number"?t.activeTab=e.payload:t.activeTab=bk.indexOf(e.payload)},setCurrentTheme:(t,e)=>{t.currentTheme=e.payload},setParametersPanelScrollPosition:(t,e)=>{t.parametersPanelScrollPosition=e.payload},setShouldPinParametersPanel:(t,e)=>{t.shouldPinParametersPanel=e.payload},setShouldShowParametersPanel:(t,e)=>{t.shouldShowParametersPanel=e.payload},setShouldHoldParametersPanelOpen:(t,e)=>{t.shouldHoldParametersPanelOpen=e.payload},setShouldShowImageDetails:(t,e)=>{t.shouldShowImageDetails=e.payload},setShouldUseCanvasBetaLayout:(t,e)=>{t.shouldUseCanvasBetaLayout=e.payload},setShouldShowExistingModelsInSearch:(t,e)=>{t.shouldShowExistingModelsInSearch=e.payload},setShouldUseSliders:(t,e)=>{t.shouldUseSliders=e.payload},setAddNewModelUIOption:(t,e)=>{t.addNewModelUIOption=e.payload}}}),{setActiveTab:pH,setCurrentTheme:gH,setParametersPanelScrollPosition:mH,setShouldHoldParametersPanelOpen:vH,setShouldPinParametersPanel:yH,setShouldShowParametersPanel:SH,setShouldShowImageDetails:_H,setShouldUseCanvasBetaLayout:wH,setShouldShowExistingModelsInSearch:bH,setShouldUseSliders:CH,setAddNewModelUIOption:xH}=Ck.actions,wB=Ck.reducer,di=Object.create(null);di.open="0";di.close="1";di.ping="2";di.pong="3";di.message="4";di.upgrade="5";di.noop="6";const pd=Object.create(null);Object.keys(di).forEach(t=>{pd[di[t]]=t});const bB={type:"error",data:"parser error"},CB=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",xB=typeof ArrayBuffer=="function",kB=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,xk=({type:t,data:e},n,r)=>CB&&e instanceof Blob?n?r(e):fb(e,r):xB&&(e instanceof ArrayBuffer||kB(e))?n?r(e):fb(new Blob([e]),r):r(di[t]+(e||"")),fb=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)},db="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",eu=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<db.length;t++)eu[db.charCodeAt(t)]=t;const EB=t=>{let e=t.length*.75,n=t.length,r,i=0,a,s,u,c;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const f=new ArrayBuffer(e),h=new Uint8Array(f);for(r=0;r<n;r+=4)a=eu[t.charCodeAt(r)],s=eu[t.charCodeAt(r+1)],u=eu[t.charCodeAt(r+2)],c=eu[t.charCodeAt(r+3)],h[i++]=a<<2|s>>4,h[i++]=(s&15)<<4|u>>2,h[i++]=(u&3)<<6|c&63;return f},PB=typeof ArrayBuffer=="function",kk=(t,e)=>{if(typeof t!="string")return{type:"message",data:Ek(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:OB(t.substring(1),e)}:pd[n]?t.length>1?{type:pd[n],data:t.substring(1)}:{type:pd[n]}:bB},OB=(t,e)=>{if(PB){const n=EB(t);return Ek(n,e)}else return{base64:!0,data:t}},Ek=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}},Pk=String.fromCharCode(30),TB=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((a,s)=>{xk(a,!1,u=>{r[s]=u,++i===n&&e(r.join(Pk))})})},RB=(t,e)=>{const n=t.split(Pk),r=[];for(let i=0;i<n.length;i++){const a=kk(n[i],e);if(r.push(a),a.type==="error")break}return r},Ok=4;function Rt(t){if(t)return AB(t)}function AB(t){for(var e in Rt.prototype)t[e]=Rt.prototype[e];return t}Rt.prototype.on=Rt.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};Rt.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};Rt.prototype.off=Rt.prototype.removeListener=Rt.prototype.removeAllListeners=Rt.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this};Rt.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this};Rt.prototype.emitReserved=Rt.prototype.emit;Rt.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};Rt.prototype.hasListeners=function(t){return!!this.listeners(t).length};const fr=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Tk(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const IB=fr.setTimeout,LB=fr.clearTimeout;function Jh(t,e){e.useNativeTimers?(t.setTimeoutFn=IB.bind(fr),t.clearTimeoutFn=LB.bind(fr)):(t.setTimeoutFn=fr.setTimeout.bind(fr),t.clearTimeoutFn=fr.clearTimeout.bind(fr))}const MB=1.33;function DB(t){return typeof t=="string"?NB(t):Math.ceil((t.byteLength||t.size)*MB)}function NB(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}class BB extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class Rk extends Rt{constructor(e){super(),this.writable=!1,Jh(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,n,r){return super.emitReserved("error",new BB(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=kk(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}}const Ak="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Yv=64,FB={};let hb=0,Lf=0,pb;function gb(t){let e="";do e=Ak[t%Yv]+e,t=Math.floor(t/Yv);while(t>0);return e}function Ik(){const t=gb(+new Date);return t!==pb?(hb=0,pb=t):t+"."+gb(hb++)}for(;Lf<Yv;Lf++)FB[Ak[Lf]]=Lf;function Lk(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function $B(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let a=n[r].split("=");e[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e}let Mk=!1;try{Mk=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const zB=Mk;function Dk(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||zB))return new XMLHttpRequest}catch{}if(!e)try{return new fr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function GB(){}const UB=function(){return new Dk({xdomain:!1}).responseType!=null}();class jB extends Rk{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||i!==e.port,this.xs=e.secure!==r}const n=e&&e.forceBase64;this.supportsBinary=UB&&!n}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};RB(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,TB(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=Ik()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=Lk(e),a=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(a?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new ui(this.uri(),e)}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}class ui extends Rt{constructor(e,n){super(),Jh(this,n),this.opts=n,this.method=n.method||"GET",this.uri=e,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const e=Tk(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const n=this.xhr=new Dk(e);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=ui.requestsCount++,ui.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=GB,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete ui.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}ui.requestsCount=0;ui.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",mb);else if(typeof addEventListener=="function"){const t="onpagehide"in fr?"pagehide":"unload";addEventListener(t,mb,!1)}}function mb(){for(let t in ui.requests)ui.requests.hasOwnProperty(t)&&ui.requests[t].abort()}const Nk=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),Mf=fr.WebSocket||fr.MozWebSocket,vb=!0,HB="arraybuffer",yb=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class WB extends Rk{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),n=this.opts.protocols,r=yb?{}:Tk(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=vb&&!yb?n?new Mf(e,n):new Mf(e):new Mf(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||HB,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;xk(r,this.supportsBinary,a=>{const s={};try{vb&&this.ws.send(a)}catch{}i&&Nk(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=Ik()),this.supportsBinary||(e.b64=1);const i=Lk(e),a=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(a?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Mf}}const VB={websocket:WB,polling:jB},qB=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,KB=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Xv(t){const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=qB.exec(t||""),a={},s=14;for(;s--;)a[KB[s]]=i[s]||"";return n!=-1&&r!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=YB(a,a.path),a.queryKey=XB(a,a.query),a}function YB(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function XB(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,a){i&&(n[i]=a)}),n}let Bk=class os extends Rt{constructor(e,n={}){super(),this.writeBuffer=[],e&&typeof e=="object"&&(n=e,e=null),e?(e=Xv(e),n.hostname=e.host,n.secure=e.protocol==="https"||e.protocol==="wss",n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=Xv(n.host).host),Jh(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=$B(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=Ok,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[e],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new VB[e](r)}open(){let e;if(this.opts.rememberUpgrade&&os.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(e){let n=this.createTransport(e),r=!1;os.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",p=>{if(!r)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;os.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=n.name,this.emitReserved("upgradeError",g)}}))};function a(){r||(r=!0,h(),n.close(),n=null)}const s=p=>{const g=new Error("probe error: "+p);g.transport=n.name,a(),this.emitReserved("upgradeError",g)};function u(){s("transport closed")}function c(){s("socket closed")}function f(p){n&&p.name!==n.name&&a()}const h=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",u),this.off("close",c),this.off("upgrading",f)};n.once("open",i),n.once("error",s),n.once("close",u),this.once("close",c),this.once("upgrading",f),n.open()}onOpen(){if(this.readyState="open",os.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const n=this.upgrades.length;for(;e<n;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=e.data,this.onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=DB(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(e,n,r){return this.sendPacket("message",e,n,r),this}send(e,n,r){return this.sendPacket("message",e,n,r),this}sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const a={type:e,data:n,options:r};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){os.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const n=[];let r=0;const i=e.length;for(;r<i;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}};Bk.protocol=Ok;function QB(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=Xv(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const a=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port+e,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}const JB=typeof ArrayBuffer=="function",ZB=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,Fk=Object.prototype.toString,eF=typeof Blob=="function"||typeof Blob<"u"&&Fk.call(Blob)==="[object BlobConstructor]",tF=typeof File=="function"||typeof File<"u"&&Fk.call(File)==="[object FileConstructor]";function T0(t){return JB&&(t instanceof ArrayBuffer||ZB(t))||eF&&t instanceof Blob||tF&&t instanceof File}function gd(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(gd(t[n]))return!0;return!1}if(T0(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return gd(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&gd(t[n]))return!0;return!1}function nF(t){const e=[],n=t.data,r=t;return r.data=Qv(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Qv(t,e){if(!t)return t;if(T0(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Qv(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=Qv(t[r],e));return n}return t}function rF(t,e){return t.data=Jv(t.data,e),delete t.attachments,t}function Jv(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Jv(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Jv(t[n],e));return t}const iF=5;var Be;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(Be||(Be={}));class aF{constructor(e){this.replacer=e}encode(e){return(e.type===Be.EVENT||e.type===Be.ACK)&&gd(e)?this.encodeAsBinary({type:e.type===Be.EVENT?Be.BINARY_EVENT:Be.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===Be.BINARY_EVENT||e.type===Be.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=nF(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class R0 extends Rt{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===Be.BINARY_EVENT;r||n.type===Be.BINARY_ACK?(n.type=r?Be.EVENT:Be.ACK,this.reconstructor=new oF(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(T0(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(Be[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Be.BINARY_EVENT||r.type===Be.BINARY_ACK){const a=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const s=e.substring(a,n);if(s!=Number(s)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(e.charAt(n+1)==="/"){const a=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(a,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const a=n+1;for(;++n;){const s=e.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===e.length)break}r.id=Number(e.substring(a,n+1))}if(e.charAt(++n)){const a=this.tryParse(e.substr(n));if(R0.isPayloadValid(r.type,a))r.data=a;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case Be.CONNECT:return typeof n=="object";case Be.DISCONNECT:return n===void 0;case Be.CONNECT_ERROR:return typeof n=="string"||typeof n=="object";case Be.EVENT:case Be.BINARY_EVENT:return Array.isArray(n)&&n.length>0;case Be.ACK:case Be.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class oF{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=rF(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const sF=Object.freeze(Object.defineProperty({__proto__:null,Decoder:R0,Encoder:aF,get PacketType(){return Be},protocol:iF},Symbol.toStringTag,{value:"Module"}));function Dr(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const lF=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class $k extends Rt{constructor(e,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Dr(e,"open",this.onopen.bind(this)),Dr(e,"packet",this.onpacket.bind(this)),Dr(e,"error",this.onerror.bind(this)),Dr(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){if(lF.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:Be.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,u=n.pop();this._registerAckCallback(s,u),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=n;return}const a=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===e&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i);this.acks[e]=(...s)=>{this.io.clearTimeoutFn(a),n.apply(this,[null,...s])}}emitWithAck(e,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,a)=>{n.push((s,u)=>r?s?a(s):i(u):i(s)),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...a)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...a)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Be.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Be.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Be.EVENT:case Be.BINARY_EVENT:this.onevent(e);break;case Be.ACK:case Be.BINARY_ACK:this.onack(e);break;case Be.DISCONNECT:this.ondisconnect();break;case Be.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Be.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(n.apply(this,e.data),delete this.acks[e.id])}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Be.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function Vs(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Vs.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0};Vs.prototype.reset=function(){this.attempts=0};Vs.prototype.setMin=function(t){this.ms=t};Vs.prototype.setMax=function(t){this.max=t};Vs.prototype.setJitter=function(t){this.jitter=t};class Zv extends Rt{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Jh(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Vs({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||sF;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Bk(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Dr(n,"open",function(){r.onopen(),e&&e()}),a=Dr(n,"error",s=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",s),e?e(s):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const s=this._timeout;s===0&&i();const u=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},s);this.opts.autoUnref&&u.unref(),this.subs.push(function(){clearTimeout(u)})}return this.subs.push(i),this.subs.push(a),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Dr(e,"ping",this.onping.bind(this)),Dr(e,"data",this.ondata.bind(this)),Dr(e,"error",this.onerror.bind(this)),Dr(e,"close",this.onclose.bind(this)),Dr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){Nk(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new $k(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Gl={};function md(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=QB(t,e.path||"/socket.io"),r=n.source,i=n.id,a=n.path,s=Gl[i]&&a in Gl[i].nsps,u=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let c;return u?c=new Zv(r,e):(Gl[i]||(Gl[i]=new Zv(r,e)),c=Gl[i]),n.query&&!e.query&&(e.query=n.queryKey),c.socket(n.path,e)}Object.assign(md,{Manager:Zv,Socket:$k,io:md,connect:md});const kH=["ddim","plms","k_lms","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_dpmpp_2_a","k_euler","k_euler_a","k_heun"],EH=["ddim","plms","k_lms","dpmpp_2","k_dpm_2","k_dpm_2_a","k_dpmpp_2","k_euler","k_euler_a","k_heun"],PH=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],OH=[64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1024,1088,1152,1216,1280,1344,1408,1472,1536,1600,1664,1728,1792,1856,1920,1984,2048],TH=[{key:"2x",value:2},{key:"4x",value:4}],uF=0,cF=4294967295,RH=["gfpgan","codeformer"],AH=[{key:"None",value:"none"},{key:"Fast",value:"latents"},{key:"Accurate",value:"full-res"}];var fF=Math.PI/180;function dF(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Os=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},pe={_global:Os,version:"8.4.2",isBrowser:dF(),isUnminified:/param/.test(function(t){}.toString()),dblClickWindow:400,getAngle(t){return pe.angleDeg?t*fF:t},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,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return pe.DD.isDragging},isDragReady(){return!!pe.DD.node},releaseCanvasOnDestroy:!0,document:Os.document,_injectGlobal(t){Os.Konva=t}},yt=t=>{pe[t.prototype.getClassName()]=t};pe._injectGlobal(pe);class Hn{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.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 Hn(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var n=this.m;return{x:n[0]*e.x+n[2]*e.y+n[4],y:n[1]*e.x+n[3]*e.y+n[5]}}translate(e,n){return this.m[4]+=this.m[0]*e+this.m[2]*n,this.m[5]+=this.m[1]*e+this.m[3]*n,this}scale(e,n){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=n,this.m[3]*=n,this}rotate(e){var n=Math.cos(e),r=Math.sin(e),i=this.m[0]*n+this.m[2]*r,a=this.m[1]*n+this.m[3]*r,s=this.m[0]*-r+this.m[2]*n,u=this.m[1]*-r+this.m[3]*n;return this.m[0]=i,this.m[1]=a,this.m[2]=s,this.m[3]=u,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,n){var r=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,a=this.m[2]+this.m[0]*e,s=this.m[3]+this.m[1]*e;return this.m[0]=r,this.m[1]=i,this.m[2]=a,this.m[3]=s,this}multiply(e){var n=this.m[0]*e.m[0]+this.m[2]*e.m[1],r=this.m[1]*e.m[0]+this.m[3]*e.m[1],i=this.m[0]*e.m[2]+this.m[2]*e.m[3],a=this.m[1]*e.m[2]+this.m[3]*e.m[3],s=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],u=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this.m[4]=s,this.m[5]=u,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*e,r=-this.m[1]*e,i=-this.m[2]*e,a=this.m[0]*e,s=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),u=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this.m[4]=s,this.m[5]=u,this}getMatrix(){return this.m}decompose(){var e=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],a=this.m[4],s=this.m[5],u=e*i-n*r;let c={x:a,y:s,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||n!=0){var f=Math.sqrt(e*e+n*n);c.rotation=n>0?Math.acos(e/f):-Math.acos(e/f),c.scaleX=f,c.scaleY=u/f,c.skewX=(e*r+n*i)/u,c.skewY=0}else if(r!=0||i!=0){var h=Math.sqrt(r*r+i*i);c.rotation=Math.PI/2-(i>0?Math.acos(-r/h):-Math.acos(r/h)),c.scaleX=u/h,c.scaleY=h,c.skewX=0,c.skewY=(e*r+n*i)/u}return c.rotation=G._getRotation(c.rotation),c}}var hF="[object Array]",pF="[object Number]",gF="[object String]",mF="[object Boolean]",vF=Math.PI/180,yF=180/Math.PI,Em="#",SF="",_F="0",wF="Konva warning: ",Sb="Konva error: ",bF="rgb(",Pm={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]},CF=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Df=[];const xF=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(t){setTimeout(t,60)},G={_isElement(t){return!!(t&&t.nodeType==1)},_isFunction(t){return!!(t&&t.constructor&&t.call&&t.apply)},_isPlainObject(t){return!!t&&t.constructor===Object},_isArray(t){return Object.prototype.toString.call(t)===hF},_isNumber(t){return Object.prototype.toString.call(t)===pF&&!isNaN(t)&&isFinite(t)},_isString(t){return Object.prototype.toString.call(t)===gF},_isBoolean(t){return Object.prototype.toString.call(t)===mF},isObject(t){return t instanceof Object},isValidSelector(t){if(typeof t!="string")return!1;var e=t[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(t){return t===0||t>0?1:-1},requestAnimFrame(t){Df.push(t),Df.length===1&&xF(function(){const e=Df;Df=[],e.forEach(function(n){n()})})},createCanvasElement(){var t=document.createElement("canvas");try{t.style=t.style||{}}catch{}return t},createImageElement(){return document.createElement("img")},_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){var n=G.createImageElement();n.onload=function(){e(n)},n.src=t},_rgbToHex(t,e,n){return((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)},_hexToRgb(t){t=t.replace(Em,SF);var e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){for(var t=(Math.random()*16777215<<0).toString(16);t.length<6;)t=_F+t;return Em+t},getRGB(t){var e;return t in Pm?(e=Pm[t],{r:e[0],g:e[1],b:e[2]}):t[0]===Em?this._hexToRgb(t.substring(1)):t.substr(0,4)===bF?(e=CF.exec(t.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(t){return t=t||"black",G._namedColorToRBA(t)||G._hex3ColorToRGBA(t)||G._hex4ColorToRGBA(t)||G._hex6ColorToRGBA(t)||G._hex8ColorToRGBA(t)||G._rgbColorToRGBA(t)||G._rgbaColorToRGBA(t)||G._hslColorToRGBA(t)},_namedColorToRBA(t){var e=Pm[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(t){if(t.indexOf("rgb(")===0){t=t.match(/rgb\(([^)]+)\)/)[1];var e=t.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(t){if(t.indexOf("rgba(")===0){t=t.match(/rgba\(([^)]+)\)/)[1];var e=t.split(/ *, */).map((n,r)=>n.slice(-1)==="%"?r===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(t){if(t[0]==="#"&&t.length===9)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:parseInt(t.slice(7,9),16)/255}},_hex6ColorToRGBA(t){if(t[0]==="#"&&t.length===7)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex4ColorToRGBA(t){if(t[0]==="#"&&t.length===5)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:parseInt(t[4]+t[4],16)/255}},_hex3ColorToRGBA(t){if(t[0]==="#"&&t.length===4)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){const[e,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),r=Number(n[0])/360,i=Number(n[1])/100,a=Number(n[2])/100;let s,u,c;if(i===0)return c=a*255,{r:Math.round(c),g:Math.round(c),b:Math.round(c),a:1};a<.5?s=a*(1+i):s=a+i-a*i;const f=2*a-s,h=[0,0,0];for(let p=0;p<3;p++)u=r+1/3*-(p-1),u<0&&u++,u>1&&u--,6*u<1?c=f+(s-f)*6*u:2*u<1?c=s:3*u<2?c=f+(s-f)*(2/3-u)*6:c=f,h[p]=c*255;return{r:Math.round(h[0]),g:Math.round(h[1]),b:Math.round(h[2]),a:1}}},haveIntersection(t,e){return!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y)},cloneObject(t){var e={};for(var n in t)this._isPlainObject(t[n])?e[n]=this.cloneObject(t[n]):this._isArray(t[n])?e[n]=this.cloneArray(t[n]):e[n]=t[n];return e},cloneArray(t){return t.slice(0)},degToRad(t){return t*vF},radToDeg(t){return t*yF},_degToRad(t){return G.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),G.degToRad(t)},_radToDeg(t){return G.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),G.radToDeg(t)},_getRotation(t){return pe.angleDeg?G.radToDeg(t):t},_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw(t){throw new Error(Sb+t)},error(t){console.error(Sb+t)},warn(t){pe.showWarnings&&console.warn(wF+t)},each(t,e){for(var n in t)e(n,t[n])},_inRange(t,e,n){return e<=t&&t<n},_getProjectionToSegment(t,e,n,r,i,a){var s,u,c,f=(t-n)*(t-n)+(e-r)*(e-r);if(f==0)s=t,u=e,c=(i-n)*(i-n)+(a-r)*(a-r);else{var h=((i-t)*(n-t)+(a-e)*(r-e))/f;h<0?(s=t,u=e,c=(t-i)*(t-i)+(e-a)*(e-a)):h>1?(s=n,u=r,c=(n-i)*(n-i)+(r-a)*(r-a)):(s=t+h*(n-t),u=e+h*(r-e),c=(s-i)*(s-i)+(u-a)*(u-a))}return[s,u,c]},_getProjectionToLine(t,e,n){var r=G.cloneObject(t),i=Number.MAX_VALUE;return e.forEach(function(a,s){if(!(!n&&s===e.length-1)){var u=e[(s+1)%e.length],c=G._getProjectionToSegment(a.x,a.y,u.x,u.y,t.x,t.y),f=c[0],h=c[1],p=c[2];p<i&&(r.x=f,r.y=h,i=p)}}),r},_prepareArrayForTween(t,e,n){var r,i=[],a=[];if(t.length>e.length){var s=e;e=t,t=s}for(r=0;r<t.length;r+=2)i.push({x:t[r],y:t[r+1]});for(r=0;r<e.length;r+=2)a.push({x:e[r],y:e[r+1]});var u=[];return a.forEach(function(c){var f=G._getProjectionToLine(c,i,n);u.push(f.x),u.push(f.y)}),u},_prepareToStringify(t){var e;t.visitedByCircularReferenceRemoval=!0;for(var n in t)if(t.hasOwnProperty(n)&&t[n]&&typeof t[n]=="object"){if(e=Object.getOwnPropertyDescriptor(t,n),t[n].visitedByCircularReferenceRemoval||G._isElement(t[n]))if(e.configurable)delete t[n];else return null;else if(G._prepareToStringify(t[n])===null)if(e.configurable)delete t[n];else return null}return delete t.visitedByCircularReferenceRemoval,t},_assign(t,e){for(var n in e)t[n]=e[n];return t},_getFirstPointerId(t){return t.touches?t.changedTouches[0].identifier:t.pointerId||999},releaseCanvas(...t){pe.releaseCanvasOnDestroy&&t.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(t,e,n,r){let i=0,a=0,s=0,u=0;typeof r=="number"?i=a=s=u=Math.min(r,e/2,n/2):(i=Math.min(r[0]||0,e/2,n/2),a=Math.min(r[1]||0,e/2,n/2),u=Math.min(r[2]||0,e/2,n/2),s=Math.min(r[3]||0,e/2,n/2)),t.moveTo(i,0),t.lineTo(e-a,0),t.arc(e-a,a,a,Math.PI*3/2,0,!1),t.lineTo(e,n-u),t.arc(e-u,n-u,u,0,Math.PI/2,!1),t.lineTo(s,n),t.arc(s,n-s,s,Math.PI/2,Math.PI,!1),t.lineTo(0,i),t.arc(i,i,i,Math.PI,Math.PI*3/2,!1)}};function Da(t){return G._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||G._isBoolean(t)?t:Object.prototype.toString.call(t)}function zk(t){return t>255?255:t<0?0:Math.round(t)}function le(){if(pe.isUnminified)return function(t,e){return G._isNumber(t)||G.warn(Da(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function A0(t){if(pe.isUnminified)return function(e,n){let r=G._isNumber(e),i=G._isArray(e)&&e.length==t;return!r&&!i&&G.warn(Da(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function I0(){if(pe.isUnminified)return function(t,e){var n=G._isNumber(t),r=t==="auto";return n||r||G.warn(Da(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function qs(){if(pe.isUnminified)return function(t,e){return G._isString(t)||G.warn(Da(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function Gk(){if(pe.isUnminified)return function(t,e){const n=G._isString(t),r=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||r||G.warn(Da(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function kF(){if(pe.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(G._isArray(t)?t.forEach(function(r){G._isNumber(r)||G.warn('"'+e+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):G.warn(Da(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function jr(){if(pe.isUnminified)return function(t,e){var n=t===!0||t===!1;return n||G.warn(Da(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function EF(t){if(pe.isUnminified)return function(e,n){return e==null||G.isObject(e)||G.warn(Da(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}var Ul="get",jl="set";const A={addGetterSetter(t,e,n,r,i){A.addGetter(t,e,n),A.addSetter(t,e,r,i),A.addOverloadedGetterSetter(t,e)},addGetter(t,e,n){var r=Ul+G._capitalize(e);t.prototype[r]=t.prototype[r]||function(){var i=this.attrs[e];return i===void 0?n:i}},addSetter(t,e,n,r){var i=jl+G._capitalize(e);t.prototype[i]||A.overWriteSetter(t,e,n,r)},overWriteSetter(t,e,n,r){var i=jl+G._capitalize(e);t.prototype[i]=function(a){return n&&a!==void 0&&a!==null&&(a=n.call(this,a,e)),this._setAttr(e,a),r&&r.call(this),this}},addComponentsGetterSetter(t,e,n,r,i){var a=n.length,s=G._capitalize,u=Ul+s(e),c=jl+s(e),f,h;t.prototype[u]=function(){var g={};for(f=0;f<a;f++)h=n[f],g[h]=this.getAttr(e+s(h));return g};var p=EF(n);t.prototype[c]=function(g){var y=this.attrs[e],v;r&&(g=r.call(this,g)),p&&p.call(this,g,e);for(v in g)g.hasOwnProperty(v)&&this._setAttr(e+s(v),g[v]);return g||n.forEach(w=>{this._setAttr(e+s(w),void 0)}),this._fireChangeEvent(e,y,g),i&&i.call(this),this},A.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){var n=G._capitalize(e),r=jl+n,i=Ul+n;t.prototype[e]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(t,e,n,r){G.error("Adding deprecated "+e);var i=Ul+G._capitalize(e),a=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[i]=function(){G.error(a);var s=this.attrs[e];return s===void 0?n:s},A.addSetter(t,e,r,function(){G.error(a)}),A.addOverloadedGetterSetter(t,e)},backCompat(t,e){G.each(e,function(n,r){var i=t.prototype[r],a=Ul+G._capitalize(n),s=jl+G._capitalize(n);function u(){i.apply(this,arguments),G.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}t.prototype[n]=u,t.prototype[a]=u,t.prototype[s]=u})},afterSetFilter(){this._filterUpToDate=!1}};function PF(t){var e=[],n=t.length,r=G,i,a;for(i=0;i<n;i++)a=t[i],r._isNumber(a)?a=Math.round(a*1e3)/1e3:r._isString(a)||(a=a+""),e.push(a);return e}var _b=",",OF="(",TF=")",RF="([",AF="])",IF=";",LF="()",MF="=",wb=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],DF=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const NF=100;class Zh{constructor(e){this.canvas=e,pe.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){var r=this.traceArr,i=r.length,a="",s,u,c,f;for(s=0;s<i;s++)u=r[s],c=u.method,c?(f=u.args,a+=c,e?a+=LF:G._isArray(f[0])?a+=RF+f.join(_b)+AF:(n&&(f=f.map(h=>typeof h=="number"?Math.floor(h):h)),a+=OF+f.join(_b)+TF)):(a+=u.property,e||(a+=MF+u.val)),a+=IF;return a}clearTrace(){this.traceArr=[]}_trace(e){var n=this.traceArr,r;n.push(e),r=n.length,r>=NF&&n.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var 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){var n=e.getLineCap();n&&this.setAttr("lineCap",n)}_applyOpacity(e){var n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){var n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(e,n){this._context[e]=n}arc(e,n,r,i,a,s){this._context.arc(e,n,r,i,a,s)}arcTo(e,n,r,i,a){this._context.arcTo(e,n,r,i,a)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,r,i,a,s){this._context.bezierCurveTo(e,n,r,i,a,s)}clearRect(e,n,r,i){this._context.clearRect(e,n,r,i)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,n){var 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,a,s){return this._context.createRadialGradient(e,n,r,i,a,s)}drawImage(e,n,r,i,a,s,u,c,f){var h=arguments,p=this._context;h.length===3?p.drawImage(e,n,r):h.length===5?p.drawImage(e,n,r,i,a):h.length===9&&p.drawImage(e,n,r,i,a,s,u,c,f)}ellipse(e,n,r,i,a,s,u,c){this._context.ellipse(e,n,r,i,a,s,u,c)}isPointInPath(e,n,r,i){return r?this._context.isPointInPath(r,e,n,i):this._context.isPointInPath(e,n,i)}fill(e){e?this._context.fill(e):this._context.fill()}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)}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,a,s){this._context.setTransform(e,n,r,i,a,s)}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,a,s){this._context.transform(e,n,r,i,a,s)}translate(e,n){this._context.translate(e,n)}_enableTrace(){var e=this,n=wb.length,r=this.setAttr,i,a,s=function(u){var c=e[u],f;e[u]=function(){return a=PF(Array.prototype.slice.call(arguments,0)),f=c.apply(e,arguments),e._trace({method:u,args:a}),f}};for(i=0;i<n;i++)s(wb[i]);e.setAttr=function(){r.apply(e,arguments);var u=arguments[0],c=arguments[1];(u==="shadowOffsetX"||u==="shadowOffsetY"||u==="shadowBlur")&&(c=c/this.canvas.getPixelRatio()),e._trace({property:u,val:c})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;var r=!n||n==="source-over";r||this.setAttr("globalCompositeOperation",n)}}DF.forEach(function(t){Object.defineProperty(Zh.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class BF extends Zh{constructor(e){super(e),this._context=e._canvas.getContext("2d")}_fillColor(e){var n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){var n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){var n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){var n=e.fill(),r=e.getFillPriority();if(n&&r==="color"){this._fillColor(e);return}var i=e.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(e);return}var a=e.getFillLinearGradientColorStops();if(a&&r==="linear-gradient"){this._fillLinearGradient(e);return}var s=e.getFillRadialGradientColorStops();if(s&&r==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):i?this._fillPattern(e):a?this._fillLinearGradient(e):s&&this._fillRadialGradient(e)}_strokeLinearGradient(e){var n=e.getStrokeLinearGradientStartPoint(),r=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),a=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(var s=0;s<i.length;s+=2)a.addColorStop(i[s],i[s+1]);this.setAttr("strokeStyle",a)}}_stroke(e){var n=e.dash(),r=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!r){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,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)");var a=e.getStrokeLinearGradientColorStops();a?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),r||this.restore()}}_applyShadow(e){var n,r,i,a=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",s=(r=e.getShadowBlur())!==null&&r!==void 0?r:5,u=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},c=e.getAbsoluteScale(),f=this.canvas.getPixelRatio(),h=c.x*f,p=c.y*f;this.setAttr("shadowColor",a),this.setAttr("shadowBlur",s*Math.min(Math.abs(h),Math.abs(p))),this.setAttr("shadowOffsetX",u.x*h),this.setAttr("shadowOffsetY",u.y*p)}}class FF extends Zh{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()){var n=e.getStrokeScaleEnabled();if(!n){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(e);var i=e.hitStrokeWidth(),a=i==="auto"?e.strokeWidth():i;this.setAttr("lineWidth",a),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}var Nf;function $F(){if(Nf)return Nf;var t=G.createCanvasElement(),e=t.getContext("2d");return Nf=function(){var n=pe._global.devicePixelRatio||1,r=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/r}(),G.releaseCanvas(t),Nf}class ep{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=e||{},r=n.pixelRatio||pe.pixelRatio||$F();this.pixelRatio=r,this._canvas=G.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){var 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";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";var n=this.pixelRatio,r=this.getContext()._context;r.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 G.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}A.addGetterSetter(ep,"pixelRatio",void 0,le());class Ts extends ep{constructor(e={width:0,height:0}){super(e),this.context=new BF(this),this.setSize(e.width,e.height)}}class L0 extends ep{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new FF(this),this.setSize(e.width,e.height)}}const Ge={get isDragging(){var t=!1;return Ge._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(t=!0)}),t},justDragged:!1,get node(){var t;return Ge._dragElements.forEach(e=>{t=e.node}),t},_dragElements:new Map,_drag(t){const e=[];Ge._dragElements.forEach((n,r)=>{const{node:i}=n,a=i.getStage();a.setPointersPositions(t),n.pointerId===void 0&&(n.pointerId=G._getFirstPointerId(t));const s=a._changedPointerPositions.find(f=>f.id===n.pointerId);if(s){if(n.dragStatus!=="dragging"){var u=i.dragDistance(),c=Math.max(Math.abs(s.x-n.startPointerPos.x),Math.abs(s.y-n.startPointerPos.y));if(c<u||(i.startDrag({evt:t}),!i.isDragging()))return}i._setDragPosition(t,n),e.push(i)}}),e.forEach(n=>{n.fire("dragmove",{type:"dragmove",target:n,evt:t},!0)})},_endDragBefore(t){const e=[];Ge._dragElements.forEach(n=>{const{node:r}=n,i=r.getStage();if(t&&i.setPointersPositions(t),!i._changedPointerPositions.find(u=>u.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(Ge.justDragged=!0,pe._mouseListenClick=!1,pe._touchListenClick=!1,pe._pointerListenClick=!1,n.dragStatus="stopped");const s=n.node.getLayer()||n.node instanceof pe.Stage&&n.node;s&&e.indexOf(s)===-1&&e.push(s)}),e.forEach(n=>{n.draw()})},_endDragAfter(t){Ge._dragElements.forEach((e,n)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t},!0),e.dragStatus!=="dragging"&&Ge._dragElements.delete(n)})}};pe.isBrowser&&(window.addEventListener("mouseup",Ge._endDragBefore,!0),window.addEventListener("touchend",Ge._endDragBefore,!0),window.addEventListener("mousemove",Ge._drag),window.addEventListener("touchmove",Ge._drag),window.addEventListener("mouseup",Ge._endDragAfter,!1),window.addEventListener("touchend",Ge._endDragAfter,!1));var vd="absoluteOpacity",Bf="allEventListeners",Ii="absoluteTransform",bb="absoluteScale",Xa="canvas",zF="Change",GF="children",UF="konva",ey="listening",Cb="mouseenter",xb="mouseleave",kb="set",Eb="Shape",yd=" ",Pb="stage",ua="transform",jF="Stage",ty="visible",HF=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(yd);let WF=1;class se{constructor(e){this._id=WF++,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===ua||e===Ii)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){var r=this._cache.get(e),i=e===ua||e===Ii,a=r===void 0||i&&r.dirty===!0;return a&&(r=n.call(this),this._cache.set(e,r)),r}_calculate(e,n,r){if(!this._attachedDepsListeners.get(e)){const i=n.map(a=>a+"Change.konva").join(yd);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,r)}_getCanvasCache(){return this._cache.get(Xa)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===Ii&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Xa)){const{scene:e,filter:n,hit:r}=this._cache.get(Xa);G.releaseCanvas(e,n,r),this._cache.delete(Xa)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var n=e||{},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()}));var i=Math.ceil(n.width||r.width),a=Math.ceil(n.height||r.height),s=n.pixelRatio,u=n.x===void 0?Math.floor(r.x):n.x,c=n.y===void 0?Math.floor(r.y):n.y,f=n.offset||0,h=n.drawBorder||!1,p=n.hitCanvasPixelRatio||1;if(!i||!a){G.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=f*2+1,a+=f*2+1,u-=f,c-=f;var g=new Ts({pixelRatio:s,width:i,height:a}),y=new Ts({pixelRatio:s,width:0,height:0}),v=new L0({pixelRatio:p,width:i,height:a}),w=g.getContext(),x=v.getContext();return v.isCache=!0,g.isCache=!0,this._cache.delete(Xa),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(g.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),w.save(),x.save(),w.translate(-u,-c),x.translate(-u,-c),this._isUnderCache=!0,this._clearSelfAndDescendantCache(vd),this._clearSelfAndDescendantCache(bb),this.drawScene(g,this),this.drawHit(v,this),this._isUnderCache=!1,w.restore(),x.restore(),h&&(w.save(),w.beginPath(),w.rect(0,0,i,a),w.closePath(),w.setAttr("strokeStyle","red"),w.setAttr("lineWidth",5),w.stroke(),w.restore()),this._cache.set(Xa,{scene:g,filter:y,hit:v,x:u,y:c}),this._requestDraw(),this}isCached(){return this._cache.has(Xa)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){var 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}],i,a,s,u,c=this.getAbsoluteTransform(n);return r.forEach(function(f){var h=c.point(f);i===void 0&&(i=s=h.x,a=u=h.y),i=Math.min(i,h.x),a=Math.min(a,h.y),s=Math.max(s,h.x),u=Math.max(u,h.y)}),{x:i,y:a,width:s-i,height:u-a}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;e.drawImage(r._canvas,0,0,r.width/i,r.height/i),e.restore()}_drawCachedHitCanvas(e){var 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(){var e=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,a=i.getContext(),s,u,c,f;if(e){if(!this._filterUpToDate){var h=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(s=e.length,a.clear(),a.drawImage(r._canvas,0,0,r.getWidth()/h,r.getHeight()/h),u=a.getImageData(0,0,i.getWidth(),i.getHeight()),c=0;c<s;c++){if(f=e[c],typeof f!="function"){G.error("Filter should be type of function, but got "+typeof f+" instead. Please check correct filters");continue}f.call(this,u),a.putImageData(u,0,0)}}catch(p){G.error("Unable to apply filter. "+p.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(Bf),arguments.length===3)return this._delegate.apply(this,arguments);var r=e.split(yd),i=r.length,a,s,u,c,f;for(a=0;a<i;a++)s=r[a],u=s.split("."),c=u[0],f=u[1]||"",this.eventListeners[c]||(this.eventListeners[c]=[]),this.eventListeners[c].push({name:f,handler:n});return this}off(e,n){var r=(e||"").split(yd),i=r.length,a,s,u,c,f,h;if(this._cache&&this._cache.delete(Bf),!e)for(s in this.eventListeners)this._off(s);for(a=0;a<i;a++)if(u=r[a],c=u.split("."),f=c[0],h=c[1],f)this.eventListeners[f]&&this._off(f,h,n);else for(s in this.eventListeners)this._off(s,h,n);return this}dispatchEvent(e){var 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){var i=this;this.on(e,function(a){for(var s=a.target.findAncestors(n,!0,i),u=0;u<s.length;u++)a=G.cloneObject(a),a.currentTarget=s[u],r.call(s[u],a)})}remove(){return this.isDragging()&&this.stopDrag(),Ge._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Ii),this._clearSelfAndDescendantCache(vd),this._clearSelfAndDescendantCache(bb),this._clearSelfAndDescendantCache(Pb),this._clearSelfAndDescendantCache(ty),this._clearSelfAndDescendantCache(ey)}_remove(){this._clearCaches();var 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){var n="get"+G._capitalize(e);return G._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){for(var e=this.getParent(),n=[];e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{var n,r;if(!e)return this;for(n in e)n!==GF&&(r=kb+G._capitalize(n),G._isFunction(this[r])?this[r](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(ey,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(ty,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);var r=this.getLayer(),i=!1;Ge._dragElements.forEach(s=>{s.dragStatus==="dragging"&&(s.node.nodeType==="Stage"||s.node.getLayer()===r)&&(i=!0)});var a=!n&&!pe.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!a}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e=this.getDepth(),n=this,r=0,i,a,s,u;function c(f){for(i=[],a=f.length,s=0;s<a;s++)u=f[s],r++,u.nodeType!==Eb&&(i=i.concat(u.getChildren().slice())),u._id===n._id&&(s=a);i.length>0&&i[0].getDepth()<=e&&c(i)}return n.nodeType!==jF&&c(n.getStage().getChildren()),r}getDepth(){for(var e=0,n=this.parent;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(ua),this._clearSelfAndDescendantCache(Ii)),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(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(e)}getAbsolutePosition(e){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!e&&(e=!0);var i=this.getAbsoluteTransform(e).getMatrix(),a=new Hn,s=this.offset();return a.m=i.slice(),a.translate(s.x,s.y),a.getTranslation()}setAbsolutePosition(e){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(ua);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(e.x,e.y),e={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:e.x,y:e.y}),this._clearCache(ua),this._clearSelfAndDescendantCache(Ii),this}_setTransform(e){var n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){var 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){var n=e.x,r=e.y,i=this.x(),a=this.y();return n!==void 0&&(i+=n),r!==void 0&&(a+=r),this.setPosition({x:i,y:a}),this}_eachAncestorReverse(e,n){var r=[],i=this.getParent(),a,s;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(a=r.length,s=0;s<a;s++)e(r[s])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return G.warn("Node has no parent. moveToTop function is ignored."),!1;var 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 G.warn("Node has no parent. moveUp function is ignored."),!1;var 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 G.warn("Node has no parent. moveDown function is ignored."),!1;var 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 G.warn("Node has no parent. moveToBottom function is ignored."),!1;var 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 G.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&G.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)+".");var 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(vd,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e={},n=this.getAttrs(),r,i,a,s,u;e.attrs={};for(r in n)i=n[r],u=G.isObject(i)&&!G._isPlainObject(i)&&!G._isArray(i),!u&&(a=typeof this[r]=="function"&&this[r],delete n[r],s=a?a.call(this):null,n[r]=i,s!==i&&(e.attrs[r]=i));return e.className=this.getClassName(),G._prepareToStringify(e)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,r){var i=[];n&&this._isMatch(e)&&i.push(this);for(var a=this.parent;a;){if(a===r)return i;a._isMatch(e)&&i.push(a),a=a.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);var n=e.replace(/ /g,"").split(","),r=n.length,i,a;for(i=0;i<r;i++)if(a=n[i],G.isValidSelector(a)||(G.warn('Selector "'+a+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),G.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),G.warn("Konva is awesome, right?")),a.charAt(0)==="#"){if(this.id()===a.slice(1))return!0}else if(a.charAt(0)==="."){if(this.hasName(a.slice(1)))return!0}else if(this.className===a||this.nodeType===a)return!0;return!1}getLayer(){var e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(Pb,this._getStage)}_getStage(){var e=this.getParent();if(e)return e.getStage()}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(Ii,this._getAbsoluteTransform)}_getAbsoluteTransform(e){var n;if(e)return n=new Hn,this._eachAncestorReverse(function(i){var a=i.transformsEnabled();a==="all"?n.multiply(i.getTransform()):a==="position"&&n.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},e),n;n=this._cache.get(Ii)||new Hn,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();var r=this.transformsEnabled();if(r==="all")n.multiply(this.getTransform());else if(r==="position"){const i=this.attrs.x||0,a=this.attrs.y||0,s=this.attrs.offsetX||0,u=this.attrs.offsetY||0;n.translate(i-s,a-u)}return n.dirty=!1,n}getAbsoluteScale(e){for(var n=this;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(ua,this._getTransform)}_getTransform(){var e,n,r=this._cache.get(ua)||new Hn;r.reset();var i=this.x(),a=this.y(),s=pe.getAngle(this.rotation()),u=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,c=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,f=this.attrs.skewX||0,h=this.attrs.skewY||0,p=this.attrs.offsetX||0,g=this.attrs.offsetY||0;return(i!==0||a!==0)&&r.translate(i,a),s!==0&&r.rotate(s),(f!==0||h!==0)&&r.skew(f,h),(u!==1||c!==1)&&r.scale(u,c),(p!==0||g!==0)&&r.translate(-1*p,-1*g),r.dirty=!1,r}clone(e){var n=G.cloneObject(this.attrs),r,i,a,s,u;for(r in e)n[r]=e[r];var c=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],a=i.length,s=0;s<a;s++)u=i[s],u.name.indexOf(UF)<0&&(c.eventListeners[r]||(c.eventListeners[r]=[]),c.eventListeners[r].push(u));return c}_toKonvaCanvas(e){e=e||{};var n=this.getClientRect(),r=this.getStage(),i=e.x!==void 0?e.x:Math.floor(n.x),a=e.y!==void 0?e.y:Math.floor(n.y),s=e.pixelRatio||1,u=new Ts({width:e.width||Math.ceil(n.width)||(r?r.width():0),height:e.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:s}),c=u.getContext();return e.imageSmoothingEnabled===!1&&(c._context.imageSmoothingEnabled=!1),c.save(),(i||a)&&c.translate(-1*i,-1*a),this.drawScene(u),c.restore(),u}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};var 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,G._urlToImage(this.toDataURL(e),function(a){n(a),i==null||i(a)})}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(a=>{n(a),i==null||i(a)})}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():pe.dragDistance}_off(e,n,r){var i=this.eventListeners[e],a,s,u;for(a=0;a<i.length;a++)if(s=i[a].name,u=i[a].handler,(s!=="konva"||n==="konva")&&(!n||s===n)&&(!r||r===u)){if(i.splice(a,1),i.length===0){delete this.eventListeners[e];break}a--}}_fireChangeEvent(e,n,r){this._fire(e+zF,{oldVal:n,newVal:r})}addName(e){if(!this.hasName(e)){var n=this.name(),r=n?n+" "+e:e;this.name(r)}return this}hasName(e){if(!e)return!1;const n=this.name();if(!n)return!1;var r=(n||"").split(/\s/g);return r.indexOf(e)!==-1}removeName(e){var 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){var r=this[kb+G._capitalize(e)];return G._isFunction(r)?r.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(pe.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){var r=this.attrs[e];r===n&&!G.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){var 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===Eb&&(n.target=this);var i=(e===Cb||e===xb)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!i){this._fire(e,n);var a=(e===Cb||e===xb)&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!a&&(r&&r.parent?this._fireAndBubble.call(this.parent,e,n,r):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){let n=this._cache.get(Bf);if(!n){n={};let i=Object.getPrototypeOf(this);for(;i;){if(!i.eventListeners){i=Object.getPrototypeOf(i);continue}for(var r in i.eventListeners){const a=i.eventListeners[r],s=n[r]||[];n[r]=a.concat(s)}i=Object.getPrototypeOf(i)}this._cache.set(Bf,n)}return n[e]}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const r=this._getProtoListeners(e);if(r)for(var i=0;i<r.length;i++)r[i].handler.call(this,n);const a=this.eventListeners[e];if(a)for(var i=0;i<a.length;i++)a[i].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){var n=e?e.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition(),a=r._getPointerById(n)||r._changedPointerPositions[0]||i;Ge._dragElements.set(this._id,{node:this,startPointerPos:a,offset:{x:a.x-i.x,y:a.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(e,n=!0){Ge._dragElements.has(this._id)||this._createDragElement(e);const r=Ge._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){var i={x:r.x-n.offset.x,y:r.y-n.offset.y},a=this.dragBoundFunc();if(a!==void 0){const s=a.call(this,i,e);s?i=s:G.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=Ge._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Ge._endDragBefore(e),Ge._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=Ge._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){var n=e.evt.button!==void 0,r=!n||pe.dragButtons.indexOf(e.evt.button)>=0;if(r&&!this.isDragging()){var i=!1;Ge._dragElements.forEach(a=>{this.isAncestorOf(a.node)&&(i=!0)}),i||this._createDragElement(e)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var e=this.getStage();if(!e)return;const n=Ge._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&Ge._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 G.haveIntersection(r,this.getClientRect())}static create(e,n){return G._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){var r=se.prototype.getClassName.call(e),i=e.children,a,s,u;n&&(e.attrs.container=n),pe[r]||(G.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const c=pe[r];if(a=new c(e.attrs),i)for(s=i.length,u=0;u<s;u++)a.add(se._createNode(i[u]));return a}}se.prototype.nodeType="Node";se.prototype._attrsAffectingSize=[];se.prototype.eventListeners={};se.prototype.on.call(se.prototype,HF,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(ua),this._clearSelfAndDescendantCache(Ii)});se.prototype.on.call(se.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(ty)});se.prototype.on.call(se.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(ey)});se.prototype.on.call(se.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(vd)});const it=A.addGetterSetter;it(se,"zIndex");it(se,"absolutePosition");it(se,"position");it(se,"x",0,le());it(se,"y",0,le());it(se,"globalCompositeOperation","source-over",qs());it(se,"opacity",1,le());it(se,"name","",qs());it(se,"id","",qs());it(se,"rotation",0,le());A.addComponentsGetterSetter(se,"scale",["x","y"]);it(se,"scaleX",1,le());it(se,"scaleY",1,le());A.addComponentsGetterSetter(se,"skew",["x","y"]);it(se,"skewX",0,le());it(se,"skewY",0,le());A.addComponentsGetterSetter(se,"offset",["x","y"]);it(se,"offsetX",0,le());it(se,"offsetY",0,le());it(se,"dragDistance",null,le());it(se,"width",0,le());it(se,"height",0,le());it(se,"listening",!0,jr());it(se,"preventDefault",!0,jr());it(se,"filters",null,function(t){return this._filterUpToDate=!1,t});it(se,"visible",!0,jr());it(se,"transformsEnabled","all",qs());it(se,"size");it(se,"dragBoundFunc");it(se,"draggable",!1,jr());A.backCompat(se,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class qn extends se{constructor(){super(...arguments),this.children=[]}getChildren(e){if(!e)return this.children||[];const n=this.children||[];var r=[];return n.forEach(function(i){e(i)&&r.push(i)}),r}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(var n=0;n<e.length;n++)this.add(e[n]);return this}const r=e[0];return r.getParent()?(r.moveTo(this),this):(this._validateAdd(r),r.index=this.getChildren().length,r.parent=this,r._clearCaches(),this.getChildren().push(r),this._fire("add",{child:r}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){var n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){var r=[];return this._descendants(i=>{const a=i._isMatch(e);return a&&r.push(i),!!(a&&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(){var e=se.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){for(var n=e.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){var n=se.prototype.clone.call(this,e);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(e){var n=[];return this.find("Shape").forEach(function(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){var r=this.getLayer(),i=e||r&&r.getCanvas(),a=i&&i.getContext(),s=this._getCanvasCache(),u=s&&s.scene,c=i&&i.isCache;if(!this.isVisible()&&!c)return this;if(u){a.save();var f=this.getAbsoluteTransform(n).getMatrix();a.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedSceneCanvas(a),a.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=e||r&&r.hitCanvas,a=i&&i.getContext(),s=this._getCanvasCache(),u=s&&s.hit;if(u){a.save();var c=this.getAbsoluteTransform(n).getMatrix();a.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(e,n,r){var i,a=n&&n.getContext(),s=this.clipWidth(),u=this.clipHeight(),c=this.clipFunc(),f=s&&u||c;const h=r===this;if(f){a.save();var p=this.getAbsoluteTransform(r),g=p.getMatrix();if(a.transform(g[0],g[1],g[2],g[3],g[4],g[5]),a.beginPath(),c)c.call(this,a,this);else{var y=this.clipX(),v=this.clipY();a.rect(y,v,s,u)}a.clip(),g=p.copy().invert().getMatrix(),a.transform(g[0],g[1],g[2],g[3],g[4],g[5])}var w=!h&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";w&&(a.save(),a._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(x){x[e](n,r)}),w&&a.restore(),f&&a.restore()}getClientRect(e){var n;e=e||{};var r=e.skipTransform,i=e.relativeTo,a,s,u,c,f={x:1/0,y:1/0,width:0,height:0},h=this;(n=this.children)===null||n===void 0||n.forEach(function(w){if(w.visible()){var x=w.getClientRect({relativeTo:h,skipShadow:e.skipShadow,skipStroke:e.skipStroke});x.width===0&&x.height===0||(a===void 0?(a=x.x,s=x.y,u=x.x+x.width,c=x.y+x.height):(a=Math.min(a,x.x),s=Math.min(s,x.y),u=Math.max(u,x.x+x.width),c=Math.max(c,x.y+x.height)))}});for(var p=this.find("Shape"),g=!1,y=0;y<p.length;y++){var v=p[y];if(v._isVisible(this)){g=!0;break}}return g&&a!==void 0?f={x:a,y:s,width:u-a,height:c-s}:f={x:0,y:0,width:0,height:0},r?f:this._transformedRect(f,i)}}A.addComponentsGetterSetter(qn,"clip",["x","y","width","height"]);A.addGetterSetter(qn,"clipX",void 0,le());A.addGetterSetter(qn,"clipY",void 0,le());A.addGetterSetter(qn,"clipWidth",void 0,le());A.addGetterSetter(qn,"clipHeight",void 0,le());A.addGetterSetter(qn,"clipFunc");const ju=new Map,Uk=pe._global.PointerEvent!==void 0;function Om(t){return ju.get(t)}function M0(t){return{evt:t,pointerId:t.pointerId}}function jk(t,e){return ju.get(t)===e}function Hk(t,e){mu(t),e.getStage()&&(ju.set(t,e),Uk&&e._fire("gotpointercapture",M0(new PointerEvent("gotpointercapture"))))}function mu(t,e){const n=ju.get(t);if(!n)return;const r=n.getStage();r&&r.content,ju.delete(t),Uk&&n._fire("lostpointercapture",M0(new PointerEvent("lostpointercapture")))}var VF="Stage",qF="string",Ob="px",KF="mouseout",Wk="mouseleave",Vk="mouseover",qk="mouseenter",Kk="mousemove",Yk="mousedown",Xk="mouseup",tu="pointermove",nu="pointerdown",Ss="pointerup",ru="pointercancel",YF="lostpointercapture",Ff="pointerout",$f="pointerleave",zf="pointerover",Gf="pointerenter",ny="contextmenu",Qk="touchstart",Jk="touchend",Zk="touchmove",eE="touchcancel",ry="wheel",XF=5,QF=[[qk,"_pointerenter"],[Yk,"_pointerdown"],[Kk,"_pointermove"],[Xk,"_pointerup"],[Wk,"_pointerleave"],[Qk,"_pointerdown"],[Zk,"_pointermove"],[Jk,"_pointerup"],[eE,"_pointercancel"],[Vk,"_pointerover"],[ry,"_wheel"],[ny,"_contextmenu"],[nu,"_pointerdown"],[tu,"_pointermove"],[Ss,"_pointerup"],[ru,"_pointercancel"],[YF,"_lostpointercapture"]];const Tm={mouse:{[Ff]:KF,[$f]:Wk,[zf]:Vk,[Gf]:qk,[tu]:Kk,[nu]:Yk,[Ss]:Xk,[ru]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[Ff]:"touchout",[$f]:"touchleave",[zf]:"touchover",[Gf]:"touchenter",[tu]:Zk,[nu]:Qk,[Ss]:Jk,[ru]:eE,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[Ff]:Ff,[$f]:$f,[zf]:zf,[Gf]:Gf,[tu]:tu,[nu]:nu,[Ss]:Ss,[ru]:ru,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},iu=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",is=t=>{const e=iu(t);if(e==="pointer")return pe.pointerEventsEnabled&&Tm.pointer;if(e==="touch")return Tm.touch;if(e==="mouse")return Tm.mouse};function Tb(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&G.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}const JF="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);",Sd=[];class tp extends qn{constructor(e){super(Tb(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Sd.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{Tb(this.attrs)}),this._checkVisibility()}_validateAdd(e){const n=e.getType()==="Layer",r=e.getType()==="FastLayer";n||r||G.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===qF){if(e.charAt(0)==="."){var n=e.slice(1);e=document.getElementsByClassName(n)[0]}else{var r;e.charAt(0)!=="#"?r=e:r=e.slice(1),e=document.getElementById(r)}if(!e)throw"Can not find container in document with id "+r}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var e=this.children,n=e.length,r;for(r=0;r<n;r++)e[r].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),qn.prototype.clone.call(this,e)}destroy(){super.destroy();var e=this.content;e&&G._isInDocument(e)&&this.container().removeChild(e);var n=Sd.indexOf(this);return n>-1&&Sd.splice(n,1),G.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(G.warn(JF),null)}_getPointerById(e){return this._pointerPositions.find(n=>n.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e=e||{},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var n=new Ts({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),r=n.getContext()._context,i=this.children;return(e.x||e.y)&&r.translate(-1*e.x,-1*e.y),i.forEach(function(a){if(a.isVisible()){var s=a._toKonvaCanvas(e);r.drawImage(s._canvas,e.x,e.y,s.getWidth()/s.getPixelRatio(),s.getHeight()/s.getPixelRatio())}}),n}getIntersection(e){if(!e)return null;var n=this.children,r=n.length,i=r-1,a;for(a=i;a>=0;a--){const s=n[a].getIntersection(e);if(s)return s}return null}_resizeDOM(){var e=this.width(),n=this.height();this.content&&(this.content.style.width=e+Ob,this.content.style.height=n+Ob),this.bufferCanvas.setSize(e,n),this.bufferHitCanvas.setSize(e,n),this.children.forEach(r=>{r.setSize({width:e,height:n}),r.draw()})}add(e,...n){if(arguments.length>1){for(var r=0;r<arguments.length;r++)this.add(arguments[r]);return this}super.add(e);var i=this.children.length;return i>XF&&G.warn("The stage has "+i+" 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."),e.setSize({width:this.width(),height:this.height()}),e.draw(),pe.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return jk(e,this)}setPointerCapture(e){Hk(e,this)}releaseCapture(e){mu(e)}getLayers(){return this.children}_bindContentEvents(){pe.isBrowser&&QF.forEach(([e,n])=>{this.content.addEventListener(e,r=>{this[n](r)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const n=is(e.type);this._fire(n.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const n=is(e.type);this._fire(n.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let n=this[e+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(e){const n=is(e.type),r=iu(e.type);if(n){this.setPointersPositions(e);var i=this._getTargetShape(r),a=!Ge.isDragging||pe.hitOnDragEnabled;i&&a?(i._fireAndBubble(n.pointerout,{evt:e}),i._fireAndBubble(n.pointerleave,{evt:e}),this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this[r+"targetShape"]=null):a&&(this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(e){const n=is(e.type),r=iu(e.type);if(n){this.setPointersPositions(e);var i=!1;this._changedPointerPositions.forEach(a=>{var s=this.getIntersection(a);if(Ge.justDragged=!1,pe["_"+r+"ListenClick"]=!0,!(s&&s.isListening()))return;pe.capturePointerEventsEnabled&&s.setPointerCapture(a.id),this[r+"ClickStartShape"]=s,s._fireAndBubble(n.pointerdown,{evt:e,pointerId:a.id}),i=!0;const c=e.type.indexOf("touch")>=0;s.preventDefault()&&e.cancelable&&c&&e.preventDefault()}),i||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(e){const n=is(e.type),r=iu(e.type);if(!n)return;Ge.isDragging&&Ge.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e);var i=!Ge.isDragging||pe.hitOnDragEnabled;if(!i)return;var a={};let s=!1;var u=this._getTargetShape(r);this._changedPointerPositions.forEach(c=>{const f=Om(c.id)||this.getIntersection(c),h=c.id,p={evt:e,pointerId:h};var g=u!==f;if(g&&u&&(u._fireAndBubble(n.pointerout,Object.assign({},p),f),u._fireAndBubble(n.pointerleave,Object.assign({},p),f)),f){if(a[f._id])return;a[f._id]=!0}f&&f.isListening()?(s=!0,g&&(f._fireAndBubble(n.pointerover,Object.assign({},p),u),f._fireAndBubble(n.pointerenter,Object.assign({},p),u),this[r+"targetShape"]=f),f._fireAndBubble(n.pointermove,Object.assign({},p))):u&&(this._fire(n.pointerover,{evt:e,target:this,currentTarget:this,pointerId:h}),this[r+"targetShape"]=null)}),s||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const n=is(e.type),r=iu(e.type);if(!n)return;this.setPointersPositions(e);const i=this[r+"ClickStartShape"],a=this[r+"ClickEndShape"];var s={};let u=!1;this._changedPointerPositions.forEach(c=>{const f=Om(c.id)||this.getIntersection(c);if(f){if(f.releaseCapture(c.id),s[f._id])return;s[f._id]=!0}const h=c.id,p={evt:e,pointerId:h};let g=!1;pe["_"+r+"InDblClickWindow"]?(g=!0,clearTimeout(this[r+"DblTimeout"])):Ge.justDragged||(pe["_"+r+"InDblClickWindow"]=!0,clearTimeout(this[r+"DblTimeout"])),this[r+"DblTimeout"]=setTimeout(function(){pe["_"+r+"InDblClickWindow"]=!1},pe.dblClickWindow),f&&f.isListening()?(u=!0,this[r+"ClickEndShape"]=f,f._fireAndBubble(n.pointerup,Object.assign({},p)),pe["_"+r+"ListenClick"]&&i&&i===f&&(f._fireAndBubble(n.pointerclick,Object.assign({},p)),g&&a&&a===f&&f._fireAndBubble(n.pointerdblclick,Object.assign({},p)))):(this[r+"ClickEndShape"]=null,pe["_"+r+"ListenClick"]&&this._fire(n.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:h}),g&&this._fire(n.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:h}))}),u||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),pe["_"+r+"ListenClick"]=!1,e.cancelable&&r!=="touch"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(ny,{evt:e}):this._fire(ny,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(ry,{evt:e}):this._fire(ry,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const n=Om(e.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(Ss,M0(e)),mu(e.pointerId)}_lostpointercapture(e){mu(e.pointerId)}setPointersPositions(e){var n=this._getContentPosition(),r=null,i=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,a=>{this._pointerPositions.push({id:a.identifier,x:(a.clientX-n.left)/n.scaleX,y:(a.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,a=>{this._changedPointerPositions.push({id:a.identifier,x:(a.clientX-n.left)/n.scaleX,y:(a.clientY-n.top)/n.scaleY})})):(r=(e.clientX-n.left)/n.scaleX,i=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:r,y:i},this._pointerPositions=[{x:r,y:i,id:G._getFirstPointerId(e)}],this._changedPointerPositions=[{x:r,y:i,id:G._getFirstPointerId(e)}])}_setPointerPosition(e){G.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Ts({width:this.width(),height:this.height()}),this.bufferHitCanvas=new L0({pixelRatio:1,width:this.width(),height:this.height()}),!!pe.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.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"),e.appendChild(this.content),this._resizeDOM()}}cache(){return G.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(e){e.batchDraw()}),this}}tp.prototype.nodeType=VF;yt(tp);A.addGetterSetter(tp,"container");var tE="hasShadow",nE="shadowRGBA",rE="patternImage",iE="linearGradient",aE="radialGradient";let Uf;function Rm(){return Uf||(Uf=G.createCanvasElement().getContext("2d"),Uf)}const vu={};function ZF(t){t.fill()}function e$(t){t.stroke()}function t$(t){t.fill()}function n$(t){t.stroke()}function r$(){this._clearCache(tE)}function i$(){this._clearCache(nE)}function a$(){this._clearCache(rE)}function o$(){this._clearCache(iE)}function s$(){this._clearCache(aE)}class re extends se{constructor(e){super(e);let n;for(;n=G.getRandomColor(),!(n&&!(n in vu)););this.colorKey=n,vu[n]=this}getContext(){return G.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return G.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(tE,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(rE,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var e=Rm();const n=e.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const r=new Hn;r.translate(this.fillPatternX(),this.fillPatternY()),r.rotate(pe.getAngle(this.fillPatternRotation())),r.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),r.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=r.getMatrix(),a=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(a)}return n}}_getLinearGradient(){return this._getCache(iE,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var n=Rm(),r=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),a=n.createLinearGradient(r.x,r.y,i.x,i.y),s=0;s<e.length;s+=2)a.addColorStop(e[s],e[s+1]);return a}}_getRadialGradient(){return this._getCache(aE,this.__getRadialGradient)}__getRadialGradient(){var e=this.fillRadialGradientColorStops();if(e){for(var n=Rm(),r=this.fillRadialGradientStartPoint(),i=this.fillRadialGradientEndPoint(),a=n.createRadialGradient(r.x,r.y,this.fillRadialGradientStartRadius(),i.x,i.y,this.fillRadialGradientEndRadius()),s=0;s<e.length;s+=2)a.addColorStop(e[s],e[s+1]);return a}}getShadowRGBA(){return this._getCache(nE,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var e=G.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.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 e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var n=this.getStage(),r=n.bufferHitCanvas,i;return r.getContext().clear(),this.drawHit(r,null,!0),i=r.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data,i[3]>0}destroy(){return se.prototype.destroy.call(this),delete vu[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=e||this.hasFill(),a=this.hasStroke(),s=this.getAbsoluteOpacity()!==1;if(i&&a&&s)return!0;const u=this.hasShadow(),c=this.shadowForStrokeEnabled();return!!(i&&a&&u&&c)}setStrokeHitEnabled(e){G.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){const n=e.skipTransform,r=e.relativeTo,i=this.getSelfRect(),s=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,u=i.width+s,c=i.height+s,f=!e.skipShadow&&this.hasShadow(),h=f?this.shadowOffsetX():0,p=f?this.shadowOffsetY():0,g=u+Math.abs(h),y=c+Math.abs(p),v=f&&this.shadowBlur()||0,w=g+v*2,x=y+v*2,_={width:w,height:x,x:-(s/2+v)+Math.min(h,0)+i.x,y:-(s/2+v)+Math.min(p,0)+i.y};return n?_:this._transformedRect(_,r)}drawScene(e,n){var r=this.getLayer(),i=e||r.getCanvas(),a=i.getContext(),s=this._getCanvasCache(),u=this.getSceneFunc(),c=this.hasShadow(),f,h,p,g=i.isCache,y=n===this;if(!this.isVisible()&&!y)return this;if(s){a.save();var v=this.getAbsoluteTransform(n).getMatrix();return a.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedSceneCanvas(a),a.restore(),this}if(!u)return this;if(a.save(),this._useBufferCanvas()&&!g){f=this.getStage(),h=f.bufferCanvas,p=h.getContext(),p.clear(),p.save(),p._applyLineJoin(this);var w=this.getAbsoluteTransform(n).getMatrix();p.transform(w[0],w[1],w[2],w[3],w[4],w[5]),u.call(this,p,this),p.restore();var x=h.pixelRatio;c&&a._applyShadow(this),a._applyOpacity(this),a._applyGlobalCompositeOperation(this),a.drawImage(h._canvas,0,0,h.width/x,h.height/x)}else{if(a._applyLineJoin(this),!y){var w=this.getAbsoluteTransform(n).getMatrix();a.transform(w[0],w[1],w[2],w[3],w[4],w[5]),a._applyOpacity(this),a._applyGlobalCompositeOperation(this)}c&&a._applyShadow(this),u.call(this,a,this)}return a.restore(),this}drawHit(e,n,r=!1){if(!this.shouldDrawHit(n,r))return this;var i=this.getLayer(),a=e||i.hitCanvas,s=a&&a.getContext(),u=this.hitFunc()||this.sceneFunc(),c=this._getCanvasCache(),f=c&&c.hit;if(this.colorKey||G.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()"),f){s.save();var h=this.getAbsoluteTransform(n).getMatrix();return s.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedHitCanvas(s),s.restore(),this}if(!u)return this;if(s.save(),s._applyLineJoin(this),!(this===n)){var g=this.getAbsoluteTransform(n).getMatrix();s.transform(g[0],g[1],g[2],g[3],g[4],g[5])}return u.call(this,s,this),s.restore(),this}drawHitFromCache(e=0){var n=this._getCanvasCache(),r=this._getCachedSceneCanvas(),i=n.hit,a=i.getContext(),s=i.getWidth(),u=i.getHeight(),c,f,h,p,g,y;a.clear(),a.drawImage(r._canvas,0,0,s,u);try{for(c=a.getImageData(0,0,s,u),f=c.data,h=f.length,p=G._hexToRgb(this.colorKey),g=0;g<h;g+=4)y=f[g+3],y>e?(f[g]=p.r,f[g+1]=p.g,f[g+2]=p.b,f[g+3]=255):f[g+3]=0;a.putImageData(c,0,0)}catch(v){G.error("Unable to draw hit graph from cached scene canvas. "+v.message)}return this}hasPointerCapture(e){return jk(e,this)}setPointerCapture(e){Hk(e,this)}releaseCapture(e){mu(e)}}re.prototype._fillFunc=ZF;re.prototype._strokeFunc=e$;re.prototype._fillFuncHit=t$;re.prototype._strokeFuncHit=n$;re.prototype._centroid=!1;re.prototype.nodeType="Shape";yt(re);re.prototype.eventListeners={};re.prototype.on.call(re.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",r$);re.prototype.on.call(re.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",i$);re.prototype.on.call(re.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",a$);re.prototype.on.call(re.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",o$);re.prototype.on.call(re.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",s$);A.addGetterSetter(re,"stroke",void 0,Gk());A.addGetterSetter(re,"strokeWidth",2,le());A.addGetterSetter(re,"fillAfterStrokeEnabled",!1);A.addGetterSetter(re,"hitStrokeWidth","auto",I0());A.addGetterSetter(re,"strokeHitEnabled",!0,jr());A.addGetterSetter(re,"perfectDrawEnabled",!0,jr());A.addGetterSetter(re,"shadowForStrokeEnabled",!0,jr());A.addGetterSetter(re,"lineJoin");A.addGetterSetter(re,"lineCap");A.addGetterSetter(re,"sceneFunc");A.addGetterSetter(re,"hitFunc");A.addGetterSetter(re,"dash");A.addGetterSetter(re,"dashOffset",0,le());A.addGetterSetter(re,"shadowColor",void 0,qs());A.addGetterSetter(re,"shadowBlur",0,le());A.addGetterSetter(re,"shadowOpacity",1,le());A.addComponentsGetterSetter(re,"shadowOffset",["x","y"]);A.addGetterSetter(re,"shadowOffsetX",0,le());A.addGetterSetter(re,"shadowOffsetY",0,le());A.addGetterSetter(re,"fillPatternImage");A.addGetterSetter(re,"fill",void 0,Gk());A.addGetterSetter(re,"fillPatternX",0,le());A.addGetterSetter(re,"fillPatternY",0,le());A.addGetterSetter(re,"fillLinearGradientColorStops");A.addGetterSetter(re,"strokeLinearGradientColorStops");A.addGetterSetter(re,"fillRadialGradientStartRadius",0);A.addGetterSetter(re,"fillRadialGradientEndRadius",0);A.addGetterSetter(re,"fillRadialGradientColorStops");A.addGetterSetter(re,"fillPatternRepeat","repeat");A.addGetterSetter(re,"fillEnabled",!0);A.addGetterSetter(re,"strokeEnabled",!0);A.addGetterSetter(re,"shadowEnabled",!0);A.addGetterSetter(re,"dashEnabled",!0);A.addGetterSetter(re,"strokeScaleEnabled",!0);A.addGetterSetter(re,"fillPriority","color");A.addComponentsGetterSetter(re,"fillPatternOffset",["x","y"]);A.addGetterSetter(re,"fillPatternOffsetX",0,le());A.addGetterSetter(re,"fillPatternOffsetY",0,le());A.addComponentsGetterSetter(re,"fillPatternScale",["x","y"]);A.addGetterSetter(re,"fillPatternScaleX",1,le());A.addGetterSetter(re,"fillPatternScaleY",1,le());A.addComponentsGetterSetter(re,"fillLinearGradientStartPoint",["x","y"]);A.addComponentsGetterSetter(re,"strokeLinearGradientStartPoint",["x","y"]);A.addGetterSetter(re,"fillLinearGradientStartPointX",0);A.addGetterSetter(re,"strokeLinearGradientStartPointX",0);A.addGetterSetter(re,"fillLinearGradientStartPointY",0);A.addGetterSetter(re,"strokeLinearGradientStartPointY",0);A.addComponentsGetterSetter(re,"fillLinearGradientEndPoint",["x","y"]);A.addComponentsGetterSetter(re,"strokeLinearGradientEndPoint",["x","y"]);A.addGetterSetter(re,"fillLinearGradientEndPointX",0);A.addGetterSetter(re,"strokeLinearGradientEndPointX",0);A.addGetterSetter(re,"fillLinearGradientEndPointY",0);A.addGetterSetter(re,"strokeLinearGradientEndPointY",0);A.addComponentsGetterSetter(re,"fillRadialGradientStartPoint",["x","y"]);A.addGetterSetter(re,"fillRadialGradientStartPointX",0);A.addGetterSetter(re,"fillRadialGradientStartPointY",0);A.addComponentsGetterSetter(re,"fillRadialGradientEndPoint",["x","y"]);A.addGetterSetter(re,"fillRadialGradientEndPointX",0);A.addGetterSetter(re,"fillRadialGradientEndPointY",0);A.addGetterSetter(re,"fillPatternRotation",0);A.backCompat(re,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var l$="#",u$="beforeDraw",c$="draw",oE=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],f$=oE.length;class yo extends qn{constructor(e){super(e),this.canvas=new Ts,this.hitCanvas=new L0({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);var 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(){se.prototype.moveToTop.call(this);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var e=se.prototype.moveUp.call(this);if(!e)return!1;var 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(se.prototype.moveDown.call(this)){var e=this.getStage();if(e){var 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(se.prototype.moveToBottom.call(this)){var e=this.getStage();if(e){var 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(){var e=this.getNativeCanvasElement();return se.prototype.remove.call(this),e&&e.parentNode&&G._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){var n=e.getType();n!=="Group"&&n!=="Shape"&&G.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(),se.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(){G.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){G.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,G.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i<f$;i++){const a=oE[i],s=this._getIntersection({x:e.x+a.x*n,y:e.y+a.y*n}),u=s.shape;if(u)return u;if(r=!!s.antialiased,!s.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 a=G._rgbToHex(r[0],r[1],r[2]),s=vu[l$+a];return s?{shape:s}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,n){var r=this.getLayer(),i=e||r&&r.getCanvas();return this._fire(u$,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),qn.prototype.drawScene.call(this,i,n),this._fire(c$,{node:this}),this}drawHit(e,n){var r=this.getLayer(),i=e||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),qn.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){G.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return G.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var e=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return G.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}yo.prototype.nodeType="Layer";yt(yo);A.addGetterSetter(yo,"imageSmoothingEnabled",!0);A.addGetterSetter(yo,"clearBeforeDraw",!0);A.addGetterSetter(yo,"hitGraphEnabled",!0,jr());class D0 extends yo{constructor(e){super(e),this.listening(!1),G.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}D0.prototype.nodeType="FastLayer";yt(D0);class zs extends qn{_validateAdd(e){var n=e.getType();n!=="Group"&&n!=="Shape"&&G.throw("You may only add groups and shapes to groups.")}}zs.prototype.nodeType="Group";yt(zs);var Am=function(){return Os.performance&&Os.performance.now?function(){return Os.performance.now()}:function(){return new Date().getTime()}}();class dr{constructor(e,n){this.id=dr.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:Am(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){var n=[];return e?e.length>0?n=e:n=[e]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(e){var n=this.layers,r=n.length,i;for(i=0;i<r;i++)if(n[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){var e=dr,n=e.animations,r=n.length,i;for(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=Am(),dr._addAnimation(this),this}stop(){return dr._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){var n=e.id,r=this.animations,i=r.length,a;for(a=0;a<i;a++)if(r[a].id===n){this.animations.splice(a,1);break}}static _runFrames(){var e={},n=this.animations,r,i,a,s,u,c,f,h,p;for(s=0;s<n.length;s++)if(r=n[s],i=r.layers,a=r.func,r._updateFrameObject(Am()),c=i.length,a?p=a.call(r,r.frame)!==!1:p=!0,!!p)for(u=0;u<c;u++)f=i[u],f._id!==void 0&&(e[f._id]=f);for(h in e)e.hasOwnProperty(h)&&e[h].batchDraw()}static _animationLoop(){var e=dr;e.animations.length?(e._runFrames(),G.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,G.requestAnimFrame(this._animationLoop))}}dr.animations=[];dr.animIdCounter=0;dr.animRunning=!1;var d$={node:1,duration:1,easing:1,onFinish:1,yoyo:1},h$=1,Rb=2,Ab=3,p$=0,Ib=["fill","stroke","shadowColor"];class g${constructor(e,n,r,i,a,s,u){this.prop=e,this.propFunc=n,this.begin=i,this._pos=i,this.duration=s,this._change=0,this.prevPos=0,this.yoyo=u,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=r,this._change=a-this.begin,this.pause()}fire(e){var n=this[e];n&&n()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=Rb,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=Ab,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,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(){var e=this.getTimer()-this._startTime;this.state===Rb?this.setTime(e):this.state===Ab&&this.setTime(this.duration-e)}pause(){this.state=h$,this.fire("onPause")}getTimer(){return new Date().getTime()}}class kt{constructor(e){var n=this,r=e.node,i=r._id,a,s=e.easing||yu.Linear,u=!!e.yoyo,c;typeof e.duration>"u"?a=.3:e.duration===0?a=.001:a=e.duration,this.node=r,this._id=p$++;var f=r.getLayer()||(r instanceof pe.Stage?r.getLayers():null);f||G.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new dr(function(){n.tween.onEnterFrame()},f),this.tween=new g$(c,function(h){n._tweenFunc(h)},s,0,1,a*1e3,u),this._addListeners(),kt.attrs[i]||(kt.attrs[i]={}),kt.attrs[i][this._id]||(kt.attrs[i][this._id]={}),kt.tweens[i]||(kt.tweens[i]={});for(c in e)d$[c]===void 0&&this._addAttr(c,e[c]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,n){var r=this.node,i=r._id,a,s,u,c,f,h,p,g;if(u=kt.tweens[i][e],u&&delete kt.attrs[i][u][e],a=r.getAttr(e),G._isArray(n))if(s=[],f=Math.max(n.length,a.length),e==="points"&&n.length!==a.length&&(n.length>a.length?(p=a,a=G._prepareArrayForTween(a,n,r.closed())):(h=n,n=G._prepareArrayForTween(n,a,r.closed()))),e.indexOf("fill")===0)for(c=0;c<f;c++)if(c%2===0)s.push(n[c]-a[c]);else{var y=G.colorToRGBA(a[c]);g=G.colorToRGBA(n[c]),a[c]=y,s.push({r:g.r-y.r,g:g.g-y.g,b:g.b-y.b,a:g.a-y.a})}else for(c=0;c<f;c++)s.push(n[c]-a[c]);else Ib.indexOf(e)!==-1?(a=G.colorToRGBA(a),g=G.colorToRGBA(n),s={r:g.r-a.r,g:g.g-a.g,b:g.b-a.b,a:g.a-a.a}):s=n-a;kt.attrs[i][this._id][e]={start:a,diff:s,end:n,trueEnd:h,trueStart:p},kt.tweens[i][e]=this._id}_tweenFunc(e){var n=this.node,r=kt.attrs[n._id][this._id],i,a,s,u,c,f,h,p;for(i in r){if(a=r[i],s=a.start,u=a.diff,p=a.end,G._isArray(s))if(c=[],h=Math.max(s.length,p.length),i.indexOf("fill")===0)for(f=0;f<h;f++)f%2===0?c.push((s[f]||0)+u[f]*e):c.push("rgba("+Math.round(s[f].r+u[f].r*e)+","+Math.round(s[f].g+u[f].g*e)+","+Math.round(s[f].b+u[f].b*e)+","+(s[f].a+u[f].a*e)+")");else for(f=0;f<h;f++)c.push((s[f]||0)+u[f]*e);else Ib.indexOf(i)!==-1?c="rgba("+Math.round(s.r+u.r*e)+","+Math.round(s.g+u.g*e)+","+Math.round(s.b+u.b*e)+","+(s.a+u.a*e)+")":c=s+u*e;n.setAttr(i,c)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,n=kt.attrs[e._id][this._id];n.points&&n.points.trueEnd&&e.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,n=kt.attrs[e._id][this._id];n.points&&n.points.trueStart&&e.points(n.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(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e=this.node._id,n=this._id,r=kt.tweens[e],i;this.pause();for(i in r)delete kt.tweens[e][i];delete kt.attrs[e][n]}}kt.attrs={};kt.tweens={};se.prototype.to=function(t){var e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()};var n=new kt(t);n.play()};const yu={BackEaseIn(t,e,n,r){var i=1.70158;return n*(t/=r)*t*((i+1)*t-i)+e},BackEaseOut(t,e,n,r){var i=1.70158;return n*((t=t/r-1)*t*((i+1)*t+i)+1)+e},BackEaseInOut(t,e,n,r){var i=1.70158;return(t/=r/2)<1?n/2*(t*t*(((i*=1.525)+1)*t-i))+e:n/2*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)+e},ElasticEaseIn(t,e,n,r,i,a){var s=0;return t===0?e:(t/=r)===1?e+n:(a||(a=r*.3),!i||i<Math.abs(n)?(i=n,s=a/4):s=a/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(t-=1))*Math.sin((t*r-s)*(2*Math.PI)/a))+e)},ElasticEaseOut(t,e,n,r,i,a){var s=0;return t===0?e:(t/=r)===1?e+n:(a||(a=r*.3),!i||i<Math.abs(n)?(i=n,s=a/4):s=a/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*t)*Math.sin((t*r-s)*(2*Math.PI)/a)+n+e)},ElasticEaseInOut(t,e,n,r,i,a){var s=0;return t===0?e:(t/=r/2)===2?e+n:(a||(a=r*(.3*1.5)),!i||i<Math.abs(n)?(i=n,s=a/4):s=a/(2*Math.PI)*Math.asin(n/i),t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t*r-s)*(2*Math.PI)/a))+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*r-s)*(2*Math.PI)/a)*.5+n+e)},BounceEaseOut(t,e,n,r){return(t/=r)<1/2.75?n*(7.5625*t*t)+e:t<2/2.75?n*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?n*(7.5625*(t-=2.25/2.75)*t+.9375)+e:n*(7.5625*(t-=2.625/2.75)*t+.984375)+e},BounceEaseIn(t,e,n,r){return n-yu.BounceEaseOut(r-t,0,n,r)+e},BounceEaseInOut(t,e,n,r){return t<r/2?yu.BounceEaseIn(t*2,0,n,r)*.5+e:yu.BounceEaseOut(t*2-r,0,n,r)*.5+n*.5+e},EaseIn(t,e,n,r){return n*(t/=r)*t+e},EaseOut(t,e,n,r){return-n*(t/=r)*(t-2)+e},EaseInOut(t,e,n,r){return(t/=r/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},StrongEaseIn(t,e,n,r){return n*(t/=r)*t*t*t*t+e},StrongEaseOut(t,e,n,r){return n*((t=t/r-1)*t*t*t*t+1)+e},StrongEaseInOut(t,e,n,r){return(t/=r/2)<1?n/2*t*t*t*t*t+e:n/2*((t-=2)*t*t*t*t+2)+e},Linear(t,e,n,r){return n*t/r+e}},Lb=G._assign(pe,{Util:G,Transform:Hn,Node:se,Container:qn,Stage:tp,stages:Sd,Layer:yo,FastLayer:D0,Group:zs,DD:Ge,Shape:re,shapes:vu,Animation:dr,Tween:kt,Easings:yu,Context:Zh,Canvas:ep});class Wi extends re{_sceneFunc(e){var n=pe.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=pe.getAngle(r?360-this.angle():this.angle()),a=Math.cos(Math.min(i,Math.PI)),s=1,u=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),c=Math.sin(Math.min(i,Math.PI/2)),f=a*(a>0?e:n),h=s*n,p=u*(u>0?e:n),g=c*(c>0?n:e);return{x:f,y:r?-1*g:p,width:h-f,height:g-p}}}Wi.prototype._centroid=!0;Wi.prototype.className="Arc";Wi.prototype._attrsAffectingSize=["innerRadius","outerRadius"];yt(Wi);A.addGetterSetter(Wi,"innerRadius",0,le());A.addGetterSetter(Wi,"outerRadius",0,le());A.addGetterSetter(Wi,"angle",0,le());A.addGetterSetter(Wi,"clockwise",!1,jr());function iy(t,e,n,r,i,a,s){var u=Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),c=Math.sqrt(Math.pow(i-n,2)+Math.pow(a-r,2)),f=s*u/(u+c),h=s*c/(u+c),p=n-f*(i-t),g=r-f*(a-e),y=n+h*(i-t),v=r+h*(a-e);return[p,g,y,v]}function Mb(t,e){var n=t.length,r=[],i,a;for(i=2;i<n-2;i+=2)a=iy(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e),!isNaN(a[0])&&(r.push(a[0]),r.push(a[1]),r.push(t[i]),r.push(t[i+1]),r.push(a[2]),r.push(a[3]));return r}class Vi extends re{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){var n=this.points(),r=n.length,i=this.tension(),a=this.closed(),s=this.bezier(),u,c,f;if(r){if(e.beginPath(),e.moveTo(n[0],n[1]),i!==0&&r>4){for(u=this.getTensionPoints(),c=u.length,f=a?0:4,a||e.quadraticCurveTo(u[0],u[1],u[2],u[3]);f<c-2;)e.bezierCurveTo(u[f++],u[f++],u[f++],u[f++],u[f++],u[f++]);a||e.quadraticCurveTo(u[c-2],u[c-1],n[r-2],n[r-1])}else if(s)for(f=2;f<r;)e.bezierCurveTo(n[f++],n[f++],n[f++],n[f++],n[f++],n[f++]);else for(f=2;f<r;f+=2)e.lineTo(n[f],n[f+1]);a?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():Mb(this.points(),this.tension())}_getTensionPointsClosed(){var e=this.points(),n=e.length,r=this.tension(),i=iy(e[n-2],e[n-1],e[0],e[1],e[2],e[3],r),a=iy(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],r),s=Mb(e,r),u=[i[2],i[3]].concat(s).concat([a[0],a[1],e[n-2],e[n-1],a[2],a[3],i[0],i[1],e[0],e[1]]);return u}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var 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();for(var n=e[0],r=e[0],i=e[1],a=e[1],s,u,c=0;c<e.length/2;c++)s=e[c*2],u=e[c*2+1],n=Math.min(n,s),r=Math.max(r,s),i=Math.min(i,u),a=Math.max(a,u);return{x:n,y:i,width:r-n,height:a-i}}}Vi.prototype.className="Line";Vi.prototype._attrsAffectingSize=["points","bezier","tension"];yt(Vi);A.addGetterSetter(Vi,"closed",!1);A.addGetterSetter(Vi,"bezier",!1);A.addGetterSetter(Vi,"tension",0,le());A.addGetterSetter(Vi,"points",[],kF());class tt extends re{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this.dataArray=tt.parsePathData(this.data()),this.pathLength=0;for(var n=0;n<this.dataArray.length;++n)this.pathLength+=this.dataArray[n].pathLength;this.on("dataChange.konva",function(){this.dataArray=tt.parsePathData(this.data()),this.pathLength=0;for(var r=0;r<this.dataArray.length;++r)this.pathLength+=this.dataArray[r].pathLength})}_sceneFunc(e){var n=this.dataArray;e.beginPath();for(var r=!1,i=0;i<n.length;i++){var a=n[i].command,s=n[i].points;switch(a){case"L":e.lineTo(s[0],s[1]);break;case"M":e.moveTo(s[0],s[1]);break;case"C":e.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"Q":e.quadraticCurveTo(s[0],s[1],s[2],s[3]);break;case"A":var u=s[0],c=s[1],f=s[2],h=s[3],p=s[4],g=s[5],y=s[6],v=s[7],w=f>h?f:h,x=f>h?1:f/h,_=f>h?h/f:1;e.translate(u,c),e.rotate(y),e.scale(x,_),e.arc(0,0,w,p,p+g,1-v),e.scale(1/x,1/_),e.rotate(-y),e.translate(-u,-c);break;case"z":r=!0,e.closePath();break}}!r&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach(function(f){if(f.command==="A"){var h=f.points[4],p=f.points[5],g=f.points[4]+p,y=Math.PI/180;if(Math.abs(h-g)<y&&(y=Math.abs(h-g)),p<0)for(let v=h-y;v>g;v-=y){const w=tt.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],v,0);e.push(w.x,w.y)}else for(let v=h+y;v<g;v+=y){const w=tt.getPointOnEllipticalArc(f.points[0],f.points[1],f.points[2],f.points[3],v,0);e.push(w.x,w.y)}}else if(f.command==="C")for(let v=0;v<=1;v+=.01){const w=tt.getPointOnCubicBezier(v,f.start.x,f.start.y,f.points[0],f.points[1],f.points[2],f.points[3],f.points[4],f.points[5]);e.push(w.x,w.y)}else e=e.concat(f.points)});for(var n=e[0],r=e[0],i=e[1],a=e[1],s,u,c=0;c<e.length/2;c++)s=e[c*2],u=e[c*2+1],isNaN(s)||(n=Math.min(n,s),r=Math.max(r,s)),isNaN(u)||(i=Math.min(i,u),a=Math.max(a,u));return{x:n,y:i,width:r-n,height:a-i}}getLength(){return this.pathLength}getPointAtLength(e){var n,r=0,i=this.dataArray.length;if(!i)return null;for(;r<i&&e>this.dataArray[r].pathLength;)e-=this.dataArray[r].pathLength,++r;if(r===i)return n=this.dataArray[r-1].points.slice(-2),{x:n[0],y:n[1]};if(e<.01)return n=this.dataArray[r].points.slice(0,2),{x:n[0],y:n[1]};var a=this.dataArray[r],s=a.points;switch(a.command){case"L":return tt.getPointOnLine(e,a.start.x,a.start.y,s[0],s[1]);case"C":return tt.getPointOnCubicBezier(e/a.pathLength,a.start.x,a.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return tt.getPointOnQuadraticBezier(e/a.pathLength,a.start.x,a.start.y,s[0],s[1],s[2],s[3]);case"A":var u=s[0],c=s[1],f=s[2],h=s[3],p=s[4],g=s[5],y=s[6];return p+=g*e/a.pathLength,tt.getPointOnEllipticalArc(u,c,f,h,p,y)}return null}static getLineLength(e,n,r,i){return Math.sqrt((r-e)*(r-e)+(i-n)*(i-n))}static getPointOnLine(e,n,r,i,a,s,u){s===void 0&&(s=n),u===void 0&&(u=r);var c=(a-r)/(i-n+1e-8),f=Math.sqrt(e*e/(1+c*c));i<n&&(f*=-1);var h=c*f,p;if(i===n)p={x:s,y:u+h};else if((u-r)/(s-n+1e-8)===c)p={x:s+f,y:u+h};else{var g,y,v=this.getLineLength(n,r,i,a),w=(s-n)*(i-n)+(u-r)*(a-r);w=w/(v*v),g=n+w*(i-n),y=r+w*(a-r);var x=this.getLineLength(s,u,g,y),_=Math.sqrt(e*e-x*x);f=Math.sqrt(_*_/(1+c*c)),i<n&&(f*=-1),h=c*f,p={x:g+f,y:y+h}}return p}static getPointOnCubicBezier(e,n,r,i,a,s,u,c,f){function h(x){return x*x*x}function p(x){return 3*x*x*(1-x)}function g(x){return 3*x*(1-x)*(1-x)}function y(x){return(1-x)*(1-x)*(1-x)}var v=c*h(e)+s*p(e)+i*g(e)+n*y(e),w=f*h(e)+u*p(e)+a*g(e)+r*y(e);return{x:v,y:w}}static getPointOnQuadraticBezier(e,n,r,i,a,s,u){function c(y){return y*y}function f(y){return 2*y*(1-y)}function h(y){return(1-y)*(1-y)}var p=s*c(e)+i*f(e)+n*h(e),g=u*c(e)+a*f(e)+r*h(e);return{x:p,y:g}}static getPointOnEllipticalArc(e,n,r,i,a,s){var u=Math.cos(s),c=Math.sin(s),f={x:r*Math.cos(a),y:i*Math.sin(a)};return{x:e+(f.x*u-f.y*c),y:n+(f.x*c+f.y*u)}}static parsePathData(e){if(!e)return[];var n=e,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(var i=0;i<r.length;i++)n=n.replace(new RegExp(r[i],"g"),"|"+r[i]);var a=n.split("|"),s=[],u=[],c=0,f=0,h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,p;for(i=1;i<a.length;i++){var g=a[i],y=g.charAt(0);for(g=g.slice(1),u.length=0;p=h.exec(g);)u.push(p[0]);for(var v=[],w=0,x=u.length;w<x;w++){if(u[w]==="00"){v.push(0,0);continue}var _=parseFloat(u[w]);isNaN(_)?v.push(0):v.push(_)}for(;v.length>0&&!isNaN(v[0]);){var S=null,C=[],O=c,I=f,L,D,U,X,K,te,ce,j,T,$;switch(y){case"l":c+=v.shift(),f+=v.shift(),S="L",C.push(c,f);break;case"L":c=v.shift(),f=v.shift(),C.push(c,f);break;case"m":var V=v.shift(),ie=v.shift();if(c+=V,f+=ie,S="M",s.length>2&&s[s.length-1].command==="z"){for(var H=s.length-2;H>=0;H--)if(s[H].command==="M"){c=s[H].points[0]+V,f=s[H].points[1]+ie;break}}C.push(c,f),y="l";break;case"M":c=v.shift(),f=v.shift(),S="M",C.push(c,f),y="L";break;case"h":c+=v.shift(),S="L",C.push(c,f);break;case"H":c=v.shift(),S="L",C.push(c,f);break;case"v":f+=v.shift(),S="L",C.push(c,f);break;case"V":f=v.shift(),S="L",C.push(c,f);break;case"C":C.push(v.shift(),v.shift(),v.shift(),v.shift()),c=v.shift(),f=v.shift(),C.push(c,f);break;case"c":C.push(c+v.shift(),f+v.shift(),c+v.shift(),f+v.shift()),c+=v.shift(),f+=v.shift(),S="C",C.push(c,f);break;case"S":D=c,U=f,L=s[s.length-1],L.command==="C"&&(D=c+(c-L.points[2]),U=f+(f-L.points[3])),C.push(D,U,v.shift(),v.shift()),c=v.shift(),f=v.shift(),S="C",C.push(c,f);break;case"s":D=c,U=f,L=s[s.length-1],L.command==="C"&&(D=c+(c-L.points[2]),U=f+(f-L.points[3])),C.push(D,U,c+v.shift(),f+v.shift()),c+=v.shift(),f+=v.shift(),S="C",C.push(c,f);break;case"Q":C.push(v.shift(),v.shift()),c=v.shift(),f=v.shift(),C.push(c,f);break;case"q":C.push(c+v.shift(),f+v.shift()),c+=v.shift(),f+=v.shift(),S="Q",C.push(c,f);break;case"T":D=c,U=f,L=s[s.length-1],L.command==="Q"&&(D=c+(c-L.points[0]),U=f+(f-L.points[1])),c=v.shift(),f=v.shift(),S="Q",C.push(D,U,c,f);break;case"t":D=c,U=f,L=s[s.length-1],L.command==="Q"&&(D=c+(c-L.points[0]),U=f+(f-L.points[1])),c+=v.shift(),f+=v.shift(),S="Q",C.push(D,U,c,f);break;case"A":X=v.shift(),K=v.shift(),te=v.shift(),ce=v.shift(),j=v.shift(),T=c,$=f,c=v.shift(),f=v.shift(),S="A",C=this.convertEndpointToCenterParameterization(T,$,c,f,ce,j,X,K,te);break;case"a":X=v.shift(),K=v.shift(),te=v.shift(),ce=v.shift(),j=v.shift(),T=c,$=f,c+=v.shift(),f+=v.shift(),S="A",C=this.convertEndpointToCenterParameterization(T,$,c,f,ce,j,X,K,te);break}s.push({command:S||y,points:C,start:{x:O,y:I},pathLength:this.calcLength(O,I,S||y,C)})}(y==="z"||y==="Z")&&s.push({command:"z",points:[],start:void 0,pathLength:0})}return s}static calcLength(e,n,r,i){var a,s,u,c,f=tt;switch(r){case"L":return f.getLineLength(e,n,i[0],i[1]);case"C":for(a=0,s=f.getPointOnCubicBezier(0,e,n,i[0],i[1],i[2],i[3],i[4],i[5]),c=.01;c<=1;c+=.01)u=f.getPointOnCubicBezier(c,e,n,i[0],i[1],i[2],i[3],i[4],i[5]),a+=f.getLineLength(s.x,s.y,u.x,u.y),s=u;return a;case"Q":for(a=0,s=f.getPointOnQuadraticBezier(0,e,n,i[0],i[1],i[2],i[3]),c=.01;c<=1;c+=.01)u=f.getPointOnQuadraticBezier(c,e,n,i[0],i[1],i[2],i[3]),a+=f.getLineLength(s.x,s.y,u.x,u.y),s=u;return a;case"A":a=0;var h=i[4],p=i[5],g=i[4]+p,y=Math.PI/180;if(Math.abs(h-g)<y&&(y=Math.abs(h-g)),s=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],h,0),p<0)for(c=h-y;c>g;c-=y)u=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),a+=f.getLineLength(s.x,s.y,u.x,u.y),s=u;else for(c=h+y;c<g;c+=y)u=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),a+=f.getLineLength(s.x,s.y,u.x,u.y),s=u;return u=f.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],g,0),a+=f.getLineLength(s.x,s.y,u.x,u.y),a}return 0}static convertEndpointToCenterParameterization(e,n,r,i,a,s,u,c,f){var h=f*(Math.PI/180),p=Math.cos(h)*(e-r)/2+Math.sin(h)*(n-i)/2,g=-1*Math.sin(h)*(e-r)/2+Math.cos(h)*(n-i)/2,y=p*p/(u*u)+g*g/(c*c);y>1&&(u*=Math.sqrt(y),c*=Math.sqrt(y));var v=Math.sqrt((u*u*(c*c)-u*u*(g*g)-c*c*(p*p))/(u*u*(g*g)+c*c*(p*p)));a===s&&(v*=-1),isNaN(v)&&(v=0);var w=v*u*g/c,x=v*-c*p/u,_=(e+r)/2+Math.cos(h)*w-Math.sin(h)*x,S=(n+i)/2+Math.sin(h)*w+Math.cos(h)*x,C=function(K){return Math.sqrt(K[0]*K[0]+K[1]*K[1])},O=function(K,te){return(K[0]*te[0]+K[1]*te[1])/(C(K)*C(te))},I=function(K,te){return(K[0]*te[1]<K[1]*te[0]?-1:1)*Math.acos(O(K,te))},L=I([1,0],[(p-w)/u,(g-x)/c]),D=[(p-w)/u,(g-x)/c],U=[(-1*p-w)/u,(-1*g-x)/c],X=I(D,U);return O(D,U)<=-1&&(X=Math.PI),O(D,U)>=1&&(X=0),s===0&&X>0&&(X=X-2*Math.PI),s===1&&X<0&&(X=X+2*Math.PI),[_,S,u,c,L,X,h,s]}}tt.prototype.className="Path";tt.prototype._attrsAffectingSize=["data"];yt(tt);A.addGetterSetter(tt,"data");class So extends Vi{_sceneFunc(e){super._sceneFunc(e);var n=Math.PI*2,r=this.points(),i=r,a=this.tension()!==0&&r.length>4;a&&(i=this.getTensionPoints());var s=this.pointerLength(),u=r.length,c,f;if(a){const g=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[u-2],r[u-1]],y=tt.calcLength(i[i.length-4],i[i.length-3],"C",g),v=tt.getPointOnQuadraticBezier(Math.min(1,1-s/y),g[0],g[1],g[2],g[3],g[4],g[5]);c=r[u-2]-v.x,f=r[u-1]-v.y}else c=r[u-2]-r[u-4],f=r[u-1]-r[u-3];var h=(Math.atan2(f,c)+n)%n,p=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[u-2],r[u-1]),e.rotate(h),e.moveTo(0,0),e.lineTo(-s,p/2),e.lineTo(-s,-p/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),a?(c=(i[0]+i[2])/2-r[0],f=(i[1]+i[3])/2-r[1]):(c=r[2]-r[0],f=r[3]-r[1]),e.rotate((Math.atan2(-f,-c)+n)%n),e.moveTo(0,0),e.lineTo(-s,p/2),e.lineTo(-s,-p/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var 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-n,y:e.y-n,width:e.width+n*2,height:e.height+n*2}}}So.prototype.className="Arrow";yt(So);A.addGetterSetter(So,"pointerLength",10,le());A.addGetterSetter(So,"pointerWidth",10,le());A.addGetterSetter(So,"pointerAtBeginning",!1);A.addGetterSetter(So,"pointerAtEnding",!0);class Ks extends re{_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)}}Ks.prototype._centroid=!0;Ks.prototype.className="Circle";Ks.prototype._attrsAffectingSize=["radius"];yt(Ks);A.addGetterSetter(Ks,"radius",0,le());class Na extends re{_sceneFunc(e){var 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)}}Na.prototype.className="Ellipse";Na.prototype._centroid=!0;Na.prototype._attrsAffectingSize=["radiusX","radiusY"];yt(Na);A.addComponentsGetterSetter(Na,"radius",["x","y"]);A.addGetterSetter(Na,"radiusX",0,le());A.addGetterSetter(Na,"radiusY",0,le());let hi=class sE extends re{constructor(e){super(e),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let s;if(a){const u=this.attrs.cropWidth,c=this.attrs.cropHeight;u&&c?s=[a,this.cropX(),this.cropY(),u,c,0,0,n,r]:s=[a,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?G.drawRoundedRectPath(e,n,r,i):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),a&&(i&&e.clip(),e.drawImage.apply(e,s))}_hitFunc(e){var n=this.width(),r=this.height(),i=this.cornerRadius();e.beginPath(),i?G.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){var i=G.createImageElement();i.onload=function(){var a=new sE({image:i});n(a)},i.onerror=r,i.crossOrigin="Anonymous",i.src=e}};hi.prototype.className="Image";yt(hi);A.addGetterSetter(hi,"cornerRadius",0,A0(4));A.addGetterSetter(hi,"image");A.addComponentsGetterSetter(hi,"crop",["x","y","width","height"]);A.addGetterSetter(hi,"cropX",0,le());A.addGetterSetter(hi,"cropY",0,le());A.addGetterSetter(hi,"cropWidth",0,le());A.addGetterSetter(hi,"cropHeight",0,le());var lE=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],m$="Change.konva",v$="none",ay="up",oy="right",sy="down",ly="left",y$=lE.length;class N0 extends zs{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){var n=this,r,i=function(){n._sync()};for(r=0;r<y$;r++)e.on(lE[r]+m$,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var e=this.getText(),n=this.getTag(),r,i,a,s,u,c,f;if(e&&n){switch(r=e.width(),i=e.height(),a=n.pointerDirection(),s=n.pointerWidth(),f=n.pointerHeight(),u=0,c=0,a){case ay:u=r/2,c=-1*f;break;case oy:u=r+s,c=i/2;break;case sy:u=r/2,c=i+f;break;case ly:u=-1*s,c=i/2;break}n.setAttrs({x:-1*u,y:-1*c,width:r,height:i}),e.setAttrs({x:-1*u,y:-1*c})}}}N0.prototype.className="Label";yt(N0);class _o extends re{_sceneFunc(e){var n=this.width(),r=this.height(),i=this.pointerDirection(),a=this.pointerWidth(),s=this.pointerHeight(),u=this.cornerRadius();let c=0,f=0,h=0,p=0;typeof u=="number"?c=f=h=p=Math.min(u,n/2,r/2):(c=Math.min(u[0]||0,n/2,r/2),f=Math.min(u[1]||0,n/2,r/2),p=Math.min(u[2]||0,n/2,r/2),h=Math.min(u[3]||0,n/2,r/2)),e.beginPath(),e.moveTo(c,0),i===ay&&(e.lineTo((n-a)/2,0),e.lineTo(n/2,-1*s),e.lineTo((n+a)/2,0)),e.lineTo(n-f,0),e.arc(n-f,f,f,Math.PI*3/2,0,!1),i===oy&&(e.lineTo(n,(r-s)/2),e.lineTo(n+a,r/2),e.lineTo(n,(r+s)/2)),e.lineTo(n,r-p),e.arc(n-p,r-p,p,0,Math.PI/2,!1),i===sy&&(e.lineTo((n+a)/2,r),e.lineTo(n/2,r+s),e.lineTo((n-a)/2,r)),e.lineTo(h,r),e.arc(h,r-h,h,Math.PI/2,Math.PI,!1),i===ly&&(e.lineTo(0,(r+s)/2),e.lineTo(-1*a,r/2),e.lineTo(0,(r-s)/2)),e.lineTo(0,c),e.arc(c,c,c,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){var e=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),a=this.pointerDirection(),s=this.width(),u=this.height();return a===ay?(n-=i,u+=i):a===sy?u+=i:a===ly?(e-=r*1.5,s+=r):a===oy&&(s+=r*1.5),{x:e,y:n,width:s,height:u}}}_o.prototype.className="Tag";yt(_o);A.addGetterSetter(_o,"pointerDirection",v$);A.addGetterSetter(_o,"pointerWidth",0,le());A.addGetterSetter(_o,"pointerHeight",0,le());A.addGetterSetter(_o,"cornerRadius",0,A0(4));class ec extends re{_sceneFunc(e){var n=this.cornerRadius(),r=this.width(),i=this.height();e.beginPath(),n?G.drawRoundedRectPath(e,r,i,n):e.rect(0,0,r,i),e.closePath(),e.fillStrokeShape(this)}}ec.prototype.className="Rect";yt(ec);A.addGetterSetter(ec,"cornerRadius",0,A0(4));class wo extends re{_sceneFunc(e){const n=this._getPoints();e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var 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(var 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();var n=e[0].x,r=e[0].y,i=e[0].x,a=e[0].y;return e.forEach(s=>{n=Math.min(n,s.x),r=Math.max(r,s.x),i=Math.min(i,s.y),a=Math.max(a,s.y)}),{x:n,y:i,width:r-n,height:a-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}wo.prototype.className="RegularPolygon";wo.prototype._centroid=!0;wo.prototype._attrsAffectingSize=["radius"];yt(wo);A.addGetterSetter(wo,"radius",0,le());A.addGetterSetter(wo,"sides",0,le());var Db=Math.PI*2;class bo extends re{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,Db,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),Db,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)}}bo.prototype.className="Ring";bo.prototype._centroid=!0;bo.prototype._attrsAffectingSize=["innerRadius","outerRadius"];yt(bo);A.addGetterSetter(bo,"innerRadius",0,le());A.addGetterSetter(bo,"outerRadius",0,le());class pi extends re{constructor(e){super(e),this._updated=!0,this.anim=new dr(()=>{var 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){var n=this.animation(),r=this.frameIndex(),i=r*4,a=this.animations()[n],s=this.frameOffsets(),u=a[i+0],c=a[i+1],f=a[i+2],h=a[i+3],p=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,f,h),e.closePath(),e.fillStrokeShape(this)),p)if(s){var g=s[n],y=r*2;e.drawImage(p,u,c,f,h,g[y+0],g[y+1],f,h)}else e.drawImage(p,u,c,f,h,0,0,f,h)}_hitFunc(e){var n=this.animation(),r=this.frameIndex(),i=r*4,a=this.animations()[n],s=this.frameOffsets(),u=a[i+2],c=a[i+3];if(e.beginPath(),s){var f=s[n],h=r*2;e.rect(f[h+0],f[h+1],u,c)}else e.rect(0,0,u,c);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var 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(){var e=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],a=i.length/4;e<a-1?this.frameIndex(e+1):this.frameIndex(0)}}pi.prototype.className="Sprite";yt(pi);A.addGetterSetter(pi,"animation");A.addGetterSetter(pi,"animations");A.addGetterSetter(pi,"frameOffsets");A.addGetterSetter(pi,"image");A.addGetterSetter(pi,"frameIndex",0,le());A.addGetterSetter(pi,"frameRate",17,le());A.backCompat(pi,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Ba extends re{_sceneFunc(e){var n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-r);for(var a=1;a<i*2;a++){var s=a%2===0?r:n,u=s*Math.sin(a*Math.PI/i),c=-1*s*Math.cos(a*Math.PI/i);e.lineTo(u,c)}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)}}Ba.prototype.className="Star";Ba.prototype._centroid=!0;Ba.prototype._attrsAffectingSize=["innerRadius","outerRadius"];yt(Ba);A.addGetterSetter(Ba,"numPoints",5,le());A.addGetterSetter(Ba,"innerRadius",0,le());A.addGetterSetter(Ba,"outerRadius",0,le());function uE(t){return Array.from(t)}var as="auto",S$="center",Hl="justify",_$="Change.konva",w$="2d",Nb="-",cE="left",b$="text",C$="Text",x$="top",k$="bottom",Bb="middle",fE="normal",E$="px ",jf=" ",P$="right",O$="word",T$="char",Fb="none",Im="…",dE=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],R$=dE.length;function A$(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(", ")}var Hf;function Lm(){return Hf||(Hf=G.createCanvasElement().getContext(w$),Hf)}function I$(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function L$(t){t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function M$(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let vt=class extends re{constructor(e){super(M$(e)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<R$;n++)this.on(dE[n]+_$,this._setTextData);this._setTextData()}_sceneFunc(e){var n=this.textArr,r=n.length;if(this.text()){var i=this.padding(),a=this.fontSize(),s=this.lineHeight()*a,u=this.verticalAlign(),c=0,f=this.align(),h=this.getWidth(),p=this.letterSpacing(),g=this.fill(),y=this.textDecoration(),v=y.indexOf("underline")!==-1,w=y.indexOf("line-through")!==-1,x,_=0,_=s/2,S=0,C=0;for(e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",Bb),e.setAttr("textAlign",cE),u===Bb?c=(this.getHeight()-r*s-i*2)/2:u===k$&&(c=this.getHeight()-r*s-i*2),e.translate(i,c+i),x=0;x<r;x++){var S=0,C=0,O=n[x],I=O.text,L=O.width,D=O.lastInParagraph,U,X,K;if(e.save(),f===P$?S+=h-L-i*2:f===S$&&(S+=(h-L-i*2)/2),v){e.save(),e.beginPath(),e.moveTo(S,_+C+Math.round(a/2)),U=I.split(" ").length-1,X=U===0,K=f===Hl&&!D?h-i*2:L,e.lineTo(S+Math.round(K),_+C+Math.round(a/2)),e.lineWidth=a/15;const V=this._getLinearGradient();e.strokeStyle=V||g,e.stroke(),e.restore()}if(w){e.save(),e.beginPath(),e.moveTo(S,_+C),U=I.split(" ").length-1,X=U===0,K=f===Hl&&D&&!X?h-i*2:L,e.lineTo(S+Math.round(K),_+C),e.lineWidth=a/15;const V=this._getLinearGradient();e.strokeStyle=V||g,e.stroke(),e.restore()}if(p!==0||f===Hl){U=I.split(" ").length-1;for(var te=uE(I),ce=0;ce<te.length;ce++){var j=te[ce];j===" "&&!D&&f===Hl&&(S+=(h-i*2-L)/U),this._partialTextX=S,this._partialTextY=_+C,this._partialText=j,e.fillStrokeShape(this),S+=this.measureSize(j).width+p}}else this._partialTextX=S,this._partialTextY=_+C,this._partialText=I,e.fillStrokeShape(this);e.restore(),r>1&&(_+=s)}}}_hitFunc(e){var n=this.getWidth(),r=this.getHeight();e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}setText(e){var n=G._isString(e)?e:e==null?"":e+"";return this._setAttr(b$,n),this}getWidth(){var e=this.attrs.width===as||this.attrs.width===void 0;return e?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var e=this.attrs.height===as||this.attrs.height===void 0;return e?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return G.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=Lm(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(e),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+jf+this.fontVariant()+jf+(this.fontSize()+E$)+A$(this.fontFamily())}_addTextLine(e){this.align()===Hl&&(e=e.trim());var r=this._getTextWidth(e);return this.textArr.push({text:e,width:r,lastInParagraph:!1})}_getTextWidth(e){var n=this.letterSpacing(),r=e.length;return Lm().measureText(e).width+(r?n*(r-1):0)}_setTextData(){var e=this.text().split(`
`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,a=this.attrs.width,s=this.attrs.height,u=a!==as&&a!==void 0,c=s!==as&&s!==void 0,f=this.padding(),h=a-f*2,p=s-f*2,g=0,y=this.wrap(),v=y!==Fb,w=y!==T$&&v,x=this.ellipsis();this.textArr=[],Lm().font=this._getContextFont();for(var _=x?this._getTextWidth(Im):0,S=0,C=e.length;S<C;++S){var O=e[S],I=this._getTextWidth(O);if(u&&I>h)for(;O.length>0;){for(var L=0,D=O.length,U="",X=0;L<D;){var K=L+D>>>1,te=O.slice(0,K+1),ce=this._getTextWidth(te)+_;ce<=h?(L=K+1,U=te,X=ce):D=K}if(U){if(w){var j,T=O[U.length],$=T===jf||T===Nb;$&&X<=h?j=U.length:j=Math.max(U.lastIndexOf(jf),U.lastIndexOf(Nb))+1,j>0&&(L=j,U=U.slice(0,L),X=this._getTextWidth(U))}U=U.trimRight(),this._addTextLine(U),r=Math.max(r,X),g+=i;var V=this._shouldHandleEllipsis(g);if(V){this._tryToAddEllipsisToLastLine();break}if(O=O.slice(L),O=O.trimLeft(),O.length>0&&(I=this._getTextWidth(O),I<=h)){this._addTextLine(O),g+=i,r=Math.max(r,I);break}}else break}else this._addTextLine(O),g+=i,r=Math.max(r,I),this._shouldHandleEllipsis(g)&&S<C-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),c&&g+i>p)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(e){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,a=i!==as&&i!==void 0,s=this.padding(),u=i-s*2,c=this.wrap(),f=c!==Fb;return!f||a&&e+r>u}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,n=e!==as&&e!==void 0,r=this.padding(),i=e-r*2,a=this.ellipsis(),s=this.textArr[this.textArr.length-1];if(!(!s||!a)){if(n){var u=this._getTextWidth(s.text+Im)<i;u||(s.text=s.text.slice(0,s.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(s.text+Im)}}getStrokeScaleEnabled(){return!0}};vt.prototype._fillFunc=I$;vt.prototype._strokeFunc=L$;vt.prototype.className=C$;vt.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];yt(vt);A.overWriteSetter(vt,"width",I0());A.overWriteSetter(vt,"height",I0());A.addGetterSetter(vt,"fontFamily","Arial");A.addGetterSetter(vt,"fontSize",12,le());A.addGetterSetter(vt,"fontStyle",fE);A.addGetterSetter(vt,"fontVariant",fE);A.addGetterSetter(vt,"padding",0,le());A.addGetterSetter(vt,"align",cE);A.addGetterSetter(vt,"verticalAlign",x$);A.addGetterSetter(vt,"lineHeight",1,le());A.addGetterSetter(vt,"wrap",O$);A.addGetterSetter(vt,"ellipsis",!1,jr());A.addGetterSetter(vt,"letterSpacing",0,le());A.addGetterSetter(vt,"text","",qs());A.addGetterSetter(vt,"textDecoration","");var D$="",hE="normal";function pE(t){t.fillText(this.partialText,0,0)}function gE(t){t.strokeText(this.partialText,0,0)}class Nt extends re{constructor(e){super(e),this.dummyCanvas=G.createCanvasElement(),this.dataArray=[],this.dataArray=tt.parsePathData(this.attrs.data),this.on("dataChange.konva",function(){this.dataArray=tt.parsePathData(this.attrs.data),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();var n=this.textDecoration(),r=this.fill(),i=this.fontSize(),a=this.glyphInfo;n==="underline"&&e.beginPath();for(var s=0;s<a.length;s++){e.save();var u=a[s].p0;e.translate(u.x,u.y),e.rotate(a[s].rotation),this.partialText=a[s].text,e.fillStrokeShape(this),n==="underline"&&(s===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();var n=this.glyphInfo;if(n.length>=1){var r=n[0].p0;e.moveTo(r.x,r.y)}for(var i=0;i<n.length;i++){var a=n[i].p1;e.lineTo(a.x,a.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return G.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return vt.prototype.setText.call(this,e)}_getContextFont(){return vt.prototype._getContextFont.call(this)}_getTextSize(e){var n=this.dummyCanvas,r=n.getContext("2d");r.save(),r.font=this._getContextFont();var i=r.measureText(e);return r.restore(),{width:i.width,height:parseInt(this.attrs.fontSize,10)}}_setTextData(){var e=this,n=this._getTextSize(this.attrs.text),r=this.letterSpacing(),i=this.align(),a=this.kerningFunc();this.textWidth=n.width,this.textHeight=n.height;var s=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);this.glyphInfo=[];for(var u=0,c=0;c<e.dataArray.length;c++)e.dataArray[c].pathLength>0&&(u+=e.dataArray[c].pathLength);var f=0;i==="center"&&(f=Math.max(0,u/2-s/2)),i==="right"&&(f=Math.max(0,u-s));for(var h=uE(this.text()),p=this.text().split(" ").length-1,g,y,v,w=-1,x=0,_=function(){x=0;for(var ce=e.dataArray,j=w+1;j<ce.length;j++){if(ce[j].pathLength>0)return w=j,ce[j];ce[j].command==="M"&&(g={x:ce[j].points[0],y:ce[j].points[1]})}return{}},S=function(ce){var j=e._getTextSize(ce).width+r;ce===" "&&i==="justify"&&(j+=(u-s)/p);var T=0,$=0;for(y=void 0;Math.abs(j-T)/j>.01&&$<20;){$++;for(var V=T;v===void 0;)v=_(),v&&V+v.pathLength<j&&(V+=v.pathLength,v=void 0);if(Object.keys(v).length===0||g===void 0)return;var ie=!1;switch(v.command){case"L":tt.getLineLength(g.x,g.y,v.points[0],v.points[1])>j?y=tt.getPointOnLine(j,g.x,g.y,v.points[0],v.points[1],g.x,g.y):v=void 0;break;case"A":var H=v.points[4],Y=v.points[5],Q=v.points[4]+Y;x===0?x=H+1e-8:j>T?x+=Math.PI/180*Y/Math.abs(Y):x-=Math.PI/360*Y/Math.abs(Y),(Y<0&&x<Q||Y>=0&&x>Q)&&(x=Q,ie=!0),y=tt.getPointOnEllipticalArc(v.points[0],v.points[1],v.points[2],v.points[3],x,v.points[6]);break;case"C":x===0?j>v.pathLength?x=1e-8:x=j/v.pathLength:j>T?x+=(j-T)/v.pathLength/2:x=Math.max(x-(T-j)/v.pathLength/2,0),x>1&&(x=1,ie=!0),y=tt.getPointOnCubicBezier(x,v.start.x,v.start.y,v.points[0],v.points[1],v.points[2],v.points[3],v.points[4],v.points[5]);break;case"Q":x===0?x=j/v.pathLength:j>T?x+=(j-T)/v.pathLength:x-=(T-j)/v.pathLength,x>1&&(x=1,ie=!0),y=tt.getPointOnQuadraticBezier(x,v.start.x,v.start.y,v.points[0],v.points[1],v.points[2],v.points[3]);break}y!==void 0&&(T=tt.getLineLength(g.x,g.y,y.x,y.y)),ie&&(ie=!1,v=void 0)}},C="C",O=e._getTextSize(C).width+r,I=f/O-1,L=0;L<I&&(S(C),!(g===void 0||y===void 0));L++)g=y;for(var D=0;D<h.length&&(S(h[D]),!(g===void 0||y===void 0));D++){var U=tt.getLineLength(g.x,g.y,y.x,y.y),X=0;if(a)try{X=a(h[D-1],h[D])*this.fontSize()}catch{X=0}g.x+=X,y.x+=X,this.textWidth+=X;var K=tt.getPointOnLine(X+U/2,g.x,g.y,y.x,y.y),te=Math.atan2(y.y-g.y,y.x-g.x);this.glyphInfo.push({transposeX:K.x,transposeY:K.y,text:h[D],rotation:te,p0:g,p1:y}),g=y}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var e=[];this.glyphInfo.forEach(function(h){e.push(h.p0.x),e.push(h.p0.y),e.push(h.p1.x),e.push(h.p1.y)});for(var n=e[0]||0,r=e[0]||0,i=e[1]||0,a=e[1]||0,s,u,c=0;c<e.length/2;c++)s=e[c*2],u=e[c*2+1],n=Math.min(n,s),r=Math.max(r,s),i=Math.min(i,u),a=Math.max(a,u);var f=this.fontSize();return{x:n-f/2,y:i-f/2,width:r-n+f,height:a-i+f}}destroy(){return G.releaseCanvas(this.dummyCanvas),super.destroy()}}Nt.prototype._fillFunc=pE;Nt.prototype._strokeFunc=gE;Nt.prototype._fillFuncHit=pE;Nt.prototype._strokeFuncHit=gE;Nt.prototype.className="TextPath";Nt.prototype._attrsAffectingSize=["text","fontSize","data"];yt(Nt);A.addGetterSetter(Nt,"data");A.addGetterSetter(Nt,"fontFamily","Arial");A.addGetterSetter(Nt,"fontSize",12,le());A.addGetterSetter(Nt,"fontStyle",hE);A.addGetterSetter(Nt,"align","left");A.addGetterSetter(Nt,"letterSpacing",0,le());A.addGetterSetter(Nt,"textBaseline","middle");A.addGetterSetter(Nt,"fontVariant",hE);A.addGetterSetter(Nt,"text",D$);A.addGetterSetter(Nt,"textDecoration",null);A.addGetterSetter(Nt,"kerningFunc",null);var mE="tr-konva",N$=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange"].map(t=>t+`.${mE}`).join(" "),$b="nodesRect",B$=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],F$={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const $$="ontouchstart"in pe._global;function z$(t,e){if(t==="rotater")return"crosshair";e+=G.degToRad(F$[t]||0);var n=(G.radToDeg(e)%360+360)%360;return G._inRange(n,315+22.5,360)||G._inRange(n,0,22.5)?"ns-resize":G._inRange(n,45-22.5,45+22.5)?"nesw-resize":G._inRange(n,90-22.5,90+22.5)?"ew-resize":G._inRange(n,135-22.5,135+22.5)?"nwse-resize":G._inRange(n,180-22.5,180+22.5)?"ns-resize":G._inRange(n,225-22.5,225+22.5)?"nesw-resize":G._inRange(n,270-22.5,270+22.5)?"ew-resize":G._inRange(n,315-22.5,315+22.5)?"nwse-resize":(G.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var sh=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],zb=1e8;function G$(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 vE(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 Object.assign(Object.assign({},t),{rotation:t.rotation+e,x:r,y:i})}function U$(t,e){const n=G$(t);return vE(t,e,n)}function j$(t,e,n){let r=e;for(let i=0;i<t.length;i++){const a=pe.getAngle(t[i]),s=Math.abs(a-e)%(Math.PI*2);Math.min(s,Math.PI*2-s)<n&&(r=a)}return r}class Ke extends zs{constructor(e){super(e),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(N$,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return G.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 mE+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach(),this._nodes=e,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(r=>{const i=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},a=r._attrsAffectingSize.map(s=>s+"Change."+this._getEventNamespace()).join(" ");r.on(a,i),r.on(B$.map(s=>s+`.${this._getEventNamespace()}`).join(" "),i),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,i),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&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(),a=i.x-n.x,s=i.y-n.y;this.nodes().forEach(u=>{if(u===e||u.isDragging())return;const c=u.getAbsolutePosition();u.setAbsolutePosition({x:c.x+a,y:c.y+s}),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($b),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache($b,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),r){var i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=e.getAbsoluteScale(r),s=e.getAbsolutePosition(r),u=i.x*a.x-e.offsetX()*a.x,c=i.y*a.y-e.offsetY()*a.y;const f=(pe.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),h={x:s.x+u*Math.cos(f)+c*Math.sin(-f),y:s.y+c*Math.cos(f)+u*Math.sin(f),width:i.width*a.x,height:i.height*a.y,rotation:f};return vE(h,-pe.getAngle(n),{x:0,y:0})}__getNodeRect(){var e=this.getNode();if(!e)return{x:-zb,y:-zb,width:0,height:0,rotation:0};const n=[];this.nodes().map(f=>{const h=f.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var p=[{x:h.x,y:h.y},{x:h.x+h.width,y:h.y},{x:h.x+h.width,y:h.y+h.height},{x:h.x,y:h.y+h.height}],g=f.getAbsoluteTransform();p.forEach(function(y){var v=g.point(y);n.push(v)})});const r=new Hn;r.rotate(-pe.getAngle(this.rotation()));var i,a,s,u;n.forEach(function(f){var h=r.point(f);i===void 0&&(i=s=h.x,a=u=h.y),i=Math.min(i,h.x),a=Math.min(a,h.y),s=Math.max(s,h.x),u=Math.max(u,h.y)}),r.invert();const c=r.point({x:i,y:a});return{x:c.x,y:c.y,width:s-i,height:u-a,rotation:pe.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(),sh.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}_createAnchor(e){var n=new ec({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:$$?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",()=>{var i=pe.getAngle(this.rotation()),a=z$(e,i);n.getStage().content&&(n.getStage().content.style.cursor=a),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var e=new re({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var r=this.getParent(),i=r.padding();n.beginPath(),n.rect(-i,-i,this.width()+i*2,this.height()+i*2),n.moveTo(this.width()/2,-i),r.rotateEnabled()&&n.lineTo(this.width()/2,-r.rotateAnchorOffset()*G._sign(this.height())-i),n.fillStrokeShape(this)},hitFunc:(n,r)=>{if(this.shouldOverdrawWholeArea()){var 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){this._movingAnchorName=e.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,a=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/a),this.cos=Math.abs(r/a),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;var s=e.target.getAbsolutePosition(),u=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:u.x-s.x,y:u.y-s.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(c=>{c._fire("transformstart",{evt:e.evt,target:c})})}_handleMouseMove(e){var n,r,i,a=this.findOne("."+this._movingAnchorName),s=a.getStage();s.setPointersPositions(e);const u=s.getPointerPosition();let c={x:u.x-this._anchorDragOffset.x,y:u.y-this._anchorDragOffset.y};const f=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(c=this.anchorDragBoundFunc()(f,c,e)),a.setAbsolutePosition(c);const h=a.getAbsolutePosition();if(!(f.x===h.x&&f.y===h.y)){if(this._movingAnchorName==="rotater"){var p=this._getNodeRect();n=a.x()-p.width/2,r=-a.y()+p.height/2;let ce=Math.atan2(-r,n)+Math.PI/2;p.height<0&&(ce-=Math.PI);var g=pe.getAngle(this.rotation());const j=g+ce,T=pe.getAngle(this.rotationSnapTolerance()),V=j$(this.rotationSnaps(),j,T)-p.rotation,ie=U$(p,V);this._fitNodesInto(ie,e);return}var y=this.keepRatio()||e.shiftKey,S=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(y){var v=S?{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(v.x-a.x(),2)+Math.pow(v.y-a.y(),2));var w=this.findOne(".top-left").x()>v.x?-1:1,x=this.findOne(".top-left").y()>v.y?-1:1;n=i*this.cos*w,r=i*this.sin*x,this.findOne(".top-left").x(v.x-n),this.findOne(".top-left").y(v.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(y){var v=S?{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(a.x()-v.x,2)+Math.pow(v.y-a.y(),2));var w=this.findOne(".top-right").x()<v.x?-1:1,x=this.findOne(".top-right").y()>v.y?-1:1;n=i*this.cos*w,r=i*this.sin*x,this.findOne(".top-right").x(v.x+n),this.findOne(".top-right").y(v.y-r)}var _=a.position();this.findOne(".top-left").y(_.y),this.findOne(".bottom-right").x(_.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(y){var v=S?{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(v.x-a.x(),2)+Math.pow(a.y()-v.y,2));var w=v.x<a.x()?-1:1,x=a.y()<v.y?-1:1;n=i*this.cos*w,r=i*this.sin*x,a.x(v.x-n),a.y(v.y+r)}_=a.position(),this.findOne(".top-left").x(_.x),this.findOne(".bottom-right").y(_.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(a.y());else if(this._movingAnchorName==="bottom-right"){if(y){var v=S?{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(a.x()-v.x,2)+Math.pow(a.y()-v.y,2));var w=this.findOne(".bottom-right").x()<v.x?-1:1,x=this.findOne(".bottom-right").y()<v.y?-1:1;n=i*this.cos*w,r=i*this.sin*x,this.findOne(".bottom-right").x(v.x+n),this.findOne(".bottom-right").y(v.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var S=this.centeredScaling()||e.altKey;if(S){var C=this.findOne(".top-left"),O=this.findOne(".bottom-right"),I=C.x(),L=C.y(),D=this.getWidth()-O.x(),U=this.getHeight()-O.y();O.move({x:-I,y:-L}),C.move({x:D,y:U})}var X=this.findOne(".top-left").getAbsolutePosition();n=X.x,r=X.y;var K=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),te=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:K,height:te,rotation:pe.getAngle(this.rotation())},e)}}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){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));var n=this.getNode();this._fire("transformend",{evt:e,target:n}),n&&this._nodes.forEach(r=>{r._fire("transformend",{evt:e,target:r})}),this._movingAnchorName=null}}_fitNodesInto(e,n){var r=this._getNodeRect();const i=1;if(G._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(G._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const a=this.flipEnabled();var s=new Hn;if(s.rotate(pe.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const p=s.point({x:-this.padding()*2,y:0});if(e.x+=p.x,e.y+=p.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,!a){this.update();return}}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const p=s.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,e.width+=this.padding()*2,!a){this.update();return}}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const p=s.point({x:0,y:-this.padding()*2});if(e.x+=p.x,e.y+=p.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,e.height+=this.padding()*2,!a){this.update();return}}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const p=s.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=p.x,this._anchorDragOffset.y-=p.y,e.height+=this.padding()*2,!a){this.update();return}}if(this.boundBoxFunc()){const p=this.boundBoxFunc()(r,e);p?e=p:G.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const u=1e7,c=new Hn;c.translate(r.x,r.y),c.rotate(r.rotation),c.scale(r.width/u,r.height/u);const f=new Hn;f.translate(e.x,e.y),f.rotate(e.rotation),f.scale(e.width/u,e.height/u);const h=f.multiply(c.invert());this._nodes.forEach(p=>{var g;const y=p.getParent().getAbsoluteTransform(),v=p.getTransform().copy();v.translate(p.offsetX(),p.offsetY());const w=new Hn;w.multiply(y.copy().invert()).multiply(h).multiply(y).multiply(v);const x=w.decompose();p.setAttrs(x),this._fire("transform",{evt:n,target:p}),p._fire("transform",{evt:n,target:p}),(g=p.getLayer())===null||g===void 0||g.batchDraw()}),this.rotation(G._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e,n=this._getNodeRect();this.rotation(G._getRotation(n.rotation));var r=n.width,i=n.height,a=this.enabledAnchors(),s=this.resizeEnabled(),u=this.padding(),c=this.anchorSize();this.find("._anchor").forEach(f=>{f.setAttrs({width:c,height:c,offsetX:c/2,offsetY:c/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:c/2+u,offsetY:c/2+u,visible:s&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:c/2+u,visible:s&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:c/2-u,offsetY:c/2+u,visible:s&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:c/2+u,visible:s&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:c/2-u,visible:s&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:c/2+u,offsetY:c/2-u,visible:s&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:c/2-u,visible:s&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:c/2-u,offsetY:c/2-u,visible:s&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*G._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}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),zs.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return se.prototype.toObject.call(this)}clone(e){var n=se.prototype.clone.call(this,e);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}function H$(t){return t instanceof Array||G.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){sh.indexOf(e)===-1&&G.warn("Unknown anchor name: "+e+". Available names are: "+sh.join(", "))}),t||[]}Ke.prototype.className="Transformer";yt(Ke);A.addGetterSetter(Ke,"enabledAnchors",sh,H$);A.addGetterSetter(Ke,"flipEnabled",!0,jr());A.addGetterSetter(Ke,"resizeEnabled",!0);A.addGetterSetter(Ke,"anchorSize",10,le());A.addGetterSetter(Ke,"rotateEnabled",!0);A.addGetterSetter(Ke,"rotationSnaps",[]);A.addGetterSetter(Ke,"rotateAnchorOffset",50,le());A.addGetterSetter(Ke,"rotationSnapTolerance",5,le());A.addGetterSetter(Ke,"borderEnabled",!0);A.addGetterSetter(Ke,"anchorStroke","rgb(0, 161, 255)");A.addGetterSetter(Ke,"anchorStrokeWidth",1,le());A.addGetterSetter(Ke,"anchorFill","white");A.addGetterSetter(Ke,"anchorCornerRadius",0,le());A.addGetterSetter(Ke,"borderStroke","rgb(0, 161, 255)");A.addGetterSetter(Ke,"borderStrokeWidth",1,le());A.addGetterSetter(Ke,"borderDash");A.addGetterSetter(Ke,"keepRatio",!0);A.addGetterSetter(Ke,"centeredScaling",!1);A.addGetterSetter(Ke,"ignoreStroke",!1);A.addGetterSetter(Ke,"padding",0,le());A.addGetterSetter(Ke,"node");A.addGetterSetter(Ke,"nodes");A.addGetterSetter(Ke,"boundBoxFunc");A.addGetterSetter(Ke,"anchorDragBoundFunc");A.addGetterSetter(Ke,"shouldOverdrawWholeArea",!1);A.addGetterSetter(Ke,"useSingleNodeRotation",!0);A.backCompat(Ke,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class qi extends re{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,pe.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)}}qi.prototype.className="Wedge";qi.prototype._centroid=!0;qi.prototype._attrsAffectingSize=["radius"];yt(qi);A.addGetterSetter(qi,"radius",0,le());A.addGetterSetter(qi,"angle",0,le());A.addGetterSetter(qi,"clockwise",!1);A.backCompat(qi,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function Gb(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var W$=[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],V$=[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 q$(t,e){var n=t.data,r=t.width,i=t.height,a,s,u,c,f,h,p,g,y,v,w,x,_,S,C,O,I,L,D,U,X,K,te,ce,j=e+e+1,T=r-1,$=i-1,V=e+1,ie=V*(V+1)/2,H=new Gb,Y=null,Q=H,oe=null,ve=null,we=W$[e],Ue=V$[e];for(u=1;u<j;u++)Q=Q.next=new Gb,u===V&&(Y=Q);for(Q.next=H,p=h=0,s=0;s<i;s++){for(O=I=L=D=g=y=v=w=0,x=V*(U=n[h]),_=V*(X=n[h+1]),S=V*(K=n[h+2]),C=V*(te=n[h+3]),g+=ie*U,y+=ie*X,v+=ie*K,w+=ie*te,Q=H,u=0;u<V;u++)Q.r=U,Q.g=X,Q.b=K,Q.a=te,Q=Q.next;for(u=1;u<V;u++)c=h+((T<u?T:u)<<2),g+=(Q.r=U=n[c])*(ce=V-u),y+=(Q.g=X=n[c+1])*ce,v+=(Q.b=K=n[c+2])*ce,w+=(Q.a=te=n[c+3])*ce,O+=U,I+=X,L+=K,D+=te,Q=Q.next;for(oe=H,ve=Y,a=0;a<r;a++)n[h+3]=te=w*we>>Ue,te!==0?(te=255/te,n[h]=(g*we>>Ue)*te,n[h+1]=(y*we>>Ue)*te,n[h+2]=(v*we>>Ue)*te):n[h]=n[h+1]=n[h+2]=0,g-=x,y-=_,v-=S,w-=C,x-=oe.r,_-=oe.g,S-=oe.b,C-=oe.a,c=p+((c=a+e+1)<T?c:T)<<2,O+=oe.r=n[c],I+=oe.g=n[c+1],L+=oe.b=n[c+2],D+=oe.a=n[c+3],g+=O,y+=I,v+=L,w+=D,oe=oe.next,x+=U=ve.r,_+=X=ve.g,S+=K=ve.b,C+=te=ve.a,O-=U,I-=X,L-=K,D-=te,ve=ve.next,h+=4;p+=r}for(a=0;a<r;a++){for(I=L=D=O=y=v=w=g=0,h=a<<2,x=V*(U=n[h]),_=V*(X=n[h+1]),S=V*(K=n[h+2]),C=V*(te=n[h+3]),g+=ie*U,y+=ie*X,v+=ie*K,w+=ie*te,Q=H,u=0;u<V;u++)Q.r=U,Q.g=X,Q.b=K,Q.a=te,Q=Q.next;for(f=r,u=1;u<=e;u++)h=f+a<<2,g+=(Q.r=U=n[h])*(ce=V-u),y+=(Q.g=X=n[h+1])*ce,v+=(Q.b=K=n[h+2])*ce,w+=(Q.a=te=n[h+3])*ce,O+=U,I+=X,L+=K,D+=te,Q=Q.next,u<$&&(f+=r);for(h=a,oe=H,ve=Y,s=0;s<i;s++)c=h<<2,n[c+3]=te=w*we>>Ue,te>0?(te=255/te,n[c]=(g*we>>Ue)*te,n[c+1]=(y*we>>Ue)*te,n[c+2]=(v*we>>Ue)*te):n[c]=n[c+1]=n[c+2]=0,g-=x,y-=_,v-=S,w-=C,x-=oe.r,_-=oe.g,S-=oe.b,C-=oe.a,c=a+((c=s+V)<$?c:$)*r<<2,g+=O+=oe.r=n[c],y+=I+=oe.g=n[c+1],v+=L+=oe.b=n[c+2],w+=D+=oe.a=n[c+3],oe=oe.next,x+=U=ve.r,_+=X=ve.g,S+=K=ve.b,C+=te=ve.a,O-=U,I-=X,L-=K,D-=te,ve=ve.next,h+=r}}const K$=function(e){var n=Math.round(this.blurRadius());n>0&&q$(e,n)};A.addGetterSetter(se,"blurRadius",0,le(),A.afterSetFilter);const Y$=function(t){var e=this.brightness()*255,n=t.data,r=n.length,i;for(i=0;i<r;i+=4)n[i]+=e,n[i+1]+=e,n[i+2]+=e};A.addGetterSetter(se,"brightness",0,le(),A.afterSetFilter);const X$=function(t){var e=Math.pow((this.contrast()+100)/100,2),n=t.data,r=n.length,i=150,a=150,s=150,u;for(u=0;u<r;u+=4)i=n[u],a=n[u+1],s=n[u+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,a/=255,a-=.5,a*=e,a+=.5,a*=255,s/=255,s-=.5,s*=e,s+=.5,s*=255,i=i<0?0:i>255?255:i,a=a<0?0:a>255?255:a,s=s<0?0:s>255?255:s,n[u]=i,n[u+1]=a,n[u+2]=s};A.addGetterSetter(se,"contrast",0,le(),A.afterSetFilter);const Q$=function(t){var e=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),a=0,s=0,u=t.data,c=t.width,f=t.height,h=c*4,p=f;switch(r){case"top-left":a=-1,s=-1;break;case"top":a=-1,s=0;break;case"top-right":a=-1,s=1;break;case"right":a=0,s=1;break;case"bottom-right":a=1,s=1;break;case"bottom":a=1,s=0;break;case"bottom-left":a=1,s=-1;break;case"left":a=0,s=-1;break;default:G.error("Unknown emboss direction: "+r)}do{var g=(p-1)*h,y=a;p+y<1&&(y=0),p+y>f&&(y=0);var v=(p-1+y)*c*4,w=c;do{var x=g+(w-1)*4,_=s;w+_<1&&(_=0),w+_>c&&(_=0);var S=v+(w-1+_)*4,C=u[x]-u[S],O=u[x+1]-u[S+1],I=u[x+2]-u[S+2],L=C,D=L>0?L:-L,U=O>0?O:-O,X=I>0?I:-I;if(U>D&&(L=O),X>D&&(L=I),L*=e,i){var K=u[x]+L,te=u[x+1]+L,ce=u[x+2]+L;u[x]=K>255?255:K<0?0:K,u[x+1]=te>255?255:te<0?0:te,u[x+2]=ce>255?255:ce<0?0:ce}else{var j=n-L;j<0?j=0:j>255&&(j=255),u[x]=u[x+1]=u[x+2]=j}}while(--w)}while(--p)};A.addGetterSetter(se,"embossStrength",.5,le(),A.afterSetFilter);A.addGetterSetter(se,"embossWhiteLevel",.5,le(),A.afterSetFilter);A.addGetterSetter(se,"embossDirection","top-left",null,A.afterSetFilter);A.addGetterSetter(se,"embossBlend",!1,null,A.afterSetFilter);function Mm(t,e,n,r,i){var a=n-e,s=i-r,u;return a===0?r+s/2:s===0?r:(u=(t-e)/a,u=s*u+r,u)}const J$=function(t){var e=t.data,n=e.length,r=e[0],i=r,a,s=e[1],u=s,c,f=e[2],h=f,p,g,y=this.enhance();if(y!==0){for(g=0;g<n;g+=4)a=e[g+0],a<r?r=a:a>i&&(i=a),c=e[g+1],c<s?s=c:c>u&&(u=c),p=e[g+2],p<f?f=p:p>h&&(h=p);i===r&&(i=255,r=0),u===s&&(u=255,s=0),h===f&&(h=255,f=0);var v,w,x,_,S,C,O,I,L;for(y>0?(w=i+y*(255-i),x=r-y*(r-0),S=u+y*(255-u),C=s-y*(s-0),I=h+y*(255-h),L=f-y*(f-0)):(v=(i+r)*.5,w=i+y*(i-v),x=r+y*(r-v),_=(u+s)*.5,S=u+y*(u-_),C=s+y*(s-_),O=(h+f)*.5,I=h+y*(h-O),L=f+y*(f-O)),g=0;g<n;g+=4)e[g+0]=Mm(e[g+0],r,i,x,w),e[g+1]=Mm(e[g+1],s,u,C,S),e[g+2]=Mm(e[g+2],f,h,L,I)}};A.addGetterSetter(se,"enhance",0,le(),A.afterSetFilter);const Z$=function(t){var e=t.data,n=e.length,r,i;for(r=0;r<n;r+=4)i=.34*e[r]+.5*e[r+1]+.16*e[r+2],e[r]=i,e[r+1]=i,e[r+2]=i};A.addGetterSetter(se,"hue",0,le(),A.afterSetFilter);A.addGetterSetter(se,"saturation",0,le(),A.afterSetFilter);A.addGetterSetter(se,"luminance",0,le(),A.afterSetFilter);const ez=function(t){var e=t.data,n=e.length,r=1,i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,s=this.luminance()*127,u,c=r*i*Math.cos(a*Math.PI/180),f=r*i*Math.sin(a*Math.PI/180),h=.299*r+.701*c+.167*f,p=.587*r-.587*c+.33*f,g=.114*r-.114*c-.497*f,y=.299*r-.299*c-.328*f,v=.587*r+.413*c+.035*f,w=.114*r-.114*c+.293*f,x=.299*r-.3*c+1.25*f,_=.587*r-.586*c-1.05*f,S=.114*r+.886*c-.2*f,C,O,I,L;for(u=0;u<n;u+=4)C=e[u+0],O=e[u+1],I=e[u+2],L=e[u+3],e[u+0]=h*C+p*O+g*I+s,e[u+1]=y*C+v*O+w*I+s,e[u+2]=x*C+_*O+S*I+s,e[u+3]=L},tz=function(t){var e=t.data,n=e.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),a=Math.abs(this.hue()+360)%360,s,u=r*i*Math.cos(a*Math.PI/180),c=r*i*Math.sin(a*Math.PI/180),f=.299*r+.701*u+.167*c,h=.587*r-.587*u+.33*c,p=.114*r-.114*u-.497*c,g=.299*r-.299*u-.328*c,y=.587*r+.413*u+.035*c,v=.114*r-.114*u+.293*c,w=.299*r-.3*u+1.25*c,x=.587*r-.586*u-1.05*c,_=.114*r+.886*u-.2*c,S,C,O,I;for(s=0;s<n;s+=4)S=e[s+0],C=e[s+1],O=e[s+2],I=e[s+3],e[s+0]=f*S+h*C+p*O,e[s+1]=g*S+y*C+v*O,e[s+2]=w*S+x*C+_*O,e[s+3]=I};A.addGetterSetter(se,"hue",0,le(),A.afterSetFilter);A.addGetterSetter(se,"saturation",0,le(),A.afterSetFilter);A.addGetterSetter(se,"value",0,le(),A.afterSetFilter);const nz=function(t){var e=t.data,n=e.length,r;for(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]};var rz=function(t,e,n){var r=t.data,i=e.data,a=t.width,s=t.height,u=n.polarCenterX||a/2,c=n.polarCenterY||s/2,f,h,p,g=0,y=0,v=0,w=0,x,_=Math.sqrt(u*u+c*c);h=a-u,p=s-c,x=Math.sqrt(h*h+p*p),_=x>_?x:_;var S=s,C=a,O,I,L=360/C*Math.PI/180,D,U;for(I=0;I<C;I+=1)for(D=Math.sin(I*L),U=Math.cos(I*L),O=0;O<S;O+=1)h=Math.floor(u+_*O/S*U),p=Math.floor(c+_*O/S*D),f=(p*a+h)*4,g=r[f+0],y=r[f+1],v=r[f+2],w=r[f+3],f=(I+O*a)*4,i[f+0]=g,i[f+1]=y,i[f+2]=v,i[f+3]=w},iz=function(t,e,n){var r=t.data,i=e.data,a=t.width,s=t.height,u=n.polarCenterX||a/2,c=n.polarCenterY||s/2,f,h,p,g,y,v=0,w=0,x=0,_=0,S,C=Math.sqrt(u*u+c*c);h=a-u,p=s-c,S=Math.sqrt(h*h+p*p),C=S>C?S:C;var O=s,I=a,L,D,U=n.polarRotation||0,X,K;for(h=0;h<a;h+=1)for(p=0;p<s;p+=1)g=h-u,y=p-c,L=Math.sqrt(g*g+y*y)*O/C,D=(Math.atan2(y,g)*180/Math.PI+360+U)%360,D=D*I/360,X=Math.floor(D),K=Math.floor(L),f=(K*a+X)*4,v=r[f+0],w=r[f+1],x=r[f+2],_=r[f+3],f=(p*a+h)*4,i[f+0]=v,i[f+1]=w,i[f+2]=x,i[f+3]=_};const az=function(t){var e=t.width,n=t.height,r,i,a,s,u,c,f,h,p,g,y=Math.round(this.kaleidoscopePower()),v=Math.round(this.kaleidoscopeAngle()),w=Math.floor(e*(v%360)/360);if(!(y<1)){var x=G.createCanvasElement();x.width=e,x.height=n;var _=x.getContext("2d").getImageData(0,0,e,n);G.releaseCanvas(x),rz(t,_,{polarCenterX:e/2,polarCenterY:n/2});for(var S=e/Math.pow(2,y);S<=8;)S=S*2,y-=1;S=Math.ceil(S);var C=S,O=0,I=C,L=1;for(w+S>e&&(O=C,I=0,L=-1),i=0;i<n;i+=1)for(r=O;r!==I;r+=L)a=Math.round(r+w)%e,p=(e*i+a)*4,u=_.data[p+0],c=_.data[p+1],f=_.data[p+2],h=_.data[p+3],g=(e*i+r)*4,_.data[g+0]=u,_.data[g+1]=c,_.data[g+2]=f,_.data[g+3]=h;for(i=0;i<n;i+=1)for(C=Math.floor(S),s=0;s<y;s+=1){for(r=0;r<C+1;r+=1)p=(e*i+r)*4,u=_.data[p+0],c=_.data[p+1],f=_.data[p+2],h=_.data[p+3],g=(e*i+C*2-r-1)*4,_.data[g+0]=u,_.data[g+1]=c,_.data[g+2]=f,_.data[g+3]=h;C*=2}iz(_,t,{polarRotation:0})}};A.addGetterSetter(se,"kaleidoscopePower",2,le(),A.afterSetFilter);A.addGetterSetter(se,"kaleidoscopeAngle",0,le(),A.afterSetFilter);function Wf(t,e,n){var r=(n*t.width+e)*4,i=[];return i.push(t.data[r++],t.data[r++],t.data[r++],t.data[r++]),i}function Wl(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 oz(t){for(var e=[0,0,0],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 sz(t,e){var n=Wf(t,0,0),r=Wf(t,t.width-1,0),i=Wf(t,0,t.height-1),a=Wf(t,t.width-1,t.height-1),s=e||10;if(Wl(n,r)<s&&Wl(r,a)<s&&Wl(a,i)<s&&Wl(i,n)<s){for(var u=oz([r,n,a,i]),c=[],f=0;f<t.width*t.height;f++){var h=Wl(u,[t.data[f*4],t.data[f*4+1],t.data[f*4+2]]);c[f]=h<s?0:255}return c}}function lz(t,e){for(var n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function uz(t,e,n){for(var r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),s=[],u=0;u<n;u++)for(var c=0;c<e;c++){for(var f=u*e+c,h=0,p=0;p<i;p++)for(var g=0;g<i;g++){var y=u+p-a,v=c+g-a;if(y>=0&&y<n&&v>=0&&v<e){var w=y*e+v,x=r[p*i+g];h+=t[w]*x}}s[f]=h===255*8?255:0}return s}function cz(t,e,n){for(var r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),s=[],u=0;u<n;u++)for(var c=0;c<e;c++){for(var f=u*e+c,h=0,p=0;p<i;p++)for(var g=0;g<i;g++){var y=u+p-a,v=c+g-a;if(y>=0&&y<n&&v>=0&&v<e){var w=y*e+v,x=r[p*i+g];h+=t[w]*x}}s[f]=h>=255*4?255:0}return s}function fz(t,e,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),s=[],u=0;u<n;u++)for(var c=0;c<e;c++){for(var f=u*e+c,h=0,p=0;p<i;p++)for(var g=0;g<i;g++){var y=u+p-a,v=c+g-a;if(y>=0&&y<n&&v>=0&&v<e){var w=y*e+v,x=r[p*i+g];h+=t[w]*x}}s[f]=h}return s}const dz=function(t){var e=this.threshold(),n=sz(t,e);return n&&(n=uz(n,t.width,t.height),n=cz(n,t.width,t.height),n=fz(n,t.width,t.height),lz(t,n)),t};A.addGetterSetter(se,"threshold",0,le(),A.afterSetFilter);const hz=function(t){var e=this.noise()*255,n=t.data,r=n.length,i=e/2,a;for(a=0;a<r;a+=4)n[a+0]+=i-2*i*Math.random(),n[a+1]+=i-2*i*Math.random(),n[a+2]+=i-2*i*Math.random()};A.addGetterSetter(se,"noise",.2,le(),A.afterSetFilter);const pz=function(t){var e=Math.ceil(this.pixelSize()),n=t.width,r=t.height,i,a,s,u,c,f,h,p=Math.ceil(n/e),g=Math.ceil(r/e),y,v,w,x,_,S,C,O=t.data;if(e<=0){G.error("pixelSize value can not be <= 0");return}for(_=0;_<p;_+=1)for(S=0;S<g;S+=1){for(u=0,c=0,f=0,h=0,y=_*e,v=y+e,w=S*e,x=w+e,C=0,i=y;i<v;i+=1)if(!(i>=n))for(a=w;a<x;a+=1)a>=r||(s=(n*a+i)*4,u+=O[s+0],c+=O[s+1],f+=O[s+2],h+=O[s+3],C+=1);for(u=u/C,c=c/C,f=f/C,h=h/C,i=y;i<v;i+=1)if(!(i>=n))for(a=w;a<x;a+=1)a>=r||(s=(n*a+i)*4,O[s+0]=u,O[s+1]=c,O[s+2]=f,O[s+3]=h)}};A.addGetterSetter(se,"pixelSize",8,le(),A.afterSetFilter);const gz=function(t){var e=Math.round(this.levels()*254)+1,n=t.data,r=n.length,i=255/e,a;for(a=0;a<r;a+=1)n[a]=Math.floor(n[a]/i)*i};A.addGetterSetter(se,"levels",.5,le(),A.afterSetFilter);const mz=function(t){var e=t.data,n=e.length,r=this.red(),i=this.green(),a=this.blue(),s,u;for(s=0;s<n;s+=4)u=(.34*e[s]+.5*e[s+1]+.16*e[s+2])/255,e[s]=u*r,e[s+1]=u*i,e[s+2]=u*a,e[s+3]=e[s+3]};A.addGetterSetter(se,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});A.addGetterSetter(se,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});A.addGetterSetter(se,"blue",0,zk,A.afterSetFilter);const vz=function(t){var e=t.data,n=e.length,r=this.red(),i=this.green(),a=this.blue(),s=this.alpha(),u,c;for(u=0;u<n;u+=4)c=1-s,e[u]=r*s+e[u]*c,e[u+1]=i*s+e[u+1]*c,e[u+2]=a*s+e[u+2]*c};A.addGetterSetter(se,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});A.addGetterSetter(se,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});A.addGetterSetter(se,"blue",0,zk,A.afterSetFilter);A.addGetterSetter(se,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});const yz=function(t){var e=t.data,n=e.length,r,i,a,s;for(r=0;r<n;r+=4)i=e[r+0],a=e[r+1],s=e[r+2],e[r+0]=Math.min(255,i*.393+a*.769+s*.189),e[r+1]=Math.min(255,i*.349+a*.686+s*.168),e[r+2]=Math.min(255,i*.272+a*.534+s*.131)},Sz=function(t){var e=t.data,n=t.width,r=t.height,i=n*4,a=r;do{var s=(a-1)*i,u=n;do{var c=s+(u-1)*4,f=e[c],h=e[c+1],p=e[c+2];f>127&&(f=255-f),h>127&&(h=255-h),p>127&&(p=255-p),e[c]=f,e[c+1]=h,e[c+2]=p}while(--u)}while(--a)},_z=function(t){var e=this.threshold()*255,n=t.data,r=n.length,i;for(i=0;i<r;i+=1)n[i]=n[i]<e?0:255};A.addGetterSetter(se,"threshold",.5,le(),A.afterSetFilter);const Vl=Lb.Util._assign(Lb,{Arc:Wi,Arrow:So,Circle:Ks,Ellipse:Na,Image:hi,Label:N0,Tag:_o,Line:Vi,Path:tt,Rect:ec,RegularPolygon:wo,Ring:bo,Sprite:pi,Star:Ba,Text:vt,TextPath:Nt,Transformer:Ke,Wedge:qi,Filters:{Blur:K$,Brighten:Y$,Contrast:X$,Emboss:Q$,Enhance:J$,Grayscale:Z$,HSL:ez,HSV:tz,Invert:nz,Kaleidoscope:az,Mask:dz,Noise:hz,Pixelate:pz,Posterize:gz,RGB:mz,RGBA:vz,Sepia:yz,Solarize:Sz,Threshold:_z}}),wz=(t,e)=>{const{width:n,height:r}=e,i=document.createElement("div"),a=new Vl.Stage({container:i,width:n,height:r}),s=new Vl.Layer,u=new Vl.Layer;s.add(new Vl.Rect({...e,fill:"white"})),t.forEach(f=>u.add(new Vl.Line({points:f.points,stroke:"black",strokeWidth:f.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:f.tool==="brush"?"source-over":"destination-out"}))),a.add(s),a.add(u);const c=a.toDataURL({...e});return i.remove(),c};let yE=null,SE=null;const LH=t=>{yE=t},bz=()=>yE,MH=t=>{SE=t},DH=()=>SE,Cz=t=>{const e=window.open("");e&&t.forEach(n=>{const r=new Image;r.src=n.base64,e.document.write(n.caption),e.document.write("</br>"),e.document.write(r.outerHTML),e.document.write("</br></br>")})},xz=(t,e)=>Math.floor(Math.random()*(e-t+1)+t),kz=t=>{const e=bz(),{generationMode:n,generationState:r,postprocessingState:i,canvasState:a,systemState:s}=t,{codeformerFidelity:u,facetoolStrength:c,facetoolType:f,hiresFix:h,hiresStrength:p,shouldRunESRGAN:g,shouldRunFacetool:y,upscalingLevel:v,upscalingStrength:w,upscalingDenoising:x}=i,{cfgScale:_,height:S,img2imgStrength:C,infillMethod:O,initialImage:I,iterations:L,perlin:D,prompt:U,negativePrompt:X,sampler:K,seamBlur:te,seamless:ce,seamSize:j,seamSteps:T,seamStrength:$,seed:V,seedWeights:ie,shouldFitToWidthHeight:H,shouldGenerateVariations:Y,shouldRandomizeSeed:Q,steps:oe,threshold:ve,tileSize:we,variationAmount:Ue,width:At,shouldUseSymmetry:me,horizontalSymmetrySteps:qt,verticalSymmetrySteps:Bt}=r,{shouldDisplayInProgressType:bn,saveIntermediatesInterval:wr,enableImageDebugging:Ft}=s,xe={prompt:U,iterations:L,steps:oe,cfg_scale:_,threshold:ve,perlin:D,height:S,width:At,sampler_name:K,seed:V,progress_images:bn==="full-res",progress_latents:bn==="latents",save_intermediates:wr,generation_mode:n,init_mask:""};let Hr=!1,Pt=!1;if(X!==""&&(xe.prompt=`${U} [${X}]`),xe.seed=Q?xz(uF,cF):V,me&&(qt>0&&(xe.h_symmetry_time_pct=Math.max(0,Math.min(1,qt/oe))),Bt>0&&(xe.v_symmetry_time_pct=Math.max(0,Math.min(1,Bt/oe)))),n==="txt2img"&&(xe.hires_fix=h,h&&(xe.strength=p)),["txt2img","img2img"].includes(n)&&(xe.seamless=ce,g&&(Hr={level:v,denoise_str:x,strength:w}),y&&(Pt={type:f,strength:c},f==="codeformer"&&(Pt.codeformer_fidelity=u))),n==="img2img"&&I&&(xe.init_img=typeof I=="string"?I:I.url,xe.strength=C,xe.fit=H),n==="unifiedCanvas"&&e){const{layerState:{objects:gi},boundingBoxCoordinates:Xs,boundingBoxDimensions:Mn,stageScale:Fa,isMaskEnabled:Qs,shouldPreserveMaskedArea:er,boundingBoxScaleMethod:Kt,scaledBoundingBoxDimensions:Dn}=a,bt={...Xs,...Mn},$a=wz(Qs?gi.filter(Jx):[],bt);xe.init_mask=$a,xe.fit=!1,xe.strength=C,xe.invert_mask=er,xe.bounding_box=bt;const Wr=e.scale();e.scale({x:1/Fa,y:1/Fa});const Co=e.getAbsolutePosition(),Vr=e.toDataURL({x:bt.x+Co.x,y:bt.y+Co.y,width:bt.width,height:bt.height});Ft&&Cz([{base64:$a,caption:"mask sent as init_mask"},{base64:Vr,caption:"image sent as init_img"}]),e.scale(Wr),xe.init_img=Vr,xe.progress_images=!1,Kt!=="none"&&(xe.inpaint_width=Dn.width,xe.inpaint_height=Dn.height),xe.seam_size=j,xe.seam_blur=te,xe.seam_strength=$,xe.seam_steps=T,xe.tile_size=we,xe.infill_method=O,xe.force_outpaint=!1}return Y?(xe.variation_amount=Ue,ie&&(xe.with_variations=R5(ie))):xe.variation_amount=0,Ft&&(xe.enable_image_debugging=Ft),{generationParameters:xe,esrganParameters:Hr,facetoolParameters:Pt}};var Ez=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g,Pz=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g,Oz=/[^-+\dA-Z]/g;function Ut(t,e,n,r){if(arguments.length===1&&typeof t=="string"&&!/\d/.test(t)&&(e=t,t=void 0),t=t||t===0?t:new Date,t instanceof Date||(t=new Date(t)),isNaN(t))throw TypeError("Invalid date");e=String(Ub[e]||e||Ub.default);var i=e.slice(0,4);(i==="UTC:"||i==="GMT:")&&(e=e.slice(4),n=!0,i==="GMT:"&&(r=!0));var a=function(){return n?"getUTC":"get"},s=function(){return t[a()+"Date"]()},u=function(){return t[a()+"Day"]()},c=function(){return t[a()+"Month"]()},f=function(){return t[a()+"FullYear"]()},h=function(){return t[a()+"Hours"]()},p=function(){return t[a()+"Minutes"]()},g=function(){return t[a()+"Seconds"]()},y=function(){return t[a()+"Milliseconds"]()},v=function(){return n?0:t.getTimezoneOffset()},w=function(){return Tz(t)},x=function(){return Rz(t)},_={d:function(){return s()},dd:function(){return Un(s())},ddd:function(){return Pn.dayNames[u()]},DDD:function(){return jb({y:f(),m:c(),d:s(),_:a(),dayName:Pn.dayNames[u()],short:!0})},dddd:function(){return Pn.dayNames[u()+7]},DDDD:function(){return jb({y:f(),m:c(),d:s(),_:a(),dayName:Pn.dayNames[u()+7]})},m:function(){return c()+1},mm:function(){return Un(c()+1)},mmm:function(){return Pn.monthNames[c()]},mmmm:function(){return Pn.monthNames[c()+12]},yy:function(){return String(f()).slice(2)},yyyy:function(){return Un(f(),4)},h:function(){return h()%12||12},hh:function(){return Un(h()%12||12)},H:function(){return h()},HH:function(){return Un(h())},M:function(){return p()},MM:function(){return Un(p())},s:function(){return g()},ss:function(){return Un(g())},l:function(){return Un(y(),3)},L:function(){return Un(Math.floor(y()/10))},t:function(){return h()<12?Pn.timeNames[0]:Pn.timeNames[1]},tt:function(){return h()<12?Pn.timeNames[2]:Pn.timeNames[3]},T:function(){return h()<12?Pn.timeNames[4]:Pn.timeNames[5]},TT:function(){return h()<12?Pn.timeNames[6]:Pn.timeNames[7]},Z:function(){return r?"GMT":n?"UTC":Az(t)},o:function(){return(v()>0?"-":"+")+Un(Math.floor(Math.abs(v())/60)*100+Math.abs(v())%60,4)},p:function(){return(v()>0?"-":"+")+Un(Math.floor(Math.abs(v())/60),2)+":"+Un(Math.floor(Math.abs(v())%60),2)},S:function(){return["th","st","nd","rd"][s()%10>3?0:(s()%100-s()%10!=10)*s()%10]},W:function(){return w()},WW:function(){return Un(w())},N:function(){return x()}};return e.replace(Ez,function(S){return S in _?_[S]():S.slice(1,S.length-1)})}var Ub={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"},Pn={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]},Un=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;return String(e).padStart(n,"0")},jb=function(e){var n=e.y,r=e.m,i=e.d,a=e._,s=e.dayName,u=e.short,c=u===void 0?!1:u,f=new Date,h=new Date;h.setDate(h[a+"Date"]()-1);var p=new Date;p.setDate(p[a+"Date"]()+1);var g=function(){return f[a+"Date"]()},y=function(){return f[a+"Month"]()},v=function(){return f[a+"FullYear"]()},w=function(){return h[a+"Date"]()},x=function(){return h[a+"Month"]()},_=function(){return h[a+"FullYear"]()},S=function(){return p[a+"Date"]()},C=function(){return p[a+"Month"]()},O=function(){return p[a+"FullYear"]()};return v()===n&&y()===r&&g()===i?c?"Tdy":"Today":_()===n&&x()===r&&w()===i?c?"Ysd":"Yesterday":O()===n&&C()===r&&S()===i?c?"Tmw":"Tomorrow":s},Tz=function(e){var n=new Date(e.getFullYear(),e.getMonth(),e.getDate());n.setDate(n.getDate()-(n.getDay()+6)%7+3);var r=new Date(n.getFullYear(),0,4);r.setDate(r.getDate()-(r.getDay()+6)%7+3);var i=n.getTimezoneOffset()-r.getTimezoneOffset();n.setHours(n.getHours()-i);var a=(n-r)/(864e5*7);return 1+Math.floor(a)},Rz=function(e){var n=e.getDay();return n===0&&(n=7),n},Az=function(e){return(String(e).match(Pz)||[""]).pop().replace(Oz,"").replace(/GMT\+0000/g,"UTC")};const Iz=(t,e)=>{const{dispatch:n,getState:r}=t;return{emitGenerateImage:i=>{n(ei(!0));const a=r(),{generation:s,postprocessing:u,system:c,canvas:f}=a,h={generationMode:i,generationState:s,postprocessingState:u,canvasState:f,systemState:c};n(gB());const{generationParameters:p,esrganParameters:g,facetoolParameters:y}=kz(h);e.emit("generateImage",p,g,y),p.init_mask&&(p.init_mask=p.init_mask.substr(0,64).concat("...")),p.init_img&&(p.init_img=p.init_img.substr(0,64).concat("...")),n(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Image generation requested: ${JSON.stringify({...p,...g,...y})}`}))},emitRunESRGAN:i=>{n(ei(!0));const{postprocessing:{upscalingLevel:a,upscalingDenoising:s,upscalingStrength:u}}=r(),c={upscale:[a,s,u]};e.emit("runPostprocessing",i,{type:"esrgan",...c}),n(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`ESRGAN upscale requested: ${JSON.stringify({file:i.url,...c})}`}))},emitRunFacetool:i=>{n(ei(!0));const{postprocessing:{facetoolType:a,facetoolStrength:s,codeformerFidelity:u}}=r(),c={facetool_strength:s};a==="codeformer"&&(c.codeformer_fidelity=u),e.emit("runPostprocessing",i,{type:a,...c}),n(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Face restoration (${a}) requested: ${JSON.stringify({file:i.url,...c})}`}))},emitDeleteImage:i=>{const{url:a,uuid:s,category:u,thumbnail:c}=i;n(tk(i)),e.emit("deleteImage",a,c,s,u)},emitRequestImages:i=>{const a=r().gallery,{earliest_mtime:s}=a.categories[i];e.emit("requestImages",i,s)},emitRequestNewImages:i=>{const a=r().gallery,{latest_mtime:s}=a.categories[i];e.emit("requestLatestImages",i,s)},emitCancelProcessing:()=>{e.emit("cancel")},emitRequestSystemConfig:()=>{e.emit("requestSystemConfig")},emitSearchForModels:i=>{e.emit("searchForModels",i)},emitAddNewModel:i=>{e.emit("addNewModel",i)},emitDeleteModel:i=>{e.emit("deleteModel",i)},emitConvertToDiffusers:i=>{n(hB()),e.emit("convertToDiffusers",i)},emitMergeDiffusersModels:i=>{n(pB()),e.emit("mergeDiffusersModels",i)},emitRequestModelChange:i=>{n(dB()),e.emit("requestModelChange",i)},emitSaveStagingAreaImageToGallery:i=>{e.emit("requestSaveStagingAreaImageToGallery",i)},emitRequestEmptyTempFolder:()=>{e.emit("requestEmptyTempFolder")}}};let Vf;const Lz=new Uint8Array(16);function Mz(){if(!Vf&&(Vf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vf(Lz)}const Jt=[];for(let t=0;t<256;++t)Jt.push((t+256).toString(16).slice(1));function Dz(t,e=0){return(Jt[t[e+0]]+Jt[t[e+1]]+Jt[t[e+2]]+Jt[t[e+3]]+"-"+Jt[t[e+4]]+Jt[t[e+5]]+"-"+Jt[t[e+6]]+Jt[t[e+7]]+"-"+Jt[t[e+8]]+Jt[t[e+9]]+"-"+Jt[t[e+10]]+Jt[t[e+11]]+Jt[t[e+12]]+Jt[t[e+13]]+Jt[t[e+14]]+Jt[t[e+15]]).toLowerCase()}const Nz=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Hb={randomUUID:Nz};function qf(t,e,n){if(Hb.randomUUID&&!e&&!t)return Hb.randomUUID();t=t||{};const r=t.random||(t.rng||Mz)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let i=0;i<16;++i)e[n+i]=r[i];return e}return Dz(r)}const NH=dt("socketio/generateImage"),BH=dt("socketio/runESRGAN"),FH=dt("socketio/runFacetool"),$H=dt("socketio/deleteImage"),Wb=dt("socketio/requestImages"),Vb=dt("socketio/requestNewImages"),zH=dt("socketio/cancelProcessing"),Bz=dt("socketio/requestSystemConfig"),GH=dt("socketio/searchForModels"),UH=dt("socketio/addNewModel"),jH=dt("socketio/deleteModel"),HH=dt("socketio/convertToDiffusers"),WH=dt("socketio/mergeDiffusersModels"),VH=dt("socketio/requestModelChange"),qH=dt("socketio/saveStagingAreaImageToGallery"),KH=dt("socketio/requestEmptyTempFolder"),Fz=t=>{const{dispatch:e,getState:n}=t;return{onConnect:()=>{try{e(ub(!0)),e(ns(Ae.t("common.statusConnected"))),e(Bz());const r=n().gallery;r.categories.result.latest_mtime?e(Vb("result")):e(Wb("result")),r.categories.user.latest_mtime?e(Vb("user")):e(Wb("user"))}catch(r){console.error(r)}},onDisconnect:()=>{try{e(ub(!1)),e(ns(Ae.t("common.statusDisconnected"))),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:"Disconnected from server",level:"warning"}))}catch(r){console.error(r)}},onGenerationResult:r=>{try{const i=n(),{activeTab:a}=i.ui,{shouldLoopback:s}=i.postprocessing,{boundingBox:u,generationMode:c,...f}=r,h={uuid:qf(),...f};if(["txt2img","img2img"].includes(c)&&e(Tf({category:"result",image:{...h,category:"result"}})),c==="unifiedCanvas"&&r.boundingBox){const{boundingBox:p}=r;e(y5({image:{...h,category:"temp"},boundingBox:p})),i.canvas.shouldAutoSave&&e(Tf({image:{...h,category:"result"},category:"result"}))}if(s)switch(bk[a]){case"img2img":{e(M5(h));break}}e(Cm()),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Image generated: ${r.url}`}))}catch(i){console.error(i)}},onIntermediateResult:r=>{try{e(b5({uuid:qf(),...r,category:"result"})),r.isBase64||e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Intermediate image generated: ${r.url}`}))}catch(i){console.error(i)}},onPostprocessingResult:r=>{try{e(Tf({category:"result",image:{uuid:qf(),...r,category:"result"}})),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Postprocessed: ${r.url}`}))}catch(i){console.error(i)}},onProgressUpdate:r=>{try{e(ei(!0)),e(uB(r))}catch(i){console.error(i)}},onError:r=>{const{message:i,additionalData:a}=r;try{e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Server error: ${i}`,level:"error"})),e(cb()),e(Cm())}catch(s){console.error(s)}},onGalleryImages:r=>{const{images:i,areMoreImagesAvailable:a,category:s}=r,u=i.map(c=>({uuid:qf(),...c}));e(w5({images:u,areMoreImagesAvailable:a,category:s})),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Loaded ${i.length} images`}))},onProcessingCanceled:()=>{e(fB());const{intermediateImage:r}=n().gallery;r&&(r.isBase64||(e(Tf({category:"result",image:r})),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Intermediate image saved: ${r.url}`}))),e(Cm())),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:"Processing canceled",level:"warning"}))},onImageDeleted:r=>{const{url:i}=r;e(tk(r));const{generation:{initialImage:a,maskPath:s}}=n();(a===i||(a==null?void 0:a.url)===i)&&e(I5()),s===i&&e(D5("")),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Image deleted: ${i}`}))},onSystemConfig:r=>{e(cB(r)),r.infill_methods.includes("patchmatch")||e(L5(r.infill_methods[0]))},onFoundModels:r=>{const{search_folder:i,found_models:a}=r;e(mB(i)),e(vB(a))},onNewModelAdded:r=>{const{new_model_name:i,model_list:a,update:s}=r;e(rs(a)),e(ei(!1)),e(ns(Ae.t("modelManager.modelAdded"))),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Model Added: ${i}`,level:"info"})),e(zl({title:s?`${Ae.t("modelManager.modelUpdated")}: ${i}`:`${Ae.t("modelManager.modelAdded")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelDeleted:r=>{const{deleted_model_name:i,model_list:a}=r;e(rs(a)),e(ei(!1)),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`${Ae.t("modelManager.modelAdded")}: ${i}`,level:"info"})),e(zl({title:`${Ae.t("modelManager.modelEntryDeleted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelConverted:r=>{const{converted_model_name:i,model_list:a}=r;e(rs(a)),e(ns(Ae.t("common.statusModelConverted"))),e(ei(!1)),e(If(!0)),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Model converted: ${i}`,level:"info"})),e(zl({title:`${Ae.t("modelManager.modelConverted")}: ${i}`,status:"success",duration:2500,isClosable:!0}))},onModelsMerged:r=>{const{merged_models:i,merged_model_name:a,model_list:s}=r;e(rs(s)),e(ns(Ae.t("common.statusMergedModels"))),e(ei(!1)),e(If(!0)),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Models merged: ${i}`,level:"info"})),e(zl({title:`${Ae.t("modelManager.modelsMerged")}: ${a}`,status:"success",duration:2500,isClosable:!0}))},onModelChanged:r=>{const{model_name:i,model_list:a}=r;e(rs(a)),e(ns(Ae.t("common.statusModelChanged"))),e(ei(!1)),e(If(!0)),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Model changed: ${i}`,level:"info"}))},onModelChangeFailed:r=>{const{model_name:i,model_list:a}=r;e(rs(a)),e(ei(!1)),e(If(!0)),e(cb()),e(Gt({timestamp:Ut(new Date,"isoDateTime"),message:`Model change failed: ${i}`,level:"error"}))},onTempFolderEmptied:()=>{e(zl({title:Ae.t("toast.tempFoldersEmptied"),status:"success",duration:2500,isClosable:!0}))}}},$z=()=>{const{origin:t}=new URL(window.location.href),e=md(t,{timeout:6e4,path:`${window.location.pathname}socket.io`});let n=!1;return i=>a=>s=>{const{onConnect:u,onDisconnect:c,onError:f,onPostprocessingResult:h,onGenerationResult:p,onIntermediateResult:g,onProgressUpdate:y,onGalleryImages:v,onProcessingCanceled:w,onImageDeleted:x,onSystemConfig:_,onModelChanged:S,onFoundModels:C,onNewModelAdded:O,onModelDeleted:I,onModelConverted:L,onModelsMerged:D,onModelChangeFailed:U,onTempFolderEmptied:X}=Fz(i),{emitGenerateImage:K,emitRunESRGAN:te,emitRunFacetool:ce,emitDeleteImage:j,emitRequestImages:T,emitRequestNewImages:$,emitCancelProcessing:V,emitRequestSystemConfig:ie,emitSearchForModels:H,emitAddNewModel:Y,emitDeleteModel:Q,emitConvertToDiffusers:oe,emitMergeDiffusersModels:ve,emitRequestModelChange:we,emitSaveStagingAreaImageToGallery:Ue,emitRequestEmptyTempFolder:At}=Iz(i,e);switch(n||(e.on("connect",()=>u()),e.on("disconnect",()=>c()),e.on("error",me=>f(me)),e.on("generationResult",me=>p(me)),e.on("postprocessingResult",me=>h(me)),e.on("intermediateResult",me=>g(me)),e.on("progressUpdate",me=>y(me)),e.on("galleryImages",me=>v(me)),e.on("processingCanceled",()=>{w()}),e.on("imageDeleted",me=>{x(me)}),e.on("systemConfig",me=>{_(me)}),e.on("foundModels",me=>{C(me)}),e.on("newModelAdded",me=>{O(me)}),e.on("modelDeleted",me=>{I(me)}),e.on("modelConverted",me=>{L(me)}),e.on("modelsMerged",me=>{D(me)}),e.on("modelChanged",me=>{S(me)}),e.on("modelChangeFailed",me=>{U(me)}),e.on("tempFolderEmptied",()=>{X()}),n=!0),s.type){case"socketio/generateImage":{K(s.payload);break}case"socketio/runESRGAN":{te(s.payload);break}case"socketio/runFacetool":{ce(s.payload);break}case"socketio/deleteImage":{j(s.payload);break}case"socketio/requestImages":{T(s.payload);break}case"socketio/requestNewImages":{$(s.payload);break}case"socketio/cancelProcessing":{V();break}case"socketio/requestSystemConfig":{ie();break}case"socketio/searchForModels":{H(s.payload);break}case"socketio/addNewModel":{Y(s.payload);break}case"socketio/deleteModel":{Q(s.payload);break}case"socketio/convertToDiffusers":{oe(s.payload);break}case"socketio/mergeDiffusersModels":{ve(s.payload);break}case"socketio/requestModelChange":{we(s.payload);break}case"socketio/saveStagingAreaImageToGallery":{Ue(s.payload);break}case"socketio/requestEmptyTempFolder":{At();break}}a(s)}},zz=["cursorPosition","isCanvasInitialized","doesCanvasNeedScaling"].map(t=>`canvas.${t}`),Gz=["currentIteration","currentStatus","currentStep","isCancelable","isConnected","isESRGANAvailable","isGFPGANAvailable","isProcessing","socketId","totalIterations","totalSteps","openModel","cancelOptions.cancelAfter"].map(t=>`system.${t}`),Uz=["categories","currentCategory","currentImage","currentImageUuid","shouldAutoSwitchToNewImages","shouldHoldGalleryOpen","intermediateImage"].map(t=>`gallery.${t}`),_E=$x({generation:N5,postprocessing:F5,gallery:C5,system:yB,canvas:S5,ui:wB,lightbox:E5}),jz=Xx.getPersistConfig({key:"root",storage:Yx,rootReducer:_E,blacklist:[...zz,...Gz,...Uz],debounce:300}),Hz=JN(jz,_E),wE=ON({reducer:Hz,middleware:t=>t({immutableCheck:!1,serializableCheck:!1}).concat($z()),devTools:{actionsDenylist:["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine"]}}),Wz=i5(wE);function Vz(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function qz(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var Kz=function(){function t(n){var r=this;this._insertTag=function(i){var a;r.tags.length===0?r.insertionPoint?a=r.insertionPoint.nextSibling:r.prepend?a=r.container.firstChild:a=r.before:a=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,a),r.tags.push(i)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(qz(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var a=Vz(i);try{a.insertRule(r,a.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){return r.parentNode&&r.parentNode.removeChild(r)}),this.tags=[],this.ctr=0},t}(),ln="-ms-",lh="-moz-",We="-webkit-",bE="comm",B0="rule",F0="decl",Yz="@import",CE="@keyframes",Xz=Math.abs,np=String.fromCharCode,Qz=Object.assign;function Jz(t,e){return en(t,0)^45?(((e<<2^en(t,0))<<2^en(t,1))<<2^en(t,2))<<2^en(t,3):0}function xE(t){return t.trim()}function Zz(t,e){return(t=e.exec(t))?t[0]:t}function qe(t,e,n){return t.replace(e,n)}function uy(t,e){return t.indexOf(e)}function en(t,e){return t.charCodeAt(e)|0}function Hu(t,e,n){return t.slice(e,n)}function ti(t){return t.length}function $0(t){return t.length}function Kf(t,e){return e.push(t),t}function e6(t,e){return t.map(e).join("")}var rp=1,Gs=1,kE=0,Ln=0,Ot=0,Ys="";function ip(t,e,n,r,i,a,s){return{value:t,root:e,parent:n,type:r,props:i,children:a,line:rp,column:Gs,length:s,return:""}}function ql(t,e){return Qz(ip("",null,null,"",null,null,0),t,{length:-t.length},e)}function t6(){return Ot}function n6(){return Ot=Ln>0?en(Ys,--Ln):0,Gs--,Ot===10&&(Gs=1,rp--),Ot}function Kn(){return Ot=Ln<kE?en(Ys,Ln++):0,Gs++,Ot===10&&(Gs=1,rp++),Ot}function ci(){return en(Ys,Ln)}function _d(){return Ln}function tc(t,e){return Hu(Ys,t,e)}function Wu(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function EE(t){return rp=Gs=1,kE=ti(Ys=t),Ln=0,[]}function PE(t){return Ys="",t}function wd(t){return xE(tc(Ln-1,cy(t===91?t+2:t===40?t+1:t)))}function r6(t){for(;(Ot=ci())&&Ot<33;)Kn();return Wu(t)>2||Wu(Ot)>3?"":" "}function i6(t,e){for(;--e&&Kn()&&!(Ot<48||Ot>102||Ot>57&&Ot<65||Ot>70&&Ot<97););return tc(t,_d()+(e<6&&ci()==32&&Kn()==32))}function cy(t){for(;Kn();)switch(Ot){case t:return Ln;case 34:case 39:t!==34&&t!==39&&cy(Ot);break;case 40:t===41&&cy(t);break;case 92:Kn();break}return Ln}function a6(t,e){for(;Kn()&&t+Ot!==47+10;)if(t+Ot===42+42&&ci()===47)break;return"/*"+tc(e,Ln-1)+"*"+np(t===47?t:Kn())}function o6(t){for(;!Wu(ci());)Kn();return tc(t,Ln)}function s6(t){return PE(bd("",null,null,null,[""],t=EE(t),0,[0],t))}function bd(t,e,n,r,i,a,s,u,c){for(var f=0,h=0,p=s,g=0,y=0,v=0,w=1,x=1,_=1,S=0,C="",O=i,I=a,L=r,D=C;x;)switch(v=S,S=Kn()){case 40:if(v!=108&&en(D,p-1)==58){uy(D+=qe(wd(S),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:D+=wd(S);break;case 9:case 10:case 13:case 32:D+=r6(v);break;case 92:D+=i6(_d()-1,7);continue;case 47:switch(ci()){case 42:case 47:Kf(l6(a6(Kn(),_d()),e,n),c);break;default:D+="/"}break;case 123*w:u[f++]=ti(D)*_;case 125*w:case 59:case 0:switch(S){case 0:case 125:x=0;case 59+h:y>0&&ti(D)-p&&Kf(y>32?Kb(D+";",r,n,p-1):Kb(qe(D," ","")+";",r,n,p-2),c);break;case 59:D+=";";default:if(Kf(L=qb(D,e,n,f,h,i,u,C,O=[],I=[],p),a),S===123)if(h===0)bd(D,e,L,L,O,a,p,u,I);else switch(g===99&&en(D,3)===110?100:g){case 100:case 109:case 115:bd(t,L,L,r&&Kf(qb(t,L,L,0,0,i,u,C,i,O=[],p),I),i,I,p,u,r?O:I);break;default:bd(D,L,L,L,[""],I,0,u,I)}}f=h=y=0,w=_=1,C=D="",p=s;break;case 58:p=1+ti(D),y=v;default:if(w<1){if(S==123)--w;else if(S==125&&w++==0&&n6()==125)continue}switch(D+=np(S),S*w){case 38:_=h>0?1:(D+="\f",-1);break;case 44:u[f++]=(ti(D)-1)*_,_=1;break;case 64:ci()===45&&(D+=wd(Kn())),g=ci(),h=p=ti(C=D+=o6(_d())),S++;break;case 45:v===45&&ti(D)==2&&(w=0)}}return a}function qb(t,e,n,r,i,a,s,u,c,f,h){for(var p=i-1,g=i===0?a:[""],y=$0(g),v=0,w=0,x=0;v<r;++v)for(var _=0,S=Hu(t,p+1,p=Xz(w=s[v])),C=t;_<y;++_)(C=xE(w>0?g[_]+" "+S:qe(S,/&\f/g,g[_])))&&(c[x++]=C);return ip(t,e,n,i===0?B0:u,c,f,h)}function l6(t,e,n){return ip(t,e,n,bE,np(t6()),Hu(t,2,-2),0)}function Kb(t,e,n,r){return ip(t,e,n,F0,Hu(t,0,r),Hu(t,r+1,-1),r)}function Rs(t,e){for(var n="",r=$0(t),i=0;i<r;i++)n+=e(t[i],i,t,e)||"";return n}function u6(t,e,n,r){switch(t.type){case Yz:case F0:return t.return=t.return||t.value;case bE:return"";case CE:return t.return=t.value+"{"+Rs(t.children,r)+"}";case B0:t.value=t.props.join(",")}return ti(n=Rs(t.children,r))?t.return=t.value+"{"+n+"}":""}function c6(t){var e=$0(t);return function(n,r,i,a){for(var s="",u=0;u<e;u++)s+=t[u](n,r,i,a)||"";return s}}function f6(t){return function(e){e.root||(e=e.return)&&t(e)}}var Yb=function(e){var n=new WeakMap;return function(r){if(n.has(r))return n.get(r);var i=e(r);return n.set(r,i),i}};function OE(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var d6=function(e,n,r){for(var i=0,a=0;i=a,a=ci(),i===38&&a===12&&(n[r]=1),!Wu(a);)Kn();return tc(e,Ln)},h6=function(e,n){var r=-1,i=44;do switch(Wu(i)){case 0:i===38&&ci()===12&&(n[r]=1),e[r]+=d6(Ln-1,n,r);break;case 2:e[r]+=wd(i);break;case 4:if(i===44){e[++r]=ci()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=np(i)}while(i=Kn());return e},p6=function(e,n){return PE(h6(EE(e),n))},Xb=new WeakMap,g6=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!Xb.get(r))&&!i){Xb.set(e,!0);for(var a=[],s=p6(n,a),u=r.props,c=0,f=0;c<s.length;c++)for(var h=0;h<u.length;h++,f++)e.props[f]=a[c]?s[c].replace(/&\f/g,u[h]):u[h]+" "+s[c]}}},m6=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function TE(t,e){switch(Jz(t,e)){case 5103:return We+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return We+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return We+t+lh+t+ln+t+t;case 6828:case 4268:return We+t+ln+t+t;case 6165:return We+t+ln+"flex-"+t+t;case 5187:return We+t+qe(t,/(\w+).+(:[^]+)/,We+"box-$1$2"+ln+"flex-$1$2")+t;case 5443:return We+t+ln+"flex-item-"+qe(t,/flex-|-self/,"")+t;case 4675:return We+t+ln+"flex-line-pack"+qe(t,/align-content|flex-|-self/,"")+t;case 5548:return We+t+ln+qe(t,"shrink","negative")+t;case 5292:return We+t+ln+qe(t,"basis","preferred-size")+t;case 6060:return We+"box-"+qe(t,"-grow","")+We+t+ln+qe(t,"grow","positive")+t;case 4554:return We+qe(t,/([^-])(transform)/g,"$1"+We+"$2")+t;case 6187:return qe(qe(qe(t,/(zoom-|grab)/,We+"$1"),/(image-set)/,We+"$1"),t,"")+t;case 5495:case 3959:return qe(t,/(image-set\([^]*)/,We+"$1$`$1");case 4968:return qe(qe(t,/(.+:)(flex-)?(.*)/,We+"box-pack:$3"+ln+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+We+t+t;case 4095:case 3583:case 4068:case 2532:return qe(t,/(.+)-inline(.+)/,We+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ti(t)-1-e>6)switch(en(t,e+1)){case 109:if(en(t,e+4)!==45)break;case 102:return qe(t,/(.+:)(.+)-([^]+)/,"$1"+We+"$2-$3$1"+lh+(en(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~uy(t,"stretch")?TE(qe(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(en(t,e+1)!==115)break;case 6444:switch(en(t,ti(t)-3-(~uy(t,"!important")&&10))){case 107:return qe(t,":",":"+We)+t;case 101:return qe(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+We+(en(t,14)===45?"inline-":"")+"box$3$1"+We+"$2$3$1"+ln+"$2box$3")+t}break;case 5936:switch(en(t,e+11)){case 114:return We+t+ln+qe(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return We+t+ln+qe(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return We+t+ln+qe(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return We+t+ln+t+t}return t}var v6=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case F0:e.return=TE(e.value,e.length);break;case CE:return Rs([ql(e,{value:qe(e.value,"@","@"+We)})],i);case B0:if(e.length)return e6(e.props,function(a){switch(Zz(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Rs([ql(e,{props:[qe(a,/:(read-\w+)/,":"+lh+"$1")]})],i);case"::placeholder":return Rs([ql(e,{props:[qe(a,/:(plac\w+)/,":"+We+"input-$1")]}),ql(e,{props:[qe(a,/:(plac\w+)/,":"+lh+"$1")]}),ql(e,{props:[qe(a,/:(plac\w+)/,ln+"input-$1")]})],i)}return""})}},y6=[v6],S6=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var x=w.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var i=e.stylisPlugins||y6,a={},s,u=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(w){for(var x=w.getAttribute("data-emotion").split(" "),_=1;_<x.length;_++)a[x[_]]=!0;u.push(w)});var c,f=[g6,m6];{var h,p=[u6,f6(function(w){h.insert(w)})],g=c6(f.concat(i,p)),y=function(x){return Rs(s6(x),g)};c=function(x,_,S,C){h=S,y(x?x+"{"+_.styles+"}":_.styles),C&&(v.inserted[_.name]=!0)}}var v={key:n,sheet:new Kz({key:n,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:c};return v.sheet.hydrate(u),v},_6=!0;function w6(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):r+=i+" "}),r}var RE=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||_6===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},AE=function(e,n,r){RE(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var a=n;do e.insert(n===a?"."+i:"",a,e.sheet,!0),a=a.next;while(a!==void 0)}};function b6(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var C6={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},x6=/[A-Z]|^ms/g,k6=/_EMO_([^_]+?)_([^]*?)_EMO_/g,IE=function(e){return e.charCodeAt(1)===45},Qb=function(e){return e!=null&&typeof e!="boolean"},Dm=OE(function(t){return IE(t)?t:t.replace(x6,"-$&").toLowerCase()}),Jb=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(k6,function(r,i,a){return ni={name:i,styles:a,next:ni},i})}return C6[e]!==1&&!IE(e)&&typeof n=="number"&&n!==0?n+"px":n};function Vu(t,e,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return ni={name:n.name,styles:n.styles,next:ni},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)ni={name:r.name,styles:r.styles,next:ni},r=r.next;var i=n.styles+";";return i}return E6(t,e,n)}case"function":{if(t!==void 0){var a=ni,s=n(t);return ni=a,Vu(t,e,s)}break}}if(e==null)return n;var u=e[n];return u!==void 0?u:n}function E6(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=Vu(t,e,n[i])+";";else for(var a in n){var s=n[a];if(typeof s!="object")e!=null&&e[s]!==void 0?r+=a+"{"+e[s]+"}":Qb(s)&&(r+=Dm(a)+":"+Jb(a,s)+";");else if(Array.isArray(s)&&typeof s[0]=="string"&&(e==null||e[s[0]]===void 0))for(var u=0;u<s.length;u++)Qb(s[u])&&(r+=Dm(a)+":"+Jb(a,s[u])+";");else{var c=Vu(t,e,s);switch(a){case"animation":case"animationName":{r+=Dm(a)+":"+c+";";break}default:r+=a+"{"+c+"}"}}}return r}var Zb=/label:\s*([^\s;\n{]+)\s*(;|$)/g,ni,z0=function(e,n,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var i=!0,a="";ni=void 0;var s=e[0];s==null||s.raw===void 0?(i=!1,a+=Vu(r,n,s)):a+=s[0];for(var u=1;u<e.length;u++)a+=Vu(r,n,e[u]),i&&(a+=s[u]);Zb.lastIndex=0;for(var c="",f;(f=Zb.exec(a))!==null;)c+="-"+f[1];var h=b6(a)+c;return{name:h,styles:a,next:ni}},P6=function(e){return e()},LE=XS["useInsertionEffect"]?XS["useInsertionEffect"]:!1,O6=LE||P6,e2=LE||be.useLayoutEffect,ME=be.createContext(typeof HTMLElement<"u"?S6({key:"css"}):null);ME.Provider;var DE=function(e){return be.forwardRef(function(n,r){var i=be.useContext(ME);return e(n,i,r)})},qu=be.createContext({}),T6=function(e,n){if(typeof n=="function"){var r=n(e);return r}return Xd({},e,n)},R6=Yb(function(t){return Yb(function(e){return T6(t,e)})}),YH=function(e){var n=be.useContext(qu);return e.theme!==n&&(n=R6(n)(e.theme)),be.createElement(qu.Provider,{value:n},e.children)},XH=DE(function(t,e){var n=t.styles,r=z0([n],void 0,be.useContext(qu)),i=be.useRef();return e2(function(){var a=e.key+"-global",s=new e.sheet.constructor({key:a,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),u=!1,c=document.querySelector('style[data-emotion="'+a+" "+r.name+'"]');return e.sheet.tags.length&&(s.before=e.sheet.tags[0]),c!==null&&(u=!0,c.setAttribute("data-emotion",a),s.hydrate([c])),i.current=[s,u],function(){s.flush()}},[e]),e2(function(){var a=i.current,s=a[0],u=a[1];if(u){a[1]=!1;return}if(r.next!==void 0&&AE(e,r.next,!0),s.tags.length){var c=s.tags[s.tags.length-1].nextElementSibling;s.before=c,s.flush()}e.insert("",r,s,!1)},[e,r.name]),null});function A6(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return z0(e)}var I6=function(){var e=A6.apply(void 0,arguments),n="animation-"+e.name;return{name:n,styles:"@keyframes "+n+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function L6(){const t=be.useContext(qu);if(!t)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return t}var NE=be.createContext({});NE.displayName="ColorModeContext";function BE(){const t=be.useContext(NE);if(t===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return t}function M6(){const t=BE(),e=L6();return{...t,theme:e}}var FE=(...t)=>t.filter(Boolean).join(" ");function D6(){return!1}function zr(t){const e=typeof t;return t!=null&&(e==="object"||e==="function")&&!Array.isArray(t)}var QH=t=>{const{condition:e,message:n}=t;e&&D6()&&console.warn(n)};function io(t,...e){return N6(t)?t(...e):t}var N6=t=>typeof t=="function",JH=t=>t?"":void 0,ZH=t=>t?!0:void 0;function eW(...t){return function(n){t.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function tW(...t){return function(n){t.forEach(r=>{r==null||r(n)})}}var uh={},B6={get exports(){return uh},set exports(t){uh=t}};(function(t,e){var n=200,r="__lodash_hash_undefined__",i=800,a=16,s=9007199254740991,u="[object Arguments]",c="[object Array]",f="[object AsyncFunction]",h="[object Boolean]",p="[object Date]",g="[object Error]",y="[object Function]",v="[object GeneratorFunction]",w="[object Map]",x="[object Number]",_="[object Null]",S="[object Object]",C="[object Proxy]",O="[object RegExp]",I="[object Set]",L="[object String]",D="[object Undefined]",U="[object WeakMap]",X="[object ArrayBuffer]",K="[object DataView]",te="[object Float32Array]",ce="[object Float64Array]",j="[object Int8Array]",T="[object Int16Array]",$="[object Int32Array]",V="[object Uint8Array]",ie="[object Uint8ClampedArray]",H="[object Uint16Array]",Y="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,oe=/^\[object .+?Constructor\]$/,ve=/^(?:0|[1-9]\d*)$/,we={};we[te]=we[ce]=we[j]=we[T]=we[$]=we[V]=we[ie]=we[H]=we[Y]=!0,we[u]=we[c]=we[X]=we[h]=we[K]=we[p]=we[g]=we[y]=we[w]=we[x]=we[S]=we[O]=we[I]=we[L]=we[U]=!1;var Ue=typeof yn=="object"&&yn&&yn.Object===Object&&yn,At=typeof self=="object"&&self&&self.Object===Object&&self,me=Ue||At||Function("return this")(),qt=e&&!e.nodeType&&e,Bt=qt&&!0&&t&&!t.nodeType&&t,bn=Bt&&Bt.exports===qt,wr=bn&&Ue.process,Ft=function(){try{var P=Bt&&Bt.require&&Bt.require("util").types;return P||wr&&wr.binding&&wr.binding("util")}catch{}}(),xe=Ft&&Ft.isTypedArray;function Hr(P,N,W){switch(W.length){case 0:return P.call(N);case 1:return P.call(N,W[0]);case 2:return P.call(N,W[0],W[1]);case 3:return P.call(N,W[0],W[1],W[2])}return P.apply(N,W)}function Pt(P,N){for(var W=-1,fe=Array(P);++W<P;)fe[W]=N(W);return fe}function gi(P){return function(N){return P(N)}}function Xs(P,N){return P==null?void 0:P[N]}function Mn(P,N){return function(W){return P(N(W))}}var Fa=Array.prototype,Qs=Function.prototype,er=Object.prototype,Kt=me["__core-js_shared__"],Dn=Qs.toString,bt=er.hasOwnProperty,$a=function(){var P=/[^.]+$/.exec(Kt&&Kt.keys&&Kt.keys.IE_PROTO||"");return P?"Symbol(src)_1."+P:""}(),Wr=er.toString,Co=Dn.call(Object),Vr=RegExp("^"+Dn.call(bt).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),br=bn?me.Buffer:void 0,xo=me.Symbol,ko=me.Uint8Array,Eo=br?br.allocUnsafe:void 0,Po=Mn(Object.getPrototypeOf,Object),Oo=Object.create,Js=er.propertyIsEnumerable,Zs=Fa.splice,Cr=xo?xo.toStringTag:void 0,Ki=function(){try{var P=Io(Object,"defineProperty");return P({},"",{}),P}catch{}}(),sp=br?br.isBuffer:void 0,nc=Math.max,lp=Date.now,el=Io(me,"Map"),Yi=Io(Object,"create"),up=function(){function P(){}return function(N){if(!kr(N))return{};if(Oo)return Oo(N);P.prototype=N;var W=new P;return P.prototype=void 0,W}}();function mi(P){var N=-1,W=P==null?0:P.length;for(this.clear();++N<W;){var fe=P[N];this.set(fe[0],fe[1])}}function cp(){this.__data__=Yi?Yi(null):{},this.size=0}function fp(P){var N=this.has(P)&&delete this.__data__[P];return this.size-=N?1:0,N}function rc(P){var N=this.__data__;if(Yi){var W=N[P];return W===r?void 0:W}return bt.call(N,P)?N[P]:void 0}function dp(P){var N=this.__data__;return Yi?N[P]!==void 0:bt.call(N,P)}function hp(P,N){var W=this.__data__;return this.size+=this.has(P)?0:1,W[P]=Yi&&N===void 0?r:N,this}mi.prototype.clear=cp,mi.prototype.delete=fp,mi.prototype.get=rc,mi.prototype.has=dp,mi.prototype.set=hp;function xr(P){var N=-1,W=P==null?0:P.length;for(this.clear();++N<W;){var fe=P[N];this.set(fe[0],fe[1])}}function tl(){this.__data__=[],this.size=0}function pp(P){var N=this.__data__,W=yi(N,P);if(W<0)return!1;var fe=N.length-1;return W==fe?N.pop():Zs.call(N,W,1),--this.size,!0}function nl(P){var N=this.__data__,W=yi(N,P);return W<0?void 0:N[W][1]}function gp(P){return yi(this.__data__,P)>-1}function mp(P,N){var W=this.__data__,fe=yi(W,P);return fe<0?(++this.size,W.push([P,N])):W[fe][1]=N,this}xr.prototype.clear=tl,xr.prototype.delete=pp,xr.prototype.get=nl,xr.prototype.has=gp,xr.prototype.set=mp;function Xi(P){var N=-1,W=P==null?0:P.length;for(this.clear();++N<W;){var fe=P[N];this.set(fe[0],fe[1])}}function vp(){this.size=0,this.__data__={hash:new mi,map:new(el||xr),string:new mi}}function yp(P){var N=Ao(this,P).delete(P);return this.size-=N?1:0,N}function Sp(P){return Ao(this,P).get(P)}function _p(P){return Ao(this,P).has(P)}function wp(P,N){var W=Ao(this,P),fe=W.size;return W.set(P,N),this.size+=W.size==fe?0:1,this}Xi.prototype.clear=vp,Xi.prototype.delete=yp,Xi.prototype.get=Sp,Xi.prototype.has=_p,Xi.prototype.set=wp;function vi(P){var N=this.__data__=new xr(P);this.size=N.size}function bp(){this.__data__=new xr,this.size=0}function Cp(P){var N=this.__data__,W=N.delete(P);return this.size=N.size,W}function xp(P){return this.__data__.get(P)}function kp(P){return this.__data__.has(P)}function Ep(P,N){var W=this.__data__;if(W instanceof xr){var fe=W.__data__;if(!el||fe.length<n-1)return fe.push([P,N]),this.size=++W.size,this;W=this.__data__=new Xi(fe)}return W.set(P,N),this.size=W.size,this}vi.prototype.clear=bp,vi.prototype.delete=Cp,vi.prototype.get=xp,vi.prototype.has=kp,vi.prototype.set=Ep;function Pp(P,N){var W=cl(P),fe=!W&&ul(P),Ie=!W&&!fe&&_c(P),Ye=!W&&!fe&&!Ie&&bc(P),Ee=W||fe||Ie||Ye,Te=Ee?Pt(P.length,String):[],ze=Te.length;for(var dn in P)(N||bt.call(P,dn))&&!(Ee&&(dn=="length"||Ie&&(dn=="offset"||dn=="parent")||Ye&&(dn=="buffer"||dn=="byteLength"||dn=="byteOffset")||hc(dn,ze)))&&Te.push(dn);return Te}function Qi(P,N,W){(W!==void 0&&!Mo(P[N],W)||W===void 0&&!(N in P))&&rl(P,N,W)}function Op(P,N,W){var fe=P[N];(!(bt.call(P,N)&&Mo(fe,W))||W===void 0&&!(N in P))&&rl(P,N,W)}function yi(P,N){for(var W=P.length;W--;)if(Mo(P[W][0],N))return W;return-1}function rl(P,N,W){N=="__proto__"&&Ki?Ki(P,N,{configurable:!0,enumerable:!0,value:W,writable:!0}):P[N]=W}var Tp=fc();function To(P){return P==null?P===void 0?D:_:Cr&&Cr in Object(P)?dc(P):mc(P)}function il(P){return za(P)&&To(P)==u}function ic(P){if(!kr(P)||ll(P))return!1;var N=fl(P)?Vr:oe;return N.test(Sc(P))}function ac(P){return za(P)&&wc(P.length)&&!!we[To(P)]}function Rp(P){if(!kr(P))return gc(P);var N=Si(P),W=[];for(var fe in P)fe=="constructor"&&(N||!bt.call(P,fe))||W.push(fe);return W}function oc(P,N,W,fe,Ie){P!==N&&Tp(N,function(Ye,Ee){if(Ie||(Ie=new vi),kr(Ye))Ap(P,N,Ee,W,oc,fe,Ie);else{var Te=fe?fe(Lo(P,Ee),Ye,Ee+"",P,N,Ie):void 0;Te===void 0&&(Te=Ye),Qi(P,Ee,Te)}},Cc)}function Ap(P,N,W,fe,Ie,Ye,Ee){var Te=Lo(P,W),ze=Lo(N,W),dn=Ee.get(ze);if(dn){Qi(P,W,dn);return}var Yt=Ye?Ye(Te,ze,W+"",P,N,Ee):void 0,$t=Yt===void 0;if($t){var No=cl(ze),Bo=!No&&_c(ze),dl=!No&&!Bo&&bc(ze);Yt=ze,No||Bo||dl?cl(Te)?Yt=Te:Dp(Te)?Yt=Lp(Te):Bo?($t=!1,Yt=lc(ze,!0)):dl?($t=!1,Yt=al(ze,!0)):Yt=[]:Np(ze)||ul(ze)?(Yt=Te,ul(Te)?Yt=Bp(Te):(!kr(Te)||fl(Te))&&(Yt=ol(ze))):$t=!1}$t&&(Ee.set(ze,Yt),Ie(Yt,ze,fe,Ye,Ee),Ee.delete(ze)),Qi(P,W,Yt)}function Ip(P,N){return vc(Mp(P,N,xc),P+"")}var sc=Ki?function(P,N){return Ki(P,"toString",{configurable:!0,enumerable:!1,value:et(N),writable:!0})}:xc;function lc(P,N){if(N)return P.slice();var W=P.length,fe=Eo?Eo(W):new P.constructor(W);return P.copy(fe),fe}function uc(P){var N=new P.constructor(P.byteLength);return new ko(N).set(new ko(P)),N}function al(P,N){var W=N?uc(P.buffer):P.buffer;return new P.constructor(W,P.byteOffset,P.length)}function Lp(P,N){var W=-1,fe=P.length;for(N||(N=Array(fe));++W<fe;)N[W]=P[W];return N}function cc(P,N,W,fe){var Ie=!W;W||(W={});for(var Ye=-1,Ee=N.length;++Ye<Ee;){var Te=N[Ye],ze=fe?fe(W[Te],P[Te],Te,W,P):void 0;ze===void 0&&(ze=P[Te]),Ie?rl(W,Te,ze):Op(W,Te,ze)}return W}function Ro(P){return Ip(function(N,W){var fe=-1,Ie=W.length,Ye=Ie>1?W[Ie-1]:void 0,Ee=Ie>2?W[2]:void 0;for(Ye=P.length>3&&typeof Ye=="function"?(Ie--,Ye):void 0,Ee&&pc(W[0],W[1],Ee)&&(Ye=Ie<3?void 0:Ye,Ie=1),N=Object(N);++fe<Ie;){var Te=W[fe];Te&&P(N,Te,fe,Ye)}return N})}function fc(P){return function(N,W,fe){for(var Ie=-1,Ye=Object(N),Ee=fe(N),Te=Ee.length;Te--;){var ze=Ee[P?Te:++Ie];if(W(Ye[ze],ze,Ye)===!1)break}return N}}function Ao(P,N){var W=P.__data__;return sl(N)?W[typeof N=="string"?"string":"hash"]:W.map}function Io(P,N){var W=Xs(P,N);return ic(W)?W:void 0}function dc(P){var N=bt.call(P,Cr),W=P[Cr];try{P[Cr]=void 0;var fe=!0}catch{}var Ie=Wr.call(P);return fe&&(N?P[Cr]=W:delete P[Cr]),Ie}function ol(P){return typeof P.constructor=="function"&&!Si(P)?up(Po(P)):{}}function hc(P,N){var W=typeof P;return N=N??s,!!N&&(W=="number"||W!="symbol"&&ve.test(P))&&P>-1&&P%1==0&&P<N}function pc(P,N,W){if(!kr(W))return!1;var fe=typeof N;return(fe=="number"?Do(W)&&hc(N,W.length):fe=="string"&&N in W)?Mo(W[N],P):!1}function sl(P){var N=typeof P;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?P!=="__proto__":P===null}function ll(P){return!!$a&&$a in P}function Si(P){var N=P&&P.constructor,W=typeof N=="function"&&N.prototype||er;return P===W}function gc(P){var N=[];if(P!=null)for(var W in Object(P))N.push(W);return N}function mc(P){return Wr.call(P)}function Mp(P,N,W){return N=nc(N===void 0?P.length-1:N,0),function(){for(var fe=arguments,Ie=-1,Ye=nc(fe.length-N,0),Ee=Array(Ye);++Ie<Ye;)Ee[Ie]=fe[N+Ie];Ie=-1;for(var Te=Array(N+1);++Ie<N;)Te[Ie]=fe[Ie];return Te[N]=W(Ee),Hr(P,this,Te)}}function Lo(P,N){if(!(N==="constructor"&&typeof P[N]=="function")&&N!="__proto__")return P[N]}var vc=yc(sc);function yc(P){var N=0,W=0;return function(){var fe=lp(),Ie=a-(fe-W);if(W=fe,Ie>0){if(++N>=i)return arguments[0]}else N=0;return P.apply(void 0,arguments)}}function Sc(P){if(P!=null){try{return Dn.call(P)}catch{}try{return P+""}catch{}}return""}function Mo(P,N){return P===N||P!==P&&N!==N}var ul=il(function(){return arguments}())?il:function(P){return za(P)&&bt.call(P,"callee")&&!Js.call(P,"callee")},cl=Array.isArray;function Do(P){return P!=null&&wc(P.length)&&!fl(P)}function Dp(P){return za(P)&&Do(P)}var _c=sp||Fp;function fl(P){if(!kr(P))return!1;var N=To(P);return N==y||N==v||N==f||N==C}function wc(P){return typeof P=="number"&&P>-1&&P%1==0&&P<=s}function kr(P){var N=typeof P;return P!=null&&(N=="object"||N=="function")}function za(P){return P!=null&&typeof P=="object"}function Np(P){if(!za(P)||To(P)!=S)return!1;var N=Po(P);if(N===null)return!0;var W=bt.call(N,"constructor")&&N.constructor;return typeof W=="function"&&W instanceof W&&Dn.call(W)==Co}var bc=xe?gi(xe):ac;function Bp(P){return cc(P,Cc(P))}function Cc(P){return Do(P)?Pp(P,!0):Rp(P)}var nt=Ro(function(P,N,W,fe){oc(P,N,W,fe)});function et(P){return function(){return P}}function xc(P){return P}function Fp(){return!1}t.exports=nt})(B6,uh);const ai=uh;var F6=t=>/!(important)?$/.test(t),t2=t=>typeof t=="string"?t.replace(/!(important)?$/,"").trim():t,$6=(t,e)=>n=>{const r=String(e),i=F6(r),a=t2(r),s=t?`${t}.${a}`:a;let u=zr(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:e;return u=t2(u),i?`${u} !important`:u};function G0(t){const{scale:e,transform:n,compose:r}=t;return(a,s)=>{var u;const c=$6(e,a)(s);let f=(u=n==null?void 0:n(c,s))!=null?u:c;return r&&(f=r(f,s)),f}}var Yf=(...t)=>e=>t.reduce((n,r)=>r(n),e);function Ir(t,e){return n=>{const r={property:n,scale:t};return r.transform=G0({scale:t,transform:e}),r}}var z6=({rtl:t,ltr:e})=>n=>n.direction==="rtl"?t:e;function G6(t){const{property:e,scale:n,transform:r}=t;return{scale:n,property:z6(e),transform:n?G0({scale:n,compose:r}):r}}var $E=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function U6(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...$E].join(" ")}function j6(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...$E].join(" ")}var H6={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},W6={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function V6(t){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":t,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var q6={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},fy={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},K6=new Set(Object.values(fy)),zE=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Y6=t=>t.trim();function X6(t,e){if(t==null||zE.has(t))return t;const r=/(^[a-z-A-Z]+)\((.*)\)/g.exec(t),i=r==null?void 0:r[1],a=r==null?void 0:r[2];if(!i||!a)return t;const s=i.includes("-gradient")?i:`${i}-gradient`,[u,...c]=a.split(",").map(Y6).filter(Boolean);if((c==null?void 0:c.length)===0)return t;const f=u in fy?fy[u]:u;c.unshift(f);const h=c.map(p=>{if(K6.has(p))return p;const g=p.indexOf(" "),[y,v]=g!==-1?[p.substr(0,g),p.substr(g+1)]:[p],w=GE(v)?v:v&&v.split(" "),x=`colors.${y}`,_=x in e.__cssMap?e.__cssMap[x].varRef:y;return w?[_,...Array.isArray(w)?w:[w]].join(" "):_});return`${s}(${h.join(", ")})`}var GE=t=>typeof t=="string"&&t.includes("(")&&t.includes(")"),Q6=(t,e)=>X6(t,e??{});function J6(t){return/^var\(--.+\)$/.test(t)}var Z6=t=>{const e=parseFloat(t.toString()),n=t.toString().replace(String(e),"");return{unitless:!n,value:e,unit:n}},Jr=t=>e=>`${t}(${e})`,Fe={filter(t){return t!=="auto"?t:H6},backdropFilter(t){return t!=="auto"?t:W6},ring(t){return V6(Fe.px(t))},bgClip(t){return t==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:t}},transform(t){return t==="auto"?U6():t==="auto-gpu"?j6():t},vh(t){return t==="$100vh"?"var(--chakra-vh)":t},px(t){if(t==null)return t;const{unitless:e}=Z6(t);return e||typeof t=="number"?`${t}px`:t},fraction(t){return typeof t!="number"||t>1?t:`${t*100}%`},float(t,e){const n={left:"right",right:"left"};return e.direction==="rtl"?n[t]:t},degree(t){if(J6(t)||t==null)return t;const e=typeof t=="string"&&!t.endsWith("deg");return typeof t=="number"||e?`${t}deg`:t},gradient:Q6,blur:Jr("blur"),opacity:Jr("opacity"),brightness:Jr("brightness"),contrast:Jr("contrast"),dropShadow:Jr("drop-shadow"),grayscale:Jr("grayscale"),hueRotate:Jr("hue-rotate"),invert:Jr("invert"),saturate:Jr("saturate"),sepia:Jr("sepia"),bgImage(t){return t==null||GE(t)||zE.has(t)?t:`url(${t})`},outline(t){const e=String(t)==="0"||String(t)==="none";return t!==null&&e?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:t}},flexDirection(t){var e;const{space:n,divide:r}=(e=q6[t])!=null?e:{},i={flexDirection:t};return n&&(i[n]=1),r&&(i[r]=1),i}},B={borderWidths:Ir("borderWidths"),borderStyles:Ir("borderStyles"),colors:Ir("colors"),borders:Ir("borders"),radii:Ir("radii",Fe.px),space:Ir("space",Yf(Fe.vh,Fe.px)),spaceT:Ir("space",Yf(Fe.vh,Fe.px)),degreeT(t){return{property:t,transform:Fe.degree}},prop(t,e,n){return{property:t,scale:e,...e&&{transform:G0({scale:e,transform:n})}}},propT(t,e){return{property:t,transform:e}},sizes:Ir("sizes",Yf(Fe.vh,Fe.px)),sizesT:Ir("sizes",Yf(Fe.vh,Fe.fraction)),shadows:Ir("shadows"),logical:G6,blur:Ir("blur",Fe.blur)},Cd={background:B.colors("background"),backgroundColor:B.colors("backgroundColor"),backgroundImage:B.propT("backgroundImage",Fe.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Fe.bgClip},bgSize:B.prop("backgroundSize"),bgPosition:B.prop("backgroundPosition"),bg:B.colors("background"),bgColor:B.colors("backgroundColor"),bgPos:B.prop("backgroundPosition"),bgRepeat:B.prop("backgroundRepeat"),bgAttachment:B.prop("backgroundAttachment"),bgGradient:B.propT("backgroundImage",Fe.gradient),bgClip:{transform:Fe.bgClip}};Object.assign(Cd,{bgImage:Cd.backgroundImage,bgImg:Cd.backgroundImage});var He={border:B.borders("border"),borderWidth:B.borderWidths("borderWidth"),borderStyle:B.borderStyles("borderStyle"),borderColor:B.colors("borderColor"),borderRadius:B.radii("borderRadius"),borderTop:B.borders("borderTop"),borderBlockStart:B.borders("borderBlockStart"),borderTopLeftRadius:B.radii("borderTopLeftRadius"),borderStartStartRadius:B.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:B.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:B.radii("borderTopRightRadius"),borderStartEndRadius:B.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:B.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:B.borders("borderRight"),borderInlineEnd:B.borders("borderInlineEnd"),borderBottom:B.borders("borderBottom"),borderBlockEnd:B.borders("borderBlockEnd"),borderBottomLeftRadius:B.radii("borderBottomLeftRadius"),borderBottomRightRadius:B.radii("borderBottomRightRadius"),borderLeft:B.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:B.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:B.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:B.borders(["borderLeft","borderRight"]),borderInline:B.borders("borderInline"),borderY:B.borders(["borderTop","borderBottom"]),borderBlock:B.borders("borderBlock"),borderTopWidth:B.borderWidths("borderTopWidth"),borderBlockStartWidth:B.borderWidths("borderBlockStartWidth"),borderTopColor:B.colors("borderTopColor"),borderBlockStartColor:B.colors("borderBlockStartColor"),borderTopStyle:B.borderStyles("borderTopStyle"),borderBlockStartStyle:B.borderStyles("borderBlockStartStyle"),borderBottomWidth:B.borderWidths("borderBottomWidth"),borderBlockEndWidth:B.borderWidths("borderBlockEndWidth"),borderBottomColor:B.colors("borderBottomColor"),borderBlockEndColor:B.colors("borderBlockEndColor"),borderBottomStyle:B.borderStyles("borderBottomStyle"),borderBlockEndStyle:B.borderStyles("borderBlockEndStyle"),borderLeftWidth:B.borderWidths("borderLeftWidth"),borderInlineStartWidth:B.borderWidths("borderInlineStartWidth"),borderLeftColor:B.colors("borderLeftColor"),borderInlineStartColor:B.colors("borderInlineStartColor"),borderLeftStyle:B.borderStyles("borderLeftStyle"),borderInlineStartStyle:B.borderStyles("borderInlineStartStyle"),borderRightWidth:B.borderWidths("borderRightWidth"),borderInlineEndWidth:B.borderWidths("borderInlineEndWidth"),borderRightColor:B.colors("borderRightColor"),borderInlineEndColor:B.colors("borderInlineEndColor"),borderRightStyle:B.borderStyles("borderRightStyle"),borderInlineEndStyle:B.borderStyles("borderInlineEndStyle"),borderTopRadius:B.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:B.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:B.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:B.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(He,{rounded:He.borderRadius,roundedTop:He.borderTopRadius,roundedTopLeft:He.borderTopLeftRadius,roundedTopRight:He.borderTopRightRadius,roundedTopStart:He.borderStartStartRadius,roundedTopEnd:He.borderStartEndRadius,roundedBottom:He.borderBottomRadius,roundedBottomLeft:He.borderBottomLeftRadius,roundedBottomRight:He.borderBottomRightRadius,roundedBottomStart:He.borderEndStartRadius,roundedBottomEnd:He.borderEndEndRadius,roundedLeft:He.borderLeftRadius,roundedRight:He.borderRightRadius,roundedStart:He.borderInlineStartRadius,roundedEnd:He.borderInlineEndRadius,borderStart:He.borderInlineStart,borderEnd:He.borderInlineEnd,borderTopStartRadius:He.borderStartStartRadius,borderTopEndRadius:He.borderStartEndRadius,borderBottomStartRadius:He.borderEndStartRadius,borderBottomEndRadius:He.borderEndEndRadius,borderStartRadius:He.borderInlineStartRadius,borderEndRadius:He.borderInlineEndRadius,borderStartWidth:He.borderInlineStartWidth,borderEndWidth:He.borderInlineEndWidth,borderStartColor:He.borderInlineStartColor,borderEndColor:He.borderInlineEndColor,borderStartStyle:He.borderInlineStartStyle,borderEndStyle:He.borderInlineEndStyle});var e8={color:B.colors("color"),textColor:B.colors("color"),fill:B.colors("fill"),stroke:B.colors("stroke")},dy={boxShadow:B.shadows("boxShadow"),mixBlendMode:!0,blendMode:B.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:B.prop("backgroundBlendMode"),opacity:!0};Object.assign(dy,{shadow:dy.boxShadow});var t8={filter:{transform:Fe.filter},blur:B.blur("--chakra-blur"),brightness:B.propT("--chakra-brightness",Fe.brightness),contrast:B.propT("--chakra-contrast",Fe.contrast),hueRotate:B.degreeT("--chakra-hue-rotate"),invert:B.propT("--chakra-invert",Fe.invert),saturate:B.propT("--chakra-saturate",Fe.saturate),dropShadow:B.propT("--chakra-drop-shadow",Fe.dropShadow),backdropFilter:{transform:Fe.backdropFilter},backdropBlur:B.blur("--chakra-backdrop-blur"),backdropBrightness:B.propT("--chakra-backdrop-brightness",Fe.brightness),backdropContrast:B.propT("--chakra-backdrop-contrast",Fe.contrast),backdropHueRotate:B.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:B.propT("--chakra-backdrop-invert",Fe.invert),backdropSaturate:B.propT("--chakra-backdrop-saturate",Fe.saturate)},ch={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Fe.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:B.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:B.space("gap"),rowGap:B.space("rowGap"),columnGap:B.space("columnGap")};Object.assign(ch,{flexDir:ch.flexDirection});var UE={gridGap:B.space("gridGap"),gridColumnGap:B.space("gridColumnGap"),gridRowGap:B.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},n8={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Fe.outline},outlineOffset:!0,outlineColor:B.colors("outlineColor")},lr={width:B.sizesT("width"),inlineSize:B.sizesT("inlineSize"),height:B.sizes("height"),blockSize:B.sizes("blockSize"),boxSize:B.sizes(["width","height"]),minWidth:B.sizes("minWidth"),minInlineSize:B.sizes("minInlineSize"),minHeight:B.sizes("minHeight"),minBlockSize:B.sizes("minBlockSize"),maxWidth:B.sizes("maxWidth"),maxInlineSize:B.sizes("maxInlineSize"),maxHeight:B.sizes("maxHeight"),maxBlockSize:B.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,hideFrom:{scale:"breakpoints",transform:(t,e)=>{var n,r,i;return{[(i=(r=(n=e.__breakpoints)==null?void 0:n.get(t))==null?void 0:r.minWQuery)!=null?i:`@media screen and (min-width: ${t})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(t,e)=>{var n,r,i;return{[(i=(r=(n=e.__breakpoints)==null?void 0:n.get(t))==null?void 0:r.maxWQuery)!=null?i:`@media screen and (max-width: ${t})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:B.propT("float",Fe.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(lr,{w:lr.width,h:lr.height,minW:lr.minWidth,maxW:lr.maxWidth,minH:lr.minHeight,maxH:lr.maxHeight,overscroll:lr.overscrollBehavior,overscrollX:lr.overscrollBehaviorX,overscrollY:lr.overscrollBehaviorY});var r8={listStyleType:!0,listStylePosition:!0,listStylePos:B.prop("listStylePosition"),listStyleImage:!0,listStyleImg:B.prop("listStyleImage")};function i8(t,e,n,r){const i=typeof e=="string"?e.split("."):[e];for(r=0;r<i.length&&t;r+=1)t=t[i[r]];return t===void 0?n:t}var a8=t=>{const e=new WeakMap;return(r,i,a,s)=>{if(typeof r>"u")return t(r,i,a);e.has(r)||e.set(r,new Map);const u=e.get(r);if(u.has(i))return u.get(i);const c=t(r,i,a,s);return u.set(i,c),c}},o8=a8(i8),s8={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},l8={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Nm=(t,e,n)=>{const r={},i=o8(t,e,{});for(const a in i)a in n&&n[a]!=null||(r[a]=i[a]);return r},u8={srOnly:{transform(t){return t===!0?s8:t==="focusable"?l8:{}}},layerStyle:{processResult:!0,transform:(t,e,n)=>Nm(e,`layerStyles.${t}`,n)},textStyle:{processResult:!0,transform:(t,e,n)=>Nm(e,`textStyles.${t}`,n)},apply:{processResult:!0,transform:(t,e,n)=>Nm(e,t,n)}},Su={position:!0,pos:B.prop("position"),zIndex:B.prop("zIndex","zIndices"),inset:B.spaceT("inset"),insetX:B.spaceT(["left","right"]),insetInline:B.spaceT("insetInline"),insetY:B.spaceT(["top","bottom"]),insetBlock:B.spaceT("insetBlock"),top:B.spaceT("top"),insetBlockStart:B.spaceT("insetBlockStart"),bottom:B.spaceT("bottom"),insetBlockEnd:B.spaceT("insetBlockEnd"),left:B.spaceT("left"),insetInlineStart:B.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:B.spaceT("right"),insetInlineEnd:B.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Su,{insetStart:Su.insetInlineStart,insetEnd:Su.insetInlineEnd});var c8={ring:{transform:Fe.ring},ringColor:B.colors("--chakra-ring-color"),ringOffset:B.prop("--chakra-ring-offset-width"),ringOffsetColor:B.colors("--chakra-ring-offset-color"),ringInset:B.prop("--chakra-ring-inset")},st={margin:B.spaceT("margin"),marginTop:B.spaceT("marginTop"),marginBlockStart:B.spaceT("marginBlockStart"),marginRight:B.spaceT("marginRight"),marginInlineEnd:B.spaceT("marginInlineEnd"),marginBottom:B.spaceT("marginBottom"),marginBlockEnd:B.spaceT("marginBlockEnd"),marginLeft:B.spaceT("marginLeft"),marginInlineStart:B.spaceT("marginInlineStart"),marginX:B.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:B.spaceT("marginInline"),marginY:B.spaceT(["marginTop","marginBottom"]),marginBlock:B.spaceT("marginBlock"),padding:B.space("padding"),paddingTop:B.space("paddingTop"),paddingBlockStart:B.space("paddingBlockStart"),paddingRight:B.space("paddingRight"),paddingBottom:B.space("paddingBottom"),paddingBlockEnd:B.space("paddingBlockEnd"),paddingLeft:B.space("paddingLeft"),paddingInlineStart:B.space("paddingInlineStart"),paddingInlineEnd:B.space("paddingInlineEnd"),paddingX:B.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:B.space("paddingInline"),paddingY:B.space(["paddingTop","paddingBottom"]),paddingBlock:B.space("paddingBlock")};Object.assign(st,{m:st.margin,mt:st.marginTop,mr:st.marginRight,me:st.marginInlineEnd,marginEnd:st.marginInlineEnd,mb:st.marginBottom,ml:st.marginLeft,ms:st.marginInlineStart,marginStart:st.marginInlineStart,mx:st.marginX,my:st.marginY,p:st.padding,pt:st.paddingTop,py:st.paddingY,px:st.paddingX,pb:st.paddingBottom,pl:st.paddingLeft,ps:st.paddingInlineStart,paddingStart:st.paddingInlineStart,pr:st.paddingRight,pe:st.paddingInlineEnd,paddingEnd:st.paddingInlineEnd});var f8={textDecorationColor:B.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:B.shadows("textShadow")},d8={clipPath:!0,transform:B.propT("transform",Fe.transform),transformOrigin:!0,translateX:B.spaceT("--chakra-translate-x"),translateY:B.spaceT("--chakra-translate-y"),skewX:B.degreeT("--chakra-skew-x"),skewY:B.degreeT("--chakra-skew-y"),scaleX:B.prop("--chakra-scale-x"),scaleY:B.prop("--chakra-scale-y"),scale:B.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:B.degreeT("--chakra-rotate")},h8={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:B.prop("transitionDuration","transition.duration"),transitionProperty:B.prop("transitionProperty","transition.property"),transitionTimingFunction:B.prop("transitionTimingFunction","transition.easing")},p8={fontFamily:B.prop("fontFamily","fonts"),fontSize:B.prop("fontSize","fontSizes",Fe.px),fontWeight:B.prop("fontWeight","fontWeights"),lineHeight:B.prop("lineHeight","lineHeights"),letterSpacing:B.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(t){if(t===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},g8={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:B.spaceT("scrollMargin"),scrollMarginTop:B.spaceT("scrollMarginTop"),scrollMarginBottom:B.spaceT("scrollMarginBottom"),scrollMarginLeft:B.spaceT("scrollMarginLeft"),scrollMarginRight:B.spaceT("scrollMarginRight"),scrollMarginX:B.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:B.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:B.spaceT("scrollPadding"),scrollPaddingTop:B.spaceT("scrollPaddingTop"),scrollPaddingBottom:B.spaceT("scrollPaddingBottom"),scrollPaddingLeft:B.spaceT("scrollPaddingLeft"),scrollPaddingRight:B.spaceT("scrollPaddingRight"),scrollPaddingX:B.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:B.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function jE(t){return zr(t)&&t.reference?t.reference:String(t)}var ap=(t,...e)=>e.map(jE).join(` ${t} `).replace(/calc/g,""),n2=(...t)=>`calc(${ap("+",...t)})`,r2=(...t)=>`calc(${ap("-",...t)})`,hy=(...t)=>`calc(${ap("*",...t)})`,i2=(...t)=>`calc(${ap("/",...t)})`,a2=t=>{const e=jE(t);return e!=null&&!Number.isNaN(parseFloat(e))?String(e).startsWith("-")?String(e).slice(1):`-${e}`:hy(e,-1)},eo=Object.assign(t=>({add:(...e)=>eo(n2(t,...e)),subtract:(...e)=>eo(r2(t,...e)),multiply:(...e)=>eo(hy(t,...e)),divide:(...e)=>eo(i2(t,...e)),negate:()=>eo(a2(t)),toString:()=>t.toString()}),{add:n2,subtract:r2,multiply:hy,divide:i2,negate:a2});function m8(t,e="-"){return t.replace(/\s+/g,e)}function v8(t){const e=m8(t.toString());return S8(y8(e))}function y8(t){return t.includes("\\.")?t:!Number.isInteger(parseFloat(t.toString()))?t.replace(".","\\."):t}function S8(t){return t.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function _8(t,e=""){return[e,t].filter(Boolean).join("-")}function w8(t,e){return`var(${t}${e?`, ${e}`:""})`}function b8(t,e=""){return v8(`--${_8(t,e)}`)}function C8(t,e,n){const r=b8(t,n);return{variable:r,reference:w8(r,e)}}function x8(t){const e=t==null?0:t.length;return e?t[e-1]:void 0}function k8(t){const e=parseFloat(t.toString()),n=t.toString().replace(String(e),"");return{unitless:!n,value:e,unit:n}}function py(t){if(t==null)return t;const{unitless:e}=k8(t);return e||typeof t=="number"?`${t}px`:t}var HE=(t,e)=>parseInt(t[1],10)>parseInt(e[1],10)?1:-1,U0=t=>Object.fromEntries(Object.entries(t).sort(HE));function o2(t){const e=U0(t);return Object.assign(Object.values(e),e)}function E8(t){const e=Object.keys(U0(t));return new Set(e)}function s2(t){var e;if(!t)return t;t=(e=py(t))!=null?e:t;const n=-.02;return typeof t=="number"?`${t+n}`:t.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function au(t,e){const n=["@media screen"];return t&&n.push("and",`(min-width: ${py(t)})`),e&&n.push("and",`(max-width: ${py(e)})`),n.join(" ")}function P8(t){var e;if(!t)return null;t.base=(e=t.base)!=null?e:"0px";const n=o2(t),r=Object.entries(t).sort(HE).map(([s,u],c,f)=>{var h;let[,p]=(h=f[c+1])!=null?h:[];return p=parseFloat(p)>0?s2(p):void 0,{_minW:s2(u),breakpoint:s,minW:u,maxW:p,maxWQuery:au(null,p),minWQuery:au(u),minMaxQuery:au(u,p)}}),i=E8(t),a=Array.from(i.values());return{keys:i,normalized:n,isResponsive(s){const u=Object.keys(s);return u.length>0&&u.every(c=>i.has(c))},asObject:U0(t),asArray:o2(t),details:r,get(s){return r.find(u=>u.breakpoint===s)},media:[null,...n.map(s=>au(s)).slice(1)],toArrayValue(s){if(!zr(s))throw new Error("toArrayValue: value must be an object");const u=a.map(c=>{var f;return(f=s[c])!=null?f:null});for(;x8(u)===null;)u.pop();return u},toObjectValue(s){if(!Array.isArray(s))throw new Error("toObjectValue: value must be an array");return s.reduce((u,c,f)=>{const h=a[f];return h!=null&&c!=null&&(u[h]=c),u},{})}}}var Qt={hover:(t,e)=>`${t}:hover ${e}, ${t}[data-hover] ${e}`,focus:(t,e)=>`${t}:focus ${e}, ${t}[data-focus] ${e}`,focusVisible:(t,e)=>`${t}:focus-visible ${e}`,focusWithin:(t,e)=>`${t}:focus-within ${e}`,active:(t,e)=>`${t}:active ${e}, ${t}[data-active] ${e}`,disabled:(t,e)=>`${t}:disabled ${e}, ${t}[data-disabled] ${e}`,invalid:(t,e)=>`${t}:invalid ${e}, ${t}[data-invalid] ${e}`,checked:(t,e)=>`${t}:checked ${e}, ${t}[data-checked] ${e}`,indeterminate:(t,e)=>`${t}:indeterminate ${e}, ${t}[aria-checked=mixed] ${e}, ${t}[data-indeterminate] ${e}`,readOnly:(t,e)=>`${t}:read-only ${e}, ${t}[readonly] ${e}, ${t}[data-read-only] ${e}`,expanded:(t,e)=>`${t}:read-only ${e}, ${t}[aria-expanded=true] ${e}, ${t}[data-expanded] ${e}`,placeholderShown:(t,e)=>`${t}:placeholder-shown ${e}`},la=t=>WE(e=>t(e,"&"),"[role=group]","[data-group]",".group"),Ai=t=>WE(e=>t(e,"~ &"),"[data-peer]",".peer"),WE=(t,...e)=>e.map(t).join(", "),op={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:la(Qt.hover),_peerHover:Ai(Qt.hover),_groupFocus:la(Qt.focus),_peerFocus:Ai(Qt.focus),_groupFocusVisible:la(Qt.focusVisible),_peerFocusVisible:Ai(Qt.focusVisible),_groupActive:la(Qt.active),_peerActive:Ai(Qt.active),_groupDisabled:la(Qt.disabled),_peerDisabled:Ai(Qt.disabled),_groupInvalid:la(Qt.invalid),_peerInvalid:Ai(Qt.invalid),_groupChecked:la(Qt.checked),_peerChecked:Ai(Qt.checked),_groupFocusWithin:la(Qt.focusWithin),_peerFocusWithin:Ai(Qt.focusWithin),_peerPlaceholderShown:Ai(Qt.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},O8=Object.keys(op);function l2(t,e){return C8(String(t).replace(/\./g,"-"),void 0,e)}function T8(t,e){let n={};const r={};for(const[i,a]of Object.entries(t)){const{isSemantic:s,value:u}=a,{variable:c,reference:f}=l2(i,e==null?void 0:e.cssVarPrefix);if(!s){if(i.startsWith("space")){const g=i.split("."),[y,...v]=g,w=`${y}.-${v.join(".")}`,x=eo.negate(u),_=eo.negate(f);r[w]={value:x,var:c,varRef:_}}n[c]=u,r[i]={value:u,var:c,varRef:f};continue}const h=g=>{const v=[String(i).split(".")[0],g].join(".");if(!t[v])return g;const{reference:x}=l2(v,e==null?void 0:e.cssVarPrefix);return x},p=zr(u)?u:{default:u};n=ai(n,Object.entries(p).reduce((g,[y,v])=>{var w,x;const _=h(v);if(y==="default")return g[c]=_,g;const S=(x=(w=op)==null?void 0:w[y])!=null?x:y;return g[S]={[c]:_},g},{})),r[i]={value:f,var:c,varRef:f}}return{cssVars:n,cssMap:r}}function R8(t,e=[]){const n=Object.assign({},t);for(const r of e)r in n&&delete n[r];return n}function A8(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}var I8=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function L8(t){return A8(t,I8)}function M8(t){return t.semanticTokens}function D8(t){const{__cssMap:e,__cssVars:n,__breakpoints:r,...i}=t;return i}function N8({tokens:t,semanticTokens:e}){var n,r;const i=Object.entries((n=gy(t))!=null?n:{}).map(([s,u])=>[s,{isSemantic:!1,value:u}]),a=Object.entries((r=gy(e,1))!=null?r:{}).map(([s,u])=>[s,{isSemantic:!0,value:u}]);return Object.fromEntries([...i,...a])}function gy(t,e=1/0){return!zr(t)&&!Array.isArray(t)||!e?t:Object.entries(t).reduce((n,[r,i])=>(zr(i)||Array.isArray(i)?Object.entries(gy(i,e-1)).forEach(([a,s])=>{n[`${r}.${a}`]=s}):n[r]=i,n),{})}function nW(t){var e;const n=D8(t),r=L8(n),i=M8(n),a=N8({tokens:r,semanticTokens:i}),s=(e=n.config)==null?void 0:e.cssVarPrefix,{cssMap:u,cssVars:c}=T8(a,{cssVarPrefix:s});return Object.assign(n,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...c},__cssMap:u,__breakpoints:P8(n.breakpoints)}),n}var j0=ai({},Cd,He,e8,ch,lr,t8,c8,n8,UE,u8,Su,dy,st,g8,p8,f8,d8,r8,h8),B8=Object.assign({},st,lr,ch,UE,Su),rW=Object.keys(B8),F8=[...Object.keys(j0),...O8],$8={...j0,...op},z8=t=>t in $8,G8=t=>e=>{if(!e.__breakpoints)return t;const{isResponsive:n,toArrayValue:r,media:i}=e.__breakpoints,a={};for(const s in t){let u=io(t[s],e);if(u==null)continue;if(u=zr(u)&&n(u)?r(u):u,!Array.isArray(u)){a[s]=u;continue}const c=u.slice(0,i.length).length;for(let f=0;f<c;f+=1){const h=i==null?void 0:i[f];if(!h){a[s]=u[f];continue}a[h]=a[h]||{},u[f]!=null&&(a[h][s]=u[f])}}return a};function U8(t){const e=[];let n="",r=!1;for(let i=0;i<t.length;i++){const a=t[i];a==="("?(r=!0,n+=a):a===")"?(r=!1,n+=a):a===","&&!r?(e.push(n),n=""):n+=a}return n=n.trim(),n&&e.push(n),e}function j8(t){return/^var\(--.+\)$/.test(t)}var H8=(t,e)=>t.startsWith("--")&&typeof e=="string"&&!j8(e),W8=(t,e)=>{var n,r;if(e==null)return e;const i=c=>{var f,h;return(h=(f=t.__cssMap)==null?void 0:f[c])==null?void 0:h.varRef},a=c=>{var f;return(f=i(c))!=null?f:c},[s,u]=U8(e);return e=(r=(n=i(s))!=null?n:a(u))!=null?r:a(e),e};function V8(t){const{configs:e={},pseudos:n={},theme:r}=t,i=(a,s=!1)=>{var u,c,f;const h=io(a,r),p=G8(h)(r);let g={};for(let y in p){const v=p[y];let w=io(v,r);y in n&&(y=n[y]),H8(y,w)&&(w=W8(r,w));let x=e[y];if(x===!0&&(x={property:y}),zr(w)){g[y]=(u=g[y])!=null?u:{},g[y]=ai({},g[y],i(w,!0));continue}let _=(f=(c=x==null?void 0:x.transform)==null?void 0:c.call(x,w,r,h))!=null?f:w;_=x!=null&&x.processResult?i(_,!0):_;const S=io(x==null?void 0:x.property,r);if(!s&&(x!=null&&x.static)){const C=io(x.static,r);g=ai({},g,C)}if(S&&Array.isArray(S)){for(const C of S)g[C]=_;continue}if(S){S==="&"&&zr(_)?g=ai({},g,_):g[S]=_;continue}if(zr(_)){g=ai({},g,_);continue}g[y]=_}return g};return i}var q8=t=>e=>V8({theme:e,pseudos:op,configs:j0})(t);function iW(t){return t}function aW(t){return t}function oW(t){return{definePartsStyle(e){return e},defineMultiStyleConfig(e){return{parts:t,...e}}}}function K8(t,e){if(Array.isArray(t))return t;if(zr(t))return e(t);if(t!=null)return[t]}function Y8(t,e){for(let n=e+1;n<t.length;n++)if(t[n]!=null)return n;return-1}function X8(t){const e=t.__breakpoints;return function(r,i,a,s){var u,c;if(!e)return;const f={},h=K8(a,e.toArrayValue);if(!h)return f;const p=h.length,g=p===1,y=!!r.parts;for(let v=0;v<p;v++){const w=e.details[v],x=e.details[Y8(h,v)],_=au(w.minW,x==null?void 0:x._minW),S=io((u=r[i])==null?void 0:u[h[v]],s);if(S){if(y){(c=r.parts)==null||c.forEach(C=>{ai(f,{[C]:g?S[C]:{[_]:S[C]}})});continue}if(!y){g?ai(f,S):f[_]=S;continue}f[_]=S}}return f}}function Q8(t){return e=>{var n;const{variant:r,size:i,theme:a}=e,s=X8(a);return ai({},io((n=t.baseStyle)!=null?n:{},e),s(t,"sizes",i,e),s(t,"variants",r,e))}}function sW(t,e,n){var r,i,a;return(a=(i=(r=t.__cssMap)==null?void 0:r[`${e}.${n}`])==null?void 0:i.varRef)!=null?a:n}function VE(t){return R8(t,["styleConfig","size","variant","colorScheme"])}function J8(t,e){const n={};return Object.keys(t).forEach(r=>{e.includes(r)||(n[r]=t[r])}),n}function Z8(t,e,n,r){const i=typeof e=="string"?e.split("."):[e];for(r=0;r<i.length&&t;r+=1)t=t[i[r]];return t===void 0?n:t}var eG=t=>{const e=new WeakMap;return(r,i,a,s)=>{if(typeof r>"u")return t(r,i,a);e.has(r)||e.set(r,new Map);const u=e.get(r);if(u.has(i))return u.get(i);const c=t(r,i,a,s);return u.set(i,c),c}},tG=eG(Z8);function qE(t,e){const n={};return Object.keys(t).forEach(r=>{const i=t[r];e(i,r,t)&&(n[r]=i)}),n}var KE=t=>qE(t,e=>e!=null);function nG(t){return typeof t=="function"}function rG(t,...e){return nG(t)?t(...e):t}function lW(...t){return function(n){t.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var iG=typeof Element<"u",aG=typeof Map=="function",oG=typeof Set=="function",sG=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function xd(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!xd(t[r],e[r]))return!1;return!0}var a;if(aG&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(r=a.next()).done;)if(!e.has(r.value[0]))return!1;for(a=t.entries();!(r=a.next()).done;)if(!xd(r.value[1],e.get(r.value[0])))return!1;return!0}if(oG&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(r=a.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(sG&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(iG&&t instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&t.$$typeof)&&!xd(t[i[r]],e[i[r]]))return!1;return!0}return t!==t&&e!==e}var lG=function(e,n){try{return xd(e,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};function YE(t,e={}){var n;const{styleConfig:r,...i}=e,{theme:a,colorMode:s}=M6(),u=t?tG(a,`components.${t}`):void 0,c=r||u,f=ai({theme:a,colorMode:s},(n=c==null?void 0:c.defaultProps)!=null?n:{},KE(J8(i,["children"]))),h=be.useRef({});if(c){const g=Q8(c)(f);lG(h.current,g)||(h.current=g)}return h.current}function XE(t,e={}){return YE(t,e)}function uW(t,e={}){return YE(t,e)}var uG=new Set([...F8,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),cG=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function fG(t){return cG.has(t)||!uG.has(t)}function dG(t){const e=Object.assign({},t);for(let n in e)e[n]===void 0&&delete e[n];return e}function hG(t,...e){if(t==null)throw new TypeError("Cannot convert undefined or null to object");const n={...t};for(const r of e)if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(i in n&&delete n[i],n[i]=r[i]);return n}var pG=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,gG=OE(function(t){return pG.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91}),mG=gG,vG=function(e){return e!=="theme"},u2=function(e){return typeof e=="string"&&e.charCodeAt(0)>96?mG:vG},c2=function(e,n,r){var i;if(n){var a=n.shouldForwardProp;i=e.__emotion_forwardProp&&a?function(s){return e.__emotion_forwardProp(s)&&a(s)}:a}return typeof i!="function"&&r&&(i=e.__emotion_forwardProp),i},yG=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return RE(n,r,i),O6(function(){return AE(n,r,i)}),null},SG=function t(e,n){var r=e.__emotion_real===e,i=r&&e.__emotion_base||e,a,s;n!==void 0&&(a=n.label,s=n.target);var u=c2(e,n,r),c=u||u2(i),f=!c("as");return function(){var h=arguments,p=r&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(a!==void 0&&p.push("label:"+a+";"),h[0]==null||h[0].raw===void 0)p.push.apply(p,h);else{p.push(h[0][0]);for(var g=h.length,y=1;y<g;y++)p.push(h[y],h[0][y])}var v=DE(function(w,x,_){var S=f&&w.as||i,C="",O=[],I=w;if(w.theme==null){I={};for(var L in w)I[L]=w[L];I.theme=be.useContext(qu)}typeof w.className=="string"?C=w6(x.registered,O,w.className):w.className!=null&&(C=w.className+" ");var D=z0(p.concat(O),x.registered,I);C+=x.key+"-"+D.name,s!==void 0&&(C+=" "+s);var U=f&&u===void 0?u2(S):c,X={};for(var K in w)f&&K==="as"||U(K)&&(X[K]=w[K]);return X.className=C,X.ref=_,be.createElement(be.Fragment,null,be.createElement(yG,{cache:x,serialized:D,isStringTag:typeof S=="string"}),be.createElement(S,X))});return v.displayName=a!==void 0?a:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",v.defaultProps=e.defaultProps,v.__emotion_real=v,v.__emotion_base=i,v.__emotion_styles=p,v.__emotion_forwardProp=u,Object.defineProperty(v,"toString",{value:function(){return"."+s}}),v.withComponent=function(w,x){return t(w,Xd({},n,x,{shouldForwardProp:c2(v,x,!0)})).apply(void 0,p)},v}},_G=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],fh=SG.bind();_G.forEach(function(t){fh[t]=fh(t)});var f2,wG=(f2=fh.default)!=null?f2:fh,bG=({baseStyle:t})=>e=>{const{theme:n,css:r,__css:i,sx:a,...s}=e,u=qE(s,(p,g)=>z8(g)),c=rG(t,e),f=hG({},i,c,KE(u),a),h=q8(f)(e.theme);return r?[h,r]:h};function Bm(t,e){const{baseStyle:n,...r}=e??{};r.shouldForwardProp||(r.shouldForwardProp=fG);const i=bG({baseStyle:n}),a=wG(t,r)(i);return As.forwardRef(function(c,f){const{colorMode:h,forced:p}=BE();return As.createElement(a,{ref:f,"data-theme":p?h:void 0,...c})})}function CG(){const t=new Map;return new Proxy(Bm,{apply(e,n,r){return Bm(...r)},get(e,n){return t.has(n)||t.set(n,Bm(n)),t.get(n)}})}var dh=CG();function H0(t){return be.forwardRef(t)}var xG=I6({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),QE=H0((t,e)=>{const n=XE("Spinner",t),{label:r="Loading...",thickness:i="2px",speed:a="0.45s",emptyColor:s="transparent",className:u,...c}=VE(t),f=FE("chakra-spinner",u),h={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:s,borderLeftColor:s,animation:`${xG} ${a} linear infinite`,...n};return jt.jsx(dh.div,{ref:e,__css:h,className:f,...c,children:r&&jt.jsx(dh.span,{srOnly:!0,children:r})})});QE.displayName="Spinner";var JE=H0(function(e,n){const r=XE("Text",e),{className:i,align:a,decoration:s,casing:u,...c}=VE(e),f=dG({textAlign:e.align,textDecoration:e.decoration,textTransform:e.casing});return jt.jsx(dh.p,{ref:n,className:FE("chakra-text",e.className),...f,...c,__css:r})});JE.displayName="Text";var ZE=H0(function(e,n){const{direction:r,align:i,justify:a,wrap:s,basis:u,grow:c,shrink:f,...h}=e,p={display:"flex",flexDirection:r,alignItems:i,justifyContent:a,flexWrap:s,flexBasis:u,flexGrow:c,flexShrink:f};return jt.jsx(dh.div,{ref:n,__css:p,...h})});ZE.displayName="Flex";const d2=t=>{const{t:e}=sB(),{showText:n=!1,text:r=e("common.loadingInvokeAI")}=t;return jt.jsxs(ZE,{width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",bg:"#121212",flexDirection:"column",rowGap:4,children:[jt.jsx(QE,{color:"grey",w:"5rem",h:"5rem"}),n&&jt.jsx(JE,{color:"grey",fontWeight:"semibold",fontFamily:"'Inter', sans-serif",children:r})]})},kG=be.lazy(()=>Cx(()=>import("./App-5c94d6ff.js"),["./App-5c94d6ff.js","./scrollbar-af26543e.js","./App-06f6cac1.css"],import.meta.url)),EG=be.lazy(()=>Cx(()=>import("./ThemeLocaleProvider-2a8c2f39.js"),["./ThemeLocaleProvider-2a8c2f39.js","./scrollbar-af26543e.js"],import.meta.url));function PG(){return jt.jsx(As.StrictMode,{children:jt.jsx(K3,{store:wE,children:jt.jsx(Ix,{loading:jt.jsx(d2,{}),persistor:Wz,children:jt.jsx(As.Suspense,{fallback:jt.jsx(d2,{showText:!0}),children:jt.jsx(EG,{children:jt.jsx(kG,{})})})})})})}Fm.createRoot(document.getElementById("root")).render(jt.jsx(PG,{}));export{hj as $,qf as A,Tf as B,gU as C,M5 as D,sB as E,ZE as F,RH as G,Wj as H,Hj as I,jj as J,Jj as K,Zj as L,Qj as M,Pw as N,$H as O,rH as P,hd as Q,As as R,QE as S,JE as T,TH as U,P5 as V,wj as W,bj as X,lj as Y,pH as Z,Xd as _,FE as a,vH as a$,Tj as a0,BH as a1,FH as a2,_H as a3,pU as a4,_u as a5,OG as a6,rU as a7,dj as a8,XU as a9,zH as aA,hH as aB,dH as aC,T5 as aD,uj as aE,NH as aF,SH as aG,I5 as aH,Xj as aI,zj as aJ,Gj as aK,$j as aL,Lj as aM,xz as aN,cF as aO,uF as aP,Yj as aQ,Ij as aR,Bj as aS,OH as aT,yj as aU,EH as aV,kH as aW,PH as aX,iH as aY,Kj as aZ,mH as a_,ej as aa,rj as ab,oj as ac,tj as ad,aj as ae,nj as af,ij as ag,sj as ah,ZU as ai,Wb as aj,JU as ak,QU as al,Dj as am,_j as an,Cj as ao,Mj as ap,gj as aq,Ow as ar,Rj as as,kj as at,Vj as au,Fj as av,mj as aw,D5 as ax,vj as ay,Aj as az,eW as b,eU as b$,yH as b0,qj as b1,$m as b2,p2 as b3,pe as b4,Lb as b5,bU as b6,UU as b7,GU as b8,tU as b9,$U as bA,qH as bB,KG as bC,aU as bD,oU as bE,Of as bF,va as bG,CU as bH,wU as bI,yU as bJ,LG as bK,MG as bL,LH as bM,MH as bN,fU as bO,iU as bP,ZG as bQ,qU as bR,cH as bS,If as bT,ei as bU,zl as bV,Ae as bW,EU as bX,ns as bY,DG as bZ,xU as b_,IU as ba,HU as bb,DH as bc,WG as bd,vU as be,Vl as bf,dU as bg,VG as bh,bz as bi,mU as bj,UG as bk,hU as bl,jG as bm,XG as bn,RG as bo,AG as bp,IG as bq,jU as br,Jx as bs,BG as bt,FG as bu,$G as bv,zU as bw,JG as bx,QG as by,qG as bz,dh as c,nU as c0,GG as c1,zG as c2,KH as c3,HG as c4,FU as c5,PU as c6,OU as c7,DU as c8,cU as c9,jH as cA,WH as cB,AH as cC,eH as cD,aH as cE,wH as cF,CH as cG,lH as cH,Wz as cI,sH as cJ,gH as cK,uH as cL,XH as cM,NE as cN,iW as cO,oW as cP,C8 as cQ,aW as cR,ai as cS,nW as cT,YH as cU,BE as cV,tG as cW,q8 as cX,Yd as cY,O3 as cZ,TG as c_,uU as ca,kU as cb,YU as cc,AU as cd,TU as ce,BU as cf,NG as cg,L5 as ch,Nj as ci,KU as cj,lU as ck,xj as cl,Ej as cm,Pj as cn,Oj as co,tH as cp,oH as cq,HH as cr,UH as cs,GH as ct,bH as cu,mB as cv,vB as cw,xH as cx,VH as cy,fH as cz,uW as d,XE as e,H0 as f,JH as g,ZH as h,tW as i,jt as j,I6 as k,jv as l,Ur as m,rG as n,VE as o,lW as p,zr as q,be as r,L6 as s,io as t,M6 as u,rW as v,QH as w,sW as x,bk as y,_t as z};